Expand description
A raycasting backend for bevy_mod_picking
that uses Avian
for raycasting.
§Usage
Pointers will automatically shoot rays into the Avian 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 AvianBackendSettings::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 Avian 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 Avian entities, beware, I suppose.
Re-exports§
pub use avian3d;
Modules§
- prelude
- Commonly used imports.
Structs§
- Avian
Backend - Adds the
avian3d
raycasting picking backend to your app. - Avian
Backend Settings - Runtime settings for the
AvianBackend
. - Avian
Pickable - Optional. Marks cameras and target entities that should be used in the avian picking backend.
Only needed if
AvianBackendSettings::require_markers
is set to true.
Functions§
- update_
hits - Raycasts into the scene using
AvianBackendSettings
andPointerLocation
s, then outputsPointerHits
.