cCollisionSpheresTri Class Reference

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:

cCollisionSpheresGenericShape List of all members.

Public Member Functions

 cCollisionSpheresTri (cVector3d a, cVector3d b, cVector3d c)
 Constructor of cCollisionSpheresTri.
virtual ~cCollisionSpheresTri ()
bool computeCollision (cCollisionSpheresGenericShape *a_other, cGenericObject *&a_colObject, cTriangle *&a_colTriangle, cVector3d &a_colPoint, double &a_colSquareDistance)
 Return whether triangle collides with given line.
const cVector3dgetCenter () const
 Return the center of the triangle.
double getRadius () const
 Return the radius of the triangle.
cTrianglegetOriginal ()
 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.
cTrianglem_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 
)

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.
Returns:
Return a pointer to new cCollisionSpheresTri instance.

cCollisionSpheresTri::~cCollisionSpheresTri (  )  [virtual]

Destructor of cCollisionSpheresTri.


Member Function Documentation

bool cCollisionSpheresTri::computeCollision ( cCollisionSpheresGenericShape a_other,
cGenericObject *&  a_colObject,
cTriangle *&  a_colTriangle,
cVector3d a_colPoint,
double &  a_colSquareDistance 
) [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_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.
Returns:
Return whether the given line intersects this triangle.

Implements cCollisionSpheresGenericShape.


The documentation for this class was generated from the following files:
Generated on Mon Jun 11 09:41:47 2007 for CHAI 3D by  doxygen 1.5.2