TwinfinityTargetCameraStateSnapshot
Hierarchy
- TwinfinityDefaultCameraStateSnapshot
- TwinfinityTargetCameraStateSnapshot
Index
Constructors
Properties
Accessors
Methods
Constructors
publicconstructor
Parameters
_targetCamera: TargetCamera
Returns TwinfinityTargetCameraStateSnapshot
Properties
readonly_rotation
readonly_target
publicreadonlycamera
Camera to which the state snapshot is linked.
Accessors
publicisChanged
true
if camera has changed state since last time refresh was called, otherwisefalse
Returns boolean
publiclastChangeTimestamp
Returns number
timestamp in miliseconds of when the last refresh that returned true was done.
publiclastCheckTimestamp
Returns number
timestamp in miliseconds of when the last refresh was done.
Methods
publiccheckIsChanged
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
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 wastrue
when call was made. Otherwisefalse
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.