[ODE] damping functions

Remi Ricard remi.ricard at simlog.com
Mon Nov 26 07:01:50 MST 2007

> Right before applying the changes, I went to look how Bullet does it.
> Instead of calculating a damping force/torque, it just takes the
> linear/angular velocities from the last timestep and multiply them by a
> per-body damping factor. If the velocity is not above a lower bound, it
> is zeroed.
I think it should be preferable to have a different scale for linear and 

> Should we follow this approach? If we let the user specify a lower
> bound, the current proposal gets a bit cumbersome:
> dBodyDamp(body, linScale, linThreshold, angScale, angThreshold);
> Considering that the thresholds will probably not change, it makes sense
> to store them in the body; actually we already have them, in the
> auto-disable feature; is there any reason for the user not wanting to
> use auto-disabling while using the damping?
> Other idea: global damping, much like the global auto-disable settings.
> Is there any problem linking the damping to the auto-disabling? My idea
> now is to make it like this:
> // Defaults for newly created bodies
> void dWorldSetLinearDamp(world, scale);
> void dWorldSetAngularDamp(world, scale);
If defined this should apply to all bodies not only to the body created 
after setting the value.

> void dBodySetLinearDamp(body, scale); // for symmetry with get
> void dBodySetAngularDamp(body, scale); // for symmetry with get
> void dBodySetDamp(body, linearScale, angularScale); // convenience
> // These just map to the auto-disable threshold functions,
> // defined only for consistency.
> void dWorldSetLinearDampThreshold(world, threshold);
> void dWorldSetAngularDampThreshold(world, threshold);
> void dBodySetLinearDampThreshold(body, threshold);
> void dBodySetAngularDampThreshold(body, threshold);
> Now the damping happens automatically during the step function.
> Considering the damping helps the auto-disabling, it would be more
> correct to add those functions to the AutoDisable group; but the
> function names would be too long. :)

I like the above name !


More information about the ODE mailing list