From b08325fc4a184f9963035eb0df51e3d9aa31037d Mon Sep 17 00:00:00 2001 From: Learn OpenGL ES Date: Thu, 7 Nov 2013 20:47:36 -0500 Subject: Fix bug with invert matrix (was copying one float instead of all floats). --- linmath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linmath.h b/linmath.h index 97f4e17..016102a 100644 --- a/linmath.h +++ b/linmath.h @@ -298,7 +298,7 @@ static inline void mat4x4_invert(mat4x4 T, mat4x4 M) R[3][1] = M[0][0]*(M[2][1]*M[3][2] - M[2][2]*M[3][1]) - M[2][0]*(M[0][1]*M[3][2] - M[0][2]*M[3][1]) - M[3][0]*(M[0][2]*M[2][1] - M[0][1]*M[2][2]); R[3][2] = M[0][0]*(M[1][2]*M[3][1] - M[1][1]*M[3][2]) - M[1][0]*(M[0][2]*M[3][1] - M[0][1]*M[3][2]) - M[3][0]*(M[0][1]*M[1][2] - M[0][2]*M[1][1]); R[3][3] = M[0][0]*(M[1][1]*M[2][2] - M[1][2]*M[2][1]) - M[1][0]*(M[0][1]*M[2][2] - M[0][2]*M[2][1]) - M[2][0]*(M[0][2]*M[1][1] - M[0][1]*M[1][2]); - memcpy(T, R, sizeof(T)); + memcpy(T, R, sizeof(R)); } static inline void mat4x4_frustum(mat4x4 M, float l, float r, float b, float t, float n, float f) { -- cgit v1.2.3-54-g00ecf