#include <CCollisionAABBTree.h>
Public Member Functions | |
cCollisionAABBInternal () | |
Default constructor of cCollisionAABBInternal. | |
virtual | ~cCollisionAABBInternal () |
Destructor of cCollisionAABBInternal. | |
void | initialize (unsigned int a_numLeaves, cCollisionAABBLeaf *a_leaves, unsigned int a_depth=-1) |
Initialize internal node. | |
void | fitBBox (double a_radius=0) |
Size the bounding box for this node to enclose its children. | |
void | render (int a_depth=-1) |
Draw the edges of the bounding box for this node if it is at depth a_depth. | |
bool | computeCollision (cVector3d &a_segmentPointA, cVector3d &a_segmentPointB, cCollisionAABBBox &a_lineBox, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings) |
Determine whether given line intersects the tree rooted at this node. | |
virtual bool | contains_triangle (int a_tag) |
Return true if this node contains the specified triangle tag. | |
virtual void | setParent (cCollisionAABBNode *a_parent, int a_recursive) |
Return parent node and optionally propagate the assignment to children. | |
Public Attributes | |
cCollisionAABBNode * | m_leftSubTree |
The root of this node's left subtree. | |
cCollisionAABBNode * | m_rightSubTree |
The root of this node's right subtree. | |
bool | m_testLineBox |
Test box for collision with ray itself (as compared to line's box)? |
bool cCollisionAABBInternal::computeCollision | ( | cVector3d & | a_segmentPointA, | |
cVector3d & | a_segmentPointB, | |||
cCollisionAABBBox & | a_lineBox, | |||
cCollisionRecorder & | a_recorder, | |||
cCollisionSettings & | a_settings | |||
) | [virtual] |
Determine whether given line intersects the tree rooted at this node.
Determine whether the given line intersects the mesh covered by the AABB Tree rooted at this internal node. If so, return (in the output parameters) information about the intersected triangle of the mesh closest to the segment origin.
a_segmentPointA | Initial point of segment. | |
a_segmentPointB | End point of segment. | |
a_lineBox | A bounding box for the incoming segment, for quick discarding of collision tests. | |
a_recorder | Stores all collision events. | |
a_settings | Contains collision settings information. |
Implements cCollisionAABBNode.
bool cCollisionAABBInternal::contains_triangle | ( | int | tag | ) | [virtual] |
Return true if this node contains the specified triangle tag.
Return whether this node contains the specified triangle tag.
tag | Tag to inquire about |
Implements cCollisionAABBNode.
void cCollisionAABBInternal::initialize | ( | unsigned int | a_numLeaves, | |
cCollisionAABBLeaf * | a_leaves, | |||
unsigned int | a_depth = -1 | |||
) |
Initialize internal node.
Initialize an internal AABB tree node.
a_numLeaves | Number of leaves in subtree rooted at this node. | |
a_leaves | Pointer to the location in the array of leafs for the first leaf under this internal node. | |
a_depth | Depth of this node in the collision tree. |
void cCollisionAABBInternal::render | ( | int | a_depth = -1 |
) | [virtual] |
Draw the edges of the bounding box for this node if it is at depth a_depth.
Draw the edges of the bounding box for an internal tree node if it is at depth a_depth in the tree, and call the draw function for its children.
a_depth | Only draw nodes at this level in the tree. a_depth < 0 render _up to_ this level. |
Implements cCollisionAABBNode.
void cCollisionAABBInternal::setParent | ( | cCollisionAABBNode * | a_parent, | |
int | a_recursive | |||
) | [virtual] |
Return parent node and optionally propagate the assignment to children.
Sets this node's parent pointer and optionally propagate assignments to its children (setting their parent pointers to this node).
a_parent | Pointer to this node's parent. | |
a_recursive | Propagate assignment down the tree? |
Implements cCollisionAABBNode.