|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Base interface for a stateful collision algorithm that generates contact points between two potentially colliding objects of specific shape types. More...
#include <GREM/physics/collision.hpp>
Public Member Functions | |
| virtual CollisionFilterTestResult | hasCollision (ArenaResource *temporaryMemoryResource, Length1D minPenetrationDepth, ColliderView< N > colliderA, const Transformation< N > &transformationA, ColliderView< N > colliderB, const Transformation< N > &transformationB, const CollisionAlgorithmOptions< N > &options, CollisionFilterTest filterTest)=0 |
| Perform collision detection using the underlying collision algorithm and determine whether two objects have any touching surfaces or not. | |
| virtual void | detectCollisions (ArenaResource *temporaryMemoryResource, ColliderView< N > colliderA, const Transformation< N > &transformationA, ColliderView< N > colliderB, const Transformation< N > &transformationB, const CollisionAlgorithmOptions< N > &options, CollisionFilterTest filterTest, FunctionView< void(const CollisionAlgorithmResult< N > &collision)> callback)=0 |
| Perform collision detection using the underlying collision algorithm and generate contact manifolds for touching surfaces. | |
Protected Member Functions | |
| constexpr | CollisionAlgorithmImplementation () noexcept=default |
| Construct a new collision algorithm. | |
Base interface for a stateful collision algorithm that generates contact points between two potentially colliding objects of specific shape types.
| N | number of dimensions of the world space (must be 2 or 3). |
|
constexprprotecteddefaultnoexcept |
Construct a new collision algorithm.
|
nodiscardpure virtual |
Perform collision detection using the underlying collision algorithm and determine whether two objects have any touching surfaces or not.
| temporaryMemoryResource | non-null non-owning pointer to a memory resource to use for temporary memory allocations, which will all be deallocated by the time the function returns. |
| minPenetrationDepth | minimum penetration depth for a contact to be considered to be colliding. |
| colliderA | collider of the first object. Must have the same shape type as the first of the two shapes that this collision algorithm was created to handle. |
| transformationA | world-space transformation of the first object. |
| colliderB | collider of the second object. Must have the same shape type as the second of the two shapes that this collision algorithm was created to handle. |
| transformationB | world-space transformation of the second object. |
| options | collision algorithm options, see CollisionAlgorithmOptions. Should usually be simulation.resources.getResource<SimulationOptions<N>>().collisionAlgorithmOptions. |
| filterTest | test that potential colliders must pass in order to be considered for collision. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
pure virtual |
Perform collision detection using the underlying collision algorithm and generate contact manifolds for touching surfaces.
| temporaryMemoryResource | non-null non-owning pointer to a memory resource to use for temporary memory allocations, which will all be deallocated by the time the function returns. |
| colliderA | collider of the first object. Must have the same shape type as the first of the two shapes that this collision algorithm was created to handle. |
| transformationA | world-space transformation of the first object. |
| colliderB | collider of the second object. Must have the same shape type as the second of the two shapes that this collision algorithm was created to handle. |
| transformationB | world-space transformation of the second object. |
| options | collision algorithm options, see CollisionAlgorithmOptions. Should usually be simulation.resources.getResource<SimulationOptions<N>>().collisionAlgorithmOptions. |
| filterTest | test that potential colliders must pass in order to be considered for collision. |
| callback | function to pass the results to. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the callback function. |