[ODE] Objects moving "of their own free will"

Jon Watte (ODE) hplus-ode at mindcontrol.org
Thu Jul 7 16:10:16 MST 2005


0) make sure you're using a constant step size. If you vary your step 
size at all, you will introduce jitter because of the ODE integrator, 
even for bodies at rest (because "rest" means that the ground contact 
cancels out the gravity acceleration for the current time step).

Once you have a fixed time step, you may need to try a few other things:

1) add a small dampening force and torque each step -- torque is more 
important than force, but both help:

   MyVector4 lvel, avel;
   dBodyGetLinearVelocity( body, lvel );
   dBodyGetAngularVelocity( body, avel );
   lvel *= -0.02;
   avel *= -0.02;
   dBodyAddForce( body, lvel );
   dBodyAddTorque( body, avel );

There may be some support in the unstable ODE for dampening now; I 
haven't kept up with patches.

2) you may need to slightly increase the tolerances for auto-disabling, 
if bodies don't become auto-disabled on their own after the first two 
changes.

Cheers,

             / h+


Eyal Teler wrote:
> In the box stack test, when I drop a lot of boxes, after they're
> supposedly at rest, I still see one here and there seemingly trying to
> push itself from under others, very slowly pushing them out of the way.
> 
> This also seems to happen in my program (which is natural, since I took
> the box stack as an example of how to use ODE). Objects never seem at
> rest. I have a brick building, and the bricks just wobble back and forth
> constantly. I set auto-disable using dWorldSetAutoDisableFlag, but it
> never happens.
> 
> [The doesn't only look funny up close, but also ends up slower than
> using Tokamak. Since my main reason to try ODE was to allow for very
> large scenes (with the help of the collision spaces), that's not very 
> good.]
> 
>     Eyal
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 
> 


More information about the ODE mailing list