# ScreenSpaceCameraController

#### new Cesium.ScreenSpaceCameraController(scene)
engine/Source/Scene/ScreenSpaceCameraController.js 35

Modifies the camera position and orientation based on mouse input to a canvas.

Name | Type | Description
--- | --- | ---
`scene` | Scene | The scene.

### Members

#### bounceAnimationTime : number
engine/Source/Scene/ScreenSpaceCameraController.js 126

Sets the duration, in seconds, of the bounce back animations in 2D and Columbus view.

Default Value: `3.0`

#### enableCollisionDetection : boolean
engine/Source/Scene/ScreenSpaceCameraController.js 274

When disabled, the values of `maximumZoomDistance` and `minimumZoomDistance` are ignored. Also used in conjunction with `Cesium3DTileset#enableCollision` to prevent the camera from moving through or below a 3D Tileset surface. This may also affect clamping behavior when using `HeightReference.CLAMP_TO_GROUND` on 3D Tiles.

Default Value: `true`

#### enableInputs : boolean
engine/Source/Scene/ScreenSpaceCameraController.js 54

If true, inputs are allowed conditionally with the flags enableTranslate, enableZoom, enableRotate, enableTilt, and enableLook. If false, all inputs are disabled. NOTE: This setting is for temporary use cases, such as camera flights and drag-selection of regions (see Picking demo). It is typically set to false at the start of such events, and set true on completion. To keep inputs disabled past the end of camera flights, you must use the other booleans (enableTranslate, enableZoom, enableRotate, enableTilt, and enableLook).

Default Value: `true`

#### enableLook : boolean
engine/Source/Scene/ScreenSpaceCameraController.js 88

If true, allows the user to use free-look. If false, the camera view direction can only be changed through translating or rotating. This flag only applies in 3D and Columbus view modes.

Default Value: `true`

#### enableRotate : boolean
engine/Source/Scene/ScreenSpaceCameraController.js 74

If true, allows the user to rotate the world which translates the user's position. This flag only applies in 2D and 3D.

Default Value: `true`

#### enableTilt : boolean
engine/Source/Scene/ScreenSpaceCameraController.js 81

If true, allows the user to tilt the camera. If false, the camera is locked to the current heading. This flag only applies in 3D and Columbus view.

Default Value: `true`

#### enableTranslate : boolean
engine/Source/Scene/ScreenSpaceCameraController.js 61

If true, allows the user to pan around the map. If false, the camera stays locked at the current position. This flag only applies in 2D and Columbus view modes.

Default Value: `true`

#### enableZoom : boolean
engine/Source/Scene/ScreenSpaceCameraController.js 67

If true, allows the user to zoom in and out. If false, the camera is locked to the current distance from the ellipsoid.

Default Value: `true`

#### inertiaSpin : number
engine/Source/Scene/ScreenSpaceCameraController.js 96

A parameter in the range `[0, 1)` used to determine how long the camera will continue to spin because of inertia. With value of zero, the camera will have no inertia.

Default Value: `0.9`

#### inertiaTranslate : number
engine/Source/Scene/ScreenSpaceCameraController.js 104

A parameter in the range `[0, 1)` used to determine how long the camera will continue to translate because of inertia. With value of zero, the camera will have no inertia.

Default Value: `0.9`

#### inertiaZoom : number
engine/Source/Scene/ScreenSpaceCameraController.js 112

A parameter in the range `[0, 1)` used to determine how long the camera will continue to zoom because of inertia. With value of zero, the camera will have no inertia.

Default Value: `0.8`

#### lookEventTypes : CameraEventType|Array|undefined
engine/Source/Scene/ScreenSpaceCameraController.js 222

The input that allows the user to change the direction the camera is viewing. This only applies in 3D and Columbus view modes.

The type can be a `CameraEventType`, `undefined`, an object with `eventType` and `modifier` properties with types `CameraEventType` and `KeyboardEventModifier`, or an array of any of the preceding.

Default Value: `{ eventType : `CameraEventType.LEFT_DRAG`, modifier : `KeyboardEventModifier.SHIFT` }`

#### maximumMovementRatio : number
engine/Source/Scene/ScreenSpaceCameraController.js 120

A parameter in the range `[0, 1)` used to limit the range of various user inputs to a percentage of the window width/height per animation frame. This helps keep the camera under control in low-frame-rate situations.

Default Value: `0.1`

#### maximumTiltAngle : number|undefined
engine/Source/Scene/ScreenSpaceCameraController.js 284

The angle, relative to the ellipsoid normal, restricting the maximum amount that the user can tilt the camera. If `undefined`, the angle of the camera tilt is unrestricted.

Default Value: `undefined`

##### Example:

    // Prevent the camera from tilting below the ellipsoid surface
    viewer.scene.screenSpaceCameraController.maximumTiltAngle = Math.PI / 2.0;

#### maximumZoomDistance : number
engine/Source/Scene/ScreenSpaceCameraController.js 138

The maximum magnitude, in meters, of the camera position when zooming. Defaults to positive infinity.

Default Value: ``Number.POSITIVE_INFINITY``

#### minimumCollisionTerrainHeight : number
engine/Source/Scene/ScreenSpaceCameraController.js 253

The minimum height the camera must be before testing for collision with terrain. Default to scene.ellipsoid.minimumRadius * 0.0025 when another ellipsoid than WGS84 is used.

Default Value: `15000.0 or scene.ellipsoid.minimumRadius * 0.0025.`

#### minimumPickingTerrainDistanceWithInertia : number
engine/Source/Scene/ScreenSpaceCameraController.js 243

The minimum distance the camera must be before testing for collision with terrain when zoom with inertia. Default to scene.ellipsoid.minimumRadius * 0.00063 when another ellipsoid than WGS84 is used.

Default Value: `4000.0 or scene.ellipsoid.minimumRadius * 0.00063`

#### minimumPickingTerrainHeight : number
engine/Source/Scene/ScreenSpaceCameraController.js 234

The minimum height the camera must be before picking the terrain or scene content instead of the ellipsoid. Defaults to scene.ellipsoid.minimumRadius * 0.025 when another ellipsoid than WGS84 is used.

Default Value: `150000.0 or scene.ellipsoid.minimumRadius * 0.025`

#### minimumTrackBallHeight : number
engine/Source/Scene/ScreenSpaceCameraController.js 263

The minimum height the camera must be before switching from rotating a track ball to free look when clicks originate on the sky or in space. Defaults to ellipsoid.minimumRadius * 1.175 when another ellipsoid than WGS84 is used.

Default Value: `7500000.0 or scene.ellipsoid.minimumRadius * 1.175`

#### minimumZoomDistance : number
engine/Source/Scene/ScreenSpaceCameraController.js 132

The minimum magnitude, in meters, of the camera position when zooming. Defaults to 1.0.

Default Value: `1.0`

#### rotateEventTypes : CameraEventType|Array|undefined
engine/Source/Scene/ScreenSpaceCameraController.js 183

The input that allows the user to rotate around the globe or another object. This only applies in 3D and Columbus view modes.

The type can be a `CameraEventType`, `undefined`, an object with `eventType` and `modifier` properties with types `CameraEventType` and `KeyboardEventModifier`, or an array of any of the preceding.

Default Value: ``CameraEventType.LEFT_DRAG``

#### tiltEventTypes : CameraEventType|Array|undefined
engine/Source/Scene/ScreenSpaceCameraController.js 200

The input that allows the user to tilt in 3D and Columbus view or twist in 2D.

The type can be a `CameraEventType`, `undefined`, an object with `eventType` and `modifier` properties with types `CameraEventType` and `KeyboardEventModifier`, or an array of any of the preceding.

Default Value: `[`CameraEventType.MIDDLE_DRAG`, `CameraEventType.PINCH`, { eventType : `CameraEventType.LEFT_DRAG`, modifier : `KeyboardEventModifier.CTRL` }, { eventType : `CameraEventType.RIGHT_DRAG`, modifier : `KeyboardEventModifier.CTRL` }]`

#### translateEventTypes : CameraEventType|Array|undefined
engine/Source/Scene/ScreenSpaceCameraController.js 157

The input that allows the user to pan around the map. This only applies in 2D and Columbus view modes.

The type can be a `CameraEventType`, `undefined`, an object with `eventType` and `modifier` properties with types `CameraEventType` and `KeyboardEventModifier`, or an array of any of the preceding.

Default Value: ``CameraEventType.LEFT_DRAG``

#### zoomEventTypes : CameraEventType|Array|undefined
engine/Source/Scene/ScreenSpaceCameraController.js 168

The input that allows the user to zoom in/out.

The type can be a `CameraEventType`, `undefined`, an object with `eventType` and `modifier` properties with types `CameraEventType` and `KeyboardEventModifier`, or an array of any of the preceding.

Default Value: `[`CameraEventType.RIGHT_DRAG`, `CameraEventType.WHEEL`, `CameraEventType.PINCH`]`

#### zoomFactor : number
engine/Source/Scene/ScreenSpaceCameraController.js 145

A multiplier for the speed at which the camera will zoom.

Default Value: `5.0`

### Methods

#### destroy()
engine/Source/Scene/ScreenSpaceCameraController.js 3093

Removes mouse listeners held by this object.
Once an object is destroyed, it should not be used; calling any function other than `isDestroyed` will result in a `DeveloperError` exception. Therefore, assign the return value (`undefined`) to the object as done in the example.

##### Throws:

- DeveloperError : This object was destroyed, i.e., destroy() was called.

##### Example:

    controller = controller && controller.destroy();

##### See:

- ScreenSpaceCameraController#isDestroyed

#### isDestroyed() → boolean
engine/Source/Scene/ScreenSpaceCameraController.js 3074

Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other than `isDestroyed` will result in a `DeveloperError` exception.

##### Returns:

`true` if this object was destroyed; otherwise, `false`.

##### See:

- ScreenSpaceCameraController#destroy

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.