Ejemplo n.º 1
0
        public void RotateLegs(double[] thetas, Boolean areDegrees)
        {
            double angle1_d, angle2_d, angle3_d;

            if (areDegrees == false)
            {
                angle1_d = serviceConverter.ConvertRadiansToDegrees(thetas[0]);
                angle2_d = serviceConverter.ConvertRadiansToDegrees(thetas[1]);
                angle3_d = serviceConverter.ConvertRadiansToDegrees(thetas[2]);
            }
            else
            {
                angle1_d = thetas[0];
                angle2_d = thetas[1];
                angle3_d = thetas[2];
            }

            float angle1 = serviceConverter.ConvertDoubleToFloat(angle1_d);
            float angle2 = serviceConverter.ConvertDoubleToFloat(angle2_d);
            float angle3 = serviceConverter.ConvertDoubleToFloat(angle3_d);

            topLPivots[0].rotation = Quaternion.Euler(new Vector3(-angle1, topLPivots[0].eulerAngles.y, topLPivots[0].eulerAngles.z));
            topLPivots[1].rotation = Quaternion.Euler(new Vector3(-angle2, topLPivots[1].eulerAngles.y, topLPivots[1].eulerAngles.z));
            topLPivots[2].rotation = Quaternion.Euler(new Vector3(-angle3, topLPivots[2].eulerAngles.y, topLPivots[2].eulerAngles.z));
        }