Fixed bug that caused the application to crash when deleting or moving nodes in the Octree

Changes to the Octruee due to adding and updating object positions is now delayed until after the end of the frame
This commit is contained in:
2013-02-21 16:22:56 -08:00
parent 69506798c2
commit cd3627c3d3
8 changed files with 94 additions and 42 deletions

View File

@@ -18,8 +18,8 @@ class KRNode;
class KROctreeNode {
public:
KROctreeNode(const KRAABB &bounds);
KROctreeNode(const KRAABB &bounds, int iChild, KROctreeNode *pChild);
KROctreeNode(KROctreeNode *parent, const KRAABB &bounds);
KROctreeNode(KROctreeNode *parent, const KRAABB &bounds, int iChild, KROctreeNode *pChild);
~KROctreeNode();
KROctreeNode **getChildren();
@@ -31,9 +31,11 @@ public:
KRAABB getBounds();
KROctreeNode *getParent();
void setChildNode(int iChild, KROctreeNode *pChild);
int getChildIndex(KRNode *pNode);
KRAABB getChildBounds(int iChild);
void trim();
bool isEmpty() const;
bool canShrinkRoot() const;
@@ -53,6 +55,7 @@ private:
KRAABB m_bounds;
KROctreeNode *m_parent;
KROctreeNode *m_children[8];
std::set<KRNode *>m_sceneNodes;