[ODE] contact joints / attaching them
Flavien Brebion
f.brebion at vrcontext.com
Fri Oct 10 21:05:33 MST 2003
Yeah, what you're saying makes sense. You're right, that's
exactly the behavior i'm seeing: the object that introduced
the collision bounces or just stops; while the second object
starts to move (slowly). Just doesn't feel "natural".
Duplicating the objects temporarily sounds like a good idea.
It will likely not cause performance problems and should work
well in my case. However i'm wondering what would happen in
the case of more complex collisions (ex.: collisions between
3 objects). Say you've got X, Y and Z; X collides with Y and
Z. I'd create a duplicate X' for Y and X'' for Z then step
Y and Z; this will give me two different positions for X'
and X'', won't it ? But i guess this situation won't be too
frequent so it might still be worth using this trick.
Thank you!
F. Brebion
-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Benny
Kramek
Sent: vendredi 10 octobre 2003 17:17
To: ode at q12.org
Subject: Re: [ODE] contact joints / attaching them
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
>
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode
More information about the ODE
mailing list