mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:28:03 +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) {
|
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());
|
resizeGL(_glWidget->width(), _glWidget->height());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,10 @@ void OculusManager::connect() {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_isConnected = false;
|
_isConnected = false;
|
||||||
|
|
||||||
|
// we're definitely not in "VR mode" so tell the menu that
|
||||||
|
Menu::getInstance()->getActionForOption(MenuOption::EnableVRMode)->setChecked(false);
|
||||||
|
|
||||||
ovrHmd_Destroy(_ovrHmd);
|
ovrHmd_Destroy(_ovrHmd);
|
||||||
ovr_Shutdown();
|
ovr_Shutdown();
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "UserActivityLogger.h"
|
#include "UserActivityLogger.h"
|
||||||
|
|
||||||
#ifdef HAVE_SIXENSE
|
#ifdef HAVE_SIXENSE
|
||||||
|
|
||||||
const int CALIBRATION_STATE_IDLE = 0;
|
const int CALIBRATION_STATE_IDLE = 0;
|
||||||
const int CALIBRATION_STATE_X = 1;
|
const int CALIBRATION_STATE_X = 1;
|
||||||
const int CALIBRATION_STATE_Y = 2;
|
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
|
// By default we assume the _neckBase (in orb frame) is as high above the orb
|
||||||
// as the "torso" is below it.
|
// as the "torso" is below it.
|
||||||
_neckBase = glm::vec3(NECK_X, -NECK_Y, NECK_Z);
|
_neckBase = glm::vec3(NECK_X, -NECK_Y, NECK_Z);
|
||||||
|
|
||||||
sixenseInit();
|
sixenseInit();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
_hydrasConnected = false;
|
_hydrasConnected = false;
|
||||||
_triggerPressed[0] = false;
|
_triggerPressed[0] = false;
|
||||||
|
|
|
@ -71,7 +71,7 @@ private:
|
||||||
glm::vec3 _reachUp;
|
glm::vec3 _reachUp;
|
||||||
glm::vec3 _reachForward;
|
glm::vec3 _reachForward;
|
||||||
float _lastDistance;
|
float _lastDistance;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
bool _hydrasConnected;
|
bool _hydrasConnected;
|
||||||
quint64 _lastMovement;
|
quint64 _lastMovement;
|
||||||
|
|
Loading…
Reference in a new issue