Skip to content

Commit

Permalink
Remove obsolete FaceInstance light storage
Browse files Browse the repository at this point in the history
Now that BrushNode is using the new addLitRenderable() method for renderable
submission, the internal light list maintained by FaceInstance is obsolete.
  • Loading branch information
Matthew Mott committed Oct 28, 2020
1 parent f55c0b5 commit d70d2c4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 33 deletions.
14 changes: 0 additions & 14 deletions radiant/brush/BrushNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,6 @@ bool BrushNode::intersectsLight(const RendererLight& light) const {
return light.intersectsAABB(worldAABB());
}

void BrushNode::insertLight(const RendererLight& light) {
const Matrix4& l2w = localToWorld();
for (FaceInstances::iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) {
i->addLight(l2w, light);
}
}

void BrushNode::clearLights() {
for (FaceInstances::const_iterator i = m_faceInstances.begin(); i != m_faceInstances.end(); ++i) {
i->m_lights.clear();
}
}

void BrushNode::renderComponents(RenderableCollector& collector, const VolumeTest& volume) const
{
m_brush.evaluateBRep();
Expand Down Expand Up @@ -454,7 +441,6 @@ void BrushNode::renderSolid(RenderableCollector& collector,
// Skip invisible faces before traversing further
if (!forceVisible && !faceInst.faceIsVisible()) continue;

//faceInst.renderSolid(collector, volume, *_renderEntity);
const Face& face = faceInst.getFace();
if (face.intersectVolume(volume))
{
Expand Down
2 changes: 0 additions & 2 deletions radiant/brush/BrushNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ class BrushNode :

// LitObject implementation
bool intersectsLight(const RendererLight& light) const override;
void insertLight(const RendererLight& light) override;
void clearLights() override;

// Renderable implementation
void renderComponents(RenderableCollector& collector, const VolumeTest& volume) const override;
Expand Down
13 changes: 0 additions & 13 deletions radiant/brush/FaceInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,19 +425,6 @@ void FaceInstance::connectivityChanged() {
m_selectableEdges.setSelected(false);
}

void FaceInstance::addLight(const Matrix4& localToWorld, const RendererLight& light)
{
const Plane3& facePlane = getFace().plane3();

Plane3 tmp = Plane3(facePlane.normal(), -facePlane.dist())
.transformed(localToWorld);

if (!tmp.testPoint(light.worldOrigin()) || !tmp.testPoint(light.getLightOrigin()))
{
m_lights.addLight(light);
}
}

void FaceInstance::updateFaceVisibility()
{
getFace().updateFaceVisibility();
Expand Down
4 changes: 0 additions & 4 deletions radiant/brush/FaceInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class FaceInstance
static FaceInstanceSet _selectedFaceInstances;

public:
mutable render::lib::VectorLightList m_lights;

FaceInstance(Face& face, const SelectionChangedSlot& observer);
FaceInstance(const FaceInstance& other);

Expand Down Expand Up @@ -144,8 +142,6 @@ class FaceInstance

void connectivityChanged();

void addLight(const Matrix4& localToWorld, const RendererLight& light);

bool faceIsVisible() const
{
return m_face->faceIsVisible();
Expand Down

0 comments on commit d70d2c4

Please sign in to comment.