1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-24 18:39:59 +00:00

Prune empty quad tree nodes

This commit is contained in:
bzzt 2019-02-20 13:37:00 +00:00 committed by Capostrophic
parent aecbc2f01c
commit 4f387fdf1c

View File

@ -163,7 +163,10 @@ public:
boundingBox.expandBy(child->getBoundingBox()); boundingBox.expandBy(child->getBoundingBox());
} }
parent->setBoundingBox(boundingBox); if (!boundingBox.valid())
parent->removeChildren(0, 4);
else
parent->setBoundingBox(boundingBox);
} }
QuadTreeNode* addChild(QuadTreeNode* parent, ChildDirection direction, float size) QuadTreeNode* addChild(QuadTreeNode* parent, ChildDirection direction, float size)