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 {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
let up = if trans.translation.length_squared() > 1e-6 {
|
//let up = if trans.translation.length_squared() > 1e-6 {
|
||||||
trans.up()
|
// trans.up()
|
||||||
} else {
|
//} else {
|
||||||
Dir3::Y
|
// 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());
|
rot.0 = look_at_quat(**pos, target_pos, up.as_dvec3());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue