bevy/crates/bevy_render
Rafał Harabień fe7f98f7f0
Fix deactivated camera still being used in render world (#15946)
# Objective

Switch to retained render world causes the extracted cameras in render
world to not be removed until camera in main world is despawned. When
extracting data from main world inactive cameras are skipped. Therefore
camera that was active and became inactive has a retained
`ExtractedCamera` component from previous frames (when it was active)
and is processed the same way as if it were active (there is no `active`
field on `ExtractedCamera`). This breakes switching between cameras in
`render_primitives` example.
Fixes #15822

## Solution

Fix it by removing `ExtractedCamera` and related components from
inactive cameras.
Note that despawning inactive camera seems to be bad option because they
are spawned using `SyncToRenderWorld` component.

## Testing

Switching camera in `render_primitives` example now works correctly.

---------

Co-authored-by: akimakinai <105044389+akimakinai@users.noreply.github.com>
2024-10-19 15:13:14 +00:00
..
macros Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
src Fix deactivated camera still being used in render world (#15946) 2024-10-19 15:13:14 +00:00
Cargo.toml Move ImageLoader and CompressedImageSaver to bevy_image. (#15812) 2024-10-15 02:18:10 +00:00
README.md Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00

Bevy Render

License Crates.io Downloads Docs Discord