# cCollisionSpheresTri Class Reference
[Collision Detection]

cCollisionSpheresTri defines the triangle primitives that make up the mesh and are bounded by the collision spheres. It is essentially just a wrapper around a cTriangle object, to which it has a pointer (m_original). More...

`#include <CCollisionSpheresGeometry.h>`

Inheritance diagram for cCollisionSpheresTri:

[legend]

List of all members.

## Public Member Functions
| cCollisionSpheresTri (cVector3d a, cVector3d b, cVector3d c, double a_extendedRadius)
| Constructor of cCollisionSpheresTri.
virtual | ~cCollisionSpheresTri ()
| Destructor of cCollisionSpheresTri.
bool | computeCollision (cCollisionSpheresGenericShape *a_other, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
| Return whether triangle collides with given line.
const cVector3d & | getCenter () const
| Return the center of the triangle.
double | getRadius () const
| Return the radius of the triangle.
cTriangle * | getOriginal ()
| Returns the cTriangle object in the mesh associated with this triangle.
void | setOriginal (cTriangle *a_original)
| Sets the cTriangle object in the mesh associated with this triangle.
## Protected Attributes
cCollisionSpheresPoint | m_corner [3]
| The vertices of the triangle.
cCollisionSpheresEdge | m_side [3]
| The edges of the triangle.
cVector3d | m_center
| The center of the triangle.
double | m_radius
| The radius of the triangle.
cTriangle * | m_original
| The cTriangle object in the mesh associated with this triangle.

## Detailed Description

cCollisionSpheresTri defines the triangle primitives that make up the mesh and are bounded by the collision spheres. It is essentially just a wrapper around a cTriangle object, to which it has a pointer (m_original).

## Constructor & Destructor Documentation

cCollisionSpheresTri::cCollisionSpheresTri | ( | cVector3d | a,
|  | cVector3d | b,
|  | cVector3d | c,
|  | double | a_extendedRadius |
| ) |  |  |

Constructor of cCollisionSpheresTri.

Constructor of cCollisionSpheresTri, to enclose a single triangle in a sphere.

Parameters:

  | a | First vertex of the triangle.
  | b | Second vertex of the triangle.
  | c | Third vertex of the triangle.
  | a_extendedRadius | Additional radius to add to sphere.

Returns:
  Return a pointer to new cCollisionSpheresTri instance.

## Member Function Documentation

bool cCollisionSpheresTri::computeCollision | ( | cCollisionSpheresGenericShape * | a_other,
|  | cCollisionRecorder & | a_recorder,
|  | cCollisionSettings & | a_settings |
| ) |  |  | `[virtual]`

Return whether triangle collides with given line.

Determine whether there is any intersection between the primitives (this triangle and the given line) by calling the collision detection method of the cTriangle object associated with this triangle primitive.

Parameters:

  | a_other | The line primitive to check for intersection.
  | a_recorder | Stores all collision events.
  | a_settings | Contains collision settings information.

Implements cCollisionSpheresGenericShape.

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

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

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