-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Implement cast_ray_predicate to allow filtering the colliders with a function #297
Conversation
My branch should now pass all workflows (and I updated it to the current state of main). |
Should i squash the commits or is this fine the way it is? |
Sorry for responding so late. I was originally considering a predicate in Note that predicates should already work when using The example is really fun, but it's a bit confusing in that it only colors one box even though the laser/indicator goes through multiple: I think it should either color all of the non-glass boxes it hits (using e.g. No need to squash the commits, I tend to squash merge like Bevy :) |
Hi, PS: My first approach was also to try to add the predicate to SpatialQueryFilter, but that had the exact problem you described. I therefore chose to do it in a separate function. I understand that this is not ideal, but without a major refactoring this seems to be an acceptable solution. |
OK, so the failed lints are from deprecated methods outside my pull request. Should I rebase on a different branch or can this be merged? |
I just pushed a quick fix for it here, it was simply a method that was renamed and deprecated in a dependency. I think everything looks good, so I'll merge this once CI passes :) |
As I was writing a xpbd backend for bevy_mod_picking, I found that a ray cast with a predicate was missing to implement the functionality efficiently.
I was inspired by the predicate from bevy_rapier: https://github.com/dimforge/bevy_rapier/blob/c6bcce4695d596a7a9c8e91748d4dbb3d31f6d13/src/pipeline/query_filter.rs#L12
Objective
Solution