From 765bf1623299e81f5f95b78a78e7d66997e4ad0c Mon Sep 17 00:00:00 2001 From: cnlohr Date: Thu, 9 Mar 2017 20:00:42 -0500 Subject: Fix wrong quat functions + Add matrix->quat conversion. --- redist/linmath.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'redist/linmath.h') diff --git a/redist/linmath.h b/redist/linmath.h index caec281..ec20534 100644 --- a/redist/linmath.h +++ b/redist/linmath.h @@ -7,8 +7,8 @@ #define DEFAULT_EPSILON 0.001 //For printf -#define PFTHREE(x) x[0], x[1], x[2] -#define PFFOUR(x) x[0], x[1], x[2], x[3] +#define PFTHREE(x) (x)[0], (x)[1], (x)[2] +#define PFFOUR(x) (x)[0], (x)[1], (x)[2], (x)[3] #define LINMATHPI ((FLT)3.141592653589) @@ -76,6 +76,7 @@ FLT quatmagnitude( const FLT * q ); FLT quatinvsqmagnitude( const FLT * q ); void quatnormalize( FLT * qout, const FLT * qin ); //Safe for in to be same as out. void quattomatrix( FLT * matrix44, const FLT * q ); +void quatfrommatrix( FLT * q, const FLT * matrix44 ); void quatgetconjugate( FLT * qout, const FLT * qin ); void quatgetreciprocal( FLT * qout, const FLT * qin ); void quatsub( FLT * qout, const FLT * a, const FLT * b ); -- cgit v1.2.3