From b6bc5d1884ab9bd99993402cbb4b81ab2b9df734 Mon Sep 17 00:00:00 2001 From: Tater Date: Sun, 6 Oct 2024 22:45:48 -0500 Subject: [PATCH] apply exponential easing to smooth camera --- src/game/client/components/camera.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/client/components/camera.cpp b/src/game/client/components/camera.cpp index 307f3c32618..d57840a0dcc 100644 --- a/src/game/client/components/camera.cpp +++ b/src/game/client/components/camera.cpp @@ -39,7 +39,8 @@ CCamera::CCamera() float CCamera::CameraSmoothingProgress(float CurrentTime) const { - return (CurrentTime - m_CameraSmoothingStart) / (m_CameraSmoothingEnd - m_CameraSmoothingStart); + float Progress = (CurrentTime - m_CameraSmoothingStart) / (m_CameraSmoothingEnd - m_CameraSmoothingStart); + return 1.0 - std::pow(2.0, -10.0 * Progress); } float CCamera::ZoomProgress(float CurrentTime) const