Detect camera projection changes (#2015)

This commit is contained in:
TheRawMeatball 2021-04-27 01:11:04 +00:00
parent 3f4d50bab9
commit c32c37d737

View file

@ -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();