Repository navigation
Conversation
…l-dev#963) When a title paused polling the gamepad for over 100 ms (during loading screens or frame hitches), mouse counts accumulated over the entire pause window. In Velocity::update, dt was clamped to 0.1 s before dividing, which artificially multiplied the apparent mouse rate by up to 20x and caused stick deflection to peg at 100%, violently whipping the camera. Compute the velocity rate using the actual elapsed time (with dt.max(0.001) to prevent division by zero). The exponential smoothing factor (1 - exp(-dt / SMOOTHING)) naturally decays without overshooting. Fixes xcl-dev#963. Assisted-by: Antigravity (Gemini 3.8 Flash)
Owner
Author
|
Upstream PR xcl-dev#1066 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a title paused polling the gamepad for over 100 ms (such as during loading screens, level transitions, or hitching), mouse counts continued gathering in
DXandDY. InVelocity::update,dtwas clamped to0.1before dividing (dx as f32 / dt), which artificially multiplied the apparent mouse rate by up to 20x. This caused the stick deflection to peg at 100% and violently whip the camera around upon returning to gameplay.Fixes xcl-dev#963.
What is in it
crates/xcl/src/hle/kbm.rs: compute the mouse velocity rate over the realdt(withdt.max(0.001)to avoid division by zero). The smoothing factor(1 - exp(-dt / SMOOTHING))naturally bounds the exponential decay in[0, 1).crates/xcl/src/hle/kbm.rs: addframe_hitch_does_not_artificially_accelerate_velocityunit test covering 300 ms and 2 s hitch scenarios, asserting that stick deflection remains moderate.Tested
Velocity::updateandstick_from_mouseunder 300 ms and 2 s pauses; confirms deflection stays proportional (< 0.5) instead of pegging at 1.0.Regression run
test-onlylabel or community smoke run.Not tested
AI use
Mirror of xcl-dev#1066 (auto-synced, do not edit).