Class RoadsChunkMeshLayer
Represents a mesh layer for rendering roads within a terrain chunk.
Inherited Members
Namespace: Fwt.HexTerrains.ChunkMehes.Data
Assembly: fwt.hexterrains.dll
Syntax
public class RoadsChunkMeshLayer : VisualChunkMeshLayer, IDisposable, ISerializableTerrainLayer
Remarks
This class extends VisualChunkMeshLayer to provide specialized rendering for road networks, including support for roundabouts represented as center hexagons. It can be configured via IRoadsChunkMeshLayerConfig during initialization. Typically used as part of a terrain rendering pipeline for hex-based maps.
Properties
RoadsRenderSettings
Gets or sets the size of the center hexagon that represents a roundabout in a hex cell.
Declaration
public virtual HexRoadsRenderSettings RoadsRenderSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| HexRoadsRenderSettings |
Methods
Init<TInitArgs>(HexTerrainSettings, TInitArgs)
Initializes the mesh layer with the specified terrain settings and mesh layer configuration.
Declaration
public override void Init<TInitArgs>(HexTerrainSettings settings, TInitArgs initArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| HexTerrainSettings | settings | The terrain settings to use for initialization. Provides configuration values such as grid size, elevation, and other terrain-related parameters. |
| TInitArgs | initArgs |
Type Parameters
| Name | Description |
|---|---|
| TInitArgs |
Overrides
Remarks
If args is a IVisualChunkMeshLayerConfig, this
method copies its render settings, visibility, render configurations, and biome UV configurations to the
mesh layer. Existing render configurations are cleared and replaced. The method also ensures that biome UV
configuration storage is properly initialized and holds the new values from the provided args.
ScheduleGenerateMeshJob(ChunkMetricsDataLayer, ChunkMeshSourcesDataLayer, CellMetricsDataLayer, int, JobHandle)
Schedules a job to generate a mesh for the chunk with a given index. If you want to introduce your own mesh generator, override this method and schedule your own job.
Declaration
public override JobHandle ScheduleGenerateMeshJob(ChunkMetricsDataLayer chunkMetrics, ChunkMeshSourcesDataLayer chunkMeshSources, CellMetricsDataLayer cellMetrics, int chunkIndex, JobHandle dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| ChunkMetricsDataLayer | chunkMetrics | Metrix of all terrain chunks |
| ChunkMeshSourcesDataLayer | chunkMeshSources | MeshSources to save generated mesh data into |
| CellMetricsDataLayer | cellMetrics | Metrics of all cells |
| int | chunkIndex | Index of chunk to schedule a mesh generation for |
| JobHandle | dependency | JobHandle to use as parameter when scheduling job |
Returns
| Type | Description |
|---|---|
| JobHandle |