Make glider orientation stick to look dir even without input

This commit is contained in:
Ludvig Böklin 2021-04-25 14:56:04 +02:00
parent bf7f9b28fa
commit c0f43aafb1

View File

@ -65,7 +65,7 @@ impl CharacterBehavior for Data {
let ori = Some(data.inputs.move_dir)
.filter(|mv_dir| !mv_dir.is_approx_zero())
.or_else(|| self.ori.look_dir().xy().try_normalized())
.or_else(|| data.inputs.look_dir.xy().try_normalized())
.map(|mv_dir| Vec3::new(mv_dir.x, mv_dir.y, (data.inputs.look_dir.z + 0.3) * 2.0))
.and_then(Dir::from_unnormalized)
.and_then(|tgt_dir| {