diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-05-09 16:20:07 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-05-09 16:20:07 +0200 |
commit | e6fb571266c22f120c0111731da1f2e6bf4d812d (patch) | |
tree | dfeda69b1e24dc343070370651a2f228c1931e36 /tracker-rift-042 | |
parent | 2db4accd652a3a156046c373355535247b2ea7aa (diff) |
tracker/rift-042: reformat, remove outdated todo
Diffstat (limited to 'tracker-rift-042')
-rwxr-xr-x[-rw-r--r--] | tracker-rift-042/ftnoir_tracker_rift_042.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tracker-rift-042/ftnoir_tracker_rift_042.cpp b/tracker-rift-042/ftnoir_tracker_rift_042.cpp index deea4a08..bee19ee6 100644..100755 --- a/tracker-rift-042/ftnoir_tracker_rift_042.cpp +++ b/tracker-rift-042/ftnoir_tracker_rift_042.cpp @@ -4,6 +4,7 @@ #include "OVR_CAPI.h" #include "Kernel/OVR_Math.h" #include <cstdio> +#include <cstring> using namespace OVR; @@ -38,16 +39,18 @@ void Rift_Tracker::data(double *data) { if (hmd) { - ovrHSWDisplayState hsw; - if (ovrHmd_GetHSWDisplayState(hmd, &hsw), hsw.Displayed) + ovrHSWDisplayState hsw; + std::memset(&hsw, 0, sizeof(hsw)); + ovrHmd_GetHSWDisplayState(hmd, &hsw); + if (hsw.Displayed) ovrHmd_DismissHSWDisplay(hmd); ovrTrackingState ss = ovrHmd_GetTrackingState(hmd, 0); - if(ss.StatusFlags & ovrStatus_OrientationTracked) { + if (ss.StatusFlags & ovrStatus_OrientationTracked) + { auto pose = ss.HeadPose.ThePose; Quatf quat = pose.Orientation; float yaw, pitch, roll; quat.GetEulerAngles<Axis_Y, Axis_X, Axis_Z>(&yaw, &pitch, &roll); - // XXX TODO move to core if (s.useYawSpring) { yaw = old_yaw*s.persistence + (yaw-old_yaw); |