From d0ae267b90c3dba644852d0d6285c54633cad45a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 3 Aug 2018 07:36:00 +0200 Subject: tracker/rift: maybe improve Rift centering --- tracker-rift-140/rift-140.cpp | 11 ++++++++++- tracker-rift-140/rift-140.hpp | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tracker-rift-140/rift-140.cpp b/tracker-rift-140/rift-140.cpp index 839dd190..164b47f7 100644 --- a/tracker-rift-140/rift-140.cpp +++ b/tracker-rift-140/rift-140.cpp @@ -37,7 +37,10 @@ module_status rift_tracker_140::start_tracker(QFrame*) if (OVR_FAILURE(ovr_Initialize(nullptr))) goto error; - if(OVR_FAILURE(ovr_Create(&hmd, &luid))) + if (OVR_FAILURE(ovr_Create(&hmd, &luid))) + goto error; + + if (OVR_FAILURE(ovr_SetTrackingOriginType(hmd, ovrTrackingOrigin_EyeLevel))) goto error; return status_ok(); @@ -91,4 +94,10 @@ void rift_tracker_140::data(double *data) } } +bool rift_tracker_140::center() +{ + (void)ovr_RecenterTrackingOrigin(hmd); + return false; +} + OPENTRACK_DECLARE_TRACKER(rift_tracker_140, dialog_rift_140, rift_140Dll) diff --git a/tracker-rift-140/rift-140.hpp b/tracker-rift-140/rift-140.hpp index 030addab..9cc34efa 100644 --- a/tracker-rift-140/rift-140.hpp +++ b/tracker-rift-140/rift-140.hpp @@ -20,6 +20,8 @@ public: ~rift_tracker_140() override; module_status start_tracker(QFrame *) override; void data(double *data) override; + bool center() override; + private: ovrSession hmd = nullptr; ovrGraphicsLuid luid {}; -- cgit v1.2.3