[ODE] Angular-velocity autodisabling considered broken

Alen Ladavac alenl-ml at croteam.com
Wed Sep 15 20:00:19 MST 2004


>1) If you sleep objects based on an instantaneous velocity reading, then

Did I mention using instantaneous velocities? Nope, I don't think so. :o)
The key is that if an object is ready to sleep, it goes to sleep _and_ its
velocity is forced to 0. Note that it is not necessarilly 0 ATM, but it is
below some threshold (and has been so for a number of steps). Setting it to
0 removes its energy completely, and therefore decreases the chance that it
will continue jittering.

>if one object is awake and moving, it will typically exert enough force on
>the other bodies that the other bodies have to wake up. That's what we
>mean when we say that when one body won't sleep, it'll keep the island
>awake.

It doesn't have to be that way. You can have half of an island asleep and
the other half moving. Actually, you don't win anything performance wise
compared to letting entire island be awake - you still have to "wake" all
the objects in order to perform collision checks and other calculations on
them - but if this is done right, they are not moving/jittering. The gist of
it is that the objects that were once asleep tend to stay that way, and the
"sleeeping shockwave" propagates through the island, gradually stopping it
over a several steps, or even several seconds. If you do it right, one
jittering object can wiggle arund for seconds, without moving the rest of
the island even a bit. If you insist on all-or-nothing sleeping, then
situations like this (single object not being able to come to rest for
seconds) will certainly blow the entire island into pieces.

The key is in setting velocity to 0 when an object is ready to sleep,
regardless of what its neighbors do. So that you don't pull this step's
errors into the next one. This thing helps a lot, IME.

HTH,

Alen


----- Original Message -----
From: "Jon Watte" <hplus-ode at mindcontrol.org>
To: "Alen Ladavac" <alenl-ml at croteam.com>; <ode at q12.org>
Sent: Wednesday, September 15, 2004 5:56 PM
Subject: RE: [ODE] Angular-velocity autodisabling considered broken



> One thing about jittery islands... don't know exactly how ODE handles
> sleeping, but in our simulator, we noticed that it is better to handle
> sleeping per-object than per island. An object that is determined to be
> ready to sleep is put to sleep and its velocities are reset immediatelly.
No
> matter that the rest of island may still be moving. This removes energy
from
> islands that are on the verge of sleeping, making them less and less
jittery
> over time. And it prevents slow creeping of objects, because objects that
> would otherwise move very slowly are forced to 0 velocity in every step,
> hence they cannot move at all. You must be very careful about properly
> waking up the objects in the next step, though. :)

There are two problems with this approach, if you were to use it for the
general case (i e, built-into ODE).

1) If you sleep objects based on an instantaneous velocity reading, then
blocks that tip up on an edge, but will fall down again (eventually), will
fall asleep and remain tilted forever.

2) All sleeping approaches I know of apply to individual objects only. The
problem is that you have to wake up objects when they are hit by other
objects, or when forces are applied through other joints. Within an island,
if one object is awake and moving, it will typically exert enough force on
the other bodies that the other bodies have to wake up. That's what we
mean when we say that when one body won't sleep, it'll keep the island
awake.

Cheers,

/ h+





More information about the ODE mailing list