- Added
avianpicking backend.
- Updated for Bevy
0.14.0.
HighlightPluginSettings::is_enabledmade public.bevy_uinodes with zero sized rects are ignored to fix a false positive.- Fixed touch pointer inputs being missed.
- Created a new
render_to_textureexample to showcase how to render viewport textures that support picking. - Added support for a range of compatible versions of egui and rapier, instead of being tied to a specific version of these crates.
This plugin is now officially planned to be upstreamed into Bevy. This will require the
bevy_eventlistener crate is also upstreamed, and a few critical features added or changed based on
feedback from Bevy's BDFL. Many of the sub-crates in this repo are not appropriate for upstreaming,
and will remain here. This includes things like the egui or rapier backends, or the highlighting
crate.
The intent is to upstream bevy_eventlistener and bevy_picking_core to be included in Bevy
0.14, time permitting.
- The
bevy_uidebug overlay is broken until bevyengine/bevy#12268 is released as part ofbevy 0.13.1.
- Added:
bevy_xpbd_3dpicking backend, available behind the optionalbackend_xpbdfeature.
- Added:
RayMapresource that contains aRayfor every (camera, pointer) pair. This is useful for any users building a raycasting-based picking backend, handling viewports and scale for you. - Changed: rapier and bevy_mod_raycast backends use the
RayMapinstead of constructing their own rays. - Fixed: Ray construction now respects DPI / window scale.
- Added: support for touch inputs across multiple windows.
- Added: support for
bevy_uiUiScale. - Added:
RaycastBackendSettings::raycast_visibilityto support picking hidden meshes. - Changed: simplified debug settings and examples. Debug settings can be changed with the
DebugPickingModeresource.
- Fixed: sprite picking depth is now consistent with other picking backends.
- Fixed: entities with identical depth could be dropped due to the use of a BTreeMap to sort entities by depth. This has been changed to use a sorted Vec, to allow entities with the same depth to coexist.
- Fixed: rapier and bevy_mod_raycast backends use
RenderLayers::defaultwhen a camera is missing them. - Fixed: the bevy ui backend now ignores clipped areas of UI nodes.
- Fixed:
PickingPluginsSettings::enable_inputis now used as a run condition forPickSet::ProcessInput. - Fixed: replaced uses of
.insertwith.try_insert, where they could potentially panic. - Fixed: replace all
.singlecalls with matched.get_singlecalls to avoid crashing in environments where there is no window available.
- Documentation pass over all docs.
- Changed: renamed
Pickable::should_emit_eventstois_hoverableand clarified the docs. - Removed:
PickingPluginsSettings::enable_highlighting, which was nonfunctional. - Changed: renamed
PickingPluginsSettings,HighlightingPluginSettingsfields to be consistent. RenamedSelectionSettingstoSelectionPluginSettings.
- Update for bevy 0.12
- Fixed: rapier and raycast backends were not considering all cases when cameras or entities lacked
the
RenderLayerscomponent. - Fixed: crate would not compile when the bevy ui backend feature was disabled.
- Added: backends now re-export their dependency where applicable.
bevy_picking_raycastre-exportsbevy_mod_raycast, for example. - Added:
Reflectimplementations for all components and resources.
- Faster compile times.
- Sprites now support atlases, scale, rotation, and anchors.
- All
eguiwidgets, including side panels, are now supported. bevy_mod_raycastandbevy_rapierbackends are now even simpler, no longer requiring any marker components to function.- More flexible picking behavior and
bevy_uicompatibility with the updatedPickablecomponent. - Better support for cameras settings such as
is_active,RenderLayers, andshow_ui.
- Changed: Removed dependencies on
bevyand instead depend on bevy subcrates (e.g.bevy_ecs) directly. This reduces total dependency count, but more importantly allows compilation of each picking crate to start beforebevyfinishes. - Changed:
bevy_uihas been removed as a core dependency, and is now completely optional.
- Changed: The plugin no longer respects bevy_ui's
FocusPolicybecause it was not flexible enough. This has been replaced with new fields on thePickablecomponent. You can use this to override the behavior of any entity in picking.- This allows you to decide if that entity will block lower entities (on by default), and if that entity should emit events and be hover-able (on by default).
- To make objects non-pickable, instead of removing the
Pickableentity, use the new const valuePickable::IGNORE.
- Changed: The
PointerInteractioncomponent, which is added to pointers and tracks all entities being interacted with has changed internally from a hashmap of entities and theirInteractionto a sorted list of entities andHitData, sorted by depth. This better reflects how pointer data would be expected to work, and makes it easier to find the topmost entity under each pointer. - Added:
get_nearest_hitmethod added toPointerInteraction - Changed: Moved
PointerInteractionfrom thefocusmodule topointer.
- Fixed: all backends now correctly check if a camera
is_activebefore attempting hit tests. - Changed:
PickLayer, which is used to order hits from backends that targets the same render target, such as multiple render passes on the same window, has been changed from anisizeto anf32. This change was made to supportbevy_ui, which is "special" and can be rendered on any camera via a flag, instead of being rendered with its own camera. Thebevy_uibackend now adds0.5to the camera order of any events emitted, which was not possible with an integer.
- Added: support for sprite scale, rotation, and custom anchors.
- Added: support for sprite atlases.
- Fixed: the backend now checks render layers when filtering entities.
- Changed:
RaycastPickCameraandRaycastPickTargetmarkers components are not longer required. These components have been replaced with a singleRaycastPickablemarker. - Added:
RaycastBackendSettingsresource added to allow toggling the above requirement for markers at runtime. Enable therequire_markersfield to match behavior of the plugin prior to this release.
- Fixed: the backend now checks render layers when filtering entities.
- Changed:
RapierPickCameraandRapierPickTargetmarkers components are not longer required. These components have been replaced with a singleRapierPickablemarker. - Added:
RapierBackendSettingsresource added to allow toggling the above requirement for markers at runtime. Enable therequire_markersfield to match behavior of the plugin prior to this release.
- Fixed: backend not detecting hits over
SidePanels and other widgets. The backend now runs inPostUpdate, which means egui hit tests will be one frame out of date. This is required because users tend to build theireguiUI inUpdate, and egui rebuilds the entire UI from scratch every frame, so the picking backend must be run after users have built their UI. - Fixed: backend not returning hits when egui is using the pointer to resize windows or drag widgets like sliders or windows.
- Fixed: a system order ambiguity meant that sometimes clicks would be applied to
PickSelectionone frame late, and sometimes not. This led to unreliable and sometimes broken behavior, so we fix their ordering to ensurePickSelectionis always updated on the frame the pointer is released. - Fixed: removed unused
PickSet::EventListenersand fixed (upstream) eventlisteners running in theUpdateschedule instead of thePreUpdateschedule. - Fixed:
interaction_should_runupdating the wrongPickingPluginsSettingsfield.
- Update to Bevy 0.11.
- Removed: The
PickingBackendtrait is no longer required and has been removed. - Fixed: bevy_ui backend incorrectly skipping valid UI cameras.
- Changed: The plugin no longer respects bevy_ui's
FocusPolicy. This was proving to cause problems as mod_picking and bevy_ui have some fundamental differences that cannot be reconciled. This has been replaced by added fields on thePickablecomponent. You can use this to override the behavior of any entity in picking. This allows you to decide if that entity will block lower entities (on by default), and if that entity should emit events and be hover-able (on by default).- To make objects non-pickable, instead of removing the
Pickableentity, use the new const valuePickable::IGNORE.
- To make objects non-pickable, instead of removing the
- Changed: The
Pickablecomponent is now optional. Backends can choose to use it for optimization, but should not filter out entities that do not have this component. An example of an optimization would be to early exit and stop raycasting once an entity is hit that blocks the entities below it. - Changed: To fully remove bevy_ui as a dependency and avoid issues similar to the
FocusPolicychange, bevy_mod_picking no longer updates the bevy_uiInteractionstate. This has been replaced with aPickingInteractioncomponent that serves a similar purpose. This component aggregates the picking state of an entity (press, hover, none) across all pointers. - Changed:
PickLayer, used to order data from backends that targets the same render target, such as multiple render passes on the same window, has been changed fom anisizeto anf32. This change was made to support bevy_ui, which is "special" and can be rendered on any camera via a flag, instead of being rendered with its own camera. The bevy_ui backend now sets the order of any events emitted to be the camera order plus 0.5, which was not possible with an integer. - Changed: The
PointerInteractioncomponent, which is added to pointers and tracks all entities being interacted with has changed internally from a hashmap of entities and theirInteractionto a sorted list of entities andHitData, sorted by depth. This better reflects how pointer data would be expected to work, and makes it easier to find the topmost entity under each pointer. - Added:
get_nearest_hitmethod added toPointerInteraction - Changed: Moved
PointerInteractionfrom thefocusmodule topointer. - Added:
split_screenviewport example. - Added:
many_eventsandmany_buttonsstress test examples. - Added: constructors for
HitDataandPointerHits. - Changed: selection only considers clicks with the primary pointer button.