Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Transform

Defines the position, scale and rotation of an item.

Every Transform can be assigned to a BaseItem.parent which allows hierarchical editing of their position, scale and rotation. Created hierarchies are displayed in the Item Hierarchy tab.

Hierarchy

Index

Properties

axisX

axisX: Vector3

Red axis of this Transform.

axisY

axisY: Vector3

Green axis of this Transform.

axisZ

axisZ: Vector3

Blue axis of this Transform.

forward

forward: Vector3

Shorthand for Y - axis.

Note: By default, DX Engine uses the green Y axis as forward vector.

position

position: Vector3

right

right: Vector3

Shorthand for X - axis.

Note: By default, DX Engine uses the red X axis as right vector.

rotation

rotation: Quat

scale

scale: number

up

Shorthand for Z - axis.

Note: By default, DX Engine uses the Z axis as up vector.

Methods

apply

  • Additively applies values of another Transform to this Transform.

    Parameters

    Returns Transform

compose

  • Returns a new Transform created by combining this and other.

    Parameters

    Returns Transform

    new Transform.

copy

invert

  • Inverts all values of this Transform.

    Returns Transform

localToWorldPoint

localToWorldVector

lookAt

  • Rotates this Transform so that the forward vector points to the worldPosition.

    Note: By default, DX engine uses Y axis as forward vector.

    Parameters

    • worldPosition: Vector3

      point to look at.

    • worldUp: Vector3

      upward direction.

    Returns Transform

  • Rotates this Transform so that the forward vector points to the worldPosition.

    Note: By default, DX engine uses Y axis as forward vector.

    Parameters

    • worldPosition: Vector3

      point to look at.

    Returns Transform

multScale

  • Multiplies this Transform current scale by scale

    Parameters

    • scaleFactor: number

    Returns Transform

rotate

  • Rotates this Transform by angleInRadians around an origin point using axis as rotation direction.

    Parameters

    • origin: Vector3

      world space position to rotate around.

    • axis: Vector3

      rotation axis.

    • angleInRadians: number

      rotation in radians.

    Returns Transform

  • Rotates this Transform by angleInRadians around world position (0,0,0) towards axis direction.

    Parameters

    • axis: Vector3

      rotation axis.

    • angleInRadians: number

      rotation in radians.

    Returns Transform

rotateLocal

  • Rotates this Transform by angleInRadians around an offset towards axis direction.

    Parameters

    • offset: Vector3

      offset relative to current position.

    • axis: Vector3

      rotation axis.

    • angleInRadians: number

      rotation in radians.

    Returns Transform

  • Rotates this Transform by angleInRadians around its pivot towards axis direction.

    Parameters

    • axis: Vector3

      rotation axis.

    • angleInRadians: number

      rotation in radians.

    Returns Transform

set

  • Sets values of this Transform to another Transform.

    Parameters

    Returns Transform

setDirection

  • Rotates this Transform so that

    • its local Y-axis points towards the defined direction.
    • its local Z-axis points towards the worldUp direction.

    Note: The local Z-axis always attempts to be perpendicular to Y, which may lead to worldUp not always accurately pointed at.

    Parameters

    • direction: Vector3

      euler rotation to apply.

    • worldUp: Vector3

      upward direction.

    Returns Transform

  • Rotates this Transform so that

    • its local Y-axis points towards the defined direction.

    Parameters

    Returns Transform

swapYZ

  • Swaps Y and Z axes of this `Transform.

    Returns Transform

translate

  • Moves this Transform by translation.

    Parameters

    • translation: Vector3

      translation relative to world coordinate system.

    Returns Transform

translateLocal

  • Moves this Transform by translation.

    Parameters

    • translation: Vector3

      translation relative to this Transform.

    Returns Transform

worldToLocalPoint

worldToLocalVector

Generated using TypeDoc