summaryrefslogtreecommitdiffhomepage
path: root/tracker-steamvr/steamvr.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-05-23 20:16:14 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-06-05 14:44:25 +0200
commitdb2704836abd6c8d7d773b529c122c0c84d061f7 (patch)
tree1b380091ea4e7b93855be86da81a2de8f0391f1a /tracker-steamvr/steamvr.cpp
parente9e7e17d798ad4c168183b3dfc5a85a2e2038175 (diff)
tracker/steamvr: adapt to openvr api changes
Diffstat (limited to 'tracker-steamvr/steamvr.cpp')
-rw-r--r--tracker-steamvr/steamvr.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp
index 3bcfcc25..d3aaff77 100644
--- a/tracker-steamvr/steamvr.cpp
+++ b/tracker-steamvr/steamvr.cpp
@@ -216,9 +216,17 @@ module_status steamvr::start_tracker(QFrame*)
err = tr("Can't find device with that serial");
if (err.isEmpty())
- return status_ok();
- else
- return error(err);
+ {
+ if (auto* c = vr::VRCompositor(); c != nullptr)
+ {
+ c->SetTrackingSpace(origin::TrackingUniverseSeated);
+ return status_ok();
+ }
+ else
+ return error("vr::VRCompositor == NULL");
+ }
+
+ return error(err);
});
}
@@ -253,8 +261,11 @@ bool steamvr::center()
{
if (v->GetTrackedDeviceClass(device_index) == vr::ETrackedDeviceClass::TrackedDeviceClass_HMD)
{
- // Reset yaw and position
- v->ResetSeatedZeroPose();
+ auto* c = vr::VRChaperone();
+ if (!c)
+ eval_once(qDebug() << "vr::VRChaperone == NULL");
+ else
+ c->ResetZeroPose(origin::TrackingUniverseSeated);
// Use chaperone universe real world up instead of opentrack's initial pose centering
// Note: Controllers will be centered based on initial headset position.