aboutsummaryrefslogtreecommitdiff
path: root/src/poser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/poser.c')
-rw-r--r--src/poser.c7
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