#include <CCollisionSpheresGeometry.h>
Inheritance diagram for cCollisionSpheresLine:
Public Member Functions | |
cCollisionSpheresLine (cVector3d &a_segmentPointA, cVector3d &a_segmentPointB) | |
Constructor of cCollisionSpheresLine. | |
const cVector3d & | getCenter () const |
double | getRadius () const |
Return the radius of the line. | |
bool | computeCollision (cCollisionSpheresGenericShape *a_other, cGenericObject *&a_colObject, cTriangle *&a_colTriangle, cVector3d &a_colPoint, double &a_colSquareDistance) |
Return whether this line intersects the given triangle. | |
cVector3d | getSegmentPointA () |
Get first endpoint of the line. | |
cVector3d | getDir () |
Get direction vector of the line. | |
Protected Attributes | |
cVector3d | m_center |
The center of the line. | |
double | m_radius |
The radius of the line. | |
cVector3d | m_segmentPointA |
The first endpoint of the line. | |
cVector3d | m_dir |
The direction vector of the line. |
cCollisionSpheresLine::cCollisionSpheresLine | ( | cVector3d & | a_segmentPointA, | |
cVector3d & | a_segmentPointB | |||
) |
Constructor of cCollisionSpheresLine.
Constructor of cCollisionSpheresLine.
a_segmentPointA | First endpoint of the line segment. | |
a_segmentPointB | Second endpoint of the line segment. |
const cVector3d& cCollisionSpheresLine::getCenter | ( | ) | const [inline, virtual] |
METHODS: Return the center of the line.
Implements cCollisionSpheresGenericShape.
bool cCollisionSpheresLine::computeCollision | ( | cCollisionSpheresGenericShape * | a_other, | |
cGenericObject *& | a_colObject, | |||
cTriangle *& | a_colTriangle, | |||
cVector3d & | a_colPoint, | |||
double & | a_colSquareDistance | |||
) | [virtual] |
Return whether this line intersects the given triangle.
Determine whether there is any intersection between the primitives (this line and the given triangle) by calling the collision detection method of the triangle primitive.
a_other | The triangle 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.