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

Commit 1e19f6b

Browse files
authored
Merge pull request #867 from dazerdude/fix
Matrix3x2.Multiply now behaves like other Matrix.Multiply functions
2 parents 3087443 + 0aae573 commit 1e19f6b

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

Source/SharpDX.Mathematics/Matrix3x2.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,14 @@ public static Matrix3x2 Multiply(Matrix3x2 left, float right)
366366
/// <param name="result">The product of the two matrices.</param>
367367
public static void Multiply(ref Matrix3x2 left, ref Matrix3x2 right, out Matrix3x2 result)
368368
{
369-
result = new Matrix3x2();
370-
result.M11 = (left.M11 * right.M11) + (left.M12 * right.M21);
371-
result.M12 = (left.M11 * right.M12) + (left.M12 * right.M22);
372-
result.M21 = (left.M21 * right.M11) + (left.M22 * right.M21);
373-
result.M22 = (left.M21 * right.M12) + (left.M22 * right.M22);
374-
result.M31 = (left.M31 * right.M11) + (left.M32 * right.M21) + right.M31;
375-
result.M32 = (left.M31 * right.M12) + (left.M32 * right.M22) + right.M32;
369+
Matrix3x2 temp = new Matrix3x2();
370+
temp.M11 = (left.M11 * right.M11) + (left.M12 * right.M21);
371+
temp.M12 = (left.M11 * right.M12) + (left.M12 * right.M22);
372+
temp.M21 = (left.M21 * right.M11) + (left.M22 * right.M21);
373+
temp.M22 = (left.M21 * right.M12) + (left.M22 * right.M22);
374+
temp.M31 = (left.M31 * right.M11) + (left.M32 * right.M21) + right.M31;
375+
temp.M32 = (left.M31 * right.M12) + (left.M32 * right.M22) + right.M32;
376+
result = temp;
376377
}
377378

378379
/// <summary>

0 commit comments

Comments
 (0)