Skip to content

Commit

Permalink
#5893: Remove LitObject interface
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Feb 13, 2022
1 parent 612eda2 commit 28d7959
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 34 deletions.
17 changes: 0 additions & 17 deletions include/irender.h
Expand Up @@ -264,23 +264,6 @@ inline std::ostream& operator<< (std::ostream& os, const RendererLight& l)
<< ", lightAABB=" << l.lightAABB() << ")";
}

/**
* \brief Interface for an object which can test its intersection with a
* RendererLight.
*
* Objects which implement this interface define a intersectsLight() function
* which determines whether the given light intersects the object.
*/
class LitObject
{
public:
virtual ~LitObject() {}

/// Test if the given light intersects the LitObject
virtual bool intersectsLight(const RendererLight& light) const = 0;
};
typedef std::shared_ptr<LitObject> LitObjectPtr;

class Renderable;
typedef std::function<void(Renderable&)> RenderableCallback;

Expand Down
2 changes: 0 additions & 2 deletions include/irenderable.h
Expand Up @@ -14,7 +14,6 @@ class OpenGLRenderable;
class Matrix4;
class IRenderEntity;
class RendererLight;
class LitObject;
class Renderable;
class VolumeTest;

Expand Down Expand Up @@ -74,7 +73,6 @@ class IRenderableCollector
virtual void addRenderable(Shader& shader,
const OpenGLRenderable& renderable,
const Matrix4& localToWorld,
const LitObject* litObject = nullptr,
const IRenderEntity* entity = nullptr) = 0;

/**
Expand Down
1 change: 0 additions & 1 deletion libs/render/CamRenderer.h
Expand Up @@ -55,7 +55,6 @@ class CamRenderer :
void addRenderable(Shader& shader,
const OpenGLRenderable& renderable,
const Matrix4& localToWorld,
const LitObject* litObject = nullptr,
const IRenderEntity* entity = nullptr) override
{
addHighlightRenderable(renderable, localToWorld);
Expand Down
5 changes: 0 additions & 5 deletions libs/scene/Node.cpp
Expand Up @@ -511,11 +511,6 @@ void Node::setRenderSystem(const RenderSystemPtr& renderSystem)
_children.setRenderSystem(renderSystem);
}

bool Node::intersectsLight(const RendererLight& light) const
{
return light.lightAABB().intersects(worldAABB());
}

void Node::setForcedVisibility(bool forceVisible, bool includeChildren)
{
bool wasVisible = visible();
Expand Down
8 changes: 1 addition & 7 deletions libs/scene/Node.h
Expand Up @@ -18,7 +18,7 @@ class Graph;
typedef std::weak_ptr<Graph> GraphWeakPtr;

/// Main implementation of INode
class Node: public LitObject, public virtual INode, public std::enable_shared_from_this<Node>
class Node : public virtual INode, public std::enable_shared_from_this<Node>
{
public:
enum {
Expand Down Expand Up @@ -194,12 +194,6 @@ class Node: public LitObject, public virtual INode, public std::enable_shared_fr
virtual RenderSystemPtr getRenderSystem() const;
void setRenderSystem(const RenderSystemPtr& renderSystem) override;

// Default LitObject::intersectsLight implementation, does a simple
// intersection check between this node's worldAABB and the light's
// lightAABB. Subclasses may override to provide more precise intersection
// tests if appropriate.
bool intersectsLight(const RendererLight& light) const override;

protected:
// Set the "forced visible" flag, only to be used internally by subclasses
virtual void setForcedVisibility(bool forceVisible, bool includeChildren) override;
Expand Down
1 change: 0 additions & 1 deletion radiant/xyview/XYRenderer.h
Expand Up @@ -41,7 +41,6 @@ class XYRenderer :
void addRenderable(Shader& shader,
const OpenGLRenderable& renderable,
const Matrix4& localToWorld,
const LitObject* /* litObject */,
const IRenderEntity* entity = nullptr) override
{
addHighlightRenderable(renderable, localToWorld);
Expand Down
1 change: 0 additions & 1 deletion test/Entity.cpp
Expand Up @@ -473,7 +473,6 @@ namespace

void addRenderable(Shader& shader, const OpenGLRenderable& renderable,
const Matrix4& localToWorld,
const LitObject* litObject = nullptr,
const IRenderEntity* entity = nullptr) override
{
++renderables;
Expand Down

0 comments on commit 28d7959

Please sign in to comment.