#include <CCollisionSpheres.h>
Inheritance diagram for cCollisionSpheresLeaf:
Public Member Functions | |
cCollisionSpheresLeaf (cCollisionSpheresGenericShape *a_prim, cCollisionSpheresSphere *a_parent=NULL) | |
Constructor of cCollisionSpheresLeaf. | |
cCollisionSpheresLeaf (cTriangle *a_tri, cCollisionSpheresSphere *a_parent=NULL) | |
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, cGenericObject *&a_colObject, cTriangle *&a_colTriangle, cVector3d &a_colPoint, double &a_colSquareDistance, cCollisionSpheresLeaf *a_sb) |
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 | |||
) |
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. |
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.
bool cCollisionSpheresLeaf::computeCollision | ( | cCollisionSpheresLeaf * | a_sa, | |
cGenericObject *& | a_colObject, | |||
cTriangle *& | a_colTriangle, | |||
cVector3d & | a_colPoint, | |||
double & | a_colSquareDistance, | |||
cCollisionSpheresLeaf * | a_sb | |||
) | [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_colObject | Returns pointer to nearest collided object. | |
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. | |
a_sb | Other sphere tree leaf to check for collision. |