Class for storing and applying camera control settings.
const aspect = app.container.offsetWidth / app.container.offsetHeight;
const camera = new v3d.PerspectiveCamera(45, aspect, 1, 1000);
camera.position.z = -5;
camera.controlSettings = new v3d.ControlSettings('ORBIT');
app.scene.add(camera);
// sets active camera and assigns app controls
app.setCamera(camera);
'ORBIT'
, 'FIRST_PERSON'
, or 'FLYING'
. Optional, default is 'ORBIT'
.'true'
.1
.1
.Create a new object with camera control settings.
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
.
Enable or disable zooming (dollying) of the camera.
Movements speed factor. Upon assigning settings to actual controls object, this value affects both panning and zooming speeds. Default is 1
.
Enable or disable moving the camera over the head. Default is false
.
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
.
Rotations speed factor. Default is 1
.
Controls type: 'ORBIT'
, 'FIRST_PERSON'
, or 'FLYING'
.
Assign control settings to actual controls object.
Clone control settings.
Copy control settings.
For more info on how to obtain the source code of this module see this page.