[ODE] simulation steps in a game

Russ Smith russ at q12.org
Wed Apr 10 19:16:01 2002


> The constraint solver in ODE actually uses the (previous?) time step
> to figure out the constraint forces.  This can break horribly if, for
> some reason, you have a small time step followed by a much larger
> time step.

actually this is not strictly true. the only information that ODE
passes between time steps is the positions and velocities of all the
bodies (and this is true of all rigid body sims, not just ODE). the
constraint forces are calculated using purely local information.
the timestep problem you mention (small followed by large) is due to
the fact that ODE's error-control mechanism (governed by ERP) adds in
some real "physical" velocity to reduce the position error, rather than
just fixing the position directly. for most situations this works well
and is no more "non-physical" than other methods. in the small-large
timestep case it fails, because the velocity correction is timestep
dependent (i.e. the small velocity correction calculated during the
small timestep becomes a much-too-large correction during the large
timestep). there is a good fix for this problem, which i will
eventually add to ODE (as time permits). there'll be a dWorld switch
to turn it on, as there is a slight performance cost.

russ.

--
Russell Smith
http://www.q12.org