diff options
author | dpeter99 <dpeter99@gmail.com> | 2018-03-28 17:36:09 +0200 |
---|---|---|
committer | dpeter99 <dpeter99@gmail.com> | 2018-03-28 17:36:09 +0200 |
commit | 6f7759314baf66f69fa7a335a1f17c65e90661f2 (patch) | |
tree | 11a0e499a0ea83a5b7aa645ba05e5a87f6cc5070 /src/poser.c | |
parent | ef18541ac2e1e97de9f04f132ac7b2b1ba21e515 (diff) | |
parent | 4c373617220aca69a4acb7a32c12457a057f4e48 (diff) | |
download | libsurvive-6f7759314baf66f69fa7a335a1f17c65e90661f2.tar.gz libsurvive-6f7759314baf66f69fa7a335a1f17c65e90661f2.tar.bz2 |
Merge branch 'master' of https://github.com/dpeter99/libsurvive
Diffstat (limited to 'src/poser.c')
-rw-r--r-- | src/poser.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/poser.c b/src/poser.c index 1c638f8..9a0de24 100644 --- a/src/poser.c +++ b/src/poser.c @@ -1,6 +1,7 @@ #include "math.h" #include <linmath.h> #include <stdint.h> +#include <stdio.h> #include <survive.h> #define _USE_MATH_DEFINES // for C @@ -21,6 +22,12 @@ void PoserData_lighthouse_pose_func(PoserData *poser_data, SurviveObject *so, ui } else { const FLT up[3] = {0, 0, 1}; + if (quatmagnitude(lighthouse_pose->Rot) == 0) { + SurviveContext *ctx = so->ctx; + SV_INFO("Pose func called with invalid pose."); + return; + } + // Assume that the space solved for is valid but completely arbitrary. We are going to do a few things: // a) Using the gyro data, normalize it so that gravity is pushing straight down along Z // c) Assume the object is at origin |