diff --git a/Source/OpenTK/Math/Vector2.cs b/Source/OpenTK/Math/Vector2.cs index 9dad9391..5946fdd3 100644 --- a/Source/OpenTK/Math/Vector2.cs +++ b/Source/OpenTK/Math/Vector2.cs @@ -908,12 +908,10 @@ namespace OpenTK /// The result of the operation. public static void Transform(ref Vector2 vec, ref Quaternion quat, out Vector2 result) { - Quaternion v = new Quaternion(vec.X, vec.Y, 0, 0); - Quaternion i; - Quaternion t; + Quaternion v = new Quaternion(vec.X, vec.Y, 0, 0), i, t; Quaternion.Invert(ref quat, out i); - t = i * v; - v = t * quat; + Quaternion.Multiply(ref quat, ref v, out t); + Quaternion.Multiply(ref t, ref i, out v); result = new Vector2(v.X, v.Y); } diff --git a/Source/OpenTK/Math/Vector2d.cs b/Source/OpenTK/Math/Vector2d.cs index 4c4c68f9..70bddeab 100644 --- a/Source/OpenTK/Math/Vector2d.cs +++ b/Source/OpenTK/Math/Vector2d.cs @@ -796,12 +796,10 @@ namespace OpenTK /// The result of the operation. public static void Transform(ref Vector2d vec, ref Quaterniond quat, out Vector2d result) { - Quaterniond v = new Quaterniond(vec.X, vec.Y, 0, 0); - Quaterniond i; - Quaterniond t; + Quaterniond v = new Quaterniond(vec.X, vec.Y, 0, 0), i, t; Quaterniond.Invert(ref quat, out i); - t = i * v; - v = t * quat; + Quaterniond.Multiply(ref quat, ref v, out t); + Quaterniond.Multiply(ref t, ref i, out v); result = new Vector2d(v.X, v.Y); } diff --git a/Source/OpenTK/Math/Vector3.cs b/Source/OpenTK/Math/Vector3.cs index 35e52064..f297c110 100644 --- a/Source/OpenTK/Math/Vector3.cs +++ b/Source/OpenTK/Math/Vector3.cs @@ -1115,12 +1115,10 @@ namespace OpenTK /// The result of the operation. public static void Transform(ref Vector3 vec, ref Quaternion quat, out Vector3 result) { - Quaternion v = new Quaternion(vec.X, vec.Y, vec.Z, 0); - Quaternion i; - Quaternion t; + Quaternion v = new Quaternion(vec.X, vec.Y, vec.Z, 0), i, t; Quaternion.Invert(ref quat, out i); - t = i * v; - v = t * quat; + Quaternion.Multiply(ref quat, ref v, out t); + Quaternion.Multiply(ref t, ref i, out v); result = new Vector3(v.X, v.Y, v.Z); } diff --git a/Source/OpenTK/Math/Vector3d.cs b/Source/OpenTK/Math/Vector3d.cs index 9ad39e2f..2c1fdc99 100644 --- a/Source/OpenTK/Math/Vector3d.cs +++ b/Source/OpenTK/Math/Vector3d.cs @@ -1111,12 +1111,10 @@ namespace OpenTK /// The result of the operation. public static void Transform(ref Vector3d vec, ref Quaterniond quat, out Vector3d result) { - Quaterniond v = new Quaterniond(vec.X, vec.Y, vec.Z, 0); - Quaterniond i; - Quaterniond t; + Quaterniond v = new Quaterniond(vec.X, vec.Y, vec.Z, 0), i, t; Quaterniond.Invert(ref quat, out i); - t = i * v; - v = t * quat; + Quaterniond.Multiply(ref quat, ref v, out t); + Quaterniond.Multiply(ref t, ref i, out v); result = new Vector3d(v.X, v.Y, v.Z); } diff --git a/Source/OpenTK/Math/Vector4.cs b/Source/OpenTK/Math/Vector4.cs index 0994241b..f13a6fe0 100644 --- a/Source/OpenTK/Math/Vector4.cs +++ b/Source/OpenTK/Math/Vector4.cs @@ -963,12 +963,10 @@ namespace OpenTK /// The result of the operation. public static void Transform(ref Vector4 vec, ref Quaternion quat, out Vector4 result) { - Quaternion v = new Quaternion(vec.X, vec.Y, vec.Z, vec.W); - Quaternion i; - Quaternion t; + Quaternion v = new Quaternion(vec.X, vec.Y, vec.Z, vec.W), i, t; Quaternion.Invert(ref quat, out i); - t = i * v; - v = t * quat; + Quaternion.Multiply(ref quat, ref v, out t); + Quaternion.Multiply(ref t, ref i, out v); result = new Vector4(v.X, v.Y, v.Z, v.W); } diff --git a/Source/OpenTK/Math/Vector4d.cs b/Source/OpenTK/Math/Vector4d.cs index 9cfe2c98..abe6d164 100644 --- a/Source/OpenTK/Math/Vector4d.cs +++ b/Source/OpenTK/Math/Vector4d.cs @@ -966,12 +966,10 @@ namespace OpenTK /// The result of the operation. public static void Transform(ref Vector4d vec, ref Quaterniond quat, out Vector4d result) { - Quaterniond v = new Quaterniond(vec.X, vec.Y, vec.Z, vec.W); - Quaterniond i; - Quaterniond t; + Quaterniond v = new Quaterniond(vec.X, vec.Y, vec.Z, vec.W), i, t; Quaterniond.Invert(ref quat, out i); - t = i * v; - v = t * quat; + Quaterniond.Multiply(ref quat, ref v, out t); + Quaterniond.Multiply(ref t, ref i, out v); result = new Vector4d(v.X, v.Y, v.Z, v.W); }