BipedPose() static private method

static private BipedPose ( GameObject go, AvatarSetupTool bones ) : void
go UnityEngine.GameObject
bones AvatarSetupTool
return void
        protected void BipedPose()
        {
            AvatarBipedMapper.BipedPose(gameObject, m_Bones);

            AvatarSetupTool.TransferPoseToDescription(m_Skeleton, root);
            m_Inspector.Repaint();
        }
示例#2
0
        internal static void BipedPose(GameObject go, AvatarSetupTool.BoneWrapper[] bones)
        {
            AvatarBipedMapper.BipedPose(go.transform, true);
            Quaternion rotation = AvatarSetupTool.AvatarComputeOrientation(bones);

            go.transform.rotation = Quaternion.Inverse(rotation) * go.transform.rotation;
            AvatarSetupTool.MakeCharacterPositionValid(bones);
        }
示例#3
0
 private static void BipedPose(Transform t, bool ignore)
 {
     if (t.name.EndsWith("Pelvis"))
     {
         t.localRotation = Quaternion.Euler(270f, 90f, 0f);
         ignore          = false;
     }
     else if (t.name.EndsWith("Thigh"))
     {
         t.localRotation = Quaternion.Euler(0f, 180f, 0f);
     }
     else if (t.name.EndsWith("Toe0"))
     {
         t.localRotation = Quaternion.Euler(0f, 0f, 270f);
     }
     else if (t.name.EndsWith("L Clavicle"))
     {
         t.localRotation = Quaternion.Euler(0f, 270f, 180f);
     }
     else if (t.name.EndsWith("R Clavicle"))
     {
         t.localRotation = Quaternion.Euler(0f, 90f, 180f);
     }
     else if (t.name.EndsWith("L Hand"))
     {
         t.localRotation = Quaternion.Euler(270f, 0f, 0f);
     }
     else if (t.name.EndsWith("R Hand"))
     {
         t.localRotation = Quaternion.Euler(90f, 0f, 0f);
     }
     else if (t.name.EndsWith("L Finger0"))
     {
         t.localRotation = Quaternion.Euler(0f, 315f, 0f);
     }
     else if (t.name.EndsWith("R Finger0"))
     {
         t.localRotation = Quaternion.Euler(0f, 45f, 0f);
     }
     else if (!ignore)
     {
         t.localRotation = Quaternion.identity;
     }
     foreach (Transform t2 in t)
     {
         AvatarBipedMapper.BipedPose(t2, ignore);
     }
 }
示例#4
0
 private static void BipedPose(Transform t)
 {
     if (t.name.EndsWith("Pelvis"))
     {
         t.localRotation        = Quaternion.Euler(270f, 90f, 0.0f);
         t.parent.localRotation = Quaternion.Euler(270f, 90f, 0.0f);
     }
     else
     {
         t.localRotation = !t.name.EndsWith("Thigh") ? (!t.name.EndsWith("Toe0") ? (!t.name.EndsWith("L Clavicle") ? (!t.name.EndsWith("R Clavicle") ? (!t.name.EndsWith("L Hand") ? (!t.name.EndsWith("R Hand") ? (!t.name.EndsWith("L Finger0") ? (!t.name.EndsWith("R Finger0") ? Quaternion.identity : Quaternion.Euler(0.0f, 45f, 0.0f)) : Quaternion.Euler(0.0f, 315f, 0.0f)) : Quaternion.Euler(90f, 0.0f, 0.0f)) : Quaternion.Euler(270f, 0.0f, 0.0f)) : Quaternion.Euler(0.0f, 90f, 180f)) : Quaternion.Euler(0.0f, 270f, 180f)) : Quaternion.Euler(0.0f, 0.0f, 270f)) : Quaternion.Euler(0.0f, 180f, 0.0f);
     }
     foreach (Transform t1 in t)
     {
         AvatarBipedMapper.BipedPose(t1);
     }
 }
示例#5
0
        private static void BipedPose(Transform t, bool ignore)
        {
            if (t.name.EndsWith("Pelvis"))
            {
                t.localRotation = Quaternion.Euler(270f, 90f, 0f);
                ignore          = false;
            }
            else if (t.name.EndsWith("Thigh"))
            {
                t.localRotation = Quaternion.Euler(0f, 180f, 0f);
            }
            else if (t.name.EndsWith("Toe0"))
            {
                t.localRotation = Quaternion.Euler(0f, 0f, 270f);
            }
            else if (t.name.EndsWith("L Clavicle"))
            {
                t.localRotation = Quaternion.Euler(0f, 270f, 180f);
            }
            else if (t.name.EndsWith("R Clavicle"))
            {
                t.localRotation = Quaternion.Euler(0f, 90f, 180f);
            }
            else if (t.name.EndsWith("L Hand"))
            {
                t.localRotation = Quaternion.Euler(270f, 0f, 0f);
            }
            else if (t.name.EndsWith("R Hand"))
            {
                t.localRotation = Quaternion.Euler(90f, 0f, 0f);
            }
            else if (t.name.EndsWith("L Finger0"))
            {
                t.localRotation = Quaternion.Euler(0f, 315f, 0f);
            }
            else if (t.name.EndsWith("R Finger0"))
            {
                t.localRotation = Quaternion.Euler(0f, 45f, 0f);
            }
            else if (!ignore)
            {
                t.localRotation = Quaternion.identity;
            }
            IEnumerator enumerator = t.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    Transform t2 = (Transform)enumerator.Current;
                    AvatarBipedMapper.BipedPose(t2, ignore);
                }
            }
            finally
            {
                IDisposable disposable;
                if ((disposable = (enumerator as IDisposable)) != null)
                {
                    disposable.Dispose();
                }
            }
        }
示例#6
0
 protected void BipedPose()
 {
     AvatarBipedMapper.BipedPose(base.gameObject);
     AvatarSetupTool.TransferPoseToDescription(base.serializedObject, base.root);
     this.m_Inspector.Repaint();
 }
示例#7
0
 public static void BipedPose(GameObject go)
 {
     AvatarBipedMapper.BipedPose(go.transform);
 }