RavEngine
Loading...
Searching...
No Matches
physx::RaycastCCDManager Class Reference

Raycast-CCD manager. More...

#include <PxRaycastCCD.h>

Public Member Functions

 RaycastCCDManager (PxScene *scene)
 
bool registerRaycastCCDObject (PxRigidDynamic *actor, PxShape *shape)
 Register dynamic object for raycast CCD.
 
bool unregisterRaycastCCDObject (PxRigidDynamic *actor, PxShape *shape)
 Unregister dynamic object for raycast CCD.
 
void doRaycastCCD (bool doDynamicDynamicCCD)
 Perform raycast CCD. Call this after your simulate/fetchResults calls.
 

Detailed Description

Raycast-CCD manager.

Raycast-CCD is a simple and potentially cheaper alternative to the SDK's built-in continuous collision detection algorithm.

This implementation has some limitations:

Also, since it is raycast-based, the solution is not perfect. In particular:

  • small dynamic objects can still go through the static world if the ray goes through a crack between edges, or a small hole in the world (like the keyhole from a door).
  • dynamic-vs-dynamic CCD is very approximate. It only works well for fast-moving dynamic objects colliding against slow-moving dynamic objects.

Finally, since it is using the SDK's scene queries under the hood, it only works provided the simulation shapes also have scene-query shapes associated with them. That is, if the objects in the scene only use PxShapeFlag::eSIMULATION_SHAPE (and no PxShapeFlag::eSCENE_QUERY_SHAPE), then the raycast-CCD system will not work.

Member Function Documentation

◆ doRaycastCCD()

void RaycastCCDManager::doRaycastCCD ( bool  doDynamicDynamicCCD)

Perform raycast CCD. Call this after your simulate/fetchResults calls.

Parameters
[in]doDynamicDynamicCCDTrue to enable dynamic-vs-dynamic CCD (more expensive, not always needed)

◆ registerRaycastCCDObject()

bool RaycastCCDManager::registerRaycastCCDObject ( PxRigidDynamic *  actor,
PxShape *  shape 
)

Register dynamic object for raycast CCD.

Parameters
[in]actorobject's actor
[in]shapeobject's shape
Returns
True if success

◆ unregisterRaycastCCDObject()

bool RaycastCCDManager::unregisterRaycastCCDObject ( PxRigidDynamic *  actor,
PxShape *  shape 
)

Unregister dynamic object for raycast CCD.

Parameters
[in]actorobject's actor
[in]shapeobject's shape
Returns
True if success

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