@xeokit/xeokit-sdk 2.6.109 → 2.6.111
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 +39 -26
- package/dist/xeokit-sdk.es.js +39 -26
- package/dist/xeokit-sdk.es5.js +20 -19
- package/dist/xeokit-sdk.min.cjs.js +7 -7
- package/dist/xeokit-sdk.min.es.js +6 -6
- package/dist/xeokit-sdk.min.es5.js +6 -6
- package/package.json +4 -4
- package/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +26 -5
- package/src/viewer/scene/CameraControl/lib/CameraUpdater.js +9 -17
- package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +2 -0
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* xeokit-sdk v2.6.
|
|
3
|
-
* Commit:
|
|
4
|
-
* Built: 2026-05-
|
|
2
|
+
* xeokit-sdk v2.6.111
|
|
3
|
+
* Commit: f70838c6581084cf8401daf800ff7c14582ec11a
|
|
4
|
+
* Built: 2026-05-27T11:07:01.143Z
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
if (typeof window !== 'undefined') {
|
|
8
|
-
window.__XEOKIT__ = { version: '2.6.
|
|
8
|
+
window.__XEOKIT__ = { version: '2.6.111', commit: 'f70838c6581084cf8401daf800ff7c14582ec11a', built: '2026-05-27T11:07:01.143Z' };
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
@@ -59077,26 +59077,18 @@ class CameraUpdater {
|
|
|
59077
59077
|
|
|
59078
59078
|
if (updates.rotateDeltaY !== 0 || updates.rotateDeltaX !== 0) {
|
|
59079
59079
|
|
|
59080
|
-
if (
|
|
59081
|
-
pivotController.continuePivot(updates.rotateDeltaY, updates.rotateDeltaX);
|
|
59082
|
-
pivotController.showPivot();
|
|
59083
|
-
|
|
59084
|
-
} else {
|
|
59085
|
-
|
|
59080
|
+
if (configs.firstPerson) {
|
|
59086
59081
|
if (updates.rotateDeltaX !== 0) {
|
|
59087
|
-
|
|
59088
|
-
camera.pitch(-updates.rotateDeltaX);
|
|
59089
|
-
} else {
|
|
59090
|
-
camera.orbitPitch(updates.rotateDeltaX);
|
|
59091
|
-
}
|
|
59082
|
+
camera.pitch(-updates.rotateDeltaX);
|
|
59092
59083
|
}
|
|
59093
|
-
|
|
59094
59084
|
if (updates.rotateDeltaY !== 0) {
|
|
59095
|
-
|
|
59096
|
-
|
|
59097
|
-
|
|
59098
|
-
|
|
59099
|
-
|
|
59085
|
+
camera.yaw(updates.rotateDeltaY);
|
|
59086
|
+
}
|
|
59087
|
+
}
|
|
59088
|
+
else {
|
|
59089
|
+
if (configs.followPointer && pivotController.getPivoting()){
|
|
59090
|
+
pivotController.continuePivot(updates.rotateDeltaY, updates.rotateDeltaX);
|
|
59091
|
+
pivotController.showPivot();
|
|
59100
59092
|
}
|
|
59101
59093
|
}
|
|
59102
59094
|
|
|
@@ -127276,6 +127268,7 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
127276
127268
|
* @param {ArrayBuffer} [params.xkt] The *````.xkt````* file data, as an alternative to the ````src```` parameter.
|
|
127277
127269
|
* @param {String} [params.metaModelSrc] Path or URL to an optional metadata file, as an alternative to the ````metaModelData```` parameter.
|
|
127278
127270
|
* @param {*} [params.metaModelData] JSON model metadata, as an alternative to the ````metaModelSrc```` parameter.
|
|
127271
|
+
* @param {Boolean} [params.loadIntoMetaScene=true] Whether to load metadata into MetaScene, otherwise expose as SceneModel::metadata.
|
|
127279
127272
|
* @param {String} [params.manifestSrc] Path or URL to a JSON manifest file that provides paths to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split into
|
|
127280
127273
|
* multiple XKT files. See [tutorial](https://xeokit.io/blog/automatically-splitting-large-models-for-better-performance) for more info.
|
|
127281
127274
|
* @param {Object} [params.manifest] A JSON manifest object (as an alternative to a path or URL) that provides paths to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split into
|
|
@@ -127371,10 +127364,30 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
127371
127364
|
|
|
127372
127365
|
const modelId = sceneModel.id; // In case ID was auto-generated
|
|
127373
127366
|
|
|
127374
|
-
const
|
|
127375
|
-
|
|
127376
|
-
|
|
127377
|
-
|
|
127367
|
+
const loadIntoMetaScene = (! ("loadIntoMetaScene" in params)) || params.loadIntoMetaScene;
|
|
127368
|
+
const metaModel = (loadIntoMetaScene
|
|
127369
|
+
? new MetaModel({
|
|
127370
|
+
id: modelId,
|
|
127371
|
+
metaScene: this.viewer.metaScene
|
|
127372
|
+
})
|
|
127373
|
+
: (function() {
|
|
127374
|
+
let firstMetadata = null;
|
|
127375
|
+
let modelMetadata = null;
|
|
127376
|
+
return {
|
|
127377
|
+
loadData: metadata => {
|
|
127378
|
+
if (! firstMetadata) {
|
|
127379
|
+
firstMetadata = metadata;
|
|
127380
|
+
} else {
|
|
127381
|
+
if (! modelMetadata) {
|
|
127382
|
+
modelMetadata = { };
|
|
127383
|
+
Object.entries(firstMetadata).forEach(([ k, v ]) => modelMetadata[k] = Array.isArray(v) ? v.slice(0) : v);
|
|
127384
|
+
}
|
|
127385
|
+
Object.entries(metadata).forEach(([ k, v ]) => { if (Array.isArray(v)) { v.forEach(e => modelMetadata[k].push(e)); } });
|
|
127386
|
+
}
|
|
127387
|
+
},
|
|
127388
|
+
finalize: () => sceneModel.metadata = modelMetadata || firstMetadata
|
|
127389
|
+
};
|
|
127390
|
+
})());
|
|
127378
127391
|
|
|
127379
127392
|
this.viewer.scene.canvas.spinner.processes++;
|
|
127380
127393
|
|
|
@@ -127387,7 +127400,7 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
127387
127400
|
metaModel.finalize();
|
|
127388
127401
|
this.viewer.scene.canvas.spinner.processes--;
|
|
127389
127402
|
sceneModel.once("destroyed", () => {
|
|
127390
|
-
this.viewer.metaScene.destroyMetaModel(metaModel.id);
|
|
127403
|
+
loadIntoMetaScene && this.viewer.metaScene.destroyMetaModel(metaModel.id);
|
|
127391
127404
|
});
|
|
127392
127405
|
this.scheduleTask(() => {
|
|
127393
127406
|
if (sceneModel.destroyed) {
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* xeokit-sdk v2.6.
|
|
3
|
-
* Commit:
|
|
4
|
-
* Built: 2026-05-
|
|
2
|
+
* xeokit-sdk v2.6.111
|
|
3
|
+
* Commit: f70838c6581084cf8401daf800ff7c14582ec11a
|
|
4
|
+
* Built: 2026-05-27T11:07:01.143Z
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
if (typeof window !== 'undefined') {
|
|
8
|
-
window.__XEOKIT__ = { version: '2.6.
|
|
8
|
+
window.__XEOKIT__ = { version: '2.6.111', commit: 'f70838c6581084cf8401daf800ff7c14582ec11a', built: '2026-05-27T11:07:01.143Z' };
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/** @private */
|
|
@@ -59073,26 +59073,18 @@ class CameraUpdater {
|
|
|
59073
59073
|
|
|
59074
59074
|
if (updates.rotateDeltaY !== 0 || updates.rotateDeltaX !== 0) {
|
|
59075
59075
|
|
|
59076
|
-
if (
|
|
59077
|
-
pivotController.continuePivot(updates.rotateDeltaY, updates.rotateDeltaX);
|
|
59078
|
-
pivotController.showPivot();
|
|
59079
|
-
|
|
59080
|
-
} else {
|
|
59081
|
-
|
|
59076
|
+
if (configs.firstPerson) {
|
|
59082
59077
|
if (updates.rotateDeltaX !== 0) {
|
|
59083
|
-
|
|
59084
|
-
camera.pitch(-updates.rotateDeltaX);
|
|
59085
|
-
} else {
|
|
59086
|
-
camera.orbitPitch(updates.rotateDeltaX);
|
|
59087
|
-
}
|
|
59078
|
+
camera.pitch(-updates.rotateDeltaX);
|
|
59088
59079
|
}
|
|
59089
|
-
|
|
59090
59080
|
if (updates.rotateDeltaY !== 0) {
|
|
59091
|
-
|
|
59092
|
-
|
|
59093
|
-
|
|
59094
|
-
|
|
59095
|
-
|
|
59081
|
+
camera.yaw(updates.rotateDeltaY);
|
|
59082
|
+
}
|
|
59083
|
+
}
|
|
59084
|
+
else {
|
|
59085
|
+
if (configs.followPointer && pivotController.getPivoting()){
|
|
59086
|
+
pivotController.continuePivot(updates.rotateDeltaY, updates.rotateDeltaX);
|
|
59087
|
+
pivotController.showPivot();
|
|
59096
59088
|
}
|
|
59097
59089
|
}
|
|
59098
59090
|
|
|
@@ -127272,6 +127264,7 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
127272
127264
|
* @param {ArrayBuffer} [params.xkt] The *````.xkt````* file data, as an alternative to the ````src```` parameter.
|
|
127273
127265
|
* @param {String} [params.metaModelSrc] Path or URL to an optional metadata file, as an alternative to the ````metaModelData```` parameter.
|
|
127274
127266
|
* @param {*} [params.metaModelData] JSON model metadata, as an alternative to the ````metaModelSrc```` parameter.
|
|
127267
|
+
* @param {Boolean} [params.loadIntoMetaScene=true] Whether to load metadata into MetaScene, otherwise expose as SceneModel::metadata.
|
|
127275
127268
|
* @param {String} [params.manifestSrc] Path or URL to a JSON manifest file that provides paths to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split into
|
|
127276
127269
|
* multiple XKT files. See [tutorial](https://xeokit.io/blog/automatically-splitting-large-models-for-better-performance) for more info.
|
|
127277
127270
|
* @param {Object} [params.manifest] A JSON manifest object (as an alternative to a path or URL) that provides paths to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split into
|
|
@@ -127367,10 +127360,30 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
127367
127360
|
|
|
127368
127361
|
const modelId = sceneModel.id; // In case ID was auto-generated
|
|
127369
127362
|
|
|
127370
|
-
const
|
|
127371
|
-
|
|
127372
|
-
|
|
127373
|
-
|
|
127363
|
+
const loadIntoMetaScene = (! ("loadIntoMetaScene" in params)) || params.loadIntoMetaScene;
|
|
127364
|
+
const metaModel = (loadIntoMetaScene
|
|
127365
|
+
? new MetaModel({
|
|
127366
|
+
id: modelId,
|
|
127367
|
+
metaScene: this.viewer.metaScene
|
|
127368
|
+
})
|
|
127369
|
+
: (function() {
|
|
127370
|
+
let firstMetadata = null;
|
|
127371
|
+
let modelMetadata = null;
|
|
127372
|
+
return {
|
|
127373
|
+
loadData: metadata => {
|
|
127374
|
+
if (! firstMetadata) {
|
|
127375
|
+
firstMetadata = metadata;
|
|
127376
|
+
} else {
|
|
127377
|
+
if (! modelMetadata) {
|
|
127378
|
+
modelMetadata = { };
|
|
127379
|
+
Object.entries(firstMetadata).forEach(([ k, v ]) => modelMetadata[k] = Array.isArray(v) ? v.slice(0) : v);
|
|
127380
|
+
}
|
|
127381
|
+
Object.entries(metadata).forEach(([ k, v ]) => { if (Array.isArray(v)) { v.forEach(e => modelMetadata[k].push(e)); } });
|
|
127382
|
+
}
|
|
127383
|
+
},
|
|
127384
|
+
finalize: () => sceneModel.metadata = modelMetadata || firstMetadata
|
|
127385
|
+
};
|
|
127386
|
+
})());
|
|
127374
127387
|
|
|
127375
127388
|
this.viewer.scene.canvas.spinner.processes++;
|
|
127376
127389
|
|
|
@@ -127383,7 +127396,7 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
127383
127396
|
metaModel.finalize();
|
|
127384
127397
|
this.viewer.scene.canvas.spinner.processes--;
|
|
127385
127398
|
sceneModel.once("destroyed", () => {
|
|
127386
|
-
this.viewer.metaScene.destroyMetaModel(metaModel.id);
|
|
127399
|
+
loadIntoMetaScene && this.viewer.metaScene.destroyMetaModel(metaModel.id);
|
|
127387
127400
|
});
|
|
127388
127401
|
this.scheduleTask(() => {
|
|
127389
127402
|
if (sceneModel.destroyed) {
|
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* xeokit-sdk v2.6.
|
|
3
|
-
* Commit:
|
|
4
|
-
* Built: 2026-05-
|
|
2
|
+
* xeokit-sdk v2.6.111
|
|
3
|
+
* Commit: f70838c6581084cf8401daf800ff7c14582ec11a
|
|
4
|
+
* Built: 2026-05-27T11:07:01.143Z
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
var _globalThis$loaders3;var _marked=/*#__PURE__*/_regenerator().m(makeStringIterator),_marked2=/*#__PURE__*/_regenerator().m(makeMeshPrimitiveIterator);function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a;}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0));}if(o||r>1)return a;throw y=!0,n;}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0);}else 1===c&&(t=i["return"])&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e;}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break;}catch(t){i=e,c=1,u=t;}finally{f=1;}}return{value:t,done:y};};}(r,o,i),!0),u;}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this;}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e;}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this;}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]";}),(_regenerator=function _regenerator(){return{w:i,m:f};})();}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{});}catch(e){i=0;}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e);});}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2));},_regeneratorDefine2(e,r,n,t);}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n7=0,F=function F(){};return{s:F,n:function n(){return _n7>=r.length?{done:!0}:{done:!1,value:r[_n7++]};},e:function e(r){throw r;},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_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 _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _awaitAsyncGenerator(e){return new _OverloadYield(e,0);}function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments));};}function AsyncGenerator(e){var t,n;function resume(t,n){try{var r=e[t](n),o=r.value,u=o instanceof _OverloadYield;Promise.resolve(u?o.v:o).then(function(n){if(u){var i="return"===t&&o.k?t:"next";if(!o.k||n.done)return resume(i,n);n=e[i](n).value;}settle(!!r.done,n);},function(e){resume("throw",e);});}catch(e){settle(2,e);}}function settle(e,r){2===e?t.reject(r):t.resolve({value:r,done:e}),(t=t.next)?resume(t.key,t.arg):n=null;}this._invoke=function(e,r){return new Promise(function(o,u){var i={key:e,arg:r,resolve:o,reject:u,next:null};n?n=n.next=i:(t=n=i,resume(e,r));});},"function"!=typeof e["return"]&&(this["return"]=void 0);}AsyncGenerator.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this;},AsyncGenerator.prototype.next=function(e){return this._invoke("next",e);},AsyncGenerator.prototype["throw"]=function(e){return this._invoke("throw",e);},AsyncGenerator.prototype["return"]=function(e){return this._invoke("return",e);};function _OverloadYield(e,d){this.v=e,this.k=d;}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},"return":function _return(r){var n=this.s["return"];return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));},"throw":function _throw(r){var n=this.s["return"];return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));}},new AsyncFromSyncIterator(r);}if(typeof window!=='undefined'){window.__XEOKIT__={version:'2.6.109',commit:'3796b67f0bbcca7382160e5030522506fb49a54e',built:'2026-05-08T06:25:43.604Z'};}/** @private */var Map$1=/*#__PURE__*/function(){function Map$1(items,baseId){_classCallCheck(this,Map$1);this.items=items||[];this._lastUniqueId=(baseId||0)+1;}/**
|
|
7
|
+
var _globalThis$loaders3;var _marked=/*#__PURE__*/_regenerator().m(makeStringIterator),_marked2=/*#__PURE__*/_regenerator().m(makeMeshPrimitiveIterator);function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a;}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0));}if(o||r>1)return a;throw y=!0,n;}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0);}else 1===c&&(t=i["return"])&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e;}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break;}catch(t){i=e,c=1,u=t;}finally{f=1;}}return{value:t,done:y};};}(r,o,i),!0),u;}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this;}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e;}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this;}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]";}),(_regenerator=function _regenerator(){return{w:i,m:f};})();}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{});}catch(e){i=0;}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e);});}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2));},_regeneratorDefine2(e,r,n,t);}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n7=0,F=function F(){};return{s:F,n:function n(){return _n7>=r.length?{done:!0}:{done:!1,value:r[_n7++]};},e:function e(r){throw r;},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_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 _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _awaitAsyncGenerator(e){return new _OverloadYield(e,0);}function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments));};}function AsyncGenerator(e){var t,n;function resume(t,n){try{var r=e[t](n),o=r.value,u=o instanceof _OverloadYield;Promise.resolve(u?o.v:o).then(function(n){if(u){var i="return"===t&&o.k?t:"next";if(!o.k||n.done)return resume(i,n);n=e[i](n).value;}settle(!!r.done,n);},function(e){resume("throw",e);});}catch(e){settle(2,e);}}function settle(e,r){2===e?t.reject(r):t.resolve({value:r,done:e}),(t=t.next)?resume(t.key,t.arg):n=null;}this._invoke=function(e,r){return new Promise(function(o,u){var i={key:e,arg:r,resolve:o,reject:u,next:null};n?n=n.next=i:(t=n=i,resume(e,r));});},"function"!=typeof e["return"]&&(this["return"]=void 0);}AsyncGenerator.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this;},AsyncGenerator.prototype.next=function(e){return this._invoke("next",e);},AsyncGenerator.prototype["throw"]=function(e){return this._invoke("throw",e);},AsyncGenerator.prototype["return"]=function(e){return this._invoke("return",e);};function _OverloadYield(e,d){this.v=e,this.k=d;}function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator";}throw new TypeError("Object is not async iterable");}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then(function(r){return{value:r,done:n};});}return AsyncFromSyncIterator=function AsyncFromSyncIterator(r){this.s=r,this.n=r.next;},AsyncFromSyncIterator.prototype={s:null,n:null,next:function next(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments));},"return":function _return(r){var n=this.s["return"];return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));},"throw":function _throw(r){var n=this.s["return"];return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments));}},new AsyncFromSyncIterator(r);}if(typeof window!=='undefined'){window.__XEOKIT__={version:'2.6.111',commit:'f70838c6581084cf8401daf800ff7c14582ec11a',built:'2026-05-27T11:07:01.143Z'};}/** @private */var Map$1=/*#__PURE__*/function(){function Map$1(items,baseId){_classCallCheck(this,Map$1);this.items=items||[];this._lastUniqueId=(baseId||0)+1;}/**
|
|
8
8
|
* Usage:
|
|
9
9
|
*
|
|
10
10
|
* id = myMap.addItem("foo") // ID internally generated
|
|
@@ -18488,7 +18488,7 @@ if(Math.abs(updates.rotateDeltaX)<EPSILON){updates.rotateDeltaX=0;}if(Math.abs(u
|
|
|
18488
18488
|
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$3)));dollyDistFactor=dist/configs.dollyProximityThreshold;}if(dollyDistFactor<configs.dollyMinSpeed){dollyDistFactor=configs.dollyMinSpeed;}}}}else{dollyDistFactor=1;followPointerWorldPos=null;}var dollyDeltaForDist=updates.dollyDelta*dollyDistFactor;//----------------------------------------------------------------------------------------------------------
|
|
18489
18489
|
// Rotation
|
|
18490
18490
|
//----------------------------------------------------------------------------------------------------------
|
|
18491
|
-
if(updates.rotateDeltaY!==0||updates.rotateDeltaX!==0){if(
|
|
18491
|
+
if(updates.rotateDeltaY!==0||updates.rotateDeltaX!==0){if(configs.firstPerson){if(updates.rotateDeltaX!==0){camera.pitch(-updates.rotateDeltaX);}if(updates.rotateDeltaY!==0){camera.yaw(updates.rotateDeltaY);}}else{if(configs.followPointer&&pivotController.getPivoting()){pivotController.continuePivot(updates.rotateDeltaY,updates.rotateDeltaX);pivotController.showPivot();}}updates.rotateDeltaX*=configs.rotationInertia;updates.rotateDeltaY*=configs.rotationInertia;cursorType=cameraControl._cursors.rotate;}//----------------------------------------------------------------------------------------------------------
|
|
18492
18492
|
// Panning
|
|
18493
18493
|
//----------------------------------------------------------------------------------------------------------
|
|
18494
18494
|
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;//----------------------------------------------------------------------------------------------------------
|
|
@@ -20472,7 +20472,7 @@ async function loadScriptFromFile(libraryUrl) {
|
|
|
20472
20472
|
// - Potentially bypasses CORS
|
|
20473
20473
|
// Upside is that this separates fetching and parsing
|
|
20474
20474
|
// we could create a`LibraryLoader` or`ModuleLoader`
|
|
20475
|
-
function _loadLibraryFromFile(){_loadLibraryFromFile=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12(libraryUrl){var
|
|
20475
|
+
function _loadLibraryFromFile(){_loadLibraryFromFile=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12(libraryUrl){var _ref31,requireFromFile,scriptSource,_t11;return _regenerator().w(function(_context15){while(1)switch(_context15.p=_context15.n){case 0:if(!libraryUrl.endsWith('wasm')){_context15.n=2;break;}_context15.n=1;return loadAsArrayBuffer(libraryUrl);case 1:return _context15.a(2,_context15.v);case 2:if(isBrowser){_context15.n=6;break;}_context15.p=3;_ref31=globalThis.loaders||{},requireFromFile=_ref31.requireFromFile;_context15.n=4;return requireFromFile===null||requireFromFile===void 0?void 0:requireFromFile(libraryUrl);case 4:return _context15.a(2,_context15.v);case 5:_context15.p=5;_t11=_context15.v;console.error(_t11);// eslint-disable-line no-console
|
|
20476
20476
|
return _context15.a(2,null);case 6:if(!isWorker){_context15.n=7;break;}return _context15.a(2,importScripts(libraryUrl));case 7:_context15.n=8;return loadAsText(libraryUrl);case 8:scriptSource=_context15.v;return _context15.a(2,loadLibraryFromString(scriptSource,libraryUrl));}},_callee12,null,[[3,5]]);}));return _loadLibraryFromFile.apply(this,arguments);}function loadLibraryFromString(scriptSource,id){if(!isBrowser){var _ref10=globalThis.loaders||{},requireFromString=_ref10.requireFromString;return requireFromString===null||requireFromString===void 0?void 0:requireFromString(scriptSource,id);}if(isWorker){// Use lvalue trick to make eval run in global scope
|
|
20477
20477
|
eval.call(globalThis,scriptSource);// eslint-disable-line no-eval
|
|
20478
20478
|
// https://stackoverflow.com/questions/9107240/1-evalthis-vs-evalthis-in-javascript
|
|
@@ -20495,11 +20495,11 @@ function combineWorkerWithLibrary(worker, jsContent) {
|
|
|
20495
20495
|
* Load a file from local file system
|
|
20496
20496
|
* @param filename
|
|
20497
20497
|
* @returns
|
|
20498
|
-
*/function _loadAsArrayBuffer(){_loadAsArrayBuffer=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13(url){var
|
|
20498
|
+
*/function _loadAsArrayBuffer(){_loadAsArrayBuffer=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13(url){var _ref32,readFileAsArrayBuffer,response;return _regenerator().w(function(_context16){while(1)switch(_context16.n){case 0:_ref32=globalThis.loaders||{},readFileAsArrayBuffer=_ref32.readFileAsArrayBuffer;if(!(isBrowser||!readFileAsArrayBuffer||url.startsWith('http'))){_context16.n=3;break;}_context16.n=1;return fetch(url);case 1:response=_context16.v;_context16.n=2;return response.arrayBuffer();case 2:return _context16.a(2,_context16.v);case 3:_context16.n=4;return readFileAsArrayBuffer(url);case 4:return _context16.a(2,_context16.v);}},_callee13);}));return _loadAsArrayBuffer.apply(this,arguments);}function loadAsText(_x13){return _loadAsText.apply(this,arguments);}/**
|
|
20499
20499
|
* Determines if a loader can parse with worker
|
|
20500
20500
|
* @param loader
|
|
20501
20501
|
* @param options
|
|
20502
|
-
*/function _loadAsText(){_loadAsText=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(url){var
|
|
20502
|
+
*/function _loadAsText(){_loadAsText=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(url){var _ref33,readFileAsText,response;return _regenerator().w(function(_context17){while(1)switch(_context17.n){case 0:_ref33=globalThis.loaders||{},readFileAsText=_ref33.readFileAsText;if(!(isBrowser||!readFileAsText||url.startsWith('http'))){_context17.n=3;break;}_context17.n=1;return fetch(url);case 1:response=_context17.v;_context17.n=2;return response.text();case 2:return _context17.a(2,_context17.v);case 3:_context17.n=4;return readFileAsText(url);case 4:return _context17.a(2,_context17.v);}},_callee14);}));return _loadAsText.apply(this,arguments);}function canParseWithWorker(loader,options){if(!WorkerFarm.isSupported()){return false;}// Node workers are still experimental
|
|
20503
20503
|
if(!isBrowser&&!(options!==null&&options!==void 0&&options._nodeWorkers)){return false;}return loader.worker&&(options===null||options===void 0?void 0:options.worker);}/**
|
|
20504
20504
|
* this function expects that the worker function sends certain messages,
|
|
20505
20505
|
* this can be automated if the worker is wrapper by a call to createLoaderWorker in @loaders.gl/loader-utils.
|
|
@@ -21179,12 +21179,12 @@ function toDataView(data){if(data instanceof DataView){return data;}if(ArrayBuff
|
|
|
21179
21179
|
if(data instanceof ArrayBuffer){return new DataView(data);}throw new Error('toDataView');}// Use polyfills if installed to parsed image using get-pixels
|
|
21180
21180
|
function parseToNodeImage(_x51,_x52){return _parseToNodeImage.apply(this,arguments);}// Parse to platform defined image type (data on node, ImageBitmap or HTMLImage on browser)
|
|
21181
21181
|
// eslint-disable-next-line complexity
|
|
21182
|
-
function _parseToNodeImage(){_parseToNodeImage=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31(arrayBuffer,options){var _globalThis$loaders8;var
|
|
21182
|
+
function _parseToNodeImage(){_parseToNodeImage=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31(arrayBuffer,options){var _globalThis$loaders8;var _ref34,mimeType,parseImageNode;return _regenerator().w(function(_context34){while(1)switch(_context34.n){case 0:_ref34=getBinaryImageMetadata(arrayBuffer)||{},mimeType=_ref34.mimeType;// @ts-ignore
|
|
21183
21183
|
parseImageNode=(_globalThis$loaders8=globalThis.loaders)===null||_globalThis$loaders8===void 0?void 0:_globalThis$loaders8.parseImageNode;assert$4(parseImageNode);// '@loaders.gl/polyfills not installed'
|
|
21184
21184
|
// @ts-expect-error TODO should we throw error in this case?
|
|
21185
21185
|
_context34.n=1;return parseImageNode(arrayBuffer,mimeType);case 1:return _context34.a(2,_context34.v);}},_callee31);}));return _parseToNodeImage.apply(this,arguments);}function parseImage(_x53,_x54,_x55){return _parseImage.apply(this,arguments);}// Get a loadable image type from image type
|
|
21186
|
-
function _parseImage(){_parseImage=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee32(arrayBuffer,options,context){var imageOptions,imageType,
|
|
21187
|
-
imageType=imageOptions.type||'auto';
|
|
21186
|
+
function _parseImage(){_parseImage=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee32(arrayBuffer,options,context){var imageOptions,imageType,_ref35,url,loadType,image,_t19;return _regenerator().w(function(_context35){while(1)switch(_context35.n){case 0:options=options||{};imageOptions=options.image||{};// The user can request a specific output format via `options.image.type`
|
|
21187
|
+
imageType=imageOptions.type||'auto';_ref35=context||{},url=_ref35.url;// Note: For options.image.type === `data`, we may still need to load as `image` or `imagebitmap`
|
|
21188
21188
|
loadType=getLoadableImageType(imageType);_t19=loadType;_context35.n=_t19==='imagebitmap'?1:_t19==='image'?3:_t19==='data'?5:7;break;case 1:_context35.n=2;return parseToImageBitmap(arrayBuffer,options,url);case 2:image=_context35.v;return _context35.a(3,8);case 3:_context35.n=4;return parseToImage(arrayBuffer,options,url);case 4:image=_context35.v;return _context35.a(3,8);case 5:_context35.n=6;return parseToNodeImage(arrayBuffer);case 6:image=_context35.v;return _context35.a(3,8);case 7:assert$4(false);case 8:// Browser: if options.image.type === 'data', we can now extract data from the loaded image
|
|
21189
21189
|
if(imageType==='data'){image=getImageData(image);}return _context35.a(2,image);}},_callee32);}));return _parseImage.apply(this,arguments);}function getLoadableImageType(type){switch(type){case'auto':case'data':// Browser: For image data we need still need to load using an image format
|
|
21190
21190
|
// Node: the default image type is `data`.
|
|
@@ -29885,6 +29885,7 @@ var ParserV12={version:12,parseArrayBuffer:function parseArrayBuffer(viewer,opti
|
|
|
29885
29885
|
* @param {ArrayBuffer} [params.xkt] The *````.xkt````* file data, as an alternative to the ````src```` parameter.
|
|
29886
29886
|
* @param {String} [params.metaModelSrc] Path or URL to an optional metadata file, as an alternative to the ````metaModelData```` parameter.
|
|
29887
29887
|
* @param {*} [params.metaModelData] JSON model metadata, as an alternative to the ````metaModelSrc```` parameter.
|
|
29888
|
+
* @param {Boolean} [params.loadIntoMetaScene=true] Whether to load metadata into MetaScene, otherwise expose as SceneModel::metadata.
|
|
29888
29889
|
* @param {String} [params.manifestSrc] Path or URL to a JSON manifest file that provides paths to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split into
|
|
29889
29890
|
* multiple XKT files. See [tutorial](https://xeokit.io/blog/automatically-splitting-large-models-for-better-performance) for more info.
|
|
29890
29891
|
* @param {Object} [params.manifest] A JSON manifest object (as an alternative to a path or URL) that provides paths to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split into
|
|
@@ -29921,8 +29922,8 @@ var ParserV12={version:12,parseArrayBuffer:function parseArrayBuffer(viewer,opti
|
|
|
29921
29922
|
* render pass.
|
|
29922
29923
|
* @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
|
|
29923
29924
|
*/},{key:"load",value:function load(){var _this189=this;var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(params.id&&this.viewer.scene.components[params.id]){this.error("Component with this ID already exists in viewer: "+params.id+" - will autogenerate this ID");delete params.id;}if(!params.src&&!params.xkt&&!params.manifestSrc&&!params.manifest)throw new Error("XKTLoaderPlugin: load() param expected: src, xkt, manifestSrc or manifestData");var options={};var includeTypes=params.includeTypes||this._includeTypes;var excludeTypes=params.excludeTypes||this._excludeTypes;var includeIds=params.includeIds||this._includeIds;var objectDefaults=params.objectDefaults||this._objectDefaults;options.reuseGeometries=params.reuseGeometries!==null&¶ms.reuseGeometries!==undefined?params.reuseGeometries:this._reuseGeometries!==false;if(includeTypes){options.includeTypesMap={};for(var _i382=0,len=includeTypes.length;_i382<len;_i382++){options.includeTypesMap[includeTypes[_i382]]=true;}}if(excludeTypes){options.excludeTypesMap={};for(var _i383=0,_len52=excludeTypes.length;_i383<_len52;_i383++){options.excludeTypesMap[excludeTypes[_i383]]=true;}}if(includeIds){options.includeIdsMap={};for(var _i384=0,_len53=includeIds.length;_i384<_len53;_i384++){options.includeIdsMap[includeIds[_i384]]=true;}}if(objectDefaults){options.objectDefaults=objectDefaults;}options.excludeUnclassifiedObjects=params.excludeUnclassifiedObjects!==undefined?!!params.excludeUnclassifiedObjects:this._excludeUnclassifiedObjects;options.globalizeObjectIds=params.globalizeObjectIds!==undefined&¶ms.globalizeObjectIds!==null?!!params.globalizeObjectIds:this._globalizeObjectIds;var sceneModel=new SceneModel(this.viewer.scene,utils.apply(params,{isModel:true,textureTranscoder:this._textureTranscoder,maxGeometryBatchSize:this._maxGeometryBatchSize,origin:params.origin,disableVertexWelding:params.disableVertexWelding||false,disableIndexRebucketing:params.disableIndexRebucketing||false,dtxEnabled:params.dtxEnabled,renderOrder:params.renderOrder}));var modelId=sceneModel.id;// In case ID was auto-generated
|
|
29924
|
-
var metaModel=new MetaModel({metaScene:this.viewer.metaScene,
|
|
29925
|
-
sceneModel.finalize();metaModel.finalize();_this189.viewer.scene.canvas.spinner.processes--;sceneModel.once("destroyed",function(){_this189.viewer.metaScene.destroyMetaModel(metaModel.id);});_this189.scheduleTask(function(){if(sceneModel.destroyed){return;}sceneModel.scene.fire("modelLoaded",sceneModel.id);// FIXME: Assumes listeners know order of these two events
|
|
29925
|
+
var loadIntoMetaScene=!("loadIntoMetaScene"in params)||params.loadIntoMetaScene;var metaModel=loadIntoMetaScene?new MetaModel({id:modelId,metaScene:this.viewer.metaScene}):function(){var firstMetadata=null;var modelMetadata=null;return{loadData:function loadData(metadata){if(!firstMetadata){firstMetadata=metadata;}else{if(!modelMetadata){modelMetadata={};Object.entries(firstMetadata).forEach(function(_ref21){var _ref22=_slicedToArray(_ref21,2),k=_ref22[0],v=_ref22[1];return modelMetadata[k]=Array.isArray(v)?v.slice(0):v;});}Object.entries(metadata).forEach(function(_ref23){var _ref24=_slicedToArray(_ref23,2),k=_ref24[0],v=_ref24[1];if(Array.isArray(v)){v.forEach(function(e){return modelMetadata[k].push(e);});}});}},finalize:function finalize(){return sceneModel.metadata=modelMetadata||firstMetadata;}};}();this.viewer.scene.canvas.spinner.processes++;var finish=function finish(){if(sceneModel.destroyed){return;}// this._createDefaultMetaModelIfNeeded(sceneModel, params, options);
|
|
29926
|
+
sceneModel.finalize();metaModel.finalize();_this189.viewer.scene.canvas.spinner.processes--;sceneModel.once("destroyed",function(){loadIntoMetaScene&&_this189.viewer.metaScene.destroyMetaModel(metaModel.id);});_this189.scheduleTask(function(){if(sceneModel.destroyed){return;}sceneModel.scene.fire("modelLoaded",sceneModel.id);// FIXME: Assumes listeners know order of these two events
|
|
29926
29927
|
sceneModel.fire("loaded",true,false);// Don't forget the event, for late subscribers
|
|
29927
29928
|
});};var error=function error(errMsg){_this189.viewer.scene.canvas.spinner.processes--;_this189.error(errMsg);sceneModel.fire("error",errMsg);};var nextId=0;var manifestCtx={getNextId:function getNextId(){return"".concat(modelId,".").concat(nextId++);}};if(params.metaModelSrc||params.metaModelData){if(params.metaModelSrc){var metaModelSrc=params.metaModelSrc;this._dataSource.getMetaModel(metaModelSrc,function(metaModelData){if(sceneModel.destroyed){return;}metaModel.loadData(metaModelData,{includeTypes:includeTypes,excludeTypes:excludeTypes,globalizeObjectIds:options.globalizeObjectIds});if(params.src){_this189._loadModel(params.src,options,sceneModel,null,manifestCtx,finish,error);}else{_this189._parseModel(params.xkt,options,sceneModel,null,manifestCtx);finish();}},function(errMsg){error("load(): Failed to load model metadata for model '".concat(modelId," from '").concat(metaModelSrc,"' - ").concat(errMsg));});}else if(params.metaModelData){metaModel.loadData(params.metaModelData,{includeTypes:includeTypes,excludeTypes:excludeTypes,globalizeObjectIds:options.globalizeObjectIds});if(params.src){this._loadModel(params.src,options,sceneModel,null,manifestCtx,finish,error);}else{this._parseModel(params.xkt,options,sceneModel,null,manifestCtx);finish();}}}else{if(params.src){this._loadModel(params.src,options,sceneModel,metaModel,manifestCtx,finish,error);}else if(params.xkt){this._parseModel(params.xkt,options,sceneModel,metaModel,manifestCtx);finish();}else if(params.manifestSrc||params.manifest){var baseDir=params.manifestSrc?getBaseDirectory$1(params.manifestSrc):"";var loadJSONs=function loadJSONs(metaDataFiles,done,error){var i=0;var _loadNext=function loadNext(){if(sceneModel.destroyed){done();}else if(i>=metaDataFiles.length){done();}else{_this189._dataSource.getMetaModel("".concat(baseDir).concat(metaDataFiles[i]),function(metaModelData){metaModel.loadData(metaModelData,{includeTypes:includeTypes,excludeTypes:excludeTypes,globalizeObjectIds:options.globalizeObjectIds});i++;_this189.scheduleTask(_loadNext,200);},error);}};_loadNext();};var loadXKTs_excludeTheirMetaModels=function loadXKTs_excludeTheirMetaModels(xktFiles,done,error){// Load XKTs, ignore metamodels in the XKT
|
|
29928
29929
|
var i=0;var _loadNext2=function loadNext(){if(sceneModel.destroyed){done();}else if(i>=xktFiles.length){done();}else{_this189._dataSource.getXKT("".concat(baseDir).concat(xktFiles[i]),function(arrayBuffer){_this189._parseModel(arrayBuffer,options,sceneModel,null/* Ignore metamodel in XKT */,manifestCtx);sceneModel.preFinalize();i++;_this189.scheduleTask(_loadNext2,200);},error);}};_loadNext2();};var loadXKTs_includeTheirMetaModels=function loadXKTs_includeTheirMetaModels(xktFiles,done,error){// Load XKTs, parse metamodels from the XKT
|
|
@@ -31120,7 +31121,7 @@ var mapping=buildMaterialMapping(materialIds);// Create sub-geometry per materia
|
|
|
31120
31121
|
var subGeoms=new Map();for(var _i394=0,_Object$entries6=Object.entries(mapping);_i394<_Object$entries6.length;_i394++){var _Object$entries6$_i=_slicedToArray(_Object$entries6[_i394],2),matIndexStr=_Object$entries6$_i[0],faceList=_Object$entries6$_i[1];if(!faceList||faceList.length===0){continue;}// xeokit auto-generates normals on the GPU side
|
|
31121
31122
|
var positions=new Float32Array(obj.geometry.verts.toJs());var edgeIndices=new Uint32Array(obj.geometry.edges.toJs());var faces=new Uint32Array(obj.geometry.faces.toJs());var matIndex=Number(matIndexStr);var indices=buildIndicesForFaces(faceList,faces);var sceneGeometryId=makeSubGeometryId(geometry_id,matIndex);// deterministic
|
|
31122
31123
|
sceneModel.createGeometry({id:sceneGeometryId,primitive:"triangles",positions:positions,indices:indices,edgeIndices:edgeIndices});subGeoms.set(matIndex,sceneGeometryId);}geometryCache.set(geometry_id,{subGeoms:subGeoms,materials:materials,// store mapping as Map<number, Uint32Array> to avoid recomputing
|
|
31123
|
-
mapping:new Map(Object.entries(mapping).map(function(
|
|
31124
|
+
mapping:new Map(Object.entries(mapping).map(function(_ref25){var _ref26=_slicedToArray(_ref25,2),k=_ref26[0],v=_ref26[1];return[Number(k),new Uint32Array(v)];}))});}// Reuse cached sub-geometries to create per-object meshes
|
|
31124
31125
|
var cached=geometryCache.get(geometry_id);var meshIds=[];var _iterator58=_createForOfIteratorHelper(cached.subGeoms.entries()),_step58;try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){var _step58$value=_slicedToArray(_step58.value,2),_matIndex=_step58$value[0],_sceneGeometryId=_step58$value[1];var material=cached.materials[_matIndex]||{diffuse:[0.6,0.6,0.6],transparency:0.0};var meshId=generateUUID();var diffuse=material.diffuse;sceneModel.createMesh({id:meshId,geometryId:_sceneGeometryId,origin:origin,matrix:matrix,color:[diffuse[0],diffuse[1],diffuse[2]],opacity:1.0-material.transparency});meshIds.push(meshId);}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}sceneModel.createEntity({id:ctx.globalizeObjectIds?math.globalizeObjectId(ctx.sceneModel.id,ifcEntity.GlobalId):ifcEntity.GlobalId,isObject:true,meshIds:meshIds});}},{key:"_loadIFCMetaModel",value:function _loadIFCMetaModel(ctx,ifc){var _projects2$destroy;var visited=new Set();var metaObjects=[];var propertySets=[];// ---- helpers -----------------------------------------------------------
|
|
31125
31126
|
var toStr=function toStr(v){return v===undefined||v===null?"":String(v);};function getGlobalId(entity){try{return String(entity.GlobalId);}catch(_unused2){return null;}}function addNode(entity,parent){var id=getGlobalId(entity);if(!id||visited.has(id))return false;visited.add(id);var globalizeObjectIds=ctx.globalizeObjectIds;var modelId=ctx.sceneModel.id;var propertySetIds=[];if(ctx.loadMetadataPropertySets){// Try all possible association fields
|
|
31126
31127
|
var associationFields=["HasAssociations","IsDefinedBy","IsDecomposedBy","ContainsElements"];for(var _i395=0,_associationFields=associationFields;_i395<_associationFields.length;_i395++){var field=_associationFields[_i395];var associations=entity[field];if(associations&&associations.length>0){var _associations$destroy;for(var j=0;j<associations.length;j++){var rel=associations.get(j);if(rel.is_a&&rel.is_a()==="IfcRelDefinesByProperties"){var _rel$destroy;var propSet=rel.RelatingPropertyDefinition;if(propSet&&propSet.is_a){// Accept both IfcPropertySet and IfcElementQuantity
|
|
@@ -31166,7 +31167,7 @@ var headerBlockItems=[{item:'FileSignature',format:'char',size:4},{item:'FileSou
|
|
|
31166
31167
|
* @private
|
|
31167
31168
|
* @param arrayBuffer
|
|
31168
31169
|
* @returns {{}}
|
|
31169
|
-
*/var loadLASHeader=function loadLASHeader(arrayBuffer){var currentByte=0;var numOfVarLenRecords=0;var projectionStart=0;var dataView=new DataView(arrayBuffer);var buffer=new Uint8Array(6000);var getGeoKeys=function getGeoKeys(geoRecord){if(geoRecord===undefined){return undefined;}var projectionEnd=projectionStart+geoRecord["RecordLengthAfterHeader"];var geoTag=buffer.slice(projectionStart,projectionEnd);var arrayBuffer=bufferFlipper(geoTag);var dataView=new DataView(arrayBuffer);var byteCount=6;var numberOfKeys=Number(dataView.getUint16(byteCount,true));var geoKeys=[];while(numberOfKeys--){var keyTmp={};keyTmp.key=dataView.getUint16(byteCount+=2,true);keyTmp.tiffTagLocation=dataView.getUint16(byteCount+=2,true);keyTmp.count=dataView.getUint16(byteCount+=2,true);keyTmp.valueOffset=dataView.getUint16(byteCount+=2,true);geoKeys.push(keyTmp);}var projRecord=geoKeys.find(function(x){return x.key===3072;});if(projRecord&&projRecord.hasOwnProperty('valueOffset')){var epsg=projRecord.valueOffset;{return epsg;}}return undefined;};var getValue=function getValue(
|
|
31170
|
+
*/var loadLASHeader=function loadLASHeader(arrayBuffer){var currentByte=0;var numOfVarLenRecords=0;var projectionStart=0;var dataView=new DataView(arrayBuffer);var buffer=new Uint8Array(6000);var getGeoKeys=function getGeoKeys(geoRecord){if(geoRecord===undefined){return undefined;}var projectionEnd=projectionStart+geoRecord["RecordLengthAfterHeader"];var geoTag=buffer.slice(projectionStart,projectionEnd);var arrayBuffer=bufferFlipper(geoTag);var dataView=new DataView(arrayBuffer);var byteCount=6;var numberOfKeys=Number(dataView.getUint16(byteCount,true));var geoKeys=[];while(numberOfKeys--){var keyTmp={};keyTmp.key=dataView.getUint16(byteCount+=2,true);keyTmp.tiffTagLocation=dataView.getUint16(byteCount+=2,true);keyTmp.count=dataView.getUint16(byteCount+=2,true);keyTmp.valueOffset=dataView.getUint16(byteCount+=2,true);geoKeys.push(keyTmp);}var projRecord=geoKeys.find(function(x){return x.key===3072;});if(projRecord&&projRecord.hasOwnProperty('valueOffset')){var epsg=projRecord.valueOffset;{return epsg;}}return undefined;};var getValue=function getValue(_ref27){var item=_ref27.item,format=_ref27.format,size=_ref27.size;var str,array;switch(format){case'char':array=new Uint8Array(arrayBuffer,currentByte,size);currentByte+=size;str=uint8arrayToString(array);return[item,str];case'uShort':str=dataView.getUint16(currentByte,true);currentByte+=size;return[item,str];case'uLong':str=dataView.getUint32(currentByte,true);if(item==='NumberOfVariableLengthRecords'){numOfVarLenRecords=str;}currentByte+=size;return[item,str];case'uChar':str=dataView.getUint8(currentByte);currentByte+=size;return[item,str];case'double':str=dataView.getFloat64(currentByte,true);currentByte+=size;return[item,str];default:currentByte+=size;}};var getValues=function getValues(){var publicHeaderBlock={};headerBlockItems.forEach(function(obj){var myObj=getValue(_objectSpread({},obj));if(myObj!==undefined){if(myObj[0]==='FileSignature'&&myObj[1]!=='LASF'){throw new Error('Ivalid FileSignature. Is this a LAS/LAZ file');}publicHeaderBlock[myObj[0]]=myObj[1];}});var variableRecords=[];var variableLengthRecords=numOfVarLenRecords;var _loop14=function _loop14(){var variableObj={};variableLengthRecord.forEach(function(obj){var myObj=getValue(_objectSpread({},obj));variableObj[myObj[0]]=myObj[1];if(myObj[0]==='UserId'&&myObj[1]==='LASF_Projection'){projectionStart=currentByte-18+54;}});variableRecords.push(variableObj);};while(variableLengthRecords--){_loop14();}var geoRecord=variableRecords.find(function(x){return x.UserId==='LASF_Projection';});var epsg=getGeoKeys(geoRecord);if(epsg){publicHeaderBlock['epsg']=epsg;}return publicHeaderBlock;};return getValues();};var bufferFlipper=function bufferFlipper(buf){var ab=new ArrayBuffer(buf.length);var view=new Uint8Array(ab);for(var _i401=0;_i401<buf.length;++_i401){view[_i401]=buf[_i401];}return ab;};var uint8arrayToString=function uint8arrayToString(array){var str='';array.forEach(function(item){var c=String.fromCharCode(item);if(c!=="\0"){str+=c;}});return str.trim();};var MAX_VERTICES=500000;// TODO: Rough estimate
|
|
31170
31171
|
/**
|
|
31171
31172
|
* {@link Viewer} plugin that loads lidar point cloud geometry from LAS files.
|
|
31172
31173
|
*
|
|
@@ -31949,8 +31950,8 @@ sceneModel.fire("loaded",true,false);// Don't forget the event, for late subscri
|
|
|
31949
31950
|
});};if(params.src){var src=params.src;this.viewer.scene.canvas.spinner.processes++;this._dataSource.getDotBIM(src,function(fileData){// OK
|
|
31950
31951
|
var ctx={fileData:fileData,sceneModel:sceneModel,nextId:0,error:function error(errMsg){}};parseDotBIM(ctx);_this206.viewer.scene.canvas.spinner.processes--;},function(err){_this206.viewer.scene.canvas.spinner.processes--;_this206.error(err);});}else if(params.dotBIM){var ctx={fileData:params.dotBIM,sceneModel:sceneModel,nextId:0,error:function error(errMsg){}};parseDotBIM(ctx);}sceneModel.once("destroyed",function(){_this206.viewer.metaScene.destroyMetaModel(modelId);});return sceneModel;}/**
|
|
31951
31952
|
* Destroys this DotBIMLoaderPlugin.
|
|
31952
|
-
*/},{key:"destroy",value:function destroy(){_superPropGet(DotBIMLoaderPlugin,"destroy",this,3)([]);}}]);}(Plugin);var hex2rgb=function hex2rgb(color){var rgb=function rgb(idx){return parseInt(color.substr(idx+1,2),16)/255;};return[rgb(0),rgb(2),rgb(4)];};var basePolygon3D=function basePolygon3D(scene,color,alpha){var mesh=null;var updateBase=function updateBase(points){if(points){if(mesh){mesh.destroy();}try{var
|
|
31953
|
-
var ind=(
|
|
31953
|
+
*/},{key:"destroy",value:function destroy(){_superPropGet(DotBIMLoaderPlugin,"destroy",this,3)([]);}}]);}(Plugin);var hex2rgb=function hex2rgb(color){var rgb=function rgb(idx){return parseInt(color.substr(idx+1,2),16)/255;};return[rgb(0),rgb(2),rgb(4)];};var basePolygon3D=function basePolygon3D(scene,color,alpha){var mesh=null;var updateBase=function updateBase(points){if(points){if(mesh){mesh.destroy();}try{var _ref28,_ref29;var _triangulateEarClippi3=triangulateEarClipping(points.map(function(p){return[p[0],p[2]];})),_triangulateEarClippi4=_slicedToArray(_triangulateEarClippi3,2),baseVertices=_triangulateEarClippi4[0],baseTriangles=_triangulateEarClippi4[1];var positions=(_ref28=[]).concat.apply(_ref28,_toConsumableArray(baseVertices.map(function(p){return[p[0],points[0][1],p[1]];})));// To convert from Float64Array into an Array
|
|
31954
|
+
var ind=(_ref29=[]).concat.apply(_ref29,_toConsumableArray(baseTriangles));mesh=new Mesh(scene,{pickable:false,// otherwise there's a WebGL error inside PickMeshRenderer.prototype.drawMesh
|
|
31954
31955
|
geometry:new ReadableGeometry(scene,{positions:positions,indices:ind,normals:math.buildNormals(positions,ind)}),material:new PhongMaterial(scene,{alpha:alpha!==undefined?alpha:0.5,backfaces:true,diffuse:hex2rgb(color)})});}catch(e){mesh=null;}}if(mesh){mesh.visible=!!points;}};updateBase(null);return{updateBase:updateBase,destroy:function destroy(){return mesh&&mesh.destroy();}};};var startAARectCreateUI=function startAARectCreateUI(scene,markersColor,pointerLens,select3dPoint,withPoints,onPointsSelected){var marker1=marker3D(scene,markersColor);var marker2=marker3D(scene,markersColor);var updatePointerLens=pointerLens?function(canvasPos){pointerLens.visible=!!canvasPos;if(canvasPos){pointerLens.canvasPos=canvasPos;}}:function(){};var deactivatePointSelection=select3dPoint(function(){updatePointerLens(null);marker1.update(null);},function(canvasPos,worldPos){updatePointerLens(canvasPos);marker1.update(worldPos);},function(point1CanvasPos,point1WorldPos){marker1.update(point1WorldPos);deactivatePointSelection=select3dPoint(function(){updatePointerLens(null);marker2.update(null);withPoints(null);},function(canvasPos,point2WorldPos){updatePointerLens(canvasPos);marker2.update(point2WorldPos);withPoints(math.distVec3(point1WorldPos,point2WorldPos)>0.01&&[point1WorldPos,point2WorldPos]);},function(point2CanvasPos,point2WorldPos){// `marker2.update' makes sure marker's position has been updated from its default [0,0,0]
|
|
31955
31956
|
// This works around an unidentified bug somewhere around OcclusionLayer, that causes error
|
|
31956
31957
|
// [.WebGL-0x13400c47e00] GL_INVALID_OPERATION: Vertex buffer is not big enough for the draw call
|
|
@@ -31963,11 +31964,11 @@ marker2.update(point2WorldPos);marker1.destroy();marker2.destroy();updatePointer
|
|
|
31963
31964
|
*/function Zone(plugin){var _this207;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Zone);_this207=_callSuper(this,Zone,[plugin.viewer.scene,cfg]);/**
|
|
31964
31965
|
* The {@link ZonesPlugin} that owns this Zone.
|
|
31965
31966
|
* @type {ZonesPlugin}
|
|
31966
|
-
*/_this207.plugin=plugin;_this207._container=cfg.container;if(!_this207._container){throw"config missing: container";}_this207._eventSubs={};_this207.plugin.viewer.scene;_this207._geometry=cfg.geometry;cfg.onMouseOver?function(event){cfg.onMouseOver(event,_this207);_this207.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mouseover',event));}:null;cfg.onMouseLeave?function(event){cfg.onMouseLeave(event,_this207);_this207.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mouseleave',event));}:null;cfg.onContextMenu?function(event){cfg.onContextMenu(event,_this207);}:null;_this207._alpha="alpha"in cfg&&cfg.alpha!==undefined?cfg.alpha:0.5;_this207.color=cfg.color;_this207._visible=true;_this207._rebuildMesh();return _this207;}_inherits(Zone,_Component39);return _createClass(Zone,[{key:"_rebuildMesh",value:function _rebuildMesh(){var
|
|
31967
|
+
*/_this207.plugin=plugin;_this207._container=cfg.container;if(!_this207._container){throw"config missing: container";}_this207._eventSubs={};_this207.plugin.viewer.scene;_this207._geometry=cfg.geometry;cfg.onMouseOver?function(event){cfg.onMouseOver(event,_this207);_this207.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mouseover',event));}:null;cfg.onMouseLeave?function(event){cfg.onMouseLeave(event,_this207);_this207.plugin.viewer.scene.canvas.canvas.dispatchEvent(new MouseEvent('mouseleave',event));}:null;cfg.onContextMenu?function(event){cfg.onContextMenu(event,_this207);}:null;_this207._alpha="alpha"in cfg&&cfg.alpha!==undefined?cfg.alpha:0.5;_this207.color=cfg.color;_this207._visible=true;_this207._rebuildMesh();return _this207;}_inherits(Zone,_Component39);return _createClass(Zone,[{key:"_rebuildMesh",value:function _rebuildMesh(){var _ref30,_this208=this;var scene=this.plugin.viewer.scene;var planeCoords=this._geometry.planeCoordinates.slice();var downward=this._geometry.height<0;var altitude=this._geometry.altitude+(downward?this._geometry.height:0);var height=this._geometry.height*(downward?-1:1);var _triangulateEarClippi5=triangulateEarClipping(planeCoords),_triangulateEarClippi6=_slicedToArray(_triangulateEarClippi5,3),baseVertices=_triangulateEarClippi6[0],baseTriangles=_triangulateEarClippi6[1],isCCW=_triangulateEarClippi6[2];// TODO: prevent crossing edges
|
|
31967
31968
|
var pos=[];var ind=[];var addPlane=function addPlane(isCeiling){var baseIdx=pos.length;var _iterator60=_createForOfIteratorHelper(baseVertices),_step60;try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){var c=_step60.value;pos.push([c[0],altitude+(isCeiling?height:0),c[1]]);}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}var _iterator61=_createForOfIteratorHelper(baseTriangles),_step61;try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){var t=_step61.value;ind.push.apply(ind,_toConsumableArray((isCeiling?t:t.slice(0).reverse()).map(function(i){return i+baseIdx;})));}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}};addPlane(false);// floor
|
|
31968
31969
|
addPlane(true);// ceiling
|
|
31969
31970
|
// sides
|
|
31970
|
-
var _loop16=function _loop16(){var a=baseVertices[_i422];var b=baseVertices[(baseVertices.length+_i422+(isCCW?1:-1))%baseVertices.length];var f=altitude;var c=altitude+height;var baseIdx=pos.length;pos.push([a[0],f,a[1]],[b[0],f,b[1]],[b[0],c,b[1]],[a[0],c,a[1]]);ind.push.apply(ind,_toConsumableArray([0,1,2,0,2,3].map(function(i){return i+baseIdx;})));};for(var _i422=0;_i422<baseVertices.length;++_i422){_loop16();}if(this._zoneMesh){this._zoneMesh.destroy();}var min=function min(idx){return Math.min.apply(Math,_toConsumableArray(pos.map(function(p){return p[idx];})));};var max=function max(idx){return Math.max.apply(Math,_toConsumableArray(pos.map(function(p){return p[idx];})));};var xmin=min(0);var ymin=min(1);var zmin=min(2);var xmax=max(0);var ymax=max(1);var zmax=max(2);this._center=math.vec3([(xmin+xmax)/2,(ymin+ymax)/2,(zmin+zmax)/2]);var positions=(
|
|
31971
|
+
var _loop16=function _loop16(){var a=baseVertices[_i422];var b=baseVertices[(baseVertices.length+_i422+(isCCW?1:-1))%baseVertices.length];var f=altitude;var c=altitude+height;var baseIdx=pos.length;pos.push([a[0],f,a[1]],[b[0],f,b[1]],[b[0],c,b[1]],[a[0],c,a[1]]);ind.push.apply(ind,_toConsumableArray([0,1,2,0,2,3].map(function(i){return i+baseIdx;})));};for(var _i422=0;_i422<baseVertices.length;++_i422){_loop16();}if(this._zoneMesh){this._zoneMesh.destroy();}var min=function min(idx){return Math.min.apply(Math,_toConsumableArray(pos.map(function(p){return p[idx];})));};var max=function max(idx){return Math.max.apply(Math,_toConsumableArray(pos.map(function(p){return p[idx];})));};var xmin=min(0);var ymin=min(1);var zmin=min(2);var xmax=max(0);var ymax=max(1);var zmax=max(2);this._center=math.vec3([(xmin+xmax)/2,(ymin+ymax)/2,(zmin+zmax)/2]);var positions=(_ref30=[]).concat.apply(_ref30,_toConsumableArray(pos.map(function(p){return math.subVec3(p,_this208._center,p);})));this._zoneMesh=new Mesh(scene,{origin:this._center,edges:this._edges,geometry:new ReadableGeometry(scene,{positions:positions,indices:ind,normals:math.buildNormals(positions,ind)}),material:new PhongMaterial(scene,{alpha:this._alpha,backfaces:true,diffuse:hex2rgb(this._color)}),visible:this._visible});this._zoneMesh.highlighted=this._highlighted;this._zoneMesh.zone=this;{var _u2=math.vec2();var v=math.vec2();var baseArea=0;var _iterator62=_createForOfIteratorHelper(baseTriangles),_step62;try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){var t=_step62.value;var p0=baseVertices[t[0]];var p1=baseVertices[t[1]];var p2=baseVertices[t[2]];math.subVec2(p1,p0,_u2);math.subVec2(p2,p0,v);baseArea+=Math.abs(_u2[0]*v[1]-_u2[1]*v[0]);}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}this._baseArea=baseArea/2;}this._metrics=null;}},{key:"baseArea",get:function get(){return this._baseArea;}},{key:"area",get:function get(){return this._getMetrics().area;}},{key:"volume",get:function get(){return this._getMetrics().volume;}},{key:"_getMetrics",value:function _getMetrics(){if(this._metrics===null){// Sum the volume of tetrahedrons formed by the origin and face triangles
|
|
31971
31972
|
var volume=0;var _area4=0;var geo=this._zoneMesh.geometry;var pts=[math.vec3(),math.vec3(),math.vec3()];var tmpVec3=math.vec3();for(var _i423=0;_i423<geo.indices.length;_i423+=3){for(var off=0;off<3;++off){var _p7=pts[off];var pIdx=3*geo.indices[_i423+off];for(var c=0;c<3;++c){_p7[c]=geo.positions[pIdx+c];}}volume+=math.dotVec3(pts[0],math.cross3Vec3(pts[1],pts[2],tmpVec3));math.subVec3(pts[1],pts[0],pts[1]);math.subVec3(pts[2],pts[0],pts[2]);_area4+=math.lenVec3(math.cross3Vec3(pts[1],pts[2],tmpVec3));}this._metrics={area:_area4/2,volume:volume/6};}return this._metrics;}},{key:"sectionedAverage",value:function sectionedAverage(sectionPlanes){var planeCoords=this._geometry.planeCoordinates.slice();var faces=[];{var h=this._geometry.height;var _a10=this._geometry.altitude;var c=_a10+Math.max(0,h);var _f2=_a10+Math.min(0,h);var addPlane=function addPlane(isCeiling){var face=planeCoords.map(function(p){return[p[0],isCeiling?c:_f2,p[1]];});faces.push(isCeiling?face:face.slice(0).reverse());};addPlane(true);// ceiling
|
|
31972
31973
|
addPlane(false);// floor
|
|
31973
31974
|
// sides
|