Om
1.0.0
A universal framework for multimedia simulation
|
A class that sorts pairs of potentially colliding shapes to the associated collision algorithms. More...
#include <omPhysicsCollisionNarrowphase.h>
Public Member Functions | |
CollisionNarrowphase () | |
Create a default narrowphase with no algorithms. More... | |
CollisionNarrowphase (const CollisionNarrowphase &other) | |
Create a copy of an narrowphase. More... | |
~CollisionNarrowphase () | |
Destroy this narrowphase and all of the algorithms it contains. More... | |
CollisionNarrowphase & | operator= (const CollisionNarrowphase &other) |
Assign the algorithms of one narrowphase to another. More... | |
void | addPair (const CollisionPair &pair) |
Add a collision pair to this narrowphase that should be tested for collisions. More... | |
void | testPair (const CollisionPair &pair, const CollisionRequest &request, CollisionResultSet &resultSet) const |
Test for collisions between the specified pair of shapes. More... | |
void | testPairs (const CollisionRequest &request, CollisionResultSet &resultSet) |
Test all buffered pairs for collisions and place the results in the output result set. More... | |
Size | getAlgorithmCount () const |
Return the number of collision algorithms that this narrowphase has. More... | |
CollisionAlgorithm * | getAlgorithm (Index algorithmIndex) const |
Return a pointer to the algorithm at the specified index. More... | |
CollisionAlgorithm * | getAlgorithm (const ShapeType &shapeType1, const ShapeType &shapeType2) const |
Return a pointer to the algorithm for the specified shape types. More... | |
template<typename ShapeType1 , typename ShapeType2 > | |
CollisionAlgorithm * | getAlgorithm () const |
Return a pointer to the algorithm for the specified template shape types. More... | |
Bool | addAlgorithm (CollisionAlgorithm *newAlgorithm) |
Add the specified CollisionAlgorithm to this narrowphase. More... | |
Bool | removeAlgorithm (const ShapeType &shapeType1, const ShapeType &shapeType2) |
Remove an algorithm with the specified shape types from this narrowphase. More... | |
template<typename ShapeType1 , typename ShapeType2 > | |
Bool | removeAlgorithm () |
Remove an algorithm with the specified templated shape types from this narrowphase. More... | |
void | clearAlgorithms () |
Remove all algorithms from this CollisionNarrowphase. More... | |
A class that sorts pairs of potentially colliding shapes to the associated collision algorithms.
om::physics::collision::CollisionNarrowphase::CollisionNarrowphase | ( | ) |
Create a default narrowphase with no algorithms.
om::physics::collision::CollisionNarrowphase::CollisionNarrowphase | ( | const CollisionNarrowphase & | other | ) |
Create a copy of an narrowphase.
om::physics::collision::CollisionNarrowphase::~CollisionNarrowphase | ( | ) |
Destroy this narrowphase and all of the algorithms it contains.
CollisionNarrowphase& om::physics::collision::CollisionNarrowphase::operator= | ( | const CollisionNarrowphase & | other | ) |
Assign the algorithms of one narrowphase to another.
|
inline |
Add a collision pair to this narrowphase that should be tested for collisions.
The pair is stored but no collisions are found until the testPairs() method is called. For immediate collision detection, call testPair() instead.
|
inline |
Test for collisions between the specified pair of shapes.
The collision results are placed in the output result set if there are any collisions.
void om::physics::collision::CollisionNarrowphase::testPairs | ( | const CollisionRequest & | request, |
CollisionResultSet & | resultSet | ||
) |
Test all buffered pairs for collisions and place the results in the output result set.
The buffered pairs are then cleared so that the narrowphase is ready for the next set of collision pairs.
|
inline |
Return the number of collision algorithms that this narrowphase has.
|
inline |
Return a pointer to the algorithm at the specified index.
|
inline |
Return a pointer to the algorithm for the specified shape types.
If such an algorithm exists in this narrowphase, a pointer to it is returned. Otherwise, NULL is returned.
|
inline |
Return a pointer to the algorithm for the specified template shape types.
If such an algorithm exists in this narrowphase, a pointer to it is returned. Otherwise, NULL is returned.
Bool om::physics::collision::CollisionNarrowphase::addAlgorithm | ( | CollisionAlgorithm * | newAlgorithm | ) |
Add the specified CollisionAlgorithm to this narrowphase.
If there already exists an algorithm for the specified algorithm's shape types, the old algorithm is replaced.
Bool om::physics::collision::CollisionNarrowphase::removeAlgorithm | ( | const ShapeType & | shapeType1, |
const ShapeType & | shapeType2 | ||
) |
Remove an algorithm with the specified shape types from this narrowphase.
If such an algorithm exists in this narrowphase, it is removed and TRUE is returned. Otherwise, FALSE is returned and the narrowphase is unchanged.
|
inline |
Remove an algorithm with the specified templated shape types from this narrowphase.
If such an algorithm exists in this narrowphase, it is removed and TRUE is returned. Otherwise, FALSE is returned and the narrowphase is unchanged.
void om::physics::collision::CollisionNarrowphase::clearAlgorithms | ( | ) |
Remove all algorithms from this CollisionNarrowphase.