Skip to content

Commit

Permalink
apply exponential easing to smooth camera
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed Oct 7, 2024
1 parent b41512a commit b6bc5d1
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 b6bc5d1

Please sign in to comment.