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

class Transforms in Tinman.Terrain.Util

Helper class for dealing with Transform values.

static class Transforms  

Configuration

Config

The configurator object for this type.

public static readonly field Config
type IConfigurator<Transform>

Public / Constants

First

The Transform with the minimum ordinal value.

public constant First = Transform.None
type Transform

Remarks:

Use this constant to iterate over all transforms.

Last

The Transform with the maximum ordinal value.

public constant Last = Transform.DiagonalInv
type Transform

Remarks:

Use this constant to iterate over all transforms.

Public / Methods

Combine

Solves an equation for transform concatenation.

[Pure]
public static method Combine (Transform first, Transform second)
type Transform
params first The transform to apply first.
  second The transform to apply second.
returns The resulting transform.

Remarks:

Given the following transform concatenation

result = first * second
this method computes result from the given values for first and second.

FlipY

Returns the transforms that corresponds to the given one in a coordinate system with a flipped Y-axis.

[Pure]
public static method FlipY (Transform transform)
type Transform
params transform The original transform.
returns The flipped transform.

FromMatrix

Returns the transform that corresponds to the given matrix.

[Pure]
public static method FromMatrix (float64 m11, float64 m12, float64 m21, float64 m22)
type int32
params m11 Matrix component in first row, first column.
  m12 Matrix component in first row, second column.
  m21 Matrix component in second row, first column.
  m22 Matrix component in second row, second column.
returns The Transform value or -1 if the matrix cannot be expressed with a simple transform.

Remarks:

The input matrix has the following form:

/                 \
|  S(m11)  S(m12)  |
|  S(m21)  S(m22)  |
\                 /
where S(x) refers to the Sign function.

Invert

Returns the inverse of the given transform.

[Pure]
public static method Invert (Transform transform)
type Transform
params transform The transform.
returns The inverse transform.

SolveLeft

Solves an equation for transform concatenation.

[Pure]
public static method SolveLeft (Transform second, Transform result)
type Transform
params second The transform to apply second.
  result The resulting transform.
returns The transform to apply first.

Remarks:

Given the following transform concatenation

result = first * second
this method computes first from the given values for second and result.

SolveRight

Solves an equation for transform concatenation.

[Pure]
public static method SolveRight (Transform first, Transform result)
type Transform
params first The transform to apply first.
  result The resulting transform.
returns The transform to apply second.

Remarks:

Given the following transform concatenation

result = first * second
this method computes second from the given values for first and result.

ToMat2D

Converts the given 2D transform into a matrix, assuming that the coordinate origin is at (0|0).

[Pure]
public static method ToMat2D (Transform transform)
type Mat2D
params transform The 2D transform.
returns The matrix.

ToMat2F

Converts the given 2D transform into a matrix, assuming that the coordinate origin is at (0|0).

[Pure]
public static method ToMat2F (Transform transform)
type Mat2F
params transform The 2D transform.
returns The matrix.

ToMat3D

Converts the given 2D transform into a matrix, using the given coordinate origin.

[Pure]
public static method ToMat3D (Transform transform, Vec2D center = default(Vec2D))
type Mat3D
params transform The 2D transform.
  center The coordinate origin. Defaults to Zero.
returns The matrix.

ToMat3F

Converts the given 2D transform into a matrix, using the given coordinate origin.

[Pure]
public static method ToMat3F (Transform transform, Vec2F center = default(Vec2F))
type Mat3F
params transform The 2D transform.
  center The coordinate origin. Defaults to Zero.
returns The matrix.

TransformPointD

Transforms the given point using the specified 2D transform.

[Pure]
public static method TransformPointD (float64 x, float64 y, Transform transform, float64 anchorX = 0, float64 anchorY = 0)
type Vec2D
params x X-coordinate of point to transform.
  y Y-coordinate of point to transform.
  transform The 2D transform to apply.
  anchorX X-coordinate of coordinate anchor. Defaults to 0.
  anchorY Y-coordinate of coordinate anchor. Defaults to 0.
returns The transformed point.

TransformPointI

Transforms the given point using the specified 2D transform.

[Pure]
public static method TransformPointI (int32 x, int32 y, Transform transform, int32 anchorX = 0, int32 anchorY = 0)
type Vec2I
params x X-coordinate of point to transform.
  y Y-coordinate of point to transform.
  transform The 2D transform to apply.
  anchorX X-coordinate of coordinate anchor. Defaults to 0.
  anchorY Y-coordinate of coordinate anchor. Defaults to 0.
returns The transformed point.

TransformPointL

Transforms the given point using the specified 2D transform.

[Pure]
public static method TransformPointL (int64 x, int64 y, Transform transform, int64 anchorX = 0, int64 anchorY = 0)
type Vec2L
params x X-coordinate of point to transform.
  y Y-coordinate of point to transform.
  transform The 2D transform to apply.
  anchorX X-coordinate of coordinate anchor. Defaults to 0.
  anchorY Y-coordinate of coordinate anchor. Defaults to 0.
returns The transformed point.

WillSwapAxes

Returns if the given Transform will swap the X- and Y-axes.

[Pure]
public static method WillSwapAxes (Transform transform)
type bool
params transform The transform.
returns true if transform swaps the X- and Y-axes, false if not.