# Class ViewerCamera

##### Index

### Constructors

constructor

### Properties

activeCamera
cameraMinZ

### Accessors

forwardVector
maxZ
minZ
mode
options
position
projection
target
topDownMode

### Methods

attachBehavior
clearPivot
detachBehavior
pick
setPivot
zoomToExtent

## Constructors

### constructor

- new ViewerCamera(viewer: TwinfinityViewer): ViewerCamera

  #### Parameters

  - viewer: TwinfinityViewer

  #### Returns ViewerCamera

## Properties

### `Readonly` activeCamera

activeCamera: PivotTargetCamera

### `Static` `Readonly` cameraMinZ

cameraMinZ: 0.01

## Accessors

### forwardVector

- get forwardVector(): Vector3

  #### Returns Vector3

### maxZ

- get maxZ(): number

  #### Returns number

- set maxZ(n: number): void

  #### Parameters

  - n: number

  #### Returns void

### minZ

- get minZ(): number

  #### Returns number

- set minZ(n: number): void

  #### Parameters

  - n: number

  #### Returns void

### mode

- get mode(): CameraMode

  #### Returns CameraMode

- set mode(v: CameraMode): void

  #### Parameters

  - v: CameraMode

  #### Returns void

### options

- get options(): CameraOptions

  #### Returns CameraOptions

### position

- get position(): Vector3

  #### Returns Vector3

- set position(position: Vector3): void

  #### Parameters

  - position: Vector3

  #### Returns void

### projection

- get projection(): Projection

  #### Returns Projection

- set projection(projection: Projection): void

  #### Parameters

  - projection: Projection

  #### Returns void

### target

- get target(): Vector3

  #### Returns Vector3

- set target(target: Vector3): void

  #### Parameters

  - target: Vector3

  #### Returns void

### topDownMode

- get topDownMode(): boolean

  #### Returns boolean

- set topDownMode(topDownMode: boolean): void

  #### Parameters

  - topDownMode: boolean

  #### Returns void

## Methods

### attachBehavior

- attachBehavior(behavior: TwinfinityCameraBehavior): boolean

  Attaches a behavior to the camera.

  #### Parameters

  - behavior: TwinfinityCameraBehavior

    The behavior to be attached to the camera.

  #### Returns boolean

  true if the behavior was successfully attached to the camera, otherwise false.

### clearPivot

- clearPivot(): void

  #### Returns void

### detachBehavior

- detachBehavior(behavior: TwinfinityCameraBehavior): boolean

  Detaches a behavior from the camera.

  #### Parameters

  - behavior: TwinfinityCameraBehavior

    The behavior to be detached from the camera.

  #### Returns boolean

  true if the behavior was successfully detached to the camera, otherwise false.

### pick

- pick(o: PickOption): PickResult

  #### Parameters

  - o: PickOption

  #### Returns PickResult

### setPivot

- setPivot(mode: PivotMode, pivot?: Vector3): void

  #### Parameters

  - mode: PivotMode
  - `Optional` pivot: Vector3

  #### Returns void

### zoomToExtent

- zoomToExtent(aabb: BoundingInfo, direction?: CameraDirection): void

  #### Parameters

  - aabb: BoundingInfo
  - `Optional` direction: CameraDirection

  #### Returns void