TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

struct HeightmapSample in Tinman.Terrain.Heightmaps

Represents a single heightmap sample.

struct HeightmapSample implements IEquatable<HeightmapSample>
  IHeightmapLayers

Configuration

Config

The configurator object for this type.

public static property Config { get }
type IConfigurator<HeightmapSample>
value [not-null] The configurator object.

Serialization

Serializer

The serialization helper object for values of HeightmapSample.

public static readonly field Serializer
type ITypeSerializer<HeightmapSample>

Public / Constants

Default

An HeightmapSample value with full coverage and default sample values.

public static readonly field Default
type HeightmapSample

MaxValue30

Maximum absolute value for signed 30-bit scalar heightmap sample values.

public constant MaxValue30 = 1073741823
type int32

Remarks:

Scalar values are interpreted as normalized values in the range [-1..1], where -1 resp. 1 corresponds to the negative resp. positive value of MaxValue30. The normalized range is then mapped to some application-specific range (see VerticalRange).

Void

An HeightmapSample value with zero coverage and default sample values.

public static readonly field Void
type HeightmapSample

Public / Attributes

Coverage

The relative sample coverage value, ranging from 0 (no coverage) to MaxValue30 (full coverage).

public readonly field Coverage
type int32

See also:

MaxValue30
HeightmapLayer.Coverage
HeightmapSamples.Coverage
HeightmapRegion.Coverage

Displacement

The normalized displacement value along the terrain-space normal vector.

public readonly field Displacement
type int32

Remarks:

The default displacement value is 0.

See also:

MaxValue30
HeightmapLayer.Displacement
HeightmapSamples.Displacement
HeightmapRegion.Displacement

Elevation

The normalized elevation value along the terrain-space up vector.

public readonly field Elevation
type int32

Remarks:

The default elevation value is 0.

See also:

MaxValue30
HeightmapLayer.Elevation
HeightmapSamples.Elevation
HeightmapRegion.Elevation

HasFullCoverage

public property HasFullCoverage { get }
type bool
value

LayerMask

public property LayerMask { get }
type HeightmapLayer
value

Material

The token (see MaterialToken) value that describes the material of the terrain surface.

public readonly field Material
type int64

Remarks:

The default color value is 0 (no material).

See also:

HeightmapLayer.Material
HeightmapSamples.Material
HeightmapRegion.Material

Texture

The color (see Colors) value that describes the texture of the terrain surface.

public readonly field Texture
type int64

Remarks:

The default color value is 0 (transparent black).

See also:

HeightmapLayer.Texture
HeightmapSamples.Texture
HeightmapRegion.Texture

Public / Constructors

HeightmapSample

Creates a new instance of HeightmapSample.

public constructor HeightmapSample (int32 elevation, int64 texture = 0, int64 material = 0, int32 coverage = MaxValue30, int32 displacement = 0)
params elevation The Elevation value.
  texture The Texture value. Defaults to 0.
  material The Material value. Defaults to 0.
  coverage The Coverage value. Defaults to MaxValue30.
  displacement The Displacement value. Defaults to 0.

Public / Methods

ClearDefault

Clears the given heightmap layers to Default.

public method ClearDefault (HeightmapLayer layers)
type HeightmapSample
params layers The heightmap layers to clear.
returns The resulting heightmap sample value.

ClearVoid

Clears the given heightmap layers to Void.

public method ClearVoid (HeightmapLayer layers)
type HeightmapSample
params layers The heightmap layers to clear.
returns The resulting heightmap sample value.

Equals

public method Equals (HeightmapSample other)
type bool
params other

Merge

Merges this heightmap sample (first) with the given one (second).

public method Merge (HeightmapSample other, HeightmapLayer layers = HeightmapLayer.All)
type HeightmapSample
params other The heightmap sample to merge with.
  layers The heightmap layers to merge; defaults to All.
returns The resulting heightmap sample.

Mix

Mixes this heightmap sample with the given one.

public method Mix (HeightmapSample other, int32 f)
type HeightmapSample
params other The heightmap sample to mix with..
  f Mix factor for heightmap samples in the range [0..65536] (0 = this sample, 65536 = other sample).
returns The resulting heightmap sample.

Remarks:

This method uses discrete linear interpolation.


Mixes the given heightmap samples (interpolation between b and c).

public static method Mix (HeightmapSample a, HeightmapSample b, HeightmapSample c, HeightmapSample d, int32 f)
type HeightmapSample
params a The zeroth heightmap sample to mix.
  b The first heightmap sample to mix.
  c The second heightmap sample to mix.
  d The third heightmap sample to mix.
  f Mix factor for the heightmap samples in the range [0..65536].
returns The resulting heightmap sample.

Remarks:

This method uses discrete Catmull-Rom interpolation.

Modulate

Modulates this heightmap sample with the given coverage.

public method Modulate (int32 coverage)
type HeightmapSample
params coverage The coverage sample to modulate with.

SetDisplacement

Sets the Displacement value.

public method SetDisplacement (int32 displacement)
type HeightmapSample
params displacement The displacement value.
returns The resulting heightmap sample.

SetElevation

Sets the Elevation value.

public method SetElevation (int32 elevation)
type HeightmapSample
params elevation The elevation value.
returns The resulting heightmap sample.

SetMaterial

Sets the Material value.

public method SetMaterial (int64 material)
type HeightmapSample
params material The material value.
returns The resulting heightmap sample.

SetTexture

Sets the Texture value.

public method SetTexture (int64 texture)
type HeightmapSample
params texture The texture value.
returns The resulting heightmap sample.