-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
2D Follow Physics Interpolation #294
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- [Added] Interpolation Update Mode to PCamHost - [Added] Additional warnings
- [Updated] Physics Interpolation to use string setters
- [Moved] Follow Targets setters/getters closer to other Follow setters/getters
ramokz
added a commit
that referenced
this pull request
Jun 1, 2024
* Move all spring arm initializaiton code out of _process into _ready (#282) * Move all spring arm initializaiton code out of _process into _ready. Resolves #193 * Making _follow_spring_arm explicitly top_level * Default _follow_spring_arm.position initialization to the original pcam position if follow_target is not available * Updated plugin.cfg to 0.7.1 * Change Camera3DResource.cull_mask to use export_flags_3d_render. Resolves #290 (#293) * Only show viewfinder if the active PCam's mode is framed (#295) * Only show viewfinder in the correct follow mode * Adjust comments * Reorder early returns * Remove unneeded type cast * Updated Editor Updater wording for major releases * Improved Limit Target error setter * Added FUNDING.yml * 2D Follow Physics Interpolation (#294) * Initial _process / _physics_process logic split * More 2d physics interpolation supported - [Added] Interpolation Update Mode to PCamHost - [Added] Additional warnings * Commented out 4.3 specific code * Stripped out a few todo comments * Removed uneeded checkers * Added physics body checker for Group Follow * Added reset_physics_interpolation - [Updated] Physics Interpolation to use string setters * Added physics target checker to PCam3D - [Moved] Follow Targets setters/getters closer to other Follow setters/getters * Aligned PCam2D' script with PCam3D's * Added missing variable assignment * Added missing return for Framed Follow checker * Removed unneeded boolean flag * Tidied up process logic * Added Jitter Tip output * Added physics checker to Look At Group * Updated parameter type from NodePath to Node3D * Updated spacing for setters/getter functions * Set _player_visual to top level in 2D example scene * Added additional jitter context * Updated append_look_at_targets_array * Added Godot 4.3 2D example scene variants --------- Co-authored-by: ZenithStar <ZenithStar@users.noreply.github.com> Co-authored-by: audeck <55060124+audeck@users.noreply.github.com>
ramokz
added a commit
that referenced
this pull request
Jun 3, 2024
* Move all spring arm initializaiton code out of _process into _ready (#282) * Move all spring arm initializaiton code out of _process into _ready. Resolves #193 * Making _follow_spring_arm explicitly top_level * Default _follow_spring_arm.position initialization to the original pcam position if follow_target is not available * Updated plugin.cfg to 0.7.1 * Change Camera3DResource.cull_mask to use export_flags_3d_render. Resolves #290 (#293) * Only show viewfinder if the active PCam's mode is framed (#295) * Only show viewfinder in the correct follow mode * Adjust comments * Reorder early returns * Remove unneeded type cast * Updated Editor Updater wording for major releases * Improved Limit Target error setter * Added FUNDING.yml * 2D Follow Physics Interpolation (#294) * Initial _process / _physics_process logic split * More 2d physics interpolation supported - [Added] Interpolation Update Mode to PCamHost - [Added] Additional warnings * Commented out 4.3 specific code * Stripped out a few todo comments * Removed uneeded checkers * Added physics body checker for Group Follow * Added reset_physics_interpolation - [Updated] Physics Interpolation to use string setters * Added physics target checker to PCam3D - [Moved] Follow Targets setters/getters closer to other Follow setters/getters * Aligned PCam2D' script with PCam3D's * Added missing variable assignment * Added missing return for Framed Follow checker * Removed unneeded boolean flag * Tidied up process logic * Added Jitter Tip output * Added physics checker to Look At Group * Updated parameter type from NodePath to Node3D * Updated spacing for setters/getter functions * Set _player_visual to top level in 2D example scene * Added additional jitter context * Phantom Camera Manager (#306) * Initial _process / _physics_process logic split * More 2d physics interpolation supported - [Added] Interpolation Update Mode to PCamHost - [Added] Additional warnings * Commented out 4.3 specific code * Stripped out a few todo comments * Removed uneeded checkers * Added physics body checker for Group Follow * Added reset_physics_interpolation - [Updated] Physics Interpolation to use string setters * Added physics target checker to PCam3D - [Moved] Follow Targets setters/getters closer to other Follow setters/getters * Aligned PCam2D' script with PCam3D's * Added missing variable assignment * Added missing return for Framed Follow checker * Removed unneeded boolean flag * Tidied up process logic * Added Phantom Camera Manager singleton * Minor fix for when not having a PCam in scene * Removed print statement * Fixed merge error * Removed unneeded print statement * Improved viewfinder detection (#307) * Added PCamHost warning when not child of Camera * Additional camera3d parameters (#308) * Added additional PhantomCamera3DResource properties * Shortened Camera3DResource local variable names * Updated Editor Updater to be less intrusive (#309) * Conditional checker for Cam3DRes changes * Added support for disable_3d export templates (#311) * Fixed viewfinder during play error * Minor tweaks * Minor post-main merge fix * Updated plugin.cfg to 0.7.2 * Resolved issue with disabled tween on load for Third Person Follow (#319) * Updated Third Person to update follow_position instead of global_position * Removed commented out code in PCamHost * Resolved issue with Follow Mode None getting stuck (#320) * Added public properties and getters for PCamManager * Updated git issue link --------- Co-authored-by: ZenithStar <ZenithStar@users.noreply.github.com> Co-authored-by: audeck <55060124+audeck@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
Both Godot 4.2 and 4.3 are supported, however the enhancements here will only work for Godot 4.3 dev6 or later.
Important
The changes only affect 2D scenes.
3D phyics interpolation are not yet supported in Godot and will be added in a future release.
What is this?
This change applies the newly added physics interpolation that was included in Godot 4.3 dev 6 release.
The changes in this PR allows a
PCam2D
to support having afollow target
of either aPhysicsBody2D
-based or a non-PhysicsBody2D
-based node, where theCamera2D
will then automatically adjust its interpolation mode to match. Resulting in a jitter-free movement.Before this, the user had to make use of either the smoothing-addon or implement their own solution to interpolate visuals as mentioned in the documentation.
For Godot 4.2
This release will still be compatible with Godot 4.2. It does a few checks to confirm the version and disables the added functionality while retaining existing behaviour. So nothing should be worse or better from this change.
Note
It will encourage to upgrade to Godot 4.3 if one attempts to select a
PhysicsBody2D
as afollow target
orfollow targets
(Group Follow).For Godot 4.3
Project Settings
Physics Interpolation
, insidephysics/common/physics_interpolation
Advanced Settings
will likely need to be enabled to see it.PhantomCameraHost
To enable the newly added physics interpolation, uncomment the following two lines insidePhantomCameraHost.gd
on line201
and206
.Do no uncomment those lines in Godot 4.2 as that will likely crash the editor.
Known Issues
Note
All known issues have now been addressed.
Switching to aPCam2D
that has aPhysicsBody2D
follow target
from anotherPCam2D
that either has nofollow target
or a non-PhysicsBody2D
follow target
will cause a sudden camera flickering on the first few frames. The tween still triggers, but the effect is very noticeable and not good enough for release.This appears to be due to setting theCamera2D
'sphysics_interpolation_mode
toNode.PHYSICS_INTERPOLATION_MODE_ON
from having previously beingNode.PHYSICS_INTERPOLATION_MODE_OFF
.Notes
This issue is only appearing when enabling it after it has been disabled, and not the other way around.This appears to occur independently of the addon and occurs in simple projects too