@xeokit/xeokit-sdk 2.6.103 → 2.6.105
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 +50 -8
- package/dist/xeokit-sdk.es.js +50 -8
- package/dist/xeokit-sdk.es5.js +9 -8
- package/dist/xeokit-sdk.min.cjs.js +6 -6
- package/dist/xeokit-sdk.min.es.js +6 -6
- package/dist/xeokit-sdk.min.es5.js +5 -5
- package/package.json +7 -6
- package/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +1 -0
- package/src/plugins/GLTFLoaderPlugin/GLTFSceneModelLoader.js +45 -4
- package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.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-01-
|
|
2
|
+
* xeokit-sdk v2.6.105
|
|
3
|
+
* Commit: a7773e7668edb2daae03f66d0ce50714c895c486
|
|
4
|
+
* Built: 2026-01-29T10:29:08.631Z
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
if (typeof window !== 'undefined') {
|
|
8
|
-
window.__XEOKIT__ = { version: '2.6.
|
|
8
|
+
window.__XEOKIT__ = { version: '2.6.105', commit: 'a7773e7668edb2daae03f66d0ce50714c895c486', built: '2026-01-29T10:29:08.631Z' };
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
@@ -111609,6 +111609,7 @@ function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok, er
|
|
|
111609
111609
|
numObjects: 0,
|
|
111610
111610
|
nodes: [],
|
|
111611
111611
|
nextId: 0,
|
|
111612
|
+
entityPerMesh: options.entityPerMesh,
|
|
111612
111613
|
log: (msg) => {
|
|
111613
111614
|
plugin.log(msg);
|
|
111614
111615
|
}
|
|
@@ -111896,6 +111897,49 @@ function loadDefaultScene(ctx) {
|
|
|
111896
111897
|
});
|
|
111897
111898
|
})(nodes);
|
|
111898
111899
|
|
|
111900
|
+
if (ctx.entityPerMesh) {
|
|
111901
|
+
const sceneIds = new Set();
|
|
111902
|
+
(function createSceneMeshesAndEntities(nodes, parentId, parentMatrix, dep) {
|
|
111903
|
+
return nodes.reduce(
|
|
111904
|
+
(hadMesh, node) => {
|
|
111905
|
+
const baseId = node.name ?? "Node";
|
|
111906
|
+
const maybeGlobalize = id => ctx.globalizeObjectIds ? math.globalizeObjectId(ctx.sceneModel.id, id) : id;
|
|
111907
|
+
let entityId = maybeGlobalize(baseId);
|
|
111908
|
+
let nextPostfixId = 1;
|
|
111909
|
+
while (ctx.sceneModel.objects[entityId] || sceneIds.has(entityId)) {
|
|
111910
|
+
entityId = maybeGlobalize(`${baseId}.${(nextPostfixId++).toString().padStart(4, "0")}`);
|
|
111911
|
+
}
|
|
111912
|
+
sceneIds.add(entityId);
|
|
111913
|
+
const matrix = parseNodeMatrix(node, parentMatrix);
|
|
111914
|
+
|
|
111915
|
+
const meshEntity = node.mesh && (function() {
|
|
111916
|
+
const meshIds = [ ];
|
|
111917
|
+
parseNodeMesh(node, ctx, matrix, meshIds);
|
|
111918
|
+
return (meshIds.length > 0) && ctx.sceneModel.createEntity({
|
|
111919
|
+
id: entityId,
|
|
111920
|
+
meshIds: meshIds,
|
|
111921
|
+
isObject: true
|
|
111922
|
+
});
|
|
111923
|
+
})();
|
|
111924
|
+
|
|
111925
|
+
const hasMesh = (node.children && createSceneMeshesAndEntities(node.children, entityId, matrix)) || meshEntity;
|
|
111926
|
+
|
|
111927
|
+
if (hasMesh && ctx.autoMetaModel) {
|
|
111928
|
+
ctx.metaObjects.push({
|
|
111929
|
+
id: entityId,
|
|
111930
|
+
name: entityId,
|
|
111931
|
+
type: "Default",
|
|
111932
|
+
parent: parentId
|
|
111933
|
+
});
|
|
111934
|
+
}
|
|
111935
|
+
|
|
111936
|
+
return hadMesh || hasMesh;
|
|
111937
|
+
},
|
|
111938
|
+
false);
|
|
111939
|
+
})(nodes, ctx.sceneModel.id, null);
|
|
111940
|
+
return;
|
|
111941
|
+
}
|
|
111942
|
+
|
|
111899
111943
|
// Create a SceneMesh for each mesh primitive, and a SceneModelEntity for the root node and each named node.
|
|
111900
111944
|
const meshIdsStack = [];
|
|
111901
111945
|
let meshIds = null;
|
|
@@ -111937,7 +111981,7 @@ function loadDefaultScene(ctx) {
|
|
|
111937
111981
|
ctx.metaObjects.push({
|
|
111938
111982
|
id: entityId,
|
|
111939
111983
|
type: "Default",
|
|
111940
|
-
name:
|
|
111984
|
+
name: nodeName ? nodeName : "Node",
|
|
111941
111985
|
parent: ctx.sceneModel.id
|
|
111942
111986
|
});
|
|
111943
111987
|
}
|
|
@@ -112008,9 +112052,6 @@ function parseNodeMesh(node, ctx, matrix, meshIds) {
|
|
|
112008
112052
|
if (numPrimitives > 0) {
|
|
112009
112053
|
for (let i = 0; i < numPrimitives; i++) {
|
|
112010
112054
|
const primitive = mesh.primitives[i];
|
|
112011
|
-
if (primitive.mode < 4) {
|
|
112012
|
-
continue;
|
|
112013
|
-
}
|
|
112014
112055
|
const meshCfg = {
|
|
112015
112056
|
id: ctx.sceneModel.id + "." + ctx.numObjects++
|
|
112016
112057
|
};
|
|
@@ -112420,6 +112461,7 @@ class GLTFLoaderPlugin extends Plugin {
|
|
|
112420
112461
|
* @param {Boolean} [params.autoMetaModel] When supplied, creates a default MetaModel with a single MetaObject.
|
|
112421
112462
|
* @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models.
|
|
112422
112463
|
* @param {*} [params.parseOptions={}] Options to pass to loaders.gl parse method, eg. ````{ gltf: { excludeExtensions: { "KHR_texture_transform": false } } }````.
|
|
112464
|
+
* @param {Boolean} [params.entityPerMesh=false] Create an entity for each mesh, instead of grouping leaf meshes under their common entity.
|
|
112423
112465
|
* @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}
|
|
112424
112466
|
*/
|
|
112425
112467
|
load(params = {}) {
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* xeokit-sdk v2.6.
|
|
3
|
-
* Commit:
|
|
4
|
-
* Built: 2026-01-
|
|
2
|
+
* xeokit-sdk v2.6.105
|
|
3
|
+
* Commit: a7773e7668edb2daae03f66d0ce50714c895c486
|
|
4
|
+
* Built: 2026-01-29T10:29:08.631Z
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
if (typeof window !== 'undefined') {
|
|
8
|
-
window.__XEOKIT__ = { version: '2.6.
|
|
8
|
+
window.__XEOKIT__ = { version: '2.6.105', commit: 'a7773e7668edb2daae03f66d0ce50714c895c486', built: '2026-01-29T10:29:08.631Z' };
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/** @private */
|
|
@@ -111605,6 +111605,7 @@ function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok, er
|
|
|
111605
111605
|
numObjects: 0,
|
|
111606
111606
|
nodes: [],
|
|
111607
111607
|
nextId: 0,
|
|
111608
|
+
entityPerMesh: options.entityPerMesh,
|
|
111608
111609
|
log: (msg) => {
|
|
111609
111610
|
plugin.log(msg);
|
|
111610
111611
|
}
|
|
@@ -111892,6 +111893,49 @@ function loadDefaultScene(ctx) {
|
|
|
111892
111893
|
});
|
|
111893
111894
|
})(nodes);
|
|
111894
111895
|
|
|
111896
|
+
if (ctx.entityPerMesh) {
|
|
111897
|
+
const sceneIds = new Set();
|
|
111898
|
+
(function createSceneMeshesAndEntities(nodes, parentId, parentMatrix, dep) {
|
|
111899
|
+
return nodes.reduce(
|
|
111900
|
+
(hadMesh, node) => {
|
|
111901
|
+
const baseId = node.name ?? "Node";
|
|
111902
|
+
const maybeGlobalize = id => ctx.globalizeObjectIds ? math.globalizeObjectId(ctx.sceneModel.id, id) : id;
|
|
111903
|
+
let entityId = maybeGlobalize(baseId);
|
|
111904
|
+
let nextPostfixId = 1;
|
|
111905
|
+
while (ctx.sceneModel.objects[entityId] || sceneIds.has(entityId)) {
|
|
111906
|
+
entityId = maybeGlobalize(`${baseId}.${(nextPostfixId++).toString().padStart(4, "0")}`);
|
|
111907
|
+
}
|
|
111908
|
+
sceneIds.add(entityId);
|
|
111909
|
+
const matrix = parseNodeMatrix(node, parentMatrix);
|
|
111910
|
+
|
|
111911
|
+
const meshEntity = node.mesh && (function() {
|
|
111912
|
+
const meshIds = [ ];
|
|
111913
|
+
parseNodeMesh(node, ctx, matrix, meshIds);
|
|
111914
|
+
return (meshIds.length > 0) && ctx.sceneModel.createEntity({
|
|
111915
|
+
id: entityId,
|
|
111916
|
+
meshIds: meshIds,
|
|
111917
|
+
isObject: true
|
|
111918
|
+
});
|
|
111919
|
+
})();
|
|
111920
|
+
|
|
111921
|
+
const hasMesh = (node.children && createSceneMeshesAndEntities(node.children, entityId, matrix)) || meshEntity;
|
|
111922
|
+
|
|
111923
|
+
if (hasMesh && ctx.autoMetaModel) {
|
|
111924
|
+
ctx.metaObjects.push({
|
|
111925
|
+
id: entityId,
|
|
111926
|
+
name: entityId,
|
|
111927
|
+
type: "Default",
|
|
111928
|
+
parent: parentId
|
|
111929
|
+
});
|
|
111930
|
+
}
|
|
111931
|
+
|
|
111932
|
+
return hadMesh || hasMesh;
|
|
111933
|
+
},
|
|
111934
|
+
false);
|
|
111935
|
+
})(nodes, ctx.sceneModel.id, null);
|
|
111936
|
+
return;
|
|
111937
|
+
}
|
|
111938
|
+
|
|
111895
111939
|
// Create a SceneMesh for each mesh primitive, and a SceneModelEntity for the root node and each named node.
|
|
111896
111940
|
const meshIdsStack = [];
|
|
111897
111941
|
let meshIds = null;
|
|
@@ -111933,7 +111977,7 @@ function loadDefaultScene(ctx) {
|
|
|
111933
111977
|
ctx.metaObjects.push({
|
|
111934
111978
|
id: entityId,
|
|
111935
111979
|
type: "Default",
|
|
111936
|
-
name:
|
|
111980
|
+
name: nodeName ? nodeName : "Node",
|
|
111937
111981
|
parent: ctx.sceneModel.id
|
|
111938
111982
|
});
|
|
111939
111983
|
}
|
|
@@ -112004,9 +112048,6 @@ function parseNodeMesh(node, ctx, matrix, meshIds) {
|
|
|
112004
112048
|
if (numPrimitives > 0) {
|
|
112005
112049
|
for (let i = 0; i < numPrimitives; i++) {
|
|
112006
112050
|
const primitive = mesh.primitives[i];
|
|
112007
|
-
if (primitive.mode < 4) {
|
|
112008
|
-
continue;
|
|
112009
|
-
}
|
|
112010
112051
|
const meshCfg = {
|
|
112011
112052
|
id: ctx.sceneModel.id + "." + ctx.numObjects++
|
|
112012
112053
|
};
|
|
@@ -112416,6 +112457,7 @@ class GLTFLoaderPlugin extends Plugin {
|
|
|
112416
112457
|
* @param {Boolean} [params.autoMetaModel] When supplied, creates a default MetaModel with a single MetaObject.
|
|
112417
112458
|
* @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models.
|
|
112418
112459
|
* @param {*} [params.parseOptions={}] Options to pass to loaders.gl parse method, eg. ````{ gltf: { excludeExtensions: { "KHR_texture_transform": false } } }````.
|
|
112460
|
+
* @param {Boolean} [params.entityPerMesh=false] Create an entity for each mesh, instead of grouping leaf meshes under their common entity.
|
|
112419
112461
|
* @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}
|
|
112420
112462
|
*/
|
|
112421
112463
|
load(params = {}) {
|
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* xeokit-sdk v2.6.
|
|
3
|
-
* Commit:
|
|
4
|
-
* Built: 2026-01-
|
|
2
|
+
* xeokit-sdk v2.6.105
|
|
3
|
+
* Commit: a7773e7668edb2daae03f66d0ce50714c895c486
|
|
4
|
+
* Built: 2026-01-29T10:29:08.631Z
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
var _globalThis$loaders3,_DRACO_EXTERNAL_LIBRA,_DEFAULT_SAMPLER_PARA;var _marked=/*#__PURE__*/_regeneratorRuntime().mark(makeStringIterator),_marked2=/*#__PURE__*/_regeneratorRuntime().mark(makeArrayBufferIterator),_marked3=/*#__PURE__*/_regeneratorRuntime().mark(makeMeshPrimitiveIterator);function _wrapNativeSuper(Class){var _cache=typeof Map==="function"?new Map():undefined;_wrapNativeSuper=function _wrapNativeSuper(Class){if(Class===null||!_isNativeFunction(Class))return Class;if(typeof Class!=="function"){throw new TypeError("Super expression must either be null or a function");}if(typeof _cache!=="undefined"){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper);}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor);}Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,Class);};return _wrapNativeSuper(Class);}function _construct(Parent,args,Class){if(_isNativeReflectConstruct()){_construct=Reflect.construct.bind();}else{_construct=function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var Constructor=Function.bind.apply(Parent,a);var instance=new Constructor();if(Class)_setPrototypeOf(instance,Class.prototype);return instance;};}return _construct.apply(null,arguments);}function _isNativeFunction(fn){return Function.toString.call(fn).indexOf("[native code]")!==-1;}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(_e14){throw _e14;},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(_e15){didErr=true;err=_e15;},f:function f(){try{if(!normalCompletion&&it["return"]!=null)it["return"]();}finally{if(didErr)throw err;}}};}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){_defineProperty(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 _defineProperty(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 _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 _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 _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 _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 _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 _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 _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 _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);}if(typeof window!=='undefined'){window.__XEOKIT__={version:'2.6.103',commit:'04beebb6bc2ab830039ad23e343432aae980ecf7',built:'2026-01-08T15:10:53.564Z'};}/** @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,_DRACO_EXTERNAL_LIBRA,_DEFAULT_SAMPLER_PARA;var _marked=/*#__PURE__*/_regeneratorRuntime().mark(makeStringIterator),_marked2=/*#__PURE__*/_regeneratorRuntime().mark(makeArrayBufferIterator),_marked3=/*#__PURE__*/_regeneratorRuntime().mark(makeMeshPrimitiveIterator);function _wrapNativeSuper(Class){var _cache=typeof Map==="function"?new Map():undefined;_wrapNativeSuper=function _wrapNativeSuper(Class){if(Class===null||!_isNativeFunction(Class))return Class;if(typeof Class!=="function"){throw new TypeError("Super expression must either be null or a function");}if(typeof _cache!=="undefined"){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper);}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor);}Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,Class);};return _wrapNativeSuper(Class);}function _construct(Parent,args,Class){if(_isNativeReflectConstruct()){_construct=Reflect.construct.bind();}else{_construct=function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var Constructor=Function.bind.apply(Parent,a);var instance=new Constructor();if(Class)_setPrototypeOf(instance,Class.prototype);return instance;};}return _construct.apply(null,arguments);}function _isNativeFunction(fn){return Function.toString.call(fn).indexOf("[native code]")!==-1;}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(_e14){throw _e14;},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(_e15){didErr=true;err=_e15;},f:function f(){try{if(!normalCompletion&&it["return"]!=null)it["return"]();}finally{if(didErr)throw err;}}};}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){_defineProperty(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 _defineProperty(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 _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 _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 _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 _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 _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 _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 _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 _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);}if(typeof window!=='undefined'){window.__XEOKIT__={version:'2.6.105',commit:'a7773e7668edb2daae03f66d0ce50714c895c486',built:'2026-01-29T10:29:08.631Z'};}/** @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
|
|
@@ -26355,10 +26355,10 @@ sceneModel.fire("loaded",true,false);});if(ok){ok();}},function(msg){plugin.erro
|
|
|
26355
26355
|
sceneModel.fire("loaded",true,false);if(ok){ok();}},function(msg){sceneModel.error(msg);sceneModel.fire("error",msg);if(error){error(msg);}});}}]);return GLTFSceneModelLoader;}();function loadGLTF(plugin,src,metaModelJSON,options,sceneModel,ok,error){var spinner=plugin.viewer.scene.canvas.spinner;spinner.processes++;var isGLB=src.split('.').pop()==="glb";if(isGLB){plugin.dataSource.getGLB(src,function(arrayBuffer){// OK
|
|
26356
26356
|
options.basePath=getBasePath(src);parseGLTF(plugin,src,arrayBuffer,metaModelJSON,options,sceneModel,ok,error);spinner.processes--;},function(err){spinner.processes--;error(err);});}else{plugin.dataSource.getGLTF(src,function(gltf){// OK
|
|
26357
26357
|
options.basePath=getBasePath(src);parseGLTF(plugin,src,gltf,metaModelJSON,options,sceneModel,ok,error);spinner.processes--;},function(err){spinner.processes--;error(err);});}}function getBasePath(src){var i=src.lastIndexOf("/");return i!==0?src.substring(0,i+1):"";}function parseGLTF(plugin,src,gltf,metaModelJSON,options,sceneModel,ok,error){var spinner=plugin.viewer.scene.canvas.spinner;spinner.processes++;parse$4(gltf,GLTFLoader,_objectSpread(_objectSpread({},options.parseOptions||{}),{},{baseUri:options.basePath})).then(function(gltfData){var processedGLTF=postProcessGLTF(gltfData);var ctx={src:src,entityId:options.entityId,metaModelJSON:metaModelJSON,autoMetaModel:options.autoMetaModel,globalizeObjectIds:options.globalizeObjectIds,metaObjects:[],loadBuffer:options.loadBuffer,basePath:options.basePath,handlenode:options.handlenode,backfaces:!!options.backfaces,gltfData:processedGLTF,scene:sceneModel.scene,plugin:plugin,sceneModel:sceneModel,//geometryCreated: {},
|
|
26358
|
-
numObjects:0,nodes:[],nextId:0,log:function log(msg){plugin.log(msg);}};loadTextures(ctx);loadMaterials(ctx);if(options.autoMetaModel){ctx.metaObjects.push({id:sceneModel.id,type:"Default",name:sceneModel.id});}loadDefaultScene(ctx);sceneModel.finalize();if(options.autoMetaModel){plugin.viewer.metaScene.createMetaModel(sceneModel.id,{metaObjects:ctx.metaObjects});}spinner.processes--;ok();})["catch"](function(err){if(error)error(err);});}function loadTextures(ctx){var gltfData=ctx.gltfData;var textures=gltfData.textures;if(textures){for(var _i322=0,len=textures.length;_i322<len;_i322++){loadTexture(ctx,textures[_i322]);}}}function loadTexture(ctx,texture){if(!texture.source||!texture.source.image){return;}var textureId="texture-".concat(ctx.nextId++);var minFilter=NearestMipMapLinearFilter;switch(texture.sampler.minFilter){case 9728:minFilter=NearestFilter;break;case 9729:minFilter=LinearFilter;break;case 9984:minFilter=NearestMipMapNearestFilter;break;case 9985:minFilter=LinearMipMapNearestFilter;break;case 9986:minFilter=NearestMipMapLinearFilter;break;case 9987:minFilter=LinearMipMapLinearFilter;break;}var magFilter=LinearFilter;switch(texture.sampler.magFilter){case 9728:magFilter=NearestFilter;break;case 9729:magFilter=LinearFilter;break;}var wrapS=RepeatWrapping;switch(texture.sampler.wrapS){case 33071:wrapS=ClampToEdgeWrapping;break;case 33648:wrapS=MirroredRepeatWrapping;break;case 10497:wrapS=RepeatWrapping;break;}var wrapT=RepeatWrapping;switch(texture.sampler.wrapT){case 33071:wrapT=ClampToEdgeWrapping;break;case 33648:wrapT=MirroredRepeatWrapping;break;case 10497:wrapT=RepeatWrapping;break;}var wrapR=RepeatWrapping;switch(texture.sampler.wrapR){case 33071:wrapR=ClampToEdgeWrapping;break;case 33648:wrapR=MirroredRepeatWrapping;break;case 10497:wrapR=RepeatWrapping;break;}ctx.sceneModel.createTexture({id:textureId,image:texture.source.image,flipY:!!texture.flipY,minFilter:minFilter,magFilter:magFilter,wrapS:wrapS,wrapT:wrapT,wrapR:wrapR,encoding:sRGBEncoding});texture._textureId=textureId;}function loadMaterials(ctx){var gltfData=ctx.gltfData;var materials=gltfData.materials;if(materials){for(var _i323=0,len=materials.length;_i323<len;_i323++){var material=materials[_i323];material._textureSetId=loadTextureSet(ctx,material);material._attributes=loadMaterialAttributes(ctx,material);}}}function loadTextureSet(ctx,material){var textureSetCfg={};if(material.normalTexture){textureSetCfg.normalTextureId=material.normalTexture.texture._textureId;}if(material.occlusionTexture){textureSetCfg.occlusionTextureId=material.occlusionTexture.texture._textureId;}if(material.emissiveTexture){textureSetCfg.emissiveTextureId=material.emissiveTexture.texture._textureId;}switch(material.alphaMode){case"OPAQUE":break;case"MASK":var alphaCutoff=material.alphaCutoff;// Default from the spec https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-material
|
|
26358
|
+
numObjects:0,nodes:[],nextId:0,entityPerMesh:options.entityPerMesh,log:function log(msg){plugin.log(msg);}};loadTextures(ctx);loadMaterials(ctx);if(options.autoMetaModel){ctx.metaObjects.push({id:sceneModel.id,type:"Default",name:sceneModel.id});}loadDefaultScene(ctx);sceneModel.finalize();if(options.autoMetaModel){plugin.viewer.metaScene.createMetaModel(sceneModel.id,{metaObjects:ctx.metaObjects});}spinner.processes--;ok();})["catch"](function(err){if(error)error(err);});}function loadTextures(ctx){var gltfData=ctx.gltfData;var textures=gltfData.textures;if(textures){for(var _i322=0,len=textures.length;_i322<len;_i322++){loadTexture(ctx,textures[_i322]);}}}function loadTexture(ctx,texture){if(!texture.source||!texture.source.image){return;}var textureId="texture-".concat(ctx.nextId++);var minFilter=NearestMipMapLinearFilter;switch(texture.sampler.minFilter){case 9728:minFilter=NearestFilter;break;case 9729:minFilter=LinearFilter;break;case 9984:minFilter=NearestMipMapNearestFilter;break;case 9985:minFilter=LinearMipMapNearestFilter;break;case 9986:minFilter=NearestMipMapLinearFilter;break;case 9987:minFilter=LinearMipMapLinearFilter;break;}var magFilter=LinearFilter;switch(texture.sampler.magFilter){case 9728:magFilter=NearestFilter;break;case 9729:magFilter=LinearFilter;break;}var wrapS=RepeatWrapping;switch(texture.sampler.wrapS){case 33071:wrapS=ClampToEdgeWrapping;break;case 33648:wrapS=MirroredRepeatWrapping;break;case 10497:wrapS=RepeatWrapping;break;}var wrapT=RepeatWrapping;switch(texture.sampler.wrapT){case 33071:wrapT=ClampToEdgeWrapping;break;case 33648:wrapT=MirroredRepeatWrapping;break;case 10497:wrapT=RepeatWrapping;break;}var wrapR=RepeatWrapping;switch(texture.sampler.wrapR){case 33071:wrapR=ClampToEdgeWrapping;break;case 33648:wrapR=MirroredRepeatWrapping;break;case 10497:wrapR=RepeatWrapping;break;}ctx.sceneModel.createTexture({id:textureId,image:texture.source.image,flipY:!!texture.flipY,minFilter:minFilter,magFilter:magFilter,wrapS:wrapS,wrapT:wrapT,wrapR:wrapR,encoding:sRGBEncoding});texture._textureId=textureId;}function loadMaterials(ctx){var gltfData=ctx.gltfData;var materials=gltfData.materials;if(materials){for(var _i323=0,len=materials.length;_i323<len;_i323++){var material=materials[_i323];material._textureSetId=loadTextureSet(ctx,material);material._attributes=loadMaterialAttributes(ctx,material);}}}function loadTextureSet(ctx,material){var textureSetCfg={};if(material.normalTexture){textureSetCfg.normalTextureId=material.normalTexture.texture._textureId;}if(material.occlusionTexture){textureSetCfg.occlusionTextureId=material.occlusionTexture.texture._textureId;}if(material.emissiveTexture){textureSetCfg.emissiveTextureId=material.emissiveTexture.texture._textureId;}switch(material.alphaMode){case"OPAQUE":break;case"MASK":var alphaCutoff=material.alphaCutoff;// Default from the spec https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#reference-material
|
|
26359
26359
|
textureSetCfg.alphaCutoff=alphaCutoff!==undefined?alphaCutoff:0.5;break;}var metallicPBR=material.pbrMetallicRoughness;if(material.pbrMetallicRoughness){var pbrMetallicRoughness=material.pbrMetallicRoughness;var baseColorTexture=pbrMetallicRoughness.baseColorTexture||pbrMetallicRoughness.colorTexture;if(baseColorTexture){if(baseColorTexture.texture){textureSetCfg.colorTextureId=baseColorTexture.texture._textureId;}else{textureSetCfg.colorTextureId=ctx.gltfData.textures[baseColorTexture.index]._textureId;}}if(metallicPBR.metallicRoughnessTexture){textureSetCfg.metallicRoughnessTextureId=metallicPBR.metallicRoughnessTexture.texture._textureId;}}var extensions=material.extensions;if(extensions){var specularPBR=extensions["KHR_materials_pbrSpecularGlossiness"];if(specularPBR){specularPBR.specularTexture;var specularColorTexture=specularPBR.specularColorTexture;if(specularColorTexture!==null&&specularColorTexture!==undefined){textureSetCfg.colorTextureId=ctx.gltfData.textures[specularColorTexture.index]._textureId;}}}if(textureSetCfg.normalTextureId!==undefined||textureSetCfg.occlusionTextureId!==undefined||textureSetCfg.emissiveTextureId!==undefined||textureSetCfg.colorTextureId!==undefined||textureSetCfg.metallicRoughnessTextureId!==undefined){textureSetCfg.id="textureSet-".concat(ctx.nextId++,";");ctx.sceneModel.createTextureSet(textureSetCfg);return textureSetCfg.id;}return null;}function loadMaterialAttributes(ctx,material){// Substitute RGBA for material, to use fast flat shading instead
|
|
26360
|
-
var extensions=material.extensions;var materialAttributes={color:new Float32Array([1,1,1,1]),opacity:1,metallic:0,roughness:1,doubleSided:true};if(extensions){var specularPBR=extensions["KHR_materials_pbrSpecularGlossiness"];if(specularPBR){var diffuseFactor=specularPBR.diffuseFactor;if(diffuseFactor!==null&&diffuseFactor!==undefined){materialAttributes.color.set(diffuseFactor);}}var common=extensions["KHR_materials_common"];if(common){var technique=common.technique;var values=common.values||{};var blinn=technique==="BLINN";var phong=technique==="PHONG";var lambert=technique==="LAMBERT";var diffuse=values.diffuse;if(diffuse&&(blinn||phong||lambert)){if(!utils.isString(diffuse)){materialAttributes.color.set(diffuse);}}var transparency=values.transparency;if(transparency!==null&&transparency!==undefined){materialAttributes.opacity=transparency;}var transparent=values.transparent;if(transparent!==null&&transparent!==undefined){materialAttributes.opacity=transparent;}}}var metallicPBR=material.pbrMetallicRoughness;if(metallicPBR){var baseColorFactor=metallicPBR.baseColorFactor;if(baseColorFactor){materialAttributes.color[0]=baseColorFactor[0];materialAttributes.color[1]=baseColorFactor[1];materialAttributes.color[2]=baseColorFactor[2];materialAttributes.opacity=baseColorFactor[3];}var metallicFactor=metallicPBR.metallicFactor;if(metallicFactor!==null&&metallicFactor!==undefined){materialAttributes.metallic=metallicFactor;}var roughnessFactor=metallicPBR.roughnessFactor;if(roughnessFactor!==null&&roughnessFactor!==undefined){materialAttributes.roughness=roughnessFactor;}}materialAttributes.doubleSided=material.doubleSided!==false;return materialAttributes;}function loadDefaultScene(ctx){var gltfData=ctx.gltfData;var scene=gltfData.scene||gltfData.scenes[0];if(!scene){error(ctx,"glTF has no default scene");return;}var nodes=scene.nodes;if(!nodes){return;}(function accumulateMeshInstantes(nodes){nodes.forEach(function(node){var mesh=node.mesh;if(mesh){mesh.instances||(mesh.instances=0);mesh.instances+=1;}if(node.children){accumulateMeshInstantes(node.children);}});})(nodes)
|
|
26361
|
-
var meshIdsStack=[];var meshIds=null;(function createSceneMeshesAndEntities(nodes,depth,parentMatrix){nodes.forEach(function(node){var nodeName=node.name;var entityId=nodeName!==undefined&&nodeName!==null&&nodeName||depth===0&&"Node."+String(ctx.nextId++).padStart(4,"0");if(entityId){entityId=ctx.globalizeObjectIds?math.globalizeObjectId(ctx.sceneModel.id,entityId):entityId;while(ctx.sceneModel.objects[entityId]){entityId=nodeName+"."+String(ctx.nextId++).padStart(4,"0");entityId=ctx.globalizeObjectIds?math.globalizeObjectId(ctx.sceneModel.id,entityId):entityId;}meshIdsStack.push(meshIds);meshIds=[];}var matrix=parseNodeMatrix(node,parentMatrix);if(node.mesh){parseNodeMesh(node,ctx,matrix,meshIds);}if(node.children){createSceneMeshesAndEntities(node.children,depth+1,matrix);}if(entityId){if(meshIds.length>0){ctx.sceneModel.createEntity({id:entityId,meshIds:meshIds,isObject:true});if(ctx.autoMetaModel){ctx.metaObjects.push({id:entityId,type:"Default",name:
|
|
26360
|
+
var extensions=material.extensions;var materialAttributes={color:new Float32Array([1,1,1,1]),opacity:1,metallic:0,roughness:1,doubleSided:true};if(extensions){var specularPBR=extensions["KHR_materials_pbrSpecularGlossiness"];if(specularPBR){var diffuseFactor=specularPBR.diffuseFactor;if(diffuseFactor!==null&&diffuseFactor!==undefined){materialAttributes.color.set(diffuseFactor);}}var common=extensions["KHR_materials_common"];if(common){var technique=common.technique;var values=common.values||{};var blinn=technique==="BLINN";var phong=technique==="PHONG";var lambert=technique==="LAMBERT";var diffuse=values.diffuse;if(diffuse&&(blinn||phong||lambert)){if(!utils.isString(diffuse)){materialAttributes.color.set(diffuse);}}var transparency=values.transparency;if(transparency!==null&&transparency!==undefined){materialAttributes.opacity=transparency;}var transparent=values.transparent;if(transparent!==null&&transparent!==undefined){materialAttributes.opacity=transparent;}}}var metallicPBR=material.pbrMetallicRoughness;if(metallicPBR){var baseColorFactor=metallicPBR.baseColorFactor;if(baseColorFactor){materialAttributes.color[0]=baseColorFactor[0];materialAttributes.color[1]=baseColorFactor[1];materialAttributes.color[2]=baseColorFactor[2];materialAttributes.opacity=baseColorFactor[3];}var metallicFactor=metallicPBR.metallicFactor;if(metallicFactor!==null&&metallicFactor!==undefined){materialAttributes.metallic=metallicFactor;}var roughnessFactor=metallicPBR.roughnessFactor;if(roughnessFactor!==null&&roughnessFactor!==undefined){materialAttributes.roughness=roughnessFactor;}}materialAttributes.doubleSided=material.doubleSided!==false;return materialAttributes;}function loadDefaultScene(ctx){var gltfData=ctx.gltfData;var scene=gltfData.scene||gltfData.scenes[0];if(!scene){error(ctx,"glTF has no default scene");return;}var nodes=scene.nodes;if(!nodes){return;}(function accumulateMeshInstantes(nodes){nodes.forEach(function(node){var mesh=node.mesh;if(mesh){mesh.instances||(mesh.instances=0);mesh.instances+=1;}if(node.children){accumulateMeshInstantes(node.children);}});})(nodes);if(ctx.entityPerMesh){var sceneIds=new Set();(function createSceneMeshesAndEntities(nodes,parentId,parentMatrix,dep){return nodes.reduce(function(hadMesh,node){var _node$name;var baseId=(_node$name=node.name)!==null&&_node$name!==void 0?_node$name:"Node";var maybeGlobalize=function maybeGlobalize(id){return ctx.globalizeObjectIds?math.globalizeObjectId(ctx.sceneModel.id,id):id;};var entityId=maybeGlobalize(baseId);var nextPostfixId=1;while(ctx.sceneModel.objects[entityId]||sceneIds.has(entityId)){entityId=maybeGlobalize("".concat(baseId,".").concat((nextPostfixId++).toString().padStart(4,"0")));}sceneIds.add(entityId);var matrix=parseNodeMatrix(node,parentMatrix);var meshEntity=node.mesh&&function(){var meshIds=[];parseNodeMesh(node,ctx,matrix,meshIds);return meshIds.length>0&&ctx.sceneModel.createEntity({id:entityId,meshIds:meshIds,isObject:true});}();var hasMesh=node.children&&createSceneMeshesAndEntities(node.children,entityId,matrix)||meshEntity;if(hasMesh&&ctx.autoMetaModel){ctx.metaObjects.push({id:entityId,name:entityId,type:"Default",parent:parentId});}return hadMesh||hasMesh;},false);})(nodes,ctx.sceneModel.id,null);return;}// Create a SceneMesh for each mesh primitive, and a SceneModelEntity for the root node and each named node.
|
|
26361
|
+
var meshIdsStack=[];var meshIds=null;(function createSceneMeshesAndEntities(nodes,depth,parentMatrix){nodes.forEach(function(node){var nodeName=node.name;var entityId=nodeName!==undefined&&nodeName!==null&&nodeName||depth===0&&"Node."+String(ctx.nextId++).padStart(4,"0");if(entityId){entityId=ctx.globalizeObjectIds?math.globalizeObjectId(ctx.sceneModel.id,entityId):entityId;while(ctx.sceneModel.objects[entityId]){entityId=nodeName+"."+String(ctx.nextId++).padStart(4,"0");entityId=ctx.globalizeObjectIds?math.globalizeObjectId(ctx.sceneModel.id,entityId):entityId;}meshIdsStack.push(meshIds);meshIds=[];}var matrix=parseNodeMatrix(node,parentMatrix);if(node.mesh){parseNodeMesh(node,ctx,matrix,meshIds);}if(node.children){createSceneMeshesAndEntities(node.children,depth+1,matrix);}if(entityId){if(meshIds.length>0){ctx.sceneModel.createEntity({id:entityId,meshIds:meshIds,isObject:true});if(ctx.autoMetaModel){ctx.metaObjects.push({id:entityId,type:"Default",name:nodeName?nodeName:"Node",parent:ctx.sceneModel.id});}}meshIds=meshIdsStack.pop();}});})(nodes,0,null);}/**
|
|
26362
26362
|
* Parses transform at the given glTF node.
|
|
26363
26363
|
*
|
|
26364
26364
|
* @param node the glTF node
|
|
@@ -26371,7 +26371,7 @@ var meshIdsStack=[];var meshIds=null;(function createSceneMeshesAndEntities(node
|
|
|
26371
26371
|
* @param ctx Parsing context
|
|
26372
26372
|
* @param matrix Matrix for the XKTMeshes
|
|
26373
26373
|
* @param meshIds returns IDs of the new XKTMeshes
|
|
26374
|
-
*/function parseNodeMesh(node,ctx,matrix,meshIds){var mesh=node.mesh;if(!mesh){return;}var numPrimitives=mesh.primitives.length;if(numPrimitives>0){for(var _i324=0;_i324<numPrimitives;_i324++){var primitive=mesh.primitives[_i324];
|
|
26374
|
+
*/function parseNodeMesh(node,ctx,matrix,meshIds){var mesh=node.mesh;if(!mesh){return;}var numPrimitives=mesh.primitives.length;if(numPrimitives>0){for(var _i324=0;_i324<numPrimitives;_i324++){var primitive=mesh.primitives[_i324];var meshCfg={id:ctx.sceneModel.id+"."+ctx.numObjects++};var material=primitive.material;if(material){meshCfg.textureSetId=material._textureSetId;meshCfg.color=material._attributes.color;meshCfg.opacity=material._attributes.opacity;meshCfg.metallic=material._attributes.metallic;meshCfg.roughness=material._attributes.roughness;}else{meshCfg.color=new Float32Array([1.0,1.0,1.0]);meshCfg.opacity=1.0;}var backfaces=ctx.backfaces!==false||material&&material.doubleSided!==false;switch(primitive.mode){case 0:// POINTS
|
|
26375
26375
|
meshCfg.primitive="points";break;case 1:// LINES
|
|
26376
26376
|
meshCfg.primitive="lines";break;case 2:// LINE_LOOP
|
|
26377
26377
|
meshCfg.primitive="lines";break;case 3:// LINE_STRIP
|
|
@@ -26673,6 +26673,7 @@ if(rtcNeeded){meshCfg.origin=origin;}ctx.sceneModel.createMesh(meshCfg);meshIds.
|
|
|
26673
26673
|
* @param {Boolean} [params.autoMetaModel] When supplied, creates a default MetaModel with a single MetaObject.
|
|
26674
26674
|
* @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models.
|
|
26675
26675
|
* @param {*} [params.parseOptions={}] Options to pass to loaders.gl parse method, eg. ````{ gltf: { excludeExtensions: { "KHR_texture_transform": false } } }````.
|
|
26676
|
+
* @param {Boolean} [params.entityPerMesh=false] Create an entity for each mesh, instead of grouping leaf meshes under their common entity.
|
|
26676
26677
|
* @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}
|
|
26677
26678
|
*/,set:function set(value){this._objectDefaults=value||IFCObjectDefaults;}},{key:"load",value:function load(){var _this159=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;}var sceneModel=new SceneModel(this.viewer.scene,utils.apply(params,{isModel:true,dtxEnabled:params.dtxEnabled}));var modelId=sceneModel.id;// In case ID was auto-generated
|
|
26678
26679
|
if(!params.src&&!params.gltf){this.error("load() param expected: src or gltf");return sceneModel;// Return new empty model
|