Class TCSModule
Traction control. Pushes an enable flag and a per-wheel slip threshold to each WheelController; the friction solver holds the wheel at that threshold and recomputes tire forces to match.
Inherited Members
Namespace: NWH.VehiclePhysics2.Modules.TCS
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class TCSModule : VehicleComponent
Remarks
The clamp runs per substep after the friction solve, so intervention shows up as wheel speed held near the threshold, not as an engine or throttle cut. Engine output is untouched. Off below lowerSpeedThreshold and during a gear change.
Fields
active
True while any driven wheel is being slip-limited. Read-only at runtime.
Declaration
[Tooltip("Is TCS currently active?")]
public bool active
Field Value
| Type | Description |
|---|---|
| bool |
lowSpeedSlipThreshold
Dry-asphalt-reference slip threshold at low speeds (more permissive than slipThreshold).
Declaration
[Range(0, 1)]
[Tooltip("Dry-asphalt slip threshold at low speeds. Scaled to the active friction curve and interpolated to slipThreshold.")]
public float lowSpeedSlipThreshold
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Differential action in slow turns spreads wheel speeds and reads as slip, so the band is widened down low. The effective threshold interpolates from here to slipThreshold as speed rises from lowerSpeedThreshold to upperSpeedThreshold.
lowerSpeedThreshold
Minimum vehicle speed in m/s for TCS to engage. Below it TCS is off, so pulling away on slopes or rough terrain is unaffected.
Declaration
[Tooltip("Speed under which TCS will not work.")]
public float lowerSpeedThreshold
Field Value
| Type | Description |
|---|---|
| float |
onTCSActive
Unity event triggered when TCS starts limiting wheel slip.
Declaration
[Tooltip("Called when TCS becomes active.")]
public UnityEvent onTCSActive
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.
slipThreshold
Dry-asphalt-reference longitudinal slip threshold used by TCS.
Declaration
[Range(0, 1)]
[Tooltip("Dry-asphalt slip threshold for TCS. Scaled to each wheel's active friction-curve peak.")]
public float slipThreshold
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Authored against the dry-asphalt tire and scaled at runtime by each wheel's active friction-curve peak, which keeps the same relative intervention point on wet and loose surfaces. Usually set lower than the ABS slip threshold, since acceleration slip peaks earlier than braking slip.
upperSpeedThreshold
Speed (m/s) at which TCS transitions to full intensity.
Declaration
[Tooltip("Speed at which TCS transitions to full intensity.")]
public float upperSpeedThreshold
Field Value
| Type | Description |
|---|---|
| float |
Remarks
Above this speed the threshold is slipThreshold; below it, down to lowerSpeedThreshold, it interpolates from lowSpeedSlipThreshold.
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
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
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 TCS enable/threshold to each driven wheel; the friction solver clamps wheel speed to that threshold after solving.
Declaration
public override void VC_FixedUpdate(float DeltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| float | DeltaTime |