From 7219a925d2697744ba28713caa4970b6dd4f86cb Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Fri, 19 Feb 2016 14:17:28 -0800 Subject: [PATCH] remove getTrueMouse() --- interface/src/Application.cpp | 25 +++++++++++-------------- interface/src/Application.h | 2 -- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index efb12c9623..792a06e136 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2064,9 +2064,10 @@ void Application::keyPressEvent(QKeyEvent* event) { break; case Qt::Key_Space: { if (!event->isAutoRepeat()) { + // FIXME -- I don't think we've tested the HFActionEvent in a while... this looks possibly dubious // this starts an HFActionEvent HFActionEvent startActionEvent(HFActionEvent::startType(), - computePickRay(getTrueMouse().x, getTrueMouse().y)); + computePickRay(getMouse().x, getMouse().y)); sendEvent(this, &startActionEvent); } @@ -2115,9 +2116,10 @@ void Application::keyReleaseEvent(QKeyEvent* event) { switch (event->key()) { case Qt::Key_Space: { if (!event->isAutoRepeat()) { + // FIXME -- I don't think we've tested the HFActionEvent in a while... this looks possibly dubious // this ends the HFActionEvent HFActionEvent endActionEvent(HFActionEvent::endType(), - computePickRay(getTrueMouse().x, getTrueMouse().y)); + computePickRay(getMouse().x, getMouse().y)); sendEvent(this, &endActionEvent); } break; @@ -2577,10 +2579,15 @@ void Application::setLowVelocityFilter(bool lowVelocityFilter) { } ivec2 Application::getMouse() { + auto reticlePosition = _compositor.getReticlePosition(); + + // in the HMD, the reticlePosition is the mouse position if (isHMDMode()) { - return getTrueMouse(); // FIXME + return reticlePosition; } - return getTrueMouse(); + + // in desktop mode, we need to map from global to widget space + return toGlm(_glWidget->mapFromGlobal(QPoint(reticlePosition.x, reticlePosition.y))); } FaceTracker* Application::getActiveFaceTracker() { @@ -4738,20 +4745,10 @@ QSize Application::getDeviceSize() const { return fromGlm(getActiveDisplayPlugin()->getRecommendedRenderSize()); } -PickRay Application::computePickRay() { - return computePickRay(getTrueMouse().x, getTrueMouse().y); -} - bool Application::isThrottleRendering() const { return getActiveDisplayPlugin()->isThrottled(); } -// FIXME -- consolidate users of getTrueMouse() _compositor.getReticlePosition() -ivec2 Application::getTrueMouse() { - auto reticlePosition = _compositor.getReticlePosition(); - return toGlm(_glWidget->mapFromGlobal(QPoint(reticlePosition.x, reticlePosition.y))); -} - bool Application::hasFocus() const { return getActiveDisplayPlugin()->hasFocus(); } diff --git a/interface/src/Application.h b/interface/src/Application.h index f05c5c6123..482f0afef6 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -119,7 +119,6 @@ public: glm::uvec2 getUiSize() const; QSize getDeviceSize() const; bool hasFocus() const; - PickRay computePickRay(); bool isThrottleRendering() const; @@ -142,7 +141,6 @@ public: EntityEditPacketSender* getEntityEditPacketSender() { return &_entityEditSender; } ivec2 getMouse(); - ivec2 getTrueMouse(); FaceTracker* getActiveFaceTracker(); FaceTracker* getSelectedFaceTracker();