Skip to content

Commit

Permalink
scene_viewer: Use get_single_mut as there should be exactly one Camer…
Browse files Browse the repository at this point in the history
…aController
  • Loading branch information
superdump committed Mar 19, 2022
1 parent 28ae21e commit fc24bc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/tools/scene_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,15 @@ fn camera_controller(
mouse_delta += mouse_event.delta;
}

for (mut transform, mut options) in query.iter_mut() {
if let Ok((mut transform, mut options)) = query.get_single_mut() {
if !options.initialized {
let (_roll, yaw, pitch) = transform.rotation.to_euler(EulerRot::ZYX);
options.yaw = yaw;
options.pitch = pitch;
options.initialized = true;
}
if !options.enabled {
continue;
return;
}

// Handle key input
Expand Down

0 comments on commit fc24bc6

Please sign in to comment.