17-07-2024, 10:44 AM
(This post was last modified: 17-07-2024, 10:54 AM by josemendez.)
(17-07-2024, 10:28 AM)wenhao_zheng Wrote: So I wonder if the impulse of the Obi physics engine has a scale difference from the impulse of the Unity physics engine.
No, they are exactly the same. All units both in Unity and Obi use the International System: distances in meters, time in seconds and mass in kilograms, so forces in newtons and impulses in newton-seconds.
(17-07-2024, 10:28 AM)wenhao_zheng Wrote: So I am curious about how ObiRigidbody transfers the correct physical momentum to Rigidbody.
You can see the code for this in ObiBurstColliderCollisionConstraintsBatch.cs, line316:
Code:
BurstMath.ApplyImpulse(rigidbodyIndex, -lambda / frameEnd * contact.normal, ...);
Note how it divides the lambda impulse (which is a lagrange multiplier, the value you get on your contact callbacks) by time (frameEnd) once, to convert it to a normal impulse. You would divide again to convert the lambda impulse to a force. Also note the negative sign since the contact normal points away from the surface of the rigidbody.
kind regards,