コード例 #1
0
 public void NormalizeEulerAxis()
 {
     if (-(float)Math.PI / 2f < Low.X && High.X < (float)Math.PI / 2f)
     {
         Euler = EulerType.ZXY;
     }
     else if (-(float)Math.PI / 2f < Low.Y && High.Y < (float)Math.PI / 2f)
     {
         Euler = EulerType.XYZ;
     }
     else
     {
         Euler = EulerType.YZX;
     }
     FixAxis = FixAxisType.None;
     if (Low.X == 0f && High.X == 0f && Low.Y == 0f && High.Y == 0f && Low.Z == 0f && High.Z == 0f)
     {
         FixAxis = FixAxisType.Fix;
     }
     else if (Low.Y == 0f && High.Y == 0f && Low.Z == 0f && High.Z == 0f)
     {
         FixAxis = FixAxisType.X;
     }
     else if (Low.X == 0f && High.X == 0f && Low.Z == 0f && High.Z == 0f)
     {
         FixAxis = FixAxisType.Y;
     }
     else if (Low.X == 0f && High.X == 0f && Low.Y == 0f && High.Y == 0f)
     {
         FixAxis = FixAxisType.Z;
     }
 }
コード例 #2
0
 public void FromIKLink(IKLink link)
 {
     Bone    = link.Bone;
     IsLimit = link.IsLimit;
     Low     = link.Low;
     High    = link.High;
     Euler   = link.Euler;
 }
コード例 #3
0
ファイル: IKLink.cs プロジェクト: Romulion/GameEngine
        public void NormalizeEulerAxis()
        {
            float pi05 = (float)Math.PI / 2;

            if (-pi05 < LimitMin.X && LimitMax.X < pi05)
            {
                Euler = EulerType.ZXY;
            }
            else if (-pi05 < LimitMin.Y && LimitMax.Y < pi05)
            {
                Euler = EulerType.XYZ;
            }
            else
            {
                Euler = EulerType.YZX;
            }

            FixAxis = FixAxisType.None;

            if (LimitMin.X == 0f && LimitMax.X == 0f && LimitMin.Y == 0f && LimitMax.Y == 0f && LimitMin.Z == 0f && LimitMax.Z == 0f)
            {
                FixAxis = FixAxisType.Fix;
            }
            else if (LimitMin.Y == 0f && LimitMax.Y == 0f && LimitMin.Z == 0f && LimitMax.Z == 0f)
            {
                FixAxis = FixAxisType.X;
            }
            else if (LimitMin.X == 0f && LimitMax.X == 0f && LimitMin.Z == 0f && LimitMax.Z == 0f)
            {
                FixAxis = FixAxisType.Y;
            }
            else if (LimitMin.X == 0f && LimitMax.X == 0f && LimitMin.Y == 0f && LimitMax.Y == 0f)
            {
                FixAxis = FixAxisType.Z;
            }
        }