More sensible turn rate in air

This commit is contained in:
Joshua Barretto 2022-01-16 19:43:13 +00:00
parent 20509a7818
commit 7f3d9898db
2 changed files with 8 additions and 2 deletions

View File

@ -421,7 +421,14 @@ pub fn handle_orientation(
// Angle factor used to keep turning rate approximately constant by
// counteracting slerp turning more with a larger angle
let angle_factor = 2.0 / (1.0 - update.ori.dot(target_ori)).sqrt();
data.body.base_ori_rate() * efficiency * angle_factor
data.body.base_ori_rate()
* efficiency
* angle_factor
* if data.physics.on_ground.is_some() {
1.0
} else {
0.2
}
};
update.ori = update
.ori

View File

@ -43,7 +43,6 @@ impl Animation for JumpAnimation {
} else {
x_tilt
};
println!("{} days", x_tilt);
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation = Quaternion::rotation_x(x_tilt * -0.5);