From d5cdd53de154b3adb0562f2925781eb3798c6e40 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 20 Nov 2016 10:53:27 +0000 Subject: [PATCH] gb_math.h - 0.07b - Fix mat4_inverse --- gb_math.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gb_math.h b/gb_math.h index c1fa09c..9d593eb 100644 --- a/gb_math.h +++ b/gb_math.h @@ -3,6 +3,7 @@ use '#define GB_MATH_IMPLEMENTATION' before including to create the implementation in _ONE_ file Version History: + 0.07b - Fix mat4_inverse 0.07a - Fix Mat2 0.07 - Better Mat4 procedures 0.06h - Ignore silly warnings @@ -1560,9 +1561,9 @@ void gb_mat4_inverse(gbMat4 *out, gbMat4 *in) { o[3][2] = -(m[0][0] * sf14 - m[0][1] * sf16 + m[0][3] * sf18); o[3][3] = +(m[0][0] * sf15 - m[0][1] * sf17 + m[0][2] * sf18); - ood = 1.0f / (m[0][0] * o[0][0] - m[0][1] * o[0][1] - m[0][2] * o[0][2] + ood = 1.0f / (m[0][0] * o[0][0] + + m[0][1] * o[0][1] + + m[0][2] * o[0][2] + m[0][3] * o[0][3]); o[0][0] *= ood;