Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Protected Member Functions | List of all members
om::physics::collision::CollisionAlgorithm Class Referenceabstract

The base class for objects that detect collisions between shapes. More...

#include <omPhysicsCollisionAlgorithm.h>

Inheritance diagram for om::physics::collision::CollisionAlgorithm:
om::physics::collision::CollisionAlgorithmFunction< ShapeType1, ShapeType2, testPair > om::physics::collision::CollisionAlgorithmGJK< ShapeType1, ShapeType2, getSupportPoint1, getSupportPoint2 > om::physics::collision::CollisionAlgorithmMeshVsShape< OtherShapeType, getSupportPoint >

Public Member Functions

virtual ~CollisionAlgorithm ()
 Destroy this algorithm. More...
 
virtual void testPairs (const CollisionPair *pairs, Size numPairs, const CollisionRequest &request, const CollisionNarrowphase &narrowphase, CollisionResultSet &result)=0
 Test the specified array of pairs for collisions and add the results to the result set. More...
 
const ShapeTypegetShapeType1 () const
 Return an object representing the first shape type that this algorithm operates on. More...
 
const ShapeTypegetShapeType2 () const
 Return an object representing the second shape type that this algorithm operates on. More...
 

Protected Member Functions

 CollisionAlgorithm (const ShapeType *newShapeType1, const ShapeType *newShapeType2)
 Create a new collision algorithm which operates on the specified collision shape types. More...
 

Detailed Description

The base class for objects that detect collisions between shapes.

Constructor & Destructor Documentation

virtual om::physics::collision::CollisionAlgorithm::~CollisionAlgorithm ( )
inlinevirtual

Destroy this algorithm.

om::physics::collision::CollisionAlgorithm::CollisionAlgorithm ( const ShapeType newShapeType1,
const ShapeType newShapeType2 
)
inlineprotected

Create a new collision algorithm which operates on the specified collision shape types.

Member Function Documentation

virtual void om::physics::collision::CollisionAlgorithm::testPairs ( const CollisionPair pairs,
Size  numPairs,
const CollisionRequest request,
const CollisionNarrowphase narrowphase,
CollisionResultSet result 
)
pure virtual

Test the specified array of pairs for collisions and add the results to the result set.

The pairs are assumed to have the same shape types as this algorithm and so can be safely cast to the shape base class.

The method finds any collisions among the pairs and adds the resulting collision points to the output collision result set.

Implemented in om::physics::collision::CollisionAlgorithmGJK< ShapeType1, ShapeType2, getSupportPoint1, getSupportPoint2 >, om::physics::collision::CollisionAlgorithmFunction< ShapeType1, ShapeType2, testPair >, and om::physics::collision::CollisionAlgorithmMeshVsShape< OtherShapeType, getSupportPoint >.

const ShapeType& om::physics::collision::CollisionAlgorithm::getShapeType1 ( ) const
inline

Return an object representing the first shape type that this algorithm operates on.

const ShapeType& om::physics::collision::CollisionAlgorithm::getShapeType2 ( ) const
inline

Return an object representing the second shape type that this algorithm operates on.


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