|
@@ -61,166 +61,154 @@ function animate() {
|
|
|
</div>
|
|
|
|
|
|
|
|
|
- <h2>Properties</h2>
|
|
|
+ <h2>Properties</h2>
|
|
|
|
|
|
- <h3>[property:HTMLDOMElement domElement]</h3>
|
|
|
+ <h3>[property:Boolean autoRotate]</h3>
|
|
|
<div>
|
|
|
- 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. Default is the whole document.
|
|
|
+ Set to true to automatically rotate around the target.<br> Note that if this is enabled, you must call [page:.update]
|
|
|
+ () in your animation loop.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Boolean enabled]</h3>
|
|
|
+ <h3>[property:Float autoRotateSpeed]</h3>
|
|
|
<div>
|
|
|
- Whether or not the controls are enabled.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[property:Camera object]</h3>
|
|
|
- <div>
|
|
|
- The camera ( or other object ) that is being controlled.
|
|
|
+ How fast to rotate around the target if [property:Boolean autoRotate] is true. Default is 2.0, which equates to 30 seconds
|
|
|
+ per rotation at 60fps.<br> Note that if [property:Boolean autoRotate] is enabled, you must call [page:.update]
|
|
|
+ () in your animation loop.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Vector3 target]</h3>
|
|
|
+ <h3>
|
|
|
+ [property:Float dampingFactor]</h3>
|
|
|
<div>
|
|
|
- The focus point of the controls, the [page:.object] orbits around this.
|
|
|
- It can be updated manually at any point to change the focus of the controls.
|
|
|
+ The damping inertia used if [property:Boolean enableDamping] is set to true.<br> Note that for this to work, you must
|
|
|
+ call [page:.update] () in your animation loop.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float minDistance]</h3>
|
|
|
+ <h3>[property:HTMLDOMElement domElement]</h3>
|
|
|
<div>
|
|
|
- How far you can dolly in ( [page:PerspectiveCamera] only ). Default is 0.
|
|
|
+ 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. Default is the whole document.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float maxDistance]</h3>
|
|
|
+ <h3>[property:Boolean enabled]</h3>
|
|
|
<div>
|
|
|
- How far you can dolly out ( [page:PerspectiveCamera] only ). Default is Infinity.
|
|
|
+ Whether or not the controls are enabled.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float minZoom]</h3>
|
|
|
+ <h3>[property:Boolean enableDamping]</h3>
|
|
|
<div>
|
|
|
- How far you can zoom in ( [page:OrthographicCamera] only ). Default is 0.
|
|
|
+ Set to true to enable damping (inertia), which can be used to give a sense of weight to the controls. Default is false.<br> Note that if this is enabled, you must call [page:.update] () in your animation loop.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float maxZoom]</h3>
|
|
|
+ <h3>[property:Boolean enableKeys]</h3>
|
|
|
<div>
|
|
|
- How far you can zoom out ( [page:OrthographicCamera] only ). Default is Infinity.
|
|
|
+ Enable or disable the use of keyboard controls.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float minPolarAngle]</h3>
|
|
|
+ <h3>[property:Boolean enablePan]</h3>
|
|
|
<div>
|
|
|
- How far you can orbit vertically, lower limit. Range is 0 to Math.PI radians,
|
|
|
- and default is 0.
|
|
|
+ Enable or disable camera panning. Default is true.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float maxPolarAngle]</h3>
|
|
|
+ <h3>[property:Boolean enableRotate]</h3>
|
|
|
<div>
|
|
|
- How far you can orbit vertically, upper limit. Range is 0 to Math.PI radians,
|
|
|
- and default is Math.PI.
|
|
|
+ Enable or disable horizontal and vertical rotation of the camera. Default is true.<br>
|
|
|
+ Note that it is possible to disable a single axis by setting the min and max of the
|
|
|
+ [page:.minPolarAngle polar angle] or [page:.minAzimuthAngle azimuth angle] to the same value,
|
|
|
+ which will cause the vertical or horizontal rotation to be fixed at that value.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float minAzimuthAngle]</h3>
|
|
|
+ <h3>[property:Boolean enableZoom]</h3>
|
|
|
<div>
|
|
|
- How far you can orbit horizontally, lower limit. Range is - Math.PI to Math.PI
|
|
|
- ( or - Infinity for no limit ) and default is - Infinity;
|
|
|
+ Enable or disable zooming (dollying) of the camera.
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <h3>[property:Float maxAzimuthAngle]</h3>
|
|
|
+ <h3>[property:Float keyPanSpeed]</h3>
|
|
|
<div>
|
|
|
- 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 fast to pan the camera when the keyboard is used. Default is 7.0 pixels per keypress.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Boolean enableDamping]</h3>
|
|
|
+ <h3>[property:Object keys]</h3>
|
|
|
<div>
|
|
|
- Set to true to enable damping (inertia), which can be used to give a sense of weight to the controls.
|
|
|
- Default is false.<br>
|
|
|
- Note that if this is enabled, you must call [page:.update] () in your animation loop.
|
|
|
+ This object contains references to the keycodes for controlling camera panning. Default is the 4 arrow keys.
|
|
|
+ <code>
|
|
|
+controls.keys = {
|
|
|
+ LEFT: 37, //left arrow
|
|
|
+ UP: 38, // up arrow
|
|
|
+ RIGHT: 39, // right arrow
|
|
|
+ BOTTOM: 40 // down arrow
|
|
|
+}
|
|
|
+ </code> See [link:https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode this page] for a full
|
|
|
+ list of keycodes.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float dampingFactor]</h3>
|
|
|
+ <h3>[property:Float maxAzimuthAngle]</h3>
|
|
|
<div>
|
|
|
- The damping inertia used if [property:Boolean enableDamping] is set to true.<br>
|
|
|
- Note that for this to work, you must call [page:.update] () in your animation loop.
|
|
|
+ How far you can orbit horizontally, upper limit. Range is - Math.PI to Math.PI ( or Infinity for no limit ) and default is
|
|
|
+ Infinity;
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Boolean enableZoom]</h3>
|
|
|
+ <h3>[property:Float maxDistance]</h3>
|
|
|
<div>
|
|
|
- Enable or disable zooming (dollying) of the camera.
|
|
|
+ How far you can dolly out ( [page:PerspectiveCamera] only ). Default is Infinity.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float zoomSpeed]</h3>
|
|
|
+ <h3>[property:Float maxPolarAngle]</h3>
|
|
|
<div>
|
|
|
- Speed of zooming / dollying. Default is 1.
|
|
|
+ How far you can orbit vertically, upper limit. Range is 0 to Math.PI radians, and default is Math.PI.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Boolean enableRotate]</h3>
|
|
|
+ <h3>[property:Float maxZoom]</h3>
|
|
|
<div>
|
|
|
- Enable or disable horizontal and vertical rotation of the camera. Default is true.<br>
|
|
|
- Note that it is possible to disable a single axis by setting the min and max of the
|
|
|
- [page:.minPolarAngle polar angle] or [page:.minAzimuthAngle azimuth angle] to the same value,
|
|
|
- which will cause the vertical or horizontal rotation to be fixed at that value.
|
|
|
+ How far you can zoom out ( [page:OrthographicCamera] only ). Default is Infinity.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float rotateSpeed]</h3>
|
|
|
+ <h3>[property:Float minAzimuthAngle]</h3>
|
|
|
<div>
|
|
|
- Speed of rotation. Default is 1.
|
|
|
+ How far you can orbit horizontally, lower limit. Range is - Math.PI to Math.PI ( or - Infinity for no limit ) and default
|
|
|
+ is - Infinity;
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Boolean enablePan]</h3>
|
|
|
+ <h3>[property:Float minDistance]</h3>
|
|
|
<div>
|
|
|
- Enable or disable camera panning. Default is true.
|
|
|
+ How far you can dolly in ( [page:PerspectiveCamera] only ). Default is 0.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float keyPanSpeed]</h3>
|
|
|
+ <h3>[property:Float minPolarAngle]</h3>
|
|
|
<div>
|
|
|
- How fast to pan the camera when the keyboard is used. Default is 7.0 pixels per keypress.
|
|
|
+ How far you can orbit vertically, lower limit. Range is 0 to Math.PI radians, and default is 0.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Boolean autoRotate]</h3>
|
|
|
+ <h3>[property:Float minZoom]</h3>
|
|
|
<div>
|
|
|
- Set to true to automatically rotate around the target.<br>
|
|
|
- Note that if this is enabled, you must call [page:.update] () in your animation loop.
|
|
|
+ How far you can zoom in ( [page:OrthographicCamera] only ). Default is 0.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Float autoRotateSpeed]</h3>
|
|
|
+ <h3>
|
|
|
+ [property:Object mouseButtons]</h3>
|
|
|
<div>
|
|
|
- How fast to rotate around the target if [property:Boolean autoRotate] is true. Default is 2.0, which equates to 30 seconds per rotation at 60fps.<br>
|
|
|
- Note that if [property:Boolean autoRotate] is enabled, you must call [page:.update] () in your animation loop.
|
|
|
+ This object contains references to the mouse buttons used for the controls.
|
|
|
+ <code>
|
|
|
+controls.mouseButtons = {
|
|
|
+ ORBIT: THREE.MOUSE.LEFT,
|
|
|
+ ZOOM: THREE.MOUSE.MIDDLE,
|
|
|
+ PAN: THREE.MOUSE.RIGHT
|
|
|
+}
|
|
|
+ </code>
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Boolean enableKeys]</h3>
|
|
|
+ <h3>[property:Camera object]</h3>
|
|
|
<div>
|
|
|
- Enable or disable the use of keyboard controls.
|
|
|
+ The camera ( or other object ) that is being controlled.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Object keys]</h3>
|
|
|
+ <h3>[property:Vector3 position0]</h3>
|
|
|
<div>
|
|
|
- This object contains references to the keycodes for controlling camera panning.
|
|
|
- Default is the 4 arrow keys.
|
|
|
- <code>
|
|
|
-controls.keys = {
|
|
|
- LEFT: 37, //left arrow
|
|
|
- UP: 38, // up arrow
|
|
|
- RIGHT: 39, // right arrow
|
|
|
- BOTTOM: 40 // down arrow
|
|
|
-}
|
|
|
- </code>
|
|
|
- See [link:https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode this page] for a full list of keycodes.
|
|
|
+ Used internally by the [method:saveState] and [method:reset] methods.
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
- <h3>[property:Object mouseButtons]</h3>
|
|
|
+ <h3>[property:Float rotateSpeed]</h3>
|
|
|
<div>
|
|
|
- This object contains references to the mouse buttons used for the controls.
|
|
|
- <code>
|
|
|
-controls.mouseButtons = {
|
|
|
- ORBIT: THREE.MOUSE.LEFT,
|
|
|
- ZOOM: THREE.MOUSE.MIDDLE,
|
|
|
- PAN: THREE.MOUSE.RIGHT
|
|
|
-}
|
|
|
- </code>
|
|
|
+ Speed of rotation. Default is 1.
|
|
|
</div>
|
|
|
|
|
|
<h3>[property:Vector3 target0]</h3>
|
|
@@ -228,9 +216,10 @@ controls.mouseButtons = {
|
|
|
Used internally by the [method:saveState] and [method:reset] methods.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[property:Vector3 position0]</h3>
|
|
|
+ <h3>[property:Vector3 target]</h3>
|
|
|
<div>
|
|
|
- Used internally by the [method:saveState] and [method:reset] methods.
|
|
|
+ The focus point of the controls, the [page:.object] orbits around this. It can be updated manually at any point to change
|
|
|
+ the focus of the controls.
|
|
|
</div>
|
|
|
|
|
|
<h3>[property:Float zoom0]</h3>
|
|
@@ -238,21 +227,28 @@ controls.mouseButtons = {
|
|
|
Used internally by the [method:saveState] and [method:reset] methods.
|
|
|
</div>
|
|
|
|
|
|
+ <h3>[property:Float zoomSpeed]</h3>
|
|
|
+ <div>
|
|
|
+ Speed of zooming / dollying. Default is 1.
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<h2>Methods</h2>
|
|
|
|
|
|
- <h3>[method:radians getPolarAngle] ()</h3>
|
|
|
- <div>
|
|
|
- Get the current vertical rotation, in radians.
|
|
|
- </div>
|
|
|
+ <h3>[method:null dispose] ()</h3>
|
|
|
+ <div>
|
|
|
+ Remove all the event listeners.
|
|
|
+ </div>
|
|
|
|
|
|
<h3>[method:radians getAzimuthalAngle] ()</h3>
|
|
|
<div>
|
|
|
Get the current horizontal rotation, in radians.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[method:null saveState] ()</h3>
|
|
|
- <div>
|
|
|
- Save the current state of the controls. This can later be recovered with [page:.reset].
|
|
|
+ <h3>[method:radians getPolarAngle] ()</h3>
|
|
|
+ <div>
|
|
|
+ Get the current vertical rotation, in radians.
|
|
|
</div>
|
|
|
|
|
|
<h3>[method:null reset] ()</h3>
|
|
@@ -260,9 +256,9 @@ controls.mouseButtons = {
|
|
|
Reset the controls to their state from either the last time the [page:.saveState] was called, or the initial state.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[method:null dispose] ()</h3>
|
|
|
+ <h3>[method:null saveState] ()</h3>
|
|
|
<div>
|
|
|
- Remove all the event listeners.
|
|
|
+ Save the current state of the controls. This can later be recovered with [page:.reset].
|
|
|
</div>
|
|
|
|
|
|
<h3>[method:false update] ()</h3>
|