attempt to fix "Error: The vector given to Dir3::new_unchecked is not normalized"

fixes #24
This commit is contained in:
yuni 2024-10-05 02:51:42 +02:00
parent 8e5b17fcfa
commit 1112e2a03a

View file

@ -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());
}
}