Skip to content

Commit

Permalink
Better quaternion vector transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
notgiven688 committed Jun 6, 2024
1 parent 62f0176 commit 53ec0cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Jitter2/LinearMath/JVector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;

namespace Jitter2.LinearMath;

Expand Down Expand Up @@ -254,7 +255,7 @@ public static void TransposedTransform(in JVector vector, in JMatrix matrix, out
/// Transforms the vector by a quaternion.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public unsafe static void Transform(in JVector vector, in JQuaternion rotation, out JVector result)
public static void Transform(in JVector vector, in JQuaternion rotation, out JVector result)
{
float numx = 2.0f * (rotation.Y * vector.Z - rotation.Z * vector.Y);
float numy = 2.0f * (rotation.Z * vector.X - rotation.X * vector.Z);
Expand Down

0 comments on commit 53ec0cc

Please sign in to comment.