Ejemplo n.º 1
0
        /// <summary>
        /// Solve for Humanoid
        /// </summary>
        private void SolveHumanoid()
        {
            kinematicSolver.SolveBone(head);

            switch (solver)
            {
            case SolverMethod.CCD:
                CCD.SolveCCD(rightUpperbody, leftUpperbody);
                CCD.SolveCCD(rightLeg);
                CCD.SolveCCD(leftLeg);
                break;

            case SolverMethod.FABRIK:
                FABRIK.SolveFABRIK(rightUpperbody);
                FABRIK.SolveFABRIK(leftUpperbody);
                FABRIK.SolveFABRIK(rightLeg);
                FABRIK.SolveFABRIK(leftLeg);
                break;

            case SolverMethod.Analytical:
                analyticalSolver.SolveAnalytically(rightUpperbody, transform.forward, Vector3.down);
                analyticalSolver.SolveAnalytically(leftUpperbody, transform.forward, Vector3.down);
                analyticalSolver.SolveAnalytically(rightLeg, transform.forward, Vector3.up);
                analyticalSolver.SolveAnalytically(leftLeg, transform.forward, Vector3.up);
                break;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Solve the IK chain analytically (joint count must equal to 3)
 /// </summary>
 /// <param name="_direction"></param>
 /// <param name="_axis"></param>
 public void SolveChainAnalytically(Vector3 _direction, Vector3 _axis)
 {
     if (this.joints.Count != 3)
     {
         return;
     }
     Analytical.SolveAnalytically(this, _direction, _axis);
 }