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

class PointInfo in Tinman.Terrain.Meshing

Represents local information about a point on the terrain-surface.

class PointInfo  

See also:

Picking

Public / Attributes

Elevation

The terrain-space elevation.

public property Elevation { get set }
type float32
value The elevation value or 0 if not present (see Elevation).

Remarks:

If the given value is not a number (see IsNumber), the corresponding point info flag flag will be cleared.

See also:

Semantic.Elevation

Face

The cubemap face of the triangle that contains the point (derived from Heightmap and Vertices).

public property Face { get }
type CubemapFace
value The cubemap face.

FaceTangentX

Unit-length terrain-space tangent vector that corresponds to the cubemap face X-axis.

public property FaceTangentX { get set }
type Vec3F
value The tangent vector or Zero if not present (see FaceTangentX).

Remarks:

If the given value is undefined (see IsUndefined ), the corresponding point info flag flag will be cleared.

For rectangular terrains (see Rect), TangentX and FaceTangentX are equivalent.

FaceTangentY

Unit-length terrain-space tangent vector that corresponds to the cubemap face Y-axis.

public property FaceTangentY { get set }
type Vec3F
value The tangent vector or Zero if not present (see FaceTangentY).

Remarks:

If the given value is undefined (see IsUndefined ), the corresponding point info flag flag will be cleared.

For rectangular terrains (see Rect), TangentY and FaceTangentY are equivalent.

Flags

A bitmask that indicates which values have been computed and are thus valid.

public property Flags { get }
type PointInfoFlags
value The point info flags.

Heightmap

Heightmap coordinates of the picked point, relative to MaxSize.

public property Heightmap { get set }
type Vec3D
value The heightmap coordinates or Zero if not present (see Heightmap).

Remarks:

If the given value is undefined (see IsUndefined), the corresponding point info flag flag will be cleared.

Normal

Unit-length terrain-space normal vector.

public property Normal { get set }
type Vec3F
value The normal vector or Zero if not present (see Normal).

Position

The point position, in terrain-space.

public property Position { get set }
type Vec3D
value The point coordinates or Zero if not present (see Position).

TangentX

Unit-length terrain-space tangent vector that corresponds to the heightmap space X-axis.

public property TangentX { get set }
type Vec3F
value The tangent vector or Zero if not present (see TangentX).

Remarks:

If the given value is undefined (see IsUndefined ), the corresponding point info flag flag will be cleared.

For rectangular terrains (see Rect), TangentX and FaceTangentX are equivalent.

TangentY

Unit-length terrain-space tangent vector that corresponds to the heightmap space Y-axis.

public property TangentY { get set }
type Vec3F
value The tangent vector or Zero if not present (see TangentY).

Remarks:

If the given value is undefined (see IsUndefined ), the corresponding point info flag flag will be cleared.

For rectangular terrains (see Rect), TangentY and FaceTangentY are equivalent.

TangentZ

Unit-length terrain-space tangent vector that corresponds to the heightmap space Z-axis.

public property TangentZ { get set }
type Vec3F
value The tangent vector or Zero if not present (see TangentZ).

Remarks:

If the given value is undefined (see IsUndefined), the corresponding point info flag flag will be cleared.

Vertices

Indices of vertices of picked triangle.

public property Vertices { get set }
type Vec3I
value The vertex indices or Zero if not present (see Vertices).

Remarks:

The vertices of the picked triangle are oriented so that the vector cross(Y-X, Z-X) points into the direction of the triangle face normal.

Weights

The barycentric coordinates (range [0..1]) of picked point in picked triangle.

public property Weights { get set }
type Vec3D
value The barycentric weights or Zero if not present (see Weights).

Remarks:

If the given value is undefined (see IsUndefined ), the corresponding point info flag flag will be cleared.

The picked point can be expressed using barycentric coordinates as follows:

p = A * w1 + B * w2 + C * w3
where

p := the picked point
A := first vertex of picked triangle
B := second vertex of picked triangle
C := third vertex of picked triangle
w1 := first barycentric coordinate of picked point in picked triangle ( X)
w2 := second barycentric coordinate of picked point in picked triangle ( Y)
w3 := third barycentric coordinate of picked point in picked triangle ( Z)

The sum of the barycentric coordinates is always 1.0 (i.e. w1 + w2 + w3 = 1).

Public / Constructors

PointInfo

Creates a new instance of PointInfo.

public constructor PointInfo ()

Public / Methods

Clear

Clears all flags of this point info object and resets all values.

public method Clear ()

See also:

Flags

Compute

Computes missing point info values based on the available input data.

public method Compute (Int3 coords, Float1 elevation, Double3 position, Float3 normal, Float3 tangentX, Float3 tangentY, Float3 tangentZ, PointInfoFlags flags = PointInfoFlags.All)
params coords The heightmap coordinate vertex array (see HeightmapCoords) or null.
  elevation The elevation vertex array (see Elevation) or null.
  position The vertex position vertex array (see Position) or null.
  normal The normal vector vertex array (see Normal) or null.
  tangentX The tangent vector vertex array (see TangentX) or null.
  tangentY The tangent vector vertex array (see TangentY) or null.
  tangentZ The tangent vector vertex array (see TangentZ) or null.
  flags The point info flags of the values to compute.