NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Class SurfaceParticleSystem

    Tire smoke, surface dust and debris chunks for one wheel.

    Inheritance
    object
    SurfaceParticleSystem
    Namespace: NWH.VehiclePhysics2.Effects
    Assembly: NWH.VehiclePhysics2.dll
    Syntax
    [Serializable]
    public class SurfaceParticleSystem
    Remarks

    Smoke is slip driven, off the larger of longitudinal and lateral slip, for hard surfaces. Dust is speed driven, for loose surfaces. Chunks scale with wheel angular velocity and slip. Colour, size and lifetime come from the ground SurfacePreset, whose particleType picks between the smoke and dust paths.

    Fields

    binaryEmission

    When true, smoke emits at full rate or not at all with no gradual transition. Only affects surfaces whose SurfacePreset particleType is Smoke. Dust presets derive emission from speed and ignore this flag.

    Declaration
    [Tooltip("    Makes the particle either emit or not emit with no in-between.")]
    public bool binaryEmission
    Field Value
    Type Description
    bool

    chunkPS

    Particle system for chunks kicked up by the wheel

    Declaration
    public ParticleSystem chunkPS
    Field Value
    Type Description
    ParticleSystem

    chunkPrefab

    Prefab for the chunks kicked up by the wheel.

    Declaration
    public GameObject chunkPrefab
    Field Value
    Type Description
    GameObject

    emissionRateCoeff

    Multiplier applied to the base emission rate from the SurfacePreset. Values above 1 produce more particles, below 1 produce fewer. Set by SurfaceParticleManager.

    Declaration
    [Tooltip("    Coefficient by which the emission rate will be multiplied.")]
    public float emissionRateCoeff
    Field Value
    Type Description
    float

    lateralSlipCoeff

    Multiplier for lateral (sideways) slip contribution to smoke emission. Higher values produce more smoke during drifting and cornering. Only affects Smoke type particles. Set by SurfaceParticleManager.

    Declaration
    [Tooltip("Coefficient by which the lateral slip will be multiplied.\r\nIncrease the value to emit more particles when there is lateral slip (wheel skid / drift).")]
    public float lateralSlipCoeff
    Field Value
    Type Description
    float

    longitudinalSlipCoeff

    Multiplier for longitudinal (forward/backward) slip contribution to smoke emission. Higher values produce more smoke during wheelspin and hard braking. Only affects Smoke type particles. Set by SurfaceParticleManager.

    Declaration
    [Tooltip("Coefficient by which the longitudinal slip will be multiplied.\r\nIncrease the value to emit more particles when there is longitudinal slip (wheel spin).")]
    public float longitudinalSlipCoeff
    Field Value
    Type Description
    float

    particlePS

    Smoke particles particle system

    Declaration
    public ParticleSystem particlePS
    Field Value
    Type Description
    ParticleSystem

    particlePrefab

    Smoke particles prefab

    Declaration
    public GameObject particlePrefab
    Field Value
    Type Description
    GameObject

    particleSizeCoeff

    Multiplier applied to the base particle size from the SurfacePreset. Values above 1 create larger particles, below 1 create smaller ones. Set by SurfaceParticleManager.

    Declaration
    [Tooltip("    Coefficient by which the particle start size will be multiplied.")]
    public float particleSizeCoeff
    Field Value
    Type Description
    float

    surfacePreset

    Surface preset for this SurfaceParticleSystem

    Declaration
    [SerializeField]
    public SurfacePreset surfacePreset
    Field Value
    Type Description
    SurfacePreset

    Methods

    Destroy()

    Stops coroutines and destroys the spawned particle and chunk GameObjects so re-init doesn't orphan them.

    Declaration
    public void Destroy()

    Disable()

    Stops the particle and chunk update coroutines and stops playing the particle systems.

    Declaration
    public void Disable()

    Enable()

    Starts the particle and chunk update coroutines and begins playing the particle systems.

    Declaration
    public void Enable()

    Initialize(VehicleController, WheelComponent)

    Initializes the particle system by instantiating particle and chunk prefabs as children of the wheel.

    Declaration
    public void Initialize(VehicleController vc, WheelComponent wheelComponent)
    Parameters
    Type Name Description
    VehicleController vc

    The parent vehicle controller.

    WheelComponent wheelComponent

    The wheel this particle system is attached to.

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