Capítulo 309 de 859
This class is an alternative implementation of FlyControls.
verticalMin and verticalMax.1 disables damping.heightMax.heightCoef, heightMin and heightMax for …import { FirstPersonControls } from 'three/addons/controls/FirstPersonControls.js';
Constructor
| Signature |
|---|
new FirstPersonControls( object : Object3D, domElement : HTMLElement ) |
Properties
| Property | Description |
|---|---|
.autoForward : boolean | Whether the camera is automatically moved forward or not. |
.constrainVertical : boolean | Whether or not looking around is vertically constrained by verticalMin and verticalMax. |
.dampingFactor : number | How quickly the movement and look velocity catches up to the input. Lower values feel heavier (more inertia), 1 disables damping. |
.heightCoef : number | Determines how much faster the camera moves when it's y-component is near heightMax. |
.heightMax : number | Upper camera height limit used for movement speed adjustment. |
.heightMin : number | Lower camera height limit used for movement speed adjustment. |
.heightSpeed : boolean | Whether or not the camera's height influences the forward movement speed. Use the properties heightCoef, heightMin and heightMax for configuration. |
.lookSpeed : number | The look around speed. |
.lookVertical : boolean | Whether it's possible to vertically look around or not. |
.mouseDragOn : boolean (readonly) | Whether the mouse is pressed down or not. |
.movementSpeed : number | The movement speed. |
.verticalMax : number | How far you can vertically look around, upper limit. Range is 0 to Math.PI in radians. |
.verticalMin : number | How far you can vertically look around, lower limit. Range is 0 to Math.PI in radians. |
Methods
| Method | Description |
|---|---|
.handleResize() | |
| `.lookAt( x : number | Vector3, y : number, z : number ) : FirstPersonControls` |