public void SetConstraints(BipedSkeleton skeleton) { #region Cone constraints #region Spine too head skeleton[Joint.SPINE0].Constraints = (Spine); skeleton[Joint.SPINE1].Constraints = (Spine); skeleton[Joint.NECK].Constraints = (Neck); #endregion #region Legs skeleton[Joint.HIP_L].Constraints = (SwapXZ(Femur)); skeleton[Joint.HIP_R].Constraints = (Femur); skeleton[Joint.KNEE_L].Constraints = (SwapXZ(Knee)); skeleton[Joint.KNEE_R].Constraints = (Knee); skeleton[Joint.ANKLE_L].Constraints = (SwapXZ(Ankle)); skeleton[Joint.ANKLE_R].Constraints = (Ankle); skeleton[Joint.FOOTBASE_L].Constraints = (SwapXZ(FootBase)); skeleton[Joint.FOOTBASE_R].Constraints = (FootBase); #endregion #region Arms skeleton[Joint.CLAVICLE_L].Constraints = (SwapXZ(Clavicula)); skeleton[Joint.CLAVICLE_R].Constraints = (Clavicula); skeleton[Joint.SHOULDER_L].Constraints = (SwapXZ(Shoulder)); skeleton[Joint.SHOULDER_R].Constraints = (Shoulder); skeleton[Joint.ELBOW_L].Constraints = (SwapXZ(Elbow)); skeleton[Joint.ELBOW_R].Constraints = (Elbow); skeleton[Joint.WRIST_L].Constraints = (SwapXZ(Wrist)); skeleton[Joint.WRIST_R].Constraints = (Wrist); #endregion #endregion #region ParentPointers skeleton[Joint.CLAVICLE_R].ParentPointer = QuaternionHelper2.RotationZ(-MathHelper.PiOver2); skeleton[Joint.CLAVICLE_L].ParentPointer = QuaternionHelper2.RotationZ(MathHelper.PiOver2); skeleton[Joint.HIP_R].ParentPointer = QuaternionHelper2.RotationZ(MathHelper.Pi); skeleton[Joint.HIP_L].ParentPointer = QuaternionHelper2.RotationZ(MathHelper.Pi); skeleton[Joint.ANKLE_R].ParentPointer = QuaternionHelper2.RotationX(MathHelper.PiOver4) * QuaternionHelper2.RotationZ(-MathHelper.PiOver4); skeleton[Joint.ANKLE_L].ParentPointer = QuaternionHelper2.RotationX(MathHelper.PiOver4) * QuaternionHelper2.RotationZ(MathHelper.PiOver4); skeleton[Joint.FOOTBASE_L].ParentPointer = QuaternionHelper2.RotationX(MathHelper.PiOver4) * QuaternionHelper2.RotationZ(-MathHelper.PiOver4); skeleton[Joint.FOOTBASE_R].ParentPointer = QuaternionHelper2.RotationX(MathHelper.PiOver4) * QuaternionHelper2.RotationZ(MathHelper.PiOver4); #endregion #region TwistConstraints #region Spine skeleton[Joint.SPINE0].TwistLimit = (SpineTwist); skeleton[Joint.SPINE1].TwistLimit = (SpineTwist); skeleton[Joint.SPINE3].TwistLimit = (NoTwist); skeleton[Joint.NECK].TwistLimit = (NeckTwist); #endregion #region Legs skeleton[Joint.HIP_L].TwistLimit = (FemurTwist); skeleton[Joint.HIP_R].TwistLimit = (FemurTwist); skeleton[Joint.KNEE_L].TwistLimit = (KneeTwist); skeleton[Joint.KNEE_R].TwistLimit = (KneeTwist); skeleton[Joint.ANKLE_L].TwistLimit = (AnkleTwist); skeleton[Joint.ANKLE_R].TwistLimit = (AnkleTwist); skeleton[Joint.FOOTBASE_L].TwistLimit = (FootBaseTwist); skeleton[Joint.FOOTBASE_R].TwistLimit = (FootBaseTwist); #endregion #region Arms skeleton[Joint.CLAVICLE_L].TwistLimit = (ClaviculaTwist); skeleton[Joint.SHOULDER_L].TwistLimit = (ShoulderTwist); skeleton[Joint.ELBOW_L].TwistLimit = (ElbowTwist); skeleton[Joint.WRIST_L].TwistLimit = (WristTwist); skeleton[Joint.CLAVICLE_R].TwistLimit = (ClaviculaTwist); skeleton[Joint.SHOULDER_R].TwistLimit = (ShoulderTwist); skeleton[Joint.ELBOW_R].TwistLimit = (ElbowTwist); skeleton[Joint.WRIST_R].TwistLimit = (WristTwist); #endregion #endregion #region stiffness #region Arms skeleton[Joint.CLAVICLE_L].Stiffness = (verystiff); skeleton[Joint.CLAVICLE_R].Stiffness = (verystiff); skeleton[Joint.WRIST_L].Stiffness = (barelymoving); skeleton[Joint.WRIST_R].Stiffness = (barelymoving); #endregion #region Legs skeleton[Joint.ANKLE_L].Stiffness = (barelymoving); skeleton[Joint.ANKLE_R].Stiffness = (barelymoving); skeleton[Joint.FOOTBASE_L].Stiffness = (barelymoving); skeleton[Joint.FOOTBASE_R].Stiffness = (barelymoving); #endregion #endregion }