From 782a5c491ebac32f30ac183d36da0bbdb89a2060 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Tue, 28 Jul 2015 12:56:31 -0700 Subject: [PATCH] removed hand lasers because they had been renamed so they weren't removed --- interface/src/Application.cpp | 7 +----- interface/src/Menu.cpp | 1 - interface/src/Menu.h | 1 - interface/src/ui/ApplicationCompositor.cpp | 25 +++++++++------------- tests/ui/src/main.cpp | 1 - 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 16248d74af..6c8093dc29 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2838,7 +2838,7 @@ void Application::emulateMouse(Hand* hand, float click, float shift, int index) unsigned int deviceID = index == 0 ? CONTROLLER_0_EVENT : CONTROLLER_1_EVENT; - if (Menu::getInstance()->isOptionChecked(MenuOption::HandLasers) || qApp->isHMDMode()) { + if (qApp->isHMDMode()) { pos = qApp->getApplicationCompositor().getPalmClickLocation(palm); } else { @@ -3551,11 +3551,6 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se sceneInterface->setEngineDrawnOverlay3DItems(engineRC->_numDrawnOverlay3DItems); } - //Render the sixense lasers - if (Menu::getInstance()->isOptionChecked(MenuOption::HandLasers)) { - _myAvatar->renderLaserPointers(*renderArgs->_batch); - } - if (!selfAvatarOnly) { // give external parties a change to hook in { diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 890c1ef96a..d41fac9a72 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -437,7 +437,6 @@ Menu::Menu() { addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHands, 0, true); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::HandMouseInput, 0, true); - addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::HandLasers, 0, false); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::LowVelocityFilter, 0, true, qApp, SLOT(setLowVelocityFilter(bool))); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::ShowIKConstraints, 0, false); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 276ea44043..bcb038bd5d 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -196,7 +196,6 @@ namespace MenuOption { const QString FullscreenMirror = "Fullscreen Mirror"; const QString GlowWhenSpeaking = "Glow When Speaking"; const QString HandMouseInput = "Enable Hand Mouse Input"; - const QString HandLasers = "Enable Hand UI Lasers"; const QString IncreaseAvatarSize = "Increase Avatar Size"; const QString IndependentMode = "Independent Mode"; const QString InputMenu = "Avatar>Input Devices"; diff --git a/interface/src/ui/ApplicationCompositor.cpp b/interface/src/ui/ApplicationCompositor.cpp index dc75edf905..81fef04185 100644 --- a/interface/src/ui/ApplicationCompositor.cpp +++ b/interface/src/ui/ApplicationCompositor.cpp @@ -511,24 +511,19 @@ void ApplicationCompositor::renderControllerPointers(gpu::Batch& batch) { auto canvasSize = qApp->getCanvasSize(); int mouseX, mouseY; - if (Menu::getInstance()->isOptionChecked(MenuOption::HandLasers)) { - QPoint res = getPalmClickLocation(palmData); - mouseX = res.x(); - mouseY = res.y(); - } else { - // Get directon relative to avatar orientation - glm::vec3 direction = glm::inverse(myAvatar->getOrientation()) * palmData->getFingerDirection(); - // Get the angles, scaled between (-0.5,0.5) - float xAngle = (atan2f(direction.z, direction.x) + PI_OVER_TWO); - float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)PI_OVER_TWO)); + // Get directon relative to avatar orientation + glm::vec3 direction = glm::inverse(myAvatar->getOrientation()) * palmData->getFingerDirection(); - // Get the pixel range over which the xAngle and yAngle are scaled - float cursorRange = canvasSize.x * InputDevice::getCursorPixelRangeMult(); + // Get the angles, scaled between (-0.5,0.5) + float xAngle = (atan2f(direction.z, direction.x) + PI_OVER_TWO); + float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)PI_OVER_TWO)); - mouseX = (canvasSize.x / 2.0f + cursorRange * xAngle); - mouseY = (canvasSize.y / 2.0f + cursorRange * yAngle); - } + // Get the pixel range over which the xAngle and yAngle are scaled + float cursorRange = canvasSize.x * InputDevice::getCursorPixelRangeMult(); + + mouseX = (canvasSize.x / 2.0f + cursorRange * xAngle); + mouseY = (canvasSize.y / 2.0f + cursorRange * yAngle); //If the cursor is out of the screen then don't render it if (mouseX < 0 || mouseX >= (int)canvasSize.x || mouseY < 0 || mouseY >= (int)canvasSize.y) { diff --git a/tests/ui/src/main.cpp b/tests/ui/src/main.cpp index 71033406e5..c47639003f 100644 --- a/tests/ui/src/main.cpp +++ b/tests/ui/src/main.cpp @@ -147,7 +147,6 @@ public: NamesAboveHeads, GoToUser, HandMouseInput, - HandLasers, HMDTools, IncreaseAvatarSize, KeyboardMotorControl,