// Returns the leaf wich contained the sceneObject. // Returns NULL if the sceneObject parameter is not contained in the node. OctreeNode* OctreeNode::FindLeaf(const SceneObject& sceneObject) { if(!this->ObjectIsInside(sceneObject)) return NULL; OctreeNode* currentNode = this; while(currentNode != NULL && !currentNode->IsALeaf()) { currentNode = currentNode->FindNextNode(sceneObject); } return currentNode; }