Repository navigation
Compliant/Soft contacts for rigid bodies #2131
|
Hi! I am trying to recreate physx compliant contacts, but found no way to do it without patching jolt. My idea of an implementation is straight-forward:
This seems to work (not for ccd though, havent figured it out yet)
|
Replies: 1 comment 1 reply
|
Jolt doesn't use soft constraints to resolve contacts. It uses Baumgarte stabilization with the caveat that the stabilization only affects positions and not velocities. So when a body is pushed out of collision, it stops the moment it leaves collision. You can make contacts 'softer' by reducing If you want soft contacts (as in a spring) then you indeed need to modify Jolt in the way you describe. Note that you also need to remove the code in Can I ask why you want to have soft contacts? What are you trying to achieve? |
Jolt doesn't use soft constraints to resolve contacts. It uses Baumgarte stabilization with the caveat that the stabilization only affects positions and not velocities. So when a body is pushed out of collision, it stops the moment it leaves collision. You can make contacts 'softer' by reducing
PhysicsSettings::mBaumgarte.If you want soft contacts (as in a spring) then you indeed need to modify Jolt in the way you describe. Note that you also need to remove the code in
ContactConstraintManager::sSolvePositionConstraintto disable Baumgarte stabilization.Can I ask why you want to have soft contacts? What are you trying to achieve?