bevy/crates
Paweł Grabarz a81fb7aa7e Add a method iter_combinations on query to iterate over combinations of query results (#1763)
Related to [discussion on discord](https://discord.com/channels/691052431525675048/742569353878437978/824731187724681289)

With const generics, it is now possible to write generic iterator over multiple entities at once.

This enables patterns of query iterations like

```rust
for [e1, e2, e3] in query.iter_combinations() {
   // do something with relation of all three entities
}
```

The compiler is able to infer the correct iterator for given size of array, so either of those work
```rust
for [e1, e2] in query.iter_combinations()  { ... }
for [e1, e2, e3] in query.iter_combinations()  { ... }
```

This feature can be very useful for systems like collision detection.

When you ask for permutations of size K of N entities:
- if K == N, you get one result of all entities
- if K < N, you get all possible subsets of N with size K, without repetition
- if K > N, the result set is empty (no permutation of size K exist)

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2021-05-17 23:33:47 +00:00
..
bevy_app Add inline documentation to bevy code (#1404) 2021-05-06 02:26:54 +00:00
bevy_asset fix diagnostic length for asset count (#2165) 2021-05-14 19:31:36 +00:00
bevy_audio Hide re-exported docs (#1985) 2021-04-27 18:29:33 +00:00
bevy_core use bytemuck crate instead of Byteable trait (#2183) 2021-05-17 22:29:10 +00:00
bevy_derive [bevy_derive] Refactor modules for better error message. (#2059) 2021-05-06 23:45:23 +00:00
bevy_diagnostic fix diagnostic length for asset count (#2165) 2021-05-14 19:31:36 +00:00
bevy_dylib Release 0.5.0 (#1835) 2021-04-06 18:48:48 +00:00
bevy_dynamic_plugin Various cleanups (#2046) 2021-05-01 20:07:06 +00:00
bevy_ecs Add a method iter_combinations on query to iterate over combinations of query results (#1763) 2021-05-17 23:33:47 +00:00
bevy_gilrs Release 0.5.0 (#1835) 2021-04-06 18:48:48 +00:00
bevy_gltf Update gltf requirement from 0.15.2 to 0.16.0 (#2196) 2021-05-17 18:44:04 +00:00
bevy_input Hide re-exported docs (#1985) 2021-04-27 18:29:33 +00:00
bevy_internal Hide re-exported docs (#1985) 2021-04-27 18:29:33 +00:00
bevy_log Hide re-exported docs (#1985) 2021-04-27 18:29:33 +00:00
bevy_math use bytemuck crate instead of Byteable trait (#2183) 2021-05-17 22:29:10 +00:00
bevy_pbr Fix PBR regression for unlit materials (#2197) 2021-05-17 22:45:07 +00:00
bevy_reflect revert supporting generics for deriving TypeUuid (#2204) 2021-05-17 20:28:50 +00:00
bevy_render use bytemuck crate instead of Byteable trait (#2183) 2021-05-17 22:29:10 +00:00
bevy_scene Hide re-exported docs (#1985) 2021-04-27 18:29:33 +00:00
bevy_sprite use bytemuck crate instead of Byteable trait (#2183) 2021-05-17 22:29:10 +00:00
bevy_tasks Various cleanups (#2046) 2021-05-01 20:07:06 +00:00
bevy_text Allows a number of clippy lints and fixes 2 (#1999) 2021-05-14 20:37:32 +00:00
bevy_transform Move to smallvec v1.6 (#2074) 2021-05-05 19:14:39 +00:00
bevy_ui Allows a number of clippy lints and fixes 2 (#1999) 2021-05-14 20:37:32 +00:00
bevy_utils EnumVariantMeta derive (#1972) 2021-04-21 23:46:54 +00:00
bevy_wgpu Allows a number of clippy lints and fixes 2 (#1999) 2021-05-14 20:37:32 +00:00
bevy_window Adds an alias mouse position -> cursor position (#2038) 2021-04-28 21:26:47 +00:00
bevy_winit Allows a number of clippy lints and fixes 2 (#1999) 2021-05-14 20:37:32 +00:00