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 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/poser_turveytori.c') 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]; -- cgit v1.2.3