diff options
author | Mike Turvey <mturvey6@gmail.com> | 2017-06-01 22:19:43 -0700 |
---|---|---|
committer | Mike Turvey <mturvey6@gmail.com> | 2017-06-01 22:19:43 -0700 |
commit | 046188c2168a20f94db8f68e15c9813fe3087515 (patch) | |
tree | fa2531b6102bd074edab80f8fa6eaa068da6bb64 /src | |
parent | d28f6fd44e2d22d8fb9ad4a18dfaad7677ad465d (diff) | |
download | libsurvive-046188c2168a20f94db8f68e15c9813fe3087515.tar.gz libsurvive-046188c2168a20f94db8f68e15c9813fe3087515.tar.bz2 |
Forgot to normalize the quaternion
Diffstat (limited to 'src')
-rw-r--r-- | src/poser_turveytori.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/poser_turveytori.c b/src/poser_turveytori.c index 3f0a0d5..ff7f47d 100644 --- a/src/poser_turveytori.c +++ b/src/poser_turveytori.c @@ -1151,7 +1151,7 @@ void SolveForRotation(FLT rotOut[4], TrackedObject *obj, Point lh) } -static Point SolveForLighthouse(FLT posOut[3], FLT quatOut[4], TrackedObject *obj, SurviveObject *so, char doLogOutput, int lh, int setLhCalibration) +static Point SolveForLighthouse(FLT posOut[3], FLT quatOut[4], TrackedObject *obj, SurviveObject *so, char doLogOutput,const int lh,const int setLhCalibration) { ToriData *toriData = so->PoserData; @@ -1385,6 +1385,8 @@ static Point SolveForLighthouse(FLT posOut[3], FLT quatOut[4], TrackedObject *ob //quatrotateabout(newOrientation, invRot, invPoseRot); // turns correctly, rotations aligned <-- This seems to be the best. //quatrotateabout(newOrientation, invPoseRot, invRot); // turns correctly, rotations aligned, (x & y flipped?) + quatnormalize(newOrientation, newOrientation); + so->OutPose.Pos[0] = wcPos[0]; so->OutPose.Pos[1] = wcPos[1]; so->OutPose.Pos[2] = wcPos[2]; @@ -1641,7 +1643,7 @@ int PoserTurveyTori( SurviveObject * so, PoserData * poserData ) FLT angle; FLT axis[3]; - angleaxisfrom2vect(&angle, &axis, td->down, negZ); + angleaxisfrom2vect(&angle, axis, td->down, negZ); //angleaxisfrom2vect(&angle, &axis, negZ, td->down); { |