Class VehicleInputProviderBase
Abstract base class for all vehicle input providers, defining the interface for vehicle control inputs such as throttle, steering, braking, and auxiliary functions.
Inheritance
Inherited Members
Namespace: NWH.VehiclePhysics2.Input
Assembly: NWH.VehiclePhysics2.dll
Syntax
public class VehicleInputProviderBase : InputProvider
Remarks
VehicleInputProviderBase establishes the standard interface that all vehicle input sources must implement. Derived classes provide specific implementations for different input systems like keyboard/mouse, gamepad, mobile touch, or custom input solutions.
Input methods defined include: - Primary controls: Throttle, Brakes, Steering, Handbrake, Clutch - Transmission controls: Gear shifting (up/down, specific gears) - Vehicle functions: Horn, lights (headlights, brake, turn signals, hazards) - Engine controls: Start/stop, ignition - Camera and UI controls: Camera switching, menu navigation
All input values are typically returned as normalized floats in the range [0,1] for analog inputs or as boolean states converted to 0/1 for digital inputs. The VehicleInputHandler processes these raw values and applies any necessary smoothing or modification before passing them to vehicle systems.
Methods
Boost()
Returns true while the boost button is held down. Only functional when NOSModule or similar boost module is present and enabled. Provides temporary power increase when active.
Declaration
public virtual bool Boost()
Returns
| Type | Description |
|---|---|
| bool | True while button is pressed. |
Brakes()
Returns the current brake input value normalized to [0, 1] range. 0 means no braking, 1 means full braking force.
Declaration
public virtual float Brakes()
Returns
| Type | Description |
|---|---|
| float | Brake input value between 0 and 1. |
Clutch()
Returns the current clutch input value normalized to [0, 1] range. 0 means clutch fully engaged (pedal released), 1 means clutch fully disengaged (pedal pressed). Used with manual transmissions for gear changes and preventing engine stalls.
Declaration
public virtual float Clutch()
Returns
| Type | Description |
|---|---|
| float | Clutch input value between 0 and 1. |
CruiseControl()
Returns true when the cruise control toggle button is pressed this frame. Only functional when CruiseControlModule is present and enabled. Maintains constant vehicle speed without throttle input.
Declaration
public virtual bool CruiseControl()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
EngineStartStop()
Returns true when the engine start/stop button is pressed this frame. Toggles the engine on/off state.
Declaration
public virtual bool EngineStartStop()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
ExtraLights()
Returns true when the extra lights toggle button is pressed this frame. Controls auxiliary lights such as fog lights, work lights, or off-road lights.
Declaration
public virtual bool ExtraLights()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
FlipOver()
Returns true when the flip-over button is pressed this frame. Only functional when FlipOverModule is present and enabled, used to right overturned vehicles.
Declaration
public virtual bool FlipOver()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
Handbrake()
Returns the current handbrake input value normalized to [0, 1] range. 0 means released, 1 means fully engaged. Typically used for drifting or parking.
Declaration
public virtual float Handbrake()
Returns
| Type | Description |
|---|---|
| float | Handbrake input value between 0 and 1. |
HazardLights()
Returns true when the hazard lights toggle button is pressed this frame. Activates all turn signals simultaneously for emergency warning.
Declaration
public virtual bool HazardLights()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
HighBeamLights()
Returns true when the high beam headlights toggle button is pressed this frame. Switches headlights between low beam and high beam mode.
Declaration
public virtual bool HighBeamLights()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
Horn()
Returns true while the horn button is held down. Unlike toggle buttons, this is typically held for continuous horn sound.
Declaration
public virtual bool Horn()
Returns
| Type | Description |
|---|---|
| bool | True while button is pressed. |
LeftBlinker()
Returns true when the left turn signal button is pressed this frame. Toggles the left turn indicator on/off.
Declaration
public virtual bool LeftBlinker()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
LowBeamLights()
Returns true when the low beam headlights toggle button is pressed this frame. Turns the main headlights on or off.
Declaration
public virtual bool LowBeamLights()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
RightBlinker()
Returns true when the right turn signal button is pressed this frame. Toggles the right turn indicator on/off.
Declaration
public virtual bool RightBlinker()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
ShiftDown()
Returns true when the sequential shift down button is pressed this frame. Shifts transmission to the next lower gear in sequential mode.
Declaration
public virtual bool ShiftDown()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
ShiftInto()
Returns the directly selected gear index for H-pattern shifters and non-sequential transmissions. Used for manual gear selection where each gear has a dedicated input binding.
Declaration
public virtual int ShiftInto()
Returns
| Type | Description |
|---|---|
| int | Gear index (-1 for reverse, 0 for neutral, positive integers for forward gears), or -999 if no gear is selected. |
ShiftUp()
Returns true when the sequential shift up button is pressed this frame. Shifts transmission to the next higher gear in sequential mode.
Declaration
public virtual bool ShiftUp()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |
Steering()
Returns the current steering input value normalized to [-1, 1] range. -1 means full left, 0 means centered, 1 means full right.
Declaration
public virtual float Steering()
Returns
| Type | Description |
|---|---|
| float | Steering input value between -1 and 1. |
Throttle()
Returns the current throttle input value normalized to [0, 1] range. 0 means no throttle, 1 means full throttle.
Declaration
public virtual float Throttle()
Returns
| Type | Description |
|---|---|
| float | Throttle input value between 0 and 1. |
TrailerAttachDetach()
Returns true when the trailer attach/detach button is pressed this frame. Only functional when TrailerHitchModule is present and enabled on the vehicle.
Declaration
public virtual bool TrailerAttachDetach()
Returns
| Type | Description |
|---|---|
| bool | True if button was pressed this frame. |