@xeokit/xeokit-sdk 2.6.103 → 2.6.105-XCD-439-transparent-issues

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.
@@ -1,10 +1,10 @@
1
1
  /**
2
- * xeokit-sdk v2.6.103
3
- * Commit: 04beebb6bc2ab830039ad23e343432aae980ecf7
4
- * Built: 2026-01-08T15:10:53.564Z
2
+ * xeokit-sdk v2.6.105-XCD-439-transparent-issues
3
+ * Commit: 20c5d5219328db0e2a6ebfd88bbfc44eb0367962
4
+ * Built: 2026-02-02T17:00:01.808Z
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-XCD-439-transparent-issues',commit:'20c5d5219328db0e2a6ebfd88bbfc44eb0367962',built:'2026-02-02T17:00:01.808Z'};}/** @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
@@ -2801,7 +2801,7 @@ comparison=arcLengths[i]-targetArcLength;if(comparison<0){low=i+1;}else if(compa
2801
2801
  * @param {Number} duration The total duration for this CameraPath.
2802
2802
  */},{key:"smoothFrameTimes",value:function smoothFrameTimes(duration){var numFrames=this._frames.length;if(numFrames===0){return;}var vec=math.vec3();var totalLen=0;this._frames[0].t=0;var lens=[];for(var _i46=1,len=this._frames.length;_i46<len;_i46++){var lenVec=math.lenVec3(math.subVec3(this._frames[_i46].eye,this._frames[_i46-1].eye,vec));lens[_i46]=lenVec;totalLen+=lenVec;}for(var _i47=1,_len3=this._frames.length;_i47<_len3;_i47++){var interFrameRate=lens[_i47]/totalLen*duration;this._frames[_i47].t=this._frames[_i47-1].t+interFrameRate;}}/**
2803
2803
  * Removes all frames from this CameraPath.
2804
- */},{key:"clearFrames",value:function clearFrames(){this._frames=[];this._eyeCurve.points=[];this._lookCurve.points=[];this._upCurve.points=[];}}]);return CameraPath;}(Component);var tempVec3$8=math.vec3();var newLook=math.vec3();var newEye=math.vec3();var newUp=math.vec3();var newLookEyeVec=math.vec3();/**
2804
+ */},{key:"clearFrames",value:function clearFrames(){this._frames=[];this._eyeCurve.points=[];this._lookCurve.points=[];this._upCurve.points=[];}}]);return CameraPath;}(Component);var tempVec3$9=math.vec3();var newLook=math.vec3();var newEye=math.vec3();var newUp=math.vec3();var newLookEyeVec=math.vec3();/**
2805
2805
  * @desc Jumps or flies the {@link Scene}'s {@link Camera} to a given target.
2806
2806
  *
2807
2807
  * * Located at {@link Viewer#cameraFlight}
@@ -2922,7 +2922,7 @@ comparison=arcLengths[i]-targetArcLength;if(comparison<0){low=i+1;}else if(compa
2922
2922
  */function get(){return"CameraFlightAnimation";}},{key:"flyTo",value:function flyTo(params,callback,scope){params=params||this.scene;if(this._flying){this.stop();}this._flying=false;this._flyingEye=false;this._flyingLook=false;this._flyingEyeLookUp=false;this._callback=callback;this._callbackScope=scope;var camera=this.scene.camera;var flyToProjection=!!params.projection&&params.projection!==camera.projection;this._eye1[0]=camera.eye[0];this._eye1[1]=camera.eye[1];this._eye1[2]=camera.eye[2];this._look1[0]=camera.look[0];this._look1[1]=camera.look[1];this._look1[2]=camera.look[2];this._up1[0]=camera.up[0];this._up1[1]=camera.up[1];this._up1[2]=camera.up[2];this._orthoScale1=camera.ortho.scale;this._orthoScale2=params.orthoScale||this._orthoScale1;var aabb;var eye;var look;var up;var componentId;if(params.aabb){aabb=params.aabb;}else if(params.length===6){aabb=params;}else if(params.eye&&params.look||params.up){eye=params.eye;look=params.look;up=params.up;}else if(params.eye){eye=params.eye;}else if(params.look){look=params.look;}else{// Argument must be an instance or ID of a Component (subtype)
2923
2923
  var component=params;if(utils.isNumeric(component)||utils.isString(component)){componentId=component;component=this.scene.components[componentId];if(!component){this.error("Component not found: "+utils.inQuotes(componentId));if(callback){if(scope){callback.call(scope);}else{callback();}}return;}}if(!flyToProjection){aabb=component.aabb||this.scene.aabb;}}var poi=params.poi;if(aabb){if(aabb[3]<aabb[0]||aabb[4]<aabb[1]||aabb[5]<aabb[2]){// Don't fly to an inverted boundary
2924
2924
  return;}if(aabb[3]===aabb[0]&&aabb[4]===aabb[1]&&aabb[5]===aabb[2]){// Don't fly to an empty boundary
2925
- return;}aabb=aabb.slice();var aabbCenter=math.getAABB3Center(aabb);this._look2=poi||aabbCenter;var _eyeLookVec=math.subVec3(this._eye1,this._look1,tempVec3$8);var _eyeLookVecNorm=math.normalizeVec3(_eyeLookVec);var diag=poi?math.getAABB3DiagPoint(aabb,poi):math.getAABB3Diag(aabb);var fitFOV=params.fitFOV||this._fitFOV;var sca=Math.abs(diag/Math.tan(fitFOV*math.DEGTORAD));this._orthoScale2=diag*1.1;this._eye2[0]=this._look2[0]+_eyeLookVecNorm[0]*sca;this._eye2[1]=this._look2[1]+_eyeLookVecNorm[1]*sca;this._eye2[2]=this._look2[2]+_eyeLookVecNorm[2]*sca;this._up2[0]=this._up1[0];this._up2[1]=this._up1[1];this._up2[2]=this._up1[2];this._flyingEyeLookUp=true;}else if(eye||look||up){this._flyingEyeLookUp=!!eye&&!!look&&!!up;this._flyingEye=!!eye&&!look;this._flyingLook=!!look&&!eye;if(eye){this._eye2[0]=eye[0];this._eye2[1]=eye[1];this._eye2[2]=eye[2];}if(look){this._look2[0]=look[0];this._look2[1]=look[1];this._look2[2]=look[2];}if(up){this._up2[0]=up[0];this._up2[1]=up[1];this._up2[2]=up[2];}}if(flyToProjection){if(params.projection==="ortho"&&camera.projection!=="ortho"){this._projection2="ortho";this._projMatrix1=camera.projMatrix.slice();this._projMatrix2=camera.ortho.matrix.slice();camera.projection="customProjection";}if(params.projection==="perspective"&&camera.projection!=="perspective"){this._projection2="perspective";this._projMatrix1=camera.projMatrix.slice();this._projMatrix2=camera.perspective.matrix.slice();camera.projection="customProjection";}}else{this._projection2=null;}this.fire("started",params,true);this._time1=Date.now();this._time2=this._time1+(Number.isFinite(params.duration)?params.duration*1000:this._duration);this._flying=true;// False as soon as we stop
2925
+ return;}aabb=aabb.slice();var aabbCenter=math.getAABB3Center(aabb);this._look2=poi||aabbCenter;var _eyeLookVec=math.subVec3(this._eye1,this._look1,tempVec3$9);var _eyeLookVecNorm=math.normalizeVec3(_eyeLookVec);var diag=poi?math.getAABB3DiagPoint(aabb,poi):math.getAABB3Diag(aabb);var fitFOV=params.fitFOV||this._fitFOV;var sca=Math.abs(diag/Math.tan(fitFOV*math.DEGTORAD));this._orthoScale2=diag*1.1;this._eye2[0]=this._look2[0]+_eyeLookVecNorm[0]*sca;this._eye2[1]=this._look2[1]+_eyeLookVecNorm[1]*sca;this._eye2[2]=this._look2[2]+_eyeLookVecNorm[2]*sca;this._up2[0]=this._up1[0];this._up2[1]=this._up1[1];this._up2[2]=this._up1[2];this._flyingEyeLookUp=true;}else if(eye||look||up){this._flyingEyeLookUp=!!eye&&!!look&&!!up;this._flyingEye=!!eye&&!look;this._flyingLook=!!look&&!eye;if(eye){this._eye2[0]=eye[0];this._eye2[1]=eye[1];this._eye2[2]=eye[2];}if(look){this._look2[0]=look[0];this._look2[1]=look[1];this._look2[2]=look[2];}if(up){this._up2[0]=up[0];this._up2[1]=up[1];this._up2[2]=up[2];}}if(flyToProjection){if(params.projection==="ortho"&&camera.projection!=="ortho"){this._projection2="ortho";this._projMatrix1=camera.projMatrix.slice();this._projMatrix2=camera.ortho.matrix.slice();camera.projection="customProjection";}if(params.projection==="perspective"&&camera.projection!=="perspective"){this._projection2="perspective";this._projMatrix1=camera.projMatrix.slice();this._projMatrix2=camera.perspective.matrix.slice();camera.projection="customProjection";}}else{this._projection2=null;}this.fire("started",params,true);this._time1=Date.now();this._time2=this._time1+(Number.isFinite(params.duration)?params.duration*1000:this._duration);this._flying=true;// False as soon as we stop
2926
2926
  core.scheduleTask(this._update,this);}/**
2927
2927
  * Jumps the {@link Scene}'s {@link Camera} to the given target.
2928
2928
  *
@@ -2944,7 +2944,7 @@ aabb=params.aabb;}else if(params.length===6){// AABB
2944
2944
  aabb=params;}else if(params.eye||params.look||params.up){// Camera pose
2945
2945
  newEye=params.eye;newLook=params.look;newUp=params.up;}else{// Argument must be an instance or ID of a Component (subtype)
2946
2946
  var component=params;if(utils.isNumeric(component)||utils.isString(component)){componentId=component;component=this.scene.components[componentId];if(!component){this.error("Component not found: "+utils.inQuotes(componentId));return;}}aabb=component.aabb||this.scene.aabb;}var poi=params.poi;if(aabb){if(aabb[3]<=aabb[0]||aabb[4]<=aabb[1]||aabb[5]<=aabb[2]){// Don't fly to an empty boundary
2947
- return;}var diag=poi?math.getAABB3DiagPoint(aabb,poi):math.getAABB3Diag(aabb);newLook=poi||math.getAABB3Center(aabb,newLook);if(this._trail){math.subVec3(camera.look,newLook,newLookEyeVec);}else{math.subVec3(camera.eye,camera.look,newLookEyeVec);}math.normalizeVec3(newLookEyeVec);var dist;var fit=params.fit!==undefined?params.fit:this._fit;if(fit){dist=Math.abs(diag/Math.tan((params.fitFOV||this._fitFOV)*math.DEGTORAD));}else{dist=math.lenVec3(math.subVec3(camera.eye,camera.look,tempVec3$8));}math.mulVec3Scalar(newLookEyeVec,dist);camera.eye=math.addVec3(newLook,newLookEyeVec,tempVec3$8);camera.look=newLook;this.scene.camera.ortho.scale=diag*1.1;}else if(newEye||newLook||newUp){if(newEye){camera.eye=newEye;}if(newLook){camera.look=newLook;}if(newUp){camera.up=newUp;}}if(params.projection){camera.projection=params.projection;}}},{key:"_update",value:function _update(){if(!this._flying){return;}var time=Date.now();var t=(time-this._time1)/(this._time2-this._time1);var stopping=t>=1;if(t>1){t=1;}var tFlight=this.easing?CameraFlightAnimation._ease(t,0,1,1):t;var camera=this.scene.camera;if(this._flyingEye||this._flyingLook){if(this._flyingEye){math.subVec3(camera.eye,camera.look,newLookEyeVec);camera.eye=math.lerpVec3(tFlight,0,1,this._eye1,this._eye2,newEye);camera.look=math.subVec3(newEye,newLookEyeVec,newLook);}else if(this._flyingLook){camera.look=math.lerpVec3(tFlight,0,1,this._look1,this._look2,newLook);camera.up=math.lerpVec3(tFlight,0,1,this._up1,this._up2,newUp);}}else if(this._flyingEyeLookUp){camera.eye=math.lerpVec3(tFlight,0,1,this._eye1,this._eye2,newEye);camera.look=math.lerpVec3(tFlight,0,1,this._look1,this._look2,newLook);camera.up=math.lerpVec3(tFlight,0,1,this._up1,this._up2,newUp);}if(this._projection2){var tProj=this._projection2==="ortho"?CameraFlightAnimation._easeOutExpo(t,0,1,1):CameraFlightAnimation._easeInCubic(t,0,1,1);camera.customProjection.matrix=math.lerpMat4(tProj,0,1,this._projMatrix1,this._projMatrix2);}else{camera.ortho.scale=this._orthoScale1+t*(this._orthoScale2-this._orthoScale1);}if(stopping){camera.ortho.scale=this._orthoScale2;this.stop();return;}core.scheduleTask(this._update,this);// Keep flying
2947
+ return;}var diag=poi?math.getAABB3DiagPoint(aabb,poi):math.getAABB3Diag(aabb);newLook=poi||math.getAABB3Center(aabb,newLook);if(this._trail){math.subVec3(camera.look,newLook,newLookEyeVec);}else{math.subVec3(camera.eye,camera.look,newLookEyeVec);}math.normalizeVec3(newLookEyeVec);var dist;var fit=params.fit!==undefined?params.fit:this._fit;if(fit){dist=Math.abs(diag/Math.tan((params.fitFOV||this._fitFOV)*math.DEGTORAD));}else{dist=math.lenVec3(math.subVec3(camera.eye,camera.look,tempVec3$9));}math.mulVec3Scalar(newLookEyeVec,dist);camera.eye=math.addVec3(newLook,newLookEyeVec,tempVec3$9);camera.look=newLook;this.scene.camera.ortho.scale=diag*1.1;}else if(newEye||newLook||newUp){if(newEye){camera.eye=newEye;}if(newLook){camera.look=newLook;}if(newUp){camera.up=newUp;}}if(params.projection){camera.projection=params.projection;}}},{key:"_update",value:function _update(){if(!this._flying){return;}var time=Date.now();var t=(time-this._time1)/(this._time2-this._time1);var stopping=t>=1;if(t>1){t=1;}var tFlight=this.easing?CameraFlightAnimation._ease(t,0,1,1):t;var camera=this.scene.camera;if(this._flyingEye||this._flyingLook){if(this._flyingEye){math.subVec3(camera.eye,camera.look,newLookEyeVec);camera.eye=math.lerpVec3(tFlight,0,1,this._eye1,this._eye2,newEye);camera.look=math.subVec3(newEye,newLookEyeVec,newLook);}else if(this._flyingLook){camera.look=math.lerpVec3(tFlight,0,1,this._look1,this._look2,newLook);camera.up=math.lerpVec3(tFlight,0,1,this._up1,this._up2,newUp);}}else if(this._flyingEyeLookUp){camera.eye=math.lerpVec3(tFlight,0,1,this._eye1,this._eye2,newEye);camera.look=math.lerpVec3(tFlight,0,1,this._look1,this._look2,newLook);camera.up=math.lerpVec3(tFlight,0,1,this._up1,this._up2,newUp);}if(this._projection2){var tProj=this._projection2==="ortho"?CameraFlightAnimation._easeOutExpo(t,0,1,1):CameraFlightAnimation._easeInCubic(t,0,1,1);camera.customProjection.matrix=math.lerpMat4(tProj,0,1,this._projMatrix1,this._projMatrix2);}else{camera.ortho.scale=this._orthoScale1+t*(this._orthoScale2-this._orthoScale1);}if(stopping){camera.ortho.scale=this._orthoScale2;this.stop();return;}core.scheduleTask(this._update,this);// Keep flying
2948
2948
  }},{key:"stop",value:/**
2949
2949
  * Stops an earlier flyTo, fires arrival callback.
2950
2950
  */function stop(){if(!this._flying){return;}this._flying=false;this._time1=null;this._time2=null;if(this._projection2){this.scene.camera.projection=this._projection2;}var callback=this._callback;if(callback){this._callback=null;if(this._callbackScope){callback.call(this._callbackScope);}else{callback();}}this.fire("stopped",true,true);}/**
@@ -6849,7 +6849,7 @@ if(cfg.src){_this26.src=cfg.src;// Image file
6849
6849
  * @type {Number}
6850
6850
  */},{key:"encoding",get:function get(){return this._state.encoding;}/**
6851
6851
  * Destroys this Texture
6852
- */},{key:"destroy",value:function destroy(){_get(_getPrototypeOf(Texture.prototype),"destroy",this).call(this);if(this._state.texture){this._state.texture.destroy();}this._state.destroy();stats.memory.textures--;}}]);return Texture;}(Component);var tempVec3$7=math.vec3();var tempVec3b$a=math.vec3();math.vec3();var zeroVec$1=math.vec3([0,-1,0]);var tempQuat=math.vec4([0,0,0,1]);/**
6852
+ */},{key:"destroy",value:function destroy(){_get(_getPrototypeOf(Texture.prototype),"destroy",this).call(this);if(this._state.texture){this._state.texture.destroy();}this._state.destroy();stats.memory.textures--;}}]);return Texture;}(Component);var tempVec3$8=math.vec3();var tempVec3b$a=math.vec3();math.vec3();var zeroVec$1=math.vec3([0,-1,0]);var tempQuat=math.vec4([0,0,0,1]);/**
6853
6853
  * @desc A plane-shaped 3D object containing a bitmap image.
6854
6854
  *
6855
6855
  * Use ````ImagePlane```` to embed bitmap images in your scenes.
@@ -7085,7 +7085,7 @@ if(cfg.src){_this26.src=cfg.src;// Image file
7085
7085
  * Default is ````true````.
7086
7086
  *
7087
7087
  * @type {Boolean}
7088
- */,set:function set(dir){this._dir.set(dir||[0,0,-1]);if(dir){var origin=this.scene.center;var negDir=[-this._dir[0],-this._dir[1],-this._dir[2]];math.subVec3(origin,this.position,tempVec3$7);var dist=-math.dotVec3(negDir,tempVec3$7);math.normalizeVec3(negDir);math.mulVec3Scalar(negDir,dist,tempVec3b$a);math.vec3PairToQuaternion(zeroVec$1,dir,tempQuat);this._node.quaternion=tempQuat;}}},{key:"collidable",get:/**
7088
+ */,set:function set(dir){this._dir.set(dir||[0,0,-1]);if(dir){var origin=this.scene.center;var negDir=[-this._dir[0],-this._dir[1],-this._dir[2]];math.subVec3(origin,this.position,tempVec3$8);var dist=-math.dotVec3(negDir,tempVec3$8);math.normalizeVec3(negDir);math.mulVec3Scalar(negDir,dist,tempVec3b$a);math.vec3PairToQuaternion(zeroVec$1,dir,tempQuat);this._node.quaternion=tempQuat;}}},{key:"collidable",get:/**
7089
7089
  * Gets if this ````ImagePlane```` is included in boundary calculations.
7090
7090
  *
7091
7091
  * Default is ````true````.
@@ -9136,7 +9136,7 @@ var outColor=programVariables.createOutput("vec4","outColor");var encodeFloat=pr
9136
9136
  appendFragmentOutputs:function appendFragmentOutputs(src,getGammaOutputExpression,gl_FragCoord,sliceColorOr){src.push("".concat(outColor," = ").concat(isPointsOrLines?silhouetteColor:sliceColorOr("vec4(".concat(silhouetteColor,".rgb, min(").concat(silhouetteColor,".a, ").concat(vAlpha,"))")),";"));}};};var SnapProgram=function SnapProgram(programVariables,geometry,isSnapInit,isPoints){var layerNumber=programVariables.createUniform("int","layerNumber",function(set,state){return set(state.legacyFrameCtx.snapPickLayerParams.length);});var coordinateScaler=programVariables.createUniform("vec3","coordinateScaler",function(set,state){return set(state.legacyFrameCtx.snapPickCoordinateScale);});var vWorldPosition=programVariables.createVarying("vec3","vWorldPosition",function(){return"".concat(geometry.attributes.position.world,".xyz");});var vPickColor=programVariables.createVarying("vec4","vPickColor",function(){return geometry.attributes.pickColor;});// Using `flat` causes an instability - see XEOK-385 and XEOK-401
9137
9137
  var outCoords=programVariables.createOutput("highp ivec4","outCoords",0);var outNormal=programVariables.createOutput("highp ivec4","outNormal",1);var outPickColor=programVariables.createOutput("lowp uvec4","outPickColor",2);return{programName:isSnapInit?"SnapInit":"Snap",// Improves occlusion accuracy at distance
9138
9138
  getLogDepth:function getLogDepth(vFragDepth){return isSnapInit?"".concat(vFragDepth," + length(vec2(dFdx(").concat(vFragDepth,"), dFdy(").concat(vFragDepth,")))"):vFragDepth;},renderPassFlag:3,// PICK
9139
- vertexCullX:!isSnapInit&&"2.0",dontCullOnAlphaZero:!isSnapInit,appendFragmentOutputs:function appendFragmentOutputs(src){src.push("".concat(outCoords," = ivec4(").concat(vWorldPosition," * ").concat(coordinateScaler,".xyz, ").concat(isSnapInit?"-":"").concat(layerNumber,");"));if(isSnapInit){src.push("".concat(outNormal," = ").concat(isPoints?"ivec4(1.0)":"ivec4(normalize(cross(dFdx(".concat(vWorldPosition,"), dFdy(").concat(vWorldPosition,"))) * float(").concat(math.MAX_INT,"), 1.0)"),";"));src.push("".concat(outPickColor," = uvec4(").concat(vPickColor,");"));}}};};var tempVec2=math.vec2();var tempVec3$6=math.vec3();var tempVec4$1=math.vec4();var tempMat4$2=math.mat4();var vec3zero=math.vec3([0,0,0]);var RENDER_PASSES={// Skipped - suppress rendering
9139
+ vertexCullX:!isSnapInit&&"2.0",dontCullOnAlphaZero:!isSnapInit,appendFragmentOutputs:function appendFragmentOutputs(src){src.push("".concat(outCoords," = ivec4(").concat(vWorldPosition," * ").concat(coordinateScaler,".xyz, ").concat(isSnapInit?"-":"").concat(layerNumber,");"));if(isSnapInit){src.push("".concat(outNormal," = ").concat(isPoints?"ivec4(1.0)":"ivec4(normalize(cross(dFdx(".concat(vWorldPosition,"), dFdy(").concat(vWorldPosition,"))) * float(").concat(math.MAX_INT,"), 1.0)"),";"));src.push("".concat(outPickColor," = uvec4(").concat(vPickColor,");"));}}};};var tempVec2=math.vec2();var tempVec3$7=math.vec3();var tempVec4$1=math.vec4();var tempMat4$2=math.mat4();var vec3zero=math.vec3([0,0,0]);var RENDER_PASSES={// Skipped - suppress rendering
9140
9140
  NOT_RENDERED:0,// Normal rendering - mutually exclusive modes
9141
9141
  COLOR_OPAQUE:1,COLOR_TRANSPARENT:2,// Emphasis silhouette rendering - mutually exclusive modes
9142
9142
  SILHOUETTE_HIGHLIGHTED:3,SILHOUETTE_SELECTED:4,SILHOUETTE_XRAYED:5,// Edges rendering - mutually exclusive modes
@@ -9144,7 +9144,7 @@ EDGES_COLOR_OPAQUE:6,EDGES_COLOR_TRANSPARENT:7,EDGES_HIGHLIGHTED:8,EDGES_SELECTE
9144
9144
  PICK:11};var safeInvVec3=function safeInvVec3(v){return[math.safeInv(v[0]),math.safeInv(v[1]),math.safeInv(v[2])];};var isPerspectiveMatrix=function isPerspectiveMatrix(m){return"(".concat(m,"[2][3] == - 1.0)");};var getColSilhEdgePickFlags=function getColSilhEdgePickFlags(flags,transparent,hasEdges,scene,dst){var visible=!!(flags&ENTITY_FLAGS.VISIBLE);var xrayed=!!(flags&ENTITY_FLAGS.XRAYED);var highlighted=!!(flags&ENTITY_FLAGS.HIGHLIGHTED);var selected=!!(flags&ENTITY_FLAGS.SELECTED);var edges=!!(flags&ENTITY_FLAGS.EDGES);var pickable=!!(flags&ENTITY_FLAGS.PICKABLE);var culled=!!(flags&ENTITY_FLAGS.CULLED);var colorFlag;if(!visible||culled||xrayed||highlighted&&!scene.highlightMaterial.glowThrough||selected&&!scene.selectedMaterial.glowThrough){colorFlag=RENDER_PASSES.NOT_RENDERED;}else{if(transparent){colorFlag=RENDER_PASSES.COLOR_TRANSPARENT;}else{colorFlag=RENDER_PASSES.COLOR_OPAQUE;}}var silhouetteFlag;if(!visible||culled){silhouetteFlag=RENDER_PASSES.NOT_RENDERED;}else if(selected){silhouetteFlag=RENDER_PASSES.SILHOUETTE_SELECTED;}else if(highlighted){silhouetteFlag=RENDER_PASSES.SILHOUETTE_HIGHLIGHTED;}else if(xrayed){silhouetteFlag=RENDER_PASSES.SILHOUETTE_XRAYED;}else{silhouetteFlag=RENDER_PASSES.NOT_RENDERED;}var edgeFlag=0;if(!hasEdges||!visible||culled){edgeFlag=RENDER_PASSES.NOT_RENDERED;}else if(selected){edgeFlag=RENDER_PASSES.EDGES_SELECTED;}else if(highlighted){edgeFlag=RENDER_PASSES.EDGES_HIGHLIGHTED;}else if(xrayed){edgeFlag=RENDER_PASSES.EDGES_XRAYED;}else if(edges){if(transparent){edgeFlag=RENDER_PASSES.EDGES_COLOR_TRANSPARENT;}else{edgeFlag=RENDER_PASSES.EDGES_COLOR_OPAQUE;}}else{edgeFlag=RENDER_PASSES.NOT_RENDERED;}var pickFlag=visible&&!culled&&pickable?RENDER_PASSES.PICK:RENDER_PASSES.NOT_RENDERED;dst[0]=colorFlag;dst[1]=silhouetteFlag;dst[2]=edgeFlag;dst[3]=pickFlag;};var getRenderers=function(){var cachedRenderers={};return function(scene,layerType,primitive,saoEnabled,pbrSupported,colorTextureSupported,surfaceHasNormals,makeRenderingAttributes){var primKey=primitive==="points"||primitive==="lines"?primitive:"triangles";var cacheKey=[layerType,primKey,!!saoEnabled,!!pbrSupported,!!colorTextureSupported,!!surfaceHasNormals].join(":");if(!(cacheKey in cachedRenderers)){cachedRenderers[cacheKey]={};}var cache=cachedRenderers[cacheKey];var sceneId=scene.id;if(!(sceneId in cache)){var gl=scene.canvas.gl;var wrapRenderer=function wrapRenderer(createProgramSetup,subGeometry,isEager){var instantiate=function instantiate(){var programVariablesState=createProgramVariablesState();var programVariables=programVariablesState.programVariables;var renderingAttributes=makeRenderingAttributes(programVariables,subGeometry);return createProgramSetup(programVariables,renderingAttributes.geometryParameters,function(programSetup,usePickClipPos){var pointsMaterial=scene.pointsMaterial;var setupPoints=primitive==="points"&&!subGeometry;var getHash=function getHash(){return[scene._sectionPlanesState.getHash()].concat(setupPoints?[pointsMaterial.hash]:[]).concat(programSetup.getHash?programSetup.getHash():[]).join(";");};var hash=getHash();var getValid=function getValid(){return hash===getHash();};var geometryParameters=renderingAttributes.geometryParameters;var incrementDrawState=programSetup.incrementDrawState;var isShadowProgram=programSetup.isShadowProgram;var attributes=geometryParameters.attributes;var worldPositionAttribute=attributes.position.world;var clipPos="clipPos";var _programVariablesStat3=programVariablesState.buildProgram(gl,layerType+" "+primitive+" "+programSetup.programName,{appendFragmentOutputs:programSetup.appendFragmentOutputs,cleanerEdges:programSetup.cleanerEdges,clipPos:clipPos,clippableTest:renderingAttributes.clippableTest,clippingCaps:programSetup.clippingCaps,crossSections:scene.crossSections,discardPoints:setupPoints&&pointsMaterial.roundPoints,getGammaFactor:scene.gammaOutput&&function(){return scene.gammaFactor;},getLogDepth:programSetup.getLogDepth,getPointSize:function(){var addends=[];if(setupPoints){var pointSize=programVariables.createUniform("float","pointSize",function(set){return set(pointsMaterial.pointSize);});if(pointsMaterial.perspectivePoints){var nearPlaneHeight=programVariables.createUniform("float","nearPlaneHeight",function(set,state){return set(state.legacyFrameCtx.nearPlaneHeight);});var minVal="".concat(Math.floor(pointsMaterial.minPerspectivePointSize),".0");var maxVal="".concat(Math.floor(pointsMaterial.maxPerspectivePointSize),".0");addends.push("clamp((".concat(nearPlaneHeight," * ").concat(pointSize,") / gl_Position.w, ").concat(minVal,", ").concat(maxVal,")"));}else{addends.push(pointSize);}}else if(subGeometry&&subGeometry.vertices){addends.push("1.0");}programSetup.incPointSizeBy10&&primitive==="points"&&addends.push("10.0");return addends.length>0&&function(){return addends.join(" + ");};}(),getVertexData:function getVertexData(){var colorA=attributes.color;var flag=attributes.flags[programSetup.renderPassFlag];var renderPass=programVariables.createUniform("int","renderPass",function(set,state){return set(state.renderPass);});var flagTest=isShadowProgram?"(".concat(flag," <= 0) || (").concat(colorA,".a < 1.0)"):"".concat(flag," != ").concat(renderPass);var afterFlagsColorLines=["if (".concat(flagTest,") {")," gl_Position = vec4(".concat(programSetup.vertexCullX||0.0,", 0.0, 0.0, 0.0);"),// Cull vertex
9145
9145
  " return;","}"].concat(!renderingAttributes.dontCullOnAlphaZero&&!programSetup.dontCullOnAlphaZero?["if (".concat(colorA,".a == 0.0) {")," gl_Position = vec4(3.0, 3.0, 3.0, 1.0);",// Cull vertex
9146
9146
  " return;","}"]:[]).concat(programSetup.filterIntensityRange&&primitive==="points"&&pointsMaterial.filterIntensity?function(){var intensityRange=programVariables.createUniform("vec2","intensityRange",function(set){tempVec2[0]=pointsMaterial.minIntensity;tempVec2[1]=pointsMaterial.maxIntensity;set(tempVec2);});return["if ((".concat(colorA,".a < ").concat(intensityRange,"[0]) || (").concat(colorA,".a > ").concat(intensityRange,"[1])) {")," gl_Position = vec4(0.0, 0.0, 0.0, 0.0);",// Cull vertex
9147
- " return;","}"];}():[]);var vertexData=[];renderingAttributes.ensureColorAndFlagAvailable&&renderingAttributes.ensureColorAndFlagAvailable(vertexData);afterFlagsColorLines.forEach(function(line){return vertexData.push(line);});renderingAttributes.appendVertexData(vertexData);var viewPosition=geometryParameters.attributes.position.view;vertexData.push("vec4 ".concat(viewPosition," = ").concat(geometryParameters.viewMatrix," * ").concat(worldPositionAttribute,";"));vertexData.push("vec4 ".concat(clipPos," = ").concat(geometryParameters.projMatrix," * ").concat(viewPosition,";"));return vertexData;},projMatrix:geometryParameters.projMatrix,sectionPlanesState:scene._sectionPlanesState,testPerspectiveForGl_FragDepth:primitive!=="points"&&primitive!=="lines"||subGeometry,usePickClipPos:usePickClipPos,worldPositionAttribute:worldPositionAttribute}),_programVariablesStat4=_slicedToArray(_programVariablesStat3,2),program=_programVariablesStat4[0],errors=_programVariablesStat4[1];if(errors){console.error(errors);return{getValid:getValid,destroy:function destroy(){},drawLayer:function drawLayer(frameCtx,layer,renderPass){}};}else{return{getValid:getValid,destroy:function destroy(){return program.destroy();},drawLayer:function drawLayer(frameCtx,layer,renderPass){if(frameCtx.lastProgramId!==program.id){frameCtx.lastProgramId=program.id;program.bind();}var origin=layer.origin;var model=layer.model;var viewParams=frameCtx.viewParams;var rtcOrigin=tempVec3$6;math.transformPoint3(model.matrix,origin,rtcOrigin);var viewMatrix=viewParams.viewMatrix;var projMatrix=viewParams.projMatrix;if(frameCtx.snapPickOrigin){frameCtx.snapPickOrigin[0]=rtcOrigin[0];frameCtx.snapPickOrigin[1]=rtcOrigin[1];frameCtx.snapPickOrigin[2]=rtcOrigin[2];}var state={legacyFrameCtx:frameCtx,layerTextureSet:layer.layerTextureSet,mesh:{layerIndex:layer.layerIndex,origin:rtcOrigin,renderFlags:{sectionPlanesActivePerLayer:model.renderFlags.sectionPlanesActivePerLayer}},renderPass:renderPass,view:{eye:viewParams.eye,far:viewParams.far,projMatrix:projMatrix,viewMatrix:math.compareVec3(rtcOrigin,vec3zero)?viewMatrix:createRTCViewMat(viewMatrix,rtcOrigin,tempMat4$2),viewNormalMatrix:viewParams.viewNormalMatrix}};program.inputSetters.setUniforms(frameCtx,state);layer.drawCalls[subGeometry?subGeometry.vertices?"drawVertices":"drawEdges":"drawSurface"](program.inputSetters.attributesHash,renderingAttributes.layerTypeInputs,{projMatrix:projMatrix,viewMatrix:math.compareVec3(rtcOrigin,vec3zero)?viewMatrix:createRTCViewMat(viewMatrix,rtcOrigin,tempMat4$2),viewNormalMatrix:viewParams.viewNormalMatrix,eye:viewParams.eye});if(incrementDrawState){frameCtx.drawElements++;}}};}});};var renderer=isEager&&instantiate();return{drawLayer:function drawLayer(frameCtx,layer,renderPass){if(!renderer){renderer=instantiate();}renderer.drawLayer(frameCtx,layer,renderPass);},revalidate:function revalidate(force){if(renderer&&(force||!renderer.getValid())){renderer.destroy();renderer=isEager&&instantiate();}}};};// Pre-initialize certain renderers that would otherwise be lazy-initialised on user interaction,
9147
+ " return;","}"];}():[]);var vertexData=[];renderingAttributes.ensureColorAndFlagAvailable&&renderingAttributes.ensureColorAndFlagAvailable(vertexData);afterFlagsColorLines.forEach(function(line){return vertexData.push(line);});renderingAttributes.appendVertexData(vertexData);var viewPosition=geometryParameters.attributes.position.view;vertexData.push("vec4 ".concat(viewPosition," = ").concat(geometryParameters.viewMatrix," * ").concat(worldPositionAttribute,";"));vertexData.push("vec4 ".concat(clipPos," = ").concat(geometryParameters.projMatrix," * ").concat(viewPosition,";"));return vertexData;},projMatrix:geometryParameters.projMatrix,sectionPlanesState:scene._sectionPlanesState,testPerspectiveForGl_FragDepth:primitive!=="points"&&primitive!=="lines"||subGeometry,usePickClipPos:usePickClipPos,worldPositionAttribute:worldPositionAttribute}),_programVariablesStat4=_slicedToArray(_programVariablesStat3,2),program=_programVariablesStat4[0],errors=_programVariablesStat4[1];if(errors){console.error(errors);return{getValid:getValid,destroy:function destroy(){},drawLayer:function drawLayer(frameCtx,layer,renderPass){}};}else{return{getValid:getValid,destroy:function destroy(){return program.destroy();},drawLayer:function drawLayer(frameCtx,layer,renderPass){if(frameCtx.lastProgramId!==program.id){frameCtx.lastProgramId=program.id;program.bind();}var origin=layer.origin;var model=layer.model;var viewParams=frameCtx.viewParams;var rtcOrigin=tempVec3$7;math.transformPoint3(model.matrix,origin,rtcOrigin);var viewMatrix=viewParams.viewMatrix;var projMatrix=viewParams.projMatrix;if(frameCtx.snapPickOrigin){frameCtx.snapPickOrigin[0]=rtcOrigin[0];frameCtx.snapPickOrigin[1]=rtcOrigin[1];frameCtx.snapPickOrigin[2]=rtcOrigin[2];}var state={legacyFrameCtx:frameCtx,layerTextureSet:layer.layerTextureSet,mesh:{layerIndex:layer.layerIndex,origin:rtcOrigin,renderFlags:{sectionPlanesActivePerLayer:model.renderFlags.sectionPlanesActivePerLayer}},renderPass:renderPass,view:{eye:viewParams.eye,far:viewParams.far,projMatrix:projMatrix,viewMatrix:math.compareVec3(rtcOrigin,vec3zero)?viewMatrix:createRTCViewMat(viewMatrix,rtcOrigin,tempMat4$2),viewNormalMatrix:viewParams.viewNormalMatrix}};program.inputSetters.setUniforms(frameCtx,state);layer.drawCalls[subGeometry?subGeometry.vertices?"drawVertices":"drawEdges":"drawSurface"](program.inputSetters.attributesHash,renderingAttributes.layerTypeInputs,{projMatrix:projMatrix,viewMatrix:math.compareVec3(rtcOrigin,vec3zero)?viewMatrix:createRTCViewMat(viewMatrix,rtcOrigin,tempMat4$2),viewNormalMatrix:viewParams.viewNormalMatrix,eye:viewParams.eye});if(incrementDrawState){frameCtx.drawElements++;}}};}});};var renderer=isEager&&instantiate();return{drawLayer:function drawLayer(frameCtx,layer,renderPass){if(!renderer){renderer=instantiate();}renderer.drawLayer(frameCtx,layer,renderPass);},revalidate:function revalidate(force){if(renderer&&(force||!renderer.getValid())){renderer.destroy();renderer=isEager&&instantiate();}}};};// Pre-initialize certain renderers that would otherwise be lazy-initialised on user interaction,
9148
9148
  // such as picking or emphasis, so that there is no delay when user first begins interacting with the viewer.
9149
9149
  var eager=function eager(createProgramSetup,subGeometry){return wrapRenderer(createProgramSetup,subGeometry,true);};var lazy=function lazy(createProgramSetup,subGeometry){return wrapRenderer(createProgramSetup,subGeometry,false);};var makeColorProgram=function makeColorProgram(vars,geo,lights,sao){return ColorProgram(vars,geo,scene.logarithmicDepthBufferEnabled,lights,sao,primitive);};var makePickDepthProgram=function makePickDepthProgram(vars,geo,c){return c(PickDepthProgram(vars,geo,scene.logarithmicDepthBufferEnabled),true);};var makePickMeshProgram=function makePickMeshProgram(vars,geo,c){return c(PickMeshProgram(vars,geo,scene.logarithmicDepthBufferEnabled),true);};var makePickNormalsProgram=function makePickNormalsProgram(vars,geo,c,isFlat){return c(PickNormalsProgram(vars,geo,scene.logarithmicDepthBufferEnabled,isFlat),true);};var makeSnapProgram=function makeSnapProgram(vars,geo,c,isSnapInit,isPoints){return c(SnapProgram(vars,geo,isSnapInit,isPoints),true);};if(primitive==="points"){cache[sceneId]={colorRenderers:{"sao-":{"vertex":lazy(function(vars,geo,c){return c(makeColorProgram(vars,geo,null,null));})}},occlusionRenderer:lazy(function(vars,geo,c){return c(OcclusionProgram(vars,scene.logarithmicDepthBufferEnabled));}),pickDepthRenderer:lazy(makePickDepthProgram),pickMeshRenderer:lazy(makePickMeshProgram),// VBOBatchingPointsShadowRenderer has been implemented by 14e973df6268369b00baef60e468939e062ac320,
9150
9150
  // but never used (and probably not maintained), as opposed to VBOInstancingPointsShadowRenderer in the same commit
@@ -9255,7 +9255,7 @@ var renderer=this._renderers.depthRenderer;if(renderer&&this._numTransparentLaye
9255
9255
  */var INDICES_EDGE_INDICES_ALIGNEMENT_SIZE=8;/**
9256
9256
  * Number of maximum allowed per-object flags update per render frame
9257
9257
  * before switching to batch update mode.
9258
- */var MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE=10;var tempVec3$5=math.vec3();var tempVec3a$e=math.vec3();var tempVec4a$b=math.vec4();math.vec4();var tempMat4a=new Float32Array(16);var tempUint8Array4$1=new Uint8Array(4);var DEFAULT_MATRIX$1=math.identityMat4();/**
9258
+ */var MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE=10;var tempVec3$6=math.vec3();var tempVec3a$e=math.vec3();var tempVec4a$b=math.vec4();math.vec4();var tempMat4a=new Float32Array(16);var tempUint8Array4$1=new Uint8Array(4);var DEFAULT_MATRIX$1=math.identityMat4();/**
9259
9259
  * @private
9260
9260
  */var DTXLayer=/*#__PURE__*/function(_Layer){_inherits(DTXLayer,_Layer);var _super25=_createSuper(DTXLayer);function DTXLayer(model,primitive,origin){var _this40;_classCallCheck(this,DTXLayer);_this40=_super25.call(this,model,primitive,origin);dataTextureRamStats.numberOfLayers++;_this40._sortId="TriDTX-".concat(dataTextureRamStats.numberOfLayers);var gl=model.scene.canvas.gl;var geometryData=function geometryData(indicesStatsProp,edgesStatsProp){var indicesBuffer=[];var lenIndices=0;var perTriangleNumberPortionId=[];var numIndices=0;var edgeIndicesBuffer=[];var lenEdgeIndices=0;var perEdgeNumberPortionId=[];var numEdgeIndices=0;return{len:function len(){return numIndices;},accumulateIndices:function accumulateIndices(indices,edgeIndices){var accIndicesSubPortion=indices&&indices.length>0&&function(){var indicesBase=lenIndices/3;lenIndices+=indices.length;indicesBuffer.push(indices);var numTriangles=indices.length/3;return function(subPortionId){var currentNumIndices=numIndices;numIndices+=numTriangles*3;buffer.perObjectIndexBaseOffsets.push(currentNumIndices/3-indicesBase);for(var _i100=0;_i100<numTriangles;_i100+=INDICES_EDGE_INDICES_ALIGNEMENT_SIZE){perTriangleNumberPortionId.push(subPortionId);}dataTextureRamStats[indicesStatsProp]+=numTriangles;dataTextureRamStats.totalPolygons+=numTriangles;};}();var accEdgesSubPortion=edgeIndices&&function(){var edgeIndicesBase=lenEdgeIndices/2;lenEdgeIndices+=edgeIndices.length;edgeIndicesBuffer.push(edgeIndices);var numEdges=edgeIndices.length/2;return function(subPortionId){var currentNumEdgeIndices=numEdgeIndices;numEdgeIndices+=numEdges*2;buffer.perObjectEdgeIndexBaseOffsets.push(currentNumEdgeIndices/2-edgeIndicesBase);for(var _i101=0;_i101<numEdges;_i101+=INDICES_EDGE_INDICES_ALIGNEMENT_SIZE){perEdgeNumberPortionId.push(subPortionId);}dataTextureRamStats[edgesStatsProp]+=numEdges;dataTextureRamStats.totalEdges+=numEdges;};}();dataTextureRamStats.numberOfGeometries++;return{numTriangles:indices?indices.length/3:0,accumulateSubPortionId:function accumulateSubPortionId(subPortionId){accIndicesSubPortion&&accIndicesSubPortion(subPortionId);accEdgesSubPortion&&accEdgesSubPortion(subPortionId);}};},createDrawers:function createDrawers(createTextureForSingleItems,indicesType){var createTextureForPackedPortionIds=function createTextureForPackedPortionIds(portionIdsArray,defaultIfEmpty){return portionIdsArray.length>0?createTextureForSingleItems([portionIdsArray],portionIdsArray.length,1,gl.UNSIGNED_SHORT,"sizeDataTexturePortionIds"):defaultIfEmpty;};// Texture that holds the PortionId that corresponds to a given polygon-id.
9261
9261
  var portionIdsTexture=createTextureForPackedPortionIds(perTriangleNumberPortionId,{texture:null});// Texture that holds the unique-vertex-indices.
@@ -9373,7 +9373,7 @@ this._bucketGeometries=null;this._buffer.geometry8Bits._clearToOptimizeGC();this
9373
9373
  * flags/flags2 set since the previous invocation of `beginDeferredFlags`.
9374
9374
  */deferredSetFlagsActive=false;deferredSetFlagsDirty=false;texturePerObjectColorsAndFlagsData.reloadData();}numUpdatesInFrame=0;});var forEachSubPortionId=function forEachSubPortionId(portionId,cb){var subPortionIds=portionToSubPortionsMap[portionId];if(!subPortionIds){model.error("portion not found: "+portionId);}else{for(var _i104=0,len=subPortionIds.length;_i104<len;_i104++){cb(subPortionIds[_i104]);}}};var setPortionColorsAndFlags=function setPortionColorsAndFlags(subPortionId,offset,data,deferred){var defer=deferredSetFlagsActive||deferred;if(defer){deferredSetFlagsDirty=true;}else if(++numUpdatesInFrame>=MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE){beginDeferredFlags();// Subsequent flags updates now deferred
9375
9375
  }texturePerObjectColorsAndFlagsData.setData(data,subPortionId,offset,!defer);};var setFlags2=function setFlags2(portionId,flags){var deferred=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;tempUint8Array4$1.set([flags&ENTITY_FLAGS.CLIPPABLE?255:0,0,1,2]);forEachSubPortionId(portionId,function(subPortionId){return setPortionColorsAndFlags(subPortionId,3,tempUint8Array4$1,deferred);});};return{edgesColorOpaqueAllowed:function edgesColorOpaqueAllowed(){if(scene.logarithmicDepthBufferEnabled){if(!scene._loggedWarning){console.log("Edge enhancement for SceneModel data texture layers currently disabled with logarithmic depth buffer");scene._loggedWarning=true;}return false;}else{return true;}},sortId:sortId,setClippableFlags:setFlags2,setFlags:function setFlags(portionId,flags,transparent){var deferred=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;getColSilhEdgePickFlags(flags,transparent,true,scene,tempUint8Array4$1);forEachSubPortionId(portionId,function(subPortionId){return setPortionColorsAndFlags(subPortionId,2,tempUint8Array4$1,deferred);});},setFlags2:setFlags2,setDeferredFlags:function setDeferredFlags(){},setColor:function setColor(portionId,color){tempUint8Array4$1.set(color);forEachSubPortionId(portionId,function(subPortionId){return setPortionColorsAndFlags(subPortionId,0,tempUint8Array4$1,false);});},setMatrix:function setMatrix(portionId,matrix){forEachSubPortionId(portionId,function(subPortionId){var defer=deferredSetFlagsActive;if(defer){deferredSetFlagsDirty=true;}else if(++numUpdatesInFrame>=MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE){beginDeferredFlags();// Subsequent flags updates now deferred
9376
- }tempMat4a.set(matrix);texturePerObjectInstanceMatricesData.setData(tempMat4a,subPortionId,0,!defer);});},setOffset:function setOffset(portionId,offset){/* NOT COMPLETE */},getEachIndex:function getEachIndex(portionId,callback){if(subPortionReadableGeometries){forEachSubPortionId(portionId,function(subPortionId){return subPortionReadableGeometries[subPortionId].indices.forEach(function(i){return callback(i);});});}},getEachVertex:function getEachVertex(portionId,callback){if(subPortionReadableGeometries){forEachSubPortionId(portionId,function(subPortionId){var subPortionReadableGeometry=subPortionReadableGeometries[subPortionId];var positions=subPortionReadableGeometry.positionsCompressed;var positionsDecodeMatrix=subPortionReadableGeometry.positionsDecodeMatrix;var worldPos=tempVec4a$b;for(var _i105=0,len=positions.length;_i105<len;_i105+=3){worldPos[0]=positions[_i105];worldPos[1]=positions[_i105+1];worldPos[2]=positions[_i105+2];worldPos[3]=1.0;math.decompressPosition(worldPos,positionsDecodeMatrix);math.mulMat4v4(model.worldMatrix,worldPos,worldPos);math.addVec3(origin,worldPos,worldPos);callback(worldPos);}});}},precisionRayPickSurface:function precisionRayPickSurface(portionId,worldRayOrigin,worldRayDir,worldSurfacePos,worldNormal){return false;},renderers:getRenderers(scene,"dtx",primitive,model.saoEnabled,false,false,true,function(programVariables,subGeometry){return makeDTXRenderingAttributes(programVariables,!subGeometry);}),drawCalls:function(){var drawer=function drawer(drawCall){var setInputValue=function setInputValue(input,value){return input.setInputValue&&input.setInputValue(value);};return function(attributesHash,layerTypeInputs,viewState){setInputValue(layerTypeInputs.worldMatrix,model.rotationMatrix);setInputValue(layerTypeInputs.viewMatrix,viewState.viewMatrix);setInputValue(layerTypeInputs.projMatrix,viewState.projMatrix);var rtcOrigin=math.transformPoint3(model.matrix,origin,tempVec3$5);setInputValue(layerTypeInputs.uCameraEyeRtc,math.subVec3(viewState.eye,rtcOrigin,tempVec3a$e));setInputValue(layerTypeInputs.perObjPosDecode,texturePerObjectPositionsDecodeMatrix);setInputValue(layerTypeInputs.perVertIdCoords,texturePerVertexIdCoordinates);setInputValue(layerTypeInputs.perObjColsFlags,texturePerObjectColorsAndFlags);setInputValue(layerTypeInputs.perObjectMatrix,texturePerObjectInstanceMatrices);drawCall(layerTypeInputs);};};var vertEdgesDrawer=function vertEdgesDrawer(glMode){return drawer(function(layerTypeInputs){draw8.edges(layerTypeInputs,glMode);draw16.edges(layerTypeInputs,glMode);draw32.edges(layerTypeInputs,glMode);});};return{drawVertices:vertEdgesDrawer(gl.POINTS),drawEdges:vertEdgesDrawer(gl.LINES),drawSurface:drawer(function(layerTypeInputs){var glMode=gl.TRIANGLES;draw8.indices(layerTypeInputs,glMode);draw16.indices(layerTypeInputs,glMode);draw32.indices(layerTypeInputs,glMode);})};}(),destroy:function destroy(){if(!destroyed){scene.off(onSceneRendering);destroyed=true;}}};}}]);return DTXLayer;}(Layer);var createBindableDataTexture=function createBindableDataTexture(gl,entitiesCnt,entitySize,type,entitiesPerRow,populateTexArray,statsProp,exposeData){if(entitySize>4&&entitySize%4>0){throw"Unhandled data size "+entitySize;}var pixelsPerEntity=Math.ceil(entitySize/4);var pixelWidth=entitySize/pixelsPerEntity;var _ref5=function(){switch(type){case gl.UNSIGNED_BYTE:return[Uint8Array].concat(_toConsumableArray(pixelWidth===1?[gl.R8UI,gl.RED_INTEGER]:pixelWidth===2?[gl.RG8UI,gl.RG_INTEGER]:pixelWidth===3?[gl.RGB8UI,gl.RGB_INTEGER]:[gl.RGBA8UI,gl.RGBA_INTEGER]));case gl.UNSIGNED_SHORT:return[Uint16Array].concat(_toConsumableArray(pixelWidth===1?[gl.R16UI,gl.RED_INTEGER]:pixelWidth===2?[gl.RG16UI,gl.RG_INTEGER]:pixelWidth===3?[gl.RGB16UI,gl.RGB_INTEGER]:[gl.RGBA16UI,gl.RGBA_INTEGER]));case gl.UNSIGNED_INT:return[Uint32Array].concat(_toConsumableArray(pixelWidth===1?[gl.R32UI,gl.RED_INTEGER]:pixelWidth===2?[gl.RG32UI,gl.RG_INTEGER]:pixelWidth===3?[gl.RGB32UI,gl.RGB_INTEGER]:[gl.RGBA32UI,gl.RGBA_INTEGER]));case gl.FLOAT:return[Float32Array].concat(_toConsumableArray(pixelWidth===1?[gl.R32F,gl.RED]:pixelWidth===2?[gl.RG32F,gl.RG]:pixelWidth===3?[gl.RGB32F,gl.RGB]:[gl.RGBA32F,gl.RGBA]));default:throw"Unhandled data type "+type;}}(),_ref6=_slicedToArray(_ref5,3),arrayType=_ref6[0],internalFormat=_ref6[1],format=_ref6[2];var textureWidth=entitiesPerRow*pixelsPerEntity;var textureHeight=Math.ceil(entitiesCnt/entitiesPerRow);if(textureHeight===0){throw"texture height===0";}var texArray=new arrayType(textureWidth*textureHeight*pixelWidth);dataTextureRamStats[statsProp]+=texArray.byteLength;dataTextureRamStats.numberOfTextures++;populateTexArray(texArray);var texture=gl.createTexture();gl.bindTexture(gl.TEXTURE_2D,texture);gl.texStorage2D(gl.TEXTURE_2D,1,internalFormat,textureWidth,textureHeight);gl.texSubImage2D(gl.TEXTURE_2D,0,0,0,textureWidth,textureHeight,format,type,texArray);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.bindTexture(gl.TEXTURE_2D,null);if(!exposeData){texArray=null;// See the comment related to XCD-408 and XCD-424 above.
9376
+ }tempMat4a.set(matrix);texturePerObjectInstanceMatricesData.setData(tempMat4a,subPortionId,0,!defer);});},setOffset:function setOffset(portionId,offset){/* NOT COMPLETE */},getEachIndex:function getEachIndex(portionId,callback){if(subPortionReadableGeometries){forEachSubPortionId(portionId,function(subPortionId){return subPortionReadableGeometries[subPortionId].indices.forEach(function(i){return callback(i);});});}},getEachVertex:function getEachVertex(portionId,callback){if(subPortionReadableGeometries){forEachSubPortionId(portionId,function(subPortionId){var subPortionReadableGeometry=subPortionReadableGeometries[subPortionId];var positions=subPortionReadableGeometry.positionsCompressed;var positionsDecodeMatrix=subPortionReadableGeometry.positionsDecodeMatrix;var worldPos=tempVec4a$b;for(var _i105=0,len=positions.length;_i105<len;_i105+=3){worldPos[0]=positions[_i105];worldPos[1]=positions[_i105+1];worldPos[2]=positions[_i105+2];worldPos[3]=1.0;math.decompressPosition(worldPos,positionsDecodeMatrix);math.mulMat4v4(model.worldMatrix,worldPos,worldPos);math.addVec3(origin,worldPos,worldPos);callback(worldPos);}});}},precisionRayPickSurface:function precisionRayPickSurface(portionId,worldRayOrigin,worldRayDir,worldSurfacePos,worldNormal){return false;},renderers:getRenderers(scene,"dtx",primitive,model.saoEnabled,false,false,true,function(programVariables,subGeometry){return makeDTXRenderingAttributes(programVariables,!subGeometry);}),drawCalls:function(){var drawer=function drawer(drawCall){var setInputValue=function setInputValue(input,value){return input.setInputValue&&input.setInputValue(value);};return function(attributesHash,layerTypeInputs,viewState){setInputValue(layerTypeInputs.worldMatrix,model.rotationMatrix);setInputValue(layerTypeInputs.viewMatrix,viewState.viewMatrix);setInputValue(layerTypeInputs.projMatrix,viewState.projMatrix);var rtcOrigin=math.transformPoint3(model.matrix,origin,tempVec3$6);setInputValue(layerTypeInputs.uCameraEyeRtc,math.subVec3(viewState.eye,rtcOrigin,tempVec3a$e));setInputValue(layerTypeInputs.perObjPosDecode,texturePerObjectPositionsDecodeMatrix);setInputValue(layerTypeInputs.perVertIdCoords,texturePerVertexIdCoordinates);setInputValue(layerTypeInputs.perObjColsFlags,texturePerObjectColorsAndFlags);setInputValue(layerTypeInputs.perObjectMatrix,texturePerObjectInstanceMatrices);drawCall(layerTypeInputs);};};var vertEdgesDrawer=function vertEdgesDrawer(glMode){return drawer(function(layerTypeInputs){draw8.edges(layerTypeInputs,glMode);draw16.edges(layerTypeInputs,glMode);draw32.edges(layerTypeInputs,glMode);});};return{drawVertices:vertEdgesDrawer(gl.POINTS),drawEdges:vertEdgesDrawer(gl.LINES),drawSurface:drawer(function(layerTypeInputs){var glMode=gl.TRIANGLES;draw8.indices(layerTypeInputs,glMode);draw16.indices(layerTypeInputs,glMode);draw32.indices(layerTypeInputs,glMode);})};}(),destroy:function destroy(){if(!destroyed){scene.off(onSceneRendering);destroyed=true;}}};}}]);return DTXLayer;}(Layer);var createBindableDataTexture=function createBindableDataTexture(gl,entitiesCnt,entitySize,type,entitiesPerRow,populateTexArray,statsProp,exposeData){if(entitySize>4&&entitySize%4>0){throw"Unhandled data size "+entitySize;}var pixelsPerEntity=Math.ceil(entitySize/4);var pixelWidth=entitySize/pixelsPerEntity;var _ref5=function(){switch(type){case gl.UNSIGNED_BYTE:return[Uint8Array].concat(_toConsumableArray(pixelWidth===1?[gl.R8UI,gl.RED_INTEGER]:pixelWidth===2?[gl.RG8UI,gl.RG_INTEGER]:pixelWidth===3?[gl.RGB8UI,gl.RGB_INTEGER]:[gl.RGBA8UI,gl.RGBA_INTEGER]));case gl.UNSIGNED_SHORT:return[Uint16Array].concat(_toConsumableArray(pixelWidth===1?[gl.R16UI,gl.RED_INTEGER]:pixelWidth===2?[gl.RG16UI,gl.RG_INTEGER]:pixelWidth===3?[gl.RGB16UI,gl.RGB_INTEGER]:[gl.RGBA16UI,gl.RGBA_INTEGER]));case gl.UNSIGNED_INT:return[Uint32Array].concat(_toConsumableArray(pixelWidth===1?[gl.R32UI,gl.RED_INTEGER]:pixelWidth===2?[gl.RG32UI,gl.RG_INTEGER]:pixelWidth===3?[gl.RGB32UI,gl.RGB_INTEGER]:[gl.RGBA32UI,gl.RGBA_INTEGER]));case gl.FLOAT:return[Float32Array].concat(_toConsumableArray(pixelWidth===1?[gl.R32F,gl.RED]:pixelWidth===2?[gl.RG32F,gl.RG]:pixelWidth===3?[gl.RGB32F,gl.RGB]:[gl.RGBA32F,gl.RGBA]));default:throw"Unhandled data type "+type;}}(),_ref6=_slicedToArray(_ref5,3),arrayType=_ref6[0],internalFormat=_ref6[1],format=_ref6[2];var textureWidth=entitiesPerRow*pixelsPerEntity;var textureHeight=Math.ceil(entitiesCnt/entitiesPerRow);if(textureHeight===0){throw"texture height===0";}var texArray=new arrayType(textureWidth*textureHeight*pixelWidth);dataTextureRamStats[statsProp]+=texArray.byteLength;dataTextureRamStats.numberOfTextures++;populateTexArray(texArray);var texture=gl.createTexture();gl.bindTexture(gl.TEXTURE_2D,texture);gl.texStorage2D(gl.TEXTURE_2D,1,internalFormat,textureWidth,textureHeight);gl.texSubImage2D(gl.TEXTURE_2D,0,0,0,textureWidth,textureHeight,format,type,texArray);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.bindTexture(gl.TEXTURE_2D,null);if(!exposeData){texArray=null;// See the comment related to XCD-408 and XCD-424 above.
9377
9377
  }return{// called by createSampler::bindTexture
9378
9378
  bind:function bind(unit){gl.activeTexture(gl["TEXTURE"+unit]);gl.bindTexture(gl.TEXTURE_2D,texture);return true;},unbind:function unbind(unit){// This `unbind` method is ignored at the moment to allow avoiding
9379
9379
  // to rebind same texture already bound to a texture unit.
@@ -14411,7 +14411,7 @@ return outside;});if(!culled){var origin=occlusionLayer.origin;viewMatrix.setInp
14411
14411
  * Sets visibilities of {@link Marker}s according to whether or not they are obscured by anything in the render buffer.
14412
14412
  */},{key:"doOcclusionTest",value:function doOcclusionTest(readColorPixel){this._occlusionLayersList.forEach(function(occlusionLayer){for(var _i198=0;_i198<occlusionLayer.lenOcclusionTestList;_i198++){var j=_i198*2;var _color3=readColorPixel(occlusionLayer.pixels[j],occlusionLayer.pixels[j+1]);occlusionLayer.occlusionTestList[_i198]._setVisible(math.compareVec3(MARKER_COLOR,_color3));}});}/**
14413
14413
  * Destroys this OcclusionTester.
14414
- */},{key:"destroy",value:function destroy(){if(!this.destroyed){this._occlusionLayersList.forEach(function(layer){return layer.destroy();});this._drawable&&this._drawable.destroy();this._scene.camera.off(this._onCameraViewMatrix);this._scene.camera.off(this._onCameraProjMatrix);this._scene.canvas.off(this._onCanvasBoundary);this.destroyed=true;}}}]);return OcclusionTester;}();var vec3_0=math.vec3([0,0,0]);var iota=function iota(n){var ret=[];for(var _i199=0;_i199<n;++_i199){ret.push(_i199);}return ret;};var tempPlanes=iota(6).map(function(){return math.vec4();});var tempVec4=math.vec4();var bitShiftScreenZ=math.vec4([1.0/(256.0*256.0*256.0*256.0),1.0/(256.0*256.0*256.0),1.0/(256.0*256.0),1.0/256.0]);var pixelToInt=function pixelToInt(pix){return pix[0]+(pix[1]<<8)+(pix[2]<<16)+(pix[3]<<24);};var toWorldNormal=function toWorldNormal(n){return math.normalizeVec3(math.divVec3Scalar(n,math.MAX_INT,math.vec3()));};var toWorldPos=function toWorldPos(p,origin,scale){return math.vec3([p[0]*scale[0]+origin[0],p[1]*scale[1]+origin[1],p[2]*scale[2]+origin[2]]);};var makeFrustumAABBIntersectionTest=function makeFrustumAABBIntersectionTest(camera){var m=math.mat4();math.mulMat4(camera.projMatrix,camera.viewMatrix,m);for(var _i200=0;_i200<3;++_i200){tempPlanes[_i200*2+0][0]=m[3]+m[_i200];tempPlanes[_i200*2+0][1]=m[7]+m[_i200+4];tempPlanes[_i200*2+0][2]=m[11]+m[_i200+8];tempPlanes[_i200*2+0][3]=m[15]+m[_i200+12];tempPlanes[_i200*2+1][0]=m[3]-m[_i200];tempPlanes[_i200*2+1][1]=m[7]-m[_i200+4];tempPlanes[_i200*2+1][2]=m[11]-m[_i200+8];tempPlanes[_i200*2+1][3]=m[15]-m[_i200+12];}// Normalize each plane
14414
+ */},{key:"destroy",value:function destroy(){if(!this.destroyed){this._occlusionLayersList.forEach(function(layer){return layer.destroy();});this._drawable&&this._drawable.destroy();this._scene.camera.off(this._onCameraViewMatrix);this._scene.camera.off(this._onCameraProjMatrix);this._scene.canvas.off(this._onCanvasBoundary);this.destroyed=true;}}}]);return OcclusionTester;}();var vec3_0=math.vec3([0,0,0]);var iota=function iota(n){var ret=[];for(var _i199=0;_i199<n;++_i199){ret.push(_i199);}return ret;};var tempPlanes=iota(6).map(function(){return math.vec4();});var tempVec3$5=math.vec3();var tempVec4=math.vec4();var bitShiftScreenZ=math.vec4([1.0/(256.0*256.0*256.0*256.0),1.0/(256.0*256.0*256.0),1.0/(256.0*256.0),1.0/256.0]);var pixelToInt=function pixelToInt(pix){return pix[0]+(pix[1]<<8)+(pix[2]<<16)+(pix[3]<<24);};var toWorldNormal=function toWorldNormal(n){return math.normalizeVec3(math.divVec3Scalar(n,math.MAX_INT,math.vec3()));};var toWorldPos=function toWorldPos(p,origin,scale){return math.vec3([p[0]*scale[0]+origin[0],p[1]*scale[1]+origin[1],p[2]*scale[2]+origin[2]]);};var makeFrustumAABBIntersectionTest=function makeFrustumAABBIntersectionTest(camera){var m=math.mat4();math.mulMat4(camera.projMatrix,camera.viewMatrix,m);for(var _i200=0;_i200<3;++_i200){tempPlanes[_i200*2+0][0]=m[3]+m[_i200];tempPlanes[_i200*2+0][1]=m[7]+m[_i200+4];tempPlanes[_i200*2+0][2]=m[11]+m[_i200+8];tempPlanes[_i200*2+0][3]=m[15]+m[_i200+12];tempPlanes[_i200*2+1][0]=m[3]-m[_i200];tempPlanes[_i200*2+1][1]=m[7]-m[_i200+4];tempPlanes[_i200*2+1][2]=m[11]-m[_i200+8];tempPlanes[_i200*2+1][3]=m[15]-m[_i200+12];}// Normalize each plane
14415
14415
  tempPlanes.forEach(function(p){return math.divVec4Scalar(p,math.lenVec3(p),p);});return function(aabb){return tempPlanes.every(function(p){// Compute the positive vertex (farthest in direction of normal)
14416
14416
  tempVec4[0]=aabb[p[0]>=0?3:0];tempVec4[1]=aabb[p[1]>=0?4:1];tempVec4[2]=aabb[p[2]>=0?5:2];tempVec4[3]=1;return math.dotVec4(p,tempVec4)>=0;});};};var makeRayAABBIntersectionTest=function makeRayAABBIntersectionTest(O,D){return function(aabb){var tmin=-Infinity;var tmax=Infinity;for(var _i201=0;_i201<3;_i201++){var origin=O[_i201];var _direction=D[_i201];var minBound=aabb[_i201];var maxBound=aabb[_i201+3];if(Math.abs(_direction)<1e-8){// Ray is parallel to plane
14417
14417
  if(origin<minBound||origin>maxBound){return false;// No intersection
@@ -14469,11 +14469,12 @@ if(normalEdgesOpaqueBinLen>0){for(i=0;i<normalEdgesOpaqueBinLen;i++){normalEdges
14469
14469
  if(xrayedFillOpaqueBinLen>0){for(i=0;i<xrayedFillOpaqueBinLen;i++){xrayedFillOpaqueBin[i].drawSilhouetteXRayed(frameCtx);}}// Opaque X-ray edges
14470
14470
  if(xrayEdgesOpaqueBinLen>0){for(i=0;i<xrayEdgesOpaqueBinLen;i++){xrayEdgesOpaqueBin[i].drawEdgesXRayed(frameCtx);}}// Transparent
14471
14471
  if(xrayedFillTransparentBinLen>0||xrayEdgesTransparentBinLen>0||normalFillTransparentBinLen>0||normalEdgesTransparentBinLen>0){gl.enable(gl.CULL_FACE);gl.enable(gl.BLEND);if(canvasTransparent){gl.blendEquation(gl.FUNC_ADD);gl.blendFuncSeparate(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA,gl.ONE,gl.ONE_MINUS_SRC_ALPHA);}else{gl.blendEquation(gl.FUNC_ADD);gl.blendFunc(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA);}frameCtx.backfaces=false;if(!alphaDepthMask){gl.depthMask(false);}// Transparent color edges
14472
- if(normalFillTransparentBinLen>0||normalEdgesTransparentBinLen>0){gl.blendFunc(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA);}if(normalEdgesTransparentBinLen>0){for(i=0;i<normalEdgesTransparentBinLen;i++){drawable=normalEdgesTransparentBin[i];drawable.drawEdgesColorTransparent(frameCtx);}}// Transparent color fill
14473
- if(normalFillTransparentBinLen>0){var eye=frameCtx.viewParams.eye;normalFillTransparentBin.length=normalFillTransparentBinLen;// normalFillTransparentBin reused by renderDrawables calls, so needs to be truncated if necessary
14474
- var byDist=normalFillTransparentBin.map(function(d){return{drawable:d,distSq:math.distVec3(d.origin||vec3_0,eye)};});byDist.sort(function(a,b){return b.distSq-a.distSq;});for(i=0;i<normalFillTransparentBinLen;i++){byDist[i].drawable.drawColorTransparent(frameCtx);}}// Transparent X-ray edges
14472
+ if(normalFillTransparentBinLen>0||normalEdgesTransparentBinLen>0){gl.blendFunc(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA);}if(options.sortAllTransparent){var eye=frameCtx.viewParams.eye;normalFillTransparentBin.length=normalFillTransparentBinLen;// normalFillTransparentBin reused by renderDrawables calls, so needs to be truncated if necessary
14473
+ var transparentDrawables=[];var appendTransparentDrawable=function appendTransparentDrawable(d,draw){math.getAABB3Center(d.aabb,tempVec3$5);transparentDrawables.push({draw:draw,distSq:math.distVec3(eye,math.getAABB3Center(d.aabb,tempVec3$5))});};iota(normalEdgesTransparentBinLen).forEach(function(i){var d=normalEdgesTransparentBin[i];appendTransparentDrawable(d,function(){return d.drawEdgesColorTransparent(frameCtx);});});iota(normalFillTransparentBinLen).forEach(function(i){var d=normalFillTransparentBin[i];appendTransparentDrawable(d,function(){return d.drawColorTransparent(frameCtx);});});iota(xrayEdgesTransparentBinLen).forEach(function(i){var d=xrayEdgesTransparentBin[i];appendTransparentDrawable(d,function(){return d.drawEdgesXRayed(frameCtx);});});iota(xrayedFillTransparentBinLen).forEach(function(i){var d=xrayedFillTransparentBin[i];appendTransparentDrawable(d,function(){return d.drawSilhouetteXRayed(frameCtx);});});transparentDrawables.sort(function(a,b){return b.distSq-a.distSq;}).forEach(function(d){return d.draw();});}else{if(normalEdgesTransparentBinLen>0){for(i=0;i<normalEdgesTransparentBinLen;i++){drawable=normalEdgesTransparentBin[i];drawable.drawEdgesColorTransparent(frameCtx);}}// Transparent color fill
14474
+ if(normalFillTransparentBinLen>0){var _eye=frameCtx.viewParams.eye;normalFillTransparentBin.length=normalFillTransparentBinLen;// normalFillTransparentBin reused by renderDrawables calls, so needs to be truncated if necessary
14475
+ var byDist=normalFillTransparentBin.map(function(d){return{drawable:d,distSq:math.distVec3(d.origin||vec3_0,_eye)};});byDist.sort(function(a,b){return b.distSq-a.distSq;});for(i=0;i<normalFillTransparentBinLen;i++){byDist[i].drawable.drawColorTransparent(frameCtx);}}// Transparent X-ray edges
14475
14476
  if(xrayEdgesTransparentBinLen>0){for(i=0;i<xrayEdgesTransparentBinLen;i++){xrayEdgesTransparentBin[i].drawEdgesXRayed(frameCtx);}}// Transparent X-ray fill
14476
- if(xrayedFillTransparentBinLen>0){for(i=0;i<xrayedFillTransparentBinLen;i++){xrayedFillTransparentBin[i].drawSilhouetteXRayed(frameCtx);}}gl.disable(gl.BLEND);if(!alphaDepthMask){gl.depthMask(true);}}// Opaque highlight
14477
+ if(xrayedFillTransparentBinLen>0){for(i=0;i<xrayedFillTransparentBinLen;i++){xrayedFillTransparentBin[i].drawSilhouetteXRayed(frameCtx);}}}gl.disable(gl.BLEND);if(!alphaDepthMask){gl.depthMask(true);}}// Opaque highlight
14477
14478
  if(highlightedFillOpaqueBinLen>0||highlightedEdgesOpaqueBinLen>0){frameCtx.lastProgramId=null;if(scene.highlightMaterial.glowThrough){gl.clear(gl.DEPTH_BUFFER_BIT);}// Opaque highlighted edges
14478
14479
  if(highlightedEdgesOpaqueBinLen>0){for(i=0;i<highlightedEdgesOpaqueBinLen;i++){highlightedEdgesOpaqueBin[i].drawEdgesHighlighted(frameCtx);}}// Opaque highlighted fill
14479
14480
  if(highlightedFillOpaqueBinLen>0){for(i=0;i<highlightedFillOpaqueBinLen;i++){highlightedFillOpaqueBin[i].drawSilhouetteHighlighted(frameCtx);}}}// Highlighted transparent
@@ -17616,7 +17617,7 @@ _this102._needRecompile=false;/**
17616
17617
  *
17617
17618
  * @type {Canvas}
17618
17619
  */_this102.canvas=new Canvas(_assertThisInitialized(_this102),{dontClear:true,// Never destroy this component with Scene#clear();
17619
- canvas:canvas,spinnerElementId:cfg.spinnerElementId,transparent:transparent,webgl2:cfg.webgl2!==false,contextAttr:cfg.contextAttr||{},backgroundColor:cfg.backgroundColor,backgroundColorFromAmbientLight:cfg.backgroundColorFromAmbientLight,premultipliedAlpha:cfg.premultipliedAlpha});var onContextLost=function onContextLost(event){return _this102.viewer.destroy();};canvas.addEventListener("webglcontextlost",onContextLost,false);_this102._removeWebglcontextlostListener=function(){return canvas.removeEventListener("webglcontextlost",onContextLost,false);};_this102.canvas.on("boundary",function(){_this102.glRedraw();});_this102.canvas.on("webglContextFailed",function(){alert("xeokit failed to find WebGL!");});_this102._renderer=new Renderer$1(_assertThisInitialized(_this102),{transparent:transparent,alphaDepthMask:alphaDepthMask});_this102._sectionPlanesState=new function(){this.sectionPlanes=[];this.clippingCaps=false;this._numCachedSectionPlanes=0;var hash=null;this.getHash=function(){if(hash){return hash;}var numAllocatedSectionPlanes=this.getNumAllocatedSectionPlanes();this.sectionPlanes;if(numAllocatedSectionPlanes===0){return this.hash=";";}var hashParts=[];for(var _i207=0,len=numAllocatedSectionPlanes;_i207<len;_i207++){hashParts.push("cp");}hashParts.push(";");hash=hashParts.join("");return hash;};this.addSectionPlane=function(sectionPlane){this.sectionPlanes.push(sectionPlane);hash=null;};this.removeSectionPlane=function(sectionPlane){for(var _i208=0,len=this.sectionPlanes.length;_i208<len;_i208++){if(this.sectionPlanes[_i208].id===sectionPlane.id){this.sectionPlanes.splice(_i208,1);hash=null;return;}}};this.setNumCachedSectionPlanes=function(numCachedSectionPlanes){this._numCachedSectionPlanes=numCachedSectionPlanes;hash=null;};this.getNumCachedSectionPlanes=function(){return this._numCachedSectionPlanes;};this.getNumAllocatedSectionPlanes=function(){var num=this.sectionPlanes.length;return num>this._numCachedSectionPlanes?num:this._numCachedSectionPlanes;};}();_this102._sectionPlanesState.setNumCachedSectionPlanes(cfg.numCachedSectionPlanes||0);_this102._lightsState=new function(){var DEFAULT_AMBIENT=math.vec4([0,0,0,0]);var ambientColorIntensity=math.vec4();this.lights=[];this.reflectionMaps=[];this.lightMaps=[];var hash=null;var ambientLight=null;this.getHash=function(){if(hash){return hash;}var hashParts=[];var lights=this.lights;var light;for(var _i209=0,len=lights.length;_i209<len;_i209++){light=lights[_i209];hashParts.push("/");hashParts.push(light.type);hashParts.push(light.space==="world"?"w":"v");if(light.castsShadow){hashParts.push("sh");}}if(this.lightMaps.length>0){hashParts.push("/lm");}if(this.reflectionMaps.length>0){hashParts.push("/rm");}hashParts.push(";");hash=hashParts.join("");return hash;};this.addLight=function(state){this.lights.push(state);ambientLight=null;hash=null;};this.removeLight=function(state){for(var _i210=0,len=this.lights.length;_i210<len;_i210++){var light=this.lights[_i210];if(light.id===state.id){this.lights.splice(_i210,1);if(ambientLight&&ambientLight.id===state.id){ambientLight=null;}hash=null;return;}}};this.addReflectionMap=function(state){this.reflectionMaps.push(state);hash=null;};this.removeReflectionMap=function(state){for(var _i211=0,len=this.reflectionMaps.length;_i211<len;_i211++){if(this.reflectionMaps[_i211].id===state.id){this.reflectionMaps.splice(_i211,1);hash=null;return;}}};this.addLightMap=function(state){this.lightMaps.push(state);hash=null;};this.removeLightMap=function(state){for(var _i212=0,len=this.lightMaps.length;_i212<len;_i212++){if(this.lightMaps[_i212].id===state.id){this.lightMaps.splice(_i212,1);hash=null;return;}}};this.getAmbientColorAndIntensity=function(){if(!ambientLight){for(var _i213=0,len=this.lights.length;_i213<len;_i213++){var light=this.lights[_i213];if(light.type==="ambient"){ambientLight=light;break;}}}if(ambientLight){var _color5=ambientLight.color;var intensity=ambientLight.intensity;ambientColorIntensity[0]=_color5[0];ambientColorIntensity[1]=_color5[1];ambientColorIntensity[2]=_color5[2];ambientColorIntensity[3]=intensity;return ambientColorIntensity;}else{return DEFAULT_AMBIENT;}};}();/**
17620
+ canvas:canvas,spinnerElementId:cfg.spinnerElementId,transparent:transparent,webgl2:cfg.webgl2!==false,contextAttr:cfg.contextAttr||{},backgroundColor:cfg.backgroundColor,backgroundColorFromAmbientLight:cfg.backgroundColorFromAmbientLight,premultipliedAlpha:cfg.premultipliedAlpha});var onContextLost=function onContextLost(event){return _this102.viewer.destroy();};canvas.addEventListener("webglcontextlost",onContextLost,false);_this102._removeWebglcontextlostListener=function(){return canvas.removeEventListener("webglcontextlost",onContextLost,false);};_this102.canvas.on("boundary",function(){_this102.glRedraw();});_this102.canvas.on("webglContextFailed",function(){alert("xeokit failed to find WebGL!");});_this102._renderer=new Renderer$1(_assertThisInitialized(_this102),{transparent:transparent,alphaDepthMask:alphaDepthMask,sortAllTransparent:cfg.sortAllTransparent});_this102._sectionPlanesState=new function(){this.sectionPlanes=[];this.clippingCaps=false;this._numCachedSectionPlanes=0;var hash=null;this.getHash=function(){if(hash){return hash;}var numAllocatedSectionPlanes=this.getNumAllocatedSectionPlanes();this.sectionPlanes;if(numAllocatedSectionPlanes===0){return this.hash=";";}var hashParts=[];for(var _i207=0,len=numAllocatedSectionPlanes;_i207<len;_i207++){hashParts.push("cp");}hashParts.push(";");hash=hashParts.join("");return hash;};this.addSectionPlane=function(sectionPlane){this.sectionPlanes.push(sectionPlane);hash=null;};this.removeSectionPlane=function(sectionPlane){for(var _i208=0,len=this.sectionPlanes.length;_i208<len;_i208++){if(this.sectionPlanes[_i208].id===sectionPlane.id){this.sectionPlanes.splice(_i208,1);hash=null;return;}}};this.setNumCachedSectionPlanes=function(numCachedSectionPlanes){this._numCachedSectionPlanes=numCachedSectionPlanes;hash=null;};this.getNumCachedSectionPlanes=function(){return this._numCachedSectionPlanes;};this.getNumAllocatedSectionPlanes=function(){var num=this.sectionPlanes.length;return num>this._numCachedSectionPlanes?num:this._numCachedSectionPlanes;};}();_this102._sectionPlanesState.setNumCachedSectionPlanes(cfg.numCachedSectionPlanes||0);_this102._lightsState=new function(){var DEFAULT_AMBIENT=math.vec4([0,0,0,0]);var ambientColorIntensity=math.vec4();this.lights=[];this.reflectionMaps=[];this.lightMaps=[];var hash=null;var ambientLight=null;this.getHash=function(){if(hash){return hash;}var hashParts=[];var lights=this.lights;var light;for(var _i209=0,len=lights.length;_i209<len;_i209++){light=lights[_i209];hashParts.push("/");hashParts.push(light.type);hashParts.push(light.space==="world"?"w":"v");if(light.castsShadow){hashParts.push("sh");}}if(this.lightMaps.length>0){hashParts.push("/lm");}if(this.reflectionMaps.length>0){hashParts.push("/rm");}hashParts.push(";");hash=hashParts.join("");return hash;};this.addLight=function(state){this.lights.push(state);ambientLight=null;hash=null;};this.removeLight=function(state){for(var _i210=0,len=this.lights.length;_i210<len;_i210++){var light=this.lights[_i210];if(light.id===state.id){this.lights.splice(_i210,1);if(ambientLight&&ambientLight.id===state.id){ambientLight=null;}hash=null;return;}}};this.addReflectionMap=function(state){this.reflectionMaps.push(state);hash=null;};this.removeReflectionMap=function(state){for(var _i211=0,len=this.reflectionMaps.length;_i211<len;_i211++){if(this.reflectionMaps[_i211].id===state.id){this.reflectionMaps.splice(_i211,1);hash=null;return;}}};this.addLightMap=function(state){this.lightMaps.push(state);hash=null;};this.removeLightMap=function(state){for(var _i212=0,len=this.lightMaps.length;_i212<len;_i212++){if(this.lightMaps[_i212].id===state.id){this.lightMaps.splice(_i212,1);hash=null;return;}}};this.getAmbientColorAndIntensity=function(){if(!ambientLight){for(var _i213=0,len=this.lights.length;_i213<len;_i213++){var light=this.lights[_i213];if(light.type==="ambient"){ambientLight=light;break;}}}if(ambientLight){var _color5=ambientLight.color;var intensity=ambientLight.intensity;ambientColorIntensity[0]=_color5[0];ambientColorIntensity[1]=_color5[1];ambientColorIntensity[2]=_color5[2];ambientColorIntensity[3]=intensity;return ambientColorIntensity;}else{return DEFAULT_AMBIENT;}};}();/**
17620
17621
  * Publishes input events that occur on this Scene's canvas.
17621
17622
  *
17622
17623
  * @property input
@@ -18490,7 +18491,7 @@ if(updates.rotateDeltaY!==0||updates.rotateDeltaX!==0){if(!configs.firstPerson&&
18490
18491
  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;//----------------------------------------------------------------------------------------------------------
18491
18492
  // Dollying
18492
18493
  //----------------------------------------------------------------------------------------------------------
18493
- if(dollyDeltaForDist!==0){if(dollyDeltaForDist<0){cursorType=cameraControl._cursors.dollyForward;}else{cursorType=cameraControl._cursors.dollyBackward;}if(configs.firstPerson){var _verticalEye;var _verticalLook;if(configs.constrainVertical){if(camera.xUp){_verticalEye=camera.eye[0];_verticalLook=camera.look[0];}else if(camera.yUp){_verticalEye=camera.eye[1];_verticalLook=camera.look[1];}else if(camera.zUp){_verticalEye=camera.eye[2];_verticalLook=camera.look[2];}}if(configs.followPointer){var dolliedThroughSurface=panController.dollyToCanvasPos(followPointerWorldPos,states.pointerCanvasPos,-dollyDeltaForDist);if(dolliedThroughSurface){states.followPointerDirty=true;}}else{camera.pan([0,0,dollyDeltaForDist]);camera.ortho.scale=camera.ortho.scale-dollyDeltaForDist;}if(configs.constrainVertical){var _eye=camera.eye;var _look=camera.look;if(camera.xUp){_eye[0]=_verticalEye;_look[0]=_verticalLook;}else if(camera.yUp){_eye[1]=_verticalEye;_look[1]=_verticalLook;}else if(camera.zUp){_eye[2]=_verticalEye;_look[2]=_verticalLook;}camera.eye=_eye;camera.look=_look;}}else if(configs.planView){if(configs.followPointer){var _dolliedThroughSurface=panController.dollyToCanvasPos(followPointerWorldPos,states.pointerCanvasPos,-dollyDeltaForDist);if(_dolliedThroughSurface){states.followPointerDirty=true;}}else{camera.ortho.scale=camera.ortho.scale+dollyDeltaForDist;camera.zoom(dollyDeltaForDist);}}else{// Orbiting
18494
+ if(dollyDeltaForDist!==0){if(dollyDeltaForDist<0){cursorType=cameraControl._cursors.dollyForward;}else{cursorType=cameraControl._cursors.dollyBackward;}if(configs.firstPerson){var _verticalEye;var _verticalLook;if(configs.constrainVertical){if(camera.xUp){_verticalEye=camera.eye[0];_verticalLook=camera.look[0];}else if(camera.yUp){_verticalEye=camera.eye[1];_verticalLook=camera.look[1];}else if(camera.zUp){_verticalEye=camera.eye[2];_verticalLook=camera.look[2];}}if(configs.followPointer){var dolliedThroughSurface=panController.dollyToCanvasPos(followPointerWorldPos,states.pointerCanvasPos,-dollyDeltaForDist);if(dolliedThroughSurface){states.followPointerDirty=true;}}else{camera.pan([0,0,dollyDeltaForDist]);camera.ortho.scale=camera.ortho.scale-dollyDeltaForDist;}if(configs.constrainVertical){var _eye2=camera.eye;var _look=camera.look;if(camera.xUp){_eye2[0]=_verticalEye;_look[0]=_verticalLook;}else if(camera.yUp){_eye2[1]=_verticalEye;_look[1]=_verticalLook;}else if(camera.zUp){_eye2[2]=_verticalEye;_look[2]=_verticalLook;}camera.eye=_eye2;camera.look=_look;}}else if(configs.planView){if(configs.followPointer){var _dolliedThroughSurface=panController.dollyToCanvasPos(followPointerWorldPos,states.pointerCanvasPos,-dollyDeltaForDist);if(_dolliedThroughSurface){states.followPointerDirty=true;}}else{camera.ortho.scale=camera.ortho.scale+dollyDeltaForDist;camera.zoom(dollyDeltaForDist);}}else{// Orbiting
18494
18495
  if(configs.followPointer){var _dolliedThroughSurface2=panController.dollyToCanvasPos(followPointerWorldPos,states.pointerCanvasPos,-dollyDeltaForDist);if(_dolliedThroughSurface2){states.followPointerDirty=true;}}else{camera.ortho.scale=camera.ortho.scale+dollyDeltaForDist;camera.zoom(dollyDeltaForDist);}}updates.dollyDelta*=configs.dollyInertia;}pickController.fireEvents();document.body.style.cursor=cursorType;});}_createClass(CameraUpdater,[{key:"destroy",value:function destroy(){this._scene.off(this._onTick);}}]);return CameraUpdater;}();/**
18495
18496
  * @private
18496
18497
  */var MouseMiscHandler=/*#__PURE__*/function(){function MouseMiscHandler(scene,controllers,configs,states,updates){_classCallCheck(this,MouseMiscHandler);this._scene=scene;var canvas=this._scene.canvas.canvas;canvas.addEventListener("mouseenter",this._mouseEnterHandler=function(){states.mouseover=true;});canvas.addEventListener("mouseleave",this._mouseLeaveHandler=function(){states.mouseover=false;canvas.style.cursor=null;});document.addEventListener("mousemove",this._mouseMoveHandler=function(e){getCanvasPosFromEvent$2(e,canvas,states.pointerCanvasPos);states.mouseover=true;// Added to fix XCD-386: The zoom speed slows down when zooming into an empty space for the first time on a relatively large model, and it cannot be reset without reloading
@@ -23391,6 +23392,7 @@ o4===0&&onSegment(c,b,d))// c, d and b are collinear and b lies on segment cd
23391
23392
  * configures renderer logic for the specified number of SectionPlanes, eliminating the need for setting up logic with each SectionPlane creation and thereby enhancing
23392
23393
  * responsiveness. It is important to consider that each SectionPlane impacts rendering performance, so it is recommended to set this value to a quantity that aligns with
23393
23394
  * your expected usage.
23395
+ * @param {Boolean} [cfg.sortAllTransparent=false] Whether to sort all transparent objects by their distance from the camera, before drawing on the scene.
23394
23396
  */function Viewer(cfg){_classCallCheck(this,Viewer);/**
23395
23397
  * The Viewer's current language setting.
23396
23398
  * @property language
@@ -23411,7 +23413,7 @@ o4===0&&onSegment(c,b,d))// c, d and b are collinear and b lies on segment cd
23411
23413
  * The Viewer's {@link Scene}.
23412
23414
  * @property scene
23413
23415
  * @type {Scene}
23414
- */this.scene=new Scene(this,{canvasId:cfg.canvasId,canvasElement:cfg.canvasElement,keyboardEventsElement:cfg.keyboardEventsElement,contextAttr:{preserveDrawingBuffer:cfg.preserveDrawingBuffer!==false,premultipliedAlpha:!!cfg.premultipliedAlpha,antialias:cfg.antialias!==false},spinnerElementId:cfg.spinnerElementId,transparent:cfg.transparent!==false,gammaInput:true,gammaOutput:false,backgroundColor:cfg.backgroundColor,backgroundColorFromAmbientLight:cfg.backgroundColorFromAmbientLight,ticksPerRender:1,ticksPerOcclusionTest:20,units:cfg.units,scale:cfg.scale,origin:cfg.origin,saoEnabled:cfg.saoEnabled,alphaDepthMask:cfg.alphaDepthMask!==false,entityOffsetsEnabled:!!cfg.entityOffsetsEnabled,readableGeometryEnabled:!!cfg.readableGeometryEnabled,logarithmicDepthBufferEnabled:!!cfg.logarithmicDepthBufferEnabled,pbrEnabled:!!cfg.pbrEnabled,colorTextureEnabled:cfg.colorTextureEnabled!==false,dtxEnabled:!!cfg.dtxEnabled,markerZOffset:cfg.markerZOffset,numCachedSectionPlanes:cfg.numCachedSectionPlanes});/**
23416
+ */this.scene=new Scene(this,{canvasId:cfg.canvasId,canvasElement:cfg.canvasElement,keyboardEventsElement:cfg.keyboardEventsElement,contextAttr:{preserveDrawingBuffer:cfg.preserveDrawingBuffer!==false,premultipliedAlpha:!!cfg.premultipliedAlpha,antialias:cfg.antialias!==false},spinnerElementId:cfg.spinnerElementId,transparent:cfg.transparent!==false,gammaInput:true,gammaOutput:false,backgroundColor:cfg.backgroundColor,backgroundColorFromAmbientLight:cfg.backgroundColorFromAmbientLight,ticksPerRender:1,ticksPerOcclusionTest:20,units:cfg.units,scale:cfg.scale,origin:cfg.origin,saoEnabled:cfg.saoEnabled,alphaDepthMask:cfg.alphaDepthMask!==false,entityOffsetsEnabled:!!cfg.entityOffsetsEnabled,readableGeometryEnabled:!!cfg.readableGeometryEnabled,logarithmicDepthBufferEnabled:!!cfg.logarithmicDepthBufferEnabled,pbrEnabled:!!cfg.pbrEnabled,colorTextureEnabled:cfg.colorTextureEnabled!==false,dtxEnabled:!!cfg.dtxEnabled,markerZOffset:cfg.markerZOffset,numCachedSectionPlanes:cfg.numCachedSectionPlanes,sortAllTransparent:cfg.sortAllTransparent});/**
23415
23417
  * Metadata about the {@link Scene} and the models and objects within it.
23416
23418
  * @property metaScene
23417
23419
  * @type {MetaScene}
@@ -26355,10 +26357,10 @@ sceneModel.fire("loaded",true,false);});if(ok){ok();}},function(msg){plugin.erro
26355
26357
  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
26358
  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
26359
  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
26360
+ 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
26361
  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);// 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:entityId,parent:ctx.sceneModel.id});}}meshIds=meshIdsStack.pop();}});})(nodes,0,null);}/**
26362
+ 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.
26363
+ 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
26364
  * Parses transform at the given glTF node.
26363
26365
  *
26364
26366
  * @param node the glTF node
@@ -26371,7 +26373,7 @@ var meshIdsStack=[];var meshIds=null;(function createSceneMeshesAndEntities(node
26371
26373
  * @param ctx Parsing context
26372
26374
  * @param matrix Matrix for the XKTMeshes
26373
26375
  * @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];if(primitive.mode<4){continue;}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
26376
+ */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
26377
  meshCfg.primitive="points";break;case 1:// LINES
26376
26378
  meshCfg.primitive="lines";break;case 2:// LINE_LOOP
26377
26379
  meshCfg.primitive="lines";break;case 3:// LINE_STRIP
@@ -26673,6 +26675,7 @@ if(rtcNeeded){meshCfg.origin=origin;}ctx.sceneModel.createMesh(meshCfg);meshIds.
26673
26675
  * @param {Boolean} [params.autoMetaModel] When supplied, creates a default MetaModel with a single MetaObject.
26674
26676
  * @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
26677
  * @param {*} [params.parseOptions={}] Options to pass to loaders.gl parse method, eg. ````{ gltf: { excludeExtensions: { "KHR_texture_transform": false } } }````.
26678
+ * @param {Boolean} [params.entityPerMesh=false] Create an entity for each mesh, instead of grouping leaf meshes under their common entity.
26676
26679
  * @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
26680
  */,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
26681
  if(!params.src&&!params.gltf){this.error("load() param expected: src or gltf");return sceneModel;// Return new empty model