diff options
author | Justin Berger <j.david.berger@gmail.com> | 2018-03-11 14:48:08 -0600 |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2018-03-11 14:48:08 -0600 |
commit | 5153a32da9793945f72d60185d1929cd72ceeea3 (patch) | |
tree | c82aa5d46518ba04279325ef41ab9b50ecf606e2 /redist/linmath.c | |
parent | c3235ace3df4fae68c11dcd449ab3a32afca72aa (diff) | |
download | libsurvive-5153a32da9793945f72d60185d1929cd72ceeea3.tar.gz libsurvive-5153a32da9793945f72d60185d1929cd72ceeea3.tar.bz2 |
Added missing functions into lintest
Diffstat (limited to 'redist/linmath.c')
-rw-r--r-- | redist/linmath.c | 14 |
1 files changed, 12 insertions, 2 deletions
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); +} |