AlphaFramework API  1.0.3
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
AlphaFramework.World.Terrains.OcclusionIntervalMapGenerator Class Reference

Generates an occlusion interval map from a height map for a ITerrain as a background task. More...

Inheritance diagram for AlphaFramework.World.Terrains.OcclusionIntervalMapGenerator:
NanoByte::Common::Tasks::TaskBase NanoByte::Common::Tasks::ITask

Public Member Functions

 OcclusionIntervalMapGenerator (ByteGrid heightMap, float stretchH=1, float stretchV=1, double lightSourceInclination=90)
 Prepares to calculate an occlusion interval map for a height-map. More...
 
- Public Member Functions inherited from NanoByte::Common::Tasks::TaskBase
void Run (CancellationToken cancellationToken=default, ICredentialProvider credentialProvider=null, IProgress< TaskSnapshot > progress=null)
 

Static Public Member Functions

static OcclusionIntervalMapGenerator FromTerrain (ITerrain terrain, double lightSourceInclination)
 Prepares to calculate an occlusion interval map for the height-map of a ITerrain. More...
 

Public Attributes

override string Name => Resources.CalculatingShadows
 
override bool CanCancel => true
 
- Public Attributes inherited from NanoByte::Common::Tasks::TaskBase
virtual bool CanCancel
 

Protected Member Functions

override void Execute ()
 

Protected Attributes

override bool UnitsByte => false
 
- Protected Attributes inherited from NanoByte::Common::Tasks::TaskBase
CancellationToken CancellationToken
 
ICredentialProvider CredentialProvider
 

Properties

ByteVector4Grid Result [get]
 Returns the calculated occlusion end map array once th calculation is complete. More...
 
- Properties inherited from NanoByte::Common::Tasks::TaskBase
abstract string Name
 
object Tag
 
internal TaskState State
 
abstract bool UnitsByte
 
long UnitsProcessed
 
long UnitsTotal
 
- Properties inherited from NanoByte::Common::Tasks::ITask
string Name
 
object Tag
 
bool CanCancel
 

Detailed Description

Generates an occlusion interval map from a height map for a ITerrain as a background task.

See also
ITerrain.OcclusionIntervalMap

Constructor & Destructor Documentation

◆ OcclusionIntervalMapGenerator()

AlphaFramework.World.Terrains.OcclusionIntervalMapGenerator.OcclusionIntervalMapGenerator ( ByteGrid  heightMap,
float  stretchH = 1,
float  stretchV = 1,
double  lightSourceInclination = 90 
)
inline

Prepares to calculate an occlusion interval map for a height-map.

Parameters
heightMapThe height-map data. This is not cloned and must not be modified during calculation!
stretchHA factor by which the terrain is horizontally stretched.
stretchVA factor by which the terrain is vertically stretched.
lightSourceInclinationThe angle of inclination of the sun's path away from the horizon in degrees.

Member Function Documentation

◆ FromTerrain()

static OcclusionIntervalMapGenerator AlphaFramework.World.Terrains.OcclusionIntervalMapGenerator.FromTerrain ( ITerrain  terrain,
double  lightSourceInclination 
)
inlinestatic

Prepares to calculate an occlusion interval map for the height-map of a ITerrain.

Parameters
terrainThe ITerrain providing the height-map. The height-map is not cloned and must not be modified during calculation!
lightSourceInclinationThe angle of inclination of the sun's path away from the horizon in degrees.
Returns
The newly crated occlusion interval map generator.

The results are not automatically written back to terrain .

Property Documentation

◆ Result

ByteVector4Grid AlphaFramework.World.Terrains.OcclusionIntervalMapGenerator.Result
get

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

A light rise angles is the minimum vertical angle (0 = 0°, 255 = 90°) which a directional light must achieve to be not occluded.

Exceptions
InvalidOperationExceptionThe calculation is not complete yet.

The documentation for this class was generated from the following file: