Skip to content
Snippets Groups Projects
Commit 493cf89f authored by andreykproductengine's avatar andreykproductengine
Browse files

SL-6306 Viewer freeze and crash on octree

parent f46969fe
No related branches found
No related tags found
No related merge requests found
...@@ -401,7 +401,7 @@ class LLOctreeNode : public LLTreeNode<T> ...@@ -401,7 +401,7 @@ class LLOctreeNode : public LLTreeNode<T>
child->insert(data); child->insert(data);
} }
} }
else else if (parent)
{ {
//it's not in here, give it to the root //it's not in here, give it to the root
OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL; OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL;
...@@ -416,6 +416,13 @@ class LLOctreeNode : public LLTreeNode<T> ...@@ -416,6 +416,13 @@ class LLOctreeNode : public LLTreeNode<T>
node->insert(data); node->insert(data);
} }
else
{
// It's not in here, and we are root.
// LLOctreeRoot::insert() should have expanded
// root by now, something is wrong
OCT_ERRS << "Octree insertion failed! Root expansion failed." << LL_ENDL;
}
return false; return false;
} }
...@@ -763,10 +770,15 @@ class LLOctreeRoot : public LLOctreeNode<T> ...@@ -763,10 +770,15 @@ class LLOctreeRoot : public LLOctreeNode<T>
{ {
LLOctreeNode<T>::insert(data); LLOctreeNode<T>::insert(data);
} }
else else if (node->isInside(data->getPositionGroup()))
{ {
node->insert(data); node->insert(data);
} }
else
{
// calling node->insert(data) will return us to root
OCT_ERRS << "Failed to insert data at child node" << LL_ENDL;
}
} }
else if (this->getChildCount() == 0) else if (this->getChildCount() == 0)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment