diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 3007943643..9d49dc6281 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1440,6 +1440,15 @@ void Application::setEnable3DTVMode(bool enable3DTVMode) { } void Application::setEnableVRMode(bool enableVRMode) { + if (enableVRMode) { + if (!OculusManager::isConnected()) { + // attempt to reconnect the Oculus manager - it's possible this was a workaround + // for the sixense crash + OculusManager::disconnect(); + OculusManager::connect(); + } + } + resizeGL(_glWidget->width(), _glWidget->height()); } diff --git a/interface/src/devices/OculusManager.cpp b/interface/src/devices/OculusManager.cpp index 6ce77e3ca2..7d7375fad5 100644 --- a/interface/src/devices/OculusManager.cpp +++ b/interface/src/devices/OculusManager.cpp @@ -135,6 +135,10 @@ void OculusManager::connect() { } else { _isConnected = false; + + // we're definitely not in "VR mode" so tell the menu that + Menu::getInstance()->getActionForOption(MenuOption::EnableVRMode)->setChecked(false); + ovrHmd_Destroy(_ovrHmd); ovr_Shutdown(); } diff --git a/interface/src/devices/SixenseManager.cpp b/interface/src/devices/SixenseManager.cpp index 089d478198..803060e5d3 100644 --- a/interface/src/devices/SixenseManager.cpp +++ b/interface/src/devices/SixenseManager.cpp @@ -19,6 +19,7 @@ #include "UserActivityLogger.h" #ifdef HAVE_SIXENSE + const int CALIBRATION_STATE_IDLE = 0; const int CALIBRATION_STATE_X = 1; const int CALIBRATION_STATE_Y = 2; @@ -41,8 +42,9 @@ SixenseManager::SixenseManager() { // By default we assume the _neckBase (in orb frame) is as high above the orb // as the "torso" is below it. _neckBase = glm::vec3(NECK_X, -NECK_Y, NECK_Z); - + sixenseInit(); + #endif _hydrasConnected = false; _triggerPressed[0] = false; diff --git a/interface/src/devices/SixenseManager.h b/interface/src/devices/SixenseManager.h index 91f9e9884f..664c102f76 100644 --- a/interface/src/devices/SixenseManager.h +++ b/interface/src/devices/SixenseManager.h @@ -71,7 +71,7 @@ private: glm::vec3 _reachUp; glm::vec3 _reachForward; float _lastDistance; - + #endif bool _hydrasConnected; quint64 _lastMovement;