diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index b6fd769..4d41830 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -132,14 +132,16 @@ void setIsometricView(bool isometric){ } glm::vec2 getCursorWorldPos(const glm::vec2& cursorPos, float aspectRatio, float zoom, float windowWidth, float windowHeight){ + float isometricEased = utils::easeInOutExpo(isometricShade); + float relativeX = (cursorPos.x / windowWidth * 2) - 1; float relativeY = (cursorPos.y / windowHeight * 2) - 1; float deltaX = relativeX * aspectRatio / zoom; float deltaY = relativeY / zoom; - float worldX = camPos.x + deltaX * (1 - isometricView) + (0.5 * deltaX + deltaY) * isometricView; - float worldY = camPos.y + deltaY * (1 - isometricView) + (-0.5 * deltaX + deltaY) * isometricView; + float worldX = camPos.x + deltaX * (1 - isometricEased) + (0.5 * deltaX + deltaY) * isometricEased; + float worldY = camPos.y + deltaY * (1 - isometricEased) + (-0.5 * deltaX + deltaY) * isometricEased; return {worldX, worldY}; }