cCollisionAABBLeaf Class Reference
[Collision Detection]

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:

Inheritance graph
[legend]

List of all members.

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

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

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.

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

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.

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

Parameters:
a_depth Only draw nodes at this depth in the tree. a_depth < 0 render _up to_ abs(a_depth).

Implements cCollisionAABBNode.


The documentation for this class was generated from the following files:


CHAI3D 2.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2009 - CHAI 3D
All Rights Reserved.