Class MaterialGeoPlastLayer
Inheritance
MaterialGeoPlastLayer
Assembly: fwt.hexterrains.dll
Syntax
public class MaterialGeoPlastLayer : DynamicGeoPlastLayer, IDisposable, ISerializableTerrainLayer
Fields
HeatFlowMap
Declaration
public FlowMapDataLayer HeatFlowMap
Field Value
HeatFlowPotentialMap
Declaration
public FlowMapDataLayer HeatFlowPotentialMap
Field Value
HeatMap
Declaration
public ColorMapCellValueDataLayer_Float HeatMap
Field Value
IncomingHeatFlowChunks
Hash set that stores chunk indexes to which the incoming flow happens
Declaration
public NativeParallelHashSetDataLayer<int> IncomingHeatFlowChunks
Field Value
MaterialSettings
Declaration
public MaterialGeoPlastSettings MaterialSettings
Field Value
TemperatureMap
Declaration
public ColorMapCellValueDataLayer_Float TemperatureMap
Field Value
Methods
ApplyHeatFlowFromCell(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Declaration
public virtual JobHandle ApplyHeatFlowFromCell(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
ApplyHeatFlowMap(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Declaration
public virtual JobHandle ApplyHeatFlowMap(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
ApplyHorizontalHeatFlowMap(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Declaration
public virtual JobHandle ApplyHorizontalHeatFlowMap(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
ApplySimulation(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Applies calculated Change.
For instance, there is a flow in all directions + up + down already calculated at this stage,
so this stage applies calculated change. For instance, it changes the plast amount according to calculated flow maps.
Declaration
public override JobHandle ApplySimulation(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
| Type |
Name |
Description |
| HexTerrainSimulationTimer |
simulationTime |
Simulation timer. Use it's values to be in sync with other simulations
|
| GeoPlastLayerGroup |
geoPlastLayerList |
Layer list to query for referenced geo plasts from.
For instance, for evaporation calculation there is a reference to a evaporation target geo plast layer,
so it will be retrieved from this layer list
|
| JobHandle |
dependency |
dependency to schedule jobs with
|
Returns
| Type |
Description |
| JobHandle |
job handle to all scheduled jobs
|
Overrides
ApplyVerticalHeatFlowMap(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Declaration
public virtual JobHandle ApplyVerticalHeatFlowMap(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
ApplyVerticalHeatFlowMap(HexTerrainSimulationTimer, MaterialGeoPlastLayer, FlowDirections, JobHandle)
Declaration
public virtual JobHandle ApplyVerticalHeatFlowMap(HexTerrainSimulationTimer simulationTime, MaterialGeoPlastLayer targetLayer, FlowDirections flowDirection, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
ApplyVolumeFlowMapToHeatFlowMap(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Declaration
public virtual JobHandle ApplyVolumeFlowMapToHeatFlowMap(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CalculateColorMap(JobHandle)
Schedules the calculation of the color map, ensuring it is executed after the specified job dependency
completes.
Declaration
public override JobHandle CalculateColorMap(JobHandle dependency)
Parameters
| Type |
Name |
Description |
| JobHandle |
dependency |
A job handle representing the dependency that must be completed before the color map calculation begins.
|
Returns
| Type |
Description |
| JobHandle |
A job handle that can be used to track the completion of the color map calculation job.
|
Overrides
CalculateDensity(JobHandle)
Calculates the density map.
Declaration
public override JobHandle CalculateDensity(JobHandle dependency)
Parameters
| Type |
Name |
Description |
| JobHandle |
dependency |
dependency for all jobs to be scheduled
|
Returns
| Type |
Description |
| JobHandle |
job handle of all scheduled jobs
|
Overrides
CalculateDensityByTemperature(JobHandle)
Declaration
protected virtual JobHandle CalculateDensityByTemperature(JobHandle dependency)
Parameters
| Type |
Name |
Description |
| JobHandle |
dependency |
|
Returns
| Type |
Description |
| JobHandle |
|
CalculateHeatFlowMap(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Declaration
public virtual JobHandle CalculateHeatFlowMap(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CalculateHeatFlowPotential(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Declaration
public virtual JobHandle CalculateHeatFlowPotential(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CalculateHorizontalHeatFlowPotential(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Default implementation of the horizontal flow potential calculation.
Heat diffuses to adjacent cells based on the touching volume between cells.
Declaration
public virtual JobHandle CalculateHorizontalHeatFlowPotential(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
| Type |
Name |
Description |
| HexTerrainSimulationTimer |
simulationTime |
Simulation timer. Use it's values to be in sync with other simulations
|
| GeoPlastLayerGroup |
geoPlastLayerList |
Layer list to query for referenced geo plasts from.
For instance, for evaporation calculation there is a reference to a evaporation target geo plast layer,
so it will be retrieved from this layer list
|
| JobHandle |
dependency |
dependency to schedule jobs with
|
Returns
| Type |
Description |
| JobHandle |
job handle to all scheduled jobs
|
CalculateSimulation(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Calculates actual Change based on Change Potential.
For instance, there is a flow potential in all directions + up + down,
so total flow potential may exceed the total amount of geo plast in this cell,
and existing amount splits proportionally to the flow potential.
Declaration
public override JobHandle CalculateSimulation(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
| Type |
Name |
Description |
| HexTerrainSimulationTimer |
simulationTime |
|
| GeoPlastLayerGroup |
geoPlastLayerList |
Layer list to query for referenced geo plasts from.
For instance, for evaporation calculation there is a reference to a evaporation target geo plast layer,
so it will be retrieved from this layer list
|
| JobHandle |
dependency |
dependency to schedule jobs with
|
Returns
| Type |
Description |
| JobHandle |
job handle to all scheduled jobs
|
Overrides
CalculateTemperature(JobHandle)
Declaration
public virtual JobHandle CalculateTemperature(JobHandle dependency)
Parameters
| Type |
Name |
Description |
| JobHandle |
dependency |
|
Returns
| Type |
Description |
| JobHandle |
|
CalculateVerticalHeatFlowPotential(HexTerrainSimulationTimer, DirectionFlowSettings, MaterialGeoPlastLayer, FlowDirections, JobHandle)
Declaration
protected virtual JobHandle CalculateVerticalHeatFlowPotential(HexTerrainSimulationTimer simulationTime, DirectionFlowSettings flowSettings, MaterialGeoPlastLayer flowTargetLayer, FlowDirections direction, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CalculateVerticalHeatFlowPotential(HexTerrainSimulationTimer, GeoPlastLayerGroup, FlowDirections, JobHandle)
Declaration
protected virtual JobHandle CalculateVerticalHeatFlowPotential(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, FlowDirections direction, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CalculateVerticalHeatFlowPotential(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Declaration
public virtual JobHandle CalculateVerticalHeatFlowPotential(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CalculateVerticalVolumeFlowPotential(HexTerrainSimulationTimer, DirectionFlowSettings, VerticalFlowByTemperatureSettings, GeoPlastLayer, FlowDirections, JobHandle)
Declaration
protected virtual JobHandle CalculateVerticalVolumeFlowPotential(HexTerrainSimulationTimer simulationTime, DirectionFlowSettings flowSettings, VerticalFlowByTemperatureSettings verticalFlowSettings, GeoPlastLayer flowTargetLayer, FlowDirections direction, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CalculateVerticalVolumeFlowPotential(HexTerrainSimulationTimer, GeoPlastLayerGroup, FlowDirections, JobHandle)
Declaration
protected virtual JobHandle CalculateVerticalVolumeFlowPotential(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, FlowDirections direction, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
CalculateVerticalVolumeFlowPotential(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Declaration
public override JobHandle CalculateVerticalVolumeFlowPotential(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
Overrides
CalculateVolumeFlowMap(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Declaration
public override JobHandle CalculateVolumeFlowMap(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerGroup, JobHandle dependency)
Parameters
Returns
| Type |
Description |
| JobHandle |
|
Overrides
Cleanup()
Every frame there is a cleanup stage. This function is called.
Usually used to clean the dirty flags.
Declaration
public override void Cleanup()
Overrides
CleanupAsync(JobHandle)
Async version of Cleanup() Cleanup()
Difference between regular Cleanup() is that it schedules jobs that clean up data layers,
so you don't have to wait for the results and can continue working.
Every frame there is a cleanup stage. This function is called.
Usually used to clean the dirty flags.
Declaration
public override JobHandle CleanupAsync(JobHandle dependency)
Parameters
| Type |
Name |
Description |
| JobHandle |
dependency |
|
Returns
| Type |
Description |
| JobHandle |
|
Overrides
ClearHeatFlowMap(JobHandle)
Clears the flow potential map (fills it wil zero values)
Declaration
public virtual JobHandle ClearHeatFlowMap(JobHandle dependency)
Parameters
| Type |
Name |
Description |
| JobHandle |
dependency |
|
Returns
| Type |
Description |
| JobHandle |
|
ClearHeatFlowPotentialMap(JobHandle)
Declaration
public virtual JobHandle ClearHeatFlowPotentialMap(JobHandle dependency)
Parameters
| Type |
Name |
Description |
| JobHandle |
dependency |
|
Returns
| Type |
Description |
| JobHandle |
|
CompleteAllJobs()
Completes all jobs that affect data layers.
Declaration
public override void CompleteAllJobs()
Overrides
DeserializeLayer(BinaryReader, HexTerrainSettings)
Requests a deserialization of the layer data.
Returns false if the layer does not support deserialization.
Declaration
public override bool DeserializeLayer(BinaryReader reader, HexTerrainSettings terrainSettings)
Parameters
| Type |
Name |
Description |
| BinaryReader |
reader |
binary reader to deserialize data from
|
| HexTerrainSettings |
terrainSettings |
deserialized terrain settings (layer was serialized with this settings)
|
Returns
Overrides
Dispose()
Disposes all allocated native memory.
Declaration
public override void Dispose()
Overrides
Init(HexTerrainSettings)
Initializes/Reinitializes the area data.
Declaration
public override void Init(HexTerrainSettings settings)
Parameters
Overrides
InitLayerData(IInitGeoPlastLayerConfig)
Declaration
public override void InitLayerData(IInitGeoPlastLayerConfig args)
Parameters
Overrides
PreparePlastUpdate(JobHandle)
Called at the beginning of the update cycle to prepare any data needed for the update.
Called before calculating Volume, Pressure, etc.
Declaration
public override JobHandle PreparePlastUpdate(JobHandle dependency)
Parameters
| Type |
Name |
Description |
| JobHandle |
dependency |
dependency for all jobs to be scheduled
|
Returns
| Type |
Description |
| JobHandle |
job handle of all scheduled jobs
|
Overrides
PrepareSimulation(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)
Calculates Change Potential. For instance, the flow potential per direction + up + down.
It's like in a physics engine the stage when the velocity is calculated,
and the actual movement will be calculated later based on the actual state like mass and velocity and collisions, etc.
Declaration
public override JobHandle PrepareSimulation(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
Parameters
| Type |
Name |
Description |
| HexTerrainSimulationTimer |
simulationTime |
|
| GeoPlastLayerGroup |
geoPlastLayerList |
Layer list to query for referenced geo plasts from.
For instance, for evaporation calculation there is a reference to a evaporation target geo plast layer,
so it will be retrieved from this layer list
|
| JobHandle |
dependency |
dependency to schedule jobs with
|
Returns
| Type |
Description |
| JobHandle |
job handle to all scheduled jobs
|
Overrides
SerializeLayer(BinaryWriter)
Requests a serialization of the layer data.
Returns false if the layer does not support serialization.
Declaration
public override bool SerializeLayer(BinaryWriter writer)
Parameters
| Type |
Name |
Description |
| BinaryWriter |
writer |
binary writer to serialize data by
|
Returns
| Type |
Description |
| bool |
True if serialized, false if not serialized/not supported/not implemented
|
Overrides
SetAllDirty(bool)
Sets all data layers dirty value.
If isDirty is true, all data layers will be marked as dirty and will be recalculated on the next frame.
If isDirty is false, all data layers will be marked as clean and will not be recalculated on the next frame.
Declaration
public override void SetAllDirty(bool isDirty)
Parameters
| Type |
Name |
Description |
| bool |
isDirty |
|
Overrides
Implements
Extension Methods