From 66a4f2e90b62d0f322e2b39b1459b148f1c4079b Mon Sep 17 00:00:00 2001 From: waveydave Date: Sun, 3 Nov 2024 19:36:32 +0000 Subject: [PATCH] Fix for issue 4454, MatrixDecompose() gave incorrect output for certain combinations of scale and rotation (#4461) --- src/raymath.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/raymath.h b/src/raymath.h index d1b5ab01..e522113b 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -2569,7 +2569,13 @@ RMAPI void MatrixDecompose(Matrix mat, Vector3 *translation, Quaternion *rotatio if (!FloatEquals(det, 0)) { clone.m0 /= s.x; + clone.m4 /= s.x; + clone.m8 /= s.x; + clone.m1 /= s.y; clone.m5 /= s.y; + clone.m9 /= s.y; + clone.m2 /= s.z; + clone.m6 /= s.z; clone.m10 /= s.z; // Extract rotation