Skip to content

Conversation

@WesleyClements
Copy link
Contributor

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_slope into two separate properties, stops_motion and separate_along_ray. The idea behind this is that slide_on_slope is currently responsible for controlling two unrelated aspects of separation ray collision.

  • First, it determines if collisions should be resolved by separating along the length of the ray or along the collision normal.
  • Second, it is responsible for determining whether separation rays are used for collision detection.

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/3D floor snapping logic uses PhysicsTestMotionParameters2D/3D.collide_separation_ray to disable the second effect of slide_on_slope (I have renamed this property to separation_rays_stop_motion for 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_ray is necessary if users are able to individually toggle which rays stop motion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants