Class SkidmarkGenerator
Generates procedural skidmark meshes dynamically as wheels slip on surfaces.
Namespace: NWH.VehiclePhysics2.Effects
Assembly: NWH.VehiclePhysics2.dll
Syntax
public class SkidmarkGenerator
Methods
GenerateNewSkidmark()
Spawns a new skidmark GameObject with mesh and renderer, and trims the oldest when over the triangle budget.
Declaration
public void GenerateNewSkidmark()
Initialize(SkidmarkManager, WheelComponent)
Binds the generator to its manager and wheel, resets state, and spawns the first skidmark object.
Declaration
public void Initialize(SkidmarkManager skidmarkManager, WheelComponent wheelComponent)
Parameters
| Type | Name | Description |
|---|---|---|
| SkidmarkManager | skidmarkManager | Owning skidmark manager supplying settings and the container. |
| WheelComponent | wheelComponent | Wheel this generator tracks. |
Update(int, float, float)
Smooths toward target intensity and appends or commits skidmark geometry for this wheel.
Declaration
public void Update(int surfaceMapIndex, float targetIntensity, float dt)
Parameters
| Type | Name | Description |
|---|---|---|
| int | surfaceMapIndex | Index of the current surface; negative means no skidmark surface. |
| float | targetIntensity | Target skidmark alpha to lerp toward. |
| float | dt | Time step since the last update. |