Check if the tree structure is valid (for debugging purpose)
| 750 | |
| 751 | // Check if the tree structure is valid (for debugging purpose) |
| 752 | void DynamicAABBTree::check() const { |
| 753 | |
| 754 | // Recursively check each node |
| 755 | checkNode(mRootNodeID); |
| 756 | |
| 757 | int32 nbFreeNodes = 0; |
| 758 | int32 freeNodeID = mFreeNodeID; |
| 759 | |
| 760 | // Check the free nodes |
| 761 | while(freeNodeID != TreeNode::NULL_TREE_NODE) { |
| 762 | assert(0 <= freeNodeID && freeNodeID < mNbAllocatedNodes); |
| 763 | freeNodeID = mNodes[freeNodeID].nextNodeID; |
| 764 | nbFreeNodes++; |
| 765 | } |
| 766 | |
| 767 | assert(mNbNodes + nbFreeNodes == mNbAllocatedNodes); |
| 768 | } |
| 769 | |
| 770 | // Check if the node structure is valid (for debugging purpose) |
| 771 | void DynamicAABBTree::checkNode(int32 nodeID) const { |
nothing calls this directly
no outgoing calls
no test coverage detected