mirror of
https://github.com/lubosz/overte.git
synced 2025-04-19 17:03:43 +02:00
if enable VR mode is re-checked then attempt to re-connect to Oculus
This commit is contained in:
parent
ac4d20bb43
commit
4bf7bbe0df
4 changed files with 17 additions and 2 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -71,7 +71,7 @@ private:
|
|||
glm::vec3 _reachUp;
|
||||
glm::vec3 _reachForward;
|
||||
float _lastDistance;
|
||||
|
||||
|
||||
#endif
|
||||
bool _hydrasConnected;
|
||||
quint64 _lastMovement;
|
||||
|
|
Loading…
Reference in a new issue