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.

rotateDegrees
auto rotateDegrees(FT degrees)

Apply 2D rotation in-place.

rotateX
Transform rotateX(FT angle)

Apply 3D rotation around the X axis in-place.

rotateXDegrees
auto rotateXDegrees(FT degrees)

Apply 3D rotation around the X axis in-place.

rotateY
Transform rotateY(FT angle)

Apply 3D rotation around the Y axis in-place.

rotateYDegrees
auto rotateYDegrees(FT degrees)

Apply 3D rotation around the Y axis in-place.

rotated
Transform rotated(FT angle)

Returns a rotated copy of Transform.

rotatedDegrees
auto rotatedDegrees(FT degrees)

Returns a rotated copy of Transform.

rotatedX
Transform rotatedX(FT angle)

Returns a copy of Transform rotated around the X axis.

rotatedXDegrees
auto rotatedXDegrees(FT degrees)

Returns a copy of Transform rotated around the X axis.

rotatedY
Transform rotatedY(FT angle)

Returns a copy of Transform rotated around the Y axis.

rotatedYDegrees
auto rotatedYDegrees(FT degrees)

Returns a copy of Transform rotated around the Y axis.

scale
Transform scale(T[N] values)

Apply scaling in-place.

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.

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.

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.

fromRotationDegrees
auto fromRotationDegrees(FT degrees)

Constructs a new Transform representing a 2D rotation.

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.

fromXRotationDegrees
auto fromXRotationDegrees(FT degrees)

Constructs a new Transform representing a 3D rotation aroud the X axis.

fromYRotation
Transform fromYRotation(FT angle)

Constructs a new Transform representing a 3D rotation aroud the Y axis.

fromYRotationDegrees
auto fromYRotationDegrees(FT degrees)

Constructs a new Transform representing a 3D rotation aroud the Y axis.

Variables

isCompact
enum bool isCompact;

Whether Transform is compact.

matrix
MatrixType matrix;

The underlying matrix.

Parameters

T

Value types, should be numeric

Dim

Space dimensions, pass 2 for 2D, 3 for 3D, etc...

options

Additional options

Meta