@rings-webgpu/core 1.0.32 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rings.es.js +33 -33
- package/dist/rings.es.js.map +3 -3
- package/dist/rings.es.max.js +18 -58
- package/dist/rings.umd.js +22 -22
- package/dist/rings.umd.js.map +3 -3
- package/dist/rings.umd.max.js +18 -58
- package/dist/types/loader/parser/tileRenderer/TilesRenderer.d.ts +0 -5
- package/dist/types/loader/parser/tileRenderer/utils/PriorityQueue.d.ts +3 -10
- package/package.json +1 -1
package/dist/rings.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(d,Yt){typeof exports=="object"&&typeof module<"u"?Yt(exports):typeof define=="function"&&define.amd?define(["exports"],Yt):(d=typeof globalThis<"u"?globalThis:d||self,Yt(d.rings={}))})(void 0,(function(d){"use strict";var Yt=typeof document<"u"?document.currentScript:null;class J{static COLOR_RED=new J(1,0,0,1);static COLOR_GREEN=new J(0,1,0,1);static COLOR_BLUE=new J(0,0,1,1);static COLOR_WHITE=new J(1,1,1,1);static COLOR_0=new J;static COLOR_1=new J;static COLOR_2=new J;static HEX_CHARACTERS="a-f\\d";static MATCH_3OR4_HEX=`#?[${J.HEX_CHARACTERS}]{3}[${J.HEX_CHARACTERS}]?`;static MATCH_6OR8_HEX=`#?[${J.HEX_CHARACTERS}]{6}([${J.HEX_CHARACTERS}]{2})?`;static NON_HEX_CHARS=new RegExp(`[^#${J.HEX_CHARACTERS}]`,"gi");static VALID_HEX_SIZE=new RegExp(`^${J.MATCH_3OR4_HEX}$|^${J.MATCH_6OR8_HEX}$`,"i");r=0;g=0;b=0;a=0;constructor(e=1,t=1,a=1,r=1){this.setTo(e,t,a,r)}convertToHDRRGB(){return this.r=this.r*Math.pow(2.4,this.a),this.g=this.g*Math.pow(2.4,this.a),this.b=this.b*Math.pow(2.4,this.a),this}unSerialized(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}hexToRGB(e){return this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}hexToRGBA(e){return this.a=(e>>24&255)/255,this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}static random(e=1){let t=new J;return t.a=e,t.r=e*Math.random(),t.g=e*Math.random(),t.b=e*Math.random(),t}static randomRGB(e=.5,t=.5,a=.5,r=.5,i=.5,n=.5){let o=new J;return o.a=1,o.r=r+e*Math.random(),o.g=i+t*Math.random(),o.b=n+a*Math.random(),o}static randomGray(e=.5,t=.5){let a=Math.random()*t+e,r=new J;return r.a=1,r.r=a,r.g=a,r.b=a,r}setTo(e,t,a,r){this.r=Math.max(e,0),this.g=Math.max(t,0),this.b=Math.max(a,0),this.a=Math.max(r,0)}setHex(e){if(typeof e!="string"||J.NON_HEX_CHARS.test(e)||!J.VALID_HEX_SIZE.test(e))throw new TypeError("Expected a valid hex string");e=e.replace(/^#/,"");let t=1;e.length===8&&(t=Number.parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),e.length===4&&(t=Number.parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const a=Number.parseInt(e,16),r=a>>16,i=a>>8&255,n=a&255,o=t;this.a=o,this.r=r/255,this.g=i/255,this.b=n/255}getHex(){let e=a=>{a*=255;let r=a.toString(16);return r.length===1&&(r="0"+r),r};return e(this.r)+e(this.g)+e(this.b)+e(this.a)}get rgb(){return[this.r*255>>>0,this.g*255>>>0,this.b*255>>>0]}set rgb(e){this.setTo(e[0]/255,e[1]/255,e[2]/255,this.a)}get rgba(){return[this.r*255>>>0,this.g*255>>>0,this.b*255>>>0,this.a*255>>>0]}set rgba(e){this.setTo(e[0]/255,e[1]/255,e[2]/255,e[3]/255)}clone(){return new J().copyFrom(this)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}copyFromArray(e,t=255){return this.r=e[0]/t,this.g=e[1]/t,this.b=e[2]/t,this.a=e[3]/t,this}copyFromVector(e){return this.r=e.x,this.g=e.y,this.b=e.z,this.a=e.w||1,this}static hexRGBColor(e,t=null){return t=t||new J,t.hexToRGB(e),t}static lerp(e,t,a,r){let i=r||new J;return i.r=(a.r-t.r)*e+t.r,i.g=(a.g-t.g)*e+t.g,i.b=(a.b-t.b)*e+t.b,i.a=(a.a-t.a)*e+t.a,i}static PRIMARY=4149685;static PRIMARYDARK=3162015;static ACCENT=16728193;static WHITE=16777215;static IVORY=16777200;static LIGHTYELLOW=16777184;static YELLOW=16776960;static SNOW=16775930;static FLORALWHITE=16775920;static LEMONCHIFFON=16775885;static CORNSILK=16775388;static SEASHELL=16774638;static LAVENDERBLUSH=16773365;static PAPAYAWHIP=16773077;static BLANCHEDALMOND=16772045;static MISTYROSE=16770273;static BISQUE=16770244;static MOCCASIN=16770229;static NAVAJOWHITE=16768685;static PEACHPUFF=16767673;static GOLD=16766720;static PINK=16761035;static LIGHTPINK=16758465;static ORANGE=16753920;static LIGHTSALMON=16752762;static DARKORANGE=16747520;static CORAL=16744272;static HOTPINK=16738740;static TOMATO=16737095;static ORANGERED=16729344;static DEEPPINK=16716947;static FUCHSIA=16711935;static MAGENTA=16711935;static RED=16711680;static OLDLACE=16643558;static LIGHTGOLDENRODYELLOW=16448210;static LINEN=16445670;static ANTIQUEWHITE=16444375;static SALMON=16416882;static GHOSTWHITE=16316671;static MINTCREAM=16121850;static WHITESMOKE=16119285;static BEIGE=16119260;static WHEAT=16113331;static SANDYBROWN=16032864;static AZURE=15794175;static HONEYDEW=15794160;static ALICEBLUE=15792383;static KHAKI=15787660;static LIGHTCORAL=15761536;static PALEGOLDENROD=15657130;static VIOLET=15631086;static DARKSALMON=15308410;static LAVENDER=15132410;static LIGHTCYAN=14745599;static BURLYWOOD=14596231;static PLUM=14524637;static GAINSBORO=14474460;static CRIMSON=14423100;static PALEVIOLETRED=14381203;static GOLDENROD=14329120;static ORCHID=14315734;static THISTLE=14204888;static LIGHTGREY=13882323;static TAN=13808780;static CHOCOLATE=13789470;static PERU=13468991;static INDIANRED=13458524;static MEDIUMVIOLETRED=13047173;static SILVER=12632256;static DARKKHAKI=12433259;static ROSYBROWN=12357519;static MEDIUMORCHID=12211667;static DARKGOLDENROD=12092939;static FIREBRICK=11674146;static POWDERBLUE=11591910;static LIGHTSTEELBLUE=11584734;static PALETURQUOISE=11529966;static GREENYELLOW=11403055;static LIGHTBLUE=11393254;static DARKGRAY=11119017;static BROWN=10824234;static SIENNA=10506797;static DARKORCHID=10040012;static PALEGREEN=10025880;static DARKVIOLET=9699539;static MEDIUMPURPLE=9662683;static LIGHTGREEN=9498256;static DARKSEAGREEN=9419919;static SADDLEBROWN=9127187;static DARKMAGENTA=9109643;static DARKRED=9109504;static BLUEVIOLET=9055202;static LIGHTSKYBLUE=8900346;static SKYBLUE=8900331;static GRAY=8421504;static OLIVE=8421376;static PURPLE=8388736;static MAROON=8388608;static AQUAMARINE=8388564;static CHARTREUSE=8388352;static LAWNGREEN=8190976;static MEDIUMSLATEBLUE=8087790;static LIGHTSLATEGRAY=7833753;static SLATEGRAY=7372944;static OLIVEDRAB=7048739;static SLATEBLUE=6970061;static DIMGRAY=6908265;static MEDIUMAQUAMARINE=6737322;static CORNFLOWERBLUE=6591981;static CADETBLUE=6266528;static DARKOLIVEGREEN=5597999;static INDIGO=4915330;static MEDIUMTURQUOISE=4772300;static DARKSLATEBLUE=4734347;static STEELBLUE=4620980;static ROYALBLUE=4286945;static TURQUOISE=4251856;static MEDIUMSEAGREEN=3978097;static LIMEGREEN=3329330;static DARKSLATEGRAY=3100495;static SEAGREEN=3050327;static FORESTGREEN=2263842;static LIGHTSEAGREEN=2142890;static DODGERBLUE=2003199;static MIDNIGHTBLUE=1644912;static AQUA=65535;static CYAN=65535;static SPRINGGREEN=65407;static LIME=65280;static MEDIUMSPRINGGREEN=64154;static DARKTURQUOISE=52945;static DEEPSKYBLUE=49151;static DARKCYAN=35723;static TEAL=32896;static GREEN=32768;static DARKGREEN=25600;static BLUE=255;static MEDIUMBLUE=205;static DARKBLUE=139;static NAVY=128;static BLACK=0}class Le{static time=0;static frame=0;static delta=0;static _startTime=0;static _timeLabel="";static start(e){this._startTime=performance.now(),this._timeLabel=e}static end(){console.log(this._timeLabel,performance.now()-this._startTime)}}class bt{target;currentTarget;type;data;param;time=0;delay=0;mouseCode=0;ctrlKey;metaKey;altKey;shiftKey;targetTouches;changedTouches;touches;_stopImmediatePropagation=!1;view;constructor(e=null,t=null){this.type=e,this.data=t}stopImmediatePropagation(){this._stopImmediatePropagation=!0}reset(){this._stopImmediatePropagation=!1}get isStopImmediatePropagation(){return this._stopImmediatePropagation}}class rn{constructor(e=null,t=null,a=null,r=null,i=0){this.type=e,this.thisObject=t,this.handler=a,this.param=r,this.priority=i}static event_id_count=0;id=0;current;equalCurrentListener(e,t,a,r){return this.type==e&&this.thisObject==a&&this.handler==t&&this.param==r}dispose(){this.handler=null,this.thisObject=null,this.param=null,this.priority=0}}class Ja{listeners={};data;dispatchEvent(e){let t=this.listeners[e.type];if(t!=null){t=t.slice();for(let a=0;a<t.length;a++){let r=t[a];if(r.handler){try{e.param=r.param,e.currentTarget=r,r.thisObject,r.handler.call(r.thisObject,e)}catch{}if(e.isStopImmediatePropagation)break}}}}destroy(){for(let e in this.listeners){let t=this.listeners[e];for(;t.length>0;){let a=t[0];a.handler=null,a.thisObject=null,t.splice(0,1)}}}addEventListener(e,t,a,r=null,i=0){if(this.listeners[e]==null&&(this.listeners[e]=[]),!this.hasEventListener(e,t,a)){let n=new rn(e,a,t,r,i);return n.id=++rn.event_id_count,n.current=this,this.listeners[e].push(n),this.listeners[e].sort(function(o,l){return l.priority-o.priority}),n.id}for(let n=0;n<this.listeners[e].length;n++){let o=this.listeners[e][n];if(o.equalCurrentListener(e,t,a,r))return o.id}return 0}removeEventListener(e,t,a){if(this.hasEventListener(e,t,a))for(let r=0;r<this.listeners[e].length;r++){let i=this.listeners[e][r];if(i.equalCurrentListener(e,t,a,i.param)){i.handler=null,i.thisObject=null,this.listeners[e].splice(r,1);return}}}removeEventListenerAt(e){for(let t in this.listeners)for(let a=0;a<this.listeners[t].length;a++){let r=this.listeners[t][a];if(r.id==e)return r.handler=null,r.thisObject=null,this.listeners[t].splice(a,1),!0}return!1}removeAllEventListener(e=null){let t;if(e){if(this.listeners[e]){for(let a=0;a<this.listeners[e].length;a++)t=this.listeners[e][a],t.dispose(),this.listeners[e].splice(a,1);delete this.listeners[e]}}else for(let a in this.listeners){for(let r=0;r<this.listeners[a].length;r++)t=this.listeners[a][r],t.dispose(),this.listeners[a].splice(r,1);delete this.listeners[a]}}containEventListener(e){return this.listeners[e]==null?!1:this.listeners[e].length>0}hasEventListener(e,t=null,a=null){if(this.listeners[e]==null)return!1;if(a&&t)for(let r=0;r<this.listeners[e].length;r++){let i=this.listeners[e][r];if(i.equalCurrentListener(e,t,a,i.param))return!0}return!1}}class Ra extends bt{static KEY_DOWN="onKeyDown";static KEY_UP="onKeyUp";keyCode=0}class j extends bt{static PICK_OVER="onPickOver";static PICK_CLICK="onPickClick";static PICK_OUT="onPickOut";static PICK_MOVE="onPickMove";static PICK_UP="onPickUp";static PICK_DOWN="onPickDown";static POINTER_RIGHT_CLICK="onPointerRightClick";static POINTER_MID_UP="onPointerMidUp";static POINTER_MID_DOWN="onPointerMidDown";static POINTER_CLICK="onPointerClick";static POINTER_MOVE="onPointerMove";static POINTER_DOWN="onPointerDown";static POINTER_UP="onPointerUp";static POINTER_OUT="onPointerOut";static POINTER_OVER="onPointerOver";static POINTER_WHEEL="onPointerWheel";pointerId;pointerType="onPointer";isPrimary;pressure;mouseX;mouseY;movementX;movementY;deltaX;deltaY;deltaZ;reset(){super.reset(),this.mouseX=0,this.mouseY=0,this.movementX=0,this.movementY=0,this.deltaX=0,this.deltaY=0,this.deltaZ=0}}class Ut extends bt{static PICK_OVER_GUI="onPickOverGUI";static PICK_CLICK_GUI="onPickClickGUI";static PICK_OUT_GUI="onPickOutGUI";static PICK_UP_GUI="onPickUpGUI";static PICK_DOWN_GUI="onPickDownGUI";pointerId;pointerType="onPickGUI";isPrimary;pressure;mouseX;mouseY;movementX;movementY;deltaX;deltaY;deltaZ;reset(){super.reset(),this.mouseX=0,this.mouseY=0,this.movementX=0,this.movementY=0,this.deltaX=0,this.deltaY=0,this.deltaZ=0}}class b{static MAX=new b(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);static MIN=new b(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE);static SAFE_MAX=new b(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);static SAFE_MIN=new b(Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);static X_AXIS=new b(1,0,0);static neg_X_AXIS=new b(-1,0,0);static Y_AXIS=new b(0,1,0);static Z_AXIS=new b(0,0,1);static HELP_0=new b;static HELP_1=new b;static HELP_2=new b;static EPSILON=1e-5;static HELP_3=new b;static HELP_4=new b;static HELP_5=new b;static HELP_6=new b;static get ZERO(){return new b(0,0,0)}static get ONE(){return new b(1,1,1)}static get LEFT(){return new b(-1,0,0)}static get RIGHT(){return new b(1,0,0)}static get UP(){return new b(0,1,0)}static get DOWN(){return new b(0,-1,0)}static get BACK(){return new b(0,0,-1)}static get FORWARD(){return new b(0,0,1)}x=0;y=0;z=0;w=1;index=0;static _index=0;constructor(e=0,t=0,a=0,r=0){this.set(e,t,a,r),this.index=b._index++}set a(e){this.w=e}set r(e){this.x=e}set g(e){this.y=e}set b(e){this.z=e}get a(){return this.w}get r(){return this.x}get g(){return this.y}get b(){return this.z}get length(){return Math.sqrt(this.lengthSquared)}get lengthSquared(){return this.x*this.x+this.y*this.y+this.z*this.z}get position(){return this}static getTowPointbyDir(e,t,a,r,i){i==b.Z_AXIS?(t.x=e.y,t.y=-e.x,a.x=-e.y,a.y=e.x,t.scaleBy(r*.5),a.scaleBy(r*.5)):i==b.Y_AXIS&&(t.x=e.z,t.z=-e.x,a.x=-e.z,a.z=e.x,t.scaleBy(r*.5),a.scaleBy(r*.5))}static pointToLine(e,t,a){let r=0,i,n,o;if(i=b.distance(e,t),n=b.distance(e,a),o=b.distance(t,a),o<=1e-6||n<=1e-6)return r=0,r;if(i<=1e-6||o*o>=i*i+n*n)return r=n,r;if(n*n>=i*i+o*o)return r=o,r;let l=(i+n+o)/2;return r=2*Math.sqrt(l*(l-i)*(l-n)*(l-o))/i,r}static dot(e,t){return e.x*t.x+e.y*t.y+e.z*t.z}static getPoints(e,t){let a=[];for(let r=0;r<e;r++){const i=new b(Math.random()*t-t*.5,Math.random()*t-t*.5,Math.random()*t-t*.5);a.push(i)}return a}static getPointNumbers(e,t){let a=[];for(let r=0;r<e;r++)a.push(Math.random()*t-t*.5,Math.random()*t-t*.5,Math.random()*t-t*.5);return a}static getAngle(e,t){let a=e.dotProduct(t)/(e.length*t.length);return Math.acos(a)*180/Math.PI}static sqrMagnitude(e){return e.x*e.x+e.y*e.y+e.z*e.z}static getZYAngle(e,t){return this.calAngle(e.y,e.z,t.y,t.z)}static sub(e,t,a=null){return a=a||new b,a.x=e.x-t.x,a.y=e.y-t.y,a.z=e.z-t.z,a}static add(e,t,a=null){return a=a||new b,a.x=e.x+t.x,a.y=e.y+t.y,a.z=e.z+t.z,a}static smoothDamp(e,t,a,r,i,n){return null}static distance(e,t){let a=e.x-t.x,r=e.y-t.y,i=e.z-t.z;return Math.sqrt(a*a+r*r+i*i)}static squareDistance(e,t){let a=e.x-t.x,r=e.y-t.y,i=e.z-t.z;return a*a+r*r+i*i}static distanceXZ(e,t){let a=e.x-t.x,r=0,i=e.z-t.z;return Math.sqrt(a*a+r*r+i*i)}set(e,t,a,r=1){return this.x=e,this.y=t,this.z=a,this.w=r,this}add(e,t=null){t||=new b;let a=this.x,r=this.y,i=this.z,n=this.w,o=e.x,l=e.y,c=e.z,f=e.w;return t.setTo(a+o,r+l,i+c,n+f),t}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}min(e,t=this){return t.x=Math.min(this.x,e.x),t.y=Math.min(this.y,e.y),t.z=Math.min(this.z,e.z),t}max(e,t=this){return t.x=Math.max(this.x,e.x),t.y=Math.max(this.y,e.y),t.z=Math.max(this.z,e.z),t}distanceToSquared(e){let t=this.x-e.x,a=this.y-e.y,r=this.z-e.z;return t*t+a*a+r*r}addXYZW(e,t,a,r,i=null){i||=new b;let n=this.x,o=this.y,l=this.z,c=this.w,f=e,h=t,u=a,g=r;return i.setTo(n+f,o+h,l+u,c+g),i}clone(){return new b(this.x,this.y,this.z,this.w)}copyFrom(e){let t=this;return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}decrementBy(e){this.x-=e.x,this.y-=e.y,this.z-=e.z}dotProduct(e){return this.x*e.x+this.y*e.y+this.z*e.z}equals(e,t=!1){return this.x==e.x&&this.y==e.y&&this.z==e.z&&(!t||this.w==e.w)}incrementBy(e){this.x+=e.x,this.y+=e.y,this.z+=e.z}divide(e){return e instanceof b?new b(this.x/e.x,this.y/e.y,this.z/e.z):(this.x=this.x/e,this.y=this.y/e,this.z=this.z/e,this)}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}normalize(e=1){let t=this;if(this.length!=0){let a=e/this.length;return this.x*=a,this.y*=a,this.z*=a,t}return t}applyQuaternion(e){const t=this.x,a=this.y,r=this.z,i=e.x,n=e.y,o=e.z,l=e.w,c=l*t+n*r-o*a,f=l*a+o*t-i*r,h=l*r+i*a-n*t,u=-i*t-n*a-o*r;return this.x=c*l+u*-i+f*-o-h*-n,this.y=f*l+u*-n+h*-i-c*-o,this.z=h*l+u*-o+c*-n-f*-i,this}applyMatrix4(e){return e.transformPoint(this,this)}scaleBy(e){return this.x*=e,this.y*=e,this.z*=e,this}mul(e){let t=new b;return t.x=this.x*e,t.y=this.y*e,t.z=this.z*e,t}scale(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}scaleToRef(e,t){return t||(t=new b),t.x=this.x*e,t.y=this.y*e,t.z=this.z*e,t}setTo(e,t,a,r=1){this.x=e,this.y=t,this.z=a,this.w=r}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}subtract(e,t=null){return t||(t=new b),t.setTo(this.x-e.x,this.y-e.y,this.z-e.z),t}multiply(e,t=null){t||(t=new b);let a=this.x,r=this.y,i=this.z,n=e.x,o=e.y,l=e.z;return t.setTo(a*n,r*o,i*l),t}divided(e,t=null){t||(t=new b);let a=this.x,r=this.y,i=this.z,n=e.x,o=e.y,l=e.z;return t.setTo(a/n,r/o,i/l),t}div(e,t){t||(t=new b);let a=this.x,r=this.y,i=this.z,n=this.w;return t.setTo(a/e,r/e,i/e,n/e),t}lerp(e,t,a){let r=e.x,i=e.y,n=e.z,o=e.w,l=t.x,c=t.y,f=t.z,h=t.w;this.x=(l-r)*a+r,this.y=(c-i)*a+i,this.z=(f-n)*a+n,this.w=(h-o)*a+o}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}toString(){return"<"+this.x+", "+this.y+", "+this.z+">"}normalizeToWay2D_XY(){let e=Math.abs(this.x),t=Math.abs(this.y);e>t?this.x>0?this.copyFrom(b.RIGHT):this.copyFrom(b.LEFT):this.y>0?this.copyFrom(b.DOWN):this.copyFrom(b.UP)}toArray(){return[this.x,this.y,this.z]}copyToBytes(e){e.setFloat32(0*Float32Array.BYTES_PER_ELEMENT,this.x,!0),e.setFloat32(1*Float32Array.BYTES_PER_ELEMENT,this.y,!0),e.setFloat32(2*Float32Array.BYTES_PER_ELEMENT,this.z,!0)}crossProduct(e,t=null){return t=t||new b,t.x=this.y*e.z-this.z*e.y,t.y=this.z*e.x-this.x*e.z,t.z=this.x*e.y-this.y*e.x,t.w=1,t}crossVectors(e,t){return e.crossProduct(t,this),this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}setFromArray(e,t=0){this.x=e[t],this.y=e[t+1],this.z=e[t+2]}divideScalar(e){return this.multiplyScalar(1/e)}clampLength(e,t){let a=this.length;return this.divideScalar(a||1).multiplyScalar(Math.max(e,Math.min(t,a)))}setScalar(e){return this.x=e,this.y=e,this.z=e,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}static calAngle(e,t,a,r){const i=o(a,r,e,t);let n=Math.acos(i)*180/Math.PI;return a<e&&(n=-n),n;function o(c,f,h,u){let g=[c-h,f-u];return l(g,[0,-1])}function l(c,f){let h=c[0]*f[0]+c[1]*f[1],u=Math.sqrt(c[0]*c[0]+c[1]*c[1])*Math.sqrt(f[0]*f[0]+f[1]*f[1]);return h/u}}static pointInsideTriangle(e,t,a,r){return b.HELP_0.setTo(e.x,e.z,0),b.HELP_1.setTo(t.x,t.z,0),b.HELP_2.setTo(a.x,a.z,0),b.HELP_3.setTo(r.x,r.z,0),b.pointInsideTriangle2d()}static pointInsideTriangle2d(){return b.productXY(b.HELP_1,b.HELP_2,b.HELP_3)>=0?b.productXY(b.HELP_1,b.HELP_2,b.HELP_0)>=0&&b.productXY(b.HELP_2,b.HELP_3,b.HELP_0)>=0&&b.productXY(b.HELP_3,b.HELP_1,b.HELP_0)>=0:b.productXY(b.HELP_1,b.HELP_2,b.HELP_0)<=0&&b.productXY(b.HELP_2,b.HELP_3,b.HELP_0)<=0&&b.productXY(b.HELP_3,b.HELP_1,b.HELP_0)<=0}static productXY(e,t,a){var r=(e.x-a.x)*(t.y-a.y)-(e.y-a.y)*(t.x-a.x);return r>-1e-5&&r<1e-5&&(r=0),r}static serialize(e){return new b(e.x,e.y,e.z,e.w)}}class Yo{constructor(e){this.canvasX=e.clientX,this.canvasY=e.clientY,this.identifier=e.identifier,this.clientX=e.clientX,this.clientY=e.clientY,this.pageX=e.pageX,this.pageY=e.pageY,this.screenX=e.screenX,this.screenY=e.screenY}canvasX;canvasY;identifier;clientX;clientY;pageX;pageY;screenX;screenY}class Xo extends Ja{canvasX=0;canvasY=0;isMouseDown=!1;isRightMouseDown=!1;canvas;mouseX=0;mouseY=0;wheelDelta=0;mouseOffsetX=0;mouseOffsetY=0;mouseLastX=0;mouseLastY=0;_time=0;_keyStatus;_mouseStatus;_isTouchStart;_keyEvent3d;_pointerEvent3D;_windowsEvent3d;mouseLock=!1;initCanvas(e){this.canvas=e;let t=0,a=0,r=0,i=0;e.onpointerdown=o=>{t=performance.now(),a=o.clientX,r=o.clientY,i=o.button,o.button==0?this.mouseStart(o):o.button==1?this.middleDown(o):o.button==2&&(this.isRightMouseDown=!0,this.mouseStart(o)),e.setPointerCapture(o.pointerId)},e.onpointerup=o=>{o.button==0?this.mouseEnd(o):o.button==1?this.middleUp(o):o.button==2&&(this.isRightMouseDown=!1,this.mouseEnd(o)),o.button===i&&performance.now()-t<300&&Math.abs(a-o.clientX)<20&&Math.abs(r-o.clientY)<20&&(o.button===0?this.mouseClick(o):this.rightClick(o)),e.releasePointerCapture(o.pointerId)},e.onpointerenter=o=>{this.mouseOver(o)},e.onpointermove=o=>{this.mouseMove(o)},e.onpointercancel=o=>{e.releasePointerCapture(o.pointerId),o.button==1?this.middleUp(o):this.mouseEnd(o)},e.addEventListener("wheel",o=>this.mouseWheel(o),{passive:!1}),window.addEventListener("keydown",o=>this.keyDown(o),!0),window.addEventListener("keyup",o=>this.keyUp(o),!0),e.oncontextmenu=function(){return!1};let n=this.canvas.getBoundingClientRect();this.canvasX=n.left,this.canvasY=n.top,this._keyStatus={},this._mouseStatus={},this._isTouchStart=!1,this._keyEvent3d=new Ra,this._pointerEvent3D=new j,this._windowsEvent3d=new bt}useMouseLock(){this.mouseLock||(this.canvas.requestPointerLock(),this.mouseLock=!0,document.addEventListener("mousemove",e=>this.onMouseLockMove(e),!1))}releaseMouseLock(){this.mouseLock=!1,document.exitPointerLock(),document.removeEventListener("mousemove",e=>this.onMouseLockMove(e),!1)}onMouseLockMove(e){this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=e.movementX,this.mouseOffsetY=e.movementY,this._pointerEvent3D.reset(),this._pointerEvent3D.type=j.POINTER_MOVE,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this._pointerEvent3D.movementX=e.movementX,this._pointerEvent3D.movementY=e.movementY,this.dispatchEvent(this._pointerEvent3D)}onPinch(e,t,a,r){this._oldPosition1=new b(e,t),this._oldPosition2=new b(a,r)}onSwipe(e,t){this.mouseX=e,this.mouseY=t,this._oldPosition1=null,this._oldPosition2=null,this._time=new Date().getTime()}_oldPosition1=null;_oldPosition2=null;GetTargetTouches(e){for(var t=new Array,a=0;a<e.length;a++){var r=new Yo(e[a]);t.push(r)}return t}rightClick(e){this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._pointerEvent3D.mouseX=e.clientX-this.canvasX,this._pointerEvent3D.mouseY=e.clientY-this.canvasY,this._pointerEvent3D.type=j.POINTER_RIGHT_CLICK,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this.dispatchEvent(this._pointerEvent3D)}middleDown(e){this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._pointerEvent3D.mouseX=e.clientX-this.canvasX,this._pointerEvent3D.mouseY=e.clientY-this.canvasY,this._pointerEvent3D.type=j.POINTER_MID_DOWN,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId?e.pointerId:0,this._pointerEvent3D.pointerType=e.pointerType?e.pointerType:0,this._pointerEvent3D.isPrimary=e.isPrimary?e.isPrimary:0,this._pointerEvent3D.pressure=e.pressure?e.pressure:0,this.dispatchEvent(this._pointerEvent3D)}middleUp(e){this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._pointerEvent3D.mouseX=e.clientX-this.canvasX,this._pointerEvent3D.mouseY=e.clientY-this.canvasY,this._pointerEvent3D.type=j.POINTER_MID_UP,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId,this._pointerEvent3D.pointerType=e.pointerType,this._pointerEvent3D.isPrimary=e.isPrimary,this._pointerEvent3D.pressure=e.pressure,this.dispatchEvent(this._pointerEvent3D)}mouseClick(e){this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._pointerEvent3D.mouseX=e.clientX-this.canvasX,this._pointerEvent3D.mouseY=e.clientY-this.canvasY,this._pointerEvent3D.type=j.POINTER_CLICK,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this.dispatchEvent(this._pointerEvent3D)}_downTime=0;mouseEnd(e){this.isMouseDown=!1,this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=this.mouseX-this.mouseLastX,this.mouseOffsetY=this.mouseY-this.mouseLastY,this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._mouseStatus[this._pointerEvent3D.mouseCode]=!1,this._pointerEvent3D.type=j.POINTER_UP,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId,this._pointerEvent3D.pointerType=e.pointerType,this._pointerEvent3D.isPrimary=e.isPrimary,this._pointerEvent3D.pressure=e.pressure,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this.dispatchEvent(this._pointerEvent3D)}mouseStart(e){this.isMouseDown=!0,this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=this.mouseX-this.mouseLastX,this.mouseOffsetY=this.mouseY-this.mouseLastY,this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId?e.pointerId:0,this._pointerEvent3D.pointerType=e.pointerType?e.pointerType:0,this._pointerEvent3D.isPrimary=e.isPrimary?e.isPrimary:0,this._pointerEvent3D.pressure=e.pressure?e.pressure:0,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this._pointerEvent3D.type=j.POINTER_DOWN,this.dispatchEvent(this._pointerEvent3D)}mouseMove(e){this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=this.mouseX-this.mouseLastX,this.mouseOffsetY=this.mouseY-this.mouseLastY,this._pointerEvent3D.reset(),this._pointerEvent3D.type=j.POINTER_MOVE,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId,this._pointerEvent3D.pointerType=e.pointerType,this._pointerEvent3D.isPrimary=e.isPrimary,this._pointerEvent3D.pressure=e.pressure,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this._pointerEvent3D.movementX=e.movementX,this._pointerEvent3D.movementY=e.movementY,this.dispatchEvent(this._pointerEvent3D)}mouseOver(e){this.isMouseDown=!1,this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=this.mouseX-this.mouseLastX,this.mouseOffsetY=this.mouseY-this.mouseLastY,this._pointerEvent3D.reset(),this._pointerEvent3D.type=j.POINTER_OVER,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId,this._pointerEvent3D.pointerType=e.pointerType,this._pointerEvent3D.isPrimary=e.isPrimary,this._pointerEvent3D.pressure=e.pressure,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this.dispatchEvent(this._pointerEvent3D)}mouseWheel(e){e.preventDefault(),this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=this.mouseX-this.mouseLastX,this.mouseOffsetY=this.mouseY-this.mouseLastY,"wheelDelta"in e?(this._pointerEvent3D.delay=e.wheelDelta,this.wheelDelta=e.wheelDelta):"delta"in e&&(this.wheelDelta=e.delta),this._pointerEvent3D.reset(),this._pointerEvent3D.type=j.POINTER_WHEEL,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this._pointerEvent3D.deltaX=e.deltaX,this._pointerEvent3D.deltaY=e.deltaY,this._pointerEvent3D.deltaZ=e.deltaZ,this.dispatchEvent(this._pointerEvent3D)}keyDown(e){this._keyEvent3d.reset(),this._keyEvent3d.keyCode=e.keyCode,this._keyEvent3d.ctrlKey=e.ctrlKey,this._keyEvent3d.altKey=e.altKey,this._keyEvent3d.shiftKey=e.shiftKey,this._keyStatus[e.keyCode]||(this._keyStatus[e.keyCode]=!0,this._keyEvent3d.type=Ra.KEY_DOWN,this.dispatchEvent(this._keyEvent3d))}keyUp(e){this._keyEvent3d.reset(),this._keyEvent3d.keyCode=e.keyCode,this._keyStatus[e.keyCode]=!1,this._keyEvent3d.type=Ra.KEY_UP,this.dispatchEvent(this._keyEvent3d)}GetSlideAngle(e,t){return Math.atan2(t,e)*180/Math.PI}GetSlideDirection(e,t,a,r){var i=t-r,n=a-e,o=0;if(Math.abs(n)<2&&Math.abs(i)<2)return o;var l=this.GetSlideAngle(n,i);return l>=-45&&l<45?o=4:l>=45&&l<135?o=1:l>=-135&&l<-45?o=2:(l>=135&&l<=180||l>=-180&&l<-135)&&(o=3),o}}class nr extends bt{static RESIZE="resize"}class Ho extends Ja{adapter;device;context;aspect;presentationSize=[0,0];presentationFormat;canvas;windowWidth;windowHeight;canvasConfig;_pixelRatio=1;_resizeEvent;get pixelRatio(){return this._pixelRatio}async init(e){if(this.canvasConfig=e,e&&e.canvas){if(this.canvas=e.canvas,this.canvas===null)throw new Error("no Canvas");this.canvas.style.width||(this.canvas.style.width=this.canvas.width+"px"),this.canvas.style.height||(this.canvas.style.height=this.canvas.height+"px")}else this.canvas=document.createElement("canvas"),this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.zIndex=e?.zIndex?e.zIndex.toString():"0",document.body.appendChild(this.canvas);if(e&&e.backgroundImage?(this.canvas.style.background=`url(${e.backgroundImage})`,this.canvas.style["background-size"]="cover",this.canvas.style["background-position"]="center"):this.canvas.style.background="transparent",this.canvas.style["touch-action"]="none",this.canvas.style["object-fit"]="cover",navigator.gpu===void 0)throw new Error("Your browser does not support WebGPU!");if(this.adapter=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),this.adapter==null)throw new Error("Your browser does not support WebGPU!");if(this.device=await this.adapter.requestDevice({requiredFeatures:["bgra8unorm-storage","depth-clip-control","depth32float-stencil8","indirect-first-instance","rg11b10ufloat-renderable"],requiredLimits:{minUniformBufferOffsetAlignment:256,maxStorageBufferBindingSize:this.adapter.limits.maxStorageBufferBindingSize}}),this.device==null)throw new Error("Your browser does not support WebGPU!");return this._pixelRatio=this.canvasConfig?.devicePixelRatio||window.devicePixelRatio||1,this._pixelRatio=Math.min(this._pixelRatio,2),this.device.label="device",this.presentationFormat=navigator.gpu.getPreferredCanvasFormat(),this.context=this.canvas.getContext("webgpu"),this.context.configure({device:this.device,format:this.presentationFormat,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT,alphaMode:"premultiplied",colorSpace:"srgb"}),this._resizeEvent=new nr(nr.RESIZE,{width:this.windowWidth,height:this.windowHeight}),new ResizeObserver(()=>{this.updateSize(),ft.destroyTexture()}).observe(this.canvas),this.updateSize(),!0}updateSize(){let e=Math.floor(this.canvas.clientWidth*this.pixelRatio),t=Math.floor(this.canvas.clientHeight*this.pixelRatio);(e!=this.windowWidth||t!=this.windowHeight)&&(this.canvas.width=this.windowWidth=e,this.canvas.height=this.windowHeight=t,this.presentationSize[0]=this.windowWidth,this.presentationSize[1]=this.windowHeight,this.aspect=this.windowWidth/this.windowHeight,this._resizeEvent.data.width=this.windowWidth,this._resizeEvent.data.height=this.windowHeight,this.dispatchEvent(this._resizeEvent))}}let w=new Ho;var Qe=(s=>(s[s.Default=1]="Default",s[s.IgnoreDepthPass=2]="IgnoreDepthPass",s[s.Sky=6]="Sky",s[s.Particle=10]="Particle",s[s.SkinnedMesh=16]="SkinnedMesh",s[s.MorphTarget=32]="MorphTarget",s[s.Terrain=64]="Terrain",s[s.UI=128]="UI",s[s.Reflection=256]="Reflection",s[s.ReflectionDebug=512]="ReflectionDebug",s[s.Graphic3D=1024]="Graphic3D",s))(Qe||{});class aa{static addMask(e,t){return e|t}static removeMask(e,t){return e&~t}static hasMask(e,t){return(e&t)==t}}class de{static HELP_0=new de;static HELP_1=new de;static HELP_2=new de;static ZERO=new de(0,0);static SAFE_MAX=new de(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);static SAFE_MIN=new de(Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);x=0;y=0;constructor(e=0,t=0){this.x=e,this.y=t}static getAngle(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}static slerp(e,t,a){let r=new de,i=e.dot(t);if(i<0&&(t.x=-t.x,t.y=-t.y,i=-i),i>.9995)return r.x=e.x+a*(t.x-e.x),r.y=e.y+a*(t.y-e.y),r;let n=Math.acos(i),o=Math.sin(n),l=Math.sin((1-a)*n)/o,c=Math.sin(a*n)/o;return r.x=l*e.x+c*t.x,r.y=l*e.y+c*t.y,r}static lerp(e,t,a){return de.HELP_0.copyFrom(e),de.HELP_1.copyFrom(t),de.HELP_0.scale(a),de.HELP_1.scale(1-a),new de(de.HELP_0.x+de.HELP_1.x,de.HELP_0.y+de.HELP_1.y)}set(e=0,t=0){return this.x=e,this.y=t,this}distance(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}add(e,t){return t=t||new de,t.x=this.x+e.x,t.y=this.y+e.y,t}sub(e,t){return t=t||new de,t.x=this.x-e.x,t.y=this.y-e.y,t}scale(e){return this.x=this.x*e,this.y=this.y*e,this}multiply(e,t){return t=t||new de,t.x=this.x*e,t.y=this.y*e,t}multiplyScaler(e){return this.x*=e,this.y*=e,this}divide(e,t){return t=t||new de,t.x=this.x/e,t.y=this.y/e,t}neg(e){return e||(e=new de),e.x=-e.x,e.y=-e.y,e}abs(){return Math.sqrt(this.x*this.x+this.y*this.y)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}getAngle(e){return Math.atan2(e.y-this.y,e.x-this.x)}unt(e){e=e||new de;let t=this.abs();return e.x=this.x/t,e.y=this.y/t,e}angleTo(e){let t=e.x-this.x,a=e.y-this.y;return Math.atan2(a,t)}equals(e){return Math.abs(this.x-e.x)<1e-6&&Math.abs(this.y-e.y)<1e-6}pal(e){let t=this.unt(),a=e.unt();return t.equals(a)?1:t.equals(a.neg())?-1:0}clone(){return new de(this.x,this.y)}copyFrom(e){return this.x=e.x,this.y=e.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}dot(e){return this.x*e.x+this.y*e.y}normalize(){let e=this.abs();return this.x=this.x/e,this.y=this.y/e,this}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}}class he{static X_AXIS=new he(1,0,0);static Y_AXIS=new he(0,1,0);static Z_AXIS=new he(0,0,1);static HELP_0=new he;static HELP_1=new he;static HELP_2=new he;static EPSILON=1e-5;static HELP_3=new he;static HELP_4=new he;static HELP_5=new he;static HELP_6=new he;static ZERO=new he;static ONE=new he(1,1,1,1);static LEFT=new he(-1,0,0);static RIGHT=new he(1,0,0);static UP=new he(0,-1,0);static DOWN=new he(0,1,0);static BACK=new he(0,0,-1);static FORWARD=new he(0,0,1);x=0;y=0;z=0;w=1;constructor(e=0,t=0,a=0,r=0){this.x=e,this.y=t,this.z=a,this.w=r}get width(){return this.z}get height(){return this.w}static crossVectors(e,t,a){a=a||new he;var r=e.x,i=e.y,n=e.z,o=t.x,l=t.y,c=t.z;return a.x=i*c-n*l,a.y=n*o-r*c,a.z=r*l-i*o,a}static distance(e,t){let a=e.x-t.x,r=e.y-t.y,i=e.z-t.z,n=e.w-t.w;return Math.sqrt(a*a+r*r+i*i+n*n)}set(e,t,a,r){return this.x=e,this.y=t,this.z=a,this.w=r,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}clone(){return new he(this.x,this.y,this.z,this.w)}}function Zn(s,e){let t=s.__NonSerialize__;t||(t=s.__NonSerialize__={},t.__NonSerialize__=!0),t[e]=!0}function Yn(s,e){let t;for(;s&&(s=s.__proto__,s&&(t=s.__NonSerialize__),!t););return t&&t[e]}function jr(s,e,t,a,r){let i=s.__EditorInspector__;i||(i=s.__EditorInspector__=new Map);let n=i.get(s.constructor.name);n||(n=new Map,i.set(s.constructor.name,n)),n.set(e,{p1:t,p2:a,p3:r})}function cu(s){let e,t=s,a=[];for(;t;){if(a.indexOf(t.constructor.name)!=-1){t=t.__proto__;continue}a.push(t.constructor.name),t=t.__proto__}for(a=a.reverse(),t=s;t&&(t=t.__proto__,t&&(e=t.__EditorInspector__),!e););let r=new Map;if(e)for(let i=0;i<a.length;i++){const n=a[i];let o=e.get(n);o&&o.forEach((l,c)=>{r.set(c,l)})}return r}function Lt(s,e,t,a,r){let i=window.__Component__;i||(i=window.__Component__={}),i[e]=s}function Ko(s){let e=window.__Component__;return e[s]?e[s]:null}function Ia(s,e,t,a,r){let i=window.__shader__;i||(i=window.__shader__={}),i[e]=s}function qo(s){let e=window.__shader__;return e[s]?e[s]:null}var fu=Object.defineProperty,$o=(s,e,t,a)=>{for(var r=void 0,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(e,t,r)||r);return r&&fu(e,t,r),r};const Xn=class an{__refection;__size=0;getValueType(){if(!this.__refection){let e=this;this.__refection=[];for(const t in e)if(!Yn(this,t)){const a=e[t];let r={name:t,type:a.constructor.name};this.__refection.push(r)}}return this.__refection}static getValueSize(e){switch(e.constructor.name){case"Boolean":return 4;case"Number":return 4;case"f32":return 4;case"i32":return 4;case"u32":return 4;case"Float32Array":return e.byteLength;case"Vector2":return 8;case"Vector3":return 12;case"Vector4":return 16;case"Color":return 16;case"Array":let a=0;for(let r=0,i=e.length;r<i;r++)a+=an.getValueSize(e[r]);return a}return 0}static __cacheStruct=new Map;static Ref(e){return this.Get(e).getValueType()}static Get(e){let t=an.__cacheStruct.get(e.prototype);return t||(t=new e,an.__cacheStruct.set(e.prototype,t)),t}static GetSize(e){let t=this.Get(e);if(t.__size==0){for(const a in t)if(!Yn(t,a)){const r=t[a];t.__size+=an.getValueSize(r)}t.__size>4&&(t.__size=Math.ceil(t.__size/4)*4)}return t.__size}};$o([Zn],Xn.prototype,"__refection"),$o([Zn],Xn.prototype,"__size");let gi=Xn;class el{byteOffset;byteSize;offset=0;dataBytes;get x(){return this.dataBytes.getFloat32(0*Float32Array.BYTES_PER_ELEMENT,!0)}set x(e){this.dataBytes.setFloat32(0*Float32Array.BYTES_PER_ELEMENT,e,!0)}get y(){return this.dataBytes.getFloat32(1*Float32Array.BYTES_PER_ELEMENT,!0)}set y(e){this.dataBytes.setFloat32(1*Float32Array.BYTES_PER_ELEMENT,e,!0)}get z(){return this.dataBytes.getFloat32(2*Float32Array.BYTES_PER_ELEMENT,!0)}set z(e){this.dataBytes.setFloat32(2*Float32Array.BYTES_PER_ELEMENT,e,!0)}get w(){return this.dataBytes.getFloat32(3*Float32Array.BYTES_PER_ELEMENT,!0)}set w(e){this.dataBytes.setFloat32(3*Float32Array.BYTES_PER_ELEMENT,e,!0)}setX(e){this.x=e}setXY(e,t){this.x=e,this.y=t}setXYZ(e,t,a){this.x=e,this.y=t,this.z=a}setXYZW(e,t,a,r){this.x=e,this.y=t,this.z=a,this.w=r}setVector2Array(e){for(let t=0;t<e.length;t++){const a=e[t];this.dataBytes.setFloat32((t*2+0)*Float32Array.BYTES_PER_ELEMENT,a.x,!0),this.dataBytes.setFloat32((t*2+1)*Float32Array.BYTES_PER_ELEMENT,a.y,!0)}}setVector3Array(e){for(let t=0;t<e.length;t++){const a=e[t];this.dataBytes.setFloat32((t*3+0)*Float32Array.BYTES_PER_ELEMENT,a.x,!0),this.dataBytes.setFloat32((t*3+1)*Float32Array.BYTES_PER_ELEMENT,a.y,!0),this.dataBytes.setFloat32((t*3+2)*Float32Array.BYTES_PER_ELEMENT,a.z,!0)}}setVector4Array(e){for(let t=0;t<e.length;t++){const a=e[t];this.dataBytes.setFloat32((t*4+0)*Float32Array.BYTES_PER_ELEMENT,a.x,!0),this.dataBytes.setFloat32((t*4+1)*Float32Array.BYTES_PER_ELEMENT,a.y,!0),this.dataBytes.setFloat32((t*4+2)*Float32Array.BYTES_PER_ELEMENT,a.z,!0),this.dataBytes.setFloat32((t*4+3)*Float32Array.BYTES_PER_ELEMENT,a.w,!0)}}setColorArray(e){for(let t=0;t<e.length;t++){const a=e[t];this.dataBytes.setFloat32((t*4+0)*Float32Array.BYTES_PER_ELEMENT,a.r,!0),this.dataBytes.setFloat32((t*4+1)*Float32Array.BYTES_PER_ELEMENT,a.g,!0),this.dataBytes.setFloat32((t*4+2)*Float32Array.BYTES_PER_ELEMENT,a.b,!0),this.dataBytes.setFloat32((t*4+3)*Float32Array.BYTES_PER_ELEMENT,a.a,!0)}}setInt8(e,t=0){this.dataBytes.setInt8(t*Int8Array.BYTES_PER_ELEMENT,e)}getInt8(e=0){return this.dataBytes.getInt8(e*Int8Array.BYTES_PER_ELEMENT)}setInt16(e,t=0){this.dataBytes.setInt16(t*Int16Array.BYTES_PER_ELEMENT,e,!0)}getInt16(e=0){return this.dataBytes.getInt16(e*Int16Array.BYTES_PER_ELEMENT,!0)}setInt32(e,t=0){this.dataBytes.setInt32(t*Int32Array.BYTES_PER_ELEMENT,e,!0)}getInt32(e=0){return this.dataBytes.getInt32(e*Int32Array.BYTES_PER_ELEMENT,!0)}setFloat(e,t=0){this.dataBytes.setFloat32(t*Float32Array.BYTES_PER_ELEMENT,e,!0)}getFloat(e=0){return this.dataBytes.getFloat32(e*Float32Array.BYTES_PER_ELEMENT,!0)}setUint8(e,t=0){this.dataBytes.setUint8(t*Uint8Array.BYTES_PER_ELEMENT,e)}getUint8(e=0){return this.dataBytes.getUint8(e*Uint8Array.BYTES_PER_ELEMENT)}setUint16(e,t=0){this.dataBytes.setUint16(t*Uint16Array.BYTES_PER_ELEMENT,e,!0)}getUint16(e=0){return this.dataBytes.getUint16(e*Uint16Array.BYTES_PER_ELEMENT,!0)}setUint32(e,t=0){this.dataBytes.setUint32(t*Uint32Array.BYTES_PER_ELEMENT,e,!0)}getUint32(e=0){return this.dataBytes.getUint32(e*Uint32Array.BYTES_PER_ELEMENT,!0)}setArray(e,t){for(let a=0;a<t.length;a++){const r=t[a];this.dataBytes.setFloat32((e+a)*Float32Array.BYTES_PER_ELEMENT,r,!0)}}setFloat32Array(e,t){new Float32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Float32Array.BYTES_PER_ELEMENT,t.length).set(t)}setFloatArray(e,t){let a;t instanceof Float32Array?a=t:a=new Float32Array(t),new Float32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Float32Array.BYTES_PER_ELEMENT,a.length).set(a)}setArrayBuffer(e,t){t instanceof Uint8Array?this.setUint8Array(e,t):t instanceof Uint16Array?this.setUint16Array(e,t):t instanceof Uint32Array?this.setUint32Array(e,t):t instanceof Int8Array?this.setInt8Array(e,t):t instanceof Int16Array?this.setInt16Array(e,t):t instanceof Int32Array?this.setInt32Array(e,t):t instanceof Float32Array&&this.setFloat32Array(e,t)}setInt8Array(e,t){new Int8Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Int8Array.BYTES_PER_ELEMENT).set(t)}setInt16Array(e,t){new Int16Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Int16Array.BYTES_PER_ELEMENT).set(t)}setInt32Array(e,t){new Int32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Int32Array.BYTES_PER_ELEMENT).set(t)}setUint8Array(e,t){new Uint8Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Uint8Array.BYTES_PER_ELEMENT).set(t)}setUint16Array(e,t){new Uint16Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Uint16Array.BYTES_PER_ELEMENT).set(t)}setUint32Array(e,t){new Uint32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Uint32Array.BYTES_PER_ELEMENT).set(t)}setData(e,t){this.dataBytes.setFloat32(e*Float32Array.BYTES_PER_ELEMENT,t,!0)}setVector2(e,t){this.dataBytes.setFloat32(e*Float32Array.BYTES_PER_ELEMENT,t.x,!0),this.dataBytes.setFloat32((e+1)*Float32Array.BYTES_PER_ELEMENT,t.y,!0)}setVector3(e,t){this.dataBytes.setFloat32(e*Float32Array.BYTES_PER_ELEMENT,t.x,!0),this.dataBytes.setFloat32((e+1)*Float32Array.BYTES_PER_ELEMENT,t.y,!0),this.dataBytes.setFloat32((e+2)*Float32Array.BYTES_PER_ELEMENT,t.z,!0)}setVector4(e,t){this.dataBytes.setFloat32(e*Float32Array.BYTES_PER_ELEMENT,t.x,!0),this.dataBytes.setFloat32((e+1)*Float32Array.BYTES_PER_ELEMENT,t.y,!0),this.dataBytes.setFloat32((e+2)*Float32Array.BYTES_PER_ELEMENT,t.z,!0),this.dataBytes.setFloat32((e+3)*Float32Array.BYTES_PER_ELEMENT,t.w,!0)}setColor(e,t){this.dataBytes.setFloat32(e*Float32Array.BYTES_PER_ELEMENT,t.r,!0),this.dataBytes.setFloat32((e+1)*Float32Array.BYTES_PER_ELEMENT,t.g,!0),this.dataBytes.setFloat32((e+2)*Float32Array.BYTES_PER_ELEMENT,t.b,!0),this.dataBytes.setFloat32((e+3)*Float32Array.BYTES_PER_ELEMENT,t.a,!0)}getData(e){return this.dataBytes.getFloat32(e*Float32Array.BYTES_PER_ELEMENT,!0)}writeFloat(e){this.dataBytes.setFloat32(this.offset,e,!0),this.offset+=Float32Array.BYTES_PER_ELEMENT}writeInt8(e){this.dataBytes.setInt8(this.offset,e),this.offset+=Int8Array.BYTES_PER_ELEMENT}writeInt16(e){this.dataBytes.setInt16(this.offset,e,!0),this.offset+=Int16Array.BYTES_PER_ELEMENT}writeInt32(e){this.dataBytes.setInt32(this.offset,e,!0),this.offset+=Int32Array.BYTES_PER_ELEMENT}writeUint8(e){this.dataBytes.setUint8(this.offset,e),this.offset+=Uint8Array.BYTES_PER_ELEMENT}writeUint16(e){this.dataBytes.setUint16(this.offset,e,!0),this.offset+=Uint16Array.BYTES_PER_ELEMENT}writeUint32(e){this.dataBytes.setUint32(this.offset,e,!0),this.offset+=Uint32Array.BYTES_PER_ELEMENT}writeVector2(e){this.writeFloat(e.x),this.writeFloat(e.y)}writeVector3(e){this.writeFloat(e.x),this.writeFloat(e.y),this.writeFloat(e.z)}writeVector4(e){this.writeFloat(e.x),this.writeFloat(e.y),this.writeFloat(e.z),this.writeFloat(e.w)}writeRGBColor(e){this.writeFloat(e.r),this.writeFloat(e.g),this.writeFloat(e.b)}writeArray(e){for(let t=0;t<e.length;t++){const a=e[t];this.writeFloat(a)}}writeFloat32Array(e){new Float32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeInt8Array(e){new Int8Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeInt16Array(e){new Int16Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeInt32Array(e){new Int32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeUint8Array(e){new Uint8Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeUint16Array(e){new Uint16Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeUint32Array(e){new Uint32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}reset(){this.offset=0}destroy(){this.byteOffset=null,this.byteSize=null,this.offset=null,this.dataBytes=null}}class sr{shareDataBuffer;_byteOffset=0;allocation(e){this.shareDataBuffer&&this.shareDataBuffer.byteLength<e?this._byteOffset=0:this.shareDataBuffer=new ArrayBuffer(e)}allocation_node(e){if(this._byteOffset+e>this.shareDataBuffer.byteLength)return console.error("memory not enough!",this._byteOffset,e,this.shareDataBuffer.byteLength),null;let t=new el;return t.byteOffset=this._byteOffset,t.byteSize=e,t.dataBytes=new DataView(this.shareDataBuffer,this._byteOffset,t.byteSize),this._byteOffset+=t.byteSize,t}allocation_memory(e){return this._byteOffset+e.byteSize>this.shareDataBuffer.byteLength?(console.error("memory not enough!",this._byteOffset,e.byteSize,this.shareDataBuffer.byteLength),null):(e.byteOffset=this._byteOffset,e.dataBytes=new DataView(this.shareDataBuffer,this._byteOffset,e.byteSize),this._byteOffset+=e.byteSize,e)}reset(){this._byteOffset=0}destroy(e){this.shareDataBuffer=null,this._byteOffset=0}}class ja{bufferType;buffer;memory;memoryNodes;seek;outFloat32Array;byteSize;usage;visibility=GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE;mapAsyncBuffersOutstanding=0;mapAsyncReady;_readBuffer;_dataView;constructor(){this.mapAsyncReady=[]}debug(){}reset(e=!1,t=0,a){this.seek=0,this.memory.reset(),e&&this.createBuffer(this.usage,t,a)}setBoolean(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(4),this.memoryNodes.set(e,a)),a.setX(t?1:0)}readBoole(e){let t=this.memoryNodes.get(e);return t?t.getFloat()!=0:null}setFloat(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(4),this.memoryNodes.set(e,a)),a.setX(t)}getFloat(e){let t=this.memoryNodes.get(e);return t?t.getFloat():null}setInt8(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(1),this.memoryNodes.set(e,a)),a.setInt8(t)}getInt8(e){let t=this.memoryNodes.get(e);return t?t.getInt8():null}setInt16(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(2),this.memoryNodes.set(e,a)),a.setInt16(t)}getInt16(e){let t=this.memoryNodes.get(e);return t?t.getInt16():null}setInt32(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(4),this.memoryNodes.set(e,a)),a.setInt32(t)}getInt32(e){let t=this.memoryNodes.get(e);return t?t.getInt32():null}setUint8(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(1),this.memoryNodes.set(e,a)),a.setUint8(t)}getUint8(e){let t=this.memoryNodes.get(e);return t?t.getUint8():null}setUint16(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(2),this.memoryNodes.set(e,a)),a.setUint16(t)}getUint16(e){let t=this.memoryNodes.get(e);return t?t.getUint16():null}setUint32(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(4),this.memoryNodes.set(e,a)),a.setUint32(t)}getUint32(e){let t=this.memoryNodes.get(e);return t?t.getUint32():null}setVector2(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(8),this.memoryNodes.set(e,a)),a.setXY(t.x,t.y)}getVector2(e){let t=this.memoryNodes.get(e);return t?new de(t.x,t.y):null}setVector3(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(12),this.memoryNodes.set(e,a)),a.setXYZ(t.x,t.y,t.z)}getVector3(e){let t=this.memoryNodes.get(e);return t?new b(t.x,t.y,t.z):null}setVector4(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(16),this.memoryNodes.set(e,a)),a.setXYZW(t.x,t.y,t.z,t.w)}getVector4(e){let t=this.memoryNodes.get(e);return t?new he(t.x,t.y,t.z,t.w):null}setVector4Array(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(16*t.length),this.memoryNodes.set(e,a)),a.setVector4Array(t)}setColor(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(16),this.memoryNodes.set(e,a)),a.setXYZW(t.r,t.g,t.b,t.a)}getColor(e){let t=this.memoryNodes.get(e);return t?new J(t.x,t.y,t.z,t.w):null}setColorArray(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(16*t.length),this.memoryNodes.set(e,a)),a.setColorArray(t)}setMatrix(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(64),this.memoryNodes.set(e,a)),a.setFloatArray(0,t.rawData)}setMatrixArray(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(64*t.length),this.memoryNodes.set(e,a));for(let r=0;r<t.length;r++){const i=t[r];a.setFloatArray(r*16,i.rawData)}}setArray(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(t.length*4),this.memoryNodes.set(e,a)),a.setArray(0,t)}setFloat32Array(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(t.length*4),this.memoryNodes.set(e,a)),a.setFloat32Array(0,t)}setInt32Array(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(t.length*4),this.memoryNodes.set(e,a)),a.setInt32Array(0,t)}setUint32Array(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(t.length*4),this.memoryNodes.set(e,a)),a.setUint32Array(0,t)}setStruct(e,t,a,r){let i=gi.Ref(e);gi.GetSize(e);let n=t,o=this.memoryNodes.get(n);o.reset();let l=a;r&&(l=l[r]);for(let c=0;c<i.length;c++){const f=i[c];let h=l[f.name];this.writeValue(o,f,h)}}writeValue(e,t,a){switch(t.type){case"Boolean":e.writeFloat(a);break;case"Number":e.writeFloat(a);break;case"Float32Array":e.writeFloat32Array(a);break;case"Float64Array":e.writeFloat32Array(new Float32Array(a));break;case"Vector2":e.writeVector2(a);break;case"Vector3":e.writeVector3(a);break;case"Vector4":e.writeVector4(a);break;case"Color":e.writeRGBColor(a);break;case"Array":e.writeArray(a);break}}setStructArray(e,t,a){let r=t.length;for(let i=0;i<r;i++){const n=t[i];this.setStruct(e,i,n,a)}}clean(){this._dataView.fill(0,0,this._dataView.length)}apply(){w.device.queue.writeBuffer(this.buffer,0,this.memory.shareDataBuffer)}mapAsyncWrite(e,t){let a;e instanceof Float64Array?a=new Float32Array(e):a=e;let r=w.device;if(a.length>0){let i=null;for(;this.mapAsyncReady.length&&(i=this.mapAsyncReady.shift(),i.usedSize!=a.byteLength);)i.destroy(),this.mapAsyncBuffersOutstanding--,i=null;i||(i=r.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.MAP_WRITE,mappedAtCreation:!0}),i.usedSize=a.byteLength,this.mapAsyncBuffersOutstanding++,this.mapAsyncBuffersOutstanding>20&&console.warn(` Warning: mapAsync requests from ${this.mapAsyncBuffersOutstanding} frames ago have not resolved yet. MB of staging buffers allocated.`));let n=new Float32Array(a.buffer,a.byteOffset,t);new Float32Array(i.getMappedRange(0,t*4)).set(n),i.unmap();const l=r.createCommandEncoder();l.copyBufferToBuffer(i,0,this.buffer,0,t*4),r.queue.submit([l.finish()]),i.mapAsync(GPUMapMode.WRITE).then(()=>this.mapAsyncReady.push(i))}}destroy(e){this.memoryNodes&&this.memoryNodes.forEach(t=>{t.destroy()}),this.bufferType=null,this.seek=null,this.byteSize=null,this.usage=null,this.visibility=null,this.outFloat32Array=null,this.buffer&&this.buffer.destroy(),this.buffer=null,this.memory&&this.memory.destroy(),this.memory=null,this._readBuffer&&this._readBuffer.destroy()}createBuffer(e,t,a,r){let i=w.device;if(this.buffer&&this.destroy(),this.byteSize=t*4,this.usage=e,this.buffer=i.createBuffer({label:r,size:this.byteSize,usage:e,mappedAtCreation:!1}),this.memory=new sr,this.memoryNodes=new Map,this._dataView=new Float32Array(this.memory.shareDataBuffer),this.memory.allocation(this.byteSize),a){let n=this.memory.allocation_node(a.length*4);const o=a.buffer instanceof ArrayBuffer?a.buffer:new Uint8Array(a.buffer).buffer;n.setArrayBuffer(0,o),this.apply()}}resizeBuffer(e,t){this.createBuffer(this.usage,e,t)}createNewBuffer(e,t){let a=w.device,r=t*4,i=e;return this.buffer&&this.destroy(),a.createBuffer({size:r,usage:i,mappedAtCreation:!1})}createBufferByStruct(e,t,a){let r=gi.GetSize(t),i=r*a,n=w.device;this.buffer=n.createBuffer({label:"StructStorageGPUBuffer",size:i,usage:e,mappedAtCreation:!1}),this.memory=new sr,this.memoryNodes=new Map,this._dataView=new Float32Array(this.memory.shareDataBuffer),this.memory.allocation(i);for(let o=0;o<a;o++){let l=o,c=this.memoryNodes.get(l);c||(c=this.memory.allocation_node(r),this.memoryNodes.set(l,c))}}readBuffer(e=!1){this.outFloat32Array||=new Float32Array(this.memory.shareDataBuffer.byteLength/4),this._readBuffer||(this._readBuffer=w.device.createBuffer({size:this.memory.shareDataBuffer.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ,mappedAtCreation:!1}));let t=this.read();return e?t:this.outFloat32Array}_readFlag=!1;async read(){if(!this._readFlag){this._readFlag=!0;let e=w.device.createCommandEncoder();e.copyBufferToBuffer(this.buffer,0,this._readBuffer,0,this.memory.shareDataBuffer.byteLength),w.device.queue.submit([e.finish()]),await this._readBuffer.mapAsync(GPUMapMode.READ);const t=this._readBuffer.getMappedRange();this.outFloat32Array.set(new Float32Array(t),0),this._readBuffer.unmap(),this._readFlag=!1}return this.outFloat32Array}}var ga=(s=>(s[s.IndicesGPUBuffer=0]="IndicesGPUBuffer",s[s.VertexGPUBuffer=1]="VertexGPUBuffer",s[s.UniformGPUBuffer=2]="UniformGPUBuffer",s[s.StorageGPUBuffer=3]="StorageGPUBuffer",s[s.ComputeGPUBuffer=4]="ComputeGPUBuffer",s[s.MaterialDataUniformGPUBuffer=5]="MaterialDataUniformGPUBuffer",s[s.StructStorageGPUBuffer=6]="StructStorageGPUBuffer",s))(ga||{});class Te extends ja{constructor(e,t=0,a){super(),this.bufferType=ga.StorageGPUBuffer,this.createBuffer(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|t,e,a,"StorageGPUBuffer")}}class yt extends ja{constructor(e,t){super(),this.bufferType=ga.UniformGPUBuffer,this.createBuffer(GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC,e,t,"UniformGPUBuffer")}genUniformNodes(){}}class Xt{static getMorphTargetShaderBinding(e,t){return`
|
|
1
|
+
(function(d,Yt){typeof exports=="object"&&typeof module<"u"?Yt(exports):typeof define=="function"&&define.amd?define(["exports"],Yt):(d=typeof globalThis<"u"?globalThis:d||self,Yt(d.rings={}))})(void 0,(function(d){"use strict";var Yt=typeof document<"u"?document.currentScript:null;class J{static COLOR_RED=new J(1,0,0,1);static COLOR_GREEN=new J(0,1,0,1);static COLOR_BLUE=new J(0,0,1,1);static COLOR_WHITE=new J(1,1,1,1);static COLOR_0=new J;static COLOR_1=new J;static COLOR_2=new J;static HEX_CHARACTERS="a-f\\d";static MATCH_3OR4_HEX=`#?[${J.HEX_CHARACTERS}]{3}[${J.HEX_CHARACTERS}]?`;static MATCH_6OR8_HEX=`#?[${J.HEX_CHARACTERS}]{6}([${J.HEX_CHARACTERS}]{2})?`;static NON_HEX_CHARS=new RegExp(`[^#${J.HEX_CHARACTERS}]`,"gi");static VALID_HEX_SIZE=new RegExp(`^${J.MATCH_3OR4_HEX}$|^${J.MATCH_6OR8_HEX}$`,"i");r=0;g=0;b=0;a=0;constructor(e=1,t=1,a=1,r=1){this.setTo(e,t,a,r)}convertToHDRRGB(){return this.r=this.r*Math.pow(2.4,this.a),this.g=this.g*Math.pow(2.4,this.a),this.b=this.b*Math.pow(2.4,this.a),this}unSerialized(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}hexToRGB(e){return this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}hexToRGBA(e){return this.a=(e>>24&255)/255,this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this}static random(e=1){let t=new J;return t.a=e,t.r=e*Math.random(),t.g=e*Math.random(),t.b=e*Math.random(),t}static randomRGB(e=.5,t=.5,a=.5,r=.5,i=.5,n=.5){let o=new J;return o.a=1,o.r=r+e*Math.random(),o.g=i+t*Math.random(),o.b=n+a*Math.random(),o}static randomGray(e=.5,t=.5){let a=Math.random()*t+e,r=new J;return r.a=1,r.r=a,r.g=a,r.b=a,r}setTo(e,t,a,r){this.r=Math.max(e,0),this.g=Math.max(t,0),this.b=Math.max(a,0),this.a=Math.max(r,0)}setHex(e){if(typeof e!="string"||J.NON_HEX_CHARS.test(e)||!J.VALID_HEX_SIZE.test(e))throw new TypeError("Expected a valid hex string");e=e.replace(/^#/,"");let t=1;e.length===8&&(t=Number.parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),e.length===4&&(t=Number.parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const a=Number.parseInt(e,16),r=a>>16,i=a>>8&255,n=a&255,o=t;this.a=o,this.r=r/255,this.g=i/255,this.b=n/255}getHex(){let e=a=>{a*=255;let r=a.toString(16);return r.length===1&&(r="0"+r),r};return e(this.r)+e(this.g)+e(this.b)+e(this.a)}get rgb(){return[this.r*255>>>0,this.g*255>>>0,this.b*255>>>0]}set rgb(e){this.setTo(e[0]/255,e[1]/255,e[2]/255,this.a)}get rgba(){return[this.r*255>>>0,this.g*255>>>0,this.b*255>>>0,this.a*255>>>0]}set rgba(e){this.setTo(e[0]/255,e[1]/255,e[2]/255,e[3]/255)}clone(){return new J().copyFrom(this)}copyFrom(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}copyFromArray(e,t=255){return this.r=e[0]/t,this.g=e[1]/t,this.b=e[2]/t,this.a=e[3]/t,this}copyFromVector(e){return this.r=e.x,this.g=e.y,this.b=e.z,this.a=e.w||1,this}static hexRGBColor(e,t=null){return t=t||new J,t.hexToRGB(e),t}static lerp(e,t,a,r){let i=r||new J;return i.r=(a.r-t.r)*e+t.r,i.g=(a.g-t.g)*e+t.g,i.b=(a.b-t.b)*e+t.b,i.a=(a.a-t.a)*e+t.a,i}static PRIMARY=4149685;static PRIMARYDARK=3162015;static ACCENT=16728193;static WHITE=16777215;static IVORY=16777200;static LIGHTYELLOW=16777184;static YELLOW=16776960;static SNOW=16775930;static FLORALWHITE=16775920;static LEMONCHIFFON=16775885;static CORNSILK=16775388;static SEASHELL=16774638;static LAVENDERBLUSH=16773365;static PAPAYAWHIP=16773077;static BLANCHEDALMOND=16772045;static MISTYROSE=16770273;static BISQUE=16770244;static MOCCASIN=16770229;static NAVAJOWHITE=16768685;static PEACHPUFF=16767673;static GOLD=16766720;static PINK=16761035;static LIGHTPINK=16758465;static ORANGE=16753920;static LIGHTSALMON=16752762;static DARKORANGE=16747520;static CORAL=16744272;static HOTPINK=16738740;static TOMATO=16737095;static ORANGERED=16729344;static DEEPPINK=16716947;static FUCHSIA=16711935;static MAGENTA=16711935;static RED=16711680;static OLDLACE=16643558;static LIGHTGOLDENRODYELLOW=16448210;static LINEN=16445670;static ANTIQUEWHITE=16444375;static SALMON=16416882;static GHOSTWHITE=16316671;static MINTCREAM=16121850;static WHITESMOKE=16119285;static BEIGE=16119260;static WHEAT=16113331;static SANDYBROWN=16032864;static AZURE=15794175;static HONEYDEW=15794160;static ALICEBLUE=15792383;static KHAKI=15787660;static LIGHTCORAL=15761536;static PALEGOLDENROD=15657130;static VIOLET=15631086;static DARKSALMON=15308410;static LAVENDER=15132410;static LIGHTCYAN=14745599;static BURLYWOOD=14596231;static PLUM=14524637;static GAINSBORO=14474460;static CRIMSON=14423100;static PALEVIOLETRED=14381203;static GOLDENROD=14329120;static ORCHID=14315734;static THISTLE=14204888;static LIGHTGREY=13882323;static TAN=13808780;static CHOCOLATE=13789470;static PERU=13468991;static INDIANRED=13458524;static MEDIUMVIOLETRED=13047173;static SILVER=12632256;static DARKKHAKI=12433259;static ROSYBROWN=12357519;static MEDIUMORCHID=12211667;static DARKGOLDENROD=12092939;static FIREBRICK=11674146;static POWDERBLUE=11591910;static LIGHTSTEELBLUE=11584734;static PALETURQUOISE=11529966;static GREENYELLOW=11403055;static LIGHTBLUE=11393254;static DARKGRAY=11119017;static BROWN=10824234;static SIENNA=10506797;static DARKORCHID=10040012;static PALEGREEN=10025880;static DARKVIOLET=9699539;static MEDIUMPURPLE=9662683;static LIGHTGREEN=9498256;static DARKSEAGREEN=9419919;static SADDLEBROWN=9127187;static DARKMAGENTA=9109643;static DARKRED=9109504;static BLUEVIOLET=9055202;static LIGHTSKYBLUE=8900346;static SKYBLUE=8900331;static GRAY=8421504;static OLIVE=8421376;static PURPLE=8388736;static MAROON=8388608;static AQUAMARINE=8388564;static CHARTREUSE=8388352;static LAWNGREEN=8190976;static MEDIUMSLATEBLUE=8087790;static LIGHTSLATEGRAY=7833753;static SLATEGRAY=7372944;static OLIVEDRAB=7048739;static SLATEBLUE=6970061;static DIMGRAY=6908265;static MEDIUMAQUAMARINE=6737322;static CORNFLOWERBLUE=6591981;static CADETBLUE=6266528;static DARKOLIVEGREEN=5597999;static INDIGO=4915330;static MEDIUMTURQUOISE=4772300;static DARKSLATEBLUE=4734347;static STEELBLUE=4620980;static ROYALBLUE=4286945;static TURQUOISE=4251856;static MEDIUMSEAGREEN=3978097;static LIMEGREEN=3329330;static DARKSLATEGRAY=3100495;static SEAGREEN=3050327;static FORESTGREEN=2263842;static LIGHTSEAGREEN=2142890;static DODGERBLUE=2003199;static MIDNIGHTBLUE=1644912;static AQUA=65535;static CYAN=65535;static SPRINGGREEN=65407;static LIME=65280;static MEDIUMSPRINGGREEN=64154;static DARKTURQUOISE=52945;static DEEPSKYBLUE=49151;static DARKCYAN=35723;static TEAL=32896;static GREEN=32768;static DARKGREEN=25600;static BLUE=255;static MEDIUMBLUE=205;static DARKBLUE=139;static NAVY=128;static BLACK=0}class Le{static time=0;static frame=0;static delta=0;static _startTime=0;static _timeLabel="";static start(e){this._startTime=performance.now(),this._timeLabel=e}static end(){console.log(this._timeLabel,performance.now()-this._startTime)}}class bt{target;currentTarget;type;data;param;time=0;delay=0;mouseCode=0;ctrlKey;metaKey;altKey;shiftKey;targetTouches;changedTouches;touches;_stopImmediatePropagation=!1;view;constructor(e=null,t=null){this.type=e,this.data=t}stopImmediatePropagation(){this._stopImmediatePropagation=!0}reset(){this._stopImmediatePropagation=!1}get isStopImmediatePropagation(){return this._stopImmediatePropagation}}class rn{constructor(e=null,t=null,a=null,r=null,i=0){this.type=e,this.thisObject=t,this.handler=a,this.param=r,this.priority=i}static event_id_count=0;id=0;current;equalCurrentListener(e,t,a,r){return this.type==e&&this.thisObject==a&&this.handler==t&&this.param==r}dispose(){this.handler=null,this.thisObject=null,this.param=null,this.priority=0}}class Ja{listeners={};data;dispatchEvent(e){let t=this.listeners[e.type];if(t!=null){t=t.slice();for(let a=0;a<t.length;a++){let r=t[a];if(r.handler){try{e.param=r.param,e.currentTarget=r,r.thisObject,r.handler.call(r.thisObject,e)}catch{}if(e.isStopImmediatePropagation)break}}}}destroy(){for(let e in this.listeners){let t=this.listeners[e];for(;t.length>0;){let a=t[0];a.handler=null,a.thisObject=null,t.splice(0,1)}}}addEventListener(e,t,a,r=null,i=0){if(this.listeners[e]==null&&(this.listeners[e]=[]),!this.hasEventListener(e,t,a)){let n=new rn(e,a,t,r,i);return n.id=++rn.event_id_count,n.current=this,this.listeners[e].push(n),this.listeners[e].sort(function(o,l){return l.priority-o.priority}),n.id}for(let n=0;n<this.listeners[e].length;n++){let o=this.listeners[e][n];if(o.equalCurrentListener(e,t,a,r))return o.id}return 0}removeEventListener(e,t,a){if(this.hasEventListener(e,t,a))for(let r=0;r<this.listeners[e].length;r++){let i=this.listeners[e][r];if(i.equalCurrentListener(e,t,a,i.param)){i.handler=null,i.thisObject=null,this.listeners[e].splice(r,1);return}}}removeEventListenerAt(e){for(let t in this.listeners)for(let a=0;a<this.listeners[t].length;a++){let r=this.listeners[t][a];if(r.id==e)return r.handler=null,r.thisObject=null,this.listeners[t].splice(a,1),!0}return!1}removeAllEventListener(e=null){let t;if(e){if(this.listeners[e]){for(let a=0;a<this.listeners[e].length;a++)t=this.listeners[e][a],t.dispose(),this.listeners[e].splice(a,1);delete this.listeners[e]}}else for(let a in this.listeners){for(let r=0;r<this.listeners[a].length;r++)t=this.listeners[a][r],t.dispose(),this.listeners[a].splice(r,1);delete this.listeners[a]}}containEventListener(e){return this.listeners[e]==null?!1:this.listeners[e].length>0}hasEventListener(e,t=null,a=null){if(this.listeners[e]==null)return!1;if(a&&t)for(let r=0;r<this.listeners[e].length;r++){let i=this.listeners[e][r];if(i.equalCurrentListener(e,t,a,i.param))return!0}return!1}}class wa extends bt{static KEY_DOWN="onKeyDown";static KEY_UP="onKeyUp";keyCode=0}class j extends bt{static PICK_OVER="onPickOver";static PICK_CLICK="onPickClick";static PICK_OUT="onPickOut";static PICK_MOVE="onPickMove";static PICK_UP="onPickUp";static PICK_DOWN="onPickDown";static POINTER_RIGHT_CLICK="onPointerRightClick";static POINTER_MID_UP="onPointerMidUp";static POINTER_MID_DOWN="onPointerMidDown";static POINTER_CLICK="onPointerClick";static POINTER_MOVE="onPointerMove";static POINTER_DOWN="onPointerDown";static POINTER_UP="onPointerUp";static POINTER_OUT="onPointerOut";static POINTER_OVER="onPointerOver";static POINTER_WHEEL="onPointerWheel";pointerId;pointerType="onPointer";isPrimary;pressure;mouseX;mouseY;movementX;movementY;deltaX;deltaY;deltaZ;reset(){super.reset(),this.mouseX=0,this.mouseY=0,this.movementX=0,this.movementY=0,this.deltaX=0,this.deltaY=0,this.deltaZ=0}}class Ut extends bt{static PICK_OVER_GUI="onPickOverGUI";static PICK_CLICK_GUI="onPickClickGUI";static PICK_OUT_GUI="onPickOutGUI";static PICK_UP_GUI="onPickUpGUI";static PICK_DOWN_GUI="onPickDownGUI";pointerId;pointerType="onPickGUI";isPrimary;pressure;mouseX;mouseY;movementX;movementY;deltaX;deltaY;deltaZ;reset(){super.reset(),this.mouseX=0,this.mouseY=0,this.movementX=0,this.movementY=0,this.deltaX=0,this.deltaY=0,this.deltaZ=0}}class b{static MAX=new b(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);static MIN=new b(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE);static SAFE_MAX=new b(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);static SAFE_MIN=new b(Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);static X_AXIS=new b(1,0,0);static neg_X_AXIS=new b(-1,0,0);static Y_AXIS=new b(0,1,0);static Z_AXIS=new b(0,0,1);static HELP_0=new b;static HELP_1=new b;static HELP_2=new b;static EPSILON=1e-5;static HELP_3=new b;static HELP_4=new b;static HELP_5=new b;static HELP_6=new b;static get ZERO(){return new b(0,0,0)}static get ONE(){return new b(1,1,1)}static get LEFT(){return new b(-1,0,0)}static get RIGHT(){return new b(1,0,0)}static get UP(){return new b(0,1,0)}static get DOWN(){return new b(0,-1,0)}static get BACK(){return new b(0,0,-1)}static get FORWARD(){return new b(0,0,1)}x=0;y=0;z=0;w=1;index=0;static _index=0;constructor(e=0,t=0,a=0,r=0){this.set(e,t,a,r),this.index=b._index++}set a(e){this.w=e}set r(e){this.x=e}set g(e){this.y=e}set b(e){this.z=e}get a(){return this.w}get r(){return this.x}get g(){return this.y}get b(){return this.z}get length(){return Math.sqrt(this.lengthSquared)}get lengthSquared(){return this.x*this.x+this.y*this.y+this.z*this.z}get position(){return this}static getTowPointbyDir(e,t,a,r,i){i==b.Z_AXIS?(t.x=e.y,t.y=-e.x,a.x=-e.y,a.y=e.x,t.scaleBy(r*.5),a.scaleBy(r*.5)):i==b.Y_AXIS&&(t.x=e.z,t.z=-e.x,a.x=-e.z,a.z=e.x,t.scaleBy(r*.5),a.scaleBy(r*.5))}static pointToLine(e,t,a){let r=0,i,n,o;if(i=b.distance(e,t),n=b.distance(e,a),o=b.distance(t,a),o<=1e-6||n<=1e-6)return r=0,r;if(i<=1e-6||o*o>=i*i+n*n)return r=n,r;if(n*n>=i*i+o*o)return r=o,r;let l=(i+n+o)/2;return r=2*Math.sqrt(l*(l-i)*(l-n)*(l-o))/i,r}static dot(e,t){return e.x*t.x+e.y*t.y+e.z*t.z}static getPoints(e,t){let a=[];for(let r=0;r<e;r++){const i=new b(Math.random()*t-t*.5,Math.random()*t-t*.5,Math.random()*t-t*.5);a.push(i)}return a}static getPointNumbers(e,t){let a=[];for(let r=0;r<e;r++)a.push(Math.random()*t-t*.5,Math.random()*t-t*.5,Math.random()*t-t*.5);return a}static getAngle(e,t){let a=e.dotProduct(t)/(e.length*t.length);return Math.acos(a)*180/Math.PI}static sqrMagnitude(e){return e.x*e.x+e.y*e.y+e.z*e.z}static getZYAngle(e,t){return this.calAngle(e.y,e.z,t.y,t.z)}static sub(e,t,a=null){return a=a||new b,a.x=e.x-t.x,a.y=e.y-t.y,a.z=e.z-t.z,a}static add(e,t,a=null){return a=a||new b,a.x=e.x+t.x,a.y=e.y+t.y,a.z=e.z+t.z,a}static smoothDamp(e,t,a,r,i,n){return null}static distance(e,t){let a=e.x-t.x,r=e.y-t.y,i=e.z-t.z;return Math.sqrt(a*a+r*r+i*i)}static squareDistance(e,t){let a=e.x-t.x,r=e.y-t.y,i=e.z-t.z;return a*a+r*r+i*i}static distanceXZ(e,t){let a=e.x-t.x,r=0,i=e.z-t.z;return Math.sqrt(a*a+r*r+i*i)}set(e,t,a,r=1){return this.x=e,this.y=t,this.z=a,this.w=r,this}add(e,t=null){t||=new b;let a=this.x,r=this.y,i=this.z,n=this.w,o=e.x,l=e.y,c=e.z,f=e.w;return t.setTo(a+o,r+l,i+c,n+f),t}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}min(e,t=this){return t.x=Math.min(this.x,e.x),t.y=Math.min(this.y,e.y),t.z=Math.min(this.z,e.z),t}max(e,t=this){return t.x=Math.max(this.x,e.x),t.y=Math.max(this.y,e.y),t.z=Math.max(this.z,e.z),t}distanceToSquared(e){let t=this.x-e.x,a=this.y-e.y,r=this.z-e.z;return t*t+a*a+r*r}addXYZW(e,t,a,r,i=null){i||=new b;let n=this.x,o=this.y,l=this.z,c=this.w,f=e,h=t,u=a,g=r;return i.setTo(n+f,o+h,l+u,c+g),i}clone(){return new b(this.x,this.y,this.z,this.w)}copyFrom(e){let t=this;return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}decrementBy(e){this.x-=e.x,this.y-=e.y,this.z-=e.z}dotProduct(e){return this.x*e.x+this.y*e.y+this.z*e.z}equals(e,t=!1){return this.x==e.x&&this.y==e.y&&this.z==e.z&&(!t||this.w==e.w)}incrementBy(e){this.x+=e.x,this.y+=e.y,this.z+=e.z}divide(e){return e instanceof b?new b(this.x/e.x,this.y/e.y,this.z/e.z):(this.x=this.x/e,this.y=this.y/e,this.z=this.z/e,this)}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}normalize(e=1){let t=this;if(this.length!=0){let a=e/this.length;return this.x*=a,this.y*=a,this.z*=a,t}return t}applyQuaternion(e){const t=this.x,a=this.y,r=this.z,i=e.x,n=e.y,o=e.z,l=e.w,c=l*t+n*r-o*a,f=l*a+o*t-i*r,h=l*r+i*a-n*t,u=-i*t-n*a-o*r;return this.x=c*l+u*-i+f*-o-h*-n,this.y=f*l+u*-n+h*-i-c*-o,this.z=h*l+u*-o+c*-n-f*-i,this}applyMatrix4(e){return e.transformPoint(this,this)}scaleBy(e){return this.x*=e,this.y*=e,this.z*=e,this}mul(e){let t=new b;return t.x=this.x*e,t.y=this.y*e,t.z=this.z*e,t}scale(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}scaleToRef(e,t){return t||(t=new b),t.x=this.x*e,t.y=this.y*e,t.z=this.z*e,t}setTo(e,t,a,r=1){this.x=e,this.y=t,this.z=a,this.w=r}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}subtract(e,t=null){return t||(t=new b),t.setTo(this.x-e.x,this.y-e.y,this.z-e.z),t}multiply(e,t=null){t||(t=new b);let a=this.x,r=this.y,i=this.z,n=e.x,o=e.y,l=e.z;return t.setTo(a*n,r*o,i*l),t}divided(e,t=null){t||(t=new b);let a=this.x,r=this.y,i=this.z,n=e.x,o=e.y,l=e.z;return t.setTo(a/n,r/o,i/l),t}div(e,t){t||(t=new b);let a=this.x,r=this.y,i=this.z,n=this.w;return t.setTo(a/e,r/e,i/e,n/e),t}lerp(e,t,a){let r=e.x,i=e.y,n=e.z,o=e.w,l=t.x,c=t.y,f=t.z,h=t.w;this.x=(l-r)*a+r,this.y=(c-i)*a+i,this.z=(f-n)*a+n,this.w=(h-o)*a+o}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}toString(){return"<"+this.x+", "+this.y+", "+this.z+">"}normalizeToWay2D_XY(){let e=Math.abs(this.x),t=Math.abs(this.y);e>t?this.x>0?this.copyFrom(b.RIGHT):this.copyFrom(b.LEFT):this.y>0?this.copyFrom(b.DOWN):this.copyFrom(b.UP)}toArray(){return[this.x,this.y,this.z]}copyToBytes(e){e.setFloat32(0*Float32Array.BYTES_PER_ELEMENT,this.x,!0),e.setFloat32(1*Float32Array.BYTES_PER_ELEMENT,this.y,!0),e.setFloat32(2*Float32Array.BYTES_PER_ELEMENT,this.z,!0)}crossProduct(e,t=null){return t=t||new b,t.x=this.y*e.z-this.z*e.y,t.y=this.z*e.x-this.x*e.z,t.z=this.x*e.y-this.y*e.x,t.w=1,t}crossVectors(e,t){return e.crossProduct(t,this),this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}setFromArray(e,t=0){this.x=e[t],this.y=e[t+1],this.z=e[t+2]}divideScalar(e){return this.multiplyScalar(1/e)}clampLength(e,t){let a=this.length;return this.divideScalar(a||1).multiplyScalar(Math.max(e,Math.min(t,a)))}setScalar(e){return this.x=e,this.y=e,this.z=e,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}static calAngle(e,t,a,r){const i=o(a,r,e,t);let n=Math.acos(i)*180/Math.PI;return a<e&&(n=-n),n;function o(c,f,h,u){let g=[c-h,f-u];return l(g,[0,-1])}function l(c,f){let h=c[0]*f[0]+c[1]*f[1],u=Math.sqrt(c[0]*c[0]+c[1]*c[1])*Math.sqrt(f[0]*f[0]+f[1]*f[1]);return h/u}}static pointInsideTriangle(e,t,a,r){return b.HELP_0.setTo(e.x,e.z,0),b.HELP_1.setTo(t.x,t.z,0),b.HELP_2.setTo(a.x,a.z,0),b.HELP_3.setTo(r.x,r.z,0),b.pointInsideTriangle2d()}static pointInsideTriangle2d(){return b.productXY(b.HELP_1,b.HELP_2,b.HELP_3)>=0?b.productXY(b.HELP_1,b.HELP_2,b.HELP_0)>=0&&b.productXY(b.HELP_2,b.HELP_3,b.HELP_0)>=0&&b.productXY(b.HELP_3,b.HELP_1,b.HELP_0)>=0:b.productXY(b.HELP_1,b.HELP_2,b.HELP_0)<=0&&b.productXY(b.HELP_2,b.HELP_3,b.HELP_0)<=0&&b.productXY(b.HELP_3,b.HELP_1,b.HELP_0)<=0}static productXY(e,t,a){var r=(e.x-a.x)*(t.y-a.y)-(e.y-a.y)*(t.x-a.x);return r>-1e-5&&r<1e-5&&(r=0),r}static serialize(e){return new b(e.x,e.y,e.z,e.w)}}class Yo{constructor(e){this.canvasX=e.clientX,this.canvasY=e.clientY,this.identifier=e.identifier,this.clientX=e.clientX,this.clientY=e.clientY,this.pageX=e.pageX,this.pageY=e.pageY,this.screenX=e.screenX,this.screenY=e.screenY}canvasX;canvasY;identifier;clientX;clientY;pageX;pageY;screenX;screenY}class Xo extends Ja{canvasX=0;canvasY=0;isMouseDown=!1;isRightMouseDown=!1;canvas;mouseX=0;mouseY=0;wheelDelta=0;mouseOffsetX=0;mouseOffsetY=0;mouseLastX=0;mouseLastY=0;_time=0;_keyStatus;_mouseStatus;_isTouchStart;_keyEvent3d;_pointerEvent3D;_windowsEvent3d;mouseLock=!1;initCanvas(e){this.canvas=e;let t=0,a=0,r=0,i=0;e.onpointerdown=o=>{t=performance.now(),a=o.clientX,r=o.clientY,i=o.button,o.button==0?this.mouseStart(o):o.button==1?this.middleDown(o):o.button==2&&(this.isRightMouseDown=!0,this.mouseStart(o)),e.setPointerCapture(o.pointerId)},e.onpointerup=o=>{o.button==0?this.mouseEnd(o):o.button==1?this.middleUp(o):o.button==2&&(this.isRightMouseDown=!1,this.mouseEnd(o)),o.button===i&&performance.now()-t<300&&Math.abs(a-o.clientX)<20&&Math.abs(r-o.clientY)<20&&(o.button===0?this.mouseClick(o):this.rightClick(o)),e.releasePointerCapture(o.pointerId)},e.onpointerenter=o=>{this.mouseOver(o)},e.onpointermove=o=>{this.mouseMove(o)},e.onpointercancel=o=>{e.releasePointerCapture(o.pointerId),o.button==1?this.middleUp(o):this.mouseEnd(o)},e.addEventListener("wheel",o=>this.mouseWheel(o),{passive:!1}),window.addEventListener("keydown",o=>this.keyDown(o),!0),window.addEventListener("keyup",o=>this.keyUp(o),!0),e.oncontextmenu=function(){return!1};let n=this.canvas.getBoundingClientRect();this.canvasX=n.left,this.canvasY=n.top,this._keyStatus={},this._mouseStatus={},this._isTouchStart=!1,this._keyEvent3d=new wa,this._pointerEvent3D=new j,this._windowsEvent3d=new bt}useMouseLock(){this.mouseLock||(this.canvas.requestPointerLock(),this.mouseLock=!0,document.addEventListener("mousemove",e=>this.onMouseLockMove(e),!1))}releaseMouseLock(){this.mouseLock=!1,document.exitPointerLock(),document.removeEventListener("mousemove",e=>this.onMouseLockMove(e),!1)}onMouseLockMove(e){this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=e.movementX,this.mouseOffsetY=e.movementY,this._pointerEvent3D.reset(),this._pointerEvent3D.type=j.POINTER_MOVE,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this._pointerEvent3D.movementX=e.movementX,this._pointerEvent3D.movementY=e.movementY,this.dispatchEvent(this._pointerEvent3D)}onPinch(e,t,a,r){this._oldPosition1=new b(e,t),this._oldPosition2=new b(a,r)}onSwipe(e,t){this.mouseX=e,this.mouseY=t,this._oldPosition1=null,this._oldPosition2=null,this._time=new Date().getTime()}_oldPosition1=null;_oldPosition2=null;GetTargetTouches(e){for(var t=new Array,a=0;a<e.length;a++){var r=new Yo(e[a]);t.push(r)}return t}rightClick(e){this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._pointerEvent3D.mouseX=e.clientX-this.canvasX,this._pointerEvent3D.mouseY=e.clientY-this.canvasY,this._pointerEvent3D.type=j.POINTER_RIGHT_CLICK,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this.dispatchEvent(this._pointerEvent3D)}middleDown(e){this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._pointerEvent3D.mouseX=e.clientX-this.canvasX,this._pointerEvent3D.mouseY=e.clientY-this.canvasY,this._pointerEvent3D.type=j.POINTER_MID_DOWN,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId?e.pointerId:0,this._pointerEvent3D.pointerType=e.pointerType?e.pointerType:0,this._pointerEvent3D.isPrimary=e.isPrimary?e.isPrimary:0,this._pointerEvent3D.pressure=e.pressure?e.pressure:0,this.dispatchEvent(this._pointerEvent3D)}middleUp(e){this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._pointerEvent3D.mouseX=e.clientX-this.canvasX,this._pointerEvent3D.mouseY=e.clientY-this.canvasY,this._pointerEvent3D.type=j.POINTER_MID_UP,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId,this._pointerEvent3D.pointerType=e.pointerType,this._pointerEvent3D.isPrimary=e.isPrimary,this._pointerEvent3D.pressure=e.pressure,this.dispatchEvent(this._pointerEvent3D)}mouseClick(e){this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._pointerEvent3D.mouseX=e.clientX-this.canvasX,this._pointerEvent3D.mouseY=e.clientY-this.canvasY,this._pointerEvent3D.type=j.POINTER_CLICK,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this.dispatchEvent(this._pointerEvent3D)}_downTime=0;mouseEnd(e){this.isMouseDown=!1,this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=this.mouseX-this.mouseLastX,this.mouseOffsetY=this.mouseY-this.mouseLastY,this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._mouseStatus[this._pointerEvent3D.mouseCode]=!1,this._pointerEvent3D.type=j.POINTER_UP,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId,this._pointerEvent3D.pointerType=e.pointerType,this._pointerEvent3D.isPrimary=e.isPrimary,this._pointerEvent3D.pressure=e.pressure,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this.dispatchEvent(this._pointerEvent3D)}mouseStart(e){this.isMouseDown=!0,this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=this.mouseX-this.mouseLastX,this.mouseOffsetY=this.mouseY-this.mouseLastY,this._pointerEvent3D.reset(),this._pointerEvent3D.mouseCode=e.button,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId?e.pointerId:0,this._pointerEvent3D.pointerType=e.pointerType?e.pointerType:0,this._pointerEvent3D.isPrimary=e.isPrimary?e.isPrimary:0,this._pointerEvent3D.pressure=e.pressure?e.pressure:0,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this._pointerEvent3D.type=j.POINTER_DOWN,this.dispatchEvent(this._pointerEvent3D)}mouseMove(e){this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=this.mouseX-this.mouseLastX,this.mouseOffsetY=this.mouseY-this.mouseLastY,this._pointerEvent3D.reset(),this._pointerEvent3D.type=j.POINTER_MOVE,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId,this._pointerEvent3D.pointerType=e.pointerType,this._pointerEvent3D.isPrimary=e.isPrimary,this._pointerEvent3D.pressure=e.pressure,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this._pointerEvent3D.movementX=e.movementX,this._pointerEvent3D.movementY=e.movementY,this.dispatchEvent(this._pointerEvent3D)}mouseOver(e){this.isMouseDown=!1,this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=this.mouseX-this.mouseLastX,this.mouseOffsetY=this.mouseY-this.mouseLastY,this._pointerEvent3D.reset(),this._pointerEvent3D.type=j.POINTER_OVER,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.pointerId=e.pointerId,this._pointerEvent3D.pointerType=e.pointerType,this._pointerEvent3D.isPrimary=e.isPrimary,this._pointerEvent3D.pressure=e.pressure,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this.dispatchEvent(this._pointerEvent3D)}mouseWheel(e){e.preventDefault(),this.mouseLastX=this.mouseX,this.mouseLastY=this.mouseY,this.mouseX=e.clientX-this.canvasX,this.mouseY=e.clientY-this.canvasY,this.mouseOffsetX=this.mouseX-this.mouseLastX,this.mouseOffsetY=this.mouseY-this.mouseLastY,"wheelDelta"in e?(this._pointerEvent3D.delay=e.wheelDelta,this.wheelDelta=e.wheelDelta):"delta"in e&&(this.wheelDelta=e.delta),this._pointerEvent3D.reset(),this._pointerEvent3D.type=j.POINTER_WHEEL,this._pointerEvent3D.ctrlKey=e.ctrlKey,this._pointerEvent3D.metaKey=e.metaKey,this._pointerEvent3D.altKey=e.altKey,this._pointerEvent3D.shiftKey=e.shiftKey,this._pointerEvent3D.mouseX=this.mouseX,this._pointerEvent3D.mouseY=this.mouseY,this._pointerEvent3D.deltaX=e.deltaX,this._pointerEvent3D.deltaY=e.deltaY,this._pointerEvent3D.deltaZ=e.deltaZ,this.dispatchEvent(this._pointerEvent3D)}keyDown(e){this._keyEvent3d.reset(),this._keyEvent3d.keyCode=e.keyCode,this._keyEvent3d.ctrlKey=e.ctrlKey,this._keyEvent3d.altKey=e.altKey,this._keyEvent3d.shiftKey=e.shiftKey,this._keyStatus[e.keyCode]||(this._keyStatus[e.keyCode]=!0,this._keyEvent3d.type=wa.KEY_DOWN,this.dispatchEvent(this._keyEvent3d))}keyUp(e){this._keyEvent3d.reset(),this._keyEvent3d.keyCode=e.keyCode,this._keyStatus[e.keyCode]=!1,this._keyEvent3d.type=wa.KEY_UP,this.dispatchEvent(this._keyEvent3d)}GetSlideAngle(e,t){return Math.atan2(t,e)*180/Math.PI}GetSlideDirection(e,t,a,r){var i=t-r,n=a-e,o=0;if(Math.abs(n)<2&&Math.abs(i)<2)return o;var l=this.GetSlideAngle(n,i);return l>=-45&&l<45?o=4:l>=45&&l<135?o=1:l>=-135&&l<-45?o=2:(l>=135&&l<=180||l>=-180&&l<-135)&&(o=3),o}}class ir extends bt{static RESIZE="resize"}class Ho extends Ja{adapter;device;context;aspect;presentationSize=[0,0];presentationFormat;canvas;windowWidth;windowHeight;canvasConfig;_pixelRatio=1;_resizeEvent;get pixelRatio(){return this._pixelRatio}async init(e){if(this.canvasConfig=e,e&&e.canvas){if(this.canvas=e.canvas,this.canvas===null)throw new Error("no Canvas");this.canvas.style.width||(this.canvas.style.width=this.canvas.width+"px"),this.canvas.style.height||(this.canvas.style.height=this.canvas.height+"px")}else this.canvas=document.createElement("canvas"),this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.zIndex=e?.zIndex?e.zIndex.toString():"0",document.body.appendChild(this.canvas);if(e&&e.backgroundImage?(this.canvas.style.background=`url(${e.backgroundImage})`,this.canvas.style["background-size"]="cover",this.canvas.style["background-position"]="center"):this.canvas.style.background="transparent",this.canvas.style["touch-action"]="none",this.canvas.style["object-fit"]="cover",navigator.gpu===void 0)throw new Error("Your browser does not support WebGPU!");if(this.adapter=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),this.adapter==null)throw new Error("Your browser does not support WebGPU!");if(this.device=await this.adapter.requestDevice({requiredFeatures:["bgra8unorm-storage","depth-clip-control","depth32float-stencil8","indirect-first-instance","rg11b10ufloat-renderable"],requiredLimits:{minUniformBufferOffsetAlignment:256,maxStorageBufferBindingSize:this.adapter.limits.maxStorageBufferBindingSize}}),this.device==null)throw new Error("Your browser does not support WebGPU!");return this._pixelRatio=this.canvasConfig?.devicePixelRatio||window.devicePixelRatio||1,this._pixelRatio=Math.min(this._pixelRatio,2),this.device.label="device",this.presentationFormat=navigator.gpu.getPreferredCanvasFormat(),this.context=this.canvas.getContext("webgpu"),this.context.configure({device:this.device,format:this.presentationFormat,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT,alphaMode:"premultiplied",colorSpace:"srgb"}),this._resizeEvent=new ir(ir.RESIZE,{width:this.windowWidth,height:this.windowHeight}),new ResizeObserver(()=>{this.updateSize(),ft.destroyTexture()}).observe(this.canvas),this.updateSize(),!0}updateSize(){let e=Math.floor(this.canvas.clientWidth*this.pixelRatio),t=Math.floor(this.canvas.clientHeight*this.pixelRatio);(e!=this.windowWidth||t!=this.windowHeight)&&(this.canvas.width=this.windowWidth=e,this.canvas.height=this.windowHeight=t,this.presentationSize[0]=this.windowWidth,this.presentationSize[1]=this.windowHeight,this.aspect=this.windowWidth/this.windowHeight,this._resizeEvent.data.width=this.windowWidth,this._resizeEvent.data.height=this.windowHeight,this.dispatchEvent(this._resizeEvent))}}let w=new Ho;var Qe=(s=>(s[s.Default=1]="Default",s[s.IgnoreDepthPass=2]="IgnoreDepthPass",s[s.Sky=6]="Sky",s[s.Particle=10]="Particle",s[s.SkinnedMesh=16]="SkinnedMesh",s[s.MorphTarget=32]="MorphTarget",s[s.Terrain=64]="Terrain",s[s.UI=128]="UI",s[s.Reflection=256]="Reflection",s[s.ReflectionDebug=512]="ReflectionDebug",s[s.Graphic3D=1024]="Graphic3D",s))(Qe||{});class aa{static addMask(e,t){return e|t}static removeMask(e,t){return e&~t}static hasMask(e,t){return(e&t)==t}}class de{static HELP_0=new de;static HELP_1=new de;static HELP_2=new de;static ZERO=new de(0,0);static SAFE_MAX=new de(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);static SAFE_MIN=new de(Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);x=0;y=0;constructor(e=0,t=0){this.x=e,this.y=t}static getAngle(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}static slerp(e,t,a){let r=new de,i=e.dot(t);if(i<0&&(t.x=-t.x,t.y=-t.y,i=-i),i>.9995)return r.x=e.x+a*(t.x-e.x),r.y=e.y+a*(t.y-e.y),r;let n=Math.acos(i),o=Math.sin(n),l=Math.sin((1-a)*n)/o,c=Math.sin(a*n)/o;return r.x=l*e.x+c*t.x,r.y=l*e.y+c*t.y,r}static lerp(e,t,a){return de.HELP_0.copyFrom(e),de.HELP_1.copyFrom(t),de.HELP_0.scale(a),de.HELP_1.scale(1-a),new de(de.HELP_0.x+de.HELP_1.x,de.HELP_0.y+de.HELP_1.y)}set(e=0,t=0){return this.x=e,this.y=t,this}distance(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}add(e,t){return t=t||new de,t.x=this.x+e.x,t.y=this.y+e.y,t}sub(e,t){return t=t||new de,t.x=this.x-e.x,t.y=this.y-e.y,t}scale(e){return this.x=this.x*e,this.y=this.y*e,this}multiply(e,t){return t=t||new de,t.x=this.x*e,t.y=this.y*e,t}multiplyScaler(e){return this.x*=e,this.y*=e,this}divide(e,t){return t=t||new de,t.x=this.x/e,t.y=this.y/e,t}neg(e){return e||(e=new de),e.x=-e.x,e.y=-e.y,e}abs(){return Math.sqrt(this.x*this.x+this.y*this.y)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}getAngle(e){return Math.atan2(e.y-this.y,e.x-this.x)}unt(e){e=e||new de;let t=this.abs();return e.x=this.x/t,e.y=this.y/t,e}angleTo(e){let t=e.x-this.x,a=e.y-this.y;return Math.atan2(a,t)}equals(e){return Math.abs(this.x-e.x)<1e-6&&Math.abs(this.y-e.y)<1e-6}pal(e){let t=this.unt(),a=e.unt();return t.equals(a)?1:t.equals(a.neg())?-1:0}clone(){return new de(this.x,this.y)}copyFrom(e){return this.x=e.x,this.y=e.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}dot(e){return this.x*e.x+this.y*e.y}normalize(){let e=this.abs();return this.x=this.x/e,this.y=this.y/e,this}addInPlace(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}}class he{static X_AXIS=new he(1,0,0);static Y_AXIS=new he(0,1,0);static Z_AXIS=new he(0,0,1);static HELP_0=new he;static HELP_1=new he;static HELP_2=new he;static EPSILON=1e-5;static HELP_3=new he;static HELP_4=new he;static HELP_5=new he;static HELP_6=new he;static ZERO=new he;static ONE=new he(1,1,1,1);static LEFT=new he(-1,0,0);static RIGHT=new he(1,0,0);static UP=new he(0,-1,0);static DOWN=new he(0,1,0);static BACK=new he(0,0,-1);static FORWARD=new he(0,0,1);x=0;y=0;z=0;w=1;constructor(e=0,t=0,a=0,r=0){this.x=e,this.y=t,this.z=a,this.w=r}get width(){return this.z}get height(){return this.w}static crossVectors(e,t,a){a=a||new he;var r=e.x,i=e.y,n=e.z,o=t.x,l=t.y,c=t.z;return a.x=i*c-n*l,a.y=n*o-r*c,a.z=r*l-i*o,a}static distance(e,t){let a=e.x-t.x,r=e.y-t.y,i=e.z-t.z,n=e.w-t.w;return Math.sqrt(a*a+r*r+i*i+n*n)}set(e,t,a,r){return this.x=e,this.y=t,this.z=a,this.w=r,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}clone(){return new he(this.x,this.y,this.z,this.w)}}function Zn(s,e){let t=s.__NonSerialize__;t||(t=s.__NonSerialize__={},t.__NonSerialize__=!0),t[e]=!0}function Yn(s,e){let t;for(;s&&(s=s.__proto__,s&&(t=s.__NonSerialize__),!t););return t&&t[e]}function jr(s,e,t,a,r){let i=s.__EditorInspector__;i||(i=s.__EditorInspector__=new Map);let n=i.get(s.constructor.name);n||(n=new Map,i.set(s.constructor.name,n)),n.set(e,{p1:t,p2:a,p3:r})}function cu(s){let e,t=s,a=[];for(;t;){if(a.indexOf(t.constructor.name)!=-1){t=t.__proto__;continue}a.push(t.constructor.name),t=t.__proto__}for(a=a.reverse(),t=s;t&&(t=t.__proto__,t&&(e=t.__EditorInspector__),!e););let r=new Map;if(e)for(let i=0;i<a.length;i++){const n=a[i];let o=e.get(n);o&&o.forEach((l,c)=>{r.set(c,l)})}return r}function Lt(s,e,t,a,r){let i=window.__Component__;i||(i=window.__Component__={}),i[e]=s}function Ko(s){let e=window.__Component__;return e[s]?e[s]:null}function Ra(s,e,t,a,r){let i=window.__shader__;i||(i=window.__shader__={}),i[e]=s}function qo(s){let e=window.__shader__;return e[s]?e[s]:null}var fu=Object.defineProperty,$o=(s,e,t,a)=>{for(var r=void 0,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(e,t,r)||r);return r&&fu(e,t,r),r};const Xn=class an{__refection;__size=0;getValueType(){if(!this.__refection){let e=this;this.__refection=[];for(const t in e)if(!Yn(this,t)){const a=e[t];let r={name:t,type:a.constructor.name};this.__refection.push(r)}}return this.__refection}static getValueSize(e){switch(e.constructor.name){case"Boolean":return 4;case"Number":return 4;case"f32":return 4;case"i32":return 4;case"u32":return 4;case"Float32Array":return e.byteLength;case"Vector2":return 8;case"Vector3":return 12;case"Vector4":return 16;case"Color":return 16;case"Array":let a=0;for(let r=0,i=e.length;r<i;r++)a+=an.getValueSize(e[r]);return a}return 0}static __cacheStruct=new Map;static Ref(e){return this.Get(e).getValueType()}static Get(e){let t=an.__cacheStruct.get(e.prototype);return t||(t=new e,an.__cacheStruct.set(e.prototype,t)),t}static GetSize(e){let t=this.Get(e);if(t.__size==0){for(const a in t)if(!Yn(t,a)){const r=t[a];t.__size+=an.getValueSize(r)}t.__size>4&&(t.__size=Math.ceil(t.__size/4)*4)}return t.__size}};$o([Zn],Xn.prototype,"__refection"),$o([Zn],Xn.prototype,"__size");let gi=Xn;class el{byteOffset;byteSize;offset=0;dataBytes;get x(){return this.dataBytes.getFloat32(0*Float32Array.BYTES_PER_ELEMENT,!0)}set x(e){this.dataBytes.setFloat32(0*Float32Array.BYTES_PER_ELEMENT,e,!0)}get y(){return this.dataBytes.getFloat32(1*Float32Array.BYTES_PER_ELEMENT,!0)}set y(e){this.dataBytes.setFloat32(1*Float32Array.BYTES_PER_ELEMENT,e,!0)}get z(){return this.dataBytes.getFloat32(2*Float32Array.BYTES_PER_ELEMENT,!0)}set z(e){this.dataBytes.setFloat32(2*Float32Array.BYTES_PER_ELEMENT,e,!0)}get w(){return this.dataBytes.getFloat32(3*Float32Array.BYTES_PER_ELEMENT,!0)}set w(e){this.dataBytes.setFloat32(3*Float32Array.BYTES_PER_ELEMENT,e,!0)}setX(e){this.x=e}setXY(e,t){this.x=e,this.y=t}setXYZ(e,t,a){this.x=e,this.y=t,this.z=a}setXYZW(e,t,a,r){this.x=e,this.y=t,this.z=a,this.w=r}setVector2Array(e){for(let t=0;t<e.length;t++){const a=e[t];this.dataBytes.setFloat32((t*2+0)*Float32Array.BYTES_PER_ELEMENT,a.x,!0),this.dataBytes.setFloat32((t*2+1)*Float32Array.BYTES_PER_ELEMENT,a.y,!0)}}setVector3Array(e){for(let t=0;t<e.length;t++){const a=e[t];this.dataBytes.setFloat32((t*3+0)*Float32Array.BYTES_PER_ELEMENT,a.x,!0),this.dataBytes.setFloat32((t*3+1)*Float32Array.BYTES_PER_ELEMENT,a.y,!0),this.dataBytes.setFloat32((t*3+2)*Float32Array.BYTES_PER_ELEMENT,a.z,!0)}}setVector4Array(e){for(let t=0;t<e.length;t++){const a=e[t];this.dataBytes.setFloat32((t*4+0)*Float32Array.BYTES_PER_ELEMENT,a.x,!0),this.dataBytes.setFloat32((t*4+1)*Float32Array.BYTES_PER_ELEMENT,a.y,!0),this.dataBytes.setFloat32((t*4+2)*Float32Array.BYTES_PER_ELEMENT,a.z,!0),this.dataBytes.setFloat32((t*4+3)*Float32Array.BYTES_PER_ELEMENT,a.w,!0)}}setColorArray(e){for(let t=0;t<e.length;t++){const a=e[t];this.dataBytes.setFloat32((t*4+0)*Float32Array.BYTES_PER_ELEMENT,a.r,!0),this.dataBytes.setFloat32((t*4+1)*Float32Array.BYTES_PER_ELEMENT,a.g,!0),this.dataBytes.setFloat32((t*4+2)*Float32Array.BYTES_PER_ELEMENT,a.b,!0),this.dataBytes.setFloat32((t*4+3)*Float32Array.BYTES_PER_ELEMENT,a.a,!0)}}setInt8(e,t=0){this.dataBytes.setInt8(t*Int8Array.BYTES_PER_ELEMENT,e)}getInt8(e=0){return this.dataBytes.getInt8(e*Int8Array.BYTES_PER_ELEMENT)}setInt16(e,t=0){this.dataBytes.setInt16(t*Int16Array.BYTES_PER_ELEMENT,e,!0)}getInt16(e=0){return this.dataBytes.getInt16(e*Int16Array.BYTES_PER_ELEMENT,!0)}setInt32(e,t=0){this.dataBytes.setInt32(t*Int32Array.BYTES_PER_ELEMENT,e,!0)}getInt32(e=0){return this.dataBytes.getInt32(e*Int32Array.BYTES_PER_ELEMENT,!0)}setFloat(e,t=0){this.dataBytes.setFloat32(t*Float32Array.BYTES_PER_ELEMENT,e,!0)}getFloat(e=0){return this.dataBytes.getFloat32(e*Float32Array.BYTES_PER_ELEMENT,!0)}setUint8(e,t=0){this.dataBytes.setUint8(t*Uint8Array.BYTES_PER_ELEMENT,e)}getUint8(e=0){return this.dataBytes.getUint8(e*Uint8Array.BYTES_PER_ELEMENT)}setUint16(e,t=0){this.dataBytes.setUint16(t*Uint16Array.BYTES_PER_ELEMENT,e,!0)}getUint16(e=0){return this.dataBytes.getUint16(e*Uint16Array.BYTES_PER_ELEMENT,!0)}setUint32(e,t=0){this.dataBytes.setUint32(t*Uint32Array.BYTES_PER_ELEMENT,e,!0)}getUint32(e=0){return this.dataBytes.getUint32(e*Uint32Array.BYTES_PER_ELEMENT,!0)}setArray(e,t){for(let a=0;a<t.length;a++){const r=t[a];this.dataBytes.setFloat32((e+a)*Float32Array.BYTES_PER_ELEMENT,r,!0)}}setFloat32Array(e,t){new Float32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Float32Array.BYTES_PER_ELEMENT,t.length).set(t)}setFloatArray(e,t){let a;t instanceof Float32Array?a=t:a=new Float32Array(t),new Float32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Float32Array.BYTES_PER_ELEMENT,a.length).set(a)}setArrayBuffer(e,t){t instanceof Uint8Array?this.setUint8Array(e,t):t instanceof Uint16Array?this.setUint16Array(e,t):t instanceof Uint32Array?this.setUint32Array(e,t):t instanceof Int8Array?this.setInt8Array(e,t):t instanceof Int16Array?this.setInt16Array(e,t):t instanceof Int32Array?this.setInt32Array(e,t):t instanceof Float32Array&&this.setFloat32Array(e,t)}setInt8Array(e,t){new Int8Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Int8Array.BYTES_PER_ELEMENT).set(t)}setInt16Array(e,t){new Int16Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Int16Array.BYTES_PER_ELEMENT).set(t)}setInt32Array(e,t){new Int32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Int32Array.BYTES_PER_ELEMENT).set(t)}setUint8Array(e,t){new Uint8Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Uint8Array.BYTES_PER_ELEMENT).set(t)}setUint16Array(e,t){new Uint16Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Uint16Array.BYTES_PER_ELEMENT).set(t)}setUint32Array(e,t){new Uint32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+e*Uint32Array.BYTES_PER_ELEMENT).set(t)}setData(e,t){this.dataBytes.setFloat32(e*Float32Array.BYTES_PER_ELEMENT,t,!0)}setVector2(e,t){this.dataBytes.setFloat32(e*Float32Array.BYTES_PER_ELEMENT,t.x,!0),this.dataBytes.setFloat32((e+1)*Float32Array.BYTES_PER_ELEMENT,t.y,!0)}setVector3(e,t){this.dataBytes.setFloat32(e*Float32Array.BYTES_PER_ELEMENT,t.x,!0),this.dataBytes.setFloat32((e+1)*Float32Array.BYTES_PER_ELEMENT,t.y,!0),this.dataBytes.setFloat32((e+2)*Float32Array.BYTES_PER_ELEMENT,t.z,!0)}setVector4(e,t){this.dataBytes.setFloat32(e*Float32Array.BYTES_PER_ELEMENT,t.x,!0),this.dataBytes.setFloat32((e+1)*Float32Array.BYTES_PER_ELEMENT,t.y,!0),this.dataBytes.setFloat32((e+2)*Float32Array.BYTES_PER_ELEMENT,t.z,!0),this.dataBytes.setFloat32((e+3)*Float32Array.BYTES_PER_ELEMENT,t.w,!0)}setColor(e,t){this.dataBytes.setFloat32(e*Float32Array.BYTES_PER_ELEMENT,t.r,!0),this.dataBytes.setFloat32((e+1)*Float32Array.BYTES_PER_ELEMENT,t.g,!0),this.dataBytes.setFloat32((e+2)*Float32Array.BYTES_PER_ELEMENT,t.b,!0),this.dataBytes.setFloat32((e+3)*Float32Array.BYTES_PER_ELEMENT,t.a,!0)}getData(e){return this.dataBytes.getFloat32(e*Float32Array.BYTES_PER_ELEMENT,!0)}writeFloat(e){this.dataBytes.setFloat32(this.offset,e,!0),this.offset+=Float32Array.BYTES_PER_ELEMENT}writeInt8(e){this.dataBytes.setInt8(this.offset,e),this.offset+=Int8Array.BYTES_PER_ELEMENT}writeInt16(e){this.dataBytes.setInt16(this.offset,e,!0),this.offset+=Int16Array.BYTES_PER_ELEMENT}writeInt32(e){this.dataBytes.setInt32(this.offset,e,!0),this.offset+=Int32Array.BYTES_PER_ELEMENT}writeUint8(e){this.dataBytes.setUint8(this.offset,e),this.offset+=Uint8Array.BYTES_PER_ELEMENT}writeUint16(e){this.dataBytes.setUint16(this.offset,e,!0),this.offset+=Uint16Array.BYTES_PER_ELEMENT}writeUint32(e){this.dataBytes.setUint32(this.offset,e,!0),this.offset+=Uint32Array.BYTES_PER_ELEMENT}writeVector2(e){this.writeFloat(e.x),this.writeFloat(e.y)}writeVector3(e){this.writeFloat(e.x),this.writeFloat(e.y),this.writeFloat(e.z)}writeVector4(e){this.writeFloat(e.x),this.writeFloat(e.y),this.writeFloat(e.z),this.writeFloat(e.w)}writeRGBColor(e){this.writeFloat(e.r),this.writeFloat(e.g),this.writeFloat(e.b)}writeArray(e){for(let t=0;t<e.length;t++){const a=e[t];this.writeFloat(a)}}writeFloat32Array(e){new Float32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeInt8Array(e){new Int8Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeInt16Array(e){new Int16Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeInt32Array(e){new Int32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeUint8Array(e){new Uint8Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeUint16Array(e){new Uint16Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}writeUint32Array(e){new Uint32Array(this.dataBytes.buffer,this.dataBytes.byteOffset+this.offset).set(e),this.offset+=e.byteLength}reset(){this.offset=0}destroy(){this.byteOffset=null,this.byteSize=null,this.offset=null,this.dataBytes=null}}class nr{shareDataBuffer;_byteOffset=0;allocation(e){this.shareDataBuffer&&this.shareDataBuffer.byteLength<e?this._byteOffset=0:this.shareDataBuffer=new ArrayBuffer(e)}allocation_node(e){if(this._byteOffset+e>this.shareDataBuffer.byteLength)return console.error("memory not enough!",this._byteOffset,e,this.shareDataBuffer.byteLength),null;let t=new el;return t.byteOffset=this._byteOffset,t.byteSize=e,t.dataBytes=new DataView(this.shareDataBuffer,this._byteOffset,t.byteSize),this._byteOffset+=t.byteSize,t}allocation_memory(e){return this._byteOffset+e.byteSize>this.shareDataBuffer.byteLength?(console.error("memory not enough!",this._byteOffset,e.byteSize,this.shareDataBuffer.byteLength),null):(e.byteOffset=this._byteOffset,e.dataBytes=new DataView(this.shareDataBuffer,this._byteOffset,e.byteSize),this._byteOffset+=e.byteSize,e)}reset(){this._byteOffset=0}destroy(e){this.shareDataBuffer=null,this._byteOffset=0}}class ja{bufferType;buffer;memory;memoryNodes;seek;outFloat32Array;byteSize;usage;visibility=GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE;mapAsyncBuffersOutstanding=0;mapAsyncReady;_readBuffer;_dataView;constructor(){this.mapAsyncReady=[]}debug(){}reset(e=!1,t=0,a){this.seek=0,this.memory.reset(),e&&this.createBuffer(this.usage,t,a)}setBoolean(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(4),this.memoryNodes.set(e,a)),a.setX(t?1:0)}readBoole(e){let t=this.memoryNodes.get(e);return t?t.getFloat()!=0:null}setFloat(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(4),this.memoryNodes.set(e,a)),a.setX(t)}getFloat(e){let t=this.memoryNodes.get(e);return t?t.getFloat():null}setInt8(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(1),this.memoryNodes.set(e,a)),a.setInt8(t)}getInt8(e){let t=this.memoryNodes.get(e);return t?t.getInt8():null}setInt16(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(2),this.memoryNodes.set(e,a)),a.setInt16(t)}getInt16(e){let t=this.memoryNodes.get(e);return t?t.getInt16():null}setInt32(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(4),this.memoryNodes.set(e,a)),a.setInt32(t)}getInt32(e){let t=this.memoryNodes.get(e);return t?t.getInt32():null}setUint8(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(1),this.memoryNodes.set(e,a)),a.setUint8(t)}getUint8(e){let t=this.memoryNodes.get(e);return t?t.getUint8():null}setUint16(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(2),this.memoryNodes.set(e,a)),a.setUint16(t)}getUint16(e){let t=this.memoryNodes.get(e);return t?t.getUint16():null}setUint32(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(4),this.memoryNodes.set(e,a)),a.setUint32(t)}getUint32(e){let t=this.memoryNodes.get(e);return t?t.getUint32():null}setVector2(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(8),this.memoryNodes.set(e,a)),a.setXY(t.x,t.y)}getVector2(e){let t=this.memoryNodes.get(e);return t?new de(t.x,t.y):null}setVector3(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(12),this.memoryNodes.set(e,a)),a.setXYZ(t.x,t.y,t.z)}getVector3(e){let t=this.memoryNodes.get(e);return t?new b(t.x,t.y,t.z):null}setVector4(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(16),this.memoryNodes.set(e,a)),a.setXYZW(t.x,t.y,t.z,t.w)}getVector4(e){let t=this.memoryNodes.get(e);return t?new he(t.x,t.y,t.z,t.w):null}setVector4Array(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(16*t.length),this.memoryNodes.set(e,a)),a.setVector4Array(t)}setColor(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(16),this.memoryNodes.set(e,a)),a.setXYZW(t.r,t.g,t.b,t.a)}getColor(e){let t=this.memoryNodes.get(e);return t?new J(t.x,t.y,t.z,t.w):null}setColorArray(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(16*t.length),this.memoryNodes.set(e,a)),a.setColorArray(t)}setMatrix(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(64),this.memoryNodes.set(e,a)),a.setFloatArray(0,t.rawData)}setMatrixArray(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(64*t.length),this.memoryNodes.set(e,a));for(let r=0;r<t.length;r++){const i=t[r];a.setFloatArray(r*16,i.rawData)}}setArray(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(t.length*4),this.memoryNodes.set(e,a)),a.setArray(0,t)}setFloat32Array(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(t.length*4),this.memoryNodes.set(e,a)),a.setFloat32Array(0,t)}setInt32Array(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(t.length*4),this.memoryNodes.set(e,a)),a.setInt32Array(0,t)}setUint32Array(e,t){let a=this.memoryNodes.get(e);a||(a=this.memory.allocation_node(t.length*4),this.memoryNodes.set(e,a)),a.setUint32Array(0,t)}setStruct(e,t,a,r){let i=gi.Ref(e);gi.GetSize(e);let n=t,o=this.memoryNodes.get(n);o.reset();let l=a;r&&(l=l[r]);for(let c=0;c<i.length;c++){const f=i[c];let h=l[f.name];this.writeValue(o,f,h)}}writeValue(e,t,a){switch(t.type){case"Boolean":e.writeFloat(a);break;case"Number":e.writeFloat(a);break;case"Float32Array":e.writeFloat32Array(a);break;case"Float64Array":e.writeFloat32Array(new Float32Array(a));break;case"Vector2":e.writeVector2(a);break;case"Vector3":e.writeVector3(a);break;case"Vector4":e.writeVector4(a);break;case"Color":e.writeRGBColor(a);break;case"Array":e.writeArray(a);break}}setStructArray(e,t,a){let r=t.length;for(let i=0;i<r;i++){const n=t[i];this.setStruct(e,i,n,a)}}clean(){this._dataView.fill(0,0,this._dataView.length)}apply(){w.device.queue.writeBuffer(this.buffer,0,this.memory.shareDataBuffer)}mapAsyncWrite(e,t){let a;e instanceof Float64Array?a=new Float32Array(e):a=e;let r=w.device;if(a.length>0){let i=null;for(;this.mapAsyncReady.length&&(i=this.mapAsyncReady.shift(),i.usedSize!=a.byteLength);)i.destroy(),this.mapAsyncBuffersOutstanding--,i=null;i||(i=r.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.MAP_WRITE,mappedAtCreation:!0}),i.usedSize=a.byteLength,this.mapAsyncBuffersOutstanding++,this.mapAsyncBuffersOutstanding>20&&console.warn(` Warning: mapAsync requests from ${this.mapAsyncBuffersOutstanding} frames ago have not resolved yet. MB of staging buffers allocated.`));let n=new Float32Array(a.buffer,a.byteOffset,t);new Float32Array(i.getMappedRange(0,t*4)).set(n),i.unmap();const l=r.createCommandEncoder();l.copyBufferToBuffer(i,0,this.buffer,0,t*4),r.queue.submit([l.finish()]),i.mapAsync(GPUMapMode.WRITE).then(()=>this.mapAsyncReady.push(i))}}destroy(e){this.memoryNodes&&this.memoryNodes.forEach(t=>{t.destroy()}),this.bufferType=null,this.seek=null,this.byteSize=null,this.usage=null,this.visibility=null,this.outFloat32Array=null,this.buffer&&this.buffer.destroy(),this.buffer=null,this.memory&&this.memory.destroy(),this.memory=null,this._readBuffer&&this._readBuffer.destroy()}createBuffer(e,t,a,r){let i=w.device;if(this.buffer&&this.destroy(),this.byteSize=t*4,this.usage=e,this.buffer=i.createBuffer({label:r,size:this.byteSize,usage:e,mappedAtCreation:!1}),this.memory=new nr,this.memoryNodes=new Map,this._dataView=new Float32Array(this.memory.shareDataBuffer),this.memory.allocation(this.byteSize),a){let n=this.memory.allocation_node(a.length*4);const o=a.buffer instanceof ArrayBuffer?a.buffer:new Uint8Array(a.buffer).buffer;n.setArrayBuffer(0,o),this.apply()}}resizeBuffer(e,t){this.createBuffer(this.usage,e,t)}createNewBuffer(e,t){let a=w.device,r=t*4,i=e;return this.buffer&&this.destroy(),a.createBuffer({size:r,usage:i,mappedAtCreation:!1})}createBufferByStruct(e,t,a){let r=gi.GetSize(t),i=r*a,n=w.device;this.buffer=n.createBuffer({label:"StructStorageGPUBuffer",size:i,usage:e,mappedAtCreation:!1}),this.memory=new nr,this.memoryNodes=new Map,this._dataView=new Float32Array(this.memory.shareDataBuffer),this.memory.allocation(i);for(let o=0;o<a;o++){let l=o,c=this.memoryNodes.get(l);c||(c=this.memory.allocation_node(r),this.memoryNodes.set(l,c))}}readBuffer(e=!1){this.outFloat32Array||=new Float32Array(this.memory.shareDataBuffer.byteLength/4),this._readBuffer||(this._readBuffer=w.device.createBuffer({size:this.memory.shareDataBuffer.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ,mappedAtCreation:!1}));let t=this.read();return e?t:this.outFloat32Array}_readFlag=!1;async read(){if(!this._readFlag){this._readFlag=!0;let e=w.device.createCommandEncoder();e.copyBufferToBuffer(this.buffer,0,this._readBuffer,0,this.memory.shareDataBuffer.byteLength),w.device.queue.submit([e.finish()]),await this._readBuffer.mapAsync(GPUMapMode.READ);const t=this._readBuffer.getMappedRange();this.outFloat32Array.set(new Float32Array(t),0),this._readBuffer.unmap(),this._readFlag=!1}return this.outFloat32Array}}var ga=(s=>(s[s.IndicesGPUBuffer=0]="IndicesGPUBuffer",s[s.VertexGPUBuffer=1]="VertexGPUBuffer",s[s.UniformGPUBuffer=2]="UniformGPUBuffer",s[s.StorageGPUBuffer=3]="StorageGPUBuffer",s[s.ComputeGPUBuffer=4]="ComputeGPUBuffer",s[s.MaterialDataUniformGPUBuffer=5]="MaterialDataUniformGPUBuffer",s[s.StructStorageGPUBuffer=6]="StructStorageGPUBuffer",s))(ga||{});class Te extends ja{constructor(e,t=0,a){super(),this.bufferType=ga.StorageGPUBuffer,this.createBuffer(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|t,e,a,"StorageGPUBuffer")}}class yt extends ja{constructor(e,t){super(),this.bufferType=ga.UniformGPUBuffer,this.createBuffer(GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC,e,t,"UniformGPUBuffer")}genUniformNodes(){}}class Xt{static getMorphTargetShaderBinding(e,t){return`
|
|
2
2
|
fn blendMorphTargetPosition(vertexID:i32, posIn:vec3<f32>) -> vec3<f32>{
|
|
3
3
|
let offset:i32 = vertexID * 3;
|
|
4
4
|
var pos = posIn * morphTargetConfig:morphBaseInfluence;
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
#endif
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
`}let Gt=function(s=16,e=16){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),a=[],r;if(e=e||t.length,s)for(r=0;r<s;r++)a[r]=t[0|Math.random()*e];else{var i;for(a[8]=a[13]=a[18]=a[23]="-",a[14]="4",r=0;r<36;r++)a[r]||(i=0|Math.random()*16,a[r]=t[r==19?i&3|8:i])}return a.join("")},tl=1e6,Hn=function(){return tl++,tl},du=function(s,e){let t=0,a=s.length;for(t=0;t<a;t++)if(s[t]==e)return!0;return!1},hu=function(s,e){let t=0,a=s.length;for(t=0;t<a;t++)if(s[t]==e)return t;return-1},nn=(...s)=>function(...e){s.forEach(t=>t.apply(this,e))};var Ct=(s=>(s[s.Number=0]="Number",s[s.Vector2=1]="Vector2",s[s.Vector3=2]="Vector3",s[s.Vector4=3]="Vector4",s[s.Color=4]="Color",s[s.Float32Array=5]="Float32Array",s))(Ct||{});class
|
|
90
|
+
`}let Gt=function(s=16,e=16){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),a=[],r;if(e=e||t.length,s)for(r=0;r<s;r++)a[r]=t[0|Math.random()*e];else{var i;for(a[8]=a[13]=a[18]=a[23]="-",a[14]="4",r=0;r<36;r++)a[r]||(i=0|Math.random()*16,a[r]=t[r==19?i&3|8:i])}return a.join("")},tl=1e6,Hn=function(){return tl++,tl},du=function(s,e){let t=0,a=s.length;for(t=0;t<a;t++)if(s[t]==e)return!0;return!1},hu=function(s,e){let t=0,a=s.length;for(t=0;t<a;t++)if(s[t]==e)return t;return-1},nn=(...s)=>function(...e){s.forEach(t=>t.apply(this,e))};var Ct=(s=>(s[s.Number=0]="Number",s[s.Vector2=1]="Vector2",s[s.Vector3=2]="Vector3",s[s.Vector4=3]="Vector4",s[s.Color=4]="Color",s[s.Float32Array=5]="Float32Array",s))(Ct||{});class sr{size;memoryInfo;bindOnChange;_data;_type=Ct.Number;_x=0;_y=0;_z=0;_w=0;constructor(e){this.data=e}get data(){return this._data}set data(e){this._data=e,this._type=Ct.Number,e instanceof de?(this.size=2,this._x=e.x,this._y=e.y,this._type=Ct.Vector2):e instanceof b?(this.size=3,this._x=e.x,this._y=e.y,this._z=e.z,this._type=Ct.Vector3):e instanceof he?(this.size=4,this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._type=Ct.Vector4):e instanceof J?(this.size=4,this._x=e.r,this._y=e.g,this._z=e.b,this._w=e.a,this._type=Ct.Color):e instanceof Float32Array?(this.size=e.length,this._type=Ct.Float32Array):(this.size=1,this._x=e,this._data=e,this._type=Ct.Number)}getColor(e){return e?e.copyFrom(this._data):e=this._data,e}get color(){return new J(this._data.r,this._data.g,this._data.b,this._data.a)}set color(e){(this._x!=e.r||this._y!=e.g||this._z!=e.b||this._w!=e.a)&&(this._data.r=e.r,this._data.g=e.g,this._data.b=e.b,this._data.a=e.a,this._x=e.r,this._y=e.g,this._z=e.b,this._w=e.a,this.onChange())}get value(){return this._x}set value(e){this._x!=e&&(this._data=e,this._x=e,this.onChange())}get vector2(){return this._data}set vector2(e){(this._x!=e.x||this._y!=e.y)&&(this._data.x=e.x,this._data.y=e.y,this._x=e.x,this._y=e.y,this.onChange())}get vector3(){return this._data}set vector3(e){(this._x!=e.x||this._y!=e.y||this._z!=e.z)&&(this._data.x=e.x,this._data.y=e.y,this._data.z=e.z,this._x=e.x,this._y=e.y,this._z=e.z,this.onChange())}get vector4(){return this._data}set vector4(e){(this._x!=e.x||this._y!=e.y||this._z!=e.z||this._w!=e.w)&&(this._data.x=e.x,this._data.y=e.y,this._data.z=e.z,this._data.w=e.w,this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChange())}onChange(){this.bindOnChange&&this.bindOnChange()}float32Array(e){this._data.set(e),this.onChange()}update(){switch(this._type){case Ct.Number:this.memoryInfo.dataBytes.setFloat32(0*Float32Array.BYTES_PER_ELEMENT,this._data,!0);break;case Ct.Vector2:this.memoryInfo.setVector2(0,this._data);break;case Ct.Vector3:this.memoryInfo.setVector3(0,this._data);break;case Ct.Vector4:this.memoryInfo.setVector4(0,this._data);break;case Ct.Color:this.memoryInfo.setColor(0,this._data);break;case Ct.Float32Array:this.memoryInfo.setFloat32Array(0,this._data);break}}}class Kn{instanceID;shaderVariant;vsEntryPoint="main";fsEntryPoint="main";bindGroups;shaderReflection;defineValue;constValues;uniforms;materialDataUniformBuffer;_bufferDic;_shaderChange=!0;_valueChange=!1;constructor(){this.instanceID=Gt(),this.defineValue={},this.constValues={},this.uniforms={},this._bufferDic=new Map}noticeShaderChange(){this._shaderChange=!0}noticeValueChange(){this._valueChange=!0}setStorageBuffer(e,t){this._bufferDic.has(e)?this._bufferDic.set(e,t):(this._bufferDic.set(e,t),this.noticeBufferChange(e))}setStructStorageBuffer(e,t){this._bufferDic.has(e)?(this._bufferDic.set(e,t),this.noticeBufferChange(e)):this._bufferDic.set(e,t)}setUniformBuffer(e,t){this._bufferDic.has(e)?(this._bufferDic.set(e,t),this.noticeBufferChange(e)):this._bufferDic.set(e,t)}setDefine(e,t){(this.defineValue[e]==null||this.defineValue[e]!=t)&&(this.defineValue[e]=t,this.noticeValueChange(),this.noticeShaderChange()),this.defineValue[e]=t}hasDefine(e){return this.defineValue[e]!=null}deleteDefine(e){delete this.defineValue[e],this.noticeShaderChange()}setUniformFloat(e,t){this.uniforms[e]?this.uniforms[e].value=t:(this.uniforms[e]=new sr(t),this.noticeValueChange())}setUniformVector2(e,t){this.uniforms[e]?this.uniforms[e].vector2=t:(this.uniforms[e]=new sr(t),this.noticeValueChange())}setUniformVector3(e,t){this.uniforms[e]?this.uniforms[e].vector3=t:this.uniforms[e]=new sr(t)}setUniformVector4(e,t){this.uniforms[e]?this.uniforms[e].vector4=t:this.uniforms[e]=new sr(t)}setUniformColor(e,t){this.uniforms[e]?this.uniforms[e].color=t:this.uniforms[e]=new sr(t)}setUniformArray(e,t){this.uniforms[e]?this.uniforms[e].float32Array(t):this.uniforms[e]=new sr(t)}setUniform(e,t){this.uniforms[e]?this.uniforms[e].data=t:this.uniforms[e]=new sr(t)}getUniform(e){return this.uniforms[e].data}getUniformFloat(e){return this.uniforms[e].data}getUniformVector2(e){return this.uniforms[e].data}getUniformVector3(e){return this.uniforms[e].data}getUniformVector4(e){return this.uniforms[e].data}getUniformColor(e){return this.uniforms[e].color}getBuffer(e){return this._bufferDic[e].data}noticeBufferChange(e){}applyUniform(){this.materialDataUniformBuffer&&this._valueChange&&this.materialDataUniformBuffer.apply()}destroy(e){}}var or=(s=>(s[s.u32=1]="u32",s[s.f32=1]="f32",s[s["vec2<f32>"]=2]="vec2<f32>",s[s["vec3<f32>"]=3]="vec3<f32>",s[s["vec4<f32>"]=4]="vec4<f32>",s[s.float32=1]="float32",s[s.float32x2=2]="float32x2",s[s.float32x3=3]="float32x3",s[s.float32x4=4]="float32x4",s))(or||{});let Ht={clamp_to_edge:"clamp-to-edge",repeat:"repeat",mirror_repeat:"mirror-repeat"},uu={zero:"zero",one:"one",src:"src",one_minus_src:"one-minus-src",src_alpha:"src-alpha",one_minus_src_alpha:"one-minus-src-alpha",dst:"dst",one_minus_dst:"one-minus-dst",dst_alpha:"dst-alpha",one_minus_dst_alpha:"one-minus-dst-alpha",src_alpha_saturated:"src-alpha-saturated",constant:"constant",one_minus_constant:"one-minus-constant"};const bu={srcFactor:"one",dstFactor:"zero",operation:"add"},gu={compare:"always",failOp:"keep",depthFailOp:"keep",passOp:"keep"};let ot={never:"never",less:"less",equal:"equal",less_equal:"less-equal",greater:"greater",not_equal:"not-equal",greater_equal:"greater-equal",always:"always"},Nt={none:"none",front:"front",back:"back"},lr={nearest:"nearest",linear:"linear"},sn={point_list:"point-list",line_list:"line-list",line_strip:"line-strip",triangle_list:"triangle-list",triangle_strip:"triangle-strip"},se={r8unorm:"r8unorm",r8snorm:"r8snorm",r8uint:"r8uint",r8sint:"r8sint",r16uint:"r16uint",r16sint:"r16sint",r16float:"r16float",rg8unorm:"rg8unorm",rg8snorm:"rg8snorm",rg8uint:"rg8uint",rg8sint:"rg8sint",r32uint:"r32uint",r32sint:"r32sint",r32float:"r32float",rg16uint:"rg16uint",rg16sint:"rg16sint",rg16float:"rg16float",rgba8unorm:"rgba8unorm",rgba8unorm_srgb:"rgba8unorm-srgb",rgba8snorm:"rgba8snorm",rgba8uint:"rgba8uint",rgba8sint:"rgba8sint",bgra8unorm:"bgra8unorm",bgra8unorm_srgb:"bgra8unorm-srgb",rgb9e5ufloat:"rgb9e5ufloat",rgb10a2unorm:"rgb10a2unorm",rg11b10ufloat:"rg11b10ufloat",rg32uint:"rg32uint",rg32sint:"rg32sint",rg32float:"rg32float",rgba16uint:"rgba16uint",rgba16sint:"rgba16sint",rgba16float:"rgba16float",rgba32uint:"rgba32uint",rgba32sint:"rgba32sint",rgba32float:"rgba32float",stencil8:"stencil8",depth16unorm:"depth16unorm",depth24plus:"depth24plus",depth24plus_stencil8:"depth24plus-stencil8",depth32float:"depth32float",bc1_rgba_unorm:"bc1-rgba-unorm",bc1_rgba_unorm_srgb:"bc1-rgba-unorm-srgb",bc2_rgba_unorm:"bc2-rgba-unorm",bc2_rgba_unorm_srgb:"bc2-rgba-unorm-srgb",bc3_rgba_unorm:"bc3-rgba-unorm",bc3_rgba_unorm_srgb:"bc3-rgba-unorm-srgb",bc4_r_unorm:"bc4-r-unorm",bc4_r_snorm:"bc4-r-snorm",bc5_rg_unorm:"bc5-rg-unorm",bc5_rg_snorm:"bc5-rg-snorm",bc6h_rgb_ufloat:"bc6h-rgb-ufloat",bc6h_rgb_float:"bc6h-rgb-float",bc7_rgba_unorm:"bc7-rgba-unorm",bc7_rgba_unorm_srgb:"bc7-rgba-unorm-srgb",depth24unorm_stencil8:"depth24unorm-stencil8",depth32float_stencil8:"depth32float-stencil8"},mi={uint8x2:"uint8x2",uint8x4:"uint8x4",sint8x2:"sint8x2",sint8x4:"sint8x4",unorm8x2:"unorm8x2",unorm8x4:"unorm8x4",snorm8x2:"snorm8x2",snorm8x4:"snorm8x4",uint16x2:"uint16x2",uint16x4:"uint16x4",sint16x2:"sint16x2",sint16x4:"sint16x4",unorm16x2:"unorm16x2",unorm16x4:"unorm16x4",snorm16x2:"snorm16x2",snorm16x4:"snorm16x4",float16x2:"float16x2",float16x4:"float16x4",float32:"float32",float32x2:"float32x2",float32x3:"float32x3",float32x4:"float32x4",uint32:"uint32",uint32x2:"uint32x2",uint32x3:"uint32x3",uint32x4:"uint32x4",sint32:"sint32",sint32x2:"sint32x2",sint32x3:"sint32x3",sint32x4:"sint32x4"},mu={vertex:"vertex",instance:"instance"},al=[null,mi.float32,mi.float32x2,mi.float32x3,mi.float32x4],rl=`
|
|
91
91
|
var<private> colorSet: array<vec3<f32>, 9> = array<vec3<f32>, 9>(
|
|
92
92
|
vec3<f32>(1.0, 0.0, 0.0),
|
|
93
93
|
vec3<f32>(1.0, 0.5, 0.0),
|
|
@@ -5666,7 +5666,7 @@ struct InstanceData {
|
|
|
5666
5666
|
`,""),c=c.replaceAll(" "," "),this.parserAttribute(c,t)}else{var n=r.split(":")[1];n=n.replaceAll(" ",""),n=n.replaceAll(" ",""),n=n.replaceAll(")",""),n=e.split(`struct ${n}`)[1];let l=n.indexOf("{"),c=n.indexOf("}");n=n.slice(l,c),i=n.split("@");for(let f=1;f<i.length;f++){let u=i[f].replace(/\s*$/g,"");u=u.replaceAll(`
|
|
5667
5667
|
`,""),u=u.split(",")[0],u=u.replaceAll(" "," "),this.parserAttribute(u,t)}}return t}static parserVertex(e,t){let a=[],i=t.split(`fn ${e}(`)[1].split("->")[0],n=i.split("@");if(n&&n.length>1)for(let l=1;l<n.length;l++){let f=n[l].replace(/\s*$/g,"");f=f.replaceAll(",",""),f=f.replaceAll(`
|
|
5668
5668
|
`,""),f=f.replaceAll(" "," "),this.parserAttribute(f,a)}else{var o=i.split(":")[1];o=o.replaceAll(" ",""),o=o.replaceAll(" ",""),o=o.replaceAll(")",""),o=t.split(`struct ${o}`)[1];let c=o.indexOf("{"),f=o.indexOf("}");o=o.slice(c,f),n=o.split("@");for(let h=1;h<n.length;h++){let g=n[h].replace(/\s*$/g,"");g=g.replaceAll(`
|
|
5669
|
-
`,""),g=g.split(",")[0],g=g.replaceAll(" "," "),this.parserAttribute(g,a)}}return a}static parserAttribute(e,t){let a={name:"",group:0,location:0,type:"",valueType:"",value:0,size:0,format:"float32"};if(e.indexOf("builtin")!=-1){a.type="builtin";var r=e.match(/\((.+?)\)/g)[0];r=e.match(/\((.+?)\)/g)[0],r=r.replace("(",""),r=r.replaceAll(")",""),a.location=parseInt(r);let i=e.split(":");a.name=i[0].split(" ")[1],a.name=a.name.replaceAll(" "," "),a.name=a.name.replaceAll(" ",""),a.valueType=i[1],a.valueType=a.valueType.replaceAll(" "," "),a.valueType=a.valueType.replaceAll(" ",""),a.valueType=a.valueType.replaceAll("\r",""),a.valueType=a.valueType.replaceAll(")",""),a.valueType=a.valueType.replaceAll(")",""),a.size=lr[a.valueType],t.push(a)}else if(e.indexOf("location")!=-1){a.type="location";var r=e.match(/\((.+?)\)/g)[0];r=e.match(/\((.+?)\)/g)[0],r=r.replace("(",""),r=r.replaceAll(")",""),a.location=parseInt(r);let n=e.split(":");a.name=n[0].split(" ")[1],a.name=a.name.replaceAll(" "," "),a.name=a.name.replaceAll(" ",""),a.valueType=n[1],a.valueType=a.valueType.replaceAll(" "," "),a.valueType=a.valueType.replaceAll(" ",""),a.valueType=a.valueType.replaceAll("\r",""),a.valueType=a.valueType.replaceAll(")",""),a.valueType=a.valueType.replaceAll(")",""),a.size=lr[a.valueType],t.push(a)}a.format=al[lr[a.valueType]]}}class ye extends Kn{entryPoint="CsMain";workerSizeX=1;workerSizeY=0;workerSizeZ=0;_computePipeline;_csShaderModule;_destCS;_sourceCS;_storageTextureDic;_sampleTextureDic;_groupsShaderReflectionVarInfos;_groupCache={};constructor(e){super(),this._sourceCS=e,St.getShaderReflection2(e,this),this._storageTextureDic=new Map,this._sampleTextureDic=new Map}setStorageTexture(e,t){this._storageTextureDic.has(e)||this._storageTextureDic.set(e,t)}setSamplerTexture(e,t){this._sampleTextureDic.set(e,t)}compute(e){this._computePipeline||this.genComputePipeline(),e.setPipeline(this._computePipeline);for(let t=0;t<this.bindGroups.length;++t)e.setBindGroup(t,this.bindGroups[t]);this.workerSizeX&&this.workerSizeY&&this.workerSizeZ?e.dispatchWorkgroups(this.workerSizeX,this.workerSizeY,this.workerSizeZ):this.workerSizeX&&this.workerSizeY?e.dispatchWorkgroups(this.workerSizeX,this.workerSizeY):e.dispatchWorkgroups(this.workerSizeX)}createBufferBindGroup(e,t,a,r){let i=this._bufferDic.get(t);if(i){let n={binding:a,resource:{buffer:i.buffer,offset:0,size:i.memory.shareDataBuffer.byteLength}};r.push(n)}else console.error(`ComputeShader(${this.instanceID})`,`buffer ${t} is missing!`)}noticeBufferChange(e){let t=this._groupCache[e];t&&this.genGroups(t.groupIndex,t.infos,!0)}genGroups(e,t,a=!1){if(!this.bindGroups[e]||a){const r=t[e];let i=[];for(let o=0;o<r.length;++o){const l=r[o];if(l)switch(l.varType){case"uniform":case"storage-read":case"storage-read_write":this.createBufferBindGroup(e,l.varName,l.binding,i),this._groupCache[l.varName]={groupIndex:e,infos:t};break;case"var":if(l.dataType=="sampler"){let c=l.varName.replace("Sampler",""),f=this._sampleTextureDic.get(c);if(f){let h={binding:l.binding,resource:f.gpuSampler};i.push(h)}else console.error(`ComputeShader(${this.instanceID})`,`texture ${l.varName} is missing! `)}else if(l.dataType=="sampler_comparison"){let c=l.varName.replace("Sampler",""),f=this._sampleTextureDic.get(c);if(f){let h={binding:l.binding,resource:f.gpuSampler_comparison};i.push(h)}else console.error(`ComputeShader(${this.instanceID})`,`texture ${l.varName} is missing! `)}else if(l.dataType.indexOf("texture_storage")!=-1){let c=this._storageTextureDic.get(l.varName);if(c){let f={binding:l.binding,resource:c.getGPUView()};i.push(f),Ce.getInstance().attached(c,this)}else console.error(`ComputeShader(${this.instanceID})`,`texture ${l.varName} is missing! `)}else if(l.dataType.indexOf("texture")!=-1){let c=this._sampleTextureDic.get(l.varName);if(c){let f={binding:l.binding,resource:c.getGPUView()};i.push(f),Ce.getInstance().attached(c,this)}else console.error(`ComputeShader(${this.instanceID})`,`texture ${l.varName} is missing! `)}break;default:console.error("unprocessed type:",l.varType);break}}let n=w.device.createBindGroup({layout:this._computePipeline.getBindGroupLayout(e),entries:i});this.bindGroups[e]=n}}genComputePipeline(){this.preCompileShader(this._sourceCS),this.genReflection(),this._computePipeline=w.device.createComputePipeline({layout:"auto",compute:{module:this.compileShader(),entryPoint:this.entryPoint}}),this._groupsShaderReflectionVarInfos=[];let e=this.shaderReflection;this.bindGroups=[];for(let t=0;t<e.groups.length;++t){let a=e.groups[t];this._groupsShaderReflectionVarInfos[t]=a,this.genGroups(t,this._groupsShaderReflectionVarInfos)}w.addEventListener(nr.RESIZE,t=>{for(let a=0;a<e.groups.length;++a){let r=e.groups[a];this._groupsShaderReflectionVarInfos[a]=r,this.genGroups(a,this._groupsShaderReflectionVarInfos,!0)}},this)}preCompileShader(e){for(const t in this.constValues)if(Object.prototype.hasOwnProperty.call(this.constValues,t)){const a=this.constValues[t];e=e.replaceAll(`&${t}`,a.toString())}this._destCS=ma.parseComputeShader(e,this.defineValue)}compileShader(){let e=w.device.createShaderModule({label:`ComputeShader(${this.instanceID})`,code:this._destCS});return e.getCompilationInfo().then(t=>{t.messages.length>0&&console.warn("[shader error]",t,this._destCS)}),this._csShaderModule=e,e}genReflection(){this.shaderVariant+=St.genComputeShaderVariant(this);let e=St.poolGetReflection(this.shaderVariant);e?this.shaderReflection=e:(St.getShaderReflection2(this._destCS,this),St.combineShaderReflectionVarInfo(this.shaderReflection,this.shaderReflection.cs_variables))}}var le=(s=>(s[s.COLOR=1]="COLOR",s[s.REFLECTION=2]="REFLECTION",s[s.POSITION=4]="POSITION",s[s.GRAPHIC=8]="GRAPHIC",s[s.GI=16]="GI",s[s.Cluster=32]="Cluster",s[s.SHADOW=64]="SHADOW",s[s.POINT_SHADOW=128]="POINT_SHADOW",s[s.POST=256]="POST",s[s.DEPTH=512]="DEPTH",s[s.UI=1024]="UI",s))(le||{});class lt{static profilerLabelMap=new Map;static viewMap=new Map;static testObj={testValue1:0,testValue2:0,testValue3:0,testValue4:0};static startView(e){let t=this.viewMap.get(e);if(!t){t={};for(const a in le)parseInt(a)>=0||(t[a]={vertexCount:0,indicesCount:0,instanceCount:0,triCount:0,drawCount:0,pipelineCount:0});this.viewMap.set(e,t)}for(const a in le)parseInt(a)>=0||(t[a].vertexCount=0,t[a].indicesCount=0,t[a].triCount=0,t[a].instanceCount=0,t[a].drawCount=0,t[a].pipelineCount=0)}static viewCount(e){return this.startView(e),this.viewMap.get(e)}static viewCount_vertex(e,t,a){this.viewMap.get(e)[t].vertexCount+=a}static viewCount_indices(e,t,a){this.viewMap.get(e)[t].indicesCount+=a}static viewCount_tri(e,t,a){this.viewMap.get(e)[t].triCount+=a}static viewCount_instance(e,t,a){this.viewMap.get(e)[t].instanceCount+=a}static viewCount_draw(e,t){this.viewMap.get(e)[t].drawCount++}static viewCount_pipeline(e,t){this.viewMap.get(e)[t].pipelineCount++}static start(e){let t=this.profilerLabelMap.get(e);t||(t={lable:e,start:0,end:0,total:0,count:0,child:new Map},this.profilerLabelMap.set(e,t)),t.start=performance.now(),t.end=performance.now(),t.count=0,t.child.clear()}static end(e){let t=this.profilerLabelMap.get(e);t&&(t.end=performance.now(),t.total=t.end-t.start)}static countStart(e,t=""){let a=this.profilerLabelMap.get(e);if(a&&(a.count++,t!="")){let r=a.child.get(t);r||(r={lable:t,start:0,end:0,total:0,count:0}),r.start=performance.now(),r.end=performance.now(),r.count=0,a.child.set(t,r)}}static countEnd(e,t){let a=this.profilerLabelMap.get(e);if(a&&t!=""){let r=a.child.get(t);r||(r={lable:t,start:0,end:0,total:0,count:0}),r.end=performance.now(),r.total=r.end-r.start,r.count++}}static print(e){let t=this.profilerLabelMap.get(e);t&&console.log("performance",e,t.total+" ms")}}var Au=(()=>{var s=typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Yt&&Yt.tagName.toUpperCase()==="SCRIPT"&&Yt.src||new URL("rings.umd.max.js",document.baseURI).href;return(async function(e={}){var t=e,a,r;t.ready=new Promise((V,L)=>{a=V,r=L});var i=Object.assign({},t),n=[],o="./this.program",l=(V,L)=>{throw L},c=typeof window=="object",f=typeof importScripts=="function",h=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",u="";function g(V){return t.locateFile?t.locateFile(V,u):u+V}var A,m;if(h){const{createRequire:V}=await Promise.resolve().then(()=>dp);var p=V(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Yt&&Yt.tagName.toUpperCase()==="SCRIPT"&&Yt.src||new URL("rings.umd.max.js",document.baseURI).href),D=p("fs"),B=p("path");f?u=B.dirname(u)+"/":u=p("url").fileURLToPath(new URL("data:text/javascript;base64,DQp2YXIgTW9kdWxlID0gKCgpID0+IHsNCiAgdmFyIF9zY3JpcHREaXIgPSBpbXBvcnQubWV0YS51cmw7DQogIA0KICByZXR1cm4gKA0KYXN5bmMgZnVuY3Rpb24obW9kdWxlQXJnID0ge30pIHsNCg0KdmFyIE1vZHVsZT1tb2R1bGVBcmc7dmFyIHJlYWR5UHJvbWlzZVJlc29sdmUscmVhZHlQcm9taXNlUmVqZWN0O01vZHVsZVsicmVhZHkiXT1uZXcgUHJvbWlzZSgocmVzb2x2ZSxyZWplY3QpPT57cmVhZHlQcm9taXNlUmVzb2x2ZT1yZXNvbHZlO3JlYWR5UHJvbWlzZVJlamVjdD1yZWplY3R9KTt2YXIgbW9kdWxlT3ZlcnJpZGVzPU9iamVjdC5hc3NpZ24oe30sTW9kdWxlKTt2YXIgYXJndW1lbnRzXz1bXTt2YXIgdGhpc1Byb2dyYW09Ii4vdGhpcy5wcm9ncmFtIjt2YXIgcXVpdF89KHN0YXR1cyx0b1Rocm93KT0+e3Rocm93IHRvVGhyb3d9O3ZhciBFTlZJUk9OTUVOVF9JU19XRUI9dHlwZW9mIHdpbmRvdz09Im9iamVjdCI7dmFyIEVOVklST05NRU5UX0lTX1dPUktFUj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W9kdWxlWyJwcmVJbml0Il09W01vZHVsZVsicHJlSW5pdCJdXTt3aGlsZShNb2R1bGVbInByZUluaXQiXS5sZW5ndGg+MCl7TW9kdWxlWyJwcmVJbml0Il0ucG9wKCkoKX19dmFyIHNob3VsZFJ1bk5vdz10cnVlO2lmKE1vZHVsZVsibm9Jbml0aWFsUnVuIl0pc2hvdWxkUnVuTm93PWZhbHNlO3J1bigpOw0KDQoNCiAgcmV0dXJuIG1vZHVsZUFyZy5yZWFkeQ0KfQ0KKTsNCn0pKCk7DQpleHBvcnQgZGVmYXVsdCBNb2R1bGU7",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Yt&&Yt.tagName.toUpperCase()==="SCRIPT"&&Yt.src||new URL("rings.umd.max.js",document.baseURI).href)),A=(L,te)=>(L=ue(L)?new URL(L):B.normalize(L),D.readFileSync(L,te?void 0:"utf8")),m=L=>{var te=A(L,!0);return te.buffer||(te=new Uint8Array(te)),te},!t.thisProgram&&process.argv.length>1&&(o=process.argv[1].replace(/\\/g,"/")),n=process.argv.slice(2),l=(L,te)=>{throw process.exitCode=L,te}}else(c||f)&&(f?u=self.location.href:typeof document<"u"&&document.currentScript&&(u=document.currentScript.src),s&&(u=s),u.startsWith("blob:")?u="":u=u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1),A=V=>{var L=new XMLHttpRequest;return L.open("GET",V,!1),L.send(null),L.responseText},f&&(m=V=>{var L=new XMLHttpRequest;return L.open("GET",V,!1),L.responseType="arraybuffer",L.send(null),new Uint8Array(L.response)}));var v=t.print||console.log.bind(console),C=t.printErr||console.error.bind(console);Object.assign(t,i),i=null,t.arguments&&(n=t.arguments),t.thisProgram&&(o=t.thisProgram),t.quit&&(l=t.quit);var y;t.wasmBinary&&(y=t.wasmBinary);function x(V){if(typeof h<"u"&&h){var L=Buffer.from(V,"base64");return new Uint8Array(L.buffer,L.byteOffset,L.length)}for(var te=atob(V),ke=new Uint8Array(te.length),Ze=0;Ze<te.length;++Ze)ke[Ze]=te.charCodeAt(Ze);return ke}function k(V){if(ce(V))return x(V.slice(ne.length))}var E,S=!1,Q,I,T,M;function Z(){var V=E.buffer;t.HEAP8=I=new Int8Array(V),t.HEAP16=new Int16Array(V),t.HEAPU8=T=new Uint8Array(V),t.HEAPU16=new Uint16Array(V),t.HEAP32=new Int32Array(V),t.HEAPU32=M=new Uint32Array(V),t.HEAPF32=new Float32Array(V),t.HEAPF64=new Float64Array(V)}var be=[],re=[],P=[],z=[];function H(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)$(t.preRun.shift());ut(be)}function O(){ut(re)}function ie(){ut(P)}function W(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)oe(t.postRun.shift());ut(z)}function $(V){be.unshift(V)}function ee(V){re.unshift(V)}function oe(V){z.unshift(V)}var fe=0,De=null;function Ne(V){fe++,t.monitorRunDependencies?.(fe)}function Ke(V){if(fe--,t.monitorRunDependencies?.(fe),fe==0&&De){var L=De;De=null,L()}}function q(V){t.onAbort?.(V),V="Aborted("+V+")",C(V),S=!0,Q=1,V+=". Build with -sASSERTIONS for more info.";var L=new WebAssembly.RuntimeError(V);throw r(L),L}var ne="data:application/octet-stream;base64,",ce=V=>V.startsWith(ne),ue=V=>V.startsWith("file://"),Re;Re="data:application/octet-stream;base64,AGFzbQEAAAABpAEaYAF/AX9gAn9/AGADf39/AX9gA39/fwBgAX8AYAAAYAV/f39/fwBgBH9/f38AYAJ/fwF/YAZ/f39/f38AYAABf2AEf39/fQBgBH9/f38Bf2ABfAF9YAJ8fwF8YAF9AX1gAXwBfGACfn8Bf2ADfHx/AXxgAnx8AXxgBn98f39/fwF/YAJ9fwF/YAJ8fwF/YAV/f39/fwF/YAN/fn8BfmADf399AAIfBQFhAWEADAFhAWIAAwFhAWMABQFhAWQAAAFhAWUAAwNYVwMGAg0NAgAEABEEEhMFBQ4CBA8QAgAPE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MgF6IgJCAYoqCgoDkDACACIANBgAEQFRoLIAVBADYCAAsgA0GAAWokACACC4gLAQd/AkAgASAAKAIMIgQgACgCCCIDa0EHdSICRg0AAkAgASACSwRAIAEgAmsiBiAAKAIQIgUgBCIDa0EHdU0EQAJAIAZFDQAgAyECIAZBA3EiBQRAQQAhBANAIAJBCGpBAEHwABAHGiACQoCAgICAgID4PzcDeCACQoCAgICAgID4PzcDUCACQoCAgICAgID4PzcDKCACQoCAgICAgID4PzcDACACQYABaiECIARBAWoiBCAFRw0ACwsgBkEHdCADaiEDIAZBAWtB////D3FBA0kNAANAIAJBCGpBAEHwABAHGiACQoCAgICAgID4PzcDeCACQoCAgICAgID4PzcDUCACQoCAgICAgID4PzcDKCACQoCAgICAgID4PzcDACACQYgBakEAQfAAEAcaIAJCgICAgICAgPg/NwP4ASACQoCAgICAgID4PzcD0AEgAkKAgICAgICA+D83A6gBIAJCgICAgICAgPg/NwOAASACQYgCakEAQfAAEAcaIAJCgICAgICAgPg/NwP4AiACQoCAgICAgID4PzcD0AIgAkKAgICAgICA+D83A6gCIAJCgICAgICAgPg/NwOAAiACQYgDakEAQfAAEAcaIAJCgICAgICAgPg/NwP4AyACQoCAgICAgID4PzcD0AMgAkKAgICAgICA+D83A6gDIAJCgICAgICAgPg/NwOAAyACQYAEaiICIANHDQALCyAAIAM2AgwMAgsCQCADIAAoAggiAmtBB3UiBCAGaiIHQYCAgBBJBEBBACEDQf///w8gBSACayIFQQZ1IgIgByACIAdLGyAFQYD///8HTxsiBwRAIAdBgICAEE8NAiAHQQd0EAshCAsgCCAEQQd0aiIEIQIgBkEDcSIFBEADQCACQQhqQQBB8AAQBxogAkKAgICAgICA+D83A3ggAkKAgICAgICA+D83A1AgAkKAgICAgICA+D83AyggAkKAgICAgICA+D83AwAgAkGAAWohAiADQQFqIgMgBUcNAAsLIAZBB3QgBGohBSAGQQFrQf///w9xQQNPBEADQCACQQhqQQBB8AAQBxogAkKAgICAgICA+D83A3ggAkKAgICAgICA+D83A1AgAkKAgICAgICA+D83AyggAkKAgICAgICA+D83AwAgAkGIAWpBAEHwABAHGiACQoCAgICAgID4PzcD+AEgAkKAgICAgICA+D83A9ABIAJCgICAgICAgPg/NwOoASACQoCAgICAgID4PzcDgAEgAkGIAmpBAEHwABAHGiACQoCAgICAgID4PzcD+AIgAkKAgICAgICA+D83A9ACIAJCgICAgICAgPg/NwOoAiACQoCAgICAgID4PzcDgAIgAkGIA2pBAEHwABAHGiACQoCAgICAgID4PzcD+AMgAkKAgICAgICA+D83A9ADIAJCgICAgICAgPg/NwOoAyACQoCAgICAgID4PzcDgAMgAkGABGoiAiAFRw0ACwsgACgCDCICIAAoAggiA0cEQANAIARBgAFrIgQgAkGAAWsiAkGAARAVGiACIANHDQALIAAoAgghAgsgACAIIAdBB3RqNgIQIAAgBTYCDCAAIAQ2AgggAgRAIAIQFgsMAwsQEwALEBIACyABIAJPDQAgACADIAFBB3RqNgIMCwJAIAAoAhggACgCFCIDa0HIAG0iAiABSQRAIABBFGogASACaxA8DAELIAEgAk8NACAAIAMgAUHIAGxqNgIYCwJAIAAoAiQgACgCICIDa0EEdSICIAFJBEAgAEEgaiABIAJrEDsMAQsgASACTw0AIAAgAyABQQR0ajYCJAsgACgCMCAAKAIsIgNrQcgAbSICIAFJBEAgAEEsaiABIAJrEDwPCyABIAJPDQAgACADIAFByABsajYCMAsLBwAgACgCLAsHACAAKAIgCwcAIAAoAhQLBwAgACgCCAvUBQEHfyABIAAoAggiByAAKAIEIgNrQQR1TQRAAkAgAUUNACADIQIgAUEHcSIFBEADQCACQv////8PNwIIIAJCADcCACACQRBqIQIgBEEBaiIEIAVHDQALCyABQQR0IANqIQMgAUEBa0H/////AHFBB0kNAANAIAJC/////w83AnggAkIANwJwIAJC/////w83AmggAkIANwJgIAJC/////w83AlggAkIANwJQIAJC/////w83AkggAkIANwJAIAJC/////w83AjggAkIANwIwIAJC/////w83AiggAkIANwIgIAJC/////w83AhggAkIANwIQIAJC/////w83AgggAkIANwIAIAJBgAFqIgIgA0cNAAsLIAAgAzYCBA8LAkAgAyAAKAIAIgJrQQR1IgQgAWoiBkGAgICAAUkEQEH/////ACAHIAJrIgdBA3UiAiAGIAIgBksbIAdB8P///wdPGyIGBEAgBkGAgICAAU8NAiAGQQR0EAshCAsgCCAEQQR0aiIEIQIgAUEHcSIHBEADQCACQv////8PNwIIIAJCADcCACACQRBqIQIgBUEBaiIFIAdHDQALCyABQQR0IARqIQUgAUEBa0H/////AHFBB08EQANAIAJC/////w83AnggAkIANwJwIAJC/////w83AmggAkIANwJgIAJC/////w83AlggAkIANwJQIAJC/////w83AkggAkIANwJAIAJC/////w83AjggAkIANwIwIAJC/////w83AiggAkIANwIgIAJC/////w83AhggAkIANwIQIAJC/////w83AgggAkIANwIAIAJBgAFqIgIgBUcNAAsLIAAoAgAiASADRwRAA0AgBEEQayIEIANBEGsiA/0AAgD9CwIAIAEgA0cNAAsgACgCACEDCyAAIAggBkEEdGo2AgggACAFNgIEIAAgBDYCACADBEAgAxAMCw8LEBMACxASAAuLAwEHfyABIAAoAggiAiAAKAIEIgNrQcgAbU0EQCAAIAEEfyADQQAgAUHIAGxByABrIgAgAEHIAHBrQcgAaiIAEAcgAGoFIAMLNgIEDwsCQCADIAAoAgAiBmtByABtIgggAWoiBEHk8bgcSQRAQePxuBwgAiAGa0HIAG0iB0EBdCICIAQgAiAESxsgB0HxuJwOTxsiBARAIARB5PG4HE8NAiAEQcgAbBALIQULIAUgCEHIAGxqIgJBACABQcgAbEHIAGsiASABQcgAcGtByABqIgcQByIBIAdqIQggBSAEQcgAbGohBwJAIAMgBkYEQCABIQUMAQsDQCACQcgAayIFIANByABrIgH9AAMA/QsDACACQThrIANBOGv9AAMA/QsDACACQShrIANBKGv9AAMA/QsDACACQRhrIANBGGv9AAMA/QsDACACQQhrIANBCGsrAwA5AwAgBSECIAEiAyAGRw0ACwsgACAHNgIIIAAgCDYCBCAAIAU2AgAgBgRAIAYQDAsPCxATAAsQEgALGQEBf0GgKygCACIBIAAgASgCACgCGBEBAAsQACMAIABrQXBxIgAkACAACwcAIAAoAgQLBQBBowkLBQBBzQkLBQBBkAkLFwEBf0GgKygCACIAIAAoAgAoAhQRAAALFQAgAEUEQEEADwsgAEHkJhAiQQBHCxoAIAAgASgCCCAFEAoEQCABIAIgAyAEECALCzcAIAAgASgCCCAFEAoEQCABIAIgAyAEECAPCyAAKAIIIgAgASACIAMgBCAFIAAoAgAoAhQRCQALpwEAIAAgASgCCCAEEAoEQAJAIAEoAgQgAkcNACABKAIcQQFGDQAgASADNgIcCw8LAkAgACABKAIAIAQQCkUNAAJAIAIgASgCEEcEQCABKAIUIAJHDQELIANBAUcNASABQQE2AiAPCyABIAI2AhQgASADNgIgIAEgASgCKEEBajYCKAJAIAEoAiRBAUcNACABKAIYQQJHDQAgAUEBOgA2CyABQQQ2AiwLC4gCACAAIAEoAgggBBAKBEACQCABKAIEIAJHDQAgASgCHEEBRg0AIAEgAzYCHAsPCwJAIAAgASgCACAEEAoEQAJAIAIgASgCEEcEQCABKAIUIAJHDQELIANBAUcNAiABQQE2AiAPCyABIAM2AiACQCABKAIsQQRGDQAgAUEAOwE0IAAoAggiACABIAIgAkEBIAQgACgCACgCFBEJACABLQA1BEAgAUEDNgIsIAEtADRFDQEMAwsgAUEENgIsCyABIAI2AhQgASABKAIoQQFqNgIoIAEoAiRBAUcNASABKAIYQQJHDQEgAUEBOgA2DwsgACgCCCIAIAEgAiADIAQgACgCACgCGBEGAAsLMQAgACABKAIIQQAQCgRAIAEgAiADECEPCyAAKAIIIgAgASACIAMgACgCACgCHBEHAAsYACAAIAEoAghBABAKBEAgASACIAMQIQsLFwEBf0GgKygCACIAIAAoAgAoAhARAAALnAEBAn8jAEFAaiIDJAACf0EBIAAgAUEAEAoNABpBACABRQ0AGkEAIAFBhCYQIiIBRQ0AGiADQQxqQQBBNBAHGiADQQE2AjggA0F/NgIUIAMgADYCECADIAE2AgggASADQQhqIAIoAgBBASABKAIAKAIcEQcAIAMoAi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AAU3QxMWxvZ2ljX2Vycm9yAKATAACgFAAAQBQAAAAAAADkFAAAAgAAACsAAAAqAAAAU3QxMmxlbmd0aF9lcnJvcgAAAACgEwAA0BQAALAUAABTdDl0eXBlX2luZm8AAAAAeBMAAPAUAEGIKgsBBQBBlCoLARMAQawqCw4UAAAAFQAAALgVAAAABABBxCoLAQEAQdQqCwX/////CgBBmCsLA3AcAQ==",ce(Re)||(Re=g(Re));function ge(V){if(V==Re&&y)return new Uint8Array(y);var L=k(V);if(L)return L;if(m)return m(V);throw"both async and sync fetching of the wasm failed"}function Se(V){return Promise.resolve().then(()=>ge(V))}function Ie(V,L,te){return Se(V).then(ke=>WebAssembly.instantiate(ke,L)).then(te,ke=>{C(`failed to asynchronously prepare wasm: ${ke}`),q(ke)})}function Me(V,L,te,ke){return Ie(L,te,ke)}function ze(){var V={a:pp};function L(ke,Ze){return Ot=ke.exports,E=Ot.f,Z(),ee(Ot.g),Ke(),Ot}Ne();function te(ke){L(ke.instance)}if(t.instantiateWasm)try{return t.instantiateWasm(V,L)}catch(ke){C(`Module.instantiateWasm callback failed with error: ${ke}`),r(ke)}return Me(y,Re,V,te).catch(r),{}}function Vt(V){this.name="ExitStatus",this.message=`Program terminated with exit(${V})`,this.status=V}var ut=V=>{for(;V.length>0;)V.shift()(t)};t.noExitRuntime;class ir{constructor(L){this.excPtr=L,this.ptr=L-24}set_type(L){M[this.ptr+4>>2]=L}get_type(){return M[this.ptr+4>>2]}set_destructor(L){M[this.ptr+8>>2]=L}get_destructor(){return M[this.ptr+8>>2]}set_caught(L){L=L?1:0,I[this.ptr+12]=L}get_caught(){return I[this.ptr+12]!=0}set_rethrown(L){L=L?1:0,I[this.ptr+13]=L}get_rethrown(){return I[this.ptr+13]!=0}init(L,te){this.set_adjusted_ptr(0),this.set_type(L),this.set_destructor(te)}set_adjusted_ptr(L){M[this.ptr+16>>2]=L}get_adjusted_ptr(){return M[this.ptr+16>>2]}get_exception_ptr(){var L=su(this.get_type());if(L)return M[this.excPtr>>2];var te=this.get_adjusted_ptr();return te!==0?te:this.excPtr}}var ka=0,Ga=(V,L,te)=>{var ke=new ir(V);throw ke.init(L,te),ka=V,ka},za=()=>{q("")},ta=(V,L,te)=>T.copyWithin(V,L,L+te),Wa=()=>2147483648,ua=V=>{var L=E.buffer,te=(V-L.byteLength+65535)/65536;try{return E.grow(te),Z(),1}catch{}},Mt=V=>{var L=T.length;V>>>=0;var te=Wa();if(V>te)return!1;for(var ke=(wa,bi)=>wa+(bi-wa%bi)%bi,Ze=1;Ze<=4;Ze*=2){var st=L*(1+.2/Ze);st=Math.min(st,V+100663296);var Ye=Math.min(te,ke(Math.max(V,st),65536)),We=ua(Ye);if(We)return!0}return!1},Ea=[null,[],[]],ba=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Lr=(V,L,te)=>{for(var ke=L+te,Ze=L;V[Ze]&&!(Ze>=ke);)++Ze;if(Ze-L>16&&V.buffer&&ba)return ba.decode(V.subarray(L,Ze));for(var st="";L<Ze;){var Ye=V[L++];if(!(Ye&128)){st+=String.fromCharCode(Ye);continue}var We=V[L++]&63;if((Ye&224)==192){st+=String.fromCharCode((Ye&31)<<6|We);continue}var wa=V[L++]&63;if((Ye&240)==224?Ye=(Ye&15)<<12|We<<6|wa:Ye=(Ye&7)<<18|We<<12|wa<<6|V[L++]&63,Ye<65536)st+=String.fromCharCode(Ye);else{var bi=Ye-65536;st+=String.fromCharCode(55296|bi>>10,56320|bi&1023)}}return st},Gr=(V,L)=>{var te=Ea[V];L===0||L===10?((V===1?v:C)(Lr(te,0)),te.length=0):te.push(L)},zr=(V,L,te,ke)=>{for(var Ze=0,st=0;st<te;st++){var Ye=M[L>>2],We=M[L+4>>2];L+=8;for(var wa=0;wa<We;wa++)Gr(V,T[Ye+wa]);Ze+=We}return M[ke>>2]=Ze,0},Wr=V=>{Q=V,l(V,new Vt(V))},Jr=(V,L)=>{Q=V,Wr(V)},hp=V=>{if(V instanceof Vt||V=="unwind")return Q;l(1,V)},up=V=>{for(var L=0,te=0;te<V.length;++te){var ke=V.charCodeAt(te);ke<=127?L++:ke<=2047?L+=2:ke>=55296&&ke<=57343?(L+=4,++te):L+=3}return L},bp=(V,L,te,ke)=>{if(!(ke>0))return 0;for(var Ze=te,st=te+ke-1,Ye=0;Ye<V.length;++Ye){var We=V.charCodeAt(Ye);if(We>=55296&&We<=57343){var wa=V.charCodeAt(++Ye);We=65536+((We&1023)<<10)|wa&1023}if(We<=127){if(te>=st)break;L[te++]=We}else if(We<=2047){if(te+1>=st)break;L[te++]=192|We>>6,L[te++]=128|We&63}else if(We<=65535){if(te+2>=st)break;L[te++]=224|We>>12,L[te++]=128|We>>6&63,L[te++]=128|We&63}else{if(te+3>=st)break;L[te++]=240|We>>18,L[te++]=128|We>>12&63,L[te++]=128|We>>6&63,L[te++]=128|We&63}}return L[te]=0,te-Ze},gp=(V,L,te)=>bp(V,T,L,te),mp=V=>{var L=up(V)+1,te=Zo(L);return gp(V,te,L),te},pp={b:Ga,c:za,e:ta,d:Mt,a:zr},Ot=ze();t._initialize=(V,L,te)=>(t._initialize=Ot.h)(V,L,te),t._allocMatrix=V=>(t._allocMatrix=Ot.i)(V),t._getMatrixBufferPtr=()=>(t._getMatrixBufferPtr=Ot.j)(),t._getSRTPtr=()=>(t._getSRTPtr=Ot.k)(),t._getInfoPtr=()=>(t._getInfoPtr=Ot.l)(),t._getContinuedSRTPtr=()=>(t._getContinuedSRTPtr=Ot.m)(),t._printMatrix=V=>(t._printMatrix=Ot.n)(V),t._updateAllMatrixContinueTransform=(V,L,te)=>(t._updateAllMatrixContinueTransform=Ot.o)(V,L,te);var nu=t._main=(V,L)=>(nu=t._main=Ot.p)(V,L),Zo=V=>(Zo=Ot.r)(V),su=V=>(su=Ot.s)(V),jn;De=function V(){jn||ou(),jn||(De=V)};function Ap(V=[]){var L=nu;V.unshift(o);var te=V.length,ke=Zo((te+1)*4),Ze=ke;V.forEach(Ye=>{M[Ze>>2]=mp(Ye),Ze+=4}),M[Ze>>2]=0;try{var st=L(te,ke);return Jr(st,!0),st}catch(Ye){return hp(Ye)}}function ou(V=n){if(fe>0||(H(),fe>0))return;function L(){jn||(jn=!0,t.calledRun=!0,!S&&(O(),ie(),a(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),lu&&Ap(V),W()))}t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),L()},1)):L()}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();var lu=!0;return t.noInitialRun&&(lu=!1),ou(),e.ready})})();function fr(s,e,t){return _.setting.doublePrecision?new Float64Array(s,e,t):new Float32Array(s,e,t)}class Ee{static matrixBuffer;static matrixSRTBuffer;static matrixContinuedSRTBuffer;static matrixStateBuffer;static matrixBufferPtr;static matrixSRTBufferPtr;static matrixContinuedSRTBufferPtr;static matrixStateBufferPtr;static wasm;static stateStruct=4;static useDoublePrecision=!1;static async init(e,t=!1){this.wasm=await Au(),this.useDoublePrecision=t,this.wasm._initialize(e,t,0),this.allocMatrix(e)}static allocMatrix(e){e>R.maxCount&&console.error(`The maximum allocation size is exceeded! current:${e}, limit:${R.maxCount}`),this.wasm._allocMatrix(e),this.matrixBufferPtr=this.wasm._getMatrixBufferPtr(),this.matrixSRTBufferPtr=this.wasm._getSRTPtr(),this.matrixStateBufferPtr=this.wasm._getInfoPtr(),this.matrixContinuedSRTBufferPtr=this.wasm._getContinuedSRTPtr(),this.useDoublePrecision?(this.matrixBuffer=fr(this.wasm.HEAPF64.buffer,this.matrixBufferPtr,16*e),this.matrixSRTBuffer=fr(this.wasm.HEAPF64.buffer,this.matrixSRTBufferPtr,9*e),this.matrixContinuedSRTBuffer=fr(this.wasm.HEAPF64.buffer,this.matrixContinuedSRTBufferPtr,9*e),R.blockBytes=R.block*8):(this.matrixBuffer=fr(this.wasm.HEAPF32.buffer,this.matrixBufferPtr,16*e),this.matrixSRTBuffer=fr(this.wasm.HEAPF32.buffer,this.matrixSRTBufferPtr,9*e),this.matrixContinuedSRTBuffer=fr(this.wasm.HEAPF32.buffer,this.matrixContinuedSRTBufferPtr,9*e),R.blockBytes=R.block*4),this.matrixStateBuffer=new Int32Array(this.wasm.HEAP32.buffer,this.matrixStateBufferPtr,Ee.stateStruct*e),R.allocMatrix(e)}static updateAllContinueTransform(e,t,a){this.wasm._updateAllMatrixContinueTransform(e,t,a)}static setParent(e,t,a){this.matrixStateBuffer[e*Ee.stateStruct+2]=t>=0?t:-1,this.matrixStateBuffer[e*Ee.stateStruct+3]=a}static setTranslate(e,t,a,r){this.matrixSRTBuffer[e*9+6]=t,this.matrixSRTBuffer[e*9+7]=a,this.matrixSRTBuffer[e*9+8]=r}static setRotation(e,t,a,r){this.matrixSRTBuffer[e*9+3]=t%360,this.matrixSRTBuffer[e*9+4]=a%360,this.matrixSRTBuffer[e*9+5]=r%360}static setScale(e,t,a,r){this.matrixSRTBuffer[e*9+0]=t,this.matrixSRTBuffer[e*9+1]=a,this.matrixSRTBuffer[e*9+2]=r}static setContinueTranslate(e,t,a,r){(t!=0||a!=0||r!=0)&&(this.matrixContinuedSRTBuffer[e*9+6]=t,this.matrixContinuedSRTBuffer[e*9+7]=a,this.matrixContinuedSRTBuffer[e*9+8]=r,this.matrixStateBuffer[e*Ee.stateStruct+1]=1)}static setContinueRotation(e,t,a,r){(t!=0||a!=0||r!=0)&&(this.matrixContinuedSRTBuffer[e*9+3]=t,this.matrixContinuedSRTBuffer[e*9+4]=a,this.matrixContinuedSRTBuffer[e*9+5]=r,this.matrixStateBuffer[e*Ee.stateStruct+1]=1)}static setContinueScale(e,t,a,r){(t!=0||a!=0||r!=0)&&(this.matrixContinuedSRTBuffer[e*9+0]=t,this.matrixContinuedSRTBuffer[e*9+1]=a,this.matrixContinuedSRTBuffer[e*9+2]=r,this.matrixStateBuffer[e*Ee.stateStruct+1]=1)}}class ia{static AXIS_ANGLE="axisAngle";static EULER_ANGLES="eulerAngles";static QUATERNION="quaternion"}class ae{static HELP_0=new ae(0,0,0,1);static HELP_1=new ae(0,0,0,1);static HELP_2=new ae(0,0,0,1);static _zero=new ae(0,0,0,1);static CALCULATION_QUATERNION=new ae;x=0;y=0;z=0;w=1;constructor(e=0,t=0,a=0,r=1){this.x=e,this.y=t,this.z=a,this.w=r}static identity(){return ae._zero}static quaternionToMatrix(e,t){let a=e.x*2,r=e.y*2,i=e.z*2,n=e.x*a,o=e.y*r,l=e.z*i,c=e.x*r,f=e.x*i,h=e.y*i,u=e.w*a,g=e.w*r,A=e.w*i;t.rawData[0]=1-(o+l),t.rawData[1]=c+A,t.rawData[2]=f-g,t.rawData[3]=0,t.rawData[4]=c-A,t.rawData[5]=1-(n+l),t.rawData[6]=h+u,t.rawData[7]=0,t.rawData[8]=f+g,t.rawData[9]=h-u,t.rawData[10]=1-(n+o),t.rawData[11]=0,t.rawData[12]=0,t.rawData[13]=0,t.rawData[14]=0,t.rawData[15]=1}get magnitude(){return Math.sqrt(this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z)}set(e=0,t=0,a=0,r=1){return this.x=e,this.y=t,this.z=a,this.w=r,this}divide(e){return e instanceof ae?new ae(this.x/e.x,this.y/e.y,this.z/e.z):(this.x=this.x/e,this.y=this.y/e,this.z=this.z/e,this)}setFromArray(e){return this.x=e[0],this.y=e[1],this.z=e[2],this.w=e[3],this}multiply(e,t){var a=e.w,r=e.x,i=e.y,n=e.z,o=t.w,l=t.x,c=t.y,f=t.z;this.w=a*o-r*l-i*c-n*f,this.x=a*l+r*o+i*f-n*c,this.y=a*c-r*f+i*o+n*l,this.z=a*f+r*c-i*l+n*o}multiplyVector(e,t=null){t||=new ae;var a=e.x,r=e.y,i=e.z;return t.w=-this.x*a-this.y*r-this.z*i,t.x=this.w*a+this.y*i-this.z*r,t.y=this.w*r-this.x*i+this.z*a,t.z=this.w*i+this.x*r-this.y*a,t}fromAxisAngle(e,t){t*=Math.PI/180;var a=t*.5,r=Math.sin(a);this.w=Math.cos(a),this.x=e.x*r,this.y=e.y*r,this.z=e.z*r,this.normalize()}toAxisAngle(e){var t=this.x*this.x+this.y*this.y+this.z*this.z,a=0;return t>0?(a=2*Math.acos(this.w),t=1/Math.sqrt(t),e.x=this.x*t,e.y=this.y*t,e.z=this.z*t):(a=0,e.x=1,e.y=0,e.z=0),a}slerp(e,t,a){var r=e.w,i=e.x,n=e.y,o=e.z,l=t.w,c=t.x,f=t.y,h=t.z,u=r*l+i*c+n*f+o*h;if(u<0&&(u=-u,l=-l,c=-c,f=-f,h=-h),u<.95){var g=Math.acos(u),A=1/Math.sin(g),m=Math.sin(g*(1-a))*A,p=Math.sin(g*a)*A;this.w=r*m+l*p,this.x=i*m+c*p,this.y=n*m+f*p,this.z=o*m+h*p}else{this.w=r+a*(l-r),this.x=i+a*(c-i),this.y=n+a*(f-n),this.z=o+a*(h-o);var D=1/Math.sqrt(this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z);this.w*=D,this.x*=D,this.y*=D,this.z*=D}}lerp(e,t,a){var r=e.w,i=e.x,n=e.y,o=e.z,l=t.w,c=t.x,f=t.y,h=t.z,u;r*l+i*c+n*f+o*h<0&&(l=-l,c=-c,f=-f,h=-h),this.w=r+a*(l-r),this.x=i+a*(c-i),this.y=n+a*(f-n),this.z=o+a*(h-o),u=1/Math.sqrt(this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z),this.w*=u,this.x*=u,this.y*=u,this.z*=u}fromEulerAngles(e,t,a){e*=pt,t*=pt,a*=pt;var r=e*.5,i=t*.5,n=a*.5,o=Math.cos(r),l=Math.sin(r),c=Math.cos(i),f=Math.sin(i),h=Math.cos(n),u=Math.sin(n);return this.w=o*c*h+l*f*u,this.x=l*c*h-o*f*u,this.y=o*f*h+l*c*u,this.z=o*c*u-l*f*h,this}setFromRotationMatrix(e){const t=e.rawData,a=t[0],r=t[4],i=t[8],n=t[1],o=t[5],l=t[9],c=t[2],f=t[6],h=t[10],u=a+o+h;if(u>0){const g=.5/Math.sqrt(u+1);this.w=.25/g,this.x=(f-l)*g,this.y=(i-c)*g,this.z=(n-r)*g}else if(a>o&&a>h){const g=2*Math.sqrt(1+a-o-h);this.w=(f-l)/g,this.x=.25*g,this.y=(r+n)/g,this.z=(i+c)/g}else if(o>h){const g=2*Math.sqrt(1+o-a-h);this.w=(i-c)/g,this.x=(r+n)/g,this.y=.25*g,this.z=(l+f)/g}else{const g=2*Math.sqrt(1+h-a-o);this.w=(n-r)/g,this.x=(i+c)/g,this.y=(l+f)/g,this.z=.25*g}return this}getEulerAngles(e){var t,a,r,i,n,o,l,c;return e||=new b,i=this.x,n=this.y,o=this.z,l=this.w,c=2*(l*n-i*o),c<=-.99999?(t=2*Math.atan2(i,l),a=-Math.PI/2,r=0):c>=.99999?(t=2*Math.atan2(i,l),a=Math.PI/2,r=0):(t=Math.atan2(2*(l*i+n*o),1-2*(i*i+n*n)),a=Math.asin(c),r=Math.atan2(2*(l*o+i*n),1-2*(n*n+o*o))),e.set(t,a,r).scaleBy(Yr)}normalize(e=1){var t=e/Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);this.x*=t,this.y*=t,this.z*=t,this.w*=t}toString(){return"{x:"+this.x+" y:"+this.y+" z:"+this.z+" w:"+this.w+"}"}fromMatrix(e){var t=e.decompose(ia.QUATERNION)[1];this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w}inverse(e=null){e||=new ae;var t=this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z;if(t>0){var a=1/t;e.w=this.w*a,e.x=-this.x*a,e.y=-this.y*a,e.z=-this.z*a}return e}clone(){return new ae(this.x,this.y,this.z,this.w)}transformVector(e,t=null){var a,r,i,n,o=e.x,l=e.y,c=e.z;return t||=new b,n=-this.x*o-this.y*l-this.z*c,a=this.w*o+this.y*c-this.z*l,r=this.w*l-this.x*c+this.z*o,i=this.w*c+this.x*l-this.y*o,t.x=-n*this.x+a*this.w-r*this.z+i*this.y,t.y=-n*this.y+a*this.z+r*this.w-i*this.x,t.z=-n*this.z-a*this.y+r*this.x+i*this.w,t}copyFrom(e){var t=this;return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,this}mul(e,t,a){let r=a||new ae;return r.x=e.w*t.x+e.x*t.w+e.y*t.z-e.z*t.y,r.y=e.w*t.y+e.y*t.w+e.z*t.x-e.x*t.z,r.z=e.w*t.z+e.z*t.w+e.x*t.y-e.y*t.x,r.w=e.w*t.w-e.x*t.x-e.y*t.y-e.z*t.z,r}clampf(e,t,a){if(t>a){var r=t;t=a,a=r}return e<t?t:e<a?e:a}static serialize(e){return new ae(e.x,e.y,e.z,e.w)}}function Du(s,e,t){let a=s.x*2,r=s.y*2,i=s.z*2,n=s.x*a,o=s.y*r,l=s.z*i,c=s.x*r,f=s.x*i,h=s.y*i,u=s.w*a,g=s.w*r,A=s.w*i,m=t||new b;return m.x=(1-(o+l))*e.x+(c-A)*e.y+(f+g)*e.z,m.y=(c+A)*e.x+(1-(n+l))*e.y+(h-u)*e.z,m.z=(f-g)*e.x+(h+u)*e.y+(1-(n+o))*e.z,m}class pi{_x=0;_y=0;_z=0;_w=0;constructor(e=0){this.seed=e}get seed(){return this._x}set seed(e){this._x=e,this._y=this._x*1812433253+1,this._z=this._y*1812433253+1,this._w=this._z*1812433253+1}static getFloatFromInt(e){return Math.floor((e&8388607)*(1/8388607))}static getByteFromInt(e){return e>>15}clone(){let e=new pi;return e._x=this._x,e._y=this._y,e._z=this._z,e._w=this._w,e}get(){let e=this._x^this._x<<11;return this._x=this._y,this._y=this._z,this._z=this._w,this._w=this._w^this._w>>19^(e^e>>8)}getFloat(){return lc(this.get())}getSignedFloat(){return this.getFloat()*2-1}}let Yr=180/Math.PI,pt=Math.PI/180,_u=2147483647,Bu=-2147483647;function Ae(s,e,t){return Math.max(e,Math.min(t,s))}class Pt{static gaussFunction(e,t,a,r){let i=Math.pow(e-a,2),n=2*Math.pow(r,2),o=-1*(i/n),l=Math.pow(Math.E,o);return Math.round(l*t)}static computeGaussian(e,t){return 1/Math.sqrt(2*Math.PI*t)*Math.exp(-(e*e)/(2*t*t))}static gaussCoef(e){e<.5&&(e=.5);let t=Math.exp(.726*.726)/e,a=Math.exp(-t),r=Math.exp(-2*t),i=(1-a)*(1-a)/(1+2*t*a-r),n=i,o=i*(t-1)*a,l=i*(t+1)*a,c=-i*r,f=2*a,h=-r,u=(n+o)/(1-f-h),g=(l+c)/(1-f-h);return new Float32Array([n,o,l,c,f,h,u,g])}static clampf(e,t,a){if(t>a){let r=t;t=a,a=r}return e<t?t:e<a?e:a}static normalizeAngle(e){for(;e>180;)e-=360;for(;e<-180;)e+=360;return e}static fract(e){return e-Math.floor(e)}static getRandDirXZ(e){let t=e*Math.random(),a=360*Math.random()*pt,r=Math.cos(a)*t,i=Math.sin(a)*t;return{x:r,z:i}}static getRandDirXYZ(e){let t=e*Math.random(),a=360*Math.random()*pt,r=Math.cos(a)*t,i=Math.tan(a)*t,n=Math.sin(a)*t;return new b(r,i,n)}static getCycleXYZ(e){let t=e*Math.random(),a=360*Math.random()*pt,r=Math.cos(a)*t,i=e*Math.random()-e*.5,n=Math.sin(a)*t;return new b(r,i,n)}static angle(e,t){let a=de.HELP_0,r=de.HELP_1;return a.set(e.x,e.z),r.set(t.x,t.z),Math.acos((a.x*r.x+a.y*r.y)/(a.abs()*r.abs()))}static angle_360(e,t){let a=b.HELP_0;return e.crossProduct(t,a),a.z>0?Pt.angle(e,t):360-Pt.angle(e,t)}getRotationY(e){return Pt.normalizeAngle(Math.atan2(e.z,e.x)*Yr)}static fromToRotation(e,t,a=null){a||=new ae;let r=R.help_matrix_2;return R.fromToRotation(e,t,r),a.fromMatrix(r),a}static getEularDir_yUp(e){let t=ae.HELP_0;return t.fromEulerAngles(0,e,0),t.transformVector(b.Z_AXIS,b.HELP_5),b.HELP_5}static transformVector(e,t,a=null){a||=new b;let r=e.rawData,i=r[0],n=r[1],o=r[2],l=r[3],c=r[4],f=r[5],h=r[6],u=r[7],g=r[8],A=r[9],m=r[10],p=r[11],D=r[12],B=r[13],v=r[14],C=r[15],y=t.x,x=t.y,k=t.z;return a.x=i*y+c*x+g*k+D,a.y=n*y+f*x+A*k+B,a.z=o*y+h*x+m*k+v,a.w=l*y+u*x+p*k+C,a}}let Sr=function(s,e,t){return s*(1-t)+e*t};function vu(s,e,t){let a=new b,r=s.x,i=s.y,n=s.z,o=s.w,l=e.x,c=e.y,f=e.z,h=e.w;return a.x=(l-r)*t+r,a.y=(c-i)*t+i,a.z=(f-n)*t+n,a.w=(h-o)*t+o,a}function Uu(s,e,t){let a=new J;return a.r=(1-t)*s.r+t*e.r,a.g=(1-t)*s.g+t*e.g,a.b=(1-t)*s.b+t*e.b,a.a=(1-t)*s.a+t*e.a,a}function yu(s,e,t){return s+((e-s)*t>>8)&255}let rs=function(s,e,t){let a=t-e;return Math.floor(s/a)%2==0?s%a+e:t-s%a+e},is=function(s,e,t){let a=t-e;return s%a+e},Cu=function(s,e){let t=0;for(let a in s)a==e&&t++;return t};class Su{x=0;y=0;z=0;w=0;randSeedList;constructor(){this.randSeedList=[]}reset(){this.x=Math.random()*1,this.y=Math.random()*1,this.z=Math.random()*1,this.w=Math.random()*1,this.randSeedList.length=0;for(let e=0;e<20;e++)this.randSeedList.push(Math.random()*1)}}function xt(s,e){return s instanceof b&&e instanceof b||s instanceof ae&&e instanceof ae?s.x*e.x+s.y*e.y+s.z*e.z:s.x*e.x+s.y*e.y}function ns(s,e){return new b(s.x*e.x,s.y*e.y,s.z*e.z)}function sc(s){return Math.sqrt(s)}function ss(s){return sc(xt(s,s))}function oc(s,e){if(ss(s)>b.EPSILON)return s.divide(ss(s));if(s instanceof de)return new de;if(s instanceof b)return new b;if(s instanceof ae)return new ae}function lc(s){return(s&8388607)*(1/8388607)}function Xr(s){return s.getFloat()}function At(s,e,t){let a=s.getFloat();return a=e*a+(1-a)*t,a}function xu(s,e,t){let a;if(e<t){a=t-e;let r=s.get()%a;return r+=e,r}else if(e>t){a=e-t;let r=s.get()%a;return r=e-r,r}else return e}function ln(s){let e=At(s,-1,1),t=At(s,0,2*Math.PI),a=Math.sqrt(1-e*e),r=a*Math.cos(t),i=a*Math.sin(t);return new b(r,i,e)}function cc(s){let e=At(s,0,2*Math.PI),t=Math.cos(e),a=Math.sin(e);return new de(t,a)}function Fu(s){let e=new ae;return e.x=At(s,-1,1),e.y=At(s,-1,1),e.z=At(s,-1,1),e.w=At(s,-1,1),e=oc(e),xt(e,ae.identity())<0?-e:e}function ku(s){const e=2*Math.PI;let t=At(s,0,1),a=At(s,0,e),r=At(s,0,e),i=Math.sqrt(1-t),n=Math.sqrt(t),o=new ae(i*Math.sin(a),i*Math.cos(a),n*Math.sin(r),n*Math.cos(r));return xt(o,ae.identity())<0?-o:o}function Eu(s,e){return new b(At(s,-e.x,e.x),At(s,-e.y,e.y),At(s,-e.z,e.z))}function fc(s){let e=ln(s);return e.scaleBy(Math.pow(Xr(s),1/3)),e}function wu(s,e){return ns(fc(s),e)}function Ru(s,e,t){let a=ln(s),r=Math.pow(At(s,0,1),1/3);return a.scaleBy(e+(t-e)*r),a}function Iu(s){let e=cc(s);return e.multiply(Math.pow(At(s,0,1),1/2),e),e}function Qu(s,e,t){let a=ns(ln(s),e),r=Math.pow(At(s,t,1),1/3);return a.scaleBy(r),a}function Tu(s){let e=s.getFloat(),t=s.getFloat();e+t>1&&(e=1-e,t=1-t);let a=1-e-t;return new b(e,t,a)}function Mu(s){return s/360*2*Math.PI}function Nu(s){return 180*s/Math.PI}function Pu(s){return Math.sin(s)}function Vu(s){return Math.cos(s)}d.randomSeed=4919;function Ou(){return++d.randomSeed}function Lu(s,e,t){let a=s[e],r=s[t];s[e]=r,s[t]=a}function dc(s){return Math.floor(s)}function os(s){return dc(s+.5)}function Gu(s){return s=Math.max(s,0),s=Math.min(s,1),os(s*65535)}function zu(s){return s=Math.max(s,0),s=Math.min(s,1),os(s*255)}function hc(s){return Math.abs(s)==0?s:1/Math.sqrt(s)}function Wu(s){let e=ls(s);return s.scaleBy(hc(e))}function Ju(s,e){return s.crossProduct(e)}function ls(s){return xt(s,s)}function ju(s){let e=new pi(s);return Xr(e)}function Zu(s,e){let t=new pi(e);s.x=Xr(t),s.y=Xr(t),s.z=Xr(t)}function Yu(s,e,t){return s<e?t:s>t?e:s}function cs(s,e){return s-Math.floor(s/e)*e}const Xu=1e-6;class R{static blockBytes=64;static block=16;static allocCount=1e3;static allocOnceCount=1e3;static maxCount=50*1e4;static useCount=0;static buffer;static wasmMatrixPtr=0;static dynamicMatrixBytes;static dynamicGlobalMatrixRef;static wasm;static help_matrix_0;static help_matrix_1;static help_matrix_2;static helpMatrix;static helpMatrix2;static _getEulerMatrix;static _zero=new b(0,0,0);static _one=new b(1,1,1);static _prs=[new b,new b,new b];index=0;offset=0;rawData;_position;static allocMatrix(e){this.allocCount=e,R.dynamicMatrixBytes=Ee.matrixBuffer,R.buffer=R.dynamicMatrixBytes.buffer,R.wasmMatrixPtr=Ee.matrixBufferPtr,this.dynamicGlobalMatrixRef||=[],this.dynamicGlobalMatrixRef.forEach(t=>{t.offset=R.wasmMatrixPtr+t.index*R.blockBytes,t.rawData=fr(R.dynamicMatrixBytes.buffer,t.offset,16)}),R.help_matrix_0||=new R,R.help_matrix_1||=new R,R.help_matrix_2||=new R,R.helpMatrix||=new R,R.helpMatrix2||=new R,R._getEulerMatrix||=new R,R._getEulerMatrix.identity()}static fromToRotation(e,t,a){return a||=new R,a.transformDir(e,t),a}static fromArray(e){if(e.length!==16)throw new Error("Array must contain exactly 16 elements");const t=new R;for(let a=0;a<16;a++)t.rawData[a]=e[a];return t}static getAxisRotation(e,t,a,r){let i=new R,n=r*(Math.PI/180),o=Math.cos(n),l=Math.sin(n),c=1-o,f,h;return i.rawData[0]=o+e*e*c,i.rawData[5]=o+t*t*c,i.rawData[10]=o+a*a*c,f=e*t*c,h=a*l,i.rawData[1]=f+h,i.rawData[4]=f-h,f=e*a*c,h=t*l,i.rawData[8]=f+h,i.rawData[2]=f-h,f=t*a*c,h=e*l,i.rawData[9]=f-h,i.rawData[6]=f+h,i}static sanitizeEuler(e){R.makePositive(e)}static makePositive(e){let t=-1e-4,a=Math.PI*2-1e-4;e.x<t?e.x+=2*Math.PI:e.x>a&&(e.x-=2*Math.PI),e.y<t?e.y+=2*Math.PI:e.y>a&&(e.y-=2*Math.PI),e.z<t?e.z+=2*Math.PI:e.z>a&&(e.z-=2*Math.PI)}static matrixToEuler(e,t){return e.get(1,2)<.999?e.get(1,2)>-.999?(t.x=Math.asin(-e.get(1,2)),t.y=Math.atan2(e.get(0,2),e.get(2,2)),t.z=Math.atan2(e.get(1,0),e.get(1,1)),R.sanitizeEuler(t),!0):(t.x=Math.PI*.5,t.y=Math.atan2(e.get(0,1),e.get(0,0)),t.z=0,R.sanitizeEuler(t),!1):(t.x=-Math.PI*.5,t.y=Math.atan2(-e.get(0,1),e.get(0,0)),t.z=0,R.sanitizeEuler(t),!1)}static matrixMultiply(e,t,a){R.wasm.Matrix_Multiply(e.index,t.index,a.index)}static matrixAppend(e,t,a){R.wasm.Matrix_Append(e.index,t.index,a.index)}static matrixRotateY(e,t){R.wasm.Matrix_Append(e,t.index)}static matrixRotate(e,t,a){R.wasm.Matrix_Rotate(e,t,a.index)}constructor(e=!1){if(R.useCount>=R.allocCount){let t=R.allocCount+R.allocOnceCount;Ee.allocMatrix(t)}this.index=R.useCount,this.offset=R.wasmMatrixPtr+this.index*R.blockBytes,R.dynamicGlobalMatrixRef[this.index]=this,R.useCount++,this.rawData=fr(R.dynamicMatrixBytes.buffer,this.offset,16),this._position=new b,this.identity()}lookAt(e,t,a=b.Y_AXIS){let r=this.rawData,i=t.subtract(e,b.HELP_0);i.length===0&&(i.z=1),i.normalize();let n=a.crossProduct(i,b.HELP_1);n.length===0&&(Math.abs(a.z)===1?i.x+=1e-4:i.z-=1e-4,i.normalize(),n=a.crossProduct(i,b.HELP_1)),n.normalize();let o=i.crossProduct(n,b.HELP_2);r[0]=n.x,r[1]=o.x,r[2]=i.x,r[3]=0,r[4]=n.y,r[5]=o.y,r[6]=i.y,r[7]=0,r[8]=n.z,r[9]=o.z,r[10]=i.z,r[11]=0,r[12]=-n.dotProduct(e),r[13]=-o.dotProduct(e),r[14]=-i.dotProduct(e),r[15]=1}static floatArray=new Float64Array(16).fill(0);multiply(e){let t=this.rawData,a=e.rawData,r=R.floatArray;r[0]=t[0]*a[0]+t[1]*a[4]+t[2]*a[8]+t[3]*a[12],r[1]=t[0]*a[1]+t[1]*a[5]+t[2]*a[9]+t[3]*a[13],r[2]=t[0]*a[2]+t[1]*a[6]+t[2]*a[10]+t[3]*a[14],r[3]=t[0]*a[3]+t[1]*a[7]+t[2]*a[11]+t[3]*a[15],r[4]=t[4]*a[0]+t[5]*a[4]+t[6]*a[8]+t[7]*a[12],r[5]=t[4]*a[1]+t[5]*a[5]+t[6]*a[9]+t[7]*a[13],r[6]=t[4]*a[2]+t[5]*a[6]+t[6]*a[10]+t[7]*a[14],r[7]=t[4]*a[3]+t[5]*a[7]+t[6]*a[11]+t[7]*a[15],r[8]=t[8]*a[0]+t[9]*a[4]+t[10]*a[8]+t[11]*a[12],r[9]=t[8]*a[1]+t[9]*a[5]+t[10]*a[9]+t[11]*a[13],r[10]=t[8]*a[2]+t[9]*a[6]+t[10]*a[10]+t[11]*a[14],r[11]=t[8]*a[3]+t[9]*a[7]+t[10]*a[11]+t[11]*a[15],r[12]=t[12]*a[0]+t[13]*a[4]+t[14]*a[8]+t[15]*a[12],r[13]=t[12]*a[1]+t[13]*a[5]+t[14]*a[9]+t[15]*a[13],r[14]=t[12]*a[2]+t[13]*a[6]+t[14]*a[10]+t[15]*a[14],r[15]=t[12]*a[3]+t[13]*a[7]+t[14]*a[11]+t[15]*a[15],t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]}multiplyMatrices(e,t){const a=e.rawData,r=t.rawData,i=this.rawData,n=a[0],o=a[4],l=a[8],c=a[12],f=a[1],h=a[5],u=a[9],g=a[13],A=a[2],m=a[6],p=a[10],D=a[14],B=a[3],v=a[7],C=a[11],y=a[15],x=r[0],k=r[4],E=r[8],S=r[12],Q=r[1],I=r[5],T=r[9],M=r[13],Z=r[2],be=r[6],re=r[10],P=r[14],z=r[3],H=r[7],O=r[11],ie=r[15];return i[0]=n*x+o*Q+l*Z+c*z,i[4]=n*k+o*I+l*be+c*H,i[8]=n*E+o*T+l*re+c*O,i[12]=n*S+o*M+l*P+c*ie,i[1]=f*x+h*Q+u*Z+g*z,i[5]=f*k+h*I+u*be+g*H,i[9]=f*E+h*T+u*re+g*O,i[13]=f*S+h*M+u*P+g*ie,i[2]=A*x+m*Q+p*Z+D*z,i[6]=A*k+m*I+p*be+D*H,i[10]=A*E+m*T+p*re+D*O,i[14]=A*S+m*M+p*P+D*ie,i[3]=B*x+v*Q+C*Z+y*z,i[7]=B*k+v*I+C*be+y*H,i[11]=B*E+v*T+C*re+y*O,i[15]=B*S+v*M+C*P+y*ie,this}multiplyPoint3(e,t){t||=new b;let a=this.rawData;return t.x=a[0]*e.x+a[4]*e.y+a[8]*e.z+a[12],t.y=a[1]*e.x+a[5]*e.y+a[9]*e.z+a[13],t.z=a[2]*e.x+a[6]*e.y+a[10]*e.z+a[14],t}multiplyVector4(e,t){t||=new b;let a=this.rawData,r=e.x,i=e.y,n=e.z,o=a[3]*r+a[7]*i+a[11]*n+a[15];return o=o||1,t.x=(a[0]*r+a[4]*i+a[8]*n+a[12])/o,t.y=(a[1]*r+a[5]*i+a[9]*n+a[13])/o,t.z=(a[2]*r+a[6]*i+a[10]*n+a[14])/o,t.w=1,t}transformVector4(e,t){let a=this.rawData;t||=new b;let r=e.x,i=e.y,n=e.z,o=e.w;return t.x=r*a[0]+i*a[4]+n*a[8]+o*a[12],t.y=r*a[1]+i*a[5]+n*a[9]+o*a[13],t.z=r*a[2]+i*a[6]+n*a[10]+o*a[14],t.w=r*a[3]+i*a[7]+n*a[11]+o*a[15],t}perspectiveMultiplyPoint3(e,t){let a=b.HELP_2,r,i=this.rawData;if(a.x=i[0]*e.x+i[4]*e.y+i[8]*e.z+i[12],a.y=i[1]*e.x+i[5]*e.y+i[9]*e.z+i[13],a.z=i[2]*e.x+i[6]*e.y+i[10]*e.z+i[14],r=i[3]*e.x+i[7]*e.y+i[11]*e.z+i[15],Math.abs(r)>1e-7){let n=1/r;return t.x=a.x*n,t.y=a.y*n,t.z=a.z*n,!0}else return t.x=0,t.y=0,t.z=0,!1}perspective(e,t,a,r){let i=this.rawData,n=e*pt/2,o=Math.cos(n)/Math.sin(n);i[0]=-o/t,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=r/(r-a),i[11]=1,i[12]=0,i[13]=0,i[14]=-a*r/(r-a),i[15]=0}perspective3(e,t,a,r){let i=Math.tan(e*Math.PI/360)*a,n=i*t;this.frustum(-n,n,-i,i,a,r)}frustum(e,t,a,r,i,n){let o=this.rawData;o[0]=-2*i/(t-e),o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*i/(r-a),o[6]=0,o[7]=0,o[8]=(t+e)/(t-e),o[9]=(r+a)/(r-a),o[10]=n/(n-i),o[11]=1,o[12]=0,o[13]=0,o[14]=-n*i/(n-i),o[15]=0}ortho(e,t,a,r){let i=this.rawData;return i[0]=2/e,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=2/t,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1/(r-a),i[11]=0,i[12]=0,i[13]=0,i[14]=a/(a-r),i[15]=1,this}orthoZO(e,t,a,r,i,n){let o=this.rawData,l=1/(e-t),c=1/(a-r),f=1/(i-n);return o[0]=-2*l,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*c,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=f,o[11]=0,o[12]=(e+t)*l,o[13]=(r+a)*c,o[14]=i*f,o[15]=1,this}orthoOffCenter(e,t,a,r,i,n){let o=this.rawData;o[0]=2/(t-e),o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2/(r-a),o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1/(n-i),o[11]=0,o[12]=(e+t)/(e-t),o[13]=(r+a)/(a-r),o[14]=i/(i-n),o[15]=1}transformDir(e,t){let a=this.rawData,r=1e-6,i=b.ZERO;t.crossProduct(e,i);let n=t.dotProduct(e);if(n>1-r)this.identity();else if(n<-1+r){let o=b.HELP_1,l=b.HELP_2,c=0,f,h,u,g,A,m,p,D,B,v,C,y,x,k,E,S,Q,I;l.x=0,l.y=e.z,l.z=-e.y,l.dotProduct(l)<r&&(l.x=-e.z,l.y=0,l.z=e.x),c=1/Math.sqrt(l.dotProduct(l)),l.x*=c,l.y*=c,l.z*=c,l.crossProduct(e,o),f=-e.x*e.x,h=-e.y*e.y,u=-e.z*e.z,g=-e.x*e.y,A=-e.x*e.z,m=-e.y*e.z,p=o.x*o.x,D=o.y*o.y,B=o.z*o.z,v=o.x*o.y,C=o.x*o.z,y=o.y*o.z,x=-l.x*l.x,k=-l.y*l.y,E=-l.z*l.z,S=-l.x*l.y,Q=-l.x*l.z,I=-l.y*l.z,a[0]=f+p+x,a[1]=g+v+S,a[2]=A+C+Q,a[4]=a[1],a[5]=h+D+k,a[6]=m+y+I,a[8]=a[2],a[9]=a[6],a[10]=u+B+E,a[3]=0,a[7]=0,a[11]=0,a[15]=1}else{let o,l,c,f,h,u=i.dotProduct(i),g=(1-n)/u;o=g*i.x,l=g*i.z,c=o*i.y,f=o*i.z,h=l*i.y,a[0]=n+o*i.x,a[1]=c-i.z,a[2]=f+i.y,a[4]=c+i.z,a[5]=n+g*i.y*i.y,a[6]=h-i.x,a[8]=f-i.y,a[9]=h+i.x,a[10]=n+l*i.z,a[3]=0,a[7]=0,a[11]=0,a[15]=1}return this}append(e){let t=this.rawData,a=t[0],r=t[4],i=t[8],n=t[12],o=t[1],l=t[5],c=t[9],f=t[13],h=t[2],u=t[6],g=t[10],A=t[14],m=t[3],p=t[7],D=t[11],B=t[15];t[0]=a*e.rawData[0]+o*e.rawData[4]+h*e.rawData[8]+m*e.rawData[12],t[1]=a*e.rawData[1]+o*e.rawData[5]+h*e.rawData[9]+m*e.rawData[13],t[2]=a*e.rawData[2]+o*e.rawData[6]+h*e.rawData[10]+m*e.rawData[14],t[3]=a*e.rawData[3]+o*e.rawData[7]+h*e.rawData[11]+m*e.rawData[15],t[4]=r*e.rawData[0]+l*e.rawData[4]+u*e.rawData[8]+p*e.rawData[12],t[5]=r*e.rawData[1]+l*e.rawData[5]+u*e.rawData[9]+p*e.rawData[13],t[6]=r*e.rawData[2]+l*e.rawData[6]+u*e.rawData[10]+p*e.rawData[14],t[7]=r*e.rawData[3]+l*e.rawData[7]+u*e.rawData[11]+p*e.rawData[15],t[8]=i*e.rawData[0]+c*e.rawData[4]+g*e.rawData[8]+D*e.rawData[12],t[9]=i*e.rawData[1]+c*e.rawData[5]+g*e.rawData[9]+D*e.rawData[13],t[10]=i*e.rawData[2]+c*e.rawData[6]+g*e.rawData[10]+D*e.rawData[14],t[11]=i*e.rawData[3]+c*e.rawData[7]+g*e.rawData[11]+D*e.rawData[15],t[12]=n*e.rawData[0]+f*e.rawData[4]+A*e.rawData[8]+B*e.rawData[12],t[13]=n*e.rawData[1]+f*e.rawData[5]+A*e.rawData[9]+B*e.rawData[13],t[14]=n*e.rawData[2]+f*e.rawData[6]+A*e.rawData[10]+B*e.rawData[14],t[15]=n*e.rawData[3]+f*e.rawData[7]+A*e.rawData[11]+B*e.rawData[15]}add(e){let t=this.rawData,a=t[0],r=t[4],i=t[8],n=t[12],o=t[1],l=t[5],c=t[9],f=t[13],h=t[2],u=t[6],g=t[10],A=t[14],m=t[3],p=t[7],D=t[11],B=t[15],v=e.rawData[0],C=e.rawData[4],y=e.rawData[8],x=e.rawData[12],k=e.rawData[1],E=e.rawData[5],S=e.rawData[9],Q=e.rawData[13],I=e.rawData[2],T=e.rawData[6],M=e.rawData[10],Z=e.rawData[14],be=e.rawData[3],re=e.rawData[7],P=e.rawData[11],z=e.rawData[15];return t[0]=a+v,t[1]=o+k,t[2]=h+I,t[3]=m+be,t[4]=r+C,t[5]=l+E,t[6]=u+T,t[7]=p+re,t[8]=i+y,t[9]=c+S,t[10]=g+M,t[11]=D+P,t[12]=n+x,t[13]=f+Q,t[14]=A+Z,t[15]=B+z,this}sub(e){let t=this.rawData,a=t[0],r=t[4],i=t[8],n=t[12],o=t[1],l=t[5],c=t[9],f=t[13],h=t[2],u=t[6],g=t[10],A=t[14],m=t[3],p=t[7],D=t[11],B=t[15],v=e.rawData[0],C=e.rawData[4],y=e.rawData[8],x=e.rawData[12],k=e.rawData[1],E=e.rawData[5],S=e.rawData[9],Q=e.rawData[13],I=e.rawData[2],T=e.rawData[6],M=e.rawData[10],Z=e.rawData[14],be=e.rawData[3],re=e.rawData[7],P=e.rawData[11],z=e.rawData[15];return t[0]=a-v,t[1]=o-k,t[2]=h-I,t[3]=m-be,t[4]=r-C,t[5]=l-E,t[6]=u-T,t[7]=p-re,t[8]=i-y,t[9]=c-S,t[10]=g-M,t[11]=D-P,t[12]=n-x,t[13]=f-Q,t[14]=A-Z,t[15]=B-z,this}mult(e){let t=this.rawData;return t[0]*=e,t[1]*=e,t[2]*=e,t[3]*=e,t[4]*=e,t[5]*=e,t[6]*=e,t[7]*=e,t[8]*=e,t[9]*=e,t[10]*=e,t[11]*=e,t[12]*=e,t[13]*=e,t[14]*=e,t[15]*=e,this}appendRotation(e,t){let a=R.getAxisRotation(t.x,t.y,t.z,e);this.append(a)}createByRotation(e,t){let a=R.helpMatrix,r,i,n=e*pt;return r=Math.sin(n),i=Math.cos(n),t.x==1&&(a.rawData[0]=1,a.rawData[1]=0,a.rawData[2]=0,a.rawData[3]=0,a.rawData[4]=0,a.rawData[5]=i,a.rawData[6]=r,a.rawData[7]=0,a.rawData[8]=0,a.rawData[9]=-r,a.rawData[10]=i,a.rawData[11]=0,a.rawData[12]=0,a.rawData[13]=0,a.rawData[14]=0,a.rawData[15]=1),t.y==1&&(a.rawData[0]=i,a.rawData[1]=0,a.rawData[2]=-r,a.rawData[3]=0,a.rawData[4]=0,a.rawData[5]=1,a.rawData[6]=0,a.rawData[7]=0,a.rawData[8]=r,a.rawData[9]=0,a.rawData[10]=i,a.rawData[11]=0,a.rawData[12]=0,a.rawData[13]=0,a.rawData[14]=0,a.rawData[15]=1),t.z==1&&(a.rawData[0]=i,a.rawData[1]=r,a.rawData[2]=0,a.rawData[3]=0,a.rawData[4]=-r,a.rawData[5]=i,a.rawData[6]=0,a.rawData[7]=0,a.rawData[8]=0,a.rawData[9]=0,a.rawData[10]=1,a.rawData[11]=0,a.rawData[12]=0,a.rawData[13]=0,a.rawData[14]=0,a.rawData[15]=1),this.append(a),this}appendScale(e,t,a){R.helpMatrix.createByScale(e,t,a),this.append(R.helpMatrix)}createByScale(e,t,a){let r=this.rawData;r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1}appendTranslation(e,t,a){let r=this.rawData;r[12]+=e,r[13]+=t,r[14]+=a}clone(){let e=new R;return e.copyFrom(this),e}copyRowFrom(e,t){let a=this.rawData;switch(e){case 0:a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=t.w;break;case 1:a[4]=t.x,a[5]=t.y,a[6]=t.z,a[7]=t.w;break;case 2:a[8]=t.x,a[9]=t.y,a[10]=t.z,a[11]=t.w;break;case 3:a[12]=t.x,a[13]=t.y,a[14]=t.z,a[15]=t.w;break}}copyRowTo(e,t){let a=this.rawData;switch(e){case 0:t.x=a[0],t.y=a[1],t.z=a[2],t.w=a[3];break;case 1:t.x=a[4],t.y=a[5],t.z=a[6],t.w=a[7];break;case 2:t.x=a[8],t.y=a[9],t.z=a[10],t.w=a[11];break;case 3:t.x=a[12],t.y=a[13],t.z=a[14],t.w=a[15];break}}copyFrom(e){let t=this.rawData;return t[0]=e.rawData[0],t[1]=e.rawData[1],t[2]=e.rawData[2],t[3]=e.rawData[3],t[4]=e.rawData[4],t[5]=e.rawData[5],t[6]=e.rawData[6],t[7]=e.rawData[7],t[8]=e.rawData[8],t[9]=e.rawData[9],t[10]=e.rawData[10],t[11]=e.rawData[11],t[12]=e.rawData[12],t[13]=e.rawData[13],t[14]=e.rawData[14],t[15]=e.rawData[15],this}copyRawDataTo(e,t=0,a=!1){let r=this.rawData;e[0+t]=r[0],e[1+t]=r[1],e[2+t]=r[2],e[3+t]=r[3],e[4+t]=r[4],e[5+t]=r[5],e[6+t]=r[6],e[7+t]=r[7],e[8+t]=r[8],e[9+t]=r[9],e[10+t]=r[10],e[11+t]=r[11],e[12+t]=r[12],e[13+t]=r[13],e[14+t]=r[14],e[15+t]=r[15]}copyColFrom(e,t){let a=this.rawData;switch(e){case 0:a[0]=t.x,a[4]=t.y,a[8]=t.z,a[12]=t.w;break;case 1:a[1]=t.x,a[5]=t.y,a[9]=t.z,a[13]=t.w;break;case 2:a[2]=t.x,a[6]=t.y,a[10]=t.z,a[14]=t.w;break;case 3:a[3]=t.x,a[7]=t.y,a[11]=t.z,a[15]=t.w;break}}copyColTo(e,t){let a=this.rawData;switch(e){case 0:t.x=a[0],t.y=a[4],t.z=a[8],t.w=a[12];break;case 1:t.x=a[1],t.y=a[5],t.z=a[9],t.w=a[13];break;case 2:t.x=a[2],t.y=a[6],t.z=a[10],t.w=a[14];break;case 3:t.x=a[3],t.y=a[7],t.z=a[11],t.w=a[15];break}}copyToMatrix3D(e){e.rawData=this.rawData.slice(0)}makeRotationFromQuaternion(e){return this.compose(R._zero,e,R._one),this}static decomposeRawData=new Float64Array(16).fill(0);decompose(e="eulerAngles",t){let a=ae.CALCULATION_QUATERNION,r=t||R._prs;this.copyRawDataTo(R.decomposeRawData);let i=R.decomposeRawData,n=r[0];n.x=i[12],n.y=i[13],n.z=i[14],i[12]=0,i[13]=0,i[14]=0;let o=r[2];o.x=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]),o.y=Math.sqrt(i[4]*i[4]+i[5]*i[5]+i[6]*i[6]),o.z=Math.sqrt(i[8]*i[8]+i[9]*i[9]+i[10]*i[10]),i[0]*(i[5]*i[10]-i[6]*i[9])-i[1]*(i[4]*i[10]-i[6]*i[8])+i[2]*(i[4]*i[9]-i[5]*i[8])<0&&(o.z=-o.z),i[0]/=o.x,i[1]/=o.x,i[2]/=o.x,i[4]/=o.y,i[5]/=o.y,i[6]/=o.y,i[8]/=o.z,i[9]/=o.z,i[10]/=o.z;let l=r[1],c;switch(e){case ia.AXIS_ANGLE:l.w=Math.acos((i[0]+i[5]+i[10]-1)/2);let f=Math.sqrt((i[6]-i[9])*(i[6]-i[9])+(i[8]-i[2])*(i[8]-i[2])+(i[1]-i[4])*(i[1]-i[4]));l.x=(i[6]-i[9])/f,l.y=(i[8]-i[2])/f,l.z=(i[1]-i[4])/f;break;case ia.QUATERNION:c=i[0]+i[5]+i[10],c>0?(l.w=Math.sqrt(1+c)/2,l.x=(i[6]-i[9])/(4*l.w),l.y=(i[8]-i[2])/(4*l.w),l.z=(i[1]-i[4])/(4*l.w)):i[0]>i[5]&&i[0]>i[10]?(l.x=Math.sqrt(1+i[0]-i[5]-i[10])/2,l.w=(i[6]-i[9])/(4*l.x),l.y=(i[1]+i[4])/(4*l.x),l.z=(i[8]+i[2])/(4*l.x)):i[5]>i[10]?(l.y=Math.sqrt(1+i[5]-i[0]-i[10])/2,l.x=(i[1]+i[4])/(4*l.y),l.w=(i[8]-i[2])/(4*l.y),l.z=(i[6]+i[9])/(4*l.y)):(l.z=Math.sqrt(1+i[10]-i[0]-i[5])/2,l.x=(i[8]+i[2])/(4*l.z),l.y=(i[6]+i[9])/(4*l.z),l.w=(i[1]-i[4])/(4*l.z));break;case ia.EULER_ANGLES:c=i[0]+i[5]+i[10],c>0?(a.w=Math.sqrt(1+c)/2,a.x=(i[6]-i[9])/(4*a.w),a.y=(i[8]-i[2])/(4*a.w),a.z=(i[1]-i[4])/(4*a.w)):i[0]>i[5]&&i[0]>i[10]?(a.x=Math.sqrt(1+i[0]-i[5]-i[10])/2,a.w=(i[6]-i[9])/(4*a.x),a.y=(i[1]+i[4])/(4*a.x),a.z=(i[8]+i[2])/(4*a.x)):i[5]>i[10]?(l.y=Math.sqrt(1+i[5]-i[0]-i[10])/2,a.x=(i[1]+i[4])/(4*a.y),a.w=(i[8]-i[2])/(4*a.y),a.z=(i[6]+i[9])/(4*a.y)):(a.z=Math.sqrt(1+i[10]-i[0]-i[5])/2,a.x=(i[8]+i[2])/(4*a.z),a.y=(i[6]+i[9])/(4*a.z),a.w=(i[1]-i[4])/(4*a.z)),a.getEulerAngles(l);break}return r[0]=n,r[1]=l,r[2]=o,r}static getEuler(e,t,a=!0,r){return e||=new b,R._getEulerMatrix.makeRotationFromQuaternion(t).makeEuler(e,a,r),e}compose(e,t,a){const r=this.rawData,i=t.x,n=t.y,o=t.z,l=t.w,c=i+i,f=n+n,h=o+o,u=i*c,g=i*f,A=i*h,m=n*f,p=n*h,D=o*h,B=l*c,v=l*f,C=l*h,y=a.x,x=a.y,k=a.z;return r[0]=(1-(m+D))*y,r[1]=(g+C)*y,r[2]=(A-v)*y,r[3]=0,r[4]=(g-C)*x,r[5]=(1-(u+D))*x,r[6]=(p+B)*x,r[7]=0,r[8]=(A+v)*k,r[9]=(p-B)*k,r[10]=(1-(u+m))*k,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}deltaTransformVector(e,t){t||=new b;let a=this.rawData,r=e.x,i=e.y,n=e.z;return t.x=r*a[0]+i*a[4]+n*a[8],t.y=r*a[1]+i*a[5]+n*a[9],t.z=r*a[2]+i*a[6]+n*a[10],t.w=r*a[3]+i*a[7]+n*a[11],t}identity(){let e=this.rawData;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}fill(e){let t=this.rawData;t[1]=e,t[2]=e,t[3]=e,t[4]=e,t[6]=e,t[7]=e,t[8]=e,t[9]=e,t[11]=e,t[12]=e,t[13]=e,t[14]=e,t[0]=e,t[5]=e,t[10]=e,t[15]=e}invers33(){let e=this.rawData,t=e[5]*e[10]-e[9]*e[6],a=e[8]*e[6]-e[4]*e[10],r=e[4]*e[9]-e[8]*e[5],i=e[9]*e[2]-e[1]*e[10],n=e[0]*e[10]-e[8]*e[2],o=e[8]*e[1]-e[0]*e[9],l=e[1]*e[6]-e[5]*e[2],c=e[4]*e[2]-e[0]*e[6],f=e[0]*e[5]-e[4]*e[1],h=e[0]*t+e[4]*i+e[8]*l;if(Math.abs(h)>1e-11){let u=1/h;e[0]=u*t,e[4]=u*a,e[8]=u*r,e[1]=u*i,e[5]=u*n,e[9]=u*o,e[2]=u*l,e[6]=u*c,e[10]=u*f}}invert(){let e=this.determinant,t=Math.abs(e)>1e-11,a=this.rawData;if(t){e=1/e;let r=a[0],i=a[4],n=a[8],o=a[12],l=a[1],c=a[5],f=a[9],h=a[13],u=a[2],g=a[6],A=a[10],m=a[14],p=a[3],D=a[7],B=a[11],v=a[15];a[0]=e*(c*(A*v-m*B)-f*(g*v-m*D)+h*(g*B-A*D)),a[1]=-e*(l*(A*v-m*B)-f*(u*v-m*p)+h*(u*B-A*p)),a[2]=e*(l*(g*v-m*D)-c*(u*v-m*p)+h*(u*D-g*p)),a[3]=-e*(l*(g*B-A*D)-c*(u*B-A*p)+f*(u*D-g*p)),a[4]=-e*(i*(A*v-m*B)-n*(g*v-m*D)+o*(g*B-A*D)),a[5]=e*(r*(A*v-m*B)-n*(u*v-m*p)+o*(u*B-A*p)),a[6]=-e*(r*(g*v-m*D)-i*(u*v-m*p)+o*(u*D-g*p)),a[7]=e*(r*(g*B-A*D)-i*(u*B-A*p)+n*(u*D-g*p)),a[8]=e*(i*(f*v-h*B)-n*(c*v-h*D)+o*(c*B-f*D)),a[9]=-e*(r*(f*v-h*B)-n*(l*v-h*p)+o*(l*B-f*p)),a[10]=e*(r*(c*v-h*D)-i*(l*v-h*p)+o*(l*D-c*p)),a[11]=-e*(r*(c*B-f*D)-i*(l*B-f*p)+n*(l*D-c*p)),a[12]=-e*(i*(f*m-h*A)-n*(c*m-h*g)+o*(c*A-f*g)),a[13]=e*(r*(f*m-h*A)-n*(l*m-h*u)+o*(l*A-f*u)),a[14]=-e*(r*(c*m-h*g)-i*(l*m-h*u)+o*(l*g-c*u)),a[15]=e*(r*(c*A-f*g)-i*(l*A-f*u)+n*(l*g-c*u))}return t}transformPoint(e,t){let a=this.rawData;t||=new b;let r=e.x,i=e.y,n=e.z;return t.x=r*a[0]+i*a[4]+n*a[8]+a[12],t.y=r*a[1]+i*a[5]+n*a[9]+a[13],t.z=r*a[2]+i*a[6]+n*a[10]+a[14],t}transformVector(e,t){let a=this.rawData;t||=new b;let r=e.x,i=e.y,n=e.z;return t.x=r*a[0]+i*a[4]+n*a[8],t.y=r*a[1]+i*a[5]+n*a[9],t.z=r*a[2]+i*a[6]+n*a[10],t}transpose(){let e=this.rawData;for(let t=0;t<R.helpMatrix.rawData.length;t++)R.helpMatrix.rawData[t]=e[t];e[1]=R.helpMatrix.rawData[4],e[2]=R.helpMatrix.rawData[8],e[3]=R.helpMatrix.rawData[12],e[4]=R.helpMatrix.rawData[1],e[6]=R.helpMatrix.rawData[9],e[7]=R.helpMatrix.rawData[13],e[8]=R.helpMatrix.rawData[2],e[9]=R.helpMatrix.rawData[6],e[11]=R.helpMatrix.rawData[14],e[12]=R.helpMatrix.rawData[3],e[13]=R.helpMatrix.rawData[7],e[14]=R.helpMatrix.rawData[11]}get determinant(){let e=this.rawData;return(e[0]*e[5]-e[4]*e[1])*(e[10]*e[15]-e[14]*e[11])-(e[0]*e[9]-e[8]*e[1])*(e[6]*e[15]-e[14]*e[7])+(e[0]*e[13]-e[12]*e[1])*(e[6]*e[11]-e[10]*e[7])+(e[4]*e[9]-e[8]*e[5])*(e[2]*e[15]-e[14]*e[3])-(e[4]*e[13]-e[12]*e[5])*(e[2]*e[11]-e[10]*e[3])+(e[8]*e[13]-e[12]*e[9])*(e[2]*e[7]-e[6]*e[3])}getPosition(e){e||=new b;let t=this.rawData;return e.x=t[12],e.y=t[13],e.z=t[14],e}get position(){return this._position.set(this.rawData[12],this.rawData[13],this.rawData[14]),this._position}set position(e){let t=this.rawData;t[12]=e.x,t[13]=e.y,t[14]=e.z}get scale(){let e=this.rawData;return new b(e[0],e[5],e[10])}set scale(e){let t=this.rawData;t[0]=e.x,t[5]=e.y,t[10]=e.z}toString(){let e=this.rawData;return"matrix3d("+Math.round(e[0]*1e3)/1e3+","+Math.round(e[1]*1e3)/1e3+","+Math.round(e[2]*1e3)/1e3+","+Math.round(e[3]*1e3)/1e3+","+Math.round(e[4]*1e3)/1e3+","+Math.round(e[5]*1e3)/1e3+","+Math.round(e[6]*1e3)/1e3+","+Math.round(e[7]*1e3)/1e3+","+Math.round(e[8]*1e3)/1e3+","+Math.round(e[9]*1e3)/1e3+","+Math.round(e[10]*1e3)/1e3+","+Math.round(e[11]*1e3)/1e3+","+Math.round(e[12]*1e3)/1e3+","+Math.round(e[13]*1e3)/1e3+","+Math.round(e[14]*1e3)/1e3+","+Math.round(e[15]*1e3)/1e3+")"}lerp(e,t,a){this.copyFrom(t).sub(e).mult(a).add(e)}get(e,t){return this.rawData[e+t*4]}set(e,t,a){this.rawData[e+t*4]=a}getMaxScaleOnAxis(){let e=this.rawData,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],a=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,a,r))}translate(e){let t=this.get(0,0)*e.x+this.get(0,1)*e.y+this.get(0,2)*e.z+this.get(0,3),a=this.get(1,0)*e.x+this.get(1,1)*e.y+this.get(1,2)*e.z+this.get(1,3),r=this.get(2,0)*e.x+this.get(2,1)*e.y+this.get(2,2)*e.z+this.get(2,3),i=this.get(3,0)*e.x+this.get(3,1)*e.y+this.get(3,2)*e.z+this.get(3,3);return this.set(0,3,t),this.set(1,3,a),this.set(2,3,r),this.set(3,3,i),this}setTRInverse(e,t){t=t.inverse(),ae.quaternionToMatrix(t,this),this.translate(new b(-e.x,-e.y,-e.z))}setScale(e){return this.set(0,0,e.x),this.set(0,1,0),this.set(0,2,0),this.set(0,3,0),this.set(1,0,0),this.set(1,1,e.y),this.set(1,2,0),this.set(1,3,0),this.set(2,0,0),this.set(2,1,0),this.set(2,2,e.z),this.set(2,3,0),this.set(3,0,0),this.set(3,1,0),this.set(3,2,0),this.set(3,3,1),this}makeBasis(e,t,a){return this.setElements(e.x,t.x,a.x,0,e.y,t.y,a.y,0,e.z,t.z,a.z,0,0,0,0,1),this}makeRotationAxis(e,t){const a=Math.cos(t),r=Math.sin(t),i=1-a,n=e.x,o=e.y,l=e.z,c=i*n,f=i*o;return this.setElements(c*n+a,c*o-r*l,c*l+r*o,0,c*o+r*l,f*o+a,f*l-r*n,0,c*l-r*o,f*l+r*n,i*l*l+a,0,0,0,0,1),this}static transpose(e,t){t||=new R;let a=e.rawData,r=t.rawData;return r[0]=a[0],r[1]=a[4],r[2]=a[8],r[3]=a[12],r[4]=a[1],r[5]=a[5],r[6]=a[9],r[7]=a[13],r[8]=a[2],r[9]=a[6],r[10]=a[10],r[11]=a[14],r[12]=a[3],r[13]=a[7],r[14]=a[11],r[15]=a[15],t}static inverse(e,t){t||=new R;let a=e.rawData,r=t.rawData;r[0]=a[5]*a[10]*a[15]-a[5]*a[14]*a[11]-a[6]*a[9]*a[15]+a[6]*a[13]*a[11]+a[7]*a[9]*a[14]-a[7]*a[13]*a[10],r[1]=-a[1]*a[10]*a[15]+a[1]*a[14]*a[11]+a[2]*a[9]*a[15]-a[2]*a[13]*a[11]-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-a[5]*a[12]*a[10]-a[6]*a[8]*a[13]+a[6]*a[12]*a[9],r[13]=a[0]*a[9]*a[14]-a[0]*a[13]*a[10]-a[1]*a[8]*a[14]+a[1]*a[12]*a[10]+a[2]*a[8]*a[13]-a[2]*a[12]*a[9],r[14]=-a[0]*a[5]*a[14]+a[0]*a[13]*a[6]+a[1]*a[4]*a[14]-a[1]*a[12]*a[6]-a[2]*a[4]*a[13]+a[2]*a[12]*a[5],r[15]=a[0]*a[5]*a[10]-a[0]*a[9]*a[6]-a[1]*a[4]*a[10]+a[1]*a[8]*a[6]+a[2]*a[4]*a[9]-a[2]*a[8]*a[5];let i=a[0]*r[0]+a[1]*r[4]+a[2]*r[8]+a[3]*r[12];for(let n=0;n<16;n++)r[n]/=i;return t}makeEuler(e,t,a="XYZ"){const r=this.rawData,i=r[0],n=r[4],o=r[8],l=r[1],c=r[5],f=r[9],h=r[2],u=r[6],g=r[10];switch(a){case"XYZ":e.y=Math.asin(Ae(o,-1,1)),Math.abs(o)<.9999999?(e.x=Math.atan2(-f,g),e.z=Math.atan2(-n,i)):(e.x=Math.atan2(u,c),e.z=0);break;case"YXZ":e.x=Math.asin(-Ae(f,-1,1)),Math.abs(f)<.9999999?(e.y=Math.atan2(o,g),e.z=Math.atan2(l,c)):(e.y=Math.atan2(-h,i),e.z=0);break;case"ZXY":e.x=Math.asin(Ae(u,-1,1)),Math.abs(u)<.9999999?(e.y=Math.atan2(-h,g),e.z=Math.atan2(-n,c)):(e.y=0,e.z=Math.atan2(l,i));break;case"ZYX":e.y=Math.asin(-Ae(h,-1,1)),Math.abs(h)<.9999999?(e.x=Math.atan2(u,g),e.z=Math.atan2(l,i)):(e.x=0,e.z=Math.atan2(-n,c));break;case"YZX":e.z=Math.asin(Ae(l,-1,1)),Math.abs(l)<.9999999?(e.x=Math.atan2(-f,c),e.y=Math.atan2(-h,i)):(e.x=0,e.y=Math.atan2(o,g));break;case"XZY":e.z=Math.asin(-Ae(n,-1,1)),Math.abs(n)<.9999999?(e.x=Math.atan2(u,c),e.y=Math.atan2(o,i)):(e.x=Math.atan2(-f,g),e.y=0);break}return t&&e.multiplyScalar(Yr),e}setElements(e,t,a,r,i,n,o,l,c,f,h,u,g,A,m,p){const D=this.rawData;return D[0]=e,D[4]=t,D[8]=a,D[12]=r,D[1]=i,D[5]=n,D[9]=o,D[13]=l,D[2]=c,D[6]=f,D[10]=h,D[14]=u,D[3]=g,D[7]=A,D[11]=m,D[15]=p,this}makeMatrix44ByQuaternion(e,t,a){this.identity(),ae.quaternionToMatrix(a,this),this.appendTranslation(e.x,e.y,e.z),this.appendScale(t.x,t.y,t.z)}}function uc(s,e,t){for(let a=0;a<4;a++)t.rawData[a]=s.rawData[a]*e.rawData[0]+s.rawData[a+4]*e.rawData[1]+s.rawData[a+8]*e.rawData[2]+s.rawData[a+12]*e.rawData[3],t.rawData[a+4]=s.rawData[a]*e.rawData[4]+s.rawData[a+4]*e.rawData[5]+s.rawData[a+8]*e.rawData[6]+s.rawData[a+12]*e.rawData[7],t.rawData[a+8]=s.rawData[a]*e.rawData[8]+s.rawData[a+4]*e.rawData[9]+s.rawData[a+8]*e.rawData[10]+s.rawData[a+12]*e.rawData[11],t.rawData[a+12]=s.rawData[a]*e.rawData[12]+s.rawData[a+4]*e.rawData[13]+s.rawData[a+8]*e.rawData[14]+s.rawData[a+12]*e.rawData[15]}function cn(s,e,t,a){let r=a.rawData,i=s.x*pt,n=s.y*pt,o=s.z*pt,l=0,c=i*.5,f=n*.5,h=o*.5,u=Math.cos(c),g=Math.sin(c),A=Math.cos(f),m=Math.sin(f),p=Math.cos(h),D=Math.sin(h);l=u*A*p+g*m*D,i=g*A*p-u*m*D,n=u*m*p+g*A*D,o=u*A*D-g*m*p;let B=i+i,v=n+n,C=o+o,y=i*B,x=i*v,k=i*C,E=n*v,S=n*C,Q=o*C,I=l*B,T=l*v,M=l*C,Z=t.x,be=t.y,re=t.z;r[0]=(1-(E+Q))*Z,r[1]=(x+M)*Z,r[2]=(k-T)*Z,r[3]=0,r[4]=(x-M)*be,r[5]=(1-(y+Q))*be,r[6]=(S+I)*be,r[7]=0,r[8]=(k+T)*re,r[9]=(S-I)*re,r[10]=(1-(y+E))*re,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1}function bc(s,e,t){let a=s.rawData,r=t.rawData,i=a[0],n=a[4],o=a[8],l=a[12],c=a[1],f=a[5],h=a[9],u=a[13],g=a[2],A=a[6],m=a[10],p=a[14],D=a[3],B=a[7],v=a[11],C=a[15];r[0]=i*e.rawData[0]+c*e.rawData[4]+g*e.rawData[8]+D*e.rawData[12],r[1]=i*e.rawData[1]+c*e.rawData[5]+g*e.rawData[9]+D*e.rawData[13],r[2]=i*e.rawData[2]+c*e.rawData[6]+g*e.rawData[10]+D*e.rawData[14],r[3]=i*e.rawData[3]+c*e.rawData[7]+g*e.rawData[11]+D*e.rawData[15],r[4]=n*e.rawData[0]+f*e.rawData[4]+A*e.rawData[8]+B*e.rawData[12],r[5]=n*e.rawData[1]+f*e.rawData[5]+A*e.rawData[9]+B*e.rawData[13],r[6]=n*e.rawData[2]+f*e.rawData[6]+A*e.rawData[10]+B*e.rawData[14],r[7]=n*e.rawData[3]+f*e.rawData[7]+A*e.rawData[11]+B*e.rawData[15],r[8]=o*e.rawData[0]+h*e.rawData[4]+m*e.rawData[8]+v*e.rawData[12],r[9]=o*e.rawData[1]+h*e.rawData[5]+m*e.rawData[9]+v*e.rawData[13],r[10]=o*e.rawData[2]+h*e.rawData[6]+m*e.rawData[10]+v*e.rawData[14],r[11]=o*e.rawData[3]+h*e.rawData[7]+m*e.rawData[11]+v*e.rawData[15],r[12]=l*e.rawData[0]+u*e.rawData[4]+p*e.rawData[8]+C*e.rawData[12],r[13]=l*e.rawData[1]+u*e.rawData[5]+p*e.rawData[9]+C*e.rawData[13],r[14]=l*e.rawData[2]+u*e.rawData[6]+p*e.rawData[10]+C*e.rawData[14],r[15]=l*e.rawData[3]+u*e.rawData[7]+p*e.rawData[11]+C*e.rawData[15]}function Hu(s,e){let t=e.x,a=e.y,r=e.z,i=e.w,n=s.rawData,o=2*t*a,l=2*t*r,c=2*t*i,f=2*a*r,h=2*a*i,u=2*r*i,g=t*t,A=a*a,m=r*r,p=i*i;return n[0]=g-A-m+p,n[4]=o-u,n[8]=l+h,n[12]=0,n[1]=o+u,n[5]=-g+A-m+p,n[9]=f-c,n[13]=0,n[2]=l-h,n[6]=f+c,n[10]=-g-A+m+p,n[14]=0,n[3]=0,n[7]=0,n[11]=0,n[15]=1,s}function Ku(s,e){let t=e.rawData,a=Math.sin(s),r=Math.cos(s);return t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[8]=a,t[9]=0,t[10]=r,t[11]=0,t}function qu(s,e,t){let a=e.x,r=e.y,i=e.z,n=Math.hypot(a,r,i),o,l,c,f,h,u,g,A,m,p,D,B;if(n<Xu)return null;n=1/n,a*=n,r*=n,i*=n,o=Math.sin(s),l=Math.cos(s),c=1-l,f=a*a*c+l,h=r*a*c+i*o,u=i*a*c-r*o,g=a*r*c-i*o,A=r*r*c+l,m=i*r*c+a*o,p=a*i*c+r*o,D=r*i*c-a*o,B=i*i*c+l;let v=t.rawData;return v[0]=f,v[1]=h,v[2]=u,v[3]=0,v[4]=g,v[5]=A,v[6]=m,v[7]=0,v[8]=p,v[9]=D,v[10]=B,v[11]=0,v[12]=0,v[13]=0,v[14]=0,v[15]=1,v}function fs(s,e,t){let a=s.rawData,r=a[0],i=a[1],n=a[2],o=a[3],l=a[4],c=a[5],f=a[6],h=a[7],u=a[8],g=a[9],A=a[10],m=a[11],p=a[12],D=a[13],B=a[14],v=a[15],C=e.rawData,y=t.rawData,x=C[0],k=C[1],E=C[2],S=C[3];return y[0]=x*r+k*l+E*u+S*p,y[1]=x*i+k*c+E*g+S*D,y[2]=x*n+k*f+E*A+S*B,y[3]=x*o+k*h+E*m+S*v,x=C[4],k=C[5],E=C[6],S=C[7],y[4]=x*r+k*l+E*u+S*p,y[5]=x*i+k*c+E*g+S*D,y[6]=x*n+k*f+E*A+S*B,y[7]=x*o+k*h+E*m+S*v,x=C[8],k=C[9],E=C[10],S=C[11],y[8]=x*r+k*l+E*u+S*p,y[9]=x*i+k*c+E*g+S*D,y[10]=x*n+k*f+E*A+S*B,y[11]=x*o+k*h+E*m+S*v,x=C[12],k=C[13],E=C[14],S=C[15],y[12]=x*r+k*l+E*u+S*p,y[13]=x*i+k*c+E*g+S*D,y[14]=x*n+k*f+E*A+S*B,y[15]=x*o+k*h+E*m+S*v,y}var ct=(s=>(s[s.None=0]="None",s[s.PointLight=1]="PointLight",s[s.DirectionLight=2]="DirectionLight",s[s.SpotLight=3]="SpotLight",s[s.SkyLight=4]="SkyLight",s))(ct||{});class fn extends gi{static lightSize=24;index=-1;lightType=-1;radius=.001;linear=8;lightPosition=new b;lightMatrixIndex=-1;direction=new b;quadratic=.032;lightColor=new J(1,1,1,1);intensity=1;innerAngle=0;outerAngle=1;range=100;castShadowIndex=-1;lightTangent=b.FORWARD;iesIndex=-1}class Pe{static componentsUpdateList;static componentsLateUpdateList;static componentsBeforeUpdateList;static componentsComputeList;static componentsEnablePickerList;static graphicComponent;static waitStartComponent;static _init=!1;static init(){this._init||(this._init=!0,this.componentsUpdateList=new Map,this.componentsLateUpdateList=new Map,this.componentsBeforeUpdateList=new Map,this.componentsComputeList=new Map,this.componentsEnablePickerList=new Map,this.graphicComponent=new Map,this.waitStartComponent=new Map)}static bindUpdate(e,t,a){this.init();let r=this.componentsUpdateList.get(e);r||(r=new Map,this.componentsUpdateList.set(e,r)),r.set(t,a)}static unBindUpdate(e,t){this.init();let a=this.componentsUpdateList.get(e);a&&a.delete(t)}static bindLateUpdate(e,t,a){this.init();let r=this.componentsLateUpdateList.get(e);r||(r=new Map,this.componentsLateUpdateList.set(e,r)),r.set(t,a)}static unBindLateUpdate(e,t){this.init();let a=this.componentsLateUpdateList.get(e);a&&a.delete(t)}static bindBeforeUpdate(e,t,a){this.init();let r=this.componentsBeforeUpdateList.get(e);r||(r=new Map,this.componentsBeforeUpdateList.set(e,r)),r.set(t,a)}static unBindBeforeUpdate(e,t){this.init();let a=this.componentsBeforeUpdateList.get(e);a&&a.delete(t)}static bindCompute(e,t,a){this.init();let r=this.componentsComputeList.get(e);r||(r=new Map,this.componentsComputeList.set(e,r)),r.set(t,a)}static unBindCompute(e,t){this.init();let a=this.componentsComputeList.get(e);a&&a.delete(t)}static bindGraphic(e,t,a){this.init();let r=this.graphicComponent.get(e);r||(r=new Map,this.graphicComponent.set(e,r)),r.set(t,a)}static unBindGraphic(e,t){this.init();let a=this.graphicComponent.get(e);a&&a.delete(t)}static appendWaitStart(e){this.init();let t=this.waitStartComponent.get(e.object3D);t?t.indexOf(e)==-1&&t.push(e):this.waitStartComponent.set(e.object3D,[e])}static removeWaitStart(e,t){this.init();let a=Pe.waitStartComponent.get(e);if(a){let r=a.indexOf(t);r!=-1&&a.splice(r)}}static bindEnablePick(e,t,a){this.init();let r=this.componentsEnablePickerList.get(e);r||(r=new Map,this.componentsEnablePickerList.set(e,r)),r.set(t,a)}static unBindEnablePick(e,t){this.init();let a=this.componentsEnablePickerList.get(e);a&&a.delete(t)}}class qe{object3D=null;_eventDispatcher;get eventDispatcher(){return this._eventDispatcher||=new Ja,this._eventDispatcher}set eventDispatcher(e){console.error("The eventDispatcher should not be set externally!")}_enable=!0;__isStart=!1;isDestroyed=!1;get isStart(){return this.__isStart}get transform(){return this.object3D.transform}set enable(e){this._enable!=e&&(this._enable=e,this._enable?this.onEnable?.(this.transform.view3D):this.onDisable?.(this.transform.view3D))}get enable(){return this._enable}__init(e){this.init(e)}__start(){this.transform&&this.transform.scene3D&&this._enable&&this.onEnable?.(this.transform.view3D),this.transform&&this.transform.scene3D&&this.__isStart==!1&&(this.start?.(),this.__isStart=!0),this.onUpdate&&this._onUpdate(this.onUpdate.bind(this)),this.onLateUpdate&&this._onLateUpdate(this.onLateUpdate.bind(this)),this.onBeforeUpdate&&this._onBeforeUpdate(this.onBeforeUpdate.bind(this)),this.onCompute&&this._onCompute(this.onCompute.bind(this)),this.onGraphic&&this._onGraphic(this.onGraphic.bind(this))}__stop(){this.transform&&this.transform.scene3D&&this.onDisable?.(this.transform.view3D),this._onUpdate(null),this._onLateUpdate(null),this._onBeforeUpdate(null),this._onCompute(null),this._onGraphic(null)}init(e){}start(){}stop(){}cloneTo(e){}copyComponent(e){return this}_onUpdate(e){e!=null?Pe.bindUpdate(this.transform.view3D,this,e):Pe.unBindUpdate(this.transform.view3D,this)}_onLateUpdate(e){e!=null?Pe.bindLateUpdate(this.transform.view3D,this,e):Pe.unBindLateUpdate(this.transform.view3D,this)}_onBeforeUpdate(e){e!=null?Pe.bindBeforeUpdate(this.transform.view3D,this,e):Pe.unBindBeforeUpdate(this.transform.view3D,this)}_onCompute(e){e!=null?Pe.bindCompute(this.transform.view3D,this,e):Pe.unBindCompute(this.transform.view3D,this)}_onGraphic(e){e!=null?Pe.bindGraphic(this.transform.view3D,this,e):Pe.unBindGraphic(this.transform.view3D,this)}beforeDestroy(e){Pe.removeWaitStart(this.object3D,this)}destroy(e){this.isDestroyed||(this.isDestroyed=!0,this.enable=!1,this.stop(),this._onBeforeUpdate(null),this._onUpdate(null),this._onLateUpdate(null),this.onEnable=null,this.onDisable=null,this.onUpdate=null,this.onLateUpdate=null,this.onBeforeUpdate=null,this.onCompute=null,this.onGraphic=null)}}class dn{value=0;inv_base=0;static get(e,t){let a=0,r=1/t;for(;e>0;)a+=e%t*r,e/=t,r/=t;return a}getBase(e,t){let a=this.inv_base=1/t;for(;e>0;)this.value+=a*(e%t),e/=t,a*=this.inv_base}next(){let e=1-this.value-1e-7;if(this.inv_base<e)this.value+=this.inv_base;else{let t=this.inv_base,a;do a=t,t*=this.inv_base;while(t>=e);this.value+=a+t-1}}get(){return this.value}}class na{origin=new b;length=Number.MAX_VALUE;static _rayl=1e9;static _smallnum=1e-8;_vector=new b;_dir=new b;constructor(e,t){this.origin.copyFrom(e||new b),this._dir.copyFrom(t||new b),this._dir.normalize()}get direction(){return this._dir}set direction(e){this._dir.copyFrom(e),this._dir.normalize()}clone(){return new na(this.origin,this.direction)}intersectBox(e,t){let a=this.direction,r=this.origin,i,n,o,l,c,f;const h=1/a.x,u=1/a.y,g=1/a.z,A=e.min,m=e.max;return i=((h>=0?A.x:m.x)-r.x)*h,n=((h>=0?m.x:A.x)-r.x)*h,o=((u>=0?A.y:m.y)-r.y)*u,l=((u>=0?m.y:A.y)-r.y)*u,i>l||o>n||(o>i&&(i=o),l<n&&(n=l),c=((g>=0?A.z:m.z)-r.z)*g,f=((g>=0?m.z:A.z)-r.z)*g,i>f||c>n)||(c>i&&(i=c),f<n&&(n=f),n<0)?null:(t||=new b,this.pointAt(i>=0?i:n,t))}pointAt(e,t){return t||=new b,t.copy(this.direction),t.multiplyScalar(e),t.add(this.origin,t),t}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this._dir.copy(e._dir),this.length=e.length,this}setApproxDirection(e){this._dir=e.normalize()}setOrigin(e){this.origin.copyFrom(e)}getOrigin(){return this.origin}getPoint(e){return this._dir.scaleBy(e),this.origin.add(this._dir)}sqrDistToPoint(e){let t=this._dir,a=e.subtract(this.origin),r=xt(a,t),i=xt(t,t),n=r/i,o=this.getPoint(n);return ls(e.subtract(o))}applyMatrix(e){this.origin=e.transformPoint(this.origin),this._dir=e.transformVector(this._dir)}_v0=new b;_v1=new b;_v2=new b;pointInTriangle(e,t,a,r){let i=this._v0,n=this._v1,o=this._v2;r.subtract(t,i),a.subtract(t,n),e.subtract(t,o);let l=b.dot(i,i),c=b.dot(i,n),f=b.dot(i,o),h=b.dot(n,n),u=b.dot(n,o),g=1/(l*h-c*c),A=(h*f-c*u)*g,m=(l*u-c*f)*g;return A>=0&&m>=0&&A+m<1}_E1=new b;_E2=new b;_P=new b;_T=new b;_Q=new b;intersectTriangle(e,t,a){let r=a.v1,i=a.v2,n=a.v3;i.subtract(r,this._E1),n.subtract(r,this._E2),t.crossProduct(this._E2,this._P);let o=this._E1.dotProduct(this._P);if(o>0?e.subtract(r,this._T):(r.subtract(e,this._T),o=-o),o<1e-4||(a.u=this._T.dotProduct(this._P),a.u<0||a.u>o)||(this._T.crossProduct(this._E1,this._Q),a.v=t.dotProduct(this._Q),a.v<0||a.u+a.v>o))return null;let l=new b;a.t0=a.t=this._E2.dotProduct(this._Q);let c=1/o;return a.t*=c,a.u*=c,a.v*=c,l.x=e.x+a.t*t.x,l.y=e.y+a.t*t.y,l.z=e.z+a.t*t.z,l}intersectSphere(e,t,a,r){let i=e.subtract(a),n=b.dot(t,t),o=2*b.dot(i,t),l=b.dot(i,i)-r*r,c=o*o-4*n*l,f=b.HELP_3;if(c<0)return null;{let h=(-o-Math.sqrt(c))/(n*2);return h<0?null:(f.x=e.x+h*t.x,f.y=e.y+h*t.y,f.z=e.z+h*t.z,f)}}intersectionSegment(e,t,a){const r=this.origin,i=b.HELP_0,n=b.HELP_1,o=b.HELP_2,l=b.HELP_3;t.subtract(e,i),this._dir.scaleToRef(na._rayl,o),r.add(o,n),e.subtract(r,l);var c=b.dot(i,i),f=b.dot(i,o),h=b.dot(o,o),u=b.dot(i,l),g=b.dot(o,l),A=c*h-f*f,m,p,D=A,B,v,C=A;A<na._smallnum?(p=0,D=1,v=g,C=h):(p=f*g-h*u,v=c*g-f*u,p<0?(p=0,v=g,C=h):p>D&&(p=D,v=g+f,C=h)),v<0?(v=0,-u<0?p=0:-u>c?p=D:(p=-u,D=c)):v>C&&(v=C,-u+f<0?p=0:-u+f>c?p=D:(p=-u+f,D=c)),m=Math.abs(p)<na._smallnum?0:p/D,B=Math.abs(v)<na._smallnum?0:v/C;const y=b.HELP_4;o.scaleToRef(B,y);const x=b.HELP_5;i.scaleToRef(m,x),x.add(l,x);const k=b.HELP_6;x.subtract(y,k);var E=B>0&&B<=this._dir.length&&k.lengthSquared<a*a;if(E){let S=new b;return S.copyFrom(t.subtract(e)),S.scaleBy(m),S.add(e,S),{out:S,length:x.length}}return{out:null,length:-1}}get_vec(e,t){let a=b.HELP_1;return a.x=e.x-t.x,a.y=e.y-t.y,a.z=e.z-t.z,a}}class Ai{x;y;w;h;constructor(e=0,t=0,a=0,r=0){this.x=e,this.y=t,this.w=a,this.h=r}get width(){return this.w}set width(e){this.w=e}get height(){return this.h}set height(e){this.h=e}static pointInRect(e,t,a,r,i,n){return!(e<a||e>i||t<r||t>n)}clone(){return new Ai(this.x,this.y,this.w,this.h)}copyFrom(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h}copyTo(e){e.copyFrom(this)}inner(e,t){return!(e<this.x||e>this.x+this.width||t<this.y||t>this.y+this.height)}equal(e){return!(this.x!=e.x||this.y!=e.y||this.width!=e.width||this.height!=e.height)}equalArea(e,t,a,r){return!(this.x!=e||this.y!=t||this.width!=a||this.height!=r)}equalInnerArea(e){var t=this.x,a=this.y,r=this.x+this.width,i=this.y+this.height,n=e.x,o=e.y,l=e.x+e.width,c=e.y+e.height;return Math.max(t,n)<=Math.min(r,l)&&Math.max(a,o)<=Math.min(i,c)}innerArea(e,t){t=t||new Ai;var a=this.x,r=this.y,i=this.x+this.width,n=this.y+this.height,o=e.x,l=e.y,c=e.x+e.width,f=e.y+e.height,h=Math.max(r,l),u=Math.min(n,f),g=Math.max(a,o),A=Math.min(c,i);return h>=0&&u>=0&&u-h>=0&&A-g>0?(t.x=g,t.y=h,t.width=A-g,t.height=u-h):(t.x=0,t.y=0,t.width=0,t.height=0),t}setTo(e,t,a,r){this.x=e,this.y=t,this.width=a,this.height=r}}class xe{center;extents;max;min;size;static maxVector3=new b(1,1,1).multiplyScalar(Number.MAX_VALUE*.1);static minVector3=new b(1,1,1).multiplyScalar(-Number.MAX_VALUE*.1);constructor(e,t){e||=b.ZERO.clone(),t||=b.ZERO.clone(),this.setFromCenterAndSize(e,t)}makeEmpty(){return this.setFromMinMax(xe.maxVector3,xe.minVector3),this}setFromMinMax(e,t){return this.init(),this.min.copyFrom(e),this.max.copyFrom(t),this.max.subtract(this.min,this.size),this.extents.copyFrom(this.size).multiplyScalar(.5),this.min.add(this.max,this.center).multiplyScalar(.5),this}init(){return this.min||=new b,this.max||=new b,this.size||=new b,this.center||=new b,this.extents||=new b,this}setFromCenterAndSize(e,t){return this.init(),this.center.copyFrom(e),this.size.copyFrom(t),this.extents.copyFrom(this.size).multiplyScalar(.5),this.center.subtract(this.extents,this.min),this.center.add(this.extents,this.max),this}inFrustum(e,t){return t.containsBox(e.bound)}merge(e){e.min.x<this.min.x&&(this.min.x=e.min.x),e.min.y<this.min.y&&(this.min.y=e.min.y),e.min.z<this.min.z&&(this.min.z=e.min.z),e.max.x>this.max.x&&(this.max.x=e.max.x),e.max.y>this.max.y&&(this.max.y=e.max.y),e.max.z>this.max.z&&(this.max.z=e.max.z),this.size.x=this.max.x-this.min.x,this.size.y=this.max.y-this.min.y,this.size.z=this.max.z-this.min.z,this.extents.x=this.size.x*.5,this.extents.y=this.size.y*.5,this.extents.z=this.size.z*.5,this.center.x=this.min.x+this.extents.x,this.center.y=this.min.y+this.extents.y,this.center.z=this.min.z+this.extents.z}intersects(e){return this.min.x<=e.max.x&&this.max.x>=e.min.x&&this.min.y<=e.max.y&&this.max.y>=e.min.y&&this.min.z<=e.max.z&&this.max.z>=e.min.z}intersectsSphere(e){return this.min.x<=e.max.x&&this.max.x>=e.min.x&&this.min.y<=e.max.y&&this.max.y>=e.min.y&&this.min.z<=e.max.z&&this.max.z>=e.min.z}intersectsBox(e){return this.min.x<=e.max.x&&this.max.x>=e.min.x&&this.min.y<=e.max.y&&this.max.y>=e.min.y&&this.min.z<=e.max.z&&this.max.z>=e.min.z}equals(e){return this.center.equals(e.center)&&this.extents.equals(e.extents)}expandByPoint(e){e.x<this.min.x&&(this.min.x=e.x),e.x>this.max.x&&(this.max.x=e.x),e.y<this.min.y&&(this.min.y=e.y),e.y>this.max.y&&(this.max.y=e.y),e.z<this.min.z&&(this.min.z=e.z),e.z>this.max.z&&(this.max.z=e.z),this.size.x=this.max.x-this.min.x,this.size.y=this.max.y-this.min.y,this.size.z=this.max.z-this.min.z,this.extents.x=this.size.x*.5,this.extents.y=this.size.y*.5,this.extents.z=this.size.z*.5,this.center.x=this.min.x+this.extents.x,this.center.y=this.min.y+this.extents.y,this.center.z=this.min.z+this.extents.z}static fromPoints(e){for(var t=new xe(new b,new b),a=0;a<e.length;a++)t.expandByPoint(e[a]);return t}calculateTransform(e){}clone(){var e=new xe(this.center.clone(),this.size.clone());return e}intersectsRay(e,t){throw new Error("Method not implemented.")}containsPoint(e){return this.min.x<=e.x&&this.max.x>=e.x&&this.min.y<=e.y&&this.max.y>=e.y&&this.min.z<=e.z&&this.max.z>=e.z}containsBox(e){let t=this.min,a=this.max;return t.x<=e.min.x&&t.y<=e.min.y&&t.z<=e.min.z&&a.x>=e.max.x&&a.y>=e.max.y&&a.z>=e.max.z}updateBound(){}destroy(e){this.center=null,this.extents=null,this.min=null,this.max=null,this.size=null}}class ds{planes;corners;boundingBox=new xe;constructor(){this.planes=[],this.corners=[];for(var e=0;e<6;e++)this.planes[e]=new b;for(var e=0;e<8;e++)this.corners[e]=new b}updateBoundBox(e){this.boundingBox.makeEmpty();let t=this.boundingBox.min,a=this.boundingBox.max,r=0;for(let i=0;i<2;++i)for(let n=0;n<2;++n)for(let o=0;o<2;++o){let l=this.corners[r];r++,l.set(2*i-1,2*n-1,o,1),e.transformVector4(l,l),l.div(l.w,l),t.x=Math.min(l.x,t.x),t.y=Math.min(l.y,t.y),t.z=Math.min(l.z,t.z),a.x=Math.max(l.x,a.x),a.y=Math.max(l.y,a.y),a.z=Math.max(l.z,a.z)}return this.boundingBox.setFromMinMax(t,a),this}setFrustumCorners(e){let t=0;for(let a=0;a<2;++a)for(let r=0;r<2;++r)for(let i=0;i<2;++i){let n=this.corners[t];n.set(2*a-1,2*r-1,i,1),e.transformVector4(n,n),n.div(n.w,n),t++}}update(e){var t=e.rawData;this.planes[0].x=t[3]-t[0],this.planes[0].y=t[7]-t[4],this.planes[0].z=t[11]-t[8],this.planes[0].w=t[15]-t[12];var a=Math.sqrt(this.planes[0].x*this.planes[0].x+this.planes[0].y*this.planes[0].y+this.planes[0].z*this.planes[0].z);this.planes[0].x/=a,this.planes[0].y/=a,this.planes[0].z/=a,this.planes[0].w/=a,this.planes[1].x=t[3]+t[0],this.planes[1].y=t[7]+t[4],this.planes[1].z=t[11]+t[8],this.planes[1].w=t[15]+t[12],a=Math.sqrt(this.planes[1].x*this.planes[1].x+this.planes[1].y*this.planes[1].y+this.planes[1].z*this.planes[1].z),this.planes[1].x/=a,this.planes[1].y/=a,this.planes[1].z/=a,this.planes[1].w/=a,this.planes[2].x=t[3]+t[1],this.planes[2].y=t[7]+t[5],this.planes[2].z=t[11]+t[9],this.planes[2].w=t[15]+t[13],a=Math.sqrt(this.planes[2].x*this.planes[2].x+this.planes[2].y*this.planes[2].y+this.planes[2].z*this.planes[2].z),this.planes[2].x/=a,this.planes[2].y/=a,this.planes[2].z/=a,this.planes[2].w/=a,this.planes[3].x=t[3]-t[1],this.planes[3].y=t[7]-t[5],this.planes[3].z=t[11]-t[9],this.planes[3].w=t[15]-t[13],a=Math.sqrt(this.planes[3].x*this.planes[3].x+this.planes[3].y*this.planes[3].y+this.planes[3].z*this.planes[3].z),this.planes[3].x/=a,this.planes[3].y/=a,this.planes[3].z/=a,this.planes[3].w/=a,this.planes[4].x=t[3]-t[2],this.planes[4].y=t[7]-t[6],this.planes[4].z=t[11]-t[10],this.planes[4].w=t[15]-t[14],a=Math.sqrt(this.planes[4].x*this.planes[4].x+this.planes[4].y*this.planes[4].y+this.planes[4].z*this.planes[4].z),this.planes[4].x/=a,this.planes[4].y/=a,this.planes[4].z/=a,this.planes[4].w/=a,this.planes[5].x=t[3]+t[2],this.planes[5].y=t[7]+t[6],this.planes[5].z=t[11]+t[10],this.planes[5].w=t[15]+t[14],a=Math.sqrt(this.planes[5].x*this.planes[5].x+this.planes[5].y*this.planes[5].y+this.planes[5].z*this.planes[5].z),this.planes[5].x/=a,this.planes[5].y/=a,this.planes[5].z/=a,this.planes[5].w/=a}containsPoint(e){for(var t=0;t<6;t++)if(this.planes[t].x*e.x+this.planes[t].y*e.y+this.planes[t].z*e.z+this.planes[t].w<=0)return!1;return!0}containsSphere(e){let t=e.bound,a=0,r,i=e.transform.worldPosition,n=t.radius,o=t.center.x+i.x,l=t.center.y+i.y,c=t.center.z+i.z;for(let f of this.planes){if(r=f.x*o+f.y*l+f.z*c+f.w,r<=-n)return 0;r>n&&a++}return a===6?2:1}containsBox(e){let t=0,a,i=Math.max(e.size.x,e.size.y,e.size.z)*2,n=e.center.x,o=e.center.y,l=e.center.z;for(let c of this.planes){if(a=c.x*n+c.y*o+c.z*l+c.w,a<=-i)return 0;a>i&&t++}return t===6?2:1}containsBox2(e){let t=0,a,r=1.74*Math.max(e.extents.x,e.extents.y,e.extents.z);for(let i of this.planes){if(a=i.x*e.center.x+i.y*e.center.y+i.z*e.center.z+i.w,a<=-r)return 0;a>r&&t++}return t===6?2:1}containsBoxPrecise(e){const t=[new b(e.min.x,e.min.y,e.min.z),new b(e.max.x,e.min.y,e.min.z),new b(e.min.x,e.max.y,e.min.z),new b(e.max.x,e.max.y,e.min.z),new b(e.min.x,e.min.y,e.max.z),new b(e.max.x,e.min.y,e.max.z),new b(e.min.x,e.max.y,e.max.z),new b(e.max.x,e.max.y,e.max.z)];let a=0;for(let r=0;r<6;r++){const i=this.planes[r];let n=-1/0,o=1/0;for(let l=0;l<8;l++){const c=t[l],f=i.x*c.x+i.y*c.y+i.z*c.z+i.w;n=Math.max(n,f),o=Math.min(o,f)}if(n<0)return 0;o>0&&a++}return a===6?2:1}}var at=(s=>(s[s.ortho=0]="ortho",s[s.perspective=1]="perspective",s[s.shadow=2]="shadow",s))(at||{});class $u{corners;index;constructor(e){this.index=e,this.corners=[];for(let t=0;t<4;t++)this.corners.push(new b)}}class e2{bound;twoSections;name;color;shadowCamera;index;constructor(e,t,a){this.bound=new xe,this.shadowCamera=dt.createCamera3DObject(null,"csmShadowCamera_"+a),this.shadowCamera.isShadowCamera=!0,this.shadowCamera.orthoOffCenter(100,-100,100,-100,1,1e4),this.twoSections=[e,t],this.index=a,a==0?this.color=new J(1,0,0,1):a==1?this.color=new J(0,1,0,1):a==2?this.color=new J(0,0,1,1):a==3&&(this.color=new J(0,1,1,1)),this.name="child_"+a}updateBound(){this.bound.makeEmpty();let e=this.bound.min,t=this.bound.max;for(let a of this.twoSections)for(let r of a.corners)e.x=Math.min(r.x,e.x),e.y=Math.min(r.y,e.y),e.z=Math.min(r.z,e.z),t.x=Math.max(r.x,t.x),t.y=Math.max(r.y,t.y),t.z=Math.max(r.z,t.z);return this.bound.setFromMinMax(e,t),this}}class gc{sections;children;name;constructor(e){this.sections=[];let t=e+1;for(let a=0;a<t;a++)this.sections.push(new $u(a));this.children=[];for(let a=0;a<e;a++)this.children.push(new e2(this.sections[a],this.sections[a+1],a))}update(e,t,a,r,i){let n=this.sections.length-1;for(let o=0;o<=n;++o){let l=this.sections[o],c=0,f=this.logSplit(a,r,o,this.sections.length);{let u=(f-a)/r;u=u**i.csmScatteringExp,f=(r-a)*u+a}f*=i.csmAreaScale;let h=(e.rawData[10]*f+e.rawData[14])/f;for(let u=0;u<2;++u)for(let g=0;g<2;++g){let A=l.corners[c];c++,A.set(2*u-1,2*g-1,h,1),t.transformVector4(A,A),A.div(A.w,A)}}for(let o of this.children)o.updateBound();return this}squareSplit(e,t,a,r){return(a/(r-1))**4*(t-e)+e}uniformSplit(e,t,a,r){return a/(r-1)*(t-e)+e}logSplit(e,t,a,r){return e*(t/e)**(a/(r-1))}}class Hr extends qe{fov=60;name;aspect=1;near=1;far=5e3;left=-100;right=100;top=100;bottom=-100;frustumSize=100;viewPort=new Ai;frustum;sh=new Float32Array(36);isShadowCamera=!1;_projectionMatrixInv=new R;_projectionMatrix=new R;_viewMatrix=new R;_viewMatrixInv=new R;_unprojection=new R;_pvMatrixInv=new R;_pvMatrix=new R;_halfw;_halfh;_ray;_enableCSM=!1;mainCamera;get projectionMatrix(){return this._projectionMatrix}lookTarget;type=at.perspective;csm;cubeShadowCameras=[];get enableCSM(){return this._enableCSM}set enableCSM(e){e&&!this.csm&&(this.csm=new gc(ra.Cascades)),this._enableCSM=e}constructor(){super()}init(){super.init(),this._ray=new na,this.frustum=new ds,this.lookTarget=new b(0,0,0),this.viewPort.x=0,this.viewPort.y=0,this.viewPort.w=w.presentationSize[0],this.viewPort.h=w.presentationSize[1],this.updateProjection(),w.addEventListener(nr.RESIZE,this.updateProjection,this)}updateProjection(){this.aspect=w.aspect,this.type==at.perspective?this.perspective(this.fov,this.aspect,this.near,this.far):this.type==at.ortho&&(this.frustumSize?this.ortho(this.frustumSize,this.near,this.far):this.orthoOffCenter(this.left,this.right,this.bottom,this.top,this.near,this.far))}getShadowBias(e){let t=2*this.getShadowWorldExtents()/e,a=this.far-this.near;return t/a-_.setting.shadow.shadowBias*.01}getShadowWorldExtents(){let e=_.setting.shadow.shadowBound;return e?e*=.5:e=Math.round(.05*this.frustum.boundingBox.extents.length),e}getCSMShadowBiasScale(e){if(e==this)return 1;let t=this.far-this.near,a=this.csm.children[0].shadowCamera;return(a.far-a.near)/t}getCSMShadowWorldExtents(e){return Math.round(this.csm.children[e].bound.extents.length)}perspective(e,t,a,r){this.fov=e,this.aspect=t,this.near=Math.max(.001,a),this.far=r,this._projectionMatrix.perspective(this.fov,this.aspect,this.near,this.far),this.type=at.perspective}ortho(e,t,a){this.frustumSize=e;let r=e*.5*this.aspect,i=e*.5,n=-r/2,o=r/2,l=i/2,c=-i/2;this.orthoOffCenter(n,o,c,l,t,a)}orthoOffCenter(e,t,a,r,i,n){this.near=i,this.far=n,this.left=e,this.right=t,this.top=r,this.bottom=a,this.type=at.ortho,this._projectionMatrix.orthoOffCenter(this.left,this.right,this.bottom,this.top,this.near,this.far)}get viewMatrix(){return this._viewMatrix.copyFrom(this.transform.worldMatrix),this._viewMatrix.invert(),this._viewMatrix}get shadowViewMatrix(){return this._viewMatrix.copyFrom(this.transform.worldMatrix),this._viewMatrix.appendScale(1,1,1),this._viewMatrix.invert(),this._viewMatrix}object3DToScreenRay(e,t=null){return t||(t=new b(0,0,0,1)),this._halfw=this.viewPort.width*.5,this._halfh=this.viewPort.height*.5,Pt.transformVector(this.viewMatrix,e,t),this.project(t,t),t.x=this._halfw+t.x*this._halfw,t.y=this.viewPort.height-(this._halfh-t.y*this._halfh),t}screenRayToObject3D(e,t=null){t||(t=new b),this._halfw=this.viewPort.width*.5,this._halfh=this.viewPort.height*.5;let a=e.x,r=e.y;return t.x=a/this.viewPort.width-.25,t.y=r/this.viewPort.height-.25,this.unProject(t.x,t.y,e.z,t),t}get pvMatrix(){return fs(this._projectionMatrix,this.viewMatrix,this._pvMatrix),this._pvMatrix}get pvMatrix2(){fs(this._projectionMatrix,this.transform.worldMatrix,this._pvMatrix);let e=this._pvMatrixInv.copyFrom(this.pvMatrix);return e.invert(),e}get pvMatrixInv(){let e=this._pvMatrixInv.copyFrom(this.pvMatrix);return e.invert(),e}get vMatrixInv(){let e=this._viewMatrixInv.copyFrom(this.viewMatrix);return e.invert(),e}get cameraToWorld(){let e=R.helpMatrix;return e.identity(),e.copyFrom(this.projectionMatrixInv),e.multiply(this.vMatrixInv),e}get ndcToView(){let e=R.helpMatrix;return e.identity(),e.copyFrom(this.projectionMatrixInv),e}get projectionMatrixInv(){return this._projectionMatrixInv.copyFrom(this._projectionMatrix),this._projectionMatrixInv.invert(),this._projectionMatrixInv}unProject(e,t,a,r){return r||(r=new b),r.x=e,r.y=-t,r.z=a,r.w=1,r.x*=a,r.y*=a,this._unprojection.copyFrom(this._projectionMatrix),this._unprojection.invert(),Pt.transformVector(this._unprojection,r,r),r.z=a,r}project(e,t){return this._projectionMatrix.perspectiveMultiplyPoint3(e,t),t.x=t.x/t.w,t.y=-t.y/t.w,t.z=e.z,t}screenPointToRay(e,t){let a=this._ray,r=dt.UnProjection(e,t,.01,this),i=dt.UnProjection(e,t,1,this);return i=i.subtract(r).normalize(),a.origin.copyFrom(r),a.direction=i,a}screenPointToWorld(e,t,a){return dt.UnProjection(e,t,a,this)}worldToScreenPoint(e,t){return dt.Projection(e,this,t)}lookAt(e,t,a=b.Y_AXIS){this.transform.lookAt(e,t,a),t&&this.lookTarget.copyFrom(t)}onUpdate(){this._useJitterProjection&&this.getJitteredProjectionMatrix(),this.frustum.update(this.pvMatrix),this.frustum.updateBoundBox(this.pvMatrixInv);let e=_.setting.shadow;this.enableCSM&&this.csm?.update(this._projectionMatrix,this._pvMatrixInv,this.near,this.far,e)}_haltonSeq;_jitterOffsetList;_useJitterProjection=!1;_jitterFrameIndex=0;_sampleIndex=0;_jitterX=0;_jitterY=0;get jitterFrameIndex(){return this._jitterFrameIndex}get jitterX(){return this._jitterX}get jitterY(){return this._jitterY}enableJitterProjection(e){this._jitterFrameIndex=0,this._useJitterProjection=e,this._haltonSeq||=new dn,this._jitterOffsetList=[];for(let t=0;t<32;t++){let a=this.generateRandomOffset();this._jitterOffsetList.push(a)}this._jitterOffsetList.reverse()}generateRandomOffset(){let e=new de(dn.get((this._sampleIndex&1023)+1,2)-.5,dn.get((this._sampleIndex&1023)+1,3)-.5);return++this._sampleIndex>=32&&(this._sampleIndex=0),e}getJitteredProjectionMatrix(){let e=_.setting.render.postProcessing.taa,t=this._projectionMatrix,a=e.temporalJitterScale,r=this._jitterFrameIndex%e.jitterSeedCount,i=this._jitterOffsetList[r].x*a,n=this._jitterOffsetList[r].y*a,o=t.get(0,2),l=t.get(1,2);this._jitterX=i/this.viewPort.width,this._jitterY=n/this.viewPort.height,o+=this._jitterX,l+=this._jitterY,t.set(0,2,o),t.set(1,2,l),this._jitterFrameIndex++}getWorldDirection(e){e||=new b;const t=this.transform._worldMatrix.rawData;return e.set(-t[8],-t[9],-t[10]).normalize()}}class zt extends qe{static LIMIT=1;static COMPONENT_NAME="UUTransform";static COMPONENT_TYPE="Transform";static POSITION_ONCHANGE="POSITION_ONCHANGE";static ROTATION_ONCHANGE="ROTATION_ONCHANGE";static SCALE_ONCHANGE="SCALE_ONCHANGE";static PARENT_ONCHANGE="PARENT_ONCHANGE";static CHILDREN_ONCHANGE="CHILDREN_ONCHANGE";static ADD_ONCHANGE="ADD_ONCHANGE";static LOCAL_ONCHANGE="LOCAL_ONCHANGE";eventPositionChange=new bt(zt.POSITION_ONCHANGE);eventRotationChange=new bt(zt.ROTATION_ONCHANGE);eventScaleChange=new bt(zt.SCALE_ONCHANGE);eventLocalChange=new bt(zt.LOCAL_ONCHANGE);onPositionChange;onRotationChange;onScaleChange;_scene3d;_parent;_localPos;_localRot;_localRotQuat;_localScale;_localDetailPos;_localDetailRot;_localDetailScale;index;index2;_forward=new b;_back=new b;_right=new b;_left=new b;_up=new b;_down=new b;_worldMatrix;_targetPos;static=!1;depthOrder=0;get localChange(){return Ee.matrixStateBuffer[this.index2]!=0}set localChange(e){Ee.matrixStateBuffer[this.index2]=e?1:0}get targetPos(){return this._targetPos}set targetPos(e){this._targetPos=e}get parent(){return this._parent}set parent(e){let t=this._parent?.object3D;if(this._parent=e,this.depthOrder=e?e.depthOrder+1:0,Ee.setParent(this.index,e?e.worldMatrix.index:-1,this.depthOrder),this.localChange=!0,this.object3D){let a=e?e.scene3D:null;a?(this._scene3d=a,this.object3D.components.forEach(r=>{Pe.appendWaitStart(r)})):this.object3D.components.forEach(r=>{r.__stop()});for(let r of this.object3D.entityChildren)r.transform.parent=e?this:null;this.object3D.components.forEach(r=>{r.onParentChange?.(t,this._parent?.object3D)})}this.notifyLocalChange()}set enable(e){this.transform._scene3d&&e?super.enable=!0:super.enable=!1;for(let t of this.object3D.entityChildren)t.transform.enable=e}get enable(){return this._enable}get scene3D(){return this._scene3d}set scene3D(e){this._scene3d=e}get view3D(){return this._scene3d&&this._scene3d.view?this._scene3d.view:null}constructor(){super(),this._worldMatrix=new R(!0),this.index=this._worldMatrix.index,this.index2=this._worldMatrix.index*Ee.stateStruct,this._localPos=new b,this._localRot=new b,this._localRotQuat=new ae,this._localScale=new b(1,1,1),Ee.setScale(this.index,this._localScale.x,this._localScale.y,this._localScale.z),Ee.setRotation(this.index,this._localRot.x,this._localRot.y,this._localRot.z),Ee.setTranslate(this.index,this._localPos.x,this._localPos.y,this._localPos.z)}awake(){}start(){}stop(){}notifyLocalChange(){if(this.localChange=!0,this.object3D){let e=this.object3D.entityChildren,t=0,a=e.length;for(t=0;t<a;t++)e[t].transform.notifyLocalChange()}this.eventDispatcher.dispatchEvent(this.eventLocalChange)}get up(){return this.worldMatrix.transformVector(b.UP,this._up),this._up}set up(e){this._up.copyFrom(e),Pt.fromToRotation(b.UP,this._up,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0}get down(){return this.worldMatrix.transformVector(b.DOWN,this._down),this._down}set down(e){this._down.copyFrom(e),Pt.fromToRotation(b.DOWN,this._down,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0,this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange)}get forward(){return this.worldMatrix.transformVector(b.FORWARD,this._forward),this._forward}set forward(e){this._forward.copyFrom(e),Pt.fromToRotation(b.FORWARD,this._forward,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0,this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange)}get back(){return this.worldMatrix.transformVector(b.BACK,this._back),this._back}set back(e){this._back.copyFrom(e),Pt.fromToRotation(b.BACK,this._back,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0}get left(){return this.worldMatrix.transformVector(b.neg_X_AXIS,this._left),this._left}set left(e){this._left.copyFrom(e),Pt.fromToRotation(b.LEFT,this._left,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0}get right(){return this.worldMatrix.transformVector(b.X_AXIS,this._right),this._right}set right(e){this._right.copyFrom(e),Pt.fromToRotation(b.RIGHT,this._right,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0,this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange)}get localRotQuat(){return this.localChange&&this.updateWorldMatrix(),this._localRotQuat}set localRotQuat(e){(e.x!=this._localRotQuat.x||e.y!=this._localRotQuat.y||e.z!=this._localRotQuat.z||e.w!=this._localRotQuat.w)&&(this._localRotQuat.copyFrom(e),this._localRotQuat.getEulerAngles(this._localRot),Ee.setRotation(this.index,this._localRot.x,this._localRot.y,this._localRot.z),this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange))}notifyChange(){this.notifyLocalChange(),this.onRotationChange?.(),this.onScaleChange?.(),this.onPositionChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange),this.eventPositionChange&&this.eventDispatcher.dispatchEvent(this.eventPositionChange),this.eventScaleChange&&this.eventDispatcher.dispatchEvent(this.eventScaleChange)}get worldMatrix(){return this.updateWorldMatrix(),this._worldMatrix}updateWorldMatrix(e=!1){(this.localChange||e)&&(this.parent?(cn(this._localRot,this._localPos,this._localScale,this._worldMatrix),bc(this._worldMatrix,this.parent.worldMatrix,this._worldMatrix)):cn(this._localRot,this._localPos,this._localScale,this._worldMatrix),this.localChange=!1)}updateChildTransform(){let e=this;if(e.localChange&&e.updateWorldMatrix(),e.object3D.numChildren>0)for(const t of e.object3D.entityChildren)t.transform.updateChildTransform()}lookTarget(e,t=b.UP){this.lookAt(this.transform.worldPosition,e,t)}lookAt(e,t,a=b.UP){this._targetPos||=new b,this._targetPos.copyFrom(t),this.localPosition=e,R.helpMatrix.lookAt(e,t,a),R.helpMatrix.invert();var r=R.helpMatrix.decompose(ia.QUATERNION);this.localRotQuat=ae.CALCULATION_QUATERNION.copyFrom(r[1])}decomposeFromMatrix(e,t="eulerAngles"){let a=e.decompose(t),r=this.transform;return r.localRotQuat.copyFrom(a[1]),r.localRotQuat=r.localRotQuat,r.localPosition.copyFrom(a[0]),r.localPosition=r.localPosition,r.localScale.copyFrom(a[2]),r.localScale=r.localScale,this}cloneTo(e){e.transform.localPosition=this.localPosition,e.transform.localRotation=this.localRotation,e.transform.localScale=this.localScale}set x(e){this._localPos.x!=e&&(this._localPos.x=e,Ee.setTranslate(this.index,this._localPos.x,this._localPos.y,this._localPos.z),this.notifyLocalChange(),this.onPositionChange?.(),this.eventPositionChange&&this.eventDispatcher.dispatchEvent(this.eventPositionChange))}get x(){return this._localPos.x}set y(e){this._localPos.y!=e&&(this._localPos.y=e,Ee.setTranslate(this.index,this._localPos.x,this._localPos.y,this._localPos.z),this.notifyLocalChange(),this.onPositionChange?.(),this.eventPositionChange&&this.eventDispatcher.dispatchEvent(this.eventPositionChange))}get y(){return this._localPos.y}set z(e){this._localPos.z!=e&&(this._localPos.z=e,Ee.setTranslate(this.index,this._localPos.x,this._localPos.y,this._localPos.z),this.notifyLocalChange(),this.onPositionChange?.(),this.eventPositionChange&&this.eventDispatcher.dispatchEvent(this.eventPositionChange))}get z(){return this._localPos.z}set scaleX(e){this._localScale.x!=e&&(this._localScale.x=e,Ee.setScale(this.index,this._localScale.x,this._localScale.y,this._localScale.z),this.notifyLocalChange(),this.onScaleChange?.(),this.eventScaleChange&&this.eventDispatcher.dispatchEvent(this.eventScaleChange))}get scaleX(){return this._localScale.x}set scaleY(e){this._localScale.y!=e&&(this._localScale.y=e,Ee.setScale(this.index,this._localScale.x,this._localScale.y,this._localScale.z),this.notifyLocalChange(),this.onScaleChange?.(),this.eventScaleChange&&this.eventDispatcher.dispatchEvent(this.eventScaleChange))}get scaleY(){return this._localScale.y}set scaleZ(e){this._localScale.z!=e&&(this._localScale.z=e,Ee.setScale(this.index,this._localScale.x,this._localScale.y,this._localScale.z),this.notifyLocalChange(),this.onScaleChange?.(),this.eventScaleChange&&this.eventDispatcher.dispatchEvent(this.eventScaleChange))}get scaleZ(){return this._localScale.z}set rotationX(e){this._localRot.x!=e&&(this._localRot.x=e,Ee.setRotation(this.index,this._localRot.x,this._localRot.y,this._localRot.z),this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange))}get rotationX(){return this._localRot.x}set rotationY(e){this._localRot.y!=e&&(this._localRot.y=e,Ee.setRotation(this.index,this._localRot.x,this._localRot.y,this._localRot.z),this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange))}get rotationY(){return this._localRot.y}set rotationZ(e){this._localRot.z!=e&&(this._localRot.z=e,Ee.setRotation(this.index,this._localRot.x,this._localRot.y,this._localRot.z),this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange))}get rotationZ(){return this._localRot.z}get worldPosition(){return this.localChange&&this.updateWorldMatrix(),this._worldMatrix.position}set localPosition(e){this.onPositionChange&&(this._localPos.x!=e.x||this._localPos.y!=e.y||this._localPos.z!=e.z)&&this.onPositionChange(this._localPos,e),this._localPos.copyFrom(e),Ee.setTranslate(this.index,e.x,e.y,e.z),this.notifyLocalChange(),this.eventPositionChange&&this.eventDispatcher.dispatchEvent(this.eventPositionChange)}get localPosition(){return this._localPos}set localRotation(e){this.onRotationChange&&(this._localRot.x!=e.x||this._localRot.y!=e.y||this._localRot.z!=e.z)&&this.onRotationChange(this._localRot,e),Ee.setRotation(this.index,e.x,e.y,e.z),this._localRot.copyFrom(e),this.notifyLocalChange(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange)}get localRotation(){return this._localRot}set localScale(e){Ee.setScale(this.index,e.x,e.y,e.z),this._localScale.copyFrom(e),this.notifyLocalChange(),this.onScaleChange?.(),this.eventScaleChange&&this.eventDispatcher.dispatchEvent(this.eventScaleChange)}get localScale(){return this._localScale}get localDetailScale(){return this._localDetailScale}set localDetailScale(e){this._localDetailScale=e,Ee.setContinueScale(this.index,e.x,e.y,e.z)}get localDetailRot(){return this._localDetailRot}set localDetailRot(e){this._localDetailRot=e,Ee.setContinueRotation(this.index,e.x,e.y,e.z)}get localDetailPos(){return this._localDetailPos}set localDetailPos(e){this._localDetailPos=e,Ee.setContinueTranslate(this.index,e.x,e.y,e.z)}beforeDestroy(e){this.parent&&this.parent.object3D&&this.parent.object3D.removeChild(this.object3D),super.beforeDestroy(e)}destroy(){super.destroy(),this.scene3D=null,this.eventPositionChange=null,this.eventRotationChange=null,this.eventScaleChange=null,this.onPositionChange=null,this.onRotationChange=null,this.onScaleChange=null,this._scene3d=null,this._parent=null,this._localPos=null,this._localRot=null,this._localRotQuat=null,this._localScale=null,this._forward=null,this._back=null,this._right=null,this._left=null,this._up=null,this._down=null,this.localChange=null,this._targetPos=null}}class sa{static GLTF_NODE_INDEX_PROPERTY;static BASE_COLOR_UNIFORM="u_baseColorFactor";static BASE_COLOR_TEXTURE_UNIFORM="u_baseColorSampler";static METALROUGHNESS_UNIFORM="u_metallicRoughnessValues";static METALROUGHNESS_TEXTURE_UNIFORM="u_metallicRoughnessSampler";static NORMAL_TEXTURE_UNIFORM="u_normalSampler";static NORMAL_SCALE_UNIFORM="u_normalScale";static EMISSIVE_TEXTURE_UNIFORM="u_emissiveSampler";static EMISSIVE_FACTOR_UNIFORM="u_emissiveFactor";static OCCLUSION_TEXTURE_UNIFORM="u_occlusionSampler";static OCCLUSION_FACTOR_UNIFORM="u_occlusionFactor";static MAX_MORPH_TARGETS=8;static MORPH_POSITION_PREFIX="a_morphPositions_";static MORPH_NORMAL_PREFIX="a_morphNormals_";static MORPH_TANGENT_PREFIX="a_morphTangents_";static MORPH_WEIGHT_UNIFORM="u_morphWeights";static SCENE_ROOT_SKELETON="SCENE_ROOT";static IDENTITY_INVERSE_BIND_MATRICES="IDENTITY_IBM";static JOINT_MATRICES_UNIFORM="u_jointMatrix";static ALPHA_CUTOFF_UNIFORM="u_alphaCutoff"}var G=(s=>(s.position="position",s.normal="normal",s.uv="uv",s.TANGENT="TANGENT",s.TEXCOORD_1="TEXCOORD_1",s.TEXCOORD_2="TEXCOORD_2",s.TEXCOORD_3="TEXCOORD_3",s.TEXCOORD_4="TEXCOORD_4",s.TEXCOORD_5="TEXCOORD_5",s.TEXCOORD_6="TEXCOORD_6",s.TEXCOORD_7="TEXCOORD_7",s.color="color",s.joints0="joints0",s.joints1="joints1",s.weights0="weights0",s.weights1="weights1",s.weight="weight",s.indices="indices",s.vIndex="vIndex",s.a_morphPositions_0="a_morphPositions_0",s.all="all",s))(G||{}),me=(s=>(s[s.NONE=0]="NONE",s[s.ABOVE=1]="ABOVE",s[s.ALPHA=2]="ALPHA",s[s.NORMAL=3]="NORMAL",s[s.ADD=4]="ADD",s[s.BELOW=5]="BELOW",s[s.ERASE=6]="ERASE",s[s.MUL=7]="MUL",s[s.SCREEN=8]="SCREEN",s[s.DIVD=9]="DIVD",s[s.SOFT_ADD=10]="SOFT_ADD",s))(me||{}),mc=(s=>(s[s.src_a=0]="src_a",s[s.dest_a=1]="dest_a",s))(mc||{});class pc{static getBlend(e){let t={color:{srcFactor:"src-alpha",dstFactor:"one"},alpha:{srcFactor:"one",dstFactor:"one"}};switch(e){case 0:t.color.srcFactor="one",t.color.dstFactor="zero",t.color.operation="add";break;case 1:t.color.srcFactor="one-minus-src-alpha",t.color.dstFactor="dst-alpha",t.color.operation="add";break;case 4:t.color.srcFactor="one",t.color.dstFactor="one",t.color.operation="add",t.alpha.srcFactor="one",t.alpha.dstFactor="one",t.alpha.operation="add";break;case 2:t.color.srcFactor="src-alpha",t.color.dstFactor="one-minus-src-alpha",t.color.operation="add";break;case 5:t.color.srcFactor="one-minus-src-alpha",t.color.dstFactor="one",t.color.operation="add";break;case 6:t.color.srcFactor="zero",t.color.dstFactor="one-minus-src-alpha",t.color.operation="add";break;case 7:t.color.srcFactor="dst",t.color.dstFactor="one-minus-src-alpha",t.color.operation="add";break;case 3:t.color.srcFactor="src-alpha",t.color.dstFactor="one-minus-src-alpha",t.color.operation="add";break;case 10:t.color.srcFactor="one",t.color.dstFactor="one",t.color.operation="max",t.alpha.srcFactor="one",t.alpha.dstFactor="one",t.alpha.operation="add";break;case 8:t.color.srcFactor="one",t.color.dstFactor="one-minus-src",t.color.operation="add";break}return t}}class pa{static mipmapShader=`
|
|
5669
|
+
`,""),g=g.split(",")[0],g=g.replaceAll(" "," "),this.parserAttribute(g,a)}}return a}static parserAttribute(e,t){let a={name:"",group:0,location:0,type:"",valueType:"",value:0,size:0,format:"float32"};if(e.indexOf("builtin")!=-1){a.type="builtin";var r=e.match(/\((.+?)\)/g)[0];r=e.match(/\((.+?)\)/g)[0],r=r.replace("(",""),r=r.replaceAll(")",""),a.location=parseInt(r);let i=e.split(":");a.name=i[0].split(" ")[1],a.name=a.name.replaceAll(" "," "),a.name=a.name.replaceAll(" ",""),a.valueType=i[1],a.valueType=a.valueType.replaceAll(" "," "),a.valueType=a.valueType.replaceAll(" ",""),a.valueType=a.valueType.replaceAll("\r",""),a.valueType=a.valueType.replaceAll(")",""),a.valueType=a.valueType.replaceAll(")",""),a.size=or[a.valueType],t.push(a)}else if(e.indexOf("location")!=-1){a.type="location";var r=e.match(/\((.+?)\)/g)[0];r=e.match(/\((.+?)\)/g)[0],r=r.replace("(",""),r=r.replaceAll(")",""),a.location=parseInt(r);let n=e.split(":");a.name=n[0].split(" ")[1],a.name=a.name.replaceAll(" "," "),a.name=a.name.replaceAll(" ",""),a.valueType=n[1],a.valueType=a.valueType.replaceAll(" "," "),a.valueType=a.valueType.replaceAll(" ",""),a.valueType=a.valueType.replaceAll("\r",""),a.valueType=a.valueType.replaceAll(")",""),a.valueType=a.valueType.replaceAll(")",""),a.size=or[a.valueType],t.push(a)}a.format=al[or[a.valueType]]}}class ye extends Kn{entryPoint="CsMain";workerSizeX=1;workerSizeY=0;workerSizeZ=0;_computePipeline;_csShaderModule;_destCS;_sourceCS;_storageTextureDic;_sampleTextureDic;_groupsShaderReflectionVarInfos;_groupCache={};constructor(e){super(),this._sourceCS=e,St.getShaderReflection2(e,this),this._storageTextureDic=new Map,this._sampleTextureDic=new Map}setStorageTexture(e,t){this._storageTextureDic.has(e)||this._storageTextureDic.set(e,t)}setSamplerTexture(e,t){this._sampleTextureDic.set(e,t)}compute(e){this._computePipeline||this.genComputePipeline(),e.setPipeline(this._computePipeline);for(let t=0;t<this.bindGroups.length;++t)e.setBindGroup(t,this.bindGroups[t]);this.workerSizeX&&this.workerSizeY&&this.workerSizeZ?e.dispatchWorkgroups(this.workerSizeX,this.workerSizeY,this.workerSizeZ):this.workerSizeX&&this.workerSizeY?e.dispatchWorkgroups(this.workerSizeX,this.workerSizeY):e.dispatchWorkgroups(this.workerSizeX)}createBufferBindGroup(e,t,a,r){let i=this._bufferDic.get(t);if(i){let n={binding:a,resource:{buffer:i.buffer,offset:0,size:i.memory.shareDataBuffer.byteLength}};r.push(n)}else console.error(`ComputeShader(${this.instanceID})`,`buffer ${t} is missing!`)}noticeBufferChange(e){let t=this._groupCache[e];t&&this.genGroups(t.groupIndex,t.infos,!0)}genGroups(e,t,a=!1){if(!this.bindGroups[e]||a){const r=t[e];let i=[];for(let o=0;o<r.length;++o){const l=r[o];if(l)switch(l.varType){case"uniform":case"storage-read":case"storage-read_write":this.createBufferBindGroup(e,l.varName,l.binding,i),this._groupCache[l.varName]={groupIndex:e,infos:t};break;case"var":if(l.dataType=="sampler"){let c=l.varName.replace("Sampler",""),f=this._sampleTextureDic.get(c);if(f){let h={binding:l.binding,resource:f.gpuSampler};i.push(h)}else console.error(`ComputeShader(${this.instanceID})`,`texture ${l.varName} is missing! `)}else if(l.dataType=="sampler_comparison"){let c=l.varName.replace("Sampler",""),f=this._sampleTextureDic.get(c);if(f){let h={binding:l.binding,resource:f.gpuSampler_comparison};i.push(h)}else console.error(`ComputeShader(${this.instanceID})`,`texture ${l.varName} is missing! `)}else if(l.dataType.indexOf("texture_storage")!=-1){let c=this._storageTextureDic.get(l.varName);if(c){let f={binding:l.binding,resource:c.getGPUView()};i.push(f),Ce.getInstance().attached(c,this)}else console.error(`ComputeShader(${this.instanceID})`,`texture ${l.varName} is missing! `)}else if(l.dataType.indexOf("texture")!=-1){let c=this._sampleTextureDic.get(l.varName);if(c){let f={binding:l.binding,resource:c.getGPUView()};i.push(f),Ce.getInstance().attached(c,this)}else console.error(`ComputeShader(${this.instanceID})`,`texture ${l.varName} is missing! `)}break;default:console.error("unprocessed type:",l.varType);break}}let n=w.device.createBindGroup({layout:this._computePipeline.getBindGroupLayout(e),entries:i});this.bindGroups[e]=n}}genComputePipeline(){this.preCompileShader(this._sourceCS),this.genReflection(),this._computePipeline=w.device.createComputePipeline({layout:"auto",compute:{module:this.compileShader(),entryPoint:this.entryPoint}}),this._groupsShaderReflectionVarInfos=[];let e=this.shaderReflection;this.bindGroups=[];for(let t=0;t<e.groups.length;++t){let a=e.groups[t];this._groupsShaderReflectionVarInfos[t]=a,this.genGroups(t,this._groupsShaderReflectionVarInfos)}w.addEventListener(ir.RESIZE,t=>{for(let a=0;a<e.groups.length;++a){let r=e.groups[a];this._groupsShaderReflectionVarInfos[a]=r,this.genGroups(a,this._groupsShaderReflectionVarInfos,!0)}},this)}preCompileShader(e){for(const t in this.constValues)if(Object.prototype.hasOwnProperty.call(this.constValues,t)){const a=this.constValues[t];e=e.replaceAll(`&${t}`,a.toString())}this._destCS=ma.parseComputeShader(e,this.defineValue)}compileShader(){let e=w.device.createShaderModule({label:`ComputeShader(${this.instanceID})`,code:this._destCS});return e.getCompilationInfo().then(t=>{t.messages.length>0&&console.warn("[shader error]",t,this._destCS)}),this._csShaderModule=e,e}genReflection(){this.shaderVariant+=St.genComputeShaderVariant(this);let e=St.poolGetReflection(this.shaderVariant);e?this.shaderReflection=e:(St.getShaderReflection2(this._destCS,this),St.combineShaderReflectionVarInfo(this.shaderReflection,this.shaderReflection.cs_variables))}}var le=(s=>(s[s.COLOR=1]="COLOR",s[s.REFLECTION=2]="REFLECTION",s[s.POSITION=4]="POSITION",s[s.GRAPHIC=8]="GRAPHIC",s[s.GI=16]="GI",s[s.Cluster=32]="Cluster",s[s.SHADOW=64]="SHADOW",s[s.POINT_SHADOW=128]="POINT_SHADOW",s[s.POST=256]="POST",s[s.DEPTH=512]="DEPTH",s[s.UI=1024]="UI",s))(le||{});class lt{static profilerLabelMap=new Map;static viewMap=new Map;static testObj={testValue1:0,testValue2:0,testValue3:0,testValue4:0};static startView(e){let t=this.viewMap.get(e);if(!t){t={};for(const a in le)parseInt(a)>=0||(t[a]={vertexCount:0,indicesCount:0,instanceCount:0,triCount:0,drawCount:0,pipelineCount:0});this.viewMap.set(e,t)}for(const a in le)parseInt(a)>=0||(t[a].vertexCount=0,t[a].indicesCount=0,t[a].triCount=0,t[a].instanceCount=0,t[a].drawCount=0,t[a].pipelineCount=0)}static viewCount(e){return this.startView(e),this.viewMap.get(e)}static viewCount_vertex(e,t,a){this.viewMap.get(e)[t].vertexCount+=a}static viewCount_indices(e,t,a){this.viewMap.get(e)[t].indicesCount+=a}static viewCount_tri(e,t,a){this.viewMap.get(e)[t].triCount+=a}static viewCount_instance(e,t,a){this.viewMap.get(e)[t].instanceCount+=a}static viewCount_draw(e,t){this.viewMap.get(e)[t].drawCount++}static viewCount_pipeline(e,t){this.viewMap.get(e)[t].pipelineCount++}static start(e){let t=this.profilerLabelMap.get(e);t||(t={lable:e,start:0,end:0,total:0,count:0,child:new Map},this.profilerLabelMap.set(e,t)),t.start=performance.now(),t.end=performance.now(),t.count=0,t.child.clear()}static end(e){let t=this.profilerLabelMap.get(e);t&&(t.end=performance.now(),t.total=t.end-t.start)}static countStart(e,t=""){let a=this.profilerLabelMap.get(e);if(a&&(a.count++,t!="")){let r=a.child.get(t);r||(r={lable:t,start:0,end:0,total:0,count:0}),r.start=performance.now(),r.end=performance.now(),r.count=0,a.child.set(t,r)}}static countEnd(e,t){let a=this.profilerLabelMap.get(e);if(a&&t!=""){let r=a.child.get(t);r||(r={lable:t,start:0,end:0,total:0,count:0}),r.end=performance.now(),r.total=r.end-r.start,r.count++}}static print(e){let t=this.profilerLabelMap.get(e);t&&console.log("performance",e,t.total+" ms")}}var Au=(()=>{var s=typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Yt&&Yt.tagName.toUpperCase()==="SCRIPT"&&Yt.src||new URL("rings.umd.max.js",document.baseURI).href;return(async function(e={}){var t=e,a,r;t.ready=new Promise((V,L)=>{a=V,r=L});var i=Object.assign({},t),n=[],o="./this.program",l=(V,L)=>{throw L},c=typeof window=="object",f=typeof importScripts=="function",h=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",u="";function g(V){return t.locateFile?t.locateFile(V,u):u+V}var A,m;if(h){const{createRequire:V}=await Promise.resolve().then(()=>dp);var p=V(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Yt&&Yt.tagName.toUpperCase()==="SCRIPT"&&Yt.src||new URL("rings.umd.max.js",document.baseURI).href),D=p("fs"),B=p("path");f?u=B.dirname(u)+"/":u=p("url").fileURLToPath(new URL("data:text/javascript;base64,DQp2YXIgTW9kdWxlID0gKCgpID0+IHsNCiAgdmFyIF9zY3JpcHREaXIgPSBpbXBvcnQubWV0YS51cmw7DQogIA0KICByZXR1cm4gKA0KYXN5bmMgZnVuY3Rpb24obW9kdWxlQXJnID0ge30pIHsNCg0KdmFyIE1vZHVsZT1tb2R1bGVBcmc7dmFyIHJlYWR5UHJvbWlzZVJlc29sdmUscmVhZHlQcm9taXNlUmVqZWN0O01vZHVsZVsicmVhZHkiXT1uZXcgUHJvbWlzZSgocmVzb2x2ZSxyZWplY3QpPT57cmVhZHlQcm9taXNlUmVzb2x2ZT1yZXNvbHZlO3JlYWR5UHJvbWlzZVJlamVjdD1yZWplY3R9KTt2YXIgbW9kdWxlT3ZlcnJpZGVzPU9iamVjdC5hc3NpZ24oe30sTW9kdWxlKTt2YXIgYXJndW1lbnRzXz1bXTt2YXIgdGhpc1Byb2dyYW09Ii4vdGhpcy5wcm9ncmFtIjt2YXIgcXVpdF89KHN0YXR1cyx0b1Rocm93KT0+e3Rocm93IHRvVGhyb3d9O3ZhciBFTlZJUk9OTUVOVF9JU19XRUI9dHlwZW9mIHdpbmRvdz09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gTW9kdWxlWyJwcmVJbml0Il09PSJmdW5jdGlvbiIpTW9kdWxlWyJwcmVJbml0Il09W01vZHVsZVsicHJlSW5pdCJdXTt3aGlsZShNb2R1bGVbInByZUluaXQiXS5sZW5ndGg+MCl7TW9kdWxlWyJwcmVJbml0Il0ucG9wKCkoKX19dmFyIHNob3VsZFJ1bk5vdz10cnVlO2lmKE1vZHVsZVsibm9Jbml0aWFsUnVuIl0pc2hvdWxkUnVuTm93PWZhbHNlO3J1bigpOw0KDQoNCiAgcmV0dXJuIG1vZHVsZUFyZy5yZWFkeQ0KfQ0KKTsNCn0pKCk7DQpleHBvcnQgZGVmYXVsdCBNb2R1bGU7",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Yt&&Yt.tagName.toUpperCase()==="SCRIPT"&&Yt.src||new URL("rings.umd.max.js",document.baseURI).href)),A=(L,te)=>(L=ue(L)?new URL(L):B.normalize(L),D.readFileSync(L,te?void 0:"utf8")),m=L=>{var te=A(L,!0);return te.buffer||(te=new Uint8Array(te)),te},!t.thisProgram&&process.argv.length>1&&(o=process.argv[1].replace(/\\/g,"/")),n=process.argv.slice(2),l=(L,te)=>{throw process.exitCode=L,te}}else(c||f)&&(f?u=self.location.href:typeof document<"u"&&document.currentScript&&(u=document.currentScript.src),s&&(u=s),u.startsWith("blob:")?u="":u=u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1),A=V=>{var L=new XMLHttpRequest;return L.open("GET",V,!1),L.send(null),L.responseText},f&&(m=V=>{var L=new XMLHttpRequest;return L.open("GET",V,!1),L.responseType="arraybuffer",L.send(null),new Uint8Array(L.response)}));var v=t.print||console.log.bind(console),C=t.printErr||console.error.bind(console);Object.assign(t,i),i=null,t.arguments&&(n=t.arguments),t.thisProgram&&(o=t.thisProgram),t.quit&&(l=t.quit);var y;t.wasmBinary&&(y=t.wasmBinary);function x(V){if(typeof h<"u"&&h){var L=Buffer.from(V,"base64");return new Uint8Array(L.buffer,L.byteOffset,L.length)}for(var te=atob(V),ke=new Uint8Array(te.length),Ze=0;Ze<te.length;++Ze)ke[Ze]=te.charCodeAt(Ze);return ke}function k(V){if(ce(V))return x(V.slice(ne.length))}var E,S=!1,Q,I,T,M;function Z(){var V=E.buffer;t.HEAP8=I=new Int8Array(V),t.HEAP16=new Int16Array(V),t.HEAPU8=T=new Uint8Array(V),t.HEAPU16=new Uint16Array(V),t.HEAP32=new Int32Array(V),t.HEAPU32=M=new Uint32Array(V),t.HEAPF32=new Float32Array(V),t.HEAPF64=new Float64Array(V)}var be=[],re=[],P=[],z=[];function H(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)$(t.preRun.shift());ut(be)}function O(){ut(re)}function ie(){ut(P)}function W(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)oe(t.postRun.shift());ut(z)}function $(V){be.unshift(V)}function ee(V){re.unshift(V)}function oe(V){z.unshift(V)}var fe=0,De=null;function Ne(V){fe++,t.monitorRunDependencies?.(fe)}function Ke(V){if(fe--,t.monitorRunDependencies?.(fe),fe==0&&De){var L=De;De=null,L()}}function q(V){t.onAbort?.(V),V="Aborted("+V+")",C(V),S=!0,Q=1,V+=". Build with -sASSERTIONS for more info.";var L=new WebAssembly.RuntimeError(V);throw r(L),L}var ne="data:application/octet-stream;base64,",ce=V=>V.startsWith(ne),ue=V=>V.startsWith("file://"),Re;Re="data:application/octet-stream;base64,AGFzbQEAAAABpAEaYAF/AX9gAn9/AGADf39/AX9gA39/fwBgAX8AYAAAYAV/f39/fwBgBH9/f38AYAJ/fwF/YAZ/f39/f38AYAABf2AEf39/fQBgBH9/f38Bf2ABfAF9YAJ8fwF8YAF9AX1gAXwBfGACfn8Bf2ADfHx/AXxgAnx8AXxgBn98f39/fwF/YAJ9fwF/YAJ8fwF/YAV/f39/fwF/YAN/fn8BfmADf399AAIfBQFhAWEADAFhAWIAAwFhAWMABQFhAWQAAAFhA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FqIgDCAXoiAYIA+ioKCgOQMIIAMgISAVoiAiIBaiICMgF6IgJCAYoqCgoDkDACACIANBgAEQFRoLIAVBADYCAAsgA0GAAWokACACC4gLAQd/AkAgASAAKAIMIgQgACgCCCIDa0EHdSICRg0AAkAgASACSwRAIAEgAmsiBiAAKAIQIgUgBCIDa0EHdU0EQAJAIAZFDQAgAyECIAZBA3EiBQRAQQAhBANAIAJBCGpBAEHwABAHGiACQoCAgICAgID4PzcDeCACQoCAgICAgID4PzcDUCACQoCAgICAgID4PzcDKCACQoCAgICAgID4PzcDACACQYABaiECIARBAWoiBCAFRw0ACwsgBkEHdCADaiEDIAZBAWtB////D3FBA0kNAANAIAJBCGpBAEHwABAHGiACQoCAgICAgID4PzcDeCACQoCAgICAgID4PzcDUCACQoCAgICAgID4PzcDKCACQoCAgICAgID4PzcDACACQYgBakEAQfAAEAcaIAJCgICAgICAgPg/NwP4ASACQoCAgICAgID4PzcD0AEgAkKAgICAgICA+D83A6gBIAJCgICAgICAgPg/NwOAASACQYgCakEAQfAAEAcaIAJCgICAgICAgPg/NwP4AiACQoCAgICAgID4PzcD0AIgAkKAgICAgICA+D83A6gCIAJCgICAgICAgPg/NwOAAiACQYgDakEAQfAAEAcaIAJCgICAgICAgPg/NwP4AyACQoCAgICAgID4PzcD0AMgAkKAgICAgICA+D83A6gDIAJCgICAgICAgPg/NwOAAyACQYAEaiICIANHDQALCyAAIAM2AgwMAgsCQCADIAAoAggiAmtBB3UiBCAGaiIHQYCAgBBJBEBBACEDQf///w8gBSACayIFQQZ1IgIgByACIAdLGyAFQYD///8HTxsiBwRAIAdBgICAEE8NAiAHQQd0EAshCAsgCCAEQQd0aiIEIQIgBkEDcSIFBEADQCACQQhqQQBB8AAQBxogAkKAgICAgICA+D83A3ggAkKAgICAgICA+D83A1AgAkKAgICAgICA+D83AyggAkKAgICAgICA+D83AwAgAkGAAWohAiADQQFqIgMgBUcNAAsLIAZBB3QgBGohBSAGQQFrQf///w9xQQNPBEADQCACQQhqQQBB8AAQBxogAkKAgICAgICA+D83A3ggAkKAgICAgICA+D83A1AgAkKAgICAgICA+D83AyggAkKAgICAgICA+D83AwAgAkGIAWpBAEHwABAHGiACQoCAgICAgID4PzcD+AEgAkKAgICAgICA+D83A9ABIAJCgICAgICAgPg/NwOoASACQoCAgICAgID4PzcDgAEgAkGIAmpBAEHwABAHGiACQoCAgICAgID4PzcD+AIgAkKAgICAgICA+D83A9ACIAJCgICAgICAgPg/NwOoAiACQoCAgICAgID4PzcDgAIgAkGIA2pBAEHwABAHGiACQoCAgICAgID4PzcD+AMgAkKAgICAgICA+D83A9ADIAJCgICAgICAgPg/NwOoAyACQoCAgICAgID4PzcDgAMgAkGABGoiAiAFRw0ACwsgACgCDCICIAAoAggiA0cEQANAIARBgAFrIgQgAkGAAWsiAkGAARAVGiACIANHDQALIAAoAgghAgsgACAIIAdBB3RqNgIQIAAgBTYCDCAAIAQ2AgggAgRAIAIQFgsMAwsQEwALEBIACyABIAJPDQAgACADIAFBB3RqNgIMCwJAIAAoAhggACgCFCIDa0HIAG0iAiABSQRAIABBFGogASACaxA8DAELIAEgAk8NACAAIAMgAUHIAGxqNgIYCwJAIAAoAiQgACgCICIDa0EEdSICIAFJBEAgAEEgaiABIAJrEDsMAQsgASACTw0AIAAgAyABQQR0ajYCJAsgACgCMCAAKAIsIgNrQcgAbSICIAFJBEAgAEEsaiABIAJrEDwPCyABIAJPDQAgACADIAFByABsajYCMAsLBwAgACgCLAsHACAAKAIgCwcAIAAoAhQLBwAgACgCCAvUBQEHfyABIAAoAggiByAAKAIEIgNrQQR1TQRAAkAgAUUNACADIQIgAUEHcSIFBEADQCACQv////8PNwIIIAJCADcCACACQRBqIQIgBEEBaiIEIAVHDQALCyABQQR0IANqIQMgAUEBa0H/////AHFBB0kNAANAIAJC/////w83AnggAkIANwJwIAJC/////w83AmggAkIANwJgIAJC/////w83AlggAkIANwJQIAJC/////w83AkggAkIANwJAIAJC/////w83AjggAkIANwIwIAJC/////w83AiggAkIANwIgIAJC/////w83AhggAkIANwIQIAJC/////w83AgggAkIANwIAIAJBgAFqIgIgA0cNAAsLIAAgAzYCBA8LAkAgAyAAKAIAIgJrQQR1IgQgAWoiBkGAgICAAUkEQEH/////ACAHIAJrIgdBA3UiAiAGIAIgBksbIAdB8P///wdPGyIGBEAgBkGAgICAAU8NAiAGQQR0EAshCAsgCCAEQQR0aiIEIQIgAUEHcSIHBEADQCACQv////8PNwIIIAJCADcCACACQRBqIQIgBUEBaiIFIAdHDQALCyABQQR0IARqIQUgAUEBa0H/////AHFBB08EQANAIAJC/////w83AnggAkIANwJwIAJC/////w83AmggAkIANwJgIAJC/////w83AlggAkIANwJQIAJC/////w83AkggAkIANwJAIAJC/////w83AjggAkIANwIwIAJC/////w83AiggAkIANwIgIAJC/////w83AhggAkIANwIQIAJC/////w83AgggAkIANwIAIAJBgAFqIgIgBUcNAAsLIAAoAgAiASADRwRAA0AgBEEQayIEIANBEGsiA/0AAgD9CwIAIAEgA0cNAAsgACgCACEDCyAAIAggBkEEdGo2AgggACAFNgIEIAAgBDYCACADBEAgAxAMCw8LEBMACxASAAuLAwEHfyABIAAoAggiAiAAKAIEIgNrQcgAbU0EQCAAIAEEfyADQQAgAUHIAGxByABrIgAgAEHIAHBrQcgAaiIAEAcgAGoFIAMLNgIEDwsCQCADIAAoAgAiBmtByABtIgggAWoiBEHk8bgcSQRAQePxuBwgAiAGa0HIAG0iB0EBdCICIAQgAiAESxsgB0HxuJwOTxsiBARAIARB5PG4HE8NAiAEQcgAbBALIQULIAUgCEHIAGxqIgJBACABQcgAbEHIAGsiASABQcgAcGtByABqIgcQByIBIAdqIQggBSAEQcgAbGohBwJAIAMgBkYEQCABIQUMAQsDQCACQcgAayIFIANByABrIgH9AAMA/QsDACACQThrIANBOGv9AAMA/QsDACACQShrIANBKGv9AAMA/QsDACACQRhrIANBGGv9AAMA/QsDACACQQhrIANBCGsrAwA5AwAgBSECIAEiAyAGRw0ACwsgACAHNgIIIAAgCDYCBCAAIAU2AgAgBgRAIAYQDAsPCxATAAsQEgALGQEBf0GgKygCACIBIAAgASgCACgCGBEBAAsQACMAIABrQXBxIgAkACAACwcAIAAoAgQLBQBBowkLBQBBzQkLBQBBkAkLFwEBf0GgKygCACIAIAAoAgAoAhQRAAALFQAgAEUEQEEADwsgAEHkJhAiQQBHCxoAIAAgASgCCCAFEAoEQCABIAIgAyAEECALCzcAIAAgASgCCCAFEAoEQCABIAIgAyAEECAPCyAAKAIIIgAgASACIAMgBCAFIAAoAgAoAhQRCQALpwEAIAAgASgCCCAEEAoEQAJAIAEoAgQgAkcNACABKAIcQQFGDQAgASADNgIcCw8LAkAgACABKAIAIAQQCkUNAAJAIAIgASgCEEcEQCABKAIUIAJHDQELIANBAUcNASABQQE2AiAPCyABIAI2AhQgASADNgIgIAEgASgCKEEBajYCKAJAIAEoAiRBAUcNACABKAIYQQJHDQAgAUEBOgA2CyABQQQ2AiwLC4gCACAAIAEoAgggBBAKBEACQCABKAIEIAJHDQAgASgCHEEBRg0AIAEgAzYCHAsPCwJAIAAgASgCACAEEAoEQAJAIAIgASgCEEcEQCABKAIUIAJHDQELIANBAUcNAiABQQE2AiAPCyABIAM2AiACQCABKAIsQQRGDQAgAUEAOwE0IAAoAggiACABIAIgAkEBIAQgACgCACgCFBEJACABLQA1BEAgAUEDNgIsIAEtADRFDQEMAwsgAUEENgIsCyABIAI2AhQgASABKAIoQQFqNgIoIAEoAiRBAUcNASABKAIYQQJHDQEgAUEBOgA2DwsgACgCCCIAIAEgAiADIAQgACgCACgCGBEGAAsLMQAgACABKAIIQQAQCgRAIAEgAiADECEPCyAAKAIIIgAgASACIAMgACgCACgCHBEHAAsYACAAIAEoAghBABAKBEAgASACIAMQIQsLFwEBf0GgKygCACIAIAAoAgAoAhARAAALnAEBAn8jAEFAaiIDJAACf0EBIAAgAUEAEAoNABpBACABRQ0AGkEAIAFBhCYQIiIBRQ0AGiADQQxqQQBBNBAHGiADQQE2AjggA0F/NgIUIAMgADYCECADI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AAAKATAABkFAAAWBQAAAAAAACwFAAAAgAAACkAAAAqAAAAU3QxMWxvZ2ljX2Vycm9yAKATAACgFAAAQBQAAAAAAADkFAAAAgAAACsAAAAqAAAAU3QxMmxlbmd0aF9lcnJvcgAAAACgEwAA0BQAALAUAABTdDl0eXBlX2luZm8AAAAAeBMAAPAUAEGIKgsBBQBBlCoLARMAQawqCw4UAAAAFQAAALgVAAAABABBxCoLAQEAQdQqCwX/////CgBBmCsLA3AcAQ==",ce(Re)||(Re=g(Re));function ge(V){if(V==Re&&y)return new Uint8Array(y);var L=k(V);if(L)return L;if(m)return m(V);throw"both async and sync fetching of the wasm failed"}function Se(V){return Promise.resolve().then(()=>ge(V))}function Ie(V,L,te){return Se(V).then(ke=>WebAssembly.instantiate(ke,L)).then(te,ke=>{C(`failed to asynchronously prepare wasm: ${ke}`),q(ke)})}function Me(V,L,te,ke){return Ie(L,te,ke)}function ze(){var V={a:pp};function L(ke,Ze){return Ot=ke.exports,E=Ot.f,Z(),ee(Ot.g),Ke(),Ot}Ne();function te(ke){L(ke.instance)}if(t.instantiateWasm)try{return t.instantiateWasm(V,L)}catch(ke){C(`Module.instantiateWasm callback failed with error: ${ke}`),r(ke)}return Me(y,Re,V,te).catch(r),{}}function Vt(V){this.name="ExitStatus",this.message=`Program terminated with exit(${V})`,this.status=V}var ut=V=>{for(;V.length>0;)V.shift()(t)};t.noExitRuntime;class rr{constructor(L){this.excPtr=L,this.ptr=L-24}set_type(L){M[this.ptr+4>>2]=L}get_type(){return M[this.ptr+4>>2]}set_destructor(L){M[this.ptr+8>>2]=L}get_destructor(){return M[this.ptr+8>>2]}set_caught(L){L=L?1:0,I[this.ptr+12]=L}get_caught(){return I[this.ptr+12]!=0}set_rethrown(L){L=L?1:0,I[this.ptr+13]=L}get_rethrown(){return I[this.ptr+13]!=0}init(L,te){this.set_adjusted_ptr(0),this.set_type(L),this.set_destructor(te)}set_adjusted_ptr(L){M[this.ptr+16>>2]=L}get_adjusted_ptr(){return M[this.ptr+16>>2]}get_exception_ptr(){var L=su(this.get_type());if(L)return M[this.excPtr>>2];var te=this.get_adjusted_ptr();return te!==0?te:this.excPtr}}var Fa=0,Ga=(V,L,te)=>{var ke=new rr(V);throw ke.init(L,te),Fa=V,Fa},za=()=>{q("")},ta=(V,L,te)=>T.copyWithin(V,L,L+te),Wa=()=>2147483648,ua=V=>{var L=E.buffer,te=(V-L.byteLength+65535)/65536;try{return E.grow(te),Z(),1}catch{}},Mt=V=>{var L=T.length;V>>>=0;var te=Wa();if(V>te)return!1;for(var ke=(Ea,bi)=>Ea+(bi-Ea%bi)%bi,Ze=1;Ze<=4;Ze*=2){var st=L*(1+.2/Ze);st=Math.min(st,V+100663296);var Ye=Math.min(te,ke(Math.max(V,st),65536)),We=ua(Ye);if(We)return!0}return!1},ka=[null,[],[]],ba=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Lr=(V,L,te)=>{for(var ke=L+te,Ze=L;V[Ze]&&!(Ze>=ke);)++Ze;if(Ze-L>16&&V.buffer&&ba)return ba.decode(V.subarray(L,Ze));for(var st="";L<Ze;){var Ye=V[L++];if(!(Ye&128)){st+=String.fromCharCode(Ye);continue}var We=V[L++]&63;if((Ye&224)==192){st+=String.fromCharCode((Ye&31)<<6|We);continue}var Ea=V[L++]&63;if((Ye&240)==224?Ye=(Ye&15)<<12|We<<6|Ea:Ye=(Ye&7)<<18|We<<12|Ea<<6|V[L++]&63,Ye<65536)st+=String.fromCharCode(Ye);else{var bi=Ye-65536;st+=String.fromCharCode(55296|bi>>10,56320|bi&1023)}}return st},Gr=(V,L)=>{var te=ka[V];L===0||L===10?((V===1?v:C)(Lr(te,0)),te.length=0):te.push(L)},zr=(V,L,te,ke)=>{for(var Ze=0,st=0;st<te;st++){var Ye=M[L>>2],We=M[L+4>>2];L+=8;for(var Ea=0;Ea<We;Ea++)Gr(V,T[Ye+Ea]);Ze+=We}return M[ke>>2]=Ze,0},Wr=V=>{Q=V,l(V,new Vt(V))},Jr=(V,L)=>{Q=V,Wr(V)},hp=V=>{if(V instanceof Vt||V=="unwind")return Q;l(1,V)},up=V=>{for(var L=0,te=0;te<V.length;++te){var ke=V.charCodeAt(te);ke<=127?L++:ke<=2047?L+=2:ke>=55296&&ke<=57343?(L+=4,++te):L+=3}return L},bp=(V,L,te,ke)=>{if(!(ke>0))return 0;for(var Ze=te,st=te+ke-1,Ye=0;Ye<V.length;++Ye){var We=V.charCodeAt(Ye);if(We>=55296&&We<=57343){var Ea=V.charCodeAt(++Ye);We=65536+((We&1023)<<10)|Ea&1023}if(We<=127){if(te>=st)break;L[te++]=We}else if(We<=2047){if(te+1>=st)break;L[te++]=192|We>>6,L[te++]=128|We&63}else if(We<=65535){if(te+2>=st)break;L[te++]=224|We>>12,L[te++]=128|We>>6&63,L[te++]=128|We&63}else{if(te+3>=st)break;L[te++]=240|We>>18,L[te++]=128|We>>12&63,L[te++]=128|We>>6&63,L[te++]=128|We&63}}return L[te]=0,te-Ze},gp=(V,L,te)=>bp(V,T,L,te),mp=V=>{var L=up(V)+1,te=Zo(L);return gp(V,te,L),te},pp={b:Ga,c:za,e:ta,d:Mt,a:zr},Ot=ze();t._initialize=(V,L,te)=>(t._initialize=Ot.h)(V,L,te),t._allocMatrix=V=>(t._allocMatrix=Ot.i)(V),t._getMatrixBufferPtr=()=>(t._getMatrixBufferPtr=Ot.j)(),t._getSRTPtr=()=>(t._getSRTPtr=Ot.k)(),t._getInfoPtr=()=>(t._getInfoPtr=Ot.l)(),t._getContinuedSRTPtr=()=>(t._getContinuedSRTPtr=Ot.m)(),t._printMatrix=V=>(t._printMatrix=Ot.n)(V),t._updateAllMatrixContinueTransform=(V,L,te)=>(t._updateAllMatrixContinueTransform=Ot.o)(V,L,te);var nu=t._main=(V,L)=>(nu=t._main=Ot.p)(V,L),Zo=V=>(Zo=Ot.r)(V),su=V=>(su=Ot.s)(V),jn;De=function V(){jn||ou(),jn||(De=V)};function Ap(V=[]){var L=nu;V.unshift(o);var te=V.length,ke=Zo((te+1)*4),Ze=ke;V.forEach(Ye=>{M[Ze>>2]=mp(Ye),Ze+=4}),M[Ze>>2]=0;try{var st=L(te,ke);return Jr(st,!0),st}catch(Ye){return hp(Ye)}}function ou(V=n){if(fe>0||(H(),fe>0))return;function L(){jn||(jn=!0,t.calledRun=!0,!S&&(O(),ie(),a(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),lu&&Ap(V),W()))}t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),L()},1)):L()}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();var lu=!0;return t.noInitialRun&&(lu=!1),ou(),e.ready})})();function cr(s,e,t){return _.setting.doublePrecision?new Float64Array(s,e,t):new Float32Array(s,e,t)}class Ee{static matrixBuffer;static matrixSRTBuffer;static matrixContinuedSRTBuffer;static matrixStateBuffer;static matrixBufferPtr;static matrixSRTBufferPtr;static matrixContinuedSRTBufferPtr;static matrixStateBufferPtr;static wasm;static stateStruct=4;static useDoublePrecision=!1;static async init(e,t=!1){this.wasm=await Au(),this.useDoublePrecision=t,this.wasm._initialize(e,t,0),this.allocMatrix(e)}static allocMatrix(e){e>R.maxCount&&console.error(`The maximum allocation size is exceeded! current:${e}, limit:${R.maxCount}`),this.wasm._allocMatrix(e),this.matrixBufferPtr=this.wasm._getMatrixBufferPtr(),this.matrixSRTBufferPtr=this.wasm._getSRTPtr(),this.matrixStateBufferPtr=this.wasm._getInfoPtr(),this.matrixContinuedSRTBufferPtr=this.wasm._getContinuedSRTPtr(),this.useDoublePrecision?(this.matrixBuffer=cr(this.wasm.HEAPF64.buffer,this.matrixBufferPtr,16*e),this.matrixSRTBuffer=cr(this.wasm.HEAPF64.buffer,this.matrixSRTBufferPtr,9*e),this.matrixContinuedSRTBuffer=cr(this.wasm.HEAPF64.buffer,this.matrixContinuedSRTBufferPtr,9*e),R.blockBytes=R.block*8):(this.matrixBuffer=cr(this.wasm.HEAPF32.buffer,this.matrixBufferPtr,16*e),this.matrixSRTBuffer=cr(this.wasm.HEAPF32.buffer,this.matrixSRTBufferPtr,9*e),this.matrixContinuedSRTBuffer=cr(this.wasm.HEAPF32.buffer,this.matrixContinuedSRTBufferPtr,9*e),R.blockBytes=R.block*4),this.matrixStateBuffer=new Int32Array(this.wasm.HEAP32.buffer,this.matrixStateBufferPtr,Ee.stateStruct*e),R.allocMatrix(e)}static updateAllContinueTransform(e,t,a){this.wasm._updateAllMatrixContinueTransform(e,t,a)}static setParent(e,t,a){this.matrixStateBuffer[e*Ee.stateStruct+2]=t>=0?t:-1,this.matrixStateBuffer[e*Ee.stateStruct+3]=a}static setTranslate(e,t,a,r){this.matrixSRTBuffer[e*9+6]=t,this.matrixSRTBuffer[e*9+7]=a,this.matrixSRTBuffer[e*9+8]=r}static setRotation(e,t,a,r){this.matrixSRTBuffer[e*9+3]=t%360,this.matrixSRTBuffer[e*9+4]=a%360,this.matrixSRTBuffer[e*9+5]=r%360}static setScale(e,t,a,r){this.matrixSRTBuffer[e*9+0]=t,this.matrixSRTBuffer[e*9+1]=a,this.matrixSRTBuffer[e*9+2]=r}static setContinueTranslate(e,t,a,r){(t!=0||a!=0||r!=0)&&(this.matrixContinuedSRTBuffer[e*9+6]=t,this.matrixContinuedSRTBuffer[e*9+7]=a,this.matrixContinuedSRTBuffer[e*9+8]=r,this.matrixStateBuffer[e*Ee.stateStruct+1]=1)}static setContinueRotation(e,t,a,r){(t!=0||a!=0||r!=0)&&(this.matrixContinuedSRTBuffer[e*9+3]=t,this.matrixContinuedSRTBuffer[e*9+4]=a,this.matrixContinuedSRTBuffer[e*9+5]=r,this.matrixStateBuffer[e*Ee.stateStruct+1]=1)}static setContinueScale(e,t,a,r){(t!=0||a!=0||r!=0)&&(this.matrixContinuedSRTBuffer[e*9+0]=t,this.matrixContinuedSRTBuffer[e*9+1]=a,this.matrixContinuedSRTBuffer[e*9+2]=r,this.matrixStateBuffer[e*Ee.stateStruct+1]=1)}}class ia{static AXIS_ANGLE="axisAngle";static EULER_ANGLES="eulerAngles";static QUATERNION="quaternion"}class ae{static HELP_0=new ae(0,0,0,1);static HELP_1=new ae(0,0,0,1);static HELP_2=new ae(0,0,0,1);static _zero=new ae(0,0,0,1);static CALCULATION_QUATERNION=new ae;x=0;y=0;z=0;w=1;constructor(e=0,t=0,a=0,r=1){this.x=e,this.y=t,this.z=a,this.w=r}static identity(){return ae._zero}static quaternionToMatrix(e,t){let a=e.x*2,r=e.y*2,i=e.z*2,n=e.x*a,o=e.y*r,l=e.z*i,c=e.x*r,f=e.x*i,h=e.y*i,u=e.w*a,g=e.w*r,A=e.w*i;t.rawData[0]=1-(o+l),t.rawData[1]=c+A,t.rawData[2]=f-g,t.rawData[3]=0,t.rawData[4]=c-A,t.rawData[5]=1-(n+l),t.rawData[6]=h+u,t.rawData[7]=0,t.rawData[8]=f+g,t.rawData[9]=h-u,t.rawData[10]=1-(n+o),t.rawData[11]=0,t.rawData[12]=0,t.rawData[13]=0,t.rawData[14]=0,t.rawData[15]=1}get magnitude(){return Math.sqrt(this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z)}set(e=0,t=0,a=0,r=1){return this.x=e,this.y=t,this.z=a,this.w=r,this}divide(e){return e instanceof ae?new ae(this.x/e.x,this.y/e.y,this.z/e.z):(this.x=this.x/e,this.y=this.y/e,this.z=this.z/e,this)}setFromArray(e){return this.x=e[0],this.y=e[1],this.z=e[2],this.w=e[3],this}multiply(e,t){var a=e.w,r=e.x,i=e.y,n=e.z,o=t.w,l=t.x,c=t.y,f=t.z;this.w=a*o-r*l-i*c-n*f,this.x=a*l+r*o+i*f-n*c,this.y=a*c-r*f+i*o+n*l,this.z=a*f+r*c-i*l+n*o}multiplyVector(e,t=null){t||=new ae;var a=e.x,r=e.y,i=e.z;return t.w=-this.x*a-this.y*r-this.z*i,t.x=this.w*a+this.y*i-this.z*r,t.y=this.w*r-this.x*i+this.z*a,t.z=this.w*i+this.x*r-this.y*a,t}fromAxisAngle(e,t){t*=Math.PI/180;var a=t*.5,r=Math.sin(a);this.w=Math.cos(a),this.x=e.x*r,this.y=e.y*r,this.z=e.z*r,this.normalize()}toAxisAngle(e){var t=this.x*this.x+this.y*this.y+this.z*this.z,a=0;return t>0?(a=2*Math.acos(this.w),t=1/Math.sqrt(t),e.x=this.x*t,e.y=this.y*t,e.z=this.z*t):(a=0,e.x=1,e.y=0,e.z=0),a}slerp(e,t,a){var r=e.w,i=e.x,n=e.y,o=e.z,l=t.w,c=t.x,f=t.y,h=t.z,u=r*l+i*c+n*f+o*h;if(u<0&&(u=-u,l=-l,c=-c,f=-f,h=-h),u<.95){var g=Math.acos(u),A=1/Math.sin(g),m=Math.sin(g*(1-a))*A,p=Math.sin(g*a)*A;this.w=r*m+l*p,this.x=i*m+c*p,this.y=n*m+f*p,this.z=o*m+h*p}else{this.w=r+a*(l-r),this.x=i+a*(c-i),this.y=n+a*(f-n),this.z=o+a*(h-o);var D=1/Math.sqrt(this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z);this.w*=D,this.x*=D,this.y*=D,this.z*=D}}lerp(e,t,a){var r=e.w,i=e.x,n=e.y,o=e.z,l=t.w,c=t.x,f=t.y,h=t.z,u;r*l+i*c+n*f+o*h<0&&(l=-l,c=-c,f=-f,h=-h),this.w=r+a*(l-r),this.x=i+a*(c-i),this.y=n+a*(f-n),this.z=o+a*(h-o),u=1/Math.sqrt(this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z),this.w*=u,this.x*=u,this.y*=u,this.z*=u}fromEulerAngles(e,t,a){e*=pt,t*=pt,a*=pt;var r=e*.5,i=t*.5,n=a*.5,o=Math.cos(r),l=Math.sin(r),c=Math.cos(i),f=Math.sin(i),h=Math.cos(n),u=Math.sin(n);return this.w=o*c*h+l*f*u,this.x=l*c*h-o*f*u,this.y=o*f*h+l*c*u,this.z=o*c*u-l*f*h,this}setFromRotationMatrix(e){const t=e.rawData,a=t[0],r=t[4],i=t[8],n=t[1],o=t[5],l=t[9],c=t[2],f=t[6],h=t[10],u=a+o+h;if(u>0){const g=.5/Math.sqrt(u+1);this.w=.25/g,this.x=(f-l)*g,this.y=(i-c)*g,this.z=(n-r)*g}else if(a>o&&a>h){const g=2*Math.sqrt(1+a-o-h);this.w=(f-l)/g,this.x=.25*g,this.y=(r+n)/g,this.z=(i+c)/g}else if(o>h){const g=2*Math.sqrt(1+o-a-h);this.w=(i-c)/g,this.x=(r+n)/g,this.y=.25*g,this.z=(l+f)/g}else{const g=2*Math.sqrt(1+h-a-o);this.w=(n-r)/g,this.x=(i+c)/g,this.y=(l+f)/g,this.z=.25*g}return this}getEulerAngles(e){var t,a,r,i,n,o,l,c;return e||=new b,i=this.x,n=this.y,o=this.z,l=this.w,c=2*(l*n-i*o),c<=-.99999?(t=2*Math.atan2(i,l),a=-Math.PI/2,r=0):c>=.99999?(t=2*Math.atan2(i,l),a=Math.PI/2,r=0):(t=Math.atan2(2*(l*i+n*o),1-2*(i*i+n*n)),a=Math.asin(c),r=Math.atan2(2*(l*o+i*n),1-2*(n*n+o*o))),e.set(t,a,r).scaleBy(Yr)}normalize(e=1){var t=e/Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);this.x*=t,this.y*=t,this.z*=t,this.w*=t}toString(){return"{x:"+this.x+" y:"+this.y+" z:"+this.z+" w:"+this.w+"}"}fromMatrix(e){var t=e.decompose(ia.QUATERNION)[1];this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w}inverse(e=null){e||=new ae;var t=this.w*this.w+this.x*this.x+this.y*this.y+this.z*this.z;if(t>0){var a=1/t;e.w=this.w*a,e.x=-this.x*a,e.y=-this.y*a,e.z=-this.z*a}return e}clone(){return new ae(this.x,this.y,this.z,this.w)}transformVector(e,t=null){var a,r,i,n,o=e.x,l=e.y,c=e.z;return t||=new b,n=-this.x*o-this.y*l-this.z*c,a=this.w*o+this.y*c-this.z*l,r=this.w*l-this.x*c+this.z*o,i=this.w*c+this.x*l-this.y*o,t.x=-n*this.x+a*this.w-r*this.z+i*this.y,t.y=-n*this.y+a*this.z+r*this.w-i*this.x,t.z=-n*this.z-a*this.y+r*this.x+i*this.w,t}copyFrom(e){var t=this;return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,this}mul(e,t,a){let r=a||new ae;return r.x=e.w*t.x+e.x*t.w+e.y*t.z-e.z*t.y,r.y=e.w*t.y+e.y*t.w+e.z*t.x-e.x*t.z,r.z=e.w*t.z+e.z*t.w+e.x*t.y-e.y*t.x,r.w=e.w*t.w-e.x*t.x-e.y*t.y-e.z*t.z,r}clampf(e,t,a){if(t>a){var r=t;t=a,a=r}return e<t?t:e<a?e:a}static serialize(e){return new ae(e.x,e.y,e.z,e.w)}}function Du(s,e,t){let a=s.x*2,r=s.y*2,i=s.z*2,n=s.x*a,o=s.y*r,l=s.z*i,c=s.x*r,f=s.x*i,h=s.y*i,u=s.w*a,g=s.w*r,A=s.w*i,m=t||new b;return m.x=(1-(o+l))*e.x+(c-A)*e.y+(f+g)*e.z,m.y=(c+A)*e.x+(1-(n+l))*e.y+(h-u)*e.z,m.z=(f-g)*e.x+(h+u)*e.y+(1-(n+o))*e.z,m}class pi{_x=0;_y=0;_z=0;_w=0;constructor(e=0){this.seed=e}get seed(){return this._x}set seed(e){this._x=e,this._y=this._x*1812433253+1,this._z=this._y*1812433253+1,this._w=this._z*1812433253+1}static getFloatFromInt(e){return Math.floor((e&8388607)*(1/8388607))}static getByteFromInt(e){return e>>15}clone(){let e=new pi;return e._x=this._x,e._y=this._y,e._z=this._z,e._w=this._w,e}get(){let e=this._x^this._x<<11;return this._x=this._y,this._y=this._z,this._z=this._w,this._w=this._w^this._w>>19^(e^e>>8)}getFloat(){return lc(this.get())}getSignedFloat(){return this.getFloat()*2-1}}let Yr=180/Math.PI,pt=Math.PI/180,_u=2147483647,Bu=-2147483647;function Ae(s,e,t){return Math.max(e,Math.min(t,s))}class Pt{static gaussFunction(e,t,a,r){let i=Math.pow(e-a,2),n=2*Math.pow(r,2),o=-1*(i/n),l=Math.pow(Math.E,o);return Math.round(l*t)}static computeGaussian(e,t){return 1/Math.sqrt(2*Math.PI*t)*Math.exp(-(e*e)/(2*t*t))}static gaussCoef(e){e<.5&&(e=.5);let t=Math.exp(.726*.726)/e,a=Math.exp(-t),r=Math.exp(-2*t),i=(1-a)*(1-a)/(1+2*t*a-r),n=i,o=i*(t-1)*a,l=i*(t+1)*a,c=-i*r,f=2*a,h=-r,u=(n+o)/(1-f-h),g=(l+c)/(1-f-h);return new Float32Array([n,o,l,c,f,h,u,g])}static clampf(e,t,a){if(t>a){let r=t;t=a,a=r}return e<t?t:e<a?e:a}static normalizeAngle(e){for(;e>180;)e-=360;for(;e<-180;)e+=360;return e}static fract(e){return e-Math.floor(e)}static getRandDirXZ(e){let t=e*Math.random(),a=360*Math.random()*pt,r=Math.cos(a)*t,i=Math.sin(a)*t;return{x:r,z:i}}static getRandDirXYZ(e){let t=e*Math.random(),a=360*Math.random()*pt,r=Math.cos(a)*t,i=Math.tan(a)*t,n=Math.sin(a)*t;return new b(r,i,n)}static getCycleXYZ(e){let t=e*Math.random(),a=360*Math.random()*pt,r=Math.cos(a)*t,i=e*Math.random()-e*.5,n=Math.sin(a)*t;return new b(r,i,n)}static angle(e,t){let a=de.HELP_0,r=de.HELP_1;return a.set(e.x,e.z),r.set(t.x,t.z),Math.acos((a.x*r.x+a.y*r.y)/(a.abs()*r.abs()))}static angle_360(e,t){let a=b.HELP_0;return e.crossProduct(t,a),a.z>0?Pt.angle(e,t):360-Pt.angle(e,t)}getRotationY(e){return Pt.normalizeAngle(Math.atan2(e.z,e.x)*Yr)}static fromToRotation(e,t,a=null){a||=new ae;let r=R.help_matrix_2;return R.fromToRotation(e,t,r),a.fromMatrix(r),a}static getEularDir_yUp(e){let t=ae.HELP_0;return t.fromEulerAngles(0,e,0),t.transformVector(b.Z_AXIS,b.HELP_5),b.HELP_5}static transformVector(e,t,a=null){a||=new b;let r=e.rawData,i=r[0],n=r[1],o=r[2],l=r[3],c=r[4],f=r[5],h=r[6],u=r[7],g=r[8],A=r[9],m=r[10],p=r[11],D=r[12],B=r[13],v=r[14],C=r[15],y=t.x,x=t.y,k=t.z;return a.x=i*y+c*x+g*k+D,a.y=n*y+f*x+A*k+B,a.z=o*y+h*x+m*k+v,a.w=l*y+u*x+p*k+C,a}}let Sr=function(s,e,t){return s*(1-t)+e*t};function vu(s,e,t){let a=new b,r=s.x,i=s.y,n=s.z,o=s.w,l=e.x,c=e.y,f=e.z,h=e.w;return a.x=(l-r)*t+r,a.y=(c-i)*t+i,a.z=(f-n)*t+n,a.w=(h-o)*t+o,a}function Uu(s,e,t){let a=new J;return a.r=(1-t)*s.r+t*e.r,a.g=(1-t)*s.g+t*e.g,a.b=(1-t)*s.b+t*e.b,a.a=(1-t)*s.a+t*e.a,a}function yu(s,e,t){return s+((e-s)*t>>8)&255}let rs=function(s,e,t){let a=t-e;return Math.floor(s/a)%2==0?s%a+e:t-s%a+e},is=function(s,e,t){let a=t-e;return s%a+e},Cu=function(s,e){let t=0;for(let a in s)a==e&&t++;return t};class Su{x=0;y=0;z=0;w=0;randSeedList;constructor(){this.randSeedList=[]}reset(){this.x=Math.random()*1,this.y=Math.random()*1,this.z=Math.random()*1,this.w=Math.random()*1,this.randSeedList.length=0;for(let e=0;e<20;e++)this.randSeedList.push(Math.random()*1)}}function xt(s,e){return s instanceof b&&e instanceof b||s instanceof ae&&e instanceof ae?s.x*e.x+s.y*e.y+s.z*e.z:s.x*e.x+s.y*e.y}function ns(s,e){return new b(s.x*e.x,s.y*e.y,s.z*e.z)}function sc(s){return Math.sqrt(s)}function ss(s){return sc(xt(s,s))}function oc(s,e){if(ss(s)>b.EPSILON)return s.divide(ss(s));if(s instanceof de)return new de;if(s instanceof b)return new b;if(s instanceof ae)return new ae}function lc(s){return(s&8388607)*(1/8388607)}function Xr(s){return s.getFloat()}function At(s,e,t){let a=s.getFloat();return a=e*a+(1-a)*t,a}function xu(s,e,t){let a;if(e<t){a=t-e;let r=s.get()%a;return r+=e,r}else if(e>t){a=e-t;let r=s.get()%a;return r=e-r,r}else return e}function ln(s){let e=At(s,-1,1),t=At(s,0,2*Math.PI),a=Math.sqrt(1-e*e),r=a*Math.cos(t),i=a*Math.sin(t);return new b(r,i,e)}function cc(s){let e=At(s,0,2*Math.PI),t=Math.cos(e),a=Math.sin(e);return new de(t,a)}function Fu(s){let e=new ae;return e.x=At(s,-1,1),e.y=At(s,-1,1),e.z=At(s,-1,1),e.w=At(s,-1,1),e=oc(e),xt(e,ae.identity())<0?-e:e}function ku(s){const e=2*Math.PI;let t=At(s,0,1),a=At(s,0,e),r=At(s,0,e),i=Math.sqrt(1-t),n=Math.sqrt(t),o=new ae(i*Math.sin(a),i*Math.cos(a),n*Math.sin(r),n*Math.cos(r));return xt(o,ae.identity())<0?-o:o}function Eu(s,e){return new b(At(s,-e.x,e.x),At(s,-e.y,e.y),At(s,-e.z,e.z))}function fc(s){let e=ln(s);return e.scaleBy(Math.pow(Xr(s),1/3)),e}function wu(s,e){return ns(fc(s),e)}function Ru(s,e,t){let a=ln(s),r=Math.pow(At(s,0,1),1/3);return a.scaleBy(e+(t-e)*r),a}function Iu(s){let e=cc(s);return e.multiply(Math.pow(At(s,0,1),1/2),e),e}function Qu(s,e,t){let a=ns(ln(s),e),r=Math.pow(At(s,t,1),1/3);return a.scaleBy(r),a}function Tu(s){let e=s.getFloat(),t=s.getFloat();e+t>1&&(e=1-e,t=1-t);let a=1-e-t;return new b(e,t,a)}function Mu(s){return s/360*2*Math.PI}function Nu(s){return 180*s/Math.PI}function Pu(s){return Math.sin(s)}function Vu(s){return Math.cos(s)}d.randomSeed=4919;function Ou(){return++d.randomSeed}function Lu(s,e,t){let a=s[e],r=s[t];s[e]=r,s[t]=a}function dc(s){return Math.floor(s)}function os(s){return dc(s+.5)}function Gu(s){return s=Math.max(s,0),s=Math.min(s,1),os(s*65535)}function zu(s){return s=Math.max(s,0),s=Math.min(s,1),os(s*255)}function hc(s){return Math.abs(s)==0?s:1/Math.sqrt(s)}function Wu(s){let e=ls(s);return s.scaleBy(hc(e))}function Ju(s,e){return s.crossProduct(e)}function ls(s){return xt(s,s)}function ju(s){let e=new pi(s);return Xr(e)}function Zu(s,e){let t=new pi(e);s.x=Xr(t),s.y=Xr(t),s.z=Xr(t)}function Yu(s,e,t){return s<e?t:s>t?e:s}function cs(s,e){return s-Math.floor(s/e)*e}const Xu=1e-6;class R{static blockBytes=64;static block=16;static allocCount=1e3;static allocOnceCount=1e3;static maxCount=50*1e4;static useCount=0;static buffer;static wasmMatrixPtr=0;static dynamicMatrixBytes;static dynamicGlobalMatrixRef;static wasm;static help_matrix_0;static help_matrix_1;static help_matrix_2;static helpMatrix;static helpMatrix2;static _getEulerMatrix;static _zero=new b(0,0,0);static _one=new b(1,1,1);static _prs=[new b,new b,new b];index=0;offset=0;rawData;_position;static allocMatrix(e){this.allocCount=e,R.dynamicMatrixBytes=Ee.matrixBuffer,R.buffer=R.dynamicMatrixBytes.buffer,R.wasmMatrixPtr=Ee.matrixBufferPtr,this.dynamicGlobalMatrixRef||=[],this.dynamicGlobalMatrixRef.forEach(t=>{t.offset=R.wasmMatrixPtr+t.index*R.blockBytes,t.rawData=cr(R.dynamicMatrixBytes.buffer,t.offset,16)}),R.help_matrix_0||=new R,R.help_matrix_1||=new R,R.help_matrix_2||=new R,R.helpMatrix||=new R,R.helpMatrix2||=new R,R._getEulerMatrix||=new R,R._getEulerMatrix.identity()}static fromToRotation(e,t,a){return a||=new R,a.transformDir(e,t),a}static fromArray(e){if(e.length!==16)throw new Error("Array must contain exactly 16 elements");const t=new R;for(let a=0;a<16;a++)t.rawData[a]=e[a];return t}static getAxisRotation(e,t,a,r){let i=new R,n=r*(Math.PI/180),o=Math.cos(n),l=Math.sin(n),c=1-o,f,h;return i.rawData[0]=o+e*e*c,i.rawData[5]=o+t*t*c,i.rawData[10]=o+a*a*c,f=e*t*c,h=a*l,i.rawData[1]=f+h,i.rawData[4]=f-h,f=e*a*c,h=t*l,i.rawData[8]=f+h,i.rawData[2]=f-h,f=t*a*c,h=e*l,i.rawData[9]=f-h,i.rawData[6]=f+h,i}static sanitizeEuler(e){R.makePositive(e)}static makePositive(e){let t=-1e-4,a=Math.PI*2-1e-4;e.x<t?e.x+=2*Math.PI:e.x>a&&(e.x-=2*Math.PI),e.y<t?e.y+=2*Math.PI:e.y>a&&(e.y-=2*Math.PI),e.z<t?e.z+=2*Math.PI:e.z>a&&(e.z-=2*Math.PI)}static matrixToEuler(e,t){return e.get(1,2)<.999?e.get(1,2)>-.999?(t.x=Math.asin(-e.get(1,2)),t.y=Math.atan2(e.get(0,2),e.get(2,2)),t.z=Math.atan2(e.get(1,0),e.get(1,1)),R.sanitizeEuler(t),!0):(t.x=Math.PI*.5,t.y=Math.atan2(e.get(0,1),e.get(0,0)),t.z=0,R.sanitizeEuler(t),!1):(t.x=-Math.PI*.5,t.y=Math.atan2(-e.get(0,1),e.get(0,0)),t.z=0,R.sanitizeEuler(t),!1)}static matrixMultiply(e,t,a){R.wasm.Matrix_Multiply(e.index,t.index,a.index)}static matrixAppend(e,t,a){R.wasm.Matrix_Append(e.index,t.index,a.index)}static matrixRotateY(e,t){R.wasm.Matrix_Append(e,t.index)}static matrixRotate(e,t,a){R.wasm.Matrix_Rotate(e,t,a.index)}constructor(e=!1){if(R.useCount>=R.allocCount){let t=R.allocCount+R.allocOnceCount;Ee.allocMatrix(t)}this.index=R.useCount,this.offset=R.wasmMatrixPtr+this.index*R.blockBytes,R.dynamicGlobalMatrixRef[this.index]=this,R.useCount++,this.rawData=cr(R.dynamicMatrixBytes.buffer,this.offset,16),this._position=new b,this.identity()}lookAt(e,t,a=b.Y_AXIS){let r=this.rawData,i=t.subtract(e,b.HELP_0);i.length===0&&(i.z=1),i.normalize();let n=a.crossProduct(i,b.HELP_1);n.length===0&&(Math.abs(a.z)===1?i.x+=1e-4:i.z-=1e-4,i.normalize(),n=a.crossProduct(i,b.HELP_1)),n.normalize();let o=i.crossProduct(n,b.HELP_2);r[0]=n.x,r[1]=o.x,r[2]=i.x,r[3]=0,r[4]=n.y,r[5]=o.y,r[6]=i.y,r[7]=0,r[8]=n.z,r[9]=o.z,r[10]=i.z,r[11]=0,r[12]=-n.dotProduct(e),r[13]=-o.dotProduct(e),r[14]=-i.dotProduct(e),r[15]=1}static floatArray=new Float64Array(16).fill(0);multiply(e){let t=this.rawData,a=e.rawData,r=R.floatArray;r[0]=t[0]*a[0]+t[1]*a[4]+t[2]*a[8]+t[3]*a[12],r[1]=t[0]*a[1]+t[1]*a[5]+t[2]*a[9]+t[3]*a[13],r[2]=t[0]*a[2]+t[1]*a[6]+t[2]*a[10]+t[3]*a[14],r[3]=t[0]*a[3]+t[1]*a[7]+t[2]*a[11]+t[3]*a[15],r[4]=t[4]*a[0]+t[5]*a[4]+t[6]*a[8]+t[7]*a[12],r[5]=t[4]*a[1]+t[5]*a[5]+t[6]*a[9]+t[7]*a[13],r[6]=t[4]*a[2]+t[5]*a[6]+t[6]*a[10]+t[7]*a[14],r[7]=t[4]*a[3]+t[5]*a[7]+t[6]*a[11]+t[7]*a[15],r[8]=t[8]*a[0]+t[9]*a[4]+t[10]*a[8]+t[11]*a[12],r[9]=t[8]*a[1]+t[9]*a[5]+t[10]*a[9]+t[11]*a[13],r[10]=t[8]*a[2]+t[9]*a[6]+t[10]*a[10]+t[11]*a[14],r[11]=t[8]*a[3]+t[9]*a[7]+t[10]*a[11]+t[11]*a[15],r[12]=t[12]*a[0]+t[13]*a[4]+t[14]*a[8]+t[15]*a[12],r[13]=t[12]*a[1]+t[13]*a[5]+t[14]*a[9]+t[15]*a[13],r[14]=t[12]*a[2]+t[13]*a[6]+t[14]*a[10]+t[15]*a[14],r[15]=t[12]*a[3]+t[13]*a[7]+t[14]*a[11]+t[15]*a[15],t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]}multiplyMatrices(e,t){const a=e.rawData,r=t.rawData,i=this.rawData,n=a[0],o=a[4],l=a[8],c=a[12],f=a[1],h=a[5],u=a[9],g=a[13],A=a[2],m=a[6],p=a[10],D=a[14],B=a[3],v=a[7],C=a[11],y=a[15],x=r[0],k=r[4],E=r[8],S=r[12],Q=r[1],I=r[5],T=r[9],M=r[13],Z=r[2],be=r[6],re=r[10],P=r[14],z=r[3],H=r[7],O=r[11],ie=r[15];return i[0]=n*x+o*Q+l*Z+c*z,i[4]=n*k+o*I+l*be+c*H,i[8]=n*E+o*T+l*re+c*O,i[12]=n*S+o*M+l*P+c*ie,i[1]=f*x+h*Q+u*Z+g*z,i[5]=f*k+h*I+u*be+g*H,i[9]=f*E+h*T+u*re+g*O,i[13]=f*S+h*M+u*P+g*ie,i[2]=A*x+m*Q+p*Z+D*z,i[6]=A*k+m*I+p*be+D*H,i[10]=A*E+m*T+p*re+D*O,i[14]=A*S+m*M+p*P+D*ie,i[3]=B*x+v*Q+C*Z+y*z,i[7]=B*k+v*I+C*be+y*H,i[11]=B*E+v*T+C*re+y*O,i[15]=B*S+v*M+C*P+y*ie,this}multiplyPoint3(e,t){t||=new b;let a=this.rawData;return t.x=a[0]*e.x+a[4]*e.y+a[8]*e.z+a[12],t.y=a[1]*e.x+a[5]*e.y+a[9]*e.z+a[13],t.z=a[2]*e.x+a[6]*e.y+a[10]*e.z+a[14],t}multiplyVector4(e,t){t||=new b;let a=this.rawData,r=e.x,i=e.y,n=e.z,o=a[3]*r+a[7]*i+a[11]*n+a[15];return o=o||1,t.x=(a[0]*r+a[4]*i+a[8]*n+a[12])/o,t.y=(a[1]*r+a[5]*i+a[9]*n+a[13])/o,t.z=(a[2]*r+a[6]*i+a[10]*n+a[14])/o,t.w=1,t}transformVector4(e,t){let a=this.rawData;t||=new b;let r=e.x,i=e.y,n=e.z,o=e.w;return t.x=r*a[0]+i*a[4]+n*a[8]+o*a[12],t.y=r*a[1]+i*a[5]+n*a[9]+o*a[13],t.z=r*a[2]+i*a[6]+n*a[10]+o*a[14],t.w=r*a[3]+i*a[7]+n*a[11]+o*a[15],t}perspectiveMultiplyPoint3(e,t){let a=b.HELP_2,r,i=this.rawData;if(a.x=i[0]*e.x+i[4]*e.y+i[8]*e.z+i[12],a.y=i[1]*e.x+i[5]*e.y+i[9]*e.z+i[13],a.z=i[2]*e.x+i[6]*e.y+i[10]*e.z+i[14],r=i[3]*e.x+i[7]*e.y+i[11]*e.z+i[15],Math.abs(r)>1e-7){let n=1/r;return t.x=a.x*n,t.y=a.y*n,t.z=a.z*n,!0}else return t.x=0,t.y=0,t.z=0,!1}perspective(e,t,a,r){let i=this.rawData,n=e*pt/2,o=Math.cos(n)/Math.sin(n);i[0]=-o/t,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=r/(r-a),i[11]=1,i[12]=0,i[13]=0,i[14]=-a*r/(r-a),i[15]=0}perspective3(e,t,a,r){let i=Math.tan(e*Math.PI/360)*a,n=i*t;this.frustum(-n,n,-i,i,a,r)}frustum(e,t,a,r,i,n){let o=this.rawData;o[0]=-2*i/(t-e),o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*i/(r-a),o[6]=0,o[7]=0,o[8]=(t+e)/(t-e),o[9]=(r+a)/(r-a),o[10]=n/(n-i),o[11]=1,o[12]=0,o[13]=0,o[14]=-n*i/(n-i),o[15]=0}ortho(e,t,a,r){let i=this.rawData;return i[0]=2/e,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=2/t,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1/(r-a),i[11]=0,i[12]=0,i[13]=0,i[14]=a/(a-r),i[15]=1,this}orthoZO(e,t,a,r,i,n){let o=this.rawData,l=1/(e-t),c=1/(a-r),f=1/(i-n);return o[0]=-2*l,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*c,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=f,o[11]=0,o[12]=(e+t)*l,o[13]=(r+a)*c,o[14]=i*f,o[15]=1,this}orthoOffCenter(e,t,a,r,i,n){let o=this.rawData;o[0]=2/(t-e),o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2/(r-a),o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=1/(n-i),o[11]=0,o[12]=(e+t)/(e-t),o[13]=(r+a)/(a-r),o[14]=i/(i-n),o[15]=1}transformDir(e,t){let a=this.rawData,r=1e-6,i=b.ZERO;t.crossProduct(e,i);let n=t.dotProduct(e);if(n>1-r)this.identity();else if(n<-1+r){let o=b.HELP_1,l=b.HELP_2,c=0,f,h,u,g,A,m,p,D,B,v,C,y,x,k,E,S,Q,I;l.x=0,l.y=e.z,l.z=-e.y,l.dotProduct(l)<r&&(l.x=-e.z,l.y=0,l.z=e.x),c=1/Math.sqrt(l.dotProduct(l)),l.x*=c,l.y*=c,l.z*=c,l.crossProduct(e,o),f=-e.x*e.x,h=-e.y*e.y,u=-e.z*e.z,g=-e.x*e.y,A=-e.x*e.z,m=-e.y*e.z,p=o.x*o.x,D=o.y*o.y,B=o.z*o.z,v=o.x*o.y,C=o.x*o.z,y=o.y*o.z,x=-l.x*l.x,k=-l.y*l.y,E=-l.z*l.z,S=-l.x*l.y,Q=-l.x*l.z,I=-l.y*l.z,a[0]=f+p+x,a[1]=g+v+S,a[2]=A+C+Q,a[4]=a[1],a[5]=h+D+k,a[6]=m+y+I,a[8]=a[2],a[9]=a[6],a[10]=u+B+E,a[3]=0,a[7]=0,a[11]=0,a[15]=1}else{let o,l,c,f,h,u=i.dotProduct(i),g=(1-n)/u;o=g*i.x,l=g*i.z,c=o*i.y,f=o*i.z,h=l*i.y,a[0]=n+o*i.x,a[1]=c-i.z,a[2]=f+i.y,a[4]=c+i.z,a[5]=n+g*i.y*i.y,a[6]=h-i.x,a[8]=f-i.y,a[9]=h+i.x,a[10]=n+l*i.z,a[3]=0,a[7]=0,a[11]=0,a[15]=1}return this}append(e){let t=this.rawData,a=t[0],r=t[4],i=t[8],n=t[12],o=t[1],l=t[5],c=t[9],f=t[13],h=t[2],u=t[6],g=t[10],A=t[14],m=t[3],p=t[7],D=t[11],B=t[15];t[0]=a*e.rawData[0]+o*e.rawData[4]+h*e.rawData[8]+m*e.rawData[12],t[1]=a*e.rawData[1]+o*e.rawData[5]+h*e.rawData[9]+m*e.rawData[13],t[2]=a*e.rawData[2]+o*e.rawData[6]+h*e.rawData[10]+m*e.rawData[14],t[3]=a*e.rawData[3]+o*e.rawData[7]+h*e.rawData[11]+m*e.rawData[15],t[4]=r*e.rawData[0]+l*e.rawData[4]+u*e.rawData[8]+p*e.rawData[12],t[5]=r*e.rawData[1]+l*e.rawData[5]+u*e.rawData[9]+p*e.rawData[13],t[6]=r*e.rawData[2]+l*e.rawData[6]+u*e.rawData[10]+p*e.rawData[14],t[7]=r*e.rawData[3]+l*e.rawData[7]+u*e.rawData[11]+p*e.rawData[15],t[8]=i*e.rawData[0]+c*e.rawData[4]+g*e.rawData[8]+D*e.rawData[12],t[9]=i*e.rawData[1]+c*e.rawData[5]+g*e.rawData[9]+D*e.rawData[13],t[10]=i*e.rawData[2]+c*e.rawData[6]+g*e.rawData[10]+D*e.rawData[14],t[11]=i*e.rawData[3]+c*e.rawData[7]+g*e.rawData[11]+D*e.rawData[15],t[12]=n*e.rawData[0]+f*e.rawData[4]+A*e.rawData[8]+B*e.rawData[12],t[13]=n*e.rawData[1]+f*e.rawData[5]+A*e.rawData[9]+B*e.rawData[13],t[14]=n*e.rawData[2]+f*e.rawData[6]+A*e.rawData[10]+B*e.rawData[14],t[15]=n*e.rawData[3]+f*e.rawData[7]+A*e.rawData[11]+B*e.rawData[15]}add(e){let t=this.rawData,a=t[0],r=t[4],i=t[8],n=t[12],o=t[1],l=t[5],c=t[9],f=t[13],h=t[2],u=t[6],g=t[10],A=t[14],m=t[3],p=t[7],D=t[11],B=t[15],v=e.rawData[0],C=e.rawData[4],y=e.rawData[8],x=e.rawData[12],k=e.rawData[1],E=e.rawData[5],S=e.rawData[9],Q=e.rawData[13],I=e.rawData[2],T=e.rawData[6],M=e.rawData[10],Z=e.rawData[14],be=e.rawData[3],re=e.rawData[7],P=e.rawData[11],z=e.rawData[15];return t[0]=a+v,t[1]=o+k,t[2]=h+I,t[3]=m+be,t[4]=r+C,t[5]=l+E,t[6]=u+T,t[7]=p+re,t[8]=i+y,t[9]=c+S,t[10]=g+M,t[11]=D+P,t[12]=n+x,t[13]=f+Q,t[14]=A+Z,t[15]=B+z,this}sub(e){let t=this.rawData,a=t[0],r=t[4],i=t[8],n=t[12],o=t[1],l=t[5],c=t[9],f=t[13],h=t[2],u=t[6],g=t[10],A=t[14],m=t[3],p=t[7],D=t[11],B=t[15],v=e.rawData[0],C=e.rawData[4],y=e.rawData[8],x=e.rawData[12],k=e.rawData[1],E=e.rawData[5],S=e.rawData[9],Q=e.rawData[13],I=e.rawData[2],T=e.rawData[6],M=e.rawData[10],Z=e.rawData[14],be=e.rawData[3],re=e.rawData[7],P=e.rawData[11],z=e.rawData[15];return t[0]=a-v,t[1]=o-k,t[2]=h-I,t[3]=m-be,t[4]=r-C,t[5]=l-E,t[6]=u-T,t[7]=p-re,t[8]=i-y,t[9]=c-S,t[10]=g-M,t[11]=D-P,t[12]=n-x,t[13]=f-Q,t[14]=A-Z,t[15]=B-z,this}mult(e){let t=this.rawData;return t[0]*=e,t[1]*=e,t[2]*=e,t[3]*=e,t[4]*=e,t[5]*=e,t[6]*=e,t[7]*=e,t[8]*=e,t[9]*=e,t[10]*=e,t[11]*=e,t[12]*=e,t[13]*=e,t[14]*=e,t[15]*=e,this}appendRotation(e,t){let a=R.getAxisRotation(t.x,t.y,t.z,e);this.append(a)}createByRotation(e,t){let a=R.helpMatrix,r,i,n=e*pt;return r=Math.sin(n),i=Math.cos(n),t.x==1&&(a.rawData[0]=1,a.rawData[1]=0,a.rawData[2]=0,a.rawData[3]=0,a.rawData[4]=0,a.rawData[5]=i,a.rawData[6]=r,a.rawData[7]=0,a.rawData[8]=0,a.rawData[9]=-r,a.rawData[10]=i,a.rawData[11]=0,a.rawData[12]=0,a.rawData[13]=0,a.rawData[14]=0,a.rawData[15]=1),t.y==1&&(a.rawData[0]=i,a.rawData[1]=0,a.rawData[2]=-r,a.rawData[3]=0,a.rawData[4]=0,a.rawData[5]=1,a.rawData[6]=0,a.rawData[7]=0,a.rawData[8]=r,a.rawData[9]=0,a.rawData[10]=i,a.rawData[11]=0,a.rawData[12]=0,a.rawData[13]=0,a.rawData[14]=0,a.rawData[15]=1),t.z==1&&(a.rawData[0]=i,a.rawData[1]=r,a.rawData[2]=0,a.rawData[3]=0,a.rawData[4]=-r,a.rawData[5]=i,a.rawData[6]=0,a.rawData[7]=0,a.rawData[8]=0,a.rawData[9]=0,a.rawData[10]=1,a.rawData[11]=0,a.rawData[12]=0,a.rawData[13]=0,a.rawData[14]=0,a.rawData[15]=1),this.append(a),this}appendScale(e,t,a){R.helpMatrix.createByScale(e,t,a),this.append(R.helpMatrix)}createByScale(e,t,a){let r=this.rawData;r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=a,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1}appendTranslation(e,t,a){let r=this.rawData;r[12]+=e,r[13]+=t,r[14]+=a}clone(){let e=new R;return e.copyFrom(this),e}copyRowFrom(e,t){let a=this.rawData;switch(e){case 0:a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=t.w;break;case 1:a[4]=t.x,a[5]=t.y,a[6]=t.z,a[7]=t.w;break;case 2:a[8]=t.x,a[9]=t.y,a[10]=t.z,a[11]=t.w;break;case 3:a[12]=t.x,a[13]=t.y,a[14]=t.z,a[15]=t.w;break}}copyRowTo(e,t){let a=this.rawData;switch(e){case 0:t.x=a[0],t.y=a[1],t.z=a[2],t.w=a[3];break;case 1:t.x=a[4],t.y=a[5],t.z=a[6],t.w=a[7];break;case 2:t.x=a[8],t.y=a[9],t.z=a[10],t.w=a[11];break;case 3:t.x=a[12],t.y=a[13],t.z=a[14],t.w=a[15];break}}copyFrom(e){let t=this.rawData;return t[0]=e.rawData[0],t[1]=e.rawData[1],t[2]=e.rawData[2],t[3]=e.rawData[3],t[4]=e.rawData[4],t[5]=e.rawData[5],t[6]=e.rawData[6],t[7]=e.rawData[7],t[8]=e.rawData[8],t[9]=e.rawData[9],t[10]=e.rawData[10],t[11]=e.rawData[11],t[12]=e.rawData[12],t[13]=e.rawData[13],t[14]=e.rawData[14],t[15]=e.rawData[15],this}copyRawDataTo(e,t=0,a=!1){let r=this.rawData;e[0+t]=r[0],e[1+t]=r[1],e[2+t]=r[2],e[3+t]=r[3],e[4+t]=r[4],e[5+t]=r[5],e[6+t]=r[6],e[7+t]=r[7],e[8+t]=r[8],e[9+t]=r[9],e[10+t]=r[10],e[11+t]=r[11],e[12+t]=r[12],e[13+t]=r[13],e[14+t]=r[14],e[15+t]=r[15]}copyColFrom(e,t){let a=this.rawData;switch(e){case 0:a[0]=t.x,a[4]=t.y,a[8]=t.z,a[12]=t.w;break;case 1:a[1]=t.x,a[5]=t.y,a[9]=t.z,a[13]=t.w;break;case 2:a[2]=t.x,a[6]=t.y,a[10]=t.z,a[14]=t.w;break;case 3:a[3]=t.x,a[7]=t.y,a[11]=t.z,a[15]=t.w;break}}copyColTo(e,t){let a=this.rawData;switch(e){case 0:t.x=a[0],t.y=a[4],t.z=a[8],t.w=a[12];break;case 1:t.x=a[1],t.y=a[5],t.z=a[9],t.w=a[13];break;case 2:t.x=a[2],t.y=a[6],t.z=a[10],t.w=a[14];break;case 3:t.x=a[3],t.y=a[7],t.z=a[11],t.w=a[15];break}}copyToMatrix3D(e){e.rawData=this.rawData.slice(0)}makeRotationFromQuaternion(e){return this.compose(R._zero,e,R._one),this}static decomposeRawData=new Float64Array(16).fill(0);decompose(e="eulerAngles",t){let a=ae.CALCULATION_QUATERNION,r=t||R._prs;this.copyRawDataTo(R.decomposeRawData);let i=R.decomposeRawData,n=r[0];n.x=i[12],n.y=i[13],n.z=i[14],i[12]=0,i[13]=0,i[14]=0;let o=r[2];o.x=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]),o.y=Math.sqrt(i[4]*i[4]+i[5]*i[5]+i[6]*i[6]),o.z=Math.sqrt(i[8]*i[8]+i[9]*i[9]+i[10]*i[10]),i[0]*(i[5]*i[10]-i[6]*i[9])-i[1]*(i[4]*i[10]-i[6]*i[8])+i[2]*(i[4]*i[9]-i[5]*i[8])<0&&(o.z=-o.z),i[0]/=o.x,i[1]/=o.x,i[2]/=o.x,i[4]/=o.y,i[5]/=o.y,i[6]/=o.y,i[8]/=o.z,i[9]/=o.z,i[10]/=o.z;let l=r[1],c;switch(e){case ia.AXIS_ANGLE:l.w=Math.acos((i[0]+i[5]+i[10]-1)/2);let f=Math.sqrt((i[6]-i[9])*(i[6]-i[9])+(i[8]-i[2])*(i[8]-i[2])+(i[1]-i[4])*(i[1]-i[4]));l.x=(i[6]-i[9])/f,l.y=(i[8]-i[2])/f,l.z=(i[1]-i[4])/f;break;case ia.QUATERNION:c=i[0]+i[5]+i[10],c>0?(l.w=Math.sqrt(1+c)/2,l.x=(i[6]-i[9])/(4*l.w),l.y=(i[8]-i[2])/(4*l.w),l.z=(i[1]-i[4])/(4*l.w)):i[0]>i[5]&&i[0]>i[10]?(l.x=Math.sqrt(1+i[0]-i[5]-i[10])/2,l.w=(i[6]-i[9])/(4*l.x),l.y=(i[1]+i[4])/(4*l.x),l.z=(i[8]+i[2])/(4*l.x)):i[5]>i[10]?(l.y=Math.sqrt(1+i[5]-i[0]-i[10])/2,l.x=(i[1]+i[4])/(4*l.y),l.w=(i[8]-i[2])/(4*l.y),l.z=(i[6]+i[9])/(4*l.y)):(l.z=Math.sqrt(1+i[10]-i[0]-i[5])/2,l.x=(i[8]+i[2])/(4*l.z),l.y=(i[6]+i[9])/(4*l.z),l.w=(i[1]-i[4])/(4*l.z));break;case ia.EULER_ANGLES:c=i[0]+i[5]+i[10],c>0?(a.w=Math.sqrt(1+c)/2,a.x=(i[6]-i[9])/(4*a.w),a.y=(i[8]-i[2])/(4*a.w),a.z=(i[1]-i[4])/(4*a.w)):i[0]>i[5]&&i[0]>i[10]?(a.x=Math.sqrt(1+i[0]-i[5]-i[10])/2,a.w=(i[6]-i[9])/(4*a.x),a.y=(i[1]+i[4])/(4*a.x),a.z=(i[8]+i[2])/(4*a.x)):i[5]>i[10]?(l.y=Math.sqrt(1+i[5]-i[0]-i[10])/2,a.x=(i[1]+i[4])/(4*a.y),a.w=(i[8]-i[2])/(4*a.y),a.z=(i[6]+i[9])/(4*a.y)):(a.z=Math.sqrt(1+i[10]-i[0]-i[5])/2,a.x=(i[8]+i[2])/(4*a.z),a.y=(i[6]+i[9])/(4*a.z),a.w=(i[1]-i[4])/(4*a.z)),a.getEulerAngles(l);break}return r[0]=n,r[1]=l,r[2]=o,r}static getEuler(e,t,a=!0,r){return e||=new b,R._getEulerMatrix.makeRotationFromQuaternion(t).makeEuler(e,a,r),e}compose(e,t,a){const r=this.rawData,i=t.x,n=t.y,o=t.z,l=t.w,c=i+i,f=n+n,h=o+o,u=i*c,g=i*f,A=i*h,m=n*f,p=n*h,D=o*h,B=l*c,v=l*f,C=l*h,y=a.x,x=a.y,k=a.z;return r[0]=(1-(m+D))*y,r[1]=(g+C)*y,r[2]=(A-v)*y,r[3]=0,r[4]=(g-C)*x,r[5]=(1-(u+D))*x,r[6]=(p+B)*x,r[7]=0,r[8]=(A+v)*k,r[9]=(p-B)*k,r[10]=(1-(u+m))*k,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}deltaTransformVector(e,t){t||=new b;let a=this.rawData,r=e.x,i=e.y,n=e.z;return t.x=r*a[0]+i*a[4]+n*a[8],t.y=r*a[1]+i*a[5]+n*a[9],t.z=r*a[2]+i*a[6]+n*a[10],t.w=r*a[3]+i*a[7]+n*a[11],t}identity(){let e=this.rawData;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}fill(e){let t=this.rawData;t[1]=e,t[2]=e,t[3]=e,t[4]=e,t[6]=e,t[7]=e,t[8]=e,t[9]=e,t[11]=e,t[12]=e,t[13]=e,t[14]=e,t[0]=e,t[5]=e,t[10]=e,t[15]=e}invers33(){let e=this.rawData,t=e[5]*e[10]-e[9]*e[6],a=e[8]*e[6]-e[4]*e[10],r=e[4]*e[9]-e[8]*e[5],i=e[9]*e[2]-e[1]*e[10],n=e[0]*e[10]-e[8]*e[2],o=e[8]*e[1]-e[0]*e[9],l=e[1]*e[6]-e[5]*e[2],c=e[4]*e[2]-e[0]*e[6],f=e[0]*e[5]-e[4]*e[1],h=e[0]*t+e[4]*i+e[8]*l;if(Math.abs(h)>1e-11){let u=1/h;e[0]=u*t,e[4]=u*a,e[8]=u*r,e[1]=u*i,e[5]=u*n,e[9]=u*o,e[2]=u*l,e[6]=u*c,e[10]=u*f}}invert(){let e=this.determinant,t=Math.abs(e)>1e-11,a=this.rawData;if(t){e=1/e;let r=a[0],i=a[4],n=a[8],o=a[12],l=a[1],c=a[5],f=a[9],h=a[13],u=a[2],g=a[6],A=a[10],m=a[14],p=a[3],D=a[7],B=a[11],v=a[15];a[0]=e*(c*(A*v-m*B)-f*(g*v-m*D)+h*(g*B-A*D)),a[1]=-e*(l*(A*v-m*B)-f*(u*v-m*p)+h*(u*B-A*p)),a[2]=e*(l*(g*v-m*D)-c*(u*v-m*p)+h*(u*D-g*p)),a[3]=-e*(l*(g*B-A*D)-c*(u*B-A*p)+f*(u*D-g*p)),a[4]=-e*(i*(A*v-m*B)-n*(g*v-m*D)+o*(g*B-A*D)),a[5]=e*(r*(A*v-m*B)-n*(u*v-m*p)+o*(u*B-A*p)),a[6]=-e*(r*(g*v-m*D)-i*(u*v-m*p)+o*(u*D-g*p)),a[7]=e*(r*(g*B-A*D)-i*(u*B-A*p)+n*(u*D-g*p)),a[8]=e*(i*(f*v-h*B)-n*(c*v-h*D)+o*(c*B-f*D)),a[9]=-e*(r*(f*v-h*B)-n*(l*v-h*p)+o*(l*B-f*p)),a[10]=e*(r*(c*v-h*D)-i*(l*v-h*p)+o*(l*D-c*p)),a[11]=-e*(r*(c*B-f*D)-i*(l*B-f*p)+n*(l*D-c*p)),a[12]=-e*(i*(f*m-h*A)-n*(c*m-h*g)+o*(c*A-f*g)),a[13]=e*(r*(f*m-h*A)-n*(l*m-h*u)+o*(l*A-f*u)),a[14]=-e*(r*(c*m-h*g)-i*(l*m-h*u)+o*(l*g-c*u)),a[15]=e*(r*(c*A-f*g)-i*(l*A-f*u)+n*(l*g-c*u))}return t}transformPoint(e,t){let a=this.rawData;t||=new b;let r=e.x,i=e.y,n=e.z;return t.x=r*a[0]+i*a[4]+n*a[8]+a[12],t.y=r*a[1]+i*a[5]+n*a[9]+a[13],t.z=r*a[2]+i*a[6]+n*a[10]+a[14],t}transformVector(e,t){let a=this.rawData;t||=new b;let r=e.x,i=e.y,n=e.z;return t.x=r*a[0]+i*a[4]+n*a[8],t.y=r*a[1]+i*a[5]+n*a[9],t.z=r*a[2]+i*a[6]+n*a[10],t}transpose(){let e=this.rawData;for(let t=0;t<R.helpMatrix.rawData.length;t++)R.helpMatrix.rawData[t]=e[t];e[1]=R.helpMatrix.rawData[4],e[2]=R.helpMatrix.rawData[8],e[3]=R.helpMatrix.rawData[12],e[4]=R.helpMatrix.rawData[1],e[6]=R.helpMatrix.rawData[9],e[7]=R.helpMatrix.rawData[13],e[8]=R.helpMatrix.rawData[2],e[9]=R.helpMatrix.rawData[6],e[11]=R.helpMatrix.rawData[14],e[12]=R.helpMatrix.rawData[3],e[13]=R.helpMatrix.rawData[7],e[14]=R.helpMatrix.rawData[11]}get determinant(){let e=this.rawData;return(e[0]*e[5]-e[4]*e[1])*(e[10]*e[15]-e[14]*e[11])-(e[0]*e[9]-e[8]*e[1])*(e[6]*e[15]-e[14]*e[7])+(e[0]*e[13]-e[12]*e[1])*(e[6]*e[11]-e[10]*e[7])+(e[4]*e[9]-e[8]*e[5])*(e[2]*e[15]-e[14]*e[3])-(e[4]*e[13]-e[12]*e[5])*(e[2]*e[11]-e[10]*e[3])+(e[8]*e[13]-e[12]*e[9])*(e[2]*e[7]-e[6]*e[3])}getPosition(e){e||=new b;let t=this.rawData;return e.x=t[12],e.y=t[13],e.z=t[14],e}get position(){return this._position.set(this.rawData[12],this.rawData[13],this.rawData[14]),this._position}set position(e){let t=this.rawData;t[12]=e.x,t[13]=e.y,t[14]=e.z}get scale(){let e=this.rawData;return new b(e[0],e[5],e[10])}set scale(e){let t=this.rawData;t[0]=e.x,t[5]=e.y,t[10]=e.z}toString(){let e=this.rawData;return"matrix3d("+Math.round(e[0]*1e3)/1e3+","+Math.round(e[1]*1e3)/1e3+","+Math.round(e[2]*1e3)/1e3+","+Math.round(e[3]*1e3)/1e3+","+Math.round(e[4]*1e3)/1e3+","+Math.round(e[5]*1e3)/1e3+","+Math.round(e[6]*1e3)/1e3+","+Math.round(e[7]*1e3)/1e3+","+Math.round(e[8]*1e3)/1e3+","+Math.round(e[9]*1e3)/1e3+","+Math.round(e[10]*1e3)/1e3+","+Math.round(e[11]*1e3)/1e3+","+Math.round(e[12]*1e3)/1e3+","+Math.round(e[13]*1e3)/1e3+","+Math.round(e[14]*1e3)/1e3+","+Math.round(e[15]*1e3)/1e3+")"}lerp(e,t,a){this.copyFrom(t).sub(e).mult(a).add(e)}get(e,t){return this.rawData[e+t*4]}set(e,t,a){this.rawData[e+t*4]=a}getMaxScaleOnAxis(){let e=this.rawData,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],a=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,a,r))}translate(e){let t=this.get(0,0)*e.x+this.get(0,1)*e.y+this.get(0,2)*e.z+this.get(0,3),a=this.get(1,0)*e.x+this.get(1,1)*e.y+this.get(1,2)*e.z+this.get(1,3),r=this.get(2,0)*e.x+this.get(2,1)*e.y+this.get(2,2)*e.z+this.get(2,3),i=this.get(3,0)*e.x+this.get(3,1)*e.y+this.get(3,2)*e.z+this.get(3,3);return this.set(0,3,t),this.set(1,3,a),this.set(2,3,r),this.set(3,3,i),this}setTRInverse(e,t){t=t.inverse(),ae.quaternionToMatrix(t,this),this.translate(new b(-e.x,-e.y,-e.z))}setScale(e){return this.set(0,0,e.x),this.set(0,1,0),this.set(0,2,0),this.set(0,3,0),this.set(1,0,0),this.set(1,1,e.y),this.set(1,2,0),this.set(1,3,0),this.set(2,0,0),this.set(2,1,0),this.set(2,2,e.z),this.set(2,3,0),this.set(3,0,0),this.set(3,1,0),this.set(3,2,0),this.set(3,3,1),this}makeBasis(e,t,a){return this.setElements(e.x,t.x,a.x,0,e.y,t.y,a.y,0,e.z,t.z,a.z,0,0,0,0,1),this}makeRotationAxis(e,t){const a=Math.cos(t),r=Math.sin(t),i=1-a,n=e.x,o=e.y,l=e.z,c=i*n,f=i*o;return this.setElements(c*n+a,c*o-r*l,c*l+r*o,0,c*o+r*l,f*o+a,f*l-r*n,0,c*l-r*o,f*l+r*n,i*l*l+a,0,0,0,0,1),this}static transpose(e,t){t||=new R;let a=e.rawData,r=t.rawData;return r[0]=a[0],r[1]=a[4],r[2]=a[8],r[3]=a[12],r[4]=a[1],r[5]=a[5],r[6]=a[9],r[7]=a[13],r[8]=a[2],r[9]=a[6],r[10]=a[10],r[11]=a[14],r[12]=a[3],r[13]=a[7],r[14]=a[11],r[15]=a[15],t}static inverse(e,t){t||=new R;let a=e.rawData,r=t.rawData;r[0]=a[5]*a[10]*a[15]-a[5]*a[14]*a[11]-a[6]*a[9]*a[15]+a[6]*a[13]*a[11]+a[7]*a[9]*a[14]-a[7]*a[13]*a[10],r[1]=-a[1]*a[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[5],r[12]=-a[4]*a[9]*a[14]+a[4]*a[13]*a[10]+a[5]*a[8]*a[14]-a[5]*a[12]*a[10]-a[6]*a[8]*a[13]+a[6]*a[12]*a[9],r[13]=a[0]*a[9]*a[14]-a[0]*a[13]*a[10]-a[1]*a[8]*a[14]+a[1]*a[12]*a[10]+a[2]*a[8]*a[13]-a[2]*a[12]*a[9],r[14]=-a[0]*a[5]*a[14]+a[0]*a[13]*a[6]+a[1]*a[4]*a[14]-a[1]*a[12]*a[6]-a[2]*a[4]*a[13]+a[2]*a[12]*a[5],r[15]=a[0]*a[5]*a[10]-a[0]*a[9]*a[6]-a[1]*a[4]*a[10]+a[1]*a[8]*a[6]+a[2]*a[4]*a[9]-a[2]*a[8]*a[5];let i=a[0]*r[0]+a[1]*r[4]+a[2]*r[8]+a[3]*r[12];for(let n=0;n<16;n++)r[n]/=i;return t}makeEuler(e,t,a="XYZ"){const r=this.rawData,i=r[0],n=r[4],o=r[8],l=r[1],c=r[5],f=r[9],h=r[2],u=r[6],g=r[10];switch(a){case"XYZ":e.y=Math.asin(Ae(o,-1,1)),Math.abs(o)<.9999999?(e.x=Math.atan2(-f,g),e.z=Math.atan2(-n,i)):(e.x=Math.atan2(u,c),e.z=0);break;case"YXZ":e.x=Math.asin(-Ae(f,-1,1)),Math.abs(f)<.9999999?(e.y=Math.atan2(o,g),e.z=Math.atan2(l,c)):(e.y=Math.atan2(-h,i),e.z=0);break;case"ZXY":e.x=Math.asin(Ae(u,-1,1)),Math.abs(u)<.9999999?(e.y=Math.atan2(-h,g),e.z=Math.atan2(-n,c)):(e.y=0,e.z=Math.atan2(l,i));break;case"ZYX":e.y=Math.asin(-Ae(h,-1,1)),Math.abs(h)<.9999999?(e.x=Math.atan2(u,g),e.z=Math.atan2(l,i)):(e.x=0,e.z=Math.atan2(-n,c));break;case"YZX":e.z=Math.asin(Ae(l,-1,1)),Math.abs(l)<.9999999?(e.x=Math.atan2(-f,c),e.y=Math.atan2(-h,i)):(e.x=0,e.y=Math.atan2(o,g));break;case"XZY":e.z=Math.asin(-Ae(n,-1,1)),Math.abs(n)<.9999999?(e.x=Math.atan2(u,c),e.y=Math.atan2(o,i)):(e.x=Math.atan2(-f,g),e.y=0);break}return t&&e.multiplyScalar(Yr),e}setElements(e,t,a,r,i,n,o,l,c,f,h,u,g,A,m,p){const D=this.rawData;return D[0]=e,D[4]=t,D[8]=a,D[12]=r,D[1]=i,D[5]=n,D[9]=o,D[13]=l,D[2]=c,D[6]=f,D[10]=h,D[14]=u,D[3]=g,D[7]=A,D[11]=m,D[15]=p,this}makeMatrix44ByQuaternion(e,t,a){this.identity(),ae.quaternionToMatrix(a,this),this.appendTranslation(e.x,e.y,e.z),this.appendScale(t.x,t.y,t.z)}}function uc(s,e,t){for(let a=0;a<4;a++)t.rawData[a]=s.rawData[a]*e.rawData[0]+s.rawData[a+4]*e.rawData[1]+s.rawData[a+8]*e.rawData[2]+s.rawData[a+12]*e.rawData[3],t.rawData[a+4]=s.rawData[a]*e.rawData[4]+s.rawData[a+4]*e.rawData[5]+s.rawData[a+8]*e.rawData[6]+s.rawData[a+12]*e.rawData[7],t.rawData[a+8]=s.rawData[a]*e.rawData[8]+s.rawData[a+4]*e.rawData[9]+s.rawData[a+8]*e.rawData[10]+s.rawData[a+12]*e.rawData[11],t.rawData[a+12]=s.rawData[a]*e.rawData[12]+s.rawData[a+4]*e.rawData[13]+s.rawData[a+8]*e.rawData[14]+s.rawData[a+12]*e.rawData[15]}function cn(s,e,t,a){let r=a.rawData,i=s.x*pt,n=s.y*pt,o=s.z*pt,l=0,c=i*.5,f=n*.5,h=o*.5,u=Math.cos(c),g=Math.sin(c),A=Math.cos(f),m=Math.sin(f),p=Math.cos(h),D=Math.sin(h);l=u*A*p+g*m*D,i=g*A*p-u*m*D,n=u*m*p+g*A*D,o=u*A*D-g*m*p;let B=i+i,v=n+n,C=o+o,y=i*B,x=i*v,k=i*C,E=n*v,S=n*C,Q=o*C,I=l*B,T=l*v,M=l*C,Z=t.x,be=t.y,re=t.z;r[0]=(1-(E+Q))*Z,r[1]=(x+M)*Z,r[2]=(k-T)*Z,r[3]=0,r[4]=(x-M)*be,r[5]=(1-(y+Q))*be,r[6]=(S+I)*be,r[7]=0,r[8]=(k+T)*re,r[9]=(S-I)*re,r[10]=(1-(y+E))*re,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1}function bc(s,e,t){let a=s.rawData,r=t.rawData,i=a[0],n=a[4],o=a[8],l=a[12],c=a[1],f=a[5],h=a[9],u=a[13],g=a[2],A=a[6],m=a[10],p=a[14],D=a[3],B=a[7],v=a[11],C=a[15];r[0]=i*e.rawData[0]+c*e.rawData[4]+g*e.rawData[8]+D*e.rawData[12],r[1]=i*e.rawData[1]+c*e.rawData[5]+g*e.rawData[9]+D*e.rawData[13],r[2]=i*e.rawData[2]+c*e.rawData[6]+g*e.rawData[10]+D*e.rawData[14],r[3]=i*e.rawData[3]+c*e.rawData[7]+g*e.rawData[11]+D*e.rawData[15],r[4]=n*e.rawData[0]+f*e.rawData[4]+A*e.rawData[8]+B*e.rawData[12],r[5]=n*e.rawData[1]+f*e.rawData[5]+A*e.rawData[9]+B*e.rawData[13],r[6]=n*e.rawData[2]+f*e.rawData[6]+A*e.rawData[10]+B*e.rawData[14],r[7]=n*e.rawData[3]+f*e.rawData[7]+A*e.rawData[11]+B*e.rawData[15],r[8]=o*e.rawData[0]+h*e.rawData[4]+m*e.rawData[8]+v*e.rawData[12],r[9]=o*e.rawData[1]+h*e.rawData[5]+m*e.rawData[9]+v*e.rawData[13],r[10]=o*e.rawData[2]+h*e.rawData[6]+m*e.rawData[10]+v*e.rawData[14],r[11]=o*e.rawData[3]+h*e.rawData[7]+m*e.rawData[11]+v*e.rawData[15],r[12]=l*e.rawData[0]+u*e.rawData[4]+p*e.rawData[8]+C*e.rawData[12],r[13]=l*e.rawData[1]+u*e.rawData[5]+p*e.rawData[9]+C*e.rawData[13],r[14]=l*e.rawData[2]+u*e.rawData[6]+p*e.rawData[10]+C*e.rawData[14],r[15]=l*e.rawData[3]+u*e.rawData[7]+p*e.rawData[11]+C*e.rawData[15]}function Hu(s,e){let t=e.x,a=e.y,r=e.z,i=e.w,n=s.rawData,o=2*t*a,l=2*t*r,c=2*t*i,f=2*a*r,h=2*a*i,u=2*r*i,g=t*t,A=a*a,m=r*r,p=i*i;return n[0]=g-A-m+p,n[4]=o-u,n[8]=l+h,n[12]=0,n[1]=o+u,n[5]=-g+A-m+p,n[9]=f-c,n[13]=0,n[2]=l-h,n[6]=f+c,n[10]=-g-A+m+p,n[14]=0,n[3]=0,n[7]=0,n[11]=0,n[15]=1,s}function Ku(s,e){let t=e.rawData,a=Math.sin(s),r=Math.cos(s);return t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[8]=a,t[9]=0,t[10]=r,t[11]=0,t}function qu(s,e,t){let a=e.x,r=e.y,i=e.z,n=Math.hypot(a,r,i),o,l,c,f,h,u,g,A,m,p,D,B;if(n<Xu)return null;n=1/n,a*=n,r*=n,i*=n,o=Math.sin(s),l=Math.cos(s),c=1-l,f=a*a*c+l,h=r*a*c+i*o,u=i*a*c-r*o,g=a*r*c-i*o,A=r*r*c+l,m=i*r*c+a*o,p=a*i*c+r*o,D=r*i*c-a*o,B=i*i*c+l;let v=t.rawData;return v[0]=f,v[1]=h,v[2]=u,v[3]=0,v[4]=g,v[5]=A,v[6]=m,v[7]=0,v[8]=p,v[9]=D,v[10]=B,v[11]=0,v[12]=0,v[13]=0,v[14]=0,v[15]=1,v}function fs(s,e,t){let a=s.rawData,r=a[0],i=a[1],n=a[2],o=a[3],l=a[4],c=a[5],f=a[6],h=a[7],u=a[8],g=a[9],A=a[10],m=a[11],p=a[12],D=a[13],B=a[14],v=a[15],C=e.rawData,y=t.rawData,x=C[0],k=C[1],E=C[2],S=C[3];return y[0]=x*r+k*l+E*u+S*p,y[1]=x*i+k*c+E*g+S*D,y[2]=x*n+k*f+E*A+S*B,y[3]=x*o+k*h+E*m+S*v,x=C[4],k=C[5],E=C[6],S=C[7],y[4]=x*r+k*l+E*u+S*p,y[5]=x*i+k*c+E*g+S*D,y[6]=x*n+k*f+E*A+S*B,y[7]=x*o+k*h+E*m+S*v,x=C[8],k=C[9],E=C[10],S=C[11],y[8]=x*r+k*l+E*u+S*p,y[9]=x*i+k*c+E*g+S*D,y[10]=x*n+k*f+E*A+S*B,y[11]=x*o+k*h+E*m+S*v,x=C[12],k=C[13],E=C[14],S=C[15],y[12]=x*r+k*l+E*u+S*p,y[13]=x*i+k*c+E*g+S*D,y[14]=x*n+k*f+E*A+S*B,y[15]=x*o+k*h+E*m+S*v,y}var ct=(s=>(s[s.None=0]="None",s[s.PointLight=1]="PointLight",s[s.DirectionLight=2]="DirectionLight",s[s.SpotLight=3]="SpotLight",s[s.SkyLight=4]="SkyLight",s))(ct||{});class fn extends gi{static lightSize=24;index=-1;lightType=-1;radius=.001;linear=8;lightPosition=new b;lightMatrixIndex=-1;direction=new b;quadratic=.032;lightColor=new J(1,1,1,1);intensity=1;innerAngle=0;outerAngle=1;range=100;castShadowIndex=-1;lightTangent=b.FORWARD;iesIndex=-1}class Pe{static componentsUpdateList;static componentsLateUpdateList;static componentsBeforeUpdateList;static componentsComputeList;static componentsEnablePickerList;static graphicComponent;static waitStartComponent;static _init=!1;static init(){this._init||(this._init=!0,this.componentsUpdateList=new Map,this.componentsLateUpdateList=new Map,this.componentsBeforeUpdateList=new Map,this.componentsComputeList=new Map,this.componentsEnablePickerList=new Map,this.graphicComponent=new Map,this.waitStartComponent=new Map)}static bindUpdate(e,t,a){this.init();let r=this.componentsUpdateList.get(e);r||(r=new Map,this.componentsUpdateList.set(e,r)),r.set(t,a)}static unBindUpdate(e,t){this.init();let a=this.componentsUpdateList.get(e);a&&a.delete(t)}static bindLateUpdate(e,t,a){this.init();let r=this.componentsLateUpdateList.get(e);r||(r=new Map,this.componentsLateUpdateList.set(e,r)),r.set(t,a)}static unBindLateUpdate(e,t){this.init();let a=this.componentsLateUpdateList.get(e);a&&a.delete(t)}static bindBeforeUpdate(e,t,a){this.init();let r=this.componentsBeforeUpdateList.get(e);r||(r=new Map,this.componentsBeforeUpdateList.set(e,r)),r.set(t,a)}static unBindBeforeUpdate(e,t){this.init();let a=this.componentsBeforeUpdateList.get(e);a&&a.delete(t)}static bindCompute(e,t,a){this.init();let r=this.componentsComputeList.get(e);r||(r=new Map,this.componentsComputeList.set(e,r)),r.set(t,a)}static unBindCompute(e,t){this.init();let a=this.componentsComputeList.get(e);a&&a.delete(t)}static bindGraphic(e,t,a){this.init();let r=this.graphicComponent.get(e);r||(r=new Map,this.graphicComponent.set(e,r)),r.set(t,a)}static unBindGraphic(e,t){this.init();let a=this.graphicComponent.get(e);a&&a.delete(t)}static appendWaitStart(e){this.init();let t=this.waitStartComponent.get(e.object3D);t?t.indexOf(e)==-1&&t.push(e):this.waitStartComponent.set(e.object3D,[e])}static removeWaitStart(e,t){this.init();let a=Pe.waitStartComponent.get(e);if(a){let r=a.indexOf(t);r!=-1&&a.splice(r)}}static bindEnablePick(e,t,a){this.init();let r=this.componentsEnablePickerList.get(e);r||(r=new Map,this.componentsEnablePickerList.set(e,r)),r.set(t,a)}static unBindEnablePick(e,t){this.init();let a=this.componentsEnablePickerList.get(e);a&&a.delete(t)}}class qe{object3D=null;_eventDispatcher;get eventDispatcher(){return this._eventDispatcher||=new Ja,this._eventDispatcher}set eventDispatcher(e){console.error("The eventDispatcher should not be set externally!")}_enable=!0;__isStart=!1;isDestroyed=!1;get isStart(){return this.__isStart}get transform(){return this.object3D.transform}set enable(e){this._enable!=e&&(this._enable=e,this._enable?this.onEnable?.(this.transform.view3D):this.onDisable?.(this.transform.view3D))}get enable(){return this._enable}__init(e){this.init(e)}__start(){this.transform&&this.transform.scene3D&&this._enable&&this.onEnable?.(this.transform.view3D),this.transform&&this.transform.scene3D&&this.__isStart==!1&&(this.start?.(),this.__isStart=!0),this.onUpdate&&this._onUpdate(this.onUpdate.bind(this)),this.onLateUpdate&&this._onLateUpdate(this.onLateUpdate.bind(this)),this.onBeforeUpdate&&this._onBeforeUpdate(this.onBeforeUpdate.bind(this)),this.onCompute&&this._onCompute(this.onCompute.bind(this)),this.onGraphic&&this._onGraphic(this.onGraphic.bind(this))}__stop(){this.transform&&this.transform.scene3D&&this.onDisable?.(this.transform.view3D),this._onUpdate(null),this._onLateUpdate(null),this._onBeforeUpdate(null),this._onCompute(null),this._onGraphic(null)}init(e){}start(){}stop(){}cloneTo(e){}copyComponent(e){return this}_onUpdate(e){e!=null?Pe.bindUpdate(this.transform.view3D,this,e):Pe.unBindUpdate(this.transform.view3D,this)}_onLateUpdate(e){e!=null?Pe.bindLateUpdate(this.transform.view3D,this,e):Pe.unBindLateUpdate(this.transform.view3D,this)}_onBeforeUpdate(e){e!=null?Pe.bindBeforeUpdate(this.transform.view3D,this,e):Pe.unBindBeforeUpdate(this.transform.view3D,this)}_onCompute(e){e!=null?Pe.bindCompute(this.transform.view3D,this,e):Pe.unBindCompute(this.transform.view3D,this)}_onGraphic(e){e!=null?Pe.bindGraphic(this.transform.view3D,this,e):Pe.unBindGraphic(this.transform.view3D,this)}beforeDestroy(e){Pe.removeWaitStart(this.object3D,this)}destroy(e){this.isDestroyed||(this.isDestroyed=!0,this.enable=!1,this.stop(),this._onBeforeUpdate(null),this._onUpdate(null),this._onLateUpdate(null),this.onEnable=null,this.onDisable=null,this.onUpdate=null,this.onLateUpdate=null,this.onBeforeUpdate=null,this.onCompute=null,this.onGraphic=null)}}class dn{value=0;inv_base=0;static get(e,t){let a=0,r=1/t;for(;e>0;)a+=e%t*r,e/=t,r/=t;return a}getBase(e,t){let a=this.inv_base=1/t;for(;e>0;)this.value+=a*(e%t),e/=t,a*=this.inv_base}next(){let e=1-this.value-1e-7;if(this.inv_base<e)this.value+=this.inv_base;else{let t=this.inv_base,a;do a=t,t*=this.inv_base;while(t>=e);this.value+=a+t-1}}get(){return this.value}}class na{origin=new b;length=Number.MAX_VALUE;static _rayl=1e9;static _smallnum=1e-8;_vector=new b;_dir=new b;constructor(e,t){this.origin.copyFrom(e||new b),this._dir.copyFrom(t||new b),this._dir.normalize()}get direction(){return this._dir}set direction(e){this._dir.copyFrom(e),this._dir.normalize()}clone(){return new na(this.origin,this.direction)}intersectBox(e,t){let a=this.direction,r=this.origin,i,n,o,l,c,f;const h=1/a.x,u=1/a.y,g=1/a.z,A=e.min,m=e.max;return i=((h>=0?A.x:m.x)-r.x)*h,n=((h>=0?m.x:A.x)-r.x)*h,o=((u>=0?A.y:m.y)-r.y)*u,l=((u>=0?m.y:A.y)-r.y)*u,i>l||o>n||(o>i&&(i=o),l<n&&(n=l),c=((g>=0?A.z:m.z)-r.z)*g,f=((g>=0?m.z:A.z)-r.z)*g,i>f||c>n)||(c>i&&(i=c),f<n&&(n=f),n<0)?null:(t||=new b,this.pointAt(i>=0?i:n,t))}pointAt(e,t){return t||=new b,t.copy(this.direction),t.multiplyScalar(e),t.add(this.origin,t),t}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this._dir.copy(e._dir),this.length=e.length,this}setApproxDirection(e){this._dir=e.normalize()}setOrigin(e){this.origin.copyFrom(e)}getOrigin(){return this.origin}getPoint(e){return this._dir.scaleBy(e),this.origin.add(this._dir)}sqrDistToPoint(e){let t=this._dir,a=e.subtract(this.origin),r=xt(a,t),i=xt(t,t),n=r/i,o=this.getPoint(n);return ls(e.subtract(o))}applyMatrix(e){this.origin=e.transformPoint(this.origin),this._dir=e.transformVector(this._dir)}_v0=new b;_v1=new b;_v2=new b;pointInTriangle(e,t,a,r){let i=this._v0,n=this._v1,o=this._v2;r.subtract(t,i),a.subtract(t,n),e.subtract(t,o);let l=b.dot(i,i),c=b.dot(i,n),f=b.dot(i,o),h=b.dot(n,n),u=b.dot(n,o),g=1/(l*h-c*c),A=(h*f-c*u)*g,m=(l*u-c*f)*g;return A>=0&&m>=0&&A+m<1}_E1=new b;_E2=new b;_P=new b;_T=new b;_Q=new b;intersectTriangle(e,t,a){let r=a.v1,i=a.v2,n=a.v3;i.subtract(r,this._E1),n.subtract(r,this._E2),t.crossProduct(this._E2,this._P);let o=this._E1.dotProduct(this._P);if(o>0?e.subtract(r,this._T):(r.subtract(e,this._T),o=-o),o<1e-4||(a.u=this._T.dotProduct(this._P),a.u<0||a.u>o)||(this._T.crossProduct(this._E1,this._Q),a.v=t.dotProduct(this._Q),a.v<0||a.u+a.v>o))return null;let l=new b;a.t0=a.t=this._E2.dotProduct(this._Q);let c=1/o;return a.t*=c,a.u*=c,a.v*=c,l.x=e.x+a.t*t.x,l.y=e.y+a.t*t.y,l.z=e.z+a.t*t.z,l}intersectSphere(e,t,a,r){let i=e.subtract(a),n=b.dot(t,t),o=2*b.dot(i,t),l=b.dot(i,i)-r*r,c=o*o-4*n*l,f=b.HELP_3;if(c<0)return null;{let h=(-o-Math.sqrt(c))/(n*2);return h<0?null:(f.x=e.x+h*t.x,f.y=e.y+h*t.y,f.z=e.z+h*t.z,f)}}intersectionSegment(e,t,a){const r=this.origin,i=b.HELP_0,n=b.HELP_1,o=b.HELP_2,l=b.HELP_3;t.subtract(e,i),this._dir.scaleToRef(na._rayl,o),r.add(o,n),e.subtract(r,l);var c=b.dot(i,i),f=b.dot(i,o),h=b.dot(o,o),u=b.dot(i,l),g=b.dot(o,l),A=c*h-f*f,m,p,D=A,B,v,C=A;A<na._smallnum?(p=0,D=1,v=g,C=h):(p=f*g-h*u,v=c*g-f*u,p<0?(p=0,v=g,C=h):p>D&&(p=D,v=g+f,C=h)),v<0?(v=0,-u<0?p=0:-u>c?p=D:(p=-u,D=c)):v>C&&(v=C,-u+f<0?p=0:-u+f>c?p=D:(p=-u+f,D=c)),m=Math.abs(p)<na._smallnum?0:p/D,B=Math.abs(v)<na._smallnum?0:v/C;const y=b.HELP_4;o.scaleToRef(B,y);const x=b.HELP_5;i.scaleToRef(m,x),x.add(l,x);const k=b.HELP_6;x.subtract(y,k);var E=B>0&&B<=this._dir.length&&k.lengthSquared<a*a;if(E){let S=new b;return S.copyFrom(t.subtract(e)),S.scaleBy(m),S.add(e,S),{out:S,length:x.length}}return{out:null,length:-1}}get_vec(e,t){let a=b.HELP_1;return a.x=e.x-t.x,a.y=e.y-t.y,a.z=e.z-t.z,a}}class Ai{x;y;w;h;constructor(e=0,t=0,a=0,r=0){this.x=e,this.y=t,this.w=a,this.h=r}get width(){return this.w}set width(e){this.w=e}get height(){return this.h}set height(e){this.h=e}static pointInRect(e,t,a,r,i,n){return!(e<a||e>i||t<r||t>n)}clone(){return new Ai(this.x,this.y,this.w,this.h)}copyFrom(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h}copyTo(e){e.copyFrom(this)}inner(e,t){return!(e<this.x||e>this.x+this.width||t<this.y||t>this.y+this.height)}equal(e){return!(this.x!=e.x||this.y!=e.y||this.width!=e.width||this.height!=e.height)}equalArea(e,t,a,r){return!(this.x!=e||this.y!=t||this.width!=a||this.height!=r)}equalInnerArea(e){var t=this.x,a=this.y,r=this.x+this.width,i=this.y+this.height,n=e.x,o=e.y,l=e.x+e.width,c=e.y+e.height;return Math.max(t,n)<=Math.min(r,l)&&Math.max(a,o)<=Math.min(i,c)}innerArea(e,t){t=t||new Ai;var a=this.x,r=this.y,i=this.x+this.width,n=this.y+this.height,o=e.x,l=e.y,c=e.x+e.width,f=e.y+e.height,h=Math.max(r,l),u=Math.min(n,f),g=Math.max(a,o),A=Math.min(c,i);return h>=0&&u>=0&&u-h>=0&&A-g>0?(t.x=g,t.y=h,t.width=A-g,t.height=u-h):(t.x=0,t.y=0,t.width=0,t.height=0),t}setTo(e,t,a,r){this.x=e,this.y=t,this.width=a,this.height=r}}class xe{center;extents;max;min;size;static maxVector3=new b(1,1,1).multiplyScalar(Number.MAX_VALUE*.1);static minVector3=new b(1,1,1).multiplyScalar(-Number.MAX_VALUE*.1);constructor(e,t){e||=b.ZERO.clone(),t||=b.ZERO.clone(),this.setFromCenterAndSize(e,t)}makeEmpty(){return this.setFromMinMax(xe.maxVector3,xe.minVector3),this}setFromMinMax(e,t){return this.init(),this.min.copyFrom(e),this.max.copyFrom(t),this.max.subtract(this.min,this.size),this.extents.copyFrom(this.size).multiplyScalar(.5),this.min.add(this.max,this.center).multiplyScalar(.5),this}init(){return this.min||=new b,this.max||=new b,this.size||=new b,this.center||=new b,this.extents||=new b,this}setFromCenterAndSize(e,t){return this.init(),this.center.copyFrom(e),this.size.copyFrom(t),this.extents.copyFrom(this.size).multiplyScalar(.5),this.center.subtract(this.extents,this.min),this.center.add(this.extents,this.max),this}inFrustum(e,t){return t.containsBox(e.bound)}merge(e){e.min.x<this.min.x&&(this.min.x=e.min.x),e.min.y<this.min.y&&(this.min.y=e.min.y),e.min.z<this.min.z&&(this.min.z=e.min.z),e.max.x>this.max.x&&(this.max.x=e.max.x),e.max.y>this.max.y&&(this.max.y=e.max.y),e.max.z>this.max.z&&(this.max.z=e.max.z),this.size.x=this.max.x-this.min.x,this.size.y=this.max.y-this.min.y,this.size.z=this.max.z-this.min.z,this.extents.x=this.size.x*.5,this.extents.y=this.size.y*.5,this.extents.z=this.size.z*.5,this.center.x=this.min.x+this.extents.x,this.center.y=this.min.y+this.extents.y,this.center.z=this.min.z+this.extents.z}intersects(e){return this.min.x<=e.max.x&&this.max.x>=e.min.x&&this.min.y<=e.max.y&&this.max.y>=e.min.y&&this.min.z<=e.max.z&&this.max.z>=e.min.z}intersectsSphere(e){return this.min.x<=e.max.x&&this.max.x>=e.min.x&&this.min.y<=e.max.y&&this.max.y>=e.min.y&&this.min.z<=e.max.z&&this.max.z>=e.min.z}intersectsBox(e){return this.min.x<=e.max.x&&this.max.x>=e.min.x&&this.min.y<=e.max.y&&this.max.y>=e.min.y&&this.min.z<=e.max.z&&this.max.z>=e.min.z}equals(e){return this.center.equals(e.center)&&this.extents.equals(e.extents)}expandByPoint(e){e.x<this.min.x&&(this.min.x=e.x),e.x>this.max.x&&(this.max.x=e.x),e.y<this.min.y&&(this.min.y=e.y),e.y>this.max.y&&(this.max.y=e.y),e.z<this.min.z&&(this.min.z=e.z),e.z>this.max.z&&(this.max.z=e.z),this.size.x=this.max.x-this.min.x,this.size.y=this.max.y-this.min.y,this.size.z=this.max.z-this.min.z,this.extents.x=this.size.x*.5,this.extents.y=this.size.y*.5,this.extents.z=this.size.z*.5,this.center.x=this.min.x+this.extents.x,this.center.y=this.min.y+this.extents.y,this.center.z=this.min.z+this.extents.z}static fromPoints(e){for(var t=new xe(new b,new b),a=0;a<e.length;a++)t.expandByPoint(e[a]);return t}calculateTransform(e){}clone(){var e=new xe(this.center.clone(),this.size.clone());return e}intersectsRay(e,t){throw new Error("Method not implemented.")}containsPoint(e){return this.min.x<=e.x&&this.max.x>=e.x&&this.min.y<=e.y&&this.max.y>=e.y&&this.min.z<=e.z&&this.max.z>=e.z}containsBox(e){let t=this.min,a=this.max;return t.x<=e.min.x&&t.y<=e.min.y&&t.z<=e.min.z&&a.x>=e.max.x&&a.y>=e.max.y&&a.z>=e.max.z}updateBound(){}destroy(e){this.center=null,this.extents=null,this.min=null,this.max=null,this.size=null}}class ds{planes;corners;boundingBox=new xe;constructor(){this.planes=[],this.corners=[];for(var e=0;e<6;e++)this.planes[e]=new b;for(var e=0;e<8;e++)this.corners[e]=new b}updateBoundBox(e){this.boundingBox.makeEmpty();let t=this.boundingBox.min,a=this.boundingBox.max,r=0;for(let i=0;i<2;++i)for(let n=0;n<2;++n)for(let o=0;o<2;++o){let l=this.corners[r];r++,l.set(2*i-1,2*n-1,o,1),e.transformVector4(l,l),l.div(l.w,l),t.x=Math.min(l.x,t.x),t.y=Math.min(l.y,t.y),t.z=Math.min(l.z,t.z),a.x=Math.max(l.x,a.x),a.y=Math.max(l.y,a.y),a.z=Math.max(l.z,a.z)}return this.boundingBox.setFromMinMax(t,a),this}setFrustumCorners(e){let t=0;for(let a=0;a<2;++a)for(let r=0;r<2;++r)for(let i=0;i<2;++i){let n=this.corners[t];n.set(2*a-1,2*r-1,i,1),e.transformVector4(n,n),n.div(n.w,n),t++}}update(e){var t=e.rawData;this.planes[0].x=t[3]-t[0],this.planes[0].y=t[7]-t[4],this.planes[0].z=t[11]-t[8],this.planes[0].w=t[15]-t[12];var a=Math.sqrt(this.planes[0].x*this.planes[0].x+this.planes[0].y*this.planes[0].y+this.planes[0].z*this.planes[0].z);this.planes[0].x/=a,this.planes[0].y/=a,this.planes[0].z/=a,this.planes[0].w/=a,this.planes[1].x=t[3]+t[0],this.planes[1].y=t[7]+t[4],this.planes[1].z=t[11]+t[8],this.planes[1].w=t[15]+t[12],a=Math.sqrt(this.planes[1].x*this.planes[1].x+this.planes[1].y*this.planes[1].y+this.planes[1].z*this.planes[1].z),this.planes[1].x/=a,this.planes[1].y/=a,this.planes[1].z/=a,this.planes[1].w/=a,this.planes[2].x=t[3]+t[1],this.planes[2].y=t[7]+t[5],this.planes[2].z=t[11]+t[9],this.planes[2].w=t[15]+t[13],a=Math.sqrt(this.planes[2].x*this.planes[2].x+this.planes[2].y*this.planes[2].y+this.planes[2].z*this.planes[2].z),this.planes[2].x/=a,this.planes[2].y/=a,this.planes[2].z/=a,this.planes[2].w/=a,this.planes[3].x=t[3]-t[1],this.planes[3].y=t[7]-t[5],this.planes[3].z=t[11]-t[9],this.planes[3].w=t[15]-t[13],a=Math.sqrt(this.planes[3].x*this.planes[3].x+this.planes[3].y*this.planes[3].y+this.planes[3].z*this.planes[3].z),this.planes[3].x/=a,this.planes[3].y/=a,this.planes[3].z/=a,this.planes[3].w/=a,this.planes[4].x=t[3]-t[2],this.planes[4].y=t[7]-t[6],this.planes[4].z=t[11]-t[10],this.planes[4].w=t[15]-t[14],a=Math.sqrt(this.planes[4].x*this.planes[4].x+this.planes[4].y*this.planes[4].y+this.planes[4].z*this.planes[4].z),this.planes[4].x/=a,this.planes[4].y/=a,this.planes[4].z/=a,this.planes[4].w/=a,this.planes[5].x=t[3]+t[2],this.planes[5].y=t[7]+t[6],this.planes[5].z=t[11]+t[10],this.planes[5].w=t[15]+t[14],a=Math.sqrt(this.planes[5].x*this.planes[5].x+this.planes[5].y*this.planes[5].y+this.planes[5].z*this.planes[5].z),this.planes[5].x/=a,this.planes[5].y/=a,this.planes[5].z/=a,this.planes[5].w/=a}containsPoint(e){for(var t=0;t<6;t++)if(this.planes[t].x*e.x+this.planes[t].y*e.y+this.planes[t].z*e.z+this.planes[t].w<=0)return!1;return!0}containsSphere(e){let t=e.bound,a=0,r,i=e.transform.worldPosition,n=t.radius,o=t.center.x+i.x,l=t.center.y+i.y,c=t.center.z+i.z;for(let f of this.planes){if(r=f.x*o+f.y*l+f.z*c+f.w,r<=-n)return 0;r>n&&a++}return a===6?2:1}containsBox(e){let t=0,a,i=Math.max(e.size.x,e.size.y,e.size.z)*2,n=e.center.x,o=e.center.y,l=e.center.z;for(let c of this.planes){if(a=c.x*n+c.y*o+c.z*l+c.w,a<=-i)return 0;a>i&&t++}return t===6?2:1}containsBox2(e){let t=0,a,r=1.74*Math.max(e.extents.x,e.extents.y,e.extents.z);for(let i of this.planes){if(a=i.x*e.center.x+i.y*e.center.y+i.z*e.center.z+i.w,a<=-r)return 0;a>r&&t++}return t===6?2:1}containsBoxPrecise(e){const t=[new b(e.min.x,e.min.y,e.min.z),new b(e.max.x,e.min.y,e.min.z),new b(e.min.x,e.max.y,e.min.z),new b(e.max.x,e.max.y,e.min.z),new b(e.min.x,e.min.y,e.max.z),new b(e.max.x,e.min.y,e.max.z),new b(e.min.x,e.max.y,e.max.z),new b(e.max.x,e.max.y,e.max.z)];let a=0;for(let r=0;r<6;r++){const i=this.planes[r];let n=-1/0,o=1/0;for(let l=0;l<8;l++){const c=t[l],f=i.x*c.x+i.y*c.y+i.z*c.z+i.w;n=Math.max(n,f),o=Math.min(o,f)}if(n<0)return 0;o>0&&a++}return a===6?2:1}}var at=(s=>(s[s.ortho=0]="ortho",s[s.perspective=1]="perspective",s[s.shadow=2]="shadow",s))(at||{});class $u{corners;index;constructor(e){this.index=e,this.corners=[];for(let t=0;t<4;t++)this.corners.push(new b)}}class e2{bound;twoSections;name;color;shadowCamera;index;constructor(e,t,a){this.bound=new xe,this.shadowCamera=dt.createCamera3DObject(null,"csmShadowCamera_"+a),this.shadowCamera.isShadowCamera=!0,this.shadowCamera.orthoOffCenter(100,-100,100,-100,1,1e4),this.twoSections=[e,t],this.index=a,a==0?this.color=new J(1,0,0,1):a==1?this.color=new J(0,1,0,1):a==2?this.color=new J(0,0,1,1):a==3&&(this.color=new J(0,1,1,1)),this.name="child_"+a}updateBound(){this.bound.makeEmpty();let e=this.bound.min,t=this.bound.max;for(let a of this.twoSections)for(let r of a.corners)e.x=Math.min(r.x,e.x),e.y=Math.min(r.y,e.y),e.z=Math.min(r.z,e.z),t.x=Math.max(r.x,t.x),t.y=Math.max(r.y,t.y),t.z=Math.max(r.z,t.z);return this.bound.setFromMinMax(e,t),this}}class gc{sections;children;name;constructor(e){this.sections=[];let t=e+1;for(let a=0;a<t;a++)this.sections.push(new $u(a));this.children=[];for(let a=0;a<e;a++)this.children.push(new e2(this.sections[a],this.sections[a+1],a))}update(e,t,a,r,i){let n=this.sections.length-1;for(let o=0;o<=n;++o){let l=this.sections[o],c=0,f=this.logSplit(a,r,o,this.sections.length);{let u=(f-a)/r;u=u**i.csmScatteringExp,f=(r-a)*u+a}f*=i.csmAreaScale;let h=(e.rawData[10]*f+e.rawData[14])/f;for(let u=0;u<2;++u)for(let g=0;g<2;++g){let A=l.corners[c];c++,A.set(2*u-1,2*g-1,h,1),t.transformVector4(A,A),A.div(A.w,A)}}for(let o of this.children)o.updateBound();return this}squareSplit(e,t,a,r){return(a/(r-1))**4*(t-e)+e}uniformSplit(e,t,a,r){return a/(r-1)*(t-e)+e}logSplit(e,t,a,r){return e*(t/e)**(a/(r-1))}}class Hr extends qe{fov=60;name;aspect=1;near=1;far=5e3;left=-100;right=100;top=100;bottom=-100;frustumSize=100;viewPort=new Ai;frustum;sh=new Float32Array(36);isShadowCamera=!1;_projectionMatrixInv=new R;_projectionMatrix=new R;_viewMatrix=new R;_viewMatrixInv=new R;_unprojection=new R;_pvMatrixInv=new R;_pvMatrix=new R;_halfw;_halfh;_ray;_enableCSM=!1;mainCamera;get projectionMatrix(){return this._projectionMatrix}lookTarget;type=at.perspective;csm;cubeShadowCameras=[];get enableCSM(){return this._enableCSM}set enableCSM(e){e&&!this.csm&&(this.csm=new gc(ra.Cascades)),this._enableCSM=e}constructor(){super()}init(){super.init(),this._ray=new na,this.frustum=new ds,this.lookTarget=new b(0,0,0),this.viewPort.x=0,this.viewPort.y=0,this.viewPort.w=w.presentationSize[0],this.viewPort.h=w.presentationSize[1],this.updateProjection(),w.addEventListener(ir.RESIZE,this.updateProjection,this)}updateProjection(){this.aspect=w.aspect,this.type==at.perspective?this.perspective(this.fov,this.aspect,this.near,this.far):this.type==at.ortho&&(this.frustumSize?this.ortho(this.frustumSize,this.near,this.far):this.orthoOffCenter(this.left,this.right,this.bottom,this.top,this.near,this.far))}getShadowBias(e){let t=2*this.getShadowWorldExtents()/e,a=this.far-this.near;return t/a-_.setting.shadow.shadowBias*.01}getShadowWorldExtents(){let e=_.setting.shadow.shadowBound;return e?e*=.5:e=Math.round(.05*this.frustum.boundingBox.extents.length),e}getCSMShadowBiasScale(e){if(e==this)return 1;let t=this.far-this.near,a=this.csm.children[0].shadowCamera;return(a.far-a.near)/t}getCSMShadowWorldExtents(e){return Math.round(this.csm.children[e].bound.extents.length)}perspective(e,t,a,r){this.fov=e,this.aspect=t,this.near=Math.max(.001,a),this.far=r,this._projectionMatrix.perspective(this.fov,this.aspect,this.near,this.far),this.type=at.perspective}ortho(e,t,a){this.frustumSize=e;let r=e*.5*this.aspect,i=e*.5,n=-r/2,o=r/2,l=i/2,c=-i/2;this.orthoOffCenter(n,o,c,l,t,a)}orthoOffCenter(e,t,a,r,i,n){this.near=i,this.far=n,this.left=e,this.right=t,this.top=r,this.bottom=a,this.type=at.ortho,this._projectionMatrix.orthoOffCenter(this.left,this.right,this.bottom,this.top,this.near,this.far)}get viewMatrix(){return this._viewMatrix.copyFrom(this.transform.worldMatrix),this._viewMatrix.invert(),this._viewMatrix}get shadowViewMatrix(){return this._viewMatrix.copyFrom(this.transform.worldMatrix),this._viewMatrix.appendScale(1,1,1),this._viewMatrix.invert(),this._viewMatrix}object3DToScreenRay(e,t=null){return t||(t=new b(0,0,0,1)),this._halfw=this.viewPort.width*.5,this._halfh=this.viewPort.height*.5,Pt.transformVector(this.viewMatrix,e,t),this.project(t,t),t.x=this._halfw+t.x*this._halfw,t.y=this.viewPort.height-(this._halfh-t.y*this._halfh),t}screenRayToObject3D(e,t=null){t||(t=new b),this._halfw=this.viewPort.width*.5,this._halfh=this.viewPort.height*.5;let a=e.x,r=e.y;return t.x=a/this.viewPort.width-.25,t.y=r/this.viewPort.height-.25,this.unProject(t.x,t.y,e.z,t),t}get pvMatrix(){return fs(this._projectionMatrix,this.viewMatrix,this._pvMatrix),this._pvMatrix}get pvMatrix2(){fs(this._projectionMatrix,this.transform.worldMatrix,this._pvMatrix);let e=this._pvMatrixInv.copyFrom(this.pvMatrix);return e.invert(),e}get pvMatrixInv(){let e=this._pvMatrixInv.copyFrom(this.pvMatrix);return e.invert(),e}get vMatrixInv(){let e=this._viewMatrixInv.copyFrom(this.viewMatrix);return e.invert(),e}get cameraToWorld(){let e=R.helpMatrix;return e.identity(),e.copyFrom(this.projectionMatrixInv),e.multiply(this.vMatrixInv),e}get ndcToView(){let e=R.helpMatrix;return e.identity(),e.copyFrom(this.projectionMatrixInv),e}get projectionMatrixInv(){return this._projectionMatrixInv.copyFrom(this._projectionMatrix),this._projectionMatrixInv.invert(),this._projectionMatrixInv}unProject(e,t,a,r){return r||(r=new b),r.x=e,r.y=-t,r.z=a,r.w=1,r.x*=a,r.y*=a,this._unprojection.copyFrom(this._projectionMatrix),this._unprojection.invert(),Pt.transformVector(this._unprojection,r,r),r.z=a,r}project(e,t){return this._projectionMatrix.perspectiveMultiplyPoint3(e,t),t.x=t.x/t.w,t.y=-t.y/t.w,t.z=e.z,t}screenPointToRay(e,t){let a=this._ray,r=dt.UnProjection(e,t,.01,this),i=dt.UnProjection(e,t,1,this);return i=i.subtract(r).normalize(),a.origin.copyFrom(r),a.direction=i,a}screenPointToWorld(e,t,a){return dt.UnProjection(e,t,a,this)}worldToScreenPoint(e,t){return dt.Projection(e,this,t)}lookAt(e,t,a=b.Y_AXIS){this.transform.lookAt(e,t,a),t&&this.lookTarget.copyFrom(t)}onUpdate(){this._useJitterProjection&&this.getJitteredProjectionMatrix(),this.frustum.update(this.pvMatrix),this.frustum.updateBoundBox(this.pvMatrixInv);let e=_.setting.shadow;this.enableCSM&&this.csm?.update(this._projectionMatrix,this._pvMatrixInv,this.near,this.far,e)}_haltonSeq;_jitterOffsetList;_useJitterProjection=!1;_jitterFrameIndex=0;_sampleIndex=0;_jitterX=0;_jitterY=0;get jitterFrameIndex(){return this._jitterFrameIndex}get jitterX(){return this._jitterX}get jitterY(){return this._jitterY}enableJitterProjection(e){this._jitterFrameIndex=0,this._useJitterProjection=e,this._haltonSeq||=new dn,this._jitterOffsetList=[];for(let t=0;t<32;t++){let a=this.generateRandomOffset();this._jitterOffsetList.push(a)}this._jitterOffsetList.reverse()}generateRandomOffset(){let e=new de(dn.get((this._sampleIndex&1023)+1,2)-.5,dn.get((this._sampleIndex&1023)+1,3)-.5);return++this._sampleIndex>=32&&(this._sampleIndex=0),e}getJitteredProjectionMatrix(){let e=_.setting.render.postProcessing.taa,t=this._projectionMatrix,a=e.temporalJitterScale,r=this._jitterFrameIndex%e.jitterSeedCount,i=this._jitterOffsetList[r].x*a,n=this._jitterOffsetList[r].y*a,o=t.get(0,2),l=t.get(1,2);this._jitterX=i/this.viewPort.width,this._jitterY=n/this.viewPort.height,o+=this._jitterX,l+=this._jitterY,t.set(0,2,o),t.set(1,2,l),this._jitterFrameIndex++}getWorldDirection(e){e||=new b;const t=this.transform._worldMatrix.rawData;return e.set(-t[8],-t[9],-t[10]).normalize()}}class zt extends qe{static LIMIT=1;static COMPONENT_NAME="UUTransform";static COMPONENT_TYPE="Transform";static POSITION_ONCHANGE="POSITION_ONCHANGE";static ROTATION_ONCHANGE="ROTATION_ONCHANGE";static SCALE_ONCHANGE="SCALE_ONCHANGE";static PARENT_ONCHANGE="PARENT_ONCHANGE";static CHILDREN_ONCHANGE="CHILDREN_ONCHANGE";static ADD_ONCHANGE="ADD_ONCHANGE";static LOCAL_ONCHANGE="LOCAL_ONCHANGE";eventPositionChange=new bt(zt.POSITION_ONCHANGE);eventRotationChange=new bt(zt.ROTATION_ONCHANGE);eventScaleChange=new bt(zt.SCALE_ONCHANGE);eventLocalChange=new bt(zt.LOCAL_ONCHANGE);onPositionChange;onRotationChange;onScaleChange;_scene3d;_parent;_localPos;_localRot;_localRotQuat;_localScale;_localDetailPos;_localDetailRot;_localDetailScale;index;index2;_forward=new b;_back=new b;_right=new b;_left=new b;_up=new b;_down=new b;_worldMatrix;_targetPos;static=!1;depthOrder=0;get localChange(){return Ee.matrixStateBuffer[this.index2]!=0}set localChange(e){Ee.matrixStateBuffer[this.index2]=e?1:0}get targetPos(){return this._targetPos}set targetPos(e){this._targetPos=e}get parent(){return this._parent}set parent(e){let t=this._parent?.object3D;if(this._parent=e,this.depthOrder=e?e.depthOrder+1:0,Ee.setParent(this.index,e?e.worldMatrix.index:-1,this.depthOrder),this.localChange=!0,this.object3D){let a=e?e.scene3D:null;a?(this._scene3d=a,this.object3D.components.forEach(r=>{Pe.appendWaitStart(r)})):this.object3D.components.forEach(r=>{r.__stop()});for(let r of this.object3D.entityChildren)r.transform.parent=e?this:null;this.object3D.components.forEach(r=>{r.onParentChange?.(t,this._parent?.object3D)})}this.notifyLocalChange()}set enable(e){this.transform._scene3d&&e?super.enable=!0:super.enable=!1;for(let t of this.object3D.entityChildren)t.transform.enable=e}get enable(){return this._enable}get scene3D(){return this._scene3d}set scene3D(e){this._scene3d=e}get view3D(){return this._scene3d&&this._scene3d.view?this._scene3d.view:null}constructor(){super(),this._worldMatrix=new R(!0),this.index=this._worldMatrix.index,this.index2=this._worldMatrix.index*Ee.stateStruct,this._localPos=new b,this._localRot=new b,this._localRotQuat=new ae,this._localScale=new b(1,1,1),Ee.setScale(this.index,this._localScale.x,this._localScale.y,this._localScale.z),Ee.setRotation(this.index,this._localRot.x,this._localRot.y,this._localRot.z),Ee.setTranslate(this.index,this._localPos.x,this._localPos.y,this._localPos.z)}awake(){}start(){}stop(){}notifyLocalChange(){if(this.localChange=!0,this.object3D){let e=this.object3D.entityChildren,t=0,a=e.length;for(t=0;t<a;t++)e[t].transform.notifyLocalChange()}this.eventDispatcher.dispatchEvent(this.eventLocalChange)}get up(){return this.worldMatrix.transformVector(b.UP,this._up),this._up}set up(e){this._up.copyFrom(e),Pt.fromToRotation(b.UP,this._up,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0}get down(){return this.worldMatrix.transformVector(b.DOWN,this._down),this._down}set down(e){this._down.copyFrom(e),Pt.fromToRotation(b.DOWN,this._down,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0,this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange)}get forward(){return this.worldMatrix.transformVector(b.FORWARD,this._forward),this._forward}set forward(e){this._forward.copyFrom(e),Pt.fromToRotation(b.FORWARD,this._forward,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0,this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange)}get back(){return this.worldMatrix.transformVector(b.BACK,this._back),this._back}set back(e){this._back.copyFrom(e),Pt.fromToRotation(b.BACK,this._back,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0}get left(){return this.worldMatrix.transformVector(b.neg_X_AXIS,this._left),this._left}set left(e){this._left.copyFrom(e),Pt.fromToRotation(b.LEFT,this._left,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0}get right(){return this.worldMatrix.transformVector(b.X_AXIS,this._right),this._right}set right(e){this._right.copyFrom(e),Pt.fromToRotation(b.RIGHT,this._right,ae.HELP_0),this.transform.localRotQuat=ae.HELP_0,this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange)}get localRotQuat(){return this.localChange&&this.updateWorldMatrix(),this._localRotQuat}set localRotQuat(e){(e.x!=this._localRotQuat.x||e.y!=this._localRotQuat.y||e.z!=this._localRotQuat.z||e.w!=this._localRotQuat.w)&&(this._localRotQuat.copyFrom(e),this._localRotQuat.getEulerAngles(this._localRot),Ee.setRotation(this.index,this._localRot.x,this._localRot.y,this._localRot.z),this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange))}notifyChange(){this.notifyLocalChange(),this.onRotationChange?.(),this.onScaleChange?.(),this.onPositionChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange),this.eventPositionChange&&this.eventDispatcher.dispatchEvent(this.eventPositionChange),this.eventScaleChange&&this.eventDispatcher.dispatchEvent(this.eventScaleChange)}get worldMatrix(){return this.updateWorldMatrix(),this._worldMatrix}updateWorldMatrix(e=!1){(this.localChange||e)&&(this.parent?(cn(this._localRot,this._localPos,this._localScale,this._worldMatrix),bc(this._worldMatrix,this.parent.worldMatrix,this._worldMatrix)):cn(this._localRot,this._localPos,this._localScale,this._worldMatrix),this.localChange=!1)}updateChildTransform(){let e=this;if(e.localChange&&e.updateWorldMatrix(),e.object3D.numChildren>0)for(const t of e.object3D.entityChildren)t.transform.updateChildTransform()}lookTarget(e,t=b.UP){this.lookAt(this.transform.worldPosition,e,t)}lookAt(e,t,a=b.UP){this._targetPos||=new b,this._targetPos.copyFrom(t),this.localPosition=e,R.helpMatrix.lookAt(e,t,a),R.helpMatrix.invert();var r=R.helpMatrix.decompose(ia.QUATERNION);this.localRotQuat=ae.CALCULATION_QUATERNION.copyFrom(r[1])}decomposeFromMatrix(e,t="eulerAngles"){let a=e.decompose(t),r=this.transform;return r.localRotQuat.copyFrom(a[1]),r.localRotQuat=r.localRotQuat,r.localPosition.copyFrom(a[0]),r.localPosition=r.localPosition,r.localScale.copyFrom(a[2]),r.localScale=r.localScale,this}cloneTo(e){e.transform.localPosition=this.localPosition,e.transform.localRotation=this.localRotation,e.transform.localScale=this.localScale}set x(e){this._localPos.x!=e&&(this._localPos.x=e,Ee.setTranslate(this.index,this._localPos.x,this._localPos.y,this._localPos.z),this.notifyLocalChange(),this.onPositionChange?.(),this.eventPositionChange&&this.eventDispatcher.dispatchEvent(this.eventPositionChange))}get x(){return this._localPos.x}set y(e){this._localPos.y!=e&&(this._localPos.y=e,Ee.setTranslate(this.index,this._localPos.x,this._localPos.y,this._localPos.z),this.notifyLocalChange(),this.onPositionChange?.(),this.eventPositionChange&&this.eventDispatcher.dispatchEvent(this.eventPositionChange))}get y(){return this._localPos.y}set z(e){this._localPos.z!=e&&(this._localPos.z=e,Ee.setTranslate(this.index,this._localPos.x,this._localPos.y,this._localPos.z),this.notifyLocalChange(),this.onPositionChange?.(),this.eventPositionChange&&this.eventDispatcher.dispatchEvent(this.eventPositionChange))}get z(){return this._localPos.z}set scaleX(e){this._localScale.x!=e&&(this._localScale.x=e,Ee.setScale(this.index,this._localScale.x,this._localScale.y,this._localScale.z),this.notifyLocalChange(),this.onScaleChange?.(),this.eventScaleChange&&this.eventDispatcher.dispatchEvent(this.eventScaleChange))}get scaleX(){return this._localScale.x}set scaleY(e){this._localScale.y!=e&&(this._localScale.y=e,Ee.setScale(this.index,this._localScale.x,this._localScale.y,this._localScale.z),this.notifyLocalChange(),this.onScaleChange?.(),this.eventScaleChange&&this.eventDispatcher.dispatchEvent(this.eventScaleChange))}get scaleY(){return this._localScale.y}set scaleZ(e){this._localScale.z!=e&&(this._localScale.z=e,Ee.setScale(this.index,this._localScale.x,this._localScale.y,this._localScale.z),this.notifyLocalChange(),this.onScaleChange?.(),this.eventScaleChange&&this.eventDispatcher.dispatchEvent(this.eventScaleChange))}get scaleZ(){return this._localScale.z}set rotationX(e){this._localRot.x!=e&&(this._localRot.x=e,Ee.setRotation(this.index,this._localRot.x,this._localRot.y,this._localRot.z),this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange))}get rotationX(){return this._localRot.x}set rotationY(e){this._localRot.y!=e&&(this._localRot.y=e,Ee.setRotation(this.index,this._localRot.x,this._localRot.y,this._localRot.z),this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange))}get rotationY(){return this._localRot.y}set rotationZ(e){this._localRot.z!=e&&(this._localRot.z=e,Ee.setRotation(this.index,this._localRot.x,this._localRot.y,this._localRot.z),this.notifyLocalChange(),this.onRotationChange?.(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange))}get rotationZ(){return this._localRot.z}get worldPosition(){return this.localChange&&this.updateWorldMatrix(),this._worldMatrix.position}set localPosition(e){this.onPositionChange&&(this._localPos.x!=e.x||this._localPos.y!=e.y||this._localPos.z!=e.z)&&this.onPositionChange(this._localPos,e),this._localPos.copyFrom(e),Ee.setTranslate(this.index,e.x,e.y,e.z),this.notifyLocalChange(),this.eventPositionChange&&this.eventDispatcher.dispatchEvent(this.eventPositionChange)}get localPosition(){return this._localPos}set localRotation(e){this.onRotationChange&&(this._localRot.x!=e.x||this._localRot.y!=e.y||this._localRot.z!=e.z)&&this.onRotationChange(this._localRot,e),Ee.setRotation(this.index,e.x,e.y,e.z),this._localRot.copyFrom(e),this.notifyLocalChange(),this.eventRotationChange&&this.eventDispatcher.dispatchEvent(this.eventRotationChange)}get localRotation(){return this._localRot}set localScale(e){Ee.setScale(this.index,e.x,e.y,e.z),this._localScale.copyFrom(e),this.notifyLocalChange(),this.onScaleChange?.(),this.eventScaleChange&&this.eventDispatcher.dispatchEvent(this.eventScaleChange)}get localScale(){return this._localScale}get localDetailScale(){return this._localDetailScale}set localDetailScale(e){this._localDetailScale=e,Ee.setContinueScale(this.index,e.x,e.y,e.z)}get localDetailRot(){return this._localDetailRot}set localDetailRot(e){this._localDetailRot=e,Ee.setContinueRotation(this.index,e.x,e.y,e.z)}get localDetailPos(){return this._localDetailPos}set localDetailPos(e){this._localDetailPos=e,Ee.setContinueTranslate(this.index,e.x,e.y,e.z)}beforeDestroy(e){this.parent&&this.parent.object3D&&this.parent.object3D.removeChild(this.object3D),super.beforeDestroy(e)}destroy(){super.destroy(),this.scene3D=null,this.eventPositionChange=null,this.eventRotationChange=null,this.eventScaleChange=null,this.onPositionChange=null,this.onRotationChange=null,this.onScaleChange=null,this._scene3d=null,this._parent=null,this._localPos=null,this._localRot=null,this._localRotQuat=null,this._localScale=null,this._forward=null,this._back=null,this._right=null,this._left=null,this._up=null,this._down=null,this.localChange=null,this._targetPos=null}}class sa{static GLTF_NODE_INDEX_PROPERTY;static BASE_COLOR_UNIFORM="u_baseColorFactor";static BASE_COLOR_TEXTURE_UNIFORM="u_baseColorSampler";static METALROUGHNESS_UNIFORM="u_metallicRoughnessValues";static METALROUGHNESS_TEXTURE_UNIFORM="u_metallicRoughnessSampler";static NORMAL_TEXTURE_UNIFORM="u_normalSampler";static NORMAL_SCALE_UNIFORM="u_normalScale";static EMISSIVE_TEXTURE_UNIFORM="u_emissiveSampler";static EMISSIVE_FACTOR_UNIFORM="u_emissiveFactor";static OCCLUSION_TEXTURE_UNIFORM="u_occlusionSampler";static OCCLUSION_FACTOR_UNIFORM="u_occlusionFactor";static MAX_MORPH_TARGETS=8;static MORPH_POSITION_PREFIX="a_morphPositions_";static MORPH_NORMAL_PREFIX="a_morphNormals_";static MORPH_TANGENT_PREFIX="a_morphTangents_";static MORPH_WEIGHT_UNIFORM="u_morphWeights";static SCENE_ROOT_SKELETON="SCENE_ROOT";static IDENTITY_INVERSE_BIND_MATRICES="IDENTITY_IBM";static JOINT_MATRICES_UNIFORM="u_jointMatrix";static ALPHA_CUTOFF_UNIFORM="u_alphaCutoff"}var G=(s=>(s.position="position",s.normal="normal",s.uv="uv",s.TANGENT="TANGENT",s.TEXCOORD_1="TEXCOORD_1",s.TEXCOORD_2="TEXCOORD_2",s.TEXCOORD_3="TEXCOORD_3",s.TEXCOORD_4="TEXCOORD_4",s.TEXCOORD_5="TEXCOORD_5",s.TEXCOORD_6="TEXCOORD_6",s.TEXCOORD_7="TEXCOORD_7",s.color="color",s.joints0="joints0",s.joints1="joints1",s.weights0="weights0",s.weights1="weights1",s.weight="weight",s.indices="indices",s.vIndex="vIndex",s.a_morphPositions_0="a_morphPositions_0",s.all="all",s))(G||{}),me=(s=>(s[s.NONE=0]="NONE",s[s.ABOVE=1]="ABOVE",s[s.ALPHA=2]="ALPHA",s[s.NORMAL=3]="NORMAL",s[s.ADD=4]="ADD",s[s.BELOW=5]="BELOW",s[s.ERASE=6]="ERASE",s[s.MUL=7]="MUL",s[s.SCREEN=8]="SCREEN",s[s.DIVD=9]="DIVD",s[s.SOFT_ADD=10]="SOFT_ADD",s))(me||{}),mc=(s=>(s[s.src_a=0]="src_a",s[s.dest_a=1]="dest_a",s))(mc||{});class pc{static getBlend(e){let t={color:{srcFactor:"src-alpha",dstFactor:"one"},alpha:{srcFactor:"one",dstFactor:"one"}};switch(e){case 0:t.color.srcFactor="one",t.color.dstFactor="zero",t.color.operation="add";break;case 1:t.color.srcFactor="one-minus-src-alpha",t.color.dstFactor="dst-alpha",t.color.operation="add";break;case 4:t.color.srcFactor="one",t.color.dstFactor="one",t.color.operation="add",t.alpha.srcFactor="one",t.alpha.dstFactor="one",t.alpha.operation="add";break;case 2:t.color.srcFactor="src-alpha",t.color.dstFactor="one-minus-src-alpha",t.color.operation="add";break;case 5:t.color.srcFactor="one-minus-src-alpha",t.color.dstFactor="one",t.color.operation="add";break;case 6:t.color.srcFactor="zero",t.color.dstFactor="one-minus-src-alpha",t.color.operation="add";break;case 7:t.color.srcFactor="dst",t.color.dstFactor="one-minus-src-alpha",t.color.operation="add";break;case 3:t.color.srcFactor="src-alpha",t.color.dstFactor="one-minus-src-alpha",t.color.operation="add";break;case 10:t.color.srcFactor="one",t.color.dstFactor="one",t.color.operation="max",t.alpha.srcFactor="one",t.alpha.dstFactor="one",t.alpha.operation="add";break;case 8:t.color.srcFactor="one",t.color.dstFactor="one-minus-src",t.color.operation="add";break}return t}}class pa{static mipmapShader=`
|
|
5670
5670
|
var<private> pos : array<vec2<f32>, 4> = array<vec2<f32>, 4>(
|
|
5671
5671
|
vec2<f32>(-1.0, 1.0), vec2<f32>(1.0, 1.0),
|
|
5672
5672
|
vec2<f32>(-1.0, -1.0), vec2<f32>(1.0, -1.0));
|
|
@@ -5692,7 +5692,7 @@ struct InstanceData {
|
|
|
5692
5692
|
var outColor: vec4<f32> = textureSampleLevel(img, imgSampler, texCoord, 0.0);
|
|
5693
5693
|
return outColor;
|
|
5694
5694
|
}
|
|
5695
|
-
`;static pipelineCache={};static pipeline;static getMipmapPipeline(e){let t=w.device,a=pa.pipelineCache[e.format];if(!a){const r=t.createShaderModule({code:pa.mipmapShader});let i=t.createBindGroupLayout({entries:[{binding:0,visibility:e.visibility,sampler:e.samplerBindingLayout},{binding:1,visibility:e.visibility,texture:e.textureBindingLayout}]}),n=w.device.createPipelineLayout({bindGroupLayouts:[i]});a=t.createRenderPipeline({layout:n,vertex:{module:r,entryPoint:"vertexMain"},fragment:{module:r,entryPoint:"fragmentMain",targets:[{format:e.format}]},primitive:{topology:"triangle-strip",stripIndexFormat:"uint32"}}),pa.pipelineCache[e.format]=a}return a}static webGPUGenerateMipmap(e){let t=w.device,a=e.textureDescriptor,r=pa.getMipmapPipeline(e),i=e.getGPUTexture().createView({baseMipLevel:0,mipLevelCount:1});const n=F.beginCommandEncoder();for(let o=1;o<a.mipLevelCount;++o){const l=e.getGPUTexture().createView({baseMipLevel:o,mipLevelCount:1}),c=n.beginRenderPass({colorAttachments:[{view:l,clearValue:[0,0,0,0],loadOp:"clear",storeOp:"store"}]});let f=t.createBindGroupLayout({entries:[{binding:0,visibility:e.visibility,sampler:e.samplerBindingLayout},{binding:1,visibility:e.visibility,texture:e.textureBindingLayout}]});const h=t.createBindGroup({layout:f,entries:[{binding:0,resource:e.gpuSampler},{binding:1,resource:i}]});c.setPipeline(r),c.setBindGroup(0,h),c.draw(4),c.end(),i=l}F.endCommandEncoder(n)}static getMipmapCount(e,t){let i=Math.max(e,t);return 1+Math.log2(i)|0}}class ft{name;url;gpuTexture;_isDestroyed=!1;get isDestroyed(){return this._isDestroyed}pid;view;gpuSampler;gpuSampler_comparison;format;usage;width=4;height=4;depthOrArrayLayers=1;numberLayer=1;viewDescriptor;textureDescriptor;visibility=GPUShaderStage.COMPUTE|GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT;textureBindingLayout={viewDimension:"2d",multisampled:!1};samplerBindingLayout={type:"filtering"};sampler_comparisonBindingLayout={type:"comparison"};flipY;isVideoTexture;isHDRTexture;_useMipmap=!1;_sourceImageData;_addressModeU;_addressModeV;_addressModeW;_magFilter;_minFilter;_mipmapFilter;_lodMinClamp;_lodMaxClamp;_compare;_maxAnisotropy;mipmapCount=1;_textureChange=!1;constructor(e=32,t=32,a=1){this.width=e,this.height=t,this.numberLayer=a,this.minFilter=cr.linear,this.magFilter=cr.linear,this.mipmapFilter=cr.linear,this.addressModeU=Ht.repeat,this.addressModeV=Ht.repeat}init(){let e=this;return e.internalCreateBindingLayoutDesc&&e.internalCreateBindingLayoutDesc(),e.internalCreateTexture&&e.internalCreateTexture(),e.internalCreateView&&e.internalCreateView(),e.internalCreateSampler&&e.internalCreateSampler(),this}createTextureDescriptor(e,t,a,r,i=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.STORAGE_BINDING,n=1,o=0){this.width=e,this.height=t,this.format=r,this.usage=i,this.textureDescriptor={size:[e,t,n],mipLevelCount:a,format:r,usage:i,label:`${this.name+this.width+this.height+this.format}`},o>0&&(this.textureDescriptor.sampleCount=o),n>1?this.viewDescriptor={format:r,dimension:"2d-array"}:this.viewDescriptor={format:r,dimension:this.textureBindingLayout.viewDimension,mipLevelCount:a,baseMipLevel:0}}generate(e){let t=32,a=32;"width"in e&&(t=e.width,a=e.height),(t<32||a<32)&&console.log(e.name+"Size must be greater than 32!"),this.width=t,this.height=a,this.createTexture(e)}createTexture(e){this._sourceImageData=e,this.updateTextureDescription(),this.updateGPUTexture();let t=w.device;this.gpuTexture instanceof GPUTexture&&t.queue.copyExternalImageToTexture({source:this._sourceImageData},{texture:this.gpuTexture},[this.width,this.height]),this.useMipmap&&pa.webGPUGenerateMipmap(this)}get useMipmap(){return this._useMipmap}set useMipmap(e){if(e){if(this.samplerBindingLayout.type="filtering",this._useMipmap==!1&&this._sourceImageData){this._useMipmap=!0,this.updateTextureDescription(),this.updateGPUTexture();let t=w.device;this.gpuTexture instanceof GPUTexture&&t.queue.copyExternalImageToTexture({source:this._sourceImageData},{texture:this.gpuTexture},[this.width,this.height]),pa.webGPUGenerateMipmap(this)}}else if(this.samplerBindingLayout.type="non-filtering",this._useMipmap==!0&&this._sourceImageData){this._useMipmap=!1,this.updateTextureDescription(),this.updateGPUTexture();let t=w.device;this.gpuTexture instanceof GPUTexture&&t.queue.copyExternalImageToTexture({source:this._sourceImageData},{texture:this.gpuTexture},[this.width,this.height])}this._textureChange=!0,this._useMipmap=e,this.noticeChange()}get sourceImageData(){return this._sourceImageData}getMipmapCount(){let e=this.width,t=this.height,a=Math.max(e,t);return 1+Math.log2(a)|0}updateTextureDescription(){this.mipmapCount=Math.floor(this.useMipmap?this.getMipmapCount():1),this.createTextureDescriptor(this.width,this.height,this.mipmapCount,this.format)}updateGPUTexture(){this.gpuTexture&&this.gpuTexture instanceof GPUTexture&&this.gpuTexture.destroy(),this.gpuTexture=null,this.view=null,this.gpuTexture=this.getGPUTexture()}getGPUTexture(){return this.gpuTexture||(this.gpuTexture=w.device.createTexture(this.textureDescriptor)),this.gpuTexture}getGPUView(e=0){return this.view||(this.gpuTexture=this.getGPUTexture(),this.gpuTexture instanceof GPUTexture&&(this.view=this.gpuTexture.createView(this.viewDescriptor),this.view.label=this.name)),this.view}_stateChangeRef=new Map;bindStateChange(e,t){this._stateChangeRef.set(t,e)}unBindStateChange(e){this._stateChangeRef.delete(e)}noticeChange(){this.gpuSampler=w.device.createSampler(this),this._stateChangeRef.forEach((e,t)=>{e()})}destroy(e){if(e&&this.gpuTexture instanceof GPUTexture&&(this.gpuSampler=null,this.gpuSampler_comparison=null,this.textureBindingLayout=null,this.textureDescriptor=null,this.gpuTexture.destroy(),this.gpuTexture=null,this._isDestroyed=!0),this._sourceImageData&&this._sourceImageData instanceof ImageBitmap){try{this._sourceImageData.close()}catch{}this._sourceImageData=null}this._stateChangeRef.clear()}get addressModeU(){return this._addressModeU}set addressModeU(e){this._addressModeU!=e&&(this._addressModeU=e,this.noticeChange())}get addressModeV(){return this._addressModeV}set addressModeV(e){this._addressModeV!=e&&(this._addressModeV=e,this.noticeChange())}get addressModeW(){return this._addressModeW}set addressModeW(e){this._addressModeW!=e&&(this._addressModeW=e,this.noticeChange())}get magFilter(){return this._magFilter}set magFilter(e){this._magFilter!=e&&(this._magFilter=e,this.noticeChange())}get minFilter(){return this._minFilter}set minFilter(e){this._minFilter!=e&&(this._minFilter=e,this.noticeChange())}get mipmapFilter(){return this._mipmapFilter}set mipmapFilter(e){this._mipmapFilter!=e&&(this._mipmapFilter=e,this.noticeChange())}get lodMinClamp(){return this._lodMinClamp}set lodMinClamp(e){this._lodMinClamp!=e&&(this._lodMinClamp=e,this.noticeChange())}get lodMaxClamp(){return this._lodMaxClamp}set lodMaxClamp(e){this._lodMaxClamp!=e&&(this._lodMaxClamp=e,this.noticeChange())}get compare(){return this._compare}set compare(e){this._compare!=e&&(this._compare=e,this.noticeChange())}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy!=e&&(this._maxAnisotropy=e,this.noticeChange())}static _texs=[];static delayDestroyTexture(e){this._texs.includes(e)||this._texs.push(e)}static destroyTexture(){if(this._texs.length>0)for(;this._texs.length>0;)this._texs.shift().destroy()}}class Ac extends ft{_bitmapTextures;constructor(e,t,a){super(e,t,a),this.format=se.rgba8unorm,this.mipmapCount=1,this._bitmapTextures=[],this.init()}setTextures(e){this._bitmapTextures.length=0;for(let t=0;t<e.length;t++){const a=e[t];this.addTexture(a)}}addTexture(e){(e.width!=this.width||e.height!=this.height)&&console.error("bitmap texture must match bitmapTextureArray size!"),e.pid=this._bitmapTextures.length,this._bitmapTextures.push(e),this.updateTexture()}removeTexture(e){let t=this._bitmapTextures.indexOf(e);if(t!=-1){this._bitmapTextures.splice(t,1);for(let a=0;a<this._bitmapTextures.length;a++){const r=this._bitmapTextures[a];r.pid=a}}}updateTexture(){let e=F.beginCommandEncoder();for(let t=0;t<this._bitmapTextures.length;t++){let a=this._bitmapTextures[t];e.copyTextureToTexture({texture:a.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{texture:this.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:t}},{width:this.width,height:this.height,depthOrArrayLayers:1})}F.endCommandEncoder(e)}internalCreateBindingLayoutDesc(){this.textureBindingLayout.viewDimension="2d-array",this.samplerBindingLayout.type="filtering",this.minFilter=cr.linear,this.magFilter=cr.linear}internalCreateTexture(){this.textureDescriptor={format:this.format,size:{width:this.width,height:this.height,depthOrArrayLayers:this.numberLayer},dimension:"2d",usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.TEXTURE_BINDING},this.gpuTexture=this.getGPUTexture()}internalCreateView(){this.viewDescriptor={dimension:"2d-array"},this.view=this.getGPUView()}internalCreateSampler(){this.gpuSampler=w.device.createSampler(this)}}class Aa{static use=!1;static iesTexture;static ies_list=[];_iesTexture;index=0;constructor(){}generateIES(e){}set IESTexture(e){this._iesTexture=e,e.addressModeU=Ht.repeat,e.addressModeV=Ht.repeat,e.addressModeW=Ht.repeat,Aa.ies_list.indexOf(this)==-1&&(this.index=Aa.ies_list.length,Aa.ies_list.push(this),Aa.iesTexture||Aa.create(e.width,e.height),Aa.iesTexture.addTexture(e))}get IESTexture(){return this._iesTexture}static create(e,t){let a=48;this.iesTexture=new Ac(e,t,a)}}class hs{static _globalDataBindGroupLayout;static getGlobalDataBindGroupLayout(){if(this._globalDataBindGroupLayout)return this._globalDataBindGroupLayout;let e=[];return e.push({binding:0,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,buffer:{type:"uniform"}}),e.push({binding:1,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}),this._globalDataBindGroupLayout=w.device.createBindGroupLayout({entries:e}),this._globalDataBindGroupLayout}}class Di{Type=0;Line=0;Colume=0;Literal="";constructor(e=0,t="\0"){this.Type=e,this.Literal=t}isTypeEqual(e){return this.Type==e}isLiteralEqual(e){return this.Literal==e}isBuiltinType(){return this.Type>33&&this.Type<101}isDataType(){return this.Type==1||this.isBuiltinType()}isOperation(){return this.Type>102&&this.Type<127}isAssignOperation(){return this.Type>128&&this.Type<133}get nOperationPriorityLevel(){switch(this.Type){case 26:return 1;case 27:return 1;case 125:return 2;case 110:return 3;case 114:return 3;case 105:return 4;case 106:return 4;case 103:return 5;case 104:return 5;case 115:return 6;case 116:return 6;case 119:return 7;case 120:return 7;case 122:return 7;case 123:return 7;case 121:return 8;case 124:return 8;case 111:return 9;case 113:return 10;case 112:return 11;case 107:return 12;case 109:return 13;case 108:return 14;case 24:return 15;case 126:return 16;case 129:return 16;case 130:return 16;case 131:return 16;case 132:return 16}return 99}}var U=(s=>(s[s.EOF=0]="EOF",s[s.IDENT=1]="IDENT",s[s.VOID=2]="VOID",s[s.CONST=3]="CONST",s[s.LAYOUT=4]="LAYOUT",s[s.PRECISION=5]="PRECISION",s[s.ATTRIBUTE=6]="ATTRIBUTE",s[s.UNIFORM=7]="UNIFORM",s[s.VARYING=8]="VARYING",s[s.INVARIANT=9]="INVARIANT",s[s.IN=10]="IN",s[s.OUT=11]="OUT",s[s.INOUT=12]="INOUT",s[s.IF=13]="IF",s[s.ELSE=14]="ELSE",s[s.FOR=15]="FOR",s[s.WHILE=16]="WHILE",s[s.DO=17]="DO",s[s.BREAK=18]="BREAK",s[s.RETURN=19]="RETURN",s[s.CONTINUE=20]="CONTINUE",s[s.STRUCT=21]="STRUCT",s[s.COMMA=22]="COMMA",s[s.COLON=23]="COLON",s[s.QUEMARK=24]="QUEMARK",s[s.SEMICOLON=25]="SEMICOLON",s[s.LEFTSAMLL=26]="LEFTSAMLL",s[s.RIGHTSAMLL=27]="RIGHTSAMLL",s[s.LEFTMEDI=28]="LEFTMEDI",s[s.RIGHTMEDI=29]="RIGHTMEDI",s[s.LEFTBIG=30]="LEFTBIG",s[s.RIGHTBIG=31]="RIGHTBIG",s[s.LITERAL=32]="LITERAL",s[s.BeginBuiltinType=33]="BeginBuiltinType",s[s.INT=34]="INT",s[s.INT_ARRAY=35]="INT_ARRAY",s[s.UINT=36]="UINT",s[s.UINT_ARRAY=37]="UINT_ARRAY",s[s.BOOL=38]="BOOL",s[s.BOOL_ARRAY=39]="BOOL_ARRAY",s[s.FLOAT=40]="FLOAT",s[s.FLOAT_ARRAY=41]="FLOAT_ARRAY",s[s.DOUBLE=42]="DOUBLE",s[s.DOUBLE_ARRAY=43]="DOUBLE_ARRAY",s[s.VEC2=44]="VEC2",s[s.VEC2_ARRAY=45]="VEC2_ARRAY",s[s.VEC3=46]="VEC3",s[s.VEC3_ARRAY=47]="VEC3_ARRAY",s[s.VEC4=48]="VEC4",s[s.VEC4_ARRAY=49]="VEC4_ARRAY",s[s.BVEC2=50]="BVEC2",s[s.BVEC2_ARRAY=51]="BVEC2_ARRAY",s[s.BVEC3=52]="BVEC3",s[s.BVEC3_ARRAY=53]="BVEC3_ARRAY",s[s.BVEC4=54]="BVEC4",s[s.BVEC4_ARRAY=55]="BVEC4_ARRAY",s[s.IVEC2=56]="IVEC2",s[s.IVEC2_ARRAY=57]="IVEC2_ARRAY",s[s.IVEC3=58]="IVEC3",s[s.IVEC3_ARRAY=59]="IVEC3_ARRAY",s[s.IVEC4=60]="IVEC4",s[s.IVEC4_ARRAY=61]="IVEC4_ARRAY",s[s.UVEC2=62]="UVEC2",s[s.UVEC2_ARRAY=63]="UVEC2_ARRAY",s[s.UVEC3=64]="UVEC3",s[s.UVEC3_ARRAY=65]="UVEC3_ARRAY",s[s.UVEC4=66]="UVEC4",s[s.UVEC4_ARRAY=67]="UVEC4_ARRAY",s[s.MAT2x2=68]="MAT2x2",s[s.MAT2x2_ARRAY=69]="MAT2x2_ARRAY",s[s.MAT2x3=70]="MAT2x3",s[s.MAT2x3_ARRAY=71]="MAT2x3_ARRAY",s[s.MAT2x4=72]="MAT2x4",s[s.MAT2x4_ARRAY=73]="MAT2x4_ARRAY",s[s.MAT3x2=74]="MAT3x2",s[s.MAT3x2_ARRAY=75]="MAT3x2_ARRAY",s[s.MAT3x3=76]="MAT3x3",s[s.MAT3x3_ARRAY=77]="MAT3x3_ARRAY",s[s.MAT3x4=78]="MAT3x4",s[s.MAT3x4_ARRAY=79]="MAT3x4_ARRAY",s[s.MAT4x2=80]="MAT4x2",s[s.MAT4x2_ARRAY=81]="MAT4x2_ARRAY",s[s.MAT4x3=82]="MAT4x3",s[s.MAT4x3_ARRAY=83]="MAT4x3_ARRAY",s[s.MAT4x4=84]="MAT4x4",s[s.MAT4x4_ARRAY=85]="MAT4x4_ARRAY",s[s.SAMPLER=86]="SAMPLER",s[s.SAMPLER_1D=87]="SAMPLER_1D",s[s.SAMPLER_2D=88]="SAMPLER_2D",s[s.SAMPLER_3D=89]="SAMPLER_3D",s[s.SAMPLER_CUBE=90]="SAMPLER_CUBE",s[s.SAMPLER_SHADOW=91]="SAMPLER_SHADOW",s[s.SAMPLER_1D_SHADOW=92]="SAMPLER_1D_SHADOW",s[s.SAMPLER_2D_SHADOW=93]="SAMPLER_2D_SHADOW",s[s.TEXTURE_1D=94]="TEXTURE_1D",s[s.TEXTURE_1D_ARRAY=95]="TEXTURE_1D_ARRAY",s[s.TEXTURE_2D=96]="TEXTURE_2D",s[s.TEXTURE_2D_ARRAY=97]="TEXTURE_2D_ARRAY",s[s.TEXTURE_3D=98]="TEXTURE_3D",s[s.TEXTURE_CUBE=99]="TEXTURE_CUBE",s[s.TEXTURE_CUBE_ARRAY=100]="TEXTURE_CUBE_ARRAY",s[s.EndBuiltinType=101]="EndBuiltinType",s[s.BeginOperation=102]="BeginOperation",s[s.ADD=103]="ADD",s[s.SUB=104]="SUB",s[s.MUL=105]="MUL",s[s.DIV=106]="DIV",s[s.AND=107]="AND",s[s.OR=108]="OR",s[s.XOR=109]="XOR",s[s.NOT=110]="NOT",s[s.BITAND=111]="BITAND",s[s.BITOR=112]="BITOR",s[s.BITXOR=113]="BITXOR",s[s.BITNOT=114]="BITNOT",s[s.BITSHIFT_L=115]="BITSHIFT_L",s[s.BITSHIFT_R=116]="BITSHIFT_R",s[s.INC=117]="INC",s[s.DEC=118]="DEC",s[s.GREATER=119]="GREATER",s[s.GREATEREQUAL=120]="GREATEREQUAL",s[s.EQUAL=121]="EQUAL",s[s.LESS=122]="LESS",s[s.LESSEQUAL=123]="LESSEQUAL",s[s.NOTEQUAL=124]="NOTEQUAL",s[s.DOT=125]="DOT",s[s.ASSIGN=126]="ASSIGN",s[s.EndOperation=127]="EndOperation",s[s.BeginAssignOperation=128]="BeginAssignOperation",s[s.ADDASSIGN=129]="ADDASSIGN",s[s.SUBASSIGN=130]="SUBASSIGN",s[s.MULASSIGN=131]="MULASSIGN",s[s.DIVASSIGN=132]="DIVASSIGN",s[s.EndAssignOperation=133]="EndAssignOperation",s))(U||{});class Kr{_char;_line;_column;_source;_currPosition;_nextPosition;constructor(e){this.reset(e)}reset(e){this._char="",this._line=0,this._column=0,this._source=e,this._currPosition=0,this._nextPosition=0}get source(){return this._source}getChar(){return this._char}get currPosition(){return this._currPosition}peekChar(){return this._nextPosition>=this._source.length?"\0":this._source[this._nextPosition]}readChar(){this._char=this._nextPosition>=this._source.length?"\0":this._source[this._nextPosition],this._char!==`
|
|
5695
|
+
`;static pipelineCache={};static pipeline;static getMipmapPipeline(e){let t=w.device,a=pa.pipelineCache[e.format];if(!a){const r=t.createShaderModule({code:pa.mipmapShader});let i=t.createBindGroupLayout({entries:[{binding:0,visibility:e.visibility,sampler:e.samplerBindingLayout},{binding:1,visibility:e.visibility,texture:e.textureBindingLayout}]}),n=w.device.createPipelineLayout({bindGroupLayouts:[i]});a=t.createRenderPipeline({layout:n,vertex:{module:r,entryPoint:"vertexMain"},fragment:{module:r,entryPoint:"fragmentMain",targets:[{format:e.format}]},primitive:{topology:"triangle-strip",stripIndexFormat:"uint32"}}),pa.pipelineCache[e.format]=a}return a}static webGPUGenerateMipmap(e){let t=w.device,a=e.textureDescriptor,r=pa.getMipmapPipeline(e),i=e.getGPUTexture().createView({baseMipLevel:0,mipLevelCount:1});const n=F.beginCommandEncoder();for(let o=1;o<a.mipLevelCount;++o){const l=e.getGPUTexture().createView({baseMipLevel:o,mipLevelCount:1}),c=n.beginRenderPass({colorAttachments:[{view:l,clearValue:[0,0,0,0],loadOp:"clear",storeOp:"store"}]});let f=t.createBindGroupLayout({entries:[{binding:0,visibility:e.visibility,sampler:e.samplerBindingLayout},{binding:1,visibility:e.visibility,texture:e.textureBindingLayout}]});const h=t.createBindGroup({layout:f,entries:[{binding:0,resource:e.gpuSampler},{binding:1,resource:i}]});c.setPipeline(r),c.setBindGroup(0,h),c.draw(4),c.end(),i=l}F.endCommandEncoder(n)}static getMipmapCount(e,t){let i=Math.max(e,t);return 1+Math.log2(i)|0}}class ft{name;url;gpuTexture;_isDestroyed=!1;get isDestroyed(){return this._isDestroyed}pid;view;gpuSampler;gpuSampler_comparison;format;usage;width=4;height=4;depthOrArrayLayers=1;numberLayer=1;viewDescriptor;textureDescriptor;visibility=GPUShaderStage.COMPUTE|GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT;textureBindingLayout={viewDimension:"2d",multisampled:!1};samplerBindingLayout={type:"filtering"};sampler_comparisonBindingLayout={type:"comparison"};flipY;isVideoTexture;isHDRTexture;_useMipmap=!1;_sourceImageData;_addressModeU;_addressModeV;_addressModeW;_magFilter;_minFilter;_mipmapFilter;_lodMinClamp;_lodMaxClamp;_compare;_maxAnisotropy;mipmapCount=1;_textureChange=!1;constructor(e=32,t=32,a=1){this.width=e,this.height=t,this.numberLayer=a,this.minFilter=lr.linear,this.magFilter=lr.linear,this.mipmapFilter=lr.linear,this.addressModeU=Ht.repeat,this.addressModeV=Ht.repeat}init(){let e=this;return e.internalCreateBindingLayoutDesc&&e.internalCreateBindingLayoutDesc(),e.internalCreateTexture&&e.internalCreateTexture(),e.internalCreateView&&e.internalCreateView(),e.internalCreateSampler&&e.internalCreateSampler(),this}createTextureDescriptor(e,t,a,r,i=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.STORAGE_BINDING,n=1,o=0){this.width=e,this.height=t,this.format=r,this.usage=i,this.textureDescriptor={size:[e,t,n],mipLevelCount:a,format:r,usage:i,label:`${this.name+this.width+this.height+this.format}`},o>0&&(this.textureDescriptor.sampleCount=o),n>1?this.viewDescriptor={format:r,dimension:"2d-array"}:this.viewDescriptor={format:r,dimension:this.textureBindingLayout.viewDimension,mipLevelCount:a,baseMipLevel:0}}generate(e){let t=32,a=32;"width"in e&&(t=e.width,a=e.height),(t<32||a<32)&&console.log(e.name+"Size must be greater than 32!"),this.width=t,this.height=a,this.createTexture(e)}createTexture(e){this._sourceImageData=e,this.updateTextureDescription(),this.updateGPUTexture();let t=w.device;this.gpuTexture instanceof GPUTexture&&t.queue.copyExternalImageToTexture({source:this._sourceImageData},{texture:this.gpuTexture},[this.width,this.height]),this.useMipmap&&pa.webGPUGenerateMipmap(this)}get useMipmap(){return this._useMipmap}set useMipmap(e){if(e){if(this.samplerBindingLayout.type="filtering",this._useMipmap==!1&&this._sourceImageData){this._useMipmap=!0,this.updateTextureDescription(),this.updateGPUTexture();let t=w.device;this.gpuTexture instanceof GPUTexture&&t.queue.copyExternalImageToTexture({source:this._sourceImageData},{texture:this.gpuTexture},[this.width,this.height]),pa.webGPUGenerateMipmap(this)}}else if(this.samplerBindingLayout.type="non-filtering",this._useMipmap==!0&&this._sourceImageData){this._useMipmap=!1,this.updateTextureDescription(),this.updateGPUTexture();let t=w.device;this.gpuTexture instanceof GPUTexture&&t.queue.copyExternalImageToTexture({source:this._sourceImageData},{texture:this.gpuTexture},[this.width,this.height])}this._textureChange=!0,this._useMipmap=e,this.noticeChange()}get sourceImageData(){return this._sourceImageData}getMipmapCount(){let e=this.width,t=this.height,a=Math.max(e,t);return 1+Math.log2(a)|0}updateTextureDescription(){this.mipmapCount=Math.floor(this.useMipmap?this.getMipmapCount():1),this.createTextureDescriptor(this.width,this.height,this.mipmapCount,this.format)}updateGPUTexture(){this.gpuTexture&&this.gpuTexture instanceof GPUTexture&&this.gpuTexture.destroy(),this.gpuTexture=null,this.view=null,this.gpuTexture=this.getGPUTexture()}getGPUTexture(){return this.gpuTexture||(this.gpuTexture=w.device.createTexture(this.textureDescriptor)),this.gpuTexture}getGPUView(e=0){return this.view||(this.gpuTexture=this.getGPUTexture(),this.gpuTexture instanceof GPUTexture&&(this.view=this.gpuTexture.createView(this.viewDescriptor),this.view.label=this.name)),this.view}_stateChangeRef=new Map;bindStateChange(e,t){this._stateChangeRef.set(t,e)}unBindStateChange(e){this._stateChangeRef.delete(e)}noticeChange(){this.gpuSampler=w.device.createSampler(this),this._stateChangeRef.forEach((e,t)=>{e()})}destroy(e){if(e&&this.gpuTexture instanceof GPUTexture&&(this.gpuSampler=null,this.gpuSampler_comparison=null,this.textureBindingLayout=null,this.textureDescriptor=null,this.gpuTexture.destroy(),this.gpuTexture=null,this._isDestroyed=!0),this._sourceImageData&&this._sourceImageData instanceof ImageBitmap){try{this._sourceImageData.close()}catch{}this._sourceImageData=null}this._stateChangeRef.clear()}get addressModeU(){return this._addressModeU}set addressModeU(e){this._addressModeU!=e&&(this._addressModeU=e,this.noticeChange())}get addressModeV(){return this._addressModeV}set addressModeV(e){this._addressModeV!=e&&(this._addressModeV=e,this.noticeChange())}get addressModeW(){return this._addressModeW}set addressModeW(e){this._addressModeW!=e&&(this._addressModeW=e,this.noticeChange())}get magFilter(){return this._magFilter}set magFilter(e){this._magFilter!=e&&(this._magFilter=e,this.noticeChange())}get minFilter(){return this._minFilter}set minFilter(e){this._minFilter!=e&&(this._minFilter=e,this.noticeChange())}get mipmapFilter(){return this._mipmapFilter}set mipmapFilter(e){this._mipmapFilter!=e&&(this._mipmapFilter=e,this.noticeChange())}get lodMinClamp(){return this._lodMinClamp}set lodMinClamp(e){this._lodMinClamp!=e&&(this._lodMinClamp=e,this.noticeChange())}get lodMaxClamp(){return this._lodMaxClamp}set lodMaxClamp(e){this._lodMaxClamp!=e&&(this._lodMaxClamp=e,this.noticeChange())}get compare(){return this._compare}set compare(e){this._compare!=e&&(this._compare=e,this.noticeChange())}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy!=e&&(this._maxAnisotropy=e,this.noticeChange())}static _texs=[];static delayDestroyTexture(e){this._texs.includes(e)||this._texs.push(e)}static destroyTexture(){if(this._texs.length>0)for(;this._texs.length>0;)this._texs.shift().destroy()}}class Ac extends ft{_bitmapTextures;constructor(e,t,a){super(e,t,a),this.format=se.rgba8unorm,this.mipmapCount=1,this._bitmapTextures=[],this.init()}setTextures(e){this._bitmapTextures.length=0;for(let t=0;t<e.length;t++){const a=e[t];this.addTexture(a)}}addTexture(e){(e.width!=this.width||e.height!=this.height)&&console.error("bitmap texture must match bitmapTextureArray size!"),e.pid=this._bitmapTextures.length,this._bitmapTextures.push(e),this.updateTexture()}removeTexture(e){let t=this._bitmapTextures.indexOf(e);if(t!=-1){this._bitmapTextures.splice(t,1);for(let a=0;a<this._bitmapTextures.length;a++){const r=this._bitmapTextures[a];r.pid=a}}}updateTexture(){let e=F.beginCommandEncoder();for(let t=0;t<this._bitmapTextures.length;t++){let a=this._bitmapTextures[t];e.copyTextureToTexture({texture:a.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{texture:this.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:t}},{width:this.width,height:this.height,depthOrArrayLayers:1})}F.endCommandEncoder(e)}internalCreateBindingLayoutDesc(){this.textureBindingLayout.viewDimension="2d-array",this.samplerBindingLayout.type="filtering",this.minFilter=lr.linear,this.magFilter=lr.linear}internalCreateTexture(){this.textureDescriptor={format:this.format,size:{width:this.width,height:this.height,depthOrArrayLayers:this.numberLayer},dimension:"2d",usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.TEXTURE_BINDING},this.gpuTexture=this.getGPUTexture()}internalCreateView(){this.viewDescriptor={dimension:"2d-array"},this.view=this.getGPUView()}internalCreateSampler(){this.gpuSampler=w.device.createSampler(this)}}class Aa{static use=!1;static iesTexture;static ies_list=[];_iesTexture;index=0;constructor(){}generateIES(e){}set IESTexture(e){this._iesTexture=e,e.addressModeU=Ht.repeat,e.addressModeV=Ht.repeat,e.addressModeW=Ht.repeat,Aa.ies_list.indexOf(this)==-1&&(this.index=Aa.ies_list.length,Aa.ies_list.push(this),Aa.iesTexture||Aa.create(e.width,e.height),Aa.iesTexture.addTexture(e))}get IESTexture(){return this._iesTexture}static create(e,t){let a=48;this.iesTexture=new Ac(e,t,a)}}class hs{static _globalDataBindGroupLayout;static getGlobalDataBindGroupLayout(){if(this._globalDataBindGroupLayout)return this._globalDataBindGroupLayout;let e=[];return e.push({binding:0,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,buffer:{type:"uniform"}}),e.push({binding:1,visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,buffer:{type:"read-only-storage"}}),this._globalDataBindGroupLayout=w.device.createBindGroupLayout({entries:e}),this._globalDataBindGroupLayout}}class Di{Type=0;Line=0;Colume=0;Literal="";constructor(e=0,t="\0"){this.Type=e,this.Literal=t}isTypeEqual(e){return this.Type==e}isLiteralEqual(e){return this.Literal==e}isBuiltinType(){return this.Type>33&&this.Type<101}isDataType(){return this.Type==1||this.isBuiltinType()}isOperation(){return this.Type>102&&this.Type<127}isAssignOperation(){return this.Type>128&&this.Type<133}get nOperationPriorityLevel(){switch(this.Type){case 26:return 1;case 27:return 1;case 125:return 2;case 110:return 3;case 114:return 3;case 105:return 4;case 106:return 4;case 103:return 5;case 104:return 5;case 115:return 6;case 116:return 6;case 119:return 7;case 120:return 7;case 122:return 7;case 123:return 7;case 121:return 8;case 124:return 8;case 111:return 9;case 113:return 10;case 112:return 11;case 107:return 12;case 109:return 13;case 108:return 14;case 24:return 15;case 126:return 16;case 129:return 16;case 130:return 16;case 131:return 16;case 132:return 16}return 99}}var U=(s=>(s[s.EOF=0]="EOF",s[s.IDENT=1]="IDENT",s[s.VOID=2]="VOID",s[s.CONST=3]="CONST",s[s.LAYOUT=4]="LAYOUT",s[s.PRECISION=5]="PRECISION",s[s.ATTRIBUTE=6]="ATTRIBUTE",s[s.UNIFORM=7]="UNIFORM",s[s.VARYING=8]="VARYING",s[s.INVARIANT=9]="INVARIANT",s[s.IN=10]="IN",s[s.OUT=11]="OUT",s[s.INOUT=12]="INOUT",s[s.IF=13]="IF",s[s.ELSE=14]="ELSE",s[s.FOR=15]="FOR",s[s.WHILE=16]="WHILE",s[s.DO=17]="DO",s[s.BREAK=18]="BREAK",s[s.RETURN=19]="RETURN",s[s.CONTINUE=20]="CONTINUE",s[s.STRUCT=21]="STRUCT",s[s.COMMA=22]="COMMA",s[s.COLON=23]="COLON",s[s.QUEMARK=24]="QUEMARK",s[s.SEMICOLON=25]="SEMICOLON",s[s.LEFTSAMLL=26]="LEFTSAMLL",s[s.RIGHTSAMLL=27]="RIGHTSAMLL",s[s.LEFTMEDI=28]="LEFTMEDI",s[s.RIGHTMEDI=29]="RIGHTMEDI",s[s.LEFTBIG=30]="LEFTBIG",s[s.RIGHTBIG=31]="RIGHTBIG",s[s.LITERAL=32]="LITERAL",s[s.BeginBuiltinType=33]="BeginBuiltinType",s[s.INT=34]="INT",s[s.INT_ARRAY=35]="INT_ARRAY",s[s.UINT=36]="UINT",s[s.UINT_ARRAY=37]="UINT_ARRAY",s[s.BOOL=38]="BOOL",s[s.BOOL_ARRAY=39]="BOOL_ARRAY",s[s.FLOAT=40]="FLOAT",s[s.FLOAT_ARRAY=41]="FLOAT_ARRAY",s[s.DOUBLE=42]="DOUBLE",s[s.DOUBLE_ARRAY=43]="DOUBLE_ARRAY",s[s.VEC2=44]="VEC2",s[s.VEC2_ARRAY=45]="VEC2_ARRAY",s[s.VEC3=46]="VEC3",s[s.VEC3_ARRAY=47]="VEC3_ARRAY",s[s.VEC4=48]="VEC4",s[s.VEC4_ARRAY=49]="VEC4_ARRAY",s[s.BVEC2=50]="BVEC2",s[s.BVEC2_ARRAY=51]="BVEC2_ARRAY",s[s.BVEC3=52]="BVEC3",s[s.BVEC3_ARRAY=53]="BVEC3_ARRAY",s[s.BVEC4=54]="BVEC4",s[s.BVEC4_ARRAY=55]="BVEC4_ARRAY",s[s.IVEC2=56]="IVEC2",s[s.IVEC2_ARRAY=57]="IVEC2_ARRAY",s[s.IVEC3=58]="IVEC3",s[s.IVEC3_ARRAY=59]="IVEC3_ARRAY",s[s.IVEC4=60]="IVEC4",s[s.IVEC4_ARRAY=61]="IVEC4_ARRAY",s[s.UVEC2=62]="UVEC2",s[s.UVEC2_ARRAY=63]="UVEC2_ARRAY",s[s.UVEC3=64]="UVEC3",s[s.UVEC3_ARRAY=65]="UVEC3_ARRAY",s[s.UVEC4=66]="UVEC4",s[s.UVEC4_ARRAY=67]="UVEC4_ARRAY",s[s.MAT2x2=68]="MAT2x2",s[s.MAT2x2_ARRAY=69]="MAT2x2_ARRAY",s[s.MAT2x3=70]="MAT2x3",s[s.MAT2x3_ARRAY=71]="MAT2x3_ARRAY",s[s.MAT2x4=72]="MAT2x4",s[s.MAT2x4_ARRAY=73]="MAT2x4_ARRAY",s[s.MAT3x2=74]="MAT3x2",s[s.MAT3x2_ARRAY=75]="MAT3x2_ARRAY",s[s.MAT3x3=76]="MAT3x3",s[s.MAT3x3_ARRAY=77]="MAT3x3_ARRAY",s[s.MAT3x4=78]="MAT3x4",s[s.MAT3x4_ARRAY=79]="MAT3x4_ARRAY",s[s.MAT4x2=80]="MAT4x2",s[s.MAT4x2_ARRAY=81]="MAT4x2_ARRAY",s[s.MAT4x3=82]="MAT4x3",s[s.MAT4x3_ARRAY=83]="MAT4x3_ARRAY",s[s.MAT4x4=84]="MAT4x4",s[s.MAT4x4_ARRAY=85]="MAT4x4_ARRAY",s[s.SAMPLER=86]="SAMPLER",s[s.SAMPLER_1D=87]="SAMPLER_1D",s[s.SAMPLER_2D=88]="SAMPLER_2D",s[s.SAMPLER_3D=89]="SAMPLER_3D",s[s.SAMPLER_CUBE=90]="SAMPLER_CUBE",s[s.SAMPLER_SHADOW=91]="SAMPLER_SHADOW",s[s.SAMPLER_1D_SHADOW=92]="SAMPLER_1D_SHADOW",s[s.SAMPLER_2D_SHADOW=93]="SAMPLER_2D_SHADOW",s[s.TEXTURE_1D=94]="TEXTURE_1D",s[s.TEXTURE_1D_ARRAY=95]="TEXTURE_1D_ARRAY",s[s.TEXTURE_2D=96]="TEXTURE_2D",s[s.TEXTURE_2D_ARRAY=97]="TEXTURE_2D_ARRAY",s[s.TEXTURE_3D=98]="TEXTURE_3D",s[s.TEXTURE_CUBE=99]="TEXTURE_CUBE",s[s.TEXTURE_CUBE_ARRAY=100]="TEXTURE_CUBE_ARRAY",s[s.EndBuiltinType=101]="EndBuiltinType",s[s.BeginOperation=102]="BeginOperation",s[s.ADD=103]="ADD",s[s.SUB=104]="SUB",s[s.MUL=105]="MUL",s[s.DIV=106]="DIV",s[s.AND=107]="AND",s[s.OR=108]="OR",s[s.XOR=109]="XOR",s[s.NOT=110]="NOT",s[s.BITAND=111]="BITAND",s[s.BITOR=112]="BITOR",s[s.BITXOR=113]="BITXOR",s[s.BITNOT=114]="BITNOT",s[s.BITSHIFT_L=115]="BITSHIFT_L",s[s.BITSHIFT_R=116]="BITSHIFT_R",s[s.INC=117]="INC",s[s.DEC=118]="DEC",s[s.GREATER=119]="GREATER",s[s.GREATEREQUAL=120]="GREATEREQUAL",s[s.EQUAL=121]="EQUAL",s[s.LESS=122]="LESS",s[s.LESSEQUAL=123]="LESSEQUAL",s[s.NOTEQUAL=124]="NOTEQUAL",s[s.DOT=125]="DOT",s[s.ASSIGN=126]="ASSIGN",s[s.EndOperation=127]="EndOperation",s[s.BeginAssignOperation=128]="BeginAssignOperation",s[s.ADDASSIGN=129]="ADDASSIGN",s[s.SUBASSIGN=130]="SUBASSIGN",s[s.MULASSIGN=131]="MULASSIGN",s[s.DIVASSIGN=132]="DIVASSIGN",s[s.EndAssignOperation=133]="EndAssignOperation",s))(U||{});class Kr{_char;_line;_column;_source;_currPosition;_nextPosition;constructor(e){this.reset(e)}reset(e){this._char="",this._line=0,this._column=0,this._source=e,this._currPosition=0,this._nextPosition=0}get source(){return this._source}getChar(){return this._char}get currPosition(){return this._currPosition}peekChar(){return this._nextPosition>=this._source.length?"\0":this._source[this._nextPosition]}readChar(){this._char=this._nextPosition>=this._source.length?"\0":this._source[this._nextPosition],this._char!==`
|
|
5696
5696
|
`?this._column++:(this._line++,this._column=0),this._currPosition=this._nextPosition,this._nextPosition++}readCharAndSkipWhitespace(){this.readChar(),this.skipWhitespace()}readIdentifier(){for(var e=this._currPosition;this.isIdentifier(this._char);)this.readChar();return this._source.substring(e,this._currPosition)}isIdentifier(e){var t=e.charCodeAt(0);return 97<=t&&t<=122||65<=t&&t<=90||48<=t&&t<=57||t==95}skipWhitespace(){for(;this.IsWhitespace(this._char);)this.readChar()}IsWhitespace(e){return e===" "||e===" "||e==="\r"||e===`
|
|
5697
5697
|
`}skipComment(){for(;this._char!==`
|
|
5698
5698
|
`&&this._char!=="\0";)this.readChar();this.skipWhitespace()}skipMultilineComment(){if(!(this._char!=="/"&&this.peekChar()!=="*")){this.readChar(),this.readChar();for(let e=1;e>0&&this._char!=="\0";)if(this.readChar(),this._char==="/"&&this.peekChar()==="*"){e++,this.readChar();continue}else if(this._char==="*"&&this.peekChar()==="/"){e--,this.readChar();continue}this.readChar(),this.readChar(),this.skipWhitespace()}}isDigit(e){var t=e.charCodeAt(0);return 48<=t&&t<=57}readNumber(){for(var e=this._currPosition;this.isDigit(this._char);)this.readChar();if(this._char===".")for(this.readChar();this.isDigit(this._char);)this.readChar();return this._source.substring(e,this._currPosition)}readValue(){return this.isDigit(this._char)?this.readNumber():this.readIdentifier()}readLine(){var e=this._currPosition,t=this._source.indexOf(`
|
|
@@ -5723,7 +5723,7 @@ struct InstanceData {
|
|
|
5723
5723
|
`),a+=o+` {\r
|
|
5724
5724
|
`,a+=l,a+=r+`}\r
|
|
5725
5725
|
`,a+=`\r
|
|
5726
|
-
`,a}}class un extends Oe{args=[];constructor(){super()}static parse(e){if(e.peekToken(0).Type==U.LEFTSAMLL){e.skipToken(1);let t=new un;for(;e.peekToken(0).Type!=U.EOF;){if(e.peekToken(0).Type==U.RIGHTSAMLL){e.skipToken(1);break}let a=Fe.parse(e);t.args.push(a),e.peekToken(0).Type==U.COMMA&&e.skipToken(1)}return t}throw"Error parsing function argument table: Unexpected character"}}class xr extends Oe{name;args;constructor(e,t){super(),this.name=e,this.args=t}static parse(e){if(e.peekToken(0).isDataType()&&e.peekToken(1).Type==U.LEFTSAMLL){let t=e.peekToken(0).Literal;e.skipToken(1);let a=un.parse(e);return new xr(t,a)}throw"Error parsing function argument table: Unexpected character"}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);if(this.name=="texture"&&this.args.args[0].nodes[0]instanceof xr){let i=this.args.args[0].nodes[0];if(i.name=="sampler2D"){a+=r+"textureSample(";for(let n=0;n<i.args.args.length;n++){let o=i.args.args[n];n>0&&(a+=", "),a+=o.formatToWGSL(e,0)}for(let n=1;n<this.args.args.length;n++){let o=this.args.args[n];n>0&&(a+=", "),a+=o.formatToWGSL(e,0)}return a+=")",a}}a+=r+oa(this.name)+"(";for(let i=0;i<this.args.args.length;i++){let n=this.args.args[i];i>0&&(a+=", "),a+=n.formatToWGSL(e,0)}return a+=")",a}}class $e extends Oe{type;name;arraySize;hasIn;hasOut;hasConst;constructor(e,t,a=new Fe){super(),this.type=e,this.name=t,this.hasIn=!1,this.hasOut=!1,this.hasConst=!1,this.arraySize=a}static parse(e){let t=new $e("",""),a=e.peekToken(0);if(a.Type==U.CONST)e.skipToken(1),t.hasConst=!0;else if(a.Type==U.IN)e.skipToken(1),t.hasIn=!0;else if(a.Type==U.OUT)e.skipToken(1),t.hasOut=!0;else if(a.Type==U.INOUT)e.skipToken(1),t.hasIn=!0,t.hasOut=!0;else if(!a.isDataType())throw"Error parsing declaration expression: Unexpected character("+a.Literal+")";if(a=e.peekToken(0),a.isDataType()&&e.peekToken(1).Type==U.LEFTMEDI){if(t.type=a.Literal,e.skipToken(2),t.arraySize=Fe.parse(e),e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1),e.peekToken(0).Type!=U.IDENT)throw"Unexpected";t.name=e.peekToken(0).Literal,e.skipToken(1)}else if(a.isDataType()&&e.peekToken(1).Type==U.IDENT&&e.peekToken(2).Type==U.LEFTMEDI)t.type=e.peekToken(0).Literal,t.name=e.peekToken(1).Literal,e.skipToken(3),e.peekToken(0).Type==U.RIGHTMEDI?e.skipToken(1):(t.arraySize=Fe.parse(e),e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1));else if(a.isDataType()&&e.peekToken(1).Type==U.IDENT)t.type=e.peekToken(0).Literal,t.name=e.peekToken(1).Literal,e.skipToken(2);else throw"Error parsing declaration expression: Unexpected character("+a.Literal+")";if(a=e.peekToken(0),a.Type==U.SEMICOLON)return e.skipToken(1),t;if(a.Type==U.RIGHTSAMLL)return t;if(a.Type==U.ASSIGN){let r=e.peekToken(0);e.skipToken(1);let i=new Ya(t.name),n=Fe.parse(e);return e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1),t.addNode(new
|
|
5726
|
+
`,a}}class un extends Oe{args=[];constructor(){super()}static parse(e){if(e.peekToken(0).Type==U.LEFTSAMLL){e.skipToken(1);let t=new un;for(;e.peekToken(0).Type!=U.EOF;){if(e.peekToken(0).Type==U.RIGHTSAMLL){e.skipToken(1);break}let a=Fe.parse(e);t.args.push(a),e.peekToken(0).Type==U.COMMA&&e.skipToken(1)}return t}throw"Error parsing function argument table: Unexpected character"}}class xr extends Oe{name;args;constructor(e,t){super(),this.name=e,this.args=t}static parse(e){if(e.peekToken(0).isDataType()&&e.peekToken(1).Type==U.LEFTSAMLL){let t=e.peekToken(0).Literal;e.skipToken(1);let a=un.parse(e);return new xr(t,a)}throw"Error parsing function argument table: Unexpected character"}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);if(this.name=="texture"&&this.args.args[0].nodes[0]instanceof xr){let i=this.args.args[0].nodes[0];if(i.name=="sampler2D"){a+=r+"textureSample(";for(let n=0;n<i.args.args.length;n++){let o=i.args.args[n];n>0&&(a+=", "),a+=o.formatToWGSL(e,0)}for(let n=1;n<this.args.args.length;n++){let o=this.args.args[n];n>0&&(a+=", "),a+=o.formatToWGSL(e,0)}return a+=")",a}}a+=r+oa(this.name)+"(";for(let i=0;i<this.args.args.length;i++){let n=this.args.args[i];i>0&&(a+=", "),a+=n.formatToWGSL(e,0)}return a+=")",a}}class $e extends Oe{type;name;arraySize;hasIn;hasOut;hasConst;constructor(e,t,a=new Fe){super(),this.type=e,this.name=t,this.hasIn=!1,this.hasOut=!1,this.hasConst=!1,this.arraySize=a}static parse(e){let t=new $e("",""),a=e.peekToken(0);if(a.Type==U.CONST)e.skipToken(1),t.hasConst=!0;else if(a.Type==U.IN)e.skipToken(1),t.hasIn=!0;else if(a.Type==U.OUT)e.skipToken(1),t.hasOut=!0;else if(a.Type==U.INOUT)e.skipToken(1),t.hasIn=!0,t.hasOut=!0;else if(!a.isDataType())throw"Error parsing declaration expression: Unexpected character("+a.Literal+")";if(a=e.peekToken(0),a.isDataType()&&e.peekToken(1).Type==U.LEFTMEDI){if(t.type=a.Literal,e.skipToken(2),t.arraySize=Fe.parse(e),e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1),e.peekToken(0).Type!=U.IDENT)throw"Unexpected";t.name=e.peekToken(0).Literal,e.skipToken(1)}else if(a.isDataType()&&e.peekToken(1).Type==U.IDENT&&e.peekToken(2).Type==U.LEFTMEDI)t.type=e.peekToken(0).Literal,t.name=e.peekToken(1).Literal,e.skipToken(3),e.peekToken(0).Type==U.RIGHTMEDI?e.skipToken(1):(t.arraySize=Fe.parse(e),e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1));else if(a.isDataType()&&e.peekToken(1).Type==U.IDENT)t.type=e.peekToken(0).Literal,t.name=e.peekToken(1).Literal,e.skipToken(2);else throw"Error parsing declaration expression: Unexpected character("+a.Literal+")";if(a=e.peekToken(0),a.Type==U.SEMICOLON)return e.skipToken(1),t;if(a.Type==U.RIGHTSAMLL)return t;if(a.Type==U.ASSIGN){let r=e.peekToken(0);e.skipToken(1);let i=new Ya(t.name),n=Fe.parse(e);return e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1),t.addNode(new fr(r,i,n)),t}else if(a.Type==U.COMMA){for(;e.peekToken(0).Type==U.COMMA&&e.peekToken(1).Type==U.IDENT;){let r=new $e(t.type,e.peekToken(1).Literal);t.addNode(r),e.skipToken(2),e.peekToken(0).Type==U.ASSIGN&&(e.skipToken(-1),r.addNode(Fe.parse(e)))}return t}throw"Error parsing declaration expression: Unexpected character("+e.peekToken(0).Literal+")"}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);if(this.hasConst?a+=r+"let ":a+=r+"var ",e.addIdentifier(this.name,this.name),this.arraySize.nodes.length<=0?a+=this.name+": "+oa(this.type):this.arraySize.nodes[0]instanceof Xa?a+=this.name+": array<"+oa(this.type)+", "+this.arraySize.nodes[0].value+">":a+=this.name+": array<"+oa(this.type)+", "+this.arraySize.nodes[0].formatToWGSL(e,0)+">",this.nodes.length>0&&this.nodes[0]instanceof fr)a+=" = "+this.nodes[0].rightValue.formatToWGSL(e,0);else if(this.nodes.length>0&&this.nodes[0]instanceof Fe&&this.nodes[0].nodes[0]instanceof fr)a+=" = "+this.nodes[0].nodes[0].rightValue.formatToWGSL(e,0);else if(this.nodes.length>0&&this.nodes[0]instanceof $e){a+=`;\r
|
|
5727
5727
|
`;for(let i of this.nodes)a+=i.formatToWGSL(e,t)+`;\r
|
|
5728
5728
|
`}else a+=`;\r
|
|
5729
5729
|
`;return a}}class Fr extends Oe{expression1;condition;expression2;loopBody;constructor(e,t,a,r){super(),this.expression1=e,this.condition=t,this.expression2=a,this.loopBody=r}static parse(e){if(e.peekToken(0).Type==U.FOR&&e.peekToken(1).Type==U.LEFTSAMLL){e.skipToken(2);let t;e.peekToken(0).Type==U.SEMICOLON?(e.skipToken(1),t=new Fe):e.peekToken(0).isDataType()&&e.peekToken(1).Type==U.IDENT&&e.peekToken(2).Type==U.ASSIGN?(t=new $e(e.peekToken(0).Literal,e.peekToken(1).Literal),e.skipToken(1),t.addNode(Fe.parse(e)),e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1)):(t=Fe.parse(e),e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1));let a;e.peekToken(0).Type==U.SEMICOLON?(e.skipToken(1),a=new Fe):(a=Fe.parse(e),e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1));let r;e.peekToken(0).Type==U.SEMICOLON?(e.skipToken(1),r=new Fe):(r=Fe.parse(e),e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1)),e.peekToken(0).Type==U.RIGHTSAMLL&&e.skipToken(1);let i;return e.peekToken(0).Type==U.LEFTBIG?i=Da.parse(e):i=new Da,new Fr(t,a,r,i)}throw"Error parsing for loop: Unexpected character"}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);a+=r+"for (",a+=this.expression1.formatToWGSL(e,0)+"; ",a+=this.condition.formatToWGSL(e,0)+"; ",a+=this.expression2.formatToWGSL(e,0)+")",a+=` { \r
|
|
@@ -5739,10 +5739,10 @@ struct InstanceData {
|
|
|
5739
5739
|
`;if(this.falseBranch.nodes.length>0){a+=r+`} else {\r
|
|
5740
5740
|
`;for(let i of this.falseBranch.nodes)a+=i.formatToWGSL(e,t+1)+`;\r
|
|
5741
5741
|
`}return a+=r+`}\r
|
|
5742
|
-
`,a}}class Fe extends Oe{constructor(){super()}static parse(e){let t=new Array,a=new Array,r=0;for(;e.peekToken(0).Type!=U.EOF;){let i=e.peekToken(0);if(i.Type==U.SEMICOLON||i.Type==U.RIGHTMEDI||i.Type==U.COMMA||i.Type==U.COLON||i.Type==U.RIGHTBIG)break;if(i.isOperation()){if(i.isOperation()){if(i.Type==U.INC||i.Type==U.DEC){let n=i;e.skipToken(1);let o=Fe.parse(e);a.push(new qr(n,void 0,o));continue}else if(t.length>0){if(t[t.length-1].nOperationPriorityLevel<=i.nOperationPriorityLevel)Fe.unionOperation(t,a);else if(t.length>0&&t[t.length-1].Literal=="-"){let o=t.pop(),l=a.pop();a.push(new qr(o,void 0,l))}}t.push(i),e.skipToken(1)}}else if(i.Type==U.LITERAL){a.push(new Xa(i.Literal)),e.skipToken(1);continue}else if(i.Type==U.LEFTSAMLL){r++,t.push(i),e.skipToken(1);continue}else if(i.Type==U.RIGHTSAMLL){if(r<=0)break;for(r--;Fe.unionOperation(t,a););if(t[t.length-1].Type==U.LEFTSAMLL){t.pop();let n=new vc;n.addNode(a.pop()),a.push(n)}e.skipToken(1);continue}else if(i.Type==U.IDENT){if(e.peekToken(1).Type==U.INC||e.peekToken(1).Type==U.DEC){let n=e.peekToken(1),o=new Ya(i.Literal);a.push(new qr(n,o,void 0)),e.skipToken(2);continue}else if(e.peekToken(1).Type==U.LEFTSAMLL){a.push(xr.parse(e));continue}else if(e.peekToken(1).Type==U.DOT){a.push(vi.parse(e));continue}else if(e.peekToken(1).Type==U.LEFTMEDI){a.push(wr.parse(e));continue}a.push(new Ya(i.Literal)),e.skipToken(1);continue}else{if(i.isBuiltinType()&&e.peekToken(1).Type==U.LEFTSAMLL){a.push(xr.parse(e));continue}if(i.isAssignOperation()){let n=i;e.skipToken(1);let o=a.pop(),l=Fe.parse(e);a.push(new dr(n,o,l));continue}if(i.Type==U.LEFTBIG&&(e.peekToken(1).Type==U.LITERAL||e.peekToken(1).Type==U.SUB&&e.peekToken(2).Type==U.LITERAL)){a.push(_i.parse(e));continue}if(i.Type==U.QUEMARK){t.length>0&&t[t.length-1].nOperationPriorityLevel<=i.nOperationPriorityLevel&&Fe.unionOperation(t,a),e.skipToken(1);let n=a.pop(),o=Fe.parse(e);e.peekToken(0).Type==U.COLON&&e.skipToken(1);let l=Fe.parse(e);if(a.push(new Uc(n,o,l)),e.peekToken(-1).Type==U.SEMICOLON)break;continue}if(i.Type==U.LEFTMEDI){e.skipToken(1);let n=Fe.parse(e);e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1);let o=a.pop();a.push(new wr(o,n));continue}throw"An unexpected character"}}for(;t.length>0&&Fe.unionOperation(t,a););if(t.length<=0&&a.length==1){let i=new Fe;return i.addNode(a.pop()),i}throw"Error parsing expression: Unexpected character("+e.peekToken(0).Literal+")"}formatToWGSL(e,t){return this.nodes[0].formatToWGSL(e,t)}static unionOperation(e,t){if(e.length<0||t.length<2){if(e.length>0&&e[e.length-1].Literal=="-"){let a=e.pop(),r=t.pop();return t.push(new qr(a,void 0,r)),!0}return!1}if(e[e.length-1].isOperation()){let a=t.pop(),r=e.pop(),i=t.pop();return r.Type==U.DOT?t.push(new vi(i,a)):t.push(new dr(r,i,a)),!0}return!1}}class vc extends Oe{constructor(){super()}formatToWGSL(e,t){return(t<=0?"":" ".repeat(t))+"("+this.nodes[0].formatToWGSL(e,0)+")"}}class Ya extends Oe{name;constructor(e){super(),this.name=e}formatToWGSL(e,t){return(t<=0?"":" ".repeat(t))+e.findIdentifier(this.name)}}class Xa extends Oe{value;constructor(e){super(),this.value=e}static parse(e){let t=e.peekToken(0);if(t.Type==U.SUB&&e.peekToken(1).Type==U.LITERAL){let a=new Xa("-"+e.peekToken(1).Literal);return e.skipToken(2),a}else if(t.Type==U.LITERAL){let a=new Xa(t.Literal);return e.skipToken(1),a}throw"Error parsing literal constants: Unexpected characters("+t.Literal+")"}formatToWGSL(e,t){return(t<=0?"":" ".repeat(t))+this.value}}class _i extends Xa{arrayValue;constructor(e){super(""),this.arrayValue=e}static parse(e){if(e.peekToken(0).Type==U.LEFTBIG&&e.peekToken(1).Type==U.LITERAL||e.peekToken(0).Type==U.LEFTBIG&&e.peekToken(1).Type==U.SUB&&e.peekToken(2).Type==U.LITERAL){e.skipToken(1);let t=[];for(;e.peekToken(0).Type!=U.RIGHTBIG;){if(e.peekToken(0).Type==U.LEFTSAMLL){t.push(_i.parse(e));continue}if(t.push(Xa.parse(e)),e.peekToken(0).Type==U.COMMA){e.skipToken(1);continue}else if(e.peekToken(0).Type==U.RIGHTBIG){e.skipToken(1);break}else throw"Error parsing array constants: Unexpected characters"}return new _i(t)}throw"Error parsing array constants: Unexpected characters"}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);this.arrayValue[0].value.includes(".")?a+=r+"array<f32, "+this.arrayValue.length.toString()+">(":a+=r+"array<i32, "+this.arrayValue.length.toString()+">(";for(let i=0;i<this.arrayValue.length;i++)i>0&&(a+=", "),a+=this.arrayValue[i].formatToWGSL(e,0);return a+=")",a}}class r2 extends Oe{constructor(){super()}}class i2 extends Oe{constructor(){super()}}class bn extends Oe{constructor(){super()}static parse(e){if(e.peekToken(0).Type==U.CONTINUE&&e.peekToken(1).Type==U.SEMICOLON)return e.skipToken(2),new bn;throw"Error parsing continue: Unexpected character"}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);return a+=r+"continue",a}}class Bi extends Oe{value;constructor(e){super(),this.value=e}static parse(e){if(e.peekToken(0).Type==U.RETURN){e.skipToken(1);let t=Fe.parse(e);return e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1),new Bi(t)}throw"Error parsing return expression: Unexpected character"}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);return a+=r+"return "+this.value.formatToWGSL(e,0),a}}class qr extends Oe{op;leftValue;rightValue;constructor(e,t,a){super(),this.op=e,this.leftValue=t,this.rightValue=a}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);if(this.op.Literal=="++"||this.op.Literal=="--")if(this.leftValue!=null){let i=this.leftValue.formatToWGSL(e,0);a+=r+i+" = "+i+" "+this.op.Literal[0]+" 1"}else{let i=this.rightValue.formatToWGSL(e,0);a+=r+i+" = "+i+" "+this.op.Literal[0]+" 1"}else this.leftValue!=null?a+=r+this.leftValue.formatToWGSL(e,0)+this.op.Literal:a+=r+this.op.Literal+this.rightValue.formatToWGSL(e,0);return a}}class dr extends Oe{op;leftValue;rightValue;constructor(e,t,a){super(),this.op=e,this.leftValue=t,this.rightValue=a}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);return a+=r+this.leftValue.formatToWGSL(e,0)+" "+this.op.Literal+" "+this.rightValue.formatToWGSL(e,0),a}}class Uc extends Oe{condition;expression1;expression2;constructor(e,t,a){super(),this.condition=e,this.expression1=t,this.expression2=a}static parse(e){throw"Error parsing ternary operation expression: Unexpected character"}formatToWGSL(e,t){return""}}class vi extends Oe{leftValue;rightValue;constructor(e,t){super(),this.leftValue=e,this.rightValue=t}static parse(e){if(e.peekToken(0).Type==U.IDENT&&e.peekToken(1).Type==U.DOT&&e.peekToken(2).Type==U.IDENT){let t=new Ya(e.peekToken(0).Literal),a=new Ya(e.peekToken(2).Literal);return e.skipToken(3),new vi(t,a)}throw"Error parsing selection expression: Unexpected character"}formatToWGSL(e,t){return(t<=0?"":" ".repeat(t))+this.leftValue.formatToWGSL(e,0)+"."+this.rightValue.formatToWGSL(e,0)}}class wr extends Oe{leftValue;indexValue;constructor(e,t){super(),this.leftValue=e,this.indexValue=t}static parse(e){if(e.peekToken(0).Type==U.IDENT&&e.peekToken(1).Type==U.LEFTMEDI){let t=new Ya(e.peekToken(0).Literal);e.skipToken(2);let a=Fe.parse(e);e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1);let r=new wr(t,a);for(;e.peekToken(0).Type==U.LEFTMEDI;)e.skipToken(1),a=Fe.parse(e),e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1),r=new wr(r,a);return r}throw"Error parsing index expression: Unexpected character"}formatToWGSL(e,t){return(t<=0?"":" ".repeat(t))+this.leftValue.formatToWGSL(e,0)+"["+this.indexValue.formatToWGSL(e,0)+"]"}}class Da extends Oe{constructor(){super()}static parse(e){if(e.peekToken(0).Type==U.LEFTBIG){e.skipToken(1);let t=new Da;for(let a=1;a>0&&e.peekToken(0).Type!=U.EOF;){let r=e.peekToken(0);if(r.Type==U.LEFTBIG){a++,e.skipToken(1);continue}if(r.Type==U.RIGHTBIG){a--,e.skipToken(1);continue}if(r.Type==U.SEMICOLON){e.skipToken(1);continue}if(r.isDataType()&&e.peekToken(1).Type==U.IDENT){t.addNode($e.parse(e));continue}if(r.Type==U.CONST&&e.peekToken(1).isDataType()&&e.peekToken(2).Type==U.IDENT){t.addNode($e.parse(e));continue}else if(r.Type==U.IDENT&&e.peekToken(1).Type==U.ASSIGN){t.addNode(Fe.parse(e)),e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1);continue}else if(r.Type==U.IDENT&&e.peekToken(1).Type==U.LEFTMEDI){let i=wr.parse(e);if(e.peekToken(0).Type==U.ASSIGN){let n=e.peekToken(0);e.skipToken(1);let o=Fe.parse(e);e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1),t.addNode(new dr(n,i,o));continue}t.addNode(i);continue}else if(r.Type==U.IDENT&&e.peekToken(1).Type==U.DOT){let i=Fe.parse(e);t.addNode(i);continue}else if(r.Type==U.IDENT&&e.peekToken(1).isAssignOperation()){let i=e.peekToken(1),n=new Ya(r.Literal);e.skipToken(2);let o=Fe.parse(e);e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1),t.addNode(new dr(i,n,o));continue}else if(r.Type==U.IDENT&&(e.peekToken(1).Type==U.INC||e.peekToken(1).Type==U.DEC)&&e.peekToken(2).Type==U.SEMICOLON){let i=e.peekToken(1);t.addNode(new qr(i,new Ya(r.Literal),void 0)),e.skipToken(3);continue}else if(r.Type==U.RETURN){t.addNode(Bi.parse(e));continue}else if(r.Type==U.CONTINUE){t.addNode(bn.parse(e));continue}else if(r.Type==U.WHILE){t.addNode(kr.parse(e));continue}else if(r.Type==U.FOR){t.addNode(Fr.parse(e));continue}else if(r.Type==U.IF){t.addNode(Er.parse(e));continue}else if(r.Type==U.IDENT&&e.peekToken(1).Type==U.LEFTSAMLL){t.addNode(xr.parse(e)),e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(0);continue}throw"Error parsing block: Unexpected symbol("+r.Literal+")"}return t}throw"Error parsing block: Unexpected symbol"}}class gn extends Oe{type;qualifier;constructor(e,t){super(),this.type=t,this.qualifier=e}static parse(e){if(e.peekToken(0).Type==U.PRECISION&&e.peekToken(1).Type==U.IDENT&&e.peekToken(2).isBuiltinType()){let t=new gn(e.peekToken(1).Literal,e.peekToken(2).Literal);return e.skipToken(3),e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1),t}throw"Error parsing precision qualifier: Unexpected character"}formatToWGSL(e,t){return""}}class Ui extends Oe{scope="";qualifier=new Map;constructor(){super()}addQualifier(e,t=""){this.qualifier.set(e,t)}static parse(e){if(e.peekToken(0).Type==U.LAYOUT&&e.peekToken(1).Type==U.LEFTSAMLL){let t=new Ui;e.skipToken(2);do if(e.peekToken(0).Type==U.IDENT){if(e.peekToken(1).Type==U.ASSIGN&&e.peekToken(2).Type==U.LITERAL){let r=e.peekToken(0).Literal,i=e.peekToken(2).Literal;if(t.addQualifier(r,i),e.skipToken(3),e.peekToken(0).Type==U.COMMA){e.skipToken(1);continue}let n=e.peekToken(0);n.Line=0}else if(e.peekToken(1).Type==U.RIGHTSAMLL){let r=e.peekToken(0).Literal;t.addQualifier(r,""),e.skipToken(1);break}else if(e.peekToken(1).Type==U.COMMA){let r=e.peekToken(0).Literal;t.addQualifier(r,""),e.skipToken(2);continue}}while(e.peekToken(0).Type!=U.RIGHTSAMLL);if(e.peekToken(0).Type==U.RIGHTSAMLL&&e.skipToken(1),t.scope=e.peekToken(0).Literal,e.skipToken(1),e.peekToken(0).Type==U.SEMICOLON)return e.skipToken(1),t;if(e.peekToken(0).isBuiltinType()&&e.peekToken(1).Type==U.IDENT&&e.peekToken(2).Type==U.SEMICOLON){let a=new $e(e.peekToken(0).Literal,e.peekToken(1).Literal);return t.addNode(a),e.skipToken(3),t}else if(e.peekToken(0).Type==U.IDENT&&e.peekToken(1).Type==U.LEFTBIG){let a=Za.parse(e);return t.addNode(a),e.peekToken(0).Type==U.IDENT&&e.peekToken(1).Type==U.SEMICOLON&&(a.addNode(new $e(a.name,e.peekToken(0).Literal)),e.skipToken(2)),t}else throw"Error parsing layout qualifier type: Unexpected symbol("+e.peekToken(0).Literal+")"}throw"Error parsing layout qualifier: Unexpected symbol"}formatToWGSL(e,t){let a="";if(this.qualifier.size==1&&this.qualifier.has("location"))a+="@location("+this.qualifier.get("location")+") ";else if(this.qualifier.size==2&&this.qualifier.has("set")&&this.qualifier.has("binding"))a+="@group("+this.qualifier.get("set")+") @binding("+this.qualifier.get("binding")+") ";else if(this.qualifier.size>=1&&this.qualifier.has("binding"))a+="@group(0) @binding("+this.qualifier.get("binding")+") ";else if(this.qualifier.size==1&&this.qualifier.has("push_constant"))a+="@push_constant ";else if(this.qualifier.size>=1&&this.qualifier.has("local_size_x"))a+="@workgroup_size(",a+=this.qualifier.get("local_size_x")+", ",a+=this.qualifier.has("local_size_y")?this.qualifier.get("local_size_y")+", ":"1, ",a+=this.qualifier.has("local_size_z")?this.qualifier.get("local_size_z")+"":"1",a+=")";else if(this.nodes.length<=0)return"";let r=this.nodes[0];if(r instanceof $e){switch(r.type){case"sampler":case"texture2D":a+="var ";break;default:this.scope=="buffer"?e.stage=="compute"?a+="var<storage, read_write> ":a+="var<storage, read> ":a+="var<"+this.scope+"> ";break}e.addIdentifier(r.name,r.name),a+=r.name+": "+oa(r.type)+`;\r
|
|
5742
|
+
`,a}}class Fe extends Oe{constructor(){super()}static parse(e){let t=new Array,a=new Array,r=0;for(;e.peekToken(0).Type!=U.EOF;){let i=e.peekToken(0);if(i.Type==U.SEMICOLON||i.Type==U.RIGHTMEDI||i.Type==U.COMMA||i.Type==U.COLON||i.Type==U.RIGHTBIG)break;if(i.isOperation()){if(i.isOperation()){if(i.Type==U.INC||i.Type==U.DEC){let n=i;e.skipToken(1);let o=Fe.parse(e);a.push(new qr(n,void 0,o));continue}else if(t.length>0){if(t[t.length-1].nOperationPriorityLevel<=i.nOperationPriorityLevel)Fe.unionOperation(t,a);else if(t.length>0&&t[t.length-1].Literal=="-"){let o=t.pop(),l=a.pop();a.push(new qr(o,void 0,l))}}t.push(i),e.skipToken(1)}}else if(i.Type==U.LITERAL){a.push(new Xa(i.Literal)),e.skipToken(1);continue}else if(i.Type==U.LEFTSAMLL){r++,t.push(i),e.skipToken(1);continue}else if(i.Type==U.RIGHTSAMLL){if(r<=0)break;for(r--;Fe.unionOperation(t,a););if(t[t.length-1].Type==U.LEFTSAMLL){t.pop();let n=new vc;n.addNode(a.pop()),a.push(n)}e.skipToken(1);continue}else if(i.Type==U.IDENT){if(e.peekToken(1).Type==U.INC||e.peekToken(1).Type==U.DEC){let n=e.peekToken(1),o=new Ya(i.Literal);a.push(new qr(n,o,void 0)),e.skipToken(2);continue}else if(e.peekToken(1).Type==U.LEFTSAMLL){a.push(xr.parse(e));continue}else if(e.peekToken(1).Type==U.DOT){a.push(vi.parse(e));continue}else if(e.peekToken(1).Type==U.LEFTMEDI){a.push(wr.parse(e));continue}a.push(new Ya(i.Literal)),e.skipToken(1);continue}else{if(i.isBuiltinType()&&e.peekToken(1).Type==U.LEFTSAMLL){a.push(xr.parse(e));continue}if(i.isAssignOperation()){let n=i;e.skipToken(1);let o=a.pop(),l=Fe.parse(e);a.push(new fr(n,o,l));continue}if(i.Type==U.LEFTBIG&&(e.peekToken(1).Type==U.LITERAL||e.peekToken(1).Type==U.SUB&&e.peekToken(2).Type==U.LITERAL)){a.push(_i.parse(e));continue}if(i.Type==U.QUEMARK){t.length>0&&t[t.length-1].nOperationPriorityLevel<=i.nOperationPriorityLevel&&Fe.unionOperation(t,a),e.skipToken(1);let n=a.pop(),o=Fe.parse(e);e.peekToken(0).Type==U.COLON&&e.skipToken(1);let l=Fe.parse(e);if(a.push(new Uc(n,o,l)),e.peekToken(-1).Type==U.SEMICOLON)break;continue}if(i.Type==U.LEFTMEDI){e.skipToken(1);let n=Fe.parse(e);e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1);let o=a.pop();a.push(new wr(o,n));continue}throw"An unexpected character"}}for(;t.length>0&&Fe.unionOperation(t,a););if(t.length<=0&&a.length==1){let i=new Fe;return i.addNode(a.pop()),i}throw"Error parsing expression: Unexpected character("+e.peekToken(0).Literal+")"}formatToWGSL(e,t){return this.nodes[0].formatToWGSL(e,t)}static unionOperation(e,t){if(e.length<0||t.length<2){if(e.length>0&&e[e.length-1].Literal=="-"){let a=e.pop(),r=t.pop();return t.push(new qr(a,void 0,r)),!0}return!1}if(e[e.length-1].isOperation()){let a=t.pop(),r=e.pop(),i=t.pop();return r.Type==U.DOT?t.push(new vi(i,a)):t.push(new fr(r,i,a)),!0}return!1}}class vc extends Oe{constructor(){super()}formatToWGSL(e,t){return(t<=0?"":" ".repeat(t))+"("+this.nodes[0].formatToWGSL(e,0)+")"}}class Ya extends Oe{name;constructor(e){super(),this.name=e}formatToWGSL(e,t){return(t<=0?"":" ".repeat(t))+e.findIdentifier(this.name)}}class Xa extends Oe{value;constructor(e){super(),this.value=e}static parse(e){let t=e.peekToken(0);if(t.Type==U.SUB&&e.peekToken(1).Type==U.LITERAL){let a=new Xa("-"+e.peekToken(1).Literal);return e.skipToken(2),a}else if(t.Type==U.LITERAL){let a=new Xa(t.Literal);return e.skipToken(1),a}throw"Error parsing literal constants: Unexpected characters("+t.Literal+")"}formatToWGSL(e,t){return(t<=0?"":" ".repeat(t))+this.value}}class _i extends Xa{arrayValue;constructor(e){super(""),this.arrayValue=e}static parse(e){if(e.peekToken(0).Type==U.LEFTBIG&&e.peekToken(1).Type==U.LITERAL||e.peekToken(0).Type==U.LEFTBIG&&e.peekToken(1).Type==U.SUB&&e.peekToken(2).Type==U.LITERAL){e.skipToken(1);let t=[];for(;e.peekToken(0).Type!=U.RIGHTBIG;){if(e.peekToken(0).Type==U.LEFTSAMLL){t.push(_i.parse(e));continue}if(t.push(Xa.parse(e)),e.peekToken(0).Type==U.COMMA){e.skipToken(1);continue}else if(e.peekToken(0).Type==U.RIGHTBIG){e.skipToken(1);break}else throw"Error parsing array constants: Unexpected characters"}return new _i(t)}throw"Error parsing array constants: Unexpected characters"}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);this.arrayValue[0].value.includes(".")?a+=r+"array<f32, "+this.arrayValue.length.toString()+">(":a+=r+"array<i32, "+this.arrayValue.length.toString()+">(";for(let i=0;i<this.arrayValue.length;i++)i>0&&(a+=", "),a+=this.arrayValue[i].formatToWGSL(e,0);return a+=")",a}}class r2 extends Oe{constructor(){super()}}class i2 extends Oe{constructor(){super()}}class bn extends Oe{constructor(){super()}static parse(e){if(e.peekToken(0).Type==U.CONTINUE&&e.peekToken(1).Type==U.SEMICOLON)return e.skipToken(2),new bn;throw"Error parsing continue: Unexpected character"}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);return a+=r+"continue",a}}class Bi extends Oe{value;constructor(e){super(),this.value=e}static parse(e){if(e.peekToken(0).Type==U.RETURN){e.skipToken(1);let t=Fe.parse(e);return e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1),new Bi(t)}throw"Error parsing return expression: Unexpected character"}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);return a+=r+"return "+this.value.formatToWGSL(e,0),a}}class qr extends Oe{op;leftValue;rightValue;constructor(e,t,a){super(),this.op=e,this.leftValue=t,this.rightValue=a}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);if(this.op.Literal=="++"||this.op.Literal=="--")if(this.leftValue!=null){let i=this.leftValue.formatToWGSL(e,0);a+=r+i+" = "+i+" "+this.op.Literal[0]+" 1"}else{let i=this.rightValue.formatToWGSL(e,0);a+=r+i+" = "+i+" "+this.op.Literal[0]+" 1"}else this.leftValue!=null?a+=r+this.leftValue.formatToWGSL(e,0)+this.op.Literal:a+=r+this.op.Literal+this.rightValue.formatToWGSL(e,0);return a}}class fr extends Oe{op;leftValue;rightValue;constructor(e,t,a){super(),this.op=e,this.leftValue=t,this.rightValue=a}formatToWGSL(e,t){let a="",r=t<=0?"":" ".repeat(t);return a+=r+this.leftValue.formatToWGSL(e,0)+" "+this.op.Literal+" "+this.rightValue.formatToWGSL(e,0),a}}class Uc extends Oe{condition;expression1;expression2;constructor(e,t,a){super(),this.condition=e,this.expression1=t,this.expression2=a}static parse(e){throw"Error parsing ternary operation expression: Unexpected character"}formatToWGSL(e,t){return""}}class vi extends Oe{leftValue;rightValue;constructor(e,t){super(),this.leftValue=e,this.rightValue=t}static parse(e){if(e.peekToken(0).Type==U.IDENT&&e.peekToken(1).Type==U.DOT&&e.peekToken(2).Type==U.IDENT){let t=new Ya(e.peekToken(0).Literal),a=new Ya(e.peekToken(2).Literal);return e.skipToken(3),new vi(t,a)}throw"Error parsing selection expression: Unexpected character"}formatToWGSL(e,t){return(t<=0?"":" ".repeat(t))+this.leftValue.formatToWGSL(e,0)+"."+this.rightValue.formatToWGSL(e,0)}}class wr extends Oe{leftValue;indexValue;constructor(e,t){super(),this.leftValue=e,this.indexValue=t}static parse(e){if(e.peekToken(0).Type==U.IDENT&&e.peekToken(1).Type==U.LEFTMEDI){let t=new Ya(e.peekToken(0).Literal);e.skipToken(2);let a=Fe.parse(e);e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1);let r=new wr(t,a);for(;e.peekToken(0).Type==U.LEFTMEDI;)e.skipToken(1),a=Fe.parse(e),e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1),r=new wr(r,a);return r}throw"Error parsing index expression: Unexpected character"}formatToWGSL(e,t){return(t<=0?"":" ".repeat(t))+this.leftValue.formatToWGSL(e,0)+"["+this.indexValue.formatToWGSL(e,0)+"]"}}class Da extends Oe{constructor(){super()}static parse(e){if(e.peekToken(0).Type==U.LEFTBIG){e.skipToken(1);let t=new Da;for(let a=1;a>0&&e.peekToken(0).Type!=U.EOF;){let r=e.peekToken(0);if(r.Type==U.LEFTBIG){a++,e.skipToken(1);continue}if(r.Type==U.RIGHTBIG){a--,e.skipToken(1);continue}if(r.Type==U.SEMICOLON){e.skipToken(1);continue}if(r.isDataType()&&e.peekToken(1).Type==U.IDENT){t.addNode($e.parse(e));continue}if(r.Type==U.CONST&&e.peekToken(1).isDataType()&&e.peekToken(2).Type==U.IDENT){t.addNode($e.parse(e));continue}else if(r.Type==U.IDENT&&e.peekToken(1).Type==U.ASSIGN){t.addNode(Fe.parse(e)),e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1);continue}else if(r.Type==U.IDENT&&e.peekToken(1).Type==U.LEFTMEDI){let i=wr.parse(e);if(e.peekToken(0).Type==U.ASSIGN){let n=e.peekToken(0);e.skipToken(1);let o=Fe.parse(e);e.peekToken(0).Type==U.RIGHTMEDI&&e.skipToken(1),t.addNode(new fr(n,i,o));continue}t.addNode(i);continue}else if(r.Type==U.IDENT&&e.peekToken(1).Type==U.DOT){let i=Fe.parse(e);t.addNode(i);continue}else if(r.Type==U.IDENT&&e.peekToken(1).isAssignOperation()){let i=e.peekToken(1),n=new Ya(r.Literal);e.skipToken(2);let o=Fe.parse(e);e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1),t.addNode(new fr(i,n,o));continue}else if(r.Type==U.IDENT&&(e.peekToken(1).Type==U.INC||e.peekToken(1).Type==U.DEC)&&e.peekToken(2).Type==U.SEMICOLON){let i=e.peekToken(1);t.addNode(new qr(i,new Ya(r.Literal),void 0)),e.skipToken(3);continue}else if(r.Type==U.RETURN){t.addNode(Bi.parse(e));continue}else if(r.Type==U.CONTINUE){t.addNode(bn.parse(e));continue}else if(r.Type==U.WHILE){t.addNode(kr.parse(e));continue}else if(r.Type==U.FOR){t.addNode(Fr.parse(e));continue}else if(r.Type==U.IF){t.addNode(Er.parse(e));continue}else if(r.Type==U.IDENT&&e.peekToken(1).Type==U.LEFTSAMLL){t.addNode(xr.parse(e)),e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(0);continue}throw"Error parsing block: Unexpected symbol("+r.Literal+")"}return t}throw"Error parsing block: Unexpected symbol"}}class gn extends Oe{type;qualifier;constructor(e,t){super(),this.type=t,this.qualifier=e}static parse(e){if(e.peekToken(0).Type==U.PRECISION&&e.peekToken(1).Type==U.IDENT&&e.peekToken(2).isBuiltinType()){let t=new gn(e.peekToken(1).Literal,e.peekToken(2).Literal);return e.skipToken(3),e.peekToken(0).Type==U.SEMICOLON&&e.skipToken(1),t}throw"Error parsing precision qualifier: Unexpected character"}formatToWGSL(e,t){return""}}class Ui extends Oe{scope="";qualifier=new Map;constructor(){super()}addQualifier(e,t=""){this.qualifier.set(e,t)}static parse(e){if(e.peekToken(0).Type==U.LAYOUT&&e.peekToken(1).Type==U.LEFTSAMLL){let t=new Ui;e.skipToken(2);do if(e.peekToken(0).Type==U.IDENT){if(e.peekToken(1).Type==U.ASSIGN&&e.peekToken(2).Type==U.LITERAL){let r=e.peekToken(0).Literal,i=e.peekToken(2).Literal;if(t.addQualifier(r,i),e.skipToken(3),e.peekToken(0).Type==U.COMMA){e.skipToken(1);continue}let n=e.peekToken(0);n.Line=0}else if(e.peekToken(1).Type==U.RIGHTSAMLL){let r=e.peekToken(0).Literal;t.addQualifier(r,""),e.skipToken(1);break}else if(e.peekToken(1).Type==U.COMMA){let r=e.peekToken(0).Literal;t.addQualifier(r,""),e.skipToken(2);continue}}while(e.peekToken(0).Type!=U.RIGHTSAMLL);if(e.peekToken(0).Type==U.RIGHTSAMLL&&e.skipToken(1),t.scope=e.peekToken(0).Literal,e.skipToken(1),e.peekToken(0).Type==U.SEMICOLON)return e.skipToken(1),t;if(e.peekToken(0).isBuiltinType()&&e.peekToken(1).Type==U.IDENT&&e.peekToken(2).Type==U.SEMICOLON){let a=new $e(e.peekToken(0).Literal,e.peekToken(1).Literal);return t.addNode(a),e.skipToken(3),t}else if(e.peekToken(0).Type==U.IDENT&&e.peekToken(1).Type==U.LEFTBIG){let a=Za.parse(e);return t.addNode(a),e.peekToken(0).Type==U.IDENT&&e.peekToken(1).Type==U.SEMICOLON&&(a.addNode(new $e(a.name,e.peekToken(0).Literal)),e.skipToken(2)),t}else throw"Error parsing layout qualifier type: Unexpected symbol("+e.peekToken(0).Literal+")"}throw"Error parsing layout qualifier: Unexpected symbol"}formatToWGSL(e,t){let a="";if(this.qualifier.size==1&&this.qualifier.has("location"))a+="@location("+this.qualifier.get("location")+") ";else if(this.qualifier.size==2&&this.qualifier.has("set")&&this.qualifier.has("binding"))a+="@group("+this.qualifier.get("set")+") @binding("+this.qualifier.get("binding")+") ";else if(this.qualifier.size>=1&&this.qualifier.has("binding"))a+="@group(0) @binding("+this.qualifier.get("binding")+") ";else if(this.qualifier.size==1&&this.qualifier.has("push_constant"))a+="@push_constant ";else if(this.qualifier.size>=1&&this.qualifier.has("local_size_x"))a+="@workgroup_size(",a+=this.qualifier.get("local_size_x")+", ",a+=this.qualifier.has("local_size_y")?this.qualifier.get("local_size_y")+", ":"1, ",a+=this.qualifier.has("local_size_z")?this.qualifier.get("local_size_z")+"":"1",a+=")";else if(this.nodes.length<=0)return"";let r=this.nodes[0];if(r instanceof $e){switch(r.type){case"sampler":case"texture2D":a+="var ";break;default:this.scope=="buffer"?e.stage=="compute"?a+="var<storage, read_write> ":a+="var<storage, read> ":a+="var<"+this.scope+"> ";break}e.addIdentifier(r.name,r.name),a+=r.name+": "+oa(r.type)+`;\r
|
|
5743
5743
|
`}else if(r instanceof Za){if(this.scope=="buffer"?e.stage=="compute"?a+="var<storage, read_write> ":a+="var<storage, read> ":a+="var<"+this.scope+"> ",r.nodes.length<=0){let i="unif"+e.layoutUniformCount.toString();for(;e.hasIdentifier(i);)e.layoutUniformCount++,i="unif"+e.layoutUniformCount.toString();for(let n of r.fields)e.addIdentifier(n.name,i+"."+n.name);a+=i+": "+r.name+`;\r
|
|
5744
5744
|
`,e.layoutUniformCount++}else{let i=r.nodes[0];a+=i.name+": "+i.type+`;\r
|
|
5745
|
-
`}return a}return a}}function oa(s){switch(s){case"int":return"i32";case"int[]":return"array<i32>";case"uint":return"u32";case"uint[]":return"array<u32>";case"float":return"f32";case"float[]":return"array<f32>";case"vec2":return"vec2<f32>";case"vec3":return"vec3<f32>";case"vec4":return"vec4<f32>";case"vec2[]":return"array<vec2<f32>>";case"vec3[]":return"array<vec3<f32>>";case"vec4[]":return"array<vec4<f32>>";case"ivec2":return"vec2<i32>";case"ivec3":return"vec3<i32>";case"ivec4":return"vec4<i32>";case"ivec2[]":return"array<vec2<i32>>";case"ivec3[]":return"array<vec3<i32>>";case"ivec4[]":return"array<vec4<i32>>";case"mat2":return"mat2x2<f32>";case"mat2x2":return"mat2x2<f32>";case"mat2x3":return"mat2x3<f32>";case"mat2x4":return"mat2x4<f32>";case"mat2[]":return"array<mat2x2<f32>>";case"mat2x2[]":return"array<mat2x2<f32>>";case"mat2x3[]":return"array<mat2x3<f32>>";case"mat2x4[]":return"array<mat2x4<f32>>";case"mat3":return"mat3x3<f32>";case"mat3x2":return"mat3x2<f32>";case"mat3x3":return"mat3x3<f32>";case"mat3x4":return"mat3x4<f32>";case"mat3[]":return"array<mat3x3<f32>>";case"mat3x2[]":return"array<mat3x2<f32>>";case"mat3x3[]":return"array<mat3x3<f32>>";case"mat3x4[]":return"array<mat3x4<f32>>";case"mat4":return"mat4x4<f32>";case"mat4x2":return"mat4x2<f32>";case"mat4x3":return"mat4x3<f32>";case"mat4x4":return"mat4x4<f32>";case"mat4[]":return"array<mat4x4<f32>>";case"mat4x2[]":return"array<mat4x2<f32>>";case"mat4x3[]":return"array<mat4x3<f32>>";case"mat4x4[]":return"array<mat4x4<f32>>";case"texture2D":return"texture_2d<f32>"}return s}class yc{_lexer;_rootNode;constructor(e){this._lexer=e,this._rootNode=new Oe,this.parse()}get lexer(){return this._lexer}parse(){for(;this.peekToken(0).Type!==U.EOF;){if(this.peekToken(0).Type==U.SEMICOLON){this.skipToken(1);continue}let e=this.parseStatement();e!==null&&this._rootNode.addNode(e)}}parseStatement(){let e=this.peekToken();if(e.Type==U.LAYOUT&&this.peekToken(1).Type==U.LEFTSAMLL)return Ui.parse(this._lexer);if(e.Type==U.STRUCT)return this.skipToken(1),Za.parse(this._lexer);if((e.isBuiltinType()||e.Type==U.VOID)&&this.peekToken(1).Type==U.IDENT&&this.peekToken(2).Type==U.LEFTSAMLL)return hn.parse(this._lexer);if(e.Type==U.CONST&&this.peekToken(1).isDataType())return $e.parse(this._lexer);if(e.isDataType()&&this.peekToken(1).Type==U.IDENT)return $e.parse(this._lexer);if(e.Type==U.OUT&&this.peekToken(1).isDataType()&&this.peekToken(2).Type==U.IDENT)return $e.parse(this._lexer);if(e.Type==U.PRECISION)return gn.parse(this._lexer);throw"Error parsing statement: Unexpected character"}skipToken(e){this._lexer.skipToken(e)}peekToken(e=0){return this._lexer.peekToken(e)}getNextToken(){return this._lexer.GetNextToken()}get ASTRoot(){return this._rootNode}}class Cc{static VertexShader="VertexShader";static FragmentShader="FragmentShader";static convertGLSL(e){var t=new _c(e),a=new Dc(t),r=new yc(a),i=new Bc(r);return i.generateWGSL()}}class bs{setID=0;bindingID=0;name="";type=""}class gs{name="";type="";locationID=0;builtinName="";isBuiltinAttribute(){return this.builtinName!=""}}class Sc{uniformInfo=[];inputAttribute=[];outputAttribute=[];sourceCode=""}var _a=(s=>(s[s.vertex=0]="vertex",s[s.fragment=1]="fragment",s[s.computer=2]="computer",s))(_a||{});class xc{blendMode=me.NONE;depthCompare=ot.less_equal;depthWriteEnabled=!0;frontFace="ccw";cullMode=Nt.back;topology=sn.triangle_list;depthBias=10;useLight=!1;useProbe=!1;acceptGI=!1;acceptShadow=!1;castShadow=!1;castReflection=!0;receiveEnv=!1;renderLayer=1e3;renderOrder=2e3;unclippedDepth=!1;transparent=!1;multisample=0;label;useZ=!0;splitTexture=!1;alphaCutoff;useFragDepth=!1;writeMasks=[];setFromMapValues(e){e.has("blendMode")&&(this.blendMode=this.convertBlendMode(e.get("blendMode"))),e.has("depthCompare")&&(this.depthCompare=e.get("depthCompare")),e.has("depthWriteEnabled")&&(this.depthWriteEnabled=e.get("depthWriteEnabled")),e.has("frontFace")&&(this.frontFace=e.get("frontFace")),e.has("cullMode")&&(this.cullMode=e.get("cullMode")),e.has("topology")&&(this.topology=e.get("topology")),e.has("depthBias")&&(this.depthBias=e.get("depthBias")),e.has("useLight")&&(this.useLight=e.get("useLight")),e.has("useProbe")&&(this.useProbe=e.get("useProbe")),e.has("acceptGI")&&(this.acceptGI=e.get("acceptGI")),e.has("acceptShadow")&&(this.acceptShadow=e.get("acceptShadow")),e.has("castShadow")&&(this.castShadow=e.get("castShadow")),e.has("receiveEnv")&&(this.receiveEnv=e.get("receiveEnv")),e.has("renderLayer")&&(this.renderLayer=e.get("renderLayer")),e.has("renderOrder")&&(this.renderOrder=e.get("renderOrder")),e.has("unclippedDepth")&&(this.unclippedDepth=e.get("unclippedDepth")),e.has("multisample")&&(this.multisample=e.get("multisample")),e.has("label")&&(this.label=e.get("label")),e.has("useZ")&&(this.useZ=e.get("useZ"))}convertBlendMode(e){switch(e){case"ABOVE":return me.ABOVE;case"ALPHA":return me.ALPHA;case"NORMAL":return me.NORMAL;case"ADD":return me.ADD;case"BELOW":return me.BELOW;case"ERASE":return me.ERASE;case"MUL":return me.MUL;case"SCREEN":return me.SCREEN;case"DIVD":return me.DIVD;case"SOFT_ADD":return me.SOFT_ADD}return me.NONE}}class Fc extends ja{uniformNodes=[];_onChange=!0;constructor(){super(),this.bufferType=ga.MaterialDataUniformGPUBuffer}initDataUniform(e){this.uniformNodes=e;let t=0;for(const a in e){const r=e[a];r||console.error(a,"is empty"),t+=r.size*4}t=Math.floor(t/256+1)*256,this.createBuffer(GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,t/4,null,"MaterialDataUniformGPUBuffer");for(const a in e){const r=e[a];r||console.error(a,"is empty");let i=this.memory.allocation_node(r.size*4);r.memoryInfo=i,r.bindOnChange=()=>this.onChange()}}onChange(){this._onChange=!0}apply(){if(this.uniformNodes.length!=0&&this._onChange){for(const e in this.uniformNodes)this.uniformNodes[e].update();super.apply(),this._onChange=!1}}}class Ha{static renderShaderModulePool;static renderShader;static init(){this.renderShaderModulePool=new Map,this.renderShader=new Map}}class Ce{reference;static _ins;static getInstance(){return this._ins||=new Ce,this._ins}attached(e,t){this.reference||=new Map;let a=this.reference.get(e);a||=new Map,a.set(t,e),this.reference.set(e,a)}detached(e,t){if(!this.reference)return;let a=this.reference.get(e);a&&(a.delete(t),a.size===0&&this.reference.delete(e))}hasReference(e){let t=this.reference.get(e);return t?t.size>0:!1}getReferenceCount(e){let t=this.reference.get(e);return t?t.size:0}getReference(e){let t=this.reference.get(e);return t||null}}class ms{static pipelineMap=new Map;static getSharePipeline(e){let t=this.pipelineMap.get(e);return t||null}static setSharePipeline(e,t){this.pipelineMap.set(e,t)}}class Xe extends Kn{passType=le.COLOR;useRz=!1;vsName;fsName;shaderState;textures;pipeline;bindGroupLayouts;envMap;prefilterMap;reflectionMap;_sourceVS;_sourceFS;_destVS;_destFS;_vsShaderModule;_fsShaderModule;_textureGroup=-1;_textureChange=!1;_groupsShaderReflectionVarInfos;outBufferMask;constructor(e,t){super(),this.vsName=e.toLowerCase(),this.fsName=t.toLowerCase(),this.vsName in Y||console.error("Shader Not Register, Please Register Shader!",this.vsName),this.fsName in Y||console.error("Shader Not Register, Please Register Shader!",this.fsName),Y[this.vsName]&&(this._sourceVS=Y[this.vsName]),Y[this.fsName]&&(this._sourceFS=Y[this.fsName]),this.textures={},this.bindGroups=[],this.shaderState=new xc,this.materialDataUniformBuffer=new Fc,this.materialDataUniformBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,this._bufferDic.set("global",this.materialDataUniformBuffer),this._bufferDic.set("materialUniform",this.materialDataUniformBuffer)}get renderOrder(){return this.shaderState.renderOrder}set renderOrder(e){this.shaderState.renderOrder!=e&&(this._valueChange=!0),this.shaderState.renderOrder=e}get doubleSide(){return this.shaderState.cullMode==Nt.none}set doubleSide(e){let t=e?Nt.none:this.cullMode;this.shaderState.cullMode!=t&&(this._valueChange=!0),this.shaderState.cullMode=t}get depthWriteEnabled(){return this.shaderState.depthWriteEnabled}set depthWriteEnabled(e){this.shaderState.depthWriteEnabled!=e&&(this._valueChange=!0),this.shaderState.depthWriteEnabled=e}get cullMode(){return this.shaderState.cullMode}set cullMode(e){this.shaderState.cullMode!=e&&(this._valueChange=!0),this.shaderState.cullMode=e}get frontFace(){return this.shaderState.frontFace}set frontFace(e){this.shaderState.frontFace!=e&&(this._valueChange=!0),this.shaderState.frontFace=e}get depthBias(){return this.shaderState.depthBias}set depthBias(e){this.shaderState.depthBias!=e&&(this._valueChange=!0),this.shaderState.depthBias=e}get topology(){return this.shaderState.topology}set topology(e){this.shaderState.topology!=e&&(this._valueChange=!0),this.shaderState.topology=e}get blendMode(){return this.shaderState.blendMode}set blendMode(e){this.shaderState.blendMode!=e&&(this._valueChange=!0,e!=me.NORMAL&&e!=me.NONE&&(this.renderOrder=3e3)),this.shaderState.blendMode=e}get depthCompare(){return this.shaderState.depthCompare}set depthCompare(e){this.shaderState.depthCompare!=e&&(this._valueChange=!0),this.shaderState.depthCompare=e}setShaderEntry(e="",t=""){this.vsEntryPoint=e,this.fsEntryPoint=t}setUniformArray(e,t){super.setUniformArray(e,t),this.materialDataUniformBuffer.onChange()}setUniform(e,t){super.setUniform(e,t),this.materialDataUniformBuffer.onChange()}setTexture(e,t){t&&this.textures[e]!=t&&(this.textures[e]&&this.textures[e].unBindStateChange(this),this._textureChange=!0,this.textures[e]=t,e=="envMap"?this.envMap=t:e=="prefilterMap"?this.prefilterMap=t:e=="reflectionMap"&&(this.reflectionMap=t),t.bindStateChange(()=>{this._textureChange=!0},this))}get baseColor(){return this.getUniform("baseColor")}set baseColor(e){this.setUniform("baseColor",e)}getTexture(e){return this.textures[e]}genRenderPipeline(e,t){let a=this.createGroupLayouts();this.createPipeline(e,t,a)}reBuild(e,t){this.compileShader(_a.vertex,this._destVS,t),this.compileShader(_a.fragment,this._destFS,t),this.genRenderPipeline(e,t)}apply(e,t,a){this.materialDataUniformBuffer.apply(),this._textureChange&&this._textureGroup!=-1&&(this._textureChange=!1,this.genGroups(this._textureGroup,this.shaderReflection.groups,!0)),this._valueChange&&(this._shaderChange&&(this.preCompile(e),this._shaderChange=!1),this.shaderVariant=St.genRenderShaderVariant(this),this.reBuild(e,t),this._valueChange=!1,a&&a())}preCompile(e){this.preDefine(e),this.preCompileShader(_a.vertex,this._sourceVS.concat()),this.preCompileShader(_a.fragment,this._sourceFS.concat()),this.genReflection()}applyPostDefine(e,t){return t.renderTargetTextures.length>1?(this.defineValue.USE_WORLDPOS=!0,this.defineValue.USEGBUFFER=!0):(this.defineValue.USE_WORLDPOS=!1,this.defineValue.USEGBUFFER=!1),_.setting.render.useCompressGBuffer?this.defineValue.USE_COMPRESSGBUFFER=!0:this.defineValue.USE_COMPRESSGBUFFER=!1,ma.parse(e,this.defineValue)}setBindGroup(e,t){this.bindGroups[e]=t}checkBuffer(e,t){}preCompileShader(e,t,a){let r=t;if(r.indexOf("version ")!=-1){var i=Cc.convertGLSL(r);r=i.sourceCode}for(const n in this.constValues)if(Object.prototype.hasOwnProperty.call(this.constValues,n)){const o=this.constValues[n];r=r.replaceAll(`&${n}`,o.toString())}switch(e){case _a.vertex:this._destVS=r;break;case _a.fragment:this._destFS=r;break}}compileShader(e,t,a){let r=t;r=this.applyPostDefine(r,a);let i=t;for(let o in this.defineValue)i+=`${o}=${this.defineValue[o]},`;let n=Ha.renderShaderModulePool.get(i);switch(n||(r=this.applyPostDefine(r,a),n=w.device.createShaderModule({label:e==_a.vertex?this.vsName:this.fsName,code:r}),n.getCompilationInfo().then(o=>{o.messages.length>0&&(console.log(r),console.log(o))}),Ha.renderShaderModulePool.set(i,n)),e){case _a.vertex:this._vsShaderModule=n,this._destVS=r;break;case _a.fragment:this._fsShaderModule=n,this._destFS=r;break}}getGroupLayout(e,t){let a=[];for(let r=0;r<t.length;r++){const i=t[r];if(i)if(i.varType=="uniform"){this._bufferDic.has(i.varName)||console.error(`not set ${i.varName} buffer`);let n=this._bufferDic.get(i.varName).visibility,o={binding:i.binding,visibility:n,buffer:{type:"uniform"}};a.push(o)}else if(i.varType=="storage-read"){this._bufferDic.has(i.varName)||console.error(`not set ${i.varName} buffer`);let n=this._bufferDic.get(i.varName).visibility,o={binding:i.binding,visibility:n,buffer:{type:"read-only-storage"}};a.push(o)}else if(i.varType=="var")switch(i.dataType){case"sampler":{let n=i.varName.replace("Sampler",""),o=this.textures[n]?this.textures[n]:_.res.redTexture,l={binding:i.binding,visibility:o.visibility,sampler:o.samplerBindingLayout};a.push(l),this._textureGroup=e}break;case"sampler_comparison":{let n=i.varName.replace("Sampler",""),o=this.textures[n]?this.textures[n]:_.res.redTexture,l={binding:i.binding,visibility:o.visibility,sampler:o.sampler_comparisonBindingLayout};a.push(l),this._textureGroup=e}break;case"texture_2d<f32>":case"texture_2d_array<f32>":case"texture_cube<f32>":case"texture_depth_2d":case"texture_depth_2d_array":case"texture_depth_cube":case"texture_depth_cube_array":{let n=this.textures[i.varName]?this.textures[i.varName]:_.res.redTexture,o={binding:i.binding,visibility:n.visibility,texture:n.textureBindingLayout};a.push(o),this._textureGroup=e,Ce.getInstance().attached(n,this)}break;case"texture_external":{let n=this.textures[i.varName]?this.textures[i.varName]:_.res.redTexture,o={binding:i.binding,visibility:n.visibility,externalTexture:{}};a.push(o),this._textureGroup=e,Ce.getInstance().attached(n,this)}break;default:{let n=this.textures[i.varName]?this.textures[i.varName]:_.res.redTexture,o={binding:i.binding,visibility:n.visibility,texture:n.textureBindingLayout};a.push(o),this._textureGroup=e,Ce.getInstance().attached(n,this)}break}else{debugger;console.error("bind group can't empty")}}return a}_cacheEntries;genGroups(e,t,a=!1){if(!this.bindGroups[e]||a){const r=t[e];let i=[];for(let o=0;o<r.length;o++){const l=r[o];if(l){if(l.varType=="uniform"){let c=this._bufferDic.get(l.varName);if(c){if(c.bufferType==ga.MaterialDataUniformGPUBuffer){let h=[];if(l.dataFields)for(let u=0;u<l.dataFields.length;u++){const g=l.dataFields[u];this.uniforms[g.name]?h.push(this.uniforms[g.name]):console.error(`shader-${this.vsName}:${this.fsName} ${g.name}is empty`)}h.length>0&&this.materialDataUniformBuffer.initDataUniform(h)}let f={binding:l.binding,resource:{buffer:c.buffer,offset:0,size:c.memory.shareDataBuffer.byteLength}};i.push(f),this.checkBuffer(l.varName,c)}else console.error(`shader${this.vsName}-${this.fsName}`,`buffer ${l.varName} is missing!`)}else if(l.varType=="storage-read"){let c=this._bufferDic.get(l.varName);if(c){let f={binding:l.binding,resource:{buffer:c.buffer,offset:0,size:c.memory.shareDataBuffer.byteLength}};i.push(f),this.checkBuffer(l.varName,c)}else console.error(`buffer ${l.varName} is missing!`)}else if(l.varType=="var")if(l.dataType=="sampler"){let c=l.varName.replace("Sampler",""),f=this.textures[c];if(f||(f=_.res.blackTexture,this.setTexture(c,f)),f){let h={binding:l.binding,resource:f.gpuSampler};i.push(h)}else console.error(`shader${this.vsName}-${this.fsName}`,`texture ${l.varName} is missing! `)}else if(l.dataType=="sampler_comparison"){let c=l.varName.replace("Sampler",""),f=this.textures[c];if(f){let h={binding:l.binding,resource:f.gpuSampler_comparison};i.push(h)}else console.error(`shader${this.vsName}-${this.fsName}`,`texture ${l.varName} is missing! `)}else{let c=this.textures[l.varName];if(c||(c=_.res.whiteTexture,this.setTexture(l.varName,c)),c){let f={binding:l.binding,resource:c.getGPUView()};i.push(f)}else console.error(`shader${this.vsName}-${this.fsName}`,`texture ${l.varName} is missing! `)}}}let n=w.device.createBindGroup({layout:this.bindGroupLayouts[e],entries:i});this.bindGroups[e]=n}}createPipeline(e,t,a){let r=e,i=this.shaderState,n=[];for(const c of t.renderTargetTextures)n.push({format:c.format});for(let c=0;c<n.length;c++){const f=n[c];i.writeMasks&&i.writeMasks.length>0&&(f.writeMask=i.writeMasks[c])}if(t.outColor!=-1){let c=n[t.outColor];i.blendMode!=me.NONE?c.blend=pc.getBlend(i.blendMode):delete c.blend}let o={label:this.vsName+"|"+this.fsName,layout:a,primitive:{topology:i.topology,cullMode:i.cullMode,frontFace:i.frontFace},vertex:void 0};this.vsEntryPoint!=""&&(o.vertex={module:this._vsShaderModule,entryPoint:this.vsEntryPoint,buffers:r.vertexBuffer.vertexBufferLayouts}),this.fsEntryPoint!=""&&(o.fragment={module:this._fsShaderModule,entryPoint:this.fsEntryPoint,targets:n}),i.multisample>0&&(o.multisample={count:i.multisample}),(t.zPreTexture||t.depthTexture)&&(i.blendMode!=me.NONE,_.setting.render.zPrePass&&t.zPreTexture&&i.useZ?o.depthStencil={depthWriteEnabled:!1,depthCompare:ot.less,format:t.zPreTexture.format}:o.depthStencil={depthWriteEnabled:i.depthWriteEnabled,depthCompare:i.depthCompare,format:t.depthTexture.format});let l=ms.getSharePipeline(this.shaderVariant);l?this.pipeline=l:(this.pipeline=F.createPipeline(o),ms.setSharePipeline(this.shaderVariant,this.pipeline))}createGroupLayouts(){this._groupsShaderReflectionVarInfos=[];let e=this.shaderReflection;this.bindGroupLayouts=[hs.getGlobalDataBindGroupLayout()];for(let a=1;a<e.groups.length;a++){let r=e.groups[a];if(r){let i=this.getGroupLayout(a,r);this._groupsShaderReflectionVarInfos[a]=r;let n=w.device.createBindGroupLayout({entries:i,label:`vs${this.vsName} fs${this.fsName} ${r.length}`});this.bindGroupLayouts[a]=n}else console.error("can't set empty group!",a)}let t=w.device.createPipelineLayout({bindGroupLayouts:this.bindGroupLayouts});return this._groupsShaderReflectionVarInfos[1]&&this.genGroups(1,this._groupsShaderReflectionVarInfos),this._groupsShaderReflectionVarInfos[2]&&this.genGroups(2,this._groupsShaderReflectionVarInfos),this._groupsShaderReflectionVarInfos[3]&&this.genGroups(3,this._groupsShaderReflectionVarInfos),t}preDefine(e){let t=e.hasAttribute(G.TEXCOORD_1),a=e.hasAttribute(G.joints0),r=e.hasAttribute(G.a_morphPositions_0),i=e.hasAttribute(G.TANGENT),n=e.hasAttribute(G.color),o=this.shaderState.acceptGI,l=this.shaderState.useLight;t&&(this.defineValue.USE_SECONDUV=!0),a&&r?this.defineValue.USE_METAHUMAN=!0:(this.defineValue.USE_SKELETON=a,this.defineValue.USE_MORPHTARGETS=r),"USE_TANGENT"in this.defineValue||(this.defineValue.USE_TANGENT=i),this.defineValue.USE_GI=o,this.defineValue.USE_SHADOWMAPING=this.shaderState.acceptShadow,this.defineValue.USE_LIGHT=l,this.defineValue.USE_VERTXCOLOR=n,_.setting.pick.mode=="pixel"&&(this.defineValue.USE_WORLDPOS=!0),_.setting.gi.enable?this.defineValue.USEGI=!0:this.defineValue.USEGI=!1,_.setting.render.debug&&(this.defineValue.USE_DEBUG=!0,this.defineValue.DEBUG_CLUSTER=!0),this.shaderState.useLight?this.defineValue.USE_LIGHT=!0:this.defineValue.USE_LIGHT=!1,_.setting.render.useLogDepth?(this.defineValue.USE_LOGDEPTH=!0,this.shaderState.useFragDepth=!0):this.defineValue.USE_LOGDEPTH=!1,this.shaderState.useFragDepth?this.defineValue.USE_OUTDEPTH=!0:this.defineValue.USE_OUTDEPTH=!1,this.defineValue.USE_PCF_SHADOW=_.setting.shadow.type=="PCF",this.defineValue.USE_HARD_SHADOW=_.setting.shadow.type=="HARD",this.defineValue.USE_SOFT_SHADOW=_.setting.shadow.type=="SOFT",this.defineValue.USE_CSM=ra.Cascades>1,this.defineValue.USE_IES_PROFILE=Aa.use}genReflection(){this.shaderVariant=St.genRenderShaderVariant(this);let e=St.poolGetReflection(this.shaderVariant);if(e)this.shaderReflection=e;else{let t=ma.parse(this._destVS,this.defineValue);t=ma.parse(t,this.defineValue),St.getShaderReflection2(t,this);let a=ma.parse(this._destFS,this.defineValue);a=ma.parse(a,this.defineValue),St.getShaderReflection2(a,this),St.final(this)}this.shaderState.splitTexture=this.shaderReflection.useSplit}destroy(e){for(const t in this.textures)if(Object.prototype.hasOwnProperty.call(this.textures,t)){const a=this.textures[t];if(Ce.getInstance().detached(a,this),e&&!Ce.getInstance().hasReference(a))a.destroy(e);else{a.destroy(!1);let r=Ce.getInstance().getReference(a);if(r){let i=[];r.forEach((n,o)=>{"name"in n?i.push(n.name):i.push("NaN")})}}}this.bindGroups.length=0,this.shaderState=null,this.textures=null,this.pipeline=null,this.bindGroupLayouts=null,this._sourceVS=null,this._sourceFS=null,this._destVS=null,this._destFS=null,this._vsShaderModule=null,this._fsShaderModule=null,this.materialDataUniformBuffer.destroy(e),this.materialDataUniformBuffer=null}static destroyShader(e){Ha.renderShader.has(e)&&(Ha.renderShader.get(e).destroy(),Ha.renderShader.delete(e))}static getShader(e){return Ha.renderShader.get(e)}static createShader(e,t){let a=new Xe(e,t);return Ha.renderShader.set(a.instanceID,a),a.instanceID}}class kc extends Xe{constructor(){super("sky_vs_frag_wgsl","SkyGBuffer_fs"),this.passType=le.GI,this.setUniformVector3("eyesPos",new b),this.setUniformFloat("exposure",1),this.setUniformFloat("roughness",0);let e=this.shaderState;e.frontFace="ccw",e.cullMode=Nt.front,e.depthWriteEnabled=!1,e.depthCompare=ot.less}}class Ec extends Xe{transparency;constructor(){super("gbuffer_vs","gbuffer_fs"),this.setShaderEntry("VertMain","FragMain"),this.passType=le.GI,this.setUniformColor("baseColor",new J),this.setUniformColor("emissiveColor",new J),this.setUniformFloat("emissiveIntensity",1),this.setUniformFloat("normalScale",1),this.setUniformFloat("alphaCutoff",1),this.blendMode=me.NONE,this.setTexture("normalMap",_.res.normalTexture)}}class wc extends Xe{constructor(){super("shadowCastMap_vert","directionShadowCastMap_frag"),this.passType=le.SHADOW,this.setShaderEntry("main"),this.setUniformFloat("cameraFar",5e3),this.setUniformVector3("lightWorldPos",b.ZERO),this.shaderState.receiveEnv=!1,this.shaderState.castShadow=!1,this.shaderState.acceptShadow=!1,this.setDefine("USE_ALPHACUT",!0)}}class Rc extends Xe{constructor(){super("castPointShadowMap_vert","shadowCastMap_frag"),this.passType=le.POINT_SHADOW,this.setShaderEntry("main","main"),this.setUniformFloat("cameraFar",5e3),this.setUniformVector3("lightWorldPos",b.ZERO),this.shaderState.receiveEnv=!1,this.shaderState.castShadow=!1,this.shaderState.acceptShadow=!1,this.setDefine("USE_ALPHACUT",!0)}}class Ic extends Xe{constructor(){super("ZPass_shader_vs","ZPass_shader_vs"),this.passType=le.DEPTH,this.setShaderEntry("main"),this.useRz=!1;let e=this.shaderState;e.receiveEnv=!1}}class yi{static createGIPass(e,t){if(aa.hasMask(e.rendererMask,Qe.Sky)){if(!t.passShader.get(le.GI)){let r=t.getSubShaders(le.COLOR)[0],i=new kc;i.setTexture("baseMap",r.getTexture("baseMap")),i.cullMode=r.cullMode,i.frontFace=r.frontFace,t.addRenderPass(i,0),i.preCompile(e.geometry)}}else this.castGBufferPass(e,t)}static castGBufferPass(e,t){let a=t.getDefaultShaders();for(let r=0;r<a.length;r++){const i=a[r];let n=t.getSubShaders(le.GI);if(!n||n.length==0||n.length<r){let o=new Ec;o.setTexture("baseMap",i.getTexture("baseMap")),o.setTexture("normalMap",i.getTexture("normalMap")),o.setTexture("emissiveMap",i.getTexture("emissiveMap")),i.uniforms.baseColor&&o.setUniform("baseColor",i.getUniform("baseColor")),i.uniforms.envIntensity&&o.setUniform("envIntensity",i.getUniform("envIntensity")),i.uniforms.emissiveColor&&o.setUniform("emissiveColor",i.getUniform("emissiveColor")),i.uniforms.emissiveIntensity&&o.setUniform("emissiveIntensity",i.getUniform("emissiveIntensity")),i.uniforms.alphaCutoff&&o.setUniform("alphaCutoff",i.getUniform("alphaCutoff")),o.cullMode=i.cullMode,o.frontFace=i.frontFace,o.preCompile(e.geometry),t.addRenderPass(o)}}}static createShadowPass(e,t){let a=aa.hasMask(e.rendererMask,Qe.SkinnedMesh),r=e.geometry.hasAttribute(G.TANGENT),i=e.geometry.hasAttribute(sa.MORPH_POSITION_PREFIX+"0"),n=e.geometry.hasAttribute(sa.MORPH_NORMAL_PREFIX+"0"),o=t.getSubShaders(le.COLOR);for(let l=0;l<o.length;l++){const c=o[l];let f=t.getSubShaders(le.SHADOW);if(!f||f.length<l+1){let u=new wc;u.setTexture("baseMap",c.getTexture("baseMap")),u.setUniform("alphaCutoff",c.getUniform("alphaCutoff")),r&&u.setDefine("USE_TANGENT",r),a&&u.setDefine("USE_SKELETON",a),i&&u.setDefine("USE_MORPHTARGETS",i),n&&u.setDefine("USE_MORPHNORMALS",n),c.cullMode=="none"?u.shaderState.cullMode="none":c.cullMode=="back"?u.shaderState.cullMode="front":c.cullMode=="front"&&(u.shaderState.cullMode="back"),u.preCompile(e.geometry),t.addRenderPass(u)}let h=t.getSubShaders(le.POINT_SHADOW);if(!h||h.length<l+1){let u=new Rc;u.setTexture("baseMap",c.getTexture("baseMap")),u.setUniform("alphaCutoff",c.getUniform("alphaCutoff")),u.setDefine("USE_ALPHACUT",1);for(let g=0;g<1;g++)r&&u.setDefine("USE_TANGENT",r),a&&u.setDefine("USE_SKELETON",a),i&&u.setDefine("USE_MORPHTARGETS",i),n&&u.setDefine("USE_MORPHNORMALS",n),u.shaderState.cullMode="front",u.preCompile(e.geometry);t.addRenderPass(u)}}}static createDepthPass(e,t){let a=t.getSubShaders(le.COLOR),r=e.geometry.hasAttribute("TANGENT"),i=e.geometry.hasAttribute(sa.MORPH_POSITION_PREFIX+"0"),n=e.geometry.hasAttribute(sa.MORPH_NORMAL_PREFIX+"0"),o=aa.hasMask(e.rendererMask,Qe.SkinnedMesh);for(let l=0;l<a.length;l++){const c=a[l];let f=t.getSubShaders(le.DEPTH);if(!f&&c.shaderState.useZ&&(!f||f.length<l)){let h=new Ic;h.setTexture("baseMap",c.getTexture("baseMap")),r||h.setDefine("USE_TANGENT",r),o&&h.setDefine("USE_SKELETON",o),i&&h.setDefine("USE_MORPHTARGETS",i),n&&h.setDefine("USE_MORPHNORMALS",n),h.cullMode=c.cullMode,h.frontFace=c.frontFace,h.preCompile(e.geometry),t.addRenderPass(h)}}}static createReflectionPass(e,t){let a=t.getDefaultShaders();for(let o=0;o<a.length;o++){const l=a[o];let c=t.getSubShaders(le.REFLECTION);if(!c||c.length==0||c.length<o){let f=new Xe(l.vsName,l.fsName);f.vsEntryPoint=l.vsEntryPoint,f.fsEntryPoint=l.fsEntryPoint,f.passType=le.REFLECTION;for(const h in l.shaderState){var r=l.shaderState[h];f.shaderState[h]=r}for(const h in l.textures){var i=l.getTexture(h);f.setTexture(h,i)}for(const h in l.uniforms){var n=l.getUniform(h);f.setUniform(h,n)}for(const h in l.defineValue){var n=l.defineValue[h];f.setDefine(h,n)}f.setDefine("USE_CASTREFLECTION",!0),f.preCompile(e.geometry),t.addRenderPass(f)}}}}class hr{static _v1=new b;static _v2=new b;entities;box;subTrees=[];parent;level;static maxSplitLevel=6;static autoSplitLevel=3;index;uuid;constructor(e,t=0,a=null,r=0){this.parent=a,this.box=e.clone(),this.level=r,this.index=t,this.uuid=r+"_"+t,this.entities=new Map}tryInsertEntity(e){let t=e.renderer.object3D.bound;if(this.level==0||this.box.containsBox(t)){this.subTrees.length==0&&this.level<hr.maxSplitLevel&&this.splitTree();let a;if(this.subTrees.length>0){for(let r of this.subTrees)if(r.tryInsertEntity(e)){a=!0;break}}return a||e.enterNode(this),!0}return!1}splitTree(){if(this.subTrees.length==0){const e=hr._v1,t=this.box.extents.clone();let a=this.level+1,r=0;for(let i=0;i<2;i++)for(let n=0;n<2;n++)for(let o=0;o<2;o++){const l=new xe;this.box.min.add(e.set(i,n,o).multiply(t),l.min),l.min.add(t,l.max),l.setFromMinMax(l.min,l.max);let c=new hr(l,r++,this,a);this.subTrees.push(c)}}}__rayCastTempVector=new b;rayCasts(e,t){if(this.level==0||e.intersectBox(this.box,this.__rayCastTempVector)){this.entities.size>0&&t.push(...this.entities.values());for(let a of this.subTrees)a.rayCasts(e,t);return!0}return!1}frustumCasts(e,t){if(this.level==0||e.containsBox2(this.box)>0){if(this.entities.size>0)for(const a of this.entities.values())(this.level>hr.autoSplitLevel||e.containsBox2(a.renderer.object3D.bound)>0)&&t.push(a);for(let a of this.subTrees)a.frustumCasts(e,t);return!0}return!1}getRenderNode(e,t){if(this.level==0||e.containsBox2(this.box)>0){if(this.entities.size>0)for(const a of this.entities.values())(this.level>hr.autoSplitLevel||e.containsBox2(a.renderer.object3D.bound)>0)&&(a.renderer.renderOrder<3e3?t.opaqueList.push(a.renderer):a.renderer.renderOrder>=3e3&&t.transparentList.push(a.renderer));for(let a of this.subTrees)a.getRenderNode(e,t);return!0}return!1}boxCasts(e,t){if(e.intersectsBox(this.box)){this.entities.size>0&&t.push(...this.entities.values());for(let a of this.subTrees)a.boxCasts(e,t);return!0}return!1}clean(){for(let e of this.entities.values())e.leaveNode();return this.entities.clear(),this}}class Qc{_pool=[];_worldPosition=new b;_viewPosition=new b;_zSortList=[];pop(){return this._pool.pop()||{}}recycle(){for(let e of this._zSortList)e.z=0,e.userData=null,e.obj3d=null,this._pool.push(e);this._zSortList.length=0}sort(e,t,a,r){this._zSortList=[];for(let i of t){let n=this.pop();n.userData=i,n.obj3d=a(i),n.z=this.worldToCameraDepth(n.obj3d,e),this._zSortList.push(n)}this._zSortList.sort((i,n)=>i.z-n.z>0?1:-1),r||=[];for(let i of this._zSortList)r.push(i.userData);return this.recycle(),r}worldToCameraDepth(e,t){t||=e.transform.view3D.camera;let a=0;return t&&(this._worldPosition.copyFrom(e.transform.worldPosition),t.worldToScreenPoint(this._worldPosition,this._viewPosition),a=this._viewPosition.z),a}}let Tc=new Qc;var Ci=(s=>(s[s.None=2]="None",s[s.StaticBatch=4]="StaticBatch",s[s.DynamicBatch=8]="DynamicBatch",s[s.Hiden=16]="Hiden",s))(Ci||{});class ps{static addMask(e,t){return e|t}static removeMask(e,t){return e&~t}static hasMask(e,t){return(e&t)!=0}}class Mc{opaqueList=[];transparentList=[];sky;clean(){this.opaqueList.length=0,this.transparentList.length=0}}class Nc{renderGroup;constructor(){this.renderGroup=new Map}collect_add(e){let t="",a="";t+=e.geometry.instanceID;for(let i=0;i<e.materials.length;i++){const n=e.materials[i];a+=n.shader.getDefaultColorShader().shaderVariant}let r=t+a;this.renderGroup.has(r)||this.renderGroup.set(r,{bundleMap:new Map,key:r,renderNodes:[]}),this.renderGroup.get(r).renderNodes.indexOf(e)==-1&&this.renderGroup.get(r).renderNodes.push(e)}}class Pc{renderShaderUpdateList=new Map;renderNodeList=new Map;collect_add(e){let t=e.transform.view3D;t&&e.materials&&e.materials.forEach(a=>{let r=this.renderShaderUpdateList.get(t);r||(r=new Map,this.renderShaderUpdateList.set(t,r));let i=this.renderNodeList.get(t);i||(i=new Map,this.renderNodeList.set(t,i)),i.set(e.instanceID,e);let n=a.getAllPass();for(let o=0;o<n.length;o++){const l=n[o];let c=`${e.geometry.instanceID+l.instanceID}`,f=r.get(c);f||(f=new Map,r.set(c,f)),f.set(e.instanceID,e)}})}collect_remove(e){let t=e.transform.view3D;if(t&&e.materials){let a=this.renderShaderUpdateList.get(t);a&&e.materials.forEach(r=>{let i=r.getAllPass();for(let n=0;n<i.length;n++){const o=i[n];let l=`${e.geometry.instanceID+o.instanceID}`;a.delete(l)}})}}}class K{static _instance;_sceneLights;_sceneGIProbes;_op_RenderNodes;_tr_RenderNodes;_octreeRenderNodes;_reflections;_graphics;_op_renderGroup;_tr_renderGroup;_renderShaderCollect;state={giLightingChange:!0};sky;_collectInfo;rendererOctree;static get instance(){return this._instance||(this._instance=new K),this._instance}constructor(){this._sceneLights=new Map,this._sceneGIProbes=new Map,this._op_RenderNodes=new Map,this._tr_RenderNodes=new Map,this._reflections=new Map,this._graphics=[],this._op_renderGroup=new Map,this._tr_renderGroup=new Map,this._collectInfo=new Mc,this._renderShaderCollect=new Pc,this._octreeRenderNodes=new Map}getPashList(e,t){if(t.renderOrder<3e3)return this._op_RenderNodes.get(e);if(t.renderOrder>=3e3)return this._tr_RenderNodes.get(e)}sortRenderNode(e,t){for(let a=e.length-1;a>0;a--)if(e[a].renderOrder<t.renderOrder){e.push(t);return}e.push(t)}addRenderNode(e,t){if(!e)return;let a=t.renderOrder>=3e3;if(t.hasMask(Qe.Sky))this.sky=t;else if(t.hasMask(Qe.Reflection)){this.removeRenderNode(e,t);let r=this._reflections.get(e);r||(r=[],this._reflections.set(e,r),r.push(t)),r.includes(t)||r.push(t)}else if(t.hasMask(Qe.Graphic3D))this._graphics.indexOf(t)==-1&&this._graphics.push(t);else if(ps.hasMask(t.renderLayer,Ci.None)){this.removeRenderNode(e,t);let r=a?this._tr_RenderNodes:this._op_RenderNodes;r.has(e)||r.set(e,[]),r.get(e).push(t),_.setting.occlusionQuery.octree&&t.attachSceneOctree(this.getOctree(e));let i=this.getPashList(e,t);i.indexOf(t)==-1&&this.sortRenderNode(i,t)}else{this.removeRenderNode(e,t);let r=a?this._tr_renderGroup:this._op_renderGroup;r.has(e)||r.set(e,new Nc),r.get(e).collect_add(t)}t.object3D.renderNode=t,this._renderShaderCollect.collect_add(t)}getOctree(e){let t,a=_.setting.occlusionQuery.octree;if(a&&(t=this._octreeRenderNodes.get(e),!t)){let r=new b(a.x,a.y,a.z),i=new b(a.width,a.height,a.depth),n=new xe(r,i);t=new hr(n),this._octreeRenderNodes.set(e,t)}return t}removeRenderNode(e,t){if(t.detachSceneOctree(),t.hasMask(Qe.Sky))this.sky=null;else if(t.hasMask(Qe.Reflection)){let a=this._reflections.get(e);if(a){let r=a.indexOf(t);r!=-1&&a.splice(r,1)}}else if(ps.hasMask(t.renderLayer,Ci.None)){let a=this.getPashList(e,t);if(a){let r=a.indexOf(t);r!=-1&&a.splice(r,1)}}this._renderShaderCollect.collect_remove(t)}addLight(e,t){if(!this._sceneLights.has(e))this._sceneLights.set(e,[t]);else{let a=this._sceneLights.get(e);if(a.length>=_.setting.light.maxLight){console.warn("Alreay meet maxmium light number:",_.setting.light.maxLight);return}a.indexOf(t)!=-1||a.push(t)}}removeLight(e,t){if(this._sceneLights.has(e)){let a=this._sceneLights.get(e),r=a.indexOf(t);r!=-1&&a.splice(r,1)}}getLights(e){let t=this._sceneLights.get(e);return t||[]}addGIProbe(e,t){this._sceneGIProbes.has(e)?this._sceneGIProbes.get(e).push(t):this._sceneGIProbes.set(e,[t])}removeGIProbe(e,t){if(this._sceneGIProbes.has(e)){let a=this._sceneGIProbes.get(e),r=a.indexOf(t);r!=-1&&a.splice(r,1)}}getProbes(e){let t=this._sceneGIProbes.get(e);return t||[]}getReflections(e){let t=this._reflections.get(e);return t||[]}autoSortRenderNodes(e){let t=this._tr_RenderNodes.get(e);if(!t)return;let a=!1;for(const r of t)if(r.isRenderOrderChange||r.needSortOnCameraZ){a=!0;break}if(a){for(const r of t){let i=r.renderOrder;if(r.needSortOnCameraZ){let n=Tc.worldToCameraDepth(r.object3D);n=1-Math.max(0,Math.min(1,n)),i+=n}r.__renderOrder=i,r.isRenderOrderChange=!1}t.sort((r,i)=>r.__renderOrder>i.__renderOrder?1:-1)}return this}getRenderNodes(e,t){if(this.autoSortRenderNodes(e),this._collectInfo.clean(),this._collectInfo.sky=this.sky,_.setting.occlusionQuery.octree)this.rendererOctree=this.getOctree(e),this.rendererOctree.getRenderNode(t.frustum,this._collectInfo);else{let a=this._op_RenderNodes.get(e);a&&(this._collectInfo.opaqueList=a.concat());let r=this._tr_RenderNodes.get(e);r&&(this._collectInfo.transparentList=r.concat())}return this._collectInfo}getOpRenderGroup(e){return this._op_renderGroup.get(e)}getTrRenderGroup(e){return this._tr_renderGroup.get(e)}getGraphicList(){return this._graphics}getRenderShaderCollect(e){return this._renderShaderCollect.renderShaderUpdateList.get(e)}}class Vc{renderer;owner;uuid;constructor(e){this.renderer=e,this.uuid=e.object3D.instanceID}leaveNode(){this.owner&&(this.owner.entities.delete(this.uuid),this.owner=null)}enterNode(e){this.owner&&this.leaveNode(),this.owner=e,e.entities.set(this.uuid,this)}update(e){return this.owner?.tryInsertEntity(this)||(this.leaveNode(),e.tryInsertEntity(this)),this.owner}}var n2=Object.defineProperty,s2=Object.getOwnPropertyDescriptor,As=(s,e,t,a)=>{for(var r=s2(e,t),i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(e,t,r)||r);return r&&n2(e,t,r),r};class Qa extends qe{instanceCount=0;lodLevel=0;alwaysRender=!1;instanceID;drawType=0;_geometry;_materials=[];_castShadow=!0;_castReflection=!0;_castGI=!1;_rendererMask=Qe.Default;_inRenderer=!1;_readyPipeline=!1;_combineShaderRefection;_ignoreEnvMap;_ignorePrefilterMap;__renderOrder=0;_renderOrder=0;_passInit=new Map;isRenderOrderChange;needSortOnCameraZ;isRecievePostEffectUI;_octreeBinder;_renderLayer=Ci.None;_computes;init(e){this.renderOrder=0,this.rendererMask=Qe.Default,this.instanceID=Hn().toString(),this._computes=[]}attachSceneOctree(e){this._octreeBinder={octree:e,entity:new Vc(this)},this.transform.eventDispatcher.addEventListener(zt.LOCAL_ONCHANGE,this.updateOctreeEntity,this)}detachSceneOctree(){this._octreeBinder&&(this._octreeBinder.entity?.leaveNode(),this.transform.eventDispatcher.removeEventListener(zt.LOCAL_ONCHANGE,this.updateOctreeEntity,this),this._octreeBinder=null)}updateOctreeEntity(e){this._octreeBinder?.entity?.update(this._octreeBinder.octree)}copyComponent(e){return super.copyComponent(e),this.geometry=e._geometry,this.materials=e._materials.slice(),this.drawType=e.drawType,this.alwaysRender=e.alwaysRender,this.needSortOnCameraZ=e.needSortOnCameraZ,this.isRenderOrderChange=e.isRenderOrderChange,this.castShadow=e.castShadow,this.castGI=e.castGI,this.rendererMask=e.rendererMask,this.isRecievePostEffectUI=e.isRecievePostEffectUI,this}get renderLayer(){return this._renderLayer}set renderLayer(e){this._renderLayer=e}get geometry(){return this._geometry}set geometry(e){this._geometry!=e&&(this._readyPipeline=!1,this._geometry&&Ce.getInstance().detached(this._geometry,this),e&&Ce.getInstance().attached(e,this)),this._geometry=e}addMask(e){this._rendererMask=aa.addMask(this.rendererMask,e)}removeMask(e){this._rendererMask=aa.removeMask(this.rendererMask,e)}hasMask(e){return aa.hasMask(this.rendererMask,e)}get rendererMask(){return this._rendererMask}set rendererMask(e){this._rendererMask=e}get renderOrder(){return this._renderOrder}set renderOrder(e){e!=this._renderOrder&&(this.isRenderOrderChange=!0,this.__renderOrder=e),this._renderOrder=e}get materials(){return this._materials}set materials(e){this._readyPipeline=!1;for(let a=0;a<this._materials.length;a++){let r=this._materials[a];Ce.getInstance().detached(r,this),r.shader&&r.shader.computes&&this.removeComputes(r.shader.computes)}for(let a=0;a<e.length;a++){let r=e[a];Ce.getInstance().attached(r,this),r.shader&&r.shader.computes&&this.addComputes(r.shader.computes)}this._materials=e;let t=0;for(let a=0;a<e.length;a++){const n=e[a].getPass(le.COLOR)[0];n.shaderState.transparent&&(t=t>n.renderOrder?t:n.renderOrder)}this.renderOrder=t,this._readyPipeline||this.initPipeline()}addComputes(e){this._computes.push(...e)}removeComputes(e){for(const t of e){let a=this._computes.indexOf(t);a!=-1&&this._computes.splice(a,1)}}addRendererMask(e){this._rendererMask=aa.addMask(this._rendererMask,e)}removeRendererMask(e){this._rendererMask=aa.removeMask(this._rendererMask,e)}onEnable(){this._readyPipeline||this.initPipeline(),K.instance.addRenderNode(this.transform.scene3D,this),this.updateOctreeEntity()}onDisable(){this._enable=!1,K.instance.removeRenderNode(this.transform.scene3D,this),super.onDisable?.()}selfCloneMaterials(e){let t=[];for(let a=0,r=this.materials.length;a<r;a++){const i=this.materials[a].clone();t.push(i)}return this.materials=t,this._readyPipeline=!1,this.initPipeline(),this}initPipeline(){if(this._geometry&&this._materials.length>0){for(let t=0;t<this._materials.length;t++){let r=this._materials[t].getPass(le.COLOR);for(let i=0;i<r.length;i++){const n=r[i];n.shaderReflection||n.preCompile(this._geometry),this._geometry.generate(n.shaderReflection)}this.object3D.bound=this._geometry.bounds.clone()}this._readyPipeline=!0;let e=0;for(let t=0;t<this.materials.length;t++){const i=this.materials[t].getPass(le.COLOR)[0];i.renderOrder>=3e3?e=e>i.renderOrder?e:i.renderOrder:e=Math.max(e-3e3,0),this.castNeedPass()}this.renderOrder=e,this.enable&&this.transform&&this.transform.scene3D&&K.instance.addRenderNode(this.transform.scene3D,this)}}castNeedPass(){if(this.castGI)for(let t=0;t<this.materials.length;t++){const a=this.materials[t];yi.createGIPass(this,a.shader)}for(let t=0;t<this.materials.length;t++){const a=this.materials[t];a.castShadow&&yi.createShadowPass(this,a.shader)}if(this.castReflection)for(let t=0;t<this.materials.length;t++){const a=this.materials[t];a.castReflection&&yi.createReflectionPass(this,a.shader)}if(!aa.hasMask(this.rendererMask,Qe.IgnoreDepthPass)&&_.setting.render.zPrePass)for(let t=0;t<this.materials.length;t++){const a=this.materials[t];yi.createDepthPass(this,a.shader)}else for(let t=0;t<this.materials.length;t++)this.materials[t].shader.removeShaderByIndex(le.DEPTH,0)}get castShadow(){return this._castShadow}set castShadow(e){this._castShadow=e}get castGI(){return this._castGI}set castGI(e){this._castGI=e}get castReflection(){return this._castReflection}set castReflection(e){this._castReflection=e}renderPass(e,t,a){if(!this._geometry)return;let r=this,i=r.transform._worldMatrix;const n=Math.max(r.materials.length,r._geometry.subGeometries.length);for(let o=0;o<n;o++){const l=o>=r.materials.length?r.materials[0]:r.materials[o];if(!l||!l.enable)continue;let c=l.getPass(t);if(!(!c||c.length==0)){F.bindGeometryBuffer(a.encoder,r._geometry),lt.viewCount_vertex(e,le[t],r._geometry.vertexCount);for(let f=0;f<c.length;f++){if(!c||c.length==0)continue;const u=c[f];if(u.pipeline){u.shaderState.splitTexture&&(a.endRenderPass(),Et.WriteSplitColorTexture(r.instanceID),a.beginOpaqueRenderPass(),F.bindCamera(a.encoder,e.camera),F.bindGeometryBuffer(a.encoder,r._geometry)),F.bindPipeline(a.encoder,u)&<.viewCount_pipeline(e,le[t]);let p=(o>=r._geometry.subGeometries.length?r._geometry.subGeometries[0]:r._geometry.subGeometries[o]).lodLevels[r.lodLevel];r.instanceCount>0?(lt.viewCount_instance(e,le[t],r.instanceCount),lt.viewCount_indices(e,le[t],p.indexCount),lt.viewCount_tri(e,le[t],p.indexCount/3*r.instanceCount),F.drawIndexed(a.encoder,p.indexCount,r.instanceCount,p.indexStart,0,0)):(lt.viewCount_indices(e,le[t],p.indexCount),lt.viewCount_tri(e,le[t],p.indexCount/3),F.drawIndexed(a.encoder,p.indexCount,1,p.indexStart,0,i.index)),lt.viewCount_draw(e,le[t])}}}}}renderPass2(e,t,a,r,i,n=!1){if(!this.enable||!this._geometry)return;let o=this,l=o.object3D.transform._worldMatrix;for(let c=0;c<this.materials.length;c++){const f=this.materials[c];if(!f.castShadow&&t==le.SHADOW)continue;let h=f.getPass(t);if(!h||h.length==0)return;if(this.drawType==2)for(let u of h)u.pipeline&&(F.bindPipeline(i,u),F.draw(i,6,1,0,l.index));else{F.bindGeometryBuffer(i,o._geometry);for(let u of h)if(u.pipeline){F.bindPipeline(i,u);let p=o._geometry.subGeometries[c].lodLevels[o.lodLevel];F.drawIndexed(i,p.indexCount,1,p.indexStart,0,l.index)}}}}recordRenderPass2(e,t,a,r,i,n=!1){if(!this.enable)return;let o=this;for(let l=0;l<this.materials.length;l++){let f=this.materials[l].getPass(t);if(!f||f.length==0)return;let h=o.object3D.transform._worldMatrix;for(let u=0;u<f.length;u++){const g=f[u];F.bindPipeline(i,g);let D=o._geometry.subGeometries[l].lodLevels[o.lodLevel];F.drawIndexed(i,D.indexCount,1,D.indexStart,0,h.index)}}}noticeShaderChange(){this.enable&&(this.onEnable(),this._passInit.forEach((e,t)=>{this._passInit.set(t,!1)}))}preInit(e){return this._passInit.get(e)}nodeUpdate(e,t,a,r){let i=this,n=e.scene.envMap;for(let o=0;o<i.materials.length;o++){let c=i.materials[o].getPass(t);if(c)for(let f=0;f<c.length;f++){const u=c[f];if(u.shaderState.splitTexture){let v=Et.CreateSplitTexture(i.instanceID);u.setTexture("splitTexture_Map",v)}!i._ignoreEnvMap&&u.envMap!=n&&u.setTexture("envMap",n),u.prefilterMap||u.setTexture("prefilterMap",n);let g=ve.getReflectionEntries(e.scene);if(!u.reflectionMap&&g&&g.reflectionMap&&(u.setTexture("reflectionMap",g.reflectionMap),u.setStorageBuffer("reflectionBuffer",g.storageGPUBuffer)),u.pipeline){u.apply(i._geometry,a,()=>i.noticeShaderChange());continue}let A=_.res.getTexture("BRDFLUT");u.setTexture("brdflutMap",A);let m=_.getRenderJob(e).shadowMapPassRenderer;m&&m.depth2DArrayTexture&&u.setTexture("shadowMap",_.getRenderJob(e).shadowMapPassRenderer.depth2DArrayTexture);let p=_.getRenderJob(e).pointLightShadowRenderer;p&&p.cubeArrayTexture&&u.setTexture("pointShadowMap",p.cubeArrayTexture);let D=Aa.iesTexture;D&&u.setTexture("iesTextureArrayMap",D),a.irradianceBuffer&&a.irradianceBuffer.length>0&&(u.setTexture("irradianceMap",a.irradianceBuffer[0]),u.setTexture("irradianceDepthMap",a.irradianceBuffer[1]));let B=ve.getLightEntries(e.scene);B&&(u.setStorageBuffer("lightBuffer",B.storageGPUBuffer),B.irradianceVolume&&u.setUniformBuffer("irradianceData",B.irradianceVolume.irradianceVolumeBuffer)),r&&(u.setStorageBuffer("clustersUniform",r.clustersUniformBuffer),u.setStorageBuffer("lightAssignBuffer",r.lightAssignBuffer),u.setStorageBuffer("assignTable",r.assignTableBuffer),u.setStorageBuffer("clusterBuffer",r.clusterBuffer)),u.apply(i._geometry,a),this._passInit.set(t,!0)}}}beforeDestroy(e){this._geometry&&(Ce.getInstance().detached(this._geometry,this),Ce.getInstance().hasReference(this._geometry)||this._geometry.destroy(e));for(let t=0;t<this._materials.length;t++){const a=this._materials[t];a&&(Ce.getInstance().detached(a,this),Ce.getInstance().hasReference(a)||a.destroy(e))}this._computes&&(this._computes.length=0),this.detachSceneOctree(),super.beforeDestroy(e)}destroy(e){super.destroy(e),this._geometry=void 0,this._materials.length=0,this._computes=null,this._passInit&&(this._passInit.clear(),this._passInit=null),this._combineShaderRefection=void 0}}As([jr],Qa.prototype,"materials"),As([jr],Qa.prototype,"castShadow"),As([jr],Qa.prototype,"castGI");class Dt{instanceID;name;enable=!0;_defaultSubShader;_shader;_isDestroyed=!1;constructor(){this.instanceID=Gt()}set shader(e){this._shader=e,this._defaultSubShader=e.getDefaultShaders()[0]}get shader(){return this._shader}get doubleSide(){return this._defaultSubShader.doubleSide}set doubleSide(e){this._defaultSubShader.doubleSide=e}get castShadow(){return this._defaultSubShader.shaderState.castShadow}set castShadow(e){let t=this._defaultSubShader.shaderState;e!=t.castShadow&&(t.castShadow=e)}get acceptShadow(){return this._defaultSubShader.shaderState.acceptShadow}set acceptShadow(e){let t=this._defaultSubShader.shaderState;t.acceptShadow!=e&&(t.acceptShadow=e,this._defaultSubShader.noticeShaderChange(),this._defaultSubShader.noticeValueChange())}get castReflection(){return this._defaultSubShader.shaderState.castReflection}set castReflection(e){this._defaultSubShader.shaderState.castReflection=e}get blendMode(){return this._defaultSubShader.blendMode}set blendMode(e){this._defaultSubShader.blendMode=e}get depthCompare(){return this._defaultSubShader.depthCompare}set depthCompare(e){this._defaultSubShader.depthCompare=e;for(let t of this._shader.passShader.values())for(let a of t)a.depthCompare=e}get transparent(){return this._defaultSubShader.shaderState.transparent}set transparent(e){this._defaultSubShader.shaderState.transparent=e,e&&(this._defaultSubShader.renderOrder=3e3)}get cullMode(){return this._defaultSubShader.cullMode}set cullMode(e){if(this._defaultSubShader.cullMode!=e){for(let t of this._shader.passShader.values())for(let a of t)a.cullMode=e;this._defaultSubShader.cullMode=e}}get depthWriteEnabled(){return this._defaultSubShader.depthWriteEnabled}set depthWriteEnabled(e){this._defaultSubShader.depthWriteEnabled=e}set useBillboard(e){this._defaultSubShader.setDefine("USE_BILLBOARD",e)}get topology(){return this._defaultSubShader.topology}set topology(e){this._defaultSubShader.topology=e}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}getPass(e){return this._shader.getSubShaders(e)}getAllPass(){return this._shader.getSubShaders(le.COLOR)}clone(){let e=new Dt;return e.shader=this.shader.clone(),e}destroy(e){this._isDestroyed||(this.name=null,this.instanceID=null,this._shader&&(this._shader.destroy(e),this._shader=null),this._defaultSubShader=null,this._isDestroyed=!0)}setDefine(e,t){this.shader.setDefine(e,t)}setTexture(e,t){this._shader.setTexture(e,t)}setStorageBuffer(e,t){this._shader.setStorageBuffer(e,t)}setUniformBuffer(e,t){this._shader.setStorageBuffer(e,t)}setUniformFloat(e,t){this._shader.setUniformFloat(e,t)}setUniformVector2(e,t){this._shader.setUniformVector2(e,t)}setUniformVector3(e,t){this._shader.setUniformVector3(e,t)}setUniformVector4(e,t){this._shader.setUniformVector4(e,t)}setUniformColor(e,t){this._shader.setUniformColor(e,t)}getUniformFloat(e){return this._shader.getUniform(e).data}getUniformV2(e){return this._shader.getUniformVector2(e)}getUniformV3(e){return this._shader.getUniformVector3(e)}getUniformV4(e){return this._shader.getUniformVector4(e)}getUniformColor(e){return this._shader.getUniformColor(e)}getTexture(e){return this._shader.getTexture(e)}getStorageBuffer(e){return this._shader.getStorageBuffer(e)}getStructStorageBuffer(e){return this._shader.getStructStorageBuffer(e)}getUniformBuffer(e){return this._shader.getUniformBuffer(e)}applyUniform(){this._shader.applyUniform()}}const Oc=`
|
|
5745
|
+
`}return a}return a}}function oa(s){switch(s){case"int":return"i32";case"int[]":return"array<i32>";case"uint":return"u32";case"uint[]":return"array<u32>";case"float":return"f32";case"float[]":return"array<f32>";case"vec2":return"vec2<f32>";case"vec3":return"vec3<f32>";case"vec4":return"vec4<f32>";case"vec2[]":return"array<vec2<f32>>";case"vec3[]":return"array<vec3<f32>>";case"vec4[]":return"array<vec4<f32>>";case"ivec2":return"vec2<i32>";case"ivec3":return"vec3<i32>";case"ivec4":return"vec4<i32>";case"ivec2[]":return"array<vec2<i32>>";case"ivec3[]":return"array<vec3<i32>>";case"ivec4[]":return"array<vec4<i32>>";case"mat2":return"mat2x2<f32>";case"mat2x2":return"mat2x2<f32>";case"mat2x3":return"mat2x3<f32>";case"mat2x4":return"mat2x4<f32>";case"mat2[]":return"array<mat2x2<f32>>";case"mat2x2[]":return"array<mat2x2<f32>>";case"mat2x3[]":return"array<mat2x3<f32>>";case"mat2x4[]":return"array<mat2x4<f32>>";case"mat3":return"mat3x3<f32>";case"mat3x2":return"mat3x2<f32>";case"mat3x3":return"mat3x3<f32>";case"mat3x4":return"mat3x4<f32>";case"mat3[]":return"array<mat3x3<f32>>";case"mat3x2[]":return"array<mat3x2<f32>>";case"mat3x3[]":return"array<mat3x3<f32>>";case"mat3x4[]":return"array<mat3x4<f32>>";case"mat4":return"mat4x4<f32>";case"mat4x2":return"mat4x2<f32>";case"mat4x3":return"mat4x3<f32>";case"mat4x4":return"mat4x4<f32>";case"mat4[]":return"array<mat4x4<f32>>";case"mat4x2[]":return"array<mat4x2<f32>>";case"mat4x3[]":return"array<mat4x3<f32>>";case"mat4x4[]":return"array<mat4x4<f32>>";case"texture2D":return"texture_2d<f32>"}return s}class yc{_lexer;_rootNode;constructor(e){this._lexer=e,this._rootNode=new Oe,this.parse()}get lexer(){return this._lexer}parse(){for(;this.peekToken(0).Type!==U.EOF;){if(this.peekToken(0).Type==U.SEMICOLON){this.skipToken(1);continue}let e=this.parseStatement();e!==null&&this._rootNode.addNode(e)}}parseStatement(){let e=this.peekToken();if(e.Type==U.LAYOUT&&this.peekToken(1).Type==U.LEFTSAMLL)return Ui.parse(this._lexer);if(e.Type==U.STRUCT)return this.skipToken(1),Za.parse(this._lexer);if((e.isBuiltinType()||e.Type==U.VOID)&&this.peekToken(1).Type==U.IDENT&&this.peekToken(2).Type==U.LEFTSAMLL)return hn.parse(this._lexer);if(e.Type==U.CONST&&this.peekToken(1).isDataType())return $e.parse(this._lexer);if(e.isDataType()&&this.peekToken(1).Type==U.IDENT)return $e.parse(this._lexer);if(e.Type==U.OUT&&this.peekToken(1).isDataType()&&this.peekToken(2).Type==U.IDENT)return $e.parse(this._lexer);if(e.Type==U.PRECISION)return gn.parse(this._lexer);throw"Error parsing statement: Unexpected character"}skipToken(e){this._lexer.skipToken(e)}peekToken(e=0){return this._lexer.peekToken(e)}getNextToken(){return this._lexer.GetNextToken()}get ASTRoot(){return this._rootNode}}class Cc{static VertexShader="VertexShader";static FragmentShader="FragmentShader";static convertGLSL(e){var t=new _c(e),a=new Dc(t),r=new yc(a),i=new Bc(r);return i.generateWGSL()}}class bs{setID=0;bindingID=0;name="";type=""}class gs{name="";type="";locationID=0;builtinName="";isBuiltinAttribute(){return this.builtinName!=""}}class Sc{uniformInfo=[];inputAttribute=[];outputAttribute=[];sourceCode=""}var _a=(s=>(s[s.vertex=0]="vertex",s[s.fragment=1]="fragment",s[s.computer=2]="computer",s))(_a||{});class xc{blendMode=me.NONE;depthCompare=ot.less_equal;depthWriteEnabled=!0;frontFace="ccw";cullMode=Nt.back;topology=sn.triangle_list;depthBias=10;useLight=!1;useProbe=!1;acceptGI=!1;acceptShadow=!1;castShadow=!1;castReflection=!0;receiveEnv=!1;renderLayer=1e3;renderOrder=2e3;unclippedDepth=!1;transparent=!1;multisample=0;label;useZ=!0;splitTexture=!1;alphaCutoff;useFragDepth=!1;writeMasks=[];setFromMapValues(e){e.has("blendMode")&&(this.blendMode=this.convertBlendMode(e.get("blendMode"))),e.has("depthCompare")&&(this.depthCompare=e.get("depthCompare")),e.has("depthWriteEnabled")&&(this.depthWriteEnabled=e.get("depthWriteEnabled")),e.has("frontFace")&&(this.frontFace=e.get("frontFace")),e.has("cullMode")&&(this.cullMode=e.get("cullMode")),e.has("topology")&&(this.topology=e.get("topology")),e.has("depthBias")&&(this.depthBias=e.get("depthBias")),e.has("useLight")&&(this.useLight=e.get("useLight")),e.has("useProbe")&&(this.useProbe=e.get("useProbe")),e.has("acceptGI")&&(this.acceptGI=e.get("acceptGI")),e.has("acceptShadow")&&(this.acceptShadow=e.get("acceptShadow")),e.has("castShadow")&&(this.castShadow=e.get("castShadow")),e.has("receiveEnv")&&(this.receiveEnv=e.get("receiveEnv")),e.has("renderLayer")&&(this.renderLayer=e.get("renderLayer")),e.has("renderOrder")&&(this.renderOrder=e.get("renderOrder")),e.has("unclippedDepth")&&(this.unclippedDepth=e.get("unclippedDepth")),e.has("multisample")&&(this.multisample=e.get("multisample")),e.has("label")&&(this.label=e.get("label")),e.has("useZ")&&(this.useZ=e.get("useZ"))}convertBlendMode(e){switch(e){case"ABOVE":return me.ABOVE;case"ALPHA":return me.ALPHA;case"NORMAL":return me.NORMAL;case"ADD":return me.ADD;case"BELOW":return me.BELOW;case"ERASE":return me.ERASE;case"MUL":return me.MUL;case"SCREEN":return me.SCREEN;case"DIVD":return me.DIVD;case"SOFT_ADD":return me.SOFT_ADD}return me.NONE}}class Fc extends ja{uniformNodes=[];_onChange=!0;constructor(){super(),this.bufferType=ga.MaterialDataUniformGPUBuffer}initDataUniform(e){this.uniformNodes=e;let t=0;for(const a in e){const r=e[a];r||console.error(a,"is empty"),t+=r.size*4}t=Math.floor(t/256+1)*256,this.createBuffer(GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,t/4,null,"MaterialDataUniformGPUBuffer");for(const a in e){const r=e[a];r||console.error(a,"is empty");let i=this.memory.allocation_node(r.size*4);r.memoryInfo=i,r.bindOnChange=()=>this.onChange()}}onChange(){this._onChange=!0}apply(){if(this.uniformNodes.length!=0&&this._onChange){for(const e in this.uniformNodes)this.uniformNodes[e].update();super.apply(),this._onChange=!1}}}class Ha{static renderShaderModulePool;static renderShader;static init(){this.renderShaderModulePool=new Map,this.renderShader=new Map}}class Ce{reference;static _ins;static getInstance(){return this._ins||=new Ce,this._ins}attached(e,t){this.reference||=new Map;let a=this.reference.get(e);a||=new Map,a.set(t,e),this.reference.set(e,a)}detached(e,t){if(!this.reference)return;let a=this.reference.get(e);a&&(a.delete(t),a.size===0&&this.reference.delete(e))}hasReference(e){let t=this.reference.get(e);return t?t.size>0:!1}getReferenceCount(e){let t=this.reference.get(e);return t?t.size:0}getReference(e){let t=this.reference.get(e);return t||null}}class ms{static pipelineMap=new Map;static getSharePipeline(e){let t=this.pipelineMap.get(e);return t||null}static setSharePipeline(e,t){this.pipelineMap.set(e,t)}}class Xe extends Kn{passType=le.COLOR;useRz=!1;vsName;fsName;shaderState;textures;pipeline;bindGroupLayouts;envMap;prefilterMap;reflectionMap;_sourceVS;_sourceFS;_destVS;_destFS;_vsShaderModule;_fsShaderModule;_textureGroup=-1;_textureChange=!1;_groupsShaderReflectionVarInfos;outBufferMask;constructor(e,t){super(),this.vsName=e.toLowerCase(),this.fsName=t.toLowerCase(),this.vsName in Y||console.error("Shader Not Register, Please Register Shader!",this.vsName),this.fsName in Y||console.error("Shader Not Register, Please Register Shader!",this.fsName),Y[this.vsName]&&(this._sourceVS=Y[this.vsName]),Y[this.fsName]&&(this._sourceFS=Y[this.fsName]),this.textures={},this.bindGroups=[],this.shaderState=new xc,this.materialDataUniformBuffer=new Fc,this.materialDataUniformBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,this._bufferDic.set("global",this.materialDataUniformBuffer),this._bufferDic.set("materialUniform",this.materialDataUniformBuffer)}get renderOrder(){return this.shaderState.renderOrder}set renderOrder(e){this.shaderState.renderOrder!=e&&(this._valueChange=!0),this.shaderState.renderOrder=e}get doubleSide(){return this.shaderState.cullMode==Nt.none}set doubleSide(e){let t=e?Nt.none:this.cullMode;this.shaderState.cullMode!=t&&(this._valueChange=!0),this.shaderState.cullMode=t}get depthWriteEnabled(){return this.shaderState.depthWriteEnabled}set depthWriteEnabled(e){this.shaderState.depthWriteEnabled!=e&&(this._valueChange=!0),this.shaderState.depthWriteEnabled=e}get cullMode(){return this.shaderState.cullMode}set cullMode(e){this.shaderState.cullMode!=e&&(this._valueChange=!0),this.shaderState.cullMode=e}get frontFace(){return this.shaderState.frontFace}set frontFace(e){this.shaderState.frontFace!=e&&(this._valueChange=!0),this.shaderState.frontFace=e}get depthBias(){return this.shaderState.depthBias}set depthBias(e){this.shaderState.depthBias!=e&&(this._valueChange=!0),this.shaderState.depthBias=e}get topology(){return this.shaderState.topology}set topology(e){this.shaderState.topology!=e&&(this._valueChange=!0),this.shaderState.topology=e}get blendMode(){return this.shaderState.blendMode}set blendMode(e){this.shaderState.blendMode!=e&&(this._valueChange=!0,e!=me.NORMAL&&e!=me.NONE&&(this.renderOrder=3e3)),this.shaderState.blendMode=e}get depthCompare(){return this.shaderState.depthCompare}set depthCompare(e){this.shaderState.depthCompare!=e&&(this._valueChange=!0),this.shaderState.depthCompare=e}setShaderEntry(e="",t=""){this.vsEntryPoint=e,this.fsEntryPoint=t}setUniformArray(e,t){super.setUniformArray(e,t),this.materialDataUniformBuffer.onChange()}setUniform(e,t){super.setUniform(e,t),this.materialDataUniformBuffer.onChange()}setTexture(e,t){t&&this.textures[e]!=t&&(this.textures[e]&&this.textures[e].unBindStateChange(this),this._textureChange=!0,this.textures[e]=t,e=="envMap"?this.envMap=t:e=="prefilterMap"?this.prefilterMap=t:e=="reflectionMap"&&(this.reflectionMap=t),t.bindStateChange(()=>{this._textureChange=!0},this))}get baseColor(){return this.getUniform("baseColor")}set baseColor(e){this.setUniform("baseColor",e)}getTexture(e){return this.textures[e]}genRenderPipeline(e,t){let a=this.createGroupLayouts();this.createPipeline(e,t,a)}reBuild(e,t){this.compileShader(_a.vertex,this._destVS,t),this.compileShader(_a.fragment,this._destFS,t),this.genRenderPipeline(e,t)}apply(e,t,a){this.materialDataUniformBuffer.apply(),this._textureChange&&this._textureGroup!=-1&&(this._textureChange=!1,this.genGroups(this._textureGroup,this.shaderReflection.groups,!0)),this._valueChange&&(this._shaderChange&&(this.preCompile(e),this._shaderChange=!1),this.shaderVariant=St.genRenderShaderVariant(this),this.reBuild(e,t),this._valueChange=!1,a&&a())}preCompile(e){this.preDefine(e),this.preCompileShader(_a.vertex,this._sourceVS.concat()),this.preCompileShader(_a.fragment,this._sourceFS.concat()),this.genReflection()}applyPostDefine(e,t){return t.renderTargetTextures.length>1?(this.defineValue.USE_WORLDPOS=!0,this.defineValue.USEGBUFFER=!0):(this.defineValue.USE_WORLDPOS=!1,this.defineValue.USEGBUFFER=!1),_.setting.render.useCompressGBuffer?this.defineValue.USE_COMPRESSGBUFFER=!0:this.defineValue.USE_COMPRESSGBUFFER=!1,ma.parse(e,this.defineValue)}setBindGroup(e,t){this.bindGroups[e]=t}checkBuffer(e,t){}preCompileShader(e,t,a){let r=t;if(r.indexOf("version ")!=-1){var i=Cc.convertGLSL(r);r=i.sourceCode}for(const n in this.constValues)if(Object.prototype.hasOwnProperty.call(this.constValues,n)){const o=this.constValues[n];r=r.replaceAll(`&${n}`,o.toString())}switch(e){case _a.vertex:this._destVS=r;break;case _a.fragment:this._destFS=r;break}}compileShader(e,t,a){let r=t;r=this.applyPostDefine(r,a);let i=t;for(let o in this.defineValue)i+=`${o}=${this.defineValue[o]},`;let n=Ha.renderShaderModulePool.get(i);switch(n||(r=this.applyPostDefine(r,a),n=w.device.createShaderModule({label:e==_a.vertex?this.vsName:this.fsName,code:r}),n.getCompilationInfo().then(o=>{o.messages.length>0&&(console.log(r),console.log(o))}),Ha.renderShaderModulePool.set(i,n)),e){case _a.vertex:this._vsShaderModule=n,this._destVS=r;break;case _a.fragment:this._fsShaderModule=n,this._destFS=r;break}}getGroupLayout(e,t){let a=[];for(let r=0;r<t.length;r++){const i=t[r];if(i)if(i.varType=="uniform"){this._bufferDic.has(i.varName)||console.error(`not set ${i.varName} buffer`);let n=this._bufferDic.get(i.varName).visibility,o={binding:i.binding,visibility:n,buffer:{type:"uniform"}};a.push(o)}else if(i.varType=="storage-read"){this._bufferDic.has(i.varName)||console.error(`not set ${i.varName} buffer`);let n=this._bufferDic.get(i.varName).visibility,o={binding:i.binding,visibility:n,buffer:{type:"read-only-storage"}};a.push(o)}else if(i.varType=="var")switch(i.dataType){case"sampler":{let n=i.varName.replace("Sampler",""),o=this.textures[n]?this.textures[n]:_.res.redTexture,l={binding:i.binding,visibility:o.visibility,sampler:o.samplerBindingLayout};a.push(l),this._textureGroup=e}break;case"sampler_comparison":{let n=i.varName.replace("Sampler",""),o=this.textures[n]?this.textures[n]:_.res.redTexture,l={binding:i.binding,visibility:o.visibility,sampler:o.sampler_comparisonBindingLayout};a.push(l),this._textureGroup=e}break;case"texture_2d<f32>":case"texture_2d_array<f32>":case"texture_cube<f32>":case"texture_depth_2d":case"texture_depth_2d_array":case"texture_depth_cube":case"texture_depth_cube_array":{let n=this.textures[i.varName]?this.textures[i.varName]:_.res.redTexture,o={binding:i.binding,visibility:n.visibility,texture:n.textureBindingLayout};a.push(o),this._textureGroup=e,Ce.getInstance().attached(n,this)}break;case"texture_external":{let n=this.textures[i.varName]?this.textures[i.varName]:_.res.redTexture,o={binding:i.binding,visibility:n.visibility,externalTexture:{}};a.push(o),this._textureGroup=e,Ce.getInstance().attached(n,this)}break;default:{let n=this.textures[i.varName]?this.textures[i.varName]:_.res.redTexture,o={binding:i.binding,visibility:n.visibility,texture:n.textureBindingLayout};a.push(o),this._textureGroup=e,Ce.getInstance().attached(n,this)}break}else{debugger;console.error("bind group can't empty")}}return a}_cacheEntries;genGroups(e,t,a=!1){if(!this.bindGroups[e]||a){const r=t[e];let i=[];for(let o=0;o<r.length;o++){const l=r[o];if(l){if(l.varType=="uniform"){let c=this._bufferDic.get(l.varName);if(c){if(c.bufferType==ga.MaterialDataUniformGPUBuffer){let h=[];if(l.dataFields)for(let u=0;u<l.dataFields.length;u++){const g=l.dataFields[u];this.uniforms[g.name]?h.push(this.uniforms[g.name]):console.error(`shader-${this.vsName}:${this.fsName} ${g.name}is empty`)}h.length>0&&this.materialDataUniformBuffer.initDataUniform(h)}let f={binding:l.binding,resource:{buffer:c.buffer,offset:0,size:c.memory.shareDataBuffer.byteLength}};i.push(f),this.checkBuffer(l.varName,c)}else console.error(`shader${this.vsName}-${this.fsName}`,`buffer ${l.varName} is missing!`)}else if(l.varType=="storage-read"){let c=this._bufferDic.get(l.varName);if(c){let f={binding:l.binding,resource:{buffer:c.buffer,offset:0,size:c.memory.shareDataBuffer.byteLength}};i.push(f),this.checkBuffer(l.varName,c)}else console.error(`buffer ${l.varName} is missing!`)}else if(l.varType=="var")if(l.dataType=="sampler"){let c=l.varName.replace("Sampler",""),f=this.textures[c];if(f||(f=_.res.blackTexture,this.setTexture(c,f)),f){let h={binding:l.binding,resource:f.gpuSampler};i.push(h)}else console.error(`shader${this.vsName}-${this.fsName}`,`texture ${l.varName} is missing! `)}else if(l.dataType=="sampler_comparison"){let c=l.varName.replace("Sampler",""),f=this.textures[c];if(f){let h={binding:l.binding,resource:f.gpuSampler_comparison};i.push(h)}else console.error(`shader${this.vsName}-${this.fsName}`,`texture ${l.varName} is missing! `)}else{let c=this.textures[l.varName];if(c||(c=_.res.whiteTexture,this.setTexture(l.varName,c)),c){let f={binding:l.binding,resource:c.getGPUView()};i.push(f)}else console.error(`shader${this.vsName}-${this.fsName}`,`texture ${l.varName} is missing! `)}}}let n=w.device.createBindGroup({layout:this.bindGroupLayouts[e],entries:i});this.bindGroups[e]=n}}createPipeline(e,t,a){let r=e,i=this.shaderState,n=[];for(const c of t.renderTargetTextures)n.push({format:c.format});for(let c=0;c<n.length;c++){const f=n[c];i.writeMasks&&i.writeMasks.length>0&&(f.writeMask=i.writeMasks[c])}if(t.outColor!=-1){let c=n[t.outColor];i.blendMode!=me.NONE?c.blend=pc.getBlend(i.blendMode):delete c.blend}let o={label:this.vsName+"|"+this.fsName,layout:a,primitive:{topology:i.topology,cullMode:i.cullMode,frontFace:i.frontFace},vertex:void 0};this.vsEntryPoint!=""&&(o.vertex={module:this._vsShaderModule,entryPoint:this.vsEntryPoint,buffers:r.vertexBuffer.vertexBufferLayouts}),this.fsEntryPoint!=""&&(o.fragment={module:this._fsShaderModule,entryPoint:this.fsEntryPoint,targets:n}),i.multisample>0&&(o.multisample={count:i.multisample}),(t.zPreTexture||t.depthTexture)&&(i.blendMode!=me.NONE,_.setting.render.zPrePass&&t.zPreTexture&&i.useZ?o.depthStencil={depthWriteEnabled:!1,depthCompare:ot.less,format:t.zPreTexture.format}:o.depthStencil={depthWriteEnabled:i.depthWriteEnabled,depthCompare:i.depthCompare,format:t.depthTexture.format});let l=ms.getSharePipeline(this.shaderVariant);l?this.pipeline=l:(this.pipeline=F.createPipeline(o),ms.setSharePipeline(this.shaderVariant,this.pipeline))}createGroupLayouts(){this._groupsShaderReflectionVarInfos=[];let e=this.shaderReflection;this.bindGroupLayouts=[hs.getGlobalDataBindGroupLayout()];for(let a=1;a<e.groups.length;a++){let r=e.groups[a];if(r){let i=this.getGroupLayout(a,r);this._groupsShaderReflectionVarInfos[a]=r;let n=w.device.createBindGroupLayout({entries:i,label:`vs${this.vsName} fs${this.fsName} ${r.length}`});this.bindGroupLayouts[a]=n}else console.error("can't set empty group!",a)}let t=w.device.createPipelineLayout({bindGroupLayouts:this.bindGroupLayouts});return this._groupsShaderReflectionVarInfos[1]&&this.genGroups(1,this._groupsShaderReflectionVarInfos),this._groupsShaderReflectionVarInfos[2]&&this.genGroups(2,this._groupsShaderReflectionVarInfos),this._groupsShaderReflectionVarInfos[3]&&this.genGroups(3,this._groupsShaderReflectionVarInfos),t}preDefine(e){let t=e.hasAttribute(G.TEXCOORD_1),a=e.hasAttribute(G.joints0),r=e.hasAttribute(G.a_morphPositions_0),i=e.hasAttribute(G.TANGENT),n=e.hasAttribute(G.color),o=this.shaderState.acceptGI,l=this.shaderState.useLight;t&&(this.defineValue.USE_SECONDUV=!0),a&&r?this.defineValue.USE_METAHUMAN=!0:(this.defineValue.USE_SKELETON=a,this.defineValue.USE_MORPHTARGETS=r),"USE_TANGENT"in this.defineValue||(this.defineValue.USE_TANGENT=i),this.defineValue.USE_GI=o,this.defineValue.USE_SHADOWMAPING=this.shaderState.acceptShadow,this.defineValue.USE_LIGHT=l,this.defineValue.USE_VERTXCOLOR=n,_.setting.pick.mode=="pixel"&&(this.defineValue.USE_WORLDPOS=!0),_.setting.gi.enable?this.defineValue.USEGI=!0:this.defineValue.USEGI=!1,_.setting.render.debug&&(this.defineValue.USE_DEBUG=!0,this.defineValue.DEBUG_CLUSTER=!0),this.shaderState.useLight?this.defineValue.USE_LIGHT=!0:this.defineValue.USE_LIGHT=!1,_.setting.render.useLogDepth?(this.defineValue.USE_LOGDEPTH=!0,this.shaderState.useFragDepth=!0):this.defineValue.USE_LOGDEPTH=!1,this.shaderState.useFragDepth?this.defineValue.USE_OUTDEPTH=!0:this.defineValue.USE_OUTDEPTH=!1,this.defineValue.USE_PCF_SHADOW=_.setting.shadow.type=="PCF",this.defineValue.USE_HARD_SHADOW=_.setting.shadow.type=="HARD",this.defineValue.USE_SOFT_SHADOW=_.setting.shadow.type=="SOFT",this.defineValue.USE_CSM=ra.Cascades>1,this.defineValue.USE_IES_PROFILE=Aa.use}genReflection(){this.shaderVariant=St.genRenderShaderVariant(this);let e=St.poolGetReflection(this.shaderVariant);if(e)this.shaderReflection=e;else{let t=ma.parse(this._destVS,this.defineValue);t=ma.parse(t,this.defineValue),St.getShaderReflection2(t,this);let a=ma.parse(this._destFS,this.defineValue);a=ma.parse(a,this.defineValue),St.getShaderReflection2(a,this),St.final(this)}this.shaderState.splitTexture=this.shaderReflection.useSplit}destroy(e){for(const t in this.textures)if(Object.prototype.hasOwnProperty.call(this.textures,t)){const a=this.textures[t];if(Ce.getInstance().detached(a,this),e&&!Ce.getInstance().hasReference(a))a.destroy(e);else{a.destroy(!1);let r=Ce.getInstance().getReference(a);if(r){let i=[];r.forEach((n,o)=>{"name"in n?i.push(n.name):i.push("NaN")})}}}this.bindGroups.length=0,this.shaderState=null,this.textures=null,this.pipeline=null,this.bindGroupLayouts=null,this._sourceVS=null,this._sourceFS=null,this._destVS=null,this._destFS=null,this._vsShaderModule=null,this._fsShaderModule=null,this.materialDataUniformBuffer.destroy(e),this.materialDataUniformBuffer=null}static destroyShader(e){Ha.renderShader.has(e)&&(Ha.renderShader.get(e).destroy(),Ha.renderShader.delete(e))}static getShader(e){return Ha.renderShader.get(e)}static createShader(e,t){let a=new Xe(e,t);return Ha.renderShader.set(a.instanceID,a),a.instanceID}}class kc extends Xe{constructor(){super("sky_vs_frag_wgsl","SkyGBuffer_fs"),this.passType=le.GI,this.setUniformVector3("eyesPos",new b),this.setUniformFloat("exposure",1),this.setUniformFloat("roughness",0);let e=this.shaderState;e.frontFace="ccw",e.cullMode=Nt.front,e.depthWriteEnabled=!1,e.depthCompare=ot.less}}class Ec extends Xe{transparency;constructor(){super("gbuffer_vs","gbuffer_fs"),this.setShaderEntry("VertMain","FragMain"),this.passType=le.GI,this.setUniformColor("baseColor",new J),this.setUniformColor("emissiveColor",new J),this.setUniformFloat("emissiveIntensity",1),this.setUniformFloat("normalScale",1),this.setUniformFloat("alphaCutoff",1),this.blendMode=me.NONE,this.setTexture("normalMap",_.res.normalTexture)}}class wc extends Xe{constructor(){super("shadowCastMap_vert","directionShadowCastMap_frag"),this.passType=le.SHADOW,this.setShaderEntry("main"),this.setUniformFloat("cameraFar",5e3),this.setUniformVector3("lightWorldPos",b.ZERO),this.shaderState.receiveEnv=!1,this.shaderState.castShadow=!1,this.shaderState.acceptShadow=!1,this.setDefine("USE_ALPHACUT",!0)}}class Rc extends Xe{constructor(){super("castPointShadowMap_vert","shadowCastMap_frag"),this.passType=le.POINT_SHADOW,this.setShaderEntry("main","main"),this.setUniformFloat("cameraFar",5e3),this.setUniformVector3("lightWorldPos",b.ZERO),this.shaderState.receiveEnv=!1,this.shaderState.castShadow=!1,this.shaderState.acceptShadow=!1,this.setDefine("USE_ALPHACUT",!0)}}class Ic extends Xe{constructor(){super("ZPass_shader_vs","ZPass_shader_vs"),this.passType=le.DEPTH,this.setShaderEntry("main"),this.useRz=!1;let e=this.shaderState;e.receiveEnv=!1}}class yi{static createGIPass(e,t){if(aa.hasMask(e.rendererMask,Qe.Sky)){if(!t.passShader.get(le.GI)){let r=t.getSubShaders(le.COLOR)[0],i=new kc;i.setTexture("baseMap",r.getTexture("baseMap")),i.cullMode=r.cullMode,i.frontFace=r.frontFace,t.addRenderPass(i,0),i.preCompile(e.geometry)}}else this.castGBufferPass(e,t)}static castGBufferPass(e,t){let a=t.getDefaultShaders();for(let r=0;r<a.length;r++){const i=a[r];let n=t.getSubShaders(le.GI);if(!n||n.length==0||n.length<r){let o=new Ec;o.setTexture("baseMap",i.getTexture("baseMap")),o.setTexture("normalMap",i.getTexture("normalMap")),o.setTexture("emissiveMap",i.getTexture("emissiveMap")),i.uniforms.baseColor&&o.setUniform("baseColor",i.getUniform("baseColor")),i.uniforms.envIntensity&&o.setUniform("envIntensity",i.getUniform("envIntensity")),i.uniforms.emissiveColor&&o.setUniform("emissiveColor",i.getUniform("emissiveColor")),i.uniforms.emissiveIntensity&&o.setUniform("emissiveIntensity",i.getUniform("emissiveIntensity")),i.uniforms.alphaCutoff&&o.setUniform("alphaCutoff",i.getUniform("alphaCutoff")),o.cullMode=i.cullMode,o.frontFace=i.frontFace,o.preCompile(e.geometry),t.addRenderPass(o)}}}static createShadowPass(e,t){let a=aa.hasMask(e.rendererMask,Qe.SkinnedMesh),r=e.geometry.hasAttribute(G.TANGENT),i=e.geometry.hasAttribute(sa.MORPH_POSITION_PREFIX+"0"),n=e.geometry.hasAttribute(sa.MORPH_NORMAL_PREFIX+"0"),o=t.getSubShaders(le.COLOR);for(let l=0;l<o.length;l++){const c=o[l];let f=t.getSubShaders(le.SHADOW);if(!f||f.length<l+1){let u=new wc;u.setTexture("baseMap",c.getTexture("baseMap")),u.setUniform("alphaCutoff",c.getUniform("alphaCutoff")),r&&u.setDefine("USE_TANGENT",r),a&&u.setDefine("USE_SKELETON",a),i&&u.setDefine("USE_MORPHTARGETS",i),n&&u.setDefine("USE_MORPHNORMALS",n),c.cullMode=="none"?u.shaderState.cullMode="none":c.cullMode=="back"?u.shaderState.cullMode="front":c.cullMode=="front"&&(u.shaderState.cullMode="back"),u.preCompile(e.geometry),t.addRenderPass(u)}let h=t.getSubShaders(le.POINT_SHADOW);if(!h||h.length<l+1){let u=new Rc;u.setTexture("baseMap",c.getTexture("baseMap")),u.setUniform("alphaCutoff",c.getUniform("alphaCutoff")),u.setDefine("USE_ALPHACUT",1);for(let g=0;g<1;g++)r&&u.setDefine("USE_TANGENT",r),a&&u.setDefine("USE_SKELETON",a),i&&u.setDefine("USE_MORPHTARGETS",i),n&&u.setDefine("USE_MORPHNORMALS",n),u.shaderState.cullMode="front",u.preCompile(e.geometry);t.addRenderPass(u)}}}static createDepthPass(e,t){let a=t.getSubShaders(le.COLOR),r=e.geometry.hasAttribute("TANGENT"),i=e.geometry.hasAttribute(sa.MORPH_POSITION_PREFIX+"0"),n=e.geometry.hasAttribute(sa.MORPH_NORMAL_PREFIX+"0"),o=aa.hasMask(e.rendererMask,Qe.SkinnedMesh);for(let l=0;l<a.length;l++){const c=a[l];let f=t.getSubShaders(le.DEPTH);if(!f&&c.shaderState.useZ&&(!f||f.length<l)){let h=new Ic;h.setTexture("baseMap",c.getTexture("baseMap")),r||h.setDefine("USE_TANGENT",r),o&&h.setDefine("USE_SKELETON",o),i&&h.setDefine("USE_MORPHTARGETS",i),n&&h.setDefine("USE_MORPHNORMALS",n),h.cullMode=c.cullMode,h.frontFace=c.frontFace,h.preCompile(e.geometry),t.addRenderPass(h)}}}static createReflectionPass(e,t){let a=t.getDefaultShaders();for(let o=0;o<a.length;o++){const l=a[o];let c=t.getSubShaders(le.REFLECTION);if(!c||c.length==0||c.length<o){let f=new Xe(l.vsName,l.fsName);f.vsEntryPoint=l.vsEntryPoint,f.fsEntryPoint=l.fsEntryPoint,f.passType=le.REFLECTION;for(const h in l.shaderState){var r=l.shaderState[h];f.shaderState[h]=r}for(const h in l.textures){var i=l.getTexture(h);f.setTexture(h,i)}for(const h in l.uniforms){var n=l.getUniform(h);f.setUniform(h,n)}for(const h in l.defineValue){var n=l.defineValue[h];f.setDefine(h,n)}f.setDefine("USE_CASTREFLECTION",!0),f.preCompile(e.geometry),t.addRenderPass(f)}}}}class dr{static _v1=new b;static _v2=new b;entities;box;subTrees=[];parent;level;static maxSplitLevel=6;static autoSplitLevel=3;index;uuid;constructor(e,t=0,a=null,r=0){this.parent=a,this.box=e.clone(),this.level=r,this.index=t,this.uuid=r+"_"+t,this.entities=new Map}tryInsertEntity(e){let t=e.renderer.object3D.bound;if(this.level==0||this.box.containsBox(t)){this.subTrees.length==0&&this.level<dr.maxSplitLevel&&this.splitTree();let a;if(this.subTrees.length>0){for(let r of this.subTrees)if(r.tryInsertEntity(e)){a=!0;break}}return a||e.enterNode(this),!0}return!1}splitTree(){if(this.subTrees.length==0){const e=dr._v1,t=this.box.extents.clone();let a=this.level+1,r=0;for(let i=0;i<2;i++)for(let n=0;n<2;n++)for(let o=0;o<2;o++){const l=new xe;this.box.min.add(e.set(i,n,o).multiply(t),l.min),l.min.add(t,l.max),l.setFromMinMax(l.min,l.max);let c=new dr(l,r++,this,a);this.subTrees.push(c)}}}__rayCastTempVector=new b;rayCasts(e,t){if(this.level==0||e.intersectBox(this.box,this.__rayCastTempVector)){this.entities.size>0&&t.push(...this.entities.values());for(let a of this.subTrees)a.rayCasts(e,t);return!0}return!1}frustumCasts(e,t){if(this.level==0||e.containsBox2(this.box)>0){if(this.entities.size>0)for(const a of this.entities.values())(this.level>dr.autoSplitLevel||e.containsBox2(a.renderer.object3D.bound)>0)&&t.push(a);for(let a of this.subTrees)a.frustumCasts(e,t);return!0}return!1}getRenderNode(e,t){if(this.level==0||e.containsBox2(this.box)>0){if(this.entities.size>0)for(const a of this.entities.values())(this.level>dr.autoSplitLevel||e.containsBox2(a.renderer.object3D.bound)>0)&&(a.renderer.renderOrder<3e3?t.opaqueList.push(a.renderer):a.renderer.renderOrder>=3e3&&t.transparentList.push(a.renderer));for(let a of this.subTrees)a.getRenderNode(e,t);return!0}return!1}boxCasts(e,t){if(e.intersectsBox(this.box)){this.entities.size>0&&t.push(...this.entities.values());for(let a of this.subTrees)a.boxCasts(e,t);return!0}return!1}clean(){for(let e of this.entities.values())e.leaveNode();return this.entities.clear(),this}}class Qc{_pool=[];_worldPosition=new b;_viewPosition=new b;_zSortList=[];pop(){return this._pool.pop()||{}}recycle(){for(let e of this._zSortList)e.z=0,e.userData=null,e.obj3d=null,this._pool.push(e);this._zSortList.length=0}sort(e,t,a,r){this._zSortList=[];for(let i of t){let n=this.pop();n.userData=i,n.obj3d=a(i),n.z=this.worldToCameraDepth(n.obj3d,e),this._zSortList.push(n)}this._zSortList.sort((i,n)=>i.z-n.z>0?1:-1),r||=[];for(let i of this._zSortList)r.push(i.userData);return this.recycle(),r}worldToCameraDepth(e,t){t||=e.transform.view3D.camera;let a=0;return t&&(this._worldPosition.copyFrom(e.transform.worldPosition),t.worldToScreenPoint(this._worldPosition,this._viewPosition),a=this._viewPosition.z),a}}let Tc=new Qc;var Ci=(s=>(s[s.None=2]="None",s[s.StaticBatch=4]="StaticBatch",s[s.DynamicBatch=8]="DynamicBatch",s[s.Hiden=16]="Hiden",s))(Ci||{});class ps{static addMask(e,t){return e|t}static removeMask(e,t){return e&~t}static hasMask(e,t){return(e&t)!=0}}class Mc{opaqueList=[];transparentList=[];sky;clean(){this.opaqueList.length=0,this.transparentList.length=0}}class Nc{renderGroup;constructor(){this.renderGroup=new Map}collect_add(e){let t="",a="";t+=e.geometry.instanceID;for(let i=0;i<e.materials.length;i++){const n=e.materials[i];a+=n.shader.getDefaultColorShader().shaderVariant}let r=t+a;this.renderGroup.has(r)||this.renderGroup.set(r,{bundleMap:new Map,key:r,renderNodes:[]}),this.renderGroup.get(r).renderNodes.indexOf(e)==-1&&this.renderGroup.get(r).renderNodes.push(e)}}class Pc{renderShaderUpdateList=new Map;renderNodeList=new Map;collect_add(e){let t=e.transform.view3D;t&&e.materials&&e.materials.forEach(a=>{let r=this.renderShaderUpdateList.get(t);r||(r=new Map,this.renderShaderUpdateList.set(t,r));let i=this.renderNodeList.get(t);i||(i=new Map,this.renderNodeList.set(t,i)),i.set(e.instanceID,e);let n=a.getAllPass();for(let o=0;o<n.length;o++){const l=n[o];let c=`${e.geometry.instanceID+l.instanceID}`,f=r.get(c);f||(f=new Map,r.set(c,f)),f.set(e.instanceID,e)}})}collect_remove(e){let t=e.transform.view3D;if(t&&e.materials){let a=this.renderShaderUpdateList.get(t);a&&e.materials.forEach(r=>{let i=r.getAllPass();for(let n=0;n<i.length;n++){const o=i[n];let l=`${e.geometry.instanceID+o.instanceID}`;a.delete(l)}})}}}class K{static _instance;_sceneLights;_sceneGIProbes;_op_RenderNodes;_tr_RenderNodes;_octreeRenderNodes;_reflections;_graphics;_op_renderGroup;_tr_renderGroup;_renderShaderCollect;state={giLightingChange:!0};sky;_collectInfo;rendererOctree;static get instance(){return this._instance||(this._instance=new K),this._instance}constructor(){this._sceneLights=new Map,this._sceneGIProbes=new Map,this._op_RenderNodes=new Map,this._tr_RenderNodes=new Map,this._reflections=new Map,this._graphics=[],this._op_renderGroup=new Map,this._tr_renderGroup=new Map,this._collectInfo=new Mc,this._renderShaderCollect=new Pc,this._octreeRenderNodes=new Map}getPashList(e,t){if(t.renderOrder<3e3)return this._op_RenderNodes.get(e);if(t.renderOrder>=3e3)return this._tr_RenderNodes.get(e)}sortRenderNode(e,t){for(let a=e.length-1;a>0;a--)if(e[a].renderOrder<t.renderOrder){e.push(t);return}e.push(t)}addRenderNode(e,t){if(!e)return;let a=t.renderOrder>=3e3;if(t.hasMask(Qe.Sky))this.sky=t;else if(t.hasMask(Qe.Reflection)){this.removeRenderNode(e,t);let r=this._reflections.get(e);r||(r=[],this._reflections.set(e,r),r.push(t)),r.includes(t)||r.push(t)}else if(t.hasMask(Qe.Graphic3D))this._graphics.indexOf(t)==-1&&this._graphics.push(t);else if(ps.hasMask(t.renderLayer,Ci.None)){this.removeRenderNode(e,t);let r=a?this._tr_RenderNodes:this._op_RenderNodes;r.has(e)||r.set(e,[]),r.get(e).push(t),_.setting.occlusionQuery.octree&&t.attachSceneOctree(this.getOctree(e));let i=this.getPashList(e,t);i.indexOf(t)==-1&&this.sortRenderNode(i,t)}else{this.removeRenderNode(e,t);let r=a?this._tr_renderGroup:this._op_renderGroup;r.has(e)||r.set(e,new Nc),r.get(e).collect_add(t)}t.object3D.renderNode=t,this._renderShaderCollect.collect_add(t)}getOctree(e){let t,a=_.setting.occlusionQuery.octree;if(a&&(t=this._octreeRenderNodes.get(e),!t)){let r=new b(a.x,a.y,a.z),i=new b(a.width,a.height,a.depth),n=new xe(r,i);t=new dr(n),this._octreeRenderNodes.set(e,t)}return t}removeRenderNode(e,t){if(t.detachSceneOctree(),t.hasMask(Qe.Sky))this.sky=null;else if(t.hasMask(Qe.Reflection)){let a=this._reflections.get(e);if(a){let r=a.indexOf(t);r!=-1&&a.splice(r,1)}}else if(ps.hasMask(t.renderLayer,Ci.None)){let a=this.getPashList(e,t);if(a){let r=a.indexOf(t);r!=-1&&a.splice(r,1)}}this._renderShaderCollect.collect_remove(t)}addLight(e,t){if(!this._sceneLights.has(e))this._sceneLights.set(e,[t]);else{let a=this._sceneLights.get(e);if(a.length>=_.setting.light.maxLight){console.warn("Alreay meet maxmium light number:",_.setting.light.maxLight);return}a.indexOf(t)!=-1||a.push(t)}}removeLight(e,t){if(this._sceneLights.has(e)){let a=this._sceneLights.get(e),r=a.indexOf(t);r!=-1&&a.splice(r,1)}}getLights(e){let t=this._sceneLights.get(e);return t||[]}addGIProbe(e,t){this._sceneGIProbes.has(e)?this._sceneGIProbes.get(e).push(t):this._sceneGIProbes.set(e,[t])}removeGIProbe(e,t){if(this._sceneGIProbes.has(e)){let a=this._sceneGIProbes.get(e),r=a.indexOf(t);r!=-1&&a.splice(r,1)}}getProbes(e){let t=this._sceneGIProbes.get(e);return t||[]}getReflections(e){let t=this._reflections.get(e);return t||[]}autoSortRenderNodes(e){let t=this._tr_RenderNodes.get(e);if(!t)return;let a=!1;for(const r of t)if(r.isRenderOrderChange||r.needSortOnCameraZ){a=!0;break}if(a){for(const r of t){let i=r.renderOrder;if(r.needSortOnCameraZ){let n=Tc.worldToCameraDepth(r.object3D);n=1-Math.max(0,Math.min(1,n)),i+=n}r.__renderOrder=i,r.isRenderOrderChange=!1}t.sort((r,i)=>r.__renderOrder>i.__renderOrder?1:-1)}return this}getRenderNodes(e,t){if(this.autoSortRenderNodes(e),this._collectInfo.clean(),this._collectInfo.sky=this.sky,_.setting.occlusionQuery.octree)this.rendererOctree=this.getOctree(e),this.rendererOctree.getRenderNode(t.frustum,this._collectInfo);else{let a=this._op_RenderNodes.get(e);a&&(this._collectInfo.opaqueList=a.concat());let r=this._tr_RenderNodes.get(e);r&&(this._collectInfo.transparentList=r.concat())}return this._collectInfo}getOpRenderGroup(e){return this._op_renderGroup.get(e)}getTrRenderGroup(e){return this._tr_renderGroup.get(e)}getGraphicList(){return this._graphics}getRenderShaderCollect(e){return this._renderShaderCollect.renderShaderUpdateList.get(e)}}class Vc{renderer;owner;uuid;constructor(e){this.renderer=e,this.uuid=e.object3D.instanceID}leaveNode(){this.owner&&(this.owner.entities.delete(this.uuid),this.owner=null)}enterNode(e){this.owner&&this.leaveNode(),this.owner=e,e.entities.set(this.uuid,this)}update(e){return this.owner?.tryInsertEntity(this)||(this.leaveNode(),e.tryInsertEntity(this)),this.owner}}var n2=Object.defineProperty,s2=Object.getOwnPropertyDescriptor,As=(s,e,t,a)=>{for(var r=s2(e,t),i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(e,t,r)||r);return r&&n2(e,t,r),r};class Ia extends qe{instanceCount=0;lodLevel=0;alwaysRender=!1;instanceID;drawType=0;_geometry;_materials=[];_castShadow=!0;_castReflection=!0;_castGI=!1;_rendererMask=Qe.Default;_inRenderer=!1;_readyPipeline=!1;_combineShaderRefection;_ignoreEnvMap;_ignorePrefilterMap;__renderOrder=0;_renderOrder=0;_passInit=new Map;isRenderOrderChange;needSortOnCameraZ;isRecievePostEffectUI;_octreeBinder;_renderLayer=Ci.None;_computes;init(e){this.renderOrder=0,this.rendererMask=Qe.Default,this.instanceID=Hn().toString(),this._computes=[]}attachSceneOctree(e){this._octreeBinder={octree:e,entity:new Vc(this)},this.transform.eventDispatcher.addEventListener(zt.LOCAL_ONCHANGE,this.updateOctreeEntity,this)}detachSceneOctree(){this._octreeBinder&&(this._octreeBinder.entity?.leaveNode(),this.transform.eventDispatcher.removeEventListener(zt.LOCAL_ONCHANGE,this.updateOctreeEntity,this),this._octreeBinder=null)}updateOctreeEntity(e){this._octreeBinder?.entity?.update(this._octreeBinder.octree)}copyComponent(e){return super.copyComponent(e),this.geometry=e._geometry,this.materials=e._materials.slice(),this.drawType=e.drawType,this.alwaysRender=e.alwaysRender,this.needSortOnCameraZ=e.needSortOnCameraZ,this.isRenderOrderChange=e.isRenderOrderChange,this.castShadow=e.castShadow,this.castGI=e.castGI,this.rendererMask=e.rendererMask,this.isRecievePostEffectUI=e.isRecievePostEffectUI,this}get renderLayer(){return this._renderLayer}set renderLayer(e){this._renderLayer=e}get geometry(){return this._geometry}set geometry(e){this._geometry!=e&&(this._readyPipeline=!1,this._geometry&&Ce.getInstance().detached(this._geometry,this),e&&Ce.getInstance().attached(e,this)),this._geometry=e}addMask(e){this._rendererMask=aa.addMask(this.rendererMask,e)}removeMask(e){this._rendererMask=aa.removeMask(this.rendererMask,e)}hasMask(e){return aa.hasMask(this.rendererMask,e)}get rendererMask(){return this._rendererMask}set rendererMask(e){this._rendererMask=e}get renderOrder(){return this._renderOrder}set renderOrder(e){e!=this._renderOrder&&(this.isRenderOrderChange=!0,this.__renderOrder=e),this._renderOrder=e}get materials(){return this._materials}set materials(e){this._readyPipeline=!1;for(let a=0;a<this._materials.length;a++){let r=this._materials[a];Ce.getInstance().detached(r,this),r.shader&&r.shader.computes&&this.removeComputes(r.shader.computes)}for(let a=0;a<e.length;a++){let r=e[a];Ce.getInstance().attached(r,this),r.shader&&r.shader.computes&&this.addComputes(r.shader.computes)}this._materials=e;let t=0;for(let a=0;a<e.length;a++){const n=e[a].getPass(le.COLOR)[0];n.shaderState.transparent&&(t=t>n.renderOrder?t:n.renderOrder)}this.renderOrder=t,this._readyPipeline||this.initPipeline()}addComputes(e){this._computes.push(...e)}removeComputes(e){for(const t of e){let a=this._computes.indexOf(t);a!=-1&&this._computes.splice(a,1)}}addRendererMask(e){this._rendererMask=aa.addMask(this._rendererMask,e)}removeRendererMask(e){this._rendererMask=aa.removeMask(this._rendererMask,e)}onEnable(){this._readyPipeline||this.initPipeline(),K.instance.addRenderNode(this.transform.scene3D,this),this.updateOctreeEntity()}onDisable(){this._enable=!1,K.instance.removeRenderNode(this.transform.scene3D,this),super.onDisable?.()}selfCloneMaterials(e){let t=[];for(let a=0,r=this.materials.length;a<r;a++){const i=this.materials[a].clone();t.push(i)}return this.materials=t,this._readyPipeline=!1,this.initPipeline(),this}initPipeline(){if(this._geometry&&this._materials.length>0){for(let t=0;t<this._materials.length;t++){let r=this._materials[t].getPass(le.COLOR);for(let i=0;i<r.length;i++){const n=r[i];n.shaderReflection||n.preCompile(this._geometry),this._geometry.generate(n.shaderReflection)}this.object3D.bound=this._geometry.bounds.clone()}this._readyPipeline=!0;let e=0;for(let t=0;t<this.materials.length;t++){const i=this.materials[t].getPass(le.COLOR)[0];i.renderOrder>=3e3?e=e>i.renderOrder?e:i.renderOrder:e=Math.max(e-3e3,0),this.castNeedPass()}this.renderOrder=e,this.enable&&this.transform&&this.transform.scene3D&&K.instance.addRenderNode(this.transform.scene3D,this)}}castNeedPass(){if(this.castGI)for(let t=0;t<this.materials.length;t++){const a=this.materials[t];yi.createGIPass(this,a.shader)}for(let t=0;t<this.materials.length;t++){const a=this.materials[t];a.castShadow&&yi.createShadowPass(this,a.shader)}if(this.castReflection)for(let t=0;t<this.materials.length;t++){const a=this.materials[t];a.castReflection&&yi.createReflectionPass(this,a.shader)}if(!aa.hasMask(this.rendererMask,Qe.IgnoreDepthPass)&&_.setting.render.zPrePass)for(let t=0;t<this.materials.length;t++){const a=this.materials[t];yi.createDepthPass(this,a.shader)}else for(let t=0;t<this.materials.length;t++)this.materials[t].shader.removeShaderByIndex(le.DEPTH,0)}get castShadow(){return this._castShadow}set castShadow(e){this._castShadow=e}get castGI(){return this._castGI}set castGI(e){this._castGI=e}get castReflection(){return this._castReflection}set castReflection(e){this._castReflection=e}renderPass(e,t,a){if(!this._geometry)return;let r=this,i=r.transform._worldMatrix;const n=Math.max(r.materials.length,r._geometry.subGeometries.length);for(let o=0;o<n;o++){const l=o>=r.materials.length?r.materials[0]:r.materials[o];if(!l||!l.enable)continue;let c=l.getPass(t);if(!(!c||c.length==0)){F.bindGeometryBuffer(a.encoder,r._geometry),lt.viewCount_vertex(e,le[t],r._geometry.vertexCount);for(let f=0;f<c.length;f++){if(!c||c.length==0)continue;const u=c[f];if(u.pipeline){u.shaderState.splitTexture&&(a.endRenderPass(),Et.WriteSplitColorTexture(r.instanceID),a.beginOpaqueRenderPass(),F.bindCamera(a.encoder,e.camera),F.bindGeometryBuffer(a.encoder,r._geometry)),F.bindPipeline(a.encoder,u)&<.viewCount_pipeline(e,le[t]);let p=(o>=r._geometry.subGeometries.length?r._geometry.subGeometries[0]:r._geometry.subGeometries[o]).lodLevels[r.lodLevel];r.instanceCount>0?(lt.viewCount_instance(e,le[t],r.instanceCount),lt.viewCount_indices(e,le[t],p.indexCount),lt.viewCount_tri(e,le[t],p.indexCount/3*r.instanceCount),F.drawIndexed(a.encoder,p.indexCount,r.instanceCount,p.indexStart,0,0)):(lt.viewCount_indices(e,le[t],p.indexCount),lt.viewCount_tri(e,le[t],p.indexCount/3),F.drawIndexed(a.encoder,p.indexCount,1,p.indexStart,0,i.index)),lt.viewCount_draw(e,le[t])}}}}}renderPass2(e,t,a,r,i,n=!1){if(!this.enable||!this._geometry)return;let o=this,l=o.object3D.transform._worldMatrix;for(let c=0;c<this.materials.length;c++){const f=this.materials[c];if(!f.castShadow&&t==le.SHADOW)continue;let h=f.getPass(t);if(!h||h.length==0)return;if(this.drawType==2)for(let u of h)u.pipeline&&(F.bindPipeline(i,u),F.draw(i,6,1,0,l.index));else{F.bindGeometryBuffer(i,o._geometry);for(let u of h)if(u.pipeline){F.bindPipeline(i,u);let p=o._geometry.subGeometries[c].lodLevels[o.lodLevel];F.drawIndexed(i,p.indexCount,1,p.indexStart,0,l.index)}}}}recordRenderPass2(e,t,a,r,i,n=!1){if(!this.enable)return;let o=this;for(let l=0;l<this.materials.length;l++){let f=this.materials[l].getPass(t);if(!f||f.length==0)return;let h=o.object3D.transform._worldMatrix;for(let u=0;u<f.length;u++){const g=f[u];F.bindPipeline(i,g);let D=o._geometry.subGeometries[l].lodLevels[o.lodLevel];F.drawIndexed(i,D.indexCount,1,D.indexStart,0,h.index)}}}noticeShaderChange(){this.enable&&(this.onEnable(),this._passInit.forEach((e,t)=>{this._passInit.set(t,!1)}))}preInit(e){return this._passInit.get(e)}nodeUpdate(e,t,a,r){let i=this,n=e.scene.envMap;for(let o=0;o<i.materials.length;o++){let c=i.materials[o].getPass(t);if(c)for(let f=0;f<c.length;f++){const u=c[f];if(u.shaderState.splitTexture){let v=Et.CreateSplitTexture(i.instanceID);u.setTexture("splitTexture_Map",v)}!i._ignoreEnvMap&&u.envMap!=n&&u.setTexture("envMap",n),u.prefilterMap||u.setTexture("prefilterMap",n);let g=ve.getReflectionEntries(e.scene);if(!u.reflectionMap&&g&&g.reflectionMap&&(u.setTexture("reflectionMap",g.reflectionMap),u.setStorageBuffer("reflectionBuffer",g.storageGPUBuffer)),u.pipeline){u.apply(i._geometry,a,()=>i.noticeShaderChange());continue}let A=_.res.getTexture("BRDFLUT");u.setTexture("brdflutMap",A);let m=_.getRenderJob(e).shadowMapPassRenderer;m&&m.depth2DArrayTexture&&u.setTexture("shadowMap",_.getRenderJob(e).shadowMapPassRenderer.depth2DArrayTexture);let p=_.getRenderJob(e).pointLightShadowRenderer;p&&p.cubeArrayTexture&&u.setTexture("pointShadowMap",p.cubeArrayTexture);let D=Aa.iesTexture;D&&u.setTexture("iesTextureArrayMap",D),a.irradianceBuffer&&a.irradianceBuffer.length>0&&(u.setTexture("irradianceMap",a.irradianceBuffer[0]),u.setTexture("irradianceDepthMap",a.irradianceBuffer[1]));let B=ve.getLightEntries(e.scene);B&&(u.setStorageBuffer("lightBuffer",B.storageGPUBuffer),B.irradianceVolume&&u.setUniformBuffer("irradianceData",B.irradianceVolume.irradianceVolumeBuffer)),r&&(u.setStorageBuffer("clustersUniform",r.clustersUniformBuffer),u.setStorageBuffer("lightAssignBuffer",r.lightAssignBuffer),u.setStorageBuffer("assignTable",r.assignTableBuffer),u.setStorageBuffer("clusterBuffer",r.clusterBuffer)),u.apply(i._geometry,a),this._passInit.set(t,!0)}}}beforeDestroy(e){this._geometry&&(Ce.getInstance().detached(this._geometry,this),Ce.getInstance().hasReference(this._geometry)||this._geometry.destroy(e));for(let t=0;t<this._materials.length;t++){const a=this._materials[t];a&&(Ce.getInstance().detached(a,this),Ce.getInstance().hasReference(a)||a.destroy(e))}this._computes&&(this._computes.length=0),this.detachSceneOctree(),super.beforeDestroy(e)}destroy(e){super.destroy(e),this._geometry=void 0,this._materials.length=0,this._computes=null,this._passInit&&(this._passInit.clear(),this._passInit=null),this._combineShaderRefection=void 0}}As([jr],Ia.prototype,"materials"),As([jr],Ia.prototype,"castShadow"),As([jr],Ia.prototype,"castGI");class Dt{instanceID;name;enable=!0;_defaultSubShader;_shader;_isDestroyed=!1;constructor(){this.instanceID=Gt()}set shader(e){this._shader=e,this._defaultSubShader=e.getDefaultShaders()[0]}get shader(){return this._shader}get doubleSide(){return this._defaultSubShader.doubleSide}set doubleSide(e){this._defaultSubShader.doubleSide=e}get castShadow(){return this._defaultSubShader.shaderState.castShadow}set castShadow(e){let t=this._defaultSubShader.shaderState;e!=t.castShadow&&(t.castShadow=e)}get acceptShadow(){return this._defaultSubShader.shaderState.acceptShadow}set acceptShadow(e){let t=this._defaultSubShader.shaderState;t.acceptShadow!=e&&(t.acceptShadow=e,this._defaultSubShader.noticeShaderChange(),this._defaultSubShader.noticeValueChange())}get castReflection(){return this._defaultSubShader.shaderState.castReflection}set castReflection(e){this._defaultSubShader.shaderState.castReflection=e}get blendMode(){return this._defaultSubShader.blendMode}set blendMode(e){this._defaultSubShader.blendMode=e}get depthCompare(){return this._defaultSubShader.depthCompare}set depthCompare(e){this._defaultSubShader.depthCompare=e;for(let t of this._shader.passShader.values())for(let a of t)a.depthCompare=e}get transparent(){return this._defaultSubShader.shaderState.transparent}set transparent(e){this._defaultSubShader.shaderState.transparent=e,e&&(this._defaultSubShader.renderOrder=3e3)}get cullMode(){return this._defaultSubShader.cullMode}set cullMode(e){if(this._defaultSubShader.cullMode!=e){for(let t of this._shader.passShader.values())for(let a of t)a.cullMode=e;this._defaultSubShader.cullMode=e}}get depthWriteEnabled(){return this._defaultSubShader.depthWriteEnabled}set depthWriteEnabled(e){this._defaultSubShader.depthWriteEnabled=e}set useBillboard(e){this._defaultSubShader.setDefine("USE_BILLBOARD",e)}get topology(){return this._defaultSubShader.topology}set topology(e){this._defaultSubShader.topology=e}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}getPass(e){return this._shader.getSubShaders(e)}getAllPass(){return this._shader.getSubShaders(le.COLOR)}clone(){let e=new Dt;return e.shader=this.shader.clone(),e}destroy(e){this._isDestroyed||(this.name=null,this.instanceID=null,this._shader&&(this._shader.destroy(e),this._shader=null),this._defaultSubShader=null,this._isDestroyed=!0)}setDefine(e,t){this.shader.setDefine(e,t)}setTexture(e,t){this._shader.setTexture(e,t)}setStorageBuffer(e,t){this._shader.setStorageBuffer(e,t)}setUniformBuffer(e,t){this._shader.setStorageBuffer(e,t)}setUniformFloat(e,t){this._shader.setUniformFloat(e,t)}setUniformVector2(e,t){this._shader.setUniformVector2(e,t)}setUniformVector3(e,t){this._shader.setUniformVector3(e,t)}setUniformVector4(e,t){this._shader.setUniformVector4(e,t)}setUniformColor(e,t){this._shader.setUniformColor(e,t)}getUniformFloat(e){return this._shader.getUniform(e).data}getUniformV2(e){return this._shader.getUniformVector2(e)}getUniformV3(e){return this._shader.getUniformVector3(e)}getUniformV4(e){return this._shader.getUniformVector4(e)}getUniformColor(e){return this._shader.getUniformColor(e)}getTexture(e){return this._shader.getTexture(e)}getStorageBuffer(e){return this._shader.getStorageBuffer(e)}getStructStorageBuffer(e){return this._shader.getStructStorageBuffer(e)}getUniformBuffer(e){return this._shader.getUniformBuffer(e)}applyUniform(){this._shader.applyUniform()}}const Oc=`
|
|
5746
5746
|
#include "GlobalUniform"
|
|
5747
5747
|
|
|
5748
5748
|
// Constants
|
|
@@ -5992,7 +5992,7 @@ struct InstanceData {
|
|
|
5992
5992
|
o.color = evalSplat(vTexCoord, vColor);
|
|
5993
5993
|
return o;
|
|
5994
5994
|
}
|
|
5995
|
-
`;class gt{computes;passShader;constructor(){this.computes=[],this.passShader=new Map}addRenderPass(e,t=-1){let a=this.passShader.get(e.passType)||[];t==-1?a.push(e):a.splice(t,-1,e),this.passShader.set(e.passType,a)}removeShader(e,t=-1){let a=this.passShader.get(e.passType);if(a)if(t==-1){let r=a.indexOf(e);r!=-1&&a.splice(r)}else a.splice(t,1)}removeShaderByIndex(e,t=-1){let a=this.passShader.get(e);a&&(t==-1?this.passShader.delete(e):a.splice(t,1))}getSubShaders(e){return this.passShader.get(e)||[]}hasSubShaders(e){return this.passShader.get(e).length>0}getDefaultShaders(){return this.passShader.get(le.COLOR)}getDefaultColorShader(){return this.passShader.get(le.COLOR)[0]}setDefine(e,t){for(const a of this.passShader)for(const r of a[1])r.setDefine(e,t)}hasDefine(e){for(const t of this.passShader)for(const a of t[1]){let r=a.hasDefine(e);if(r)return r}return!1}deleteDefine(e){for(const t of this.passShader)for(const a of t[1])a.deleteDefine(e)}setUniform(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniform(e,t)}setUniformFloat(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformFloat(e,t)}setUniformVector2(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformVector2(e,t)}setUniformVector3(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformVector3(e,t)}setUniformVector4(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformVector4(e,t)}setUniformColor(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformColor(e,t)}getUniform(e){return this.getDefaultColorShader().getUniform(e)}getUniformFloat(e){return this.getDefaultColorShader().getUniformFloat(e)}getUniformVector2(e){return this.getDefaultColorShader().getUniformVector2(e)}getUniformVector3(e){return this.getDefaultColorShader().getUniformVector3(e)}getUniformVector4(e){return this.getDefaultColorShader().getUniformVector4(e)}getUniformColor(e){return this.getDefaultColorShader().getUniformColor(e)}setTexture(e,t){for(const a of this.passShader)for(const r of a[1])r.setTexture(e,t);this.setDefine(`USE_${e.toLocaleUpperCase()}`,!0)}getTexture(e){return this.getDefaultColorShader().textures[e]}setUniformBuffer(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformBuffer(e,t)}getUniformBuffer(e){return this.getDefaultColorShader().getBuffer(e)}setStorageBuffer(e,t){for(const a of this.passShader)for(const r of a[1])r.setStorageBuffer(e,t)}getStorageBuffer(e){return this.getDefaultColorShader().getBuffer(e)}setStructStorageBuffer(e,t){for(const a of this.passShader)for(const r of a[1])r.setStructStorageBuffer(e,t)}getStructStorageBuffer(e){return this.getDefaultColorShader().getBuffer(e)}noticeValueChange(){for(const e of this.passShader)for(const t of e[1])t.noticeValueChange()}destroy(e){for(const t of this.passShader)for(const a of t[1])a.destroy(e);this.passShader.clear(),this.passShader=null,this.computes=null}clone(){let e=new gt,t=this.getDefaultShaders();for(const a of t)e.addRenderPass(a);return e}applyUniform(){for(const e of this.passShader)for(const t of e[1])t.applyUniform()}}var o2=Object.getOwnPropertyDescriptor,l2=(s,e,t,a)=>{for(var r=a>1?void 0:a?o2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.GSplatShader=class extends gt{constructor(){super();const e=new Xe("gsplat_vs_dc","gsplat_fs_dc");e.passType=le.COLOR,e.setShaderEntry("VertMain","FragMain"),e.topology=sn.triangle_list,e.depthWriteEnabled=!1,e.cullMode=Nt.none,e.shaderState.transparent=!0,e.shaderState.blendMode=me.NORMAL,e.shaderState.writeMasks=[15,15],e.shaderState.castReflection=!1,this.addRenderPass(e),this.setDefault()}setDefault(){const e=this.getDefaultColorShader(),t=new R;e.setUniform("modelMatrix",t.rawData),e.setUniform("pixelCull",new Float32Array([2,0,0,0]))}},d.GSplatShader=l2([Ia(d.GSplatShader,"GSplatShader")],d.GSplatShader);class Gc extends Dt{_pixelCullArray=new Float32Array(4);constructor(){super(),Y.register("gsplat_vs_dc",Oc),Y.register("gsplat_fs_dc",Lc),this.shader=new d.GSplatShader}setSplatTextures(e,t,a,r,i){const n=this.shader.getDefaultColorShader();n.setTexture("splatColor",e),n.setTexture("transformA",t),n.setTexture("transformB",a),n.setUniformArray("tex_params",r),i&&n.setTexture("splatOrder",i),n.shaderState.depthCompare=ot.less}setTransformMatrix(e){this.shader.getDefaultColorShader().setUniform("modelMatrix",e.rawData)}setPixelCulling(e,t,a=0,r=128){this._pixelCullArray[0]=e,this._pixelCullArray[1]=t,this._pixelCullArray[2]=a,this._pixelCullArray[3]=r,this.shader.getDefaultColorShader().setUniform("pixelCull",this._pixelCullArray)}}class mn extends ja{node;constructor(e){super(),this.bufferType=ga.VertexGPUBuffer,this.createVertexBuffer(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|GPUBufferUsage.VERTEX,e)}createVertexBuffer(e,t){let a=w.device;this.byteSize=t*Float32Array.BYTES_PER_ELEMENT,this.usage=e,this.buffer&&this.destroy(),this.buffer=a.createBuffer({label:"VertexGPUBuffer",size:this.byteSize,usage:e,mappedAtCreation:!1}),this.memory=new sr,this.memoryNodes=new Map,this.memory.allocation(this.byteSize),this.node=this.memory.allocation_node(this.byteSize)}}var Ft=(s=>(s[s.split=0]="split",s[s.compose=1]="compose",s[s.compose_bin=2]="compose_bin",s))(Ft||{});class zc{vertexCount=0;vertexGPUBuffer;geometryType=Ft.compose;_vertexBufferLayouts;_attributeSlotLayouts;_attributeLocation;constructor(){this._vertexBufferLayouts=[],this._attributeLocation={},this._attributeSlotLayouts=[]}get vertexBufferLayouts(){return this._vertexBufferLayouts}createVertexBuffer(e,t){switch(this.geometryType){case Ft.split:this.createSplitVertexBuffer(e,t);break;case Ft.compose:this.createComposeVertexBuffer(e,t);break;case Ft.compose_bin:this.createComposBinVertexBuffer(e,t);break}}createSplitVertexBuffer(e,t){let a=0;for(let r=0;r<t.attributes.length;r++){const i=t.attributes[r];if(i.name=="index")continue;this._attributeLocation[i.name]=i.location;let n={name:i.name,format:i.format,offset:0,shaderLocation:i.location,stride:lr[i.format]};this._attributeSlotLayouts[i.location]=[n];let o=e.get(i.name);o||(o={attribute:i.name,data:new Float32Array(i.size*this.vertexCount)},e.set(i.name,o));let l=o.data.length/n.stride;this.vertexCount!=0&&this.vertexCount!=l&&console.error(" vertex count not match attribute count"),this.vertexCount=l,this._vertexBufferLayouts[i.location]={name:i.name,arrayStride:i.size*4,stepMode:"vertex",attributes:this._attributeSlotLayouts[i.location],offset:a*4,size:this.vertexCount*i.size*4},a+=this.vertexCount*i.size}this.vertexGPUBuffer=new mn(a)}createComposeVertexBuffer(e,t){this._attributeSlotLayouts[0]=[];let a=0;for(let r=0;r<t.attributes.length;r++){const i=t.attributes[r];if(i.name=="index"||i.type=="builtin")continue;this._attributeLocation[i.name]=i.location;let n={name:i.name,format:i.format,offset:a*4,shaderLocation:i.location,stride:lr[i.format]};this._attributeSlotLayouts[0][i.location]=n;let o=e.get(i.name);if(o||(o={attribute:i.name,data:new Float32Array(i.size*this.vertexCount)},e.set(i.name,o)),o.data){let l=o.data.length/n.stride;this.vertexCount!=0&&this.vertexCount!=l&&console.error(" vertex count not match attribute count"),this.vertexCount=l}a+=i.size}this._vertexBufferLayouts[0]={name:"composeStruct",arrayStride:a*4,stepMode:"vertex",attributes:this._attributeSlotLayouts[0],offset:0,size:this.vertexCount*a*4},this.vertexGPUBuffer=new mn(this.vertexCount*a)}createComposBinVertexBuffer(e,t){this._attributeSlotLayouts[0]=[];let a=0;for(let n=0;n<t.attributes.length;n++){const o=t.attributes[n];if(o.name=="index"||o.type=="builtin")continue;this._attributeLocation[o.name]=o.location;let l={name:o.name,format:o.format,offset:a*4,shaderLocation:o.location,stride:lr[o.format]};this._attributeSlotLayouts[0][o.location]=l;let c=e.get(o.name);if(c||(c={attribute:o.name,data:new Float32Array(o.size*this.vertexCount)},e.set(o.name,c)),c.data){let f=c.data.length/l.stride;this.vertexCount!=0&&this.vertexCount!=f&&console.error(" vertex count not match attribute count"),this.vertexCount=f}a+=o.size}let i=e.get(G.all).data.length/a;this.vertexCount=i,this._vertexBufferLayouts[0]={name:"composeStruct",arrayStride:a*4,stepMode:"vertex",attributes:this._attributeSlotLayouts[0],offset:0,size:this.vertexCount*a*4},this.vertexGPUBuffer=new mn(this.vertexCount*a)}upload(e,t){if(this.vertexGPUBuffer){switch(this.geometryType){case Ft.split:{let a=this._attributeLocation[e],r=this._vertexBufferLayouts[a];this.vertexGPUBuffer.node.setFloat32Array(r.offset/4,t.data)}break;case Ft.compose:for(let a=0;a<this.vertexCount;a++){const r=this._attributeSlotLayouts[0][this._attributeLocation[e]];for(let i=0;i<r.stride;i++){let n=t.data[a*r.stride+i],o=a*(this._vertexBufferLayouts[0].arrayStride/4)+r.offset/4+i;this.vertexGPUBuffer.node.setFloat(n,o)}}break;case Ft.compose_bin:this.vertexGPUBuffer.node.setFloat32Array(0,t.data);break}this.vertexGPUBuffer?.apply()}}updateAttributes(e){switch(this.geometryType){case Ft.split:for(let t=0;t<this._vertexBufferLayouts.length;t++){const a=this._vertexBufferLayouts[t];let r=e.get(a.name);this.vertexGPUBuffer.node.setFloat32Array(a.offset/4,r.data)}break;case Ft.compose:for(let t=0;t<this.vertexCount;t++)this._attributeSlotLayouts.forEach(a=>{for(let r=0;r<a.length;r++){const i=a[r];let n=e.get(i.name);for(let o=0;o<i.stride;o++){let l=n.data[t*i.stride+o],c=t*(this._vertexBufferLayouts[0].arrayStride/4)+i.offset/4+o;this.vertexGPUBuffer.node.setFloat(l,c)}}});break;case Ft.compose_bin:{let t=e.get(G.all);this.vertexGPUBuffer.node.setFloat32Array(0,t.data)}break}this.vertexGPUBuffer.apply()}compute(){}destroy(e){this.vertexCount=null,this.geometryType=null,this._vertexBufferLayouts=null,this._attributeSlotLayouts=null,this._attributeLocation=null,this.vertexGPUBuffer&&this.vertexGPUBuffer.destroy(e),this.vertexGPUBuffer=null}}class Wc extends ja{indicesNode;constructor(e){super(),this.bufferType=ga.IndicesGPUBuffer,this.createIndicesBuffer(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|GPUBufferUsage.INDEX|GPUBufferUsage.INDIRECT,e)}createIndicesBuffer(e,t){let a=w.device;if(this.byteSize=t.length*4,this.usage=e,this.buffer&&this.destroy(),this.buffer=a.createBuffer({label:"IndicesGPUBuffer",size:this.byteSize,usage:e,mappedAtCreation:!1}),this.memory=new sr,this.memoryNodes=new Map,this.memory.allocation(this.byteSize),t){this.indicesNode=this.memory.allocation_node(t.length*4);const r=t.buffer instanceof ArrayBuffer?t.buffer:new Uint8Array(t.buffer).buffer;this.indicesNode.setArrayBuffer(0,r),this.apply()}}}class Jc{uuid="";name;indicesGPUBuffer;indicesFormat="uint16";indicesCount=0;constructor(){}createIndicesBuffer(e){e.data instanceof Uint16Array?this.indicesFormat="uint16":e.data instanceof Uint32Array&&(this.indicesFormat="uint32"),this.indicesCount=e.data.length,this.indicesGPUBuffer=new Wc(e.data)}upload(e){this.indicesGPUBuffer.indicesNode.setArrayBuffer(0,e),this.indicesGPUBuffer.apply()}compute(){}destroy(){this.uuid=null,this.name=null,this.indicesFormat=null,this.indicesCount=null,this.indicesGPUBuffer.destroy(),this.indicesGPUBuffer=null}}class jc{lodLevels}class Ve{instanceID;name;subGeometries=[];morphTargetsRelative;morphTargetDictionary;skinNames;bindPose;blendShapeData;vertexDim;vertexCount=0;_bounds;_attributeMap;_attributes;_indicesBuffer;_vertexBuffer;_onChange=!0;_wireframeLines;_isDestroyed=!1;constructor(){this.instanceID=Gt(),this._attributeMap=new Map,this._attributes=[],this._vertexBuffer=new zc}get indicesBuffer(){return this._indicesBuffer}get vertexBuffer(){return this._vertexBuffer}get vertexAttributes(){return this._attributes}get vertexAttributeMap(){return this._attributeMap}get geometryType(){return this._vertexBuffer.geometryType}set geometryType(e){this._vertexBuffer.geometryType=e}get bounds(){if(!this._bounds){this._bounds=new xe(new b,new b(1,1,1)),this._bounds.min.x=Number.MAX_VALUE,this._bounds.min.y=Number.MAX_VALUE,this._bounds.min.z=Number.MAX_VALUE,this._bounds.max.x=-Number.MAX_VALUE,this._bounds.max.y=-Number.MAX_VALUE,this._bounds.max.z=-Number.MAX_VALUE;let e=this.getAttribute(G.position);if(e&&e.data)for(let t=0;t<e.data.length/3;t++){const a=e.data[t*3+0],r=e.data[t*3+1],i=e.data[t*3+2];this._bounds.min.x>a&&(this._bounds.min.x=a),this._bounds.min.y>r&&(this._bounds.min.y=r),this._bounds.min.z>i&&(this._bounds.min.z=i),this._bounds.max.x<a&&(this._bounds.max.x=a),this._bounds.max.y<r&&(this._bounds.max.y=r),this._bounds.max.z<i&&(this._bounds.max.z=i)}this._bounds.setFromMinMax(this._bounds.min,this._bounds.max)}return this._bounds}set bounds(e){this._bounds=e}addSubGeometry(...e){let t=new jc;return t.lodLevels=e,this.subGeometries.push(t),t}generate(e){this._onChange&&(this._onChange=!1,this._indicesBuffer.upload(this.getAttribute(G.indices).data),this._vertexBuffer.createVertexBuffer(this._attributeMap,e),this._vertexBuffer.updateAttributes(this._attributeMap),this.vertexCount=this._vertexBuffer.vertexCount)}setIndices(e){if(!this._attributeMap.has(G.indices)){let t={attribute:G.indices,data:e};this._attributeMap.set(G.indices,t),this._indicesBuffer=new Jc,this._indicesBuffer.createIndicesBuffer(t)}}setAttribute(e,t){if(e==G.indices)this.setIndices(t);else{let a={attribute:e,data:t};this._attributeMap.set(e,a),this._attributes.push(e)}}getAttribute(e){return this._attributeMap.get(e)}hasAttribute(e){return this._attributeMap.has(e)}genWireframe(){if(this._wireframeLines)return this._wireframeLines;if(this.geometryType==Ft.split||this.geometryType==Ft.compose){let e=this.getAttribute(G.position),t=this.getAttribute(G.indices);if(t&&e&&t.data.length>0){let a=e.data,r=[];for(let i=0;i<t.data.length/3;i++){const n=t.data[i*3+0],o=t.data[i*3+1],l=t.data[i*3+2];let c=new b(a[n*3+0],a[n*3+1],a[n*3+2]),f=new b(a[o*3+0],a[o*3+1],a[o*3+2]),h=new b(a[l*3+0],a[l*3+1],a[l*3+2]);r.push(c,f),r.push(f,h),r.push(h,c)}return this._wireframeLines=r,r}}else if(this.geometryType==Ft.compose_bin){let e=this.getAttribute(G.all),t=this.vertexDim,a=this.getAttribute(G.indices);if(a&&e&&a.data.length>0){let r=e.data,i=[];for(let n=0;n<a.data.length/3;n++){const o=a.data[n*3+0],l=a.data[n*3+1],c=a.data[n*3+2];let f=new b(r[o*t+0],r[o*t+1],r[o*t+2]),h=new b(r[l*t+0],r[l*t+1],r[l*t+2]),u=new b(r[c*t+0],r[c*t+1],r[c*t+2]);i.push(f,h),i.push(h,u),i.push(u,f)}return this._wireframeLines=i,i}}return null}compute(){this._indicesBuffer&&this._indicesBuffer.compute(),this._vertexBuffer&&this._vertexBuffer.compute()}static crossA=b.UP.clone();static crossB=b.UP.clone();static crossRet=b.UP.clone();static point1=b.UP.clone();static point2=b.UP.clone();static point3=b.UP.clone();computeNormals(){let e=this.getAttribute(G.position),t=this.getAttribute(G.normal),a=this.getAttribute(G.indices);if(!e||!t||!a)return this;let r=a.data.length/3,i=Ve.point1,n=Ve.point2,o=Ve.point3,l=Ve.crossA,c=Ve.crossB,f=Ve.crossRet;for(let h=0;h<r;h++){let u=a.data[h*3],g=a.data[h*3+1],A=a.data[h*3+2];i.set(e.data[u*3],e.data[u*3+1],e.data[u*3+2]),n.set(e.data[g*3],e.data[g*3+1],e.data[g*3+2]),o.set(e.data[A*3],e.data[A*3+1],e.data[A*3+2]),b.sub(i,n,l).normalize(),b.sub(i,o,c).normalize();let m=l.crossProduct(c,f).normalize();t.data[u*3]=t.data[g*3]=t.data[A*3]=m.x,t.data[u*3+1]=t.data[g*3+1]=t.data[A*3+1]=m.y,t.data[u*3+2]=t.data[g*3+2]=t.data[A*3+2]=m.z}return this._vertexBuffer.upload(G.normal,t),this}isPrimitive(){return!1}destroy(e){this._isDestroyed||(this.instanceID=null,this.name=null,this.subGeometries=null,this.morphTargetDictionary=null,this.skinNames=null,this.bindPose=null,this.blendShapeData=null,this._wireframeLines=null,this._bounds&&(this._bounds.destroy(),this._bounds=null),this._attributeMap&&(this._attributeMap.forEach(t=>{t&&t.data&&(t.data=null)}),this._attributeMap.clear(),this._attributeMap=null),this._attributes=null,this._indicesBuffer&&(this._indicesBuffer.destroy(),this._indicesBuffer=null),this._vertexBuffer&&(this._vertexBuffer.destroy(),this._vertexBuffer=null),this._isDestroyed=!0)}}class Zc extends Ve{batchSize;constructor(e=128){super(),this.batchSize=e;const t=new Float32Array(12*e);for(let r=0;r<e;++r)t.set([-2,-2,r,2,-2,r,2,2,r,-2,2,r],r*12);const a=new Uint32Array(6*e);for(let r=0;r<e;++r){const i=r*4;a.set([0+i,1+i,2+i,0+i,2+i,3+i],r*6)}this.setAttribute(G.position,t),this.setIndices(a),this.addSubGeometry({indexStart:0,indexCount:a.length,vertexStart:0,vertexCount:t.length/3,firstStart:0,index:0,topology:0})}}class pn extends ft{_dataBuffer;create(e,t,a,r=!1){let i=w.device;const n=Math.ceil(e*4/256)*256;this.format=se.rgba8unorm,this.mipmapCount=Math.floor(r?Math.log2(e):1),this.createTextureDescriptor(e,t,this.mipmapCount,this.format);const o=this._dataBuffer=i.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});i.queue.writeBuffer(o,0,a.buffer);const l=F.beginCommandEncoder();return l.copyBufferToTexture({buffer:o,bytesPerRow:n},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(l),r&&pa.webGPUGenerateMipmap(this),this}updateTexture(e,t,a){let r=w.device;const i=Math.ceil(e*4/256)*256;this.mipmapCount=Math.floor(Math.log2(e)),this._dataBuffer&&this._dataBuffer.destroy(),this._dataBuffer=null;const n=this._dataBuffer=r.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});r.queue.writeBuffer(n,0,a.buffer);const o=F.beginCommandEncoder();o.copyBufferToTexture({buffer:n,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(o),this.gpuSampler=r.createSampler(this),this.mipmapCount>1&&pa.webGPUGenerateMipmap(this)}}class Yc extends ft{_dataBuffer;create(e,t,a){let r=w.device;const i=e*4*4;this.format=se.rgba32uint,this.createTextureDescriptor(e,t,1,this.format);const o=this._dataBuffer=r.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});r.queue.writeBuffer(o,0,a.buffer);const l=r.createCommandEncoder();return l.copyBufferToTexture({buffer:o,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),r.queue.submit([l.finish()]),this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="uint",this.gpuSampler=r.createSampler({}),this}updateTexture(e,t,a){let r=w.device;const i=e*4*4;r.queue.writeTexture({texture:this.getGPUTexture()},a.buffer,{bytesPerRow:i},{width:e,height:t,depthOrArrayLayers:1})}}class Ds extends ft{_dataBuffer;create(e,t,a){let r=w.device;const i=e*4;this.format=se.r32uint,this.createTextureDescriptor(e,t,1,this.format);const o=this._dataBuffer=r.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});r.queue.writeBuffer(o,0,a.buffer);const l=r.createCommandEncoder();return l.copyBufferToTexture({buffer:o,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),r.queue.submit([l.finish()]),this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="uint",this.gpuSampler=r.createSampler({}),this}updateTexture(e,t,a){let r=w.device;const i=e*4;r.queue.writeTexture({texture:this.getGPUTexture()},a.buffer,{bytesPerRow:i},{width:e,height:t,depthOrArrayLayers:1})}}const Xc=new Float32Array(1),c2=new Int32Array(Xc.buffer);let ur=function(s){Xc[0]=s;const e=c2[0];let t=e>>16&32768,a=e>>12&2047;const r=e>>23&255;return r<103?t:r>142?(t|=31744,t|=(r==255?1:0)&&e&8388607,t):r<114?(a|=2048,t|=(a>>114-r)+(a>>113-r&1),t):(t|=r-112<<10|a>>1,t+=a&1,t)};class _s extends ft{uint16Array;floatArray;_dataBuffer;create(e,t,a=null,r=!0){if(a==null){a=[];for(let i=0,n=e*t*4;i<n;i++)a[i]=0}return this.updateTexture(e,t,a,r),this}updateTexture(e,t,a,r=!0){(e!=this.width||t!=this.height)&&(this._dataBuffer&&this._dataBuffer.destroy(),this._dataBuffer=null,this.gpuTexture&&this.gpuTexture.destroy(),this.gpuTexture=null),this.floatArray=a;let i=w.device;const n=e*4*2;this.format=se.rgba16float,this.mipmapCount=Math.floor(r?Math.log2(e):1),this.createTextureDescriptor(e,t,this.mipmapCount,this.format),(!this.uint16Array||this.uint16Array.length!=a.length)&&(this.uint16Array=new Uint16Array(a.length));let o=this.uint16Array;for(let f=0,h=o.length;f<h;f++)o[f]=ur(a[f]);const l=this._dataBuffer=i.createBuffer({size:o.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});i.queue.writeBuffer(l,0,o);const c=F.beginCommandEncoder();c.copyBufferToTexture({buffer:l,bytesPerRow:n},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),this.useMipmap||(this.samplerBindingLayout.type="filtering",this.textureBindingLayout.sampleType="float"),F.endCommandEncoder(c),this.gpuSampler=i.createSampler(this),this.gpuTexture=this.getGPUTexture(),this.mipmapCount>1&&pa.webGPUGenerateMipmap(this)}}var f2=Object.getOwnPropertyDescriptor,d2=(s,e,t,a)=>{for(var r=a>1?void 0:a?f2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.GSplatRenderer=class extends Qa{count=0;size=new de;splatColor;transformA;transformB;texParams;splatOrder;gsplatMaterial;_positions;get positions(){return this._positions}_worldPositions;_orderData;_sortWorker;_lastSentTime=0;_minIntervalMs=16;_centersSent=!1;_lastViewMatrixHash=0;_lastCameraSpeed=0;_adaptiveSorting=!0;_lastPixelCullParams="";_texturesInitialized=!1;_lodEnabled=!1;_lodDistances=[5,10,20,40];_lodRatios=[1,.75,.5,.25,.1];_currentLodLevel=0;_minPixelCoverage=4;_maxPixelCoverage=0;_maxPixelCullDistance=0;_mapping=null;_fullCount=0;get fullCount(){return this._fullCount}_batchSize=128;instanceCount=0;constructor(){super()}initAsset(e){this.count=e.count,this._fullCount=e.count,this.size=this.evalTextureSize(e.count),this.buildColor(e),this.buildTransform(e),this.texParams=new Float32Array([this.count,this.size.x,this.count,1]),this._positions=e.position;const t=this.size.x*this.size.y;this._orderData=new Uint32Array(t);for(let a=0;a<t;a++)this._orderData[a]=a<this.count?a:this.count>0?this.count-1:0;this.splatOrder=new Ds().create(this.size.x,this.size.y,this._orderData),this.splatOrder.name="splatOrder",this.splatOrder.minFilter="nearest",this.splatOrder.magFilter="nearest",this.splatOrder.addressModeU="clamp-to-edge",this.splatOrder.addressModeV="clamp-to-edge",this.gsplatMaterial=new Gc,this.geometry=new Zc(this._batchSize),this.materials=[this.gsplatMaterial],this.instanceCount=0}onBeforeUpdate(e){this.count>0&&e?.camera&&(this._lodEnabled&&this.updateLOD(e),e.camera.viewMatrix&&this.scheduleOrder(e.camera.viewMatrix))}updateLOD(e){if(!this._worldPositions||this._fullCount===0)return;const a=e.camera.viewMatrix.rawData,r=-(a[0]*a[12]+a[1]*a[13]+a[2]*a[14]),i=-(a[4]*a[12]+a[5]*a[13]+a[6]*a[14]),n=-(a[8]*a[12]+a[9]*a[13]+a[10]*a[14]);let o=0,l=0,c=0;const f=Math.min(100,this._fullCount);for(let p=0;p<f;p++){const D=Math.floor(p/f*this._fullCount)*3;o+=this._worldPositions[D+0],l+=this._worldPositions[D+1],c+=this._worldPositions[D+2]}o/=f,l/=f,c/=f;const h=r-o,u=i-l,g=n-c,A=Math.sqrt(h*h+u*u+g*g);let m=this._lodDistances.length;for(let p=0;p<this._lodDistances.length;p++)if(A<this._lodDistances[p]){m=p;break}if(m!==this._currentLodLevel){this._currentLodLevel=m;const p=this._lodRatios[m],D=Math.floor(this._fullCount*p);if(this._mapping){const B=this._mapping;this._mapping=new Uint32Array(Math.min(D,B.length));for(let v=0;v<this._mapping.length;v++)this._mapping[v]=B[v];this.setMapping(this._mapping)}else this.count=D,this.texParams[0]=this.count,this.texParams[2]=this.count}}setMapping(e){this._mapping=e&&e.length>0?e:null,this.count=this._mapping?this._mapping.length:this._fullCount,this.texParams[0]=this.count,this.texParams[2]=Math.min(this.texParams[0],this.count);const t=this.size.x*this.size.y;for(let a=0;a<t;a++)this._orderData[a]=a<this.count?a:this.count>0?this.count-1:0;if(this.splatOrder.updateTexture(this.size.x,this.size.y,this._orderData),this._sortWorker){const a=this._worldPositions||this._positions,r=this._mapping?new Float32Array(this._mapping.length*3):new Float32Array(a);if(this._mapping)for(let i=0;i<this._mapping.length;++i){const n=this._mapping[i]*3,o=i*3;r[o+0]=a[n+0],r[o+1]=a[n+1],r[o+2]=a[n+2]}this._sortWorker.postMessage({type:"centers",centers:r.buffer,mapping:this._mapping?this._mapping:null},[r.buffer]),this._centersSent=!0}else this._centersSent=!1;this.instanceCount=0}setVisBoost(e){this.texParams[3]=Math.max(0,e)}setSortThrottle(e){this._minIntervalMs=Math.max(0,e|0)}setAdaptiveSorting(e){this._adaptiveSorting=e}setLOD(e,t,a){this._lodEnabled=e,t&&(this._lodDistances=t),a&&(this._lodRatios=a)}getLODStats(){return{enabled:this._lodEnabled,currentLevel:this._currentLodLevel,distances:this._lodDistances,ratios:this._lodRatios,currentRatio:this._lodRatios[this._currentLodLevel],visibleCount:this._lodEnabled?Math.floor(this._fullCount*this._lodRatios[this._currentLodLevel]):this._fullCount}}setPixelCulling(e,t=0,a=0){this._minPixelCoverage=Math.max(0,e),this._maxPixelCoverage=Math.max(0,t),this._maxPixelCullDistance=Math.max(0,a)}getPixelCullingStats(){return{minPixels:this._minPixelCoverage,maxPixels:this._maxPixelCoverage,maxPixelCullDistance:this._maxPixelCullDistance,maxEnabled:this._maxPixelCoverage>0,distanceEnabled:this._maxPixelCullDistance>0}}getBatchingStats(){return{enabled:!0,batchSize:this._batchSize,instanceCount:this.instanceCount,splatCount:this.count,reduction:this.count>0?(1-this.instanceCount/this.count)*100:0}}evalTextureSize(e){let t=Math.ceil(Math.sqrt(e));const a=64;t=Math.ceil(t/a)*a;const r=Math.ceil(e/t);return new de(t,r)}buildColor(e){const t=this.size.x|0,a=this.size.y|0,r=new Uint8Array(t*a*4),i=.28209479177387814,n=e.count,o=e.sh?.coeffs,l=o?o.length/(3*n):1;for(let c=0;c<n;c++){let f=.5,h=.5,u=.5;if(o&&l>=1){const m=c*l*3;f=.5+o[m+0]*i,h=.5+o[m+l+0]*i,u=.5+o[m+2*l+0]*i}const g=e.opacity?1/(1+Math.exp(-e.opacity[c])):1,A=c*4;r[A+0]=Math.max(0,Math.min(255,Math.floor(f*255))),r[A+1]=Math.max(0,Math.min(255,Math.floor(h*255))),r[A+2]=Math.max(0,Math.min(255,Math.floor(u*255))),r[A+3]=Math.max(0,Math.min(255,Math.floor(g*255)))}this.splatColor=new pn().create(t,a,r,!1),this.splatColor.name="splatColor",this.splatColor.minFilter="nearest",this.splatColor.magFilter="nearest",this.splatColor.mipmapFilter="nearest",this.splatColor.addressModeU="clamp-to-edge",this.splatColor.addressModeV="clamp-to-edge"}buildTransform(e){const t=this.size.x|0,a=this.size.y|0,r=e.count,i=new Uint32Array(t*a*4),n=new Array(t*a*4).fill(0),o=new ArrayBuffer(4),l=new Float32Array(o),c=new Uint32Array(o),f=A=>(l[0]=A,c[0]),h=e.position,u=e.rotation,g=e.scale;for(let A=0;A<r;A++){const m=A*4,p=h[A*3+0],D=h[A*3+1],B=h[A*3+2];i[m+0]=f(p),i[m+1]=f(D),i[m+2]=f(B);let v=0,C=0,y=0,x=1;if(u){v=u[A*4+0],C=u[A*4+1],y=u[A*4+2],x=u[A*4+3];const Mt=1/Math.hypot(v,C,y,x);v*=Mt,C*=Mt,y*=Mt,x*=Mt}let k=1,E=1,S=1;g&&(k=Math.exp(g[A*3+0]),E=Math.exp(g[A*3+1]),S=Math.exp(g[A*3+2]));const Q=v+v,I=C+C,T=y+y,M=v*Q,Z=v*I,be=v*T,re=C*I,P=C*T,z=y*T,H=x*Q,O=x*I,ie=x*T,W=1-(re+z),$=Z+ie,ee=be-O,oe=Z-ie,fe=1-(M+z),De=P+H,Ne=be+O,Ke=P-H,q=1-(M+re),ne=W*k,ce=$*k,ue=ee*k,Re=oe*E,ge=fe*E,Se=De*E,Ie=Ne*S,Me=Ke*S,ze=q*S,Vt=ne*ne+Re*Re+Ie*Ie,ut=ne*ce+Re*ge+Ie*Me,ir=ne*ue+Re*Se+Ie*ze,ka=ce*ce+ge*ge+Me*Me,Ga=ce*ue+ge*Se+Me*ze,za=ue*ue+Se*Se+ze*ze,ta=m;n[ta+0]=Vt,n[ta+1]=ut,n[ta+2]=ir,n[ta+3]=za;const Wa=ur(ka)&65535,ua=ur(Ga)&65535;i[m+3]=Wa|ua<<16}this.transformA=new Yc().create(t,a,i),this.transformA.name="transformA",this.transformA.minFilter="nearest",this.transformA.magFilter="nearest",this.transformA.addressModeU="clamp-to-edge",this.transformA.addressModeV="clamp-to-edge",this.transformB=new _s().create(t,a,n,!1),this.transformB.name="transformB",this.transformB.minFilter="nearest",this.transformB.magFilter="nearest",this.transformB.mipmapFilter="nearest",this.transformB.addressModeU="clamp-to-edge",this.transformB.addressModeV="clamp-to-edge"}updateWorldPositions(){if(!this._positions)return;const e=this.object3D.transform.worldMatrix,t=this._positions,a=this._fullCount;this._worldPositions||(this._worldPositions=new Float32Array(t.length));const r=e.rawData;for(let i=0;i<a;i++){const n=i*3,o=t[n+0],l=t[n+1],c=t[n+2];this._worldPositions[n+0]=r[0]*o+r[4]*l+r[8]*c+r[12],this._worldPositions[n+1]=r[1]*o+r[5]*l+r[9]*c+r[13],this._worldPositions[n+2]=r[2]*o+r[6]*l+r[10]*c+r[14]}this._centersSent=!1}scheduleOrder(e){if(this.count===0)return;const t=this.object3D.transform.localChange;(t||!this._worldPositions)&&this.updateWorldPositions();const a=e.rawData,r=a[2],i=a[6],n=a[10],o=-(a[0]*a[12]+a[1]*a[13]+a[2]*a[14]),l=-(a[4]*a[12]+a[5]*a[13]+a[6]*a[14]),c=-(a[8]*a[12]+a[9]*a[13]+a[10]*a[14]),f=performance.now(),h=(f-this._lastSentTime)/1e3,u=Math.floor(o*1e3)^Math.floor(l*1e3)^Math.floor(c*1e3),g=Math.floor(r*1e3)^Math.floor(i*1e3)^Math.floor(n*1e3),A=u^g;if(A===this._lastViewMatrixHash&&!t)return;let m=this._minIntervalMs;if(this._adaptiveSorting&&this._minIntervalMs>0){const D=Math.abs(A-this._lastViewMatrixHash)/Math.max(h,.001);D<1e3?m=this._minIntervalMs:D<1e4?m=this._minIntervalMs*.5:m=this._minIntervalMs*.2,this._lastCameraSpeed=D}if(!(f-this._lastSentTime<m)){if(this._lastViewMatrixHash=A,this._lastSentTime=f,!this._sortWorker){this._sortWorker=this.createSortWorker(),this._sortWorker.onmessage=v=>{const C=v.data.order,y=this._orderData.buffer;this._sortWorker.postMessage({order:y},[y]);const x=new Uint32Array(C),k=this.size.x*this.size.y,E=this.count;(!this._orderData||this._orderData.length!==k)&&(this._orderData=new Uint32Array(k));const S=Math.min(E,x.length);if(this._orderData.set(x.subarray(0,S),0),S<k){const T=E>0?E-1:0;this._orderData.fill(T,S,k)}this.splatOrder.updateTexture(this.size.x,this.size.y,this._orderData);const Q=Math.max(0,Math.min(this.count,v.data.count|0));this.texParams[2]=Q;const I=Math.ceil(Q/this._batchSize);this.instanceCount=I};const p=this._worldPositions||this._positions,D=this._mapping?new Float32Array(this._mapping.length*3):new Float32Array(p);if(this._mapping)for(let v=0;v<this._mapping.length;++v){const C=this._mapping[v]*3,y=v*3;D[y+0]=p[C+0],D[y+1]=p[C+1],D[y+2]=p[C+2]}const B=new Uint32Array(this.count);for(let v=0;v<this.count;v++)B[v]=v;this._sortWorker.postMessage({order:B.buffer,centers:D.buffer,mapping:this._mapping},[B.buffer,D.buffer]),this._centersSent=!0}if(!this._centersSent&&this._sortWorker){const p=this._worldPositions||this._positions,D=this._mapping?new Float32Array(this._mapping.length*3):new Float32Array(p);if(this._mapping)for(let B=0;B<this._mapping.length;++B){const v=this._mapping[B]*3,C=B*3;D[C+0]=p[v+0],D[C+1]=p[v+1],D[C+2]=p[v+2]}this._sortWorker.postMessage({type:"centers",centers:D.buffer,mapping:this._mapping?this._mapping:null},[D.buffer]),this._centersSent=!0}this._sortWorker.postMessage({cameraPosition:{x:o,y:l,z:c},cameraDirection:{x:-r,y:-i,z:-n}})}}createSortWorker(){function e(){let o,l,c,f,h,u=!1;const g={x:0,y:0,z:0},A={x:0,y:0,z:0},m={x:0,y:0,z:0},p={x:0,y:0,z:0};let D,B;const v=(y,x,k)=>{for(;y<=x;){const E=x+y>>1,S=k(E);if(S>0)y=E+1;else if(S<0)x=E-1;else return E}return~y},C=()=>{if(!o||!l||!f||!h)return;const y=f.x,x=f.y,k=f.z,E=h.x,S=h.y,Q=h.z,I=.001;if(!u&&Math.abs(y-g.x)<I&&Math.abs(x-g.y)<I&&Math.abs(k-g.z)<I&&Math.abs(E-A.x)<I&&Math.abs(S-A.y)<I&&Math.abs(Q-A.z)<I)return;u=!1,g.x=y,g.y=x,g.z=k,A.x=E,A.y=S,A.z=Q;const T=l.length/3;D?.length!==T&&(D=new Uint32Array(T));let M,Z;for(let O=0;O<8;++O){const ie=(O&1?m.x:p.x)-y,W=(O&2?m.y:p.y)-x,$=(O&4?m.z:p.z)-k,ee=ie*E+W*S+$*Q;O===0?M=Z=ee:(M=Math.min(M,ee),Z=Math.max(Z,ee))}B?B.fill(0):B=new Uint32Array(65537);const be=Z-M,re=be<1e-6?0:1/be*2**16;for(let O=0;O<T;++O){const ie=O*3,W=l[ie+0]-y,$=l[ie+1]-x,ee=l[ie+2]-k,oe=W*E+$*S+ee*Q,fe=Math.floor((oe-M)*re);D[O]=fe,B[fe]++}for(let O=1;O<65537;O++)B[O]+=B[O-1];for(let O=0;O<T;O++){const ie=D[O],W=--B[ie];o[W]=O}const P=O=>D[o[O]]/re+M,z=()=>{const O=v(0,T-1,ie=>-P(ie));return Math.min(T,Math.abs(O))},H=P(T-1)>=0?z():T;if(c)for(let O=0;O<T;++O)o[O]=c[o[O]];self.postMessage({order:o.buffer,count:H},[o.buffer]),o=null};self.onmessage=y=>{if(y.data.order&&(o=new Uint32Array(y.data.order)),y.data.centers){l=new Float32Array(y.data.centers),m.x=p.x=l[0],m.y=p.y=l[1],m.z=p.z=l[2];const x=l.length/3;for(let k=1;k<x;++k){const E=l[k*3+0],S=l[k*3+1],Q=l[k*3+2];m.x=Math.min(m.x,E),m.y=Math.min(m.y,S),m.z=Math.min(m.z,Q),p.x=Math.max(p.x,E),p.y=Math.max(p.y,S),p.z=Math.max(p.z,Q)}u=!0}y.data.hasOwnProperty("mapping")&&(c=y.data.mapping?new Uint32Array(y.data.mapping):null,u=!0),y.data.cameraPosition&&(f=y.data.cameraPosition),y.data.cameraDirection&&(h=y.data.cameraDirection),C()}}const t=`(${e.toString()})()`,a=new Blob([t],{type:"application/javascript"}),r=URL.createObjectURL(a);return new Worker(r)}nodeUpdate(e,t,a,r){const i=this.object3D.transform.worldMatrix;this.gsplatMaterial.setTransformMatrix(i);const n=`${this._minPixelCoverage},${this._maxPixelCoverage},${this._maxPixelCullDistance},${this._batchSize}`;n!==this._lastPixelCullParams&&(this.gsplatMaterial.setPixelCulling(this._minPixelCoverage,this._maxPixelCoverage,this._maxPixelCullDistance,this._batchSize),this._lastPixelCullParams=n),this._texturesInitialized||(this.gsplatMaterial.setSplatTextures(this.splatColor,this.transformA,this.transformB,this.texParams,this.splatOrder),this._texturesInitialized=!0),super.nodeUpdate(e,t,a,r)}renderPass(e,t,a){const r=a.encoder;for(let i of this.materials){const n=i.getPass(t);if(!(!n||n.length===0))for(const o of n){if(!o.pipeline)continue;o.apply(this.geometry,a.rendererPassState||a),F.bindPipeline(r,o),F.bindGeometryBuffer(r,this.geometry);const c=this.geometry.subGeometries[0].lodLevels[0];this.instanceCount>0?F.drawIndexed(r,c.indexCount,this.instanceCount,c.indexStart,0,0):F.drawIndexed(r,c.indexCount,1,c.indexStart,0,0)}}}destroy(e){this._sortWorker&&(this._sortWorker.terminate(),this._sortWorker=null),this.splatColor&&(this.splatColor.destroy(e),this.splatColor=null),this.transformA&&(this.transformA.destroy(e),this.transformA=null),this.transformB&&(this.transformB.destroy(e),this.transformB=null),this.splatOrder&&(this.splatOrder.destroy(e),this.splatOrder=null),this._positions=null,this._worldPositions=null,this._orderData=null,this.texParams=null,this._mapping=null,super.destroy(e)}},d.GSplatRenderer=d2([Lt(d.GSplatRenderer,"GSplatRenderer")],d.GSplatRenderer);const Hc=`
|
|
5995
|
+
`;class gt{computes;passShader;constructor(){this.computes=[],this.passShader=new Map}addRenderPass(e,t=-1){let a=this.passShader.get(e.passType)||[];t==-1?a.push(e):a.splice(t,-1,e),this.passShader.set(e.passType,a)}removeShader(e,t=-1){let a=this.passShader.get(e.passType);if(a)if(t==-1){let r=a.indexOf(e);r!=-1&&a.splice(r)}else a.splice(t,1)}removeShaderByIndex(e,t=-1){let a=this.passShader.get(e);a&&(t==-1?this.passShader.delete(e):a.splice(t,1))}getSubShaders(e){return this.passShader.get(e)||[]}hasSubShaders(e){return this.passShader.get(e).length>0}getDefaultShaders(){return this.passShader.get(le.COLOR)}getDefaultColorShader(){return this.passShader.get(le.COLOR)[0]}setDefine(e,t){for(const a of this.passShader)for(const r of a[1])r.setDefine(e,t)}hasDefine(e){for(const t of this.passShader)for(const a of t[1]){let r=a.hasDefine(e);if(r)return r}return!1}deleteDefine(e){for(const t of this.passShader)for(const a of t[1])a.deleteDefine(e)}setUniform(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniform(e,t)}setUniformFloat(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformFloat(e,t)}setUniformVector2(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformVector2(e,t)}setUniformVector3(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformVector3(e,t)}setUniformVector4(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformVector4(e,t)}setUniformColor(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformColor(e,t)}getUniform(e){return this.getDefaultColorShader().getUniform(e)}getUniformFloat(e){return this.getDefaultColorShader().getUniformFloat(e)}getUniformVector2(e){return this.getDefaultColorShader().getUniformVector2(e)}getUniformVector3(e){return this.getDefaultColorShader().getUniformVector3(e)}getUniformVector4(e){return this.getDefaultColorShader().getUniformVector4(e)}getUniformColor(e){return this.getDefaultColorShader().getUniformColor(e)}setTexture(e,t){for(const a of this.passShader)for(const r of a[1])r.setTexture(e,t);this.setDefine(`USE_${e.toLocaleUpperCase()}`,!0)}getTexture(e){return this.getDefaultColorShader().textures[e]}setUniformBuffer(e,t){for(const a of this.passShader)for(const r of a[1])r.setUniformBuffer(e,t)}getUniformBuffer(e){return this.getDefaultColorShader().getBuffer(e)}setStorageBuffer(e,t){for(const a of this.passShader)for(const r of a[1])r.setStorageBuffer(e,t)}getStorageBuffer(e){return this.getDefaultColorShader().getBuffer(e)}setStructStorageBuffer(e,t){for(const a of this.passShader)for(const r of a[1])r.setStructStorageBuffer(e,t)}getStructStorageBuffer(e){return this.getDefaultColorShader().getBuffer(e)}noticeValueChange(){for(const e of this.passShader)for(const t of e[1])t.noticeValueChange()}destroy(e){for(const t of this.passShader)for(const a of t[1])a.destroy(e);this.passShader.clear(),this.passShader=null,this.computes=null}clone(){let e=new gt,t=this.getDefaultShaders();for(const a of t)e.addRenderPass(a);return e}applyUniform(){for(const e of this.passShader)for(const t of e[1])t.applyUniform()}}var o2=Object.getOwnPropertyDescriptor,l2=(s,e,t,a)=>{for(var r=a>1?void 0:a?o2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.GSplatShader=class extends gt{constructor(){super();const e=new Xe("gsplat_vs_dc","gsplat_fs_dc");e.passType=le.COLOR,e.setShaderEntry("VertMain","FragMain"),e.topology=sn.triangle_list,e.depthWriteEnabled=!1,e.cullMode=Nt.none,e.shaderState.transparent=!0,e.shaderState.blendMode=me.NORMAL,e.shaderState.writeMasks=[15,15],e.shaderState.castReflection=!1,this.addRenderPass(e),this.setDefault()}setDefault(){const e=this.getDefaultColorShader(),t=new R;e.setUniform("modelMatrix",t.rawData),e.setUniform("pixelCull",new Float32Array([2,0,0,0]))}},d.GSplatShader=l2([Ra(d.GSplatShader,"GSplatShader")],d.GSplatShader);class Gc extends Dt{_pixelCullArray=new Float32Array(4);constructor(){super(),Y.register("gsplat_vs_dc",Oc),Y.register("gsplat_fs_dc",Lc),this.shader=new d.GSplatShader}setSplatTextures(e,t,a,r,i){const n=this.shader.getDefaultColorShader();n.setTexture("splatColor",e),n.setTexture("transformA",t),n.setTexture("transformB",a),n.setUniformArray("tex_params",r),i&&n.setTexture("splatOrder",i),n.shaderState.depthCompare=ot.less}setTransformMatrix(e){this.shader.getDefaultColorShader().setUniform("modelMatrix",e.rawData)}setPixelCulling(e,t,a=0,r=128){this._pixelCullArray[0]=e,this._pixelCullArray[1]=t,this._pixelCullArray[2]=a,this._pixelCullArray[3]=r,this.shader.getDefaultColorShader().setUniform("pixelCull",this._pixelCullArray)}}class mn extends ja{node;constructor(e){super(),this.bufferType=ga.VertexGPUBuffer,this.createVertexBuffer(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|GPUBufferUsage.VERTEX,e)}createVertexBuffer(e,t){let a=w.device;this.byteSize=t*Float32Array.BYTES_PER_ELEMENT,this.usage=e,this.buffer&&this.destroy(),this.buffer=a.createBuffer({label:"VertexGPUBuffer",size:this.byteSize,usage:e,mappedAtCreation:!1}),this.memory=new nr,this.memoryNodes=new Map,this.memory.allocation(this.byteSize),this.node=this.memory.allocation_node(this.byteSize)}}var Ft=(s=>(s[s.split=0]="split",s[s.compose=1]="compose",s[s.compose_bin=2]="compose_bin",s))(Ft||{});class zc{vertexCount=0;vertexGPUBuffer;geometryType=Ft.compose;_vertexBufferLayouts;_attributeSlotLayouts;_attributeLocation;constructor(){this._vertexBufferLayouts=[],this._attributeLocation={},this._attributeSlotLayouts=[]}get vertexBufferLayouts(){return this._vertexBufferLayouts}createVertexBuffer(e,t){switch(this.geometryType){case Ft.split:this.createSplitVertexBuffer(e,t);break;case Ft.compose:this.createComposeVertexBuffer(e,t);break;case Ft.compose_bin:this.createComposBinVertexBuffer(e,t);break}}createSplitVertexBuffer(e,t){let a=0;for(let r=0;r<t.attributes.length;r++){const i=t.attributes[r];if(i.name=="index")continue;this._attributeLocation[i.name]=i.location;let n={name:i.name,format:i.format,offset:0,shaderLocation:i.location,stride:or[i.format]};this._attributeSlotLayouts[i.location]=[n];let o=e.get(i.name);o||(o={attribute:i.name,data:new Float32Array(i.size*this.vertexCount)},e.set(i.name,o));let l=o.data.length/n.stride;this.vertexCount!=0&&this.vertexCount!=l&&console.error(" vertex count not match attribute count"),this.vertexCount=l,this._vertexBufferLayouts[i.location]={name:i.name,arrayStride:i.size*4,stepMode:"vertex",attributes:this._attributeSlotLayouts[i.location],offset:a*4,size:this.vertexCount*i.size*4},a+=this.vertexCount*i.size}this.vertexGPUBuffer=new mn(a)}createComposeVertexBuffer(e,t){this._attributeSlotLayouts[0]=[];let a=0;for(let r=0;r<t.attributes.length;r++){const i=t.attributes[r];if(i.name=="index"||i.type=="builtin")continue;this._attributeLocation[i.name]=i.location;let n={name:i.name,format:i.format,offset:a*4,shaderLocation:i.location,stride:or[i.format]};this._attributeSlotLayouts[0][i.location]=n;let o=e.get(i.name);if(o||(o={attribute:i.name,data:new Float32Array(i.size*this.vertexCount)},e.set(i.name,o)),o.data){let l=o.data.length/n.stride;this.vertexCount!=0&&this.vertexCount!=l&&console.error(" vertex count not match attribute count"),this.vertexCount=l}a+=i.size}this._vertexBufferLayouts[0]={name:"composeStruct",arrayStride:a*4,stepMode:"vertex",attributes:this._attributeSlotLayouts[0],offset:0,size:this.vertexCount*a*4},this.vertexGPUBuffer=new mn(this.vertexCount*a)}createComposBinVertexBuffer(e,t){this._attributeSlotLayouts[0]=[];let a=0;for(let n=0;n<t.attributes.length;n++){const o=t.attributes[n];if(o.name=="index"||o.type=="builtin")continue;this._attributeLocation[o.name]=o.location;let l={name:o.name,format:o.format,offset:a*4,shaderLocation:o.location,stride:or[o.format]};this._attributeSlotLayouts[0][o.location]=l;let c=e.get(o.name);if(c||(c={attribute:o.name,data:new Float32Array(o.size*this.vertexCount)},e.set(o.name,c)),c.data){let f=c.data.length/l.stride;this.vertexCount!=0&&this.vertexCount!=f&&console.error(" vertex count not match attribute count"),this.vertexCount=f}a+=o.size}let i=e.get(G.all).data.length/a;this.vertexCount=i,this._vertexBufferLayouts[0]={name:"composeStruct",arrayStride:a*4,stepMode:"vertex",attributes:this._attributeSlotLayouts[0],offset:0,size:this.vertexCount*a*4},this.vertexGPUBuffer=new mn(this.vertexCount*a)}upload(e,t){if(this.vertexGPUBuffer){switch(this.geometryType){case Ft.split:{let a=this._attributeLocation[e],r=this._vertexBufferLayouts[a];this.vertexGPUBuffer.node.setFloat32Array(r.offset/4,t.data)}break;case Ft.compose:for(let a=0;a<this.vertexCount;a++){const r=this._attributeSlotLayouts[0][this._attributeLocation[e]];for(let i=0;i<r.stride;i++){let n=t.data[a*r.stride+i],o=a*(this._vertexBufferLayouts[0].arrayStride/4)+r.offset/4+i;this.vertexGPUBuffer.node.setFloat(n,o)}}break;case Ft.compose_bin:this.vertexGPUBuffer.node.setFloat32Array(0,t.data);break}this.vertexGPUBuffer?.apply()}}updateAttributes(e){switch(this.geometryType){case Ft.split:for(let t=0;t<this._vertexBufferLayouts.length;t++){const a=this._vertexBufferLayouts[t];let r=e.get(a.name);this.vertexGPUBuffer.node.setFloat32Array(a.offset/4,r.data)}break;case Ft.compose:for(let t=0;t<this.vertexCount;t++)this._attributeSlotLayouts.forEach(a=>{for(let r=0;r<a.length;r++){const i=a[r];let n=e.get(i.name);for(let o=0;o<i.stride;o++){let l=n.data[t*i.stride+o],c=t*(this._vertexBufferLayouts[0].arrayStride/4)+i.offset/4+o;this.vertexGPUBuffer.node.setFloat(l,c)}}});break;case Ft.compose_bin:{let t=e.get(G.all);this.vertexGPUBuffer.node.setFloat32Array(0,t.data)}break}this.vertexGPUBuffer.apply()}compute(){}destroy(e){this.vertexCount=null,this.geometryType=null,this._vertexBufferLayouts=null,this._attributeSlotLayouts=null,this._attributeLocation=null,this.vertexGPUBuffer&&this.vertexGPUBuffer.destroy(e),this.vertexGPUBuffer=null}}class Wc extends ja{indicesNode;constructor(e){super(),this.bufferType=ga.IndicesGPUBuffer,this.createIndicesBuffer(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|GPUBufferUsage.INDEX|GPUBufferUsage.INDIRECT,e)}createIndicesBuffer(e,t){let a=w.device;if(this.byteSize=t.length*4,this.usage=e,this.buffer&&this.destroy(),this.buffer=a.createBuffer({label:"IndicesGPUBuffer",size:this.byteSize,usage:e,mappedAtCreation:!1}),this.memory=new nr,this.memoryNodes=new Map,this.memory.allocation(this.byteSize),t){this.indicesNode=this.memory.allocation_node(t.length*4);const r=t.buffer instanceof ArrayBuffer?t.buffer:new Uint8Array(t.buffer).buffer;this.indicesNode.setArrayBuffer(0,r),this.apply()}}}class Jc{uuid="";name;indicesGPUBuffer;indicesFormat="uint16";indicesCount=0;constructor(){}createIndicesBuffer(e){e.data instanceof Uint16Array?this.indicesFormat="uint16":e.data instanceof Uint32Array&&(this.indicesFormat="uint32"),this.indicesCount=e.data.length,this.indicesGPUBuffer=new Wc(e.data)}upload(e){this.indicesGPUBuffer.indicesNode.setArrayBuffer(0,e),this.indicesGPUBuffer.apply()}compute(){}destroy(){this.uuid=null,this.name=null,this.indicesFormat=null,this.indicesCount=null,this.indicesGPUBuffer.destroy(),this.indicesGPUBuffer=null}}class jc{lodLevels}class Ve{instanceID;name;subGeometries=[];morphTargetsRelative;morphTargetDictionary;skinNames;bindPose;blendShapeData;vertexDim;vertexCount=0;_bounds;_attributeMap;_attributes;_indicesBuffer;_vertexBuffer;_onChange=!0;_wireframeLines;_isDestroyed=!1;constructor(){this.instanceID=Gt(),this._attributeMap=new Map,this._attributes=[],this._vertexBuffer=new zc}get indicesBuffer(){return this._indicesBuffer}get vertexBuffer(){return this._vertexBuffer}get vertexAttributes(){return this._attributes}get vertexAttributeMap(){return this._attributeMap}get geometryType(){return this._vertexBuffer.geometryType}set geometryType(e){this._vertexBuffer.geometryType=e}get bounds(){if(!this._bounds){this._bounds=new xe(new b,new b(1,1,1)),this._bounds.min.x=Number.MAX_VALUE,this._bounds.min.y=Number.MAX_VALUE,this._bounds.min.z=Number.MAX_VALUE,this._bounds.max.x=-Number.MAX_VALUE,this._bounds.max.y=-Number.MAX_VALUE,this._bounds.max.z=-Number.MAX_VALUE;let e=this.getAttribute(G.position);if(e&&e.data)for(let t=0;t<e.data.length/3;t++){const a=e.data[t*3+0],r=e.data[t*3+1],i=e.data[t*3+2];this._bounds.min.x>a&&(this._bounds.min.x=a),this._bounds.min.y>r&&(this._bounds.min.y=r),this._bounds.min.z>i&&(this._bounds.min.z=i),this._bounds.max.x<a&&(this._bounds.max.x=a),this._bounds.max.y<r&&(this._bounds.max.y=r),this._bounds.max.z<i&&(this._bounds.max.z=i)}this._bounds.setFromMinMax(this._bounds.min,this._bounds.max)}return this._bounds}set bounds(e){this._bounds=e}addSubGeometry(...e){let t=new jc;return t.lodLevels=e,this.subGeometries.push(t),t}generate(e){this._onChange&&(this._onChange=!1,this._indicesBuffer.upload(this.getAttribute(G.indices).data),this._vertexBuffer.createVertexBuffer(this._attributeMap,e),this._vertexBuffer.updateAttributes(this._attributeMap),this.vertexCount=this._vertexBuffer.vertexCount)}setIndices(e){if(!this._attributeMap.has(G.indices)){let t={attribute:G.indices,data:e};this._attributeMap.set(G.indices,t),this._indicesBuffer=new Jc,this._indicesBuffer.createIndicesBuffer(t)}}setAttribute(e,t){if(e==G.indices)this.setIndices(t);else{let a={attribute:e,data:t};this._attributeMap.set(e,a),this._attributes.push(e)}}getAttribute(e){return this._attributeMap.get(e)}hasAttribute(e){return this._attributeMap.has(e)}genWireframe(){if(this._wireframeLines)return this._wireframeLines;if(this.geometryType==Ft.split||this.geometryType==Ft.compose){let e=this.getAttribute(G.position),t=this.getAttribute(G.indices);if(t&&e&&t.data.length>0){let a=e.data,r=[];for(let i=0;i<t.data.length/3;i++){const n=t.data[i*3+0],o=t.data[i*3+1],l=t.data[i*3+2];let c=new b(a[n*3+0],a[n*3+1],a[n*3+2]),f=new b(a[o*3+0],a[o*3+1],a[o*3+2]),h=new b(a[l*3+0],a[l*3+1],a[l*3+2]);r.push(c,f),r.push(f,h),r.push(h,c)}return this._wireframeLines=r,r}}else if(this.geometryType==Ft.compose_bin){let e=this.getAttribute(G.all),t=this.vertexDim,a=this.getAttribute(G.indices);if(a&&e&&a.data.length>0){let r=e.data,i=[];for(let n=0;n<a.data.length/3;n++){const o=a.data[n*3+0],l=a.data[n*3+1],c=a.data[n*3+2];let f=new b(r[o*t+0],r[o*t+1],r[o*t+2]),h=new b(r[l*t+0],r[l*t+1],r[l*t+2]),u=new b(r[c*t+0],r[c*t+1],r[c*t+2]);i.push(f,h),i.push(h,u),i.push(u,f)}return this._wireframeLines=i,i}}return null}compute(){this._indicesBuffer&&this._indicesBuffer.compute(),this._vertexBuffer&&this._vertexBuffer.compute()}static crossA=b.UP.clone();static crossB=b.UP.clone();static crossRet=b.UP.clone();static point1=b.UP.clone();static point2=b.UP.clone();static point3=b.UP.clone();computeNormals(){let e=this.getAttribute(G.position),t=this.getAttribute(G.normal),a=this.getAttribute(G.indices);if(!e||!t||!a)return this;let r=a.data.length/3,i=Ve.point1,n=Ve.point2,o=Ve.point3,l=Ve.crossA,c=Ve.crossB,f=Ve.crossRet;for(let h=0;h<r;h++){let u=a.data[h*3],g=a.data[h*3+1],A=a.data[h*3+2];i.set(e.data[u*3],e.data[u*3+1],e.data[u*3+2]),n.set(e.data[g*3],e.data[g*3+1],e.data[g*3+2]),o.set(e.data[A*3],e.data[A*3+1],e.data[A*3+2]),b.sub(i,n,l).normalize(),b.sub(i,o,c).normalize();let m=l.crossProduct(c,f).normalize();t.data[u*3]=t.data[g*3]=t.data[A*3]=m.x,t.data[u*3+1]=t.data[g*3+1]=t.data[A*3+1]=m.y,t.data[u*3+2]=t.data[g*3+2]=t.data[A*3+2]=m.z}return this._vertexBuffer.upload(G.normal,t),this}isPrimitive(){return!1}destroy(e){this._isDestroyed||(this.instanceID=null,this.name=null,this.subGeometries=null,this.morphTargetDictionary=null,this.skinNames=null,this.bindPose=null,this.blendShapeData=null,this._wireframeLines=null,this._bounds&&(this._bounds.destroy(),this._bounds=null),this._attributeMap&&(this._attributeMap.forEach(t=>{t&&t.data&&(t.data=null)}),this._attributeMap.clear(),this._attributeMap=null),this._attributes=null,this._indicesBuffer&&(this._indicesBuffer.destroy(),this._indicesBuffer=null),this._vertexBuffer&&(this._vertexBuffer.destroy(),this._vertexBuffer=null),this._isDestroyed=!0)}}class Zc extends Ve{batchSize;constructor(e=128){super(),this.batchSize=e;const t=new Float32Array(12*e);for(let r=0;r<e;++r)t.set([-2,-2,r,2,-2,r,2,2,r,-2,2,r],r*12);const a=new Uint32Array(6*e);for(let r=0;r<e;++r){const i=r*4;a.set([0+i,1+i,2+i,0+i,2+i,3+i],r*6)}this.setAttribute(G.position,t),this.setIndices(a),this.addSubGeometry({indexStart:0,indexCount:a.length,vertexStart:0,vertexCount:t.length/3,firstStart:0,index:0,topology:0})}}class pn extends ft{_dataBuffer;create(e,t,a,r=!1){let i=w.device;const n=Math.ceil(e*4/256)*256;this.format=se.rgba8unorm,this.mipmapCount=Math.floor(r?Math.log2(e):1),this.createTextureDescriptor(e,t,this.mipmapCount,this.format);const o=this._dataBuffer=i.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});i.queue.writeBuffer(o,0,a.buffer);const l=F.beginCommandEncoder();return l.copyBufferToTexture({buffer:o,bytesPerRow:n},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(l),r&&pa.webGPUGenerateMipmap(this),this}updateTexture(e,t,a){let r=w.device;const i=Math.ceil(e*4/256)*256;this.mipmapCount=Math.floor(Math.log2(e)),this._dataBuffer&&this._dataBuffer.destroy(),this._dataBuffer=null;const n=this._dataBuffer=r.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});r.queue.writeBuffer(n,0,a.buffer);const o=F.beginCommandEncoder();o.copyBufferToTexture({buffer:n,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(o),this.gpuSampler=r.createSampler(this),this.mipmapCount>1&&pa.webGPUGenerateMipmap(this)}}class Yc extends ft{_dataBuffer;create(e,t,a){let r=w.device;const i=e*4*4;this.format=se.rgba32uint,this.createTextureDescriptor(e,t,1,this.format);const o=this._dataBuffer=r.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});r.queue.writeBuffer(o,0,a.buffer);const l=r.createCommandEncoder();return l.copyBufferToTexture({buffer:o,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),r.queue.submit([l.finish()]),this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="uint",this.gpuSampler=r.createSampler({}),this}updateTexture(e,t,a){let r=w.device;const i=e*4*4;r.queue.writeTexture({texture:this.getGPUTexture()},a.buffer,{bytesPerRow:i},{width:e,height:t,depthOrArrayLayers:1})}}class Ds extends ft{_dataBuffer;create(e,t,a){let r=w.device;const i=e*4;this.format=se.r32uint,this.createTextureDescriptor(e,t,1,this.format);const o=this._dataBuffer=r.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});r.queue.writeBuffer(o,0,a.buffer);const l=r.createCommandEncoder();return l.copyBufferToTexture({buffer:o,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),r.queue.submit([l.finish()]),this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="uint",this.gpuSampler=r.createSampler({}),this}updateTexture(e,t,a){let r=w.device;const i=e*4;r.queue.writeTexture({texture:this.getGPUTexture()},a.buffer,{bytesPerRow:i},{width:e,height:t,depthOrArrayLayers:1})}}const Xc=new Float32Array(1),c2=new Int32Array(Xc.buffer);let hr=function(s){Xc[0]=s;const e=c2[0];let t=e>>16&32768,a=e>>12&2047;const r=e>>23&255;return r<103?t:r>142?(t|=31744,t|=(r==255?1:0)&&e&8388607,t):r<114?(a|=2048,t|=(a>>114-r)+(a>>113-r&1),t):(t|=r-112<<10|a>>1,t+=a&1,t)};class _s extends ft{uint16Array;floatArray;_dataBuffer;create(e,t,a=null,r=!0){if(a==null){a=[];for(let i=0,n=e*t*4;i<n;i++)a[i]=0}return this.updateTexture(e,t,a,r),this}updateTexture(e,t,a,r=!0){(e!=this.width||t!=this.height)&&(this._dataBuffer&&this._dataBuffer.destroy(),this._dataBuffer=null,this.gpuTexture&&this.gpuTexture.destroy(),this.gpuTexture=null),this.floatArray=a;let i=w.device;const n=e*4*2;this.format=se.rgba16float,this.mipmapCount=Math.floor(r?Math.log2(e):1),this.createTextureDescriptor(e,t,this.mipmapCount,this.format),(!this.uint16Array||this.uint16Array.length!=a.length)&&(this.uint16Array=new Uint16Array(a.length));let o=this.uint16Array;for(let f=0,h=o.length;f<h;f++)o[f]=hr(a[f]);const l=this._dataBuffer=i.createBuffer({size:o.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});i.queue.writeBuffer(l,0,o);const c=F.beginCommandEncoder();c.copyBufferToTexture({buffer:l,bytesPerRow:n},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),this.useMipmap||(this.samplerBindingLayout.type="filtering",this.textureBindingLayout.sampleType="float"),F.endCommandEncoder(c),this.gpuSampler=i.createSampler(this),this.gpuTexture=this.getGPUTexture(),this.mipmapCount>1&&pa.webGPUGenerateMipmap(this)}}var f2=Object.getOwnPropertyDescriptor,d2=(s,e,t,a)=>{for(var r=a>1?void 0:a?f2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.GSplatRenderer=class extends Ia{count=0;size=new de;splatColor;transformA;transformB;texParams;splatOrder;gsplatMaterial;_positions;get positions(){return this._positions}_worldPositions;_orderData;_sortWorker;_lastSentTime=0;_minIntervalMs=16;_centersSent=!1;_lastViewMatrixHash=0;_lastCameraSpeed=0;_adaptiveSorting=!0;_lastPixelCullParams="";_texturesInitialized=!1;_lodEnabled=!1;_lodDistances=[5,10,20,40];_lodRatios=[1,.75,.5,.25,.1];_currentLodLevel=0;_minPixelCoverage=4;_maxPixelCoverage=0;_maxPixelCullDistance=0;_mapping=null;_fullCount=0;get fullCount(){return this._fullCount}_batchSize=128;instanceCount=0;constructor(){super()}initAsset(e){this.count=e.count,this._fullCount=e.count,this.size=this.evalTextureSize(e.count),this.buildColor(e),this.buildTransform(e),this.texParams=new Float32Array([this.count,this.size.x,this.count,1]),this._positions=e.position;const t=this.size.x*this.size.y;this._orderData=new Uint32Array(t);for(let a=0;a<t;a++)this._orderData[a]=a<this.count?a:this.count>0?this.count-1:0;this.splatOrder=new Ds().create(this.size.x,this.size.y,this._orderData),this.splatOrder.name="splatOrder",this.splatOrder.minFilter="nearest",this.splatOrder.magFilter="nearest",this.splatOrder.addressModeU="clamp-to-edge",this.splatOrder.addressModeV="clamp-to-edge",this.gsplatMaterial=new Gc,this.geometry=new Zc(this._batchSize),this.materials=[this.gsplatMaterial],this.instanceCount=0}onBeforeUpdate(e){this.count>0&&e?.camera&&(this._lodEnabled&&this.updateLOD(e),e.camera.viewMatrix&&this.scheduleOrder(e.camera.viewMatrix))}updateLOD(e){if(!this._worldPositions||this._fullCount===0)return;const a=e.camera.viewMatrix.rawData,r=-(a[0]*a[12]+a[1]*a[13]+a[2]*a[14]),i=-(a[4]*a[12]+a[5]*a[13]+a[6]*a[14]),n=-(a[8]*a[12]+a[9]*a[13]+a[10]*a[14]);let o=0,l=0,c=0;const f=Math.min(100,this._fullCount);for(let p=0;p<f;p++){const D=Math.floor(p/f*this._fullCount)*3;o+=this._worldPositions[D+0],l+=this._worldPositions[D+1],c+=this._worldPositions[D+2]}o/=f,l/=f,c/=f;const h=r-o,u=i-l,g=n-c,A=Math.sqrt(h*h+u*u+g*g);let m=this._lodDistances.length;for(let p=0;p<this._lodDistances.length;p++)if(A<this._lodDistances[p]){m=p;break}if(m!==this._currentLodLevel){this._currentLodLevel=m;const p=this._lodRatios[m],D=Math.floor(this._fullCount*p);if(this._mapping){const B=this._mapping;this._mapping=new Uint32Array(Math.min(D,B.length));for(let v=0;v<this._mapping.length;v++)this._mapping[v]=B[v];this.setMapping(this._mapping)}else this.count=D,this.texParams[0]=this.count,this.texParams[2]=this.count}}setMapping(e){this._mapping=e&&e.length>0?e:null,this.count=this._mapping?this._mapping.length:this._fullCount,this.texParams[0]=this.count,this.texParams[2]=Math.min(this.texParams[0],this.count);const t=this.size.x*this.size.y;for(let a=0;a<t;a++)this._orderData[a]=a<this.count?a:this.count>0?this.count-1:0;if(this.splatOrder.updateTexture(this.size.x,this.size.y,this._orderData),this._sortWorker){const a=this._worldPositions||this._positions,r=this._mapping?new Float32Array(this._mapping.length*3):new Float32Array(a);if(this._mapping)for(let i=0;i<this._mapping.length;++i){const n=this._mapping[i]*3,o=i*3;r[o+0]=a[n+0],r[o+1]=a[n+1],r[o+2]=a[n+2]}this._sortWorker.postMessage({type:"centers",centers:r.buffer,mapping:this._mapping?this._mapping:null},[r.buffer]),this._centersSent=!0}else this._centersSent=!1;this.instanceCount=0}setVisBoost(e){this.texParams[3]=Math.max(0,e)}setSortThrottle(e){this._minIntervalMs=Math.max(0,e|0)}setAdaptiveSorting(e){this._adaptiveSorting=e}setLOD(e,t,a){this._lodEnabled=e,t&&(this._lodDistances=t),a&&(this._lodRatios=a)}getLODStats(){return{enabled:this._lodEnabled,currentLevel:this._currentLodLevel,distances:this._lodDistances,ratios:this._lodRatios,currentRatio:this._lodRatios[this._currentLodLevel],visibleCount:this._lodEnabled?Math.floor(this._fullCount*this._lodRatios[this._currentLodLevel]):this._fullCount}}setPixelCulling(e,t=0,a=0){this._minPixelCoverage=Math.max(0,e),this._maxPixelCoverage=Math.max(0,t),this._maxPixelCullDistance=Math.max(0,a)}getPixelCullingStats(){return{minPixels:this._minPixelCoverage,maxPixels:this._maxPixelCoverage,maxPixelCullDistance:this._maxPixelCullDistance,maxEnabled:this._maxPixelCoverage>0,distanceEnabled:this._maxPixelCullDistance>0}}getBatchingStats(){return{enabled:!0,batchSize:this._batchSize,instanceCount:this.instanceCount,splatCount:this.count,reduction:this.count>0?(1-this.instanceCount/this.count)*100:0}}evalTextureSize(e){let t=Math.ceil(Math.sqrt(e));const a=64;t=Math.ceil(t/a)*a;const r=Math.ceil(e/t);return new de(t,r)}buildColor(e){const t=this.size.x|0,a=this.size.y|0,r=new Uint8Array(t*a*4),i=.28209479177387814,n=e.count,o=e.sh?.coeffs,l=o?o.length/(3*n):1;for(let c=0;c<n;c++){let f=.5,h=.5,u=.5;if(o&&l>=1){const m=c*l*3;f=.5+o[m+0]*i,h=.5+o[m+l+0]*i,u=.5+o[m+2*l+0]*i}const g=e.opacity?1/(1+Math.exp(-e.opacity[c])):1,A=c*4;r[A+0]=Math.max(0,Math.min(255,Math.floor(f*255))),r[A+1]=Math.max(0,Math.min(255,Math.floor(h*255))),r[A+2]=Math.max(0,Math.min(255,Math.floor(u*255))),r[A+3]=Math.max(0,Math.min(255,Math.floor(g*255)))}this.splatColor=new pn().create(t,a,r,!1),this.splatColor.name="splatColor",this.splatColor.minFilter="nearest",this.splatColor.magFilter="nearest",this.splatColor.mipmapFilter="nearest",this.splatColor.addressModeU="clamp-to-edge",this.splatColor.addressModeV="clamp-to-edge"}buildTransform(e){const t=this.size.x|0,a=this.size.y|0,r=e.count,i=new Uint32Array(t*a*4),n=new Array(t*a*4).fill(0),o=new ArrayBuffer(4),l=new Float32Array(o),c=new Uint32Array(o),f=A=>(l[0]=A,c[0]),h=e.position,u=e.rotation,g=e.scale;for(let A=0;A<r;A++){const m=A*4,p=h[A*3+0],D=h[A*3+1],B=h[A*3+2];i[m+0]=f(p),i[m+1]=f(D),i[m+2]=f(B);let v=0,C=0,y=0,x=1;if(u){v=u[A*4+0],C=u[A*4+1],y=u[A*4+2],x=u[A*4+3];const Mt=1/Math.hypot(v,C,y,x);v*=Mt,C*=Mt,y*=Mt,x*=Mt}let k=1,E=1,S=1;g&&(k=Math.exp(g[A*3+0]),E=Math.exp(g[A*3+1]),S=Math.exp(g[A*3+2]));const Q=v+v,I=C+C,T=y+y,M=v*Q,Z=v*I,be=v*T,re=C*I,P=C*T,z=y*T,H=x*Q,O=x*I,ie=x*T,W=1-(re+z),$=Z+ie,ee=be-O,oe=Z-ie,fe=1-(M+z),De=P+H,Ne=be+O,Ke=P-H,q=1-(M+re),ne=W*k,ce=$*k,ue=ee*k,Re=oe*E,ge=fe*E,Se=De*E,Ie=Ne*S,Me=Ke*S,ze=q*S,Vt=ne*ne+Re*Re+Ie*Ie,ut=ne*ce+Re*ge+Ie*Me,rr=ne*ue+Re*Se+Ie*ze,Fa=ce*ce+ge*ge+Me*Me,Ga=ce*ue+ge*Se+Me*ze,za=ue*ue+Se*Se+ze*ze,ta=m;n[ta+0]=Vt,n[ta+1]=ut,n[ta+2]=rr,n[ta+3]=za;const Wa=hr(Fa)&65535,ua=hr(Ga)&65535;i[m+3]=Wa|ua<<16}this.transformA=new Yc().create(t,a,i),this.transformA.name="transformA",this.transformA.minFilter="nearest",this.transformA.magFilter="nearest",this.transformA.addressModeU="clamp-to-edge",this.transformA.addressModeV="clamp-to-edge",this.transformB=new _s().create(t,a,n,!1),this.transformB.name="transformB",this.transformB.minFilter="nearest",this.transformB.magFilter="nearest",this.transformB.mipmapFilter="nearest",this.transformB.addressModeU="clamp-to-edge",this.transformB.addressModeV="clamp-to-edge"}updateWorldPositions(){if(!this._positions)return;const e=this.object3D.transform.worldMatrix,t=this._positions,a=this._fullCount;this._worldPositions||(this._worldPositions=new Float32Array(t.length));const r=e.rawData;for(let i=0;i<a;i++){const n=i*3,o=t[n+0],l=t[n+1],c=t[n+2];this._worldPositions[n+0]=r[0]*o+r[4]*l+r[8]*c+r[12],this._worldPositions[n+1]=r[1]*o+r[5]*l+r[9]*c+r[13],this._worldPositions[n+2]=r[2]*o+r[6]*l+r[10]*c+r[14]}this._centersSent=!1}scheduleOrder(e){if(this.count===0)return;const t=this.object3D.transform.localChange;(t||!this._worldPositions)&&this.updateWorldPositions();const a=e.rawData,r=a[2],i=a[6],n=a[10],o=-(a[0]*a[12]+a[1]*a[13]+a[2]*a[14]),l=-(a[4]*a[12]+a[5]*a[13]+a[6]*a[14]),c=-(a[8]*a[12]+a[9]*a[13]+a[10]*a[14]),f=performance.now(),h=(f-this._lastSentTime)/1e3,u=Math.floor(o*1e3)^Math.floor(l*1e3)^Math.floor(c*1e3),g=Math.floor(r*1e3)^Math.floor(i*1e3)^Math.floor(n*1e3),A=u^g;if(A===this._lastViewMatrixHash&&!t)return;let m=this._minIntervalMs;if(this._adaptiveSorting&&this._minIntervalMs>0){const D=Math.abs(A-this._lastViewMatrixHash)/Math.max(h,.001);D<1e3?m=this._minIntervalMs:D<1e4?m=this._minIntervalMs*.5:m=this._minIntervalMs*.2,this._lastCameraSpeed=D}if(!(f-this._lastSentTime<m)){if(this._lastViewMatrixHash=A,this._lastSentTime=f,!this._sortWorker){this._sortWorker=this.createSortWorker(),this._sortWorker.onmessage=v=>{const C=v.data.order,y=this._orderData.buffer;this._sortWorker.postMessage({order:y},[y]);const x=new Uint32Array(C),k=this.size.x*this.size.y,E=this.count;(!this._orderData||this._orderData.length!==k)&&(this._orderData=new Uint32Array(k));const S=Math.min(E,x.length);if(this._orderData.set(x.subarray(0,S),0),S<k){const T=E>0?E-1:0;this._orderData.fill(T,S,k)}this.splatOrder.updateTexture(this.size.x,this.size.y,this._orderData);const Q=Math.max(0,Math.min(this.count,v.data.count|0));this.texParams[2]=Q;const I=Math.ceil(Q/this._batchSize);this.instanceCount=I};const p=this._worldPositions||this._positions,D=this._mapping?new Float32Array(this._mapping.length*3):new Float32Array(p);if(this._mapping)for(let v=0;v<this._mapping.length;++v){const C=this._mapping[v]*3,y=v*3;D[y+0]=p[C+0],D[y+1]=p[C+1],D[y+2]=p[C+2]}const B=new Uint32Array(this.count);for(let v=0;v<this.count;v++)B[v]=v;this._sortWorker.postMessage({order:B.buffer,centers:D.buffer,mapping:this._mapping},[B.buffer,D.buffer]),this._centersSent=!0}if(!this._centersSent&&this._sortWorker){const p=this._worldPositions||this._positions,D=this._mapping?new Float32Array(this._mapping.length*3):new Float32Array(p);if(this._mapping)for(let B=0;B<this._mapping.length;++B){const v=this._mapping[B]*3,C=B*3;D[C+0]=p[v+0],D[C+1]=p[v+1],D[C+2]=p[v+2]}this._sortWorker.postMessage({type:"centers",centers:D.buffer,mapping:this._mapping?this._mapping:null},[D.buffer]),this._centersSent=!0}this._sortWorker.postMessage({cameraPosition:{x:o,y:l,z:c},cameraDirection:{x:-r,y:-i,z:-n}})}}createSortWorker(){function e(){let o,l,c,f,h,u=!1;const g={x:0,y:0,z:0},A={x:0,y:0,z:0},m={x:0,y:0,z:0},p={x:0,y:0,z:0};let D,B;const v=(y,x,k)=>{for(;y<=x;){const E=x+y>>1,S=k(E);if(S>0)y=E+1;else if(S<0)x=E-1;else return E}return~y},C=()=>{if(!o||!l||!f||!h)return;const y=f.x,x=f.y,k=f.z,E=h.x,S=h.y,Q=h.z,I=.001;if(!u&&Math.abs(y-g.x)<I&&Math.abs(x-g.y)<I&&Math.abs(k-g.z)<I&&Math.abs(E-A.x)<I&&Math.abs(S-A.y)<I&&Math.abs(Q-A.z)<I)return;u=!1,g.x=y,g.y=x,g.z=k,A.x=E,A.y=S,A.z=Q;const T=l.length/3;D?.length!==T&&(D=new Uint32Array(T));let M,Z;for(let O=0;O<8;++O){const ie=(O&1?m.x:p.x)-y,W=(O&2?m.y:p.y)-x,$=(O&4?m.z:p.z)-k,ee=ie*E+W*S+$*Q;O===0?M=Z=ee:(M=Math.min(M,ee),Z=Math.max(Z,ee))}B?B.fill(0):B=new Uint32Array(65537);const be=Z-M,re=be<1e-6?0:1/be*2**16;for(let O=0;O<T;++O){const ie=O*3,W=l[ie+0]-y,$=l[ie+1]-x,ee=l[ie+2]-k,oe=W*E+$*S+ee*Q,fe=Math.floor((oe-M)*re);D[O]=fe,B[fe]++}for(let O=1;O<65537;O++)B[O]+=B[O-1];for(let O=0;O<T;O++){const ie=D[O],W=--B[ie];o[W]=O}const P=O=>D[o[O]]/re+M,z=()=>{const O=v(0,T-1,ie=>-P(ie));return Math.min(T,Math.abs(O))},H=P(T-1)>=0?z():T;if(c)for(let O=0;O<T;++O)o[O]=c[o[O]];self.postMessage({order:o.buffer,count:H},[o.buffer]),o=null};self.onmessage=y=>{if(y.data.order&&(o=new Uint32Array(y.data.order)),y.data.centers){l=new Float32Array(y.data.centers),m.x=p.x=l[0],m.y=p.y=l[1],m.z=p.z=l[2];const x=l.length/3;for(let k=1;k<x;++k){const E=l[k*3+0],S=l[k*3+1],Q=l[k*3+2];m.x=Math.min(m.x,E),m.y=Math.min(m.y,S),m.z=Math.min(m.z,Q),p.x=Math.max(p.x,E),p.y=Math.max(p.y,S),p.z=Math.max(p.z,Q)}u=!0}y.data.hasOwnProperty("mapping")&&(c=y.data.mapping?new Uint32Array(y.data.mapping):null,u=!0),y.data.cameraPosition&&(f=y.data.cameraPosition),y.data.cameraDirection&&(h=y.data.cameraDirection),C()}}const t=`(${e.toString()})()`,a=new Blob([t],{type:"application/javascript"}),r=URL.createObjectURL(a);return new Worker(r)}nodeUpdate(e,t,a,r){const i=this.object3D.transform.worldMatrix;this.gsplatMaterial.setTransformMatrix(i);const n=`${this._minPixelCoverage},${this._maxPixelCoverage},${this._maxPixelCullDistance},${this._batchSize}`;n!==this._lastPixelCullParams&&(this.gsplatMaterial.setPixelCulling(this._minPixelCoverage,this._maxPixelCoverage,this._maxPixelCullDistance,this._batchSize),this._lastPixelCullParams=n),this._texturesInitialized||(this.gsplatMaterial.setSplatTextures(this.splatColor,this.transformA,this.transformB,this.texParams,this.splatOrder),this._texturesInitialized=!0),super.nodeUpdate(e,t,a,r)}renderPass(e,t,a){const r=a.encoder;for(let i of this.materials){const n=i.getPass(t);if(!(!n||n.length===0))for(const o of n){if(!o.pipeline)continue;o.apply(this.geometry,a.rendererPassState||a),F.bindPipeline(r,o),F.bindGeometryBuffer(r,this.geometry);const c=this.geometry.subGeometries[0].lodLevels[0];this.instanceCount>0?F.drawIndexed(r,c.indexCount,this.instanceCount,c.indexStart,0,0):F.drawIndexed(r,c.indexCount,1,c.indexStart,0,0)}}}destroy(e){this._sortWorker&&(this._sortWorker.terminate(),this._sortWorker=null),this.splatColor&&(this.splatColor.destroy(e),this.splatColor=null),this.transformA&&(this.transformA.destroy(e),this.transformA=null),this.transformB&&(this.transformB.destroy(e),this.transformB=null),this.splatOrder&&(this.splatOrder.destroy(e),this.splatOrder=null),this._positions=null,this._worldPositions=null,this._orderData=null,this.texParams=null,this._mapping=null,super.destroy(e)}},d.GSplatRenderer=d2([Lt(d.GSplatRenderer,"GSplatRenderer")],d.GSplatRenderer);const Hc=`
|
|
5996
5996
|
#include "GlobalUniform"
|
|
5997
5997
|
|
|
5998
5998
|
const ALPHA_THRESHOLD: f32 = 0.00392156863;
|
|
@@ -6118,7 +6118,7 @@ struct InstanceData {
|
|
|
6118
6118
|
o.gBuffer = vec4f(0.0);
|
|
6119
6119
|
return o;
|
|
6120
6120
|
}
|
|
6121
|
-
`;var h2=Object.getOwnPropertyDescriptor,u2=(s,e,t,a)=>{for(var r=a>1?void 0:a?h2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.PointCloudShader=class extends gt{constructor(){super(),Y.register("pointcloud_vs_dc",Hc),Y.register("pointcloud_fs_dc",Kc);const e=new Xe("pointcloud_vs_dc","pointcloud_fs_dc");e.passType=le.COLOR,e.setShaderEntry("VertMain","FragMain"),e.topology=sn.triangle_list,e.depthWriteEnabled=!0,e.cullMode=Nt.none,e.shaderState.transparent=!1,e.shaderState.blendMode=me.NORMAL,e.shaderState.writeMasks=[15,15],e.shaderState.castReflection=!1,this.addRenderPass(e),this.setDefault()}setDefault(){const e=this.getDefaultColorShader(),t=new R;e.setUniform("modelMatrix",t.rawData),e.setUniformArray("tex_params",new Float32Array([0,0,0,4])),e.setUniformArray("pointParams",new Float32Array([0,0,0,128]))}},d.PointCloudShader=u2([Ia(d.PointCloudShader,"PointCloudShader")],d.PointCloudShader);class qc extends Dt{_texParams=new Float32Array([0,0,0,4]);_pointParamsArray=new Float32Array([0,0,0,128]);constructor(){super(),this.shader=new d.PointCloudShader}setPointTextures(e,t,a,r){const i=this.shader.getDefaultColorShader();if(!i.getUniform("modelMatrix")){const n=new R;i.setUniform("modelMatrix",n.rawData)}i.setTexture("pointColor",t),i.setTexture("pointPosition",e),this._texParams[0]=a[0],this._texParams[1]=a[1],this._texParams[2]=a[2],this._texParams[3]=a[3],i.setUniformArray("tex_params",this._texParams),i.setUniformArray("pointParams",this._pointParamsArray),r&&i.setTexture("pointOrder",r),i.shaderState.depthCompare=ot.less}setTransformMatrix(e){this.shader.getDefaultColorShader().setUniform("modelMatrix",e.rawData)}setPointSize(e){this._texParams[3]=Math.max(.1,e),this.shader.getDefaultColorShader().setUniformArray("tex_params",this._texParams)}setPointShape(e){this._pointParamsArray[0]=e==="circle"?1:0,this.shader.getDefaultColorShader().setUniformArray("pointParams",this._pointParamsArray)}enableDebugFullScreen(e){this._pointParamsArray[1]=e?1:0,this.shader.getDefaultColorShader().setUniformArray("pointParams",this._pointParamsArray)}setBatchSize(e){this._pointParamsArray[3]=Math.max(1,e|0),this.shader.getDefaultColorShader().setUniformArray("pointParams",this._pointParamsArray)}}class Bs extends Ve{batchSize;constructor(e=128){super(),this.batchSize=e;const t=new Float32Array(12*e);for(let r=0;r<e;++r){const i=r*12;t.set([-1,-1,r,1,-1,r,1,1,r,-1,1,r],i)}const a=new Uint32Array(6*e);for(let r=0;r<e;++r){const i=r*4,n=r*6;a.set([0+i,1+i,2+i,0+i,2+i,3+i],n)}this.setAttribute(G.position,t),this.setIndices(a),this.addSubGeometry({indexStart:0,indexCount:a.length,vertexStart:0,vertexCount:t.length/3,firstStart:0,index:0,topology:0})}}class $c extends ft{create(e,t,a,r=!0){let i=w.device;const n=e*4*4;this.format=se.rgba32float,this.createTextureDescriptor(e,t,1,this.format);const l=i.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});i.queue.writeBuffer(l,0,a.buffer);const c=F.beginCommandEncoder();return c.copyBufferToTexture({buffer:l,bytesPerRow:n},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(c),r&&(this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="unfilterable-float"),this.gpuSampler=i.createSampler({}),this}fromBuffer(e,t,a){let r=w.device;const i=e*4*4;this.format=se.rgba32float,this.mipmapCount=1,this.createTextureDescriptor(e,t,this.mipmapCount,this.format);const n=F.beginCommandEncoder();return n.copyBufferToTexture({buffer:a,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(n),this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="unfilterable-float",this.gpuSampler=r.createSampler({}),this}}var b2=Object.getOwnPropertyDescriptor,g2=(s,e,t,a)=>{for(var r=a>1?void 0:a?b2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.PointCloudRenderer=class extends Qa{count=0;size=new de;pointColor;pointPosition;pointOrder;texParams;pointCloudMaterial;_positions;get positions(){return this._positions}_colors;_orderData;_fullCount=0;get fullCount(){return this._fullCount}_batchSize=128;instanceCount=0;_texturesInitialized=!1;_debugFullScreen=!1;_centerOffset=new b;get centerOffset(){return this._centerOffset}constructor(){super()}initFromData(e,t,a){if(!e||!t||a<=0){console.error("PointCloudRenderer: Invalid input data");return}if(e.length<a*3){console.error("PointCloudRenderer: Positions array too small");return}if(t.length<a*4){console.error("PointCloudRenderer: Colors array too small");return}this.count=a,this._fullCount=a,this.size=this.evalTextureSize(a),this._positions=e,this._colors=t,this.centerizePositions(),this.buildPositionTexture(),this.buildColorTexture(),this.texParams=new Float32Array([this.count,this.size.x,this.count,4]),this.buildOrderTexture(),this.pointCloudMaterial=new qc,this.geometry=new Bs(this._batchSize),this.materials=[this.pointCloudMaterial],this.instanceCount=Math.ceil(this.count/this._batchSize)}evalTextureSize(e){let t=Math.ceil(Math.sqrt(e));const a=64;t=Math.ceil(t/a)*a;const r=Math.ceil(e/t);return new de(t,r)}centerizePositions(){if(this.count===0)return;let e=0,t=0,a=0;for(let o=0;o<this.count;o++){const l=o*3;e+=this._positions[l+0],t+=this._positions[l+1],a+=this._positions[l+2]}const r=e/this.count,i=t/this.count,n=a/this.count;this._centerOffset.set(r,i,n);for(let o=0;o<this.count;o++){const l=o*3;this._positions[l+0]-=r,this._positions[l+1]-=i,this._positions[l+2]-=n}this.object3D.localPosition=this._centerOffset}buildPositionTexture(){const e=this.size.x|0,t=this.size.y|0,a=this.count,r=new Float32Array(e*t*4);for(let i=0;i<a;i++){const n=i*4,o=i*3;r[n+0]=this._positions[o+0],r[n+1]=this._positions[o+1],r[n+2]=this._positions[o+2],r[n+3]=0}if(a<e*t){const i=(a-1)*4;for(let n=a;n<e*t;n++){const o=n*4;r[o+0]=r[i+0],r[o+1]=r[i+1],r[o+2]=r[i+2],r[o+3]=0}}this.pointPosition=new $c().create(e,t,r),this.pointPosition.name="pointPosition",this.pointPosition.minFilter="nearest",this.pointPosition.magFilter="nearest",this.pointPosition.addressModeU="clamp-to-edge",this.pointPosition.addressModeV="clamp-to-edge"}buildColorTexture(){const e=this.size.x|0,t=this.size.y|0,a=this.count,r=new Uint8Array(e*t*4);for(let i=0;i<a;i++){const n=i*4,o=i*4;r[n+0]=this._colors[o+0],r[n+1]=this._colors[o+1],r[n+2]=this._colors[o+2],r[n+3]=this._colors[o+3]}if(a<e*t){const i=(a-1)*4;for(let n=a;n<e*t;n++){const o=n*4;r[o+0]=r[i+0],r[o+1]=r[i+1],r[o+2]=r[i+2],r[o+3]=r[i+3]}}this.pointColor=new pn().create(e,t,r,!1),this.pointColor.name="pointColor",this.pointColor.minFilter="nearest",this.pointColor.magFilter="nearest",this.pointColor.mipmapFilter="nearest",this.pointColor.addressModeU="clamp-to-edge",this.pointColor.addressModeV="clamp-to-edge"}buildOrderTexture(){const e=this.size.x*this.size.y;this._orderData=new Uint32Array(e);for(let t=0;t<e;t++)this._orderData[t]=t<this.count?t:this.count>0?this.count-1:0;this.pointOrder=new Ds().create(this.size.x,this.size.y,this._orderData),this.pointOrder.name="pointOrder",this.pointOrder.minFilter="nearest",this.pointOrder.magFilter="nearest",this.pointOrder.addressModeU="clamp-to-edge",this.pointOrder.addressModeV="clamp-to-edge"}nodeUpdate(e,t,a,r){const i=this.object3D.transform.worldMatrix;this.pointCloudMaterial.setTransformMatrix(i),this._texturesInitialized||(this.pointCloudMaterial.setPointTextures(this.pointPosition,this.pointColor,this.texParams,this.pointOrder),this.pointCloudMaterial.setBatchSize(this._batchSize),this.pointCloudMaterial.setPointSize(this.texParams[3]),this.pointCloudMaterial.enableDebugFullScreen(this._debugFullScreen),this._texturesInitialized=!0),super.nodeUpdate(e,t,a,r)}renderPass(e,t,a){const r=a.encoder;for(let i of this.materials){const n=i.getPass(t);if(!(!n||n.length===0))for(const o of n){if(!o.pipeline)continue;o.apply(this.geometry,a.rendererPassState||a),F.bindPipeline(r,o),F.bindGeometryBuffer(r,this.geometry);const c=this.geometry.subGeometries[0].lodLevels[0];this.instanceCount>0?F.drawIndexed(r,c.indexCount,this.instanceCount,c.indexStart,0,0):F.drawIndexed(r,c.indexCount,1,c.indexStart,0,0)}}}setPointSize(e){this.texParams[3]=Math.max(.1,e),this.pointCloudMaterial&&this.pointCloudMaterial.setPointSize(e)}setPointShape(e){this.pointCloudMaterial&&this.pointCloudMaterial.setPointShape(e)}enableDebugFullScreen(e){this._debugFullScreen=e,this.pointCloudMaterial&&this.pointCloudMaterial.enableDebugFullScreen(e)}setBatchSize(e){if(this._batchSize=Math.max(1,e|0),this.geometry){const t=this.geometry;Ce.getInstance().detached(t,this),Ce.getInstance().hasReference(t)||t.destroy(),this.geometry=new Bs(this._batchSize)}this.pointCloudMaterial&&(this.pointCloudMaterial.setBatchSize(this._batchSize),this.pointCloudMaterial.enableDebugFullScreen(this._debugFullScreen)),this.instanceCount=Math.ceil(this.count/this._batchSize)}destroy(e){this.pointColor&&(this.pointColor.destroy(e),this.pointColor=null),this.pointPosition&&(this.pointPosition.destroy(e),this.pointPosition=null),this.pointOrder&&(this.pointOrder.destroy(e),this.pointOrder=null),this._positions=null,this._colors=null,this._orderData=null,this.texParams=null,super.destroy(e)}},d.PointCloudRenderer=g2([Lt(d.PointCloudRenderer,"PointCloudRenderer")],d.PointCloudRenderer);class vs{static maxVector=new b(Number.MAX_VALUE*.1,Number.MAX_VALUE*.1,Number.MAX_VALUE*.1);static minVector=this.maxVector.clone().multiplyScalar(-1);static genMeshMaxVector=b.ZERO.clone();static genMeshMinVector=b.ZERO.clone();static genMeshVectorList8=[new b,new b,new b,new b,new b,new b,new b,new b];static genPointCloudBounds(e,t){t||=new xe(b.ZERO,b.ZERO),t.setFromMinMax(this.maxVector,this.minVector);let a=e.getComponents(d.PointCloudRenderer);if(!a)return console.warn("genPointCloudBounds: No PointCloudRenderer found on object"),t;for(const r of a){const i=r.positions,n=r.fullCount;if(!i||n===0){console.warn("genPointCloudBounds: No position data available");continue}const o=r.object3D.transform.worldMatrix,l=new b;for(let c=0;c<n;c++){const f=c*3;l.set(i[f+0],i[f+1],i[f+2]),o.transformPoint(l,l),t.expandByPoint(l)}}return t}static genGSplatBounds(e,t){t||=new xe(b.ZERO,b.ZERO),t.setFromMinMax(this.maxVector,this.minVector);let a=e.getComponents(d.GSplatRenderer);if(!a)return console.warn("genGSplatBounds: No GSplatRenderer found on object"),t;for(const r of a){const i=r.positions,n=r.fullCount;if(!i||n===0)return console.warn("genGSplatBounds: No position data available"),t;const o=r.object3D.transform.worldMatrix,l=new b;for(let c=0;c<n;c++){const f=c*3;l.set(i[f+0],i[f+1],i[f+2]),o.transformPoint(l,l),t.expandByPoint(l)}t.setFromMinMax(t.min,t.max)}return t}static genMeshBounds(e,t){let a=this.genMeshMinVector,r=this.genMeshMaxVector,i=this.genMeshVectorList8;t||=new xe(b.ZERO,b.ZERO),t.setFromMinMax(this.maxVector,this.minVector);let n=e.getComponents(d.MeshRenderer);for(const o of n)if(o&&o.geometry){let l=o.object3D.transform.worldMatrix;a.copy(o.geometry.bounds.min),r.copy(o.geometry.bounds.max),i[0].set(a.x,a.y,a.z),i[1].set(a.x,a.y,r.z),i[2].set(a.x,r.y,a.z),i[3].set(a.x,r.y,r.z),i[4].set(r.x,a.y,a.z),i[5].set(r.x,a.y,r.z),i[6].set(r.x,r.y,a.z),i[7].set(r.x,r.y,r.z);for(const c of i)l.transformPoint(c,c),t.expandByPoint(c)}return r.copyFrom(t.max),a.copyFrom(t.min),t.setFromMinMax(a,r),t}static transformBound(e,t,a){let r=this.genMeshMinVector.copyFrom(t.min),i=this.genMeshMaxVector.copyFrom(t.max),n=this.genMeshVectorList8;a||=new xe(b.ZERO,b.ZERO),a.setFromMinMax(this.maxVector,this.minVector),n[0].set(r.x,r.y,r.z),n[1].set(r.x,r.y,i.z),n[2].set(r.x,i.y,r.z),n[3].set(r.x,i.y,i.z),n[4].set(i.x,r.y,r.z),n[5].set(i.x,r.y,i.z),n[6].set(i.x,i.y,r.z),n[7].set(i.x,i.y,i.z);for(const o of n)e.transformPoint(o,o),a.expandByPoint(o);return i.copyFrom(a.max),r.copyFrom(a.min),a.setFromMinMax(r,i),a}}class e0 extends Ja{name="";_instanceID="";_numChildren;get instanceID(){return this._instanceID}transform;renderNode;entityChildren;components;waitDisposeComponents;_bound;_boundWorld;_isBoundChange=!0;_dispose=!1;get dispose(){return this._dispose}getObjectByName(e){if(e.indexOf("/")>=0){let a=e.split("/"),r=this;for(;a.length>0&&r;){let i=a.shift();if(r=r.getChildByName(i,!1),!r)return null}return r}else return this.getChildByName(e,!1)}constructor(){super(),this.entityChildren=[],this.components=new Map,this._instanceID=Hn().toString(),this.waitDisposeComponents=[]}get numChildren(){return this._numChildren}addChild(e){if(e==null)throw new Error("child is null!");if(e===this)throw new Error("child is self!");return this.entityChildren.indexOf(e)==-1?(e.removeFromParent(),e.transform.parent=this.transform,this.entityChildren.push(e),this._numChildren=this.entityChildren.length,this.noticeComponents("onAddChild",e),e):null}removeChild(e){if(e===null)return;if(e===this)throw new Error("add child is self!");let t=this.entityChildren.indexOf(e);t!=-1&&(this.entityChildren.splice(t,1),e.transform.parent=null,this._numChildren=this.entityChildren.length,this.noticeComponents("onRemoveChild",e))}removeAllChild(){for(;this.numChildren>0;)this.removeChild(this.entityChildren[0])}removeSelf(){return this.removeFromParent()}removeChildByIndex(e){e>=0&&e<this.entityChildren.length?this.removeChild(this.entityChildren[e]):console.error("remove child by index , index out of range")}hasChild(e){return this.entityChildren.indexOf(e)!=-1}removeFromParent(){let e=this.transform.parent;return e&&e.object3D&&e.object3D.removeChild(this),this}getChildByIndex(e){let t=null;return e<this.entityChildren.length&&(t=this.entityChildren[e]),t}getChildByName(e,t=!0){let a=null;for(const r of this.entityChildren){if(r.name==e)return a=r,a;if(t&&(a=r.getChildByName(e,t),a))return a}return a}update(){}instantiate(){return null}onTransformLocalChange(e){this._isBoundChange=!0}get bound(){return(this._isBoundChange||!this._bound)&&this.updateBound(),this._boundWorld}set bound(e){this._bound=e,this._boundWorld=this._bound.clone(),this._isBoundChange=!0}updateBound(){return this._bound||(this._bound=new xe,this._boundWorld=this._bound.clone(),this._isBoundChange=!0),this._isBoundChange&&(vs.transformBound(this.transform.worldMatrix,this._bound,this._boundWorld),this._isBoundChange=!1),this._boundWorld}waitUpdate(){this._dispose?(this.transform.parent&&this.transform.parent.object3D.removeChild(this),this.components.forEach((e,t)=>{e.enable=!1,e.beforeDestroy(),e.destroy()}),this.components.clear()):Pe.waitStartComponent.forEach((e,t)=>{for(;e.length>0;){const a=e.shift();a.__start(),Pe.waitStartComponent.delete(a.object3D)}})}noticeComponents(e,t){for(let a of this.components.values())a[e]?.(t)}destroy(e){this._dispose||(this.components.forEach(t=>{t.beforeDestroy(e)}),this.components.forEach(t=>{t.destroy(e)}),this.components.clear(),this.components.clear(),this.entityChildren&&(this.entityChildren.forEach(t=>{t.destroy(e)}),this.removeAllChild(),this.entityChildren=[]),this._bound&&this._bound.destroy&&(this._bound.destroy(),this._bound=null),this._boundWorld&&this._boundWorld.destroy&&(this._boundWorld.destroy(),this._boundWorld=null),this.transform.parent=null,this._dispose=!0,super.destroy())}}var m2=Object.getOwnPropertyDescriptor,p2=(s,e,t,a)=>{for(var r=a>1?void 0:a?m2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.Object3D=class extends e0{_isScene3D;prefabRef;serializeTag;constructor(){super(),this.transform=this.addComponent(zt),this.transform.eventDispatcher.addEventListener(zt.LOCAL_ONCHANGE,this.onTransformLocalChange,this)}get isScene3D(){return this._isScene3D}forChild(e){this.entityChildren.forEach(t=>{e(t),t.forChild(e)})}addComponent(e,t){if(!this.components.has(e)){let a=new e;return a.object3D=this,this.components.set(e,a),a.__init(t),Pe.appendWaitStart(a),a}return this.components.get(e)}getOrAddComponent(e){let t=this.components.get(e);return t||(t=this.addComponent(e)),t}removeComponent(e){if(this.components.has(e)){let t=this.components.get(e);Pe.removeWaitStart(this,t),this.components.delete(e),t.__stop(),t.beforeDestroy(),t.destroy()}}hasComponent(e){return this.components.has(e)}getComponent(e){return this.components.get(e)}getComponentFromParent(e){if(!this.parent)return null;let t=this.parent.object3D.getComponent(e);return t||this.parent.object3D.getComponentFromParent(e)}getComponentsInChild(e){let t=[],a=this.components.get(e);a&&t.push(a);for(let r=0;r<this.entityChildren.length;r++){let n=this.entityChildren[r].getComponentsInChild(e);t.push(...n)}return t}getComponents(e,t,a){t||=[];let r=this.getComponent(e);r&&(r.enable||a)&&t.push(r);for(let i=0,n=this.entityChildren.length;i<n;i++){let o=this.entityChildren[i];o&&o instanceof d.Object3D&&o.getComponents(e,t,a)}return t}getComponentsExt(e,t,a){t||=[];let r=this.components.get(e);if(r&&(r.enable||a))t.push(r);else for(const i of this.entityChildren)i instanceof d.Object3D&&i.getComponentsExt(e,t,a);return t}getComponentsByProperty(e,t,a=!0,r,i){r||=[];let n;for(const o of this.components.values())o&&(o.enable||i)&&o[e]===t&&(r.push(o),n=!0);if(!(n&&a))for(const o of this.entityChildren)o instanceof d.Object3D&&o.getComponentsByProperty(e,t,a,r,i);return r}clone(){return this.instantiate()}instantiate(){let e=new d.Object3D;return e.name=this.name,e.serializeTag=this.serializeTag,e.prefabRef=this.prefabRef,this.entityChildren.forEach((t,a)=>{let r=t.instantiate();e.addChild(r)}),this.components.forEach((t,a)=>{t.cloneTo(e)}),e}get localPosition(){return this.transform.localPosition}set localPosition(e){this.transform.localPosition=e}get localRotation(){return this.transform.localRotation}set localRotation(e){this.transform.localRotation=e}get localScale(){return this.transform.localScale}set localScale(e){this.transform.localScale=e}get localQuaternion(){return this.transform.localRotQuat}set localQuaternion(e){this.transform.localRotQuat=e}notifyChange(){this.transform.notifyChange()}get parent(){return this.transform.parent}get parentObject(){return this.transform.parent.object3D}set x(e){this.transform.x=e}get x(){return this.transform.x}set y(e){this.transform.y=e}get y(){return this.transform.y}set z(e){this.transform.z=e}get z(){return this.transform.z}set scaleX(e){this.transform.scaleX=e}get scaleX(){return this.transform.scaleX}set scaleY(e){this.transform.scaleY=e}get scaleY(){return this.transform.scaleY}set scaleZ(e){this.transform.scaleZ=e}get scaleZ(){return this.transform.scaleZ}set rotationX(e){this.transform.rotationX=e}get rotationX(){return this.transform.rotationX}set rotationY(e){this.transform.rotationY=e}get rotationY(){return this.transform.rotationY}set rotationZ(e){this.transform.rotationZ=e}get rotationZ(){return this.transform.rotationZ}fixedUpdate(){}lateUpdate(){}traverse(e){e(this);for(let t=0,a=this.entityChildren.length;t<a;t++){let r=this.entityChildren[t];r instanceof d.Object3D&&r.traverse(e)}}destroy(e){this.transform.eventDispatcher.removeEventListener(zt.LOCAL_ONCHANGE,this.onTransformLocalChange,this);const t=this.batchTable;t&&typeof t.destroy=="function"&&(t.destroy(),this.batchTable=null);const a=this.featureTable;a&&typeof a.destroy=="function"&&(a.destroy(),this.featureTable=null),super.destroy(e)}},d.Object3D=p2([A2],d.Object3D);function A2(s,e){return class extends d.Object3D{set active(t){this.transform.enable=t>0}get active(){return this.transform.enable?1:0}get materialColor(){return this.getComponent(d.MeshRenderer)?.material?.shader.getDefaultColorShader().baseColor}set materialColor(t){let a=this.getComponent(d.MeshRenderer)?.material;a&&(a.shader.getDefaultColorShader().baseColor=t)}notifyMaterialColorChange(t,a){this.getComponent(d.MeshRenderer).materials?.[t]?.shader.getDefaultColorShader().uniforms[a].onChange()}}}class dt{static createCamera3DObject(e,t){return this.createCamera3D(null,e,t)}static createCamera3D(e,t,a){return e||=new d.Object3D,t&&t.addChild(e),a&&(e.name=a),e.getOrAddComponent(Hr)}static UnProjection(e,t,a=1,r){let i=new b(e,t,0),n=1,o=b.HELP_0,l=w.canvas.offsetLeft,c=w.canvas.offsetTop,f=w.canvas.clientWidth,h=w.canvas.clientHeight;o.x=((i.x-l)*n/f-.5)*2,o.y=-((i.y-c)*n/h-.5)*2,o.z=a;let u=new b(0,0,0),g=R.helpMatrix2;g.copyFrom(r.projectionMatrix),g.invert();let A=R.helpMatrix;return A.identity(),A.multiply(g),A.multiply(r.transform.worldMatrix),A.perspectiveMultiplyPoint3(o,u),u}static Projection(e,t,a){let r=a||new b(0,0,0),i=R.helpMatrix;i.copyFrom(t.viewMatrix),i.multiply(t.projectionMatrix),i.perspectiveMultiplyPoint3(e,r);let n=w.canvas.clientWidth/2,o=w.canvas.clientHeight/2;return r.x=r.x*n+n,r.y=o-r.y*o,r}static UnProjection2(e,t,a,r,i){let n=i||new b(0,0,0),o=R.helpMatrix;o.copyFrom(r.pvMatrixInv);let l=w.canvas.clientWidth/2,c=w.canvas.clientHeight/2;return n.x=(e-l)/l,n.y=(c-t)/c,n.z=a,o.perspectiveMultiplyPoint3(n,n),n}}class Wt{static maxNumDirectionShadow=8;static maxNumPointShadow=8;static directionLightList;static pointLightList;static shadowLights;static init(){this.directionLightList=new Map,this.pointLightList=new Map,this.shadowLights=new Map}static createBuffer(e){if(!this.shadowLights.has(e.scene)){let t=new Float32Array(16);this.shadowLights.set(e.scene,t)}}static getShadowLightList(e){if(!e.transform.view3D)return null;if(e.lightData.lightType==ct.DirectionLight){let t=this.directionLightList.get(e.transform.view3D.scene);return t||(t=[],this.directionLightList.set(e.transform.view3D.scene,t)),t}else if(e.lightData.lightType==ct.PointLight){let t=this.pointLightList.get(e.transform.view3D.scene);return t||(t=[],this.pointLightList.set(e.transform.view3D.scene,t)),t}else if(e.lightData.lightType==ct.SpotLight){let t=this.pointLightList.get(e.transform.view3D.scene);return t||(t=[],this.pointLightList.set(e.transform.view3D.scene,t)),t}}static getShadowLightWhichScene(e,t){if(t==ct.DirectionLight){let a=this.directionLightList.get(e);return a||(a=[],this.directionLightList.set(e,a)),a}else if(t==ct.PointLight){let a=this.pointLightList.get(e);return a||(a=[],this.pointLightList.set(e,a)),a}}static getDirectShadowLightWhichScene(e){let t=this.directionLightList.get(e);return t||(t=[],this.directionLightList.set(e,t)),t}static getPointShadowLightWhichScene(e){let t=this.pointLightList.get(e);return t||(t=[],this.pointLightList.set(e,t)),t}static addShadowLight(e){if(!e.transform.view3D)return null;let t=e.transform.view3D.scene;if(e.lightData.lightType==ct.DirectionLight){let a=this.directionLightList.get(t);if(a||(a=[],this.directionLightList.set(t,a)),!e.shadowCamera){e.shadowCamera=dt.createCamera3DObject(null,"shadowCamera"),e.shadowCamera.isShadowCamera=!0;let r=-1e3;e.shadowCamera.orthoOffCenter(r,-r,r,-r,1,1e4)}return a.indexOf(e)==-1&&a.push(e),a}else if(e.lightData.lightType==ct.PointLight||e.lightData.lightType==ct.SpotLight){let a=this.pointLightList.get(t);return a&&a.length>=8||(a||(a=[],this.pointLightList.set(t,a)),a.indexOf(e)==-1&&a.push(e)),a}}static removeShadowLight(e){if(e.lightData.castShadowIndex=-1,!e.transform.view3D)return null;if(e.lightData.lightType==ct.DirectionLight){let t=this.directionLightList.get(e.transform.view3D.scene);if(t){let a=t.indexOf(e);a!=-1&&t.splice(a,1)}return e.lightData.castShadowIndex=-1,t}else if(e.lightData.lightType==ct.PointLight||e.lightData.lightType==ct.SpotLight){let t=this.pointLightList.get(e.transform.view3D.scene);if(t){let a=t.indexOf(e);a!=-1&&t.splice(a,1)}return e.lightData.castShadowIndex=-1,t}}static update(e){let t=this.shadowLights.get(e.scene),a=Wt.directionLightList.get(e.scene),r=Wt.pointLightList.get(e.scene),i=0,n=0,o=0,l=0;if(t.fill(0),a){let f=0;for(let h=0;h<a.length;h++){const u=a[h];t[h]=u.lightData.index,u.lightData.castShadowIndex=f++}n=a.length}if(r){o=n;let f=0;for(let h=o;h<r.length;h++){const u=r[h];t[h]=u.lightData.index,u.lightData.castShadowIndex=f++}l=o+r.length}ve.getAllCameraGroup().forEach(f=>{f.dirShadowStart=i,f.dirShadowEnd=n,f.pointShadowStart=o,f.pointShadowEnd=l,f.shadowLights.set(new Float32Array(t))})}}class Us{uuid;usage;globalBindGroup;uniformGPUBuffer;matrixBindGroup;uniformByteLength;matrixesByteLength;shadowMatrixRaw=new Float32Array(128);csmMatrixRaw=new Float32Array(ra.Cascades*16);csmShadowBias=new Float32Array(4);shadowLights=new Float32Array(16);dirShadowStart=0;dirShadowEnd=0;pointShadowStart=0;pointShadowEnd=0;constructor(e){this.uuid=Gt(),this.usage=GPUBufferUsage.UNIFORM|GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST,this.uniformGPUBuffer=new yt(8336),this.uniformGPUBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,this.matrixBindGroup=e,this.createBindGroup()}createBindGroup(){this.uniformByteLength=this.uniformGPUBuffer.memory.shareDataBuffer.byteLength,this.matrixesByteLength=R.block*4*R.maxCount,this.globalBindGroup=w.device.createBindGroup({label:"global_bindGroupLayout",layout:hs.getGlobalDataBindGroupLayout(),entries:[{binding:0,resource:{buffer:this.uniformGPUBuffer.buffer,offset:0,size:this.uniformByteLength}},{binding:1,resource:{buffer:this.matrixBindGroup.matrixBufferDst.buffer,offset:0,size:this.matrixesByteLength}}]})}setCamera(e){this.uniformGPUBuffer.setMatrix("_projectionMatrix",e.projectionMatrix),this.uniformGPUBuffer.setMatrix("_viewMatrix",e.viewMatrix),this.uniformGPUBuffer.setMatrix("_cameraWorldMatrix",e.transform.worldMatrix),this.uniformGPUBuffer.setMatrix("pvMatrixInv",e.projectionMatrixInv),this.uniformGPUBuffer.setMatrix("viewToWorld",e.cameraToWorld);let t=Wt.getDirectShadowLightWhichScene(e.transform.scene3D);this.csmShadowBias.fill(1e-4),this.shadowMatrixRaw.fill(0),this.csmMatrixRaw.fill(0);for(let l=0;l<8;l++)if(l<t.length){let c=t[l].shadowCamera;this.shadowMatrixRaw.set(c.pvMatrix.rawData,l*16)}else this.shadowMatrixRaw.set(e.transform.worldMatrix.rawData,l*16);this.uniformGPUBuffer.setFloat32Array("shadowMatrix",this.shadowMatrixRaw);let a=_.setting.shadow.shadowSize;if(ra.Cascades>1&&e.enableCSM&&t[0])for(let l=0;l<ra.Cascades;l++){let c=e.csm.children[l].shadowCamera;this.csmMatrixRaw.set(c.pvMatrix.rawData,l*16),this.csmShadowBias[l]=e.getCSMShadowBiasScale(c)}this.uniformGPUBuffer.setFloat32Array("csmShadowBias",this.csmShadowBias),this.uniformGPUBuffer.setFloat32Array("csmMatrix",this.csmMatrixRaw),this.uniformGPUBuffer.setFloat32Array("shadowLights",this.shadowLights);let r=_.setting.reflectionSetting,i=K.instance.getReflections(e.transform.scene3D).length;this.uniformGPUBuffer.setFloat("reflectionProbeSize",r.reflectionProbeSize),this.uniformGPUBuffer.setFloat("reflectionProbeMaxCount",r.reflectionProbeMaxCount),this.uniformGPUBuffer.setFloat("reflectionMapWidth",r.width),this.uniformGPUBuffer.setFloat("reflectionMapHeight",r.height),this.uniformGPUBuffer.setFloat("reflectionCount",i),this.uniformGPUBuffer.setFloat("test2",lt.testObj.testValue2),this.uniformGPUBuffer.setFloat("test3",lt.testObj.testValue3),this.uniformGPUBuffer.setFloat("test4",lt.testObj.testValue4),this.uniformGPUBuffer.setVector3("CameraPos",e.transform.worldPosition),this.uniformGPUBuffer.setFloat("frame",Le.frame),this.uniformGPUBuffer.setFloat32Array("SH",e.sh),this.uniformGPUBuffer.setFloat("time",Le.time),this.uniformGPUBuffer.setFloat("delta",Le.delta),this.uniformGPUBuffer.setFloat("shadowBias",e.getShadowBias(a)),this.uniformGPUBuffer.setFloat("skyExposure",_.setting.sky.skyExposure),this.uniformGPUBuffer.setFloat("renderPassState",_.setting.render.renderPassState),this.uniformGPUBuffer.setFloat("quadScale",_.setting.render.quadScale),this.uniformGPUBuffer.setFloat("hdrExposure",_.setting.render.hdrExposure),this.uniformGPUBuffer.setInt32("renderState_left",_.setting.render.renderState_left),this.uniformGPUBuffer.setInt32("renderState_right",_.setting.render.renderState_right),this.uniformGPUBuffer.setFloat("renderState_split",_.setting.render.renderState_split);let n=_.inputSystem.mouseX*w.pixelRatio,o=_.inputSystem.mouseY*w.pixelRatio;this.uniformGPUBuffer.setFloat("mouseX",n),this.uniformGPUBuffer.setFloat("mouseY",o),this.uniformGPUBuffer.setFloat("windowWidth",w.windowWidth),this.uniformGPUBuffer.setFloat("windowHeight",w.windowHeight),this.uniformGPUBuffer.setFloat("near",e.near),this.uniformGPUBuffer.setFloat("far",e.far),this.uniformGPUBuffer.setFloat("pointShadowBias",_.setting.shadow.pointShadowBias),this.uniformGPUBuffer.setFloat("shadowMapSize",a),this.uniformGPUBuffer.setFloat("shadowSoft",_.setting.shadow.shadowSoft),this.uniformGPUBuffer.setFloat("enableCSM",e.enableCSM?1:0),this.uniformGPUBuffer.setFloat("csmMargin",_.setting.shadow.csmMargin),this.uniformGPUBuffer.setInt32("nDirShadowStart",this.dirShadowStart),this.uniformGPUBuffer.setInt32("nDirShadowEnd",this.dirShadowEnd),this.uniformGPUBuffer.setInt32("nPointShadowStart",this.pointShadowStart),this.uniformGPUBuffer.setInt32("nPointShadowEnd",this.pointShadowEnd),this.uniformGPUBuffer.setVector3("cameraForward",e.transform.forward),this.uniformGPUBuffer.setVector4Array("frustumPlanes",e.frustum.planes),this.uniformGPUBuffer.apply()}setShadowCamera(e){this.uniformGPUBuffer.setMatrix("_projectionMatrix",e.projectionMatrix),this.uniformGPUBuffer.setMatrix("_viewMatrix",e.viewMatrix),this.uniformGPUBuffer.setMatrix("_pvMatrix",e.pvMatrix),this.uniformGPUBuffer.setMatrix("pvMatrixInv",e.projectionMatrixInv),this.uniformGPUBuffer.setMatrix("viewToWorld",e.cameraToWorld),this.csmShadowBias.fill(1e-4),this.shadowMatrixRaw.fill(0),this.csmMatrixRaw.fill(0),this.uniformGPUBuffer.setFloat32Array("shadowCamera",this.shadowMatrixRaw),this.uniformGPUBuffer.setFloat32Array("csmShadowBias",this.csmShadowBias),this.uniformGPUBuffer.setFloat32Array("csmMatrix",this.csmMatrixRaw),this.uniformGPUBuffer.setFloat32Array("shadowLights",this.shadowLights),this.uniformGPUBuffer.setVector3("CameraPos",e.transform.worldPosition),this.uniformGPUBuffer.setFloat("frame",Le.frame),this.uniformGPUBuffer.setFloat32Array("SH",e.sh),this.uniformGPUBuffer.setFloat("time",Le.time),this.uniformGPUBuffer.setFloat("delta",Le.delta),this.uniformGPUBuffer.setFloat("shadowBias",_.setting.shadow.shadowBias),this.uniformGPUBuffer.setFloat("skyExposure",_.setting.sky.skyExposure),this.uniformGPUBuffer.setFloat("renderPassState",_.setting.render.renderPassState),this.uniformGPUBuffer.setFloat("quadScale",_.setting.render.quadScale),this.uniformGPUBuffer.setFloat("hdrExposure",_.setting.render.hdrExposure),this.uniformGPUBuffer.setInt32("renderState_left",_.setting.render.renderState_left),this.uniformGPUBuffer.setInt32("renderState_right",_.setting.render.renderState_right),this.uniformGPUBuffer.setFloat("renderState_split",_.setting.render.renderState_split);let t=_.inputSystem.mouseX*w.pixelRatio,a=_.inputSystem.mouseY*w.pixelRatio;this.uniformGPUBuffer.setFloat("mouseX",t),this.uniformGPUBuffer.setFloat("mouseY",a),this.uniformGPUBuffer.setFloat("windowWidth",w.windowWidth),this.uniformGPUBuffer.setFloat("windowHeight",w.windowHeight),this.uniformGPUBuffer.setFloat("near",e.near),this.uniformGPUBuffer.setFloat("far",e.far),this.uniformGPUBuffer.setFloat("pointShadowBias",_.setting.shadow.pointShadowBias),this.uniformGPUBuffer.setFloat("shadowMapSize",_.setting.shadow.shadowSize),this.uniformGPUBuffer.setFloat("shadowSoft",_.setting.shadow.shadowSoft),this.uniformGPUBuffer.setFloat("enableCSM",0),this.uniformGPUBuffer.setFloat("csmMargin",_.setting.shadow.csmMargin),this.uniformGPUBuffer.setInt32("nDirShadowStart",this.dirShadowStart),this.uniformGPUBuffer.setInt32("nDirShadowEnd",this.dirShadowEnd),this.uniformGPUBuffer.setInt32("nPointShadowStart",this.pointShadowStart),this.uniformGPUBuffer.setInt32("nPointShadowEnd",this.pointShadowEnd),this.uniformGPUBuffer.apply()}setShadowLight(){}}class t0{setting;probesBufferData;probesBuffer;isVolumeFrameChange=!0;randomOrientation;startPosition=new b;isVolumeChange=!0;irradianceVolumeBuffer;directionDistance=20;randomSeedCount=3;useRandomIndex=0;centerDirection=new b(0,0,this.directionDistance).normalize(1);arroundPositions=[];updateOrientation(){return this.useRandomIndex++,this.useRandomIndex>=this.arroundPositions.length&&(this.useRandomIndex=0),R.fromToRotation(this.centerDirection,this.arroundPositions[this.useRandomIndex],this.randomOrientation),this.randomOrientation}init(e){this.setting=e,this.randomOrientation=new R(!1),this.randomOrientation.identity(),this.irradianceVolumeBuffer=new yt(80),this.createFramesBuffer(),this.arroundPositions.push(this.centerDirection.clone());for(let t=0;t<this.randomSeedCount;t++){let a=Math.PI*2*t/this.randomSeedCount,r=new b(Math.sin(a),Math.cos(a),this.directionDistance).normalize(1);this.arroundPositions.push(r)}}setVolumeDataChange(){this.isVolumeChange=!0}updateProbes(e){let t=this.probesBufferData;for(let a of e){let r=a.index*4;t[r+3]=a.drawCallFrame}}createFramesBuffer(){if(!this.probesBufferData){let e=this.setting.probeXCount*this.setting.probeYCount*this.setting.probeZCount;this.probesBufferData=new Float32Array(e*4),this.probesBufferData.fill(-1),this.probesBuffer=new Te(e*4,GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST)}}uploadBuffer(){this.isVolumeChange&&(this.fillIrradianceData(),this.isVolumeChange=!1,this.isVolumeFrameChange=!0),this.probesBuffer.setFloat32Array("uniformFramesBuffer",this.probesBufferData)}calcPosition(e,t,a,r){let i=this.setting,n=this.setting.probeSpace;return r=r||new b,r.x=e*n-n*(i.probeXCount-1)*.5+i.offsetX,r.y=t*n-n*(i.probeYCount-1)*.5+i.offsetY,r.z=a*n-n*(i.probeZCount-1)*.5+i.offsetZ,r}debugX=0;debugY=0;debugZ=0;fillIrradianceData(){let e=this.setting,t=this.calcPosition(0,0,0,this.startPosition);this.irradianceVolumeBuffer.setFloat("orientationIndex",this.randomOrientation.index),this.irradianceVolumeBuffer.setFloat("hysteresis",e.hysteresis),this.irradianceVolumeBuffer.setFloat("OctRTSideSize",e.octRTSideSize),this.irradianceVolumeBuffer.setFloat("OctRTMaxSize",e.octRTMaxSize),this.irradianceVolumeBuffer.setFloat("startX",t.x),this.irradianceVolumeBuffer.setFloat("startY",t.y),this.irradianceVolumeBuffer.setFloat("startZ",t.z),this.irradianceVolumeBuffer.setFloat("ProbeSpace",e.probeSpace),this.irradianceVolumeBuffer.setFloat("probeXCount",e.probeXCount),this.irradianceVolumeBuffer.setFloat("probeYCount",e.probeYCount),this.irradianceVolumeBuffer.setFloat("probeZCount",e.probeZCount),this.irradianceVolumeBuffer.setFloat("maxDistance",e.probeSpace*1.732),this.irradianceVolumeBuffer.setFloat("depthSharpness",e.depthSharpness),this.irradianceVolumeBuffer.setFloat("ProbeSourceTextureSize",e.probeSourceTextureSize),this.irradianceVolumeBuffer.setFloat("ProbeSize",e.probeSize),this.irradianceVolumeBuffer.setFloat("bounceIntensity",e.bounceIntensity),this.irradianceVolumeBuffer.setFloat("probeRoughness",e.probeRoughness),this.irradianceVolumeBuffer.setFloat("normalBias",e.normalBias),this.irradianceVolumeBuffer.setFloat("irradianceChebyshevBias",e.irradianceChebyshevBias),this.irradianceVolumeBuffer.setFloat("rayNumber",e.rayNumber),this.irradianceVolumeBuffer.setFloat("irradianceDistanceBias",e.irradianceDistanceBias),this.irradianceVolumeBuffer.setFloat("indirectIntensity",e.indirectIntensity),this.irradianceVolumeBuffer.setFloat("ddgiGamma",e.ddgiGamma),this.irradianceVolumeBuffer.setFloat("lerpHysteresis",e.lerpHysteresis),this.irradianceVolumeBuffer.setFloat("debugX",this.debugX),this.irradianceVolumeBuffer.setFloat("debugY",this.debugY),this.irradianceVolumeBuffer.setFloat("debugZ",this.debugZ),this.irradianceVolumeBuffer.apply()}}class a0{storageGPUBuffer;irradianceVolume;_lightList=[];constructor(){this.storageGPUBuffer=new Te(fn.lightSize*_.setting.light.maxLight,GPUBufferUsage.COPY_SRC),this.irradianceVolume=new t0,this.irradianceVolume.init(_.setting.gi);for(let e=0;e<_.setting.light.maxLight;e++){let t=this.storageGPUBuffer.memory.allocation_node(fn.lightSize*4);this._lightList.push(t)}this.storageGPUBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE}update(e){this.storageGPUBuffer.clean();let t=K.instance.getLights(e.scene);for(let a=0;a<t.length;a++){const r=t[a].lightData;r.index=a,this.writeLightBytes(r,this._lightList[a])}this.storageGPUBuffer.apply()}writeLightBytes(e,t){t.offset=0,t.writeFloat(e.index),t.writeInt32(e.lightType),t.writeFloat(e.radius),t.writeFloat(e.linear),t.writeVector3(e.lightPosition),t.writeFloat(e.lightMatrixIndex),t.writeVector3(e.direction),t.writeFloat(e.quadratic),t.writeRGBColor(e.lightColor),t.writeFloat(e.intensity),t.writeFloat(e.innerAngle),t.writeFloat(e.outerAngle),t.writeFloat(e.range),t.writeInt32(e.castShadowIndex),t.writeVector3(e.lightTangent),t.writeFloat(e.iesIndex)}}class r0{storageGPUBuffer;reflectionMap;sourceReflectionMap;count;constructor(){this.storageGPUBuffer=new Te(768)}update(e){this.storageGPUBuffer.clean();let t=K.instance.getReflections(e.scene);for(let a=0;a<t.length;a++){const r=t[a];r.gid=a,this.storageGPUBuffer.setFloat("gid",r.gid),this.storageGPUBuffer.setVector3("worldPosition",r.transform.worldPosition),this.storageGPUBuffer.setFloat("radius",r.radius),this.storageGPUBuffer.setVector3("bound",r.transform.worldPosition)}this.count=t.length,this.storageGPUBuffer.apply()}}class i0 extends ja{size;constructor(e,t=0,a){super(),this.bufferType=ga.StorageGPUBuffer,this.size=e,this.createBuffer(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|t,e,a,"MatrixGPUBuffer")}writeBufferByHeap(e,t){let a;e instanceof Float64Array?a=new Float32Array(e):a=e;let r=w.device;if(a.length>0){let i=null;for(;this.mapAsyncReady.length&&(i=this.mapAsyncReady.shift(),i.usedSize!=a.byteLength);)i.destroy(),this.mapAsyncBuffersOutstanding--,i=null;i||(i=r.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.MAP_WRITE,mappedAtCreation:!0}),i.usedSize=a.byteLength,this.mapAsyncBuffersOutstanding++,this.mapAsyncBuffersOutstanding>10&&console.warn(` Warning: mapAsync requests from ${this.mapAsyncBuffersOutstanding} frames ago have not resolved yet. MB of staging buffers allocated.`));let n=new Float32Array(a.buffer,a.byteOffset,t);new Float32Array(i.getMappedRange(0,t*4)).set(n),i.unmap();const l=r.createCommandEncoder();l.copyBufferToBuffer(i,0,this.buffer,0,t*4),r.queue.submit([l.finish()]),i.mapAsync(GPUMapMode.WRITE).then(()=>this.mapAsyncReady.push(i))}}}class n0{uuid;index;usage;groupBufferSize;matrixBufferDst;constructor(){this.uuid=Gt(),this.groupBufferSize=0,this.usage=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST,this.cacheWorldMatrix()}cacheWorldMatrix(){this.groupBufferSize=R.maxCount*R.blockBytes,this.matrixBufferDst=new i0(this.groupBufferSize/4),this.matrixBufferDst.visibility=GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,this.matrixBufferDst.buffer.label=this.groupBufferSize.toString()}writeBuffer(e){const t=R.dynamicMatrixBytes;this.matrixBufferDst.mapAsyncWrite(t,e)}}class ve{static _cameraBindGroups;static _lightEntriesMap;static _reflectionEntriesMap;static modelMatrixBindGroup;static init(){this.modelMatrixBindGroup=new n0,this._cameraBindGroups=new Map,this._lightEntriesMap=new Map,this._reflectionEntriesMap=new Map}static getAllCameraGroup(){return this._cameraBindGroups}static getCameraGroup(e){let t=this._cameraBindGroups.get(e);return t||(t=new Us(this.modelMatrixBindGroup),this._cameraBindGroups.set(e,t)),e.isShadowCamera?t.setShadowCamera(e):t.setCamera(e),t}static updateCameraGroup(e){let t=this._cameraBindGroups.get(e);t||(t=new Us(this.modelMatrixBindGroup),this._cameraBindGroups.set(e,t)),e.isShadowCamera?t.setShadowCamera(e):t.setCamera(e)}static getLightEntries(e){e||console.log("getLightEntries scene is null");let t=this._lightEntriesMap.get(e);return t||(t=new a0,this._lightEntriesMap.set(e,t)),this._lightEntriesMap.get(e)}static getReflectionEntries(e){e||console.log("getLightEntries scene is null");let t=this._reflectionEntriesMap.get(e);return t||(t=new r0,this._reflectionEntriesMap.set(e,t)),this._reflectionEntriesMap.get(e)}}class F{static lastGeometry;static lastPipeline;static lastShader;static drawCount=0;static renderPassCount=0;static geometryCount=0;static pipelineCount=0;static matrixCount=0;static lastRenderPassState;static LastCommand;static bindPipeline(e,t){if(F.lastShader!=t)F.lastShader=t;else return!1;F.lastPipeline!=t.pipeline&&(F.lastPipeline=t.pipeline,e.setPipeline(t.pipeline));for(let a=1;a<t.bindGroups.length;a++){const r=t.bindGroups[a];r&&e.setBindGroup(a,r)}return!0}static bindCamera(e,t){let a=ve.getCameraGroup(t);e.setBindGroup(0,a.globalBindGroup)}static bindGeometryBuffer(e,t){if(this.lastGeometry!=t&&(this.lastGeometry=t,t.indicesBuffer)){e.setIndexBuffer(t.indicesBuffer.indicesGPUBuffer.buffer,t.indicesBuffer.indicesFormat);let a=t.vertexBuffer.vertexGPUBuffer,r=t.vertexBuffer.vertexBufferLayouts;for(let i=0;i<r.length;i++){const n=r[i];e.setVertexBuffer(i,a.buffer,n.offset,n.size)}}}static cleanCache(){this.lastGeometry=null,this.lastPipeline=null,this.lastShader=null}static createPipeline(e){return lt.countStart("GPUContext","pipeline"),w.device.createRenderPipeline(e)}static beginCommandEncoder(){return lt.countStart("GPUContext","beginCommandEncoder"),this.LastCommand&&w.device.queue.submit([this.LastCommand.finish()]),this.LastCommand=w.device.createCommandEncoder(),this.LastCommand}static endCommandEncoder(e){this.LastCommand==e&&(w.device.queue.submit([this.LastCommand.finish()]),this.LastCommand=null,lt.countStart("GPUContext","endCommandEncoder"))}static recordBundleEncoder(e){return w.device.createRenderBundleEncoder(e)}static beginRenderPass(e,t){if(this.cleanCache(),this.renderPassCount++,this.lastRenderPassState=t,t.depthTexture){let a=t.renderPassDescriptor.depthStencilAttachment;a.view=t.depthTexture.getGPUView()}if(t.renderTargets&&t.renderTargets.length>0){for(let a=0;a<t.renderTargets.length;++a){const r=t.renderTargets[a];let i=t.renderPassDescriptor.colorAttachments[a];t.multisample>0&&t.renderTargets.length==1?(i.view=t.multiTexture.createView(),i.resolveTarget=r.getGPUView()):i.view=r.getGPUTexture().createView()}return e.beginRenderPass(t.renderPassDescriptor)}else{let a=t.renderPassDescriptor.colorAttachments[0];return a&&(t.multisample>0?(a.view=t.multiTexture.createView(),a.resolveTarget=w.context.getCurrentTexture().createView()):a.view=w.context.getCurrentTexture().createView()),e.beginRenderPass(t.renderPassDescriptor)}}static drawIndexed(e,t,a,r,i,n){e.drawIndexed(t,a,r,i,n),this.drawCount++}static draw(e,t,a,r,i){e.draw(t,a,r,i),this.drawCount++}static endPass(e){e.insertDebugMarker("end"),e.end()}static computeCommand(e,t){let a=e.beginComputePass();for(let r=0;r<t.length;r++)t[r].compute(a);a.end()}static copyTexture(e,t,a){e.copyTextureToTexture({texture:t.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{texture:a.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{width:a.width,height:a.height,depthOrArrayLayers:1})}}class s0{source;input;output;reset(e){this.input&&this.input.destroy(),this.output&&this.output.destroy(),this.input=this.output=null,this.source=e}apply(e){if(this.source){if(!this.input){let t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST;this.input=new Te(this.source.length,t,this.source),this.input.apply()}if(!this.output){let t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC;this.output=new Te(e*3,t),this.output.apply()}}}}class o0{enable;morphTargetsRelative;MaxMorphTargetCount=64;_computeConfigArray;_computeConfigBuffer;_morphInfluenceArray;_morphInfluenceBuffer;_positionAttrDataGroup;_normalAttrDataGroup;_isInfluenceDirty;_morphTargetCount;_totalVertexCount;_computeShader;_computeShaders;_computeWorkGroupXY=1;_collectMorphTargetData;_blendTarget;constructor(){this._isInfluenceDirty=!0,this.generateGPUBuffer(),this._positionAttrDataGroup=new s0,this._normalAttrDataGroup=new s0}initMorphTarget(e){this._collectMorphTargetData=this.collectMorphTargetList(e),this._computeShader&&this._computeShader.destroy();let t=Xt.CsMain;this._computeShader=new ye(t),this._collectMorphTargetData.mergedNormal?this._computeShader.setDefine("USE_MORPHNORMALS",!0):this._computeShader.deleteDefine("USE_MORPHNORMALS"),this._computeShaders=[this._computeShader],this._isInfluenceDirty=!0,this._morphTargetCount=this._collectMorphTargetData.mtCount,this._totalVertexCount=this._collectMorphTargetData.vCount,this._morphInfluenceArray.fill(0),this._computeWorkGroupXY=this.calcWorkGroup(this._totalVertexCount),this._positionAttrDataGroup.reset(this._collectMorphTargetData.mergedPos),this._normalAttrDataGroup.reset(this._collectMorphTargetData.mergedNormal)}applyRenderShader(e){this.uploadMorphTargetBuffer(),this.uploadConfigGBuffer(),e.setUniformBuffer("morphTargetConfig",this._computeConfigBuffer),e.setStorageBuffer("morphTargetOpPositions",this._positionAttrDataGroup.output),this._collectMorphTargetData.mergedNormal&&e.setStorageBuffer("morphTargetOpNormals",this._normalAttrDataGroup.output)}computeMorphTarget(e){this.uploadConfigGBuffer(),this.uploadMorphTargetBuffer(),this._computeShader.setUniformBuffer("morphTargetConfig",this._computeConfigBuffer),this._computeShader.setStorageBuffer("morphTargetInfluence",this._morphInfluenceBuffer),this._computeShader.setStorageBuffer("morphTargetPositions",this._positionAttrDataGroup.input),this._computeShader.setStorageBuffer("morphTargetOpPositions",this._positionAttrDataGroup.output),this._collectMorphTargetData.mergedNormal&&(this._computeShader.setStorageBuffer("morphTargetNormals",this._normalAttrDataGroup.input),this._computeShader.setStorageBuffer("morphTargetOpNormals",this._normalAttrDataGroup.output)),this._computeShader.workerSizeX=this._computeWorkGroupXY,this._computeShader.workerSizeY=this._computeWorkGroupXY,this._computeShader.workerSizeZ=1,F.computeCommand(e,this._computeShaders)}updateInfluence(e,t){this._isInfluenceDirty=!0,this._morphInfluenceArray[e]=t}get blendShape(){return this._blendTarget}collectMorphTargetList(e){let t=this.collectAttribute("a_morphPositions_",e),a=t.length,r=t[0].data.length/3;if(this._blendTarget={},e.blendShapeData)for(let l=0;l<e.blendShapeData.shapeIndexs.length;l++){let c=e.blendShapeData.shapeIndexs[l],f=e.blendShapeData.shapeNames[l].split("."),h=f[f.length-1];this._blendTarget[h]=u=>this.updateInfluence(c,u)}let i=new Float32Array(r*a*3);{let l=0;for(let c=0;c<a;c++){let f=t[c];i.set(f.data,l),l+=f.data.length}}let n=this.collectAttribute("a_morphNormals_",e),o;if(n&&n.length>0){let l=0;o=new Float32Array(r*a*3);for(let c=0;c<a;c++){let f=n[c];o.set(f.data,l),l+=f.data.length}}return{mtCount:a,vCount:r,mergedPos:i,mergedNormal:o}}collectAttribute(e,t){let a=[];for(let r=0;r<this.MaxMorphTargetCount;r++){let i=e+r,n=t.getAttribute(i);if(n)a[r]=n;else break}return a}uploadConfigGBuffer(){if(this._isInfluenceDirty){let e=0;for(let t=0;t<this._morphTargetCount;t++)e+=this._morphInfluenceArray[t];this._morphInfluenceBuffer.setFloat32Array("data",this._morphInfluenceArray),this._morphInfluenceBuffer.apply(),this._computeConfigArray[0]=this.morphTargetsRelative?1:1-e,this._computeConfigArray[1]=this._morphTargetCount,this._computeConfigArray[2]=this._totalVertexCount,this._computeConfigArray[3]=this._computeWorkGroupXY,this._computeConfigBuffer.setFloat32Array("data",this._computeConfigArray),this._computeConfigBuffer.apply(),this._isInfluenceDirty=!1}}calcWorkGroup(e){let t=Math.ceil(Math.sqrt(e)),a=Math.ceil(Math.log2(t));return t=Math.pow(2,a),t}uploadMorphTargetBuffer(){this._positionAttrDataGroup.output||this._positionAttrDataGroup.apply(this._totalVertexCount),this._normalAttrDataGroup.output||this._normalAttrDataGroup.apply(this._totalVertexCount)}generateGPUBuffer(){this._computeConfigArray=new Float32Array(4),this._computeConfigBuffer=new yt(4),this._morphInfluenceArray=new Float32Array(this.MaxMorphTargetCount);let e=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST;this._morphInfluenceBuffer=new Te(this.MaxMorphTargetCount,e)}destroy(e){this._computeConfigBuffer&&(this._computeConfigBuffer.destroy(e),this._computeConfigBuffer=null),this._morphInfluenceBuffer&&(this._morphInfluenceBuffer.destroy(e),this._morphInfluenceBuffer=null),this._computeShader&&(this._computeShader.destroy(e),this._computeShader=null),this._positionAttrDataGroup&&(this._positionAttrDataGroup.input&&this._positionAttrDataGroup.input.destroy(e),this._positionAttrDataGroup.output&&this._positionAttrDataGroup.output.destroy(e),this._positionAttrDataGroup=null),this._normalAttrDataGroup&&(this._normalAttrDataGroup.input&&this._normalAttrDataGroup.input.destroy(e),this._normalAttrDataGroup.output&&this._normalAttrDataGroup.output.destroy(e),this._normalAttrDataGroup=null),this._computeConfigArray=null,this._morphInfluenceArray=null,this._collectMorphTargetData=null,this._blendTarget=null,this._computeShaders=null}}var D2=Object.defineProperty,_2=Object.getOwnPropertyDescriptor,ys=(s,e,t,a)=>{for(var r=a>1?void 0:a?_2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=(a?n(e,t,r):n(r))||r);return a&&r&&D2(e,t,r),r};d.MeshRenderer=class extends Qa{receiveShadow;morphData;constructor(){super()}onEnable(){super.onEnable()}onDisable(){super.onDisable()}cloneTo(e){e.addComponent(d.MeshRenderer).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.receiveShadow=e.receiveShadow,this}get geometry(){return this._geometry}set geometry(e){if(super.geometry=e,e){let t=e.morphTargetDictionary!=null;t&&(this.morphData||=new o0,this.morphData.morphTargetsRelative=e.morphTargetsRelative,this.morphData.initMorphTarget(e)),this.morphData&&(this.morphData.enable=t),this.morphData?.enable?this.addRendererMask(Qe.MorphTarget):this.removeRendererMask(Qe.MorphTarget),this.object3D.bound=this._geometry.bounds.clone()}else this.morphData&&(this.morphData.enable=!1),this.removeRendererMask(Qe.MorphTarget);this._readyPipeline||(this.initPipeline(),this._computes&&(this.onCompute=nn(this.onCompute,()=>{for(let t=0;t<this._computes.length;t++)this._computes[t].onUpdate()})))}get material(){return this._materials[0]}set material(e){this.materials=[e]}setMorphInfluence(e,t){if(this.morphData&&this.morphData.enable){let a=this._geometry.morphTargetDictionary[e];a>=0&&this.morphData.updateInfluence(a,t)}}setMorphInfluenceIndex(e,t){this.morphData&&this.morphData.enable&&e>=0&&this.morphData.updateInfluence(e,t)}onCompute(e,t){this.morphData&&this.morphData.enable&&this.morphData.computeMorphTarget(t)}nodeUpdate(e,t,a,r){if(this.morphData&&this.morphData.enable)for(let i=0;i<this.materials.length;i++){let o=this.materials[i].getPass(t);if(o)for(let l=0;l<o.length;l++)this.morphData.applyRenderShader(o[l])}super.nodeUpdate(e,t,a,r)}destroy(e){this.morphData&&(this.morphData.destroy(e),this.morphData=null),super.destroy(e)}},ys([jr],d.MeshRenderer.prototype,"geometry",1),ys([jr],d.MeshRenderer.prototype,"material",1),d.MeshRenderer=ys([Lt(d.MeshRenderer,"MeshRenderer")],d.MeshRenderer);class Ta{static compressGBufferTex_NAME="compressGBufferTex_NAME";static colorBufferTex_NAME="colorBufferTex";static positionBufferTex_NAME="positionBufferTex";static normalBufferTex_NAME="normalBufferTex";static materialBufferTex_NAME="materialBufferTex";static zBufferTexture_NAME="zBufferTexture";static zPreDepthTexture_NAME="zPreDepthTexture";static outTex_NAME="outTex"}class l0{label="";customSize=!1;zPreTexture=null;depthTexture=null;renderTargetTextures;outColor=-1;renderTargets;rtTextureDescriptors;irradianceBuffer;multisample=0;multiTexture;depthViewIndex=0;depthCleanValue=0;isOutTarget=!0;camera3D;rtFrame;renderPassDescriptor;renderBundleEncoderDescriptor;depthLoadOp;getLastRenderTexture(){return this.renderTargets&&this.renderTargets.length>0?this.renderTargets[0]:_.res.redTexture}}class kt extends ft{resolveTarget;sampleCount;autoResize;clear;constructor(e,t,a=se.rgba8unorm,r=!1,i,n=1,o=0,l=!0,c=!0){super(e,t,n),this.name=Gt(),this.autoResize=c,this.useMipmap=r,this.sampleCount=o,this.format=a,this.numberLayer=n,this.clear=l,i!=null?this.usage=i:this.usage=i|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.COPY_DST,this.resize(e,t),this.autoResize&&w.addEventListener(nr.RESIZE,f=>{let{width:h,height:u}=f.data;this.resize(h,u),this._textureChange=!0},this)}resize(e,t){let a=w.device;this.gpuTexture&&(ft.delayDestroyTexture(this.gpuTexture),this.gpuTexture=null,this.view=null),this.width=e,this.height=t,this.createTextureDescriptor(e,t,1,this.format,this.usage,this.numberLayer,this.sampleCount),this.useMipmap=!1,this.visibility=GPUShaderStage.COMPUTE|GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,this.format==se.rgba32float?(this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="unfilterable-float",this.gpuSampler=a.createSampler({})):this.format==se.depth32float?(this.samplerBindingLayout.type="filtering",this.sampler_comparisonBindingLayout.type="comparison",this.textureBindingLayout.sampleType="depth",this.gpuSampler=w.device.createSampler({}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})):this.format==se.depth24plus?(this.samplerBindingLayout={type:"filtering"},this.sampler_comparisonBindingLayout={type:"comparison"},this.textureBindingLayout.sampleType="depth",this.gpuSampler=w.device.createSampler({}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})):(this.samplerBindingLayout.type="filtering",this.textureBindingLayout.sampleType="float",this.sampleCount>0&&(this.textureBindingLayout.multisampled=!0),this.minFilter="linear",this.magFilter="linear",this.mipmapFilter="linear",this.addressModeU=Ht.clamp_to_edge,this.addressModeV=Ht.clamp_to_edge,this.gpuSampler=a.createSampler(this)),this._textureChange=!0}create(e,t,a=!0){let r=w.device;const i=e*4;let n=new Float32Array(e*t*4);const o=r.createBuffer({size:n.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});r.queue.writeBuffer(o,0,n);const l=F.beginCommandEncoder();l.copyBufferToTexture({buffer:o,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(l)}clone(){let e=new kt(this.width,this.height,this.format,this.useMipmap,this.usage,this.numberLayer,this.sampleCount,this.clear,this.autoResize);return e.name="clone_"+e.name,e}readTextureToImage(){let e=w.device,t=w.windowWidth,a=w.windowHeight,r=new Float32Array(t*a*4);const i=e.createBuffer({size:r.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});return F.beginCommandEncoder().copyTextureToBuffer({texture:this.getGPUTexture()},{buffer:i},[t,a]),i.getMappedRange(0,r.byteLength)}}class Ge{storeOp="store";loadOp="clear";clearValue=[0,0,0,0]}class rt{label;customSize=!1;renderTargets;rtDescriptors;zPreTexture;depthTexture;depthViewIndex=0;depthCleanValue=1;depthLoadOp="clear";isOutTarget=!0;constructor(e,t,a,r,i=!0){this.renderTargets=e,this.rtDescriptors=t,this.depthTexture=a,this.zPreTexture=r,this.isOutTarget=i}clone2Frame(e){e.renderTargets.push(...this.renderTargets.concat());for(let t=0;t<this.rtDescriptors.length;t++){const a=this.rtDescriptors[t];let r=new Ge;r.loadOp=a.loadOp,r.storeOp=a.storeOp,r.clearValue=a.clearValue,e.rtDescriptors.push(r)}e.depthTexture=this.depthTexture,e.zPreTexture=this.zPreTexture,e.customSize=this.customSize}clone(){let e=new rt([],[]);return this.clone2Frame(e),e}}class _e extends rt{static colorPass_GBuffer="ColorPassGBuffer";static reflections_GBuffer="reflections_GBuffer";static gui_GBuffer="gui_GBuffer";static gBufferMap=new Map;_colorBufferTex;_compressGBufferTex;constructor(){super([],[])}createGBuffer(e,t,a,r=!0,i=!0,n){let o=this.renderTargets,l=this.rtDescriptors;if(i){let f=new Ge;f.loadOp="clear",this._colorBufferTex=Et.createRTTexture(e+Ta.colorBufferTex_NAME,t,a,se.rgba16float,!0),o.push(this._colorBufferTex),l.push(f)}this._compressGBufferTex=new kt(t,a,se.rgba32float,!1,void 0,1,0,!0,!0),o.push(this._compressGBufferTex),n?this.depthTexture=n:(this.depthTexture=new kt(t,a,se.depth24plus,!1,void 0,1,0,!0,!0),this.depthTexture.name=e+"_depthTexture");let c;c=new Ge,l.push(c)}getPositionMap(){return this.renderTargets[1]}getNormalMap(){return this.renderTargets[2]}getColorTexture(){return this._colorBufferTex}getCompressGBufferTexture(){return this._compressGBufferTex}static getGBufferFrame(e,t=0,a=0,r=!0,i){let n;if(_e.gBufferMap.has(e))n=_e.gBufferMap.get(e);else{n=new _e;let o=w.presentationSize;n.createGBuffer(e,t==0?o[0]:t,a==0?o[1]:a,t!=0&&a!=0,r,i),_e.gBufferMap.set(e,n)}return n}static getGUIBufferFrame(){let e=this.getGBufferFrame(this.colorPass_GBuffer);return _e.getGBufferFrame(_e.gui_GBuffer,0,0,!0,e.depthTexture)}clone(){let e=new _e;return this.clone2Frame(e),e}}class Je{static rendererPassState=new Map;static createRendererPassState(e,t=null){let a=Je.rendererPassState.get(e);if(a||(a=new l0,a.label=e.label,a.customSize=e.customSize,a.rtFrame=e,a.zPreTexture=e.zPreTexture,a.depthTexture=e.depthTexture,a.depthViewIndex=e.depthViewIndex,a.isOutTarget=e.isOutTarget,a.depthCleanValue=e.depthCleanValue,a.depthLoadOp=e.depthLoadOp,Je.rendererPassState.set(e,a)),e&&e.renderTargets.length>0){a.renderTargets=e.renderTargets,a.rtTextureDescriptors=e.rtDescriptors,a.renderPassDescriptor=Je.getRenderPassDescriptor(a),a.renderPassDescriptor.depthStencilAttachment&&(a.renderPassDescriptor.depthStencilAttachment.depthLoadOp=e.depthLoadOp),t=="load"&&e?.renderTargets[0]&&e.renderTargets[0].name.startsWith(_e.gui_GBuffer)&&(a.renderPassDescriptor.colorAttachments[0].loadOp="load"),a.depthLoadOp=e.depthLoadOp,a.renderBundleEncoderDescriptor=Je.getRenderBundleDescriptor(a),a.renderTargetTextures=[];for(let r=0;r<e.renderTargets.length;r++){const i=e.renderTargets[r];a.renderTargetTextures[r]={format:i.format},i.name.indexOf(Ta.colorBufferTex_NAME)!=-1&&(a.outColor=r)}}else a.renderPassDescriptor=Je.getRenderPassDescriptor(a,t),a.renderBundleEncoderDescriptor=Je.getRenderBundleDescriptor(a),a.renderTargetTextures=[{format:w.presentationFormat}],a.outColor=0;return a}static getRenderPassDescriptor(e,t=null){if(e.renderPassDescriptor)return e.renderPassDescriptor;w.device,w.presentationSize;let a=[];if(e.renderTargets&&e.renderTargets.length>0){e.renderTargets[0].width,e.renderTargets[0].height;for(let i=0;i<e.renderTargets.length;i++){const n=e.renderTargets[i],o=e.rtTextureDescriptors[i];a.push({view:n.getGPUView(),resolveTarget:void 0,loadOp:o.loadOp,clearValue:o.clearValue,storeOp:o.storeOp})}}else if(!e.customSize){let i=w.canvasConfig&&w.canvasConfig.alpha?[1,1,1,0]:[0,0,0,1];e.isOutTarget==!0&&a.push({view:void 0,resolveTarget:void 0,loadOp:w.canvasConfig&&w.canvasConfig.alpha||t!=null?"load":"clear",clearValue:i,storeOp:"store"})}let r=null;return e.depthTexture||e.zPreTexture?(e.zPreTexture&&(e.depthTexture=e.zPreTexture),r={label:`${e.label} renderPassDescriptor zPreTexture${e.zPreTexture?"load":"clear"}`,colorAttachments:a,depthStencilAttachment:{view:e.depthTexture.getGPUView(),depthLoadOp:e.zPreTexture?"load":e.depthLoadOp,depthClearValue:e.zPreTexture?1:e.depthCleanValue,depthStoreOp:"store"}}):r={colorAttachments:a,label:"renderPassDescriptor not writeDepth"},e.renderPassDescriptor=r,r}static getRenderBundleDescriptor(e){if(e.renderBundleEncoderDescriptor)return e.renderBundleEncoderDescriptor;w.presentationSize;let t=[];if(e.renderTargets&&e.renderTargets.length>0){e.renderTargets[0].width,e.renderTargets[0].height;for(let r=0;r<e.renderTargets.length;r++){const i=e.renderTargets[r];t.push(i.format)}}let a=null;return e.depthTexture?a={colorFormats:t,depthStencilFormat:e.depthTexture.format}:a={colorFormats:t},e.renderBundleEncoderDescriptor=a,e.renderBundleEncoderDescriptor}}class $r extends Ve{width;height;segmentW;segmentH;up;constructor(e,t,a=1,r=1,i=b.Y_AXIS){super(),this.width=e,this.height=t,this.segmentW=a,this.segmentH=r,this.up=i,this.buildGeometry(this.up)}buildGeometry(e){var t,a,r,i,n=this.segmentW+1;(this.segmentH+1)*n,this.bounds=new xe(b.ZERO.clone(),new b(this.width,1,this.height)),r=this.segmentH*this.segmentW*6;let o=(this.segmentW+1)*(this.segmentH+1),l=new Float32Array(o*3),c=new Float32Array(o*3),f=new Float32Array(o*2),h;this.segmentW*this.segmentH*2*3>=Uint16Array.length?h=new Uint32Array(this.segmentW*this.segmentH*2*3):h=new Uint16Array(this.segmentW*this.segmentH*2*3),r=0;for(var g=0,A=0,m=0,p=0;p<=this.segmentH;++p)for(var D=0;D<=this.segmentW;++D){switch(t=(D/this.segmentW-.5)*this.width,a=(p/this.segmentH-.5)*this.height,e){case b.Y_AXIS:l[g++]=t,l[g++]=0,l[g++]=a,c[A++]=0,c[A++]=1,c[A++]=0;break;case b.Z_AXIS:l[g++]=t,l[g++]=-a,l[g++]=0,c[A++]=0,c[A++]=0,c[A++]=1;break;case b.X_AXIS:l[g++]=0,l[g++]=t,l[g++]=a,c[A++]=1,c[A++]=0,c[A++]=0;break;default:l[g++]=t,l[g++]=0,l[g++]=a,c[A++]=0,c[A++]=1,c[A++]=0;break}f[m++]=D/this.segmentW,f[m++]=p/this.segmentH,D!=this.segmentW&&p!=this.segmentH&&(i=D+p*n,h[r++]=i+1,h[r++]=i,h[r++]=i+n,h[r++]=i+1,h[r++]=i+n,h[r++]=i+n+1)}this.setIndices(h),this.setAttribute(G.position,l),this.setAttribute(G.normal,c),this.setAttribute(G.uv,f),this.setAttribute(G.TEXCOORD_1,f),this.addSubGeometry({indexStart:0,indexCount:h.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0})}}var B2=Object.getOwnPropertyDescriptor,v2=(s,e,t,a)=>{for(var r=a>1?void 0:a?B2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.QuadShader=class extends gt{constructor(e="QuadGlsl_vs",t="QuadGlsl_fs"){super();let a=new Xe(e,t);this.addRenderPass(a);let r=a.shaderState;a.blendMode=me.NONE,r.frontFace="cw",r.depthWriteEnabled=!1,r.depthCompare=ot.always,r.multisample=0,this.setTexture("baseMap",_.res.blackTexture),this.setUniformFloat("x",0),this.setUniformFloat("y",0),this.setUniformFloat("width",100),this.setUniformFloat("height",100)}},d.QuadShader=v2([Ia(d.QuadShader,"QuadShader")],d.QuadShader);class Cs extends d.Object3D{width=128;height=128;quadRenderer;material;rendererPassState;quadShader;constructor(e="QuadGlsl_vs",t="QuadGlsl_fs",a,r=0,i=!1){super();let n=a?a.renderTargets:[];this.material=new Dt,this.quadShader=new d.QuadShader(e,t),this.material.shader=this.quadShader,this.quadRenderer=this.addComponent(d.MeshRenderer),this.quadRenderer.material=this.material,this.quadRenderer.castGI=!1,this.quadRenderer.castShadow=!1,this.quadRenderer.drawType=i?2:0,this.quadRenderer.geometry=new $r(100,100,1,1),this.quadRenderer.material=this.material,this.quadRenderer.__start(),this.quadRenderer._enable=!0,this.quadRenderer.onEnable(),this.rendererPassState=Je.createRendererPassState(a,"load"),r>0&&(this.rendererPassState.multisample=this.quadShader.getDefaultColorShader().shaderState.multisample,this.rendererPassState.multiTexture=w.device.createTexture({size:{width:w.presentationSize[0],height:w.presentationSize[1]},sampleCount:r,format:n.length>0?n[0].format:w.presentationFormat,usage:GPUTextureUsage.RENDER_ATTACHMENT})),w.addEventListener(nr.RESIZE,o=>{this.rendererPassState=Je.createRendererPassState(a,"load"),r>0&&(this.rendererPassState.multisample=this.quadShader.getDefaultColorShader().shaderState.multisample,this.rendererPassState.multiTexture=w.device.createTexture({size:{width:w.presentationSize[0],height:w.presentationSize[1]},sampleCount:r,format:n.length>0?n[0].format:w.presentationFormat,usage:GPUTextureUsage.RENDER_ATTACHMENT}))},this)}renderTarget(e,t,a){let r=e.camera,i=F.beginRenderPass(a,t.rendererPassState);F.bindCamera(i,r),t.quadRenderer.nodeUpdate(e,le.COLOR,t.rendererPassState,null),t.quadRenderer.renderPass2(e,le.COLOR,t.rendererPassState,null,i),F.endPass(i)}renderToViewQuad(e,t,a,r){let i=e.camera;t.quadShader.setTexture("baseMap",r);let n=F.beginRenderPass(a,t.rendererPassState);F.bindCamera(n,i),t.quadRenderer.nodeUpdate(e,le.COLOR,t.rendererPassState,null),t.quadRenderer.renderPass2(e,le.COLOR,t.rendererPassState,null,n),F.endPass(n)}}class Et{static rtTextureMap;static rtViewQuad;static init(){this.rtTextureMap=new Map,this.rtViewQuad=new Map}static createRTTexture(e,t,a,r,i=!1,n=0){let o=this.rtTextureMap.get(e);return o||(e==Ta.colorBufferTex_NAME?o=new kt(t,a,r,i,void 0,1,n,!1):o=new kt(t,a,r,i,void 0,1,n,!0),o.name=e,Et.rtTextureMap.set(e,o)),o}static createRTTextureArray(e,t,a,r,i=1,n=!1,o=0){let l=this.rtTextureMap.get(e);return l||(l=new kt(t,a,r,n,void 0,i,o),l.name=e,Et.rtTextureMap.set(e,l)),l}static createViewQuad(e,t,a,r,i=0){let n=new rt([r],[new Ge]),o=new Cs(t,a,n,i);return Et.rtViewQuad.set(e,o),o}static getTexture(e){return this.rtTextureMap.get(e)}static CreateSplitTexture(e){let t=this.getTexture(Ta.colorBufferTex_NAME),a=this.getTexture(e+"_split");return a||(a=this.createRTTexture(e+"_split",t.width,t.height,t.format,!1)),a}static WriteSplitColorTexture(e){let t=this.getTexture(Ta.colorBufferTex_NAME),a=this.getTexture(e+"_split");const r=F.beginCommandEncoder();r.copyTextureToTexture({texture:t.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{texture:a.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{width:a.width,height:a.height,depthOrArrayLayers:1}),F.endCommandEncoder(r)}}class Ss{command;encoder;rendererPassStates;rtFrame;constructor(e){this.rtFrame=e,this.rendererPassStates=[]}clean(){this.rendererPassStates.length=0,F.cleanCache()}beginContinueRendererPassState(e="load",t="load"){if(this.rendererPassStates.length>0){let a=this.rtFrame.clone();for(const i of a.rtDescriptors)i.loadOp="load";a.depthLoadOp=t;let r=Je.createRendererPassState(a,e);return this.rendererPassStates.push(r),r}else{this.rtFrame.depthLoadOp=t;let a=Je.createRendererPassState(this.rtFrame,e);return this.rendererPassStates.push(a),a}}get rendererPassState(){return this.rendererPassStates[this.rendererPassStates.length-1]}beginOpaqueRenderPass(){this.beginContinueRendererPassState("clear","clear"),this.begineNewCommand(),this.beginNewEncoder()}beginTransparentRenderPass(){this.beginContinueRendererPassState("load","load"),this.begineNewCommand(),this.beginNewEncoder()}specialtRenderPass(){this.beginContinueRendererPassState("load","load"),this.begineNewCommand(),this.beginNewEncoder()}endRenderPass(){this.endEncoder(),this.endCommand()}begineNewCommand(){return this.command=F.beginCommandEncoder(),this.command}endCommand(){F.endCommandEncoder(this.command),this.command=null}beginNewEncoder(){return this.encoder=F.beginRenderPass(this.command,this.rendererPassState),this.encoder}endEncoder(){F.endPass(this.encoder),this.encoder=null}}class Ma extends Ja{rendererPassState;splitRendererPassState;useRenderBundle=!1;debugViewQuads;debugTextures;renderContext;_rendererType;_rtFrame;get passType(){return this._rendererType}set passType(e){this._rendererType=e}constructor(){super(),this.debugTextures=[],this.debugViewQuads=[]}setRenderStates(e){if(this._rtFrame=e,e){this.rendererPassState=Je.createRendererPassState(e);let t=e.clone();t.depthLoadOp="load";for(const a of t.rtDescriptors)a.loadOp="load";this.splitRendererPassState=Je.createRendererPassState(t)}this.renderContext=new Ss(e)}getRenderContext(e){return this._rtFrame=e,new Ss(e)}setIrradiance(e,t){this.rendererPassState.irradianceBuffer=[e,t]}compute(e,t){}render(e,t,a,r=!1){F.cleanCache();let i=e.camera,n=e.scene;this.rendererPassState.camera3D=i;let o=K.instance.getRenderNodes(n,i),l=this.renderBundleOp(e,o,t,a),c=r?[]:this.renderBundleTr(e,o,t,a);{let f=F.beginCommandEncoder(),h=F.beginRenderPass(f,this.rendererPassState);l.length>0&&h.executeBundles(l),!r&&K.instance.sky&&(F.bindCamera(h,i),K.instance.sky.renderPass2(e,this._rendererType,this.rendererPassState,a,h)),this.drawRenderNodes(e,h,f,o.opaqueList,t),F.endPass(h),F.endCommandEncoder(f)}{let f=F.beginCommandEncoder(),h=F.beginRenderPass(f,this.rendererPassState);c.length>0&&h.executeBundles(c),r||(F.bindCamera(h,i),this.drawRenderNodes(e,h,f,o.transparentList,t)),F.endPass(h),F.endCommandEncoder(f)}}nodeUpload(e,t,a){}occlusionRenderNodeTest(e,t,a){return a?a.occlusionRenderNodeTest(e)>0:!0}renderOp(e,t,a,r,i){}renderTr(e,t,a,r,i){}renderBundleOp(e,t,a,r){let i=K.instance.getOpRenderGroup(e.scene);if(i){let n=[];return i.renderGroup.forEach(o=>{if(o.bundleMap.has(this._rendererType))n.push(o.bundleMap.get(this._rendererType));else{let l=F.recordBundleEncoder(this.rendererPassState.renderBundleEncoderDescriptor);this.recordRenderBundleNode(e,l,o.renderNodes,r);let c=l.finish();o.bundleMap.set(this._rendererType,c),n.push(c)}}),n}return[]}renderBundleTr(e,t,a,r){let i=K.instance.getTrRenderGroup(e.scene);if(i){let n=[];return i.renderGroup.forEach(o=>{if(o.bundleMap.has(this._rendererType))n.push(o.bundleMap.get(this._rendererType));else{let l=F.recordBundleEncoder(this.rendererPassState.renderBundleEncoderDescriptor);this.recordRenderBundleNode(e,l,o.renderNodes,r);let c=l.finish();o.bundleMap.set(this._rendererType,c),n.push(c)}}),n}return[]}recordRenderBundleNode(e,t,a,r){F.bindCamera(t,e.camera),F.bindGeometryBuffer(t,a[0].geometry);for(let i=0;i<a.length;++i){let n=a[i];n.transform.worldMatrix.index,n.transform.enable&&n.recordRenderPass2(e,this._rendererType,this.rendererPassState,r,t)}}drawRenderNodes(e,t,a,r,i,n){F.bindCamera(t,e.camera);for(let o=_.setting.render.drawOpMin;o<Math.min(r.length,_.setting.render.drawOpMax);++o){let l=r[o];l.transform.enable&&l.enable&&l.renderPass2(e,this._rendererType,this.rendererPassState,n,t)}}}class c0 extends Ma{constructor(){super(),this.passType=le.COLOR}render(e,t,a,r=!1){this.renderContext.clean();let i=e.scene,n=e.camera;ve.updateCameraGroup(n),this.rendererPassState.camera3D=n;let o=K.instance.getRenderNodes(i,n),l=this.renderBundleOp(e,o,t,a),c=r?[]:this.renderBundleTr(e,o,t,a);{this.renderContext.beginOpaqueRenderPass();let f=this.renderContext.encoder;l.length>0&&(K.instance.getOpRenderGroup(i),f.executeBundles(l)),!r&&K.instance.sky&&(F.bindCamera(f,n),K.instance.sky.preInit(this._rendererType)||K.instance.sky.nodeUpdate(e,this._rendererType,this.rendererPassState,a),K.instance.sky.renderPass2(e,this._rendererType,this.rendererPassState,a,f)),o.opaqueList&&(F.bindCamera(f,n),this.drawNodes(e,this.renderContext,o.opaqueList,t,a))}{let f=this.renderContext.encoder;c.length>0&&f.executeBundles(c),!r&&o.transparentList&&(F.bindCamera(f,n),this.drawNodes(e,this.renderContext,o.transparentList,t,a));let h=K.instance.getGraphicList();for(let u=0;u<h.length;u++){const g=h[u];g.nodeUpdate(e,this._rendererType,this.splitRendererPassState,a),g.renderPass2(e,this._rendererType,this.splitRendererPassState,a,f)}this.renderContext.endRenderPass(),lt.end("ColorPass Draw Transparent")}}drawNodes(e,t,a,r,i){let n=K.instance.getRenderShaderCollect(e);if(n){for(const o of n){let l=o[1];for(const c of l){let f=c[1];if(!f.isDestroyed&&f.preInit(this._rendererType)){f.nodeUpdate(e,this._rendererType,this.rendererPassState,i);break}}}for(let o=_.setting.render.drawOpMin;o<Math.min(a.length,_.setting.render.drawOpMax);++o){let l=a[o];l.transform.enable&&l.enable&&(l.hasMask(Qe.UI)&&!l.isRecievePostEffectUI||l.isDestroyed||(l.preInit(this._rendererType)||l.nodeUpdate(e,this._rendererType,this.rendererPassState,i),l.renderPass(e,this.passType,this.renderContext)))}}}occlusionRenderNodeTest(e,t,a){return a.zDepthRenderNodeTest(t)>0}}class xs{frustumCullingList;zVisibleList;_renderList;static enable=!0;constructor(){this._renderList=new Map}occlusionRenderNodeTest(e){return _.setting.occlusionQuery.enable?this.frustumCullingList?this.frustumCullingList[e]:0:1}zDepthRenderNodeTest(e){return this.zVisibleList?this.zVisibleList[e]:0}update(e,t){}collect(e,t){}renderCommitTesting(e,t){return!0}}class ei extends ja{constructor(e,t){super(),this.bufferType=ga.ComputeGPUBuffer,this.createBuffer(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST,e,t,"ComputeGPUBuffer")}}class f0{clusterBuffer;lightAssignBuffer;assignTableBuffer;clustersUniformBuffer;constructor(e,t){this.clusterBuffer=new ei(e*2*4),this.clustersUniformBuffer=new yt(10),this.clustersUniformBuffer.visibility=GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,this.lightAssignBuffer=new ei(e*t),this.lightAssignBuffer.visibility=GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,this.assignTableBuffer=new ei(e*4),this.assignTableBuffer.visibility=GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE}update(e,t,a,r,i,n,o,l,c,f){this.clustersUniformBuffer.setFloat("clusterTileX",r),this.clustersUniformBuffer.setFloat("clusterTileY",i),this.clustersUniformBuffer.setFloat("clusterTileZ",n),this.clustersUniformBuffer.setFloat("numLights",o),this.clustersUniformBuffer.setFloat("maxNumLightsPerCluster",l),this.clustersUniformBuffer.setFloat("near",c),this.clustersUniformBuffer.setFloat("far",f),this.clustersUniformBuffer.setFloat("screenWidth",e),this.clustersUniformBuffer.setFloat("screenHeight",t),this.clustersUniformBuffer.setFloat("clusterPix",a),this.clustersUniformBuffer.apply()}}class wt{static clusterTileX=16;static clusterTileY=16;static clusterTileZ=32}let d0=`
|
|
6121
|
+
`;var h2=Object.getOwnPropertyDescriptor,u2=(s,e,t,a)=>{for(var r=a>1?void 0:a?h2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.PointCloudShader=class extends gt{constructor(){super(),Y.register("pointcloud_vs_dc",Hc),Y.register("pointcloud_fs_dc",Kc);const e=new Xe("pointcloud_vs_dc","pointcloud_fs_dc");e.passType=le.COLOR,e.setShaderEntry("VertMain","FragMain"),e.topology=sn.triangle_list,e.depthWriteEnabled=!0,e.cullMode=Nt.none,e.shaderState.transparent=!1,e.shaderState.blendMode=me.NORMAL,e.shaderState.writeMasks=[15,15],e.shaderState.castReflection=!1,this.addRenderPass(e),this.setDefault()}setDefault(){const e=this.getDefaultColorShader(),t=new R;e.setUniform("modelMatrix",t.rawData),e.setUniformArray("tex_params",new Float32Array([0,0,0,4])),e.setUniformArray("pointParams",new Float32Array([0,0,0,128]))}},d.PointCloudShader=u2([Ra(d.PointCloudShader,"PointCloudShader")],d.PointCloudShader);class qc extends Dt{_texParams=new Float32Array([0,0,0,4]);_pointParamsArray=new Float32Array([0,0,0,128]);constructor(){super(),this.shader=new d.PointCloudShader}setPointTextures(e,t,a,r){const i=this.shader.getDefaultColorShader();if(!i.getUniform("modelMatrix")){const n=new R;i.setUniform("modelMatrix",n.rawData)}i.setTexture("pointColor",t),i.setTexture("pointPosition",e),this._texParams[0]=a[0],this._texParams[1]=a[1],this._texParams[2]=a[2],this._texParams[3]=a[3],i.setUniformArray("tex_params",this._texParams),i.setUniformArray("pointParams",this._pointParamsArray),r&&i.setTexture("pointOrder",r),i.shaderState.depthCompare=ot.less}setTransformMatrix(e){this.shader.getDefaultColorShader().setUniform("modelMatrix",e.rawData)}setPointSize(e){this._texParams[3]=Math.max(.1,e),this.shader.getDefaultColorShader().setUniformArray("tex_params",this._texParams)}setPointShape(e){this._pointParamsArray[0]=e==="circle"?1:0,this.shader.getDefaultColorShader().setUniformArray("pointParams",this._pointParamsArray)}enableDebugFullScreen(e){this._pointParamsArray[1]=e?1:0,this.shader.getDefaultColorShader().setUniformArray("pointParams",this._pointParamsArray)}setBatchSize(e){this._pointParamsArray[3]=Math.max(1,e|0),this.shader.getDefaultColorShader().setUniformArray("pointParams",this._pointParamsArray)}}class Bs extends Ve{batchSize;constructor(e=128){super(),this.batchSize=e;const t=new Float32Array(12*e);for(let r=0;r<e;++r){const i=r*12;t.set([-1,-1,r,1,-1,r,1,1,r,-1,1,r],i)}const a=new Uint32Array(6*e);for(let r=0;r<e;++r){const i=r*4,n=r*6;a.set([0+i,1+i,2+i,0+i,2+i,3+i],n)}this.setAttribute(G.position,t),this.setIndices(a),this.addSubGeometry({indexStart:0,indexCount:a.length,vertexStart:0,vertexCount:t.length/3,firstStart:0,index:0,topology:0})}}class $c extends ft{create(e,t,a,r=!0){let i=w.device;const n=e*4*4;this.format=se.rgba32float,this.createTextureDescriptor(e,t,1,this.format);const l=i.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});i.queue.writeBuffer(l,0,a.buffer);const c=F.beginCommandEncoder();return c.copyBufferToTexture({buffer:l,bytesPerRow:n},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(c),r&&(this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="unfilterable-float"),this.gpuSampler=i.createSampler({}),this}fromBuffer(e,t,a){let r=w.device;const i=e*4*4;this.format=se.rgba32float,this.mipmapCount=1,this.createTextureDescriptor(e,t,this.mipmapCount,this.format);const n=F.beginCommandEncoder();return n.copyBufferToTexture({buffer:a,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(n),this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="unfilterable-float",this.gpuSampler=r.createSampler({}),this}}var b2=Object.getOwnPropertyDescriptor,g2=(s,e,t,a)=>{for(var r=a>1?void 0:a?b2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.PointCloudRenderer=class extends Ia{count=0;size=new de;pointColor;pointPosition;pointOrder;texParams;pointCloudMaterial;_positions;get positions(){return this._positions}_colors;_orderData;_fullCount=0;get fullCount(){return this._fullCount}_batchSize=128;instanceCount=0;_texturesInitialized=!1;_debugFullScreen=!1;_centerOffset=new b;get centerOffset(){return this._centerOffset}constructor(){super()}initFromData(e,t,a){if(!e||!t||a<=0){console.error("PointCloudRenderer: Invalid input data");return}if(e.length<a*3){console.error("PointCloudRenderer: Positions array too small");return}if(t.length<a*4){console.error("PointCloudRenderer: Colors array too small");return}this.count=a,this._fullCount=a,this.size=this.evalTextureSize(a),this._positions=e,this._colors=t,this.centerizePositions(),this.buildPositionTexture(),this.buildColorTexture(),this.texParams=new Float32Array([this.count,this.size.x,this.count,4]),this.buildOrderTexture(),this.pointCloudMaterial=new qc,this.geometry=new Bs(this._batchSize),this.materials=[this.pointCloudMaterial],this.instanceCount=Math.ceil(this.count/this._batchSize)}evalTextureSize(e){let t=Math.ceil(Math.sqrt(e));const a=64;t=Math.ceil(t/a)*a;const r=Math.ceil(e/t);return new de(t,r)}centerizePositions(){if(this.count===0)return;let e=0,t=0,a=0;for(let o=0;o<this.count;o++){const l=o*3;e+=this._positions[l+0],t+=this._positions[l+1],a+=this._positions[l+2]}const r=e/this.count,i=t/this.count,n=a/this.count;this._centerOffset.set(r,i,n);for(let o=0;o<this.count;o++){const l=o*3;this._positions[l+0]-=r,this._positions[l+1]-=i,this._positions[l+2]-=n}this.object3D.localPosition=this._centerOffset}buildPositionTexture(){const e=this.size.x|0,t=this.size.y|0,a=this.count,r=new Float32Array(e*t*4);for(let i=0;i<a;i++){const n=i*4,o=i*3;r[n+0]=this._positions[o+0],r[n+1]=this._positions[o+1],r[n+2]=this._positions[o+2],r[n+3]=0}if(a<e*t){const i=(a-1)*4;for(let n=a;n<e*t;n++){const o=n*4;r[o+0]=r[i+0],r[o+1]=r[i+1],r[o+2]=r[i+2],r[o+3]=0}}this.pointPosition=new $c().create(e,t,r),this.pointPosition.name="pointPosition",this.pointPosition.minFilter="nearest",this.pointPosition.magFilter="nearest",this.pointPosition.addressModeU="clamp-to-edge",this.pointPosition.addressModeV="clamp-to-edge"}buildColorTexture(){const e=this.size.x|0,t=this.size.y|0,a=this.count,r=new Uint8Array(e*t*4);for(let i=0;i<a;i++){const n=i*4,o=i*4;r[n+0]=this._colors[o+0],r[n+1]=this._colors[o+1],r[n+2]=this._colors[o+2],r[n+3]=this._colors[o+3]}if(a<e*t){const i=(a-1)*4;for(let n=a;n<e*t;n++){const o=n*4;r[o+0]=r[i+0],r[o+1]=r[i+1],r[o+2]=r[i+2],r[o+3]=r[i+3]}}this.pointColor=new pn().create(e,t,r,!1),this.pointColor.name="pointColor",this.pointColor.minFilter="nearest",this.pointColor.magFilter="nearest",this.pointColor.mipmapFilter="nearest",this.pointColor.addressModeU="clamp-to-edge",this.pointColor.addressModeV="clamp-to-edge"}buildOrderTexture(){const e=this.size.x*this.size.y;this._orderData=new Uint32Array(e);for(let t=0;t<e;t++)this._orderData[t]=t<this.count?t:this.count>0?this.count-1:0;this.pointOrder=new Ds().create(this.size.x,this.size.y,this._orderData),this.pointOrder.name="pointOrder",this.pointOrder.minFilter="nearest",this.pointOrder.magFilter="nearest",this.pointOrder.addressModeU="clamp-to-edge",this.pointOrder.addressModeV="clamp-to-edge"}nodeUpdate(e,t,a,r){const i=this.object3D.transform.worldMatrix;this.pointCloudMaterial.setTransformMatrix(i),this._texturesInitialized||(this.pointCloudMaterial.setPointTextures(this.pointPosition,this.pointColor,this.texParams,this.pointOrder),this.pointCloudMaterial.setBatchSize(this._batchSize),this.pointCloudMaterial.setPointSize(this.texParams[3]),this.pointCloudMaterial.enableDebugFullScreen(this._debugFullScreen),this._texturesInitialized=!0),super.nodeUpdate(e,t,a,r)}renderPass(e,t,a){const r=a.encoder;for(let i of this.materials){const n=i.getPass(t);if(!(!n||n.length===0))for(const o of n){if(!o.pipeline)continue;o.apply(this.geometry,a.rendererPassState||a),F.bindPipeline(r,o),F.bindGeometryBuffer(r,this.geometry);const c=this.geometry.subGeometries[0].lodLevels[0];this.instanceCount>0?F.drawIndexed(r,c.indexCount,this.instanceCount,c.indexStart,0,0):F.drawIndexed(r,c.indexCount,1,c.indexStart,0,0)}}}setPointSize(e){this.texParams[3]=Math.max(.1,e),this.pointCloudMaterial&&this.pointCloudMaterial.setPointSize(e)}setPointShape(e){this.pointCloudMaterial&&this.pointCloudMaterial.setPointShape(e)}enableDebugFullScreen(e){this._debugFullScreen=e,this.pointCloudMaterial&&this.pointCloudMaterial.enableDebugFullScreen(e)}setBatchSize(e){if(this._batchSize=Math.max(1,e|0),this.geometry){const t=this.geometry;Ce.getInstance().detached(t,this),Ce.getInstance().hasReference(t)||t.destroy(),this.geometry=new Bs(this._batchSize)}this.pointCloudMaterial&&(this.pointCloudMaterial.setBatchSize(this._batchSize),this.pointCloudMaterial.enableDebugFullScreen(this._debugFullScreen)),this.instanceCount=Math.ceil(this.count/this._batchSize)}destroy(e){this.pointColor&&(this.pointColor.destroy(e),this.pointColor=null),this.pointPosition&&(this.pointPosition.destroy(e),this.pointPosition=null),this.pointOrder&&(this.pointOrder.destroy(e),this.pointOrder=null),this._positions=null,this._colors=null,this._orderData=null,this.texParams=null,super.destroy(e)}},d.PointCloudRenderer=g2([Lt(d.PointCloudRenderer,"PointCloudRenderer")],d.PointCloudRenderer);class vs{static maxVector=new b(Number.MAX_VALUE*.1,Number.MAX_VALUE*.1,Number.MAX_VALUE*.1);static minVector=this.maxVector.clone().multiplyScalar(-1);static genMeshMaxVector=b.ZERO.clone();static genMeshMinVector=b.ZERO.clone();static genMeshVectorList8=[new b,new b,new b,new b,new b,new b,new b,new b];static genPointCloudBounds(e,t){t||=new xe(b.ZERO,b.ZERO),t.setFromMinMax(this.maxVector,this.minVector);let a=e.getComponents(d.PointCloudRenderer);if(!a)return console.warn("genPointCloudBounds: No PointCloudRenderer found on object"),t;for(const r of a){const i=r.positions,n=r.fullCount;if(!i||n===0){console.warn("genPointCloudBounds: No position data available");continue}const o=r.object3D.transform.worldMatrix,l=new b;for(let c=0;c<n;c++){const f=c*3;l.set(i[f+0],i[f+1],i[f+2]),o.transformPoint(l,l),t.expandByPoint(l)}}return t}static genGSplatBounds(e,t){t||=new xe(b.ZERO,b.ZERO),t.setFromMinMax(this.maxVector,this.minVector);let a=e.getComponents(d.GSplatRenderer);if(!a)return console.warn("genGSplatBounds: No GSplatRenderer found on object"),t;for(const r of a){const i=r.positions,n=r.fullCount;if(!i||n===0)return console.warn("genGSplatBounds: No position data available"),t;const o=r.object3D.transform.worldMatrix,l=new b;for(let c=0;c<n;c++){const f=c*3;l.set(i[f+0],i[f+1],i[f+2]),o.transformPoint(l,l),t.expandByPoint(l)}t.setFromMinMax(t.min,t.max)}return t}static genMeshBounds(e,t){let a=this.genMeshMinVector,r=this.genMeshMaxVector,i=this.genMeshVectorList8;t||=new xe(b.ZERO,b.ZERO),t.setFromMinMax(this.maxVector,this.minVector);let n=e.getComponents(d.MeshRenderer);for(const o of n)if(o&&o.geometry){let l=o.object3D.transform.worldMatrix;a.copy(o.geometry.bounds.min),r.copy(o.geometry.bounds.max),i[0].set(a.x,a.y,a.z),i[1].set(a.x,a.y,r.z),i[2].set(a.x,r.y,a.z),i[3].set(a.x,r.y,r.z),i[4].set(r.x,a.y,a.z),i[5].set(r.x,a.y,r.z),i[6].set(r.x,r.y,a.z),i[7].set(r.x,r.y,r.z);for(const c of i)l.transformPoint(c,c),t.expandByPoint(c)}return r.copyFrom(t.max),a.copyFrom(t.min),t.setFromMinMax(a,r),t}static transformBound(e,t,a){let r=this.genMeshMinVector.copyFrom(t.min),i=this.genMeshMaxVector.copyFrom(t.max),n=this.genMeshVectorList8;a||=new xe(b.ZERO,b.ZERO),a.setFromMinMax(this.maxVector,this.minVector),n[0].set(r.x,r.y,r.z),n[1].set(r.x,r.y,i.z),n[2].set(r.x,i.y,r.z),n[3].set(r.x,i.y,i.z),n[4].set(i.x,r.y,r.z),n[5].set(i.x,r.y,i.z),n[6].set(i.x,i.y,r.z),n[7].set(i.x,i.y,i.z);for(const o of n)e.transformPoint(o,o),a.expandByPoint(o);return i.copyFrom(a.max),r.copyFrom(a.min),a.setFromMinMax(r,i),a}}class e0 extends Ja{name="";_instanceID="";_numChildren;get instanceID(){return this._instanceID}transform;renderNode;entityChildren;components;waitDisposeComponents;_bound;_boundWorld;_isBoundChange=!0;_dispose=!1;get dispose(){return this._dispose}getObjectByName(e){if(e.indexOf("/")>=0){let a=e.split("/"),r=this;for(;a.length>0&&r;){let i=a.shift();if(r=r.getChildByName(i,!1),!r)return null}return r}else return this.getChildByName(e,!1)}constructor(){super(),this.entityChildren=[],this.components=new Map,this._instanceID=Hn().toString(),this.waitDisposeComponents=[]}get numChildren(){return this._numChildren}addChild(e){if(e==null)throw new Error("child is null!");if(e===this)throw new Error("child is self!");return this.entityChildren.indexOf(e)==-1?(e.removeFromParent(),e.transform.parent=this.transform,this.entityChildren.push(e),this._numChildren=this.entityChildren.length,this.noticeComponents("onAddChild",e),e):null}removeChild(e){if(e===null)return;if(e===this)throw new Error("add child is self!");let t=this.entityChildren.indexOf(e);t!=-1&&(this.entityChildren.splice(t,1),e.transform.parent=null,this._numChildren=this.entityChildren.length,this.noticeComponents("onRemoveChild",e))}removeAllChild(){for(;this.numChildren>0;)this.removeChild(this.entityChildren[0])}removeSelf(){return this.removeFromParent()}removeChildByIndex(e){e>=0&&e<this.entityChildren.length?this.removeChild(this.entityChildren[e]):console.error("remove child by index , index out of range")}hasChild(e){return this.entityChildren.indexOf(e)!=-1}removeFromParent(){let e=this.transform.parent;return e&&e.object3D&&e.object3D.removeChild(this),this}getChildByIndex(e){let t=null;return e<this.entityChildren.length&&(t=this.entityChildren[e]),t}getChildByName(e,t=!0){let a=null;for(const r of this.entityChildren){if(r.name==e)return a=r,a;if(t&&(a=r.getChildByName(e,t),a))return a}return a}update(){}instantiate(){return null}onTransformLocalChange(e){this._isBoundChange=!0}get bound(){return(this._isBoundChange||!this._bound)&&this.updateBound(),this._boundWorld}set bound(e){this._bound=e,this._boundWorld=this._bound.clone(),this._isBoundChange=!0}updateBound(){return this._bound||(this._bound=new xe,this._boundWorld=this._bound.clone(),this._isBoundChange=!0),this._isBoundChange&&(vs.transformBound(this.transform.worldMatrix,this._bound,this._boundWorld),this._isBoundChange=!1),this._boundWorld}waitUpdate(){this._dispose?(this.transform.parent&&this.transform.parent.object3D.removeChild(this),this.components.forEach((e,t)=>{e.enable=!1,e.beforeDestroy(),e.destroy()}),this.components.clear()):Pe.waitStartComponent.forEach((e,t)=>{for(;e.length>0;){const a=e.shift();a.__start(),Pe.waitStartComponent.delete(a.object3D)}})}noticeComponents(e,t){for(let a of this.components.values())a[e]?.(t)}destroy(e){this._dispose||(this.components.forEach(t=>{t.beforeDestroy(e)}),this.components.forEach(t=>{t.destroy(e)}),this.components.clear(),this.components.clear(),this.entityChildren&&(this.entityChildren.forEach(t=>{t.destroy(e)}),this.removeAllChild(),this.entityChildren=[]),this._bound&&this._bound.destroy&&(this._bound.destroy(),this._bound=null),this._boundWorld&&this._boundWorld.destroy&&(this._boundWorld.destroy(),this._boundWorld=null),this.transform.parent=null,this._dispose=!0,super.destroy())}}var m2=Object.getOwnPropertyDescriptor,p2=(s,e,t,a)=>{for(var r=a>1?void 0:a?m2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.Object3D=class extends e0{_isScene3D;prefabRef;serializeTag;constructor(){super(),this.transform=this.addComponent(zt),this.transform.eventDispatcher.addEventListener(zt.LOCAL_ONCHANGE,this.onTransformLocalChange,this)}get isScene3D(){return this._isScene3D}forChild(e){this.entityChildren.forEach(t=>{e(t),t.forChild(e)})}addComponent(e,t){if(!this.components.has(e)){let a=new e;return a.object3D=this,this.components.set(e,a),a.__init(t),Pe.appendWaitStart(a),a}return this.components.get(e)}getOrAddComponent(e){let t=this.components.get(e);return t||(t=this.addComponent(e)),t}removeComponent(e){if(this.components.has(e)){let t=this.components.get(e);Pe.removeWaitStart(this,t),this.components.delete(e),t.__stop(),t.beforeDestroy(),t.destroy()}}hasComponent(e){return this.components.has(e)}getComponent(e){return this.components.get(e)}getComponentFromParent(e){if(!this.parent)return null;let t=this.parent.object3D.getComponent(e);return t||this.parent.object3D.getComponentFromParent(e)}getComponentsInChild(e){let t=[],a=this.components.get(e);a&&t.push(a);for(let r=0;r<this.entityChildren.length;r++){let n=this.entityChildren[r].getComponentsInChild(e);t.push(...n)}return t}getComponents(e,t,a){t||=[];let r=this.getComponent(e);r&&(r.enable||a)&&t.push(r);for(let i=0,n=this.entityChildren.length;i<n;i++){let o=this.entityChildren[i];o&&o instanceof d.Object3D&&o.getComponents(e,t,a)}return t}getComponentsExt(e,t,a){t||=[];let r=this.components.get(e);if(r&&(r.enable||a))t.push(r);else for(const i of this.entityChildren)i instanceof d.Object3D&&i.getComponentsExt(e,t,a);return t}getComponentsByProperty(e,t,a=!0,r,i){r||=[];let n;for(const o of this.components.values())o&&(o.enable||i)&&o[e]===t&&(r.push(o),n=!0);if(!(n&&a))for(const o of this.entityChildren)o instanceof d.Object3D&&o.getComponentsByProperty(e,t,a,r,i);return r}clone(){return this.instantiate()}instantiate(){let e=new d.Object3D;return e.name=this.name,e.serializeTag=this.serializeTag,e.prefabRef=this.prefabRef,this.entityChildren.forEach((t,a)=>{let r=t.instantiate();e.addChild(r)}),this.components.forEach((t,a)=>{t.cloneTo(e)}),e}get localPosition(){return this.transform.localPosition}set localPosition(e){this.transform.localPosition=e}get localRotation(){return this.transform.localRotation}set localRotation(e){this.transform.localRotation=e}get localScale(){return this.transform.localScale}set localScale(e){this.transform.localScale=e}get localQuaternion(){return this.transform.localRotQuat}set localQuaternion(e){this.transform.localRotQuat=e}notifyChange(){this.transform.notifyChange()}get parent(){return this.transform.parent}get parentObject(){return this.transform.parent.object3D}set x(e){this.transform.x=e}get x(){return this.transform.x}set y(e){this.transform.y=e}get y(){return this.transform.y}set z(e){this.transform.z=e}get z(){return this.transform.z}set scaleX(e){this.transform.scaleX=e}get scaleX(){return this.transform.scaleX}set scaleY(e){this.transform.scaleY=e}get scaleY(){return this.transform.scaleY}set scaleZ(e){this.transform.scaleZ=e}get scaleZ(){return this.transform.scaleZ}set rotationX(e){this.transform.rotationX=e}get rotationX(){return this.transform.rotationX}set rotationY(e){this.transform.rotationY=e}get rotationY(){return this.transform.rotationY}set rotationZ(e){this.transform.rotationZ=e}get rotationZ(){return this.transform.rotationZ}fixedUpdate(){}lateUpdate(){}traverse(e){e(this);for(let t=0,a=this.entityChildren.length;t<a;t++){let r=this.entityChildren[t];r instanceof d.Object3D&&r.traverse(e)}}destroy(e){this.transform.eventDispatcher.removeEventListener(zt.LOCAL_ONCHANGE,this.onTransformLocalChange,this);const t=this.batchTable;t&&typeof t.destroy=="function"&&(t.destroy(),this.batchTable=null);const a=this.featureTable;a&&typeof a.destroy=="function"&&(a.destroy(),this.featureTable=null),super.destroy(e)}},d.Object3D=p2([A2],d.Object3D);function A2(s,e){return class extends d.Object3D{set active(t){this.transform.enable=t>0}get active(){return this.transform.enable?1:0}get materialColor(){return this.getComponent(d.MeshRenderer)?.material?.shader.getDefaultColorShader().baseColor}set materialColor(t){let a=this.getComponent(d.MeshRenderer)?.material;a&&(a.shader.getDefaultColorShader().baseColor=t)}notifyMaterialColorChange(t,a){this.getComponent(d.MeshRenderer).materials?.[t]?.shader.getDefaultColorShader().uniforms[a].onChange()}}}class dt{static createCamera3DObject(e,t){return this.createCamera3D(null,e,t)}static createCamera3D(e,t,a){return e||=new d.Object3D,t&&t.addChild(e),a&&(e.name=a),e.getOrAddComponent(Hr)}static UnProjection(e,t,a=1,r){let i=new b(e,t,0),n=1,o=b.HELP_0,l=w.canvas.offsetLeft,c=w.canvas.offsetTop,f=w.canvas.clientWidth,h=w.canvas.clientHeight;o.x=((i.x-l)*n/f-.5)*2,o.y=-((i.y-c)*n/h-.5)*2,o.z=a;let u=new b(0,0,0),g=R.helpMatrix2;g.copyFrom(r.projectionMatrix),g.invert();let A=R.helpMatrix;return A.identity(),A.multiply(g),A.multiply(r.transform.worldMatrix),A.perspectiveMultiplyPoint3(o,u),u}static Projection(e,t,a){let r=a||new b(0,0,0),i=R.helpMatrix;i.copyFrom(t.viewMatrix),i.multiply(t.projectionMatrix),i.perspectiveMultiplyPoint3(e,r);let n=w.canvas.clientWidth/2,o=w.canvas.clientHeight/2;return r.x=r.x*n+n,r.y=o-r.y*o,r}static UnProjection2(e,t,a,r,i){let n=i||new b(0,0,0),o=R.helpMatrix;o.copyFrom(r.pvMatrixInv);let l=w.canvas.clientWidth/2,c=w.canvas.clientHeight/2;return n.x=(e-l)/l,n.y=(c-t)/c,n.z=a,o.perspectiveMultiplyPoint3(n,n),n}}class Wt{static maxNumDirectionShadow=8;static maxNumPointShadow=8;static directionLightList;static pointLightList;static shadowLights;static init(){this.directionLightList=new Map,this.pointLightList=new Map,this.shadowLights=new Map}static createBuffer(e){if(!this.shadowLights.has(e.scene)){let t=new Float32Array(16);this.shadowLights.set(e.scene,t)}}static getShadowLightList(e){if(!e.transform.view3D)return null;if(e.lightData.lightType==ct.DirectionLight){let t=this.directionLightList.get(e.transform.view3D.scene);return t||(t=[],this.directionLightList.set(e.transform.view3D.scene,t)),t}else if(e.lightData.lightType==ct.PointLight){let t=this.pointLightList.get(e.transform.view3D.scene);return t||(t=[],this.pointLightList.set(e.transform.view3D.scene,t)),t}else if(e.lightData.lightType==ct.SpotLight){let t=this.pointLightList.get(e.transform.view3D.scene);return t||(t=[],this.pointLightList.set(e.transform.view3D.scene,t)),t}}static getShadowLightWhichScene(e,t){if(t==ct.DirectionLight){let a=this.directionLightList.get(e);return a||(a=[],this.directionLightList.set(e,a)),a}else if(t==ct.PointLight){let a=this.pointLightList.get(e);return a||(a=[],this.pointLightList.set(e,a)),a}}static getDirectShadowLightWhichScene(e){let t=this.directionLightList.get(e);return t||(t=[],this.directionLightList.set(e,t)),t}static getPointShadowLightWhichScene(e){let t=this.pointLightList.get(e);return t||(t=[],this.pointLightList.set(e,t)),t}static addShadowLight(e){if(!e.transform.view3D)return null;let t=e.transform.view3D.scene;if(e.lightData.lightType==ct.DirectionLight){let a=this.directionLightList.get(t);if(a||(a=[],this.directionLightList.set(t,a)),!e.shadowCamera){e.shadowCamera=dt.createCamera3DObject(null,"shadowCamera"),e.shadowCamera.isShadowCamera=!0;let r=-1e3;e.shadowCamera.orthoOffCenter(r,-r,r,-r,1,1e4)}return a.indexOf(e)==-1&&a.push(e),a}else if(e.lightData.lightType==ct.PointLight||e.lightData.lightType==ct.SpotLight){let a=this.pointLightList.get(t);return a&&a.length>=8||(a||(a=[],this.pointLightList.set(t,a)),a.indexOf(e)==-1&&a.push(e)),a}}static removeShadowLight(e){if(e.lightData.castShadowIndex=-1,!e.transform.view3D)return null;if(e.lightData.lightType==ct.DirectionLight){let t=this.directionLightList.get(e.transform.view3D.scene);if(t){let a=t.indexOf(e);a!=-1&&t.splice(a,1)}return e.lightData.castShadowIndex=-1,t}else if(e.lightData.lightType==ct.PointLight||e.lightData.lightType==ct.SpotLight){let t=this.pointLightList.get(e.transform.view3D.scene);if(t){let a=t.indexOf(e);a!=-1&&t.splice(a,1)}return e.lightData.castShadowIndex=-1,t}}static update(e){let t=this.shadowLights.get(e.scene),a=Wt.directionLightList.get(e.scene),r=Wt.pointLightList.get(e.scene),i=0,n=0,o=0,l=0;if(t.fill(0),a){let f=0;for(let h=0;h<a.length;h++){const u=a[h];t[h]=u.lightData.index,u.lightData.castShadowIndex=f++}n=a.length}if(r){o=n;let f=0;for(let h=o;h<r.length;h++){const u=r[h];t[h]=u.lightData.index,u.lightData.castShadowIndex=f++}l=o+r.length}ve.getAllCameraGroup().forEach(f=>{f.dirShadowStart=i,f.dirShadowEnd=n,f.pointShadowStart=o,f.pointShadowEnd=l,f.shadowLights.set(new Float32Array(t))})}}class Us{uuid;usage;globalBindGroup;uniformGPUBuffer;matrixBindGroup;uniformByteLength;matrixesByteLength;shadowMatrixRaw=new Float32Array(128);csmMatrixRaw=new Float32Array(ra.Cascades*16);csmShadowBias=new Float32Array(4);shadowLights=new Float32Array(16);dirShadowStart=0;dirShadowEnd=0;pointShadowStart=0;pointShadowEnd=0;constructor(e){this.uuid=Gt(),this.usage=GPUBufferUsage.UNIFORM|GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST,this.uniformGPUBuffer=new yt(8336),this.uniformGPUBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,this.matrixBindGroup=e,this.createBindGroup()}createBindGroup(){this.uniformByteLength=this.uniformGPUBuffer.memory.shareDataBuffer.byteLength,this.matrixesByteLength=R.block*4*R.maxCount,this.globalBindGroup=w.device.createBindGroup({label:"global_bindGroupLayout",layout:hs.getGlobalDataBindGroupLayout(),entries:[{binding:0,resource:{buffer:this.uniformGPUBuffer.buffer,offset:0,size:this.uniformByteLength}},{binding:1,resource:{buffer:this.matrixBindGroup.matrixBufferDst.buffer,offset:0,size:this.matrixesByteLength}}]})}setCamera(e){this.uniformGPUBuffer.setMatrix("_projectionMatrix",e.projectionMatrix),this.uniformGPUBuffer.setMatrix("_viewMatrix",e.viewMatrix),this.uniformGPUBuffer.setMatrix("_cameraWorldMatrix",e.transform.worldMatrix),this.uniformGPUBuffer.setMatrix("pvMatrixInv",e.projectionMatrixInv),this.uniformGPUBuffer.setMatrix("viewToWorld",e.cameraToWorld);let t=Wt.getDirectShadowLightWhichScene(e.transform.scene3D);this.csmShadowBias.fill(1e-4),this.shadowMatrixRaw.fill(0),this.csmMatrixRaw.fill(0);for(let l=0;l<8;l++)if(l<t.length){let c=t[l].shadowCamera;this.shadowMatrixRaw.set(c.pvMatrix.rawData,l*16)}else this.shadowMatrixRaw.set(e.transform.worldMatrix.rawData,l*16);this.uniformGPUBuffer.setFloat32Array("shadowMatrix",this.shadowMatrixRaw);let a=_.setting.shadow.shadowSize;if(ra.Cascades>1&&e.enableCSM&&t[0])for(let l=0;l<ra.Cascades;l++){let c=e.csm.children[l].shadowCamera;this.csmMatrixRaw.set(c.pvMatrix.rawData,l*16),this.csmShadowBias[l]=e.getCSMShadowBiasScale(c)}this.uniformGPUBuffer.setFloat32Array("csmShadowBias",this.csmShadowBias),this.uniformGPUBuffer.setFloat32Array("csmMatrix",this.csmMatrixRaw),this.uniformGPUBuffer.setFloat32Array("shadowLights",this.shadowLights);let r=_.setting.reflectionSetting,i=K.instance.getReflections(e.transform.scene3D).length;this.uniformGPUBuffer.setFloat("reflectionProbeSize",r.reflectionProbeSize),this.uniformGPUBuffer.setFloat("reflectionProbeMaxCount",r.reflectionProbeMaxCount),this.uniformGPUBuffer.setFloat("reflectionMapWidth",r.width),this.uniformGPUBuffer.setFloat("reflectionMapHeight",r.height),this.uniformGPUBuffer.setFloat("reflectionCount",i),this.uniformGPUBuffer.setFloat("test2",lt.testObj.testValue2),this.uniformGPUBuffer.setFloat("test3",lt.testObj.testValue3),this.uniformGPUBuffer.setFloat("test4",lt.testObj.testValue4),this.uniformGPUBuffer.setVector3("CameraPos",e.transform.worldPosition),this.uniformGPUBuffer.setFloat("frame",Le.frame),this.uniformGPUBuffer.setFloat32Array("SH",e.sh),this.uniformGPUBuffer.setFloat("time",Le.time),this.uniformGPUBuffer.setFloat("delta",Le.delta),this.uniformGPUBuffer.setFloat("shadowBias",e.getShadowBias(a)),this.uniformGPUBuffer.setFloat("skyExposure",_.setting.sky.skyExposure),this.uniformGPUBuffer.setFloat("renderPassState",_.setting.render.renderPassState),this.uniformGPUBuffer.setFloat("quadScale",_.setting.render.quadScale),this.uniformGPUBuffer.setFloat("hdrExposure",_.setting.render.hdrExposure),this.uniformGPUBuffer.setInt32("renderState_left",_.setting.render.renderState_left),this.uniformGPUBuffer.setInt32("renderState_right",_.setting.render.renderState_right),this.uniformGPUBuffer.setFloat("renderState_split",_.setting.render.renderState_split);let n=_.inputSystem.mouseX*w.pixelRatio,o=_.inputSystem.mouseY*w.pixelRatio;this.uniformGPUBuffer.setFloat("mouseX",n),this.uniformGPUBuffer.setFloat("mouseY",o),this.uniformGPUBuffer.setFloat("windowWidth",w.windowWidth),this.uniformGPUBuffer.setFloat("windowHeight",w.windowHeight),this.uniformGPUBuffer.setFloat("near",e.near),this.uniformGPUBuffer.setFloat("far",e.far),this.uniformGPUBuffer.setFloat("pointShadowBias",_.setting.shadow.pointShadowBias),this.uniformGPUBuffer.setFloat("shadowMapSize",a),this.uniformGPUBuffer.setFloat("shadowSoft",_.setting.shadow.shadowSoft),this.uniformGPUBuffer.setFloat("enableCSM",e.enableCSM?1:0),this.uniformGPUBuffer.setFloat("csmMargin",_.setting.shadow.csmMargin),this.uniformGPUBuffer.setInt32("nDirShadowStart",this.dirShadowStart),this.uniformGPUBuffer.setInt32("nDirShadowEnd",this.dirShadowEnd),this.uniformGPUBuffer.setInt32("nPointShadowStart",this.pointShadowStart),this.uniformGPUBuffer.setInt32("nPointShadowEnd",this.pointShadowEnd),this.uniformGPUBuffer.setVector3("cameraForward",e.transform.forward),this.uniformGPUBuffer.setVector4Array("frustumPlanes",e.frustum.planes),this.uniformGPUBuffer.apply()}setShadowCamera(e){this.uniformGPUBuffer.setMatrix("_projectionMatrix",e.projectionMatrix),this.uniformGPUBuffer.setMatrix("_viewMatrix",e.viewMatrix),this.uniformGPUBuffer.setMatrix("_pvMatrix",e.pvMatrix),this.uniformGPUBuffer.setMatrix("pvMatrixInv",e.projectionMatrixInv),this.uniformGPUBuffer.setMatrix("viewToWorld",e.cameraToWorld),this.csmShadowBias.fill(1e-4),this.shadowMatrixRaw.fill(0),this.csmMatrixRaw.fill(0),this.uniformGPUBuffer.setFloat32Array("shadowCamera",this.shadowMatrixRaw),this.uniformGPUBuffer.setFloat32Array("csmShadowBias",this.csmShadowBias),this.uniformGPUBuffer.setFloat32Array("csmMatrix",this.csmMatrixRaw),this.uniformGPUBuffer.setFloat32Array("shadowLights",this.shadowLights),this.uniformGPUBuffer.setVector3("CameraPos",e.transform.worldPosition),this.uniformGPUBuffer.setFloat("frame",Le.frame),this.uniformGPUBuffer.setFloat32Array("SH",e.sh),this.uniformGPUBuffer.setFloat("time",Le.time),this.uniformGPUBuffer.setFloat("delta",Le.delta),this.uniformGPUBuffer.setFloat("shadowBias",_.setting.shadow.shadowBias),this.uniformGPUBuffer.setFloat("skyExposure",_.setting.sky.skyExposure),this.uniformGPUBuffer.setFloat("renderPassState",_.setting.render.renderPassState),this.uniformGPUBuffer.setFloat("quadScale",_.setting.render.quadScale),this.uniformGPUBuffer.setFloat("hdrExposure",_.setting.render.hdrExposure),this.uniformGPUBuffer.setInt32("renderState_left",_.setting.render.renderState_left),this.uniformGPUBuffer.setInt32("renderState_right",_.setting.render.renderState_right),this.uniformGPUBuffer.setFloat("renderState_split",_.setting.render.renderState_split);let t=_.inputSystem.mouseX*w.pixelRatio,a=_.inputSystem.mouseY*w.pixelRatio;this.uniformGPUBuffer.setFloat("mouseX",t),this.uniformGPUBuffer.setFloat("mouseY",a),this.uniformGPUBuffer.setFloat("windowWidth",w.windowWidth),this.uniformGPUBuffer.setFloat("windowHeight",w.windowHeight),this.uniformGPUBuffer.setFloat("near",e.near),this.uniformGPUBuffer.setFloat("far",e.far),this.uniformGPUBuffer.setFloat("pointShadowBias",_.setting.shadow.pointShadowBias),this.uniformGPUBuffer.setFloat("shadowMapSize",_.setting.shadow.shadowSize),this.uniformGPUBuffer.setFloat("shadowSoft",_.setting.shadow.shadowSoft),this.uniformGPUBuffer.setFloat("enableCSM",0),this.uniformGPUBuffer.setFloat("csmMargin",_.setting.shadow.csmMargin),this.uniformGPUBuffer.setInt32("nDirShadowStart",this.dirShadowStart),this.uniformGPUBuffer.setInt32("nDirShadowEnd",this.dirShadowEnd),this.uniformGPUBuffer.setInt32("nPointShadowStart",this.pointShadowStart),this.uniformGPUBuffer.setInt32("nPointShadowEnd",this.pointShadowEnd),this.uniformGPUBuffer.apply()}setShadowLight(){}}class t0{setting;probesBufferData;probesBuffer;isVolumeFrameChange=!0;randomOrientation;startPosition=new b;isVolumeChange=!0;irradianceVolumeBuffer;directionDistance=20;randomSeedCount=3;useRandomIndex=0;centerDirection=new b(0,0,this.directionDistance).normalize(1);arroundPositions=[];updateOrientation(){return this.useRandomIndex++,this.useRandomIndex>=this.arroundPositions.length&&(this.useRandomIndex=0),R.fromToRotation(this.centerDirection,this.arroundPositions[this.useRandomIndex],this.randomOrientation),this.randomOrientation}init(e){this.setting=e,this.randomOrientation=new R(!1),this.randomOrientation.identity(),this.irradianceVolumeBuffer=new yt(80),this.createFramesBuffer(),this.arroundPositions.push(this.centerDirection.clone());for(let t=0;t<this.randomSeedCount;t++){let a=Math.PI*2*t/this.randomSeedCount,r=new b(Math.sin(a),Math.cos(a),this.directionDistance).normalize(1);this.arroundPositions.push(r)}}setVolumeDataChange(){this.isVolumeChange=!0}updateProbes(e){let t=this.probesBufferData;for(let a of e){let r=a.index*4;t[r+3]=a.drawCallFrame}}createFramesBuffer(){if(!this.probesBufferData){let e=this.setting.probeXCount*this.setting.probeYCount*this.setting.probeZCount;this.probesBufferData=new Float32Array(e*4),this.probesBufferData.fill(-1),this.probesBuffer=new Te(e*4,GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST)}}uploadBuffer(){this.isVolumeChange&&(this.fillIrradianceData(),this.isVolumeChange=!1,this.isVolumeFrameChange=!0),this.probesBuffer.setFloat32Array("uniformFramesBuffer",this.probesBufferData)}calcPosition(e,t,a,r){let i=this.setting,n=this.setting.probeSpace;return r=r||new b,r.x=e*n-n*(i.probeXCount-1)*.5+i.offsetX,r.y=t*n-n*(i.probeYCount-1)*.5+i.offsetY,r.z=a*n-n*(i.probeZCount-1)*.5+i.offsetZ,r}debugX=0;debugY=0;debugZ=0;fillIrradianceData(){let e=this.setting,t=this.calcPosition(0,0,0,this.startPosition);this.irradianceVolumeBuffer.setFloat("orientationIndex",this.randomOrientation.index),this.irradianceVolumeBuffer.setFloat("hysteresis",e.hysteresis),this.irradianceVolumeBuffer.setFloat("OctRTSideSize",e.octRTSideSize),this.irradianceVolumeBuffer.setFloat("OctRTMaxSize",e.octRTMaxSize),this.irradianceVolumeBuffer.setFloat("startX",t.x),this.irradianceVolumeBuffer.setFloat("startY",t.y),this.irradianceVolumeBuffer.setFloat("startZ",t.z),this.irradianceVolumeBuffer.setFloat("ProbeSpace",e.probeSpace),this.irradianceVolumeBuffer.setFloat("probeXCount",e.probeXCount),this.irradianceVolumeBuffer.setFloat("probeYCount",e.probeYCount),this.irradianceVolumeBuffer.setFloat("probeZCount",e.probeZCount),this.irradianceVolumeBuffer.setFloat("maxDistance",e.probeSpace*1.732),this.irradianceVolumeBuffer.setFloat("depthSharpness",e.depthSharpness),this.irradianceVolumeBuffer.setFloat("ProbeSourceTextureSize",e.probeSourceTextureSize),this.irradianceVolumeBuffer.setFloat("ProbeSize",e.probeSize),this.irradianceVolumeBuffer.setFloat("bounceIntensity",e.bounceIntensity),this.irradianceVolumeBuffer.setFloat("probeRoughness",e.probeRoughness),this.irradianceVolumeBuffer.setFloat("normalBias",e.normalBias),this.irradianceVolumeBuffer.setFloat("irradianceChebyshevBias",e.irradianceChebyshevBias),this.irradianceVolumeBuffer.setFloat("rayNumber",e.rayNumber),this.irradianceVolumeBuffer.setFloat("irradianceDistanceBias",e.irradianceDistanceBias),this.irradianceVolumeBuffer.setFloat("indirectIntensity",e.indirectIntensity),this.irradianceVolumeBuffer.setFloat("ddgiGamma",e.ddgiGamma),this.irradianceVolumeBuffer.setFloat("lerpHysteresis",e.lerpHysteresis),this.irradianceVolumeBuffer.setFloat("debugX",this.debugX),this.irradianceVolumeBuffer.setFloat("debugY",this.debugY),this.irradianceVolumeBuffer.setFloat("debugZ",this.debugZ),this.irradianceVolumeBuffer.apply()}}class a0{storageGPUBuffer;irradianceVolume;_lightList=[];constructor(){this.storageGPUBuffer=new Te(fn.lightSize*_.setting.light.maxLight,GPUBufferUsage.COPY_SRC),this.irradianceVolume=new t0,this.irradianceVolume.init(_.setting.gi);for(let e=0;e<_.setting.light.maxLight;e++){let t=this.storageGPUBuffer.memory.allocation_node(fn.lightSize*4);this._lightList.push(t)}this.storageGPUBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE}update(e){this.storageGPUBuffer.clean();let t=K.instance.getLights(e.scene);for(let a=0;a<t.length;a++){const r=t[a].lightData;r.index=a,this.writeLightBytes(r,this._lightList[a])}this.storageGPUBuffer.apply()}writeLightBytes(e,t){t.offset=0,t.writeFloat(e.index),t.writeInt32(e.lightType),t.writeFloat(e.radius),t.writeFloat(e.linear),t.writeVector3(e.lightPosition),t.writeFloat(e.lightMatrixIndex),t.writeVector3(e.direction),t.writeFloat(e.quadratic),t.writeRGBColor(e.lightColor),t.writeFloat(e.intensity),t.writeFloat(e.innerAngle),t.writeFloat(e.outerAngle),t.writeFloat(e.range),t.writeInt32(e.castShadowIndex),t.writeVector3(e.lightTangent),t.writeFloat(e.iesIndex)}}class r0{storageGPUBuffer;reflectionMap;sourceReflectionMap;count;constructor(){this.storageGPUBuffer=new Te(768)}update(e){this.storageGPUBuffer.clean();let t=K.instance.getReflections(e.scene);for(let a=0;a<t.length;a++){const r=t[a];r.gid=a,this.storageGPUBuffer.setFloat("gid",r.gid),this.storageGPUBuffer.setVector3("worldPosition",r.transform.worldPosition),this.storageGPUBuffer.setFloat("radius",r.radius),this.storageGPUBuffer.setVector3("bound",r.transform.worldPosition)}this.count=t.length,this.storageGPUBuffer.apply()}}class i0 extends ja{size;constructor(e,t=0,a){super(),this.bufferType=ga.StorageGPUBuffer,this.size=e,this.createBuffer(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|t,e,a,"MatrixGPUBuffer")}writeBufferByHeap(e,t){let a;e instanceof Float64Array?a=new Float32Array(e):a=e;let r=w.device;if(a.length>0){let i=null;for(;this.mapAsyncReady.length&&(i=this.mapAsyncReady.shift(),i.usedSize!=a.byteLength);)i.destroy(),this.mapAsyncBuffersOutstanding--,i=null;i||(i=r.createBuffer({size:a.byteLength,usage:GPUBufferUsage.COPY_SRC|GPUBufferUsage.MAP_WRITE,mappedAtCreation:!0}),i.usedSize=a.byteLength,this.mapAsyncBuffersOutstanding++,this.mapAsyncBuffersOutstanding>10&&console.warn(` Warning: mapAsync requests from ${this.mapAsyncBuffersOutstanding} frames ago have not resolved yet. MB of staging buffers allocated.`));let n=new Float32Array(a.buffer,a.byteOffset,t);new Float32Array(i.getMappedRange(0,t*4)).set(n),i.unmap();const l=r.createCommandEncoder();l.copyBufferToBuffer(i,0,this.buffer,0,t*4),r.queue.submit([l.finish()]),i.mapAsync(GPUMapMode.WRITE).then(()=>this.mapAsyncReady.push(i))}}}class n0{uuid;index;usage;groupBufferSize;matrixBufferDst;constructor(){this.uuid=Gt(),this.groupBufferSize=0,this.usage=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST,this.cacheWorldMatrix()}cacheWorldMatrix(){this.groupBufferSize=R.maxCount*R.blockBytes,this.matrixBufferDst=new i0(this.groupBufferSize/4),this.matrixBufferDst.visibility=GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,this.matrixBufferDst.buffer.label=this.groupBufferSize.toString()}writeBuffer(e){const t=R.dynamicMatrixBytes;this.matrixBufferDst.mapAsyncWrite(t,e)}}class ve{static _cameraBindGroups;static _lightEntriesMap;static _reflectionEntriesMap;static modelMatrixBindGroup;static init(){this.modelMatrixBindGroup=new n0,this._cameraBindGroups=new Map,this._lightEntriesMap=new Map,this._reflectionEntriesMap=new Map}static getAllCameraGroup(){return this._cameraBindGroups}static getCameraGroup(e){let t=this._cameraBindGroups.get(e);return t||(t=new Us(this.modelMatrixBindGroup),this._cameraBindGroups.set(e,t)),e.isShadowCamera?t.setShadowCamera(e):t.setCamera(e),t}static updateCameraGroup(e){let t=this._cameraBindGroups.get(e);t||(t=new Us(this.modelMatrixBindGroup),this._cameraBindGroups.set(e,t)),e.isShadowCamera?t.setShadowCamera(e):t.setCamera(e)}static getLightEntries(e){e||console.log("getLightEntries scene is null");let t=this._lightEntriesMap.get(e);return t||(t=new a0,this._lightEntriesMap.set(e,t)),this._lightEntriesMap.get(e)}static getReflectionEntries(e){e||console.log("getLightEntries scene is null");let t=this._reflectionEntriesMap.get(e);return t||(t=new r0,this._reflectionEntriesMap.set(e,t)),this._reflectionEntriesMap.get(e)}}class F{static lastGeometry;static lastPipeline;static lastShader;static drawCount=0;static renderPassCount=0;static geometryCount=0;static pipelineCount=0;static matrixCount=0;static lastRenderPassState;static LastCommand;static bindPipeline(e,t){if(F.lastShader!=t)F.lastShader=t;else return!1;F.lastPipeline!=t.pipeline&&(F.lastPipeline=t.pipeline,e.setPipeline(t.pipeline));for(let a=1;a<t.bindGroups.length;a++){const r=t.bindGroups[a];r&&e.setBindGroup(a,r)}return!0}static bindCamera(e,t){let a=ve.getCameraGroup(t);e.setBindGroup(0,a.globalBindGroup)}static bindGeometryBuffer(e,t){if(this.lastGeometry!=t&&(this.lastGeometry=t,t.indicesBuffer)){e.setIndexBuffer(t.indicesBuffer.indicesGPUBuffer.buffer,t.indicesBuffer.indicesFormat);let a=t.vertexBuffer.vertexGPUBuffer,r=t.vertexBuffer.vertexBufferLayouts;for(let i=0;i<r.length;i++){const n=r[i];e.setVertexBuffer(i,a.buffer,n.offset,n.size)}}}static cleanCache(){this.lastGeometry=null,this.lastPipeline=null,this.lastShader=null}static createPipeline(e){return lt.countStart("GPUContext","pipeline"),w.device.createRenderPipeline(e)}static beginCommandEncoder(){return lt.countStart("GPUContext","beginCommandEncoder"),this.LastCommand&&w.device.queue.submit([this.LastCommand.finish()]),this.LastCommand=w.device.createCommandEncoder(),this.LastCommand}static endCommandEncoder(e){this.LastCommand==e&&(w.device.queue.submit([this.LastCommand.finish()]),this.LastCommand=null,lt.countStart("GPUContext","endCommandEncoder"))}static recordBundleEncoder(e){return w.device.createRenderBundleEncoder(e)}static beginRenderPass(e,t){if(this.cleanCache(),this.renderPassCount++,this.lastRenderPassState=t,t.depthTexture){let a=t.renderPassDescriptor.depthStencilAttachment;a.view=t.depthTexture.getGPUView()}if(t.renderTargets&&t.renderTargets.length>0){for(let a=0;a<t.renderTargets.length;++a){const r=t.renderTargets[a];let i=t.renderPassDescriptor.colorAttachments[a];t.multisample>0&&t.renderTargets.length==1?(i.view=t.multiTexture.createView(),i.resolveTarget=r.getGPUView()):i.view=r.getGPUTexture().createView()}return e.beginRenderPass(t.renderPassDescriptor)}else{let a=t.renderPassDescriptor.colorAttachments[0];return a&&(t.multisample>0?(a.view=t.multiTexture.createView(),a.resolveTarget=w.context.getCurrentTexture().createView()):a.view=w.context.getCurrentTexture().createView()),e.beginRenderPass(t.renderPassDescriptor)}}static drawIndexed(e,t,a,r,i,n){e.drawIndexed(t,a,r,i,n),this.drawCount++}static draw(e,t,a,r,i){e.draw(t,a,r,i),this.drawCount++}static endPass(e){e.insertDebugMarker("end"),e.end()}static computeCommand(e,t){let a=e.beginComputePass();for(let r=0;r<t.length;r++)t[r].compute(a);a.end()}static copyTexture(e,t,a){e.copyTextureToTexture({texture:t.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{texture:a.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{width:a.width,height:a.height,depthOrArrayLayers:1})}}class s0{source;input;output;reset(e){this.input&&this.input.destroy(),this.output&&this.output.destroy(),this.input=this.output=null,this.source=e}apply(e){if(this.source){if(!this.input){let t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST;this.input=new Te(this.source.length,t,this.source),this.input.apply()}if(!this.output){let t=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC;this.output=new Te(e*3,t),this.output.apply()}}}}class o0{enable;morphTargetsRelative;MaxMorphTargetCount=64;_computeConfigArray;_computeConfigBuffer;_morphInfluenceArray;_morphInfluenceBuffer;_positionAttrDataGroup;_normalAttrDataGroup;_isInfluenceDirty;_morphTargetCount;_totalVertexCount;_computeShader;_computeShaders;_computeWorkGroupXY=1;_collectMorphTargetData;_blendTarget;constructor(){this._isInfluenceDirty=!0,this.generateGPUBuffer(),this._positionAttrDataGroup=new s0,this._normalAttrDataGroup=new s0}initMorphTarget(e){this._collectMorphTargetData=this.collectMorphTargetList(e),this._computeShader&&this._computeShader.destroy();let t=Xt.CsMain;this._computeShader=new ye(t),this._collectMorphTargetData.mergedNormal?this._computeShader.setDefine("USE_MORPHNORMALS",!0):this._computeShader.deleteDefine("USE_MORPHNORMALS"),this._computeShaders=[this._computeShader],this._isInfluenceDirty=!0,this._morphTargetCount=this._collectMorphTargetData.mtCount,this._totalVertexCount=this._collectMorphTargetData.vCount,this._morphInfluenceArray.fill(0),this._computeWorkGroupXY=this.calcWorkGroup(this._totalVertexCount),this._positionAttrDataGroup.reset(this._collectMorphTargetData.mergedPos),this._normalAttrDataGroup.reset(this._collectMorphTargetData.mergedNormal)}applyRenderShader(e){this.uploadMorphTargetBuffer(),this.uploadConfigGBuffer(),e.setUniformBuffer("morphTargetConfig",this._computeConfigBuffer),e.setStorageBuffer("morphTargetOpPositions",this._positionAttrDataGroup.output),this._collectMorphTargetData.mergedNormal&&e.setStorageBuffer("morphTargetOpNormals",this._normalAttrDataGroup.output)}computeMorphTarget(e){this.uploadConfigGBuffer(),this.uploadMorphTargetBuffer(),this._computeShader.setUniformBuffer("morphTargetConfig",this._computeConfigBuffer),this._computeShader.setStorageBuffer("morphTargetInfluence",this._morphInfluenceBuffer),this._computeShader.setStorageBuffer("morphTargetPositions",this._positionAttrDataGroup.input),this._computeShader.setStorageBuffer("morphTargetOpPositions",this._positionAttrDataGroup.output),this._collectMorphTargetData.mergedNormal&&(this._computeShader.setStorageBuffer("morphTargetNormals",this._normalAttrDataGroup.input),this._computeShader.setStorageBuffer("morphTargetOpNormals",this._normalAttrDataGroup.output)),this._computeShader.workerSizeX=this._computeWorkGroupXY,this._computeShader.workerSizeY=this._computeWorkGroupXY,this._computeShader.workerSizeZ=1,F.computeCommand(e,this._computeShaders)}updateInfluence(e,t){this._isInfluenceDirty=!0,this._morphInfluenceArray[e]=t}get blendShape(){return this._blendTarget}collectMorphTargetList(e){let t=this.collectAttribute("a_morphPositions_",e),a=t.length,r=t[0].data.length/3;if(this._blendTarget={},e.blendShapeData)for(let l=0;l<e.blendShapeData.shapeIndexs.length;l++){let c=e.blendShapeData.shapeIndexs[l],f=e.blendShapeData.shapeNames[l].split("."),h=f[f.length-1];this._blendTarget[h]=u=>this.updateInfluence(c,u)}let i=new Float32Array(r*a*3);{let l=0;for(let c=0;c<a;c++){let f=t[c];i.set(f.data,l),l+=f.data.length}}let n=this.collectAttribute("a_morphNormals_",e),o;if(n&&n.length>0){let l=0;o=new Float32Array(r*a*3);for(let c=0;c<a;c++){let f=n[c];o.set(f.data,l),l+=f.data.length}}return{mtCount:a,vCount:r,mergedPos:i,mergedNormal:o}}collectAttribute(e,t){let a=[];for(let r=0;r<this.MaxMorphTargetCount;r++){let i=e+r,n=t.getAttribute(i);if(n)a[r]=n;else break}return a}uploadConfigGBuffer(){if(this._isInfluenceDirty){let e=0;for(let t=0;t<this._morphTargetCount;t++)e+=this._morphInfluenceArray[t];this._morphInfluenceBuffer.setFloat32Array("data",this._morphInfluenceArray),this._morphInfluenceBuffer.apply(),this._computeConfigArray[0]=this.morphTargetsRelative?1:1-e,this._computeConfigArray[1]=this._morphTargetCount,this._computeConfigArray[2]=this._totalVertexCount,this._computeConfigArray[3]=this._computeWorkGroupXY,this._computeConfigBuffer.setFloat32Array("data",this._computeConfigArray),this._computeConfigBuffer.apply(),this._isInfluenceDirty=!1}}calcWorkGroup(e){let t=Math.ceil(Math.sqrt(e)),a=Math.ceil(Math.log2(t));return t=Math.pow(2,a),t}uploadMorphTargetBuffer(){this._positionAttrDataGroup.output||this._positionAttrDataGroup.apply(this._totalVertexCount),this._normalAttrDataGroup.output||this._normalAttrDataGroup.apply(this._totalVertexCount)}generateGPUBuffer(){this._computeConfigArray=new Float32Array(4),this._computeConfigBuffer=new yt(4),this._morphInfluenceArray=new Float32Array(this.MaxMorphTargetCount);let e=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST;this._morphInfluenceBuffer=new Te(this.MaxMorphTargetCount,e)}destroy(e){this._computeConfigBuffer&&(this._computeConfigBuffer.destroy(e),this._computeConfigBuffer=null),this._morphInfluenceBuffer&&(this._morphInfluenceBuffer.destroy(e),this._morphInfluenceBuffer=null),this._computeShader&&(this._computeShader.destroy(e),this._computeShader=null),this._positionAttrDataGroup&&(this._positionAttrDataGroup.input&&this._positionAttrDataGroup.input.destroy(e),this._positionAttrDataGroup.output&&this._positionAttrDataGroup.output.destroy(e),this._positionAttrDataGroup=null),this._normalAttrDataGroup&&(this._normalAttrDataGroup.input&&this._normalAttrDataGroup.input.destroy(e),this._normalAttrDataGroup.output&&this._normalAttrDataGroup.output.destroy(e),this._normalAttrDataGroup=null),this._computeConfigArray=null,this._morphInfluenceArray=null,this._collectMorphTargetData=null,this._blendTarget=null,this._computeShaders=null}}var D2=Object.defineProperty,_2=Object.getOwnPropertyDescriptor,ys=(s,e,t,a)=>{for(var r=a>1?void 0:a?_2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=(a?n(e,t,r):n(r))||r);return a&&r&&D2(e,t,r),r};d.MeshRenderer=class extends Ia{receiveShadow;morphData;constructor(){super()}onEnable(){super.onEnable()}onDisable(){super.onDisable()}cloneTo(e){e.addComponent(d.MeshRenderer).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.receiveShadow=e.receiveShadow,this}get geometry(){return this._geometry}set geometry(e){if(super.geometry=e,e){let t=e.morphTargetDictionary!=null;t&&(this.morphData||=new o0,this.morphData.morphTargetsRelative=e.morphTargetsRelative,this.morphData.initMorphTarget(e)),this.morphData&&(this.morphData.enable=t),this.morphData?.enable?this.addRendererMask(Qe.MorphTarget):this.removeRendererMask(Qe.MorphTarget),this.object3D.bound=this._geometry.bounds.clone()}else this.morphData&&(this.morphData.enable=!1),this.removeRendererMask(Qe.MorphTarget);this._readyPipeline||(this.initPipeline(),this._computes&&(this.onCompute=nn(this.onCompute,()=>{for(let t=0;t<this._computes.length;t++)this._computes[t].onUpdate()})))}get material(){return this._materials[0]}set material(e){this.materials=[e]}setMorphInfluence(e,t){if(this.morphData&&this.morphData.enable){let a=this._geometry.morphTargetDictionary[e];a>=0&&this.morphData.updateInfluence(a,t)}}setMorphInfluenceIndex(e,t){this.morphData&&this.morphData.enable&&e>=0&&this.morphData.updateInfluence(e,t)}onCompute(e,t){this.morphData&&this.morphData.enable&&this.morphData.computeMorphTarget(t)}nodeUpdate(e,t,a,r){if(this.morphData&&this.morphData.enable)for(let i=0;i<this.materials.length;i++){let o=this.materials[i].getPass(t);if(o)for(let l=0;l<o.length;l++)this.morphData.applyRenderShader(o[l])}super.nodeUpdate(e,t,a,r)}destroy(e){this.morphData&&(this.morphData.destroy(e),this.morphData=null),super.destroy(e)}},ys([jr],d.MeshRenderer.prototype,"geometry",1),ys([jr],d.MeshRenderer.prototype,"material",1),d.MeshRenderer=ys([Lt(d.MeshRenderer,"MeshRenderer")],d.MeshRenderer);class Qa{static compressGBufferTex_NAME="compressGBufferTex_NAME";static colorBufferTex_NAME="colorBufferTex";static positionBufferTex_NAME="positionBufferTex";static normalBufferTex_NAME="normalBufferTex";static materialBufferTex_NAME="materialBufferTex";static zBufferTexture_NAME="zBufferTexture";static zPreDepthTexture_NAME="zPreDepthTexture";static outTex_NAME="outTex"}class l0{label="";customSize=!1;zPreTexture=null;depthTexture=null;renderTargetTextures;outColor=-1;renderTargets;rtTextureDescriptors;irradianceBuffer;multisample=0;multiTexture;depthViewIndex=0;depthCleanValue=0;isOutTarget=!0;camera3D;rtFrame;renderPassDescriptor;renderBundleEncoderDescriptor;depthLoadOp;getLastRenderTexture(){return this.renderTargets&&this.renderTargets.length>0?this.renderTargets[0]:_.res.redTexture}}class kt extends ft{resolveTarget;sampleCount;autoResize;clear;constructor(e,t,a=se.rgba8unorm,r=!1,i,n=1,o=0,l=!0,c=!0){super(e,t,n),this.name=Gt(),this.autoResize=c,this.useMipmap=r,this.sampleCount=o,this.format=a,this.numberLayer=n,this.clear=l,i!=null?this.usage=i:this.usage=i|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.COPY_DST,this.resize(e,t),this.autoResize&&w.addEventListener(ir.RESIZE,f=>{let{width:h,height:u}=f.data;this.resize(h,u),this._textureChange=!0},this)}resize(e,t){let a=w.device;this.gpuTexture&&(ft.delayDestroyTexture(this.gpuTexture),this.gpuTexture=null,this.view=null),this.width=e,this.height=t,this.createTextureDescriptor(e,t,1,this.format,this.usage,this.numberLayer,this.sampleCount),this.useMipmap=!1,this.visibility=GPUShaderStage.COMPUTE|GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,this.format==se.rgba32float?(this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="unfilterable-float",this.gpuSampler=a.createSampler({})):this.format==se.depth32float?(this.samplerBindingLayout.type="filtering",this.sampler_comparisonBindingLayout.type="comparison",this.textureBindingLayout.sampleType="depth",this.gpuSampler=w.device.createSampler({}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})):this.format==se.depth24plus?(this.samplerBindingLayout={type:"filtering"},this.sampler_comparisonBindingLayout={type:"comparison"},this.textureBindingLayout.sampleType="depth",this.gpuSampler=w.device.createSampler({}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})):(this.samplerBindingLayout.type="filtering",this.textureBindingLayout.sampleType="float",this.sampleCount>0&&(this.textureBindingLayout.multisampled=!0),this.minFilter="linear",this.magFilter="linear",this.mipmapFilter="linear",this.addressModeU=Ht.clamp_to_edge,this.addressModeV=Ht.clamp_to_edge,this.gpuSampler=a.createSampler(this)),this._textureChange=!0}create(e,t,a=!0){let r=w.device;const i=e*4;let n=new Float32Array(e*t*4);const o=r.createBuffer({size:n.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});r.queue.writeBuffer(o,0,n);const l=F.beginCommandEncoder();l.copyBufferToTexture({buffer:o,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(l)}clone(){let e=new kt(this.width,this.height,this.format,this.useMipmap,this.usage,this.numberLayer,this.sampleCount,this.clear,this.autoResize);return e.name="clone_"+e.name,e}readTextureToImage(){let e=w.device,t=w.windowWidth,a=w.windowHeight,r=new Float32Array(t*a*4);const i=e.createBuffer({size:r.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});return F.beginCommandEncoder().copyTextureToBuffer({texture:this.getGPUTexture()},{buffer:i},[t,a]),i.getMappedRange(0,r.byteLength)}}class Ge{storeOp="store";loadOp="clear";clearValue=[0,0,0,0]}class rt{label;customSize=!1;renderTargets;rtDescriptors;zPreTexture;depthTexture;depthViewIndex=0;depthCleanValue=1;depthLoadOp="clear";isOutTarget=!0;constructor(e,t,a,r,i=!0){this.renderTargets=e,this.rtDescriptors=t,this.depthTexture=a,this.zPreTexture=r,this.isOutTarget=i}clone2Frame(e){e.renderTargets.push(...this.renderTargets.concat());for(let t=0;t<this.rtDescriptors.length;t++){const a=this.rtDescriptors[t];let r=new Ge;r.loadOp=a.loadOp,r.storeOp=a.storeOp,r.clearValue=a.clearValue,e.rtDescriptors.push(r)}e.depthTexture=this.depthTexture,e.zPreTexture=this.zPreTexture,e.customSize=this.customSize}clone(){let e=new rt([],[]);return this.clone2Frame(e),e}}class _e extends rt{static colorPass_GBuffer="ColorPassGBuffer";static reflections_GBuffer="reflections_GBuffer";static gui_GBuffer="gui_GBuffer";static gBufferMap=new Map;_colorBufferTex;_compressGBufferTex;constructor(){super([],[])}createGBuffer(e,t,a,r=!0,i=!0,n){let o=this.renderTargets,l=this.rtDescriptors;if(i){let f=new Ge;f.loadOp="clear",this._colorBufferTex=Et.createRTTexture(e+Qa.colorBufferTex_NAME,t,a,se.rgba16float,!0),o.push(this._colorBufferTex),l.push(f)}this._compressGBufferTex=new kt(t,a,se.rgba32float,!1,void 0,1,0,!0,!0),o.push(this._compressGBufferTex),n?this.depthTexture=n:(this.depthTexture=new kt(t,a,se.depth24plus,!1,void 0,1,0,!0,!0),this.depthTexture.name=e+"_depthTexture");let c;c=new Ge,l.push(c)}getPositionMap(){return this.renderTargets[1]}getNormalMap(){return this.renderTargets[2]}getColorTexture(){return this._colorBufferTex}getCompressGBufferTexture(){return this._compressGBufferTex}static getGBufferFrame(e,t=0,a=0,r=!0,i){let n;if(_e.gBufferMap.has(e))n=_e.gBufferMap.get(e);else{n=new _e;let o=w.presentationSize;n.createGBuffer(e,t==0?o[0]:t,a==0?o[1]:a,t!=0&&a!=0,r,i),_e.gBufferMap.set(e,n)}return n}static getGUIBufferFrame(){let e=this.getGBufferFrame(this.colorPass_GBuffer);return _e.getGBufferFrame(_e.gui_GBuffer,0,0,!0,e.depthTexture)}clone(){let e=new _e;return this.clone2Frame(e),e}}class Je{static rendererPassState=new Map;static createRendererPassState(e,t=null){let a=Je.rendererPassState.get(e);if(a||(a=new l0,a.label=e.label,a.customSize=e.customSize,a.rtFrame=e,a.zPreTexture=e.zPreTexture,a.depthTexture=e.depthTexture,a.depthViewIndex=e.depthViewIndex,a.isOutTarget=e.isOutTarget,a.depthCleanValue=e.depthCleanValue,a.depthLoadOp=e.depthLoadOp,Je.rendererPassState.set(e,a)),e&&e.renderTargets.length>0){a.renderTargets=e.renderTargets,a.rtTextureDescriptors=e.rtDescriptors,a.renderPassDescriptor=Je.getRenderPassDescriptor(a),a.renderPassDescriptor.depthStencilAttachment&&(a.renderPassDescriptor.depthStencilAttachment.depthLoadOp=e.depthLoadOp),t=="load"&&e?.renderTargets[0]&&e.renderTargets[0].name.startsWith(_e.gui_GBuffer)&&(a.renderPassDescriptor.colorAttachments[0].loadOp="load"),a.depthLoadOp=e.depthLoadOp,a.renderBundleEncoderDescriptor=Je.getRenderBundleDescriptor(a),a.renderTargetTextures=[];for(let r=0;r<e.renderTargets.length;r++){const i=e.renderTargets[r];a.renderTargetTextures[r]={format:i.format},i.name.indexOf(Qa.colorBufferTex_NAME)!=-1&&(a.outColor=r)}}else a.renderPassDescriptor=Je.getRenderPassDescriptor(a,t),a.renderBundleEncoderDescriptor=Je.getRenderBundleDescriptor(a),a.renderTargetTextures=[{format:w.presentationFormat}],a.outColor=0;return a}static getRenderPassDescriptor(e,t=null){if(e.renderPassDescriptor)return e.renderPassDescriptor;w.device,w.presentationSize;let a=[];if(e.renderTargets&&e.renderTargets.length>0){e.renderTargets[0].width,e.renderTargets[0].height;for(let i=0;i<e.renderTargets.length;i++){const n=e.renderTargets[i],o=e.rtTextureDescriptors[i];a.push({view:n.getGPUView(),resolveTarget:void 0,loadOp:o.loadOp,clearValue:o.clearValue,storeOp:o.storeOp})}}else if(!e.customSize){let i=w.canvasConfig&&w.canvasConfig.alpha?[1,1,1,0]:[0,0,0,1];e.isOutTarget==!0&&a.push({view:void 0,resolveTarget:void 0,loadOp:w.canvasConfig&&w.canvasConfig.alpha||t!=null?"load":"clear",clearValue:i,storeOp:"store"})}let r=null;return e.depthTexture||e.zPreTexture?(e.zPreTexture&&(e.depthTexture=e.zPreTexture),r={label:`${e.label} renderPassDescriptor zPreTexture${e.zPreTexture?"load":"clear"}`,colorAttachments:a,depthStencilAttachment:{view:e.depthTexture.getGPUView(),depthLoadOp:e.zPreTexture?"load":e.depthLoadOp,depthClearValue:e.zPreTexture?1:e.depthCleanValue,depthStoreOp:"store"}}):r={colorAttachments:a,label:"renderPassDescriptor not writeDepth"},e.renderPassDescriptor=r,r}static getRenderBundleDescriptor(e){if(e.renderBundleEncoderDescriptor)return e.renderBundleEncoderDescriptor;w.presentationSize;let t=[];if(e.renderTargets&&e.renderTargets.length>0){e.renderTargets[0].width,e.renderTargets[0].height;for(let r=0;r<e.renderTargets.length;r++){const i=e.renderTargets[r];t.push(i.format)}}let a=null;return e.depthTexture?a={colorFormats:t,depthStencilFormat:e.depthTexture.format}:a={colorFormats:t},e.renderBundleEncoderDescriptor=a,e.renderBundleEncoderDescriptor}}class $r extends Ve{width;height;segmentW;segmentH;up;constructor(e,t,a=1,r=1,i=b.Y_AXIS){super(),this.width=e,this.height=t,this.segmentW=a,this.segmentH=r,this.up=i,this.buildGeometry(this.up)}buildGeometry(e){var t,a,r,i,n=this.segmentW+1;(this.segmentH+1)*n,this.bounds=new xe(b.ZERO.clone(),new b(this.width,1,this.height)),r=this.segmentH*this.segmentW*6;let o=(this.segmentW+1)*(this.segmentH+1),l=new Float32Array(o*3),c=new Float32Array(o*3),f=new Float32Array(o*2),h;this.segmentW*this.segmentH*2*3>=Uint16Array.length?h=new Uint32Array(this.segmentW*this.segmentH*2*3):h=new Uint16Array(this.segmentW*this.segmentH*2*3),r=0;for(var g=0,A=0,m=0,p=0;p<=this.segmentH;++p)for(var D=0;D<=this.segmentW;++D){switch(t=(D/this.segmentW-.5)*this.width,a=(p/this.segmentH-.5)*this.height,e){case b.Y_AXIS:l[g++]=t,l[g++]=0,l[g++]=a,c[A++]=0,c[A++]=1,c[A++]=0;break;case b.Z_AXIS:l[g++]=t,l[g++]=-a,l[g++]=0,c[A++]=0,c[A++]=0,c[A++]=1;break;case b.X_AXIS:l[g++]=0,l[g++]=t,l[g++]=a,c[A++]=1,c[A++]=0,c[A++]=0;break;default:l[g++]=t,l[g++]=0,l[g++]=a,c[A++]=0,c[A++]=1,c[A++]=0;break}f[m++]=D/this.segmentW,f[m++]=p/this.segmentH,D!=this.segmentW&&p!=this.segmentH&&(i=D+p*n,h[r++]=i+1,h[r++]=i,h[r++]=i+n,h[r++]=i+1,h[r++]=i+n,h[r++]=i+n+1)}this.setIndices(h),this.setAttribute(G.position,l),this.setAttribute(G.normal,c),this.setAttribute(G.uv,f),this.setAttribute(G.TEXCOORD_1,f),this.addSubGeometry({indexStart:0,indexCount:h.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0})}}var B2=Object.getOwnPropertyDescriptor,v2=(s,e,t,a)=>{for(var r=a>1?void 0:a?B2(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.QuadShader=class extends gt{constructor(e="QuadGlsl_vs",t="QuadGlsl_fs"){super();let a=new Xe(e,t);this.addRenderPass(a);let r=a.shaderState;a.blendMode=me.NONE,r.frontFace="cw",r.depthWriteEnabled=!1,r.depthCompare=ot.always,r.multisample=0,this.setTexture("baseMap",_.res.blackTexture),this.setUniformFloat("x",0),this.setUniformFloat("y",0),this.setUniformFloat("width",100),this.setUniformFloat("height",100)}},d.QuadShader=v2([Ra(d.QuadShader,"QuadShader")],d.QuadShader);class Cs extends d.Object3D{width=128;height=128;quadRenderer;material;rendererPassState;quadShader;constructor(e="QuadGlsl_vs",t="QuadGlsl_fs",a,r=0,i=!1){super();let n=a?a.renderTargets:[];this.material=new Dt,this.quadShader=new d.QuadShader(e,t),this.material.shader=this.quadShader,this.quadRenderer=this.addComponent(d.MeshRenderer),this.quadRenderer.material=this.material,this.quadRenderer.castGI=!1,this.quadRenderer.castShadow=!1,this.quadRenderer.drawType=i?2:0,this.quadRenderer.geometry=new $r(100,100,1,1),this.quadRenderer.material=this.material,this.quadRenderer.__start(),this.quadRenderer._enable=!0,this.quadRenderer.onEnable(),this.rendererPassState=Je.createRendererPassState(a,"load"),r>0&&(this.rendererPassState.multisample=this.quadShader.getDefaultColorShader().shaderState.multisample,this.rendererPassState.multiTexture=w.device.createTexture({size:{width:w.presentationSize[0],height:w.presentationSize[1]},sampleCount:r,format:n.length>0?n[0].format:w.presentationFormat,usage:GPUTextureUsage.RENDER_ATTACHMENT})),w.addEventListener(ir.RESIZE,o=>{this.rendererPassState=Je.createRendererPassState(a,"load"),r>0&&(this.rendererPassState.multisample=this.quadShader.getDefaultColorShader().shaderState.multisample,this.rendererPassState.multiTexture=w.device.createTexture({size:{width:w.presentationSize[0],height:w.presentationSize[1]},sampleCount:r,format:n.length>0?n[0].format:w.presentationFormat,usage:GPUTextureUsage.RENDER_ATTACHMENT}))},this)}renderTarget(e,t,a){let r=e.camera,i=F.beginRenderPass(a,t.rendererPassState);F.bindCamera(i,r),t.quadRenderer.nodeUpdate(e,le.COLOR,t.rendererPassState,null),t.quadRenderer.renderPass2(e,le.COLOR,t.rendererPassState,null,i),F.endPass(i)}renderToViewQuad(e,t,a,r){let i=e.camera;t.quadShader.setTexture("baseMap",r);let n=F.beginRenderPass(a,t.rendererPassState);F.bindCamera(n,i),t.quadRenderer.nodeUpdate(e,le.COLOR,t.rendererPassState,null),t.quadRenderer.renderPass2(e,le.COLOR,t.rendererPassState,null,n),F.endPass(n)}}class Et{static rtTextureMap;static rtViewQuad;static init(){this.rtTextureMap=new Map,this.rtViewQuad=new Map}static createRTTexture(e,t,a,r,i=!1,n=0){let o=this.rtTextureMap.get(e);return o||(e==Qa.colorBufferTex_NAME?o=new kt(t,a,r,i,void 0,1,n,!1):o=new kt(t,a,r,i,void 0,1,n,!0),o.name=e,Et.rtTextureMap.set(e,o)),o}static createRTTextureArray(e,t,a,r,i=1,n=!1,o=0){let l=this.rtTextureMap.get(e);return l||(l=new kt(t,a,r,n,void 0,i,o),l.name=e,Et.rtTextureMap.set(e,l)),l}static createViewQuad(e,t,a,r,i=0){let n=new rt([r],[new Ge]),o=new Cs(t,a,n,i);return Et.rtViewQuad.set(e,o),o}static getTexture(e){return this.rtTextureMap.get(e)}static CreateSplitTexture(e){let t=this.getTexture(Qa.colorBufferTex_NAME),a=this.getTexture(e+"_split");return a||(a=this.createRTTexture(e+"_split",t.width,t.height,t.format,!1)),a}static WriteSplitColorTexture(e){let t=this.getTexture(Qa.colorBufferTex_NAME),a=this.getTexture(e+"_split");const r=F.beginCommandEncoder();r.copyTextureToTexture({texture:t.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{texture:a.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{width:a.width,height:a.height,depthOrArrayLayers:1}),F.endCommandEncoder(r)}}class Ss{command;encoder;rendererPassStates;rtFrame;constructor(e){this.rtFrame=e,this.rendererPassStates=[]}clean(){this.rendererPassStates.length=0,F.cleanCache()}beginContinueRendererPassState(e="load",t="load"){if(this.rendererPassStates.length>0){let a=this.rtFrame.clone();for(const i of a.rtDescriptors)i.loadOp="load";a.depthLoadOp=t;let r=Je.createRendererPassState(a,e);return this.rendererPassStates.push(r),r}else{this.rtFrame.depthLoadOp=t;let a=Je.createRendererPassState(this.rtFrame,e);return this.rendererPassStates.push(a),a}}get rendererPassState(){return this.rendererPassStates[this.rendererPassStates.length-1]}beginOpaqueRenderPass(){this.beginContinueRendererPassState("clear","clear"),this.begineNewCommand(),this.beginNewEncoder()}beginTransparentRenderPass(){this.beginContinueRendererPassState("load","load"),this.begineNewCommand(),this.beginNewEncoder()}specialtRenderPass(){this.beginContinueRendererPassState("load","load"),this.begineNewCommand(),this.beginNewEncoder()}endRenderPass(){this.endEncoder(),this.endCommand()}begineNewCommand(){return this.command=F.beginCommandEncoder(),this.command}endCommand(){F.endCommandEncoder(this.command),this.command=null}beginNewEncoder(){return this.encoder=F.beginRenderPass(this.command,this.rendererPassState),this.encoder}endEncoder(){F.endPass(this.encoder),this.encoder=null}}class Ta extends Ja{rendererPassState;splitRendererPassState;useRenderBundle=!1;debugViewQuads;debugTextures;renderContext;_rendererType;_rtFrame;get passType(){return this._rendererType}set passType(e){this._rendererType=e}constructor(){super(),this.debugTextures=[],this.debugViewQuads=[]}setRenderStates(e){if(this._rtFrame=e,e){this.rendererPassState=Je.createRendererPassState(e);let t=e.clone();t.depthLoadOp="load";for(const a of t.rtDescriptors)a.loadOp="load";this.splitRendererPassState=Je.createRendererPassState(t)}this.renderContext=new Ss(e)}getRenderContext(e){return this._rtFrame=e,new Ss(e)}setIrradiance(e,t){this.rendererPassState.irradianceBuffer=[e,t]}compute(e,t){}render(e,t,a,r=!1){F.cleanCache();let i=e.camera,n=e.scene;this.rendererPassState.camera3D=i;let o=K.instance.getRenderNodes(n,i),l=this.renderBundleOp(e,o,t,a),c=r?[]:this.renderBundleTr(e,o,t,a);{let f=F.beginCommandEncoder(),h=F.beginRenderPass(f,this.rendererPassState);l.length>0&&h.executeBundles(l),!r&&K.instance.sky&&(F.bindCamera(h,i),K.instance.sky.renderPass2(e,this._rendererType,this.rendererPassState,a,h)),this.drawRenderNodes(e,h,f,o.opaqueList,t),F.endPass(h),F.endCommandEncoder(f)}{let f=F.beginCommandEncoder(),h=F.beginRenderPass(f,this.rendererPassState);c.length>0&&h.executeBundles(c),r||(F.bindCamera(h,i),this.drawRenderNodes(e,h,f,o.transparentList,t)),F.endPass(h),F.endCommandEncoder(f)}}nodeUpload(e,t,a){}occlusionRenderNodeTest(e,t,a){return a?a.occlusionRenderNodeTest(e)>0:!0}renderOp(e,t,a,r,i){}renderTr(e,t,a,r,i){}renderBundleOp(e,t,a,r){let i=K.instance.getOpRenderGroup(e.scene);if(i){let n=[];return i.renderGroup.forEach(o=>{if(o.bundleMap.has(this._rendererType))n.push(o.bundleMap.get(this._rendererType));else{let l=F.recordBundleEncoder(this.rendererPassState.renderBundleEncoderDescriptor);this.recordRenderBundleNode(e,l,o.renderNodes,r);let c=l.finish();o.bundleMap.set(this._rendererType,c),n.push(c)}}),n}return[]}renderBundleTr(e,t,a,r){let i=K.instance.getTrRenderGroup(e.scene);if(i){let n=[];return i.renderGroup.forEach(o=>{if(o.bundleMap.has(this._rendererType))n.push(o.bundleMap.get(this._rendererType));else{let l=F.recordBundleEncoder(this.rendererPassState.renderBundleEncoderDescriptor);this.recordRenderBundleNode(e,l,o.renderNodes,r);let c=l.finish();o.bundleMap.set(this._rendererType,c),n.push(c)}}),n}return[]}recordRenderBundleNode(e,t,a,r){F.bindCamera(t,e.camera),F.bindGeometryBuffer(t,a[0].geometry);for(let i=0;i<a.length;++i){let n=a[i];n.transform.worldMatrix.index,n.transform.enable&&n.recordRenderPass2(e,this._rendererType,this.rendererPassState,r,t)}}drawRenderNodes(e,t,a,r,i,n){F.bindCamera(t,e.camera);for(let o=_.setting.render.drawOpMin;o<Math.min(r.length,_.setting.render.drawOpMax);++o){let l=r[o];l.transform.enable&&l.enable&&l.renderPass2(e,this._rendererType,this.rendererPassState,n,t)}}}class c0 extends Ta{constructor(){super(),this.passType=le.COLOR}render(e,t,a,r=!1){this.renderContext.clean();let i=e.scene,n=e.camera;ve.updateCameraGroup(n),this.rendererPassState.camera3D=n;let o=K.instance.getRenderNodes(i,n),l=this.renderBundleOp(e,o,t,a),c=r?[]:this.renderBundleTr(e,o,t,a);{this.renderContext.beginOpaqueRenderPass();let f=this.renderContext.encoder;l.length>0&&(K.instance.getOpRenderGroup(i),f.executeBundles(l)),!r&&K.instance.sky&&(F.bindCamera(f,n),K.instance.sky.preInit(this._rendererType)||K.instance.sky.nodeUpdate(e,this._rendererType,this.rendererPassState,a),K.instance.sky.renderPass2(e,this._rendererType,this.rendererPassState,a,f)),o.opaqueList&&(F.bindCamera(f,n),this.drawNodes(e,this.renderContext,o.opaqueList,t,a))}{let f=this.renderContext.encoder;c.length>0&&f.executeBundles(c),!r&&o.transparentList&&(F.bindCamera(f,n),this.drawNodes(e,this.renderContext,o.transparentList,t,a));let h=K.instance.getGraphicList();for(let u=0;u<h.length;u++){const g=h[u];g.nodeUpdate(e,this._rendererType,this.splitRendererPassState,a),g.renderPass2(e,this._rendererType,this.splitRendererPassState,a,f)}this.renderContext.endRenderPass(),lt.end("ColorPass Draw Transparent")}}drawNodes(e,t,a,r,i){let n=K.instance.getRenderShaderCollect(e);if(n){for(const o of n){let l=o[1];for(const c of l){let f=c[1];if(!f.isDestroyed&&f.preInit(this._rendererType)){f.nodeUpdate(e,this._rendererType,this.rendererPassState,i);break}}}for(let o=_.setting.render.drawOpMin;o<Math.min(a.length,_.setting.render.drawOpMax);++o){let l=a[o];l.transform.enable&&l.enable&&(l.hasMask(Qe.UI)&&!l.isRecievePostEffectUI||l.isDestroyed||(l.preInit(this._rendererType)||l.nodeUpdate(e,this._rendererType,this.rendererPassState,i),l.renderPass(e,this.passType,this.renderContext)))}}}occlusionRenderNodeTest(e,t,a){return a.zDepthRenderNodeTest(t)>0}}class xs{frustumCullingList;zVisibleList;_renderList;static enable=!0;constructor(){this._renderList=new Map}occlusionRenderNodeTest(e){return _.setting.occlusionQuery.enable?this.frustumCullingList?this.frustumCullingList[e]:0:1}zDepthRenderNodeTest(e){return this.zVisibleList?this.zVisibleList[e]:0}update(e,t){}collect(e,t){}renderCommitTesting(e,t){return!0}}class ei extends ja{constructor(e,t){super(),this.bufferType=ga.ComputeGPUBuffer,this.createBuffer(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST,e,t,"ComputeGPUBuffer")}}class f0{clusterBuffer;lightAssignBuffer;assignTableBuffer;clustersUniformBuffer;constructor(e,t){this.clusterBuffer=new ei(e*2*4),this.clustersUniformBuffer=new yt(10),this.clustersUniformBuffer.visibility=GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,this.lightAssignBuffer=new ei(e*t),this.lightAssignBuffer.visibility=GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE,this.assignTableBuffer=new ei(e*4),this.assignTableBuffer.visibility=GPUShaderStage.FRAGMENT|GPUShaderStage.COMPUTE}update(e,t,a,r,i,n,o,l,c,f){this.clustersUniformBuffer.setFloat("clusterTileX",r),this.clustersUniformBuffer.setFloat("clusterTileY",i),this.clustersUniformBuffer.setFloat("clusterTileZ",n),this.clustersUniformBuffer.setFloat("numLights",o),this.clustersUniformBuffer.setFloat("maxNumLightsPerCluster",l),this.clustersUniformBuffer.setFloat("near",c),this.clustersUniformBuffer.setFloat("far",f),this.clustersUniformBuffer.setFloat("screenWidth",e),this.clustersUniformBuffer.setFloat("screenHeight",t),this.clustersUniformBuffer.setFloat("clusterPix",a),this.clustersUniformBuffer.apply()}}class wt{static clusterTileX=16;static clusterTileY=16;static clusterTileZ=32}let d0=`
|
|
6122
6122
|
#include "GlobalUniform"
|
|
6123
6123
|
|
|
6124
6124
|
struct ClusterBox{
|
|
@@ -6329,7 +6329,7 @@ struct InstanceData {
|
|
|
6329
6329
|
idx.empty1 = f32(clustersUniform.maxNumLightsPerCluster);
|
|
6330
6330
|
assignTable[clusterId_1D] = idx;
|
|
6331
6331
|
}
|
|
6332
|
-
`;class u0 extends Ma{maxNumLightsPerCluster=64;clusterPix=1;clusterLightingBuffer;_currentLightCount=0;_clusterGenerateCompute;_clusterLightingCompute;_useCamera;resize=!1;constructor(e){super(),this.passType=le.Cluster,this.initCompute(e)}initCompute(e){this._clusterGenerateCompute=new ye(d0),this._clusterLightingCompute=new ye(h0);let t=w.presentationSize,a=wt.clusterTileX*wt.clusterTileY*wt.clusterTileZ,r=e.camera,i=r.near,n=r.far;this.clusterLightingBuffer=new f0(a,this.maxNumLightsPerCluster),this.clusterLightingBuffer.update(t[0],t[1],this.clusterPix,wt.clusterTileX,wt.clusterTileY,wt.clusterTileZ,0,this.maxNumLightsPerCluster,i,n),this._clusterGenerateCompute.setUniformBuffer("clustersUniform",this.clusterLightingBuffer.clustersUniformBuffer),this._clusterGenerateCompute.setStorageBuffer("clusterBuffer",this.clusterLightingBuffer.clusterBuffer);let o=ve.getLightEntries(e.scene);this._clusterLightingCompute.setStorageBuffer("models",ve.modelMatrixBindGroup.matrixBufferDst),this._clusterLightingCompute.setUniformBuffer("clustersUniform",this.clusterLightingBuffer.clustersUniformBuffer),this._clusterLightingCompute.setStorageBuffer("clusterBuffer",this.clusterLightingBuffer.clusterBuffer),this._clusterLightingCompute.setStorageBuffer("lightBuffer",o.storageGPUBuffer),this._clusterLightingCompute.setStorageBuffer("lightAssignBuffer",this.clusterLightingBuffer.lightAssignBuffer),this._clusterLightingCompute.setStorageBuffer("assignTable",this.clusterLightingBuffer.assignTableBuffer),this.resize=!0}render(e,t){let a=e.scene,r=K.instance.getLights(a);if(this._useCamera!=e.camera){this._useCamera=e.camera;let o=ve.getCameraGroup(this._useCamera);this._clusterGenerateCompute.setUniformBuffer("globalUniform",o.uniformGPUBuffer),this._clusterLightingCompute.setUniformBuffer("globalUniform",o.uniformGPUBuffer)}this._currentLightCount!=r.length&&(this._currentLightCount=r.length,this.clusterLightingBuffer.clustersUniformBuffer.setFloat("numLights",r.length),this.clusterLightingBuffer.clustersUniformBuffer.apply(),this._clusterGenerateCompute.workerSizeX=wt.clusterTileZ,this._clusterLightingCompute.workerSizeX=wt.clusterTileZ);let i=w.presentationSize;this.clusterLightingBuffer.update(i[0],i[1],this.clusterPix,wt.clusterTileX,wt.clusterTileY,wt.clusterTileZ,r.length,this.maxNumLightsPerCluster,e.camera.near,e.camera.far),this.resize=!1;let n=F.beginCommandEncoder();F.computeCommand(n,[this._clusterGenerateCompute,this._clusterLightingCompute]),F.endCommandEncoder(n)}}class we extends ft{resolveTarget;sampleCount;clone(){let e=new we(this.width,this.height,this.format,this.useMipmap,this.usage,this.numberLayer,this.sampleCount);return e.name="clone_"+e.name,e}constructor(e,t,a=se.rgba8unorm,r=!1,i,n=1,o=0,l=1){super(e,t,n),w.device,this.name=Gt(),this.useMipmap=r,this.sampleCount=o,this.format=a,this.numberLayer=n,this.mipmapCount=l,i!=null?this.usage=i:this.usage=i|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.COPY_DST,this.resize(e,t)}resize(e,t){let a=w.device;this.gpuTexture&&(ft.delayDestroyTexture(this.gpuTexture),this.gpuTexture=null,this.view=null),this.width=e,this.height=t,this.createTextureDescriptor(e,t,this.mipmapCount,this.format,this.usage,this.numberLayer,this.sampleCount),this.useMipmap=!1,this.visibility=GPUShaderStage.COMPUTE|GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,this.format==se.rgba32float?(this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="unfilterable-float",this.gpuSampler=a.createSampler({})):this.format==se.depth32float?(this.samplerBindingLayout.type="filtering",this.sampler_comparisonBindingLayout.type="comparison",this.textureBindingLayout.sampleType="depth",this.gpuSampler=w.device.createSampler({}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})):this.format==se.depth24plus?(this.samplerBindingLayout={type:"filtering"},this.sampler_comparisonBindingLayout={type:"comparison"},this.textureBindingLayout.sampleType="depth",this.gpuSampler=w.device.createSampler({}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})):(this.samplerBindingLayout.type="filtering",this.textureBindingLayout.sampleType="float",this.sampleCount>0&&(this.textureBindingLayout.multisampled=!0),this.minFilter="linear",this.magFilter="linear",this.mipmapFilter="nearest",this.maxAnisotropy=1,this.addressModeU=Ht.mirror_repeat,this.addressModeV=Ht.mirror_repeat,this.gpuSampler=a.createSampler(this)),this._textureChange=!0}create(e,t,a=!0){let r=w.device;const i=e*4;let n=new Float32Array(e*t*4);const o=r.createBuffer({size:n.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});r.queue.writeBuffer(o,0,n);const l=F.beginCommandEncoder();l.copyBufferToTexture({buffer:o,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(l)}readTextureToImage(){let e=w.device,t=w.windowWidth,a=w.windowHeight,r=new Float32Array(t*a*4);const i=e.createBuffer({size:r.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});return F.beginCommandEncoder().copyTextureToBuffer({texture:this.getGPUTexture()},{buffer:i},[t,a]),i.getMappedRange(0,r.byteLength)}}class b0 extends d.Object3D{up_camera;down_camera;left_camera;right_camera;front_camera;back_camera;set label(e){this.up_camera.name=e+"up",this.down_camera.name=e+"down",this.left_camera.name=e+"left",this.right_camera.name=e+"right",this.front_camera.name=e+"front",this.back_camera.name=e+"back"}constructor(e=.001,t=1e4,a=90,r=!1){super(),this.initCubeCamera(e,t,a,r)}initCubeCamera(e,t,a=90,r=!1){this.up_camera=dt.createCamera3DObject(this,"up"),this.down_camera=dt.createCamera3DObject(this,"down"),this.left_camera=dt.createCamera3DObject(this,"left"),this.right_camera=dt.createCamera3DObject(this,"right"),this.front_camera=dt.createCamera3DObject(this,"front"),this.back_camera=dt.createCamera3DObject(this,"back"),this.up_camera.isShadowCamera=r,this.down_camera.isShadowCamera=r,this.left_camera.isShadowCamera=r,this.right_camera.isShadowCamera=r,this.front_camera.isShadowCamera=r,this.back_camera.isShadowCamera=r;let i=1;this.up_camera.perspective(a,i,e,t),this.up_camera.lookAt(b.ZERO,b.UP,b.DOWN),this.up_camera.object3D.scaleX=-1,this.up_camera.object3D.rotationY=180,this.down_camera.perspective(a,i,e,t),this.down_camera.lookAt(b.ZERO,b.DOWN,b.DOWN),this.down_camera.object3D.scaleX=-1,this.down_camera.object3D.rotationY=180,this.left_camera.perspective(a,i,e,t),this.left_camera.lookAt(b.ZERO,b.LEFT),this.left_camera.object3D.scaleX=-1,this.right_camera.perspective(a,i,e,t),this.right_camera.lookAt(b.ZERO,b.RIGHT),this.right_camera.object3D.scaleX=-1,this.front_camera.perspective(a,i,e,t),this.front_camera.lookAt(b.ZERO,b.FORWARD),this.front_camera.object3D.scaleX=-1,this.back_camera.perspective(a,i,e,t),this.back_camera.lookAt(b.ZERO,b.BACK),this.back_camera.object3D.scaleX=-1,this.up_camera.type=at.shadow,this.down_camera.type=at.shadow,this.left_camera.type=at.shadow,this.right_camera.type=at.shadow,this.front_camera.type=at.shadow,this.back_camera.type=at.shadow}}class g0 extends ft{constructor(e,t,a){super(e,t,a),this.format=se.depth32float,this.mipmapCount=1,this.init()}internalCreateBindingLayoutDesc(){this.textureBindingLayout.sampleType="depth",this.textureBindingLayout.viewDimension="cube-array",this.samplerBindingLayout.type="filtering",this.sampler_comparisonBindingLayout.type="comparison"}internalCreateTexture(){this.textureDescriptor={format:this.format,size:{width:this.width,height:this.height,depthOrArrayLayers:6*this.numberLayer},dimension:"2d",usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.TEXTURE_BINDING},this.gpuTexture=this.getGPUTexture()}internalCreateView(){this.viewDescriptor={dimension:"cube-array"},this.view=this.getGPUView()}internalCreateSampler(){this.gpuSampler=w.device.createSampler({minFilter:cr.linear,magFilter:cr.linear}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})}}class m0 extends Ma{shadowPassCount;_forceUpdate=!1;_shadowCameraDic;shadowCamera;cubeArrayTexture;colorTexture;shadowSize=1024;constructor(){super(),this.passType=le.POINT_SHADOW,this._shadowCameraDic=new Map,this.cubeArrayTexture=new g0(this.shadowSize,this.shadowSize,8),this.colorTexture=new we(this.shadowSize,this.shadowSize,se.bgra8unorm,!1),Ce.getInstance().attached(this.cubeArrayTexture,this)}getShadowCamera(e,t){let a;if(this._shadowCameraDic.has(t))a=this._shadowCameraDic.get(t);else{let r=new b0(e.camera.near,e.camera.far,90,!0);r.label=t.name;let i=[],n=[];for(let o=0;o<6;o++){let l=new we(this.shadowSize,this.shadowSize,this.cubeArrayTexture.format,!1),c=new rt([this.colorTexture],[new Ge]);l.name="shadowDepthTexture_"+t.name+o+"_face",i[o]=l,c.depthTexture=l,c.label="shadowRender",c.customSize=!0,n[o]=this.getRenderContext(c)}a={cubeCamera:r,depthTexture:i,renderContext:n},this._shadowCameraDic.set(t,a)}return a}render(e,t){if(!_.setting.shadow.enable)return;this.shadowPassCount=0,e.camera;let a=e.scene,r=Wt.getPointShadowLightWhichScene(a),i=r.length;for(let n=0;n<i;n++){let o=r[n];if(o.lightData.lightType!=ct.DirectionLight&&o.lightData.castShadowIndex>-1&&(o.needUpdateShadow||this._forceUpdate||Le.frame<5||o.realTimeShadow)){o.needUpdateShadow=!1;let l=this.getShadowCamera(e,o),c=o.transform.worldPosition;l.cubeCamera.x=c.x,l.cubeCamera.y=c.y,l.cubeCamera.z=c.z;let f;l.cubeCamera.transform.updateWorldMatrix(!0),t.update(l.cubeCamera.right_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.right_camera),this.renderSceneOnce(0,l,e,l.cubeCamera.right_camera,f,t),t.update(l.cubeCamera.left_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.left_camera),this.renderSceneOnce(1,l,e,l.cubeCamera.left_camera,f,t),t.update(l.cubeCamera.up_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.up_camera),this.renderSceneOnce(2,l,e,l.cubeCamera.up_camera,f,t),t.update(l.cubeCamera.down_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.down_camera),this.renderSceneOnce(3,l,e,l.cubeCamera.down_camera,f,t),t.update(l.cubeCamera.front_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.front_camera),this.renderSceneOnce(4,l,e,l.cubeCamera.front_camera,f,t),t.update(l.cubeCamera.back_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.back_camera),this.renderSceneOnce(5,l,e,l.cubeCamera.back_camera,f,t);let h=F.beginCommandEncoder();for(let u=0;u<6;u++)h.copyTextureToTexture({texture:l.depthTexture[u].getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{texture:this.cubeArrayTexture.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:o.shadowIndex*6+u}},{width:this.shadowSize,height:this.shadowSize,depthOrArrayLayers:1});F.endCommandEncoder(h)}}this._forceUpdate=!1}renderSceneOnce(e,t,a,r,i,n){let o=t.renderContext[e];o.clean(),o.beginOpaqueRenderPass(),o.encoder.setViewport(0,0,this.shadowSize,this.shadowSize,0,1),o.encoder.setScissorRect(0,0,this.shadowSize,this.shadowSize),r.onUpdate(),r.transform.updateWorldMatrix(!0);for(const l of i.opaqueList){let c=l;if(!c.isDestroyed&&c.preInit(this._rendererType)){c.nodeUpdate(a,this._rendererType,o.rendererPassState,null);break}}this.drawShadowRenderNodes(a,r,o,i.opaqueList,n),this.drawShadowRenderNodes(a,r,o,i.transparentList,n),o.endRenderPass()}drawShadowRenderNodes(e,t,a,r,i){ve.updateCameraGroup(t),F.bindCamera(a.encoder,t),this.drawNodes(e,t,a,r,i,null)}drawNodes(e,t,a,r,i,n){let o=K.instance.getRenderShaderCollect(e);if(o){for(const l of o){let c=l[1];for(const f of c){let h=f[1];if(!h.isDestroyed&&h.preInit(this._rendererType)){h.nodeUpdate(e,this._rendererType,a.rendererPassState,n);break}}}for(let l=_.setting.render.drawOpMin;l<Math.min(r.length,_.setting.render.drawOpMax);++l){let c=r[l];if(c.transform.enable&&c.enable&&c.castShadow&&!c.isDestroyed){c.preInit(this._rendererType)||c.nodeUpdate(e,this._rendererType,a.rendererPassState,n);for(let f of c.materials){let h=f.getPass(this._rendererType);if(!(!h||h.length==0))for(let u of h){const g=u;g.pipeline&&(g.setUniformFloat("cameraFar",t.far),g.setUniformVector3("lightWorldPos",t.transform.worldPosition),g.materialDataUniformBuffer.apply())}}c.renderPass(e,this.passType,a)}}}}}class p0 extends ft{constructor(e,t,a=se.depth32float,r=4){super(e,t,r),this.format=a,this.mipmapCount=1,this.init()}internalCreateBindingLayoutDesc(){this.textureBindingLayout.sampleType="depth",this.textureBindingLayout.viewDimension="2d-array",this.samplerBindingLayout.type="filtering",this.sampler_comparisonBindingLayout.type="comparison"}internalCreateTexture(){this.textureDescriptor={format:this.format,size:{width:this.width,height:this.height,depthOrArrayLayers:this.numberLayer},dimension:"2d",usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.TEXTURE_BINDING},this.gpuTexture=this.getGPUTexture()}internalCreateView(){this.viewDescriptor={dimension:"2d-array"},this.view=this.getGPUView()}internalCreateSampler(){this.gpuSampler=w.device.createSampler({}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})}}class A0 extends Ma{shadowPassCount;depth2DArrayTexture;rendererPassStates;_forceUpdate=!1;constructor(){super(),this.setShadowMap(_.setting.shadow.shadowSize,ra.Cascades),this.passType=le.SHADOW}setShadowMap(e,t){this.rendererPassStates=[],this.depth2DArrayTexture=new p0(e,e,se.depth32float,8),Ce.getInstance().attached(this.depth2DArrayTexture,this);for(let a=0;a<8;a++){let r=new rt([],[]);const i=new we(e,e,se.depth32float,!1);i.name=`shadowDepthTexture_${a}`,r.depthTexture=i,r.label="shadowRender",r.customSize=!0,r.depthCleanValue=1;let n=Je.createRendererPassState(r);this.rendererPassStates[a]=n}}render(e,t){let a=_.setting.shadow;if(!a.enable)return;let r=e.camera,i=e.scene;if(this.shadowPassCount=0,!a.needUpdate||Le.frame%a.updateFrameRate!=0)return;let n=Wt.getDirectShadowLightWhichScene(i),o=a.shadowSize;const l=ra.Cascades;for(let c of n){const f=c;let h=f.shadowIndex;this.rendererPassState=this.rendererPassStates[h],o=this.rendererPassState.depthTexture.width;let u=K.instance.getRenderShaderCollect(e);for(const g of u){let A=g[1];for(const m of A){let p=m[1];if(!p.isDestroyed&&p.preInit(this._rendererType)){p.nodeUpdate(e,this._rendererType,this.rendererPassState,null);break}}}if(f.castShadow&&f.needUpdateShadow||this._forceUpdate||f.castShadow&&a.autoUpdate)if(f.needUpdateShadow=!1,r.enableCSM&&h==0)for(let g=0;g<l;g++){this.rendererPassState=this.rendererPassStates[g];let A=r.csm.children[g],m=r.getCSMShadowWorldExtents(g);this.poseShadowCamera(r,f.direction,A.shadowCamera,m,A.bound.center),this.renderShadow(e,A.shadowCamera,t,this.rendererPassState),this.copyDepthTexture(this.rendererPassState.depthTexture,this.depth2DArrayTexture,g,o)}else{r.enableCSM&&(h+=l-1);let g=r.getShadowWorldExtents();this.rendererPassState=this.rendererPassStates[h],this.poseShadowCamera(r,f.direction,f.shadowCamera,g,r.lookTarget),this.renderShadow(e,f.shadowCamera,t,this.rendererPassState),this.copyDepthTexture(this.rendererPassState.depthTexture,this.depth2DArrayTexture,h,o)}}this._forceUpdate=!1}copyDepthTexture(e,t,a,r){let i=F.beginCommandEncoder();i.copyTextureToTexture({texture:e.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{texture:t.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:a}},{width:r,height:r,depthOrArrayLayers:1}),F.endCommandEncoder(i)}_shadowPos=new b;_shadowCameraTarget=new b;poseShadowCamera(e,t,a,r,i){this._shadowPos.copy(t).normalize(e.far),i.add(this._shadowPos,this._shadowCameraTarget),i.subtract(this._shadowPos,this._shadowPos),a.transform.lookAt(this._shadowPos,this._shadowCameraTarget),a.orthoOffCenter(-r,r,-r,r,e.near,e.far*2)}compute(){}renderShadow(e,t,a,r){let i=K.instance.getRenderNodes(e.scene,t),n=F.beginCommandEncoder(),o=F.beginRenderPass(n,r);t.transform.updateWorldMatrix(),xs.enable&&(a.update(t,e.scene),a.collect(i,t)),ve.updateCameraGroup(t),F.bindCamera(o,t);let l=this.renderShadowBundleOp(e,t,r),c=this.renderShadowBundleTr(e,t,r);l.length>0&&o.executeBundles(l),this.drawShadowRenderNodes(e,t,o,i.opaqueList),c.length>0&&o.executeBundles(c),this.drawShadowRenderNodes(e,t,o,i.transparentList),F.endPass(o),F.endCommandEncoder(n)}renderShadowBundleOp(e,t,a){let r=K.instance.getOpRenderGroup(e.scene);if(r){let i=[];return r.renderGroup.forEach(n=>{if(n.bundleMap.has(this._rendererType))i.push(n.bundleMap.get(this._rendererType));else{let o=F.recordBundleEncoder(a.renderBundleEncoderDescriptor);this.recordShadowRenderBundleNode(e,t,o,n.renderNodes);let l=o.finish();n.bundleMap.set(this._rendererType,l),i.push(l)}}),i}return[]}renderShadowBundleTr(e,t,a){let r=K.instance.getTrRenderGroup(e.scene);if(r){let i=[];return r.renderGroup.forEach(n=>{if(n.bundleMap.has(this._rendererType))i.push(n.bundleMap.get(this._rendererType));else{let o=F.recordBundleEncoder(a.renderBundleEncoderDescriptor);this.recordShadowRenderBundleNode(e,t,o,n.renderNodes);let l=o.finish();n.bundleMap.set(this._rendererType,l),i.push(l)}}),i}return[]}recordShadowRenderBundleNode(e,t,a,r,i){if(ve.updateCameraGroup(t),F.bindCamera(a,t),r){F.bindGeometryBuffer(a,r[0].geometry);for(let n=0;n<r.length;++n){let o=r[n];o.transform.enable&&o.recordRenderPass2(e,this._rendererType,this.rendererPassState,i,a)}}}drawShadowRenderNodes(e,t,a,r,i){if(ve.updateCameraGroup(t),F.bindCamera(a,t),r)for(let n=_.setting.render.drawOpMin;n<Math.min(r.length,_.setting.render.drawOpMax);++n){let o=r[n];o.transform.enable&&o.enable&&o.castShadow&&(o.isDestroyed||(o.preInit(this._rendererType)||o.nodeUpdate(e,this._rendererType,this.rendererPassState,i),o.renderPass2(e,this._rendererType,this.rendererPassState,i,a)))}}}class D0 extends Ma{zBufferTexture;useRenderBundle=!1;shadowPassCount;zCullingCompute;constructor(){super(),this.passType=le.DEPTH;let e=w.presentationSize,t=1;this.zBufferTexture=Et.createRTTexture(Ta.zBufferTexture_NAME,Math.floor(e[0]*t),Math.floor(e[1]*t),se.rgba16float,!1);let a=new Ge;a.clearValue=[0,0,0,0],a.loadOp="clear";let r=new rt([],[],Et.createRTTexture(Ta.zPreDepthTexture_NAME,Math.floor(e[0]),Math.floor(e[1]),se.depth32float,!1),null,!1);this.setRenderStates(r)}render(e,t){let a=e.camera,r=e.scene;F.cleanCache(),lt.start("DepthPass Renderer");let i=r;this.rendererPassState.camera3D=a;let n=K.instance.getRenderNodes(i,a);this.compute(e,t);let o=this.renderBundleOp(e,n,t),l=[],c=F.beginCommandEncoder(),f=F.beginRenderPass(c,this.rendererPassState);o.length>0&&f.executeBundles(o);let h=K.instance.getRenderShaderCollect(e);for(const u of h){let g=u[1];for(const A of g){let m=A[1];if(!m.isDestroyed&&m.preInit(this._rendererType)){m.nodeUpdate(e,this._rendererType,this.rendererPassState,null);break}}}this.drawRenderNodes(e,f,c,n.opaqueList,t),l.length>0&&f.executeBundles(l),F.endPass(f),F.endCommandEncoder(c),lt.end("DepthPass Renderer")}drawRenderNodes(e,t,a,r,i,n){F.bindCamera(t,e.camera);for(let o=_.setting.render.drawOpMin;o<Math.min(r.length,_.setting.render.drawOpMax);++o){let l=r[o];l.transform.enable&&l.enable&&(l.isDestroyed||(l.preInit(this._rendererType)||l.nodeUpdate(e,this._rendererType,this.rendererPassState),l.renderPass2(e,this._rendererType,this.rendererPassState,n,t)))}}}class _0{map;passRendererList;constructor(){this.map=new Map,this.passRendererList=[]}addRenderer(e){this.map.has(e.passType)?console.error("same renderer pass repeat!"):(this.map.set(e.passType,e),e.passType<=8&&this.addPassRenderer(e))}getRenderer(e){return this.map.get(e)}addPassRenderer(e){this.passRendererList.push(e)}getAllRenderer(){return this.map}getAllPassRenderer(){return this.passRendererList}}class B0 extends Ma{finalQuadView;postList;constructor(){super(),this._rendererType=le.POST,this.postList=new Map,this.initRenderer()}initRenderer(){Y.register("FullQuad_vert_wgsl",Rl),this.finalQuadView=new Cs("Quad_vert_wgsl","Quad_frag_wgsl",new rt([],[]),0,!1)}attachPost(e,t){t.postRenderer=this;let a=t.constructor.name;this.postList.get(a)||(this.postList.set(a,t),t.onAttach(e))}detachPost(e,t){let a=t.constructor.name,r=this.postList.get(a);return r&&(this.postList.delete(a),t.onDetach(e),t.postRenderer=null),r!=null}render(e){this.postList.forEach(a=>{a.enable&&a.compute(e)});let t=F.beginCommandEncoder();this.postList.forEach(a=>{a.enable&&a.render(e,t)}),F.endCommandEncoder(t)}presentContent(e,t){let a=F.beginCommandEncoder();this.finalQuadView.renderToViewQuad(e,this.finalQuadView,a,t),F.endCommandEncoder(a)}}class Jt{enable=!0;postRenderer;rtViewQuad;virtualTexture;constructor(){this.rtViewQuad=new Map,this.virtualTexture=new Map,w.addEventListener(nr.RESIZE,this.onResize,this)}createRTTexture(e,t,a,r,i=!1,n=0){let o=Et.createRTTexture(e,t,a,r,i,n);return o.name=e,this.virtualTexture.set(e,o),Ce.getInstance().attached(o,this),o}createViewQuad(e,t,a,r=0){let i=Et.createViewQuad(e,"Quad_vert_wgsl",t,a,r);return this.rtViewQuad.set(e,i),i}getOutTexture(){let e,t=F.lastRenderPassState.renderTargets;return t.length>0?e=t[0]:e=Et.getTexture(Ta.colorBufferTex_NAME),e}autoSetColorTexture(e,t){let a=this.getOutTexture();t.setSamplerTexture(e,a)}compute(e){}onAttach(e){}onDetach(e){}onResize(){}render(e,t){this.compute(e),this.rtViewQuad.forEach((a,r)=>{let i=F.lastRenderPassState.getLastRenderTexture();a.renderToViewQuad(e,a,t,i)})}destroy(e){this.postRenderer=null;for(let t=0;t<this.rtViewQuad.size;t++)this.rtViewQuad.values[t].destroy(e);this.rtViewQuad.clear(),this.rtViewQuad=null;for(let t=0;t<this.virtualTexture.size;t++){const a=this.virtualTexture.values[t];Ce.getInstance().detached(a,this),a.destroy(e)}}}class Fs extends d.Object3D{up_camera;down_camera;left_camera;right_camera;front_camera;back_camera;_near;_far;constructor(e=.001,t=1e4,a=90,r=!1){super(),this.initCubeCamera(e,t,a,r)}initCubeCamera(e,t,a=90,r=!1){this.up_camera=dt.createCamera3DObject(this,"up"),this.down_camera=dt.createCamera3DObject(this,"down"),this.left_camera=dt.createCamera3DObject(this,"left"),this.right_camera=dt.createCamera3DObject(this,"right"),this.front_camera=dt.createCamera3DObject(this,"front"),this.back_camera=dt.createCamera3DObject(this,"back"),this.up_camera.isShadowCamera=r,this.down_camera.isShadowCamera=r,this.left_camera.isShadowCamera=r,this.right_camera.isShadowCamera=r,this.front_camera.isShadowCamera=r,this.back_camera.isShadowCamera=r;let i=1;this.up_camera.perspective(a,i,e,t),this.up_camera.lookAt(b.ZERO,b.UP,b.DOWN),this.down_camera.perspective(a,i,e,t),this.down_camera.lookAt(b.ZERO,b.DOWN,b.DOWN),this.left_camera.perspective(a,i,e,t),this.left_camera.lookAt(b.ZERO,b.LEFT),this.right_camera.perspective(a,i,e,t),this.right_camera.lookAt(b.ZERO,b.RIGHT),this.front_camera.perspective(a,i,e,t),this.front_camera.lookAt(b.ZERO,b.FORWARD),this.back_camera.perspective(a,i,e,t),this.back_camera.lookAt(b.ZERO,b.BACK),this.up_camera.type=at.shadow,this.down_camera.type=at.shadow,this.left_camera.type=at.shadow,this.right_camera.type=at.shadow,this.front_camera.type=at.shadow,this.back_camera.type=at.shadow}set near(e){this._near=e,this.up_camera.near=e,this.down_camera.near=e,this.left_camera.near=e,this.right_camera.near=e,this.front_camera.near=e,this.back_camera.near=e}get near(){return this._near}set far(e){this._far=e,this.up_camera.far=e,this.down_camera.far=e,this.left_camera.far=e,this.right_camera.far=e,this.front_camera.far=e,this.back_camera.far=e}get far(){return this._far}}let v0=`
|
|
6332
|
+
`;class u0 extends Ta{maxNumLightsPerCluster=64;clusterPix=1;clusterLightingBuffer;_currentLightCount=0;_clusterGenerateCompute;_clusterLightingCompute;_useCamera;resize=!1;constructor(e){super(),this.passType=le.Cluster,this.initCompute(e)}initCompute(e){this._clusterGenerateCompute=new ye(d0),this._clusterLightingCompute=new ye(h0);let t=w.presentationSize,a=wt.clusterTileX*wt.clusterTileY*wt.clusterTileZ,r=e.camera,i=r.near,n=r.far;this.clusterLightingBuffer=new f0(a,this.maxNumLightsPerCluster),this.clusterLightingBuffer.update(t[0],t[1],this.clusterPix,wt.clusterTileX,wt.clusterTileY,wt.clusterTileZ,0,this.maxNumLightsPerCluster,i,n),this._clusterGenerateCompute.setUniformBuffer("clustersUniform",this.clusterLightingBuffer.clustersUniformBuffer),this._clusterGenerateCompute.setStorageBuffer("clusterBuffer",this.clusterLightingBuffer.clusterBuffer);let o=ve.getLightEntries(e.scene);this._clusterLightingCompute.setStorageBuffer("models",ve.modelMatrixBindGroup.matrixBufferDst),this._clusterLightingCompute.setUniformBuffer("clustersUniform",this.clusterLightingBuffer.clustersUniformBuffer),this._clusterLightingCompute.setStorageBuffer("clusterBuffer",this.clusterLightingBuffer.clusterBuffer),this._clusterLightingCompute.setStorageBuffer("lightBuffer",o.storageGPUBuffer),this._clusterLightingCompute.setStorageBuffer("lightAssignBuffer",this.clusterLightingBuffer.lightAssignBuffer),this._clusterLightingCompute.setStorageBuffer("assignTable",this.clusterLightingBuffer.assignTableBuffer),this.resize=!0}render(e,t){let a=e.scene,r=K.instance.getLights(a);if(this._useCamera!=e.camera){this._useCamera=e.camera;let o=ve.getCameraGroup(this._useCamera);this._clusterGenerateCompute.setUniformBuffer("globalUniform",o.uniformGPUBuffer),this._clusterLightingCompute.setUniformBuffer("globalUniform",o.uniformGPUBuffer)}this._currentLightCount!=r.length&&(this._currentLightCount=r.length,this.clusterLightingBuffer.clustersUniformBuffer.setFloat("numLights",r.length),this.clusterLightingBuffer.clustersUniformBuffer.apply(),this._clusterGenerateCompute.workerSizeX=wt.clusterTileZ,this._clusterLightingCompute.workerSizeX=wt.clusterTileZ);let i=w.presentationSize;this.clusterLightingBuffer.update(i[0],i[1],this.clusterPix,wt.clusterTileX,wt.clusterTileY,wt.clusterTileZ,r.length,this.maxNumLightsPerCluster,e.camera.near,e.camera.far),this.resize=!1;let n=F.beginCommandEncoder();F.computeCommand(n,[this._clusterGenerateCompute,this._clusterLightingCompute]),F.endCommandEncoder(n)}}class we extends ft{resolveTarget;sampleCount;clone(){let e=new we(this.width,this.height,this.format,this.useMipmap,this.usage,this.numberLayer,this.sampleCount);return e.name="clone_"+e.name,e}constructor(e,t,a=se.rgba8unorm,r=!1,i,n=1,o=0,l=1){super(e,t,n),w.device,this.name=Gt(),this.useMipmap=r,this.sampleCount=o,this.format=a,this.numberLayer=n,this.mipmapCount=l,i!=null?this.usage=i:this.usage=i|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.COPY_DST,this.resize(e,t)}resize(e,t){let a=w.device;this.gpuTexture&&(ft.delayDestroyTexture(this.gpuTexture),this.gpuTexture=null,this.view=null),this.width=e,this.height=t,this.createTextureDescriptor(e,t,this.mipmapCount,this.format,this.usage,this.numberLayer,this.sampleCount),this.useMipmap=!1,this.visibility=GPUShaderStage.COMPUTE|GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,this.format==se.rgba32float?(this.samplerBindingLayout.type="non-filtering",this.textureBindingLayout.sampleType="unfilterable-float",this.gpuSampler=a.createSampler({})):this.format==se.depth32float?(this.samplerBindingLayout.type="filtering",this.sampler_comparisonBindingLayout.type="comparison",this.textureBindingLayout.sampleType="depth",this.gpuSampler=w.device.createSampler({}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})):this.format==se.depth24plus?(this.samplerBindingLayout={type:"filtering"},this.sampler_comparisonBindingLayout={type:"comparison"},this.textureBindingLayout.sampleType="depth",this.gpuSampler=w.device.createSampler({}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})):(this.samplerBindingLayout.type="filtering",this.textureBindingLayout.sampleType="float",this.sampleCount>0&&(this.textureBindingLayout.multisampled=!0),this.minFilter="linear",this.magFilter="linear",this.mipmapFilter="nearest",this.maxAnisotropy=1,this.addressModeU=Ht.mirror_repeat,this.addressModeV=Ht.mirror_repeat,this.gpuSampler=a.createSampler(this)),this._textureChange=!0}create(e,t,a=!0){let r=w.device;const i=e*4;let n=new Float32Array(e*t*4);const o=r.createBuffer({size:n.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});r.queue.writeBuffer(o,0,n);const l=F.beginCommandEncoder();l.copyBufferToTexture({buffer:o,bytesPerRow:i},{texture:this.getGPUTexture()},{width:e,height:t,depthOrArrayLayers:1}),F.endCommandEncoder(l)}readTextureToImage(){let e=w.device,t=w.windowWidth,a=w.windowHeight,r=new Float32Array(t*a*4);const i=e.createBuffer({size:r.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});return F.beginCommandEncoder().copyTextureToBuffer({texture:this.getGPUTexture()},{buffer:i},[t,a]),i.getMappedRange(0,r.byteLength)}}class b0 extends d.Object3D{up_camera;down_camera;left_camera;right_camera;front_camera;back_camera;set label(e){this.up_camera.name=e+"up",this.down_camera.name=e+"down",this.left_camera.name=e+"left",this.right_camera.name=e+"right",this.front_camera.name=e+"front",this.back_camera.name=e+"back"}constructor(e=.001,t=1e4,a=90,r=!1){super(),this.initCubeCamera(e,t,a,r)}initCubeCamera(e,t,a=90,r=!1){this.up_camera=dt.createCamera3DObject(this,"up"),this.down_camera=dt.createCamera3DObject(this,"down"),this.left_camera=dt.createCamera3DObject(this,"left"),this.right_camera=dt.createCamera3DObject(this,"right"),this.front_camera=dt.createCamera3DObject(this,"front"),this.back_camera=dt.createCamera3DObject(this,"back"),this.up_camera.isShadowCamera=r,this.down_camera.isShadowCamera=r,this.left_camera.isShadowCamera=r,this.right_camera.isShadowCamera=r,this.front_camera.isShadowCamera=r,this.back_camera.isShadowCamera=r;let i=1;this.up_camera.perspective(a,i,e,t),this.up_camera.lookAt(b.ZERO,b.UP,b.DOWN),this.up_camera.object3D.scaleX=-1,this.up_camera.object3D.rotationY=180,this.down_camera.perspective(a,i,e,t),this.down_camera.lookAt(b.ZERO,b.DOWN,b.DOWN),this.down_camera.object3D.scaleX=-1,this.down_camera.object3D.rotationY=180,this.left_camera.perspective(a,i,e,t),this.left_camera.lookAt(b.ZERO,b.LEFT),this.left_camera.object3D.scaleX=-1,this.right_camera.perspective(a,i,e,t),this.right_camera.lookAt(b.ZERO,b.RIGHT),this.right_camera.object3D.scaleX=-1,this.front_camera.perspective(a,i,e,t),this.front_camera.lookAt(b.ZERO,b.FORWARD),this.front_camera.object3D.scaleX=-1,this.back_camera.perspective(a,i,e,t),this.back_camera.lookAt(b.ZERO,b.BACK),this.back_camera.object3D.scaleX=-1,this.up_camera.type=at.shadow,this.down_camera.type=at.shadow,this.left_camera.type=at.shadow,this.right_camera.type=at.shadow,this.front_camera.type=at.shadow,this.back_camera.type=at.shadow}}class g0 extends ft{constructor(e,t,a){super(e,t,a),this.format=se.depth32float,this.mipmapCount=1,this.init()}internalCreateBindingLayoutDesc(){this.textureBindingLayout.sampleType="depth",this.textureBindingLayout.viewDimension="cube-array",this.samplerBindingLayout.type="filtering",this.sampler_comparisonBindingLayout.type="comparison"}internalCreateTexture(){this.textureDescriptor={format:this.format,size:{width:this.width,height:this.height,depthOrArrayLayers:6*this.numberLayer},dimension:"2d",usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.TEXTURE_BINDING},this.gpuTexture=this.getGPUTexture()}internalCreateView(){this.viewDescriptor={dimension:"cube-array"},this.view=this.getGPUView()}internalCreateSampler(){this.gpuSampler=w.device.createSampler({minFilter:lr.linear,magFilter:lr.linear}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})}}class m0 extends Ta{shadowPassCount;_forceUpdate=!1;_shadowCameraDic;shadowCamera;cubeArrayTexture;colorTexture;shadowSize=1024;constructor(){super(),this.passType=le.POINT_SHADOW,this._shadowCameraDic=new Map,this.cubeArrayTexture=new g0(this.shadowSize,this.shadowSize,8),this.colorTexture=new we(this.shadowSize,this.shadowSize,se.bgra8unorm,!1),Ce.getInstance().attached(this.cubeArrayTexture,this)}getShadowCamera(e,t){let a;if(this._shadowCameraDic.has(t))a=this._shadowCameraDic.get(t);else{let r=new b0(e.camera.near,e.camera.far,90,!0);r.label=t.name;let i=[],n=[];for(let o=0;o<6;o++){let l=new we(this.shadowSize,this.shadowSize,this.cubeArrayTexture.format,!1),c=new rt([this.colorTexture],[new Ge]);l.name="shadowDepthTexture_"+t.name+o+"_face",i[o]=l,c.depthTexture=l,c.label="shadowRender",c.customSize=!0,n[o]=this.getRenderContext(c)}a={cubeCamera:r,depthTexture:i,renderContext:n},this._shadowCameraDic.set(t,a)}return a}render(e,t){if(!_.setting.shadow.enable)return;this.shadowPassCount=0,e.camera;let a=e.scene,r=Wt.getPointShadowLightWhichScene(a),i=r.length;for(let n=0;n<i;n++){let o=r[n];if(o.lightData.lightType!=ct.DirectionLight&&o.lightData.castShadowIndex>-1&&(o.needUpdateShadow||this._forceUpdate||Le.frame<5||o.realTimeShadow)){o.needUpdateShadow=!1;let l=this.getShadowCamera(e,o),c=o.transform.worldPosition;l.cubeCamera.x=c.x,l.cubeCamera.y=c.y,l.cubeCamera.z=c.z;let f;l.cubeCamera.transform.updateWorldMatrix(!0),t.update(l.cubeCamera.right_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.right_camera),this.renderSceneOnce(0,l,e,l.cubeCamera.right_camera,f,t),t.update(l.cubeCamera.left_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.left_camera),this.renderSceneOnce(1,l,e,l.cubeCamera.left_camera,f,t),t.update(l.cubeCamera.up_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.up_camera),this.renderSceneOnce(2,l,e,l.cubeCamera.up_camera,f,t),t.update(l.cubeCamera.down_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.down_camera),this.renderSceneOnce(3,l,e,l.cubeCamera.down_camera,f,t),t.update(l.cubeCamera.front_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.front_camera),this.renderSceneOnce(4,l,e,l.cubeCamera.front_camera,f,t),t.update(l.cubeCamera.back_camera,a),f=K.instance.getRenderNodes(a,l.cubeCamera.back_camera),this.renderSceneOnce(5,l,e,l.cubeCamera.back_camera,f,t);let h=F.beginCommandEncoder();for(let u=0;u<6;u++)h.copyTextureToTexture({texture:l.depthTexture[u].getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{texture:this.cubeArrayTexture.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:o.shadowIndex*6+u}},{width:this.shadowSize,height:this.shadowSize,depthOrArrayLayers:1});F.endCommandEncoder(h)}}this._forceUpdate=!1}renderSceneOnce(e,t,a,r,i,n){let o=t.renderContext[e];o.clean(),o.beginOpaqueRenderPass(),o.encoder.setViewport(0,0,this.shadowSize,this.shadowSize,0,1),o.encoder.setScissorRect(0,0,this.shadowSize,this.shadowSize),r.onUpdate(),r.transform.updateWorldMatrix(!0);for(const l of i.opaqueList){let c=l;if(!c.isDestroyed&&c.preInit(this._rendererType)){c.nodeUpdate(a,this._rendererType,o.rendererPassState,null);break}}this.drawShadowRenderNodes(a,r,o,i.opaqueList,n),this.drawShadowRenderNodes(a,r,o,i.transparentList,n),o.endRenderPass()}drawShadowRenderNodes(e,t,a,r,i){ve.updateCameraGroup(t),F.bindCamera(a.encoder,t),this.drawNodes(e,t,a,r,i,null)}drawNodes(e,t,a,r,i,n){let o=K.instance.getRenderShaderCollect(e);if(o){for(const l of o){let c=l[1];for(const f of c){let h=f[1];if(!h.isDestroyed&&h.preInit(this._rendererType)){h.nodeUpdate(e,this._rendererType,a.rendererPassState,n);break}}}for(let l=_.setting.render.drawOpMin;l<Math.min(r.length,_.setting.render.drawOpMax);++l){let c=r[l];if(c.transform.enable&&c.enable&&c.castShadow&&!c.isDestroyed){c.preInit(this._rendererType)||c.nodeUpdate(e,this._rendererType,a.rendererPassState,n);for(let f of c.materials){let h=f.getPass(this._rendererType);if(!(!h||h.length==0))for(let u of h){const g=u;g.pipeline&&(g.setUniformFloat("cameraFar",t.far),g.setUniformVector3("lightWorldPos",t.transform.worldPosition),g.materialDataUniformBuffer.apply())}}c.renderPass(e,this.passType,a)}}}}}class p0 extends ft{constructor(e,t,a=se.depth32float,r=4){super(e,t,r),this.format=a,this.mipmapCount=1,this.init()}internalCreateBindingLayoutDesc(){this.textureBindingLayout.sampleType="depth",this.textureBindingLayout.viewDimension="2d-array",this.samplerBindingLayout.type="filtering",this.sampler_comparisonBindingLayout.type="comparison"}internalCreateTexture(){this.textureDescriptor={format:this.format,size:{width:this.width,height:this.height,depthOrArrayLayers:this.numberLayer},dimension:"2d",usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.TEXTURE_BINDING},this.gpuTexture=this.getGPUTexture()}internalCreateView(){this.viewDescriptor={dimension:"2d-array"},this.view=this.getGPUView()}internalCreateSampler(){this.gpuSampler=w.device.createSampler({}),this.gpuSampler_comparison=w.device.createSampler({compare:"less",label:"sampler_comparison"})}}class A0 extends Ta{shadowPassCount;depth2DArrayTexture;rendererPassStates;_forceUpdate=!1;constructor(){super(),this.setShadowMap(_.setting.shadow.shadowSize,ra.Cascades),this.passType=le.SHADOW}setShadowMap(e,t){this.rendererPassStates=[],this.depth2DArrayTexture=new p0(e,e,se.depth32float,8),Ce.getInstance().attached(this.depth2DArrayTexture,this);for(let a=0;a<8;a++){let r=new rt([],[]);const i=new we(e,e,se.depth32float,!1);i.name=`shadowDepthTexture_${a}`,r.depthTexture=i,r.label="shadowRender",r.customSize=!0,r.depthCleanValue=1;let n=Je.createRendererPassState(r);this.rendererPassStates[a]=n}}render(e,t){let a=_.setting.shadow;if(!a.enable)return;let r=e.camera,i=e.scene;if(this.shadowPassCount=0,!a.needUpdate||Le.frame%a.updateFrameRate!=0)return;let n=Wt.getDirectShadowLightWhichScene(i),o=a.shadowSize;const l=ra.Cascades;for(let c of n){const f=c;let h=f.shadowIndex;this.rendererPassState=this.rendererPassStates[h],o=this.rendererPassState.depthTexture.width;let u=K.instance.getRenderShaderCollect(e);for(const g of u){let A=g[1];for(const m of A){let p=m[1];if(!p.isDestroyed&&p.preInit(this._rendererType)){p.nodeUpdate(e,this._rendererType,this.rendererPassState,null);break}}}if(f.castShadow&&f.needUpdateShadow||this._forceUpdate||f.castShadow&&a.autoUpdate)if(f.needUpdateShadow=!1,r.enableCSM&&h==0)for(let g=0;g<l;g++){this.rendererPassState=this.rendererPassStates[g];let A=r.csm.children[g],m=r.getCSMShadowWorldExtents(g);this.poseShadowCamera(r,f.direction,A.shadowCamera,m,A.bound.center),this.renderShadow(e,A.shadowCamera,t,this.rendererPassState),this.copyDepthTexture(this.rendererPassState.depthTexture,this.depth2DArrayTexture,g,o)}else{r.enableCSM&&(h+=l-1);let g=r.getShadowWorldExtents();this.rendererPassState=this.rendererPassStates[h],this.poseShadowCamera(r,f.direction,f.shadowCamera,g,r.lookTarget),this.renderShadow(e,f.shadowCamera,t,this.rendererPassState),this.copyDepthTexture(this.rendererPassState.depthTexture,this.depth2DArrayTexture,h,o)}}this._forceUpdate=!1}copyDepthTexture(e,t,a,r){let i=F.beginCommandEncoder();i.copyTextureToTexture({texture:e.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:0}},{texture:t.getGPUTexture(),mipLevel:0,origin:{x:0,y:0,z:a}},{width:r,height:r,depthOrArrayLayers:1}),F.endCommandEncoder(i)}_shadowPos=new b;_shadowCameraTarget=new b;poseShadowCamera(e,t,a,r,i){this._shadowPos.copy(t).normalize(e.far),i.add(this._shadowPos,this._shadowCameraTarget),i.subtract(this._shadowPos,this._shadowPos),a.transform.lookAt(this._shadowPos,this._shadowCameraTarget),a.orthoOffCenter(-r,r,-r,r,e.near,e.far*2)}compute(){}renderShadow(e,t,a,r){let i=K.instance.getRenderNodes(e.scene,t),n=F.beginCommandEncoder(),o=F.beginRenderPass(n,r);t.transform.updateWorldMatrix(),xs.enable&&(a.update(t,e.scene),a.collect(i,t)),ve.updateCameraGroup(t),F.bindCamera(o,t);let l=this.renderShadowBundleOp(e,t,r),c=this.renderShadowBundleTr(e,t,r);l.length>0&&o.executeBundles(l),this.drawShadowRenderNodes(e,t,o,i.opaqueList),c.length>0&&o.executeBundles(c),this.drawShadowRenderNodes(e,t,o,i.transparentList),F.endPass(o),F.endCommandEncoder(n)}renderShadowBundleOp(e,t,a){let r=K.instance.getOpRenderGroup(e.scene);if(r){let i=[];return r.renderGroup.forEach(n=>{if(n.bundleMap.has(this._rendererType))i.push(n.bundleMap.get(this._rendererType));else{let o=F.recordBundleEncoder(a.renderBundleEncoderDescriptor);this.recordShadowRenderBundleNode(e,t,o,n.renderNodes);let l=o.finish();n.bundleMap.set(this._rendererType,l),i.push(l)}}),i}return[]}renderShadowBundleTr(e,t,a){let r=K.instance.getTrRenderGroup(e.scene);if(r){let i=[];return r.renderGroup.forEach(n=>{if(n.bundleMap.has(this._rendererType))i.push(n.bundleMap.get(this._rendererType));else{let o=F.recordBundleEncoder(a.renderBundleEncoderDescriptor);this.recordShadowRenderBundleNode(e,t,o,n.renderNodes);let l=o.finish();n.bundleMap.set(this._rendererType,l),i.push(l)}}),i}return[]}recordShadowRenderBundleNode(e,t,a,r,i){if(ve.updateCameraGroup(t),F.bindCamera(a,t),r){F.bindGeometryBuffer(a,r[0].geometry);for(let n=0;n<r.length;++n){let o=r[n];o.transform.enable&&o.recordRenderPass2(e,this._rendererType,this.rendererPassState,i,a)}}}drawShadowRenderNodes(e,t,a,r,i){if(ve.updateCameraGroup(t),F.bindCamera(a,t),r)for(let n=_.setting.render.drawOpMin;n<Math.min(r.length,_.setting.render.drawOpMax);++n){let o=r[n];o.transform.enable&&o.enable&&o.castShadow&&(o.isDestroyed||(o.preInit(this._rendererType)||o.nodeUpdate(e,this._rendererType,this.rendererPassState,i),o.renderPass2(e,this._rendererType,this.rendererPassState,i,a)))}}}class D0 extends Ta{zBufferTexture;useRenderBundle=!1;shadowPassCount;zCullingCompute;constructor(){super(),this.passType=le.DEPTH;let e=w.presentationSize,t=1;this.zBufferTexture=Et.createRTTexture(Qa.zBufferTexture_NAME,Math.floor(e[0]*t),Math.floor(e[1]*t),se.rgba16float,!1);let a=new Ge;a.clearValue=[0,0,0,0],a.loadOp="clear";let r=new rt([],[],Et.createRTTexture(Qa.zPreDepthTexture_NAME,Math.floor(e[0]),Math.floor(e[1]),se.depth32float,!1),null,!1);this.setRenderStates(r)}render(e,t){let a=e.camera,r=e.scene;F.cleanCache(),lt.start("DepthPass Renderer");let i=r;this.rendererPassState.camera3D=a;let n=K.instance.getRenderNodes(i,a);this.compute(e,t);let o=this.renderBundleOp(e,n,t),l=[],c=F.beginCommandEncoder(),f=F.beginRenderPass(c,this.rendererPassState);o.length>0&&f.executeBundles(o);let h=K.instance.getRenderShaderCollect(e);for(const u of h){let g=u[1];for(const A of g){let m=A[1];if(!m.isDestroyed&&m.preInit(this._rendererType)){m.nodeUpdate(e,this._rendererType,this.rendererPassState,null);break}}}this.drawRenderNodes(e,f,c,n.opaqueList,t),l.length>0&&f.executeBundles(l),F.endPass(f),F.endCommandEncoder(c),lt.end("DepthPass Renderer")}drawRenderNodes(e,t,a,r,i,n){F.bindCamera(t,e.camera);for(let o=_.setting.render.drawOpMin;o<Math.min(r.length,_.setting.render.drawOpMax);++o){let l=r[o];l.transform.enable&&l.enable&&(l.isDestroyed||(l.preInit(this._rendererType)||l.nodeUpdate(e,this._rendererType,this.rendererPassState),l.renderPass2(e,this._rendererType,this.rendererPassState,n,t)))}}}class _0{map;passRendererList;constructor(){this.map=new Map,this.passRendererList=[]}addRenderer(e){this.map.has(e.passType)?console.error("same renderer pass repeat!"):(this.map.set(e.passType,e),e.passType<=8&&this.addPassRenderer(e))}getRenderer(e){return this.map.get(e)}addPassRenderer(e){this.passRendererList.push(e)}getAllRenderer(){return this.map}getAllPassRenderer(){return this.passRendererList}}class B0 extends Ta{finalQuadView;postList;constructor(){super(),this._rendererType=le.POST,this.postList=new Map,this.initRenderer()}initRenderer(){Y.register("FullQuad_vert_wgsl",Rl),this.finalQuadView=new Cs("Quad_vert_wgsl","Quad_frag_wgsl",new rt([],[]),0,!1)}attachPost(e,t){t.postRenderer=this;let a=t.constructor.name;this.postList.get(a)||(this.postList.set(a,t),t.onAttach(e))}detachPost(e,t){let a=t.constructor.name,r=this.postList.get(a);return r&&(this.postList.delete(a),t.onDetach(e),t.postRenderer=null),r!=null}render(e){this.postList.forEach(a=>{a.enable&&a.compute(e)});let t=F.beginCommandEncoder();this.postList.forEach(a=>{a.enable&&a.render(e,t)}),F.endCommandEncoder(t)}presentContent(e,t){let a=F.beginCommandEncoder();this.finalQuadView.renderToViewQuad(e,this.finalQuadView,a,t),F.endCommandEncoder(a)}}class Jt{enable=!0;postRenderer;rtViewQuad;virtualTexture;constructor(){this.rtViewQuad=new Map,this.virtualTexture=new Map,w.addEventListener(ir.RESIZE,this.onResize,this)}createRTTexture(e,t,a,r,i=!1,n=0){let o=Et.createRTTexture(e,t,a,r,i,n);return o.name=e,this.virtualTexture.set(e,o),Ce.getInstance().attached(o,this),o}createViewQuad(e,t,a,r=0){let i=Et.createViewQuad(e,"Quad_vert_wgsl",t,a,r);return this.rtViewQuad.set(e,i),i}getOutTexture(){let e,t=F.lastRenderPassState.renderTargets;return t.length>0?e=t[0]:e=Et.getTexture(Qa.colorBufferTex_NAME),e}autoSetColorTexture(e,t){let a=this.getOutTexture();t.setSamplerTexture(e,a)}compute(e){}onAttach(e){}onDetach(e){}onResize(){}render(e,t){this.compute(e),this.rtViewQuad.forEach((a,r)=>{let i=F.lastRenderPassState.getLastRenderTexture();a.renderToViewQuad(e,a,t,i)})}destroy(e){this.postRenderer=null;for(let t=0;t<this.rtViewQuad.size;t++)this.rtViewQuad.values[t].destroy(e);this.rtViewQuad.clear(),this.rtViewQuad=null;for(let t=0;t<this.virtualTexture.size;t++){const a=this.virtualTexture.values[t];Ce.getInstance().detached(a,this),a.destroy(e)}}}class Fs extends d.Object3D{up_camera;down_camera;left_camera;right_camera;front_camera;back_camera;_near;_far;constructor(e=.001,t=1e4,a=90,r=!1){super(),this.initCubeCamera(e,t,a,r)}initCubeCamera(e,t,a=90,r=!1){this.up_camera=dt.createCamera3DObject(this,"up"),this.down_camera=dt.createCamera3DObject(this,"down"),this.left_camera=dt.createCamera3DObject(this,"left"),this.right_camera=dt.createCamera3DObject(this,"right"),this.front_camera=dt.createCamera3DObject(this,"front"),this.back_camera=dt.createCamera3DObject(this,"back"),this.up_camera.isShadowCamera=r,this.down_camera.isShadowCamera=r,this.left_camera.isShadowCamera=r,this.right_camera.isShadowCamera=r,this.front_camera.isShadowCamera=r,this.back_camera.isShadowCamera=r;let i=1;this.up_camera.perspective(a,i,e,t),this.up_camera.lookAt(b.ZERO,b.UP,b.DOWN),this.down_camera.perspective(a,i,e,t),this.down_camera.lookAt(b.ZERO,b.DOWN,b.DOWN),this.left_camera.perspective(a,i,e,t),this.left_camera.lookAt(b.ZERO,b.LEFT),this.right_camera.perspective(a,i,e,t),this.right_camera.lookAt(b.ZERO,b.RIGHT),this.front_camera.perspective(a,i,e,t),this.front_camera.lookAt(b.ZERO,b.FORWARD),this.back_camera.perspective(a,i,e,t),this.back_camera.lookAt(b.ZERO,b.BACK),this.up_camera.type=at.shadow,this.down_camera.type=at.shadow,this.left_camera.type=at.shadow,this.right_camera.type=at.shadow,this.front_camera.type=at.shadow,this.back_camera.type=at.shadow}set near(e){this._near=e,this.up_camera.near=e,this.down_camera.near=e,this.left_camera.near=e,this.right_camera.near=e,this.front_camera.near=e,this.back_camera.near=e}get near(){return this._near}set far(e){this._far=e,this.up_camera.far=e,this.down_camera.far=e,this.left_camera.far=e,this.right_camera.far=e,this.front_camera.far=e,this.back_camera.far=e}get far(){return this._far}}let v0=`
|
|
6333
6333
|
#include "GenerayRandomDir"
|
|
6334
6334
|
#include "BitUtil"
|
|
6335
6335
|
#include "MathShader"
|
|
@@ -6526,7 +6526,7 @@ struct InstanceData {
|
|
|
6526
6526
|
return r2 / pow(NoH2 * (r2 - 1.0) + 1.0, 2.0);
|
|
6527
6527
|
}
|
|
6528
6528
|
|
|
6529
|
-
`;class U0 extends
|
|
6529
|
+
`;class U0 extends Ta{cubeCamera;gBuffer;sizeW=0;sizeH=0;probeSize=64;probeCount=32;mipCount=8;preFilteredEnvironmentCompute;outTexture;preFilteredEnvironmentUniform;onChange=!0;needUpdate=!0;constructor(){super(),this.passType=le.REFLECTION,this.cubeCamera=new Fs(.01,5e3);let e=1;this.probeSize=_.setting.reflectionSetting.reflectionProbeSize,this.probeCount=_.setting.reflectionSetting.reflectionProbeMaxCount,this.sizeW=_.setting.reflectionSetting.width,this.sizeH=_.setting.reflectionSetting.height,this.gBuffer=_e.getGBufferFrame(_e.reflections_GBuffer,this.sizeW,this.sizeH,!1),this.setRenderStates(this.gBuffer),this.outTexture=new we(this.probeSize*this.mipCount,this.sizeH,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING,1,0,e),this.outTexture.name="texture_AAA",this.preFilteredEnvironmentUniform=new yt(4+this.probeCount*4),this.preFilteredEnvironmentUniform.setFloat("probeSize",this.probeSize),this.preFilteredEnvironmentUniform.setFloat("probeCount",this.probeCount),this.preFilteredEnvironmentUniform.setFloat("width",this.sizeW),this.preFilteredEnvironmentUniform.setFloat("height",this.sizeH),this.preFilteredEnvironmentUniform.apply(),this.preFilteredEnvironmentCompute=new ye(v0),this.preFilteredEnvironmentCompute.setSamplerTexture("inputTex",this.gBuffer.getCompressGBufferTexture()),this.preFilteredEnvironmentCompute.setStorageTexture("outputTexture",this.outTexture),this.preFilteredEnvironmentCompute.setUniformBuffer("uniformData",this.preFilteredEnvironmentUniform)}forceUpdate(){this.onChange=!0}compute(e,t){if(this.needUpdate){this.needUpdate=!1;let a=ve.getReflectionEntries(e.scene);a.reflectionMap=this.outTexture,this.preFilteredEnvironmentCompute.workerSizeX=Math.ceil(this.probeSize*this.mipCount/16),this.preFilteredEnvironmentCompute.workerSizeY=Math.ceil(this.sizeH/16),this.preFilteredEnvironmentCompute.workerSizeZ=this.mipCount*a.count;let r=F.beginCommandEncoder();F.computeCommand(r,[this.preFilteredEnvironmentCompute]),F.endCommandEncoder(r)}}render(e,t,a,r=!1,i=!1){this.renderContext.clean();let n=this.probeSize,o=this.probeSize,l=K.instance.getReflections(e.scene);for(let c=0;c<l.length;c++){let f=l[c];if(f.autoUpdate&&(f.needUpdate||this.onChange)||Le.frame<10){f.needUpdate=!1,this.needUpdate=!0,this.renderContext.beginOpaqueRenderPass();let h=this.renderContext.encoder,u=c*o;l[c].transform.updateWorldMatrix();let g=l[c].transform.worldPosition;this.cubeCamera.x=g.x,this.cubeCamera.y=g.y,this.cubeCamera.z=g.z,this.cubeCamera.far=1e4,this.cubeCamera.transform.updateWorldMatrix(),h.setViewport(n*0,u,n,o,0,1),this.renderOnce(e,this.cubeCamera.right_camera,h,t,a,r),h.setViewport(n*1,u,n,o,0,1),this.renderOnce(e,this.cubeCamera.left_camera,h,t,a,r),h.setViewport(n*2,u,n,o,0,1),this.renderOnce(e,this.cubeCamera.up_camera,h,t,a,r),h.setViewport(n*3,u,n,o,0,1),this.renderOnce(e,this.cubeCamera.down_camera,h,t,a,r),h.setViewport(n*4,u,n,o,0,1),this.renderOnce(e,this.cubeCamera.front_camera,h,t,a,r),h.setViewport(n*5,u,n,o,0,1),this.renderOnce(e,this.cubeCamera.back_camera,h,t,a,r),this.renderContext.endRenderPass()}}this.onChange=!1}renderOnce(e,t,a,r,i,n=!1){let o=e.scene;t.transform.scene3D=o,this.rendererPassState.camera3D=t;let l=K.instance.getRenderNodes(o,t);{let c=a;ve.updateCameraGroup(t),!n&&K.instance.sky&&(F.bindCamera(c,t),K.instance.sky.preInit(le.REFLECTION)||K.instance.sky.nodeUpdate(e,le.REFLECTION,this.rendererPassState,i),K.instance.sky.renderPass2(e,le.REFLECTION,this.rendererPassState,i,c)),l.opaqueList&&(F.bindCamera(c,t),this.drawNodes(e,this.renderContext,l.opaqueList,r,i)),!n&&l.transparentList&&(F.bindCamera(c,t),this.drawNodes(e,this.renderContext,l.transparentList,r,i))}}drawNodes(e,t,a,r,i){let n=K.instance.getRenderShaderCollect(e);if(n){for(const o of n){let l=o[1];for(const c of l){let f=c[1];if(!f.hasMask(Qe.ReflectionDebug)&&!f.isDestroyed&&f.preInit(le.REFLECTION)){f.nodeUpdate(e,le.REFLECTION,this.rendererPassState,i);break}}}for(let o=0;o<a.length;o++){let l=a[o];l.hasMask(Qe.ReflectionDebug)||l.transform.enable&&l.enable&&(l.isDestroyed||(l.preInit(le.REFLECTION)||l.nodeUpdate(e,le.REFLECTION,this.rendererPassState,i),l.renderPass(e,le.REFLECTION,this.renderContext)))}}}occlusionRenderNodeTest(e,t,a){return!0}}let y0=`
|
|
6530
6530
|
#include 'BitUtil'
|
|
6531
6531
|
struct FragmentOutput {
|
|
6532
6532
|
@location(auto) o_Target: vec4<f32>
|
|
@@ -7352,7 +7352,7 @@ fn CsMain( @builtin(workgroup_id) workgroup_id : vec3<u32> , @builtin(global_inv
|
|
|
7352
7352
|
var color = coordFun(fragCoord);
|
|
7353
7353
|
textureStore(outputBuffer, fragCoord, color);
|
|
7354
7354
|
}
|
|
7355
|
-
`;class R0{computeShader;worldPosMap;worldNormalMap;colorMap;shadowMap;pointShadowMap;lightingTexture;constructor(){let e=_.setting.gi;this.lightingTexture=new kt(e.probeSourceTextureSize,e.probeSourceTextureSize,se.rgba16float,!1,GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.STORAGE_BINDING)}create(e){let t=ve.getLightEntries(e.scene);this.computeShader=new ye(w0);let a=ve.getCameraGroup(e.camera);this.computeShader.setUniformBuffer("globalUniform",a.uniformGPUBuffer),this.computeShader.setStorageTexture("outputBuffer",this.lightingTexture),this.computeShader.setStorageBuffer("lightBuffer",t.storageGPUBuffer),this.computeShader.setStorageBuffer("models",ve.modelMatrixBindGroup.matrixBufferDst),this.computeShader.setSamplerTexture("positionMap",this.worldPosMap),this.computeShader.setSamplerTexture("normalMap",this.worldNormalMap),this.computeShader.setSamplerTexture("colorMap",this.colorMap),this.computeShader.setSamplerTexture("shadowMap",this.shadowMap),this.computeShader.setSamplerTexture("pointShadowMap",this.pointShadowMap),this.computeShader.setSamplerTexture("prefilterMap",_.res.defaultSky)}setInputs(e){this.worldPosMap=e[0],this.worldNormalMap=e[1],this.colorMap=e[2],this.shadowMap=e[3],this.pointShadowMap=e[4]}compute(e,t){this.computeShader||this.create(e);let a=F.beginCommandEncoder(),r=_.setting.gi;this.computeShader.workerSizeX=r.probeSourceTextureSize/8,this.computeShader.workerSizeY=r.probeSourceTextureSize/8,this.computeShader.workerSizeZ=1,F.computeCommand(a,[this.computeShader]),F.endCommandEncoder(a)}}let An=new bt("GIRenderStartEvent"),Es=new bt("GIRenderCompleteEvent");class U2{count;complete}class I0 extends Ma{cubeCamera;volume;probeCountPerFrame=1;nextProbeIndex=-1;tempProbeList=[];isRenderCloudGI;probeRenderResult;renderStatus="none";positionMap;normalMap;colorMap;probeNext=128;sizeW;sizeH;lightingPass;bouncePass;irradianceComputePass;irradianceDepthMap;irradianceColorMap;constructor(e){super(),this.passType=le.GI,this.volume=e;let t=e.setting;this.cubeCamera=new Fs(.01,5e3),this.sizeW=t.probeSourceTextureSize,this.sizeH=t.probeSourceTextureSize,this.probeNext=t.probeSourceTextureSize/t.probeSize,this.initIrradianceMap(e),this.probeRenderResult=new U2;let a=new S0(this.sizeW,this.sizeH,!1);this.positionMap=a.renderTargets[0],this.normalMap=a.renderTargets[1],this.colorMap=a.renderTargets[2],this.setRenderStates(a)}setInputTexture(e){this.lightingPass=new R0,this.bouncePass=new E0(this.volume),this.irradianceComputePass=new F0(this.volume),this.lightingPass.setInputs([this.positionMap,this.normalMap,this.colorMap,e[0],e[1]]),this.bouncePass.setInputs([this.normalMap,this.colorMap,this.lightingPass.lightingTexture,this.irradianceColorMap]),this.irradianceComputePass.setTextures([this.positionMap,this.normalMap,this.bouncePass.blendTexture],this.irradianceColorMap,this.irradianceDepthMap)}setIrradianceData(e,t,a,r){if(a!=this.irradianceColorMap.width||r!=this.irradianceColorMap.height){console.error("irradiance image size not match !");return}this.writeToTexture(this.irradianceColorMap,e,a,r),this.writeToTexture(this.irradianceDepthMap,t,a,r)}updateProbe(e,t,a){let r=K.instance.getLights(e.scene),i=this.volume.setting.probeSize;t.drawCallFrame+=1,this.cubeCamera.x=t.x,this.cubeCamera.y=t.y,this.cubeCamera.z=t.z,this.volume.setting.debugCamera?(this.cubeCamera.x=e.camera.transform.x,this.cubeCamera.y=e.camera.transform.y,this.cubeCamera.z=e.camera.transform.z,this.cubeCamera.rotationX=e.camera.transform.rotationX,this.cubeCamera.rotationY=e.camera.transform.rotationY,this.cubeCamera.rotationZ=e.camera.transform.rotationZ):(this.cubeCamera.rotationX=t.rotationX,this.cubeCamera.rotationY=t.rotationY,this.cubeCamera.rotationZ=t.rotationZ);let n=this.cubeCamera,o=Math.floor(t.index/this.probeNext)*(i*6),l=Math.floor(t.index%this.probeNext)*i;a.setViewport(0+o,l,i,i,0,1),this.renderSceneOnce(e,n.right_camera,a,r),a.setViewport(i+o,l,i,i,0,1),this.renderSceneOnce(e,n.left_camera,a,r),a.setViewport(i*2+o,l,i,i,0,1),this.renderSceneOnce(e,n.up_camera,a,r),a.setViewport(i*3+o,l,i,i,0,1),this.renderSceneOnce(e,n.down_camera,a,r),a.setViewport(i*4+o,l,i,i,0,1),this.renderSceneOnce(e,n.front_camera,a,r),a.setViewport(i*5+o,l,i,i,0,1),this.renderSceneOnce(e,n.back_camera,a,r)}renderSceneOnce(e,t,a,r){this.volume.uploadBuffer();let i=K.instance.getRenderNodes(e.scene,t);F.bindCamera(a,t);let n=Math.max(0,_.setting.render.drawOpMin),o=Math.min(_.setting.render.drawOpMax,i.opaqueList.length),l=K.instance.getRenderShaderCollect(e);for(const c of l){let f=c[1];for(const h of f){let u=h[1];if(!u.isDestroyed&&u.preInit(this.passType)){u.nodeUpdate(e,this.passType,this.rendererPassState,null);break}}}for(let c=n;c<o;++c){let f=i.opaqueList[c];f.enable&&f.transform.enable&&!f.isDestroyed&&(f.preInit(this.passType)||f.nodeUpdate(e,this.passType,this.rendererPassState,null),f.renderPass2(e,this.passType,this.rendererPassState,null,a))}K.instance.sky&&(K.instance.sky.preInit(this.passType)||K.instance.sky.nodeUpdate(e,this.passType,this.rendererPassState,null),K.instance.sky.renderPass2(e,this.passType,this.rendererPassState,null,a)),n=Math.max(0,_.setting.render.drawTrMin),o=Math.min(_.setting.render.drawTrMax,i.transparentList.length);for(let c=n;c<o;++c){let f=i.transparentList[c];f.enable&&f.transform.enable&&!f.isDestroyed&&(f.preInit(this.passType)||f.nodeUpdate(e,this.passType,this.rendererPassState,null),f.renderPass2(e,this.passType,this.rendererPassState,null,a))}}render(e,t){if(!_.setting.gi.enable)return;this.volume.updateOrientation(),this.volume.isVolumeFrameChange=!1,this.volume.uploadBuffer(),this.rendProbe(e);let a=this.probeRenderResult.count>0;(K.instance.state.giLightingChange||a||_.setting.gi.realTimeGI)&&(K.instance.state.giLightingChange=!1,this.lightingPass.compute(e,this.rendererPassState),this.bouncePass.compute(e,this.rendererPassState),this.irradianceComputePass.compute(e,this.rendererPassState)),this.probeRenderResult.complete&&this.dispatchEvent(Es)}startRenderGI(e=0){this.nextProbeIndex==-1&&e==0&&this.dispatchEvent(An),this.nextProbeIndex=e,this.renderStatus="rendering"}startRenderCloudGI(){this.dispatchEvent(An),this.nextProbeIndex=0,this.renderStatus="rendering",this.isRenderCloudGI=!0}rendProbe(e){let t=_.setting.gi.autoRenderProbe,a=!1;if(t?(this.nextProbeIndex==-1&&this.startRenderGI(),a=!0):a=this.renderStatus=="rendering",this.probeRenderResult.count=0,this.probeRenderResult.complete=!1,a){let r=K.instance.getProbes(e.scene);this.renderContext.clean(),this.renderContext.beginOpaqueRenderPass(),this.tempProbeList.length=0;let i=Math.min(this.probeCountPerFrame,r.length);for(this.probeRenderResult.count=i;i>0;){const o=r[this.nextProbeIndex];this.updateProbe(e,o,this.renderContext.encoder),i--,this.nextProbeIndex++,o.drawCallFrame<3&&this.tempProbeList.push(o)}this.tempProbeList.length>0&&this.volume.updateProbes(this.tempProbeList);let n=this.nextProbeIndex>=r.length;this.nextProbeIndex>=r.length&&this.isRenderCloudGI&&this.updateProbe(e,r[0],this.renderContext.encoder),this.renderContext.endRenderPass(),n&&(this.nextProbeIndex=-1,this.renderStatus="complete",this.probeRenderResult.complete=!0)}}initIrradianceMap(e){let t=e.setting,a=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.COPY_DST;this.irradianceDepthMap=new kt(t.octRTMaxSize,t.octRTMaxSize,se.rgba16float,!1,a),this.irradianceDepthMap.name="irradianceDepthMap",this.irradianceColorMap=new kt(t.octRTMaxSize,t.octRTMaxSize,se.rgba16float,!1,a),this.irradianceColorMap.name="irradianceColorMap"}writeToTexture(e,t,a,r){console.log(e.name);const i=w.device.createBuffer({size:t.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});w.device.queue.writeBuffer(i,0,t);const n=F.beginCommandEncoder();n.copyBufferToTexture({buffer:i,bytesPerRow:a*16},{texture:e.getGPUTexture()},{width:a,height:r,depthOrArrayLayers:1}),F.endCommandEncoder(n)}}class Q0 extends Ma{constructor(){super(),this.passType=le.UI}compute(e,t){let a=F.beginCommandEncoder(),r=F.lastRenderPassState.getLastRenderTexture(),i=_e.getGUIBufferFrame().getColorTexture();F.copyTexture(a,r,i),F.endCommandEncoder(a)}render(e,t,a,r=!1){this.renderContext.clean();let i=e.scene,n=e.camera;ve.updateCameraGroup(n),this.rendererPassState.camera3D=n;let o=K.instance.getRenderNodes(i,n);{this.renderContext.specialtRenderPass();let l=this.renderContext.encoder;o.opaqueList&&(F.bindCamera(l,n),this.drawNodes(e,this.renderContext,o.opaqueList,t,a))}{let l=this.renderContext.encoder;!r&&o.transparentList&&(F.bindCamera(l,n),this.drawNodes(e,this.renderContext,o.transparentList,t,a)),this.renderContext.endRenderPass()}}drawNodes(e,t,a,r,i){let n=K.instance.getRenderShaderCollect(e);if(n){for(const o of n){let l=o[1];for(const c of l){let f=c[1];if(!f.isDestroyed&&f.preInit(this._rendererType)){f.nodeUpdate(e,this._rendererType,this.rendererPassState,i);break}}}for(let o=_.setting.render.drawOpMin;o<Math.min(a.length,_.setting.render.drawOpMax);++o){let l=a[o];l.transform.enable&&l.enable&&(!l.hasMask(Qe.UI)||l.isRecievePostEffectUI||l.isDestroyed||(l.preInit(this._rendererType)||l.nodeUpdate(e,this._rendererType,this.rendererPassState,i),l.renderPass(e,this.passType,this.renderContext)))}}}occlusionRenderNodeTest(e,t,a){return a.zDepthRenderNodeTest(t)>0}}class T0 extends C0{constructor(e){super(e)}start(){super.start();{let e=new c0,t=_e.getGBufferFrame(_e.colorPass_GBuffer);if(_.setting.render.zPrePass&&(t.zPreTexture=this.depthPassRenderer.rendererPassState.depthTexture),e.setRenderStates(t),_.setting.gi.enable){let a=ve.getLightEntries(this.view.scene);this.ddgiProbeRenderer=new I0(a.irradianceVolume),this.ddgiProbeRenderer.setInputTexture([this.shadowMapPassRenderer.depth2DArrayTexture,this.pointLightShadowRenderer.cubeArrayTexture]),e.setIrradiance(this.ddgiProbeRenderer.irradianceColorMap,this.ddgiProbeRenderer.irradianceDepthMap),this.rendererMap.addRenderer(this.ddgiProbeRenderer)}this.rendererMap.addRenderer(e)}{let e=_e.getGUIBufferFrame(),t=new Q0;t.setRenderStates(e),this.rendererMap.addRenderer(t)}_.setting.render.debug&&this.debug()}debug(){}}class M0{_factor;_doubleFactor;constructor(){this._factor=1,this._doubleFactor=2}get accelerateInterpolator(){return this._factor}set accelerateInterpolator(e){this._factor=e,this._doubleFactor=2*this._factor}getInterpolation(e){return this._factor==1?e*e:Math.pow(e,this._doubleFactor)}}class N0{_factor=1;constructor(){}get decelerateInterpolator(){return this._factor}set decelerateInterpolator(e){this._factor=e}getInterpolation(e){let t;return this._factor==1?t=1-(1-e)*(1-e):t=1-Math.pow(1-e,2*this._factor),t}}class P0{_factor=1;constructor(){}getInterpolation(e){return Math.cos((e+1)*Math.PI)/2+.5}}class V0{getInterpolation(e){return e}}class O0{getInterpolation(e){return 4.9*e+4.9*e}}class Kt{constructor(){}static bounce(e){return e*e*9.8}getInterpolation(e){return e*=1.1226,e<.3535?Kt.bounce(e):e<.7408?Kt.bounce(e-.54719)+.7:e<.9644?Kt.bounce(e-.8526)+.9:Kt.bounce(e-1.0435)+.95}getBounceInterpolation(e){return e<.5?Kt.bounce(e):Kt.bounce(e-1)}geJumpUp(e,t){return t<.5?(t=t/.5,e*t-Kt.bounce(t)):t<.8?(t=(t-.5)/(.8-.5),(e*t-Kt.bounce(t))*.3):t<1?(t=(t-.8)/(1-.8),(e*t-Kt.bounce(t))*.15):e*t-Kt.bounce(t)}}class L0{_tension;constructor(){this._tension=2}get anticipateInterpolator(){return this._tension}set anticipateInterpolator(e){this._tension=e}getInterpolation(e){return e*e*((this._tension+1)*e-this._tension)}}class Si{_tension;constructor(){this._tension=1*1.5}anticipateOvershootInterpolator(e){this._tension=e*1.5}anticipateOvershootInterpolator2(e,t){this._tension=e*t}getInterpolation(e){return e<.5?.5*Si.a(e*2,this._tension):.5*(Si.o(e*2-2,this._tension)+2)}static a(e,t){return e*e*((t+1)*e-t)}static o(e,t){return e*e*((t+1)*e+t)}}class G0{_cycles;constructor(e){this._cycles=e}getInterpolation(e){return Math.sin(2*this._cycles*Math.PI*e)}}class z0{_tension;constructor(){this._tension=2}getInterpolation(e){return e-=1,e*e*((this._tension+1)*e+this._tension)+1}}var ws=(s=>(s[s.AccelerateInterpolator=0]="AccelerateInterpolator",s[s.DecelerateInterpolator=1]="DecelerateInterpolator",s[s.AccelerateDecelerateInterpolator=2]="AccelerateDecelerateInterpolator",s[s.LinearInterpolator=3]="LinearInterpolator",s[s.BounceInterpolator=4]="BounceInterpolator",s[s.AnticipateInterpolator=5]="AnticipateInterpolator",s[s.AnticipateOvershootInterpolator=6]="AnticipateOvershootInterpolator",s[s.CycleInterpolator=7]="CycleInterpolator",s[s.OvershootInterpolator=8]="OvershootInterpolator",s[s.JumperInterpolator=9]="JumperInterpolator",s))(ws||{});class br{static interpolators=[];complete=!1;onComplete;onProgress;target;property;targetProperty;durtion;interpolatorEnum;delayTime=0;_interpolator;_ct=0;_p=0;static to(e,t,a,r=0){var i=new br;return i.target=e,i.property=t,i.durtion=a,i.interpolatorEnum=r,i.start(),i.delayTime=t.delayTime?t.delayTime:0,t.onComplete&&(i.onComplete=t.onComplete),t.onProgress&&(i.onProgress=t.onProgress),this.interpolators.push(i),i}static tick(e){let t=br.interpolators;for(let a of t)a.complete?br.remove(a,!0):a.tick(e)}static remove(e,t){let a=br.interpolators,r=a.indexOf(e);r!=-1&&a.splice(r,1),t&&e.dispose()}static removeList(e,t){e.forEach(a=>{this.remove(a,t)})}start(){window.AccelerateInterpolator=M0,window.DecelerateInterpolator=N0,window.AccelerateDecelerateInterpolator=P0,window.LinearInterpolator=V0,window.BounceInterpolator=Kt,window.AnticipateInterpolator=L0,window.AnticipateOvershootInterpolator=Si,window.CycleInterpolator=G0,window.OvershootInterpolator=z0,window.JumperInterpolator=O0,this._interpolator=new window[ws[this.interpolatorEnum]],this.targetProperty={};for(let e in this.property)this.targetProperty[e]=this.target[e]}tick(e){if(this.delayTime<=0){this._p=Math.min(this._ct/this.durtion,1);let t=this._interpolator.getInterpolation(this._p),a=this.property,r=this.target,i=this.targetProperty,n,o;for(let l in a)o=a[l],n=i[l],r[l]=n+(o-n)*t;this.onProgress!=null&&this.onProgress(this._p),this._ct>=this.durtion&&(this.complete=!0,this.onComplete!=null&&this.onComplete(this.target)),this._ct+=e}else this.delayTime-=e}dispose(){this.onComplete=null,this.onProgress=null,this.target=null,this.property=null,this.targetProperty=null,this.interpolatorEnum=null,this._interpolator=null,br.remove(this)}}class Rt{static _filterChar=[" "," ",";",`
|
|
7355
|
+
`;class R0{computeShader;worldPosMap;worldNormalMap;colorMap;shadowMap;pointShadowMap;lightingTexture;constructor(){let e=_.setting.gi;this.lightingTexture=new kt(e.probeSourceTextureSize,e.probeSourceTextureSize,se.rgba16float,!1,GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.STORAGE_BINDING)}create(e){let t=ve.getLightEntries(e.scene);this.computeShader=new ye(w0);let a=ve.getCameraGroup(e.camera);this.computeShader.setUniformBuffer("globalUniform",a.uniformGPUBuffer),this.computeShader.setStorageTexture("outputBuffer",this.lightingTexture),this.computeShader.setStorageBuffer("lightBuffer",t.storageGPUBuffer),this.computeShader.setStorageBuffer("models",ve.modelMatrixBindGroup.matrixBufferDst),this.computeShader.setSamplerTexture("positionMap",this.worldPosMap),this.computeShader.setSamplerTexture("normalMap",this.worldNormalMap),this.computeShader.setSamplerTexture("colorMap",this.colorMap),this.computeShader.setSamplerTexture("shadowMap",this.shadowMap),this.computeShader.setSamplerTexture("pointShadowMap",this.pointShadowMap),this.computeShader.setSamplerTexture("prefilterMap",_.res.defaultSky)}setInputs(e){this.worldPosMap=e[0],this.worldNormalMap=e[1],this.colorMap=e[2],this.shadowMap=e[3],this.pointShadowMap=e[4]}compute(e,t){this.computeShader||this.create(e);let a=F.beginCommandEncoder(),r=_.setting.gi;this.computeShader.workerSizeX=r.probeSourceTextureSize/8,this.computeShader.workerSizeY=r.probeSourceTextureSize/8,this.computeShader.workerSizeZ=1,F.computeCommand(a,[this.computeShader]),F.endCommandEncoder(a)}}let An=new bt("GIRenderStartEvent"),Es=new bt("GIRenderCompleteEvent");class U2{count;complete}class I0 extends Ta{cubeCamera;volume;probeCountPerFrame=1;nextProbeIndex=-1;tempProbeList=[];isRenderCloudGI;probeRenderResult;renderStatus="none";positionMap;normalMap;colorMap;probeNext=128;sizeW;sizeH;lightingPass;bouncePass;irradianceComputePass;irradianceDepthMap;irradianceColorMap;constructor(e){super(),this.passType=le.GI,this.volume=e;let t=e.setting;this.cubeCamera=new Fs(.01,5e3),this.sizeW=t.probeSourceTextureSize,this.sizeH=t.probeSourceTextureSize,this.probeNext=t.probeSourceTextureSize/t.probeSize,this.initIrradianceMap(e),this.probeRenderResult=new U2;let a=new S0(this.sizeW,this.sizeH,!1);this.positionMap=a.renderTargets[0],this.normalMap=a.renderTargets[1],this.colorMap=a.renderTargets[2],this.setRenderStates(a)}setInputTexture(e){this.lightingPass=new R0,this.bouncePass=new E0(this.volume),this.irradianceComputePass=new F0(this.volume),this.lightingPass.setInputs([this.positionMap,this.normalMap,this.colorMap,e[0],e[1]]),this.bouncePass.setInputs([this.normalMap,this.colorMap,this.lightingPass.lightingTexture,this.irradianceColorMap]),this.irradianceComputePass.setTextures([this.positionMap,this.normalMap,this.bouncePass.blendTexture],this.irradianceColorMap,this.irradianceDepthMap)}setIrradianceData(e,t,a,r){if(a!=this.irradianceColorMap.width||r!=this.irradianceColorMap.height){console.error("irradiance image size not match !");return}this.writeToTexture(this.irradianceColorMap,e,a,r),this.writeToTexture(this.irradianceDepthMap,t,a,r)}updateProbe(e,t,a){let r=K.instance.getLights(e.scene),i=this.volume.setting.probeSize;t.drawCallFrame+=1,this.cubeCamera.x=t.x,this.cubeCamera.y=t.y,this.cubeCamera.z=t.z,this.volume.setting.debugCamera?(this.cubeCamera.x=e.camera.transform.x,this.cubeCamera.y=e.camera.transform.y,this.cubeCamera.z=e.camera.transform.z,this.cubeCamera.rotationX=e.camera.transform.rotationX,this.cubeCamera.rotationY=e.camera.transform.rotationY,this.cubeCamera.rotationZ=e.camera.transform.rotationZ):(this.cubeCamera.rotationX=t.rotationX,this.cubeCamera.rotationY=t.rotationY,this.cubeCamera.rotationZ=t.rotationZ);let n=this.cubeCamera,o=Math.floor(t.index/this.probeNext)*(i*6),l=Math.floor(t.index%this.probeNext)*i;a.setViewport(0+o,l,i,i,0,1),this.renderSceneOnce(e,n.right_camera,a,r),a.setViewport(i+o,l,i,i,0,1),this.renderSceneOnce(e,n.left_camera,a,r),a.setViewport(i*2+o,l,i,i,0,1),this.renderSceneOnce(e,n.up_camera,a,r),a.setViewport(i*3+o,l,i,i,0,1),this.renderSceneOnce(e,n.down_camera,a,r),a.setViewport(i*4+o,l,i,i,0,1),this.renderSceneOnce(e,n.front_camera,a,r),a.setViewport(i*5+o,l,i,i,0,1),this.renderSceneOnce(e,n.back_camera,a,r)}renderSceneOnce(e,t,a,r){this.volume.uploadBuffer();let i=K.instance.getRenderNodes(e.scene,t);F.bindCamera(a,t);let n=Math.max(0,_.setting.render.drawOpMin),o=Math.min(_.setting.render.drawOpMax,i.opaqueList.length),l=K.instance.getRenderShaderCollect(e);for(const c of l){let f=c[1];for(const h of f){let u=h[1];if(!u.isDestroyed&&u.preInit(this.passType)){u.nodeUpdate(e,this.passType,this.rendererPassState,null);break}}}for(let c=n;c<o;++c){let f=i.opaqueList[c];f.enable&&f.transform.enable&&!f.isDestroyed&&(f.preInit(this.passType)||f.nodeUpdate(e,this.passType,this.rendererPassState,null),f.renderPass2(e,this.passType,this.rendererPassState,null,a))}K.instance.sky&&(K.instance.sky.preInit(this.passType)||K.instance.sky.nodeUpdate(e,this.passType,this.rendererPassState,null),K.instance.sky.renderPass2(e,this.passType,this.rendererPassState,null,a)),n=Math.max(0,_.setting.render.drawTrMin),o=Math.min(_.setting.render.drawTrMax,i.transparentList.length);for(let c=n;c<o;++c){let f=i.transparentList[c];f.enable&&f.transform.enable&&!f.isDestroyed&&(f.preInit(this.passType)||f.nodeUpdate(e,this.passType,this.rendererPassState,null),f.renderPass2(e,this.passType,this.rendererPassState,null,a))}}render(e,t){if(!_.setting.gi.enable)return;this.volume.updateOrientation(),this.volume.isVolumeFrameChange=!1,this.volume.uploadBuffer(),this.rendProbe(e);let a=this.probeRenderResult.count>0;(K.instance.state.giLightingChange||a||_.setting.gi.realTimeGI)&&(K.instance.state.giLightingChange=!1,this.lightingPass.compute(e,this.rendererPassState),this.bouncePass.compute(e,this.rendererPassState),this.irradianceComputePass.compute(e,this.rendererPassState)),this.probeRenderResult.complete&&this.dispatchEvent(Es)}startRenderGI(e=0){this.nextProbeIndex==-1&&e==0&&this.dispatchEvent(An),this.nextProbeIndex=e,this.renderStatus="rendering"}startRenderCloudGI(){this.dispatchEvent(An),this.nextProbeIndex=0,this.renderStatus="rendering",this.isRenderCloudGI=!0}rendProbe(e){let t=_.setting.gi.autoRenderProbe,a=!1;if(t?(this.nextProbeIndex==-1&&this.startRenderGI(),a=!0):a=this.renderStatus=="rendering",this.probeRenderResult.count=0,this.probeRenderResult.complete=!1,a){let r=K.instance.getProbes(e.scene);this.renderContext.clean(),this.renderContext.beginOpaqueRenderPass(),this.tempProbeList.length=0;let i=Math.min(this.probeCountPerFrame,r.length);for(this.probeRenderResult.count=i;i>0;){const o=r[this.nextProbeIndex];this.updateProbe(e,o,this.renderContext.encoder),i--,this.nextProbeIndex++,o.drawCallFrame<3&&this.tempProbeList.push(o)}this.tempProbeList.length>0&&this.volume.updateProbes(this.tempProbeList);let n=this.nextProbeIndex>=r.length;this.nextProbeIndex>=r.length&&this.isRenderCloudGI&&this.updateProbe(e,r[0],this.renderContext.encoder),this.renderContext.endRenderPass(),n&&(this.nextProbeIndex=-1,this.renderStatus="complete",this.probeRenderResult.complete=!0)}}initIrradianceMap(e){let t=e.setting,a=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.COPY_DST;this.irradianceDepthMap=new kt(t.octRTMaxSize,t.octRTMaxSize,se.rgba16float,!1,a),this.irradianceDepthMap.name="irradianceDepthMap",this.irradianceColorMap=new kt(t.octRTMaxSize,t.octRTMaxSize,se.rgba16float,!1,a),this.irradianceColorMap.name="irradianceColorMap"}writeToTexture(e,t,a,r){console.log(e.name);const i=w.device.createBuffer({size:t.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.COPY_SRC});w.device.queue.writeBuffer(i,0,t);const n=F.beginCommandEncoder();n.copyBufferToTexture({buffer:i,bytesPerRow:a*16},{texture:e.getGPUTexture()},{width:a,height:r,depthOrArrayLayers:1}),F.endCommandEncoder(n)}}class Q0 extends Ta{constructor(){super(),this.passType=le.UI}compute(e,t){let a=F.beginCommandEncoder(),r=F.lastRenderPassState.getLastRenderTexture(),i=_e.getGUIBufferFrame().getColorTexture();F.copyTexture(a,r,i),F.endCommandEncoder(a)}render(e,t,a,r=!1){this.renderContext.clean();let i=e.scene,n=e.camera;ve.updateCameraGroup(n),this.rendererPassState.camera3D=n;let o=K.instance.getRenderNodes(i,n);{this.renderContext.specialtRenderPass();let l=this.renderContext.encoder;o.opaqueList&&(F.bindCamera(l,n),this.drawNodes(e,this.renderContext,o.opaqueList,t,a))}{let l=this.renderContext.encoder;!r&&o.transparentList&&(F.bindCamera(l,n),this.drawNodes(e,this.renderContext,o.transparentList,t,a)),this.renderContext.endRenderPass()}}drawNodes(e,t,a,r,i){let n=K.instance.getRenderShaderCollect(e);if(n){for(const o of n){let l=o[1];for(const c of l){let f=c[1];if(!f.isDestroyed&&f.preInit(this._rendererType)){f.nodeUpdate(e,this._rendererType,this.rendererPassState,i);break}}}for(let o=_.setting.render.drawOpMin;o<Math.min(a.length,_.setting.render.drawOpMax);++o){let l=a[o];l.transform.enable&&l.enable&&(!l.hasMask(Qe.UI)||l.isRecievePostEffectUI||l.isDestroyed||(l.preInit(this._rendererType)||l.nodeUpdate(e,this._rendererType,this.rendererPassState,i),l.renderPass(e,this.passType,this.renderContext)))}}}occlusionRenderNodeTest(e,t,a){return a.zDepthRenderNodeTest(t)>0}}class T0 extends C0{constructor(e){super(e)}start(){super.start();{let e=new c0,t=_e.getGBufferFrame(_e.colorPass_GBuffer);if(_.setting.render.zPrePass&&(t.zPreTexture=this.depthPassRenderer.rendererPassState.depthTexture),e.setRenderStates(t),_.setting.gi.enable){let a=ve.getLightEntries(this.view.scene);this.ddgiProbeRenderer=new I0(a.irradianceVolume),this.ddgiProbeRenderer.setInputTexture([this.shadowMapPassRenderer.depth2DArrayTexture,this.pointLightShadowRenderer.cubeArrayTexture]),e.setIrradiance(this.ddgiProbeRenderer.irradianceColorMap,this.ddgiProbeRenderer.irradianceDepthMap),this.rendererMap.addRenderer(this.ddgiProbeRenderer)}this.rendererMap.addRenderer(e)}{let e=_e.getGUIBufferFrame(),t=new Q0;t.setRenderStates(e),this.rendererMap.addRenderer(t)}_.setting.render.debug&&this.debug()}debug(){}}class M0{_factor;_doubleFactor;constructor(){this._factor=1,this._doubleFactor=2}get accelerateInterpolator(){return this._factor}set accelerateInterpolator(e){this._factor=e,this._doubleFactor=2*this._factor}getInterpolation(e){return this._factor==1?e*e:Math.pow(e,this._doubleFactor)}}class N0{_factor=1;constructor(){}get decelerateInterpolator(){return this._factor}set decelerateInterpolator(e){this._factor=e}getInterpolation(e){let t;return this._factor==1?t=1-(1-e)*(1-e):t=1-Math.pow(1-e,2*this._factor),t}}class P0{_factor=1;constructor(){}getInterpolation(e){return Math.cos((e+1)*Math.PI)/2+.5}}class V0{getInterpolation(e){return e}}class O0{getInterpolation(e){return 4.9*e+4.9*e}}class Kt{constructor(){}static bounce(e){return e*e*9.8}getInterpolation(e){return e*=1.1226,e<.3535?Kt.bounce(e):e<.7408?Kt.bounce(e-.54719)+.7:e<.9644?Kt.bounce(e-.8526)+.9:Kt.bounce(e-1.0435)+.95}getBounceInterpolation(e){return e<.5?Kt.bounce(e):Kt.bounce(e-1)}geJumpUp(e,t){return t<.5?(t=t/.5,e*t-Kt.bounce(t)):t<.8?(t=(t-.5)/(.8-.5),(e*t-Kt.bounce(t))*.3):t<1?(t=(t-.8)/(1-.8),(e*t-Kt.bounce(t))*.15):e*t-Kt.bounce(t)}}class L0{_tension;constructor(){this._tension=2}get anticipateInterpolator(){return this._tension}set anticipateInterpolator(e){this._tension=e}getInterpolation(e){return e*e*((this._tension+1)*e-this._tension)}}class Si{_tension;constructor(){this._tension=1*1.5}anticipateOvershootInterpolator(e){this._tension=e*1.5}anticipateOvershootInterpolator2(e,t){this._tension=e*t}getInterpolation(e){return e<.5?.5*Si.a(e*2,this._tension):.5*(Si.o(e*2-2,this._tension)+2)}static a(e,t){return e*e*((t+1)*e-t)}static o(e,t){return e*e*((t+1)*e+t)}}class G0{_cycles;constructor(e){this._cycles=e}getInterpolation(e){return Math.sin(2*this._cycles*Math.PI*e)}}class z0{_tension;constructor(){this._tension=2}getInterpolation(e){return e-=1,e*e*((this._tension+1)*e+this._tension)+1}}var ws=(s=>(s[s.AccelerateInterpolator=0]="AccelerateInterpolator",s[s.DecelerateInterpolator=1]="DecelerateInterpolator",s[s.AccelerateDecelerateInterpolator=2]="AccelerateDecelerateInterpolator",s[s.LinearInterpolator=3]="LinearInterpolator",s[s.BounceInterpolator=4]="BounceInterpolator",s[s.AnticipateInterpolator=5]="AnticipateInterpolator",s[s.AnticipateOvershootInterpolator=6]="AnticipateOvershootInterpolator",s[s.CycleInterpolator=7]="CycleInterpolator",s[s.OvershootInterpolator=8]="OvershootInterpolator",s[s.JumperInterpolator=9]="JumperInterpolator",s))(ws||{});class ur{static interpolators=[];complete=!1;onComplete;onProgress;target;property;targetProperty;durtion;interpolatorEnum;delayTime=0;_interpolator;_ct=0;_p=0;static to(e,t,a,r=0){var i=new ur;return i.target=e,i.property=t,i.durtion=a,i.interpolatorEnum=r,i.start(),i.delayTime=t.delayTime?t.delayTime:0,t.onComplete&&(i.onComplete=t.onComplete),t.onProgress&&(i.onProgress=t.onProgress),this.interpolators.push(i),i}static tick(e){let t=ur.interpolators;for(let a of t)a.complete?ur.remove(a,!0):a.tick(e)}static remove(e,t){let a=ur.interpolators,r=a.indexOf(e);r!=-1&&a.splice(r,1),t&&e.dispose()}static removeList(e,t){e.forEach(a=>{this.remove(a,t)})}start(){window.AccelerateInterpolator=M0,window.DecelerateInterpolator=N0,window.AccelerateDecelerateInterpolator=P0,window.LinearInterpolator=V0,window.BounceInterpolator=Kt,window.AnticipateInterpolator=L0,window.AnticipateOvershootInterpolator=Si,window.CycleInterpolator=G0,window.OvershootInterpolator=z0,window.JumperInterpolator=O0,this._interpolator=new window[ws[this.interpolatorEnum]],this.targetProperty={};for(let e in this.property)this.targetProperty[e]=this.target[e]}tick(e){if(this.delayTime<=0){this._p=Math.min(this._ct/this.durtion,1);let t=this._interpolator.getInterpolation(this._p),a=this.property,r=this.target,i=this.targetProperty,n,o;for(let l in a)o=a[l],n=i[l],r[l]=n+(o-n)*t;this.onProgress!=null&&this.onProgress(this._p),this._ct>=this.durtion&&(this.complete=!0,this.onComplete!=null&&this.onComplete(this.target)),this._ct+=e}else this.delayTime-=e}dispose(){this.onComplete=null,this.onProgress=null,this.target=null,this.property=null,this.targetProperty=null,this.interpolatorEnum=null,this._interpolator=null,ur.remove(this)}}class Rt{static _filterChar=[" "," ",";",`
|
|
7356
7356
|
`,"\r"," ",`
|
|
7357
7357
|
`,"\r"," "];static hasString(e,t){for(var a=0;a<e.length;++a)if(e[a]==t)return a;return-1}static getEllipsis(e,t=4){let a=e;return a.length>t&&(a=a.slice(0,t)+"..."),a}static getURLName(e){var t;t=e.split("/");let a=t[t.length-1];return a=a.split(".")[0],a}static getFileFormat(e){var t=e.lastIndexOf(".");t++;var a=e.length;e.indexOf("?",t)!==-1&&(a=e.indexOf("?",t));var r=e.substr(t,a-t);return r=r.toLowerCase(),r}static readLineProperty(e,t){e.trim().split(" ").forEach((a,r)=>{let i=a.split("=");if(i.length>1){let n=i[0],o=i[1];Object.prototype.hasOwnProperty.call(t,n)&&(o.indexOf('"')==-1?t[n]=parseFloat(i[1]):t[n]=o.replace('"',"").replace('"',""))}})}static getPath(e){var t=e.lastIndexOf("/");return t++,e.substring(0,t)}static normalizePath(e){if(!e)return e;let t=e.replace(/\\/g,"/");const a=t.startsWith("//"),r=[];let i=0;return t=t.replace(/([a-zA-Z][a-zA-Z0-9+\-.]*):\/{2}/g,(n,o,l)=>{if(o.length===1&&l===0)return n;const c=`__SCHEME_SLASH_${i++}__`;return r.push(c),`${o}:${c}`}),t=t.replace(/\/{2,}/g,"/"),r.forEach(n=>{t=t.replace(n,"//")}),a&&(t=`//${t.replace(/^\/+/,"")}`),t}static getStringList(e,t=";"){return e.split(t)}static formatTime(e){let a=e/1e3/60,r=Math.floor(a),i=Math.floor(a-r);return[r.toString(),i.toString()]}static trim(e){return e.replace(/^\s+/g,"").replace(/\s+$/g,"")}static isEmpty(e){return!e||typeof e>"u"||e==null||typeof e=="string"&&this.trim(e)===""||e==="null"}static strCut(e,t){if(e.length*2<=t)return e;for(var a=0,r="",i=0;i<e.length;i++)if(r=r+e.charAt(i),e.charCodeAt(i)>128){if(a=a+2,a>=t)return r.substring(0,r.length-1)+"..."}else if(a=a+1,a>=t)return r.substring(0,r.length-2)+"...";return r}static toQueryPair(e,t,a=!1){return e+"="+(a?encodeURIComponent(t):t)}static stringFormat(e,...t){if(arguments.length===0)throw new Error("please give arg at least one !");if(arguments.length===2&&typeof arguments[1]=="object")for(let a in arguments[1]){let r=new RegExp("({"+a+"})","g");e=e.replace(r,arguments[1][a])}else for(let a=0;a<t.length;a++){if(t[a]==null)return e;{let r=new RegExp("({["+a+"]})","g");e=e.replace(r,t[a])}}return e}static parseJson2String(e,t){let a=null,r="",i=0,n=" ";return t=t||{},t.newlineAfterColonIfBeforeBraceOrBracket=t.newlineAfterColonIfBeforeBraceOrBracket===!0,t.spaceAfterColon=t.spaceAfterColon!==!1,typeof e!="string"||(e=JSON.parse(e)),e=JSON.stringify(e),a=/([\{\}])/g,e=e.replace(a,`\r
|
|
7358
7358
|
$1\r
|
|
@@ -7633,7 +7633,7 @@ else if (typeof exports === 'object')
|
|
|
7633
7633
|
`;for(;0>(n=c.indexOf(f))&&o<t&&i<e.byteLength;)l+=c,o+=c.length,i+=128,c+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(i,i+128)));return-1<n?(a!==!1&&(e.pos+=o+n+1),l+c.slice(0,n)):!1}paserHeader(e){const t=/^#\?(\S+)/,a=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,r=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,i=/^\s*FORMAT=(\S+)\s*$/,n=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,o=new Zs;let l,c;if(e.pos>=e.byteLength||!(l=this.parserBlock(e)))return this.parseError(1,"no header found");if(!(c=l.match(t)))return this.parseError(3,"bad initial token");const f=1,h=2,u=4;for(o.valid|=f,o.programtype=c[1],o.string+=l+`
|
|
7634
7634
|
`;l=this.parserBlock(e),l!==!1;){if(o.string+=l+`
|
|
7635
7635
|
`,l.charAt(0)==="#"){o.comments+=l+`
|
|
7636
|
-
`;continue}if((c=l.match(a))&&(o.gamma=Math.floor(parseFloat(c[1])*10)/10),(c=l.match(r))&&(o.exposure=Math.floor(parseFloat(c[1])*10)/10),(c=l.match(i))&&(o.valid|=h,o.format=c[1]),(c=l.match(n))&&(o.valid|=u,o.height=parseInt(c[1],10),o.width=parseInt(c[2],10)),o.valid&h&&o.valid&u)break}return o.valid&h?o.valid&u?o:(this.parseError(3,"missing image size specifier"),null):(this.parseError(3,"missing format specifier"),null)}parserPixel(e,t,a){const r=t;if(r<8||r>32767||e[0]!==2||e[1]!==2||e[2]&128)return new Uint8Array(e);if(r!==(e[2]<<8|e[3]))return this.parseError(3,"wrong scanline width");const i=new Uint8Array(4*t*a);if(!i.length)return this.parseError(4,"unable to allocate buffer space");let n=0,o=0;const l=4*r,c=new Uint8Array(4),f=new Uint8Array(l);let h=a;for(;h>0&&o<e.byteLength;){if(o+4>e.byteLength)return this.parseError(1,"");if(c[0]=e[o++],c[1]=e[o++],c[2]=e[o++],c[3]=e[o++],c[0]!=2||c[1]!=2||(c[2]<<8|c[3])!=r)return this.parseError(3,"bad rgbe scanline format");let u=0,g;for(;u<l&&o<e.byteLength;){g=e[o++];const m=g>128;if(m&&(g-=128),g===0||u+g>l)return this.parseError(3,"bad scanline data");if(m){const p=e[o++];for(let D=0;D<g;D++)f[u++]=p}else f.set(e.subarray(o,o+g),u),u+=g,o+=g}const A=r;for(let m=0;m<A;m++){let p=0;i[n]=f[m+p],p+=r,i[n+1]=f[m+p],p+=r,i[n+2]=f[m+p],p+=r,i[n+3]=f[m+p],n+=4}h--}return i}rbgeToFloat(e,t,a,r){const i=e[t+3],n=Math.pow(2,i-128)/255;a[r+0]=e[t+0]*n,a[r+1]=e[t+1]*n,a[r+2]=e[t+2]*n,a[r+3]=1}rbgeToHalfFloat(e,t,a,r){const i=e[t+3],n=Math.pow(2,i-128)/255;a[r+0]=
|
|
7636
|
+
`;continue}if((c=l.match(a))&&(o.gamma=Math.floor(parseFloat(c[1])*10)/10),(c=l.match(r))&&(o.exposure=Math.floor(parseFloat(c[1])*10)/10),(c=l.match(i))&&(o.valid|=h,o.format=c[1]),(c=l.match(n))&&(o.valid|=u,o.height=parseInt(c[1],10),o.width=parseInt(c[2],10)),o.valid&h&&o.valid&u)break}return o.valid&h?o.valid&u?o:(this.parseError(3,"missing image size specifier"),null):(this.parseError(3,"missing format specifier"),null)}parserPixel(e,t,a){const r=t;if(r<8||r>32767||e[0]!==2||e[1]!==2||e[2]&128)return new Uint8Array(e);if(r!==(e[2]<<8|e[3]))return this.parseError(3,"wrong scanline width");const i=new Uint8Array(4*t*a);if(!i.length)return this.parseError(4,"unable to allocate buffer space");let n=0,o=0;const l=4*r,c=new Uint8Array(4),f=new Uint8Array(l);let h=a;for(;h>0&&o<e.byteLength;){if(o+4>e.byteLength)return this.parseError(1,"");if(c[0]=e[o++],c[1]=e[o++],c[2]=e[o++],c[3]=e[o++],c[0]!=2||c[1]!=2||(c[2]<<8|c[3])!=r)return this.parseError(3,"bad rgbe scanline format");let u=0,g;for(;u<l&&o<e.byteLength;){g=e[o++];const m=g>128;if(m&&(g-=128),g===0||u+g>l)return this.parseError(3,"bad scanline data");if(m){const p=e[o++];for(let D=0;D<g;D++)f[u++]=p}else f.set(e.subarray(o,o+g),u),u+=g,o+=g}const A=r;for(let m=0;m<A;m++){let p=0;i[n]=f[m+p],p+=r,i[n+1]=f[m+p],p+=r,i[n+2]=f[m+p],p+=r,i[n+3]=f[m+p],n+=4}h--}return i}rbgeToFloat(e,t,a,r){const i=e[t+3],n=Math.pow(2,i-128)/255;a[r+0]=e[t+0]*n,a[r+1]=e[t+1]*n,a[r+2]=e[t+2]*n,a[r+3]=1}rbgeToHalfFloat(e,t,a,r){const i=e[t+3],n=Math.pow(2,i-128)/255;a[r+0]=hr(e[t+0]*n),a[r+1]=hr(e[t+1]*n),a[r+2]=hr(e[t+2]*n),a[r+3]=hr(1)}}let bf=`
|
|
7637
7637
|
struct ImageSize {
|
|
7638
7638
|
srcWidth : i32,
|
|
7639
7639
|
srcHeight : i32,
|
|
@@ -7885,10 +7885,10 @@ else if (typeof exports === 'object')
|
|
|
7885
7885
|
fragColor = vec4<f32>(res.x, res.y, 0.0, 1.0);
|
|
7886
7886
|
textureStore(brdflutTexture, vec2<i32>(fragCoord.xy), fragColor);
|
|
7887
7887
|
}
|
|
7888
|
-
`;class yf{compute;constructor(){this.compute=new ye(Uf)}generateBRDFLUTTexture(){let e=new we(256,256,se.rgba8unorm,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING);this.compute.setStorageTexture("brdflutTexture",e),this.compute.workerSizeX=256/8,this.compute.workerSizeY=256/8;let t=F.beginCommandEncoder();return F.computeCommand(t,[this.compute]),F.endCommandEncoder(t),e}}class ai{id;guiTexture;uvRec=new he(0,0,1,1);uvBorder=new he(0,0,0,0);offsetSize=new he(0,0,4,4);borderSize=new he(0,0,0,0);trimSize=new de;isSliced=!1;height=4;width=4;xadvance=0;xoffset=0;yoffset=0;constructor(e){this.guiTexture=e||_.res.defaultGUITexture}}class
|
|
7888
|
+
`;class yf{compute;constructor(){this.compute=new ye(Uf)}generateBRDFLUTTexture(){let e=new we(256,256,se.rgba8unorm,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING);this.compute.setStorageTexture("brdflutTexture",e),this.compute.workerSizeX=256/8,this.compute.workerSizeY=256/8;let t=F.beginCommandEncoder();return F.computeCommand(t,[this.compute]),F.endCommandEncoder(t),e}}class ai{id;guiTexture;uvRec=new he(0,0,1,1);uvBorder=new he(0,0,0,0);offsetSize=new he(0,0,4,4);borderSize=new he(0,0,0,0);trimSize=new de;isSliced=!1;height=4;width=4;xadvance=0;xoffset=0;yoffset=0;constructor(e){this.guiTexture=e||_.res.defaultGUITexture}}class br{static _maxUid=-1;_staticId=-1;dynamicId=-1;texture;width=1;height=1;get staticId(){return this._staticId}constructor(e){e||=_.res.whiteTexture,e.addressModeU="clamp-to-edge",e.addressModeV="clamp-to-edge",this.texture=e,br._maxUid++,this._staticId=br._maxUid,this.init()}init(){this.dynamicId=-1,this.width=this.texture.width,this.height=this.texture.height}}class H2{fntCache={};fntData={};addFontData(e,t,a){this.fntData[`${e}${t}`]=a}getFontData(e,t){return this.fntData[`${e}${t}`]}addFnt(e,t,a,r){let i=`${e}${t}`;this.fntCache[i]||(this.fntCache[i]={}),this.fntCache[i][a]=r}getFnt(e,t,a){let r=`${e}${t}`,i=this.fntCache[r];return i?i[a]:this.fntCache[" "]}}let ri=new H2;class Cf{face="";size=0;bold=!1;italic=!1;stretchH=0;spacing="";outline=0;lineHeight=0;base=0;scaleW=0;scaleH=0;pages=0;packed=0;alphaChnl=0;redChnl=0;greenChnl=0;blueChnl=0;count=0;fontPage=[];fontChar={};constructor(){}}class Sf{id=0;file=""}class xf{id=-1;x=0;y=0;width=0;height=0;xoffset=0;yoffset=0;xadvance=0;page=0;chnl=0}class $a extends it{static format=He.TEXT;static parseSprite(e,t){for(const a in t.fontChar)if(Object.prototype.hasOwnProperty.call(t.fontChar,a)){const r=t.fontChar[a];let i=new ai;i.id=r.id.toString(),i.offsetSize.set(0,0,r.width,r.height),i.trimSize.set(r.width,r.height),i.width=r.width,i.height=r.height,i.xadvance=r.xadvance,i.xoffset=r.xoffset,i.yoffset=r.yoffset,i.guiTexture=e[r.page],i.uvRec.set(r.x/t.scaleW,(t.scaleH-(r.y+r.height))/t.scaleH,r.width/t.scaleW,r.height/t.scaleH),ri.addFnt(t.face,t.size,i.id,i)}}verification(){if(this.data)return!0;throw new Error("Method not implemented.")}async parseString(e){let t=this.getNewLine(e),a=e,r=new Cf;a.trim().split(t).forEach((i,n)=>{if(n<2)$a.readLineProperty(i,r);else if(n<r.pages+2){let o=new Sf;$a.readLineProperty(i,o),r.fontPage.push(o)}else if(n<r.pages+3)$a.readLineProperty(i,r);else if(r.count>0){let o=new xf;$a.readLineProperty(i,o),r.fontChar[o.id]=o,r.count--}}),a="",this.data=r,await this.loadFontTextures()}getNewLine(e){return e.indexOf(`\r
|
|
7889
7889
|
`)!=-1?`\r
|
|
7890
7890
|
`:e.indexOf("\r")!=-1?"\r":`
|
|
7891
|
-
`}async loadFontTextures(){let e=[],t=this.data;for(const a of t.fontPage){let r=this.baseUrl+a.file;await _.res.loadTexture(r,null,!0);let i=_.res.getTexture(r),n=new gr(i);e.push(n)}$a.parseSprite(e,t),t.fontChar[" "]||$a.insertSpaceChar(t,e[0])}static insertSpaceChar(e,t){let a=new ai,r=e.size*.5,i=e.lineHeight*.5;a.id=" ",a.offsetSize.set(0,0,e.size,e.size),a.trimSize.set(r,i),a.width=r,a.height=i,a.xadvance=0,a.xoffset=0,a.yoffset=0,a.guiTexture=t,a.uvRec.set(0,0,1e-6,1e-6),ri.addFnt(e.face,e.size,a.id,a)}static readLineProperty(e,t){e.trim().split(" ").forEach((a,r)=>{let i=a.split("=");if(i.length>1){let n=i[0],o=i[1];Object.prototype.hasOwnProperty.call(t,n)&&(o.indexOf('"')==-1?t[n]=parseFloat(i[1]):t[n]=o.replace('"',"").replace('"',""))}})}}function K2(s,e){let t=new ai;return t.id=s,t.offsetSize.set(0,0,e.width,e.height),t.trimSize.set(e.width,e.height),t.width=e.width,t.height=e.height,t.xadvance=0,t.xoffset=0,t.yoffset=0,t.guiTexture=new gr(e),t.uvRec.set(0,0,1,1),e.isVideoTexture||(e.flipY=!0),t}function Ff(s,e,t){let a=new ai;a.guiTexture=s,a.id=e,a.uvRec.copyFrom(t.textureRect),a.trimSize.x=t.textureRect.z,a.trimSize.y=t.textureRect.w,a.offsetSize.x=t.textureRectOffset.x,a.offsetSize.y=t.textureRectOffset.y,a.offsetSize.z=t.size.x,a.offsetSize.w=t.size.y,a.width=t.size.x,a.height=t.size.y;let r=1/s.width,i=1/s.height;a.uvRec.set(a.uvRec.x*r,a.uvRec.y*i,a.uvRec.z*r,a.uvRec.w*i);let n=.1;return t.border.x<=n&&t.border.y<=n&&t.border.z<=n&&t.border.x<=n?a.isSliced=!1:(a.borderSize.copyFrom(t.border),a.uvBorder.copyFrom(t.border),a.uvBorder.x-=t.textureRectOffset.x,a.uvBorder.y-=t.textureRectOffset.y,a.uvBorder.z=t.border.z-(t.size.x-t.textureRect.z-t.textureRectOffset.x),a.uvBorder.w=t.border.w-(t.size.y-t.textureRect.w-t.textureRectOffset.y),a.uvBorder.x/=t.textureRect.z,a.uvBorder.z/=t.textureRect.z,a.uvBorder.y/=t.textureRect.w,a.uvBorder.w/=t.textureRect.w,a.isSliced=!0),a}class kf{_spriteMap=new Map;_spriteList=[];textureSize=new de;name;constructor(e){this.textureSize.set(e.x,e.y)}setTexture(e,t,a){let r=Ff(e,t,a);return this._spriteMap.set(r.id,r),this._spriteList.push(r),r}getSprite(e){return this._spriteMap.get(e)}get spriteList(){return this._spriteList}}class Ef extends it{static format=He.TEXT;_json;_texture;async parseString(e){this._json=JSON.parse(e);let t=this.userData.replace(".json",".png");this._texture=await _.res.loadTexture(t,null,!0),this.data={json:this._json,texture:this._texture},this.parseAtlas()}verification(){if(this.data)return!0;throw new Error("verify failed.")}parseAtlas(){let e=new kf(this._json.size),t=new gr(this._texture),a=this._json.atlas;for(const r in a)e.setTexture(t,r,a[r]);_.res.addAtlas(this.baseUrl,e),this.data=e}}var $t=Uint8Array,ii=Uint16Array,q2=Int32Array,wf=new $t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Rf=new $t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),$2=new $t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),If=function(s,e){for(var t=new ii(31),a=0;a<31;++a)t[a]=e+=1<<s[a-1];for(var r=new q2(t[30]),a=1;a<30;++a)for(var i=t[a];i<t[a+1];++i)r[i]=i-t[a]<<5|a;return{b:t,r}},Qf=If(wf,2),Tf=Qf.b,eb=Qf.r;Tf[28]=258,eb[258]=28;for(var tb=If(Rf,0),ab=tb.b,eo=new ii(32768),je=0;je<32768;++je){var mr=(je&43690)>>1|(je&21845)<<1;mr=(mr&52428)>>2|(mr&13107)<<2,mr=(mr&61680)>>4|(mr&3855)<<4,eo[je]=((mr&65280)>>8|(mr&255)<<8)>>1}for(var Ri=(function(s,e,t){for(var a=s.length,r=0,i=new ii(e);r<a;++r)s[r]&&++i[s[r]-1];var n=new ii(e);for(r=1;r<e;++r)n[r]=n[r-1]+i[r-1]<<1;var o;if(t){o=new ii(1<<e);var l=15-e;for(r=0;r<a;++r)if(s[r])for(var c=r<<4|s[r],f=e-s[r],h=n[s[r]-1]++<<f,u=h|(1<<f)-1;h<=u;++h)o[eo[h]>>l]=c}else for(o=new ii(a),r=0;r<a;++r)s[r]&&(o[r]=eo[n[s[r]-1]++]>>15-s[r]);return o}),Ii=new $t(288),je=0;je<144;++je)Ii[je]=8;for(var je=144;je<256;++je)Ii[je]=9;for(var je=256;je<280;++je)Ii[je]=7;for(var je=280;je<288;++je)Ii[je]=8;for(var Mf=new $t(32),je=0;je<32;++je)Mf[je]=5;var rb=Ri(Ii,9,1),ib=Ri(Mf,5,1),to=function(s){for(var e=s[0],t=1;t<s.length;++t)s[t]>e&&(e=s[t]);return e},va=function(s,e,t){var a=e/8|0;return(s[a]|s[a+1]<<8)>>(e&7)&t},ao=function(s,e){var t=e/8|0;return(s[t]|s[t+1]<<8|s[t+2]<<16)>>(e&7)},nb=function(s){return(s+7)/8|0},ro=function(s,e,t){return(e==null||e<0)&&(e=0),(t==null||t>s.length)&&(t=s.length),new $t(s.subarray(e,t))},sb=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],la=function(s,e,t){var a=new Error(e||sb[s]);if(a.code=s,Error.captureStackTrace&&Error.captureStackTrace(a,la),!t)throw a;return a},ob=function(s,e,t,a){var r=s.length,i=a?a.length:0;if(!r||e.f&&!e.l)return t||new $t(0);var n=!t,o=n||e.i!=2,l=e.i;n&&(t=new $t(r*3));var c=function(ne){var ce=t.length;if(ne>ce){var ue=new $t(Math.max(ce*2,ne));ue.set(t),t=ue}},f=e.f||0,h=e.p||0,u=e.b||0,g=e.l,A=e.d,m=e.m,p=e.n,D=r*8;do{if(!g){f=va(s,h,1);var B=va(s,h+1,3);if(h+=3,B)if(B==1)g=rb,A=ib,m=9,p=5;else if(B==2){var x=va(s,h,31)+257,k=va(s,h+10,15)+4,E=x+va(s,h+5,31)+1;h+=14;for(var S=new $t(E),Q=new $t(19),I=0;I<k;++I)Q[$2[I]]=va(s,h+I*3,7);h+=k*3;for(var T=to(Q),M=(1<<T)-1,Z=Ri(Q,T,1),I=0;I<E;){var be=Z[va(s,h,M)];h+=be&15;var v=be>>4;if(v<16)S[I++]=v;else{var re=0,P=0;for(v==16?(P=3+va(s,h,3),h+=2,re=S[I-1]):v==17?(P=3+va(s,h,7),h+=3):v==18&&(P=11+va(s,h,127),h+=7);P--;)S[I++]=re}}var z=S.subarray(0,x),H=S.subarray(x);m=to(z),p=to(H),g=Ri(z,m,1),A=Ri(H,p,1)}else la(1);else{var v=nb(h)+4,C=s[v-4]|s[v-3]<<8,y=v+C;if(y>r){l&&la(0);break}o&&c(u+C),t.set(s.subarray(v,y),u),e.b=u+=C,e.p=h=y*8,e.f=f;continue}if(h>D){l&&la(0);break}}o&&c(u+131072);for(var O=(1<<m)-1,ie=(1<<p)-1,W=h;;W=h){var re=g[ao(s,h)&O],$=re>>4;if(h+=re&15,h>D){l&&la(0);break}if(re||la(2),$<256)t[u++]=$;else if($==256){W=h,g=null;break}else{var ee=$-254;if($>264){var I=$-257,oe=wf[I];ee=va(s,h,(1<<oe)-1)+Tf[I],h+=oe}var fe=A[ao(s,h)&ie],De=fe>>4;fe||la(3),h+=fe&15;var H=ab[De];if(De>3){var oe=Rf[De];H+=ao(s,h)&(1<<oe)-1,h+=oe}if(h>D){l&&la(0);break}o&&c(u+131072);var Ne=u+ee;if(u<H){var Ke=i-H,q=Math.min(H,Ne);for(Ke+u<0&&la(3);u<q;++u)t[u]=a[Ke+u]}for(;u<Ne;++u)t[u]=t[u-H]}}e.l=g,e.p=W,e.b=u,e.f=f,g&&(f=1,e.m=m,e.d=A,e.n=p)}while(!f);return u!=t.length&&n?ro(t,0,u):t.subarray(0,u)},lb=new $t(0),Na=function(s,e){return s[e]|s[e+1]<<8},Ua=function(s,e){return(s[e]|s[e+1]<<8|s[e+2]<<16|s[e+3]<<24)>>>0},io=function(s,e){return Ua(s,e)+Ua(s,e+4)*4294967296};function cb(s,e){return ob(s,{i:2},e&&e.out,e&&e.dictionary)}var no=typeof TextDecoder<"u"&&new TextDecoder,fb=0;try{no.decode(lb,{stream:!0}),fb=1}catch{}var db=function(s){for(var e="",t=0;;){var a=s[t++],r=(a>127)+(a>223)+(a>239);if(t+r>s.length)return{s:e,r:ro(s,t-1)};r?r==3?(a=((a&15)<<18|(s[t++]&63)<<12|(s[t++]&63)<<6|s[t++]&63)-65536,e+=String.fromCharCode(55296|a>>10,56320|a&1023)):r&1?e+=String.fromCharCode((a&31)<<6|s[t++]&63):e+=String.fromCharCode((a&15)<<12|(s[t++]&63)<<6|s[t++]&63):e+=String.fromCharCode(a)}};function Nf(s,e){if(e){for(var t="",a=0;a<s.length;a+=16384)t+=String.fromCharCode.apply(null,s.subarray(a,a+16384));return t}else{if(no)return no.decode(s);var r=db(s),i=r.s,t=r.r;return t.length&&la(8),i}}var hb=function(s,e){return e+30+Na(s,e+26)+Na(s,e+28)},ub=function(s,e,t){var a=Na(s,e+28),r=Nf(s.subarray(e+46,e+46+a),!(Na(s,e+8)&2048)),i=e+46+a,n=Ua(s,e+20),o=t&&n==4294967295?bb(s,i):[n,Ua(s,e+24),Ua(s,e+42)],l=o[0],c=o[1],f=o[2];return[Na(s,e+10),l,c,r,i+Na(s,e+30)+Na(s,e+32),f]},bb=function(s,e){for(;Na(s,e)!=1;e+=4+Na(s,e+2));return[io(s,e+12),io(s,e+4),io(s,e+20)]};function gb(s,e){for(var t={},a=s.length-22;Ua(s,a)!=101010256;--a)(!a||s.length-a>65558)&&la(13);var r=Na(s,a+8);if(!r)return{};var i=Ua(s,a+16),n=i==4294967295||r==65535;if(n){var o=Ua(s,a-12);n=Ua(s,o)==101075792,n&&(r=Ua(s,o+32),i=Ua(s,o+48))}for(var l=0;l<r;++l){var c=ub(s,i,n),f=c[0],h=c[1],u=c[2],g=c[3],A=c[4],m=c[5],p=hb(s,m);i=A,f?f==8?t[g]=cb(s.subarray(p,p+h),{out:new $t(u)}):la(14,"unknown compression type "+f):t[g]=ro(s,p,p+h)}return t}class Bt extends Dt{constructor(){super(),this.shader=new d.UnLitShader,this.baseMap=_.res.whiteTexture}set baseMap(e){this.shader.setTexture("baseMap",e)}get baseMap(){return this.shader.getTexture("baseMap")}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set envMap(e){}set shadowMap(e){}}class Ir extends Ve{shape_vertices=[];shape_indices=[];radius;widthSegments;heightSegments;phiStart;phiLength;thetaStart;thetaLength;constructor(e,t,a,r,i,n,o){super(),this.radius=e,this.widthSegments=t,this.heightSegments=a,this.phiStart=r,this.phiLength=i,this.thetaStart=n,this.thetaLength=o,this.buildGeometry()}buildGeometry(){var e,t,a=0;let r=this.heightSegments,i=this.widthSegments,n=this.radius;var o=(r+1)*(i+1);let l=new Float32Array(o*3),c=new Float32Array(o*3),f=new Float32Array(o*2),h=new Uint16Array(i*r*2*3),u=0,g=0,A=0;for(t=0;t<=r;++t){var m=Math.PI*t/r,p=n*Math.cos(m),D=n*Math.sin(m);for(e=0;e<=i;++e){var B=2*Math.PI*e/i,v=D*Math.cos(B),C=D*Math.sin(B),y=1/Math.sqrt(v*v+p*p+C*C);if(l[u++]=v,l[u++]=p,l[u++]=C,c[g++]=v*y,c[g++]=p*y,c[g++]=C*y,f[A++]=e/i,f[A++]=t/r,e>0&&t>0){var x=(i+1)*t+e,k=(i+1)*t+e-1,E=(i+1)*(t-1)+e-1,S=(i+1)*(t-1)+e;t==r?(h[a++]=x,h[a++]=E,h[a++]=S):t==1?(h[a++]=x,h[a++]=k,h[a++]=E):(h[a++]=x,h[a++]=k,h[a++]=E,h[a++]=x,h[a++]=E,h[a++]=S)}}}this.setIndices(h),this.setAttribute(G.position,l),this.setAttribute(G.normal,c),this.setAttribute(G.uv,f),this.setAttribute(G.TEXCOORD_1,f),this.addSubGeometry({indexStart:0,indexCount:h.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0}),this.bounds=new xe(b.ZERO,new b(this.radius*2,this.radius*2,this.radius*2))}}class Qi extends d.Object3D{static register3DRepresentation=null;positionIndex=-1;positionValid=!1;marker;constructor(e){super(),this.parsePlacemark(e),this.setup3DRepresentation()}parsePlacemark(e){if(!e.slamPositionInfo){console.warn("WayPoint3D: slamPositionInfo is not found");return}const t=e.slamPositionInfo.slamPosition.split(",").map(Number);this.localPosition=new b(t[0],t[1],t[2]),this.positionIndex=Number(e.slamPositionInfo.slamPositionIndex),this.positionValid=e.slamPositionInfo.slamPositionValid==="1"}setup3DRepresentation(){if(this.marker&&(this.removeChild(this.marker),this.marker=null),Qi.register3DRepresentation)this.marker=Qi.register3DRepresentation(this),this.marker&&this.addChild(this.marker);else{this.marker=new d.Object3D;const e=this.marker.addComponent(d.MeshRenderer);e.geometry=new Ir(.1,32,16),e.material=new Bt,e.material.baseColor=this.positionValid?new J(0,1,0,1):new J(1,0,0,1),this.addChild(this.marker),this.marker.name="WayPoint3DMarker"}}}class Ti extends d.Object3D{static register3DRepresentation=null;line;constructor(e){super(),this.parseWayLineFile(e),this.setup3DRepresentation()}parseWayLineFile(e){for(const t of e.Folder.Placemark){const a=new Qi(t);this.addChild(a)}this.entityChildren=this.entityChildren.sort((t,a)=>t.positionIndex-a.positionIndex)}setup3DRepresentation(){this.line&&(this.removeChild(this.line),this.line=null),Ti.register3DRepresentation?(this.line=Ti.register3DRepresentation(this),this.line&&this.addChild(this.line)):(this.line=this.createMultiLine(this.entityChildren.map(e=>e.localPosition),new J(1,1,1,1)),this.addChild(this.line),this.line.name="WayLines3DLine")}createMultiLine(e,t){if(e.length<2)return null;const a=new Ve,r=new Float32Array(e.length*3);for(let c=0;c<e.length;c++)r[c*3]=e[c].x,r[c*3+1]=e[c].y,r[c*3+2]=e[c].z;const i=new Uint16Array((e.length-1)*2);for(let c=0;c<e.length-1;c++)i[c*2]=c,i[c*2+1]=c+1;a.setIndices(i),a.setAttribute(G.position,r),a.addSubGeometry({indexStart:0,indexCount:i.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0});const n=new d.Object3D,o=n.addComponent(d.MeshRenderer),l=new Bt;return l.topology="line-list",l.baseColor=t,l.blendMode=me.ADD,l.castReflection=!1,o.geometry=a,o.material=l,n}}class Pf extends it{static format=He.BIN;parseBuffer(e){try{const t={template:null,waylines:null},a=gb(new Uint8Array(e));for(const i in a){const n=a[i],l=new DOMParser().parseFromString(Nf(n),"application/xml"),c={};this.parseNode(l,c);const f=i.replace("wpmz/","").split(".")[0];Object.assign(t,{[f]:c["#document"].kml.Document})}const r=new Ti(t.waylines);this.data=r}catch(t){this.parserError(`KMZ parsing failed: ${t}`,-1)}}parseNode(e,t){const a=["Placemark","actionGroup","action"],r=e.nodeName.replace("wpml:","");if(!e.childNodes.length)t[r]=void 0;else{let i=null,n=!1;for(let o=0;o<e.childNodes.length;++o){const l=e.childNodes[o];if(l.nodeType==Node.TEXT_NODE){const c=l.nodeValue?.trim();c&&c.length>0&&(i=c)}else l.nodeType==Node.ELEMENT_NODE&&(n=!0)}if(i&&!n)t[r]=i;else if(n){a.includes(r)?t[r]?.length?t[r].push({}):t[r]=[{}]:t[r]={};for(let o=0;o<e.childNodes.length;++o){const l=e.childNodes[o];l.nodeType==Node.ELEMENT_NODE&&this.parseNode(l,Array.isArray(t[r])?t[r].at(-1):t[r])}}else t[r]=void 0}}verification(){if(this.data)return!0;throw new Error("verify failed.")}}class Vf{_texturePool;_materialPool;_prefabPool;_gltfPool;_geometryPool;_atlasList;_obj;constructor(){this._texturePool=new Map,this._materialPool=new Map,this._prefabPool=new Map,this._geometryPool=new Map,this._gltfPool=new Map,this._atlasList=new Map,this._obj=new Map}getGltf(e){return this._gltfPool.get(e)}addObj(e,t){this._obj.set(e,t)}getObj(e){return this._obj.get(e)}addTexture(e,t){this._texturePool.set(e,t)}getTexture(e){return this._texturePool.get(e)}addGeometry(e,t){this._geometryPool.set(e,t)}getGeometry(e){return this._geometryPool.get(e)}addMat(e,t){return this._materialPool.set(e,t)}getMat(e){return this._materialPool.get(e)}addPrefab(e,t){this._prefabPool.set(e,t)}getPrefab(e){return this._prefabPool.get(e).instantiate()}addAtlas(e,t){t.name=e,this._atlasList.set(e,t)}getAtlas(e){return this._atlasList.get(e)}getGUISprite(e){for(let t of this._atlasList.values()){let a=t.getSprite(e);if(a)return a}return null}async load(e,t,a){return(await new It().load(e,t,a)).data}async loadGltf(e,t){if(this._prefabPool.has(e))return this._prefabPool.get(e);let a,r=e.substring(e.lastIndexOf(".")).toLowerCase(),i=new It;r==".gltf"?a=await i.load(e,_t,t):a=await i.load(e,zs,t);let n=a.data;return this._prefabPool.set(e,n),this._gltfPool.set(e,a.gltf),n}async loadObj(e,t){if(this._prefabPool.has(e))return this._prefabPool.get(e);let a,r=e.substring(e.lastIndexOf(".")).toLowerCase(),i=new It;r==".obj"&&(a=await i.load(e,sf,t));let n=a.data;return this._prefabPool.set(e,n),n}async loadB3DM(e,t,a){if(this._prefabPool.has(e))return this._prefabPool.get(e);let n=(await new It().load(e,Hs,t,a)).data;return this._prefabPool.set(e,n),n}async loadI3DM(e,t,a){if(this._prefabPool.has(e))return this._prefabPool.get(e);let n=(await new It().load(e,$s,t,a)).data;return this._prefabPool.set(e,n),n}async loadTexture(e,t,a){if(this._texturePool.has(e))return this._texturePool.get(e);let r=new Ka;r.flipY=a;try{await r.load(e,t)}catch(i){return console.error(`Failed to load texture: ${e}`,i),null}return this._texturePool.set(e,r),r}destroyTexture(e){const t=this._texturePool.get(e);return t?Ce.getInstance().hasReference(t)?!1:(t.isDestroyed||t.destroy(),this._texturePool.delete(e),!0):!1}destroyTextureAllUnUsed(){for(const[e,t]of this._texturePool.entries())this.destroyTexture(e)}async loadTextureCount(e,t,a,r){return new Promise(async(i,n)=>{let o=0,l=[];t==0&&i(l);for(let c=0;c<t;c++){const f=e.shift();this.loadTexture(f,a,r).then(h=>{l.push(h),o++,o==t&&i(l)})}})}async loadBitmapTextures(e,t=5,a,r){let i=[],n=Math.floor(e.length/t)+1,o=Math.floor(e.length%t);for(let l=0;l<n;l++){let c=await this.loadTextureCount(e,l==n-1?o:t,a,r);i.push(...c)}return i}async loadHDRTexture(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let a=new js;return a=await a.load(e,t),this._texturePool.set(e,a),a}async loadHDRTextureCube(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let a=new yn;return a=await a.load(e,t),this._texturePool.set(e,a),a}async loadLDRTextureCube(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let a=new Sn;return a=await a.load(e,t),this._texturePool.set(e,a),a}async loadTextureCubeMaps(e){let t=e[0];if(this._texturePool.has(t))return this._texturePool.get(t);let a=new Ws;return await a.load(e),this._texturePool.set(e[0],a),a}async loadTextureCubeStd(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let a=new Ws;return await a.loadStd(e),a}async loadJSON(e,t){return await new It().loadJson(e,t).then(async a=>a).catch(a=>{console.log(a)})}async loadFont(e,t,a){let i=await new It().load(e,$a,t,a),n=i.data;return ri.addFontData(n.face,n.size,n),i.data}async loadAtlas(e,t){return(await new It().load(e,Ef,t,e)).data}async loadKMZ(e,t){return(await new It().load(e,Pf,t)).data}normalTexture;maskTexture;whiteTexture;blackTexture;redTexture;blueTexture;greenTexture;yellowTexture;grayTexture;defaultSky;defaultGUITexture;defaultGUISprite;defaultMaterial;createTexture(e,t,a,r,i,n,o){let l=32,c=32,f=new Uint8Array(l*c*4);this.fillColor(f,e,t,a,r,i,n);let h=new pn;return h.name=o,h.create(16,16,f,!0),o&&this.addTexture(o,h),h}fillColor(e,t,a,r,i,n,o){for(let l=0;l<t;l++)for(let c=0;c<a;c++){let f=c*t+l;e[f*4+0]=r,e[f*4+1]=i,e[f*4+2]=n,e[f*4+3]=o}}initDefault(){this.normalTexture=this.createTexture(32,32,255*.5,255*.5,255,255,"default-normalTexture"),this.maskTexture=this.createTexture(32,32,255,255*.5,255,255,"default-maskTexture"),this.whiteTexture=this.createTexture(32,32,255,255,255,255,"default-whiteTexture"),this.blackTexture=this.createTexture(32,32,0,0,0,255,"default-blackTexture"),this.redTexture=this.createTexture(32,32,255,0,0,255,"default-redTexture"),this.blueTexture=this.createTexture(32,32,0,0,255,255,"default-blueTexture"),this.greenTexture=this.createTexture(32,32,0,255,0,255,"default-greenTexture"),this.yellowTexture=this.createTexture(32,32,0,255,255,255,"default-yellowTexture"),this.grayTexture=this.createTexture(32,32,128,128,128,255,"default-grayTexture");let t=new yf().generateBRDFLUTTexture(),a=t.name="BRDFLUT";this.addTexture(a,t),this.defaultSky=new yn,this.defaultSky.createFromTexture(128,this.blackTexture),Ce.getInstance().attached(this.defaultSky,this),Ce.getInstance().attached(t,this),Ce.getInstance().attached(this.normalTexture,this),Ce.getInstance().attached(this.maskTexture,this),Ce.getInstance().attached(this.whiteTexture,this),Ce.getInstance().attached(this.blackTexture,this),Ce.getInstance().attached(this.redTexture,this),Ce.getInstance().attached(this.blueTexture,this),Ce.getInstance().attached(this.greenTexture,this),Ce.getInstance().attached(this.yellowTexture,this),Ce.getInstance().attached(this.grayTexture,this),this.defaultGUITexture=new gr(this.whiteTexture),this.defaultGUISprite=new ai(this.defaultGUITexture),this.defaultGUISprite.trimSize.set(4,4),this.defaultMaterial=new qt}}class Of extends qe{_postList;init(e){this._postList=new Map}start(){}stop(){}onEnable(){this.activePost()}onDisable(){this.unActivePost()}activePost(){let e=this.transform.view3D,t=_.getRenderJob(e);this._postList.forEach(a=>{t.addPost(a)})}unActivePost(){let e=this.transform.view3D,t=_.getRenderJob(e);this._postList.forEach(a=>{t.removePost(a)})}addPost(e){if(this._postList.has(e))return;let t=new e;return this._postList.set(e,t),this._enable&&this.activePost(),t}removePost(e){if(!this._postList.has(e))return;let t=this._postList.get(e);this._postList.delete(e);let a=this.transform.view3D;_.getRenderJob(a).removePost(t)}getPost(e){return this._postList.has(e)?this._postList.get(e):null}}const mb="1.0.31";class _{static res;static inputSystem;static views;static _frameRateValue=0;static _frameRate=360;static _time=0;static _beforeRender;static _renderLoop;static _lateRender;static _requestAnimationFrameID=0;static get frameRate(){return this._frameRate}static set frameRate(e){this._frameRate=e,this._frameRateValue=1e3/e,e>=360&&(this._frameRateValue=0)}static get size(){return w.presentationSize}static get aspect(){return w.aspect}static get width(){return w.windowWidth}static get height(){return w.windowHeight}static setting={doublePrecision:!1,occlusionQuery:{enable:!0,debug:!1},pick:{enable:!0,mode:"bound",detail:"mesh"},render:{debug:!1,renderPassState:4,renderState_left:5,renderState_right:5,renderState_split:.5,quadScale:1,hdrExposure:1.5,debugQuad:-1,maxPointLight:1e3,maxDirectLight:4,maxSportLight:1e3,drawOpMin:0,drawOpMax:Number.MAX_SAFE_INTEGER,drawTrMin:0,drawTrMax:Number.MAX_SAFE_INTEGER,zPrePass:!1,useLogDepth:!1,useCompressGBuffer:!1,gi:!1,postProcessing:{bloom:{downSampleStep:3,downSampleBlurSize:9,downSampleBlurSigma:1,upSampleBlurSize:9,upSampleBlurSigma:1,luminanceThreshole:1,bloomIntensity:1,hdr:1},globalFog:{debug:!1,enable:!1,fogType:0,fogHeightScale:.1,start:400,end:10,density:.02,ins:.5,skyFactor:.5,skyRoughness:.4,overrideSkyFactor:.8,fogColor:new J(96/255,117/255,133/255,1),falloff:.7,rayLength:200,scatteringExponent:2.7,dirHeightLine:10},godRay:{blendColor:!0,rayMarchCount:16,scatteringExponent:5,intensity:.5},ssao:{enable:!1,radius:.15,bias:-.1,aoPower:2,debug:!0},outline:{enable:!1,strength:1,groupCount:4,outlinePixel:2,fadeOutlinePixel:4,textureScale:1,useAddMode:!1,debug:!0},taa:{enable:!1,jitterSeedCount:8,blendFactor:.1,sharpFactor:.6,sharpPreBlurFactor:.5,temporalJitterScale:.13,debug:!0},gtao:{enable:!1,darkFactor:1,maxDistance:5,maxPixel:50,rayMarchSegment:6,multiBounce:!1,usePosFloat32:!0,blendColor:!0,debug:!0},ssr:{enable:!1,pixelRatio:1,fadeEdgeRatio:.2,rayMarchRatio:.5,fadeDistanceMin:600,fadeDistanceMax:2e3,roughnessThreshold:.5,powDotRN:.2,mixThreshold:.1,debug:!0},fxaa:{enable:!1},depthOfView:{enable:!1,iterationCount:3,pixelOffset:1,near:150,far:300}}},shadow:{enable:!0,type:"HARD",pointShadowBias:5e-4,shadowSize:2048,pointShadowSize:1024,shadowSoft:.005,shadowBound:100,shadowBias:.05,needUpdate:!0,autoUpdate:!0,updateFrameRate:2,csmMargin:.1,csmScatteringExp:.7,csmAreaScale:.4,debug:!1},gi:{enable:!1,offsetX:0,offsetY:0,offsetZ:0,probeSpace:64,probeXCount:4,probeYCount:2,probeZCount:4,probeSize:32,probeSourceTextureSize:2048,octRTMaxSize:2048,octRTSideSize:16,maxDistance:64*1.73,normalBias:.25,depthSharpness:1,hysteresis:.98,lerpHysteresis:.01,irradianceChebyshevBias:.01,rayNumber:144,irradianceDistanceBias:32,indirectIntensity:1,ddgiGamma:2.2,bounceIntensity:.025,probeRoughness:1,realTimeGI:!1,debug:!1,autoRenderProbe:!1},sky:{type:"HDRSKY",sky:null,skyExposure:1,defaultFar:65536,defaultNear:1},light:{maxLight:4096},material:{materialChannelDebug:!1,materialDebug:!1},loader:{numConcurrent:20},reflectionSetting:{reflectionProbeMaxCount:8,reflectionProbeSize:256,width:256*6,height:8*256,enable:!0}};static renderJobs;static async init(e={}){console.log("Rings Version",mb),window.isSecureContext||console.warn("WebGPU is only supported in secure contexts (HTTPS or localhost)"),this.setting={...this.setting,...e.engineSetting},await Ee.init(R.allocCount,this.setting.doublePrecision),await w.init(e.canvasConfig),this.setting.reflectionSetting.width=this.setting.reflectionSetting.reflectionProbeSize*6,this.setting.reflectionSetting.height=this.setting.reflectionSetting.reflectionProbeSize*this.setting.reflectionSetting.reflectionProbeMaxCount,_e.getGBufferFrame(_e.reflections_GBuffer,this.setting.reflectionSetting.width,this.setting.reflectionSetting.height,!1),Y.init(),Ha.init(),ve.init(),Et.init(),Wt.init(),this.res=new Vf,this.res.initDefault(),this._beforeRender=e.beforeRender,this._renderLoop=e.renderLoop,this._lateRender=e.lateRender,this.inputSystem=new Xo,this.inputSystem.initCanvas(w.canvas)}static startRenderJob(e){let t=new T0(e);return this.renderJobs.set(e,t),this.setting.pick.mode=="pixel"&&e.scene.getOrAddComponent(Of).addPost(ks),(this.setting.pick.mode=="pixel"||this.setting.pick.mode=="bound")&&(e.enablePick=!0),t}static startRenderView(e){this.renderJobs||=new Map,this.views=[e];let t=this.startRenderJob(e);return this.resume(),t}static startRenderViews(e){this.renderJobs||=new Map,this.views=e;for(let t=0;t<e.length;t++)this.startRenderJob(e[t]);this.resume()}static getRenderJob(e){return this.renderJobs.get(e)}static pause(){this._requestAnimationFrameID!==0&&(cancelAnimationFrame(this._requestAnimationFrameID),this._requestAnimationFrameID=0)}static resume(){this._requestAnimationFrameID===0&&(this._requestAnimationFrameID=requestAnimationFrame(e=>this.render(e)))}static async render(e){if(this._frameRateValue>0){let t=e-this._time;if(t<this._frameRateValue){let a=performance.now();await new Promise(r=>{setTimeout(()=>{e+=performance.now()-a,r(!0)},this._frameRateValue-t)})}this._time=e}await this.updateFrame(e),this._requestAnimationFrameID=0,this.resume()}static async updateFrame(e){Le.delta=e-Le.time,Le.time=e,Le.frame+=1,br.tick(Le.delta);let t=this.views,a=0;for(a=0;a<t.length;a++){const n=t[a];n.scene.waitUpdate();let[o,l]=w.presentationSize;n.camera.viewPort.setTo(0,0,o,l)}this._beforeRender&&await this._beforeRender();for(const n of Pe.componentsBeforeUpdateList){let o=n[0],l=n[1];for(const c of l){let f=c[0],h=c[1];f.enable&&h(o)}}let r=w.device.createCommandEncoder();for(const n of Pe.componentsComputeList){let o=n[0],l=n[1];for(const c of l){let f=c[0],h=c[1];f.enable&&h(o,r)}}w.device.queue.submit([r.finish()]);for(const n of Pe.componentsUpdateList){let o=n[0],l=n[1];for(const c of l){let f=c[0],h=c[1];f.enable&&h(o)}}for(const n of Pe.graphicComponent){let o=n[0],l=n[1];for(const c of l){let f=c[0],h=c[1];o&&f.enable&&h(o)}}this._renderLoop&&await this._renderLoop(),Ee.updateAllContinueTransform(0,R.useCount,16),ve.modelMatrixBindGroup.writeBuffer(R.useCount*16),this.renderJobs.forEach((n,o)=>{n.renderState||n.start(),n.renderFrame()});for(const n of Pe.componentsLateUpdateList){let o=n[0],l=n[1];for(const c of l){let f=c[0],h=c[1];f.enable&&h(o)}}this._lateRender&&await this._lateRender()}}let xn=`
|
|
7891
|
+
`}async loadFontTextures(){let e=[],t=this.data;for(const a of t.fontPage){let r=this.baseUrl+a.file;await _.res.loadTexture(r,null,!0);let i=_.res.getTexture(r),n=new br(i);e.push(n)}$a.parseSprite(e,t),t.fontChar[" "]||$a.insertSpaceChar(t,e[0])}static insertSpaceChar(e,t){let a=new ai,r=e.size*.5,i=e.lineHeight*.5;a.id=" ",a.offsetSize.set(0,0,e.size,e.size),a.trimSize.set(r,i),a.width=r,a.height=i,a.xadvance=0,a.xoffset=0,a.yoffset=0,a.guiTexture=t,a.uvRec.set(0,0,1e-6,1e-6),ri.addFnt(e.face,e.size,a.id,a)}static readLineProperty(e,t){e.trim().split(" ").forEach((a,r)=>{let i=a.split("=");if(i.length>1){let n=i[0],o=i[1];Object.prototype.hasOwnProperty.call(t,n)&&(o.indexOf('"')==-1?t[n]=parseFloat(i[1]):t[n]=o.replace('"',"").replace('"',""))}})}}function K2(s,e){let t=new ai;return t.id=s,t.offsetSize.set(0,0,e.width,e.height),t.trimSize.set(e.width,e.height),t.width=e.width,t.height=e.height,t.xadvance=0,t.xoffset=0,t.yoffset=0,t.guiTexture=new br(e),t.uvRec.set(0,0,1,1),e.isVideoTexture||(e.flipY=!0),t}function Ff(s,e,t){let a=new ai;a.guiTexture=s,a.id=e,a.uvRec.copyFrom(t.textureRect),a.trimSize.x=t.textureRect.z,a.trimSize.y=t.textureRect.w,a.offsetSize.x=t.textureRectOffset.x,a.offsetSize.y=t.textureRectOffset.y,a.offsetSize.z=t.size.x,a.offsetSize.w=t.size.y,a.width=t.size.x,a.height=t.size.y;let r=1/s.width,i=1/s.height;a.uvRec.set(a.uvRec.x*r,a.uvRec.y*i,a.uvRec.z*r,a.uvRec.w*i);let n=.1;return t.border.x<=n&&t.border.y<=n&&t.border.z<=n&&t.border.x<=n?a.isSliced=!1:(a.borderSize.copyFrom(t.border),a.uvBorder.copyFrom(t.border),a.uvBorder.x-=t.textureRectOffset.x,a.uvBorder.y-=t.textureRectOffset.y,a.uvBorder.z=t.border.z-(t.size.x-t.textureRect.z-t.textureRectOffset.x),a.uvBorder.w=t.border.w-(t.size.y-t.textureRect.w-t.textureRectOffset.y),a.uvBorder.x/=t.textureRect.z,a.uvBorder.z/=t.textureRect.z,a.uvBorder.y/=t.textureRect.w,a.uvBorder.w/=t.textureRect.w,a.isSliced=!0),a}class kf{_spriteMap=new Map;_spriteList=[];textureSize=new de;name;constructor(e){this.textureSize.set(e.x,e.y)}setTexture(e,t,a){let r=Ff(e,t,a);return this._spriteMap.set(r.id,r),this._spriteList.push(r),r}getSprite(e){return this._spriteMap.get(e)}get spriteList(){return this._spriteList}}class Ef extends it{static format=He.TEXT;_json;_texture;async parseString(e){this._json=JSON.parse(e);let t=this.userData.replace(".json",".png");this._texture=await _.res.loadTexture(t,null,!0),this.data={json:this._json,texture:this._texture},this.parseAtlas()}verification(){if(this.data)return!0;throw new Error("verify failed.")}parseAtlas(){let e=new kf(this._json.size),t=new br(this._texture),a=this._json.atlas;for(const r in a)e.setTexture(t,r,a[r]);_.res.addAtlas(this.baseUrl,e),this.data=e}}var $t=Uint8Array,ii=Uint16Array,q2=Int32Array,wf=new $t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Rf=new $t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),$2=new $t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),If=function(s,e){for(var t=new ii(31),a=0;a<31;++a)t[a]=e+=1<<s[a-1];for(var r=new q2(t[30]),a=1;a<30;++a)for(var i=t[a];i<t[a+1];++i)r[i]=i-t[a]<<5|a;return{b:t,r}},Qf=If(wf,2),Tf=Qf.b,eb=Qf.r;Tf[28]=258,eb[258]=28;for(var tb=If(Rf,0),ab=tb.b,eo=new ii(32768),je=0;je<32768;++je){var gr=(je&43690)>>1|(je&21845)<<1;gr=(gr&52428)>>2|(gr&13107)<<2,gr=(gr&61680)>>4|(gr&3855)<<4,eo[je]=((gr&65280)>>8|(gr&255)<<8)>>1}for(var Ri=(function(s,e,t){for(var a=s.length,r=0,i=new ii(e);r<a;++r)s[r]&&++i[s[r]-1];var n=new ii(e);for(r=1;r<e;++r)n[r]=n[r-1]+i[r-1]<<1;var o;if(t){o=new ii(1<<e);var l=15-e;for(r=0;r<a;++r)if(s[r])for(var c=r<<4|s[r],f=e-s[r],h=n[s[r]-1]++<<f,u=h|(1<<f)-1;h<=u;++h)o[eo[h]>>l]=c}else for(o=new ii(a),r=0;r<a;++r)s[r]&&(o[r]=eo[n[s[r]-1]++]>>15-s[r]);return o}),Ii=new $t(288),je=0;je<144;++je)Ii[je]=8;for(var je=144;je<256;++je)Ii[je]=9;for(var je=256;je<280;++je)Ii[je]=7;for(var je=280;je<288;++je)Ii[je]=8;for(var Mf=new $t(32),je=0;je<32;++je)Mf[je]=5;var rb=Ri(Ii,9,1),ib=Ri(Mf,5,1),to=function(s){for(var e=s[0],t=1;t<s.length;++t)s[t]>e&&(e=s[t]);return e},va=function(s,e,t){var a=e/8|0;return(s[a]|s[a+1]<<8)>>(e&7)&t},ao=function(s,e){var t=e/8|0;return(s[t]|s[t+1]<<8|s[t+2]<<16)>>(e&7)},nb=function(s){return(s+7)/8|0},ro=function(s,e,t){return(e==null||e<0)&&(e=0),(t==null||t>s.length)&&(t=s.length),new $t(s.subarray(e,t))},sb=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],la=function(s,e,t){var a=new Error(e||sb[s]);if(a.code=s,Error.captureStackTrace&&Error.captureStackTrace(a,la),!t)throw a;return a},ob=function(s,e,t,a){var r=s.length,i=a?a.length:0;if(!r||e.f&&!e.l)return t||new $t(0);var n=!t,o=n||e.i!=2,l=e.i;n&&(t=new $t(r*3));var c=function(ne){var ce=t.length;if(ne>ce){var ue=new $t(Math.max(ce*2,ne));ue.set(t),t=ue}},f=e.f||0,h=e.p||0,u=e.b||0,g=e.l,A=e.d,m=e.m,p=e.n,D=r*8;do{if(!g){f=va(s,h,1);var B=va(s,h+1,3);if(h+=3,B)if(B==1)g=rb,A=ib,m=9,p=5;else if(B==2){var x=va(s,h,31)+257,k=va(s,h+10,15)+4,E=x+va(s,h+5,31)+1;h+=14;for(var S=new $t(E),Q=new $t(19),I=0;I<k;++I)Q[$2[I]]=va(s,h+I*3,7);h+=k*3;for(var T=to(Q),M=(1<<T)-1,Z=Ri(Q,T,1),I=0;I<E;){var be=Z[va(s,h,M)];h+=be&15;var v=be>>4;if(v<16)S[I++]=v;else{var re=0,P=0;for(v==16?(P=3+va(s,h,3),h+=2,re=S[I-1]):v==17?(P=3+va(s,h,7),h+=3):v==18&&(P=11+va(s,h,127),h+=7);P--;)S[I++]=re}}var z=S.subarray(0,x),H=S.subarray(x);m=to(z),p=to(H),g=Ri(z,m,1),A=Ri(H,p,1)}else la(1);else{var v=nb(h)+4,C=s[v-4]|s[v-3]<<8,y=v+C;if(y>r){l&&la(0);break}o&&c(u+C),t.set(s.subarray(v,y),u),e.b=u+=C,e.p=h=y*8,e.f=f;continue}if(h>D){l&&la(0);break}}o&&c(u+131072);for(var O=(1<<m)-1,ie=(1<<p)-1,W=h;;W=h){var re=g[ao(s,h)&O],$=re>>4;if(h+=re&15,h>D){l&&la(0);break}if(re||la(2),$<256)t[u++]=$;else if($==256){W=h,g=null;break}else{var ee=$-254;if($>264){var I=$-257,oe=wf[I];ee=va(s,h,(1<<oe)-1)+Tf[I],h+=oe}var fe=A[ao(s,h)&ie],De=fe>>4;fe||la(3),h+=fe&15;var H=ab[De];if(De>3){var oe=Rf[De];H+=ao(s,h)&(1<<oe)-1,h+=oe}if(h>D){l&&la(0);break}o&&c(u+131072);var Ne=u+ee;if(u<H){var Ke=i-H,q=Math.min(H,Ne);for(Ke+u<0&&la(3);u<q;++u)t[u]=a[Ke+u]}for(;u<Ne;++u)t[u]=t[u-H]}}e.l=g,e.p=W,e.b=u,e.f=f,g&&(f=1,e.m=m,e.d=A,e.n=p)}while(!f);return u!=t.length&&n?ro(t,0,u):t.subarray(0,u)},lb=new $t(0),Ma=function(s,e){return s[e]|s[e+1]<<8},Ua=function(s,e){return(s[e]|s[e+1]<<8|s[e+2]<<16|s[e+3]<<24)>>>0},io=function(s,e){return Ua(s,e)+Ua(s,e+4)*4294967296};function cb(s,e){return ob(s,{i:2},e&&e.out,e&&e.dictionary)}var no=typeof TextDecoder<"u"&&new TextDecoder,fb=0;try{no.decode(lb,{stream:!0}),fb=1}catch{}var db=function(s){for(var e="",t=0;;){var a=s[t++],r=(a>127)+(a>223)+(a>239);if(t+r>s.length)return{s:e,r:ro(s,t-1)};r?r==3?(a=((a&15)<<18|(s[t++]&63)<<12|(s[t++]&63)<<6|s[t++]&63)-65536,e+=String.fromCharCode(55296|a>>10,56320|a&1023)):r&1?e+=String.fromCharCode((a&31)<<6|s[t++]&63):e+=String.fromCharCode((a&15)<<12|(s[t++]&63)<<6|s[t++]&63):e+=String.fromCharCode(a)}};function Nf(s,e){if(e){for(var t="",a=0;a<s.length;a+=16384)t+=String.fromCharCode.apply(null,s.subarray(a,a+16384));return t}else{if(no)return no.decode(s);var r=db(s),i=r.s,t=r.r;return t.length&&la(8),i}}var hb=function(s,e){return e+30+Ma(s,e+26)+Ma(s,e+28)},ub=function(s,e,t){var a=Ma(s,e+28),r=Nf(s.subarray(e+46,e+46+a),!(Ma(s,e+8)&2048)),i=e+46+a,n=Ua(s,e+20),o=t&&n==4294967295?bb(s,i):[n,Ua(s,e+24),Ua(s,e+42)],l=o[0],c=o[1],f=o[2];return[Ma(s,e+10),l,c,r,i+Ma(s,e+30)+Ma(s,e+32),f]},bb=function(s,e){for(;Ma(s,e)!=1;e+=4+Ma(s,e+2));return[io(s,e+12),io(s,e+4),io(s,e+20)]};function gb(s,e){for(var t={},a=s.length-22;Ua(s,a)!=101010256;--a)(!a||s.length-a>65558)&&la(13);var r=Ma(s,a+8);if(!r)return{};var i=Ua(s,a+16),n=i==4294967295||r==65535;if(n){var o=Ua(s,a-12);n=Ua(s,o)==101075792,n&&(r=Ua(s,o+32),i=Ua(s,o+48))}for(var l=0;l<r;++l){var c=ub(s,i,n),f=c[0],h=c[1],u=c[2],g=c[3],A=c[4],m=c[5],p=hb(s,m);i=A,f?f==8?t[g]=cb(s.subarray(p,p+h),{out:new $t(u)}):la(14,"unknown compression type "+f):t[g]=ro(s,p,p+h)}return t}class Bt extends Dt{constructor(){super(),this.shader=new d.UnLitShader,this.baseMap=_.res.whiteTexture}set baseMap(e){this.shader.setTexture("baseMap",e)}get baseMap(){return this.shader.getTexture("baseMap")}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set envMap(e){}set shadowMap(e){}}class Ir extends Ve{shape_vertices=[];shape_indices=[];radius;widthSegments;heightSegments;phiStart;phiLength;thetaStart;thetaLength;constructor(e,t,a,r,i,n,o){super(),this.radius=e,this.widthSegments=t,this.heightSegments=a,this.phiStart=r,this.phiLength=i,this.thetaStart=n,this.thetaLength=o,this.buildGeometry()}buildGeometry(){var e,t,a=0;let r=this.heightSegments,i=this.widthSegments,n=this.radius;var o=(r+1)*(i+1);let l=new Float32Array(o*3),c=new Float32Array(o*3),f=new Float32Array(o*2),h=new Uint16Array(i*r*2*3),u=0,g=0,A=0;for(t=0;t<=r;++t){var m=Math.PI*t/r,p=n*Math.cos(m),D=n*Math.sin(m);for(e=0;e<=i;++e){var B=2*Math.PI*e/i,v=D*Math.cos(B),C=D*Math.sin(B),y=1/Math.sqrt(v*v+p*p+C*C);if(l[u++]=v,l[u++]=p,l[u++]=C,c[g++]=v*y,c[g++]=p*y,c[g++]=C*y,f[A++]=e/i,f[A++]=t/r,e>0&&t>0){var x=(i+1)*t+e,k=(i+1)*t+e-1,E=(i+1)*(t-1)+e-1,S=(i+1)*(t-1)+e;t==r?(h[a++]=x,h[a++]=E,h[a++]=S):t==1?(h[a++]=x,h[a++]=k,h[a++]=E):(h[a++]=x,h[a++]=k,h[a++]=E,h[a++]=x,h[a++]=E,h[a++]=S)}}}this.setIndices(h),this.setAttribute(G.position,l),this.setAttribute(G.normal,c),this.setAttribute(G.uv,f),this.setAttribute(G.TEXCOORD_1,f),this.addSubGeometry({indexStart:0,indexCount:h.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0}),this.bounds=new xe(b.ZERO,new b(this.radius*2,this.radius*2,this.radius*2))}}class Qi extends d.Object3D{static register3DRepresentation=null;positionIndex=-1;positionValid=!1;marker;constructor(e){super(),this.parsePlacemark(e),this.setup3DRepresentation()}parsePlacemark(e){if(!e.slamPositionInfo){console.warn("WayPoint3D: slamPositionInfo is not found");return}const t=e.slamPositionInfo.slamPosition.split(",").map(Number);this.localPosition=new b(t[0],t[1],t[2]),this.positionIndex=Number(e.slamPositionInfo.slamPositionIndex),this.positionValid=e.slamPositionInfo.slamPositionValid==="1"}setup3DRepresentation(){if(this.marker&&(this.removeChild(this.marker),this.marker=null),Qi.register3DRepresentation)this.marker=Qi.register3DRepresentation(this),this.marker&&this.addChild(this.marker);else{this.marker=new d.Object3D;const e=this.marker.addComponent(d.MeshRenderer);e.geometry=new Ir(.1,32,16),e.material=new Bt,e.material.baseColor=this.positionValid?new J(0,1,0,1):new J(1,0,0,1),this.addChild(this.marker),this.marker.name="WayPoint3DMarker"}}}class Ti extends d.Object3D{static register3DRepresentation=null;line;constructor(e){super(),this.parseWayLineFile(e),this.setup3DRepresentation()}parseWayLineFile(e){for(const t of e.Folder.Placemark){const a=new Qi(t);this.addChild(a)}this.entityChildren=this.entityChildren.sort((t,a)=>t.positionIndex-a.positionIndex)}setup3DRepresentation(){this.line&&(this.removeChild(this.line),this.line=null),Ti.register3DRepresentation?(this.line=Ti.register3DRepresentation(this),this.line&&this.addChild(this.line)):(this.line=this.createMultiLine(this.entityChildren.map(e=>e.localPosition),new J(1,1,1,1)),this.addChild(this.line),this.line.name="WayLines3DLine")}createMultiLine(e,t){if(e.length<2)return null;const a=new Ve,r=new Float32Array(e.length*3);for(let c=0;c<e.length;c++)r[c*3]=e[c].x,r[c*3+1]=e[c].y,r[c*3+2]=e[c].z;const i=new Uint16Array((e.length-1)*2);for(let c=0;c<e.length-1;c++)i[c*2]=c,i[c*2+1]=c+1;a.setIndices(i),a.setAttribute(G.position,r),a.addSubGeometry({indexStart:0,indexCount:i.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0});const n=new d.Object3D,o=n.addComponent(d.MeshRenderer),l=new Bt;return l.topology="line-list",l.baseColor=t,l.blendMode=me.ADD,l.castReflection=!1,o.geometry=a,o.material=l,n}}class Pf extends it{static format=He.BIN;parseBuffer(e){try{const t={template:null,waylines:null},a=gb(new Uint8Array(e));for(const i in a){const n=a[i],l=new DOMParser().parseFromString(Nf(n),"application/xml"),c={};this.parseNode(l,c);const f=i.replace("wpmz/","").split(".")[0];Object.assign(t,{[f]:c["#document"].kml.Document})}const r=new Ti(t.waylines);this.data=r}catch(t){this.parserError(`KMZ parsing failed: ${t}`,-1)}}parseNode(e,t){const a=["Placemark","actionGroup","action"],r=e.nodeName.replace("wpml:","");if(!e.childNodes.length)t[r]=void 0;else{let i=null,n=!1;for(let o=0;o<e.childNodes.length;++o){const l=e.childNodes[o];if(l.nodeType==Node.TEXT_NODE){const c=l.nodeValue?.trim();c&&c.length>0&&(i=c)}else l.nodeType==Node.ELEMENT_NODE&&(n=!0)}if(i&&!n)t[r]=i;else if(n){a.includes(r)?t[r]?.length?t[r].push({}):t[r]=[{}]:t[r]={};for(let o=0;o<e.childNodes.length;++o){const l=e.childNodes[o];l.nodeType==Node.ELEMENT_NODE&&this.parseNode(l,Array.isArray(t[r])?t[r].at(-1):t[r])}}else t[r]=void 0}}verification(){if(this.data)return!0;throw new Error("verify failed.")}}class Vf{_texturePool;_materialPool;_prefabPool;_gltfPool;_geometryPool;_atlasList;_obj;constructor(){this._texturePool=new Map,this._materialPool=new Map,this._prefabPool=new Map,this._geometryPool=new Map,this._gltfPool=new Map,this._atlasList=new Map,this._obj=new Map}getGltf(e){return this._gltfPool.get(e)}addObj(e,t){this._obj.set(e,t)}getObj(e){return this._obj.get(e)}addTexture(e,t){this._texturePool.set(e,t)}getTexture(e){return this._texturePool.get(e)}addGeometry(e,t){this._geometryPool.set(e,t)}getGeometry(e){return this._geometryPool.get(e)}addMat(e,t){return this._materialPool.set(e,t)}getMat(e){return this._materialPool.get(e)}addPrefab(e,t){this._prefabPool.set(e,t)}getPrefab(e){return this._prefabPool.get(e).instantiate()}addAtlas(e,t){t.name=e,this._atlasList.set(e,t)}getAtlas(e){return this._atlasList.get(e)}getGUISprite(e){for(let t of this._atlasList.values()){let a=t.getSprite(e);if(a)return a}return null}async load(e,t,a){return(await new It().load(e,t,a)).data}async loadGltf(e,t){if(this._prefabPool.has(e))return this._prefabPool.get(e);let a,r=e.substring(e.lastIndexOf(".")).toLowerCase(),i=new It;r==".gltf"?a=await i.load(e,_t,t):a=await i.load(e,zs,t);let n=a.data;return this._prefabPool.set(e,n),this._gltfPool.set(e,a.gltf),n}async loadObj(e,t){if(this._prefabPool.has(e))return this._prefabPool.get(e);let a,r=e.substring(e.lastIndexOf(".")).toLowerCase(),i=new It;r==".obj"&&(a=await i.load(e,sf,t));let n=a.data;return this._prefabPool.set(e,n),n}async loadB3DM(e,t,a){if(this._prefabPool.has(e))return this._prefabPool.get(e);let n=(await new It().load(e,Hs,t,a)).data;return this._prefabPool.set(e,n),n}async loadI3DM(e,t,a){if(this._prefabPool.has(e))return this._prefabPool.get(e);let n=(await new It().load(e,$s,t,a)).data;return this._prefabPool.set(e,n),n}async loadTexture(e,t,a){if(this._texturePool.has(e))return this._texturePool.get(e);let r=new Ka;r.flipY=a;try{await r.load(e,t)}catch(i){return console.error(`Failed to load texture: ${e}`,i),null}return this._texturePool.set(e,r),r}destroyTexture(e){const t=this._texturePool.get(e);return t?Ce.getInstance().hasReference(t)?!1:(t.isDestroyed||t.destroy(),this._texturePool.delete(e),!0):!1}destroyTextureAllUnUsed(){for(const[e,t]of this._texturePool.entries())this.destroyTexture(e)}async loadTextureCount(e,t,a,r){return new Promise(async(i,n)=>{let o=0,l=[];t==0&&i(l);for(let c=0;c<t;c++){const f=e.shift();this.loadTexture(f,a,r).then(h=>{l.push(h),o++,o==t&&i(l)})}})}async loadBitmapTextures(e,t=5,a,r){let i=[],n=Math.floor(e.length/t)+1,o=Math.floor(e.length%t);for(let l=0;l<n;l++){let c=await this.loadTextureCount(e,l==n-1?o:t,a,r);i.push(...c)}return i}async loadHDRTexture(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let a=new js;return a=await a.load(e,t),this._texturePool.set(e,a),a}async loadHDRTextureCube(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let a=new yn;return a=await a.load(e,t),this._texturePool.set(e,a),a}async loadLDRTextureCube(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let a=new Sn;return a=await a.load(e,t),this._texturePool.set(e,a),a}async loadTextureCubeMaps(e){let t=e[0];if(this._texturePool.has(t))return this._texturePool.get(t);let a=new Ws;return await a.load(e),this._texturePool.set(e[0],a),a}async loadTextureCubeStd(e,t){if(this._texturePool.has(e))return this._texturePool.get(e);let a=new Ws;return await a.loadStd(e),a}async loadJSON(e,t){return await new It().loadJson(e,t).then(async a=>a).catch(a=>{console.log(a)})}async loadFont(e,t,a){let i=await new It().load(e,$a,t,a),n=i.data;return ri.addFontData(n.face,n.size,n),i.data}async loadAtlas(e,t){return(await new It().load(e,Ef,t,e)).data}async loadKMZ(e,t){return(await new It().load(e,Pf,t)).data}normalTexture;maskTexture;whiteTexture;blackTexture;redTexture;blueTexture;greenTexture;yellowTexture;grayTexture;defaultSky;defaultGUITexture;defaultGUISprite;defaultMaterial;createTexture(e,t,a,r,i,n,o){let l=32,c=32,f=new Uint8Array(l*c*4);this.fillColor(f,e,t,a,r,i,n);let h=new pn;return h.name=o,h.create(16,16,f,!0),o&&this.addTexture(o,h),h}fillColor(e,t,a,r,i,n,o){for(let l=0;l<t;l++)for(let c=0;c<a;c++){let f=c*t+l;e[f*4+0]=r,e[f*4+1]=i,e[f*4+2]=n,e[f*4+3]=o}}initDefault(){this.normalTexture=this.createTexture(32,32,255*.5,255*.5,255,255,"default-normalTexture"),this.maskTexture=this.createTexture(32,32,255,255*.5,255,255,"default-maskTexture"),this.whiteTexture=this.createTexture(32,32,255,255,255,255,"default-whiteTexture"),this.blackTexture=this.createTexture(32,32,0,0,0,255,"default-blackTexture"),this.redTexture=this.createTexture(32,32,255,0,0,255,"default-redTexture"),this.blueTexture=this.createTexture(32,32,0,0,255,255,"default-blueTexture"),this.greenTexture=this.createTexture(32,32,0,255,0,255,"default-greenTexture"),this.yellowTexture=this.createTexture(32,32,0,255,255,255,"default-yellowTexture"),this.grayTexture=this.createTexture(32,32,128,128,128,255,"default-grayTexture");let t=new yf().generateBRDFLUTTexture(),a=t.name="BRDFLUT";this.addTexture(a,t),this.defaultSky=new yn,this.defaultSky.createFromTexture(128,this.blackTexture),Ce.getInstance().attached(this.defaultSky,this),Ce.getInstance().attached(t,this),Ce.getInstance().attached(this.normalTexture,this),Ce.getInstance().attached(this.maskTexture,this),Ce.getInstance().attached(this.whiteTexture,this),Ce.getInstance().attached(this.blackTexture,this),Ce.getInstance().attached(this.redTexture,this),Ce.getInstance().attached(this.blueTexture,this),Ce.getInstance().attached(this.greenTexture,this),Ce.getInstance().attached(this.yellowTexture,this),Ce.getInstance().attached(this.grayTexture,this),this.defaultGUITexture=new br(this.whiteTexture),this.defaultGUISprite=new ai(this.defaultGUITexture),this.defaultGUISprite.trimSize.set(4,4),this.defaultMaterial=new qt}}class Of extends qe{_postList;init(e){this._postList=new Map}start(){}stop(){}onEnable(){this.activePost()}onDisable(){this.unActivePost()}activePost(){let e=this.transform.view3D,t=_.getRenderJob(e);this._postList.forEach(a=>{t.addPost(a)})}unActivePost(){let e=this.transform.view3D,t=_.getRenderJob(e);this._postList.forEach(a=>{t.removePost(a)})}addPost(e){if(this._postList.has(e))return;let t=new e;return this._postList.set(e,t),this._enable&&this.activePost(),t}removePost(e){if(!this._postList.has(e))return;let t=this._postList.get(e);this._postList.delete(e);let a=this.transform.view3D;_.getRenderJob(a).removePost(t)}getPost(e){return this._postList.has(e)?this._postList.get(e):null}}const mb="1.0.33";class _{static res;static inputSystem;static views;static _frameRateValue=0;static _frameRate=360;static _time=0;static _beforeRender;static _renderLoop;static _lateRender;static _requestAnimationFrameID=0;static get frameRate(){return this._frameRate}static set frameRate(e){this._frameRate=e,this._frameRateValue=1e3/e,e>=360&&(this._frameRateValue=0)}static get size(){return w.presentationSize}static get aspect(){return w.aspect}static get width(){return w.windowWidth}static get height(){return w.windowHeight}static setting={doublePrecision:!1,occlusionQuery:{enable:!0,debug:!1},pick:{enable:!0,mode:"bound",detail:"mesh"},render:{debug:!1,renderPassState:4,renderState_left:5,renderState_right:5,renderState_split:.5,quadScale:1,hdrExposure:1.5,debugQuad:-1,maxPointLight:1e3,maxDirectLight:4,maxSportLight:1e3,drawOpMin:0,drawOpMax:Number.MAX_SAFE_INTEGER,drawTrMin:0,drawTrMax:Number.MAX_SAFE_INTEGER,zPrePass:!1,useLogDepth:!1,useCompressGBuffer:!1,gi:!1,postProcessing:{bloom:{downSampleStep:3,downSampleBlurSize:9,downSampleBlurSigma:1,upSampleBlurSize:9,upSampleBlurSigma:1,luminanceThreshole:1,bloomIntensity:1,hdr:1},globalFog:{debug:!1,enable:!1,fogType:0,fogHeightScale:.1,start:400,end:10,density:.02,ins:.5,skyFactor:.5,skyRoughness:.4,overrideSkyFactor:.8,fogColor:new J(96/255,117/255,133/255,1),falloff:.7,rayLength:200,scatteringExponent:2.7,dirHeightLine:10},godRay:{blendColor:!0,rayMarchCount:16,scatteringExponent:5,intensity:.5},ssao:{enable:!1,radius:.15,bias:-.1,aoPower:2,debug:!0},outline:{enable:!1,strength:1,groupCount:4,outlinePixel:2,fadeOutlinePixel:4,textureScale:1,useAddMode:!1,debug:!0},taa:{enable:!1,jitterSeedCount:8,blendFactor:.1,sharpFactor:.6,sharpPreBlurFactor:.5,temporalJitterScale:.13,debug:!0},gtao:{enable:!1,darkFactor:1,maxDistance:5,maxPixel:50,rayMarchSegment:6,multiBounce:!1,usePosFloat32:!0,blendColor:!0,debug:!0},ssr:{enable:!1,pixelRatio:1,fadeEdgeRatio:.2,rayMarchRatio:.5,fadeDistanceMin:600,fadeDistanceMax:2e3,roughnessThreshold:.5,powDotRN:.2,mixThreshold:.1,debug:!0},fxaa:{enable:!1},depthOfView:{enable:!1,iterationCount:3,pixelOffset:1,near:150,far:300}}},shadow:{enable:!0,type:"HARD",pointShadowBias:5e-4,shadowSize:2048,pointShadowSize:1024,shadowSoft:.005,shadowBound:100,shadowBias:.05,needUpdate:!0,autoUpdate:!0,updateFrameRate:2,csmMargin:.1,csmScatteringExp:.7,csmAreaScale:.4,debug:!1},gi:{enable:!1,offsetX:0,offsetY:0,offsetZ:0,probeSpace:64,probeXCount:4,probeYCount:2,probeZCount:4,probeSize:32,probeSourceTextureSize:2048,octRTMaxSize:2048,octRTSideSize:16,maxDistance:64*1.73,normalBias:.25,depthSharpness:1,hysteresis:.98,lerpHysteresis:.01,irradianceChebyshevBias:.01,rayNumber:144,irradianceDistanceBias:32,indirectIntensity:1,ddgiGamma:2.2,bounceIntensity:.025,probeRoughness:1,realTimeGI:!1,debug:!1,autoRenderProbe:!1},sky:{type:"HDRSKY",sky:null,skyExposure:1,defaultFar:65536,defaultNear:1},light:{maxLight:4096},material:{materialChannelDebug:!1,materialDebug:!1},loader:{numConcurrent:20},reflectionSetting:{reflectionProbeMaxCount:8,reflectionProbeSize:256,width:256*6,height:8*256,enable:!0}};static renderJobs;static async init(e={}){console.log("Rings Version",mb),window.isSecureContext||console.warn("WebGPU is only supported in secure contexts (HTTPS or localhost)"),this.setting={...this.setting,...e.engineSetting},await Ee.init(R.allocCount,this.setting.doublePrecision),await w.init(e.canvasConfig),this.setting.reflectionSetting.width=this.setting.reflectionSetting.reflectionProbeSize*6,this.setting.reflectionSetting.height=this.setting.reflectionSetting.reflectionProbeSize*this.setting.reflectionSetting.reflectionProbeMaxCount,_e.getGBufferFrame(_e.reflections_GBuffer,this.setting.reflectionSetting.width,this.setting.reflectionSetting.height,!1),Y.init(),Ha.init(),ve.init(),Et.init(),Wt.init(),this.res=new Vf,this.res.initDefault(),this._beforeRender=e.beforeRender,this._renderLoop=e.renderLoop,this._lateRender=e.lateRender,this.inputSystem=new Xo,this.inputSystem.initCanvas(w.canvas)}static startRenderJob(e){let t=new T0(e);return this.renderJobs.set(e,t),this.setting.pick.mode=="pixel"&&e.scene.getOrAddComponent(Of).addPost(ks),(this.setting.pick.mode=="pixel"||this.setting.pick.mode=="bound")&&(e.enablePick=!0),t}static startRenderView(e){this.renderJobs||=new Map,this.views=[e];let t=this.startRenderJob(e);return this.resume(),t}static startRenderViews(e){this.renderJobs||=new Map,this.views=e;for(let t=0;t<e.length;t++)this.startRenderJob(e[t]);this.resume()}static getRenderJob(e){return this.renderJobs.get(e)}static pause(){this._requestAnimationFrameID!==0&&(cancelAnimationFrame(this._requestAnimationFrameID),this._requestAnimationFrameID=0)}static resume(){this._requestAnimationFrameID===0&&(this._requestAnimationFrameID=requestAnimationFrame(e=>this.render(e)))}static async render(e){if(this._frameRateValue>0){let t=e-this._time;if(t<this._frameRateValue){let a=performance.now();await new Promise(r=>{setTimeout(()=>{e+=performance.now()-a,r(!0)},this._frameRateValue-t)})}this._time=e}await this.updateFrame(e),this._requestAnimationFrameID=0,this.resume()}static async updateFrame(e){Le.delta=e-Le.time,Le.time=e,Le.frame+=1,ur.tick(Le.delta);let t=this.views,a=0;for(a=0;a<t.length;a++){const n=t[a];n.scene.waitUpdate();let[o,l]=w.presentationSize;n.camera.viewPort.setTo(0,0,o,l)}this._beforeRender&&await this._beforeRender();for(const n of Pe.componentsBeforeUpdateList){let o=n[0],l=n[1];for(const c of l){let f=c[0],h=c[1];f.enable&&h(o)}}let r=w.device.createCommandEncoder();for(const n of Pe.componentsComputeList){let o=n[0],l=n[1];for(const c of l){let f=c[0],h=c[1];f.enable&&h(o,r)}}w.device.queue.submit([r.finish()]);for(const n of Pe.componentsUpdateList){let o=n[0],l=n[1];for(const c of l){let f=c[0],h=c[1];f.enable&&h(o)}}for(const n of Pe.graphicComponent){let o=n[0],l=n[1];for(const c of l){let f=c[0],h=c[1];o&&f.enable&&h(o)}}this._renderLoop&&await this._renderLoop(),Ee.updateAllContinueTransform(0,R.useCount,16),ve.modelMatrixBindGroup.writeBuffer(R.useCount*16),this.renderJobs.forEach((n,o)=>{n.renderState||n.start(),n.renderFrame()});for(const n of Pe.componentsLateUpdateList){let o=n[0],l=n[1];for(const c of l){let f=c[0],h=c[1];f.enable&&h(o)}}this._lateRender&&await this._lateRender()}}let xn=`
|
|
7892
7892
|
struct BloomCfg{
|
|
7893
7893
|
downSampleStep: f32,
|
|
7894
7894
|
downSampleBlurSize: f32,
|
|
@@ -11536,7 +11536,7 @@ fn frag(){
|
|
|
11536
11536
|
var fragColor:vec4<f32> = vec4<f32>((sky.rgb), 1.0);
|
|
11537
11537
|
return fragColor;
|
|
11538
11538
|
}
|
|
11539
|
-
`}class Dd{sunRadius=500;sunRadiance=11;mieG=.76;mieHeight=1200;eyePos=1500;sunX=.71;sunY=.56;sunBrightness=1;displaySun=!0;defaultTextureCubeSize=512;defaultTexture2DSize=1024;skyColor=new J(1,1,1,1)}class _d extends Sn{_internalTexture;_cubeSize;setting;constructor(e){return super(),this.setting=e,this._cubeSize=e.defaultTextureCubeSize,this._internalTexture=new Eb(e.defaultTexture2DSize,e.defaultTexture2DSize*.5),this._internalTexture.update(this.setting),this.createFromTexture(this._cubeSize,this._internalTexture),this}get texture2D(){return this._internalTexture}apply(){return this._internalTexture.update(this.setting),this._faceData.uploadErpTexture(this._internalTexture),this}}class Eb extends we{_computeShader;_uniformBuffer;constructor(e,t){super(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING),this.initCompute(e,t)}initCompute(e,t){this._uniformBuffer=new yt(64),this._uniformBuffer.apply(),this._computeShader=new ye(Ad.cs),this._computeShader.setUniformBuffer("uniformBuffer",this._uniformBuffer),this._computeShader.setStorageTexture("outTexture",this),this._computeShader.workerSizeX=e/8,this._computeShader.workerSizeY=t/8}update(e){this._uniformBuffer.setFloat("width",this.width),this._uniformBuffer.setFloat("height",this.height),this._uniformBuffer.setFloat("sunU",e.sunX),this._uniformBuffer.setFloat("sunV",e.sunY),this._uniformBuffer.setFloat("eyePos",e.eyePos),this._uniformBuffer.setFloat("sunRadius",e.sunRadius),this._uniformBuffer.setFloat("sunRadiance",e.sunRadiance),this._uniformBuffer.setFloat("mieG",e.mieG),this._uniformBuffer.setFloat("mieHeight",e.mieHeight),this._uniformBuffer.setFloat("sunBrightness",e.sunBrightness),this._uniformBuffer.setFloat("displaySun",e.displaySun?1:0),this._uniformBuffer.setColor("skyColor",e.skyColor),this._uniformBuffer.apply();let t=F.beginCommandEncoder();return F.computeCommand(t,[this._computeShader]),F.endCommandEncoder(t),this}}var wb=Object.getOwnPropertyDescriptor,Rb=(s,e,t,a)=>{for(var r=a>1?void 0:a?wb(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.SkyShader=class extends gt{constructor(){super();let e=new Xe("sky_vs_frag_wgsl","sky_fs_frag_wgsl");this.addRenderPass(e),e.setUniformVector3("eyesPos",new b),e.setUniformFloat("exposure",1),e.setUniformFloat("roughness",0);let t=e.shaderState;t.frontFace="cw",t.cullMode=Nt.back,t.depthWriteEnabled=!1,t.depthCompare=ot.less}},d.SkyShader=Rb([Ia(d.SkyShader,"SkyShader")],d.SkyShader);class Bd extends Dt{constructor(){super(),this.shader=new d.SkyShader,this.shader.setUniformVector3("eyesPos",new b),this.shader.setUniformFloat("exposure",1),this.shader.setUniformFloat("roughness",0)}set baseMap(e){this.setTexture("baseMap",e);const t="IS_HDR_SKY";this._shader.getDefaultShaders()[0].defineValue[t]!=e?.isHDRTexture&&this._shader.setDefine(t,!!e?.isHDRTexture)}get baseMap(){return this._shader.getDefaultColorShader().getTexture("baseMap")}set envMap(e){}set shadowMap(e){}get exposure(){return _.setting.sky.skyExposure}set exposure(e){_.setting.sky.skyExposure=e}get roughness(){return this._shader.getDefaultColorShader().uniforms.roughness.value}set roughness(e){let t=this._shader.getDefaultColorShader();"roughness"in t.uniforms&&(t.uniforms.roughness.value=e)}}class vd extends Qa{gid=0;needUpdate=!0;autoUpdate=!1;radius=500;init(){super.init(),this.addRendererMask(Qe.Reflection),this.alwaysRender=!0,this.object3D.bound=new xe(b.ZERO.clone(),b.MAX),nn(this.transform.onPositionChange,()=>{this.needUpdate=!0})}onEnable(){K.instance.addRenderNode(this.transform.scene3D,this)}onDisable(){K.instance.removeRenderNode(this.transform.scene3D,this)}renderPass2(e,t,a,r,i,n=!1){super.renderPass2(e,t,a,r,i,n)}}class Ud extends gt{constructor(){super();let e=new Xe("ReflectionShader_shader","ReflectionShader_shader");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);let t=e.shaderState;t.acceptShadow=!1,t.castShadow=!1,t.receiveEnv=!1,t.acceptGI=!1,t.useLight=!1,this.setDefine("USE_BRDF",!0),this.setDefine("USE_AO_R",!0),this.setDefine("USE_ROUGHNESS_G",!0),this.setDefine("USE_METALLIC_B",!0),this.setDefine("USE_ALPHA_A",!0),this.setDefault()}setDefault(){this.setUniformVector4("transformUV1",new he(0,0,1,1)),this.setUniformVector4("transformUV2",new he(0,0,1,1)),this.setUniformColor("baseColor",new J),this.setUniformFloat("alphaCutoff",0)}set _MainTex(e){this.setTexture("baseMap",e)}set _BumpMap(e){this.setTexture("normalMap",e)}set _MaskTex(e){this.setTexture("maskMap",e)}set _UVTransform(e){this.setUniformVector4("transformUV1",e)}set _Metallic(e){this.setUniformFloat("metallic",e)}set _Roughness(e){this.setUniformFloat("roughness",e)}set _MainColor(e){this.setUniformColor("baseColor",e)}set _AlphaCutoff(e){this.setUniformFloat("alphaCutoff",e)}set _DoubleSidedEnable(e){let t=this.getDefaultColorShader();t.shaderState.cullMode=e?Nt.none:t.shaderState.cullMode}set _SurfaceType(e){let t=this.getDefaultColorShader();e==0?t.blendMode=me.NONE:t.blendMode=me.ALPHA}set _AlphaCutoffEnable(e){e==0?this.setDefine("USE_ALPHACUT",!1):this.setDefine("USE_ALPHACUT",!0)}}class yd extends Dt{constructor(){super(),this.shader=new Ud,this.baseMap=_.res.whiteTexture,this.setDefine("USE_CUSTOMUNIFORM",!0),this.reflectionIndex=0}set baseMap(e){this.shader.setTexture("baseMap",e)}get baseMap(){return this.shader.getTexture("baseMap")}set baseColor(e){this.shader.setUniformColor("baseColor",e)}set reflectionIndex(e){this.shader.setUniformFloat("reflectionIndex",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set envMap(e){}set shadowMap(e){}}class Qr{center=new b;extents;max;min;size;tmpVecA=new b;tmpVecB=new b;tmpVecC=new b;tmpVecD=new b;radius=0;diffBetweenPoints=new b;owner;forward=new b(0,0,1);worldCenter;worldSize;_center=new b;constructor(e,t){this.center=e||new b(0,0,0),this.radius=t===void 0?.5:t}updateBound(){throw new Error("Method not implemented.")}containsPoint(e){var t=this.tmpVecA.subtract(e,this.center).lengthSquared,a=this.radius;return t<a*a}intersectsRay(e,t){var a=this.tmpVecA.copyFrom(e.origin).subtract(this.center),r=a.dotProduct(this.tmpVecB.copyFrom(e.direction).normalize()),i=a.dotProduct(a)-this.radius*this.radius;if(i>0&&r>0)return null;var n=r*r-i;if(n<0)return!1;var o=Math.abs(-r-Math.sqrt(n));return t&&t.copyFrom(e.direction).scaleBy(o).add(e.origin),!0}intersectsBoundingSphere(e){this.tmpVecA.subtract(e.center,this.center);var t=e.radius+this.radius;return this.tmpVecA.lengthSquared<=t*t}calculateTransform(e){this.update(e)}inFrustum(e,t){return t.containsSphere(e)}clone(){return new Qr(this.center.clone(),this.radius)}update(e){this.owner=e,this._center.add(e.transform.worldMatrix.position,this.center),this.forward=e.transform.forward}merge(e){throw new Error("BoundingSphere merge is not ready!")}setFromCenterAndSize(e,t){this.center.copy(e),this.radius=t}}class Cd extends vd{init(){super.init(),this.castShadow=!1,this.castGI=!1,this.addRendererMask(Qe.Reflection),this.alwaysRender=!0,this.object3D.bound=new Qr(b.ZERO.clone(),this.radius)}debug(e,t=1){let a=new d.Object3D,r=a.addComponent(d.MeshRenderer);r.addMask(Qe.ReflectionDebug),r.geometry=new Ir(25,30,30);let i=_.setting.reflectionSetting,n=_e.getGBufferFrame(_e.reflections_GBuffer,i.width,i.height),o=new yd;o.reflectionIndex=e,o.baseMap=n.getCompressGBufferTexture(),r.material=o,this.object3D.addChild(a),a.scaleX=t,a.scaleY=t,a.scaleZ=t}onEnable(){super.onEnable()}onDisable(){super.onDisable()}renderPass2(e,t,a,r,i,n=!1){super.renderPass2(e,t,a,r,i,n)}}class Fn extends d.MeshRenderer{skyMaterial;init(){super.init(),this.castShadow=!1,this.castGI=!0,this.addRendererMask(Qe.Sky),this.alwaysRender=!0,this.object3D.bound=new xe(b.ZERO.clone(),b.MAX),this.geometry=new Ir(_.setting.sky.defaultFar,20,20),this.skyMaterial||=new Bd}onEnable(){this._readyPipeline?(this.castNeedPass(),!this._inRenderer&&this.transform.scene3D&&(K.instance.sky=this,this._inRenderer=!0)):this.initPipeline()}onDisable(){this._inRenderer&&this.transform.scene3D&&(this._inRenderer=!1,K.instance.sky=null),super.onDisable()}nodeUpdate(e,t,a,r){super.nodeUpdate(e,t,a,r)}renderPass2(e,t,a,r,i,n=!1){super.renderPass2(e,t,a,r,i,n)}set map(e){this.skyMaterial.baseMap=e,this.skyMaterial.name==null&&(this.skyMaterial.name="skyMaterial"),this.material=this.skyMaterial}get map(){return this.skyMaterial.baseMap}get exposure(){return this.skyMaterial.exposure}set exposure(e){this.skyMaterial&&(this.skyMaterial.exposure=e)}get roughness(){return this.skyMaterial.roughness}set roughness(e){this.skyMaterial&&(this.skyMaterial.roughness=e)}useSkyReflection(){let e=new d.Object3D,t=e.addComponent(Cd);t.autoUpdate=!1,e.x=0,e.y=300,e.z=0,this.object3D.addChild(e)}}class Ib{rotateX;rotateY;sunX;sunY;constructor(){this.reset()}reset(){return this.rotateX=this.rotateY=this.sunX=this.sunY=Number.MAX_VALUE,this}isRotateChange(e,t){return Math.abs(this.rotateX-e)>=.001||Math.abs(this.rotateY-t)>=.001}isSkyChange(e,t){return Math.abs(this.sunX-e)>=.001||Math.abs(this.sunY-t)>=.001}save(e,t,a,r){return this.sunX=e,this.sunY=t,this.rotateX=a,this.rotateY=r,this}}class Qb extends Fn{_atmosphericScatteringSky;_onChange=!0;_relatedTransform;_historyData;get sunX(){return this._atmosphericScatteringSky.setting.sunX}set sunX(e){this._atmosphericScatteringSky.setting.sunX!=e&&(this._atmosphericScatteringSky.setting.sunX=e,this._onChange=!0)}get sunY(){return this._atmosphericScatteringSky.setting.sunY}set sunY(e){this._atmosphericScatteringSky.setting.sunY!=e&&(this._atmosphericScatteringSky.setting.sunY=e,this._onChange=!0)}get eyePos(){return this._atmosphericScatteringSky.setting.eyePos}set eyePos(e){this._atmosphericScatteringSky.setting.eyePos!=e&&(this._atmosphericScatteringSky.setting.eyePos=e,this._onChange=!0)}get sunRadius(){return this._atmosphericScatteringSky.setting.sunRadius}set sunRadius(e){this._atmosphericScatteringSky.setting.sunRadius!=e&&(this._atmosphericScatteringSky.setting.sunRadius=e,this._onChange=!0)}get sunRadiance(){return this._atmosphericScatteringSky.setting.sunRadiance}set sunRadiance(e){this._atmosphericScatteringSky.setting.sunRadiance!=e&&(this._atmosphericScatteringSky.setting.sunRadiance=e,this._onChange=!0)}get sunBrightness(){return this._atmosphericScatteringSky.setting.sunBrightness}set sunBrightness(e){this._atmosphericScatteringSky.setting.sunBrightness!=e&&(this._atmosphericScatteringSky.setting.sunBrightness=e,this._onChange=!0)}get displaySun(){return this._atmosphericScatteringSky.setting.displaySun}set displaySun(e){this._atmosphericScatteringSky.setting.displaySun!=e&&(this._atmosphericScatteringSky.setting.displaySun=e,this._onChange=!0)}init(){super.init(),this._historyData=new Ib,this._atmosphericScatteringSky=new _d(new Dd);let e=this.transform.view3D,t=this.transform.scene3D;this.map=this._atmosphericScatteringSky,t.envMap=this._atmosphericScatteringSky,this.onUpdate(e)}start(e){let t=this.transform.scene3D;this.map=this._atmosphericScatteringSky,t.envMap=this._atmosphericScatteringSky,super.start()}get relativeTransform(){return this._relatedTransform}set relativeTransform(e){this._relatedTransform=e,this._historyData.reset()}onUpdate(e){this._relatedTransform&&(this._relatedTransform.rotationZ=0,this._historyData.isRotateChange(this._relatedTransform.rotationX,this._relatedTransform.rotationY)?(this.sunX=(this._relatedTransform.rotationY+90)/360,this.sunY=this._relatedTransform.rotationX/180+.5):this._historyData.isSkyChange(this.sunX,this.sunY)&&(this._relatedTransform.rotationY=this.sunX*360-90,this._relatedTransform.rotationX=(this.sunY-.5)*180),this._historyData.save(this.sunX,this.sunY,this._relatedTransform.rotationX,this._relatedTransform.rotationY)),this._onChange&&(this._onChange=!1,this._atmosphericScatteringSky.apply())}destroy(e){super.destroy(e),this._atmosphericScatteringSky.destroy(),this._atmosphericScatteringSky=null,this._onChange=null}}class Tr{static panelRatio=1;static quadMaxCountForWorld=256;static quadMaxCountForView=2048;static SortOrderStartWorld=7e3;static SortOrderStartView=8e3;static SortOrderCanvasSpan=1e4}var ca=(s=>(s[s.View=0]="View",s[s.World=2]="World",s))(ca||{}),ni=(s=>(s[s.Simple=0]="Simple",s[s.Sliced=1]="Sliced",s[s.Tiled=2]="Tiled",s[s.Filled=3]="Filled",s))(ni||{}),pr=(s=>(s[s.None=0]="None",s[s.BillboardY=9]="BillboardY",s[s.BillboardXYZ=10]="BillboardXYZ",s))(pr||{});class Mi extends qe{type;camera;_cameraPosition;constructor(){super(),this._cameraPosition=new b}onUpdate(){this.enable&&this.transform.view3D.camera&&this.updateBillboardMatrix()}updateBillboardMatrix(){let e=this.transform.view3D.camera;this._cameraPosition.copyFrom(e.transform.back),this.type==pr.BillboardXYZ||this.type==pr.BillboardY&&(this._cameraPosition.y=0),this._cameraPosition.normalize(),this._cameraPosition.add(this.object3D.localPosition,this._cameraPosition),this.transform.lookAt(this.object3D.localPosition,this._cameraPosition,e.transform.up)}cloneTo(e){let t=e.addComponent(Mi);t.type=this.type}}var si=(s=>(s[s.None=0]="None",s[s.Box=1]="Box",s[s.Capsule=2]="Capsule",s[s.Sphere=3]="Sphere",s[s.Mesh=4]="Mesh",s))(si||{});class ht{_center;_size;_halfSize;_shapeType=0;static v3_help_0;static helpMatrix;static helpRay;constructor(){ht.v3_help_0||=new b,ht.helpMatrix||=new R,ht.helpRay||=new na,this._center=new b,this._size=new b,this._halfSize=new b}get shapeType(){return this._shapeType}setFromCenterAndSize(e,t){return e&&this._center.copy(e),t&&this._size.copy(t),this}get center(){return this._center}set center(e){this._center.copy(e)}get size(){return this._size}set size(e){this._size.copy(e),this._halfSize.copy(e).multiplyScalar(.5)}get halfSize(){return this._halfSize}rayPick(e,t){return null}}class oi extends ht{_pickRet;box;constructor(){super(),this._shapeType=si.Box,this.box=new xe(new b,new b)}rayPick(e,t){this.box.setFromCenterAndSize(this.center,this.size);let r=ht.helpMatrix;r.copyFrom(t).invert();let i=ht.helpRay.copy(e);i.applyMatrix(r);let n=i.intersectBox(this.box,ht.v3_help_0);return n?(this._pickRet||(this._pickRet={intersectPoint:new b,distance:0}),this._pickRet.intersectPoint=n,this._pickRet.distance=b.distance(i.origin,ht.v3_help_0),this._pickRet):null}}class fa extends qe{_shape;constructor(){super(),this._shape=new oi}start(){_.setting.pick.mode=="pixel"&&this.transform.scene3D.view.pickFire.mouseEnableMap.set(this.transform.worldMatrix.index,this)}onEnable(e){Pe.bindEnablePick(e,this,null)}onDisable(e){Pe.unBindEnablePick(e,this)}get shape(){return this._shape}set shape(e){this._shape=e}rayPick(e){return this._enable?this._shape.rayPick(e,this.transform.worldMatrix):null}beforeDestroy(e){_.setting.pick.mode=="pixel"&&this.transform.scene3D.view.pickFire.mouseEnableMap.delete(this.transform.worldMatrix.index),super.beforeDestroy(e)}}class Sd{loop=!0;speed=1;t=0;time=0;weight=0;currFrame=0;lastFrame=-1;nextFrame=0;clip;animation;_isEnd=!1;_currSkeletonPose;constructor(e){this.clip=e,this._currSkeletonPose=new Fi(this.clip.skeleton)}reset(){this.time=0,this.weight=0,this._isEnd=!1}get name(){return this.clip.name}get currSkeletonPose(){return this._currSkeletonPose}update(e){this.time=(this.time+e*this.speed)%this.clip.totalTime;let t=this.time/this.clip.frameRate;if(this.currFrame=Math.trunc(t),this.t=t-this.currFrame,this.currFrame<0&&(this.currFrame=this.clip.numFrame+this.currFrame),this.time>=0?this.nextFrame=(this.currFrame+1)%this.clip.numFrame:(this.nextFrame=this.currFrame-1,this.nextFrame<0&&(this.nextFrame=this.clip.numFrame+this.nextFrame),this.t=1-this.t),this._isEnd)this.currFrame=this.nextFrame=this.speed<0?0:this.clip.numFrame-1;else if(this.currFrame!=this.lastFrame){let i=this.speed<0?0:this.clip.numFrame;this.currFrame==i&&(this.loop?(this.currFrame=0,this.nextFrame=1,this.time=this.t=0):(this.currFrame=this.nextFrame=this.speed<0?0:this.clip.numFrame-1,this._isEnd=!0));var a=this.clip.getEvents();if(a)for(let n of a){var r=Math.floor(n.time/this.clip.frameRate);if(r=Math.min(r,this.clip.numFrame),r=Math.max(r,0),r==this.currFrame){n.skeletonAnimation=this.animation,this.animation.eventDispatcher.dispatchEvent(n);break}}this.lastFrame=this.currFrame}this.clip.getLerpSkeletonPose(this.currFrame,this.nextFrame,this.t,this._currSkeletonPose)}}var Tb=Object.getOwnPropertyDescriptor,Mb=(s,e,t,a)=>{for(var r=a>1?void 0:a?Tb(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.SkeletonAnimationComponent=class extends qe{isPlaying=!0;timeScale=1;_skeleton;_clips=[];_clipStates=new Map;_mixSkeletonPose;_mixTempSkeletonPose;_currentClipState;_bindList=[];_jointMatrixIndexTableBuffer;_crossFadeState;constructor(){super()}start(){}set skeleton(e){this._skeleton=e,this._mixSkeletonPose=new Fi(this._skeleton,!0),this._mixTempSkeletonPose=new Fi(this._skeleton);const t=new Float32Array(this._mixSkeletonPose.jointMatrixIndexTable);this._jointMatrixIndexTableBuffer=new Te(this._skeleton.numJoint*4,0,t)}get skeleton(){return this._skeleton}get finalSkeletonPose(){return this._mixSkeletonPose}get jointMatrixIndexTableBuffer(){return this._jointMatrixIndexTableBuffer}getJointIndexTable(e){let t=new Array;for(let a=0;a<e.length;a++){const r=e[a];let i=this._skeleton.getJointByName(r);t[a]=i?i.index:-1}return t}addAnimationClip(e){if(!this._clipStates.has(e.name)){this._clips.push(e);let t=new Sd(e);t.animation=this,this._clipStates.set(e.name,t),this._currentClipState||this.setCurrentClipState(t)}}getAnimationClip(e){var t=this.getAnimationClipState(e);return t?t.clip:null}getAnimationClips(){return this._clips}getAnimationClipState(e){return this._clipStates.has(e)?this._clipStates.get(e):null}getAnimationClipStates(){return this._clipStates}pause(){this.isPlaying=!1}resume(){this.isPlaying=!0}play(e,t=1,a=!1){if(this._currentClipState&&this._currentClipState.name==e)return a&&this._currentClipState.reset(),!1;let r=this.getAnimationClipState(e);return r?(r.speed=t,r.reset(),this._clipStates.forEach((i,n)=>{i.weight=0}),this.setCurrentClipState(r),!0):!1}crossFade(e,t){if(t<.01){this.play(e);return}if(this._currentClipState.name==e)return;let a=this.getAnimationClipState(e);a&&(a.reset(),this._crossFadeState?(this._crossFadeState.inClip&&(this._crossFadeState.inClip.weight=0),this._crossFadeState.outClip&&(this._crossFadeState.outClip.weight=0),this._crossFadeState.reset(a,this._currentClipState,t)):this._crossFadeState=new Nb(a,this._currentClipState,t),this._currentClipState=a)}setAnimIsLoop(e,t){this._clipStates.has(e)&&(this._clipStates.get(e).loop=t)}addJointBind(e,t){this._bindList.push({jointName:e,obj:t})}removeJointBind(e){for(let t=0;t<this._bindList.length;t++)if(this._bindList[t].obj==e){this._bindList.splice(t,1);break}}onUpdate(){if(!this.isPlaying)return;let e=Le.delta*.001*this.timeScale;this._crossFadeState&&this._crossFadeState.update(e);var t=0,a=[];if(this._clipStates.forEach((i,n)=>{i.weight>0&&(i.update(e),t+=i.weight,a.push(i))}),a.length>0){this._mixSkeletonPose.copyFrom(a[0].currSkeletonPose);for(var r=1;r<a.length;++r){const i=a[r];this._mixTempSkeletonPose.lerp(this._mixSkeletonPose,i.currSkeletonPose,i.weight/t),this._mixSkeletonPose.copyFrom(this._mixTempSkeletonPose)}}}cloneTo(e){let t=e.addComponent(d.SkeletonAnimationComponent);t.skeleton=this.skeleton;for(var a=0;a<this._clips.length;++a)t.addAnimationClip(this._clips[a])}setCurrentClipState(e){this._currentClipState!=e&&(this._currentClipState=e,this._currentClipState.weight=1)}},d.SkeletonAnimationComponent=Mb([Lt(d.SkeletonAnimationComponent,"SkeletonAnimationComponent")],d.SkeletonAnimationComponent);class Nb{inClip;outClip;currentTime;crossFadeTime;constructor(e,t,a){this.reset(e,t,a)}reset(e,t,a){this.inClip=e,this.outClip=t,this.currentTime=0,this.crossFadeTime=a}update(e){!this.inClip||!this.outClip||(this.currentTime+=e,this.inClip.weight=Math.min(Math.abs(this.currentTime%this.crossFadeTime)/this.crossFadeTime,1),this.outClip.weight=1-this.inClip.weight,Math.abs(this.currentTime)>=this.crossFadeTime&&(this.inClip.weight=1,this.outClip.weight=0,this.inClip=null,this.outClip=null))}}var Pb=Object.getOwnPropertyDescriptor,Vb=(s,e,t,a)=>{for(var r=a>1?void 0:a?Pb(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.AnimatorComponent=class extends qe{timeScale=1;jointMatrixIndexTableBuffer;playBlendShapeLoop=!1;inverseBindMatrices;_avatar;_rendererList;propertyCache;_clips;_clipsState;_clipsMap;_currentSkeletonClip;_currentBlendAnimClip;_skeletonTime=0;_blendShapeTime=0;_skeletonSpeed=1;_blendShapeSpeed=1;_skeletonStart=!0;_blendShapeStart=!0;root;_avatarName;_bonePos=new b;_boneScale=new b;_boneRot=new ae;_crossFadeState;init(e){this.propertyCache=new Map,this._clipsMap=new Map,this._clips=[],this._clipsState=[],this._rendererList=this.object3D.getComponentsInChild(d.SkinnedMeshRenderer2);let t=this.object3D.getComponentsInChild(d.MeshRenderer);for(let a of t){let r=a;r.blendShape=a.morphData,this._rendererList.push(r)}for(const a of this._rendererList)aa.hasMask(a.rendererMask,Qe.MorphTarget)&&a.selfCloneMaterials("MORPH_TARGET_UUID")}start(){}debug(){}playAnim(e,t=0,a=1){let r=this.getAnimationClipState(e);r?(this._currentSkeletonClip&&(this._currentSkeletonClip.weight=0),this._currentSkeletonClip=r,this._currentSkeletonClip.weight=1,this._skeletonTime=t,this._skeletonSpeed=a,this._skeletonStart=!0):console.warn(`not has anim ${e}`)}crossFade(e,t){let a=this.getAnimationClipState(e);if(!a){console.warn(`not has anim ${e}`);return}if(t<.01||!this._currentSkeletonClip){this.playAnim(e);return}if(this._currentSkeletonClip&&this._currentSkeletonClip.clip.clipName===e)return;let r=a,i=this._currentSkeletonClip;this._crossFadeState?(this._crossFadeState.inClip&&(this._crossFadeState.inClip.weight=0),this._crossFadeState.outClip&&(this._crossFadeState.outClip.weight=0),this._crossFadeState.reset(r,i,t)):this._crossFadeState=new Ob(r,i,t),this._currentSkeletonClip=r}playBlendShape(e,t=0,a=1){this._clipsMap.has(e)?(this._currentBlendAnimClip=this._clipsMap.get(e),this._blendShapeTime=t,this._blendShapeSpeed=a,this._blendShapeStart=!0):console.warn(`not has blendShape ${e}`)}set avatar(e){this._avatarName=e,this.inverseBindMatrices=[],this._avatar=_.res.getObj(e);let t=this.buildSkeletonPose();const a=new Float32Array(t);this.jointMatrixIndexTableBuffer=new Te(this._avatar.count,0,a)}get numJoint(){return this._avatar.count}getJointIndexTable(e){let t=new Array;for(let a=0;a<e.length;a++){let r=this._avatar.boneMap.get(e[a]);t[a]=r?r.boneID:-1}return t}skeltonPoseObject3D={};skeltonTPoseObject3D={};buildSkeletonPose(){let e=[];for(const t of this._avatar.boneData){let a=new d.Object3D;R.getEuler(b.HELP_6,t.q,!0,"ZYX"),a.localPosition=t.t.clone(),a.localRotation=b.HELP_6.clone(),a.localScale=b.ONE,t.s.clone(),this.skeltonPoseObject3D[t.boneName]=a,this.skeltonTPoseObject3D[t.bonePath]=a.clone(),t.parentBoneName&&t.parentBoneName!=""?this.skeltonPoseObject3D[t.parentBoneName].addChild(a):(this.object3D.transform.scene3D&&this.object3D.transform.scene3D.addChild(a),this.root=a),e.push(a.transform.worldMatrix.index);let r=new R;r.copyFrom(a.transform.worldMatrix),r.invert(),this.inverseBindMatrices.push(r.rawData)}return e}set clips(e){this._clips=e;for(const t of e)this._clipsMap.set(t.clipName,t);this._clipsState=[];for(const t of e)this._clipsState.push(new xd(t));this._currentSkeletonClip||this.playAnim(e[0].clipName)}get clips(){return this._clips}get clipsState(){return this._clipsState}cloneTo(e){let t=e.addComponent(d.AnimatorComponent);t.avatar=this._avatarName,t.clips=this._clips}updateTime(){const e=Le.delta*.001;this._skeletonStart&&(this._skeletonTime+=e*this._skeletonSpeed*this.timeScale,this._currentSkeletonClip&&this._currentSkeletonClip.clip.loopTime&&(this._skeletonTime=this._skeletonTime%this._currentSkeletonClip.clip.stopTime)),this._blendShapeStart&&(this._blendShapeTime+=e*this._blendShapeSpeed,this._currentBlendAnimClip&&(this._currentBlendAnimClip.loopTime&&this.playBlendShapeLoop?this._blendShapeTime=this._blendShapeTime%this._currentBlendAnimClip.stopTime:this._blendShapeTime=Math.min(this._blendShapeTime,this._currentBlendAnimClip.stopTime)-1e-4)),this._crossFadeState&&this._crossFadeState.update(e)}onUpdate(e){this.updateTime();let t=[];for(let a of this._clipsState)a.weight>0&&t.push(a);t.length>0?this.updateSkeletonAnimMix(t):this.updateSkeletonAnim(),this.updateMorphAnim()}updateSkeletonAnim(){if(this._currentSkeletonClip){let e=this._avatar.boneData,t=0,a=e.length;for(t=0;t<a;t++){const r=e[t];let i=this.skeltonPoseObject3D[r.boneName];if(this._currentSkeletonClip.clip.useSkeletonPos){let o=this.getPosition(r.bonePath,this._skeletonTime);i.transform.localPosition=o}let n=this.getRotation(r.bonePath,this._skeletonTime);if(i.transform.localRotQuat=n,this._currentSkeletonClip.clip.useSkeletonScale){let o=this.getScale(r.bonePath,this._skeletonTime);i.transform.localScale=o}}}}updateMorphAnim(){if(this._currentBlendAnimClip&&this._currentBlendAnimClip.floatCurves&&this._currentBlendAnimClip.floatCurves.size>0&&this._rendererList)for(const e of this._currentBlendAnimClip.floatCurves){let t=e[0],r=e[1].propertys,n=this._currentBlendAnimClip.floatCurves.get(t).getValue(this._blendShapeTime)/100;this.updateBlendShape(r,t,n)}}updateBlendShape(e,t,a){for(const r of this._rendererList)if(r.blendShape){let i=this.propertyCache.get(r);if(i&&t in i)i[t](a);else{i=r;for(const n of e){if(!i[n]){i=null;break}i=i[n]}if(!i||i==r)continue;this.propertyCache.get(r)||this.propertyCache.set(r,{}),this.propertyCache.get(r)[t]=i,i(a)}}}updateSkeletonAnimMix(e){let t=0;for(let a of e)t+=a.weight;if(e.length>0){let a=this._avatar.boneData,r=a.length;for(let i=0;i<r;i++){const n=a[i];let o=this.skeltonPoseObject3D[n.boneName];if(e[0].clip.useSkeletonPos){this._bonePos.copyFrom(this.getPosition(n.bonePath,this._skeletonTime,e[0].clip));for(let l=1;l<e.length;l++){const c=e[l];if(c.clip.useSkeletonPos){let f=this.getPosition(n.bonePath,this._skeletonTime,c.clip);b.HELP_0.lerp(this._bonePos,f,c.weight/t),this._bonePos.copyFrom(b.HELP_0)}}o.transform.localPosition=this._bonePos}this._boneRot.copyFrom(this.getRotation(n.bonePath,this._skeletonTime,e[0].clip));for(let l=1;l<e.length;l++){const c=e[l];let f=this.getRotation(n.bonePath,this._skeletonTime,c.clip);ae.HELP_2.slerp(this._boneRot,f,c.weight/t),this._boneRot.copyFrom(ae.HELP_2)}if(o.transform.localRotQuat=this._boneRot,e[0].clip.useSkeletonScale){this._boneScale.copyFrom(this.getScale(n.bonePath,this._skeletonTime,e[0].clip));for(let l=1;l<e.length;l++){const c=e[l];if(c.clip.useSkeletonScale){let f=this.getScale(n.bonePath,this._skeletonTime,c.clip);b.HELP_0.lerp(this._boneScale,f,c.weight/t),this._boneScale.copyFrom(b.HELP_0)}}o.transform.localScale=this._boneScale}}}}getPosition(e,t,a=this._currentSkeletonClip.clip){return a.positionCurves.has(e)?a.positionCurves.get(e).getValue(t):this.skeltonTPoseObject3D[e].localPosition}getRotation(e,t,a=this._currentSkeletonClip.clip){if(a.rotationCurves.has(e)){let r=a.rotationCurves.get(e).getValue(t);return ae.HELP_0.set(r.x,r.y,r.z,r.w),ae.HELP_0}return this.skeltonTPoseObject3D[e].localQuaternion}getScale(e,t,a=this._currentSkeletonClip.clip){return a.scaleCurves.has(e)?a.scaleCurves.get(e).getValue(t):this.skeltonTPoseObject3D[e].localScale}getAnimationClipState(e){for(let t of this._clipsState)if(t.clip.clipName===e)return t;return null}cloneMorphRenderers(){let e={};for(const t of this._rendererList)for(const a in t.geometry.morphTargetDictionary){let r=e[a]||[];r.push(t),e[a]=r}return e}},d.AnimatorComponent=Vb([Lt(d.AnimatorComponent,"AnimatorComponent")],d.AnimatorComponent);class xd{clip;weight=0;get totalTime(){return this.clip.stopTime-this.clip.startTime}constructor(e){this.clip=e}}class Ob{inClip;outClip;currentTime;crossFadeTime;constructor(e,t,a){this.reset(e,t,a)}reset(e,t,a){this.inClip=e,this.outClip=t,this.currentTime=0,this.crossFadeTime=a}update(e){!this.inClip||!this.outClip||(this.currentTime+=e,this.inClip.weight=Math.min(Math.abs(this.currentTime%this.crossFadeTime)/this.crossFadeTime,1),this.outClip.weight=1-this.inClip.weight,Math.abs(this.currentTime)>=this.crossFadeTime&&(this.inClip.weight=1,this.outClip.weight=0,this.inClip=null,this.outClip=null))}}class fo{index;time;timeEnd;coeff=[]}var Ar=(s=>(s[s.PingPong=0]="PingPong",s[s.Repeat=1]="Repeat",s[s.Clamp=2]="Clamp",s))(Ar||{});class kn{serializedVersion="2";time;value;inSlope=0;outSlope=0;tangentMode=0;weightedMode=0;inWeight;outWeight;constructor(e=0,t=0){this.time=e,this.value=t}unSerialized(e){this.serializedVersion=e.serializedVersion,this.time=e.time,this.value=e.value,this.tangentMode=e.tangentMode,this.inSlope=e.inSlope=="Infinity"?NaN:e.inSlope,this.outSlope=e.outSlope=="Infinity"?NaN:e.outSlope}unSerialized2(e){this.serializedVersion=e.serializedVersion,this.time=e.time,this.value=e.value,this.tangentMode=e.tangentMode,this.inSlope=e.inTangent=="Infinity"?NaN:e.inTangent,this.outSlope=e.outTangent=="Infinity"?NaN:e.outTangent}}class Ni{_totalTime=1;_cache=new fo;_cacheOut={lhsIndex:0,rhsIndex:0};_InvalidateCache=!1;curve=[];serializedVersion;preWarpMode;postWarpMode;rotationOrder;get cacheOut(){return this._cacheOut}constructor(e,t=Ar.Repeat,a=Ar.Repeat){if(e)for(let r=0;r<e.length;r++){const i=e[r];this.addKeyFrame(i)}this.preWarpMode=t,this.postWarpMode=a}get totalTime(){return this._totalTime}get first(){return this.curve[0]}get last(){return this.curve[this.curve.length-1]}addKeyFrame(e){this.curve.indexOf(e)==-1&&this.curve.push(e),this.calcTotalTime()}removeKeyFrame(e){let t=this.curve.indexOf(e);t!=-1&&this.curve.splice(t,1),this.calcTotalTime()}calculateCacheData(e,t,a,r=0){let i=this.curve,n=i[t],o=i[a];e.index=t,e.time=n.time+r,e.timeEnd=o.time+r,e.index=t;let l,c,f,h,u,g,A;l=o.time-n.time,l=Math.max(l,1e-4),f=o.value-n.value,c=1/(l*l),h=n.outSlope,u=o.inSlope,g=h*l,A=u*l,e.coeff[0]=(g+A-f-f)*c/l,e.coeff[1]=(f+f+f-g-g-A)*c,e.coeff[2]=h,e.coeff[3]=n.value,this.setupStepped(e.coeff,n,o)}getValue(e){return e=this.wrapTime(e),this.findCurve(e,this._cacheOut),this.calculateCacheData(this._cache,this._cacheOut.lhsIndex,this._cacheOut.rhsIndex,0),this.evaluateCache(this._cache,e)}getCurveFramesExtent(e){return e=this.wrapTime(e),this.findCurve(e,this._cacheOut),{lhsIndex:this._cacheOut.lhsIndex,rhsIndex:this._cacheOut.rhsIndex,time:e}}getKeyCount(){return this.curve.length}getKey(e){return this.curve[e]}unSerialized(e){this.preWarpMode=e.m_PreInfinity,this.postWarpMode=e.m_PostInfinity,this.rotationOrder=e.m_RotationOrder;let t=e.m_Curve.length;for(let a=0;a<t;a++)this.curve[a]=new kn,this.curve[a].unSerialized(e.m_Curve[a.toString()]);return this.calcTotalTime(),this}unSerialized2(e){this.preWarpMode=e.preWrapMode,this.postWarpMode=e.postWrapMode;let t=e.keyFrames||e.keys,a=t.length;for(let r=0;r<a;r++)this.curve[r]=new kn,this.curve[r].unSerialized2(t[r.toString()]);return this.calcTotalTime(),this}wrapTime(e){let t=this.curve,a=t[0].time,r=t[t.length-1].time;return e<a?this.preWarpMode==Ar.Clamp?e=a:this.preWarpMode==Ar.PingPong?e=rs(e,a,r):e=is(e,a,r):e>r&&(this.postWarpMode==Ar.Clamp?e=r:this.postWarpMode==Ar.PingPong?e=rs(e,a,r):e=is(e,a,r)),e}evaluateCache(e,t){let a=t-e.time;return a*(a*(a*e.coeff[0]+e.coeff[1])+e.coeff[2])+e.coeff[3]}findCurve(e,t){let a=this.curve;for(let r=1;r<a.length;r++){let i=a[r-1],n=a[r];i.time<=e&&n.time>e&&(t.lhsIndex=r-1,t.rhsIndex=r)}}setupStepped(e,t,a){(isNaN(t.outSlope)||isNaN(a.inSlope))&&(e[0]=0,e[1]=0,e[2]=0,e[3]=t.value)}invalidateCache(){this._InvalidateCache=!0}calcTotalTime(){let e=0;for(let t of this.curve)t?e=Math.max(e,t.time):console.error(t);this._totalTime=e}static scaleCurveValue(e,t){if(!e._InvalidateCache)for(let a=0;a<e.curve.length;a++){let r=e.curve[a];r.value*=t,r.inSlope*=t,r.outSlope*=t}e.invalidateCache()}}class Fd extends Ni{attribute="";propertyList;path;constructor(){super()}unSerialized(e){let{attribute:t,path:a}=e;return this.attribute=t,this.path=a,this.propertyList=t.split("."),super.unSerialized(e.curve),this}}class kd{curve={}}var li=(s=>(s[s.Default=0]="Default",s[s.Clamp=1]="Clamp",s[s.Once=1]="Once",s[s.Loop=2]="Loop",s[s.PingPong=4]="PingPong",s[s.ClampForever=8]="ClampForever",s))(li||{});class Lb{name;objAnimClip;totalTime=0;time=0;_stopTime=0;_loopTime;_wrapMode;_sampleRate;get wrapMode(){return this._wrapMode||(this._wrapMode=0),this._wrapMode}set wrapMode(e){this._wrapMode=e}parse(e){this.objAnimClip={};let t=e.AnimationClip,{m_Name:a,m_AnimationClipSettings:r,m_WrapMode:i,m_SampleRate:n}=t;this.name=a,this._wrapMode=i,this._sampleRate=n,this._loopTime=r.m_LoopTime;for(const o in t.m_EditorCurves)if(Object.prototype.hasOwnProperty.call(t.m_EditorCurves,o)){const l=t.m_EditorCurves[o];let c=l.attribute,f=new Fd;f.unSerialized(l),this.totalTime=Math.max(this.totalTime,f.totalTime);let h=this.objAnimClip[l.path];h||(h=new kd,this.objAnimClip[l.path]=h),h.curve[c]=f}}}class Ed{transform;quaternion;materialColor}class Pi{static Property={"m_LocalPosition.x":"localPosition.x","m_LocalPosition.y":"localPosition.y","m_LocalPosition.z":"localPosition.z","m_LocalRotation.x":"localQuaternion.x","m_LocalRotation.y":"localQuaternion.y","m_LocalRotation.z":"localQuaternion.z","m_LocalRotation.w":"localQuaternion.w","localEulerAnglesRaw.x":"localRotation.x","localEulerAnglesRaw.y":"localRotation.y","localEulerAnglesRaw.z":"localRotation.z","m_LocalEulerAngles.x":"localRotation.x","m_LocalEulerAngles.y":"localRotation.y","m_LocalEulerAngles.z":"localRotation.z","m_LocalScale.x":"localScale.x","m_LocalScale.y":"localScale.y","m_LocalScale.z":"localScale.z","m_Color.r":"materialColor.r","m_Color.g":"materialColor.g","m_Color.b":"materialColor.b","m_Color.a":"materialColor.a","material._Color.r":"materialColor.r","material._Color.g":"materialColor.g","material._Color.b":"materialColor.b","material._Color.a":"materialColor.a","material._UnlitColor.r":"materialColor.r","material._UnlitColor.g":"materialColor.g","material._UnlitColor.b":"materialColor.b","material._UnlitColor.a":"materialColor.a","field of view":"camera3D.fov",m_IsActive:"active",m_Sprite:"sprite",m_FlipX:"flipX",m_FlipY:"flipY"};static Scale={"m_LocalPosition.x":1,"m_LocalPosition.y":1,"m_LocalPosition.z":-1,"localEulerAnglesRaw.x":-1,"localEulerAnglesRaw.y":1,"localEulerAnglesRaw.z":1,"m_LocalEulerAngles.x":-1,"m_LocalEulerAngles.y":1,"m_LocalEulerAngles.z":1,"m_LocalRotation.x":1,"m_LocalRotation.y":1,"m_LocalRotation.z":-1,"m_LocalRotation.w":-1,"field of view":1,m_IsActive:1,m_Sprite:1};static updatePropertyTag(e,t){e.quaternion||=this.tag_quaternion[t],e.transform||=this.tag_transform[t],e.materialColor||=this.tag_materialColor[t]}static tag_quaternion={"m_LocalRotation.x":!0,"m_LocalRotation.y":!0,"m_LocalRotation.z":!0,"m_LocalRotation.w":!0};static tag_materialColor={"material._Color.r":!0,"material._Color.g":!0,"material._Color.b":!0,"material._Color.a":!0,"material._UnlitColor.r":!0,"material._UnlitColor.g":!0,"material._UnlitColor.b":!0,"material._UnlitColor.a":!0};static tag_transform={"m_LocalPosition.x":!0,"m_LocalPosition.y":!0,"m_LocalPosition.z":!0,"m_LocalRotation.x":!0,"m_LocalRotation.y":!0,"m_LocalRotation.z":!0,"m_LocalRotation.w":!0,"localEulerAnglesRaw.x":!0,"localEulerAnglesRaw.y":!0,"localEulerAnglesRaw.z":!0,"m_LocalEulerAngles.x":!0,"m_LocalEulerAngles.y":!0,"m_LocalEulerAngles.z":!0,"m_LocalScale.x":!0,"m_LocalScale.y":!0,"m_LocalScale.z":!0}}class Mr{static Complete=0;static Seek=1;_rootObject3D;_animation;_propertyCache;_currentClip;_frame=0;_time=0;_isPlaying=!0;speed=1;_propertyTagDic;constructor(e){this._rootObject3D=e.object3D,this._animation=e,this._propertyTagDic=new Map,this.reset()}reset(){this._propertyCache={},this._propertyTagDic.clear()}get time(){return this._time}get currentClip(){return this._currentClip}play(e,t=!0){this._isPlaying=!0,t&&(this._time=0),e!=this._currentClip&&e&&this.parseAnimClip(e),this._currentClip=e,this.validProperty()}parseAnimClip(e){this.reset();for(const t in e.objAnimClip){let a=e.objAnimClip[t],r=this._rootObject3D,i={};if(t==""?r=this._rootObject3D:r=this._rootObject3D.getObjectByName(t),!r)continue;let n=new Ed;this._propertyTagDic.set(r,n);let o=a.curve;for(const l in o){Pi.updatePropertyTag(n,l);let c=this._propertyCache[t]||={},f=Pi.Property[l].split("."),h=f[0];if(f.length>1){let u=i[h];u||(u=i[h]=r[h]),c[l]={value:u,property:f[1]}}else c[l]={value:r,property:f[0]}}}return this}stop(){return this._isPlaying=!1,this}toggle(){return this._isPlaying=!this._isPlaying,this}get isPlaying(){return this._isPlaying}update(e,t){if(e=e*.001,t=t*.001,!this._currentClip||this._frame==e||!this._isPlaying)return;this._frame=e;let a=this._time;this._time=this.calcTime(a+t*this.speed),this.validProperty(),this._currentClip.wrapMode!=li.Loop&&this._currentClip.wrapMode!=li.Default&&(this.speed>0?this._time>=this._currentClip.totalTime:this._time<=0)&&(this._isPlaying=!1,this._animation.statusCall(Mr.Complete,a,this._time)),this._animation.statusCall(Mr.Seek,a,this._time)}seek(e){return this._time=this.calcTime(e),this._rootObject3D&&this.validProperty(),this}calcTime(e){return this._currentClip.wrapMode==li.Loop||this._currentClip.wrapMode==li.Default?e=cs(e,this._currentClip.totalTime):e=Ae(e,0,this._currentClip.totalTime),e}validProperty(){for(const e in this._currentClip.objAnimClip){let a=this._currentClip.objAnimClip[e].curve;for(const r in a){const i=a[r];let n=this._propertyCache[e][r],o=i.getValue(this._time);r in Pi.Scale&&(o*=Pi.Scale[r]),n.value[n.property]=o}}this._propertyTagDic.forEach((e,t)=>{this.applyProperty(e,t)})}applyProperty(e,t){e.quaternion&&R.getEuler(t.transform.localRotation,t.transform.localRotQuat,!0,"ZYX"),e.transform&&(t.transform.localPosition=t.transform.localPosition,t.transform.localRotation=t.transform.localRotation,t.transform.localScale=t.transform.localScale);let a=t;e.materialColor&&a.notifyMaterialColorChange(0,"baseColor")}}class Gb{clipName;data;time}class Vi extends bt{static SEEK="SEEK";static COMPLETE="COMPLETE";animation;frame;constructor(e,t){super(t),this.animation=e}}class ho extends qe{_animator;_clips=[];defaultClip;autoPlay;_seekEvent;_completeEvent;_keyFrameList;constructor(){super(),this._seekEvent=new Vi(this,Vi.SEEK),this._completeEvent=new Vi(this,Vi.COMPLETE),this._keyFrameList={}}registerEventKeyFrame(e){let t=this._keyFrameList[e.clipName];t==null&&(this._keyFrameList[e.clipName]=t=[]),t.push(e)}init(){this._animator=new Mr(this)}onUpdate(){this.enable&&this._animator.update(Le.time,Le.delta)}appendClip(e){this._clips.push(e),this.play(e.name)}statusCall(e,t,a){if(e==Mr.Complete)this.eventDispatcher.dispatchEvent(this._completeEvent);else if(e==Mr.Seek&&t!=a){let r=this._keyFrameList[this.currentClip.name];if(r)for(let i of r)i.time>t&&i.time<=a&&(this._seekEvent.data=this._seekEvent.frame=i,this.eventDispatcher.dispatchEvent(this._seekEvent))}}set speed(e){this._animator.speed=e}get speed(){return this._animator.speed}stop(){this._animator.stop()}toggle(){this._animator.toggle()}getClip(e){let t;for(let a of this._clips)if(a.name==e){t=a;break}return t}get currentClip(){return this._animator.currentClip}get time(){return this._animator.time}seek(e){this._animator.seek(e)}play(e,t=!0){let a=this.getClip(e);return a?(this._animator.play(a,t),a):null}start(){this.autoPlay&&this.play(this.defaultClip)}copyComponent(e){this.autoPlay=e.autoPlay,this.defaultClip=e.defaultClip;let t=e._clips;for(let a=0,r=t.length;a<r;a++)this.appendClip(t[a]);return this}cloneTo(e){e.addComponent(ho).copyComponent(this)}}var zb=Object.getOwnPropertyDescriptor,Wb=(s,e,t,a)=>{for(var r=a>1?void 0:a?zb(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.SkinnedMeshRenderer2=class extends d.MeshRenderer{skinJointsName;mInverseBindMatrixData;mInverseBindMatrixBuffer;mSkeletonAnimation;mJointIndexTableBuffer;constructor(){super(),this.addRendererMask(Qe.SkinnedMesh)}get geometry(){return this._geometry}set geometry(e){this.skinJointsName=e.skinNames;let t=[];for(let a=0;a<e.bindPose.length;a++)t.push(new Float32Array(e.bindPose[a].rawData.slice(0,16)));this.skinInverseBindMatrices=t,super.geometry=e}start(){if(super.start(),this.skeletonAnimation=this.object3D.getComponent(d.AnimatorComponent),!this.skeletonAnimation){let e=this.object3D.parentObject.parentObject.getComponentsInChild(d.AnimatorComponent);e.length>0&&(this.skeletonAnimation=e[0]);let t=this.object3D;for(;!this.skeletonAnimation&&t;)this.skeletonAnimation=t.getComponentFromParent(d.AnimatorComponent),t.parent&&(t=t.parent.object3D)}}get blendShape(){return this.morphData}onEnable(){super.onEnable()}get skeletonAnimation(){return this.mSkeletonAnimation}set skeletonAnimation(e){if(this.mSkeletonAnimation=e,!!e&&!this.mJointIndexTableBuffer){let t=this.mSkeletonAnimation.getJointIndexTable(this.skinJointsName);this.mJointIndexTableBuffer=new Te(t.length,0,new Float32Array(t)),this.mJointIndexTableBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.COMPUTE}}get skinInverseBindMatrices(){return this.mInverseBindMatrixData}set skinInverseBindMatrices(e){this.mInverseBindMatrixData=e;var t=new Float32Array(e.length*16);for(let a=0;a<e.length;a++){let r=a*16,i=e[a];t.set(i,r)}this.mInverseBindMatrixBuffer=new Te(t.byteLength,0,t),this.mInverseBindMatrixBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.COMPUTE}get inverseBindMatrixBuffer(){return this.mInverseBindMatrixBuffer}get jointIndexTableBuffer(){return this.mJointIndexTableBuffer.buffer}cloneTo(e){let t=e.addComponent(d.SkinnedMeshRenderer2),a=[];for(const r of this.materials)a.push(r.clone());t.materials=a,t.geometry=this.geometry,t.castShadow=this.castShadow,t.castGI=this.castGI,t.receiveShadow=this.receiveShadow,t.rendererMask=this.rendererMask,t.skinJointsName=this.skinJointsName,t.skinInverseBindMatrices=this.skinInverseBindMatrices,t.mJointIndexTableBuffer=this.mJointIndexTableBuffer}nodeUpdate(e,t,a,r){for(let i=0;i<this.materials.length;i++){let o=this.materials[i].getPass(t);if(o)for(let l=0;l<o.length;l++){const c=o[l];!c.pipeline&&this.mSkeletonAnimation&&(c.setStorageBuffer("jointsMatrixIndexTable",this.mSkeletonAnimation.jointMatrixIndexTableBuffer),c.setStorageBuffer("jointsInverseMatrix",this.mInverseBindMatrixBuffer),c.setStorageBuffer("jointsIndexMapingTable",this.mJointIndexTableBuffer))}}super.nodeUpdate(e,t,a,r)}},d.SkinnedMeshRenderer2=Wb([Lt(d.SkinnedMeshRenderer2,"SkinnedMeshRenderer2")],d.SkinnedMeshRenderer2);class Jb extends qe{_targetRenderers={};_vec3=new b;_matrix4=new R;_quaternion=new ae;init(e){let t=this.fetchMorphRenderers(this.object3D,d.SkinnedMeshRenderer2),a=this.fetchMorphRenderers(this.object3D,d.MeshRenderer);t.push(...a);for(const r of t){aa.hasMask(r.rendererMask,Qe.MorphTarget)&&r.selfCloneMaterials("MORPH_TARGET_UUID");for(const n in r.geometry.morphTargetDictionary){let o=this._targetRenderers[n]||[];o.push(r),this._targetRenderers[n]=o}}}getMorphRenderersByKey(e){return this._targetRenderers[e]}cloneMorphRenderers(){let e={};for(let t in this._targetRenderers)e[t]=this._targetRenderers[t];return e}applyBlendShape(e,t,a=1){if(!e){console.warn("blendShape is null");return}this._vec3.setFromArray(e.transform.transform[3]),this._vec3.multiplyScalar(a),this.object3D.transform.localPosition=this._vec3,this._vec3.setFromArray(e.transform.transform[2]),this._matrix4.copyColFrom(2,this._vec3),this._vec3.setFromArray(e.transform.transform[1]),this._matrix4.copyColFrom(1,this._vec3),this._vec3.setFromArray(e.transform.transform[0]),this._matrix4.copyColFrom(0,this._vec3),this._matrix4.transpose(),this._quaternion.fromMatrix(this._matrix4),this.object3D.localQuaternion=this._quaternion;for(let r in t){let i=this._targetRenderers[r],n=t[r],o=e.texture[n];this.applyMorphTargetInfluence(r,o,i)}}applyMorphTargetInfluence(e,t,a){for(let r of a)r.setMorphInfluence(e,t)}fetchMorphRenderers(e,t){let a=e.getComponentsInChild(t),r=[];for(let i of a)i.hasMask(Qe.MorphTarget)&&r.push(i);return r}}class jb{texture;transform}var wd=(s=>(s.mouthRollLower="mouthRollLower",s.browOuterUp_L="browOuterUpLeft",s.mouthSmile_L="mouthSmileLeft",s.jawRight="jawRight",s.eyeLookOut_L="eyeLookOutLeft",s.mouthFunnel="mouthFunnel",s.mouthUpperUp_R="mouthUpperUpRight",s.browDown_L="browDownLeft",s.jawLeft="jawLeft",s.mouthLowerDown_L="mouthLowerDownLeft",s.noseSneer_R="noseSneerRight",s.jawForward="jawForward",s.mouthLowerDown_R="mouthLowerDownRight",s.browInnerUp="browInnerUp",s.mouthRollUpper="mouthRollUpper",s.mouthStretch_R="mouthStretchRight",s.mouthPucker="mouthPucker",s.eyeBlink_L="eyeBlinkLeft",s.mouthUpperUp_L="mouthUpperUpLeft",s.mouthShrugUpper="mouthShrugUpper",s.eyeLookIn_R="eyeLookInRight",s.noseSneer_L="noseSneerLeft",s.mouthFrown_L="mouthFrownLeft",s.cheekSquint_L="cheekSquintLeft",s.eyeLookDown_L="eyeLookDownLeft",s.mouthDimple_L="mouthDimpleLeft",s.mouthFrown_R="mouthFrownRight",s.eyeLookIn_L="eyeLookInLeft",s.eyeLookOut_R="eyeLookOutRight",s.mouthLeft="mouthLeft",s.mouthStretch_L="mouthStretchLeft",s.mouthPress_L="mouthPressLeft",s.mouthDimple_R="mouthDimpleRight",s.eyeWide_R="eyeWideRight",s.browDown_R="browDownRight",s.eyeLookUp_R="eyeLookUpRight",s.eyeBlink_R="eyeBlinkRight",s.cheekSquint_R="cheekSquintRight",s.mouthRight="mouthDimpleRight",s.eyeLookDown_R="eyeLookDownRight",s.eyeLookUp_L="eyeLookUpLeft",s.eyeSquint_L="eyeSquintLeft",s.jawOpen="jawOpen",s.browOuterUp_R="browOuterUpRight",s.mouthClose="mouthClose",s.mouthShrugLower="mouthShrugLower",s.eyeWide_L="eyeWideLeft",s.tongueOut="tongueOut",s.eyeSquint_R="eyeSquintRight",s.cheekPuff="cheekPuff",s.mouthPress_R="mouthPressRight",s.mouthSmile_R="mouthSmileRight",s))(wd||{});class Zb{joints;constructor(e=[]){this.joints=e}get numJoint(){return this.joints.length}addJoint(e){e.index=this.joints.push(e)-1}getJointName(e){return this.joints[e].name}getJointParentIndex(e){let t=this.joints[e];return t.parent?t.parent.index:-1}getJointByName(e){for(let t of this.joints)if(t.name==e)return t;return null}}class Yb{_computePipeline;_computeBindGroup;constructor(e,t){let a=w.device;this._computePipeline=a.createComputePipeline({layout:"auto",compute:{module:a.createShaderModule({code:e}),entryPoint:"CsMain"}}),this._computeBindGroup=a.createBindGroup({layout:this._computePipeline.getBindGroupLayout(0),entries:t})}compute(e,t,a,r){let i=e.beginComputePass();return i.setPipeline(this._computePipeline),i.setBindGroup(0,this._computeBindGroup),i.dispatchWorkgroups(t,a,r),i.end(),this}}class Xb extends sr{numJoint;numState;time;weight;argumentsData;_isDirty=!1;_argumentsBuffer;_argumentsBufferEntries;constructor(){super(),this.allocationMemorySet([{name:"numJoint",data:[0]},{name:"numState",data:[0]},{name:"retain1",data:[0]},{name:"retain2",data:[0]},{name:"time",data:[0,0]},{name:"weight",data:[0,0]}]),this.generateGPUBuffer()}getGPUBuffer(){return this._argumentsBuffer}getGPUBindGroupEntry(){return this._argumentsBufferEntries}updateGPUBuffer(){return this._isDirty&&(this._isDirty=!1,w.device.queue.writeBuffer(this._argumentsBuffer,0,this.shareDataBuffer)),this}allocationMemorySet(e){this.argumentsData={};let t=0;for(let a=0;a<e.length;a++){const r=e[a];t+=r.data.length}this.allocation(t*4);for(let a=0;a<e.length;a++){const r=e[a],i=r.name;this.argumentsData[i]=this.allocation_node(r.data.length*4)}}generateGPUBuffer(){let e=w.device;this._argumentsBuffer=e.createBuffer({size:this.shareDataBuffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST,mappedAtCreation:!1}),this._argumentsBufferEntries={binding:0,resource:{buffer:this._argumentsBuffer,offset:0,size:this.shareDataBuffer.byteLength}}}}class Hb extends sr{numJoint;numFrame;retain0;retain1;argumentsData;_isDirty=!1;_argumentsBuffer;_argumentsBufferEntries;constructor(){super(),this.allocationMemorySet([{name:"numJoint",data:[0]},{name:"numFrame",data:[0]},{name:"retain0",data:[0]},{name:"retain1",data:[0]}]),this.generateGPUBuffer()}getGPUBuffer(){return this._argumentsBuffer}getGPUBindGroupEntry(){return this._argumentsBufferEntries}updateGPUBuffer(){this._isDirty&&(this._isDirty=!1,w.device.queue.writeBuffer(this._argumentsBuffer,0,this.shareDataBuffer))}allocationMemorySet(e){this.argumentsData={};let t=0;for(let r=0;r<e.length;r++){const i=e[r];t+=i.data.length}this.allocation(t*4);let a=this;for(let r=0;r<e.length;r++){const i=e[r],n=i.name;this.argumentsData[n]=this.allocation_node(i.data.length*4),a[n]=this.argumentsData[n]}}generateGPUBuffer(){let e=w.device;this._argumentsBuffer=e.createBuffer({size:this.shareDataBuffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST,mappedAtCreation:!1}),this._argumentsBufferEntries={binding:0,resource:{buffer:this._argumentsBuffer,offset:0,size:this.shareDataBuffer.byteLength}}}}class Kb{_autoUpdate=!0;_target;_lookAtObject;_origin=new b(0,0,0);_speed=300;constructor(e=null,t=null){this._target=e,this._lookAtObject=t}get target(){return this._target}set target(e){this._target!=e&&(this._target=e)}get lookAtObject(){return this._lookAtObject}set lookAtObject(e){this._lookAtObject!=e&&(this._lookAtObject=e)}get speed(){return this._speed}set speed(e){this._speed=e}update(){}}class qb extends qe{focus;distance=5;_camera;constructor(){super()}start(){if(this._camera=this.object3D.getOrAddComponent(Hr),!this._camera){console.error("FirstPersonCameraController need camera");return}if(!this.focus){console.error("FirstPersonCameraController need target");return}_.inputSystem.addEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.addEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.addEventListener(j.POINTER_DOWN,this.mouseDown,this)}mouseDown(e){_.inputSystem.addEventListener(j.POINTER_MOVE,this.mouseMove,this)}mouseUp(e){_.inputSystem.removeEventListener(j.POINTER_MOVE,this.mouseMove,this)}mouseMove(e){let t=this.transform.localRotation;t.y+=e.movementX*.01,t.x+=e.movementY*.01,this.transform.localRotation=t}mouseWheel(e){this.distance+=_.inputSystem.wheelDelta*.1}onUpdate(){let e=new b;this._camera.transform.forward.scaleToRef(this.distance,e);var t=this.focus.transform.worldPosition;this._camera.transform.localPosition=t}destroy(e){_.inputSystem.removeEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.removeEventListener(j.POINTER_DOWN,this.mouseDown,this),super.destroy(e)}}var et=(s=>(s[s.Key_BackSpace=8]="Key_BackSpace",s[s.Key_Tab=9]="Key_Tab",s[s.Key_Clear=12]="Key_Clear",s[s.Key_Enter=13]="Key_Enter",s[s.Key_Shift_L=16]="Key_Shift_L",s[s.Key_Control_L=17]="Key_Control_L",s[s.Key_Alt_L=18]="Key_Alt_L",s[s.Key_Pause=19]="Key_Pause",s[s.Key_CapsLock=20]="Key_CapsLock",s[s.Key_Escape=21]="Key_Escape",s[s.Key_Esc=27]="Key_Esc",s[s.Key_Space=32]="Key_Space",s[s.Key_Prior=33]="Key_Prior",s[s.Key_Next=34]="Key_Next",s[s.Key_End=35]="Key_End",s[s.Key_Home=36]="Key_Home",s[s.Key_Left=37]="Key_Left",s[s.Key_Up=38]="Key_Up",s[s.Key_Right=39]="Key_Right",s[s.Key_Down=40]="Key_Down",s[s.Key_Select=41]="Key_Select",s[s.Key_Print=42]="Key_Print",s[s.Key_Execute=43]="Key_Execute",s[s.Key_Insert=45]="Key_Insert",s[s.Key_Delete=46]="Key_Delete",s[s.Key_Help=47]="Key_Help",s[s.Key_0=48]="Key_0",s[s.Key_1=49]="Key_1",s[s.Key_2=50]="Key_2",s[s.Key_3=51]="Key_3",s[s.Key_4=52]="Key_4",s[s.Key_5=53]="Key_5",s[s.Key_6=54]="Key_6",s[s.Key_7=55]="Key_7",s[s.Key_8=56]="Key_8",s[s.Key_9=57]="Key_9",s[s.Key_A=65]="Key_A",s[s.Key_B=66]="Key_B",s[s.Key_C=67]="Key_C",s[s.Key_D=68]="Key_D",s[s.Key_E=69]="Key_E",s[s.Key_F=70]="Key_F",s[s.Key_G=71]="Key_G",s[s.Key_H=72]="Key_H",s[s.Key_I=73]="Key_I",s[s.Key_J=74]="Key_J",s[s.Key_K=75]="Key_K",s[s.Key_L=76]="Key_L",s[s.Key_M=77]="Key_M",s[s.Key_N=78]="Key_N",s[s.Key_O=79]="Key_O",s[s.Key_P=80]="Key_P",s[s.Key_Q=81]="Key_Q",s[s.Key_R=82]="Key_R",s[s.Key_S=83]="Key_S",s[s.Key_T=84]="Key_T",s[s.Key_U=85]="Key_U",s[s.Key_V=86]="Key_V",s[s.Key_W=87]="Key_W",s[s.Key_X=88]="Key_X",s[s.Key_Y=89]="Key_Y",s[s.Key_Z=90]="Key_Z",s[s.Key_KP_0=96]="Key_KP_0",s[s.Key_KP_1=97]="Key_KP_1",s[s.Key_KP_2=98]="Key_KP_2",s[s.Key_KP_3=99]="Key_KP_3",s[s.Key_KP_4=100]="Key_KP_4",s[s.Key_KP_5=101]="Key_KP_5",s[s.Key_KP_6=102]="Key_KP_6",s[s.Key_KP_7=103]="Key_KP_7",s[s.Key_KP_8=104]="Key_KP_8",s[s.Key_KP_9=105]="Key_KP_9",s[s.Key_Multiply=106]="Key_Multiply",s[s.Key_Add=107]="Key_Add",s[s.Key_Separator=108]="Key_Separator",s[s.Key_Subtract=109]="Key_Subtract",s[s.Key_Decimal=110]="Key_Decimal",s[s.Key_Divide=111]="Key_Divide",s[s.Key_F1=112]="Key_F1",s[s.Key_F2=113]="Key_F2",s[s.Key_F3=114]="Key_F3",s[s.Key_F4=115]="Key_F4",s[s.Key_F5=116]="Key_F5",s[s.Key_F6=117]="Key_F6",s[s.Key_F7=118]="Key_F7",s[s.Key_F8=119]="Key_F8",s[s.Key_F9=120]="Key_F9",s[s.Key_F10=121]="Key_F10",s[s.Key_F11=122]="Key_F11",s[s.Key_F12=123]="Key_F12",s[s.Key_F13=124]="Key_F13",s[s.Key_F14=125]="Key_F14",s[s.Key_F15=126]="Key_F15",s[s.Key_F16=127]="Key_F16",s[s.Key_F17=128]="Key_F17",s[s.Key_F18=129]="Key_F18",s[s.Key_F19=130]="Key_F19",s[s.Key_F20=131]="Key_F20",s[s.Key_F21=132]="Key_F21",s[s.Key_F22=133]="Key_F22",s[s.Key_F23=134]="Key_F23",s[s.Key_F24=135]="Key_F24",s[s.Key_Num_Lock=136]="Key_Num_Lock",s[s.Key_Scroll_Lock=137]="Key_Scroll_Lock",s))(et||{});class $b extends qe{moveSpeed=2;targetPos=new b(0,0,10);lookAtPos=new b(0,0,0);config={shiftMoveScale:20};_moveScale=1;_dir;_mouseFactory=25;_factory=1.5;_mouseDown=!1;_lastPos;_keyState;constructor(){super(),this._lastPos=new b,this._keyState={front:!1,back:!1,left:!1,right:!1,q:!1,e:!1},this.setCamera(new b(0,0,100),new b(0,0,0))}setCamera(e,t){this.targetPos.copyFrom(e),this.lookAtPos.copyFrom(t),this.Reset()}start(){_.inputSystem.addEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.addEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.addEventListener(j.POINTER_DOWN,this.mouseDown,this),_.inputSystem.addEventListener(Ra.KEY_UP,this.keyUp,this),_.inputSystem.addEventListener(Ra.KEY_DOWN,this.keyDown,this),this.transform.lookAt(this.targetPos,this.lookAtPos)}mouseWheel(e){}keyUp(e){switch(e.keyCode){case et.Key_W:this._keyState.front=!1;break;case et.Key_S:this._keyState.back=!1;break;case et.Key_A:this._keyState.left=!1;break;case et.Key_D:this._keyState.right=!1;break;case et.Key_Shift_L:this._moveScale=1;break;case et.Key_Q:this._keyState.q=!1;break;case et.Key_E:this._keyState.e=!1;break;case et.Key_F:this.transform.lookAt(this.targetPos,this.lookAtPos);break}}keyDown(e){switch(e.keyCode){case et.Key_W:this._keyState.front=!0;break;case et.Key_S:this._keyState.back=!0;break;case et.Key_A:this._keyState.left=!0;break;case et.Key_D:this._keyState.right=!0;break;case et.Key_Q:this._keyState.q=!0;break;case et.Key_E:this._keyState.e=!0;break;case et.Key_Shift_L:this._moveScale=this.config.shiftMoveScale}}Reset(){this._lastPos.x=_.inputSystem.mouseLastX,this._lastPos.y=_.inputSystem.mouseLastY}mouseDown(e){this.Reset(),this._mouseDown=!0}mouseUp(e){this.Reset(),this._mouseDown=!1}get factory(){return this._factory}set factory(e){this._factory=e}get mouseFactory(){return this._mouseFactory}set mouseFactory(e){this._mouseFactory=e}internal(e,t,a){return(t-e)*a}onUpdate(){let e=this.transform,t=Ae(Le.delta,0,.016);if(this._mouseDown&&(e.rotationY-=this.internal(e.rotationY+(_.inputSystem.mouseLastX-this._lastPos.x)*.25,e.rotationY,t*this._mouseFactory),e.rotationX-=this.internal(e.rotationX+(_.inputSystem.mouseLastY-this._lastPos.y)*.25,e.rotationX,t*this._mouseFactory),this.Reset()),this._keyState.front){let a=e.forward;e.x-=this.internal(e.x+a.x*this.moveSpeed*this._moveScale,e.x,t*this._factory),e.y-=this.internal(e.y+a.y*this.moveSpeed*this._moveScale,e.y,t*this._factory),e.z-=this.internal(e.z+a.z*this.moveSpeed*this._moveScale,e.z,t*this._factory)}if(this._keyState.back){let a=e.forward;e.x+=this.internal(e.x+a.x*this.moveSpeed*this._moveScale,e.x,t*this._factory),e.y+=this.internal(e.y+a.y*this.moveSpeed*this._moveScale,e.y,t*this._factory),e.z+=this.internal(e.z+a.z*this.moveSpeed*this._moveScale,e.z,t*this._factory)}if(this._keyState.left){let a=e.left;e.x+=this.internal(e.x+a.x*this.moveSpeed*this._moveScale,e.x,t*this._factory),e.y+=this.internal(e.y+a.y*this.moveSpeed*this._moveScale,e.y,t*this._factory),e.z+=this.internal(e.z+a.z*this.moveSpeed*this._moveScale,e.z,t*this._factory)}if(this._keyState.right){let a=e.left;e.x-=this.internal(e.x+a.x*this.moveSpeed*this._moveScale,e.x,t*this._factory),e.y-=this.internal(e.y+a.y*this.moveSpeed*this._moveScale,e.y,t*this._factory),e.z-=this.internal(e.z+a.z*this.moveSpeed*this._moveScale,e.z,t*this._factory)}this._keyState.q&&(e.y=Sr(e.y,e.y-this.moveSpeed*this._moveScale,t*this._factory)),this._keyState.e&&(e.y=Sr(e.y,e.y+this.moveSpeed*this._moveScale,t*this._factory))}destroy(e){_.inputSystem.removeEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.removeEventListener(j.POINTER_DOWN,this.mouseDown,this),_.inputSystem.removeEventListener(Ra.KEY_UP,this.keyUp,this),_.inputSystem.removeEventListener(Ra.KEY_DOWN,this.keyDown,this),super.destroy(e)}}class Oi{static add(e,t,a){return a||(a=new b),a.x=e.x+t.x,a.y=e.y+t.y,a.z=e.z+t.z,a}static sub(e,t,a){return a||(a=new b),a.x=e.x-t.x,a.y=e.y-t.y,a.z=e.z-t.z,a}static mul(e,t,a){return a||(a=new b),a.x=e.x*t.x,a.y=e.y*t.y,a.z=e.z*t.z,a}static mulScale(e,t,a){return a||(a=new b),a.x=e.x*t,a.y=e.y*t,a.z=e.z*t,a}static div(e,t,a){return a||(a=new b),a.x=e.x/t.x,a.y=e.y/t.y,a.z=e.z/t.z,a}static normalize(e){return e.clone().normalize()}static dot(e,t){let a=b.HELP_0;return a.copyFrom(e),a.dotProduct(t)}static calculateVectorAngle_xz(e,t){return Math.acos((e.x*t.x+e.y*t.y)/Math.sqrt((e.x*e.x+e.y*e.y)*(t.x*t.x+t.y*t.y)))}static distance(e,t){return b.distance(e,t)}static getRandomXYZ(e=-100,t=100){return new b(Math.random()*(t-e)+e,Math.random()*(t-e)+e,Math.random()*(t-e)+e)}static getRandomV3(e=-100,t=100,a,r){return new b(Math.random()*t+e,Math.random()*r+a,Math.random()*t+e)}static sphere(e){let t=e*Math.random(),a=new b(Math.random()*1-.5,Math.random()*1-.5,Math.random()*1-.5);return a.normalize(),a.scaleBy(t),a}static sphereXYZ(e,t,a=1,r=1,i=1){let n=e+(t-e)*Math.random(),o=new b(Math.random()*a-a*.5,Math.random()*r-r*.5,Math.random()*i-i*.5);return o.normalize(),o.scaleBy(n),o}}class eg extends qe{camera;minDistance=.1;maxDistance=500;rollSmooth=15;dragSmooth=20;wheelSmooth=10;wheelStep=.002;mouseRightFactor=.25;mouseLeftFactor=20;smooth=!0;_wheelStep=.002;_distance=0;distance=10;_roll=0;roll=0;_pitch=0;pitch=0;_currentPos;_targetPos;_flowTarget;_flowOffset;_mouseLeftDown=!1;_mouseRightDown=!1;_bottomClamp=89.99;_topClamp=-89.99;get bottomClamp(){return this._bottomClamp}set bottomClamp(e){this._bottomClamp=e>89.99?89.99:e}get topClamp(){return this._topClamp}set topClamp(e){this._topClamp=e<-89.99?-89.99:e}_tempDir=new b;_tempPos=new b;constructor(){super(),this._currentPos=new d.Object3D,this._targetPos=new d.Object3D}start(){this.camera=this.object3D.getOrAddComponent(Hr),_.inputSystem.addEventListener(j.POINTER_DOWN,this.onMouseDown,this),_.inputSystem.addEventListener(j.POINTER_MOVE,this.onMouseMove,this,null,10),_.inputSystem.addEventListener(j.POINTER_UP,this.onMouseUp,this,null,10),_.inputSystem.addEventListener(j.POINTER_WHEEL,this.onMouseWheel,this)}flowTarget(e,t=b.ZERO){this._flowTarget=e,this._flowOffset||=new b,this._flowOffset.copyFrom(t)}getFlowTarget(){return this._flowTarget}setCamera(e,t,a,r){this.roll=e,this.pitch=t,this.distance=a,this.maxDistance<a*1.5&&(this.maxDistance=a*1.5),r&&this._targetPos.transform.localPosition.copy(r)}focusByBounds(e){let t=vs.genMeshBounds(e);this.focusBound(t)}focusBound(e){this.target=e.center}set target(e){this._targetPos.transform.localPosition.copy(e)}get target(){return this._targetPos.transform.localPosition}onMouseWheel(e){this.enable&&(this._wheelStep=this.wheelStep*Oi.distance(this._currentPos.transform.worldPosition,this.camera.transform.worldPosition)/10,this.distance-=_.inputSystem.wheelDelta*this._wheelStep,this.distance=Ae(this.distance,this.minDistance,this.maxDistance))}onMouseDown(e){if(this.enable)switch(e.mouseCode){case 0:this._mouseLeftDown=!0;break;case 1:break;case 2:this._mouseRightDown=!0;break}}onMouseUp(e){this._mouseLeftDown=!1,this._mouseRightDown=!1}onMouseMove(e){this.enable&&(this._mouseRightDown&&(b.HELP_1.x=-1*e.movementX*Math.cos(this._roll*Math.PI/180)-e.movementY*Math.sin(this._roll*Math.PI/180),b.HELP_1.z=-1*e.movementY*Math.cos(this._roll*Math.PI/180)+e.movementX*Math.sin(this._roll*Math.PI/180),this._targetPos.x+=b.HELP_1.x*this.mouseRightFactor,this._targetPos.z+=b.HELP_1.z*this.mouseRightFactor),this._mouseLeftDown&&(this.roll-=e.movementX*Le.delta*.001*this.mouseLeftFactor,this.pitch-=e.movementY*Le.delta*.001*this.mouseLeftFactor,this.pitch=Ae(this.pitch,this._topClamp,this._bottomClamp)))}onBeforeUpdate(e){if(!this.enable)return;this._flowTarget&&(b.HELP_0.copyFrom(this._flowTarget.transform.worldPosition),b.HELP_0.add(this._flowOffset,b.HELP_0),this.target=b.HELP_0);let t=Ae(Le.delta,0,.016);this.smooth?(this._currentPos.x+=(this._targetPos.x-this._currentPos.x)*t*this.dragSmooth,this._currentPos.y+=(this._targetPos.y-this._currentPos.y)*t*this.dragSmooth,this._currentPos.z+=(this._targetPos.z-this._currentPos.z)*t*this.dragSmooth,this._distance+=(this.distance-this._distance)*t*this.wheelSmooth,this._roll+=(this.roll-this._roll)*t*this.rollSmooth,this._pitch+=(this.pitch-this._pitch)*t*this.rollSmooth):(this._currentPos.x=this._targetPos.x,this._currentPos.y=this._targetPos.y,this._currentPos.z=this._targetPos.z,this._distance=this.distance,this._roll=this.roll,this._pitch=this.pitch),this._tempDir.set(0,0,1);let a=ae.HELP_0;a.fromEulerAngles(this._pitch,this._roll,0),this._tempDir.applyQuaternion(a),this._tempPos=Oi.mulScale(this._tempDir,this._distance,this._tempPos),this._tempPos.add(this._currentPos.transform.localPosition,this._tempPos),this.camera.lookAt(this._tempPos,this._currentPos.transform.localPosition,b.UP)}destroy(e){_.inputSystem.removeEventListener(j.POINTER_DOWN,this.onMouseDown,this),_.inputSystem.removeEventListener(j.POINTER_MOVE,this.onMouseMove,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.onMouseUp,this),_.inputSystem.removeEventListener(j.POINTER_WHEEL,this.onMouseWheel,this),super.destroy(e),this.camera=null,this._flowTarget=null}}class tg extends qe{_camera;autoRotate=!1;autoRotateSpeed=.1;rotateFactor=.5;zoomFactor=.1;panFactor=.25;_smooth=5;_minDistance=1;_maxDistance=1e5;_maxPolarAngle=90;_minPolarAngle=-90;_target=new b(0,0,0);_cTarget=new b(0,0,0);_position=new b(0,0,0);_cPosition=new b(0,0,0);_spherical=new ag;_isMouseDown=!1;_lastMouseX=-1;_lastMouseY=-1;_isPanning=!1;constructor(){super()}get target(){return this._target}set target(e){this._target=e}get smooth(){return this._smooth}set smooth(e){this._smooth=Math.max(e,1)}get minDistance(){return this._minDistance}set minDistance(e){this._minDistance=Ae(e,2e-6,this._maxDistance)}get maxDistance(){return this._maxDistance}set maxDistance(e){this._maxDistance=Ae(e,this._minDistance,1/0)}get minPolarAngle(){return this._minPolarAngle}set minPolarAngle(e){this._minPolarAngle=Ae(e,-90,this._maxPolarAngle)}get maxPolarAngle(){return this._maxPolarAngle}set maxPolarAngle(e){this._maxPolarAngle=Ae(e,this._minPolarAngle,90)}get spherical(){return this._spherical}start(){this._camera=this.object3D.getComponent(Hr),this._position=this.object3D.transform.localPosition.clone(),this._cPosition=this._position.clone(),this._target=this._camera.lookTarget.clone(),this._cTarget=this._target.clone(),this._spherical.setCoords(this._position.x-this._target.x,this._position.y-this._target.y,this._position.z-this._target.z),this._camera.lookAt(this._cPosition,this._cTarget,b.UP),this.addEventListener()}onEnable(){this.addEventListener()}onDisable(){this.removeEventListener()}onUpdate(){let e=this._isPanning?1:this.smooth,t=!1;this._cPosition.equals(this.object3D.transform.localPosition)||(this._position.copyFrom(this.object3D.transform.localPosition),e=1,t=!0),this._cTarget.equals(this._target)||(this._cTarget.copyFrom(this._target),e=1,t=!0),t?this._spherical.setCoords(this._position.x-this._target.x,this._position.y-this._target.y,this._position.z-this._target.z):!this._isMouseDown&&this.autoRotate&&(this._spherical.theta-=this.autoRotateSpeed*Math.PI/180,this.updateCamera());let a=(this._position.x-this._cPosition.x)/e,r=(this._position.y-this._cPosition.y)/e,i=(this._position.z-this._cPosition.z)/e;this._cPosition.x=Math.abs(a)>1e-10?this._cPosition.x+a:this._position.x,this._cPosition.y=Math.abs(r)>1e-10?this._cPosition.y+r:this._position.y,this._cPosition.z=Math.abs(i)>1e-10?this._cPosition.z+i:this._position.z,this._camera.lookAt(this._cPosition,this._cTarget,b.UP)}onWheel(e){e.deltaY=Ae(e.deltaY,-this._spherical.radius,this._spherical.radius),this._spherical.radius+=e.deltaY*this.zoomFactor,this._spherical.radius=Ae(this._spherical.radius,this.minDistance,this.maxDistance),this.updateCamera()}onPointerDown(e){this._isMouseDown=!0,this._lastMouseX=e.mouseX,this._lastMouseY=e.mouseY,e.mouseCode===2&&(this._isPanning=!0)}onPointerMove(e){if(!this._isMouseDown||!this.enable)return;let t=e.mouseX,a=e.mouseY;if(e.mouseCode===0&&this._lastMouseX>0&&this._lastMouseY>0){const r=-(t-this._lastMouseX)*this.rotateFactor,i=(a-this._lastMouseY)*this.rotateFactor;this._spherical.theta+=r*Math.PI/180,this._spherical.phi-=i*Math.PI/180,this._spherical.phi=Ae(this._spherical.phi,this.minPolarAngle,this.maxPolarAngle),this.updateCamera()}else e.mouseCode===2&&(Oi.mulScale(this.object3D.transform.up,e.movementY*this.panFactor*this._camera.aspect,b.HELP_1),e.ctrlKey||e.metaKey?this._target.y+=b.HELP_1.y:(this._target.x+=b.HELP_1.x,this._target.z+=b.HELP_1.z),Oi.mulScale(this.object3D.transform.right,-e.movementX*this.panFactor,b.HELP_1),this._target.x-=b.HELP_1.x,this._target.z-=b.HELP_1.z,this._cTarget.copyFrom(this._target),this.updateCamera());this._lastMouseX=t,this._lastMouseY=a}onPointerUp(e){this._isMouseDown=!1,e.mouseCode===2&&(this._isPanning=!1)}updateCamera(){this._spherical.makeSafe();let e=this._spherical.getCoords();this._position.set(e.x+this._target.x,e.y+this._target.y,e.z+this._target.z)}addEventListener(){_.inputSystem.addEventListener(j.POINTER_WHEEL,this.onWheel,this),_.inputSystem.addEventListener(j.POINTER_DOWN,this.onPointerDown,this),_.inputSystem.addEventListener(j.POINTER_MOVE,this.onPointerMove,this),_.inputSystem.addEventListener(j.POINTER_UP,this.onPointerUp,this)}removeEventListener(){_.inputSystem.removeEventListener(j.POINTER_WHEEL,this.onWheel,this),_.inputSystem.removeEventListener(j.POINTER_DOWN,this.onPointerDown,this),_.inputSystem.removeEventListener(j.POINTER_MOVE,this.onPointerMove,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.onPointerUp,this)}}const Rd=Math.PI/180/100;class ag{radius;phi;theta;coords;constructor(e=1,t=0,a=0){return this.radius=e,this.phi=t,this.theta=a,this.coords=new b,this}set(e,t,a){return this.radius=e,this.phi=t,this.theta=a,this}makeSafe(){return this.phi=Math.max(Rd,Math.min(Math.PI-Rd,this.phi)),this}setFromVector3(e){return this.setCoords(e.x,e.y,e.z)}setCoords(e,t,a){return this.radius=Math.sqrt(e*e+t*t+a*a),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,a),this.phi=Math.acos(Ae(t/this.radius,-1,1))),this}getCoords(){const e=Math.sin(this.phi)*this.radius;return this.coords.x=e*Math.sin(this.theta),this.coords.y=Math.cos(this.phi)*this.radius,this.coords.z=e*Math.cos(this.theta),this.coords}}class rg extends qe{focus;_rotation=new b(45,0,0);distance=5;_camera;constructor(){super()}start(){if(this._camera=this.object3D.getOrAddComponent(Hr),!this._camera){console.error("ThirdPersonCameraController need camera");return}if(!this.focus){console.error("ThirdPersonCameraController need target");return}_.inputSystem.addEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.addEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.addEventListener(j.POINTER_DOWN,this.mouseDown,this)}mouseDown(e){_.inputSystem.addEventListener(j.POINTER_MOVE,this.mouseMove,this)}mouseUp(e){_.inputSystem.removeEventListener(j.POINTER_MOVE,this.mouseMove,this)}mouseMove(e){this._rotation.y+=e.movementX*.01,this._rotation.x+=e.movementY*.01}mouseWheel(e){this.distance+=_.inputSystem.wheelDelta*.1}onUpdate(){let e=new b;this._camera.transform.forward.scaleToRef(this.distance,e);var t=this.focus.transform.worldPosition;this._camera.transform.localPosition=t.subtract(e)}destroy(e){_.inputSystem.removeEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.removeEventListener(j.POINTER_DOWN,this.mouseDown,this),super.destroy(e)}}var tt=(s=>(s[s.NORMAL=0]="NORMAL",s[s.DOWN=1]="DOWN",s[s.OVER=2]="OVER",s[s.DISABLE=3]="DISABLE",s))(tt||{});let Id=Math.PI*2;class Nr{a;b;c;d;tx;ty;constructor(e=1,t=0,a=0,r=1,i=0,n=0){this.a=e,this.b=t,this.c=a,this.d=r,this.tx=i,this.ty=n}clone(){return new Nr(this.a,this.b,this.c,this.d,this.tx,this.ty)}concat(e){let t=this.a,a=this.c,r=this.tx;this.a=t*e.a+this.b*e.c,this.b=t*e.b+this.b*e.d,this.c=a*e.a+this.d*e.c,this.d=a*e.b+this.d*e.d,this.tx=r*e.a+this.ty*e.c+e.tx,this.ty=r*e.b+this.ty*e.d+e.ty}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}identity(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this}invert(){this._invertInto(this)}rotate(e){if(e=+e,e!==0){e=e*pt;let t=Math.cos(e),a=Math.sin(e),r=this.a,i=this.b,n=this.c,o=this.d,l=this.tx,c=this.ty;this.a=r*t-i*a,this.b=r*a+i*t,this.c=n*t-o*a,this.d=n*a+o*t,this.tx=l*t-c*a,this.ty=l*a+c*t}}scale(e,t){e!==1&&(this.a*=e,this.c*=e,this.tx*=e),t!==1&&(this.b*=t,this.d*=t,this.ty*=t)}setTo(e,t,a,r,i,n){return this.a=e,this.b=t,this.c=a,this.d=r,this.tx=i,this.ty=n,this}transformPoint(e,t,a){let r=this.a*e+this.c*t+this.tx,i=this.b*e+this.d*t+this.ty;return a?(a.setTo(r,i,0,1),a):new b(r,i,0,1)}setTranslate(e,t){this.tx=e,this.ty=t}translate(e,t){this.tx+=e,this.ty+=t}mul(e){let t=this,a=e,r=t.a,i=t.b,n=t.c,o=t.d,l=t.tx,c=t.ty,f=a.a,h=a.b,u=a.c,g=a.d,A=a.tx,m=a.ty;h!==0||u!==0?(this.a=r*f+i*u,this.b=r*h+i*g,this.c=n*f+o*u,this.d=n*h+o*g,this.tx=f*l+u*c+A,this.ty=h*l+g*c+m):(this.a=r*f,this.b=i*g,this.c=n*f,this.d=o*g,this.tx=f*l+A,this.ty=g*c+m)}equals(e){return this.a==e.a&&this.b==e.b&&this.c==e.c&&this.d==e.d&&this.tx==e.tx&&this.ty==e.ty}prepend(e,t,a,r,i,n){let o=this.tx;if(e!=1||t!=0||a!=0||r!=1){let l=this.a,c=this.c;this.a=l*e+this.b*a,this.b=l*t+this.b*r,this.c=c*e+this.d*a,this.d=c*t+this.d*r}return this.tx=o*e+this.ty*a+i,this.ty=o*t+this.ty*r+n,this}append(e){let t=this.a,a=this.b,r=this.c,i=this.d;return(e.a!=1||e.b!=0||e.c!=0||e.d!=1)&&(this.a=e.a*t+e.b*r,this.b=e.a*a+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*a+e.d*i),this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*a+e.ty*i+this.ty,this}deltaTransformPoint(e){let t=this,a=t.a*e.x+t.c*e.y,r=t.b*e.x+t.d*e.y;return new b(a,r)}toString(){return"(a="+this.a+", b="+this.b+", c="+this.c+", d="+this.d+", tx="+this.tx+", ty="+this.ty+")"}createBox(e,t,a=0,r=0,i=0){let n=this;if(a!==0){a=a*pt;let o=Math.cos(a),l=Math.sin(a);n.a=o*e,n.b=l*t,n.c=-l*e,n.d=o*t}else n.a=e,n.b=0,n.c=0,n.d=t;n.tx=r,n.ty=i}createGradientBox(e,t,a=0,r=0,i=0){this.createBox(e/1638.4,t/1638.4,a,r+e/2,i+t/2)}_invertInto(e){let t=this.a,a=this.b,r=this.c,i=this.d,n=this.tx,o=this.ty;if(a==0&&r==0){e.b=e.c=0,t==0||i==0?e.a=e.d=e.tx=e.ty=0:(t=e.a=1/t,i=e.d=1/i,e.tx=-t*n,e.ty=-i*o);return}let l=t*i-a*r;if(l==0){e.identity();return}l=1/l;let c=e.a=i*l;a=e.b=-a*l,r=e.c=-r*l,i=e.d=t*l,e.tx=-(c*n+r*o),e.ty=-(a*n+i*o)}getScaleX(){let e=this;if(e.a==1&&e.b==0)return 1;let t=Math.sqrt(e.a*e.a+e.b*e.b);return this.getDeterminant()<0?-t:t}getScaleY(){let e=this;if(e.c==0&&e.d==1)return 1;let t=Math.sqrt(e.c*e.c+e.d*e.d);return this.getDeterminant()<0?-t:t}getSkewX(){return Math.atan2(this.d,this.c)-Math.PI/2}getSkewY(){return Math.atan2(this.b,this.a)}updateScaleAndRotation(e,t,a,r){if((a==0||a==Id)&&(r==0||r==Id)){this.a=e,this.b=this.c=0,this.d=t;return}a=a*pt,r=r*pt;let i=Math.cos(a),n=Math.sin(a);a==r?(this.a=i*e,this.b=n*e):(this.a=Math.cos(r)*e,this.b=Math.sin(r)*e),this.c=-n*t,this.d=i*t}preMultiplyInto(e,t){let a=e.a*this.a,r=0,i=0,n=e.d*this.d,o=e.tx*this.a+this.tx,l=e.ty*this.d+this.ty;(e.b!==0||e.c!==0||this.b!==0||this.c!==0)&&(a+=e.b*this.c,n+=e.c*this.b,r+=e.a*this.b+e.b*this.d,i+=e.c*this.a+e.d*this.c,o+=e.ty*this.c,l+=e.tx*this.b),t.a=a,t.b=r,t.c=i,t.d=n,t.tx=o,t.ty=l}$transformBounds(e){let t=this.a,a=this.b,r=this.c,i=this.d,n=this.tx,o=this.ty,l=e.x,c=e.y,f=l+e.width,h=c+e.height,u=t*l+r*c+n,g=a*l+i*c+o,A=t*f+r*c+n,m=a*f+i*c+o,p=t*f+r*h+n,D=a*f+i*h+o,B=t*l+r*h+n,v=a*l+i*h+o,C=0;u>A&&(C=u,u=A,A=C),p>B&&(C=p,p=B,B=C),e.x=Math.floor(u<p?u:p),e.width=Math.ceil((A>B?A:B)-e.x),g>m&&(C=g,g=m,m=C),D>v&&(C=D,D=v,v=C),e.y=Math.floor(g<D?g:D),e.height=Math.ceil((m>v?m:v)-e.y)}getDeterminant(){return this.a*this.d-this.b*this.c}}class Li extends qe{isGUICanvas=!0;index=0;addChild(e){return this.object3D.addChild(e),this}removeChild(e){return this.object3D.removeChild(e),this}cloneTo(e){e.getOrAddComponent(Li).copyComponent(this)}copyComponent(e){return e.index=e.index,this}}var nt=(s=>(s[s.NONE=0]="NONE",s[s.POSITION=1]="POSITION",s[s.SPRITE=2]="SPRITE",s[s.COLOR=4]="COLOR",s[s.MAX=7]="MAX",s))(nt||{});class uo{array;buffer;constructor(e){this.buffer=new Te(e,0),this.array=new Float32Array(this.buffer.memory.shareDataBuffer)}}class Qd extends Ve{_attributeUV;_attributeVIndex;_faceIndexes;_uvSize=2;_vIndexSize=1;_posAttribute;_spriteAttribute;_colorAttribute;_onPositionChange=!0;_onSpriteChange=!0;_onColorChange=!0;maxQuadCount;constructor(e){super(),this.maxQuadCount=e}updateSubGeometry(e,t,a){let r=this.subGeometries[e];if(r){let i=r.lodLevels[0];i.indexStart=t,i.indexCount=a,i.index=e}else r=this.addSubGeometry({indexStart:t,indexCount:a,vertexStart:0,vertexCount:0,firstStart:0,index:e,topology:0});return r}resetSubGeometries(){for(let e of this.subGeometries){let t=e.lodLevels[0];t.indexStart=0,t.indexCount=0,t.index=0}}updateBounds(e,t){let a=Number.MAX_VALUE*.1;return e=new b(-a,-a,-a),t=new b(a,a,a),this.bounds.setFromMinMax(e,t),this}getPositionBuffer(){return this._onPositionChange&&(this._posAttribute.buffer.apply(),this._onPositionChange=!1),this._posAttribute.buffer}getSpriteBuffer(){return this._onSpriteChange&&(this._spriteAttribute.buffer.apply(),this._onSpriteChange=!1),this._spriteAttribute.buffer}getColorBuffer(){return this._onColorChange&&(this._colorAttribute.buffer.apply(),this._onColorChange=!1),this._colorAttribute.buffer}create(){this.createBuffer(),this.updateBounds();let e=this.maxQuadCount,t=[],a=[];for(let i=0;i<e;i++)t.push(...ci.attUV);for(let i=0,n=this.maxQuadCount*ci.vertexCount;i<n;i++)a[i]=i;this._attributeUV=new Float32Array(ci.vertexCount*e*this._uvSize),this._attributeVIndex=new Float32Array(ci.vertexCount*e*this._vIndexSize),this._attributeUV.set(t,0),this._attributeVIndex.set(a,0);let r=[];for(let i=0;i<e;i++)for(let n=0;n<ci.indecies.length;n++){const o=ci.indecies[n]+i*4;r.push(o)}return this._faceIndexes=new Uint32Array(e*6),this._faceIndexes.set(r,0),this.setIndices(this._faceIndexes),this.setAttribute(G.uv,this._attributeUV),this.setAttribute(G.vIndex,this._attributeVIndex),this.updateSubGeometry(0,0,this._faceIndexes.length),this}createBuffer(){let e=this.maxQuadCount;this._posAttribute=new uo(e*4),this._spriteAttribute=new uo(e*12),this._colorAttribute=new uo(e*4)}fillQuad(e,t){e.dirtyAttributes&nt.POSITION&&this.fillQuadPosition(e,t),e.dirtyAttributes&nt.COLOR&&this.fillQuadColor(e,t),e.dirtyAttributes&nt.SPRITE&&this.fillQuadSprite(e,t)}fillQuadPosition(e,t){Td.setXYZW(this._posAttribute.array,e.z,e.left,e.bottom,e.right,e.top),this._onPositionChange=!0}fillQuadColor(e,t){let a=e.color,r=this._colorAttribute.array;Td.setXYZW(r,e.z,a.r,a.g,a.b,a.a),this._onColorChange=!0}fillQuadSprite(e,t){let a=e.sprite,r=0,i=0;a.isSliced&&e.imageType==ni.Sliced&&(r=a.trimSize.x,r=(t.width-(a.offsetSize.z-a.trimSize.x))/r,i=a.trimSize.y,i=(t.height-(a.offsetSize.w-a.trimSize.y))/i);let n=a.guiTexture.dynamicId,o=a.uvRec,l=a.uvBorder,c=this._spriteAttribute.array,f=12*e.z;c[f+0]=o.x,c[f+1]=o.y,c[f+2]=o.z,c[f+3]=o.w,c[f+4]=l.x,c[f+5]=l.y,c[f+6]=l.z,c[f+7]=l.w,c[f+8]=r,c[f+9]=i,c[f+10]=n,c[f+11]=e.visible?1:0,this._onSpriteChange=!0}}class ig{static set(e,t,a,r,...i){let n=t*r+a;for(let o=0,l=i.length;o<l;o++)e[n+o]=i[o]}}class Td extends ig{static setXYZW(e,t,a,r,i,n){this.set(e,t,0,4,a,r,i,n)}static setXYZ(e,t,a,r,i){this.set(e,t,0,4,a,r,i)}static setZ(e,t,a){this.set(e,t,3,4,a)}}class ci{static vertexCount=4;static attUV=[0,0,1,0,1,1,0,1];static indecies=[0,1,2,0,2,3]}class Md{_textureMap=new Map;_textureList=[];build(e,t,a){let r=t._geometry;r.resetSubGeometries();let i=-1,n=0,o=0,l=0,c=0,f=this._textureList,h=this._textureMap;function u(){l>0&&(t.updateDrawCallSegment(c,o,l),t._uiRenderer.materials[c].setTextures(f),h.clear(),f.length=0,c++,o+=l,l=0,n=0)}h.clear(),f.length=0;let g=[],A=t.quadMaxCount-1;for(let m of e){let p=m.needUpdateQuads;g.length=0;const D=this.collectQuads(m.object3D,g);for(let B of D){let v=B.sprite.guiTexture;if(h.has(v.staticId)||(n==7&&u(),h.set(v.staticId,v),v.dynamicId=n,f[n]=v.texture,n+=1),B.z=++i,l+=6,B.cacheTextureId!=v.dynamicId&&(B.dirtyAttributes=nt.MAX,B.cacheTextureId=v.dynamicId),(p||a)&&(B.dirtyAttributes=nt.MAX),B.dirtyAttributes&nt.POSITION&&B.applyTransform(m),B.dirtyAttributes&&B.writeToGeometry(r,m),i==A)return u(),!0}}return u(),!1}collectQuads(e,t){t||=[];let a=e.components.values();for(let r of a){let i=r;if(i.isUIShadow||!i.mainQuads)continue;let n=i.getShadowRender();n&&this.push(n.mainQuads,t),this.push(i.mainQuads,t)}return t}push(e,t){e&&e.length>0&&t.push(...e)}}class bo{static bindTextureArray(){let e="";for(let t=0;t<7;t++)e+=`
|
|
11539
|
+
`}class Dd{sunRadius=500;sunRadiance=11;mieG=.76;mieHeight=1200;eyePos=1500;sunX=.71;sunY=.56;sunBrightness=1;displaySun=!0;defaultTextureCubeSize=512;defaultTexture2DSize=1024;skyColor=new J(1,1,1,1)}class _d extends Sn{_internalTexture;_cubeSize;setting;constructor(e){return super(),this.setting=e,this._cubeSize=e.defaultTextureCubeSize,this._internalTexture=new Eb(e.defaultTexture2DSize,e.defaultTexture2DSize*.5),this._internalTexture.update(this.setting),this.createFromTexture(this._cubeSize,this._internalTexture),this}get texture2D(){return this._internalTexture}apply(){return this._internalTexture.update(this.setting),this._faceData.uploadErpTexture(this._internalTexture),this}}class Eb extends we{_computeShader;_uniformBuffer;constructor(e,t){super(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING),this.initCompute(e,t)}initCompute(e,t){this._uniformBuffer=new yt(64),this._uniformBuffer.apply(),this._computeShader=new ye(Ad.cs),this._computeShader.setUniformBuffer("uniformBuffer",this._uniformBuffer),this._computeShader.setStorageTexture("outTexture",this),this._computeShader.workerSizeX=e/8,this._computeShader.workerSizeY=t/8}update(e){this._uniformBuffer.setFloat("width",this.width),this._uniformBuffer.setFloat("height",this.height),this._uniformBuffer.setFloat("sunU",e.sunX),this._uniformBuffer.setFloat("sunV",e.sunY),this._uniformBuffer.setFloat("eyePos",e.eyePos),this._uniformBuffer.setFloat("sunRadius",e.sunRadius),this._uniformBuffer.setFloat("sunRadiance",e.sunRadiance),this._uniformBuffer.setFloat("mieG",e.mieG),this._uniformBuffer.setFloat("mieHeight",e.mieHeight),this._uniformBuffer.setFloat("sunBrightness",e.sunBrightness),this._uniformBuffer.setFloat("displaySun",e.displaySun?1:0),this._uniformBuffer.setColor("skyColor",e.skyColor),this._uniformBuffer.apply();let t=F.beginCommandEncoder();return F.computeCommand(t,[this._computeShader]),F.endCommandEncoder(t),this}}var wb=Object.getOwnPropertyDescriptor,Rb=(s,e,t,a)=>{for(var r=a>1?void 0:a?wb(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.SkyShader=class extends gt{constructor(){super();let e=new Xe("sky_vs_frag_wgsl","sky_fs_frag_wgsl");this.addRenderPass(e),e.setUniformVector3("eyesPos",new b),e.setUniformFloat("exposure",1),e.setUniformFloat("roughness",0);let t=e.shaderState;t.frontFace="cw",t.cullMode=Nt.back,t.depthWriteEnabled=!1,t.depthCompare=ot.less}},d.SkyShader=Rb([Ra(d.SkyShader,"SkyShader")],d.SkyShader);class Bd extends Dt{constructor(){super(),this.shader=new d.SkyShader,this.shader.setUniformVector3("eyesPos",new b),this.shader.setUniformFloat("exposure",1),this.shader.setUniformFloat("roughness",0)}set baseMap(e){this.setTexture("baseMap",e);const t="IS_HDR_SKY";this._shader.getDefaultShaders()[0].defineValue[t]!=e?.isHDRTexture&&this._shader.setDefine(t,!!e?.isHDRTexture)}get baseMap(){return this._shader.getDefaultColorShader().getTexture("baseMap")}set envMap(e){}set shadowMap(e){}get exposure(){return _.setting.sky.skyExposure}set exposure(e){_.setting.sky.skyExposure=e}get roughness(){return this._shader.getDefaultColorShader().uniforms.roughness.value}set roughness(e){let t=this._shader.getDefaultColorShader();"roughness"in t.uniforms&&(t.uniforms.roughness.value=e)}}class vd extends Ia{gid=0;needUpdate=!0;autoUpdate=!1;radius=500;init(){super.init(),this.addRendererMask(Qe.Reflection),this.alwaysRender=!0,this.object3D.bound=new xe(b.ZERO.clone(),b.MAX),nn(this.transform.onPositionChange,()=>{this.needUpdate=!0})}onEnable(){K.instance.addRenderNode(this.transform.scene3D,this)}onDisable(){K.instance.removeRenderNode(this.transform.scene3D,this)}renderPass2(e,t,a,r,i,n=!1){super.renderPass2(e,t,a,r,i,n)}}class Ud extends gt{constructor(){super();let e=new Xe("ReflectionShader_shader","ReflectionShader_shader");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);let t=e.shaderState;t.acceptShadow=!1,t.castShadow=!1,t.receiveEnv=!1,t.acceptGI=!1,t.useLight=!1,this.setDefine("USE_BRDF",!0),this.setDefine("USE_AO_R",!0),this.setDefine("USE_ROUGHNESS_G",!0),this.setDefine("USE_METALLIC_B",!0),this.setDefine("USE_ALPHA_A",!0),this.setDefault()}setDefault(){this.setUniformVector4("transformUV1",new he(0,0,1,1)),this.setUniformVector4("transformUV2",new he(0,0,1,1)),this.setUniformColor("baseColor",new J),this.setUniformFloat("alphaCutoff",0)}set _MainTex(e){this.setTexture("baseMap",e)}set _BumpMap(e){this.setTexture("normalMap",e)}set _MaskTex(e){this.setTexture("maskMap",e)}set _UVTransform(e){this.setUniformVector4("transformUV1",e)}set _Metallic(e){this.setUniformFloat("metallic",e)}set _Roughness(e){this.setUniformFloat("roughness",e)}set _MainColor(e){this.setUniformColor("baseColor",e)}set _AlphaCutoff(e){this.setUniformFloat("alphaCutoff",e)}set _DoubleSidedEnable(e){let t=this.getDefaultColorShader();t.shaderState.cullMode=e?Nt.none:t.shaderState.cullMode}set _SurfaceType(e){let t=this.getDefaultColorShader();e==0?t.blendMode=me.NONE:t.blendMode=me.ALPHA}set _AlphaCutoffEnable(e){e==0?this.setDefine("USE_ALPHACUT",!1):this.setDefine("USE_ALPHACUT",!0)}}class yd extends Dt{constructor(){super(),this.shader=new Ud,this.baseMap=_.res.whiteTexture,this.setDefine("USE_CUSTOMUNIFORM",!0),this.reflectionIndex=0}set baseMap(e){this.shader.setTexture("baseMap",e)}get baseMap(){return this.shader.getTexture("baseMap")}set baseColor(e){this.shader.setUniformColor("baseColor",e)}set reflectionIndex(e){this.shader.setUniformFloat("reflectionIndex",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set envMap(e){}set shadowMap(e){}}class Qr{center=new b;extents;max;min;size;tmpVecA=new b;tmpVecB=new b;tmpVecC=new b;tmpVecD=new b;radius=0;diffBetweenPoints=new b;owner;forward=new b(0,0,1);worldCenter;worldSize;_center=new b;constructor(e,t){this.center=e||new b(0,0,0),this.radius=t===void 0?.5:t}updateBound(){throw new Error("Method not implemented.")}containsPoint(e){var t=this.tmpVecA.subtract(e,this.center).lengthSquared,a=this.radius;return t<a*a}intersectsRay(e,t){var a=this.tmpVecA.copyFrom(e.origin).subtract(this.center),r=a.dotProduct(this.tmpVecB.copyFrom(e.direction).normalize()),i=a.dotProduct(a)-this.radius*this.radius;if(i>0&&r>0)return null;var n=r*r-i;if(n<0)return!1;var o=Math.abs(-r-Math.sqrt(n));return t&&t.copyFrom(e.direction).scaleBy(o).add(e.origin),!0}intersectsBoundingSphere(e){this.tmpVecA.subtract(e.center,this.center);var t=e.radius+this.radius;return this.tmpVecA.lengthSquared<=t*t}calculateTransform(e){this.update(e)}inFrustum(e,t){return t.containsSphere(e)}clone(){return new Qr(this.center.clone(),this.radius)}update(e){this.owner=e,this._center.add(e.transform.worldMatrix.position,this.center),this.forward=e.transform.forward}merge(e){throw new Error("BoundingSphere merge is not ready!")}setFromCenterAndSize(e,t){this.center.copy(e),this.radius=t}}class Cd extends vd{init(){super.init(),this.castShadow=!1,this.castGI=!1,this.addRendererMask(Qe.Reflection),this.alwaysRender=!0,this.object3D.bound=new Qr(b.ZERO.clone(),this.radius)}debug(e,t=1){let a=new d.Object3D,r=a.addComponent(d.MeshRenderer);r.addMask(Qe.ReflectionDebug),r.geometry=new Ir(25,30,30);let i=_.setting.reflectionSetting,n=_e.getGBufferFrame(_e.reflections_GBuffer,i.width,i.height),o=new yd;o.reflectionIndex=e,o.baseMap=n.getCompressGBufferTexture(),r.material=o,this.object3D.addChild(a),a.scaleX=t,a.scaleY=t,a.scaleZ=t}onEnable(){super.onEnable()}onDisable(){super.onDisable()}renderPass2(e,t,a,r,i,n=!1){super.renderPass2(e,t,a,r,i,n)}}class Fn extends d.MeshRenderer{skyMaterial;init(){super.init(),this.castShadow=!1,this.castGI=!0,this.addRendererMask(Qe.Sky),this.alwaysRender=!0,this.object3D.bound=new xe(b.ZERO.clone(),b.MAX),this.geometry=new Ir(_.setting.sky.defaultFar,20,20),this.skyMaterial||=new Bd}onEnable(){this._readyPipeline?(this.castNeedPass(),!this._inRenderer&&this.transform.scene3D&&(K.instance.sky=this,this._inRenderer=!0)):this.initPipeline()}onDisable(){this._inRenderer&&this.transform.scene3D&&(this._inRenderer=!1,K.instance.sky=null),super.onDisable()}nodeUpdate(e,t,a,r){super.nodeUpdate(e,t,a,r)}renderPass2(e,t,a,r,i,n=!1){super.renderPass2(e,t,a,r,i,n)}set map(e){this.skyMaterial.baseMap=e,this.skyMaterial.name==null&&(this.skyMaterial.name="skyMaterial"),this.material=this.skyMaterial}get map(){return this.skyMaterial.baseMap}get exposure(){return this.skyMaterial.exposure}set exposure(e){this.skyMaterial&&(this.skyMaterial.exposure=e)}get roughness(){return this.skyMaterial.roughness}set roughness(e){this.skyMaterial&&(this.skyMaterial.roughness=e)}useSkyReflection(){let e=new d.Object3D,t=e.addComponent(Cd);t.autoUpdate=!1,e.x=0,e.y=300,e.z=0,this.object3D.addChild(e)}}class Ib{rotateX;rotateY;sunX;sunY;constructor(){this.reset()}reset(){return this.rotateX=this.rotateY=this.sunX=this.sunY=Number.MAX_VALUE,this}isRotateChange(e,t){return Math.abs(this.rotateX-e)>=.001||Math.abs(this.rotateY-t)>=.001}isSkyChange(e,t){return Math.abs(this.sunX-e)>=.001||Math.abs(this.sunY-t)>=.001}save(e,t,a,r){return this.sunX=e,this.sunY=t,this.rotateX=a,this.rotateY=r,this}}class Qb extends Fn{_atmosphericScatteringSky;_onChange=!0;_relatedTransform;_historyData;get sunX(){return this._atmosphericScatteringSky.setting.sunX}set sunX(e){this._atmosphericScatteringSky.setting.sunX!=e&&(this._atmosphericScatteringSky.setting.sunX=e,this._onChange=!0)}get sunY(){return this._atmosphericScatteringSky.setting.sunY}set sunY(e){this._atmosphericScatteringSky.setting.sunY!=e&&(this._atmosphericScatteringSky.setting.sunY=e,this._onChange=!0)}get eyePos(){return this._atmosphericScatteringSky.setting.eyePos}set eyePos(e){this._atmosphericScatteringSky.setting.eyePos!=e&&(this._atmosphericScatteringSky.setting.eyePos=e,this._onChange=!0)}get sunRadius(){return this._atmosphericScatteringSky.setting.sunRadius}set sunRadius(e){this._atmosphericScatteringSky.setting.sunRadius!=e&&(this._atmosphericScatteringSky.setting.sunRadius=e,this._onChange=!0)}get sunRadiance(){return this._atmosphericScatteringSky.setting.sunRadiance}set sunRadiance(e){this._atmosphericScatteringSky.setting.sunRadiance!=e&&(this._atmosphericScatteringSky.setting.sunRadiance=e,this._onChange=!0)}get sunBrightness(){return this._atmosphericScatteringSky.setting.sunBrightness}set sunBrightness(e){this._atmosphericScatteringSky.setting.sunBrightness!=e&&(this._atmosphericScatteringSky.setting.sunBrightness=e,this._onChange=!0)}get displaySun(){return this._atmosphericScatteringSky.setting.displaySun}set displaySun(e){this._atmosphericScatteringSky.setting.displaySun!=e&&(this._atmosphericScatteringSky.setting.displaySun=e,this._onChange=!0)}init(){super.init(),this._historyData=new Ib,this._atmosphericScatteringSky=new _d(new Dd);let e=this.transform.view3D,t=this.transform.scene3D;this.map=this._atmosphericScatteringSky,t.envMap=this._atmosphericScatteringSky,this.onUpdate(e)}start(e){let t=this.transform.scene3D;this.map=this._atmosphericScatteringSky,t.envMap=this._atmosphericScatteringSky,super.start()}get relativeTransform(){return this._relatedTransform}set relativeTransform(e){this._relatedTransform=e,this._historyData.reset()}onUpdate(e){this._relatedTransform&&(this._relatedTransform.rotationZ=0,this._historyData.isRotateChange(this._relatedTransform.rotationX,this._relatedTransform.rotationY)?(this.sunX=(this._relatedTransform.rotationY+90)/360,this.sunY=this._relatedTransform.rotationX/180+.5):this._historyData.isSkyChange(this.sunX,this.sunY)&&(this._relatedTransform.rotationY=this.sunX*360-90,this._relatedTransform.rotationX=(this.sunY-.5)*180),this._historyData.save(this.sunX,this.sunY,this._relatedTransform.rotationX,this._relatedTransform.rotationY)),this._onChange&&(this._onChange=!1,this._atmosphericScatteringSky.apply())}destroy(e){super.destroy(e),this._atmosphericScatteringSky.destroy(),this._atmosphericScatteringSky=null,this._onChange=null}}class Tr{static panelRatio=1;static quadMaxCountForWorld=256;static quadMaxCountForView=2048;static SortOrderStartWorld=7e3;static SortOrderStartView=8e3;static SortOrderCanvasSpan=1e4}var ca=(s=>(s[s.View=0]="View",s[s.World=2]="World",s))(ca||{}),ni=(s=>(s[s.Simple=0]="Simple",s[s.Sliced=1]="Sliced",s[s.Tiled=2]="Tiled",s[s.Filled=3]="Filled",s))(ni||{}),mr=(s=>(s[s.None=0]="None",s[s.BillboardY=9]="BillboardY",s[s.BillboardXYZ=10]="BillboardXYZ",s))(mr||{});class Mi extends qe{type;camera;_cameraPosition;constructor(){super(),this._cameraPosition=new b}onUpdate(){this.enable&&this.transform.view3D.camera&&this.updateBillboardMatrix()}updateBillboardMatrix(){let e=this.transform.view3D.camera;this._cameraPosition.copyFrom(e.transform.back),this.type==mr.BillboardXYZ||this.type==mr.BillboardY&&(this._cameraPosition.y=0),this._cameraPosition.normalize(),this._cameraPosition.add(this.object3D.localPosition,this._cameraPosition),this.transform.lookAt(this.object3D.localPosition,this._cameraPosition,e.transform.up)}cloneTo(e){let t=e.addComponent(Mi);t.type=this.type}}var si=(s=>(s[s.None=0]="None",s[s.Box=1]="Box",s[s.Capsule=2]="Capsule",s[s.Sphere=3]="Sphere",s[s.Mesh=4]="Mesh",s))(si||{});class ht{_center;_size;_halfSize;_shapeType=0;static v3_help_0;static helpMatrix;static helpRay;constructor(){ht.v3_help_0||=new b,ht.helpMatrix||=new R,ht.helpRay||=new na,this._center=new b,this._size=new b,this._halfSize=new b}get shapeType(){return this._shapeType}setFromCenterAndSize(e,t){return e&&this._center.copy(e),t&&this._size.copy(t),this}get center(){return this._center}set center(e){this._center.copy(e)}get size(){return this._size}set size(e){this._size.copy(e),this._halfSize.copy(e).multiplyScalar(.5)}get halfSize(){return this._halfSize}rayPick(e,t){return null}}class oi extends ht{_pickRet;box;constructor(){super(),this._shapeType=si.Box,this.box=new xe(new b,new b)}rayPick(e,t){this.box.setFromCenterAndSize(this.center,this.size);let r=ht.helpMatrix;r.copyFrom(t).invert();let i=ht.helpRay.copy(e);i.applyMatrix(r);let n=i.intersectBox(this.box,ht.v3_help_0);return n?(this._pickRet||(this._pickRet={intersectPoint:new b,distance:0}),this._pickRet.intersectPoint=n,this._pickRet.distance=b.distance(i.origin,ht.v3_help_0),this._pickRet):null}}class fa extends qe{_shape;constructor(){super(),this._shape=new oi}start(){_.setting.pick.mode=="pixel"&&this.transform.scene3D.view.pickFire.mouseEnableMap.set(this.transform.worldMatrix.index,this)}onEnable(e){Pe.bindEnablePick(e,this,null)}onDisable(e){Pe.unBindEnablePick(e,this)}get shape(){return this._shape}set shape(e){this._shape=e}rayPick(e){return this._enable?this._shape.rayPick(e,this.transform.worldMatrix):null}beforeDestroy(e){_.setting.pick.mode=="pixel"&&this.transform.scene3D.view.pickFire.mouseEnableMap.delete(this.transform.worldMatrix.index),super.beforeDestroy(e)}}class Sd{loop=!0;speed=1;t=0;time=0;weight=0;currFrame=0;lastFrame=-1;nextFrame=0;clip;animation;_isEnd=!1;_currSkeletonPose;constructor(e){this.clip=e,this._currSkeletonPose=new Fi(this.clip.skeleton)}reset(){this.time=0,this.weight=0,this._isEnd=!1}get name(){return this.clip.name}get currSkeletonPose(){return this._currSkeletonPose}update(e){this.time=(this.time+e*this.speed)%this.clip.totalTime;let t=this.time/this.clip.frameRate;if(this.currFrame=Math.trunc(t),this.t=t-this.currFrame,this.currFrame<0&&(this.currFrame=this.clip.numFrame+this.currFrame),this.time>=0?this.nextFrame=(this.currFrame+1)%this.clip.numFrame:(this.nextFrame=this.currFrame-1,this.nextFrame<0&&(this.nextFrame=this.clip.numFrame+this.nextFrame),this.t=1-this.t),this._isEnd)this.currFrame=this.nextFrame=this.speed<0?0:this.clip.numFrame-1;else if(this.currFrame!=this.lastFrame){let i=this.speed<0?0:this.clip.numFrame;this.currFrame==i&&(this.loop?(this.currFrame=0,this.nextFrame=1,this.time=this.t=0):(this.currFrame=this.nextFrame=this.speed<0?0:this.clip.numFrame-1,this._isEnd=!0));var a=this.clip.getEvents();if(a)for(let n of a){var r=Math.floor(n.time/this.clip.frameRate);if(r=Math.min(r,this.clip.numFrame),r=Math.max(r,0),r==this.currFrame){n.skeletonAnimation=this.animation,this.animation.eventDispatcher.dispatchEvent(n);break}}this.lastFrame=this.currFrame}this.clip.getLerpSkeletonPose(this.currFrame,this.nextFrame,this.t,this._currSkeletonPose)}}var Tb=Object.getOwnPropertyDescriptor,Mb=(s,e,t,a)=>{for(var r=a>1?void 0:a?Tb(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.SkeletonAnimationComponent=class extends qe{isPlaying=!0;timeScale=1;_skeleton;_clips=[];_clipStates=new Map;_mixSkeletonPose;_mixTempSkeletonPose;_currentClipState;_bindList=[];_jointMatrixIndexTableBuffer;_crossFadeState;constructor(){super()}start(){}set skeleton(e){this._skeleton=e,this._mixSkeletonPose=new Fi(this._skeleton,!0),this._mixTempSkeletonPose=new Fi(this._skeleton);const t=new Float32Array(this._mixSkeletonPose.jointMatrixIndexTable);this._jointMatrixIndexTableBuffer=new Te(this._skeleton.numJoint*4,0,t)}get skeleton(){return this._skeleton}get finalSkeletonPose(){return this._mixSkeletonPose}get jointMatrixIndexTableBuffer(){return this._jointMatrixIndexTableBuffer}getJointIndexTable(e){let t=new Array;for(let a=0;a<e.length;a++){const r=e[a];let i=this._skeleton.getJointByName(r);t[a]=i?i.index:-1}return t}addAnimationClip(e){if(!this._clipStates.has(e.name)){this._clips.push(e);let t=new Sd(e);t.animation=this,this._clipStates.set(e.name,t),this._currentClipState||this.setCurrentClipState(t)}}getAnimationClip(e){var t=this.getAnimationClipState(e);return t?t.clip:null}getAnimationClips(){return this._clips}getAnimationClipState(e){return this._clipStates.has(e)?this._clipStates.get(e):null}getAnimationClipStates(){return this._clipStates}pause(){this.isPlaying=!1}resume(){this.isPlaying=!0}play(e,t=1,a=!1){if(this._currentClipState&&this._currentClipState.name==e)return a&&this._currentClipState.reset(),!1;let r=this.getAnimationClipState(e);return r?(r.speed=t,r.reset(),this._clipStates.forEach((i,n)=>{i.weight=0}),this.setCurrentClipState(r),!0):!1}crossFade(e,t){if(t<.01){this.play(e);return}if(this._currentClipState.name==e)return;let a=this.getAnimationClipState(e);a&&(a.reset(),this._crossFadeState?(this._crossFadeState.inClip&&(this._crossFadeState.inClip.weight=0),this._crossFadeState.outClip&&(this._crossFadeState.outClip.weight=0),this._crossFadeState.reset(a,this._currentClipState,t)):this._crossFadeState=new Nb(a,this._currentClipState,t),this._currentClipState=a)}setAnimIsLoop(e,t){this._clipStates.has(e)&&(this._clipStates.get(e).loop=t)}addJointBind(e,t){this._bindList.push({jointName:e,obj:t})}removeJointBind(e){for(let t=0;t<this._bindList.length;t++)if(this._bindList[t].obj==e){this._bindList.splice(t,1);break}}onUpdate(){if(!this.isPlaying)return;let e=Le.delta*.001*this.timeScale;this._crossFadeState&&this._crossFadeState.update(e);var t=0,a=[];if(this._clipStates.forEach((i,n)=>{i.weight>0&&(i.update(e),t+=i.weight,a.push(i))}),a.length>0){this._mixSkeletonPose.copyFrom(a[0].currSkeletonPose);for(var r=1;r<a.length;++r){const i=a[r];this._mixTempSkeletonPose.lerp(this._mixSkeletonPose,i.currSkeletonPose,i.weight/t),this._mixSkeletonPose.copyFrom(this._mixTempSkeletonPose)}}}cloneTo(e){let t=e.addComponent(d.SkeletonAnimationComponent);t.skeleton=this.skeleton;for(var a=0;a<this._clips.length;++a)t.addAnimationClip(this._clips[a])}setCurrentClipState(e){this._currentClipState!=e&&(this._currentClipState=e,this._currentClipState.weight=1)}},d.SkeletonAnimationComponent=Mb([Lt(d.SkeletonAnimationComponent,"SkeletonAnimationComponent")],d.SkeletonAnimationComponent);class Nb{inClip;outClip;currentTime;crossFadeTime;constructor(e,t,a){this.reset(e,t,a)}reset(e,t,a){this.inClip=e,this.outClip=t,this.currentTime=0,this.crossFadeTime=a}update(e){!this.inClip||!this.outClip||(this.currentTime+=e,this.inClip.weight=Math.min(Math.abs(this.currentTime%this.crossFadeTime)/this.crossFadeTime,1),this.outClip.weight=1-this.inClip.weight,Math.abs(this.currentTime)>=this.crossFadeTime&&(this.inClip.weight=1,this.outClip.weight=0,this.inClip=null,this.outClip=null))}}var Pb=Object.getOwnPropertyDescriptor,Vb=(s,e,t,a)=>{for(var r=a>1?void 0:a?Pb(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.AnimatorComponent=class extends qe{timeScale=1;jointMatrixIndexTableBuffer;playBlendShapeLoop=!1;inverseBindMatrices;_avatar;_rendererList;propertyCache;_clips;_clipsState;_clipsMap;_currentSkeletonClip;_currentBlendAnimClip;_skeletonTime=0;_blendShapeTime=0;_skeletonSpeed=1;_blendShapeSpeed=1;_skeletonStart=!0;_blendShapeStart=!0;root;_avatarName;_bonePos=new b;_boneScale=new b;_boneRot=new ae;_crossFadeState;init(e){this.propertyCache=new Map,this._clipsMap=new Map,this._clips=[],this._clipsState=[],this._rendererList=this.object3D.getComponentsInChild(d.SkinnedMeshRenderer2);let t=this.object3D.getComponentsInChild(d.MeshRenderer);for(let a of t){let r=a;r.blendShape=a.morphData,this._rendererList.push(r)}for(const a of this._rendererList)aa.hasMask(a.rendererMask,Qe.MorphTarget)&&a.selfCloneMaterials("MORPH_TARGET_UUID")}start(){}debug(){}playAnim(e,t=0,a=1){let r=this.getAnimationClipState(e);r?(this._currentSkeletonClip&&(this._currentSkeletonClip.weight=0),this._currentSkeletonClip=r,this._currentSkeletonClip.weight=1,this._skeletonTime=t,this._skeletonSpeed=a,this._skeletonStart=!0):console.warn(`not has anim ${e}`)}crossFade(e,t){let a=this.getAnimationClipState(e);if(!a){console.warn(`not has anim ${e}`);return}if(t<.01||!this._currentSkeletonClip){this.playAnim(e);return}if(this._currentSkeletonClip&&this._currentSkeletonClip.clip.clipName===e)return;let r=a,i=this._currentSkeletonClip;this._crossFadeState?(this._crossFadeState.inClip&&(this._crossFadeState.inClip.weight=0),this._crossFadeState.outClip&&(this._crossFadeState.outClip.weight=0),this._crossFadeState.reset(r,i,t)):this._crossFadeState=new Ob(r,i,t),this._currentSkeletonClip=r}playBlendShape(e,t=0,a=1){this._clipsMap.has(e)?(this._currentBlendAnimClip=this._clipsMap.get(e),this._blendShapeTime=t,this._blendShapeSpeed=a,this._blendShapeStart=!0):console.warn(`not has blendShape ${e}`)}set avatar(e){this._avatarName=e,this.inverseBindMatrices=[],this._avatar=_.res.getObj(e);let t=this.buildSkeletonPose();const a=new Float32Array(t);this.jointMatrixIndexTableBuffer=new Te(this._avatar.count,0,a)}get numJoint(){return this._avatar.count}getJointIndexTable(e){let t=new Array;for(let a=0;a<e.length;a++){let r=this._avatar.boneMap.get(e[a]);t[a]=r?r.boneID:-1}return t}skeltonPoseObject3D={};skeltonTPoseObject3D={};buildSkeletonPose(){let e=[];for(const t of this._avatar.boneData){let a=new d.Object3D;R.getEuler(b.HELP_6,t.q,!0,"ZYX"),a.localPosition=t.t.clone(),a.localRotation=b.HELP_6.clone(),a.localScale=b.ONE,t.s.clone(),this.skeltonPoseObject3D[t.boneName]=a,this.skeltonTPoseObject3D[t.bonePath]=a.clone(),t.parentBoneName&&t.parentBoneName!=""?this.skeltonPoseObject3D[t.parentBoneName].addChild(a):(this.object3D.transform.scene3D&&this.object3D.transform.scene3D.addChild(a),this.root=a),e.push(a.transform.worldMatrix.index);let r=new R;r.copyFrom(a.transform.worldMatrix),r.invert(),this.inverseBindMatrices.push(r.rawData)}return e}set clips(e){this._clips=e;for(const t of e)this._clipsMap.set(t.clipName,t);this._clipsState=[];for(const t of e)this._clipsState.push(new xd(t));this._currentSkeletonClip||this.playAnim(e[0].clipName)}get clips(){return this._clips}get clipsState(){return this._clipsState}cloneTo(e){let t=e.addComponent(d.AnimatorComponent);t.avatar=this._avatarName,t.clips=this._clips}updateTime(){const e=Le.delta*.001;this._skeletonStart&&(this._skeletonTime+=e*this._skeletonSpeed*this.timeScale,this._currentSkeletonClip&&this._currentSkeletonClip.clip.loopTime&&(this._skeletonTime=this._skeletonTime%this._currentSkeletonClip.clip.stopTime)),this._blendShapeStart&&(this._blendShapeTime+=e*this._blendShapeSpeed,this._currentBlendAnimClip&&(this._currentBlendAnimClip.loopTime&&this.playBlendShapeLoop?this._blendShapeTime=this._blendShapeTime%this._currentBlendAnimClip.stopTime:this._blendShapeTime=Math.min(this._blendShapeTime,this._currentBlendAnimClip.stopTime)-1e-4)),this._crossFadeState&&this._crossFadeState.update(e)}onUpdate(e){this.updateTime();let t=[];for(let a of this._clipsState)a.weight>0&&t.push(a);t.length>0?this.updateSkeletonAnimMix(t):this.updateSkeletonAnim(),this.updateMorphAnim()}updateSkeletonAnim(){if(this._currentSkeletonClip){let e=this._avatar.boneData,t=0,a=e.length;for(t=0;t<a;t++){const r=e[t];let i=this.skeltonPoseObject3D[r.boneName];if(this._currentSkeletonClip.clip.useSkeletonPos){let o=this.getPosition(r.bonePath,this._skeletonTime);i.transform.localPosition=o}let n=this.getRotation(r.bonePath,this._skeletonTime);if(i.transform.localRotQuat=n,this._currentSkeletonClip.clip.useSkeletonScale){let o=this.getScale(r.bonePath,this._skeletonTime);i.transform.localScale=o}}}}updateMorphAnim(){if(this._currentBlendAnimClip&&this._currentBlendAnimClip.floatCurves&&this._currentBlendAnimClip.floatCurves.size>0&&this._rendererList)for(const e of this._currentBlendAnimClip.floatCurves){let t=e[0],r=e[1].propertys,n=this._currentBlendAnimClip.floatCurves.get(t).getValue(this._blendShapeTime)/100;this.updateBlendShape(r,t,n)}}updateBlendShape(e,t,a){for(const r of this._rendererList)if(r.blendShape){let i=this.propertyCache.get(r);if(i&&t in i)i[t](a);else{i=r;for(const n of e){if(!i[n]){i=null;break}i=i[n]}if(!i||i==r)continue;this.propertyCache.get(r)||this.propertyCache.set(r,{}),this.propertyCache.get(r)[t]=i,i(a)}}}updateSkeletonAnimMix(e){let t=0;for(let a of e)t+=a.weight;if(e.length>0){let a=this._avatar.boneData,r=a.length;for(let i=0;i<r;i++){const n=a[i];let o=this.skeltonPoseObject3D[n.boneName];if(e[0].clip.useSkeletonPos){this._bonePos.copyFrom(this.getPosition(n.bonePath,this._skeletonTime,e[0].clip));for(let l=1;l<e.length;l++){const c=e[l];if(c.clip.useSkeletonPos){let f=this.getPosition(n.bonePath,this._skeletonTime,c.clip);b.HELP_0.lerp(this._bonePos,f,c.weight/t),this._bonePos.copyFrom(b.HELP_0)}}o.transform.localPosition=this._bonePos}this._boneRot.copyFrom(this.getRotation(n.bonePath,this._skeletonTime,e[0].clip));for(let l=1;l<e.length;l++){const c=e[l];let f=this.getRotation(n.bonePath,this._skeletonTime,c.clip);ae.HELP_2.slerp(this._boneRot,f,c.weight/t),this._boneRot.copyFrom(ae.HELP_2)}if(o.transform.localRotQuat=this._boneRot,e[0].clip.useSkeletonScale){this._boneScale.copyFrom(this.getScale(n.bonePath,this._skeletonTime,e[0].clip));for(let l=1;l<e.length;l++){const c=e[l];if(c.clip.useSkeletonScale){let f=this.getScale(n.bonePath,this._skeletonTime,c.clip);b.HELP_0.lerp(this._boneScale,f,c.weight/t),this._boneScale.copyFrom(b.HELP_0)}}o.transform.localScale=this._boneScale}}}}getPosition(e,t,a=this._currentSkeletonClip.clip){return a.positionCurves.has(e)?a.positionCurves.get(e).getValue(t):this.skeltonTPoseObject3D[e].localPosition}getRotation(e,t,a=this._currentSkeletonClip.clip){if(a.rotationCurves.has(e)){let r=a.rotationCurves.get(e).getValue(t);return ae.HELP_0.set(r.x,r.y,r.z,r.w),ae.HELP_0}return this.skeltonTPoseObject3D[e].localQuaternion}getScale(e,t,a=this._currentSkeletonClip.clip){return a.scaleCurves.has(e)?a.scaleCurves.get(e).getValue(t):this.skeltonTPoseObject3D[e].localScale}getAnimationClipState(e){for(let t of this._clipsState)if(t.clip.clipName===e)return t;return null}cloneMorphRenderers(){let e={};for(const t of this._rendererList)for(const a in t.geometry.morphTargetDictionary){let r=e[a]||[];r.push(t),e[a]=r}return e}},d.AnimatorComponent=Vb([Lt(d.AnimatorComponent,"AnimatorComponent")],d.AnimatorComponent);class xd{clip;weight=0;get totalTime(){return this.clip.stopTime-this.clip.startTime}constructor(e){this.clip=e}}class Ob{inClip;outClip;currentTime;crossFadeTime;constructor(e,t,a){this.reset(e,t,a)}reset(e,t,a){this.inClip=e,this.outClip=t,this.currentTime=0,this.crossFadeTime=a}update(e){!this.inClip||!this.outClip||(this.currentTime+=e,this.inClip.weight=Math.min(Math.abs(this.currentTime%this.crossFadeTime)/this.crossFadeTime,1),this.outClip.weight=1-this.inClip.weight,Math.abs(this.currentTime)>=this.crossFadeTime&&(this.inClip.weight=1,this.outClip.weight=0,this.inClip=null,this.outClip=null))}}class fo{index;time;timeEnd;coeff=[]}var pr=(s=>(s[s.PingPong=0]="PingPong",s[s.Repeat=1]="Repeat",s[s.Clamp=2]="Clamp",s))(pr||{});class kn{serializedVersion="2";time;value;inSlope=0;outSlope=0;tangentMode=0;weightedMode=0;inWeight;outWeight;constructor(e=0,t=0){this.time=e,this.value=t}unSerialized(e){this.serializedVersion=e.serializedVersion,this.time=e.time,this.value=e.value,this.tangentMode=e.tangentMode,this.inSlope=e.inSlope=="Infinity"?NaN:e.inSlope,this.outSlope=e.outSlope=="Infinity"?NaN:e.outSlope}unSerialized2(e){this.serializedVersion=e.serializedVersion,this.time=e.time,this.value=e.value,this.tangentMode=e.tangentMode,this.inSlope=e.inTangent=="Infinity"?NaN:e.inTangent,this.outSlope=e.outTangent=="Infinity"?NaN:e.outTangent}}class Ni{_totalTime=1;_cache=new fo;_cacheOut={lhsIndex:0,rhsIndex:0};_InvalidateCache=!1;curve=[];serializedVersion;preWarpMode;postWarpMode;rotationOrder;get cacheOut(){return this._cacheOut}constructor(e,t=pr.Repeat,a=pr.Repeat){if(e)for(let r=0;r<e.length;r++){const i=e[r];this.addKeyFrame(i)}this.preWarpMode=t,this.postWarpMode=a}get totalTime(){return this._totalTime}get first(){return this.curve[0]}get last(){return this.curve[this.curve.length-1]}addKeyFrame(e){this.curve.indexOf(e)==-1&&this.curve.push(e),this.calcTotalTime()}removeKeyFrame(e){let t=this.curve.indexOf(e);t!=-1&&this.curve.splice(t,1),this.calcTotalTime()}calculateCacheData(e,t,a,r=0){let i=this.curve,n=i[t],o=i[a];e.index=t,e.time=n.time+r,e.timeEnd=o.time+r,e.index=t;let l,c,f,h,u,g,A;l=o.time-n.time,l=Math.max(l,1e-4),f=o.value-n.value,c=1/(l*l),h=n.outSlope,u=o.inSlope,g=h*l,A=u*l,e.coeff[0]=(g+A-f-f)*c/l,e.coeff[1]=(f+f+f-g-g-A)*c,e.coeff[2]=h,e.coeff[3]=n.value,this.setupStepped(e.coeff,n,o)}getValue(e){return e=this.wrapTime(e),this.findCurve(e,this._cacheOut),this.calculateCacheData(this._cache,this._cacheOut.lhsIndex,this._cacheOut.rhsIndex,0),this.evaluateCache(this._cache,e)}getCurveFramesExtent(e){return e=this.wrapTime(e),this.findCurve(e,this._cacheOut),{lhsIndex:this._cacheOut.lhsIndex,rhsIndex:this._cacheOut.rhsIndex,time:e}}getKeyCount(){return this.curve.length}getKey(e){return this.curve[e]}unSerialized(e){this.preWarpMode=e.m_PreInfinity,this.postWarpMode=e.m_PostInfinity,this.rotationOrder=e.m_RotationOrder;let t=e.m_Curve.length;for(let a=0;a<t;a++)this.curve[a]=new kn,this.curve[a].unSerialized(e.m_Curve[a.toString()]);return this.calcTotalTime(),this}unSerialized2(e){this.preWarpMode=e.preWrapMode,this.postWarpMode=e.postWrapMode;let t=e.keyFrames||e.keys,a=t.length;for(let r=0;r<a;r++)this.curve[r]=new kn,this.curve[r].unSerialized2(t[r.toString()]);return this.calcTotalTime(),this}wrapTime(e){let t=this.curve,a=t[0].time,r=t[t.length-1].time;return e<a?this.preWarpMode==pr.Clamp?e=a:this.preWarpMode==pr.PingPong?e=rs(e,a,r):e=is(e,a,r):e>r&&(this.postWarpMode==pr.Clamp?e=r:this.postWarpMode==pr.PingPong?e=rs(e,a,r):e=is(e,a,r)),e}evaluateCache(e,t){let a=t-e.time;return a*(a*(a*e.coeff[0]+e.coeff[1])+e.coeff[2])+e.coeff[3]}findCurve(e,t){let a=this.curve;for(let r=1;r<a.length;r++){let i=a[r-1],n=a[r];i.time<=e&&n.time>e&&(t.lhsIndex=r-1,t.rhsIndex=r)}}setupStepped(e,t,a){(isNaN(t.outSlope)||isNaN(a.inSlope))&&(e[0]=0,e[1]=0,e[2]=0,e[3]=t.value)}invalidateCache(){this._InvalidateCache=!0}calcTotalTime(){let e=0;for(let t of this.curve)t?e=Math.max(e,t.time):console.error(t);this._totalTime=e}static scaleCurveValue(e,t){if(!e._InvalidateCache)for(let a=0;a<e.curve.length;a++){let r=e.curve[a];r.value*=t,r.inSlope*=t,r.outSlope*=t}e.invalidateCache()}}class Fd extends Ni{attribute="";propertyList;path;constructor(){super()}unSerialized(e){let{attribute:t,path:a}=e;return this.attribute=t,this.path=a,this.propertyList=t.split("."),super.unSerialized(e.curve),this}}class kd{curve={}}var li=(s=>(s[s.Default=0]="Default",s[s.Clamp=1]="Clamp",s[s.Once=1]="Once",s[s.Loop=2]="Loop",s[s.PingPong=4]="PingPong",s[s.ClampForever=8]="ClampForever",s))(li||{});class Lb{name;objAnimClip;totalTime=0;time=0;_stopTime=0;_loopTime;_wrapMode;_sampleRate;get wrapMode(){return this._wrapMode||(this._wrapMode=0),this._wrapMode}set wrapMode(e){this._wrapMode=e}parse(e){this.objAnimClip={};let t=e.AnimationClip,{m_Name:a,m_AnimationClipSettings:r,m_WrapMode:i,m_SampleRate:n}=t;this.name=a,this._wrapMode=i,this._sampleRate=n,this._loopTime=r.m_LoopTime;for(const o in t.m_EditorCurves)if(Object.prototype.hasOwnProperty.call(t.m_EditorCurves,o)){const l=t.m_EditorCurves[o];let c=l.attribute,f=new Fd;f.unSerialized(l),this.totalTime=Math.max(this.totalTime,f.totalTime);let h=this.objAnimClip[l.path];h||(h=new kd,this.objAnimClip[l.path]=h),h.curve[c]=f}}}class Ed{transform;quaternion;materialColor}class Pi{static Property={"m_LocalPosition.x":"localPosition.x","m_LocalPosition.y":"localPosition.y","m_LocalPosition.z":"localPosition.z","m_LocalRotation.x":"localQuaternion.x","m_LocalRotation.y":"localQuaternion.y","m_LocalRotation.z":"localQuaternion.z","m_LocalRotation.w":"localQuaternion.w","localEulerAnglesRaw.x":"localRotation.x","localEulerAnglesRaw.y":"localRotation.y","localEulerAnglesRaw.z":"localRotation.z","m_LocalEulerAngles.x":"localRotation.x","m_LocalEulerAngles.y":"localRotation.y","m_LocalEulerAngles.z":"localRotation.z","m_LocalScale.x":"localScale.x","m_LocalScale.y":"localScale.y","m_LocalScale.z":"localScale.z","m_Color.r":"materialColor.r","m_Color.g":"materialColor.g","m_Color.b":"materialColor.b","m_Color.a":"materialColor.a","material._Color.r":"materialColor.r","material._Color.g":"materialColor.g","material._Color.b":"materialColor.b","material._Color.a":"materialColor.a","material._UnlitColor.r":"materialColor.r","material._UnlitColor.g":"materialColor.g","material._UnlitColor.b":"materialColor.b","material._UnlitColor.a":"materialColor.a","field of view":"camera3D.fov",m_IsActive:"active",m_Sprite:"sprite",m_FlipX:"flipX",m_FlipY:"flipY"};static Scale={"m_LocalPosition.x":1,"m_LocalPosition.y":1,"m_LocalPosition.z":-1,"localEulerAnglesRaw.x":-1,"localEulerAnglesRaw.y":1,"localEulerAnglesRaw.z":1,"m_LocalEulerAngles.x":-1,"m_LocalEulerAngles.y":1,"m_LocalEulerAngles.z":1,"m_LocalRotation.x":1,"m_LocalRotation.y":1,"m_LocalRotation.z":-1,"m_LocalRotation.w":-1,"field of view":1,m_IsActive:1,m_Sprite:1};static updatePropertyTag(e,t){e.quaternion||=this.tag_quaternion[t],e.transform||=this.tag_transform[t],e.materialColor||=this.tag_materialColor[t]}static tag_quaternion={"m_LocalRotation.x":!0,"m_LocalRotation.y":!0,"m_LocalRotation.z":!0,"m_LocalRotation.w":!0};static tag_materialColor={"material._Color.r":!0,"material._Color.g":!0,"material._Color.b":!0,"material._Color.a":!0,"material._UnlitColor.r":!0,"material._UnlitColor.g":!0,"material._UnlitColor.b":!0,"material._UnlitColor.a":!0};static tag_transform={"m_LocalPosition.x":!0,"m_LocalPosition.y":!0,"m_LocalPosition.z":!0,"m_LocalRotation.x":!0,"m_LocalRotation.y":!0,"m_LocalRotation.z":!0,"m_LocalRotation.w":!0,"localEulerAnglesRaw.x":!0,"localEulerAnglesRaw.y":!0,"localEulerAnglesRaw.z":!0,"m_LocalEulerAngles.x":!0,"m_LocalEulerAngles.y":!0,"m_LocalEulerAngles.z":!0,"m_LocalScale.x":!0,"m_LocalScale.y":!0,"m_LocalScale.z":!0}}class Mr{static Complete=0;static Seek=1;_rootObject3D;_animation;_propertyCache;_currentClip;_frame=0;_time=0;_isPlaying=!0;speed=1;_propertyTagDic;constructor(e){this._rootObject3D=e.object3D,this._animation=e,this._propertyTagDic=new Map,this.reset()}reset(){this._propertyCache={},this._propertyTagDic.clear()}get time(){return this._time}get currentClip(){return this._currentClip}play(e,t=!0){this._isPlaying=!0,t&&(this._time=0),e!=this._currentClip&&e&&this.parseAnimClip(e),this._currentClip=e,this.validProperty()}parseAnimClip(e){this.reset();for(const t in e.objAnimClip){let a=e.objAnimClip[t],r=this._rootObject3D,i={};if(t==""?r=this._rootObject3D:r=this._rootObject3D.getObjectByName(t),!r)continue;let n=new Ed;this._propertyTagDic.set(r,n);let o=a.curve;for(const l in o){Pi.updatePropertyTag(n,l);let c=this._propertyCache[t]||={},f=Pi.Property[l].split("."),h=f[0];if(f.length>1){let u=i[h];u||(u=i[h]=r[h]),c[l]={value:u,property:f[1]}}else c[l]={value:r,property:f[0]}}}return this}stop(){return this._isPlaying=!1,this}toggle(){return this._isPlaying=!this._isPlaying,this}get isPlaying(){return this._isPlaying}update(e,t){if(e=e*.001,t=t*.001,!this._currentClip||this._frame==e||!this._isPlaying)return;this._frame=e;let a=this._time;this._time=this.calcTime(a+t*this.speed),this.validProperty(),this._currentClip.wrapMode!=li.Loop&&this._currentClip.wrapMode!=li.Default&&(this.speed>0?this._time>=this._currentClip.totalTime:this._time<=0)&&(this._isPlaying=!1,this._animation.statusCall(Mr.Complete,a,this._time)),this._animation.statusCall(Mr.Seek,a,this._time)}seek(e){return this._time=this.calcTime(e),this._rootObject3D&&this.validProperty(),this}calcTime(e){return this._currentClip.wrapMode==li.Loop||this._currentClip.wrapMode==li.Default?e=cs(e,this._currentClip.totalTime):e=Ae(e,0,this._currentClip.totalTime),e}validProperty(){for(const e in this._currentClip.objAnimClip){let a=this._currentClip.objAnimClip[e].curve;for(const r in a){const i=a[r];let n=this._propertyCache[e][r],o=i.getValue(this._time);r in Pi.Scale&&(o*=Pi.Scale[r]),n.value[n.property]=o}}this._propertyTagDic.forEach((e,t)=>{this.applyProperty(e,t)})}applyProperty(e,t){e.quaternion&&R.getEuler(t.transform.localRotation,t.transform.localRotQuat,!0,"ZYX"),e.transform&&(t.transform.localPosition=t.transform.localPosition,t.transform.localRotation=t.transform.localRotation,t.transform.localScale=t.transform.localScale);let a=t;e.materialColor&&a.notifyMaterialColorChange(0,"baseColor")}}class Gb{clipName;data;time}class Vi extends bt{static SEEK="SEEK";static COMPLETE="COMPLETE";animation;frame;constructor(e,t){super(t),this.animation=e}}class ho extends qe{_animator;_clips=[];defaultClip;autoPlay;_seekEvent;_completeEvent;_keyFrameList;constructor(){super(),this._seekEvent=new Vi(this,Vi.SEEK),this._completeEvent=new Vi(this,Vi.COMPLETE),this._keyFrameList={}}registerEventKeyFrame(e){let t=this._keyFrameList[e.clipName];t==null&&(this._keyFrameList[e.clipName]=t=[]),t.push(e)}init(){this._animator=new Mr(this)}onUpdate(){this.enable&&this._animator.update(Le.time,Le.delta)}appendClip(e){this._clips.push(e),this.play(e.name)}statusCall(e,t,a){if(e==Mr.Complete)this.eventDispatcher.dispatchEvent(this._completeEvent);else if(e==Mr.Seek&&t!=a){let r=this._keyFrameList[this.currentClip.name];if(r)for(let i of r)i.time>t&&i.time<=a&&(this._seekEvent.data=this._seekEvent.frame=i,this.eventDispatcher.dispatchEvent(this._seekEvent))}}set speed(e){this._animator.speed=e}get speed(){return this._animator.speed}stop(){this._animator.stop()}toggle(){this._animator.toggle()}getClip(e){let t;for(let a of this._clips)if(a.name==e){t=a;break}return t}get currentClip(){return this._animator.currentClip}get time(){return this._animator.time}seek(e){this._animator.seek(e)}play(e,t=!0){let a=this.getClip(e);return a?(this._animator.play(a,t),a):null}start(){this.autoPlay&&this.play(this.defaultClip)}copyComponent(e){this.autoPlay=e.autoPlay,this.defaultClip=e.defaultClip;let t=e._clips;for(let a=0,r=t.length;a<r;a++)this.appendClip(t[a]);return this}cloneTo(e){e.addComponent(ho).copyComponent(this)}}var zb=Object.getOwnPropertyDescriptor,Wb=(s,e,t,a)=>{for(var r=a>1?void 0:a?zb(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.SkinnedMeshRenderer2=class extends d.MeshRenderer{skinJointsName;mInverseBindMatrixData;mInverseBindMatrixBuffer;mSkeletonAnimation;mJointIndexTableBuffer;constructor(){super(),this.addRendererMask(Qe.SkinnedMesh)}get geometry(){return this._geometry}set geometry(e){this.skinJointsName=e.skinNames;let t=[];for(let a=0;a<e.bindPose.length;a++)t.push(new Float32Array(e.bindPose[a].rawData.slice(0,16)));this.skinInverseBindMatrices=t,super.geometry=e}start(){if(super.start(),this.skeletonAnimation=this.object3D.getComponent(d.AnimatorComponent),!this.skeletonAnimation){let e=this.object3D.parentObject.parentObject.getComponentsInChild(d.AnimatorComponent);e.length>0&&(this.skeletonAnimation=e[0]);let t=this.object3D;for(;!this.skeletonAnimation&&t;)this.skeletonAnimation=t.getComponentFromParent(d.AnimatorComponent),t.parent&&(t=t.parent.object3D)}}get blendShape(){return this.morphData}onEnable(){super.onEnable()}get skeletonAnimation(){return this.mSkeletonAnimation}set skeletonAnimation(e){if(this.mSkeletonAnimation=e,!!e&&!this.mJointIndexTableBuffer){let t=this.mSkeletonAnimation.getJointIndexTable(this.skinJointsName);this.mJointIndexTableBuffer=new Te(t.length,0,new Float32Array(t)),this.mJointIndexTableBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.COMPUTE}}get skinInverseBindMatrices(){return this.mInverseBindMatrixData}set skinInverseBindMatrices(e){this.mInverseBindMatrixData=e;var t=new Float32Array(e.length*16);for(let a=0;a<e.length;a++){let r=a*16,i=e[a];t.set(i,r)}this.mInverseBindMatrixBuffer=new Te(t.byteLength,0,t),this.mInverseBindMatrixBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.COMPUTE}get inverseBindMatrixBuffer(){return this.mInverseBindMatrixBuffer}get jointIndexTableBuffer(){return this.mJointIndexTableBuffer.buffer}cloneTo(e){let t=e.addComponent(d.SkinnedMeshRenderer2),a=[];for(const r of this.materials)a.push(r.clone());t.materials=a,t.geometry=this.geometry,t.castShadow=this.castShadow,t.castGI=this.castGI,t.receiveShadow=this.receiveShadow,t.rendererMask=this.rendererMask,t.skinJointsName=this.skinJointsName,t.skinInverseBindMatrices=this.skinInverseBindMatrices,t.mJointIndexTableBuffer=this.mJointIndexTableBuffer}nodeUpdate(e,t,a,r){for(let i=0;i<this.materials.length;i++){let o=this.materials[i].getPass(t);if(o)for(let l=0;l<o.length;l++){const c=o[l];!c.pipeline&&this.mSkeletonAnimation&&(c.setStorageBuffer("jointsMatrixIndexTable",this.mSkeletonAnimation.jointMatrixIndexTableBuffer),c.setStorageBuffer("jointsInverseMatrix",this.mInverseBindMatrixBuffer),c.setStorageBuffer("jointsIndexMapingTable",this.mJointIndexTableBuffer))}}super.nodeUpdate(e,t,a,r)}},d.SkinnedMeshRenderer2=Wb([Lt(d.SkinnedMeshRenderer2,"SkinnedMeshRenderer2")],d.SkinnedMeshRenderer2);class Jb extends qe{_targetRenderers={};_vec3=new b;_matrix4=new R;_quaternion=new ae;init(e){let t=this.fetchMorphRenderers(this.object3D,d.SkinnedMeshRenderer2),a=this.fetchMorphRenderers(this.object3D,d.MeshRenderer);t.push(...a);for(const r of t){aa.hasMask(r.rendererMask,Qe.MorphTarget)&&r.selfCloneMaterials("MORPH_TARGET_UUID");for(const n in r.geometry.morphTargetDictionary){let o=this._targetRenderers[n]||[];o.push(r),this._targetRenderers[n]=o}}}getMorphRenderersByKey(e){return this._targetRenderers[e]}cloneMorphRenderers(){let e={};for(let t in this._targetRenderers)e[t]=this._targetRenderers[t];return e}applyBlendShape(e,t,a=1){if(!e){console.warn("blendShape is null");return}this._vec3.setFromArray(e.transform.transform[3]),this._vec3.multiplyScalar(a),this.object3D.transform.localPosition=this._vec3,this._vec3.setFromArray(e.transform.transform[2]),this._matrix4.copyColFrom(2,this._vec3),this._vec3.setFromArray(e.transform.transform[1]),this._matrix4.copyColFrom(1,this._vec3),this._vec3.setFromArray(e.transform.transform[0]),this._matrix4.copyColFrom(0,this._vec3),this._matrix4.transpose(),this._quaternion.fromMatrix(this._matrix4),this.object3D.localQuaternion=this._quaternion;for(let r in t){let i=this._targetRenderers[r],n=t[r],o=e.texture[n];this.applyMorphTargetInfluence(r,o,i)}}applyMorphTargetInfluence(e,t,a){for(let r of a)r.setMorphInfluence(e,t)}fetchMorphRenderers(e,t){let a=e.getComponentsInChild(t),r=[];for(let i of a)i.hasMask(Qe.MorphTarget)&&r.push(i);return r}}class jb{texture;transform}var wd=(s=>(s.mouthRollLower="mouthRollLower",s.browOuterUp_L="browOuterUpLeft",s.mouthSmile_L="mouthSmileLeft",s.jawRight="jawRight",s.eyeLookOut_L="eyeLookOutLeft",s.mouthFunnel="mouthFunnel",s.mouthUpperUp_R="mouthUpperUpRight",s.browDown_L="browDownLeft",s.jawLeft="jawLeft",s.mouthLowerDown_L="mouthLowerDownLeft",s.noseSneer_R="noseSneerRight",s.jawForward="jawForward",s.mouthLowerDown_R="mouthLowerDownRight",s.browInnerUp="browInnerUp",s.mouthRollUpper="mouthRollUpper",s.mouthStretch_R="mouthStretchRight",s.mouthPucker="mouthPucker",s.eyeBlink_L="eyeBlinkLeft",s.mouthUpperUp_L="mouthUpperUpLeft",s.mouthShrugUpper="mouthShrugUpper",s.eyeLookIn_R="eyeLookInRight",s.noseSneer_L="noseSneerLeft",s.mouthFrown_L="mouthFrownLeft",s.cheekSquint_L="cheekSquintLeft",s.eyeLookDown_L="eyeLookDownLeft",s.mouthDimple_L="mouthDimpleLeft",s.mouthFrown_R="mouthFrownRight",s.eyeLookIn_L="eyeLookInLeft",s.eyeLookOut_R="eyeLookOutRight",s.mouthLeft="mouthLeft",s.mouthStretch_L="mouthStretchLeft",s.mouthPress_L="mouthPressLeft",s.mouthDimple_R="mouthDimpleRight",s.eyeWide_R="eyeWideRight",s.browDown_R="browDownRight",s.eyeLookUp_R="eyeLookUpRight",s.eyeBlink_R="eyeBlinkRight",s.cheekSquint_R="cheekSquintRight",s.mouthRight="mouthDimpleRight",s.eyeLookDown_R="eyeLookDownRight",s.eyeLookUp_L="eyeLookUpLeft",s.eyeSquint_L="eyeSquintLeft",s.jawOpen="jawOpen",s.browOuterUp_R="browOuterUpRight",s.mouthClose="mouthClose",s.mouthShrugLower="mouthShrugLower",s.eyeWide_L="eyeWideLeft",s.tongueOut="tongueOut",s.eyeSquint_R="eyeSquintRight",s.cheekPuff="cheekPuff",s.mouthPress_R="mouthPressRight",s.mouthSmile_R="mouthSmileRight",s))(wd||{});class Zb{joints;constructor(e=[]){this.joints=e}get numJoint(){return this.joints.length}addJoint(e){e.index=this.joints.push(e)-1}getJointName(e){return this.joints[e].name}getJointParentIndex(e){let t=this.joints[e];return t.parent?t.parent.index:-1}getJointByName(e){for(let t of this.joints)if(t.name==e)return t;return null}}class Yb{_computePipeline;_computeBindGroup;constructor(e,t){let a=w.device;this._computePipeline=a.createComputePipeline({layout:"auto",compute:{module:a.createShaderModule({code:e}),entryPoint:"CsMain"}}),this._computeBindGroup=a.createBindGroup({layout:this._computePipeline.getBindGroupLayout(0),entries:t})}compute(e,t,a,r){let i=e.beginComputePass();return i.setPipeline(this._computePipeline),i.setBindGroup(0,this._computeBindGroup),i.dispatchWorkgroups(t,a,r),i.end(),this}}class Xb extends nr{numJoint;numState;time;weight;argumentsData;_isDirty=!1;_argumentsBuffer;_argumentsBufferEntries;constructor(){super(),this.allocationMemorySet([{name:"numJoint",data:[0]},{name:"numState",data:[0]},{name:"retain1",data:[0]},{name:"retain2",data:[0]},{name:"time",data:[0,0]},{name:"weight",data:[0,0]}]),this.generateGPUBuffer()}getGPUBuffer(){return this._argumentsBuffer}getGPUBindGroupEntry(){return this._argumentsBufferEntries}updateGPUBuffer(){return this._isDirty&&(this._isDirty=!1,w.device.queue.writeBuffer(this._argumentsBuffer,0,this.shareDataBuffer)),this}allocationMemorySet(e){this.argumentsData={};let t=0;for(let a=0;a<e.length;a++){const r=e[a];t+=r.data.length}this.allocation(t*4);for(let a=0;a<e.length;a++){const r=e[a],i=r.name;this.argumentsData[i]=this.allocation_node(r.data.length*4)}}generateGPUBuffer(){let e=w.device;this._argumentsBuffer=e.createBuffer({size:this.shareDataBuffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST,mappedAtCreation:!1}),this._argumentsBufferEntries={binding:0,resource:{buffer:this._argumentsBuffer,offset:0,size:this.shareDataBuffer.byteLength}}}}class Hb extends nr{numJoint;numFrame;retain0;retain1;argumentsData;_isDirty=!1;_argumentsBuffer;_argumentsBufferEntries;constructor(){super(),this.allocationMemorySet([{name:"numJoint",data:[0]},{name:"numFrame",data:[0]},{name:"retain0",data:[0]},{name:"retain1",data:[0]}]),this.generateGPUBuffer()}getGPUBuffer(){return this._argumentsBuffer}getGPUBindGroupEntry(){return this._argumentsBufferEntries}updateGPUBuffer(){this._isDirty&&(this._isDirty=!1,w.device.queue.writeBuffer(this._argumentsBuffer,0,this.shareDataBuffer))}allocationMemorySet(e){this.argumentsData={};let t=0;for(let r=0;r<e.length;r++){const i=e[r];t+=i.data.length}this.allocation(t*4);let a=this;for(let r=0;r<e.length;r++){const i=e[r],n=i.name;this.argumentsData[n]=this.allocation_node(i.data.length*4),a[n]=this.argumentsData[n]}}generateGPUBuffer(){let e=w.device;this._argumentsBuffer=e.createBuffer({size:this.shareDataBuffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST,mappedAtCreation:!1}),this._argumentsBufferEntries={binding:0,resource:{buffer:this._argumentsBuffer,offset:0,size:this.shareDataBuffer.byteLength}}}}class Kb{_autoUpdate=!0;_target;_lookAtObject;_origin=new b(0,0,0);_speed=300;constructor(e=null,t=null){this._target=e,this._lookAtObject=t}get target(){return this._target}set target(e){this._target!=e&&(this._target=e)}get lookAtObject(){return this._lookAtObject}set lookAtObject(e){this._lookAtObject!=e&&(this._lookAtObject=e)}get speed(){return this._speed}set speed(e){this._speed=e}update(){}}class qb extends qe{focus;distance=5;_camera;constructor(){super()}start(){if(this._camera=this.object3D.getOrAddComponent(Hr),!this._camera){console.error("FirstPersonCameraController need camera");return}if(!this.focus){console.error("FirstPersonCameraController need target");return}_.inputSystem.addEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.addEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.addEventListener(j.POINTER_DOWN,this.mouseDown,this)}mouseDown(e){_.inputSystem.addEventListener(j.POINTER_MOVE,this.mouseMove,this)}mouseUp(e){_.inputSystem.removeEventListener(j.POINTER_MOVE,this.mouseMove,this)}mouseMove(e){let t=this.transform.localRotation;t.y+=e.movementX*.01,t.x+=e.movementY*.01,this.transform.localRotation=t}mouseWheel(e){this.distance+=_.inputSystem.wheelDelta*.1}onUpdate(){let e=new b;this._camera.transform.forward.scaleToRef(this.distance,e);var t=this.focus.transform.worldPosition;this._camera.transform.localPosition=t}destroy(e){_.inputSystem.removeEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.removeEventListener(j.POINTER_DOWN,this.mouseDown,this),super.destroy(e)}}var et=(s=>(s[s.Key_BackSpace=8]="Key_BackSpace",s[s.Key_Tab=9]="Key_Tab",s[s.Key_Clear=12]="Key_Clear",s[s.Key_Enter=13]="Key_Enter",s[s.Key_Shift_L=16]="Key_Shift_L",s[s.Key_Control_L=17]="Key_Control_L",s[s.Key_Alt_L=18]="Key_Alt_L",s[s.Key_Pause=19]="Key_Pause",s[s.Key_CapsLock=20]="Key_CapsLock",s[s.Key_Escape=21]="Key_Escape",s[s.Key_Esc=27]="Key_Esc",s[s.Key_Space=32]="Key_Space",s[s.Key_Prior=33]="Key_Prior",s[s.Key_Next=34]="Key_Next",s[s.Key_End=35]="Key_End",s[s.Key_Home=36]="Key_Home",s[s.Key_Left=37]="Key_Left",s[s.Key_Up=38]="Key_Up",s[s.Key_Right=39]="Key_Right",s[s.Key_Down=40]="Key_Down",s[s.Key_Select=41]="Key_Select",s[s.Key_Print=42]="Key_Print",s[s.Key_Execute=43]="Key_Execute",s[s.Key_Insert=45]="Key_Insert",s[s.Key_Delete=46]="Key_Delete",s[s.Key_Help=47]="Key_Help",s[s.Key_0=48]="Key_0",s[s.Key_1=49]="Key_1",s[s.Key_2=50]="Key_2",s[s.Key_3=51]="Key_3",s[s.Key_4=52]="Key_4",s[s.Key_5=53]="Key_5",s[s.Key_6=54]="Key_6",s[s.Key_7=55]="Key_7",s[s.Key_8=56]="Key_8",s[s.Key_9=57]="Key_9",s[s.Key_A=65]="Key_A",s[s.Key_B=66]="Key_B",s[s.Key_C=67]="Key_C",s[s.Key_D=68]="Key_D",s[s.Key_E=69]="Key_E",s[s.Key_F=70]="Key_F",s[s.Key_G=71]="Key_G",s[s.Key_H=72]="Key_H",s[s.Key_I=73]="Key_I",s[s.Key_J=74]="Key_J",s[s.Key_K=75]="Key_K",s[s.Key_L=76]="Key_L",s[s.Key_M=77]="Key_M",s[s.Key_N=78]="Key_N",s[s.Key_O=79]="Key_O",s[s.Key_P=80]="Key_P",s[s.Key_Q=81]="Key_Q",s[s.Key_R=82]="Key_R",s[s.Key_S=83]="Key_S",s[s.Key_T=84]="Key_T",s[s.Key_U=85]="Key_U",s[s.Key_V=86]="Key_V",s[s.Key_W=87]="Key_W",s[s.Key_X=88]="Key_X",s[s.Key_Y=89]="Key_Y",s[s.Key_Z=90]="Key_Z",s[s.Key_KP_0=96]="Key_KP_0",s[s.Key_KP_1=97]="Key_KP_1",s[s.Key_KP_2=98]="Key_KP_2",s[s.Key_KP_3=99]="Key_KP_3",s[s.Key_KP_4=100]="Key_KP_4",s[s.Key_KP_5=101]="Key_KP_5",s[s.Key_KP_6=102]="Key_KP_6",s[s.Key_KP_7=103]="Key_KP_7",s[s.Key_KP_8=104]="Key_KP_8",s[s.Key_KP_9=105]="Key_KP_9",s[s.Key_Multiply=106]="Key_Multiply",s[s.Key_Add=107]="Key_Add",s[s.Key_Separator=108]="Key_Separator",s[s.Key_Subtract=109]="Key_Subtract",s[s.Key_Decimal=110]="Key_Decimal",s[s.Key_Divide=111]="Key_Divide",s[s.Key_F1=112]="Key_F1",s[s.Key_F2=113]="Key_F2",s[s.Key_F3=114]="Key_F3",s[s.Key_F4=115]="Key_F4",s[s.Key_F5=116]="Key_F5",s[s.Key_F6=117]="Key_F6",s[s.Key_F7=118]="Key_F7",s[s.Key_F8=119]="Key_F8",s[s.Key_F9=120]="Key_F9",s[s.Key_F10=121]="Key_F10",s[s.Key_F11=122]="Key_F11",s[s.Key_F12=123]="Key_F12",s[s.Key_F13=124]="Key_F13",s[s.Key_F14=125]="Key_F14",s[s.Key_F15=126]="Key_F15",s[s.Key_F16=127]="Key_F16",s[s.Key_F17=128]="Key_F17",s[s.Key_F18=129]="Key_F18",s[s.Key_F19=130]="Key_F19",s[s.Key_F20=131]="Key_F20",s[s.Key_F21=132]="Key_F21",s[s.Key_F22=133]="Key_F22",s[s.Key_F23=134]="Key_F23",s[s.Key_F24=135]="Key_F24",s[s.Key_Num_Lock=136]="Key_Num_Lock",s[s.Key_Scroll_Lock=137]="Key_Scroll_Lock",s))(et||{});class $b extends qe{moveSpeed=2;targetPos=new b(0,0,10);lookAtPos=new b(0,0,0);config={shiftMoveScale:20};_moveScale=1;_dir;_mouseFactory=25;_factory=1.5;_mouseDown=!1;_lastPos;_keyState;constructor(){super(),this._lastPos=new b,this._keyState={front:!1,back:!1,left:!1,right:!1,q:!1,e:!1},this.setCamera(new b(0,0,100),new b(0,0,0))}setCamera(e,t){this.targetPos.copyFrom(e),this.lookAtPos.copyFrom(t),this.Reset()}start(){_.inputSystem.addEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.addEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.addEventListener(j.POINTER_DOWN,this.mouseDown,this),_.inputSystem.addEventListener(wa.KEY_UP,this.keyUp,this),_.inputSystem.addEventListener(wa.KEY_DOWN,this.keyDown,this),this.transform.lookAt(this.targetPos,this.lookAtPos)}mouseWheel(e){}keyUp(e){switch(e.keyCode){case et.Key_W:this._keyState.front=!1;break;case et.Key_S:this._keyState.back=!1;break;case et.Key_A:this._keyState.left=!1;break;case et.Key_D:this._keyState.right=!1;break;case et.Key_Shift_L:this._moveScale=1;break;case et.Key_Q:this._keyState.q=!1;break;case et.Key_E:this._keyState.e=!1;break;case et.Key_F:this.transform.lookAt(this.targetPos,this.lookAtPos);break}}keyDown(e){switch(e.keyCode){case et.Key_W:this._keyState.front=!0;break;case et.Key_S:this._keyState.back=!0;break;case et.Key_A:this._keyState.left=!0;break;case et.Key_D:this._keyState.right=!0;break;case et.Key_Q:this._keyState.q=!0;break;case et.Key_E:this._keyState.e=!0;break;case et.Key_Shift_L:this._moveScale=this.config.shiftMoveScale}}Reset(){this._lastPos.x=_.inputSystem.mouseLastX,this._lastPos.y=_.inputSystem.mouseLastY}mouseDown(e){this.Reset(),this._mouseDown=!0}mouseUp(e){this.Reset(),this._mouseDown=!1}get factory(){return this._factory}set factory(e){this._factory=e}get mouseFactory(){return this._mouseFactory}set mouseFactory(e){this._mouseFactory=e}internal(e,t,a){return(t-e)*a}onUpdate(){let e=this.transform,t=Ae(Le.delta,0,.016);if(this._mouseDown&&(e.rotationY-=this.internal(e.rotationY+(_.inputSystem.mouseLastX-this._lastPos.x)*.25,e.rotationY,t*this._mouseFactory),e.rotationX-=this.internal(e.rotationX+(_.inputSystem.mouseLastY-this._lastPos.y)*.25,e.rotationX,t*this._mouseFactory),this.Reset()),this._keyState.front){let a=e.forward;e.x-=this.internal(e.x+a.x*this.moveSpeed*this._moveScale,e.x,t*this._factory),e.y-=this.internal(e.y+a.y*this.moveSpeed*this._moveScale,e.y,t*this._factory),e.z-=this.internal(e.z+a.z*this.moveSpeed*this._moveScale,e.z,t*this._factory)}if(this._keyState.back){let a=e.forward;e.x+=this.internal(e.x+a.x*this.moveSpeed*this._moveScale,e.x,t*this._factory),e.y+=this.internal(e.y+a.y*this.moveSpeed*this._moveScale,e.y,t*this._factory),e.z+=this.internal(e.z+a.z*this.moveSpeed*this._moveScale,e.z,t*this._factory)}if(this._keyState.left){let a=e.left;e.x+=this.internal(e.x+a.x*this.moveSpeed*this._moveScale,e.x,t*this._factory),e.y+=this.internal(e.y+a.y*this.moveSpeed*this._moveScale,e.y,t*this._factory),e.z+=this.internal(e.z+a.z*this.moveSpeed*this._moveScale,e.z,t*this._factory)}if(this._keyState.right){let a=e.left;e.x-=this.internal(e.x+a.x*this.moveSpeed*this._moveScale,e.x,t*this._factory),e.y-=this.internal(e.y+a.y*this.moveSpeed*this._moveScale,e.y,t*this._factory),e.z-=this.internal(e.z+a.z*this.moveSpeed*this._moveScale,e.z,t*this._factory)}this._keyState.q&&(e.y=Sr(e.y,e.y-this.moveSpeed*this._moveScale,t*this._factory)),this._keyState.e&&(e.y=Sr(e.y,e.y+this.moveSpeed*this._moveScale,t*this._factory))}destroy(e){_.inputSystem.removeEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.removeEventListener(j.POINTER_DOWN,this.mouseDown,this),_.inputSystem.removeEventListener(wa.KEY_UP,this.keyUp,this),_.inputSystem.removeEventListener(wa.KEY_DOWN,this.keyDown,this),super.destroy(e)}}class Oi{static add(e,t,a){return a||(a=new b),a.x=e.x+t.x,a.y=e.y+t.y,a.z=e.z+t.z,a}static sub(e,t,a){return a||(a=new b),a.x=e.x-t.x,a.y=e.y-t.y,a.z=e.z-t.z,a}static mul(e,t,a){return a||(a=new b),a.x=e.x*t.x,a.y=e.y*t.y,a.z=e.z*t.z,a}static mulScale(e,t,a){return a||(a=new b),a.x=e.x*t,a.y=e.y*t,a.z=e.z*t,a}static div(e,t,a){return a||(a=new b),a.x=e.x/t.x,a.y=e.y/t.y,a.z=e.z/t.z,a}static normalize(e){return e.clone().normalize()}static dot(e,t){let a=b.HELP_0;return a.copyFrom(e),a.dotProduct(t)}static calculateVectorAngle_xz(e,t){return Math.acos((e.x*t.x+e.y*t.y)/Math.sqrt((e.x*e.x+e.y*e.y)*(t.x*t.x+t.y*t.y)))}static distance(e,t){return b.distance(e,t)}static getRandomXYZ(e=-100,t=100){return new b(Math.random()*(t-e)+e,Math.random()*(t-e)+e,Math.random()*(t-e)+e)}static getRandomV3(e=-100,t=100,a,r){return new b(Math.random()*t+e,Math.random()*r+a,Math.random()*t+e)}static sphere(e){let t=e*Math.random(),a=new b(Math.random()*1-.5,Math.random()*1-.5,Math.random()*1-.5);return a.normalize(),a.scaleBy(t),a}static sphereXYZ(e,t,a=1,r=1,i=1){let n=e+(t-e)*Math.random(),o=new b(Math.random()*a-a*.5,Math.random()*r-r*.5,Math.random()*i-i*.5);return o.normalize(),o.scaleBy(n),o}}class eg extends qe{camera;minDistance=.1;maxDistance=500;rollSmooth=15;dragSmooth=20;wheelSmooth=10;wheelStep=.002;mouseRightFactor=.25;mouseLeftFactor=20;smooth=!0;_wheelStep=.002;_distance=0;distance=10;_roll=0;roll=0;_pitch=0;pitch=0;_currentPos;_targetPos;_flowTarget;_flowOffset;_mouseLeftDown=!1;_mouseRightDown=!1;_bottomClamp=89.99;_topClamp=-89.99;get bottomClamp(){return this._bottomClamp}set bottomClamp(e){this._bottomClamp=e>89.99?89.99:e}get topClamp(){return this._topClamp}set topClamp(e){this._topClamp=e<-89.99?-89.99:e}_tempDir=new b;_tempPos=new b;constructor(){super(),this._currentPos=new d.Object3D,this._targetPos=new d.Object3D}start(){this.camera=this.object3D.getOrAddComponent(Hr),_.inputSystem.addEventListener(j.POINTER_DOWN,this.onMouseDown,this),_.inputSystem.addEventListener(j.POINTER_MOVE,this.onMouseMove,this,null,10),_.inputSystem.addEventListener(j.POINTER_UP,this.onMouseUp,this,null,10),_.inputSystem.addEventListener(j.POINTER_WHEEL,this.onMouseWheel,this)}flowTarget(e,t=b.ZERO){this._flowTarget=e,this._flowOffset||=new b,this._flowOffset.copyFrom(t)}getFlowTarget(){return this._flowTarget}setCamera(e,t,a,r){this.roll=e,this.pitch=t,this.distance=a,this.maxDistance<a*1.5&&(this.maxDistance=a*1.5),r&&this._targetPos.transform.localPosition.copy(r)}focusByBounds(e){let t=vs.genMeshBounds(e);this.focusBound(t)}focusBound(e){this.target=e.center}set target(e){this._targetPos.transform.localPosition.copy(e)}get target(){return this._targetPos.transform.localPosition}onMouseWheel(e){this.enable&&(this._wheelStep=this.wheelStep*Oi.distance(this._currentPos.transform.worldPosition,this.camera.transform.worldPosition)/10,this.distance-=_.inputSystem.wheelDelta*this._wheelStep,this.distance=Ae(this.distance,this.minDistance,this.maxDistance))}onMouseDown(e){if(this.enable)switch(e.mouseCode){case 0:this._mouseLeftDown=!0;break;case 1:break;case 2:this._mouseRightDown=!0;break}}onMouseUp(e){this._mouseLeftDown=!1,this._mouseRightDown=!1}onMouseMove(e){this.enable&&(this._mouseRightDown&&(b.HELP_1.x=-1*e.movementX*Math.cos(this._roll*Math.PI/180)-e.movementY*Math.sin(this._roll*Math.PI/180),b.HELP_1.z=-1*e.movementY*Math.cos(this._roll*Math.PI/180)+e.movementX*Math.sin(this._roll*Math.PI/180),this._targetPos.x+=b.HELP_1.x*this.mouseRightFactor,this._targetPos.z+=b.HELP_1.z*this.mouseRightFactor),this._mouseLeftDown&&(this.roll-=e.movementX*Le.delta*.001*this.mouseLeftFactor,this.pitch-=e.movementY*Le.delta*.001*this.mouseLeftFactor,this.pitch=Ae(this.pitch,this._topClamp,this._bottomClamp)))}onBeforeUpdate(e){if(!this.enable)return;this._flowTarget&&(b.HELP_0.copyFrom(this._flowTarget.transform.worldPosition),b.HELP_0.add(this._flowOffset,b.HELP_0),this.target=b.HELP_0);let t=Ae(Le.delta,0,.016);this.smooth?(this._currentPos.x+=(this._targetPos.x-this._currentPos.x)*t*this.dragSmooth,this._currentPos.y+=(this._targetPos.y-this._currentPos.y)*t*this.dragSmooth,this._currentPos.z+=(this._targetPos.z-this._currentPos.z)*t*this.dragSmooth,this._distance+=(this.distance-this._distance)*t*this.wheelSmooth,this._roll+=(this.roll-this._roll)*t*this.rollSmooth,this._pitch+=(this.pitch-this._pitch)*t*this.rollSmooth):(this._currentPos.x=this._targetPos.x,this._currentPos.y=this._targetPos.y,this._currentPos.z=this._targetPos.z,this._distance=this.distance,this._roll=this.roll,this._pitch=this.pitch),this._tempDir.set(0,0,1);let a=ae.HELP_0;a.fromEulerAngles(this._pitch,this._roll,0),this._tempDir.applyQuaternion(a),this._tempPos=Oi.mulScale(this._tempDir,this._distance,this._tempPos),this._tempPos.add(this._currentPos.transform.localPosition,this._tempPos),this.camera.lookAt(this._tempPos,this._currentPos.transform.localPosition,b.UP)}destroy(e){_.inputSystem.removeEventListener(j.POINTER_DOWN,this.onMouseDown,this),_.inputSystem.removeEventListener(j.POINTER_MOVE,this.onMouseMove,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.onMouseUp,this),_.inputSystem.removeEventListener(j.POINTER_WHEEL,this.onMouseWheel,this),super.destroy(e),this.camera=null,this._flowTarget=null}}class tg extends qe{_camera;autoRotate=!1;autoRotateSpeed=.1;rotateFactor=.5;zoomFactor=.1;panFactor=.25;_smooth=5;_minDistance=1;_maxDistance=1e5;_maxPolarAngle=90;_minPolarAngle=-90;_target=new b(0,0,0);_cTarget=new b(0,0,0);_position=new b(0,0,0);_cPosition=new b(0,0,0);_spherical=new ag;_isMouseDown=!1;_lastMouseX=-1;_lastMouseY=-1;_isPanning=!1;constructor(){super()}get target(){return this._target}set target(e){this._target=e}get smooth(){return this._smooth}set smooth(e){this._smooth=Math.max(e,1)}get minDistance(){return this._minDistance}set minDistance(e){this._minDistance=Ae(e,2e-6,this._maxDistance)}get maxDistance(){return this._maxDistance}set maxDistance(e){this._maxDistance=Ae(e,this._minDistance,1/0)}get minPolarAngle(){return this._minPolarAngle}set minPolarAngle(e){this._minPolarAngle=Ae(e,-90,this._maxPolarAngle)}get maxPolarAngle(){return this._maxPolarAngle}set maxPolarAngle(e){this._maxPolarAngle=Ae(e,this._minPolarAngle,90)}get spherical(){return this._spherical}start(){this._camera=this.object3D.getComponent(Hr),this._position=this.object3D.transform.localPosition.clone(),this._cPosition=this._position.clone(),this._target=this._camera.lookTarget.clone(),this._cTarget=this._target.clone(),this._spherical.setCoords(this._position.x-this._target.x,this._position.y-this._target.y,this._position.z-this._target.z),this._camera.lookAt(this._cPosition,this._cTarget,b.UP),this.addEventListener()}onEnable(){this.addEventListener()}onDisable(){this.removeEventListener()}onUpdate(){let e=this._isPanning?1:this.smooth,t=!1;this._cPosition.equals(this.object3D.transform.localPosition)||(this._position.copyFrom(this.object3D.transform.localPosition),e=1,t=!0),this._cTarget.equals(this._target)||(this._cTarget.copyFrom(this._target),e=1,t=!0),t?this._spherical.setCoords(this._position.x-this._target.x,this._position.y-this._target.y,this._position.z-this._target.z):!this._isMouseDown&&this.autoRotate&&(this._spherical.theta-=this.autoRotateSpeed*Math.PI/180,this.updateCamera());let a=(this._position.x-this._cPosition.x)/e,r=(this._position.y-this._cPosition.y)/e,i=(this._position.z-this._cPosition.z)/e;this._cPosition.x=Math.abs(a)>1e-10?this._cPosition.x+a:this._position.x,this._cPosition.y=Math.abs(r)>1e-10?this._cPosition.y+r:this._position.y,this._cPosition.z=Math.abs(i)>1e-10?this._cPosition.z+i:this._position.z,this._camera.lookAt(this._cPosition,this._cTarget,b.UP)}onWheel(e){e.deltaY=Ae(e.deltaY,-this._spherical.radius,this._spherical.radius),this._spherical.radius+=e.deltaY*this.zoomFactor,this._spherical.radius=Ae(this._spherical.radius,this.minDistance,this.maxDistance),this.updateCamera()}onPointerDown(e){this._isMouseDown=!0,this._lastMouseX=e.mouseX,this._lastMouseY=e.mouseY,e.mouseCode===2&&(this._isPanning=!0)}onPointerMove(e){if(!this._isMouseDown||!this.enable)return;let t=e.mouseX,a=e.mouseY;if(e.mouseCode===0&&this._lastMouseX>0&&this._lastMouseY>0){const r=-(t-this._lastMouseX)*this.rotateFactor,i=(a-this._lastMouseY)*this.rotateFactor;this._spherical.theta+=r*Math.PI/180,this._spherical.phi-=i*Math.PI/180,this._spherical.phi=Ae(this._spherical.phi,this.minPolarAngle,this.maxPolarAngle),this.updateCamera()}else e.mouseCode===2&&(Oi.mulScale(this.object3D.transform.up,e.movementY*this.panFactor*this._camera.aspect,b.HELP_1),e.ctrlKey||e.metaKey?this._target.y+=b.HELP_1.y:(this._target.x+=b.HELP_1.x,this._target.z+=b.HELP_1.z),Oi.mulScale(this.object3D.transform.right,-e.movementX*this.panFactor,b.HELP_1),this._target.x-=b.HELP_1.x,this._target.z-=b.HELP_1.z,this._cTarget.copyFrom(this._target),this.updateCamera());this._lastMouseX=t,this._lastMouseY=a}onPointerUp(e){this._isMouseDown=!1,e.mouseCode===2&&(this._isPanning=!1)}updateCamera(){this._spherical.makeSafe();let e=this._spherical.getCoords();this._position.set(e.x+this._target.x,e.y+this._target.y,e.z+this._target.z)}addEventListener(){_.inputSystem.addEventListener(j.POINTER_WHEEL,this.onWheel,this),_.inputSystem.addEventListener(j.POINTER_DOWN,this.onPointerDown,this),_.inputSystem.addEventListener(j.POINTER_MOVE,this.onPointerMove,this),_.inputSystem.addEventListener(j.POINTER_UP,this.onPointerUp,this)}removeEventListener(){_.inputSystem.removeEventListener(j.POINTER_WHEEL,this.onWheel,this),_.inputSystem.removeEventListener(j.POINTER_DOWN,this.onPointerDown,this),_.inputSystem.removeEventListener(j.POINTER_MOVE,this.onPointerMove,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.onPointerUp,this)}}const Rd=Math.PI/180/100;class ag{radius;phi;theta;coords;constructor(e=1,t=0,a=0){return this.radius=e,this.phi=t,this.theta=a,this.coords=new b,this}set(e,t,a){return this.radius=e,this.phi=t,this.theta=a,this}makeSafe(){return this.phi=Math.max(Rd,Math.min(Math.PI-Rd,this.phi)),this}setFromVector3(e){return this.setCoords(e.x,e.y,e.z)}setCoords(e,t,a){return this.radius=Math.sqrt(e*e+t*t+a*a),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,a),this.phi=Math.acos(Ae(t/this.radius,-1,1))),this}getCoords(){const e=Math.sin(this.phi)*this.radius;return this.coords.x=e*Math.sin(this.theta),this.coords.y=Math.cos(this.phi)*this.radius,this.coords.z=e*Math.cos(this.theta),this.coords}}class rg extends qe{focus;_rotation=new b(45,0,0);distance=5;_camera;constructor(){super()}start(){if(this._camera=this.object3D.getOrAddComponent(Hr),!this._camera){console.error("ThirdPersonCameraController need camera");return}if(!this.focus){console.error("ThirdPersonCameraController need target");return}_.inputSystem.addEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.addEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.addEventListener(j.POINTER_DOWN,this.mouseDown,this)}mouseDown(e){_.inputSystem.addEventListener(j.POINTER_MOVE,this.mouseMove,this)}mouseUp(e){_.inputSystem.removeEventListener(j.POINTER_MOVE,this.mouseMove,this)}mouseMove(e){this._rotation.y+=e.movementX*.01,this._rotation.x+=e.movementY*.01}mouseWheel(e){this.distance+=_.inputSystem.wheelDelta*.1}onUpdate(){let e=new b;this._camera.transform.forward.scaleToRef(this.distance,e);var t=this.focus.transform.worldPosition;this._camera.transform.localPosition=t.subtract(e)}destroy(e){_.inputSystem.removeEventListener(j.POINTER_WHEEL,this.mouseWheel,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.mouseUp,this),_.inputSystem.removeEventListener(j.POINTER_DOWN,this.mouseDown,this),super.destroy(e)}}var tt=(s=>(s[s.NORMAL=0]="NORMAL",s[s.DOWN=1]="DOWN",s[s.OVER=2]="OVER",s[s.DISABLE=3]="DISABLE",s))(tt||{});let Id=Math.PI*2;class Nr{a;b;c;d;tx;ty;constructor(e=1,t=0,a=0,r=1,i=0,n=0){this.a=e,this.b=t,this.c=a,this.d=r,this.tx=i,this.ty=n}clone(){return new Nr(this.a,this.b,this.c,this.d,this.tx,this.ty)}concat(e){let t=this.a,a=this.c,r=this.tx;this.a=t*e.a+this.b*e.c,this.b=t*e.b+this.b*e.d,this.c=a*e.a+this.d*e.c,this.d=a*e.b+this.d*e.d,this.tx=r*e.a+this.ty*e.c+e.tx,this.ty=r*e.b+this.ty*e.d+e.ty}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}identity(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this}invert(){this._invertInto(this)}rotate(e){if(e=+e,e!==0){e=e*pt;let t=Math.cos(e),a=Math.sin(e),r=this.a,i=this.b,n=this.c,o=this.d,l=this.tx,c=this.ty;this.a=r*t-i*a,this.b=r*a+i*t,this.c=n*t-o*a,this.d=n*a+o*t,this.tx=l*t-c*a,this.ty=l*a+c*t}}scale(e,t){e!==1&&(this.a*=e,this.c*=e,this.tx*=e),t!==1&&(this.b*=t,this.d*=t,this.ty*=t)}setTo(e,t,a,r,i,n){return this.a=e,this.b=t,this.c=a,this.d=r,this.tx=i,this.ty=n,this}transformPoint(e,t,a){let r=this.a*e+this.c*t+this.tx,i=this.b*e+this.d*t+this.ty;return a?(a.setTo(r,i,0,1),a):new b(r,i,0,1)}setTranslate(e,t){this.tx=e,this.ty=t}translate(e,t){this.tx+=e,this.ty+=t}mul(e){let t=this,a=e,r=t.a,i=t.b,n=t.c,o=t.d,l=t.tx,c=t.ty,f=a.a,h=a.b,u=a.c,g=a.d,A=a.tx,m=a.ty;h!==0||u!==0?(this.a=r*f+i*u,this.b=r*h+i*g,this.c=n*f+o*u,this.d=n*h+o*g,this.tx=f*l+u*c+A,this.ty=h*l+g*c+m):(this.a=r*f,this.b=i*g,this.c=n*f,this.d=o*g,this.tx=f*l+A,this.ty=g*c+m)}equals(e){return this.a==e.a&&this.b==e.b&&this.c==e.c&&this.d==e.d&&this.tx==e.tx&&this.ty==e.ty}prepend(e,t,a,r,i,n){let o=this.tx;if(e!=1||t!=0||a!=0||r!=1){let l=this.a,c=this.c;this.a=l*e+this.b*a,this.b=l*t+this.b*r,this.c=c*e+this.d*a,this.d=c*t+this.d*r}return this.tx=o*e+this.ty*a+i,this.ty=o*t+this.ty*r+n,this}append(e){let t=this.a,a=this.b,r=this.c,i=this.d;return(e.a!=1||e.b!=0||e.c!=0||e.d!=1)&&(this.a=e.a*t+e.b*r,this.b=e.a*a+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*a+e.d*i),this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*a+e.ty*i+this.ty,this}deltaTransformPoint(e){let t=this,a=t.a*e.x+t.c*e.y,r=t.b*e.x+t.d*e.y;return new b(a,r)}toString(){return"(a="+this.a+", b="+this.b+", c="+this.c+", d="+this.d+", tx="+this.tx+", ty="+this.ty+")"}createBox(e,t,a=0,r=0,i=0){let n=this;if(a!==0){a=a*pt;let o=Math.cos(a),l=Math.sin(a);n.a=o*e,n.b=l*t,n.c=-l*e,n.d=o*t}else n.a=e,n.b=0,n.c=0,n.d=t;n.tx=r,n.ty=i}createGradientBox(e,t,a=0,r=0,i=0){this.createBox(e/1638.4,t/1638.4,a,r+e/2,i+t/2)}_invertInto(e){let t=this.a,a=this.b,r=this.c,i=this.d,n=this.tx,o=this.ty;if(a==0&&r==0){e.b=e.c=0,t==0||i==0?e.a=e.d=e.tx=e.ty=0:(t=e.a=1/t,i=e.d=1/i,e.tx=-t*n,e.ty=-i*o);return}let l=t*i-a*r;if(l==0){e.identity();return}l=1/l;let c=e.a=i*l;a=e.b=-a*l,r=e.c=-r*l,i=e.d=t*l,e.tx=-(c*n+r*o),e.ty=-(a*n+i*o)}getScaleX(){let e=this;if(e.a==1&&e.b==0)return 1;let t=Math.sqrt(e.a*e.a+e.b*e.b);return this.getDeterminant()<0?-t:t}getScaleY(){let e=this;if(e.c==0&&e.d==1)return 1;let t=Math.sqrt(e.c*e.c+e.d*e.d);return this.getDeterminant()<0?-t:t}getSkewX(){return Math.atan2(this.d,this.c)-Math.PI/2}getSkewY(){return Math.atan2(this.b,this.a)}updateScaleAndRotation(e,t,a,r){if((a==0||a==Id)&&(r==0||r==Id)){this.a=e,this.b=this.c=0,this.d=t;return}a=a*pt,r=r*pt;let i=Math.cos(a),n=Math.sin(a);a==r?(this.a=i*e,this.b=n*e):(this.a=Math.cos(r)*e,this.b=Math.sin(r)*e),this.c=-n*t,this.d=i*t}preMultiplyInto(e,t){let a=e.a*this.a,r=0,i=0,n=e.d*this.d,o=e.tx*this.a+this.tx,l=e.ty*this.d+this.ty;(e.b!==0||e.c!==0||this.b!==0||this.c!==0)&&(a+=e.b*this.c,n+=e.c*this.b,r+=e.a*this.b+e.b*this.d,i+=e.c*this.a+e.d*this.c,o+=e.ty*this.c,l+=e.tx*this.b),t.a=a,t.b=r,t.c=i,t.d=n,t.tx=o,t.ty=l}$transformBounds(e){let t=this.a,a=this.b,r=this.c,i=this.d,n=this.tx,o=this.ty,l=e.x,c=e.y,f=l+e.width,h=c+e.height,u=t*l+r*c+n,g=a*l+i*c+o,A=t*f+r*c+n,m=a*f+i*c+o,p=t*f+r*h+n,D=a*f+i*h+o,B=t*l+r*h+n,v=a*l+i*h+o,C=0;u>A&&(C=u,u=A,A=C),p>B&&(C=p,p=B,B=C),e.x=Math.floor(u<p?u:p),e.width=Math.ceil((A>B?A:B)-e.x),g>m&&(C=g,g=m,m=C),D>v&&(C=D,D=v,v=C),e.y=Math.floor(g<D?g:D),e.height=Math.ceil((m>v?m:v)-e.y)}getDeterminant(){return this.a*this.d-this.b*this.c}}class Li extends qe{isGUICanvas=!0;index=0;addChild(e){return this.object3D.addChild(e),this}removeChild(e){return this.object3D.removeChild(e),this}cloneTo(e){e.getOrAddComponent(Li).copyComponent(this)}copyComponent(e){return e.index=e.index,this}}var nt=(s=>(s[s.NONE=0]="NONE",s[s.POSITION=1]="POSITION",s[s.SPRITE=2]="SPRITE",s[s.COLOR=4]="COLOR",s[s.MAX=7]="MAX",s))(nt||{});class uo{array;buffer;constructor(e){this.buffer=new Te(e,0),this.array=new Float32Array(this.buffer.memory.shareDataBuffer)}}class Qd extends Ve{_attributeUV;_attributeVIndex;_faceIndexes;_uvSize=2;_vIndexSize=1;_posAttribute;_spriteAttribute;_colorAttribute;_onPositionChange=!0;_onSpriteChange=!0;_onColorChange=!0;maxQuadCount;constructor(e){super(),this.maxQuadCount=e}updateSubGeometry(e,t,a){let r=this.subGeometries[e];if(r){let i=r.lodLevels[0];i.indexStart=t,i.indexCount=a,i.index=e}else r=this.addSubGeometry({indexStart:t,indexCount:a,vertexStart:0,vertexCount:0,firstStart:0,index:e,topology:0});return r}resetSubGeometries(){for(let e of this.subGeometries){let t=e.lodLevels[0];t.indexStart=0,t.indexCount=0,t.index=0}}updateBounds(e,t){let a=Number.MAX_VALUE*.1;return e=new b(-a,-a,-a),t=new b(a,a,a),this.bounds.setFromMinMax(e,t),this}getPositionBuffer(){return this._onPositionChange&&(this._posAttribute.buffer.apply(),this._onPositionChange=!1),this._posAttribute.buffer}getSpriteBuffer(){return this._onSpriteChange&&(this._spriteAttribute.buffer.apply(),this._onSpriteChange=!1),this._spriteAttribute.buffer}getColorBuffer(){return this._onColorChange&&(this._colorAttribute.buffer.apply(),this._onColorChange=!1),this._colorAttribute.buffer}create(){this.createBuffer(),this.updateBounds();let e=this.maxQuadCount,t=[],a=[];for(let i=0;i<e;i++)t.push(...ci.attUV);for(let i=0,n=this.maxQuadCount*ci.vertexCount;i<n;i++)a[i]=i;this._attributeUV=new Float32Array(ci.vertexCount*e*this._uvSize),this._attributeVIndex=new Float32Array(ci.vertexCount*e*this._vIndexSize),this._attributeUV.set(t,0),this._attributeVIndex.set(a,0);let r=[];for(let i=0;i<e;i++)for(let n=0;n<ci.indecies.length;n++){const o=ci.indecies[n]+i*4;r.push(o)}return this._faceIndexes=new Uint32Array(e*6),this._faceIndexes.set(r,0),this.setIndices(this._faceIndexes),this.setAttribute(G.uv,this._attributeUV),this.setAttribute(G.vIndex,this._attributeVIndex),this.updateSubGeometry(0,0,this._faceIndexes.length),this}createBuffer(){let e=this.maxQuadCount;this._posAttribute=new uo(e*4),this._spriteAttribute=new uo(e*12),this._colorAttribute=new uo(e*4)}fillQuad(e,t){e.dirtyAttributes&nt.POSITION&&this.fillQuadPosition(e,t),e.dirtyAttributes&nt.COLOR&&this.fillQuadColor(e,t),e.dirtyAttributes&nt.SPRITE&&this.fillQuadSprite(e,t)}fillQuadPosition(e,t){Td.setXYZW(this._posAttribute.array,e.z,e.left,e.bottom,e.right,e.top),this._onPositionChange=!0}fillQuadColor(e,t){let a=e.color,r=this._colorAttribute.array;Td.setXYZW(r,e.z,a.r,a.g,a.b,a.a),this._onColorChange=!0}fillQuadSprite(e,t){let a=e.sprite,r=0,i=0;a.isSliced&&e.imageType==ni.Sliced&&(r=a.trimSize.x,r=(t.width-(a.offsetSize.z-a.trimSize.x))/r,i=a.trimSize.y,i=(t.height-(a.offsetSize.w-a.trimSize.y))/i);let n=a.guiTexture.dynamicId,o=a.uvRec,l=a.uvBorder,c=this._spriteAttribute.array,f=12*e.z;c[f+0]=o.x,c[f+1]=o.y,c[f+2]=o.z,c[f+3]=o.w,c[f+4]=l.x,c[f+5]=l.y,c[f+6]=l.z,c[f+7]=l.w,c[f+8]=r,c[f+9]=i,c[f+10]=n,c[f+11]=e.visible?1:0,this._onSpriteChange=!0}}class ig{static set(e,t,a,r,...i){let n=t*r+a;for(let o=0,l=i.length;o<l;o++)e[n+o]=i[o]}}class Td extends ig{static setXYZW(e,t,a,r,i,n){this.set(e,t,0,4,a,r,i,n)}static setXYZ(e,t,a,r,i){this.set(e,t,0,4,a,r,i)}static setZ(e,t,a){this.set(e,t,3,4,a)}}class ci{static vertexCount=4;static attUV=[0,0,1,0,1,1,0,1];static indecies=[0,1,2,0,2,3]}class Md{_textureMap=new Map;_textureList=[];build(e,t,a){let r=t._geometry;r.resetSubGeometries();let i=-1,n=0,o=0,l=0,c=0,f=this._textureList,h=this._textureMap;function u(){l>0&&(t.updateDrawCallSegment(c,o,l),t._uiRenderer.materials[c].setTextures(f),h.clear(),f.length=0,c++,o+=l,l=0,n=0)}h.clear(),f.length=0;let g=[],A=t.quadMaxCount-1;for(let m of e){let p=m.needUpdateQuads;g.length=0;const D=this.collectQuads(m.object3D,g);for(let B of D){let v=B.sprite.guiTexture;if(h.has(v.staticId)||(n==7&&u(),h.set(v.staticId,v),v.dynamicId=n,f[n]=v.texture,n+=1),B.z=++i,l+=6,B.cacheTextureId!=v.dynamicId&&(B.dirtyAttributes=nt.MAX,B.cacheTextureId=v.dynamicId),(p||a)&&(B.dirtyAttributes=nt.MAX),B.dirtyAttributes&nt.POSITION&&B.applyTransform(m),B.dirtyAttributes&&B.writeToGeometry(r,m),i==A)return u(),!0}}return u(),!1}collectQuads(e,t){t||=[];let a=e.components.values();for(let r of a){let i=r;if(i.isUIShadow||!i.mainQuads)continue;let n=i.getShadowRender();n&&this.push(n.mainQuads,t),this.push(i.mainQuads,t)}return t}push(e,t){e&&e.length>0&&t.push(...e)}}class bo{static bindTextureArray(){let e="";for(let t=0;t<7;t++)e+=`
|
|
11540
11540
|
@group(1) @binding(auto)
|
|
11541
11541
|
var tex_${t}Sampler: sampler;
|
|
11542
11542
|
@group(1) @binding(auto)
|
|
@@ -11784,9 +11784,9 @@ fn frag(){
|
|
|
11784
11784
|
}
|
|
11785
11785
|
|
|
11786
11786
|
${this.fs}
|
|
11787
|
-
`}class go extends Dt{_scissorRect;_screenSize=new de(1024,768);_scissorEnable=!1;constructor(e){super(),Y.register("GUI_shader_view",bo.GUI_shader_view),Y.register("GUI_shader_world",bo.GUI_shader_world);let t=new gt;this.addColorPass(t,le.COLOR,e),this.addColorPass(t,le.UI,e),this.shader=t}addColorPass(e,t,a){let r=a==ca.View?"GUI_shader_view":"GUI_shader_world",i=new Xe(r,r);i.passType=t,i.setShaderEntry("VertMain","FragMain"),i.setUniformVector4("scissorRect",new he),i.setUniformVector2("screenSize",this._screenSize),i.setUniformFloat("scissorCornerRadius",0),i.setUniformFloat("scissorFadeOutSize",0),i.setUniformFloat("pixelRatio",1),i.setUniformVector3("v3",b.ZERO);let n=i.shaderState;n.depthWriteEnabled=!1,i.blendMode=me.NORMAL,i.depthCompare=a==ca.View?ot.always:ot.less_equal,i.cullMode=Nt.back,e.addRenderPass(i)}setPanelRatio(e){this.shader.setUniformFloat("pixelRatio",e)}setScissorRect(e,t,a,r){this._scissorRect||=new he,this._scissorRect.set(e,t,a,r),this.shader.setUniformVector4("scissorRect",this._scissorRect)}setScissorEnable(e){this._scissorEnable!=e&&(this._scissorEnable=e,e?this.shader.setDefine("SCISSOR_ENABLE",!0):this.shader.deleteDefine("SCISSOR_ENABLE"),this.shader.noticeValueChange())}setScissorCorner(e,t){this.shader.setUniformFloat("scissorCornerRadius",e),this.shader.setUniformFloat("scissorFadeOutSize",t)}setScreenSize(e,t){return this._screenSize.set(e,t),this.shader.setUniformVector2("screenSize",this._screenSize),this}setTextures(e){for(let t=0;t<7;t++){let a=e[t]||_.res.whiteTexture;this.shader.setTexture(`tex_${t}`,a),this.setVideoTextureDefine(t,a.isVideoTexture)}}_videoTextureFlags={};setVideoTextureDefine(e,t){let a=!1;t!=this._videoTextureFlags[e]&&(t?this.shader.setDefine(`VideoTexture${e}`,!0):this.shader.deleteDefine(`VideoTexture${e}`),this._videoTextureFlags[e]=t,a=!0),a&&this.shader.noticeValueChange()}set envMap(e){}set shadowMap(e){}set baseMap(e){}set normalMap(e){}set emissiveMap(e){}set irradianceMap(e){}set irradianceDepthMap(e){}}class Nd extends d.MeshRenderer{_guiGeometry;init(e){super.init(),this.addRendererMask(Qe.UI),this.removeRendererMask(Qe.Default),this.castGI=!1,this.castShadow=!1,this.alwaysRender=!0,this._ignoreEnvMap=this._ignorePrefilterMap=!0}get geometry(){return super.geometry}set geometry(e){super.geometry=e,this._guiGeometry=e}nodeUpdate(e,t,a,r){for(let i=0;i<this.materials.length;i++){let o=this.materials[i].getPass(t),l=this._guiGeometry.getPositionBuffer(),c=this._guiGeometry.getSpriteBuffer(),f=this._guiGeometry.getColorBuffer();if(o)for(let h=0;h<o.length;h++){const u=o[h];u.pipeline||(u.setStorageBuffer("vPositionBuffer",l),u.setStorageBuffer("vSpriteBuffer",c),u.setStorageBuffer("vColorBuffer",f))}}super.nodeUpdate(e,t,a,r)}onUpdate(e){}}class Pd{_use;_unUse;constructor(){this._use=[],this._unUse=[]}pushBack(e){let t=this._use.indexOf(e);t!=-1&&(this._use.splice(t,1),this._unUse.push(e))}getUseList(){return this._use}getOne(e,t){let a;return this._unUse.length>0?(a=this._unUse[0],this._unUse.splice(0,1),this._use.push(a),a):(a=new e(t),this._use.push(a),a)}hasFree(){return this._unUse.length>0}}let Gi;class Pa{x=0;y=0;z=0;width=1;height=1;_globalX=0;_globalY=0;_globalWidth=0;_globalHeight=0;_visible=!0;_offsetX=0;_offsetY=0;_sprite=_.res.defaultGUISprite;_color=new J(1,1,1,1);_imageType=ni.Simple;dirtyAttributes=nt.MAX;cacheTextureId=-1;static textPool;static get quadPool(){return this.textPool||=new Pd,this.textPool}static recycleQuad(e){e.sprite=null,e.dirtyAttributes=nt.MAX,e.x=0,e.y=0,e.z=-1,e.cacheTextureId=-1,Pa.quadPool.pushBack(e)}static spawnQuad(){return Pa.quadPool.getOne(Pa)}get imageType(){return this._imageType}set imageType(e){this._imageType=e,this.setAttrChange(nt.SPRITE|nt.POSITION)}get color(){return this._color}set color(e){this._color.copyFrom(e),this.setAttrChange(nt.COLOR)}get visible(){return this._visible}set visible(e){e!=this._visible&&(this._visible=e,this.setAttrChange(nt.SPRITE))}get sprite(){return this._sprite}set sprite(e){this._sprite!=e&&(this._sprite=e,this.setAttrChange(nt.SPRITE|nt.POSITION))}get left(){return this._globalX-this._offsetX}get right(){return this.left+this._globalWidth}get top(){return this._globalY-this._offsetY}get bottom(){return this.top+this._globalHeight}setSize(e,t){this.width=e,this.height=t,this.setAttrChange(nt.POSITION)}setXY(e,t){this.x=e,this.y=t,this.setAttrChange(nt.POSITION)}setAttrChange(e){this.dirtyAttributes=this.dirtyAttributes|e}applyTransform(e){this.setAttrChange(nt.POSITION);let t=this._sprite,a=e.getWorldMatrix();(this.x!=0||this.y!=0)&&(a=this.getQuadMatrix(a));let r=a.getScaleX(),i=a.getScaleY(),n=t.isSliced&&this._imageType==ni.Sliced;if(this._offsetX=e.width*.5*r,this._offsetY=e.height*.5*i,n)this._globalWidth=r*(e.width-(t.offsetSize.z-t.trimSize.x)),this._globalHeight=i*(e.height-(t.offsetSize.w-t.trimSize.y)),this._globalX=a.tx+t.offsetSize.x*r,this._globalY=a.ty+t.offsetSize.y*i;else{let o=this.width/t.offsetSize.z,l=this.height/t.offsetSize.w;this._globalWidth=r*t.trimSize.x*o,this._globalHeight=i*t.trimSize.y*l,this._globalX=a.tx+t.offsetSize.x*o*r,this._globalY=a.ty+t.offsetSize.y*l*i}return this}getQuadMatrix(e){return Gi||=new Nr,Gi.identity(),Gi.setTranslate(this.x,this.y),Gi.mul(e),Gi}writeToGeometry(e,t){return e.fillQuad(this,t),this.dirtyAttributes=nt.NONE,this}}class mo extends qe{_uiTransform;_visible=!0;destroy(){this._uiTransform.setNeedUpdateUIPanel(),super.destroy()}get uiTransform(){return this._uiTransform}get visible(){return this._visible}set visible(e){this._visible!=e&&(this._visible=e,this.onUIComponentVisible?.(this._visible))}init(e){super.init?.(e),this._uiTransform=this.object3D.getOrAddComponent(er),this._uiTransform.setNeedUpdateUIPanel()}copyComponent(e){return this.visible=e.visible,this}}class zi extends mo{_mainQuads;_shadowRender;_shadowSource;isUIShadow;isShadowless;needUpdateShadow;init(e){super.init?.(e),this._mainQuads=[]}destroy(){this.detachQuads(),this._shadowRender?.setShadowSource(null),this._shadowSource?.setShadowRenderer(null),super.destroy(),this._shadowRender=null,this._shadowSource=null}start(){super.start?.(),this.isUIShadow?this.autoBindShadow(null,this):this.isShadowless||this.autoBindShadow(this,null),this.setShadowDirty()}setShadowDirty(){this._shadowRender&&(this._shadowRender.needUpdateShadow=!0)}get mainQuads(){return this._mainQuads}setShadowRenderer(e){this._shadowRender=e}setShadowSource(e){this._shadowSource=e}getShadowRender(){return this._shadowRender}autoBindShadow(e,t){let a=this.object3D.components.values();if(!e)for(let r of a){let i=r;if(!(i.isShadowless||i.isUIShadow)&&i.mainQuads){e=i;break}}if(!t)for(let r of a){let i=r;if(i.isUIShadow&&i.mainQuads){t=i;break}}return e&&t?(e.setShadowRenderer(t),t.setShadowSource(e),!0):!1}recycleQuad(e){if(e&&this._mainQuads){let t=this._mainQuads.indexOf(e);t>=0?(this._mainQuads.splice(t,1),Pa.recycleQuad(e)):e=null}return e}attachQuad(e){return this._mainQuads&&this._mainQuads.push(e),this}detachQuads(){if(this._mainQuads)for(;this._mainQuads.length>0;){let e=this._mainQuads.shift();this.recycleQuad(e)}return this}copyComponent(e){return super.copyComponent(e),this.isUIShadow=e.isUIShadow,this.isShadowless=e.isShadowless,this}}class Pr extends zi{init(e){super.init?.(e),this.attachQuad(Pa.spawnQuad()),this.sprite=_.res.defaultGUISprite}cloneTo(e){e.getOrAddComponent(Pr).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.sprite=e.sprite,this.color=e.color,this.imageType=e.imageType,this}set sprite(e){e||=_.res.defaultGUISprite;for(let t of this._mainQuads)t.sprite=e,t.setSize(this._uiTransform.width,this._uiTransform.height);this.setShadowDirty()}onTransformResize(){this.applyTransformSize()}applyTransformSize(){for(let e of this._mainQuads)e.setSize(this._uiTransform.width,this._uiTransform.height);this.setShadowDirty()}get sprite(){return this._mainQuads[0].sprite}onUIComponentVisible(e){this.applyComponentVisible()}onUITransformVisible(e){this.applyComponentVisible()}applyComponentVisible(){let e=!this._visible||!this._uiTransform.globalVisible;for(let t of this._mainQuads)t.visible=!e;this.setShadowDirty()}get color(){return this._mainQuads[0].color}set color(e){for(let t of this._mainQuads)t.color=e;this.setShadowDirty()}get imageType(){return this._mainQuads[0].imageType}set imageType(e){for(let t of this._mainQuads)t.imageType=e;this.setShadowDirty()}}class Wi extends Pr{space=ca.World;needUpdateGeometry=!0;panelOrder=0;needSortOnCameraZ;_billboard;_rebuild;scissorEnable=!1;scissorCornerRadius=0;scissorFadeOutSize=0;_uiRenderer;_geometry;_maxCount=128;panelRatio=1;isUIPanel=!0;cloneTo(e){e.getOrAddComponent(Wi).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.panelOrder=e.panelOrder,this.needSortOnCameraZ=e.needSortOnCameraZ,this.cullMode=e.cullMode,this.billboard=e.billboard,this.scissorEnable=e.scissorEnable,this.scissorCornerRadius=e.scissorCornerRadius,this.scissorFadeOutSize=e.scissorFadeOutSize,this}init(e){super.init(e),this._uiTransform.resize(w.canvas.width,w.canvas.height),this.create(this.space),this.visible=!1}updateDrawCallSegment(e,t,a){this._geometry.updateSubGeometry(e,t,a);let r=this._uiRenderer.material,i=this._uiRenderer.materials[e];if(!i){i=new go(this.space);let n=this._uiRenderer.materials.slice();n.push(i),this._uiRenderer.materials=n,i.cullMode=r.cullMode,i.depthCompare=r.depthCompare}}create(e){this._maxCount=this.space==ca.World?Tr.quadMaxCountForWorld:Tr.quadMaxCountForView,this._uiRenderer=this.object3D.addComponent(Nd),this._geometry=this._uiRenderer.geometry=new Qd(this._maxCount).create(),this._uiRenderer.material=new go(e),this._uiRenderer.renderOrder=Tr.SortOrderStartWorld,this._rebuild=new Md,this.object3D.bound=new xe(new b,new b(1,1,1).multiplyScalar(Number.MAX_VALUE*.1))}get quadMaxCount(){return this._maxCount}get renderer(){return this._uiRenderer}set billboard(e){this.space==ca.View&&(e=pr.None,console.warn("Cannot enable billboard in view space")),e==pr.BillboardXYZ||e==pr.BillboardY?(this._billboard=this.object3D.getOrAddComponent(Mi),this._billboard.type=e):(this.object3D.removeComponent(Mi),this._billboard=null)}get billboard(){return this._billboard?this._billboard.type:pr.None}set cullMode(e){if(this.space==ca.World)for(let t of this._uiRenderer.materials)t.cullMode=e;else console.warn("Cannot change cullMode in view space")}get cullMode(){return this._uiRenderer.material.cullMode}onUpdate(e){super.onUpdate?.(e),this.rebuildGUIMesh(e)}_collectTransform=[];rebuildGUIMesh(e){let t=this,a=t._collectTransform;if(a.length=0,t.object3D.getComponents(er,a),a.length>0){t._rebuild.build(a,t,t.needUpdateGeometry);for(const o of a)o.needUpdateQuads=!1}let r=t.object3D.getComponentFromParent(Li),i=r?r.index:0;t._uiRenderer.enable=a.length>0;let n=t.isViewPanel?Tr.SortOrderStartView:Tr.SortOrderStartWorld;if(t._uiRenderer.renderOrder=i*Tr.SortOrderCanvasSpan+n+t.panelOrder,t._uiRenderer.needSortOnCameraZ=t.needSortOnCameraZ,this.space==ca.View){let o=w.canvas.clientWidth,l=w.canvas.clientHeight,c=this._uiTransform.width,f=this._uiTransform.height;this.panelRatio=this.updateGUIPixelRatio(o,l,c,f)}else this.panelRatio=1;for(let o of t._uiRenderer.materials){let l=o;if(l.setPanelRatio(this.panelRatio),l.setScreenSize(w.canvas.clientWidth,w.canvas.clientHeight),l.setScissorEnable(t.scissorEnable),t.scissorEnable){let c=t.mainQuads[0];l.setScissorRect(c.left,c.bottom,c.right,c.top),l.setScissorCorner(t.scissorCornerRadius,t.scissorFadeOutSize)}}t.needUpdateGeometry=!1}updateGUIPixelRatio(e,t,a,r){let i=a/r,n=e/t,o=1;return i<n?o=t/r:o=e/a,o}}class En extends Wi{isViewPanel=!0;space=ca.View;constructor(){super()}cloneTo(e){e.getOrAddComponent(En).copyComponent(this)}}class wn extends Wi{isWorldPanel=!0;space=ca.World;_depthTest=!0;constructor(){super()}cloneTo(e){e.getOrAddComponent(wn).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.depthTest=e.depthTest,this}get depthTest(){return this._depthTest}set depthTest(e){if(this._depthTest!=e){this._depthTest=e;let t=this.depthTest?ot.less_equal:ot.always;for(let a of this._uiRenderer.materials)a.depthCompare=t}}}let Vd;class er extends qe{useParentPivot=!1;parent;pivotX=.5;pivotY=.5;_width=100;_height=100;_localVisible=!0;_globalVisible=!0;_uiInteractiveList;get uiInteractiveList(){return this._uiInteractiveList}constructor(){super(),this._localMatrix=new Nr,this._worldMatrix=new Nr}init(e){super.init(e),this.transform.eventDispatcher.addEventListener(this.transform.eventLocalChange.type,this.onTransformChange,this),this.onParentChange(null,this.object3D.parent?.object3D)}onTransformChange(e){this.onChange=!0}addUIInteractive(e){return this._uiInteractiveList||=[],this._uiInteractiveList.push(e),this}removeUIInteractive(e){if(this._uiInteractiveList){let t=this._uiInteractiveList.indexOf(e);if(t>=0)return this._uiInteractiveList.slice(t,1),e}return null}get globalVisible(){return this._globalVisible}set visible(e){if(this._localVisible!=e){this._localVisible=e;let t=this.parent?this.parent._globalVisible:!0;this.onUITransformVisible(this._localVisible&&t)}}get visible(){return this._localVisible}onUITransformVisible(e){let t=this._localVisible&&e;t!=this._globalVisible&&(this._globalVisible=t,this.object3D.components.forEach((a,r)=>{let i=a;if(i.onUITransformVisible)if(i==this)for(let n of this.object3D.entityChildren){let o=n.getComponent(er);o&&o.onUITransformVisible(this._globalVisible)}else i.onUITransformVisible(this._globalVisible)}))}onParentChange(e,t){this.parent?.setNeedUpdateUIPanel(),this.parent=t?.getComponent(er),this.parent?.setNeedUpdateUIPanel()}get width(){return this._width}get height(){return this._height}resize(e,t){if(this._width!=e||this._height!=t){this._width=e,this._height=t,this.onChange=!0;for(let a of this.object3D.components.values())a.onTransformResize?.();return!0}return!1}get x(){return this.object3D.x}set x(e){e!=this.object3D.x&&(this.object3D.x=e,this.onChange=!0)}get y(){return this.object3D.y}set y(e){e!=this.object3D.y&&(this.object3D.y=e,this.onChange=!0)}setXY(e,t){let a=this.object3D.localPosition;a.set(e,t,a.z),this.object3D.localPosition=a,this.onChange=!0}get z(){return this.object3D.z}set z(e){e!=this.object3D.z&&(this.object3D.z=e,this.onChange=!0)}get scaleX(){return this.object3D.scaleX}set scaleX(e){this.onChange=!0,this.object3D.scaleX=e}get scaleY(){return this.object3D.scaleY}set scaleY(e){this.onChange=!0,this.object3D.scaleY=e}get scaleZ(){return this.object3D.scaleZ}set scaleZ(e){this.onChange=!0,this.object3D.scaleZ=e}_localMatrix;_worldMatrix;_onChange=!0;needUpdateQuads=!0;get onChange(){return this._onChange}_tempTransforms=[];set onChange(e){if(this._onChange!=e&&(this._onChange=e,e)){this._tempTransforms.length=0;let t=this.object3D.getComponents(er,this._tempTransforms,!0);for(let a of t)a._onChange=!0,a.needUpdateQuads=!0}}onEnable(){this.setNeedUpdateUIPanel(),this.onChange=!0}onDisable(){this.setNeedUpdateUIPanel(),this.onChange=!0}setNeedUpdateUIPanel(){let e;e=this.object3D.getComponentFromParent(wn),e||(e=this.object3D.getComponentFromParent(En)),e&&(e.needUpdateGeometry=!0)}cloneTo(e){let t=e.getOrAddComponent(er);t.visible=this.visible,t.x=this.x,t.y=this.y,t.z=this.z,t.resize(this.width,this.height),t.pivotX=this.pivotX,t.pivotY=this.pivotY,t.scaleX=this.scaleX,t.scaleY=this.scaleY}matrix(){let e=this._localMatrix,t=this.object3D.rotationZ;return this.parent?(e.updateScaleAndRotation(this.object3D.scaleX,this.object3D.scaleY,t,t),e.tx=this.object3D.x,e.ty=this.object3D.y):e.updateScaleAndRotation(1,1,0,0),(this.pivotX!=.5||this.pivotY!=.5)&&(Vd||=new Nr().identity(),e.mul(Vd.setTo(1,0,0,1,-(this.pivotX-.5)*this.width,-(this.pivotY-.5)*this.height))),e}getWorldMatrix(){let e=this,t=e._worldMatrix;return this._onChange&&(t.copyFrom(e.matrix()),e.parent&&t.mul(e.parent.getWorldMatrix()),e._onChange=!1),t}beforeDestroy(e){this.transform.eventDispatcher.addEventListener(this.transform.eventLocalChange.type,this.onTransformChange,this),super.beforeDestroy?.(e)}}class Od{_ray;_mouseCode;_clickEvent;_outEvent;_overEvent;_upEvent;_downEvent;_view;init(e){this._view=e,this._ray=new na,this._clickEvent=new Ut(Ut.PICK_CLICK_GUI),this._outEvent=new Ut(Ut.PICK_OUT_GUI),this._overEvent=new Ut(Ut.PICK_OVER_GUI),this._upEvent=new Ut(Ut.PICK_UP_GUI),this._downEvent=new Ut(Ut.PICK_DOWN_GUI),_.inputSystem.addEventListener(j.POINTER_DOWN,this.onTouchDown,this,null,1),_.inputSystem.addEventListener(j.POINTER_UP,this.onTouchUp,this,null,1),_.inputSystem.addEventListener(j.POINTER_MOVE,this.onTouchMove,this,null,1),_.inputSystem.addEventListener(j.POINTER_CLICK,this.onTouchClick,this,null,1)}_lastDownTarget;_lastOverTarget;onTouchClick(e){this._lastOverTarget&&e.stopImmediatePropagation()}onTouchMove(e){this._mouseCode=e.mouseCode,this.collectEntities();let t=this.pick(this._colliderOut);if(t){e.stopImmediatePropagation();let a=t.collider;a!=this._lastOverTarget&&(a.mouseStyle=tt.OVER,Object.assign(this._overEvent,e),this._overEvent.type=Ut.PICK_OVER_GUI,this._overEvent.target=a.object3D,this._overEvent.data=t,a.object3D.dispatchEvent(this._overEvent),this._lastOverTarget&&(this._lastOverTarget.mouseStyle=tt.NORMAL,Object.assign(this._outEvent,e),this._outEvent.type=Ut.PICK_OUT_GUI,this._outEvent.target=a.object3D,this._outEvent.data=t,this._lastOverTarget.object3D.dispatchEvent(this._outEvent))),this._lastOverTarget=a}else this._lastOverTarget&&(this._lastOverTarget.mouseStyle=tt.NORMAL,Object.assign(this._outEvent,e),this._outEvent.type=Ut.PICK_OUT_GUI,this._outEvent.target=this._lastOverTarget.object3D,this._outEvent.data=t,this._lastOverTarget.object3D.dispatchEvent(this._outEvent),this._lastOverTarget=null)}_lastDownPosition=new de;_calcDistanceVec2=new de;_lastDownTime=0;_clickTimeSpan=200;_clickDistanceSpan=10;onTouchDown(e){this._lastDownTime=Le.time,this._lastDownPosition.set(e.mouseX,e.mouseY),this._mouseCode=e.mouseCode,this.collectEntities();let t=this.pick(this._colliderOut);t&&e.stopImmediatePropagation();let a=t?t.collider:null;a&&(a.mouseStyle=tt.DOWN,Object.assign(this._downEvent,e),this._downEvent.type=Ut.PICK_DOWN_GUI,this._downEvent.target=a.object3D,this._downEvent.data=t,a.object3D.dispatchEvent(this._downEvent)),this._lastDownTarget=a}onTouchUp(e){this._calcDistanceVec2.set(e.mouseX,e.mouseY),this._mouseCode=e.mouseCode,this.collectEntities();let t=this.pick(this._colliderOut);t&&e.stopImmediatePropagation();let a=t?t.collider:null;this._lastDownTarget&&this._lastDownTarget.enable&&(this._lastDownTarget.mouseStyle=tt.NORMAL),a&&a==this._lastDownTarget&&Le.time-this._lastDownTime<=this._clickTimeSpan&&(this._calcDistanceVec2.set(e.mouseX,e.mouseY),this._calcDistanceVec2.distance(this._lastDownPosition)<=this._clickDistanceSpan&&(Object.assign(this._clickEvent,e),this._clickEvent.type=Ut.PICK_CLICK_GUI,this._clickEvent.target=a.object3D,this._clickEvent.data=t,a.object3D.dispatchEvent(this._clickEvent))),this._lastDownTarget=null}_colliderOut=[];_transformList=[];_sortWorldPanelList=[];_iteractive2PanelDict=new Map;collectEntities(){return this._colliderOut.length=0,this._sortWorldPanelList.length=0,this._iteractive2PanelDict.clear(),this._view.canvasList.slice().reverse().forEach(t=>{if(t&&t.transform&&t.transform.parent){let a=t.object3D.getComponentsByProperty("isUIPanel",!0,!0);a.sort((r,i)=>{let n=r._uiRenderer.__renderOrder,o=i._uiRenderer.__renderOrder;return n>o?-1:1});for(let r of a){this._transformList.length=0,r.object3D.getComponents(er,this._transformList),this._transformList.reverse();for(const i of this._transformList){let n=i.uiInteractiveList;if(n&&n.length>0)for(let o of n)this._colliderOut.push(o),this._iteractive2PanelDict.set(o,r)}}}}),this._colliderOut}pick(e){this._ray=this._view.camera.screenPointToRay(_.inputSystem.mouseX,_.inputSystem.mouseY);let t=new de(_.inputSystem.mouseX,_.inputSystem.mouseY),a=new de(w.canvas.clientWidth,w.canvas.clientHeight),r;for(const i of e)if(i.interactive&&i.enable&&i.interactiveVisible){let n=this._iteractive2PanelDict.get(i);if(r=i.rayPick(this._ray,n,t,a),r)return r.collider=i,r}return null}}var Ld=(s=>(s[s.COLLINEAR=0]="COLLINEAR",s[s.LINES_INTERSECT=1]="LINES_INTERSECT",s[s.SEGMENTS_INTERSECT=2]="SEGMENTS_INTERSECT",s[s.A_BISECTS_B=3]="A_BISECTS_B",s[s.B_BISECTS_A=4]="B_BISECTS_A",s[s.PARALELL=5]="PARALELL",s))(Ld||{}),Gd=(s=>(s[s.ON_LINE=0]="ON_LINE",s[s.LEFT_SIDE=1]="LEFT_SIDE",s[s.RIGHT_SIDE=2]="RIGHT_SIDE",s))(Gd||{});class vt{static cacluteLine0=new vt(null,null);static cacluteLine1=new vt(null,null);start;end;color=new J(1,1,1,1);_normal;_normalCalculated=!1;constructor(e,t){this.start=e,this.end=t}set(e,t){this.start=e,this.end=t}getCenter(){let e=b.HELP_0;return this.start.subtract(this.end,e),e.scaleBy(.5),e.add(this.end),e}inverse(){let e=this.start;this.start=this.end,this.end=e}equals(e){return this.start==e.start&&this.end==e.end||this.start==e.end&&this.end==e.start}toArray(){return[this.start.x,this.start.y,this.start.z,this.end.x,this.end.y,this.end.z]}static getLines(e){let t=[];for(let a=0;a<e.length;a++){let r=a,i=cs(a+1,e.length),n=e[r],o=e[i];t.push(new vt(n,o))}return t}intersection(e,t=null){var a=(e.end.z-e.start.z)*(this.end.x-this.start.x)-(e.end.x-e.start.x)*(this.end.z-this.start.z),r=(e.end.x-e.start.x)*(this.start.z-e.start.z)-(e.end.z-e.start.z)*(this.start.x-e.start.x),i=(e.start.x-this.start.x)*(this.end.z-this.start.z)-(e.start.z-this.start.z)*(this.end.x-this.start.x);if(a==0)return r==0&&i==0?0:5;r=r/a,i=i/a;var n=this.start.x+r*(this.end.x-this.start.x),o=this.start.z+r*(this.end.z-this.start.z);return t!=null&&(t.x=n,t.y=0,t.z=o),r>=0&&r<=1&&i>=0&&i<=1?2:i>=0&&i<=1?3:r>=0&&r<=1?4:1}getDirection(){var e=this.end.subtract(this.start),t=new b(e.x,e.y);return t.normalize()}copyFrom(e){this.start||(this.start=new b),this.end||(this.end=new b),this.start.copyFrom(e.start),this.end.copyFrom(e.end)}static IsEqual(e,t){return Math.abs(e-t)<1e-7}static squreDistanceSegmentToSegment(e,t,a){let r=e.start,i=e.end,n=t.start,o=t.end,l=r.x,c=r.y,f=r.z,h=i.x,u=i.y,g=i.z,A=n.x,m=n.y,p=n.z,D=o.x,B=o.y,v=o.z,C=h-l,y=u-c,x=g-f,k=D-A,E=B-m,S=v-p,Q=l-A,I=c-m,T=f-p,M=C*C+y*y+x*x,Z=C*k+y*E+x*S,be=k*k+E*E+S*S,re=C*Q+y*I+x*T,P=k*Q+E*I+S*T,z=M*be-Z*Z,H=z,O=z,ie=0,W=0;this.IsEqual(z,0)?(ie=0,H=1,W=P,O=be):(ie=Z*P-be*re,W=M*P-Z*re,ie<0?(ie=0,W=P,O=be):ie>H&&(ie=H,W=P+Z,O=be)),W<0?(W=0,-re<0?ie=0:-re>M?ie=H:(ie=-re,H=M)):W>O&&(W=O,-re+Z<0?ie=0:-re+Z>M?ie=H:(ie=-re+Z,H=M));let $=0,ee=0;this.IsEqual(ie,0)?$=0:$=ie/H,this.IsEqual(W,0)?ee=0:ee=W/O;let oe=Q+$*C-ee*k,fe=I+$*y-ee*E,De=T+$*x-ee*S;return oe*oe+fe*fe+De*De}isNear(e,t=0,a){let r=b.HELP_0,i=b.HELP_1;r.copyFrom(e.origin),i.copyFrom(e.direction),i.scaleBy(9999),i.add(r,i),vt.cacluteLine0.set(r,i),vt.cacluteLine1.copyFrom(this),a&&(a.perspectiveMultiplyPoint3(vt.cacluteLine1.start,vt.cacluteLine1.start),a.perspectiveMultiplyPoint3(vt.cacluteLine1.end,vt.cacluteLine1.end));let n=vt.squreDistanceSegmentToSegment(vt.cacluteLine0,vt.cacluteLine1,a);return n+1e-4<=t?(e.length=n,!0):(e.length=-999999,!1)}}class Ji{static ID=-1;v1;v2;v3;u1;u2;u3;n1;n2;n3;t0;t;u;v;min=new b;max=new b;id=0;constructor(e,t,a){this.id=Ji.ID+++200,e&&t&&a&&this.set(e,t,a)}set(e,t,a){this.v1=e,this.v2=t,this.v3=a;let r=this.min,i=this.max;return r.x=Math.min(this.v1.x,this.v2.x,this.v3.x),r.y=Math.min(this.v1.y,this.v2.y,this.v3.y),r.z=Math.min(this.v1.z,this.v2.z,this.v3.z),i.x=Math.max(this.v1.x,this.v2.x,this.v3.x),i.y=Math.max(this.v1.y,this.v2.y,this.v3.y),i.z=Math.max(this.v1.z,this.v2.z,this.v3.z),this}getNormal(){let e=this.v1,t=this.v2,a=this.v3,r=new b(t.x-e.x,t.y-e.y,t.z-e.z),n=new b(a.x-e.x,a.y-e.y,a.z-e.z).crossProduct(r);return n.normalize(),n}turnBack(){let e=this.v3;this.v3=this.v1,this.v1=e}getLines(){let e=this.v1,t=this.v2,a=this.v3;return[new vt(e,t),new vt(t,a),new vt(a,e)]}equals(e){let t=this.getLines(),a=e.getLines(),r=0;for(let i=0;i<t.length;i++)for(let n=0;n<a.length;n++)t[i].equals(a[n])&&r++;return r==3}getCenter(){let e=this.min,t=this.max,a=new b;return a.x=(e.x+t.x)*.5,a.y=(e.y+t.y)*.5,a.z=(e.z+t.z)*.5,a}intersects(e){var t=this.max,a=this.min,r=e.max,i=e.min;return a.x<=r.x&&t.x>=i.x&&a.y<=r.y&&t.y>=i.y&&a.z<=r.z&&t.z>=i.z}sign2D(e,t,a){return(e.x-a.x)*(t.z-a.z)-(t.x-a.x)*(e.z-a.z)}pointInTriangle2D(e){let t=this.v1,a=this.v2,r=this.v3,i,n,o,l,c;return i=this.sign2D(e,t,a),n=this.sign2D(e,a,r),o=this.sign2D(e,r,t),l=i<0||n<0||o<0,c=i>0||n>0||o>0,!(l&&c)}toArray(){return[this.v1.x,this.v1.y,this.v1.z,this.v2.x,this.v2.y,this.v2.z,this.v3.x,this.v3.y,this.v3.z]}}class zd{static _pt0;static _pt1;static _pt2;static _pt3;static _hitPoint;static _worldMatrix;static _ray;static _triangle;static _isInit;static init(){this._pt0=new b,this._pt1=new b,this._pt2=new b,this._pt3=new b,this._ray=new na,this._triangle=new Ji,this._hitPoint=new b,this._worldMatrix=new R}static rayPick(e,t,a,r,i,n,o){this._isInit||(this.init(),this._isInit=!0);let l=this._worldMatrix;if(r==ca.World){let c;this.calculateHotArea_World(n,this._pt0,this._pt1,this._pt2,this._pt3),l.copyFrom(o).invert();let f=this._ray;if(f.copy(e).applyMatrix(l),this._triangle.set(this._pt0,this._pt1,this._pt2),c=f.intersectTriangle(f.origin,f.direction,this._triangle),c||(this._triangle.set(this._pt1,this._pt2,this._pt3),c=f.intersectTriangle(f.origin,f.direction,this._triangle)),c)return{distance:0,intersectPoint:c}}else{this.calculateHotArea_View(n,i,this._pt0,this._pt1,this._pt2,this._pt3);let c=a.x,f=a.y,h=Math.min(this._pt0.x,this._pt1.x,this._pt2.x,this._pt3.x)+c*.5,u=Math.min(this._pt0.y,this._pt1.y,this._pt2.y,this._pt3.y)+f*.5,g=Math.max(this._pt0.x,this._pt1.x,this._pt2.x,this._pt3.x)+c*.5,A=Math.max(this._pt0.y,this._pt1.y,this._pt2.y,this._pt3.y)+f*.5;return t.x<=g&&t.x>=h&&t.y<=A&&t.y>=u?(this._hitPoint.set(t.x,t.y,0),{distance:0,intersectPoint:this._hitPoint}):null}return null}static calculateHotArea_View(e,t,a,r,i,n){let o=e.getWorldMatrix(),l=o.getScaleX(),c=o.getScaleY(),f=e.width*.5*l,h=e.height*.5*c;a.set(-f,-h,0),r.set(f,-h,0),i.set(-f,h,0),n.set(f,h,0);let u=o.tx;a.x+=u,r.x+=u,i.x+=u,n.x+=u,u=o.ty,a.y-=u,r.y-=u,i.y-=u,n.y-=u,a.multiplyScalar(t),r.multiplyScalar(t),i.multiplyScalar(t),n.multiplyScalar(t)}static calculateHotArea_World(e,t,a,r,i){let n=e.getWorldMatrix(),o=n.getScaleX(),l=n.getScaleY(),c=e.width*.5*o,f=e.height*.5*l;t.set(-c,f,0),a.set(c,f,0),r.set(-c,-f,0),i.set(c,-f,0);let h=n.tx;t.x+=h,a.x+=h,r.x+=h,i.x+=h,h=n.ty,t.y+=h,a.y+=h,r.y+=h,i.y+=h}}var Wd=(s=>(s[s.UpperLeft=0]="UpperLeft",s[s.UpperCenter=1]="UpperCenter",s[s.UpperRight=2]="UpperRight",s[s.MiddleLeft=3]="MiddleLeft",s[s.MiddleCenter=4]="MiddleCenter",s[s.MiddleRight=5]="MiddleRight",s[s.LowerLeft=6]="LowerLeft",s[s.LowerCenter=7]="LowerCenter",s[s.LowerRight=8]="LowerRight",s))(Wd||{}),Jd=(s=>(s[s.Upper=0]="Upper",s[s.Middle=1]="Middle",s[s.Lower=2]="Lower",s))(Jd||{}),jd=(s=>(s[s.Left=0]="Left",s[s.Center=1]="Center",s[s.Right=2]="Right",s))(jd||{});class Zd{charList=[];quadList=[];width=0;index=0}class Yd{layout(e){let t=[],a=e.originSize,r=ri.getFontData(e.font,a),i=e.fontSize/a;return this.makeTextLine(e.uiTransform,e.alignment,t,e.font,r,e.text,i,a,e.lineSpacing),t}makeTextLine(e,t,a,r,i,n,o,l,c){let f=-1,h=0,u=l*o,g=u*.5,A=e.width/o,m=e.height/o,p=0,D=e.height,B=()=>{h=0,f++;let x=new Zd;return x.index=f,a.push(x),x},v=(x,k)=>{const E=x.charCodeAt(0).toString();let S=ri.getFnt(r,l,E),Q=null;return S?(Q=Pa.spawnQuad(),Q.sprite=S,Q.x=(h+S.xoffset)*o-p,Q.y=(i.base-S.height-S.yoffset-i.base)*o+D,Q.width=S.offsetSize.width*o,Q.height=S.offsetSize.height*o,h+=S.xadvance):x==`
|
|
11787
|
+
`}class go extends Dt{_scissorRect;_screenSize=new de(1024,768);_scissorEnable=!1;constructor(e){super(),Y.register("GUI_shader_view",bo.GUI_shader_view),Y.register("GUI_shader_world",bo.GUI_shader_world);let t=new gt;this.addColorPass(t,le.COLOR,e),this.addColorPass(t,le.UI,e),this.shader=t}addColorPass(e,t,a){let r=a==ca.View?"GUI_shader_view":"GUI_shader_world",i=new Xe(r,r);i.passType=t,i.setShaderEntry("VertMain","FragMain"),i.setUniformVector4("scissorRect",new he),i.setUniformVector2("screenSize",this._screenSize),i.setUniformFloat("scissorCornerRadius",0),i.setUniformFloat("scissorFadeOutSize",0),i.setUniformFloat("pixelRatio",1),i.setUniformVector3("v3",b.ZERO);let n=i.shaderState;n.depthWriteEnabled=!1,i.blendMode=me.NORMAL,i.depthCompare=a==ca.View?ot.always:ot.less_equal,i.cullMode=Nt.back,e.addRenderPass(i)}setPanelRatio(e){this.shader.setUniformFloat("pixelRatio",e)}setScissorRect(e,t,a,r){this._scissorRect||=new he,this._scissorRect.set(e,t,a,r),this.shader.setUniformVector4("scissorRect",this._scissorRect)}setScissorEnable(e){this._scissorEnable!=e&&(this._scissorEnable=e,e?this.shader.setDefine("SCISSOR_ENABLE",!0):this.shader.deleteDefine("SCISSOR_ENABLE"),this.shader.noticeValueChange())}setScissorCorner(e,t){this.shader.setUniformFloat("scissorCornerRadius",e),this.shader.setUniformFloat("scissorFadeOutSize",t)}setScreenSize(e,t){return this._screenSize.set(e,t),this.shader.setUniformVector2("screenSize",this._screenSize),this}setTextures(e){for(let t=0;t<7;t++){let a=e[t]||_.res.whiteTexture;this.shader.setTexture(`tex_${t}`,a),this.setVideoTextureDefine(t,a.isVideoTexture)}}_videoTextureFlags={};setVideoTextureDefine(e,t){let a=!1;t!=this._videoTextureFlags[e]&&(t?this.shader.setDefine(`VideoTexture${e}`,!0):this.shader.deleteDefine(`VideoTexture${e}`),this._videoTextureFlags[e]=t,a=!0),a&&this.shader.noticeValueChange()}set envMap(e){}set shadowMap(e){}set baseMap(e){}set normalMap(e){}set emissiveMap(e){}set irradianceMap(e){}set irradianceDepthMap(e){}}class Nd extends d.MeshRenderer{_guiGeometry;init(e){super.init(),this.addRendererMask(Qe.UI),this.removeRendererMask(Qe.Default),this.castGI=!1,this.castShadow=!1,this.alwaysRender=!0,this._ignoreEnvMap=this._ignorePrefilterMap=!0}get geometry(){return super.geometry}set geometry(e){super.geometry=e,this._guiGeometry=e}nodeUpdate(e,t,a,r){for(let i=0;i<this.materials.length;i++){let o=this.materials[i].getPass(t),l=this._guiGeometry.getPositionBuffer(),c=this._guiGeometry.getSpriteBuffer(),f=this._guiGeometry.getColorBuffer();if(o)for(let h=0;h<o.length;h++){const u=o[h];u.pipeline||(u.setStorageBuffer("vPositionBuffer",l),u.setStorageBuffer("vSpriteBuffer",c),u.setStorageBuffer("vColorBuffer",f))}}super.nodeUpdate(e,t,a,r)}onUpdate(e){}}class Pd{_use;_unUse;constructor(){this._use=[],this._unUse=[]}pushBack(e){let t=this._use.indexOf(e);t!=-1&&(this._use.splice(t,1),this._unUse.push(e))}getUseList(){return this._use}getOne(e,t){let a;return this._unUse.length>0?(a=this._unUse[0],this._unUse.splice(0,1),this._use.push(a),a):(a=new e(t),this._use.push(a),a)}hasFree(){return this._unUse.length>0}}let Gi;class Na{x=0;y=0;z=0;width=1;height=1;_globalX=0;_globalY=0;_globalWidth=0;_globalHeight=0;_visible=!0;_offsetX=0;_offsetY=0;_sprite=_.res.defaultGUISprite;_color=new J(1,1,1,1);_imageType=ni.Simple;dirtyAttributes=nt.MAX;cacheTextureId=-1;static textPool;static get quadPool(){return this.textPool||=new Pd,this.textPool}static recycleQuad(e){e.sprite=null,e.dirtyAttributes=nt.MAX,e.x=0,e.y=0,e.z=-1,e.cacheTextureId=-1,Na.quadPool.pushBack(e)}static spawnQuad(){return Na.quadPool.getOne(Na)}get imageType(){return this._imageType}set imageType(e){this._imageType=e,this.setAttrChange(nt.SPRITE|nt.POSITION)}get color(){return this._color}set color(e){this._color.copyFrom(e),this.setAttrChange(nt.COLOR)}get visible(){return this._visible}set visible(e){e!=this._visible&&(this._visible=e,this.setAttrChange(nt.SPRITE))}get sprite(){return this._sprite}set sprite(e){this._sprite!=e&&(this._sprite=e,this.setAttrChange(nt.SPRITE|nt.POSITION))}get left(){return this._globalX-this._offsetX}get right(){return this.left+this._globalWidth}get top(){return this._globalY-this._offsetY}get bottom(){return this.top+this._globalHeight}setSize(e,t){this.width=e,this.height=t,this.setAttrChange(nt.POSITION)}setXY(e,t){this.x=e,this.y=t,this.setAttrChange(nt.POSITION)}setAttrChange(e){this.dirtyAttributes=this.dirtyAttributes|e}applyTransform(e){this.setAttrChange(nt.POSITION);let t=this._sprite,a=e.getWorldMatrix();(this.x!=0||this.y!=0)&&(a=this.getQuadMatrix(a));let r=a.getScaleX(),i=a.getScaleY(),n=t.isSliced&&this._imageType==ni.Sliced;if(this._offsetX=e.width*.5*r,this._offsetY=e.height*.5*i,n)this._globalWidth=r*(e.width-(t.offsetSize.z-t.trimSize.x)),this._globalHeight=i*(e.height-(t.offsetSize.w-t.trimSize.y)),this._globalX=a.tx+t.offsetSize.x*r,this._globalY=a.ty+t.offsetSize.y*i;else{let o=this.width/t.offsetSize.z,l=this.height/t.offsetSize.w;this._globalWidth=r*t.trimSize.x*o,this._globalHeight=i*t.trimSize.y*l,this._globalX=a.tx+t.offsetSize.x*o*r,this._globalY=a.ty+t.offsetSize.y*l*i}return this}getQuadMatrix(e){return Gi||=new Nr,Gi.identity(),Gi.setTranslate(this.x,this.y),Gi.mul(e),Gi}writeToGeometry(e,t){return e.fillQuad(this,t),this.dirtyAttributes=nt.NONE,this}}class mo extends qe{_uiTransform;_visible=!0;destroy(){this._uiTransform.setNeedUpdateUIPanel(),super.destroy()}get uiTransform(){return this._uiTransform}get visible(){return this._visible}set visible(e){this._visible!=e&&(this._visible=e,this.onUIComponentVisible?.(this._visible))}init(e){super.init?.(e),this._uiTransform=this.object3D.getOrAddComponent(er),this._uiTransform.setNeedUpdateUIPanel()}copyComponent(e){return this.visible=e.visible,this}}class zi extends mo{_mainQuads;_shadowRender;_shadowSource;isUIShadow;isShadowless;needUpdateShadow;init(e){super.init?.(e),this._mainQuads=[]}destroy(){this.detachQuads(),this._shadowRender?.setShadowSource(null),this._shadowSource?.setShadowRenderer(null),super.destroy(),this._shadowRender=null,this._shadowSource=null}start(){super.start?.(),this.isUIShadow?this.autoBindShadow(null,this):this.isShadowless||this.autoBindShadow(this,null),this.setShadowDirty()}setShadowDirty(){this._shadowRender&&(this._shadowRender.needUpdateShadow=!0)}get mainQuads(){return this._mainQuads}setShadowRenderer(e){this._shadowRender=e}setShadowSource(e){this._shadowSource=e}getShadowRender(){return this._shadowRender}autoBindShadow(e,t){let a=this.object3D.components.values();if(!e)for(let r of a){let i=r;if(!(i.isShadowless||i.isUIShadow)&&i.mainQuads){e=i;break}}if(!t)for(let r of a){let i=r;if(i.isUIShadow&&i.mainQuads){t=i;break}}return e&&t?(e.setShadowRenderer(t),t.setShadowSource(e),!0):!1}recycleQuad(e){if(e&&this._mainQuads){let t=this._mainQuads.indexOf(e);t>=0?(this._mainQuads.splice(t,1),Na.recycleQuad(e)):e=null}return e}attachQuad(e){return this._mainQuads&&this._mainQuads.push(e),this}detachQuads(){if(this._mainQuads)for(;this._mainQuads.length>0;){let e=this._mainQuads.shift();this.recycleQuad(e)}return this}copyComponent(e){return super.copyComponent(e),this.isUIShadow=e.isUIShadow,this.isShadowless=e.isShadowless,this}}class Pr extends zi{init(e){super.init?.(e),this.attachQuad(Na.spawnQuad()),this.sprite=_.res.defaultGUISprite}cloneTo(e){e.getOrAddComponent(Pr).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.sprite=e.sprite,this.color=e.color,this.imageType=e.imageType,this}set sprite(e){e||=_.res.defaultGUISprite;for(let t of this._mainQuads)t.sprite=e,t.setSize(this._uiTransform.width,this._uiTransform.height);this.setShadowDirty()}onTransformResize(){this.applyTransformSize()}applyTransformSize(){for(let e of this._mainQuads)e.setSize(this._uiTransform.width,this._uiTransform.height);this.setShadowDirty()}get sprite(){return this._mainQuads[0].sprite}onUIComponentVisible(e){this.applyComponentVisible()}onUITransformVisible(e){this.applyComponentVisible()}applyComponentVisible(){let e=!this._visible||!this._uiTransform.globalVisible;for(let t of this._mainQuads)t.visible=!e;this.setShadowDirty()}get color(){return this._mainQuads[0].color}set color(e){for(let t of this._mainQuads)t.color=e;this.setShadowDirty()}get imageType(){return this._mainQuads[0].imageType}set imageType(e){for(let t of this._mainQuads)t.imageType=e;this.setShadowDirty()}}class Wi extends Pr{space=ca.World;needUpdateGeometry=!0;panelOrder=0;needSortOnCameraZ;_billboard;_rebuild;scissorEnable=!1;scissorCornerRadius=0;scissorFadeOutSize=0;_uiRenderer;_geometry;_maxCount=128;panelRatio=1;isUIPanel=!0;cloneTo(e){e.getOrAddComponent(Wi).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.panelOrder=e.panelOrder,this.needSortOnCameraZ=e.needSortOnCameraZ,this.cullMode=e.cullMode,this.billboard=e.billboard,this.scissorEnable=e.scissorEnable,this.scissorCornerRadius=e.scissorCornerRadius,this.scissorFadeOutSize=e.scissorFadeOutSize,this}init(e){super.init(e),this._uiTransform.resize(w.canvas.width,w.canvas.height),this.create(this.space),this.visible=!1}updateDrawCallSegment(e,t,a){this._geometry.updateSubGeometry(e,t,a);let r=this._uiRenderer.material,i=this._uiRenderer.materials[e];if(!i){i=new go(this.space);let n=this._uiRenderer.materials.slice();n.push(i),this._uiRenderer.materials=n,i.cullMode=r.cullMode,i.depthCompare=r.depthCompare}}create(e){this._maxCount=this.space==ca.World?Tr.quadMaxCountForWorld:Tr.quadMaxCountForView,this._uiRenderer=this.object3D.addComponent(Nd),this._geometry=this._uiRenderer.geometry=new Qd(this._maxCount).create(),this._uiRenderer.material=new go(e),this._uiRenderer.renderOrder=Tr.SortOrderStartWorld,this._rebuild=new Md,this.object3D.bound=new xe(new b,new b(1,1,1).multiplyScalar(Number.MAX_VALUE*.1))}get quadMaxCount(){return this._maxCount}get renderer(){return this._uiRenderer}set billboard(e){this.space==ca.View&&(e=mr.None,console.warn("Cannot enable billboard in view space")),e==mr.BillboardXYZ||e==mr.BillboardY?(this._billboard=this.object3D.getOrAddComponent(Mi),this._billboard.type=e):(this.object3D.removeComponent(Mi),this._billboard=null)}get billboard(){return this._billboard?this._billboard.type:mr.None}set cullMode(e){if(this.space==ca.World)for(let t of this._uiRenderer.materials)t.cullMode=e;else console.warn("Cannot change cullMode in view space")}get cullMode(){return this._uiRenderer.material.cullMode}onUpdate(e){super.onUpdate?.(e),this.rebuildGUIMesh(e)}_collectTransform=[];rebuildGUIMesh(e){let t=this,a=t._collectTransform;if(a.length=0,t.object3D.getComponents(er,a),a.length>0){t._rebuild.build(a,t,t.needUpdateGeometry);for(const o of a)o.needUpdateQuads=!1}let r=t.object3D.getComponentFromParent(Li),i=r?r.index:0;t._uiRenderer.enable=a.length>0;let n=t.isViewPanel?Tr.SortOrderStartView:Tr.SortOrderStartWorld;if(t._uiRenderer.renderOrder=i*Tr.SortOrderCanvasSpan+n+t.panelOrder,t._uiRenderer.needSortOnCameraZ=t.needSortOnCameraZ,this.space==ca.View){let o=w.canvas.clientWidth,l=w.canvas.clientHeight,c=this._uiTransform.width,f=this._uiTransform.height;this.panelRatio=this.updateGUIPixelRatio(o,l,c,f)}else this.panelRatio=1;for(let o of t._uiRenderer.materials){let l=o;if(l.setPanelRatio(this.panelRatio),l.setScreenSize(w.canvas.clientWidth,w.canvas.clientHeight),l.setScissorEnable(t.scissorEnable),t.scissorEnable){let c=t.mainQuads[0];l.setScissorRect(c.left,c.bottom,c.right,c.top),l.setScissorCorner(t.scissorCornerRadius,t.scissorFadeOutSize)}}t.needUpdateGeometry=!1}updateGUIPixelRatio(e,t,a,r){let i=a/r,n=e/t,o=1;return i<n?o=t/r:o=e/a,o}}class En extends Wi{isViewPanel=!0;space=ca.View;constructor(){super()}cloneTo(e){e.getOrAddComponent(En).copyComponent(this)}}class wn extends Wi{isWorldPanel=!0;space=ca.World;_depthTest=!0;constructor(){super()}cloneTo(e){e.getOrAddComponent(wn).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.depthTest=e.depthTest,this}get depthTest(){return this._depthTest}set depthTest(e){if(this._depthTest!=e){this._depthTest=e;let t=this.depthTest?ot.less_equal:ot.always;for(let a of this._uiRenderer.materials)a.depthCompare=t}}}let Vd;class er extends qe{useParentPivot=!1;parent;pivotX=.5;pivotY=.5;_width=100;_height=100;_localVisible=!0;_globalVisible=!0;_uiInteractiveList;get uiInteractiveList(){return this._uiInteractiveList}constructor(){super(),this._localMatrix=new Nr,this._worldMatrix=new Nr}init(e){super.init(e),this.transform.eventDispatcher.addEventListener(this.transform.eventLocalChange.type,this.onTransformChange,this),this.onParentChange(null,this.object3D.parent?.object3D)}onTransformChange(e){this.onChange=!0}addUIInteractive(e){return this._uiInteractiveList||=[],this._uiInteractiveList.push(e),this}removeUIInteractive(e){if(this._uiInteractiveList){let t=this._uiInteractiveList.indexOf(e);if(t>=0)return this._uiInteractiveList.slice(t,1),e}return null}get globalVisible(){return this._globalVisible}set visible(e){if(this._localVisible!=e){this._localVisible=e;let t=this.parent?this.parent._globalVisible:!0;this.onUITransformVisible(this._localVisible&&t)}}get visible(){return this._localVisible}onUITransformVisible(e){let t=this._localVisible&&e;t!=this._globalVisible&&(this._globalVisible=t,this.object3D.components.forEach((a,r)=>{let i=a;if(i.onUITransformVisible)if(i==this)for(let n of this.object3D.entityChildren){let o=n.getComponent(er);o&&o.onUITransformVisible(this._globalVisible)}else i.onUITransformVisible(this._globalVisible)}))}onParentChange(e,t){this.parent?.setNeedUpdateUIPanel(),this.parent=t?.getComponent(er),this.parent?.setNeedUpdateUIPanel()}get width(){return this._width}get height(){return this._height}resize(e,t){if(this._width!=e||this._height!=t){this._width=e,this._height=t,this.onChange=!0;for(let a of this.object3D.components.values())a.onTransformResize?.();return!0}return!1}get x(){return this.object3D.x}set x(e){e!=this.object3D.x&&(this.object3D.x=e,this.onChange=!0)}get y(){return this.object3D.y}set y(e){e!=this.object3D.y&&(this.object3D.y=e,this.onChange=!0)}setXY(e,t){let a=this.object3D.localPosition;a.set(e,t,a.z),this.object3D.localPosition=a,this.onChange=!0}get z(){return this.object3D.z}set z(e){e!=this.object3D.z&&(this.object3D.z=e,this.onChange=!0)}get scaleX(){return this.object3D.scaleX}set scaleX(e){this.onChange=!0,this.object3D.scaleX=e}get scaleY(){return this.object3D.scaleY}set scaleY(e){this.onChange=!0,this.object3D.scaleY=e}get scaleZ(){return this.object3D.scaleZ}set scaleZ(e){this.onChange=!0,this.object3D.scaleZ=e}_localMatrix;_worldMatrix;_onChange=!0;needUpdateQuads=!0;get onChange(){return this._onChange}_tempTransforms=[];set onChange(e){if(this._onChange!=e&&(this._onChange=e,e)){this._tempTransforms.length=0;let t=this.object3D.getComponents(er,this._tempTransforms,!0);for(let a of t)a._onChange=!0,a.needUpdateQuads=!0}}onEnable(){this.setNeedUpdateUIPanel(),this.onChange=!0}onDisable(){this.setNeedUpdateUIPanel(),this.onChange=!0}setNeedUpdateUIPanel(){let e;e=this.object3D.getComponentFromParent(wn),e||(e=this.object3D.getComponentFromParent(En)),e&&(e.needUpdateGeometry=!0)}cloneTo(e){let t=e.getOrAddComponent(er);t.visible=this.visible,t.x=this.x,t.y=this.y,t.z=this.z,t.resize(this.width,this.height),t.pivotX=this.pivotX,t.pivotY=this.pivotY,t.scaleX=this.scaleX,t.scaleY=this.scaleY}matrix(){let e=this._localMatrix,t=this.object3D.rotationZ;return this.parent?(e.updateScaleAndRotation(this.object3D.scaleX,this.object3D.scaleY,t,t),e.tx=this.object3D.x,e.ty=this.object3D.y):e.updateScaleAndRotation(1,1,0,0),(this.pivotX!=.5||this.pivotY!=.5)&&(Vd||=new Nr().identity(),e.mul(Vd.setTo(1,0,0,1,-(this.pivotX-.5)*this.width,-(this.pivotY-.5)*this.height))),e}getWorldMatrix(){let e=this,t=e._worldMatrix;return this._onChange&&(t.copyFrom(e.matrix()),e.parent&&t.mul(e.parent.getWorldMatrix()),e._onChange=!1),t}beforeDestroy(e){this.transform.eventDispatcher.addEventListener(this.transform.eventLocalChange.type,this.onTransformChange,this),super.beforeDestroy?.(e)}}class Od{_ray;_mouseCode;_clickEvent;_outEvent;_overEvent;_upEvent;_downEvent;_view;init(e){this._view=e,this._ray=new na,this._clickEvent=new Ut(Ut.PICK_CLICK_GUI),this._outEvent=new Ut(Ut.PICK_OUT_GUI),this._overEvent=new Ut(Ut.PICK_OVER_GUI),this._upEvent=new Ut(Ut.PICK_UP_GUI),this._downEvent=new Ut(Ut.PICK_DOWN_GUI),_.inputSystem.addEventListener(j.POINTER_DOWN,this.onTouchDown,this,null,1),_.inputSystem.addEventListener(j.POINTER_UP,this.onTouchUp,this,null,1),_.inputSystem.addEventListener(j.POINTER_MOVE,this.onTouchMove,this,null,1),_.inputSystem.addEventListener(j.POINTER_CLICK,this.onTouchClick,this,null,1)}_lastDownTarget;_lastOverTarget;onTouchClick(e){this._lastOverTarget&&e.stopImmediatePropagation()}onTouchMove(e){this._mouseCode=e.mouseCode,this.collectEntities();let t=this.pick(this._colliderOut);if(t){e.stopImmediatePropagation();let a=t.collider;a!=this._lastOverTarget&&(a.mouseStyle=tt.OVER,Object.assign(this._overEvent,e),this._overEvent.type=Ut.PICK_OVER_GUI,this._overEvent.target=a.object3D,this._overEvent.data=t,a.object3D.dispatchEvent(this._overEvent),this._lastOverTarget&&(this._lastOverTarget.mouseStyle=tt.NORMAL,Object.assign(this._outEvent,e),this._outEvent.type=Ut.PICK_OUT_GUI,this._outEvent.target=a.object3D,this._outEvent.data=t,this._lastOverTarget.object3D.dispatchEvent(this._outEvent))),this._lastOverTarget=a}else this._lastOverTarget&&(this._lastOverTarget.mouseStyle=tt.NORMAL,Object.assign(this._outEvent,e),this._outEvent.type=Ut.PICK_OUT_GUI,this._outEvent.target=this._lastOverTarget.object3D,this._outEvent.data=t,this._lastOverTarget.object3D.dispatchEvent(this._outEvent),this._lastOverTarget=null)}_lastDownPosition=new de;_calcDistanceVec2=new de;_lastDownTime=0;_clickTimeSpan=200;_clickDistanceSpan=10;onTouchDown(e){this._lastDownTime=Le.time,this._lastDownPosition.set(e.mouseX,e.mouseY),this._mouseCode=e.mouseCode,this.collectEntities();let t=this.pick(this._colliderOut);t&&e.stopImmediatePropagation();let a=t?t.collider:null;a&&(a.mouseStyle=tt.DOWN,Object.assign(this._downEvent,e),this._downEvent.type=Ut.PICK_DOWN_GUI,this._downEvent.target=a.object3D,this._downEvent.data=t,a.object3D.dispatchEvent(this._downEvent)),this._lastDownTarget=a}onTouchUp(e){this._calcDistanceVec2.set(e.mouseX,e.mouseY),this._mouseCode=e.mouseCode,this.collectEntities();let t=this.pick(this._colliderOut);t&&e.stopImmediatePropagation();let a=t?t.collider:null;this._lastDownTarget&&this._lastDownTarget.enable&&(this._lastDownTarget.mouseStyle=tt.NORMAL),a&&a==this._lastDownTarget&&Le.time-this._lastDownTime<=this._clickTimeSpan&&(this._calcDistanceVec2.set(e.mouseX,e.mouseY),this._calcDistanceVec2.distance(this._lastDownPosition)<=this._clickDistanceSpan&&(Object.assign(this._clickEvent,e),this._clickEvent.type=Ut.PICK_CLICK_GUI,this._clickEvent.target=a.object3D,this._clickEvent.data=t,a.object3D.dispatchEvent(this._clickEvent))),this._lastDownTarget=null}_colliderOut=[];_transformList=[];_sortWorldPanelList=[];_iteractive2PanelDict=new Map;collectEntities(){return this._colliderOut.length=0,this._sortWorldPanelList.length=0,this._iteractive2PanelDict.clear(),this._view.canvasList.slice().reverse().forEach(t=>{if(t&&t.transform&&t.transform.parent){let a=t.object3D.getComponentsByProperty("isUIPanel",!0,!0);a.sort((r,i)=>{let n=r._uiRenderer.__renderOrder,o=i._uiRenderer.__renderOrder;return n>o?-1:1});for(let r of a){this._transformList.length=0,r.object3D.getComponents(er,this._transformList),this._transformList.reverse();for(const i of this._transformList){let n=i.uiInteractiveList;if(n&&n.length>0)for(let o of n)this._colliderOut.push(o),this._iteractive2PanelDict.set(o,r)}}}}),this._colliderOut}pick(e){this._ray=this._view.camera.screenPointToRay(_.inputSystem.mouseX,_.inputSystem.mouseY);let t=new de(_.inputSystem.mouseX,_.inputSystem.mouseY),a=new de(w.canvas.clientWidth,w.canvas.clientHeight),r;for(const i of e)if(i.interactive&&i.enable&&i.interactiveVisible){let n=this._iteractive2PanelDict.get(i);if(r=i.rayPick(this._ray,n,t,a),r)return r.collider=i,r}return null}}var Ld=(s=>(s[s.COLLINEAR=0]="COLLINEAR",s[s.LINES_INTERSECT=1]="LINES_INTERSECT",s[s.SEGMENTS_INTERSECT=2]="SEGMENTS_INTERSECT",s[s.A_BISECTS_B=3]="A_BISECTS_B",s[s.B_BISECTS_A=4]="B_BISECTS_A",s[s.PARALELL=5]="PARALELL",s))(Ld||{}),Gd=(s=>(s[s.ON_LINE=0]="ON_LINE",s[s.LEFT_SIDE=1]="LEFT_SIDE",s[s.RIGHT_SIDE=2]="RIGHT_SIDE",s))(Gd||{});class vt{static cacluteLine0=new vt(null,null);static cacluteLine1=new vt(null,null);start;end;color=new J(1,1,1,1);_normal;_normalCalculated=!1;constructor(e,t){this.start=e,this.end=t}set(e,t){this.start=e,this.end=t}getCenter(){let e=b.HELP_0;return this.start.subtract(this.end,e),e.scaleBy(.5),e.add(this.end),e}inverse(){let e=this.start;this.start=this.end,this.end=e}equals(e){return this.start==e.start&&this.end==e.end||this.start==e.end&&this.end==e.start}toArray(){return[this.start.x,this.start.y,this.start.z,this.end.x,this.end.y,this.end.z]}static getLines(e){let t=[];for(let a=0;a<e.length;a++){let r=a,i=cs(a+1,e.length),n=e[r],o=e[i];t.push(new vt(n,o))}return t}intersection(e,t=null){var a=(e.end.z-e.start.z)*(this.end.x-this.start.x)-(e.end.x-e.start.x)*(this.end.z-this.start.z),r=(e.end.x-e.start.x)*(this.start.z-e.start.z)-(e.end.z-e.start.z)*(this.start.x-e.start.x),i=(e.start.x-this.start.x)*(this.end.z-this.start.z)-(e.start.z-this.start.z)*(this.end.x-this.start.x);if(a==0)return r==0&&i==0?0:5;r=r/a,i=i/a;var n=this.start.x+r*(this.end.x-this.start.x),o=this.start.z+r*(this.end.z-this.start.z);return t!=null&&(t.x=n,t.y=0,t.z=o),r>=0&&r<=1&&i>=0&&i<=1?2:i>=0&&i<=1?3:r>=0&&r<=1?4:1}getDirection(){var e=this.end.subtract(this.start),t=new b(e.x,e.y);return t.normalize()}copyFrom(e){this.start||(this.start=new b),this.end||(this.end=new b),this.start.copyFrom(e.start),this.end.copyFrom(e.end)}static IsEqual(e,t){return Math.abs(e-t)<1e-7}static squreDistanceSegmentToSegment(e,t,a){let r=e.start,i=e.end,n=t.start,o=t.end,l=r.x,c=r.y,f=r.z,h=i.x,u=i.y,g=i.z,A=n.x,m=n.y,p=n.z,D=o.x,B=o.y,v=o.z,C=h-l,y=u-c,x=g-f,k=D-A,E=B-m,S=v-p,Q=l-A,I=c-m,T=f-p,M=C*C+y*y+x*x,Z=C*k+y*E+x*S,be=k*k+E*E+S*S,re=C*Q+y*I+x*T,P=k*Q+E*I+S*T,z=M*be-Z*Z,H=z,O=z,ie=0,W=0;this.IsEqual(z,0)?(ie=0,H=1,W=P,O=be):(ie=Z*P-be*re,W=M*P-Z*re,ie<0?(ie=0,W=P,O=be):ie>H&&(ie=H,W=P+Z,O=be)),W<0?(W=0,-re<0?ie=0:-re>M?ie=H:(ie=-re,H=M)):W>O&&(W=O,-re+Z<0?ie=0:-re+Z>M?ie=H:(ie=-re+Z,H=M));let $=0,ee=0;this.IsEqual(ie,0)?$=0:$=ie/H,this.IsEqual(W,0)?ee=0:ee=W/O;let oe=Q+$*C-ee*k,fe=I+$*y-ee*E,De=T+$*x-ee*S;return oe*oe+fe*fe+De*De}isNear(e,t=0,a){let r=b.HELP_0,i=b.HELP_1;r.copyFrom(e.origin),i.copyFrom(e.direction),i.scaleBy(9999),i.add(r,i),vt.cacluteLine0.set(r,i),vt.cacluteLine1.copyFrom(this),a&&(a.perspectiveMultiplyPoint3(vt.cacluteLine1.start,vt.cacluteLine1.start),a.perspectiveMultiplyPoint3(vt.cacluteLine1.end,vt.cacluteLine1.end));let n=vt.squreDistanceSegmentToSegment(vt.cacluteLine0,vt.cacluteLine1,a);return n+1e-4<=t?(e.length=n,!0):(e.length=-999999,!1)}}class Ji{static ID=-1;v1;v2;v3;u1;u2;u3;n1;n2;n3;t0;t;u;v;min=new b;max=new b;id=0;constructor(e,t,a){this.id=Ji.ID+++200,e&&t&&a&&this.set(e,t,a)}set(e,t,a){this.v1=e,this.v2=t,this.v3=a;let r=this.min,i=this.max;return r.x=Math.min(this.v1.x,this.v2.x,this.v3.x),r.y=Math.min(this.v1.y,this.v2.y,this.v3.y),r.z=Math.min(this.v1.z,this.v2.z,this.v3.z),i.x=Math.max(this.v1.x,this.v2.x,this.v3.x),i.y=Math.max(this.v1.y,this.v2.y,this.v3.y),i.z=Math.max(this.v1.z,this.v2.z,this.v3.z),this}getNormal(){let e=this.v1,t=this.v2,a=this.v3,r=new b(t.x-e.x,t.y-e.y,t.z-e.z),n=new b(a.x-e.x,a.y-e.y,a.z-e.z).crossProduct(r);return n.normalize(),n}turnBack(){let e=this.v3;this.v3=this.v1,this.v1=e}getLines(){let e=this.v1,t=this.v2,a=this.v3;return[new vt(e,t),new vt(t,a),new vt(a,e)]}equals(e){let t=this.getLines(),a=e.getLines(),r=0;for(let i=0;i<t.length;i++)for(let n=0;n<a.length;n++)t[i].equals(a[n])&&r++;return r==3}getCenter(){let e=this.min,t=this.max,a=new b;return a.x=(e.x+t.x)*.5,a.y=(e.y+t.y)*.5,a.z=(e.z+t.z)*.5,a}intersects(e){var t=this.max,a=this.min,r=e.max,i=e.min;return a.x<=r.x&&t.x>=i.x&&a.y<=r.y&&t.y>=i.y&&a.z<=r.z&&t.z>=i.z}sign2D(e,t,a){return(e.x-a.x)*(t.z-a.z)-(t.x-a.x)*(e.z-a.z)}pointInTriangle2D(e){let t=this.v1,a=this.v2,r=this.v3,i,n,o,l,c;return i=this.sign2D(e,t,a),n=this.sign2D(e,a,r),o=this.sign2D(e,r,t),l=i<0||n<0||o<0,c=i>0||n>0||o>0,!(l&&c)}toArray(){return[this.v1.x,this.v1.y,this.v1.z,this.v2.x,this.v2.y,this.v2.z,this.v3.x,this.v3.y,this.v3.z]}}class zd{static _pt0;static _pt1;static _pt2;static _pt3;static _hitPoint;static _worldMatrix;static _ray;static _triangle;static _isInit;static init(){this._pt0=new b,this._pt1=new b,this._pt2=new b,this._pt3=new b,this._ray=new na,this._triangle=new Ji,this._hitPoint=new b,this._worldMatrix=new R}static rayPick(e,t,a,r,i,n,o){this._isInit||(this.init(),this._isInit=!0);let l=this._worldMatrix;if(r==ca.World){let c;this.calculateHotArea_World(n,this._pt0,this._pt1,this._pt2,this._pt3),l.copyFrom(o).invert();let f=this._ray;if(f.copy(e).applyMatrix(l),this._triangle.set(this._pt0,this._pt1,this._pt2),c=f.intersectTriangle(f.origin,f.direction,this._triangle),c||(this._triangle.set(this._pt1,this._pt2,this._pt3),c=f.intersectTriangle(f.origin,f.direction,this._triangle)),c)return{distance:0,intersectPoint:c}}else{this.calculateHotArea_View(n,i,this._pt0,this._pt1,this._pt2,this._pt3);let c=a.x,f=a.y,h=Math.min(this._pt0.x,this._pt1.x,this._pt2.x,this._pt3.x)+c*.5,u=Math.min(this._pt0.y,this._pt1.y,this._pt2.y,this._pt3.y)+f*.5,g=Math.max(this._pt0.x,this._pt1.x,this._pt2.x,this._pt3.x)+c*.5,A=Math.max(this._pt0.y,this._pt1.y,this._pt2.y,this._pt3.y)+f*.5;return t.x<=g&&t.x>=h&&t.y<=A&&t.y>=u?(this._hitPoint.set(t.x,t.y,0),{distance:0,intersectPoint:this._hitPoint}):null}return null}static calculateHotArea_View(e,t,a,r,i,n){let o=e.getWorldMatrix(),l=o.getScaleX(),c=o.getScaleY(),f=e.width*.5*l,h=e.height*.5*c;a.set(-f,-h,0),r.set(f,-h,0),i.set(-f,h,0),n.set(f,h,0);let u=o.tx;a.x+=u,r.x+=u,i.x+=u,n.x+=u,u=o.ty,a.y-=u,r.y-=u,i.y-=u,n.y-=u,a.multiplyScalar(t),r.multiplyScalar(t),i.multiplyScalar(t),n.multiplyScalar(t)}static calculateHotArea_World(e,t,a,r,i){let n=e.getWorldMatrix(),o=n.getScaleX(),l=n.getScaleY(),c=e.width*.5*o,f=e.height*.5*l;t.set(-c,f,0),a.set(c,f,0),r.set(-c,-f,0),i.set(c,-f,0);let h=n.tx;t.x+=h,a.x+=h,r.x+=h,i.x+=h,h=n.ty,t.y+=h,a.y+=h,r.y+=h,i.y+=h}}var Wd=(s=>(s[s.UpperLeft=0]="UpperLeft",s[s.UpperCenter=1]="UpperCenter",s[s.UpperRight=2]="UpperRight",s[s.MiddleLeft=3]="MiddleLeft",s[s.MiddleCenter=4]="MiddleCenter",s[s.MiddleRight=5]="MiddleRight",s[s.LowerLeft=6]="LowerLeft",s[s.LowerCenter=7]="LowerCenter",s[s.LowerRight=8]="LowerRight",s))(Wd||{}),Jd=(s=>(s[s.Upper=0]="Upper",s[s.Middle=1]="Middle",s[s.Lower=2]="Lower",s))(Jd||{}),jd=(s=>(s[s.Left=0]="Left",s[s.Center=1]="Center",s[s.Right=2]="Right",s))(jd||{});class Zd{charList=[];quadList=[];width=0;index=0}class Yd{layout(e){let t=[],a=e.originSize,r=ri.getFontData(e.font,a),i=e.fontSize/a;return this.makeTextLine(e.uiTransform,e.alignment,t,e.font,r,e.text,i,a,e.lineSpacing),t}makeTextLine(e,t,a,r,i,n,o,l,c){let f=-1,h=0,u=l*o,g=u*.5,A=e.width/o,m=e.height/o,p=0,D=e.height,B=()=>{h=0,f++;let x=new Zd;return x.index=f,a.push(x),x},v=(x,k)=>{const E=x.charCodeAt(0).toString();let S=ri.getFnt(r,l,E),Q=null;return S?(Q=Na.spawnQuad(),Q.sprite=S,Q.x=(h+S.xoffset)*o-p,Q.y=(i.base-S.height-S.yoffset-i.base)*o+D,Q.width=S.offsetSize.width*o,Q.height=S.offsetSize.height*o,h+=S.xadvance):x==`
|
|
11788
11788
|
`||(x==" "?h+=u:h+=g),k.width=h,k.quadList.push(Q),k.charList.push(x),Q},C=()=>{let x=this.getAlignment(t);switch(x.v){case 0:for(let k=0,E=a.length;k<E;k++){let S=a[k];if(k>0){let Q=k*u*c;for(let I=0,T=S.quadList.length;I<T;I++){let M=S.quadList[I];M&&(M.y-=Q)}}}break;case 1:for(let k=0,E=a.length;k<E;k++){let S=a[k],Q=(m-E*l*c)*.5*o+k*u*c;for(let I=0,T=S.quadList.length;I<T;I++){let M=S.quadList[I];M&&(M.y-=Q)}}break;case 2:for(let k=0,E=a.length;k<E;k++){let S=a[k],Q=(m-E*l*c)*o+k*u*c;for(let I=0,T=S.quadList.length;I<T;I++){let M=S.quadList[I];M&&(M.y-=Q)}}break}switch(x.h){case 0:break;case 1:for(let k=0,E=a.length;k<E;k++){let S=a[k],Q=(A-S.width)*.5*o;for(let I=0,T=S.quadList.length;I<T;I++){let M=S.quadList[I];M&&(M.x+=Q)}}break;case 2:for(let k=0,E=a.length;k<E;k++){let S=a[k],Q=(A-S.width)*o;for(let I=0,T=S.quadList.length;I<T;I++){let M=S.quadList[I];M&&(M.x+=Q)}}break}};(()=>{let x=null,k=n.length;for(let E=0;E<k;E++){x||=B();let S=n.charAt(E);S==`
|
|
11789
|
-
`||S==" "?x=null:(v(S,x),x.width+g>=A&&(x=B()))}})(),C()}getAlignment(e){let t={v:0,h:0};switch(e){case 1:t.v=0,t.h=1;break;case 0:t.v=0,t.h=0;break;case 2:t.v=0,t.h=2;break;case 4:t.v=1,t.h=1;break;case 3:t.v=1,t.h=0;break;case 5:t.v=1,t.h=2;break;case 7:t.v=2,t.h=1;break;case 6:t.v=2,t.h=0;break;case 8:t.v=2,t.h=2;break}return t}}class Rn extends mo{_style=tt.NORMAL;_interactive=!1;set interactive(e){this._interactive=e}get interactive(){return this._interactive}set mouseStyle(e){this._style=e}get interactiveVisible(){return this._uiTransform.globalVisible&&this._visible}init(e){super.init(e),this._uiTransform.addUIInteractive(this)}destroy(){this._uiTransform.removeUIInteractive(this),super.destroy()}rayPick(e,t,a,r){return zd.rayPick(e,a,r,t.space,t.panelRatio,this._uiTransform,t.transform.worldMatrix)}cloneTo(e){e.getOrAddComponent(Rn).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.enable=e._enable,this.interactive=e._interactive,this.mouseStyle=e._style,this}}var Xd=(s=>(s[s.NONE=0]="NONE",s[s.COLOR=1]="COLOR",s[s.SPRITE=2]="SPRITE",s))(Xd||{});class po extends Rn{_spriteMap;_colorMap;_image;_isCreateImage;_transition=2;init(e){super.init(e),this._interactive=!0,this._spriteMap=new Map,this._colorMap=new Map,this._image=this.object3D.getComponent(Pr),this._isCreateImage=this._image==null,this._image||(this._image=this.object3D.addComponent(Pr)),this.imageType=ni.Sliced}onEnable(){this.mouseStyle=tt.NORMAL}onDisable(){this.mouseStyle=tt.DISABLE}set transition(e){this._transition!=e&&(this._transition=e,this.validateStyle(this._style,!0))}get transition(){return this._transition}get imageType(){return this._image.imageType}set imageType(e){this._image.imageType=e}setStyleColor(e,t){return this._colorMap.set(e,t),this._style==e&&this.validateStyle(this._style,!0),this}getStyleColor(e){return this._colorMap.get(e)}set mouseStyle(e){super.mouseStyle=e,this.validateStyle(e,!0)}get normalSprite(){return this._spriteMap.get(tt.NORMAL)}set normalSprite(e){this._spriteMap.set(tt.NORMAL,e),this._style==tt.NORMAL&&this.validateStyle(this._style,!0)}get overSprite(){return this._spriteMap.get(tt.OVER)}set overSprite(e){this._spriteMap.set(tt.OVER,e),this._style==tt.OVER&&this.validateStyle(this._style,!0)}set downSprite(e){this._spriteMap.set(tt.DOWN,e),this._style==tt.DOWN&&this.validateStyle(this._style,!0)}get downSprite(){return this._spriteMap.get(tt.DOWN)}set disableSprite(e){this._spriteMap.set(tt.DISABLE,e),this._style==tt.DISABLE&&this.validateStyle(this._style,!0)}get disableSprite(){return this._spriteMap.get(tt.DISABLE)}validateStyle(e,t){if(this._transition&2){let a=this._spriteMap.get(e);this._image.sprite=a}if(this._transition&1){let a=this._colorMap.get(e);a&&(this._image.color=a)}}cloneTo(e){e.getOrAddComponent(po).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.imageType=e.imageType,this.transition=e.transition,e._spriteMap.forEach((t,a)=>{t&&this._spriteMap.set(a,t)}),e._colorMap.forEach((t,a)=>{t&&this._colorMap.set(a,t.clone())}),this.mouseStyle=e.mouseStyle,this}destroy(){this._isCreateImage&&this._image&&(this.object3D.removeComponent(Pr),this._image=null),super.destroy()}}class Ao extends zi{_count=0;constructor(){super()}init(e){super.init?.(e),this._count=e?e.count:1;for(let t=0;t<this._count;t++)this.attachQuad(Pa.spawnQuad());this._uiTransform.resize(0,0)}getQuad(e){return this._mainQuads[e]}cloneTo(e){e.addComponent(Ao,{count:this._count}).copyComponent(this)}copyComponent(e){super.copyComponent(e);for(let t=0;t<e._count;t++)this.setSprite(t,e.getSprite(t)),this.setColor(t,e.getColor(t)),this.setImageType(t,e.getImageType(t));return this}setSprite(e,t){this._mainQuads[e].sprite=t||_.res.defaultGUISprite,this.setShadowDirty()}getSprite(e){return this._mainQuads[e].sprite}onUIComponentVisible(e){this.applyComponentVisible()}onUITransformVisible(e){this.applyComponentVisible()}applyComponentVisible(){let e=!this._visible||!this._uiTransform.globalVisible;for(let t of this._mainQuads)t.visible=!e;this.setShadowDirty()}getColor(e){return this._mainQuads[e].color}setColor(e,t){this._mainQuads[e].color=t,this.setShadowDirty()}getImageType(e){return this._mainQuads[e].imageType}setImageType(e,t){this._mainQuads[e].imageType=t,this.setShadowDirty()}setSize(e,t,a){this._mainQuads[e].setSize(t,a),this.setShadowDirty()}setXY(e,t,a){this._mainQuads[e].setXY(t,a),this.setShadowDirty()}getXY(e,t){t||=new de;let a=this._mainQuads[e];return t.x=a.x,t.y=a.y,t}}class Do extends zi{_shadowQuality=1;_shadowOffset;_shadowRadius;_shadowColor;_subShadowColor;needUpdateShadow=!1;init(e){super.init?.(e),this._shadowRadius=2,this._shadowQuality=1,this._shadowOffset=new de(4,-4),this._shadowColor=new J(.1,.1,.1,.8),this._subShadowColor=this._shadowColor.clone(),this.isUIShadow=!0}cloneTo(e){e.getOrAddComponent(Do).copyComponent(this)}copyComponent(e){return super.copyComponent(this),this._shadowColor=e._shadowColor,this._shadowOffset=e._shadowOffset,this._shadowRadius=e._shadowRadius,this._shadowQuality=e.shadowQuality,this}get shadowColor(){return this._shadowColor}set shadowColor(e){this._shadowColor.copyFrom(e),this.needUpdateShadow=!0}set shadowQuality(e){e=Ae(e,0,4),this._shadowQuality!=e&&(this._shadowQuality=e,this.needUpdateShadow=!0)}get shadowQuality(){return this._shadowQuality}set shadowOffset(e){this._shadowOffset=e,this.needUpdateShadow=!0}get shadowOffset(){return this._shadowOffset||=new de(4,-4),this._shadowOffset}set shadowRadius(e){this._shadowRadius!=e&&(this._shadowRadius=e,this.applyShadow())}get shadowRadius(){return this._shadowRadius}onUpdate(e){this.needUpdateShadow&&(this.applyShadow(),this.needUpdateShadow=!1)}applyShadow(){if(this.detachQuads(),this._shadowSource&&this._shadowQuality>0){let e=this._shadowSource.mainQuads;if(e.length>0)for(let t of e)this.createQuadShadow(t)}this._uiTransform.setNeedUpdateUIPanel()}createQuadShadow(e){let t=this._shadowQuality,a=Math.PI*2;this._subShadowColor.copyFrom(this._shadowColor),this._subShadowColor.a=1/Math.max(1,t);for(let r=0;r<t;r++){let i=Pa.spawnQuad(),n=0,o=0;if(r==0)i.color=this._shadowColor;else{let l=a*(r-1)/(t-1);n=Math.sin(l)*this._shadowRadius,o=Math.cos(l)*this._shadowRadius,i.color=this._subShadowColor}i.setXY(n+this._shadowOffset.x+e.x,o+this._shadowOffset.y+e.y),i.setSize(e.width,e.height),i.sprite=e.sprite,i.visible=e.visible,i.imageType=e.imageType,this.attachQuad(i)}}}class _o extends zi{_font="\u5FAE\u8F6F\u96C5\u9ED1";_fontSize=14;_originSize=42;_alignment=0;_lineSpacing=1;_text="";_color=new J(1,1,1,1);constructor(){super()}cloneTo(e){e.getOrAddComponent(_o).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this._font=e._font,this._fontSize=e._fontSize,this._originSize=e._originSize,this._alignment=e._alignment,this._lineSpacing=e._lineSpacing,this._color.copyFrom(e._color),this.text=e.text,this}get originSize(){return this._originSize}get font(){return this._font}set font(e){this._font=e}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!=e&&(this._fontSize=e,this.layoutText())}get text(){return this._text}set text(e){this._text!=e&&(e||(e=""),this._text=e,this.layoutText())}textLine=null;layoutProxy=new Yd;layoutText(){this.detachQuads(),this.textLine=this.layoutProxy.layout(this);for(let e=0,t=this.textLine.length;e<t;e++){let a=this.textLine[e];for(let r=0,i=a.quadList.length;r<i;r++){let n=a.quadList[r];n&&this.attachQuad(n)}}this.color=this._color,this._uiTransform.setNeedUpdateUIPanel(),this.onUIComponentVisible(this._visible),this.setShadowDirty()}onUIComponentVisible(e){this.applyComponentVisible()}onUITransformVisible(e){this.applyComponentVisible()}applyComponentVisible(){let e=!this._visible||!this._uiTransform.globalVisible;for(let t of this._mainQuads)t&&(t.visible=!e);this.setShadowDirty()}onTransformResize(){this.layoutText()}get color(){return this._color}set color(e){this._color.copyFrom(e);for(let t of this._mainQuads)t.color=e;this.setShadowDirty()}get alignment(){return this._alignment}set alignment(e){this._alignment!=e&&(this._alignment=e,this.layoutText())}get lineSpacing(){return this._lineSpacing}set lineSpacing(e){this._lineSpacing!=e&&(this._lineSpacing=e,this.layoutText())}}var ng=Object.getOwnPropertyDescriptor,sg=(s,e,t,a)=>{for(var r=a>1?void 0:a?ng(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.Light=class extends ki{constructor(){super()}init(){super.init(),this.lightData.lightType=ct.PointLight,this.object3D.name==""&&(this.object3D.name="PointLight"+Gt())}get range(){return this.lightData.range}set range(e){this.lightData.range=e,this.onChange()}get at(){return this.lightData.linear}set at(e){this.lightData.linear=e,this.onChange()}get radius(){return this.lightData.radius}set radius(e){this.lightData.radius=e,this.onChange()}get quadratic(){return this.lightData.quadratic}set quadratic(e){this.lightData.quadratic=e,this.onChange()}start(){this.transform.rotationX=90,super.start()}onUpdate(){}onGraphic(e){let t=e.scene.getChildByName("graphic3D");if(!t)return;let a=t.createCustomShape(`PointLight_${this.object3D.instanceID}`,this.transform);a.buildAxis(),a.buildCircle(b.ZERO,this.range,32,b.X_AXIS),a.buildCircle(b.ZERO,this.range,32,b.Y_AXIS),a.buildCircle(b.ZERO,this.range,32,b.Z_AXIS)}debug(){}debugDraw(e){}},d.Light=sg([Lt(d.Light,"Light")],d.Light);var og=Object.getOwnPropertyDescriptor,lg=(s,e,t,a)=>{for(var r=a>1?void 0:a?og(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.FatLineRenderer=class extends Qa{_fatLineMaterial=null;_fatLineGeometry=null;_cachedResolution=new de(0,0);constructor(){super()}onEnable(){super.onEnable()}onDisable(){super.onDisable()}cloneTo(e){e.addComponent(d.FatLineRenderer).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this}set geometry(e){super.geometry=e,this._fatLineGeometry=e,e&&(this.instanceCount=e.instanceCount,this._fatLineMaterial&&e.instanceBuffer&&this._fatLineMaterial.setInstanceBuffer(e.instanceBuffer))}get geometry(){return this._fatLineGeometry}set material(e){this.materials=[e],this._fatLineMaterial=e,this._fatLineGeometry&&this._fatLineGeometry.instanceBuffer&&e.setInstanceBuffer(this._fatLineGeometry.instanceBuffer)}get material(){return this._fatLineMaterial}nodeUpdate(e,t,a,r){if(this._fatLineMaterial&&this.object3D){this._fatLineMaterial.setModelMatrix(this.object3D.transform.worldMatrix);const i=w.presentationSize[0],n=w.presentationSize[1];i>0&&n>0&&(this._cachedResolution.x!==i||this._cachedResolution.y!==n)&&(this._cachedResolution.set(i,n),this._fatLineMaterial.resolution=this._cachedResolution.clone())}super.nodeUpdate(e,t,a,r)}destroy(e){super.destroy(e)}},d.FatLineRenderer=lg([Lt(d.FatLineRenderer,"FatLineRenderer")],d.FatLineRenderer);class Hd extends d.Object3D{index=0;drawCallFrame=-1;constructor(){super()}}var Bo=(s=>(s[s.CastGI=0]="CastGI",s[s.ReceiveGI=1]="ReceiveGI",s[s.CastDepth=2]="CastDepth",s[s.Other=3]="Other",s))(Bo||{});class Kd extends Dt{static count=0;constructor(e=0,t=0){super(),Y.register("GIProbeShader",gd);let a=new gt,r=new Xe("GIProbeShader","GIProbeShader");r.passType=le.COLOR,a.addRenderPass(r),r.setDefine("USE_BRDF",!0),r.setShaderEntry("VertMain","FragMain"),r.setUniformVector4("probeUniform",new he(t,e,0,0));let i=r.shaderState;i.acceptShadow=!1,i.castShadow=!1,i.receiveEnv=!1,i.acceptGI=!1,i.useLight=!1,a.setTexture("baseMap",_.res.whiteTexture),a.setTexture("normalMap",_.res.normalTexture),a.setTexture("emissiveMap",_.res.blackTexture),this.shader=a}}class cg extends qe{_probes;_volume;_debugMr=[];init(e){e||=_.views[0]?.scene,_.setting.gi.enable=!0,this._volume=ve.getLightEntries(e).irradianceVolume,this.initProbe(e)}initProbe(e){let t=this._volume.setting.probeXCount,a=this._volume.setting.probeYCount,r=this._volume.setting.probeZCount,i=new Ir(4,16,16),n=new b;this._probes=[];for(let o=0;o<t;o++)for(let l=0;l<a;l++)for(let c=0;c<r;c++){let f=o+c*t+l*(t*r),h=new Hd;h.index=f,h.name=`${o}_${l}_${c}`;let u=h.addComponent(d.MeshRenderer);u.material=new Kd(Bo.CastGI,f),u.geometry=i,u.castGI=!1,u.castShadow=!1,this._debugMr.push(u),this.object3D.addChild(h),this._volume.calcPosition(o,l,c,n),h.x=n.x,h.y=n.y,h.z=n.z,this._probes[f]=h,this._debugMr.push(u)}for(let o=0;o<this._probes.length;o++)K.instance.addGIProbe(e,this._probes[o]);this.object3D.transform.enable=!1,this._volume.setting.debug&&this.debug()}debug(){}debugProbeRay(e,t){const a=_.setting.gi.rayNumber;let r=new ae(0,-.7071067811865475,.7071067811865475,0);for(let i=0;i<a;i++){let n=e*a+i,o=new b(-t[n*4+0],-t[n*4+1],-t[n*4+2],0);r.transformVector(o,o);let l=t[n*4+3],c=this._probes[e].transform.worldPosition.clone(),f=o.scaleBy(l);f.add(c,f)}}changeProbesVolumeData(){this._volume.setVolumeDataChange()}changeProbesPosition(){this._volume.setVolumeDataChange();let e=this._volume.setting.probeXCount,t=this._volume.setting.probeYCount,a=this._volume.setting.probeZCount,r=new b;for(let i=0;i<e;i++)for(let n=0;n<t;n++)for(let o=0;o<a;o++){let l=i+o*e+n*(e*a),c=this._probes[l];this._volume.calcPosition(i,n,o,r),c.x=r.x,c.y=r.y,c.z=r.z}}onUpdate(){_.setting.gi.maxDistance=_.setting.gi.probeSpace*1.5;let e=this.transform.scene3D.view.camera,t=b.distance(e.transform.worldPosition,e.transform.targetPos)/300;if(this._debugMr&&this._debugMr.length>0)for(let a=0;a<this._debugMr.length;a++){const r=this._debugMr[a].transform;r.scaleX=t,r.scaleY=t,r.scaleZ=t}}}class fg extends Qa{_keyRenderGroup;_keyBufferGroup;_keyIdsGroup;constructor(){super()}init(e){this._keyRenderGroup=new Map,this._keyBufferGroup=new Map,this._keyIdsGroup=new Map}start(){let e=[];this.object3D.getComponents(d.MeshRenderer,e,!0);for(let t=0;t<e.length;t++){const a=e[t];a.transform.updateWorldMatrix(!0),a.enable=!1;let r=a.geometry.instanceID;for(let i=0;i<a.materials.length;i++){const n=a.materials[i];r+=n.instanceID}if(this._keyRenderGroup.has(r))this._keyRenderGroup.get(r).push(a),this._keyIdsGroup.get(r).push(a.transform.worldMatrix.index);else{let i=new Te(e.length);i.visibility=GPUShaderStage.VERTEX,this._keyRenderGroup.set(r,[a]),this._keyBufferGroup.set(r,i),this._keyIdsGroup.set(r,[a.transform.worldMatrix.index])}}this._keyBufferGroup.forEach((t,a)=>{let r=this._keyIdsGroup.get(a),i=this._keyBufferGroup.get(a);i.setInt32Array("matrixIDs",new Int32Array(r)),i.apply()})}reset(){this._keyRenderGroup.size>0&&(this._keyRenderGroup.clear(),this._keyBufferGroup.clear(),this._keyIdsGroup.clear(),this.start())}nodeUpdate(e,t,a,r){this._keyRenderGroup.forEach((i,n)=>{let o=this._keyBufferGroup.get(n),l=i[0];for(let c=0;c<l.materials.length;c++){let h=l.materials[c].getPass(t);if(h)for(let u=0;u<h.length;u++){const g=h[u];g.setDefine("USE_INSTANCEDRAW",!0),g.setStorageBuffer("instanceDrawID",o)}}l.nodeUpdate(e,t,a,r)})}renderPass(e,t,a){this._keyRenderGroup.forEach((r,i)=>{let n=r[0];n.instanceCount=r.length,this.renderItem(e,t,n,a)})}renderItem(e,t,a,r){let i=a.transform._worldMatrix;for(let n=0;n<a.materials.length;n++){let l=a.materials[n].getPass(t);if(!(!l||l.length==0))for(let c=0;c<l.length;c++){let f=l[c];F.bindGeometryBuffer(r.encoder,a.geometry);const h=f;h.shaderState.splitTexture&&(r.endRenderPass(),Et.WriteSplitColorTexture(a.instanceID),r.beginOpaqueRenderPass(),F.bindCamera(r.encoder,e.camera),F.bindGeometryBuffer(r.encoder,a.geometry)),F.bindPipeline(r.encoder,h);let m=a.geometry.subGeometries[n].lodLevels[a.lodLevel];a.instanceCount>0?F.drawIndexed(r.encoder,m.indexCount,a.instanceCount,m.indexStart,0,0):F.drawIndexed(r.encoder,m.indexCount,1,m.indexStart,0,i.index)}}}beforeDestroy(e){this._keyRenderGroup.clear(),this._keyBufferGroup.clear(),this._keyIdsGroup.clear(),this._keyRenderGroup=this._keyBufferGroup=this._keyIdsGroup=void 0,Pe.removeWaitStart(this.object3D,this)}}var dg=Object.getOwnPropertyDescriptor,hg=(s,e,t,a)=>{for(var r=a>1?void 0:a?dg(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.MeshFilter=class extends d.MeshRenderer{constructor(){super()}get geometry(){return null}set geometry(e){}cloneTo(e){}set meshURL(e){let t=_.res.getGeometry(e);t?this.geometry=t:console.error("no geometry set",e)}},d.MeshFilter=hg([Lt(d.MeshFilter,"MeshFilter")],d.MeshFilter);var ug=Object.getOwnPropertyDescriptor,bg=(s,e,t,a)=>{for(var r=a>1?void 0:a?ug(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.SkinnedMeshRenderer=class extends d.MeshRenderer{skinJointsName;mInverseBindMatrixData;mInverseBindMatrixBuffer;mSkeletonAnimation;mJointIndexTableBuffer;constructor(){super(),this.addRendererMask(Qe.SkinnedMesh)}start(){if(super.start(),this.skeletonAnimation=this.object3D.getComponent(d.SkeletonAnimationComponent),!this.skeletonAnimation){let e=this.object3D.parentObject.parentObject.getComponentsInChild(d.SkeletonAnimationComponent);e.length>0&&(this.skeletonAnimation=e[0]);let t=this.object3D;for(;!this.skeletonAnimation&&t;)this.skeletonAnimation=t.getComponentFromParent(d.SkeletonAnimationComponent),t.parent&&(t=t.parent.object3D)}}onEnable(){super.onEnable()}get skeletonAnimation(){return this.mSkeletonAnimation}set skeletonAnimation(e){if(this.mSkeletonAnimation=e,!!e&&!this.mJointIndexTableBuffer){let t=this.mSkeletonAnimation.getJointIndexTable(this.skinJointsName);this.mJointIndexTableBuffer=new Te(t.length*4,0,new Float32Array(t)),this.mJointIndexTableBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.COMPUTE}}get skinInverseBindMatrices(){return this.mInverseBindMatrixData}set skinInverseBindMatrices(e){this.mInverseBindMatrixData=e;var t=new Float32Array(e.length*16);for(let a=0;a<e.length;a++){let r=a*16,i=e[a];t.set(i,r)}this.mInverseBindMatrixBuffer=new Te(t.byteLength,0,t),this.mInverseBindMatrixBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.COMPUTE}get inverseBindMatrixBuffer(){return this.mInverseBindMatrixBuffer}get jointIndexTableBuffer(){return this.mJointIndexTableBuffer.buffer}cloneTo(e){let t=e.addComponent(d.SkinnedMeshRenderer);t.geometry=this.geometry,t.material=this.material.clone(),t.castShadow=this.castShadow,t.castGI=this.castGI,t.receiveShadow=this.receiveShadow,t.rendererMask=this.rendererMask,t.skinJointsName=this.skinJointsName,t.skinInverseBindMatrices=this.skinInverseBindMatrices,t.mJointIndexTableBuffer=this.mJointIndexTableBuffer}nodeUpdate(e,t,a,r){for(let i=0;i<this.materials.length;i++){let o=this.materials[i].getPass(t);if(o)for(let l=0;l<o.length;l++){const c=o[l];!c.pipeline&&this.mSkeletonAnimation&&(c.setStorageBuffer("jointsMatrixIndexTable",this.mSkeletonAnimation.jointMatrixIndexTableBuffer),c.setStorageBuffer("jointsInverseMatrix",this.mInverseBindMatrixBuffer),c.setStorageBuffer("jointsIndexMapingTable",this.mJointIndexTableBuffer))}}super.nodeUpdate(e,t,a,r)}},d.SkinnedMeshRenderer=bg([Lt(d.SkinnedMeshRenderer,"SkinnedMeshRenderer")],d.SkinnedMeshRenderer);class gg extends ht{radius=2.5;height=10;constructor(){super(),this._shapeType=si.Capsule}}class In extends ht{mesh;static triangle;_pickRet;constructor(){super(),this._shapeType=si.Mesh}rayPick(e,t){if(this.mesh){In.triangle||=new Ji(new b,new b,new b);let a=this.mesh.getAttribute(G.position),r=this.mesh.getAttribute(G.indices),i=ht.helpMatrix;i.copyFrom(t).invert();let n=ht.helpRay.copy(e);if(n.applyMatrix(i),n.intersectBox(this.mesh.bounds),!n.intersectBox(this.mesh.bounds,ht.v3_help_0))return null;if(r&&a&&r.data.length>0){let l=a.data;for(let c=0,f=r.data.length/3;c<f;c++){let h=c*3;const u=r.data[h+0]*3,g=r.data[h+1]*3,A=r.data[h+2]*3;let m=In.triangle,p=m.v1.set(l[u+0],l[u+1],l[u+2]),D=m.v2.set(l[g+0],l[g+1],l[g+2]),B=m.v3.set(l[A+0],l[A+1],l[A+2]);m.set(p,D,B);let v=n.intersectTriangle(n.origin,n.direction,m);if(v){this._pickRet||={intersectPoint:new b,distance:0},this._pickRet.intersectPoint=v,this._pickRet.distance=b.distance(n.origin,v);let C=this.mesh.getAttribute(G.normal);if(C){let y=C.data,x=new b(y[u],y[u+1],y[u+2]);t.transformVector(x,x),x.normalize(),this._pickRet.normal=x}return this._pickRet}}}}return null}}class mg extends ht{_pickRet;box;radius=.5;constructor(e){super(),this._shapeType=si.Sphere,this.radius=e,this.box=new Qr(new b,1)}rayPick(e,t){this.box.setFromCenterAndSize(this.center,this.radius);let r=ht.helpMatrix;r.copyFrom(t).invert();let i=ht.helpRay.copy(e);i.applyMatrix(r);let n=i.intersectSphere(i.origin,i.direction,this.box.center,this.box.radius);return n?(this._pickRet||(this._pickRet={intersect:!1,intersectPoint:new b,distance:0}),this._pickRet.intersect=!0,this._pickRet.intersectPoint=n,this._pickRet.distance=b.distance(i.origin,ht.v3_help_0),this._pickRet):null}}class pg extends d.Object3D{_envMap;skyObject;envMapChange=!0;view;constructor(){super(),this.transform.scene3D=this,this.skyObject=new d.Object3D,this.addChild(this.skyObject),this._isScene3D=!0,this.envMap||=_.res.defaultSky}get envMap(){return this._envMap}set envMap(e){this._envMap!=e&&(this.envMapChange=!0),this._envMap=e,K.instance.sky&&"map"in K.instance.sky&&(K.instance.sky.map=e)}get exposure(){return K.instance.sky&&"exposure"in K.instance.sky?K.instance.sky.exposure:0}set exposure(e){K.instance.sky&&"exposure"in K.instance.sky&&(K.instance.sky.exposure=e,_.setting.sky.skyExposure=e)}get roughness(){if(K.instance.sky&&"roughness"in K.instance.sky)return K.instance.sky.roughness}set roughness(e){K.instance.sky&&"roughness"in K.instance.sky&&(K.instance.sky.roughness=e)}}class qd{_computeShader;_outBuffer;constructor(){}init(){let e=_e.getGBufferFrame(_e.colorPass_GBuffer);this._computeShader=new ye(qf),this._outBuffer=new ei(32),this._computeShader.setStorageBuffer("outBuffer",this._outBuffer),this._computeShader.setSamplerTexture("gBufferTexture",e.getCompressGBufferTexture())}compute(e){let t=ve.getCameraGroup(e.camera);this._computeShader.setStorageBuffer("globalUniform",t.uniformGPUBuffer);let a=F.beginCommandEncoder();F.computeCommand(a,[this._computeShader]),F.endCommandEncoder(a),this._outBuffer.readBuffer()}getPickMeshID(){var e=this._outBuffer.outFloat32Array[0]+.1;return Math.floor(e)}getPickWorldPosition(e){e||=new b;var t=this._outBuffer.outFloat32Array[4],a=this._outBuffer.outFloat32Array[5],r=this._outBuffer.outFloat32Array[6];return e.set(t,a,r),e}getPickWorldNormal(e){e||=new b;var t=this._outBuffer.outFloat32Array[8],a=this._outBuffer.outFloat32Array[9],r=this._outBuffer.outFloat32Array[10];return e.set(t*2-1,a*2-1,r*2-1).normalize(),e}getPickScreenUV(e){e||=new de;var t=this._outBuffer.outFloat32Array[2],a=this._outBuffer.outFloat32Array[3];return e.set(t,a),e}}class $d extends Ja{ray;isTouching=!1;_mouseCode;_pickEvent;_outEvent;_overEvent;_upEvent;_downEvent;_mouseMove;_pickCompute;_lastDownTarget;mouseEnableMap;_view;constructor(e){super(),this._view=e,this.init()}init(){this.ray=new na,this.mouseEnableMap=new Map,this._pickEvent=new j(j.PICK_CLICK),this._outEvent=new j(j.PICK_OUT),this._overEvent=new j(j.PICK_OVER),this._mouseMove=new j(j.PICK_MOVE),this._upEvent=new j(j.PICK_UP),this._downEvent=new j(j.PICK_DOWN)}start(){_.setting.pick.enable&&(_.inputSystem.addEventListener(j.POINTER_DOWN,this.onTouchStart,this),_.inputSystem.addEventListener(j.POINTER_UP,this.onTouchEnd,this),_.inputSystem.addEventListener(j.POINTER_CLICK,this.onTouchOnce,this),_.inputSystem.addEventListener(j.POINTER_RIGHT_CLICK,this.onTouchOnce,this),_.inputSystem.addEventListener(j.POINTER_MOVE,this.onTouchMove,this)),_.setting.pick.mode=="pixel"&&(this._pickCompute=new qd,this._pickCompute.init())}stop(){_.inputSystem.removeEventListener(j.POINTER_DOWN,this.onTouchStart,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.onTouchEnd,this),_.inputSystem.removeEventListener(j.POINTER_CLICK,this.onTouchOnce,this),_.inputSystem.removeEventListener(j.POINTER_RIGHT_CLICK,this.onTouchOnce,this),_.inputSystem.removeEventListener(j.POINTER_MOVE,this.onTouchMove,this)}onTouchStart(e){this.isTouching=!0,this._mouseCode=e.mouseCode,this.pick(this._view.camera);let t=this.findNearestObj(this._interestList,this._view.camera);this._lastDownTarget=t,t&&(Object.assign(this._downEvent,e),this._downEvent.type=j.PICK_DOWN,this._downEvent.target=t.object3D,this._downEvent.data=this.getPickInfo(),this.dispatchEvent(this._downEvent),t.object3D.containEventListener(j.PICK_DOWN)&&t.object3D.dispatchEvent(this._downEvent))}onTouchEnd(e){this.isTouching=!1,this._mouseCode=e.mouseCode,this.pick(this._view.camera);let t=this.findNearestObj(this._interestList,this._view.camera);t&&(Object.assign(this._upEvent,e),this._upEvent.type=j.PICK_UP,this._upEvent.target=t.object3D,this._upEvent.data=this.getPickInfo(),this.dispatchEvent(this._upEvent),t.object3D.containEventListener(j.PICK_UP)&&t.object3D.dispatchEvent(this._upEvent))}_lastFocus;getPickInfo(){if(_.setting.pick.mode=="pixel")return{worldPos:this._pickCompute.getPickWorldPosition(),worldNormal:this._pickCompute.getPickWorldNormal(),screenUv:this._pickCompute.getPickScreenUV(),meshID:this._pickCompute.getPickMeshID()};{let e=this._interestList[0];return{worldPos:e.intersectPoint,worldNormal:e.normal,meshID:e.collider.transform.worldMatrix.index,distance:e.distance}}}onTouchMove(e){this.isTouching=!0,this._mouseCode=e.mouseCode,this.pick(this._view.camera);let t=this.findNearestObj(this._interestList,this._view.camera);t&&(Object.assign(this._mouseMove,e),this._mouseMove.type=j.PICK_MOVE,this._mouseMove.target=t.object3D,this._mouseMove.data=this.getPickInfo(),this.dispatchEvent(this._mouseMove),t.object3D.containEventListener(j.PICK_MOVE)&&t.object3D.dispatchEvent(this._mouseMove)),t!=this._lastFocus&&(this._lastFocus&&this._lastFocus.object3D&&(Object.assign(this._outEvent,e),this._outEvent.type=j.PICK_OUT,this._outEvent.target=this._lastFocus.object3D,this._outEvent.data=this.getPickInfo(),this.dispatchEvent(this._outEvent),this._lastFocus.object3D.containEventListener(j.PICK_OUT)&&this._lastFocus.object3D.dispatchEvent(this._outEvent)),t&&(Object.assign(this._overEvent,e),this._overEvent.type=j.PICK_OVER,this._overEvent.target=t.object3D,this._overEvent.data=this.getPickInfo(),this.dispatchEvent(this._overEvent),t.object3D.containEventListener(j.PICK_OVER)&&t.object3D.dispatchEvent(this._overEvent))),this._lastFocus=t}onTouchOnce(e){this.isTouching=!0,this._mouseCode=e.mouseCode,this.pick(this._view.camera);let t=this.findNearestObj(this._interestList,this._view.camera);if(t){let a=this.getPickInfo();Object.assign(this._pickEvent,e),this._pickEvent.type=j.PICK_CLICK,this._pickEvent.target=t.object3D,this._pickEvent.data=a,this.dispatchEvent(this._pickEvent),t===this._lastDownTarget&&t.object3D.containEventListener(j.PICK_CLICK)&&t.object3D.dispatchEvent(this._pickEvent)}this._lastDownTarget=null}findNearestObj(e,t){return e.sort((a,r)=>a.distance>r.distance?1:-1),e[0]?.collider}_interestList=[];pick(e){if(this._interestList.length=0,_.setting.pick.mode=="pixel"){this._pickCompute.compute(this._view);let t=this._pickCompute.getPickMeshID(),a=this.mouseEnableMap.get(t);if(a){let r=this._pickCompute.getPickWorldPosition(),i=b.distance(r,this.ray.origin);this._interestList.push({distance:i,collider:a,intersectPoint:r})}}else if(_.setting.pick.mode=="bound"){this.ray=e.screenPointToRay(_.inputSystem.mouseX,_.inputSystem.mouseY);let t,a=Pe.componentsEnablePickerList.get(this._view);if(a)for(const r of a){let i=r[0];i.enable&&(t=i.rayPick(this.ray),t&&(t.collider=i,this._interestList.push(t)))}}}}class Ag extends rn{_camera;_scene;_viewPort;_enablePick=!1;_enable=!0;pickFire;guiPick;canvasList;constructor(e=0,t=0,a=0,r=0){super(),this.canvasList=[],this._viewPort=new he(e,t,a,r)}get enable(){return this._enable}set enable(e){this._enable=e}get enablePick(){return this._enablePick}set enablePick(e){this._enablePick!=e&&(this.pickFire=new $d(this),this.pickFire.start()),this._enablePick=e}get scene(){return this._scene}set scene(e){this._scene=e,e.view=this,Wt.createBuffer(this),e&&this.canvasList.forEach(t=>{t&&e.addChild(t.object3D)})}get camera(){return this._camera}set camera(e){this._camera=e}get viewPort(){return this._viewPort}set viewPort(e){this._viewPort=e}enableUICanvas(e=0){let t=this.canvasList[e];if(!t){let a=new d.Object3D;a.name="Canvas "+e,t=a.addComponent(Li),t.index=e,this.canvasList[e]=t}return this.scene.addChild(t.object3D),this.guiPick||(this.guiPick=new Od,this.guiPick.init(this)),t}disableUICanvas(e=0){let t=this.canvasList[e];t&&t.object3D&&t.object3D.removeFromParent()}}class Dg{normal;fixNormal;center;rotateShape;distance=0;index;constructor(e){this.index=e,this.rotateShape=[]}}class _g extends Ve{vScale;uNegate;sections;build(e,t,a,r=1,i=!0){if(a.length<2)throw new Error("path length is not enough");return this.vScale=r,this.uNegate=i,e=e.slice(),t&&e.push(e[0]),this.sections=this.buildSections(e,a),this.buildGeometry(e,this.sections),this.bounds=new xe(b.ZERO.clone(),new b(100,100,100)),this}buildSections(e,t){let a,r,i,n=[],o=t.length;for(let c=0;c<o;c++){let f=new Dg(c);a=t[c],r=t[c+1],f.center=a.clone(),r==null?(f.normal=i.clone(),f.distance=0):(i=r.subtract(a),f.distance=i.length,f.normal=i.normalize()),n.push(f)}n[0].fixNormal=n[0].normal.clone();for(let c=1;c<o;c++){let f=n[c-1],h=n[c];h.fixNormal=h.normal.add(f.normal).normalize()}let l=new R().identity();for(let c=0;c<o;c++){let f=n[c],h,u;if(c==0)h=b.UP,u=e;else{let g=n[c-1];h=g.fixNormal,u=g.rotateShape}R.fromToRotation(h,f.fixNormal,l);for(let g=0,A=e.length;g<A;g++){let m=l.multiplyPoint3(u[g]);f.rotateShape.push(m)}}return n}buildGeometry(e,t){let a=t.length,r=e.length,i=a*r,n=a-1,o=new Float32Array(i*3),l=new Float32Array(i*3),c=new Float32Array(i*2),f=new Uint32Array(n*(r-1)*6),h=r-1,u=0,g=0,A=[0];for(let p=1;p<r;p++)g+=e[p-1].subtract(e[p]).length,A.push(g);for(let p=0;p<a;p++){let D=t[p];for(let B=0;B<r;B++){let v=(p*r+B)*3,C=D.rotateShape[B].add(D.center);o[v]=C.x,o[v+1]=C.y,o[v+2]=C.z,l[v+1]=1;let y=(p*r+B)*2,x=A[B]/g;c[y]=this.uNegate?1-x:x,c[y+1]=u*this.vScale}u+=D.distance}let m=0;for(let p=0;p<n;p++){let D=p*r;for(let B=0;B<h;B++){let v=B,C=B+1,y=v+r,x=C+r;f[m++]=v+D,f[m++]=C+D,f[m++]=y+D,f[m++]=C+D,f[m++]=x+D,f[m++]=y+D}}return this.setIndices(f),this.setAttribute(G.position,o),this.setAttribute(G.normal,l),this.setAttribute(G.uv,c),this.setAttribute(G.TEXCOORD_1,c),this.addSubGeometry({indexStart:0,indexCount:f.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0}),this.computeNormals(),this}}class eh extends Ve{_instanceBuffer;_instanceData;_instanceCount=0;constructor(){super(),this.initBaseGeometry()}initBaseGeometry(){const e=new Float32Array([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0]),t=new Float32Array([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2]),a=new Uint16Array([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]);this.setIndices(a),this.setAttribute(G.position,e),this.setAttribute(G.uv,t),this.addSubGeometry({indexStart:0,indexCount:a.length,vertexStart:0,vertexCount:e.length/3,firstStart:0,index:0,topology:0})}setPositions(e){const t=e instanceof Float32Array?e:new Float32Array(e),r=t.length/3-1;if(r<=0)return console.warn("FatLineGeometry: Need at least 2 points"),this;const i=new Float32Array(r*16);for(let n=0;n<r;n++){const o=n*3,l=(n+1)*3;i[n*16+0]=t[o+0],i[n*16+1]=t[o+1],i[n*16+2]=t[o+2],i[n*16+3]=0,i[n*16+4]=t[l+0],i[n*16+5]=t[l+1],i[n*16+6]=t[l+2],i[n*16+7]=0,i[n*16+8]=1,i[n*16+9]=1,i[n*16+10]=1,i[n*16+11]=0,i[n*16+12]=1,i[n*16+13]=1,i[n*16+14]=1,i[n*16+15]=0}return this._instanceData=i,this._instanceCount=r,this.computeBoundingBox(t),this}setColors(e){const t=e instanceof Float32Array?e:new Float32Array(e);if(!this._instanceData)return console.warn("FatLineGeometry: Must call setPositions() before setColors()"),this;const r=t.length/3-1;if(r!==this._instanceCount)return console.warn("FatLineGeometry: Color array length doesn't match segment count"),this;for(let i=0;i<r;i++){const n=i*3,o=(i+1)*3;this._instanceData[i*16+8]=t[n+0],this._instanceData[i*16+9]=t[n+1],this._instanceData[i*16+10]=t[n+2],this._instanceData[i*16+12]=t[o+0],this._instanceData[i*16+13]=t[o+1],this._instanceData[i*16+14]=t[o+2]}return this}computeBoundingBox(e){const t=new b(1/0,1/0,1/0),a=new b(-1/0,-1/0,-1/0);for(let i=0;i<e.length;i+=3){const n=e[i],o=e[i+1],l=e[i+2];t.x=Math.min(t.x,n),t.y=Math.min(t.y,o),t.z=Math.min(t.z,l),a.x=Math.max(a.x,n),a.y=Math.max(a.y,o),a.z=Math.max(a.z,l)}const r=b.sub(a,t);this.bounds=new xe(b.ZERO.clone(),r),this.bounds.setFromMinMax(t,a)}get instanceData(){return this._instanceData}get instanceCount(){return this._instanceCount}get instanceBuffer(){return!this._instanceBuffer&&this._instanceData&&(this._instanceBuffer=new Te(this._instanceData.byteLength),this._instanceBuffer.setFloat32Array("",this._instanceData),this._instanceBuffer.apply()),this._instanceBuffer}updateInstanceBuffer(){this._instanceBuffer&&this._instanceData&&(this._instanceBuffer.setFloat32Array("",this._instanceData),this._instanceBuffer.apply())}}class Bg{name;offset;size;arrayStride;stepMode;attributes}class vg{name;format;offset;shaderLocation;stride}var th=(s=>(s[s.position=3]="position",s[s.normal=3]="normal",s[s.TANGENT=4]="TANGENT",s[s.uv=2]="uv",s[s.TEXCOORD_1=2]="TEXCOORD_1",s[s.color=4]="color",s[s.joints0=4]="joints0",s[s.weights0=4]="weights0",s[s.joints1=4]="joints1",s[s.weights1=4]="weights1",s[s.vIndex=1]="vIndex",s[s.weight=1]="weight",s[s.a_morphPositions_0=3]="a_morphPositions_0",s))(th||{});class Ug{get data(){return null}entity}class ah{min=0;max=0;set(e,t){return this.max=t,this.min=e,this}copy(e){return this.max=e.max,this.min=e.min,this}isInterestRange(e){return!(this.max>e.min||e.max<this.min)}}class rh{_spaceDesc;getRange(e){return this._spaceDesc[e]}initSpace(e){this._spaceDesc={};for(let t of e)(this._spaceDesc[t]=new ah).set(-Number.MAX_VALUE,Number.MAX_VALUE);return this}isContain(e,t){let a=this._spaceDesc[e];return t>=a.min&&t<a.max}isInterestRange(e,t){let a=this._spaceDesc[e];return a?t.isInterestRange(a):!1}splitSpace(e,t,a){let r=this._spaceDesc[e];return t?r.max=a:r.min=a,this}copySpace(e){for(let t in e._spaceDesc){let a=e._spaceDesc[t];this._spaceDesc[t].copy(a)}return this}}class ji{static MaxEntityCountInLeaf=4;static MaxLayer=10;static ClearLeafLayer=ji.MaxLayer-4}class Zi{static UUID=0;uuid="0";constructor(){this.uuid=(Zi.UUID++).toString()}}class yg{map={};_count=0;get count(){return this._count}push(e){return this.map[e.uuid]?!1:(this.map[e.uuid]=e,this._count++,!0)}remove(e){return this.map[e]?(delete this.map[e],this._count--,!0):!1}}class Dr extends Zi{_dimensionIndex=0;_dimensions;_dimension;_left;_right;_space;_parent;_entities;layer;get dimension(){return this._dimension}constructor(e=0){super(),this.layer=e,Dr.nodeCount++}initNode(e,t,a){return this._dimensions=t,this._dimensionIndex=a,this._dimension=t[a],this._space=new rh().initSpace(t),e&&this._space.copySpace(e._space),this._parent=e,this._entities=new yg,this}updateEntity(e){if(e.isInNode(this,this._dimension)&&(e.attachTreeNode(this),this.autoSplit(),this._left&&this._right)){let t=(this._dimensionIndex+1)%this._dimensions.length,a=this._dimensions[t];e.isInNode(this._right,a)?this._right.updateEntity(e):e.isInNode(this._left,a)&&this._left.updateEntity(e)}}buildRoot(e){for(const t of e)t.entity.attachTreeNode(this);this.autoSplit()}_splitEntityList=[];autoSplit(){if(this._entities.count>ji.MaxEntityCountInLeaf&&!this._right&&!this._left&&this.layer<ji.MaxLayer){let e=this._splitEntityList,t=(this._dimensionIndex+1)%this._dimensions.length,a=this._dimensions[t],r=0;for(const i in this._entities.map){let n=this._entities.map[i];r+=n.centerValue(a),e.push(n)}r/=this._entities.count,this._left=new Dr(this.layer+1),this._right=new Dr(this.layer+1),this._left.initNode(this,this._dimensions,t),this._right.initNode(this,this._dimensions,t),this._left.setSpace(!0,r),this._right.setSpace(!1,r);for(let i of e)i.isInNode(this._right,a)?i.attachTreeNode(this._right):i.isInNode(this._left,a)&&i.attachTreeNode(this._left)}this._left&&this._left.autoSplit(),this._right&&this._right.autoSplit()}setSpace(e,t){return this._parent&&this._space.splitSpace(this._dimension,e,t),this}isEmpty(){return this._left==null&&this._right==null&&this._entities.count==0}pushEntity(e){return this._entities.push(e)}removeEntity(e){return this._entities.remove(e.uuid)}static nodeCount=0;autoClear(){let e=this;for(;e&&e.layer>ji.ClearLeafLayer&&e.clearLeaf();)e=e._parent}clearLeaf(){let e=!this._left&&!this._right,t=!e&&this._left.isEmpty()&&this._right.isEmpty();return t&&(this._left=this._right=null,Dr.nodeCount-=2),e||t}isContain(e){return this._space.isContain(this._dimension,e)}static rangeBox=new xe(new b(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),new b(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE));nodeIntersectsBox(e){let t=this._space.getRange("x"),a=this._space.getRange("y"),r=this._space.getRange("z"),i=Dr.rangeBox;return i.min.set(t.min,a.min,r.min),i.max.set(t.max,a.max,r.max),i.intersectsBox(e)}nodeIntersectsRay(e){let t=this._space.getRange("x"),a=this._space.getRange("y"),r=this._space.getRange("z"),i=Dr.rangeBox;return i.min.set(t.min,a.min,r.min),i.max.set(t.max,a.max,r.max),!0}pointCast(e,t=0,a){if(a=a||[],this._entities.count>0){let r=this._entities.map;for(let i in r){let n=r[i],o=n.entityContainPoint(e);!o&&t>0&&(o=n.squareDistanceTo(e,this._dimensions)<=t),o&&a.push(n)}}this._left&&this._left.isContain(e[this._left.dimension])&&this._left.pointCast(e,t,a),this._right&&this._right.isContain(e[this._right.dimension])&&this._right.pointCast(e,t,a)}boxCast(e,t){if(t=t||[],this._entities.count>0){let a=this._entities.map;for(let r in a){let i=a[r];i.entityIntersectsBox(e)&&t.push(i)}}this._left&&this._left.nodeIntersectsBox(e)&&this._left.boxCast(e,t),this._right&&this._right.nodeIntersectsBox(e)&&this._right.boxCast(e,t)}pointIntersect=new b;rayCast(e,t,a){t=t||[],a=a||[];let r=this.pointIntersect;if(this._entities.count>0){let i=this._entities.map;for(let n in i){let o=i[n];o.entityIntersectsRay(e,r)&&(a.push(new b().copyFrom(r)),t.push(o))}}this._left&&this._left.nodeIntersectsRay(e)&&this._left.rayCast(e,t,a),this._right&&this._right.nodeIntersectsRay(e)&&this._right.rayCast(e,t,a)}}class Cg extends Zi{userData;node;constructor(e){super(),this.userData=e}centerValue(e){return 0}isInNode(e,t){return!1}entityContainPoint(e){return!1}squareDistanceTo(e,t){return Number.MAX_VALUE}entityIntersectsBox(e){return!1}entityIntersectsRay(e,t){return!1}attachTreeNode(e){return this.node&&this.detachTreeNode(),this.node=e,this.node.pushEntity(this)}detachTreeNode(){let e=this.node.removeEntity(this);return this.node=null,e}updateNode(e){let t=this.node;t&&this.detachTreeNode(),e.updateEntity(this),t&&t.autoClear()}}class Qt{minPosX=0;minPosY=0;maxPosX=0;maxPosY=0;testID=0;points;offsetPosition;static TINY=1e-6;constructor(){this.points=new Array,this.offsetPosition=new b(0,0,0,0),this.clear()}setAABox(e,t,a,r){this.minPosX=e-a/2-Qt.TINY,this.maxPosX=e+a/2+Qt.TINY,this.minPosY=t-r/2-Qt.TINY,this.maxPosY=t+r/2+Qt.TINY,this.offsetPosition.setTo(0,0,0)}setOffset(e){this.maxPosX+=e.x-this.offsetPosition.x,this.minPosX+=e.x-this.offsetPosition.x,this.minPosY+=e.z-this.offsetPosition.z,this.maxPosY+=e.z-this.offsetPosition.z,this.offsetPosition.copyFrom(e)}setContainRect(e,t,a,r){this.minPosX>e&&(this.minPosX=e),this.minPosY>t&&(this.minPosY=t),this.maxPosX<a&&(this.maxPosX=a),this.maxPosY<r&&(this.maxPosY=r)}clear(){var e=1e9;this.minPosX=this.minPosY=e,this.maxPosX=this.maxPosY=-e,this.points.length=0,this.testID=0,this.offsetPosition.setTo(0,0,0)}addPoint(e){this.points.indexOf(e)==-1&&(e.x<this.minPosX&&(this.minPosX=e.x-Qt.TINY),e.x>this.maxPosX&&(this.maxPosX=e.x+Qt.TINY),e.z<this.minPosY&&(this.minPosY=e.z-Qt.TINY),e.z>this.maxPosY&&(this.maxPosY=e.z+Qt.TINY),this.points.push(e))}clone(){var e=new Qt;return e.minPosX=this.minPosX,e.minPosY=this.minPosY,e.maxPosX=this.maxPosX,e.maxPosY=this.maxPosY,e}get radius(){return Math.sqrt((this.maxPosY-this.minPosY)*(this.maxPosY-this.minPosY)+(this.maxPosX-this.minPosX)*(this.maxPosX-this.minPosX))}get sideX(){return this.maxPosX-this.minPosX}get sideY(){return this.maxPosY-this.minPosY}get centreX(){return(this.maxPosX-this.minPosX)*.5+this.minPosX}get centreY(){return(this.maxPosY-this.minPosY)*.5+this.minPosY}overlapTest(e){return!(this.minPosY>=e.maxPosY||this.maxPosY<=e.minPosY||this.minPosX>=e.maxPosX||this.maxPosX<=e.minPosX)}isPointInside(e){return e.x>=this.minPosX&&e.x<=this.maxPosX&&e.z>=this.minPosY&&e.z<=this.maxPosY}isIntersectLineSegment(e,t,a,r){var i=!1,n=t-r,o=a-e,l=e*r-a*t,c=(-l-n*this.minPosX)/o;c<=this.maxPosY&&c>=this.minPosY&&(i=!0),c=(-l-n*this.maxPosX)/o,c<=this.maxPosY&&c>=this.minPosY&&(i=!0);var f=(-l-o*this.minPosY)/n;return f<=this.maxPosX&&f>=this.minPosX&&(i=!0),f=(-l-o*this.maxPosY)/n,f<=this.maxPosX&&f>=this.minPosX&&(i=!0),i}}class _r{static NUM_CHILDREN=4;childCellIndices;nodeIndices;aabb;points;constructor(e){this.childCellIndices=new Array,this.childCellIndices.length=_r.NUM_CHILDREN,this.nodeIndices=new Array,this.clear(),e?this.aabb=e.clone():this.aabb=new Qt}isLeaf(){return this.childCellIndices[0]==-1}clear(){for(var e=0;e<_r.NUM_CHILDREN;e++)this.childCellIndices[e]=-1;this.nodeIndices.splice(0,this.nodeIndices.length)}}class ih{_cells;_rootCell;_quadNodes;_aabb;_cellsToTest;_testID;constructor(){this._testID=0,this._cells=new Array,this._quadNodes=new Array,this._cellsToTest=new Array,this._aabb=new Qt}getQuadNode(e){return this._quadNodes[e]}clear(){this._cells.length=0,this._quadNodes.length=0}initNodes(e){this.clear();for(var t=0,a=e.length;t<a;)e[t].calcGlobalQuadAABB(),this._quadNodes.push(e[t]),t++}buildQuadTree(e,t){this._aabb.clear();for(var a of this._quadNodes)if(a.isTriangle)for(var r of a.aabb.points)this._aabb.addPoint(r);else this._aabb.setContainRect(a.aabb.minPosX,a.aabb.minPosY,a.aabb.maxPosX,a.aabb.maxPosY);this._cells.length=0,this._rootCell=new _r(this._aabb),this._cells.push(this._rootCell);for(var i=this._quadNodes.length,n=0;n<i;n++)this._cells[0].nodeIndices[n]=n;var o=new Array;o.push(0);for(var l,c,f;o.length!=0;)if(c=o.pop(),!(this._cells[c].nodeIndices.length<=e||this._cells[c].aabb.radius<t)){for(n=0;n<_r.NUM_CHILDREN;n++){this._cells[c].childCellIndices[n]=this._cells.length,o.push(this._cells.length),this._cells.push(new _r(this.createAABox(this._cells[c].aabb,n))),f=this._cells[this._cells.length-1],i=this._cells[c].nodeIndices.length;for(var h=0;h<i;h++)l=this._cells[c].nodeIndices[h],this.doesNodeIntersectCell(this._quadNodes[l],f)&&f.nodeIndices.push(l)}this._cells[c].nodeIndices.length=0}}createAABox(e,t){var a=e.centreX,r=e.centreY,i=e.sideX,n=e.sideY,o=new Qt;switch(t){case 0:o.setAABox(a+i/4,r+n/4,i/2,n/2);break;case 1:o.setAABox(a-i/4,r+n/4,i/2,n/2);break;case 2:o.setAABox(a-i/4,r-n/4,i/2,n/2);break;case 3:o.setAABox(a+i/4,r-n/4,i/2,n/2);break;default:o.setAABox(a+i/4,r-n/4,i/2,n/2);break}return o}doesNodeIntersectCell(e,t){var a=e.aabb;if(!a.overlapTest(t.aabb))return!1;if(!e.isTriangle)return!0;var r=a.points,i=r[0],n=r[1],o=r[2];if(t.aabb.isPointInside(i)||t.aabb.isPointInside(n)||t.aabb.isPointInside(o))return!0;var l=this.pointInTriangle(t.aabb.minPosX,t.aabb.minPosY,i,n,o)||this.pointInTriangle(t.aabb.minPosX,t.aabb.maxPosY,i,n,o)||this.pointInTriangle(t.aabb.maxPosX,t.aabb.maxPosY,i,n,o)||this.pointInTriangle(t.aabb.maxPosX,t.aabb.minPosY,i,n,o);return l?!0:(l=t.aabb.isIntersectLineSegment(i.x,i.z,n.x,n.z)||t.aabb.isIntersectLineSegment(i.x,i.z,o.x,o.z)||t.aabb.isIntersectLineSegment(n.x,n.z,o.x,o.z),l)}getNodesIntersectingtAABox(e,t){if(this._cells.length==0)return 0;this._cellsToTest.length=0,this._cellsToTest.push(0),this.incrementTestCounter();for(var a,r,i,n,o=0;this._cellsToTest.length!=0;)if(a=this._cellsToTest.pop(),i=this._cells[a],!!t.overlapTest(i.aabb))if(i.isLeaf())for(r=i.nodeIndices.length,o=0;o<r;o++)n=this.getQuadNode(i.nodeIndices[o]).aabb,n.testID!=this._testID&&(n.testID=this._testID,t.overlapTest(n)&&e.push(i.nodeIndices[o]));else for(o=0;o<_r.NUM_CHILDREN;o++)this._cellsToTest.push(i.childCellIndices[o]);return e.length}pointInTriangle(e,t,a,r,i){var n=a,o=r,l=i,c=n.z-o.z,f=o.x-n.x,h=n.x*o.z-o.x*n.z,u=o.z-l.z,g=l.x-o.x,A=o.x*l.z-l.x*o.z,m=l.z-n.z,p=n.x-l.x,D=l.x*n.z-n.x*l.z,B=!1,v=c*e+f*t+h,C=u*e+g*t+A,y=m*e+p*t+D;const x=.01;return(v>=-x&&C>=-x&&y>=-x||v<=x&&C<=x&&y<=x)&&(B=!0),B}incrementTestCounter(){if(++this._testID,this._testID==0){for(var e=this._quadNodes.length,t=0;t<e;t++)this._quadNodes[t].aabb.testID=0;this._testID=1}}logDeep=0;logTree(e){if(!(e<0)){this.logDeep++;for(var t=this._cells[e],a="",r=0;r<this.logDeep-1;r++)a+="-|";console.log(a+"i="+e+" "+t.aabb.minPosX.toFixed(2)+" "+t.aabb.maxPosX.toFixed(2)+" "+t.aabb.minPosY.toFixed(2)+" "+t.aabb.maxPosY.toFixed(2));var i;for(i=0;i<t.nodeIndices.length;i++)if(t.nodeIndices[i]>=0){var n=this._quadNodes[t.nodeIndices[i]];console.log(a+" t="+t.nodeIndices[i]+" "+n.aabb.minPosX.toFixed(2)+" "+n.aabb.maxPosX.toFixed(2)+" "+n.aabb.minPosY.toFixed(2)+" "+n.aabb.maxPosY.toFixed(2))}for(i=0;i<t.childCellIndices.length;i++)t.childCellIndices[i]>=0&&this.logTree(t.childCellIndices[i]);this.logDeep--}}}class nh{_maxNodesPerCell;_minCellSize;_quadTree;_collisionNodesIdx;_segBox;_collisionNodes;constructor(e=10,t=500){this._maxNodesPerCell=e,this._minCellSize=t,this._segBox=new Qt,this._collisionNodesIdx=new Array,this._collisionNodes=new Array}createQuadTree(e){this._quadTree=new ih,this._quadTree.initNodes(e),this._quadTree.buildQuadTree(this._maxNodesPerCell,this._minCellSize)}getNodesByAABB(e,t,a,r){this._segBox.clear(),this._segBox.maxPosX=a,this._segBox.maxPosY=r,this._segBox.minPosX=e,this._segBox.minPosY=t,this._collisionNodesIdx.length=0,this._collisionNodes.length=0,this._quadTree.getNodesIntersectingtAABox(this._collisionNodesIdx,this._segBox);for(var i,n=0;n<this._collisionNodesIdx.length;n++)i=this._quadTree.getQuadNode(this._collisionNodesIdx[n]),this._collisionNodes.push(i);return this._collisionNodes}getTriangleAtPoint(e,t=5){this._segBox.clear(),this._segBox.setAABox(e.x,e.z,1,1),this._collisionNodesIdx.length=0,this._collisionNodes.length=0,this._quadTree.getNodesIntersectingtAABox(this._collisionNodesIdx,this._segBox);for(var a=4294967295,r=0,i,n,o,l,c=0;c<this._collisionNodesIdx.length;c++)n=this._quadTree.getQuadNode(this._collisionNodesIdx[c]),l=n.aabb,b.pointInsideTriangle(e,l.points[0],l.points[1],l.points[2])&&(o=n,r=Math.abs(o.plane.distance(e)),!(r>t)&&(n==null||r<=a)&&(i=o,a=r));return i}}var Qn=(s=>(s[s.MOUSE_LEFT=0]="MOUSE_LEFT",s[s.MOUSE_MID=1]="MOUSE_MID",s[s.MOUSE_RIGHT=2]="MOUSE_RIGHT",s))(Qn||{});class Sg extends bt{static LOADER_PROGRESS="loaderProgress";static LOADER_COMPLETE="loaderComplete"}class xg extends bt{static ADDED="added";static REMOVED="removed";static CHILD_ADD_EVENT="childAddEvent";static CHILD_REMOVED="childRemoved"}class Fg extends bt{static SHOW="show";static HIDE="hide";static UPDATE="update"}class kg{static merge(e,t,a,r){let i=0,n=0;i=Math.max(e.width,i),i=Math.max(t.width,i),i=Math.max(a.width,i),i=Math.max(r.width,i),n=Math.max(e.height,n),n=Math.max(t.height,n),n=Math.max(a.height,n),n=Math.max(r.height,n);let o=new we(i,n,se.rgba8unorm),l=new ye(Yf);l.setSamplerTexture("textureR",e),l.setSamplerTexture("textureG",t),l.setSamplerTexture("textureB",a),l.setSamplerTexture("textureA",r),l.setStorageTexture("outTex",o),l.workerSizeX=Math.ceil(i/8),l.workerSizeY=Math.ceil(n/8);let c=F.beginCommandEncoder();return F.computeCommand(c,[l]),F.endCommandEncoder(c),o}}class sh{computeShader;setInputes(e,t,a){this.computeShader=new ye(fd(e,t,a,8,8,1));for(let r=0;r<t.length;r++)this.computeShader.setSamplerTexture(`source${r}Map`,t[r]);for(let r=0;r<a.length;r++)this.computeShader.setStorageTexture(`dest${r}Map`,a[r]);e&&this.computeShader.setSamplerTexture("colorMap",e),this.computeShader.workerSizeX=a[0].width/8,this.computeShader.workerSizeY=a[0].height/8,this.computeShader.workerSizeZ=1}}class oh{sourceShader;compute;needUpdate=!0;constructor(e,t){this.sourceShader=t,this.compute=new ye(e),this.init()}init(){}onUpdate(){this.onFrame&&this.onFrame(),this.onOnce&&this.needUpdate&&(this.needUpdate=!1,this.onFrame())}}class lh extends oh{constructor(e){super($f,e)}init(){let e=new we(256,256,se.rgba8unorm,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING);return this.compute.setStorageTexture("sssMap",e),this.sourceShader.setTexture("lutMap",e),e}onFrame(){this.compute.workerSizeX=256/8,this.compute.workerSizeY=256/8;let e=F.beginCommandEncoder();F.computeCommand(e,[this.compute]),F.endCommandEncoder(e)}}class Eg{gpuBuffer;probes;memoryDo;_probeInfoList;initDataUniform(e){this.memoryDo=new sr,this.probes=e,this._probeInfoList=[],this.memoryDo.destroy(),this.memoryDo.allocation(e.length*17*4);for(let a=0;a<e.length;a++){var t=17;let r=this.memoryDo.allocation_node(t*4);this._probeInfoList.push(r);let i=e[a].transform.worldPosition;r.setArray(0,[i.x,i.y,i.z])}this.gpuBuffer=w.device.createBuffer({size:this.memoryDo.shareDataBuffer.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.STORAGE,label:"ProbeBuffer",mappedAtCreation:!1})}updateGPUBuffer(){const e=this.memoryDo.shareDataBuffer;let t=this.memoryDo.shareDataBuffer.byteLength,a=0;const r=5e3*64;for(;a<t;)w.device.queue.writeBuffer(this.gpuBuffer,a,e,a,Math.floor(Math.min(r,t-a))),a+=r}}class wg extends ja{constructor(e,t,a=0){super(),this.bufferType=ga.StructStorageGPUBuffer,this.createBufferByStruct(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|a,e,t)}}class Rg{static codeMax=`
|
|
11789
|
+
`||S==" "?x=null:(v(S,x),x.width+g>=A&&(x=B()))}})(),C()}getAlignment(e){let t={v:0,h:0};switch(e){case 1:t.v=0,t.h=1;break;case 0:t.v=0,t.h=0;break;case 2:t.v=0,t.h=2;break;case 4:t.v=1,t.h=1;break;case 3:t.v=1,t.h=0;break;case 5:t.v=1,t.h=2;break;case 7:t.v=2,t.h=1;break;case 6:t.v=2,t.h=0;break;case 8:t.v=2,t.h=2;break}return t}}class Rn extends mo{_style=tt.NORMAL;_interactive=!1;set interactive(e){this._interactive=e}get interactive(){return this._interactive}set mouseStyle(e){this._style=e}get interactiveVisible(){return this._uiTransform.globalVisible&&this._visible}init(e){super.init(e),this._uiTransform.addUIInteractive(this)}destroy(){this._uiTransform.removeUIInteractive(this),super.destroy()}rayPick(e,t,a,r){return zd.rayPick(e,a,r,t.space,t.panelRatio,this._uiTransform,t.transform.worldMatrix)}cloneTo(e){e.getOrAddComponent(Rn).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.enable=e._enable,this.interactive=e._interactive,this.mouseStyle=e._style,this}}var Xd=(s=>(s[s.NONE=0]="NONE",s[s.COLOR=1]="COLOR",s[s.SPRITE=2]="SPRITE",s))(Xd||{});class po extends Rn{_spriteMap;_colorMap;_image;_isCreateImage;_transition=2;init(e){super.init(e),this._interactive=!0,this._spriteMap=new Map,this._colorMap=new Map,this._image=this.object3D.getComponent(Pr),this._isCreateImage=this._image==null,this._image||(this._image=this.object3D.addComponent(Pr)),this.imageType=ni.Sliced}onEnable(){this.mouseStyle=tt.NORMAL}onDisable(){this.mouseStyle=tt.DISABLE}set transition(e){this._transition!=e&&(this._transition=e,this.validateStyle(this._style,!0))}get transition(){return this._transition}get imageType(){return this._image.imageType}set imageType(e){this._image.imageType=e}setStyleColor(e,t){return this._colorMap.set(e,t),this._style==e&&this.validateStyle(this._style,!0),this}getStyleColor(e){return this._colorMap.get(e)}set mouseStyle(e){super.mouseStyle=e,this.validateStyle(e,!0)}get normalSprite(){return this._spriteMap.get(tt.NORMAL)}set normalSprite(e){this._spriteMap.set(tt.NORMAL,e),this._style==tt.NORMAL&&this.validateStyle(this._style,!0)}get overSprite(){return this._spriteMap.get(tt.OVER)}set overSprite(e){this._spriteMap.set(tt.OVER,e),this._style==tt.OVER&&this.validateStyle(this._style,!0)}set downSprite(e){this._spriteMap.set(tt.DOWN,e),this._style==tt.DOWN&&this.validateStyle(this._style,!0)}get downSprite(){return this._spriteMap.get(tt.DOWN)}set disableSprite(e){this._spriteMap.set(tt.DISABLE,e),this._style==tt.DISABLE&&this.validateStyle(this._style,!0)}get disableSprite(){return this._spriteMap.get(tt.DISABLE)}validateStyle(e,t){if(this._transition&2){let a=this._spriteMap.get(e);this._image.sprite=a}if(this._transition&1){let a=this._colorMap.get(e);a&&(this._image.color=a)}}cloneTo(e){e.getOrAddComponent(po).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this.imageType=e.imageType,this.transition=e.transition,e._spriteMap.forEach((t,a)=>{t&&this._spriteMap.set(a,t)}),e._colorMap.forEach((t,a)=>{t&&this._colorMap.set(a,t.clone())}),this.mouseStyle=e.mouseStyle,this}destroy(){this._isCreateImage&&this._image&&(this.object3D.removeComponent(Pr),this._image=null),super.destroy()}}class Ao extends zi{_count=0;constructor(){super()}init(e){super.init?.(e),this._count=e?e.count:1;for(let t=0;t<this._count;t++)this.attachQuad(Na.spawnQuad());this._uiTransform.resize(0,0)}getQuad(e){return this._mainQuads[e]}cloneTo(e){e.addComponent(Ao,{count:this._count}).copyComponent(this)}copyComponent(e){super.copyComponent(e);for(let t=0;t<e._count;t++)this.setSprite(t,e.getSprite(t)),this.setColor(t,e.getColor(t)),this.setImageType(t,e.getImageType(t));return this}setSprite(e,t){this._mainQuads[e].sprite=t||_.res.defaultGUISprite,this.setShadowDirty()}getSprite(e){return this._mainQuads[e].sprite}onUIComponentVisible(e){this.applyComponentVisible()}onUITransformVisible(e){this.applyComponentVisible()}applyComponentVisible(){let e=!this._visible||!this._uiTransform.globalVisible;for(let t of this._mainQuads)t.visible=!e;this.setShadowDirty()}getColor(e){return this._mainQuads[e].color}setColor(e,t){this._mainQuads[e].color=t,this.setShadowDirty()}getImageType(e){return this._mainQuads[e].imageType}setImageType(e,t){this._mainQuads[e].imageType=t,this.setShadowDirty()}setSize(e,t,a){this._mainQuads[e].setSize(t,a),this.setShadowDirty()}setXY(e,t,a){this._mainQuads[e].setXY(t,a),this.setShadowDirty()}getXY(e,t){t||=new de;let a=this._mainQuads[e];return t.x=a.x,t.y=a.y,t}}class Do extends zi{_shadowQuality=1;_shadowOffset;_shadowRadius;_shadowColor;_subShadowColor;needUpdateShadow=!1;init(e){super.init?.(e),this._shadowRadius=2,this._shadowQuality=1,this._shadowOffset=new de(4,-4),this._shadowColor=new J(.1,.1,.1,.8),this._subShadowColor=this._shadowColor.clone(),this.isUIShadow=!0}cloneTo(e){e.getOrAddComponent(Do).copyComponent(this)}copyComponent(e){return super.copyComponent(this),this._shadowColor=e._shadowColor,this._shadowOffset=e._shadowOffset,this._shadowRadius=e._shadowRadius,this._shadowQuality=e.shadowQuality,this}get shadowColor(){return this._shadowColor}set shadowColor(e){this._shadowColor.copyFrom(e),this.needUpdateShadow=!0}set shadowQuality(e){e=Ae(e,0,4),this._shadowQuality!=e&&(this._shadowQuality=e,this.needUpdateShadow=!0)}get shadowQuality(){return this._shadowQuality}set shadowOffset(e){this._shadowOffset=e,this.needUpdateShadow=!0}get shadowOffset(){return this._shadowOffset||=new de(4,-4),this._shadowOffset}set shadowRadius(e){this._shadowRadius!=e&&(this._shadowRadius=e,this.applyShadow())}get shadowRadius(){return this._shadowRadius}onUpdate(e){this.needUpdateShadow&&(this.applyShadow(),this.needUpdateShadow=!1)}applyShadow(){if(this.detachQuads(),this._shadowSource&&this._shadowQuality>0){let e=this._shadowSource.mainQuads;if(e.length>0)for(let t of e)this.createQuadShadow(t)}this._uiTransform.setNeedUpdateUIPanel()}createQuadShadow(e){let t=this._shadowQuality,a=Math.PI*2;this._subShadowColor.copyFrom(this._shadowColor),this._subShadowColor.a=1/Math.max(1,t);for(let r=0;r<t;r++){let i=Na.spawnQuad(),n=0,o=0;if(r==0)i.color=this._shadowColor;else{let l=a*(r-1)/(t-1);n=Math.sin(l)*this._shadowRadius,o=Math.cos(l)*this._shadowRadius,i.color=this._subShadowColor}i.setXY(n+this._shadowOffset.x+e.x,o+this._shadowOffset.y+e.y),i.setSize(e.width,e.height),i.sprite=e.sprite,i.visible=e.visible,i.imageType=e.imageType,this.attachQuad(i)}}}class _o extends zi{_font="\u5FAE\u8F6F\u96C5\u9ED1";_fontSize=14;_originSize=42;_alignment=0;_lineSpacing=1;_text="";_color=new J(1,1,1,1);constructor(){super()}cloneTo(e){e.getOrAddComponent(_o).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this._font=e._font,this._fontSize=e._fontSize,this._originSize=e._originSize,this._alignment=e._alignment,this._lineSpacing=e._lineSpacing,this._color.copyFrom(e._color),this.text=e.text,this}get originSize(){return this._originSize}get font(){return this._font}set font(e){this._font=e}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!=e&&(this._fontSize=e,this.layoutText())}get text(){return this._text}set text(e){this._text!=e&&(e||(e=""),this._text=e,this.layoutText())}textLine=null;layoutProxy=new Yd;layoutText(){this.detachQuads(),this.textLine=this.layoutProxy.layout(this);for(let e=0,t=this.textLine.length;e<t;e++){let a=this.textLine[e];for(let r=0,i=a.quadList.length;r<i;r++){let n=a.quadList[r];n&&this.attachQuad(n)}}this.color=this._color,this._uiTransform.setNeedUpdateUIPanel(),this.onUIComponentVisible(this._visible),this.setShadowDirty()}onUIComponentVisible(e){this.applyComponentVisible()}onUITransformVisible(e){this.applyComponentVisible()}applyComponentVisible(){let e=!this._visible||!this._uiTransform.globalVisible;for(let t of this._mainQuads)t&&(t.visible=!e);this.setShadowDirty()}onTransformResize(){this.layoutText()}get color(){return this._color}set color(e){this._color.copyFrom(e);for(let t of this._mainQuads)t.color=e;this.setShadowDirty()}get alignment(){return this._alignment}set alignment(e){this._alignment!=e&&(this._alignment=e,this.layoutText())}get lineSpacing(){return this._lineSpacing}set lineSpacing(e){this._lineSpacing!=e&&(this._lineSpacing=e,this.layoutText())}}var ng=Object.getOwnPropertyDescriptor,sg=(s,e,t,a)=>{for(var r=a>1?void 0:a?ng(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.Light=class extends ki{constructor(){super()}init(){super.init(),this.lightData.lightType=ct.PointLight,this.object3D.name==""&&(this.object3D.name="PointLight"+Gt())}get range(){return this.lightData.range}set range(e){this.lightData.range=e,this.onChange()}get at(){return this.lightData.linear}set at(e){this.lightData.linear=e,this.onChange()}get radius(){return this.lightData.radius}set radius(e){this.lightData.radius=e,this.onChange()}get quadratic(){return this.lightData.quadratic}set quadratic(e){this.lightData.quadratic=e,this.onChange()}start(){this.transform.rotationX=90,super.start()}onUpdate(){}onGraphic(e){let t=e.scene.getChildByName("graphic3D");if(!t)return;let a=t.createCustomShape(`PointLight_${this.object3D.instanceID}`,this.transform);a.buildAxis(),a.buildCircle(b.ZERO,this.range,32,b.X_AXIS),a.buildCircle(b.ZERO,this.range,32,b.Y_AXIS),a.buildCircle(b.ZERO,this.range,32,b.Z_AXIS)}debug(){}debugDraw(e){}},d.Light=sg([Lt(d.Light,"Light")],d.Light);var og=Object.getOwnPropertyDescriptor,lg=(s,e,t,a)=>{for(var r=a>1?void 0:a?og(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.FatLineRenderer=class extends Ia{_fatLineMaterial=null;_fatLineGeometry=null;_cachedResolution=new de(0,0);constructor(){super()}onEnable(){super.onEnable()}onDisable(){super.onDisable()}cloneTo(e){e.addComponent(d.FatLineRenderer).copyComponent(this)}copyComponent(e){return super.copyComponent(e),this}set geometry(e){super.geometry=e,this._fatLineGeometry=e,e&&(this.instanceCount=e.instanceCount,this._fatLineMaterial&&e.instanceBuffer&&this._fatLineMaterial.setInstanceBuffer(e.instanceBuffer))}get geometry(){return this._fatLineGeometry}set material(e){this.materials=[e],this._fatLineMaterial=e,this._fatLineGeometry&&this._fatLineGeometry.instanceBuffer&&e.setInstanceBuffer(this._fatLineGeometry.instanceBuffer)}get material(){return this._fatLineMaterial}nodeUpdate(e,t,a,r){if(this._fatLineMaterial&&this.object3D){this._fatLineMaterial.setModelMatrix(this.object3D.transform.worldMatrix);const i=w.presentationSize[0],n=w.presentationSize[1];i>0&&n>0&&(this._cachedResolution.x!==i||this._cachedResolution.y!==n)&&(this._cachedResolution.set(i,n),this._fatLineMaterial.resolution=this._cachedResolution.clone())}super.nodeUpdate(e,t,a,r)}destroy(e){super.destroy(e)}},d.FatLineRenderer=lg([Lt(d.FatLineRenderer,"FatLineRenderer")],d.FatLineRenderer);class Hd extends d.Object3D{index=0;drawCallFrame=-1;constructor(){super()}}var Bo=(s=>(s[s.CastGI=0]="CastGI",s[s.ReceiveGI=1]="ReceiveGI",s[s.CastDepth=2]="CastDepth",s[s.Other=3]="Other",s))(Bo||{});class Kd extends Dt{static count=0;constructor(e=0,t=0){super(),Y.register("GIProbeShader",gd);let a=new gt,r=new Xe("GIProbeShader","GIProbeShader");r.passType=le.COLOR,a.addRenderPass(r),r.setDefine("USE_BRDF",!0),r.setShaderEntry("VertMain","FragMain"),r.setUniformVector4("probeUniform",new he(t,e,0,0));let i=r.shaderState;i.acceptShadow=!1,i.castShadow=!1,i.receiveEnv=!1,i.acceptGI=!1,i.useLight=!1,a.setTexture("baseMap",_.res.whiteTexture),a.setTexture("normalMap",_.res.normalTexture),a.setTexture("emissiveMap",_.res.blackTexture),this.shader=a}}class cg extends qe{_probes;_volume;_debugMr=[];init(e){e||=_.views[0]?.scene,_.setting.gi.enable=!0,this._volume=ve.getLightEntries(e).irradianceVolume,this.initProbe(e)}initProbe(e){let t=this._volume.setting.probeXCount,a=this._volume.setting.probeYCount,r=this._volume.setting.probeZCount,i=new Ir(4,16,16),n=new b;this._probes=[];for(let o=0;o<t;o++)for(let l=0;l<a;l++)for(let c=0;c<r;c++){let f=o+c*t+l*(t*r),h=new Hd;h.index=f,h.name=`${o}_${l}_${c}`;let u=h.addComponent(d.MeshRenderer);u.material=new Kd(Bo.CastGI,f),u.geometry=i,u.castGI=!1,u.castShadow=!1,this._debugMr.push(u),this.object3D.addChild(h),this._volume.calcPosition(o,l,c,n),h.x=n.x,h.y=n.y,h.z=n.z,this._probes[f]=h,this._debugMr.push(u)}for(let o=0;o<this._probes.length;o++)K.instance.addGIProbe(e,this._probes[o]);this.object3D.transform.enable=!1,this._volume.setting.debug&&this.debug()}debug(){}debugProbeRay(e,t){const a=_.setting.gi.rayNumber;let r=new ae(0,-.7071067811865475,.7071067811865475,0);for(let i=0;i<a;i++){let n=e*a+i,o=new b(-t[n*4+0],-t[n*4+1],-t[n*4+2],0);r.transformVector(o,o);let l=t[n*4+3],c=this._probes[e].transform.worldPosition.clone(),f=o.scaleBy(l);f.add(c,f)}}changeProbesVolumeData(){this._volume.setVolumeDataChange()}changeProbesPosition(){this._volume.setVolumeDataChange();let e=this._volume.setting.probeXCount,t=this._volume.setting.probeYCount,a=this._volume.setting.probeZCount,r=new b;for(let i=0;i<e;i++)for(let n=0;n<t;n++)for(let o=0;o<a;o++){let l=i+o*e+n*(e*a),c=this._probes[l];this._volume.calcPosition(i,n,o,r),c.x=r.x,c.y=r.y,c.z=r.z}}onUpdate(){_.setting.gi.maxDistance=_.setting.gi.probeSpace*1.5;let e=this.transform.scene3D.view.camera,t=b.distance(e.transform.worldPosition,e.transform.targetPos)/300;if(this._debugMr&&this._debugMr.length>0)for(let a=0;a<this._debugMr.length;a++){const r=this._debugMr[a].transform;r.scaleX=t,r.scaleY=t,r.scaleZ=t}}}class fg extends Ia{_keyRenderGroup;_keyBufferGroup;_keyIdsGroup;constructor(){super()}init(e){this._keyRenderGroup=new Map,this._keyBufferGroup=new Map,this._keyIdsGroup=new Map}start(){let e=[];this.object3D.getComponents(d.MeshRenderer,e,!0);for(let t=0;t<e.length;t++){const a=e[t];a.transform.updateWorldMatrix(!0),a.enable=!1;let r=a.geometry.instanceID;for(let i=0;i<a.materials.length;i++){const n=a.materials[i];r+=n.instanceID}if(this._keyRenderGroup.has(r))this._keyRenderGroup.get(r).push(a),this._keyIdsGroup.get(r).push(a.transform.worldMatrix.index);else{let i=new Te(e.length);i.visibility=GPUShaderStage.VERTEX,this._keyRenderGroup.set(r,[a]),this._keyBufferGroup.set(r,i),this._keyIdsGroup.set(r,[a.transform.worldMatrix.index])}}this._keyBufferGroup.forEach((t,a)=>{let r=this._keyIdsGroup.get(a),i=this._keyBufferGroup.get(a);i.setInt32Array("matrixIDs",new Int32Array(r)),i.apply()})}reset(){this._keyRenderGroup.size>0&&(this._keyRenderGroup.clear(),this._keyBufferGroup.clear(),this._keyIdsGroup.clear(),this.start())}nodeUpdate(e,t,a,r){this._keyRenderGroup.forEach((i,n)=>{let o=this._keyBufferGroup.get(n),l=i[0];for(let c=0;c<l.materials.length;c++){let h=l.materials[c].getPass(t);if(h)for(let u=0;u<h.length;u++){const g=h[u];g.setDefine("USE_INSTANCEDRAW",!0),g.setStorageBuffer("instanceDrawID",o)}}l.nodeUpdate(e,t,a,r)})}renderPass(e,t,a){this._keyRenderGroup.forEach((r,i)=>{let n=r[0];n.instanceCount=r.length,this.renderItem(e,t,n,a)})}renderItem(e,t,a,r){let i=a.transform._worldMatrix;for(let n=0;n<a.materials.length;n++){let l=a.materials[n].getPass(t);if(!(!l||l.length==0))for(let c=0;c<l.length;c++){let f=l[c];F.bindGeometryBuffer(r.encoder,a.geometry);const h=f;h.shaderState.splitTexture&&(r.endRenderPass(),Et.WriteSplitColorTexture(a.instanceID),r.beginOpaqueRenderPass(),F.bindCamera(r.encoder,e.camera),F.bindGeometryBuffer(r.encoder,a.geometry)),F.bindPipeline(r.encoder,h);let m=a.geometry.subGeometries[n].lodLevels[a.lodLevel];a.instanceCount>0?F.drawIndexed(r.encoder,m.indexCount,a.instanceCount,m.indexStart,0,0):F.drawIndexed(r.encoder,m.indexCount,1,m.indexStart,0,i.index)}}}beforeDestroy(e){this._keyRenderGroup.clear(),this._keyBufferGroup.clear(),this._keyIdsGroup.clear(),this._keyRenderGroup=this._keyBufferGroup=this._keyIdsGroup=void 0,Pe.removeWaitStart(this.object3D,this)}}var dg=Object.getOwnPropertyDescriptor,hg=(s,e,t,a)=>{for(var r=a>1?void 0:a?dg(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.MeshFilter=class extends d.MeshRenderer{constructor(){super()}get geometry(){return null}set geometry(e){}cloneTo(e){}set meshURL(e){let t=_.res.getGeometry(e);t?this.geometry=t:console.error("no geometry set",e)}},d.MeshFilter=hg([Lt(d.MeshFilter,"MeshFilter")],d.MeshFilter);var ug=Object.getOwnPropertyDescriptor,bg=(s,e,t,a)=>{for(var r=a>1?void 0:a?ug(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.SkinnedMeshRenderer=class extends d.MeshRenderer{skinJointsName;mInverseBindMatrixData;mInverseBindMatrixBuffer;mSkeletonAnimation;mJointIndexTableBuffer;constructor(){super(),this.addRendererMask(Qe.SkinnedMesh)}start(){if(super.start(),this.skeletonAnimation=this.object3D.getComponent(d.SkeletonAnimationComponent),!this.skeletonAnimation){let e=this.object3D.parentObject.parentObject.getComponentsInChild(d.SkeletonAnimationComponent);e.length>0&&(this.skeletonAnimation=e[0]);let t=this.object3D;for(;!this.skeletonAnimation&&t;)this.skeletonAnimation=t.getComponentFromParent(d.SkeletonAnimationComponent),t.parent&&(t=t.parent.object3D)}}onEnable(){super.onEnable()}get skeletonAnimation(){return this.mSkeletonAnimation}set skeletonAnimation(e){if(this.mSkeletonAnimation=e,!!e&&!this.mJointIndexTableBuffer){let t=this.mSkeletonAnimation.getJointIndexTable(this.skinJointsName);this.mJointIndexTableBuffer=new Te(t.length*4,0,new Float32Array(t)),this.mJointIndexTableBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.COMPUTE}}get skinInverseBindMatrices(){return this.mInverseBindMatrixData}set skinInverseBindMatrices(e){this.mInverseBindMatrixData=e;var t=new Float32Array(e.length*16);for(let a=0;a<e.length;a++){let r=a*16,i=e[a];t.set(i,r)}this.mInverseBindMatrixBuffer=new Te(t.byteLength,0,t),this.mInverseBindMatrixBuffer.visibility=GPUShaderStage.VERTEX|GPUShaderStage.COMPUTE}get inverseBindMatrixBuffer(){return this.mInverseBindMatrixBuffer}get jointIndexTableBuffer(){return this.mJointIndexTableBuffer.buffer}cloneTo(e){let t=e.addComponent(d.SkinnedMeshRenderer);t.geometry=this.geometry,t.material=this.material.clone(),t.castShadow=this.castShadow,t.castGI=this.castGI,t.receiveShadow=this.receiveShadow,t.rendererMask=this.rendererMask,t.skinJointsName=this.skinJointsName,t.skinInverseBindMatrices=this.skinInverseBindMatrices,t.mJointIndexTableBuffer=this.mJointIndexTableBuffer}nodeUpdate(e,t,a,r){for(let i=0;i<this.materials.length;i++){let o=this.materials[i].getPass(t);if(o)for(let l=0;l<o.length;l++){const c=o[l];!c.pipeline&&this.mSkeletonAnimation&&(c.setStorageBuffer("jointsMatrixIndexTable",this.mSkeletonAnimation.jointMatrixIndexTableBuffer),c.setStorageBuffer("jointsInverseMatrix",this.mInverseBindMatrixBuffer),c.setStorageBuffer("jointsIndexMapingTable",this.mJointIndexTableBuffer))}}super.nodeUpdate(e,t,a,r)}},d.SkinnedMeshRenderer=bg([Lt(d.SkinnedMeshRenderer,"SkinnedMeshRenderer")],d.SkinnedMeshRenderer);class gg extends ht{radius=2.5;height=10;constructor(){super(),this._shapeType=si.Capsule}}class In extends ht{mesh;static triangle;_pickRet;constructor(){super(),this._shapeType=si.Mesh}rayPick(e,t){if(this.mesh){In.triangle||=new Ji(new b,new b,new b);let a=this.mesh.getAttribute(G.position),r=this.mesh.getAttribute(G.indices),i=ht.helpMatrix;i.copyFrom(t).invert();let n=ht.helpRay.copy(e);if(n.applyMatrix(i),n.intersectBox(this.mesh.bounds),!n.intersectBox(this.mesh.bounds,ht.v3_help_0))return null;if(r&&a&&r.data.length>0){let l=a.data;for(let c=0,f=r.data.length/3;c<f;c++){let h=c*3;const u=r.data[h+0]*3,g=r.data[h+1]*3,A=r.data[h+2]*3;let m=In.triangle,p=m.v1.set(l[u+0],l[u+1],l[u+2]),D=m.v2.set(l[g+0],l[g+1],l[g+2]),B=m.v3.set(l[A+0],l[A+1],l[A+2]);m.set(p,D,B);let v=n.intersectTriangle(n.origin,n.direction,m);if(v){this._pickRet||={intersectPoint:new b,distance:0},this._pickRet.intersectPoint=v,this._pickRet.distance=b.distance(n.origin,v);let C=this.mesh.getAttribute(G.normal);if(C){let y=C.data,x=new b(y[u],y[u+1],y[u+2]);t.transformVector(x,x),x.normalize(),this._pickRet.normal=x}return this._pickRet}}}}return null}}class mg extends ht{_pickRet;box;radius=.5;constructor(e){super(),this._shapeType=si.Sphere,this.radius=e,this.box=new Qr(new b,1)}rayPick(e,t){this.box.setFromCenterAndSize(this.center,this.radius);let r=ht.helpMatrix;r.copyFrom(t).invert();let i=ht.helpRay.copy(e);i.applyMatrix(r);let n=i.intersectSphere(i.origin,i.direction,this.box.center,this.box.radius);return n?(this._pickRet||(this._pickRet={intersect:!1,intersectPoint:new b,distance:0}),this._pickRet.intersect=!0,this._pickRet.intersectPoint=n,this._pickRet.distance=b.distance(i.origin,ht.v3_help_0),this._pickRet):null}}class pg extends d.Object3D{_envMap;skyObject;envMapChange=!0;view;constructor(){super(),this.transform.scene3D=this,this.skyObject=new d.Object3D,this.addChild(this.skyObject),this._isScene3D=!0,this.envMap||=_.res.defaultSky}get envMap(){return this._envMap}set envMap(e){this._envMap!=e&&(this.envMapChange=!0),this._envMap=e,K.instance.sky&&"map"in K.instance.sky&&(K.instance.sky.map=e)}get exposure(){return K.instance.sky&&"exposure"in K.instance.sky?K.instance.sky.exposure:0}set exposure(e){K.instance.sky&&"exposure"in K.instance.sky&&(K.instance.sky.exposure=e,_.setting.sky.skyExposure=e)}get roughness(){if(K.instance.sky&&"roughness"in K.instance.sky)return K.instance.sky.roughness}set roughness(e){K.instance.sky&&"roughness"in K.instance.sky&&(K.instance.sky.roughness=e)}}class qd{_computeShader;_outBuffer;constructor(){}init(){let e=_e.getGBufferFrame(_e.colorPass_GBuffer);this._computeShader=new ye(qf),this._outBuffer=new ei(32),this._computeShader.setStorageBuffer("outBuffer",this._outBuffer),this._computeShader.setSamplerTexture("gBufferTexture",e.getCompressGBufferTexture())}compute(e){let t=ve.getCameraGroup(e.camera);this._computeShader.setStorageBuffer("globalUniform",t.uniformGPUBuffer);let a=F.beginCommandEncoder();F.computeCommand(a,[this._computeShader]),F.endCommandEncoder(a),this._outBuffer.readBuffer()}getPickMeshID(){var e=this._outBuffer.outFloat32Array[0]+.1;return Math.floor(e)}getPickWorldPosition(e){e||=new b;var t=this._outBuffer.outFloat32Array[4],a=this._outBuffer.outFloat32Array[5],r=this._outBuffer.outFloat32Array[6];return e.set(t,a,r),e}getPickWorldNormal(e){e||=new b;var t=this._outBuffer.outFloat32Array[8],a=this._outBuffer.outFloat32Array[9],r=this._outBuffer.outFloat32Array[10];return e.set(t*2-1,a*2-1,r*2-1).normalize(),e}getPickScreenUV(e){e||=new de;var t=this._outBuffer.outFloat32Array[2],a=this._outBuffer.outFloat32Array[3];return e.set(t,a),e}}class $d extends Ja{ray;isTouching=!1;_mouseCode;_pickEvent;_outEvent;_overEvent;_upEvent;_downEvent;_mouseMove;_pickCompute;_lastDownTarget;mouseEnableMap;_view;constructor(e){super(),this._view=e,this.init()}init(){this.ray=new na,this.mouseEnableMap=new Map,this._pickEvent=new j(j.PICK_CLICK),this._outEvent=new j(j.PICK_OUT),this._overEvent=new j(j.PICK_OVER),this._mouseMove=new j(j.PICK_MOVE),this._upEvent=new j(j.PICK_UP),this._downEvent=new j(j.PICK_DOWN)}start(){_.setting.pick.enable&&(_.inputSystem.addEventListener(j.POINTER_DOWN,this.onTouchStart,this),_.inputSystem.addEventListener(j.POINTER_UP,this.onTouchEnd,this),_.inputSystem.addEventListener(j.POINTER_CLICK,this.onTouchOnce,this),_.inputSystem.addEventListener(j.POINTER_RIGHT_CLICK,this.onTouchOnce,this),_.inputSystem.addEventListener(j.POINTER_MOVE,this.onTouchMove,this)),_.setting.pick.mode=="pixel"&&(this._pickCompute=new qd,this._pickCompute.init())}stop(){_.inputSystem.removeEventListener(j.POINTER_DOWN,this.onTouchStart,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.onTouchEnd,this),_.inputSystem.removeEventListener(j.POINTER_CLICK,this.onTouchOnce,this),_.inputSystem.removeEventListener(j.POINTER_RIGHT_CLICK,this.onTouchOnce,this),_.inputSystem.removeEventListener(j.POINTER_MOVE,this.onTouchMove,this)}onTouchStart(e){this.isTouching=!0,this._mouseCode=e.mouseCode,this.pick(this._view.camera);let t=this.findNearestObj(this._interestList,this._view.camera);this._lastDownTarget=t,t&&(Object.assign(this._downEvent,e),this._downEvent.type=j.PICK_DOWN,this._downEvent.target=t.object3D,this._downEvent.data=this.getPickInfo(),this.dispatchEvent(this._downEvent),t.object3D.containEventListener(j.PICK_DOWN)&&t.object3D.dispatchEvent(this._downEvent))}onTouchEnd(e){this.isTouching=!1,this._mouseCode=e.mouseCode,this.pick(this._view.camera);let t=this.findNearestObj(this._interestList,this._view.camera);t&&(Object.assign(this._upEvent,e),this._upEvent.type=j.PICK_UP,this._upEvent.target=t.object3D,this._upEvent.data=this.getPickInfo(),this.dispatchEvent(this._upEvent),t.object3D.containEventListener(j.PICK_UP)&&t.object3D.dispatchEvent(this._upEvent))}_lastFocus;getPickInfo(){if(_.setting.pick.mode=="pixel")return{worldPos:this._pickCompute.getPickWorldPosition(),worldNormal:this._pickCompute.getPickWorldNormal(),screenUv:this._pickCompute.getPickScreenUV(),meshID:this._pickCompute.getPickMeshID()};{let e=this._interestList[0];return{worldPos:e.intersectPoint,worldNormal:e.normal,meshID:e.collider.transform.worldMatrix.index,distance:e.distance}}}onTouchMove(e){this.isTouching=!0,this._mouseCode=e.mouseCode,this.pick(this._view.camera);let t=this.findNearestObj(this._interestList,this._view.camera);t&&(Object.assign(this._mouseMove,e),this._mouseMove.type=j.PICK_MOVE,this._mouseMove.target=t.object3D,this._mouseMove.data=this.getPickInfo(),this.dispatchEvent(this._mouseMove),t.object3D.containEventListener(j.PICK_MOVE)&&t.object3D.dispatchEvent(this._mouseMove)),t!=this._lastFocus&&(this._lastFocus&&this._lastFocus.object3D&&(Object.assign(this._outEvent,e),this._outEvent.type=j.PICK_OUT,this._outEvent.target=this._lastFocus.object3D,this._outEvent.data=this.getPickInfo(),this.dispatchEvent(this._outEvent),this._lastFocus.object3D.containEventListener(j.PICK_OUT)&&this._lastFocus.object3D.dispatchEvent(this._outEvent)),t&&(Object.assign(this._overEvent,e),this._overEvent.type=j.PICK_OVER,this._overEvent.target=t.object3D,this._overEvent.data=this.getPickInfo(),this.dispatchEvent(this._overEvent),t.object3D.containEventListener(j.PICK_OVER)&&t.object3D.dispatchEvent(this._overEvent))),this._lastFocus=t}onTouchOnce(e){this.isTouching=!0,this._mouseCode=e.mouseCode,this.pick(this._view.camera);let t=this.findNearestObj(this._interestList,this._view.camera);if(t){let a=this.getPickInfo();Object.assign(this._pickEvent,e),this._pickEvent.type=j.PICK_CLICK,this._pickEvent.target=t.object3D,this._pickEvent.data=a,this.dispatchEvent(this._pickEvent),t===this._lastDownTarget&&t.object3D.containEventListener(j.PICK_CLICK)&&t.object3D.dispatchEvent(this._pickEvent)}this._lastDownTarget=null}findNearestObj(e,t){return e.sort((a,r)=>a.distance>r.distance?1:-1),e[0]?.collider}_interestList=[];pick(e){if(this._interestList.length=0,_.setting.pick.mode=="pixel"){this._pickCompute.compute(this._view);let t=this._pickCompute.getPickMeshID(),a=this.mouseEnableMap.get(t);if(a){let r=this._pickCompute.getPickWorldPosition(),i=b.distance(r,this.ray.origin);this._interestList.push({distance:i,collider:a,intersectPoint:r})}}else if(_.setting.pick.mode=="bound"){this.ray=e.screenPointToRay(_.inputSystem.mouseX,_.inputSystem.mouseY);let t,a=Pe.componentsEnablePickerList.get(this._view);if(a)for(const r of a){let i=r[0];i.enable&&(t=i.rayPick(this.ray),t&&(t.collider=i,this._interestList.push(t)))}}}}class Ag extends rn{_camera;_scene;_viewPort;_enablePick=!1;_enable=!0;pickFire;guiPick;canvasList;constructor(e=0,t=0,a=0,r=0){super(),this.canvasList=[],this._viewPort=new he(e,t,a,r)}get enable(){return this._enable}set enable(e){this._enable=e}get enablePick(){return this._enablePick}set enablePick(e){this._enablePick!=e&&(this.pickFire=new $d(this),this.pickFire.start()),this._enablePick=e}get scene(){return this._scene}set scene(e){this._scene=e,e.view=this,Wt.createBuffer(this),e&&this.canvasList.forEach(t=>{t&&e.addChild(t.object3D)})}get camera(){return this._camera}set camera(e){this._camera=e}get viewPort(){return this._viewPort}set viewPort(e){this._viewPort=e}enableUICanvas(e=0){let t=this.canvasList[e];if(!t){let a=new d.Object3D;a.name="Canvas "+e,t=a.addComponent(Li),t.index=e,this.canvasList[e]=t}return this.scene.addChild(t.object3D),this.guiPick||(this.guiPick=new Od,this.guiPick.init(this)),t}disableUICanvas(e=0){let t=this.canvasList[e];t&&t.object3D&&t.object3D.removeFromParent()}}class Dg{normal;fixNormal;center;rotateShape;distance=0;index;constructor(e){this.index=e,this.rotateShape=[]}}class _g extends Ve{vScale;uNegate;sections;build(e,t,a,r=1,i=!0){if(a.length<2)throw new Error("path length is not enough");return this.vScale=r,this.uNegate=i,e=e.slice(),t&&e.push(e[0]),this.sections=this.buildSections(e,a),this.buildGeometry(e,this.sections),this.bounds=new xe(b.ZERO.clone(),new b(100,100,100)),this}buildSections(e,t){let a,r,i,n=[],o=t.length;for(let c=0;c<o;c++){let f=new Dg(c);a=t[c],r=t[c+1],f.center=a.clone(),r==null?(f.normal=i.clone(),f.distance=0):(i=r.subtract(a),f.distance=i.length,f.normal=i.normalize()),n.push(f)}n[0].fixNormal=n[0].normal.clone();for(let c=1;c<o;c++){let f=n[c-1],h=n[c];h.fixNormal=h.normal.add(f.normal).normalize()}let l=new R().identity();for(let c=0;c<o;c++){let f=n[c],h,u;if(c==0)h=b.UP,u=e;else{let g=n[c-1];h=g.fixNormal,u=g.rotateShape}R.fromToRotation(h,f.fixNormal,l);for(let g=0,A=e.length;g<A;g++){let m=l.multiplyPoint3(u[g]);f.rotateShape.push(m)}}return n}buildGeometry(e,t){let a=t.length,r=e.length,i=a*r,n=a-1,o=new Float32Array(i*3),l=new Float32Array(i*3),c=new Float32Array(i*2),f=new Uint32Array(n*(r-1)*6),h=r-1,u=0,g=0,A=[0];for(let p=1;p<r;p++)g+=e[p-1].subtract(e[p]).length,A.push(g);for(let p=0;p<a;p++){let D=t[p];for(let B=0;B<r;B++){let v=(p*r+B)*3,C=D.rotateShape[B].add(D.center);o[v]=C.x,o[v+1]=C.y,o[v+2]=C.z,l[v+1]=1;let y=(p*r+B)*2,x=A[B]/g;c[y]=this.uNegate?1-x:x,c[y+1]=u*this.vScale}u+=D.distance}let m=0;for(let p=0;p<n;p++){let D=p*r;for(let B=0;B<h;B++){let v=B,C=B+1,y=v+r,x=C+r;f[m++]=v+D,f[m++]=C+D,f[m++]=y+D,f[m++]=C+D,f[m++]=x+D,f[m++]=y+D}}return this.setIndices(f),this.setAttribute(G.position,o),this.setAttribute(G.normal,l),this.setAttribute(G.uv,c),this.setAttribute(G.TEXCOORD_1,c),this.addSubGeometry({indexStart:0,indexCount:f.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0}),this.computeNormals(),this}}class eh extends Ve{_instanceBuffer;_instanceData;_instanceCount=0;constructor(){super(),this.initBaseGeometry()}initBaseGeometry(){const e=new Float32Array([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0]),t=new Float32Array([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2]),a=new Uint16Array([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]);this.setIndices(a),this.setAttribute(G.position,e),this.setAttribute(G.uv,t),this.addSubGeometry({indexStart:0,indexCount:a.length,vertexStart:0,vertexCount:e.length/3,firstStart:0,index:0,topology:0})}setPositions(e){const t=e instanceof Float32Array?e:new Float32Array(e),r=t.length/3-1;if(r<=0)return console.warn("FatLineGeometry: Need at least 2 points"),this;const i=new Float32Array(r*16);for(let n=0;n<r;n++){const o=n*3,l=(n+1)*3;i[n*16+0]=t[o+0],i[n*16+1]=t[o+1],i[n*16+2]=t[o+2],i[n*16+3]=0,i[n*16+4]=t[l+0],i[n*16+5]=t[l+1],i[n*16+6]=t[l+2],i[n*16+7]=0,i[n*16+8]=1,i[n*16+9]=1,i[n*16+10]=1,i[n*16+11]=0,i[n*16+12]=1,i[n*16+13]=1,i[n*16+14]=1,i[n*16+15]=0}return this._instanceData=i,this._instanceCount=r,this.computeBoundingBox(t),this}setColors(e){const t=e instanceof Float32Array?e:new Float32Array(e);if(!this._instanceData)return console.warn("FatLineGeometry: Must call setPositions() before setColors()"),this;const r=t.length/3-1;if(r!==this._instanceCount)return console.warn("FatLineGeometry: Color array length doesn't match segment count"),this;for(let i=0;i<r;i++){const n=i*3,o=(i+1)*3;this._instanceData[i*16+8]=t[n+0],this._instanceData[i*16+9]=t[n+1],this._instanceData[i*16+10]=t[n+2],this._instanceData[i*16+12]=t[o+0],this._instanceData[i*16+13]=t[o+1],this._instanceData[i*16+14]=t[o+2]}return this}computeBoundingBox(e){const t=new b(1/0,1/0,1/0),a=new b(-1/0,-1/0,-1/0);for(let i=0;i<e.length;i+=3){const n=e[i],o=e[i+1],l=e[i+2];t.x=Math.min(t.x,n),t.y=Math.min(t.y,o),t.z=Math.min(t.z,l),a.x=Math.max(a.x,n),a.y=Math.max(a.y,o),a.z=Math.max(a.z,l)}const r=b.sub(a,t);this.bounds=new xe(b.ZERO.clone(),r),this.bounds.setFromMinMax(t,a)}get instanceData(){return this._instanceData}get instanceCount(){return this._instanceCount}get instanceBuffer(){return!this._instanceBuffer&&this._instanceData&&(this._instanceBuffer=new Te(this._instanceData.byteLength),this._instanceBuffer.setFloat32Array("",this._instanceData),this._instanceBuffer.apply()),this._instanceBuffer}updateInstanceBuffer(){this._instanceBuffer&&this._instanceData&&(this._instanceBuffer.setFloat32Array("",this._instanceData),this._instanceBuffer.apply())}}class Bg{name;offset;size;arrayStride;stepMode;attributes}class vg{name;format;offset;shaderLocation;stride}var th=(s=>(s[s.position=3]="position",s[s.normal=3]="normal",s[s.TANGENT=4]="TANGENT",s[s.uv=2]="uv",s[s.TEXCOORD_1=2]="TEXCOORD_1",s[s.color=4]="color",s[s.joints0=4]="joints0",s[s.weights0=4]="weights0",s[s.joints1=4]="joints1",s[s.weights1=4]="weights1",s[s.vIndex=1]="vIndex",s[s.weight=1]="weight",s[s.a_morphPositions_0=3]="a_morphPositions_0",s))(th||{});class Ug{get data(){return null}entity}class ah{min=0;max=0;set(e,t){return this.max=t,this.min=e,this}copy(e){return this.max=e.max,this.min=e.min,this}isInterestRange(e){return!(this.max>e.min||e.max<this.min)}}class rh{_spaceDesc;getRange(e){return this._spaceDesc[e]}initSpace(e){this._spaceDesc={};for(let t of e)(this._spaceDesc[t]=new ah).set(-Number.MAX_VALUE,Number.MAX_VALUE);return this}isContain(e,t){let a=this._spaceDesc[e];return t>=a.min&&t<a.max}isInterestRange(e,t){let a=this._spaceDesc[e];return a?t.isInterestRange(a):!1}splitSpace(e,t,a){let r=this._spaceDesc[e];return t?r.max=a:r.min=a,this}copySpace(e){for(let t in e._spaceDesc){let a=e._spaceDesc[t];this._spaceDesc[t].copy(a)}return this}}class ji{static MaxEntityCountInLeaf=4;static MaxLayer=10;static ClearLeafLayer=ji.MaxLayer-4}class Zi{static UUID=0;uuid="0";constructor(){this.uuid=(Zi.UUID++).toString()}}class yg{map={};_count=0;get count(){return this._count}push(e){return this.map[e.uuid]?!1:(this.map[e.uuid]=e,this._count++,!0)}remove(e){return this.map[e]?(delete this.map[e],this._count--,!0):!1}}class Ar extends Zi{_dimensionIndex=0;_dimensions;_dimension;_left;_right;_space;_parent;_entities;layer;get dimension(){return this._dimension}constructor(e=0){super(),this.layer=e,Ar.nodeCount++}initNode(e,t,a){return this._dimensions=t,this._dimensionIndex=a,this._dimension=t[a],this._space=new rh().initSpace(t),e&&this._space.copySpace(e._space),this._parent=e,this._entities=new yg,this}updateEntity(e){if(e.isInNode(this,this._dimension)&&(e.attachTreeNode(this),this.autoSplit(),this._left&&this._right)){let t=(this._dimensionIndex+1)%this._dimensions.length,a=this._dimensions[t];e.isInNode(this._right,a)?this._right.updateEntity(e):e.isInNode(this._left,a)&&this._left.updateEntity(e)}}buildRoot(e){for(const t of e)t.entity.attachTreeNode(this);this.autoSplit()}_splitEntityList=[];autoSplit(){if(this._entities.count>ji.MaxEntityCountInLeaf&&!this._right&&!this._left&&this.layer<ji.MaxLayer){let e=this._splitEntityList,t=(this._dimensionIndex+1)%this._dimensions.length,a=this._dimensions[t],r=0;for(const i in this._entities.map){let n=this._entities.map[i];r+=n.centerValue(a),e.push(n)}r/=this._entities.count,this._left=new Ar(this.layer+1),this._right=new Ar(this.layer+1),this._left.initNode(this,this._dimensions,t),this._right.initNode(this,this._dimensions,t),this._left.setSpace(!0,r),this._right.setSpace(!1,r);for(let i of e)i.isInNode(this._right,a)?i.attachTreeNode(this._right):i.isInNode(this._left,a)&&i.attachTreeNode(this._left)}this._left&&this._left.autoSplit(),this._right&&this._right.autoSplit()}setSpace(e,t){return this._parent&&this._space.splitSpace(this._dimension,e,t),this}isEmpty(){return this._left==null&&this._right==null&&this._entities.count==0}pushEntity(e){return this._entities.push(e)}removeEntity(e){return this._entities.remove(e.uuid)}static nodeCount=0;autoClear(){let e=this;for(;e&&e.layer>ji.ClearLeafLayer&&e.clearLeaf();)e=e._parent}clearLeaf(){let e=!this._left&&!this._right,t=!e&&this._left.isEmpty()&&this._right.isEmpty();return t&&(this._left=this._right=null,Ar.nodeCount-=2),e||t}isContain(e){return this._space.isContain(this._dimension,e)}static rangeBox=new xe(new b(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),new b(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE));nodeIntersectsBox(e){let t=this._space.getRange("x"),a=this._space.getRange("y"),r=this._space.getRange("z"),i=Ar.rangeBox;return i.min.set(t.min,a.min,r.min),i.max.set(t.max,a.max,r.max),i.intersectsBox(e)}nodeIntersectsRay(e){let t=this._space.getRange("x"),a=this._space.getRange("y"),r=this._space.getRange("z"),i=Ar.rangeBox;return i.min.set(t.min,a.min,r.min),i.max.set(t.max,a.max,r.max),!0}pointCast(e,t=0,a){if(a=a||[],this._entities.count>0){let r=this._entities.map;for(let i in r){let n=r[i],o=n.entityContainPoint(e);!o&&t>0&&(o=n.squareDistanceTo(e,this._dimensions)<=t),o&&a.push(n)}}this._left&&this._left.isContain(e[this._left.dimension])&&this._left.pointCast(e,t,a),this._right&&this._right.isContain(e[this._right.dimension])&&this._right.pointCast(e,t,a)}boxCast(e,t){if(t=t||[],this._entities.count>0){let a=this._entities.map;for(let r in a){let i=a[r];i.entityIntersectsBox(e)&&t.push(i)}}this._left&&this._left.nodeIntersectsBox(e)&&this._left.boxCast(e,t),this._right&&this._right.nodeIntersectsBox(e)&&this._right.boxCast(e,t)}pointIntersect=new b;rayCast(e,t,a){t=t||[],a=a||[];let r=this.pointIntersect;if(this._entities.count>0){let i=this._entities.map;for(let n in i){let o=i[n];o.entityIntersectsRay(e,r)&&(a.push(new b().copyFrom(r)),t.push(o))}}this._left&&this._left.nodeIntersectsRay(e)&&this._left.rayCast(e,t,a),this._right&&this._right.nodeIntersectsRay(e)&&this._right.rayCast(e,t,a)}}class Cg extends Zi{userData;node;constructor(e){super(),this.userData=e}centerValue(e){return 0}isInNode(e,t){return!1}entityContainPoint(e){return!1}squareDistanceTo(e,t){return Number.MAX_VALUE}entityIntersectsBox(e){return!1}entityIntersectsRay(e,t){return!1}attachTreeNode(e){return this.node&&this.detachTreeNode(),this.node=e,this.node.pushEntity(this)}detachTreeNode(){let e=this.node.removeEntity(this);return this.node=null,e}updateNode(e){let t=this.node;t&&this.detachTreeNode(),e.updateEntity(this),t&&t.autoClear()}}class Qt{minPosX=0;minPosY=0;maxPosX=0;maxPosY=0;testID=0;points;offsetPosition;static TINY=1e-6;constructor(){this.points=new Array,this.offsetPosition=new b(0,0,0,0),this.clear()}setAABox(e,t,a,r){this.minPosX=e-a/2-Qt.TINY,this.maxPosX=e+a/2+Qt.TINY,this.minPosY=t-r/2-Qt.TINY,this.maxPosY=t+r/2+Qt.TINY,this.offsetPosition.setTo(0,0,0)}setOffset(e){this.maxPosX+=e.x-this.offsetPosition.x,this.minPosX+=e.x-this.offsetPosition.x,this.minPosY+=e.z-this.offsetPosition.z,this.maxPosY+=e.z-this.offsetPosition.z,this.offsetPosition.copyFrom(e)}setContainRect(e,t,a,r){this.minPosX>e&&(this.minPosX=e),this.minPosY>t&&(this.minPosY=t),this.maxPosX<a&&(this.maxPosX=a),this.maxPosY<r&&(this.maxPosY=r)}clear(){var e=1e9;this.minPosX=this.minPosY=e,this.maxPosX=this.maxPosY=-e,this.points.length=0,this.testID=0,this.offsetPosition.setTo(0,0,0)}addPoint(e){this.points.indexOf(e)==-1&&(e.x<this.minPosX&&(this.minPosX=e.x-Qt.TINY),e.x>this.maxPosX&&(this.maxPosX=e.x+Qt.TINY),e.z<this.minPosY&&(this.minPosY=e.z-Qt.TINY),e.z>this.maxPosY&&(this.maxPosY=e.z+Qt.TINY),this.points.push(e))}clone(){var e=new Qt;return e.minPosX=this.minPosX,e.minPosY=this.minPosY,e.maxPosX=this.maxPosX,e.maxPosY=this.maxPosY,e}get radius(){return Math.sqrt((this.maxPosY-this.minPosY)*(this.maxPosY-this.minPosY)+(this.maxPosX-this.minPosX)*(this.maxPosX-this.minPosX))}get sideX(){return this.maxPosX-this.minPosX}get sideY(){return this.maxPosY-this.minPosY}get centreX(){return(this.maxPosX-this.minPosX)*.5+this.minPosX}get centreY(){return(this.maxPosY-this.minPosY)*.5+this.minPosY}overlapTest(e){return!(this.minPosY>=e.maxPosY||this.maxPosY<=e.minPosY||this.minPosX>=e.maxPosX||this.maxPosX<=e.minPosX)}isPointInside(e){return e.x>=this.minPosX&&e.x<=this.maxPosX&&e.z>=this.minPosY&&e.z<=this.maxPosY}isIntersectLineSegment(e,t,a,r){var i=!1,n=t-r,o=a-e,l=e*r-a*t,c=(-l-n*this.minPosX)/o;c<=this.maxPosY&&c>=this.minPosY&&(i=!0),c=(-l-n*this.maxPosX)/o,c<=this.maxPosY&&c>=this.minPosY&&(i=!0);var f=(-l-o*this.minPosY)/n;return f<=this.maxPosX&&f>=this.minPosX&&(i=!0),f=(-l-o*this.maxPosY)/n,f<=this.maxPosX&&f>=this.minPosX&&(i=!0),i}}class Dr{static NUM_CHILDREN=4;childCellIndices;nodeIndices;aabb;points;constructor(e){this.childCellIndices=new Array,this.childCellIndices.length=Dr.NUM_CHILDREN,this.nodeIndices=new Array,this.clear(),e?this.aabb=e.clone():this.aabb=new Qt}isLeaf(){return this.childCellIndices[0]==-1}clear(){for(var e=0;e<Dr.NUM_CHILDREN;e++)this.childCellIndices[e]=-1;this.nodeIndices.splice(0,this.nodeIndices.length)}}class ih{_cells;_rootCell;_quadNodes;_aabb;_cellsToTest;_testID;constructor(){this._testID=0,this._cells=new Array,this._quadNodes=new Array,this._cellsToTest=new Array,this._aabb=new Qt}getQuadNode(e){return this._quadNodes[e]}clear(){this._cells.length=0,this._quadNodes.length=0}initNodes(e){this.clear();for(var t=0,a=e.length;t<a;)e[t].calcGlobalQuadAABB(),this._quadNodes.push(e[t]),t++}buildQuadTree(e,t){this._aabb.clear();for(var a of this._quadNodes)if(a.isTriangle)for(var r of a.aabb.points)this._aabb.addPoint(r);else this._aabb.setContainRect(a.aabb.minPosX,a.aabb.minPosY,a.aabb.maxPosX,a.aabb.maxPosY);this._cells.length=0,this._rootCell=new Dr(this._aabb),this._cells.push(this._rootCell);for(var i=this._quadNodes.length,n=0;n<i;n++)this._cells[0].nodeIndices[n]=n;var o=new Array;o.push(0);for(var l,c,f;o.length!=0;)if(c=o.pop(),!(this._cells[c].nodeIndices.length<=e||this._cells[c].aabb.radius<t)){for(n=0;n<Dr.NUM_CHILDREN;n++){this._cells[c].childCellIndices[n]=this._cells.length,o.push(this._cells.length),this._cells.push(new Dr(this.createAABox(this._cells[c].aabb,n))),f=this._cells[this._cells.length-1],i=this._cells[c].nodeIndices.length;for(var h=0;h<i;h++)l=this._cells[c].nodeIndices[h],this.doesNodeIntersectCell(this._quadNodes[l],f)&&f.nodeIndices.push(l)}this._cells[c].nodeIndices.length=0}}createAABox(e,t){var a=e.centreX,r=e.centreY,i=e.sideX,n=e.sideY,o=new Qt;switch(t){case 0:o.setAABox(a+i/4,r+n/4,i/2,n/2);break;case 1:o.setAABox(a-i/4,r+n/4,i/2,n/2);break;case 2:o.setAABox(a-i/4,r-n/4,i/2,n/2);break;case 3:o.setAABox(a+i/4,r-n/4,i/2,n/2);break;default:o.setAABox(a+i/4,r-n/4,i/2,n/2);break}return o}doesNodeIntersectCell(e,t){var a=e.aabb;if(!a.overlapTest(t.aabb))return!1;if(!e.isTriangle)return!0;var r=a.points,i=r[0],n=r[1],o=r[2];if(t.aabb.isPointInside(i)||t.aabb.isPointInside(n)||t.aabb.isPointInside(o))return!0;var l=this.pointInTriangle(t.aabb.minPosX,t.aabb.minPosY,i,n,o)||this.pointInTriangle(t.aabb.minPosX,t.aabb.maxPosY,i,n,o)||this.pointInTriangle(t.aabb.maxPosX,t.aabb.maxPosY,i,n,o)||this.pointInTriangle(t.aabb.maxPosX,t.aabb.minPosY,i,n,o);return l?!0:(l=t.aabb.isIntersectLineSegment(i.x,i.z,n.x,n.z)||t.aabb.isIntersectLineSegment(i.x,i.z,o.x,o.z)||t.aabb.isIntersectLineSegment(n.x,n.z,o.x,o.z),l)}getNodesIntersectingtAABox(e,t){if(this._cells.length==0)return 0;this._cellsToTest.length=0,this._cellsToTest.push(0),this.incrementTestCounter();for(var a,r,i,n,o=0;this._cellsToTest.length!=0;)if(a=this._cellsToTest.pop(),i=this._cells[a],!!t.overlapTest(i.aabb))if(i.isLeaf())for(r=i.nodeIndices.length,o=0;o<r;o++)n=this.getQuadNode(i.nodeIndices[o]).aabb,n.testID!=this._testID&&(n.testID=this._testID,t.overlapTest(n)&&e.push(i.nodeIndices[o]));else for(o=0;o<Dr.NUM_CHILDREN;o++)this._cellsToTest.push(i.childCellIndices[o]);return e.length}pointInTriangle(e,t,a,r,i){var n=a,o=r,l=i,c=n.z-o.z,f=o.x-n.x,h=n.x*o.z-o.x*n.z,u=o.z-l.z,g=l.x-o.x,A=o.x*l.z-l.x*o.z,m=l.z-n.z,p=n.x-l.x,D=l.x*n.z-n.x*l.z,B=!1,v=c*e+f*t+h,C=u*e+g*t+A,y=m*e+p*t+D;const x=.01;return(v>=-x&&C>=-x&&y>=-x||v<=x&&C<=x&&y<=x)&&(B=!0),B}incrementTestCounter(){if(++this._testID,this._testID==0){for(var e=this._quadNodes.length,t=0;t<e;t++)this._quadNodes[t].aabb.testID=0;this._testID=1}}logDeep=0;logTree(e){if(!(e<0)){this.logDeep++;for(var t=this._cells[e],a="",r=0;r<this.logDeep-1;r++)a+="-|";console.log(a+"i="+e+" "+t.aabb.minPosX.toFixed(2)+" "+t.aabb.maxPosX.toFixed(2)+" "+t.aabb.minPosY.toFixed(2)+" "+t.aabb.maxPosY.toFixed(2));var i;for(i=0;i<t.nodeIndices.length;i++)if(t.nodeIndices[i]>=0){var n=this._quadNodes[t.nodeIndices[i]];console.log(a+" t="+t.nodeIndices[i]+" "+n.aabb.minPosX.toFixed(2)+" "+n.aabb.maxPosX.toFixed(2)+" "+n.aabb.minPosY.toFixed(2)+" "+n.aabb.maxPosY.toFixed(2))}for(i=0;i<t.childCellIndices.length;i++)t.childCellIndices[i]>=0&&this.logTree(t.childCellIndices[i]);this.logDeep--}}}class nh{_maxNodesPerCell;_minCellSize;_quadTree;_collisionNodesIdx;_segBox;_collisionNodes;constructor(e=10,t=500){this._maxNodesPerCell=e,this._minCellSize=t,this._segBox=new Qt,this._collisionNodesIdx=new Array,this._collisionNodes=new Array}createQuadTree(e){this._quadTree=new ih,this._quadTree.initNodes(e),this._quadTree.buildQuadTree(this._maxNodesPerCell,this._minCellSize)}getNodesByAABB(e,t,a,r){this._segBox.clear(),this._segBox.maxPosX=a,this._segBox.maxPosY=r,this._segBox.minPosX=e,this._segBox.minPosY=t,this._collisionNodesIdx.length=0,this._collisionNodes.length=0,this._quadTree.getNodesIntersectingtAABox(this._collisionNodesIdx,this._segBox);for(var i,n=0;n<this._collisionNodesIdx.length;n++)i=this._quadTree.getQuadNode(this._collisionNodesIdx[n]),this._collisionNodes.push(i);return this._collisionNodes}getTriangleAtPoint(e,t=5){this._segBox.clear(),this._segBox.setAABox(e.x,e.z,1,1),this._collisionNodesIdx.length=0,this._collisionNodes.length=0,this._quadTree.getNodesIntersectingtAABox(this._collisionNodesIdx,this._segBox);for(var a=4294967295,r=0,i,n,o,l,c=0;c<this._collisionNodesIdx.length;c++)n=this._quadTree.getQuadNode(this._collisionNodesIdx[c]),l=n.aabb,b.pointInsideTriangle(e,l.points[0],l.points[1],l.points[2])&&(o=n,r=Math.abs(o.plane.distance(e)),!(r>t)&&(n==null||r<=a)&&(i=o,a=r));return i}}var Qn=(s=>(s[s.MOUSE_LEFT=0]="MOUSE_LEFT",s[s.MOUSE_MID=1]="MOUSE_MID",s[s.MOUSE_RIGHT=2]="MOUSE_RIGHT",s))(Qn||{});class Sg extends bt{static LOADER_PROGRESS="loaderProgress";static LOADER_COMPLETE="loaderComplete"}class xg extends bt{static ADDED="added";static REMOVED="removed";static CHILD_ADD_EVENT="childAddEvent";static CHILD_REMOVED="childRemoved"}class Fg extends bt{static SHOW="show";static HIDE="hide";static UPDATE="update"}class kg{static merge(e,t,a,r){let i=0,n=0;i=Math.max(e.width,i),i=Math.max(t.width,i),i=Math.max(a.width,i),i=Math.max(r.width,i),n=Math.max(e.height,n),n=Math.max(t.height,n),n=Math.max(a.height,n),n=Math.max(r.height,n);let o=new we(i,n,se.rgba8unorm),l=new ye(Yf);l.setSamplerTexture("textureR",e),l.setSamplerTexture("textureG",t),l.setSamplerTexture("textureB",a),l.setSamplerTexture("textureA",r),l.setStorageTexture("outTex",o),l.workerSizeX=Math.ceil(i/8),l.workerSizeY=Math.ceil(n/8);let c=F.beginCommandEncoder();return F.computeCommand(c,[l]),F.endCommandEncoder(c),o}}class sh{computeShader;setInputes(e,t,a){this.computeShader=new ye(fd(e,t,a,8,8,1));for(let r=0;r<t.length;r++)this.computeShader.setSamplerTexture(`source${r}Map`,t[r]);for(let r=0;r<a.length;r++)this.computeShader.setStorageTexture(`dest${r}Map`,a[r]);e&&this.computeShader.setSamplerTexture("colorMap",e),this.computeShader.workerSizeX=a[0].width/8,this.computeShader.workerSizeY=a[0].height/8,this.computeShader.workerSizeZ=1}}class oh{sourceShader;compute;needUpdate=!0;constructor(e,t){this.sourceShader=t,this.compute=new ye(e),this.init()}init(){}onUpdate(){this.onFrame&&this.onFrame(),this.onOnce&&this.needUpdate&&(this.needUpdate=!1,this.onFrame())}}class lh extends oh{constructor(e){super($f,e)}init(){let e=new we(256,256,se.rgba8unorm,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING);return this.compute.setStorageTexture("sssMap",e),this.sourceShader.setTexture("lutMap",e),e}onFrame(){this.compute.workerSizeX=256/8,this.compute.workerSizeY=256/8;let e=F.beginCommandEncoder();F.computeCommand(e,[this.compute]),F.endCommandEncoder(e)}}class Eg{gpuBuffer;probes;memoryDo;_probeInfoList;initDataUniform(e){this.memoryDo=new nr,this.probes=e,this._probeInfoList=[],this.memoryDo.destroy(),this.memoryDo.allocation(e.length*17*4);for(let a=0;a<e.length;a++){var t=17;let r=this.memoryDo.allocation_node(t*4);this._probeInfoList.push(r);let i=e[a].transform.worldPosition;r.setArray(0,[i.x,i.y,i.z])}this.gpuBuffer=w.device.createBuffer({size:this.memoryDo.shareDataBuffer.byteLength,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.STORAGE,label:"ProbeBuffer",mappedAtCreation:!1})}updateGPUBuffer(){const e=this.memoryDo.shareDataBuffer;let t=this.memoryDo.shareDataBuffer.byteLength,a=0;const r=5e3*64;for(;a<t;)w.device.queue.writeBuffer(this.gpuBuffer,a,e,a,Math.floor(Math.min(r,t-a))),a+=r}}class wg extends ja{constructor(e,t,a=0){super(),this.bufferType=ga.StructStorageGPUBuffer,this.createBufferByStruct(GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST|a,e,t)}}class Rg{static codeMax=`
|
|
11790
11790
|
@group(0) @binding(0) var inputTexture : texture_2d<f32>;
|
|
11791
11791
|
@group(0) @binding(1) var inputTextureSampler : sampler;
|
|
11792
11792
|
@group(0) @binding(2) var outputTexture : texture_storage_2d<rgba8unorm, write>;
|
|
@@ -11812,15 +11812,15 @@ fn frag(){
|
|
|
11812
11812
|
let dstCoord = vec2<i32>(i32(GlobalInvocationID.x), i32(GlobalInvocationID.y));
|
|
11813
11813
|
textureStore(outputTexture, dstCoord, fromColor);
|
|
11814
11814
|
}
|
|
11815
|
-
`;static _pipelineMax;static _pipelineMin;static createMipmap(e,t){const a=w.device;this._pipelineMax||=a.createComputePipeline({layout:"auto",compute:{module:a.createShaderModule({code:this.codeMax}),entryPoint:"main"}}),this._pipelineMin||=a.createComputePipeline({layout:"auto",compute:{module:a.createShaderModule({code:this.codeMin}),entryPoint:"main"}});let r=Math.ceil(e.width*.5),i=Math.ceil(e.height*.5),n={mipmapCount:t,texture:e,srcView:null,mipLevel:1,dstHeight:i,dstWidth:r};n.srcView=e.getGPUTexture().createView({format:e.format,dimension:"2d",baseMipLevel:0,mipLevelCount:1}),e.width>1024&&e.height>1024?this.mipmap(this._pipelineMax,n):this.mipmap(this._pipelineMin,n)}static mipmap(e,t){const a=w.device,r=F.beginCommandEncoder();let i=e==this._pipelineMax,n,o;for(let l=t.mipLevel;l<t.mipmapCount;l++){let c=[],f=0;c.push({binding:f++,resource:t.srcView}),c.push({binding:f++,resource:t.texture.gpuSampler}),n=t.texture.getGPUTexture().createView({format:t.texture.format,dimension:"2d",baseMipLevel:l,mipLevelCount:1}),c.push({binding:f++,resource:n});const h=a.createBindGroup({layout:e.getBindGroupLayout(0),entries:c}),u=r.beginComputePass();u.setPipeline(e),u.setBindGroup(0,h);let g=t.dstWidth,A=t.dstHeight;if(i&&(g=Math.max(1,Math.floor(t.dstWidth/8)),A=Math.max(1,Math.floor(t.dstHeight/8))),u.dispatchWorkgroups(g,A),t.dstHeight*=.5,t.dstWidth*=.5,t.srcView=n,t.mipLevel=l+1,o=i&&(t.dstWidth<8||t.dstHeight<8),u.end(),o)break}F.endCommandEncoder(r),o&&this.mipmap(this._pipelineMin,t)}}class ch{name="";passMap=new Map}class fh{passType="";shaderState=new Map;vertexShader="";fragmentShader=""}class Ig{static passKeyword="pass";static shaderKeyword="Shader";static vertexKeyword="vertex";static fragmentKeyword="fragment";static passTypeKeyword="PassType";static parser(e,t){e=ma.filterComment(e);let a=new ch,r=e.indexOf(this.shaderKeyword),i=e.indexOf("{",r),n=e.substring(r+this.shaderKeyword.length,i).trim();a.name=n.substring(1,n.length-1),n=e.substring(e.indexOf("{")+1,e.lastIndexOf("}"));let o=this.splitPassBlock(n);for(let l of o){let c=this.parserPassBlock(l),f;a.passMap.has(c.passType)?f=a.passMap.get(c.passType):(f=[],a.passMap.set(c.passType,f)),f.push(c),c.vertexShader.length>0&&(c.vertexShader=ma.parse(c.vertexShader,t)),c.fragmentShader.length>0&&(c.fragmentShader=ma.parse(c.fragmentShader,t))}return a}static splitPassBlock(e){let t=0,a=[];for(;t<e.length;){let r=e.indexOf(this.passKeyword,t);if(r==-1){a.push(e.substring(t));break}t!=0&&a.push(e.substring(t,r)),t=r+this.passKeyword.length}return a}static parserPassBlock(e){let t=new fh,a=e.indexOf(this.passTypeKeyword),r=e.indexOf('"',a);return a=e.indexOf('"',r+1),t.passType=e.substring(a+1,r).trim(),this.parserShaderState(t,e),a=e.indexOf(this.vertexKeyword),a!=-1&&(t.vertexShader=this.extractBlock(e.substring(a+this.vertexKeyword.length),"{","}")),a=e.indexOf(this.fragmentKeyword),a!=-1&&(t.fragmentShader=this.extractBlock(e.substring(a+this.fragmentKeyword.length),"{","}")),t}static parserShaderState(e,t){let a=t.indexOf("ShaderState");if(a==-1)return!1;a=t.indexOf("{",a);let r=t.indexOf("}",a),n=t.substring(a+1,r).split(",");for(let o of n){let l=o.split(":"),c=l[0].trim(),f=this.convertValue(l[1].trim());e.shaderState.set(c,f)}return!0}static convertValue(e){return e.length==4&&e.toLowerCase()=="true"?!0:e.length==5&&e.toLowerCase()=="false"?!1:e[0]=='"'?e.substring(1,e.length-1):Number.parseInt(e)}static extractBlock(e,t,a){let r=e.indexOf(t);if(r==-1)return"";let i=0,n=0;e=e.substring(r);for(let l of e){if(l==t?i++:l==a&&i--,i<=0)break;n++}return e.substring(1,n).trim()}}let dh=new bt("IrradianceDataReaderCompleteEvent");class Yi extends Ja{readFlag=!1;probeRenderer;opColorBuffer;opDepthBuffer;srcColorMap;srcDepthMap;opDepthArray;opColorArray;initReader(e,t,a){this.probeRenderer=e,this.srcColorMap=t,this.srcDepthMap=a;let r=_.setting.gi,i=r.octRTMaxSize*r.octRTMaxSize;this.opColorBuffer=w.device.createBuffer({size:i*4*4,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ,mappedAtCreation:!1}),this.opColorArray=new Float32Array(i*4),this.opDepthBuffer=w.device.createBuffer({size:i*4*4,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ,mappedAtCreation:!1}),this.opDepthArray=new Float32Array(i*4),this.probeRenderer.addEventListener(Es.type,()=>{this.onProbeRenderComplete()},this),this.probeRenderer.addEventListener(An.type,()=>{console.log("GIRenderStartEvent")},this)}async onProbeRenderComplete(){if(console.log("GIRenderCompleteEvent"),this.readFlag)console.log("irradianceDataReader is reading yet!!!");else{this.readFlag=!0;let e=Date.now();console.log("irradianceDataReader start reading "),await Yi.read(this.srcColorMap.getGPUTexture(),this.opColorBuffer,this.opColorArray),await Yi.read(this.srcDepthMap.getGPUTexture(),this.opDepthBuffer,this.opDepthArray),this.readFlag=!1,console.log("process time :",Date.now()-e),console.log("irradianceDataReader read complete"),this.dispatchEvent(dh)}}static async read(e,t,a){let r=F.beginCommandEncoder();r.copyTextureToBuffer({texture:e},{buffer:t,bytesPerRow:e.width*16},[e.width,e.height]),F.endCommandEncoder(r),await t.mapAsync(GPUMapMode.READ);const i=t.getMappedRange();a.set(new Float32Array(i),0),t.unmap()}}let Qg=new Yi;class Tg{computeShader;visibleBuffer;texture;constructor(){this.computeShader=new ye(hd),this.visibleBuffer=new ei(8192*2),this.computeShader.setStorageBuffer("visibleBuffer",this.visibleBuffer),this.texture=Et.getTexture(Ta.zBufferTexture_NAME),this.computeShader.setSamplerTexture("zBufferTexture",this.texture),this.computeShader.workerSizeX=Math.ceil(this.texture.width/8),this.computeShader.workerSizeY=Math.ceil(this.texture.height/8),this.computeShader.workerSizeZ=1}compute(e,t){this.visibleBuffer.reset(!0,0),this.visibleBuffer.apply();let a=F.beginCommandEncoder();F.computeCommand(a,[this.computeShader]),this.visibleBuffer.readBuffer(),t.zVisibleList=this.visibleBuffer.outFloat32Array}}class Mg extends Jt{RT_BloomUp;RT_BloomDown;RT_threshold;rendererPassState;thresholdCompute;downSampleComputes;upSampleComputes;postCompute;bloomSetting;rtFrame;constructor(){super()}onAttach(e){_.setting.render.postProcessing.bloom.enable=!0,this.createGUI()}onDetach(e){_.setting.render.postProcessing.bloom.enable=!1,this.removeGUI()}createGUI(){}removeGUI(){}get downSampleBlurSize(){return _.setting.render.postProcessing.bloom.downSampleBlurSize}set downSampleBlurSize(e){_.setting.render.postProcessing.bloom.downSampleBlurSize=e}get downSampleBlurSigma(){return _.setting.render.postProcessing.bloom.downSampleBlurSigma}set downSampleBlurSigma(e){_.setting.render.postProcessing.bloom.downSampleBlurSigma=e}get upSampleBlurSize(){return _.setting.render.postProcessing.bloom.upSampleBlurSize}set upSampleBlurSize(e){_.setting.render.postProcessing.bloom.upSampleBlurSize=e}get upSampleBlurSigma(){return _.setting.render.postProcessing.bloom.upSampleBlurSigma}set upSampleBlurSigma(e){_.setting.render.postProcessing.bloom.upSampleBlurSigma=e}get luminanceThreshole(){return _.setting.render.postProcessing.bloom.luminanceThreshole}set luminanceThreshole(e){_.setting.render.postProcessing.bloom.luminanceThreshole=e}get bloomIntensity(){return _.setting.render.postProcessing.bloom.bloomIntensity}set bloomIntensity(e){_.setting.render.postProcessing.bloom.bloomIntensity=e}get hdr(){return _.setting.render.postProcessing.bloom.hdr}set hdr(e){_.setting.render.postProcessing.bloom.hdr=e}createThreshouldCompute(){this.thresholdCompute=new ye(Gf),this.autoSetColorTexture("inTex",this.thresholdCompute),this.thresholdCompute.setStorageTexture("outTex",this.RT_threshold),this.thresholdCompute.setUniformBuffer("bloomCfg",this.bloomSetting),this.thresholdCompute.workerSizeX=Math.ceil(this.RT_threshold.width/8),this.thresholdCompute.workerSizeY=Math.ceil(this.RT_threshold.height/8),this.thresholdCompute.workerSizeZ=1}createDownSampleComputes(){const t=_.setting.render.postProcessing.bloom.downSampleStep;this.downSampleComputes=[];for(let a=0;a<t;a++){let r=new ye(zf),i=this.RT_BloomDown[a],n=a==0?this.RT_threshold:this.RT_BloomDown[a-1];r.setSamplerTexture("inTex",n),r.setStorageTexture("outTex",i),r.setUniformBuffer("bloomCfg",this.bloomSetting),r.workerSizeX=Math.ceil(i.width/8),r.workerSizeY=Math.ceil(i.height/8),r.workerSizeZ=1,this.downSampleComputes.push(r)}}createUpSampleComputes(){const t=_.setting.render.postProcessing.bloom.downSampleStep;this.upSampleComputes=[];{let a=new ye(lo),r=this.RT_BloomUp[0],i=this.RT_BloomDown[t-2];a.setSamplerTexture("_MainTex",i),a.setSamplerTexture("_PrevMip",this.RT_BloomDown[t-1]),a.setStorageTexture("outTex",r),a.setUniformBuffer("bloomCfg",this.bloomSetting),a.workerSizeX=Math.ceil(r.width/8),a.workerSizeY=Math.ceil(r.height/8),a.workerSizeZ=1,this.upSampleComputes.push(a)}for(let a=1;a<t-1;a++){let r=new ye(lo),i=this.RT_BloomUp[a],n=this.RT_BloomDown[t-2-a];r.setSamplerTexture("_MainTex",n),r.setSamplerTexture("_PrevMip",this.RT_BloomUp[a-1]),r.setStorageTexture("outTex",i),r.setUniformBuffer("bloomCfg",this.bloomSetting),r.workerSizeX=Math.ceil(i.width/8),r.workerSizeY=Math.ceil(i.height/8),r.workerSizeZ=1,this.upSampleComputes.push(r)}}createPostCompute(){const t=_.setting.render.postProcessing.bloom.downSampleStep;this.postCompute=new ye(Wf),this.autoSetColorTexture("_MainTex",this.postCompute),this.postCompute.setSamplerTexture("_BloomTex",this.RT_BloomUp[t-2]),this.postCompute.setStorageTexture("outTex",this.RT_threshold),this.postCompute.setUniformBuffer("bloomCfg",this.bloomSetting),this.postCompute.workerSizeX=Math.ceil(this.RT_threshold.width/8),this.postCompute.workerSizeY=Math.ceil(this.RT_threshold.height/8),this.postCompute.workerSizeZ=1}createResource(){let e=_.setting.render.postProcessing.bloom;this.bloomSetting=new yt(8);let[t,a]=w.presentationSize,r=GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING;this.RT_threshold=new we(t,a,se.rgba16float,!1,r);const i=e.downSampleStep;{this.RT_BloomDown=[];let o=Math.ceil(t/4),l=Math.ceil(a/4);for(let c=0;c<i;c++)this.RT_BloomDown[c]=new we(o,l,se.rgba16float,!1,r),o=Math.ceil(o/2),l=Math.ceil(l/2)}{this.RT_BloomUp=[];for(let o=0;o<i-1;o++){let l=this.RT_BloomDown[i-2-o].width,c=this.RT_BloomDown[i-2-o].height;this.RT_BloomUp[o]=new we(l,c,se.rgba16float,!1,r)}}let n=new Ge;n.loadOp="load",this.rtFrame=new rt([this.RT_threshold],[n])}render(e,t){this.thresholdCompute||(this.createResource(),this.createThreshouldCompute(),this.createDownSampleComputes(),this.createUpSampleComputes(),this.createPostCompute(),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="Bloom");let a=_.setting.render.postProcessing.bloom;this.bloomSetting.setFloat("downSampleStep",a.downSampleStep),this.bloomSetting.setFloat("downSampleBlurSize",a.downSampleBlurSize),this.bloomSetting.setFloat("downSampleBlurSigma",a.downSampleBlurSigma),this.bloomSetting.setFloat("upSampleBlurSize",a.upSampleBlurSize),this.bloomSetting.setFloat("upSampleBlurSigma",a.upSampleBlurSigma),this.bloomSetting.setFloat("luminanceThreshole",a.luminanceThreshole),this.bloomSetting.setFloat("bloomIntensity",a.bloomIntensity),this.bloomSetting.setFloat("hdr",a.hdr),this.bloomSetting.apply(),F.computeCommand(t,[this.thresholdCompute,...this.downSampleComputes,...this.upSampleComputes,this.postCompute]),F.lastRenderPassState=this.rendererPassState}onResize(){let e=_.setting.render.postProcessing.bloom,[t,a]=w.presentationSize;this.RT_threshold.resize(t,a);const r=e.downSampleStep;let i=Math.ceil(t/4),n=Math.ceil(a/4);for(let o=0;o<r;o++)this.RT_BloomDown[o].resize(i,n),i=Math.ceil(i/2),n=Math.ceil(n/2);for(let o=0;o<r-1;o++){let l=this.RT_BloomDown[r-2-o].width,c=this.RT_BloomDown[r-2-o].height;this.RT_BloomUp[o].resize(l,c)}this.thresholdCompute.workerSizeX=Math.ceil(this.RT_threshold.width/8),this.thresholdCompute.workerSizeY=Math.ceil(this.RT_threshold.height/8),this.thresholdCompute.workerSizeZ=1;for(let o=0;o<r;o++){let l=this.downSampleComputes[o],c=this.RT_BloomDown[o];l.workerSizeX=Math.ceil(c.width/8),l.workerSizeY=Math.ceil(c.height/8),l.workerSizeZ=1}{let o=this.RT_BloomUp[0],l=this.upSampleComputes[0];l.workerSizeX=Math.ceil(o.width/8),l.workerSizeY=Math.ceil(o.height/8),l.workerSizeZ=1}for(let o=1;o<r-1;o++){let l=this.RT_BloomUp[o],c=this.upSampleComputes[o];c.workerSizeX=Math.ceil(l.width/8),c.workerSizeY=Math.ceil(l.height/8),c.workerSizeZ=1}this.postCompute.workerSizeX=Math.ceil(this.RT_threshold.width/8),this.postCompute.workerSizeY=Math.ceil(this.RT_threshold.height/8),this.postCompute.workerSizeZ=1}}class Ng extends Jt{blurTexture1;blurTexture2;rendererPassState;blurComputes;blurSettings;outTexture;rtFrame;constructor(){super()}onAttach(e){_.setting.render.postProcessing.depthOfView.enable=!0}onDetach(e){_.setting.render.postProcessing.depthOfView.enable=!1}get pixelOffset(){return _.setting.render.postProcessing.depthOfView.pixelOffset}set pixelOffset(e){e=Math.max(0,e);let t=_.setting.render.postProcessing.depthOfView;t.pixelOffset=e}get near(){return _.setting.render.postProcessing.depthOfView.near}set near(e){e=Math.max(0,e);let t=_.setting.render.postProcessing.depthOfView;t.near=e}get far(){return _.setting.render.postProcessing.depthOfView.far}set far(e){e=Math.max(0,e);let t=_.setting.render.postProcessing.depthOfView;t.far=e}createBlurCompute(){this.blurSettings=[],this.blurComputes=[];let e=_.setting.render.postProcessing.depthOfView;for(let t=0;t<e.iterationCount;t++){let a=new yt(4),r=new ye(Jf);this.blurComputes.push(r),this.blurSettings.push(a),r.setUniformBuffer("blurSetting",a);let i=_e.getGBufferFrame(_e.colorPass_GBuffer);r.setSamplerTexture("gBufferTexture",i.getCompressGBufferTexture());let n=t%2==0?this.blurTexture1:this.blurTexture2,o=t%2==1?this.blurTexture1:this.blurTexture2;r.setSamplerTexture("inTex",n),r.setStorageTexture("outTex",o),r.workerSizeX=Math.ceil(this.blurTexture1.width/8),r.workerSizeY=Math.ceil(this.blurTexture1.height/8),r.workerSizeZ=1,this.outTexture=o}}createResource(){let e=w.presentationSize,t=e[0],a=e[1];this.blurTexture1=new we(t,a,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.blurTexture1.name="dof1";let r=new Ge;r.clearValue=[0,0,0,1],r.loadOp="clear",this.blurTexture2=new we(t,a,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.blurTexture2.name="dof2";let i=new Ge;i.clearValue=[0,0,0,1],i.loadOp="clear",this.rtFrame=new rt([this.blurTexture1,this.blurTexture2],[r,i])}render(e,t){if(!this.blurComputes){this.createResource(),this.createBlurCompute();let r=ve.getCameraGroup(e.camera);for(let i=0;i<this.blurComputes.length;i++)this.blurComputes[i].setUniformBuffer("globalUniform",r.uniformGPUBuffer);this.rendererPassState=Je.createRendererPassState(this.rtFrame,null)}this.autoSetColorTexture("inTex",this.blurComputes[0]);let a=_.setting.render.postProcessing.depthOfView;a.far=Math.max(a.near,a.far)+1e-4;for(let r=0;r<a.iterationCount;r++){let i=this.blurComputes[r],n=this.blurSettings[r];n.setFloat("near",a.near),n.setFloat("far",a.far),n.setFloat("pixelOffset",(r+1)*a.pixelOffset),n.apply(),i.setStorageBuffer("blurSetting",n)}F.computeCommand(t,this.blurComputes),F.lastRenderPassState=this.rendererPassState}onResize(){let e=w.presentationSize,t=e[0],a=e[1],r=_.setting.render.postProcessing.depthOfView;r.far=Math.max(r.near,r.far)+1e-4,this.blurTexture1.resize(t,a),this.blurTexture2.resize(t,a);for(let i=0;i<r.iterationCount;i++){let n=this.blurComputes[i];n.workerSizeX=Math.ceil(this.blurTexture1.width/8),n.workerSizeY=Math.ceil(this.blurTexture1.height/8),n.workerSizeZ=1}}}class Pg extends Jt{outTexture;rendererPassState;rtFrame;view;gBufferTexture;testCompute;_state=0;_state1=256;_state2=256;uniformBuffer;currentRenderTexture;constructor(){super()}onAttach(e){this.view=e}onDetach(e){}set state(e){this._state=e,this.uniformBuffer.setInt32("state",e),this.uniformBuffer.apply()}get state(){return this._state}set size1(e){this._state1=e,this.uniformBuffer.setInt32("state1",e),this.uniformBuffer.apply()}get size1(){return this._state1}set size2(e){this._state2=e,this.uniformBuffer.setInt32("state2",e),this.uniformBuffer.apply()}get size2(){return this._state2}createResource(){let e=_e.getGBufferFrame("ColorPassGBuffer");this.currentRenderTexture=e.getColorTexture(),this.gBufferTexture=e.getCompressGBufferTexture();let[t,a]=w.presentationSize;this.outTexture=new we(t,a,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.outTexture.name="outTexture";let r=new Ge;r.loadOp="load",this.rtFrame=new rt([this.outTexture],[r])}createCompute(){this.uniformBuffer=new yt(4),this.uniformBuffer.setInt32("state",this._state);let e=ve.getCameraGroup(this.view.camera),a=_e.getGBufferFrame("ColorPassGBuffer").getCompressGBufferTexture(),r=_.setting.reflectionSetting,n=_e.getGBufferFrame(_e.reflections_GBuffer,r.width,r.height).getCompressGBufferTexture(),o=_.renderJobs.get(this.view).reflectionRenderer.outTexture;this.testCompute=new ye(cd),this.testCompute.setUniformBuffer("globalUniform",e.uniformGPUBuffer),this.testCompute.setUniformBuffer("uniformData",this.uniformBuffer),this.testCompute.setSamplerTexture("gBufferTexture",a),this.testCompute.setSamplerTexture("currentRenderTexture",this.currentRenderTexture),this.testCompute.setSamplerTexture("reflectionsGBufferTexture",n),this.testCompute.setSamplerTexture("envMap",o),this.testCompute.setStorageTexture("outputTexture",this.outTexture),this.testCompute.workerSizeX=Math.ceil(this.outTexture.width/16),this.testCompute.workerSizeY=Math.ceil(this.outTexture.height/16),this.testCompute.workerSizeZ=1}render(e,t){}compute(e){this.testCompute||(this.createResource(),this.createCompute(),this.onResize(),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="test");let t=F.beginCommandEncoder();F.computeCommand(t,[this.testCompute]),F.endCommandEncoder(t),F.lastRenderPassState=this.rendererPassState}onResize(){let[e,t]=w.presentationSize;this.outTexture.resize(e,t),this.testCompute.workerSizeX=Math.ceil(this.outTexture.width/16),this.testCompute.workerSizeY=Math.ceil(this.outTexture.height/16)}}class Vg extends Jt{gtaoTexture;rendererPassState;gtaoCompute;gtaoSetting;aoBuffer;directionsBuffer;directionsArray;rtFrame;constructor(){super()}onAttach(e){_.setting.render.postProcessing.gtao.enable=!0}Render;onDetach(e){_.setting.render.postProcessing.gtao.enable=!1}get maxDistance(){return _.setting.render.postProcessing.gtao.maxDistance}set maxDistance(e){e=Ae(e,.1,50);let t=_.setting.render.postProcessing.gtao;t.maxDistance=e}get maxPixel(){return _.setting.render.postProcessing.gtao.maxPixel}set maxPixel(e){e=Ae(e,5,100);let t=_.setting.render.postProcessing.gtao;t.maxPixel=e}get darkFactor(){return _.setting.render.postProcessing.gtao.darkFactor}set darkFactor(e){e=Ae(e,.01,1);let t=_.setting.render.postProcessing.gtao;t.darkFactor=e}get rayMarchSegment(){return _.setting.render.postProcessing.gtao.rayMarchSegment}set rayMarchSegment(e){e=Ae(e,4,10);let t=_.setting.render.postProcessing.gtao;t.rayMarchSegment=e}get multiBounce(){return _.setting.render.postProcessing.gtao.multiBounce}set multiBounce(e){let t=_.setting.render.postProcessing.gtao;t.multiBounce=e}get blendColor(){return _.setting.render.postProcessing.gtao.blendColor}set blendColor(e){let t=_.setting.render.postProcessing.gtao;t.blendColor=e}get usePosFloat32(){return _.setting.render.postProcessing.gtao.usePosFloat32}set usePosFloat32(e){let t=_.setting.render.postProcessing.gtao;t.usePosFloat32=e}createCompute(){this.gtaoCompute=new ye(jf);let e=new yt(8);this.gtaoCompute.setUniformBuffer("gtaoData",e),this.directionsArray=new Float32Array(16),this.directionsBuffer=new Te(16),this.directionsBuffer.setFloat32Array("array",this.randomDirection()),this.directionsBuffer.apply(),this.gtaoCompute.setStorageBuffer("directions",this.directionsBuffer),this.aoBuffer=new Te(this.gtaoTexture.width*this.gtaoTexture.height),this.gtaoCompute.setStorageBuffer("aoBuffer",this.aoBuffer);let t=_e.getGBufferFrame(_e.colorPass_GBuffer);this.gtaoCompute.setSamplerTexture("gBufferTexture",t.getCompressGBufferTexture()),this.autoSetColorTexture("inTex",this.gtaoCompute),this.gtaoCompute.setStorageTexture("outTex",this.gtaoTexture),this.gtaoSetting=e}createResource(){let[e,t]=w.presentationSize;this.gtaoTexture=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.gtaoTexture.name="gtaoTex";let a=new Ge;a.loadOp="load",this.rtFrame=new rt([this.gtaoTexture],[a])}randomCount=0;randomDirection(){this.randomCount=0;let e=Math.PI*2*this.randomCount/16,t=Math.PI*2/8;for(let a=0;a<8;a++){let r=e+a*t;this.directionsArray[a*2]=Math.sin(r),this.directionsArray[a*2+1]=Math.cos(r)}return this.directionsArray}render(e,t){if(!this.gtaoCompute){this.createResource(),this.createCompute(),this.onResize(),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="GTAO";let l=ve.getCameraGroup(e.camera);this.gtaoCompute.setUniformBuffer("globalUniform",l.uniformGPUBuffer)}let a=_.setting.render.postProcessing.gtao;this.directionsBuffer.setFloat32Array("array",this.randomDirection()),this.directionsBuffer.apply();let r=1-.2*(Le.frame%2),i=a.maxDistance*r,n=a.maxPixel*r;this.gtaoSetting.setFloat("maxDistance",i),this.gtaoSetting.setFloat("maxPixel",n),this.gtaoSetting.setFloat("darkFactor",a.darkFactor),this.gtaoSetting.setFloat("rayMarchSegment",a.rayMarchSegment);let o=e.camera;this.gtaoSetting.setFloat("cameraNear",o.near),this.gtaoSetting.setFloat("cameraFar",o.far),this.gtaoSetting.setFloat("multiBounce",a.multiBounce?1:0),this.gtaoSetting.setFloat("blendColor",a.blendColor?1:0),this.gtaoSetting.apply(),F.computeCommand(t,[this.gtaoCompute]),F.lastRenderPassState=this.rendererPassState}onResize(){let[e,t]=w.presentationSize;this.gtaoTexture.resize(e,t),this.gtaoCompute.workerSizeX=Math.ceil(this.gtaoTexture.width/8),this.gtaoCompute.workerSizeY=Math.ceil(this.gtaoTexture.height/8),this.gtaoCompute.workerSizeZ=1}}class Og extends Jt{fogSetting;fogOpTexture;fogCompute;fogUniform;rendererPassState;constructor(){super(),this.fogSetting=_.setting.render.postProcessing.globalFog}createCompute(e){Y.register("GlobalFog_shader",co),this.fogCompute=new ye(co),this.fogUniform=new yt(20),this.fogCompute.setUniformBuffer("fogUniform",this.fogUniform);let t=_e.getGBufferFrame(_e.colorPass_GBuffer);this.fogCompute.setSamplerTexture("gBufferTexture",t.getCompressGBufferTexture()),this.fogCompute.setSamplerTexture("inTex",t.getColorTexture()),this._lastSkyTexture=this.getSkyTexture(),this.fogCompute.setSamplerTexture("prefilterMap",this._lastSkyTexture),this.fogCompute.setStorageTexture("outTex",this.fogOpTexture),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="FOG";let a=ve.getLightEntries(e.scene);this.fogCompute.setStorageBuffer("lightBuffer",a.storageGPUBuffer)}uploadSetting(){let e=this.fogUniform,t=this.fogSetting;e.setColor("fogColor",t.fogColor),e.setFloat("fogType",t.fogType),e.setFloat("fogHeightScale",t.fogHeightScale),e.setFloat("start",t.start),e.setFloat("end",t.end),e.setFloat("density",t.density),e.setFloat("ins",t.ins),e.setFloat("falloff",t.falloff),e.setFloat("rayLength",t.rayLength),e.setFloat("scatteringExponent",t.scatteringExponent),e.setFloat("dirHeightLine",t.dirHeightLine),e.setFloat("skyFactor",t.skyFactor),e.setFloat("skyRoughness",t.skyRoughness),e.setFloat("overrideSkyFactor",t.overrideSkyFactor),e.setFloat("isSkyHDR",0),e.apply(),this.fogCompute.setUniformBuffer("fogUniform",this.fogUniform)}rtFrame;createResource(){let[e,t]=w.presentationSize;this.fogOpTexture=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.fogOpTexture.name="fogTex";let a=new Ge;a.loadOp="load",this.rtFrame=new rt([this.fogOpTexture],[a])}onAttach(e){_.setting.render.postProcessing.globalFog.enable=!0}onDetach(e){_.setting.render.postProcessing.globalFog.enable=!1}set fogType(e){this.fogSetting.fogType=e}get fogType(){return this.fogSetting.fogType}set fogHeightScale(e){this.fogSetting.fogHeightScale=e}get fogHeightScale(){return this.fogSetting.fogHeightScale}set start(e){this.fogSetting.start=e}get start(){return this.fogSetting.start}set end(e){this.fogSetting.end=e}get end(){return this.fogSetting.end}set ins(e){this.fogSetting.ins=e}get ins(){return this.fogSetting.ins}set density(e){this.fogSetting.density=e}get density(){return this.fogSetting.density}set skyRoughness(e){this.fogSetting.skyRoughness=e}get skyRoughness(){return this.fogSetting.skyRoughness}set skyFactor(e){this.fogSetting.skyFactor=e}get skyFactor(){return this.fogSetting.skyFactor}set overrideSkyFactor(e){this.fogSetting.overrideSkyFactor=e}get overrideSkyFactor(){return this.fogSetting.overrideSkyFactor}get fogColor(){return this.fogSetting.fogColor}set fogColor(e){this.fogSetting.fogColor.copyFrom(e)}set falloff(e){this.fogSetting.falloff=e}get falloff(){return this.fogSetting.falloff}set rayLength(e){this.fogSetting.rayLength=e}get rayLength(){return this.fogSetting.rayLength}set scatteringExponent(e){this.fogSetting.scatteringExponent=e}get scatteringExponent(){return this.fogSetting.scatteringExponent}set dirHeightLine(e){this.fogSetting.dirHeightLine=e}get dirHeightLine(){return this.fogSetting.dirHeightLine}_lastSkyTexture;getSkyTexture(){let e=_.res.defaultSky;return K.instance.sky instanceof Fn&&(e=K.instance.sky.map),e}render(e,t){if(!this.fogCompute){this.createResource(),this.createCompute(e),this.onResize();let r=ve.getCameraGroup(e.camera);this.fogCompute.setUniformBuffer("globalUniform",r.uniformGPUBuffer)}let a=this.getSkyTexture();a!=this._lastSkyTexture&&(this._lastSkyTexture=a,this.fogCompute.setSamplerTexture("prefilterMap",this._lastSkyTexture)),this.fogCompute.setUniformFloat("isSkyHDR",a.isHDRTexture?1:0),this.uploadSetting(),F.computeCommand(t,[this.fogCompute]),F.lastRenderPassState=this.rendererPassState}onResize(){let[e,t]=w.presentationSize;this.fogOpTexture.resize(e,t),this.fogCompute.workerSizeX=Math.ceil(this.fogOpTexture.width/8),this.fogCompute.workerSizeY=Math.ceil(this.fogOpTexture.height/8),this.fogCompute.workerSizeZ=1}}class Lg extends Jt{godRayTexture;rendererPassState;godRayCompute;historyGodRayData;godRaySetting;rtFrame;constructor(){super()}onAttach(e){_.setting.render.postProcessing.godRay.enable=!0,this.createGUI()}Render;onDetach(e){_.setting.render.postProcessing.godRay.enable=!1,this.removeGUI()}get blendColor(){return _.setting.render.postProcessing.godRay.blendColor}set blendColor(e){_.setting.render.postProcessing.godRay.blendColor=e}get rayMarchCount(){return _.setting.render.postProcessing.godRay.rayMarchCount}set rayMarchCount(e){e=Ae(e,8,20),_.setting.render.postProcessing.godRay.rayMarchCount=e}get scatteringExponent(){return _.setting.render.postProcessing.godRay.scatteringExponent}set scatteringExponent(e){e=Ae(e,1,40),_.setting.render.postProcessing.godRay.scatteringExponent=e}get intensity(){return _.setting.render.postProcessing.godRay.intensity}set intensity(e){e=Ae(e,.01,5),_.setting.render.postProcessing.godRay.intensity=e}createGUI(){}removeGUI(){}createCompute(e){this.godRayCompute=new ye(Zf);let t=new yt(12);this.godRayCompute.setUniformBuffer("godRayUniform",t),this.historyGodRayData=new Te(4*this.godRayTexture.width*this.godRayTexture.height),this.godRayCompute.setStorageBuffer("historyGodRayData",this.historyGodRayData);let a=_e.getGBufferFrame(_e.colorPass_GBuffer);this.godRayCompute.setSamplerTexture("gBufferTexture",a.getCompressGBufferTexture()),this.autoSetColorTexture("inTex",this.godRayCompute),this.godRayCompute.setStorageTexture("outTex",this.godRayTexture);let r=_.getRenderJob(e).shadowMapPassRenderer;this.godRayCompute.setSamplerTexture("shadowMap",r.depth2DArrayTexture),this.godRaySetting=t,this.onResize()}createResource(){let e=w.presentationSize,[t,a]=e;this.godRayTexture=new we(t,a,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.godRayTexture.name="godRayTexture";let r=new Ge;r.loadOp="load",this.rtFrame=new rt([this.godRayTexture],[r])}onResize(){let e=w.presentationSize,[t,a]=e;this.godRayTexture.resize(t,a),this.historyGodRayData.resizeBuffer(4*this.godRayTexture.width*this.godRayTexture.height),this.godRayCompute.setStorageBuffer("historyGodRayData",this.historyGodRayData),this.godRayCompute.workerSizeX=Math.ceil(this.godRayTexture.width/8),this.godRayCompute.workerSizeY=Math.ceil(this.godRayTexture.height/8),this.godRayCompute.workerSizeZ=1}render(e,t){if(!this.godRayCompute){this.createResource(),this.createCompute(e);let o=ve.getLightEntries(e.scene);this.godRayCompute.setStorageBuffer("lightBuffer",o.storageGPUBuffer),this.godRayCompute.setStorageBuffer("models",ve.modelMatrixBindGroup.matrixBufferDst),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="GodRay";let l=ve.getCameraGroup(e.camera);this.godRayCompute.setUniformBuffer("globalUniform",l.uniformGPUBuffer)}let a=_.setting.render.postProcessing.godRay;this.godRaySetting.setFloat("intensity",a.intensity),this.godRaySetting.setFloat("rayMarchCount",a.rayMarchCount);let r=w.presentationSize,[i,n]=r;this.godRaySetting.setFloat("viewPortWidth",i),this.godRaySetting.setFloat("viewPortHeight",n),this.godRaySetting.setFloat("blendColor",a.blendColor?1:0),this.godRaySetting.setFloat("scatteringExponent",a.scatteringExponent),this.godRaySetting.apply(),F.computeCommand(t,[this.godRayCompute]),F.lastRenderPassState=this.rendererPassState}}class hh{indexList;color;count}class uh{SlotCount=8;MaxEntities=16;defaultColor=new J(.2,1,1,1);slots=[];dataDirty=!0;constructor(){let e=_.setting.render.postProcessing.outline.groupCount;this.SlotCount=Math.max(1,Math.min(e,this.SlotCount));for(let t=0;t<this.SlotCount;t++){let a=this.slots[t]=new hh;a.indexList=new Float32Array(this.MaxEntities),a.color=this.defaultColor.clone(),a.count=0}}clear(){for(let e=0;e<this.SlotCount;e++)this.clearAt(e)}clearAt(e){this.dataDirty=!0;let t=this.slots[e];return t.color.copyFrom(this.defaultColor),t.indexList.fill(-1),t.count=0,this}fillDataAt(e,t,a){this.dataDirty=!0;let r=this.slots[e];if(r){r.indexList.fill(-1);for(let i=0,n=t.length;i<n;i++)r.indexList[i]=t[i];r.count=t.length,r.color.copyFrom(a)}return this}fetchData(e){return e.dirty=this.dataDirty,e.slots=this.slots,this.dataDirty=!1,this}}let ya=new uh;class Gg extends Jt{outlineTex;lowTex;rendererPassState;calcWeightCompute;outlineCompute;blendCompute;outlineSetting;slotsBuffer;slotsArray;entitiesArray;entitiesBuffer;weightBuffer;lowTexSize;oldOutlineColor;rtFrame;view;constructor(){super()}onAttach(e){this.view=e,_.setting.render.postProcessing.outline.enable=!0}onDetach(e){_.setting.render.postProcessing.outline.enable=!1}set outlinePixel(e){e=Ae(e,0,8);let t=_.setting.render.postProcessing.outline;t.outlinePixel!=e&&(t.outlinePixel=e)}get outlinePixel(){return _.setting.render.postProcessing.outline.outlinePixel}set fadeOutlinePixel(e){let t=_.setting.render.postProcessing.outline;e=Ae(e,0,8),t.fadeOutlinePixel!=e&&(t.fadeOutlinePixel=e)}get fadeOutlinePixel(){return _.setting.render.postProcessing.outline.fadeOutlinePixel}set strength(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.outline;t.strength!=e&&(t.strength=e)}get strength(){return _.setting.render.postProcessing.outline.strength}set useAddMode(e){_.setting.render.postProcessing.outline.useAddMode=e}get useAddMode(){return _.setting.render.postProcessing.outline.useAddMode}createGUI(){}createCompute(){let e=_e.getGBufferFrame(_e.colorPass_GBuffer);this.calcWeightCompute=new ye(Hf);let t=ve.getCameraGroup(this.view.camera);this.calcWeightCompute.setUniformBuffer("globalUniform",t.uniformGPUBuffer),this.calcWeightCompute.setStorageBuffer("outlineSetting",this.outlineSetting),this.calcWeightCompute.setStorageBuffer("slotsBuffer",this.slotsBuffer),this.calcWeightCompute.setStorageBuffer("weightBuffer",this.weightBuffer),this.calcWeightCompute.setStorageBuffer("entitiesBuffer",this.entitiesBuffer),this.calcWeightCompute.setSamplerTexture("gBufferTexture",e.getCompressGBufferTexture()),this.calcWeightCompute.workerSizeX=Math.ceil(this.lowTex.width/8),this.calcWeightCompute.workerSizeY=Math.ceil(this.lowTex.height/8),this.calcWeightCompute.workerSizeZ=1,this.outlineCompute=new ye(Kf),this.outlineCompute.setStorageBuffer("outlineSetting",this.outlineSetting),this.outlineCompute.setStorageBuffer("slotsBuffer",this.slotsBuffer),this.outlineCompute.setStorageBuffer("weightBuffer",this.weightBuffer),this.outlineCompute.setStorageBuffer("oldOutlineColor",this.oldOutlineColor),this.outlineCompute.setStorageTexture("lowTex",this.lowTex),this.outlineCompute.workerSizeX=Math.ceil(this.lowTex.width/8),this.outlineCompute.workerSizeY=Math.ceil(this.lowTex.height/8),this.outlineCompute.workerSizeZ=1,this.blendCompute=new ye(Xf),this.blendCompute.setStorageBuffer("outlineSetting",this.outlineSetting),this.autoSetColorTexture("inTex",this.blendCompute),this.blendCompute.setSamplerTexture("lowTex",this.lowTex),this.blendCompute.setStorageTexture("outlineTex",this.outlineTex),this.blendCompute.workerSizeX=Math.ceil(this.outlineTex.width/8),this.blendCompute.workerSizeY=Math.ceil(this.outlineTex.height/8),this.blendCompute.workerSizeZ=1}createResource(){let e=w.presentationSize,t=e[0],a=e[1],r=_.setting.render.postProcessing.outline.textureScale;this.lowTexSize=new de(Math.ceil(t*r),Math.ceil(a*r)),this.lowTex=new we(this.lowTexSize.x,this.lowTexSize.y,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.lowTex.name="lowTex";let i=new Ge;i.clearValue=[0,0,0,1],i.loadOp="clear",this.outlineTex=new we(t,a,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.outlineTex.name="outlineTex";let n=new Ge;n.clearValue=[0,0,0,1],n.loadOp="clear",this.rtFrame=new rt([this.outlineTex],[n]),this.outlineSetting=new yt(8),this.weightBuffer=new Te(this.lowTexSize.x*this.lowTexSize.y*4,GPUBufferUsage.COPY_SRC),this.oldOutlineColor=new Te(this.lowTexSize.x*this.lowTexSize.y*4,GPUBufferUsage.COPY_SRC),this.slotsArray=new Float32Array(ya.SlotCount*4),this.slotsBuffer=new Te(this.slotsArray.length),this.slotsBuffer.setFloat32Array("slotsArray",this.slotsArray),this.slotsBuffer.apply(),this.entitiesArray=new Float32Array(ya.SlotCount*ya.MaxEntities),this.entitiesBuffer=new Te(this.entitiesArray.length),this.entitiesBuffer.setFloat32Array("entitiesArray",this.entitiesArray),this.slotsBuffer.apply(),this.fetchData||={}}fetchData;fetchOutlineData(){if(ya.fetchData(this.fetchData),this.fetchData.dirty){let e=ya.SlotCount,t=ya.MaxEntities;for(let a=0;a<e;a++){let r=4*a,i=this.fetchData.slots[a];this.slotsArray[r+0]=i.color.r,this.slotsArray[r+1]=i.color.g,this.slotsArray[r+2]=i.color.b,this.slotsArray[r+3]=i.count,r=t*a,this.entitiesArray.set(i.indexList,r)}this.slotsBuffer.setFloat32Array("slotsArray",this.slotsArray),this.slotsBuffer.apply(),this.entitiesBuffer.setFloat32Array("entitiesArray",this.entitiesArray),this.entitiesBuffer.apply()}}computeList;render(e,t){this.calcWeightCompute||(this.createResource(),this.createCompute(),this.createGUI(),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null)),this.computeList||=[this.calcWeightCompute,this.outlineCompute,this.blendCompute];let a=_.setting.render.postProcessing.outline;this.outlineSetting.setFloat("strength",a.strength),this.outlineSetting.setFloat("useAddMode",a.useAddMode?1:0),this.outlineSetting.setFloat("outlinePixel",a.outlinePixel),this.outlineSetting.setFloat("fadeOutlinePixel",a.fadeOutlinePixel),this.outlineSetting.setFloat("lowTexWidth",this.lowTexSize.x),this.outlineSetting.setFloat("lowTexHeight",this.lowTexSize.y),this.outlineSetting.apply(),this.fetchOutlineData(),F.computeCommand(t,this.computeList),F.lastRenderPassState=this.rendererPassState}onResize(){let e=w.presentationSize,t=e[0],a=e[1],r=_.setting.render.postProcessing.outline.textureScale;this.lowTexSize=new de(Math.ceil(t*r),Math.ceil(a*r)),this.lowTex.resize(this.lowTexSize.x,this.lowTexSize.y),this.outlineTex.resize(t,a),this.weightBuffer.resizeBuffer(this.lowTexSize.x*this.lowTexSize.y*4),this.oldOutlineColor.resizeBuffer(this.lowTexSize.x*this.lowTexSize.y*4),this.calcWeightCompute.workerSizeX=Math.ceil(this.lowTex.width/8),this.calcWeightCompute.workerSizeY=Math.ceil(this.lowTex.height/8),this.calcWeightCompute.workerSizeZ=1,this.outlineCompute.workerSizeX=Math.ceil(this.lowTex.width/8),this.outlineCompute.workerSizeY=Math.ceil(this.lowTex.height/8),this.outlineCompute.workerSizeZ=1,this.blendCompute.workerSizeX=Math.ceil(this.outlineTex.width/8),this.blendCompute.workerSizeY=Math.ceil(this.outlineTex.height/8),this.blendCompute.workerSizeZ=1}}class zg extends Jt{outTexture;newTexture;oldTexture;combineTexture;rendererPassState;ssgiCompute;delayCompute;combineCompute;rtFrame;textureScaleSmallCompute;textureScaleBigCompute;view;colorTexture;posTexture;normalTexture;gBufferTexture;lastPosTexture;downSampleCofe=1;debugChanal="0";updateBuffer;constructor(){super(),this.updateBuffer=new Te(32),this.updateBuffer.setFloat("frameCount",10),this.updateBuffer.setFloat("indirectIns",1.5),this.updateBuffer.setFloat("delay",.02),this.updateBuffer.setFloat("colorIns",1),this.updateBuffer.setFloat("d1",.03),this.updateBuffer.apply()}onAttach(e){this.view=e,e.camera.transform.onPositionChange=e.camera.transform.onPositionChange?nn(e.camera.transform.onPositionChange,(t,a)=>this.onCameraChange(t,a)):(t,a)=>this.onCameraChange(t,a)}onCameraChange(e,t){console.log("a");let a=b.distance(e,t);a=Math.min(.45,a)+.01,this.updateBuffer.setFloat("delay",a)}Render;onDetach(e){}set ins(e){this.updateBuffer.setFloat("indirectIns",e),this.updateBuffer.apply()}get ins(){return this.updateBuffer.getFloat("indirectIns")}set delay(e){this.updateBuffer.setFloat("delay",e),this.updateBuffer.apply()}get delay(){return this.updateBuffer.getFloat("delay")}set colorIns(e){this.updateBuffer.setFloat("colorIns",e),this.updateBuffer.apply()}get colorIns(){return this.updateBuffer.getFloat("colorIns")}set frameCount(e){this.updateBuffer.setFloat("frameCount",e),this.updateBuffer.apply()}get frameCount(){return this.updateBuffer.getFloat("frameCount")}set d1(e){this.updateBuffer.setFloat("d1",e),this.updateBuffer.apply()}get d1(){return this.updateBuffer.getFloat("d1")}createResource(){let e=_e.getGBufferFrame("ColorPassGBuffer");this.gBufferTexture=e.getCompressGBufferTexture();let t=w.presentationSize,a=t[0],r=t[1];this.lastPosTexture=new we(a,r,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.lastPosTexture.name="lastPosTexture",this.outTexture=new we(a,r,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.outTexture.name="outTexture";let i=Math.floor(a*this.downSampleCofe),n=Math.floor(r*this.downSampleCofe);this.newTexture=new we(i,n,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.newTexture.name="newTexture",this.oldTexture=new we(i,n,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.oldTexture.name="oldTexture",this.combineTexture=new we(i,n,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.combineTexture.name="combineTexture";let o=new Ge;o.loadOp="load",this.rtFrame=new rt([this.outTexture],[o])}createCompute(){this.ssgiCompute=new ye(ed),this.delayCompute=new ye(ld),this.combineCompute=new ye(od);let e=ve.getCameraGroup(this.view.camera);this.ssgiCompute.setSamplerTexture("gBufferTexture",this.gBufferTexture),this.ssgiCompute.setSamplerTexture("combineTexture",this.combineTexture),this.ssgiCompute.setSamplerTexture("oldTexture",this.oldTexture),this.ssgiCompute.setStorageTexture("newTexture",this.newTexture),this.ssgiCompute.setUniformBuffer("globalUniform",e.uniformGPUBuffer),this.ssgiCompute.setStorageBuffer("updateBuffer",this.updateBuffer),this.autoSetColorTexture("inTex",this.ssgiCompute),this.delayCompute.setSamplerTexture("newTexture",this.newTexture),this.delayCompute.setSamplerTexture("oldTexture",this.oldTexture),this.delayCompute.setStorageTexture("combineTexture",this.combineTexture),this.delayCompute.setStorageBuffer("updateBuffer",this.updateBuffer),this.combineCompute.setSamplerTexture("inputBTexture",this.combineTexture),this.combineCompute.setSamplerTexture("gBufferTexture",this.gBufferTexture),this.combineCompute.setUniformBuffer("globalUniform",e.uniformGPUBuffer),this.combineCompute.setStorageTexture("outTexture",this.outTexture),this.combineCompute.setStorageBuffer("updateBuffer",this.updateBuffer),this.textureScaleBigCompute=new sh,this.textureScaleBigCompute.setInputes(null,[this.combineTexture],[this.outTexture])}render(e,t){}frame=0;compute(e){this.ssgiCompute||(this.createResource(),this.createCompute(),this.onResize(),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="SSGI"),this.frameCount=this.frame,this.frame++;let t=F.beginCommandEncoder();switch(parseInt(this.debugChanal)){case 0:F.copyTexture(t,this.combineTexture,this.oldTexture),F.computeCommand(t,[this.ssgiCompute,this.delayCompute,this.combineCompute]);break;case 1:F.copyTexture(t,this.posTexture,this.lastPosTexture),F.copyTexture(t,this.lastPosTexture,this.outTexture);break;case 2:F.copyTexture(t,this.normalTexture,this.outTexture);break;case 3:F.copyTexture(t,this.posTexture,this.outTexture);break;case 4:F.copyTexture(t,this.colorTexture,this.outTexture);break;case 5:F.copyTexture(t,this.gBufferTexture,this.outTexture);break}F.lastRenderPassState=this.rendererPassState,this.updateBuffer.setFloat("delay",.01)}onResize(){let e=w.presentationSize,t=e[0],a=e[1];this.outTexture.resize(t,a),this.ssgiCompute.workerSizeX=Math.ceil(this.newTexture.width/16),this.ssgiCompute.workerSizeY=Math.ceil(this.newTexture.height/16),this.ssgiCompute.workerSizeZ=1,this.delayCompute.workerSizeX=Math.ceil(this.combineTexture.width/16),this.delayCompute.workerSizeY=Math.ceil(this.combineTexture.height/16),this.delayCompute.workerSizeZ=1,this.combineCompute.workerSizeX=Math.ceil(this.outTexture.width/16),this.combineCompute.workerSizeY=Math.ceil(this.outTexture.height/16),this.combineCompute.workerSizeZ=1}}class Wg extends Jt{SSR_RayTraceCompute;SSR_IS_Compute;SSR_Blend_Compute;isRetTexture;finalTexture;rendererPassState;ssrUniformBuffer;rayTraceData;ssrColorData;rtFrame;historyPosition;view;onAttach(e){this.view=e,_.setting.render.postProcessing.ssr.enable=!0}onDetach(e){_.setting.render.postProcessing.ssr.enable=!1}reflectionRatio=.5;get fadeEdgeRatio(){return _.setting.render.postProcessing.ssr.fadeEdgeRatio}set fadeEdgeRatio(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.ssr;t.fadeEdgeRatio=e}get rayMarchRatio(){return _.setting.render.postProcessing.ssr.rayMarchRatio}set rayMarchRatio(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.ssr;t.rayMarchRatio=e}get roughnessThreshold(){return _.setting.render.postProcessing.ssr.roughnessThreshold}set roughnessThreshold(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.ssr;t.roughnessThreshold=e}get fadeDistanceMin(){return _.setting.render.postProcessing.ssr.fadeDistanceMin}set fadeDistanceMin(e){e=Ae(e,0,1e4);let t=_.setting.render.postProcessing.ssr;t.fadeDistanceMin=e}get fadeDistanceMax(){return _.setting.render.postProcessing.ssr.fadeDistanceMax}set fadeDistanceMax(e){e=Ae(e,0,1e4);let t=_.setting.render.postProcessing.ssr;t.fadeDistanceMax=e}get powDotRN(){return _.setting.render.postProcessing.ssr.powDotRN}set powDotRN(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.ssr;t.powDotRN=e}createRayTraceShader(){let e=ve.getCameraGroup(this.view.camera);this.SSR_RayTraceCompute=new ye(rd),this.SSR_RayTraceCompute.setUniformBuffer("globalUniform",e.uniformGPUBuffer),this.SSR_RayTraceCompute.setUniformBuffer("ssrUniform",this.ssrUniformBuffer),this.SSR_RayTraceCompute.setStorageBuffer("rayTraceBuffer",this.rayTraceData),this.SSR_RayTraceCompute.setStorageBuffer("historyPosition",this.historyPosition);let a=_e.getGBufferFrame("ColorPassGBuffer").getCompressGBufferTexture();this.SSR_RayTraceCompute.setSamplerTexture("gBufferTexture",a),K.instance.sky instanceof Fn&&this.SSR_RayTraceCompute.setSamplerTexture("prefilterMap",K.instance.sky.map),this.SSR_RayTraceCompute.workerSizeX=Math.ceil(this.isRetTexture.width/8),this.SSR_RayTraceCompute.workerSizeY=Math.ceil(this.isRetTexture.height/8),this.SSR_RayTraceCompute.workerSizeZ=1}createISShader(){this.SSR_IS_Compute=new ye(ad),this.SSR_IS_Compute.setStorageBuffer("ssrUniform",this.ssrUniformBuffer),this.SSR_IS_Compute.setStorageBuffer("rayTraceBuffer",this.rayTraceData),this.SSR_IS_Compute.setStorageBuffer("ssrColorData",this.ssrColorData),this.SSR_IS_Compute.setStorageBuffer("historyPosition",this.historyPosition),this.SSR_IS_Compute.setSamplerTexture("colorMap",this.getOutTexture()),this.SSR_IS_Compute.setStorageTexture("outTex",this.isRetTexture),this.SSR_IS_Compute.workerSizeX=Math.ceil(this.isRetTexture.width/8),this.SSR_IS_Compute.workerSizeY=Math.ceil(this.isRetTexture.height/8),this.SSR_IS_Compute.workerSizeZ=1}createBlendShader(e){let t=ve.getCameraGroup(this.view.camera);this.SSR_Blend_Compute=new ye(td),this.SSR_Blend_Compute.setStorageBuffer("rayTraceBuffer",this.rayTraceData),this.SSR_Blend_Compute.setUniformBuffer("globalUniform",t.uniformGPUBuffer);let r=_e.getGBufferFrame("ColorPassGBuffer").getCompressGBufferTexture();this.SSR_Blend_Compute.setSamplerTexture("gBufferTexture",r),this.SSR_Blend_Compute.setSamplerTexture("colorMap",this.getOutTexture()),this.SSR_Blend_Compute.setSamplerTexture("ssrMap",e),this.SSR_Blend_Compute.setStorageTexture("outTex",this.finalTexture),this.SSR_Blend_Compute.workerSizeX=Math.ceil(this.finalTexture.width/8),this.SSR_Blend_Compute.workerSizeY=Math.ceil(this.finalTexture.height/8),this.SSR_Blend_Compute.workerSizeZ=1}createResource(){let[e,t]=w.presentationSize;this.finalTexture=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING),this.finalTexture.name="ssrOutTex";let a=new Ge;a.clearValue=[0,0,0,0],a.loadOp="clear";let r=Math.ceil(e*_.setting.render.postProcessing.ssr.pixelRatio),i=Math.ceil(t*_.setting.render.postProcessing.ssr.pixelRatio);this.isRetTexture=new we(r,i,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING),this.isRetTexture.name="ssrTextureIn";let n=new Ge;n.clearValue=[0,0,0,0],n.loadOp="clear",this.rtFrame=new rt([this.finalTexture,this.isRetTexture],[a,n]),this.rayTraceData=new Te(r*i*8,GPUBufferUsage.COPY_SRC),this.ssrColorData=new Te(r*i*4,GPUBufferUsage.COPY_SRC),this.historyPosition=new Te(r*i*4,GPUBufferUsage.COPY_SRC),this.ssrUniformBuffer=new yt(32),this.ssrUniformBuffer.setFloat("ssrBufferSizeX",this.isRetTexture.width),this.ssrUniformBuffer.setFloat("ssrBufferSizeY",this.isRetTexture.height),this.ssrUniformBuffer.setFloat("colorMapSizeX",this.finalTexture.width),this.ssrUniformBuffer.setFloat("colorMapSizeY",this.finalTexture.height),this.ssrUniformBuffer.apply()}render(e,t){if(!this.SSR_RayTraceCompute){this.createResource(),this.createISShader(),this.createRayTraceShader(),this.createBlendShader(this.isRetTexture),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null);let i=ve.getCameraGroup(e.camera);this.SSR_RayTraceCompute.setUniformBuffer("standUniform",i.uniformGPUBuffer)}let a=_.setting.render.postProcessing.ssr;this.ssrUniformBuffer.setFloat("fadeEdgeRatio",a.fadeEdgeRatio),this.ssrUniformBuffer.setFloat("rayMarchRatio",a.rayMarchRatio),this.ssrUniformBuffer.setFloat("fadeDistanceMin",a.fadeDistanceMin),this.ssrUniformBuffer.setFloat("fadeDistanceMax",a.fadeDistanceMax),this.ssrUniformBuffer.setFloat("mixThreshold",a.mixThreshold),this.ssrUniformBuffer.setFloat("roughnessThreshold",a.roughnessThreshold),this.ssrUniformBuffer.setFloat("reflectionRatio",this.reflectionRatio),this.ssrUniformBuffer.setFloat("powDotRN",a.powDotRN),this.ssrUniformBuffer.setFloat("randomSeedX",Math.random()),this.ssrUniformBuffer.setFloat("randomSeedY",Math.random()),this.ssrUniformBuffer.apply();let r=[this.SSR_RayTraceCompute,this.SSR_IS_Compute,this.SSR_Blend_Compute];F.computeCommand(t,r),F.lastRenderPassState=this.rendererPassState}onResize(){let[e,t]=w.presentationSize,a=Math.ceil(e*_.setting.render.postProcessing.ssr.pixelRatio),r=Math.ceil(t*_.setting.render.postProcessing.ssr.pixelRatio);this.finalTexture.resize(e,t),this.isRetTexture.resize(a,r),this.rayTraceData.resizeBuffer(a*r*8),this.ssrColorData.resizeBuffer(a*r*4),this.historyPosition.resizeBuffer(a*r*4),this.ssrUniformBuffer.setFloat("ssrBufferSizeX",this.isRetTexture.width),this.ssrUniformBuffer.setFloat("ssrBufferSizeY",this.isRetTexture.height),this.ssrUniformBuffer.setFloat("colorMapSizeX",this.finalTexture.width),this.ssrUniformBuffer.setFloat("colorMapSizeY",this.finalTexture.height),this.SSR_RayTraceCompute.workerSizeX=Math.ceil(this.isRetTexture.width/8),this.SSR_RayTraceCompute.workerSizeY=Math.ceil(this.isRetTexture.height/8),this.SSR_RayTraceCompute.workerSizeZ=1,this.SSR_IS_Compute.workerSizeX=Math.ceil(this.isRetTexture.width/8),this.SSR_IS_Compute.workerSizeY=Math.ceil(this.isRetTexture.height/8),this.SSR_IS_Compute.workerSizeZ=1,this.SSR_Blend_Compute.workerSizeX=Math.ceil(this.finalTexture.width/8),this.SSR_Blend_Compute.workerSizeY=Math.ceil(this.finalTexture.height/8),this.SSR_Blend_Compute.workerSizeZ=1}}class Jg{static createSeeds(){let e=20,t=32,a=[new b(0,0,e)],r=0,i=.02;for(let n=1;n<t;n++){let o=new b;a.push(o),r+=1-(1-.618)*n/t,i+=n*.01,o.x=Math.sin(r)*i,o.y=Math.cos(r)*i,o.z=1-n/t,o.multiplyScalar(e)}return a}}class jg extends Jt{taaTexture;outTexture;rendererPassState;taaCompute;copyTexCompute;sharpCompute;taaSetting;preColorBuffer;preColorTex;preProjMatrix;preViewMatrix;rtFrame;constructor(){super()}onAttach(e){_.setting.render.postProcessing.taa.enable=!0,e.camera.enableJitterProjection(!0),this.createGUI()}onDetach(e){_.setting.render.postProcessing.taa.enable=!1,e.camera.enableJitterProjection(!1)}get jitterSeedCount(){return _.setting.render.postProcessing.taa.jitterSeedCount}set jitterSeedCount(e){e=Ae(e,2,32),e=Math.round(e);let t=_.setting.render.postProcessing.taa;t.jitterSeedCount=e}get blendFactor(){return _.setting.render.postProcessing.taa.blendFactor}set blendFactor(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.taa;t.blendFactor=e}get sharpFactor(){return _.setting.render.postProcessing.taa.sharpFactor}set sharpFactor(e){e=Ae(e,.1,.99);let t=_.setting.render.postProcessing.taa;t.sharpFactor=e}get sharpPreBlurFactor(){return _.setting.render.postProcessing.taa.sharpPreBlurFactor}set sharpPreBlurFactor(e){e=Ae(e,.1,.99);let t=_.setting.render.postProcessing.taa;t.sharpPreBlurFactor=e}get temporalJitterScale(){return _.setting.render.postProcessing.taa.temporalJitterScale}set temporalJitterScale(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.taa;t.temporalJitterScale=e}createGUI(){}createCompute(e){let t=new ye(sd),a=new yt(44),r=ve.getCameraGroup(e.camera);t.setUniformBuffer("globalUniform",r.uniformGPUBuffer),t.setUniformBuffer("taaData",a),t.setStorageBuffer("preColorBuffer",this.preColorBuffer);let i=_e.getGBufferFrame(_e.colorPass_GBuffer);t.setSamplerTexture("preColorTex",this.preColorTex),t.setSamplerTexture("gBufferTexture",i.getCompressGBufferTexture()),this.autoSetColorTexture("inTex",t),t.setStorageTexture("outTex",this.taaTexture),t.workerSizeX=Math.ceil(this.taaTexture.width/8),t.workerSizeY=Math.ceil(this.taaTexture.height/8),t.workerSizeZ=1,this.taaCompute=t,this.taaSetting=a,this.copyTexCompute=new ye(id),this.copyTexCompute.setStorageBuffer("preColor",this.preColorBuffer),this.copyTexCompute.setStorageTexture("preColorTex",this.preColorTex),this.copyTexCompute.workerSizeX=Math.ceil(this.taaTexture.width/8),this.copyTexCompute.workerSizeY=Math.ceil(this.taaTexture.height/8),this.copyTexCompute.workerSizeZ=1,this.sharpCompute=new ye(nd),this.sharpCompute.setUniformBuffer("taaData",a),this.sharpCompute.setSamplerTexture("inTex",this.taaTexture),this.sharpCompute.setStorageTexture("outTex",this.outTexture),this.sharpCompute.workerSizeX=Math.ceil(this.outTexture.width/8),this.sharpCompute.workerSizeY=Math.ceil(this.outTexture.height/8),this.sharpCompute.workerSizeZ=1}createResource(){this.preProjMatrix=new R().identity(),this.preViewMatrix=new R().identity();let[e,t]=w.presentationSize;this.preColorBuffer=new Te(e*t*4,GPUBufferUsage.COPY_SRC),this.preColorTex=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.preColorTex.name="taaTex";let a=new Ge;a.clearValue=[0,0,0,1],a.loadOp="clear",this.taaTexture=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.taaTexture.name="taaTex";let r=new Ge;r.clearValue=[0,0,0,1],r.loadOp="clear",this.outTexture=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.outTexture.name="sharpTaaTex";let i=new Ge;i.clearValue=[0,0,0,1],i.loadOp="clear",this.rtFrame=new rt([this.preColorTex,this.taaTexture,this.outTexture],[a,r,i])}render(e,t){this.taaCompute||(this.createResource(),this.createCompute(e),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null));let a=_.setting.render.postProcessing.taa;this.taaSetting.setMatrix("preProjMatrix",this.preProjMatrix),this.taaSetting.setMatrix("preViewMatrix",this.preViewMatrix),this.taaSetting.setFloat("jitterFrameIndex",e.camera.jitterFrameIndex),this.taaSetting.setFloat("blendFactor",a.blendFactor),this.taaSetting.setFloat("sharpFactor",a.sharpFactor),this.taaSetting.setFloat("sharpPreBlurFactor",a.sharpPreBlurFactor),this.taaSetting.setFloat("jitterX",e.camera.jitterX),this.taaSetting.setFloat("jitterY",e.camera.jitterY),this.taaSetting.apply(),F.computeCommand(t,[this.copyTexCompute,this.taaCompute,this.sharpCompute]),F.lastRenderPassState=this.rendererPassState,this.preProjMatrix.copyFrom(e.camera.projectionMatrix),this.preViewMatrix.copyFrom(e.camera.viewMatrix)}onResize(){let[e,t]=w.presentationSize;this.preColorBuffer.resizeBuffer(e*t*4),this.taaTexture.resize(e,t),this.outTexture.resize(e,t),this.preColorTex.resize(e,t),this.taaCompute.workerSizeX=Math.ceil(this.taaTexture.width/8),this.taaCompute.workerSizeY=Math.ceil(this.taaTexture.height/8),this.taaCompute.workerSizeZ=1,this.copyTexCompute.workerSizeX=Math.ceil(this.taaTexture.width/8),this.copyTexCompute.workerSizeY=Math.ceil(this.taaTexture.height/8),this.copyTexCompute.workerSizeZ=1,this.sharpCompute.workerSizeX=Math.ceil(this.outTexture.width/8),this.sharpCompute.workerSizeY=Math.ceil(this.outTexture.height/8),this.sharpCompute.workerSizeZ=1}}class bh{_tempIndexArray=[];setOutline(e,t){this.setOutlineList([e],t?[t]:null)}setOutlineList(e,t){e||=[];let a=ya.defaultColor,r=ya.SlotCount;for(let i=0;i<r;i++){this._tempIndexArray.length=0;let n=e[i],o=(t?t[i]:null)||a;if(n)for(const l of n)this.getEntityIdList(l,this._tempIndexArray);ya.fillDataAt(i,this._tempIndexArray,o)}}clearOutline(){return ya.clear(),this}_rendererList=[];getEntityIdList(e,t){this._rendererList.length=0;let a=e.getComponents(d.MeshRenderer,this._rendererList);for(const r of a)t.push(r.object3D.transform._worldMatrix.index)}}let Zg=new bh;class gh{localPosition=new b;worldPosition=new b;uv=new de;faceIndex;isIn=!1;t=0;u=0;v=0;triangle;v0;v1;v2;pickList;color}class fi{static EPS=1e-4;static FLT_MAX=3402823466e29;static distPtTri(e,t,a,r){let i=new b,n=new b,o=new b;r.subtract(t,i),a.subtract(t,n),e.subtract(t,o);let l=xt(i,i),c=xt(i,n),f=xt(i,o),h=xt(n,n),u=xt(n,o),g=1/(l*h-c*c),A=(h*f-c*u)*g,m=(l*u-c*f)*g;if(A>=-fi.EPS&&m>=-fi.EPS&&A+m<=1+fi.EPS){let p=t[1]+i[1]*A+n[1]*m;return Math.abs(p-e[1])}return fi.FLT_MAX}static _info=new gh;static IntersectTriangle(e,t,a){let r=t.v1,i=t.v2,n=t.v3,o=i.subtract(r,b.HELP_3),l=n.subtract(r,b.HELP_4),c=e.direction.crossProduct(l,b.HELP_5),f=xt(o,c),h;if(f>0){if(a)return null;h=e.origin.subtract(r,b.HELP_2)}else h=r.subtract(e.origin,b.HELP_2),f=-f;if(f<1e-4)return this._info.isIn=!1,this._info.t=0,this._info.u=0,this._info.v=0,this._info;let u=xt(h,c);if(u<0||u>f)return this._info.isIn=!1,this._info.t=0,this._info.u=0,this._info.v=0,this._info;let g=h.crossProduct(o,b.HELP_1),A=xt(e.direction,g);if(A<0||u+A>f)return this._info.isIn=!1,this._info.t=0,this._info.u=0,this._info.v=0,this._info;let m=xt(l,g),p=1/f;m*=p,u*=p,A*=p,this._info.isIn=!0,this._info.t=m,this._info.u=u,this._info.v=A;let D=1-u-A;return this._u0.copyFrom(t.u1),this._u0.scale(D),this._u1.copyFrom(t.u2),this._u1.scale(u),this._u2.copyFrom(t.u3),this._u2.scale(A),this._info.uv.copyFrom(this._u0),this._info.uv.add(this._u1,this._info.uv),this._info.uv.add(this._u2,this._info.uv),this._info.localPosition.copyFrom(e.direction).multiplyScalar(m),this._info.localPosition.add(e.origin,this._info.localPosition),this._info}static _u0=new de;static _u1=new de;static _u2=new de}class Tn extends Ja{static _instance;_maxRetry=3;loadAll(e,t){return new Promise((a,r)=>{let i=e.length,n=[];e.forEach((o,l)=>{let c=new t;this.load(o,t).then(f=>{c.parse(f),n.push(c),i--,i===0&&a(n)})})})}constructor(){if(super(),Tn._instance)throw new Error("LoadManager is singleton class...")}static getInstance(){return this._instance||(this._instance=new Tn)}loadUrls(e,t){return new Promise((a,r)=>{let i=e.length,n=[];e.forEach((o,l)=>{this.load(o,t).then(c=>{n.push(c),i--,i===0&&a(n),i<0&&console.error(`loadUrls ${e} error`)})})})}get maxRetry(){return this._maxRetry}set maxRetry(e){this._maxRetry=e}load(e,t){return new Promise((a,r)=>{t.format})}}function vo(s){const e=[1/0,1/0,1/0],t=[-1/0,-1/0,-1/0];for(let a=0;a<s.length;a+=3){const r=s[a+0],i=s[a+1],n=s[a+2];r<e[0]&&(e[0]=r),i<e[1]&&(e[1]=i),n<e[2]&&(e[2]=n),r>t[0]&&(t[0]=r),i>t[1]&&(t[1]=i),n>t[2]&&(t[2]=n)}return{min:e,max:t}}var di=(s=>(s.PLY="ply",s.SPLAT="splat",s.KSPLAT="ksplat",s.UNKNOWN="unknown",s))(di||{});function mh(s){if(s.byteLength<16)return"unknown";const e=new Uint8Array(s,0,Math.min(512,s.byteLength));return new TextDecoder("utf-8").decode(e).startsWith("ply")?"ply":"unknown"}var Br=(s=>(s[s.Splat=0]="Splat",s[s.PointCloud=1]="PointCloud",s[s.Mesh=2]="Mesh",s))(Br||{});const Uo=["x","y","z","scale_0","scale_1","scale_2","opacity","rot_0","rot_1","rot_2","rot_3"],ph=["red","green","blue","f_dc_0","f_dc_1","f_dc_2"];function da(s){switch(s){case"char":case"uchar":case"uint8":case"int8":return 1;case"short":case"ushort":case"int16":case"uint16":return 2;case"int":case"uint":case"int32":case"uint32":case"float":case"float32":return 4;case"double":case"float64":return 8;default:return 4}}function Be(s,e,t){switch(t){case"char":case"int8":return s.getInt8(e);case"uchar":case"uint8":return s.getUint8(e);case"short":case"int16":return s.getInt16(e,!0);case"ushort":case"uint16":return s.getUint16(e,!0);case"int":case"int32":return s.getInt32(e,!0);case"uint":case"uint32":return s.getUint32(e,!0);case"double":case"float64":return s.getFloat64(e,!0);case"float":case"float32":default:return s.getFloat32(e,!0)}}function yo(s){const e=Math.round(Math.sqrt(s));return Math.max(0,e-1)}function Xi(s){const e=new TextDecoder("utf-8").decode(new Uint8Array(s,0,Math.min(4096,s.byteLength)));if(!e.startsWith("ply"))throw new Error("PLY: Unsupported format. Expecting PLY file.");const t=e.indexOf(`end_header
|
|
11816
|
-
`);if(t<0)throw new Error("PLY: Invalid PLY header");const a=e.substring(0,t+11),r=a.split(/\r?\n/);let i="",n=0,o=0;const l=[],c=[],f=[];let h=!1,u=!1;for(const m of r)if(m.startsWith("format "))i=m.split(/\s+/)[1];else if(m.startsWith("comment TextureFile ")){const p=m.substring(20).trim();p&&f.push(p)}else if(m.startsWith("element ")){const p=m.split(/\s+/);h=p[1]==="vertex",u=p[1]==="face",h&&(n=parseInt(p[2]),u=!1),u&&(o=parseInt(p[2]),h=!1)}else if(h&&m.startsWith("property ")){const p=m.split(/\s+/),D=p[1],B=p[2];l.push({name:B,type:D})}else if(u&&m.startsWith("property ")){const p=m.split(/\s+/);if(p[1]==="list"){const D=p[2],B=p[3],v=p[4];c.push({name:v,type:`list ${D} ${B}`})}else{const D=p[1],B=p[2];c.push({name:B,type:D})}}if(i!=="binary_little_endian"&&i!=="ascii")throw new Error(`PLY: Unsupported format: ${i}. Only binary_little_endian and ascii are supported.`);let g=0,A=0;for(const m of l)Uo.includes(m.name)&&g++,ph.includes(m.name)&&A++;return{format:i,vertexCount:n,faceCount:o,properties:l,faceProperties:c.length>0?c:void 0,textureFiles:f,headerByteLength:a.length,mode:o?
|
|
11815
|
+
`;static _pipelineMax;static _pipelineMin;static createMipmap(e,t){const a=w.device;this._pipelineMax||=a.createComputePipeline({layout:"auto",compute:{module:a.createShaderModule({code:this.codeMax}),entryPoint:"main"}}),this._pipelineMin||=a.createComputePipeline({layout:"auto",compute:{module:a.createShaderModule({code:this.codeMin}),entryPoint:"main"}});let r=Math.ceil(e.width*.5),i=Math.ceil(e.height*.5),n={mipmapCount:t,texture:e,srcView:null,mipLevel:1,dstHeight:i,dstWidth:r};n.srcView=e.getGPUTexture().createView({format:e.format,dimension:"2d",baseMipLevel:0,mipLevelCount:1}),e.width>1024&&e.height>1024?this.mipmap(this._pipelineMax,n):this.mipmap(this._pipelineMin,n)}static mipmap(e,t){const a=w.device,r=F.beginCommandEncoder();let i=e==this._pipelineMax,n,o;for(let l=t.mipLevel;l<t.mipmapCount;l++){let c=[],f=0;c.push({binding:f++,resource:t.srcView}),c.push({binding:f++,resource:t.texture.gpuSampler}),n=t.texture.getGPUTexture().createView({format:t.texture.format,dimension:"2d",baseMipLevel:l,mipLevelCount:1}),c.push({binding:f++,resource:n});const h=a.createBindGroup({layout:e.getBindGroupLayout(0),entries:c}),u=r.beginComputePass();u.setPipeline(e),u.setBindGroup(0,h);let g=t.dstWidth,A=t.dstHeight;if(i&&(g=Math.max(1,Math.floor(t.dstWidth/8)),A=Math.max(1,Math.floor(t.dstHeight/8))),u.dispatchWorkgroups(g,A),t.dstHeight*=.5,t.dstWidth*=.5,t.srcView=n,t.mipLevel=l+1,o=i&&(t.dstWidth<8||t.dstHeight<8),u.end(),o)break}F.endCommandEncoder(r),o&&this.mipmap(this._pipelineMin,t)}}class ch{name="";passMap=new Map}class fh{passType="";shaderState=new Map;vertexShader="";fragmentShader=""}class Ig{static passKeyword="pass";static shaderKeyword="Shader";static vertexKeyword="vertex";static fragmentKeyword="fragment";static passTypeKeyword="PassType";static parser(e,t){e=ma.filterComment(e);let a=new ch,r=e.indexOf(this.shaderKeyword),i=e.indexOf("{",r),n=e.substring(r+this.shaderKeyword.length,i).trim();a.name=n.substring(1,n.length-1),n=e.substring(e.indexOf("{")+1,e.lastIndexOf("}"));let o=this.splitPassBlock(n);for(let l of o){let c=this.parserPassBlock(l),f;a.passMap.has(c.passType)?f=a.passMap.get(c.passType):(f=[],a.passMap.set(c.passType,f)),f.push(c),c.vertexShader.length>0&&(c.vertexShader=ma.parse(c.vertexShader,t)),c.fragmentShader.length>0&&(c.fragmentShader=ma.parse(c.fragmentShader,t))}return a}static splitPassBlock(e){let t=0,a=[];for(;t<e.length;){let r=e.indexOf(this.passKeyword,t);if(r==-1){a.push(e.substring(t));break}t!=0&&a.push(e.substring(t,r)),t=r+this.passKeyword.length}return a}static parserPassBlock(e){let t=new fh,a=e.indexOf(this.passTypeKeyword),r=e.indexOf('"',a);return a=e.indexOf('"',r+1),t.passType=e.substring(a+1,r).trim(),this.parserShaderState(t,e),a=e.indexOf(this.vertexKeyword),a!=-1&&(t.vertexShader=this.extractBlock(e.substring(a+this.vertexKeyword.length),"{","}")),a=e.indexOf(this.fragmentKeyword),a!=-1&&(t.fragmentShader=this.extractBlock(e.substring(a+this.fragmentKeyword.length),"{","}")),t}static parserShaderState(e,t){let a=t.indexOf("ShaderState");if(a==-1)return!1;a=t.indexOf("{",a);let r=t.indexOf("}",a),n=t.substring(a+1,r).split(",");for(let o of n){let l=o.split(":"),c=l[0].trim(),f=this.convertValue(l[1].trim());e.shaderState.set(c,f)}return!0}static convertValue(e){return e.length==4&&e.toLowerCase()=="true"?!0:e.length==5&&e.toLowerCase()=="false"?!1:e[0]=='"'?e.substring(1,e.length-1):Number.parseInt(e)}static extractBlock(e,t,a){let r=e.indexOf(t);if(r==-1)return"";let i=0,n=0;e=e.substring(r);for(let l of e){if(l==t?i++:l==a&&i--,i<=0)break;n++}return e.substring(1,n).trim()}}let dh=new bt("IrradianceDataReaderCompleteEvent");class Yi extends Ja{readFlag=!1;probeRenderer;opColorBuffer;opDepthBuffer;srcColorMap;srcDepthMap;opDepthArray;opColorArray;initReader(e,t,a){this.probeRenderer=e,this.srcColorMap=t,this.srcDepthMap=a;let r=_.setting.gi,i=r.octRTMaxSize*r.octRTMaxSize;this.opColorBuffer=w.device.createBuffer({size:i*4*4,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ,mappedAtCreation:!1}),this.opColorArray=new Float32Array(i*4),this.opDepthBuffer=w.device.createBuffer({size:i*4*4,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ,mappedAtCreation:!1}),this.opDepthArray=new Float32Array(i*4),this.probeRenderer.addEventListener(Es.type,()=>{this.onProbeRenderComplete()},this),this.probeRenderer.addEventListener(An.type,()=>{console.log("GIRenderStartEvent")},this)}async onProbeRenderComplete(){if(console.log("GIRenderCompleteEvent"),this.readFlag)console.log("irradianceDataReader is reading yet!!!");else{this.readFlag=!0;let e=Date.now();console.log("irradianceDataReader start reading "),await Yi.read(this.srcColorMap.getGPUTexture(),this.opColorBuffer,this.opColorArray),await Yi.read(this.srcDepthMap.getGPUTexture(),this.opDepthBuffer,this.opDepthArray),this.readFlag=!1,console.log("process time :",Date.now()-e),console.log("irradianceDataReader read complete"),this.dispatchEvent(dh)}}static async read(e,t,a){let r=F.beginCommandEncoder();r.copyTextureToBuffer({texture:e},{buffer:t,bytesPerRow:e.width*16},[e.width,e.height]),F.endCommandEncoder(r),await t.mapAsync(GPUMapMode.READ);const i=t.getMappedRange();a.set(new Float32Array(i),0),t.unmap()}}let Qg=new Yi;class Tg{computeShader;visibleBuffer;texture;constructor(){this.computeShader=new ye(hd),this.visibleBuffer=new ei(8192*2),this.computeShader.setStorageBuffer("visibleBuffer",this.visibleBuffer),this.texture=Et.getTexture(Qa.zBufferTexture_NAME),this.computeShader.setSamplerTexture("zBufferTexture",this.texture),this.computeShader.workerSizeX=Math.ceil(this.texture.width/8),this.computeShader.workerSizeY=Math.ceil(this.texture.height/8),this.computeShader.workerSizeZ=1}compute(e,t){this.visibleBuffer.reset(!0,0),this.visibleBuffer.apply();let a=F.beginCommandEncoder();F.computeCommand(a,[this.computeShader]),this.visibleBuffer.readBuffer(),t.zVisibleList=this.visibleBuffer.outFloat32Array}}class Mg extends Jt{RT_BloomUp;RT_BloomDown;RT_threshold;rendererPassState;thresholdCompute;downSampleComputes;upSampleComputes;postCompute;bloomSetting;rtFrame;constructor(){super()}onAttach(e){_.setting.render.postProcessing.bloom.enable=!0,this.createGUI()}onDetach(e){_.setting.render.postProcessing.bloom.enable=!1,this.removeGUI()}createGUI(){}removeGUI(){}get downSampleBlurSize(){return _.setting.render.postProcessing.bloom.downSampleBlurSize}set downSampleBlurSize(e){_.setting.render.postProcessing.bloom.downSampleBlurSize=e}get downSampleBlurSigma(){return _.setting.render.postProcessing.bloom.downSampleBlurSigma}set downSampleBlurSigma(e){_.setting.render.postProcessing.bloom.downSampleBlurSigma=e}get upSampleBlurSize(){return _.setting.render.postProcessing.bloom.upSampleBlurSize}set upSampleBlurSize(e){_.setting.render.postProcessing.bloom.upSampleBlurSize=e}get upSampleBlurSigma(){return _.setting.render.postProcessing.bloom.upSampleBlurSigma}set upSampleBlurSigma(e){_.setting.render.postProcessing.bloom.upSampleBlurSigma=e}get luminanceThreshole(){return _.setting.render.postProcessing.bloom.luminanceThreshole}set luminanceThreshole(e){_.setting.render.postProcessing.bloom.luminanceThreshole=e}get bloomIntensity(){return _.setting.render.postProcessing.bloom.bloomIntensity}set bloomIntensity(e){_.setting.render.postProcessing.bloom.bloomIntensity=e}get hdr(){return _.setting.render.postProcessing.bloom.hdr}set hdr(e){_.setting.render.postProcessing.bloom.hdr=e}createThreshouldCompute(){this.thresholdCompute=new ye(Gf),this.autoSetColorTexture("inTex",this.thresholdCompute),this.thresholdCompute.setStorageTexture("outTex",this.RT_threshold),this.thresholdCompute.setUniformBuffer("bloomCfg",this.bloomSetting),this.thresholdCompute.workerSizeX=Math.ceil(this.RT_threshold.width/8),this.thresholdCompute.workerSizeY=Math.ceil(this.RT_threshold.height/8),this.thresholdCompute.workerSizeZ=1}createDownSampleComputes(){const t=_.setting.render.postProcessing.bloom.downSampleStep;this.downSampleComputes=[];for(let a=0;a<t;a++){let r=new ye(zf),i=this.RT_BloomDown[a],n=a==0?this.RT_threshold:this.RT_BloomDown[a-1];r.setSamplerTexture("inTex",n),r.setStorageTexture("outTex",i),r.setUniformBuffer("bloomCfg",this.bloomSetting),r.workerSizeX=Math.ceil(i.width/8),r.workerSizeY=Math.ceil(i.height/8),r.workerSizeZ=1,this.downSampleComputes.push(r)}}createUpSampleComputes(){const t=_.setting.render.postProcessing.bloom.downSampleStep;this.upSampleComputes=[];{let a=new ye(lo),r=this.RT_BloomUp[0],i=this.RT_BloomDown[t-2];a.setSamplerTexture("_MainTex",i),a.setSamplerTexture("_PrevMip",this.RT_BloomDown[t-1]),a.setStorageTexture("outTex",r),a.setUniformBuffer("bloomCfg",this.bloomSetting),a.workerSizeX=Math.ceil(r.width/8),a.workerSizeY=Math.ceil(r.height/8),a.workerSizeZ=1,this.upSampleComputes.push(a)}for(let a=1;a<t-1;a++){let r=new ye(lo),i=this.RT_BloomUp[a],n=this.RT_BloomDown[t-2-a];r.setSamplerTexture("_MainTex",n),r.setSamplerTexture("_PrevMip",this.RT_BloomUp[a-1]),r.setStorageTexture("outTex",i),r.setUniformBuffer("bloomCfg",this.bloomSetting),r.workerSizeX=Math.ceil(i.width/8),r.workerSizeY=Math.ceil(i.height/8),r.workerSizeZ=1,this.upSampleComputes.push(r)}}createPostCompute(){const t=_.setting.render.postProcessing.bloom.downSampleStep;this.postCompute=new ye(Wf),this.autoSetColorTexture("_MainTex",this.postCompute),this.postCompute.setSamplerTexture("_BloomTex",this.RT_BloomUp[t-2]),this.postCompute.setStorageTexture("outTex",this.RT_threshold),this.postCompute.setUniformBuffer("bloomCfg",this.bloomSetting),this.postCompute.workerSizeX=Math.ceil(this.RT_threshold.width/8),this.postCompute.workerSizeY=Math.ceil(this.RT_threshold.height/8),this.postCompute.workerSizeZ=1}createResource(){let e=_.setting.render.postProcessing.bloom;this.bloomSetting=new yt(8);let[t,a]=w.presentationSize,r=GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING;this.RT_threshold=new we(t,a,se.rgba16float,!1,r);const i=e.downSampleStep;{this.RT_BloomDown=[];let o=Math.ceil(t/4),l=Math.ceil(a/4);for(let c=0;c<i;c++)this.RT_BloomDown[c]=new we(o,l,se.rgba16float,!1,r),o=Math.ceil(o/2),l=Math.ceil(l/2)}{this.RT_BloomUp=[];for(let o=0;o<i-1;o++){let l=this.RT_BloomDown[i-2-o].width,c=this.RT_BloomDown[i-2-o].height;this.RT_BloomUp[o]=new we(l,c,se.rgba16float,!1,r)}}let n=new Ge;n.loadOp="load",this.rtFrame=new rt([this.RT_threshold],[n])}render(e,t){this.thresholdCompute||(this.createResource(),this.createThreshouldCompute(),this.createDownSampleComputes(),this.createUpSampleComputes(),this.createPostCompute(),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="Bloom");let a=_.setting.render.postProcessing.bloom;this.bloomSetting.setFloat("downSampleStep",a.downSampleStep),this.bloomSetting.setFloat("downSampleBlurSize",a.downSampleBlurSize),this.bloomSetting.setFloat("downSampleBlurSigma",a.downSampleBlurSigma),this.bloomSetting.setFloat("upSampleBlurSize",a.upSampleBlurSize),this.bloomSetting.setFloat("upSampleBlurSigma",a.upSampleBlurSigma),this.bloomSetting.setFloat("luminanceThreshole",a.luminanceThreshole),this.bloomSetting.setFloat("bloomIntensity",a.bloomIntensity),this.bloomSetting.setFloat("hdr",a.hdr),this.bloomSetting.apply(),F.computeCommand(t,[this.thresholdCompute,...this.downSampleComputes,...this.upSampleComputes,this.postCompute]),F.lastRenderPassState=this.rendererPassState}onResize(){let e=_.setting.render.postProcessing.bloom,[t,a]=w.presentationSize;this.RT_threshold.resize(t,a);const r=e.downSampleStep;let i=Math.ceil(t/4),n=Math.ceil(a/4);for(let o=0;o<r;o++)this.RT_BloomDown[o].resize(i,n),i=Math.ceil(i/2),n=Math.ceil(n/2);for(let o=0;o<r-1;o++){let l=this.RT_BloomDown[r-2-o].width,c=this.RT_BloomDown[r-2-o].height;this.RT_BloomUp[o].resize(l,c)}this.thresholdCompute.workerSizeX=Math.ceil(this.RT_threshold.width/8),this.thresholdCompute.workerSizeY=Math.ceil(this.RT_threshold.height/8),this.thresholdCompute.workerSizeZ=1;for(let o=0;o<r;o++){let l=this.downSampleComputes[o],c=this.RT_BloomDown[o];l.workerSizeX=Math.ceil(c.width/8),l.workerSizeY=Math.ceil(c.height/8),l.workerSizeZ=1}{let o=this.RT_BloomUp[0],l=this.upSampleComputes[0];l.workerSizeX=Math.ceil(o.width/8),l.workerSizeY=Math.ceil(o.height/8),l.workerSizeZ=1}for(let o=1;o<r-1;o++){let l=this.RT_BloomUp[o],c=this.upSampleComputes[o];c.workerSizeX=Math.ceil(l.width/8),c.workerSizeY=Math.ceil(l.height/8),c.workerSizeZ=1}this.postCompute.workerSizeX=Math.ceil(this.RT_threshold.width/8),this.postCompute.workerSizeY=Math.ceil(this.RT_threshold.height/8),this.postCompute.workerSizeZ=1}}class Ng extends Jt{blurTexture1;blurTexture2;rendererPassState;blurComputes;blurSettings;outTexture;rtFrame;constructor(){super()}onAttach(e){_.setting.render.postProcessing.depthOfView.enable=!0}onDetach(e){_.setting.render.postProcessing.depthOfView.enable=!1}get pixelOffset(){return _.setting.render.postProcessing.depthOfView.pixelOffset}set pixelOffset(e){e=Math.max(0,e);let t=_.setting.render.postProcessing.depthOfView;t.pixelOffset=e}get near(){return _.setting.render.postProcessing.depthOfView.near}set near(e){e=Math.max(0,e);let t=_.setting.render.postProcessing.depthOfView;t.near=e}get far(){return _.setting.render.postProcessing.depthOfView.far}set far(e){e=Math.max(0,e);let t=_.setting.render.postProcessing.depthOfView;t.far=e}createBlurCompute(){this.blurSettings=[],this.blurComputes=[];let e=_.setting.render.postProcessing.depthOfView;for(let t=0;t<e.iterationCount;t++){let a=new yt(4),r=new ye(Jf);this.blurComputes.push(r),this.blurSettings.push(a),r.setUniformBuffer("blurSetting",a);let i=_e.getGBufferFrame(_e.colorPass_GBuffer);r.setSamplerTexture("gBufferTexture",i.getCompressGBufferTexture());let n=t%2==0?this.blurTexture1:this.blurTexture2,o=t%2==1?this.blurTexture1:this.blurTexture2;r.setSamplerTexture("inTex",n),r.setStorageTexture("outTex",o),r.workerSizeX=Math.ceil(this.blurTexture1.width/8),r.workerSizeY=Math.ceil(this.blurTexture1.height/8),r.workerSizeZ=1,this.outTexture=o}}createResource(){let e=w.presentationSize,t=e[0],a=e[1];this.blurTexture1=new we(t,a,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.blurTexture1.name="dof1";let r=new Ge;r.clearValue=[0,0,0,1],r.loadOp="clear",this.blurTexture2=new we(t,a,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.blurTexture2.name="dof2";let i=new Ge;i.clearValue=[0,0,0,1],i.loadOp="clear",this.rtFrame=new rt([this.blurTexture1,this.blurTexture2],[r,i])}render(e,t){if(!this.blurComputes){this.createResource(),this.createBlurCompute();let r=ve.getCameraGroup(e.camera);for(let i=0;i<this.blurComputes.length;i++)this.blurComputes[i].setUniformBuffer("globalUniform",r.uniformGPUBuffer);this.rendererPassState=Je.createRendererPassState(this.rtFrame,null)}this.autoSetColorTexture("inTex",this.blurComputes[0]);let a=_.setting.render.postProcessing.depthOfView;a.far=Math.max(a.near,a.far)+1e-4;for(let r=0;r<a.iterationCount;r++){let i=this.blurComputes[r],n=this.blurSettings[r];n.setFloat("near",a.near),n.setFloat("far",a.far),n.setFloat("pixelOffset",(r+1)*a.pixelOffset),n.apply(),i.setStorageBuffer("blurSetting",n)}F.computeCommand(t,this.blurComputes),F.lastRenderPassState=this.rendererPassState}onResize(){let e=w.presentationSize,t=e[0],a=e[1],r=_.setting.render.postProcessing.depthOfView;r.far=Math.max(r.near,r.far)+1e-4,this.blurTexture1.resize(t,a),this.blurTexture2.resize(t,a);for(let i=0;i<r.iterationCount;i++){let n=this.blurComputes[i];n.workerSizeX=Math.ceil(this.blurTexture1.width/8),n.workerSizeY=Math.ceil(this.blurTexture1.height/8),n.workerSizeZ=1}}}class Pg extends Jt{outTexture;rendererPassState;rtFrame;view;gBufferTexture;testCompute;_state=0;_state1=256;_state2=256;uniformBuffer;currentRenderTexture;constructor(){super()}onAttach(e){this.view=e}onDetach(e){}set state(e){this._state=e,this.uniformBuffer.setInt32("state",e),this.uniformBuffer.apply()}get state(){return this._state}set size1(e){this._state1=e,this.uniformBuffer.setInt32("state1",e),this.uniformBuffer.apply()}get size1(){return this._state1}set size2(e){this._state2=e,this.uniformBuffer.setInt32("state2",e),this.uniformBuffer.apply()}get size2(){return this._state2}createResource(){let e=_e.getGBufferFrame("ColorPassGBuffer");this.currentRenderTexture=e.getColorTexture(),this.gBufferTexture=e.getCompressGBufferTexture();let[t,a]=w.presentationSize;this.outTexture=new we(t,a,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.outTexture.name="outTexture";let r=new Ge;r.loadOp="load",this.rtFrame=new rt([this.outTexture],[r])}createCompute(){this.uniformBuffer=new yt(4),this.uniformBuffer.setInt32("state",this._state);let e=ve.getCameraGroup(this.view.camera),a=_e.getGBufferFrame("ColorPassGBuffer").getCompressGBufferTexture(),r=_.setting.reflectionSetting,n=_e.getGBufferFrame(_e.reflections_GBuffer,r.width,r.height).getCompressGBufferTexture(),o=_.renderJobs.get(this.view).reflectionRenderer.outTexture;this.testCompute=new ye(cd),this.testCompute.setUniformBuffer("globalUniform",e.uniformGPUBuffer),this.testCompute.setUniformBuffer("uniformData",this.uniformBuffer),this.testCompute.setSamplerTexture("gBufferTexture",a),this.testCompute.setSamplerTexture("currentRenderTexture",this.currentRenderTexture),this.testCompute.setSamplerTexture("reflectionsGBufferTexture",n),this.testCompute.setSamplerTexture("envMap",o),this.testCompute.setStorageTexture("outputTexture",this.outTexture),this.testCompute.workerSizeX=Math.ceil(this.outTexture.width/16),this.testCompute.workerSizeY=Math.ceil(this.outTexture.height/16),this.testCompute.workerSizeZ=1}render(e,t){}compute(e){this.testCompute||(this.createResource(),this.createCompute(),this.onResize(),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="test");let t=F.beginCommandEncoder();F.computeCommand(t,[this.testCompute]),F.endCommandEncoder(t),F.lastRenderPassState=this.rendererPassState}onResize(){let[e,t]=w.presentationSize;this.outTexture.resize(e,t),this.testCompute.workerSizeX=Math.ceil(this.outTexture.width/16),this.testCompute.workerSizeY=Math.ceil(this.outTexture.height/16)}}class Vg extends Jt{gtaoTexture;rendererPassState;gtaoCompute;gtaoSetting;aoBuffer;directionsBuffer;directionsArray;rtFrame;constructor(){super()}onAttach(e){_.setting.render.postProcessing.gtao.enable=!0}Render;onDetach(e){_.setting.render.postProcessing.gtao.enable=!1}get maxDistance(){return _.setting.render.postProcessing.gtao.maxDistance}set maxDistance(e){e=Ae(e,.1,50);let t=_.setting.render.postProcessing.gtao;t.maxDistance=e}get maxPixel(){return _.setting.render.postProcessing.gtao.maxPixel}set maxPixel(e){e=Ae(e,5,100);let t=_.setting.render.postProcessing.gtao;t.maxPixel=e}get darkFactor(){return _.setting.render.postProcessing.gtao.darkFactor}set darkFactor(e){e=Ae(e,.01,1);let t=_.setting.render.postProcessing.gtao;t.darkFactor=e}get rayMarchSegment(){return _.setting.render.postProcessing.gtao.rayMarchSegment}set rayMarchSegment(e){e=Ae(e,4,10);let t=_.setting.render.postProcessing.gtao;t.rayMarchSegment=e}get multiBounce(){return _.setting.render.postProcessing.gtao.multiBounce}set multiBounce(e){let t=_.setting.render.postProcessing.gtao;t.multiBounce=e}get blendColor(){return _.setting.render.postProcessing.gtao.blendColor}set blendColor(e){let t=_.setting.render.postProcessing.gtao;t.blendColor=e}get usePosFloat32(){return _.setting.render.postProcessing.gtao.usePosFloat32}set usePosFloat32(e){let t=_.setting.render.postProcessing.gtao;t.usePosFloat32=e}createCompute(){this.gtaoCompute=new ye(jf);let e=new yt(8);this.gtaoCompute.setUniformBuffer("gtaoData",e),this.directionsArray=new Float32Array(16),this.directionsBuffer=new Te(16),this.directionsBuffer.setFloat32Array("array",this.randomDirection()),this.directionsBuffer.apply(),this.gtaoCompute.setStorageBuffer("directions",this.directionsBuffer),this.aoBuffer=new Te(this.gtaoTexture.width*this.gtaoTexture.height),this.gtaoCompute.setStorageBuffer("aoBuffer",this.aoBuffer);let t=_e.getGBufferFrame(_e.colorPass_GBuffer);this.gtaoCompute.setSamplerTexture("gBufferTexture",t.getCompressGBufferTexture()),this.autoSetColorTexture("inTex",this.gtaoCompute),this.gtaoCompute.setStorageTexture("outTex",this.gtaoTexture),this.gtaoSetting=e}createResource(){let[e,t]=w.presentationSize;this.gtaoTexture=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.gtaoTexture.name="gtaoTex";let a=new Ge;a.loadOp="load",this.rtFrame=new rt([this.gtaoTexture],[a])}randomCount=0;randomDirection(){this.randomCount=0;let e=Math.PI*2*this.randomCount/16,t=Math.PI*2/8;for(let a=0;a<8;a++){let r=e+a*t;this.directionsArray[a*2]=Math.sin(r),this.directionsArray[a*2+1]=Math.cos(r)}return this.directionsArray}render(e,t){if(!this.gtaoCompute){this.createResource(),this.createCompute(),this.onResize(),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="GTAO";let l=ve.getCameraGroup(e.camera);this.gtaoCompute.setUniformBuffer("globalUniform",l.uniformGPUBuffer)}let a=_.setting.render.postProcessing.gtao;this.directionsBuffer.setFloat32Array("array",this.randomDirection()),this.directionsBuffer.apply();let r=1-.2*(Le.frame%2),i=a.maxDistance*r,n=a.maxPixel*r;this.gtaoSetting.setFloat("maxDistance",i),this.gtaoSetting.setFloat("maxPixel",n),this.gtaoSetting.setFloat("darkFactor",a.darkFactor),this.gtaoSetting.setFloat("rayMarchSegment",a.rayMarchSegment);let o=e.camera;this.gtaoSetting.setFloat("cameraNear",o.near),this.gtaoSetting.setFloat("cameraFar",o.far),this.gtaoSetting.setFloat("multiBounce",a.multiBounce?1:0),this.gtaoSetting.setFloat("blendColor",a.blendColor?1:0),this.gtaoSetting.apply(),F.computeCommand(t,[this.gtaoCompute]),F.lastRenderPassState=this.rendererPassState}onResize(){let[e,t]=w.presentationSize;this.gtaoTexture.resize(e,t),this.gtaoCompute.workerSizeX=Math.ceil(this.gtaoTexture.width/8),this.gtaoCompute.workerSizeY=Math.ceil(this.gtaoTexture.height/8),this.gtaoCompute.workerSizeZ=1}}class Og extends Jt{fogSetting;fogOpTexture;fogCompute;fogUniform;rendererPassState;constructor(){super(),this.fogSetting=_.setting.render.postProcessing.globalFog}createCompute(e){Y.register("GlobalFog_shader",co),this.fogCompute=new ye(co),this.fogUniform=new yt(20),this.fogCompute.setUniformBuffer("fogUniform",this.fogUniform);let t=_e.getGBufferFrame(_e.colorPass_GBuffer);this.fogCompute.setSamplerTexture("gBufferTexture",t.getCompressGBufferTexture()),this.fogCompute.setSamplerTexture("inTex",t.getColorTexture()),this._lastSkyTexture=this.getSkyTexture(),this.fogCompute.setSamplerTexture("prefilterMap",this._lastSkyTexture),this.fogCompute.setStorageTexture("outTex",this.fogOpTexture),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="FOG";let a=ve.getLightEntries(e.scene);this.fogCompute.setStorageBuffer("lightBuffer",a.storageGPUBuffer)}uploadSetting(){let e=this.fogUniform,t=this.fogSetting;e.setColor("fogColor",t.fogColor),e.setFloat("fogType",t.fogType),e.setFloat("fogHeightScale",t.fogHeightScale),e.setFloat("start",t.start),e.setFloat("end",t.end),e.setFloat("density",t.density),e.setFloat("ins",t.ins),e.setFloat("falloff",t.falloff),e.setFloat("rayLength",t.rayLength),e.setFloat("scatteringExponent",t.scatteringExponent),e.setFloat("dirHeightLine",t.dirHeightLine),e.setFloat("skyFactor",t.skyFactor),e.setFloat("skyRoughness",t.skyRoughness),e.setFloat("overrideSkyFactor",t.overrideSkyFactor),e.setFloat("isSkyHDR",0),e.apply(),this.fogCompute.setUniformBuffer("fogUniform",this.fogUniform)}rtFrame;createResource(){let[e,t]=w.presentationSize;this.fogOpTexture=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.fogOpTexture.name="fogTex";let a=new Ge;a.loadOp="load",this.rtFrame=new rt([this.fogOpTexture],[a])}onAttach(e){_.setting.render.postProcessing.globalFog.enable=!0}onDetach(e){_.setting.render.postProcessing.globalFog.enable=!1}set fogType(e){this.fogSetting.fogType=e}get fogType(){return this.fogSetting.fogType}set fogHeightScale(e){this.fogSetting.fogHeightScale=e}get fogHeightScale(){return this.fogSetting.fogHeightScale}set start(e){this.fogSetting.start=e}get start(){return this.fogSetting.start}set end(e){this.fogSetting.end=e}get end(){return this.fogSetting.end}set ins(e){this.fogSetting.ins=e}get ins(){return this.fogSetting.ins}set density(e){this.fogSetting.density=e}get density(){return this.fogSetting.density}set skyRoughness(e){this.fogSetting.skyRoughness=e}get skyRoughness(){return this.fogSetting.skyRoughness}set skyFactor(e){this.fogSetting.skyFactor=e}get skyFactor(){return this.fogSetting.skyFactor}set overrideSkyFactor(e){this.fogSetting.overrideSkyFactor=e}get overrideSkyFactor(){return this.fogSetting.overrideSkyFactor}get fogColor(){return this.fogSetting.fogColor}set fogColor(e){this.fogSetting.fogColor.copyFrom(e)}set falloff(e){this.fogSetting.falloff=e}get falloff(){return this.fogSetting.falloff}set rayLength(e){this.fogSetting.rayLength=e}get rayLength(){return this.fogSetting.rayLength}set scatteringExponent(e){this.fogSetting.scatteringExponent=e}get scatteringExponent(){return this.fogSetting.scatteringExponent}set dirHeightLine(e){this.fogSetting.dirHeightLine=e}get dirHeightLine(){return this.fogSetting.dirHeightLine}_lastSkyTexture;getSkyTexture(){let e=_.res.defaultSky;return K.instance.sky instanceof Fn&&(e=K.instance.sky.map),e}render(e,t){if(!this.fogCompute){this.createResource(),this.createCompute(e),this.onResize();let r=ve.getCameraGroup(e.camera);this.fogCompute.setUniformBuffer("globalUniform",r.uniformGPUBuffer)}let a=this.getSkyTexture();a!=this._lastSkyTexture&&(this._lastSkyTexture=a,this.fogCompute.setSamplerTexture("prefilterMap",this._lastSkyTexture)),this.fogCompute.setUniformFloat("isSkyHDR",a.isHDRTexture?1:0),this.uploadSetting(),F.computeCommand(t,[this.fogCompute]),F.lastRenderPassState=this.rendererPassState}onResize(){let[e,t]=w.presentationSize;this.fogOpTexture.resize(e,t),this.fogCompute.workerSizeX=Math.ceil(this.fogOpTexture.width/8),this.fogCompute.workerSizeY=Math.ceil(this.fogOpTexture.height/8),this.fogCompute.workerSizeZ=1}}class Lg extends Jt{godRayTexture;rendererPassState;godRayCompute;historyGodRayData;godRaySetting;rtFrame;constructor(){super()}onAttach(e){_.setting.render.postProcessing.godRay.enable=!0,this.createGUI()}Render;onDetach(e){_.setting.render.postProcessing.godRay.enable=!1,this.removeGUI()}get blendColor(){return _.setting.render.postProcessing.godRay.blendColor}set blendColor(e){_.setting.render.postProcessing.godRay.blendColor=e}get rayMarchCount(){return _.setting.render.postProcessing.godRay.rayMarchCount}set rayMarchCount(e){e=Ae(e,8,20),_.setting.render.postProcessing.godRay.rayMarchCount=e}get scatteringExponent(){return _.setting.render.postProcessing.godRay.scatteringExponent}set scatteringExponent(e){e=Ae(e,1,40),_.setting.render.postProcessing.godRay.scatteringExponent=e}get intensity(){return _.setting.render.postProcessing.godRay.intensity}set intensity(e){e=Ae(e,.01,5),_.setting.render.postProcessing.godRay.intensity=e}createGUI(){}removeGUI(){}createCompute(e){this.godRayCompute=new ye(Zf);let t=new yt(12);this.godRayCompute.setUniformBuffer("godRayUniform",t),this.historyGodRayData=new Te(4*this.godRayTexture.width*this.godRayTexture.height),this.godRayCompute.setStorageBuffer("historyGodRayData",this.historyGodRayData);let a=_e.getGBufferFrame(_e.colorPass_GBuffer);this.godRayCompute.setSamplerTexture("gBufferTexture",a.getCompressGBufferTexture()),this.autoSetColorTexture("inTex",this.godRayCompute),this.godRayCompute.setStorageTexture("outTex",this.godRayTexture);let r=_.getRenderJob(e).shadowMapPassRenderer;this.godRayCompute.setSamplerTexture("shadowMap",r.depth2DArrayTexture),this.godRaySetting=t,this.onResize()}createResource(){let e=w.presentationSize,[t,a]=e;this.godRayTexture=new we(t,a,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.godRayTexture.name="godRayTexture";let r=new Ge;r.loadOp="load",this.rtFrame=new rt([this.godRayTexture],[r])}onResize(){let e=w.presentationSize,[t,a]=e;this.godRayTexture.resize(t,a),this.historyGodRayData.resizeBuffer(4*this.godRayTexture.width*this.godRayTexture.height),this.godRayCompute.setStorageBuffer("historyGodRayData",this.historyGodRayData),this.godRayCompute.workerSizeX=Math.ceil(this.godRayTexture.width/8),this.godRayCompute.workerSizeY=Math.ceil(this.godRayTexture.height/8),this.godRayCompute.workerSizeZ=1}render(e,t){if(!this.godRayCompute){this.createResource(),this.createCompute(e);let o=ve.getLightEntries(e.scene);this.godRayCompute.setStorageBuffer("lightBuffer",o.storageGPUBuffer),this.godRayCompute.setStorageBuffer("models",ve.modelMatrixBindGroup.matrixBufferDst),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="GodRay";let l=ve.getCameraGroup(e.camera);this.godRayCompute.setUniformBuffer("globalUniform",l.uniformGPUBuffer)}let a=_.setting.render.postProcessing.godRay;this.godRaySetting.setFloat("intensity",a.intensity),this.godRaySetting.setFloat("rayMarchCount",a.rayMarchCount);let r=w.presentationSize,[i,n]=r;this.godRaySetting.setFloat("viewPortWidth",i),this.godRaySetting.setFloat("viewPortHeight",n),this.godRaySetting.setFloat("blendColor",a.blendColor?1:0),this.godRaySetting.setFloat("scatteringExponent",a.scatteringExponent),this.godRaySetting.apply(),F.computeCommand(t,[this.godRayCompute]),F.lastRenderPassState=this.rendererPassState}}class hh{indexList;color;count}class uh{SlotCount=8;MaxEntities=16;defaultColor=new J(.2,1,1,1);slots=[];dataDirty=!0;constructor(){let e=_.setting.render.postProcessing.outline.groupCount;this.SlotCount=Math.max(1,Math.min(e,this.SlotCount));for(let t=0;t<this.SlotCount;t++){let a=this.slots[t]=new hh;a.indexList=new Float32Array(this.MaxEntities),a.color=this.defaultColor.clone(),a.count=0}}clear(){for(let e=0;e<this.SlotCount;e++)this.clearAt(e)}clearAt(e){this.dataDirty=!0;let t=this.slots[e];return t.color.copyFrom(this.defaultColor),t.indexList.fill(-1),t.count=0,this}fillDataAt(e,t,a){this.dataDirty=!0;let r=this.slots[e];if(r){r.indexList.fill(-1);for(let i=0,n=t.length;i<n;i++)r.indexList[i]=t[i];r.count=t.length,r.color.copyFrom(a)}return this}fetchData(e){return e.dirty=this.dataDirty,e.slots=this.slots,this.dataDirty=!1,this}}let ya=new uh;class Gg extends Jt{outlineTex;lowTex;rendererPassState;calcWeightCompute;outlineCompute;blendCompute;outlineSetting;slotsBuffer;slotsArray;entitiesArray;entitiesBuffer;weightBuffer;lowTexSize;oldOutlineColor;rtFrame;view;constructor(){super()}onAttach(e){this.view=e,_.setting.render.postProcessing.outline.enable=!0}onDetach(e){_.setting.render.postProcessing.outline.enable=!1}set outlinePixel(e){e=Ae(e,0,8);let t=_.setting.render.postProcessing.outline;t.outlinePixel!=e&&(t.outlinePixel=e)}get outlinePixel(){return _.setting.render.postProcessing.outline.outlinePixel}set fadeOutlinePixel(e){let t=_.setting.render.postProcessing.outline;e=Ae(e,0,8),t.fadeOutlinePixel!=e&&(t.fadeOutlinePixel=e)}get fadeOutlinePixel(){return _.setting.render.postProcessing.outline.fadeOutlinePixel}set strength(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.outline;t.strength!=e&&(t.strength=e)}get strength(){return _.setting.render.postProcessing.outline.strength}set useAddMode(e){_.setting.render.postProcessing.outline.useAddMode=e}get useAddMode(){return _.setting.render.postProcessing.outline.useAddMode}createGUI(){}createCompute(){let e=_e.getGBufferFrame(_e.colorPass_GBuffer);this.calcWeightCompute=new ye(Hf);let t=ve.getCameraGroup(this.view.camera);this.calcWeightCompute.setUniformBuffer("globalUniform",t.uniformGPUBuffer),this.calcWeightCompute.setStorageBuffer("outlineSetting",this.outlineSetting),this.calcWeightCompute.setStorageBuffer("slotsBuffer",this.slotsBuffer),this.calcWeightCompute.setStorageBuffer("weightBuffer",this.weightBuffer),this.calcWeightCompute.setStorageBuffer("entitiesBuffer",this.entitiesBuffer),this.calcWeightCompute.setSamplerTexture("gBufferTexture",e.getCompressGBufferTexture()),this.calcWeightCompute.workerSizeX=Math.ceil(this.lowTex.width/8),this.calcWeightCompute.workerSizeY=Math.ceil(this.lowTex.height/8),this.calcWeightCompute.workerSizeZ=1,this.outlineCompute=new ye(Kf),this.outlineCompute.setStorageBuffer("outlineSetting",this.outlineSetting),this.outlineCompute.setStorageBuffer("slotsBuffer",this.slotsBuffer),this.outlineCompute.setStorageBuffer("weightBuffer",this.weightBuffer),this.outlineCompute.setStorageBuffer("oldOutlineColor",this.oldOutlineColor),this.outlineCompute.setStorageTexture("lowTex",this.lowTex),this.outlineCompute.workerSizeX=Math.ceil(this.lowTex.width/8),this.outlineCompute.workerSizeY=Math.ceil(this.lowTex.height/8),this.outlineCompute.workerSizeZ=1,this.blendCompute=new ye(Xf),this.blendCompute.setStorageBuffer("outlineSetting",this.outlineSetting),this.autoSetColorTexture("inTex",this.blendCompute),this.blendCompute.setSamplerTexture("lowTex",this.lowTex),this.blendCompute.setStorageTexture("outlineTex",this.outlineTex),this.blendCompute.workerSizeX=Math.ceil(this.outlineTex.width/8),this.blendCompute.workerSizeY=Math.ceil(this.outlineTex.height/8),this.blendCompute.workerSizeZ=1}createResource(){let e=w.presentationSize,t=e[0],a=e[1],r=_.setting.render.postProcessing.outline.textureScale;this.lowTexSize=new de(Math.ceil(t*r),Math.ceil(a*r)),this.lowTex=new we(this.lowTexSize.x,this.lowTexSize.y,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.lowTex.name="lowTex";let i=new Ge;i.clearValue=[0,0,0,1],i.loadOp="clear",this.outlineTex=new we(t,a,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.outlineTex.name="outlineTex";let n=new Ge;n.clearValue=[0,0,0,1],n.loadOp="clear",this.rtFrame=new rt([this.outlineTex],[n]),this.outlineSetting=new yt(8),this.weightBuffer=new Te(this.lowTexSize.x*this.lowTexSize.y*4,GPUBufferUsage.COPY_SRC),this.oldOutlineColor=new Te(this.lowTexSize.x*this.lowTexSize.y*4,GPUBufferUsage.COPY_SRC),this.slotsArray=new Float32Array(ya.SlotCount*4),this.slotsBuffer=new Te(this.slotsArray.length),this.slotsBuffer.setFloat32Array("slotsArray",this.slotsArray),this.slotsBuffer.apply(),this.entitiesArray=new Float32Array(ya.SlotCount*ya.MaxEntities),this.entitiesBuffer=new Te(this.entitiesArray.length),this.entitiesBuffer.setFloat32Array("entitiesArray",this.entitiesArray),this.slotsBuffer.apply(),this.fetchData||={}}fetchData;fetchOutlineData(){if(ya.fetchData(this.fetchData),this.fetchData.dirty){let e=ya.SlotCount,t=ya.MaxEntities;for(let a=0;a<e;a++){let r=4*a,i=this.fetchData.slots[a];this.slotsArray[r+0]=i.color.r,this.slotsArray[r+1]=i.color.g,this.slotsArray[r+2]=i.color.b,this.slotsArray[r+3]=i.count,r=t*a,this.entitiesArray.set(i.indexList,r)}this.slotsBuffer.setFloat32Array("slotsArray",this.slotsArray),this.slotsBuffer.apply(),this.entitiesBuffer.setFloat32Array("entitiesArray",this.entitiesArray),this.entitiesBuffer.apply()}}computeList;render(e,t){this.calcWeightCompute||(this.createResource(),this.createCompute(),this.createGUI(),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null)),this.computeList||=[this.calcWeightCompute,this.outlineCompute,this.blendCompute];let a=_.setting.render.postProcessing.outline;this.outlineSetting.setFloat("strength",a.strength),this.outlineSetting.setFloat("useAddMode",a.useAddMode?1:0),this.outlineSetting.setFloat("outlinePixel",a.outlinePixel),this.outlineSetting.setFloat("fadeOutlinePixel",a.fadeOutlinePixel),this.outlineSetting.setFloat("lowTexWidth",this.lowTexSize.x),this.outlineSetting.setFloat("lowTexHeight",this.lowTexSize.y),this.outlineSetting.apply(),this.fetchOutlineData(),F.computeCommand(t,this.computeList),F.lastRenderPassState=this.rendererPassState}onResize(){let e=w.presentationSize,t=e[0],a=e[1],r=_.setting.render.postProcessing.outline.textureScale;this.lowTexSize=new de(Math.ceil(t*r),Math.ceil(a*r)),this.lowTex.resize(this.lowTexSize.x,this.lowTexSize.y),this.outlineTex.resize(t,a),this.weightBuffer.resizeBuffer(this.lowTexSize.x*this.lowTexSize.y*4),this.oldOutlineColor.resizeBuffer(this.lowTexSize.x*this.lowTexSize.y*4),this.calcWeightCompute.workerSizeX=Math.ceil(this.lowTex.width/8),this.calcWeightCompute.workerSizeY=Math.ceil(this.lowTex.height/8),this.calcWeightCompute.workerSizeZ=1,this.outlineCompute.workerSizeX=Math.ceil(this.lowTex.width/8),this.outlineCompute.workerSizeY=Math.ceil(this.lowTex.height/8),this.outlineCompute.workerSizeZ=1,this.blendCompute.workerSizeX=Math.ceil(this.outlineTex.width/8),this.blendCompute.workerSizeY=Math.ceil(this.outlineTex.height/8),this.blendCompute.workerSizeZ=1}}class zg extends Jt{outTexture;newTexture;oldTexture;combineTexture;rendererPassState;ssgiCompute;delayCompute;combineCompute;rtFrame;textureScaleSmallCompute;textureScaleBigCompute;view;colorTexture;posTexture;normalTexture;gBufferTexture;lastPosTexture;downSampleCofe=1;debugChanal="0";updateBuffer;constructor(){super(),this.updateBuffer=new Te(32),this.updateBuffer.setFloat("frameCount",10),this.updateBuffer.setFloat("indirectIns",1.5),this.updateBuffer.setFloat("delay",.02),this.updateBuffer.setFloat("colorIns",1),this.updateBuffer.setFloat("d1",.03),this.updateBuffer.apply()}onAttach(e){this.view=e,e.camera.transform.onPositionChange=e.camera.transform.onPositionChange?nn(e.camera.transform.onPositionChange,(t,a)=>this.onCameraChange(t,a)):(t,a)=>this.onCameraChange(t,a)}onCameraChange(e,t){console.log("a");let a=b.distance(e,t);a=Math.min(.45,a)+.01,this.updateBuffer.setFloat("delay",a)}Render;onDetach(e){}set ins(e){this.updateBuffer.setFloat("indirectIns",e),this.updateBuffer.apply()}get ins(){return this.updateBuffer.getFloat("indirectIns")}set delay(e){this.updateBuffer.setFloat("delay",e),this.updateBuffer.apply()}get delay(){return this.updateBuffer.getFloat("delay")}set colorIns(e){this.updateBuffer.setFloat("colorIns",e),this.updateBuffer.apply()}get colorIns(){return this.updateBuffer.getFloat("colorIns")}set frameCount(e){this.updateBuffer.setFloat("frameCount",e),this.updateBuffer.apply()}get frameCount(){return this.updateBuffer.getFloat("frameCount")}set d1(e){this.updateBuffer.setFloat("d1",e),this.updateBuffer.apply()}get d1(){return this.updateBuffer.getFloat("d1")}createResource(){let e=_e.getGBufferFrame("ColorPassGBuffer");this.gBufferTexture=e.getCompressGBufferTexture();let t=w.presentationSize,a=t[0],r=t[1];this.lastPosTexture=new we(a,r,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.lastPosTexture.name="lastPosTexture",this.outTexture=new we(a,r,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.outTexture.name="outTexture";let i=Math.floor(a*this.downSampleCofe),n=Math.floor(r*this.downSampleCofe);this.newTexture=new we(i,n,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.newTexture.name="newTexture",this.oldTexture=new we(i,n,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.oldTexture.name="oldTexture",this.combineTexture=new we(i,n,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.combineTexture.name="combineTexture";let o=new Ge;o.loadOp="load",this.rtFrame=new rt([this.outTexture],[o])}createCompute(){this.ssgiCompute=new ye(ed),this.delayCompute=new ye(ld),this.combineCompute=new ye(od);let e=ve.getCameraGroup(this.view.camera);this.ssgiCompute.setSamplerTexture("gBufferTexture",this.gBufferTexture),this.ssgiCompute.setSamplerTexture("combineTexture",this.combineTexture),this.ssgiCompute.setSamplerTexture("oldTexture",this.oldTexture),this.ssgiCompute.setStorageTexture("newTexture",this.newTexture),this.ssgiCompute.setUniformBuffer("globalUniform",e.uniformGPUBuffer),this.ssgiCompute.setStorageBuffer("updateBuffer",this.updateBuffer),this.autoSetColorTexture("inTex",this.ssgiCompute),this.delayCompute.setSamplerTexture("newTexture",this.newTexture),this.delayCompute.setSamplerTexture("oldTexture",this.oldTexture),this.delayCompute.setStorageTexture("combineTexture",this.combineTexture),this.delayCompute.setStorageBuffer("updateBuffer",this.updateBuffer),this.combineCompute.setSamplerTexture("inputBTexture",this.combineTexture),this.combineCompute.setSamplerTexture("gBufferTexture",this.gBufferTexture),this.combineCompute.setUniformBuffer("globalUniform",e.uniformGPUBuffer),this.combineCompute.setStorageTexture("outTexture",this.outTexture),this.combineCompute.setStorageBuffer("updateBuffer",this.updateBuffer),this.textureScaleBigCompute=new sh,this.textureScaleBigCompute.setInputes(null,[this.combineTexture],[this.outTexture])}render(e,t){}frame=0;compute(e){this.ssgiCompute||(this.createResource(),this.createCompute(),this.onResize(),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null),this.rendererPassState.label="SSGI"),this.frameCount=this.frame,this.frame++;let t=F.beginCommandEncoder();switch(parseInt(this.debugChanal)){case 0:F.copyTexture(t,this.combineTexture,this.oldTexture),F.computeCommand(t,[this.ssgiCompute,this.delayCompute,this.combineCompute]);break;case 1:F.copyTexture(t,this.posTexture,this.lastPosTexture),F.copyTexture(t,this.lastPosTexture,this.outTexture);break;case 2:F.copyTexture(t,this.normalTexture,this.outTexture);break;case 3:F.copyTexture(t,this.posTexture,this.outTexture);break;case 4:F.copyTexture(t,this.colorTexture,this.outTexture);break;case 5:F.copyTexture(t,this.gBufferTexture,this.outTexture);break}F.lastRenderPassState=this.rendererPassState,this.updateBuffer.setFloat("delay",.01)}onResize(){let e=w.presentationSize,t=e[0],a=e[1];this.outTexture.resize(t,a),this.ssgiCompute.workerSizeX=Math.ceil(this.newTexture.width/16),this.ssgiCompute.workerSizeY=Math.ceil(this.newTexture.height/16),this.ssgiCompute.workerSizeZ=1,this.delayCompute.workerSizeX=Math.ceil(this.combineTexture.width/16),this.delayCompute.workerSizeY=Math.ceil(this.combineTexture.height/16),this.delayCompute.workerSizeZ=1,this.combineCompute.workerSizeX=Math.ceil(this.outTexture.width/16),this.combineCompute.workerSizeY=Math.ceil(this.outTexture.height/16),this.combineCompute.workerSizeZ=1}}class Wg extends Jt{SSR_RayTraceCompute;SSR_IS_Compute;SSR_Blend_Compute;isRetTexture;finalTexture;rendererPassState;ssrUniformBuffer;rayTraceData;ssrColorData;rtFrame;historyPosition;view;onAttach(e){this.view=e,_.setting.render.postProcessing.ssr.enable=!0}onDetach(e){_.setting.render.postProcessing.ssr.enable=!1}reflectionRatio=.5;get fadeEdgeRatio(){return _.setting.render.postProcessing.ssr.fadeEdgeRatio}set fadeEdgeRatio(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.ssr;t.fadeEdgeRatio=e}get rayMarchRatio(){return _.setting.render.postProcessing.ssr.rayMarchRatio}set rayMarchRatio(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.ssr;t.rayMarchRatio=e}get roughnessThreshold(){return _.setting.render.postProcessing.ssr.roughnessThreshold}set roughnessThreshold(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.ssr;t.roughnessThreshold=e}get fadeDistanceMin(){return _.setting.render.postProcessing.ssr.fadeDistanceMin}set fadeDistanceMin(e){e=Ae(e,0,1e4);let t=_.setting.render.postProcessing.ssr;t.fadeDistanceMin=e}get fadeDistanceMax(){return _.setting.render.postProcessing.ssr.fadeDistanceMax}set fadeDistanceMax(e){e=Ae(e,0,1e4);let t=_.setting.render.postProcessing.ssr;t.fadeDistanceMax=e}get powDotRN(){return _.setting.render.postProcessing.ssr.powDotRN}set powDotRN(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.ssr;t.powDotRN=e}createRayTraceShader(){let e=ve.getCameraGroup(this.view.camera);this.SSR_RayTraceCompute=new ye(rd),this.SSR_RayTraceCompute.setUniformBuffer("globalUniform",e.uniformGPUBuffer),this.SSR_RayTraceCompute.setUniformBuffer("ssrUniform",this.ssrUniformBuffer),this.SSR_RayTraceCompute.setStorageBuffer("rayTraceBuffer",this.rayTraceData),this.SSR_RayTraceCompute.setStorageBuffer("historyPosition",this.historyPosition);let a=_e.getGBufferFrame("ColorPassGBuffer").getCompressGBufferTexture();this.SSR_RayTraceCompute.setSamplerTexture("gBufferTexture",a),K.instance.sky instanceof Fn&&this.SSR_RayTraceCompute.setSamplerTexture("prefilterMap",K.instance.sky.map),this.SSR_RayTraceCompute.workerSizeX=Math.ceil(this.isRetTexture.width/8),this.SSR_RayTraceCompute.workerSizeY=Math.ceil(this.isRetTexture.height/8),this.SSR_RayTraceCompute.workerSizeZ=1}createISShader(){this.SSR_IS_Compute=new ye(ad),this.SSR_IS_Compute.setStorageBuffer("ssrUniform",this.ssrUniformBuffer),this.SSR_IS_Compute.setStorageBuffer("rayTraceBuffer",this.rayTraceData),this.SSR_IS_Compute.setStorageBuffer("ssrColorData",this.ssrColorData),this.SSR_IS_Compute.setStorageBuffer("historyPosition",this.historyPosition),this.SSR_IS_Compute.setSamplerTexture("colorMap",this.getOutTexture()),this.SSR_IS_Compute.setStorageTexture("outTex",this.isRetTexture),this.SSR_IS_Compute.workerSizeX=Math.ceil(this.isRetTexture.width/8),this.SSR_IS_Compute.workerSizeY=Math.ceil(this.isRetTexture.height/8),this.SSR_IS_Compute.workerSizeZ=1}createBlendShader(e){let t=ve.getCameraGroup(this.view.camera);this.SSR_Blend_Compute=new ye(td),this.SSR_Blend_Compute.setStorageBuffer("rayTraceBuffer",this.rayTraceData),this.SSR_Blend_Compute.setUniformBuffer("globalUniform",t.uniformGPUBuffer);let r=_e.getGBufferFrame("ColorPassGBuffer").getCompressGBufferTexture();this.SSR_Blend_Compute.setSamplerTexture("gBufferTexture",r),this.SSR_Blend_Compute.setSamplerTexture("colorMap",this.getOutTexture()),this.SSR_Blend_Compute.setSamplerTexture("ssrMap",e),this.SSR_Blend_Compute.setStorageTexture("outTex",this.finalTexture),this.SSR_Blend_Compute.workerSizeX=Math.ceil(this.finalTexture.width/8),this.SSR_Blend_Compute.workerSizeY=Math.ceil(this.finalTexture.height/8),this.SSR_Blend_Compute.workerSizeZ=1}createResource(){let[e,t]=w.presentationSize;this.finalTexture=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING),this.finalTexture.name="ssrOutTex";let a=new Ge;a.clearValue=[0,0,0,0],a.loadOp="clear";let r=Math.ceil(e*_.setting.render.postProcessing.ssr.pixelRatio),i=Math.ceil(t*_.setting.render.postProcessing.ssr.pixelRatio);this.isRetTexture=new we(r,i,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.TEXTURE_BINDING),this.isRetTexture.name="ssrTextureIn";let n=new Ge;n.clearValue=[0,0,0,0],n.loadOp="clear",this.rtFrame=new rt([this.finalTexture,this.isRetTexture],[a,n]),this.rayTraceData=new Te(r*i*8,GPUBufferUsage.COPY_SRC),this.ssrColorData=new Te(r*i*4,GPUBufferUsage.COPY_SRC),this.historyPosition=new Te(r*i*4,GPUBufferUsage.COPY_SRC),this.ssrUniformBuffer=new yt(32),this.ssrUniformBuffer.setFloat("ssrBufferSizeX",this.isRetTexture.width),this.ssrUniformBuffer.setFloat("ssrBufferSizeY",this.isRetTexture.height),this.ssrUniformBuffer.setFloat("colorMapSizeX",this.finalTexture.width),this.ssrUniformBuffer.setFloat("colorMapSizeY",this.finalTexture.height),this.ssrUniformBuffer.apply()}render(e,t){if(!this.SSR_RayTraceCompute){this.createResource(),this.createISShader(),this.createRayTraceShader(),this.createBlendShader(this.isRetTexture),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null);let i=ve.getCameraGroup(e.camera);this.SSR_RayTraceCompute.setUniformBuffer("standUniform",i.uniformGPUBuffer)}let a=_.setting.render.postProcessing.ssr;this.ssrUniformBuffer.setFloat("fadeEdgeRatio",a.fadeEdgeRatio),this.ssrUniformBuffer.setFloat("rayMarchRatio",a.rayMarchRatio),this.ssrUniformBuffer.setFloat("fadeDistanceMin",a.fadeDistanceMin),this.ssrUniformBuffer.setFloat("fadeDistanceMax",a.fadeDistanceMax),this.ssrUniformBuffer.setFloat("mixThreshold",a.mixThreshold),this.ssrUniformBuffer.setFloat("roughnessThreshold",a.roughnessThreshold),this.ssrUniformBuffer.setFloat("reflectionRatio",this.reflectionRatio),this.ssrUniformBuffer.setFloat("powDotRN",a.powDotRN),this.ssrUniformBuffer.setFloat("randomSeedX",Math.random()),this.ssrUniformBuffer.setFloat("randomSeedY",Math.random()),this.ssrUniformBuffer.apply();let r=[this.SSR_RayTraceCompute,this.SSR_IS_Compute,this.SSR_Blend_Compute];F.computeCommand(t,r),F.lastRenderPassState=this.rendererPassState}onResize(){let[e,t]=w.presentationSize,a=Math.ceil(e*_.setting.render.postProcessing.ssr.pixelRatio),r=Math.ceil(t*_.setting.render.postProcessing.ssr.pixelRatio);this.finalTexture.resize(e,t),this.isRetTexture.resize(a,r),this.rayTraceData.resizeBuffer(a*r*8),this.ssrColorData.resizeBuffer(a*r*4),this.historyPosition.resizeBuffer(a*r*4),this.ssrUniformBuffer.setFloat("ssrBufferSizeX",this.isRetTexture.width),this.ssrUniformBuffer.setFloat("ssrBufferSizeY",this.isRetTexture.height),this.ssrUniformBuffer.setFloat("colorMapSizeX",this.finalTexture.width),this.ssrUniformBuffer.setFloat("colorMapSizeY",this.finalTexture.height),this.SSR_RayTraceCompute.workerSizeX=Math.ceil(this.isRetTexture.width/8),this.SSR_RayTraceCompute.workerSizeY=Math.ceil(this.isRetTexture.height/8),this.SSR_RayTraceCompute.workerSizeZ=1,this.SSR_IS_Compute.workerSizeX=Math.ceil(this.isRetTexture.width/8),this.SSR_IS_Compute.workerSizeY=Math.ceil(this.isRetTexture.height/8),this.SSR_IS_Compute.workerSizeZ=1,this.SSR_Blend_Compute.workerSizeX=Math.ceil(this.finalTexture.width/8),this.SSR_Blend_Compute.workerSizeY=Math.ceil(this.finalTexture.height/8),this.SSR_Blend_Compute.workerSizeZ=1}}class Jg{static createSeeds(){let e=20,t=32,a=[new b(0,0,e)],r=0,i=.02;for(let n=1;n<t;n++){let o=new b;a.push(o),r+=1-(1-.618)*n/t,i+=n*.01,o.x=Math.sin(r)*i,o.y=Math.cos(r)*i,o.z=1-n/t,o.multiplyScalar(e)}return a}}class jg extends Jt{taaTexture;outTexture;rendererPassState;taaCompute;copyTexCompute;sharpCompute;taaSetting;preColorBuffer;preColorTex;preProjMatrix;preViewMatrix;rtFrame;constructor(){super()}onAttach(e){_.setting.render.postProcessing.taa.enable=!0,e.camera.enableJitterProjection(!0),this.createGUI()}onDetach(e){_.setting.render.postProcessing.taa.enable=!1,e.camera.enableJitterProjection(!1)}get jitterSeedCount(){return _.setting.render.postProcessing.taa.jitterSeedCount}set jitterSeedCount(e){e=Ae(e,2,32),e=Math.round(e);let t=_.setting.render.postProcessing.taa;t.jitterSeedCount=e}get blendFactor(){return _.setting.render.postProcessing.taa.blendFactor}set blendFactor(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.taa;t.blendFactor=e}get sharpFactor(){return _.setting.render.postProcessing.taa.sharpFactor}set sharpFactor(e){e=Ae(e,.1,.99);let t=_.setting.render.postProcessing.taa;t.sharpFactor=e}get sharpPreBlurFactor(){return _.setting.render.postProcessing.taa.sharpPreBlurFactor}set sharpPreBlurFactor(e){e=Ae(e,.1,.99);let t=_.setting.render.postProcessing.taa;t.sharpPreBlurFactor=e}get temporalJitterScale(){return _.setting.render.postProcessing.taa.temporalJitterScale}set temporalJitterScale(e){e=Ae(e,0,1);let t=_.setting.render.postProcessing.taa;t.temporalJitterScale=e}createGUI(){}createCompute(e){let t=new ye(sd),a=new yt(44),r=ve.getCameraGroup(e.camera);t.setUniformBuffer("globalUniform",r.uniformGPUBuffer),t.setUniformBuffer("taaData",a),t.setStorageBuffer("preColorBuffer",this.preColorBuffer);let i=_e.getGBufferFrame(_e.colorPass_GBuffer);t.setSamplerTexture("preColorTex",this.preColorTex),t.setSamplerTexture("gBufferTexture",i.getCompressGBufferTexture()),this.autoSetColorTexture("inTex",t),t.setStorageTexture("outTex",this.taaTexture),t.workerSizeX=Math.ceil(this.taaTexture.width/8),t.workerSizeY=Math.ceil(this.taaTexture.height/8),t.workerSizeZ=1,this.taaCompute=t,this.taaSetting=a,this.copyTexCompute=new ye(id),this.copyTexCompute.setStorageBuffer("preColor",this.preColorBuffer),this.copyTexCompute.setStorageTexture("preColorTex",this.preColorTex),this.copyTexCompute.workerSizeX=Math.ceil(this.taaTexture.width/8),this.copyTexCompute.workerSizeY=Math.ceil(this.taaTexture.height/8),this.copyTexCompute.workerSizeZ=1,this.sharpCompute=new ye(nd),this.sharpCompute.setUniformBuffer("taaData",a),this.sharpCompute.setSamplerTexture("inTex",this.taaTexture),this.sharpCompute.setStorageTexture("outTex",this.outTexture),this.sharpCompute.workerSizeX=Math.ceil(this.outTexture.width/8),this.sharpCompute.workerSizeY=Math.ceil(this.outTexture.height/8),this.sharpCompute.workerSizeZ=1}createResource(){this.preProjMatrix=new R().identity(),this.preViewMatrix=new R().identity();let[e,t]=w.presentationSize;this.preColorBuffer=new Te(e*t*4,GPUBufferUsage.COPY_SRC),this.preColorTex=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.preColorTex.name="taaTex";let a=new Ge;a.clearValue=[0,0,0,1],a.loadOp="clear",this.taaTexture=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.taaTexture.name="taaTex";let r=new Ge;r.clearValue=[0,0,0,1],r.loadOp="clear",this.outTexture=new we(e,t,se.rgba16float,!1,GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC|GPUTextureUsage.TEXTURE_BINDING),this.outTexture.name="sharpTaaTex";let i=new Ge;i.clearValue=[0,0,0,1],i.loadOp="clear",this.rtFrame=new rt([this.preColorTex,this.taaTexture,this.outTexture],[a,r,i])}render(e,t){this.taaCompute||(this.createResource(),this.createCompute(e),this.rendererPassState=Je.createRendererPassState(this.rtFrame,null));let a=_.setting.render.postProcessing.taa;this.taaSetting.setMatrix("preProjMatrix",this.preProjMatrix),this.taaSetting.setMatrix("preViewMatrix",this.preViewMatrix),this.taaSetting.setFloat("jitterFrameIndex",e.camera.jitterFrameIndex),this.taaSetting.setFloat("blendFactor",a.blendFactor),this.taaSetting.setFloat("sharpFactor",a.sharpFactor),this.taaSetting.setFloat("sharpPreBlurFactor",a.sharpPreBlurFactor),this.taaSetting.setFloat("jitterX",e.camera.jitterX),this.taaSetting.setFloat("jitterY",e.camera.jitterY),this.taaSetting.apply(),F.computeCommand(t,[this.copyTexCompute,this.taaCompute,this.sharpCompute]),F.lastRenderPassState=this.rendererPassState,this.preProjMatrix.copyFrom(e.camera.projectionMatrix),this.preViewMatrix.copyFrom(e.camera.viewMatrix)}onResize(){let[e,t]=w.presentationSize;this.preColorBuffer.resizeBuffer(e*t*4),this.taaTexture.resize(e,t),this.outTexture.resize(e,t),this.preColorTex.resize(e,t),this.taaCompute.workerSizeX=Math.ceil(this.taaTexture.width/8),this.taaCompute.workerSizeY=Math.ceil(this.taaTexture.height/8),this.taaCompute.workerSizeZ=1,this.copyTexCompute.workerSizeX=Math.ceil(this.taaTexture.width/8),this.copyTexCompute.workerSizeY=Math.ceil(this.taaTexture.height/8),this.copyTexCompute.workerSizeZ=1,this.sharpCompute.workerSizeX=Math.ceil(this.outTexture.width/8),this.sharpCompute.workerSizeY=Math.ceil(this.outTexture.height/8),this.sharpCompute.workerSizeZ=1}}class bh{_tempIndexArray=[];setOutline(e,t){this.setOutlineList([e],t?[t]:null)}setOutlineList(e,t){e||=[];let a=ya.defaultColor,r=ya.SlotCount;for(let i=0;i<r;i++){this._tempIndexArray.length=0;let n=e[i],o=(t?t[i]:null)||a;if(n)for(const l of n)this.getEntityIdList(l,this._tempIndexArray);ya.fillDataAt(i,this._tempIndexArray,o)}}clearOutline(){return ya.clear(),this}_rendererList=[];getEntityIdList(e,t){this._rendererList.length=0;let a=e.getComponents(d.MeshRenderer,this._rendererList);for(const r of a)t.push(r.object3D.transform._worldMatrix.index)}}let Zg=new bh;class gh{localPosition=new b;worldPosition=new b;uv=new de;faceIndex;isIn=!1;t=0;u=0;v=0;triangle;v0;v1;v2;pickList;color}class fi{static EPS=1e-4;static FLT_MAX=3402823466e29;static distPtTri(e,t,a,r){let i=new b,n=new b,o=new b;r.subtract(t,i),a.subtract(t,n),e.subtract(t,o);let l=xt(i,i),c=xt(i,n),f=xt(i,o),h=xt(n,n),u=xt(n,o),g=1/(l*h-c*c),A=(h*f-c*u)*g,m=(l*u-c*f)*g;if(A>=-fi.EPS&&m>=-fi.EPS&&A+m<=1+fi.EPS){let p=t[1]+i[1]*A+n[1]*m;return Math.abs(p-e[1])}return fi.FLT_MAX}static _info=new gh;static IntersectTriangle(e,t,a){let r=t.v1,i=t.v2,n=t.v3,o=i.subtract(r,b.HELP_3),l=n.subtract(r,b.HELP_4),c=e.direction.crossProduct(l,b.HELP_5),f=xt(o,c),h;if(f>0){if(a)return null;h=e.origin.subtract(r,b.HELP_2)}else h=r.subtract(e.origin,b.HELP_2),f=-f;if(f<1e-4)return this._info.isIn=!1,this._info.t=0,this._info.u=0,this._info.v=0,this._info;let u=xt(h,c);if(u<0||u>f)return this._info.isIn=!1,this._info.t=0,this._info.u=0,this._info.v=0,this._info;let g=h.crossProduct(o,b.HELP_1),A=xt(e.direction,g);if(A<0||u+A>f)return this._info.isIn=!1,this._info.t=0,this._info.u=0,this._info.v=0,this._info;let m=xt(l,g),p=1/f;m*=p,u*=p,A*=p,this._info.isIn=!0,this._info.t=m,this._info.u=u,this._info.v=A;let D=1-u-A;return this._u0.copyFrom(t.u1),this._u0.scale(D),this._u1.copyFrom(t.u2),this._u1.scale(u),this._u2.copyFrom(t.u3),this._u2.scale(A),this._info.uv.copyFrom(this._u0),this._info.uv.add(this._u1,this._info.uv),this._info.uv.add(this._u2,this._info.uv),this._info.localPosition.copyFrom(e.direction).multiplyScalar(m),this._info.localPosition.add(e.origin,this._info.localPosition),this._info}static _u0=new de;static _u1=new de;static _u2=new de}class Tn extends Ja{static _instance;_maxRetry=3;loadAll(e,t){return new Promise((a,r)=>{let i=e.length,n=[];e.forEach((o,l)=>{let c=new t;this.load(o,t).then(f=>{c.parse(f),n.push(c),i--,i===0&&a(n)})})})}constructor(){if(super(),Tn._instance)throw new Error("LoadManager is singleton class...")}static getInstance(){return this._instance||(this._instance=new Tn)}loadUrls(e,t){return new Promise((a,r)=>{let i=e.length,n=[];e.forEach((o,l)=>{this.load(o,t).then(c=>{n.push(c),i--,i===0&&a(n),i<0&&console.error(`loadUrls ${e} error`)})})})}get maxRetry(){return this._maxRetry}set maxRetry(e){this._maxRetry=e}load(e,t){return new Promise((a,r)=>{t.format})}}function vo(s){const e=[1/0,1/0,1/0],t=[-1/0,-1/0,-1/0];for(let a=0;a<s.length;a+=3){const r=s[a+0],i=s[a+1],n=s[a+2];r<e[0]&&(e[0]=r),i<e[1]&&(e[1]=i),n<e[2]&&(e[2]=n),r>t[0]&&(t[0]=r),i>t[1]&&(t[1]=i),n>t[2]&&(t[2]=n)}return{min:e,max:t}}var di=(s=>(s.PLY="ply",s.SPLAT="splat",s.KSPLAT="ksplat",s.UNKNOWN="unknown",s))(di||{});function mh(s){if(s.byteLength<16)return"unknown";const e=new Uint8Array(s,0,Math.min(512,s.byteLength));return new TextDecoder("utf-8").decode(e).startsWith("ply")?"ply":"unknown"}var _r=(s=>(s[s.Splat=0]="Splat",s[s.PointCloud=1]="PointCloud",s[s.Mesh=2]="Mesh",s))(_r||{});const Uo=["x","y","z","scale_0","scale_1","scale_2","opacity","rot_0","rot_1","rot_2","rot_3"],ph=["red","green","blue","f_dc_0","f_dc_1","f_dc_2"];function da(s){switch(s){case"char":case"uchar":case"uint8":case"int8":return 1;case"short":case"ushort":case"int16":case"uint16":return 2;case"int":case"uint":case"int32":case"uint32":case"float":case"float32":return 4;case"double":case"float64":return 8;default:return 4}}function Be(s,e,t){switch(t){case"char":case"int8":return s.getInt8(e);case"uchar":case"uint8":return s.getUint8(e);case"short":case"int16":return s.getInt16(e,!0);case"ushort":case"uint16":return s.getUint16(e,!0);case"int":case"int32":return s.getInt32(e,!0);case"uint":case"uint32":return s.getUint32(e,!0);case"double":case"float64":return s.getFloat64(e,!0);case"float":case"float32":default:return s.getFloat32(e,!0)}}function yo(s){const e=Math.round(Math.sqrt(s));return Math.max(0,e-1)}function Xi(s){const e=new TextDecoder("utf-8").decode(new Uint8Array(s,0,Math.min(4096,s.byteLength)));if(!e.startsWith("ply"))throw new Error("PLY: Unsupported format. Expecting PLY file.");const t=e.indexOf(`end_header
|
|
11816
|
+
`);if(t<0)throw new Error("PLY: Invalid PLY header");const a=e.substring(0,t+11),r=a.split(/\r?\n/);let i="",n=0,o=0;const l=[],c=[],f=[];let h=!1,u=!1;for(const m of r)if(m.startsWith("format "))i=m.split(/\s+/)[1];else if(m.startsWith("comment TextureFile ")){const p=m.substring(20).trim();p&&f.push(p)}else if(m.startsWith("element ")){const p=m.split(/\s+/);h=p[1]==="vertex",u=p[1]==="face",h&&(n=parseInt(p[2]),u=!1),u&&(o=parseInt(p[2]),h=!1)}else if(h&&m.startsWith("property ")){const p=m.split(/\s+/),D=p[1],B=p[2];l.push({name:B,type:D})}else if(u&&m.startsWith("property ")){const p=m.split(/\s+/);if(p[1]==="list"){const D=p[2],B=p[3],v=p[4];c.push({name:v,type:`list ${D} ${B}`})}else{const D=p[1],B=p[2];c.push({name:B,type:D})}}if(i!=="binary_little_endian"&&i!=="ascii")throw new Error(`PLY: Unsupported format: ${i}. Only binary_little_endian and ascii are supported.`);let g=0,A=0;for(const m of l)Uo.includes(m.name)&&g++,ph.includes(m.name)&&A++;return{format:i,vertexCount:n,faceCount:o,properties:l,faceProperties:c.length>0?c:void 0,textureFiles:f,headerByteLength:a.length,mode:o?_r.Mesh:g===Uo.length&&A===3?_r.Splat:_r.PointCloud}}function Co(s){const e=Xi(s),{format:t}=e;return t==="ascii"?Xg(s,e):Yg(s,e)}function Yg(s,e){const{vertexCount:t,properties:a,headerByteLength:r}=e,i=new DataView(s,r),n=C=>a.find(y=>y.name===C)!=null,o=C=>a.findIndex(y=>y.name===C),l=new Float32Array(t*3),c=n("scale_0")?new Float32Array(t*3):void 0,f=n("rot_0")?new Float32Array(t*4):void 0,h=n("opacity")?new Float32Array(t):void 0,u=[o("f_dc_0"),o("f_dc_1"),o("f_dc_2")],g=[];for(let C=0;C<a.length;C++)a[C].name.startsWith("f_rest_")&&g.push(C);const A=u[0]>=0&&u[1]>=0&&u[2]>=0;let m,p=0;if(A){const C=1+g.length/3;p=yo(C),m=new Float32Array(t*C*3)}const D=[];let B=0;for(const C of a)D.push(B),B+=da(C.type);let v=0;for(let C=0;C<t;C++){const y=v,x=o("x"),k=o("y"),E=o("z");if(x<0||k<0||E<0)throw new Error("PLY: Missing x/y/z for vertex");if(l[C*3+0]=Be(i,y+D[x],a[x].type),l[C*3+1]=Be(i,y+D[k],a[k].type),l[C*3+2]=Be(i,y+D[E],a[E].type),c){const S=o("scale_0"),Q=o("scale_1"),I=o("scale_2");c[C*3+0]=Be(i,y+D[S],a[S].type),c[C*3+1]=Be(i,y+D[Q],a[Q].type),c[C*3+2]=Be(i,y+D[I],a[I].type)}if(f){const S=o("rot_0"),Q=o("rot_1"),I=o("rot_2"),T=o("rot_3"),M=Be(i,y+D[S],a[S].type),Z=Be(i,y+D[Q],a[Q].type),be=Be(i,y+D[I],a[I].type),re=Be(i,y+D[T],a[T].type);f[C*4+0]=Z,f[C*4+1]=be,f[C*4+2]=re,f[C*4+3]=M}if(h){const S=o("opacity");h[C]=Be(i,y+D[S],a[S].type)}if(A&&m){const S=1+g.length/3,Q=C*S*3;m[Q+0]=Be(i,y+D[u[0]],a[u[0]].type),m[Q+S+0]=Be(i,y+D[u[1]],a[u[1]].type),m[Q+2*S+0]=Be(i,y+D[u[2]],a[u[2]].type);let I=1,T=1,M=1;for(let Z=0;Z<g.length;Z+=3){const be=g[Z+0],re=g[Z+1],P=g[Z+2];m[Q+I]=Be(i,y+D[be],a[be].type),m[Q+S+T]=Be(i,y+D[re],a[re].type),m[Q+2*S+M]=Be(i,y+D[P],a[P].type),I++,T++,M++}}v+=B}return{vertexCount:t,position:l,scale:c,rotation:f,opacity:h,sh:A&&m?{order:p,coeffs:m}:void 0}}function Xg(s,e){const{vertexCount:t,properties:a}=e,r=new TextDecoder("utf-8").decode(s),i=r.indexOf("end_header");if(i<0)throw new Error("PLY: Invalid PLY header");let n=i+10;for(;n<r.length&&(r[n]===" "||r[n]===`
|
|
11817
11817
|
`||r[n]==="\r");)n++;const l=r.substring(n).split(/\s+/).filter(P=>P.length>0);let c=0;const f=P=>a.find(z=>z.name===P)!=null,h=P=>a.findIndex(z=>z.name===P),u=P=>{if(c>=l.length)throw new Error("PLY: Unexpected end of file");const z=l[c++];switch(P){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(z);case"float":case"double":case"float32":case"float64":return parseFloat(z);default:return parseFloat(z)}},g=new Float32Array(t*3),A=f("scale_0")?new Float32Array(t*3):void 0,m=f("rot_0")?new Float32Array(t*4):void 0,p=f("opacity")?new Float32Array(t):void 0,D=[h("f_dc_0"),h("f_dc_1"),h("f_dc_2")],B=[];for(let P=0;P<a.length;P++)a[P].name.startsWith("f_rest_")&&B.push(P);const v=D[0]>=0&&D[1]>=0&&D[2]>=0;let C,y=0;if(v){const P=1+B.length/3;y=yo(P),C=new Float32Array(t*P*3)}const x=h("x"),k=h("y"),E=h("z");if(x<0||k<0||E<0)throw new Error("PLY: Missing x/y/z for vertex");const S=A?h("scale_0"):-1,Q=A?h("scale_1"):-1,I=A?h("scale_2"):-1,T=m?h("rot_0"):-1,M=m?h("rot_1"):-1,Z=m?h("rot_2"):-1,be=m?h("rot_3"):-1,re=p?h("opacity"):-1;for(let P=0;P<t;P++)for(let z=0;z<a.length;z++){const H=a[z],O=u(H.type);if(z===x?g[P*3+0]=O:z===k?g[P*3+1]=O:z===E&&(g[P*3+2]=O),A&&z===S?A[P*3+0]=O:A&&z===Q?A[P*3+1]=O:A&&z===I&&(A[P*3+2]=O),m&&z===T?m[P*4+3]=O:m&&z===M?m[P*4+0]=O:m&&z===Z?m[P*4+1]=O:m&&z===be&&(m[P*4+2]=O),p&&z===re&&(p[P]=O),v&&C){const ie=1+B.length/3,W=P*ie*3;z===D[0]?C[W+0]=O:z===D[1]?C[W+ie+0]=O:z===D[2]&&(C[W+2*ie+0]=O);for(let $=0;$<B.length;$+=3){const ee=B[$+0],oe=B[$+1],fe=B[$+2];z===ee?C[W+($/3+1)]=O:z===oe?C[W+ie+($/3+1)]=O:z===fe&&(C[W+2*ie+($/3+1)]=O)}}}return{vertexCount:t,position:g,scale:A,rotation:m,opacity:p,sh:v&&C?{order:y,coeffs:C}:void 0}}function Ah(s){const e=Xi(s),{format:t,vertexCount:a,faceCount:r,properties:i,faceProperties:n,textureFiles:o,headerByteLength:l}=e;return t==="ascii"?Kg(s,e):Hg(s,e)}function Hg(s,e){const{vertexCount:t,faceCount:a,properties:r,faceProperties:i,textureFiles:n,headerByteLength:o}=e,l=new DataView(s,o),c=P=>r.find(z=>z.name===P)!=null,f=P=>r.findIndex(z=>z.name===P),h=i?.some(P=>P.name==="texcoord")||!1,u=i?.some(P=>P.name==="texnumber")||!1;i?.find(P=>P.name==="texcoord"),i?.find(P=>P.name==="texnumber");const g=new Float32Array(t*3),A=c("nx")&&c("ny")&&c("nz"),m=A?new Float32Array(t*3):new Float32Array(t*3),p=(c("red")||c("r"))&&(c("green")||c("g"))&&(c("blue")||c("b"))?new Float32Array(t*3):void 0,D=(c("u")||c("s"))&&(c("v")||c("t")),B=D||h?new Float32Array(t*2):void 0,v=new Map,C=u?new Array(a):[],y=[];let x=0;for(const P of r)y.push(x),x+=da(P.type);let k=0;for(let P=0;P<t;P++){const z=k,H=f("x"),O=f("y"),ie=f("z");if(H<0||O<0||ie<0)throw new Error("PLY: Missing x/y/z for vertex");if(g[P*3+0]=Be(l,z+y[H],r[H].type),g[P*3+1]=Be(l,z+y[O],r[O].type),g[P*3+2]=Be(l,z+y[ie],r[ie].type),A){const W=f("nx"),$=f("ny"),ee=f("nz");m[P*3+0]=Be(l,z+y[W],r[W].type),m[P*3+1]=Be(l,z+y[$],r[$].type),m[P*3+2]=Be(l,z+y[ee],r[ee].type)}if(p){const W=f("red")>=0?f("red"):f("r"),$=f("green")>=0?f("green"):f("g"),ee=f("blue")>=0?f("blue"):f("b");if(W>=0&&$>=0&&ee>=0){let oe=Be(l,z+y[W],r[W].type),fe=Be(l,z+y[$],r[$].type),De=Be(l,z+y[ee],r[ee].type);(r[W].type==="uchar"||r[W].type==="uint8")&&(oe/=255,fe/=255,De/=255),p[P*3+0]=oe,p[P*3+1]=fe,p[P*3+2]=De}}if(B){const W=f("u")>=0?f("u"):f("s"),$=f("v")>=0?f("v"):f("t");W>=0&&$>=0&&(B[P*2+0]=Be(l,z+y[W],r[W].type),B[P*2+1]=Be(l,z+y[$],r[$].type))}k+=x}const E=[],S=[],Q=[];let I=k;B&&!D&&!h&&new Array(t).fill(!1);for(let P=0;P<a;P++){let z=I,H=[],O,ie=0,W=0;if(!i||i.length===0)throw new Error("PLY: Face element must have properties");for(const ee of i)if(ee.name==="vertex_indices"){const oe=ee.type.split(" ");if(oe.length!==3||oe[0]!=="list")throw new Error(`PLY: Invalid vertex_indices property type: ${ee.type}`);const fe=oe[1],De=oe[2];if(W=Be(l,z,fe),z+=da(fe),W<3)throw new Error(`PLY: Face ${P} has less than 3 vertices`);const Ne=da(De);H=[];for(let Ke=0;Ke<W;Ke++){const q=Be(l,z,De);H.push(q),z+=Ne}}else if(ee.name==="texcoord"){const oe=ee.type.split(" ");if(oe.length!==3||oe[0]!=="list")throw new Error(`PLY: Invalid texcoord property type: ${ee.type}`);const fe=oe[1],De=oe[2],Ne=Be(l,z,fe);z+=da(fe);const Ke=da(De);O=new Float32Array(Ne);for(let q=0;q<Ne;q++)O[q]=Be(l,z,De),z+=Ke;v.set(P,O)}else if(ee.name==="texnumber")ie=Be(l,z,ee.type),z+=da(ee.type),C[P]=ie;else if(ee.type.startsWith("list ")){const oe=ee.type.split(" ");if(oe.length===3){const fe=oe[1],De=oe[2],Ne=Be(l,z,fe);z+=da(fe);const Ke=da(De);z+=Ne*Ke}}else z+=da(ee.type);I=z;const $=u?C[P]??0:0;if(W===3)E.push(H[0],H[1],H[2]),u&&S.push($),h&&O&&O.length>=6&&Q.push(O[0],1-O[1],O[2],1-O[3],O[4],1-O[5]);else for(let ee=1;ee<W-1;ee++)E.push(H[0],H[ee],H[ee+1]),u&&S.push($),h&&O&&O.length>=W*2&&Q.push(O[0],1-O[1],O[ee*2+0],1-O[ee*2+1],O[(ee+1)*2+0],1-O[(ee+1)*2+1])}if(!A){for(let P=0;P<t*3;P++)m[P]=0;for(let P=0;P<E.length;P+=3){const z=E[P],H=E[P+1],O=E[P+2],ie=g[z*3+0],W=g[z*3+1],$=g[z*3+2],ee=g[H*3+0],oe=g[H*3+1],fe=g[H*3+2],De=g[O*3+0],Ne=g[O*3+1],Ke=g[O*3+2],q=ee-ie,ne=oe-W,ce=fe-$,ue=De-ie,Re=Ne-W,ge=Ke-$,Se=ne*ge-ce*Re,Ie=ce*ue-q*ge,Me=q*Re-ne*ue;m[z*3+0]+=Se,m[z*3+1]+=Ie,m[z*3+2]+=Me,m[H*3+0]+=Se,m[H*3+1]+=Ie,m[H*3+2]+=Me,m[O*3+0]+=Se,m[O*3+1]+=Ie,m[O*3+2]+=Me}for(let P=0;P<t;P++){const z=m[P*3+0],H=m[P*3+1],O=m[P*3+2],ie=Math.sqrt(z*z+H*H+O*O);ie>1e-5?(m[P*3+0]=z/ie,m[P*3+1]=H/ie,m[P*3+2]=O/ie):(m[P*3+0]=0,m[P*3+1]=1,m[P*3+2]=0)}}let T=g,M=m,Z=p,be,re;if(h&&Q.length>0){const P=E.length/3,z=new Float32Array(P*3*3),H=new Float32Array(P*3*3),O=p?new Float32Array(P*3*3):void 0;be=new Float32Array(Q);for(let W=0;W<P;W++){const $=W*3,ee=E[$+0],oe=E[$+1],fe=E[$+2];z[W*9+0]=g[ee*3+0],z[W*9+1]=g[ee*3+1],z[W*9+2]=g[ee*3+2],z[W*9+3]=g[oe*3+0],z[W*9+4]=g[oe*3+1],z[W*9+5]=g[oe*3+2],z[W*9+6]=g[fe*3+0],z[W*9+7]=g[fe*3+1],z[W*9+8]=g[fe*3+2],H[W*9+0]=m[ee*3+0],H[W*9+1]=m[ee*3+1],H[W*9+2]=m[ee*3+2],H[W*9+3]=m[oe*3+0],H[W*9+4]=m[oe*3+1],H[W*9+5]=m[oe*3+2],H[W*9+6]=m[fe*3+0],H[W*9+7]=m[fe*3+1],H[W*9+8]=m[fe*3+2],O&&p&&(O[W*9+0]=p[ee*3+0],O[W*9+1]=p[ee*3+1],O[W*9+2]=p[ee*3+2],O[W*9+3]=p[oe*3+0],O[W*9+4]=p[oe*3+1],O[W*9+5]=p[oe*3+2],O[W*9+6]=p[fe*3+0],O[W*9+7]=p[fe*3+1],O[W*9+8]=p[fe*3+2])}T=z,M=H,Z=O;const ie=new Uint32Array(P*3);for(let W=0;W<P*3;W++)ie[W]=W;re=ie}else re=new Uint32Array(E),be=B;return{vertexCount:h&&Q.length>0?T.length/3:t,faceCount:a,position:T,normal:M,color:Z,uv:be,indices:re,textureFiles:n.length>0?n:void 0,triangleTexnumbers:S.length>0?S:void 0}}function Kg(s,e){const{vertexCount:t,faceCount:a,properties:r,faceProperties:i,textureFiles:n,headerByteLength:o}=e,l=new TextDecoder("utf-8").decode(s),c=l.indexOf("end_header");if(c<0)throw new Error("PLY: Invalid PLY header");let f=c+10;for(;f<l.length&&(l[f]===" "||l[f]===`
|
|
11818
|
-
`||l[f]==="\r");)f++;const u=l.substring(f).split(/\s+/).filter(q=>q.length>0);let g=0;const A=q=>r.find(ne=>ne.name===q)!=null,m=q=>{if(g>=u.length)throw new Error("PLY: Unexpected end of file");const ne=u[g++];switch(q){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(ne);case"float":case"double":case"float32":case"float64":return parseFloat(ne);default:return parseFloat(ne)}},p=new Float32Array(t*3),D=A("nx")&&A("ny")&&A("nz"),B=D?new Float32Array(t*3):new Float32Array(t*3),v=(A("red")||A("r"))&&(A("green")||A("g"))&&(A("blue")||A("b"))?new Float32Array(t*3):void 0,C=(A("u")||A("s"))&&(A("v")||A("t")),y=i?.some(q=>q.name==="texcoord")||!1,x=C||y?new Float32Array(t*2):void 0,k=new Map,E=i?.some(q=>q.name==="texnumber")||!1,S=E?new Array(a):[],Q=[],I=[],T=[],M=q=>r.findIndex(ne=>ne.name===q),Z=M("x"),be=M("y"),re=M("z"),P=D?M("nx"):-1,z=D?M("ny"):-1,H=D?M("nz"):-1,O=v?M("red")>=0?M("red"):M("r"):-1,ie=v?M("green")>=0?M("green"):M("g"):-1,W=v?M("blue")>=0?M("blue"):M("b"):-1,$=x&&C?M("u")>=0?M("u"):M("s"):-1,ee=x&&C?M("v")>=0?M("v"):M("t"):-1;for(let q=0;q<t;q++)for(let ne=0;ne<r.length;ne++){const ce=r[ne],ue=m(ce.type);ne===Z?p[q*3+0]=ue:ne===be?p[q*3+1]=ue:ne===re?p[q*3+2]=ue:ne===P?B[q*3+0]=ue:ne===z?B[q*3+1]=ue:ne===H?B[q*3+2]=ue:ne===O&&v?v[q*3+0]=ce.type==="uchar"||ce.type==="uint8"?ue/255:ue:ne===ie&&v?v[q*3+1]=ce.type==="uchar"||ce.type==="uint8"?ue/255:ue:ne===W&&v?v[q*3+2]=ce.type==="uchar"||ce.type==="uint8"?ue/255:ue:ne===$&&x?x[q*2+0]=ue:ne===ee&&x&&(x[q*2+1]=ue)}for(let q=0;q<a;q++){let ne=[],ce,ue=0;for(const Se of i||[])if(Se.name==="vertex_indices"){const Ie=Se.type.split(" "),Me=Ie[1],ze=Ie[2],Vt=m(Me);ne=[];for(let ut=0;ut<Vt;ut++)ne.push(m(ze))}else if(Se.name==="texcoord"){const Ie=Se.type.split(" "),Me=Ie[1],ze=Ie[2],Vt=m(Me);ce=new Float32Array(Vt);for(let ut=0;ut<Vt;ut++)ce[ut]=m(ze);k.set(q,ce)}else Se.name==="texnumber"&&(ue=m(Se.type),S[q]=ue);const Re=ne.length,ge=E?S[q]??0:0;if(Re===3)Q.push(ne[0],ne[1],ne[2]),E&&I.push(ge),y&&ce&&ce.length>=6&&T.push(ce[0],1-ce[1],ce[2],1-ce[3],ce[4],1-ce[5]);else for(let Se=1;Se<Re-1;Se++)Q.push(ne[0],ne[Se],ne[Se+1]),E&&I.push(ge),y&&ce&&ce.length>=Re*2&&T.push(ce[0],1-ce[1],ce[Se*2+0],1-ce[Se*2+1],ce[(Se+1)*2+0],1-ce[(Se+1)*2+1])}if(!D){for(let q=0;q<t*3;q++)B[q]=0;for(let q=0;q<Q.length;q+=3){const ne=Q[q],ce=Q[q+1],ue=Q[q+2],Re=p[ne*3+0],ge=p[ne*3+1],Se=p[ne*3+2],Ie=p[ce*3+0],Me=p[ce*3+1],ze=p[ce*3+2],Vt=p[ue*3+0],ut=p[ue*3+1],
|
|
11818
|
+
`||l[f]==="\r");)f++;const u=l.substring(f).split(/\s+/).filter(q=>q.length>0);let g=0;const A=q=>r.find(ne=>ne.name===q)!=null,m=q=>{if(g>=u.length)throw new Error("PLY: Unexpected end of file");const ne=u[g++];switch(q){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(ne);case"float":case"double":case"float32":case"float64":return parseFloat(ne);default:return parseFloat(ne)}},p=new Float32Array(t*3),D=A("nx")&&A("ny")&&A("nz"),B=D?new Float32Array(t*3):new Float32Array(t*3),v=(A("red")||A("r"))&&(A("green")||A("g"))&&(A("blue")||A("b"))?new Float32Array(t*3):void 0,C=(A("u")||A("s"))&&(A("v")||A("t")),y=i?.some(q=>q.name==="texcoord")||!1,x=C||y?new Float32Array(t*2):void 0,k=new Map,E=i?.some(q=>q.name==="texnumber")||!1,S=E?new Array(a):[],Q=[],I=[],T=[],M=q=>r.findIndex(ne=>ne.name===q),Z=M("x"),be=M("y"),re=M("z"),P=D?M("nx"):-1,z=D?M("ny"):-1,H=D?M("nz"):-1,O=v?M("red")>=0?M("red"):M("r"):-1,ie=v?M("green")>=0?M("green"):M("g"):-1,W=v?M("blue")>=0?M("blue"):M("b"):-1,$=x&&C?M("u")>=0?M("u"):M("s"):-1,ee=x&&C?M("v")>=0?M("v"):M("t"):-1;for(let q=0;q<t;q++)for(let ne=0;ne<r.length;ne++){const ce=r[ne],ue=m(ce.type);ne===Z?p[q*3+0]=ue:ne===be?p[q*3+1]=ue:ne===re?p[q*3+2]=ue:ne===P?B[q*3+0]=ue:ne===z?B[q*3+1]=ue:ne===H?B[q*3+2]=ue:ne===O&&v?v[q*3+0]=ce.type==="uchar"||ce.type==="uint8"?ue/255:ue:ne===ie&&v?v[q*3+1]=ce.type==="uchar"||ce.type==="uint8"?ue/255:ue:ne===W&&v?v[q*3+2]=ce.type==="uchar"||ce.type==="uint8"?ue/255:ue:ne===$&&x?x[q*2+0]=ue:ne===ee&&x&&(x[q*2+1]=ue)}for(let q=0;q<a;q++){let ne=[],ce,ue=0;for(const Se of i||[])if(Se.name==="vertex_indices"){const Ie=Se.type.split(" "),Me=Ie[1],ze=Ie[2],Vt=m(Me);ne=[];for(let ut=0;ut<Vt;ut++)ne.push(m(ze))}else if(Se.name==="texcoord"){const Ie=Se.type.split(" "),Me=Ie[1],ze=Ie[2],Vt=m(Me);ce=new Float32Array(Vt);for(let ut=0;ut<Vt;ut++)ce[ut]=m(ze);k.set(q,ce)}else Se.name==="texnumber"&&(ue=m(Se.type),S[q]=ue);const Re=ne.length,ge=E?S[q]??0:0;if(Re===3)Q.push(ne[0],ne[1],ne[2]),E&&I.push(ge),y&&ce&&ce.length>=6&&T.push(ce[0],1-ce[1],ce[2],1-ce[3],ce[4],1-ce[5]);else for(let Se=1;Se<Re-1;Se++)Q.push(ne[0],ne[Se],ne[Se+1]),E&&I.push(ge),y&&ce&&ce.length>=Re*2&&T.push(ce[0],1-ce[1],ce[Se*2+0],1-ce[Se*2+1],ce[(Se+1)*2+0],1-ce[(Se+1)*2+1])}if(!D){for(let q=0;q<t*3;q++)B[q]=0;for(let q=0;q<Q.length;q+=3){const ne=Q[q],ce=Q[q+1],ue=Q[q+2],Re=p[ne*3+0],ge=p[ne*3+1],Se=p[ne*3+2],Ie=p[ce*3+0],Me=p[ce*3+1],ze=p[ce*3+2],Vt=p[ue*3+0],ut=p[ue*3+1],rr=p[ue*3+2],Fa=Ie-Re,Ga=Me-ge,za=ze-Se,ta=Vt-Re,Wa=ut-ge,ua=rr-Se,Mt=Ga*ua-za*Wa,ka=za*ta-Fa*ua,ba=Fa*Wa-Ga*ta;B[ne*3+0]+=Mt,B[ne*3+1]+=ka,B[ne*3+2]+=ba,B[ce*3+0]+=Mt,B[ce*3+1]+=ka,B[ce*3+2]+=ba,B[ue*3+0]+=Mt,B[ue*3+1]+=ka,B[ue*3+2]+=ba}for(let q=0;q<t;q++){const ne=B[q*3+0],ce=B[q*3+1],ue=B[q*3+2],Re=Math.sqrt(ne*ne+ce*ce+ue*ue);Re>1e-5?(B[q*3+0]=ne/Re,B[q*3+1]=ce/Re,B[q*3+2]=ue/Re):(B[q*3+0]=0,B[q*3+1]=1,B[q*3+2]=0)}}let oe=p,fe=B,De=v,Ne,Ke;if(y&&T.length>0){const q=Q.length/3,ne=new Float32Array(q*3*3),ce=new Float32Array(q*3*3),ue=v?new Float32Array(q*3*3):void 0;Ne=new Float32Array(T);for(let ge=0;ge<q;ge++){const Se=ge*3,Ie=Q[Se+0],Me=Q[Se+1],ze=Q[Se+2];ne[ge*9+0]=p[Ie*3+0],ne[ge*9+1]=p[Ie*3+1],ne[ge*9+2]=p[Ie*3+2],ne[ge*9+3]=p[Me*3+0],ne[ge*9+4]=p[Me*3+1],ne[ge*9+5]=p[Me*3+2],ne[ge*9+6]=p[ze*3+0],ne[ge*9+7]=p[ze*3+1],ne[ge*9+8]=p[ze*3+2],ce[ge*9+0]=B[Ie*3+0],ce[ge*9+1]=B[Ie*3+1],ce[ge*9+2]=B[Ie*3+2],ce[ge*9+3]=B[Me*3+0],ce[ge*9+4]=B[Me*3+1],ce[ge*9+5]=B[Me*3+2],ce[ge*9+6]=B[ze*3+0],ce[ge*9+7]=B[ze*3+1],ce[ge*9+8]=B[ze*3+2],ue&&v&&(ue[ge*9+0]=v[Ie*3+0],ue[ge*9+1]=v[Ie*3+1],ue[ge*9+2]=v[Ie*3+2],ue[ge*9+3]=v[Me*3+0],ue[ge*9+4]=v[Me*3+1],ue[ge*9+5]=v[Me*3+2],ue[ge*9+6]=v[ze*3+0],ue[ge*9+7]=v[ze*3+1],ue[ge*9+8]=v[ze*3+2])}oe=ne,fe=ce,De=ue;const Re=new Uint32Array(q*3);for(let ge=0;ge<q*3;ge++)Re[ge]=ge;Ke=Re}else Ke=new Uint32Array(Q),Ne=x;return{vertexCount:y&&T.length>0?oe.length/3:t,faceCount:a,position:oe,normal:fe,color:De,uv:Ne,indices:Ke,textureFiles:n.length>0?n:void 0,triangleTexnumbers:I.length>0?I:void 0}}function Dh(s){const e=Xi(s),{format:t}=e;return t==="ascii"?$g(s,e):qg(s,e)}function qg(s,e){const{vertexCount:t,properties:a,headerByteLength:r}=e,i=new DataView(s,r),n=m=>a.find(p=>p.name===m)!=null,o=m=>a.findIndex(p=>p.name===m),l=new Float32Array(t*3),c=(n("red")||n("r"))&&(n("green")||n("g"))&&(n("blue")||n("b")),f=n("alpha")||n("a"),h=c?new Uint8Array(t*4):void 0,u=[];let g=0;for(const m of a)u.push(g),g+=da(m.type);let A=0;for(let m=0;m<t;m++){const p=A,D=o("x"),B=o("y"),v=o("z");if(D<0||B<0||v<0)throw new Error("PLY: Missing x/y/z for vertex");if(l[m*3+0]=Be(i,p+u[D],a[D].type),l[m*3+1]=Be(i,p+u[B],a[B].type),l[m*3+2]=Be(i,p+u[v],a[v].type),h){const C=o("red")>=0?o("red"):o("r"),y=o("green")>=0?o("green"):o("g"),x=o("blue")>=0?o("blue"):o("b"),k=f?o("alpha")>=0?o("alpha"):o("a"):-1;if(C>=0&&y>=0&&x>=0){let E=Be(i,p+u[C],a[C].type),S=Be(i,p+u[y],a[y].type),Q=Be(i,p+u[x],a[x].type),I=255;(a[C].type==="float"||a[C].type==="float32"||a[C].type==="double"||a[C].type==="float64")&&(E=Math.round(E*255),S=Math.round(S*255),Q=Math.round(Q*255)),k>=0&&(I=Be(i,p+u[k],a[k].type),(a[k].type==="float"||a[k].type==="float32"||a[k].type==="double"||a[k].type==="float64")&&(I=Math.round(I*255))),h[m*4+0]=Math.max(0,Math.min(255,E)),h[m*4+1]=Math.max(0,Math.min(255,S)),h[m*4+2]=Math.max(0,Math.min(255,Q)),h[m*4+3]=Math.max(0,Math.min(255,I))}}A+=g}return{vertexCount:t,position:l,color:h}}function $g(s,e){const{vertexCount:t,properties:a}=e,r=new TextDecoder("utf-8").decode(s),i=r.indexOf("end_header");if(i<0)throw new Error("PLY: Invalid PLY header");let n=i+10;for(;n<r.length&&(r[n]===" "||r[n]===`
|
|
11819
11819
|
`||r[n]==="\r");)n++;const l=r.substring(n).split(/\s+/).filter(E=>E.length>0);let c=0;const f=E=>a.find(S=>S.name===E)!=null,h=E=>{if(c>=l.length)throw new Error("PLY: Unexpected end of file");const S=l[c++];switch(E){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(S);case"float":case"double":case"float32":case"float64":return parseFloat(S);default:return parseFloat(S)}},u=new Float32Array(t*3),g=(f("red")||f("r"))&&(f("green")||f("g"))&&(f("blue")||f("b")),A=f("alpha")||f("a"),m=g?new Uint8Array(t*4):void 0,p=E=>a.findIndex(S=>S.name===E),D=p("x"),B=p("y"),v=p("z"),C=g?p("red")>=0?p("red"):p("r"):-1,y=g?p("green")>=0?p("green"):p("g"):-1,x=g?p("blue")>=0?p("blue"):p("b"):-1,k=A?p("alpha")>=0?p("alpha"):p("a"):-1;for(let E=0;E<t;E++){for(let S=0;S<a.length;S++){const Q=a[S],I=h(Q.type);if(S===D)u[E*3+0]=I;else if(S===B)u[E*3+1]=I;else if(S===v)u[E*3+2]=I;else if(S===C&&m){const T=Q.type==="uchar"||Q.type==="uint8"?I:Math.round(I*255);m[E*4+0]=Math.max(0,Math.min(255,T))}else if(S===y&&m){const T=Q.type==="uchar"||Q.type==="uint8"?I:Math.round(I*255);m[E*4+1]=Math.max(0,Math.min(255,T))}else if(S===x&&m){const T=Q.type==="uchar"||Q.type==="uint8"?I:Math.round(I*255);m[E*4+2]=Math.max(0,Math.min(255,T))}else if(S===k&&m){const T=Q.type==="uchar"||Q.type==="uint8"?I:Math.round(I*255);m[E*4+3]=Math.max(0,Math.min(255,T))}}m&&k<0&&(m[E*4+3]=255)}return{vertexCount:t,position:u,color:m}}class em extends it{static format=He.BIN;async parseBuffer(e){const t=mh(e);let a;switch(t){case di.PLY:{const r=Co(e);a={count:r.vertexCount,position:r.position,rotation:r.rotation,scale:r.scale,opacity:r.opacity,sh:r.sh},a.bbox=vo(r.position);break}case di.SPLAT:throw new Error("SPLAT format is not yet supported");case di.KSPLAT:throw new Error("KSPLAT format is not yet supported");case di.UNKNOWN:default:throw new Error("Unknown or unsupported Gaussian Splatting file format")}return this.data=a,a}verification(){return!!this.data&&this.data.count>0}}var Mn=(s=>(s.Point="Point",s.LineString="LineString",s.MultiPolygon="MultiPolygon",s))(Mn||{});class tm extends it{static format=He.JSON;json;async parseString(e){this.json=e,this.data=JSON.parse(e)}}class am{static getPath(e){let t=[];for(let a=0;a<e.features.length;a++){const r=e.features[a];switch(r.geometry.type){case Mn.LineString:break;case Mn.MultiPolygon:let i=[];for(let n=0;n<r.geometry.coordinates.length;n++){const o=r.geometry.coordinates[n];for(const l of o)for(const c of l){let f=new b(c[0],0,c[1]);i.push(f)}}t.push(i);break}}return t}}class rm{name;defines;doubleSided;baseColorFactor;emissiveFactor;metallicFactor;roughnessFactor;alphaCutoff;enableBlend;baseColorTexture;metallicRoughnessTexture;normalTexture;occlusionTexture;emissiveTexture;extensions;baseMapOffsetSize;normalMapOffsetSize;emissiveMapOffsetSize;roughnessMapOffsetSize;metallicMapOffsetSize;aoMapOffsetSize}class im{}class nm{}class Zt{static chunk(e,t){const a=[];let r=0;for(;r<e.length;)a.push(e.slice(r,r+t)),r+=t;return a}static removeComment(e){return e.split(`
|
|
11820
11820
|
`).filter(t=>t.trim().charAt(0)!=="#").join(`
|
|
11821
11821
|
`)}static convertToValue(e){return+e||/^0|0$/.test(e)?+e:e}static parseSection(e,t){const a=new RegExp(`~${t}(?:\\w*\\s*)*\\n\\s*`,"i"),r=e.split(a);return r.length>1?r[1].split(/~/)[0]:""}static parseParameterLine(e){const t=e.trim();if(!t)return{mnemonic:"",unit:"",value:"",description:""};const a=t.indexOf(":"),r=a>=0?t.substring(0,a).trim():t,i=a>=0?t.substring(a+1).trim():"none",n=r.split(/\s{2,}|\s+/),o=n[0]||"",l=o.indexOf(".");let c="",f="none";l>=0?(c=o.substring(0,l).trim(),f=o.substring(l+1).trim()||"none"):c=o.trim();const h=n.length>1?n[n.length-1].trim():"";return{mnemonic:c.toUpperCase(),unit:f,value:h,description:i||"none"}}}class _h{async parse(e){if(e instanceof ArrayBuffer){const t=new DataView(e);if(ti(t)==="LASF")return await this.parseBinary(e);{const i=new TextDecoder("utf-8",{fatal:!1}).decode(e);return await this.parseText(i)}}else return await this.parseText(e)}async parseText(e){const t=this.parseMetadata(e),a=this.parseWellParams(e),r=this.parseCurveParams(e),i=this.parseHeaders(e),n=a.NULL?.value,o=typeof n=="string"?+n:n,l=this.parseData(e,i,o||-999.25);return{headers:i,data:l,wellParams:a,curveParams:r,metadata:t,nullValue:o||-999.25}}async parseBinary(e){const t=new DataView(e),a=ti(t);if(a!=="LASF")throw new Error(`LASLoader: Invalid binary LAS file, expected 'LASF' magic bytes, got '${a}'`);const r=t.getUint8(24),n=t.getUint8(25)+r/10,o=t.getUint8(104),l=t.getUint32(107,!0),c=t.getFloat64(131,!0),f=t.getFloat64(139,!0),h=t.getFloat64(147,!0),u=t.getFloat64(155,!0),g=t.getFloat64(163,!0),A=t.getFloat64(171,!0),m=t.getFloat64(187,!0),p=t.getFloat64(195,!0),D=t.getFloat64(203,!0),B=t.getFloat64(211,!0),v=t.getFloat64(219,!0),C=t.getFloat64(227,!0),y=t.getUint32(96,!0),x=t.getUint32(100,!0);let k=y;for(let M=0;M<x;M++){const Z=t.getUint16(k+54,!0);k+=54+Z}const S=[20,28,26,34,57,63,30,36,38,59,67][o]||20;if(o>10)throw new Error(`LASLoader: Unsupported point data format ${o}`);const Q=new Float32Array(l*3),I=new Uint8Array(l*4);let T=k;for(let M=0;M<l;M++){const Z=T+M*S;let be,re,P;o>=6?(be=Number(t.getBigInt64(Z,!0)),re=Number(t.getBigInt64(Z+8,!0)),P=Number(t.getBigInt64(Z+16,!0))):(be=t.getInt32(Z,!0),re=t.getInt32(Z+4,!0),P=t.getInt32(Z+8,!0));const z=be*c+u,H=re*f+g,O=P*h+A;Q[M*3+0]=z,Q[M*3+1]=H,Q[M*3+2]=O;let ie;o>=6?ie=Z+24:ie=Z+12;const W=t.getUint16(ie,!0);if([2,3,5,7,8,9,10].includes(o)){let $;const ee=Z+S;if(o===5?$=Z+28:o===10?$=Z+59:$=ee-6,$>=Z&&$+6<=ee&&$+6<=e.byteLength)try{const oe=t.getUint16($,!0),fe=t.getUint16($+2,!0),De=t.getUint16($+4,!0);I[M*4+0]=oe<256?oe:oe>>8,I[M*4+1]=fe<256?fe:fe>>8,I[M*4+2]=De<256?De:De>>8,I[M*4+3]=255}catch(oe){console.warn(`LASLoader: Failed to read RGB at offset ${$} (format ${o}, record length ${S}), using intensity instead. Error: ${oe}`);const fe=Math.min(W/65535,1);I[M*4+0]=Math.floor(fe*255),I[M*4+1]=Math.floor(fe*255),I[M*4+2]=Math.floor(fe*255),I[M*4+3]=255}else{console.warn(`LASLoader: RGB offset ${$} out of bounds (offset: ${Z}, record end: ${ee}, buffer size: ${e.byteLength}, format: ${o}), using intensity instead`);const oe=Math.min(W/65535,1);I[M*4+0]=Math.floor(oe*255),I[M*4+1]=Math.floor(oe*255),I[M*4+2]=Math.floor(oe*255),I[M*4+3]=255}}else{const $=Math.min(W/65535,1);I[M*4+0]=Math.floor($*255),I[M*4+1]=Math.floor($*255),I[M*4+2]=Math.floor($*255),I[M*4+3]=255}}return{format:"binary",version:n,pointDataFormat:o,numPoints:l,positions:Q,colors:I,bbox:{xMin:m,xMax:p,yMin:D,yMax:B,zMin:v,zMax:C},scale:{x:c,y:f,z:h},offset:{x:u,y:g,z:A}}}parseMetadata(e){const t=Zt.parseSection(e,"V");if(!t)throw new Error("LASLoader: ~VERSION section not found");const r=Zt.removeComment(t).split(`
|
|
11822
11822
|
`).filter(Boolean);let i=2,n=!1;for(const o of r){const l=o.split(/\s{2,}|\s*:/).filter(Boolean);if(l.length>=2){const c=l[0].trim().toUpperCase(),f=l[1].trim().toUpperCase();if(c==="VERS"||c==="VERSION"){const h=f.match(/(\d+\.?\d*)/);h&&(i=+h[1])}else(c==="WRAP"||c==="WRAP.")&&(n=f==="YES"||f==="Y")}}return{version:i,wrap:n}}parseWellParams(e){const t=Zt.parseSection(e,"W");if(!t)return{};const r=Zt.removeComment(t).split(`
|
|
11823
11823
|
`).filter(Boolean),i={};for(const n of r){const o=Zt.parseParameterLine(n);o.mnemonic&&(i[o.mnemonic]={unit:o.unit,value:Zt.convertToValue(o.value),description:o.description})}return i}parseCurveParams(e){const t=Zt.parseSection(e,"C");if(!t)return{};const r=Zt.removeComment(t).split(`
|
|
11824
11824
|
`).filter(Boolean),i={};for(const n of r){const o=Zt.parseParameterLine(n);o.mnemonic&&(i[o.mnemonic]={unit:o.unit,value:o.value,description:o.description})}return i}parseHeaders(e){const t=Zt.parseSection(e,"C");if(!t)throw new Error("LASLoader: ~CURVE section not found");const r=Zt.removeComment(t).split(`
|
|
11825
|
-
`).filter(Boolean),i=[];for(const n of r){const o=Zt.parseParameterLine(n);o.mnemonic&&i.push(o.mnemonic)}if(i.length===0)throw new Error("LASLoader: No headers found in ~CURVE section");return i}parseData(e,t,a){const r=e.match(/~A(?:[\x20-\x7E])*(?:\r\n|\r|\n)([\s\S]*?)(?=~|$)/);if(!r||!r[1])throw new Error("LASLoader: ~A data section not found");const i=r[1].trim();if(!i)throw new Error("LASLoader: Data section is empty");const n=i.split(/\s+/).filter(c=>c.trim().length>0).map(c=>Zt.convertToValue(c.trim()));if(n.length===0)throw new Error("LASLoader: No data values found");const o=Math.floor(n.length/t.length);if(o===0)throw new Error("LASLoader: Insufficient data values");const l=[];for(let c=0;c<o;c++){const f=[];for(let h=0;h<t.length;h++){const u=c*t.length+h;u<n.length&&f.push(n[u])}f.length===t.length&&l.push(f)}return l}}var hi=(s=>(s.PointCloud="pointcloud",s.Curve="curve",s.WellTrajectory="trajectory",s))(hi||{}),sm=Object.getOwnPropertyDescriptor,om=(s,e,t,a)=>{for(var r=a>1?void 0:a?sm(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.FatLineShader=class extends gt{constructor(){super();const e=new Xe("FatLine_VS","FatLine_FS");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);const t=e.shaderState;t.acceptShadow=!1,t.castShadow=!1,t.receiveEnv=!1,t.acceptGI=!1,t.useLight=!1,t.cullMode=Nt.none,t.depthWriteEnabled=!0,this.setDefault()}setDefault(){this.setUniformColor("baseColor",new J(1,1,1,1)),this.setUniformFloat("lineWidth",1),this.setUniformFloat("opacity",1),this.setUniformVector2("resolution",new de(1920,1080));const e=new R;this.getDefaultColorShader().setUniform("modelMatrix",e.rawData)}},d.FatLineShader=om([Ia(d.FatLineShader,"FatLineShader")],d.FatLineShader);class Bh extends Dt{constructor(){super(),this.shader=new d.FatLineShader,this.transparent=!0}setInstanceBuffer(e){this.shader.setStorageBuffer("instances",e)}setModelMatrix(e){this.shader.getDefaultColorShader().setUniform("modelMatrix",e.rawData)}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set lineWidth(e){this.shader.setUniformFloat("lineWidth",e)}get lineWidth(){return this.shader.getUniformFloat("lineWidth")}set opacity(e){this.shader.setUniformFloat("opacity",e)}get opacity(){return this.shader.getUniformFloat("opacity")}set resolution(e){this.shader.setUniformVector2("resolution",e)}get resolution(){return this.shader.getUniformVector2("resolution")}}class lm extends it{static format=He.BIN;visualizationMode=hi.PointCloud;async parseBuffer(e){const a=await new _h().parse(e);await this.createVisualization(a)}async createVisualization(e){if("format"in e&&e.format==="binary")this.data=this.createBinaryPointCloudVisualization(e);else{const t=e;let a;switch(this.visualizationMode){case hi.PointCloud:a=this.createPointCloudVisualization(t);break;case hi.Curve:a=this.createCurveVisualization(t);break;case hi.WellTrajectory:a=this.createWellTrajectoryVisualization(t);break;default:a=this.createPointCloudVisualization(t)}a.lasData=t,a.wellParams=t.wellParams,a.curveParams=t.curveParams,this.data=a}}createBinaryPointCloudVisualization(e){const t=new d.Object3D;t.name="LASPointCloud";const a=new d.Object3D;a.name="LASPointCloudRoot",t.addChild(a);const r=a.addComponent(d.PointCloudRenderer);return r.initFromData(e.positions,e.colors,e.numPoints),r.setPointShape("circle"),r.setPointSize(4),t.lasFormat="binary",t.lasVersion=e.version,t.numPoints=e.numPoints,t.pointDataFormat=e.pointDataFormat,t.bbox=e.bbox,t}verification(){if(this.data)return!0;throw new Error("LASParser: Parse failed")}createPointCloudVisualization(e){const{headers:t,data:a,nullValue:r}=e,i=t.findIndex(D=>D.toUpperCase()==="DEPTH"||D.toUpperCase()==="DEPT");if(i<0)throw new Error("LASParser: DEPTH column not found");const n=t.map((D,B)=>B).filter(D=>D!==i).slice(0,2),o=a.filter(D=>!D.some(B=>B===r||B===+r));if(o.length===0)throw new Error("LASParser: No valid data points after filtering");const l=o.length,c=new Float32Array(l*3),f=new Uint8Array(l*4);let h=1/0,u=-1/0,g=1/0,A=-1/0;if(n.length>0){const D=o.map(B=>+B[n[0]]).filter(B=>!isNaN(B));if(h=Math.min(...D),u=Math.max(...D),n.length>1){const B=o.map(v=>+v[n[1]]).filter(v=>!isNaN(v));g=Math.min(...B),A=Math.max(...B)}}for(let D=0;D<o.length;D++){const B=o[D],v=D*3,C=D*4;if(c[v+2]=+B[i],n.length>0){const y=+B[n[0]],x=u!==h?(y-h)/(u-h):0;if(c[v+0]=x*10,n.length>1){const k=+B[n[1]],E=A!==g?(k-g)/(A-g):0;c[v+1]=E*10}else c[v+1]=0}else c[v+0]=0,c[v+1]=0;if(n.length>0){const y=+B[n[0]],x=u!==h?(y-h)/(u-h):0;this.mapValueToColor(x,f,C)}else f[C+0]=255,f[C+1]=255,f[C+2]=255,f[C+3]=255}const m=new d.Object3D;m.name="LASPointCloud";const p=m.addComponent(d.PointCloudRenderer);return p.initFromData(c,f,l),p.setPointShape("circle"),p.setPointSize(4),m}createCurveVisualization(e){const{headers:t,data:a,nullValue:r}=e,i=t.findIndex(D=>D.toUpperCase()==="DEPTH"||D.toUpperCase()==="DEPT");if(i<0)throw new Error("LASParser: DEPTH column not found");const n=t.map((D,B)=>B).find(D=>D!==i);if(n===void 0)throw new Error("LASParser: No curve column found");const o=a.filter(D=>{const B=+D[i],v=+D[n];return!isNaN(B)&&!isNaN(v)&&v!==r&&v!==+r});if(o.length===0)throw new Error("LASParser: No valid data points");const l=o.map(D=>+D[n]),c=Math.min(...l),h=Math.max(...l)-c,u=new Float32Array(o.length*3);for(let D=0;D<o.length;D++){const B=o[D],v=D*3,C=+B[i],y=+B[n];u[v+2]=C;const x=h>0?(y-c)/h:0;u[v+0]=x*10,u[v+1]=0}const g=new eh;g.setPositions(u);const A=new Bh;A.baseColor=new J(1,0,0,1),A.lineWidth=2;const m=new d.Object3D;m.name=`LASCurve_${t[n]}`;const p=m.addComponent(d.FatLineRenderer);return p.geometry=g,p.material=A,m}createWellTrajectoryVisualization(e){throw new Error("LASParser: Well trajectory visualization not yet implemented")}normalizeValue(e,t,a){const r=t.map(o=>+o[a]).filter(o=>!isNaN(o)),i=Math.min(...r),n=Math.max(...r);return n!==i?(e-i)/(n-i):0}mapValueToColor(e,t,a){const r=Math.floor(e*255),i=Math.floor((1-e)*255);t[a+0]=r,t[a+1]=0,t[a+2]=i,t[a+3]=255}}class cm extends it{static format=He.BIN;async parseBuffer(e){switch(Xi(e).mode){case Br.Splat:{const a=Co(e),r={count:a.vertexCount,position:a.position,rotation:a.rotation,scale:a.scale,opacity:a.opacity,sh:a.sh};r.bbox=vo(a.position);const i=new d.Object3D;i.name="GaussianSplat",i.addComponent(d.GSplatRenderer).initAsset(r),this.data=i;break}case Br.PointCloud:{const a=Dh(e),r=new d.Object3D;r.name="PLYPointCloud";const i=new d.Object3D;i.name="PLYPointCloudRoot",r.addChild(i);const n=i.addComponent(d.PointCloudRenderer);if(a.color)n.initFromData(a.position,a.color,a.vertexCount);else{const o=new Uint8Array(a.vertexCount*4);o.fill(255),n.initFromData(a.position,o,a.vertexCount)}n.setPointShape("circle"),n.setPointSize(4),this.data=r;break}case Br.Mesh:{const a=Ah(e),r=new d.Object3D;r.name="PLYMesh";const i=new Map;if(a.triangleTexnumbers&&a.triangleTexnumbers.length>0)for(let o=0;o<a.triangleTexnumbers.length;o++){const l=a.triangleTexnumbers[o];i.has(l)||i.set(l,[]),i.get(l).push(o)}else{const o=a.indices.length/3,l=[];for(let c=0;c<o;c++)l.push(c);i.set(0,l)}const n=new Map;if(a.textureFiles&&a.textureFiles.length>0){const o=[];for(let l=0;l<a.textureFiles.length;l++){const c=new qt,f=Rt.normalizePath(this.baseUrl+a.textureFiles[l]);o.push(_.res.loadTexture(f).then(h=>{c.baseMap=h,n.set(l,c)}))}await Promise.all(o)}n.size===0&&n.set(0,new qt);for(const[o,l]of i){const c=[];for(const A of l){const m=A*3;c.push(a.indices[m+0],a.indices[m+1],a.indices[m+2])}const f=new Ve;f.setAttribute(G.position,a.position),f.setAttribute(G.normal,a.normal),a.uv&&f.setAttribute(G.uv,a.uv),a.color&&f.setAttribute(G.color,a.color),f.setIndices(new Uint32Array(c)),f.addSubGeometry({indexStart:0,indexCount:c.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0});let h=n.get(o);h||(h=n.values().next().value||new qt);const u=new d.Object3D;u.name=`PLYMesh_Texture_${o}`;const g=u.addComponent(d.MeshRenderer);g.geometry=f,g.material=h,r.addChild(u)}this.data=r;break}}}verification(){return!!this.data}}class vh{async parse(e){const t=new DataView(e),a=ti(t);console.assert(a==="pnts");const r=t.getUint32(4,!0);console.assert(r===1);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const n=t.getUint32(12,!0),o=t.getUint32(16,!0),l=t.getUint32(20,!0),c=t.getUint32(24,!0),f=28,h=new Ei(e,f,n,o),u=f+n+o,g=h.header.POINTS_LENGTH||0,A=new Cn(e,g,u,l,c);return{version:r,featureTable:h,batchTable:A}}}class Uh extends vh{async parse(e){const t=await super.parse(e),{featureTable:a,batchTable:r}=t,i=a.header.POINTS_LENGTH;if(!i||i<=0)throw new Error("PNTSLoader: POINTS_LENGTH must be defined and greater than zero");const o=a.header.extensions?.["3DTILES_draco_point_compression"];let l,c;if(o){const g=await this.parseDraco(a,o,i);l=g.positions,c=g.colors,g.normals}else l=this.parsePositions(a,i),c=this.parseColors(a,i),this.parseNormals(a,i);const f=new d.Object3D,h=f.addComponent(d.PointCloudRenderer);h.initFromData(l,c,i),h.setPointShape("circle"),h.setPointSize(4);const u=a.getData("RTC_CENTER",1,"FLOAT","VEC3");return u&&f.transform.localPosition.set(u[0],u[1],u[2]),f.batchTable=r,f.featureTable=a,f}parsePositions(e,t){let a=e.getData("POSITION",t,"FLOAT","VEC3");if(a)return a;const r=e.getData("POSITION_QUANTIZED",t,"UNSIGNED_SHORT","VEC3");if(!r)throw new Error("PNTSLoader: Either POSITION or POSITION_QUANTIZED must be defined");const i=e.getData("QUANTIZED_VOLUME_SCALE",1,"FLOAT","VEC3"),n=e.getData("QUANTIZED_VOLUME_OFFSET",1,"FLOAT","VEC3");if(!i||!n)throw new Error("PNTSLoader: QUANTIZED_VOLUME_SCALE and QUANTIZED_VOLUME_OFFSET must be defined for quantized positions");const o=new Float32Array(t*3),l=65535;for(let c=0;c<t;c++){const f=c*3;o[f+0]=r[f+0]/l*i[0]+n[0],o[f+1]=r[f+1]/l*i[1]+n[1],o[f+2]=r[f+2]/l*i[2]+n[2]}return o}parseColors(e,t){let a=e.getData("RGBA",t,"UNSIGNED_BYTE","VEC4");if(a)return a;const r=e.getData("RGB",t,"UNSIGNED_BYTE","VEC3");if(r){const l=new Uint8Array(t*4);for(let c=0;c<t;c++){const f=c*3,h=c*4;l[h+0]=r[f+0],l[h+1]=r[f+1],l[h+2]=r[f+2],l[h+3]=255}return l}const i=e.getData("RGB565",t,"UNSIGNED_SHORT","SCALAR");if(i){const l=new Uint8Array(t*4);for(let c=0;c<t;c++){const f=this.decodeRGB565(i[c]),h=c*4;l[h+0]=f[0],l[h+1]=f[1],l[h+2]=f[2],l[h+3]=255}return l}const n=e.getData("CONSTANT_RGBA",1,"UNSIGNED_BYTE","VEC4");if(n){const l=new Uint8Array(t*4);for(let c=0;c<t;c++){const f=c*4;l[f+0]=n[0],l[f+1]=n[1],l[f+2]=n[2],l[f+3]=n[3]}return l}const o=new Uint8Array(t*4);return o.fill(255),o}parseNormals(e,t){let a=e.getData("NORMAL",t,"FLOAT","VEC3");if(a)return a;const r=e.getData("NORMAL_OCT16P",t,"UNSIGNED_BYTE","VEC2");return r?this.decodeOctNormals(r,t):null}decodeRGB565(e){const t=(e>>11&31)<<3,a=(e>>5&63)<<2,r=(e&31)<<3;return[t,a,r]}decodeOctNormals(e,t){const a=new Float32Array(t*3);for(let r=0;r<t;r++){const i=r*2,n=e[i]/255,o=e[i+1]/255,l=n*2-1,c=o*2-1,f=1-Math.abs(l)-Math.abs(c);let h,u;f<0?(h=(l>=0?1:-1)*(1-Math.abs(c)),u=(c>=0?1:-1)*(1-Math.abs(l))):(h=l,u=c);const g=Math.sqrt(h*h+u*u+f*f),A=r*3;a[A+0]=h/g,a[A+1]=u/g,a[A+2]=f/g}return a}async parseDraco(e,t,a){throw new Error("Draco compression not yet implemented")}}class yh extends it{static format=He.BIN;async parseBuffer(e){const a=await new Uh().parse(e),r=new d.Object3D;r.name="PNTS",r.addChild(a),this.data=r}verification(){if(this.data)return!0;throw new Error("PNTSParser: Parse failed")}}class So{boneName;bonePath;parentBoneName;boneID;parentBoneID;instanceID;parentInstanceID;t;q;s;formBytes(e){this.boneName=e.readUTF(),this.bonePath=e.readUTF(),this.parentBoneName=e.readUTF(),this.boneID=e.readInt32(),this.parentBoneID=e.readInt32(),this.instanceID=e.readUTF(),this.parentInstanceID=e.readUTF(),this.t=e.readVector3(),this.q=e.readQuaternion(),this.s=e.readVector3()}}class xo{name;count;boneData;boneMap;formBytes(e){this.boneData=[],this.boneMap=new Map,this.name=e.readUTF(),this.count=e.readInt32();for(let t=0;t<this.count;t++){let a=new So;a.formBytes(e.readBytesArray()),this.boneData[t]=a,this.boneMap.set(a.boneName,a)}}}class Ch extends it{static format=He.BIN;static parser(e,t){let a=e.readInt32();for(let r=0;r<a;r++){let i=new xo;i.formBytes(e.readBytesArray()),_.res.addObj(i.name,i)}}verification(){if(this.data)return!0;throw new Error("verify failed.")}}G.position,G.normal,G.color,G.TANGENT,G.uv,G.TEXCOORD_1,G.TEXCOORD_2,G.TEXCOORD_2,G.TEXCOORD_4,G.TEXCOORD_5,G.TEXCOORD_6,G.TEXCOORD_7,G.joints0,G.weights0;var X=(s=>(s[s.single=0]="single",s[s.boolean=1]="boolean",s[s.int=2]="int",s[s.int16=3]="int16",s[s.int32=4]="int32",s[s.float=5]="float",s[s.long=6]="long",s[s.uint=7]="uint",s[s.uint32=8]="uint32",s[s.uint64=9]="uint64",s[s.double=10]="double",s[s.string=11]="string",s[s.singleArray=12]="singleArray",s[s.stringArray=13]="stringArray",s[s.floatArray=14]="floatArray",s[s.vector2=15]="vector2",s[s.vector3=16]="vector3",s[s.vector4=17]="vector4",s[s.color=18]="color",s[s.color32=19]="color32",s[s.animationCurve=20]="animationCurve",s[s.quaternion=21]="quaternion",s[s.matrix4x4=22]="matrix4x4",s[s.mesh=23]="mesh",s[s.texture=24]="texture",s[s.material=25]="material",s[s.materials=26]="materials",s[s.skeleton=27]="skeleton",s[s.animClip=28]="animClip",s[s.vector2Int=29]="vector2Int",s[s.int32List=30]="int32List",s[s.colorList=31]="colorList",s[s.color32List=32]="color32List",s))(X||{});class Nn{static GetMaterial(e){let t=e,a=t.split("/");t=a[a.length-1],a=t.split("."),t=a[a.length-1];let r=qo(t);if(r){let i=new Dt;return i.shader=new r,i}else throw new Error("not found shader, shader name is "+t)}static applyMaterialTexture(e,t){for(let a=0;a<t.length;a++){const r=t[a];r.property in e?e[r.property]=r.texture:r.property in e.shader?e.shader[r.property]=r.texture:e.setTexture(r.property,r.texture)}}static applyMaterialProperties(e,t){for(let a=0;a<t.length;a++){const r=t[a],i=r.key;switch(r.type){case X.color:case X.color32:{let n=r.getValue();i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformColor(i,n)}break;case X.single:case X.float:case X.int:case X.int16:case X.int32:case X.uint:case X.uint32:case X.uint64:{let n=r.getValue();i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformFloat(i,n)}break;case X.singleArray:{let n=r.getValue()[0];i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformFloat(i,n)}break;case X.vector2:case X.vector2Int:{let n=r.getValue();i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformVector2(i,n)}break;case X.vector3:{let n=r.getValue();i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformVector3(i,n)}break;case X.vector4:{let n=r.getValue();i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformVector4(i,n)}break}}}}class Va{static parser(e){switch(e.readInt32()){case X.single:return{t:X.single,v:e.readFloat32()};case X.boolean:return{t:X.boolean,v:e.readBoolean()};case X.int:return{t:X.int,v:e.readInt32()};case X.int16:return{t:X.int16,v:e.readInt16()};case X.int32:return{t:X.int32,v:e.readInt32()};case X.float:return{t:X.float,v:e.readFloat32()};case X.long:return{t:X.long,v:e.readFloat64()};case X.uint:return{t:X.uint,v:e.readUnit32()};case X.uint32:return{t:X.uint32,v:e.readUnit32()};case X.uint64:return{t:X.uint64,v:e.readUnit32()};case X.double:return{t:X.double,v:e.readFloat64()};case X.string:return{t:X.string,v:e.readUTF()};case X.singleArray:return{t:X.singleArray,v:e.readFloatArray()};case X.stringArray:return{t:X.stringArray,v:e.readStringArray()};case X.floatArray:return{t:X.floatArray,v:e.readFloatArray()};case X.vector2:return{t:X.vector2,v:e.readVector2()};case X.vector3:return{t:X.vector3,v:e.readVector3()};case X.vector4:return{t:X.vector4,v:e.readVector4()};case X.color:return{t:X.color,v:e.readColor()};case X.color32:return{t:X.color32,v:e.readColor()};case X.animationCurve:return{t:X.animationCurve,v:null};case X.quaternion:return{t:X.quaternion,v:e.readQuaternion()};case X.matrix4x4:return{t:X.matrix4x4,v:null};case X.mesh:{let o=e.readUTF(),l=_.res.getGeometry(o);return{t:X.mesh,v:l}}case X.texture:{let o=e.readUTF(),l=_.res.getTexture(o);return{t:X.texture,v:l}}case X.material:{let o=e.readUTF(),l=_.res.getMat(o);return{t:X.material,v:l}}case X.materials:{let o=e.readStringArray(),l=[];for(let c=0;c<o.length;c++){const f=o[c];let h=_.res.getMat(f);l.push(h)}return{t:X.materials,v:l}}case X.skeleton:break;case X.animClip:{let o=[],l=e.readInt32();for(let c=0;c<l;c++){let f=new Lo;f.formBytes(e),o.push(f)}return{t:X.animClip,v:o}}case X.vector2Int:return{t:X.vector2Int,v:e.readVector2int()};case X.int32List:return{t:X.int32List,v:e.readInt32List()};case X.colorList:let a=e.readInt32(),r=[];for(let o=0;o<a;o++){const l=Va.parser(e).v;r.push(l)}return{t:X.colorList,v:r};case X.color32List:let i=e.readInt32(),n=[];for(let o=0;o<i;o++){const l=Va.parser(e).v;n.push(l)}return{t:X.color32List,v:n}}}}class Fo{key;type;_data;getValue(){return this._data}formBytes(e){this.key=e.readUTF();let{t,v:a}=Va.parser(e);this.type=t,this._data=a}}class Sh{property;name;texture;texelSize;wrapModeU;wrapModeV;wrapModeW;wrapMode;anisoLevel;dimension;filterMode}class xh extends it{static format=He.TEXT;static parserMaterial(e,t){let a=e.readInt32();for(let r=0;r<a;r++){let i=e.readBytesArray(),n=i.readUTF(),o=i.readUTF();i.readUTF();let l=i.readStringArray();i.readVector4(),i.readVector4();let c=i.readUTF(),f=[],h=[],u=i.readInt32();for(let m=0;m<u;m++){let p=new Fo;p.formBytes(i),f.push(p)}let g=i.readInt32();for(let m=0;m<g;m++){let p=i.readBytesArray(),D=new Sh;D.property=p.readUTF(),D.name=p.readUTF(),D.texture=_.res.getTexture(D.name),D.texelSize=p.readVector2(),D.wrapModeU=p.readUnit32(),D.wrapModeV=p.readUnit32(),D.wrapModeW=p.readUnit32(),D.wrapMode=p.readUnit32(),D.anisoLevel=p.readUnit32(),D.dimension=p.readUnit32(),D.filterMode=p.readUnit32(),h.push(D)}let A=Nn.GetMaterial(c);A.name=n;for(let m=0;m<l.length;m++){const p=l[m];A.shader.setDefine(p,!0)}Nn.applyMaterialTexture(A,h),Nn.applyMaterialProperties(A,f),_.res.addMat(o,A)}}verification(){if(this.data)return!0;throw new Error("verify failed.")}}class ko{shapeName;shapeIndex;frameCount;blendPositionList=new Float32Array;blendNormalList=new Float32Array;formBytes(e){let t=e.readBytesArray();this.shapeName=t.readUTF(),this.shapeIndex=t.readInt32(),this.frameCount=t.readInt32();let a=t.readInt32();this.blendPositionList=t.readFloat32Array(a*3);let r=t.readInt32();this.blendNormalList=t.readFloat32Array(r*3)}}class Eo{vertexCount;shapeNames;shapeIndexs;blendCount;blendShapePropertyDatas;blendShapeMap;formBytes(e){this.blendShapeMap=new Map,this.blendShapePropertyDatas=[];let t=e.readBytesArray();this.vertexCount=t.readInt32(),this.shapeNames=t.readStringArray(),this.shapeIndexs=t.readIntArray(),this.blendCount=t.readInt32();for(let a=0;a<this.blendCount;a++){let r=new ko;r.formBytes(t),this.blendShapePropertyDatas.push(r),this.blendShapeMap.set(r.shapeName,r)}return e}}class Fh{name;meshName;meshID;vertexCount;vertexStrip;vertexBuffer;indices;attributes;bones;bindPose;blendShapeData}class kh extends it{static format=He.BIN;async parseBuffer(e){}static parserMeshs(e,t){let a=e.readInt32();for(let r=0;r<a;r++){let i=new Fh,n=e.readBytesArray();i.meshName=n.readUTF(),i.meshID=n.readUTF(),n.readFloat32()>0,n.readFloat32()>0,n.readFloat32()>0;let o=n.readFloat32()>0,l=n.readFloat32()>0;o&&(i.bones=n.readStringArray(),i.bindPose=n.readMatrix44Array()),l&&(i.blendShapeData=new Eo,i.blendShapeData.formBytes(n));let c=n.readBytesArray(),f=n.readBytesArray(),h=c.readInt32(),u=0,g=[];for(let B=0;B<h;B++)g[B]={},g[B].att=fm[c.readUTF()],g[B].dim=c.readInt32(),u+=g[B].dim,g[B].format=c.readUTF();i.vertexCount=c.readInt32(),i.vertexBuffer=f.getFloat32Array();let A=n.readInt32Array(),m=[],p=n.readInt32();for(let B=0;B<p;B++){let v=n.readInt32(),C=n.readInt32(),y=n.readInt32(),x=n.readInt32(),k=n.readInt32(),E=n.readInt32();n.readVector3(),n.readVector3();let S={indexStart:C,indexCount:y,vertexStart:x,vertexCount:E,firstStart:k,topology:v,index:B};m.push(S)}A.length>65535?i.indices=new Uint32Array(A):i.indices=new Uint16Array(A);let D=new Ve;if(D.vertexDim=u,D.geometryType=Ft.compose_bin,D.setIndices(i.indices),D.setAttribute(G.all,i.vertexBuffer),o&&(D.skinNames=i.bones,D.bindPose=i.bindPose),l){D.blendShapeData=i.blendShapeData,D.morphTargetsRelative=!0,D.morphTargetDictionary={};for(let B=0;B<i.blendShapeData.blendCount;B++){D.setAttribute("a_morphPositions_"+B,i.blendShapeData.blendShapePropertyDatas[B].blendPositionList),D.setAttribute("a_morphNormals_"+B,i.blendShapeData.blendShapePropertyDatas[B].blendNormalList);for(let v=0;v<i.blendShapeData.blendCount;v++){let C=i.blendShapeData.shapeNames[v],y=i.blendShapeData.shapeIndexs[v];D.morphTargetDictionary[C]=y}}}for(let B=0;B<g.length;B++){const v=g[B].att;D.setAttribute(v,null)}for(let B=0;B<m.length;B++){const v=m[B];D.addSubGeometry(v)}D.name=i.meshName,_.res.addGeometry(i.meshID,D)}}verification(){if(this.data)return!0;throw new Error("verify failed.")}}let fm={Position:G.position,Normal:G.normal,Color:G.color,Tangent:G.TANGENT,TexCoord0:G.uv,TexCoord1:G.TEXCOORD_1,TexCoord2:G.TEXCOORD_2,TexCoord3:G.TEXCOORD_2,TexCoord4:G.TEXCOORD_4,TexCoord5:G.TEXCOORD_5,TexCoord6:G.TEXCOORD_6,TexCoord7:G.vIndex,BlendIndices:G.joints0,BlendWeight:G.weights0};class Pn extends DataView{get buffer(){return super.buffer}get byteOffset(){return super.byteOffset}get byteLength(){return super.byteLength}getInt16(e,t){return super.getInt16(e,t)}getInt32(e,t){return super.getInt32(e,t)}getFloat32(e,t){return super.getFloat32(e,t)}getFloat64(e,t){return super.getFloat64(e,t)}getUint8(e){return super.getUint8(e)}getUint32(e,t){return super.getUint32(e,t)}getInt8(e){return super.getInt8(e)}getUint16(e,t){return super.getUint16(e,t)}position=0;littleEndian=!0;constructor(e,t,a){super(e,t,a),this.position=0,this.position+=this.byteOffset}readUTF(){let e=this.readInt32(),t=e%4;t>0&&t<4&&(t=4-t);let a="",r=new Int8Array(this.buffer,this.position,e);return this.position+=e*Int8Array.BYTES_PER_ELEMENT,a+=String.fromCharCode.apply(null,r),this.position+=t*Int8Array.BYTES_PER_ELEMENT,a}readStringArray(){let e=[],t=this.readInt32();for(let a=0;a<t;a++)e.push(this.readUTF());return e}readByte(){let e=this.buffer[this.position];return this.position+=1,e}readBoolean(){let e=this.readInt32();return this.position+=4,e==1}readBytes(e){let t=new DataView(this.buffer,this.position,e);return this.position+=e,t.buffer}readBytesArray(){let e=this.readInt32(),t=new Pn(this.buffer.slice(this.position,this.position+e));return this.position+=e,t}readUnit8(){let e=this.getUint8(this.position);return this.position+=Uint8Array.BYTES_PER_ELEMENT,e}readUnit16(){let e=this.getUint16(this.position);return this.position+=Uint16Array.BYTES_PER_ELEMENT,e}readUnit32(){let e=this.getUint32(this.position);return this.position+=Uint32Array.BYTES_PER_ELEMENT,e}readInt8(){let e=this.getInt8(this.position);return this.position+=Int8Array.BYTES_PER_ELEMENT,e}readInt16(){let e=this.getInt16(this.position,this.littleEndian);return this.position+=Int16Array.BYTES_PER_ELEMENT,e}readInt32(){let e=this.getInt32(this.position,this.littleEndian);return this.position+=Int32Array.BYTES_PER_ELEMENT,e}readFloat32(){let e=this.getFloat32(this.position,this.littleEndian);return this.position+=Float32Array.BYTES_PER_ELEMENT,e}readFloat64(){let e=this.getFloat64(this.position,this.littleEndian);return this.position+=Float64Array.BYTES_PER_ELEMENT,e}readInt32Array(){let e=this.readInt32(),t=new Int32Array(this.buffer,this.position,e);return t=t.slice(0,e),this.position+=t.byteLength,t}readInt32List(){let e=this.readInt32(),t=[];for(let a=0;a<e;a++)t.push(this.readInt32());return t}readFloatArray(){let e=this.readInt32(),t=[];for(let a=0;a<e;a++){let r=this.readFloat32();t.push(r)}return t}readIntArray(){let e=this.readInt32(),t=[];for(let a=0;a<e;a++){let r=this.readInt32();t.push(r)}return t}readVector2int(){let e=new de;return e.x=this.readInt32(),e.y=this.readInt32(),e}readVector2(){let e=new de;return e.x=this.readFloat32(),e.y=this.readFloat32(),e}readVector3(){let e=new b;return e.x=this.readFloat32(),e.y=this.readFloat32(),e.z=this.readFloat32(),e}readVector3Array(){let e=[],t=this.readInt32();for(let a=0;a<t;a++)e.push(this.readVector3());return e}readVector4(){let e=new he;return e.x=this.readFloat32(),e.y=this.readFloat32(),e.z=this.readFloat32(),e.w=this.readFloat32(),e}readVector4Array(){let e=[],t=this.readInt32();for(let a=0;a<t;a++)e.push(this.readVector4());return e}readColor(){let e=new J;return e.r=this.readFloat32(),e.g=this.readFloat32(),e.b=this.readFloat32(),e.a=this.readFloat32(),e}readColorArray(){let e=[],t=this.readInt32();for(let a=0;a<t;a++)e.push(this.readColor());return e}readQuaternion(){let e=new ae;return e.x=this.readFloat32(),e.y=this.readFloat32(),e.z=this.readFloat32(),e.w=this.readFloat32(),e}readQuaternionArray(){let e=[],t=this.readInt32();for(let a=0;a<t;a++)e.push(this.readQuaternion());return e}readMatrix44(){let e=new R,t=e.rawData;return t[0]=this.readFloat32(),t[1]=this.readFloat32(),t[2]=this.readFloat32(),t[3]=this.readFloat32(),t[4]=this.readFloat32(),t[5]=this.readFloat32(),t[6]=this.readFloat32(),t[7]=this.readFloat32(),t[8]=this.readFloat32(),t[9]=this.readFloat32(),t[10]=this.readFloat32(),t[11]=this.readFloat32(),t[12]=this.readFloat32(),t[13]=this.readFloat32(),t[14]=this.readFloat32(),t[15]=this.readFloat32(),e}readMatrix44Array(){let e=this.readInt32(),t=[];for(let a=0;a<e;a++){let r=this.readMatrix44();t.push(r)}return t}readFloat32Array(e){let t=new DataView(this.buffer),a=new Float32Array(e);for(let r=0;r<e;r++)a[r]=t.getFloat32(this.position+r*Float32Array.BYTES_PER_ELEMENT,this.littleEndian);return this.position+=e*Float32Array.BYTES_PER_ELEMENT,a}getFloat32Array(){let e=new Float32Array(this.buffer,this.byteOffset,this.byteLength/Float32Array.BYTES_PER_ELEMENT);return e=e.slice(0,this.byteLength),e}}class Eh extends it{static format=He.TEXT;static async parserTexture(e,t,a){let r=e.readInt32(),i=[];for(let o=0;o<r;o++){let l=e.readUTF();wh.useWebp?(l=l.replace("png","webp"),l=l.replace("jpb","webp"),i.push(t.baseUrl+"webp/"+l)):i.push(t.baseUrl+l)}let n=await _.res.loadBitmapTextures(i,_.setting.loader.numConcurrent,a,!0);for(const o of n)_.res.addTexture(o.name,o)}verification(){if(this.data)return!0;throw new Error("verify failed.")}}var dm=Object.getOwnPropertyDescriptor,hm=(s,e,t,a)=>{for(var r=a>1?void 0:a?dm(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.LitSSSShader=class extends gt{constructor(){super(),Y.register("PBRLitSSSShader",md);let e=new Xe("PBRLitSSSShader","PBRLitSSSShader");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);let t=e.shaderState;t.acceptShadow=!0,t.castShadow=!0,t.receiveEnv=!0,t.acceptGI=!0,t.useLight=!0,this.setDefine("USE_BRDF",!0),this.setDefine("USE_AO_R",!0),this.setDefine("USE_ROUGHNESS_G",!0),this.setDefine("USE_METALLIC_B",!0),this.setDefine("USE_ALPHA_A",!0),this.setDefine("USE_CUSTOMUNIFORM",!0),this.setDefault(),this.computes=[new lh(this)]}setDefault(){this.setUniformFloat("shadowBias",35e-5),this.setUniformVector4("transformUV1",new he(0,0,1,1)),this.setUniformVector4("transformUV2",new he(0,0,1,1)),this.setUniformColor("baseColor",new J),this.setUniformColor("emissiveColor",new J(1,1,1)),this.setUniformVector4("materialF0",new he(.04,.04,.04,1)),this.setUniformColor("specularColor",new J(.04,.04,.04)),this.setUniformFloat("envIntensity",1),this.setUniformFloat("normalScale",1),this.setUniformFloat("roughness",1),this.setUniformFloat("metallic",0),this.setUniformFloat("ao",1),this.setUniformFloat("roughness_min",0),this.setUniformFloat("roughness_max",1),this.setUniformFloat("metallic_min",0),this.setUniformFloat("metallic_max",1),this.setUniformFloat("emissiveIntensity",0),this.setUniformFloat("alphaCutoff",0),this.setUniformFloat("ior",1.5),this.setUniformFloat("clearcoatFactor",0),this.setUniformFloat("clearcoatRoughnessFactor",0),this.setUniformColor("clearcoatColor",new J(1,1,1)),this.setUniformFloat("clearcoatWeight",0),this.setUniformColor("skinColor",new J(1,0,0)),this.setUniformFloat("skinPower",3.4),this.setUniformFloat("skinColorIns",.5),this.setUniformFloat("curveFactor",1)}set _MainTex(e){this.setTexture("baseMap",e)}set _BumpMap(e){this.setTexture("normalMap",e)}set _SSSMap(e){this.setTexture("sssMap",e)}set _MaskTex(e){this.setTexture("maskMap",e)}set _UVTransform(e){this.setUniformVector4("transformUV1",e)}set _Metallic(e){this.setUniformFloat("metallic",e)}set _Roughness(e){this.setUniformFloat("roughness",e)}set _MainColor(e){this.setUniformColor("baseColor",e)}set _AlphaCutoff(e){this.setUniformFloat("alphaCutoff",e)}set _DoubleSidedEnable(e){let t=this.getDefaultColorShader();t.shaderState.cullMode=e?Nt.none:t.shaderState.cullMode}set _SkinColor(e){this.setUniformColor("skinColor",e)}set _SkinPower(e){this.setUniformFloat("skinPower",e)}set _SkinColorIns(e){this.setUniformFloat("skinColorIns",e)}set curveFactor(e){this.setUniformFloat("curveFactor",e)}set _SurfaceType(e){let t=this.getDefaultColorShader();e==0?t.blendMode=me.NONE:t.blendMode=me.ALPHA}set _AlphaCutoffEnable(e){e==0?this.setDefine("USE_ALPHACUT",!1):this.setDefine("USE_ALPHACUT",!0)}},d.LitSSSShader=hm([Ia(d.LitSSSShader,"LitSSSShader")],d.LitSSSShader);var um=Object.getOwnPropertyDescriptor,bm=(s,e,t,a)=>{for(var r=a>1?void 0:a?um(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.LitShader=class extends gt{constructor(){super();let e=new Xe("PBRLItShader","PBRLItShader");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);let t=e.shaderState;t.acceptShadow=!0,t.castShadow=!0,t.receiveEnv=!0,t.acceptGI=!0,t.useLight=!0,this.setDefine("USE_BRDF",!0),this.setDefine("USE_ROUGHNESS_G",!0),this.setDefine("USE_METALLIC_B",!0),this.setDefine("USE_ALPHA_A",!0),this.setDefault()}setDefault(){this.setUniformFloat("shadowBias",35e-5),this.setUniformVector4("transformUV1",new he(0,0,1,1)),this.setUniformVector4("transformUV2",new he(0,0,1,1)),this.setUniformColor("baseColor",new J),this.setUniformColor("emissiveColor",new J(0,0,0)),this.setUniformVector4("materialF0",new he(.04,.04,.04,1)),this.setUniformColor("specularColor",new J(.04,.04,.04)),this.setUniformFloat("envIntensity",1),this.setUniformFloat("normalScale",1),this.setUniformFloat("roughness",1),this.setUniformFloat("metallic",0),this.setUniformFloat("ao",1),this.setUniformFloat("roughness_min",0),this.setUniformFloat("roughness_max",1),this.setUniformFloat("metallic_min",0),this.setUniformFloat("metallic_max",1),this.setUniformFloat("emissiveIntensity",0),this.setUniformFloat("alphaCutoff",0),this.setUniformFloat("ior",1.5),this.setUniformFloat("clearcoatFactor",0),this.setUniformFloat("clearcoatRoughnessFactor",0),this.setUniformColor("clearcoatColor",new J(1,1,1)),this.setUniformFloat("clearcoatWeight",0),this._MainTex=_.res.grayTexture,this._BumpMap=_.res.normalTexture,this._MaskTex=_.res.maskTexture}set _MainTex(e){this.setTexture("baseMap",e)}set _BumpMap(e){this.setTexture("normalMap",e)}set _MaskTex(e){this.setTexture("maskMap",e)}set _UVTransform(e){this.setUniformVector4("transformUV1",e)}set _Metallic(e){this.setUniformFloat("metallic",e)}set _Roughness(e){this.setUniformFloat("roughness",e)}set _MainColor(e){this.setUniformColor("baseColor",e)}set _AlphaCutoff(e){this.setUniformFloat("alphaCutoff",e)}set _DoubleSidedEnable(e){let t=this.getDefaultColorShader();t.shaderState.cullMode=e?Nt.none:t.shaderState.cullMode}set _SurfaceType(e){let t=this.getDefaultColorShader();e==0?t.blendMode=me.NONE:t.blendMode=me.ALPHA}set _AlphaCutoffEnable(e){e==0?this.setDefine("USE_ALPHACUT",!1):this.setDefine("USE_ALPHACUT",!0)}},d.LitShader=bm([Ia(d.LitShader,"LitShader")],d.LitShader);class Vn{comName;data;static parser(e){let t=e.readBytesArray(),a=new Vn;a.comName=t.readUTF(),a.data=[];let r=t.readInt32();for(let i=0;i<r;i++){let n=new Fo;n.formBytes(t),a.data.push(n)}return a}}class Hi{name;parentName;position;rotation;scale;comDatas;child;static parser(e){let t=e.readBytesArray(),a=new Hi;a.name=t.readUTF(),a.parentName=t.readUTF(),a.position=t.readVector3(),a.rotation=t.readQuaternion(),a.scale=t.readVector3(),a.comDatas=[],a.child=[];let r=t.readInt32();for(let n=0;n<r;n++){const o=Vn.parser(t);a.comDatas.push(o)}let i=t.readInt32();for(let n=0;n<i;n++){const o=Hi.parser(t);a.child.push(o)}return a}}class wh extends it{static useWebp=!0;static format=He.BIN;avatarDic;nodeData;async parseBuffer(e){this.avatarDic={};let t=new Pn(e,0);await Eh.parserTexture(t,this,this.loaderFunctions),Ch.parser(t,this),kh.parserMeshs(t,this),xh.parserMaterial(t,this),this.nodeData=this.parserPrefabNode(t),this.data=this.data=this.parserNodeTree(this.nodeData)}parserPrefabNode(e){return Hi.parser(e)}parserNodeTree(e){let t=new d.Object3D;if(t.localPosition=b.serialize(e.position),t.localQuaternion=ae.serialize(e.rotation),t.localScale=b.serialize(e.scale),t.name=e.name,e.comDatas)for(let a=0;a<e.comDatas.length;a++){const r=e.comDatas[a];let i=null,n=Ko(r.comName);if(n){i=t.getOrAddComponent(n);for(let o=0;o<r.data.length;o++){const l=r.data[o];l.key in i&&(i[l.key]=l.getValue())}}}if(e.child&&e.child.length>0)for(let a=0;a<e.child.length;a++){let r=this.parserNodeTree(e.child[a]);t.addChild(r)}return t}verification(){if(this.data)return!0;throw new Error("verify failed.")}}class gm{static getNumber(e){return parseFloat(e)}static getInt(e){return parseInt(e)}static getBoolean(e){return e=="true"}static getNumberArray(e){let t=e.replaceAll("[","");t=t.replaceAll("]","");let a=t.split(",");for(let r=0;r<a.length;r++)parseFloat(a[r]);return t}static getStringArray(e){let t=e.replaceAll("[","");t=t.replaceAll("]","");let a=t.split(","),r=[];for(let i=0;i<a.length;i++){const n=a[i];r.push(n)}return r}static getVector2(e){}static getVector3(e){}static getVector4(e){}static getQuaternion(e){}static getColor(e){}}var mm=Object.getOwnPropertyDescriptor,pm=(s,e,t,a)=>{for(var r=a>1?void 0:a?mm(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.UnLitShader=class extends gt{constructor(){super();let e=new Xe("UnLit","UnLit");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);let t=e.shaderState;t.acceptShadow=!1,t.castShadow=!1,t.receiveEnv=!1,t.acceptGI=!1,t.useLight=!1,this.setDefine("USE_BRDF",!0),this.setDefine("USE_AO_R",!0),this.setDefine("USE_ROUGHNESS_G",!0),this.setDefine("USE_METALLIC_B",!0),this.setDefine("USE_ALPHA_A",!0),this.setDefault()}setDefault(){this.setUniformVector4("transformUV1",new he(0,0,1,1)),this.setUniformVector4("transformUV2",new he(0,0,1,1)),this.setUniformColor("baseColor",new J),this.setUniformFloat("alphaCutoff",0)}set _MainTex(e){this.setTexture("baseMap",e)}set _BumpMap(e){this.setTexture("normalMap",e)}set _MaskTex(e){this.setTexture("maskMap",e)}set _UVTransform(e){this.setUniformVector4("transformUV1",e)}set _Metallic(e){this.setUniformFloat("metallic",e)}set _Roughness(e){this.setUniformFloat("roughness",e)}set _MainColor(e){this.setUniformColor("baseColor",e)}set _AlphaCutoff(e){this.setUniformFloat("alphaCutoff",e)}set _DoubleSidedEnable(e){let t=this.getDefaultColorShader();t.shaderState.cullMode=e?Nt.none:t.shaderState.cullMode}set _SurfaceType(e){let t=this.getDefaultColorShader();e==0?t.blendMode=me.NONE:t.blendMode=me.ALPHA}set _AlphaCutoffEnable(e){e==0?this.setDefine("USE_ALPHACUT",!1):this.setDefine("USE_ALPHACUT",!0)}},d.UnLitShader=pm([Ia(d.UnLitShader,"UnLitShader")],d.UnLitShader);var Am=Object.getOwnPropertyDescriptor,Dm=(s,e,t,a)=>{for(var r=a>1?void 0:a?Am(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.UnLitTexArrayShader=class extends gt{constructor(){super(),Y.register("VertexAttributeIndexShader",ud),Y.register("UnLitTextureArray",pd);let e=new Xe("UnLitTextureArray","UnLitTextureArray");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);let t=e.shaderState;t.acceptShadow=!1,t.castShadow=!1,t.receiveEnv=!1,t.acceptGI=!1,t.useLight=!1,this.setDefine("USE_BRDF",!0),this.setDefine("USE_AO_R",!0),this.setDefine("USE_ROUGHNESS_G",!0),this.setDefine("USE_METALLIC_B",!0),this.setDefine("USE_ALPHA_A",!0),this.setDefault()}setDefault(){this.setUniformVector4("transformUV1",new he(0,0,1,1)),this.setUniformVector4("transformUV2",new he(0,0,1,1)),this.setUniformColor("baseColor",new J),this.setUniformFloat("alphaCutoff",0)}set _MainTex(e){this.setTexture("baseMap",e)}set _BumpMap(e){this.setTexture("normalMap",e)}set _MaskTex(e){this.setTexture("maskMap",e)}set _UVTransform(e){this.setUniformVector4("transformUV1",e)}set _Metallic(e){this.setUniformFloat("metallic",e)}set _Roughness(e){this.setUniformFloat("roughness",e)}set _MainColor(e){this.setUniformColor("baseColor",e)}set _AlphaCutoff(e){this.setUniformFloat("alphaCutoff",e)}set _DoubleSidedEnable(e){let t=this.getDefaultColorShader();t.shaderState.cullMode=e?Nt.none:t.shaderState.cullMode}set _SurfaceType(e){let t=this.getDefaultColorShader();e==0?t.blendMode=me.NONE:t.blendMode=me.ALPHA}set _AlphaCutoffEnable(e){e==0?this.setDefine("USE_ALPHACUT",!1):this.setDefine("USE_ALPHACUT",!0)}},d.UnLitTexArrayShader=Dm([Ia(d.UnLitTexArrayShader,"UnLitTexArrayShader")],d.UnLitTexArrayShader);const tr=-1,vr=0,wo=1,Rh=2,Ca=3,_m=6378137,Bm=1/298.257223563,vm=6356752314245179e-9,Um=Symbol("PLUGIN_REGISTERED");class Ro{boundingVolume;geometricError;refine;content;contents;transform;extensions;extras;parent=null;children=[];loadingState=vr;used=!1;visible=!1;active=!1;inFrustum=!1;error=1/0;distanceFromCamera=1/0;depth=0;depthFromRenderedParent=0;lastFrameVisited=-1;isLeaf=!1;allChildrenReady=!1;hasContent=!1;hasRenderableContent=!1;hasUnrenderableContent=!1;childrenProcessed=0;usedLastFrame=!1;priority;canTraverse=!1;canTraverseFrame=-1;basePath="";cached={};constructor(e,t=null){if(this.boundingVolume=e.boundingVolume,this.geometricError=e.geometricError,this.refine=e.refine,this.content=e.content,this.contents=e.contents,this.transform=e.transform,this.extensions=e.extensions,this.extras=e.extras,this.parent=t,this.depth=t?t.depth+1:0,this.depthFromRenderedParent=t?.hasContent?0:t?t.depthFromRenderedParent+1:0,this.hasContent=!!(this.content||this.contents&&this.contents.length>0),this.content?.uri){const a=this.content.uri.toLowerCase();this.hasUnrenderableContent=a.endsWith("tileset.json"),this.hasRenderableContent=!this.hasUnrenderableContent}else this.contents&&this.contents.length>0&&(this.hasRenderableContent=!0)}addChild(e){e.parent=this,e.depth=this.depth+1,e.depthFromRenderedParent=this.hasContent?0:this.depthFromRenderedParent+1,this.children.push(e)}resetFrameState(e){this.lastFrameVisited!==e&&(this.lastFrameVisited=e,this.used=!1,this.inFrustum=!1,this.isLeaf=!1,this.visible=!1,this.active=!1,this.error=1/0,this.distanceFromCamera=1/0,this.allChildrenReady=!1)}}const Ih=2**30;class Qh{minSize=6e3;maxSize=8e3;minBytesSize=.3*Ih;maxBytesSize=.4*Ih;unloadPercent=.05;autoMarkUnused=!0;_itemSet=new Map;_itemList=[];_usedSet=new Set;_callbacks=new Map;_unloadingHandle=-1;_cachedBytes=0;_bytesMap=new Map;_loadedSet=new Set;_unloadPriorityCallback=null;set unloadPriorityCallback(e){this._unloadPriorityCallback=e}get unloadPriorityCallback(){return this._unloadPriorityCallback}isFull(){return this._itemSet.size>=this.maxSize||this._cachedBytes>=this.maxBytesSize}getMemoryUsage(e){return this._bytesMap.get(e)||0}setMemoryUsage(e,t){if(!this._itemSet.has(e))return;const a=this._bytesMap.get(e)||0;this._cachedBytes-=a,this._bytesMap.set(e,t),this._cachedBytes+=t}add(e,t){return this._itemSet.has(e)||this.isFull()?!1:(this._itemList.push(e),this._usedSet.add(e),this._itemSet.set(e,Date.now()),this._callbacks.set(e,t),this._loadedSet.add(e),!0)}has(e){return this._itemSet.has(e)}remove(e){if(!this._itemSet.has(e))return!1;const t=this._bytesMap.get(e)||0;this._cachedBytes-=t,this._bytesMap.delete(e);const a=this._callbacks.get(e);a&&a(e);const r=this._itemList.indexOf(e);return r!==-1&&this._itemList.splice(r,1),this._usedSet.delete(e),this._itemSet.delete(e),this._callbacks.delete(e),this._loadedSet.delete(e),!0}markUsed(e){this._itemSet.has(e)&&(this._usedSet.add(e),this._itemSet.set(e,Date.now()))}markUnused(e){this._usedSet.delete(e)}scheduleUnload(){this._unloadingHandle===-1&&(this._unloadingHandle=requestAnimationFrame(()=>{this._unloadingHandle=-1,this._performUnload()}))}_performUnload(){if(!(this._itemSet.size>this.minSize||this._cachedBytes>this.minBytesSize))return;this.autoMarkUnused&&this._itemSet.forEach((o,l)=>{this._usedSet.has(l)||this.markUnused(l)});const t=[];this._itemList.forEach(o=>{this._usedSet.has(o)||t.push(o)}),this._unloadPriorityCallback&&t.sort(this._unloadPriorityCallback);const a=Math.floor(this._itemSet.size*(1-this.unloadPercent)),r=this._cachedBytes-(this._cachedBytes-this.minBytesSize);let i=0,n=0;for(let o=0;o<t.length;o++){const l=t[o];if(this._itemSet.size-i<=a&&this._cachedBytes-n<=r)break;const c=this._bytesMap.get(l)||0;this.remove(l)&&(i++,n+=c)}}clear(){Array.from(this._itemSet.keys()).forEach(t=>this.remove(t))}getStats(){return{size:this._itemSet.size,bytes:this._cachedBytes,usedCount:this._usedSet.size}}}class Io{maxJobs=6;autoUpdate=!0;priorityCallback=null;_items=[];_callbacks=new Map;_currJobs=0;_scheduled=!1;_schedulingCallback;constructor(){this._schedulingCallback=e=>{requestAnimationFrame(e)}}set schedulingCallback(e){this._schedulingCallback=e}get running(){return this._items.length!==0||this._currJobs!==0}sort(){this.priorityCallback&&this._items.sort(this.priorityCallback)}has(e){return this._callbacks.has(e)}add(e,t){if(this._callbacks.has(e))return this._callbacks.get(e).promise;let a,r;const i=new Promise((o,l)=>{a=o,r=l}),n={callback:t,promise:i,resolve:a,reject:r};return this._items.unshift(e),this._callbacks.set(e,n),this.autoUpdate&&this._scheduleJobRun(),i}remove(e){const t=this._items.indexOf(e);if(t!==-1){const a=this._callbacks.get(e);a&&(a.promise.catch(()=>{}),a.reject(new Error("PriorityQueue: Item removed."))),this._items.splice(t,1),this._callbacks.delete(e)}}removeByFilter(e){const t=[];this._items.forEach(a=>{e(a)&&t.push(a)}),t.forEach(a=>this.remove(a))}_scheduleJobRun(){this._scheduled||(this._scheduled=!0,this._schedulingCallback(()=>{this._scheduled=!1,this._tryRunJobs()}))}_tryRunJobs(){this.sort();const e=this.maxJobs;let t=0;const a=()=>{this._currJobs--,this.autoUpdate&&this._scheduleJobRun()};for(;e>this._currJobs&&this._items.length>0&&t<e;){this._currJobs++,t++;const r=this._items.shift(),i=this._callbacks.get(r);this._callbacks.delete(r),Promise.resolve(i.callback(r)).then(()=>{i.resolve(),a()}).catch(n=>{i.reject(n),a()})}}clear(){Array.from(this._items).forEach(t=>this.remove(t))}getStats(){return{queued:this._items.length,running:this._currJobs}}}function Th(s,e=null,t=null){const a=[];for(a.push(s),a.push(null),a.push(0);a.length>0;){const r=a.pop(),i=a.pop(),n=a.pop();if(e&&e(n,i,r)===!0){t&&t(n,i,r);return}const o=n.children;if(o&&o.length>0)for(let l=o.length-1;l>=0;l--)a.push(o[l]),a.push(n),a.push(r+1);if(t&&t(n,i,r)===!0)return}}function ym(s,e){let t=s;for(;t;){const a=t.depth,r=t.parent;e(t,r,a),t=r}}const On={inView:!1,error:1/0,distanceFromCamera:1/0},Mh=!0;function Nh(s){return s===Ca||s===tr}function Ur(s,e){return s.lastFrameVisited===e&&s.used}function Ph(s){return s.childrenProcessed===s.children.length}function Qo(s){return s.hasUnrenderableContent||s.parent!==null&&s.parent.geometricError<s.geometricError}function To(s,e){s.lastFrameVisited!==e.frameCount&&(s.usedLastFrame=s.used,s.lastFrameVisited=e.frameCount,s.used=!1,s.inFrustum=!1,s.isLeaf=!1,s.visible=!1,s.active=!1,s.error=1/0,s.distanceFromCamera=1/0,s.allChildrenReady=!1,e.calculateTileViewError(s,On),s.inFrustum=On.inView,s.error=On.error,s.distanceFromCamera=On.distanceFromCamera)}function Mo(s,e,t=!1){s.used||(t||(s.used=!0,e.stats.used++),e.markTileUsed(s),s.inFrustum===!0&&e.stats.inFrustum++)}function Cm(s,e){if(s.canTraverse&&s.canTraverseFrame===e.frameCount)return s.canTraverse;let t=!1;return s.error<=e.errorTarget&&!Qo(s)||s.depth>=e.maxDepth||!s.children||s.children.length===0?t=!1:t=!0,s.canTraverse=t,s.canTraverseFrame=e.frameCount,t}function No(s,e,t=!1){if(e.ensureChildrenArePreprocessed(s),To(s,e),Mo(s,e,t),Qo(s)&&Ph(s)){const a=s.children;for(let r=0,i=a.length;r<i;r++)No(a[r],e,t)}}function Ln(s,e){if(e.ensureChildrenArePreprocessed(s),To(s,e),!s.inFrustum)return;if(!Cm(s,e)){Mo(s,e);const n=s.children;if(!s.hasContent&&n&&n.length>0)for(let o=0,l=n.length;o<l;o++){const c=n[o];Ln(c,e)}return}const a=s.children;let r=!1,i=!1;for(let n=0,o=a.length;n<o;n++){const l=a[n];Ln(l,e),r=r||Ur(l,e.frameCount),i=i||l.inFrustum}if(s.refine==="REPLACE"&&!i&&a.length!==0){s.inFrustum=!1;for(let n=0,o=a.length;n<o;n++)No(a[n],e,!0);return}if(Mo(s,e),s.refine==="REPLACE"&&(r&&s.depth!==0||Mh))for(let n=0,o=a.length;n<o;n++)No(a[n],e)}function Po(s,e){const t=e.frameCount;if(!Ur(s,t))return;const a=s.children;let r=!1;for(let i=0,n=a.length;i<n;i++){const o=a[i];r=r||Ur(o,t)}if(!r)s.isLeaf=!0;else{let i=!0;for(let n=0,o=a.length;n<o;n++){const l=a[n];if(Po(l,e),Ur(l,t)){const c=!Qo(l);let f=!l.hasContent||l.hasRenderableContent&&Nh(l.loadingState)||l.hasUnrenderableContent&&l.loadingState===tr;f=c&&f||l.allChildrenReady,i=i&&f}}s.allChildrenReady=i}}function Vh(s,e){if(e.ensureChildrenArePreprocessed(s),Ur(s,e.frameCount)&&(s.hasContent&&e.queueTileForDownload(s),Ph(s))){const t=s.children;for(let a=0,r=t.length;a<r;a++)Vh(t[a],e)}}function Vo(s,e){const t=e.stats;if(!Ur(s,e.frameCount))return;if(s.isLeaf){s.loadingState===Ca?(s.inFrustum&&(s.visible=!0,t.visible++),s.active=!0,t.active++):s.hasContent&&e.queueTileForDownload(s);return}const a=s.children,r=s.hasContent,i=Nh(s.loadingState)&&r,n=(e.errorTarget+1)*(e.errorThreshold||1),o=s.error<=n,l=s.refine==="ADD",c=s.allChildrenReady||s.depth===0&&!Mh;if(r&&(o||l)&&e.queueTileForDownload(s),(o&&i&&!c||i&&l)&&(s.inFrustum&&(s.visible=!0,t.visible++),s.active=!0,t.active++),!l&&o&&!c)for(let f=0,h=a.length;f<h;f++){const u=a[f];Ur(u,e.frameCount)&&Vh(u,e)}else for(let f=0,h=a.length;f<h;f++)Vo(a[f],e)}function Oo(s,e){const t=Ur(s,e.frameCount);if(t||s.usedLastFrame){let a=!1,r=!1;if(t?(a=s.active,r=s.visible):To(s,e),s.hasRenderableContent&&s.loadingState===Ca){const n=s.__wasSetVisible;s.__wasSetActive!==a&&(e.setTileActive(s,a),s.__wasSetActive=a),n!==r&&(e.setTileVisible(s,r),s.__wasSetVisible=r)}s.usedLastFrame=t;const i=s.children;for(let n=0,o=i.length;n<o;n++)Oo(i[n],e)}}class Vr{static s_tmpMatrix=null;_type;_data;_box;get box(){return this._box}_sphere;_matrix;constructor(e){if(Vr.s_tmpMatrix||(Vr.s_tmpMatrix=new R),this._data=e,e.box)this._type="box",this._parseBox(e.box);else if(e.sphere)this._type="sphere",this._parseSphere(e.sphere);else if(e.region)this._type="region",this._parseRegion(e.region);else throw new Error("BoundingVolume: Invalid bounding volume data")}_parseBox(e){if(e.length!==12)throw new Error("BoundingVolume: Box must have 12 elements");const t=new b(e[0],e[1],e[2]),a=new b(e[3],e[4],e[5]),r=new b(e[6],e[7],e[8]),i=new b(e[9],e[10],e[11]),n=a.length,o=r.length,l=i.length,c=a.clone().normalize(),f=r.clone().normalize(),h=i.clone().normalize();this._matrix=new R;const u=this._matrix.rawData;u[0]=c.x,u[1]=c.y,u[2]=c.z,u[3]=0,u[4]=f.x,u[5]=f.y,u[6]=f.z,u[7]=0,u[8]=h.x,u[9]=h.y,u[10]=h.z,u[11]=0,u[12]=t.x,u[13]=t.y,u[14]=t.z,u[15]=1;const g=new b(n*2,o*2,l*2);this._box=new xe(new b(0,0,0),g)}_parseSphere(e){if(e.length!==4)throw new Error("BoundingVolume: Sphere must have 4 elements");const t=new b(e[0],e[1],e[2]),a=e[3];this._sphere=new Qr(t,a)}_parseRegion(e){if(e.length!==6)throw new Error("BoundingVolume: Region must have 6 elements");const[t,a,r,i,n,o]=e,l=new b((t+r)/2,(a+i)/2,(n+o)/2),c=new b(Math.abs(r-t),Math.abs(i-a),Math.abs(o-n));this._box=new xe(l,c),this._matrix=new R,this._matrix.identity()}getAABB(e,t){if(this._type==="sphere"&&this._sphere){const a=this._sphere.center,r=this._sphere.radius,i=new b(a.x-r,a.y-r,a.z-r),n=new b(a.x+r,a.y+r,a.z+r);if(e.setFromMinMax(i,n),t){const o=[new b(i.x,i.y,i.z),new b(n.x,i.y,i.z),new b(i.x,n.y,i.z),new b(n.x,n.y,i.z),new b(i.x,i.y,n.z),new b(n.x,i.y,n.z),new b(i.x,n.y,n.z),new b(n.x,n.y,n.z)];o.forEach(l=>{const c=new b;t.transformPoint(l,c),l.copyFrom(c)}),e.makeEmpty(),o.forEach(l=>{e.expandByPoint(l)})}return e}else if(this._box){const a=Vr.s_tmpMatrix;if(a.identity(),this._matrix?t?a.multiplyMatrices(t,this._matrix):a.copyFrom(this._matrix):t&&a.copyFrom(t),a){const r=this._box,i=[new b(r.min.x,r.min.y,r.min.z),new b(r.max.x,r.min.y,r.min.z),new b(r.min.x,r.max.y,r.min.z),new b(r.max.x,r.max.y,r.min.z),new b(r.min.x,r.min.y,r.max.z),new b(r.max.x,r.min.y,r.max.z),new b(r.min.x,r.max.y,r.max.z),new b(r.max.x,r.max.y,r.max.z)];i.forEach(n=>{const o=new b;a.transformPoint(n,o),n.copyFrom(o)}),e.makeEmpty(),i.forEach(n=>{e.expandByPoint(n)})}else e.setFromMinMax(this._box.min,this._box.max);return e}throw new Error("BoundingVolume: Invalid state")}getOBB(e,t){this._type==="box"&&this._box&&this._matrix?(e.setFromMinMax(this._box.min,this._box.max),t.copyFrom(this._matrix)):(this.getAABB(e),t.identity())}getSphere(e){if(this._type==="sphere"&&this._sphere)return e.center.copyFrom(this._sphere.center),e.radius=this._sphere.radius,e;const t=new xe;this.getAABB(t);const a=t.center,i=t.size.length*.5;return e.center.copyFrom(a),e.radius=i,e}get type(){return this._type}distanceToPoint(e,t){if(this._type==="sphere"&&this._sphere){const a=this._sphere.center;let r=a;if(t){const o=new b;t.transformPoint(a,o),r=o}const i=this._sphere.radius,n=e.clone().subtract(r).length;return Math.max(0,n-i)}else if(this._box){const a=new xe;this.getAABB(a,t);const r=a.center,i=a.size,n=Math.max(0,Math.abs(e.x-r.x)-i.x*.5),o=Math.max(0,Math.abs(e.y-r.y)-i.y*.5),l=Math.max(0,Math.abs(e.z-r.z)-i.z*.5);return Math.sqrt(n*n+o*o+l*l)}return 1/0}intersectsFrustum(e,t){if(this._type==="sphere"&&this._sphere){const a=new xe;return this.getAABB(a,t),e.containsBox2(a)>0}else if(this._box){const a=new xe;return this.getAABB(a,t),e.containsBox2(a)>0}return!1}}const Oh=(s,e)=>{const t=s.priority||0,a=e.priority||0;return t!==a?t>a?1:-1:s.used!==e.used?s.used?1:-1:s.error!==e.error?s.error>e.error?1:-1:s.distanceFromCamera!==e.distanceFromCamera?s.distanceFromCamera>e.distanceFromCamera?-1:1:s.depthFromRenderedParent!==e.depthFromRenderedParent?s.depthFromRenderedParent>e.depthFromRenderedParent?-1:1:0},Lh=(s,e)=>{const t=s.priority||0,a=e.priority||0;return t!==a?t>a?1:-1:s.lastFrameVisited!==e.lastFrameVisited?s.lastFrameVisited>e.lastFrameVisited?-1:1:s.depthFromRenderedParent!==e.depthFromRenderedParent?s.depthFromRenderedParent>e.depthFromRenderedParent?1:-1:s.loadingState!==e.loadingState?s.loadingState>e.loadingState?-1:1:s.hasUnrenderableContent!==e.hasUnrenderableContent?s.hasUnrenderableContent?-1:1:s.error!==e.error?s.error>e.error?-1:1:0};class Sm{rootLoadingState=vr;rootTileSet=null;rootURL=null;fetchOptions={};frameCount=0;isLoading=!1;lruCache;loadQueue;processNodeQueue;plugins=[];_queuedTiles=[];_cachedSinceLoadComplete=new Set;_processedTiles=new WeakSet;_visibleTiles=new Set;_usedSet=new Set;_cacheHits=0;_cacheMisses=0;stats={parsing:0,downloading:0,failed:0,inFrustum:0,used:0,active:0,visible:0,inCacheSinceLoad:0};errorTarget=16;errorThreshold=1;maxDepth=30;displayActiveTiles=!1;onRootTileLoaded;rtcOffset=null;_root=null;_activeTiles=new Set;_delayedHideTiles=new Set;group;cameras=[];_cameraMap=new Map;_cameraInfo=[];_upRotationMatrix=new R;_ellipsoid;_bytesUsed=new WeakMap;_eventListeners=new Map;performanceStats={updateTime:0,traverseTime:0,markUsedTime:0,markVisibleTime:0,toggleTime:0,queueProcessTime:0};constructor(e=null){this.rootURL=e,this.lruCache=new Qh,this.lruCache.unloadPriorityCallback=Lh,this.loadQueue=new Io,this.loadQueue.maxJobs=10,this.loadQueue.priorityCallback=Oh,this.processNodeQueue=new Io,this.processNodeQueue.maxJobs=25,this.group=new d.Object3D,this.group.name="TilesRendererGroup"}get root(){return this._root}get loadProgress(){const{stats:e,isLoading:t}=this,a=e.downloading,r=e.inCacheSinceLoad+(t?1:0);return r===0?1:1-a/r}update(){const{lruCache:e,_usedSet:t,stats:a,loadQueue:r,processNodeQueue:i}=this;this.rootLoadingState===vr&&(this.rootLoadingState=wo,this.isLoading=!0,this._loadRootTileSet().then(c=>{if(this.rootLoadingState=Ca,this.rootTileSet=c,c.root){const f=this._getBasePath(this.rootURL||""),h=this.preprocessNode(c.root,f,null);this._root=h;const u=new Vr(h.boundingVolume),g=new Qr;u.getSphere(g);const A=new xe;if(u.getAABB(A),this.rtcOffset=new b(-g.center.x,-g.center.y,-g.center.z),this.onRootTileLoaded)try{this.onRootTileLoaded({center:g.center,radius:g.radius,boundingBox:A,rtcOffset:this.rtcOffset})}catch(m){console.warn("Failed to calculate bounding volume for root tile:",m)}}this.dispatchEvent({type:"load-tile-set",tileSet:c,url:this.rootURL})}).catch(c=>{this.rootLoadingState=tr,console.error("Failed to load root tileset:",c),this.dispatchEvent({type:"load-error",tile:null,error:c,url:this.rootURL})}));const n=this.root;if(!n)return;a.inFrustum=0,a.used=0,a.active=0,a.visible=0,this.frameCount++,t.forEach(c=>e.markUnused(c)),t.clear(),this.updateCameraInfo(),this._checkDelayedHideTiles(),Ln(n,this),Po(n,this),Vo(n,this),Oo(n,this);const o=this._queuedTiles;e.unloadPriorityCallback&&o.sort(e.unloadPriorityCallback);for(let c=0,f=o.length;c<f&&!e.isFull();c++)this.requestTileContents(o[c]);o.length=0,e.scheduleUnload(),(r.running||i.running)===!1&&this.isLoading===!0&&(this._cachedSinceLoadComplete.clear(),a.inCacheSinceLoad=0,this.dispatchEvent({type:"tiles-load-end"}),this.isLoading=!1)}traverse(e,t,a=!0){this.root&&Th(this.root,(r,i,n)=>(a&&this.ensureChildrenArePreprocessed(r,!0),e?e(r,i,n):!1),t)}registerPlugin(e){if(this.plugins.includes(e))return;const t=e.priority||0;let a=this.plugins.length;for(let r=0;r<this.plugins.length;r++)if((this.plugins[r].priority||0)>t){a=r;break}this.plugins.splice(a,0,e),e.init&&e.init(this)}unregisterPlugin(e){const t=this.plugins;let a;if(typeof e=="string"?a=t.find(r=>r.name===e):a=e,a&&t.includes(a)){const r=t.indexOf(a);return t.splice(r,1),a.dispose&&a.dispose(),!0}return!1}getPluginByName(e){return this.plugins.find(t=>t.name===e)||null}calculateTileViewError(e,t){const a=e.cached,r=this.cameras,i=this._cameraInfo,n=a.boundingVolume;if(!n){t.inView=!1,t.error=1/0,t.distanceFromCamera=1/0;return}let o=!1,l=-1/0,c=1/0,f=-1/0,h=1/0;const u=a.worldTransform;for(let g=0,A=r.length;g<A;g++){const m=i[g];let p,D;if(m.isOrthographic){const v=m.pixelSize;p=e.geometricError/v,D=1/0}else{const v=m.sseDenominator;D=n.distanceToPoint(m.position,u),p=D===0?1/0:e.geometricError/(D*v)}const B=i[g].frustum;n.intersectsFrustum(B,u)&&(o=!0,l=Math.max(l,p),c=Math.min(c,D)),f=Math.max(f,p),h=Math.min(h,D)}o?(t.inView=!0,t.error=l,t.distanceFromCamera=c):(t.inView=!1,t.error=f,t.distanceFromCamera=h)}updateCameraInfo(){this._updateCameraInfo()}_updateCameraInfo(){const e=this.cameras,t=this._cameraInfo,a=this._cameraMap;for(;t.length<e.length;)t.push({position:new b,frustum:new ds,isOrthographic:!1});for(let r=0;r<e.length;r++){const i=e[r],n=t[r],o=a.get(i);if(!o)continue;const l=i.transform.worldPosition;if(n.position.copyFrom(l),n.frustum=i.frustum,n.isOrthographic=i.type===at.ortho,n.isOrthographic){const c=i.frustumSize;n.pixelSize=c/o.height}else{const f=i.fov*Math.PI/180;n.sseDenominator=2*Math.tan(f/2)/o.height}}}preprocessNode(e,t,a=null){if(this._processedTiles.has(e))return e;this._processedTiles.add(e);let r;if(e instanceof Ro?r=e:r=new Ro(e,a),r.content){const c=r.content;!("uri"in c)&&"url"in c&&(c.uri=c.url,delete c.url)}if(r.basePath=t,r.boundingVolume){const c=new Vr(r.boundingVolume);r.cached.boundingVolume=c}const i=new b(r.boundingVolume.box[0],r.boundingVolume.box[1],r.boundingVolume.box[2]),n=new R;if(r.transform){const c=r.transform;for(let f=0;f<16;f++)n.rawData[f]=c[f]}if(!a){n.copyFrom(this._upRotationMatrix);const c=new b;c.copyFrom(i),c.applyMatrix4(n);const f=r.cached.boundingVolume.box,h=[new b(f.min.x,f.min.y,f.min.z),new b(f.max.x,f.min.y,f.min.z),new b(f.min.x,f.max.y,f.min.z),new b(f.max.x,f.max.y,f.min.z),new b(f.min.x,f.min.y,f.max.z),new b(f.max.x,f.min.y,f.max.z),new b(f.min.x,f.max.y,f.max.z),new b(f.max.x,f.max.y,f.max.z)];for(const A of h)A.applyMatrix4(n);const u=new xe;h.forEach(A=>{u.expandByPoint(A)}),n.rawData[12]=-c.x,n.rawData[13]=-c.y,n.rawData[14]=-c.z;const g=u.min;n.rawData[13]-=g.y}const o=new R;o.copyFrom(n),a&&a.cached.worldTransform&&o.multiplyMatrices(a.cached.worldTransform,n);const l=new R;if(l.copyFrom(o),l.invert(),r.cached.transfrom=n,r.cached.worldTransform=o,r.cached.transformInverse=l,e.children&&e.children.length>0){r.children=[];for(let c=0;c<e.children.length;c++){const f=e.children[c],h=this.preprocessNode(f,t,r);r.children.push(h)}r.childrenProcessed=r.children.length}return r}ensureChildrenArePreprocessed(e,t=!1){const a=e.children;for(let r=0,i=a.length;r<i;r++){const n=a[r];n.basePath!==void 0&&n.basePath!==""||n.cached.boundingVolume||(t?(this.processNodeQueue.remove(n),this.preprocessNode(n,e.basePath,e)):this.processNodeQueue.has(n)||this.processNodeQueue.add(n,o=>{this.preprocessNode(o,e.basePath,e)}))}}_recordCacheHit(){this._cacheHits++}_recordCacheMiss(){this._cacheMisses++}resetCacheStats(){this._cacheHits=0,this._cacheMisses=0}requestTileContents(e){if(e.loadingState!==vr){this._recordCacheHit();return}if(this.lruCache.isFull()){this._recordCacheMiss();return}this._recordCacheMiss(),e.loadingState=wo,this.stats.downloading++;const t=e.content||e.contents&&e.contents[0];if(!t||!t.uri){e.loadingState=tr,this.stats.downloading--,this.stats.failed++;return}const a=e.basePath||"",r=t.uri,i=this._resolveURL(a,r);this.loadQueue.add(e,async n=>{try{await this.parseTileContent(n,r,i),this.stats.downloading--}catch(o){n.loadingState=tr,this.stats.downloading--,this.stats.failed++,console.error("Failed to load tile:",o)}})}async parseTileContent(e,t,a){e.loadingState=Rh;const i=(c=>{const f=c.split(".");return f.length>1?f[f.length-1]:""})(t),n=a;let o=null;const l=new It;switch(i.toLowerCase()){case"b3dm":{o=(await l.load(n,Hs,{onProgress:f=>{},onComplete:f=>{}})).data;break}case"i3dm":{o=(await l.load(n,$s,{onProgress:f=>{},onComplete:f=>{}})).data;break}case"glb":case"gltf":{o=(await l.load(n,_t,{onProgress:f=>{},onComplete:f=>{}})).data;break}case"pnts":{o=(await l.load(n,yh,{onProgress:f=>{},onComplete:f=>{}})).data;break}case"json":try{const c=await _.res.loadJSON(n);e.children.length=0,e.childrenProcessed=0;const f=this._getBasePath(n);if(c.root){const h=this.preprocessNode(c.root,f,e);e.children.push(h),e.childrenProcessed=1,this.dispatchEvent({type:"load-tile-set",tileSet:c,url:n})}e.loadingState=Ca;return}catch(c){console.error("Failed to load external tileset:",c),e.loadingState=tr,this.stats.failed++;return}break;default:console.warn(`Unknown tile format: ${i}`);break}if(o){e.cached.scene=o,e.loadingState=Ca;const c=this._estimateBytesUsed(o);this._bytesUsed.set(o,c),this.lruCache.setMemoryUsage(e,c),this.lruCache.has(e)||this.lruCache.add(e,f=>{if(f.cached.scene){const h=f.cached.scene;h.parent&&h.parent.object3D.removeChild(h),h.destroy(!0),f.cached.scene=null}f.loadingState=vr}),e.active&&this.setTileActive(e,!0)}else e.loadingState=tr,this.stats.failed++}markTileUsed(e){this._usedSet.add(e),this.lruCache.markUsed(e)}setTileActive(e,t){t?(this._activeTiles.add(e),this._delayedHideTiles.has(e)&&this._delayedHideTiles.delete(e)):this._activeTiles.delete(e);const a=e.cached.scene;a&&(t?(this.group.entityChildren.includes(a)||(a.parent&&a.parent.object3D.removeChild(a),this.group.addChild(a)),e.cached.worldTransform&&this._applyWorldTransform(a.transform,e.cached.worldTransform),a.transform.enable=!0):this._delayedHideTiles.has(e)||this._delayedHideTiles.add(e))}_getLoadingChildrenThatWillBeActive(e){const t=[],a=e.children;for(let r=0,i=a.length;r<i;r++){const n=a[r];n.loadingState!==Ca&&n.loadingState!==tr&&t.push(n),n.children&&n.children.length>0&&t.push(...this._getLoadingChildrenThatWillBeActive(n))}return t}_checkDelayedHideTiles(){for(const e of this._delayedHideTiles)if(this._getLoadingChildrenThatWillBeActive(e).length===0){this._delayedHideTiles.delete(e);const a=e.cached.scene;a&&(a.transform.enable=!1)}}setTileVisible(e,t){t?(this._visibleTiles.add(e),this._delayedHideTiles.has(e)&&this._delayedHideTiles.delete(e)):this._visibleTiles.delete(e);const a=e.cached.scene;a&&(t?a.transform.enable=!0:this._delayedHideTiles.has(e)||this._delayedHideTiles.add(e))}queueTileForDownload(e){e.loadingState!==vr||this.lruCache.isFull()||this._queuedTiles.push(e)}dispatchEvent(e){const t=this._eventListeners.get(e.type);t&&t.forEach(a=>{try{a(e)}catch(r){console.error("Error in event listener:",r)}})}async _loadRootTileSet(){if(!this.rootURL)throw new Error("Root URL is not set");const e=await _.res.loadJSON(this.rootURL);return e.asset&&e.asset.gltfUpAxis&&this._setupUpAxisRotation(e.asset.gltfUpAxis),e}_setupUpAxisRotation(e){const t=new R;switch(e.toLowerCase()){case"x":t.makeRotationAxis(b.Y_AXIS,-Math.PI/2);break;case"y":t.identity();break;case"z":t.makeRotationAxis(b.X_AXIS,-Math.PI/2);break;default:console.warn(`Unknown gltfUpAxis: ${e}, using default`),t.identity();break}this._upRotationMatrix=t}_applyLocalTransform(e,t){const a=t.decompose(ia.EULER_ANGLES);e.localPosition=a[0];const r=new ae;r.fromEulerAngles(a[1].x,a[1].y,a[1].z),e.localRotQuat=r,e.localScale=a[2]}_applyWorldTransform(e,t){const a=t.decompose(ia.EULER_ANGLES);e.localPosition=a[0];const r=new ae;r.fromEulerAngles(a[1].x,a[1].y,a[1].z),e.localRotQuat=r,e.localScale=a[2]}_getBasePath(e){const t=e.lastIndexOf("/");return t!==-1?e.substring(0,t):""}_resolveURL(e,t){return t.startsWith("http://")||t.startsWith("https://")?t:e+"/"+t}_getUrlExtension(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}getMemoryStats(){const e=this.lruCache.getStats(),t=this.lruCache.maxBytesSize,a=e.bytes,r=t-a,i=this._cacheHits+this._cacheMisses,n=i>0?this._cacheHits/i:0;return{totalTiles:e.size,loadedTiles:e.usedCount,cachedTiles:e.size,totalBytes:t,usedBytes:a,freeBytes:r,cacheHitRate:n}}getLoadedTiles(){const e=[];return this.traverse(t=>(t.loadingState===Ca&&e.push(t),!1),null),e}getVisibleTiles(){return Array.from(this._visibleTiles)}getActiveTiles(){return Array.from(this._activeTiles)}getTileTreeStats(){let e=0,t=0,a=0,r=0,i=0,n=0;return this.traverse(o=>(e++,o.loadingState===Ca&&t++,o.visible&&a++,o.active&&r++,i=Math.max(i,o.depth),n+=o.depth,!1),null),{totalTiles:e,loadedTiles:t,visibleTiles:a,activeTiles:r,maxDepth:i,averageDepth:e>0?n/e:0}}printDebugInfo(){const e=this.stats,t=this.getMemoryStats(),a=this.getTileTreeStats(),r=this.performanceStats,i=this.lruCache.getStats();console.log("=== TilesRenderer Debug Info ==="),console.log("Stats:",e),console.log("Memory:",t),console.log("Tree:",a),console.log("Performance:",r),console.log("Cache:",i),console.log("Queues:",{load:this.loadQueue.getStats(),process:this.processNodeQueue.getStats()})}setPerformanceOptions(e){e.lruCacheMinSize!==void 0&&(this.lruCache.minSize=e.lruCacheMinSize),e.lruCacheMaxSize!==void 0&&(this.lruCache.maxSize=e.lruCacheMaxSize),e.lruCacheMinBytes!==void 0&&(this.lruCache.minBytesSize=e.lruCacheMinBytes),e.lruCacheMaxBytes!==void 0&&(this.lruCache.maxBytesSize=e.lruCacheMaxBytes),e.lruCacheUnloadPercent!==void 0&&(this.lruCache.unloadPercent=e.lruCacheUnloadPercent),e.downloadQueueMaxJobs!==void 0&&(this.loadQueue.maxJobs=e.downloadQueueMaxJobs),e.parseQueueMaxJobs!==void 0&&(this.loadQueue.maxJobs=e.parseQueueMaxJobs),e.processQueueMaxJobs!==void 0&&(this.processNodeQueue.maxJobs=e.processQueueMaxJobs),e.enablePerformanceStats!==void 0&&(this._enablePerformanceStats=e.enablePerformanceStats),e.enableCacheStats!==void 0&&(this._enableCacheStats=e.enableCacheStats)}dispose(e){[...this.plugins].forEach(a=>this.unregisterPlugin(a)),this.lruCache.clear(),this.loadQueue.clear(),this.processNodeQueue.clear(),this._root=null,this.rootTileSet=null,this.rootLoadingState=vr,this.frameCount=0,this.isLoading=!1,this.resetCacheStats(),this.group.destroy(e)}setCamera(e,t,a){this.cameras.includes(e)||this.cameras.push(e),this._cameraMap.set(e,{width:t,height:a}),this._updateCameraInfo()}deleteCamera(e){const t=this.cameras.indexOf(e);t!==-1&&this.cameras.splice(t,1),this._cameraMap.delete(e),this._updateCameraInfo()}setResolution(e,t,a){const r=this._cameraMap.get(e);r?(r.width=t,r.height=a):this._cameraMap.set(e,{width:t,height:a}),this._updateCameraInfo()}forEachLoadedModel(e){this.traverse(t=>(t.loadingState===Ca&&t.cached.scene&&e(t.cached.scene,t),!1),null)}_estimateBytesUsed(e){let t=0;return e.forChild(a=>{const r=a.getComponent(d.MeshRenderer);r&&r.geometry&&(t+=1024),r&&r.material&&(t+=512)}),t}addEventListener(e,t){this._eventListeners.has(e)||this._eventListeners.set(e,[]),this._eventListeners.get(e).push(t)}removeEventListener(e,t){const a=this._eventListeners.get(e);if(a){const r=a.indexOf(t);r!==-1&&a.splice(r,1)}}async loadTileSet(e,t){const r=(e.endsWith("/")?e.slice(0,-1):e)+"/"+t;this.rootURL=r}get modelList(){const e=[];return this.forEachLoadedModel(t=>{e.push(t)}),e}}class xm{asset;extras;geometricError;properties;refine;root;extensionsUsed;extensionsRequired;extensions}class Fm{boundingVolume;children;geometricError;transform;content;contents;refine;extensions;extras}class km{boundingVolume;geometricError;refine;content;contents;children;transform;extensions;extras}class Em{uri;group;metadata}class wm{class;properties}function Rm(s,e){let t=0,a=null;return function(...r){const i=Date.now(),n=i-t;n>=e?(t=i,s.apply(this,r)):(a!==null&&clearTimeout(a),a=window.setTimeout(()=>{t=Date.now(),s.apply(this,r),a=null},e-n))}}class Im extends Dt{static count=0;constructor(){super(),Y.register("ColorLitShader",bd),this.shader=new gt;let e=new Xe("ColorLitShader","ColorLitShader");e.passType=le.COLOR,this.shader.addRenderPass(e),e.setDefine("USE_BRDF",!0),e.setShaderEntry("VertMain","FragMain"),e.setUniformColor("baseColor",new J),e.setUniformColor("emissiveColor",new J),e.setUniformFloat("envIntensity",1),e.setUniformFloat("normalScale",1),e.setUniformFloat("roughness",0),e.setUniformFloat("metallic",0),e.setUniformFloat("ao",1),e.setUniformFloat("alphaCutoff",0);let t=e.shaderState;t.acceptShadow=!0,t.receiveEnv=!0,t.acceptGI=!0,t.useLight=!0,e.setTexture("normalMap",_.res.normalTexture),e.setTexture("emissiveMap",_.res.blackTexture)}clone(){return null}debug(){}}class Qm extends Dt{constructor(){super();let e=new Xe("LambertShader","LambertShader");e.setShaderEntry("VertMain","FragMain"),e.passType=le.COLOR,e.setUniformVector4("transformUV1",new he(0,0,1,1)),e.setUniformVector4("transformUV2",new he(0,0,1,1)),e.setUniformColor("baseColor",new J(1,1,1,1)),e.setUniformFloat("alphaCutoff",.5);let t=e.shaderState;t.acceptShadow=!1,t.castShadow=!1,t.receiveEnv=!1,t.acceptGI=!1,t.useLight=!1;let a=new gt;a.addRenderPass(e),this.shader=a,this.baseMap=_.res.grayTexture}set baseMap(e){this.shader.setTexture("baseMap",e)}get baseMap(){return this.shader.getTexture("baseMap")}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set envMap(e){}set shadowMap(e){}}function Tm(s,e){}class Mm extends Dt{constructor(){super(),this.shader=new d.UnLitTexArrayShader,this.baseMap=_.res.whiteTexture}set baseMap(e){this.shader.setTexture("baseMap",e)}get baseMap(){return this.shader.getTexture("baseMap")}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set shadowMap(e){}}class Lo{clipName;loopTime;startTime;stopTime;sampleRate;useSkeletonPos;useSkeletonScale;positionCurves=new Map;rotationCurves=new Map;scaleCurves=new Map;floatCurves=new Map;formBytes(e){if(this.clipName=e.readUTF(),this.loopTime=!e.readInt32(),this.startTime=e.readFloat32(),this.stopTime=e.readFloat32(),this.sampleRate=e.readInt32(),this.useSkeletonPos=e.readInt32()>0,this.useSkeletonScale=e.readInt32()>0,this.useSkeletonPos){let r=e.readInt32();for(let i=0;i<r;i++){let n=new yr;n.formBytes(e),this.positionCurves.set(n.path,n)}}let t=e.readInt32();for(let r=0;r<t;r++){let i=new yr;i.formBytes(e),this.rotationCurves.set(i.path,i)}if(this.useSkeletonScale){let r=e.readInt32();for(let i=0;i<r;i++){let n=new yr;n.formBytes(e),this.scaleCurves.set(n.path,n)}}let a=e.readInt32();for(let r=0;r<a;r++){let i=new yr;i.formBytes(e),this.floatCurves.set(i.attribute,i)}}}class yr{path;attribute;propertys;preInfinity;postInfinity;rotationOrder;m_curves;k=0;_cacheValue;_kValue;constructor(e=1){this.k=e,this.m_curves=[],this.check()}check(){for(let e=0;e<this.k;e++)this.m_curves[e]||=new Ni;switch(this.k){case 1:this._cacheValue=0;break;case 2:this._cacheValue=new de;break;case 3:this._cacheValue=new b;break;case 4:this._cacheValue=new he;break}}get totalTime(){return this.m_curves[0].totalTime}addKeyFrame(e){for(let t=0;t<this.k;t++)this.m_curves[t].addKeyFrame(e.getK(t))}removeKeyFrame(e){for(let t=0;t<this.k;t++)this.m_curves[t].removeKeyFrame(e.getK(t))}getValue(e){switch(this.k){case 1:this._cacheValue=this.m_curves[0].getValue(e);break;case 2:this._cacheValue.x=this.m_curves[0].getValue(e),this._cacheValue.y=this.m_curves[1].getValue(e);break;case 3:this._cacheValue.x=this.m_curves[0].getValue(e),this._cacheValue.y=this.m_curves[1].getValue(e),this._cacheValue.z=this.m_curves[2].getValue(e);break;case 4:const t=this.m_curves[0].getCurveFramesExtent(e),a=t.lhsIndex,r=t.rhsIndex;e=t.time;let i=this.m_curves[0].getKey(a),n=this.m_curves[0].getKey(r);e%=this.m_curves[0].totalTime;let o=(e-i.time)/(n.time-i.time);ae.HELP_0.set(this.m_curves[0].getKey(a).value,this.m_curves[1].getKey(a).value,this.m_curves[2].getKey(a).value,this.m_curves[3].getKey(a).value),ae.HELP_1.set(this.m_curves[0].getKey(r).value,this.m_curves[1].getKey(r).value,this.m_curves[2].getKey(r).value,this.m_curves[3].getKey(r).value),ae.HELP_2.slerp(ae.HELP_0,ae.HELP_1,o),this._cacheValue.x=ae.HELP_2.x,this._cacheValue.y=ae.HELP_2.y,this._cacheValue.z=ae.HELP_2.z,this._cacheValue.w=ae.HELP_2.w;break}return this._cacheValue}getKeyCount(){return this.m_curves[0].getKeyCount()}getKey(e){let t=[];for(let a=0;a<this.k;a++)t.push(this.m_curves[a].getKey(e));return t}formBytes(e){this.path=e.readUTF(),this.k=e.readInt32(),this.check(),this.attribute=e.readUTF(),this.propertys=this.attribute.split("."),this.preInfinity=e.readInt32(),this.postInfinity=e.readInt32(),this.rotationOrder=e.readInt32();let t=e.readInt32();for(let a=0;a<t;a++){let r=new $i(0);r.formBytes(e),this.addKeyFrame(r)}}}class Nm extends Map{negtive;constructor(e){if(super(e),this.negtive=new Map,e)for(let t of e)this.negtive.set(t[1],t[0])}delete(e){if(this.has(e)){let t=this.get(e);return this.negtive.delete(t),super.delete(e)}return!1}getKey(e){return this.negtive.get(e)}deleteValue(e){let t=this.negtive.get(e);return t&&this.delete(t),this.negtive.delete(e)}set(e,t){return super.set(e,t),this.negtive.set(t,e),this}clear(){this.negtive.clear(),super.clear()}}class Pm{colorArray;constructor(e){this.colorArray=e}getColor(e){let t=e*this.colorArray.length,a=Math.floor(t),r=Math.min(a+1,this.colorArray.length-1),i=this.colorArray[a],n=this.colorArray[r];return J.lerp(t-a,i,n)}}class Gn{controlVertices;constructor(e){this.setControlVertices(e)}setControlVertices(e){e.length==4&&(this.controlVertices=e.concat())}getPoint(e){if(!(e>=0&&e<=1))return b.ZERO;let t=1-e,a=t*t*t,r=3*e*t*t,i=3*e*e*t,n=e*e*e;return this.controlVertices[0].mul(a).add(this.controlVertices[1].mul(r)).add(this.controlVertices[2].mul(i)).add(this.controlVertices[3].mul(n))}getTangent(e){if(!(e>=0&&e<=1))return b.ZERO;let t=this.controlVertices,a=t[0].add(t[1].add(t[0]).mul(e)),r=t[1].add(t[2].add(t[1]).mul(e)),i=t[2].add(t[3].add(t[2]).mul(e)),n=a.add(r.subtract(a).mul(e));return r.add(i.subtract(r).mul(e)).subtract(n)}getClosestParam(e,t=1e-6){return this.getClosestParamRec(e,0,1,t)}getClosestParamRec(e,t,a,r){let i=(t+a)/2;if(a-t<r)return i;let n=(t+i)/2,o=(i+a)/2,l=this.getPoint(n),c=this.getPoint(o),f=l.subtract(e).lengthSquared,h=c.subtract(e).lengthSquared;return f<h?a=i:t=i,this.getClosestParamRec(e,t,a,r)}}var Gh=(s=>(s[s.Open=0]="Open",s[s.Closed=1]="Closed",s))(Gh||{});class Vm{type=0;numCurveSegments=0;numControlVertices=0;controlVertices=[];constructor(e,t=0){this.setControlVertices(e,t)}getPathType(){return this.type}isClosed(){return this.type==1}isValid(){return this.numCurveSegments>0}clear(){this.controlVertices.length=0,this.type=0,this.numCurveSegments=0,this.numControlVertices=0}computeApproxLength(){if(!this.isValid())return 0;let e=this.numCurveSegments+1;if(e<2)return 0;let t=0,a=this.controlVertices;for(let r=1;r<e;r++){let i=a[(r-1)*3],n=a[r*3];t+=i.subtract(n).lengthSquared}return t==0?0:t}computeApproxParamPerUnitLength(){let e=this.computeApproxLength();return this.numCurveSegments/e}computeApproxNormParamPerUnitLength(){return 1/this.computeApproxLength()}interpolatePoints(e,t){let a=e.length;a<2&&console.error("point count must great 1"),this.clear(),this.type=t;let r=this.controlVertices;switch(t){case 0:{this.numCurveSegments=a-1,this.numControlVertices=3*a-2,r.length=this.numControlVertices;for(let o=0;o<a;o++)r[o*3]=e[o];let i=e[1].subtract(e[0]).mul(.25);r[1]=e[0].add(i);let n=e[a-2].subtract(e[a-1]).mul(.25);r[this.numControlVertices-2]=e[a-1].add(n);for(let o=1;o<this.numCurveSegments;o++){let l=e[o-1].subtract(e[o]),c=e[o+1].subtract(e[o]),f=l.lengthSquared,h=c.lengthSquared;if(f>0&&h>0){let u=(f+h)/8,g=c.div(h).subtract(l.div(f));g.normalize(),g=g.mul(u),r[o*3-1]=e[o].subtract(g),r[o*3+1]=e[o].add(g)}else r[o*3-1]=e[o],r[o*3+1]=e[o]}break}case 1:{this.numCurveSegments=a,this.numControlVertices=3*a+1,r.length=this.numControlVertices;for(let i=0;i<a;i++)r[i*3]=e[i];r[this.numControlVertices-1]=e[0];for(let i=1;i<=this.numCurveSegments;i++){let n=i-1,o=(i+1)%this.numCurveSegments,l=i%this.numCurveSegments,c=e[n].subtract(e[l]),f=e[o].subtract(e[l]),h=c.lengthSquared,u=f.lengthSquared,g=3*i-1,A=(3*i+1)%(this.numControlVertices-1);if(h>0&&u>0){let m=(h+u)/8,p=f.div(u).subtract(c.div(h));p.normalize(),p=p.mul(m),r[g]=e[l].subtract(p),r[A]=e[l].add(p)}else r[g]=e[l],r[A]=e[l]}break}}}setControlVertices(e,t){let a=e.length;a<=0||t==0&&a<4||t==1&&a<7||(a-1)%3==0&&(this.clear(),this.type=t,this.numControlVertices=a,this.numCurveSegments=(a-1)/3,this.controlVertices=e)}getPoint(e){if(this.type==1){for(;e<0;)e+=this.numCurveSegments;for(;e>this.numCurveSegments;)e-=this.numCurveSegments}else e=Pt.clampf(e,0,this.numCurveSegments);if(!(e>=0)&&e<=this.numCurveSegments)return;let t=Math.floor(e);t>=this.numCurveSegments&&(t=this.numCurveSegments-1);let a=[],r=this.controlVertices;return a[0]=r[3*t+0],a[1]=r[3*t+1],a[2]=r[3*t+2],a[3]=r[3*t+3],new Gn(a).getPoint(e-t)}getPointNorm(e){return this.getPoint(e*this.numCurveSegments)}getTangent(e){if(this.type==1){for(;e<0;)e+=this.numCurveSegments;for(;e>this.numCurveSegments;)e-=this.numCurveSegments}else e=Pt.clampf(e,0,this.numCurveSegments);if(!(e>=0)&&e<=this.numCurveSegments)return;let t=Math.floor(e);t>=this.numCurveSegments&&(t=this.numCurveSegments-1);let a=this.controlVertices,r=[];return r[0]=a[3*t+0],r[1]=a[3*t+1],r[2]=a[3*t+2],r[3]=a[3*t+3],new Gn(r).getTangent(e-t)}getTangentNorm(e){return this.getTangent(e*this.numCurveSegments)}computeClosestParam(e,t){let a=Number.MAX_SAFE_INTEGER,r=0,i=[],n=new Gn(i);for(let o=0;o<this.controlVertices.length-1;o+=3){for(let h=0;h<4;h++)i[h]=this.controlVertices[o+h];n.setControlVertices(i);let l=n.getClosestParam(e,t),f=n.getPoint(l).subtract(e).lengthSquared;f<a&&(a=f,r=o/3+l)}return r}computeClosestNormParam(e,t){return this.computeClosestParam(e,t*this.numCurveSegments)}}class Om extends Map{valueList;keyList;isChange=!0;constructor(e,t,a){if(super(e),t&&(this.keyList=[]),a&&(this.valueList=[]),e)for(let r of e)this.valueList?.push(r[1]),this.keyList?.push(r[0])}delete(e){if(this.has(e)){let t=this.get(e);return this.valueList&&this.deleteValue(t),this.keyList&&this.deleteKey(e),this.isChange=!0,super.delete(e)}return!1}deleteValue(e){let t=this.valueList.indexOf(e);return t>=0&&this.valueList.splice(t,1),this}deleteKey(e){let t=this.keyList.indexOf(e);return t>=0&&this.keyList.splice(t,1),this}set(e,t){return this.delete(e),this.keyList?.push(e),this.valueList?.push(t),super.set(e,t),this.isChange=!0,this}clear(){this.valueList&&(this.valueList.length=0),this.keyList&&(this.keyList.length=0),this.isChange=!0,super.clear()}}var zh=(s=>(s[s.kParticleSystemClampVelocityCurveId=322376503]="kParticleSystemClampVelocityCurveId",s[s.kParticleSystemForceCurveId=306581307]="kParticleSystemForceCurveId",s[s.kParticleSystemRotationCurveId=1793934638]="kParticleSystemRotationCurveId",s[s.kParticleSystemRotationBySpeedCurveId=3737431713]="kParticleSystemRotationBySpeedCurveId",s[s.kParticleSystemStartSpeedCurveId=2527743459]="kParticleSystemStartSpeedCurveId",s[s.kParticleSystemSizeCurveId=2368504881]="kParticleSystemSizeCurveId",s[s.kParticleSystemSizeBySpeedCurveId=4085612399]="kParticleSystemSizeBySpeedCurveId",s[s.kParticleSystemVelocityCurveId=3774601268]="kParticleSystemVelocityCurveId",s[s.kParticleSystemUVCurveId=326370691]="kParticleSystemUVCurveId",s[s.kParticleSystemColorGradientId=1494990940]="kParticleSystemColorGradientId",s[s.kParticleSystemColorByVelocityGradientId=1089181156]="kParticleSystemColorByVelocityGradientId",s[s.kParticleSystemMeshSelectionId=3159510623]="kParticleSystemMeshSelectionId",s[s.kParticleSystemUVRowSelectionId=2941263940]="kParticleSystemUVRowSelectionId",s))(zh||{});const Lm=3.141592653589793;class Gm{}function Wh(s,e,t){let a=.3333333333333333,r=.5,i=s*a,n=i*i,l=n*i-i*e*r+t*r,c=-n+e*a,f=c*c*c,h=f+l*l;if(h>=0){let A=Math.sqrt(h)-l;return A=A>0?Math.pow(A,a):-Math.pow(-A,a),-i-c/A+A}let u=Math.sqrt(-f),g=Math.acos(-l/u);return u=Math.pow(u,a),u=u-c/u,g=-i+u*Math.cos(g*a),g}function zn(s,e,t,a){let r=1e-5;if(Math.abs(s)<r)return Math.abs(e)>r?(a.r0=-t/e,1):0;let i=e*e-4*s*t;if(i<0)return 0;let n=.5/s,o=Math.sqrt(i);return a.r0=(o-e)*n,a.r1=(-o-e)*n,2}function Jh(s,e,t,a,r){let i=0;if(Math.abs(e)>=1e-4){let n=t/e,o=a/e,l=r/e;s[0]=Wh(n,o,l),i++;let c=e,f=t+e*s[0],h=a+t*s[0]+e*s[0]*s[0];i+=zn(c,f,h,{r0:s[1],r1:s[2]})}else i+=zn(t,a,r,{r0:s[1],r1:s[2]});return i}class Oa{coeff=[];static EvalSegment(e,t){return e*(e*(e*t[0]+t[1])+t[2])+t[3]}}class ar{static kMaxNumSegments=8;segments=[];integrationCache=[];doubleIntegrationCache=[];times=[];segmentCount;constructor(){this.segments[ar.kMaxNumSegments]=new Oa,this.integrationCache[ar.kMaxNumSegments]=0,this.doubleIntegrationCache[ar.kMaxNumSegments]=0,this.times[ar.kMaxNumSegments]=0}calculateMinMax(e,t){e.x=Math.min(e.x,t),e.y=Math.max(e.y,t)}findMinMaxDoubleIntegrated(){let e=de.ZERO.clone(),t=20,a=1/t,r=a;for(let i=0;i<t;i++)this.calculateMinMax(e,this.evaluateDoubleIntegrated(r)),r+=a;return e}findMinMaxIntegrated(){let e=de.ZERO.clone(),t=[],a=[];for(let r=0;r<this.segmentCount;r++){let i=4*this.segments[r].coeff[0],n=3*this.segments[r].coeff[1],o=2*this.segments[r].coeff[2],l=1*this.segments[r].coeff[3],c=[],f=Jh(c,i,n,o,l);for(let h=0;h<f;h++){let u=c[h]+t[r];u>=t[r]&&u<a[r]&&this.calculateMinMax(e,this.evaluateIntegrated(u))}this.calculateMinMax(e,this.evaluateIntegrated(a[r])),this.times[r]}return e}generateIntegrationCache(e){e.integrationCache[0]=0;let t=e.times[0],a=0;for(let r=1;r<e.segmentCount;r++){let i=e.segments[r-1].coeff;Go(i);let n=t-a;e.integrationCache[r]=e.integrationCache[r-1]+Oa.EvalSegment(n,i)*n,a=t,t=e.times[r]}}generateDoubleIntegrationCache(e){let t=0,a=0;for(let r=0;r<e.segmentCount;r++){e.doubleIntegrationCache[r]=t;let i=e.times[r]-a;i=Math.max(i,0),t+=Oa.EvalSegment(i,e.segments[r].coeff)*i*i+e.integrationCache[r]*i,a=e.times[r]}}integrate(){this.generateIntegrationCache(this);for(let e=0;e<this.segmentCount;e++)Go(this.segments[e].coeff)}doubleIntegrate(){this.generateIntegrationCache(this);for(let e=0;e<this.segmentCount;e++)jh(this.segments[e].coeff);this.generateDoubleIntegrationCache(this)}static isValidCurve(e){let t=e.getKeyCount(),a=t-1;return e.getKey(0).time!=0&&a++,e.getKey(t-1).time!=1&&a++,a<=ar.kMaxNumSegments}evaluateDoubleIntegrated(e){let t=0;for(let a=0;a<this.segmentCount;a++){if(e<=this.times[a]){let r=e-t;return this.doubleIntegrationCache[a]+this.integrationCache[a]*r+Oa.EvalSegment(r,this.segments[a].coeff)*r*r}t=this.times[a]}return 1}evaluateIntegrated(e){let t=0;for(let a=0;a<this.segmentCount;a++){if(e<=this.times[a]){let r=e-t;return this.integrationCache[a]+Oa.EvalSegment(r,this.segments[a].coeff)*r}t=this.times[a]}return 1}evaluate(e){let t=0;for(let a=0;a<this.segmentCount;a++){if(e<=this.times[a])return Oa.EvalSegment(e-t,this.segments[a].coeff);t=this.times[a]}return 1}buildCurve(e,t){let a=e.getKeyCount();this.segmentCount=1;let r=1.01;if(this.segments.length=0,this.integrationCache.length=0,this.doubleIntegrationCache.length=0,this.times.length=0,this.times[0]=r,a!=0)if(a==1)this.segments[0]=new Oa,this.segments[0].coeff[3]=e.getKey(0).value*t;else{this.segmentCount=a-1;let i=0;e.getKey(0).time!=0&&(this.segments[0].coeff[3]=e.getKey(0).value,this.times[0]=e.getKey(0).time,i=1);for(let n=0;n<this.segmentCount;n++){let o;e.calculateCacheData(o,n,n+1,0),this.segments[n+i].coeff=o.coeff.concat(),this.times[n+i]=e.getKey(n+1).time}this.segmentCount+=i,e.getKey(a-1).time!=1&&(this.segments[this.segmentCount].coeff[3]=e.getKey(a-1).value,this.segmentCount++),this.times[this.segmentCount-1]=r;for(let n=0;n<this.segmentCount;n++)this.segments[n].coeff[0]*=t,this.segments[n].coeff[1]*=t,this.segments[n].coeff[2]*=t,this.segments[n].coeff[3]*=t}return!0}}function jh(s){s[0]/=20,s[1]/=12,s[2]/=6,s[3]/=2}function Go(s){s[0]/=4,s[1]/=3,s[2]/=2,s[3]/=1}var Zh=(s=>(s[s.kEMScalar=0]="kEMScalar",s[s.kEMOptimized=1]="kEMOptimized",s[s.kEMOptimizedMinMax=2]="kEMOptimizedMinMax",s[s.kEMSlow=3]="kEMSlow",s))(Zh||{}),Yh=(s=>(s[s.kMMCScalar=0]="kMMCScalar",s[s.kMMCCurve=1]="kMMCCurve",s[s.kMMCTwoCurves=2]="kMMCTwoCurves",s[s.kMMCTwoConstants=3]="kMMCTwoConstants",s))(Yh||{});class zm{max;min}class Wm{max;min;integrate(){this.max.integrate(),this.min.integrate()}doubleIntegrate(){this.max.doubleIntegrate(),this.min.doubleIntegrate()}findMinMaxIntegrated(){return null}findMinMaxDoubleIntegrated(){return null}}class Xh{minMaxState;minCurve;maxCurve;_scalar=1;_minScalar;constructor(e=1){this._scalar=e,this.minMaxState=0,this.minCurve=new Ni,this.maxCurve=new Ni}setScalar(e){this._scalar=e}getScalar(){return this._scalar}static evaluateSlow(e,t,a){let r=e.maxCurve.getValue(t)*e.getScalar();return e.minMaxState==2?Sr(e.minCurve.getValue(t)*e.getScalar(),r,a):r}static evaluate(e,t,a=1){if(e.minMaxState==0)return e.getScalar();let r=e.maxCurve.getValue(t)*e.getScalar();return e.minMaxState==1?Sr(e.minCurve.getValue(t)*e.getScalar(),r,a):e.minMaxState==3?Sr(e._minScalar,e._scalar,a):e.minMaxState==2?Sr(e.minCurve.getValue(t)*e.getScalar(),r,1*Math.random()):this.evaluateSlow(e,t,1)}unSerialized(e){this.minMaxState=e.minMaxState,this._scalar=e.scalar,this._minScalar=e.minScalar,this.maxCurve.unSerialized(e.maxCurve),this.minCurve.unSerialized(e.minCurve)}}class Jm{value=0;mode=0;spread=0;speed=new Xh;unSerialized(e){this.value=e.value,this.mode=e.mode,this.spread=e.spread,this.speed.unSerialized(e.speed)}}function jm(s,e){let t=ar.isValidCurve(s.max);return e!=2&&e!=3?t:t&&ar.isValidCurve(s.min)}function Zm(s,e,t,a){s.max.buildCurve(e.max,t),a!=2&&a!=3?s.min.buildCurve(e.max,t):s.min.buildCurve(e.min,t)}function Ym(s,e){let t=e.getKeyCount();if(t!=0)if(t==1)Ki(s,e.getKey(0).value);else{let a=t-1;Ki(s,e.getKey(0).value);for(let r=0;r<a;r++){let i=new fo;e.calculateCacheData(i,r,r+1,0);let n=3*i.coeff[0],o=2*i.coeff[1],l=1*i.coeff[2],c=e.getKey(r).time,f=e.getKey(r+1).time,h=[],u=zn(n,o,l,{r0:h[0],r1:h[1]});for(let g=0;g<u;g++)h[g]>=0&&h[g]+c<f&&Ki(s,Oa.EvalSegment(h[g],i.coeff));Ki(s,Oa.EvalSegment(f-c,i.coeff))}}}function Ki(s,e){s.x=Math.min(s.x,e),s.y=Math.max(s.y,e)}class Or{static BACK=0;static FRONT=1;static IN=0;static OUT=1;static INTERSECT=2}class Hh{a;b;c;d;static ALIGN_ANY=0;static ALIGN_XY_AXIS=1;static ALIGN_YZ_AXIS=2;static ALIGN_XZ_AXIS=3;constructor(e=0,t=0,a=0,r=0){this.a=e,this.b=t,this.c=a,this.d=r}setTo(e=0,t=0,a=0,r=0){this.a=e,this.b=t,this.c=a,this.d=r}fromPoints(e,t,a){var r=t.x-e.x,i=t.y-e.y,n=t.z-e.z,o=a.x-e.x,l=a.y-e.y,c=a.z-e.z;this.a=i*c-n*l,this.b=n*o-r*c,this.c=r*l-i*o,this.d=-(this.a*e.x+this.b*e.y+this.c*e.z)}fromNormalAndPoint(e,t){this.a=e.x,this.b=e.y,this.c=e.z,this.d=-(this.a*t.x+this.b*t.y+this.c*t.z)}normalize(){var e=Math.sqrt(this.a*this.a+this.b*this.b+this.c*this.c);if(e>0){var t=1/e;this.a*=t,this.b*=t,this.c*=t,this.d*=t}return e}distance(e){return this.a*e.x+this.b*e.y+this.c*e.z+this.d}classifyPoint(e,t=.01){var a=this.distance(e);return a<-t?Or.BACK:a>t?Or.FRONT:Or.INTERSECT}toString(){return"Plane3D [a:"+this.a+", b:"+this.b+", c:"+this.c+", d:"+this.d+"]"}}function Xm(s,e){return Math.random()*e+Math.random()*s+(e-s)*Math.random()}function Hm(s,e,t){let a=t*Math.random();return Math.random()*e*a+Math.random()*s*a+(e-s)*Math.random()*a}function Kh(s,e,t){let a=0,r=0;for(;a===0;)a=Math.random();for(;r===0;)r=Math.random();let i=Math.sqrt(-2*Math.log(a))*Math.cos(2*Math.PI*r);return i=i/10+.5,(i>1||i<0)&&(i=Kh(s,e,t)),i=Math.pow(i,t),i*=e-s,i+=s,i}function Sa(s){return s>0?Math.floor(s):Math.floor(s)-1}let Ue=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];function zo(s,e){let t=s&15,a=1+(t&7);return t&8&&(a=-a),a*e}function Wn(s,e,t){let a=s&7,r=a<4?e:t,i=a<4?t:e;return(a&1?-r:r)+(a&2?-2*i:2*i)}function qi(s,e,t,a){let r=s&15,i=r<8?e:t,n=r<4?t:r==12||r==14?e:a;return(r&1?-i:i)+(r&2?-n:n)}function ui(s,e,t,a,r){let i=s&31,n=i<24?e:t,o=i<16?t:a,l=i<8?a:r;return(i&1?-n:n)+(i&2?-o:o)+(i&4?-l:l)}let ea=[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]];function Km(s){let e=Sa(s),t=e+1,a=s-e,r=a-1,i,n,o=1-a*a;o*=o,i=o*o*zo(Ue[e&255],a);let l=1-r*r;return l*=l,n=l*l*zo(Ue[t&255],r),.25*(i+n)}function qm(s,e){const t=.366025403,a=.211324865;let r,i,n,o=(s+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Ie-Me*Me-ze*ze;zr<0?l=0:(zr*=zr,l=zr*zr*ui(Ue[ua+ee+Ue[Mt+oe+Ue[Ea+fe+Ue[ba+De]]]],Se,Ie,Me,ze));let Wr=.6-Vt*Vt-ut*ut-ir*ir-ka*ka;Wr<0?c=0:(Wr*=Wr,c=Wr*Wr*ui(Ue[ua+Ne+Ue[Mt+Ke+Ue[Ea+q+Ue[ba+ne]]]],Vt,ut,ir,ka));let Jr=.6-Ga*Ga-za*za-ta*ta-Wa*Wa;return Jr<0?f=0:(Jr*=Jr,f=Jr*Jr*ui(Ue[ua+1+Ue[Mt+1+Ue[Ea+1+Ue[ba+1]]]],Ga,za,ta,Wa)),27*(n+o+l+c+f)}class Wo extends de{static uv_0=new Wo;u=0;v=0;constructor(e=0,t=0){super(e,t),this.u=e,this.v=t}length(){return 0}static getUVSheet(e,t,a){let r=Math.floor(e%(t*a)),i=Math.floor(r/t),n=r%t;return new he(i/t,n/a,1/t,1/a)}}class $i{serializedVersion="2";time;tangentMode=0;weightedMode=0;propertyKeyFrame;constructor(e=0){this.time=e,this.propertyKeyFrame={}}getK(e){return this.propertyKeyFrame[e]}split(e,t,a){switch(e){case X.single:{let r=this.getKeyFrame(0);r[a]=t}break;case X.float:{let r=this.getKeyFrame(0);r[a]=t}break;case X.vector2:{let r=t,i=this.getKeyFrame(0);i[a]=r.x;let n=this.getKeyFrame(1);n[a]=r.y}break;case X.vector3:{let r=t,i=this.getKeyFrame(0);i[a]=r.x;let n=this.getKeyFrame(1);n[a]=r.y;let o=this.getKeyFrame(2);o[a]=r.z}break;case X.vector4:{let r=t,i=this.getKeyFrame(0);i[a]=r.x;let n=this.getKeyFrame(1);n[a]=r.y;let o=this.getKeyFrame(2);o[a]=r.z;let l=this.getKeyFrame(3);l[a]=r.w}break;case X.quaternion:{let r=t,i=this.getKeyFrame(0);i[a]=r.x;let n=this.getKeyFrame(1);n[a]=r.y;let o=this.getKeyFrame(2);o[a]=r.z;let l=this.getKeyFrame(3);l[a]=r.w}break}}getKeyFrame(e){let t=this.propertyKeyFrame[e];return t||(t=new kn,t.time=this.time,t.tangentMode=this.tangentMode,t.weightedMode=this.weightedMode,this.propertyKeyFrame[e]=t),t}formBytes(e){this.time=e.readFloat32();{let{t,v:a}=Va.parser(e);this.split(t,a,"value")}{let{t,v:a}=Va.parser(e);this.split(t,a,"inSlope")}{let{t,v:a}=Va.parser(e);this.split(t,a,"outSlope")}this.tangentMode=e.readInt32(),this.weightedMode=e.readInt32();{let{t,v:a}=Va.parser(e);this.split(t,a,"inWeight")}{let{t,v:a}=Va.parser(e);this.split(t,a,"outWeight")}}}class tp{static sub(e,t){switch(e.constructor.name){case"number":return e-t;case"Vector2":{let r=e,i=t;return new de(r.x-i.x,r.y-i.y)}case"Vector3":{let r=e,i=t;return new b(r.x-i.x,r.y-i.y,r.z-i.z)}case"Vector4":{let r=e,i=t;return new he(r.x-i.x,r.y-i.y,r.z-i.z,r.w-i.w)}case"Quaternion":{let r=e,i=t;return new ae(r.x-i.x,r.y-i.y,r.z-i.z,r.w-i.w)}}}}class en{_keys=new Array;_values=new Array;getIndexByKey(e){return this._keys.indexOf(e)}getValueByKey(e){var t=this.getIndexByKey(e);return t>-1?this._values[t]:null}put(e,t){if(e==null)return null;var a=this.remove(e);return this._keys.push(e),this._values.push(t),a}remove(e){var t=this._keys.indexOf(e),a;return t>-1&&(a=this._values[t],this._keys.splice(t,1),this._values.splice(t,1)),a}getValues(){return this._values}getKeys(){return this._keys}clear(){this._values.length=0,this._keys.length=0}}class Cr{static WalkAble=1}class tn{static SetConst(e){this.EPSILON=e,this.POWER_EPSILON=e*e}static EPSILON=.1;static POWER_EPSILON=this.EPSILON*this.EPSILON}class Tt extends b{static CALC_VECTOR3D1=new b;static CALC_VECTOR3D2=new b;static CALC_VECTOR3D3=new b;static CALC_VECTOR3D4=new b;static CALC_VECTOR3D5=new b;_pointId=0;constructor(e,t,a,r){super(t,a,r,0),this._pointId=e}get id(){return this._pointId}static equalPoint(e,t){return(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y)+(e.z-t.z)*(e.z-t.z)<tn.POWER_EPSILON}static calcDistance(e,t){return Tt.CALC_VECTOR3D3.setTo(e.x-t.x,e.y-t.y,e.z-t.z),Tt.CALC_VECTOR3D3.length}}class qh{_openedList;_closedList;_endNode;_startNode;_triangleChannel;_navMesh;_findIndex=0;constructor(){this._openedList=new Array,this._closedList=new Array}findPath(e,t,a){return this._findIndex++,this._navMesh=e,this._startNode=t,this._endNode=a,this._openedList.length=0,this._closedList.length=0,this._startNode&&this._endNode?(this._startNode.gg=0,this._startNode.h=0,this._startNode.f=0,this._startNode.parent=null,this.search()):!1}search(){for(var e=this._startNode,t=[],a;e!=this._endNode;){t=e.getNeibourTriangles(t,Cr.WalkAble,Cr.WalkAble);for(a of t)if(a.closeId!=this._findIndex&&!(a==e||!a.walkAble)){var r=e.gg+Tt.calcDistance(a,e)*a.costMultiplier,i=Tt.calcDistance(a,this._endNode),n=r+i;a.openId==this._findIndex?a.f>n&&(a.f=n,a.gg=r,a.h=i,a.parent=e):(a.f=n,a.gg=r,a.h=i,a.parent=e,a.openId=this._findIndex,this._openedList.push(a))}if(e.closeId=this._findIndex,this._closedList.push(e),this._openedList.length==0)return!1;this._openedList.sort(function(o,l){return o.f-l.f}),e=this._openedList.shift()}return this.buildPath(),!0}buildPath(){this._triangleChannel=[];var e=this._endNode;for(this._triangleChannel.push(e);e!=this._startNode;)e=e.parent,this._triangleChannel.unshift(e)}get channel(){return this._triangleChannel}}class xa extends Tt{_ownerPoint;_ownerEdge;radius=0;constructor(e,t){super(e.id,0,0,0),this._ownerEdge=t,this._ownerPoint=e}get ownerPoint(){return this._ownerPoint}get ownerEdge(){return this._ownerEdge}scalePoint(e=.7){var t=new xa(this._ownerPoint,this._ownerEdge);return t.copyFrom(this),t.decrementBy(this._ownerPoint),t.scaleBy(e),t.radius=t.length,t.incrementBy(this._ownerPoint),t}}class Fa{_edgeMask=0;_edgeSize=0;_pointA;_pointB;_triangleOwners;_centerPoint;_edgeDirA2B;crossPoint;fatPointA;fatPointB;static CALC_FAT_VECTOR=new b;constructor(e,t){if(this._pointA=e,this._pointB=t,e.id>=t.id)throw new Error("edge point order error!!!");this._triangleOwners=new Array,this._centerPoint=new b,this._edgeMask=Cr.WalkAble,Tt.CALC_VECTOR3D1.setTo(e.x-t.x,e.y-t.y,e.z-t.z),this._edgeSize=Tt.CALC_VECTOR3D1.length,this._centerPoint.setTo((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2)}get size(){return this._edgeSize}get triangleOwners(){return this._triangleOwners}get centerPoint(){return this._centerPoint}initFatPoints(e){this._edgeDirA2B=this._pointB.subtract(this._pointA),this._edgeDirA2B.normalize(),this.fatPointA=this.fatPointA||new xa(this._pointA,this),this.fatPointB=this.fatPointB||new xa(this._pointB,this),this.fatPointA.radius!=e&&(Fa.CALC_FAT_VECTOR.copyFrom(this._edgeDirA2B),Fa.CALC_FAT_VECTOR.scaleBy(e),Fa.CALC_FAT_VECTOR.incrementBy(this._pointA),this.fatPointA.copyFrom(Fa.CALC_FAT_VECTOR),this.fatPointA.radius=e),this.fatPointB.radius!=e&&(Fa.CALC_FAT_VECTOR.copyFrom(this._edgeDirA2B),Fa.CALC_FAT_VECTOR.scaleBy(-e),Fa.CALC_FAT_VECTOR.incrementBy(this._pointB),this.fatPointB.copyFrom(Fa.CALC_FAT_VECTOR),this.fatPointB.radius=e)}getFatPoint(e){return e==this._pointA?this.fatPointA:this.fatPointB}getAnotherFatPoint(e){return e==this._pointA?this.fatPointB:this.fatPointA}getAnotherPoint(e){return e==this._pointA?this._pointB:this._pointA}containsPoint(e){return Tt.equalPoint(e,this._pointA)?this._pointA:Tt.equalPoint(e,this._pointB)?this._pointB:null}addTriangleOwners(e){if(e.edges.indexOf(this)==-1)throw new Error("the edge is not belong triangle!!!");this._triangleOwners.indexOf(e)==-1&&this._triangleOwners.push(e)}getPublicPoint(e){return this._pointA==e._pointA||this._pointA==e._pointB?this._pointA:this._pointB==e._pointA||this._pointB==e._pointB?this._pointB:null}getEqualPoint(e){return Tt.equalPoint(e,this._pointA)?this._pointA:Tt.equalPoint(e,this._pointB)?this._pointB:null}get pointA(){return this._pointA}get pointB(){return this._pointB}get walkAble(){return(this._edgeMask&Cr.WalkAble)==Cr.WalkAble}testMask(e){return(this._edgeMask&e)==e}}class pe{endPoint;curPoint;rayA;rayB;rayAPoint;rayBPoint;static RAY_1=new b;static RAY_2=new b;static TEST_RAY=new b;static TEST_RAY_1=new b;static TEST_RAY_2=new b;static CALC_CROSS_POINT=new b;static CALC_CROSS_TEST=new b;cornerPoint;cornerEdge;continuePass(e,t,a){this.resetData(),this.curPoint=e,this.endPoint=t,this.cornerEdge=a}passEdge(e,t,a,r){if((this.rayA==null||this.rayB==null)&&(this.rayA=pe.RAY_1,this.rayB=pe.RAY_2,this.rayAPoint=e.pointA,this.rayBPoint=e.pointB,this.rayA.setTo(this.rayAPoint.x-this.curPoint.x,0,this.rayAPoint.z-this.curPoint.z),this.rayB.setTo(this.rayBPoint.x-this.curPoint.x,0,this.rayBPoint.z-this.curPoint.z)),r)return this.checkEndPoint(a);if(pe.TEST_RAY.setTo(a.x-this.curPoint.x,0,a.z-this.curPoint.z),this.isPointAtCenter(pe.TEST_RAY,this.rayA,this.rayB)){this.hasCrossPoint(t.pointA,t.pointB,this.rayAPoint,this.rayA)?(this.rayB.copyFrom(pe.TEST_RAY),a instanceof Tt?this.rayBPoint=a:this.rayBPoint=null):(this.rayA.copyFrom(pe.TEST_RAY),a instanceof Tt?this.rayAPoint=a:this.rayAPoint=null);var i=t.getAnotherPoint(a);pe.TEST_RAY.setTo(i.x-this.curPoint.x,0,i.z-this.curPoint.z),(i==this.rayAPoint||i==this.rayBPoint||this.isPointAtCenter(pe.TEST_RAY,this.rayA,this.rayB))&&(this.cornerEdge=t)}else{var n;if(pe.TEST_RAY_1.copyFrom(t.pointA),pe.TEST_RAY_1.decrementBy(this.curPoint),pe.TEST_RAY_2.copyFrom(t.pointB),pe.TEST_RAY_2.decrementBy(this.curPoint),pe.TEST_RAY_1.y=0,pe.TEST_RAY_2.y=0,this.isPointAtCenter(this.rayA,pe.TEST_RAY_1,pe.TEST_RAY_2)||this.isPointAtCenter(this.rayB,pe.TEST_RAY_1,pe.TEST_RAY_2)?n=!1:n=!0,n)return this.isPointAtCenter(this.rayA,pe.TEST_RAY,this.rayB)?this.cornerPoint=this.rayAPoint:this.cornerPoint=this.rayBPoint,this.cornerEdge.crossPoint=this.cornerPoint,!1}return!0}checkEndPoint(e){return pe.TEST_RAY.setTo(e.x-this.curPoint.x,0,e.z-this.curPoint.z),this.isPointAtCenter(pe.TEST_RAY,this.rayA,this.rayB)?!0:(this.isPointAtCenter(this.rayA,pe.TEST_RAY,this.rayB)?this.cornerPoint=this.rayAPoint:this.cornerPoint=this.rayBPoint,this.cornerEdge.crossPoint=this.cornerPoint,!1)}calcCrossEdge(e,t,a){return this.calcCrossPoint(e.fatPointA,e.fatPointB,t,a)}calcCrossPoint(e,t,a,r){pe.CALC_CROSS_POINT.copyFrom(t),pe.CALC_CROSS_POINT.decrementBy(e);let i=pe.CALC_CROSS_POINT.x*r.z-r.x*pe.CALC_CROSS_POINT.z;var n=0;return i!=0&&(n=((e.z-a.z)*r.x-(e.x-a.x)*r.z)/i),n>1?n=1:n<0&&(n=0),pe.CALC_CROSS_POINT.scaleBy(n),pe.CALC_CROSS_POINT.incrementBy(e),pe.CALC_CROSS_POINT.clone()}calcCrossPointOut(e,t,a,r){pe.CALC_CROSS_POINT.copyFrom(t),pe.CALC_CROSS_POINT.decrementBy(e);var i=((e.z-a.z)*r.x-(e.x-a.x)*r.z)/(pe.CALC_CROSS_POINT.x*r.z-r.x*pe.CALC_CROSS_POINT.z);return i<=1&&i>=0?null:(pe.CALC_CROSS_POINT.scaleBy(i),pe.CALC_CROSS_POINT.incrementBy(e),pe.CALC_CROSS_POINT.clone())}hasCrossPoint(e,t,a,r){pe.CALC_CROSS_TEST.copyFrom(t),pe.CALC_CROSS_TEST.decrementBy(e);var i=((e.z-a.z)*r.x-(e.x-a.x)*r.z)/(pe.CALC_CROSS_TEST.x*r.z-r.x*pe.CALC_CROSS_TEST.z);return i<=1&&i>=0}isPointAtCenter(e,t,a){var r=t.crossProduct(e);if(r.length==0&&e.length<t.length)return!0;var i=a.crossProduct(e);return i.length==0&&e.length<a.length?!0:(r.normalize(),i.normalize(),r.incrementBy(i),r.length<.01)}resetData(){this.cornerEdge=null,this.cornerPoint=null,this.curPoint=null,this.rayA=this.rayB=null,this.rayAPoint=this.rayBPoint=null,pe.RAY_1.setTo(0,0,0),pe.RAY_2.setTo(0,0,0)}}class rr{_aiRadius=0;_router;_result;_tempPublicEdgeList=new Array;_tempSamePlaneList=new Array;static CROSS_TEST_DIRECTION=new b;constructor(){this._router=new pe}searchPath(e,t,a,r=0){return r<=0&&(r=1),this._aiRadius=r*1.5,this.searchEnable(e,t,a)?(this.search(e,t,a),!0):!1}get path(){return this._result}searchEnable(e,t,a){return!(e==null||t==null||a==null||a[0].plane.classifyPoint(e,tn.EPSILON)!=Or.INTERSECT||a[a.length-1].plane.classifyPoint(t,tn.EPSILON)!=Or.INTERSECT)}search(e,t,a){this._tempPublicEdgeList.length=0,this._tempSamePlaneList.length=0;var r=0,i=a.length-1,n,o,l,c;for(r=0;r<i;r++)o=a[r].getPublicEdge(a[r+1]),o.crossPoint=null,o.initFatPoints(this._aiRadius),this._tempPublicEdgeList.push(o),n=a[r],c=n.plane,n=a[r+1],l=n.getEdgeAgainstPoint(o),this._tempSamePlaneList.push(c.classifyPoint(l,tn.EPSILON)==Or.INTERSECT);this._router.continuePass(e,t,this._tempPublicEdgeList[0]),i=this._tempPublicEdgeList.length;var f,h,u,g;for(r=0;r<i;r++)o=this._tempPublicEdgeList[r],n=a[r+1],g=r==i-1,g?l=t:l=n.getEdgeAgainstPoint(o),u=this._router.passEdge(o,this._tempPublicEdgeList[r+1],l,g),u||(f=this._router.cornerPoint,h=this._router.cornerEdge,r=this._tempPublicEdgeList.indexOf(h),this._router.continuePass(f,t,this._tempPublicEdgeList[r+1]));this.pushAllPathPoint2(e,t),this._result.length>=3&&(this.optimusTerminusFat(),this.optimusByRadius());let A=[];for(let m of this._result)A.push(new b().copyFrom(m));this._result=A}optimusTerminusFat(){var e,t,a;a=this._result[1],a instanceof xa&&(e=a),a=this._result[this._result.length-2],a instanceof xa&&(t=a),e&&(this._result[1]=e.scalePoint()),t&&e!=t&&(this._result[this._result.length-2]=t.scalePoint())}pushAllPathPoint2(e,t){var a=this._tempPublicEdgeList.length,r,i;this._result=new Array,this._result.push(e);for(var n=e,o,l,c,f=0;f<a;f++)if(r=this._tempPublicEdgeList[f],l=null,r.crossPoint)l=this.getFatPoint(r,r.crossPoint),l?this._result.push(l):this._result.push(r.crossPoint),n=r.crossPoint;else{i=null,o=null;for(var h=f+1;h<a&&(i=this._tempPublicEdgeList[h],o=i.crossPoint,!o);h++);o==null&&(o=t),l=this.getFatPoint(r,o),l?this._result.push(l):(o==n?c=o.clone():(rr.CROSS_TEST_DIRECTION.setTo(o.x-n.x,0,o.z-n.z),c=this._router.calcCrossEdge(r,n,rr.CROSS_TEST_DIRECTION)),this._result.push(c))}this._result.push(t)}optimusByRadius(){var e=new Array;e.length=this._result.length;var t=this._result.length-2,a,r,i,n,o,l,c,f,h,u,g,A,m;for(m=0;m<t;m++)c=f=h=null,n=o=l=null,g=!1,A=null,a=this._result[m],r=this._result[m+1],i=this._result[m+2],a instanceof xa&&(n=a),r instanceof xa&&(o=r),i instanceof xa&&(l=i),n&&(c=n.ownerPoint),o&&(f=o.ownerPoint),l&&(h=l.ownerPoint),c&&f&&c==f&&f!=h&&(g=!0),h&&f&&h==f&&c!=f&&(g=!0),g&&(rr.CROSS_TEST_DIRECTION.copyFrom(a),rr.CROSS_TEST_DIRECTION.decrementBy(i),u=o.ownerEdge,g=this._router.hasCrossPoint(u.pointA,u.pointB,i,rr.CROSS_TEST_DIRECTION),g&&(A=this._router.calcCrossPointOut(f,r,i,rr.CROSS_TEST_DIRECTION)),A&&(e[m+1]=A))}getFatPoint(e,t){if(e==null)return null;var a;t instanceof xa&&(a=t);var r;return a?r=a.ownerPoint:r=e.getEqualPoint(t),r==null?null:(a=e.getFatPoint(r),a)}}class $h extends b{_id=0;_plane;_points=new Array;_edges=new Array;_neibourTriangles=new en;_pointAgainstEdge=new en;_edgeAgainstPoint=new en;_mask=0;_aabbBox;f=0;gg=0;h=0;parent;costMultiplier=1;openId=0;closeId=0;get aabb(){return this._aabbBox}initAABB(){this._aabbBox=new Qt,this._aabbBox.addPoint(this._points[0]),this._aabbBox.addPoint(this._points[1]),this._aabbBox.addPoint(this._points[2])}calcGlobalQuadAABB(){}get isTriangle(){return!0}constructor(e,t,a,r){super(0,0,0,0),this._id=e,this._mask=Cr.WalkAble,this._edges.push(t,a,r);var i;for(i of this._edges)this._points.indexOf(i.pointA)==-1&&this._points.push(i.pointA),this._points.indexOf(i.pointB)==-1&&this._points.push(i.pointB);this.x=(this._points[0].x+this._points[1].x+this._points[2].x)/3,this.y=(this._points[0].y+this._points[1].y+this._points[2].y)/3,this.z=(this._points[0].z+this._points[1].z+this._points[2].z)/3,this._plane=new Hh,this._plane.fromPoints(this._points[0],this._points[1],this._points[2]),this._plane.normalize(),this.genarateAgainstData(),this.initAABB()}genarateAgainstData(){var e,t;for(e of this._edges)for(t of this._points)e.pointA!=t&&e.pointB!=t&&(this._edgeAgainstPoint.put(e,t),this._pointAgainstEdge.put(t,e))}get id(){return this._id}get plane(){return this._plane}get points(){return this._points}addNeibour(e,t){if(this._edges.indexOf(e)>=0)this._neibourTriangles.put(e,t);else throw new Error("the edge is not in triangle!!!")}getNeibourTriangles(e=null,t=1,a=1){e=e||new Array,e.length=0;var r,i,n=this._neibourTriangles.getKeys(),o;for(o of n)i=o,i.testMask(t)&&(r=this._neibourTriangles.getValueByKey(i),r.testMask(a)&&e.push(r));return e}getEdges(e=null,t=1){e=e||new Array,e.length=0;var a;for(a of this._edges)a.testMask(t)&&e.push(a);return e}get walkAble(){return this.testMask(Cr.WalkAble)}get edges(){return this._edges}testMask(e){return(this._mask&e)==e}getEdgeAgainstPoint(e){return this._edgeAgainstPoint.getValueByKey(e)}getPointAgainstEdge(e){return this._pointAgainstEdge.getValueByKey(e)}getPublicEdge(e){if(e&&e!=this){var t=this._neibourTriangles.getKeys(),a;for(a of t)if(this._neibourTriangles.getValueByKey(a)==e)return a}return null}loopPublicEdge(e){var t,a;if(e&&e!=this){for(t of this._edges)for(a of e._edges)if(t==a)return t}return null}randomPoint(){var e=this._points[2].subtract(this._points[0]);e.scaleBy(Math.random()),e.incrementBy(this._points[0]);var t=this._points[1].subtract(e);return t.scaleBy(Math.random()),t.incrementBy(e),t}}class ap{_nav3dPoints;_nav3dEdges;_nav3dTriangles;_path;_edgesDict;_nav3dAstar;_nav3dFunnel;_terrainQuad;_triangleList;get edges(){return this._nav3dEdges}get points(){return this._nav3dPoints}get path(){return this._path}get triangles(){return this._nav3dTriangles}constructor(e,t){this._nav3dPoints=new Array,this._nav3dEdges=new Array,this._nav3dTriangles=new Array,this._edgesDict=new en,this.initPoints(e),this.initEdgesAndTriangles(t),this.createConnections(),this._nav3dAstar=new qh,this._nav3dFunnel=new rr,this._terrainQuad=new nh(8,128),this._terrainQuad.createQuadTree(this._nav3dTriangles)}getTriangleAtPoint(e,t=5){return this._terrainQuad.getTriangleAtPoint(e,t)}findPath(e,t,a=5){this._path=null,this._triangleList=null;var r=this.getTriangleAtPoint(e,10),i=this.getTriangleAtPoint(t,10),n=this._nav3dAstar.findPath(this,r,i);return n?(this._triangleList=this._nav3dAstar.channel,n=this._nav3dFunnel.searchPath(e,t,this._triangleList,a),this._path=this._nav3dFunnel.path,n):!1}initPoints(e){for(var t,a,r=e.length,i=0;i<r;i++)t=e[i],a=new Tt(i,t.x,t.y,t.z),this._nav3dPoints.push(a)}initEdgesAndTriangles(e){for(var t,a,r,i,n,o=e.length,l=0;l<o;l++)t=e[l],a=this.tryCreateEdge(t[0],t[1]),r=this.tryCreateEdge(t[1],t[2]),i=this.tryCreateEdge(t[2],t[0]),!(a==null||r==null||i==null)&&(n=new $h(l,a,r,i),this._nav3dTriangles.push(n))}tryCreateEdge(e,t){if(e==t)throw new Error("edge point index error!!!");if(e>t){var a=e;e=t,t=a}var r=this._edgesDict.getValueByKey(e+"_"+t);return r==null&&(r=new Fa(this._nav3dPoints[e],this._nav3dPoints[t]),this._nav3dEdges.push(r),this._edgesDict.put(e+"_"+t,r)),r}createConnections(){for(var e=this._nav3dTriangles.length,t=this._nav3dTriangles.length,a,r,i,n,o=0;o<e;o++){a=this._nav3dTriangles[o];for(i of a.edges)i.addTriangleOwners(a);for(var l=0;l<t;l++)r=this._nav3dTriangles[l],a!=r&&(n=a.loopPublicEdge(r),n&&(a.addNeibour(n,r),r.addNeibour(n,a)))}}}class Jo{x;y;setTo(e,t){this.x=e,this.y=t}equals(e,t){return e==this.x&&t==this.y}equalPoint(e){return this.equals(e.x,e.y)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y)}clone(){var e=new Jo;return e.setTo(this.x,this.y),e}normalize(){var e=length;e!=0&&this.setTo(this.x/e,this.y/e)}}class La extends Ve{width;height;depth;constructor(e=1,t=1,a=1){super(),this.width=e,this.height=t,this.depth=a,this.initVertex()}initVertex(){let e=this.width/2,t=this.height/2,a=this.depth/2;this.bounds=new xe(b.ZERO.clone(),new b(this.width,this.height,this.depth));let r=new Float32Array([-e,t,a,e,t,a,e,t,-a,-e,t,-a,-e,t,a,e,t,-a,e,-t,a,-e,-t,a,-e,-t,-a,e,-t,-a,e,-t,a,-e,-t,-a,-e,-t,a,-e,t,a,-e,t,-a,-e,-t,-a,-e,-t,a,-e,t,-a,e,t,a,e,-t,a,e,-t,-a,e,t,-a,e,t,a,e,-t,-a,e,t,a,-e,t,a,-e,-t,a,-e,-t,a,e,-t,a,e,t,a,e,-t,-a,-e,-t,-a,-e,t,-a,e,t,-a,e,-t,-a,-e,t,-a]),i=new Float32Array([0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),n=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),o=[0,2,1,3,5,4,6,8,7,9,11,10,12,14,13,15,17,16,18,20,19,21,23,22,24,26,25,27,29,28,30,32,31,33,35,34],l=new Uint16Array(o.reverse());this.setIndices(l),this.setAttribute(G.position,r),this.setAttribute(G.normal,i),this.setAttribute(G.uv,n),this.setAttribute(G.TEXCOORD_1,n),this.addSubGeometry({indexStart:0,indexCount:o.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0})}}class eu extends Ve{radiusTop;radiusBottom;height;radialSegments;heightSegments;openEnded;thetaStart;thetaLength;constructor(e=1,t=1,a=1,r=8,i=8,n=!1,o=0,l=Math.PI*2){super(),this.radiusTop=e,this.radiusBottom=t,this.height=a,this.radialSegments=r,this.heightSegments=i,this.openEnded=n,this.thetaStart=o,this.thetaLength=l,this.instanceID=Gt(),this.buildGeometry()}addGroup(e,t,a){this.addSubGeometry({indexStart:e,indexCount:t,vertexStart:e,vertexCount:0,firstStart:0,index:a,topology:0})}buildGeometry(){const e=this;this.radialSegments=Math.floor(this.radialSegments),this.heightSegments=Math.floor(this.heightSegments);const t=[],a=[],r=[],i=[];let n=0;const o=[],l=this.height/2;let c=0;A(),this.openEnded===!1&&(this.radiusTop>0&&m(!0),this.radiusBottom>0&&m(!1));let f=new Float32Array(t),h=new Float32Array(a),u=new Float32Array(r),g=new Uint16Array(i);this.setAttribute(G.position,f),this.setAttribute(G.normal,h),this.setAttribute(G.uv,u),this.setAttribute(G.TEXCOORD_1,u),this.setIndices(g);function A(){const p=new b,D=new b;let B=0;const v=(e.radiusBottom-e.radiusTop)/e.height;for(let C=0;C<=e.heightSegments;C++){const y=[],x=C/e.heightSegments,k=x*(e.radiusBottom-e.radiusTop)+e.radiusTop;for(let E=0;E<=e.radialSegments;E++){const S=E/e.radialSegments;let Q=S*e.thetaLength+e.thetaStart;E==e.radialSegments&&Math.abs(e.thetaLength-e.thetaStart)==Math.PI*2&&(Q=0);const I=Math.sin(Q),T=Math.cos(Q);D.x=k*I,D.y=-x*e.height+l,D.z=k*T,t.push(D.x,D.y,D.z),p.set(I,v,T).normalize(),a.push(p.x,p.y,p.z),r.push(S,1-x),y.push(n++)}o.push(y)}for(let C=0;C<e.radialSegments;C++)for(let y=0;y<e.heightSegments;y++){const x=o[y][C],k=o[y+1][C],E=o[y+1][C+1],S=o[y][C+1];i.push(x,k,S),i.push(k,E,S),B+=6}e.addGroup(c,B,0),c+=B}function m(p){const D=n,B=new de,v=new b;let C=0;const y=p===!0?e.radiusTop:e.radiusBottom,x=p===!0?1:-1;for(let E=1;E<=e.radialSegments;E++)t.push(0,l*x,0),a.push(0,x,0),r.push(.5,.5),n++;const k=n;for(let E=0;E<=e.radialSegments;E++){const Q=E/e.radialSegments*e.thetaLength+e.thetaStart,I=Math.cos(Q),T=Math.sin(Q);v.x=y*T,v.y=l*x,v.z=y*I,t.push(v.x,v.y,v.z),a.push(0,x,0),B.x=I*.5+.5,B.y=T*.5*x+.5,r.push(B.x,B.y),n++}for(let E=0;E<e.radialSegments;E++){const S=D+E,Q=k+E;p===!0?i.push(Q,Q+1,S):i.push(Q+1,Q,S),C+=3}e.addGroup(c,C,p===!0?1:2),c+=C}}}class tu extends Ve{radius;tube;radialSegments;tubularSegments;constructor(e=.4,t=.1,a=32,r=32){super(),this.radius=e,this.tube=t,this.radialSegments=a,this.tubularSegments=r,this.initVertex()}initVertex(){const e=2*Math.PI,t=this.radius,a=this.tube,r=this.radialSegments,i=this.tubularSegments;this.bounds=new xe(b.ZERO.clone(),new b(t*2,a*2,t*2));var n=(r+1)*(i+1);let o=new Float32Array(n*3),l=new Float32Array(n*3),c=new Float32Array(n*2),f=new Uint16Array(r*i*2*3),h=0,u=0,g=0,A=0;for(let m=0;m<=r;m++)for(let p=0;p<=i;p++){const D=p/i,B=m/r,v=D*e,C=B*Math.PI*2;if(o[h++]=(t+a*Math.cos(C))*Math.sin(v),o[h++]=a*Math.sin(C),o[h++]=(t+a*Math.cos(C))*Math.cos(v),l[u++]=Math.sin(v)*Math.cos(C),l[u++]=Math.sin(C),l[u++]=Math.cos(v)*Math.cos(C),c[g++]=D,c[g++]=B,p<i&&m<r){const y=i+1,x=y*m+p,k=y*(m+1)+p,E=y*(m+1)+p+1,S=y*m+p+1;f[A++]=x,f[A++]=S,f[A++]=k,f[A++]=S,f[A++]=E,f[A++]=k}}this.setIndices(f),this.setAttribute(G.position,o),this.setAttribute(G.normal,l),this.setAttribute(G.uv,c),this.setAttribute(G.TEXCOORD_1,c),this.addSubGeometry({indexStart:0,indexCount:f.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0})}}class rp extends Ve{segment;row=0;constructor(e){super(),this.segment=e,this.buildGeometry()}buildGeometry(){this.row=this.segment+1;let e=new Uint32Array(this.segment*6),t=new Float32Array(this.row*3*2),a=new Float32Array(this.row*3*2),r=new Float32Array(this.row*2*2);for(let i=0;i<this.row;i++){t[i*3*2+0]=0,t[i*3*2+1]=0,t[i*3*2+2]=0,t[i*3*2+3]=0,t[i*3*2+4]=0,t[i*3*2+5]=0,a[i*3*2+0]=0,a[i*3*2+1]=0,a[i*3*2+2]=1,a[i*3*2+3]=0,a[i*3*2+4]=0,a[i*3*2+5]=1,r[i*2*2+0]=0,r[i*2*2+1]=i/this.segment,r[i*2*2+2]=1,r[i*2*2+3]=i/this.segment;let n=i*2,o=n,l=n+1,c=n+2,f=n+3;e[i*6+0]=o,e[i*6+1]=l,e[i*6+2]=c,e[i*6+3]=l,e[i*6+4]=f,e[i*6+5]=c}this.setIndices(e),this.setAttribute(G.position,t),this.setAttribute(G.normal,a),this.setAttribute(G.uv,r),this.setAttribute(G.TEXCOORD_1,r),this.addSubGeometry({indexStart:0,indexCount:e.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0})}}class ip extends Ve{faceCount=0;constructor(e){super(),this.faceCount=e,this.buildGeometry()}buildGeometry(){let e=new Uint32Array(this.faceCount*3),t=new Float32Array(this.faceCount*3*3),a=new Float32Array(this.faceCount*3*3),r=new Float32Array(this.faceCount*3*2),i=new Float32Array(this.faceCount*3*1);for(let n=0;n<this.faceCount;n++){let o=n*3+0,l=n*3+1,c=n*3+2;e[o]=o,e[l]=l,e[c]=c}this.setIndices(e),this.setAttribute(G.position,t),this.setAttribute(G.normal,a),this.setAttribute(G.uv,r),this.setAttribute(G.TEXCOORD_1,r),this.setAttribute(G.vIndex,i),this.addSubGeometry({indexStart:0,indexCount:e.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0})}}class np extends Sn{_internalTexture;_minSize=32;_skyColor;constructor(e){super(),this._skyColor=e,this._internalTexture=new _s;let t=[];return _.res.fillColor(t,this._minSize,this._minSize,this.color.r,this.color.g,this.color.b,this.color.a),this._internalTexture.create(this._minSize,this._minSize,t,!1),this.createFromTexture(this._minSize,this._internalTexture),this}changeColor(e){return this._skyColor=e,_.res.fillColor(this._internalTexture.floatArray,this._minSize,this._minSize,this.color.r,this.color.g,this.color.b,this.color.a),this._internalTexture.updateTexture(this._minSize,this._minSize,this._internalTexture.floatArray,!1),this._faceData.uploadTexture(0,this._internalTexture),this}get color(){return this._skyColor}set color(e){this.changeColor(e)}}class sp extends d.Object3D{length=100;thickness=.1;constructor(e,t=.1){super(),this.length=e,this.thickness=t,this.init()}init(){let e=new d.Object3D,t=new d.Object3D,a=new d.Object3D,r=new La(2,2,2),i=new La(2,2,2),n=new La(2,2,2),o=new Bt;o.baseColor=new J(1,0,0);let l=new Bt;l.baseColor=new J(0,1,0);let c=new Bt;c.baseColor=new J(0,0,1);let f=e.addComponent(d.MeshRenderer),h=t.addComponent(d.MeshRenderer),u=a.addComponent(d.MeshRenderer);f.geometry=r,f.material=o,f.castShadow=!1,h.geometry=i,h.material=l,h.castShadow=!1,u.geometry=n,u.material=c,u.castShadow=!1,e.localScale=new b(this.length,this.thickness,this.thickness),e.x=this.length,t.localScale=new b(this.thickness,this.length,this.thickness),t.y=this.length,a.localScale=new b(this.thickness,this.thickness,this.length),a.z=this.length,this.addChild(e),this.addChild(t),this.addChild(a)}}class op{static merge(e,t,a){}static mergeNumber(e,t,a){let r=a||new Ve,i=e.getAttribute(G.position).data.length/3,n=new Float32Array(i*t);for(const f of e.vertexAttributeMap){let h=f[1].attribute;if(h==G.indices)continue;let u=e.getAttribute(h).data,g=u.length,A=new Float32Array(g*t);for(let m=0;m<t;m++){A.set(u,g*m);for(let p=0;p<i;p++)n[i*m+p]=m}r.setAttribute(h,A)}r.setAttribute(G.vIndex,n);let o=e.getAttribute(G.indices).data,l=o.length,c=new Uint32Array(o.length*t);for(let f=0;f<t;f++)for(let h=0;h<l;h++){let u=f*i,g=f*l;const A=o[h]+u;c[g+h]=A}return r.setIndices(c),r.addSubGeometry({indexStart:0,indexCount:c.length,vertexStart:0,index:0,vertexCount:0,firstStart:0,topology:0}),r}static generateNormal(){}static generateTangent(){}static packUV(){}}class lp extends d.Object3D{size=100;divisions=10;constructor(e=100,t=10){super(),this.size=e,this.divisions=t,this.buildGeometry(),this.addAxis()}buildGeometry(){const e=[],t=[],a=this.size/this.divisions,r=this.size/2,i=this.divisions/2;for(let c=0,f=-r;c<=this.divisions;c++,f+=a)c!==i&&(e.push(-r,0,f,r,0,f),e.push(f,0,-r,f,0,r));for(let c=0;c<e.length/3;c+=2)t.push(c,c+1);let n=new Ve;n.setIndices(t.length>Uint16Array.length?new Uint32Array(t):new Uint16Array(t)),n.setAttribute(G.position,new Float32Array(e)),n.addSubGeometry({indexStart:0,indexCount:t.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0});let o=new Bt;o.topology="line-list",o.baseColor=new J(1,1,1,.15),o.blendMode=me.ADD,o.castReflection=!1;let l=this.addComponent(d.MeshRenderer);l.geometry=n,l.material=o}addAxis(){const e=this.size/2;let t=new Float32Array([-e,0,0,e,0,0]),a=new Uint16Array([0,1,2,3]),r=new Ve;r.setIndices(a),r.setAttribute(G.position,t),r.addSubGeometry({indexStart:0,indexCount:a.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0});{let i=new d.Object3D,n=i.addComponent(d.MeshRenderer);n.geometry=r;let o=n.material=new Bt;o.baseColor=new J(1,0,0,.5),o.blendMode=me.ADD,o.castReflection=!1,o.topology="line-list",this.addChild(i)}{let i=new d.Object3D;i.rotationY=90;let n=i.addComponent(d.MeshRenderer);n.geometry=r;let o=n.material=new Bt;o.baseColor=new J(0,1,0,.5),o.blendMode=me.ADD,o.castReflection=!1,o.topology="line-list",this.addChild(i)}}}class cp{static color_temperature_to_rgb(e){e<1e3?e=1e3:e>4e4&&(e=4e4);let t=e/100,a=this.get_red(t),r=this.get_green(t),i=this.get_blue(t);return new J(a/255,r/255,i/255,1)}static get_red(e){if(e<=66)return 255;let t=329.698727446*Math.pow(e-60,-.1332047592);return this.bound(t)}static get_green(e){let t=0;return e<=66?t=99.4708025861*Math.log(e)-161.1195681661:t=288.1221695283*Math.pow(e-60,-.0755148492),this.bound(t)}static get_blue(e){let t=0;return e>=66?255:e<=19?0:(t=138.5177312231*Math.log(e-10)-305.0447927307,this.bound(t))}static bound(e,t=0,a=255){let r=Math.max(e,t);return Math.min(r,a)}}class fp{static boxGeo;static planeGeo;static sphere;static material;static materialMap;static initHeap(){this.boxGeo||(this.boxGeo=new La),this.planeGeo||(this.planeGeo=new $r(1,1,1,1,b.UP)),this.sphere||(this.sphere=new Ir(1,35,35)),this.material||(this.material=new qt),this.materialMap||(this.materialMap=new Map)}static get CubeMesh(){return this.initHeap(),this.boxGeo}static get SphereMesh(){return this.initHeap(),this.sphere}static GetCube(){this.initHeap();let e=new d.Object3D,t=e.addComponent(d.MeshRenderer);return t.geometry=this.boxGeo,t.material=this.material.clone(),t.castShadow=!0,e}static GetMaterial(e){let t=this.materialMap.get(e);return t||(t=new qt,t.baseMap=e,this.materialMap.set(e,t)),t.clone()}static GetPlane(e){this.initHeap();let t=new d.Object3D,a=t.addComponent(d.MeshRenderer);a.geometry=this.planeGeo;let r=this.GetMaterial(e);return r.blendMode=me.ADD,r.castShadow=!1,a.material=r,a.castGI=!1,a.castReflection=!1,t}static GetSingleCube(e,t,a,r,i,n){this.initHeap();let o=new qt;o.roughness=.5,o.metallic=.1,o.baseColor=new J(r,i,n,1);let l=new d.Object3D,c=l.addComponent(d.MeshRenderer);return c.castGI=!0,c.geometry=new La(e,t,a),c.material=o,l}static GetSingleSphere(e,t,a,r){this.initHeap();let i=new qt;i.baseColor=new J(t,a,r,1);let n=new d.Object3D,o=n.addComponent(d.MeshRenderer);return o.castGI=!0,o.geometry=new Ir(e,20,20),o.material=i,n}static get Sphere(){this.initHeap();let e=new d.Object3D,t=e.addComponent(d.MeshRenderer);return t.geometry=this.sphere,t.material=this.material,e}static GetSingleCube2(e,t=10){this.initHeap();let a=new d.Object3D,r=a.addComponent(d.MeshRenderer);return r.castShadow=!1,r.geometry=new La(t,t,t),r.material=e,a}static GetPointLight(e,t,a,r,i,n,o=1,l=!0){let c=new d.Object3D,f=c.addComponent(d.PointLight);f.lightColor=new J(r,i,n,1),f.intensity=o,f.range=a,f.at=8,f.radius=0,f.castShadow=l,c.localPosition=e,c.localRotation=t;let h=this.GetSingleSphere(.1,1,1,1);return c.addChild(h),f}}var N=(s=>(s[s.X=0]="X",s[s.Y=1]="Y",s[s.Z=2]="Z",s[s.XY=3]="XY",s[s.XZ=4]="XZ",s[s.YZ=5]="YZ",s[s.XYZ=6]="XYZ",s[s.MAX=7]="MAX",s[s.NONE=8]="NONE",s))(N||{}),ha=(s=>(s[s.Local=0]="Local",s[s.Global=1]="Global",s))(ha||{});class Jn extends qe{mAxis;mAxisColor;mContainer;mAxisMaterial;mAxisCollider;constructor(){super(),this._enable=!1,this.mAxis=new Array(N.MAX),this.mAxisColor=new Array(N.MAX),this.mAxisMaterial=new Array(N.MAX),this.mAxisCollider=new Array(N.MAX)}get target(){return this.object3D.target}get mX(){return this.object3D.mXObj}get mY(){return this.object3D.mYObj}get mZ(){return this.object3D.mZObj}get transformSpaceMode(){return this.object3D.transformSpaceMode}init(e){this.mContainer=new d.Object3D;let t=new Bt;t.baseColor=new J(1,0,0),t.depthCompare=ot.always,this.mAxisColor[N.X]=t.baseColor,this.mAxisMaterial[N.X]=t;let a=new Bt;a.baseColor=new J(0,1,0),a.depthCompare=ot.always,this.mAxisColor[N.Y]=a.baseColor,this.mAxisMaterial[N.Y]=a;let r=new Bt;r.baseColor=new J(0,0,1),r.depthCompare=ot.always,this.mAxisColor[N.Z]=r.baseColor,this.mAxisMaterial[N.Z]=r;let i=this.createCustomAxis(N.X),n=this.createCustomAxis(N.Y),o=this.createCustomAxis(N.Z);this.mContainer.addChild(this.mAxis[N.X]=i),this.mContainer.addChild(this.mAxis[N.Y]=n),this.mContainer.addChild(this.mAxis[N.Z]=o),this.mAxisCollider[N.X]=i.getComponent(fa),this.mAxisCollider[N.Y]=n.getComponent(fa),this.mAxisCollider[N.Z]=o.getComponent(fa)}start(){}onEnable(e){this.object3D.addChild(this.mContainer),this.reset()}onDisable(e){this.object3D.removeChild(this.mContainer)}reset(){switch(this.transformSpaceMode){case ha.Local:{let t=R.help_matrix_0.copyFrom(this.mX.transform.worldMatrix).decompose();this.object3D.scaleX=1,this.object3D.scaleY=1,this.object3D.scaleZ=1,this.object3D.rotationX=t[1].x,this.object3D.rotationY=t[1].y,this.object3D.rotationZ=t[1].z,this.object3D.x=t[0].x,this.object3D.y=t[0].y,this.object3D.z=t[0].z}break;case ha.Global:{this.object3D.scaleX=1,this.object3D.scaleY=1,this.object3D.scaleZ=1,this.object3D.rotationX=0,this.object3D.rotationY=0,this.object3D.rotationZ=0;const e=this.mX.transform.worldPosition;this.object3D.x=e.x,this.object3D.y=e.y,this.object3D.z=e.z}break}}pickAxis(){let a=this.object3D.transform.scene3D.view.camera.screenPointToRay(_.inputSystem.mouseX,_.inputSystem.mouseY),r,i;for(let n=0;n<=N.MAX;n++){let o=this.mAxisCollider[n];if(o&&(r=o.rayPick(a),r&&(!i||i.distance>r.distance||n==N.XYZ)&&(i={axis:n,obj:o.object3D,distance:r.distance,intersectPoint:r.intersectPoint},n==N.XYZ)))break}return i}currentAxis=N.NONE;beginPoint=new b;beginMousePos=new b;currentPoint=new b;onMouseDown(e){if(e.mouseCode!=Qn.MOUSE_LEFT)return;let t=this.pickAxis();if(!t)return;this.currentAxis=t.axis,e.stopImmediatePropagation();const r=this.object3D.transform.scene3D.view.camera;let i=r.worldToScreenPoint(this.mX.transform.worldPosition),n=r.screenPointToWorld(_.inputSystem.mouseX,_.inputSystem.mouseY,i.z);this.beginPoint.copyFrom(n),this.beginMousePos.x=_.inputSystem.mouseX,this.beginMousePos.y=_.inputSystem.mouseY}lastMoveObj;lastMoveAxis;onMouseMove(e){if(this.currentAxis==N.NONE){let t=this.lastMoveObj.getComponent(d.MeshRenderer).material;this.lastMoveObj&&"baseColor"in t&&(t.baseColor=this.mAxisColor[this.lastMoveAxis],this.lastMoveObj=null,this.lastMoveAxis==N.XYZ&&(this.mAxis[N.X].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",this.mAxisColor[N.X]),this.mAxis[N.Y].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",this.mAxisColor[N.Y]),this.mAxis[N.Z].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",this.mAxisColor[N.Z])),this.lastMoveAxis=N.NONE);let a=this.pickAxis();if(!a)return;t.setUniformColor("baseColor",new J(1,1,1)),this.lastMoveObj=a.obj,this.lastMoveAxis=a.axis,this.lastMoveAxis==N.XYZ&&(this.mAxis[N.X].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",new J(1,1,1)),this.mAxis[N.Y].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",new J(1,1,1)),this.mAxis[N.Z].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",new J(1,1,1)))}else{const a=this.object3D.transform.scene3D.view.camera;let r=a.worldToScreenPoint(this.mX.transform.worldPosition),i=a.screenPointToWorld(_.inputSystem.mouseX,_.inputSystem.mouseY,r.z);this.currentPoint.copyFrom(i);let n=i.subtract(this.beginPoint);b.HELP_0.set(_.inputSystem.mouseX,_.inputSystem.mouseY,0);let o=b.distance(b.HELP_0,this.beginMousePos);switch(this.beginMousePos.copyFrom(b.HELP_0),this.transformSpaceMode){case ha.Local:this.applyLocalTransform(this.currentAxis,n,o);break;case ha.Global:this.applyGlobalTransform(this.currentAxis,n,o);break}this.beginPoint.copyFrom(i),this.reset()}}onMouseUp(e){e.mouseCode==Qn.MOUSE_LEFT&&(this.currentAxis=N.NONE,this.reset())}onUpdate(e){let a=b.distance(e.camera.transform.worldPosition,this.object3D.transform.worldPosition)/100;if(this.mContainer.scaleX=this.mContainer.scaleY=this.mContainer.scaleZ=a,this.mX){const r=this.mX.transform.worldPosition;this.object3D.x=r.x,this.object3D.y=r.y,this.object3D.z=r.z}}applyLocalTransform(e,t,a){console.warn("not imp")}applyGlobalTransform(e,t,a){console.warn("not imp")}createCustomAxis(e){return this.createAxis(e)}createAxis(e){let t=0,a=0,r=0;switch(e){case N.X:t=1;break;case N.Y:a=1;break;case N.Z:r=1;break}let i=.4+t*20,n=.4+a*20,o=.4+r*20,l=new d.Object3D;l.x=i*.5,l.y=n*.5,l.z=o*.5;let c=l.addComponent(d.MeshRenderer);c.geometry=new La(i,n,o),c.material=this.mAxisMaterial[e];let f=l.addComponent(fa),h=new oi;return h.setFromCenterAndSize(new b(0,0,0),new b(i+1,n+1,o+1)),f.shape=h,l}}class au extends Jn{init(e){super.init(e);let t=new Bt;t.doubleSide=!0,t.baseColor=new J(.9,.9,.9),t.depthCompare=ot.always,this.mAxisColor[N.XYZ]=t.baseColor,this.mAxisMaterial[N.XYZ]=t;let a=new d.Object3D,r=a.addComponent(d.MeshRenderer);r.geometry=new La(2,2,2),r.material=this.mAxisMaterial[N.XYZ];let i=a.addComponent(fa),n=new oi;n.setFromCenterAndSize(new b(0,0,0),new b(2,2,2)),i.shape=n,this.mContainer.addChild(this.mAxis[N.XYZ]=a),this.mAxisCollider[N.XYZ]=a.getComponent(fa)}applyLocalTransform(e,t,a){switch(this.currentAxis){case N.XYZ:{let r=0;Math.abs(t.x)>Math.abs(t.y)?Math.abs(t.x)>Math.abs(t.z)?r=t.x:r=t.z:r=t.y,this.mX.scaleX+=r,this.mX.scaleY+=r,this.mX.scaleZ+=r}break;default:this.mX.transform.worldMatrix.transformVector(t,t),(this.currentAxis==N.X||this.currentAxis==N.XY||this.currentAxis==N.XZ)&&(this.mX.scaleX=Math.abs(this.mX.scaleX+t.x)),(this.currentAxis==N.Y||this.currentAxis==N.XY||this.currentAxis==N.YZ)&&(this.mX.scaleY=Math.abs(this.mX.scaleY+t.y)),(this.currentAxis==N.Z||this.currentAxis==N.XZ||this.currentAxis==N.YZ)&&(this.mX.scaleZ=Math.abs(this.mX.scaleZ+t.z));break}}applyGlobalTransform(e,t,a){let r=b.HELP_0;r.set(0,0,0),(this.currentAxis==N.X||this.currentAxis==N.XY||this.currentAxis==N.XZ)&&(r.x=t.x),(this.currentAxis==N.Y||this.currentAxis==N.XY||this.currentAxis==N.YZ)&&(r.y=t.y),(this.currentAxis==N.Z||this.currentAxis==N.XZ||this.currentAxis==N.YZ)&&(r.z=t.z),this.mX.transform.worldMatrix.transformVector(r,b.HELP_1),this.mX.scaleX+=b.HELP_1.x,this.mX.scaleY+=b.HELP_1.y,this.mX.scaleZ+=b.HELP_1.z}createCustomAxis(e){let t=super.createAxis(e),a=this.createBox(e);return t.addChild(a),t}createBox(e){let t=0,a=0,r=0,i=new d.Object3D;switch(e){case N.X:t=1,i.rotationZ=-90;break;case N.Y:a=1;break;case N.Z:r=1,i.rotationX=90;break}let n=.2+t*20,o=.2+a*20,l=.2+r*20;i.x=n*.5,i.y=o*.5,i.z=l*.5;let c=i.addComponent(d.MeshRenderer);return c.geometry=new La(2,2,2),c.material=this.mAxisMaterial[e],i}}var mt=(s=>(s[s.Scale=0]="Scale",s[s.Rotation=1]="Rotation",s[s.Translation=2]="Translation",s[s.NONE=3]="NONE",s))(mt||{});class ru extends Jn{applyLocalTransform(e,t,a){if(this.currentAxis==N.X||this.currentAxis==N.XY||this.currentAxis==N.XZ,this.currentAxis==N.Y||this.currentAxis==N.XY||this.currentAxis==N.YZ){R.help_matrix_0.copyFrom(this.mX.transform.worldMatrix),R.help_matrix_1.identity(),R.help_matrix_1.createByRotation(1,b.Y_AXIS),R.help_matrix_2.multiplyMatrices(R.help_matrix_1,R.help_matrix_0),R.help_matrix_2.invert(),R.help_matrix_1.multiplyMatrices(R.help_matrix_2,R.help_matrix_0);let r=R.help_matrix_1.decompose();this.mX.rotationX+=r[1].x,this.mY.rotationY+=r[1].y,this.mZ.rotationZ+=r[1].z}this.currentAxis==N.Z||this.currentAxis==N.XZ||this.currentAxis==N.YZ}getAngle(){const t=this.object3D.transform.scene3D.view.camera,a=this.mZ.transform.worldPosition;if(t.screenPointToRay(_.inputSystem.mouseX,_.inputSystem.mouseY),this.currentAxis==N.X){let r=t.worldToScreenPoint(a);b.HELP_1.set(r.x,r.y,0),b.HELP_2.set(_.inputSystem.mouseX,_.inputSystem.mouseY,0);let i=b.HELP_2.subtract(b.HELP_1),n=b.getAngle(b.X_AXIS,i);return i.y>0&&(n=360-n),t.transform.worldPosition.x-a.x>0&&(n=360-n),n}if(this.currentAxis==N.Y){let r=t.worldToScreenPoint(a);b.HELP_1.set(r.x,r.y,0),b.HELP_2.set(_.inputSystem.mouseX,_.inputSystem.mouseY,0);let i=b.HELP_2.subtract(b.HELP_1),n=b.getAngle(b.X_AXIS,i);return i.y>0&&(n=360-n),t.transform.worldPosition.y-a.y>0&&(n=360-n),n}if(this.currentAxis==N.Z){let r=t.worldToScreenPoint(a);b.HELP_1.set(r.x,r.y,0),b.HELP_2.set(_.inputSystem.mouseX,_.inputSystem.mouseY,0);let i=b.HELP_2.subtract(b.HELP_1),n=b.getAngle(b.X_AXIS,i);return i.y>0&&(n=360-n),t.transform.worldPosition.z-a.z>0&&(n=360-n),n}return 0}mLastAngle=0;applyGlobalTransform(e,t,a){if(this.currentAxis==N.X||this.currentAxis==N.Y||this.currentAxis==N.Z){let r=this.getAngle();switch(R.help_matrix_0.identity(),this.currentAxis){case N.X:R.help_matrix_0.createByRotation(this.mLastAngle-r,b.X_AXIS);break;case N.Y:R.help_matrix_0.createByRotation(this.mLastAngle-r,b.Y_AXIS);break;case N.Z:R.help_matrix_0.createByRotation(this.mLastAngle-r,b.Z_AXIS);break}R.help_matrix_1.copyFrom(this.mX.transform.worldMatrix),R.help_matrix_1.append(R.help_matrix_0),this.mX.parent&&(R.help_matrix_2.copyFrom(this.mX.parent.worldMatrix),R.help_matrix_2.invert(),R.help_matrix_1.multiply(R.help_matrix_2));let n=R.help_matrix_1.decompose(ia.QUATERNION)[1];ae.HELP_0.set(n.x,n.y,n.z,n.w),this.mLastAngle=r,this.mX.transform.localRotQuat=ae.HELP_0}}onMouseDown(e){super.onMouseDown(e),this.currentAxis!=N.NONE&&(this.mAxis[N.X].getComponent(d.MeshRenderer).enable=!1,this.mAxis[N.Y].getComponent(d.MeshRenderer).enable=!1,this.mAxis[N.Z].getComponent(d.MeshRenderer).enable=!1,this.mAxis[this.currentAxis].getComponent(d.MeshRenderer).enable=!0,this.mLastAngle=this.getAngle())}onMouseUp(e){super.onMouseUp(e),this.currentAxis==N.NONE&&(this.mAxis[N.X].getComponent(d.MeshRenderer).enable=!0,this.mAxis[N.Y].getComponent(d.MeshRenderer).enable=!0,this.mAxis[N.Z].getComponent(d.MeshRenderer).enable=!0)}createCustomAxis(e){return this.createAxis(e)}createAxis(e){let t=new d.Object3D;switch(e){case N.X:t.rotationZ=90;break;case N.Y:break;case N.Z:t.rotationX=90;break}let a=t.addComponent(d.MeshRenderer);a.geometry=new tu(20,.4),a.material=this.mAxisMaterial[e];let r=t.addComponent(fa),i=new oi;return i.setFromCenterAndSize(new b,new b(40,.4,40)),r.shape=i,t}pickAxis(){let a=this.object3D.transform.scene3D.view.camera.screenPointToRay(_.inputSystem.mouseX,_.inputSystem.mouseY),r,i;for(let n=0;n<=N.MAX;n++){let o=this.mAxisCollider[n];if(o&&(r=o.rayPick(a),r)){let l=b.distance(r.intersectPoint,o.shape.center);if(l>20+.8||l<20-.8)continue;(!i||i.distance>r.distance)&&(i={axis:n,obj:o.object3D,distance:r.distance,intersectPoint:r.intersectPoint})}}return i}}class iu extends Jn{init(e){super.init(e);let t=new Bt;t.doubleSide=!0,t.baseColor=new J(0,0,1),t.depthCompare=ot.always,this.mAxisColor[N.XY]=t.baseColor,this.mAxisMaterial[N.XY]=t;let a=new Bt;a.doubleSide=!0,a.baseColor=new J(0,1,0),a.depthCompare=ot.always,this.mAxisColor[N.XZ]=a.baseColor,this.mAxisMaterial[N.XZ]=a;let r=new Bt;r.doubleSide=!0,r.baseColor=new J(1,0,0),r.depthCompare=ot.always,this.mAxisColor[N.YZ]=r.baseColor,this.mAxisMaterial[N.YZ]=r;let i=this.createPlane(N.XY),n=this.createPlane(N.XZ),o=this.createPlane(N.YZ);this.mContainer.addChild(this.mAxis[N.XY]=i),this.mContainer.addChild(this.mAxis[N.XZ]=n),this.mContainer.addChild(this.mAxis[N.YZ]=o),this.mAxisCollider[N.XY]=i.getComponent(fa),this.mAxisCollider[N.XZ]=n.getComponent(fa),this.mAxisCollider[N.YZ]=o.getComponent(fa)}applyLocalTransform(e,t,a){R.help_matrix_0.copyFrom(this.mX.transform.worldMatrix).invert(),R.help_matrix_0.transformVector(t,b.HELP_0),this.currentAxis==N.X||this.currentAxis==N.XY||this.currentAxis==N.XZ||(b.HELP_0.x=0),this.currentAxis==N.Y||this.currentAxis==N.XY||this.currentAxis==N.YZ||(b.HELP_0.y=0),this.currentAxis==N.Z||this.currentAxis==N.XZ||this.currentAxis==N.YZ||(b.HELP_0.z=0),this.mX.transform.worldMatrix.transformVector(b.HELP_0,b.HELP_1),this.mX.x+=b.HELP_1.x,this.mX.y+=b.HELP_1.y,this.mX.z+=b.HELP_1.z}applyGlobalTransform(e,t,a){R.help_matrix_0.identity(),(this.currentAxis==N.X||this.currentAxis==N.XY||this.currentAxis==N.XZ)&&R.help_matrix_0.appendTranslation(t.x,0,0),(this.currentAxis==N.Y||this.currentAxis==N.XY||this.currentAxis==N.YZ)&&R.help_matrix_0.appendTranslation(0,t.y,0),(this.currentAxis==N.Z||this.currentAxis==N.XZ||this.currentAxis==N.YZ)&&R.help_matrix_0.appendTranslation(0,0,t.z),R.help_matrix_1.copyFrom(this.mX.transform.worldMatrix),R.help_matrix_1.append(R.help_matrix_0),this.mX.parent&&(R.help_matrix_2.copyFrom(this.mX.parent.worldMatrix),R.help_matrix_2.invert(),R.help_matrix_1.multiply(R.help_matrix_2));let r=R.help_matrix_1.decompose(ia.QUATERNION);this.mX.transform.localPosition=r[0],console.log(this.target.localPosition)}createCustomAxis(e){let t=super.createAxis(e),a=this.createArrows(e);return t.addChild(a),t}createArrows(e){let t=0,a=0,r=0,i=new d.Object3D;switch(e){case N.X:t=1,i.rotationZ=-90;break;case N.Y:a=1,i.rotationY=-90;break;case N.Z:r=1,i.rotationX=90;break}let n=.2+t*20,o=.2+a*20,l=.2+r*20;i.x=n*.5,i.y=o*.5,i.z=l*.5;let c=i.addComponent(d.MeshRenderer);return c.geometry=new eu(0,1,4),c.material=this.mAxisMaterial[e],i}createPlane(e){let t=new d.Object3D,a=t.addComponent(d.MeshRenderer);a.material=this.mAxisMaterial[e];let r=t.addComponent(fa),i=new oi;switch(r.shape=i,e){case N.XY:a.geometry=new $r(4,4,1,1,b.Z_AXIS),t.x=8,t.y=8,i.setFromCenterAndSize(new b(0,0,0),new b(4,4,.1));break;case N.XZ:a.geometry=new $r(4,4,1,1,b.Y_AXIS),t.x=8,t.z=8,i.setFromCenterAndSize(new b(0,0,0),new b(4,.1,4));break;case N.YZ:a.geometry=new $r(4,4,1,1,b.X_AXIS),t.y=8,t.z=8,i.setFromCenterAndSize(new b(0,0,0),new b(.1,4,4));break}return t}}class jo extends d.Object3D{static _instance;static get instance(){return this._instance||(this._instance=new jo),this._instance}mTarget;mTransformMode=mt.NONE;mTransformSpaceType=ha.Global;mControllers;mXObj;mYObj;mZObj;constructor(){super(),this.mControllers=[null,null,null],this.mControllers[mt.Scale]=this.addComponent(au),this.mControllers[mt.Rotation]=this.addComponent(ru),this.mControllers[mt.Translation]=this.addComponent(iu),this.mControllers[mt.Scale].enable=!1,this.mControllers[mt.Rotation].enable=!1,this.mControllers[mt.Translation].enable=!1,this.mXObj=new d.Object3D,this.mYObj=new d.Object3D,this.mZObj=new d.Object3D,this.mXObj.addChild(this.mYObj),this.mYObj.addChild(this.mZObj)}get transformMode(){return this.mTransformMode}get transformSpaceMode(){return this.mTransformSpaceType}active(e){e.addChild(this),e.addChild(this.mXObj)}unActive(e){e.removeChild(this)}get target(){return this.mTarget}selectObject(e,t,a){this.mTarget!=e&&(e?this.activate():this.unactivate(),this.mTarget=e,this.mXObj.localPosition=e.transform.worldPosition.clone()),t!=null&&this.selectTransformMode(t),a!=null&&this.selectTransformSpaceMode(a)}selectTransformMode(e){this.mTransformMode!=e&&(this.mTransformMode!=mt.NONE&&(this.mControllers[this.mTransformMode].enable=!1),this.mTransformMode=e,this.mTransformMode!=mt.NONE&&(this.mControllers[this.mTransformMode].enable=!0))}selectTransformSpaceMode(e){this.mTransformSpaceType!=e&&(this.mTransformSpaceType=e,this.mTransformMode!=mt.NONE&&this.mControllers[this.mTransformMode].reset())}activate(){_.inputSystem.addEventListener(Ra.KEY_DOWN,this.onKeyDown,this),_.inputSystem.addEventListener(j.POINTER_DOWN,this.onMouseDown,this,null,99999),_.inputSystem.addEventListener(j.POINTER_MOVE,this.onMouseMove,this,null,99999),_.inputSystem.addEventListener(j.POINTER_UP,this.onMouseUp,this,null,99999)}unactivate(){_.inputSystem.removeEventListener(Ra.KEY_DOWN,this.onKeyDown,this),_.inputSystem.removeEventListener(j.POINTER_DOWN,this.onMouseDown,this),_.inputSystem.removeEventListener(j.POINTER_MOVE,this.onMouseMove,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.onMouseUp,this)}onKeyDown(e){switch(e.keyCode){case et.Key_R:this.selectTransformMode(mt.Scale),this.selectTransformSpaceMode(ha.Local);break;case et.Key_E:this.selectTransformMode(mt.Rotation),this.selectTransformSpaceMode(ha.Global);break;case et.Key_W:this.selectTransformMode(mt.Translation),this.selectTransformSpaceMode(ha.Global);break;case et.Key_A:this.selectTransformSpaceMode(ha.Local);break;case et.Key_S:this.selectTransformSpaceMode(ha.Global);break}}onMouseDown(e){this.mTransformMode!=mt.NONE&&this.mControllers[this.mTransformMode].onMouseDown(e)}onMouseMove(e){this.mTransformMode!=mt.NONE&&this.mControllers[this.mTransformMode].onMouseMove(e)}onMouseUp(e){this.mTransformMode!=mt.NONE&&this.mControllers[this.mTransformMode].onMouseUp(e)}}const dp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));d.AccelerateDecelerateInterpolator=P0,d.AccelerateInterpolator=M0,d.AnimationCurve=Ni,d.AnimationCurveT=yr,d.AnimationMonitor=Mr,d.AnimatorEventKeyframe=Gb,d.AnticipateInterpolator=L0,d.AnticipateOvershootInterpolator=Si,d.ArrayHas=du,d.ArrayItemIndex=hu,d.AtlasParser=Ef,d.AtmosphericComponent=Qb,d.AtmosphericScatteringSky=_d,d.AtmosphericScatteringSkySetting=Dd,d.AtmosphericScatteringSky_shader=Ad,d.AttributeAnimCurve=Fd,d.AxisObject=sp,d.B3DMLoader=qa,d.B3DMLoaderBase=pf,d.B3DMParseUtil=qs,d.B3DMParser=Hs,d.BRDFLUT=Uf,d.BRDFLUTGenerate=yf,d.BRDF_frag=Cl,d.BatchTable=Cn,d.BiMap=Nm,d.BillboardComponent=Mi,d.BillboardType=pr,d.BitUtil=ql,d.BitmapTexture2D=Ka,d.BitmapTexture2DArray=Ac,d.BitmapTextureCube=Ws,d.Blend=mc,d.BlendFactor=pc,d.BlendMode=me,d.BlendShapeData=Eo,d.BlendShapePropertyData=ko,d.BloomPost=Mg,d.BlurEffectCreatorBlur_cs=lf,d.BlurEffectCreatorSample_cs=of,d.BlurTexture2DBufferCreator=cf,d.BounceInterpolator=Kt,d.BoundUtil=vs,d.BoundingBox=xe,d.BoundingSphere=Qr,d.BoundingVolume=Vr,d.BoxColliderShape=oi,d.BoxGeometry=La,d.BrdfLut_frag=gl,d.BsDF_frag=xl,d.BxDF_frag=Sl,d.BxdfDebug_frag=wl,d.BytesArray=Pn,d.CEvent=bt,d.CEventDispatcher=Ja,d.CEventListener=rn,d.CResizeEvent=nr,d.CSM=ra,d.Camera3D=Hr,d.CameraControllerBase=Kb,d.CameraType=at,d.CameraUtil=dt,d.CapsuleColliderShape=gg,d.CastPointShadowMaterialPass=Rc,d.CastShadowMaterialPass=wc,d.Clearcoat_frag=Fl,d.ClusterBoundsSource_cs=d0,d.ClusterConfig=wt,d.ClusterDebug_frag=rl,d.ClusterLight=Vl,d.ClusterLightingBuffer=f0,d.ClusterLightingRender=u0,d.ClusterLighting_cs=h0,d.CollectInfo=Mc,d.ColliderComponent=fa,d.ColliderShape=ht,d.ColliderShapeType=si,d.Color=J,d.ColorGradient=Pm,d.ColorLitMaterial=Im,d.ColorLitShader=bd,d.ColorPassFragmentOutput=Cb,d.ColorPassRenderer=c0,d.ColorUtil=on,d.ComData=Vn,d.Combine_cs=od,d.Common_frag=ul,d.Common_vert=bl,d.ComponentBase=qe,d.ComponentCollect=Pe,d.ComputeGPUBuffer=ei,d.ComputeShader=ye,d.Context3D=Ho,d.CubeCamera=Fs,d.CubeMapFaceEnum=ff,d.CubeSky_Shader=qn,d.CubicBezierCurve=Gn,d.CubicBezierPath=Vm,d.CubicBezierType=Gh,d.CycleInterpolator=G0,d.CylinderGeometry=eu,d.DDGIIrradianceComputePass=F0,d.DDGIIrradianceGPUBufferReader=Yi,d.DDGIIrradianceVolume=t0,d.DDGIIrradiance_shader=x0,d.DDGILightingPass=R0,d.DDGILighting_shader=w0,d.DDGIMultiBouncePass=E0,d.DDGIProbeRenderer=I0,d.DEGREES_TO_RADIANS=pt,d.DRACO_DECODER_GLTF_JS=J0,d.DecelerateInterpolator=N0,d.Denoising_cs=ld,d.Depth2DTextureArray=p0,d.DepthCubeArrayTexture=g0,d.DepthMaterialPass=Ic,d.DepthOfFieldPost=Ng,d.DepthOfView_cs=Jf,d.DoubleArray=en,d.EditorInspector=jr,d.Engine3D=_,d.Entity=e0,d.EntityBatchCollect=Nc,d.EntityCollect=K,d.EnvMap_frag=ml,d.ErpImage2CubeMap=jt,d.ErpImage2CubeMapCreateCube_cs=df,d.ErpImage2CubeMapRgbe2rgba_cs=hf,d.ExtrudeGeometry=_g,d.FAILED=tr,d.FASTFLOOR=Sa,d.FXAAPost=ks,d.FXAAShader=y0,d.FastMathShader=Al,d.FatLineGeometry=eh,d.FatLineMaterial=Bh,d.FatLine_FS=ic,d.FatLine_VS=rc,d.FeatureTable=Ei,d.FileLoader=It,d.FirstPersonCameraController=qb,d.Float16ArrayTexture=_s,d.Float32ArrayTexture=$c,d.FlyCameraController=$b,d.FontChar=xf,d.FontInfo=Cf,d.FontPage=Sf,d.FontParser=$a,d.ForwardRenderJob=T0,d.FragmentOutput=ts,d.FragmentVarying=_l,d.FrameCache=fo,d.Frustum=ds,d.FrustumCSM=gc,d.FrustumCulling_cs=yb,d.FullQuad_vert_wgsl=Rl,d.GBufferFrame=_e,d.GBufferPass=Ec,d.GBufferPost=Pg,d.GBufferStand=$l,d.GBuffer_pass=as,d.GILighting=Gs,d.GIProbeMaterial=Kd,d.GIProbeMaterialType=Bo,d.GIProbeShader=gd,d.GIRenderCompleteEvent=Es,d.GIRenderStartEvent=An,d.GLBChunk=rf,d.GLBHeader=af,d.GLBParser=zs,d.GLSLLexer=Dc,d.GLSLLexerToken=Di,d.GLSLPreprocessor=_c,d.GLSLSyntax=yc,d.GLTFBinaryExtension=_f,d.GLTFMaterial=rm,d.GLTFParser=_t,d.GLTFSubParser=Bn,d.GLTFSubParserCamera=j0,d.GLTFSubParserConverter=tf,d.GLTFSubParserMaterial=Y0,d.GLTFSubParserMesh=Z0,d.GLTFSubParserSkeleton=Ls,d.GLTFSubParserSkin=X0,d.GLTFType=sa,d.GLTF_Accessors=k2,d.GLTF_Info=Dn,d.GLTF_Light=C2,d.GLTF_Mesh=F2,d.GLTF_Node=S2,d.GLTF_Primitives=x2,d.GLTF_Scene=y2,d.GPUAddressMode=Ht,d.GPUBlendFactor=uu,d.GPUBufferBase=ja,d.GPUBufferType=ga,d.GPUCompareFunction=ot,d.GPUContext=F,d.GPUCullMode=Nt,d.GPUFilterMode=cr,d.GPUPrimitiveTopology=sn,d.GPUTextureFormat=se,d.GPUVertexFormat=mi,d.GPUVertexStepMode=mu,d.GSplatFormat=di,d.GSplatGeometry=Zc,d.GSplatMaterial=Gc,d.GSplat_FS=Lc,d.GSplat_VS=Oc,d.GTAOPost=Vg,d.GTAO_cs=jf,d.GUIAtlasTexture=kf,d.GUICanvas=Li,d.GUIConfig=Tr,d.GUIGeometry=Qd,d.GUIGeometryRebuild=Md,d.GUIMaterial=go,d.GUIPassRenderer=Q0,d.GUIPick=Od,d.GUIPickHelper=zd,d.GUIQuad=Pa,d.GUIQuadAttrEnum=nt,d.GUIRenderer=Nd,d.GUIShader=bo,d.GUISpace=ca,d.GUISprite=ai,d.GUITexture=gr,d.GaussianSplatParser=em,d.GenerayRandomDir=Nl,d.GeoJsonParser=tm,d.GeoJsonUtil=am,d.GeoType=Mn,d.GeometryBase=Ve,d.GeometryIndicesBuffer=Jc,d.GeometryUtil=op,d.GeometryVertexBuffer=zc,d.GeometryVertexType=Ft,d.GetComponentClass=Ko,d.GetCountInstanceID=Hn,d.GetRepeat=Cu,d.GetShader=qo,d.GlassShader=Sb,d.GlobalBindGroup=ve,d.GlobalBindGroupLayout=hs,d.GlobalFog=Og,d.GlobalFog_shader=co,d.GlobalIlluminationComponent=cg,d.GlobalUniform=$n,d.GlobalUniformGroup=Us,d.GodRayPost=Lg,d.GodRay_cs=Zf,d.GridObject=lp,d.HDRTexture=js,d.HDRTextureCube=yn,d.Hair_frag=Ol,d.Hair_shader_op=xb,d.Hair_shader_tr=Fb,d.HaltonSeq=dn,d.Horizontal=jd,d.HoverCameraController=eg,d.I3DMLoader=Ba,d.I3DMLoaderBase=Bf,d.I3DMParser=$s,d.IBLEnvMapCreator=gf,d.IBLEnvMapCreator_cs=bf,d.IESProfiles=Aa,d.IESProfiles_frag=vl,d.IKDTreeUserData=Ug,d.ImageType=ni,d.IndicesGPUBuffer=Wc,d.Inline_vert=hl,d.InputSystem=Xo,d.InstanceDrawComponent=fg,d.InstanceUniform=pl,d.InstancedMesh=vf,d.Interpolator=br,d.InterpolatorEnum=ws,d.IrradianceDataReaderCompleteEvent=dh,d.IrradianceVolumeData_frag=dl,d.Irradiance_frag=yl,d.IsEditorInspector=cu,d.IsNonSerialize=Yn,d.Joint=H0,d.JointPose=Os,d.JumperInterpolator=O0,d.KDTreeEntity=Cg,d.KDTreeNode=Dr,d.KDTreeRange=ah,d.KDTreeSpace=rh,d.KDTreeUUID=Zi,d.KHR_draco_mesh_compression=Vs,d.KHR_lights_punctual=im,d.KHR_materials_clearcoat=q0,d.KHR_materials_emissive_strength=$0,d.KHR_materials_ior=nm,d.KHR_materials_unlit=ef,d.KMZParser=Pf,d.KV=Fo,d.KelvinUtil=cp,d.KeyCode=et,d.KeyEvent=Ra,d.Keyframe=kn,d.KeyframeT=$i,d.LASLoader=_h,d.LASParser=lm,d.LASUtils=Zt,d.LASVisualizationMode=hi,d.LDRTextureCube=Sn,d.LOADED=Ca,d.LOADING=wo,d.LRUCache=Qh,d.LambertMaterial=Qm,d.Lambert_shader=Gl,d.LightBase=ki,d.LightData=fn,d.LightEntries=a0,d.LightType=ct,d.LightingFunction_frag=il,d.Line=vt,d.LineClassification=Ld,d.LinearInterpolator=V0,d.LitMaterial=qt,d.Lit_shader=kl,d.LoaderBase=Rr,d.LoaderEvent=Sg,d.LoaderManager=Tn,d.MAX_VALUE=_u,d.MIN_VALUE=Bu,d.Material=Dt,d.MaterialDataUniformGPUBuffer=Fc,d.MaterialUtilities=Nn,d.MathShader=nl,d.MathUtil=Pt,d.Matrix3=Nr,d.Matrix4=R,d.MatrixBindGroup=n0,d.MatrixGPUBuffer=i0,d.MatrixShader=Pl,d.MemoryDO=sr,d.MemoryInfo=el,d.MergeRGBACreator=kg,d.MergeRGBA_cs=Yf,d.MeshColliderShape=In,d.MinMaxAnimationCurves=zm,d.MinMaxCurve=Xh,d.MinMaxCurveState=Yh,d.MinMaxPolyCurves=Wm,d.MorePassParser=Ig,d.MorePassShader=ch,d.MorphTargetBlender=Jb,d.MorphTargetData=o0,d.MorphTargetFrame=jb,d.MorphTargetTransformKey=wd,d.MorphTarget_shader=Xt,d.MouseCode=Qn,d.MultiBouncePass_cs=k0,d.Navi3DAstar=qh,d.Navi3DConst=tn,d.Navi3DEdge=Fa,d.Navi3DFunnel=rr,d.Navi3DMaskType=Cr,d.Navi3DMesh=ap,d.Navi3DPoint=Tt,d.Navi3DPoint2D=Jo,d.Navi3DPointFat=xa,d.Navi3DRouter=pe,d.Navi3DTriangle=$h,d.NonSerialize=Zn,d.NormalMap_frag=Dl,d.OAnimationEvent=K0,d.OBJParser=sf,d.Object3DEvent=xg,d.Object3DTransformTools=jo,d.Object3DUtil=fp,d.ObjectAnimClip=kd,d.OcclusionSystem=xs,d.Octree=hr,d.OctreeEntity=Vc,d.OrbitController=tg,d.OrderMap=Om,d.Orientation3D=ia,d.OutLineBlendColor_cs=Xf,d.OutlineCalcOutline_cs=Hf,d.OutlinePass=kb,d.OutlinePost=Gg,d.OutlinePostData=uh,d.OutlinePostManager=bh,d.OutlinePostSlot=hh,d.Outline_cs=Kf,d.OvershootInterpolator=z0,d.PARSING=Rh,d.PBRLItShader=El,d.PBRLitSSSShader=md,d.PLUGIN_REGISTERED=Um,d.PNTSLoader=Uh,d.PNTSLoaderBase=vh,d.PNTSParser=yh,d.ParserBase=it,d.ParserFormat=He,d.ParticleSystemCurveEvalMode=Zh,d.ParticleSystemRandomnessIds=zh,d.PassGenerate=yi,d.PassShader=fh,d.PassType=le,d.PhysicMaterialUniform_frag=sl,d.PickCompute=qd,d.PickFire=$d,d.PickGUIEvent3D=Ut,d.PickResult=gh,d.Picker_cs=qf,d.PingPong=rs,d.PipelinePool=ms,d.Plane3D=Hh,d.PlaneClassification=Or,d.PlaneGeometry=$r,d.PlyMode=Br,d.PlyParser=cm,d.PointClassification=Gd,d.PointCloudGeometry=Bs,d.PointCloudMaterial=qc,d.PointCloud_FS=Kc,d.PointCloud_VS=Hc,d.PointLightShadowRenderer=m0,d.PointShadowCubeCamera=b0,d.PointerEvent3D=j,d.Polynomial=Oa,d.PolynomialCurve=ar,d.Polynomials=Gm,d.PoolNode=Pd,d.PostBase=Jt,d.PostProcessingComponent=Of,d.PostRenderer=B0,d.PreDepthPassRenderer=D0,d.PreFilteredEnvironment_cs=v0,d.PreFilteredEnvironment_cs2=pb,d.PreIntegratedLut=$f,d.PreIntegratedLutCompute=lh,d.PrefabAvatarData=xo,d.PrefabAvatarParser=Ch,d.PrefabBoneData=So,d.PrefabMaterialParser=xh,d.PrefabMeshData=Fh,d.PrefabMeshParser=kh,d.PrefabNode=Hi,d.PrefabParser=wh,d.PrefabStringUtil=gm,d.PrefabTextureData=Sh,d.PrefabTextureParser=Eh,d.Preprocessor=ma,d.PriorityQueue=Io,d.Probe=Hd,d.ProbeEntries=Eg,d.ProbeGBufferFrame=S0,d.ProfilerUtil=lt,d.PropertyAnimClip=Lb,d.PropertyAnimTag=Ed,d.PropertyAnimation=ho,d.PropertyAnimationClip=Lo,d.PropertyAnimationClipState=xd,d.PropertyAnimationEvent=Vi,d.PropertyHelp=Pi,d.QuadAABB=Qt,d.QuadGlsl_fs=Wl,d.QuadGlsl_vs=zl,d.QuadRoot=nh,d.QuadTree=ih,d.QuadTreeCell=_r,d.Quad_depth2dArray_frag_wgsl=pu,d.Quad_depth2d_frag_wgsl=Tl,d.Quad_depthCube_frag_wgsl=Ml,d.Quad_frag_wgsl=Ql,d.Quad_vert_wgsl=Il,d.Quaternion=ae,d.R32UintTexture=Ds,d.RADIANS_TO_DEGREES=Yr,d.RGBEErrorCode=uf,d.RGBEHeader=Zs,d.RGBEParser=Ys,d.RTDescriptor=Ge,d.RTFrame=rt,d.RTResourceConfig=Ta,d.RTResourceMap=Et,d.Rand=pi,d.RandomSeed=Su,d.Ray=na,d.RayCastMeshDetail=fi,d.Reader=Kr,d.Rect=Ai,d.Reference=Ce,d.Reflection=vd,d.ReflectionCG=tc,d.ReflectionEntries=r0,d.ReflectionMaterial=yd,d.ReflectionRenderer=U0,d.ReflectionShader=Ud,d.ReflectionShader_shader=ec,d.RegisterComponent=Lt,d.RegisterShader=Ia,d.RenderContext=Ss,d.RenderLayer=Ci,d.RenderLayerUtil=ps,d.RenderNode=Qa,d.RenderShaderCollect=Pc,d.RenderShaderCompute=oh,d.RenderShaderPass=Xe,d.RenderTexture=kt,d.RendererBase=Ma,d.RendererJob=C0,d.RendererMap=_0,d.RendererMask=Qe,d.RendererMaskUtil=aa,d.RendererPassState=l0,d.RepeatSE=is,d.Res=Vf,d.RotationControlComponents=ru,d.SHCommon_frag=ac,d.SN_ArrayConstant=_i,d.SN_BinaryOperation=dr,d.SN_Break=r2,d.SN_CodeBlock=Da,d.SN_Constant=Xa,d.SN_Continue=bn,d.SN_Declaration=$e,d.SN_Discard=i2,d.SN_DoWhileLoop=a2,d.SN_Expression=Fe,d.SN_ForLoop=Fr,d.SN_Function=hn,d.SN_FunctionArgs=un,d.SN_FunctionCall=xr,d.SN_IFBranch=Er,d.SN_Identifier=Ya,d.SN_IndexOperation=wr,d.SN_Layout=Ui,d.SN_ParenExpression=vc,d.SN_Precision=gn,d.SN_Return=Bi,d.SN_SelectOperation=vi,d.SN_Struct=Za,d.SN_TernaryOperation=Uc,d.SN_UnaryOperation=qr,d.SN_WhileLoop=kr,d.SSAO_cs=Ab,d.SSGI2_cs=ed,d.SSGIPost=zg,d.SSRPost=Wg,d.SSR_BlendColor_cs=td,d.SSR_IS_Kernel=Jg,d.SSR_IS_cs=ad,d.SSR_RayTrace_cs=rd,d.ScaleControlComponents=au,d.Scene3D=pg,d.Shader=gt,d.ShaderAttributeInfo=gs,d.ShaderConverter=Cc,d.ShaderConverterResult=Sc,d.ShaderLib=Y,d.ShaderPassBase=Kn,d.ShaderReflection=St,d.ShaderStage=_a,d.ShaderState=xc,d.ShaderUniformInfo=bs,d.ShaderUtil=Ha,d.ShadingInput=Bl,d.ShadowLightsCollect=Wt,d.ShadowMapPassRenderer=A0,d.ShadowMapping_frag=Ul,d.Skeleton=Zb,d.SkeletonAnimationClip=_n,d.SkeletonAnimationClipState=Sd,d.SkeletonAnimationCompute=Yb,d.SkeletonAnimation_shader=Zr,d.SkeletonBlendComputeArgs=Xb,d.SkeletonPose=Fi,d.SkeletonTransformComputeArgs=Hb,d.SkyGBufferPass=kc,d.SkyGBuffer_pass=Jl,d.SkyMaterial=Bd,d.SkyRenderer=Fn,d.SolidColorSky=np,d.SphereColliderShape=mg,d.SphereGeometry=Ir,d.SphereReflection=Cd,d.StandShader=nf,d.StatementNode=Oe,d.StorageGPUBuffer=Te,d.StringUtil=Rt,d.Struct=gi,d.StructStorageGPUBuffer=wg,d.SubGeometry=jc,d.TAACopyTex_cs=id,d.TAAPost=jg,d.TAASharpTex_cs=nd,d.TAA_cs=sd,d.TestComputeLoadBuffer=cd,d.TextAnchor=Wd,d.TextFieldLayout=Yd,d.TextFieldLine=Zd,d.Texture=ft,d.TextureCube=vn,d.TextureCubeFaceData=Xs,d.TextureCubeStdCreator=Un,d.TextureCubeUtils=Js,d.TextureMipmapCompute=Rg,d.TextureMipmapGenerator=pa,d.TextureScaleCompute=sh,d.ThirdPersonCameraController=rg,d.Tile=Ro,d.TileSet=xm,d.TileSetChild=km,d.TileSetChildContent=Em,d.TileSetChildContentMetaData=wm,d.TileSetRoot=Fm,d.TilesRenderer=Sm,d.Time=Le,d.TokenType=U,d.TorusGeometry=tu,d.TouchData=Yo,d.TrailGeometry=rp,d.Transform=zt,d.TransformAxisEnum=N,d.TransformControllerBaseComponent=Jn,d.TransformMode=mt,d.TransformSpaceMode=ha,d.TranslationControlComponents=iu,d.TranslatorContext=us,d.TriGeometry=ip,d.Triangle=Ji,d.UIButton=po,d.UIButtonTransition=Xd,d.UIComponentBase=mo,d.UIEvent=Fg,d.UIImage=Pr,d.UIImageGroup=Ao,d.UIInteractive=Rn,d.UIInteractiveStyle=tt,d.UIPanel=Wi,d.UIRenderAble=zi,d.UIShadow=Do,d.UITextField=_o,d.UITransform=er,d.UNLOADED=vr,d.UUID=Gt,d.UV=Wo,d.Uint32ArrayTexture=Yc,d.Uint8ArrayTexture=pn,d.UnLit=Ll,d.UnLitMaterial=Bt,d.UnLitMaterialUniform_frag=ol,d.UnLitTexArrayMaterial=Mm,d.UnLitTextureArray=pd,d.UnLit_frag=ll,d.UniformGPUBuffer=yt,d.UniformNode=or,d.UniformType=Ct,d.ValueEnumType=X,d.ValueOp=tp,d.ValueParser=Va,d.ValueSpread=Jm,d.Vector2=de,d.Vector3=b,d.Vector3Ex=Oi,d.Vector4=he,d.VertexAttribute=vg,d.VertexAttributeIndexShader=ud,d.VertexAttributeName=G,d.VertexAttributeSize=lr,d.VertexAttributeStride=th,d.VertexAttributes_vert=cl,d.VertexBufferLayout=Bg,d.VertexFormat=al,d.VertexGPUBuffer=mn,d.Vertical=Jd,d.VideoUniform_frag=fl,d.View3D=Ag,d.ViewPanel=En,d.ViewQuad=Cs,d.VirtualTexture=we,d.WGS84_FLATTENING=Bm,d.WGS84_HEIGHT=vm,d.WGS84_RADIUS=_m,d.WGSLTranslator=Bc,d.WayLines3D=Ti,d.WayPoint3D=Qi,d.WebGPUDescriptorCreator=Je,d.WorldMatrixUniform=es,d.WorldPanel=wn,d.WrapMode=li,d.WrapTimeMode=Ar,d.ZCullingCompute=Tg,d.ZPassShader_cs=hd,d.ZPassShader_fs=Kl,d.ZPassShader_vs=Hl,d.ZSorterUtil=Qc,d.append=bc,d.arrayToString=mf,d.blendComponent=bu,d.buildCurves=Zm,d.byteSizeOfType=da,d.calculateCurveRangesValue=Ym,d.calculateMinMax=Ki,d.castPointShadowMap_vert=Zl,d.clamp=Ae,d.clampRepeat=Yu,d.computeAABBFromPositions=vo,d.cos=Vu,d.crossProduct=Ju,d.cubicPolynomialRoot=Wh,d.cubicPolynomialRootsGeneric=Jh,d.curvesSupportProcedural=jm,d.deg2Rad=Mu,d.detectGSplatFormat=mh,d.directionShadowCastMap_frag=Xl,d.dot=xt,d.doubleIntegrateSegment=jh,d.downSample=zf,d.fastInvSqrt=hc,d.floorfToIntPos=dc,d.fonts=ri,d.generateRandom=ju,d.generateRandom3=Zu,d.getFloatFromInt=lc,d.getGLTypeFromTypedArray=L2,d.getGLTypeFromTypedArrayType=O2,d.getGlobalRandomSeed=Ou,d.getTypedArray=G2,d.getTypedArrayTypeFromGLType=Ps,d.grad1=zo,d.grad2=Wn,d.grad3=qi,d.grad4=ui,d.inferSHOrder=yo,d.integrateSegment=Go,d.irradianceDataReader=Qg,d.kPI=Lm,d.lerp=Sr,d.lerpByte=yu,d.lerpColor=Uu,d.lerpVector3=vu,d.lruPriorityCallback=Lh,d.magnitude=ss,d.makeAloneSprite=K2,d.makeGUISprite=Ff,d.makeMatrix44=cn,d.markUsedSetLeaves=Po,d.markUsedTiles=Ln,d.markVisibleTiles=Vo,d.matrixMultiply=fs,d.matrixRotate=qu,d.matrixRotateY=Ku,d.mergeFunctions=nn,d.multiplyMatrices4x4REF=uc,d.normal_distribution=Kh,d.normalizeFast=Wu,d.normalizeSafe=oc,d.normalizedToByte=zu,d.normalizedToWord=Gu,d.outlinePostData=ya,d.outlinePostManager=Zg,d.parsePlyGaussianSplat=Co,d.parsePlyHeader=Xi,d.parsePlyMesh=Ah,d.parsePlyPointCloud=Dh,d.perm=Ue,d.post=Wf,d.priorityCallback=Oh,d.quadraticPolynomialRootsGeneric=zn,d.rad2Deg=Nu,d.random01=Xr,d.randomBarycentricCoord=Tu,d.randomPointBetweenEllipsoid=Qu,d.randomPointBetweenSphere=Ru,d.randomPointInsideCube=Eu,d.randomPointInsideEllipsoid=wu,d.randomPointInsideUnitCircle=Iu,d.randomPointInsideUnitSphere=fc,d.randomQuaternion=Fu,d.randomQuaternionUniformDistribution=ku,d.randomUnitVector=ln,d.randomUnitVector2=cc,d.rangedRandomFloat=At,d.rangedRandomInt=xu,d.readByType=Be,d.readMagicBytes=ti,d.registerMaterial=Tm,d.repeat=cs,d.rotMatrix=Hu,d.rotateVectorByQuat=Du,d.roundfToIntPos=os,d.scale=ns,d.shadowCastMap_frag=Yl,d.shadowCastMap_vert=jl,d.simplex=ea,d.sin=Pu,d.snoise1=Km,d.snoise2=qm,d.snoise3=$m,d.snoise4=ep,d.splatColorProperties=ph,d.splatProperties=Uo,d.sqrMagnitude=ls,d.sqrtImpl=sc,d.stencilStateFace=gu,d.swap=Lu,d.textureCompress=fd,d.threshold=Gf,d.throttle=Rm,d.toHalfFloat=ur,d.toggleTiles=Oo,d.traverseAncestors=ym,d.traverseSet=Th,d.tw=Ub,d.uniform_real_distribution=Xm,d.uniform_real_distribution2=Hm,d.upSample=lo,d.webGPUContext=w,d.zSorterUtil=Tc,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
|
11825
|
+
`).filter(Boolean),i=[];for(const n of r){const o=Zt.parseParameterLine(n);o.mnemonic&&i.push(o.mnemonic)}if(i.length===0)throw new Error("LASLoader: No headers found in ~CURVE section");return i}parseData(e,t,a){const r=e.match(/~A(?:[\x20-\x7E])*(?:\r\n|\r|\n)([\s\S]*?)(?=~|$)/);if(!r||!r[1])throw new Error("LASLoader: ~A data section not found");const i=r[1].trim();if(!i)throw new Error("LASLoader: Data section is empty");const n=i.split(/\s+/).filter(c=>c.trim().length>0).map(c=>Zt.convertToValue(c.trim()));if(n.length===0)throw new Error("LASLoader: No data values found");const o=Math.floor(n.length/t.length);if(o===0)throw new Error("LASLoader: Insufficient data values");const l=[];for(let c=0;c<o;c++){const f=[];for(let h=0;h<t.length;h++){const u=c*t.length+h;u<n.length&&f.push(n[u])}f.length===t.length&&l.push(f)}return l}}var hi=(s=>(s.PointCloud="pointcloud",s.Curve="curve",s.WellTrajectory="trajectory",s))(hi||{}),sm=Object.getOwnPropertyDescriptor,om=(s,e,t,a)=>{for(var r=a>1?void 0:a?sm(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.FatLineShader=class extends gt{constructor(){super();const e=new Xe("FatLine_VS","FatLine_FS");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);const t=e.shaderState;t.acceptShadow=!1,t.castShadow=!1,t.receiveEnv=!1,t.acceptGI=!1,t.useLight=!1,t.cullMode=Nt.none,t.depthWriteEnabled=!0,this.setDefault()}setDefault(){this.setUniformColor("baseColor",new J(1,1,1,1)),this.setUniformFloat("lineWidth",1),this.setUniformFloat("opacity",1),this.setUniformVector2("resolution",new de(1920,1080));const e=new R;this.getDefaultColorShader().setUniform("modelMatrix",e.rawData)}},d.FatLineShader=om([Ra(d.FatLineShader,"FatLineShader")],d.FatLineShader);class Bh extends Dt{constructor(){super(),this.shader=new d.FatLineShader,this.transparent=!0}setInstanceBuffer(e){this.shader.setStorageBuffer("instances",e)}setModelMatrix(e){this.shader.getDefaultColorShader().setUniform("modelMatrix",e.rawData)}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set lineWidth(e){this.shader.setUniformFloat("lineWidth",e)}get lineWidth(){return this.shader.getUniformFloat("lineWidth")}set opacity(e){this.shader.setUniformFloat("opacity",e)}get opacity(){return this.shader.getUniformFloat("opacity")}set resolution(e){this.shader.setUniformVector2("resolution",e)}get resolution(){return this.shader.getUniformVector2("resolution")}}class lm extends it{static format=He.BIN;visualizationMode=hi.PointCloud;async parseBuffer(e){const a=await new _h().parse(e);await this.createVisualization(a)}async createVisualization(e){if("format"in e&&e.format==="binary")this.data=this.createBinaryPointCloudVisualization(e);else{const t=e;let a;switch(this.visualizationMode){case hi.PointCloud:a=this.createPointCloudVisualization(t);break;case hi.Curve:a=this.createCurveVisualization(t);break;case hi.WellTrajectory:a=this.createWellTrajectoryVisualization(t);break;default:a=this.createPointCloudVisualization(t)}a.lasData=t,a.wellParams=t.wellParams,a.curveParams=t.curveParams,this.data=a}}createBinaryPointCloudVisualization(e){const t=new d.Object3D;t.name="LASPointCloud";const a=new d.Object3D;a.name="LASPointCloudRoot",t.addChild(a);const r=a.addComponent(d.PointCloudRenderer);return r.initFromData(e.positions,e.colors,e.numPoints),r.setPointShape("circle"),r.setPointSize(4),t.lasFormat="binary",t.lasVersion=e.version,t.numPoints=e.numPoints,t.pointDataFormat=e.pointDataFormat,t.bbox=e.bbox,t}verification(){if(this.data)return!0;throw new Error("LASParser: Parse failed")}createPointCloudVisualization(e){const{headers:t,data:a,nullValue:r}=e,i=t.findIndex(D=>D.toUpperCase()==="DEPTH"||D.toUpperCase()==="DEPT");if(i<0)throw new Error("LASParser: DEPTH column not found");const n=t.map((D,B)=>B).filter(D=>D!==i).slice(0,2),o=a.filter(D=>!D.some(B=>B===r||B===+r));if(o.length===0)throw new Error("LASParser: No valid data points after filtering");const l=o.length,c=new Float32Array(l*3),f=new Uint8Array(l*4);let h=1/0,u=-1/0,g=1/0,A=-1/0;if(n.length>0){const D=o.map(B=>+B[n[0]]).filter(B=>!isNaN(B));if(h=Math.min(...D),u=Math.max(...D),n.length>1){const B=o.map(v=>+v[n[1]]).filter(v=>!isNaN(v));g=Math.min(...B),A=Math.max(...B)}}for(let D=0;D<o.length;D++){const B=o[D],v=D*3,C=D*4;if(c[v+2]=+B[i],n.length>0){const y=+B[n[0]],x=u!==h?(y-h)/(u-h):0;if(c[v+0]=x*10,n.length>1){const k=+B[n[1]],E=A!==g?(k-g)/(A-g):0;c[v+1]=E*10}else c[v+1]=0}else c[v+0]=0,c[v+1]=0;if(n.length>0){const y=+B[n[0]],x=u!==h?(y-h)/(u-h):0;this.mapValueToColor(x,f,C)}else f[C+0]=255,f[C+1]=255,f[C+2]=255,f[C+3]=255}const m=new d.Object3D;m.name="LASPointCloud";const p=m.addComponent(d.PointCloudRenderer);return p.initFromData(c,f,l),p.setPointShape("circle"),p.setPointSize(4),m}createCurveVisualization(e){const{headers:t,data:a,nullValue:r}=e,i=t.findIndex(D=>D.toUpperCase()==="DEPTH"||D.toUpperCase()==="DEPT");if(i<0)throw new Error("LASParser: DEPTH column not found");const n=t.map((D,B)=>B).find(D=>D!==i);if(n===void 0)throw new Error("LASParser: No curve column found");const o=a.filter(D=>{const B=+D[i],v=+D[n];return!isNaN(B)&&!isNaN(v)&&v!==r&&v!==+r});if(o.length===0)throw new Error("LASParser: No valid data points");const l=o.map(D=>+D[n]),c=Math.min(...l),h=Math.max(...l)-c,u=new Float32Array(o.length*3);for(let D=0;D<o.length;D++){const B=o[D],v=D*3,C=+B[i],y=+B[n];u[v+2]=C;const x=h>0?(y-c)/h:0;u[v+0]=x*10,u[v+1]=0}const g=new eh;g.setPositions(u);const A=new Bh;A.baseColor=new J(1,0,0,1),A.lineWidth=2;const m=new d.Object3D;m.name=`LASCurve_${t[n]}`;const p=m.addComponent(d.FatLineRenderer);return p.geometry=g,p.material=A,m}createWellTrajectoryVisualization(e){throw new Error("LASParser: Well trajectory visualization not yet implemented")}normalizeValue(e,t,a){const r=t.map(o=>+o[a]).filter(o=>!isNaN(o)),i=Math.min(...r),n=Math.max(...r);return n!==i?(e-i)/(n-i):0}mapValueToColor(e,t,a){const r=Math.floor(e*255),i=Math.floor((1-e)*255);t[a+0]=r,t[a+1]=0,t[a+2]=i,t[a+3]=255}}class cm extends it{static format=He.BIN;async parseBuffer(e){switch(Xi(e).mode){case _r.Splat:{const a=Co(e),r={count:a.vertexCount,position:a.position,rotation:a.rotation,scale:a.scale,opacity:a.opacity,sh:a.sh};r.bbox=vo(a.position);const i=new d.Object3D;i.name="GaussianSplat",i.addComponent(d.GSplatRenderer).initAsset(r),this.data=i;break}case _r.PointCloud:{const a=Dh(e),r=new d.Object3D;r.name="PLYPointCloud";const i=new d.Object3D;i.name="PLYPointCloudRoot",r.addChild(i);const n=i.addComponent(d.PointCloudRenderer);if(a.color)n.initFromData(a.position,a.color,a.vertexCount);else{const o=new Uint8Array(a.vertexCount*4);o.fill(255),n.initFromData(a.position,o,a.vertexCount)}n.setPointShape("circle"),n.setPointSize(4),this.data=r;break}case _r.Mesh:{const a=Ah(e),r=new d.Object3D;r.name="PLYMesh";const i=new Map;if(a.triangleTexnumbers&&a.triangleTexnumbers.length>0)for(let o=0;o<a.triangleTexnumbers.length;o++){const l=a.triangleTexnumbers[o];i.has(l)||i.set(l,[]),i.get(l).push(o)}else{const o=a.indices.length/3,l=[];for(let c=0;c<o;c++)l.push(c);i.set(0,l)}const n=new Map;if(a.textureFiles&&a.textureFiles.length>0){const o=[];for(let l=0;l<a.textureFiles.length;l++){const c=new qt,f=Rt.normalizePath(this.baseUrl+a.textureFiles[l]);o.push(_.res.loadTexture(f).then(h=>{c.baseMap=h,n.set(l,c)}))}await Promise.all(o)}n.size===0&&n.set(0,new qt);for(const[o,l]of i){const c=[];for(const A of l){const m=A*3;c.push(a.indices[m+0],a.indices[m+1],a.indices[m+2])}const f=new Ve;f.setAttribute(G.position,a.position),f.setAttribute(G.normal,a.normal),a.uv&&f.setAttribute(G.uv,a.uv),a.color&&f.setAttribute(G.color,a.color),f.setIndices(new Uint32Array(c)),f.addSubGeometry({indexStart:0,indexCount:c.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0});let h=n.get(o);h||(h=n.values().next().value||new qt);const u=new d.Object3D;u.name=`PLYMesh_Texture_${o}`;const g=u.addComponent(d.MeshRenderer);g.geometry=f,g.material=h,r.addChild(u)}this.data=r;break}}}verification(){return!!this.data}}class vh{async parse(e){const t=new DataView(e),a=ti(t);console.assert(a==="pnts");const r=t.getUint32(4,!0);console.assert(r===1);const i=t.getUint32(8,!0);console.assert(i===e.byteLength);const n=t.getUint32(12,!0),o=t.getUint32(16,!0),l=t.getUint32(20,!0),c=t.getUint32(24,!0),f=28,h=new Ei(e,f,n,o),u=f+n+o,g=h.header.POINTS_LENGTH||0,A=new Cn(e,g,u,l,c);return{version:r,featureTable:h,batchTable:A}}}class Uh extends vh{async parse(e){const t=await super.parse(e),{featureTable:a,batchTable:r}=t,i=a.header.POINTS_LENGTH;if(!i||i<=0)throw new Error("PNTSLoader: POINTS_LENGTH must be defined and greater than zero");const o=a.header.extensions?.["3DTILES_draco_point_compression"];let l,c;if(o){const g=await this.parseDraco(a,o,i);l=g.positions,c=g.colors,g.normals}else l=this.parsePositions(a,i),c=this.parseColors(a,i),this.parseNormals(a,i);const f=new d.Object3D,h=f.addComponent(d.PointCloudRenderer);h.initFromData(l,c,i),h.setPointShape("circle"),h.setPointSize(4);const u=a.getData("RTC_CENTER",1,"FLOAT","VEC3");return u&&f.transform.localPosition.set(u[0],u[1],u[2]),f.batchTable=r,f.featureTable=a,f}parsePositions(e,t){let a=e.getData("POSITION",t,"FLOAT","VEC3");if(a)return a;const r=e.getData("POSITION_QUANTIZED",t,"UNSIGNED_SHORT","VEC3");if(!r)throw new Error("PNTSLoader: Either POSITION or POSITION_QUANTIZED must be defined");const i=e.getData("QUANTIZED_VOLUME_SCALE",1,"FLOAT","VEC3"),n=e.getData("QUANTIZED_VOLUME_OFFSET",1,"FLOAT","VEC3");if(!i||!n)throw new Error("PNTSLoader: QUANTIZED_VOLUME_SCALE and QUANTIZED_VOLUME_OFFSET must be defined for quantized positions");const o=new Float32Array(t*3),l=65535;for(let c=0;c<t;c++){const f=c*3;o[f+0]=r[f+0]/l*i[0]+n[0],o[f+1]=r[f+1]/l*i[1]+n[1],o[f+2]=r[f+2]/l*i[2]+n[2]}return o}parseColors(e,t){let a=e.getData("RGBA",t,"UNSIGNED_BYTE","VEC4");if(a)return a;const r=e.getData("RGB",t,"UNSIGNED_BYTE","VEC3");if(r){const l=new Uint8Array(t*4);for(let c=0;c<t;c++){const f=c*3,h=c*4;l[h+0]=r[f+0],l[h+1]=r[f+1],l[h+2]=r[f+2],l[h+3]=255}return l}const i=e.getData("RGB565",t,"UNSIGNED_SHORT","SCALAR");if(i){const l=new Uint8Array(t*4);for(let c=0;c<t;c++){const f=this.decodeRGB565(i[c]),h=c*4;l[h+0]=f[0],l[h+1]=f[1],l[h+2]=f[2],l[h+3]=255}return l}const n=e.getData("CONSTANT_RGBA",1,"UNSIGNED_BYTE","VEC4");if(n){const l=new Uint8Array(t*4);for(let c=0;c<t;c++){const f=c*4;l[f+0]=n[0],l[f+1]=n[1],l[f+2]=n[2],l[f+3]=n[3]}return l}const o=new Uint8Array(t*4);return o.fill(255),o}parseNormals(e,t){let a=e.getData("NORMAL",t,"FLOAT","VEC3");if(a)return a;const r=e.getData("NORMAL_OCT16P",t,"UNSIGNED_BYTE","VEC2");return r?this.decodeOctNormals(r,t):null}decodeRGB565(e){const t=(e>>11&31)<<3,a=(e>>5&63)<<2,r=(e&31)<<3;return[t,a,r]}decodeOctNormals(e,t){const a=new Float32Array(t*3);for(let r=0;r<t;r++){const i=r*2,n=e[i]/255,o=e[i+1]/255,l=n*2-1,c=o*2-1,f=1-Math.abs(l)-Math.abs(c);let h,u;f<0?(h=(l>=0?1:-1)*(1-Math.abs(c)),u=(c>=0?1:-1)*(1-Math.abs(l))):(h=l,u=c);const g=Math.sqrt(h*h+u*u+f*f),A=r*3;a[A+0]=h/g,a[A+1]=u/g,a[A+2]=f/g}return a}async parseDraco(e,t,a){throw new Error("Draco compression not yet implemented")}}class yh extends it{static format=He.BIN;async parseBuffer(e){const a=await new Uh().parse(e),r=new d.Object3D;r.name="PNTS",r.addChild(a),this.data=r}verification(){if(this.data)return!0;throw new Error("PNTSParser: Parse failed")}}class So{boneName;bonePath;parentBoneName;boneID;parentBoneID;instanceID;parentInstanceID;t;q;s;formBytes(e){this.boneName=e.readUTF(),this.bonePath=e.readUTF(),this.parentBoneName=e.readUTF(),this.boneID=e.readInt32(),this.parentBoneID=e.readInt32(),this.instanceID=e.readUTF(),this.parentInstanceID=e.readUTF(),this.t=e.readVector3(),this.q=e.readQuaternion(),this.s=e.readVector3()}}class xo{name;count;boneData;boneMap;formBytes(e){this.boneData=[],this.boneMap=new Map,this.name=e.readUTF(),this.count=e.readInt32();for(let t=0;t<this.count;t++){let a=new So;a.formBytes(e.readBytesArray()),this.boneData[t]=a,this.boneMap.set(a.boneName,a)}}}class Ch extends it{static format=He.BIN;static parser(e,t){let a=e.readInt32();for(let r=0;r<a;r++){let i=new xo;i.formBytes(e.readBytesArray()),_.res.addObj(i.name,i)}}verification(){if(this.data)return!0;throw new Error("verify failed.")}}G.position,G.normal,G.color,G.TANGENT,G.uv,G.TEXCOORD_1,G.TEXCOORD_2,G.TEXCOORD_2,G.TEXCOORD_4,G.TEXCOORD_5,G.TEXCOORD_6,G.TEXCOORD_7,G.joints0,G.weights0;var X=(s=>(s[s.single=0]="single",s[s.boolean=1]="boolean",s[s.int=2]="int",s[s.int16=3]="int16",s[s.int32=4]="int32",s[s.float=5]="float",s[s.long=6]="long",s[s.uint=7]="uint",s[s.uint32=8]="uint32",s[s.uint64=9]="uint64",s[s.double=10]="double",s[s.string=11]="string",s[s.singleArray=12]="singleArray",s[s.stringArray=13]="stringArray",s[s.floatArray=14]="floatArray",s[s.vector2=15]="vector2",s[s.vector3=16]="vector3",s[s.vector4=17]="vector4",s[s.color=18]="color",s[s.color32=19]="color32",s[s.animationCurve=20]="animationCurve",s[s.quaternion=21]="quaternion",s[s.matrix4x4=22]="matrix4x4",s[s.mesh=23]="mesh",s[s.texture=24]="texture",s[s.material=25]="material",s[s.materials=26]="materials",s[s.skeleton=27]="skeleton",s[s.animClip=28]="animClip",s[s.vector2Int=29]="vector2Int",s[s.int32List=30]="int32List",s[s.colorList=31]="colorList",s[s.color32List=32]="color32List",s))(X||{});class Nn{static GetMaterial(e){let t=e,a=t.split("/");t=a[a.length-1],a=t.split("."),t=a[a.length-1];let r=qo(t);if(r){let i=new Dt;return i.shader=new r,i}else throw new Error("not found shader, shader name is "+t)}static applyMaterialTexture(e,t){for(let a=0;a<t.length;a++){const r=t[a];r.property in e?e[r.property]=r.texture:r.property in e.shader?e.shader[r.property]=r.texture:e.setTexture(r.property,r.texture)}}static applyMaterialProperties(e,t){for(let a=0;a<t.length;a++){const r=t[a],i=r.key;switch(r.type){case X.color:case X.color32:{let n=r.getValue();i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformColor(i,n)}break;case X.single:case X.float:case X.int:case X.int16:case X.int32:case X.uint:case X.uint32:case X.uint64:{let n=r.getValue();i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformFloat(i,n)}break;case X.singleArray:{let n=r.getValue()[0];i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformFloat(i,n)}break;case X.vector2:case X.vector2Int:{let n=r.getValue();i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformVector2(i,n)}break;case X.vector3:{let n=r.getValue();i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformVector3(i,n)}break;case X.vector4:{let n=r.getValue();i in e?e[i]=n:i in e.shader?e.shader[i]=n:e.setUniformVector4(i,n)}break}}}}class Pa{static parser(e){switch(e.readInt32()){case X.single:return{t:X.single,v:e.readFloat32()};case X.boolean:return{t:X.boolean,v:e.readBoolean()};case X.int:return{t:X.int,v:e.readInt32()};case X.int16:return{t:X.int16,v:e.readInt16()};case X.int32:return{t:X.int32,v:e.readInt32()};case X.float:return{t:X.float,v:e.readFloat32()};case X.long:return{t:X.long,v:e.readFloat64()};case X.uint:return{t:X.uint,v:e.readUnit32()};case X.uint32:return{t:X.uint32,v:e.readUnit32()};case X.uint64:return{t:X.uint64,v:e.readUnit32()};case X.double:return{t:X.double,v:e.readFloat64()};case X.string:return{t:X.string,v:e.readUTF()};case X.singleArray:return{t:X.singleArray,v:e.readFloatArray()};case X.stringArray:return{t:X.stringArray,v:e.readStringArray()};case X.floatArray:return{t:X.floatArray,v:e.readFloatArray()};case X.vector2:return{t:X.vector2,v:e.readVector2()};case X.vector3:return{t:X.vector3,v:e.readVector3()};case X.vector4:return{t:X.vector4,v:e.readVector4()};case X.color:return{t:X.color,v:e.readColor()};case X.color32:return{t:X.color32,v:e.readColor()};case X.animationCurve:return{t:X.animationCurve,v:null};case X.quaternion:return{t:X.quaternion,v:e.readQuaternion()};case X.matrix4x4:return{t:X.matrix4x4,v:null};case X.mesh:{let o=e.readUTF(),l=_.res.getGeometry(o);return{t:X.mesh,v:l}}case X.texture:{let o=e.readUTF(),l=_.res.getTexture(o);return{t:X.texture,v:l}}case X.material:{let o=e.readUTF(),l=_.res.getMat(o);return{t:X.material,v:l}}case X.materials:{let o=e.readStringArray(),l=[];for(let c=0;c<o.length;c++){const f=o[c];let h=_.res.getMat(f);l.push(h)}return{t:X.materials,v:l}}case X.skeleton:break;case X.animClip:{let o=[],l=e.readInt32();for(let c=0;c<l;c++){let f=new Lo;f.formBytes(e),o.push(f)}return{t:X.animClip,v:o}}case X.vector2Int:return{t:X.vector2Int,v:e.readVector2int()};case X.int32List:return{t:X.int32List,v:e.readInt32List()};case X.colorList:let a=e.readInt32(),r=[];for(let o=0;o<a;o++){const l=Pa.parser(e).v;r.push(l)}return{t:X.colorList,v:r};case X.color32List:let i=e.readInt32(),n=[];for(let o=0;o<i;o++){const l=Pa.parser(e).v;n.push(l)}return{t:X.color32List,v:n}}}}class Fo{key;type;_data;getValue(){return this._data}formBytes(e){this.key=e.readUTF();let{t,v:a}=Pa.parser(e);this.type=t,this._data=a}}class Sh{property;name;texture;texelSize;wrapModeU;wrapModeV;wrapModeW;wrapMode;anisoLevel;dimension;filterMode}class xh extends it{static format=He.TEXT;static parserMaterial(e,t){let a=e.readInt32();for(let r=0;r<a;r++){let i=e.readBytesArray(),n=i.readUTF(),o=i.readUTF();i.readUTF();let l=i.readStringArray();i.readVector4(),i.readVector4();let c=i.readUTF(),f=[],h=[],u=i.readInt32();for(let m=0;m<u;m++){let p=new Fo;p.formBytes(i),f.push(p)}let g=i.readInt32();for(let m=0;m<g;m++){let p=i.readBytesArray(),D=new Sh;D.property=p.readUTF(),D.name=p.readUTF(),D.texture=_.res.getTexture(D.name),D.texelSize=p.readVector2(),D.wrapModeU=p.readUnit32(),D.wrapModeV=p.readUnit32(),D.wrapModeW=p.readUnit32(),D.wrapMode=p.readUnit32(),D.anisoLevel=p.readUnit32(),D.dimension=p.readUnit32(),D.filterMode=p.readUnit32(),h.push(D)}let A=Nn.GetMaterial(c);A.name=n;for(let m=0;m<l.length;m++){const p=l[m];A.shader.setDefine(p,!0)}Nn.applyMaterialTexture(A,h),Nn.applyMaterialProperties(A,f),_.res.addMat(o,A)}}verification(){if(this.data)return!0;throw new Error("verify failed.")}}class ko{shapeName;shapeIndex;frameCount;blendPositionList=new Float32Array;blendNormalList=new Float32Array;formBytes(e){let t=e.readBytesArray();this.shapeName=t.readUTF(),this.shapeIndex=t.readInt32(),this.frameCount=t.readInt32();let a=t.readInt32();this.blendPositionList=t.readFloat32Array(a*3);let r=t.readInt32();this.blendNormalList=t.readFloat32Array(r*3)}}class Eo{vertexCount;shapeNames;shapeIndexs;blendCount;blendShapePropertyDatas;blendShapeMap;formBytes(e){this.blendShapeMap=new Map,this.blendShapePropertyDatas=[];let t=e.readBytesArray();this.vertexCount=t.readInt32(),this.shapeNames=t.readStringArray(),this.shapeIndexs=t.readIntArray(),this.blendCount=t.readInt32();for(let a=0;a<this.blendCount;a++){let r=new ko;r.formBytes(t),this.blendShapePropertyDatas.push(r),this.blendShapeMap.set(r.shapeName,r)}return e}}class Fh{name;meshName;meshID;vertexCount;vertexStrip;vertexBuffer;indices;attributes;bones;bindPose;blendShapeData}class kh extends it{static format=He.BIN;async parseBuffer(e){}static parserMeshs(e,t){let a=e.readInt32();for(let r=0;r<a;r++){let i=new Fh,n=e.readBytesArray();i.meshName=n.readUTF(),i.meshID=n.readUTF(),n.readFloat32()>0,n.readFloat32()>0,n.readFloat32()>0;let o=n.readFloat32()>0,l=n.readFloat32()>0;o&&(i.bones=n.readStringArray(),i.bindPose=n.readMatrix44Array()),l&&(i.blendShapeData=new Eo,i.blendShapeData.formBytes(n));let c=n.readBytesArray(),f=n.readBytesArray(),h=c.readInt32(),u=0,g=[];for(let B=0;B<h;B++)g[B]={},g[B].att=fm[c.readUTF()],g[B].dim=c.readInt32(),u+=g[B].dim,g[B].format=c.readUTF();i.vertexCount=c.readInt32(),i.vertexBuffer=f.getFloat32Array();let A=n.readInt32Array(),m=[],p=n.readInt32();for(let B=0;B<p;B++){let v=n.readInt32(),C=n.readInt32(),y=n.readInt32(),x=n.readInt32(),k=n.readInt32(),E=n.readInt32();n.readVector3(),n.readVector3();let S={indexStart:C,indexCount:y,vertexStart:x,vertexCount:E,firstStart:k,topology:v,index:B};m.push(S)}A.length>65535?i.indices=new Uint32Array(A):i.indices=new Uint16Array(A);let D=new Ve;if(D.vertexDim=u,D.geometryType=Ft.compose_bin,D.setIndices(i.indices),D.setAttribute(G.all,i.vertexBuffer),o&&(D.skinNames=i.bones,D.bindPose=i.bindPose),l){D.blendShapeData=i.blendShapeData,D.morphTargetsRelative=!0,D.morphTargetDictionary={};for(let B=0;B<i.blendShapeData.blendCount;B++){D.setAttribute("a_morphPositions_"+B,i.blendShapeData.blendShapePropertyDatas[B].blendPositionList),D.setAttribute("a_morphNormals_"+B,i.blendShapeData.blendShapePropertyDatas[B].blendNormalList);for(let v=0;v<i.blendShapeData.blendCount;v++){let C=i.blendShapeData.shapeNames[v],y=i.blendShapeData.shapeIndexs[v];D.morphTargetDictionary[C]=y}}}for(let B=0;B<g.length;B++){const v=g[B].att;D.setAttribute(v,null)}for(let B=0;B<m.length;B++){const v=m[B];D.addSubGeometry(v)}D.name=i.meshName,_.res.addGeometry(i.meshID,D)}}verification(){if(this.data)return!0;throw new Error("verify failed.")}}let fm={Position:G.position,Normal:G.normal,Color:G.color,Tangent:G.TANGENT,TexCoord0:G.uv,TexCoord1:G.TEXCOORD_1,TexCoord2:G.TEXCOORD_2,TexCoord3:G.TEXCOORD_2,TexCoord4:G.TEXCOORD_4,TexCoord5:G.TEXCOORD_5,TexCoord6:G.TEXCOORD_6,TexCoord7:G.vIndex,BlendIndices:G.joints0,BlendWeight:G.weights0};class Pn extends DataView{get buffer(){return super.buffer}get byteOffset(){return super.byteOffset}get byteLength(){return super.byteLength}getInt16(e,t){return super.getInt16(e,t)}getInt32(e,t){return super.getInt32(e,t)}getFloat32(e,t){return super.getFloat32(e,t)}getFloat64(e,t){return super.getFloat64(e,t)}getUint8(e){return super.getUint8(e)}getUint32(e,t){return super.getUint32(e,t)}getInt8(e){return super.getInt8(e)}getUint16(e,t){return super.getUint16(e,t)}position=0;littleEndian=!0;constructor(e,t,a){super(e,t,a),this.position=0,this.position+=this.byteOffset}readUTF(){let e=this.readInt32(),t=e%4;t>0&&t<4&&(t=4-t);let a="",r=new Int8Array(this.buffer,this.position,e);return this.position+=e*Int8Array.BYTES_PER_ELEMENT,a+=String.fromCharCode.apply(null,r),this.position+=t*Int8Array.BYTES_PER_ELEMENT,a}readStringArray(){let e=[],t=this.readInt32();for(let a=0;a<t;a++)e.push(this.readUTF());return e}readByte(){let e=this.buffer[this.position];return this.position+=1,e}readBoolean(){let e=this.readInt32();return this.position+=4,e==1}readBytes(e){let t=new DataView(this.buffer,this.position,e);return this.position+=e,t.buffer}readBytesArray(){let e=this.readInt32(),t=new Pn(this.buffer.slice(this.position,this.position+e));return this.position+=e,t}readUnit8(){let e=this.getUint8(this.position);return this.position+=Uint8Array.BYTES_PER_ELEMENT,e}readUnit16(){let e=this.getUint16(this.position);return this.position+=Uint16Array.BYTES_PER_ELEMENT,e}readUnit32(){let e=this.getUint32(this.position);return this.position+=Uint32Array.BYTES_PER_ELEMENT,e}readInt8(){let e=this.getInt8(this.position);return this.position+=Int8Array.BYTES_PER_ELEMENT,e}readInt16(){let e=this.getInt16(this.position,this.littleEndian);return this.position+=Int16Array.BYTES_PER_ELEMENT,e}readInt32(){let e=this.getInt32(this.position,this.littleEndian);return this.position+=Int32Array.BYTES_PER_ELEMENT,e}readFloat32(){let e=this.getFloat32(this.position,this.littleEndian);return this.position+=Float32Array.BYTES_PER_ELEMENT,e}readFloat64(){let e=this.getFloat64(this.position,this.littleEndian);return this.position+=Float64Array.BYTES_PER_ELEMENT,e}readInt32Array(){let e=this.readInt32(),t=new Int32Array(this.buffer,this.position,e);return t=t.slice(0,e),this.position+=t.byteLength,t}readInt32List(){let e=this.readInt32(),t=[];for(let a=0;a<e;a++)t.push(this.readInt32());return t}readFloatArray(){let e=this.readInt32(),t=[];for(let a=0;a<e;a++){let r=this.readFloat32();t.push(r)}return t}readIntArray(){let e=this.readInt32(),t=[];for(let a=0;a<e;a++){let r=this.readInt32();t.push(r)}return t}readVector2int(){let e=new de;return e.x=this.readInt32(),e.y=this.readInt32(),e}readVector2(){let e=new de;return e.x=this.readFloat32(),e.y=this.readFloat32(),e}readVector3(){let e=new b;return e.x=this.readFloat32(),e.y=this.readFloat32(),e.z=this.readFloat32(),e}readVector3Array(){let e=[],t=this.readInt32();for(let a=0;a<t;a++)e.push(this.readVector3());return e}readVector4(){let e=new he;return e.x=this.readFloat32(),e.y=this.readFloat32(),e.z=this.readFloat32(),e.w=this.readFloat32(),e}readVector4Array(){let e=[],t=this.readInt32();for(let a=0;a<t;a++)e.push(this.readVector4());return e}readColor(){let e=new J;return e.r=this.readFloat32(),e.g=this.readFloat32(),e.b=this.readFloat32(),e.a=this.readFloat32(),e}readColorArray(){let e=[],t=this.readInt32();for(let a=0;a<t;a++)e.push(this.readColor());return e}readQuaternion(){let e=new ae;return e.x=this.readFloat32(),e.y=this.readFloat32(),e.z=this.readFloat32(),e.w=this.readFloat32(),e}readQuaternionArray(){let e=[],t=this.readInt32();for(let a=0;a<t;a++)e.push(this.readQuaternion());return e}readMatrix44(){let e=new R,t=e.rawData;return t[0]=this.readFloat32(),t[1]=this.readFloat32(),t[2]=this.readFloat32(),t[3]=this.readFloat32(),t[4]=this.readFloat32(),t[5]=this.readFloat32(),t[6]=this.readFloat32(),t[7]=this.readFloat32(),t[8]=this.readFloat32(),t[9]=this.readFloat32(),t[10]=this.readFloat32(),t[11]=this.readFloat32(),t[12]=this.readFloat32(),t[13]=this.readFloat32(),t[14]=this.readFloat32(),t[15]=this.readFloat32(),e}readMatrix44Array(){let e=this.readInt32(),t=[];for(let a=0;a<e;a++){let r=this.readMatrix44();t.push(r)}return t}readFloat32Array(e){let t=new DataView(this.buffer),a=new Float32Array(e);for(let r=0;r<e;r++)a[r]=t.getFloat32(this.position+r*Float32Array.BYTES_PER_ELEMENT,this.littleEndian);return this.position+=e*Float32Array.BYTES_PER_ELEMENT,a}getFloat32Array(){let e=new Float32Array(this.buffer,this.byteOffset,this.byteLength/Float32Array.BYTES_PER_ELEMENT);return e=e.slice(0,this.byteLength),e}}class Eh extends it{static format=He.TEXT;static async parserTexture(e,t,a){let r=e.readInt32(),i=[];for(let o=0;o<r;o++){let l=e.readUTF();wh.useWebp?(l=l.replace("png","webp"),l=l.replace("jpb","webp"),i.push(t.baseUrl+"webp/"+l)):i.push(t.baseUrl+l)}let n=await _.res.loadBitmapTextures(i,_.setting.loader.numConcurrent,a,!0);for(const o of n)_.res.addTexture(o.name,o)}verification(){if(this.data)return!0;throw new Error("verify failed.")}}var dm=Object.getOwnPropertyDescriptor,hm=(s,e,t,a)=>{for(var r=a>1?void 0:a?dm(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.LitSSSShader=class extends gt{constructor(){super(),Y.register("PBRLitSSSShader",md);let e=new Xe("PBRLitSSSShader","PBRLitSSSShader");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);let t=e.shaderState;t.acceptShadow=!0,t.castShadow=!0,t.receiveEnv=!0,t.acceptGI=!0,t.useLight=!0,this.setDefine("USE_BRDF",!0),this.setDefine("USE_AO_R",!0),this.setDefine("USE_ROUGHNESS_G",!0),this.setDefine("USE_METALLIC_B",!0),this.setDefine("USE_ALPHA_A",!0),this.setDefine("USE_CUSTOMUNIFORM",!0),this.setDefault(),this.computes=[new lh(this)]}setDefault(){this.setUniformFloat("shadowBias",35e-5),this.setUniformVector4("transformUV1",new he(0,0,1,1)),this.setUniformVector4("transformUV2",new he(0,0,1,1)),this.setUniformColor("baseColor",new J),this.setUniformColor("emissiveColor",new J(1,1,1)),this.setUniformVector4("materialF0",new he(.04,.04,.04,1)),this.setUniformColor("specularColor",new J(.04,.04,.04)),this.setUniformFloat("envIntensity",1),this.setUniformFloat("normalScale",1),this.setUniformFloat("roughness",1),this.setUniformFloat("metallic",0),this.setUniformFloat("ao",1),this.setUniformFloat("roughness_min",0),this.setUniformFloat("roughness_max",1),this.setUniformFloat("metallic_min",0),this.setUniformFloat("metallic_max",1),this.setUniformFloat("emissiveIntensity",0),this.setUniformFloat("alphaCutoff",0),this.setUniformFloat("ior",1.5),this.setUniformFloat("clearcoatFactor",0),this.setUniformFloat("clearcoatRoughnessFactor",0),this.setUniformColor("clearcoatColor",new J(1,1,1)),this.setUniformFloat("clearcoatWeight",0),this.setUniformColor("skinColor",new J(1,0,0)),this.setUniformFloat("skinPower",3.4),this.setUniformFloat("skinColorIns",.5),this.setUniformFloat("curveFactor",1)}set _MainTex(e){this.setTexture("baseMap",e)}set _BumpMap(e){this.setTexture("normalMap",e)}set _SSSMap(e){this.setTexture("sssMap",e)}set _MaskTex(e){this.setTexture("maskMap",e)}set _UVTransform(e){this.setUniformVector4("transformUV1",e)}set _Metallic(e){this.setUniformFloat("metallic",e)}set _Roughness(e){this.setUniformFloat("roughness",e)}set _MainColor(e){this.setUniformColor("baseColor",e)}set _AlphaCutoff(e){this.setUniformFloat("alphaCutoff",e)}set _DoubleSidedEnable(e){let t=this.getDefaultColorShader();t.shaderState.cullMode=e?Nt.none:t.shaderState.cullMode}set _SkinColor(e){this.setUniformColor("skinColor",e)}set _SkinPower(e){this.setUniformFloat("skinPower",e)}set _SkinColorIns(e){this.setUniformFloat("skinColorIns",e)}set curveFactor(e){this.setUniformFloat("curveFactor",e)}set _SurfaceType(e){let t=this.getDefaultColorShader();e==0?t.blendMode=me.NONE:t.blendMode=me.ALPHA}set _AlphaCutoffEnable(e){e==0?this.setDefine("USE_ALPHACUT",!1):this.setDefine("USE_ALPHACUT",!0)}},d.LitSSSShader=hm([Ra(d.LitSSSShader,"LitSSSShader")],d.LitSSSShader);var um=Object.getOwnPropertyDescriptor,bm=(s,e,t,a)=>{for(var r=a>1?void 0:a?um(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.LitShader=class extends gt{constructor(){super();let e=new Xe("PBRLItShader","PBRLItShader");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);let t=e.shaderState;t.acceptShadow=!0,t.castShadow=!0,t.receiveEnv=!0,t.acceptGI=!0,t.useLight=!0,this.setDefine("USE_BRDF",!0),this.setDefine("USE_ROUGHNESS_G",!0),this.setDefine("USE_METALLIC_B",!0),this.setDefine("USE_ALPHA_A",!0),this.setDefault()}setDefault(){this.setUniformFloat("shadowBias",35e-5),this.setUniformVector4("transformUV1",new he(0,0,1,1)),this.setUniformVector4("transformUV2",new he(0,0,1,1)),this.setUniformColor("baseColor",new J),this.setUniformColor("emissiveColor",new J(0,0,0)),this.setUniformVector4("materialF0",new he(.04,.04,.04,1)),this.setUniformColor("specularColor",new J(.04,.04,.04)),this.setUniformFloat("envIntensity",1),this.setUniformFloat("normalScale",1),this.setUniformFloat("roughness",1),this.setUniformFloat("metallic",0),this.setUniformFloat("ao",1),this.setUniformFloat("roughness_min",0),this.setUniformFloat("roughness_max",1),this.setUniformFloat("metallic_min",0),this.setUniformFloat("metallic_max",1),this.setUniformFloat("emissiveIntensity",0),this.setUniformFloat("alphaCutoff",0),this.setUniformFloat("ior",1.5),this.setUniformFloat("clearcoatFactor",0),this.setUniformFloat("clearcoatRoughnessFactor",0),this.setUniformColor("clearcoatColor",new J(1,1,1)),this.setUniformFloat("clearcoatWeight",0),this._MainTex=_.res.grayTexture,this._BumpMap=_.res.normalTexture,this._MaskTex=_.res.maskTexture}set _MainTex(e){this.setTexture("baseMap",e)}set _BumpMap(e){this.setTexture("normalMap",e)}set _MaskTex(e){this.setTexture("maskMap",e)}set _UVTransform(e){this.setUniformVector4("transformUV1",e)}set _Metallic(e){this.setUniformFloat("metallic",e)}set _Roughness(e){this.setUniformFloat("roughness",e)}set _MainColor(e){this.setUniformColor("baseColor",e)}set _AlphaCutoff(e){this.setUniformFloat("alphaCutoff",e)}set _DoubleSidedEnable(e){let t=this.getDefaultColorShader();t.shaderState.cullMode=e?Nt.none:t.shaderState.cullMode}set _SurfaceType(e){let t=this.getDefaultColorShader();e==0?t.blendMode=me.NONE:t.blendMode=me.ALPHA}set _AlphaCutoffEnable(e){e==0?this.setDefine("USE_ALPHACUT",!1):this.setDefine("USE_ALPHACUT",!0)}},d.LitShader=bm([Ra(d.LitShader,"LitShader")],d.LitShader);class Vn{comName;data;static parser(e){let t=e.readBytesArray(),a=new Vn;a.comName=t.readUTF(),a.data=[];let r=t.readInt32();for(let i=0;i<r;i++){let n=new Fo;n.formBytes(t),a.data.push(n)}return a}}class Hi{name;parentName;position;rotation;scale;comDatas;child;static parser(e){let t=e.readBytesArray(),a=new Hi;a.name=t.readUTF(),a.parentName=t.readUTF(),a.position=t.readVector3(),a.rotation=t.readQuaternion(),a.scale=t.readVector3(),a.comDatas=[],a.child=[];let r=t.readInt32();for(let n=0;n<r;n++){const o=Vn.parser(t);a.comDatas.push(o)}let i=t.readInt32();for(let n=0;n<i;n++){const o=Hi.parser(t);a.child.push(o)}return a}}class wh extends it{static useWebp=!0;static format=He.BIN;avatarDic;nodeData;async parseBuffer(e){this.avatarDic={};let t=new Pn(e,0);await Eh.parserTexture(t,this,this.loaderFunctions),Ch.parser(t,this),kh.parserMeshs(t,this),xh.parserMaterial(t,this),this.nodeData=this.parserPrefabNode(t),this.data=this.data=this.parserNodeTree(this.nodeData)}parserPrefabNode(e){return Hi.parser(e)}parserNodeTree(e){let t=new d.Object3D;if(t.localPosition=b.serialize(e.position),t.localQuaternion=ae.serialize(e.rotation),t.localScale=b.serialize(e.scale),t.name=e.name,e.comDatas)for(let a=0;a<e.comDatas.length;a++){const r=e.comDatas[a];let i=null,n=Ko(r.comName);if(n){i=t.getOrAddComponent(n);for(let o=0;o<r.data.length;o++){const l=r.data[o];l.key in i&&(i[l.key]=l.getValue())}}}if(e.child&&e.child.length>0)for(let a=0;a<e.child.length;a++){let r=this.parserNodeTree(e.child[a]);t.addChild(r)}return t}verification(){if(this.data)return!0;throw new Error("verify failed.")}}class gm{static getNumber(e){return parseFloat(e)}static getInt(e){return parseInt(e)}static getBoolean(e){return e=="true"}static getNumberArray(e){let t=e.replaceAll("[","");t=t.replaceAll("]","");let a=t.split(",");for(let r=0;r<a.length;r++)parseFloat(a[r]);return t}static getStringArray(e){let t=e.replaceAll("[","");t=t.replaceAll("]","");let a=t.split(","),r=[];for(let i=0;i<a.length;i++){const n=a[i];r.push(n)}return r}static getVector2(e){}static getVector3(e){}static getVector4(e){}static getQuaternion(e){}static getColor(e){}}var mm=Object.getOwnPropertyDescriptor,pm=(s,e,t,a)=>{for(var r=a>1?void 0:a?mm(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.UnLitShader=class extends gt{constructor(){super();let e=new Xe("UnLit","UnLit");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);let t=e.shaderState;t.acceptShadow=!1,t.castShadow=!1,t.receiveEnv=!1,t.acceptGI=!1,t.useLight=!1,this.setDefine("USE_BRDF",!0),this.setDefine("USE_AO_R",!0),this.setDefine("USE_ROUGHNESS_G",!0),this.setDefine("USE_METALLIC_B",!0),this.setDefine("USE_ALPHA_A",!0),this.setDefault()}setDefault(){this.setUniformVector4("transformUV1",new he(0,0,1,1)),this.setUniformVector4("transformUV2",new he(0,0,1,1)),this.setUniformColor("baseColor",new J),this.setUniformFloat("alphaCutoff",0)}set _MainTex(e){this.setTexture("baseMap",e)}set _BumpMap(e){this.setTexture("normalMap",e)}set _MaskTex(e){this.setTexture("maskMap",e)}set _UVTransform(e){this.setUniformVector4("transformUV1",e)}set _Metallic(e){this.setUniformFloat("metallic",e)}set _Roughness(e){this.setUniformFloat("roughness",e)}set _MainColor(e){this.setUniformColor("baseColor",e)}set _AlphaCutoff(e){this.setUniformFloat("alphaCutoff",e)}set _DoubleSidedEnable(e){let t=this.getDefaultColorShader();t.shaderState.cullMode=e?Nt.none:t.shaderState.cullMode}set _SurfaceType(e){let t=this.getDefaultColorShader();e==0?t.blendMode=me.NONE:t.blendMode=me.ALPHA}set _AlphaCutoffEnable(e){e==0?this.setDefine("USE_ALPHACUT",!1):this.setDefine("USE_ALPHACUT",!0)}},d.UnLitShader=pm([Ra(d.UnLitShader,"UnLitShader")],d.UnLitShader);var Am=Object.getOwnPropertyDescriptor,Dm=(s,e,t,a)=>{for(var r=a>1?void 0:a?Am(e,t):e,i=s.length-1,n;i>=0;i--)(n=s[i])&&(r=n(r)||r);return r};d.UnLitTexArrayShader=class extends gt{constructor(){super(),Y.register("VertexAttributeIndexShader",ud),Y.register("UnLitTextureArray",pd);let e=new Xe("UnLitTextureArray","UnLitTextureArray");e.setShaderEntry("VertMain","FragMain"),this.addRenderPass(e);let t=e.shaderState;t.acceptShadow=!1,t.castShadow=!1,t.receiveEnv=!1,t.acceptGI=!1,t.useLight=!1,this.setDefine("USE_BRDF",!0),this.setDefine("USE_AO_R",!0),this.setDefine("USE_ROUGHNESS_G",!0),this.setDefine("USE_METALLIC_B",!0),this.setDefine("USE_ALPHA_A",!0),this.setDefault()}setDefault(){this.setUniformVector4("transformUV1",new he(0,0,1,1)),this.setUniformVector4("transformUV2",new he(0,0,1,1)),this.setUniformColor("baseColor",new J),this.setUniformFloat("alphaCutoff",0)}set _MainTex(e){this.setTexture("baseMap",e)}set _BumpMap(e){this.setTexture("normalMap",e)}set _MaskTex(e){this.setTexture("maskMap",e)}set _UVTransform(e){this.setUniformVector4("transformUV1",e)}set _Metallic(e){this.setUniformFloat("metallic",e)}set _Roughness(e){this.setUniformFloat("roughness",e)}set _MainColor(e){this.setUniformColor("baseColor",e)}set _AlphaCutoff(e){this.setUniformFloat("alphaCutoff",e)}set _DoubleSidedEnable(e){let t=this.getDefaultColorShader();t.shaderState.cullMode=e?Nt.none:t.shaderState.cullMode}set _SurfaceType(e){let t=this.getDefaultColorShader();e==0?t.blendMode=me.NONE:t.blendMode=me.ALPHA}set _AlphaCutoffEnable(e){e==0?this.setDefine("USE_ALPHACUT",!1):this.setDefine("USE_ALPHACUT",!0)}},d.UnLitTexArrayShader=Dm([Ra(d.UnLitTexArrayShader,"UnLitTexArrayShader")],d.UnLitTexArrayShader);const Br=-1,vr=0,wo=1,Rh=2,Va=3,_m=6378137,Bm=1/298.257223563,vm=6356752314245179e-9,Um=Symbol("PLUGIN_REGISTERED");class Ro{boundingVolume;geometricError;refine;content;contents;transform;extensions;extras;parent=null;children=[];loadingState=vr;used=!1;visible=!1;active=!1;inFrustum=!1;error=1/0;distanceFromCamera=1/0;depth=0;depthFromRenderedParent=0;lastFrameVisited=-1;isLeaf=!1;allChildrenReady=!1;hasContent=!1;hasRenderableContent=!1;hasUnrenderableContent=!1;childrenProcessed=0;usedLastFrame=!1;priority;canTraverse=!1;canTraverseFrame=-1;basePath="";cached={};constructor(e,t=null){if(this.boundingVolume=e.boundingVolume,this.geometricError=e.geometricError,this.refine=e.refine,this.content=e.content,this.contents=e.contents,this.transform=e.transform,this.extensions=e.extensions,this.extras=e.extras,this.parent=t,this.depth=t?t.depth+1:0,this.depthFromRenderedParent=t?.hasContent?0:t?t.depthFromRenderedParent+1:0,this.hasContent=!!(this.content||this.contents&&this.contents.length>0),this.content?.uri){const a=this.content.uri.toLowerCase();this.hasUnrenderableContent=a.endsWith("tileset.json"),this.hasRenderableContent=!this.hasUnrenderableContent}else this.contents&&this.contents.length>0&&(this.hasRenderableContent=!0)}addChild(e){e.parent=this,e.depth=this.depth+1,e.depthFromRenderedParent=this.hasContent?0:this.depthFromRenderedParent+1,this.children.push(e)}resetFrameState(e){this.lastFrameVisited!==e&&(this.lastFrameVisited=e,this.used=!1,this.inFrustum=!1,this.isLeaf=!1,this.visible=!1,this.active=!1,this.error=1/0,this.distanceFromCamera=1/0,this.allChildrenReady=!1)}}const Ih=2**30;class Qh{minSize=6e3;maxSize=8e3;minBytesSize=.3*Ih;maxBytesSize=.4*Ih;unloadPercent=.05;autoMarkUnused=!0;_itemSet=new Map;_itemList=[];_usedSet=new Set;_callbacks=new Map;_unloadingHandle=-1;_cachedBytes=0;_bytesMap=new Map;_loadedSet=new Set;_unloadPriorityCallback=null;set unloadPriorityCallback(e){this._unloadPriorityCallback=e}get unloadPriorityCallback(){return this._unloadPriorityCallback}isFull(){return this._itemSet.size>=this.maxSize||this._cachedBytes>=this.maxBytesSize}getMemoryUsage(e){return this._bytesMap.get(e)||0}setMemoryUsage(e,t){if(!this._itemSet.has(e))return;const a=this._bytesMap.get(e)||0;this._cachedBytes-=a,this._bytesMap.set(e,t),this._cachedBytes+=t}add(e,t){return this._itemSet.has(e)||this.isFull()?!1:(this._itemList.push(e),this._usedSet.add(e),this._itemSet.set(e,Date.now()),this._callbacks.set(e,t),this._loadedSet.add(e),!0)}has(e){return this._itemSet.has(e)}remove(e){if(!this._itemSet.has(e))return!1;const t=this._bytesMap.get(e)||0;this._cachedBytes-=t,this._bytesMap.delete(e);const a=this._callbacks.get(e);a&&a(e);const r=this._itemList.indexOf(e);return r!==-1&&this._itemList.splice(r,1),this._usedSet.delete(e),this._itemSet.delete(e),this._callbacks.delete(e),this._loadedSet.delete(e),!0}markUsed(e){this._itemSet.has(e)&&(this._usedSet.add(e),this._itemSet.set(e,Date.now()))}markUnused(e){this._usedSet.delete(e)}scheduleUnload(){this._unloadingHandle===-1&&(this._unloadingHandle=requestAnimationFrame(()=>{this._unloadingHandle=-1,this._performUnload()}))}_performUnload(){if(!(this._itemSet.size>this.minSize||this._cachedBytes>this.minBytesSize))return;this.autoMarkUnused&&this._itemSet.forEach((o,l)=>{this._usedSet.has(l)||this.markUnused(l)});const t=[];this._itemList.forEach(o=>{this._usedSet.has(o)||t.push(o)}),this._unloadPriorityCallback&&t.sort(this._unloadPriorityCallback);const a=Math.floor(this._itemSet.size*(1-this.unloadPercent)),r=this._cachedBytes-(this._cachedBytes-this.minBytesSize);let i=0,n=0;for(let o=0;o<t.length;o++){const l=t[o];if(this._itemSet.size-i<=a&&this._cachedBytes-n<=r)break;const c=this._bytesMap.get(l)||0;this.remove(l)&&(i++,n+=c)}}clear(){Array.from(this._itemSet.keys()).forEach(t=>this.remove(t))}getStats(){return{size:this._itemSet.size,bytes:this._cachedBytes,usedCount:this._usedSet.size}}}class Io{maxJobs=6;priorityCallback=null;_items=[];_callbacks=new Map;_currJobs=0;get running(){return this._items.length!==0||this._currJobs!==0}sort(){this.priorityCallback&&this._items.sort(this.priorityCallback)}has(e){return this._callbacks.has(e)}add(e,t){if(this._callbacks.has(e))return this._callbacks.get(e).promise;let a,r;const i=new Promise((o,l)=>{a=o,r=l}),n={callback:t,promise:i,resolve:a,reject:r};return this._items.unshift(e),this._callbacks.set(e,n),i}remove(e){const t=this._items.indexOf(e);if(t!==-1){const a=this._callbacks.get(e);a&&(a.promise.catch(()=>{}),a.reject(new Error("PriorityQueue: Item removed."))),this._items.splice(t,1),this._callbacks.delete(e)}}removeByFilter(e){const t=[];this._items.forEach(a=>{e(a)&&t.push(a)}),t.forEach(a=>this.remove(a))}update(){this._tryRunJobs()}_tryRunJobs(){this.sort();const e=this.maxJobs;let t=0;const a=()=>{this._currJobs--};for(;e>this._currJobs&&this._items.length>0&&t<e;){this._currJobs++,t++;const r=this._items.shift(),i=this._callbacks.get(r);this._callbacks.delete(r),Promise.resolve(i.callback(r)).then(()=>{i.resolve(),a()}).catch(n=>{i.reject(n),a()})}}clear(){Array.from(this._items).forEach(t=>this.remove(t))}getStats(){return{queued:this._items.length,running:this._currJobs}}}function Th(s,e=null,t=null){const a=[];for(a.push(s),a.push(null),a.push(0);a.length>0;){const r=a.pop(),i=a.pop(),n=a.pop();if(e&&e(n,i,r)===!0){t&&t(n,i,r);return}const o=n.children;if(o&&o.length>0)for(let l=o.length-1;l>=0;l--)a.push(o[l]),a.push(n),a.push(r+1);if(t&&t(n,i,r)===!0)return}}function ym(s,e){let t=s;for(;t;){const a=t.depth,r=t.parent;e(t,r,a),t=r}}const On={inView:!1,error:1/0,distanceFromCamera:1/0},Mh=!0;function Nh(s){return s===Va||s===Br}function Ur(s,e){return s.lastFrameVisited===e&&s.used}function Ph(s){return s.childrenProcessed===s.children.length}function Qo(s){return s.hasUnrenderableContent||s.parent!==null&&s.parent.geometricError<s.geometricError}function To(s,e){s.lastFrameVisited!==e.frameCount&&(s.usedLastFrame=s.used,s.lastFrameVisited=e.frameCount,s.used=!1,s.inFrustum=!1,s.isLeaf=!1,s.visible=!1,s.active=!1,s.error=1/0,s.distanceFromCamera=1/0,s.allChildrenReady=!1,e.calculateTileViewError(s,On),s.inFrustum=On.inView,s.error=On.error,s.distanceFromCamera=On.distanceFromCamera)}function Mo(s,e,t=!1){s.used||(t||(s.used=!0,e.stats.used++),e.markTileUsed(s),s.inFrustum===!0&&e.stats.inFrustum++)}function Cm(s,e){if(s.canTraverse&&s.canTraverseFrame===e.frameCount)return s.canTraverse;let t=!1;return s.error<=e.errorTarget&&!Qo(s)||s.depth>=e.maxDepth||!s.children||s.children.length===0?t=!1:t=!0,s.canTraverse=t,s.canTraverseFrame=e.frameCount,t}function No(s,e,t=!1){if(e.ensureChildrenArePreprocessed(s),To(s,e),Mo(s,e,t),Qo(s)&&Ph(s)){const a=s.children;for(let r=0,i=a.length;r<i;r++)No(a[r],e,t)}}function Ln(s,e){if(e.ensureChildrenArePreprocessed(s),To(s,e),!s.inFrustum)return;if(!Cm(s,e)){Mo(s,e);const n=s.children;if(!s.hasContent&&n&&n.length>0)for(let o=0,l=n.length;o<l;o++){const c=n[o];Ln(c,e)}return}const a=s.children;let r=!1,i=!1;for(let n=0,o=a.length;n<o;n++){const l=a[n];Ln(l,e),r=r||Ur(l,e.frameCount),i=i||l.inFrustum}if(s.refine==="REPLACE"&&!i&&a.length!==0){s.inFrustum=!1;for(let n=0,o=a.length;n<o;n++)No(a[n],e,!0);return}if(Mo(s,e),s.refine==="REPLACE"&&(r&&s.depth!==0||Mh))for(let n=0,o=a.length;n<o;n++)No(a[n],e)}function Po(s,e){const t=e.frameCount;if(!Ur(s,t))return;const a=s.children;let r=!1;for(let i=0,n=a.length;i<n;i++){const o=a[i];r=r||Ur(o,t)}if(!r)s.isLeaf=!0;else{let i=!0;for(let n=0,o=a.length;n<o;n++){const l=a[n];if(Po(l,e),Ur(l,t)){const c=!Qo(l);let f=!l.hasContent||l.hasRenderableContent&&Nh(l.loadingState)||l.hasUnrenderableContent&&l.loadingState===Br;f=c&&f||l.allChildrenReady,i=i&&f}}s.allChildrenReady=i}}function Vh(s,e){if(e.ensureChildrenArePreprocessed(s),Ur(s,e.frameCount)&&(s.hasContent&&e.queueTileForDownload(s),Ph(s))){const t=s.children;for(let a=0,r=t.length;a<r;a++)Vh(t[a],e)}}function Vo(s,e){const t=e.stats;if(!Ur(s,e.frameCount))return;if(s.isLeaf){s.loadingState===Va?(s.inFrustum&&(s.visible=!0,t.visible++),s.active=!0,t.active++):s.hasContent&&e.queueTileForDownload(s);return}const a=s.children,r=s.hasContent,i=Nh(s.loadingState)&&r,n=(e.errorTarget+1)*(e.errorThreshold||1),o=s.error<=n,l=s.refine==="ADD",c=s.allChildrenReady||s.depth===0&&!Mh;if(r&&(o||l)&&e.queueTileForDownload(s),(o&&i&&!c||i&&l)&&(s.inFrustum&&(s.visible=!0,t.visible++),s.active=!0,t.active++),!l&&o&&!c)for(let f=0,h=a.length;f<h;f++){const u=a[f];Ur(u,e.frameCount)&&Vh(u,e)}else for(let f=0,h=a.length;f<h;f++)Vo(a[f],e)}function Oo(s,e){const t=Ur(s,e.frameCount);if(t||s.usedLastFrame){let a=!1,r=!1;if(t?(a=s.active,r=s.visible):To(s,e),s.hasRenderableContent&&s.loadingState===Va){const n=s.__wasSetVisible;s.__wasSetActive!==a&&(e.setTileActive(s,a),s.__wasSetActive=a),n!==r&&(e.setTileVisible(s,r),s.__wasSetVisible=r)}s.usedLastFrame=t;const i=s.children;for(let n=0,o=i.length;n<o;n++)Oo(i[n],e)}}class Vr{static s_tmpMatrix=null;_type;_data;_box;get box(){return this._box}_sphere;_matrix;constructor(e){if(Vr.s_tmpMatrix||(Vr.s_tmpMatrix=new R),this._data=e,e.box)this._type="box",this._parseBox(e.box);else if(e.sphere)this._type="sphere",this._parseSphere(e.sphere);else if(e.region)this._type="region",this._parseRegion(e.region);else throw new Error("BoundingVolume: Invalid bounding volume data")}_parseBox(e){if(e.length!==12)throw new Error("BoundingVolume: Box must have 12 elements");const t=new b(e[0],e[1],e[2]),a=new b(e[3],e[4],e[5]),r=new b(e[6],e[7],e[8]),i=new b(e[9],e[10],e[11]),n=a.length,o=r.length,l=i.length,c=a.clone().normalize(),f=r.clone().normalize(),h=i.clone().normalize();this._matrix=new R;const u=this._matrix.rawData;u[0]=c.x,u[1]=c.y,u[2]=c.z,u[3]=0,u[4]=f.x,u[5]=f.y,u[6]=f.z,u[7]=0,u[8]=h.x,u[9]=h.y,u[10]=h.z,u[11]=0,u[12]=t.x,u[13]=t.y,u[14]=t.z,u[15]=1;const g=new b(n*2,o*2,l*2);this._box=new xe(new b(0,0,0),g)}_parseSphere(e){if(e.length!==4)throw new Error("BoundingVolume: Sphere must have 4 elements");const t=new b(e[0],e[1],e[2]),a=e[3];this._sphere=new Qr(t,a)}_parseRegion(e){if(e.length!==6)throw new Error("BoundingVolume: Region must have 6 elements");const[t,a,r,i,n,o]=e,l=new b((t+r)/2,(a+i)/2,(n+o)/2),c=new b(Math.abs(r-t),Math.abs(i-a),Math.abs(o-n));this._box=new xe(l,c),this._matrix=new R,this._matrix.identity()}getAABB(e,t){if(this._type==="sphere"&&this._sphere){const a=this._sphere.center,r=this._sphere.radius,i=new b(a.x-r,a.y-r,a.z-r),n=new b(a.x+r,a.y+r,a.z+r);if(e.setFromMinMax(i,n),t){const o=[new b(i.x,i.y,i.z),new b(n.x,i.y,i.z),new b(i.x,n.y,i.z),new b(n.x,n.y,i.z),new b(i.x,i.y,n.z),new b(n.x,i.y,n.z),new b(i.x,n.y,n.z),new b(n.x,n.y,n.z)];o.forEach(l=>{const c=new b;t.transformPoint(l,c),l.copyFrom(c)}),e.makeEmpty(),o.forEach(l=>{e.expandByPoint(l)})}return e}else if(this._box){const a=Vr.s_tmpMatrix;if(a.identity(),this._matrix?t?a.multiplyMatrices(t,this._matrix):a.copyFrom(this._matrix):t&&a.copyFrom(t),a){const r=this._box,i=[new b(r.min.x,r.min.y,r.min.z),new b(r.max.x,r.min.y,r.min.z),new b(r.min.x,r.max.y,r.min.z),new b(r.max.x,r.max.y,r.min.z),new b(r.min.x,r.min.y,r.max.z),new b(r.max.x,r.min.y,r.max.z),new b(r.min.x,r.max.y,r.max.z),new b(r.max.x,r.max.y,r.max.z)];i.forEach(n=>{const o=new b;a.transformPoint(n,o),n.copyFrom(o)}),e.makeEmpty(),i.forEach(n=>{e.expandByPoint(n)})}else e.setFromMinMax(this._box.min,this._box.max);return e}throw new Error("BoundingVolume: Invalid state")}getOBB(e,t){this._type==="box"&&this._box&&this._matrix?(e.setFromMinMax(this._box.min,this._box.max),t.copyFrom(this._matrix)):(this.getAABB(e),t.identity())}getSphere(e){if(this._type==="sphere"&&this._sphere)return e.center.copyFrom(this._sphere.center),e.radius=this._sphere.radius,e;const t=new xe;this.getAABB(t);const a=t.center,i=t.size.length*.5;return e.center.copyFrom(a),e.radius=i,e}get type(){return this._type}distanceToPoint(e,t){if(this._type==="sphere"&&this._sphere){const a=this._sphere.center;let r=a;if(t){const o=new b;t.transformPoint(a,o),r=o}const i=this._sphere.radius,n=e.clone().subtract(r).length;return Math.max(0,n-i)}else if(this._box){const a=new xe;this.getAABB(a,t);const r=a.center,i=a.size,n=Math.max(0,Math.abs(e.x-r.x)-i.x*.5),o=Math.max(0,Math.abs(e.y-r.y)-i.y*.5),l=Math.max(0,Math.abs(e.z-r.z)-i.z*.5);return Math.sqrt(n*n+o*o+l*l)}return 1/0}intersectsFrustum(e,t){if(this._type==="sphere"&&this._sphere){const a=new xe;return this.getAABB(a,t),e.containsBox2(a)>0}else if(this._box){const a=new xe;return this.getAABB(a,t),e.containsBox2(a)>0}return!1}}const Oh=(s,e)=>{const t=s.priority||0,a=e.priority||0;return t!==a?t>a?1:-1:s.used!==e.used?s.used?1:-1:s.error!==e.error?s.error>e.error?1:-1:s.distanceFromCamera!==e.distanceFromCamera?s.distanceFromCamera>e.distanceFromCamera?-1:1:s.depthFromRenderedParent!==e.depthFromRenderedParent?s.depthFromRenderedParent>e.depthFromRenderedParent?-1:1:0},Lh=(s,e)=>{const t=s.priority||0,a=e.priority||0;return t!==a?t>a?1:-1:s.lastFrameVisited!==e.lastFrameVisited?s.lastFrameVisited>e.lastFrameVisited?-1:1:s.depthFromRenderedParent!==e.depthFromRenderedParent?s.depthFromRenderedParent>e.depthFromRenderedParent?1:-1:s.loadingState!==e.loadingState?s.loadingState>e.loadingState?-1:1:s.hasUnrenderableContent!==e.hasUnrenderableContent?s.hasUnrenderableContent?-1:1:s.error!==e.error?s.error>e.error?-1:1:0};class Sm{rootLoadingState=vr;rootTileSet=null;rootURL=null;fetchOptions={};frameCount=0;isLoading=!1;lruCache;loadQueue;processNodeQueue;plugins=[];_queuedTiles=[];_cachedSinceLoadComplete=new Set;_processedTiles=new WeakSet;_visibleTiles=new Set;_usedSet=new Set;_cacheHits=0;_cacheMisses=0;stats={parsing:0,downloading:0,failed:0,inFrustum:0,used:0,active:0,visible:0,inCacheSinceLoad:0};errorTarget=16;errorThreshold=1;maxDepth=30;displayActiveTiles=!1;onRootTileLoaded;rtcOffset=null;_root=null;_activeTiles=new Set;_delayedHideTiles=new Set;group;cameras=[];_cameraMap=new Map;_cameraInfo=[];_upRotationMatrix=new R;_ellipsoid;_bytesUsed=new WeakMap;_eventListeners=new Map;performanceStats={updateTime:0,traverseTime:0,markUsedTime:0,markVisibleTime:0,toggleTime:0,queueProcessTime:0};constructor(e=null){this.rootURL=e,this.lruCache=new Qh,this.lruCache.unloadPriorityCallback=Lh,this.loadQueue=new Io,this.loadQueue.maxJobs=10,this.loadQueue.priorityCallback=Oh,this.processNodeQueue=new Io,this.processNodeQueue.maxJobs=25,this.group=new d.Object3D,this.group.name="TilesRendererGroup"}get root(){return this._root}get loadProgress(){const{stats:e,isLoading:t}=this,a=e.downloading,r=e.inCacheSinceLoad+(t?1:0);return r===0?1:1-a/r}update(){const{lruCache:e,_usedSet:t,stats:a,loadQueue:r,processNodeQueue:i}=this;this.rootLoadingState===vr&&(this.rootLoadingState=wo,this.isLoading=!0,this._loadRootTileSet().then(c=>{if(this.rootLoadingState=Va,this.rootTileSet=c,c.root){const f=this._getBasePath(this.rootURL||""),h=this.preprocessNode(c.root,f,null);this.queueTileForDownload(h),this._root=h;const u=new Vr(h.boundingVolume),g=new Qr;u.getSphere(g);const A=new xe;if(u.getAABB(A),this.rtcOffset=new b(-g.center.x,-g.center.y,-g.center.z),this.onRootTileLoaded)try{this.onRootTileLoaded({center:g.center,radius:g.radius,boundingBox:A,rtcOffset:this.rtcOffset})}catch(m){console.warn("Failed to calculate bounding volume for root tile:",m)}}this.dispatchEvent({type:"load-tile-set",tileSet:c,url:this.rootURL})}).catch(c=>{this.rootLoadingState=Br,console.error("Failed to load root tileset:",c),this.dispatchEvent({type:"load-error",tile:null,error:c,url:this.rootURL})}));const n=this.root;if(!n)return;a.inFrustum=0,a.used=0,a.active=0,a.visible=0,this.frameCount++,t.forEach(c=>e.markUnused(c)),t.clear(),this.updateCameraInfo(),this._checkDelayedHideTiles(),Ln(n,this),Po(n,this),Vo(n,this),Oo(n,this);const o=this._queuedTiles;e.unloadPriorityCallback&&o.sort(e.unloadPriorityCallback);for(let c=0,f=o.length;c<f&&!e.isFull();c++)this.requestTileContents(o[c]);o.length=0,r.update(),i.update(),e.scheduleUnload(),(r.running||i.running)===!1&&this.isLoading===!0&&(this._cachedSinceLoadComplete.clear(),a.inCacheSinceLoad=0,this.dispatchEvent({type:"tiles-load-end"}),this.isLoading=!1)}traverse(e,t,a=!0){this.root&&Th(this.root,(r,i,n)=>(a&&this.ensureChildrenArePreprocessed(r,!0),e?e(r,i,n):!1),t)}registerPlugin(e){if(this.plugins.includes(e))return;const t=e.priority||0;let a=this.plugins.length;for(let r=0;r<this.plugins.length;r++)if((this.plugins[r].priority||0)>t){a=r;break}this.plugins.splice(a,0,e),e.init&&e.init(this)}unregisterPlugin(e){const t=this.plugins;let a;if(typeof e=="string"?a=t.find(r=>r.name===e):a=e,a&&t.includes(a)){const r=t.indexOf(a);return t.splice(r,1),a.dispose&&a.dispose(),!0}return!1}getPluginByName(e){return this.plugins.find(t=>t.name===e)||null}calculateTileViewError(e,t){const a=e.cached,r=this.cameras,i=this._cameraInfo,n=a.boundingVolume;if(!n){t.inView=!1,t.error=1/0,t.distanceFromCamera=1/0;return}let o=!1,l=-1/0,c=1/0,f=-1/0,h=1/0;const u=a.worldTransform;for(let g=0,A=r.length;g<A;g++){const m=i[g];let p,D;if(m.isOrthographic){const v=m.pixelSize;p=e.geometricError/v,D=1/0}else{const v=m.sseDenominator;D=n.distanceToPoint(m.position,u),p=D===0?1/0:e.geometricError/(D*v)}const B=i[g].frustum;n.intersectsFrustum(B,u)&&(o=!0,l=Math.max(l,p),c=Math.min(c,D)),f=Math.max(f,p),h=Math.min(h,D)}o?(t.inView=!0,t.error=l,t.distanceFromCamera=c):(t.inView=!1,t.error=f,t.distanceFromCamera=h)}updateCameraInfo(){this._updateCameraInfo()}_updateCameraInfo(){const e=this.cameras,t=this._cameraInfo,a=this._cameraMap;for(;t.length<e.length;)t.push({position:new b,frustum:new ds,isOrthographic:!1});for(let r=0;r<e.length;r++){const i=e[r],n=t[r],o=a.get(i);if(!o)continue;const l=i.transform.worldPosition;if(n.position.copyFrom(l),n.frustum=i.frustum,n.isOrthographic=i.type===at.ortho,n.isOrthographic){const c=i.frustumSize;n.pixelSize=c/o.height}else{const f=i.fov*Math.PI/180;n.sseDenominator=2*Math.tan(f/2)/o.height}}}preprocessNode(e,t,a=null){if(this._processedTiles.has(e))return e;this._processedTiles.add(e);let r;if(e instanceof Ro?r=e:r=new Ro(e,a),r.content){const c=r.content;!("uri"in c)&&"url"in c&&(c.uri=c.url,delete c.url)}if(r.basePath=t,r.boundingVolume){const c=new Vr(r.boundingVolume);r.cached.boundingVolume=c}const i=new b(r.boundingVolume.box[0],r.boundingVolume.box[1],r.boundingVolume.box[2]),n=new R;if(r.transform){const c=r.transform;for(let f=0;f<16;f++)n.rawData[f]=c[f]}if(!a){n.copyFrom(this._upRotationMatrix);const c=new b;c.copyFrom(i),c.applyMatrix4(n);const f=r.cached.boundingVolume.box,h=[new b(f.min.x,f.min.y,f.min.z),new b(f.max.x,f.min.y,f.min.z),new b(f.min.x,f.max.y,f.min.z),new b(f.max.x,f.max.y,f.min.z),new b(f.min.x,f.min.y,f.max.z),new b(f.max.x,f.min.y,f.max.z),new b(f.min.x,f.max.y,f.max.z),new b(f.max.x,f.max.y,f.max.z)];for(const A of h)A.applyMatrix4(n);const u=new xe;h.forEach(A=>{u.expandByPoint(A)}),n.rawData[12]=-c.x,n.rawData[13]=-c.y,n.rawData[14]=-c.z;const g=u.min;n.rawData[13]-=g.y}const o=new R;o.copyFrom(n),a&&a.cached.worldTransform&&o.multiplyMatrices(a.cached.worldTransform,n);const l=new R;if(l.copyFrom(o),l.invert(),r.cached.transfrom=n,r.cached.worldTransform=o,r.cached.transformInverse=l,e.children&&e.children.length>0){r.children=[];for(let c=0;c<e.children.length;c++){const f=e.children[c],h=this.preprocessNode(f,t,r);r.children.push(h)}r.childrenProcessed=r.children.length}return r}ensureChildrenArePreprocessed(e,t=!1){const a=e.children;for(let r=0,i=a.length;r<i;r++){const n=a[r];n.basePath!==void 0&&n.basePath!==""||n.cached.boundingVolume||(t?(this.processNodeQueue.remove(n),this.preprocessNode(n,e.basePath,e)):this.processNodeQueue.has(n)||this.processNodeQueue.add(n,o=>{this.preprocessNode(o,e.basePath,e)}))}}_recordCacheHit(){this._cacheHits++}_recordCacheMiss(){this._cacheMisses++}resetCacheStats(){this._cacheHits=0,this._cacheMisses=0}requestTileContents(e){if(e.loadingState!==vr){this._recordCacheHit();return}if(this.lruCache.isFull()){this._recordCacheMiss();return}this._recordCacheMiss(),e.loadingState=wo,this.stats.downloading++;const t=e.content||e.contents&&e.contents[0];if(!t||!t.uri){e.loadingState=Br,this.stats.downloading--,this.stats.failed++;return}const a=e.basePath||"",r=t.uri,i=this._resolveURL(a,r);this.loadQueue.add(e,async n=>{try{await this.parseTileContent(n,r,i),this.stats.downloading--}catch(o){n.loadingState=Br,this.stats.downloading--,this.stats.failed++,console.error("Failed to load tile:",o)}})}async parseTileContent(e,t,a){e.loadingState=Rh;const i=(c=>{const f=c.split(".");return f.length>1?f[f.length-1]:""})(t),n=a;let o=null;const l=new It;switch(i.toLowerCase()){case"b3dm":{o=(await l.load(n,Hs,{onProgress:f=>{},onComplete:f=>{}})).data;break}case"i3dm":{o=(await l.load(n,$s,{onProgress:f=>{},onComplete:f=>{}})).data;break}case"glb":case"gltf":{o=(await l.load(n,_t,{onProgress:f=>{},onComplete:f=>{}})).data;break}case"pnts":{o=(await l.load(n,yh,{onProgress:f=>{},onComplete:f=>{}})).data;break}case"json":try{const c=await _.res.loadJSON(n);e.children.length=0,e.childrenProcessed=0;const f=this._getBasePath(n);if(c.root){const h=this.preprocessNode(c.root,f,e);e.children.push(h),e.childrenProcessed=1,this.dispatchEvent({type:"load-tile-set",tileSet:c,url:n})}e.loadingState=Va;return}catch(c){console.error("Failed to load external tileset:",c),e.loadingState=Br,this.stats.failed++;return}break;default:console.warn(`Unknown tile format: ${i}`);break}if(o){e.cached.scene=o,e.loadingState=Va;const c=this._estimateBytesUsed(o);this._bytesUsed.set(o,c),this.lruCache.setMemoryUsage(e,c),this.lruCache.has(e)||this.lruCache.add(e,f=>{if(f.cached.scene){const h=f.cached.scene;h.parent&&h.parent.object3D.removeChild(h),h.destroy(!0),f.cached.scene=null}f.loadingState=vr}),this.setTileActive(e,!0),e.active=!0,this.stats.active++}else e.loadingState=Br,this.stats.failed++}markTileUsed(e){this._usedSet.add(e),this.lruCache.markUsed(e)}setTileActive(e,t){t?(this._activeTiles.add(e),this._delayedHideTiles.has(e)&&this._delayedHideTiles.delete(e)):this._activeTiles.delete(e);const a=e.cached.scene;a&&(t?(this.group.entityChildren.includes(a)||(a.parent&&a.parent.object3D.removeChild(a),this.group.addChild(a)),e.cached.worldTransform&&this._applyWorldTransform(a.transform,e.cached.worldTransform),a.transform.enable=!0):this._delayedHideTiles.has(e)||this._delayedHideTiles.add(e))}_checkDelayedHideTiles(){if(this.stats.downloading===0)for(const e of this._delayedHideTiles){this._delayedHideTiles.delete(e);const t=e.cached.scene;t&&(t.transform.enable=!1)}}setTileVisible(e,t){t?(this._visibleTiles.add(e),this._delayedHideTiles.has(e)&&this._delayedHideTiles.delete(e)):this._visibleTiles.delete(e);const a=e.cached.scene;a&&(t?a.transform.enable=!0:this._delayedHideTiles.has(e)||this._delayedHideTiles.add(e))}queueTileForDownload(e){e.loadingState!==vr||this.lruCache.isFull()||this._queuedTiles.push(e)}dispatchEvent(e){const t=this._eventListeners.get(e.type);t&&t.forEach(a=>{try{a(e)}catch(r){console.error("Error in event listener:",r)}})}async _loadRootTileSet(){if(!this.rootURL)throw new Error("Root URL is not set");const e=await _.res.loadJSON(this.rootURL);return e.asset&&e.asset.gltfUpAxis&&this._setupUpAxisRotation(e.asset.gltfUpAxis),e}_setupUpAxisRotation(e){const t=new R;switch(e.toLowerCase()){case"x":t.makeRotationAxis(b.Y_AXIS,-Math.PI/2);break;case"y":t.identity();break;case"z":t.makeRotationAxis(b.X_AXIS,-Math.PI/2);break;default:console.warn(`Unknown gltfUpAxis: ${e}, using default`),t.identity();break}this._upRotationMatrix=t}_applyLocalTransform(e,t){const a=t.decompose(ia.EULER_ANGLES);e.localPosition=a[0];const r=new ae;r.fromEulerAngles(a[1].x,a[1].y,a[1].z),e.localRotQuat=r,e.localScale=a[2]}_applyWorldTransform(e,t){const a=t.decompose(ia.EULER_ANGLES);e.localPosition=a[0];const r=new ae;r.fromEulerAngles(a[1].x,a[1].y,a[1].z),e.localRotQuat=r,e.localScale=a[2]}_getBasePath(e){const t=e.lastIndexOf("/");return t!==-1?e.substring(0,t):""}_resolveURL(e,t){return t.startsWith("http://")||t.startsWith("https://")?t:e+"/"+t}_getUrlExtension(e){const t=e.split(".");return t.length>1?t[t.length-1]:""}getMemoryStats(){const e=this.lruCache.getStats(),t=this.lruCache.maxBytesSize,a=e.bytes,r=t-a,i=this._cacheHits+this._cacheMisses,n=i>0?this._cacheHits/i:0;return{totalTiles:e.size,loadedTiles:e.usedCount,cachedTiles:e.size,totalBytes:t,usedBytes:a,freeBytes:r,cacheHitRate:n}}getLoadedTiles(){const e=[];return this.traverse(t=>(t.loadingState===Va&&e.push(t),!1),null),e}getVisibleTiles(){return Array.from(this._visibleTiles)}getActiveTiles(){return Array.from(this._activeTiles)}getTileTreeStats(){let e=0,t=0,a=0,r=0,i=0,n=0;return this.traverse(o=>(e++,o.loadingState===Va&&t++,o.visible&&a++,o.active&&r++,i=Math.max(i,o.depth),n+=o.depth,!1),null),{totalTiles:e,loadedTiles:t,visibleTiles:a,activeTiles:r,maxDepth:i,averageDepth:e>0?n/e:0}}printDebugInfo(){const e=this.stats,t=this.getMemoryStats(),a=this.getTileTreeStats(),r=this.performanceStats,i=this.lruCache.getStats();console.log("=== TilesRenderer Debug Info ==="),console.log("Stats:",e),console.log("Memory:",t),console.log("Tree:",a),console.log("Performance:",r),console.log("Cache:",i),console.log("Queues:",{load:this.loadQueue.getStats(),process:this.processNodeQueue.getStats()})}setPerformanceOptions(e){e.lruCacheMinSize!==void 0&&(this.lruCache.minSize=e.lruCacheMinSize),e.lruCacheMaxSize!==void 0&&(this.lruCache.maxSize=e.lruCacheMaxSize),e.lruCacheMinBytes!==void 0&&(this.lruCache.minBytesSize=e.lruCacheMinBytes),e.lruCacheMaxBytes!==void 0&&(this.lruCache.maxBytesSize=e.lruCacheMaxBytes),e.lruCacheUnloadPercent!==void 0&&(this.lruCache.unloadPercent=e.lruCacheUnloadPercent),e.downloadQueueMaxJobs!==void 0&&(this.loadQueue.maxJobs=e.downloadQueueMaxJobs),e.parseQueueMaxJobs!==void 0&&(this.loadQueue.maxJobs=e.parseQueueMaxJobs),e.processQueueMaxJobs!==void 0&&(this.processNodeQueue.maxJobs=e.processQueueMaxJobs),e.enablePerformanceStats!==void 0&&(this._enablePerformanceStats=e.enablePerformanceStats),e.enableCacheStats!==void 0&&(this._enableCacheStats=e.enableCacheStats)}dispose(e){[...this.plugins].forEach(a=>this.unregisterPlugin(a)),this.lruCache.clear(),this.loadQueue.clear(),this.processNodeQueue.clear(),this._root=null,this.rootTileSet=null,this.rootLoadingState=vr,this.frameCount=0,this.isLoading=!1,this.resetCacheStats(),this.group.destroy(e)}setCamera(e,t,a){this.cameras.includes(e)||this.cameras.push(e),this._cameraMap.set(e,{width:t,height:a}),this._updateCameraInfo()}deleteCamera(e){const t=this.cameras.indexOf(e);t!==-1&&this.cameras.splice(t,1),this._cameraMap.delete(e),this._updateCameraInfo()}setResolution(e,t,a){const r=this._cameraMap.get(e);r?(r.width=t,r.height=a):this._cameraMap.set(e,{width:t,height:a}),this._updateCameraInfo()}forEachLoadedModel(e){this.traverse(t=>(t.loadingState===Va&&t.cached.scene&&e(t.cached.scene,t),!1),null)}_estimateBytesUsed(e){let t=0;return e.forChild(a=>{const r=a.getComponent(d.MeshRenderer);r&&r.geometry&&(t+=1024),r&&r.material&&(t+=512)}),t}addEventListener(e,t){this._eventListeners.has(e)||this._eventListeners.set(e,[]),this._eventListeners.get(e).push(t)}removeEventListener(e,t){const a=this._eventListeners.get(e);if(a){const r=a.indexOf(t);r!==-1&&a.splice(r,1)}}async loadTileSet(e,t){const r=(e.endsWith("/")?e.slice(0,-1):e)+"/"+t;this.rootURL=r}get modelList(){const e=[];return this.forEachLoadedModel(t=>{e.push(t)}),e}}class xm{asset;extras;geometricError;properties;refine;root;extensionsUsed;extensionsRequired;extensions}class Fm{boundingVolume;children;geometricError;transform;content;contents;refine;extensions;extras}class km{boundingVolume;geometricError;refine;content;contents;children;transform;extensions;extras}class Em{uri;group;metadata}class wm{class;properties}function Rm(s,e){let t=0,a=null;return function(...r){const i=Date.now(),n=i-t;n>=e?(t=i,s.apply(this,r)):(a!==null&&clearTimeout(a),a=window.setTimeout(()=>{t=Date.now(),s.apply(this,r),a=null},e-n))}}class Im extends Dt{static count=0;constructor(){super(),Y.register("ColorLitShader",bd),this.shader=new gt;let e=new Xe("ColorLitShader","ColorLitShader");e.passType=le.COLOR,this.shader.addRenderPass(e),e.setDefine("USE_BRDF",!0),e.setShaderEntry("VertMain","FragMain"),e.setUniformColor("baseColor",new J),e.setUniformColor("emissiveColor",new J),e.setUniformFloat("envIntensity",1),e.setUniformFloat("normalScale",1),e.setUniformFloat("roughness",0),e.setUniformFloat("metallic",0),e.setUniformFloat("ao",1),e.setUniformFloat("alphaCutoff",0);let t=e.shaderState;t.acceptShadow=!0,t.receiveEnv=!0,t.acceptGI=!0,t.useLight=!0,e.setTexture("normalMap",_.res.normalTexture),e.setTexture("emissiveMap",_.res.blackTexture)}clone(){return null}debug(){}}class Qm extends Dt{constructor(){super();let e=new Xe("LambertShader","LambertShader");e.setShaderEntry("VertMain","FragMain"),e.passType=le.COLOR,e.setUniformVector4("transformUV1",new he(0,0,1,1)),e.setUniformVector4("transformUV2",new he(0,0,1,1)),e.setUniformColor("baseColor",new J(1,1,1,1)),e.setUniformFloat("alphaCutoff",.5);let t=e.shaderState;t.acceptShadow=!1,t.castShadow=!1,t.receiveEnv=!1,t.acceptGI=!1,t.useLight=!1;let a=new gt;a.addRenderPass(e),this.shader=a,this.baseMap=_.res.grayTexture}set baseMap(e){this.shader.setTexture("baseMap",e)}get baseMap(){return this.shader.getTexture("baseMap")}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set envMap(e){}set shadowMap(e){}}function Tm(s,e){}class Mm extends Dt{constructor(){super(),this.shader=new d.UnLitTexArrayShader,this.baseMap=_.res.whiteTexture}set baseMap(e){this.shader.setTexture("baseMap",e)}get baseMap(){return this.shader.getTexture("baseMap")}set baseColor(e){this.shader.setUniformColor("baseColor",e)}get baseColor(){return this.shader.getUniformColor("baseColor")}set shadowMap(e){}}class Lo{clipName;loopTime;startTime;stopTime;sampleRate;useSkeletonPos;useSkeletonScale;positionCurves=new Map;rotationCurves=new Map;scaleCurves=new Map;floatCurves=new Map;formBytes(e){if(this.clipName=e.readUTF(),this.loopTime=!e.readInt32(),this.startTime=e.readFloat32(),this.stopTime=e.readFloat32(),this.sampleRate=e.readInt32(),this.useSkeletonPos=e.readInt32()>0,this.useSkeletonScale=e.readInt32()>0,this.useSkeletonPos){let r=e.readInt32();for(let i=0;i<r;i++){let n=new yr;n.formBytes(e),this.positionCurves.set(n.path,n)}}let t=e.readInt32();for(let r=0;r<t;r++){let i=new yr;i.formBytes(e),this.rotationCurves.set(i.path,i)}if(this.useSkeletonScale){let r=e.readInt32();for(let i=0;i<r;i++){let n=new yr;n.formBytes(e),this.scaleCurves.set(n.path,n)}}let a=e.readInt32();for(let r=0;r<a;r++){let i=new yr;i.formBytes(e),this.floatCurves.set(i.attribute,i)}}}class yr{path;attribute;propertys;preInfinity;postInfinity;rotationOrder;m_curves;k=0;_cacheValue;_kValue;constructor(e=1){this.k=e,this.m_curves=[],this.check()}check(){for(let e=0;e<this.k;e++)this.m_curves[e]||=new Ni;switch(this.k){case 1:this._cacheValue=0;break;case 2:this._cacheValue=new de;break;case 3:this._cacheValue=new b;break;case 4:this._cacheValue=new he;break}}get totalTime(){return this.m_curves[0].totalTime}addKeyFrame(e){for(let t=0;t<this.k;t++)this.m_curves[t].addKeyFrame(e.getK(t))}removeKeyFrame(e){for(let t=0;t<this.k;t++)this.m_curves[t].removeKeyFrame(e.getK(t))}getValue(e){switch(this.k){case 1:this._cacheValue=this.m_curves[0].getValue(e);break;case 2:this._cacheValue.x=this.m_curves[0].getValue(e),this._cacheValue.y=this.m_curves[1].getValue(e);break;case 3:this._cacheValue.x=this.m_curves[0].getValue(e),this._cacheValue.y=this.m_curves[1].getValue(e),this._cacheValue.z=this.m_curves[2].getValue(e);break;case 4:const t=this.m_curves[0].getCurveFramesExtent(e),a=t.lhsIndex,r=t.rhsIndex;e=t.time;let i=this.m_curves[0].getKey(a),n=this.m_curves[0].getKey(r);e%=this.m_curves[0].totalTime;let o=(e-i.time)/(n.time-i.time);ae.HELP_0.set(this.m_curves[0].getKey(a).value,this.m_curves[1].getKey(a).value,this.m_curves[2].getKey(a).value,this.m_curves[3].getKey(a).value),ae.HELP_1.set(this.m_curves[0].getKey(r).value,this.m_curves[1].getKey(r).value,this.m_curves[2].getKey(r).value,this.m_curves[3].getKey(r).value),ae.HELP_2.slerp(ae.HELP_0,ae.HELP_1,o),this._cacheValue.x=ae.HELP_2.x,this._cacheValue.y=ae.HELP_2.y,this._cacheValue.z=ae.HELP_2.z,this._cacheValue.w=ae.HELP_2.w;break}return this._cacheValue}getKeyCount(){return this.m_curves[0].getKeyCount()}getKey(e){let t=[];for(let a=0;a<this.k;a++)t.push(this.m_curves[a].getKey(e));return t}formBytes(e){this.path=e.readUTF(),this.k=e.readInt32(),this.check(),this.attribute=e.readUTF(),this.propertys=this.attribute.split("."),this.preInfinity=e.readInt32(),this.postInfinity=e.readInt32(),this.rotationOrder=e.readInt32();let t=e.readInt32();for(let a=0;a<t;a++){let r=new $i(0);r.formBytes(e),this.addKeyFrame(r)}}}class Nm extends Map{negtive;constructor(e){if(super(e),this.negtive=new Map,e)for(let t of e)this.negtive.set(t[1],t[0])}delete(e){if(this.has(e)){let t=this.get(e);return this.negtive.delete(t),super.delete(e)}return!1}getKey(e){return this.negtive.get(e)}deleteValue(e){let t=this.negtive.get(e);return t&&this.delete(t),this.negtive.delete(e)}set(e,t){return super.set(e,t),this.negtive.set(t,e),this}clear(){this.negtive.clear(),super.clear()}}class Pm{colorArray;constructor(e){this.colorArray=e}getColor(e){let t=e*this.colorArray.length,a=Math.floor(t),r=Math.min(a+1,this.colorArray.length-1),i=this.colorArray[a],n=this.colorArray[r];return J.lerp(t-a,i,n)}}class Gn{controlVertices;constructor(e){this.setControlVertices(e)}setControlVertices(e){e.length==4&&(this.controlVertices=e.concat())}getPoint(e){if(!(e>=0&&e<=1))return b.ZERO;let t=1-e,a=t*t*t,r=3*e*t*t,i=3*e*e*t,n=e*e*e;return this.controlVertices[0].mul(a).add(this.controlVertices[1].mul(r)).add(this.controlVertices[2].mul(i)).add(this.controlVertices[3].mul(n))}getTangent(e){if(!(e>=0&&e<=1))return b.ZERO;let t=this.controlVertices,a=t[0].add(t[1].add(t[0]).mul(e)),r=t[1].add(t[2].add(t[1]).mul(e)),i=t[2].add(t[3].add(t[2]).mul(e)),n=a.add(r.subtract(a).mul(e));return r.add(i.subtract(r).mul(e)).subtract(n)}getClosestParam(e,t=1e-6){return this.getClosestParamRec(e,0,1,t)}getClosestParamRec(e,t,a,r){let i=(t+a)/2;if(a-t<r)return i;let n=(t+i)/2,o=(i+a)/2,l=this.getPoint(n),c=this.getPoint(o),f=l.subtract(e).lengthSquared,h=c.subtract(e).lengthSquared;return f<h?a=i:t=i,this.getClosestParamRec(e,t,a,r)}}var Gh=(s=>(s[s.Open=0]="Open",s[s.Closed=1]="Closed",s))(Gh||{});class Vm{type=0;numCurveSegments=0;numControlVertices=0;controlVertices=[];constructor(e,t=0){this.setControlVertices(e,t)}getPathType(){return this.type}isClosed(){return this.type==1}isValid(){return this.numCurveSegments>0}clear(){this.controlVertices.length=0,this.type=0,this.numCurveSegments=0,this.numControlVertices=0}computeApproxLength(){if(!this.isValid())return 0;let e=this.numCurveSegments+1;if(e<2)return 0;let t=0,a=this.controlVertices;for(let r=1;r<e;r++){let i=a[(r-1)*3],n=a[r*3];t+=i.subtract(n).lengthSquared}return t==0?0:t}computeApproxParamPerUnitLength(){let e=this.computeApproxLength();return this.numCurveSegments/e}computeApproxNormParamPerUnitLength(){return 1/this.computeApproxLength()}interpolatePoints(e,t){let a=e.length;a<2&&console.error("point count must great 1"),this.clear(),this.type=t;let r=this.controlVertices;switch(t){case 0:{this.numCurveSegments=a-1,this.numControlVertices=3*a-2,r.length=this.numControlVertices;for(let o=0;o<a;o++)r[o*3]=e[o];let i=e[1].subtract(e[0]).mul(.25);r[1]=e[0].add(i);let n=e[a-2].subtract(e[a-1]).mul(.25);r[this.numControlVertices-2]=e[a-1].add(n);for(let o=1;o<this.numCurveSegments;o++){let l=e[o-1].subtract(e[o]),c=e[o+1].subtract(e[o]),f=l.lengthSquared,h=c.lengthSquared;if(f>0&&h>0){let u=(f+h)/8,g=c.div(h).subtract(l.div(f));g.normalize(),g=g.mul(u),r[o*3-1]=e[o].subtract(g),r[o*3+1]=e[o].add(g)}else r[o*3-1]=e[o],r[o*3+1]=e[o]}break}case 1:{this.numCurveSegments=a,this.numControlVertices=3*a+1,r.length=this.numControlVertices;for(let i=0;i<a;i++)r[i*3]=e[i];r[this.numControlVertices-1]=e[0];for(let i=1;i<=this.numCurveSegments;i++){let n=i-1,o=(i+1)%this.numCurveSegments,l=i%this.numCurveSegments,c=e[n].subtract(e[l]),f=e[o].subtract(e[l]),h=c.lengthSquared,u=f.lengthSquared,g=3*i-1,A=(3*i+1)%(this.numControlVertices-1);if(h>0&&u>0){let m=(h+u)/8,p=f.div(u).subtract(c.div(h));p.normalize(),p=p.mul(m),r[g]=e[l].subtract(p),r[A]=e[l].add(p)}else r[g]=e[l],r[A]=e[l]}break}}}setControlVertices(e,t){let a=e.length;a<=0||t==0&&a<4||t==1&&a<7||(a-1)%3==0&&(this.clear(),this.type=t,this.numControlVertices=a,this.numCurveSegments=(a-1)/3,this.controlVertices=e)}getPoint(e){if(this.type==1){for(;e<0;)e+=this.numCurveSegments;for(;e>this.numCurveSegments;)e-=this.numCurveSegments}else e=Pt.clampf(e,0,this.numCurveSegments);if(!(e>=0)&&e<=this.numCurveSegments)return;let t=Math.floor(e);t>=this.numCurveSegments&&(t=this.numCurveSegments-1);let a=[],r=this.controlVertices;return a[0]=r[3*t+0],a[1]=r[3*t+1],a[2]=r[3*t+2],a[3]=r[3*t+3],new Gn(a).getPoint(e-t)}getPointNorm(e){return this.getPoint(e*this.numCurveSegments)}getTangent(e){if(this.type==1){for(;e<0;)e+=this.numCurveSegments;for(;e>this.numCurveSegments;)e-=this.numCurveSegments}else e=Pt.clampf(e,0,this.numCurveSegments);if(!(e>=0)&&e<=this.numCurveSegments)return;let t=Math.floor(e);t>=this.numCurveSegments&&(t=this.numCurveSegments-1);let a=this.controlVertices,r=[];return r[0]=a[3*t+0],r[1]=a[3*t+1],r[2]=a[3*t+2],r[3]=a[3*t+3],new Gn(r).getTangent(e-t)}getTangentNorm(e){return this.getTangent(e*this.numCurveSegments)}computeClosestParam(e,t){let a=Number.MAX_SAFE_INTEGER,r=0,i=[],n=new Gn(i);for(let o=0;o<this.controlVertices.length-1;o+=3){for(let h=0;h<4;h++)i[h]=this.controlVertices[o+h];n.setControlVertices(i);let l=n.getClosestParam(e,t),f=n.getPoint(l).subtract(e).lengthSquared;f<a&&(a=f,r=o/3+l)}return r}computeClosestNormParam(e,t){return this.computeClosestParam(e,t*this.numCurveSegments)}}class Om extends Map{valueList;keyList;isChange=!0;constructor(e,t,a){if(super(e),t&&(this.keyList=[]),a&&(this.valueList=[]),e)for(let r of e)this.valueList?.push(r[1]),this.keyList?.push(r[0])}delete(e){if(this.has(e)){let t=this.get(e);return this.valueList&&this.deleteValue(t),this.keyList&&this.deleteKey(e),this.isChange=!0,super.delete(e)}return!1}deleteValue(e){let t=this.valueList.indexOf(e);return t>=0&&this.valueList.splice(t,1),this}deleteKey(e){let t=this.keyList.indexOf(e);return t>=0&&this.keyList.splice(t,1),this}set(e,t){return this.delete(e),this.keyList?.push(e),this.valueList?.push(t),super.set(e,t),this.isChange=!0,this}clear(){this.valueList&&(this.valueList.length=0),this.keyList&&(this.keyList.length=0),this.isChange=!0,super.clear()}}var zh=(s=>(s[s.kParticleSystemClampVelocityCurveId=322376503]="kParticleSystemClampVelocityCurveId",s[s.kParticleSystemForceCurveId=306581307]="kParticleSystemForceCurveId",s[s.kParticleSystemRotationCurveId=1793934638]="kParticleSystemRotationCurveId",s[s.kParticleSystemRotationBySpeedCurveId=3737431713]="kParticleSystemRotationBySpeedCurveId",s[s.kParticleSystemStartSpeedCurveId=2527743459]="kParticleSystemStartSpeedCurveId",s[s.kParticleSystemSizeCurveId=2368504881]="kParticleSystemSizeCurveId",s[s.kParticleSystemSizeBySpeedCurveId=4085612399]="kParticleSystemSizeBySpeedCurveId",s[s.kParticleSystemVelocityCurveId=3774601268]="kParticleSystemVelocityCurveId",s[s.kParticleSystemUVCurveId=326370691]="kParticleSystemUVCurveId",s[s.kParticleSystemColorGradientId=1494990940]="kParticleSystemColorGradientId",s[s.kParticleSystemColorByVelocityGradientId=1089181156]="kParticleSystemColorByVelocityGradientId",s[s.kParticleSystemMeshSelectionId=3159510623]="kParticleSystemMeshSelectionId",s[s.kParticleSystemUVRowSelectionId=2941263940]="kParticleSystemUVRowSelectionId",s))(zh||{});const Lm=3.141592653589793;class Gm{}function Wh(s,e,t){let a=.3333333333333333,r=.5,i=s*a,n=i*i,l=n*i-i*e*r+t*r,c=-n+e*a,f=c*c*c,h=f+l*l;if(h>=0){let A=Math.sqrt(h)-l;return A=A>0?Math.pow(A,a):-Math.pow(-A,a),-i-c/A+A}let u=Math.sqrt(-f),g=Math.acos(-l/u);return u=Math.pow(u,a),u=u-c/u,g=-i+u*Math.cos(g*a),g}function zn(s,e,t,a){let r=1e-5;if(Math.abs(s)<r)return Math.abs(e)>r?(a.r0=-t/e,1):0;let i=e*e-4*s*t;if(i<0)return 0;let n=.5/s,o=Math.sqrt(i);return a.r0=(o-e)*n,a.r1=(-o-e)*n,2}function Jh(s,e,t,a,r){let i=0;if(Math.abs(e)>=1e-4){let n=t/e,o=a/e,l=r/e;s[0]=Wh(n,o,l),i++;let c=e,f=t+e*s[0],h=a+t*s[0]+e*s[0]*s[0];i+=zn(c,f,h,{r0:s[1],r1:s[2]})}else i+=zn(t,a,r,{r0:s[1],r1:s[2]});return i}class Oa{coeff=[];static EvalSegment(e,t){return e*(e*(e*t[0]+t[1])+t[2])+t[3]}}class tr{static kMaxNumSegments=8;segments=[];integrationCache=[];doubleIntegrationCache=[];times=[];segmentCount;constructor(){this.segments[tr.kMaxNumSegments]=new Oa,this.integrationCache[tr.kMaxNumSegments]=0,this.doubleIntegrationCache[tr.kMaxNumSegments]=0,this.times[tr.kMaxNumSegments]=0}calculateMinMax(e,t){e.x=Math.min(e.x,t),e.y=Math.max(e.y,t)}findMinMaxDoubleIntegrated(){let e=de.ZERO.clone(),t=20,a=1/t,r=a;for(let i=0;i<t;i++)this.calculateMinMax(e,this.evaluateDoubleIntegrated(r)),r+=a;return e}findMinMaxIntegrated(){let e=de.ZERO.clone(),t=[],a=[];for(let r=0;r<this.segmentCount;r++){let i=4*this.segments[r].coeff[0],n=3*this.segments[r].coeff[1],o=2*this.segments[r].coeff[2],l=1*this.segments[r].coeff[3],c=[],f=Jh(c,i,n,o,l);for(let h=0;h<f;h++){let u=c[h]+t[r];u>=t[r]&&u<a[r]&&this.calculateMinMax(e,this.evaluateIntegrated(u))}this.calculateMinMax(e,this.evaluateIntegrated(a[r])),this.times[r]}return e}generateIntegrationCache(e){e.integrationCache[0]=0;let t=e.times[0],a=0;for(let r=1;r<e.segmentCount;r++){let i=e.segments[r-1].coeff;Go(i);let n=t-a;e.integrationCache[r]=e.integrationCache[r-1]+Oa.EvalSegment(n,i)*n,a=t,t=e.times[r]}}generateDoubleIntegrationCache(e){let t=0,a=0;for(let r=0;r<e.segmentCount;r++){e.doubleIntegrationCache[r]=t;let i=e.times[r]-a;i=Math.max(i,0),t+=Oa.EvalSegment(i,e.segments[r].coeff)*i*i+e.integrationCache[r]*i,a=e.times[r]}}integrate(){this.generateIntegrationCache(this);for(let e=0;e<this.segmentCount;e++)Go(this.segments[e].coeff)}doubleIntegrate(){this.generateIntegrationCache(this);for(let e=0;e<this.segmentCount;e++)jh(this.segments[e].coeff);this.generateDoubleIntegrationCache(this)}static isValidCurve(e){let t=e.getKeyCount(),a=t-1;return e.getKey(0).time!=0&&a++,e.getKey(t-1).time!=1&&a++,a<=tr.kMaxNumSegments}evaluateDoubleIntegrated(e){let t=0;for(let a=0;a<this.segmentCount;a++){if(e<=this.times[a]){let r=e-t;return this.doubleIntegrationCache[a]+this.integrationCache[a]*r+Oa.EvalSegment(r,this.segments[a].coeff)*r*r}t=this.times[a]}return 1}evaluateIntegrated(e){let t=0;for(let a=0;a<this.segmentCount;a++){if(e<=this.times[a]){let r=e-t;return this.integrationCache[a]+Oa.EvalSegment(r,this.segments[a].coeff)*r}t=this.times[a]}return 1}evaluate(e){let t=0;for(let a=0;a<this.segmentCount;a++){if(e<=this.times[a])return Oa.EvalSegment(e-t,this.segments[a].coeff);t=this.times[a]}return 1}buildCurve(e,t){let a=e.getKeyCount();this.segmentCount=1;let r=1.01;if(this.segments.length=0,this.integrationCache.length=0,this.doubleIntegrationCache.length=0,this.times.length=0,this.times[0]=r,a!=0)if(a==1)this.segments[0]=new Oa,this.segments[0].coeff[3]=e.getKey(0).value*t;else{this.segmentCount=a-1;let i=0;e.getKey(0).time!=0&&(this.segments[0].coeff[3]=e.getKey(0).value,this.times[0]=e.getKey(0).time,i=1);for(let n=0;n<this.segmentCount;n++){let o;e.calculateCacheData(o,n,n+1,0),this.segments[n+i].coeff=o.coeff.concat(),this.times[n+i]=e.getKey(n+1).time}this.segmentCount+=i,e.getKey(a-1).time!=1&&(this.segments[this.segmentCount].coeff[3]=e.getKey(a-1).value,this.segmentCount++),this.times[this.segmentCount-1]=r;for(let n=0;n<this.segmentCount;n++)this.segments[n].coeff[0]*=t,this.segments[n].coeff[1]*=t,this.segments[n].coeff[2]*=t,this.segments[n].coeff[3]*=t}return!0}}function jh(s){s[0]/=20,s[1]/=12,s[2]/=6,s[3]/=2}function Go(s){s[0]/=4,s[1]/=3,s[2]/=2,s[3]/=1}var Zh=(s=>(s[s.kEMScalar=0]="kEMScalar",s[s.kEMOptimized=1]="kEMOptimized",s[s.kEMOptimizedMinMax=2]="kEMOptimizedMinMax",s[s.kEMSlow=3]="kEMSlow",s))(Zh||{}),Yh=(s=>(s[s.kMMCScalar=0]="kMMCScalar",s[s.kMMCCurve=1]="kMMCCurve",s[s.kMMCTwoCurves=2]="kMMCTwoCurves",s[s.kMMCTwoConstants=3]="kMMCTwoConstants",s))(Yh||{});class zm{max;min}class Wm{max;min;integrate(){this.max.integrate(),this.min.integrate()}doubleIntegrate(){this.max.doubleIntegrate(),this.min.doubleIntegrate()}findMinMaxIntegrated(){return null}findMinMaxDoubleIntegrated(){return null}}class Xh{minMaxState;minCurve;maxCurve;_scalar=1;_minScalar;constructor(e=1){this._scalar=e,this.minMaxState=0,this.minCurve=new Ni,this.maxCurve=new Ni}setScalar(e){this._scalar=e}getScalar(){return this._scalar}static evaluateSlow(e,t,a){let r=e.maxCurve.getValue(t)*e.getScalar();return e.minMaxState==2?Sr(e.minCurve.getValue(t)*e.getScalar(),r,a):r}static evaluate(e,t,a=1){if(e.minMaxState==0)return e.getScalar();let r=e.maxCurve.getValue(t)*e.getScalar();return e.minMaxState==1?Sr(e.minCurve.getValue(t)*e.getScalar(),r,a):e.minMaxState==3?Sr(e._minScalar,e._scalar,a):e.minMaxState==2?Sr(e.minCurve.getValue(t)*e.getScalar(),r,1*Math.random()):this.evaluateSlow(e,t,1)}unSerialized(e){this.minMaxState=e.minMaxState,this._scalar=e.scalar,this._minScalar=e.minScalar,this.maxCurve.unSerialized(e.maxCurve),this.minCurve.unSerialized(e.minCurve)}}class Jm{value=0;mode=0;spread=0;speed=new Xh;unSerialized(e){this.value=e.value,this.mode=e.mode,this.spread=e.spread,this.speed.unSerialized(e.speed)}}function jm(s,e){let t=tr.isValidCurve(s.max);return e!=2&&e!=3?t:t&&tr.isValidCurve(s.min)}function Zm(s,e,t,a){s.max.buildCurve(e.max,t),a!=2&&a!=3?s.min.buildCurve(e.max,t):s.min.buildCurve(e.min,t)}function Ym(s,e){let t=e.getKeyCount();if(t!=0)if(t==1)Ki(s,e.getKey(0).value);else{let a=t-1;Ki(s,e.getKey(0).value);for(let r=0;r<a;r++){let i=new fo;e.calculateCacheData(i,r,r+1,0);let n=3*i.coeff[0],o=2*i.coeff[1],l=1*i.coeff[2],c=e.getKey(r).time,f=e.getKey(r+1).time,h=[],u=zn(n,o,l,{r0:h[0],r1:h[1]});for(let g=0;g<u;g++)h[g]>=0&&h[g]+c<f&&Ki(s,Oa.EvalSegment(h[g],i.coeff));Ki(s,Oa.EvalSegment(f-c,i.coeff))}}}function Ki(s,e){s.x=Math.min(s.x,e),s.y=Math.max(s.y,e)}class Or{static BACK=0;static FRONT=1;static IN=0;static OUT=1;static INTERSECT=2}class Hh{a;b;c;d;static ALIGN_ANY=0;static ALIGN_XY_AXIS=1;static ALIGN_YZ_AXIS=2;static ALIGN_XZ_AXIS=3;constructor(e=0,t=0,a=0,r=0){this.a=e,this.b=t,this.c=a,this.d=r}setTo(e=0,t=0,a=0,r=0){this.a=e,this.b=t,this.c=a,this.d=r}fromPoints(e,t,a){var r=t.x-e.x,i=t.y-e.y,n=t.z-e.z,o=a.x-e.x,l=a.y-e.y,c=a.z-e.z;this.a=i*c-n*l,this.b=n*o-r*c,this.c=r*l-i*o,this.d=-(this.a*e.x+this.b*e.y+this.c*e.z)}fromNormalAndPoint(e,t){this.a=e.x,this.b=e.y,this.c=e.z,this.d=-(this.a*t.x+this.b*t.y+this.c*t.z)}normalize(){var e=Math.sqrt(this.a*this.a+this.b*this.b+this.c*this.c);if(e>0){var t=1/e;this.a*=t,this.b*=t,this.c*=t,this.d*=t}return e}distance(e){return this.a*e.x+this.b*e.y+this.c*e.z+this.d}classifyPoint(e,t=.01){var a=this.distance(e);return a<-t?Or.BACK:a>t?Or.FRONT:Or.INTERSECT}toString(){return"Plane3D [a:"+this.a+", b:"+this.b+", c:"+this.c+", d:"+this.d+"]"}}function Xm(s,e){return Math.random()*e+Math.random()*s+(e-s)*Math.random()}function Hm(s,e,t){let a=t*Math.random();return Math.random()*e*a+Math.random()*s*a+(e-s)*Math.random()*a}function Kh(s,e,t){let a=0,r=0;for(;a===0;)a=Math.random();for(;r===0;)r=Math.random();let i=Math.sqrt(-2*Math.log(a))*Math.cos(2*Math.PI*r);return i=i/10+.5,(i>1||i<0)&&(i=Kh(s,e,t)),i=Math.pow(i,t),i*=e-s,i+=s,i}function Ca(s){return s>0?Math.floor(s):Math.floor(s)-1}let Ue=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];function zo(s,e){let t=s&15,a=1+(t&7);return t&8&&(a=-a),a*e}function Wn(s,e,t){let a=s&7,r=a<4?e:t,i=a<4?t:e;return(a&1?-r:r)+(a&2?-2*i:2*i)}function qi(s,e,t,a){let r=s&15,i=r<8?e:t,n=r<4?t:r==12||r==14?e:a;return(r&1?-i:i)+(r&2?-n:n)}function ui(s,e,t,a,r){let i=s&31,n=i<24?e:t,o=i<16?t:a,l=i<8?a:r;return(i&1?-n:n)+(i&2?-o:o)+(i&4?-l:l)}let ea=[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]];function Km(s){let e=Ca(s),t=e+1,a=s-e,r=a-1,i,n,o=1-a*a;o*=o,i=o*o*zo(Ue[e&255],a);let l=1-r*r;return l*=l,n=l*l*zo(Ue[t&255],r),.25*(i+n)}function qm(s,e){const t=.366025403,a=.211324865;let r,i,n,o=(s+e)*t,l=s+o,c=e+o,f=Ca(l),h=Ca(c),u=(f+h)*a,g=f-u,A=h-u,m=s-g,p=e-A,D,B;m>p?(D=1,B=0):(D=0,B=1);let v=m-D+a,C=p-B+a,y=m-1+2*a,x=p-1+2*a,k=f&255,E=h&255,S=.5-m*m-p*p;S<0?r=0:(S*=S,r=S*S*Wn(Ue[k+Ue[E]],m,p));let Q=.5-v*v-C*C;Q<0?i=0:(Q*=Q,i=Q*Q*Wn(Ue[k+D+Ue[E+B]],v,C));let I=.5-y*y-x*x;return I<0?n=0:(I*=I,n=I*I*Wn(Ue[k+1+Ue[E+1]],y,x)),40*(r+i+n)}function $m(s,e,t){const a=.333333333,r=.166666667;let i,n,o,l,c=(s+e+t)*a,f=s+c,h=e+c,u=t+c,g=Ca(f),A=Ca(h),m=Ca(u),p=(g+A+m)*r,D=g-p,B=A-p,v=m-p,C=s-D,y=e-B,x=t-v,k,E,S,Q,I,T;C>=y?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,1/t,1/a)}}class $i{serializedVersion="2";time;tangentMode=0;weightedMode=0;propertyKeyFrame;constructor(e=0){this.time=e,this.propertyKeyFrame={}}getK(e){return this.propertyKeyFrame[e]}split(e,t,a){switch(e){case X.single:{let r=this.getKeyFrame(0);r[a]=t}break;case X.float:{let r=this.getKeyFrame(0);r[a]=t}break;case X.vector2:{let r=t,i=this.getKeyFrame(0);i[a]=r.x;let n=this.getKeyFrame(1);n[a]=r.y}break;case X.vector3:{let r=t,i=this.getKeyFrame(0);i[a]=r.x;let n=this.getKeyFrame(1);n[a]=r.y;let o=this.getKeyFrame(2);o[a]=r.z}break;case X.vector4:{let r=t,i=this.getKeyFrame(0);i[a]=r.x;let n=this.getKeyFrame(1);n[a]=r.y;let o=this.getKeyFrame(2);o[a]=r.z;let l=this.getKeyFrame(3);l[a]=r.w}break;case X.quaternion:{let r=t,i=this.getKeyFrame(0);i[a]=r.x;let n=this.getKeyFrame(1);n[a]=r.y;let o=this.getKeyFrame(2);o[a]=r.z;let l=this.getKeyFrame(3);l[a]=r.w}break}}getKeyFrame(e){let t=this.propertyKeyFrame[e];return t||(t=new kn,t.time=this.time,t.tangentMode=this.tangentMode,t.weightedMode=this.weightedMode,this.propertyKeyFrame[e]=t),t}formBytes(e){this.time=e.readFloat32();{let{t,v:a}=Pa.parser(e);this.split(t,a,"value")}{let{t,v:a}=Pa.parser(e);this.split(t,a,"inSlope")}{let{t,v:a}=Pa.parser(e);this.split(t,a,"outSlope")}this.tangentMode=e.readInt32(),this.weightedMode=e.readInt32();{let{t,v:a}=Pa.parser(e);this.split(t,a,"inWeight")}{let{t,v:a}=Pa.parser(e);this.split(t,a,"outWeight")}}}class tp{static sub(e,t){switch(e.constructor.name){case"number":return e-t;case"Vector2":{let r=e,i=t;return new de(r.x-i.x,r.y-i.y)}case"Vector3":{let r=e,i=t;return new b(r.x-i.x,r.y-i.y,r.z-i.z)}case"Vector4":{let r=e,i=t;return new he(r.x-i.x,r.y-i.y,r.z-i.z,r.w-i.w)}case"Quaternion":{let r=e,i=t;return new ae(r.x-i.x,r.y-i.y,r.z-i.z,r.w-i.w)}}}}class en{_keys=new Array;_values=new Array;getIndexByKey(e){return this._keys.indexOf(e)}getValueByKey(e){var t=this.getIndexByKey(e);return t>-1?this._values[t]:null}put(e,t){if(e==null)return null;var a=this.remove(e);return this._keys.push(e),this._values.push(t),a}remove(e){var t=this._keys.indexOf(e),a;return t>-1&&(a=this._values[t],this._keys.splice(t,1),this._values.splice(t,1)),a}getValues(){return this._values}getKeys(){return this._keys}clear(){this._values.length=0,this._keys.length=0}}class Cr{static WalkAble=1}class tn{static SetConst(e){this.EPSILON=e,this.POWER_EPSILON=e*e}static EPSILON=.1;static POWER_EPSILON=this.EPSILON*this.EPSILON}class Tt extends b{static CALC_VECTOR3D1=new b;static CALC_VECTOR3D2=new b;static CALC_VECTOR3D3=new b;static CALC_VECTOR3D4=new b;static CALC_VECTOR3D5=new b;_pointId=0;constructor(e,t,a,r){super(t,a,r,0),this._pointId=e}get id(){return this._pointId}static equalPoint(e,t){return(e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y)+(e.z-t.z)*(e.z-t.z)<tn.POWER_EPSILON}static calcDistance(e,t){return Tt.CALC_VECTOR3D3.setTo(e.x-t.x,e.y-t.y,e.z-t.z),Tt.CALC_VECTOR3D3.length}}class qh{_openedList;_closedList;_endNode;_startNode;_triangleChannel;_navMesh;_findIndex=0;constructor(){this._openedList=new Array,this._closedList=new Array}findPath(e,t,a){return this._findIndex++,this._navMesh=e,this._startNode=t,this._endNode=a,this._openedList.length=0,this._closedList.length=0,this._startNode&&this._endNode?(this._startNode.gg=0,this._startNode.h=0,this._startNode.f=0,this._startNode.parent=null,this.search()):!1}search(){for(var e=this._startNode,t=[],a;e!=this._endNode;){t=e.getNeibourTriangles(t,Cr.WalkAble,Cr.WalkAble);for(a of t)if(a.closeId!=this._findIndex&&!(a==e||!a.walkAble)){var r=e.gg+Tt.calcDistance(a,e)*a.costMultiplier,i=Tt.calcDistance(a,this._endNode),n=r+i;a.openId==this._findIndex?a.f>n&&(a.f=n,a.gg=r,a.h=i,a.parent=e):(a.f=n,a.gg=r,a.h=i,a.parent=e,a.openId=this._findIndex,this._openedList.push(a))}if(e.closeId=this._findIndex,this._closedList.push(e),this._openedList.length==0)return!1;this._openedList.sort(function(o,l){return o.f-l.f}),e=this._openedList.shift()}return this.buildPath(),!0}buildPath(){this._triangleChannel=[];var e=this._endNode;for(this._triangleChannel.push(e);e!=this._startNode;)e=e.parent,this._triangleChannel.unshift(e)}get channel(){return this._triangleChannel}}class Sa extends Tt{_ownerPoint;_ownerEdge;radius=0;constructor(e,t){super(e.id,0,0,0),this._ownerEdge=t,this._ownerPoint=e}get ownerPoint(){return this._ownerPoint}get ownerEdge(){return this._ownerEdge}scalePoint(e=.7){var t=new Sa(this._ownerPoint,this._ownerEdge);return t.copyFrom(this),t.decrementBy(this._ownerPoint),t.scaleBy(e),t.radius=t.length,t.incrementBy(this._ownerPoint),t}}class xa{_edgeMask=0;_edgeSize=0;_pointA;_pointB;_triangleOwners;_centerPoint;_edgeDirA2B;crossPoint;fatPointA;fatPointB;static CALC_FAT_VECTOR=new b;constructor(e,t){if(this._pointA=e,this._pointB=t,e.id>=t.id)throw new Error("edge point order error!!!");this._triangleOwners=new Array,this._centerPoint=new b,this._edgeMask=Cr.WalkAble,Tt.CALC_VECTOR3D1.setTo(e.x-t.x,e.y-t.y,e.z-t.z),this._edgeSize=Tt.CALC_VECTOR3D1.length,this._centerPoint.setTo((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2)}get size(){return this._edgeSize}get triangleOwners(){return this._triangleOwners}get centerPoint(){return this._centerPoint}initFatPoints(e){this._edgeDirA2B=this._pointB.subtract(this._pointA),this._edgeDirA2B.normalize(),this.fatPointA=this.fatPointA||new Sa(this._pointA,this),this.fatPointB=this.fatPointB||new Sa(this._pointB,this),this.fatPointA.radius!=e&&(xa.CALC_FAT_VECTOR.copyFrom(this._edgeDirA2B),xa.CALC_FAT_VECTOR.scaleBy(e),xa.CALC_FAT_VECTOR.incrementBy(this._pointA),this.fatPointA.copyFrom(xa.CALC_FAT_VECTOR),this.fatPointA.radius=e),this.fatPointB.radius!=e&&(xa.CALC_FAT_VECTOR.copyFrom(this._edgeDirA2B),xa.CALC_FAT_VECTOR.scaleBy(-e),xa.CALC_FAT_VECTOR.incrementBy(this._pointB),this.fatPointB.copyFrom(xa.CALC_FAT_VECTOR),this.fatPointB.radius=e)}getFatPoint(e){return e==this._pointA?this.fatPointA:this.fatPointB}getAnotherFatPoint(e){return e==this._pointA?this.fatPointB:this.fatPointA}getAnotherPoint(e){return e==this._pointA?this._pointB:this._pointA}containsPoint(e){return Tt.equalPoint(e,this._pointA)?this._pointA:Tt.equalPoint(e,this._pointB)?this._pointB:null}addTriangleOwners(e){if(e.edges.indexOf(this)==-1)throw new Error("the edge is not belong triangle!!!");this._triangleOwners.indexOf(e)==-1&&this._triangleOwners.push(e)}getPublicPoint(e){return this._pointA==e._pointA||this._pointA==e._pointB?this._pointA:this._pointB==e._pointA||this._pointB==e._pointB?this._pointB:null}getEqualPoint(e){return Tt.equalPoint(e,this._pointA)?this._pointA:Tt.equalPoint(e,this._pointB)?this._pointB:null}get pointA(){return this._pointA}get pointB(){return this._pointB}get walkAble(){return(this._edgeMask&Cr.WalkAble)==Cr.WalkAble}testMask(e){return(this._edgeMask&e)==e}}class pe{endPoint;curPoint;rayA;rayB;rayAPoint;rayBPoint;static RAY_1=new b;static RAY_2=new b;static TEST_RAY=new b;static TEST_RAY_1=new b;static TEST_RAY_2=new b;static CALC_CROSS_POINT=new b;static CALC_CROSS_TEST=new b;cornerPoint;cornerEdge;continuePass(e,t,a){this.resetData(),this.curPoint=e,this.endPoint=t,this.cornerEdge=a}passEdge(e,t,a,r){if((this.rayA==null||this.rayB==null)&&(this.rayA=pe.RAY_1,this.rayB=pe.RAY_2,this.rayAPoint=e.pointA,this.rayBPoint=e.pointB,this.rayA.setTo(this.rayAPoint.x-this.curPoint.x,0,this.rayAPoint.z-this.curPoint.z),this.rayB.setTo(this.rayBPoint.x-this.curPoint.x,0,this.rayBPoint.z-this.curPoint.z)),r)return this.checkEndPoint(a);if(pe.TEST_RAY.setTo(a.x-this.curPoint.x,0,a.z-this.curPoint.z),this.isPointAtCenter(pe.TEST_RAY,this.rayA,this.rayB)){this.hasCrossPoint(t.pointA,t.pointB,this.rayAPoint,this.rayA)?(this.rayB.copyFrom(pe.TEST_RAY),a instanceof Tt?this.rayBPoint=a:this.rayBPoint=null):(this.rayA.copyFrom(pe.TEST_RAY),a instanceof Tt?this.rayAPoint=a:this.rayAPoint=null);var i=t.getAnotherPoint(a);pe.TEST_RAY.setTo(i.x-this.curPoint.x,0,i.z-this.curPoint.z),(i==this.rayAPoint||i==this.rayBPoint||this.isPointAtCenter(pe.TEST_RAY,this.rayA,this.rayB))&&(this.cornerEdge=t)}else{var n;if(pe.TEST_RAY_1.copyFrom(t.pointA),pe.TEST_RAY_1.decrementBy(this.curPoint),pe.TEST_RAY_2.copyFrom(t.pointB),pe.TEST_RAY_2.decrementBy(this.curPoint),pe.TEST_RAY_1.y=0,pe.TEST_RAY_2.y=0,this.isPointAtCenter(this.rayA,pe.TEST_RAY_1,pe.TEST_RAY_2)||this.isPointAtCenter(this.rayB,pe.TEST_RAY_1,pe.TEST_RAY_2)?n=!1:n=!0,n)return this.isPointAtCenter(this.rayA,pe.TEST_RAY,this.rayB)?this.cornerPoint=this.rayAPoint:this.cornerPoint=this.rayBPoint,this.cornerEdge.crossPoint=this.cornerPoint,!1}return!0}checkEndPoint(e){return pe.TEST_RAY.setTo(e.x-this.curPoint.x,0,e.z-this.curPoint.z),this.isPointAtCenter(pe.TEST_RAY,this.rayA,this.rayB)?!0:(this.isPointAtCenter(this.rayA,pe.TEST_RAY,this.rayB)?this.cornerPoint=this.rayAPoint:this.cornerPoint=this.rayBPoint,this.cornerEdge.crossPoint=this.cornerPoint,!1)}calcCrossEdge(e,t,a){return this.calcCrossPoint(e.fatPointA,e.fatPointB,t,a)}calcCrossPoint(e,t,a,r){pe.CALC_CROSS_POINT.copyFrom(t),pe.CALC_CROSS_POINT.decrementBy(e);let i=pe.CALC_CROSS_POINT.x*r.z-r.x*pe.CALC_CROSS_POINT.z;var n=0;return i!=0&&(n=((e.z-a.z)*r.x-(e.x-a.x)*r.z)/i),n>1?n=1:n<0&&(n=0),pe.CALC_CROSS_POINT.scaleBy(n),pe.CALC_CROSS_POINT.incrementBy(e),pe.CALC_CROSS_POINT.clone()}calcCrossPointOut(e,t,a,r){pe.CALC_CROSS_POINT.copyFrom(t),pe.CALC_CROSS_POINT.decrementBy(e);var i=((e.z-a.z)*r.x-(e.x-a.x)*r.z)/(pe.CALC_CROSS_POINT.x*r.z-r.x*pe.CALC_CROSS_POINT.z);return i<=1&&i>=0?null:(pe.CALC_CROSS_POINT.scaleBy(i),pe.CALC_CROSS_POINT.incrementBy(e),pe.CALC_CROSS_POINT.clone())}hasCrossPoint(e,t,a,r){pe.CALC_CROSS_TEST.copyFrom(t),pe.CALC_CROSS_TEST.decrementBy(e);var i=((e.z-a.z)*r.x-(e.x-a.x)*r.z)/(pe.CALC_CROSS_TEST.x*r.z-r.x*pe.CALC_CROSS_TEST.z);return i<=1&&i>=0}isPointAtCenter(e,t,a){var r=t.crossProduct(e);if(r.length==0&&e.length<t.length)return!0;var i=a.crossProduct(e);return i.length==0&&e.length<a.length?!0:(r.normalize(),i.normalize(),r.incrementBy(i),r.length<.01)}resetData(){this.cornerEdge=null,this.cornerPoint=null,this.curPoint=null,this.rayA=this.rayB=null,this.rayAPoint=this.rayBPoint=null,pe.RAY_1.setTo(0,0,0),pe.RAY_2.setTo(0,0,0)}}class ar{_aiRadius=0;_router;_result;_tempPublicEdgeList=new Array;_tempSamePlaneList=new Array;static CROSS_TEST_DIRECTION=new b;constructor(){this._router=new pe}searchPath(e,t,a,r=0){return r<=0&&(r=1),this._aiRadius=r*1.5,this.searchEnable(e,t,a)?(this.search(e,t,a),!0):!1}get path(){return this._result}searchEnable(e,t,a){return!(e==null||t==null||a==null||a[0].plane.classifyPoint(e,tn.EPSILON)!=Or.INTERSECT||a[a.length-1].plane.classifyPoint(t,tn.EPSILON)!=Or.INTERSECT)}search(e,t,a){this._tempPublicEdgeList.length=0,this._tempSamePlaneList.length=0;var r=0,i=a.length-1,n,o,l,c;for(r=0;r<i;r++)o=a[r].getPublicEdge(a[r+1]),o.crossPoint=null,o.initFatPoints(this._aiRadius),this._tempPublicEdgeList.push(o),n=a[r],c=n.plane,n=a[r+1],l=n.getEdgeAgainstPoint(o),this._tempSamePlaneList.push(c.classifyPoint(l,tn.EPSILON)==Or.INTERSECT);this._router.continuePass(e,t,this._tempPublicEdgeList[0]),i=this._tempPublicEdgeList.length;var f,h,u,g;for(r=0;r<i;r++)o=this._tempPublicEdgeList[r],n=a[r+1],g=r==i-1,g?l=t:l=n.getEdgeAgainstPoint(o),u=this._router.passEdge(o,this._tempPublicEdgeList[r+1],l,g),u||(f=this._router.cornerPoint,h=this._router.cornerEdge,r=this._tempPublicEdgeList.indexOf(h),this._router.continuePass(f,t,this._tempPublicEdgeList[r+1]));this.pushAllPathPoint2(e,t),this._result.length>=3&&(this.optimusTerminusFat(),this.optimusByRadius());let A=[];for(let m of this._result)A.push(new b().copyFrom(m));this._result=A}optimusTerminusFat(){var e,t,a;a=this._result[1],a instanceof Sa&&(e=a),a=this._result[this._result.length-2],a instanceof Sa&&(t=a),e&&(this._result[1]=e.scalePoint()),t&&e!=t&&(this._result[this._result.length-2]=t.scalePoint())}pushAllPathPoint2(e,t){var a=this._tempPublicEdgeList.length,r,i;this._result=new Array,this._result.push(e);for(var n=e,o,l,c,f=0;f<a;f++)if(r=this._tempPublicEdgeList[f],l=null,r.crossPoint)l=this.getFatPoint(r,r.crossPoint),l?this._result.push(l):this._result.push(r.crossPoint),n=r.crossPoint;else{i=null,o=null;for(var h=f+1;h<a&&(i=this._tempPublicEdgeList[h],o=i.crossPoint,!o);h++);o==null&&(o=t),l=this.getFatPoint(r,o),l?this._result.push(l):(o==n?c=o.clone():(ar.CROSS_TEST_DIRECTION.setTo(o.x-n.x,0,o.z-n.z),c=this._router.calcCrossEdge(r,n,ar.CROSS_TEST_DIRECTION)),this._result.push(c))}this._result.push(t)}optimusByRadius(){var e=new Array;e.length=this._result.length;var t=this._result.length-2,a,r,i,n,o,l,c,f,h,u,g,A,m;for(m=0;m<t;m++)c=f=h=null,n=o=l=null,g=!1,A=null,a=this._result[m],r=this._result[m+1],i=this._result[m+2],a instanceof Sa&&(n=a),r instanceof Sa&&(o=r),i instanceof Sa&&(l=i),n&&(c=n.ownerPoint),o&&(f=o.ownerPoint),l&&(h=l.ownerPoint),c&&f&&c==f&&f!=h&&(g=!0),h&&f&&h==f&&c!=f&&(g=!0),g&&(ar.CROSS_TEST_DIRECTION.copyFrom(a),ar.CROSS_TEST_DIRECTION.decrementBy(i),u=o.ownerEdge,g=this._router.hasCrossPoint(u.pointA,u.pointB,i,ar.CROSS_TEST_DIRECTION),g&&(A=this._router.calcCrossPointOut(f,r,i,ar.CROSS_TEST_DIRECTION)),A&&(e[m+1]=A))}getFatPoint(e,t){if(e==null)return null;var a;t instanceof Sa&&(a=t);var r;return a?r=a.ownerPoint:r=e.getEqualPoint(t),r==null?null:(a=e.getFatPoint(r),a)}}class $h extends b{_id=0;_plane;_points=new Array;_edges=new Array;_neibourTriangles=new en;_pointAgainstEdge=new en;_edgeAgainstPoint=new en;_mask=0;_aabbBox;f=0;gg=0;h=0;parent;costMultiplier=1;openId=0;closeId=0;get aabb(){return this._aabbBox}initAABB(){this._aabbBox=new Qt,this._aabbBox.addPoint(this._points[0]),this._aabbBox.addPoint(this._points[1]),this._aabbBox.addPoint(this._points[2])}calcGlobalQuadAABB(){}get isTriangle(){return!0}constructor(e,t,a,r){super(0,0,0,0),this._id=e,this._mask=Cr.WalkAble,this._edges.push(t,a,r);var i;for(i of this._edges)this._points.indexOf(i.pointA)==-1&&this._points.push(i.pointA),this._points.indexOf(i.pointB)==-1&&this._points.push(i.pointB);this.x=(this._points[0].x+this._points[1].x+this._points[2].x)/3,this.y=(this._points[0].y+this._points[1].y+this._points[2].y)/3,this.z=(this._points[0].z+this._points[1].z+this._points[2].z)/3,this._plane=new Hh,this._plane.fromPoints(this._points[0],this._points[1],this._points[2]),this._plane.normalize(),this.genarateAgainstData(),this.initAABB()}genarateAgainstData(){var e,t;for(e of this._edges)for(t of this._points)e.pointA!=t&&e.pointB!=t&&(this._edgeAgainstPoint.put(e,t),this._pointAgainstEdge.put(t,e))}get id(){return this._id}get plane(){return this._plane}get points(){return this._points}addNeibour(e,t){if(this._edges.indexOf(e)>=0)this._neibourTriangles.put(e,t);else throw new Error("the edge is not in triangle!!!")}getNeibourTriangles(e=null,t=1,a=1){e=e||new Array,e.length=0;var r,i,n=this._neibourTriangles.getKeys(),o;for(o of n)i=o,i.testMask(t)&&(r=this._neibourTriangles.getValueByKey(i),r.testMask(a)&&e.push(r));return e}getEdges(e=null,t=1){e=e||new Array,e.length=0;var a;for(a of this._edges)a.testMask(t)&&e.push(a);return e}get walkAble(){return this.testMask(Cr.WalkAble)}get edges(){return this._edges}testMask(e){return(this._mask&e)==e}getEdgeAgainstPoint(e){return this._edgeAgainstPoint.getValueByKey(e)}getPointAgainstEdge(e){return this._pointAgainstEdge.getValueByKey(e)}getPublicEdge(e){if(e&&e!=this){var t=this._neibourTriangles.getKeys(),a;for(a of t)if(this._neibourTriangles.getValueByKey(a)==e)return a}return null}loopPublicEdge(e){var t,a;if(e&&e!=this){for(t of this._edges)for(a of e._edges)if(t==a)return t}return null}randomPoint(){var e=this._points[2].subtract(this._points[0]);e.scaleBy(Math.random()),e.incrementBy(this._points[0]);var t=this._points[1].subtract(e);return t.scaleBy(Math.random()),t.incrementBy(e),t}}class ap{_nav3dPoints;_nav3dEdges;_nav3dTriangles;_path;_edgesDict;_nav3dAstar;_nav3dFunnel;_terrainQuad;_triangleList;get edges(){return this._nav3dEdges}get points(){return this._nav3dPoints}get path(){return this._path}get triangles(){return this._nav3dTriangles}constructor(e,t){this._nav3dPoints=new Array,this._nav3dEdges=new Array,this._nav3dTriangles=new Array,this._edgesDict=new en,this.initPoints(e),this.initEdgesAndTriangles(t),this.createConnections(),this._nav3dAstar=new qh,this._nav3dFunnel=new ar,this._terrainQuad=new nh(8,128),this._terrainQuad.createQuadTree(this._nav3dTriangles)}getTriangleAtPoint(e,t=5){return this._terrainQuad.getTriangleAtPoint(e,t)}findPath(e,t,a=5){this._path=null,this._triangleList=null;var r=this.getTriangleAtPoint(e,10),i=this.getTriangleAtPoint(t,10),n=this._nav3dAstar.findPath(this,r,i);return n?(this._triangleList=this._nav3dAstar.channel,n=this._nav3dFunnel.searchPath(e,t,this._triangleList,a),this._path=this._nav3dFunnel.path,n):!1}initPoints(e){for(var t,a,r=e.length,i=0;i<r;i++)t=e[i],a=new Tt(i,t.x,t.y,t.z),this._nav3dPoints.push(a)}initEdgesAndTriangles(e){for(var t,a,r,i,n,o=e.length,l=0;l<o;l++)t=e[l],a=this.tryCreateEdge(t[0],t[1]),r=this.tryCreateEdge(t[1],t[2]),i=this.tryCreateEdge(t[2],t[0]),!(a==null||r==null||i==null)&&(n=new $h(l,a,r,i),this._nav3dTriangles.push(n))}tryCreateEdge(e,t){if(e==t)throw new Error("edge point index error!!!");if(e>t){var a=e;e=t,t=a}var r=this._edgesDict.getValueByKey(e+"_"+t);return r==null&&(r=new xa(this._nav3dPoints[e],this._nav3dPoints[t]),this._nav3dEdges.push(r),this._edgesDict.put(e+"_"+t,r)),r}createConnections(){for(var e=this._nav3dTriangles.length,t=this._nav3dTriangles.length,a,r,i,n,o=0;o<e;o++){a=this._nav3dTriangles[o];for(i of a.edges)i.addTriangleOwners(a);for(var l=0;l<t;l++)r=this._nav3dTriangles[l],a!=r&&(n=a.loopPublicEdge(r),n&&(a.addNeibour(n,r),r.addNeibour(n,a)))}}}class Jo{x;y;setTo(e,t){this.x=e,this.y=t}equals(e,t){return e==this.x&&t==this.y}equalPoint(e){return this.equals(e.x,e.y)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y)}clone(){var e=new Jo;return e.setTo(this.x,this.y),e}normalize(){var e=length;e!=0&&this.setTo(this.x/e,this.y/e)}}class La extends Ve{width;height;depth;constructor(e=1,t=1,a=1){super(),this.width=e,this.height=t,this.depth=a,this.initVertex()}initVertex(){let e=this.width/2,t=this.height/2,a=this.depth/2;this.bounds=new xe(b.ZERO.clone(),new b(this.width,this.height,this.depth));let r=new Float32Array([-e,t,a,e,t,a,e,t,-a,-e,t,-a,-e,t,a,e,t,-a,e,-t,a,-e,-t,a,-e,-t,-a,e,-t,-a,e,-t,a,-e,-t,-a,-e,-t,a,-e,t,a,-e,t,-a,-e,-t,-a,-e,-t,a,-e,t,-a,e,t,a,e,-t,a,e,-t,-a,e,t,-a,e,t,a,e,-t,-a,e,t,a,-e,t,a,-e,-t,a,-e,-t,a,e,-t,a,e,t,a,e,-t,-a,-e,-t,-a,-e,t,-a,e,t,-a,e,-t,-a,-e,t,-a]),i=new Float32Array([0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),n=new Float32Array([1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0]),o=[0,2,1,3,5,4,6,8,7,9,11,10,12,14,13,15,17,16,18,20,19,21,23,22,24,26,25,27,29,28,30,32,31,33,35,34],l=new Uint16Array(o.reverse());this.setIndices(l),this.setAttribute(G.position,r),this.setAttribute(G.normal,i),this.setAttribute(G.uv,n),this.setAttribute(G.TEXCOORD_1,n),this.addSubGeometry({indexStart:0,indexCount:o.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0})}}class eu extends Ve{radiusTop;radiusBottom;height;radialSegments;heightSegments;openEnded;thetaStart;thetaLength;constructor(e=1,t=1,a=1,r=8,i=8,n=!1,o=0,l=Math.PI*2){super(),this.radiusTop=e,this.radiusBottom=t,this.height=a,this.radialSegments=r,this.heightSegments=i,this.openEnded=n,this.thetaStart=o,this.thetaLength=l,this.instanceID=Gt(),this.buildGeometry()}addGroup(e,t,a){this.addSubGeometry({indexStart:e,indexCount:t,vertexStart:e,vertexCount:0,firstStart:0,index:a,topology:0})}buildGeometry(){const e=this;this.radialSegments=Math.floor(this.radialSegments),this.heightSegments=Math.floor(this.heightSegments);const t=[],a=[],r=[],i=[];let n=0;const o=[],l=this.height/2;let c=0;A(),this.openEnded===!1&&(this.radiusTop>0&&m(!0),this.radiusBottom>0&&m(!1));let f=new Float32Array(t),h=new Float32Array(a),u=new Float32Array(r),g=new Uint16Array(i);this.setAttribute(G.position,f),this.setAttribute(G.normal,h),this.setAttribute(G.uv,u),this.setAttribute(G.TEXCOORD_1,u),this.setIndices(g);function A(){const p=new b,D=new b;let B=0;const v=(e.radiusBottom-e.radiusTop)/e.height;for(let C=0;C<=e.heightSegments;C++){const y=[],x=C/e.heightSegments,k=x*(e.radiusBottom-e.radiusTop)+e.radiusTop;for(let E=0;E<=e.radialSegments;E++){const S=E/e.radialSegments;let Q=S*e.thetaLength+e.thetaStart;E==e.radialSegments&&Math.abs(e.thetaLength-e.thetaStart)==Math.PI*2&&(Q=0);const I=Math.sin(Q),T=Math.cos(Q);D.x=k*I,D.y=-x*e.height+l,D.z=k*T,t.push(D.x,D.y,D.z),p.set(I,v,T).normalize(),a.push(p.x,p.y,p.z),r.push(S,1-x),y.push(n++)}o.push(y)}for(let C=0;C<e.radialSegments;C++)for(let y=0;y<e.heightSegments;y++){const x=o[y][C],k=o[y+1][C],E=o[y+1][C+1],S=o[y][C+1];i.push(x,k,S),i.push(k,E,S),B+=6}e.addGroup(c,B,0),c+=B}function m(p){const D=n,B=new de,v=new b;let C=0;const y=p===!0?e.radiusTop:e.radiusBottom,x=p===!0?1:-1;for(let E=1;E<=e.radialSegments;E++)t.push(0,l*x,0),a.push(0,x,0),r.push(.5,.5),n++;const k=n;for(let E=0;E<=e.radialSegments;E++){const Q=E/e.radialSegments*e.thetaLength+e.thetaStart,I=Math.cos(Q),T=Math.sin(Q);v.x=y*T,v.y=l*x,v.z=y*I,t.push(v.x,v.y,v.z),a.push(0,x,0),B.x=I*.5+.5,B.y=T*.5*x+.5,r.push(B.x,B.y),n++}for(let E=0;E<e.radialSegments;E++){const S=D+E,Q=k+E;p===!0?i.push(Q,Q+1,S):i.push(Q+1,Q,S),C+=3}e.addGroup(c,C,p===!0?1:2),c+=C}}}class tu extends Ve{radius;tube;radialSegments;tubularSegments;constructor(e=.4,t=.1,a=32,r=32){super(),this.radius=e,this.tube=t,this.radialSegments=a,this.tubularSegments=r,this.initVertex()}initVertex(){const e=2*Math.PI,t=this.radius,a=this.tube,r=this.radialSegments,i=this.tubularSegments;this.bounds=new xe(b.ZERO.clone(),new b(t*2,a*2,t*2));var n=(r+1)*(i+1);let o=new Float32Array(n*3),l=new Float32Array(n*3),c=new Float32Array(n*2),f=new Uint16Array(r*i*2*3),h=0,u=0,g=0,A=0;for(let m=0;m<=r;m++)for(let p=0;p<=i;p++){const D=p/i,B=m/r,v=D*e,C=B*Math.PI*2;if(o[h++]=(t+a*Math.cos(C))*Math.sin(v),o[h++]=a*Math.sin(C),o[h++]=(t+a*Math.cos(C))*Math.cos(v),l[u++]=Math.sin(v)*Math.cos(C),l[u++]=Math.sin(C),l[u++]=Math.cos(v)*Math.cos(C),c[g++]=D,c[g++]=B,p<i&&m<r){const y=i+1,x=y*m+p,k=y*(m+1)+p,E=y*(m+1)+p+1,S=y*m+p+1;f[A++]=x,f[A++]=S,f[A++]=k,f[A++]=S,f[A++]=E,f[A++]=k}}this.setIndices(f),this.setAttribute(G.position,o),this.setAttribute(G.normal,l),this.setAttribute(G.uv,c),this.setAttribute(G.TEXCOORD_1,c),this.addSubGeometry({indexStart:0,indexCount:f.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0})}}class rp extends Ve{segment;row=0;constructor(e){super(),this.segment=e,this.buildGeometry()}buildGeometry(){this.row=this.segment+1;let e=new Uint32Array(this.segment*6),t=new Float32Array(this.row*3*2),a=new Float32Array(this.row*3*2),r=new Float32Array(this.row*2*2);for(let i=0;i<this.row;i++){t[i*3*2+0]=0,t[i*3*2+1]=0,t[i*3*2+2]=0,t[i*3*2+3]=0,t[i*3*2+4]=0,t[i*3*2+5]=0,a[i*3*2+0]=0,a[i*3*2+1]=0,a[i*3*2+2]=1,a[i*3*2+3]=0,a[i*3*2+4]=0,a[i*3*2+5]=1,r[i*2*2+0]=0,r[i*2*2+1]=i/this.segment,r[i*2*2+2]=1,r[i*2*2+3]=i/this.segment;let n=i*2,o=n,l=n+1,c=n+2,f=n+3;e[i*6+0]=o,e[i*6+1]=l,e[i*6+2]=c,e[i*6+3]=l,e[i*6+4]=f,e[i*6+5]=c}this.setIndices(e),this.setAttribute(G.position,t),this.setAttribute(G.normal,a),this.setAttribute(G.uv,r),this.setAttribute(G.TEXCOORD_1,r),this.addSubGeometry({indexStart:0,indexCount:e.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0})}}class ip extends Ve{faceCount=0;constructor(e){super(),this.faceCount=e,this.buildGeometry()}buildGeometry(){let e=new Uint32Array(this.faceCount*3),t=new Float32Array(this.faceCount*3*3),a=new Float32Array(this.faceCount*3*3),r=new Float32Array(this.faceCount*3*2),i=new Float32Array(this.faceCount*3*1);for(let n=0;n<this.faceCount;n++){let o=n*3+0,l=n*3+1,c=n*3+2;e[o]=o,e[l]=l,e[c]=c}this.setIndices(e),this.setAttribute(G.position,t),this.setAttribute(G.normal,a),this.setAttribute(G.uv,r),this.setAttribute(G.TEXCOORD_1,r),this.setAttribute(G.vIndex,i),this.addSubGeometry({indexStart:0,indexCount:e.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0})}}class np extends Sn{_internalTexture;_minSize=32;_skyColor;constructor(e){super(),this._skyColor=e,this._internalTexture=new _s;let t=[];return _.res.fillColor(t,this._minSize,this._minSize,this.color.r,this.color.g,this.color.b,this.color.a),this._internalTexture.create(this._minSize,this._minSize,t,!1),this.createFromTexture(this._minSize,this._internalTexture),this}changeColor(e){return this._skyColor=e,_.res.fillColor(this._internalTexture.floatArray,this._minSize,this._minSize,this.color.r,this.color.g,this.color.b,this.color.a),this._internalTexture.updateTexture(this._minSize,this._minSize,this._internalTexture.floatArray,!1),this._faceData.uploadTexture(0,this._internalTexture),this}get color(){return this._skyColor}set color(e){this.changeColor(e)}}class sp extends d.Object3D{length=100;thickness=.1;constructor(e,t=.1){super(),this.length=e,this.thickness=t,this.init()}init(){let e=new d.Object3D,t=new d.Object3D,a=new d.Object3D,r=new La(2,2,2),i=new La(2,2,2),n=new La(2,2,2),o=new Bt;o.baseColor=new J(1,0,0);let l=new Bt;l.baseColor=new J(0,1,0);let c=new Bt;c.baseColor=new J(0,0,1);let f=e.addComponent(d.MeshRenderer),h=t.addComponent(d.MeshRenderer),u=a.addComponent(d.MeshRenderer);f.geometry=r,f.material=o,f.castShadow=!1,h.geometry=i,h.material=l,h.castShadow=!1,u.geometry=n,u.material=c,u.castShadow=!1,e.localScale=new b(this.length,this.thickness,this.thickness),e.x=this.length,t.localScale=new b(this.thickness,this.length,this.thickness),t.y=this.length,a.localScale=new b(this.thickness,this.thickness,this.length),a.z=this.length,this.addChild(e),this.addChild(t),this.addChild(a)}}class op{static merge(e,t,a){}static mergeNumber(e,t,a){let r=a||new Ve,i=e.getAttribute(G.position).data.length/3,n=new Float32Array(i*t);for(const f of e.vertexAttributeMap){let h=f[1].attribute;if(h==G.indices)continue;let u=e.getAttribute(h).data,g=u.length,A=new Float32Array(g*t);for(let m=0;m<t;m++){A.set(u,g*m);for(let p=0;p<i;p++)n[i*m+p]=m}r.setAttribute(h,A)}r.setAttribute(G.vIndex,n);let o=e.getAttribute(G.indices).data,l=o.length,c=new Uint32Array(o.length*t);for(let f=0;f<t;f++)for(let h=0;h<l;h++){let u=f*i,g=f*l;const A=o[h]+u;c[g+h]=A}return r.setIndices(c),r.addSubGeometry({indexStart:0,indexCount:c.length,vertexStart:0,index:0,vertexCount:0,firstStart:0,topology:0}),r}static generateNormal(){}static generateTangent(){}static packUV(){}}class lp extends d.Object3D{size=100;divisions=10;constructor(e=100,t=10){super(),this.size=e,this.divisions=t,this.buildGeometry(),this.addAxis()}buildGeometry(){const e=[],t=[],a=this.size/this.divisions,r=this.size/2,i=this.divisions/2;for(let c=0,f=-r;c<=this.divisions;c++,f+=a)c!==i&&(e.push(-r,0,f,r,0,f),e.push(f,0,-r,f,0,r));for(let c=0;c<e.length/3;c+=2)t.push(c,c+1);let n=new Ve;n.setIndices(t.length>Uint16Array.length?new Uint32Array(t):new Uint16Array(t)),n.setAttribute(G.position,new Float32Array(e)),n.addSubGeometry({indexStart:0,indexCount:t.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0});let o=new Bt;o.topology="line-list",o.baseColor=new J(1,1,1,.15),o.blendMode=me.ADD,o.castReflection=!1;let l=this.addComponent(d.MeshRenderer);l.geometry=n,l.material=o}addAxis(){const e=this.size/2;let t=new Float32Array([-e,0,0,e,0,0]),a=new Uint16Array([0,1,2,3]),r=new Ve;r.setIndices(a),r.setAttribute(G.position,t),r.addSubGeometry({indexStart:0,indexCount:a.length,vertexStart:0,vertexCount:0,firstStart:0,index:0,topology:0});{let i=new d.Object3D,n=i.addComponent(d.MeshRenderer);n.geometry=r;let o=n.material=new Bt;o.baseColor=new J(1,0,0,.5),o.blendMode=me.ADD,o.castReflection=!1,o.topology="line-list",this.addChild(i)}{let i=new d.Object3D;i.rotationY=90;let n=i.addComponent(d.MeshRenderer);n.geometry=r;let o=n.material=new Bt;o.baseColor=new J(0,1,0,.5),o.blendMode=me.ADD,o.castReflection=!1,o.topology="line-list",this.addChild(i)}}}class cp{static color_temperature_to_rgb(e){e<1e3?e=1e3:e>4e4&&(e=4e4);let t=e/100,a=this.get_red(t),r=this.get_green(t),i=this.get_blue(t);return new J(a/255,r/255,i/255,1)}static get_red(e){if(e<=66)return 255;let t=329.698727446*Math.pow(e-60,-.1332047592);return this.bound(t)}static get_green(e){let t=0;return e<=66?t=99.4708025861*Math.log(e)-161.1195681661:t=288.1221695283*Math.pow(e-60,-.0755148492),this.bound(t)}static get_blue(e){let t=0;return e>=66?255:e<=19?0:(t=138.5177312231*Math.log(e-10)-305.0447927307,this.bound(t))}static bound(e,t=0,a=255){let r=Math.max(e,t);return Math.min(r,a)}}class fp{static boxGeo;static planeGeo;static sphere;static material;static materialMap;static initHeap(){this.boxGeo||(this.boxGeo=new La),this.planeGeo||(this.planeGeo=new $r(1,1,1,1,b.UP)),this.sphere||(this.sphere=new Ir(1,35,35)),this.material||(this.material=new qt),this.materialMap||(this.materialMap=new Map)}static get CubeMesh(){return this.initHeap(),this.boxGeo}static get SphereMesh(){return this.initHeap(),this.sphere}static GetCube(){this.initHeap();let e=new d.Object3D,t=e.addComponent(d.MeshRenderer);return t.geometry=this.boxGeo,t.material=this.material.clone(),t.castShadow=!0,e}static GetMaterial(e){let t=this.materialMap.get(e);return t||(t=new qt,t.baseMap=e,this.materialMap.set(e,t)),t.clone()}static GetPlane(e){this.initHeap();let t=new d.Object3D,a=t.addComponent(d.MeshRenderer);a.geometry=this.planeGeo;let r=this.GetMaterial(e);return r.blendMode=me.ADD,r.castShadow=!1,a.material=r,a.castGI=!1,a.castReflection=!1,t}static GetSingleCube(e,t,a,r,i,n){this.initHeap();let o=new qt;o.roughness=.5,o.metallic=.1,o.baseColor=new J(r,i,n,1);let l=new d.Object3D,c=l.addComponent(d.MeshRenderer);return c.castGI=!0,c.geometry=new La(e,t,a),c.material=o,l}static GetSingleSphere(e,t,a,r){this.initHeap();let i=new qt;i.baseColor=new J(t,a,r,1);let n=new d.Object3D,o=n.addComponent(d.MeshRenderer);return o.castGI=!0,o.geometry=new Ir(e,20,20),o.material=i,n}static get Sphere(){this.initHeap();let e=new d.Object3D,t=e.addComponent(d.MeshRenderer);return t.geometry=this.sphere,t.material=this.material,e}static GetSingleCube2(e,t=10){this.initHeap();let a=new d.Object3D,r=a.addComponent(d.MeshRenderer);return r.castShadow=!1,r.geometry=new La(t,t,t),r.material=e,a}static GetPointLight(e,t,a,r,i,n,o=1,l=!0){let c=new d.Object3D,f=c.addComponent(d.PointLight);f.lightColor=new J(r,i,n,1),f.intensity=o,f.range=a,f.at=8,f.radius=0,f.castShadow=l,c.localPosition=e,c.localRotation=t;let h=this.GetSingleSphere(.1,1,1,1);return c.addChild(h),f}}var N=(s=>(s[s.X=0]="X",s[s.Y=1]="Y",s[s.Z=2]="Z",s[s.XY=3]="XY",s[s.XZ=4]="XZ",s[s.YZ=5]="YZ",s[s.XYZ=6]="XYZ",s[s.MAX=7]="MAX",s[s.NONE=8]="NONE",s))(N||{}),ha=(s=>(s[s.Local=0]="Local",s[s.Global=1]="Global",s))(ha||{});class Jn extends qe{mAxis;mAxisColor;mContainer;mAxisMaterial;mAxisCollider;constructor(){super(),this._enable=!1,this.mAxis=new Array(N.MAX),this.mAxisColor=new Array(N.MAX),this.mAxisMaterial=new Array(N.MAX),this.mAxisCollider=new Array(N.MAX)}get target(){return this.object3D.target}get mX(){return this.object3D.mXObj}get mY(){return this.object3D.mYObj}get mZ(){return this.object3D.mZObj}get transformSpaceMode(){return this.object3D.transformSpaceMode}init(e){this.mContainer=new d.Object3D;let t=new Bt;t.baseColor=new J(1,0,0),t.depthCompare=ot.always,this.mAxisColor[N.X]=t.baseColor,this.mAxisMaterial[N.X]=t;let a=new Bt;a.baseColor=new J(0,1,0),a.depthCompare=ot.always,this.mAxisColor[N.Y]=a.baseColor,this.mAxisMaterial[N.Y]=a;let r=new Bt;r.baseColor=new J(0,0,1),r.depthCompare=ot.always,this.mAxisColor[N.Z]=r.baseColor,this.mAxisMaterial[N.Z]=r;let i=this.createCustomAxis(N.X),n=this.createCustomAxis(N.Y),o=this.createCustomAxis(N.Z);this.mContainer.addChild(this.mAxis[N.X]=i),this.mContainer.addChild(this.mAxis[N.Y]=n),this.mContainer.addChild(this.mAxis[N.Z]=o),this.mAxisCollider[N.X]=i.getComponent(fa),this.mAxisCollider[N.Y]=n.getComponent(fa),this.mAxisCollider[N.Z]=o.getComponent(fa)}start(){}onEnable(e){this.object3D.addChild(this.mContainer),this.reset()}onDisable(e){this.object3D.removeChild(this.mContainer)}reset(){switch(this.transformSpaceMode){case ha.Local:{let t=R.help_matrix_0.copyFrom(this.mX.transform.worldMatrix).decompose();this.object3D.scaleX=1,this.object3D.scaleY=1,this.object3D.scaleZ=1,this.object3D.rotationX=t[1].x,this.object3D.rotationY=t[1].y,this.object3D.rotationZ=t[1].z,this.object3D.x=t[0].x,this.object3D.y=t[0].y,this.object3D.z=t[0].z}break;case ha.Global:{this.object3D.scaleX=1,this.object3D.scaleY=1,this.object3D.scaleZ=1,this.object3D.rotationX=0,this.object3D.rotationY=0,this.object3D.rotationZ=0;const e=this.mX.transform.worldPosition;this.object3D.x=e.x,this.object3D.y=e.y,this.object3D.z=e.z}break}}pickAxis(){let a=this.object3D.transform.scene3D.view.camera.screenPointToRay(_.inputSystem.mouseX,_.inputSystem.mouseY),r,i;for(let n=0;n<=N.MAX;n++){let o=this.mAxisCollider[n];if(o&&(r=o.rayPick(a),r&&(!i||i.distance>r.distance||n==N.XYZ)&&(i={axis:n,obj:o.object3D,distance:r.distance,intersectPoint:r.intersectPoint},n==N.XYZ)))break}return i}currentAxis=N.NONE;beginPoint=new b;beginMousePos=new b;currentPoint=new b;onMouseDown(e){if(e.mouseCode!=Qn.MOUSE_LEFT)return;let t=this.pickAxis();if(!t)return;this.currentAxis=t.axis,e.stopImmediatePropagation();const r=this.object3D.transform.scene3D.view.camera;let i=r.worldToScreenPoint(this.mX.transform.worldPosition),n=r.screenPointToWorld(_.inputSystem.mouseX,_.inputSystem.mouseY,i.z);this.beginPoint.copyFrom(n),this.beginMousePos.x=_.inputSystem.mouseX,this.beginMousePos.y=_.inputSystem.mouseY}lastMoveObj;lastMoveAxis;onMouseMove(e){if(this.currentAxis==N.NONE){let t=this.lastMoveObj.getComponent(d.MeshRenderer).material;this.lastMoveObj&&"baseColor"in t&&(t.baseColor=this.mAxisColor[this.lastMoveAxis],this.lastMoveObj=null,this.lastMoveAxis==N.XYZ&&(this.mAxis[N.X].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",this.mAxisColor[N.X]),this.mAxis[N.Y].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",this.mAxisColor[N.Y]),this.mAxis[N.Z].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",this.mAxisColor[N.Z])),this.lastMoveAxis=N.NONE);let a=this.pickAxis();if(!a)return;t.setUniformColor("baseColor",new J(1,1,1)),this.lastMoveObj=a.obj,this.lastMoveAxis=a.axis,this.lastMoveAxis==N.XYZ&&(this.mAxis[N.X].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",new J(1,1,1)),this.mAxis[N.Y].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",new J(1,1,1)),this.mAxis[N.Z].getComponent(d.MeshRenderer).material.setUniformColor("baseColor",new J(1,1,1)))}else{const a=this.object3D.transform.scene3D.view.camera;let r=a.worldToScreenPoint(this.mX.transform.worldPosition),i=a.screenPointToWorld(_.inputSystem.mouseX,_.inputSystem.mouseY,r.z);this.currentPoint.copyFrom(i);let n=i.subtract(this.beginPoint);b.HELP_0.set(_.inputSystem.mouseX,_.inputSystem.mouseY,0);let o=b.distance(b.HELP_0,this.beginMousePos);switch(this.beginMousePos.copyFrom(b.HELP_0),this.transformSpaceMode){case ha.Local:this.applyLocalTransform(this.currentAxis,n,o);break;case ha.Global:this.applyGlobalTransform(this.currentAxis,n,o);break}this.beginPoint.copyFrom(i),this.reset()}}onMouseUp(e){e.mouseCode==Qn.MOUSE_LEFT&&(this.currentAxis=N.NONE,this.reset())}onUpdate(e){let a=b.distance(e.camera.transform.worldPosition,this.object3D.transform.worldPosition)/100;if(this.mContainer.scaleX=this.mContainer.scaleY=this.mContainer.scaleZ=a,this.mX){const r=this.mX.transform.worldPosition;this.object3D.x=r.x,this.object3D.y=r.y,this.object3D.z=r.z}}applyLocalTransform(e,t,a){console.warn("not imp")}applyGlobalTransform(e,t,a){console.warn("not imp")}createCustomAxis(e){return this.createAxis(e)}createAxis(e){let t=0,a=0,r=0;switch(e){case N.X:t=1;break;case N.Y:a=1;break;case N.Z:r=1;break}let i=.4+t*20,n=.4+a*20,o=.4+r*20,l=new d.Object3D;l.x=i*.5,l.y=n*.5,l.z=o*.5;let c=l.addComponent(d.MeshRenderer);c.geometry=new La(i,n,o),c.material=this.mAxisMaterial[e];let f=l.addComponent(fa),h=new oi;return h.setFromCenterAndSize(new b(0,0,0),new b(i+1,n+1,o+1)),f.shape=h,l}}class au extends Jn{init(e){super.init(e);let t=new Bt;t.doubleSide=!0,t.baseColor=new J(.9,.9,.9),t.depthCompare=ot.always,this.mAxisColor[N.XYZ]=t.baseColor,this.mAxisMaterial[N.XYZ]=t;let a=new d.Object3D,r=a.addComponent(d.MeshRenderer);r.geometry=new La(2,2,2),r.material=this.mAxisMaterial[N.XYZ];let i=a.addComponent(fa),n=new oi;n.setFromCenterAndSize(new b(0,0,0),new b(2,2,2)),i.shape=n,this.mContainer.addChild(this.mAxis[N.XYZ]=a),this.mAxisCollider[N.XYZ]=a.getComponent(fa)}applyLocalTransform(e,t,a){switch(this.currentAxis){case N.XYZ:{let r=0;Math.abs(t.x)>Math.abs(t.y)?Math.abs(t.x)>Math.abs(t.z)?r=t.x:r=t.z:r=t.y,this.mX.scaleX+=r,this.mX.scaleY+=r,this.mX.scaleZ+=r}break;default:this.mX.transform.worldMatrix.transformVector(t,t),(this.currentAxis==N.X||this.currentAxis==N.XY||this.currentAxis==N.XZ)&&(this.mX.scaleX=Math.abs(this.mX.scaleX+t.x)),(this.currentAxis==N.Y||this.currentAxis==N.XY||this.currentAxis==N.YZ)&&(this.mX.scaleY=Math.abs(this.mX.scaleY+t.y)),(this.currentAxis==N.Z||this.currentAxis==N.XZ||this.currentAxis==N.YZ)&&(this.mX.scaleZ=Math.abs(this.mX.scaleZ+t.z));break}}applyGlobalTransform(e,t,a){let r=b.HELP_0;r.set(0,0,0),(this.currentAxis==N.X||this.currentAxis==N.XY||this.currentAxis==N.XZ)&&(r.x=t.x),(this.currentAxis==N.Y||this.currentAxis==N.XY||this.currentAxis==N.YZ)&&(r.y=t.y),(this.currentAxis==N.Z||this.currentAxis==N.XZ||this.currentAxis==N.YZ)&&(r.z=t.z),this.mX.transform.worldMatrix.transformVector(r,b.HELP_1),this.mX.scaleX+=b.HELP_1.x,this.mX.scaleY+=b.HELP_1.y,this.mX.scaleZ+=b.HELP_1.z}createCustomAxis(e){let t=super.createAxis(e),a=this.createBox(e);return t.addChild(a),t}createBox(e){let t=0,a=0,r=0,i=new d.Object3D;switch(e){case N.X:t=1,i.rotationZ=-90;break;case N.Y:a=1;break;case N.Z:r=1,i.rotationX=90;break}let n=.2+t*20,o=.2+a*20,l=.2+r*20;i.x=n*.5,i.y=o*.5,i.z=l*.5;let c=i.addComponent(d.MeshRenderer);return c.geometry=new La(2,2,2),c.material=this.mAxisMaterial[e],i}}var mt=(s=>(s[s.Scale=0]="Scale",s[s.Rotation=1]="Rotation",s[s.Translation=2]="Translation",s[s.NONE=3]="NONE",s))(mt||{});class ru extends Jn{applyLocalTransform(e,t,a){if(this.currentAxis==N.X||this.currentAxis==N.XY||this.currentAxis==N.XZ,this.currentAxis==N.Y||this.currentAxis==N.XY||this.currentAxis==N.YZ){R.help_matrix_0.copyFrom(this.mX.transform.worldMatrix),R.help_matrix_1.identity(),R.help_matrix_1.createByRotation(1,b.Y_AXIS),R.help_matrix_2.multiplyMatrices(R.help_matrix_1,R.help_matrix_0),R.help_matrix_2.invert(),R.help_matrix_1.multiplyMatrices(R.help_matrix_2,R.help_matrix_0);let r=R.help_matrix_1.decompose();this.mX.rotationX+=r[1].x,this.mY.rotationY+=r[1].y,this.mZ.rotationZ+=r[1].z}this.currentAxis==N.Z||this.currentAxis==N.XZ||this.currentAxis==N.YZ}getAngle(){const t=this.object3D.transform.scene3D.view.camera,a=this.mZ.transform.worldPosition;if(t.screenPointToRay(_.inputSystem.mouseX,_.inputSystem.mouseY),this.currentAxis==N.X){let r=t.worldToScreenPoint(a);b.HELP_1.set(r.x,r.y,0),b.HELP_2.set(_.inputSystem.mouseX,_.inputSystem.mouseY,0);let i=b.HELP_2.subtract(b.HELP_1),n=b.getAngle(b.X_AXIS,i);return i.y>0&&(n=360-n),t.transform.worldPosition.x-a.x>0&&(n=360-n),n}if(this.currentAxis==N.Y){let r=t.worldToScreenPoint(a);b.HELP_1.set(r.x,r.y,0),b.HELP_2.set(_.inputSystem.mouseX,_.inputSystem.mouseY,0);let i=b.HELP_2.subtract(b.HELP_1),n=b.getAngle(b.X_AXIS,i);return i.y>0&&(n=360-n),t.transform.worldPosition.y-a.y>0&&(n=360-n),n}if(this.currentAxis==N.Z){let r=t.worldToScreenPoint(a);b.HELP_1.set(r.x,r.y,0),b.HELP_2.set(_.inputSystem.mouseX,_.inputSystem.mouseY,0);let i=b.HELP_2.subtract(b.HELP_1),n=b.getAngle(b.X_AXIS,i);return i.y>0&&(n=360-n),t.transform.worldPosition.z-a.z>0&&(n=360-n),n}return 0}mLastAngle=0;applyGlobalTransform(e,t,a){if(this.currentAxis==N.X||this.currentAxis==N.Y||this.currentAxis==N.Z){let r=this.getAngle();switch(R.help_matrix_0.identity(),this.currentAxis){case N.X:R.help_matrix_0.createByRotation(this.mLastAngle-r,b.X_AXIS);break;case N.Y:R.help_matrix_0.createByRotation(this.mLastAngle-r,b.Y_AXIS);break;case N.Z:R.help_matrix_0.createByRotation(this.mLastAngle-r,b.Z_AXIS);break}R.help_matrix_1.copyFrom(this.mX.transform.worldMatrix),R.help_matrix_1.append(R.help_matrix_0),this.mX.parent&&(R.help_matrix_2.copyFrom(this.mX.parent.worldMatrix),R.help_matrix_2.invert(),R.help_matrix_1.multiply(R.help_matrix_2));let n=R.help_matrix_1.decompose(ia.QUATERNION)[1];ae.HELP_0.set(n.x,n.y,n.z,n.w),this.mLastAngle=r,this.mX.transform.localRotQuat=ae.HELP_0}}onMouseDown(e){super.onMouseDown(e),this.currentAxis!=N.NONE&&(this.mAxis[N.X].getComponent(d.MeshRenderer).enable=!1,this.mAxis[N.Y].getComponent(d.MeshRenderer).enable=!1,this.mAxis[N.Z].getComponent(d.MeshRenderer).enable=!1,this.mAxis[this.currentAxis].getComponent(d.MeshRenderer).enable=!0,this.mLastAngle=this.getAngle())}onMouseUp(e){super.onMouseUp(e),this.currentAxis==N.NONE&&(this.mAxis[N.X].getComponent(d.MeshRenderer).enable=!0,this.mAxis[N.Y].getComponent(d.MeshRenderer).enable=!0,this.mAxis[N.Z].getComponent(d.MeshRenderer).enable=!0)}createCustomAxis(e){return this.createAxis(e)}createAxis(e){let t=new d.Object3D;switch(e){case N.X:t.rotationZ=90;break;case N.Y:break;case N.Z:t.rotationX=90;break}let a=t.addComponent(d.MeshRenderer);a.geometry=new tu(20,.4),a.material=this.mAxisMaterial[e];let r=t.addComponent(fa),i=new oi;return i.setFromCenterAndSize(new b,new b(40,.4,40)),r.shape=i,t}pickAxis(){let a=this.object3D.transform.scene3D.view.camera.screenPointToRay(_.inputSystem.mouseX,_.inputSystem.mouseY),r,i;for(let n=0;n<=N.MAX;n++){let o=this.mAxisCollider[n];if(o&&(r=o.rayPick(a),r)){let l=b.distance(r.intersectPoint,o.shape.center);if(l>20+.8||l<20-.8)continue;(!i||i.distance>r.distance)&&(i={axis:n,obj:o.object3D,distance:r.distance,intersectPoint:r.intersectPoint})}}return i}}class iu extends Jn{init(e){super.init(e);let t=new Bt;t.doubleSide=!0,t.baseColor=new J(0,0,1),t.depthCompare=ot.always,this.mAxisColor[N.XY]=t.baseColor,this.mAxisMaterial[N.XY]=t;let a=new Bt;a.doubleSide=!0,a.baseColor=new J(0,1,0),a.depthCompare=ot.always,this.mAxisColor[N.XZ]=a.baseColor,this.mAxisMaterial[N.XZ]=a;let r=new Bt;r.doubleSide=!0,r.baseColor=new J(1,0,0),r.depthCompare=ot.always,this.mAxisColor[N.YZ]=r.baseColor,this.mAxisMaterial[N.YZ]=r;let i=this.createPlane(N.XY),n=this.createPlane(N.XZ),o=this.createPlane(N.YZ);this.mContainer.addChild(this.mAxis[N.XY]=i),this.mContainer.addChild(this.mAxis[N.XZ]=n),this.mContainer.addChild(this.mAxis[N.YZ]=o),this.mAxisCollider[N.XY]=i.getComponent(fa),this.mAxisCollider[N.XZ]=n.getComponent(fa),this.mAxisCollider[N.YZ]=o.getComponent(fa)}applyLocalTransform(e,t,a){R.help_matrix_0.copyFrom(this.mX.transform.worldMatrix).invert(),R.help_matrix_0.transformVector(t,b.HELP_0),this.currentAxis==N.X||this.currentAxis==N.XY||this.currentAxis==N.XZ||(b.HELP_0.x=0),this.currentAxis==N.Y||this.currentAxis==N.XY||this.currentAxis==N.YZ||(b.HELP_0.y=0),this.currentAxis==N.Z||this.currentAxis==N.XZ||this.currentAxis==N.YZ||(b.HELP_0.z=0),this.mX.transform.worldMatrix.transformVector(b.HELP_0,b.HELP_1),this.mX.x+=b.HELP_1.x,this.mX.y+=b.HELP_1.y,this.mX.z+=b.HELP_1.z}applyGlobalTransform(e,t,a){R.help_matrix_0.identity(),(this.currentAxis==N.X||this.currentAxis==N.XY||this.currentAxis==N.XZ)&&R.help_matrix_0.appendTranslation(t.x,0,0),(this.currentAxis==N.Y||this.currentAxis==N.XY||this.currentAxis==N.YZ)&&R.help_matrix_0.appendTranslation(0,t.y,0),(this.currentAxis==N.Z||this.currentAxis==N.XZ||this.currentAxis==N.YZ)&&R.help_matrix_0.appendTranslation(0,0,t.z),R.help_matrix_1.copyFrom(this.mX.transform.worldMatrix),R.help_matrix_1.append(R.help_matrix_0),this.mX.parent&&(R.help_matrix_2.copyFrom(this.mX.parent.worldMatrix),R.help_matrix_2.invert(),R.help_matrix_1.multiply(R.help_matrix_2));let r=R.help_matrix_1.decompose(ia.QUATERNION);this.mX.transform.localPosition=r[0],console.log(this.target.localPosition)}createCustomAxis(e){let t=super.createAxis(e),a=this.createArrows(e);return t.addChild(a),t}createArrows(e){let t=0,a=0,r=0,i=new d.Object3D;switch(e){case N.X:t=1,i.rotationZ=-90;break;case N.Y:a=1,i.rotationY=-90;break;case N.Z:r=1,i.rotationX=90;break}let n=.2+t*20,o=.2+a*20,l=.2+r*20;i.x=n*.5,i.y=o*.5,i.z=l*.5;let c=i.addComponent(d.MeshRenderer);return c.geometry=new eu(0,1,4),c.material=this.mAxisMaterial[e],i}createPlane(e){let t=new d.Object3D,a=t.addComponent(d.MeshRenderer);a.material=this.mAxisMaterial[e];let r=t.addComponent(fa),i=new oi;switch(r.shape=i,e){case N.XY:a.geometry=new $r(4,4,1,1,b.Z_AXIS),t.x=8,t.y=8,i.setFromCenterAndSize(new b(0,0,0),new b(4,4,.1));break;case N.XZ:a.geometry=new $r(4,4,1,1,b.Y_AXIS),t.x=8,t.z=8,i.setFromCenterAndSize(new b(0,0,0),new b(4,.1,4));break;case N.YZ:a.geometry=new $r(4,4,1,1,b.X_AXIS),t.y=8,t.z=8,i.setFromCenterAndSize(new b(0,0,0),new b(.1,4,4));break}return t}}class jo extends d.Object3D{static _instance;static get instance(){return this._instance||(this._instance=new jo),this._instance}mTarget;mTransformMode=mt.NONE;mTransformSpaceType=ha.Global;mControllers;mXObj;mYObj;mZObj;constructor(){super(),this.mControllers=[null,null,null],this.mControllers[mt.Scale]=this.addComponent(au),this.mControllers[mt.Rotation]=this.addComponent(ru),this.mControllers[mt.Translation]=this.addComponent(iu),this.mControllers[mt.Scale].enable=!1,this.mControllers[mt.Rotation].enable=!1,this.mControllers[mt.Translation].enable=!1,this.mXObj=new d.Object3D,this.mYObj=new d.Object3D,this.mZObj=new d.Object3D,this.mXObj.addChild(this.mYObj),this.mYObj.addChild(this.mZObj)}get transformMode(){return this.mTransformMode}get transformSpaceMode(){return this.mTransformSpaceType}active(e){e.addChild(this),e.addChild(this.mXObj)}unActive(e){e.removeChild(this)}get target(){return this.mTarget}selectObject(e,t,a){this.mTarget!=e&&(e?this.activate():this.unactivate(),this.mTarget=e,this.mXObj.localPosition=e.transform.worldPosition.clone()),t!=null&&this.selectTransformMode(t),a!=null&&this.selectTransformSpaceMode(a)}selectTransformMode(e){this.mTransformMode!=e&&(this.mTransformMode!=mt.NONE&&(this.mControllers[this.mTransformMode].enable=!1),this.mTransformMode=e,this.mTransformMode!=mt.NONE&&(this.mControllers[this.mTransformMode].enable=!0))}selectTransformSpaceMode(e){this.mTransformSpaceType!=e&&(this.mTransformSpaceType=e,this.mTransformMode!=mt.NONE&&this.mControllers[this.mTransformMode].reset())}activate(){_.inputSystem.addEventListener(wa.KEY_DOWN,this.onKeyDown,this),_.inputSystem.addEventListener(j.POINTER_DOWN,this.onMouseDown,this,null,99999),_.inputSystem.addEventListener(j.POINTER_MOVE,this.onMouseMove,this,null,99999),_.inputSystem.addEventListener(j.POINTER_UP,this.onMouseUp,this,null,99999)}unactivate(){_.inputSystem.removeEventListener(wa.KEY_DOWN,this.onKeyDown,this),_.inputSystem.removeEventListener(j.POINTER_DOWN,this.onMouseDown,this),_.inputSystem.removeEventListener(j.POINTER_MOVE,this.onMouseMove,this),_.inputSystem.removeEventListener(j.POINTER_UP,this.onMouseUp,this)}onKeyDown(e){switch(e.keyCode){case et.Key_R:this.selectTransformMode(mt.Scale),this.selectTransformSpaceMode(ha.Local);break;case et.Key_E:this.selectTransformMode(mt.Rotation),this.selectTransformSpaceMode(ha.Global);break;case et.Key_W:this.selectTransformMode(mt.Translation),this.selectTransformSpaceMode(ha.Global);break;case et.Key_A:this.selectTransformSpaceMode(ha.Local);break;case et.Key_S:this.selectTransformSpaceMode(ha.Global);break}}onMouseDown(e){this.mTransformMode!=mt.NONE&&this.mControllers[this.mTransformMode].onMouseDown(e)}onMouseMove(e){this.mTransformMode!=mt.NONE&&this.mControllers[this.mTransformMode].onMouseMove(e)}onMouseUp(e){this.mTransformMode!=mt.NONE&&this.mControllers[this.mTransformMode].onMouseUp(e)}}const dp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));d.AccelerateDecelerateInterpolator=P0,d.AccelerateInterpolator=M0,d.AnimationCurve=Ni,d.AnimationCurveT=yr,d.AnimationMonitor=Mr,d.AnimatorEventKeyframe=Gb,d.AnticipateInterpolator=L0,d.AnticipateOvershootInterpolator=Si,d.ArrayHas=du,d.ArrayItemIndex=hu,d.AtlasParser=Ef,d.AtmosphericComponent=Qb,d.AtmosphericScatteringSky=_d,d.AtmosphericScatteringSkySetting=Dd,d.AtmosphericScatteringSky_shader=Ad,d.AttributeAnimCurve=Fd,d.AxisObject=sp,d.B3DMLoader=qa,d.B3DMLoaderBase=pf,d.B3DMParseUtil=qs,d.B3DMParser=Hs,d.BRDFLUT=Uf,d.BRDFLUTGenerate=yf,d.BRDF_frag=Cl,d.BatchTable=Cn,d.BiMap=Nm,d.BillboardComponent=Mi,d.BillboardType=mr,d.BitUtil=ql,d.BitmapTexture2D=Ka,d.BitmapTexture2DArray=Ac,d.BitmapTextureCube=Ws,d.Blend=mc,d.BlendFactor=pc,d.BlendMode=me,d.BlendShapeData=Eo,d.BlendShapePropertyData=ko,d.BloomPost=Mg,d.BlurEffectCreatorBlur_cs=lf,d.BlurEffectCreatorSample_cs=of,d.BlurTexture2DBufferCreator=cf,d.BounceInterpolator=Kt,d.BoundUtil=vs,d.BoundingBox=xe,d.BoundingSphere=Qr,d.BoundingVolume=Vr,d.BoxColliderShape=oi,d.BoxGeometry=La,d.BrdfLut_frag=gl,d.BsDF_frag=xl,d.BxDF_frag=Sl,d.BxdfDebug_frag=wl,d.BytesArray=Pn,d.CEvent=bt,d.CEventDispatcher=Ja,d.CEventListener=rn,d.CResizeEvent=ir,d.CSM=ra,d.Camera3D=Hr,d.CameraControllerBase=Kb,d.CameraType=at,d.CameraUtil=dt,d.CapsuleColliderShape=gg,d.CastPointShadowMaterialPass=Rc,d.CastShadowMaterialPass=wc,d.Clearcoat_frag=Fl,d.ClusterBoundsSource_cs=d0,d.ClusterConfig=wt,d.ClusterDebug_frag=rl,d.ClusterLight=Vl,d.ClusterLightingBuffer=f0,d.ClusterLightingRender=u0,d.ClusterLighting_cs=h0,d.CollectInfo=Mc,d.ColliderComponent=fa,d.ColliderShape=ht,d.ColliderShapeType=si,d.Color=J,d.ColorGradient=Pm,d.ColorLitMaterial=Im,d.ColorLitShader=bd,d.ColorPassFragmentOutput=Cb,d.ColorPassRenderer=c0,d.ColorUtil=on,d.ComData=Vn,d.Combine_cs=od,d.Common_frag=ul,d.Common_vert=bl,d.ComponentBase=qe,d.ComponentCollect=Pe,d.ComputeGPUBuffer=ei,d.ComputeShader=ye,d.Context3D=Ho,d.CubeCamera=Fs,d.CubeMapFaceEnum=ff,d.CubeSky_Shader=qn,d.CubicBezierCurve=Gn,d.CubicBezierPath=Vm,d.CubicBezierType=Gh,d.CycleInterpolator=G0,d.CylinderGeometry=eu,d.DDGIIrradianceComputePass=F0,d.DDGIIrradianceGPUBufferReader=Yi,d.DDGIIrradianceVolume=t0,d.DDGIIrradiance_shader=x0,d.DDGILightingPass=R0,d.DDGILighting_shader=w0,d.DDGIMultiBouncePass=E0,d.DDGIProbeRenderer=I0,d.DEGREES_TO_RADIANS=pt,d.DRACO_DECODER_GLTF_JS=J0,d.DecelerateInterpolator=N0,d.Denoising_cs=ld,d.Depth2DTextureArray=p0,d.DepthCubeArrayTexture=g0,d.DepthMaterialPass=Ic,d.DepthOfFieldPost=Ng,d.DepthOfView_cs=Jf,d.DoubleArray=en,d.EditorInspector=jr,d.Engine3D=_,d.Entity=e0,d.EntityBatchCollect=Nc,d.EntityCollect=K,d.EnvMap_frag=ml,d.ErpImage2CubeMap=jt,d.ErpImage2CubeMapCreateCube_cs=df,d.ErpImage2CubeMapRgbe2rgba_cs=hf,d.ExtrudeGeometry=_g,d.FAILED=Br,d.FASTFLOOR=Ca,d.FXAAPost=ks,d.FXAAShader=y0,d.FastMathShader=Al,d.FatLineGeometry=eh,d.FatLineMaterial=Bh,d.FatLine_FS=ic,d.FatLine_VS=rc,d.FeatureTable=Ei,d.FileLoader=It,d.FirstPersonCameraController=qb,d.Float16ArrayTexture=_s,d.Float32ArrayTexture=$c,d.FlyCameraController=$b,d.FontChar=xf,d.FontInfo=Cf,d.FontPage=Sf,d.FontParser=$a,d.ForwardRenderJob=T0,d.FragmentOutput=ts,d.FragmentVarying=_l,d.FrameCache=fo,d.Frustum=ds,d.FrustumCSM=gc,d.FrustumCulling_cs=yb,d.FullQuad_vert_wgsl=Rl,d.GBufferFrame=_e,d.GBufferPass=Ec,d.GBufferPost=Pg,d.GBufferStand=$l,d.GBuffer_pass=as,d.GILighting=Gs,d.GIProbeMaterial=Kd,d.GIProbeMaterialType=Bo,d.GIProbeShader=gd,d.GIRenderCompleteEvent=Es,d.GIRenderStartEvent=An,d.GLBChunk=rf,d.GLBHeader=af,d.GLBParser=zs,d.GLSLLexer=Dc,d.GLSLLexerToken=Di,d.GLSLPreprocessor=_c,d.GLSLSyntax=yc,d.GLTFBinaryExtension=_f,d.GLTFMaterial=rm,d.GLTFParser=_t,d.GLTFSubParser=Bn,d.GLTFSubParserCamera=j0,d.GLTFSubParserConverter=tf,d.GLTFSubParserMaterial=Y0,d.GLTFSubParserMesh=Z0,d.GLTFSubParserSkeleton=Ls,d.GLTFSubParserSkin=X0,d.GLTFType=sa,d.GLTF_Accessors=k2,d.GLTF_Info=Dn,d.GLTF_Light=C2,d.GLTF_Mesh=F2,d.GLTF_Node=S2,d.GLTF_Primitives=x2,d.GLTF_Scene=y2,d.GPUAddressMode=Ht,d.GPUBlendFactor=uu,d.GPUBufferBase=ja,d.GPUBufferType=ga,d.GPUCompareFunction=ot,d.GPUContext=F,d.GPUCullMode=Nt,d.GPUFilterMode=lr,d.GPUPrimitiveTopology=sn,d.GPUTextureFormat=se,d.GPUVertexFormat=mi,d.GPUVertexStepMode=mu,d.GSplatFormat=di,d.GSplatGeometry=Zc,d.GSplatMaterial=Gc,d.GSplat_FS=Lc,d.GSplat_VS=Oc,d.GTAOPost=Vg,d.GTAO_cs=jf,d.GUIAtlasTexture=kf,d.GUICanvas=Li,d.GUIConfig=Tr,d.GUIGeometry=Qd,d.GUIGeometryRebuild=Md,d.GUIMaterial=go,d.GUIPassRenderer=Q0,d.GUIPick=Od,d.GUIPickHelper=zd,d.GUIQuad=Na,d.GUIQuadAttrEnum=nt,d.GUIRenderer=Nd,d.GUIShader=bo,d.GUISpace=ca,d.GUISprite=ai,d.GUITexture=br,d.GaussianSplatParser=em,d.GenerayRandomDir=Nl,d.GeoJsonParser=tm,d.GeoJsonUtil=am,d.GeoType=Mn,d.GeometryBase=Ve,d.GeometryIndicesBuffer=Jc,d.GeometryUtil=op,d.GeometryVertexBuffer=zc,d.GeometryVertexType=Ft,d.GetComponentClass=Ko,d.GetCountInstanceID=Hn,d.GetRepeat=Cu,d.GetShader=qo,d.GlassShader=Sb,d.GlobalBindGroup=ve,d.GlobalBindGroupLayout=hs,d.GlobalFog=Og,d.GlobalFog_shader=co,d.GlobalIlluminationComponent=cg,d.GlobalUniform=$n,d.GlobalUniformGroup=Us,d.GodRayPost=Lg,d.GodRay_cs=Zf,d.GridObject=lp,d.HDRTexture=js,d.HDRTextureCube=yn,d.Hair_frag=Ol,d.Hair_shader_op=xb,d.Hair_shader_tr=Fb,d.HaltonSeq=dn,d.Horizontal=jd,d.HoverCameraController=eg,d.I3DMLoader=Ba,d.I3DMLoaderBase=Bf,d.I3DMParser=$s,d.IBLEnvMapCreator=gf,d.IBLEnvMapCreator_cs=bf,d.IESProfiles=Aa,d.IESProfiles_frag=vl,d.IKDTreeUserData=Ug,d.ImageType=ni,d.IndicesGPUBuffer=Wc,d.Inline_vert=hl,d.InputSystem=Xo,d.InstanceDrawComponent=fg,d.InstanceUniform=pl,d.InstancedMesh=vf,d.Interpolator=ur,d.InterpolatorEnum=ws,d.IrradianceDataReaderCompleteEvent=dh,d.IrradianceVolumeData_frag=dl,d.Irradiance_frag=yl,d.IsEditorInspector=cu,d.IsNonSerialize=Yn,d.Joint=H0,d.JointPose=Os,d.JumperInterpolator=O0,d.KDTreeEntity=Cg,d.KDTreeNode=Ar,d.KDTreeRange=ah,d.KDTreeSpace=rh,d.KDTreeUUID=Zi,d.KHR_draco_mesh_compression=Vs,d.KHR_lights_punctual=im,d.KHR_materials_clearcoat=q0,d.KHR_materials_emissive_strength=$0,d.KHR_materials_ior=nm,d.KHR_materials_unlit=ef,d.KMZParser=Pf,d.KV=Fo,d.KelvinUtil=cp,d.KeyCode=et,d.KeyEvent=wa,d.Keyframe=kn,d.KeyframeT=$i,d.LASLoader=_h,d.LASParser=lm,d.LASUtils=Zt,d.LASVisualizationMode=hi,d.LDRTextureCube=Sn,d.LOADED=Va,d.LOADING=wo,d.LRUCache=Qh,d.LambertMaterial=Qm,d.Lambert_shader=Gl,d.LightBase=ki,d.LightData=fn,d.LightEntries=a0,d.LightType=ct,d.LightingFunction_frag=il,d.Line=vt,d.LineClassification=Ld,d.LinearInterpolator=V0,d.LitMaterial=qt,d.Lit_shader=kl,d.LoaderBase=Rr,d.LoaderEvent=Sg,d.LoaderManager=Tn,d.MAX_VALUE=_u,d.MIN_VALUE=Bu,d.Material=Dt,d.MaterialDataUniformGPUBuffer=Fc,d.MaterialUtilities=Nn,d.MathShader=nl,d.MathUtil=Pt,d.Matrix3=Nr,d.Matrix4=R,d.MatrixBindGroup=n0,d.MatrixGPUBuffer=i0,d.MatrixShader=Pl,d.MemoryDO=nr,d.MemoryInfo=el,d.MergeRGBACreator=kg,d.MergeRGBA_cs=Yf,d.MeshColliderShape=In,d.MinMaxAnimationCurves=zm,d.MinMaxCurve=Xh,d.MinMaxCurveState=Yh,d.MinMaxPolyCurves=Wm,d.MorePassParser=Ig,d.MorePassShader=ch,d.MorphTargetBlender=Jb,d.MorphTargetData=o0,d.MorphTargetFrame=jb,d.MorphTargetTransformKey=wd,d.MorphTarget_shader=Xt,d.MouseCode=Qn,d.MultiBouncePass_cs=k0,d.Navi3DAstar=qh,d.Navi3DConst=tn,d.Navi3DEdge=xa,d.Navi3DFunnel=ar,d.Navi3DMaskType=Cr,d.Navi3DMesh=ap,d.Navi3DPoint=Tt,d.Navi3DPoint2D=Jo,d.Navi3DPointFat=Sa,d.Navi3DRouter=pe,d.Navi3DTriangle=$h,d.NonSerialize=Zn,d.NormalMap_frag=Dl,d.OAnimationEvent=K0,d.OBJParser=sf,d.Object3DEvent=xg,d.Object3DTransformTools=jo,d.Object3DUtil=fp,d.ObjectAnimClip=kd,d.OcclusionSystem=xs,d.Octree=dr,d.OctreeEntity=Vc,d.OrbitController=tg,d.OrderMap=Om,d.Orientation3D=ia,d.OutLineBlendColor_cs=Xf,d.OutlineCalcOutline_cs=Hf,d.OutlinePass=kb,d.OutlinePost=Gg,d.OutlinePostData=uh,d.OutlinePostManager=bh,d.OutlinePostSlot=hh,d.Outline_cs=Kf,d.OvershootInterpolator=z0,d.PARSING=Rh,d.PBRLItShader=El,d.PBRLitSSSShader=md,d.PLUGIN_REGISTERED=Um,d.PNTSLoader=Uh,d.PNTSLoaderBase=vh,d.PNTSParser=yh,d.ParserBase=it,d.ParserFormat=He,d.ParticleSystemCurveEvalMode=Zh,d.ParticleSystemRandomnessIds=zh,d.PassGenerate=yi,d.PassShader=fh,d.PassType=le,d.PhysicMaterialUniform_frag=sl,d.PickCompute=qd,d.PickFire=$d,d.PickGUIEvent3D=Ut,d.PickResult=gh,d.Picker_cs=qf,d.PingPong=rs,d.PipelinePool=ms,d.Plane3D=Hh,d.PlaneClassification=Or,d.PlaneGeometry=$r,d.PlyMode=_r,d.PlyParser=cm,d.PointClassification=Gd,d.PointCloudGeometry=Bs,d.PointCloudMaterial=qc,d.PointCloud_FS=Kc,d.PointCloud_VS=Hc,d.PointLightShadowRenderer=m0,d.PointShadowCubeCamera=b0,d.PointerEvent3D=j,d.Polynomial=Oa,d.PolynomialCurve=tr,d.Polynomials=Gm,d.PoolNode=Pd,d.PostBase=Jt,d.PostProcessingComponent=Of,d.PostRenderer=B0,d.PreDepthPassRenderer=D0,d.PreFilteredEnvironment_cs=v0,d.PreFilteredEnvironment_cs2=pb,d.PreIntegratedLut=$f,d.PreIntegratedLutCompute=lh,d.PrefabAvatarData=xo,d.PrefabAvatarParser=Ch,d.PrefabBoneData=So,d.PrefabMaterialParser=xh,d.PrefabMeshData=Fh,d.PrefabMeshParser=kh,d.PrefabNode=Hi,d.PrefabParser=wh,d.PrefabStringUtil=gm,d.PrefabTextureData=Sh,d.PrefabTextureParser=Eh,d.Preprocessor=ma,d.PriorityQueue=Io,d.Probe=Hd,d.ProbeEntries=Eg,d.ProbeGBufferFrame=S0,d.ProfilerUtil=lt,d.PropertyAnimClip=Lb,d.PropertyAnimTag=Ed,d.PropertyAnimation=ho,d.PropertyAnimationClip=Lo,d.PropertyAnimationClipState=xd,d.PropertyAnimationEvent=Vi,d.PropertyHelp=Pi,d.QuadAABB=Qt,d.QuadGlsl_fs=Wl,d.QuadGlsl_vs=zl,d.QuadRoot=nh,d.QuadTree=ih,d.QuadTreeCell=Dr,d.Quad_depth2dArray_frag_wgsl=pu,d.Quad_depth2d_frag_wgsl=Tl,d.Quad_depthCube_frag_wgsl=Ml,d.Quad_frag_wgsl=Ql,d.Quad_vert_wgsl=Il,d.Quaternion=ae,d.R32UintTexture=Ds,d.RADIANS_TO_DEGREES=Yr,d.RGBEErrorCode=uf,d.RGBEHeader=Zs,d.RGBEParser=Ys,d.RTDescriptor=Ge,d.RTFrame=rt,d.RTResourceConfig=Qa,d.RTResourceMap=Et,d.Rand=pi,d.RandomSeed=Su,d.Ray=na,d.RayCastMeshDetail=fi,d.Reader=Kr,d.Rect=Ai,d.Reference=Ce,d.Reflection=vd,d.ReflectionCG=tc,d.ReflectionEntries=r0,d.ReflectionMaterial=yd,d.ReflectionRenderer=U0,d.ReflectionShader=Ud,d.ReflectionShader_shader=ec,d.RegisterComponent=Lt,d.RegisterShader=Ra,d.RenderContext=Ss,d.RenderLayer=Ci,d.RenderLayerUtil=ps,d.RenderNode=Ia,d.RenderShaderCollect=Pc,d.RenderShaderCompute=oh,d.RenderShaderPass=Xe,d.RenderTexture=kt,d.RendererBase=Ta,d.RendererJob=C0,d.RendererMap=_0,d.RendererMask=Qe,d.RendererMaskUtil=aa,d.RendererPassState=l0,d.RepeatSE=is,d.Res=Vf,d.RotationControlComponents=ru,d.SHCommon_frag=ac,d.SN_ArrayConstant=_i,d.SN_BinaryOperation=fr,d.SN_Break=r2,d.SN_CodeBlock=Da,d.SN_Constant=Xa,d.SN_Continue=bn,d.SN_Declaration=$e,d.SN_Discard=i2,d.SN_DoWhileLoop=a2,d.SN_Expression=Fe,d.SN_ForLoop=Fr,d.SN_Function=hn,d.SN_FunctionArgs=un,d.SN_FunctionCall=xr,d.SN_IFBranch=Er,d.SN_Identifier=Ya,d.SN_IndexOperation=wr,d.SN_Layout=Ui,d.SN_ParenExpression=vc,d.SN_Precision=gn,d.SN_Return=Bi,d.SN_SelectOperation=vi,d.SN_Struct=Za,d.SN_TernaryOperation=Uc,d.SN_UnaryOperation=qr,d.SN_WhileLoop=kr,d.SSAO_cs=Ab,d.SSGI2_cs=ed,d.SSGIPost=zg,d.SSRPost=Wg,d.SSR_BlendColor_cs=td,d.SSR_IS_Kernel=Jg,d.SSR_IS_cs=ad,d.SSR_RayTrace_cs=rd,d.ScaleControlComponents=au,d.Scene3D=pg,d.Shader=gt,d.ShaderAttributeInfo=gs,d.ShaderConverter=Cc,d.ShaderConverterResult=Sc,d.ShaderLib=Y,d.ShaderPassBase=Kn,d.ShaderReflection=St,d.ShaderStage=_a,d.ShaderState=xc,d.ShaderUniformInfo=bs,d.ShaderUtil=Ha,d.ShadingInput=Bl,d.ShadowLightsCollect=Wt,d.ShadowMapPassRenderer=A0,d.ShadowMapping_frag=Ul,d.Skeleton=Zb,d.SkeletonAnimationClip=_n,d.SkeletonAnimationClipState=Sd,d.SkeletonAnimationCompute=Yb,d.SkeletonAnimation_shader=Zr,d.SkeletonBlendComputeArgs=Xb,d.SkeletonPose=Fi,d.SkeletonTransformComputeArgs=Hb,d.SkyGBufferPass=kc,d.SkyGBuffer_pass=Jl,d.SkyMaterial=Bd,d.SkyRenderer=Fn,d.SolidColorSky=np,d.SphereColliderShape=mg,d.SphereGeometry=Ir,d.SphereReflection=Cd,d.StandShader=nf,d.StatementNode=Oe,d.StorageGPUBuffer=Te,d.StringUtil=Rt,d.Struct=gi,d.StructStorageGPUBuffer=wg,d.SubGeometry=jc,d.TAACopyTex_cs=id,d.TAAPost=jg,d.TAASharpTex_cs=nd,d.TAA_cs=sd,d.TestComputeLoadBuffer=cd,d.TextAnchor=Wd,d.TextFieldLayout=Yd,d.TextFieldLine=Zd,d.Texture=ft,d.TextureCube=vn,d.TextureCubeFaceData=Xs,d.TextureCubeStdCreator=Un,d.TextureCubeUtils=Js,d.TextureMipmapCompute=Rg,d.TextureMipmapGenerator=pa,d.TextureScaleCompute=sh,d.ThirdPersonCameraController=rg,d.Tile=Ro,d.TileSet=xm,d.TileSetChild=km,d.TileSetChildContent=Em,d.TileSetChildContentMetaData=wm,d.TileSetRoot=Fm,d.TilesRenderer=Sm,d.Time=Le,d.TokenType=U,d.TorusGeometry=tu,d.TouchData=Yo,d.TrailGeometry=rp,d.Transform=zt,d.TransformAxisEnum=N,d.TransformControllerBaseComponent=Jn,d.TransformMode=mt,d.TransformSpaceMode=ha,d.TranslationControlComponents=iu,d.TranslatorContext=us,d.TriGeometry=ip,d.Triangle=Ji,d.UIButton=po,d.UIButtonTransition=Xd,d.UIComponentBase=mo,d.UIEvent=Fg,d.UIImage=Pr,d.UIImageGroup=Ao,d.UIInteractive=Rn,d.UIInteractiveStyle=tt,d.UIPanel=Wi,d.UIRenderAble=zi,d.UIShadow=Do,d.UITextField=_o,d.UITransform=er,d.UNLOADED=vr,d.UUID=Gt,d.UV=Wo,d.Uint32ArrayTexture=Yc,d.Uint8ArrayTexture=pn,d.UnLit=Ll,d.UnLitMaterial=Bt,d.UnLitMaterialUniform_frag=ol,d.UnLitTexArrayMaterial=Mm,d.UnLitTextureArray=pd,d.UnLit_frag=ll,d.UniformGPUBuffer=yt,d.UniformNode=sr,d.UniformType=Ct,d.ValueEnumType=X,d.ValueOp=tp,d.ValueParser=Pa,d.ValueSpread=Jm,d.Vector2=de,d.Vector3=b,d.Vector3Ex=Oi,d.Vector4=he,d.VertexAttribute=vg,d.VertexAttributeIndexShader=ud,d.VertexAttributeName=G,d.VertexAttributeSize=or,d.VertexAttributeStride=th,d.VertexAttributes_vert=cl,d.VertexBufferLayout=Bg,d.VertexFormat=al,d.VertexGPUBuffer=mn,d.Vertical=Jd,d.VideoUniform_frag=fl,d.View3D=Ag,d.ViewPanel=En,d.ViewQuad=Cs,d.VirtualTexture=we,d.WGS84_FLATTENING=Bm,d.WGS84_HEIGHT=vm,d.WGS84_RADIUS=_m,d.WGSLTranslator=Bc,d.WayLines3D=Ti,d.WayPoint3D=Qi,d.WebGPUDescriptorCreator=Je,d.WorldMatrixUniform=es,d.WorldPanel=wn,d.WrapMode=li,d.WrapTimeMode=pr,d.ZCullingCompute=Tg,d.ZPassShader_cs=hd,d.ZPassShader_fs=Kl,d.ZPassShader_vs=Hl,d.ZSorterUtil=Qc,d.append=bc,d.arrayToString=mf,d.blendComponent=bu,d.buildCurves=Zm,d.byteSizeOfType=da,d.calculateCurveRangesValue=Ym,d.calculateMinMax=Ki,d.castPointShadowMap_vert=Zl,d.clamp=Ae,d.clampRepeat=Yu,d.computeAABBFromPositions=vo,d.cos=Vu,d.crossProduct=Ju,d.cubicPolynomialRoot=Wh,d.cubicPolynomialRootsGeneric=Jh,d.curvesSupportProcedural=jm,d.deg2Rad=Mu,d.detectGSplatFormat=mh,d.directionShadowCastMap_frag=Xl,d.dot=xt,d.doubleIntegrateSegment=jh,d.downSample=zf,d.fastInvSqrt=hc,d.floorfToIntPos=dc,d.fonts=ri,d.generateRandom=ju,d.generateRandom3=Zu,d.getFloatFromInt=lc,d.getGLTypeFromTypedArray=L2,d.getGLTypeFromTypedArrayType=O2,d.getGlobalRandomSeed=Ou,d.getTypedArray=G2,d.getTypedArrayTypeFromGLType=Ps,d.grad1=zo,d.grad2=Wn,d.grad3=qi,d.grad4=ui,d.inferSHOrder=yo,d.integrateSegment=Go,d.irradianceDataReader=Qg,d.kPI=Lm,d.lerp=Sr,d.lerpByte=yu,d.lerpColor=Uu,d.lerpVector3=vu,d.lruPriorityCallback=Lh,d.magnitude=ss,d.makeAloneSprite=K2,d.makeGUISprite=Ff,d.makeMatrix44=cn,d.markUsedSetLeaves=Po,d.markUsedTiles=Ln,d.markVisibleTiles=Vo,d.matrixMultiply=fs,d.matrixRotate=qu,d.matrixRotateY=Ku,d.mergeFunctions=nn,d.multiplyMatrices4x4REF=uc,d.normal_distribution=Kh,d.normalizeFast=Wu,d.normalizeSafe=oc,d.normalizedToByte=zu,d.normalizedToWord=Gu,d.outlinePostData=ya,d.outlinePostManager=Zg,d.parsePlyGaussianSplat=Co,d.parsePlyHeader=Xi,d.parsePlyMesh=Ah,d.parsePlyPointCloud=Dh,d.perm=Ue,d.post=Wf,d.priorityCallback=Oh,d.quadraticPolynomialRootsGeneric=zn,d.rad2Deg=Nu,d.random01=Xr,d.randomBarycentricCoord=Tu,d.randomPointBetweenEllipsoid=Qu,d.randomPointBetweenSphere=Ru,d.randomPointInsideCube=Eu,d.randomPointInsideEllipsoid=wu,d.randomPointInsideUnitCircle=Iu,d.randomPointInsideUnitSphere=fc,d.randomQuaternion=Fu,d.randomQuaternionUniformDistribution=ku,d.randomUnitVector=ln,d.randomUnitVector2=cc,d.rangedRandomFloat=At,d.rangedRandomInt=xu,d.readByType=Be,d.readMagicBytes=ti,d.registerMaterial=Tm,d.repeat=cs,d.rotMatrix=Hu,d.rotateVectorByQuat=Du,d.roundfToIntPos=os,d.scale=ns,d.shadowCastMap_frag=Yl,d.shadowCastMap_vert=jl,d.simplex=ea,d.sin=Pu,d.snoise1=Km,d.snoise2=qm,d.snoise3=$m,d.snoise4=ep,d.splatColorProperties=ph,d.splatProperties=Uo,d.sqrMagnitude=ls,d.sqrtImpl=sc,d.stencilStateFace=gu,d.swap=Lu,d.textureCompress=fd,d.threshold=Gf,d.throttle=Rm,d.toHalfFloat=hr,d.toggleTiles=Oo,d.traverseAncestors=ym,d.traverseSet=Th,d.tw=Ub,d.uniform_real_distribution=Xm,d.uniform_real_distribution2=Hm,d.upSample=lo,d.webGPUContext=w,d.zSorterUtil=Tc,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
|
11826
11826
|
//# sourceMappingURL=rings.umd.js.map
|