#include <CCollisionAABBTree.h>
Inheritance diagram for cCollisionAABBInternal:
Public Member Functions | |
cCollisionAABBInternal () | |
Default constructor of cCollisionAABBInternal. | |
cCollisionAABBInternal (unsigned int a_numLeaves, cCollisionAABBLeaf *a_leaves, unsigned int a_depth=-1) | |
Constructor of cCollisionAABBInternal. | |
virtual | ~cCollisionAABBInternal () |
Destructor of cCollisionAABBInternal. | |
void | fitBBox () |
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_segmentDirection, cCollisionAABBBox &a_lineBox, cTriangle *&a_colTriangle, cVector3d &a_colPoint, double &a_colSquareDistance) |
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)? |
cCollisionAABBInternal::cCollisionAABBInternal | ( | unsigned int | a_numLeaves, | |
cCollisionAABBLeaf * | a_leaves, | |||
unsigned int | a_depth = -1 | |||
) |
Constructor of cCollisionAABBInternal.
Create 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. |
cCollisionAABBInternal::~cCollisionAABBInternal | ( | ) | [virtual] |
Destructor of cCollisionAABBInternal.
Destructor of cCollisionAABBInternal.
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.
bool cCollisionAABBInternal::computeCollision | ( | cVector3d & | a_segmentPointA, | |
cVector3d & | a_segmentDirection, | |||
cCollisionAABBBox & | a_lineBox, | |||
cTriangle *& | a_colTriangle, | |||
cVector3d & | a_colPoint, | |||
double & | a_colSquareDistance | |||
) | [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_segmentDirection | Direction of ray from first to second segment points (i.e., proxy to goal). | |
a_lineBox | A bounding box for the incoming segment, for quick discarding of collision tests. | |
a_colTriangle | Returns pointer to nearest collided triangle. | |
a_colPoint | Returns position of nearest collision. | |
a_colSquareDistance | Returns distance between ray origin and collision point. |
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::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.