Transform
3D Transformation. 3x4 matrix.
Properties
Transform ( x_axis, Vector3 y_axis, z_axis, Vector3 origin ) | |
Transform ( basis, Vector3 origin ) | |
Transform ( from ) | |
Transform | ( Quat from ) |
Transform ( from ) | |
Transform | ( ) |
Transform | ( Transform transform, weight ) |
Transform | ( ) |
Transform | ( Vector3 target, up ) |
Transform | ( ) |
Transform | ( Vector3 axis, phi ) |
Transform | ( Vector3 scale ) |
translated ( ofs ) | |
Variant | ( Variant v ) |
xform_inv ( v ) |
Constants
- IDENTITY = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) — Transform with no translation, rotation or scaling applied. When applied to other data structures, performs no transformation.
- FLIP_Y = Transform( 1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0 ) — Transform with mirroring applied perpendicular to the XZ plane.
- FLIP_Z = Transform( 1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0 ) — with mirroring applied perpendicular to the XY plane.
Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a Basis “basis” and an “origin”. It is similar to a 3x4 matrix.
Tutorials
- Basis basis
The basis is a matrix containing 3 as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.
- Vector3 origin
The translation offset of the transform.
Method Descriptions
Constructs the Transform from four Vector3. Each axis corresponds to local basis vectors (some of which may be scaled).
- Transform ( Basis basis, origin )
Constructs the Transform from a Basis and .
- Transform Transform ( from )
Constructs the Transform from a Quat. The origin will be Vector3(0, 0, 0).
- Transform ( Basis from )
Constructs the Transform from a . The origin will be Vector3(0, 0, 0).
- Transform affine_inverse ( )
Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation.
- interpolate_with ( Transform transform, weight )
Interpolates the transform to other Transform by weight amount (0-1).
- Transform inverse ( )
Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling).
- looking_at ( Vector3 target, up )
Returns a copy of the transform rotated such that its -Z axis points towards the position.
Operations take place in global space.
- Transform orthonormalized ( )
Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors.
- rotated ( Vector3 axis, phi )
Rotates the transform around given axis by phi. The axis must be a normalized vector.
- Transform scaled ( scale )
Scales the transform by the specified 3D scaling factors.
- Transform translated ( ofs )
Translates the transform by the specified offset.
Transforms the given Vector3, , or AABB by this transform.
- xform_inv ( Variant v )