> ## Documentation Index
> Fetch the complete documentation index at: https://docs.speckle.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# SpeckleControls

> Abstract base class for all camera controls implementations

## Accessors

### enabled

```typescript theme={null}
abstract get enabled(): boolean
abstract set enabled(value: boolean)
```

Gets/sets the enabled state of the controls

**Returns**: boolean

### options

```typescript theme={null}
abstract get options(): Partial<Record<string, unknown>>
abstract set options(value: Partial<Record<string, unknown>>)
```

Gets/sets any options the controls implementation might need

**Returns**: `Partial<Record<string, unknown>>`

### targetCamera

```typescript theme={null}
abstract set targetCamera(target: PerspectiveCamera | OrthographicCamera)
```

Sets the camera that will be controls by this controls instance.
It only accepts [*PerspectiveCamera*](https://threejs.org/docs/index.html?q=pers#api/en/cameras/PerspectiveCamera)
or [*OrthographicCamera*](https://threejs.org/docs/index.html?q=orth#api/en/cameras/OrthographicCamera) instances

**Returns**: void

### up

```typescript theme={null}
public get up()
public set up(value: Vector3)
```

Sets the up vector this controls instance will use to compute the camera position and rotation.
Default value is `(0, 1, 0)`, however speckle data is represented in a coordinate system where up is `(0, 0, 1)`

**Returns**: [*Vector3*](https://threejs.org/docs/index.html?q=vec#api/en/math/Vector3)

<br />

<br />

## Methods

### dispose

```typescript theme={null}
abstract dispose(): void
```

Disposes of the controls implementation

**Returns**: void

### fitToSphere

```typescript theme={null}
abstract fitToSphere(sphere: Sphere): void
```

All controls implementations need to be able to position and orient themselves according to an input [*Sphere*](https://threejs.org/docs/index.html?q=sphere#api/en/math/Sphere)

<Warning>
  The `sphere` argument is provided in a coordinate system where up is `(0, 1,   0)`
</Warning>

**Parameters**

* **sphere**: [*Sphere*](https://threejs.org/docs/index.html?q=sphere#api/en/math/Sphere)

**Returns**: void

### fromPositionAndTarget

```typescript theme={null}
abstract fromPositionAndTarget(position: Vector3, target: Vector3): void
```

Sets the controller's goal position and rotation based on a given location and another location to 'lookAt'.
All controls implementation need to be able to position and orient themselves according to these two vectors.

**Parameters**

* **position**: The desired camera position as [*Vector3*](https://threejs.org/docs/index.html?q=vec#api/en/math/Vector3)
* **target**: A position in space where the camera should 'lookAt' as [*Vector3*](https://threejs.org/docs/index.html?q=vec#api/en/math/Vector3)
  **Returns**: void

### getPosition

```typescript theme={null}
abstract getPosition(): Vector3
```

Gets the current goal position of the control's target camera

**Returns**: [*Vector3*](https://threejs.org/docs/index.html?q=vec#api/en/math/Vector3)

### getTarget

```typescript theme={null}
abstract getTarget(): Vector3
```

Gets the current goal look position of the control's target camera

**Returns**: [*Vector3*](https://threejs.org/docs/index.html?q=vec#api/en/math/Vector3)

### isStationary

```typescript theme={null}
abstract isStationary(): boolean
```

Determines whether the control's camera target is stationary or not.

**Returns**: boolean

### jumpToGoal

```typescript theme={null}
abstract jumpToGoal(): void
```

Immediately sets the control's target camera position and rotation to their goal values.
Effectively skipping over any potential camera animation

**Returns**: void

### update

```typescript theme={null}
abstract update(delta?: number): boolean
```

The control's update loop

**Parameters**

* **delta**(*optional*): Frame delta time

**Returns**: void
