Flying controls allow the camera to move around like an airplane.
The HTMLElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will not set up new event listeners. Default is the whole document.
Whether or not the controls are enabled.
Whether to enable damping (inertia), which is used to give a sense of
weight to the controls. Default is true
.
Note that if this is enabled, you must call .update() in your animation loop.
Enable or disable the use of keyboard controls. Default is true
.
Enable or disable camera panning. Default is true
.
Enable or disable horizontal and vertical rotation of the camera. Default is true
.
Note that it is possible to disable a single axis by setting the min and max of the polar angle or azimuth angle to the same value, which will cause the vertical or horizontal rotation to be fixed at that value.
Enable or disable moving the camera over the head. Default is false
.
Enable or disable zooming (dollying) of the camera.
Flag which says whether the camera is currently in the state of tweening.
How far you can orbit horizontally, upper limit. Range is -Math.PI
to Math.PI
(or Infinity
for no limit) and default is Infinity
;
How far you can dolly out (PerspectiveCamera only). Default is Infinity
.
How far you can orbit vertically, upper limit. Range is 0
to Math.PI
radians, and default is Math.PI
.
How far you can zoom out (OrthographicCamera only). Default is Infinity.
How far you can orbit horizontally, lower limit. Range is -Math.PI
to Math.PI
(or -Infinity
for no limit) and default is -Infinity
;
How far you can dolly in (PerspectiveCamera only). Default is 0
.
How far you can orbit vertically, lower limit. Range is 0
to Math.PI
radians, and default is 0
.
How far you can zoom in (OrthographicCamera only). Default is 0
.
This object contains references to the mouse buttons used for the controls.
controls.mouseButtons = {
ROTATE: v3d.MOUSE.LEFT,
ZOOM: v3d.MOUSE.MIDDLE,
PAN: v3d.MOUSE.RIGHT
}
The camera (or other object) that is being controlled.
The panning damping inertia used if .enableDamping is set to true
. Note that for this to work, you must call .update() in your animation loop. Default is 0.05
.
Speed of panning. Default is 20.0
.
Speed of panning (pixels moved) when using keyboard arrow keys. Default is 0.15
.
Speed of panning (pixels moved) when using touch-based controls. Default is 15.0
.
The rotation damping inertia used if .enableDamping is set to true. Note that for this to work, you must call .update() in your animation loop. Default is 0.05
.
Same as .rotateInertia, but for the touch-based controls used on mobile devices. Default value is 0.05
.
Speed of rotation. Default is 0.9
.
Speed of rotation on touch-based devices. Default is 0.75
.
Speed of zooming / dollying. Default is 150.0
.
Speed of zooming when using keyboard arrow keys. Default is 0.5
.
Speed of rotation on touch-based devices. Default is 20.0
.
The zoom damping inertia used if .enableDamping is set to true. Note that for this to work, you must call .update() in your animation loop. Default is 0.05
.
Same as .zoomInertia, but for the touch-based controls used on mobile devices. Default is 0.05
.
Remove all the event listeners.
Change the camera's current position and target point to the specified new position and target smoothly over the specified time.
Change the orthographic camera target point and zoom factor smoothly over the specified period of time.
Update the controls. Must be called after any manual changes to the camera's transform, or in the update loop if .autoRotate or .enableDamping are set.
For more info on how to obtain the source code of this module see this page.