NVIDIAGameWorks / PhysX-3.4

NVIDIA PhysX SDK 3.4
https://www.nvidia.com/
2.35k stars 274 forks source link

Dissociation between collision detection and the phiscs solver #8

Closed juancaf9312 closed 7 years ago

juancaf9312 commented 7 years ago

I want to ask if there is a way i can just use the collision detection of a scence without use the pyshics solver. I want to know how can i use the collision detector on physX, take this information, aind then, implement the phisics solver by my own with the information retrieved from the physX collision detector.

kstorey-nvidia commented 7 years ago

You have a couple of options available to you.

(1) you could request in filter shaders to report contact information but not respond (raise PxPairFlag::eDETECT_DISCRETE_CONTACT, request contact notification but not PxPairFlag::eSOLVE_CONTACT). You would still find your bodies were integrated but perhaps you could work around this by settings your bodies to be kinematic and enabling kinematic-kinematic and kinematic-static collision detection. Or perhaps just overrule the PhysX integration.

(2) you could use the new immediate mode feature (see SnippetImmediateMode in the snippets) and just use the contact generation but implement your own collision response.

Option (2) is probably the path of least resistance. If you provide more details about what you want to achieve, perhaps we can find other options for you. HTH