|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Acceleration structure for spatial queries in a simulation. More...
#include <GREM/physics/Broadphase.hpp>
Classes | |
| struct | CollisionResult |
| Result of a collision check of a shape against the entities in a broadphase. More... | |
| struct | RaycastResult |
| Result of a raycast against the objects in a broadphase. More... | |
| struct | ShapecastResult |
| Result of a shapecast against the objects in a broadphase. More... | |
Public Types | |
| using | value_type = typename Tree::value_type |
| Value type of the container. | |
| using | reference = typename Tree::reference |
| Reference type of the container. | |
| using | const_reference = typename Tree::const_reference |
| Const reference type of the container. | |
| using | pointer = typename Tree::pointer |
| Pointer type of the container. | |
| using | const_pointer = typename Tree::const_pointer |
| Const pointer type of the container. | |
| using | size_type = typename Tree::size_type |
| Size type of the container. | |
| using | difference_type = typename Tree::difference_type |
| Difference type of the container. | |
| using | iterator = typename Tree::iterator |
| Iterator type of the container. | |
| using | const_iterator = typename Tree::const_iterator |
| Const iterator type of the container. | |
| using | local_iterator = typename Tree::local_iterator |
| Local iterator type for the nodes of the container. | |
| using | const_local_iterator = typename Tree::const_local_iterator |
| Const local iterator type for the nodes of the container. | |
| using | ElementsView = Subrange<iterator, iterator, SubrangeKind::SIZED> |
| Non-owning view over the elements in a broadphase. | |
| using | ConstElementsView = Subrange<const_iterator, const_iterator, SubrangeKind::SIZED> |
| Non-owning read-only view over the elements in a broadphase. | |
Public Member Functions | |
| ElementsView | getElements () noexcept |
| Get a view over the elements in the broadphase. | |
| ConstElementsView | getElements () const noexcept |
| Get a read-only view over the elements in the broadphase. | |
| void | clear () noexcept |
| Erase all elements from the broadphase and reset it to its empty state. | |
| void | reset (const Box< N > &worldBoundingBox, Distance minEntitySizeApproximation) noexcept |
| Reset the broadphase to an empty state with new world parameters. | |
| Distance | getMinEntitySizeApproximation () const noexcept |
| Get the current minimum entity size approximation of the broadphase. | |
| Box< N > | getRootBox () const noexcept |
| Get the current root box of the broadphase. | |
| iterator | insert (const Box< N > &boundingBox, EntityID entityID) |
| Insert an entity into the broadphase. | |
| void | erase (const_iterator pos) |
| Remove an entity from the broadphase. | |
| void | erase (BroadphaseID id) |
| Remove an entity from the broadphase. | |
| EntityID | operator[] (LooseOrthtreeID id) const |
| Get the entity with a specific handle. | |
| template<typename Callback, typename Predicate> | |
| auto | traverseNodes (Callback &&callback, Predicate &&predicate) const |
| Execute a callback function for each active node of the broadphase, including empty internal nodes. | |
| template<typename Callback> | |
| auto | traverseNodes (Callback &&callback) const |
| Execute a callback function for each active node of the broadphase, including empty internal nodes. | |
| template<typename Callback, typename Predicate> | |
| auto | traverseEntities (Callback &&callback, Predicate &&predicate) const |
| Execute a callback function for each entity in the broadphase. | |
| template<typename Callback> | |
| auto | traverseEntities (Callback &&callback) const |
| Execute a callback function for each entity in the broadphase. | |
| bool | testPoint (Position< N > point, CollisionFilter filter, execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > entities, CollisionFilterTest filterTest={}, FunctionView< bool(EntityID objectID, CollisionFilterTestResult filterTestResult)> callback=[](EntityID) -> bool { return true;}, FunctionView< bool(EntityID objectID)> predicate=[](EntityID) -> bool { return true;}) const |
| Find all objects in the broadphase that contain a given point. | |
| bool | testShape (Length1D minPenetrationDepth, ShapeView< N > shape, CollisionFilter filter, const Transformation< N > &transformation, execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > entities, const CollisionAlgorithmOptions< N > &options, CollisionFilterTest filterTest={}, FunctionView< bool(EntityID objectID, CollisionFilterTestResult filterTestResult)> callback=[](EntityID) -> bool { return true;}, FunctionView< bool(EntityID objectID)> predicate=[](EntityID) -> bool { return true;}) const |
| Find all objects in the broadphase that collide with a given shape. | |
| bool | collide (ShapeView< N > shape, CollisionFilter filter, const Transformation< N > &transformation, execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > entities, const CollisionAlgorithmOptions< N > &options, CollisionFilterTest filterTest={}, FunctionView< bool(const CollisionResult &collision)> callback=[](const CollisionResult &) -> bool { return true;}, FunctionView< bool(EntityID objectID)> predicate=[](EntityID) -> bool { return true;}) const |
| Find collisions between a shape and the objects in the broadphase. | |
| bool | raycast (const Ray< N > &ray, CollisionFilter filter, execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > entities, CollisionFilterTest filterTest={}, FunctionView< bool(const RaycastResult &hit)> callback=[](const RaycastResult &) -> bool { return true;}, FunctionView< bool(EntityID objectID)> predicate=[](EntityID) -> bool { return true;}) const |
| Find collisions between a point and the objects in the broadphase when the point is cast like a ray from a given start position towards a given direction. | |
| Optional< RaycastResult > | raycastClosestHit (const Ray< N > &ray, CollisionFilter filter, execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > entities, CollisionFilterTest filterTest={}, FunctionView< bool(EntityID objectID)> predicate=[](EntityID) -> bool { return true;}) const |
| Find the closest collision between a point and the objects in the broadphase when the point is cast like a ray from a given start position towards a given direction. | |
| Optional< RaycastResult > | raycastAnyHit (const Ray< N > &ray, CollisionFilter filter, execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > entities, CollisionFilterTest filterTest={}, FunctionView< bool(EntityID objectID)> predicate=[](EntityID) -> bool { return true;}) const |
| Find any collision between a point and the objects in the broadphase when the point is cast like a ray from a given start position towards a given direction. | |
| bool | shapecast (ConvexShapeView< N > convexShape, CollisionFilter filter, const Transformation< N > &transformation, Direction< N > direction, Distance maxDistance, execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > entities, const CollisionAlgorithmOptions< N > &options, CollisionFilterTest filterTest={}, FunctionView< bool(const ShapecastResult &hit)> callback=[](const ShapecastResult &) -> bool { return true;}, FunctionView< bool(EntityID objectID)> predicate=[](EntityID) -> bool { return true;}) const |
| Find collisions between an object of a convex shape and the objects in the broadphase when the object is cast from a given start position towards a given direction. | |
| Optional< ShapecastResult > | shapecastClosestHit (ConvexShapeView< N > convexShape, CollisionFilter filter, const Transformation< N > &transformation, Direction< N > direction, Distance maxDistance, execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > entities, const CollisionAlgorithmOptions< N > &options, CollisionFilterTest filterTest={}, FunctionView< bool(EntityID objectID)> predicate=[](EntityID) -> bool { return true;}) const |
| Find the closest collision between an object of a convex shape and the objects in the broadphase when the object is cast from a given start position towards a given direction. | |
| Optional< ShapecastResult > | shapecastAnyHit (ConvexShapeView< N > convexShape, CollisionFilter filter, const Transformation< N > &transformation, Direction< N > direction, Distance maxDistance, execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > entities, const CollisionAlgorithmOptions< N > &options, CollisionFilterTest filterTest={}, FunctionView< bool(EntityID objectID)> predicate=[](EntityID) -> bool { return true;}) const |
| Find any collision between an object of a convex shape and the objects in the broadphase when the object is cast from a given start position towards a given direction. | |
Friends | |
| template<typename Predicate> | |
| size_type | erase_if (Broadphase &c, Predicate &&predicate) |
| Erase all entities that match a predicate from the broadphase. | |
Acceleration structure for spatial queries in a simulation.
| N | number of dimensions of the world space (must be 2 or 3). |
| using grem::physics::Broadphase< N >::value_type = typename Tree::value_type |
Value type of the container.
| using grem::physics::Broadphase< N >::reference = typename Tree::reference |
Reference type of the container.
| using grem::physics::Broadphase< N >::const_reference = typename Tree::const_reference |
Const reference type of the container.
| using grem::physics::Broadphase< N >::pointer = typename Tree::pointer |
Pointer type of the container.
| using grem::physics::Broadphase< N >::const_pointer = typename Tree::const_pointer |
Const pointer type of the container.
| using grem::physics::Broadphase< N >::size_type = typename Tree::size_type |
Size type of the container.
| using grem::physics::Broadphase< N >::difference_type = typename Tree::difference_type |
Difference type of the container.
| using grem::physics::Broadphase< N >::iterator = typename Tree::iterator |
Iterator type of the container.
| using grem::physics::Broadphase< N >::const_iterator = typename Tree::const_iterator |
Const iterator type of the container.
| using grem::physics::Broadphase< N >::local_iterator = typename Tree::local_iterator |
Local iterator type for the nodes of the container.
| using grem::physics::Broadphase< N >::const_local_iterator = typename Tree::const_local_iterator |
Const local iterator type for the nodes of the container.
| using grem::physics::Broadphase< N >::ElementsView = Subrange<iterator, iterator, SubrangeKind::SIZED> |
Non-owning view over the elements in a broadphase.
| using grem::physics::Broadphase< N >::ConstElementsView = Subrange<const_iterator, const_iterator, SubrangeKind::SIZED> |
Non-owning read-only view over the elements in a broadphase.
|
inlinenodiscardnoexcept |
Get a view over the elements in the broadphase.
|
inlinenodiscardnoexcept |
Get a read-only view over the elements in the broadphase.
|
inlinenoexcept |
Erase all elements from the broadphase and reset it to its empty state.
|
inlinenoexcept |
Reset the broadphase to an empty state with new world parameters.
| worldBoundingBox | total bounding box of the entities that will be inserted. |
| minEntitySizeApproximation | approximation of the minimum width of the entities that will be inserted. |
|
inlinenodiscardnoexcept |
Get the current minimum entity size approximation of the broadphase.
|
inlinenodiscardnoexcept |
Get the current root box of the broadphase.
|
inline |
Insert an entity into the broadphase.
| boundingBox | axis-aligned bounding box of the entity. |
| entityID | handle to the entity. |
| 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. |
|
inline |
Remove an entity from the broadphase.
| pos | iterator to the entity to remove. Must be valid. |
|
inline |
Remove an entity from the broadphase.
| id | handle to the entity to remove. Must be valid. |
|
inlinenodiscard |
Get the entity with a specific handle.
| id | handle to the entity to get. Must be valid. |
|
inline |
Execute a callback function for each active node of the broadphase, including empty internal nodes.
| callback | function to execute, which should accept the following parameters (though they don't need to be used):
|
| predicate | condition that must be met in order to traverse deeper into the hierarchy. Must return bool and accept the following parameter:
|
| 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 or predicate functions. |
|
inline |
Execute a callback function for each active node of the broadphase, including empty internal nodes.
| callback | function to execute, which should accept the following parameters (though they don't need to be used):
|
| 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. |
|
inline |
Execute a callback function for each entity in the broadphase.
| callback | function to execute, which should accept the following parameter:
|
| predicate | condition that must be met in order to traverse deeper into the hierarchy. Must return bool and accept the following parameter:
|
| 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 or predicate functions. |
|
inline |
Execute a callback function for each entity in the broadphase.
| callback | function to execute, which should accept the following parameter:
|
| 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. |
| bool grem::physics::Broadphase< N >::testPoint | ( | Position< N > | point, |
| CollisionFilter | filter, | ||
| execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > | entities, | ||
| CollisionFilterTest | filterTest = {}, | ||
| FunctionView< bool(EntityID objectID, CollisionFilterTestResult filterTestResult)> | callback = [](EntityID) -> bool { return true;}, | ||
| FunctionView< bool(EntityID objectID)> | predicate = [](EntityID) -> bool { return true;} ) const |
Find all objects in the broadphase that contain a given point.
| point | world-space point to check. |
| filter | collision filter of the point. |
| entities | objects to collide against. |
| filterTest | test that potential colliders must pass in order to be considered for collision. The default test passes if the filters of both colliders want either collision or response (or both) on any layer(s). To limit to only colliders that want response (and skip trigger volumes, etc.), use CollisionFilterTest::RESPONSE. |
| callback | function to execute for each colliding object that passed the filter test. Returns a bool that specifies whether to stop searching or not. A value of true means to stop and return early, while a value of false means to continue processing the rest of the collisions. Note that at the end of the search, testPoint() will return true if at least one collision was found, regardless of what the callback returned. |
| predicate | condition that must be met in order to consider an entity for collision. Must return bool and accept the following parameter:
|
| 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 or predicate functions. |
| bool grem::physics::Broadphase< N >::testShape | ( | Length1D | minPenetrationDepth, |
| ShapeView< N > | shape, | ||
| CollisionFilter | filter, | ||
| const Transformation< N > & | transformation, | ||
| execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > | entities, | ||
| const CollisionAlgorithmOptions< N > & | options, | ||
| CollisionFilterTest | filterTest = {}, | ||
| FunctionView< bool(EntityID objectID, CollisionFilterTestResult filterTestResult)> | callback = [](EntityID) -> bool { return true;}, | ||
| FunctionView< bool(EntityID objectID)> | predicate = [](EntityID) -> bool { return true;} ) const |
Find all objects in the broadphase that collide with a given shape.
| minPenetrationDepth | minimum penetration depth for a contact to be considered to be colliding. |
| shape | shape to collide. |
| filter | collision filter of the shape. |
| transformation | world-space transformation of the shape. |
| entities | objects to collide against. |
| 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. The default test passes if the filters of both colliders want either collision or response (or both) on any layer(s). To limit to only colliders that want response (and skip trigger volumes, etc.), use CollisionFilterTest::RESPONSE. |
| callback | function to execute for each colliding object that passed the filter test. Returns a bool that specifies whether to stop searching or not. A value of true means to stop and return early, while a value of false means to continue processing the rest of the collisions. Note that at the end of the search, testShape() will return true if at least one collision was found, regardless of what the callback returned. |
| predicate | condition that must be met in order to consider an entity for collision. Must return bool and accept the following parameter:
|
| 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 or predicate functions. |
| bool grem::physics::Broadphase< N >::collide | ( | ShapeView< N > | shape, |
| CollisionFilter | filter, | ||
| const Transformation< N > & | transformation, | ||
| execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > | entities, | ||
| const CollisionAlgorithmOptions< N > & | options, | ||
| CollisionFilterTest | filterTest = {}, | ||
| FunctionView< bool(const CollisionResult &collision)> | callback = [](const CollisionResult &) -> bool { return true;}, | ||
| FunctionView< bool(EntityID objectID)> | predicate = [](EntityID) -> bool { return true;} ) const |
Find collisions between a shape and the objects in the broadphase.
| shape | shape to collide. |
| filter | collision filter of the shape. |
| transformation | world-space transformation of the shape. |
| entities | objects to collide against. |
| 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. The default test passes if the filters of both colliders want either collision or response (or both) on any layer(s). To limit to only colliders that want response (and skip trigger volumes, etc.), use CollisionFilterTest::RESPONSE. |
| callback | function to execute for each colliding object that passed the filter test. Returns a bool that specifies whether to stop searching or not. A value of true means to stop and return early, while a value of false means to continue processing the rest of the collisions. Note that at the end of the search, collide() will return true if at least one collision was found, regardless of what the callback returned. |
| predicate | condition that must be met in order to consider an entity for collision. Must return bool and accept the following parameter:
|
| 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 or predicate functions. |
| bool grem::physics::Broadphase< N >::raycast | ( | const Ray< N > & | ray, |
| CollisionFilter | filter, | ||
| execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > | entities, | ||
| CollisionFilterTest | filterTest = {}, | ||
| FunctionView< bool(const RaycastResult &hit)> | callback = [](const RaycastResult &) -> bool { return true;}, | ||
| FunctionView< bool(EntityID objectID)> | predicate = [](EntityID) -> bool { return true;} ) const |
Find collisions between a point and the objects in the broadphase when the point is cast like a ray from a given start position towards a given direction.
| ray | ray to cast. |
| filter | collision filter of the ray. |
| entities | objects to collide against. |
| filterTest | test that potential colliders must pass in order to be considered for collision. The default test passes if the filters of both colliders want either collision or response (or both) on any layer(s). To limit to only colliders that want response (and skip trigger volumes, etc.), use CollisionFilterTest::RESPONSE. |
| callback | function to execute for each colliding object that passed the filter test. Returns a bool that specifies whether to stop searching or not. A value of true means to stop and return early, while a value of false means to continue processing the rest of the collisions. Note that at the end of the search, raycast() will return true if at least one collision was found, regardless of what the callback returned. |
| predicate | condition that must be met in order to consider an entity for collision. Must return bool and accept the following parameter:
|
| 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 or predicate functions. |
|
inlinenodiscard |
Find the closest collision between a point and the objects in the broadphase when the point is cast like a ray from a given start position towards a given direction.
| ray | ray to cast. |
| filter | collision filter of the ray. |
| entities | objects to collide against. |
| filterTest | test that potential colliders must pass in order to be considered for collision. The default test passes if the filters of both colliders want either collision or response (or both) on any layer(s). To limit to only colliders that want response (and skip trigger volumes, etc.), use CollisionFilterTest::RESPONSE. |
| predicate | condition that must be met in order to consider an entity for collision. Must return bool and accept the following parameter:
|
| 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 predicate function. |
|
inlinenodiscard |
Find any collision between a point and the objects in the broadphase when the point is cast like a ray from a given start position towards a given direction.
| ray | ray to cast. |
| filter | collision filter of the ray. |
| entities | objects to collide against. |
| filterTest | test that potential colliders must pass in order to be considered for collision. The default test passes if the filters of both colliders want either collision or response (or both) on any layer(s). To limit to only colliders that want response (and skip trigger volumes, etc.), use CollisionFilterTest::RESPONSE. |
| predicate | condition that must be met in order to consider an entity for collision. Must return bool and accept the following parameter:
|
| 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 predicate function. |
| bool grem::physics::Broadphase< N >::shapecast | ( | ConvexShapeView< N > | convexShape, |
| CollisionFilter | filter, | ||
| const Transformation< N > & | transformation, | ||
| Direction< N > | direction, | ||
| Distance | maxDistance, | ||
| execution::Entities< const Position< N >, const Orientation< N >, const Scale< N >, const Collider< N >, const ObjectBounds< N > > | entities, | ||
| const CollisionAlgorithmOptions< N > & | options, | ||
| CollisionFilterTest | filterTest = {}, | ||
| FunctionView< bool(const ShapecastResult &hit)> | callback = [](const ShapecastResult &) -> bool { return true;}, | ||
| FunctionView< bool(EntityID objectID)> | predicate = [](EntityID) -> bool { return true;} ) const |
Find collisions between an object of a convex shape and the objects in the broadphase when the object is cast from a given start position towards a given direction.
| convexShape | convex shape to cast. |
| filter | collision filter of the shape. |
| transformation | world-space transformation of the shape. |
| direction | direction to cast in. |
| maxDistance | maximum hit distance. Must be non-negative. |
| entities | objects to collide against. |
| 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. The default test passes if the filters of both colliders want either collision or response (or both) on any layer(s). To limit to only colliders that want response (and skip trigger volumes, etc.), use CollisionFilterTest::RESPONSE. |
| callback | function to execute for each colliding object that passed the filter test. Returns a bool that specifies whether to stop searching or not. A value of true means to stop and return early, while a value of false means to continue processing the rest of the collisions. Note that at the end of the search, shapecast() will return true if at least one collision was found, regardless of what the callback returned. |
| predicate | condition that must be met in order to consider an entity for collision. Must return bool and accept the following parameter:
|
| 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 or predicate functions. |
|
inlinenodiscard |
Find the closest collision between an object of a convex shape and the objects in the broadphase when the object is cast from a given start position towards a given direction.
| convexShape | convex shape to cast. |
| filter | collision filter of the shape. |
| transformation | world-space transformation of the shape. |
| direction | direction to cast in. |
| maxDistance | maximum hit distance. Must be non-negative. |
| entities | objects to collide against. |
| 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. The default test passes if the filters of both colliders want either collision or response (or both) on any layer(s). To limit to only colliders that want response (and skip trigger volumes, etc.), use CollisionFilterTest::RESPONSE. |
| predicate | condition that must be met in order to consider an entity for collision. Must return bool and accept the following parameter:
|
| 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 predicate function. |
|
inlinenodiscard |
Find any collision between an object of a convex shape and the objects in the broadphase when the object is cast from a given start position towards a given direction.
| convexShape | convex shape to cast. |
| filter | collision filter of the shape. |
| transformation | world-space transformation of the shape. |
| direction | direction to cast in. |
| maxDistance | maximum hit distance. Must be non-negative. |
| entities | objects to collide against. |
| 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. The default test passes if the filters of both colliders want either collision or response (or both) on any layer(s). To limit to only colliders that want response (and skip trigger volumes, etc.), use CollisionFilterTest::RESPONSE. |
| predicate | condition that must be met in order to consider an entity for collision. Must return bool and accept the following parameter:
|
| 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 predicate function. |
|
friend |
Erase all entities that match a predicate from the broadphase.
| c | broadphase to erase from. |
| predicate | condition to check. |
| any | exception thrown by the predicate function. |