aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Ginger Bill 2016-11-20 10:53:27 +0000
committerGravatar Ginger Bill 2016-11-20 10:53:27 +0000
commitd5cdd53de154b3adb0562f2925781eb3798c6e40 (patch)
tree350c60468806b33cf8a06b73cbef1a641532c81e
parentFix Mat2 (diff)
gb_math.h - 0.07b - Fix mat4_inverse
-rw-r--r--gb_math.h7
1 files 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;