[ODE] AutoDisable Disabled?
Jon Watte
hplus-ode at mindcontrol.org
Fri Oct 8 09:59:31 MST 2004
> The function dBodyIsEnabled() returns true, and also the edges of
> the cube are moving in a way that can be easily noticed (which
> obviously do not appen if I manually disable the cube after an
> almost-resting state is reached).
If your cube is visibly moving, I'm not surprised it's not being
disabled, as it will likely generate different contacts each step.
What you need to do is to make sure the cube doesn't visibly move
when "at resting".
You described in a different message that you step at a fixed time
step of 0.01, but then step an extra time to "exactly" catch up to
the step you want. I suggest you don't do this, as it's likely the
source of your instability. Instead, I suggest that you save the
remainder, and add that to the amount to step the next time around.
By the time you accumulate a whole 0.01 worth, you will step one
extra time. That way, the simulation will be maximally stable.
It's also un-clear whether you are using any damping. I've found
that internal rotational inertial (angular velocity) can keep a
simulation alive for very long, as there isnt much loss involved.
Each step, I suggest adding a counter-torque on the order of 0.01
times the current angular velocity. Do the same thing for linear
velocity. These internal dampenings will greatly stabilize the
system, and serve to model losses a "real world" physics system
would see from viscosity, friction, air drag, etc.
Last: if you are not prepared to take these steps to get the
simulation stable, then you're probably trying to ask too much
of ODE. While ODE is designed to provide robust, stable game
simulation, it is NOT an engineering grade simulation package.
Cheers,
/ h+
More information about the ODE
mailing list