bevy/crates/bevy_pbr/src
Nicola Papale 288765930f Rework extract_meshes (#4240)
* Cleanup redundant code
* Use a type alias to make sure the `caster_query` and
  `not_caster_query` really do the same thing and access the same things

**Objective**

Cleanup code that would otherwise be difficult to understand

**Solution**

* `extract_meshes` had two for loops which are functionally identical,
  just copy-pasted code. I extracted the common code between the two
  and put them into an anonymous function.
* I flattened the tuple literal for the bundle batch, it looks much
  less nested and the code is much more readable as a result.
* The parameters of `extract_meshes` were also very daunting, but they
  turned out to be the same query repeated twice. I extracted the query
  into a type alias.

EDIT: I reworked the PR to **not do anything breaking**, and keep the old allocation behavior. Removing the memorized length was clearly a performance loss, so I kept it.
2022-07-04 12:44:23 +00:00
..
render Rework extract_meshes (#4240) 2022-07-04 12:44:23 +00:00
alpha.rs Derive default for enums where possible (#5158) 2022-07-01 03:42:15 +00:00
bundle.rs Better Materials: AsBindGroup trait and derive, simpler Material trait (#5053) 2022-06-30 23:48:46 +00:00
lib.rs Callable PBR functions (#4939) 2022-06-21 20:50:06 +00:00
light.rs Updated glam to 0.21. (#5142) 2022-07-03 19:55:33 +00:00
material.rs Better Materials: AsBindGroup trait and derive, simpler Material trait (#5053) 2022-06-30 23:48:46 +00:00
pbr_material.rs Better Materials: AsBindGroup trait and derive, simpler Material trait (#5053) 2022-06-30 23:48:46 +00:00
wireframe.rs Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00