[name]

This class is an alternative implementation of [page:FlyControls].

Examples

[example:webgl_geometry_terrain webgl / geometry / terrain ]

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.

Creates a new instance of [name].

Properties

.activeLook : Boolean

Whether or not it's possible to look around. Default is `true`.

.autoForward : Boolean

Whether or not the camera is automatically moved forward. Default is `false`.

.constrainVertical : Boolean

Whether or not looking around is vertically constrained by [[page:.verticalMin], [page:.verticalMax]]. Default is `false`.

.domElement : HTMLDOMElement

The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will not set up new event listeners.

.enabled : Boolean

Whether or not the controls are enabled. Default is `true`.

.heightCoef : Number

Determines how much faster the camera moves when it's y-component is near [page:.heightMax]. Default is *1*.

.heightMax : Number

Upper camera height limit used for movement speed adjustment. Default is *1*.

.heightMin : Number

Lower camera height limit used for movement speed adjustment. Default is *0*.

.heightSpeed : Boolean

Whether or not the camera's height influences the forward movement speed. Default is `false`. Use the properties [page:.heightCoef], [page:.heightMin] and [page:.heightMax] for configuration.

.lookVertical : Boolean

Whether or not it's possible to vertically look around. Default is `true`.

.lookSpeed : Number

The look around speed. Default is `0.005`.

.mouseDragOn : Boolean

Whether or not the mouse is pressed down. Read-only property.

.movementSpeed : Number

The movement speed. Default is *1*.

.object : Camera

The camera to be controlled.

.verticalMax : Number

How far you can vertically look around, upper limit. Range is 0 to Math.PI radians. Default is `Math.PI`.

.verticalMin : Number

How far you can vertically look around, lower limit. Range is 0 to Math.PI radians. Default is *0*.

Methods

.dispose () : undefined

Should be called if the controls is no longer required.

.handleResize () : undefined

Should be called if the application window is resized.

.lookAt ( [param:Vector3 vector] ) : FirstPersonControls
.lookAt ( [param:Float x], [param:Float y], [param:Float z] ) : FirstPersonControls

vector - A vector representing the target position.

Optionally, the x, y, z components of the world space position.

Ensures the controls orient the camera towards the defined target position.

.update ( [param:Number delta] ) : undefined

[page:Number delta]: Time delta value.

Updates the controls. Usually called in the animation loop.

Source

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

FirstPersonControls FirstPersonControls FirstPersonControls FirstPersonControls

FirstPersonControls FirstPersonControls FirstPersonControls FirstPersonControls