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

interface TwinfinityCameraStateSnapshot {
camera: Camera;
isChanged: boolean;
lastChangeTimestamp: number;
lastCheckTimestamp: number;
checkIsChanged(checkOnlyDimensions?: boolean): boolean;
refresh(): boolean;
}

#### Implemented by

- TwinfinityDefaultCameraStateSnapshot

##### Index

### Properties

camera
isChanged
lastChangeTimestamp
lastCheckTimestamp

### Methods

checkIsChanged
refresh

## Properties

### `Readonly` camera

camera: Camera

Camera to which the state snapshot is linked.

### `Readonly` isChanged

isChanged: boolean

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

### `Readonly` lastChangeTimestamp

lastChangeTimestamp: number

Timestamp when last camera change check was true.

### `Readonly` lastCheckTimestamp

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

  - `Optional` checkOnlyDimensions: 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`