Skip to content

C#: Update Aabb IntersectsSegment and IntersectsRay API#103152

Open
beicause wants to merge 1 commit intogodotengine:masterfrom
beicause:cs-aabb-intersects-api
Open

C#: Update Aabb IntersectsSegment and IntersectsRay API#103152
beicause wants to merge 1 commit intogodotengine:masterfrom
beicause:cs-aabb-intersects-api

Conversation

@beicause
Copy link
Copy Markdown
Contributor

Closes #103088

Update Aabb.IntersectsSegment and add Aabb.IntersectsRay. Basically ported from https://github.com/godotengine/godot/blob/master/core/math/aabb.cpp

@paulloz
Copy link
Copy Markdown
Member

paulloz commented Mar 10, 2025

Thanks for your contribution!

This seems consistent with core implementation, and with e.g. our Plane.IntersectsRay(Vector3, Vector3) implementation1. Not sure when we can introduce the breaking change, but I think we should consider it as soon as we can.

Note that #97695 also implements IntersectsRay(Vector3, Vector3), but with the old signature.

Footnotes

  1. https://github.com/godotengine/godot/blob/master/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs#L152-L178

@beicause
Copy link
Copy Markdown
Contributor Author

beicause commented Jun 9, 2025

Could this be introduced in 4.5?

@raulsntos
Copy link
Copy Markdown
Member

We could introduce the fixed IntersectsSegment with a different name to avoid breaking compat, and then we can break compat in the new GDExtension-based bindings where we have an upgrade tool that can automatically rename the invocation.

However, maybe it's OK to break compat here if this API wasn't used much with its current signature.

youfch added a commit to youfch/godot that referenced this pull request Mar 26, 2026
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.

The C# public API for the AABB class is not equivalent to its counterpart in GDScript

4 participants