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

Constructors

Properties

axisX: Vector3

Red axis of this Transform.

axisY: Vector3

Green axis of this Transform.

axisZ: Vector3

Blue axis of this Transform.

forward: Vector3

Shorthand for Y - axis.

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

position: Vector3

Position of this Transform using X, Y, and Z coordinates.

Note: By default, DX engine uses Z for "up".

right: Vector3

Shorthand for X - axis.

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

rotation: Quat

Rotation of this Transform stored as Quat.

scale: number

Scale of this Transform.

Default value is 1.

Shorthand for Z - axis.

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

Methods

  • Additively applies values of another Transform to this Transform.

    Parameters

    Returns Transform

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

    Parameters

    Returns Transform

    new Transform.

  • Inverts all values of this Transform.

    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.

    • 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

  • Multiplies this Transform current scale by scale

    Parameters

    • scaleFactor: number

    Returns Transform

  • 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

  • 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

  • Sets values of this Transform to another Transform.

    Parameters

    Returns Transform

  • 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

  • Swaps Y and Z axes of this `Transform.

    Returns Transform

  • Moves this Transform by translation.

    Parameters

    • translation: Vector3

      translation relative to world coordinate system.

    Returns Transform

  • Moves this Transform by translation.

    Parameters

    • translation: Vector3

      translation relative to this Transform.

    Returns Transform