From 1112e2a03a49c14f82ea9f4c2811802bdc6212a4 Mon Sep 17 00:00:00 2001 From: yuni Date: Sat, 5 Oct 2024 02:51:42 +0200 Subject: [PATCH] attempt to fix "Error: The vector given to Dir3::new_unchecked is not normalized" fixes #24 --- src/actor.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/actor.rs b/src/actor.rs index 725389b..781ac28 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -721,11 +721,12 @@ fn handle_wants_lookat( } else { continue; }; - let up = if trans.translation.length_squared() > 1e-6 { - trans.up() - } else { - Dir3::Y - }; + //let up = if trans.translation.length_squared() > 1e-6 { + // trans.up() + //} else { + // Dir3::Y + //}; + let up = Dir3::Y; // TODO: the above code seems to be buggy, this is a workaround rot.0 = look_at_quat(**pos, target_pos, up.as_dvec3()); } }