From b7661e1a0a45bcda51bbfa0d68f4f100f5a7c475 Mon Sep 17 00:00:00 2001 From: awsms <48278661+awsms@users.noreply.github.com> Date: Thu, 1 Oct 2026 07:42:51 +0200 Subject: [PATCH] Match IW4x controller turn acceleration The turn-speed limit scaled with sensitivity while acceleration scaled with FOV. Increasing sensitivity therefore lengthened the ramp, unlike the local IW4x controller implementation. Scale acceleration by the base controller sensitivity multiplier instead of FOV, matching IW4x's default 1200 degrees/s squared times sensitivity. Keep ADS and FOV scaling on the requested turn speed. Ramp the absolute speed before applying the requested direction, matching IW4x's integrator when the stick reverses direction during a ramp. Deceleration and disabled acceleration remain immediate. Validation: the play build, targeted rustfmt and diff checks passed. A temporary reference probe passed 216 combinations of sensitivity, FOV, ADS blend, frame rate and acceleration mode, including direction reversals, release and disabling acceleration. No game relaunch or physical-controller feel test was performed. --- crates/net/src/client/pad_aim.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/crates/net/src/client/pad_aim.rs b/crates/net/src/client/pad_aim.rs index ae5acbd..9ee3e61 100644 --- a/crates/net/src/client/pad_aim.rs +++ b/crates/net/src/client/pad_aim.rs @@ -171,16 +171,11 @@ pub fn pad_look_frame( let wanted = [-input.pad_look[1] * max_pitch, -input.pad_look[0] * max_yaw]; for (rate, goal) in input.pad_turn_rate.iter_mut().zip(wanted) { - if input.pad_acceleration - && ((goal.abs() > rate.abs() && goal.signum() == rate.signum()) - || (*rate == 0.0 && goal != 0.0)) - { - let step = TURN_ACCEL * zoom * dt; - *rate = if goal > *rate { - (*rate + step).min(goal) - } else { - (*rate - step).max(goal) - }; + if input.pad_acceleration && goal.abs() > rate.abs() { + // IW4x ramps speed magnitude, then applies the requested direction. + // Acceleration follows base sensitivity, independently of FOV and ADS. + let step = TURN_ACCEL * input.pad_sensitivity * dt; + *rate = (rate.abs() + step).min(goal.abs()) * goal.signum(); } else { *rate = goal; }