}
private void buildLimbConstraints() {
Vector3f tmp = new Vector3f();
for (int i = 0; i < JointType.JOINT_COUNT.ordinal(); ++i) {
if (joints[i] != null) {
ownerWorld.removeConstraint(joints[i]);
}
}
///////////////////////////// SETTING THE CONSTRAINTS /////////////////////////////////////////////7777
// Now setup the constraints
Generic6DofConstraint joint6DOF;
Transform localA = new Transform(), localB = new Transform();
boolean useLinearReferenceFrameA = true;
/// ******* SPINE HEAD ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin
.set(0f,
-(limbLengths[BodyPart.BODYPART_SPINE.ordinal()] + limbLengths[BodyPart.BODYPART_NECK
.ordinal()]), 0f);
localB.origin.set(0f,
limbLengths[BodyPart.BODYPART_HEAD.ordinal()], 0f);
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_SPINE.ordinal()],
bodies[BodyPart.BODYPART_HEAD.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_PI * 0.2f, -BulletGlobals.FLT_EPSILON,
-BulletGlobals.SIMD_PI * 0.1f);
joint6DOF.setAngularLowerLimit(tmp);
tmp.set(BulletGlobals.SIMD_PI * 0.1f, BulletGlobals.FLT_EPSILON,
BulletGlobals.SIMD_PI * 0.10f);
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_NECK_HEAD.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_NECK_HEAD.ordinal()], true);
}
/// *************************** ///
/// ******* PELVIS ******** ///
{
localA.setIdentity();
localB.setIdentity();
MatrixUtil.setEulerZYX(localA.basis, 0, BulletGlobals.SIMD_HALF_PI,
0);
localA.origin.set(0f,
-limbLengths[BodyPart.BODYPART_PELVIS.ordinal()], 0f);
MatrixUtil.setEulerZYX(localB.basis, 0, BulletGlobals.SIMD_HALF_PI,
0);
localB.origin.set(0f,
limbLengths[BodyPart.BODYPART_SPINE.ordinal()], 0f);
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_PELVIS.ordinal()],
bodies[BodyPart.BODYPART_SPINE.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_PI * 0.1f, -BulletGlobals.SIMD_EPSILON,
-BulletGlobals.SIMD_PI * 0.1f);
joint6DOF.setAngularLowerLimit(tmp);
tmp.set(BulletGlobals.SIMD_PI * 0.2f, BulletGlobals.SIMD_EPSILON,
BulletGlobals.SIMD_PI * 0.15f);
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_PELVIS_SPINE.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_PELVIS_SPINE.ordinal()], true);
}
/// *************************** ///
/// ******* SPINE 2D ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin.set(0f, 0f, 0f);
localB.origin.set(0f, 0f, 0f);
CollisionShape ZeroShape = null;
GLOBAL.jBullet.ZeroBody = new RigidBody(0.0f, null, ZeroShape);
Transform Rotation = new Transform();
Rotation.setIdentity();
GLOBAL.jBullet.ZeroBody.setWorldTransform(Rotation);
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_SPINE.ordinal()],
GLOBAL.jBullet.ZeroBody, localA, localB, false);
joint6DOF.setLimit(0, 1, 0); // Disable X axis limits
joint6DOF.setLimit(1, 1, 0); // Disable Y axis limits
joint6DOF.setLimit(2, 0, 0); // Set the Z axis to always be equal to zero
joint6DOF.setLimit(3, 0, 0); // Disable X rotational axes
joint6DOF.setLimit(4, 0, 0); // Disable Y rotational axes
joint6DOF.setLimit(5, 1, 0); // Uncap the rotational axes
//#endif
joints[JointType.JOINT_PLANE.ordinal()] = joint6DOF;
ownerWorld.addConstraint(joints[JointType.JOINT_PLANE.ordinal()],
true);
bodies[BodyPart.BODYPART_SPINE.ordinal()]
.setAngularFactor(new Vector3f(0, 0, 1));
}
/// *************************** ///
if (hasArms) {
/// ******* LEFT SHOULDER ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin.set(0f,
-limbLengths[BodyPart.BODYPART_SPINE.ordinal()],
limbWidths[BodyPart.BODYPART_SPINE.ordinal()] * 1.2f); //joint on spine
MatrixUtil.setEulerZYX(localB.basis, BulletGlobals.SIMD_PI, BulletGlobals.SIMD_PI, BulletGlobals.SIMD_PI);
localB.origin
.set(0f, limbLengths[BodyPart.BODYPART_LEFT_UPPER_ARM
.ordinal()], 0f); // upper arm
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_SPINE.ordinal()],
bodies[BodyPart.BODYPART_LEFT_UPPER_ARM.ordinal()],
localA, localB, useLinearReferenceFrameA);
tmp.set(-BulletGlobals.SIMD_EPSILON,
-BulletGlobals.SIMD_EPSILON,
BulletGlobals.SIMD_HALF_PI * 0.5f);
joint6DOF.setAngularLowerLimit(tmp);
tmp.set(BulletGlobals.SIMD_HALF_PI * 0.6f,
BulletGlobals.SIMD_EPSILON,
-BulletGlobals.SIMD_HALF_PI * 1.3f); //bend foward
joint6DOF.setAngularUpperLimit(tmp);
joints[JointType.JOINT_LEFT_SHOULDER.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_LEFT_SHOULDER.ordinal()], true);
}
/// *************************** ///
/// ******* RIGHT SHOULDER ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin.set(0f,
-limbLengths[BodyPart.BODYPART_SPINE.ordinal()],
-limbWidths[BodyPart.BODYPART_SPINE.ordinal()] * 1.2f); //joint on spine
//MatrixUtil.setEulerZYX(localB.basis,BulletGlobals.SIMD_PI, BulletGlobals.SIMD_PI, BulletGlobals.SIMD_PI);
localB.origin
.set(0f, limbLengths[BodyPart.BODYPART_RIGHT_UPPER_ARM
.ordinal()], 0f); // upper arm
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_SPINE.ordinal()],
bodies[BodyPart.BODYPART_RIGHT_UPPER_ARM.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_HALF_PI * 0.5f);
joint6DOF.setAngularLowerLimit(tmp);
tmp.set(BulletGlobals.SIMD_HALF_PI * 0.6f,
BulletGlobals.SIMD_EPSILON,
-BulletGlobals.SIMD_HALF_PI * 1.3f); //bend foward
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_RIGHT_SHOULDER.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_RIGHT_SHOULDER.ordinal()], true);
}
/// *************************** ///
/// ******* LEFT ELBOW ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin
.set(0f, -limbLengths[BodyPart.BODYPART_LEFT_UPPER_ARM
.ordinal()], 0f); // upper arm
localB.origin
.set(0f, -limbLengths[BodyPart.BODYPART_LEFT_LOWER_ARM
.ordinal()], 0f); // lower arm
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_LEFT_UPPER_ARM.ordinal()],
bodies[BodyPart.BODYPART_LEFT_LOWER_ARM.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_HALF_PI * 0.5f);
joint6DOF.setAngularLowerLimit(tmp);
tmp.set(BulletGlobals.SIMD_HALF_PI * 0.6f,
BulletGlobals.SIMD_EPSILON,
BulletGlobals.SIMD_HALF_PI * 1.3f); //bend foward
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_LEFT_ELBOW.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_LEFT_ELBOW.ordinal()], true);
}
/// *************************** ///
/// ******* RIGHT ELBOW ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin
.set(0f, -limbLengths[BodyPart.BODYPART_LEFT_UPPER_ARM
.ordinal()], 0f); // upper arm
localB.origin
.set(0f, -limbLengths[BodyPart.BODYPART_LEFT_LOWER_ARM
.ordinal()], 0f); // lower arm
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_RIGHT_UPPER_ARM.ordinal()],
bodies[BodyPart.BODYPART_RIGHT_LOWER_ARM.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_HALF_PI * 0.5f);
joint6DOF.setAngularLowerLimit(tmp);
tmp.set(BulletGlobals.SIMD_HALF_PI * 0.6f,
BulletGlobals.SIMD_EPSILON,
BulletGlobals.SIMD_HALF_PI * 1.3f); //bend foward
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_RIGHT_ELBOW.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_RIGHT_ELBOW.ordinal()], true);
}
/// *************************** ///
/// ******* RIGHT Wrist ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin
.set(0f, limbLengths[BodyPart.BODYPART_RIGHT_LOWER_ARM
.ordinal()], 0f); // upper arm
localB.origin.set(0f,
-limbLengths[BodyPart.BODYPART_RIGHT_HAND.ordinal()],
0f); // lower arm
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()],
bodies[BodyPart.BODYPART_RIGHT_HAND.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_PI * 0.7f,
BulletGlobals.SIMD_EPSILON, BulletGlobals.SIMD_EPSILON);
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_RIGHT_WRIST.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_RIGHT_WRIST.ordinal()], true);
}
/// *************************** ///
/// ******* LEFT Wrist ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin
.set(0f, limbLengths[BodyPart.BODYPART_LEFT_LOWER_ARM
.ordinal()], 0f); // upper arm
localB.origin
.set(0f, -limbLengths[BodyPart.BODYPART_LEFT_HAND
.ordinal()], 0f); // lower arm
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()],
bodies[BodyPart.BODYPART_LEFT_HAND.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_PI * 0.7f,
BulletGlobals.SIMD_EPSILON, BulletGlobals.SIMD_EPSILON);
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_LEFT_WRIST.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_LEFT_WRIST.ordinal()], true);
}
/// *************************** ///
}
/// ******* LEFT HIP ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin.set(0f,
limbLengths[BodyPart.BODYPART_PELVIS.ordinal()],
limbWidths[BodyPart.BODYPART_PELVIS.ordinal()]);
localB.origin
.set(0f, -limbLengths[BodyPart.BODYPART_LEFT_UPPER_LEG
.ordinal()] * .6f, 0f);
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_PELVIS.ordinal()],
bodies[BodyPart.BODYPART_LEFT_UPPER_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_HALF_PI * 0.5f);
joint6DOF.setAngularLowerLimit(tmp);
tmp.set(BulletGlobals.SIMD_HALF_PI * 0.6f,
BulletGlobals.SIMD_EPSILON,
BulletGlobals.SIMD_HALF_PI * 1.3f); //bend foward
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_LEFT_HIP.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_LEFT_HIP.ordinal()], true);
}
/// *************************** ///
/// ******* RIGHT HIP ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin.set(0f,
limbLengths[BodyPart.BODYPART_PELVIS.ordinal()],
-limbWidths[BodyPart.BODYPART_PELVIS.ordinal()]);
localB.origin
.set(0f, -limbLengths[BodyPart.BODYPART_RIGHT_UPPER_LEG
.ordinal()] * .6f, 0f);
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_PELVIS.ordinal()],
bodies[BodyPart.BODYPART_RIGHT_UPPER_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_HALF_PI * 0.6f,
-BulletGlobals.SIMD_EPSILON,
-BulletGlobals.SIMD_HALF_PI * 0.5f);
joint6DOF.setAngularLowerLimit(tmp);
tmp.set(BulletGlobals.SIMD_EPSILON, BulletGlobals.SIMD_EPSILON,
BulletGlobals.SIMD_HALF_PI * 1.3f);
joint6DOF.setAngularUpperLimit(tmp);
//#endif
joints[JointType.JOINT_RIGHT_HIP.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_RIGHT_HIP.ordinal()], true);
}
/// *************************** ///
/// ******* LEFT KNEE ******** ///
{
localA.setIdentity();
localB.setIdentity();
localA.origin
.set(0f, limbLengths[BodyPart.BODYPART_LEFT_UPPER_LEG
.ordinal()], 0f);
localB.origin.set(0f,
-limbLengths[BodyPart.BODYPART_LEFT_LOWER_LEG.ordinal()],
0f);
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_LEFT_UPPER_LEG.ordinal()],
bodies[BodyPart.BODYPART_LEFT_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_LEFT_KNEE.ordinal()] = joint6DOF;
ownerWorld.addConstraint(
joints[JointType.JOINT_LEFT_KNEE.ordinal()], true);
}
/// *************************** ///
/// ******* 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,
0f);
joint6DOF = new Generic6DofConstraint(
bodies[BodyPart.BODYPART_LEFT_LOWER_LEG.ordinal()],
bodies[BodyPart.BODYPART_LEFT_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_LEFT_ANKLE.ordinal()] = joint6DOF;
ownerWorld.addConstraint(