Beispiel #1
0
        public static void Transform(ref Vector2 vec, ref Quaternion quat, out Vector2 result)
        {
            Quaternion result1 = new Quaternion(vec.X, vec.Y, 0.0f, 0.0f);
            Quaternion result2;

            Quaternion.Invert(ref quat, out result2);
            Quaternion result3;

            Quaternion.Multiply(ref quat, ref result1, out result3);
            Quaternion.Multiply(ref result3, ref result2, out result1);
            result = new Vector2(result1.X, result1.Y);
        }
Beispiel #2
0
        public static void Transform(ref Vector4 vec, ref Quaternion quat, out Vector4 result)
        {
            Quaternion result1 = new Quaternion(vec.X, vec.Y, vec.Z, vec.W);
            Quaternion result2;

            Quaternion.Invert(ref quat, out result2);
            Quaternion result3;

            Quaternion.Multiply(ref quat, ref result1, out result3);
            Quaternion.Multiply(ref result3, ref result2, out result1);
            result = new Vector4(result1.X, result1.Y, result1.Z, result1.W);
        }