bevy_mod_picking icon indicating copy to clipboard operation
bevy_mod_picking copied to clipboard

Support `bevy_xpbd` as a backend

Open musjj opened this issue 1 year ago • 2 comments

It would be nice to support bevy_xpbd as a backend.

musjj avatar Dec 01 '23 21:12 musjj

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?

Affinator avatar Jan 11 '24 12:01 Affinator

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.

Affinator avatar Jan 12 '24 21:01 Affinator