#include <CCollisionAABBTree.h>
Inheritance diagram for cCollisionAABBLeaf:
Public Member Functions | |
cCollisionAABBLeaf () | |
Default constructor of cCollisionAABBLeaf. | |
cCollisionAABBLeaf (cTriangle *a_triangle) | |
Constructor of cCollisionAABBLeaf. | |
virtual | ~cCollisionAABBLeaf () |
Destructor of cCollisionAABBLeaf. | |
void | fitBBox () |
Create a bounding box to enclose triangle belonging to this leaf node. | |
void | render (int a_depth=-1) |
Draw the edges of the bounding box for this leaf 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 the given line intersects this leaf's triangle. | |
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_recusive) |
Return parent of this node. | |
Public Attributes | |
cTriangle * | m_triangle |
The triangle bounded by the leaf. |
void cCollisionAABBLeaf::fitBBox | ( | ) | [virtual] |
Create a bounding box to enclose triangle belonging to this leaf node.
Create a bounding box to enclose the three vertices of the triangle belonging to the leaf node.
Reimplemented from cCollisionAABBNode.
void cCollisionAABBLeaf::render | ( | int | a_depth = -1 |
) | [virtual] |
Draw the edges of the bounding box for this leaf if it is at depth a_depth.
Render bounding box of leaf node if it is at level a_depth in the tree.
a_depth | Only draw nodes at this depth in the tree. a_depth < 0 render _up to_ abs(a_depth). |
Implements cCollisionAABBNode.
bool cCollisionAABBLeaf::computeCollision | ( | cVector3d & | a_segmentPointA, | |
cVector3d & | a_segmentDirection, | |||
cCollisionAABBBox & | a_lineBox, | |||
cTriangle *& | a_colTriangle, | |||
cVector3d & | a_colPoint, | |||
double & | a_colSquareDistance | |||
) | [virtual] |
Determine whether the given line intersects this leaf's triangle.
Determine whether the given line intersects the triangle belonging to this leaf node by calling the triangle's collision detection method.
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.