#include <CCollisionSpheres.h>
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, cCollisionSpheresSphere *a_sb, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings) |
Calculate the distance between the two given collision spheres. | |
Protected 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. | |
int | m_num |
Internal usage. | |
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, | |
cCollisionSpheresSphere * | a_sb, | |||
cCollisionRecorder & | a_recorder, | |||
cCollisionSettings & | a_settings | |||
) | [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 | Node 0. | |
a_sb | Node 1. | |
a_recorder | Stores all collision events | |
a_settings | Contains collision settings information. |