@xeokit/xeokit-sdk 2.6.54 → 2.6.55
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/dist/xeokit-sdk.cjs.js +45 -15
- package/dist/xeokit-sdk.es.js +45 -15
- package/dist/xeokit-sdk.es5.js +27 -10
- package/dist/xeokit-sdk.min.cjs.js +2 -2
- package/dist/xeokit-sdk.min.es.js +4 -4
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
- package/src/viewer/scene/CameraControl/CameraControl.js +38 -0
- package/src/viewer/scene/CameraControl/lib/CameraUpdater.js +5 -4
- package/src/viewer/scene/CameraControl/lib/handlers/KeyboardPanRotateDollyHandler.js +0 -8
- package/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +0 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/VBOInstancingTrianglesLayer.js +1 -1
- package/types/viewer/scene/CameraControl/CameraControl.d.ts +23 -0
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -61851,7 +61851,7 @@ class VBOInstancingTrianglesLayer {
|
|
|
61851
61851
|
state.indicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(geometry.indices), geometry.indices.length, 1, gl.STATIC_DRAW);
|
|
61852
61852
|
state.numIndices = geometry.indices.length;
|
|
61853
61853
|
}
|
|
61854
|
-
if (geometry.
|
|
61854
|
+
if (geometry.edgeIndices && geometry.edgeIndices.length > 0) {
|
|
61855
61855
|
state.edgeIndicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(geometry.edgeIndices), geometry.edgeIndices.length, 1, gl.STATIC_DRAW);
|
|
61856
61856
|
}
|
|
61857
61857
|
|
|
@@ -97467,7 +97467,6 @@ class MousePanRotateDollyHandler {
|
|
|
97467
97467
|
});
|
|
97468
97468
|
|
|
97469
97469
|
function setMousedownState(pick = true) {
|
|
97470
|
-
canvas.style.cursor = "move";
|
|
97471
97470
|
setMousedownPositions();
|
|
97472
97471
|
if (pick) {
|
|
97473
97472
|
setMousedownPick();
|
|
@@ -98258,7 +98257,7 @@ class KeyboardPanRotateDollyHandler {
|
|
|
98258
98257
|
|
|
98259
98258
|
const keyDownMap = [];
|
|
98260
98259
|
|
|
98261
|
-
|
|
98260
|
+
scene.canvas.canvas;
|
|
98262
98261
|
|
|
98263
98262
|
let mouseMovedSinceLastKeyboardDolly = true;
|
|
98264
98263
|
|
|
@@ -98274,10 +98273,6 @@ class KeyboardPanRotateDollyHandler {
|
|
|
98274
98273
|
return;
|
|
98275
98274
|
}
|
|
98276
98275
|
keyDownMap[keyCode] = true;
|
|
98277
|
-
|
|
98278
|
-
if (keyCode === input.KEY_SHIFT) {
|
|
98279
|
-
canvas.style.cursor = "move";
|
|
98280
|
-
}
|
|
98281
98276
|
});
|
|
98282
98277
|
|
|
98283
98278
|
this._onSceneKeyUp = input.on("keyup", (keyCode) => {
|
|
@@ -98286,10 +98281,6 @@ class KeyboardPanRotateDollyHandler {
|
|
|
98286
98281
|
}
|
|
98287
98282
|
keyDownMap[keyCode] = false;
|
|
98288
98283
|
|
|
98289
|
-
if (keyCode === input.KEY_SHIFT) {
|
|
98290
|
-
canvas.style.cursor = null;
|
|
98291
|
-
}
|
|
98292
|
-
|
|
98293
98284
|
if (controllers.pivotController.getPivoting()) {
|
|
98294
98285
|
controllers.pivotController.endPivot();
|
|
98295
98286
|
}
|
|
@@ -98446,6 +98437,7 @@ class CameraUpdater {
|
|
|
98446
98437
|
const pickController = controllers.pickController;
|
|
98447
98438
|
const pivotController = controllers.pivotController;
|
|
98448
98439
|
const panController = controllers.panController;
|
|
98440
|
+
const cameraControl = controllers.cameraControl;
|
|
98449
98441
|
|
|
98450
98442
|
let countDown = SCALE_DOLLY_EACH_FRAME; // Decrements on each tick
|
|
98451
98443
|
let dollyDistFactor = 1.0; // Calculated when countDown is zero
|
|
@@ -98570,7 +98562,7 @@ class CameraUpdater {
|
|
|
98570
98562
|
updates.rotateDeltaX *= configs.rotationInertia;
|
|
98571
98563
|
updates.rotateDeltaY *= configs.rotationInertia;
|
|
98572
98564
|
|
|
98573
|
-
cursorType =
|
|
98565
|
+
cursorType = cameraControl._cursors.rotate;
|
|
98574
98566
|
}
|
|
98575
98567
|
|
|
98576
98568
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -98636,7 +98628,7 @@ class CameraUpdater {
|
|
|
98636
98628
|
camera.pan(vec);
|
|
98637
98629
|
}
|
|
98638
98630
|
|
|
98639
|
-
cursorType =
|
|
98631
|
+
cursorType = cameraControl._cursors.pan;
|
|
98640
98632
|
}
|
|
98641
98633
|
|
|
98642
98634
|
updates.panDeltaX *= configs.panInertia;
|
|
@@ -98650,9 +98642,9 @@ class CameraUpdater {
|
|
|
98650
98642
|
if (dollyDeltaForDist !== 0) {
|
|
98651
98643
|
|
|
98652
98644
|
if (dollyDeltaForDist < 0) {
|
|
98653
|
-
cursorType =
|
|
98645
|
+
cursorType = cameraControl._cursors.dollyForward;
|
|
98654
98646
|
} else {
|
|
98655
|
-
cursorType =
|
|
98647
|
+
cursorType = cameraControl._cursors.dollyBackward;
|
|
98656
98648
|
}
|
|
98657
98649
|
|
|
98658
98650
|
if (configs.firstPerson) {
|
|
@@ -100113,6 +100105,13 @@ class CameraControl extends Component {
|
|
|
100113
100105
|
new KeyboardPanRotateDollyHandler(this.scene, this._controllers, this._configs, this._states, this._updates)
|
|
100114
100106
|
];
|
|
100115
100107
|
|
|
100108
|
+
this._cursors = {
|
|
100109
|
+
dollyForward: "zoom-in",
|
|
100110
|
+
dollyBackward: "zoom-out",
|
|
100111
|
+
rotate: 'grabbing',
|
|
100112
|
+
pan: 'move',
|
|
100113
|
+
};
|
|
100114
|
+
|
|
100116
100115
|
// Applies scheduled updates to the Camera on each Scene "tick" event
|
|
100117
100116
|
|
|
100118
100117
|
this._cameraUpdater = new CameraUpdater(this.scene, this._controllers, this._configs, this._states, this._updates);
|
|
@@ -100474,6 +100473,37 @@ class CameraControl extends Component {
|
|
|
100474
100473
|
this._configs.pointerEnabled = !!value;
|
|
100475
100474
|
}
|
|
100476
100475
|
|
|
100476
|
+
/**
|
|
100477
|
+
* Sets the cursor to be used when a particular action is being performed.
|
|
100478
|
+
*
|
|
100479
|
+
* Accepted actions are:
|
|
100480
|
+
*
|
|
100481
|
+
* * "dollyForward" - when the camera is dollying in the forward direction
|
|
100482
|
+
* * "dollyBackward" - when the camera is dollying in the backward direction
|
|
100483
|
+
* * "pan" - when the camera is being panned
|
|
100484
|
+
* * "rotate" - when the camera is being rotated
|
|
100485
|
+
*
|
|
100486
|
+
* @param {String} action
|
|
100487
|
+
* @param {String} style
|
|
100488
|
+
*/
|
|
100489
|
+
setCursorStyle(action, style) {
|
|
100490
|
+
if (Object.prototype.hasOwnProperty.call(this._cursors, action)) {
|
|
100491
|
+
this._cursors = { ...this._cursors, [action]: style };
|
|
100492
|
+
}
|
|
100493
|
+
else
|
|
100494
|
+
console.warn(`Action '${action}' is not valid for cursor styles.`);
|
|
100495
|
+
}
|
|
100496
|
+
|
|
100497
|
+
/**
|
|
100498
|
+
* Gets the current style for a particular action.
|
|
100499
|
+
*
|
|
100500
|
+
* @param {String} action To get the style for
|
|
100501
|
+
* @returns {String} style set on the cursor for action
|
|
100502
|
+
*/
|
|
100503
|
+
getCursorStyle(action) {
|
|
100504
|
+
return this._cursors[action] || null;
|
|
100505
|
+
}
|
|
100506
|
+
|
|
100477
100507
|
_reset() {
|
|
100478
100508
|
for (let i = 0, len = this._handlers.length; i < len; i++) {
|
|
100479
100509
|
const handler = this._handlers[i];
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -61847,7 +61847,7 @@ class VBOInstancingTrianglesLayer {
|
|
|
61847
61847
|
state.indicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(geometry.indices), geometry.indices.length, 1, gl.STATIC_DRAW);
|
|
61848
61848
|
state.numIndices = geometry.indices.length;
|
|
61849
61849
|
}
|
|
61850
|
-
if (geometry.
|
|
61850
|
+
if (geometry.edgeIndices && geometry.edgeIndices.length > 0) {
|
|
61851
61851
|
state.edgeIndicesBuf = new ArrayBuf(gl, gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(geometry.edgeIndices), geometry.edgeIndices.length, 1, gl.STATIC_DRAW);
|
|
61852
61852
|
}
|
|
61853
61853
|
|
|
@@ -97463,7 +97463,6 @@ class MousePanRotateDollyHandler {
|
|
|
97463
97463
|
});
|
|
97464
97464
|
|
|
97465
97465
|
function setMousedownState(pick = true) {
|
|
97466
|
-
canvas.style.cursor = "move";
|
|
97467
97466
|
setMousedownPositions();
|
|
97468
97467
|
if (pick) {
|
|
97469
97468
|
setMousedownPick();
|
|
@@ -98254,7 +98253,7 @@ class KeyboardPanRotateDollyHandler {
|
|
|
98254
98253
|
|
|
98255
98254
|
const keyDownMap = [];
|
|
98256
98255
|
|
|
98257
|
-
|
|
98256
|
+
scene.canvas.canvas;
|
|
98258
98257
|
|
|
98259
98258
|
let mouseMovedSinceLastKeyboardDolly = true;
|
|
98260
98259
|
|
|
@@ -98270,10 +98269,6 @@ class KeyboardPanRotateDollyHandler {
|
|
|
98270
98269
|
return;
|
|
98271
98270
|
}
|
|
98272
98271
|
keyDownMap[keyCode] = true;
|
|
98273
|
-
|
|
98274
|
-
if (keyCode === input.KEY_SHIFT) {
|
|
98275
|
-
canvas.style.cursor = "move";
|
|
98276
|
-
}
|
|
98277
98272
|
});
|
|
98278
98273
|
|
|
98279
98274
|
this._onSceneKeyUp = input.on("keyup", (keyCode) => {
|
|
@@ -98282,10 +98277,6 @@ class KeyboardPanRotateDollyHandler {
|
|
|
98282
98277
|
}
|
|
98283
98278
|
keyDownMap[keyCode] = false;
|
|
98284
98279
|
|
|
98285
|
-
if (keyCode === input.KEY_SHIFT) {
|
|
98286
|
-
canvas.style.cursor = null;
|
|
98287
|
-
}
|
|
98288
|
-
|
|
98289
98280
|
if (controllers.pivotController.getPivoting()) {
|
|
98290
98281
|
controllers.pivotController.endPivot();
|
|
98291
98282
|
}
|
|
@@ -98442,6 +98433,7 @@ class CameraUpdater {
|
|
|
98442
98433
|
const pickController = controllers.pickController;
|
|
98443
98434
|
const pivotController = controllers.pivotController;
|
|
98444
98435
|
const panController = controllers.panController;
|
|
98436
|
+
const cameraControl = controllers.cameraControl;
|
|
98445
98437
|
|
|
98446
98438
|
let countDown = SCALE_DOLLY_EACH_FRAME; // Decrements on each tick
|
|
98447
98439
|
let dollyDistFactor = 1.0; // Calculated when countDown is zero
|
|
@@ -98566,7 +98558,7 @@ class CameraUpdater {
|
|
|
98566
98558
|
updates.rotateDeltaX *= configs.rotationInertia;
|
|
98567
98559
|
updates.rotateDeltaY *= configs.rotationInertia;
|
|
98568
98560
|
|
|
98569
|
-
cursorType =
|
|
98561
|
+
cursorType = cameraControl._cursors.rotate;
|
|
98570
98562
|
}
|
|
98571
98563
|
|
|
98572
98564
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -98632,7 +98624,7 @@ class CameraUpdater {
|
|
|
98632
98624
|
camera.pan(vec);
|
|
98633
98625
|
}
|
|
98634
98626
|
|
|
98635
|
-
cursorType =
|
|
98627
|
+
cursorType = cameraControl._cursors.pan;
|
|
98636
98628
|
}
|
|
98637
98629
|
|
|
98638
98630
|
updates.panDeltaX *= configs.panInertia;
|
|
@@ -98646,9 +98638,9 @@ class CameraUpdater {
|
|
|
98646
98638
|
if (dollyDeltaForDist !== 0) {
|
|
98647
98639
|
|
|
98648
98640
|
if (dollyDeltaForDist < 0) {
|
|
98649
|
-
cursorType =
|
|
98641
|
+
cursorType = cameraControl._cursors.dollyForward;
|
|
98650
98642
|
} else {
|
|
98651
|
-
cursorType =
|
|
98643
|
+
cursorType = cameraControl._cursors.dollyBackward;
|
|
98652
98644
|
}
|
|
98653
98645
|
|
|
98654
98646
|
if (configs.firstPerson) {
|
|
@@ -100109,6 +100101,13 @@ class CameraControl extends Component {
|
|
|
100109
100101
|
new KeyboardPanRotateDollyHandler(this.scene, this._controllers, this._configs, this._states, this._updates)
|
|
100110
100102
|
];
|
|
100111
100103
|
|
|
100104
|
+
this._cursors = {
|
|
100105
|
+
dollyForward: "zoom-in",
|
|
100106
|
+
dollyBackward: "zoom-out",
|
|
100107
|
+
rotate: 'grabbing',
|
|
100108
|
+
pan: 'move',
|
|
100109
|
+
};
|
|
100110
|
+
|
|
100112
100111
|
// Applies scheduled updates to the Camera on each Scene "tick" event
|
|
100113
100112
|
|
|
100114
100113
|
this._cameraUpdater = new CameraUpdater(this.scene, this._controllers, this._configs, this._states, this._updates);
|
|
@@ -100470,6 +100469,37 @@ class CameraControl extends Component {
|
|
|
100470
100469
|
this._configs.pointerEnabled = !!value;
|
|
100471
100470
|
}
|
|
100472
100471
|
|
|
100472
|
+
/**
|
|
100473
|
+
* Sets the cursor to be used when a particular action is being performed.
|
|
100474
|
+
*
|
|
100475
|
+
* Accepted actions are:
|
|
100476
|
+
*
|
|
100477
|
+
* * "dollyForward" - when the camera is dollying in the forward direction
|
|
100478
|
+
* * "dollyBackward" - when the camera is dollying in the backward direction
|
|
100479
|
+
* * "pan" - when the camera is being panned
|
|
100480
|
+
* * "rotate" - when the camera is being rotated
|
|
100481
|
+
*
|
|
100482
|
+
* @param {String} action
|
|
100483
|
+
* @param {String} style
|
|
100484
|
+
*/
|
|
100485
|
+
setCursorStyle(action, style) {
|
|
100486
|
+
if (Object.prototype.hasOwnProperty.call(this._cursors, action)) {
|
|
100487
|
+
this._cursors = { ...this._cursors, [action]: style };
|
|
100488
|
+
}
|
|
100489
|
+
else
|
|
100490
|
+
console.warn(`Action '${action}' is not valid for cursor styles.`);
|
|
100491
|
+
}
|
|
100492
|
+
|
|
100493
|
+
/**
|
|
100494
|
+
* Gets the current style for a particular action.
|
|
100495
|
+
*
|
|
100496
|
+
* @param {String} action To get the style for
|
|
100497
|
+
* @returns {String} style set on the cursor for action
|
|
100498
|
+
*/
|
|
100499
|
+
getCursorStyle(action) {
|
|
100500
|
+
return this._cursors[action] || null;
|
|
100501
|
+
}
|
|
100502
|
+
|
|
100473
100503
|
_reset() {
|
|
100474
100504
|
for (let i = 0, len = this._handlers.length; i < len; i++) {
|
|
100475
100505
|
const handler = this._handlers[i];
|
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _DEFAULT_SAMPLER;var _marked=/*#__PURE__*/_regeneratorRuntime().mark(makeStringIterator),_marked2=/*#__PURE__*/_regeneratorRuntime().mark(makeArrayBufferIterator),_marked3=/*#__PURE__*/_regeneratorRuntime().mark(makeMeshPrimitiveIterator);function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty2(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty2(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return exports;};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key];}try{define({},"");}catch(err){define=function define(obj,key,value){return obj[key]=value;};}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return generator._invoke=function(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult();}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult;}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg);}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done};}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg);}};}(innerFn,self,context),generator;}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)};}catch(err){return{type:"throw",arg:err};}}exports.wrap=wrap;var ContinueSentinel={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this;});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg);});});}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==_typeof(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject);},function(err){invoke("throw",err,resolve,reject);}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result);},function(error){return invoke("throw",error,resolve,reject);});}reject(record.arg);}var previousPromise;this._invoke=function(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject);});}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();};}function maybeInvokeDelegate(delegate,context){var method=delegate.iterator[context.method];if(undefined===method){if(context.delegate=null,"throw"===context.method){if(delegate.iterator["return"]&&(context.method="return",context.arg=undefined,maybeInvokeDelegate(delegate,context),"throw"===context.method))return ContinueSentinel;context.method="throw",context.arg=new TypeError("The iterator does not provide a 'throw' method");}return ContinueSentinel;}var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=undefined),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel);}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry);}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record;}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0);}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;){if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;}return next.value=undefined,next.done=!0,next;};return next.next=next;}}return{next:doneResult};}function doneResult(){return{value:undefined,done:!0};}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(Gp,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name));},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun;},exports.awrap=function(arg){return{__await:arg};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this;}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next();});},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this;}),define(Gp,"toString",function(){return"[object Generator]";}),exports.keys=function(object){var keys=[];for(var key in object){keys.push(key);}return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next;}return next.done=!0,next;};},exports.values=values,Context.prototype={constructor:Context,reset:function reset(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this){"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=undefined);}},stop:function stop(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval;},dispatchException:function dispatchException(exception){if(this.done)throw exception;var context=this;function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=undefined),!!caught;}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc);}else if(hasCatch){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);}else{if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc);}}}},abrupt:function abrupt(type,arg){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break;}}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record);},complete:function complete(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel;},finish:function finish(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel;}},"catch":function _catch(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry);}return thrown;}}throw new Error("illegal catch attempt");},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=undefined),ContinueSentinel;}},exports;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e13){throw _e13;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o);},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e14){didErr=true;err=_e14;},f:function f(){try{if(!normalCompletion&&it["return"]!=null)it["return"]();}finally{if(didErr)throw err;}}};}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _awaitAsyncGenerator(value){return new _AwaitValue(value);}function _wrapAsyncGenerator(fn){return function(){return new _AsyncGenerator(fn.apply(this,arguments));};}function _AsyncGenerator(gen){var front,back;function send(key,arg){return new Promise(function(resolve,reject){var request={key:key,arg:arg,resolve:resolve,reject:reject,next:null};if(back){back=back.next=request;}else{front=back=request;resume(key,arg);}});}function resume(key,arg){try{var result=gen[key](arg);var value=result.value;var wrappedAwait=value instanceof _AwaitValue;Promise.resolve(wrappedAwait?value.wrapped:value).then(function(arg){if(wrappedAwait){resume(key==="return"?"return":"next",arg);return;}settle(result.done?"return":"normal",arg);},function(err){resume("throw",err);});}catch(err){settle("throw",err);}}function settle(type,value){switch(type){case"return":front.resolve({value:value,done:true});break;case"throw":front.reject(value);break;default:front.resolve({value:value,done:false});break;}front=front.next;if(front){resume(front.key,front.arg);}else{back=null;}}this._invoke=send;if(typeof gen["return"]!=="function"){this["return"]=undefined;}}_AsyncGenerator.prototype[typeof Symbol==="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this;};_AsyncGenerator.prototype.next=function(arg){return this._invoke("next",arg);};_AsyncGenerator.prototype["throw"]=function(arg){return this._invoke("throw",arg);};_AsyncGenerator.prototype["return"]=function(arg){return this._invoke("return",arg);};function _AwaitValue(value){this.wrapped=value;}function _asyncIterator(iterable){var method,async,sync,retry=2;for("undefined"!=typeof Symbol&&(async=Symbol.asyncIterator,sync=Symbol.iterator);retry--;){if(async&&null!=(method=iterable[async]))return method.call(iterable);if(sync&&null!=(method=iterable[sync]))return new AsyncFromSyncIterator(method.call(iterable));async="@@asyncIterator",sync="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(s){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var done=r.done;return Promise.resolve(r.value).then(function(value){return{value:value,done:done};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(s){this.s=s,this.n=s.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},"return":function _return(value){var ret=this.s["return"];return void 0===ret?Promise.resolve({value:value,done:!0}):AsyncFromSyncIteratorContinuation(ret.apply(this.s,arguments));},"throw":function _throw(value){var thr=this.s["return"];return void 0===thr?Promise.reject(value):AsyncFromSyncIteratorContinuation(thr.apply(this.s,arguments));}},new AsyncFromSyncIterator(s);}/** @private */var Map$1=/*#__PURE__*/function(){function Map$1(items,baseId){_classCallCheck(this,Map$1);this.items=items||[];this._lastUniqueId=(baseId||0)+1;}/**
|
|
1
|
+
var _DEFAULT_SAMPLER;var _marked=/*#__PURE__*/_regeneratorRuntime().mark(makeStringIterator),_marked2=/*#__PURE__*/_regeneratorRuntime().mark(makeArrayBufferIterator),_marked3=/*#__PURE__*/_regeneratorRuntime().mark(makeMeshPrimitiveIterator);function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return exports;};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key];}try{define({},"");}catch(err){define=function define(obj,key,value){return obj[key]=value;};}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return generator._invoke=function(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult();}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult;}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg);}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done};}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg);}};}(innerFn,self,context),generator;}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)};}catch(err){return{type:"throw",arg:err};}}exports.wrap=wrap;var ContinueSentinel={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this;});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg);});});}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==_typeof(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject);},function(err){invoke("throw",err,resolve,reject);}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result);},function(error){return invoke("throw",error,resolve,reject);});}reject(record.arg);}var previousPromise;this._invoke=function(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject);});}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();};}function maybeInvokeDelegate(delegate,context){var method=delegate.iterator[context.method];if(undefined===method){if(context.delegate=null,"throw"===context.method){if(delegate.iterator["return"]&&(context.method="return",context.arg=undefined,maybeInvokeDelegate(delegate,context),"throw"===context.method))return ContinueSentinel;context.method="throw",context.arg=new TypeError("The iterator does not provide a 'throw' method");}return ContinueSentinel;}var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=undefined),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel);}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry);}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record;}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0);}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;){if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;}return next.value=undefined,next.done=!0,next;};return next.next=next;}}return{next:doneResult};}function doneResult(){return{value:undefined,done:!0};}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(Gp,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name));},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun;},exports.awrap=function(arg){return{__await:arg};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this;}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next();});},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this;}),define(Gp,"toString",function(){return"[object Generator]";}),exports.keys=function(object){var keys=[];for(var key in object){keys.push(key);}return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next;}return next.done=!0,next;};},exports.values=values,Context.prototype={constructor:Context,reset:function reset(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this){"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=undefined);}},stop:function stop(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval;},dispatchException:function dispatchException(exception){if(this.done)throw exception;var context=this;function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=undefined),!!caught;}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc);}else if(hasCatch){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);}else{if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc);}}}},abrupt:function abrupt(type,arg){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break;}}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record);},complete:function complete(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel;},finish:function finish(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel;}},"catch":function _catch(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry);}return thrown;}}throw new Error("illegal catch attempt");},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=undefined),ContinueSentinel;}},exports;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty2(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty2(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e13){throw _e13;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o);},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e14){didErr=true;err=_e14;},f:function f(){try{if(!normalCompletion&&it["return"]!=null)it["return"]();}finally{if(didErr)throw err;}}};}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _awaitAsyncGenerator(value){return new _AwaitValue(value);}function _wrapAsyncGenerator(fn){return function(){return new _AsyncGenerator(fn.apply(this,arguments));};}function _AsyncGenerator(gen){var front,back;function send(key,arg){return new Promise(function(resolve,reject){var request={key:key,arg:arg,resolve:resolve,reject:reject,next:null};if(back){back=back.next=request;}else{front=back=request;resume(key,arg);}});}function resume(key,arg){try{var result=gen[key](arg);var value=result.value;var wrappedAwait=value instanceof _AwaitValue;Promise.resolve(wrappedAwait?value.wrapped:value).then(function(arg){if(wrappedAwait){resume(key==="return"?"return":"next",arg);return;}settle(result.done?"return":"normal",arg);},function(err){resume("throw",err);});}catch(err){settle("throw",err);}}function settle(type,value){switch(type){case"return":front.resolve({value:value,done:true});break;case"throw":front.reject(value);break;default:front.resolve({value:value,done:false});break;}front=front.next;if(front){resume(front.key,front.arg);}else{back=null;}}this._invoke=send;if(typeof gen["return"]!=="function"){this["return"]=undefined;}}_AsyncGenerator.prototype[typeof Symbol==="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this;};_AsyncGenerator.prototype.next=function(arg){return this._invoke("next",arg);};_AsyncGenerator.prototype["throw"]=function(arg){return this._invoke("throw",arg);};_AsyncGenerator.prototype["return"]=function(arg){return this._invoke("return",arg);};function _AwaitValue(value){this.wrapped=value;}function _asyncIterator(iterable){var method,async,sync,retry=2;for("undefined"!=typeof Symbol&&(async=Symbol.asyncIterator,sync=Symbol.iterator);retry--;){if(async&&null!=(method=iterable[async]))return method.call(iterable);if(sync&&null!=(method=iterable[sync]))return new AsyncFromSyncIterator(method.call(iterable));async="@@asyncIterator",sync="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(s){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var done=r.done;return Promise.resolve(r.value).then(function(value){return{value:value,done:done};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(s){this.s=s,this.n=s.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},"return":function _return(value){var ret=this.s["return"];return void 0===ret?Promise.resolve({value:value,done:!0}):AsyncFromSyncIteratorContinuation(ret.apply(this.s,arguments));},"throw":function _throw(value){var thr=this.s["return"];return void 0===thr?Promise.reject(value):AsyncFromSyncIteratorContinuation(thr.apply(this.s,arguments));}},new AsyncFromSyncIterator(s);}/** @private */var Map$1=/*#__PURE__*/function(){function Map$1(items,baseId){_classCallCheck(this,Map$1);this.items=items||[];this._lastUniqueId=(baseId||0)+1;}/**
|
|
2
2
|
* Usage:
|
|
3
3
|
*
|
|
4
4
|
* id = myMap.addItem("foo") // ID internally generated
|
|
@@ -15383,7 +15383,7 @@ var _notNormalized3=false;state.flagsBuf=new ArrayBuf(gl,gl.ARRAY_BUFFER,new Flo
|
|
|
15383
15383
|
// const normalized = true; // For oct-encoded UInt8
|
|
15384
15384
|
// state.normalsBuf = new ArrayBuf(gl, gl.ARRAY_BUFFER, geometry.normalsCompressed, geometry.normalsCompressed.length, 3, gl.STATIC_DRAW, normalized);
|
|
15385
15385
|
// }
|
|
15386
|
-
if(geometry.colorsCompressed&&geometry.colorsCompressed.length>0){var colorsCompressed=new Uint8Array(geometry.colorsCompressed);var _notNormalized5=false;state.colorsBuf=new ArrayBuf(gl,gl.ARRAY_BUFFER,colorsCompressed,colorsCompressed.length,4,gl.STATIC_DRAW,_notNormalized5);}if(geometry.uvCompressed&&geometry.uvCompressed.length>0){var uvCompressed=geometry.uvCompressed;state.uvDecodeMatrix=geometry.uvDecodeMatrix;state.uvBuf=new ArrayBuf(gl,gl.ARRAY_BUFFER,uvCompressed,uvCompressed.length,2,gl.STATIC_DRAW,false);}if(geometry.indices&&geometry.indices.length>0){state.indicesBuf=new ArrayBuf(gl,gl.ELEMENT_ARRAY_BUFFER,new Uint32Array(geometry.indices),geometry.indices.length,1,gl.STATIC_DRAW);state.numIndices=geometry.indices.length;}if(geometry.
|
|
15386
|
+
if(geometry.colorsCompressed&&geometry.colorsCompressed.length>0){var colorsCompressed=new Uint8Array(geometry.colorsCompressed);var _notNormalized5=false;state.colorsBuf=new ArrayBuf(gl,gl.ARRAY_BUFFER,colorsCompressed,colorsCompressed.length,4,gl.STATIC_DRAW,_notNormalized5);}if(geometry.uvCompressed&&geometry.uvCompressed.length>0){var uvCompressed=geometry.uvCompressed;state.uvDecodeMatrix=geometry.uvDecodeMatrix;state.uvBuf=new ArrayBuf(gl,gl.ARRAY_BUFFER,uvCompressed,uvCompressed.length,2,gl.STATIC_DRAW,false);}if(geometry.indices&&geometry.indices.length>0){state.indicesBuf=new ArrayBuf(gl,gl.ELEMENT_ARRAY_BUFFER,new Uint32Array(geometry.indices),geometry.indices.length,1,gl.STATIC_DRAW);state.numIndices=geometry.indices.length;}if(geometry.edgeIndices&&geometry.edgeIndices.length>0){state.edgeIndicesBuf=new ArrayBuf(gl,gl.ELEMENT_ARRAY_BUFFER,new Uint32Array(geometry.edgeIndices),geometry.edgeIndices.length,1,gl.STATIC_DRAW);}if(this._modelMatrixCol0.length>0){var _normalized5=false;state.modelMatrixCol0Buf=new ArrayBuf(gl,gl.ARRAY_BUFFER,new Float32Array(this._modelMatrixCol0),this._modelMatrixCol0.length,4,gl.STATIC_DRAW,_normalized5);state.modelMatrixCol1Buf=new ArrayBuf(gl,gl.ARRAY_BUFFER,new Float32Array(this._modelMatrixCol1),this._modelMatrixCol1.length,4,gl.STATIC_DRAW,_normalized5);state.modelMatrixCol2Buf=new ArrayBuf(gl,gl.ARRAY_BUFFER,new Float32Array(this._modelMatrixCol2),this._modelMatrixCol2.length,4,gl.STATIC_DRAW,_normalized5);this._modelMatrixCol0=[];this._modelMatrixCol1=[];this._modelMatrixCol2=[];if(state.normalsBuf){state.modelNormalMatrixCol0Buf=new ArrayBuf(gl,gl.ARRAY_BUFFER,new Float32Array(this._modelNormalMatrixCol0),this._modelNormalMatrixCol0.length,4,gl.STATIC_DRAW,_normalized5);state.modelNormalMatrixCol1Buf=new ArrayBuf(gl,gl.ARRAY_BUFFER,new Float32Array(this._modelNormalMatrixCol1),this._modelNormalMatrixCol1.length,4,gl.STATIC_DRAW,_normalized5);state.modelNormalMatrixCol2Buf=new ArrayBuf(gl,gl.ARRAY_BUFFER,new Float32Array(this._modelNormalMatrixCol2),this._modelNormalMatrixCol2.length,4,gl.STATIC_DRAW,_normalized5);this._modelNormalMatrixCol0=[];this._modelNormalMatrixCol1=[];this._modelNormalMatrixCol2=[];}}if(this._pickColors.length>0){var _normalized6=false;state.pickColorsBuf=new ArrayBuf(gl,gl.ARRAY_BUFFER,new Uint8Array(this._pickColors),this._pickColors.length,4,gl.STATIC_DRAW,_normalized6);this._pickColors=[];// Release memory
|
|
15387
15387
|
}state.pbrSupported=!!state.metallicRoughnessBuf&&!!state.uvBuf&&!!state.normalsBuf&&!!textureSet&&!!textureSet.colorTexture&&!!textureSet.metallicRoughnessTexture;state.colorTextureSupported=!!state.uvBuf&&!!textureSet&&!!textureSet.colorTexture;if(!this.model.scene.readableGeometryEnabled){this._state.geometry=null;}this._finalized=true;}// The following setters are called by VBOSceneModelMesh, in turn called by VBOSceneModelNode, only after the layer is finalized.
|
|
15388
15388
|
// It's important that these are called after finalize() in order to maintain integrity of counts like _numVisibleLayerPortions etc.
|
|
15389
15389
|
},{key:"initFlags",value:function initFlags(portionId,flags,meshTransparent){if(flags&ENTITY_FLAGS.VISIBLE){this._numVisibleLayerPortions++;this.model.numVisibleLayerPortions++;}if(flags&ENTITY_FLAGS.HIGHLIGHTED){this._numHighlightedLayerPortions++;this.model.numHighlightedLayerPortions++;}if(flags&ENTITY_FLAGS.XRAYED){this._numXRayedLayerPortions++;this.model.numXRayedLayerPortions++;}if(flags&ENTITY_FLAGS.SELECTED){this._numSelectedLayerPortions++;this.model.numSelectedLayerPortions++;}if(flags&ENTITY_FLAGS.CLIPPABLE){this._numClippableLayerPortions++;this.model.numClippableLayerPortions++;}if(flags&ENTITY_FLAGS.EDGES){this._numEdgesLayerPortions++;this.model.numEdgesLayerPortions++;}if(flags&ENTITY_FLAGS.PICKABLE){this._numPickableLayerPortions++;this.model.numPickableLayerPortions++;}if(flags&ENTITY_FLAGS.CULLED){this._numCulledLayerPortions++;this.model.numCulledLayerPortions++;}if(meshTransparent){this._numTransparentLayerPortions++;this.model.numTransparentLayerPortions++;}this._setFlags(portionId,flags,meshTransparent);}},{key:"setVisible",value:function setVisible(portionId,flags,meshTransparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.VISIBLE){this._numVisibleLayerPortions++;this.model.numVisibleLayerPortions++;}else{this._numVisibleLayerPortions--;this.model.numVisibleLayerPortions--;}this._setFlags(portionId,flags,meshTransparent);}},{key:"setHighlighted",value:function setHighlighted(portionId,flags,meshTransparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.HIGHLIGHTED){this._numHighlightedLayerPortions++;this.model.numHighlightedLayerPortions++;}else{this._numHighlightedLayerPortions--;this.model.numHighlightedLayerPortions--;}this._setFlags(portionId,flags,meshTransparent);}},{key:"setXRayed",value:function setXRayed(portionId,flags,meshTransparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.XRAYED){this._numXRayedLayerPortions++;this.model.numXRayedLayerPortions++;}else{this._numXRayedLayerPortions--;this.model.numXRayedLayerPortions--;}this._setFlags(portionId,flags,meshTransparent);}},{key:"setSelected",value:function setSelected(portionId,flags,meshTransparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.SELECTED){this._numSelectedLayerPortions++;this.model.numSelectedLayerPortions++;}else{this._numSelectedLayerPortions--;this.model.numSelectedLayerPortions--;}this._setFlags(portionId,flags,meshTransparent);}},{key:"setEdges",value:function setEdges(portionId,flags,meshTransparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.EDGES){this._numEdgesLayerPortions++;this.model.numEdgesLayerPortions++;}else{this._numEdgesLayerPortions--;this.model.numEdgesLayerPortions--;}this._setFlags(portionId,flags,meshTransparent);}},{key:"setClippable",value:function setClippable(portionId,flags){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.CLIPPABLE){this._numClippableLayerPortions++;this.model.numClippableLayerPortions++;}else{this._numClippableLayerPortions--;this.model.numClippableLayerPortions--;}this._setFlags(portionId,flags);}},{key:"setCollidable",value:function setCollidable(portionId,flags){if(!this._finalized){throw"Not finalized";}}},{key:"setPickable",value:function setPickable(portionId,flags,meshTransparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.PICKABLE){this._numPickableLayerPortions++;this.model.numPickableLayerPortions++;}else{this._numPickableLayerPortions--;this.model.numPickableLayerPortions--;}this._setFlags(portionId,flags,meshTransparent);}},{key:"setCulled",value:function setCulled(portionId,flags,meshTransparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.CULLED){this._numCulledLayerPortions++;this.model.numCulledLayerPortions++;}else{this._numCulledLayerPortions--;this.model.numCulledLayerPortions--;}this._setFlags(portionId,flags,meshTransparent);}},{key:"setColor",value:function setColor(portionId,color){// RGBA color is normalized as ints
|
|
@@ -22982,7 +22982,7 @@ this.pickResult=this._scene.pick({canvasPos:this.pickCursorPos});if(this.pickRes
|
|
|
22982
22982
|
* @private
|
|
22983
22983
|
*/var canvasPos=math.vec2();var getCanvasPosFromEvent$3=function getCanvasPosFromEvent$3(event,canvasPos){if(!event){event=window.event;canvasPos[0]=event.x;canvasPos[1]=event.y;}else{var element=event.target;var totalOffsetLeft=0;var totalOffsetTop=0;var totalScrollX=0;var totalScrollY=0;while(element.offsetParent){totalOffsetLeft+=element.offsetLeft;totalOffsetTop+=element.offsetTop;totalScrollX+=element.scrollLeft;totalScrollY+=element.scrollTop;element=element.offsetParent;}canvasPos[0]=event.pageX+totalScrollX-totalOffsetLeft;canvasPos[1]=event.pageY+totalScrollY-totalOffsetTop;}return canvasPos;};/**
|
|
22984
22984
|
* @private
|
|
22985
|
-
*/var MousePanRotateDollyHandler=/*#__PURE__*/function(){function MousePanRotateDollyHandler(scene,controllers,configs,states,updates){_classCallCheck(this,MousePanRotateDollyHandler);this._scene=scene;var pickController=controllers.pickController;var cameraControl=controllers.cameraControl;var lastX=0;var lastY=0;var lastXDown=0;var lastYDown=0;var mouseDownLeft;var mouseDownMiddle;var mouseDownRight;var mouseDownPicked=false;var pickedWorldPos=math.vec3();var mouseMovedOnCanvasSinceLastWheel=true;var canvas=this._scene.canvas.canvas;var keyDown=[];document.addEventListener("keydown",this._documentKeyDownHandler=function(e){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}var keyCode=e.keyCode;keyDown[keyCode]=true;});document.addEventListener("keyup",this._documentKeyUpHandler=function(e){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}var keyCode=e.keyCode;keyDown[keyCode]=false;});function setMousedownState(){var pick=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;
|
|
22985
|
+
*/var MousePanRotateDollyHandler=/*#__PURE__*/function(){function MousePanRotateDollyHandler(scene,controllers,configs,states,updates){_classCallCheck(this,MousePanRotateDollyHandler);this._scene=scene;var pickController=controllers.pickController;var cameraControl=controllers.cameraControl;var lastX=0;var lastY=0;var lastXDown=0;var lastYDown=0;var mouseDownLeft;var mouseDownMiddle;var mouseDownRight;var mouseDownPicked=false;var pickedWorldPos=math.vec3();var mouseMovedOnCanvasSinceLastWheel=true;var canvas=this._scene.canvas.canvas;var keyDown=[];document.addEventListener("keydown",this._documentKeyDownHandler=function(e){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}var keyCode=e.keyCode;keyDown[keyCode]=true;});document.addEventListener("keyup",this._documentKeyUpHandler=function(e){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}var keyCode=e.keyCode;keyDown[keyCode]=false;});function setMousedownState(){var pick=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;setMousedownPositions();if(pick){setMousedownPick();}}function setMousedownPositions(){lastX=states.pointerCanvasPos[0];lastY=states.pointerCanvasPos[1];lastXDown=states.pointerCanvasPos[0];lastYDown=states.pointerCanvasPos[1];}function setMousedownPick(){pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickSurface=true;pickController.update();if(pickController.picked&&pickController.pickedSurface&&pickController.pickResult&&pickController.pickResult.worldPos){mouseDownPicked=true;pickedWorldPos.set(pickController.pickResult.worldPos);}else{mouseDownPicked=false;}}function isPanning(){return cameraControl._isKeyDownForAction(cameraControl.MOUSE_PAN,keyDown);}function isRotating(){return cameraControl._isKeyDownForAction(cameraControl.MOUSE_ROTATE,keyDown);}canvas.addEventListener("mousedown",this._mouseDownHandler=function(e){if(!(configs.active&&configs.pointerEnabled)){return;}switch(e.which){case 1:// Left button
|
|
22986
22986
|
if(keyDown[scene.input.KEY_SHIFT]||configs.planView){mouseDownLeft=true;keyDown[scene.input.MOUSE_LEFT_BUTTON]=true;setMousedownState();}else{mouseDownLeft=true;keyDown[scene.input.MOUSE_LEFT_BUTTON]=true;setMousedownState(false);}break;case 2:// Middle/both buttons
|
|
22987
22987
|
mouseDownMiddle=true;keyDown[scene.input.MOUSE_MIDDLE_BUTTON]=true;setMousedownState();break;case 3:// Right button
|
|
22988
22988
|
mouseDownRight=true;keyDown[scene.input.MOUSE_RIGHT_BUTTON]=true;if(configs.panRightClick){setMousedownState();}break;}});document.addEventListener("mousemove",this._documentMouseMoveHandler=function(e){if(!(configs.active&&configs.pointerEnabled)){return;}if(!mouseDownLeft&&!mouseDownMiddle&&!mouseDownRight){return;}// Scaling drag-rotate to canvas boundary
|
|
@@ -23016,7 +23016,7 @@ if(pickedSubs||pickedNothingSubs||pickedSurfaceSubs){pickController.pickCursorPo
|
|
|
23016
23016
|
pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickEntity=configs.doublePickFlyTo;pickController.schedulePickSurface=pickedSurfaceSubs;pickController.update();var firstClickPickResult=pickController.pickResult;var firstClickPickSurface=pickController.pickedSurface;_this113._timeout=setTimeout(function(){if(firstClickPickResult&&firstClickPickResult.worldPos){cameraControl.fire("picked",firstClickPickResult,true);if(firstClickPickSurface){cameraControl.fire("pickedSurface",firstClickPickResult,true);if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.setPivotPos(firstClickPickResult.worldPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}else{cameraControl.fire("pickedNothing",{canvasPos:states.pointerCanvasPos},true);}_this113._clicks=0;},configs.doubleClickTimeFrame);}else{// Second click
|
|
23017
23017
|
if(_this113._timeout!==null){window.clearTimeout(_this113._timeout);_this113._timeout=null;}pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickEntity=configs.doublePickFlyTo||doublePickedSubs||doublePickedSurfaceSubs;pickController.schedulePickSurface=pickController.schedulePickEntity&&doublePickedSurfaceSubs;pickController.update();if(pickController.pickResult){cameraControl.fire("doublePicked",pickController.pickResult,true);if(pickController.pickedSurface){cameraControl.fire("doublePickedSurface",pickController.pickResult,true);}if(configs.doublePickFlyTo){flyCameraTo(pickController.pickResult);if(!configs.firstPerson&&configs.followPointer){var pickedEntityAABB=pickController.pickResult.entity.aabb;var pickedEntityCenterPos=math.getAABB3Center(pickedEntityAABB);controllers.pivotController.setPivotPos(pickedEntityCenterPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}else{cameraControl.fire("doublePickedNothing",{canvasPos:states.pointerCanvasPos},true);if(configs.doublePickFlyTo){flyCameraTo();if(!configs.firstPerson&&configs.followPointer){var sceneAABB=scene.aabb;var sceneCenterPos=math.getAABB3Center(sceneAABB);controllers.pivotController.setPivotPos(sceneCenterPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}_this113._clicks=0;}},false);}_createClass(MousePickHandler,[{key:"reset",value:function reset(){this._clicks=0;this._lastPickedEntityId=null;if(this._timeout){window.clearTimeout(this._timeout);this._timeout=null;}}},{key:"destroy",value:function destroy(){var canvas=this._scene.canvas.canvas;canvas.removeEventListener("mousemove",this._canvasMouseMoveHandler);canvas.removeEventListener("mousedown",this._canvasMouseDownHandler);document.removeEventListener("mouseup",this._documentMouseUpHandler);canvas.removeEventListener("mouseup",this._canvasMouseUpHandler);if(this._timeout){window.clearTimeout(this._timeout);this._timeout=null;}}}]);return MousePickHandler;}();/**
|
|
23018
23018
|
* @private
|
|
23019
|
-
*/var KeyboardPanRotateDollyHandler=/*#__PURE__*/function(){function KeyboardPanRotateDollyHandler(scene,controllers,configs,states,updates){_classCallCheck(this,KeyboardPanRotateDollyHandler);this._scene=scene;var input=scene.input;var keyDownMap=[];
|
|
23019
|
+
*/var KeyboardPanRotateDollyHandler=/*#__PURE__*/function(){function KeyboardPanRotateDollyHandler(scene,controllers,configs,states,updates){_classCallCheck(this,KeyboardPanRotateDollyHandler);this._scene=scene;var input=scene.input;var keyDownMap=[];scene.canvas.canvas;var mouseMovedSinceLastKeyboardDolly=true;this._onSceneMouseMove=input.on("mousemove",function(){mouseMovedSinceLastKeyboardDolly=true;});this._onSceneKeyDown=input.on("keydown",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(configs.keyboardEnabledOnlyIfMouseover&&!states.mouseover){return;}keyDownMap[keyCode]=true;});this._onSceneKeyUp=input.on("keyup",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}keyDownMap[keyCode]=false;if(controllers.pivotController.getPivoting()){controllers.pivotController.endPivot();}});this._onTick=scene.on("tick",function(e){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(configs.keyboardEnabledOnlyIfMouseover&&!states.mouseover){return;}var cameraControl=controllers.cameraControl;var elapsedSecs=e.deltaTime/1000.0;//-------------------------------------------------------------------------------------------------
|
|
23020
23020
|
// Keyboard rotation
|
|
23021
23021
|
//-------------------------------------------------------------------------------------------------
|
|
23022
23022
|
if(!configs.planView){var rotateYPos=cameraControl._isKeyDownForAction(cameraControl.ROTATE_Y_POS,keyDownMap);var rotateYNeg=cameraControl._isKeyDownForAction(cameraControl.ROTATE_Y_NEG,keyDownMap);var rotateXPos=cameraControl._isKeyDownForAction(cameraControl.ROTATE_X_POS,keyDownMap);var rotateXNeg=cameraControl._isKeyDownForAction(cameraControl.ROTATE_X_NEG,keyDownMap);var orbitDelta=elapsedSecs*configs.keyboardRotationRate;if(rotateYPos||rotateYNeg||rotateXPos||rotateXNeg){if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.startPivot();}if(rotateYPos){updates.rotateDeltaY+=orbitDelta;}else if(rotateYNeg){updates.rotateDeltaY-=orbitDelta;}if(rotateXPos){updates.rotateDeltaX+=orbitDelta;}else if(rotateXNeg){updates.rotateDeltaX-=orbitDelta;}if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.startPivot();}}}//-------------------------------------------------------------------------------------------------
|
|
@@ -23028,7 +23028,7 @@ var EPSILON=0.001;var tempVec3$2=math.vec3();/**
|
|
|
23028
23028
|
* Handles camera updates on each "tick" that were scheduled by the various controllers.
|
|
23029
23029
|
*
|
|
23030
23030
|
* @private
|
|
23031
|
-
*/var CameraUpdater=/*#__PURE__*/function(){function CameraUpdater(scene,controllers,configs,states,updates){_classCallCheck(this,CameraUpdater);this._scene=scene;var camera=scene.camera;var pickController=controllers.pickController;var pivotController=controllers.pivotController;var panController=controllers.panController;var countDown=SCALE_DOLLY_EACH_FRAME;// Decrements on each tick
|
|
23031
|
+
*/var CameraUpdater=/*#__PURE__*/function(){function CameraUpdater(scene,controllers,configs,states,updates){_classCallCheck(this,CameraUpdater);this._scene=scene;var camera=scene.camera;var pickController=controllers.pickController;var pivotController=controllers.pivotController;var panController=controllers.panController;var cameraControl=controllers.cameraControl;var countDown=SCALE_DOLLY_EACH_FRAME;// Decrements on each tick
|
|
23032
23032
|
var dollyDistFactor=1.0;// Calculated when countDown is zero
|
|
23033
23033
|
var followPointerWorldPos=null;// Holds the pointer's World position when configs.followPointer is true
|
|
23034
23034
|
this._onTick=scene.on("tick",function(){if(!(configs.active&&configs.pointerEnabled)){return;}var cursorType="default";//----------------------------------------------------------------------------------------------------------
|
|
@@ -23050,13 +23050,13 @@ if(Math.abs(updates.rotateDeltaX)<EPSILON){updates.rotateDeltaX=0;}if(Math.abs(u
|
|
|
23050
23050
|
if(configs.followPointer){if(--countDown<=0){countDown=SCALE_DOLLY_EACH_FRAME;if(updates.dollyDelta!==0){if(updates.rotateDeltaY===0&&updates.rotateDeltaX===0){if(configs.followPointer&&states.followPointerDirty){pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickSurface=true;pickController.update();if(pickController.pickResult&&pickController.pickResult.worldPos){followPointerWorldPos=pickController.pickResult.worldPos;}else{dollyDistFactor=1.0;followPointerWorldPos=null;}states.followPointerDirty=false;}}if(followPointerWorldPos){var dist=Math.abs(math.lenVec3(math.subVec3(followPointerWorldPos,scene.camera.eye,tempVec3$2)));dollyDistFactor=dist/configs.dollyProximityThreshold;}if(dollyDistFactor<configs.dollyMinSpeed){dollyDistFactor=configs.dollyMinSpeed;}}}}else{dollyDistFactor=1;followPointerWorldPos=null;}var dollyDeltaForDist=updates.dollyDelta*dollyDistFactor;//----------------------------------------------------------------------------------------------------------
|
|
23051
23051
|
// Rotation
|
|
23052
23052
|
//----------------------------------------------------------------------------------------------------------
|
|
23053
|
-
if(updates.rotateDeltaY!==0||updates.rotateDeltaX!==0){if(!configs.firstPerson&&configs.followPointer&&pivotController.getPivoting()){pivotController.continuePivot(updates.rotateDeltaY,updates.rotateDeltaX);pivotController.showPivot();}else{if(updates.rotateDeltaX!==0){if(configs.firstPerson){camera.pitch(-updates.rotateDeltaX);}else{camera.orbitPitch(updates.rotateDeltaX);}}if(updates.rotateDeltaY!==0){if(configs.firstPerson){camera.yaw(updates.rotateDeltaY);}else{camera.orbitYaw(updates.rotateDeltaY);}}}updates.rotateDeltaX*=configs.rotationInertia;updates.rotateDeltaY*=configs.rotationInertia;cursorType=
|
|
23053
|
+
if(updates.rotateDeltaY!==0||updates.rotateDeltaX!==0){if(!configs.firstPerson&&configs.followPointer&&pivotController.getPivoting()){pivotController.continuePivot(updates.rotateDeltaY,updates.rotateDeltaX);pivotController.showPivot();}else{if(updates.rotateDeltaX!==0){if(configs.firstPerson){camera.pitch(-updates.rotateDeltaX);}else{camera.orbitPitch(updates.rotateDeltaX);}}if(updates.rotateDeltaY!==0){if(configs.firstPerson){camera.yaw(updates.rotateDeltaY);}else{camera.orbitYaw(updates.rotateDeltaY);}}}updates.rotateDeltaX*=configs.rotationInertia;updates.rotateDeltaY*=configs.rotationInertia;cursorType=cameraControl._cursors.rotate;}//----------------------------------------------------------------------------------------------------------
|
|
23054
23054
|
// Panning
|
|
23055
23055
|
//----------------------------------------------------------------------------------------------------------
|
|
23056
|
-
if(Math.abs(updates.panDeltaX)<EPSILON){updates.panDeltaX=0;}if(Math.abs(updates.panDeltaY)<EPSILON){updates.panDeltaY=0;}if(Math.abs(updates.panDeltaZ)<EPSILON){updates.panDeltaZ=0;}if(updates.panDeltaX!==0||updates.panDeltaY!==0||updates.panDeltaZ!==0){var vec=math.vec3();vec[0]=updates.panDeltaX;vec[1]=updates.panDeltaY;vec[2]=updates.panDeltaZ;var verticalEye;var verticalLook;if(configs.constrainVertical){if(camera.xUp){verticalEye=camera.eye[0];verticalLook=camera.look[0];}else if(camera.yUp){verticalEye=camera.eye[1];verticalLook=camera.look[1];}else if(camera.zUp){verticalEye=camera.eye[2];verticalLook=camera.look[2];}camera.pan(vec);var eye=camera.eye;var look=camera.look;if(camera.xUp){eye[0]=verticalEye;look[0]=verticalLook;}else if(camera.yUp){eye[1]=verticalEye;look[1]=verticalLook;}else if(camera.zUp){eye[2]=verticalEye;look[2]=verticalLook;}camera.eye=eye;camera.look=look;}else{camera.pan(vec);}cursorType=
|
|
23056
|
+
if(Math.abs(updates.panDeltaX)<EPSILON){updates.panDeltaX=0;}if(Math.abs(updates.panDeltaY)<EPSILON){updates.panDeltaY=0;}if(Math.abs(updates.panDeltaZ)<EPSILON){updates.panDeltaZ=0;}if(updates.panDeltaX!==0||updates.panDeltaY!==0||updates.panDeltaZ!==0){var vec=math.vec3();vec[0]=updates.panDeltaX;vec[1]=updates.panDeltaY;vec[2]=updates.panDeltaZ;var verticalEye;var verticalLook;if(configs.constrainVertical){if(camera.xUp){verticalEye=camera.eye[0];verticalLook=camera.look[0];}else if(camera.yUp){verticalEye=camera.eye[1];verticalLook=camera.look[1];}else if(camera.zUp){verticalEye=camera.eye[2];verticalLook=camera.look[2];}camera.pan(vec);var eye=camera.eye;var look=camera.look;if(camera.xUp){eye[0]=verticalEye;look[0]=verticalLook;}else if(camera.yUp){eye[1]=verticalEye;look[1]=verticalLook;}else if(camera.zUp){eye[2]=verticalEye;look[2]=verticalLook;}camera.eye=eye;camera.look=look;}else{camera.pan(vec);}cursorType=cameraControl._cursors.pan;}updates.panDeltaX*=configs.panInertia;updates.panDeltaY*=configs.panInertia;updates.panDeltaZ*=configs.panInertia;//----------------------------------------------------------------------------------------------------------
|
|
23057
23057
|
// Dollying
|
|
23058
23058
|
//----------------------------------------------------------------------------------------------------------
|
|
23059
|
-
if(dollyDeltaForDist!==0){if(dollyDeltaForDist<0){cursorType=
|
|
23059
|
+
if(dollyDeltaForDist!==0){if(dollyDeltaForDist<0){cursorType=cameraControl._cursors.dollyForward;}else{cursorType=cameraControl._cursors.dollyBackward;}if(configs.firstPerson){var _verticalEye;var _verticalLook;if(configs.constrainVertical){if(camera.xUp){_verticalEye=camera.eye[0];_verticalLook=camera.look[0];}else if(camera.yUp){_verticalEye=camera.eye[1];_verticalLook=camera.look[1];}else if(camera.zUp){_verticalEye=camera.eye[2];_verticalLook=camera.look[2];}}if(configs.followPointer){var dolliedThroughSurface=panController.dollyToCanvasPos(followPointerWorldPos,states.pointerCanvasPos,-dollyDeltaForDist);if(dolliedThroughSurface){states.followPointerDirty=true;}}else{camera.pan([0,0,dollyDeltaForDist]);camera.ortho.scale=camera.ortho.scale-dollyDeltaForDist;}if(configs.constrainVertical){var _eye=camera.eye;var _look=camera.look;if(camera.xUp){_eye[0]=_verticalEye;_look[0]=_verticalLook;}else if(camera.yUp){_eye[1]=_verticalEye;_look[1]=_verticalLook;}else if(camera.zUp){_eye[2]=_verticalEye;_look[2]=_verticalLook;}camera.eye=_eye;camera.look=_look;}}else if(configs.planView){if(configs.followPointer){var _dolliedThroughSurface=panController.dollyToCanvasPos(followPointerWorldPos,states.pointerCanvasPos,-dollyDeltaForDist);if(_dolliedThroughSurface){states.followPointerDirty=true;}}else{camera.ortho.scale=camera.ortho.scale+dollyDeltaForDist;camera.zoom(dollyDeltaForDist);}}else{// Orbiting
|
|
23060
23060
|
if(configs.followPointer){var _dolliedThroughSurface2=panController.dollyToCanvasPos(followPointerWorldPos,states.pointerCanvasPos,-dollyDeltaForDist);if(_dolliedThroughSurface2){states.followPointerDirty=true;}}else{camera.ortho.scale=camera.ortho.scale+dollyDeltaForDist;camera.zoom(dollyDeltaForDist);}}updates.dollyDelta*=configs.dollyInertia;}pickController.fireEvents();document.body.style.cursor=cursorType;});}_createClass(CameraUpdater,[{key:"destroy",value:function destroy(){this._scene.off(this._onTick);}}]);return CameraUpdater;}();/**
|
|
23061
23061
|
* @private
|
|
23062
23062
|
*/var MouseMiscHandler=/*#__PURE__*/function(){function MouseMiscHandler(scene,controllers,configs,states,updates){_classCallCheck(this,MouseMiscHandler);this._scene=scene;var canvas=this._scene.canvas.canvas;canvas.addEventListener("mouseenter",this._mouseEnterHandler=function(){states.mouseover=true;});canvas.addEventListener("mouseleave",this._mouseLeaveHandler=function(){states.mouseover=false;canvas.style.cursor=null;});document.addEventListener("mousemove",this._mouseMoveHandler=function(e){getCanvasPosFromEvent$2(e,canvas,states.pointerCanvasPos);});canvas.addEventListener("mousedown",this._mouseDownHandler=function(e){if(!(configs.active&&configs.pointerEnabled)){return;}getCanvasPosFromEvent$2(e,canvas,states.pointerCanvasPos);states.mouseover=true;});canvas.addEventListener("mouseup",this._mouseUpHandler=function(e){if(!(configs.active&&configs.pointerEnabled)){return;}});}_createClass(MouseMiscHandler,[{key:"reset",value:function reset(){}},{key:"destroy",value:function destroy(){var canvas=this._scene.canvas.canvas;document.removeEventListener("mousemove",this._mouseMoveHandler);canvas.removeEventListener("mouseenter",this._mouseEnterHandler);canvas.removeEventListener("mouseleave",this._mouseLeaveHandler);canvas.removeEventListener("mousedown",this._mouseDownHandler);canvas.removeEventListener("mouseup",this._mouseUpHandler);}}]);return MouseMiscHandler;}();function getCanvasPosFromEvent$2(event,canvas,canvasPos){if(!event){event=window.event;canvasPos[0]=event.x;canvasPos[1]=event.y;}else{var _canvas$getBoundingCl=canvas.getBoundingClientRect(),left=_canvas$getBoundingCl.left,top=_canvas$getBoundingCl.top;canvasPos[0]=event.clientX-left;canvasPos[1]=event.clientY-top;}return canvasPos;}var getCanvasPosFromEvent$1=function getCanvasPosFromEvent$1(event,canvasPos){if(!event){event=window.event;canvasPos[0]=event.x;canvasPos[1]=event.y;}else{var element=event.target;var totalOffsetLeft=0;var totalOffsetTop=0;while(element.offsetParent){totalOffsetLeft+=element.offsetLeft;totalOffsetTop+=element.offsetTop;element=element.offsetParent;}canvasPos[0]=event.pageX-totalOffsetLeft;canvasPos[1]=event.pageY-totalOffsetTop;}return canvasPos;};/**
|
|
@@ -23727,7 +23727,7 @@ keyboardDollyRate:10,mouseWheelDollyRate:100,touchDollyRate:0.2,dollyInertia:0,d
|
|
|
23727
23727
|
_this114._states={pointerCanvasPos:math.vec2(),mouseover:false,followPointerDirty:true,mouseDownClientX:0,mouseDownClientY:0,mouseDownCursorX:0,mouseDownCursorY:0,touchStartTime:null,activeTouches:[],tapStartPos:math.vec2(),tapStartTime:-1,lastTapTime:-1,longTouchTimeout:null};// Updates for CameraUpdater to process on next Scene "tick" event
|
|
23728
23728
|
_this114._updates={rotateDeltaX:0,rotateDeltaY:0,panDeltaX:0,panDeltaY:0,panDeltaZ:0,dollyDelta:0};// Controllers to assist input event handlers with controlling the Camera
|
|
23729
23729
|
var scene=_this114.scene;_this114._controllers={cameraControl:_assertThisInitialized(_this114),pickController:new PickController(_assertThisInitialized(_this114),_this114._configs),pivotController:new PivotController(scene,_this114._configs),panController:new PanController(scene),cameraFlight:new CameraFlightAnimation(_assertThisInitialized(_this114),{duration:0.5})};// Input event handlers
|
|
23730
|
-
_this114._handlers=[new MouseMiscHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new TouchPanRotateAndDollyHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new MousePanRotateDollyHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new KeyboardAxisViewHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new MousePickHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new TouchPickHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new KeyboardPanRotateDollyHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates)];// Applies scheduled updates to the Camera on each Scene "tick" event
|
|
23730
|
+
_this114._handlers=[new MouseMiscHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new TouchPanRotateAndDollyHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new MousePanRotateDollyHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new KeyboardAxisViewHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new MousePickHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new TouchPickHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates),new KeyboardPanRotateDollyHandler(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates)];_this114._cursors={dollyForward:"zoom-in",dollyBackward:"zoom-out",rotate:'grabbing',pan:'move'};// Applies scheduled updates to the Camera on each Scene "tick" event
|
|
23731
23731
|
_this114._cameraUpdater=new CameraUpdater(_this114.scene,_this114._controllers,_this114._configs,_this114._states,_this114._updates);// Set initial user configurations
|
|
23732
23732
|
_this114.navMode=cfg.navMode;if(cfg.planView){_this114.planView=cfg.planView;}_this114.constrainVertical=cfg.constrainVertical;if(cfg.keyboardLayout){_this114.keyboardLayout=cfg.keyboardLayout;// Deprecated
|
|
23733
23733
|
}else{_this114.keyMap=cfg.keyMap;}_this114.doublePickFlyTo=cfg.doublePickFlyTo;_this114.panRightClick=cfg.panRightClick;_this114.active=cfg.active;_this114.followPointer=cfg.followPointer;_this114.rotationInertia=cfg.rotationInertia;_this114.keyboardPanRate=cfg.keyboardPanRate;_this114.touchPanRate=cfg.touchPanRate;_this114.keyboardRotationRate=cfg.keyboardRotationRate;_this114.dragRotationRate=cfg.dragRotationRate;_this114.touchDollyRate=cfg.touchDollyRate;_this114.dollyInertia=cfg.dollyInertia;_this114.dollyProximityThreshold=cfg.dollyProximityThreshold;_this114.dollyMinSpeed=cfg.dollyMinSpeed;_this114.panInertia=cfg.panInertia;_this114.pointerEnabled=true;_this114.keyboardDollyRate=cfg.keyboardDollyRate;_this114.mouseWheelDollyRate=cfg.mouseWheelDollyRate;return _this114;}/**
|
|
@@ -23852,7 +23852,24 @@ case"qwerty":keyMap[this.PAN_LEFT]=[input.KEY_A];keyMap[this.PAN_RIGHT]=[input.K
|
|
|
23852
23852
|
* See class comments for more info.
|
|
23853
23853
|
*
|
|
23854
23854
|
* @param {Boolean} value Set ````true```` to enable the Camera to follow the pointer.
|
|
23855
|
-
*/,set:function set(value){this._reset();this._configs.pointerEnabled=!!value;}
|
|
23855
|
+
*/,set:function set(value){this._reset();this._configs.pointerEnabled=!!value;}/**
|
|
23856
|
+
* Sets the cursor to be used when a particular action is being performed.
|
|
23857
|
+
*
|
|
23858
|
+
* Accepted actions are:
|
|
23859
|
+
*
|
|
23860
|
+
* * "dollyForward" - when the camera is dollying in the forward direction
|
|
23861
|
+
* * "dollyBackward" - when the camera is dollying in the backward direction
|
|
23862
|
+
* * "pan" - when the camera is being panned
|
|
23863
|
+
* * "rotate" - when the camera is being rotated
|
|
23864
|
+
*
|
|
23865
|
+
* @param {String} action
|
|
23866
|
+
* @param {String} style
|
|
23867
|
+
*/},{key:"setCursorStyle",value:function setCursorStyle(action,style){if(Object.prototype.hasOwnProperty.call(this._cursors,action)){this._cursors=_objectSpread(_objectSpread({},this._cursors),{},_defineProperty2({},action,style));}else console.warn("Action '".concat(action,"' is not valid for cursor styles."));}/**
|
|
23868
|
+
* Gets the current style for a particular action.
|
|
23869
|
+
*
|
|
23870
|
+
* @param {String} action To get the style for
|
|
23871
|
+
* @returns {String} style set on the cursor for action
|
|
23872
|
+
*/},{key:"getCursorStyle",value:function getCursorStyle(action){return this._cursors[action]||null;}},{key:"_reset",value:function _reset(){for(var _i486=0,len=this._handlers.length;_i486<len;_i486++){var handler=this._handlers[_i486];if(handler.reset){handler.reset();}}this._updates.panDeltaX=0;this._updates.panDeltaY=0;this._updates.rotateDeltaX=0;this._updates.rotateDeltaY=0;this._updates.dolyDelta=0;}},{key:"followPointer",get:/**
|
|
23856
23873
|
* Sets whether the {@link Camera} follows the mouse/touch pointer.
|
|
23857
23874
|
*
|
|
23858
23875
|
* In orbiting mode, the Camera will orbit about the pointer, and will dolly to and from the pointer.
|