-
-
Notifications
You must be signed in to change notification settings - Fork 551
Move frame prediction logic for camera from Sector to Camera #3173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
da82dfb to
606b90b
Compare
|
I forgot to say why I am making this PR now: I spent a few hours today trying to figure out how to, when the frame prediction option is enabled, change the Camera logic to extrapolate the camera position instead of interpolating with between 0 and 1 frames of delay. (Done right, this should make the jump cuts when Tux goes through pipes in |
|
I tested this briefly. I think with this change it looks even smoother. |
606b90b to
3758735
Compare
Err.... when making this change I forgot to, as the code had done before, disable the camera interpolation when frame prediction is not used. (I've updated the commit to fix this.) The camera interpolation logic adds up to a frame of lag to the camera, so it's possible that you are just noticing the accidentally increased camera inaccuracy when frame prediction was off. This change should not affect how the frame prediction option works, except in the few rare cases where e.g. Camera.set_pos/Camera.set_scale are used in scripts. Edit: have pushed second update to adjust formatting. |
3758735 to
2b795fb
Compare
2b795fb to
566c7ed
Compare
MatusGuy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good
566c7ed to
0c882f1
Compare
5083ab8 to
fdf2abb
Compare
fdf2abb to
0d074e6
Compare
|
Can this get merged? |
0d074e6 to
66ab4f3
Compare
66ab4f3 to
0d885aa
Compare
This makes it possible to avoid interpolating the camera position when a Camera::move or other discontinuous transition is requested.
0d885aa to
9e73c4f
Compare
This commit avoids interpolating the camera position when a Camera::move or other discontinuous transition is requested.
Note: jumps in the camera position that are purely driven by changes to Tux's position will continue to be interpolated. (For example, when
Tux.set_pos()is called inbonus1/mario.stl.)