[ODE] Damping

james at 6msoft.com james at 6msoft.com
Fri Jul 30 12:16:32 MST 2004


I see what you are saying, but the fact is, I don't think you will find a
physics engine on the planet that is perfectly deterministic with
different tickrates. And certainly using forces wouldn't be either
(specially when they dont take tickrate into account at all). Having an
exponential curve for damping might make it more correct though, so I will
look into it. Might also allow for different interpolations (like how you
do fogging in OpenGL), so you can do pure linear or exponential.

-James

>
>> the equation is something like...
>
>> a = damping * timeStep
>> a = clamp(a, 0, 1)
>> vel *= 1 - a
>
> This looks wrong. If I step five times with time step 0.2
> using this method, I will get a different end velocity than
> if I step twenty times with time step 0.05. I believe you
> need to involve a powf() in the calculation of the actual
> timestep dependent damping to apply, if you apply it to
> velocity in this way. Alas, powf() is sadly quite slow :-(
>
> If you don't want to involve the powf(), I'd suggest not
> scaling damping by timestep at all, and save both a multiply
> per body and the clamp (which may possibly branch, which may
> be more expensive than a divide).
>
>> For disabling, right now setting the damping of a body to 0 disables it,
>> but currently no way across a world (but it can obviously be done.
>
> May I suggest that you make the damping API mirror the
> auto-disabling API as closely as possible, for consistency?
>
> Cheers,
>
> 			/ h+
>
>



More information about the ODE mailing list