ControlSettings - Verge3D User Manual - Soft8Soft
Description: Learn how to use ControlSettings in your interactive 3D apps made with Verge3D

# ControlSettings

Class for storing and applying camera control settings.

## Code Example

`const aspect = app.container.offsetWidth / app.container.offsetHeight; const camera = new v3d.PerspectiveCamera(45, aspect, 1, 1000); camera.position.z = -5; camera.controlSettings = new v3d.ControlSettings('ORBIT'); app.scene.add(camera); // sets active camera and assigns app controls app.setCamera(camera);`

## Constructor

### ControlSettings(type : String, enablePan : Boolean, rotateSpeed : Float, moveSpeed : Float)

- type — controls type: `'ORBIT'`, `'FIRST_PERSON'`, or `'FLYING'`. Optional, default is `'ORBIT'`.
- enablePan — create camera controls with panning enabled. Optional, default is `'true'`.
- rotateSpeed — camera rotation speed. Optional, default is `1`.
- moveSpeed — camera movement speed. Optional, default is `1`.

Create a new object with camera control settings.

## Properties

### # .enableKeys : Boolean

Enable or disable the use of keyboard controls. Default is `true`.

### # .enablePan : Boolean

Enable or disable camera panning. Default is `true`.

### # .enableRotate : Boolean

Enable or disable horizontal and vertical rotation of the camera. Default is `true`.

### # .enableZoom : Boolean

Enable or disable zooming (dollying) of the camera.

### # .moveSpeed : Float

Movements speed factor. Upon assigning settings to actual controls object, this value affects both panning and zooming speeds. Default is `1`.

### # .orbitEnableTurnover : Boolean

Enable or disable moving the camera over the head. Default is `false`.

### # .orbitMaxAzimuthAngle : Float

How far you can orbit horizontally, upper limit. Range is `-Math.PI` to `Math.PI` (or `Infinity` for no limit) and default is `Infinity`;

### # .orbitMaxDistance : Float

How far you can dolly out (PerspectiveCamera only). Default is `Infinity`.

### # .orbitMaxPolarAngle : Float

How far you can orbit vertically, upper limit. Range is `0` to `Math.PI` radians, and default is `Math.PI`.

### # .orbitMaxZoom : Float

How far you can zoom out (OrthographicCamera only). Default is `Infinity`.

### # .orbitMinAzimuthAngle : Float

How far you can orbit horizontally, lower limit. Range is `-Math.PI` to `Math.PI` (or `-Infinity` for no limit) and default is `-Infinity`;

### # .orbitMinDistance : Float

How far you can dolly in (PerspectiveCamera only). Default is `0`.

### # .orbitMinPolarAngle : Float

How far you can orbit vertically, lower limit. Range is `0` to `Math.PI` radians, and default is `0`.

### # .orbitMinZoom : Float

How far you can zoom in (OrthographicCamera only). Default is `0`.

### # .rotateSpeed : Float

Rotations speed factor. Default is `1`.

### # .screenSpacePanning : Boolean

Defines how the camera's position is translated when panning. If `true`, the camera pans in screen space. Otherwise, the camera pans in the plane orthogonal to the camera's up direction. Default is `true`.

### # .type : String

Controls type: `"ORBIT"`, `"FIRST_PERSON"`, or `"FLYING"`.

## Methods

### # .assignToControls(controls : Controls, scene : Scene)

- controls — camera controls object, such as OrbitControls.
- scene — scene where controls will be applied, only required for FirstPersonControls.

Assign control settings to actual controls object.

### # .clone() → ControlSettings

Clone control settings.

### # .copy(source : ControlSettings) → ControlSettings

Copy control settings.

## Source

For more info on how to obtain the source code of this module see this page.