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

interface IGeometry in Tinman.Terrain.Geometries

Represents the base geometry of a terrain in terrain-space. The center of the terrain always resides at the coordinate origin in terrain-space.

interface IGeometry extends IMapInfo
  base of GeometryBase

Attributes

Handedness

Returns the handedness of this geometry object.

[ThreadSafe]
property Handedness { get }
type CartesianHandedness
value The coordinate system handedness.

Remarks:

The handedness of a geometry is taken into account when vertex normal vectors are computed: Normal vectors are computed from vertex positions using a counter-clockwise winding in heightmap space. Since heightmap space is always right-handed, all computed normal vectors must be flipped when the application uses a left-handed world coordinate system.

Map

Returns a MapInfo value that describes the used map raster.

property Map { get }
type MapInfo
value The map info value.
inherited IMapInfo.Map

ToGeocentric

Returns an instance of Geocentric that corresponds to this geometry.

property ToGeocentric { get }
type Geocentric
value The Geocentric object or null if this is a custom geometry object.

Unit

The terrain-space unit.

property Unit { get }
type UnitOfMeasure
value [not-null] The terrain-space unit.

Remarks:

The default unit is Metre.

Methods

ComputeCoordinates

Computes the heightmap coordinates that correspond to the given geographic coordinates.

[ThreadSafe]
method ComputeCoordinates (LatLon geographic)
type Vec3D
params geographic The geographic coordinates.
returns The heightmap coordinates or Undefined is this geometry object is not geo-referenced (see ToGeocentric).

Computes the heightmap coordinates and elevation that correspond to the given position.

[ThreadSafe]
method ComputeCoordinates (float64 positionX, float64 positionY, float64 positionZ, out Vec3D heightmap)
type float64
params positionX X-coordinate of position in terrain-space.
  positionY Y-coordinate of position in terrain-space.
  positionZ Z-coordinate of position in terrain-space.
  heightmap Output for heightmap coordinates.
returns The terrain-space elevation, in terrain-space units (see Unit).

ComputeLatLon

Computes the geographic coordinates that correspond to the given heightmap coordinates.

[ThreadSafe]
method ComputeLatLon (float64 heightmapX, float64 heightmapY, float64 heightmapZ)
type LatLon
params heightmapX The heightmap X-coordinate.
  heightmapY The heightmap Y-coordinate.
  heightmapZ The heightmap Z-coordinate.
returns The geographic coordinates or Undefined if this geometry object is not geo-referenced (see ToGeocentric).

ComputeNorth

Computes the vertex north-vector for the given heightmap coordinates.

[ThreadSafe]
method ComputeNorth (float64 heightmapX, float64 heightmapY, float64 heightmapZ)
type Vec3D
params heightmapX The heightmap X-coordinate.
  heightmapY The heightmap Y-coordinate.
  heightmapZ The heightmap Z-coordinate.
returns The unit-length vertex north-vector.

Remarks:

The north-vector is perpendicular to the up-vector and points towards the terrain North Pole, which is defined by the implementing class and can assume different meanings.

ComputePosition

Computes the vertex position that corresponds to the given heightmap coordinates and elevation.

[ThreadSafe]
method ComputePosition (float64 heightmapX, float64 heightmapY, float64 heightmapZ, float64 elevation, out Vec3D position, out Vec3D up)
params heightmapX The heightmap X-coordinate.
  heightmapY The heightmap Y-coordinate.
  heightmapZ The heightmap Z-coordinate.
  elevation The terrain-space elevation, in terrain-space units (see Unit).
  position Output for vertex position.
  up Output for unit-length up-vector.
returns The vertex position.

ComputeUp

Computes the vertex up-vector for the given heightmap coordinates.

[ThreadSafe]
method ComputeUp (float64 heightmapX, float64 heightmapY, float64 heightmapZ)
type Vec3D
params heightmapX The heightmap X-coordinate.
  heightmapY The heightmap Y-coordinate.
  heightmapZ The heightmap Z-coordinate.
returns The unit-length vertex up-vector.

ToHandedness

Transforms this geometry to the given handedness by flipping the Z-axis if necessary.

method ToHandedness (CartesianHandedness handedness)
type IGeometry
params handedness The requested handedness.
returns [not-null] The resulting geometry.

Transform

Creates a geometry that transforms the output coordinates of this geometry with the given matrix.

method Transform (Mat4D matrix)
type IGeometry
params matrix The transformation matrix.
returns [not-null] The resulting geometry.

Extensions

BoundingSphere

Computes the bounding sphere that contains all vertex positions generated by this IGeometry object for elevation values in the given range.

[ThreadSafe]
method BoundingSphere (float64 elevationMax = 0, float64 elevationMin = 0)
type Sphere
params elevationMax The maximum terrain-space elevation value. Defaults to 0.
  elevationMin The minimum terrain-space elevation value. Defaults to 0.
returns [>0] The bounding sphere, in terrain-space.

Computes the bounding sphere that contains all vertex positions generated by this IGeometry object for elevation values in the given range.

[ThreadSafe]
method BoundingSphere (VerticalRange range, UnitOfMeasure unit = null)
type Sphere
params range The elevation range, in unit s.
  unit The elevation range unit. If null, terrain-space is used (see Unit). Defaults to null.
returns [>0] The bounding sphere, in terrain-space.

ComputeCoordinates

Computes the heightmap coordinates and elevation that correspond to the given position.

[ThreadSafe]
method ComputeCoordinates (Vec3I position, out Vec3D heightmap)
type float64
params position The position in terrain-space.
  heightmap Output for heightmap coordinates.
returns The terrain-space elevation.

Computes the heightmap coordinates and elevation that correspond to the given position.

[ThreadSafe]
method ComputeCoordinates (Vec3D position, out Vec3D heightmap)
type float64
params position The position in terrain-space.
  heightmap Output for heightmap coordinates.
returns The terrain-space elevation.

ComputeDerivative

Computes the partial derivatives of the vertex position that corresponds to the given heightmap coordinates and elevation.

[ThreadSafe]
method ComputeDerivative (CubemapFaceCoordsI coords, out Vec3D dFaceX, out Vec3D dFaceY, float64 elevation = 0)
params coords The cubemap face coordinates.
  dFaceX Output for partial derivative vector along cubemap face X-axis.
  dFaceY Output for partial derivative vector along cubemap face Y-axis.
  elevation The terrain-space elevation. Defaults to 0.
returns The vertex position.

Computes the partial derivatives of the vertex position that corresponds to the given heightmap coordinates and elevation.

[ThreadSafe]
method ComputeDerivative (CubemapFaceCoordsD coords, out Vec3D dFaceX, out Vec3D dFaceY, float64 elevation = 0)
params coords The cubemap face coordinates.
  dFaceX Output for partial derivative vector along cubemap face X-axis.
  dFaceY Output for partial derivative vector along cubemap face Y-axis.
  elevation The terrain-space elevation. Defaults to 0.
returns The vertex position.

Computes the partial derivatives vertex position that corresponds to the given heightmap coordinates and elevation.

[ThreadSafe]
method ComputeDerivative (float64 faceX, float64 faceY, CubemapFace face, out Vec3D dFaceX, out Vec3D dFaceY, float64 elevation = 0)
params faceX The cubemap face X-coordinate.
  faceY The cubemap face Y-coordinate.
  face The cubemap face.
  dFaceX Output for partial derivative vector along cubemap face X-axis.
  dFaceY Output for partial derivative vector along cubemap face Y-axis.
  elevation The terrain-space elevation. Defaults to 0.
returns The vertex position.

ComputeLatLon

Computes the geographic coordinates that correspond to the given heightmap coordinates.

[ThreadSafe]
method ComputeLatLon (Vec3I heightmap)
type LatLon
params heightmap The heightmap coordinates.
returns The geographic coordinates or Undefined if this geometry object is not geo-referenced (see ToGeocentric).

Computes the geographic coordinates that correspond to the given heightmap coordinates.

[ThreadSafe]
method ComputeLatLon (Vec3D heightmap)
type LatLon
params heightmap The heightmap coordinates.
returns The geographic coordinates or Undefined if this geometry object is not geo-referenced (see ToGeocentric).

ComputeLocal

Computes a local coordinate system for the given heightmap coordinates.

[ThreadSafe]
method ComputeLocal (Vec3I heightmap)
type Mat3D
params heightmap The heightmap coordinates.
returns The orthogonal matrix that transforms from local coordinate space to terrain space, without translation.

Remarks:

The coordinate system axes are defined as follows:


Computes a local coordinate system for the given heightmap coordinates.

[ThreadSafe]
method ComputeLocal (Vec3D heightmap)
type Mat3D
params heightmap The heightmap coordinates.
returns The orthogonal matrix that transforms from local coordinate space to terrain space, without translation.

Remarks:

The coordinate system axes are defined as follows:


Computes a local coordinate system for the given heightmap coordinates.

[ThreadSafe]
method ComputeLocal (float64 heightmapX, float64 heightmapY, float64 heightmapZ)
type Mat3D
params heightmapX The heightmap X-coordinate.
  heightmapY The heightmap Y-coordinate.
  heightmapZ The heightmap Z-coordinate.
returns The orthogonal matrix that transforms from local coordinate space to terrain space, without translation.

Remarks:

The coordinate system axes are defined as follows:

ComputeNorth

Computes the vertex north-vector for the given heightmap coordinates.

[ThreadSafe]
method ComputeNorth (Vec3I heightmap)
type Vec3D
params heightmap The heightmap coordinates.
returns The unit-length vertex north-vector.

Remarks:

The north-vector is perpendicular to the up-vector and points towards the terrain North Pole, which is defined by the implementing class and can assume different meanings.


Computes the vertex north-vector for the given heightmap coordinates.

[ThreadSafe]
method ComputeNorth (Vec3D heightmap)
type Vec3D
params heightmap The heightmap coordinates.
returns The unit-length vertex north-vector.

Remarks:

The north-vector is perpendicular to the up-vector and points towards the terrain North Pole, which is defined by the implementing class and can assume different meanings.

ComputePosition

Computes the vertex position that corresponds to the given heightmap coordinates and elevation.

[ThreadSafe]
method ComputePosition (Vec3I heightmap, float64 elevation = 0)
type Vec3D
params heightmap The heightmap coordinates.
  elevation The terrain-space elevation. Defaults to 0.
returns The vertex position.

Computes the vertex position that corresponds to the given heightmap coordinates and elevation.

[ThreadSafe]
method ComputePosition (Vec3D heightmap, float64 elevation = 0)
type Vec3D
params heightmap The heightmap coordinates.
  elevation The terrain-space elevation. Defaults to 0.
returns The vertex position.

Computes the vertex position that corresponds to the given heightmap coordinates and elevation.

[ThreadSafe]
method ComputePosition (float64 heightmapX, float64 heightmapY, float64 heightmapZ, float64 elevation = 0)
type Vec3D
params heightmapX The heightmap X-coordinate.
  heightmapY The heightmap Y-coordinate.
  heightmapZ The heightmap Z-coordinate.
  elevation The terrain-space elevation. Defaults to 0.
returns The vertex position.

Computes the vertex position that corresponds to the given heightmap coordinates and elevation.

[ThreadSafe]
method ComputePosition (Vec3I heightmap, float64 elevation, out Vec3D position, out Vec3D up)
params heightmap The heightmap coordinates.
  elevation The terrain-space elevation.
  position Output for vertex position.
  up Output for unit-length up-vector.

Computes the vertex position that corresponds to the given heightmap coordinates and elevation.

[ThreadSafe]
method ComputePosition (Vec3D heightmap, float64 elevation, out Vec3D position, out Vec3D up)
params heightmap The heightmap coordinates.
  elevation The terrain-space elevation.
  position Output for vertex position.
  up Output for unit-length up-vector.

ComputeUp

Computes the vertex up-vector for the given heightmap coordinates.

[ThreadSafe]
method ComputeUp (Vec3I heightmap)
type Vec3D
params heightmap The heightmap coordinates.
returns The unit-length vertex up-vector.

Computes the vertex up-vector for the given heightmap coordinates.

[ThreadSafe]
method ComputeUp (Vec3D heightmap)
type Vec3D
params heightmap The heightmap coordinates.
returns The unit-length vertex up-vector.

Scale

Returns a scaled version of this geometry.

method Scale (float64 scale)
type IGeometry
params scale The scale factor.
returns [not-null] The resulting geometry.

ToUnit

Scales this geometry to the given terrain-space unit.

method ToUnit (UnitOfMeasure unit)
type IGeometry
params unit [not-null] The new terrain-space unit.
returns [not-null] The resulting geometry.