From 736154cb3fc3099907430b82e435d2a4b84dac90 Mon Sep 17 00:00:00 2001 From: Meredith Date: Sun, 18 Feb 2018 17:20:04 +0100 Subject: [PATCH] undo playspace fix aswell and adjust log messages. --- src/tabcontrollers/FixFloorTabController.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tabcontrollers/FixFloorTabController.cpp b/src/tabcontrollers/FixFloorTabController.cpp index 5d48eef..ad79b8f 100644 --- a/src/tabcontrollers/FixFloorTabController.cpp +++ b/src/tabcontrollers/FixFloorTabController.cpp @@ -102,7 +102,7 @@ void FixFloorTabController::eventLoopTick(vr::TrackedDevicePose_t* devicePoses) } else { floorOffsetY = tempOffsetY - controllerDownOffsetCorrection; } - LOG(INFO) << "Fix Floor: Floor Offset = [" << floorOffsetX << ", " << floorOffsetY << ", " << floorOffsetZ << "]"; + LOG(INFO) << "Fix Floor and adjust playspace center: Floor Offset = [" << floorOffsetX << ", " << floorOffsetY << ", " << floorOffsetZ << "]"; parent->AddOffsetToUniverseCenter(vr::TrackingUniverseStanding, 0, floorOffsetX, false); parent->AddOffsetToUniverseCenter(vr::TrackingUniverseStanding, 1, floorOffsetY, false); parent->AddOffsetToUniverseCenter(vr::TrackingUniverseStanding, 2, floorOffsetZ, false); @@ -148,8 +148,10 @@ void FixFloorTabController::fixFloorClicked() { } void FixFloorTabController::undoFixFloorClicked() { + parent->AddOffsetToUniverseCenter(vr::TrackingUniverseStanding, 0, -floorOffsetX, false); parent->AddOffsetToUniverseCenter(vr::TrackingUniverseStanding, 1, -floorOffsetY, false); - LOG(INFO) << "Fix Floor: Undo Floor Offset = " << -floorOffsetY; + parent->AddOffsetToUniverseCenter(vr::TrackingUniverseStanding, 2, -floorOffsetZ, false); + LOG(INFO) << "Fix Floor: Undo Floor Offset = [" << -floorOffsetX << ", " << -floorOffsetY << ", " << -floorOffsetZ << "]"; floorOffsetY = 0.0f; statusMessage = "Undo ... OK"; statusMessageTimeout = 1.0;