aboutsummaryrefslogtreecommitdiff
path: root/src/poser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/poser.c')
-rw-r--r--src/poser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/poser.c b/src/poser.c
index 3fb4fe8..2cfe28d 100644
--- a/src/poser.c
+++ b/src/poser.c
@@ -45,7 +45,11 @@ void PoserData_lighthouse_pose_func(PoserData *poser_data, SurviveObject *so, ui
// Now find the space with the same origin, but rotated so that gravity is up
SurvivePose lighthouse2objUp = {}, object2objUp = {};
- quatfrom2vectors(object2objUp.Rot, so->activations.accel, up);
+ if (quatmagnitude(so->activations.accel)) {
+ quatfrom2vectors(object2objUp.Rot, so->activations.accel, up);
+ } else {
+ object2objUp.Rot[0] = 1.0;
+ }
// Calculate the pose of the lighthouse in this space
ApplyPoseToPose(&lighthouse2objUp, &object2objUp, &lighthouse2obj);