Showing the changes to interface/src/Application.cpp (1 of 12 files). Show all
Unified · Split
| @@ -806,14 +806,14 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 805 unmodified lines | ||
| 806 | 806 | } else if (action == controller::toInt(controller::Action::CYCLE_CAMERA)) { |
| 807 | 807 | cycleCamera(); |
| 808 | 808 | } else if (action == controller::toInt(controller::Action::CONTEXT_MENU)) { |
| 809 | − auto reticlePosition = _controllerScriptingInterface->getReticlePosition(); | |
| 809 | + auto reticlePosition = _compositor.getReticlePosition(); | |
| 810 | 810 | offscreenUi->toggleMenu(_glWidget->mapFromGlobal(QPoint(reticlePosition.x, reticlePosition.y))); |
| 811 | 811 | } else if (action == controller::toInt(controller::Action::RETICLE_X)) { |
| 812 | − auto oldPos = _controllerScriptingInterface->getReticlePosition(); | |
| 813 | − _controllerScriptingInterface->setReticlePosition({ oldPos.x + state, oldPos.y }); | |
| 812 | + auto oldPos = _compositor.getReticlePosition(); | |
| 813 | + _compositor.setReticlePosition({ oldPos.x + state, oldPos.y }); | |
| 814 | 814 | } else if (action == controller::toInt(controller::Action::RETICLE_Y)) { |
| 815 | − auto oldPos = _controllerScriptingInterface->getReticlePosition(); | |
| 816 | − _controllerScriptingInterface->setReticlePosition({ oldPos.x, oldPos.y + state }); | |
| 815 | + auto oldPos = _compositor.getReticlePosition(); | |
| 816 | + _compositor.setReticlePosition({ oldPos.x, oldPos.y + state }); | |
| 817 | 817 | } |
| 818 | 818 | } |
| 819 | 819 | }); |
| @@ -1254,6 +1254,7 @@ void Application::initializeUi() { · 434 unmodified lines | ||
| 1254 | 1254 | rootContext->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data()); |
| 1255 | 1255 | rootContext->setContextProperty("Scene", DependencyManager::get<SceneScriptingInterface>().data()); |
| 1256 | 1256 | rootContext->setContextProperty("Render", _renderEngine->getConfiguration().get()); |
| 1257 | + rootContext->setContextProperty("Reticle", _compositor.getReticleInterface()); | |
| 1257 | 1258 | |
| 1258 | 1259 | _glWidget->installEventFilter(offscreenUi.data()); |
| 1259 | 1260 | offscreenUi->setMouseTranslator([=](const QPointF& pt) { |
| @@ -2085,7 +2086,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 825 unmodified lines | ||
| 2085 | 2086 | void Application::keyReleaseEvent(QKeyEvent* event) { |
| 2086 | 2087 | if (event->key() == Qt::Key_Alt && _altPressed && hasFocus()) { |
| 2087 | 2088 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |
| 2088 | − auto reticlePosition = _controllerScriptingInterface->getReticlePosition(); | |
| 2089 | + auto reticlePosition = _compositor.getReticlePosition(); | |
| 2089 | 2090 | offscreenUi->toggleMenu(_glWidget->mapFromGlobal(QPoint(reticlePosition.x, reticlePosition.y))); |
| 2090 | 2091 | } |
| 2091 | 2092 | |
| @@ -2542,7 +2543,7 @@ void Application::setLowVelocityFilter(bool lowVelocityFilter) { · 450 unmodified lines | ||
| 2542 | 2543 | controller::InputDevice::setLowVelocityFilter(lowVelocityFilter); |
| 2543 | 2544 | } |
| 2544 | 2545 | |
| 2545 | −ivec2 Application::getMouse() const { | |
| 2546 | +ivec2 Application::getMouse() { | |
| 2546 | 2547 | if (isHMDMode()) { |
| 2547 | 2548 | return _compositor.screenToOverlay(getTrueMouse()); |
| 2548 | 2549 | } |
| @@ -3566,7 +3567,7 @@ glm::vec3 Application::getSunDirection() { · 1017 unmodified lines | ||
| 3566 | 3567 | // FIXME, preprocessor guard this check to occur only in DEBUG builds |
| 3567 | 3568 | static QThread * activeRenderingThread = nullptr; |
| 3568 | 3569 | |
| 3569 | −PickRay Application::computePickRay(float x, float y) const { | |
| 3570 | +PickRay Application::computePickRay(float x, float y) { | |
| 3570 | 3571 | vec2 pickPoint { x, y }; |
| 3571 | 3572 | PickRay result; |
| 3572 | 3573 | if (isHMDMode()) { |
| @@ -4216,6 +4217,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 643 unmodified lines | ||
| 4216 | 4217 | scriptEngine->registerGlobalObject("Render", _renderEngine->getConfiguration().get()); |
| 4217 | 4218 | |
| 4218 | 4219 | scriptEngine->registerGlobalObject("ScriptDiscoveryService", DependencyManager::get<ScriptEngines>().data()); |
| 4220 | + scriptEngine->registerGlobalObject("Reticle", _compositor.getReticleInterface()); | |
| 4219 | 4221 | } |
| 4220 | 4222 | |
| 4221 | 4223 | bool Application::canAcceptURL(const QString& urlString) const { |
| @@ -4695,7 +4697,7 @@ QSize Application::getDeviceSize() const { · 473 unmodified lines | ||
| 4695 | 4697 | return fromGlm(getActiveDisplayPlugin()->getRecommendedRenderSize()); |
| 4696 | 4698 | } |
| 4697 | 4699 | |
| 4698 | −PickRay Application::computePickRay() const { | |
| 4700 | +PickRay Application::computePickRay() { | |
| 4699 | 4701 | return computePickRay(getTrueMouse().x, getTrueMouse().y); |
| 4700 | 4702 | } |
| 4701 | 4703 | |
| @@ -4703,9 +4705,9 @@ bool Application::isThrottleRendering() const { · 1 unmodified line | ||
| 4703 | 4705 | return getActiveDisplayPlugin()->isThrottled(); |
| 4704 | 4706 | } |
| 4705 | 4707 | |
| 4706 | −// FIXME -- consolidate users of getTrueMouse() controllerScriptingInterface->getReticlePosition() | |
| 4707 | −ivec2 Application::getTrueMouse() const { | |
| 4708 | − auto reticlePosition = _controllerScriptingInterface->getReticlePosition(); | |
| 4708 | +// FIXME -- consolidate users of getTrueMouse() _compositor.getReticlePosition() | |
| 4709 | +ivec2 Application::getTrueMouse() { | |
| 4710 | + auto reticlePosition = _compositor.getReticlePosition(); | |
| 4709 | 4711 | return toGlm(_glWidget->mapFromGlobal(QPoint(reticlePosition.x, reticlePosition.y))); |
| 4710 | 4712 | } |
| 4711 | 4713 | |