Skip to main content

TwinfinityDefaultCameraStateSnapshot

Is the snapshot of a camera state. The snapshot can be used to check if the camera state (rotation, position etc.) has changed since the snapshot was created IsChanged. The snapshot can also be updated refresh so it matches the Camera from which it was created.

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

publicconstructor

Properties

publicreadonlycamera

camera: Camera

Camera to which the state snapshot is linked.

Accessors

publicisChanged

  • get isChanged(): boolean
  • true if camera has changed state since last time refresh was called, otherwise false


    Returns boolean

Methods

publiccheckIsChanged

  • checkIsChanged(checkOnlyDimensions?: boolean): boolean
  • Checks if the camera has changed since the last time _copyCameraStateToSelf(this.camera) was called. If checkOnlyDimensions is true, only the camera dimensions are checked for differences. If checkOnlyDimensions is false, camera dimensions, scale, rotation and translation is checked.


    Parameters

    • checkOnlyDimensions: boolean = false

      Specifies whether to only check camera dimensions (width, height, stuff like that) or to check camera dimensions in addition to everything else

    Returns boolean

    A boolean which is true if the current camera state is different from when _copyCameraStateToSelf(this.camera) was last called

publicrefresh

  • refresh(): boolean
  • Resets the camera state so isChanged is set to false (ie we refresh the snapshot so it is equal to the state of camera).


    Returns boolean

    true if isChanged was true when call was made. Otherwise false