Damping
[Rigid BodiesWorld]


Functions

ODE_API dReal dWorldGetLinearDampingThreshold (dWorldID w)
 Get the world's linear damping threshold.
ODE_API void dWorldSetLinearDampingThreshold (dWorldID w, dReal threshold)
 Set the world's linear damping threshold.
ODE_API dReal dWorldGetAngularDampingThreshold (dWorldID w)
 Get the world's angular damping threshold.
ODE_API void dWorldSetAngularDampingThreshold (dWorldID w, dReal threshold)
 Set the world's angular damping threshold.
ODE_API dReal dWorldGetLinearDamping (dWorldID w)
 Get the world's linear damping scale.
ODE_API void dWorldSetLinearDamping (dWorldID w, dReal scale)
 Set the world's linear damping scale.
ODE_API dReal dWorldGetAngularDamping (dWorldID w)
 Get the world's angular damping scale.
ODE_API void dWorldSetAngularDamping (dWorldID w, dReal scale)
 Set the world's angular damping scale.
ODE_API void dWorldSetDamping (dWorldID w, dReal linear_scale, dReal angular_scale)
 Convenience function to set body linear and angular scales.
ODE_API dReal dWorldGetMaxAngularSpeed (dWorldID w)
 Get the default maximum angular speed.
ODE_API void dWorldSetMaxAngularSpeed (dWorldID w, dReal max_speed)
 Set the default maximum angular speed for new bodies.
ODE_API void dBodySetDampingDefaults (dBodyID b)
 Resets the damping settings to the current world's settings.
ODE_API dReal dBodyGetLinearDamping (dBodyID b)
 Get the body's linear damping scale.
ODE_API void dBodySetLinearDamping (dBodyID b, dReal scale)
 Set the body's linear damping scale.
ODE_API dReal dBodyGetAngularDamping (dBodyID b)
 Get the body's angular damping scale.
ODE_API void dBodySetAngularDamping (dBodyID b, dReal scale)
 Set the body's angular damping scale.
ODE_API void dBodySetDamping (dBodyID b, dReal linear_scale, dReal angular_scale)
 Convenience function to set linear and angular scales at once.
ODE_API dReal dBodyGetLinearDampingThreshold (dBodyID b)
 Get the body's linear damping threshold.
ODE_API void dBodySetLinearDampingThreshold (dBodyID b, dReal threshold)
 Set the body's linear damping threshold.
ODE_API dReal dBodyGetAngularDampingThreshold (dBodyID b)
 Get the body's angular damping threshold.
ODE_API void dBodySetAngularDampingThreshold (dBodyID b, dReal threshold)
 Set the body's angular damping threshold.

Detailed Description

Damping serves two purposes: reduce simulation instability, and to allow the bodies to come to rest (and possibly auto-disabling them).

Bodies are constructed using the world's current damping parameters. Setting the scales to 0 disables the damping.

Here is how it is done: after every time step linear and angular velocities are tested against the corresponding thresholds. If they are above, they are multiplied by (1 - scale). So a negative scale value will actually increase the speed, and values greater than one will make the object oscillate every step; both can make the simulation unstable.

To disable damping just set the damping scale to zero.

You can also limit the maximum angular velocity. In contrast to the damping functions, the angular velocity is affected before the body is moved. This means that it will introduce errors in joints that are forcing the body to rotate too fast. Some bodies have naturally high angular velocities (like cars' wheels), so you may want to give them a very high (like the default, dInfinity) limit.

Note:
The velocities are damped after the stepper function has moved the object. Otherwise the damping could introduce errors in joints. First the joint constraints are processed by the stepper (moving the body), then the damping is applied.

The damping happens right after the moved callback is called; this way it still possible use the exact velocities the body has acquired during the step. You can even use the callback to create your own customized damping.


Function Documentation

ODE_API dReal dBodyGetAngularDamping ( dBodyID  b  ) 

Get the body's angular damping scale.

Remarks:
If the body's angular damping scale was not set, this function returns the world's angular damping scale.

ODE_API void dBodySetAngularDamping ( dBodyID  b,
dReal  scale 
)

Set the body's angular damping scale.

Parameters:
scale The angular damping scale. Should be in the interval [0, 1].
Remarks:
From now on the body will not use the world's angular damping scale until dBodyResetAngularDamping() is called.
See also:
dBodyResetAngularDamping()

ODE_API void dBodySetAngularDampingThreshold ( dBodyID  b,
dReal  threshold 
)

Set the body's angular damping threshold.

Parameters:
threshold The angular threshold to be used. Damping is only used if the angular speed is above this limit.

ODE_API void dBodySetDamping ( dBodyID  b,
dReal  linear_scale,
dReal  angular_scale 
)

Convenience function to set linear and angular scales at once.

Parameters:
linear_scale The linear damping scale. Should be in the interval [0, 1].
angular_scale The angular damping scale. Should be in the interval [0, 1].
See also:
dBodySetLinearDamping() dBodySetAngularDamping()

ODE_API void dBodySetLinearDamping ( dBodyID  b,
dReal  scale 
)

Set the body's linear damping scale.

Parameters:
scale The linear damping scale. Should be in the interval [0, 1].
Remarks:
From now on the body will not use the world's linear damping scale until dBodySetDampingDefaults() is called.
See also:
dBodySetDampingDefaults()

ODE_API void dBodySetLinearDampingThreshold ( dBodyID  b,
dReal  threshold 
)

Set the body's linear damping threshold.

Parameters:
threshold The linear threshold to be used. Damping is only applied if the linear speed is above this limit.

ODE_API dReal dWorldGetMaxAngularSpeed ( dWorldID  w  ) 

Get the default maximum angular speed.

See also:
dBodyGetMaxAngularSpeed()

ODE_API void dWorldSetAngularDamping ( dWorldID  w,
dReal  scale 
)

Set the world's angular damping scale.

Parameters:
scale The angular damping scale that is to be applied to bodies. Default is 0 (no damping). Should be in the interval [0, 1].

ODE_API void dWorldSetAngularDampingThreshold ( dWorldID  w,
dReal  threshold 
)

Set the world's angular damping threshold.

Parameters:
threshold The damping won't be applied if the angular speed is below this threshold. Default is 0.01.

ODE_API void dWorldSetDamping ( dWorldID  w,
dReal  linear_scale,
dReal  angular_scale 
)

Convenience function to set body linear and angular scales.

Parameters:
linear_scale The linear damping scale that is to be applied to bodies.
angular_scale The angular damping scale that is to be applied to bodies.

ODE_API void dWorldSetLinearDamping ( dWorldID  w,
dReal  scale 
)

Set the world's linear damping scale.

Parameters:
scale The linear damping scale that is to be applied to bodies. Default is 0 (no damping). Should be in the interval [0, 1].

ODE_API void dWorldSetLinearDampingThreshold ( dWorldID  w,
dReal  threshold 
)

Set the world's linear damping threshold.

Parameters:
threshold The damping won't be applied if the linear speed is below this threshold. Default is 0.01.

ODE_API void dWorldSetMaxAngularSpeed ( dWorldID  w,
dReal  max_speed 
)

Set the default maximum angular speed for new bodies.

See also:
dBodySetMaxAngularSpeed()


Generated on Sun May 10 15:42:27 2009 for Open Dynamics Engine by  doxygen 1.5.7