Hydros Module Reference
Module defined in `lua/vehicle/hydros.lua`. This module simulates hydraulic actuators (hydros) and torsion hydros, primarily used for steering and complex animated parts. It also handles Force Feedbac
Module defined in lua/vehicle/hydros.lua. This module simulates hydraulic actuators (hydros) and torsion hydros, primarily used for steering and complex animated parts. It also handles Force Feedback (FFB) calculation, soft-lock limits, and gamepad vibrations.
See Also
- Input: For steering input sources.
- Controller/Hydraulics: Logic for complex hydraulic systems.
Force Feedback (FFB) State
Live telemetry and configuration for hardware feedback.
| Variable | Type | Description |
|---|---|---|
enableFFB | boolean | If false, skips sending FFB requests to hardware. |
enableVibration | boolean | Toggles gamepad vibration logic. |
forceAtWheelNorm | number | Real torque measured at the steering rack (0-1). |
forceAtDriverNorm | number | Normalized force sent to the driver (0-1). |
curForceLimitNorm | number | Current safety limit for FFB spikes (0-1). |
wheelFFBForceLimit | number | Maximum steady force limit (default: 10). |
State Fields - Actuators
| Variable | Description |
|---|---|
hydros, torsionHydros | Active JBeam data tables for hydraulic actuators. Properties: Includes state (0-1), cmd (target), and bcid (associated beam/torsion CID). |
Public API
| Function | Signature | Description |
|---|---|---|
hydros.onFFBConfigChanged | (config) | Callback triggered when FFB bindings or settings are changed. Re-initializes heuristics for update frequency and response curves. |
hydros.sendRPMLeds | (current, firstLed, redline) | Sends RPM data to hardware peripherals (steering wheels with LEDs). |
hydros.setExternalForce | (force) | Injects an external force into the FFB calculation. Useful for custom physics extensions. |
hydros.enableVirtualWheel | (enabled, angleFun, sendFun) | Toggles the virtual steering wheel simulation (used for mouse steering or non-FFB hardware). |
hydros.sendHydroStateToGUI | () | Triggers the HydrosUpdate UI event with current actuator states. |
hydros.init | () / reset() | Module bootstrapping. Identifies steering hydros, sets up FFB smoothers, and clears caches. |
hydros.update | (dt) | High-frequency update (2000Hz). Calculates FFB torque, handles torsion hydro movement, and manages the soft-lock steering stops. |
hydros.updateGFX | (dt) | Maps inputs to hydro targets, calculates FFB safety limits, and runs vibration logic for gamepads. |
hydros.destroy | () | Final cleanup. Turns off FFB hardware and clears SFX sources. |
module.setWheelSlipForceMultiplier | (multiplier) | Sets the wheel slip force multiplier. |
module.setJerkForceMultiplier | (multiplier) | Sets the jerk force multiplier. |
module.setWheelSlipMin | (min) | Sets the wheel slip min. |
module.setJerkMin | (min) | Sets the jerk min. Returns M. |
module.getFFBConfig | () | Returns the f f b config. Returns table. |
module.setFFBConfig | (ffbParams) | Sets the f f b config. |
module.isPhysicsStepUsed | () | Checks if physics step used. Returns M.update == update. |
HTML Texture Module Reference
Module defined in `lua/vehicle/htmlTexture.lua`. Manages HTML-based textures rendered onto vehicle surfaces, used for digital dashboards, infotainment screens, and other in-vehicle displays powered by embedded web views.
Input Module Reference
Module defined in `lua/vehicle/input.lua`. This module processes raw user inputs from various sources (keyboard, gamepad, steering wheel, AI), applies temporal smoothing and driving assistants, and br