[ODE] Possible solution to unstable rotating bodies problem

Alen Ladavac alenl-ml at croteam.com
Thu Apr 7 07:56:58 MST 2005

> Also I'm interested in the earlier point about storing the penetration
> velocity separate to avoid the "bouncing" effect.  This seems an
> incredibly great idea, as objects right now can bounce more just from
> collisions than from the actual bounce parameter!  Thats very annoying,
> particularly for objects which shouldn't be that rubbery.

This is even simpler than it looks at first. When giving the contact to the
solver, you need to clamp the correctional velocity caused by penetration.
In most joints, you'd want to just take the error, multiply it with ERP and
put in the right hand side. With contact, you would want to clamp the result
of that multiplication. The number that you use for clamping here is the
maximum separation velocity introduced by the contact. 1 m/s works good

If you are messing with that part, I'd also suggest adding a minimum
residual penetration, so that boxes can rest more steadily on one another.
This turns into one line:

correction = min(erp*max(penetrationdepth-minpenetrationdepth, 0.0f),

possible values: minpenetrationdepth=0.015f, maxcorrectionvelocity=1.0f


More information about the ODE mailing list