Skip to content
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

C#: Sync Plane with Core #71456

Merged
merged 1 commit into from
Jan 16, 2023
Merged

Conversation

raulsntos
Copy link
Member

@raulsntos raulsntos commented Jan 15, 2023

  • Add Plane(Vector3) constructor.
  • Rename IntersectRay to IntersectsRay.
    • It always had the s in Core.
  • Rename IntersectSegment to IntersectsSegment.
    • It always had the s in Core.
  • Replace Center property with GetCenter method.
    • This matches the other C# structs that also implement a GetCenter method (AABB, Rect2, and Rect2i).
    • Also renaming this in Core in a separate PR: Rename center method to get_center in Plane. #71474.
    • Alternatively, since the implementation is cheap enough we could decide to replace all the GetCenter methods with Center properties instead1.

Footnotes

  1. This is not possible in GDScript because it doesn't support readonly properties but in C# we can.

@raulsntos
Copy link
Member Author

Replace Center property with GetCenter method.

@akien-mga Would it be OK to also rename the method in Core, or is it too late? To fix the inconsistency with AABB, Rect2, and Rect2i.

@akien-mga
Copy link
Member

akien-mga commented Jan 15, 2023

Replace Center property with GetCenter method.

@akien-mga Would it be OK to also rename the method in Core, or is it too late? To fix the inconsistency with AABB, Rect2, and Rect2i.

Ah yes, a method named center() is pretty weird. Should definitely get get_center().

@raulsntos raulsntos requested a review from a team as a code owner January 15, 2023 18:46
- Add `Plane(Vector3)` constructor.
- Rename `IntersectRay` to `IntersectsRay`.
- Rename `IntersectSegment` to `IntersectsSegment`.
- Replace `Center` property with `GetCenter` method.
- Add and fix documentation about the _normal_ parameter
to Core and C# documentation.
@akien-mga akien-mga merged commit 88c81bf into godotengine:master Jan 16, 2023
@akien-mga
Copy link
Member

Thanks!

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.

4 participants