Skip to main content

Transform

Index

Constructors

constructor

Accessors

children

globalPos

globalRotation

  • get globalRotation(): number
  • set globalRotation(rotation: number): void
  • Returns number

  • Parameters

    • rotation: number

    Returns void

globalScale

globalZ

  • get globalZ(): number
  • set globalZ(z: number): void
  • Returns number

  • Parameters

    • z: number

    Returns void

publicinverse

  • Calculates and returns the inverse matrix representation of this transform


    Returns AffineMatrix

publicmatrix

  • Calculates and returns the matrix representation of this transform

    Avoid mutating the matrix to update the transform, it is not the source of truth. Update the transform pos, rotation, scale.


    Returns AffineMatrix

parent

pos

rotation

  • get rotation(): number
  • set rotation(rotation: number): void
  • Returns number

  • Parameters

    • rotation: number

    Returns void

scale

z

  • get z(): number
  • set z(z: number): void
  • Returns number

  • Parameters

    • z: number

    Returns void

Methods

publicapply

publicapplyInverse

publicclone

  • Clones the current transform Warning does not clone the parent


    Parameters

    Returns Transform

publiccloneWithParent

  • Clones but keeps the same parent reference


    Parameters

    Returns Transform

publicflagDirty

  • flagDirty(): void
  • Returns void

publicisMirrored

  • isMirrored(): boolean
  • Returns true if the transform has a negative x scale or y scale, but not both


    Returns boolean

publicsetTransform

  • setTransform(pos: Vector, rotation: number, scale: Vector): void
  • Parameters

    Returns void

publictoString

  • toString(): string
  • Returns string