Transform Structure |
Namespace: Godot
[SerializableAttribute] public struct Transform : IEquatable<Transform>
The Transform type exposes the following members.
| Name | Description | |
|---|---|---|
| Transform(Basis, Vector3) |
Constructs a transformation matrix from the given basis and origin vector.
| |
| Transform(Quat, Vector3) |
Constructs a transformation matrix from the given quaternion and origin vector.
| |
| Transform(Vector3, Vector3, Vector3, Vector3) |
Constructs a transformation matrix from 4 vectors (matrix columns).
|
| Name | Description | |
|---|---|---|
| FlipX |
The transform that will flip something along the X axis.
| |
| FlipY |
The transform that will flip something along the Y axis.
| |
| FlipZ |
The transform that will flip something along the Z axis.
| |
| Identity |
The identity transform, with no translation, rotation, or scaling applied.
This is used as a replacement for `Transform()` in GDScript.
Do not use `new Transform()` with no arguments in C#, because it sets all values to zero.
| |
| ItemInt32 |
Access whole columns in the form of Vector3. The fourth column is the origin vector.
| |
| ItemInt32, Int32 |
Access matrix elements in column-major order. The fourth column is the origin vector.
|
| Name | Description | |
|---|---|---|
| AffineInverse |
Returns the inverse of the transform, under the assumption that
the transformation is composed of rotation, scaling, and translation.
| |
| Equals(Object) | (Overrides ValueTypeEquals(Object).) | |
| Equals(Transform) | ||
| 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(Vector3) on each component.
| |
| LookingAt |
Returns a copy of the transform rotated such that its
-Z axis (forward) points towards the target position.
The transform will first be rotated around the given up vector,
and then fully aligned to the target by a further rotation around
an axis perpendicular to both the target and up vectors.
Operations take place in global space.
| |
| Orthonormalized |
Returns the transform with the basis orthogonal (90 degrees),
and normalized axis vectors (scale of 1 or -1).
| |
| Rotated |
Rotates the transform around the given `axis` by `phi` (in radians),
using matrix multiplication. The axis must be a normalized vector.
| |
| Scaled |
Scales the transform by the given 3D scaling factor, using matrix multiplication.
| |
| SetLookAt | ||
| ToString | (Overrides ValueTypeToString.) | |
| ToString(String) | ||
| Translated |
Translates the transform by the given `offset`,
relative to the transform's basis vectors.
Unlike Rotated(Vector3, Single) and Scaled(Vector3),
this does not use matrix multiplication.
| |
| Xform |
Returns a vector transformed (multiplied) by this transformation matrix.
| |
| XformInv |
Returns a vector transformed (multiplied) by the transposed transformation matrix.
Note: This results in a multiplication by the inverse of the
transformation matrix only if it represents a rotation-reflection.
|
| Name | Description | |
|---|---|---|
| Equality | ||
| Inequality | ||
| Multiply |
| Name | Description | |
|---|---|---|
| basis |
The Basis of this transform. Contains the X, Y, and Z basis
vectors (columns 0 to 2) and is responsible for rotation and scale.
| |
| origin |
The origin vector (column 3, the fourth column). Equivalent to array index `[3]`.
|