NVIDIAGameWorks / PhysX

NVIDIA PhysX SDK
Other
3.11k stars 793 forks source link

Force CCD on "slow" moving rigid body #619

Closed LuwyStudio closed 1 year ago

LuwyStudio commented 1 year ago

As described in the documentation : PhysX 4.1 documentation - Advanced collision detection

Once enabled, CCD only activates between shapes whose relative speeds are above the sum of their respective CCD velocity thresholds. These velocity thresholds are automatically calculated based on the shape's properties and support non-uniform scales.

In the context of a simple arcade game with few moving actors, the performance loss of forcing CCD (or tweaking the minimum velocity to a lower number) on an actor might be worth the trade to reduce overlap in collisions.

For instance, i'm getting this kind of overlap from the discreet collision solver, even tho the rigid body has been marked to use CCD : image

If I increase the speed, I eventually get to the CCD min velocity threshold and collisions becomes more accurate : image

Is there any flag or tweak that can be used to affect the "automatic calculated velocity threshold" or is there any plan to expose more control over this behavior in the futur?

LuwyStudio commented 1 year ago

Not a bug, so not meant for issues, sorry, moved to https://github.com/NVIDIA-Omniverse/PhysX/discussions/