cCollisionAABBLeaf Class Reference

cCollisionAABBLeaf contains methods to set up leaf nodes of an AABB tree and to use them to detect for collision with a line. More...

#include <CCollisionAABBTree.h>

Inheritance diagram for cCollisionAABBLeaf:

cCollisionAABBNode List of all members.

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

cTrianglem_triangle
 The triangle bounded by the leaf.

Detailed Description

cCollisionAABBLeaf contains methods to set up leaf nodes of an AABB tree and to use them to detect for collision with a line.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.
Returns:
Return true if the line segment intersects the leaf's triangle.

Implements cCollisionAABBNode.


The documentation for this class was generated from the following files:
Generated on Mon Jun 11 09:41:46 2007 for CHAI 3D by  doxygen 1.5.2