Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Commit

Permalink
Matrix3x2.Multiply now behaves like other Matrix.Multiply functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dazerdude committed Mar 15, 2017
1 parent d11f6bc commit 0aae573
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Source/SharpDX.Mathematics/Matrix3x2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,14 @@ public static Matrix3x2 Multiply(Matrix3x2 left, float right)
/// <param name="result">The product of the two matrices.</param>
public static void Multiply(ref Matrix3x2 left, ref Matrix3x2 right, out Matrix3x2 result)
{
result = new Matrix3x2();
result.M11 = (left.M11 * right.M11) + (left.M12 * right.M21);
result.M12 = (left.M11 * right.M12) + (left.M12 * right.M22);
result.M21 = (left.M21 * right.M11) + (left.M22 * right.M21);
result.M22 = (left.M21 * right.M12) + (left.M22 * right.M22);
result.M31 = (left.M31 * right.M11) + (left.M32 * right.M21) + right.M31;
result.M32 = (left.M31 * right.M12) + (left.M32 * right.M22) + right.M32;
Matrix3x2 temp = new Matrix3x2();
temp.M11 = (left.M11 * right.M11) + (left.M12 * right.M21);
temp.M12 = (left.M11 * right.M12) + (left.M12 * right.M22);
temp.M21 = (left.M21 * right.M11) + (left.M22 * right.M21);
temp.M22 = (left.M21 * right.M12) + (left.M22 * right.M22);
temp.M31 = (left.M31 * right.M11) + (left.M32 * right.M21) + right.M31;
temp.M32 = (left.M31 * right.M12) + (left.M32 * right.M22) + right.M32;
result = temp;
}

/// <summary>
Expand Down

0 comments on commit 0aae573

Please sign in to comment.