Category: Built-In Types
3D Transformation. 3x4 matrix.
- :ref:`Basis<class_basis>` basis - The basis is a matrix containing 3 :ref:`Vector3<class_vector3>` 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.
- :ref:`Vector3<class_vector3>` origin - The translation offset of the transform.
Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a :ref:`Basis<class_basis>` "basis" and an :ref:`Vector3<class_vector3>` "origin". It is similar to a 3x4 matrix.
- :ref:`Transform<class_transform>` Transform ( :ref:`Vector3<class_vector3>` x_axis, :ref:`Vector3<class_vector3>` y_axis, :ref:`Vector3<class_vector3>` z_axis, :ref:`Vector3<class_vector3>` origin )
Constructs the Transform from four :ref:`Vector3<class_vector3>`. Each axis corresponds to local basis vectors (some of which may be scaled).
- :ref:`Transform<class_transform>` Transform ( :ref:`Basis<class_basis>` basis, :ref:`Vector3<class_vector3>` origin )
Constructs the Transform from a :ref:`Basis<class_basis>` and :ref:`Vector3<class_vector3>`.
- :ref:`Transform<class_transform>` Transform ( :ref:`Transform2D<class_transform2d>` from )
Constructs the Transform from a :ref:`Transform2D<class_transform2d>`.
- :ref:`Transform<class_transform>` Transform ( :ref:`Quat<class_quat>` from )
Constructs the Transform from a :ref:`Quat<class_quat>`. The origin will be Vector3(0, 0, 0).
- :ref:`Transform<class_transform>` Transform ( :ref:`Basis<class_basis>` from )
Constructs the Transform from a :ref:`Basis<class_basis>`. The origin will be Vector3(0, 0, 0).
- :ref:`Transform<class_transform>` affine_inverse ( )
Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation.
- :ref:`Transform<class_transform>` interpolate_with ( :ref:`Transform<class_transform>` transform, :ref:`float<class_float>` weight )
Interpolates the transform to other Transform by weight amount (0-1).
- :ref:`Transform<class_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).
- :ref:`Transform<class_transform>` looking_at ( :ref:`Vector3<class_vector3>` target, :ref:`Vector3<class_vector3>` up )
Returns a copy of the transform rotated such that its -Z axis 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.
- :ref:`Transform<class_transform>` orthonormalized ( )
Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors.
- :ref:`Transform<class_transform>` rotated ( :ref:`Vector3<class_vector3>` axis, :ref:`float<class_float>` phi )
Rotates the transform around given axis by phi. The axis must be a normalized vector.
- :ref:`Transform<class_transform>` scaled ( :ref:`Vector3<class_vector3>` scale )
Scales the transform by the specified 3D scaling factors.
- :ref:`Transform<class_transform>` translated ( :ref:`Vector3<class_vector3>` ofs )
Translates the transform by the specified offset.
- var xform ( var v )
Transforms the given vector "v" by this transform.
- var xform_inv ( var v )
Inverse-transforms the given vector "v" by this transform.