Class ABSModule
Anti-lock Braking System (ABS) module for NWH Vehicle Physics 2.
Inherited Members
Namespace: NWH.VehiclePhysics2.Modules.ABS
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class ABSModule : VehicleComponent
Remarks
ABS prevents wheels from locking up during braking by modulating brake torque when longitudinal slip exceeds a threshold. This maintains steering control and reduces stopping distance on most surfaces.
The module monitors wheel slip continuously and reduces brake torque proportionally when slip enters the defined range. It operates independently on each wheel, allowing for optimal braking performance across different surface conditions.
Key behaviors: - Automatically disables below the speed threshold to allow for controlled low-speed maneuvering - Does not interfere with handbrake operation for drifting and parking - Deactivates during rev limiter engagement to prevent conflicts - Works in conjunction with other brake torque modifiers in the vehicle
For optimal performance, tune the slip threshold and range based on your tire friction curves. Lower values provide earlier intervention but may reduce maximum braking force. Higher values allow more aggressive braking but risk wheel lockup.
Fields
absActivated
Unity event triggered each physics frame while ABS is actively modulating brake torque.
Declaration
[Tooltip("Called each frame while ABS is a active.")]
public UnityEvent absActivated
Field Value
| Type | Description |
|---|---|
| UnityEvent |
Remarks
Use this event to trigger visual or audio feedback like dashboard warning lights or ABS pump sounds. The event fires continuously while ABS is engaged, not just on initial activation.
active
Indicates whether ABS is currently modulating brake torque.
Declaration
[Tooltip("Is ABS currently active?")]
public bool active
Field Value
| Type | Description |
|---|---|
| bool |
Remarks
Read-only at runtime. True when ABS is actively reducing brake torque on any wheel. Use this for UI indicators or to check ABS engagement state.
lowerSpeedThreshold
Minimum vehicle speed (m/s) required for ABS to engage.
Declaration
[Tooltip("ABS will not work below this speed.")]
public float lowerSpeedThreshold
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Below this speed, ABS is disabled to allow for precise low-speed maneuvering and parking. Setting this too low may cause unwanted ABS intervention during slow maneuvers. Setting it too high reduces ABS coverage during emergency braking from moderate speeds.
Typical values: 0.5-2.0 m/s (1.8-7.2 km/h). Default is 1.0 m/s.
slipRange
Slip range over which brake torque is progressively reduced.
Declaration
[Range(0.001, 1)]
[Tooltip("Range in which brake torque will be reduced. Larger value means less sensitive ABS.")]
public float slipRange
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Defines how gradually ABS reduces brake torque once the slip threshold is exceeded. The brake torque reduction is proportional to how far the slip extends into this range.
Lower values (0.05-0.15): Aggressive ABS with rapid brake modulation. More effective on high-grip surfaces. Higher values (0.2-0.4): Gradual ABS response. Better for mixed or low-grip surfaces.
The total operating range is slipThreshold to (slipThreshold + slipRange).
slipThreshold
Longitudinal slip threshold at which ABS begins to intervene.
Declaration
[Range(0, 1)]
[Tooltip("Longitudinal slip required for ABS to trigger.")]
public float slipThreshold
Field Value
| Type | Description |
|---|---|
| float |
Remarks
This value should be set based on your tire's optimal slip range for maximum braking force. Most tires achieve peak longitudinal force at 10-20% slip.
Lower values (0.08-0.12): Early ABS intervention, maintains better steering control but may increase stopping distance. Higher values (0.15-0.25): Allows more aggressive braking before intervention, shorter stopping distance but risk of momentary lockup.
Typical racing ABS: 0.12-0.15 Typical road car ABS: 0.15-0.20
Methods
VC_Disable(bool)
Disables the component and stops updates. Override to add component-specific disable logic.
Declaration
public override bool VC_Disable(bool calledByParent)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | calledByParent | True if called by parent component or LOD system |
Returns
| Type | Description |
|---|---|
| bool | True if successfully disabled, false otherwise |
Overrides
Remarks
Component must be initialized before it can be disabled. Tracks whether disable was called by parent to manage LOD system interaction.
VC_Enable(bool)
Enables the component and starts updates. Override to add component-specific enable logic.
Declaration
public override bool VC_Enable(bool calledByParent)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | calledByParent | True if called by parent component or LOD system |
Returns
| Type | Description |
|---|---|
| bool | True if successfully enabled, false otherwise |
Overrides
Remarks
Will initialize the component if not already initialized. Components disabled by LOD system will track the parent caller to prevent manual enabling while LOD is controlling state.
VC_FixedUpdate(float)
Pushes ABS settings to every wheel; the friction solver does the per-wheel braking.
Declaration
public override void VC_FixedUpdate(float DeltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| float | DeltaTime |