bevy_mod_picking
bevy_mod_picking copied to clipboard
Support `bevy_xpbd` as a backend
It would be nice to support bevy_xpbd as a backend.
I am currently implementing the xpbd backend and it is working so far (https://github.com/Affinator/bevy_mod_picking/tree/xpbd). But I have one question:
The SpatialQueryFilter of xpbd raycasts does not support predicates like rapier. Therefore it is more expensive to filter the entities regarding having a component like Pickable::IGNORE or a marker component.
Instead of only calculating the closest hit, I would need to get all hits and filter them accordingly to the different conditions.
@aevyrie I assume to be consistent we should take this performance hit until the needed functionality is implemented in xpbd? What would be the correct approach to be in line with the rest of the crate?
I just send a pull request to bevy_xpbd (https://github.com/Jondolf/bevy_xpbd/pull/297) to implement a ray cast with a predicate, which would close the functionality gap to bevy_rapier. If it is accepted I will update my fork and send a pull request to implement a xpbd backend.
Edit: My PR has now been merged. I will create a PR for my xpbd backend soon.