From 6b06987700b0ea1e814591a3591142dff2b8ba8f Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 15 Jul 2015 10:48:07 -0700 Subject: [PATCH] remove dead code for magnifier --- interface/src/ui/ApplicationCompositor.cpp | 69 ---------------------- interface/src/ui/ApplicationCompositor.h | 1 - 2 files changed, 70 deletions(-) diff --git a/interface/src/ui/ApplicationCompositor.cpp b/interface/src/ui/ApplicationCompositor.cpp index fb7fffb19c..5af82eef99 100644 --- a/interface/src/ui/ApplicationCompositor.cpp +++ b/interface/src/ui/ApplicationCompositor.cpp @@ -535,75 +535,6 @@ void ApplicationCompositor::renderControllerPointers(gpu::Batch& batch) { } } -//Renders a small magnification of the currently bound texture at the coordinates -void ApplicationCompositor::renderMagnifier(gpu::Batch& batch, const glm::vec2& magPos, float sizeMult, bool showBorder) { - if (!_magnifier) { - return; - } - auto canvasSize = qApp->getCanvasSize(); - - const int widgetWidth = canvasSize.x; - const int widgetHeight = canvasSize.y; - - const float halfWidth = (MAGNIFY_WIDTH / _textureAspectRatio) * sizeMult / 2.0f; - const float halfHeight = MAGNIFY_HEIGHT * sizeMult / 2.0f; - // Magnification Texture Coordinates - const float magnifyULeft = (magPos.x - halfWidth) / (float)widgetWidth; - const float magnifyURight = (magPos.x + halfWidth) / (float)widgetWidth; - const float magnifyVTop = 1.0f - (magPos.y - halfHeight) / (float)widgetHeight; - const float magnifyVBottom = 1.0f - (magPos.y + halfHeight) / (float)widgetHeight; - - const float newHalfWidth = halfWidth * MAGNIFY_MULT; - const float newHalfHeight = halfHeight * MAGNIFY_MULT; - //Get yaw / pitch value for the corners - const glm::vec2 topLeftYawPitch = overlayToSpherical(glm::vec2(magPos.x - newHalfWidth, - magPos.y - newHalfHeight)); - const glm::vec2 bottomRightYawPitch = overlayToSpherical(glm::vec2(magPos.x + newHalfWidth, - magPos.y + newHalfHeight)); - - const glm::vec3 bottomLeft = getPoint(topLeftYawPitch.x, bottomRightYawPitch.y); - const glm::vec3 bottomRight = getPoint(bottomRightYawPitch.x, bottomRightYawPitch.y); - const glm::vec3 topLeft = getPoint(topLeftYawPitch.x, topLeftYawPitch.y); - const glm::vec3 topRight = getPoint(bottomRightYawPitch.x, topLeftYawPitch.y); - - auto geometryCache = DependencyManager::get(); - - if (bottomLeft != _previousMagnifierBottomLeft || bottomRight != _previousMagnifierBottomRight - || topLeft != _previousMagnifierTopLeft || topRight != _previousMagnifierTopRight) { - QVector border; - border << topLeft; - border << bottomLeft; - border << bottomRight; - border << topRight; - border << topLeft; - geometryCache->updateVertices(_magnifierBorder, border, glm::vec4(1.0f, 0.0f, 0.0f, _alpha)); - - _previousMagnifierBottomLeft = bottomLeft; - _previousMagnifierBottomRight = bottomRight; - _previousMagnifierTopLeft = topLeft; - _previousMagnifierTopRight = topRight; - } - - glPushMatrix(); { - if (showBorder) { - glDisable(GL_TEXTURE_2D); - glLineWidth(1.0f); - //Outer Line - geometryCache->renderVertices(gpu::LINE_STRIP, _magnifierBorder); - glEnable(GL_TEXTURE_2D); - } - glm::vec4 magnifierColor = { 1.0f, 1.0f, 1.0f, _alpha }; - - DependencyManager::get()->renderQuad(bottomLeft, bottomRight, topRight, topLeft, - glm::vec2(magnifyULeft, magnifyVBottom), - glm::vec2(magnifyURight, magnifyVBottom), - glm::vec2(magnifyURight, magnifyVTop), - glm::vec2(magnifyULeft, magnifyVTop), - magnifierColor, _magnifierQuad); - - } glPopMatrix(); -} - void ApplicationCompositor::buildHemiVertices( const float fov, const float aspectRatio, const int slices, const int stacks) { static float textureFOV = 0.0f, textureAspectRatio = 1.0f; diff --git a/interface/src/ui/ApplicationCompositor.h b/interface/src/ui/ApplicationCompositor.h index 0f89f81d26..5df145afa2 100644 --- a/interface/src/ui/ApplicationCompositor.h +++ b/interface/src/ui/ApplicationCompositor.h @@ -77,7 +77,6 @@ private: void updateTooltips(); void renderPointers(gpu::Batch& batch); - void renderMagnifier(gpu::Batch& batch, const glm::vec2& magPos, float sizeMult, bool showBorder); void renderControllerPointers(gpu::Batch& batch); void renderPointersOculus(gpu::Batch& batch);