Transform

Affine Transformation matrix.

@nogc @safe pure nothrow
struct Transform (
T
uint Dim
TransformOptions options = TransformOptions.none
) if (
Dim > 0
) {}

Constructors

this
this(MatrixType mat)

Construct a Transform from matrix.

Alias This

matrix

Members

Aliases

ElementType
alias ElementType = T

Undocumented in source.

MatrixType
alias MatrixType = Matrix!(T, Dim + 1, Dim + 1)

The underlying matrix type

MatrixType
alias MatrixType = Matrix!(T, Dim + 1, Dim)

The underlying matrix type

fromZRotation
alias fromZRotation = fromRotation

Undocumented in source.

fromZRotationDegrees
alias fromZRotationDegrees = fromRotationDegrees

Undocumented in source.

rotateZ
alias rotateZ = rotate

Undocumented in source.

rotateZDegrees
alias rotateZDegrees = rotateDegrees

Undocumented in source.

rotatedZ
alias rotatedZ = rotated

Undocumented in source.

rotatedZDegrees
alias rotatedZDegrees = rotatedDegrees

Undocumented in source.

Functions

copyInto
auto ref copyInto(Transform!(T, Args) target)

Copy Transform contents into target transform of any dimension and options.

copyInto
auto ref copyInto(Matrix!(T, C, R) target)

Copy Transform contents into a matrix of Transform-like dimensions.

opBinary
auto opBinary(T[N] values)

Transform an array of values of any dimension.

opCast
U opCast()

Cast between Transform types of any dimension.

rotate
Transform rotate(FT angle)

Apply 2D rotation in-place. Params: angle = Rotation angle in radians Returns: this

rotateDegrees
auto rotateDegrees(FT degrees)

Apply 2D rotation in-place. Params: angle = Rotation angle in degrees

rotateX
Transform rotateX(FT angle)

Apply 3D rotation around the X axis in-place. Params: angle = Rotation angle in radians

rotateXDegrees
auto rotateXDegrees(FT degrees)

Apply 3D rotation around the X axis in-place. Params: angle = Rotation angle in degrees

rotateY
Transform rotateY(FT angle)

Apply 3D rotation around the Y axis in-place. Params: angle = Rotation angle in radians

rotateYDegrees
auto rotateYDegrees(FT degrees)

Apply 3D rotation around the Y axis in-place. Params: angle = Rotation angle in degrees

rotated
Transform rotated(FT angle)

Returns a rotated copy of Transform. Params: angle = Rotation angle in radians

rotatedDegrees
auto rotatedDegrees(FT degrees)

Returns a rotated copy of Transform. Params: angle = Rotation angle in degrees

rotatedX
Transform rotatedX(FT angle)

Returns a copy of Transform rotated around the X axis. Params: angle = Rotation angle in radians

rotatedXDegrees
auto rotatedXDegrees(FT degrees)

Returns a copy of Transform rotated around the X axis. Params: angle = Rotation angle in degrees

rotatedY
Transform rotatedY(FT angle)

Returns a copy of Transform rotated around the Y axis. Params: angle = Rotation angle in radians

rotatedYDegrees
auto rotatedYDegrees(FT degrees)

Returns a copy of Transform rotated around the Y axis. Params: angle = Rotation angle in degrees

scale
Transform scale(T[N] values)

Apply scaling in-place. Returns: this

scaled
Transform scaled(T[N] values)

Returns a scaled copy of Transform.

setIdentity
Transform setIdentity()

Reset a Transform to identity.

shear
Transform shear(T[N] values)

Apply shearing in-place. Returns: this

sheared
Transform sheared(T[N] values)

Returns a sheared copy of Transform.

transform
T[N] transform(T[N] values)

Transform an array of values of any dimension.

translate
Transform translate(T[N] values)

Apply translation in-place. Returns: this

translated
Transform translated(T[N] values)

Returns a translated copy of Transform.

Manifest constants

dimension
enum dimension;

Transform dimension.

identity
enum identity;

The identity Transform.

Static functions

fromRotation
Transform fromRotation(FT angle)

Constructs a new Transform representing a 2D rotation. Params: angle = Rotation angle in radians

fromRotationDegrees
auto fromRotationDegrees(FT degrees)

Constructs a new Transform representing a 2D rotation. Params: angle = Rotation angle in degrees

fromScaling
Transform fromScaling(T[N] values)

Constructs a new Transform representing a scaling.

fromShearing
Transform fromShearing(T[N] values)

Constructs a new Transform representing a shearing.

fromTranslation
Transform fromTranslation(T[N] values)

Constructs a new Transform representing a translation.

fromXRotation
Transform fromXRotation(FT angle)

Constructs a new Transform representing a 3D rotation aroud the X axis. Params: angle = Rotation angle in radians

fromXRotationDegrees
auto fromXRotationDegrees(FT degrees)

Constructs a new Transform representing a 3D rotation aroud the X axis. Params: angle = Rotation angle in degrees

fromYRotation
Transform fromYRotation(FT angle)

Constructs a new Transform representing a 3D rotation aroud the Y axis. Params: angle = Rotation angle in radians

fromYRotationDegrees
auto fromYRotationDegrees(FT degrees)

Constructs a new Transform representing a 3D rotation aroud the Y axis. Params: angle = Rotation angle in degrees

Variables

isCompact
enum bool isCompact;

Whether Transform is compact.

matrix
MatrixType matrix;

The underlying matrix.

Meta