smoother camera movement

This commit is contained in:
yuni 2024-04-08 02:19:33 +02:00
parent 0e5711f229
commit 58bd34cfd0

View file

@ -296,7 +296,7 @@ pub fn apply_input_to_player(
} }
let angular_slowdown: f64 = (2.0 - engine.reaction_wheels.powf(0.01).clamp(1.001, 1.1)) as f64; let angular_slowdown: f64 = (2.0 - engine.reaction_wheels.powf(0.01).clamp(1.001, 1.1)) as f64;
if pitch_yaw_rot.length_squared() > 0.0001 { if pitch_yaw_rot.length_squared() > 1.0e-18 {
play_reactionwheel_sound = true; play_reactionwheel_sound = true;
pitch_yaw_rot *= settings.mouse_sensitivity * sensitivity_factor * engine.reaction_wheels; pitch_yaw_rot *= settings.mouse_sensitivity * sensitivity_factor * engine.reaction_wheels;
torque.apply_torque(DVec3::from( torque.apply_torque(DVec3::from(
@ -307,7 +307,7 @@ pub fn apply_input_to_player(
angularvelocity.0 *= angular_slowdown.clamp(0.97, 1.0) as f64; angularvelocity.0 *= angular_slowdown.clamp(0.97, 1.0) as f64;
} }
else { else {
if angularvelocity.length_squared() > 0.001 { if angularvelocity.length_squared() > 1.0e-18 {
angularvelocity.0 *= angular_slowdown; angularvelocity.0 *= angular_slowdown;
} }
else { else {