diff options
Diffstat (limited to 'tracker-steamvr/steamvr.cpp')
-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. |