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.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'redist/linmath.c') diff --git a/redist/linmath.c b/redist/linmath.c index eb74271..76a723d 100644 --- a/redist/linmath.c +++ b/redist/linmath.c @@ -634,9 +634,19 @@ void matrix44transpose(FLT * mout, const FLT * minm ) } -void ApplyPoseToPoint( FLT * pout, const FLT * pin, const FLT * pose ) -{ +void ApplyPoseToPoint(LINMATH_POINT pout, const LINMATH_POSE pose, const LINMATH_POINT pin) { quatrotatevector( pout, &pose[3], pin ); add3d( pout, pout, &pose[0] ); } +void ApplyPoseToPose(LINMATH_POSE pout, const LINMATH_POSE lhs_pose, const LINMATH_POSE rhs_pose) { + ApplyPoseToPoint(pout, lhs_pose, rhs_pose); + quatrotateabout(&pout[3], &lhs_pose[3], &rhs_pose[3]); +} + +void InvertPose(LINMATH_POSE poseout, const LINMATH_POSE pose) { + quatgetreciprocal(&poseout[3], &pose[3]); + + quatrotatevector(&poseout[0], &poseout[3], &pose[0]); + scale3d(&poseout[0], &poseout[0], -1); +} -- cgit v1.2.3