[Odejava] Static And Dynamic Joints

Hi,
Is there a way to link a dynamic object via say a JointHinge to a static object.

This is helpful for things like doors, The door is attached to the wall, but the wall is static (not affected by forces and gravity).

Ive looked at the code for Joint which leads back to OdeJNI and OdeJNI.get_BODYID_ZERO

Does BODYID_ZERO indicate that this is attached with the world?

Thanks, DP

hi,
did someone already solve it ?, i’d be very curious.
my actual workaround is kind of a heavy stone i attached my moving bodies to and i’m not satisfied with it :smiley:

i already tried to create the joints with lowlevel api and connect to body_id_zero but the result was an ode-crash…

i know things happen due to my inferior programming knowledge. therefore my hope is still alive :wink:

I don’t think BODYID_ZERO should be used for this, as I think that is the logical equivilent of ‘null’.

I would have suggested attaching it to a very heavy Body. Beyond that I’m not sure. Have you tried the ODE mailing list? They are pretty good with things like this.

Will.

are u sure ?
the ode userguide says:

“To attach this joint to only one body, set body1 or body2 to zero - a zero body refers to the static environment.”

hmm…but the next sentence in the userguide is:
“Some joints, like hinge-2 need to be attached to two bodies to work.”

i’m not so sure anymore … it’s quite possible i tried that with hinge2.

yes, hinge2 needs two bodies to work…

Try Ball or Hinge to see…I haven’t had a chance yet, too busy doing a demo for GDC! I’l sit down with it soon…

DP

ok… i replaced the hinge2 with universal and attached them sucessfully to the static environment.

joint.attach(null, body);

it is running now, but the universals act more like fixedjoints … doesnt move anymore… :-/ ?

:-X
omg … i just didnt realize that my inverted pendulums were just in balance as soon as they got connected to the world. :smiley:

now everything works fine, thx for help.