# FocusController

Class · extends [`InputController`](https://api.playcanvas.com/engine/classes/InputController.md) · category: Input

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/extras/input/controllers/focus-controller.js#L25

The focus controller. It ignores the input frame and instead eases the pose from where it was
towards the pose given to [attach](https://api.playcanvas.com/engine/classes/FocusController.md#attach), smoothed by [focusDamping](https://api.playcanvas.com/engine/classes/FocusController.md#focusdamping). Use it to animate a
camera onto a new target and then hand over to another controller; [complete](https://api.playcanvas.com/engine/classes/FocusController.md#complete) reports
when the target has been reached.

## Properties

### focusDamping

```ts
focusDamping: number = 0.98
```

The focus damping. In the range 0 to 1, where a value of 0 means no damping and 1 means
full damping. Default is 0.98.

## Methods

### attach

```ts
attach(pose: Pose, smooth?: boolean): void
```

**Parameters**

- `pose` ([`Pose`](https://api.playcanvas.com/engine/classes/Pose.md)): The initial pose of the controller.
- `smooth` (`boolean`, optional, default `true`): Whether to smooth the transition.

### complete

```ts
complete(): boolean
```

**Returns** `boolean`

### destroy

```ts
destroy(): void
```

### detach

```ts
detach(): void
```

### update

```ts
update(frame: InputFrame<{ move: number[]; rotate: number[] }>, dt: number): Pose
```

**Parameters**

- `frame` ([`InputFrame`](https://api.playcanvas.com/engine/classes/InputFrame.md)`<{ move: number[]; rotate: number[] }>`): The input frame.
- `dt` (`number`): The delta time.

**Returns** [`Pose`](https://api.playcanvas.com/engine/classes/Pose.md): - The controller pose.

## Inherited from [InputController](https://api.playcanvas.com/engine/classes/InputController.md)

- `new FocusController()`
- `protected _pose: Pose`
