7 releases

0.20.0 Jul 6, 2024
0.20.0-rc.1 Jun 30, 2024
0.19.1 Jun 21, 2024
0.18.1 Jun 21, 2024
0.18.0 Mar 5, 2024

#2442 in Game dev

28 downloads per month
Used in bevy_mod_picking

MIT/Apache

75KB
1.5K SLoC

A raycasting backend for bevy_mod_picking that uses xpbd for raycasting.

Usage

Pointers will automatically shoot rays into the xpbd scene and pick entities.

To ignore an entity, you can add Pickable::IGNORE to it, and it will be ignored during raycasting.

For fine-grained control, see the XpbdBackendSettings::require_markers setting.

Limitations

Because raycasting is expensive, only the closest intersection will be reported. This means that unlike some UI, you cannot hover multiple xpbd objects with a single pointer by configuring the Pickable component to not block lower elements but still emit events. As mentioned above, all that is supported is completely ignoring an entity with Pickable::IGNORE.

This is probably not a meaningful limitation, as the feature is usually only used in UI where you might want a pointer to be able to pick multiple elements that are on top of each other. If are trying to build a UI out of xpbd entities, beware, I suppose.

Dependencies

~37–73MB
~1.5M SLoC