-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Add information about hit side to Ray3d::intersect_plane #20166
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
base: main
Are you sure you want to change the base?
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
It looks like your PR is a breaking change, but you didn't provide a migration guide. Please review the instructions for writing migration guides, then expand or revise the content in the migration guides directory to reflect your changes. |
Allows to choose which face side of the plane the Ray3d intersects.
36242b7
to
52d50d2
Compare
To me the big question here is if we solidify the fact that a plane has a "front" (the current approach), or if we should be creating a new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'm not a huge fan of putting everything everything into one universal method. Though the code diff is actually nicer than what I expected. (ex: All the backface-relevant data is already computed anyway and the method is already full of branches.) So I'm not against merging this.
Given that the user has to supply an argument (whose documentation explains the details), so they won't be surprised by what the method does.
How about making the function params stay the same but changing the output to |
That would work by me too yeah. |
I like changing the return type! |
Thanks for all the suggestions! I agree that using the return type instead of parameter makes everything cleaner. I've updated I'm wondering if |
Ray3d::intersect_plane
Ray3d::intersect_plane
Objective
Currently,
Ray3d::intersect_plane
always returns intersections on both faces of the plane, including backface hits.This behavior:
Fixes #20152
Solution
HitSide
enum to allow the user to retrieve information about intersected plane side.Ray3d::intersect_plane
fromOption<f32>
toOption<(f32, HitSide)>
.Testing
Added unit tests.
Showcase