Skip to content

Commit

Permalink
Merge pull request ddnet#9124 from sjrc6/pr_smooth_expo_ease
Browse files Browse the repository at this point in the history
Apply exponential easing to smooth camera
  • Loading branch information
def- authored Oct 7, 2024
2 parents b41512a + b6bc5d1 commit 10df82a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/game/client/components/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 10df82a

Please sign in to comment.