summaryrefslogtreecommitdiffhomepage
path: root/tracker-rift-140
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-08-03 07:36:00 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-08-03 07:36:00 +0200
commitd0ae267b90c3dba644852d0d6285c54633cad45a (patch)
tree4f6428079f58e43fee233be5ff8a619dde4babc7 /tracker-rift-140
parentbb7a4fd91a8ad870ca98454141d09ec39b937259 (diff)
tracker/rift: maybe improve Rift centering
Diffstat (limited to 'tracker-rift-140')
-rw-r--r--tracker-rift-140/rift-140.cpp11
-rw-r--r--tracker-rift-140/rift-140.hpp2
2 files changed, 12 insertions, 1 deletions
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 {};