#include <Opcode.h>
Public Member Functions | |
inline_ udword | GetNbPrimitives () const |
inline_ const udword * | GetPrimitives () const |
Protected Member Functions | |
void | _BuildHierarchy (AABBTreeBuilder *builder) |
void | _Refit (AABBTreeBuilder *builder) |
udword | Split (udword axis, AABBTreeBuilder *builder) |
bool | Subdivide (AABBTreeBuilder *builder) |
Protected Attributes | |
udword | mNbPrimitives |
Number of primitives for this node. | |
udword * | mNodePrimitives |
Node-related primitives (shortcut to a position in mIndices below) |
void AABBTreeNode::_BuildHierarchy | ( | AABBTreeBuilder * | builder | ) | [protected] |
Recursive hierarchy building in a top-down fashion.
builder | [in] the tree builder |
Definition at line 333 of file OPC_AABBTree.cpp.
void AABBTreeNode::_Refit | ( | AABBTreeBuilder * | builder | ) | [protected] |
Refits the tree (top-down).
builder | [in] the tree builder |
Definition at line 354 of file OPC_AABBTree.cpp.
inline_ udword Opcode::AABBTreeNode::GetNbPrimitives | ( | ) | const [inline] |
inline_ const udword* Opcode::AABBTreeNode::GetPrimitives | ( | ) | const [inline] |
udword AABBTreeNode::Split | ( | udword | axis, |
AABBTreeBuilder * | builder | ||
) | [protected] |
Splits the node along a given axis. The list of indices is reorganized according to the split values.
axis | [in] splitting axis index |
builder | [in] the tree builder |
Definition at line 99 of file OPC_AABBTree.cpp.
bool AABBTreeNode::Subdivide | ( | AABBTreeBuilder * | builder | ) | [protected] |
Subdivides the node.
N / \ / \ N/2 N/2 / \ / \ N/4 N/4 N/4 N/4 (etc)
A well-balanced tree should have a O(log n) depth. A degenerate tree would have a O(n) depth. Note a perfectly-balanced tree is not well-suited to collision detection anyway.
builder | [in] the tree builder |
Definition at line 150 of file OPC_AABBTree.cpp.
udword Opcode::AABBTreeNode::mNbPrimitives [protected] |
udword* Opcode::AABBTreeNode::mNodePrimitives [protected] |