bevy_xpbd icon indicating copy to clipboard operation
bevy_xpbd copied to clipboard

Splitting spatial query out?

Open waywardmonkeys opened this issue 2 years ago • 2 comments
trafficstars

I am working on something with bevy that is not a game. We have no real need for physics, but we do need spatial query. Would there be interest and would it make sense to possibly split this crate up some?

waywardmonkeys avatar Nov 03 '23 15:11 waywardmonkeys

You should already be able to use SpatialQueryPlugin on its own without any of the actual physics plugins (broad phase, narrow phase, integrator, solver etc.), but I agree that it'd be nice to move spatial queries into a separate crate that could be used without bevy_xpbd. The current spatial query logic depends on colliders though, so we'd need to move collision detection into a separate crate as well, or have collision detection + spatial queries in the same crate.

For now, I probably won't be committing resources to doing this for the current Parry-based spatial queries. However, I'm planning on trying to make a custom Glam-based collision detection library that could be used instead of Parry, which would get rid of the Nalgebra types while also allowing us to make things even more Bevy-native, maybe even using Bevy's primitive shapes for some collider shapes if we implemented the primitive shapes RFC. It would probably be a general purpose collision detection + spatial query crate, but with a bevy feature that would provide things like the NarrowPhasePlugin, SpatialQueryPlugin, RayCaster component and other Bevy-specific features and ergonomics.

Jondolf avatar Nov 03 '23 18:11 Jondolf

This all sounds good. I may be able to help at some point in the future once things are ready for a split.

waywardmonkeys avatar Nov 06 '23 15:11 waywardmonkeys