#include <Opcode.h>
Public Member Functions | |
AABBTree () | |
bool | Build (AABBTreeBuilder *builder) |
udword | ComputeDepth () const |
inline_ const udword * | GetIndices () const |
Catch the indices. | |
inline_ udword | GetNbNodes () const |
Catch the number of nodes. | |
udword | GetUsedBytes () const |
bool | IsComplete () const |
bool | Refit (AABBTreeBuilder *builder) |
bool | Refit2 (AABBTreeBuilder *builder) |
void | Release () |
udword | Walk (WalkingCallback callback, void *user_data) const |
~AABBTree () | |
Private Attributes | |
udword * | mIndices |
Indices in the app list. Indices are reorganized during build (permutation). | |
AABBTreeNode * | mPool |
Linear pool of nodes for complete trees. Null otherwise. [Opcode 1.3]. | |
udword | mTotalNbNodes |
Number of nodes in the tree. |
Constructor.
Definition at line 373 of file OPC_AABBTree.cpp.
Destructor.
Definition at line 382 of file OPC_AABBTree.cpp.
bool AABBTree::Build | ( | AABBTreeBuilder * | builder | ) |
Builds a generic AABB tree from a tree builder.
builder | [in] the tree builder |
Definition at line 405 of file OPC_AABBTree.cpp.
udword AABBTree::ComputeDepth | ( | ) | const |
Computes the depth of the tree. A well-balanced tree should have a log(n) depth. A degenerate tree O(n) depth.
Definition at line 456 of file OPC_AABBTree.cpp.
inline_ const udword* Opcode::AABBTree::GetIndices | ( | ) | const [inline] |
inline_ udword Opcode::AABBTree::GetNbNodes | ( | ) | const [inline] |
udword AABBTree::GetUsedBytes | ( | ) | const |
Computes the number of bytes used by the tree.
Definition at line 556 of file OPC_AABBTree.cpp.
bool AABBTree::IsComplete | ( | ) | const |
Checks the tree is a complete tree or not. A complete tree is made of 2*N-1 nodes, where N is the number of primitives in the tree.
Definition at line 570 of file OPC_AABBTree.cpp.
bool AABBTree::Refit | ( | AABBTreeBuilder * | builder | ) |
Refits the tree in a top-down way.
builder | [in] the tree builder |
Definition at line 501 of file OPC_AABBTree.cpp.
bool AABBTree::Refit2 | ( | AABBTreeBuilder * | builder | ) |
Refits the tree in a bottom-up way.
builder | [in] the tree builder |
Definition at line 514 of file OPC_AABBTree.cpp.
Releases the tree.
Definition at line 392 of file OPC_AABBTree.cpp.
udword AABBTree::Walk | ( | WalkingCallback | callback, |
void * | user_data | ||
) | const |
Walks the tree, calling the user back for each node.
Definition at line 466 of file OPC_AABBTree.cpp.
udword* Opcode::AABBTree::mIndices [private] |
AABBTreeNode* Opcode::AABBTree::mPool [private] |
udword Opcode::AABBTree::mTotalNbNodes [private] |