HeightmapsUtil

Description

static class Tinman.Terrain.Heightmaps.HeightmapsUtil

Helper class for this namespace.

Public / Constants

First​Layer


public constant FirstLayer → (HeightmapLayer.Elevation:HeightmapLayer)

The first heightmap data layer.

Max​Coord


public constant MaxCoord → (1073741824:int32)

The maximum value for heightmap coordinates (i.e. X, Y and Z).

Max​Size


public constant MaxSize → (1073741825:int32)

The maximum heightmap size.

Min​Size


public constant MinSize → (257:int32)

The minimum heightmap size.

Range​Layers


The heightmap layers that depend on a VerticalRange value.

Public / Methods

Compute​Scale​To​Max​Size


public static method ComputeScaleToMaxSize → (1)

size in : int32

[pow2+1]
The heightmap size.

returns → int32

The scale factor.

Computes the factor to use to scale coordinates of a heightmap of the given size in to a heightmap of MaxSize.

Compute​Shift​To​Max​Size


public static method ComputeShiftToMaxSize → (1)

size in : int32

[pow2+1]
The heightmap size.

returns → int32

The number of bits to shift.

Computes the number of bits to shift in order to scale the coordinates of a heightmap of the given size in to a heightmap of MaxSize.

Compute​Size


public static method ComputeSize → (2)

width in : int32

The heightmap width.

height opt : int32 = 0

The heightmap height.

returns → int32

The internal map size.

Computes the internal size for the given heightmap width and height.

Next​Layer


public static method NextLayer → (1)

layer in : HeightmapLayer

The current data layer.

returns → HeightmapLayer

The next data layer or HeightmapLayer.None.

Returns the next data layer.

Heightmap layers are enumerated in this order:

Translate​Coordinates

2 overloads


public static method TranslateCoordinates1 → (3)

coords in : Vec3D

The source heightmap coordinates.

sizeFrom in : int32

[pow2+1]
The source heightmap size.

sizeTo in : int32

[pow2+1]
The target heightmap size.

returns → Vec3D

The target heightmap coordinates.

Translates the given heightmap coordinates.


public static method TranslateCoordinates2 → (3)

coords in : Vec3I

The source heightmap coordinates.

sizeFrom in : int32

[pow2+1]
The source heightmap size.

sizeTo in : int32

[pow2+1]
The target heightmap size.

returns → Vec3I

The target heightmap coordinates.

Translates the given heightmap coordinates.

Translate​Coordinates​From​Max​Size

2 overloads


public static method TranslateCoordinatesFromMaxSize1 → (2)

coords in : Vec3D

The source heightmap coordinates.

sizeTo in : int32

[pow2+1]
The target heightmap size.

returns → Vec3D

The target heightmap coordinates.

Translates the given heightmap coordinates.


public static method TranslateCoordinatesFromMaxSize2 → (2)

coords in : Vec3I

The source heightmap coordinates.

sizeTo in : int32

[pow2+1]
The target heightmap size.

returns → Vec3I

The target heightmap coordinates.

Translates the given heightmap coordinates.

Translate​Coordinates​To​Max​Size

2 overloads


public static method TranslateCoordinatesToMaxSize1 → (2)

coords in : Vec3D

The source heightmap coordinates.

sizeFrom in : int32

[pow2+1]
The source heightmap size.

returns → Vec3D

The target heightmap coordinates.

Translates the given heightmap coordinates.


public static method TranslateCoordinatesToMaxSize2 → (2)

coords in : Vec3I

The source heightmap coordinates.

sizeFrom in : int32

[pow2+1]
The source heightmap size.

returns → Vec3I

The target heightmap coordinates.

Translates the given heightmap coordinates.

Public / Attributes

Cache​Memory


public static attribute CacheMemory → (get,set)

value : int32

[>=0]
The amount of cache memory, in megabytes. If 0, the default value will be used.

Size of the heightmap dataset cache.

The default value is 128 <= N/16 <= 2048, where N is the amount of total memory (see LowLevel.MemoryTotal), in megabytes.

Cache​Object


[OwnerReturn]
public static attribute CacheObject → (get)

value : IDisposable

[not-null]
The cache object.

Returns the cache object.

The cache object is created when needed and disposed when no longer needed. By keeping the returned cache object alive, client code can avoid repeated creations / disposals if only one entity at a time is using the cache.

Configuration

Config​Heightmap​Layer


public static attribute ConfigHeightmapLayer → (get)

value : IConfiguratorEnum<HeightmapLayer>

[not-null]
The configurator object.

The configuration type for HeightmapLayer values.

Config​Heightmap​Layers


public static attribute ConfigHeightmapLayers → (get)

value : IConfigurator<HeightmapLayer>

[not-null]
The configurator object.

The configuration type for HeightmapLayer values.

Logging

Logger


public static readonly attribute Logger → (ILogger)

The logger object of this class.