craftworkgames / MonoGame.Extended

Extensions to make MonoGame more awesome
http://www.monogameextended.net/
Other
1.44k stars 323 forks source link

Matrix 3x2 Invert doesn't work properly #960

Closed optsing closed 2 weeks ago

optsing commented 3 weeks ago

Matrix3x2 Invert produces an incorrect result because each next element is computed from the previously modified elements, not the original one.

As a solution, you can create a new matrix instead of mutating the original one or use temporary variables.

Also, Matrix3x2 contains a division operator that simply divides each element of one matrix by an element of the other, which makes no practical sense, better to replace it with a multiplication by an inverted matrix, so A * B / B = A

AristurtleDev commented 2 weeks ago

Resolved in #962