aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Turvey <mturvey6@gmail.com>2017-05-21 16:42:11 -0700
committerMike Turvey <mturvey6@gmail.com>2017-05-21 16:42:11 -0700
commitce0aa4741f273fbdd936d6d5a8badd61ae112c60 (patch)
tree71a3667d83de75c0ce5e2cef61b1075854ae8505 /src
parent39f4fbc9397e347d1f406c845d42324eb052e7bb (diff)
downloadlibsurvive-ce0aa4741f273fbdd936d6d5a8badd61ae112c60.tar.gz
libsurvive-ce0aa4741f273fbdd936d6d5a8badd61ae112c60.tar.bz2
Use the IMU to determine +Z
This feature removes the requirement that you calibrate with the tracked object in any particular orientation. The IMU on the tracked object will be used to determine what direction is "up"
Diffstat (limited to 'src')
-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