#include <CCollisionBrute.h>
Public Member Functions | |
cCollisionBrute (vector< cTriangle > *a_triangles) | |
Constructor of cCollisionBrute. | |
virtual | ~cCollisionBrute () |
Destructor of cCollisionBrute. | |
virtual void | initialize (double a_radius=0) |
No initialization is necessary for the brute force method. | |
virtual void | render () |
There isn't really a useful "visualization" of "check all triangles". | |
bool | computeCollision (cVector3d &a_segmentPointA, cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings) |
Return the triangles intersected by the given segment, if any. | |
Protected Attributes | |
vector< cTriangle > * | m_triangles |
Pointer to the list of triangles in the mesh. |
bool cCollisionBrute::computeCollision | ( | cVector3d & | a_segmentPointA, | |
cVector3d & | a_segmentPointB, | |||
cCollisionRecorder & | a_recorder, | |||
cCollisionSettings & | a_settings | |||
) | [virtual] |
Return the triangles intersected by the given segment, if any.
Check if the given line segment intersects any triangle of the mesh. This method is called "brute force" because all triangles are checked by invoking their collision-detection methods. This method is simple but very inefficient.
a_segmentPointA | Initial point of segment. | |
a_segmentPointB | End point of segment. | |
a_recorder | Returns pointer to nearest collided object. | |
a_settings | Structure which contains some rules about how the collision detection should be performed. |
Reimplemented from cGenericCollision.