[ODE] Universal Joint / Arm -> rotating about its own axis

David Nicolier dnicolier at gameloft.com
Thu Apr 3 03:43:01 2003


I'm trying to create a RagDoll demo, and I have some issues
with the Universal Joint (using ODE 0.035 OldCol/TriCol/Opcode1.2).
I have connected my arms and legs with universal joints to
the body. They seem to behave correctly, but time to time,
they do rotate about their own axis. I was wondering if I
could do something to prevent this from happening... or
if I did something wrong in my code. (I tried all the axis
combination, none solved it)

PS : The init for a Leg looks like this :

dJointID	jointID = dJointCreateUniversal(g_WorldID, 0);
dJointAttach( jointID, bodyBodyID, bodyLegID );
dJointSetUniversalAnchor( jointID, LegBasePos->x, LegBasePos->y,
LegBasePos->z );
dJointSetUniversalAxis1( jointID, 1, 0, 0 );
dJointSetUniversalAxis2( jointID, 0, 1, 0 );

Small drawing of the axis, and my character :

Z          _ O _
^           [_]
|           | | 
Y-->X