dot big bang

Developer API
Menu

Class Transform

All
  • Public
  • Public/Protected
  • All

Hierarchy

  • Transform

Index

Constructors

constructor

  • Creates a new Transform.

    Parameters

    • Optional position: Vector3

      The position part of the transform. Default is (0, 0, 0).

    • Optional rotation: Euler

      The rotation part of the transform. Default is (0, 0, 0, 'XYZ').

    • Optional scale: Vector3

      The scale part of the transform. Scale components with a value of zero or extremely close to zero can cause certain methods to not operate properly. Default is (1, 1, 1).

    Returns Transform

Accessors

position

  • The position part of this transform.

    Returns Vector3

rotation

  • The rotation part of this transform.

    Returns Euler

scale

  • The scale part of this transform. Scale components with a value of zero or extremely close to zero can cause certain methods to not operate properly.

    Returns Vector3

Methods

clone

  • Returns a new transform which is an exact copy of this one.

    Returns Transform

copy

  • Copies the provided transform into this one.

    Parameters

    Returns Transform

getForward

  • Returns the "forward" direction unit-vector corresponding to this transform.

    Parameters

    • Optional optionalTarget: Vector3

      If provided, the vector to recevie the result.

    Returns Vector3

getLeft

  • Returns the "left" direction unit-vector corresponding to this transform.

    Parameters

    • Optional optionalTarget: Vector3

      If provided, the vector to recevie the result.

    Returns Vector3

getMatrix

  • Returns the transform expressed as a Matrix4.

    Parameters

    • Optional optionalTarget: Matrix4

      If provided, a matrix to receive the result.

    Returns Matrix4

getUp

  • Returns the "up" direction unit-vector corresponding to this transform.

    Parameters

    • Optional optionalTarget: Vector3

      If provided, the vector to recevie the result.

    Returns Vector3

lookAt

  • Rotates this Transform to face a point in the same coordinate space. After this operation, the positive end of the object's local Z axis will face the point.

    Parameters

    • point: Vector3

      The location in our coordinate space to face towards.

    Returns Transform

set

  • Sets this transform by position, rotation and scale by copying the provided one

    Parameters

    Returns Transform

setFromMatrix

  • Sets this transform from a Matrix4.

    Parameters

    • matrix: Matrix4

      The matrix to set this transform from.

    Returns Transform

Static setMatrixFromPositionRotationScale

Static setMatrixFromTransform

  • Sets the Matrix4 matrix from the provided transform.

    Parameters

    • matrix: Matrix4

      The matrix to set from the transform.

    • transform: Transform

      The transform to set the matrix from.

    Returns void

Static setPositionRotationScaleFromMatrix

Static setTransformFromMatrix

  • Sets the transform from a Matrix4 matrix.

    Parameters

    • transform: Transform

      The transform to set from the matrix.

    • matrix: Matrix4

      The matrix to set the transform from.

    Returns void