6 releases (breaking)

0.18.0 Mar 5, 2024
0.17.0 Nov 10, 2023
0.16.0 Oct 30, 2023
0.15.0 Aug 21, 2023
0.1.0 May 3, 2023

#2224 in Game dev

Download history 21/week @ 2024-01-05 43/week @ 2024-01-12 13/week @ 2024-01-19 36/week @ 2024-01-26 32/week @ 2024-02-02 34/week @ 2024-02-09 95/week @ 2024-02-16 70/week @ 2024-02-23 204/week @ 2024-03-01 84/week @ 2024-03-08 62/week @ 2024-03-15 53/week @ 2024-03-22 109/week @ 2024-03-29 90/week @ 2024-04-05

318 downloads per month
Used in bevy_mod_picking

MIT/Apache

74KB
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

~43–84MB
~1.5M SLoC