#include <CCollisionAABBTree.h>
Public Member Functions | |
cCollisionAABBLeaf () | |
Default constructor of cCollisionAABBLeaf. | |
virtual | ~cCollisionAABBLeaf () |
Destructor of cCollisionAABBLeaf. | |
void | initialize (cTriangle *a_triangle, double a_radius) |
Initialize internal node. | |
void | fitBBox (double a_radius=0) |
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_segmentPointB, cCollisionAABBBox &a_lineBox, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings) |
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. |
bool cCollisionAABBLeaf::computeCollision | ( | cVector3d & | a_segmentPointA, | |
cVector3d & | a_segmentPointB, | |||
cCollisionAABBBox & | a_lineBox, | |||
cCollisionRecorder & | a_recorder, | |||
cCollisionSettings & | a_settings | |||
) | [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_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.
void cCollisionAABBLeaf::fitBBox | ( | double | a_radius = 0 |
) | [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.
a_radius | Radius around the triangle |
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.