#include <CCollisionSpheres.h>
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 | |
cCollisionSpheresGenericShape * | m_prim |
The shape primitive bounded by the sphere leaf. |
cCollisionSpheresLeaf::cCollisionSpheresLeaf | ( | cCollisionSpheresGenericShape * | a_prim, | |
cCollisionSpheresSphere * | a_parent = NULL | |||
) |
Constructor of cCollisionSpheresLeaf.
Constructor of cCollisionSpheresLeaf.
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.
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. |
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.
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. |
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.
a_depth | Only draw nodes at this depth in the tree. a_depth = -1 renders the complete tree. |
Implements cCollisionSpheresSphere.