Promlem with RevoluteJoint

Hi all, I have one problem with RevoluteJoint.

I try to modelling a hand;

at first I create RevoluteJoint between 2 parts of hand .

then set to my joint lowerLimit = -PI and upperLimit = PI ,

limit works fine, but in moment when i call EnableLimit(true) for my joint, 1 part of hand jumped to lowerLimit angle.

How can I set the start ANGLE for revolute joint ??


Sorry for my bad English.
You can use the reference angle in b2RevoluteJointDef. This sets the zero angle for the joint.
thx , but I use box2dxna port , when I change _referenceAngle in b2RevoluteJointDef(before joint creation) or b2RevoluteJoint(after joint creation) nothing happening, maybe problem in a port. 🙁

Try todo limit manualy , without EnableLimit

Todo something like this: 😆
if(joint.GetJointAngle() > PI)
{
joint.SetMotorSpeed(-5);
joint.SetMotorTorque(10000f);
joint.EnableMotor(true);
}
else{ joint.EnableMotor(false); }

for -PI do the same

I know, this method is sucks 😀
problem solved. referenceAngle didn't work because i use it before myRevoluteJointDef.Initialize then i open sourse of this box2dxna function:
Code:
public void Initialize(Body b1, Body b2, Vector2 anchor)
        {
           bodyA = b1;
           bodyB = b2;
           localAnchorA = bodyA.GetLocalPoint(anchor);
           localAnchorB = bodyB.GetLocalPoint(anchor);
           referenceAngle = bodyB.GetAngle() - bodyA.GetAngle();
        }

reference angle reinitialized at this line: referenceAngle = bodyB.GetAngle() - bodyA.GetAngle();
I put code line with referenceAngle below myRevoluteJointDef.Initialize and all works fine 😉

Original thread: https://box2d.org/forum/viewtopic.php?t=4937