ReactPhysics3D  v0.10.1
C++ Physics engine library
reactphysics3d::CollisionDetectionSystem Class Reference

This class computes the collision detection algorithms. More...

#include <include/reactphysics3d/systems/CollisionDetectionSystem.h>

Public Member Functions

 CollisionDetectionSystem (PhysicsWorld *world, ColliderComponents &collidersComponents, TransformComponents &transformComponents, BodyComponents &bodyComponents, RigidBodyComponents &rigidBodyComponents, MemoryManager &memoryManager, HalfEdgeStructure &triangleHalfEdgeStructure)
 Constructor.
 
 ~CollisionDetectionSystem ()=default
 Destructor.
 
 CollisionDetectionSystem (const CollisionDetectionSystem &collisionDetection)=delete
 Deleted copy-constructor.
 
CollisionDetectionSystemoperator= (const CollisionDetectionSystem &collisionDetection)=delete
 Deleted assignment operator.
 
CollisionDispatchgetCollisionDispatch ()
 Set the collision dispatch configuration.
 
void addCollider (Collider *collider, const AABB &aabb)
 Add a collider to the collision detection.
 
void removeCollider (Collider *collider)
 Remove a collider from the collision detection.
 
void updateCollider (Entity colliderEntity)
 Update a collider (that has moved for instance)
 
void updateColliders ()
 Update all the enabled colliders.
 
void addNoCollisionPair (Entity body1Entity, Entity body2Entity)
 Add a pair of bodies that cannot collide with each other.
 
void removeNoCollisionPair (Entity body1Entity, Entity body2Entity)
 Remove a pair of bodies that cannot collide with each other.
 
void askForBroadPhaseCollisionCheck (Collider *collider)
 Ask for a collision shape to be tested again during broad-phase. More...
 
void notifyOverlappingPairsToTestOverlap (Collider *collider)
 Notify that the overlapping pairs where a given collider is involved need to be tested for overlap.
 
void reportContactsAndTriggers ()
 Report contacts and triggers.
 
void computeCollisionDetection ()
 Compute the collision detection.
 
void raycast (RaycastCallback *raycastCallback, const Ray &ray, unsigned short raycastWithCategoryMaskBits) const
 Ray casting method.
 
bool testOverlap (Body *body1, Body *body2)
 Return true if two bodies (collide) overlap.
 
void testOverlap (Body *body, OverlapCallback &callback)
 Report all the bodies that overlap (collide) with the body in parameter.
 
void testOverlap (OverlapCallback &overlapCallback)
 Report all the bodies that overlap (collide) in the world.
 
void testCollision (Body *body1, Body *body2, CollisionCallback &callback)
 Test collision and report contacts between two bodies.
 
void testCollision (Body *body, CollisionCallback &callback)
 Test collision and report all the contacts involving the body in parameter.
 
void testCollision (CollisionCallback &callback)
 Test collision and report contacts between each colliding bodies in the world.
 
MemoryManagergetMemoryManager () const
 Return a reference to the memory manager.
 
PhysicsWorldgetWorld ()
 Return a pointer to the world.
 
EventListenergetWorldEventListener ()
 Return the world event listener.
 
const AABB getWorldAABB (const Collider *collider) const
 Return the world-space AABB of a given collider.
 

Detailed Description

This class computes the collision detection algorithms.

We first perform a broad-phase algorithm to know which pairs of bodies can collide and then we run a narrow-phase algorithm to compute the collision contacts between bodies.

Member Function Documentation

◆ askForBroadPhaseCollisionCheck()

RP3D_FORCE_INLINE void reactphysics3d::CollisionDetectionSystem::askForBroadPhaseCollisionCheck ( Collider collider)

Ask for a collision shape to be tested again during broad-phase.

We simply put the shape in the array of collision shape that have moved in the previous frame so that it is tested for collision again in the broad-phase.


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