Table of Contents

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
object
MarshalByRefObject
OcclusionIntervalMapGenerator
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

heightMap ByteGrid

The height-map data. This is not cloned and must not be modified during calculation!

stretchH float

A factor by which the terrain is horizontally stretched.

stretchV float

A factor by which the terrain is vertically stretched.

lightSourceInclination double

The angle of inclination of the sun's path away from the horizon in degrees.

Properties

CanCancel

public override bool CanCancel { get; }

Property Value

bool

MaxDegreeOfParallelism

Maximum number of threads to use for the computation. -1 to use ProcessorCount.

public int MaxDegreeOfParallelism { get; set; }

Property Value

int

Name

public override string Name { get; }

Property Value

string

Result

Returns the calculated occlusion end map array once the calculation is complete.

public ByteVector4Grid Result { get; }

Property Value

ByteVector4Grid

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

bool

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

terrain ITerrain

The ITerrain providing the height-map. The height-map is not cloned and must not be modified during calculation!

lightSourceInclination double

The 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.

See Also