@woosh/meep-engine 2.119.10 → 2.119.12

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.
Files changed (29) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/package.json +1 -1
  3. package/src/engine/EngineBootstrapper.d.ts.map +1 -1
  4. package/src/engine/EngineBootstrapper.js +6 -8
  5. package/src/engine/EngineConfiguration.d.ts.map +1 -1
  6. package/src/engine/EngineConfiguration.js +3 -0
  7. package/src/engine/ecs/Entity.d.ts.map +1 -1
  8. package/src/engine/ecs/Entity.js +1 -1
  9. package/src/engine/ecs/dynamic_actions/DataScope.d.ts +36 -0
  10. package/src/engine/ecs/dynamic_actions/DataScope.d.ts.map +1 -0
  11. package/src/engine/ecs/dynamic_actions/DataScope.js +126 -0
  12. package/src/engine/ecs/dynamic_actions/DynamicActorSystem.d.ts +1 -1
  13. package/src/engine/ecs/dynamic_actions/DynamicActorSystem.d.ts.map +1 -1
  14. package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +2 -2
  15. package/src/engine/ecs/dynamic_actions/RuleExecution.d.ts.map +1 -1
  16. package/src/engine/ecs/dynamic_actions/RuleExecution.js +1 -1
  17. package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
  18. package/src/engine/graphics/texture/sampler/Sampler2D.js +13 -25
  19. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts +13 -0
  20. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts.map +1 -0
  21. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js +35 -0
  22. package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts.map +1 -1
  23. package/src/engine/knowledge/database/StaticKnowledgeDatabase.js +4 -0
  24. package/src/generation/filtering/numeric/complex/CellFilterCurvature.d.ts.map +1 -1
  25. package/src/generation/filtering/numeric/complex/CellFilterCurvature.js +4 -5
  26. package/src/generation/filtering/numeric/math/poly/CellFilterCubicFunction.d.ts.map +1 -1
  27. package/src/generation/filtering/numeric/math/poly/CellFilterCubicFunction.js +5 -9
  28. package/src/view/tooltip/DomTooltipManager.d.ts.map +1 -1
  29. package/src/view/tooltip/DomTooltipManager.js +2 -0
@@ -1 +1 @@
1
- function t(t,e){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}class e{appendDescriptionOf(t){throw new Error("Not Implemented")}appendList(t,e,n,r){throw new Error("Not Implemented")}appendText(t){throw new Error("Not Implemented")}appendValue(t){throw new Error("Not Implemented")}appendValueList(t,e,n,r){throw new Error("Not Implemented")}}class n{describeTo(t){throw new Error("Not Implemented")}}class r extends n{value;constructor(t){super(),this.value=t}describeTo(t){t.appendValue(this.value)}}class i{#t;constructor(t){this.#t=t}*[Symbol.iterator](){for(const t of this.#t)yield new r(t)}}class s extends e{appendDescriptionOf(t){return t.describeTo(this),this}#e(t){this.appendText('"'),this.appendText(t),this.appendText('"')}appendValue(t){return null==t?this.appendText("null"):void 0===t?this.appendText("undefined"):"string"==typeof t?this.#e(t):"number"==typeof t?this.appendText(function(t){return String(t)}(t)):Array.isArray(t)?this.appendValueList("[",", ","]",t):(this.appendText("<"),this.appendText(function(t){try{return String(t)}catch(t){return"VALUE@0"}}(t)),this.appendText(">")),this}appendValueList(t,e,n,r){return this.appendList(t,e,n,new i(r)),this}appendList(t,e,n,r){let i=!1;this.appendText(t);const s=r[Symbol.iterator]();for(let t=s.next();!0!==t.done;t=s.next())i&&this.appendText(e),this.appendDescriptionOf(t.value),i=!0;return this.appendText(n),this}}class o extends s{value="";appendText(t){return this.value+=t,this}}function a(t,e){if(!t)throw new Error(e||"AssertionError")}function c(t,e,n,r,i){let s,o,a;for(a=0;a<i;a++)s=e+a,o=r+a,n[o]=t[s]}a.enum=function(t,e,n="value"){for(let n in e)if(e[n]===t)return;throw new Error(`${n}(=${t}) is not a valid enumerable value, valid values are: [${Object.values(e).join(", ")}]`)},a.notEqual=function(t,e,n){a(t!==e,n)},a.notOk=function(t,e){a(!t,e)},a.equal=function(t,e,n){if(t!==e){const r=`${t} !== ${e}`;throw new Error(void 0!==n&&""!==n?`${n}. ${r}`:r)}},a.logicalyEqual=function(t,e,n){},a.ok=a,a.greaterThan=function(t,e,n){if(!(t>e)){let r="";throw void 0!==n&&(r+=n+". "),r+=`Expected ${t} > ${e}.`,new Error(r)}},a.greaterThanOrEqual=function(t,e,n){if(!(t>=e)){let r="";throw void 0!==n&&(r+=n+". "),r+=`Expected ${t} >= ${e}.`,new Error(r)}},a.lessThan=function(t,e,n){if(!(t<e)){let r="";throw void 0!==n&&(r+=n+". "),r+=`Expected ${t} < ${e}.`,new Error(r)}},a.lessThanOrEqual=function(t,e,n){if(!(t<=e)){let r="";throw void 0!==n&&(r+=n+". "),r+=`Expected ${t} <= ${e}.`,new Error(r)}},a.typeOf=function(t,e,n="value"){const r=typeof t;if(r!==e)throw new Error(`expected ${n} to be ${e}, instead was '${r}'(=${t})`)},a.arrayHas=function(t,e,n="Array does not contain the item"){},a.arrayHasNo=function(t,e,n="Array contains the item"){},a.arrayEqual=function(e,n,r="Arrays are not equal"){if(!t(e,n))throw new Error(r)},a.isInstanceOf=function(t,e,n="value",r=e.name){},a.isNumber=function(t,e="value"){const n=typeof t;if("number"!==n)throw new Error(`expected ${e} to be a number, instead was '${n}'(=${t})`)},a.isString=function(t,e="value"){const n=typeof t;if("string"!==n)throw new Error(`expected ${e} to be a string, instead was '${n}'(=${t})`)},a.isBoolean=function(t,e="value"){const n=typeof t;if("boolean"!==n)throw new Error(`expected ${e} to be a boolean, instead was '${n}'(=${t})`)},a.isFunction=function(t,e="value"){const n=typeof t;if("function"!==n)throw new Error(`expected ${e} to be a function, instead was '${n}'(=${t})`)},a.isObject=function(t,e="value"){const n=typeof t;if("object"!==n)throw new Error(`expected ${e} to be an object, instead was '${n}'(=${t})`)},a.isInteger=function(t,e="value"){if(!Number.isInteger(t))throw new Error(`${e} must be an integer, instead was ${t}`)},a.isNonNegativeInteger=function(t,e="value"){if(t<0)throw new Error(`${e} must be >= 0, instead was ${t}`)},a.isArray=function(t,e="value"){if(!Array.isArray(t))throw new Error(`expected ${e} to be an array, instead was something else (typeof ='${typeof t}')`)},a.isArrayLike=function(t,e="value"){if(!Array.isArray(t)&&!function(t){if("object"!=typeof t)return!1;if(null===t)return!1;const e=t.constructor;return e===Uint8Array||e===Uint16Array||e===Uint32Array||e===Int8Array||e===Int16Array||e===Int32Array||e===Float32Array||e===Float64Array||e===BigUint64Array||e===BigInt64Array}(t))throw new Error(`expected ${e} to be an array-like structure, instead was something else (typeof ='${typeof t}')`)},a.defined=function(t,e="value"){if(void 0===t)throw new Error(`${e} is undefined`)},a.isNull=function(t,e){if(null!==t)throw new Error(`${e} is NOT null`)},a.notNull=function(t,e="value"){if(null===t)throw new Error(`${e} is null`)},a.notNaN=function(t,e="value"){if(Number.isNaN(t))throw new Error(`${e} must be a valid number, instead was NaN`)},a.isFiniteNumber=function(t,e="value"){if(!Number.isFinite(t))throw new Error(`${e} must be a finite number, instead was ${t}`)},a.that=function(t,e,n){if(n.matches(t))return;const r=new o;throw r.appendText(`Expected ${e} to be `),n.describeTo(r),r.appendText(" instead "),n.describeMismatch(t,r),new Error(r.value)};const h=new Uint32Array(781250);function u(t,e){return t<e?e:t}function d(t,e){return t<e?t:e}function l(t,e,n,r,i,s){const o=n[r+0],a=n[r+1],c=n[r+2],h=n[r+3],l=n[r+4],f=n[r+5],g=i[s+0],p=i[s+1],y=i[s+2],_=i[s+3],m=i[s+4],w=i[s+5],v=d(o,g),A=d(a,p),x=d(c,y),b=u(h,_),E=u(l,m),U=u(f,w);t[e+0]=v,t[e+1]=A,t[e+2]=x,t[e+3]=b,t[e+4]=E,t[e+5]=U}function f(t,e,n,r,i,s,o,a){t[e]=n,t[e+1]=r,t[e+2]=i,t[e+3]=s,t[e+4]=o,t[e+5]=a}function g(t,e,n,r,i,s){const o=r-t,a=s-n;return(i-e)*(o+a)+a*o}function p(t){let e=t;return e=50331903&(e|e<<16),e=50393103&(e|e<<8),e=51130563&(e|e<<4),e=153391689&(e|e<<2),e}function y(t,e,n){const r=t[n],i=t[n+1],s=t[n+2];f(t,e,r,i,s,r,i,s)}function _(t,e,n){const r=t[e],i=t[e+1],s=t[e+2];return function(t,e,n,r){const i=r[0],s=r[1],o=r[2],a=1023*(t-i)/(r[3]-i),c=1023*(e-s)/(r[4]-s),h=1023*(n-o)/(r[5]-o);return function(t,e,n){return p(t)|p(e)<<1|p(n)<<2}(Math.round(a),Math.round(c),Math.round(h))}(.5*(r+t[e+3]),.5*(i+t[e+4]),.5*(s+t[e+5]),n)}h.pointer=0;const m=h;class w{__data_buffer;__data_float32;__data_uint32;__node_count_binary=0;__node_count_leaf=0;constructor(){this.data=new ArrayBuffer(320)}estimateByteSize(){return this.data.byteLength+248}getTotalBoxCount(){return this.__node_count_binary+this.__node_count_leaf}get binary_node_count(){return this.__node_count_binary}get leaf_node_count(){return this.__node_count_leaf}getLeafBlockAddress(){return 6*this.__node_count_binary}get float32(){return this.__data_float32}get uint32(){return this.__data_uint32}set data(t){this.__data_buffer=t,this.__data_float32=new Float32Array(this.__data_buffer),this.__data_uint32=new Uint32Array(this.__data_buffer)}get data(){return this.__data_buffer}getNodeAddress(t){const e=this.__node_count_binary,n=t-e;return n<0?6*t:6*e+7*n}initialize_structure(){const t=4*(6*this.__node_count_binary+7*this.__node_count_leaf);this.__data_buffer.byteLength<t&&(this.data=new ArrayBuffer(t))}setLeafCount(t){this.__node_count_leaf=t;const e=function(t){let e=t-1;return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}(t);this.__node_count_binary=t<=1?e:e-1}getLeafAddress(t){return 7*t+6*this.__node_count_binary}setLeafData(t,e,n,r,i,s,o,a){const c=this.getLeafAddress(t);f(this.__data_float32,c,n,r,i,s,o,a),this.__data_uint32[c+6]=e}readBounds(t,e,n){c(this.__data_float32,t,e,n,6)}readLeafPayload(t){const e=this.getLeafBlockAddress()+7*t+6;return this.__data_uint32[e]}compute_total_surface_area(){let t=0;const e=new Float32Array(6);for(let n=0;n<this.getTotalBoxCount();n++){let r;r=n<this.__node_count_binary?6*n:7*(n-this.__node_count_binary)+this.getLeafBlockAddress(),this.readBounds(r,e,0),t+=g(e[0],e[1],e[2],e[3],e[4],e[5])}return t}sort_morton(t){const e=6*this.__node_count_binary;if(this.__node_count_leaf<2)return;const n=m.pointer;let r,i,s=n;m[s++]=0,m[s++]=this.__node_count_leaf-1;const o=this.__data_float32;for(;s>n;){s-=2;const n=m[s+1],a=m[s];r=a,i=n;const c=_(o,7*(a+n>>1)+e,t);for(;r<=i;){for(;_(o,7*r+e,t)<c;)r++;for(;_(o,7*i+e,t)>c;)i--;r<=i&&(r!==i&&this.__swap_leaves(r,i),r++,i--)}a<i&&(m[s++]=a,m[s++]=i),r<n&&(m[s++]=r,m[s++]=n)}}__swap_leaves(t,e){const n=this.getLeafBlockAddress(),r=7*t+n,i=7*e+n;!function(t,e,n,r,i){for(let i=0;i<7;i++){const s=e+i,o=r+i,a=n[o];n[o]=t[s],t[s]=a}}(this.__data_float32,r,this.__data_float32,i)}build(){const t=this.__node_count_binary,e=6*t;let n,r,i,s,o=Math.floor(Math.log(t)/Math.log(2));i=Math.pow(2,o),r=6*(i-1);const a=this.__node_count_leaf,h=this.__data_float32;for(n=0;n<i;n++){const t=n<<1,i=t+1,s=e+7*t;i<a?l(h,r,h,s,h,e+7*i):t<a?c(h,s,h,r,6):y(this.__data_float32,r,r-6),r+=6}for(o--;o>=0;o--)for(i=1<<o,s=i-1,n=0;n<i;n++){const t=6*(1+(s<<1));l(h,6*s,h,t,h,t+6),s++}}}function v(t,e,n){let r=t;return r<e&&(r=e),r<n&&(r=n),r}function A(t,e,n){let r=t;return r>e&&(r=e),r>n&&(r=n),r}function x(t,e,n,r,i,s){const o=t.getLeafAddress(e);!function(t,e,n,r,i,s){const o=3*r,a=3*i,c=3*s,h=n[o],u=n[o+1],d=n[o+2],l=n[a],f=n[a+1],g=n[a+2],p=n[c],y=n[c+1],_=n[c+2];t[e]=A(h,l,p),t[e+1]=A(u,f,y),t[e+2]=A(d,g,_),t[e+3]=v(h,l,p),t[e+4]=v(u,f,y),t[e+5]=v(d,g,_)}(t.__data_float32,o,n,r,i,s),t.__data_uint32[o+6]=e}function b(t){return 1===t.faces.length}function E(t,e){return t.v0===e?t.v1:t.v1===e?t.v0:null}var U,$="undefined"!=typeof Float32Array?Float32Array:Array;function F(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function S(t,e){return-1===t.indexOf(e)&&(t.push(e),!0)}function z(){}function C(t,e=","){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,e)}function V(t,e){t.__edges.delete(e)}function B(t,e,n=0,r=t.length){const i=n+r;for(let r=n;r<i;r++)if(t[r]===e)return t.splice(r,1),!0;return!1}function M(t,e){return t.v0===e||t.v1===e}function I(t,e,n){const r=t.v0,i=t.v1;return!(r!==e&&r!==n||i!==e&&i!==n)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),U=new $(3),$!=Float32Array&&(U[0]=0,U[1]=0,U[2]=0);let L=0;class T{index=L++;v0=null;v1=null;faces=[];lengthSqr=-1;get byteSize(){return 128+8*this.faces.length+10}getVertexByIndex(t){if(0===t)return this.v0;if(1===t)return this.v1;throw new Error("Index out of bounds")}copy(t){this.v0=t.v0,this.v1=t.v1,this.lengthSqr=t.lengthSqr,this.faces=t.faces.slice()}clone(){const t=new T;return t.copy(this),t}validate(t){let e=!0;const n=this.faces,r=n.length;for(let i=0;i<r;i++)n[i].containsEdge(this)||(t(`Missing back-link from face[${i}]`),e=!1);return this.v0.containsEdge(this)||(t("Missing back-link from vertex v0"),e=!1),this.v1.containsEdge(this)||(t("Missing back-link from vertex v1"),e=!1),e}isLinked(){return this.v0.containsEdge(this)}unlink(){const t=this.v0,e=this.v1;t.removeEdge(this),t!==e&&e.removeEdge(this);const n=this.faces,r=n.length;for(let t=0;t<r;t++)n[t].removeEdge(this)}isDegenerateEdge(){return this.v0===this.v1}isTopologyBorder(){return b(this)}get length(){return this.lengthSqr<0&&this.computeSquaredLength(),Math.sqrt(this.lengthSqr)}computeSquaredLength(){const t=this.v0,e=this.v1,n=t.x,r=t.y,i=t.z,s=n-e.x,o=r-e.y,a=i-e.z;this.lengthSqr=s*s+o*o+a*a}replaceVertex(t,e){t===this.v0&&(this.v0=e),t===this.v1&&(this.v1=e)}merge(t){const e=t.faces,n=this.faces,r=e.length;for(let i=0;i<r;i++){const r=e[i];r.removeEdge(t),-1===n.indexOf(r)&&(n.push(r),r.addUniqueEdge(this))}t.v0.removeEdge(t),t.v1.removeEdge(t)}containsFace(t){return-1!==this.faces.indexOf(t)}addFace(t){this.faces.push(t)}addUniqueFace(t){S(this.faces,t)}removeFace(t){B(this.faces,t)}getOtherVertex(t){return E(this,t)}containsVertex(t){return M(this,t)}containsBothVertices(t,e){return I(this,t,e)}containsSameVerticesAs(t){return I(this,t.v0,t.v1)}}function q(t,e,n){const r=t.length;for(let i=0;i<r;i++)t[i]===e&&(t[i]=n);return t}function N(t,e,n,r,i,s,o,a,c,h,u){const d=c-s,l=h-o,f=u-a,g=n-s,p=r-o,y=i-a,_=l*y-f*p,m=f*g-d*y,w=d*p-l*g,v=function(t,e,n){return t*t+e*e+n*n}(_,m,w);if(0===v)return t[e]=0,t[e+1]=1,void(t[e+2]=0);const A=1/Math.sqrt(v),x=_*A,b=m*A,E=w*A;t[e]=x,t[e+1]=b,t[e+2]=E}function k(t,e,n){return Math.sqrt(t*t+e*e+n*n)}T.prototype.isTopoEdge=!0;let O=0;class j{index=O++;edges=[];faces=[];x=0;y=0;z=0;get 0(){return this.x}get 1(){return this.y}get 2(){return this.z}get byteSize(){return 112+8*this.edges.length+10+8*this.faces.length+10}copy(t){this.x=t.x,this.y=t.y,this.z=t.z,this.index=t.index,this.faces=t.faces.slice(),this.edges=t.edges.slice()}clone(){const t=new j;return t.copy(this),t}validate(t){let e=!0;const n=this.faces,r=n.length;for(let i=0;i<r;i++)n[i].containsVertex(this)||(t(`Missing back-link from face[${i}]`),e=!1);const i=this.edges,s=i.length;for(let n=0;n<s;n++)M(i[n],this)||(t(`Missing back-link from edge[${n}]`),e=!1);return e}distanceTo(t){return e=this.x,n=this.y,r=this.z,k(t.x-e,t.y-n,t.z-r);var e,n,r}addFace(t){this.faces.push(t)}addUniqueFace(t){return S(this.faces,t)}containsFace(t){return-1!==this.faces.indexOf(t)}removeFace(t){B(this.faces,t)}addEdge(t){this.edges.push(t)}addUniqueEdge(t){return S(this.edges,t)}replaceEdge(t,e){const n=this.edges,r=n.indexOf(t);n[r]=e}containsEdge(t){return-1!==this.edges.indexOf(t)}removeEdge(t){return B(this.edges,t)}replaceAnotherVertex(t){throw new Error('deprecated, use "tm_vert_splice" instead')}computeNeighbourVertices(t,e){let n=0;const r=this.edges,i=r.length;for(let s=0;s<i;s++){const i=r[s].getOtherVertex(this);t[e+n]=i,n++}return n}static from(t,e,n){const r=new j;return r.x=t,r.y=e,r.z=n,r}}j.prototype.isTopoVertex=!0;let D=0;class R{index=D++;vertices=[];edges=[];normal=[0,0,0];get byteSize(){return 100+8*this.vertices.length+10+8*this.edges.length+10+24+10}copy(t){this.index=t.index,this.vertices=t.vertices.slice(),this.edges=t.edges.slice(),F(this.normal,t.normal)}clone(){const t=new R;return t.copy(this),t}validate(t){let e=!0;const n=this.vertices,r=n.length;3!==r&&(t(`Expected number of vertices is 3, instead got ${r}`),e=!1);for(let i=0;i<r;i++)n[i].containsFace(this)||(t(`Missing back-link from vertex[${i}]`),e=!1);const i=this.edges,s=i.length;3!==s&&(t(`Expected number of edges is 3, instead got ${s}`),e=!1);for(let n=0;n<s;n++)i[n].containsFace(this)||(t(`Missing back-link from edge[${n}]`),e=!1);return e}isLinked(){return this.vertices[0].containsFace(this)}replaceEdge(t,e){q(this.edges,t,e)}replaceVertex(t,e){q(this.vertices,t,e)}isDegenerateTopology(){const t=this.vertices,e=t[0],n=t[1],r=t[2];return e===n||e===r||n===r}unlink(){const t=this.vertices,e=t.length;for(let n=0;n<e;n++)t[n].removeFace(this);const n=this.edges,r=n.length;for(let t=0;t<r;t++)n[t].removeFace(this)}addEdge(t){this.edges.push(t)}addUniqueEdge(t){return S(this.edges,t)}removeEdge(t){B(this.edges,t)}containsEdge(t){return-1!==this.edges.indexOf(t)}computeNormal(){const t=this.vertices,e=t[0],n=t[1],r=t[2];!function(t,e,n,r){N(t,0,e[0],e[1],e[2],n[0],n[1],n[2],r[0],r[1],r[2])}(this.normal,e,n,r)}setVertexAt(t,e){this.vertices[t]=e}containsVertex(t){return-1!==this.vertices.indexOf(t)}getEdgeNeighbours(t,e){let n=0;const r=this.edges,i=r.length;for(let s=0;s<i;s++){const i=r[s].faces,o=i.length;for(let r=0;r<o;r++){const s=i[r];s!==this&&(t[e+n]=s,n++)}}return n}static fromPoints(t,e,n,r,i,s,o,a,c){const h=j.from(t,e,n),u=j.from(r,i,s),d=j.from(o,a,c),l=new T,f=new T,g=new T;l.v0=h,l.v1=u,f.v0=u,f.v1=d,g.v0=d,g.v1=h;const p=new R;return p.edges.push(l,f,g),p.vertices.push(h,u,d),h.faces.push(p),u.faces.push(p),d.faces.push(p),l.faces.push(p),f.faces.push(p),g.faces.push(p),h.edges.push(l,g),u.edges.push(l,f),d.edges.push(f,g),p}}R.prototype.isTopoFace=!0;class J{vertices=[];__edges=new Set;__faces=new Set;get byteSize(){let t=0;for(let e=0;e<this.vertices.length;e++)t+=this.vertices[e].byteSize;for(const e of this.__edges)t+=e.byteSize;for(const e of this.__faces)t+=e.byteSize;return t}getEdges(){return this.__edges}getFaces(){return this.__faces}getFaceByIndex(t){for(const e of this.__faces)if(e.index===t)return e}validate(t=z){let e=!0,n="",r=0;function i(i){t(`${n}[${r}]: ${i}`),e=!1}n="Edge",r=0;const s=this.getEdges();for(let t of s){t.validate(i),this.containsVertex(t.v0)||i("Link to off-mesh vertex v0"),this.containsVertex(t.v1)||i("Link to off-mesh vertex v1");const e=t.faces,n=e.length;for(let t=0;t<n;t++){const n=e[t];this.containsFace(n)||i(`Link to off-mesh face[${t}]`)}r++}const o=this.getFaces();n="Face",r=0;for(let t of o){t.validate(i);const e=t.edges,n=e.length;for(let t=0;t<n;t++){const n=e[t];this.containsEdge(n)||i(`Link to off-mesh edge[${t}]`)}const s=t.vertices,o=s.length;for(let t=0;t<o;t++){const e=s[t];this.containsVertex(e)||i(`Link to off-mesh vertex[${t}]`)}r++}const a=this.vertices,c=a.length;n="Vertex";for(let t=0;t<c;t++){r=t;const e=a[t];e.validate(i);const n=e.edges,s=n.length;for(let t=0;t<s;t++){const e=n[t];this.containsEdge(e)||i(`Link to off-mesh edge[${t}]`)}const o=e.faces,c=o.length;for(let t=0;t<c;t++){const e=o[t];this.containsFace(e)||i(`Link to off-mesh face[${t}]`)}}return e}clone(){const t=new J;return t.add(this),t}buildVertexMapping(){const t=new Map,e=this.vertices,n=e.length;for(let r=0;r<n;r++){const n=e[r];t.set(n.index,n)}return t}_addWithVertexMap(t,e){const n=t.getFaces();for(let t of n)this.addFaceCopy(t,e)}addFaceCopy(t,e){const n=new R;F(n.normal,t.normal);const r=t.vertices;for(let t=0;t<3;t++){const i=r[t];let s=e.get(i.index);void 0===s&&(s=new j,s.index=i.index,s.x=i.x,s.y=i.y,s.z=i.z,e.set(i.index,s),this.addVertex(s)),n.setVertexAt(t,s),s.addUniqueFace(n)}this.addFace(n),this.patchFaceEdges(n)}patchFaceEdges(t){const e=t.vertices,n=e[0],r=e[1],i=e[2],s=this.ensureEdge(n,r),o=this.ensureEdge(r,i),a=this.ensureEdge(i,n);s.addUniqueFace(t),o.addUniqueFace(t),a.addUniqueFace(t),t.addUniqueEdge(s),t.addUniqueEdge(o),t.addUniqueEdge(a)}add(t){const e=this.buildVertexMapping();this._addWithVertexMap(t,e)}addVertex(t){this.vertices.push(t)}addUniqueVertex(t){S(this.vertices,t)}removeVertex(t){var e;e=t,B(this.vertices,e)}containsVertex(t){return-1!==this.vertices.indexOf(t)}addEdge(t){this.__edges.add(t)}addUniqueEdge(t){this.__edges.add(t)}removeEdge(t){V(this,t)}containsEdge(t){return this.__edges.has(t)}addFace(t){this.__faces.add(t)}injectManyFaces(t){for(let e of t)this.injectFace(e)}injectFace(t){this.addFace(t);const e=t.edges,n=e.length;for(let t=0;t<n;t++){const n=e[t];this.addUniqueEdge(n)}const r=t.vertices,i=r.length;for(let t=0;t<i;t++){const e=r[t];this.addUniqueVertex(e)}}removeFace(t){var e;e=t,this.__faces.delete(e)}containsFace(t){return this.__faces.has(t)}ensureEdge(t,e){const n=t.edges,r=n.length;for(let i=0;i<r;i++){const r=n[i];if(E(r,t)===e)return r}const i=new T;return i.v0=t,i.v1=e,t.edges.push(i),e.edges.push(i),this.__edges.add(i),i}mergeEdges(){const t=this.getEdges();for(let e of t){const n=e.v0,r=e.v1;for(let i of t){if(e===i)continue;const t=i.v0,s=i.v1;if(n===t){if(r!==s)continue}else{if(n!==s)continue;if(r!==t)continue}V(this,i),e.merge(i)}}}computeEdgeSquaredLengths(){const t=this.getEdges();for(let e of t)e.computeSquaredLength()}setVerticesFromArray(t){const e=t.length/3,n=this.vertices;for(let r=0;r<e;r++){const e=3*r,i=new j;i.index=r,i.x=t[e],i.y=t[e+1],i.z=t[e+2],n[r]=i}}setFacesFromIndexArray(t){const e=t.length,n=this.vertices,r=e/3;for(let e=0;e<r;e++){const r=3*e,i=t[r],s=t[r+1],o=t[r+2];this.createTriangle(e,n[i],n[s],n[o])}}setFacedUnindexed(){const t=this.vertices,e=t.length/3;for(let n=0;n<e;n++){const e=3*n;this.createTriangle(n,t[e],t[e+1],t[e+2])}}build(t,e){this.setVerticesFromArray(t),null==e?this.setFacedUnindexed():this.setFacesFromIndexArray(e)}createTriangle(t,e,n,r){const i=new R;i.index=t;const s=this.ensureEdge(e,n),o=this.ensureEdge(n,r),a=this.ensureEdge(r,e);return s.faces.push(i),o.faces.push(i),a.faces.push(i),i.vertices.push(e,n,r),i.edges.push(s,o,a),e.faces.push(i),n.faces.push(i),r.faces.push(i),this.__faces.add(i),i}toString(){return`TopoMesh{ vertices: ${C(this.vertices.length)}, edges: ${C(this.getEdges().size)}, faces: ${C(this.getFaces().size)} }`}}J.prototype.isTopoMesh=!0;const P=[],H=[],W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let t=0,e=64;t<e;++t)P[t]=W[t],H[W.charCodeAt(t)]=t;function G(t,e,n){const r=[];for(let s=e;s<n;s+=3){const e=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]);r.push(P[(i=e)>>18&63]+P[i>>12&63]+P[i>>6&63]+P[63&i])}var i;return r.join("")}H["-".charCodeAt(0)]=62,H["_".charCodeAt(0)]=63;const Y=16383;class K{static encode(t){return function(t){const e=t.length,n=e%3,r=[],i=e-n;for(let e=0;e<i;e+=Y){const n=G(t,e,e+Y>i?i:e+Y);r.push(n)}if(1===n){const n=t[e-1];r.push(P[n>>2]+P[n<<4&63]+"==")}else if(2===n){const n=(t[e-2]<<8)+t[e-1];r.push(P[n>>10]+P[n>>4&63]+P[n<<2&63]+"=")}return r.join("")}(new Uint8Array(t))}static decode(t){return function(t){let e;const n=function(t){const e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");let n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}(t),r=n[0],i=n[1],s=new Uint8Array(function(t,e){return 3*(t+e)/4-e}(r,i));let o=0;const a=i>0?r-4:r;let c=0;for(;c<a;c+=4){const n=t.charCodeAt(c),r=t.charCodeAt(c+1),i=t.charCodeAt(c+2),a=t.charCodeAt(c+3);e=H[n]<<18|H[r]<<12|H[i]<<6|H[a],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=255&e}if(2===i){const n=t.charCodeAt(c),r=t.charCodeAt(c+1);e=H[n]<<2|H[r]>>4,s[o++]=255&e}if(1===i){const n=t.charCodeAt(c),r=t.charCodeAt(c+1),i=t.charCodeAt(c+2);e=H[n]<<10|H[r]<<4|H[i]>>2,s[o++]=e>>8&255,s[o++]=255&e}return s}(t).buffer}}const Q="uint8",X="uint16",Z="uint32",tt="int8",et="int16",nt="int32",rt="float32",it="float64",st={[Q]:Uint8Array,[X]:Uint16Array,[Z]:Uint32Array,[tt]:Int8Array,[et]:Int16Array,[nt]:Int32Array,float16:Uint16Array,[rt]:Float32Array,[it]:Float64Array};function ot(t){const e=Object.getPrototypeOf(t).constructor;switch(e){case Uint8Array:case Uint8ClampedArray:return Q;case Uint16Array:return X;case Uint32Array:return Z;case Int8Array:return tt;case Int16Array:return et;case Int32Array:return nt;case Float32Array:return rt;case Float64Array:return it;default:throw new Error(`unsupported constructor type ${e.name}`)}}function at(t,e,n){return t<e?e:t>n?n:t}function ct(t,e,n){return(e-t)*n+t}function ht(t,e,n,r,i){return.5*(r-e+(2*e-5*n+4*r-i+(3*(n-r)+i-e)*t)*t)*t+n}function ut(t){const e=t>>0;return 4294967295*(t-e)^e}class dt{constructor(t=[],e=1,n=0,r=0){if(!Number.isInteger(e)||e<0)throw new Error(`itemSize must be a non-negative integer, instead was ${e}`);if(!Number.isInteger(n)||n<0)throw new Error(`width must be a non-negative integer, instead was ${n}`);if(!Number.isInteger(r)||n<0)throw new Error(`height must be a non-negative integer, instead was ${r}`);if(void 0===t)throw new Error("data was undefined");if(t.length<n*r*e)throw new Error(`Buffer underflow, data.length(=${t.length}) is too small. Expected at least ${n*r*e}`);this.width=n,this.height=r,this.itemSize=e,this.data=t,this.version=0}sampleCatmullRomUV(t,e,n){const r=this.itemSize;for(let i=0;i<r;i++)n[i]=this.sampleChannelCatmullRomUV(t,e,i)}sampleChannelCatmullRomUV(t,e,n){const r=t*this.width-.5,i=e*this.height-.5;return this.sampleChannelCatmullRom(r,i,n)}sampleChannelCatmullRom(t,e,n){const r=Math.floor(t),i=Math.floor(e),s=t-r,o=e-i,a=s*(s*(1-.5*s)-.5),c=o*(o*(1-.5*o)-.5),h=s*(.5+s*(2-1.5*s)),u=o*(.5+o*(2-1.5*o)),d=s*s*(.5*s-.5),l=o*o*(.5*o-.5),f=1+s*s*(1.5*s-2.5)+h,g=1+o*o*(1.5*o-2.5)+u,p=r-1,y=i-1,_=r+2,m=i+2,w=r+h/f,v=i+u/g;let A=0;return A+=this.sampleChannelBilinear(p,y,n)*a*c,A+=this.sampleChannelBilinear(w,y,n)*f*c,A+=this.sampleChannelBilinear(_,y,n)*d*c,A+=this.sampleChannelBilinear(p,v,n)*a*g,A+=this.sampleChannelBilinear(w,v,n)*f*g,A+=this.sampleChannelBilinear(_,v,n)*d*g,A+=this.sampleChannelBilinear(p,m,n)*a*l,A+=this.sampleChannelBilinear(w,m,n)*f*l,A+=this.sampleChannelBilinear(_,m,n)*d*l,A}sampleBicubicUV(t,e,n){const r=this.itemSize;for(let i=0;i<r;i++)n[i]=this.sampleChannelBicubicUV(t,e,i)}sampleBicubic(t,e,n,r){const i=this.itemSize;for(let s=0;s<i;s++)n[s+r]=this.sampleChannelBicubic(t,e,s)}sampleChannelBicubicUV(t,e,n){const r=t*this.width,i=e*this.height;return this.sampleChannelBicubic(r-.5,i-.5,n)}sampleChannelBicubic(t,e,n){const r=this.itemSize,i=this.width,s=this.height,o=this.data,a=i*r,c=i-1,h=s-1,l=at(t,0,c),f=at(e,0,h),g=0|l,p=0|f,y=l-g,_=f-p,m=u(0,g-1),w=u(0,p-1),v=d(c,g+1),A=d(h,p+1),x=d(c,v+1),b=w*a+n,E=p*a+n,U=A*a+n,$=d(h,A+1)*a+n,F=m*r,S=g*r,z=v*r,C=x*r,V=o[b+F],B=o[b+S],M=o[b+z],I=o[b+C],L=o[E+F],T=o[E+S],q=o[E+z],N=o[E+C],k=o[U+F],O=o[U+S],j=o[U+z],D=o[U+C],R=o[$+F],J=o[$+S],P=o[$+z],H=o[$+C],W=ht(y,V,B,M,I),G=ht(y,L,T,q,N),Y=ht(y,k,O,j,D),K=ht(y,R,J,P,H);return ht(_,W,G,Y,K)}sampleBilinearUV(t,e,n,r=0){const i=this.itemSize;for(let s=0;s<i;s++)n[s+r]=this.sampleChannelBilinearUV(t,e,s)}sampleBilinear(t,e,n,r=0){const i=this.itemSize;for(let s=0;s<i;s++)n[s+r]=this.sampleChannelBilinear(t,e,s)}sampleChannelBilinearUV(t,e,n){const r=t*this.width-.5,i=e*this.height-.5;return this.sampleChannelBilinear(r,i,n)}sampleChannelBilinear(t,e,n){const r=this.itemSize,i=this.width,s=i*r,o=this.height-1,a=at(t,0,i-1),c=at(e,0,o),h=a>>>0,u=c>>>0,d=u*s,l=h*r+n,f=d+l;let g,p;g=a===h?h:h+1,p=c===u?u:u+1;const y=this.data,_=y[f];if(h===g&&u===p)return _;const m=a-h,w=c-u,v=g*r+n,A=p*s,x=A+l,b=A+v,E=y[d+v],U=y[x],$=y[b],F=ct(_,E,m),S=ct(U,$,m);return ct(F,S,w)}sampleNearestUV(t,e,n){const r=this.width,i=this.height,s=Math.round(t*r-.5),o=Math.round(e*i-.5);this.read(at(s,0,r-1),at(o,0,i-1),n)}readChannel(t,e,n){const r=(e*this.width+t)*this.itemSize+n;return this.data[r]}read(t,e,n){const r=this.width,i=this.itemSize,s=(e*r+t)*i;for(let t=0;t<i;t++)n[t]=this.data[s+t]}write(t,e,n){const r=this.width,i=this.itemSize,s=(e*r+t)*i;for(let t=0;t<i;t++)this.data[s+t]=n[t]}point2index(t,e){return t+e*this.width}index2point(t,e){const n=this.width,r=t%n,i=t/n|0;e.set(r,i)}copy(t,e,n,r,i,s,o){const a=Math.min(s,t.width-e,this.width-r),c=Math.min(o,t.height-n,this.height-i),h=this.itemSize,u=t.itemSize,d=Math.min(h,u),l=h*this.width,f=u*t.width,g=t.data,p=this.data;let y,_,m;for(_=0;_<c;_++){const t=(_+i)*l,s=(_+n)*f;for(y=0;y<a;y++){const n=t+(y+r)*h,i=s+(y+e)*u;for(m=0;m<d;m++)p[n+m]=g[i+m]}}this.version++}zeroFill(t,e,n,r){const i=at(t,0,this.width),s=at(e,0,this.height),o=at(t+n,0,this.width),a=at(e+r,0,this.height),c=this.data,h=this.itemSize,u=h*this.width,d=i*h,l=o*h;let f;for(f=s;f<a;f++){const t=f*u;c.fill(0,t+d,t+l)}this.version++}channelFill(t,e){const n=this.itemSize,r=this.data,i=r.length;for(let s=t;s<i;s+=n)r[s]=e;this.version++}fill(t,e,n,r,i){const s=this.width,o=this.height,a=at(t,0,s),c=at(e,0,o),h=at(t+n,0,s),u=at(e+r,0,o),d=this.data,l=this.itemSize,f=l*s;let g,p,y;for(g=c;g<u;g++){const t=g*f;for(p=a;p<h;p++){const e=t+p*l;for(y=0;y<l;y++)d[e+y]=i[y]}}this.version++}writeChannel(t,e,n,r){const i=(e*this.width+t)*this.itemSize+n;this.data[i]=r,this.version++}set(t,e,n){const r=this.data,i=this.itemSize,s=i*this.width*e+t*i;for(let t=0;t<i;t++)r[s+t]=n[t];this.version++}traverseCircle(t,e,n,r){let i,s;const o=0|t,a=0|e,c=n*n,h=Math.ceil(n);for(s=-h;s<=h;s++){const t=s*s;for(i=-h;i<=h;i++)i*i+t<=c&&r(o+i,a+s,this)}}resize(t,e,n=!0){const r=this.width,i=this.height;if(r===t&&i===e)return;const s=this.itemSize,o=t*e*s,a=this.data,c=new(function(t){if(t instanceof Int8Array)return Int8Array;if(t instanceof Int16Array)return Int16Array;if(t instanceof Int32Array)return Int32Array;if(t instanceof Uint8Array)return Uint8Array;if(t instanceof Uint8ClampedArray)return Uint8ClampedArray;if(t instanceof Uint16Array)return Uint16Array;if(t instanceof Uint32Array)return Uint32Array;if(t instanceof Float32Array)return Float32Array;if(t instanceof Float64Array)return Float64Array;if(Array.isArray(t))return Array;throw new TypeError("Unsupported array type")}(a))(o);if(n)if(t===r)c.set(a.subarray(0,Math.min(a.length,o)));else{const n=d(e,i),o=d(t,r);for(let e=0;e<n;e++)for(let n=0;n<o;n++){const i=(e*t+n)*s,o=(e*r+n)*s;for(let t=0;t<s;t++)c[i+t]=a[o+t]}}this.width=t,this.height=e,this.data=c,this.version++}computeByteSize(){let t;const e=this.data;return t=Array.isArray(e)?8*e.length:e.buffer.byteLength,t+280}equals(e){return this===e||this.width===e.width&&this.height===e.height&&this.itemSize===e.itemSize&&function(e,n){if(e===n)return!0;const r=e.length;if(r!==n.length)return!1;const i=e.constructor;if(i!==n.constructor)return!1;if(0===r)return!0;if(r<128)return t(e,n);const s=e.byteLength;if(s!==n.byteLength)return!1;const o=e.buffer,a=n.buffer,c=e.byteOffset,h=n.byteOffset;if(o===a&&c===h)return!0;let u=e,d=n;const l=i.BYTES_PER_ELEMENT,f=function(t,e,n){const r=t|e|n;return 0==(3&r)?4:0==(1&r)?2:1}(c,h,s);return l<4&&4===f?(u=new Uint32Array(o,c,s>>>2),d=new Uint32Array(a,h,s>>>2)):l<2&&2===f&&(u=new Uint16Array(o,c,s>>>1),d=new Uint16Array(a,h,s>>>1)),t(u,d)}(this.data,e.data)}hash(){const t=this.itemSize,e=this.width,n=this.height,r=this.data;let i=((65535&e)<<16|65535&n)^t;const s=e*n,o=Math.min(2048,s),a=Math.max(1,Math.round(s/o));if(function(t){const e=t.constructor;return e===Uint8ClampedArray||e===Uint8Array||e===Uint16Array||e===Uint32Array||e===Int8Array||e===Int16Array||e===Int32Array}(r))for(let e=0;e<s;e+=a)for(let n=0;n<t;n++)i=(i<<5)-i+r[e*t+n];else for(let e=0;e<s;e+=a)for(let n=0;n<t;n++)i=(i<<5)-i+ut(r[e*t+n]);return i}clone(){let t;return t=Array.isArray(this.data)?this.data.slice():new(0,this.data.constructor)(this.data),new dt(t,this.itemSize,this.width,this.height)}toJSON(){const t=K.encode(this.data.buffer);return{height:this.height,width:this.width,itemSize:this.itemSize,type:ot(this.data),data:t}}fromJSON({height:t,width:e,itemSize:n,type:r,data:i}){const s=function(t){const e=st[t];if(void 0===e)throw new Error(`Unsupported data type '${t}'`);return e}(r);if("string"==typeof i){const t=K.decode(i);this.data=new s(t)}else{if(!Array.isArray(i))throw new Error("Unsupported data format");this.data=new s(i)}this.height=t,this.width=e,this.itemSize=n}static uint8clamped(t,e,n){const r=new Uint8ClampedArray(e*n*t);return new dt(r,t,e,n)}static uint8(t,e,n){const r=new Uint8Array(e*n*t);return new dt(r,t,e,n)}static uint16(t,e,n){const r=new Uint16Array(e*n*t);return new dt(r,t,e,n)}static uint32(t,e,n){const r=new Uint32Array(e*n*t);return new dt(r,t,e,n)}static int8(t,e,n){const r=new Int8Array(e*n*t);return new dt(r,t,e,n)}static int16(t,e,n){const r=new Int16Array(e*n*t);return new dt(r,t,e,n)}static int32(t,e,n){const r=new Int32Array(e*n*t);return new dt(r,t,e,n)}static float32(t,e,n){const r=new Float32Array(e*n*t);return new dt(r,t,e,n)}static float64(t,e,n){const r=new Float64Array(e*n*t);return new dt(r,t,e,n)}}function lt(t,e,n,r){const i=n[r],s=n[r+1],o=n[r+2];t[e]+=i,t[e+1]+=s,t[e+2]+=o}function ft(t,e,n,r,i,s){const o=3*n,a=3*r,c=3*i;N(t,e,s[o],s[o+1],s[o+2],s[a],s[a+1],s[a+2],s[c],s[c+1],s[c+2])}function gt(t,e,n,r){const i=n[r],s=n[r+1],o=n[r+2],a=1/k(i,s,o);t[e]=i*a,t[e+1]=s*a,t[e+2]=o*a}dt.prototype.isSampler2D=!0,dt.typeName="Sampler2D";const pt=new Float64Array(3),yt={build:function(t,e,n,r,i,s){const o=n.x*s,a=n.y*s,c=o-1,h=a-1;let u=0,d=0;const l=o*a,f=new Float32Array(3*l),g=new Float32Array(3*l),p=new Float32Array(2*l);let y,_;const m=n.y/i.y/h,w=n.x/i.x/c,v=e.y/i.y,A=e.x/i.x,x=i.x*r.x,b=i.y*r.y;let E,U,$;for(y=0;y<a;y++){const e=y*m+v;for($=e*b,_=0;_<o;_++){const n=_*w+A;E=n*x,U=t.sampleChannelBicubicUV(n,e,0),f[u]=E,f[u+1]=U,f[u+2]=$,p[d]=n,p[d+1]=e,u+=3,d+=2}}u=0;const F=new(function(t){if(t<=256)return Uint8Array;if(t<=65536)return Uint16Array;if(t<=4294967295)return Uint32Array;throw new Error(`Unsupported size ${t}`)}(f.length/3))(c*h*6);for(y=0;y<h;y++)for(_=0;_<c;_++){const t=_+o*y,e=_+o*(y+1),n=_+1+o*(y+1),r=_+1+o*y;F[u]=t,F[u+1]=e,F[u+2]=r,F[u+3]=e,F[u+4]=n,F[u+5]=r,u+=6}return function(t,e,n){const r=n.length;for(let i=0;i<r;i+=3){const r=n[i],s=n[i+1],o=n[i+2];ft(pt,0,r,s,o,t),lt(e,3*r,pt,0),lt(e,3*s,pt,0),lt(e,3*o,pt,0)}!function(t,e=0,n=t.length-e){const r=e+n;for(let n=e;n<r;n+=3)gt(t,n,t,n)}(e)}(f,g,F),{indices:F,vertices:f,normals:g,uvs:p}}};self.Lib={build_bvh(t,e){const n=new w;return function(t,e,n){const r=n.length/3;t.setLeafCount(r),t.initialize_structure();for(let i=0;i<r;i++){const r=3*i;x(t,i,e,n[r],n[r+1],n[r+2])}t.build()}(n,t,e),n},Sampler2D:dt,BufferedGeometryArraysBuilder:yt,tensionOptimizeUV:function(t,e,n,r=3){const i=new J;i.build(t,n),i.computeEdgeSquaredLengths();const s=t.length/3;for(let t=0;t<r;t++)t:for(let t=0;t<s;t++){const n=i.vertices[t],r=n.edges,s=r.length;if(0===s)continue;let o=0,a=0,c=0;for(let t=0;t<s;t++){const i=r[t];if(b(i))continue t;const s=2*E(i,n).index,h=e[s],u=e[s+1],d=1/i.lengthSqr;o+=h*d,a+=u*d,c+=d}const h=o/c,u=a/c,d=2*n.index;e[d]=h,e[d+1]=u}},sampler2d_channel_compute_min:function(t,e=0){const n=t.itemSize,r=t.data,i=r.length;if(0===i)return;let s=r[e],o=e;for(let t=e+n;t<i;t+=n){const e=r[t];s>e&&(s=e,o=t)}const a=t.width,c=o/n|0;return{index:o,value:s,x:c%a,y:c/a|0}},sampler2d_channel_compute_max:function(t,e=0){const n=t.itemSize,r=t.data,i=r.length;if(0===i)return;let s=r[e],o=e;for(let t=e+n;t<i;t+=n){const e=r[t];s<e&&(s=e,o=t)}const a=t.width,c=o/n|0;return{index:o,value:s,x:c%a,y:c/a|0}}};
1
+ function t(t,e){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}class e{appendDescriptionOf(t){throw new Error("Not Implemented")}appendList(t,e,n,r){throw new Error("Not Implemented")}appendText(t){throw new Error("Not Implemented")}appendValue(t){throw new Error("Not Implemented")}appendValueList(t,e,n,r){throw new Error("Not Implemented")}}class n{describeTo(t){throw new Error("Not Implemented")}}class r extends n{value;constructor(t){super(),this.value=t}describeTo(t){t.appendValue(this.value)}}class i{#t;constructor(t){this.#t=t}*[Symbol.iterator](){for(const t of this.#t)yield new r(t)}}class s extends e{appendDescriptionOf(t){return t.describeTo(this),this}#e(t){this.appendText('"'),this.appendText(t),this.appendText('"')}appendValue(t){return null==t?this.appendText("null"):void 0===t?this.appendText("undefined"):"string"==typeof t?this.#e(t):"number"==typeof t?this.appendText(function(t){return String(t)}(t)):Array.isArray(t)?this.appendValueList("[",", ","]",t):(this.appendText("<"),this.appendText(function(t){try{return String(t)}catch(t){return"VALUE@0"}}(t)),this.appendText(">")),this}appendValueList(t,e,n,r){return this.appendList(t,e,n,new i(r)),this}appendList(t,e,n,r){let i=!1;this.appendText(t);const s=r[Symbol.iterator]();for(let t=s.next();!0!==t.done;t=s.next())i&&this.appendText(e),this.appendDescriptionOf(t.value),i=!0;return this.appendText(n),this}}class o extends s{value="";appendText(t){return this.value+=t,this}}function a(t,e){if(!t)throw new Error(e||"AssertionError")}function c(t,e,n,r,i){let s,o,a;for(a=0;a<i;a++)s=e+a,o=r+a,n[o]=t[s]}a.enum=function(t,e,n="value"){for(let n in e)if(e[n]===t)return;throw new Error(`${n}(=${t}) is not a valid enumerable value, valid values are: [${Object.values(e).join(", ")}]`)},a.notEqual=function(t,e,n){a(t!==e,n)},a.notOk=function(t,e){a(!t,e)},a.equal=function(t,e,n){if(t!==e){const r=`${t} !== ${e}`;throw new Error(void 0!==n&&""!==n?`${n}. ${r}`:r)}},a.logicalyEqual=function(t,e,n){},a.ok=a,a.greaterThan=function(t,e,n){if(!(t>e)){let r="";throw void 0!==n&&(r+=n+". "),r+=`Expected ${t} > ${e}.`,new Error(r)}},a.greaterThanOrEqual=function(t,e,n){if(!(t>=e)){let r="";throw void 0!==n&&(r+=n+". "),r+=`Expected ${t} >= ${e}.`,new Error(r)}},a.lessThan=function(t,e,n){if(!(t<e)){let r="";throw void 0!==n&&(r+=n+". "),r+=`Expected ${t} < ${e}.`,new Error(r)}},a.lessThanOrEqual=function(t,e,n){if(!(t<=e)){let r="";throw void 0!==n&&(r+=n+". "),r+=`Expected ${t} <= ${e}.`,new Error(r)}},a.typeOf=function(t,e,n="value"){const r=typeof t;if(r!==e)throw new Error(`expected ${n} to be ${e}, instead was '${r}'(=${t})`)},a.arrayHas=function(t,e,n="Array does not contain the item"){},a.arrayHasNo=function(t,e,n="Array contains the item"){},a.arrayEqual=function(e,n,r="Arrays are not equal"){if(!t(e,n))throw new Error(r)},a.isInstanceOf=function(t,e,n="value",r=e.name){},a.isNumber=function(t,e="value"){const n=typeof t;if("number"!==n)throw new Error(`expected ${e} to be a number, instead was '${n}'(=${t})`)},a.isString=function(t,e="value"){const n=typeof t;if("string"!==n)throw new Error(`expected ${e} to be a string, instead was '${n}'(=${t})`)},a.isBoolean=function(t,e="value"){const n=typeof t;if("boolean"!==n)throw new Error(`expected ${e} to be a boolean, instead was '${n}'(=${t})`)},a.isFunction=function(t,e="value"){const n=typeof t;if("function"!==n)throw new Error(`expected ${e} to be a function, instead was '${n}'(=${t})`)},a.isObject=function(t,e="value"){const n=typeof t;if("object"!==n)throw new Error(`expected ${e} to be an object, instead was '${n}'(=${t})`)},a.isInteger=function(t,e="value"){if(!Number.isInteger(t))throw new Error(`${e} must be an integer, instead was ${t}`)},a.isNonNegativeInteger=function(t,e="value"){if(t<0)throw new Error(`${e} must be >= 0, instead was ${t}`)},a.isArray=function(t,e="value"){if(!Array.isArray(t))throw new Error(`expected ${e} to be an array, instead was something else (typeof ='${typeof t}')`)},a.isArrayLike=function(t,e="value"){if(!Array.isArray(t)&&!function(t){if("object"!=typeof t)return!1;if(null===t)return!1;const e=t.constructor;return e===Uint8Array||e===Uint16Array||e===Uint32Array||e===Int8Array||e===Int16Array||e===Int32Array||e===Float32Array||e===Float64Array||e===BigUint64Array||e===BigInt64Array}(t))throw new Error(`expected ${e} to be an array-like structure, instead was something else (typeof ='${typeof t}')`)},a.defined=function(t,e="value"){if(void 0===t)throw new Error(`${e} is undefined`)},a.isNull=function(t,e){if(null!==t)throw new Error(`${e} is NOT null`)},a.notNull=function(t,e="value"){if(null===t)throw new Error(`${e} is null`)},a.notNaN=function(t,e="value"){if(Number.isNaN(t))throw new Error(`${e} must be a valid number, instead was NaN`)},a.isFiniteNumber=function(t,e="value"){if(!Number.isFinite(t))throw new Error(`${e} must be a finite number, instead was ${t}`)},a.that=function(t,e,n){if(n.matches(t))return;const r=new o;throw r.appendText(`Expected ${e} to be `),n.describeTo(r),r.appendText(" instead "),n.describeMismatch(t,r),new Error(r.value)};const h=new Uint32Array(781250);function u(t,e){return t<e?e:t}function d(t,e){return t<e?t:e}function l(t,e,n,r,i,s){const o=n[r+0],a=n[r+1],c=n[r+2],h=n[r+3],l=n[r+4],f=n[r+5],g=i[s+0],p=i[s+1],y=i[s+2],_=i[s+3],w=i[s+4],m=i[s+5],v=d(o,g),A=d(a,p),x=d(c,y),b=u(h,_),E=u(l,w),U=u(f,m);t[e+0]=v,t[e+1]=A,t[e+2]=x,t[e+3]=b,t[e+4]=E,t[e+5]=U}function f(t,e,n,r,i,s,o,a){t[e]=n,t[e+1]=r,t[e+2]=i,t[e+3]=s,t[e+4]=o,t[e+5]=a}function g(t,e,n,r,i,s){const o=r-t,a=s-n;return(i-e)*(o+a)+a*o}function p(t){let e=t;return e=50331903&(e|e<<16),e=50393103&(e|e<<8),e=51130563&(e|e<<4),e=153391689&(e|e<<2),e}function y(t,e,n){const r=t[n],i=t[n+1],s=t[n+2];f(t,e,r,i,s,r,i,s)}function _(t,e,n){const r=t[e],i=t[e+1],s=t[e+2];return function(t,e,n,r){const i=r[0],s=r[1],o=r[2],a=1023*(t-i)/(r[3]-i),c=1023*(e-s)/(r[4]-s),h=1023*(n-o)/(r[5]-o);return function(t,e,n){return p(t)|p(e)<<1|p(n)<<2}(Math.round(a),Math.round(c),Math.round(h))}(.5*(r+t[e+3]),.5*(i+t[e+4]),.5*(s+t[e+5]),n)}h.pointer=0;const w=h;class m{__data_buffer;__data_float32;__data_uint32;__node_count_binary=0;__node_count_leaf=0;constructor(){this.data=new ArrayBuffer(320)}estimateByteSize(){return this.data.byteLength+248}getTotalBoxCount(){return this.__node_count_binary+this.__node_count_leaf}get binary_node_count(){return this.__node_count_binary}get leaf_node_count(){return this.__node_count_leaf}getLeafBlockAddress(){return 6*this.__node_count_binary}get float32(){return this.__data_float32}get uint32(){return this.__data_uint32}set data(t){this.__data_buffer=t,this.__data_float32=new Float32Array(this.__data_buffer),this.__data_uint32=new Uint32Array(this.__data_buffer)}get data(){return this.__data_buffer}getNodeAddress(t){const e=this.__node_count_binary,n=t-e;return n<0?6*t:6*e+7*n}initialize_structure(){const t=4*(6*this.__node_count_binary+7*this.__node_count_leaf);this.__data_buffer.byteLength<t&&(this.data=new ArrayBuffer(t))}setLeafCount(t){this.__node_count_leaf=t;const e=function(t){let e=t-1;return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}(t);this.__node_count_binary=t<=1?e:e-1}getLeafAddress(t){return 7*t+6*this.__node_count_binary}setLeafData(t,e,n,r,i,s,o,a){const c=this.getLeafAddress(t);f(this.__data_float32,c,n,r,i,s,o,a),this.__data_uint32[c+6]=e}readBounds(t,e,n){c(this.__data_float32,t,e,n,6)}readLeafPayload(t){const e=this.getLeafBlockAddress()+7*t+6;return this.__data_uint32[e]}compute_total_surface_area(){let t=0;const e=new Float32Array(6);for(let n=0;n<this.getTotalBoxCount();n++){let r;r=n<this.__node_count_binary?6*n:7*(n-this.__node_count_binary)+this.getLeafBlockAddress(),this.readBounds(r,e,0),t+=g(e[0],e[1],e[2],e[3],e[4],e[5])}return t}sort_morton(t){const e=6*this.__node_count_binary;if(this.__node_count_leaf<2)return;const n=w.pointer;let r,i,s=n;w[s++]=0,w[s++]=this.__node_count_leaf-1;const o=this.__data_float32;for(;s>n;){s-=2;const n=w[s+1],a=w[s];r=a,i=n;const c=_(o,7*(a+n>>1)+e,t);for(;r<=i;){for(;_(o,7*r+e,t)<c;)r++;for(;_(o,7*i+e,t)>c;)i--;r<=i&&(r!==i&&this.__swap_leaves(r,i),r++,i--)}a<i&&(w[s++]=a,w[s++]=i),r<n&&(w[s++]=r,w[s++]=n)}}__swap_leaves(t,e){const n=this.getLeafBlockAddress(),r=7*t+n,i=7*e+n;!function(t,e,n,r,i){for(let i=0;i<7;i++){const s=e+i,o=r+i,a=n[o];n[o]=t[s],t[s]=a}}(this.__data_float32,r,this.__data_float32,i)}build(){const t=this.__node_count_binary,e=6*t;let n,r,i,s,o=Math.floor(Math.log(t)/Math.log(2));i=Math.pow(2,o),r=6*(i-1);const a=this.__node_count_leaf,h=this.__data_float32;for(n=0;n<i;n++){const t=n<<1,i=t+1,s=e+7*t;i<a?l(h,r,h,s,h,e+7*i):t<a?c(h,s,h,r,6):y(this.__data_float32,r,r-6),r+=6}for(o--;o>=0;o--)for(i=1<<o,s=i-1,n=0;n<i;n++){const t=6*(1+(s<<1));l(h,6*s,h,t,h,t+6),s++}}}function v(t,e,n){let r=t;return r<e&&(r=e),r<n&&(r=n),r}function A(t,e,n){let r=t;return r>e&&(r=e),r>n&&(r=n),r}function x(t,e,n,r,i,s){const o=t.getLeafAddress(e);!function(t,e,n,r,i,s){const o=3*r,a=3*i,c=3*s,h=n[o],u=n[o+1],d=n[o+2],l=n[a],f=n[a+1],g=n[a+2],p=n[c],y=n[c+1],_=n[c+2];t[e]=A(h,l,p),t[e+1]=A(u,f,y),t[e+2]=A(d,g,_),t[e+3]=v(h,l,p),t[e+4]=v(u,f,y),t[e+5]=v(d,g,_)}(t.__data_float32,o,n,r,i,s),t.__data_uint32[o+6]=e}function b(t){return 1===t.faces.length}function E(t,e){return t.v0===e?t.v1:t.v1===e?t.v0:null}var U,$="undefined"!=typeof Float32Array?Float32Array:Array;function F(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function S(t,e){return-1===t.indexOf(e)&&(t.push(e),!0)}function z(){}function C(t,e=","){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,e)}function V(t,e){t.__edges.delete(e)}function B(t,e,n=0,r=t.length){const i=n+r;for(let r=n;r<i;r++)if(t[r]===e)return t.splice(r,1),!0;return!1}function M(t,e){return t.v0===e||t.v1===e}function I(t,e,n){const r=t.v0,i=t.v1;return!(r!==e&&r!==n||i!==e&&i!==n)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),U=new $(3),$!=Float32Array&&(U[0]=0,U[1]=0,U[2]=0);let L=0;class T{index=L++;v0=null;v1=null;faces=[];lengthSqr=-1;get byteSize(){return 128+8*this.faces.length+10}getVertexByIndex(t){if(0===t)return this.v0;if(1===t)return this.v1;throw new Error("Index out of bounds")}copy(t){this.v0=t.v0,this.v1=t.v1,this.lengthSqr=t.lengthSqr,this.faces=t.faces.slice()}clone(){const t=new T;return t.copy(this),t}validate(t){let e=!0;const n=this.faces,r=n.length;for(let i=0;i<r;i++)n[i].containsEdge(this)||(t(`Missing back-link from face[${i}]`),e=!1);return this.v0.containsEdge(this)||(t("Missing back-link from vertex v0"),e=!1),this.v1.containsEdge(this)||(t("Missing back-link from vertex v1"),e=!1),e}isLinked(){return this.v0.containsEdge(this)}unlink(){const t=this.v0,e=this.v1;t.removeEdge(this),t!==e&&e.removeEdge(this);const n=this.faces,r=n.length;for(let t=0;t<r;t++)n[t].removeEdge(this)}isDegenerateEdge(){return this.v0===this.v1}isTopologyBorder(){return b(this)}get length(){return this.lengthSqr<0&&this.computeSquaredLength(),Math.sqrt(this.lengthSqr)}computeSquaredLength(){const t=this.v0,e=this.v1,n=t.x,r=t.y,i=t.z,s=n-e.x,o=r-e.y,a=i-e.z;this.lengthSqr=s*s+o*o+a*a}replaceVertex(t,e){t===this.v0&&(this.v0=e),t===this.v1&&(this.v1=e)}merge(t){const e=t.faces,n=this.faces,r=e.length;for(let i=0;i<r;i++){const r=e[i];r.removeEdge(t),-1===n.indexOf(r)&&(n.push(r),r.addUniqueEdge(this))}t.v0.removeEdge(t),t.v1.removeEdge(t)}containsFace(t){return-1!==this.faces.indexOf(t)}addFace(t){this.faces.push(t)}addUniqueFace(t){S(this.faces,t)}removeFace(t){B(this.faces,t)}getOtherVertex(t){return E(this,t)}containsVertex(t){return M(this,t)}containsBothVertices(t,e){return I(this,t,e)}containsSameVerticesAs(t){return I(this,t.v0,t.v1)}}function q(t,e,n){const r=t.length;for(let i=0;i<r;i++)t[i]===e&&(t[i]=n);return t}function N(t,e,n,r,i,s,o,a,c,h,u){const d=c-s,l=h-o,f=u-a,g=n-s,p=r-o,y=i-a,_=l*y-f*p,w=f*g-d*y,m=d*p-l*g,v=function(t,e,n){return t*t+e*e+n*n}(_,w,m);if(0===v)return t[e]=0,t[e+1]=1,void(t[e+2]=0);const A=1/Math.sqrt(v),x=_*A,b=w*A,E=m*A;t[e]=x,t[e+1]=b,t[e+2]=E}function k(t,e,n){return Math.sqrt(t*t+e*e+n*n)}T.prototype.isTopoEdge=!0;let O=0;class j{index=O++;edges=[];faces=[];x=0;y=0;z=0;get 0(){return this.x}get 1(){return this.y}get 2(){return this.z}get byteSize(){return 112+8*this.edges.length+10+8*this.faces.length+10}copy(t){this.x=t.x,this.y=t.y,this.z=t.z,this.index=t.index,this.faces=t.faces.slice(),this.edges=t.edges.slice()}clone(){const t=new j;return t.copy(this),t}validate(t){let e=!0;const n=this.faces,r=n.length;for(let i=0;i<r;i++)n[i].containsVertex(this)||(t(`Missing back-link from face[${i}]`),e=!1);const i=this.edges,s=i.length;for(let n=0;n<s;n++)M(i[n],this)||(t(`Missing back-link from edge[${n}]`),e=!1);return e}distanceTo(t){return e=this.x,n=this.y,r=this.z,k(t.x-e,t.y-n,t.z-r);var e,n,r}addFace(t){this.faces.push(t)}addUniqueFace(t){return S(this.faces,t)}containsFace(t){return-1!==this.faces.indexOf(t)}removeFace(t){B(this.faces,t)}addEdge(t){this.edges.push(t)}addUniqueEdge(t){return S(this.edges,t)}replaceEdge(t,e){const n=this.edges,r=n.indexOf(t);n[r]=e}containsEdge(t){return-1!==this.edges.indexOf(t)}removeEdge(t){return B(this.edges,t)}replaceAnotherVertex(t){throw new Error('deprecated, use "tm_vert_splice" instead')}computeNeighbourVertices(t,e){let n=0;const r=this.edges,i=r.length;for(let s=0;s<i;s++){const i=r[s].getOtherVertex(this);t[e+n]=i,n++}return n}static from(t,e,n){const r=new j;return r.x=t,r.y=e,r.z=n,r}}j.prototype.isTopoVertex=!0;let D=0;class R{index=D++;vertices=[];edges=[];normal=[0,0,0];get byteSize(){return 100+8*this.vertices.length+10+8*this.edges.length+10+24+10}copy(t){this.index=t.index,this.vertices=t.vertices.slice(),this.edges=t.edges.slice(),F(this.normal,t.normal)}clone(){const t=new R;return t.copy(this),t}validate(t){let e=!0;const n=this.vertices,r=n.length;3!==r&&(t(`Expected number of vertices is 3, instead got ${r}`),e=!1);for(let i=0;i<r;i++)n[i].containsFace(this)||(t(`Missing back-link from vertex[${i}]`),e=!1);const i=this.edges,s=i.length;3!==s&&(t(`Expected number of edges is 3, instead got ${s}`),e=!1);for(let n=0;n<s;n++)i[n].containsFace(this)||(t(`Missing back-link from edge[${n}]`),e=!1);return e}isLinked(){return this.vertices[0].containsFace(this)}replaceEdge(t,e){q(this.edges,t,e)}replaceVertex(t,e){q(this.vertices,t,e)}isDegenerateTopology(){const t=this.vertices,e=t[0],n=t[1],r=t[2];return e===n||e===r||n===r}unlink(){const t=this.vertices,e=t.length;for(let n=0;n<e;n++)t[n].removeFace(this);const n=this.edges,r=n.length;for(let t=0;t<r;t++)n[t].removeFace(this)}addEdge(t){this.edges.push(t)}addUniqueEdge(t){return S(this.edges,t)}removeEdge(t){B(this.edges,t)}containsEdge(t){return-1!==this.edges.indexOf(t)}computeNormal(){const t=this.vertices,e=t[0],n=t[1],r=t[2];!function(t,e,n,r){N(t,0,e[0],e[1],e[2],n[0],n[1],n[2],r[0],r[1],r[2])}(this.normal,e,n,r)}setVertexAt(t,e){this.vertices[t]=e}containsVertex(t){return-1!==this.vertices.indexOf(t)}getEdgeNeighbours(t,e){let n=0;const r=this.edges,i=r.length;for(let s=0;s<i;s++){const i=r[s].faces,o=i.length;for(let r=0;r<o;r++){const s=i[r];s!==this&&(t[e+n]=s,n++)}}return n}static fromPoints(t,e,n,r,i,s,o,a,c){const h=j.from(t,e,n),u=j.from(r,i,s),d=j.from(o,a,c),l=new T,f=new T,g=new T;l.v0=h,l.v1=u,f.v0=u,f.v1=d,g.v0=d,g.v1=h;const p=new R;return p.edges.push(l,f,g),p.vertices.push(h,u,d),h.faces.push(p),u.faces.push(p),d.faces.push(p),l.faces.push(p),f.faces.push(p),g.faces.push(p),h.edges.push(l,g),u.edges.push(l,f),d.edges.push(f,g),p}}R.prototype.isTopoFace=!0;class J{vertices=[];__edges=new Set;__faces=new Set;get byteSize(){let t=0;for(let e=0;e<this.vertices.length;e++)t+=this.vertices[e].byteSize;for(const e of this.__edges)t+=e.byteSize;for(const e of this.__faces)t+=e.byteSize;return t}getEdges(){return this.__edges}getFaces(){return this.__faces}getFaceByIndex(t){for(const e of this.__faces)if(e.index===t)return e}validate(t=z){let e=!0,n="",r=0;function i(i){t(`${n}[${r}]: ${i}`),e=!1}n="Edge",r=0;const s=this.getEdges();for(let t of s){t.validate(i),this.containsVertex(t.v0)||i("Link to off-mesh vertex v0"),this.containsVertex(t.v1)||i("Link to off-mesh vertex v1");const e=t.faces,n=e.length;for(let t=0;t<n;t++){const n=e[t];this.containsFace(n)||i(`Link to off-mesh face[${t}]`)}r++}const o=this.getFaces();n="Face",r=0;for(let t of o){t.validate(i);const e=t.edges,n=e.length;for(let t=0;t<n;t++){const n=e[t];this.containsEdge(n)||i(`Link to off-mesh edge[${t}]`)}const s=t.vertices,o=s.length;for(let t=0;t<o;t++){const e=s[t];this.containsVertex(e)||i(`Link to off-mesh vertex[${t}]`)}r++}const a=this.vertices,c=a.length;n="Vertex";for(let t=0;t<c;t++){r=t;const e=a[t];e.validate(i);const n=e.edges,s=n.length;for(let t=0;t<s;t++){const e=n[t];this.containsEdge(e)||i(`Link to off-mesh edge[${t}]`)}const o=e.faces,c=o.length;for(let t=0;t<c;t++){const e=o[t];this.containsFace(e)||i(`Link to off-mesh face[${t}]`)}}return e}clone(){const t=new J;return t.add(this),t}buildVertexMapping(){const t=new Map,e=this.vertices,n=e.length;for(let r=0;r<n;r++){const n=e[r];t.set(n.index,n)}return t}_addWithVertexMap(t,e){const n=t.getFaces();for(let t of n)this.addFaceCopy(t,e)}addFaceCopy(t,e){const n=new R;F(n.normal,t.normal);const r=t.vertices;for(let t=0;t<3;t++){const i=r[t];let s=e.get(i.index);void 0===s&&(s=new j,s.index=i.index,s.x=i.x,s.y=i.y,s.z=i.z,e.set(i.index,s),this.addVertex(s)),n.setVertexAt(t,s),s.addUniqueFace(n)}this.addFace(n),this.patchFaceEdges(n)}patchFaceEdges(t){const e=t.vertices,n=e[0],r=e[1],i=e[2],s=this.ensureEdge(n,r),o=this.ensureEdge(r,i),a=this.ensureEdge(i,n);s.addUniqueFace(t),o.addUniqueFace(t),a.addUniqueFace(t),t.addUniqueEdge(s),t.addUniqueEdge(o),t.addUniqueEdge(a)}add(t){const e=this.buildVertexMapping();this._addWithVertexMap(t,e)}addVertex(t){this.vertices.push(t)}addUniqueVertex(t){S(this.vertices,t)}removeVertex(t){var e;e=t,B(this.vertices,e)}containsVertex(t){return-1!==this.vertices.indexOf(t)}addEdge(t){this.__edges.add(t)}addUniqueEdge(t){this.__edges.add(t)}removeEdge(t){V(this,t)}containsEdge(t){return this.__edges.has(t)}addFace(t){this.__faces.add(t)}injectManyFaces(t){for(let e of t)this.injectFace(e)}injectFace(t){this.addFace(t);const e=t.edges,n=e.length;for(let t=0;t<n;t++){const n=e[t];this.addUniqueEdge(n)}const r=t.vertices,i=r.length;for(let t=0;t<i;t++){const e=r[t];this.addUniqueVertex(e)}}removeFace(t){var e;e=t,this.__faces.delete(e)}containsFace(t){return this.__faces.has(t)}ensureEdge(t,e){const n=t.edges,r=n.length;for(let i=0;i<r;i++){const r=n[i];if(E(r,t)===e)return r}const i=new T;return i.v0=t,i.v1=e,t.edges.push(i),e.edges.push(i),this.__edges.add(i),i}mergeEdges(){const t=this.getEdges();for(let e of t){const n=e.v0,r=e.v1;for(let i of t){if(e===i)continue;const t=i.v0,s=i.v1;if(n===t){if(r!==s)continue}else{if(n!==s)continue;if(r!==t)continue}V(this,i),e.merge(i)}}}computeEdgeSquaredLengths(){const t=this.getEdges();for(let e of t)e.computeSquaredLength()}setVerticesFromArray(t){const e=t.length/3,n=this.vertices;for(let r=0;r<e;r++){const e=3*r,i=new j;i.index=r,i.x=t[e],i.y=t[e+1],i.z=t[e+2],n[r]=i}}setFacesFromIndexArray(t){const e=t.length,n=this.vertices,r=e/3;for(let e=0;e<r;e++){const r=3*e,i=t[r],s=t[r+1],o=t[r+2];this.createTriangle(e,n[i],n[s],n[o])}}setFacedUnindexed(){const t=this.vertices,e=t.length/3;for(let n=0;n<e;n++){const e=3*n;this.createTriangle(n,t[e],t[e+1],t[e+2])}}build(t,e){this.setVerticesFromArray(t),null==e?this.setFacedUnindexed():this.setFacesFromIndexArray(e)}createTriangle(t,e,n,r){const i=new R;i.index=t;const s=this.ensureEdge(e,n),o=this.ensureEdge(n,r),a=this.ensureEdge(r,e);return s.faces.push(i),o.faces.push(i),a.faces.push(i),i.vertices.push(e,n,r),i.edges.push(s,o,a),e.faces.push(i),n.faces.push(i),r.faces.push(i),this.__faces.add(i),i}toString(){return`TopoMesh{ vertices: ${C(this.vertices.length)}, edges: ${C(this.getEdges().size)}, faces: ${C(this.getFaces().size)} }`}}J.prototype.isTopoMesh=!0;const P=[],H=[],W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let t=0,e=64;t<e;++t)P[t]=W[t],H[W.charCodeAt(t)]=t;function G(t,e,n){const r=[];for(let s=e;s<n;s+=3){const e=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]);r.push(P[(i=e)>>18&63]+P[i>>12&63]+P[i>>6&63]+P[63&i])}var i;return r.join("")}H["-".charCodeAt(0)]=62,H["_".charCodeAt(0)]=63;const Y=16383;class K{static encode(t){return function(t){const e=t.length,n=e%3,r=[],i=e-n;for(let e=0;e<i;e+=Y){const n=G(t,e,e+Y>i?i:e+Y);r.push(n)}if(1===n){const n=t[e-1];r.push(P[n>>2]+P[n<<4&63]+"==")}else if(2===n){const n=(t[e-2]<<8)+t[e-1];r.push(P[n>>10]+P[n>>4&63]+P[n<<2&63]+"=")}return r.join("")}(new Uint8Array(t))}static decode(t){return function(t){let e;const n=function(t){const e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");let n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}(t),r=n[0],i=n[1],s=new Uint8Array(function(t,e){return 3*(t+e)/4-e}(r,i));let o=0;const a=i>0?r-4:r;let c=0;for(;c<a;c+=4){const n=t.charCodeAt(c),r=t.charCodeAt(c+1),i=t.charCodeAt(c+2),a=t.charCodeAt(c+3);e=H[n]<<18|H[r]<<12|H[i]<<6|H[a],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=255&e}if(2===i){const n=t.charCodeAt(c),r=t.charCodeAt(c+1);e=H[n]<<2|H[r]>>4,s[o++]=255&e}if(1===i){const n=t.charCodeAt(c),r=t.charCodeAt(c+1),i=t.charCodeAt(c+2);e=H[n]<<10|H[r]<<4|H[i]>>2,s[o++]=e>>8&255,s[o++]=255&e}return s}(t).buffer}}const Q="uint8",X="uint16",Z="uint32",tt="int8",et="int16",nt="int32",rt="float32",it="float64",st={[Q]:Uint8Array,[X]:Uint16Array,[Z]:Uint32Array,[tt]:Int8Array,[et]:Int16Array,[nt]:Int32Array,float16:Uint16Array,[rt]:Float32Array,[it]:Float64Array};function ot(t){const e=Object.getPrototypeOf(t).constructor;switch(e){case Uint8Array:case Uint8ClampedArray:return Q;case Uint16Array:return X;case Uint32Array:return Z;case Int8Array:return tt;case Int16Array:return et;case Int32Array:return nt;case Float32Array:return rt;case Float64Array:return it;default:throw new Error(`unsupported constructor type ${e.name}`)}}function at(t,e,n){return t<e?e:t>n?n:t}function ct(t,e,n){return(e-t)*n+t}function ht(t,e,n,r,i){return.5*(r-e+(2*e-5*n+4*r-i+(3*(n-r)+i-e)*t)*t)*t+n}function ut(t){const e=t>>0;return 4294967295*(t-e)^e}class dt{constructor(t=[],e=1,n=0,r=0){if(!Number.isInteger(e)||e<0)throw new Error(`itemSize must be a non-negative integer, instead was ${e}`);if(!Number.isInteger(n)||n<0)throw new Error(`width must be a non-negative integer, instead was ${n}`);if(!Number.isInteger(r)||n<0)throw new Error(`height must be a non-negative integer, instead was ${r}`);if(void 0===t)throw new Error("data was undefined");if(t.length<n*r*e)throw new Error(`Buffer underflow, data.length(=${t.length}) is too small. Expected at least ${n*r*e}`);this.width=n,this.height=r,this.itemSize=e,this.data=t,this.version=0}sampleCatmullRomUV(t,e,n){const r=this.itemSize;for(let i=0;i<r;i++)n[i]=this.sampleChannelCatmullRomUV(t,e,i)}sampleChannelCatmullRomUV(t,e,n){const r=t*this.width-.5,i=e*this.height-.5;return this.sampleChannelCatmullRom(r,i,n)}sampleChannelCatmullRom(t,e,n){const r=Math.floor(t),i=Math.floor(e),s=t-r,o=e-i,a=s*(s*(1-.5*s)-.5),c=o*(o*(1-.5*o)-.5),h=s*(.5+s*(2-1.5*s)),u=o*(.5+o*(2-1.5*o)),d=s*s*(.5*s-.5),l=o*o*(.5*o-.5),f=1+s*s*(1.5*s-2.5)+h,g=1+o*o*(1.5*o-2.5)+u,p=r-1,y=i-1,_=r+2,w=i+2,m=r+h/f,v=i+u/g;let A=0;return A+=this.sampleChannelBilinear(p,y,n)*a*c,A+=this.sampleChannelBilinear(m,y,n)*f*c,A+=this.sampleChannelBilinear(_,y,n)*d*c,A+=this.sampleChannelBilinear(p,v,n)*a*g,A+=this.sampleChannelBilinear(m,v,n)*f*g,A+=this.sampleChannelBilinear(_,v,n)*d*g,A+=this.sampleChannelBilinear(p,w,n)*a*l,A+=this.sampleChannelBilinear(m,w,n)*f*l,A+=this.sampleChannelBilinear(_,w,n)*d*l,A}sampleBicubicUV(t,e,n){const r=this.itemSize;for(let i=0;i<r;i++)n[i]=this.sampleChannelBicubicUV(t,e,i)}sampleBicubic(t,e,n,r){const i=this.itemSize;for(let s=0;s<i;s++)n[s+r]=this.sampleChannelBicubic(t,e,s)}sampleChannelBicubicUV(t,e,n){const r=t*this.width,i=e*this.height;return this.sampleChannelBicubic(r-.5,i-.5,n)}sampleChannelBicubic(t,e,n){const r=this.itemSize,i=this.width,s=this.height,o=this.data,a=i*r,c=i-1,h=s-1,l=at(t,0,c),f=at(e,0,h),g=0|l,p=0|f,y=l-g,_=f-p,w=u(0,g-1),m=u(0,p-1),v=d(c,g+1),A=d(h,p+1),x=d(c,v+1),b=m*a+n,E=p*a+n,U=A*a+n,$=d(h,A+1)*a+n,F=w*r,S=g*r,z=v*r,C=x*r,V=o[b+F],B=o[b+S],M=o[b+z],I=o[b+C],L=o[E+F],T=o[E+S],q=o[E+z],N=o[E+C],k=o[U+F],O=o[U+S],j=o[U+z],D=o[U+C],R=o[$+F],J=o[$+S],P=o[$+z],H=o[$+C],W=ht(y,V,B,M,I),G=ht(y,L,T,q,N),Y=ht(y,k,O,j,D),K=ht(y,R,J,P,H);return ht(_,W,G,Y,K)}sampleBilinearUV(t,e,n,r=0){const i=this.itemSize;for(let s=0;s<i;s++)n[s+r]=this.sampleChannelBilinearUV(t,e,s)}sampleBilinear(t,e,n,r=0){const i=this.itemSize;for(let s=0;s<i;s++)n[s+r]=this.sampleChannelBilinear(t,e,s)}sampleChannelBilinearUV(t,e,n){const r=t*this.width-.5,i=e*this.height-.5;return this.sampleChannelBilinear(r,i,n)}sampleChannelBilinear(t,e,n){const r=this.itemSize,i=this.width,s=i*r,o=this.height-1,a=at(t,0,i-1),c=at(e,0,o),h=a>>>0,u=c>>>0,d=u*s,l=h*r+n,f=d+l;let g,p;g=a===h?h:h+1,p=c===u?u:u+1;const y=this.data,_=y[f];if(h===g&&u===p)return _;const w=a-h,m=c-u,v=g*r+n,A=p*s,x=A+l,b=A+v,E=y[d+v],U=y[x],$=y[b],F=ct(_,E,w),S=ct(U,$,w);return ct(F,S,m)}sampleNearestUV(t,e,n){const r=this.width,i=this.height,s=Math.round(t*r-.5),o=Math.round(e*i-.5);this.read(at(s,0,r-1),at(o,0,i-1),n)}readChannel(t,e,n){const r=(e*this.width+t)*this.itemSize+n;return this.data[r]}read(t,e,n){const r=this.width,i=this.itemSize,s=(e*r+t)*i;for(let t=0;t<i;t++)n[t]=this.data[s+t]}write(t,e,n){const r=this.width,i=this.itemSize,s=(e*r+t)*i;for(let t=0;t<i;t++)this.data[s+t]=n[t];this.version++}point2index(t,e){return t+e*this.width}index2point(t,e){const n=this.width,r=t%n,i=t/n|0;e.set(r,i)}copy(t,e,n,r,i,s,o){const a=Math.min(s,t.width-e,this.width-r),c=Math.min(o,t.height-n,this.height-i),h=this.itemSize,u=t.itemSize,d=Math.min(h,u),l=h*this.width,f=u*t.width,g=t.data,p=this.data;let y,_,w;for(_=0;_<c;_++){const t=(_+i)*l,s=(_+n)*f;for(y=0;y<a;y++){const n=t+(y+r)*h,i=s+(y+e)*u;for(w=0;w<d;w++)p[n+w]=g[i+w]}}this.version++}zeroFill(t,e,n,r){const i=at(t,0,this.width),s=at(e,0,this.height),o=at(t+n,0,this.width),a=at(e+r,0,this.height),c=this.data,h=this.itemSize,u=h*this.width,d=i*h,l=o*h;let f;for(f=s;f<a;f++){const t=f*u;c.fill(0,t+d,t+l)}this.version++}channelFill(t,e){const n=this.itemSize,r=this.data,i=r.length;for(let s=t;s<i;s+=n)r[s]=e;this.version++}fill(t,e,n,r,i){const s=this.width,o=this.height,a=at(t,0,s),c=at(e,0,o),h=at(t+n,0,s),u=at(e+r,0,o),d=this.data,l=this.itemSize,f=l*s;let g,p,y;for(g=c;g<u;g++){const t=g*f;for(p=a;p<h;p++){const e=t+p*l;for(y=0;y<l;y++)d[e+y]=i[y]}}this.version++}writeChannel(t,e,n,r){const i=(e*this.width+t)*this.itemSize+n;this.data[i]=r,this.version++}traverseCircle(t,e,n,r){let i,s;const o=0|t,a=0|e,c=n*n,h=Math.ceil(n);for(s=-h;s<=h;s++){const t=s*s;for(i=-h;i<=h;i++)i*i+t<=c&&r(o+i,a+s,this)}}resize(t,e,n=!0){const r=this.width,i=this.height;if(r===t&&i===e)return;const s=this.itemSize,o=t*e*s,a=this.data,c=new(function(t){if(t instanceof Int8Array)return Int8Array;if(t instanceof Int16Array)return Int16Array;if(t instanceof Int32Array)return Int32Array;if(t instanceof Uint8Array)return Uint8Array;if(t instanceof Uint8ClampedArray)return Uint8ClampedArray;if(t instanceof Uint16Array)return Uint16Array;if(t instanceof Uint32Array)return Uint32Array;if(t instanceof Float32Array)return Float32Array;if(t instanceof Float64Array)return Float64Array;if(Array.isArray(t))return Array;throw new TypeError("Unsupported array type")}(a))(o);if(n)if(t===r)c.set(a.subarray(0,Math.min(a.length,o)));else{const n=d(e,i),o=d(t,r);for(let e=0;e<n;e++)for(let n=0;n<o;n++){const i=(e*t+n)*s,o=(e*r+n)*s;for(let t=0;t<s;t++)c[i+t]=a[o+t]}}this.width=t,this.height=e,this.data=c,this.version++}computeByteSize(){let t;const e=this.data;return t=Array.isArray(e)?8*e.length:e.byteLength,t+280}equals(e){return this===e||this.width===e.width&&this.height===e.height&&this.itemSize===e.itemSize&&function(e,n){if(e===n)return!0;const r=e.length;if(r!==n.length)return!1;const i=e.constructor;if(i!==n.constructor)return!1;if(0===r)return!0;if(r<128)return t(e,n);const s=e.byteLength;if(s!==n.byteLength)return!1;const o=e.buffer,a=n.buffer,c=e.byteOffset,h=n.byteOffset;if(o===a&&c===h)return!0;let u=e,d=n;const l=i.BYTES_PER_ELEMENT,f=function(t,e,n){const r=t|e|n;return 0==(3&r)?4:0==(1&r)?2:1}(c,h,s);return l<4&&4===f?(u=new Uint32Array(o,c,s>>>2),d=new Uint32Array(a,h,s>>>2)):l<2&&2===f&&(u=new Uint16Array(o,c,s>>>1),d=new Uint16Array(a,h,s>>>1)),t(u,d)}(this.data,e.data)}hash(){const t=this.itemSize,e=this.width,n=this.height,r=this.data;let i=((65535&e)<<16|65535&n)^t;const s=e*n,o=Math.min(2048/t,s),a=Math.max(1,Math.round(s/o));if(function(t){const e=t.constructor;return e===Uint8ClampedArray||e===Uint8Array||e===Uint16Array||e===Uint32Array||e===Int8Array||e===Int16Array||e===Int32Array}(r))for(let e=0;e<s;e+=a)for(let n=0;n<t;n++)i=(i<<5)-i+r[e*t+n];else for(let e=0;e<s;e+=a)for(let n=0;n<t;n++)i=(i<<5)-i+ut(r[e*t+n]);return i}clone(){let t;return t=Array.isArray(this.data)?this.data.slice():new(0,this.data.constructor)(this.data),new dt(t,this.itemSize,this.width,this.height)}toJSON(){const t=K.encode(this.data.buffer);return{height:this.height,width:this.width,itemSize:this.itemSize,type:ot(this.data),data:t}}fromJSON({height:t,width:e,itemSize:n,type:r,data:i}){const s=function(t){const e=st[t];if(void 0===e)throw new Error(`Unsupported data type '${t}'`);return e}(r);if("string"==typeof i){const t=K.decode(i);this.data=new s(t)}else{if(!Array.isArray(i))throw new Error("Unsupported data format");this.data=new s(i)}this.height=t,this.width=e,this.itemSize=n}static uint8clamped(t,e,n){const r=new Uint8ClampedArray(e*n*t);return new dt(r,t,e,n)}static uint8(t,e,n){const r=new Uint8Array(e*n*t);return new dt(r,t,e,n)}static uint16(t,e,n){const r=new Uint16Array(e*n*t);return new dt(r,t,e,n)}static uint32(t,e,n){const r=new Uint32Array(e*n*t);return new dt(r,t,e,n)}static int8(t,e,n){const r=new Int8Array(e*n*t);return new dt(r,t,e,n)}static int16(t,e,n){const r=new Int16Array(e*n*t);return new dt(r,t,e,n)}static int32(t,e,n){const r=new Int32Array(e*n*t);return new dt(r,t,e,n)}static float32(t,e,n){const r=new Float32Array(e*n*t);return new dt(r,t,e,n)}static float64(t,e,n){const r=new Float64Array(e*n*t);return new dt(r,t,e,n)}}function lt(t,e,n,r){const i=n[r],s=n[r+1],o=n[r+2];t[e]+=i,t[e+1]+=s,t[e+2]+=o}function ft(t,e,n,r,i,s){const o=3*n,a=3*r,c=3*i;N(t,e,s[o],s[o+1],s[o+2],s[a],s[a+1],s[a+2],s[c],s[c+1],s[c+2])}function gt(t,e,n,r){const i=n[r],s=n[r+1],o=n[r+2],a=1/k(i,s,o);t[e]=i*a,t[e+1]=s*a,t[e+2]=o*a}dt.prototype.set=dt.prototype.write,dt.prototype.isSampler2D=!0,dt.typeName="Sampler2D";const pt=new Float64Array(3),yt={build:function(t,e,n,r,i,s){const o=n.x*s,a=n.y*s,c=o-1,h=a-1;let u=0,d=0;const l=o*a,f=new Float32Array(3*l),g=new Float32Array(3*l),p=new Float32Array(2*l);let y,_;const w=n.y/i.y/h,m=n.x/i.x/c,v=e.y/i.y,A=e.x/i.x,x=i.x*r.x,b=i.y*r.y;let E,U,$;for(y=0;y<a;y++){const e=y*w+v;for($=e*b,_=0;_<o;_++){const n=_*m+A;E=n*x,U=t.sampleChannelBicubicUV(n,e,0),f[u]=E,f[u+1]=U,f[u+2]=$,p[d]=n,p[d+1]=e,u+=3,d+=2}}u=0;const F=new(function(t){if(t<=256)return Uint8Array;if(t<=65536)return Uint16Array;if(t<=4294967295)return Uint32Array;throw new Error(`Unsupported size ${t}`)}(f.length/3))(c*h*6);for(y=0;y<h;y++)for(_=0;_<c;_++){const t=_+o*y,e=_+o*(y+1),n=_+1+o*(y+1),r=_+1+o*y;F[u]=t,F[u+1]=e,F[u+2]=r,F[u+3]=e,F[u+4]=n,F[u+5]=r,u+=6}return function(t,e,n){const r=n.length;for(let i=0;i<r;i+=3){const r=n[i],s=n[i+1],o=n[i+2];ft(pt,0,r,s,o,t),lt(e,3*r,pt,0),lt(e,3*s,pt,0),lt(e,3*o,pt,0)}!function(t,e=0,n=t.length-e){const r=e+n;for(let n=e;n<r;n+=3)gt(t,n,t,n)}(e)}(f,g,F),{indices:F,vertices:f,normals:g,uvs:p}}};self.Lib={build_bvh(t,e){const n=new m;return function(t,e,n){const r=n.length/3;t.setLeafCount(r),t.initialize_structure();for(let i=0;i<r;i++){const r=3*i;x(t,i,e,n[r],n[r+1],n[r+2])}t.build()}(n,t,e),n},Sampler2D:dt,BufferedGeometryArraysBuilder:yt,tensionOptimizeUV:function(t,e,n,r=3){const i=new J;i.build(t,n),i.computeEdgeSquaredLengths();const s=t.length/3;for(let t=0;t<r;t++)t:for(let t=0;t<s;t++){const n=i.vertices[t],r=n.edges,s=r.length;if(0===s)continue;let o=0,a=0,c=0;for(let t=0;t<s;t++){const i=r[t];if(b(i))continue t;const s=2*E(i,n).index,h=e[s],u=e[s+1],d=1/i.lengthSqr;o+=h*d,a+=u*d,c+=d}const h=o/c,u=a/c,d=2*n.index;e[d]=h,e[d+1]=u}},sampler2d_channel_compute_min:function(t,e=0){const n=t.itemSize,r=t.data,i=r.length;if(0===i)return;let s=r[e],o=e;for(let t=e+n;t<i;t+=n){const e=r[t];s>e&&(s=e,o=t)}const a=t.width,c=o/n|0;return{index:o,value:s,x:c%a,y:c/a|0}},sampler2d_channel_compute_max:function(t,e=0){const n=t.itemSize,r=t.data,i=r.length;if(0===i)return;let s=r[e],o=e;for(let t=e+n;t<i;t+=n){const e=r[t];s<e&&(s=e,o=t)}const a=t.width,c=o/n|0;return{index:o,value:s,x:c%a,y:c/a|0}}};
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.119.10",
8
+ "version": "2.119.12",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"EngineBootstrapper.d.ts","sourceRoot":"","sources":["../../../src/engine/EngineBootstrapper.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAGQ;;;OAGG;IACH,UAFU,IAAI,CAEM;IAIxB;;;;OAIG;IACH,mCA8CC;CACJ"}
1
+ {"version":3,"file":"EngineBootstrapper.d.ts","sourceRoot":"","sources":["../../../src/engine/EngineBootstrapper.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAEI;;;OAGG;IACH,UAFU,IAAI,CAEE;IAGhB;;;;OAIG;IACH,mCA8CC;CACJ"}
@@ -5,14 +5,12 @@ import LabelView from "../view/common/LabelView.js";
5
5
  */
6
6
  export class EngineBootstrapper {
7
7
 
8
- constructor() {
9
- /**
10
- *
11
- * @type {Node}
12
- */
13
- this.rootNode = null;
14
- }
15
-
8
+ /**
9
+ *
10
+ * @type {Node}
11
+ */
12
+ rootNode = null;
13
+
16
14
 
17
15
  /**
18
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"EngineConfiguration.d.ts","sourceRoot":"","sources":["../../../src/engine/EngineConfiguration.js"],"names":[],"mappings":"AAGA;IAEI;;;OAGG;IACH,gBAAa;IAEb;;;OAGG;IACH,gBAAa;IAEb;;;OAGG;IACH,kBAAe;IAEf;;;OAGG;IACH,SAFU,IAAI,MAAM,mBAAkB,CAElB;IAEpB;;;;OAIG;IACH,gBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,mBAHW,MAAM,mCAWhB;IAED;;;;OAIG;IACH,wBAHW,MAAM,oBAWhB;IAED;;;;OAIG;IACH,wCAFa,OAAO,CAQnB;IAED;;;;OAIG;IACH,2BAFa,OAAO,CAUnB;IAED;;OAEG;IACH,yCAKC;IAED;;;;OAIG;IACH,yDAFa,OAAO,CAMnB;IAED;;;OAGG;IACH,qCAmDC;CACJ"}
1
+ {"version":3,"file":"EngineConfiguration.d.ts","sourceRoot":"","sources":["../../../src/engine/EngineConfiguration.js"],"names":[],"mappings":"AAGA;IAEI;;;OAGG;IACH,gBAAa;IAEb;;;OAGG;IACH,gBAAa;IAEb;;;OAGG;IACH,kBAAe;IAEf;;;OAGG;IACH,SAFU,IAAI,MAAM,mBAAkB,CAElB;IAEpB;;;;OAIG;IACH,gBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,mBAHW,MAAM,mCAWhB;IAED;;;;OAIG;IACH,wBAHW,MAAM,oBAWhB;IAED;;;;OAIG;IACH,wCAFa,OAAO,CAQnB;IAED;;;;OAIG;IACH,2BAFa,OAAO,CAUnB;IAED;;OAEG;IACH,yCAKC;IAED;;;;OAIG;IACH,yDAFa,OAAO,CASnB;IAED;;;OAGG;IACH,qCAmDC;CACJ"}
@@ -110,6 +110,9 @@ export class EngineConfiguration {
110
110
  * @returns {boolean}
111
111
  */
112
112
  addDataTable(table) {
113
+ assert.defined(table,'table');
114
+ assert.notNull(table,'table');
115
+
113
116
  this.knowledge.push(table);
114
117
 
115
118
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/Entity.js"],"names":[],"mappings":";AAeA;;;GAGG;AACH;IAoYI;;;;;OAKG;IACH,+BAJW,MAAM,oCAEJ,MAAM,CAelB;IArZD;;;OAGG;IACH,IAFU,MAAM,CAER;IAER;;;;OAIG;IACH,YAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,2BAAgB;IAQhB;;;OAGG;IACH,gCAAe;IAEf;;;OAGG;IACH,OAFU,WAAW,GAAC,MAAM,CAEN;IAEtB;;;OAGG;IACH,gBAAgB;IAEhB;;OAEG;IACH;;MAEE;IAUF;;;OAGG;IACH,eAFW,MAAM,GAAC,WAAW,QAI5B;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,WAAW,GAChB,OAAO,CAMnB;IAED;;;OAGG;IACH,gBAFW,MAAM,GAAC,WAAW,QAI5B;IAED;;;OAGG;IACH,uBAEC;IAED;;OAEG;IACH,4BAQC;IAED;;;OAGG;IACH,oBAEC;IAED;;;;OAIG;IACH,8BAFa,MAAM,CAiBlB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,0CAYC;IAED;;;;;OAKG;IACH,8CAQC;IAED;;;;OAIG;IACH,kCAFa,MAAE,IAAI,CA0BlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,qBAShB;IAED;;;OAGG;IACH,wBAFW,MAAM,gBAiBhB;IAED;;;;;;OAMG;IACH,4BALW,MAAM,sCAGJ,MAAM,CAalB;IAED;;;;;;OAMG;IACH,+BALW,MAAM,sCAGJ,MAAM,CAyBlB;IAED;;;OAGG;IACH,WAFa,OAAO,CAwBnB;IAED;;;;OAIG;IACH,+CAqDC;IAwBL;;;;OAIG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;4BAxa2B,kBAAkB;mBAF3B,oCAAoC"}
1
+ {"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/Entity.js"],"names":[],"mappings":";AAeA;;;GAGG;AACH;IAoYI;;;;;OAKG;IACH,+BAJW,MAAM,oCAEJ,MAAM,CAelB;IArZD;;;OAGG;IACH,IAFU,MAAM,CAER;IAER;;;;OAIG;IACH,YAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,2BAAgB;IAQhB;;;OAGG;IACH,gCAAe;IAEf;;;OAGG;IACH,OAFU,WAAW,GAAC,MAAM,CAEN;IAEtB;;;OAGG;IACH,gBAAgB;IAEhB;;OAEG;IACH;;MAEE;IAUF;;;OAGG;IACH,eAFW,MAAM,GAAC,WAAW,QAI5B;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,WAAW,GAChB,OAAO,CAMnB;IAED;;;OAGG;IACH,gBAFW,MAAM,GAAC,WAAW,QAI5B;IAED;;;OAGG;IACH,uBAEC;IAED;;OAEG;IACH,4BAQC;IAED;;;OAGG;IACH,oBAEC;IAED;;;;OAIG;IACH,8BAFa,MAAM,CAiBlB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,0CAYC;IAED;;;;;OAKG;IACH,8CAQC;IAED;;;;OAIG;IACH,kCAFa,MAAE,IAAI,CA0BlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,qBAShB;IAED;;;OAGG;IACH,wBAFW,MAAM,gBAiBhB;IAED;;;;;;OAMG;IACH,4BALW,MAAM,sCAGJ,MAAM,CAalB;IAED;;;;;;OAMG;IACH,+BALW,MAAM,sCAGJ,MAAM,CAyBlB;IAED;;;OAGG;IACH,WAFa,OAAO,CAwBnB;IAED;;;;OAIG;IACH,wCAHa,MAAM,CAwDlB;IAwBL;;;;OAIG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;4BAxa2B,kBAAkB;mBAF3B,oCAAoC"}
@@ -347,7 +347,7 @@ class Entity {
347
347
 
348
348
  /**
349
349
  *
350
- * @returns {Number} entity
350
+ * @returns {number} entity
351
351
  * @param {EntityComponentDataset} dataset
352
352
  */
353
353
  build(dataset) {
@@ -0,0 +1,36 @@
1
+ export class DataScope {
2
+ /**
3
+ * @private
4
+ * @type {Object[]}
5
+ */
6
+ private stack;
7
+ proxy: this;
8
+ /**
9
+ *
10
+ * @return {number}
11
+ */
12
+ size(): number;
13
+ /**
14
+ *
15
+ * @param {string} variableName
16
+ * @returns {*|undefined}
17
+ */
18
+ read(variableName: string): any | undefined;
19
+ /**
20
+ *
21
+ * @param {Object} scope
22
+ */
23
+ push(scope: any): void;
24
+ /**
25
+ *
26
+ * @returns {Object}
27
+ */
28
+ pop(): any;
29
+ /**
30
+ * Drop multiple frames from the top of the stack until stack size matches given value
31
+ * @param {number} size
32
+ * @returns {number} how many frames were dropped
33
+ */
34
+ unwind(size: number): number;
35
+ }
36
+ //# sourceMappingURL=DataScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataScope.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/dynamic_actions/DataScope.js"],"names":[],"mappings":"AAEA;IAGQ;;;OAGG;IACH,cAAe;IAGf,YAqCE;IAGN;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,MAAE,SAAS,CAqBvB;IAED;;;OAGG;IACH,uBAOC;IAED;;;OAGG;IACH,WAIC;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,MAAM,CAYlB;CACJ"}
@@ -0,0 +1,126 @@
1
+ import { assert } from "../../../core/assert.js";
2
+
3
+ export class DataScope {
4
+ constructor() {
5
+
6
+ /**
7
+ * @private
8
+ * @type {Object[]}
9
+ */
10
+ this.stack = [];
11
+
12
+
13
+ this.proxy = new Proxy(this, {
14
+ /**
15
+ *
16
+ * @param target
17
+ * @param {string} p
18
+ * @param receiver
19
+ * @returns {*}
20
+ */
21
+ get(target, p, receiver) {
22
+ return target.read(p);
23
+ },
24
+ ownKeys(target) {
25
+ const size = target.size();
26
+
27
+ /**
28
+ *
29
+ * @type {string[]}
30
+ */
31
+ const result = [];
32
+
33
+ for (let i = 0; i < size; i++) {
34
+ const frame = target.stack[i];
35
+
36
+ const keys = Reflect.ownKeys(frame);
37
+
38
+ const n = keys.length;
39
+ for (let j = 0; j < n; j++) {
40
+ const key = keys[j];
41
+
42
+ if (!result.includes(key)) {
43
+ result.push(key);
44
+ }
45
+ }
46
+ }
47
+
48
+ return result;
49
+ }
50
+ });
51
+ }
52
+
53
+ /**
54
+ *
55
+ * @return {number}
56
+ */
57
+ size() {
58
+ return this.stack.length;
59
+ }
60
+
61
+ /**
62
+ *
63
+ * @param {string} variableName
64
+ * @returns {*|undefined}
65
+ */
66
+ read(variableName) {
67
+ assert.typeOf(variableName, 'string', 'variableName');
68
+
69
+ const stack = this.stack;
70
+
71
+ const last = stack.length - 1;
72
+
73
+ for (let i = last; i >= 0; i--) {
74
+ const scope = stack[i];
75
+
76
+ const value = scope[variableName];
77
+
78
+ if (value !== undefined) {
79
+ return value;
80
+ }
81
+ }
82
+
83
+ //not found
84
+ return undefined;
85
+ }
86
+
87
+ /**
88
+ *
89
+ * @param {Object} scope
90
+ */
91
+ push(scope) {
92
+ assert.notEqual(scope, undefined, 'scope is undefined');
93
+ assert.notEqual(scope, null, 'scope is null');
94
+
95
+ assert.typeOf(scope, 'object', 'scope');
96
+
97
+ this.stack.push(scope);
98
+ }
99
+
100
+ /**
101
+ *
102
+ * @returns {Object}
103
+ */
104
+ pop() {
105
+ assert.ok(this.stack.length > 0, 'Stack is empty');
106
+
107
+ return this.stack.pop();
108
+ }
109
+
110
+ /**
111
+ * Drop multiple frames from the top of the stack until stack size matches given value
112
+ * @param {number} size
113
+ * @returns {number} how many frames were dropped
114
+ */
115
+ unwind(size) {
116
+ const top = this.size();
117
+
118
+ const count = top - size;
119
+
120
+ for (let i = 0; i < count; i++) {
121
+ this.pop();
122
+ }
123
+
124
+ return count;
125
+ }
126
+ }
@@ -123,6 +123,6 @@ import { AbstractContextSystem } from "../system/AbstractContextSystem.js";
123
123
  import { DynamicActor } from "./DynamicActor.js";
124
124
  import { Blackboard } from "../../intelligence/blackboard/Blackboard.js";
125
125
  import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
126
- import { DataScope } from "../../../../../model/game/unit/actions/data/DataScope.js";
126
+ import { DataScope } from "./DataScope.js";
127
127
  import { returnTrue } from "../../../core/function/returnTrue.js";
128
128
  //# sourceMappingURL=DynamicActorSystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicActorSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/dynamic_actions/DynamicActorSystem.js"],"names":[],"mappings":"AA6FA;IA4DI;;;OAGG;IACH,4BASC;IAxED,sCAA8B;IAE9B,kEAEE;IAEF;;;OAGG;IACH,sCAAgB;IAEhB;;;OAGG;IACH,OAFU,SAAS,CAEK;IAExB;;;;OAIG;IACH,iCAOG;IAEH;;;;OAIG;IACH,gCAAoC;IAEpC;;;OAGG;IACH,mCAAiB;IAEjB;;;;OAIG;IACH,uBAAmB;IAEnB;;;;OAIG;IACH,gBAAgB;IASZ;;;OAGG;IACH,eAAoB;IAIxB;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAED;;;;;OAKG;IACH,6BAJW,MAAM,uDAyBhB;IAED;;;OAGG;IACH,iCAFW,MAAM,QAehB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,oDA4DhB;IAED;;;;OAIG;IACH,4BAHW,MAAM,SACN,SAAS,QAsDnB;IAED;;;;OAIG;IACH,yBAFY,yBAAuB,SAAS,CA6E3C;IAED;;;;;;;;;OASG;IACH,yFAHW,MAAM,GACJ;QAAC,MAAM,EAAC,MAAM,CAAC;QAAA,IAAI,yBAAwB;QAAC,KAAK,EAAE,SAAS,CAAA;KAAC,EAAE,CA4E3E;IAED;;;;;;OAMG;IACH,cALW,MAAM,SACN,MAAM,iBAEJ,yBAAuB,SAAS,CAiC5C;IAED,mFAWC;IAED;;;;;OAKG;IACH,mCAiBC;IAED,6BAYC;CACJ;sCAxkBqC,oCAAoC;6BAE7C,mBAAmB;2BARrB,6CAA6C;4CAN5B,oDAAoD;0BAVtE,0DAA0D;2BAMzD,sCAAsC"}
1
+ {"version":3,"file":"DynamicActorSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/dynamic_actions/DynamicActorSystem.js"],"names":[],"mappings":"AA6FA;IA4DI;;;OAGG;IACH,4BASC;IAxED,sCAA8B;IAE9B,kEAEE;IAEF;;;OAGG;IACH,sCAAgB;IAEhB;;;OAGG;IACH,OAFU,SAAS,CAEK;IAExB;;;;OAIG;IACH,iCAOG;IAEH;;;;OAIG;IACH,gCAAoC;IAEpC;;;OAGG;IACH,mCAAiB;IAEjB;;;;OAIG;IACH,uBAAmB;IAEnB;;;;OAIG;IACH,gBAAgB;IASZ;;;OAGG;IACH,eAAoB;IAIxB;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAED;;;;;OAKG;IACH,6BAJW,MAAM,uDAyBhB;IAED;;;OAGG;IACH,iCAFW,MAAM,QAehB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,oDA4DhB;IAED;;;;OAIG;IACH,4BAHW,MAAM,SACN,SAAS,QAsDnB;IAED;;;;OAIG;IACH,yBAFY,yBAAuB,SAAS,CA6E3C;IAED;;;;;;;;;OASG;IACH,yFAHW,MAAM,GACJ;QAAC,MAAM,EAAC,MAAM,CAAC;QAAA,IAAI,yBAAwB;QAAC,KAAK,EAAE,SAAS,CAAA;KAAC,EAAE,CA4E3E;IAED;;;;;;OAMG;IACH,cALW,MAAM,SACN,MAAM,iBAEJ,yBAAuB,SAAS,CAiC5C;IAED,mFAWC;IAED;;;;;OAKG;IACH,mCAiBC;IAED,6BAYC;CACJ;sCAzkBqC,oCAAoC;6BAG7C,mBAAmB;2BATrB,6CAA6C;4CAP5B,oDAAoD;0BAetE,gBAAgB;2BAnBf,sCAAsC"}
@@ -1,5 +1,3 @@
1
- import { DataScope } from "../../../../../model/game/unit/actions/data/DataScope.js";
2
- import { OverrideContextBehavior } from "../../../../../model/game/util/behavior/OverrideContextBehavior.js";
3
1
  import { assert } from "../../../core/assert.js";
4
2
  import { randomMultipleFromArray } from "../../../core/collection/array/randomMultipleFromArray.js";
5
3
  import { HashMap } from "../../../core/collection/map/HashMap.js";
@@ -12,6 +10,7 @@ import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessS
12
10
  import { number_compare_descending } from "../../../core/primitives/numbers/number_compare_descending.js";
13
11
  import { computeStringHash } from "../../../core/primitives/strings/computeStringHash.js";
14
12
  import { SequenceBehavior } from "../../intelligence/behavior/composite/SequenceBehavior.js";
13
+ import { OverrideContextBehavior } from "../../intelligence/behavior/decorator/OverrideContextBehavior.js";
15
14
  import { BehaviorComponent } from "../../intelligence/behavior/ecs/BehaviorComponent.js";
16
15
  import { DieBehavior } from "../../intelligence/behavior/ecs/DieBehavior.js";
17
16
  import { Blackboard } from "../../intelligence/blackboard/Blackboard.js";
@@ -22,6 +21,7 @@ import Entity from "../Entity.js";
22
21
  import { EntityFlags } from "../EntityFlags.js";
23
22
  import { AbstractContextSystem } from "../system/AbstractContextSystem.js";
24
23
  import { SystemEntityContext } from "../system/SystemEntityContext.js";
24
+ import { DataScope } from "./DataScope.js";
25
25
  import { DynamicActor } from "./DynamicActor.js";
26
26
  import { RuleExecution } from "./RuleExecution.js";
27
27
  import { computeContextualDynamicRuleDebugString } from "./rules/computeContextualDynamicRuleDebugString.js";
@@ -1 +1 @@
1
- {"version":3,"file":"RuleExecution.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/dynamic_actions/RuleExecution.js"],"names":[],"mappings":"AAAA;IAEI;;;OAGG;IACH,6BAAY;IACZ;;;OAGG;IACH,iBAAe;CAElB"}
1
+ {"version":3,"file":"RuleExecution.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/dynamic_actions/RuleExecution.js"],"names":[],"mappings":"AAAA;IAEI;;;OAGG;IACH,6BAAY;IACZ;;;OAGG;IACH,iBAAgB;CAEnB"}
@@ -9,6 +9,6 @@ export class RuleExecution {
9
9
  *
10
10
  * @type {Entity}
11
11
  */
12
- executor = null
12
+ executor = null;
13
13
 
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH;IAo9BI;;;;;;OAMG;IACH,6DAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,uDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,uDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,qDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,sDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,wDAFY,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,wDAFY,SAAS,CAKpB;IA7jCD;;;;;;;OAOG;IACH,mBANW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,iBAAiB,GAAC,UAAU,GAAC,WAAW,GAAC,WAAW,GAAC,SAAS,GAAC,UAAU,GAAC,UAAU,GAAC,YAAY,GAAC,YAAY,aACzI,MAAM,UACN,MAAM,WACN,MAAM,EAmDhB;IA7BG;;;OAGG;IACH,OAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,QAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,UAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,MAFU,MAAM,EAAE,GAAC,iBAAiB,GAAC,UAAU,GAAC,WAAW,GAAC,WAAW,GAAC,SAAS,GAAC,UAAU,GAAC,UAAU,GAAC,YAAY,GAAC,YAAY,CAEjH;IAEhB;;;OAGG;IACH,SAFU,MAAM,CAEA;IAGpB;;;;;OAKG;IACH,sBAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,QAQlB;IAED;;;;;;OAMG;IACH,6BALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAOlB;IAED;;;;;;;OAOG;IACH,2BALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CA2DlB;IAED;;;;;OAKG;IACH,mBAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,QAQlB;IAED;;;;;;OAMG;IACH,iBALW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,QAUhB;IAED;;;;;;OAMG;IACH,0BALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAOlB;IAED;;;;;;;OAOG;IACH,wBALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAgFlB;IAED;;;;;;OAMG;IACH,oBALW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,kBACrB,MAAM,QAUhB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,kBAClC,MAAM,QAWhB;IAED;;;;;;OAMG;IACH,2BALW,MAAM,KACN,MAAM,WACN,MAAM,GACL,MAAM,CAOjB;IAED;;;;;;OAMG;IACH,yBALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAiFlB;IAED;;;;;OAKG;IACH,mBAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,QAcpC;IAED;;;;;;OAMG;IACH,eALW,MAAM,KACN,MAAM,WACN,MAAM,GACJ,MAAM,CAalB;IAED;;;;;OAKG;IACH,QAJW,MAAM,KACN,MAAM,UACN,MAAM,EAAE,QAalB;IAED;;;;;OAKG;IACH,SAJW,MAAM,KACN,MAAM,QACN,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,QAapC;IAED;;;;;OAKG;IACH,eAJW,MAAM,KACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,mBAHW,MAAM,yBAUhB;IAED;;;;;;;;;OASG;IACH,aARW,SAAS,qHAoDnB;IAGD;;;;;;;OAOG;IACH,oEA8BC;IAED;;;;OAIG;IACH,2BAHW,MAAM,SACN,MAAM,QAYhB;IAED;;;;;;;OAOG;IACH,QANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,SACN,MAAO,MAAM,CAAC,QAqCxB;IAED;;;;;;OAMG;IACH,gBALW,MAAM,KACN,MAAM,WACN,MAAM,SACN,MAAM,QAqBhB;IAED;;;;;OAKG;IACH,OAJW,MAAM,KACN,MAAM,SACN,MAAM,EAAE,GAAC,YAAY,QAe/B;IAED;;;;;;;OAOG;IACH,wBALW,MAAM,WACN,MAAM,UACN,MAAM,sBAyBhB;IAED;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,iBACN,OAAO,QAyDjB;IAED;;;OAGG;IACH,mBAFY,MAAM,CAejB;IAED;;;;OAIG;IACH,cAHW,SAAS,GACR,OAAO,CAiBlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAiDjB;IAGD;;OAEG;IACH,SAFa,SAAS,CAerB;IAED;;;;;;MAUC;IAED;;;;;;aAwBC;IAgHL;;;OAGG;IACH,sBAFU,OAAO,CAEc;CAN9B;;kBAUS,MAAM"}
1
+ {"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"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"}
@@ -510,9 +510,9 @@ export class Sampler2D {
510
510
  *
511
511
  * @param {number} x
512
512
  * @param {number} y
513
- * @param {number[]|ArrayLike<number>} data
513
+ * @param {number[]|ArrayLike<number>} texel
514
514
  */
515
- write(x, y, data) {
515
+ write(x, y, texel) {
516
516
 
517
517
  const width = this.width;
518
518
 
@@ -521,8 +521,10 @@ export class Sampler2D {
521
521
  const i0 = (y * width + x) * itemSize;
522
522
 
523
523
  for (let i = 0; i < itemSize; i++) {
524
- this.data[i0 + i] = data[i];
524
+ this.data[i0 + i] = texel[i];
525
525
  }
526
+
527
+ this.version++;
526
528
  }
527
529
 
528
530
  /**
@@ -736,26 +738,6 @@ export class Sampler2D {
736
738
  this.version++;
737
739
  }
738
740
 
739
- /**
740
- *
741
- * @param {number} x
742
- * @param {number} y
743
- * @param {number[]|Float32Array} value
744
- */
745
- set(x, y, value) {
746
- const data = this.data;
747
- const itemSize = this.itemSize;
748
-
749
- const rowSize = itemSize * this.width;
750
-
751
- const offset = (rowSize * y) + x * itemSize;
752
-
753
- for (let i = 0; i < itemSize; i++) {
754
- data[offset + i] = value[i];
755
- }
756
-
757
- this.version++;
758
- }
759
741
 
760
742
  /**
761
743
  * Traverses area inside a circle
@@ -865,7 +847,7 @@ export class Sampler2D {
865
847
  // Assume IEEE float 64
866
848
  dataSize = 8 * data.length;
867
849
  } else {
868
- dataSize = data.buffer.byteLength;
850
+ dataSize = data.byteLength;
869
851
  }
870
852
 
871
853
  return dataSize + 280;
@@ -907,7 +889,7 @@ export class Sampler2D {
907
889
 
908
890
  const texel_count = width * height;
909
891
 
910
- const sample_limit = Math.min(2048, texel_count);
892
+ const sample_limit = Math.min(2048 / item_size, texel_count);
911
893
 
912
894
  const step_size = Math.max(1, Math.round(texel_count / sample_limit));
913
895
 
@@ -1113,6 +1095,12 @@ export class Sampler2D {
1113
1095
 
1114
1096
  }
1115
1097
 
1098
+
1099
+ /**
1100
+ * @deprecated use {@link write} instead
1101
+ */
1102
+ Sampler2D.prototype.set = Sampler2D.prototype.write;
1103
+
1116
1104
  /**
1117
1105
  * @readonly
1118
1106
  * @type {boolean}
@@ -0,0 +1,13 @@
1
+ export class OverrideContextBehavior extends AbstractDecoratorBehavior {
2
+ /**
3
+ *
4
+ * @param {*} context
5
+ * @param {Behavior} source
6
+ * @return {OverrideContextBehavior}
7
+ */
8
+ static from(context: any, source: Behavior): OverrideContextBehavior;
9
+ __override_context: {};
10
+ tick(timeDelta: any): import("../BehaviorStatus.js").BehaviorStatus;
11
+ }
12
+ import { AbstractDecoratorBehavior } from "./AbstractDecoratorBehavior.js";
13
+ //# sourceMappingURL=OverrideContextBehavior.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OverrideContextBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js"],"names":[],"mappings":"AAEA;IAII;;;;;OAKG;IACH,6CAFY,uBAAuB,CASlC;IAfD,uBAAwB;IAiBxB,oEAIC;CASJ;0CAlCyC,gCAAgC"}
@@ -0,0 +1,35 @@
1
+ import { AbstractDecoratorBehavior } from "./AbstractDecoratorBehavior.js";
2
+
3
+ export class OverrideContextBehavior extends AbstractDecoratorBehavior {
4
+
5
+ __override_context = {};
6
+
7
+ /**
8
+ *
9
+ * @param {*} context
10
+ * @param {Behavior} source
11
+ * @return {OverrideContextBehavior}
12
+ */
13
+ static from(context, source) {
14
+ const r = new OverrideContextBehavior();
15
+
16
+ r.__override_context = context;
17
+ r.setSource(source);
18
+
19
+ return r;
20
+ }
21
+
22
+ tick(timeDelta) {
23
+ const s = this.__source.tick(timeDelta);
24
+
25
+ return s;
26
+ }
27
+
28
+ initialize(context) {
29
+ super.initialize(context);
30
+
31
+ const child_context = Object.assign({}, context, this.__override_context);
32
+
33
+ this.__source.initialize(child_context);
34
+ }
35
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"StaticKnowledgeDatabase.d.ts","sourceRoot":"","sources":["../../../../../src/engine/knowledge/database/StaticKnowledgeDatabase.js"],"names":[],"mappings":"mCAUU,MAAM;;;;;;;AAShB;IAEI;;;OAGG;IACH,SAFU,aAAa,oBAAoB,CAAC,CAEmC;IAG/E;;;;OAIG;IACH,gBAAa;IAQb;;;OAGG;IACH,qCAEC;IAGD;;OAEG;IACH,cAUC;IAED;;;;;OAKG;IACH,QAJW,MAAM,QACN,MAAM,yCA8BhB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,0CAAmC,SAAS,CAkBxD;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,gCAA4B,SAAS,CAUjD;IAGD;;;OAGG;IACH,wBAcC;IAED;;;;OAIG;IACH,qDAiBC;IAGD;;;;;;OAMG;IACH,qBAQC;IAED;;;;;OAKG;IACH,mEAmBC;IAED;;;;;;;OAOG;IACH,qBAeC;IAED;;;;;;OAMG;IACH,mBAIC;IAED;;;;;OAKG;IACH,mEAmCC;IAGL,mCAA2D;;CAF1D;yBAlTwB,qCAAqC;mDAIX,yCAAyC"}
1
+ {"version":3,"file":"StaticKnowledgeDatabase.d.ts","sourceRoot":"","sources":["../../../../../src/engine/knowledge/database/StaticKnowledgeDatabase.js"],"names":[],"mappings":"mCAWU,MAAM;;;;;;;AAShB;IAEI;;;OAGG;IACH,SAFU,aAAa,oBAAoB,CAAC,CAEmC;IAG/E;;;;OAIG;IACH,gBAAa;IAQb;;;OAGG;IACH,qCAEC;IAGD;;OAEG;IACH,cAUC;IAED;;;;;OAKG;IACH,QAJW,MAAM,QACN,MAAM,yCAiChB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,0CAAmC,SAAS,CAkBxD;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,gCAA4B,SAAS,CAUjD;IAGD;;;OAGG;IACH,wBAcC;IAED;;;;OAIG;IACH,qDAiBC;IAGD;;;;;;OAMG;IACH,qBAQC;IAED;;;;;OAKG;IACH,mEAmBC;IAED;;;;;;;OAOG;IACH,qBAeC;IAED;;;;;;OAMG;IACH,mBAIC;IAED;;;;;OAKG;IACH,mEAmCC;IAGL,mCAA2D;;CAF1D;yBArTwB,qCAAqC;mDAIX,yCAAyC"}
@@ -1,3 +1,4 @@
1
+ import { assert } from "../../../core/assert.js";
1
2
  import { IllegalStateException } from "../../../core/fsm/exceptions/IllegalStateException.js";
2
3
  import { objectKeyByValue } from "../../../core/model/object/objectKeyByValue.js";
3
4
  import ObservedEnum from "../../../core/model/ObservedEnum.js";
@@ -70,6 +71,9 @@ export class StaticKnowledgeDatabase {
70
71
  * @param {StaticKnowledgeDataTable} table
71
72
  */
72
73
  add(id, path, table) {
74
+ assert.defined(table,'table');
75
+ assert.notNull(table,'table');
76
+
73
77
  const state = this.__state.getValue();
74
78
 
75
79
  if (state !== StaticKnowledgeState.Initial) {
@@ -1 +1 @@
1
- {"version":3,"file":"CellFilterCurvature.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/filtering/numeric/complex/CellFilterCurvature.js"],"names":[],"mappings":"AA4DA;IAWI;;;;OAIG;IACH,qBAHW,UAAU,GACT,mBAAmB,CAW9B;IArBG;;;OAGG;IACH,SAFU,UAAU,CAED;IAmBvB,uCAMC;IAED;;;;;;;OAOG;IACH,mDAFY,MAAM,CAoBjB;CACJ;2BA1H0B,qBAAqB"}
1
+ {"version":3,"file":"CellFilterCurvature.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/filtering/numeric/complex/CellFilterCurvature.js"],"names":[],"mappings":"AA4DA;IAUI;;;;OAIG;IACH,qBAHW,UAAU,GACT,mBAAmB,CAW9B;IArBG;;;OAGG;IACH,SAFU,UAAU,CAEL;IAmBnB,uCAMC;IAED;;;;;;;OAOG;IACH,mDAFY,MAAM,CAoBjB;CACJ;2BAxH0B,qBAAqB"}
@@ -1,5 +1,5 @@
1
- import { CellFilter } from "../../CellFilter.js";
2
1
  import { assert } from "../../../../core/assert.js";
2
+ import { CellFilter } from "../../CellFilter.js";
3
3
 
4
4
 
5
5
  /*
@@ -59,15 +59,14 @@ function computeNormal(grid, result, surface, x, y) {
59
59
  }
60
60
 
61
61
  export class CellFilterCurvature extends CellFilter {
62
- constructor() {
63
- super();
62
+
64
63
 
65
64
  /**
66
65
  * Surface for which the curvature is to be computed
67
66
  * @type {CellFilter}
68
67
  */
69
- this.surface = null;
70
- }
68
+ surface = null;
69
+
71
70
 
72
71
  /**
73
72
  *
@@ -1 +1 @@
1
- {"version":3,"file":"CellFilterCubicFunction.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/filtering/numeric/math/poly/CellFilterCubicFunction.js"],"names":[],"mappings":"AAGA;IAWI;;;;;;;;OAQG;IACH,oCANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,uBAAuB,CAoBnC;IAlCG,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IAiCf,0BAKC;CACJ;yCAjDwC,2CAA2C"}
1
+ {"version":3,"file":"CellFilterCubicFunction.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/filtering/numeric/math/poly/CellFilterCubicFunction.js"],"names":[],"mappings":"AAGA;IAOI;;;;;;;;OAQG;IACH,oCANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,uBAAuB,CAoBnC;IAhCD,WAAO;IACP,WAAO;IACP,WAAO;IACP,WAAO;IA+BP,0BAKC;CACJ;yCA5CwC,2CAA2C"}
@@ -1,16 +1,12 @@
1
- import { CellFilterUnaryOperation } from "../../../core/CellFilterUnaryOperation.js";
2
1
  import { assert } from "../../../../../core/assert.js";
2
+ import { CellFilterUnaryOperation } from "../../../core/CellFilterUnaryOperation.js";
3
3
 
4
4
  export class CellFilterCubicFunction extends CellFilterUnaryOperation {
5
- constructor() {
6
- super();
7
-
8
- this.p0 = 0;
9
- this.p1 = 0;
10
- this.p2 = 0;
11
- this.p3 = 0;
12
- }
13
5
 
6
+ p0 = 0;
7
+ p1 = 0;
8
+ p2 = 0;
9
+ p3 = 0;
14
10
 
15
11
  /**
16
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"DomTooltipManager.d.ts","sourceRoot":"","sources":["../../../../src/view/tooltip/DomTooltipManager.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IACI;;;OAGG;IACH,wCA6BC;IA5BG;;;;OAIG;IACH,4BAA4B;IAE5B;;;;OAIG;IACH,sBAAyB;IAGzB;;;;OAIG;IACH,oBAAsB;IAEtB;;;;OAIG;IACH,2BAA4B;IAGhC;;;OAGG;IACH,gCAEC;IAED;;;OAGG;IACH,eAFW,kBAAkB,QAM5B;IAED;;;OAGG;IACH,eAFW,kBAAkB,QAM5B;IAED,wBAQC;IAED;;;;OAIG;IACH,uBAFa,OAAO,CAenB;IAED;;;;;OAKG;IACH,kEAQC;IAED;;;OAGG;IACH,oBAMC;IAED,0BAOC;IAED;;;OAGG;IACH,uBAIC;IAED;;;;;;OAMG;IACH,+DAeC;IAED;;;OAGG;IACH,4BAgBC;CACJ;mCAhMkC,yBAAyB"}
1
+ {"version":3,"file":"DomTooltipManager.d.ts","sourceRoot":"","sources":["../../../../src/view/tooltip/DomTooltipManager.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IACI;;;OAGG;IACH,wCA6BC;IA5BG;;;;OAIG;IACH,4BAA4B;IAE5B;;;;OAIG;IACH,sBAAyB;IAGzB;;;;OAIG;IACH,oBAAsB;IAEtB;;;;OAIG;IACH,2BAA4B;IAGhC;;;OAGG;IACH,gCAEC;IAED;;;OAGG;IACH,eAFW,kBAAkB,QAM5B;IAED;;;OAGG;IACH,eAFW,kBAAkB,QAM5B;IAED,wBAQC;IAED;;;;OAIG;IACH,uBAFa,OAAO,CAiBnB;IAED;;;;;OAKG;IACH,kEAQC;IAED;;;OAGG;IACH,oBAMC;IAED,0BAOC;IAED;;;OAGG;IACH,uBAIC;IAED;;;;;;OAMG;IACH,+DAeC;IAED;;;OAGG;IACH,4BAgBC;CACJ;mCAlMkC,yBAAyB"}
@@ -96,6 +96,8 @@ export class DomTooltipManager {
96
96
  this.hide(observer);
97
97
  this.show(observer);
98
98
  }
99
+
100
+ return true;
99
101
  }
100
102
 
101
103
  /**