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

This class is used to compute the narrow-phase collision detection between a sphere and a convex polyhedron. More...

#include <include/reactphysics3d/collision/narrowphase/SphereVsConvexPolyhedronAlgorithm.h>

Inheritance diagram for reactphysics3d::SphereVsConvexPolyhedronAlgorithm:
reactphysics3d::NarrowPhaseAlgorithm

Public Member Functions

 SphereVsConvexPolyhedronAlgorithm ()=default
 Constructor.
 
virtual ~SphereVsConvexPolyhedronAlgorithm () override=default
 Destructor.
 
 SphereVsConvexPolyhedronAlgorithm (const SphereVsConvexPolyhedronAlgorithm &algorithm)=delete
 Deleted copy-constructor.
 
SphereVsConvexPolyhedronAlgorithmoperator= (const SphereVsConvexPolyhedronAlgorithm &algorithm)=delete
 Deleted assignment operator.
 
bool testCollision (NarrowPhaseInfoBatch &narrowPhaseInfoBatch, uint32 batchStartIndex, uint32 batchNbItems, bool clipWithPreviousAxisIfStillColliding, MemoryAllocator &memoryAllocator)
 Compute the narrow-phase collision detection between a sphere and a convex polyhedron.
 
- Public Member Functions inherited from reactphysics3d::NarrowPhaseAlgorithm
 NarrowPhaseAlgorithm ()=default
 Constructor.
 
virtual ~NarrowPhaseAlgorithm ()=default
 Destructor.
 
 NarrowPhaseAlgorithm (const NarrowPhaseAlgorithm &algorithm)=delete
 Deleted copy-constructor.
 
NarrowPhaseAlgorithmoperator= (const NarrowPhaseAlgorithm &algorithm)=delete
 Deleted assignment operator.
 

Detailed Description

This class is used to compute the narrow-phase collision detection between a sphere and a convex polyhedron.

The sphere is basically a point with a margin around it. The idea of this method is to use the GJK algorithm first. If GJK reports that the two objects are separated, we are done. If GJK reports that the objects are overlapping in the sphere margin, GJK will also report a contact point and a contact normal. However, if GJK reports that the object are in deep penetration (the center of the sphere is inside the polyhedron) we run the SAT algorithm to get the contact point and contact normal. This is based on the "Robust Contact Creation for Physics Simulation" presentation by Dirk Gregorius.


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