attempt to fix "Error: The vector given to Dir3::new_unchecked is not normalized"
fixes #24
This commit is contained in:
parent
8e5b17fcfa
commit
1112e2a03a
11
src/actor.rs
11
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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue