Improve camera smoothing when crouching
Asymptoptic (ease-out) smoothing is now used instead of linear interpolation. This kind of smoothing is often used for camera crouching animations in modern FPS games (see Doom 3 or Xonotic for examples).
This smoothing has been tested to be FPS-independent. It works well in all common situations (crouching/uncrouching, moving while crouching, crouchsliding).
In the future, a similar kind of smoothing can be used for things such as the first-person model animation when crouchsliding, weapon scope FOV changes, etc.
Preview
https://user-images.githubusercontent.com/180032/147613050-aff6acbb-f0d0-4078-890d-0be4da125b13.mp4
and I'm looking at this 0.35 and wondering what the hell it is for.
The 0.35f is a magic value that scales the animation speed (higher is faster). I should have made this clearer in the code :slightly_smiling_face:
The
0.35fis a magic value that scales the animation speed (higher is faster). I should have made this clearer in the code 🙂
Should probably be a variable then 👍
What's the status on this PR? I see no problems with this, other than the previously mentioned issue not being addressed. Once there's a game variable for the easing of the animation, I think it'll be good to merge.