diff --git a/include/c3d/maths.h b/include/c3d/maths.h index 6ab0f21..c461801 100644 --- a/include/c3d/maths.h +++ b/include/c3d/maths.h @@ -62,6 +62,8 @@ static inline void Mtx_Copy(C3D_Mtx* out, const C3D_Mtx* in) void Mtx_Identity(C3D_Mtx* out); void Mtx_Multiply(C3D_Mtx* out, const C3D_Mtx* a, const C3D_Mtx* b); +int Mtx_Inverse(C3D_Mtx* out); + void Mtx_Translate(C3D_Mtx* mtx, float x, float y, float z); void Mtx_Scale(C3D_Mtx* mtx, float x, float y, float z); void Mtx_RotateX(C3D_Mtx* mtx, float angle, bool bRightSide); diff --git a/source/maths/mtx_inverse.c b/source/maths/mtx_inverse.c index 06179e7..938da3e 100644 --- a/source/maths/mtx_inverse.c +++ b/source/maths/mtx_inverse.c @@ -1,6 +1,6 @@ #include -void Mtx_Inverse(C3D_Mtx* out) +int Mtx_Inverse(C3D_Mtx* out) { float inv[16], det; int i; @@ -124,6 +124,10 @@ void Mtx_Inverse(C3D_Mtx* out) for (i = 0; i < 16; i++) out->m[i] = inv[i] * det; + + return 0; } - + + return -1; + }