Transform2D Structure |
Namespace: Godot
[SerializableAttribute] public struct Transform2D : IEquatable<Transform2D>
The Transform2D type exposes the following members.
Name | Description | |
---|---|---|
![]() | Transform2D(Single, Vector2) |
Constructs a transformation matrix from a rotation value and origin vector.
|
![]() | Transform2D(Vector2, Vector2, Vector2) |
Constructs a transformation matrix from 3 vectors (matrix columns).
|
![]() | Transform2D(Single, Single, Single, Single, Single, Single) |
Constructs a transformation matrix from the given components.
Arguments are named such that xy is equal to calling x.y
|
Name | Description | |
---|---|---|
![]() ![]() | FlipX |
The transform that will flip something along the X axis.
|
![]() ![]() | FlipY |
The transform that will flip something along the Y axis.
|
![]() ![]() | Identity |
The identity transform, with no translation, rotation, or scaling applied.
This is used as a replacement for `Transform2D()` in GDScript.
Do not use `new Transform2D()` with no arguments in C#, because it sets all values to zero.
|
![]() | ItemInt32 |
Access whole columns in the form of Vector2. The third column is the origin vector.
|
![]() | ItemInt32, Int32 |
Access matrix elements in column-major order. The third column is the origin vector.
|
![]() | Rotation |
The rotation of this transformation matrix.
|
![]() | Scale |
The scale of this transformation matrix.
|
Name | Description | |
---|---|---|
![]() | AffineInverse |
Returns the inverse of the transform, under the assumption that
the transformation is composed of rotation, scaling, and translation.
|
![]() | BasisXform |
Returns a vector transformed (multiplied) by the basis matrix.
This method does not account for translation (the origin vector).
|
![]() | BasisXformInv |
Returns a vector transformed (multiplied) by the inverse basis matrix.
This method does not account for translation (the origin vector).
Note: This results in a multiplication by the inverse of the
basis matrix only if it represents a rotation-reflection.
|
![]() | Equals(Object) | (Overrides ValueTypeEquals(Object).) |
![]() | Equals(Transform2D) | |
![]() | GetHashCode | (Overrides ValueTypeGetHashCode.) |
![]() | GetType | (Inherited from Object.) |
![]() | InterpolateWith |
Interpolates this transform to the other `transform` by `weight`.
|
![]() | Inverse |
Returns the inverse of the transform, under the assumption that
the transformation is composed of rotation and translation
(no scaling, use AffineInverse for transforms with scaling).
|
![]() | IsEqualApprox |
Returns true if this transform and `other` are approximately equal, by running
IsEqualApprox(Vector2) on each component.
|
![]() | Orthonormalized |
Returns the transform with the basis orthogonal (90 degrees),
and normalized axis vectors (scale of 1 or -1).
|
![]() | Rotated |
Rotates the transform by `phi` (in radians), using matrix multiplication.
|
![]() | Scaled |
Scales the transform by the given scaling factor, using matrix multiplication.
|
![]() | ToString | (Overrides ValueTypeToString.) |
![]() | ToString(String) | |
![]() | Translated |
Translates the transform by the given `offset`,
relative to the transform's basis vectors.
Unlike Rotated(Single) and Scaled(Vector2),
this does not use matrix multiplication.
|
![]() | Xform |
Returns a vector transformed (multiplied) by this transformation matrix.
|
![]() | XformInv |
Returns a vector transformed (multiplied) by the inverse transformation matrix.
|
Name | Description | |
---|---|---|
![]() ![]() | Equality | |
![]() ![]() | Inequality | |
![]() ![]() | Multiply |
Name | Description | |
---|---|---|
![]() | origin |
The origin vector (column 2, the third column). Equivalent to array index `[2]`.
The origin vector represents translation.
|
![]() | x |
The basis matrix's X vector (column 0). Equivalent to array index `[0]`.
|
![]() | y |
The basis matrix's Y vector (column 1). Equivalent to array index `[1]`.
|