From 37aee77c323a0013cf28fbb8126725b5ea558fe5 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 8 Oct 2019 12:26:29 -0700 Subject: [PATCH] Fix oculus calibration screen crash if touch not on --- plugins/oculus/src/OculusControllerManager.cpp | 6 +++--- plugins/oculus/src/OculusControllerManager.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/oculus/src/OculusControllerManager.cpp b/plugins/oculus/src/OculusControllerManager.cpp index 14830f3f04..c1431fa4b2 100644 --- a/plugins/oculus/src/OculusControllerManager.cpp +++ b/plugins/oculus/src/OculusControllerManager.cpp @@ -50,13 +50,13 @@ QString OculusControllerManager::configurationLayout() { void OculusControllerManager::setConfigurationSettings(const QJsonObject configurationSettings) { if (configurationSettings.contains("trackControllersInOculusHome")) { - _touch->_trackControllersInOculusHome.set(configurationSettings["trackControllersInOculusHome"].toBool()); + _trackControllersInOculusHome.set(configurationSettings["trackControllersInOculusHome"].toBool()); } } QJsonObject OculusControllerManager::configurationSettings() { QJsonObject configurationSettings; - configurationSettings["trackControllersInOculusHome"] = _touch->_trackControllersInOculusHome.get(); + configurationSettings["trackControllersInOculusHome"] = _trackControllersInOculusHome.get(); return configurationSettings; } @@ -232,7 +232,7 @@ void OculusControllerManager::TouchDevice::update(float deltaTime, quint64 currentTime = usecTimestampNow(); static const auto REQUIRED_HAND_STATUS = ovrStatus_OrientationTracked | ovrStatus_PositionTracked; bool hasInputFocus = ovr::hasInputFocus(); - bool trackControllersInOculusHome = _trackControllersInOculusHome.get(); + bool trackControllersInOculusHome = _parent._trackControllersInOculusHome.get(); auto tracking = ovr::getTrackingState(); // ovr_GetTrackingState(_parent._session, 0, false); ovr::for_each_hand([&](ovrHandType hand) { ++numTrackedControllers; diff --git a/plugins/oculus/src/OculusControllerManager.h b/plugins/oculus/src/OculusControllerManager.h index ea32eace61..7d1d176a56 100644 --- a/plugins/oculus/src/OculusControllerManager.h +++ b/plugins/oculus/src/OculusControllerManager.h @@ -98,7 +98,6 @@ private: float _leftHapticStrength { 0.0f }; float _rightHapticDuration { 0.0f }; float _rightHapticStrength { 0.0f }; - Setting::Handle _trackControllersInOculusHome { "trackControllersInOculusHome", false }; mutable std::recursive_mutex _lock; std::map _lostTracking; std::map _regainTrackingDeadline; @@ -109,6 +108,7 @@ private: void checkForConnectedDevices(); + Setting::Handle _trackControllersInOculusHome { "trackControllersInOculusHome", false }; ovrInputState _remoteInputState {}; ovrInputState _touchInputState {}; RemoteDevice::Pointer _remote;