From 1a260fbceb5ed8c95358a3819d3485a0ef9b07d9 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 27 Mar 2018 00:03:48 +0200 Subject: [PATCH] only revert working copy once --- src/tabcontrollers/MoveCenterTabController.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tabcontrollers/MoveCenterTabController.cpp b/src/tabcontrollers/MoveCenterTabController.cpp index a483cf1..84e51fe 100644 --- a/src/tabcontrollers/MoveCenterTabController.cpp +++ b/src/tabcontrollers/MoveCenterTabController.cpp @@ -306,6 +306,8 @@ void MoveCenterTabController::eventLoopTick(vr::ETrackingUniverseOrigin universe emit offsetZChanged(m_offsetZ); } return; + } else if (newMoveHand != vr::TrackedControllerRole_Invalid) { + vr::VRChaperoneSetup()->RevertWorkingCopy(); } vr::TrackedDevicePose_t* pose = devicePoses + handId; vr::VRControllerState_t state; @@ -339,7 +341,8 @@ void MoveCenterTabController::eventLoopTick(vr::ETrackingUniverseOrigin universe rotateCoordinates(diff, angle); - parent->AddOffsetToUniverseCenter((vr::TrackingUniverseOrigin)m_trackingUniverse, diff, m_adjustChaperone); + parent->AddOffsetToUniverseCenter((vr::TrackingUniverseOrigin)m_trackingUniverse, diff, m_adjustChaperone, false); + vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live); } m_lastControllerPosition[0] = absoluteControllerPosition[0]; m_lastControllerPosition[1] = absoluteControllerPosition[1];