Class Transform

Used to implement transformation related functions.

Hierarchy

  • Transform

Constructors

Properties

_dirtyFlag: number = TransformFlag.WmWpWeWqWs
_entity: Entity
_isParentDirty: boolean = true
_localMatrix: Matrix4 = ...
_lossyWorldScale: Vector3 = ...
_parentTransformCache: Transform = null
_position: Vector3 = ...
_rotation: Vector3 = ...
_rotationQuaternion: Quaternion = ...
_scale: Vector3 = ...
_updateFlagManager: UpdateFlagManager = ...
_worldMatrix: Matrix4 = ...
_worldPosition: Vector3 = ...
_worldRotation: Vector3 = ...
_worldRotationQuaternion: Quaternion = ...
_tempMat30: Matrix3 = ...
_tempMat31: Matrix3 = ...
_tempMat32: Matrix3 = ...
_tempMat41: Matrix4 = ...
_tempMat42: Matrix4 = ...
_tempQuat0: Quaternion = ...
_tempVec30: Vector3 = ...
_tempVec31: Vector3 = ...
_tempVec32: Vector3 = ...

Accessors

  • get lossyWorldScale(): Vector3
  • Local lossy scaling.

    Remarks

    The value obtained may not be correct under certain conditions(for example, the parent node has scaling, and the child node has a rotation), the scaling will be tilted. Vector3 cannot be used to correctly represent the scaling. Must use Matrix3.

    Returns Vector3

Methods

  • Parameters

    • type: number

    Returns boolean

  • Parameters

    • targetDirtyFlags: number

    Returns boolean

  • Parameters

    • x: number
    • y: number
    • z: number
    • relativeToLocal: boolean = true

    Returns void

  • Parameters

    • type: number

    Returns void

  • Parameters

    • type: number

    Returns void

  • Parameters

    • translation: Vector3
    • relativeToLocal: boolean = true

    Returns void

  • Update all world transform property dirty flag, the principle is the same as above.

    Returns void

  • Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities. Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities. Get worldRotationQuaternion: Will trigger the world rotation (in quaternion) update of itself and all parent entities. Get worldRotation: Will trigger the world rotation(in euler and quaternion) update of itself and world rotation(in quaternion) update of all parent entities. In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix or worldRotationQuaternion) to be false.

    Returns void

  • Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities. Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities. Get worldScale: Will trigger the scaling update of itself and all parent entities. In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix) to be false.

    Returns void

  • Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities. Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities. In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix or worldRotationQuaternion) to be false.

    Returns void

  • Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities. Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities. Get worldRotationQuaternion: Will trigger the world rotation (in quaternion) update of itself and all parent entities. Get worldRotation: Will trigger the world rotation(in euler and quaternion) update of itself and world rotation(in quaternion) update of all parent entities. In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix or worldRotationQuaternion) to be false.

    Returns void

  • Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities. Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities. Get worldScale: Will trigger the scaling update of itself and all parent entities. In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix) to be false.

    Returns void

  • Parameters

    • type: number

    Returns void

  • Rotate and ensure that the world front vector points to the target world position.

    Parameters

    • targetPosition: Vector3

      Target world position

    • Optional worldUp: Vector3

      Up direction in world space, default is Vector3(0, 1, 0)

    Returns void

  • Register world transform change flag.

    Returns

    Change flag

    Returns BoolUpdateFlag

  • Rotate around the passed Vector3.

    Parameters

    • rotation: Vector3

      Euler angle in degrees

    • Optional relativeToLocal: boolean

      Relative to local space

    Returns void

  • Rotate around the passed Vector3.

    Parameters

    • x: number

      Rotation along x axis, in degrees

    • y: number

      Rotation along y axis, in degrees

    • z: number

      Rotation along z axis, in degrees

    • Optional relativeToLocal: boolean

      Relative to local space

    Returns void

  • Rotate around the specified axis according to the specified angle.

    Parameters

    • axis: Vector3

      Rotate axis

    • angle: number

      Rotate angle in degrees

    • relativeToLocal: boolean = true

      Relative to local space

    Returns void

  • Set local position by X, Y, Z value.

    Parameters

    • x: number

      X coordinate

    • y: number

      Y coordinate

    • z: number

      Z coordinate

    Returns void

  • Set local rotation by the X, Y, Z components of the euler angle, unit in degrees. Rotations are performed around the Y axis, the X axis, and the Z axis, in that order.

    Parameters

    • x: number

      The angle of rotation around the X axis

    • y: number

      The angle of rotation around the Y axis

    • z: number

      The angle of rotation around the Z axis

    Returns void

  • Set local rotation by the X, Y, Z, and W components of the quaternion.

    Parameters

    • x: number

      X component of quaternion

    • y: number

      Y component of quaternion

    • z: number

      Z component of quaternion

    • w: number

      W component of quaternion

    Returns void

  • Set local scaling by scaling values along X, Y, Z axis.

    Parameters

    • x: number

      Scaling along X axis

    • y: number

      Scaling along Y axis

    • z: number

      Scaling along Z axis

    Returns void

  • Set world position by X, Y, Z value.

    Parameters

    • x: number

      X coordinate

    • y: number

      Y coordinate

    • z: number

      Z coordinate

    Returns void

  • Set world rotation by the X, Y, Z components of the euler angle, unit in degrees, Yaw/Pitch/Roll sequence.

    Parameters

    • x: number

      The angle of rotation around the X axis

    • y: number

      The angle of rotation around the Y axis

    • z: number

      The angle of rotation around the Z axis

    Returns void

  • Set local rotation by the X, Y, Z, and W components of the quaternion.

    Parameters

    • x: number

      X component of quaternion

    • y: number

      Y component of quaternion

    • z: number

      Z component of quaternion

    • w: number

      W component of quaternion

    Returns void

  • Translate along the passed Vector3.

    Parameters

    • translation: Vector3

      Direction and distance of translation

    • Optional relativeToLocal: boolean

      Relative to local space

    Returns void

  • Translate along the passed X, Y, Z value.

    Parameters

    • x: number

      Translate direction and distance along x axis

    • y: number

      Translate direction and distance along y axis

    • z: number

      Translate direction and distance along z axis

    • Optional relativeToLocal: boolean

      Relative to local space

    Returns void

Generated using TypeDoc