diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-05-23 20:16:14 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-05-23 20:16:14 +0200 |
commit | 9a57421a78b172a3bf036d90616bd2f0cbd46b14 (patch) | |
tree | 848aef0a1c8c512ffb0de63e2a51b4c8c621ac65 | |
parent | 25f4e77c1344114c5c3d02e4ffa135a480d36eab (diff) |
tracker/steamvr: adapt to openvr api changes
-rw-r--r-- | tracker-steamvr/steamvr.cpp | 21 |
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. |