[ODE] contact joints / attaching them

Benny Kramek benny at kramekweb.com
Fri Oct 10 17:16:52 MST 2003


You're second example does not give the expected results because ode
simulates the collision response for each body based on the (false)
assumption that each body collided with the static world.
Example:
huge ball collides with resting little ball.
the expected result is that the huge ball continues to move in the same
direction but slows down a bit, while the little ball now begins to
move.
but if the huge ball were to collide with the static world, then it's
direction would change, and if the little ball were to collide with the
static world, than nothing would happen since it's at rest.

This is just a guess, but you might want to try doing this:
when you detect a collision, make a clone of each body in the other
bodies world.
clone the mass, position and velocity of each body. then create a
contact joint in each world. after the step, delete the temporary
bodies.

I personally think it would be a nice addition to ode to allow to step
each island in a world individually, with a different time step. this
would eliminate the need for multiple worlds in your situation.

On Fri, 10 Oct 2003 14:42:40 +0200
"Flavien Brebion" <f.brebion at vrcontext.com> wrote:

> I'm trying to use one world per dynamic object ( in order to have
> different timesteps
> per object ); but ODE doesn't allow collisions between multiple
> worlds. Why is it
> so ?
> 
> Specifically, the correct way to use contact joints is, once a contact
> has been
> determined, to do something like this:
> 
>     dJointID c = dJointCreateContact(m_odeWorld, m_odeContacts,
>     contact +
> i);
>     dJointAttach(c, b1, b2);
> 
> Where b1 and b2 are the two bodies.
> 
> If i try to do that, i get an assertion, "b1 and b2 are in different
> world".
> 
> So, i wonder if it would be equivalent to do this:
> 
>     dJointID c1 = dJointCreateContact(m_odeWorld1, m_odeContacts1,
>     contact +
> i);
>     dJointAttach(c1, b1, 0);
> 
>     dJointID c2 = dJointCreateContact(m_odeWorld2, m_odeContacts2,
>     contact +
> i);
>     dJointAttach(c2, 0, b2);
> 
> But i do not seem to get an equivalent result. This is driving me mad,
> please help :)
> Thanks,
> 
> F. Brebion
> 


More information about the ODE mailing list