Skip to content

Commit

Permalink
Negating quaternions now more often negates quaternions.
Browse files Browse the repository at this point in the history
  • Loading branch information
RossNordby committed Sep 28, 2017
1 parent 2f05f5e commit aeb2fd5
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions BEPUutilities/Quaternion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,8 @@ public static void Negate(ref Quaternion a, out Quaternion b)
/// <returns>Negated result.</returns>
public static Quaternion Negate(Quaternion q)
{
Quaternion toReturn;
toReturn.X = q.X;
toReturn.Y = q.Y;
toReturn.Z = q.Z;
toReturn.W = q.W;
return toReturn;
Negate(ref q, out var result);
return result;
}

/// <summary>
Expand All @@ -460,12 +456,8 @@ public static Quaternion Negate(Quaternion q)
/// <returns>Negated result.</returns>
public static Quaternion operator -(Quaternion q)
{
Quaternion toReturn;
toReturn.X = q.X;
toReturn.Y = q.Y;
toReturn.Z = q.Z;
toReturn.W = q.W;
return toReturn;
Negate(ref q, out var result);
return result;
}

/// <summary>
Expand Down

0 comments on commit aeb2fd5

Please sign in to comment.