[ODE] Boxes floating in a plane

Martijn Buijs buijs512 at planet.nl
Tue Nov 7 16:43:44 MST 2006

Jon Watte (ODE) wrote:
> Martijn Buijs wrote:
>> So the main issue is that ODE 'pushes' (dBodyAddForce) the objects out 
>> of each other instead of 'moving' (dBodySetPosition) them.
> The reason it does that is because it solves all constraints on all 
> objects at the same time, finding a "globally optimal" solution. This 
> helps in cases where objects get squished into corners, etc.

Yes, that is one of the advantages ODE's solver has, it is consistent in all situations and very 
predictable. The disadvantage is that there will be penetration in all situations.

Position fixing reduces that to a great degree, though it may not work in every situation and thus 
seem unpredictable (though additional work may reduce).

So it may be a matter of taste which to use.

> How does your solver deal with a case where an object gets wedged in a 
> narrow corner, and moving it out of one of the surfaces will make it 
> move further into the other? Or do you run swept intersection, and abort 
> the time step at the first contact? (Evenso, you'll get problems with  > moving-moving intersections).

I'm not doing swept intersection, with exception of projectile collisions. A collision plane is 
stored for each contact, which is then used as planar constraint. When a box is dropped into a 
v-cliff it won't be pushed into the opposite surface. I didn't implement it properly (yet) but it 
seems to work fine for most common simple cases I tested (static-moving box to v-cliff, 
moving-moving box stack).

However, the point I was trying to make is that the problem isn't 'fixing' the penetration, it is 
the way the object 'reacts'. Penetration is unavoidable, it is going to happen sooner or later in 
any simulation.

If you run a simulation in ODE with a box initially sunk into a ground plane, it will fly up violently.
If you apply the intersection correction in the same situation, the box won't even be activated. It 
will just be moved up the first update, sit on the plane, and nothing else will happen in subsequent 

Personally I don't care what an object would do when it is intersecting. It doesn't happen in nature 
so the behavior is undefined and we can do whatever we want to solve it. But from the moment the 
object is no longer intersecting, I would expect it to behave 'normal'. Which it doesn't in ODE 
because it 'inherits' the correction force as part of it's momentum.


More information about the ODE mailing list