예제 #1
0
파일: FretsIK.cs 프로젝트: wjk17/AnimaSoul
        private void IKSolve(params TransDOF[] joints)
        {
            //带DOF的IK思路:把欧拉旋转拆分为三个旋转分量,像迭代关节一样按照旋转顺序进行循环下降迭代。
            int c = jointIterCount;

            while (c > 0)
            {
                foreach (var joi in joints)
                {
                    astIK = joi;
                    iter  = 0;
                    int c2 = axisIterCount;
                    while (true)
                    {
                        if (Iteration() || c2 <= 0)
                        {
                            iter++;
                            if (iter > 2)
                            {
                                break;
                            }
                        }
                        c2--;
                    }
                }
                c--;
            }
        }
예제 #2
0
 public void AddCurve(TransDOF ast)
 {
     if (IndexOf(ast) != -1)
     {
         throw null;
     }
     if (ast.transform != null)
     {
         curves.Add(new CurveObj(ast));
     }
 }
예제 #3
0
 public int IndexOf(TransDOF ast)
 {
     for (int i = 0; i < curves.Count; i++)
     {
         if (curves[i].ast == ast)
         {
             return(i);
         }
     }
     return(-1);
 }
예제 #4
0
 public CurveObj GetCurve(TransDOF ast)
 {
     foreach (var curve in curves)
     {
         if (curve.ast == ast)
         {
             return(curve);
         }
     }
     return(null);
 }
예제 #5
0
 public static void LimitDOF(TransDOF ast, DOF dof)
 {
     ast.euler = LimitDOF(ast.euler, dof);
 }
예제 #6
0
 public CurveObj this[TransDOF t]
 {
     get { return(GetCurve(t)); }
 }
예제 #7
0
파일: CurveObj.cs 프로젝트: wjk17/WSA
 //public CurveObj(ASTransDOF ast) => this.ast = ast;
 public CurveObj(TransDOF ast)
 {
     name = ast.transform.name; this.ast = ast; pos = new CurveXYZ(); rot = new CurveXYZ();
 }