#include <CCollisionSpheresGeometry.h>
Inheritance diagram for cCollisionSpheresTri:
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 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. |
Constructor of cCollisionSpheresTri.
Constructor of cCollisionSpheresTri, to enclose a single triangle in a sphere.
a | First vertex of the triangle. | |
b | Second vertex of the triangle. | |
c | Third vertex of the triangle. |
cCollisionSpheresTri::~cCollisionSpheresTri | ( | ) | [virtual] |
Destructor of cCollisionSpheresTri.
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.
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. |
Implements cCollisionSpheresGenericShape.