mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Better orientation in the air
This commit is contained in:
parent
e52250a193
commit
71bf09d3b7
@ -111,8 +111,13 @@ impl<'a> System<'a> for Sys {
|
||||
};
|
||||
|
||||
// Set direction based on move direction when on the ground
|
||||
if Vec2::<f32>::from(move_dir.0).magnitude_squared() > 0.0001 {
|
||||
ori.0 = Lerp::lerp(ori.0, Vec3::from(move_dir.0.normalized()), 4.0 * dt.0);
|
||||
let ori_dir = if a.gliding || a.rolling {
|
||||
Vec2::from(vel.0)
|
||||
} else {
|
||||
move_dir.0
|
||||
};
|
||||
if ori_dir.magnitude_squared() > 0.0001 {
|
||||
ori.0 = Lerp::lerp(ori.0, Vec3::from(ori_dir.normalized()), 4.0 * dt.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user