bevy/crates
Vladyslav Batyrenko 71fccb2897
Improve or-with disjoint checks (#7085)
# Objective

This PR attempts to improve query compatibility checks in scenarios
involving `Or` filters.

Currently, for the following two disjoint queries, Bevy will throw a
panic:

```
fn sys(_: Query<&mut C, Or<(With<A>, With<B>)>>, _: Query<&mut C, (Without<A>, Without<B>)>) {}
``` 

This PR addresses this particular scenario.

## Solution

`FilteredAccess::with` now stores a vector of `AccessFilters`
(representing a pair of `with` and `without` bitsets), where each member
represents an `Or` "variant".
Filters like `(With<A>, Or<(With<B>, Without<C>)>` are expected to be
expanded into `A * B + A * !C`.

When calculating whether queries are compatible, every `AccessFilters`
of a query is tested for incompatibility with every `AccessFilters` of
another query.

---

## Changelog

- Improved system and query data access compatibility checks in
scenarios involving `Or` filters

---------

Co-authored-by: MinerSebas <66798382+MinerSebas@users.noreply.github.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2023-04-17 15:16:58 +00:00
..
bevy_a11y Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_animation Improved AnimationPlugin declaration. (#8361) 2023-04-12 19:27:38 +00:00
bevy_app Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_asset Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_audio Ability to set a Global Volume (#7706) 2023-04-10 14:08:43 +00:00
bevy_core Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_core_pipeline Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_derive Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_diagnostic Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_dylib Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_dynamic_plugin Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_ecs Improve or-with disjoint checks (#7085) 2023-04-17 15:16:58 +00:00
bevy_ecs_compile_fail_tests Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_encase_derive Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_gilrs Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_gizmos Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_gltf Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_hierarchy Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_input Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_internal Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_log Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_macro_utils Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_math Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_mikktspace Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_pbr Fix pbr shader breaking on missing UVs (#8412) 2023-04-17 06:22:34 +00:00
bevy_ptr Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_reflect Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_reflect_compile_fail_tests bevy_reflect: Fix trailing comma breaking derives (#8014) 2023-03-27 21:47:33 +00:00
bevy_render added multi-line string formatting (#8350) 2023-04-13 18:00:17 +00:00
bevy_scene Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_sprite Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_tasks Cleaned up panic messages (#8219) 2023-04-12 18:27:28 +00:00
bevy_text Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_time Add a scope API for world schedules (#8387) 2023-04-16 05:09:33 +00:00
bevy_transform Fix transform propagation of orphaned entities (#7264) 2023-04-09 20:53:33 +00:00
bevy_ui UiRect axes constructor (#7656) 2023-04-13 20:52:21 +00:00
bevy_utils Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_window Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_winit Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00