Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class DynamicGeoPlastLayer

    Inheritance
    object
    HexTerrainLayer
    GeoPlastLayer
    VisualGeoPlastLayer
    DynamicGeoPlastLayer
    MaterialGeoPlastLayer
    Implements
    IDisposable
    ISerializableTerrainLayer
    Inherited Members
    VisualGeoPlastLayer.VisualGeoPlastSettings
    VisualGeoPlastLayer.SurfaceLayerRef
    VisualGeoPlastLayer.RenderGeoPlast(ChunkMeshLayerGroup, JobHandle)
    VisualGeoPlastLayer.RenderGeoPlastVolume(ChunkMeshLayerGroup, JobHandle)
    VisualGeoPlastLayer.RenderGeoPlastAmount(ChunkMeshLayerGroup, JobHandle)
    VisualGeoPlastLayer.RenderGeoPlastCeiling(ChunkMeshLayerGroup, JobHandle)
    VisualGeoPlastLayer.ScheduleRenderGeoPlastJob(CellValueDataLayer<float>, ColorMapCellValueDataLayer_Float, ColorMapCellValueDataLayer_Float, ColorMapCellValueDataLayer_Int, CellValueDataLayer<bool>, JobHandle)
    VisualGeoPlastLayer.ScheduleRenderGeoPlastJob(NativeArray<float>, NativeArray<float>, NativeArray<bool>, NativeArray<float>, NativeArray<int>, NativeArray<bool>, NativeParallelHashSet<int>, JobHandle)
    GeoPlastLayer.GeoPlastSettings
    GeoPlastLayer.BedrockPlastReference
    GeoPlastLayer.AmountMap
    GeoPlastLayer.VolumeMap
    GeoPlastLayer.DensityMap
    GeoPlastLayer.BedrockHeightMap
    GeoPlastLayer.CeilingHeightMap
    GeoPlastLayer.Init(HexTerrainSettings, IInitGeoPlastLayerConfig)
    GeoPlastLayer.GetPlastAmount(int)
    GeoPlastLayer.GetDensity(int)
    GeoPlastLayer.GetPlastVolume(int)
    GeoPlastLayer.GetBedrockHeight(int)
    GeoPlastLayer.GetCeilingHeight(int)
    GeoPlastLayer.SetPlastAmount(int, float)
    GeoPlastLayer.SetDensity(int, float)
    GeoPlastLayer.SetBedrockHeight(int, float)
    GeoPlastLayer.SetCeilingHeight(int, float)
    GeoPlastLayer.SetPlastVolume(int, float)
    GeoPlastLayer.CalculateColorMap(JobHandle)
    GeoPlastLayer.PreparePlastUpdate(JobHandle)
    GeoPlastLayer.CalculateDensity(JobHandle)
    GeoPlastLayer.CalculateVolume(JobHandle)
    GeoPlastLayer.CalculateCeiling(JobHandle)
    GeoPlastLayer.CalculateBedrock(JobHandle)
    GeoPlastLayer.DoPlastUpdate(JobHandle)
    GeoPlastLayer.GetBedrockLayer()
    GeoPlastLayer.SerializeLayer(BinaryWriter)
    GeoPlastLayer.DeserializeLayer(BinaryReader, HexTerrainSettings)
    HexTerrainLayer.Name
    HexTerrainLayer.Settings
    HexTerrainLayer.ParentLayer
    HexTerrainLayer.Init<TInitArgs>(HexTerrainSettings, TInitArgs)
    HexTerrainLayer.Resize(int2)
    HexTerrainLayer.InitColoredDataLayer<TValue>(ColorMapCellValueDataLayer<TValue>, IInitColorMapCellValueDataLayerArgs<TValue>)
    HexTerrainLayer.InitDataLayer<TValue>(CellValueDataLayer<TValue>, IInitCellValueDataLayerArgs<TValue>)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(int)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(string)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(int, string)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(HexTerrainLayerReference)
    HexTerrainLayer.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Fwt.HexTerrains.GeoPlasts.Data
    Assembly: fwt.hexterrains.dll
    Syntax
    public class DynamicGeoPlastLayer : VisualGeoPlastLayer, IDisposable, ISerializableTerrainLayer

    Fields

    DownFlowTargetLayerRef

    Reference to the layer the plast amount condenses TO. (Down flow)

    Declaration
    public HexTerrainLayerReference DownFlowTargetLayerRef
    Field Value
    Type Description
    HexTerrainLayerReference

    DynamicSettings

    Settings for the flow of the geo plast. Contains settings such as flow speed, flow direction, etc.

    Declaration
    public DynamicGeoPlastSettings DynamicSettings
    Field Value
    Type Description
    DynamicGeoPlastSettings

    IncomingVolumeFlowChunks

    Hash set that stores chunk indexes to which the incoming flow happens

    Declaration
    public NativeParallelHashSetDataLayer<int> IncomingVolumeFlowChunks
    Field Value
    Type Description
    NativeParallelHashSetDataLayer<int>

    UpFlowTargetLayerRef

    Reference to the layer the plast amount evaporates TO. (Up flow)

    Declaration
    public HexTerrainLayerReference UpFlowTargetLayerRef
    Field Value
    Type Description
    HexTerrainLayerReference

    VolumeFlowMap

    Flow data for the geo plast per cell. Volume of geo plast units flown FROM the cell in each of 6 directions. 7th value is a total volume flown out of the cell. Flow is a transfer of geo plast volume from this cell to its neighbors.

    Declaration
    public FlowMapDataLayer VolumeFlowMap
    Field Value
    Type Description
    FlowMapDataLayer

    VolumeFlowPotentialMap

    Each source of flow contributes to the flow potential map. Then when the actual flow map is calculated, the flow potential map is used to determine the actual flow to each direction. Meaning, there may be ability to flow down the hill but there are several directions with the same hight difference, so the actual flow map calculation uses the relative potential, so flow down the hill will be split proportionally to the potential in each direction. Each value in the array is a struct with 8 slots. 0-5 are the 6 directions, 7 is upwards (out of the cell), 8 is downwards (into the cell).

    Declaration
    public FlowMapDataLayer VolumeFlowPotentialMap
    Field Value
    Type Description
    FlowMapDataLayer

    Methods

    ApplyHorizontalVolumeFlowMap(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    Declaration
    public virtual JobHandle ApplyHorizontalVolumeFlowMap(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTime
    GeoPlastLayerGroup geoPlastLayerList
    JobHandle dependency
    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
    GeoPlastLayer.ApplySimulation(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    ApplyVerticalFlowMap(HexTerrainSimulationTimer, DirectionFlowSettings, GeoPlastLayerGroup, FlowDirections, JobHandle)

    Declaration
    public virtual JobHandle ApplyVerticalFlowMap(HexTerrainSimulationTimer simulationTime, DirectionFlowSettings flowSettings, GeoPlastLayerGroup geoPlastLayerList, FlowDirections direction, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTime
    DirectionFlowSettings flowSettings
    GeoPlastLayerGroup geoPlastLayerList
    FlowDirections direction
    JobHandle dependency
    Returns
    Type Description
    JobHandle

    ApplyVerticalVolumeFlowMap(HexTerrainSimulationTimer, DirectionFlowSettings, GeoPlastLayer, FlowDirections, JobHandle)

    Declaration
    public virtual JobHandle ApplyVerticalVolumeFlowMap(HexTerrainSimulationTimer simulationTime, DirectionFlowSettings flowSettings, GeoPlastLayer targetLayer, FlowDirections flowDirection, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTime
    DirectionFlowSettings flowSettings
    GeoPlastLayer targetLayer
    FlowDirections flowDirection
    JobHandle dependency
    Returns
    Type Description
    JobHandle

    ApplyVerticalVolumeFlowMap(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    Declaration
    public virtual JobHandle ApplyVerticalVolumeFlowMap(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTime
    GeoPlastLayerGroup geoPlastLayerList
    JobHandle dependency
    Returns
    Type Description
    JobHandle

    ApplyVolumeFlowFromCell(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    Declaration
    public virtual JobHandle ApplyVolumeFlowFromCell(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTime
    GeoPlastLayerGroup geoPlastLayerList
    JobHandle dependency
    Returns
    Type Description
    JobHandle

    ApplyVolumeFlowMap(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    Declaration
    public virtual JobHandle ApplyVolumeFlowMap(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTime
    GeoPlastLayerGroup geoPlastLayerList
    JobHandle dependency
    Returns
    Type Description
    JobHandle

    CalculateHorizontalVolumeFlowPotential(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    Default implementation of the horizontal flow potential calculation. Flows to neighboring cells trying to equalize the height difference between height of ceiling between adjacent cells.

    Declaration
    public virtual JobHandle CalculateHorizontalVolumeFlowPotential(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 simulationTimer, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTimer

    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
    GeoPlastLayer.CalculateSimulation(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    CalculateVerticalVolumeFlowPotential(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    Declaration
    public virtual JobHandle CalculateVerticalVolumeFlowPotential(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTime
    GeoPlastLayerGroup geoPlastLayerList
    JobHandle dependency
    Returns
    Type Description
    JobHandle

    CalculateVolumeFlowMap(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    Declaration
    public virtual JobHandle CalculateVolumeFlowMap(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTime
    GeoPlastLayerGroup geoPlastLayerList
    JobHandle dependency
    Returns
    Type Description
    JobHandle

    CalculateVolumeFlowPotential(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    Declaration
    public virtual JobHandle CalculateVolumeFlowPotential(HexTerrainSimulationTimer simulationTime, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTime
    GeoPlastLayerGroup geoPlastLayerList
    JobHandle dependency
    Returns
    Type Description
    JobHandle

    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
    GeoPlastLayer.Cleanup()

    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
    GeoPlastLayer.CleanupAsync(JobHandle)

    ClearVolumeFlowMap(JobHandle)

    Clears the flow potential map (fills it wil zero values)

    Declaration
    public virtual JobHandle ClearVolumeFlowMap(JobHandle dependency)
    Parameters
    Type Name Description
    JobHandle dependency
    Returns
    Type Description
    JobHandle

    ClearVolumeFlowPotentialMap(JobHandle)

    Clears the flow potential map (fills it wil zero values)

    Declaration
    public virtual JobHandle ClearVolumeFlowPotentialMap(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
    GeoPlastLayer.CompleteAllJobs()

    Dispose()

    Disposes all allocated native memory.

    Declaration
    public override void Dispose()
    Overrides
    GeoPlastLayer.Dispose()

    GetTotalVolumeFlow(int)

    Waits until all related jobs are completed and returns the value for the given cell index if any or default if not available (if cell index is wrong, for instance). Expensive operation as it has to wait for all jobs to complete for immediate access.

    Declaration
    public virtual float GetTotalVolumeFlow(int cellIndex)
    Parameters
    Type Name Description
    int cellIndex

    cell index to get data from

    Returns
    Type Description
    float

    value if available, otherwise - default

    GetTotalVolumeFlowPotential(int)

    Waits until all related jobs are completed and returns the value for the given cell index if any or default if not available (if cell index is wrong, for instance). Expensive operation as it has to wait for all jobs to complete for immediate access.

    Declaration
    public virtual float GetTotalVolumeFlowPotential(int cellIndex)
    Parameters
    Type Name Description
    int cellIndex

    cell index to get data from

    Returns
    Type Description
    float

    value if available, otherwise - default

    GetVerticalFlowTarget<TGeoPlast>(GeoPlastLayerGroup, FlowDirections)

    Declaration
    public virtual TGeoPlast GetVerticalFlowTarget<TGeoPlast>(GeoPlastLayerGroup geoPlastLayerGroup, FlowDirections direction) where TGeoPlast : GeoPlastLayer
    Parameters
    Type Name Description
    GeoPlastLayerGroup geoPlastLayerGroup
    FlowDirections direction
    Returns
    Type Description
    TGeoPlast
    Type Parameters
    Name Description
    TGeoPlast

    GetVolumeFlow(int)

    Waits until all related jobs are completed and returns the value for the given cell index if any or default if not available (if cell index is wrong, for instance). Expensive operation as it has to wait for all jobs to complete for immediate access.

    Declaration
    public virtual FixedArray8<float> GetVolumeFlow(int cellIndex)
    Parameters
    Type Name Description
    int cellIndex

    cell index to get data from

    Returns
    Type Description
    FixedArray8<float>

    value if available, otherwise - default

    GetVolumeFlowPotential(int)

    Waits until all related jobs are completed and returns the value for the given cell index if any or default if not available (if cell index is wrong, for instance). Expensive operation as it has to wait for all jobs to complete for immediate access.

    Declaration
    public virtual FixedArray8<float> GetVolumeFlowPotential(int cellIndex)
    Parameters
    Type Name Description
    int cellIndex

    cell index to get data from

    Returns
    Type Description
    FixedArray8<float>

    value if available, otherwise - default

    Init(HexTerrainSettings)

    Initializes/Reinitializes the area data.

    Declaration
    public override void Init(HexTerrainSettings settings)
    Parameters
    Type Name Description
    HexTerrainSettings settings

    new terrain settings

    Overrides
    GeoPlastLayer.Init(HexTerrainSettings)

    InitLayerData(IInitGeoPlastLayerConfig)

    Declaration
    public override void InitLayerData(IInitGeoPlastLayerConfig args)
    Parameters
    Type Name Description
    IInitGeoPlastLayerConfig args
    Overrides
    VisualGeoPlastLayer.InitLayerData(IInitGeoPlastLayerConfig)

    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 simulationTimer, GeoPlastLayerGroup geoPlastLayerList, JobHandle dependency)
    Parameters
    Type Name Description
    HexTerrainSimulationTimer simulationTimer

    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
    GeoPlastLayer.PrepareSimulation(HexTerrainSimulationTimer, GeoPlastLayerGroup, JobHandle)

    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
    GeoPlastLayer.SetAllDirty(bool)

    SetFlow(int, FixedArray8<float>)

    Waits until all related jobs are completed and sets the value for the given cell index if there is a cell with that index. Returns true if successfull, otherwise - false. Expensive operation as it has to wait for all jobs to complete for immediate access.

    Declaration
    public virtual bool SetFlow(int cellIndex, FixedArray8<float> value)
    Parameters
    Type Name Description
    int cellIndex

    cell index to set data to

    FixedArray8<float> value
    Returns
    Type Description
    bool

    true if success, otherwise - false

    SetFlowPotential(int, FixedArray8<float>)

    Waits until all related jobs are completed and sets the value for the given cell index if there is a cell with that index. Returns true if successfull, otherwise - false. Expensive operation as it has to wait for all jobs to complete for immediate access.

    Declaration
    public virtual bool SetFlowPotential(int cellIndex, FixedArray8<float> value)
    Parameters
    Type Name Description
    int cellIndex

    cell index to set data to

    FixedArray8<float> value
    Returns
    Type Description
    bool

    true if success, otherwise - false

    SetTotalFlow(int, float)

    Waits until all related jobs are completed and sets the value for the given cell index if there is a cell with that index. Returns true if successfull, otherwise - false. Expensive operation as it has to wait for all jobs to complete for immediate access.

    Declaration
    public virtual bool SetTotalFlow(int cellIndex, float value)
    Parameters
    Type Name Description
    int cellIndex

    cell index to set data to

    float value
    Returns
    Type Description
    bool

    true if success, otherwise - false

    SetTotalFlowPotential(int, float)

    Waits until all related jobs are completed and sets the value for the given cell index if there is a cell with that index. Returns true if successfull, otherwise - false. Expensive operation as it has to wait for all jobs to complete for immediate access.

    Declaration
    public virtual bool SetTotalFlowPotential(int cellIndex, float value)
    Parameters
    Type Name Description
    int cellIndex

    cell index to set data to

    float value
    Returns
    Type Description
    bool

    true if success, otherwise - false

    Implements

    IDisposable
    ISerializableTerrainLayer

    Extension Methods

    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    In this article
    Back to top Generated by DocFX