diff --git a/radiantcore/entity/VertexInstance.h b/radiantcore/entity/VertexInstance.h index d806fa9afb..1e7b274ee3 100644 --- a/radiantcore/entity/VertexInstance.h +++ b/radiantcore/entity/VertexInstance.h @@ -1,6 +1,5 @@ #pragma once -#include "irender.h" #include "iregistry.h" #include "iselection.h" #include "iselectiontest.h" @@ -9,7 +8,6 @@ #include "EntitySettings.h" class VertexInstance : - public OpenGLRenderable, public ISelectable { protected: @@ -20,9 +18,6 @@ class VertexInstance : Vector3 _colour; - // Shader to use for the point - ShaderPtr _shader; - public: // Construct the instance with the given coordinates and connect the selectionChangeCallback VertexInstance(Vector3& vertex, const SelectionChangedSlot& observer) : @@ -31,18 +26,6 @@ class VertexInstance : _colour(entity::EntitySettings::InstancePtr()->getLightVertexColour(LightEditVertexType::Deselected)) {} - void setRenderSystem(const RenderSystemPtr& renderSystem) - { - if (renderSystem) - { - _shader = renderSystem->capture("$BIGPOINT"); - } - else - { - _shader.reset(); - } - } - void setVertex(const Vector3& vertex) { _vertex = vertex; } @@ -51,11 +34,6 @@ class VertexInstance : return _vertex; } - // Return the Shader for rendering - const ShaderPtr& getShader() const { - return _shader; - } - void setSelected(bool select) { _selectable.setSelected(select); // Change the colour according to the selection @@ -81,26 +59,7 @@ class VertexInstance : Selector_add(selector, *this, best); } } - - // Front-end render function - void render(IRenderableCollector& collector, - const VolumeTest& volume, - const Matrix4& localToWorld) const - { - collector.setHighlightFlag(IRenderableCollector::Highlight::Primitives, false); - collector.setHighlightFlag(IRenderableCollector::Highlight::Faces, false); - collector.addRenderable(*_shader, *this, localToWorld); - } - - // GL render function (backend) - virtual void render(const RenderInfo& info) const { - // Draw the center point - glBegin(GL_POINTS); - glColor3dv(_colour); - glVertex3dv(_vertex); - glEnd(); - } -}; // class VertexInstance +}; /* This is the vertexinstance class for the light_right and light_up vertex, as they * are calculated relatively to the light_target, which in turn is relative to the light origin @@ -114,11 +73,13 @@ class VertexInstanceRelative : public VertexInstance { _origin(origin) {} - const Vector3 getVertex() const { + const Vector3 getVertex() const override + { return _origin + _vertex; } - void testSelect(Selector& selector, SelectionTest& test) { + void testSelect(Selector& selector, SelectionTest& test) override + { SelectionIntersection best; Vector3 testVertex = _origin + _vertex; test.TestPoint(testVertex, best); @@ -128,4 +89,4 @@ class VertexInstanceRelative : public VertexInstance { Selector_add(selector, *this, best); } } -}; // class VertexInstanceRelative +}; diff --git a/radiantcore/entity/doom3group/StaticGeometryNode.cpp b/radiantcore/entity/doom3group/StaticGeometryNode.cpp index 15bfc0ba94..f0e4c78c5b 100644 --- a/radiantcore/entity/doom3group/StaticGeometryNode.cpp +++ b/radiantcore/entity/doom3group/StaticGeometryNode.cpp @@ -400,19 +400,6 @@ void StaticGeometryNode::setRenderSystem(const RenderSystemPtr& renderSystem) _pivotShader.reset(); _pointShader.reset(); } - - _originInstance.setRenderSystem(renderSystem); -} - -void StaticGeometryNode::renderComponents(IRenderableCollector& collector, const VolumeTest& volume) const -{ -#if 0 - if (!isModel() && GlobalSelectionSystem().ComponentMode() == selection::ComponentSelectionMode::Vertex) - { - // Register the renderable with OpenGL - _originInstance.render(collector, volume, localToWorld()); - } -#endif } void StaticGeometryNode::evaluateTransform() diff --git a/radiantcore/entity/doom3group/StaticGeometryNode.h b/radiantcore/entity/doom3group/StaticGeometryNode.h index 978b2431c6..04152002b2 100644 --- a/radiantcore/entity/doom3group/StaticGeometryNode.h +++ b/radiantcore/entity/doom3group/StaticGeometryNode.h @@ -137,8 +137,6 @@ class StaticGeometryNode : void renderHighlights(IRenderableCollector& collector, const VolumeTest& volume) override; void setRenderSystem(const RenderSystemPtr& renderSystem) override; - void renderComponents(IRenderableCollector& collector, const VolumeTest& volume) const override; - void transformComponents(const Matrix4& matrix); // Returns the original "origin" value