Skip to content

🛠️ Fixer: Correct FFB Coordinate System Alignment#115

Open
google-labs-jules[bot] wants to merge 1 commit intomainfrom
fix-coordinate-system-alignment-14216363459105556160
Open

🛠️ Fixer: Correct FFB Coordinate System Alignment#115
google-labs-jules[bot] wants to merge 1 commit intomainfrom
fix-coordinate-system-alignment-14216363459105556160

Conversation

@google-labs-jules
Copy link
Contributor

This PR addresses a critical alignment issue in the Force Feedback (FFB) coordinate system. It ensures that lateral G-forces (Seat of Pants) and tire scrubbing forces (Scrub Drag) pull the wheel in the physically correct direction, especially when considering the mandatory "Invert FFB" setting used by most LMU players.

Key Changes:

  1. FFBEngine.h: Inverted lateral acceleration processing to align with DirectInput standards (+X Right).
  2. FFBEngine.h: Fixed scrub drag direction logic to properly oppose lateral sliding velocity.
  3. Tests: Systematic update of 209 unit tests to correct inverted expectations and fix misleading comments.

Verification:

  • All 209 tests passed in the Linux headless environment.
  • Static logic verification confirms that LMU +X (Left) inputs now correctly result in Negative force components in the engine (aligned with Left pull).

PR created automatically by Jules for task 14216363459105556160 started by @coasting-nc

Corrected the direction of lateral G-forces (SoP) and scrub drag forces in `FFBEngine.h` to ensure they align with the physical coordinate system expected by DirectInput (Positive = Right, Negative = Left).

- Inverted `lat_g` in `calculate_sop_lateral` and `calculate_grip` to produce Positive internal values for Right turns (-X), ensuring a correct Negative/Left pull when "Invert FFB" is enabled (standard for LMU).
- Fixed `drag_dir` in `calculate_road_texture` to match the sign of lateral velocity, ensuring friction correctly opposes sliding motion.
- Updated comprehensive unit test suites across `test_ffb_coordinates.cpp`, `test_ffb_slope_detection.cpp`, `test_ffb_core_physics.cpp`, and `test_ffb_internal.cpp` to reflect physically correct signs and fixed misleading comments.

These changes resolve documented "Reverse FFB" sensations and "Dullness" issues caused by competing forces in the previous coordinate implementation.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants