NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Class ABSModule

    Anti-lock braking. Reduces brake torque per wheel once longitudinal slip passes the threshold, over a band of slipRange.

    Inheritance
    object
    VehicleComponent
    ABSModule
    Inherited Members
    VehicleComponent.state
    VehicleComponent.vehicleController
    VehicleComponent.IsActive
    VehicleComponent.VC_Initialize(VehicleController)
    VehicleComponent.VC_Initialize()
    VehicleComponent.VC_SetDefaults()
    VehicleComponent.VC_LoadStateFromStateSettings()
    VehicleComponent.VC_Update(float)
    VehicleComponent.VC_DrawGizmos()
    VehicleComponent.VC_Validate(VehicleController)
    VehicleComponent.UpdateLOD()
    VehicleComponent.ToggleState()
    Namespace: NWH.VehiclePhysics2.Modules.ABS
    Assembly: NWH.VehiclePhysics2.dll
    Syntax
    [Serializable]
    public class ABSModule : VehicleComponent
    Remarks

    Off below lowerSpeedThreshold and while the handbrake is applied. Not gated by engine state or the rev limiter, so it stays active under two-foot braking.

    Fields

    absActivated

    Unity event triggered when ABS starts modulating brake torque.

    Declaration
    [Tooltip("Called when ABS becomes active.")]
    public UnityEvent absActivated
    Field Value
    Type Description
    UnityEvent
    Remarks

    Rising edge only, so it will not stack one call per physics frame. Poll active for the continuous state.

    active

    True while ABS is reducing brake torque on any wheel. Read-only at runtime.

    Declaration
    [Tooltip("Is ABS currently active?")]
    public bool active
    Field Value
    Type Description
    bool

    lowerSpeedThreshold

    Minimum vehicle speed in m/s for ABS to engage. Below it ABS is off, so low-speed maneuvering and parking are unaffected.

    Declaration
    [Tooltip("ABS will not work below this speed.")]
    public float lowerSpeedThreshold
    Field Value
    Type Description
    float

    slipRange

    Slip band over which brake torque is progressively reduced. Larger means less sensitive ABS.

    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

    The band starts at the per-wheel capped threshold, so the operating range is that capped value to (capped value + slipRange). See slipThreshold.

    slipThreshold

    Longitudinal slip at which ABS starts to intervene.

    Declaration
    [Range(0, 1)]
    [Tooltip("Longitudinal slip required for ABS to trigger. Capped per wheel at 0.9x the surface's peak slip, so higher values have no effect on high-grip surfaces.")]
    public float slipThreshold
    Field Value
    Type Description
    float
    Remarks

    An upper bound, not the exact trigger point. Each wheel uses min(slipThreshold, 0.9 * its active FrictionPreset's peakSlip), so on the shipped road presets, which peak near 0.15-0.18 slip, anything authored much above ~0.14 behaves the same. Values below the cap pass through unchanged, and loose surfaces peak later so they leave the authored value intact.

    Methods

    VC_Disable(bool)

    Disables the component and stops its updates.

    Declaration
    public override bool VC_Disable(bool calledByParent)
    Parameters
    Type Name Description
    bool calledByParent

    True when called by a parent ManagerVehicleComponent fan-out or the VehicleController enable/disable loop. The LOD system passes false.

    Returns
    Type Description
    bool

    True if successfully disabled, false otherwise

    Overrides
    VehicleComponent.VC_Disable(bool)
    Remarks

    Refused on a component that is not initialized. Records whether the call came from a parent, which is what VC_Enable checks before a bulk re-enable.

    VC_Enable(bool)

    Enables the component and starts its updates.

    Declaration
    public override bool VC_Enable(bool calledByParent)
    Parameters
    Type Name Description
    bool calledByParent

    True when called by a parent ManagerVehicleComponent fan-out or the VehicleController enable/disable loop. The LOD system passes false.

    Returns
    Type Description
    bool

    True if successfully enabled, false otherwise

    Overrides
    VehicleComponent.VC_Enable(bool)
    Remarks

    Initializes the component first if it is not initialized yet. A parent bulk enable is refused unless the last disable also came from a parent, so it cannot resurrect a component turned off by LOD, by a script, or disabled in StateSettings.

    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
    Overrides
    VehicleComponent.VC_FixedUpdate(float)

    See Also

    ModuleManager
    VehicleController
    TCSModule
    ESCModule
    WheelComponent
    Brakes
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics