diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 83eb38b8d4..7d1a47f787 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -32,8 +32,6 @@ #include "ui/JSConsole.h" #include "ui/ScriptEditorWindow.h" -const float DEFAULT_OCULUS_UI_ANGULAR_SIZE = 72.0f; - const QString SETTINGS_ADDRESS_KEY = "address"; class QSettings; @@ -140,8 +138,6 @@ public: void setFieldOfView(float fieldOfView) { _fieldOfView = fieldOfView; bumpSettings(); } float getRealWorldFieldOfView() const { return _realWorldFieldOfView; } void setRealWorldFieldOfView(float realWorldFieldOfView) { _realWorldFieldOfView = realWorldFieldOfView; bumpSettings(); } - float getOculusUIAngularSize() const { return _oculusUIAngularSize; } - void setOculusUIAngularSize(float oculusUIAngularSize) { _oculusUIAngularSize = oculusUIAngularSize; bumpSettings(); } float getSixenseReticleMoveSpeed() const { return _sixenseReticleMoveSpeed; } void setSixenseReticleMoveSpeed(float sixenseReticleMoveSpeed) { _sixenseReticleMoveSpeed = sixenseReticleMoveSpeed; bumpSettings(); } bool getInvertSixenseButtons() const { return _invertSixenseButtons; } @@ -229,7 +225,6 @@ private: #if defined(Q_OS_MAC) || defined(Q_OS_WIN) SpeechRecognizer _speechRecognizer; #endif - float _oculusUIAngularSize = DEFAULT_OCULUS_UI_ANGULAR_SIZE; float _sixenseReticleMoveSpeed = DEFAULT_SIXENSE_RETICLE_MOVE_SPEED; bool _invertSixenseButtons = DEFAULT_INVERT_SIXENSE_MOUSE_BUTTONS; bool _hasLoginDialogDisplayed = false; diff --git a/interface/src/ui/ApplicationOverlay.cpp b/interface/src/ui/ApplicationOverlay.cpp index 2c5cc5b267..6d00ad6912 100644 --- a/interface/src/ui/ApplicationOverlay.cpp +++ b/interface/src/ui/ApplicationOverlay.cpp @@ -164,7 +164,7 @@ void ApplicationOverlay::renderOverlay(bool renderToTexture) { Overlays& overlays = application->getOverlays(); auto glCanvas = DependencyManager::get(); - _textureFov = glm::radians(Menu::getInstance()->getOculusUIAngularSize()); + _textureFov = glm::radians(_oculusUIAngularSize); _textureAspectRatio = (float)glCanvas->getDeviceWidth() / (float)glCanvas->getDeviceHeight(); //Handle fading and deactivation/activation of UI diff --git a/interface/src/ui/ApplicationOverlay.h b/interface/src/ui/ApplicationOverlay.h index 33dcea67a3..68edbda691 100644 --- a/interface/src/ui/ApplicationOverlay.h +++ b/interface/src/ui/ApplicationOverlay.h @@ -20,6 +20,8 @@ const float MAGNIFY_WIDTH = 220.0f; const float MAGNIFY_HEIGHT = 100.0f; const float MAGNIFY_MULT = 2.0f; +const float DEFAULT_OCULUS_UI_ANGULAR_SIZE = 72.0f; + // Handles the drawing of the overlays to the screen class ApplicationOverlay { public: @@ -35,6 +37,9 @@ public: QPoint getPalmClickLocation(const PalmData *palm) const; bool calculateRayUICollisionPoint(const glm::vec3& position, const glm::vec3& direction, glm::vec3& result) const; + float getOculusUIAngularSize() const { return _oculusUIAngularSize; } + void setOculusUIAngularSize(float oculusUIAngularSize) { _oculusUIAngularSize = oculusUIAngularSize; } + // Converter from one frame of reference to another. // Frame of reference: // Screen: Position on the screen (x,y) @@ -80,6 +85,8 @@ private: VerticesIndices _vbo; }; + float _oculusUIAngularSize = DEFAULT_OCULUS_UI_ANGULAR_SIZE; + void renderReticle(glm::quat orientation, float alpha); void renderPointers();; void renderMagnifier(glm::vec2 magPos, float sizeMult, bool showBorder); diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index c0d87898d7..75000a457a 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -157,7 +157,7 @@ void PreferencesDialog::loadPreferences() { ui.maxOctreePPSSpin->setValue(menuInstance->getMaxOctreePacketsPerSecond()); - ui.oculusUIAngularSizeSpin->setValue(menuInstance->getOculusUIAngularSize()); + ui.oculusUIAngularSizeSpin->setValue(qApp->getApplicationOverlay().getOculusUIAngularSize()); ui.sixenseReticleMoveSpeedSpin->setValue(menuInstance->getSixenseReticleMoveSpeed()); @@ -238,7 +238,7 @@ void PreferencesDialog::savePreferences() { Menu::getInstance()->setMaxOctreePacketsPerSecond(ui.maxOctreePPSSpin->value()); - Menu::getInstance()->setOculusUIAngularSize(ui.oculusUIAngularSizeSpin->value()); + qApp->getApplicationOverlay().setOculusUIAngularSize(ui.oculusUIAngularSizeSpin->value()); Menu::getInstance()->setSixenseReticleMoveSpeed(ui.sixenseReticleMoveSpeedSpin->value());