[ODE] Vehicle Speed (Generic Units to Real World Units)

Martin C. Martin martin at metahuman.org
Wed Jul 30 08:40:02 2003


> I am calling dWorldStep() with a constant .015.  Currently, I calculate how
> many .015 steps I need to match the time that has elapsed since last render.

Maybe there's a bug in that code, from the way you're describing it, it
doesn't take into account the physics time.

Try this: when your app starts, record the wall clock time.  Each time you
call dWorldStep(), add the time you pass to it to an accumulator.  Then
make sure that the time that's passed since the app started is roughly the
same as the total simulated time, i.e. the value in the accumulator.  In
that case, the ratio of times is 1:1.  1:1 will be by far the easiest
choice for debugging.

- Martin