@xeokit/xeokit-sdk 2.6.93 → 2.6.94

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,11 +1,11 @@
1
1
  /**
2
- * xeokit-sdk v2.6.93
3
- * Commit: 00a09510b0b8d1b5f72f56ee2cefec7f33616748
4
- * Built: 2025-10-20T10:21:49.411Z
2
+ * xeokit-sdk v2.6.94
3
+ * Commit: 32b1b9841f49a7817cfc809cbbee180486784356
4
+ * Built: 2025-11-03T13:05:57.748Z
5
5
  */
6
6
 
7
7
  if (typeof window !== 'undefined') {
8
- window.__XEOKIT__ = { version: '2.6.93', commit: '00a09510b0b8d1b5f72f56ee2cefec7f33616748', built: '2025-10-20T10:21:49.411Z' };
8
+ window.__XEOKIT__ = { version: '2.6.94', commit: '32b1b9841f49a7817cfc809cbbee180486784356', built: '2025-11-03T13:05:57.748Z' };
9
9
  }
10
10
 
11
11
  'use strict';
@@ -20095,7 +20095,7 @@ const createLightSetup = function(programVariables, lightsState) {
20095
20095
  const withViewLightDir = getDirection => {
20096
20096
  return {
20097
20097
  glslLight: {
20098
- isWorldSpace: light.space === "world",
20098
+ isViewSpace: light.space === "view",
20099
20099
  getColor: () => `${lightUniforms.color}.rgb * ${lightUniforms.color}.a`,
20100
20100
  getDirection: (viewMatrix, viewPosition) => `normalize(${getDirection(viewMatrix, viewPosition)})`,
20101
20101
  shadowParameters: light.castsShadow && {
@@ -20609,7 +20609,7 @@ const DrawShaderSource = function(meshDrawHash, programVariables, geometry, mate
20609
20609
  src.push("shadow /= 9.0;");
20610
20610
  }
20611
20611
  src.push(`vec3 lightColor${i} = ${light.getColor()}${light.shadowParameters ? (" * " + "shadow") : ""};`);
20612
- src.push(`vec3 lightDirection${i} = ${light.isWorldSpace ? vDirectionals[i].vViewLightReverseDir : light.getDirection(null, vViewPosition)};`);
20612
+ src.push(`vec3 lightDirection${i} = ${light.isViewSpace ? light.getDirection(null, vViewPosition) : vDirectionals[i].vViewLightReverseDir};`);
20613
20613
  const dotNL = `${saturate}(dot(viewNormal, lightDirection${i}))`;
20614
20614
  src.push(`vec3 irradiance${i} = ${dotNL} * lightColor${i};`);
20615
20615
  src.push(`reflDiff += irradiance${i};`);
@@ -40731,7 +40731,7 @@ class DirLight extends Light {
40731
40731
  * @param {Number[]} [cfg.dir=[1.0, 1.0, 1.0]] A unit vector indicating the direction that the light is shining, given in either World or View space, depending on the value of the ````space```` parameter.
40732
40732
  * @param {Number[]} [cfg.color=[0.7, 0.7, 0.8 ]] The color of this DirLight.
40733
40733
  * @param {Number} [cfg.intensity=1.0] The intensity of this DirLight, as a factor in range ````[0..1]````.
40734
- * @param {String} [cfg.space="view"] The coordinate system the DirLight is defined in - ````"view"```` or ````"space"````.
40734
+ * @param {String} [cfg.space="view"] The coordinate system the DirLight is defined in - ````"view"```` or ````"world"````.
40735
40735
  * @param {Boolean} [cfg.castsShadow=false] Flag which indicates if this DirLight casts a castsShadow.
40736
40736
  */
40737
40737
  constructor(owner, cfg = {}) {
@@ -56926,7 +56926,7 @@ class Scene extends Component {
56926
56926
  *
56927
56927
  * @param {String[]} ids Array of {@link Entity#id} values.
56928
56928
  * @param {Number[]} [colorize=(1,1,1)] RGB colorize factors, multiplied by the rendered pixel colors.
56929
- * @returns {Boolean} True if any {@link Entity}s changed opacity, else false if all updates were redundant and not applied.
56929
+ * @returns {Boolean} True if any {@link Entity}s were colorized, else false if all updates were redundant and not applied.
56930
56930
  */
56931
56931
  setObjectsColorized(ids, colorize) {
56932
56932
  return this.withObjects(ids, entity => {
@@ -1,11 +1,11 @@
1
1
  /**
2
- * xeokit-sdk v2.6.93
3
- * Commit: 00a09510b0b8d1b5f72f56ee2cefec7f33616748
4
- * Built: 2025-10-20T10:21:49.411Z
2
+ * xeokit-sdk v2.6.94
3
+ * Commit: 32b1b9841f49a7817cfc809cbbee180486784356
4
+ * Built: 2025-11-03T13:05:57.748Z
5
5
  */
6
6
 
7
7
  if (typeof window !== 'undefined') {
8
- window.__XEOKIT__ = { version: '2.6.93', commit: '00a09510b0b8d1b5f72f56ee2cefec7f33616748', built: '2025-10-20T10:21:49.411Z' };
8
+ window.__XEOKIT__ = { version: '2.6.94', commit: '32b1b9841f49a7817cfc809cbbee180486784356', built: '2025-11-03T13:05:57.748Z' };
9
9
  }
10
10
 
11
11
  /** @private */
@@ -20091,7 +20091,7 @@ const createLightSetup = function(programVariables, lightsState) {
20091
20091
  const withViewLightDir = getDirection => {
20092
20092
  return {
20093
20093
  glslLight: {
20094
- isWorldSpace: light.space === "world",
20094
+ isViewSpace: light.space === "view",
20095
20095
  getColor: () => `${lightUniforms.color}.rgb * ${lightUniforms.color}.a`,
20096
20096
  getDirection: (viewMatrix, viewPosition) => `normalize(${getDirection(viewMatrix, viewPosition)})`,
20097
20097
  shadowParameters: light.castsShadow && {
@@ -20605,7 +20605,7 @@ const DrawShaderSource = function(meshDrawHash, programVariables, geometry, mate
20605
20605
  src.push("shadow /= 9.0;");
20606
20606
  }
20607
20607
  src.push(`vec3 lightColor${i} = ${light.getColor()}${light.shadowParameters ? (" * " + "shadow") : ""};`);
20608
- src.push(`vec3 lightDirection${i} = ${light.isWorldSpace ? vDirectionals[i].vViewLightReverseDir : light.getDirection(null, vViewPosition)};`);
20608
+ src.push(`vec3 lightDirection${i} = ${light.isViewSpace ? light.getDirection(null, vViewPosition) : vDirectionals[i].vViewLightReverseDir};`);
20609
20609
  const dotNL = `${saturate}(dot(viewNormal, lightDirection${i}))`;
20610
20610
  src.push(`vec3 irradiance${i} = ${dotNL} * lightColor${i};`);
20611
20611
  src.push(`reflDiff += irradiance${i};`);
@@ -40727,7 +40727,7 @@ class DirLight extends Light {
40727
40727
  * @param {Number[]} [cfg.dir=[1.0, 1.0, 1.0]] A unit vector indicating the direction that the light is shining, given in either World or View space, depending on the value of the ````space```` parameter.
40728
40728
  * @param {Number[]} [cfg.color=[0.7, 0.7, 0.8 ]] The color of this DirLight.
40729
40729
  * @param {Number} [cfg.intensity=1.0] The intensity of this DirLight, as a factor in range ````[0..1]````.
40730
- * @param {String} [cfg.space="view"] The coordinate system the DirLight is defined in - ````"view"```` or ````"space"````.
40730
+ * @param {String} [cfg.space="view"] The coordinate system the DirLight is defined in - ````"view"```` or ````"world"````.
40731
40731
  * @param {Boolean} [cfg.castsShadow=false] Flag which indicates if this DirLight casts a castsShadow.
40732
40732
  */
40733
40733
  constructor(owner, cfg = {}) {
@@ -56922,7 +56922,7 @@ class Scene extends Component {
56922
56922
  *
56923
56923
  * @param {String[]} ids Array of {@link Entity#id} values.
56924
56924
  * @param {Number[]} [colorize=(1,1,1)] RGB colorize factors, multiplied by the rendered pixel colors.
56925
- * @returns {Boolean} True if any {@link Entity}s changed opacity, else false if all updates were redundant and not applied.
56925
+ * @returns {Boolean} True if any {@link Entity}s were colorized, else false if all updates were redundant and not applied.
56926
56926
  */
56927
56927
  setObjectsColorized(ids, colorize) {
56928
56928
  return this.withObjects(ids, entity => {
@@ -1,10 +1,10 @@
1
1
  /**
2
- * xeokit-sdk v2.6.93
3
- * Commit: 00a09510b0b8d1b5f72f56ee2cefec7f33616748
4
- * Built: 2025-10-20T10:21:49.411Z
2
+ * xeokit-sdk v2.6.94
3
+ * Commit: 32b1b9841f49a7817cfc809cbbee180486784356
4
+ * Built: 2025-11-03T13:05:57.748Z
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.93',commit:'00a09510b0b8d1b5f72f56ee2cefec7f33616748',built:'2025-10-20T10:21:49.411Z'};}/** @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.94',commit:'32b1b9841f49a7817cfc809cbbee180486784356',built:'2025-11-03T13:05:57.748Z'};}/** @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
@@ -5180,7 +5180,7 @@ var tempChildList=this._children.splice(0);var child;for(var _i64=0,len=tempChil
5180
5180
  "vec4 sRGBToLinear(in vec4 value) {"," return vec4(mix(pow(value.rgb * 0.9478672986 + 0.0521327014, vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);","}"]).concat(fragmentShader);var makeShader=function makeShader(type,srcLines){var src=srcLines.join("\n");var shader=gl.createShader(type);gl.shaderSource(shader,src);gl.compileShader(shader);if(gl.getShaderParameter(shader,gl.COMPILE_STATUS)){return[shader];}else{return[null,["Failed to compile",gl.getShaderInfoLog(shader),src.split("\n").map(function(line,i){return i+1+": "+line+"\n";}).join("")]];}};var _makeShader=makeShader(gl.VERTEX_SHADER,vertSrc),_makeShader2=_slicedToArray(_makeShader,2),vertShader=_makeShader2[0],vertErrors=_makeShader2[1];var _makeShader3=makeShader(gl.FRAGMENT_SHADER,fragSrc),_makeShader4=_slicedToArray(_makeShader3,2),fragShader=_makeShader4[0],fragErrors=_makeShader4[1];var errorObj=function errorObj(errors){console.error(errors.join("\n"));return[null,errors];};if(vertErrors){return errorObj(["Vertex shader error"].concat(vertErrors));}else if(fragErrors){return errorObj(["Fragment shader error"].concat(fragErrors));}else{var program=gl.createProgram();if(!program){return errorObj(["Failed to allocate program"]);}else{gl.attachShader(program,vertShader);gl.attachShader(program,fragShader);gl.linkProgram(program);// HACK: Disable validation temporarily
5181
5181
  // Perhaps we should defer validation until render-time, when the program has values set for all inputs?
5182
5182
  if(!gl.getProgramParameter(program,gl.LINK_STATUS)){return errorObj(["",gl.getProgramInfoLog(_this22.program),"","Vertex shader:",""].concat(_toConsumableArray(vertSrc),["","Fragment shader:",""],_toConsumableArray(fragSrc)));}else{var getInputSetter=makeInputSetters(gl,program);attrSetters.forEach(function(i){return i(getInputSetter);});var uSetters=unifSetters.map(function(i){return i(getInputSetter);}).filter(function(s){return s;});var id=ids$1.addItem({});return[{id:id,bind:function bind(){return gl.useProgram(program);},inputSetters:{attributesHash:attrHahes.sort().join(", "),setUniforms:function setUniforms(frameCtx,state){clipTransformSetup&&clipTransformSetup.setClipPosInputValue(frameCtx);uSetters.forEach(function(s){return s(state);});}},destroy:function destroy(){ids$1.removeItem(id);gl.deleteProgram(program);gl.deleteShader(vertShader);gl.deleteShader(fragShader);}}];}}}}};};var createLightSetup=function createLightSetup(programVariables,lightsState){var lightAmbient=programVariables.createUniform("vec4","lightAmbient",function(set){return set(lightsState.getAmbientColorAndIntensity());});var lights=lightsState.lights;var directionals=lights.map(function(light,i){var lightUniforms={color:programVariables.createUniform("vec4","lightColor".concat(i),function(set){var light=lights[i];// in case it changed
5183
- tempVec4$2[0]=light.color[0];tempVec4$2[1]=light.color[1];tempVec4$2[2]=light.color[2];tempVec4$2[3]=light.intensity;set(tempVec4$2);}),position:programVariables.createUniform("vec3","lightPos".concat(i),function(set){return set(lights[i].pos);}),direction:programVariables.createUniform("vec3","lightDir".concat(i),function(set){return set(lights[i].dir);}),shadowProjMatrix:programVariables.createUniform("mat4","shadowProjMatrix".concat(i),function(set){return set(lights[i].getShadowViewMatrix());}),shadowViewMatrix:programVariables.createUniform("mat4","shadowViewMatrix".concat(i),function(set){return set(lights[i].getShadowViewMatrix());}),shadowMap:programVariables.createUniform("sampler2D","shadowMap".concat(i),function(set){return set(lights[i].getShadowRenderBuf().colorTextures[0]);})};var withViewLightDir=function withViewLightDir(_getDirection){return{glslLight:{isWorldSpace:light.space==="world",getColor:function getColor(){return"".concat(lightUniforms.color,".rgb * ").concat(lightUniforms.color,".a");},getDirection:function getDirection(viewMatrix,viewPosition){return"normalize(".concat(_getDirection(viewMatrix,viewPosition),")");},shadowParameters:light.castsShadow&&{getShadowProjMatrix:function getShadowProjMatrix(){return lightUniforms.shadowProjMatrix;},getShadowViewMatrix:function getShadowViewMatrix(){return lightUniforms.shadowViewMatrix;},getShadowMap:function getShadowMap(){return lightUniforms.shadowMap;}}},setupLightsInputs:function setupLightsInputs(){var setters=Object.values(lightUniforms).map(function(u){return u.setupLightsInputs();}).filter(function(v){return v;});return function(){return setters.forEach(function(setState){return setState();});};}};};if(light.type==="dir"){if(light.space==="view"){return withViewLightDir(function(viewMatrix,viewPosition){return"-".concat(lightUniforms.direction);});}else{// If normal mapping, the fragment->light vector will be in tangent space
5183
+ tempVec4$2[0]=light.color[0];tempVec4$2[1]=light.color[1];tempVec4$2[2]=light.color[2];tempVec4$2[3]=light.intensity;set(tempVec4$2);}),position:programVariables.createUniform("vec3","lightPos".concat(i),function(set){return set(lights[i].pos);}),direction:programVariables.createUniform("vec3","lightDir".concat(i),function(set){return set(lights[i].dir);}),shadowProjMatrix:programVariables.createUniform("mat4","shadowProjMatrix".concat(i),function(set){return set(lights[i].getShadowViewMatrix());}),shadowViewMatrix:programVariables.createUniform("mat4","shadowViewMatrix".concat(i),function(set){return set(lights[i].getShadowViewMatrix());}),shadowMap:programVariables.createUniform("sampler2D","shadowMap".concat(i),function(set){return set(lights[i].getShadowRenderBuf().colorTextures[0]);})};var withViewLightDir=function withViewLightDir(_getDirection){return{glslLight:{isViewSpace:light.space==="view",getColor:function getColor(){return"".concat(lightUniforms.color,".rgb * ").concat(lightUniforms.color,".a");},getDirection:function getDirection(viewMatrix,viewPosition){return"normalize(".concat(_getDirection(viewMatrix,viewPosition),")");},shadowParameters:light.castsShadow&&{getShadowProjMatrix:function getShadowProjMatrix(){return lightUniforms.shadowProjMatrix;},getShadowViewMatrix:function getShadowViewMatrix(){return lightUniforms.shadowViewMatrix;},getShadowMap:function getShadowMap(){return lightUniforms.shadowMap;}}},setupLightsInputs:function setupLightsInputs(){var setters=Object.values(lightUniforms).map(function(u){return u.setupLightsInputs();}).filter(function(v){return v;});return function(){return setters.forEach(function(setState){return setState();});};}};};if(light.type==="dir"){if(light.space==="view"){return withViewLightDir(function(viewMatrix,viewPosition){return"-".concat(lightUniforms.direction);});}else{// If normal mapping, the fragment->light vector will be in tangent space
5184
5184
  return withViewLightDir(function(viewMatrix,viewPosition){return"-(".concat(viewMatrix," * vec4(").concat(lightUniforms.direction,", 0.0)).xyz");});}}else if(light.type==="point"){if(light.space==="view"){return withViewLightDir(function(viewMatrix,viewPosition){return"".concat(lightUniforms.position," - ").concat(viewPosition);});}else{// If normal mapping, the fragment->light vector will be in tangent space
5185
5185
  return withViewLightDir(function(viewMatrix,viewPosition){return"(".concat(viewMatrix," * vec4(").concat(lightUniforms.position,", 1.0)).xyz - ").concat(viewPosition);});}}else{return null;}}).filter(function(v){return v;});var setupCubeTexture=function setupCubeTexture(name,getMaps){var getValue=function getValue(){var m=getMaps();return m.length>0&&m[0];};var initMap=getValue();return initMap&&setupTexture(programVariables,"samplerCube",name,initMap.encoding,function(set){var v=getValue();v&&set(v.texture);});};var lightMap=setupCubeTexture("light",function(){return lightsState.lightMaps;});var reflectionMap=setupCubeTexture("reflection",function(){return lightsState.reflectionMaps;});return{getHash:function getHash(){return lightsState.getHash();},getAmbientColor:function getAmbientColor(){return"".concat(lightAmbient,".rgb * ").concat(lightAmbient,".a");},directionalLights:directionals.map(function(light){return light.glslLight;}),getIrradiance:lightMap&&function(worldNormal){return"".concat(lightMap(worldNormal),".rgb");},getReflection:reflectionMap&&function(reflectVec,mipLevel){return"".concat(reflectionMap(reflectVec,mipLevel),".rgb");}};};var setupTexture=function setupTexture(programVariables,type,name,encoding,getTexture){var map=programVariables.createUniform(type,name+"Map",getTexture);return function(texturePos,bias){var texel=bias?"texture(".concat(map,", ").concat(texturePos,", ").concat(bias,")"):"texture(".concat(map,", ").concat(texturePos,")");return encoding!==LinearEncoding?"".concat(TEXTURE_DECODE_FUNCS[encoding],"(").concat(texel,")"):texel;};};var makeInputSetters=function makeInputSetters(gl,handle){var activeInputs={};var numAttributes=gl.getProgramParameter(handle,gl.ACTIVE_ATTRIBUTES);var _loop3=function _loop3(_i67){var attribute=gl.getActiveAttrib(handle,_i67);var location=gl.getAttribLocation(handle,attribute.name);activeInputs[attribute.name]=function(arrayBuf){arrayBuf.bindAtLocation(location);gl.enableVertexAttribArray(location);var divisor=arrayBuf.attributeDivisor;if(divisor){gl.vertexAttribDivisor(location,divisor);}};activeInputs[attribute.name].attributeHash="".concat(location.toString().padStart(1+Math.floor(Math.log10(numAttributes)),"0"),":").concat(attribute.name);};for(var _i67=0;_i67<numAttributes;++_i67){_loop3(_i67);}var numBlocks=gl.getProgramParameter(handle,gl.ACTIVE_UNIFORM_BLOCKS);var _loop4=function _loop4(_i68){var blockName=gl.getActiveUniformBlockName(handle,_i68);var uniformBlockIndex=gl.getUniformBlockIndex(handle,blockName);var uniformBlockBinding=_i68;gl.uniformBlockBinding(handle,uniformBlockIndex,uniformBlockBinding);var buffer=gl.createBuffer();activeInputs[blockName]=function(data){gl.bindBuffer(gl.UNIFORM_BUFFER,buffer);gl.bufferData(gl.UNIFORM_BUFFER,data,gl.DYNAMIC_DRAW);gl.bindBufferBase(gl.UNIFORM_BUFFER,uniformBlockBinding,buffer);};};for(var _i68=0;_i68<numBlocks;++_i68){_loop4(_i68);}var numUniforms=gl.getProgramParameter(handle,gl.ACTIVE_UNIFORMS);var nextUnit=0;var _loop5=function _loop5(_i69){var u=gl.getActiveUniform(handle,_i69);var uName=u.name;if(uName.endsWith("[0]")){uName=uName.substr(0,uName.length-3);}if(uName[uName.length-1]==="\0"){uName=uName.substr(0,uName.length-1);}var location=gl.getUniformLocation(handle,uName);(function(){for(var k in gl){if(u.type===gl[k])return k;}return null;})();if(u.type===gl.SAMPLER_2D||u.type===gl.SAMPLER_CUBE||u.type===gl.SAMPLER_2D_SHADOW||gl instanceof window.WebGL2RenderingContext&&(u.type===gl.UNSIGNED_INT_SAMPLER_2D||u.type===gl.INT_SAMPLER_2D)){var unit=nextUnit++;activeInputs[uName]=function(texture){var bound=texture.bind(unit);if(bound){gl.uniform1i(location,unit);}return bound;};}else{activeInputs[uName]=function(){if(u.size===1){switch(u.type){case gl.BOOL:return function(value){return gl.uniform1i(location,value);};case gl.INT:return function(value){return gl.uniform1i(location,value);};case gl.FLOAT:return function(value){return gl.uniform1f(location,value);};case gl.FLOAT_VEC2:return function(value){return gl.uniform2fv(location,value);};case gl.FLOAT_VEC3:return function(value){return gl.uniform3fv(location,value);};case gl.FLOAT_VEC4:return function(value){return gl.uniform4fv(location,value);};case gl.FLOAT_MAT3:return function(value){return gl.uniformMatrix3fv(location,false,value);};case gl.FLOAT_MAT4:return function(value){return gl.uniformMatrix4fv(location,false,value);};}}else if(u.size>1){switch(u.type){case gl.FLOAT:return function(value){return gl.uniform1fv(location,value);};case gl.FLOAT_VEC2:return function(value){return gl.uniform2fv(location,value);};case gl.FLOAT_VEC3:return function(value){return gl.uniform3fv(location,value);};case gl.FLOAT_VEC4:return function(value){return gl.uniform4fv(location,value);};}}throw"Unhandled uniform ".concat(uName);}();}};for(var _i69=0;_i69<numUniforms;++_i69){_loop5(_i69);}return function(name){var u=activeInputs[name];if(!u){throw"Missing input \"".concat(name,"\"");}return u;};};var tempVec4$1=math.vec4();var DrawShaderSource=function DrawShaderSource(meshDrawHash,programVariables,geometry,material,scene){var materialState=material._state;var phongMaterial=materialState.type==="PhongMaterial";var metallicMaterial=materialState.type==="MetallicMaterial";var specularMaterial=materialState.type==="SpecularMaterial";var attributes=geometry.attributes;var lightSetup=createLightSetup(programVariables,scene._lightsState);var colorize=programVariables.createUniform("vec4","colorize",function(set,state){return set(state.meshColorize);});var fresnel=programVariables.createFragmentDefinition("fresnel",function(name,src){src.push("float ".concat(name,"(vec3 eyeDir, vec3 normal, float edgeBias, float centerBias, float power) {"));src.push(" float fr = abs(dot(eyeDir, normal));");src.push(" float finalFr = clamp((fr - edgeBias) / (centerBias - edgeBias), 0.0, 1.0);");src.push(" return pow(finalFr, power);");src.push("}");});var setupFresnel=function setupFresnel(name,colorSwizzle,getMaterialValue){var fresnelUniform=function fresnelUniform(type,namePostfix,getParameterValue){return programVariables.createUniform(type,name+"Fresnel"+namePostfix,function(set,state){return set(getParameterValue(getMaterialValue(state.material)));});};var edgeBias=fresnelUniform("float","EdgeBias",function(fresnelValue){return fresnelValue.edgeBias;});var centerBias=fresnelUniform("float","CenterBias",function(fresnelValue){return fresnelValue.centerBias;});var power=fresnelUniform("float","Power",function(fresnelValue){return fresnelValue.power;});var edgeColor=fresnelUniform("vec3","EdgeColor",function(fresnelValue){return fresnelValue.edgeColor;});var centerColor=fresnelUniform("vec3","CenterColor",function(fresnelValue){return fresnelValue.centerColor;});return getMaterialValue(material)&&function(viewEyeDir,viewNormal){var f="".concat(fresnel,"(").concat(viewEyeDir,", ").concat(viewNormal,", ").concat(edgeBias,", ").concat(centerBias,", ").concat(power,")");return"mix(".concat(edgeColor+colorSwizzle,", ").concat(centerColor+colorSwizzle,", ").concat(f,")");};};var diffuseFresnel=setupFresnel("diffuse","",function(mtl){return mtl._diffuseFresnel;});var specularFresnel=setupFresnel("specular","",function(mtl){return mtl._specularFresnel;});var emissiveFresnel=setupFresnel("emissive","",function(mtl){return mtl._emissiveFresnel;});var alphaFresnel=setupFresnel("alpha",".r",function(mtl){return mtl._alphaFresnel;});var setup2dTexture=function setup2dTexture(name,getMaterialValue){var initTex=attributes.uv&&getMaterialValue(material);var tex=initTex&&setupTexture(programVariables,"sampler2D",name,initTex.encoding,function(set,state){return set(getMaterialValue(state.material)._state.texture);});return tex&&function(){var matrix=initTex._state.matrix&&programVariables.createUniform("mat4",name+"MapMatrix",function(set,state){return set(getMaterialValue(state.material)._state.matrix);});var getTexCoordExpression=matrix?function(texPos){return"(".concat(matrix," * ").concat(texPos,").st");}:function(texPos){return"".concat(texPos,".st");};var sample=function sample(texturePos,bias){return tex(getTexCoordExpression(texturePos));};sample.getTexCoordExpression=getTexCoordExpression;return sample;}();};var ambientMap=setup2dTexture("ambient",function(mtl){return mtl._ambientMap;});var baseColorMap=setup2dTexture("baseColor",function(mtl){return mtl._baseColorMap;});var diffuseMap=setup2dTexture("diffuse",function(mtl){return mtl._diffuseMap;});var emissiveMap=setup2dTexture("emissive",function(mtl){return mtl._emissiveMap;});var occlusionMap=setup2dTexture("occlusion",function(mtl){return mtl._occlusionMap;});var alphaMap=setup2dTexture("alpha",function(mtl){return mtl._alphaMap;});var metallicMap=setup2dTexture("metallic",function(mtl){return mtl._metallicMap;});var roughnessMap=setup2dTexture("roughness",function(mtl){return mtl._roughnessMap;});var metallicRoughnessMap=setup2dTexture("metallicRoughness",function(mtl){return mtl._metallicRoughnessMap;});var specularMap=setup2dTexture("specular",function(mtl){return mtl._specularMap;});var glossinessMap=setup2dTexture("glossiness",function(mtl){return mtl._glossinessMap;});var specularGlossinessMap=setup2dTexture("specularGlossiness",function(mtl){return mtl._specularGlossinessMap;});var normalMap=setup2dTexture("normal",function(mtl){return mtl._normalMap;});var setupUniform=function setupUniform(name,type,getMaterialValue){var initValue=getMaterialValue(material);var isDefined=type==="float"?initValue!==undefined&&initValue!==null:initValue;return isDefined&&programVariables.createUniform(type,name,function(set,state){return set(getMaterialValue(state.material));});};var materialAmbient=setupUniform("materialAmbient","vec3",function(mtl){return mtl.ambient;});var materialDiffuse=setupUniform("materialDiffuse","vec3",function(mtl){return mtl.diffuse;});var materialBaseColor=setupUniform("materialBaseColor","vec3",function(mtl){return mtl.baseColor;});var materialEmissive=setupUniform("materialEmissive","vec3",function(mtl){return mtl.emissive;});var materialSpecular=setupUniform("materialSpecular","vec3",function(mtl){return mtl.specular;});var materialGlossiness=setupUniform("materialGlossiness","float",function(mtl){return mtl.glossiness;});var materialMetallic=setupUniform("materialMetallic","float",function(mtl){return mtl.metallic;});var materialRoughness=setupUniform("materialRoughness","float",function(mtl){return mtl.roughness;});var materialShininess=setupUniform("materialShininess","float",function(mtl){return mtl.shininess;});var materialSpecularF0=setupUniform("materialSpecularF0","float",function(mtl){return mtl.specularF0;});var materialAlphaModeCutoff=setupUniform("materialAlphaModeCutoff","vec4",function(mtl){var alpha=mtl.alpha;if(alpha!==undefined&&alpha!==null){tempVec4$1[0]=alpha;tempVec4$1[1]=mtl.alphaMode===1?1:0;tempVec4$1[2]=mtl.alphaCutoff;return tempVec4$1;}else{return null;}});var vViewPosition=programVariables.createVarying("vec3","vViewPosition",function(){return"".concat(attributes.position.view,".xyz");});var texturePos=programVariables.createVarying("vec4","texturePos",function(){return"vec4(".concat(attributes.uv,", 1.0, 1.0)");});var vColor=attributes.color&&programVariables.createVarying("vec4","vColor",function(){return attributes.color;});var vViewNormal=programVariables.createVarying("vec3","vViewNormal",function(){return attributes.normal.view;});var texUnitConverter="mat4(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0)";var vDirectionals=lightSetup.directionalLights.map(function(light,i){return{vViewLightReverseDir:programVariables.createVarying("vec3","vViewLightReverseDir".concat(i),function(){return light.getDirection(geometry.viewMatrix,null);}),vShadowPosFromLight:programVariables.createVarying("vec3","vShadowPosFromLight".concat(i),function(){return"(".concat(texUnitConverter," * ").concat(light.shadowParameters.getShadowProjMatrix()," * (").concat(light.shadowParameters.getShadowViewMatrix()," * ").concat(attributes.position.world,")).xyz");})};});var vWorldNormal=programVariables.createVarying("vec3","vWorldNormal",function(){return attributes.normal.world;});var outColor=programVariables.createOutput("vec4","outColor");var saturate=programVariables.createFragmentDefinition("saturate",function(name,src){return src.push("float ".concat(name,"(const in float a) { return clamp(a, 0.0, 1.0); }"));});var BRDF_Specular_GGX=programVariables.createFragmentDefinition("BRDF_Specular_GGX",function(name,src){src.push("vec3 F_Schlick(const in vec3 specularColor, const in float dotLH) {");src.push(" float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );");src.push(" return ( 1.0 - specularColor ) * fresnel + specularColor;");src.push("}");src.push("float G_GGX_Smith(const in float alpha, const in float dotNL, const in float dotNV) {");src.push(" float a2 = ( alpha * alpha );");src.push(" float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * ( dotNL * dotNL ) );");src.push(" float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * ( dotNV * dotNV ) );");src.push(" return 1.0 / ( gl * gv );");src.push("}");src.push("float G_GGX_SmithCorrelated(const in float alpha, const in float dotNL, const in float dotNV) {");src.push(" float a2 = ( alpha * alpha );");src.push(" float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * ( dotNV * dotNV ) );");src.push(" float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * ( dotNL * dotNL ) );");src.push(" return 0.5 / max( gv + gl, 1e-6 );");src.push("}");src.push("float D_GGX(const in float alpha, const in float dotNH) {");src.push(" float a2 = ( alpha * alpha );");src.push(" float denom = ( dotNH * dotNH) * ( a2 - 1.0 ) + 1.0;");src.push(" return 0.31830988618 * a2 / ( denom * denom);");// 1/PI
5186
5186
  src.push("}");src.push("vec3 ".concat(name,"(const in vec3 incidentLightDirection, const in vec3 viewNormal, const in vec3 viewEyeDir, const in vec3 specularColor, const in float roughness) {"));src.push(" float alpha = ( roughness * roughness );");src.push(" vec3 halfDir = normalize( incidentLightDirection + viewEyeDir );");src.push(" float dotNL = ".concat(saturate,"( dot( viewNormal, incidentLightDirection ) );"));src.push(" float dotNV = ".concat(saturate,"( dot( viewNormal, viewEyeDir ) );"));src.push(" float dotNH = ".concat(saturate,"( dot( viewNormal, halfDir ) );"));src.push(" float dotLH = ".concat(saturate,"( dot( incidentLightDirection, halfDir ) );"));src.push(" vec3 F = F_Schlick( specularColor, dotLH );");src.push(" float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );");src.push(" float D = D_GGX( alpha, dotNH );");src.push(" return F * (G * D);");src.push("}");});var BRDF_Specular_GGX_Environment=programVariables.createFragmentDefinition("BRDF_Specular_GGX_Environment",function(name,src){src.push("vec3 ".concat(name,"(const in vec3 viewNormal, const in vec3 viewEyeDir, const in vec3 specularColor, const in float roughness) {"));src.push(" float dotNV = ".concat(saturate,"(dot(viewNormal, viewEyeDir));"));src.push(" const vec4 c0 = vec4( -1, -0.0275, -0.572, 0.022);");src.push(" const vec4 c1 = vec4( 1, 0.0425, 1.04, -0.04);");src.push(" vec4 r = roughness * c0 + c1;");src.push(" float a004 = min(r.x * r.x, exp2(-9.28 * dotNV)) * r.x + r.y;");src.push(" vec2 AB = vec2(-1.04, 1.04) * a004 + r.zw;");src.push(" return specularColor * AB.x + AB.y;");src.push("}");});var perturbNormal2Arb=programVariables.createFragmentDefinition("perturbNormal2Arb",function(name,src){src.push("vec3 ".concat(name,"( vec3 eye_pos, vec3 surf_norm, vec2 uv, vec4 texel ) {"));src.push(" vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );");src.push(" vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );");src.push(" vec2 st0 = dFdx( uv.st );");src.push(" vec2 st1 = dFdy( uv.st );");src.push(" vec3 S = normalize( q0 * st1.t - q1 * st0.t );");src.push(" vec3 T = normalize( -q0 * st1.s + q1 * st0.s );");src.push(" vec3 N = normalize( surf_norm );");src.push(" vec3 mapN = texel.xyz * 2.0 - 1.0;");src.push(" mat3 tsn = mat3( S, T, N );");// src.push(" mapN *= 3.0;");
@@ -5193,7 +5193,7 @@ src.push(" discard;");// TODO: Discard earlier within this shader?
5193
5193
  src.push("}");src.push("vec3 material_diffuseColor;");if(phongMaterial){src.push("material_diffuseColor = diffuseColor;");src.push("roughness = 0.0;");}if(specularMaterial){src.push("float oneMinusSpecularStrength = 1.0 - max(max(specular.r, specular.g ),specular.b);");// Energy conservation
5194
5194
  src.push("material_diffuseColor = diffuseColor * oneMinusSpecularStrength;");src.push("roughness = clamp(1.0 - glossiness, 0.04, 1.0);");}if(metallicMaterial){src.push("float dielectricSpecular = 0.16 * specularF0 * specularF0;");src.push("material_diffuseColor = diffuseColor * (1.0 - dielectricSpecular) * (1.0 - metallic);");src.push("roughness = clamp(roughness, 0.04, 1.0);");src.push("specular = mix(vec3(dielectricSpecular), diffuseColor, metallic);");}// ENVIRONMENT AND REFLECTION MAP SHADING
5195
5195
  if(phongMaterial||metallicMaterial||specularMaterial){src.push("const float PI = 3.14159265359;");src.push("vec3 reflDiff = vec3(0.0);");src.push("vec3 reflSpec = vec3(0.0);");lightSetup.getIrradiance&&src.push("reflDiff += ".concat(lightSetup.getIrradiance("normalize(".concat(vWorldNormal,")")),";"));if(lightSetup.getReflection){var reflectVec="reflect(-viewEyeDir, viewNormal)";var spec=phongMaterial?"0.2 * PI * ".concat(lightSetup.getReflection(reflectVec)):function(){var blinnExpFromRoughness="2.0 / pow(roughness + 0.0001, 2.0) - 2.0";var specularBRDFContrib="".concat(BRDF_Specular_GGX_Environment,"(viewNormal, viewEyeDir, specular, roughness)");var viewReflectVec="normalize((vec4(".concat(reflectVec,", 0.0) * ").concat(geometry.viewMatrix,").xyz)");var maxMIPLevelScalar="4.0";var desiredMIPLevel="".concat(maxMIPLevelScalar," - 0.39624 - 0.25 * log2(pow(").concat(blinnExpFromRoughness,", 2.0) + 1.0)");var mipLevel="clamp(".concat(desiredMIPLevel,", 0.0, ").concat(maxMIPLevelScalar,")");//TODO: a random factor - fix this
5196
- return"".concat(specularBRDFContrib," * ").concat(lightSetup.getReflection(viewReflectVec,mipLevel));}();src.push("reflSpec += ".concat(spec,";"));}if(lightSetup.directionalLights.some(function(ligth){return ligth.shadowParameters;})){src.push("const vec4 bitShift = vec4(1.0, 1.0/256.0, 1.0/(256.0 * 256.0), 1.0/(256.0*256.0*256.0));");src.push("const float texelSize = 1.0 / 1024.0;");src.push("float shadow;");src.push("float fragmentDepth;");}lightSetup.directionalLights.forEach(function(light,i){if(light.shadowParameters){var shadowAcneRemover="0.007";src.push("fragmentDepth = ".concat(vDirectionals[i].vShadowPosFromLight,".z - ").concat(shadowAcneRemover,";"));src.push("shadow = 0.0;");src.push("for (int x = -3; x <= 3; x++) {");src.push(" for (int y = -3; y <= 3; y++) {");src.push(" float texelDepth = dot(texture(".concat(light.getShadowMap(),", ").concat(vDirectionals[i].vShadowPosFromLight,".xy + vec2(x, y) * texelSize), bitShift);"));src.push(" if (fragmentDepth < texelDepth) {");src.push(" shadow += 1.0;");src.push(" }");src.push(" }");src.push("}");src.push("shadow /= 9.0;");}src.push("vec3 lightColor".concat(i," = ").concat(light.getColor()).concat(light.shadowParameters?" * "+"shadow":"",";"));src.push("vec3 lightDirection".concat(i," = ").concat(light.isWorldSpace?vDirectionals[i].vViewLightReverseDir:light.getDirection(null,vViewPosition),";"));var dotNL="".concat(saturate,"(dot(viewNormal, lightDirection").concat(i,"))");src.push("vec3 irradiance".concat(i," = ").concat(dotNL," * lightColor").concat(i,";"));src.push("reflDiff += irradiance".concat(i,";"));var spec=phongMaterial?"lightColor".concat(i," * specular * pow(max(dot(reflect(-lightDirection").concat(i,", -viewNormal), viewEyeDir), 0.0), shininess)"):"irradiance".concat(i," * PI * ").concat(BRDF_Specular_GGX,"(lightDirection").concat(i,", viewNormal, viewEyeDir, specular, roughness)");src.push("reflSpec += ".concat(spec,";"));});}var ambient=phongMaterial&&"".concat(lightSetup.getAmbientColor()," * diffuseColor");src.push("vec3 outgoingLight = emissiveColor + occlusion * (reflDiff * material_diffuseColor + reflSpec)"+(ambient?" + "+ambient:"")+";");}else{src.push("vec3 ambientColor = ".concat(phongMaterial&&materialAmbient||"vec3(1.0)",";"));phongMaterial&&ambientMap&&src.push("ambientColor *= ".concat(ambientMap(texturePos),".rgb;"));src.push("ambientColor *= ".concat(lightSetup.getAmbientColor(),";"));src.push("vec3 outgoingLight = emissiveColor + ambientColor;");}src.push("vec4 fragColor = ".concat(colorize," * vec4(outgoingLight, alpha);"));src.push("".concat(outColor," = ").concat(getGammaOutputExpression?getGammaOutputExpression("fragColor"):"fragColor",";"));}};};var LambertShaderSource=function LambertShaderSource(meshDrawHash,programVariables,geometry,material,scene){var lightSetup=createLightSetup(programVariables,scene._lightsState);var colorize=programVariables.createUniform("vec4","colorize",function(set,state){return set(state.meshColorize);});var materialAlpha=programVariables.createUniform("float","materialAlpha",function(set,state){return set(state.material.alpha);});var materialColor=programVariables.createUniform("vec3","materialColor",function(set,state){return set(state.material.color);});var materialEmissive=programVariables.createUniform("vec3","materialEmissive",function(set,state){return set(state.material.emissive);});var vColor=programVariables.createVarying("vec4","vColor",function(){var attributes=geometry.attributes;var lightComponents=[lightSetup.getAmbientColor()].concat(attributes.normal?lightSetup.directionalLights.map(function(light){return"(max(dot(".concat(attributes.normal.view,", ").concat(light.getDirection(geometry.viewMatrix,attributes.position.view),"), 0.0) * ").concat(light.getColor(),")");}):[]);return"".concat(colorize," * vec4((").concat(lightComponents.join(" + "),") * ").concat(materialColor," + ").concat(materialEmissive,", ").concat(materialAlpha,");");// TODO: How to have ambient bright enough for canvas BG but not too bright for scene?
5196
+ return"".concat(specularBRDFContrib," * ").concat(lightSetup.getReflection(viewReflectVec,mipLevel));}();src.push("reflSpec += ".concat(spec,";"));}if(lightSetup.directionalLights.some(function(ligth){return ligth.shadowParameters;})){src.push("const vec4 bitShift = vec4(1.0, 1.0/256.0, 1.0/(256.0 * 256.0), 1.0/(256.0*256.0*256.0));");src.push("const float texelSize = 1.0 / 1024.0;");src.push("float shadow;");src.push("float fragmentDepth;");}lightSetup.directionalLights.forEach(function(light,i){if(light.shadowParameters){var shadowAcneRemover="0.007";src.push("fragmentDepth = ".concat(vDirectionals[i].vShadowPosFromLight,".z - ").concat(shadowAcneRemover,";"));src.push("shadow = 0.0;");src.push("for (int x = -3; x <= 3; x++) {");src.push(" for (int y = -3; y <= 3; y++) {");src.push(" float texelDepth = dot(texture(".concat(light.getShadowMap(),", ").concat(vDirectionals[i].vShadowPosFromLight,".xy + vec2(x, y) * texelSize), bitShift);"));src.push(" if (fragmentDepth < texelDepth) {");src.push(" shadow += 1.0;");src.push(" }");src.push(" }");src.push("}");src.push("shadow /= 9.0;");}src.push("vec3 lightColor".concat(i," = ").concat(light.getColor()).concat(light.shadowParameters?" * "+"shadow":"",";"));src.push("vec3 lightDirection".concat(i," = ").concat(light.isViewSpace?light.getDirection(null,vViewPosition):vDirectionals[i].vViewLightReverseDir,";"));var dotNL="".concat(saturate,"(dot(viewNormal, lightDirection").concat(i,"))");src.push("vec3 irradiance".concat(i," = ").concat(dotNL," * lightColor").concat(i,";"));src.push("reflDiff += irradiance".concat(i,";"));var spec=phongMaterial?"lightColor".concat(i," * specular * pow(max(dot(reflect(-lightDirection").concat(i,", -viewNormal), viewEyeDir), 0.0), shininess)"):"irradiance".concat(i," * PI * ").concat(BRDF_Specular_GGX,"(lightDirection").concat(i,", viewNormal, viewEyeDir, specular, roughness)");src.push("reflSpec += ".concat(spec,";"));});}var ambient=phongMaterial&&"".concat(lightSetup.getAmbientColor()," * diffuseColor");src.push("vec3 outgoingLight = emissiveColor + occlusion * (reflDiff * material_diffuseColor + reflSpec)"+(ambient?" + "+ambient:"")+";");}else{src.push("vec3 ambientColor = ".concat(phongMaterial&&materialAmbient||"vec3(1.0)",";"));phongMaterial&&ambientMap&&src.push("ambientColor *= ".concat(ambientMap(texturePos),".rgb;"));src.push("ambientColor *= ".concat(lightSetup.getAmbientColor(),";"));src.push("vec3 outgoingLight = emissiveColor + ambientColor;");}src.push("vec4 fragColor = ".concat(colorize," * vec4(outgoingLight, alpha);"));src.push("".concat(outColor," = ").concat(getGammaOutputExpression?getGammaOutputExpression("fragColor"):"fragColor",";"));}};};var LambertShaderSource=function LambertShaderSource(meshDrawHash,programVariables,geometry,material,scene){var lightSetup=createLightSetup(programVariables,scene._lightsState);var colorize=programVariables.createUniform("vec4","colorize",function(set,state){return set(state.meshColorize);});var materialAlpha=programVariables.createUniform("float","materialAlpha",function(set,state){return set(state.material.alpha);});var materialColor=programVariables.createUniform("vec3","materialColor",function(set,state){return set(state.material.color);});var materialEmissive=programVariables.createUniform("vec3","materialEmissive",function(set,state){return set(state.material.emissive);});var vColor=programVariables.createVarying("vec4","vColor",function(){var attributes=geometry.attributes;var lightComponents=[lightSetup.getAmbientColor()].concat(attributes.normal?lightSetup.directionalLights.map(function(light){return"(max(dot(".concat(attributes.normal.view,", ").concat(light.getDirection(geometry.viewMatrix,attributes.position.view),"), 0.0) * ").concat(light.getColor(),")");}):[]);return"".concat(colorize," * vec4((").concat(lightComponents.join(" + "),") * ").concat(materialColor," + ").concat(materialEmissive,", ").concat(materialAlpha,");");// TODO: How to have ambient bright enough for canvas BG but not too bright for scene?
5197
5197
  });var outColor=programVariables.createOutput("vec4","outColor");return{getHash:function getHash(){return[meshDrawHash,scene.gammaOutput?"go":"",lightSetup.getHash(),material._state.hash];},programName:"Lambert",canActAsBackground:true,discardPoints:true,setupPointSize:true,setsLineWidth:true,appendFragmentOutputs:function appendFragmentOutputs(src,getGammaOutputExpression){return src.push("".concat(outColor," = ").concat(getGammaOutputExpression?getGammaOutputExpression(vColor):vColor,";"));}};};var EmphasisShaderSource=function EmphasisShaderSource(meshHash,programVariables,geometry,scene,isFill){var lightSetup=isFill&&createLightSetup(programVariables,scene._lightsState);var uColor=programVariables.createUniform("vec3","uColor",function(set,state){return set(isFill?state.material.fillColor:state.material.edgeColor);});var uAlpha=programVariables.createUniform("float","uAlpha",function(set,state){return set(isFill?state.material.fillAlpha:state.material.edgeAlpha);});var vColor=programVariables.createVarying("vec4","vColor",function(){var attributes=geometry.attributes;var lightComponents=isFill&&[lightSetup.getAmbientColor()].concat(attributes.normal?lightSetup.directionalLights.map(function(light){return"(max(dot(".concat(attributes.normal.view,", ").concat(light.getDirection(geometry.viewMatrix,attributes.position.view),"), 0.0) * ").concat(light.getColor(),")");}):[]);// TODO: A blending mode for emphasis materials, to select add/multiply/mix
5198
5198
  // `vec4((mix(reflectedColor, ${uColor}, 0.7)), ${uAlpha})`
5199
5199
  return"vec4(".concat(uColor).concat(lightComponents?" * (".concat(lightComponents.join(" + "),")"):"",", ").concat(uAlpha,")");// `${vColor} = vec4(reflectedColor + ${uColor}, ${uAlpha})`
@@ -12122,7 +12122,7 @@ gl.bindFramebuffer(gl.FRAMEBUFFER,framebuf);if(!gl.isFramebuffer(framebuf)){thro
12122
12122
  * @param {Number[]} [cfg.dir=[1.0, 1.0, 1.0]] A unit vector indicating the direction that the light is shining, given in either World or View space, depending on the value of the ````space```` parameter.
12123
12123
  * @param {Number[]} [cfg.color=[0.7, 0.7, 0.8 ]] The color of this DirLight.
12124
12124
  * @param {Number} [cfg.intensity=1.0] The intensity of this DirLight, as a factor in range ````[0..1]````.
12125
- * @param {String} [cfg.space="view"] The coordinate system the DirLight is defined in - ````"view"```` or ````"space"````.
12125
+ * @param {String} [cfg.space="view"] The coordinate system the DirLight is defined in - ````"view"```` or ````"world"````.
12126
12126
  * @param {Boolean} [cfg.castsShadow=false] Flag which indicates if this DirLight casts a castsShadow.
12127
12127
  */function DirLight(owner){var _this70;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DirLight);_this70=_super32.call(this,owner,cfg);_this70._shadowRenderBuf=null;_this70._shadowViewMatrix=null;_this70._shadowProjMatrix=null;_this70._shadowViewMatrixDirty=true;_this70._shadowProjMatrixDirty=true;var camera=_this70.scene.camera;var canvas=_this70.scene.canvas;_this70._onCameraViewMatrix=camera.on("viewMatrix",function(){_this70._shadowViewMatrixDirty=true;});_this70._onCameraProjMatrix=camera.on("projMatrix",function(){_this70._shadowProjMatrixDirty=true;});_this70._onCanvasBoundary=canvas.on("boundary",function(){_this70._shadowProjMatrixDirty=true;});_this70._state=new RenderState({type:"dir",dir:math.vec3([1.0,1.0,1.0]),color:math.vec3([0.7,0.7,0.8]),intensity:1.0,space:cfg.space||"view",castsShadow:false,getShadowViewMatrix:function getShadowViewMatrix(){if(_this70._shadowViewMatrixDirty){if(!_this70._shadowViewMatrix){_this70._shadowViewMatrix=math.identityMat4();}var _camera=_this70.scene.camera;var dir=_this70._state.dir;var look=_camera.look;var eye=[look[0]-dir[0],look[1]-dir[1],look[2]-dir[2]];var _up=[0,1,0];math.lookAtMat4v(eye,look,_up,_this70._shadowViewMatrix);_this70._shadowViewMatrixDirty=false;}return _this70._shadowViewMatrix;},getShadowProjMatrix:function getShadowProjMatrix(){if(_this70._shadowProjMatrixDirty){// TODO: Set when canvas resizes
12128
12128
  if(!_this70._shadowProjMatrix){_this70._shadowProjMatrix=math.identityMat4();}math.orthoMat4c(-40,40,-40,40,-40.0,80,_this70._shadowProjMatrix);// left, right, bottom, top, near, far, dest
@@ -18215,7 +18215,7 @@ return entity.aabb;}ids=[ids];// Must be an entity type
18215
18215
  *
18216
18216
  * @param {String[]} ids Array of {@link Entity#id} values.
18217
18217
  * @param {Number[]} [colorize=(1,1,1)] RGB colorize factors, multiplied by the rendered pixel colors.
18218
- * @returns {Boolean} True if any {@link Entity}s changed opacity, else false if all updates were redundant and not applied.
18218
+ * @returns {Boolean} True if any {@link Entity}s were colorized, else false if all updates were redundant and not applied.
18219
18219
  */},{key:"setObjectsColorized",value:function setObjectsColorized(ids,colorize){return this.withObjects(ids,function(entity){entity.colorize=colorize;});}/**
18220
18220
  * Batch-updates {@link Entity#opacity} on {@link Entity}s that represent objects.
18221
18221
  *