[ODE] Possible solution to unstable rotating bodies problem

Megan Fox shalinor at gmail.com
Wed Apr 6 00:09:58 MST 2005

I can duplicate the problem in my own code with an object rolling
around on the ground.  It has plenty of contacts, but it still manages
to spin up to speed and fly off.

Why can't we just keep suggesting that people implement air drag, or
add some in-engine way of doing it ODE-side?  Does that not work in
certain cases?

-Megan Fox

> This refers to the problem where energy is added to rotating bodies
> (especially long, thin objects) due to numerical inaccuracy from
> explicit integration, described here:
> http://ode.org/ode-latest-userguide.html#sec_12_12_0
> Here's my idea to alleviate this problem:
> 1. Store each body's previous angular velocity (just the magnitude
> should be enough).
> 2. Every time step, check the bodies to see if they are "freely
> spinning," which is true if no contacts have been made with the body
> and no user forces have been added in the last time step.
> 3. If a body is freely spinning and its current angular velocity is
> greater than the previous angular velocity (i.e. by comparing
> magnitudes), then make the current angular velocity magnitude equal to
> that of the previous step (normalize the current angular velocity and
> scale it by the previous magnitude).
> This should ensure that freely spinning bodies can never increase
> their angular velocity.  Does this seem like a good solution?  Any
> other ideas?

More information about the ODE mailing list