From 3593fcd4d5a6df27189a447b81ff2e964dbeec7a Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Wed, 1 Feb 2023 23:34:27 +0100 Subject: [PATCH] fix panic --- kubi/src/camera/matrices.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubi/src/camera/matrices.rs b/kubi/src/camera/matrices.rs index b2086f6..7537700 100644 --- a/kubi/src/camera/matrices.rs +++ b/kubi/src/camera/matrices.rs @@ -11,7 +11,7 @@ fn update_view_matrix( ) { for (camera, transform) in (&mut vm_camera, v_transform.inserted_or_modified()).iter() { let (_, rotation, translation) = transform.0.to_scale_rotation_translation(); - let direction = rotation * Vec3::NEG_Z; + let direction = (rotation * Vec3::NEG_Z).normalize(); camera.view_matrix = Mat4::look_to_rh(translation, direction, camera.up); } }