base icon indicating copy to clipboard operation
base copied to clipboard

Improve camera smoothing when crouching

Open Calinou opened this issue 4 years ago • 3 comments

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

Calinou avatar Dec 28 '21 22:12 Calinou

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:

Calinou avatar Dec 29 '21 03:12 Calinou

The 0.35f is 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 👍

qreeves avatar Dec 29 '21 04:12 qreeves

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.

q009 avatar Jun 05 '22 11:06 q009