# Class 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 checkIsChanged. The snapshot can also be updated refresh so it matches the Camera from which it was created.

#### Hierarchy (View Summary)

- TwinfinityDefaultCameraStateSnapshot
  - TwinfinityTargetCameraStateSnapshot

##### Index

### Constructors

constructor

### Properties

_rotation
_target
camera

### Accessors

isChanged
lastChangeTimestamp
lastCheckTimestamp

### Methods

_copyCameraStateToSelf
checkIsChanged
refresh

## Constructors

### constructor

- new TwinfinityTargetCameraStateSnapshot(
  _targetCamera: TargetCamera,
  ): TwinfinityTargetCameraStateSnapshot

  #### Parameters

  - _targetCamera: TargetCamera

  #### Returns TwinfinityTargetCameraStateSnapshot

  Overrides TwinfinityDefaultCameraStateSnapshot.constructor

## Properties

### `Readonly`_rotation

_rotation: Vector3 = ...

### `Readonly`_target

_target: Vector3 = ...

### `Readonly` camera

camera: Camera

Camera to which the state snapshot is linked.

Inherited from TwinfinityDefaultCameraStateSnapshot.camera

## Accessors

### isChanged

- get isChanged(): boolean

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

  #### Returns boolean

  Overrides TwinfinityDefaultCameraStateSnapshot.isChanged

### lastChangeTimestamp

- get lastChangeTimestamp(): number

  #### Returns number

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

  Inherited from TwinfinityDefaultCameraStateSnapshot.lastChangeTimestamp

### lastCheckTimestamp

- get lastCheckTimestamp(): number

  #### Returns number

  timestamp in miliseconds of when the last refresh was done.

  Inherited from TwinfinityDefaultCameraStateSnapshot.lastCheckTimestamp

## Methods

### `Protected`_copyCameraStateToSelf

- _copyCameraStateToSelf(state: TargetCamera): void

  #### Parameters

  - state: TargetCamera

  #### Returns void

  Overrides TwinfinityDefaultCameraStateSnapshot._copyCameraStateToSelf

### checkIsChanged

- 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

  Inherited from TwinfinityDefaultCameraStateSnapshot.checkIsChanged

### 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`

  Inherited from TwinfinityDefaultCameraStateSnapshot.refresh