#include <CCollisionSpheres.h>
Inheritance diagram for cCollisionSpheresSphere:
Public Member Functions | |
cCollisionSpheresSphere (cCollisionSpheresSphere *a_parent) | |
Constructor of cCollisionSpheresSphere. | |
cCollisionSpheresSphere () | |
Default constructor of cCollisionSpheresSphere. | |
virtual | ~cCollisionSpheresSphere () |
Destructor of cCollisionsSpheresSphere. | |
const cVector3d & | getCenter () |
Return the center of the sphere. | |
double | getRadius () |
Return the radius of the sphere. | |
virtual int | isLeaf ()=0 |
Return whether the node is a leaf node. | |
virtual void | draw (int a_depth=-1)=0 |
Draw the collision sphere for this node, if at the given depth. | |
Static Public Member Functions | |
static bool | computeCollision (cCollisionSpheresSphere *a_sa, cGenericObject *&a_colObject, cTriangle *&a_colTriangle, cVector3d &a_colPoint, double &a_colSquareDistance, cCollisionSpheresSphere *a_sb) |
Calculate the distance between the two given collision spheres. | |
Public Attributes | |
cCollisionSpheresSphere * | m_parent |
The parent of the node in the tree. | |
cVector3d | m_center |
The center of the node. | |
double | m_radius |
The radius of the node. | |
int | m_depth |
The depth of this node in the collision tree. | |
Friends | |
class | cCollisionSpheresNode |
Internal nodes of the collision sphere tree. | |
class | cCollisionSpheresLeaf |
Leaf nodes of the collision sphere tree. |
cCollisionSpheresSphere::cCollisionSpheresSphere | ( | cCollisionSpheresSphere * | a_parent | ) |
Constructor of cCollisionSpheresSphere.
Constructor of cCollisionSpheresSphere.
a_parent | Pointer to parent of this node in the sphere tree. |
bool cCollisionSpheresSphere::computeCollision | ( | cCollisionSpheresSphere * | a_sa, | |
cGenericObject *& | a_colObject, | |||
cTriangle *& | a_colTriangle, | |||
cVector3d & | a_colPoint, | |||
double & | a_colSquareDistance, | |||
cCollisionSpheresSphere * | a_sb | |||
) | [static] |
Calculate the distance between the two given collision spheres.
Determine whether there is any intersection between the primitives (line and triangles) in the collision subtrees rooted at the two given collision spheres.
a_sa | The root of one sphere tree to check for collision. | |
a_colObject | Returns pointer to nearest collided object. | |
a_colTriangle | Returns pointer to nearest colided triangle. | |
a_colPoint | Returns position of nearest collision. | |
a_colSquareDistance | Returns distance between ray origin and collision point. | |
a_sb | Root of other sphere tree to check for collision. |