-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix Parallax2D physics interpolation #91706
Conversation
3138003
to
85c0020
Compare
This comment was marked as outdated.
This comment was marked as outdated.
CC @markdibarry |
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.
I did some quick tests, and checked the screen center values while using camera drag with and without physics interpolation. LGTM.
I'm not clear on what I suspect they can both just derive the |
@lawnjelly Oh good catch. I didn't test with rotation and totally should have. The original behavior is still correct, but the interpolated version now has different behavior. I used a camera with position and rotation smoothing to show the difference. Without interpolation: untitled.mp4With interpolation: 2024-05-09.08-21-26.mp4Even worse when you try to do a full 360: untitled.mp4 |
@markdibarry Could you share your test scene as a ZIP file? |
Here you go! |
85c0020
to
885a26b
Compare
Thanks for the reviews and the test project! This should work fine now. |
@markdibarry I don't understand how you got to the situation in the screenshot, please upload the new MRP. |
@rburing I just set the zoom on the camera to 0.5. |
885a26b
to
e7c8c51
Compare
The camera_screen_center value was stale in case of interpolation.
e7c8c51
to
efb6a1c
Compare
@markdibarry I made a silly mistake, the PR should be good to go now. It works because the final lines of Lines 244 to 246 in be56cab
|
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.
Ran through tests for most things I think would be affected. LGTM. Great job!
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.
I think this looks as correct as possible, and I guess testing will reveal any problems here.
(It's been a while since I looked at Camera2D
, and the whole logic of doing processing in get_camera_transform()
has long needed refactoring.)
Thanks! |
The
camera_screen_center
value was stale in case of interpolation, so in that case we compute it using the affine inverse of the interpolated camera transform.