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

struct VerticalRange in Tinman.Terrain.Heightmaps

Mapping of normalized elevation values (i.e. the range -/+MaxValue30) to vertical coordinates in a given range (for example -1000 to +9000) in terms of some vertical coordinate system (see Vertical).

struct VerticalRange implements IEquatable<VerticalRange>

Remarks

Normalized and terrain-space elevation values are always tied at zero, independent of the given minimum and maximum elevation values (see Minimum and Maximum). For the example range of -1000 to +9000, the normalized elevation zero is mapped to 0, the normalized elevation MaxValue30 is mapped to +9000 and the negative value of HeightmapSample is mapped to -9000. The actual minimum and maximum bounds become important when elevation values are encoded in a heightmap dataset, especially when using a low bit-depth.

See also:

PixelRange

Configuration

Config

The configurator object for this type.

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

Serialization

Serializer

The serialization helper object for values of VerticalRange.

public static readonly field Serializer
type ITypeSerializer<VerticalRange>

Public / Constants

Default

The default elevation range for terrains.

public static readonly field Default
type VerticalRange

Remarks:

Altitude range: [-10000..10000] units.

None

No vertical range (i.e. no elevation data).

public static readonly field None
type VerticalRange

Public / Attributes

Elevation

Returns the factor by which normalized elevation values of this range must be multiplied in order to translate them to terrain-space elevation values.

public property Elevation { get }
type float64
value The scale factor for normalized elevation values.

First

The first terrain-space elevation value.

public property First { get }
type float64
value The first elevation value, in terrain-space.

Remarks:

The elevation value is interpreted as relative height above the base geometry. The base geometry is usually an ellipsoid.

Maximum

The maximum terrain-space elevation value.

public readonly field Maximum
type float64

Remarks:

The elevation value is interpreted as relative height above the base geometry. The base geometry is usually an ellipsoid.

Minimum

The minimum terrain-space elevation value.

public readonly field Minimum
type float64

Remarks:

The elevation value is interpreted as relative height above the base geometry. The base geometry is usually an ellipsoid.

Range

The terrain-space elevation value range.

public property Range { get }
type float64
value [>=0] The terrain-space elevation range: [-Range..Range].

Second

The second terrain-space elevation value.

public property Second { get }
type float64
value The second elevation value, in terrain-space.

Remarks:

The elevation value is interpreted as relative height above the base geometry. The base geometry is usually an ellipsoid.

Public / Constructors

VerticalRange

Creates a new instance of VerticalRange.

public constructor VerticalRange (float64 first, float64 second)
params first The first terrain-space elevation value.
  second The second terrain-space elevation value.

Public / Methods

DenormalizeElevation

Transforms the given normalized heightmap elevation value to the corresponding real-world elevation value.

[Pure]
public method DenormalizeElevation (int64 elevation)
type float64
params elevation The normalized heightmap elevation value.
returns The read-world elevation value.

Equals

public method Equals (VerticalRange obj)
type bool
params obj

Merge

Merges this vertical range with the given one.

[Pure]
public method Merge (VerticalRange other)
type VerticalRange
params other The range to merge with.
returns The smallest possible vertical range that contains this range and the given one.

NormalizeElevation

Transforms the given real-world elevation value to the corresponding normalized heightmap elevation value.

[Pure]
public method NormalizeElevation (float64 elevation)
type int64
params elevation The read-world elevation value.
returns The unclamped normalized heightmap elevation value.

NormalizeElevationClamp

Transforms the given real-world elevation value to the corresponding normalized heightmap elevation value.

[Pure]
public method NormalizeElevationClamp (float64 elevation)
type int32
params elevation The read-world elevation value.
returns The normalized heightmap elevation value, between 0 and MaxValue30.

Scale

Scales this vertical range.

[Pure]
public method Scale (float64 factor)
type VerticalRange
params factor The scale factor.
returns The resulting vertical range.

ToPixelRange

[Pure]
public method ToPixelRange ()
type PixelRange

ToString

public override method ToString ()
type string

Transform

Transforms this vertical range from one vertical unit to another.

[Pure]
public method Transform (UnitOfMeasure source, UnitOfMeasure target = null)
type VerticalRange
params source The source vertical unit or null.
  target The target vertical unit or null. Defaults to null.
returns The resulting vertical range.

Remarks:

This method assumes that this vertical range is expressed in source units; then the returned vertical range will be expressed in target units. If source and/or target is null, Metre will be used instead.