Class OcclusionIntervalMapGenerator
- Namespace
- AlphaFramework.World.Terrains
- Assembly
- AlphaFramework.World.dll
Generates an occlusion interval map from a height map for a ITerrain as a background task.
public class OcclusionIntervalMapGenerator : TaskBase, ITask
- Inheritance
-
objectMarshalByRefObjectOcclusionIntervalMapGenerator
- Implements
- Inherited Members
Constructors
OcclusionIntervalMapGenerator(ByteGrid, float, float, double)
Prepares to calculate an occlusion interval map for a height-map.
public OcclusionIntervalMapGenerator(ByteGrid heightMap, float stretchH = 1, float stretchV = 1, double lightSourceInclination = 90)
Parameters
heightMapByteGridThe height-map data. This is not cloned and must not be modified during calculation!
stretchHfloatA factor by which the terrain is horizontally stretched.
stretchVfloatA factor by which the terrain is vertically stretched.
lightSourceInclinationdoubleThe angle of inclination of the sun's path away from the horizon in degrees.
Properties
CanCancel
public override bool CanCancel { get; }
Property Value
MaxDegreeOfParallelism
Maximum number of threads to use for the computation. -1 to use ProcessorCount.
public int MaxDegreeOfParallelism { get; set; }
Property Value
Name
public override string Name { get; }
Property Value
Result
Returns the calculated occlusion end map array once the calculation is complete.
public ByteVector4Grid Result { get; }
Property Value
Remarks
A light rise angle is the minimum vertical angle (0 = 0°, 255 = 90°) which a directional light must achieve to be not occluded.
Exceptions
- InvalidOperationException
The calculation is not complete yet.
UnitsByte
protected override bool UnitsByte { get; }
Property Value
Methods
Execute()
protected override void Execute()
FromTerrain(ITerrain, double)
Prepares to calculate an occlusion interval map for the height-map of a ITerrain.
public static OcclusionIntervalMapGenerator FromTerrain(ITerrain terrain, double lightSourceInclination)
Parameters
terrainITerrainThe ITerrain providing the height-map. The height-map is not cloned and must not be modified during calculation!
lightSourceInclinationdoubleThe angle of inclination of the sun's path away from the horizon in degrees.
Returns
- OcclusionIntervalMapGenerator
The newly crated occlusion interval map generator.
Remarks
The results are not automatically written back to terrain.