# [ODE] how exactly Contact Joints work?

Roland Plüss roland at rptd.dnsalias.net
Tue Aug 29 15:16:03 MST 2006

```ok, so far i got it. i played a bit around with contact joints as for
some reason they don't do what i want them to do. for the time beeing i
work with one contact joint to get things working. as far as i
understood ode requires the depth of penetration "after" the collision
occured, hence, the two objects already penetrate. so if i use my box it
would be sitting slightly inside the floor. now comes the choking point
which gives me headaches. i am required to test for collisions in the
"future". so i know for example that my box does not hit the floor
before the simuation step but during the step it hits the floor. so i
wanted to simply consider this as if the collision happened right at the
beginning of the simulation step. for this i calculate the depth after
the collision and feed this to the contact joint with the collision
point at time T. during the next simulation step though the box is at
the position of no collision while the contact joint takes effect.

should this not work out too? or am i there at a loss? currently i got
so far that the collision seems to work just with a subtle wobbling of
the box on the floor ( you need to get very close with the camera to see
it ). i'm not sure if this is due to my little "hack" here or simply
precision problems.

Nguyen Binh wrote:
> ODE contact joint form a complimentarity constraint in the big matrix.
> The complimentarity constraint is:
> 0<= v comp. d >=0, where v is relative normal velocity of the two
> contact points and d is penetration depth along the normal.
>
> The stepper in ODE just need to solve the LCP. So if the result is
> feasible, then the contacts condition should be satisfied.
> Also, there are many ways to solve a LCP...
>
> The base line is: if you view the contact as a methematical condition
> and the stepper just try to solve for them then you won't have
> to worry about one, double or multiple contacts.
>
> Hope it helps.
>
> On 8/29/06, *Roland Plüss* <roland at rptd.dnsalias.net
> <mailto:roland at rptd.dnsalias.net>> wrote:
>
>     scanning through the documentation i could not really find this
>     one out.
>     so far i know that a contact joint composes of a Hit-Point, a
>     Normal and
>     a Depth. ode has no knowledge about the shape of the colliding
>     geometry
>     hence it only knows the current Body Position, Body Velocity, Body
>     Momentum and those three values there. now how exactly does it
>     work with
>     the quick step function?
>
>     so let's take an example of a box like this:
>
>        \
>     +--+\
>     |  | \   velocity: down-right
>     +--+  \
>     -------
>
>     there exist hence two contact points: one with the sloped wall and one
>     with the floor. this yields two contact joints with two different
>     depths. now does ode calculate the force needed to push the object
>     out
>     of each contact point once or for every iteration? how does it
>     know when
>     to stop? using the current object position compared with the
>     position at
>     the start of the function and then comparing with depth?
>
>     how in this situation?
>
>     +------+
>     |      |    velocity: down
>     +------+
>     --+  +--
>       |  |
>
>     the box now rests on a slit in the ground. there are two contact
>     joints.
>     calculating the force needed to push the object away from the
>     ground for
>     each of the contact results twice the force needed.
>
>     how does ode handle these double-contact situations? i try to
>     figure out
>     how i need to use contact joints to obtain a correct result and just
>     can't get my head around it.
>
>     --
>
>     - Game: Epsylon ( http://epsylon.rptd.dnsalias.net/ )
>     - Game Engine: Drag(en)gine (
>     http://epsylon.rptd.dnsalias.net/dragengine.php )
>     - Normal Map Generator: DENormGen (
>     http://epsylon.rptd.dnsalias.net/denormgen.php )
>
>
>
>     _______________________________________________
>     ODE mailing list
>     ODE at q12.org <mailto:ODE at q12.org>
>     http://q12.org/mailman/listinfo/ode
>
>
>
>
>
>
--

- Game: Epsylon ( http://epsylon.rptd.dnsalias.net/ )
- Game Engine: Drag(en)gine (
http://epsylon.rptd.dnsalias.net/dragengine.php )
- Normal Map Generator: DENormGen (
http://epsylon.rptd.dnsalias.net/denormgen.php )

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature