13 releases (7 breaking)

0.20.0 Jul 6, 2024
0.19.1 Jun 21, 2024
0.18.0 Mar 5, 2024
0.17.0 Nov 10, 2023
0.2.0 Jul 7, 2023

#2476 in Game dev

Download history 235/week @ 2024-07-04 13/week @ 2024-07-11 3/week @ 2024-07-18 41/week @ 2024-07-25 16/week @ 2024-08-01 8/week @ 2024-08-08 11/week @ 2024-08-15 21/week @ 2024-08-22 90/week @ 2024-08-29 123/week @ 2024-09-05 66/week @ 2024-09-12 67/week @ 2024-09-19 73/week @ 2024-09-26 48/week @ 2024-10-03 139/week @ 2024-10-10 97/week @ 2024-10-17

389 downloads per month
Used in bevy_mod_picking

MIT/Apache

75KB
1.5K SLoC

A raycasting backend for bevy_mod_picking that uses rapier for raycasting.

Usage

If a pointer passes through this camera's render target, it will automatically shoot rays into the rapier scene and will be able to pick things.

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

For fine-grained control, see the RapierBackendSettings::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 rapier 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 rapier entities, beware, I suppose.

Dependencies

~41–79MB
~1.5M SLoC