Description
Merging #15320 leaves behind a couple of gaps that can be easily filled in a follow-up PR(s).
Implement WorldQuery
for RenderEntity
and MainEntity
When querying &RenderEntity
currently from within the main world (or Extract
systems in the render world), you constantly have to call .id()
on every thing you query, because RenderEntity
is a component that contains an entity. This indirection is annoying and makes the migration to 0.15 more cumbersome (more line changes), so we can implement a custom WorldQuery
so that this happens automatically (think of querying Entity
).
The same is true for MainEntity
.
Using required components
There are a couple of places, mainly in bevy_render/src/extract_component.rs
where SyncToRenderWorld
is automatically added to certain components. This is currently done with observers, but it's much better to do this with required components. This is being tackled in #15582.
Deprecating get_or_spawn
get_or_spawn
Is quite often used in extraction systems, given how things used to work. But with a retained rendering world, the entity should always already exist, so just get
should suffice.