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. |
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.
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.
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.
scale | The angular damping scale. Should be in the interval [0, 1]. |
ODE_API void dBodySetAngularDampingThreshold | ( | dBodyID | b, | |
dReal | threshold | |||
) |
Set the body's angular damping threshold.
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.
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]. |
ODE_API void dBodySetLinearDamping | ( | dBodyID | b, | |
dReal | scale | |||
) |
Set the body's linear damping scale.
scale | The linear damping scale. Should be in the interval [0, 1]. |
ODE_API void dBodySetLinearDampingThreshold | ( | dBodyID | b, | |
dReal | threshold | |||
) |
Set the body's linear damping threshold.
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 | ) |
ODE_API void dWorldSetAngularDamping | ( | dWorldID | w, | |
dReal | scale | |||
) |
Set the world's angular damping scale.
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.
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.
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.
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.
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 | |||
) |