Skip to content

Commit 66a4f2e

Browse files
authored
Fix for issue 4454, MatrixDecompose() gave incorrect output for certain combinations of scale and rotation (#4461)
1 parent 6028052 commit 66a4f2e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/raymath.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,7 +2569,13 @@ RMAPI void MatrixDecompose(Matrix mat, Vector3 *translation, Quaternion *rotatio
25692569
if (!FloatEquals(det, 0))
25702570
{
25712571
clone.m0 /= s.x;
2572+
clone.m4 /= s.x;
2573+
clone.m8 /= s.x;
2574+
clone.m1 /= s.y;
25722575
clone.m5 /= s.y;
2576+
clone.m9 /= s.y;
2577+
clone.m2 /= s.z;
2578+
clone.m6 /= s.z;
25732579
clone.m10 /= s.z;
25742580

25752581
// Extract rotation

0 commit comments

Comments
 (0)