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

struct MapInfo in Tinman.Terrain.Mapping

Provides information about a map raster.

struct MapInfo implements IEquatable<MapInfo>

Remarks

A map raster is a lattice of evenly spaced data points (the spacing is defined as 1):

(0|0)
  O---O---O---O---O
  |   |   |   |   |
  O---O---O---O---O     O := data point
  |   |   |   |   |     w := raster width  (here: 4)
  O---O---O---O---O     h := raster height (here: 3)
  |   |   |   |   |
  O---O---O---O---O
                (w|h)
The raster width resp. height always refers to the edge length of the map (in spacing units), regardless of the Coverage semantic of the underlying dataset; which can be a geocoded image (see IImage), a heightmap (see IHeightmap) or a pyramid (see IPyramid).
The raster size may differ from the number of dataset samples along each axis: A dataset with countX resp. countY samples along the X-axis resp. Y-axis will have these raster dimensions: The minimum resp. maximum raster size for a map is MinSize resp. MaxSize.

Map rasters can be rectangular or cubic (see MapType).

    (0|0)         (w|0) (s|0)
      +-------------+-----+              Y-
      |             |     |              |
      |             |     |              |
      |             |     |        X- ---O--- X+
      |             |     |              |
      |             |     |              |
(0|h) +-------------+     |              Y+
      |           (w|h)   |
      |                   |        w := raster width
      |                   |        h := raster height
      +-------------------+        s := internal raster size (power of two)
    (0|s)               (s|s)
The raster width w and height h of rectangular maps can have arbitrary values. The internal size s however is always a power of two and is greater than or equal to both w and h.
    (0|0|s)               (s|0|s)
          +-------------+            Y- |  / Z+
         /|            /|               | /
        / |           / |               |/
(0|0|0)/  |   (s|0|0)/  |        X- ----O---- X+
      +-------------+   |              /|
      |   |         |   |             / |
      |   +---------|---+         Z- /  | Y+
      |  /(0|s|s)   |  /(s|s|s)
      | /           | /          s := cubemap raster size (power of two)
      |/            |/           w := s
      +-------------+            h := s
(0|s|0)             (s|s|0)
The raster size s of a cubemap is always a power of two, and the raster width w and raster height h are equal to s.

Public / Attributes

Coverage

The pixel coverage semantic of the underlying dataset.

public readonly field Coverage
type PixelCoverage

Remarks:

For PixelIsPoint, dataset coordinates and raster coordinates are equivalent.

For PixelIsArea, the following relationship between dataset coordinates and raster coordinates exists:

raster  = dataset + 0.5
dataset = raster  - 0.5
where dataset resp. raster is a component of the dataset coordinates resp. raster coordinates.

Dataset

Returns the corresponding dataset size.

public property Dataset { get }
type Vec2I
value The dataset size, in dataset samples.

FaceFirst

Returns the minimum CubemapFace of the map.

public property FaceFirst { get }
type CubemapFace
value The minimum CubemapFace value.

FaceLast

Returns the maximum CubemapFace of the map.

public property FaceLast { get }
type CubemapFace
value The maximum CubemapFace value.

Height

The raster height of the map (edge length, not sample count).

public readonly field Height
type int32

See also:

MappingUtil.MinSize
MappingUtil.MaxSize

Size

The internal resp. cubemap raster size of the map (always a power of two).

public readonly field Size
type int32

See also:

MappingUtil.MinSize
MappingUtil.MaxSize

Type

The type of the map (rectangular or cubic).

public readonly field Type
type MapType

Width

The raster width of the map (edge length, not sample count).

public readonly field Width
type int32

See also:

MappingUtil.MinSize
MappingUtil.MaxSize

Public / Constructors

Cube

Creates a new instance of MapInfo for a cubic map raster (see Cube).

[Pure]
public static method Cube (int32 size = MappingUtil.MaxSize, PixelCoverage coverage = PixelCoverage.PixelIsPoint)
type MapInfo
params size [pow2] The raster size. Defaults to MaxSize.
  coverage The pixel coverage of the underlying dataset. Defaults to PixelIsPoint.
returns The map info value.

For

Creates a new instance of MapInfo for the given map type.

[Pure]
public static method For (MapType type, int32 width, int32 height, PixelCoverage coverage = PixelCoverage.PixelIsPoint)
type MapInfo
params type The map type.
  width [>0] The raster width.
  height [>0] The raster height.
  coverage The pixel coverage of the underlying dataset. Defaults to PixelIsPoint.
returns The map info value.

Rect

Creates a new instance of MapInfo for a rectangular map raster (see Rect).

[Pure]
public static method Rect (int32 width, int32 height, PixelCoverage coverage = PixelCoverage.PixelIsPoint)
type MapInfo
params width [>0] The raster width.
  height [>0] The raster height.
  coverage The pixel coverage of the underlying dataset. Defaults to PixelIsPoint.
returns The map info value.

Public / Methods

Equals

Compares this object with the given one.

[Pure]
public method Equals (MapInfo other)
type bool
params other The object to compare to.
returns true if this object is equal to other, false if not.

ToString

[Pure]
public override method ToString ()
type string