NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Class SurfaceParticleManager

    Manages surface particle effects for all vehicle wheels, including tire smoke and dust.

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

    SurfaceParticleManager creates and controls particle systems for each wheel, generating smoke during tire slippage and dust when rolling over loose surfaces. Vehicle-specific coefficients allow tuning particle behavior across all wheels, while per-surface settings in SurfacePresets control individual surface characteristics like dust color and emission rates.

    Fields

    binaryEmission

    When enabled, particles either fully emit or don't emit with no interpolation. Use for dusty surfaces like gravel where slip magnitude doesn't strongly affect dust amount. When disabled, emission smoothly scales with wheel slip for surfaces like asphalt.

    Declaration
    [Tooltip("When enabled the particle system will either emit or not emit, with no in-between. Also removes any smoothing.")]
    public bool binaryEmission
    Field Value
    Type Description
    bool

    emissionRateCoeff

    Vehicle-specific multiplier for particle emission rate across all wheels. Use to adjust emission on a per-vehicle basis (e.g., lighter vehicles produce less dust). For surface-specific adjustment, modify SurfacePreset emission settings instead. Values above 1 increase emission, below 1 decrease it.

    Declaration
    [Range(0, 2)]
    [Tooltip("Emission rate multiplier specific to this vehicle.\r\nUse to adjust emission on per-vehicle basis.\r\nFor global emission adjustment for individual surfaces check SurfacePresets.")]
    public float emissionRateCoeff
    Field Value
    Type Description
    float

    lateralSlipParticleCoeff

    Controls how much lateral slip (sideways sliding/drifting) affects particle emission. Higher values produce more smoke during cornering and drifting. Only applies to Smoke type particles. Dust particles ignore slip and emit based on speed instead.

    Declaration
    [Range(0, 5)]
    [Tooltip("How much will lateral slip contribute to the particle emission.\r\nIgnored when particle type for the surface is set to other than Smoke.")]
    public float lateralSlipParticleCoeff
    Field Value
    Type Description
    float

    longitudinalSlipParticleCoeff

    Controls how much longitudinal slip (wheelspin/locking) affects particle emission. Higher values produce more smoke during acceleration wheelspin and hard braking. Only applies to Smoke type particles. Dust particles ignore slip and emit based on speed instead.

    Declaration
    [Range(0, 5)]
    [Tooltip("How much will longitudinal slip contribute to the particle emission.\r\nIgnored when particle type for the surface is set to other than Smoke.")]
    public float longitudinalSlipParticleCoeff
    Field Value
    Type Description
    float

    particleSizeCoeff

    Vehicle-specific multiplier for particle size across all wheels. Use to adjust particle scale on a per-vehicle basis (e.g., larger vehicles can have larger particles). For surface-specific adjustment, modify SurfacePreset size settings instead. Values above 1 increase size, below 1 decrease it.

    Declaration
    [Range(0, 2)]
    [Tooltip("Particle size multiplier specific to this vehicle.\r\nUse to adjust particle size on per-vehicle basis.\r\nFor global particle size adjustment for individual surfaces check SurfacePresets.")]
    public float particleSizeCoeff
    Field Value
    Type Description
    float

    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
    VehicleComponent.VC_Disable(bool)
    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
    VehicleComponent.VC_Enable(bool)
    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_Initialize()

    Initializes the component's internal systems and resources. Called once during vehicle startup after the VehicleController reference is set.

    Declaration
    protected override void VC_Initialize()
    Overrides
    VehicleComponent.VC_Initialize()
    Remarks

    Override this to set up component-specific resources, cache references, or perform one-time initialization. Sets state.initialized to true on completion.

    VC_Update(float)

    Frame-rate dependent update called every frame. Override for visual updates and input handling.

    Declaration
    public override void VC_Update(float DeltaTime)
    Parameters
    Type Name Description
    float DeltaTime

    Time elapsed since last Update in seconds

    Overrides
    VehicleComponent.VC_Update(float)
    Remarks

    Only called when the component is active (initialized and enabled). Use for visual effects, UI updates, and other frame-dependent operations. Avoid physics calculations here - use VC_FixedUpdate instead.

    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics