SV: [ODE] Iterative solution

Martin C. Martin martin at metahuman.org
Wed Mar 19 17:12:02 2003


Russ Smith wrote:
> 
> > If you don't have position update, what happens when a stack of boxes
> > first penetrates the ground?
> 
> riiiiight ... i have been only thinking about systems that have the
> "correct it later" approach to interpenetration (i.e. ODE's current
> approach). i've not yet begun to think about the no-penetration case (so
> we're not really comparing apples to apples here!).
> 
> russ.
> 
> --
> Russ Smith
> http://www.q12.org/

But that's what I'm talking about.  I'm asking "how does the correction
work"?

Let's assume that the boxes are each 10 units tall, and that the bottom of
the lowest one is at z=-1.  Let's number the boxes from the bottom to the
top starting at zero.  So the positions of the center of each box are:

pos[0].z = 4
pos[1].z = 14
pos[2].z = 24
...

Assume a timestep of 0.1 sec.  We do collision and generate contact
constraints.  They are:

vel[0].z >= 10
vel[1].z >= vel[0].z
vel[2].z >= vel[1].z
...

Since they've been falling for a while (and in unison), lets assume the
initial velocities are all -2.  If you enforce in numerical order, then
the first iteration goes:

vel[0].z: 10  +4  +4  +4
vel[1].z: -2  +4  +1  +1
vel[2].z: -2  -2  +1  -0.5
vel[3].z: -2  -2  -2  -0.5
...

However, if you enforce in the opposite order, no velocities change until
the last constraint is considered.

- Martin