Skip to main content

TwinfinityTargetCameraStateSnapshot

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

Index

Constructors

publicconstructor

Properties

readonly_rotation

_rotation: Vector3 = ...

readonly_target

_target: Vector3 = ...

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

publiclastChangeTimestamp

  • get lastChangeTimestamp(): number

  • Returns number

    timestamp in miliseconds of when the last refresh that returned true was done.

publiclastCheckTimestamp

  • get lastCheckTimestamp(): number

  • Returns number

    timestamp in miliseconds of when the last refresh was done.

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