Integrate UI toggling menu item and Hydra UI toggling

They work together and both fade the UI in / out.
This commit is contained in:
David Rowe 2014-07-08 21:04:30 -07:00
parent 1e7a18e625
commit 51f7e8904d
2 changed files with 6 additions and 6 deletions

View file

@ -40,7 +40,6 @@ ApplicationOverlay::ApplicationOverlay() :
_framebufferObject(NULL),
_textureFov(DEFAULT_OCULUS_UI_ANGULAR_SIZE * RADIANS_PER_DEGREE),
_alpha(1.0f),
_active(true),
_crosshairTexture(0) {
memset(_reticleActive, 0, sizeof(_reticleActive));
@ -70,8 +69,8 @@ void ApplicationOverlay::renderOverlay(bool renderToTexture) {
QGLWidget* glWidget = application->getGLWidget();
MyAvatar* myAvatar = application->getAvatar();
//Handle fadeing and deactivation/activation of UI
if (_active) {
//Handle fading and deactivation/activation of UI
if (Menu::getInstance()->isOptionChecked(MenuOption::UserInterface)) {
_alpha += FADE_SPEED;
if (_alpha > 1.0f) {
_alpha = 1.0f;
@ -485,7 +484,8 @@ void ApplicationOverlay::renderControllerPointers() {
if (palmData->getTrigger() == 1.0f) {
if (!triggerPressed[index]) {
if (bumperPressed[index]) {
_active = !_active;
Menu::getInstance()->setIsOptionChecked(MenuOption::UserInterface,
!Menu::getInstance()->isOptionChecked(MenuOption::UserInterface));
}
triggerPressed[index] = true;
}
@ -495,7 +495,8 @@ void ApplicationOverlay::renderControllerPointers() {
if ((controllerButtons & BUTTON_FWD)) {
if (!bumperPressed[index]) {
if (triggerPressed[index]) {
_active = !_active;
Menu::getInstance()->setIsOptionChecked(MenuOption::UserInterface,
!Menu::getInstance()->isOptionChecked(MenuOption::UserInterface));
}
bumperPressed[index] = true;
}

View file

@ -69,7 +69,6 @@ private:
float _magSizeMult[NUMBER_OF_MAGNIFIERS];
float _alpha;
bool _active;
GLuint _crosshairTexture;
};