/// ******* RIGHT KNEE ******** ///
{
localA.setIdentity();
localB.setIdentity();
HingeConstraint jointHinge = null;
localA.origin.set(0f,
limbLengths[BodyPart.BODYPART_RIGHT_UPPER_LEG.ordinal()],
0f);
localB.origin.set(0f,
-limbLengths[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()],
0f);
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_RIGHT_UPPER_LEG.ordinal()],
bodies[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()],
localA, localB, useLinearReferenceFrameA);
//
//#ifdef RIGID
//joint6DOF->setAngularLowerLimit(btVector3(-SIMD_EPSILON,-SIMD_EPSILON,-SIMD_EPSILON));
//joint6DOF->setAngularUpperLimit(btVector3(SIMD_EPSILON,SIMD_EPSILON,SIMD_EPSILON));
//#else
tmp.set(-BulletGlobals.SIMD_EPSILON, -BulletGlobals.SIMD_EPSILON,
-BulletGlobals.SIMD_PI * .9f);
joint6DOF.setAngularLowerLimit(tmp);
tmp.set(BulletGlobals.SIMD_EPSILON, BulletGlobals.SIMD_EPSILON,
BulletGlobals.SIMD_EPSILON);
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_RIGHT_KNEE.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_RIGHT_KNEE.ordinal()], true);
}
/// *************************** ///
/// ******* RIGHT FOOT ******** ///
{
localA.setIdentity();
localB.setIdentity();
HingeConstraint jointHinge = null;
localA.origin.set(0f,
limbLengths[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()],
0f);
localB.origin.set(0f,
-limbLengths[BodyPart.BODYPART_RIGHT_FOOT.ordinal()] * .5f,
0f);
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()],
bodies[BodyPart.BODYPART_RIGHT_FOOT.ordinal()], localA,
localB, useLinearReferenceFrameA);
//
//#ifdef RIGID
//joint6DOF->setAngularLowerLimit(btVector3(-SIMD_EPSILON,-SIMD_EPSILON,-SIMD_EPSILON));
//joint6DOF->setAngularUpperLimit(btVector3(SIMD_EPSILON,SIMD_EPSILON,SIMD_EPSILON));
//#else
tmp.set(-BulletGlobals.SIMD_EPSILON, -BulletGlobals.SIMD_EPSILON,
BulletGlobals.SIMD_EPSILON);
joint6DOF.setAngularLowerLimit(tmp);
tmp.set(BulletGlobals.SIMD_EPSILON, BulletGlobals.SIMD_EPSILON,
BulletGlobals.SIMD_PI * .7f);
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_RIGHT_ANKLE.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_RIGHT_ANKLE.ordinal()], true);
}
/// *************************** ///
/// ******* LEFT FOOT ******** ///
{
localA.setIdentity();
localB.setIdentity();
HingeConstraint jointHinge = null;
localA.origin
.set(0f, limbLengths[BodyPart.BODYPART_LEFT_LOWER_LEG
.ordinal()], 0f);
localB.origin.set(0f,
-limbLengths[BodyPart.BODYPART_LEFT_FOOT.ordinal()] * .5f,