From f425dccd4060404c224019c7c613fe26e2c6996f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 21 Mar 2018 21:11:41 +0100 Subject: [PATCH] fix playspace offset not updating in ui when using move shortcut --- src/tabcontrollers/MoveCenterTabController.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/tabcontrollers/MoveCenterTabController.cpp b/src/tabcontrollers/MoveCenterTabController.cpp index 85ee22a..45d6082 100644 --- a/src/tabcontrollers/MoveCenterTabController.cpp +++ b/src/tabcontrollers/MoveCenterTabController.cpp @@ -299,7 +299,12 @@ void MoveCenterTabController::eventLoopTick(vr::ETrackingUniverseOrigin universe auto oldMoveHand = m_activeMoveController; auto newMoveHand = getMoveShortcutHand(); auto handId = vr::VRSystem()->GetTrackedDeviceIndexForControllerRole(newMoveHand); - if (handId == vr::k_unTrackedDeviceIndexInvalid) { + if (newMoveHand == vr::TrackedControllerRole_Invalid || handId == vr::k_unTrackedDeviceIndexInvalid) { + if (oldMoveHand != vr::TrackedControllerRole_Invalid) { + emit offsetXChanged(m_offsetX); + emit offsetYChanged(m_offsetY); + emit offsetZChanged(m_offsetZ); + } return; } vr::TrackedDevicePose_t* pose = devicePoses + handId; @@ -343,13 +348,6 @@ void MoveCenterTabController::eventLoopTick(vr::ETrackingUniverseOrigin universe m_lastControllerPosition[0] = absoluteControllerPosition[0]; m_lastControllerPosition[1] = absoluteControllerPosition[1]; m_lastControllerPosition[2] = absoluteControllerPosition[2]; - }else { - if (newMoveHand == vr::TrackedControllerRole_Invalid) { - emit offsetXChanged(m_offsetX); - emit offsetYChanged(m_offsetY); - emit offsetZChanged(m_offsetZ); - } - return; } } }