-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
[3.x] Physics Interpolation - 3D shifting origin support #92469
base: 3.x
Are you sure you want to change the base?
Conversation
33296d3
to
7138f60
Compare
7138f60
to
ca8439d
Compare
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.
Tested locally on https://github.com/godotengine/godot-demo-projects/tree/3.x/3d/kinematic_character, it works as expected.
Before
Both videos use 4x slowdown and 10 physics ticks per second.
reset_before.mp4
After
reset_after.mp4
doc/classes/VisualServer.xml
Outdated
Transforms both the current and previous stored transform for a camera. | ||
This allows transforming a camera without creating a "glitch" in the interpolation. | ||
This is particularly useful for large worlds utilising a shifting origin. |
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.
Each linebreak creates a new paragraph (which takes space), so I think this makes more sense as a single paragraph:
Transforms both the current and previous stored transform for a camera. | |
This allows transforming a camera without creating a "glitch" in the interpolation. | |
This is particularly useful for large worlds utilising a shifting origin. | |
Transforms both the current and previous stored transform for a camera. This allows transforming a camera without creating a "glitch" in the interpolation. This is particularly useful for large worlds utilising a shifting origin. |
doc/classes/VisualServer.xml
Outdated
Transforms both the current and previous stored transform for an instance. | ||
This allows transforming an instance without creating a "glitch" in the interpolation. | ||
This is particularly useful for large worlds utilising a shifting origin. |
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.
Transforms both the current and previous stored transform for an instance. | |
This allows transforming an instance without creating a "glitch" in the interpolation. | |
This is particularly useful for large worlds utilising a shifting origin. | |
Transforms both the current and previous stored transform for an instance. This allows transforming an instance without creating a "glitch" in the interpolation. This is particularly useful for large worlds utilising a shifting origin. |
scene/3d/camera.cpp
Outdated
@@ -121,6 +121,13 @@ void Camera::_notification(int p_what) { | |||
if (doppler_tracking != DOPPLER_TRACKING_DISABLED) { | |||
velocity_tracker->update_position(get_global_transform().origin); | |||
} | |||
|
|||
// Auto-reset when first adding to the tree, as a convenience. |
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.
// Auto-reset when first adding to the tree, as a convenience. | |
// Auto-reset when first adding to the tree, as a convenience. |
Just making this draft temporarily as I've moved some of the auto-reset functionality to #92784. (Otherwise it is impossible to keep the changes in sync). I'll probably edit this PR to include just the moving origin support as that is fairly self-contained. |
ca8439d
to
ec2d2cb
Compare
instance_transform_physics_interpolation()
.Discussion
Once auto-resets are added for 3D, it becomes necessary to add explicit support for moving origins, as moving origin worlds (for large world support) cannot be achieved easily without this.
ToDo
Still need to add support to call the
VisualServer
functions fromVisualInstance
, and supportCameras
(which will work differently as of #92784).