kitchen-simulator 11.30.2 → 11.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/assets/img/svg/accessories.svg +4 -4
- package/es/assets/img/svg/bottombar/elevation-back.svg +6 -6
- package/es/assets/img/svg/bottombar/elevation-front.svg +6 -6
- package/es/assets/img/svg/bottombar/elevation-left.svg +6 -6
- package/es/assets/img/svg/bottombar/elevation-right.svg +7 -7
- package/es/assets/img/svg/bottombar/elevation.svg +13 -13
- package/es/assets/img/svg/detail.svg +77 -77
- package/es/assets/img/svg/filtersActive.svg +19 -19
- package/es/assets/img/svg/invert.svg +12 -12
- package/es/assets/img/svg/menubar/login.svg +84 -84
- package/es/assets/img/svg/menubar/my_projects.svg +85 -85
- package/es/assets/img/svg/menubar/new_project.svg +110 -110
- package/es/assets/img/svg/menubar/save_project.svg +84 -84
- package/es/assets/img/svg/options.svg +3 -3
- package/es/assets/img/svg/positioning.svg +3 -3
- package/es/assets/img/svg/toggleFilters.svg +19 -19
- package/es/assets/img/svg/toolbar/shopping-cart.svg +13 -13
- package/es/assets/img/svg/wizardstep/detail_view.svg +87 -87
- package/es/assets/img/svg/wizardstep/tile_view.svg +95 -95
- package/es/components/viewer2d/viewer2d.js +7 -22
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +556 -556
- package/es/components/viewer3d/scene-creator.js +11 -10
- package/es/constants/applianceCategories.js +19 -0
- package/es/constants.js +1 -0
- package/es/engine/2d/viewer-utils.js +20 -0
- package/es/events/external/handleExternalEvent.util.js +80 -66
- package/es/events/external/handlers.changeDoorStyle.js +8 -15
- package/es/events/external/handlers.loadProject.js +8 -15
- package/es/mappings/external-events/mapExternalEventPayload.js +4 -4
- package/es/mappings/external-events/mappers/addItemMapper.js +9 -9
- package/es/mappings/external-events/mappers/ccdfMapper.js +7 -13
- package/es/shared/concurrency/async-pool.js +71 -0
- package/es/shared/domain/asset/sanitize-asset-url.js +5 -5
- package/es/shared/math/line-metrics.js +11 -11
- package/es/utils/geometry.js +19 -16
- package/es/utils/skinPanelEngine.js +14 -14
- package/lib/assets/img/svg/accessories.svg +4 -4
- package/lib/assets/img/svg/bottombar/elevation-back.svg +6 -6
- package/lib/assets/img/svg/bottombar/elevation-front.svg +6 -6
- package/lib/assets/img/svg/bottombar/elevation-left.svg +6 -6
- package/lib/assets/img/svg/bottombar/elevation-right.svg +7 -7
- package/lib/assets/img/svg/bottombar/elevation.svg +13 -13
- package/lib/assets/img/svg/detail.svg +77 -77
- package/lib/assets/img/svg/filtersActive.svg +19 -19
- package/lib/assets/img/svg/invert.svg +12 -12
- package/lib/assets/img/svg/menubar/login.svg +84 -84
- package/lib/assets/img/svg/menubar/my_projects.svg +85 -85
- package/lib/assets/img/svg/menubar/new_project.svg +110 -110
- package/lib/assets/img/svg/menubar/save_project.svg +84 -84
- package/lib/assets/img/svg/options.svg +3 -3
- package/lib/assets/img/svg/positioning.svg +3 -3
- package/lib/assets/img/svg/toggleFilters.svg +19 -19
- package/lib/assets/img/svg/toolbar/shopping-cart.svg +13 -13
- package/lib/assets/img/svg/wizardstep/detail_view.svg +87 -87
- package/lib/assets/img/svg/wizardstep/tile_view.svg +95 -95
- package/lib/components/viewer2d/viewer2d.js +7 -22
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +556 -556
- package/lib/components/viewer3d/scene-creator.js +11 -10
- package/lib/constants/applianceCategories.js +25 -0
- package/lib/constants.js +5 -4
- package/lib/engine/2d/viewer-utils.js +25 -0
- package/lib/events/external/handleExternalEvent.util.js +80 -66
- package/lib/events/external/handlers.changeDoorStyle.js +8 -15
- package/lib/events/external/handlers.loadProject.js +8 -15
- package/lib/mappings/external-events/mapExternalEventPayload.js +4 -4
- package/lib/mappings/external-events/mappers/addItemMapper.js +9 -9
- package/lib/mappings/external-events/mappers/ccdfMapper.js +7 -13
- package/lib/shared/concurrency/async-pool.js +78 -0
- package/lib/shared/domain/asset/sanitize-asset-url.js +5 -5
- package/lib/shared/math/line-metrics.js +11 -11
- package/lib/utils/geometry.js +18 -15
- package/lib/utils/skinPanelEngine.js +14 -14
- package/package.json +1 -1
|
@@ -14,11 +14,11 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
14
14
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
15
15
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
16
|
function _superPropGet(t, o, e, r) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
17
|
-
/*!
|
|
18
|
-
* camera-controls
|
|
19
|
-
* https://github.com/yomotsu/camera-controls
|
|
20
|
-
* (c) 2017 @yomotsu
|
|
21
|
-
* Released under the MIT License.
|
|
17
|
+
/*!
|
|
18
|
+
* camera-controls
|
|
19
|
+
* https://github.com/yomotsu/camera-controls
|
|
20
|
+
* (c) 2017 @yomotsu
|
|
21
|
+
* Released under the MIT License.
|
|
22
22
|
*/
|
|
23
23
|
// see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#value
|
|
24
24
|
var MOUSE_BUTTON = {
|
|
@@ -189,11 +189,11 @@ var EventDispatcher = exports.EventDispatcher = /*#__PURE__*/function () {
|
|
|
189
189
|
(0, _classCallCheck2["default"])(this, EventDispatcher);
|
|
190
190
|
this._listeners = {};
|
|
191
191
|
}
|
|
192
|
-
/**
|
|
193
|
-
* Adds the specified event listener.
|
|
194
|
-
* @param type event name
|
|
195
|
-
* @param listener handler function
|
|
196
|
-
* @category Methods
|
|
192
|
+
/**
|
|
193
|
+
* Adds the specified event listener.
|
|
194
|
+
* @param type event name
|
|
195
|
+
* @param listener handler function
|
|
196
|
+
* @category Methods
|
|
197
197
|
*/
|
|
198
198
|
return (0, _createClass2["default"])(EventDispatcher, [{
|
|
199
199
|
key: "addEventListener",
|
|
@@ -202,11 +202,11 @@ var EventDispatcher = exports.EventDispatcher = /*#__PURE__*/function () {
|
|
|
202
202
|
if (listeners[type] === undefined) listeners[type] = [];
|
|
203
203
|
if (listeners[type].indexOf(listener) === -1) listeners[type].push(listener);
|
|
204
204
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Presence of the specified event listener.
|
|
207
|
-
* @param type event name
|
|
208
|
-
* @param listener handler function
|
|
209
|
-
* @category Methods
|
|
205
|
+
/**
|
|
206
|
+
* Presence of the specified event listener.
|
|
207
|
+
* @param type event name
|
|
208
|
+
* @param listener handler function
|
|
209
|
+
* @category Methods
|
|
210
210
|
*/
|
|
211
211
|
}, {
|
|
212
212
|
key: "hasEventListener",
|
|
@@ -214,11 +214,11 @@ var EventDispatcher = exports.EventDispatcher = /*#__PURE__*/function () {
|
|
|
214
214
|
var listeners = this._listeners;
|
|
215
215
|
return listeners[type] !== undefined && listeners[type].indexOf(listener) !== -1;
|
|
216
216
|
}
|
|
217
|
-
/**
|
|
218
|
-
* Removes the specified event listener
|
|
219
|
-
* @param type event name
|
|
220
|
-
* @param listener handler function
|
|
221
|
-
* @category Methods
|
|
217
|
+
/**
|
|
218
|
+
* Removes the specified event listener
|
|
219
|
+
* @param type event name
|
|
220
|
+
* @param listener handler function
|
|
221
|
+
* @category Methods
|
|
222
222
|
*/
|
|
223
223
|
}, {
|
|
224
224
|
key: "removeEventListener",
|
|
@@ -230,10 +230,10 @@ var EventDispatcher = exports.EventDispatcher = /*#__PURE__*/function () {
|
|
|
230
230
|
if (index !== -1) listenerArray.splice(index, 1);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
/**
|
|
234
|
-
* Removes all event listeners
|
|
235
|
-
* @param type event name
|
|
236
|
-
* @category Methods
|
|
233
|
+
/**
|
|
234
|
+
* Removes all event listeners
|
|
235
|
+
* @param type event name
|
|
236
|
+
* @category Methods
|
|
237
237
|
*/
|
|
238
238
|
}, {
|
|
239
239
|
key: "removeAllEventListeners",
|
|
@@ -244,10 +244,10 @@ var EventDispatcher = exports.EventDispatcher = /*#__PURE__*/function () {
|
|
|
244
244
|
}
|
|
245
245
|
if (Array.isArray(this._listeners[type])) this._listeners[type].length = 0;
|
|
246
246
|
}
|
|
247
|
-
/**
|
|
248
|
-
* Fire an event type.
|
|
249
|
-
* @param event DispatcherEvent
|
|
250
|
-
* @category Methods
|
|
247
|
+
/**
|
|
248
|
+
* Fire an event type.
|
|
249
|
+
* @param event DispatcherEvent
|
|
250
|
+
* @category Methods
|
|
251
251
|
*/
|
|
252
252
|
}, {
|
|
253
253
|
key: "dispatchEvent",
|
|
@@ -292,177 +292,177 @@ var _quaternionB;
|
|
|
292
292
|
var _rotationMatrix;
|
|
293
293
|
var _raycaster;
|
|
294
294
|
var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatcher) {
|
|
295
|
-
/**
|
|
296
|
-
* Creates a `CameraControls` instance.
|
|
297
|
-
*
|
|
298
|
-
* Note:
|
|
299
|
-
* You **must install** three.js before using camera-controls. see [#install](#install)
|
|
300
|
-
* Not doing so will lead to runtime errors (`undefined` references to THREE).
|
|
301
|
-
*
|
|
302
|
-
* e.g.
|
|
303
|
-
* ```
|
|
304
|
-
* CameraControls.install( { THREE } );
|
|
305
|
-
* const cameraControls = new CameraControls( camera, domElement );
|
|
306
|
-
* ```
|
|
307
|
-
*
|
|
308
|
-
* @param camera A `THREE.PerspectiveCamera` or `THREE.OrthographicCamera` to be controlled.
|
|
309
|
-
* @param domElement A `HTMLElement` for the draggable area, usually `renderer.domElement`.
|
|
310
|
-
* @category Constructor
|
|
295
|
+
/**
|
|
296
|
+
* Creates a `CameraControls` instance.
|
|
297
|
+
*
|
|
298
|
+
* Note:
|
|
299
|
+
* You **must install** three.js before using camera-controls. see [#install](#install)
|
|
300
|
+
* Not doing so will lead to runtime errors (`undefined` references to THREE).
|
|
301
|
+
*
|
|
302
|
+
* e.g.
|
|
303
|
+
* ```
|
|
304
|
+
* CameraControls.install( { THREE } );
|
|
305
|
+
* const cameraControls = new CameraControls( camera, domElement );
|
|
306
|
+
* ```
|
|
307
|
+
*
|
|
308
|
+
* @param camera A `THREE.PerspectiveCamera` or `THREE.OrthographicCamera` to be controlled.
|
|
309
|
+
* @param domElement A `HTMLElement` for the draggable area, usually `renderer.domElement`.
|
|
310
|
+
* @category Constructor
|
|
311
311
|
*/
|
|
312
312
|
function CameraControls(camera, domElement) {
|
|
313
313
|
var _this;
|
|
314
314
|
(0, _classCallCheck2["default"])(this, CameraControls);
|
|
315
315
|
_this = _callSuper(this, CameraControls);
|
|
316
|
-
/**
|
|
317
|
-
* Minimum vertical angle in radians.
|
|
318
|
-
* The angle has to be between `0` and `.maxPolarAngle` inclusive.
|
|
319
|
-
* The default value is `0`.
|
|
320
|
-
*
|
|
321
|
-
* e.g.
|
|
322
|
-
* ```
|
|
323
|
-
* cameraControls.maxPolarAngle = 0;
|
|
324
|
-
* ```
|
|
325
|
-
* @category Properties
|
|
316
|
+
/**
|
|
317
|
+
* Minimum vertical angle in radians.
|
|
318
|
+
* The angle has to be between `0` and `.maxPolarAngle` inclusive.
|
|
319
|
+
* The default value is `0`.
|
|
320
|
+
*
|
|
321
|
+
* e.g.
|
|
322
|
+
* ```
|
|
323
|
+
* cameraControls.maxPolarAngle = 0;
|
|
324
|
+
* ```
|
|
325
|
+
* @category Properties
|
|
326
326
|
*/
|
|
327
327
|
_this.minPolarAngle = 0; // radians
|
|
328
|
-
/**
|
|
329
|
-
* Maximum vertical angle in radians.
|
|
330
|
-
* The angle has to be between `.maxPolarAngle` and `Math.PI` inclusive.
|
|
331
|
-
* The default value is `Math.PI`.
|
|
332
|
-
*
|
|
333
|
-
* e.g.
|
|
334
|
-
* ```
|
|
335
|
-
* cameraControls.maxPolarAngle = Math.PI;
|
|
336
|
-
* ```
|
|
337
|
-
* @category Properties
|
|
328
|
+
/**
|
|
329
|
+
* Maximum vertical angle in radians.
|
|
330
|
+
* The angle has to be between `.maxPolarAngle` and `Math.PI` inclusive.
|
|
331
|
+
* The default value is `Math.PI`.
|
|
332
|
+
*
|
|
333
|
+
* e.g.
|
|
334
|
+
* ```
|
|
335
|
+
* cameraControls.maxPolarAngle = Math.PI;
|
|
336
|
+
* ```
|
|
337
|
+
* @category Properties
|
|
338
338
|
*/
|
|
339
339
|
_this.maxPolarAngle = Math.PI; // radians
|
|
340
|
-
/**
|
|
341
|
-
* Minimum horizontal angle in radians.
|
|
342
|
-
* The angle has to be less than `.maxAzimuthAngle`.
|
|
343
|
-
* The default value is `- Infinity`.
|
|
344
|
-
*
|
|
345
|
-
* e.g.
|
|
346
|
-
* ```
|
|
347
|
-
* cameraControls.minAzimuthAngle = - Infinity;
|
|
348
|
-
* ```
|
|
349
|
-
* @category Properties
|
|
340
|
+
/**
|
|
341
|
+
* Minimum horizontal angle in radians.
|
|
342
|
+
* The angle has to be less than `.maxAzimuthAngle`.
|
|
343
|
+
* The default value is `- Infinity`.
|
|
344
|
+
*
|
|
345
|
+
* e.g.
|
|
346
|
+
* ```
|
|
347
|
+
* cameraControls.minAzimuthAngle = - Infinity;
|
|
348
|
+
* ```
|
|
349
|
+
* @category Properties
|
|
350
350
|
*/
|
|
351
351
|
_this.minAzimuthAngle = -Infinity; // radians
|
|
352
|
-
/**
|
|
353
|
-
* Maximum horizontal angle in radians.
|
|
354
|
-
* The angle has to be greater than `.minAzimuthAngle`.
|
|
355
|
-
* The default value is `Infinity`.
|
|
356
|
-
*
|
|
357
|
-
* e.g.
|
|
358
|
-
* ```
|
|
359
|
-
* cameraControls.maxAzimuthAngle = Infinity;
|
|
360
|
-
* ```
|
|
361
|
-
* @category Properties
|
|
352
|
+
/**
|
|
353
|
+
* Maximum horizontal angle in radians.
|
|
354
|
+
* The angle has to be greater than `.minAzimuthAngle`.
|
|
355
|
+
* The default value is `Infinity`.
|
|
356
|
+
*
|
|
357
|
+
* e.g.
|
|
358
|
+
* ```
|
|
359
|
+
* cameraControls.maxAzimuthAngle = Infinity;
|
|
360
|
+
* ```
|
|
361
|
+
* @category Properties
|
|
362
362
|
*/
|
|
363
363
|
_this.maxAzimuthAngle = Infinity; // radians
|
|
364
364
|
// How far you can dolly in and out ( PerspectiveCamera only )
|
|
365
|
-
/**
|
|
366
|
-
* Minimum distance for dolly. The value must be higher than `0`. Default is `Number.EPSILON`.
|
|
367
|
-
* PerspectiveCamera only.
|
|
368
|
-
* @category Properties
|
|
365
|
+
/**
|
|
366
|
+
* Minimum distance for dolly. The value must be higher than `0`. Default is `Number.EPSILON`.
|
|
367
|
+
* PerspectiveCamera only.
|
|
368
|
+
* @category Properties
|
|
369
369
|
*/
|
|
370
370
|
_this.minDistance = Number.EPSILON;
|
|
371
|
-
/**
|
|
372
|
-
* Maximum distance for dolly. The value must be higher than `minDistance`. Default is `Infinity`.
|
|
373
|
-
* PerspectiveCamera only.
|
|
374
|
-
* @category Properties
|
|
371
|
+
/**
|
|
372
|
+
* Maximum distance for dolly. The value must be higher than `minDistance`. Default is `Infinity`.
|
|
373
|
+
* PerspectiveCamera only.
|
|
374
|
+
* @category Properties
|
|
375
375
|
*/
|
|
376
376
|
_this.maxDistance = Infinity;
|
|
377
|
-
/**
|
|
378
|
-
* `true` to enable Infinity Dolly for wheel and pinch. Use this with `minDistance` and `maxDistance`
|
|
379
|
-
* If the Dolly distance is less (or over) than the `minDistance` (or `maxDistance`), `infinityDolly` will keep the distance and pushes the target position instead.
|
|
380
|
-
* @category Properties
|
|
377
|
+
/**
|
|
378
|
+
* `true` to enable Infinity Dolly for wheel and pinch. Use this with `minDistance` and `maxDistance`
|
|
379
|
+
* If the Dolly distance is less (or over) than the `minDistance` (or `maxDistance`), `infinityDolly` will keep the distance and pushes the target position instead.
|
|
380
|
+
* @category Properties
|
|
381
381
|
*/
|
|
382
382
|
_this.infinityDolly = false;
|
|
383
|
-
/**
|
|
384
|
-
* Minimum camera zoom.
|
|
385
|
-
* @category Properties
|
|
383
|
+
/**
|
|
384
|
+
* Minimum camera zoom.
|
|
385
|
+
* @category Properties
|
|
386
386
|
*/
|
|
387
387
|
_this.minZoom = 0.01;
|
|
388
|
-
/**
|
|
389
|
-
* Maximum camera zoom.
|
|
390
|
-
* @category Properties
|
|
388
|
+
/**
|
|
389
|
+
* Maximum camera zoom.
|
|
390
|
+
* @category Properties
|
|
391
391
|
*/
|
|
392
392
|
_this.maxZoom = Infinity;
|
|
393
|
-
/**
|
|
394
|
-
* Approximate time in seconds to reach the target. A smaller value will reach the target faster.
|
|
395
|
-
* @category Properties
|
|
393
|
+
/**
|
|
394
|
+
* Approximate time in seconds to reach the target. A smaller value will reach the target faster.
|
|
395
|
+
* @category Properties
|
|
396
396
|
*/
|
|
397
397
|
_this.smoothTime = 0.25;
|
|
398
|
-
/**
|
|
399
|
-
* the smoothTime while dragging
|
|
400
|
-
* @category Properties
|
|
398
|
+
/**
|
|
399
|
+
* the smoothTime while dragging
|
|
400
|
+
* @category Properties
|
|
401
401
|
*/
|
|
402
402
|
_this.draggingSmoothTime = 0.125;
|
|
403
|
-
/**
|
|
404
|
-
* Max transition speed in unit-per-seconds
|
|
405
|
-
* @category Properties
|
|
403
|
+
/**
|
|
404
|
+
* Max transition speed in unit-per-seconds
|
|
405
|
+
* @category Properties
|
|
406
406
|
*/
|
|
407
407
|
_this.maxSpeed = Infinity;
|
|
408
|
-
/**
|
|
409
|
-
* Speed of azimuth (horizontal) rotation.
|
|
410
|
-
* @category Properties
|
|
408
|
+
/**
|
|
409
|
+
* Speed of azimuth (horizontal) rotation.
|
|
410
|
+
* @category Properties
|
|
411
411
|
*/
|
|
412
412
|
_this.azimuthRotateSpeed = 1.0;
|
|
413
|
-
/**
|
|
414
|
-
* Speed of polar (vertical) rotation.
|
|
415
|
-
* @category Properties
|
|
413
|
+
/**
|
|
414
|
+
* Speed of polar (vertical) rotation.
|
|
415
|
+
* @category Properties
|
|
416
416
|
*/
|
|
417
417
|
_this.polarRotateSpeed = 1.0;
|
|
418
|
-
/**
|
|
419
|
-
* Speed of mouse-wheel dollying.
|
|
420
|
-
* @category Properties
|
|
418
|
+
/**
|
|
419
|
+
* Speed of mouse-wheel dollying.
|
|
420
|
+
* @category Properties
|
|
421
421
|
*/
|
|
422
422
|
_this.dollySpeed = 1.0;
|
|
423
|
-
/**
|
|
424
|
-
* `true` to invert direction when dollying or zooming via drag
|
|
425
|
-
* @category Properties
|
|
423
|
+
/**
|
|
424
|
+
* `true` to invert direction when dollying or zooming via drag
|
|
425
|
+
* @category Properties
|
|
426
426
|
*/
|
|
427
427
|
_this.dollyDragInverted = false;
|
|
428
|
-
/**
|
|
429
|
-
* Speed of drag for truck and pedestal.
|
|
430
|
-
* @category Properties
|
|
428
|
+
/**
|
|
429
|
+
* Speed of drag for truck and pedestal.
|
|
430
|
+
* @category Properties
|
|
431
431
|
*/
|
|
432
432
|
_this.truckSpeed = 2.0;
|
|
433
|
-
/**
|
|
434
|
-
* `true` to enable Dolly-in to the mouse cursor coords.
|
|
435
|
-
* @category Properties
|
|
433
|
+
/**
|
|
434
|
+
* `true` to enable Dolly-in to the mouse cursor coords.
|
|
435
|
+
* @category Properties
|
|
436
436
|
*/
|
|
437
437
|
_this.dollyToCursor = false;
|
|
438
|
-
/**
|
|
439
|
-
* @category Properties
|
|
438
|
+
/**
|
|
439
|
+
* @category Properties
|
|
440
440
|
*/
|
|
441
441
|
_this.dragToOffset = false;
|
|
442
|
-
/**
|
|
443
|
-
* The same as `.screenSpacePanning` in three.js's OrbitControls.
|
|
444
|
-
* @category Properties
|
|
442
|
+
/**
|
|
443
|
+
* The same as `.screenSpacePanning` in three.js's OrbitControls.
|
|
444
|
+
* @category Properties
|
|
445
445
|
*/
|
|
446
446
|
_this.verticalDragToForward = false;
|
|
447
|
-
/**
|
|
448
|
-
* Friction ratio of the boundary.
|
|
449
|
-
* @category Properties
|
|
447
|
+
/**
|
|
448
|
+
* Friction ratio of the boundary.
|
|
449
|
+
* @category Properties
|
|
450
450
|
*/
|
|
451
451
|
_this.boundaryFriction = 0.0;
|
|
452
|
-
/**
|
|
453
|
-
* Controls how soon the `rest` event fires as the camera slows.
|
|
454
|
-
* @category Properties
|
|
452
|
+
/**
|
|
453
|
+
* Controls how soon the `rest` event fires as the camera slows.
|
|
454
|
+
* @category Properties
|
|
455
455
|
*/
|
|
456
456
|
_this.restThreshold = 0.01;
|
|
457
|
-
/**
|
|
458
|
-
* An array of Meshes to collide with camera.
|
|
459
|
-
* Be aware colliderMeshes may decrease performance. The collision test uses 4 raycasters from the camera since the near plane has 4 corners.
|
|
460
|
-
* @category Properties
|
|
457
|
+
/**
|
|
458
|
+
* An array of Meshes to collide with camera.
|
|
459
|
+
* Be aware colliderMeshes may decrease performance. The collision test uses 4 raycasters from the camera since the near plane has 4 corners.
|
|
460
|
+
* @category Properties
|
|
461
461
|
*/
|
|
462
462
|
_this.colliderMeshes = [];
|
|
463
|
-
/**
|
|
464
|
-
* Force cancel user dragging.
|
|
465
|
-
* @category Methods
|
|
463
|
+
/**
|
|
464
|
+
* Force cancel user dragging.
|
|
465
|
+
* @category Methods
|
|
466
466
|
*/
|
|
467
467
|
// cancel will be overwritten in the constructor.
|
|
468
468
|
_this.cancel = function () {};
|
|
@@ -1021,9 +1021,9 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1021
1021
|
_this.update(0);
|
|
1022
1022
|
return _this;
|
|
1023
1023
|
}
|
|
1024
|
-
/**
|
|
1025
|
-
* The camera to be controlled
|
|
1026
|
-
* @category Properties
|
|
1024
|
+
/**
|
|
1025
|
+
* The camera to be controlled
|
|
1026
|
+
* @category Properties
|
|
1027
1027
|
*/
|
|
1028
1028
|
(0, _inherits2["default"])(CameraControls, _EventDispatcher);
|
|
1029
1029
|
return (0, _createClass2["default"])(CameraControls, [{
|
|
@@ -1038,10 +1038,10 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1038
1038
|
this._updateNearPlaneCorners();
|
|
1039
1039
|
this._needsUpdate = true;
|
|
1040
1040
|
}
|
|
1041
|
-
/**
|
|
1042
|
-
* Whether or not the controls are enabled.
|
|
1043
|
-
* `false` to disable user dragging/touch-move, but all methods works.
|
|
1044
|
-
* @category Properties
|
|
1041
|
+
/**
|
|
1042
|
+
* Whether or not the controls are enabled.
|
|
1043
|
+
* `false` to disable user dragging/touch-move, but all methods works.
|
|
1044
|
+
* @category Properties
|
|
1045
1045
|
*/
|
|
1046
1046
|
}, {
|
|
1047
1047
|
key: "enabled",
|
|
@@ -1062,29 +1062,29 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1062
1062
|
this._domElement.style.webkitUserSelect = '';
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
/**
|
|
1066
|
-
* Returns `true` if the controls are active updating.
|
|
1067
|
-
* readonly value.
|
|
1068
|
-
* @category Properties
|
|
1065
|
+
/**
|
|
1066
|
+
* Returns `true` if the controls are active updating.
|
|
1067
|
+
* readonly value.
|
|
1068
|
+
* @category Properties
|
|
1069
1069
|
*/
|
|
1070
1070
|
}, {
|
|
1071
1071
|
key: "active",
|
|
1072
1072
|
get: function get() {
|
|
1073
1073
|
return !this._hasRested;
|
|
1074
1074
|
}
|
|
1075
|
-
/**
|
|
1076
|
-
* Getter for the current `ACTION`.
|
|
1077
|
-
* readonly value.
|
|
1078
|
-
* @category Properties
|
|
1075
|
+
/**
|
|
1076
|
+
* Getter for the current `ACTION`.
|
|
1077
|
+
* readonly value.
|
|
1078
|
+
* @category Properties
|
|
1079
1079
|
*/
|
|
1080
1080
|
}, {
|
|
1081
1081
|
key: "currentAction",
|
|
1082
1082
|
get: function get() {
|
|
1083
1083
|
return this._state;
|
|
1084
1084
|
}
|
|
1085
|
-
/**
|
|
1086
|
-
* get/set Current distance.
|
|
1087
|
-
* @category Properties
|
|
1085
|
+
/**
|
|
1086
|
+
* get/set Current distance.
|
|
1087
|
+
* @category Properties
|
|
1088
1088
|
*/
|
|
1089
1089
|
}, {
|
|
1090
1090
|
key: "distance",
|
|
@@ -1098,10 +1098,10 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1098
1098
|
this._needsUpdate = true;
|
|
1099
1099
|
}
|
|
1100
1100
|
// horizontal angle
|
|
1101
|
-
/**
|
|
1102
|
-
* get/set the azimuth angle (horizontal) in radians.
|
|
1103
|
-
* Every 360 degrees turn is added to `.azimuthAngle` value, which is accumulative.
|
|
1104
|
-
* @category Properties
|
|
1101
|
+
/**
|
|
1102
|
+
* get/set the azimuth angle (horizontal) in radians.
|
|
1103
|
+
* Every 360 degrees turn is added to `.azimuthAngle` value, which is accumulative.
|
|
1104
|
+
* @category Properties
|
|
1105
1105
|
*/
|
|
1106
1106
|
}, {
|
|
1107
1107
|
key: "azimuthAngle",
|
|
@@ -1115,9 +1115,9 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1115
1115
|
this._needsUpdate = true;
|
|
1116
1116
|
}
|
|
1117
1117
|
// vertical angle
|
|
1118
|
-
/**
|
|
1119
|
-
* get/set the polar angle (vertical) in radians.
|
|
1120
|
-
* @category Properties
|
|
1118
|
+
/**
|
|
1119
|
+
* get/set the polar angle (vertical) in radians.
|
|
1120
|
+
* @category Properties
|
|
1121
1121
|
*/
|
|
1122
1122
|
}, {
|
|
1123
1123
|
key: "polarAngle",
|
|
@@ -1130,9 +1130,9 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1130
1130
|
this._sphericalEnd.phi = polarAngle;
|
|
1131
1131
|
this._needsUpdate = true;
|
|
1132
1132
|
}
|
|
1133
|
-
/**
|
|
1134
|
-
* Whether camera position should be enclosed in the boundary or not.
|
|
1135
|
-
* @category Properties
|
|
1133
|
+
/**
|
|
1134
|
+
* Whether camera position should be enclosed in the boundary or not.
|
|
1135
|
+
* @category Properties
|
|
1136
1136
|
*/
|
|
1137
1137
|
}, {
|
|
1138
1138
|
key: "boundaryEnclosesCamera",
|
|
@@ -1143,11 +1143,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1143
1143
|
this._boundaryEnclosesCamera = boundaryEnclosesCamera;
|
|
1144
1144
|
this._needsUpdate = true;
|
|
1145
1145
|
}
|
|
1146
|
-
/**
|
|
1147
|
-
* Set drag-start, touches and wheel enable area in the domElement.
|
|
1148
|
-
* each values are between `0` and `1` inclusive, where `0` is left/top and `1` is right/bottom of the screen.
|
|
1149
|
-
* e.g. `{ x: 0, y: 0, width: 1, height: 1 }` for entire area.
|
|
1150
|
-
* @category Properties
|
|
1146
|
+
/**
|
|
1147
|
+
* Set drag-start, touches and wheel enable area in the domElement.
|
|
1148
|
+
* each values are between `0` and `1` inclusive, where `0` is left/top and `1` is right/bottom of the screen.
|
|
1149
|
+
* e.g. `{ x: 0, y: 0, width: 1, height: 1 }` for entire area.
|
|
1150
|
+
* @category Properties
|
|
1151
1151
|
*/
|
|
1152
1152
|
}, {
|
|
1153
1153
|
key: "interactiveArea",
|
|
@@ -1157,58 +1157,58 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1157
1157
|
this._interactiveArea.x = clamp(interactiveArea.x, 0, 1 - this._interactiveArea.width);
|
|
1158
1158
|
this._interactiveArea.y = clamp(interactiveArea.y, 0, 1 - this._interactiveArea.height);
|
|
1159
1159
|
}
|
|
1160
|
-
/**
|
|
1161
|
-
* Adds the specified event listener.
|
|
1162
|
-
* Applicable event types (which is `K`) are:
|
|
1163
|
-
* | Event name | Timing |
|
|
1164
|
-
* | ------------------- | ------ |
|
|
1165
|
-
* | `'controlstart'` | When the user starts to control the camera via mouse / touches. ¹ |
|
|
1166
|
-
* | `'control'` | When the user controls the camera (dragging). |
|
|
1167
|
-
* | `'controlend'` | When the user ends to control the camera. ¹ |
|
|
1168
|
-
* | `'transitionstart'` | When any kind of transition starts, either user control or using a method with `enableTransition = true` |
|
|
1169
|
-
* | `'update'` | When the camera position is updated. |
|
|
1170
|
-
* | `'wake'` | When the camera starts moving. |
|
|
1171
|
-
* | `'rest'` | When the camera movement is below `.restThreshold` ². |
|
|
1172
|
-
* | `'sleep'` | When the camera end moving. |
|
|
1173
|
-
*
|
|
1174
|
-
* 1. `mouseButtons.wheel` (Mouse wheel control) does not emit `'controlstart'` and `'controlend'`. `mouseButtons.wheel` uses scroll-event internally, and scroll-event happens intermittently. That means "start" and "end" cannot be detected.
|
|
1175
|
-
* 2. Due to damping, `sleep` will usually fire a few seconds after the camera _appears_ to have stopped moving. If you want to do something (e.g. enable UI, perform another transition) at the point when the camera has stopped, you probably want the `rest` event. This can be fine tuned using the `.restThreshold` parameter. See the [Rest and Sleep Example](https://yomotsu.github.io/camera-controls/examples/rest-and-sleep.html).
|
|
1176
|
-
*
|
|
1177
|
-
* e.g.
|
|
1178
|
-
* ```
|
|
1179
|
-
* cameraControl.addEventListener( 'controlstart', myCallbackFunction );
|
|
1180
|
-
* ```
|
|
1181
|
-
* @param type event name
|
|
1182
|
-
* @param listener handler function
|
|
1183
|
-
* @category Methods
|
|
1160
|
+
/**
|
|
1161
|
+
* Adds the specified event listener.
|
|
1162
|
+
* Applicable event types (which is `K`) are:
|
|
1163
|
+
* | Event name | Timing |
|
|
1164
|
+
* | ------------------- | ------ |
|
|
1165
|
+
* | `'controlstart'` | When the user starts to control the camera via mouse / touches. ¹ |
|
|
1166
|
+
* | `'control'` | When the user controls the camera (dragging). |
|
|
1167
|
+
* | `'controlend'` | When the user ends to control the camera. ¹ |
|
|
1168
|
+
* | `'transitionstart'` | When any kind of transition starts, either user control or using a method with `enableTransition = true` |
|
|
1169
|
+
* | `'update'` | When the camera position is updated. |
|
|
1170
|
+
* | `'wake'` | When the camera starts moving. |
|
|
1171
|
+
* | `'rest'` | When the camera movement is below `.restThreshold` ². |
|
|
1172
|
+
* | `'sleep'` | When the camera end moving. |
|
|
1173
|
+
*
|
|
1174
|
+
* 1. `mouseButtons.wheel` (Mouse wheel control) does not emit `'controlstart'` and `'controlend'`. `mouseButtons.wheel` uses scroll-event internally, and scroll-event happens intermittently. That means "start" and "end" cannot be detected.
|
|
1175
|
+
* 2. Due to damping, `sleep` will usually fire a few seconds after the camera _appears_ to have stopped moving. If you want to do something (e.g. enable UI, perform another transition) at the point when the camera has stopped, you probably want the `rest` event. This can be fine tuned using the `.restThreshold` parameter. See the [Rest and Sleep Example](https://yomotsu.github.io/camera-controls/examples/rest-and-sleep.html).
|
|
1176
|
+
*
|
|
1177
|
+
* e.g.
|
|
1178
|
+
* ```
|
|
1179
|
+
* cameraControl.addEventListener( 'controlstart', myCallbackFunction );
|
|
1180
|
+
* ```
|
|
1181
|
+
* @param type event name
|
|
1182
|
+
* @param listener handler function
|
|
1183
|
+
* @category Methods
|
|
1184
1184
|
*/
|
|
1185
1185
|
}, {
|
|
1186
1186
|
key: "addEventListener",
|
|
1187
1187
|
value: function addEventListener(type, listener) {
|
|
1188
1188
|
_superPropGet(CameraControls, "addEventListener", this, 3)([type, listener]);
|
|
1189
1189
|
}
|
|
1190
|
-
/**
|
|
1191
|
-
* Removes the specified event listener
|
|
1192
|
-
* e.g.
|
|
1193
|
-
* ```
|
|
1194
|
-
* cameraControl.addEventListener( 'controlstart', myCallbackFunction );
|
|
1195
|
-
* ```
|
|
1196
|
-
* @param type event name
|
|
1197
|
-
* @param listener handler function
|
|
1198
|
-
* @category Methods
|
|
1190
|
+
/**
|
|
1191
|
+
* Removes the specified event listener
|
|
1192
|
+
* e.g.
|
|
1193
|
+
* ```
|
|
1194
|
+
* cameraControl.addEventListener( 'controlstart', myCallbackFunction );
|
|
1195
|
+
* ```
|
|
1196
|
+
* @param type event name
|
|
1197
|
+
* @param listener handler function
|
|
1198
|
+
* @category Methods
|
|
1199
1199
|
*/
|
|
1200
1200
|
}, {
|
|
1201
1201
|
key: "removeEventListener",
|
|
1202
1202
|
value: function removeEventListener(type, listener) {
|
|
1203
1203
|
_superPropGet(CameraControls, "removeEventListener", this, 3)([type, listener]);
|
|
1204
1204
|
}
|
|
1205
|
-
/**
|
|
1206
|
-
* Rotate azimuthal angle(horizontal) and polar angle(vertical).
|
|
1207
|
-
* Every value is added to the current value.
|
|
1208
|
-
* @param azimuthAngle Azimuth rotate angle. In radian.
|
|
1209
|
-
* @param polarAngle Polar rotate angle. In radian.
|
|
1210
|
-
* @param enableTransition Whether to move smoothly or immediately
|
|
1211
|
-
* @category Methods
|
|
1205
|
+
/**
|
|
1206
|
+
* Rotate azimuthal angle(horizontal) and polar angle(vertical).
|
|
1207
|
+
* Every value is added to the current value.
|
|
1208
|
+
* @param azimuthAngle Azimuth rotate angle. In radian.
|
|
1209
|
+
* @param polarAngle Polar rotate angle. In radian.
|
|
1210
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1211
|
+
* @category Methods
|
|
1212
1212
|
*/
|
|
1213
1213
|
}, {
|
|
1214
1214
|
key: "rotate",
|
|
@@ -1216,16 +1216,16 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1216
1216
|
var enableTransition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1217
1217
|
return this.rotateTo(this._sphericalEnd.theta + azimuthAngle, this._sphericalEnd.phi + polarAngle, enableTransition);
|
|
1218
1218
|
}
|
|
1219
|
-
/**
|
|
1220
|
-
* Rotate azimuthal angle(horizontal) to the given angle and keep the same polar angle(vertical) target.
|
|
1221
|
-
*
|
|
1222
|
-
* e.g.
|
|
1223
|
-
* ```
|
|
1224
|
-
* cameraControls.rotateAzimuthTo( 30 * THREE.MathUtils.DEG2RAD, true );
|
|
1225
|
-
* ```
|
|
1226
|
-
* @param azimuthAngle Azimuth rotate angle. In radian.
|
|
1227
|
-
* @param enableTransition Whether to move smoothly or immediately
|
|
1228
|
-
* @category Methods
|
|
1219
|
+
/**
|
|
1220
|
+
* Rotate azimuthal angle(horizontal) to the given angle and keep the same polar angle(vertical) target.
|
|
1221
|
+
*
|
|
1222
|
+
* e.g.
|
|
1223
|
+
* ```
|
|
1224
|
+
* cameraControls.rotateAzimuthTo( 30 * THREE.MathUtils.DEG2RAD, true );
|
|
1225
|
+
* ```
|
|
1226
|
+
* @param azimuthAngle Azimuth rotate angle. In radian.
|
|
1227
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1228
|
+
* @category Methods
|
|
1229
1229
|
*/
|
|
1230
1230
|
}, {
|
|
1231
1231
|
key: "rotateAzimuthTo",
|
|
@@ -1233,16 +1233,16 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1233
1233
|
var enableTransition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1234
1234
|
return this.rotateTo(azimuthAngle, this._sphericalEnd.phi, enableTransition);
|
|
1235
1235
|
}
|
|
1236
|
-
/**
|
|
1237
|
-
* Rotate polar angle(vertical) to the given angle and keep the same azimuthal angle(horizontal) target.
|
|
1238
|
-
*
|
|
1239
|
-
* e.g.
|
|
1240
|
-
* ```
|
|
1241
|
-
* cameraControls.rotatePolarTo( 30 * THREE.MathUtils.DEG2RAD, true );
|
|
1242
|
-
* ```
|
|
1243
|
-
* @param polarAngle Polar rotate angle. In radian.
|
|
1244
|
-
* @param enableTransition Whether to move smoothly or immediately
|
|
1245
|
-
* @category Methods
|
|
1236
|
+
/**
|
|
1237
|
+
* Rotate polar angle(vertical) to the given angle and keep the same azimuthal angle(horizontal) target.
|
|
1238
|
+
*
|
|
1239
|
+
* e.g.
|
|
1240
|
+
* ```
|
|
1241
|
+
* cameraControls.rotatePolarTo( 30 * THREE.MathUtils.DEG2RAD, true );
|
|
1242
|
+
* ```
|
|
1243
|
+
* @param polarAngle Polar rotate angle. In radian.
|
|
1244
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1245
|
+
* @category Methods
|
|
1246
1246
|
*/
|
|
1247
1247
|
}, {
|
|
1248
1248
|
key: "rotatePolarTo",
|
|
@@ -1250,43 +1250,43 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1250
1250
|
var enableTransition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1251
1251
|
return this.rotateTo(this._sphericalEnd.theta, polarAngle, enableTransition);
|
|
1252
1252
|
}
|
|
1253
|
-
/**
|
|
1254
|
-
* Rotate azimuthal angle(horizontal) and polar angle(vertical) to the given angle.
|
|
1255
|
-
* Camera view will rotate over the orbit pivot absolutely:
|
|
1256
|
-
*
|
|
1257
|
-
* azimuthAngle
|
|
1258
|
-
* ```
|
|
1259
|
-
* 0º
|
|
1260
|
-
* \
|
|
1261
|
-
* 90º -----+----- -90º
|
|
1262
|
-
* \
|
|
1263
|
-
* 180º
|
|
1264
|
-
* ```
|
|
1265
|
-
* | direction | angle |
|
|
1266
|
-
* | --------- | ---------------------- |
|
|
1267
|
-
* | front | 0º |
|
|
1268
|
-
* | left | 90º (`Math.PI / 2`) |
|
|
1269
|
-
* | right | -90º (`- Math.PI / 2`) |
|
|
1270
|
-
* | back | 180º (`Math.PI`) |
|
|
1271
|
-
*
|
|
1272
|
-
* polarAngle
|
|
1273
|
-
* ```
|
|
1274
|
-
* 180º
|
|
1275
|
-
* |
|
|
1276
|
-
* 90º
|
|
1277
|
-
* |
|
|
1278
|
-
* 0º
|
|
1279
|
-
* ```
|
|
1280
|
-
* | direction | angle |
|
|
1281
|
-
* | -------------------- | ---------------------- |
|
|
1282
|
-
* | top/sky | 180º (`Math.PI`) |
|
|
1283
|
-
* | horizontal from view | 90º (`Math.PI / 2`) |
|
|
1284
|
-
* | bottom/floor | 0º |
|
|
1285
|
-
*
|
|
1286
|
-
* @param azimuthAngle Azimuth rotate angle to. In radian.
|
|
1287
|
-
* @param polarAngle Polar rotate angle to. In radian.
|
|
1288
|
-
* @param enableTransition Whether to move smoothly or immediately
|
|
1289
|
-
* @category Methods
|
|
1253
|
+
/**
|
|
1254
|
+
* Rotate azimuthal angle(horizontal) and polar angle(vertical) to the given angle.
|
|
1255
|
+
* Camera view will rotate over the orbit pivot absolutely:
|
|
1256
|
+
*
|
|
1257
|
+
* azimuthAngle
|
|
1258
|
+
* ```
|
|
1259
|
+
* 0º
|
|
1260
|
+
* \
|
|
1261
|
+
* 90º -----+----- -90º
|
|
1262
|
+
* \
|
|
1263
|
+
* 180º
|
|
1264
|
+
* ```
|
|
1265
|
+
* | direction | angle |
|
|
1266
|
+
* | --------- | ---------------------- |
|
|
1267
|
+
* | front | 0º |
|
|
1268
|
+
* | left | 90º (`Math.PI / 2`) |
|
|
1269
|
+
* | right | -90º (`- Math.PI / 2`) |
|
|
1270
|
+
* | back | 180º (`Math.PI`) |
|
|
1271
|
+
*
|
|
1272
|
+
* polarAngle
|
|
1273
|
+
* ```
|
|
1274
|
+
* 180º
|
|
1275
|
+
* |
|
|
1276
|
+
* 90º
|
|
1277
|
+
* |
|
|
1278
|
+
* 0º
|
|
1279
|
+
* ```
|
|
1280
|
+
* | direction | angle |
|
|
1281
|
+
* | -------------------- | ---------------------- |
|
|
1282
|
+
* | top/sky | 180º (`Math.PI`) |
|
|
1283
|
+
* | horizontal from view | 90º (`Math.PI / 2`) |
|
|
1284
|
+
* | bottom/floor | 0º |
|
|
1285
|
+
*
|
|
1286
|
+
* @param azimuthAngle Azimuth rotate angle to. In radian.
|
|
1287
|
+
* @param polarAngle Polar rotate angle to. In radian.
|
|
1288
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1289
|
+
* @category Methods
|
|
1290
1290
|
*/
|
|
1291
1291
|
}, {
|
|
1292
1292
|
key: "rotateTo",
|
|
@@ -1306,11 +1306,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1306
1306
|
var resolveImmediately = !enableTransition || approxEquals(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && approxEquals(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold);
|
|
1307
1307
|
return this._createOnRestPromise(resolveImmediately);
|
|
1308
1308
|
}
|
|
1309
|
-
/**
|
|
1310
|
-
* Dolly in/out camera position.
|
|
1311
|
-
* @param distance Distance of dollyIn. Negative number for dollyOut.
|
|
1312
|
-
* @param enableTransition Whether to move smoothly or immediately.
|
|
1313
|
-
* @category Methods
|
|
1309
|
+
/**
|
|
1310
|
+
* Dolly in/out camera position.
|
|
1311
|
+
* @param distance Distance of dollyIn. Negative number for dollyOut.
|
|
1312
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
1313
|
+
* @category Methods
|
|
1314
1314
|
*/
|
|
1315
1315
|
}, {
|
|
1316
1316
|
key: "dolly",
|
|
@@ -1318,11 +1318,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1318
1318
|
var enableTransition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1319
1319
|
return this.dollyTo(this._sphericalEnd.radius - distance, enableTransition);
|
|
1320
1320
|
}
|
|
1321
|
-
/**
|
|
1322
|
-
* Dolly in/out camera position to given distance.
|
|
1323
|
-
* @param distance Distance of dolly.
|
|
1324
|
-
* @param enableTransition Whether to move smoothly or immediately.
|
|
1325
|
-
* @category Methods
|
|
1321
|
+
/**
|
|
1322
|
+
* Dolly in/out camera position to given distance.
|
|
1323
|
+
* @param distance Distance of dolly.
|
|
1324
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
1325
|
+
* @category Methods
|
|
1326
1326
|
*/
|
|
1327
1327
|
}, {
|
|
1328
1328
|
key: "dollyTo",
|
|
@@ -1355,12 +1355,12 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1355
1355
|
var resolveImmediately = !enableTransition || approxEquals(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
1356
1356
|
return this._createOnRestPromise(resolveImmediately);
|
|
1357
1357
|
}
|
|
1358
|
-
/**
|
|
1359
|
-
* Dolly in, but does not change the distance between the target and the camera, and moves the target position instead.
|
|
1360
|
-
* Specify a negative value for dolly out.
|
|
1361
|
-
* @param distance Distance of dolly.
|
|
1362
|
-
* @param enableTransition Whether to move smoothly or immediately.
|
|
1363
|
-
* @category Methods
|
|
1358
|
+
/**
|
|
1359
|
+
* Dolly in, but does not change the distance between the target and the camera, and moves the target position instead.
|
|
1360
|
+
* Specify a negative value for dolly out.
|
|
1361
|
+
* @param distance Distance of dolly.
|
|
1362
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
1363
|
+
* @category Methods
|
|
1364
1364
|
*/
|
|
1365
1365
|
}, {
|
|
1366
1366
|
key: "dollyInFixed",
|
|
@@ -1373,12 +1373,12 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1373
1373
|
var resolveImmediately = !enableTransition || approxEquals(this._target.x, this._targetEnd.x, this.restThreshold) && approxEquals(this._target.y, this._targetEnd.y, this.restThreshold) && approxEquals(this._target.z, this._targetEnd.z, this.restThreshold);
|
|
1374
1374
|
return this._createOnRestPromise(resolveImmediately);
|
|
1375
1375
|
}
|
|
1376
|
-
/**
|
|
1377
|
-
* Zoom in/out camera. The value is added to camera zoom.
|
|
1378
|
-
* Limits set with `.minZoom` and `.maxZoom`
|
|
1379
|
-
* @param zoomStep zoom scale
|
|
1380
|
-
* @param enableTransition Whether to move smoothly or immediately
|
|
1381
|
-
* @category Methods
|
|
1376
|
+
/**
|
|
1377
|
+
* Zoom in/out camera. The value is added to camera zoom.
|
|
1378
|
+
* Limits set with `.minZoom` and `.maxZoom`
|
|
1379
|
+
* @param zoomStep zoom scale
|
|
1380
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1381
|
+
* @category Methods
|
|
1382
1382
|
*/
|
|
1383
1383
|
}, {
|
|
1384
1384
|
key: "zoom",
|
|
@@ -1386,12 +1386,12 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1386
1386
|
var enableTransition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1387
1387
|
return this.zoomTo(this._zoomEnd + zoomStep, enableTransition);
|
|
1388
1388
|
}
|
|
1389
|
-
/**
|
|
1390
|
-
* Zoom in/out camera to given scale. The value overwrites camera zoom.
|
|
1391
|
-
* Limits set with .minZoom and .maxZoom
|
|
1392
|
-
* @param zoom
|
|
1393
|
-
* @param enableTransition
|
|
1394
|
-
* @category Methods
|
|
1389
|
+
/**
|
|
1390
|
+
* Zoom in/out camera to given scale. The value overwrites camera zoom.
|
|
1391
|
+
* Limits set with .minZoom and .maxZoom
|
|
1392
|
+
* @param zoom
|
|
1393
|
+
* @param enableTransition
|
|
1394
|
+
* @category Methods
|
|
1395
1395
|
*/
|
|
1396
1396
|
}, {
|
|
1397
1397
|
key: "zoomTo",
|
|
@@ -1407,9 +1407,9 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1407
1407
|
this._changedZoom = 0;
|
|
1408
1408
|
return this._createOnRestPromise(resolveImmediately);
|
|
1409
1409
|
}
|
|
1410
|
-
/**
|
|
1411
|
-
* @deprecated `pan()` has been renamed to `truck()`
|
|
1412
|
-
* @category Methods
|
|
1410
|
+
/**
|
|
1411
|
+
* @deprecated `pan()` has been renamed to `truck()`
|
|
1412
|
+
* @category Methods
|
|
1413
1413
|
*/
|
|
1414
1414
|
}, {
|
|
1415
1415
|
key: "pan",
|
|
@@ -1418,12 +1418,12 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1418
1418
|
console.warn('`pan` has been renamed to `truck`');
|
|
1419
1419
|
return this.truck(x, y, enableTransition);
|
|
1420
1420
|
}
|
|
1421
|
-
/**
|
|
1422
|
-
* Truck and pedestal camera using current azimuthal angle
|
|
1423
|
-
* @param x Horizontal translate amount
|
|
1424
|
-
* @param y Vertical translate amount
|
|
1425
|
-
* @param enableTransition Whether to move smoothly or immediately
|
|
1426
|
-
* @category Methods
|
|
1421
|
+
/**
|
|
1422
|
+
* Truck and pedestal camera using current azimuthal angle
|
|
1423
|
+
* @param x Horizontal translate amount
|
|
1424
|
+
* @param y Vertical translate amount
|
|
1425
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1426
|
+
* @category Methods
|
|
1427
1427
|
*/
|
|
1428
1428
|
}, {
|
|
1429
1429
|
key: "truck",
|
|
@@ -1438,11 +1438,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1438
1438
|
var to = _v3B.copy(this._targetEnd).add(offset);
|
|
1439
1439
|
return this.moveTo(to.x, to.y, to.z, enableTransition);
|
|
1440
1440
|
}
|
|
1441
|
-
/**
|
|
1442
|
-
* Move forward / backward.
|
|
1443
|
-
* @param distance Amount to move forward / backward. Negative value to move backward
|
|
1444
|
-
* @param enableTransition Whether to move smoothly or immediately
|
|
1445
|
-
* @category Methods
|
|
1441
|
+
/**
|
|
1442
|
+
* Move forward / backward.
|
|
1443
|
+
* @param distance Amount to move forward / backward. Negative value to move backward
|
|
1444
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1445
|
+
* @category Methods
|
|
1446
1446
|
*/
|
|
1447
1447
|
}, {
|
|
1448
1448
|
key: "forward",
|
|
@@ -1454,11 +1454,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1454
1454
|
var to = _v3B.copy(this._targetEnd).add(_v3A);
|
|
1455
1455
|
return this.moveTo(to.x, to.y, to.z, enableTransition);
|
|
1456
1456
|
}
|
|
1457
|
-
/**
|
|
1458
|
-
* Move up / down.
|
|
1459
|
-
* @param height Amount to move up / down. Negative value to move down
|
|
1460
|
-
* @param enableTransition Whether to move smoothly or immediately
|
|
1461
|
-
* @category Methods
|
|
1457
|
+
/**
|
|
1458
|
+
* Move up / down.
|
|
1459
|
+
* @param height Amount to move up / down. Negative value to move down
|
|
1460
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1461
|
+
* @category Methods
|
|
1462
1462
|
*/
|
|
1463
1463
|
}, {
|
|
1464
1464
|
key: "elevate",
|
|
@@ -1467,13 +1467,13 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1467
1467
|
_v3A.copy(this._camera.up).multiplyScalar(height);
|
|
1468
1468
|
return this.moveTo(this._targetEnd.x + _v3A.x, this._targetEnd.y + _v3A.y, this._targetEnd.z + _v3A.z, enableTransition);
|
|
1469
1469
|
}
|
|
1470
|
-
/**
|
|
1471
|
-
* Move target position to given point.
|
|
1472
|
-
* @param x x coord to move center position
|
|
1473
|
-
* @param y y coord to move center position
|
|
1474
|
-
* @param z z coord to move center position
|
|
1475
|
-
* @param enableTransition Whether to move smoothly or immediately
|
|
1476
|
-
* @category Methods
|
|
1470
|
+
/**
|
|
1471
|
+
* Move target position to given point.
|
|
1472
|
+
* @param x x coord to move center position
|
|
1473
|
+
* @param y y coord to move center position
|
|
1474
|
+
* @param z z coord to move center position
|
|
1475
|
+
* @param enableTransition Whether to move smoothly or immediately
|
|
1476
|
+
* @category Methods
|
|
1477
1477
|
*/
|
|
1478
1478
|
}, {
|
|
1479
1479
|
key: "moveTo",
|
|
@@ -1489,14 +1489,14 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1489
1489
|
var resolveImmediately = !enableTransition || approxEquals(this._target.x, this._targetEnd.x, this.restThreshold) && approxEquals(this._target.y, this._targetEnd.y, this.restThreshold) && approxEquals(this._target.z, this._targetEnd.z, this.restThreshold);
|
|
1490
1490
|
return this._createOnRestPromise(resolveImmediately);
|
|
1491
1491
|
}
|
|
1492
|
-
/**
|
|
1493
|
-
* Look in the given point direction.
|
|
1494
|
-
* @param x point x.
|
|
1495
|
-
* @param y point y.
|
|
1496
|
-
* @param z point z.
|
|
1497
|
-
* @param enableTransition Whether to move smoothly or immediately.
|
|
1498
|
-
* @returns Transition end promise
|
|
1499
|
-
* @category Methods
|
|
1492
|
+
/**
|
|
1493
|
+
* Look in the given point direction.
|
|
1494
|
+
* @param x point x.
|
|
1495
|
+
* @param y point y.
|
|
1496
|
+
* @param z point z.
|
|
1497
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
1498
|
+
* @returns Transition end promise
|
|
1499
|
+
* @category Methods
|
|
1500
1500
|
*/
|
|
1501
1501
|
}, {
|
|
1502
1502
|
key: "lookInDirectionOf",
|
|
@@ -1507,18 +1507,18 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1507
1507
|
var position = direction.multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);
|
|
1508
1508
|
return this.setPosition(position.x, position.y, position.z, enableTransition);
|
|
1509
1509
|
}
|
|
1510
|
-
/**
|
|
1511
|
-
* Fit the viewport to the box or the bounding box of the object, using the nearest axis. paddings are in unit.
|
|
1512
|
-
* set `cover: true` to fill enter screen.
|
|
1513
|
-
* e.g.
|
|
1514
|
-
* ```
|
|
1515
|
-
* cameraControls.fitToBox( myMesh );
|
|
1516
|
-
* ```
|
|
1517
|
-
* @param box3OrObject Axis aligned bounding box to fit the view.
|
|
1518
|
-
* @param enableTransition Whether to move smoothly or immediately.
|
|
1519
|
-
* @param options | `<object>` { cover: boolean, paddingTop: number, paddingLeft: number, paddingBottom: number, paddingRight: number }
|
|
1520
|
-
* @returns Transition end promise
|
|
1521
|
-
* @category Methods
|
|
1510
|
+
/**
|
|
1511
|
+
* Fit the viewport to the box or the bounding box of the object, using the nearest axis. paddings are in unit.
|
|
1512
|
+
* set `cover: true` to fill enter screen.
|
|
1513
|
+
* e.g.
|
|
1514
|
+
* ```
|
|
1515
|
+
* cameraControls.fitToBox( myMesh );
|
|
1516
|
+
* ```
|
|
1517
|
+
* @param box3OrObject Axis aligned bounding box to fit the view.
|
|
1518
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
1519
|
+
* @param options | `<object>` { cover: boolean, paddingTop: number, paddingLeft: number, paddingBottom: number, paddingRight: number }
|
|
1520
|
+
* @returns Transition end promise
|
|
1521
|
+
* @category Methods
|
|
1522
1522
|
*/
|
|
1523
1523
|
}, {
|
|
1524
1524
|
key: "fitToBox",
|
|
@@ -1605,11 +1605,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1605
1605
|
}
|
|
1606
1606
|
return Promise.all(promises);
|
|
1607
1607
|
}
|
|
1608
|
-
/**
|
|
1609
|
-
* Fit the viewport to the sphere or the bounding sphere of the object.
|
|
1610
|
-
* @param sphereOrMesh
|
|
1611
|
-
* @param enableTransition
|
|
1612
|
-
* @category Methods
|
|
1608
|
+
/**
|
|
1609
|
+
* Fit the viewport to the sphere or the bounding sphere of the object.
|
|
1610
|
+
* @param sphereOrMesh
|
|
1611
|
+
* @param enableTransition
|
|
1612
|
+
* @category Methods
|
|
1613
1613
|
*/
|
|
1614
1614
|
}, {
|
|
1615
1615
|
key: "fitToSphere",
|
|
@@ -1631,16 +1631,16 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1631
1631
|
promises.push(this.setFocalOffset(0, 0, 0, enableTransition));
|
|
1632
1632
|
return Promise.all(promises);
|
|
1633
1633
|
}
|
|
1634
|
-
/**
|
|
1635
|
-
* Look at the `target` from the `position`.
|
|
1636
|
-
* @param positionX
|
|
1637
|
-
* @param positionY
|
|
1638
|
-
* @param positionZ
|
|
1639
|
-
* @param targetX
|
|
1640
|
-
* @param targetY
|
|
1641
|
-
* @param targetZ
|
|
1642
|
-
* @param enableTransition
|
|
1643
|
-
* @category Methods
|
|
1634
|
+
/**
|
|
1635
|
+
* Look at the `target` from the `position`.
|
|
1636
|
+
* @param positionX
|
|
1637
|
+
* @param positionY
|
|
1638
|
+
* @param positionZ
|
|
1639
|
+
* @param targetX
|
|
1640
|
+
* @param targetY
|
|
1641
|
+
* @param targetZ
|
|
1642
|
+
* @param enableTransition
|
|
1643
|
+
* @category Methods
|
|
1644
1644
|
*/
|
|
1645
1645
|
}, {
|
|
1646
1646
|
key: "setLookAt",
|
|
@@ -1664,23 +1664,23 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1664
1664
|
var resolveImmediately = !enableTransition || approxEquals(this._target.x, this._targetEnd.x, this.restThreshold) && approxEquals(this._target.y, this._targetEnd.y, this.restThreshold) && approxEquals(this._target.z, this._targetEnd.z, this.restThreshold) && approxEquals(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && approxEquals(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && approxEquals(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
1665
1665
|
return this._createOnRestPromise(resolveImmediately);
|
|
1666
1666
|
}
|
|
1667
|
-
/**
|
|
1668
|
-
* Similar to setLookAt, but it interpolates between two states.
|
|
1669
|
-
* @param positionAX
|
|
1670
|
-
* @param positionAY
|
|
1671
|
-
* @param positionAZ
|
|
1672
|
-
* @param targetAX
|
|
1673
|
-
* @param targetAY
|
|
1674
|
-
* @param targetAZ
|
|
1675
|
-
* @param positionBX
|
|
1676
|
-
* @param positionBY
|
|
1677
|
-
* @param positionBZ
|
|
1678
|
-
* @param targetBX
|
|
1679
|
-
* @param targetBY
|
|
1680
|
-
* @param targetBZ
|
|
1681
|
-
* @param t
|
|
1682
|
-
* @param enableTransition
|
|
1683
|
-
* @category Methods
|
|
1667
|
+
/**
|
|
1668
|
+
* Similar to setLookAt, but it interpolates between two states.
|
|
1669
|
+
* @param positionAX
|
|
1670
|
+
* @param positionAY
|
|
1671
|
+
* @param positionAZ
|
|
1672
|
+
* @param targetAX
|
|
1673
|
+
* @param targetAY
|
|
1674
|
+
* @param targetAZ
|
|
1675
|
+
* @param positionBX
|
|
1676
|
+
* @param positionBY
|
|
1677
|
+
* @param positionBZ
|
|
1678
|
+
* @param targetBX
|
|
1679
|
+
* @param targetBY
|
|
1680
|
+
* @param targetBZ
|
|
1681
|
+
* @param t
|
|
1682
|
+
* @param enableTransition
|
|
1683
|
+
* @category Methods
|
|
1684
1684
|
*/
|
|
1685
1685
|
}, {
|
|
1686
1686
|
key: "lerpLookAt",
|
|
@@ -1711,14 +1711,14 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1711
1711
|
var resolveImmediately = !enableTransition || approxEquals(this._target.x, this._targetEnd.x, this.restThreshold) && approxEquals(this._target.y, this._targetEnd.y, this.restThreshold) && approxEquals(this._target.z, this._targetEnd.z, this.restThreshold) && approxEquals(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && approxEquals(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && approxEquals(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
1712
1712
|
return this._createOnRestPromise(resolveImmediately);
|
|
1713
1713
|
}
|
|
1714
|
-
/**
|
|
1715
|
-
* Set angle and distance by given position.
|
|
1716
|
-
* An alias of `setLookAt()`, without target change. Thus keep gazing at the current target
|
|
1717
|
-
* @param positionX
|
|
1718
|
-
* @param positionY
|
|
1719
|
-
* @param positionZ
|
|
1720
|
-
* @param enableTransition
|
|
1721
|
-
* @category Methods
|
|
1714
|
+
/**
|
|
1715
|
+
* Set angle and distance by given position.
|
|
1716
|
+
* An alias of `setLookAt()`, without target change. Thus keep gazing at the current target
|
|
1717
|
+
* @param positionX
|
|
1718
|
+
* @param positionY
|
|
1719
|
+
* @param positionZ
|
|
1720
|
+
* @param enableTransition
|
|
1721
|
+
* @category Methods
|
|
1722
1722
|
*/
|
|
1723
1723
|
}, {
|
|
1724
1724
|
key: "setPosition",
|
|
@@ -1726,14 +1726,14 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1726
1726
|
var enableTransition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
1727
1727
|
return this.setLookAt(positionX, positionY, positionZ, this._targetEnd.x, this._targetEnd.y, this._targetEnd.z, enableTransition);
|
|
1728
1728
|
}
|
|
1729
|
-
/**
|
|
1730
|
-
* Set the target position where gaze at.
|
|
1731
|
-
* An alias of `setLookAt()`, without position change. Thus keep the same position.
|
|
1732
|
-
* @param targetX
|
|
1733
|
-
* @param targetY
|
|
1734
|
-
* @param targetZ
|
|
1735
|
-
* @param enableTransition
|
|
1736
|
-
* @category Methods
|
|
1729
|
+
/**
|
|
1730
|
+
* Set the target position where gaze at.
|
|
1731
|
+
* An alias of `setLookAt()`, without position change. Thus keep the same position.
|
|
1732
|
+
* @param targetX
|
|
1733
|
+
* @param targetY
|
|
1734
|
+
* @param targetZ
|
|
1735
|
+
* @param enableTransition
|
|
1736
|
+
* @category Methods
|
|
1737
1737
|
*/
|
|
1738
1738
|
}, {
|
|
1739
1739
|
key: "setTarget",
|
|
@@ -1745,13 +1745,13 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1745
1745
|
this._sphericalEnd.phi = clamp(this._sphericalEnd.phi, this.minPolarAngle, this.maxPolarAngle);
|
|
1746
1746
|
return promise;
|
|
1747
1747
|
}
|
|
1748
|
-
/**
|
|
1749
|
-
* Set focal offset using the screen parallel coordinates. z doesn't affect in Orthographic as with Dolly.
|
|
1750
|
-
* @param x
|
|
1751
|
-
* @param y
|
|
1752
|
-
* @param z
|
|
1753
|
-
* @param enableTransition
|
|
1754
|
-
* @category Methods
|
|
1748
|
+
/**
|
|
1749
|
+
* Set focal offset using the screen parallel coordinates. z doesn't affect in Orthographic as with Dolly.
|
|
1750
|
+
* @param x
|
|
1751
|
+
* @param y
|
|
1752
|
+
* @param z
|
|
1753
|
+
* @param enableTransition
|
|
1754
|
+
* @category Methods
|
|
1755
1755
|
*/
|
|
1756
1756
|
}, {
|
|
1757
1757
|
key: "setFocalOffset",
|
|
@@ -1764,13 +1764,13 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1764
1764
|
var resolveImmediately = !enableTransition || approxEquals(this._focalOffset.x, this._focalOffsetEnd.x, this.restThreshold) && approxEquals(this._focalOffset.y, this._focalOffsetEnd.y, this.restThreshold) && approxEquals(this._focalOffset.z, this._focalOffsetEnd.z, this.restThreshold);
|
|
1765
1765
|
return this._createOnRestPromise(resolveImmediately);
|
|
1766
1766
|
}
|
|
1767
|
-
/**
|
|
1768
|
-
* Set orbit point without moving the camera.
|
|
1769
|
-
* SHOULD NOT RUN DURING ANIMATIONS. `setOrbitPoint()` will immediately fix the positions.
|
|
1770
|
-
* @param targetX
|
|
1771
|
-
* @param targetY
|
|
1772
|
-
* @param targetZ
|
|
1773
|
-
* @category Methods
|
|
1767
|
+
/**
|
|
1768
|
+
* Set orbit point without moving the camera.
|
|
1769
|
+
* SHOULD NOT RUN DURING ANIMATIONS. `setOrbitPoint()` will immediately fix the positions.
|
|
1770
|
+
* @param targetX
|
|
1771
|
+
* @param targetY
|
|
1772
|
+
* @param targetZ
|
|
1773
|
+
* @category Methods
|
|
1774
1774
|
*/
|
|
1775
1775
|
}, {
|
|
1776
1776
|
key: "setOrbitPoint",
|
|
@@ -1791,10 +1791,10 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1791
1791
|
this.setFocalOffset(-_v3A.x, _v3A.y, -_v3A.z, false);
|
|
1792
1792
|
this.moveTo(targetX, targetY, targetZ, false);
|
|
1793
1793
|
}
|
|
1794
|
-
/**
|
|
1795
|
-
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
1796
|
-
* @param box3
|
|
1797
|
-
* @category Methods
|
|
1794
|
+
/**
|
|
1795
|
+
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
1796
|
+
* @param box3
|
|
1797
|
+
* @category Methods
|
|
1798
1798
|
*/
|
|
1799
1799
|
}, {
|
|
1800
1800
|
key: "setBoundary",
|
|
@@ -1809,14 +1809,14 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1809
1809
|
this._boundary.clampPoint(this._targetEnd, this._targetEnd);
|
|
1810
1810
|
this._needsUpdate = true;
|
|
1811
1811
|
}
|
|
1812
|
-
/**
|
|
1813
|
-
* Set (or unset) the current viewport.
|
|
1814
|
-
* Set this when you want to use renderer viewport and .dollyToCursor feature at the same time.
|
|
1815
|
-
* @param viewportOrX
|
|
1816
|
-
* @param y
|
|
1817
|
-
* @param width
|
|
1818
|
-
* @param height
|
|
1819
|
-
* @category Methods
|
|
1812
|
+
/**
|
|
1813
|
+
* Set (or unset) the current viewport.
|
|
1814
|
+
* Set this when you want to use renderer viewport and .dollyToCursor feature at the same time.
|
|
1815
|
+
* @param viewportOrX
|
|
1816
|
+
* @param y
|
|
1817
|
+
* @param width
|
|
1818
|
+
* @param height
|
|
1819
|
+
* @category Methods
|
|
1820
1820
|
*/
|
|
1821
1821
|
}, {
|
|
1822
1822
|
key: "setViewport",
|
|
@@ -1835,13 +1835,13 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1835
1835
|
this._viewport.copy(viewportOrX);
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
|
-
/**
|
|
1839
|
-
* Calculate the distance to fit the box.
|
|
1840
|
-
* @param width box width
|
|
1841
|
-
* @param height box height
|
|
1842
|
-
* @param depth box depth
|
|
1843
|
-
* @returns distance
|
|
1844
|
-
* @category Methods
|
|
1838
|
+
/**
|
|
1839
|
+
* Calculate the distance to fit the box.
|
|
1840
|
+
* @param width box width
|
|
1841
|
+
* @param height box height
|
|
1842
|
+
* @param depth box depth
|
|
1843
|
+
* @returns distance
|
|
1844
|
+
* @category Methods
|
|
1845
1845
|
*/
|
|
1846
1846
|
}, {
|
|
1847
1847
|
key: "getDistanceToFitBox",
|
|
@@ -1854,11 +1854,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1854
1854
|
var heightToFit = (cover ? boundingRectAspect > aspect : boundingRectAspect < aspect) ? height : width / aspect;
|
|
1855
1855
|
return heightToFit * 0.5 / Math.tan(fov * 0.5) + depth * 0.5;
|
|
1856
1856
|
}
|
|
1857
|
-
/**
|
|
1858
|
-
* Calculate the distance to fit the sphere.
|
|
1859
|
-
* @param radius sphere radius
|
|
1860
|
-
* @returns distance
|
|
1861
|
-
* @category Methods
|
|
1857
|
+
/**
|
|
1858
|
+
* Calculate the distance to fit the sphere.
|
|
1859
|
+
* @param radius sphere radius
|
|
1860
|
+
* @returns distance
|
|
1861
|
+
* @category Methods
|
|
1862
1862
|
*/
|
|
1863
1863
|
}, {
|
|
1864
1864
|
key: "getDistanceToFitSphere",
|
|
@@ -1870,11 +1870,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1870
1870
|
var fov = 1 < this._camera.aspect ? vFOV : hFOV;
|
|
1871
1871
|
return radius / Math.sin(fov * 0.5);
|
|
1872
1872
|
}
|
|
1873
|
-
/**
|
|
1874
|
-
* Returns the orbit center position, where the camera looking at.
|
|
1875
|
-
* @param out The receiving Vector3 instance to copy the result
|
|
1876
|
-
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1877
|
-
* @category Methods
|
|
1873
|
+
/**
|
|
1874
|
+
* Returns the orbit center position, where the camera looking at.
|
|
1875
|
+
* @param out The receiving Vector3 instance to copy the result
|
|
1876
|
+
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1877
|
+
* @category Methods
|
|
1878
1878
|
*/
|
|
1879
1879
|
}, {
|
|
1880
1880
|
key: "getTarget",
|
|
@@ -1883,11 +1883,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1883
1883
|
var _out = !!out && out.isVector3 ? out : new THREE.Vector3();
|
|
1884
1884
|
return _out.copy(receiveEndValue ? this._targetEnd : this._target);
|
|
1885
1885
|
}
|
|
1886
|
-
/**
|
|
1887
|
-
* Returns the camera position.
|
|
1888
|
-
* @param out The receiving Vector3 instance to copy the result
|
|
1889
|
-
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1890
|
-
* @category Methods
|
|
1886
|
+
/**
|
|
1887
|
+
* Returns the camera position.
|
|
1888
|
+
* @param out The receiving Vector3 instance to copy the result
|
|
1889
|
+
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1890
|
+
* @category Methods
|
|
1891
1891
|
*/
|
|
1892
1892
|
}, {
|
|
1893
1893
|
key: "getPosition",
|
|
@@ -1896,11 +1896,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1896
1896
|
var _out = !!out && out.isVector3 ? out : new THREE.Vector3();
|
|
1897
1897
|
return _out.setFromSpherical(receiveEndValue ? this._sphericalEnd : this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(receiveEndValue ? this._targetEnd : this._target);
|
|
1898
1898
|
}
|
|
1899
|
-
/**
|
|
1900
|
-
* Returns the spherical coordinates of the orbit.
|
|
1901
|
-
* @param out The receiving Spherical instance to copy the result
|
|
1902
|
-
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1903
|
-
* @category Methods
|
|
1899
|
+
/**
|
|
1900
|
+
* Returns the spherical coordinates of the orbit.
|
|
1901
|
+
* @param out The receiving Spherical instance to copy the result
|
|
1902
|
+
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1903
|
+
* @category Methods
|
|
1904
1904
|
*/
|
|
1905
1905
|
}, {
|
|
1906
1906
|
key: "getSpherical",
|
|
@@ -1909,11 +1909,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1909
1909
|
var _out = out || new THREE.Spherical();
|
|
1910
1910
|
return _out.copy(receiveEndValue ? this._sphericalEnd : this._spherical);
|
|
1911
1911
|
}
|
|
1912
|
-
/**
|
|
1913
|
-
* Returns the focal offset, which is how much the camera appears to be translated in screen parallel coordinates.
|
|
1914
|
-
* @param out The receiving Vector3 instance to copy the result
|
|
1915
|
-
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1916
|
-
* @category Methods
|
|
1912
|
+
/**
|
|
1913
|
+
* Returns the focal offset, which is how much the camera appears to be translated in screen parallel coordinates.
|
|
1914
|
+
* @param out The receiving Vector3 instance to copy the result
|
|
1915
|
+
* @param receiveEndValue Whether receive the transition end coords or current. default is `true`
|
|
1916
|
+
* @category Methods
|
|
1917
1917
|
*/
|
|
1918
1918
|
}, {
|
|
1919
1919
|
key: "getFocalOffset",
|
|
@@ -1922,9 +1922,9 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1922
1922
|
var _out = !!out && out.isVector3 ? out : new THREE.Vector3();
|
|
1923
1923
|
return _out.copy(receiveEndValue ? this._focalOffsetEnd : this._focalOffset);
|
|
1924
1924
|
}
|
|
1925
|
-
/**
|
|
1926
|
-
* Normalize camera azimuth angle rotation between 0 and 360 degrees.
|
|
1927
|
-
* @category Methods
|
|
1925
|
+
/**
|
|
1926
|
+
* Normalize camera azimuth angle rotation between 0 and 360 degrees.
|
|
1927
|
+
* @category Methods
|
|
1928
1928
|
*/
|
|
1929
1929
|
}, {
|
|
1930
1930
|
key: "normalizeRotations",
|
|
@@ -1933,10 +1933,10 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1933
1933
|
if (this._sphericalEnd.theta < 0) this._sphericalEnd.theta += PI_2;
|
|
1934
1934
|
this._spherical.theta += PI_2 * Math.round((this._sphericalEnd.theta - this._spherical.theta) / PI_2);
|
|
1935
1935
|
}
|
|
1936
|
-
/**
|
|
1937
|
-
* Reset all rotation and position to defaults.
|
|
1938
|
-
* @param enableTransition
|
|
1939
|
-
* @category Methods
|
|
1936
|
+
/**
|
|
1937
|
+
* Reset all rotation and position to defaults.
|
|
1938
|
+
* @param enableTransition
|
|
1939
|
+
* @category Methods
|
|
1940
1940
|
*/
|
|
1941
1941
|
}, {
|
|
1942
1942
|
key: "reset",
|
|
@@ -1951,9 +1951,9 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1951
1951
|
var promises = [this.setLookAt(this._position0.x, this._position0.y, this._position0.z, this._target0.x, this._target0.y, this._target0.z, enableTransition), this.setFocalOffset(this._focalOffset0.x, this._focalOffset0.y, this._focalOffset0.z, enableTransition), this.zoomTo(this._zoom0, enableTransition)];
|
|
1952
1952
|
return Promise.all(promises);
|
|
1953
1953
|
}
|
|
1954
|
-
/**
|
|
1955
|
-
* Set current camera position as the default position.
|
|
1956
|
-
* @category Methods
|
|
1954
|
+
/**
|
|
1955
|
+
* Set current camera position as the default position.
|
|
1956
|
+
* @category Methods
|
|
1957
1957
|
*/
|
|
1958
1958
|
}, {
|
|
1959
1959
|
key: "saveState",
|
|
@@ -1964,10 +1964,10 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1964
1964
|
this._zoom0 = this._zoom;
|
|
1965
1965
|
this._focalOffset0.copy(this._focalOffset);
|
|
1966
1966
|
}
|
|
1967
|
-
/**
|
|
1968
|
-
* Sync camera-up direction.
|
|
1969
|
-
* When camera-up vector is changed, `.updateCameraUp()` must be called.
|
|
1970
|
-
* @category Methods
|
|
1967
|
+
/**
|
|
1968
|
+
* Sync camera-up direction.
|
|
1969
|
+
* When camera-up vector is changed, `.updateCameraUp()` must be called.
|
|
1970
|
+
* @category Methods
|
|
1971
1971
|
*/
|
|
1972
1972
|
}, {
|
|
1973
1973
|
key: "updateCameraUp",
|
|
@@ -1975,10 +1975,10 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1975
1975
|
this._yAxisUpSpace.setFromUnitVectors(this._camera.up, _AXIS_Y);
|
|
1976
1976
|
this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert();
|
|
1977
1977
|
}
|
|
1978
|
-
/**
|
|
1979
|
-
* Apply current camera-up direction to the camera.
|
|
1980
|
-
* The orbit system will be re-initialized with the current position.
|
|
1981
|
-
* @category Methods
|
|
1978
|
+
/**
|
|
1979
|
+
* Apply current camera-up direction to the camera.
|
|
1980
|
+
* The orbit system will be re-initialized with the current position.
|
|
1981
|
+
* @category Methods
|
|
1982
1982
|
*/
|
|
1983
1983
|
}, {
|
|
1984
1984
|
key: "applyCameraUp",
|
|
@@ -1995,12 +1995,12 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
1995
1995
|
this.updateCameraUp();
|
|
1996
1996
|
this.setPosition(position.x, position.y, position.z);
|
|
1997
1997
|
}
|
|
1998
|
-
/**
|
|
1999
|
-
* Update camera position and directions.
|
|
2000
|
-
* This should be called in your tick loop every time, and returns true if re-rendering is needed.
|
|
2001
|
-
* @param delta
|
|
2002
|
-
* @returns updated
|
|
2003
|
-
* @category Methods
|
|
1998
|
+
/**
|
|
1999
|
+
* Update camera position and directions.
|
|
2000
|
+
* This should be called in your tick loop every time, and returns true if re-rendering is needed.
|
|
2001
|
+
* @param delta
|
|
2002
|
+
* @returns updated
|
|
2003
|
+
* @category Methods
|
|
2004
2004
|
*/
|
|
2005
2005
|
}, {
|
|
2006
2006
|
key: "update",
|
|
@@ -2180,9 +2180,9 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2180
2180
|
this._needsUpdate = false;
|
|
2181
2181
|
return updated;
|
|
2182
2182
|
}
|
|
2183
|
-
/**
|
|
2184
|
-
* Get all state in JSON string
|
|
2185
|
-
* @category Methods
|
|
2183
|
+
/**
|
|
2184
|
+
* Get all state in JSON string
|
|
2185
|
+
* @category Methods
|
|
2186
2186
|
*/
|
|
2187
2187
|
}, {
|
|
2188
2188
|
key: "toJSON",
|
|
@@ -2213,11 +2213,11 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2213
2213
|
focalOffset0: this._focalOffset0.toArray()
|
|
2214
2214
|
});
|
|
2215
2215
|
}
|
|
2216
|
-
/**
|
|
2217
|
-
* Reproduce the control state with JSON. enableTransition is where anim or not in a boolean.
|
|
2218
|
-
* @param json
|
|
2219
|
-
* @param enableTransition
|
|
2220
|
-
* @category Methods
|
|
2216
|
+
/**
|
|
2217
|
+
* Reproduce the control state with JSON. enableTransition is where anim or not in a boolean.
|
|
2218
|
+
* @param json
|
|
2219
|
+
* @param enableTransition
|
|
2220
|
+
* @category Methods
|
|
2221
2221
|
*/
|
|
2222
2222
|
}, {
|
|
2223
2223
|
key: "fromJSON",
|
|
@@ -2251,9 +2251,9 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2251
2251
|
this.setFocalOffset(obj.focalOffset[0], obj.focalOffset[1], obj.focalOffset[2], enableTransition);
|
|
2252
2252
|
this._needsUpdate = true;
|
|
2253
2253
|
}
|
|
2254
|
-
/**
|
|
2255
|
-
* Attach all internal event handlers to enable drag control.
|
|
2256
|
-
* @category Methods
|
|
2254
|
+
/**
|
|
2255
|
+
* Attach all internal event handlers to enable drag control.
|
|
2256
|
+
* @category Methods
|
|
2257
2257
|
*/
|
|
2258
2258
|
}, {
|
|
2259
2259
|
key: "connect",
|
|
@@ -2266,8 +2266,8 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2266
2266
|
this._addAllEventListeners(domElement);
|
|
2267
2267
|
this._getClientRect(this._elementRect);
|
|
2268
2268
|
}
|
|
2269
|
-
/**
|
|
2270
|
-
* Detach all internal event handlers to disable drag control.
|
|
2269
|
+
/**
|
|
2270
|
+
* Detach all internal event handlers to disable drag control.
|
|
2271
2271
|
*/
|
|
2272
2272
|
}, {
|
|
2273
2273
|
key: "disconnect",
|
|
@@ -2279,9 +2279,9 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2279
2279
|
this._domElement = undefined;
|
|
2280
2280
|
}
|
|
2281
2281
|
}
|
|
2282
|
-
/**
|
|
2283
|
-
* Dispose the cameraControls instance itself, remove all eventListeners.
|
|
2284
|
-
* @category Methods
|
|
2282
|
+
/**
|
|
2283
|
+
* Dispose the cameraControls instance itself, remove all eventListeners.
|
|
2284
|
+
* @category Methods
|
|
2285
2285
|
*/
|
|
2286
2286
|
}, {
|
|
2287
2287
|
key: "dispose",
|
|
@@ -2398,8 +2398,8 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2398
2398
|
}
|
|
2399
2399
|
return distance;
|
|
2400
2400
|
}
|
|
2401
|
-
/**
|
|
2402
|
-
* Get its client rect and package into given `DOMRect` .
|
|
2401
|
+
/**
|
|
2402
|
+
* Get its client rect and package into given `DOMRect` .
|
|
2403
2403
|
*/
|
|
2404
2404
|
}, {
|
|
2405
2405
|
key: "_getClientRect",
|
|
@@ -2443,10 +2443,10 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2443
2443
|
}, {
|
|
2444
2444
|
key: "_removeAllEventListeners",
|
|
2445
2445
|
value: function _removeAllEventListeners() {}
|
|
2446
|
-
/**
|
|
2447
|
-
* backward compatible
|
|
2448
|
-
* @deprecated use smoothTime (in seconds) instead
|
|
2449
|
-
* @category Properties
|
|
2446
|
+
/**
|
|
2447
|
+
* backward compatible
|
|
2448
|
+
* @deprecated use smoothTime (in seconds) instead
|
|
2449
|
+
* @category Properties
|
|
2450
2450
|
*/
|
|
2451
2451
|
}, {
|
|
2452
2452
|
key: "dampingFactor",
|
|
@@ -2454,18 +2454,18 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2454
2454
|
console.warn('.dampingFactor has been deprecated. use smoothTime (in seconds) instead.');
|
|
2455
2455
|
return 0;
|
|
2456
2456
|
}
|
|
2457
|
-
/**
|
|
2458
|
-
* backward compatible
|
|
2459
|
-
* @deprecated use smoothTime (in seconds) instead
|
|
2460
|
-
* @category Properties
|
|
2457
|
+
/**
|
|
2458
|
+
* backward compatible
|
|
2459
|
+
* @deprecated use smoothTime (in seconds) instead
|
|
2460
|
+
* @category Properties
|
|
2461
2461
|
*/,
|
|
2462
2462
|
set: function set(_) {
|
|
2463
2463
|
console.warn('.dampingFactor has been deprecated. use smoothTime (in seconds) instead.');
|
|
2464
2464
|
}
|
|
2465
|
-
/**
|
|
2466
|
-
* backward compatible
|
|
2467
|
-
* @deprecated use draggingSmoothTime (in seconds) instead
|
|
2468
|
-
* @category Properties
|
|
2465
|
+
/**
|
|
2466
|
+
* backward compatible
|
|
2467
|
+
* @deprecated use draggingSmoothTime (in seconds) instead
|
|
2468
|
+
* @category Properties
|
|
2469
2469
|
*/
|
|
2470
2470
|
}, {
|
|
2471
2471
|
key: "draggingDampingFactor",
|
|
@@ -2473,10 +2473,10 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2473
2473
|
console.warn('.draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.');
|
|
2474
2474
|
return 0;
|
|
2475
2475
|
}
|
|
2476
|
-
/**
|
|
2477
|
-
* backward compatible
|
|
2478
|
-
* @deprecated use draggingSmoothTime (in seconds) instead
|
|
2479
|
-
* @category Properties
|
|
2476
|
+
/**
|
|
2477
|
+
* backward compatible
|
|
2478
|
+
* @deprecated use draggingSmoothTime (in seconds) instead
|
|
2479
|
+
* @category Properties
|
|
2480
2480
|
*/,
|
|
2481
2481
|
set: function set(_) {
|
|
2482
2482
|
console.warn('.draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.');
|
|
@@ -2484,44 +2484,44 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2484
2484
|
}], [{
|
|
2485
2485
|
key: "install",
|
|
2486
2486
|
value:
|
|
2487
|
-
/**
|
|
2488
|
-
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
2489
|
-
*
|
|
2490
|
-
* e.g
|
|
2491
|
-
* ```javascript
|
|
2492
|
-
* CameraControls.install( { THREE: THREE } );
|
|
2493
|
-
* ```
|
|
2494
|
-
*
|
|
2495
|
-
* Note: If you do not wish to use enter three.js to reduce file size(tree-shaking for example), make a subset to install.
|
|
2496
|
-
*
|
|
2497
|
-
* ```js
|
|
2498
|
-
* import {
|
|
2499
|
-
* Vector2,
|
|
2500
|
-
* Vector3,
|
|
2501
|
-
* Vector4,
|
|
2502
|
-
* Quaternion,
|
|
2503
|
-
* Matrix4,
|
|
2504
|
-
* Spherical,
|
|
2505
|
-
* Box3,
|
|
2506
|
-
* Sphere,
|
|
2507
|
-
* Raycaster,
|
|
2508
|
-
* MathUtils,
|
|
2509
|
-
* } from 'three';
|
|
2510
|
-
*
|
|
2511
|
-
* const subsetOfTHREE = {
|
|
2512
|
-
* Vector2 : Vector2,
|
|
2513
|
-
* Vector3 : Vector3,
|
|
2514
|
-
* Vector4 : Vector4,
|
|
2515
|
-
* Quaternion: Quaternion,
|
|
2516
|
-
* Matrix4 : Matrix4,
|
|
2517
|
-
* Spherical : Spherical,
|
|
2518
|
-
* Box3 : Box3,
|
|
2519
|
-
* Sphere : Sphere,
|
|
2520
|
-
* Raycaster : Raycaster,
|
|
2521
|
-
* };
|
|
2522
|
-
|
|
2523
|
-
* ```
|
|
2524
|
-
* @category Statics
|
|
2487
|
+
/**
|
|
2488
|
+
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
2489
|
+
*
|
|
2490
|
+
* e.g
|
|
2491
|
+
* ```javascript
|
|
2492
|
+
* CameraControls.install( { THREE: THREE } );
|
|
2493
|
+
* ```
|
|
2494
|
+
*
|
|
2495
|
+
* Note: If you do not wish to use enter three.js to reduce file size(tree-shaking for example), make a subset to install.
|
|
2496
|
+
*
|
|
2497
|
+
* ```js
|
|
2498
|
+
* import {
|
|
2499
|
+
* Vector2,
|
|
2500
|
+
* Vector3,
|
|
2501
|
+
* Vector4,
|
|
2502
|
+
* Quaternion,
|
|
2503
|
+
* Matrix4,
|
|
2504
|
+
* Spherical,
|
|
2505
|
+
* Box3,
|
|
2506
|
+
* Sphere,
|
|
2507
|
+
* Raycaster,
|
|
2508
|
+
* MathUtils,
|
|
2509
|
+
* } from 'three';
|
|
2510
|
+
*
|
|
2511
|
+
* const subsetOfTHREE = {
|
|
2512
|
+
* Vector2 : Vector2,
|
|
2513
|
+
* Vector3 : Vector3,
|
|
2514
|
+
* Vector4 : Vector4,
|
|
2515
|
+
* Quaternion: Quaternion,
|
|
2516
|
+
* Matrix4 : Matrix4,
|
|
2517
|
+
* Spherical : Spherical,
|
|
2518
|
+
* Box3 : Box3,
|
|
2519
|
+
* Sphere : Sphere,
|
|
2520
|
+
* Raycaster : Raycaster,
|
|
2521
|
+
* };
|
|
2522
|
+
* CameraControls.install( { THREE: subsetOfTHREE } );
|
|
2523
|
+
* ```
|
|
2524
|
+
* @category Statics
|
|
2525
2525
|
*/
|
|
2526
2526
|
function install(libs) {
|
|
2527
2527
|
THREE = libs.THREE;
|
|
@@ -2548,9 +2548,9 @@ var CameraControls = exports["default"] = /*#__PURE__*/function (_EventDispatche
|
|
|
2548
2548
|
_rotationMatrix = new THREE.Matrix4();
|
|
2549
2549
|
_raycaster = new THREE.Raycaster();
|
|
2550
2550
|
}
|
|
2551
|
-
/**
|
|
2552
|
-
* list all ACTIONs
|
|
2553
|
-
* @category Statics
|
|
2551
|
+
/**
|
|
2552
|
+
* list all ACTIONs
|
|
2553
|
+
* @category Statics
|
|
2554
2554
|
*/
|
|
2555
2555
|
}, {
|
|
2556
2556
|
key: "ACTION",
|