From ce0aa4741f273fbdd936d6d5a8badd61ae112c60 Mon Sep 17 00:00:00 2001 From: Mike Turvey Date: Sun, 21 May 2017 16:42:11 -0700 Subject: 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" --- src/poser_turveytori.c | 12 ++++++------ src/survive_data.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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 #include /* for sqrt */ -//#define USE_TURVEYBIGUATOR +#define USE_TURVEYBIGUATOR #ifdef USE_TURVEYBIGUATOR -- cgit v1.2.3