aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Turvey <mwturvey@users.noreply.github.com>2017-05-21 16:43:58 -0700
committerGitHub <noreply@github.com>2017-05-21 16:43:58 -0700
commitae66f593a3b929ebe8f7212d0a33a616289a3a39 (patch)
tree71a3667d83de75c0ce5e2cef61b1075854ae8505
parent39f4fbc9397e347d1f406c845d42324eb052e7bb (diff)
parentce0aa4741f273fbdd936d6d5a8badd61ae112c60 (diff)
downloadlibsurvive-ae66f593a3b929ebe8f7212d0a33a616289a3a39.tar.gz
libsurvive-ae66f593a3b929ebe8f7212d0a33a616289a3a39.tar.bz2
Merge pull request #71 from mwturvey/UseImuForDown
Use the IMU to determine +Z
-rw-r--r--src/poser_turveytori.c12
-rw-r--r--src/survive_data.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/poser_turveytori.c b/src/poser_turveytori.c
index 0222a46..4837f94 100644
--- a/src/poser_turveytori.c
+++ b/src/poser_turveytori.c
@@ -1569,10 +1569,10 @@ int PoserTurveyTori( SurviveObject * so, PoserData * poserData )
// with world coordinate system, it will have Z oriented correctly.
// let's get the quaternion that represents this rotation.
- //FLT downQuat[4];
+ FLT downQuat[4];
FLT negZ[3] = { 0,0,1 };
//quatfrom2vectors(downQuat, negZ, td->down);
- //quatfrom2vectors(downQuat, td->down, negZ);
+ quatfrom2vectors(downQuat, td->down, negZ);
{
int sensorCount = 0;
@@ -1585,8 +1585,8 @@ int PoserTurveyTori( SurviveObject * so, PoserData * poserData )
FLT norm[3] = { so->sensor_normals[i * 3 + 0] , so->sensor_normals[i * 3 + 1] , so->sensor_normals[i * 3 + 2] };
FLT point[3] = { so->sensor_locations[i * 3 + 0] , so->sensor_locations[i * 3 + 1] , so->sensor_locations[i * 3 + 2] };
- //quatrotatevector(norm, downQuat, norm);
- //quatrotatevector(point, downQuat, point);
+ quatrotatevector(norm, downQuat, norm);
+ quatrotatevector(point, downQuat, point);
to->sensor[sensorCount].normal.x = norm[0];
to->sensor[sensorCount].normal.y = norm[1];
@@ -1617,8 +1617,8 @@ int PoserTurveyTori( SurviveObject * so, PoserData * poserData )
FLT norm[3] = { so->sensor_normals[i * 3 + 0] , so->sensor_normals[i * 3 + 1] , so->sensor_normals[i * 3 + 2] };
FLT point[3] = { so->sensor_locations[i * 3 + 0] , so->sensor_locations[i * 3 + 1] , so->sensor_locations[i * 3 + 2] };
- //quatrotatevector(norm, downQuat, norm);
- //quatrotatevector(point, downQuat, point);
+ quatrotatevector(norm, downQuat, norm);
+ quatrotatevector(point, downQuat, point);
to->sensor[sensorCount].normal.x = norm[0];
to->sensor[sensorCount].normal.y = norm[1];
diff --git a/src/survive_data.c b/src/survive_data.c
index 157650d..1b80269 100644
--- a/src/survive_data.c
+++ b/src/survive_data.c
@@ -6,7 +6,7 @@
#include <string.h>
#include <math.h> /* for sqrt */
-//#define USE_TURVEYBIGUATOR
+#define USE_TURVEYBIGUATOR
#ifdef USE_TURVEYBIGUATOR