chai3d::cCollisionBrute Class Reference

This class implements a brute force approach for collision detection. More...

#include <CCollisionBrute.h>

Inheritance diagram for chai3d::cCollisionBrute:

Public Member Functions

 cCollisionBrute (cGenericArrayPtr a_entities)
 Constructor of cCollisionBrute. More...
 
virtual ~cCollisionBrute ()
 Destructor of cCollisionBrute. More...
 
bool computeCollision (cGenericObject *a_object, cVector3d &a_segmentPointA, cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
 This method computes all collisions between a segment passed as argument and the attributed 3D object. More...
 
- Public Member Functions inherited from chai3d::cGenericCollision
 cGenericCollision ()
 Constructor of cGenericCollision. More...
 
virtual ~cGenericCollision ()
 Destructor of cGenericCollision. More...
 
virtual void initialize (const double a_radius=0.0)
 This method initializes the collision detector. More...
 
virtual void render (cRenderOptions &a_options)
 This method renders a visual representation of the collision tree. More...
 
double getBoundaryRadius () const
 This method returns the radius of the boundary shell that covers every triangles. More...
 
void setDisplayDepth (const int a_depth)
 This method sets the level of the collision tree to display. More...
 
double getDisplayDepth () const
 This method returns the level inside the collision tree being displayed. (root = 0). More...
 

Protected Attributes

cGenericArrayPtr m_elements
 Pointer to the list of elements (points, segments, triangles). More...
 
- Protected Attributes inherited from chai3d::cGenericCollision
int m_displayDepth
 
double m_radiusAroundElements
 

Additional Inherited Members

- Public Attributes inherited from chai3d::cGenericCollision
cColorf m_color
 Color property used to render the collision detector graphically. More...
 

Detailed Description

This class implements a brute force approach to check for all intersections between a line segment and an object composedcpoints, segments, or triangles.

Constructor & Destructor Documentation

chai3d::cCollisionBrute::cCollisionBrute ( cGenericArrayPtr  a_elements)

Constructor of cCollisionBrute.

Parameters
a_elementsList of geometry elements.
virtual chai3d::cCollisionBrute::~cCollisionBrute ( )
inlinevirtual

Member Function Documentation

bool chai3d::cCollisionBrute::computeCollision ( cGenericObject *  a_object,
cVector3d &  a_segmentPointA,
cVector3d &  a_segmentPointB,
cCollisionRecorder &  a_recorder,
cCollisionSettings &  a_settings 
)
virtual

This method checks if the given line segment intersects any element of the object. This method is called "brute force" because all elements are checked by invoking their collision-detection methods. This method is simple but very inefficient.

Parameters
a_objectObject for which collision detector is being used.
a_segmentPointAInitial point of segment.
a_segmentPointBEnd point of segment.
a_recorderRecorder which stores all collision events.
a_settingsStructure which contains some rules about how the collision detection should be performed.
Returns
true if the line segment intersects one or more elements.

Reimplemented from chai3d::cGenericCollision.

Member Data Documentation

cGenericArrayPtr chai3d::cCollisionBrute::m_elements
protected

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