fix crash in handle_wants_lookat/trans.up() when trans.translation is 0
This commit is contained in:
parent
cb34bba7d8
commit
cdc1dcec36
|
@ -624,7 +624,12 @@ fn handle_wants_lookat(
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
rot.0 = look_at_quat(**pos, target_pos, trans.up().as_dvec3());
|
let up = if trans.translation.length_squared() > 1e-6 {
|
||||||
|
trans.up()
|
||||||
|
} else {
|
||||||
|
Dir3::Y
|
||||||
|
};
|
||||||
|
rot.0 = look_at_quat(**pos, target_pos, up.as_dvec3());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue