This class handles mesh generation for skidmarks, for all vehicles in the scene. You just have to put an instance of it in your scene. Note : this class is inspired by the Unity Car Tutorial skidmarks script, and optimized to improve performance.
More...
|
virtual int | AddSkidMark (Vector3 position, Vector3 normal, float intensity, int lastIndex) |
| Adds a new trace This method must be called from the wheel's code to add a mark at the desired moment More...
|
|
|
int | MaxMarksNumber = 1024 |
| The maximum amount of skidmarks stored. Above this number, old skidmarks are destroyed. This number is shared between all vehicles. More...
|
|
float | MarkWidth = 0.2f |
| the width of the skidmarks at ground level More...
|
|
float | GroundDistance = 0.02f |
| the offset between the mark and the ground More...
|
|
|
virtual void | Start () |
| Initalizes the array storing skidmarks and elements used for marks More...
|
|
virtual void | LateUpdate () |
| Checks wether a mark should be added and updates the mesh if needed More...
|
|
virtual void | UpdateMesh () |
| Mesh update More...
|
|
This class handles mesh generation for skidmarks, for all vehicles in the scene. You just have to put an instance of it in your scene. Note : this class is inspired by the Unity Car Tutorial skidmarks script, and optimized to improve performance.
◆ AddSkidMark()
virtual int MoreMountains.HighroadEngine.SkidmarksManager.AddSkidMark |
( |
Vector3 |
position, |
|
|
Vector3 |
normal, |
|
|
float |
intensity, |
|
|
int |
lastIndex |
|
) |
| |
|
virtual |
Adds a new trace This method must be called from the wheel's code to add a mark at the desired moment
- Returns
- The skid mark index.
- Parameters
-
position | The mark's position. |
normal | Ground normal. |
intensity | Intensity of the mark (from 0 to 1). |
lastIndex | Previous mark index for that wheel. |
◆ LateUpdate()
virtual void MoreMountains.HighroadEngine.SkidmarksManager.LateUpdate |
( |
| ) |
|
|
protectedvirtual |
Checks wether a mark should be added and updates the mesh if needed
◆ Start()
virtual void MoreMountains.HighroadEngine.SkidmarksManager.Start |
( |
| ) |
|
|
protectedvirtual |
Initalizes the array storing skidmarks and elements used for marks
◆ UpdateMesh()
virtual void MoreMountains.HighroadEngine.SkidmarksManager.UpdateMesh |
( |
| ) |
|
|
protectedvirtual |
◆ _colorsArray
Color32 [] MoreMountains.HighroadEngine.SkidmarksManager._colorsArray |
|
protected |
◆ _firstInitializationOfBoundsDone
bool MoreMountains.HighroadEngine.SkidmarksManager._firstInitializationOfBoundsDone |
|
protected |
◆ _mesh
Mesh MoreMountains.HighroadEngine.SkidmarksManager._mesh |
|
protected |
◆ _meshFilter
MeshFilter MoreMountains.HighroadEngine.SkidmarksManager._meshFilter |
|
protected |
◆ _needNewSkidmark
bool MoreMountains.HighroadEngine.SkidmarksManager._needNewSkidmark |
|
protected |
◆ _normalsArray
Vector3 [] MoreMountains.HighroadEngine.SkidmarksManager._normalsArray |
|
protected |
◆ _skidmarksArray
Section [] MoreMountains.HighroadEngine.SkidmarksManager._skidmarksArray |
|
protected |
◆ _tangentsArray
Vector4 [] MoreMountains.HighroadEngine.SkidmarksManager._tangentsArray |
|
protected |
◆ _trianglesArray
int [] MoreMountains.HighroadEngine.SkidmarksManager._trianglesArray |
|
protected |
◆ _uvsArray
Vector2 [] MoreMountains.HighroadEngine.SkidmarksManager._uvsArray |
|
protected |
◆ _verticesArray
Vector3 [] MoreMountains.HighroadEngine.SkidmarksManager._verticesArray |
|
protected |
◆ DistanceBetweenMarks
const float MoreMountains.HighroadEngine.SkidmarksManager.DistanceBetweenMarks = 0.5f |
|
static |
the minimal distance between each point of the mark
◆ GroundDistance
float MoreMountains.HighroadEngine.SkidmarksManager.GroundDistance = 0.02f |
the offset between the mark and the ground
◆ markIndex
int MoreMountains.HighroadEngine.SkidmarksManager.markIndex |
|
protected |
◆ MarkWidth
float MoreMountains.HighroadEngine.SkidmarksManager.MarkWidth = 0.2f |
the width of the skidmarks at ground level
◆ MaxMarksNumber
int MoreMountains.HighroadEngine.SkidmarksManager.MaxMarksNumber = 1024 |
The maximum amount of skidmarks stored. Above this number, old skidmarks are destroyed. This number is shared between all vehicles.
The documentation for this class was generated from the following file:
- E:/Github/Store/HighroadEngine/Assets/HighroadEngine/Common/Scripts/Managers/SkidmarksManager.cs