Skip to content

Commit

Permalink
Detect camera projection changes (#2015)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRawMeatball committed Apr 27, 2021
1 parent 3f4d50b commit c32c37d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/bevy_render/src/camera/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ pub fn camera_system<T: CameraProjection + Component>(
}
for (entity, mut camera, mut camera_projection) in queries.q0_mut().iter_mut() {
if let Some(window) = windows.get(camera.window) {
if changed_window_ids.contains(&window.id()) || added_cameras.contains(&entity) {
if changed_window_ids.contains(&window.id())
|| added_cameras.contains(&entity)
|| camera_projection.is_changed()
{
camera_projection.update(window.width(), window.height());
camera.projection_matrix = camera_projection.get_projection_matrix();
camera.depth_calculation = camera_projection.depth_calculation();
Expand Down

0 comments on commit c32c37d

Please sign in to comment.