fix viveControllerManager not registering the vive input is no hand controllers are present

This commit is contained in:
Dante Ruiz 2017-11-28 10:43:37 -08:00
parent 068b93fc30
commit 039abff861

View file

@ -274,13 +274,13 @@ void ViveControllerManager::pluginUpdate(float deltaTime, const controller::Inpu
_inputDevice->update(deltaTime, inputCalibrationData); _inputDevice->update(deltaTime, inputCalibrationData);
}); });
if (_inputDevice->_trackedControllers == 0 && _registeredWithInputMapper) { if (isDesktopMode() && _registeredWithInputMapper) {
userInputMapper->removeDevice(_inputDevice->_deviceID); userInputMapper->removeDevice(_inputDevice->_deviceID);
_registeredWithInputMapper = false; _registeredWithInputMapper = false;
_inputDevice->_poseStateMap.clear(); _inputDevice->_poseStateMap.clear();
} }
if (!_registeredWithInputMapper && _inputDevice->_trackedControllers > 0) { if (!_registeredWithInputMapper && !isDesktopMode()) {
userInputMapper->registerDevice(_inputDevice); userInputMapper->registerDevice(_inputDevice);
_registeredWithInputMapper = true; _registeredWithInputMapper = true;
} }