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--; } }
public void AddCurve(TransDOF ast) { if (IndexOf(ast) != -1) { throw null; } if (ast.transform != null) { curves.Add(new CurveObj(ast)); } }
public int IndexOf(TransDOF ast) { for (int i = 0; i < curves.Count; i++) { if (curves[i].ast == ast) { return(i); } } return(-1); }
public CurveObj GetCurve(TransDOF ast) { foreach (var curve in curves) { if (curve.ast == ast) { return(curve); } } return(null); }
public static void LimitDOF(TransDOF ast, DOF dof) { ast.euler = LimitDOF(ast.euler, dof); }
public CurveObj this[TransDOF t] { get { return(GetCurve(t)); } }
//public CurveObj(ASTransDOF ast) => this.ast = ast; public CurveObj(TransDOF ast) { name = ast.transform.name; this.ast = ast; pos = new CurveXYZ(); rot = new CurveXYZ(); }