Manual Gearbox Shift Logic
Shift logic for manual (stick shift) transmissions. Manages clutch engagement, synchromesh simulation, gear grinding detection, and rev-matching. In arcade mode, provides automatic clutch assistance.
Shift logic for manual (stick shift) transmissions. Manages clutch engagement, synchromesh simulation, gear grinding detection, and rev-matching. In arcade mode, provides automatic clutch assistance.
State Fields
| Field | Type | Description |
|---|---|---|
gearboxHandling, timer, timerConstants, inputValues, shiftPreventionData, shiftBehavior, smoothedValues | table | shared controller state. |
currentGearIndex, maxGearIndex, minGearIndex | number | Active gear information. |
throttle, brake, clutchRatio, shiftingAggression | number | processed user inputs. |
isArcadeSwitched, isSportModeActive, isShifting | boolean | logic and shift status flags. |
smoothedAvgAVInput, rpm, idleRPM, maxRPM | number | speed telemetry. |
engineThrottle, engineLoad, engineTorque, flywheelTorque, gearboxTorque | number | powertrain load state. |
ignition, isEngineRunning | boolean | engine state. |
oilTemp, waterTemp, checkEngine | number | thermal state. |
energyStorages | table | fuel sources. |
Public API
| Function | Description |
|---|---|
shiftToGearIndex(index) | Directly attempts to engage a specific gear (H-shifter mode). |
getGearName() | Returns gear index and UI position. |
getState() | Persists the current gear index. |
Hooks
| Hook | Description |
|---|---|
init(jbeamData, sharedFunctionTable) | Initializes clutch rates, launch targets, and rev-match parameters. |
gearboxBehaviorChanged(behavior) | Configures update loops for manual or automated (arcade) clutch usage. |
shiftUpOnDown() | Handlers for sequential-style input events, managing the multi-stage shift state (clutch in, neutral, shift, clutch out). |
See Also
- Vehicle Controller — Parent controller
- Sequential Gearbox — Sequential manual
- H-Pattern Animation — Shifter prop animation
Electric Motor Shift Logic
Shift logic for electric motor drivetrains. Manages single or multi-speed EV transmissions, regenerative braking integration, and one-pedal driving mode. Handles the unique torque characteristics of electric motors.
Sequential Gearbox Shift Logic
Shift logic for sequential manual transmissions. Gear changes are made one step at a time (up or down) via paddle shifters or a sequential lever. Supports flat-shift (upshift without lifting throttle) and auto-blip downshifts.