[ODE] damping functions

Daniel K. O. danielko.listas at gmail.com
Sun Nov 25 17:13:30 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.

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);


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. :)



Please comment.



-- 
Daniel K. O.
"The only way to succeed is to build success yourself"


More information about the ODE mailing list