Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How to get collision impulse properly
#1
I read collision normal impulse, it's said that unit is newtons x time x time, however I am unable to get timestep independent force.
I tried to divide that force by substep time squared or timestep squared, but the value I get is not similar - I would expect to get very similar force whatever the substep count is 4 or 8.
The goal is to detect if I push against something with force greater than X.

Also is tangent impulse never set? Or it's set only for particles or mesh colliders (I use SDF)?
Reply
#2
(09-10-2025, 01:34 PM)Qriva0 Wrote: I read collision normal impulse, it's said that unit is newtons x time x time, however I am unable to get timestep independent force.
I tried to divide that force by substep time squared or timestep squared, but the value I get is not similar - I would expect to get very similar force whatever the substep count is 4 or 8.

Hi!

Forces are refined over multiple iterations per substep, but they're calculated from scratch for each substep. Callbacks are called at the end of the step after all substeps have taken place, so they only contain data for the most recent substep. This applies to contact impulses as well as all constraint lambda multipliers in Obi.

As a result you won't get the same results with 4 and 8 substeps. This is something I'm actively working to improve in Obi 7.2, by returning the max/average over all substeps.

(09-10-2025, 01:34 PM)Qriva0 Wrote: Also is tangent impulse never set? Or it's set only for particles or mesh colliders (I use SDF)?

Should be set if you're using a collision material with friction greater than zero. Otherwise it's not set, since there's no force being applied in the tangent direction.
Reply
#3
Also note that contact normal/tangent/bitangent direction is the one calculated at the start of the step (which gets reused over all substeps). In Obi 7.2 contact constraint gradients are recalculated every substep, just like in: https://matthias-research.github.io/page...Bodies.pdf
Reply
#4
(09-10-2025, 01:51 PM)josemendez Wrote: Forces are refined over multiple iterations per substep, but they're calculated from scratch for each substep. Callbacks are called at the end of the step after all substeps have taken place, so they only contain data for the most recent substep. This applies to contact impulses as well as all constraint lambda multipliers in Obi.

As a result you won't get the same results with 4 and 8 substeps. This is something I'm actively working to improve in Obi 7.2, by returning the max/average over all substeps.

Ok, so that make sense. So in short this is expected result currently and the value should be divided by substep squared.

(09-10-2025, 01:51 PM)josemendez Wrote: Should be set if you're using a collision material with friction greater than zero. Otherwise it's not set, since there's no force being applied in the tangent direction.
I am going to double check if there is anything that might cause this, but I think contact.tangentImpulse and bitangent is always 0 and there are materials with friction for both actor and collider. I read them on simulation end, instead of oncollide, but I guess there should be no difference.
Reply