cCollisionSpheresLeaf Class Reference
[Collision Detection]

cCollisionSpheresLeaf defines leaf nodes of the collision sphere tree and provides methods for constructing the nodes and using them to determine collisions. More...

#include <CCollisionSpheres.h>

Inheritance diagram for cCollisionSpheresLeaf:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 cCollisionSpheresLeaf (cCollisionSpheresGenericShape *a_prim, cCollisionSpheresSphere *a_parent=NULL)
 Constructor of cCollisionSpheresLeaf.
 cCollisionSpheresLeaf (cTriangle *a_tri, cCollisionSpheresSphere *a_parent=NULL, double a_extendedRadius=0)
 Constructor of cCollisionSpheresLeaf.
 cCollisionSpheresLeaf ()
 Default constructor of cCollisionSpheresLeaf.
virtual ~cCollisionSpheresLeaf ()
 Destructor of cCollisionSpheresLeaf.
int isLeaf ()
 Return whether the node is a leaf node. (In this class, it is.).
void draw (int a_depth)
 Draw the collision sphere if at the given depth.

Static Public Member Functions

static bool computeCollision (cCollisionSpheresLeaf *a_sa, cCollisionSpheresLeaf *a_sb, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
 Check for intersection between the two given leaf nodes.

Public Attributes

cCollisionSpheresGenericShapem_prim
 The shape primitive bounded by the sphere leaf.


Detailed Description

cCollisionSpheresLeaf defines leaf nodes of the collision sphere tree and provides methods for constructing the nodes and using them to determine collisions.

Constructor & Destructor Documentation

cCollisionSpheresLeaf::cCollisionSpheresLeaf ( cCollisionSpheresGenericShape a_prim,
cCollisionSpheresSphere a_parent = NULL 
)

Constructor of cCollisionSpheresLeaf.

Constructor of cCollisionSpheresLeaf.

Parameters:
a_prim Pointer to a shape primitive to be enclosed by the new sphere leaf node.
a_parent Pointer to the parent of this node in sphere tree.

cCollisionSpheresLeaf::cCollisionSpheresLeaf ( cTriangle a_tri,
cCollisionSpheresSphere a_parent = NULL,
double  a_extendedRadius = 0 
)

Constructor of cCollisionSpheresLeaf.

Constructor of cCollisionSpheresLeaf.

Parameters:
a_tri Pointer to triangle to be enclosed by new sphere leaf.
a_parent Pointer to the parent of this node in the sphere tree.
a_extendedRadius Bounding radius.
Returns:
Return a pointer to new cCollisionSpheresLeaf instance.


Member Function Documentation

bool cCollisionSpheresLeaf::computeCollision ( cCollisionSpheresLeaf a_sa,
cCollisionSpheresLeaf a_sb,
cCollisionRecorder a_recorder,
cCollisionSettings a_settings 
) [static]

Check for intersection between the two given leaf nodes.

Determine whether there is any intersection between the primitives (line and triangle) of the two given collision spheres by calling the primitive's collision detection method.

Parameters:
a_sa One sphere tree leaf to check for collision.
a_sb Other sphere tree leaf to check for collision.
a_recorder Stores all collision events
a_settings Contains collision settings information.
Returns:
Return whether primitives of the two leaves collide.

void cCollisionSpheresLeaf::draw ( int  a_depth  )  [virtual]

Draw the collision sphere if at the given depth.

Draw the collision sphere if at the given depth.

Parameters:
a_depth Only draw nodes at this depth in the tree. a_depth = -1 renders the complete tree.

Implements cCollisionSpheresSphere.


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.