From 5153a32da9793945f72d60185d1929cd72ceeea3 Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Sun, 11 Mar 2018 14:48:08 -0600 Subject: Added missing functions into lintest --- redist/linmath.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'redist/linmath.h') diff --git a/redist/linmath.h b/redist/linmath.h index 1876b34..ff00c94 100644 --- a/redist/linmath.h +++ b/redist/linmath.h @@ -102,10 +102,21 @@ void quatrotatevector( FLT * vec3out, const FLT * quat, const FLT * vec3in ); void quatfrom2vectors(FLT *q, const FLT *src, const FLT *dest); //Poses are Position: [x, y, z] Quaternion: [q, x, y, z] -//XXX TODO Write these! -void ApplyPoseToPoint( FLT * pout, const FLT * pin, const FLT * pose ); -void InvertPose( FLT * poseout, const FLT * pose ); +typedef FLT *LINMATH_POSE; +// Points are [x, y, z] +typedef FLT *LINMATH_POINT; + +// This is the quat equivalent of 'pout = pose * pin' if pose were a 4x4 matrix in homogenous space +void ApplyPoseToPoint(LINMATH_POINT pout, const LINMATH_POSE pose, const LINMATH_POINT pin); + +// This is the quat equivalent of 'pout = lhs_pose * rhs_pose' if poses were a 4x4 matrix in homogenous space +void ApplyPoseToPose(LINMATH_POSE pout, const LINMATH_POSE lhs_pose, const LINMATH_POSE rhs_pose); + +// This is the quat equivlant of 'pose_in^-1'; so that ApplyPoseToPose(..., InvertPose(..., pose_in), pose_in) == +// Identity ( [0, 0, 0], [1, 0, 0, 0] ) +// by definition. +void InvertPose(LINMATH_POSE poseout, const LINMATH_POSE pose_in); // Matrix Stuff -- cgit v1.2.3