mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 06:53:01 +02:00
remove dead code for magnifier
This commit is contained in:
parent
0eeddddd6b
commit
6b06987700
2 changed files with 0 additions and 70 deletions
|
@ -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<GeometryCache>();
|
|
||||||
|
|
||||||
if (bottomLeft != _previousMagnifierBottomLeft || bottomRight != _previousMagnifierBottomRight
|
|
||||||
|| topLeft != _previousMagnifierTopLeft || topRight != _previousMagnifierTopRight) {
|
|
||||||
QVector<glm::vec3> 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<GeometryCache>()->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(
|
void ApplicationCompositor::buildHemiVertices(
|
||||||
const float fov, const float aspectRatio, const int slices, const int stacks) {
|
const float fov, const float aspectRatio, const int slices, const int stacks) {
|
||||||
static float textureFOV = 0.0f, textureAspectRatio = 1.0f;
|
static float textureFOV = 0.0f, textureAspectRatio = 1.0f;
|
||||||
|
|
|
@ -77,7 +77,6 @@ private:
|
||||||
void updateTooltips();
|
void updateTooltips();
|
||||||
|
|
||||||
void renderPointers(gpu::Batch& batch);
|
void renderPointers(gpu::Batch& batch);
|
||||||
void renderMagnifier(gpu::Batch& batch, const glm::vec2& magPos, float sizeMult, bool showBorder);
|
|
||||||
void renderControllerPointers(gpu::Batch& batch);
|
void renderControllerPointers(gpu::Batch& batch);
|
||||||
void renderPointersOculus(gpu::Batch& batch);
|
void renderPointersOculus(gpu::Batch& batch);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue