# cCollisionSpheresSphere Class Reference
[Collision Detection]

cCollisionSpheresSphere is an abstract class for nodes of the collision sphere tree. More...

`#include <CCollisionSpheres.h>`

Inheritance diagram for cCollisionSpheresSphere:

[legend]

List of all members.

## 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.

## Detailed Description

cCollisionSpheresSphere is an abstract class for nodes of the collision sphere tree.

## Constructor & Destructor Documentation

cCollisionSpheresSphere::cCollisionSpheresSphere | ( | cCollisionSpheresSphere * | a_parent | ) |

Constructor of cCollisionSpheresSphere.

Constructor of cCollisionSpheresSphere.

Parameters:

  | a_parent | Pointer to parent of this node in the sphere tree.

Returns:
  Return a pointer to new cCollisionSpheresSphere instance.

## Member Function Documentation

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.

Parameters:

  | a_sa | Node 0.
  | a_sb | Node 1.
  | a_recorder | Stores all collision events
  | a_settings | Contains collision settings information.

Returns:
  Return true if a collision event has occurred.

The documentation for this class was generated from the following files:

- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/collisions/CCollisionSpheres.h
- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/collisions/CCollisionSpheres.cpp

CHAI3D 2.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2009 - CHAI 3D
All Rights Reserved.