Decouple SeparationRayShape2D/3D configuration of collision detection and collision resolution
#111862
+183
−118
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.
This is an alternate solution to #111822 in addressing #111763 and #110407
This solution attempts to address the limitations of the engine rather than just explaining the limitations in the documentation.
Regardless of if they are reasonable, these changes are breaking and so I understand them not being eligible for a 4.x release.
This pull requests breaks the responsibility of
SeparationRayShape2D/3D.slide_on_slopeinto two separate properties,stops_motionandseparate_along_ray. The idea behind this is thatslide_on_slopeis currently responsible for controlling two unrelated aspects of separation ray collision.While this implementation makes sense within the context of solely allowing separation rays to slide on slopes, it is not farfetched to think that a users might want to control both of these aspects independently. In fact the inability to control these aspects independently is even being worked around inside the engine. The
CharacterBody2D/3Dfloor snapping logic usesPhysicsTestMotionParameters2D/3D.collide_separation_rayto disable the second effect ofslide_on_slope(I have renamed this property toseparation_rays_stop_motionfor consistency with the other changes).I have attempted to update the documentation where applicable but I do not feel confident enough to update the translations. This is a large reason I am leaving this as a draft.
The other reason being that I am aware that this implementation increases the memory footprint of each shape. I though to remedy this by using an Enum but coming up with intuitive and concise names for each state escaped me.
I additionally question whether
PhysicsTestMotionParameters2D/3D.collide_separation_rayis necessary if users are able to individually toggle which rays stop motion.