[page:Controls] →

[name]

[name] enables a navigation similar to fly modes in DCC tools like Blender. You can arbitrarily transform the camera in 3D space without any limitations (e.g. focus on a specific target).

Import

[name] is an add-on, and must be imported explicitly. See [link:#manual/introduction/Installation Installation / Addons].

import { FlyControls } from 'three/addons/controls/FlyControls.js';

Examples

[example:misc_controls_fly misc / controls / fly ]

Constructor

[name]( [param:Camera object], [param:HTMLDOMElement domElement] )

[page:Camera object]: The camera to be controlled.

[page:HTMLDOMElement domElement]: The HTML element used for event listeners. (optional)

Creates a new instance of [name].

Events

change

Fires when the camera has been transformed by the controls.

Properties

See the base [page:Controls] class for common properties.

[property:Boolean autoForward]

If set to `true`, the camera automatically moves forward (and does not stop) when initially translated. Default is `false`.

[property:Boolean dragToLook]

If set to `true`, you can only look around by performing a drag interaction. Default is `false`.

[property:Number movementSpeed]

The movement speed. Default is `1`.

[property:Number rollSpeed]

The rotation speed. Default is `0.005`.

Methods

See the base [page:Controls] class for common methods.

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/controls/FlyControls.js examples/jsm/controls/FlyControls.js]