Capítulo 310 de 859

Chapter 310: FlyControls

Core Idea

This class 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).

Key Concepts

  • autoForward : boolean: If set to true, the camera automatically moves forward (and does not stop) when initially translated.
  • dragToLook : boolean: If set to true, you can only look around by performing a drag interaction.
  • movementSpeed : number: The movement speed.
  • rollSpeed : number: The rotation speed.

Code Examples

import { FlyControls } from 'three/addons/controls/FlyControls.js';
  • What it demonstrates: Typical usage of FlyControls.

Reference Tables

Constructor

Signature
new FlyControls( object : Object3D, domElement : HTMLElement )

Properties

PropertyDescription
.autoForward : booleanIf set to true, the camera automatically moves forward (and does not stop) when initially translated.
.dragToLook : booleanIf set to true, you can only look around by performing a drag interaction.
.movementSpeed : numberThe movement speed.
.rollSpeed : numberThe rotation speed.

Key Takeaways

  1. FlyControls extends: EventDispatcher → Controls
  2. Most relevant properties: autoForward, dragToLook, movementSpeed, rollSpeed.

Connects To