mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:17:14 +02:00
Merge branch 'magnifier' into plugins_pt2
This commit is contained in:
commit
b29fbfe693
1 changed files with 1 additions and 3 deletions
|
@ -1226,19 +1226,17 @@ glm::vec2 ApplicationOverlay::sphericalToOverlay(const glm::vec2& sphericalPos)
|
||||||
result /= _textureFov;
|
result /= _textureFov;
|
||||||
result.x /= _textureAspectRatio;
|
result.x /= _textureAspectRatio;
|
||||||
result += 0.5f;
|
result += 0.5f;
|
||||||
result.x = (-sphericalPos.x / (_textureFov * _textureAspectRatio) + 0.5f);
|
|
||||||
result.y = (sphericalPos.y / _textureFov + 0.5f);
|
|
||||||
result *= qApp->getCanvasSize();
|
result *= qApp->getCanvasSize();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec2 ApplicationOverlay::overlayToSpherical(const glm::vec2& overlayPos) const {
|
glm::vec2 ApplicationOverlay::overlayToSpherical(const glm::vec2& overlayPos) const {
|
||||||
glm::vec2 result = overlayPos;
|
glm::vec2 result = overlayPos;
|
||||||
result.x *= -1.0;
|
|
||||||
result /= qApp->getCanvasSize();
|
result /= qApp->getCanvasSize();
|
||||||
result -= 0.5f;
|
result -= 0.5f;
|
||||||
result *= _textureFov;
|
result *= _textureFov;
|
||||||
result.x *= _textureAspectRatio;
|
result.x *= _textureAspectRatio;
|
||||||
|
result.x *= -1.0f;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue