ReactPhysics3D
v0.10.2
C++ Physics engine library

This class is used to compute the narrowphase collision detection between a sphere and a convex polyhedron. More...
#include <include/reactphysics3d/collision/narrowphase/SphereVsConvexPolyhedronAlgorithm.h>
Public Member Functions  
SphereVsConvexPolyhedronAlgorithm ()=default  
Constructor.  
virtual  ~SphereVsConvexPolyhedronAlgorithm () override=default 
Destructor.  
SphereVsConvexPolyhedronAlgorithm (const SphereVsConvexPolyhedronAlgorithm &algorithm)=delete  
Deleted copyconstructor.  
SphereVsConvexPolyhedronAlgorithm &  operator= (const SphereVsConvexPolyhedronAlgorithm &algorithm)=delete 
Deleted assignment operator.  
bool  testCollision (NarrowPhaseInfoBatch &narrowPhaseInfoBatch, uint32 batchStartIndex, uint32 batchNbItems, bool clipWithPreviousAxisIfStillColliding, MemoryAllocator &memoryAllocator) 
Compute the narrowphase 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 copyconstructor.  
NarrowPhaseAlgorithm &  operator= (const NarrowPhaseAlgorithm &algorithm)=delete 
Deleted assignment operator.  
This class is used to compute the narrowphase 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.