I'm tring to use SwivelHingeJoint between body and arm and it seems like it is working not as expectable.
Please see the pictures:
(Doll looks to +Z, Up is Y, X to the Right side - left for the doll)
Right arm (which is at the left side of the picture) is using ordinary hinge joint.
When we applying perpendicular force it remains in its limits as it should be.
Left arm (which is at the right side of the picture) is using SwivelHingeJoint joint having
HingeLimit.MinimumAngle = 0.0f * Pi;
HingeLimit.MaximumAngle = 0.0f * Pi;
HingeLimit.IsActive = true;
TwistLimit.MinimumAngle = -0.75f * Pi;
TwistLimit.MaximumAngle = 0.0f * Pi;
TwistLimit.IsActive = true;
Hinge axis is Y.
So it supposed to be rotated inside one plane only (or may be I'm mistaken here?)
However by applying similar force we can see that it is not so...
It is observed that it actually tries to hold it inside the limiting plane but... it can't (very low resistance).
Forces are the same (I have played a lot with that).
So could you please advise what is wrong here? Is it normal behavior for these settings or not?
Actually it can be wrenched at 0.75 * Pi only (exactly the twist limit) this makes me think that may it is as expected...
However it is not like it is shown on the picture:
http://bepuphysics.codeplex.com/wikipag ... umentation
Here is the code.
Arms are not colliding with body.
Code: Select all
// hinge
rjoint_exp = new RevoluteJoint(ra.entity, body.entity,
raj, -body.entity.OrientationMatrix.Left); Game1.scene.physics.space.Add(rjoint_exp);
rjoint_exp.Limit.IsActive = true;
rjoint_exp.Limit.MinimumAngle = 0; rjoint_exp.Limit.MaximumAngle = Pi * 0.75f;
rjoint_exp.Limit.LocalTestAxis = Vector3.UnitZ;
// Swivel
sjoint_la = new SwivelHingeJoint(la.entity, body.entity,
laj, -body.entity.OrientationMatrix.Up); Game1.scene.physics.space.Add(sjoint_la);
sjoint_la.HingeLimit.MinimumAngle = 0.0f * Pi; sjoint_la.HingeLimit.MaximumAngle = 0.0f * Pi; sjoint_la.HingeLimit.IsActive = true;
sjoint_la.TwistLimit.MinimumAngle = -0.75f * Pi; sjoint_la.TwistLimit.MaximumAngle = 0.0f * Pi; sjoint_la.TwistLimit.IsActive = true;
sjoint_la.HingeLimit.TestAxis = Vector3.UnitZ;
sjoint_la.AngularJoint.WorldHingeAxis = -Vector3.UnitY;
sjoint_la.AngularJoint.WorldTwistAxis = Vector3.UnitX;