Improve camera smoothing when crouching#1326
Improve camera smoothing when crouching#1326Calinou wants to merge 1 commit intoredeclipse:masterfrom
Conversation
qreeves
left a comment
There was a problem hiding this comment.
I don't know if I understand the point of this, the demonstration isn't really clear on what is going on, and I'm looking at this 0.35 and wondering what the hell it is for. Maybe I just haven't had enough coffee yet.
Looking at the cheat sheet provided, it makes me wonder if we should be using a more elastic easing method.
src/game/game.cpp
Outdated
| } | ||
| else | ||
| { | ||
| // asymptoptic smoothing of crouch view height (smoother than linear interpolation) |
There was a problem hiding this comment.
In a codebase fairly devoid of comments where concise code is prioritized, having the same comment twice that takes up its own line is kind of a waste of space.
The |
Should probably be a variable then 👍 |
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.
1a4529a to
0804cc2
Compare
|
What's the status on this PR? I see no problems with this, other than the previously mentioned issue not being addressed. |
| if(crouching || d->crouching(true)) | ||
| { | ||
| float zamt = zoff*curtime/float(PHYSMILLIS); | ||
| float crouchanimspeedscale = 0.35f; |
There was a problem hiding this comment.
Make this a game variable as requested
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
smooth-crouch.mp4