diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-08-30 10:18:35 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-08-30 10:18:35 +0200 |
commit | 512d269886e2d27c105157ef0db926fe03d48f70 (patch) | |
tree | a88d46dba49c43d1ab1e4fc6c54b65b60a61533e /ftnoir_tracker_rift/ftnoir_tracker_rift.cpp | |
parent | 31f526c28a48edf7dca470a3cb068dc80f4014de (diff) |
update API to OVR 0.4.1
Diffstat (limited to 'ftnoir_tracker_rift/ftnoir_tracker_rift.cpp')
-rw-r--r-- | ftnoir_tracker_rift/ftnoir_tracker_rift.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp index 031eff32..ea268f12 100644 --- a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp +++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp @@ -24,11 +24,12 @@ void Rift_Tracker::StartTracker(QFrame*) hmd = ovrHmd_Create(0); if (hmd) { - ovrHmd_GetDesc(hmd, &hmdDesc); - ovrHmd_StartSensor(hmd, ovrSensorCap_Orientation| ovrSensorCap_YawCorrection | ovrSensorCap_Position, ovrSensorCap_Orientation); - }else{ - QMessageBox::warning(0,"FaceTrackNoIR Error", "Unable to start Rift tracker",QMessageBox::Ok,QMessageBox::NoButton); - } + ovrHmd_ConfigureTracking(hmd, ovrTrackingCap_Orientation | ovrTrackingCap_MagYawCorrection | ovrTrackingCap_Position, ovrTrackingCap_Orientation); + } + else + { + QMessageBox::warning(0,"FaceTrackNoIR Error", "Unable to start Rift tracker",QMessageBox::Ok,QMessageBox::NoButton); + } } @@ -36,11 +37,12 @@ void Rift_Tracker::GetHeadPoseData(double *data) { if (hmd) { - frameTiming = ovrHmd_BeginFrameTiming(hmd, 0); - ovrSensorState ss = ovrHmd_GetSensorState(hmd, frameTiming.ScanoutMidpointSeconds); - ovrHmd_EndFrameTiming(hmd); + ovrHSWDisplayState hsw; + if (ovrHmd_GetHSWDisplayState(hmd, &hsw), hsw.Displayed) + ovrHmd_DismissHSWDisplay(hmd); + ovrTrackingState ss = ovrHmd_GetTrackingState(hmd, frameTiming.ScanoutMidpointSeconds); if(ss.StatusFlags & ovrStatus_OrientationTracked) { - ovrPosef pose = ss.Predicted.Pose; + auto pose = ss.HeadPose.ThePose; Quatf quat = pose.Orientation; float yaw, pitch, roll; quat.GetEulerAngles<Axis_Y, Axis_X, Axis_Z>(&yaw, &pitch, &roll); |