diff options
author | Florian Jung <flo@windfisch.org> | 2015-04-16 18:28:08 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-04-16 18:28:08 +0200 |
commit | 00b9727d4d0f6aa55a3ba27a111448a3c1527345 (patch) | |
tree | 8d8a33b36a5b64157c77f0ed8fb9919206913c82 | |
parent | ca36b1d3b1ffa74052a4b2a42d0b5868915fa4ca (diff) |
yaw adjustment for rift
-rw-r--r-- | client2.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/client2.cpp b/client2.cpp index 4ae6bba..6f8e79d 100644 --- a/client2.cpp +++ b/client2.cpp @@ -817,6 +817,7 @@ int main(int argc, const char** argv) char key; float aberr_r=0.989, aberr_b=1.021; + float yaw_plus=0.0; int i=-1; while (key=' ') //while ((key=waitKey(1)) != 'e') @@ -883,6 +884,8 @@ int main(int argc, const char** argv) oculus_pitch = asin(2.0*(quat[0]*quat[2]-quat[1]*quat[3])); oculus_roll = -atan2(2.0*(quat[2]*quat[3]+quat[0]*quat[1]), -(quat[0]*quat[0]-quat[1]*quat[1]-quat[2]*quat[2]+quat[3]*quat[3])); + oculus_yaw = fixup_range(oculus_yaw+yaw_plus, -PI, PI); + //printf("oculus yaw, pitch, roll = \t%f\t%f\t%f\n", oculus_yaw*180/PI, oculus_pitch*180/PI, oculus_roll*180/PI); } else @@ -928,6 +931,10 @@ int main(int argc, const char** argv) if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS) glfwSetWindowShouldClose(window, GL_TRUE); + if (glfwGetKey(window, GLFW_KEY_ENTER) == GLFW_PRESS) + { + yaw_plus = PI+yaw_cam/180.*PI+yaw_plus-oculus_yaw; + } showFPS(); |