Skip to content

Commit fc24bc6

Browse files
committed
scene_viewer: Use get_single_mut as there should be exactly one CameraController
1 parent 28ae21e commit fc24bc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/tools/scene_viewer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,15 @@ fn camera_controller(
342342
mouse_delta += mouse_event.delta;
343343
}
344344

345-
for (mut transform, mut options) in query.iter_mut() {
345+
if let Ok((mut transform, mut options)) = query.get_single_mut() {
346346
if !options.initialized {
347347
let (_roll, yaw, pitch) = transform.rotation.to_euler(EulerRot::ZYX);
348348
options.yaw = yaw;
349349
options.pitch = pitch;
350350
options.initialized = true;
351351
}
352352
if !options.enabled {
353-
continue;
353+
return;
354354
}
355355

356356
// Handle key input

0 commit comments

Comments
 (0)