From 6c5bf016d4e74d4b53812585952b72905f4c3327 Mon Sep 17 00:00:00 2001 From: mo8it Date: Wed, 6 Mar 2024 17:02:12 +0100 Subject: [PATCH] Normalize the rotation before syncing --- Cargo.toml | 2 +- src/camera.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 00606b69e..74918e6f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ serialize = ["bevy/serialize", "trackball/serde"] c11-orbit = ["trackball/cc"] [dependencies] -bevy = { version = "0.13.0", default-features = false, features = ["bevy_render"] } +bevy = { version = "0.13.0", default-features = false, features = ["bevy_render", "debug_glam_assert"] } bevy_egui = { version = "0.25.0", default-features = false, features = ["render"], optional = true } trackball = { version = "0.12.0", features = ["glam"] } diff --git a/src/camera.rs b/src/camera.rs index 40658ca5a..dcf18e069 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -138,7 +138,7 @@ pub fn trackball_camera( .unwrap_or(trackball.frame); let view = trackball.old_frame.view(); transform.translation = view.translation.into(); - transform.rotation = view.rotation.into(); + transform.rotation = view.rotation.normalize().into(); } let new_scope = trackball.scope != trackball.old_scope; let new_max = max != trackball.old_max;