From 849bee977af3d8b35b883c17216dd5801bcfcdc3 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Thu, 2 Jun 2016 12:38:54 -0700 Subject: [PATCH] Do not send stale vive data as valid after deactivating. (cherry picked from commit e6cc1fabe0d97006024e38de4a498b1f364fa860) --- plugins/openvr/src/OpenVrDisplayPlugin.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/openvr/src/OpenVrDisplayPlugin.cpp b/plugins/openvr/src/OpenVrDisplayPlugin.cpp index 2e0bebeadd..fe406cc29a 100644 --- a/plugins/openvr/src/OpenVrDisplayPlugin.cpp +++ b/plugins/openvr/src/OpenVrDisplayPlugin.cpp @@ -96,6 +96,11 @@ void OpenVrDisplayPlugin::internalDeactivate() { Parent::internalDeactivate(); _container->setIsOptionChecked(StandingHMDSensorMode, false); if (_system) { + // Invalidate poses. It's fine if someone else sets these shared values, but we're about to stop updating them, and + // we don't want ViveControllerManager to consider old values to be valid. + for (int i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) { + _trackedDevicePose[i].bPoseIsValid = false; + } releaseOpenVrSystem(); _system = nullptr; }