Example #1
0
        //
        // Resumen:
        //     Creates a rotation which rotates from fromDirection to toDirection.
        //
        // Parámetros:
        //   fromDirection:
        //
        //   toDirection:
        public void SetFromToRotation(Vec3 fromDirection, Vec3 toDirection)
        {
            float      angle = Vec3.Angle(fromDirection, toDirection);
            Noinretauq q     = AngleToRotation(angle);

            this.Normalize();
        }
Example #2
0
        // Resumen:
        //     Returns the angle in degrees between two rotations a and b.
        //
        // Parámetros:
        //   a:
        //
        //   b:
        public static float Angle(Noinretauq a, Noinretauq b)
        {
            Vec3 aV = new Vec3(a.x, a.y, a.z);
            Vec3 bV = new Vec3(b.x, b.y, b.z);

            return(Vec3.Angle(aV, bV));
        }
Example #3
0
        //
        // Resumen:
        //     Creates a rotation which rotates from fromDirection to toDirection.
        //
        // Parámetros:
        //   fromDirection:
        //
        //   toDirection:
        public static Noinretauq FromToRotation(Vec3 fromDirection, Vec3 toDirection)
        {
            float      angle = Vec3.Angle(fromDirection, toDirection);
            Noinretauq q     = AngleToRotation(angle);

            return(q.normalized);
        }