diff --git a/ANX.Framework/Properties/AssemblyInfo.cs b/ANX.Framework/Properties/AssemblyInfo.cs index 851e6763..2c2c220e 100644 --- a/ANX.Framework/Properties/AssemblyInfo.cs +++ b/ANX.Framework/Properties/AssemblyInfo.cs @@ -31,8 +31,8 @@ using System.Runtime.InteropServices; // // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: -[assembly: AssemblyVersion("0.4.26.*")] -[assembly: AssemblyFileVersion("0.4.26.0")] +[assembly: AssemblyVersion("0.4.27.*")] +[assembly: AssemblyFileVersion("0.4.27.0")] [assembly:InternalsVisibleTo("ANX.Framework.Windows.DX10")] [assembly:InternalsVisibleTo("ANX.RenderSystem.Windows.DX11")] diff --git a/ANX.Framework/Vector2.cs b/ANX.Framework/Vector2.cs index 007e355c..fee9040a 100644 --- a/ANX.Framework/Vector2.cs +++ b/ANX.Framework/Vector2.cs @@ -448,7 +448,12 @@ namespace ANX.Framework public static void Transform(ref Vector2 value, ref Quaternion rotation, out Vector2 result) { - throw new NotImplementedException(); + float x = 2 * (-rotation.Z * value.Y); + float y = 2 * (rotation.Z * value.X); + float z = 2 * (rotation.X * value.Y - rotation.Y * value.X); + + result.X = value.X + x * rotation.W + (rotation.Y * z - rotation.Z * y); + result.Y = value.Y + y * rotation.W + (rotation.Z * x - rotation.X * z); } public static void Transform(Vector2[] sourceArray, int sourceIndex, ref Matrix matrix, Vector2[] destinationArray, int destinationIndex, int length) diff --git a/ANX.Framework/Vector3.cs b/ANX.Framework/Vector3.cs index 36da2672..e084b986 100644 --- a/ANX.Framework/Vector3.cs +++ b/ANX.Framework/Vector3.cs @@ -534,13 +534,13 @@ namespace ANX.Framework public static void Transform(ref Vector3 value, ref Quaternion rotation, out Vector3 result) { - result.X = (rotation.Y * value.Z - rotation.Z * value.Y); - result.Y = (rotation.Z * value.X - rotation.X * value.Z); - result.Z = (rotation.X * value.Y - rotation.Y * value.X); + float x = 2* (rotation.Y * value.Z - rotation.Z * value.Y); + float y = 2* (rotation.Z * value.X - rotation.X * value.Z); + float z = 2* (rotation.X * value.Y - rotation.Y * value.X); - result.X = value.X + result.X * rotation.W + (rotation.Y * result.Z - rotation.Z * result.Y); - result.Y = value.Y + result.Y * rotation.W + (rotation.Z * result.X - rotation.X * result.Z); - result.Z = value.Z + result.Z * rotation.W + (rotation.X * result.Y - rotation.Y * result.X); + result.X = value.X + x * rotation.W + (rotation.Y * z - rotation.Z * y); + result.Y = value.Y + y * rotation.W + (rotation.Z * x - rotation.X * z); + result.Z = value.Z + z * rotation.W + (rotation.X * y - rotation.Y * x); } public static void Transform(Vector3[] sourceArray, ref Matrix matrix, Vector3[] destinationArray) diff --git a/ANX.Framework/Vector4.cs b/ANX.Framework/Vector4.cs index 25a40e7d..77a56a03 100644 --- a/ANX.Framework/Vector4.cs +++ b/ANX.Framework/Vector4.cs @@ -529,7 +529,14 @@ namespace ANX.Framework public static void Transform(ref Vector4 value, ref Quaternion rotation, out Vector4 result) { - throw new NotImplementedException(); + float x = 2 * (rotation.Y * value.Z - rotation.Z * value.Y); + float y = 2 * (rotation.Z * value.X - rotation.X * value.Z); + float z = 2 * (rotation.X * value.Y - rotation.Y * value.X); + + result.X = value.X + x * rotation.W + (rotation.Y * z - rotation.Z * y); + result.Y = value.Y + y * rotation.W + (rotation.Z * x - rotation.X * z); + result.Z = value.Z + z * rotation.W + (rotation.X * y - rotation.Y * x); + result.W = value.W; } public static void Transform(Vector4[] sourceArray, ref Matrix matrix, Vector4[] destinationArray)