[ODE] Infinite sliding... ?

John Miles jmiles at pop.net
Wed Aug 16 16:23:35 MST 2006


> > // Also so this for angular vel with a coefficient greater than 1
> > const dReal* av = dBodyGetLinearVel(it->body);
> > dBodyAddForce(it->body, av[0] * 2.0, av[1] * 2.0, av[2] * 2.0);
>
> Lookas all wrong. First, it uses the linear velocity. Second, it ADDS to
> the velocity (because 2.0 is not negative). Third, it still uses force.
> You probably want to write this as:
>
>    dReal const * av = dBodyGetAngularVel(it->body);
>    dBodyAddTorque(it->body, av[0] * -0.03, av[1] * -0.03, av[2] * -0.03);
>
> However, you really DO need to enable auto-sleeping. That's how you get
> things to "stick" rock solid, in any simulator I've seen.

Note that auto-disabling works quite a bit better when you modify ODE to use
an average of the last few frames' velocity.  That makes the auto-sleep test
more sensitive to jitter than to slow-motion movement, which is usually what
you want.

-- john



More information about the ODE mailing list