Skip to content

Latest commit

 

History

History
166 lines (101 loc) · 12.2 KB

class_transform.rst

File metadata and controls

166 lines (101 loc) · 12.2 KB

Transform

Category: Built-In Types

Brief Description

3D Transformation. 3x4 matrix.

Member Functions

:ref:`Transform<class_transform>` :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 )
:ref:`Transform<class_transform>` :ref:`Transform<class_Transform_Transform>` ( :ref:`Basis<class_basis>` basis, :ref:`Vector3<class_vector3>` origin )
:ref:`Transform<class_transform>` :ref:`Transform<class_Transform_Transform>` ( :ref:`Transform2D<class_transform2d>` from )
:ref:`Transform<class_transform>` :ref:`Transform<class_Transform_Transform>` ( :ref:`Quat<class_quat>` from )
:ref:`Transform<class_transform>` :ref:`Transform<class_Transform_Transform>` ( :ref:`Basis<class_basis>` from )
:ref:`Transform<class_transform>` :ref:`affine_inverse<class_Transform_affine_inverse>` ( )
:ref:`Transform<class_transform>` :ref:`interpolate_with<class_Transform_interpolate_with>` ( :ref:`Transform<class_transform>` transform, :ref:`float<class_float>` weight )
:ref:`Transform<class_transform>` :ref:`inverse<class_Transform_inverse>` ( )
:ref:`Transform<class_transform>` :ref:`looking_at<class_Transform_looking_at>` ( :ref:`Vector3<class_vector3>` target, :ref:`Vector3<class_vector3>` up )
:ref:`Transform<class_transform>` :ref:`orthonormalized<class_Transform_orthonormalized>` ( )
:ref:`Transform<class_transform>` :ref:`rotated<class_Transform_rotated>` ( :ref:`Vector3<class_vector3>` axis, :ref:`float<class_float>` phi )
:ref:`Transform<class_transform>` :ref:`scaled<class_Transform_scaled>` ( :ref:`Vector3<class_vector3>` scale )
:ref:`Transform<class_transform>` :ref:`translated<class_Transform_translated>` ( :ref:`Vector3<class_vector3>` ofs )
var :ref:`xform<class_Transform_xform>` ( var v )
var :ref:`xform_inv<class_Transform_xform_inv>` ( var v )

Member Variables

Description

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.

Member Function Description

Constructs the Transform from four :ref:`Vector3<class_vector3>`. Each axis corresponds to local basis vectors (some of which may be scaled).

Constructs the Transform from a :ref:`Basis<class_basis>` and :ref:`Vector3<class_vector3>`.

Constructs the Transform from a :ref:`Transform2D<class_transform2d>`.

Constructs the Transform from a :ref:`Quat<class_quat>`. The origin will be Vector3(0, 0, 0).

Constructs the Transform from a :ref:`Basis<class_basis>`. The origin will be Vector3(0, 0, 0).

Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation.

Interpolates the transform to other Transform by weight amount (0-1).

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).

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.

Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors.

Rotates the transform around given axis by phi. The axis must be a normalized vector.

Scales the transform by the specified 3D scaling factors.

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.