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

struct MapWrap in Tinman.Terrain.Mapping

Implements coordinate wrapping behaviour for rectangular map rasters.

struct MapWrap  

Remarks

A rectangular map has two MapWrap values, one for each axis.

For a map of size S, valid coordinate values C lie within the range [0..S]. Valid coordinate values will remain unchanged when passed to Coordinate. All other coordinate values will be modified according to the specified behaviour (see Clamp, Void and Wrap).

Public / Attributes

IsClampMax

Map coordinates are clamped at Size?

public property IsClampMax { get }
type bool
value true if coordinates are clamped, false if not.

IsClampMin

Map coordinates are clamped at 0?

public property IsClampMin { get }
type bool
value true if coordinates are clamped, false if not.

IsWrap

Map coordinates wrap around at [0..Size]?

public property IsWrap { get }
type bool
value true if coordinates wrap, false if not.

Size

The map size (edge length, not sample count).

public property Size { get }
type int32
value [>0] The map size.

Public / Constructors

Clamp

Clamps map coordinates to the range [0..size].

public static method Clamp (int32 size, bool min = true, bool max = true)
type MapWrap
params size [>0] The map size (edge length, not sample count).
  min Clamp at minimum bound (0)? Defaults to true.
  max Clamp at maximum bound (size)? Defaults to true.
returns The map wrapping behaviour.

Void

Coordinates outside of the range [0..size] are considered to be void.

public static method Void (int32 size)
type MapWrap
params size [>0] The map size (edge length, not sample count).
returns The map wrapping behaviour.

Wrap

Wraps map coordinates to the range [0..size].

public static method Wrap (int32 size)
type MapWrap
params size [>0] The map size (edge length, not sample count).
returns The map wrapping behaviour.

Public / Methods

Coordinate

Wraps the given map coordinate.

public method Coordinate (int32 coordinate)
type int32
params coordinate The map coordinate.
returns [0..Size] The wrapped map or clamped coordinate.
[<0] If the coordinate refers to a void sample.

Wraps the given map coordinate.

public method Coordinate (float64 coordinate)
type float64
params coordinate The map coordinate.
returns [0..Size] The wrapped map or clamped coordinate.
[<0] If the coordinate refers to a void sample.