Skip to main content

TwinfinityCameraStateSnapshot

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.

Implemented by

Index

Properties

readonlycamera

camera: Camera

Camera to which the state snapshot is linked.

readonlyisChanged

isChanged: boolean

true if camera has changed state since last time refresh was called, otherwise false

readonlylastChangeTimestamp

lastChangeTimestamp: number

Timestamp when last camera change check was true.

readonlylastCheckTimestamp

lastCheckTimestamp: number

Timestamp when camera state was last checked.

Methods

checkIsChanged

  • checkIsChanged(checkOnlyDimensions?: boolean): boolean
  • true if camera has changed state since last time refresh or checkIsChanged was called, otherwise false


    Parameters

    • optionalcheckOnlyDimensions: boolean

      A flag indicating if to check only if the camera dimensions changed, if set to true only width/height of the camera is checked, otherwise translation and rotation of the camera is checked too

    Returns boolean

refresh

  • 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