Merge pull request #16314 from huffman/fix/oculus-touch-calibration-crash

DEV-841: Fix oculus calibration screen crash if touch is not turned on
This commit is contained in:
Shannon Romano 2019-10-09 10:44:03 -07:00 committed by GitHub
commit f71dfa065c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -98,7 +98,6 @@ private:
float _leftHapticStrength { 0.0f };
float _rightHapticDuration { 0.0f };
float _rightHapticStrength { 0.0f };
Setting::Handle<bool> _trackControllersInOculusHome { "trackControllersInOculusHome", false };
mutable std::recursive_mutex _lock;
std::map<int, bool> _lostTracking;
std::map<int, quint64> _regainTrackingDeadline;
@ -109,6 +108,7 @@ private:
void checkForConnectedDevices();
Setting::Handle<bool> _trackControllersInOculusHome { "trackControllersInOculusHome", false };
ovrInputState _remoteInputState {};
ovrInputState _touchInputState {};
RemoteDevice::Pointer _remote;