@uptimizr/dashboard 0.1.0
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/LICENSE +201 -0
- package/README.md +76 -0
- package/out/404.html +1 -0
- package/out/__next.__PAGE__.txt +9 -0
- package/out/__next._full.txt +20 -0
- package/out/__next._head.txt +6 -0
- package/out/__next._index.txt +5 -0
- package/out/__next._tree.txt +4 -0
- package/out/_next/static/93W3szqylNKDg-afLRmVW/_buildManifest.js +11 -0
- package/out/_next/static/93W3szqylNKDg-afLRmVW/_clientMiddlewareManifest.js +1 -0
- package/out/_next/static/93W3szqylNKDg-afLRmVW/_ssgManifest.js +1 -0
- package/out/_next/static/chunks/0-2y-_oomza2l.js +87 -0
- package/out/_next/static/chunks/00k_j_r7bv_eb.js +266 -0
- package/out/_next/static/chunks/00zdau6mcqeae.js +1 -0
- package/out/_next/static/chunks/023axeoslq39i.js +1 -0
- package/out/_next/static/chunks/068j6934u8j16.js +1 -0
- package/out/_next/static/chunks/0_rf76jneiwal.js +176 -0
- package/out/_next/static/chunks/0aznt7717miff.js +1 -0
- package/out/_next/static/chunks/0cu-q5q3a7uf3.js +1 -0
- package/out/_next/static/chunks/0cz1d0mv5g_q7.js +1 -0
- package/out/_next/static/chunks/0dm32-jq30tg8.js +1 -0
- package/out/_next/static/chunks/0dn0yx0rn6mpf.js +1 -0
- package/out/_next/static/chunks/0flc7nppbmsl1.js +3 -0
- package/out/_next/static/chunks/0fskcfh9vbhtv.js +1 -0
- package/out/_next/static/chunks/0gv7mblzv3dl3.js +87 -0
- package/out/_next/static/chunks/0impkpmxx3ttp.js +1 -0
- package/out/_next/static/chunks/0jmn7u31w95ly.js +91 -0
- package/out/_next/static/chunks/0n8n481szj90g.js +1 -0
- package/out/_next/static/chunks/0o6ayai0s01js.js +1 -0
- package/out/_next/static/chunks/0rys92_73hdb0.js +22 -0
- package/out/_next/static/chunks/0tl_moiyi2txt.js +1 -0
- package/out/_next/static/chunks/0tx1j_ghpz7rc.css +3 -0
- package/out/_next/static/chunks/0ufbyo1x3qkmo.js +1 -0
- package/out/_next/static/chunks/0v82oqyoy9zol.js +1 -0
- package/out/_next/static/chunks/0wrm9jr-9bw0e.js +1893 -0
- package/out/_next/static/chunks/0wwcfw8i3j_zx.js +1 -0
- package/out/_next/static/chunks/0ys9-ozuluawt.js +1 -0
- package/out/_next/static/chunks/1-61zh4waha61.js +1 -0
- package/out/_next/static/chunks/10r_824wzt8hj.js +1 -0
- package/out/_next/static/chunks/112hws17nz665.js +7 -0
- package/out/_next/static/chunks/123xxske5c9na.js +1 -0
- package/out/_next/static/chunks/13isnf0--pmx1.js +1 -0
- package/out/_next/static/chunks/157d9euci08yu.js +1 -0
- package/out/_next/static/chunks/15s7425ffrec9.js +3 -0
- package/out/_next/static/chunks/163fa70v4mgxj.js +1 -0
- package/out/_next/static/chunks/17q0c2h5ui10r.js +4 -0
- package/out/_next/static/chunks/18u58lorfahxi.js +4 -0
- package/out/_next/static/chunks/1_aahautsz2v_.js +1 -0
- package/out/_next/static/chunks/1a9l89j7e6mqu.js +23 -0
- package/out/_next/static/chunks/1dsy2ngmfflis.js +123 -0
- package/out/_next/static/chunks/1flb8adpj6_2o.js +62 -0
- package/out/_next/static/chunks/1lsg-22yob8dx.js +1 -0
- package/out/_next/static/chunks/1nj82er7msdto.js +2 -0
- package/out/_next/static/chunks/1o1d0p-v1z8ty.js +1 -0
- package/out/_next/static/chunks/1pdep2_c530sg.js +1 -0
- package/out/_next/static/chunks/1thjncpj7u6pq.js +1 -0
- package/out/_next/static/chunks/1vdjn0pkoyypn.js +1 -0
- package/out/_next/static/chunks/1yehxf-fmeicg.js +1 -0
- package/out/_next/static/chunks/1zvc1tv--w8nn.js +1 -0
- package/out/_next/static/chunks/1zx2q-r32thv1.js +4 -0
- package/out/_next/static/chunks/2-sjjedfr0kfq.js +1 -0
- package/out/_next/static/chunks/21o42k82w4llc.js +1 -0
- package/out/_next/static/chunks/25b9x-li-tvk2.js +1 -0
- package/out/_next/static/chunks/2712627rfsmwn.js +1 -0
- package/out/_next/static/chunks/296w2ke-v5tbm.js +9 -0
- package/out/_next/static/chunks/29tfeb6amdkjb.js +23 -0
- package/out/_next/static/chunks/2a3spdq-m8drh.js +3 -0
- package/out/_next/static/chunks/2aelw3far6rii.js +1 -0
- package/out/_next/static/chunks/2aor7m-wbis85.js +1 -0
- package/out/_next/static/chunks/2cbmf9m7lqv6k.js +4 -0
- package/out/_next/static/chunks/2d09v5u7dfq0q.js +1 -0
- package/out/_next/static/chunks/2feca0xcipcyt.js +850 -0
- package/out/_next/static/chunks/2fh-_9b6tqhvb.js +1 -0
- package/out/_next/static/chunks/2g5gecypj0rqe.js +1 -0
- package/out/_next/static/chunks/2kazjq29jeamx.js +1109 -0
- package/out/_next/static/chunks/2p2vv6cc9i-3q.js +255 -0
- package/out/_next/static/chunks/2szdcpl41-kzv.js +1 -0
- package/out/_next/static/chunks/2tws5udjdcmh3.js +1 -0
- package/out/_next/static/chunks/2u6shh3oeycm-.js +1 -0
- package/out/_next/static/chunks/2unhhuv0arlcv.js +1 -0
- package/out/_next/static/chunks/2xwy0-qfho1iz.js +91 -0
- package/out/_next/static/chunks/2ycvtdd68gub7.js +1 -0
- package/out/_next/static/chunks/2yiy_l8bwiw2_.js +3 -0
- package/out/_next/static/chunks/2yph6f7khgqii.js +1 -0
- package/out/_next/static/chunks/3-shckrcpvbxu.js +1681 -0
- package/out/_next/static/chunks/30fq_t9e2_fv-.js +1 -0
- package/out/_next/static/chunks/30yzu213bqtq0.js +5 -0
- package/out/_next/static/chunks/310uz81hnnzsu.js +1 -0
- package/out/_next/static/chunks/3218lp8l0a5g_.js +1 -0
- package/out/_next/static/chunks/35h5n42wxwgzk.js +123 -0
- package/out/_next/static/chunks/37vzwr3ciejf1.js +1 -0
- package/out/_next/static/chunks/38fhw7fatsyvd.js +3 -0
- package/out/_next/static/chunks/3be6s4_kn9q-o.js +1 -0
- package/out/_next/static/chunks/3i3gbhccmhu7j.js +210 -0
- package/out/_next/static/chunks/3l1dr_qm_x5kp.js +1 -0
- package/out/_next/static/chunks/3mqy-84_ul3t2.js +1 -0
- package/out/_next/static/chunks/3nz-dh9d7cehk.js +1 -0
- package/out/_next/static/chunks/3pufs8g4ui943.js +1 -0
- package/out/_next/static/chunks/3sjq_xoi4rbyg.js +31 -0
- package/out/_next/static/chunks/3t06schbtqonl.js +1 -0
- package/out/_next/static/chunks/3v3-7fio3nw_t.js +1 -0
- package/out/_next/static/chunks/3v5ha25nxo43j.js +1 -0
- package/out/_next/static/chunks/3yfrsm8lfi6ls.js +22 -0
- package/out/_next/static/chunks/3zskk1hxu3-_o.js +1 -0
- package/out/_next/static/chunks/turbopack-2ropzf0axp1x9.js +1 -0
- package/out/_next/static/media/0c89a48fa5027cee-s.p.2cyn07wtgehh0.woff2 +0 -0
- package/out/_next/static/media/13bf9871fe164e7f-s.2f7nqdagzwx2-.woff2 +0 -0
- package/out/_next/static/media/28868e710e86be81-s.2eksvhm1z0jwa.woff2 +0 -0
- package/out/_next/static/media/32687112bd2dd8db-s.1gepa_7fcx9fm.woff2 +0 -0
- package/out/_next/static/media/3fe682a82f50d426-s.0vfdmo25voy_0.woff2 +0 -0
- package/out/_next/static/media/70bc3e132a0a741e-s.p.3t6q91iet4nsy.woff2 +0 -0
- package/out/_next/static/media/71b036adf157cdcf-s.0bp8oijd_gu96.woff2 +0 -0
- package/out/_next/static/media/89b21bb081cb7469-s.1fby2rem9ngyr.woff2 +0 -0
- package/out/_next/static/media/cc545e633e20c56d-s.176arc174-8zp.woff2 +0 -0
- package/out/_next/static/media/icon.08h29dad3pcxg.svg +4 -0
- package/out/_not-found/__next._full.txt +16 -0
- package/out/_not-found/__next._head.txt +6 -0
- package/out/_not-found/__next._index.txt +5 -0
- package/out/_not-found/__next._not-found.__PAGE__.txt +5 -0
- package/out/_not-found/__next._not-found.txt +5 -0
- package/out/_not-found/__next._tree.txt +2 -0
- package/out/_not-found.html +1 -0
- package/out/_not-found.txt +16 -0
- package/out/api/projects +1 -0
- package/out/icon.svg +4 -0
- package/out/index.html +1 -0
- package/out/index.txt +20 -0
- package/out/logo.svg +46 -0
- package/package.json +67 -0
- package/server/standalone.mjs +182 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1773,e=>{"use strict";e.s(["useOpenGLOrientationForUV",()=>!1])},54361,e=>{"use strict";class t{constructor(e,t){this.width=e,this.height=t}toString(){return`{W: ${this.width}, H: ${this.height}}`}getClassName(){return"Size"}getHashCode(){let e=0|this.width;return 397*e^this.height}copyFrom(e){this.width=e.width,this.height=e.height}copyFromFloats(e,t){return this.width=e,this.height=t,this}set(e,t){return this.copyFromFloats(e,t)}multiplyByFloats(e,i){return new t(this.width*e,this.height*i)}clone(){return new t(this.width,this.height)}equals(e){return!!e&&this.width===e.width&&this.height===e.height}get surface(){return this.width*this.height}static Zero(){return new t(0,0)}add(e){return new t(this.width+e.width,this.height+e.height)}subtract(e){return new t(this.width-e.width,this.height-e.height)}scale(e){return new t(this.width*e,this.height*e)}static Lerp(e,i,r){return new t(e.width+(i.width-e.width)*r,e.height+(i.height-e.height)*r)}}e.s(["Size",0,t])},52153,e=>{"use strict";var t,i=e.i(10272),r=e.i(37143),s=e.i(99267),a=e.i(96265),n=e.i(81623),h=e.i(84768),o=e.i(54361);class l{get wrapU(){return this._wrapU}set wrapU(e){this._wrapU=e}get wrapV(){return this._wrapV}set wrapV(e){this._wrapV=e}get coordinatesMode(){return 0}get isCube(){return!!this._texture&&this._texture.isCube}set isCube(e){this._texture&&(this._texture.isCube=e)}get is3D(){return!!this._texture&&this._texture.is3D}set is3D(e){this._texture&&(this._texture.is3D=e)}get is2DArray(){return!!this._texture&&this._texture.is2DArray}set is2DArray(e){this._texture&&(this._texture.is2DArray=e)}getClassName(){return"ThinTexture"}static _IsRenderTargetWrapper(e){return e?.shareDepth!==void 0}constructor(e){this._wrapU=1,this._wrapV=1,this.wrapR=1,this.anisotropicFilteringLevel=4,this.delayLoadState=0,this._texture=null,this._engine=null,this._cachedSize=o.Size.Zero(),this._cachedBaseSize=o.Size.Zero(),this._initialSamplingMode=2,this._texture=l._IsRenderTargetWrapper(e)?e.texture:e,this._texture&&(this._engine=this._texture.getEngine(),this.wrapU=this._texture._cachedWrapU??this.wrapU,this.wrapV=this._texture._cachedWrapV??this.wrapV,this.wrapR=this._texture._cachedWrapR??this.wrapR)}isReady(){return 4===this.delayLoadState?(this.delayLoad(),!1):!!this._texture&&this._texture.isReady}delayLoad(){}getInternalTexture(){return this._texture}getSize(){if(this._texture){if(this._texture.width)return this._cachedSize.width=this._texture.width,this._cachedSize.height=this._texture.height,this._cachedSize;this._texture._size&&(this._cachedSize.width=this._texture._size,this._cachedSize.height=this._texture._size)}return this._cachedSize}getBaseSize(){return this.isReady()&&this._texture?this._texture._size?(this._cachedBaseSize.width=this._texture._size,this._cachedBaseSize.height=this._texture._size):(this._cachedBaseSize.width=this._texture.baseWidth,this._cachedBaseSize.height=this._texture.baseHeight):(this._cachedBaseSize.width=0,this._cachedBaseSize.height=0),this._cachedBaseSize}get samplingMode(){return this._texture?this._texture.samplingMode:this._initialSamplingMode}updateSamplingMode(e,t=!1){this._texture&&this._engine&&this._engine.updateTextureSamplingMode(e,this._texture,this._texture.generateMipMaps&&t)}releaseInternalTexture(){this._texture&&(this._texture.dispose(),this._texture=null)}dispose(){this._texture&&(this.releaseInternalTexture(),this._engine=null)}}var u=e.i(80871),_=e.i(75405);class c extends l{set hasAlpha(e){this._hasAlpha!==e&&(this._hasAlpha=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)))}get hasAlpha(){return this._hasAlpha}set getAlphaFromRGB(e){this._getAlphaFromRGB!==e&&(this._getAlphaFromRGB=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)))}get getAlphaFromRGB(){return this._getAlphaFromRGB}set coordinatesIndex(e){this._coordinatesIndex!==e&&(this._coordinatesIndex=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)))}get coordinatesIndex(){return this._coordinatesIndex}set coordinatesMode(e){this._coordinatesMode!==e&&(this._coordinatesMode=e,this._scene&&this._scene.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)))}get coordinatesMode(){return this._coordinatesMode}get wrapU(){return this._wrapU}set wrapU(e){this._wrapU=e}get wrapV(){return this._wrapV}set wrapV(e){this._wrapV=e}get isCube(){return this._texture?this._texture.isCube:this._isCube}set isCube(e){this._texture?this._texture.isCube=e:this._isCube=e}get is3D(){return!!this._texture&&this._texture.is3D}set is3D(e){this._texture&&(this._texture.is3D=e)}get is2DArray(){return!!this._texture&&this._texture.is2DArray}set is2DArray(e){this._texture&&(this._texture.is2DArray=e)}get gammaSpace(){return this._texture?(null===this._texture._gammaSpace&&(this._texture._gammaSpace=this._gammaSpace),this._texture._gammaSpace&&!this._texture._useSRGBBuffer):this._gammaSpace}set gammaSpace(e){if(this._texture){if(this._texture._gammaSpace===e)return;this._texture._gammaSpace=e}else{if(this._gammaSpace===e)return;this._gammaSpace=e}this.getScene()?.markAllMaterialsAsDirty(1,e=>e.hasTexture(this))}get isRGBD(){return null!=this._texture&&this._texture._isRGBD}set isRGBD(e){e!==this.isRGBD&&(this._texture&&(this._texture._isRGBD=e),this.getScene()?.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)))}get noMipmap(){return!1}get lodGenerationOffset(){return this._texture?this._texture._lodGenerationOffset:0}set lodGenerationOffset(e){this._texture&&(this._texture._lodGenerationOffset=e)}get lodGenerationScale(){return this._texture?this._texture._lodGenerationScale:0}set lodGenerationScale(e){this._texture&&(this._texture._lodGenerationScale=e)}get linearSpecularLOD(){return!!this._texture&&this._texture._linearSpecularLOD}set linearSpecularLOD(e){this._texture&&(this._texture._linearSpecularLOD=e)}get irradianceTexture(){return this._texture?this._texture._irradianceTexture:null}set irradianceTexture(e){this._texture&&(this._texture._irradianceTexture=e)}get uid(){return this._uid||(this._uid=(0,h.RandomGUID)()),this._uid}toString(){return this.name}getClassName(){return"BaseTexture"}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get isBlocking(){return!0}get loadingError(){return this._loadingError}get errorObject(){return this._errorObject}constructor(e,t=null){super(null),this.metadata=null,this.reservedDataStore=null,this._hasAlpha=!1,this._getAlphaFromRGB=!1,this.level=1,this._coordinatesIndex=0,this.optimizeUVAllocation=!0,this._coordinatesMode=0,this.wrapR=1,this.anisotropicFilteringLevel=c.DEFAULT_ANISOTROPIC_FILTERING_LEVEL,this._isCube=!1,this._gammaSpace=!0,this.invertZ=!1,this.lodLevelInAlpha=!1,this._dominantDirection=null,this.isRenderTarget=!1,this._prefiltered=!1,this._forceSerialize=!1,this.animations=[],this.onDisposeObservable=new s.Observable,this._onDisposeObserver=null,this._scene=null,this._uid=null,this._parentContainer=null,this._loadingError=!1,e?c._IsScene(e)?this._scene=e:this._engine=e:this._scene=n.EngineStore.LastCreatedScene,this._scene&&(this.uniqueId=this._scene.getUniqueId(),this._scene.addTexture(this),this._engine=this._scene.getEngine()),this._texture=t,this._uid=null}getScene(){return this._scene}_getEngine(){return this._engine}getTextureMatrix(){return a.Matrix.IdentityReadOnly}getReflectionTextureMatrix(){return a.Matrix.IdentityReadOnly}getRefractionTextureMatrix(){return this.getReflectionTextureMatrix()}isReadyOrNotBlocking(){return!this.isBlocking||this.isReady()||this.loadingError}scale(e){}get canRescale(){return!1}_getFromCache(e,t,i,r,s,a){let n=this._getEngine();if(!n)return null;let h=n._getUseSRGBBuffer(!!s,t),o=n.getLoadedTexturesCache();for(let n=0;n<o.length;n++){let l=o[n];if((void 0===s||h===l._useSRGBBuffer)&&(void 0===r||r===l.invertY)&&l.url===e&&!t===l.generateMipMaps&&(!i||i===l.samplingMode)&&(void 0===a||a===l.isCube))return l.incrementReferences(),l}return null}_rebuild(e=!1){}clone(){return null}get textureType(){return this._texture&&void 0!==this._texture.type?this._texture.type:0}get textureFormat(){return this._texture&&void 0!==this._texture.format?this._texture.format:5}_markAllSubMeshesAsTexturesDirty(){let e=this.getScene();e&&e.markAllMaterialsAsDirty(1)}readPixels(e=0,t=0,i=null,r=!0,s=!1,a=0,n=0,h=Number.MAX_VALUE,o=Number.MAX_VALUE){if(!this._texture)return null;let l=this._getEngine();if(!l)return null;let u=this.getSize(),_=u.width,c=u.height;0!==t&&(_/=Math.pow(2,t),c/=Math.pow(2,t),_=Math.round(_),c=Math.round(c)),h=Math.min(_,h),o=Math.min(c,o);try{if(this._texture.isCube||this._texture.is2DArray)return l._readTexturePixels(this._texture,h,o,e,t,i,r,s,a,n);return l._readTexturePixels(this._texture,h,o,-1,t,i,r,s,a,n)}catch(e){return null}}_readPixelsSync(e=0,t=0,i=null,r=!0,s=!1){if(!this._texture)return null;let a=this.getSize(),n=a.width,h=a.height,o=this._getEngine();if(!o)return null;0!=t&&(n/=Math.pow(2,t),h/=Math.pow(2,t),n=Math.round(n),h=Math.round(h));try{if(this._texture.isCube)return o._readTexturePixelsSync(this._texture,n,h,e,t,i,r,s);return o._readTexturePixelsSync(this._texture,n,h,-1,t,i,r,s)}catch(e){return null}}get _lodTextureHigh(){return this._texture?this._texture._lodTextureHigh:null}get _lodTextureMid(){return this._texture?this._texture._lodTextureMid:null}get _lodTextureLow(){return this._texture?this._texture._lodTextureLow:null}dispose(){if(this._scene){this._scene.stopAnimation&&this._scene.stopAnimation(this),this._scene.removePendingData(this);let e=this._scene.textures.indexOf(this);if(e>=0&&this._scene.textures.splice(e,1),this._scene.onTextureRemovedObservable.notifyObservers(this),this._scene=null,this._parentContainer){let e=this._parentContainer.textures.indexOf(this);e>-1&&this._parentContainer.textures.splice(e,1),this._parentContainer=null}}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this.metadata=null,super.dispose()}serialize(e=!1){if(!this.name&&!e)return null;let t=u.SerializationHelper.Serialize(this);return u.SerializationHelper.AppendSerializedAnimations(this,t),t}static WhenAllReady(e,t){let i=e.length;if(0===i)return void t();for(let r=0;r<e.length;r++){let s=e[r];if(s.isReady())0==--i&&t();else{let e=s.onLoadObservable;e?e.addOnce(()=>{0==--i&&t()}):0==--i&&t()}}}static _IsScene(e){return"Scene"===e.getClassName()}}c.DEFAULT_ANISOTROPIC_FILTERING_LEVEL=4,(0,i.__decorate)([(0,r.serialize)()],c.prototype,"uniqueId",void 0),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"name",void 0),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"displayName",void 0),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"metadata",void 0),(0,i.__decorate)([(0,r.serialize)("hasAlpha")],c.prototype,"_hasAlpha",void 0),(0,i.__decorate)([(0,r.serialize)("getAlphaFromRGB")],c.prototype,"_getAlphaFromRGB",void 0),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"level",void 0),(0,i.__decorate)([(0,r.serialize)("coordinatesIndex")],c.prototype,"_coordinatesIndex",void 0),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"optimizeUVAllocation",void 0),(0,i.__decorate)([(0,r.serialize)("coordinatesMode")],c.prototype,"_coordinatesMode",void 0),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"wrapU",null),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"wrapV",null),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"wrapR",void 0),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"anisotropicFilteringLevel",void 0),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"isCube",null),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"is3D",null),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"is2DArray",null),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"gammaSpace",null),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"invertZ",void 0),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"lodLevelInAlpha",void 0),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"lodGenerationOffset",null),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"lodGenerationScale",null),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"linearSpecularLOD",null),(0,i.__decorate)([(0,r.serializeAsTexture)()],c.prototype,"irradianceTexture",null),(0,i.__decorate)([(0,r.serialize)()],c.prototype,"isRenderTarget",void 0),(t=c.prototype).forceSphericalPolynomialsRecompute??(t.forceSphericalPolynomialsRecompute=(0,_._MissingSideEffect)("BaseTexture","forceSphericalPolynomialsRecompute")),Object.getOwnPropertyDescriptor(c.prototype,"sphericalPolynomial")||Object.defineProperty(c.prototype,"sphericalPolynomial",(0,_._MissingSideEffectProperty)("BaseTexture","sphericalPolynomial")),e.s(["BaseTexture",0,c],52153)},58720,e=>{"use strict";var t=e.i(10272),i=e.i(37143),r=e.i(99267),s=e.i(96265),a=e.i(52153),n=e.i(77052),h=e.i(75405),o=e.i(23240),l=e.i(98105),u=e.i(65002),_=e.i(49311);function c(e,t,i=!1){let r=t.width,s=t.height;if(e instanceof Float32Array){let t=e.byteLength/e.BYTES_PER_ELEMENT,i=new Uint8Array(t);for(;--t>=0;){let r=e[t];r<0?r=0:r>1&&(r=1),i[t]=255*r}e=i}let a=document.createElement("canvas");a.width=r,a.height=s;let n=a.getContext("2d");if(!n)return null;let h=n.createImageData(r,s);if(h.data.set(e),n.putImageData(h,0,0),i){let e=document.createElement("canvas");e.width=r,e.height=s;let t=e.getContext("2d");return t?(t.translate(0,s),t.scale(1,-1),t.drawImage(a,0,0),e.toDataURL("image/png")):null}return a.toDataURL("image/png")}async function d(e,t=0,i=0){let r=e.getInternalTexture();if(!r)return null;let s=await e.readPixels(t,i);return s?c(s,e.getSize(),r.invertY):null}var x=e.i(1773),p=e.i(80871);class f extends a.BaseTexture{static _CreateVideoTexture(e,t,i,r=!1,s=!1,a=f.TRILINEAR_SAMPLINGMODE,n={},o,l=5){throw(0,h._WarnImport)("VideoTexture")}get noMipmap(){return this._noMipmap}get mimeType(){return this._mimeType}set isBlocking(e){this._isBlocking=e}get isBlocking(){return this._isBlocking}get invertY(){return this._invertY}constructor(e,t,i,s,a=f.TRILINEAR_SAMPLINGMODE,n=null,h=null,l=null,u=!1,_,c,d,p,g){let m;super(t),this.url=null,this.uOffset=0,this.vOffset=0,this.uScale=1,this.vScale=1,this.uAng=0,this.vAng=0,this.wAng=0,this.uRotationCenter=.5,this.vRotationCenter=.5,this.wRotationCenter=.5,this.homogeneousRotationInUVTransform=!1,this.inspectableCustomProperties=null,this._noMipmap=!1,this._invertY=!1,this._rowGenerationMatrix=null,this._cachedTextureMatrix=null,this._projectionModeMatrix=null,this._t0=null,this._t1=null,this._t2=null,this._cachedUOffset=-1,this._cachedVOffset=-1,this._cachedUScale=0,this._cachedVScale=0,this._cachedUAng=-1,this._cachedVAng=-1,this._cachedWAng=-1,this._cachedReflectionProjectionMatrixId=-1,this._cachedURotationCenter=-1,this._cachedVRotationCenter=-1,this._cachedWRotationCenter=-1,this._cachedHomogeneousRotationInUVTransform=!1,this._cachedIdentity3x2=!0,this._cachedReflectionTextureMatrix=null,this._cachedReflectionUOffset=-1,this._cachedReflectionVOffset=-1,this._cachedReflectionUScale=0,this._cachedReflectionVScale=0,this._cachedReflectionCoordinatesMode=-1,this._buffer=null,this._deleteBuffer=!1,this._format=null,this._delayedOnLoad=null,this._delayedOnError=null,this.onLoadObservable=new r.Observable,this._isBlocking=!0,this.name=e||"",this.url=e;let R=!1,M=null,T=!0;"object"==typeof i&&null!==i?(m=i.noMipmap??!1,s=i.invertY??!x.useOpenGLOrientationForUV,a=i.samplingMode??f.TRILINEAR_SAMPLINGMODE,n=i.onLoad??null,h=i.onError??null,l=i.buffer??null,u=i.deleteBuffer??!1,_=i.format,c=i.mimeType,d=i.loaderOptions,p=i.creationFlags,R=i.useSRGBBuffer??!1,M=i.internalTexture??null,T=i.gammaSpace??T,g=i.forcedExtension??g):m=!!i,this._gammaSpace=T,this._noMipmap=m,this._invertY=void 0===s?!x.useOpenGLOrientationForUV:s,this._initialSamplingMode=a,this._buffer=l,this._deleteBuffer=u,this._mimeType=c,this._loaderOptions=d,this._creationFlags=p,this._useSRGBBuffer=R,this._forcedExtension=g,void 0!==_&&(this._format=_);const S=this.getScene(),y=this._getEngine();if(!y)return;y.onBeforeTextureInitObservable.notifyObservers(this);const A=()=>{this._texture&&(this._texture._invertVScale&&(this.vScale*=-1,this.vOffset+=1),null!==this._texture._cachedWrapU&&(this.wrapU=this._texture._cachedWrapU,this._texture._cachedWrapU=null),null!==this._texture._cachedWrapV&&(this.wrapV=this._texture._cachedWrapV,this._texture._cachedWrapV=null),null!==this._texture._cachedWrapR&&(this.wrapR=this._texture._cachedWrapR,this._texture._cachedWrapR=null)),this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),n&&n(),!this.isBlocking&&S&&S.resetCachedMaterial()},O=(e,t)=>{this._loadingError=!0,this._errorObject={message:e,exception:t},h&&h(e,t),f.OnTextureLoadErrorObservable.notifyObservers(this)};if(!this.url&&!M){this._delayedOnLoad=A,this._delayedOnError=O;return}if(this._texture=M??this._getFromCache(this.url,m,a,this._invertY,R,this.isCube),this._texture)if(this._texture.isReady)o.TimingTools.SetImmediate(()=>A());else{const e=this._texture.onLoadedObservable.add(A);this._texture.onErrorObservable.add(t=>{O(t.message,t.exception),this._texture?.onLoadedObservable.remove(e)})}else if(S&&S.useDelayedTextureLoading)this.delayLoadState=4,this._delayedOnLoad=A,this._delayedOnError=O;else{try{this._texture=y.createTexture(this.url,m,this._invertY,S,a,A,O,this._buffer,void 0,this._format,this._forcedExtension,c,d,p,R)}catch(e){throw O("error loading",e),e}u&&(this._buffer=null)}}updateURL(e,t=null,i,r){this.url&&(this.releaseInternalTexture(),this.getScene().markAllMaterialsAsDirty(1,e=>e.hasTexture(this))),(!this.name||this.name.startsWith("data:"))&&(this.name=e),this.url=e,this._buffer=t,this._forcedExtension=r,this.delayLoadState=4;let s=this._delayedOnLoad,a=()=>{s?s():this.onLoadObservable.hasObservers()&&this.onLoadObservable.notifyObservers(this),i&&i()};this._delayedOnLoad=a,this.delayLoad()}delayLoad(){if(4!==this.delayLoadState)return;let e=this.getScene();if(!e)return;let t=this.url;!t&&(this.name.indexOf("://")>0||this.name.startsWith("data:"))&&(t=this.name),this.delayLoadState=1,this._texture=this._getFromCache(t,this._noMipmap,this.samplingMode,this._invertY,this._useSRGBBuffer,this.isCube),this._texture?this._delayedOnLoad&&(this._texture.isReady?o.TimingTools.SetImmediate(this._delayedOnLoad):this._texture.onLoadedObservable.add(this._delayedOnLoad)):(this._texture=e.getEngine().createTexture(t,this._noMipmap,this._invertY,e,this.samplingMode,this._delayedOnLoad,this._delayedOnError,this._buffer,null,this._format,this._forcedExtension,this._mimeType,this._loaderOptions,this._creationFlags,this._useSRGBBuffer),this._deleteBuffer&&(this._buffer=null)),this._delayedOnLoad=null,this._delayedOnError=null}_prepareRowForTextureGeneration(e,t,i,r){e*=this._cachedUScale,t*=this._cachedVScale,e-=this.uRotationCenter*this._cachedUScale,t-=this.vRotationCenter*this._cachedVScale,i-=this.wRotationCenter,s.Vector3.TransformCoordinatesFromFloatsToRef(e,t,i,this._rowGenerationMatrix,r),r.x+=this.uRotationCenter*this._cachedUScale+this._cachedUOffset,r.y+=this.vRotationCenter*this._cachedVScale+this._cachedVOffset,r.z+=this.wRotationCenter}getTextureMatrix(e=1){if(this.uOffset===this._cachedUOffset&&this.vOffset===this._cachedVOffset&&this.uScale*e===this._cachedUScale&&this.vScale===this._cachedVScale&&this.uAng===this._cachedUAng&&this.vAng===this._cachedVAng&&this.wAng===this._cachedWAng&&this.uRotationCenter===this._cachedURotationCenter&&this.vRotationCenter===this._cachedVRotationCenter&&this.wRotationCenter===this._cachedWRotationCenter&&this.homogeneousRotationInUVTransform===this._cachedHomogeneousRotationInUVTransform)return this._cachedTextureMatrix;this._cachedUOffset=this.uOffset,this._cachedVOffset=this.vOffset,this._cachedUScale=this.uScale*e,this._cachedVScale=this.vScale,this._cachedUAng=this.uAng,this._cachedVAng=this.vAng,this._cachedWAng=this.wAng,this._cachedURotationCenter=this.uRotationCenter,this._cachedVRotationCenter=this.vRotationCenter,this._cachedWRotationCenter=this.wRotationCenter,this._cachedHomogeneousRotationInUVTransform=this.homogeneousRotationInUVTransform,this._cachedTextureMatrix&&this._rowGenerationMatrix||(this._cachedTextureMatrix=s.Matrix.Zero(),this._rowGenerationMatrix=new s.Matrix,this._t0=s.Vector3.Zero(),this._t1=s.Vector3.Zero(),this._t2=s.Vector3.Zero()),s.Matrix.RotationYawPitchRollToRef(this.vAng,this.uAng,this.wAng,this._rowGenerationMatrix),this.homogeneousRotationInUVTransform?(s.Matrix.TranslationToRef(-this._cachedURotationCenter,-this._cachedVRotationCenter,-this._cachedWRotationCenter,s.TmpVectors.Matrix[0]),s.Matrix.TranslationToRef(this._cachedURotationCenter,this._cachedVRotationCenter,this._cachedWRotationCenter,s.TmpVectors.Matrix[1]),s.Matrix.ScalingToRef(this._cachedUScale,this._cachedVScale,0,s.TmpVectors.Matrix[2]),s.Matrix.TranslationToRef(this._cachedUOffset,this._cachedVOffset,0,s.TmpVectors.Matrix[3]),s.TmpVectors.Matrix[0].multiplyToRef(this._rowGenerationMatrix,this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(s.TmpVectors.Matrix[1],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(s.TmpVectors.Matrix[2],this._cachedTextureMatrix),this._cachedTextureMatrix.multiplyToRef(s.TmpVectors.Matrix[3],this._cachedTextureMatrix),this._cachedTextureMatrix.setRowFromFloats(2,this._cachedTextureMatrix.m[12],this._cachedTextureMatrix.m[13],this._cachedTextureMatrix.m[14],1)):(this._prepareRowForTextureGeneration(0,0,0,this._t0),this._prepareRowForTextureGeneration(1,0,0,this._t1),this._prepareRowForTextureGeneration(0,1,0,this._t2),this._t1.subtractInPlace(this._t0),this._t2.subtractInPlace(this._t0),s.Matrix.FromValuesToRef(this._t1.x,this._t1.y,this._t1.z,0,this._t2.x,this._t2.y,this._t2.z,0,this._t0.x,this._t0.y,this._t0.z,0,0,0,0,1,this._cachedTextureMatrix));let t=this.getScene();if(!t)return this._cachedTextureMatrix;let i=this._cachedIdentity3x2;return this._cachedIdentity3x2=this._cachedTextureMatrix.isIdentityAs3x2(),this.optimizeUVAllocation&&i!==this._cachedIdentity3x2&&t.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)),this._cachedTextureMatrix}getReflectionTextureMatrix(){let e=this.getScene();if(!e)return this._cachedReflectionTextureMatrix;if(this.uOffset===this._cachedReflectionUOffset&&this.vOffset===this._cachedReflectionVOffset&&this.uScale===this._cachedReflectionUScale&&this.vScale===this._cachedReflectionVScale&&this.coordinatesMode===this._cachedReflectionCoordinatesMode){if(this.coordinatesMode!==f.PROJECTION_MODE)return this._cachedReflectionTextureMatrix;else if(this._cachedReflectionProjectionMatrixId===e.getProjectionMatrix().updateFlag)return this._cachedReflectionTextureMatrix}this._cachedReflectionTextureMatrix||(this._cachedReflectionTextureMatrix=s.Matrix.Zero()),this._projectionModeMatrix||(this._projectionModeMatrix=s.Matrix.Zero());let t=this._cachedReflectionCoordinatesMode!==this.coordinatesMode;switch(this._cachedReflectionUOffset=this.uOffset,this._cachedReflectionVOffset=this.vOffset,this._cachedReflectionUScale=this.uScale,this._cachedReflectionVScale=this.vScale,this._cachedReflectionCoordinatesMode=this.coordinatesMode,this.coordinatesMode){case f.PLANAR_MODE:s.Matrix.IdentityToRef(this._cachedReflectionTextureMatrix),this._cachedReflectionTextureMatrix[0]=this.uScale,this._cachedReflectionTextureMatrix[5]=this.vScale,this._cachedReflectionTextureMatrix[12]=this.uOffset,this._cachedReflectionTextureMatrix[13]=this.vOffset;break;case f.PROJECTION_MODE:{s.Matrix.FromValuesToRef(.5,0,0,0,0,-.5,0,0,0,0,0,0,.5,.5,1,1,this._projectionModeMatrix);let t=e.getProjectionMatrix();this._cachedReflectionProjectionMatrixId=t.updateFlag,t.multiplyToRef(this._projectionModeMatrix,this._cachedReflectionTextureMatrix);break}default:s.Matrix.IdentityToRef(this._cachedReflectionTextureMatrix)}return t&&e.markAllMaterialsAsDirty(1,e=>e.hasTexture(this)),this._cachedReflectionTextureMatrix}clone(){let e={noMipmap:this._noMipmap,invertY:this._invertY,samplingMode:this.samplingMode,onLoad:void 0,onError:void 0,buffer:this._texture?this._texture._buffer:void 0,deleteBuffer:this._deleteBuffer,format:this.textureFormat,mimeType:this.mimeType,loaderOptions:this._loaderOptions,creationFlags:this._creationFlags,useSRGBBuffer:this._useSRGBBuffer};return p.SerializationHelper.Clone(()=>new f(this._texture?this._texture.url:null,this.getScene(),e),this)}serialize(){let e=this.name;!f.SerializeBuffers&&this.name.startsWith("data:")&&(this.name=""),this.name.startsWith("data:")&&this.url===this.name&&(this.url="");let t=super.serialize(f._SerializeInternalTextureUniqueId);if(!t)return null;if(f.SerializeBuffers||f.ForceSerializeBuffers)if("string"==typeof this._buffer&&this._buffer.startsWith("data:"))t.base64String=this._buffer,t.name=t.name.replace("data:","");else if(this.url&&this.url.startsWith("data:")&&this._buffer instanceof Uint8Array){let e=this.mimeType||"image/png";t.base64String=`data:${e};base64,${(0,_.EncodeArrayBufferToBase64)(this._buffer)}`}else(f.ForceSerializeBuffers||this.url&&this.url.startsWith("blob:")||this._forceSerialize)&&(t.base64String=!this._engine||this._engine._features.supportSyncTextureRead?function(e,t=0,i=0){let r=e.getInternalTexture();if(!r)return null;let s=e._readPixelsSync(t,i);return s?c(s,e.getSize(),r.invertY):null}(this):d(this));return t.invertY=this._invertY,t.samplingMode=this.samplingMode,t._creationFlags=this._creationFlags,t._useSRGBBuffer=this._useSRGBBuffer,f._SerializeInternalTextureUniqueId&&(t.internalTextureUniqueId=this._texture?.uniqueId),t.internalTextureLabel=this._texture?.label,t.noMipmap=this._noMipmap,this.name=e,t}getClassName(){return"Texture"}dispose(){super.dispose(),this.onLoadObservable.clear(),this._delayedOnLoad=null,this._delayedOnError=null,this._buffer=null}static Parse(e,t,i){let r;if(e.customType){let r=l.InstantiationTools.Instantiate(e.customType).Parse(e,t,i);return e.samplingMode&&r.updateSamplingMode&&r._samplingMode&&r._samplingMode!==e.samplingMode&&r.updateSamplingMode(e.samplingMode),r}if(e.isCube&&!e.isRenderTarget)return f._CubeTextureParser(e,t,i);let s=void 0!==e.internalTextureUniqueId;if(!e.name&&!e.isRenderTarget&&!s)return null;if(s){for(let i of t.getEngine().getLoadedTexturesCache())if(i.uniqueId===e.internalTextureUniqueId){r=i;break}}let a=t=>{if(t&&t._texture&&(t._texture._cachedWrapU=null,t._texture._cachedWrapV=null,t._texture._cachedWrapR=null),e.samplingMode){let i=e.samplingMode;t&&t.samplingMode!==i&&t.updateSamplingMode(i)}if(t&&e.animations)for(let i=0;i<e.animations.length;i++){let r=e.animations[i],s=(0,n.GetClass)("BABYLON.Animation");s&&t.animations.push(s.Parse(r))}t&&t._texture&&(s&&!r&&t._texture._setUniqueId(e.internalTextureUniqueId),t._texture.label=e.internalTextureLabel)};return p.SerializationHelper.Parse(()=>{let s=!0;if(e.noMipmap&&(s=!1),e.mirrorPlane){let i=f._CreateMirror(e.name,e.renderTargetSize,t,s);return i._waitingRenderList=e.renderList,i.mirrorPlane=u.Plane.FromArray(e.mirrorPlane),a(i),i}if(e.isRenderTarget&&!e.base64String){let i=null;if(e.isCube){if(t.reflectionProbes)for(let i=0;i<t.reflectionProbes.length;i++){let r=t.reflectionProbes[i];if(r.name===e.name)return r.cubeTexture}}else(i=f._CreateRenderTargetTexture(e.name,e.renderTargetSize,t,s,e._creationFlags??0))._waitingRenderList=e.renderList;return a(i),i}if(e.isVideo){let r=f._CreateVideoTexture(i+(e.url||e.name),i+(e.src||e.url),t,s,e.invertY,e.samplingMode,e.settings||{});return a(r),r}{let n;if("string"==typeof e.base64String&&e.base64String&&!r){let i={buffer:e.base64String,noMipmap:!s,invertY:e.invertY,samplingMode:e.samplingMode,useSRGBBuffer:e._useSRGBBuffer??!1,creationFlags:e._creationFlags??0,onLoad:()=>{a(n)}},r=e.base64String,h=r.startsWith("data:")?r.substring(5):r;(n=f.CreateFromBase64String("",h,t,i)).name=e.name}else{let h;h=e.name&&(e.name.indexOf("://")>0||e.name.startsWith("data:"))?e.name:i+e.name,e.url&&(e.url.startsWith("data:")||f.UseSerializedUrlIfAny)&&(h=e.url),n=new f(h,t,{noMipmap:!s,invertY:e.invertY,samplingMode:e.samplingMode,useSRGBBuffer:e._useSRGBBuffer??!1,creationFlags:e._creationFlags??0,onLoad:()=>{a(n)},internalTexture:r})}return n}},e,t)}static CreateFromBase64String(e,t,i,r,s,a=f.TRILINEAR_SAMPLINGMODE,n=null,h=null,o=5,l,u){return new f("data:"+t,i,r,s,a,n,h,e,!1,o,void 0,void 0,l,u)}static LoadFromDataString(e,t,i,r=!1,s,a=!0,n=f.TRILINEAR_SAMPLINGMODE,h=null,o=null,l=5,u,_){return"data:"!==e.substring(0,5)&&(e="data:"+e),new f(e,i,s,a,n,h,o,t,r,l,void 0,void 0,u,_)}}f.SerializeBuffers=!0,f.ForceSerializeBuffers=!1,f.OnTextureLoadErrorObservable=new r.Observable,f._SerializeInternalTextureUniqueId=!1,f._CubeTextureParser=(e,t,i)=>{throw(0,h._WarnImport)("CubeTexture")},f._CreateMirror=(e,t,i,r)=>{throw(0,h._WarnImport)("MirrorTexture")},f._CreateRenderTargetTexture=(e,t,i,r,s)=>{throw(0,h._WarnImport)("RenderTargetTexture")},f.NEAREST_SAMPLINGMODE=1,f.NEAREST_NEAREST_MIPLINEAR=8,f.BILINEAR_SAMPLINGMODE=2,f.LINEAR_LINEAR_MIPNEAREST=11,f.TRILINEAR_SAMPLINGMODE=3,f.LINEAR_LINEAR_MIPLINEAR=3,f.NEAREST_NEAREST_MIPNEAREST=4,f.NEAREST_LINEAR_MIPNEAREST=5,f.NEAREST_LINEAR_MIPLINEAR=6,f.NEAREST_LINEAR=7,f.NEAREST_NEAREST=1,f.LINEAR_NEAREST_MIPNEAREST=9,f.LINEAR_NEAREST_MIPLINEAR=10,f.LINEAR_LINEAR=2,f.LINEAR_NEAREST=12,f.EXPLICIT_MODE=0,f.SPHERICAL_MODE=1,f.PLANAR_MODE=2,f.CUBIC_MODE=3,f.PROJECTION_MODE=4,f.SKYBOX_MODE=5,f.INVCUBIC_MODE=6,f.EQUIRECTANGULAR_MODE=7,f.FIXED_EQUIRECTANGULAR_MODE=8,f.FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,f.CLAMP_ADDRESSMODE=0,f.WRAP_ADDRESSMODE=1,f.MIRROR_ADDRESSMODE=2,f.UseSerializedUrlIfAny=!1,(0,t.__decorate)([(0,i.serialize)()],f.prototype,"url",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"uOffset",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"vOffset",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"uScale",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"vScale",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"uAng",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"vAng",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"wAng",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"uRotationCenter",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"vRotationCenter",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"wRotationCenter",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"homogeneousRotationInUVTransform",void 0),(0,t.__decorate)([(0,i.serialize)()],f.prototype,"isBlocking",null),e.s(["Texture",0,f],58720)}]);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,39218,e=>{"use strict";var r=e.i(12423);let t="passPixelShader",a=`varying vec2 vUV;uniform sampler2D textureSampler;
|
|
2
|
+
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
3
|
+
void main(void)
|
|
4
|
+
{gl_FragColor=texture2D(textureSampler,vUV);}`;r.ShaderStore.ShadersStore[t]||(r.ShaderStore.ShadersStore[t]=a),e.s(["passPixelShader",0,{name:t,shader:a}])}]);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96265,89030,48657,88438,t=>{"use strict";let e=(1+Math.sqrt(5))/2;function r(t,e){let r=[];for(let i=0;i<t;++i)r.push(e());return r}function i(t,e){return r(t,e)}t.s(["Epsilon",0,.001,"PHI",0,e,"ToGammaSpace",0,1/2.2,"ToLinearSpace",0,2.2],89030);let s=["push","splice","pop","shift","unshift"];t.s(["BuildArray",0,r,"BuildTuple",0,i,"_ObserveArray",0,function(t,e){let r=s.map(r=>(function(t,e,r){let i=t[e];if("function"!=typeof i)return null;let s=function(){let i=t.length,o=s.previous.apply(t,arguments);return r(e,i),o};return i.next=s,s.previous=i,t[e]=s,()=>{let r=s.previous;if(!r)return;let i=s.next;i?(r.next=i,i.previous=r):(r.next=void 0,t[e]=r),s.next=void 0,s.previous=void 0}})(t,r,e));return()=>{for(let t of r)t?.()}}],48657);var o=t.i(86985),a=t.i(81623),n=t.i(46703);class h{}function _(t){t.updateFlag=h._UpdateFlagSeed++}function l(t,e,r,i=0){let s=t.asArray(),o=e.asArray(),a=s[0],n=s[1],h=s[2],_=s[3],y=s[4],u=s[5],m=s[6],c=s[7],x=s[8],f=s[9],R=s[10],d=s[11],z=s[12],T=s[13],w=s[14],p=s[15],F=o[0],M=o[1],g=o[2],I=o[3],A=o[4],P=o[5],D=o[6],C=o[7],V=o[8],v=o[9],L=o[10],k=o[11],O=o[12],H=o[13],U=o[14],b=o[15];r[i]=a*F+n*A+h*V+_*O,r[i+1]=a*M+n*P+h*v+_*H,r[i+2]=a*g+n*D+h*L+_*U,r[i+3]=a*I+n*C+h*k+_*b,r[i+4]=y*F+u*A+m*V+c*O,r[i+5]=y*M+u*P+m*v+c*H,r[i+6]=y*g+u*D+m*L+c*U,r[i+7]=y*I+u*C+m*k+c*b,r[i+8]=x*F+f*A+R*V+d*O,r[i+9]=x*M+f*P+R*v+d*H,r[i+10]=x*g+f*D+R*L+d*U,r[i+11]=x*I+f*C+R*k+d*b,r[i+12]=z*F+T*A+w*V+p*O,r[i+13]=z*M+T*P+w*v+p*H,r[i+14]=z*g+T*D+w*L+p*U,r[i+15]=z*I+T*C+w*k+p*b}function y(t,e,r=0){let i=t.asArray();e[r]=i[0],e[r+1]=i[1],e[r+2]=i[2],e[r+3]=i[3],e[r+4]=i[4],e[r+5]=i[5],e[r+6]=i[6],e[r+7]=i[7],e[r+8]=i[8],e[r+9]=i[9],e[r+10]=i[10],e[r+11]=i[11],e[r+12]=i[12],e[r+13]=i[13],e[r+14]=i[14],e[r+15]=i[15]}function u(t,e){let r=t.asArray(),i=r[0],s=r[1],o=r[2],a=r[3],n=r[4],h=r[5],_=r[6],l=r[7],y=r[8],u=r[9],m=r[10],c=r[11],x=r[12],f=r[13],R=r[14],d=r[15],z=m*d-R*c,T=u*d-f*c,w=u*R-f*m,p=y*d-x*c,F=y*R-m*x,M=y*f-x*u,g=+(h*z-_*T+l*w),I=-(n*z-_*p+l*F),A=+(n*T-h*p+l*M),P=-(n*w-h*F+_*M),D=i*g+s*I+o*A+a*P;if(0===D)return!1;let C=1/D,V=_*d-R*l,v=h*d-f*l,L=h*R-f*_,k=n*d-x*l,O=n*R-x*_,H=n*f-x*h,U=_*c-m*l,b=h*c-u*l,S=h*m-u*_,q=n*c-y*l,E=n*m-y*_,N=n*u-y*h;return e[0]=g*C,e[1]=-(s*z-o*T+a*w)*C,e[2]=(s*V-o*v+a*L)*C,e[3]=-(s*U-o*b+a*S)*C,e[4]=I*C,e[5]=(i*z-o*p+a*F)*C,e[6]=-(i*V-o*k+a*O)*C,e[7]=(i*U-o*q+a*E)*C,e[8]=A*C,e[9]=-(i*T-s*p+a*M)*C,e[10]=(i*v-s*k+a*H)*C,e[11]=-(i*b-s*q+a*N)*C,e[12]=P*C,e[13]=(i*w-s*F+o*M)*C,e[14]=-(i*L-s*O+o*H)*C,e[15]=(i*S-s*E+o*N)*C,!0}h._UpdateFlagSeed=0,t.s(["CopyMatrixToArray",0,y,"InvertMatrixToArray",0,u,"InvertMatrixToRef",0,function(t,e){let r=u(t,e.asArray());return r&&_(e),r},"MatrixManagement",0,h,"MultiplyMatricesToArray",0,l,"MultiplyMatricesToRef",0,function(t,e,r,i=0){l(t,e,r.asArray(),i),_(r)}],88438);var m=t.i(77052);let c=t=>parseInt(t.toString().replace(/\W/g,""));class x{constructor(t=0,e=0){this.x=t,this.y=e}toString(){return`{X: ${this.x} Y: ${this.y}}`}getClassName(){return"Vector2"}getHashCode(){let t=c(this.x),e=c(this.y),r=t;return 397*r^e}toArray(t,e=0){return t[e]=this.x,t[e+1]=this.y,this}fromArray(t,e=0){return x.FromArrayToRef(t,e,this),this}asArray(){return[this.x,this.y]}copyFrom(t){return this.x=t.x,this.y=t.y,this}copyFromFloats(t,e){return this.x=t,this.y=e,this}set(t,e){return this.copyFromFloats(t,e)}setAll(t){return this.copyFromFloats(t,t)}add(t){return new x(this.x+t.x,this.y+t.y)}addToRef(t,e){return e.x=this.x+t.x,e.y=this.y+t.y,e}addInPlace(t){return this.x+=t.x,this.y+=t.y,this}addInPlaceFromFloats(t,e){return this.x+=t,this.y+=e,this}addVector3(t){return new x(this.x+t.x,this.y+t.y)}subtract(t){return new x(this.x-t.x,this.y-t.y)}subtractToRef(t,e){return e.x=this.x-t.x,e.y=this.y-t.y,e}subtractInPlace(t){return this.x-=t.x,this.y-=t.y,this}multiplyInPlace(t){return this.x*=t.x,this.y*=t.y,this}multiply(t){return new x(this.x*t.x,this.y*t.y)}multiplyToRef(t,e){return e.x=this.x*t.x,e.y=this.y*t.y,e}multiplyByFloats(t,e){return new x(this.x*t,this.y*e)}divide(t){return new x(this.x/t.x,this.y/t.y)}divideToRef(t,e){return e.x=this.x/t.x,e.y=this.y/t.y,e}divideInPlace(t){return this.x=this.x/t.x,this.y=this.y/t.y,this}minimizeInPlace(t){return this.minimizeInPlaceFromFloats(t.x,t.y)}maximizeInPlace(t){return this.maximizeInPlaceFromFloats(t.x,t.y)}minimizeInPlaceFromFloats(t,e){return this.x=Math.min(t,this.x),this.y=Math.min(e,this.y),this}maximizeInPlaceFromFloats(t,e){return this.x=Math.max(t,this.x),this.y=Math.max(e,this.y),this}subtractFromFloats(t,e){return new x(this.x-t,this.y-e)}subtractFromFloatsToRef(t,e,r){return r.x=this.x-t,r.y=this.y-e,r}negate(){return new x(-this.x,-this.y)}negateInPlace(){return this.x*=-1,this.y*=-1,this}negateToRef(t){return t.x=-this.x,t.y=-this.y,t}scaleInPlace(t){return this.x*=t,this.y*=t,this}scale(t){return new x(this.x*t,this.y*t)}scaleToRef(t,e){return e.x=this.x*t,e.y=this.y*t,e}scaleAndAddToRef(t,e){return e.x+=this.x*t,e.y+=this.y*t,e}equals(t){return t&&this.x===t.x&&this.y===t.y}equalsWithEpsilon(t,e=.001){return t&&(0,n.WithinEpsilon)(this.x,t.x,e)&&(0,n.WithinEpsilon)(this.y,t.y,e)}equalsToFloats(t,e){return this.x===t&&this.y===e}floor(){return new x(Math.floor(this.x),Math.floor(this.y))}floorToRef(t){return t.x=Math.floor(this.x),t.y=Math.floor(this.y),t}fract(){return new x(this.x-Math.floor(this.x),this.y-Math.floor(this.y))}fractToRef(t){return t.x=this.x-Math.floor(this.x),t.y=this.y-Math.floor(this.y),t}rotate(t){return this.rotateToRef(t,new x)}rotateToRef(t,e){let r=Math.cos(t),i=Math.sin(t);return e.x=r*this.x-i*this.y,e.y=i*this.x+r*this.y,e}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(t){return 0===t||1===t?this:this.scaleInPlace(1/t)}normalizeToNew(){let t=new x;return this.normalizeToRef(t),t}normalizeToRef(t){let e=this.length();return 0===e&&(t.x=this.x,t.y=this.y),this.scaleToRef(1/e,t)}clone(){return new x(this.x,this.y)}dot(t){return this.x*t.x+this.y*t.y}static Zero(){return new x(0,0)}static One(){return new x(1,1)}static Random(t=0,e=1){return new x((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.copyFromFloats((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static get ZeroReadOnly(){return x._ZeroReadOnly}static FromArray(t,e=0){return new x(t[e],t[e+1])}static FromArrayToRef(t,e,r){return r.x=t[e],r.y=t[e+1],r}static FromFloatsToRef(t,e,r){return r.copyFromFloats(t,e),r}static CatmullRom(t,e,r,i,s){let o=s*s,a=s*o;return new x(.5*(2*e.x+(-t.x+r.x)*s+(2*t.x-5*e.x+4*r.x-i.x)*o+(-t.x+3*e.x-3*r.x+i.x)*a),.5*(2*e.y+(-t.y+r.y)*s+(2*t.y-5*e.y+4*r.y-i.y)*o+(-t.y+3*e.y-3*r.y+i.y)*a))}static ClampToRef(t,e,r,i){return i.x=(0,n.Clamp)(t.x,e.x,r.x),i.y=(0,n.Clamp)(t.y,e.y,r.y),i}static Clamp(t,e,r){return new x((0,n.Clamp)(t.x,e.x,r.x),(0,n.Clamp)(t.y,e.y,r.y))}static Hermite(t,e,r,i,s){let o=s*s,a=s*o,n=2*a-3*o+1,h=-2*a+3*o,_=a-2*o+s,l=a-o;return new x(t.x*n+r.x*h+e.x*_+i.x*l,t.y*n+r.y*h+e.y*_+i.y*l)}static Hermite1stDerivative(t,e,r,i,s){return this.Hermite1stDerivativeToRef(t,e,r,i,s,new x)}static Hermite1stDerivativeToRef(t,e,r,i,s,o){let a=s*s;return o.x=(a-s)*6*t.x+(3*a-4*s+1)*e.x+(-a+s)*6*r.x+(3*a-2*s)*i.x,o.y=(a-s)*6*t.y+(3*a-4*s+1)*e.y+(-a+s)*6*r.y+(3*a-2*s)*i.y,o}static Lerp(t,e,r){return x.LerpToRef(t,e,r,new x)}static LerpToRef(t,e,r,i){return i.x=t.x+(e.x-t.x)*r,i.y=t.y+(e.y-t.y)*r,i}static Dot(t,e){return t.x*e.x+t.y*e.y}static Normalize(t){return x.NormalizeToRef(t,new x)}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Minimize(t,e){return new x(t.x<e.x?t.x:e.x,t.y<e.y?t.y:e.y)}static Maximize(t,e){return new x(t.x>e.x?t.x:e.x,t.y>e.y?t.y:e.y)}static Transform(t,e){return x.TransformToRef(t,e,new x)}static TransformToRef(t,e,r){let i=e.m,s=t.x*i[0]+t.y*i[4]+i[12],o=t.x*i[1]+t.y*i[5]+i[13];return r.x=s,r.y=o,r}static PointInTriangle(t,e,r,i){let s=.5*(-r.y*i.x+e.y*(-r.x+i.x)+e.x*(r.y-i.y)+r.x*i.y),o=s<0?-1:1,a=(e.y*i.x-e.x*i.y+(i.y-e.y)*t.x+(e.x-i.x)*t.y)*o,n=(e.x*r.y-e.y*r.x+(e.y-r.y)*t.x+(r.x-e.x)*t.y)*o;return a>0&&n>0&&a+n<2*s*o}static Distance(t,e){return Math.sqrt(x.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t.x-e.x,i=t.y-e.y;return r*r+i*i}static Center(t,e){return x.CenterToRef(t,e,new x)}static CenterToRef(t,e,r){return r.copyFromFloats((t.x+e.x)/2,(t.y+e.y)/2)}static DistanceOfPointFromSegment(t,e,r){let i=x.DistanceSquared(e,r);if(0===i)return x.Distance(t,e);let s=r.subtract(e),o=Math.max(0,Math.min(1,x.Dot(t.subtract(e),s)/i)),a=e.add(s.multiplyByFloats(o,o));return x.Distance(t,a)}}x._V8PerformanceHack=new x(.5,.5),x._ZeroReadOnly=x.Zero();class f{get x(){return this._x}set x(t){this._x=t,this._isDirty=!0}get y(){return this._y}set y(t){this._y=t,this._isDirty=!0}get z(){return this._z}set z(t){this._z=t,this._isDirty=!0}constructor(t=0,e=0,r=0){this._isDirty=!0,this._x=t,this._y=e,this._z=r}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z}}`}getClassName(){return"Vector3"}getHashCode(){let t=c(this._x),e=c(this._y),r=c(this._z),i=t;return 397*(i=397*i^e)^r}asArray(){return[this._x,this._y,this._z]}toArray(t,e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,this}fromArray(t,e=0){return f.FromArrayToRef(t,e,this),this}toQuaternion(){return d.RotationYawPitchRoll(this._y,this._x,this._z)}addInPlace(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this._isDirty=!0,this}addInPlaceFromFloats(t,e,r){return this._x+=t,this._y+=e,this._z+=r,this._isDirty=!0,this}add(t){return new f(this._x+t._x,this._y+t._y,this._z+t._z)}addToRef(t,e){return e._x=this._x+t._x,e._y=this._y+t._y,e._z=this._z+t._z,e._isDirty=!0,e}subtractInPlace(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this._isDirty=!0,this}subtract(t){return new f(this._x-t._x,this._y-t._y,this._z-t._z)}subtractToRef(t,e){return this.subtractFromFloatsToRef(t._x,t._y,t._z,e)}subtractFromFloats(t,e,r){return new f(this._x-t,this._y-e,this._z-r)}subtractFromFloatsToRef(t,e,r,i){return i._x=this._x-t,i._y=this._y-e,i._z=this._z-r,i._isDirty=!0,i}negate(){return new f(-this._x,-this._y,-this._z)}negateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}negateToRef(t){return t._x=-1*this._x,t._y=-1*this._y,t._z=-1*this._z,t._isDirty=!0,t}scaleInPlace(t){return this._x*=t,this._y*=t,this._z*=t,this._isDirty=!0,this}scale(t){return new f(this._x*t,this._y*t,this._z*t)}scaleToRef(t,e){return e._x=this._x*t,e._y=this._y*t,e._z=this._z*t,e._isDirty=!0,e}getNormalToRef(t){let e=this.length(),r=Math.acos(this._y/e),i=Math.atan2(this._z,this._x);r>Math.PI/2?r-=Math.PI/2:r+=Math.PI/2;let s=e*Math.sin(r)*Math.cos(i),o=e*Math.cos(r),a=e*Math.sin(r)*Math.sin(i);return t.set(s,o,a),t}applyRotationQuaternionToRef(t,e){let r=this._x,i=this._y,s=this._z,o=t._x,a=t._y,n=t._z,h=t._w,_=2*(a*s-n*i),l=2*(n*r-o*s),y=2*(o*i-a*r);return e._x=r+h*_+a*y-n*l,e._y=i+h*l+n*_-o*y,e._z=s+h*y+o*l-a*_,e._isDirty=!0,e}applyRotationQuaternionInPlace(t){return this.applyRotationQuaternionToRef(t,this)}applyRotationQuaternion(t){return this.applyRotationQuaternionToRef(t,new f)}scaleAndAddToRef(t,e){return e._x+=this._x*t,e._y+=this._y*t,e._z+=this._z*t,e._isDirty=!0,e}projectOnPlane(t,e){return this.projectOnPlaneToRef(t,e,new f)}projectOnPlaneToRef(t,e,r){let i=t.normal,s=t.d,o=T.Vector3[0];this.subtractToRef(e,o),o.normalize();let a=f.Dot(o,i);if(1e-10>Math.abs(a))r.setAll(1/0);else{let t=-(f.Dot(e,i)+s)/a,n=o.scaleInPlace(t);e.addToRef(n,r)}return r}equals(t){return t&&this._x===t._x&&this._y===t._y&&this._z===t._z}equalsWithEpsilon(t,e=.001){return t&&(0,n.WithinEpsilon)(this._x,t._x,e)&&(0,n.WithinEpsilon)(this._y,t._y,e)&&(0,n.WithinEpsilon)(this._z,t._z,e)}equalsToFloats(t,e,r){return this._x===t&&this._y===e&&this._z===r}multiplyInPlace(t){return this._x*=t._x,this._y*=t._y,this._z*=t._z,this._isDirty=!0,this}multiply(t){return this.multiplyByFloats(t._x,t._y,t._z)}multiplyToRef(t,e){return e._x=this._x*t._x,e._y=this._y*t._y,e._z=this._z*t._z,e._isDirty=!0,e}multiplyByFloats(t,e,r){return new f(this._x*t,this._y*e,this._z*r)}divide(t){return new f(this._x/t._x,this._y/t._y,this._z/t._z)}divideToRef(t,e){return e._x=this._x/t._x,e._y=this._y/t._y,e._z=this._z/t._z,e._isDirty=!0,e}divideInPlace(t){return this._x=this._x/t._x,this._y=this._y/t._y,this._z=this._z/t._z,this._isDirty=!0,this}minimizeInPlace(t){return this.minimizeInPlaceFromFloats(t._x,t._y,t._z)}maximizeInPlace(t){return this.maximizeInPlaceFromFloats(t._x,t._y,t._z)}minimizeInPlaceFromFloats(t,e,r){return t<this._x&&(this.x=t),e<this._y&&(this.y=e),r<this._z&&(this.z=r),this}maximizeInPlaceFromFloats(t,e,r){return t>this._x&&(this.x=t),e>this._y&&(this.y=e),r>this._z&&(this.z=r),this}isNonUniformWithinEpsilon(t){let e=Math.abs(this._x),r=Math.abs(this._y);if(!(0,n.WithinEpsilon)(e,r,t))return!0;let i=Math.abs(this._z);return!((0,n.WithinEpsilon)(e,i,t)&&(0,n.WithinEpsilon)(r,i,t))}get isNonUniform(){let t=Math.abs(this._x);return t!==Math.abs(this._y)||t!==Math.abs(this._z)}floorToRef(t){return t._x=Math.floor(this._x),t._y=Math.floor(this._y),t._z=Math.floor(this._z),t._isDirty=!0,t}floor(){return new f(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))}fractToRef(t){return t._x=this._x-Math.floor(this._x),t._y=this._y-Math.floor(this._y),t._z=this._z-Math.floor(this._z),t._isDirty=!0,t}fract(){return new f(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z}get hasAZeroComponent(){return this._x*this._y*this._z==0}normalize(){return this.normalizeFromLength(this.length())}reorderInPlace(t){if("xyz"===(t=t.toLowerCase()))return this;let e=T.Vector3[0].copyFrom(this);return this.x=e[t[0]],this.y=e[t[1]],this.z=e[t[2]],this}rotateByQuaternionToRef(t,e){return t.toRotationMatrix(T.Matrix[0]),f.TransformCoordinatesToRef(this,T.Matrix[0],e),e}rotateByQuaternionAroundPointToRef(t,e,r){return this.subtractToRef(e,T.Vector3[0]),T.Vector3[0].rotateByQuaternionToRef(t,T.Vector3[0]),e.addToRef(T.Vector3[0],r),r}cross(t){return f.CrossToRef(this,t,new f)}normalizeFromLength(t){return 0===t||1===t?this:this.scaleInPlace(1/t)}normalizeToNew(){return this.normalizeToRef(new f)}normalizeToRef(t){let e=this.length();return 0===e||1===e?(t._x=this._x,t._y=this._y,t._z=this._z,t._isDirty=!0,t):this.scaleToRef(1/e,t)}clone(){return new f(this._x,this._y,this._z)}copyFrom(t){return this.copyFromFloats(t._x,t._y,t._z)}copyFromFloats(t,e,r){return this._x=t,this._y=e,this._z=r,this._isDirty=!0,this}set(t,e,r){return this.copyFromFloats(t,e,r)}setAll(t){return this._x=this._y=this._z=t,this._isDirty=!0,this}static GetClipFactor(t,e,r,i){let s=f.Dot(t,r);return(s-i)/(s-f.Dot(e,r))}static GetAngleBetweenVectors(t,e,r){let i=t.normalizeToRef(T.Vector3[1]),s=e.normalizeToRef(T.Vector3[2]),o=f.Dot(i,s),a=Math.acos(o=(0,n.Clamp)(o,-1,1)),h=T.Vector3[3];return(f.CrossToRef(i,s,h),f.Dot(h,r)>0)?isNaN(a)?0:a:isNaN(a)?-Math.PI:-Math.acos(o)}static GetAngleBetweenVectorsOnPlane(t,e,r){T.Vector3[0].copyFrom(t);let i=T.Vector3[0];T.Vector3[1].copyFrom(e);let s=T.Vector3[1];T.Vector3[2].copyFrom(r);let o=T.Vector3[2],a=T.Vector3[3],h=T.Vector3[4];i.normalize(),s.normalize(),o.normalize(),f.CrossToRef(o,i,a),f.CrossToRef(a,o,h);let _=Math.atan2(f.Dot(s,a),f.Dot(s,h));return(0,n.NormalizeRadians)(_)}static PitchYawRollToMoveBetweenPointsToRef(t,e,r){let i=w.Vector3[0];return e.subtractToRef(t,i),r._y=Math.atan2(i.x,i.z)||0,r._x=Math.atan2(Math.sqrt(i.x**2+i.z**2),i.y)||0,r._z=0,r._isDirty=!0,r}static PitchYawRollToMoveBetweenPoints(t,e){let r=f.Zero();return f.PitchYawRollToMoveBetweenPointsToRef(t,e,r)}static SlerpToRef(t,e,r,i){let s,o;r=(0,n.Clamp)(r,0,1);let a=T.Vector3[0],h=T.Vector3[1];a.copyFrom(t);let _=a.length();a.normalizeFromLength(_),h.copyFrom(e);let l=h.length();h.normalizeFromLength(l);let y=f.Dot(a,h);if(y<.999){let t=Math.acos(y),e=1/Math.sin(t);s=Math.sin((1-r)*t)*e,o=Math.sin(r*t)*e}else s=1-r,o=r;return a.scaleInPlace(s),h.scaleInPlace(o),i.copyFrom(a).addInPlace(h),i.scaleInPlace((0,n.Lerp)(_,l,r)),i}static SmoothToRef(t,e,r,i,s){return f.SlerpToRef(t,e,0===i?1:r/i,s),s}static FromArray(t,e=0){return new f(t[e],t[e+1],t[e+2])}static FromFloatArray(t,e){return f.FromArray(t,e)}static FromArrayToRef(t,e,r){return r._x=t[e],r._y=t[e+1],r._z=t[e+2],r._isDirty=!0,r}static FromFloatArrayToRef(t,e,r){return f.FromArrayToRef(t,e,r)}static FromFloatsToRef(t,e,r,i){return i.copyFromFloats(t,e,r),i}static Zero(){return new f(0,0,0)}static One(){return new f(1,1,1)}static Up(){return new f(0,1,0)}static get UpReadOnly(){return f._UpReadOnly}static get DownReadOnly(){return f._DownReadOnly}static get RightReadOnly(){return f._RightReadOnly}static get LeftReadOnly(){return f._LeftReadOnly}static get LeftHandedForwardReadOnly(){return f._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return f._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return f._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return f._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return f._ZeroReadOnly}static get OneReadOnly(){return f._OneReadOnly}static Down(){return new f(0,-1,0)}static Forward(t=!1){return new f(0,0,t?-1:1)}static Backward(t=!1){return new f(0,0,t?1:-1)}static Right(){return new f(1,0,0)}static Left(){return new f(-1,0,0)}static Random(t=0,e=1){return new f((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.copyFromFloats((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static TransformCoordinates(t,e){let r=f.Zero();return f.TransformCoordinatesToRef(t,e,r),r}static TransformCoordinatesToRef(t,e,r){return f.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,e,r),r}static TransformCoordinatesFromFloatsToRef(t,e,r,i,s){let o=i.m,a=t*o[0]+e*o[4]+r*o[8]+o[12],n=t*o[1]+e*o[5]+r*o[9]+o[13],h=t*o[2]+e*o[6]+r*o[10]+o[14],_=1/(t*o[3]+e*o[7]+r*o[11]+o[15]);return s._x=a*_,s._y=n*_,s._z=h*_,s._isDirty=!0,s}static TransformNormal(t,e){let r=f.Zero();return f.TransformNormalToRef(t,e,r),r}static TransformNormalToRef(t,e,r){return this.TransformNormalFromFloatsToRef(t._x,t._y,t._z,e,r),r}static TransformNormalFromFloatsToRef(t,e,r,i,s){let o=i.m;return s._x=t*o[0]+e*o[4]+r*o[8],s._y=t*o[1]+e*o[5]+r*o[9],s._z=t*o[2]+e*o[6]+r*o[10],s._isDirty=!0,s}static CatmullRom(t,e,r,i,s){let o=s*s,a=s*o;return new f(.5*(2*e._x+(-t._x+r._x)*s+(2*t._x-5*e._x+4*r._x-i._x)*o+(-t._x+3*e._x-3*r._x+i._x)*a),.5*(2*e._y+(-t._y+r._y)*s+(2*t._y-5*e._y+4*r._y-i._y)*o+(-t._y+3*e._y-3*r._y+i._y)*a),.5*(2*e._z+(-t._z+r._z)*s+(2*t._z-5*e._z+4*r._z-i._z)*o+(-t._z+3*e._z-3*r._z+i._z)*a))}static Clamp(t,e,r){let i=new f;return f.ClampToRef(t,e,r,i),i}static ClampToRef(t,e,r,i){let s=t._x;s=(s=s>r._x?r._x:s)<e._x?e._x:s;let o=t._y;o=(o=o>r._y?r._y:o)<e._y?e._y:o;let a=t._z;return a=(a=a>r._z?r._z:a)<e._z?e._z:a,i.copyFromFloats(s,o,a),i}static CheckExtends(t,e,r){e.minimizeInPlace(t),r.maximizeInPlace(t)}static Hermite(t,e,r,i,s){let o=s*s,a=s*o,n=2*a-3*o+1,h=-2*a+3*o,_=a-2*o+s,l=a-o;return new f(t._x*n+r._x*h+e._x*_+i._x*l,t._y*n+r._y*h+e._y*_+i._y*l,t._z*n+r._z*h+e._z*_+i._z*l)}static Hermite1stDerivative(t,e,r,i,s){let o=new f;return this.Hermite1stDerivativeToRef(t,e,r,i,s,o),o}static Hermite1stDerivativeToRef(t,e,r,i,s,o){let a=s*s;return o._x=(a-s)*6*t._x+(3*a-4*s+1)*e._x+(-a+s)*6*r._x+(3*a-2*s)*i._x,o._y=(a-s)*6*t._y+(3*a-4*s+1)*e._y+(-a+s)*6*r._y+(3*a-2*s)*i._y,o._z=(a-s)*6*t._z+(3*a-4*s+1)*e._z+(-a+s)*6*r._z+(3*a-2*s)*i._z,o._isDirty=!0,o}static Lerp(t,e,r){let i=new f(0,0,0);return f.LerpToRef(t,e,r,i),i}static LerpToRef(t,e,r,i){return i._x=t._x+(e._x-t._x)*r,i._y=t._y+(e._y-t._y)*r,i._z=t._z+(e._z-t._z)*r,i._isDirty=!0,i}static Dot(t,e){return t._x*e._x+t._y*e._y+t._z*e._z}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z}static Cross(t,e){let r=new f;return f.CrossToRef(t,e,r),r}static CrossToRef(t,e,r){let i=t._y*e._z-t._z*e._y,s=t._z*e._x-t._x*e._z,o=t._x*e._y-t._y*e._x;return r.copyFromFloats(i,s,o),r}static Normalize(t){let e=f.Zero();return f.NormalizeToRef(t,e),e}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Project(t,e,r,i){let s=new f;return f.ProjectToRef(t,e,r,i,s),s}static ProjectToRef(t,e,r,i,s){let o=i.width,n=i.height,h=i.x,_=i.y,l=T.Matrix[1],y=a.EngineStore.LastCreatedEngine?.isNDCHalfZRange;z.FromValuesToRef(o/2,0,0,0,0,-n/2,0,0,0,0,y?1:.5,0,h+o/2,n/2+_,.5*!y,1,l);let u=T.Matrix[0];return e.multiplyToRef(r,u),u.multiplyToRef(l,u),f.TransformCoordinatesToRef(t,u,s),s}static Reflect(t,e){return this.ReflectToRef(t,e,new f)}static ReflectToRef(t,e,r){let i=w.Vector3[0];return i.copyFrom(e).scaleInPlace(2*f.Dot(t,e)),r.copyFrom(t).subtractInPlace(i)}static UnprojectFromTransform(t,e,r,i,s){return this.Unproject(t,e,r,i,s,z.IdentityReadOnly)}static Unproject(t,e,r,i,s,o){let a=new f;return f.UnprojectToRef(t,e,r,i,s,o,a),a}static UnprojectToRef(t,e,r,i,s,o,a){return f.UnprojectFloatsToRef(t._x,t._y,t._z,e,r,i,s,o,a),a}static UnprojectFloatsToRef(t,e,r,i,s,o,n,h,_){let l=T.Matrix[0];o.multiplyToRef(n,l),l.multiplyToRef(h,l),l.invert();let y=T.Vector3[0];return y.x=t/i*2-1,y.y=-(e/s*2-1),a.EngineStore.LastCreatedEngine?.isNDCHalfZRange?y.z=r:y.z=2*r-1,f.TransformCoordinatesToRef(y,l,_),_}static Minimize(t,e){let r=new f;return r.copyFrom(t),r.minimizeInPlace(e),r}static Maximize(t,e){let r=new f;return r.copyFrom(t),r.maximizeInPlace(e),r}static Distance(t,e){return Math.sqrt(f.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t._x-e._x,i=t._y-e._y,s=t._z-e._z;return r*r+i*i+s*s}static ProjectOnTriangleToRef(t,e,r,i,s){let o,a,h=T.Vector3[0],_=T.Vector3[1],l=T.Vector3[2],y=T.Vector3[3],u=T.Vector3[4];r.subtractToRef(e,h),i.subtractToRef(e,_),i.subtractToRef(r,l);let m=h.length(),c=_.length(),x=l.length();if(m<.001||c<.001||x<.001)return s.copyFrom(e),f.Distance(t,e);t.subtractToRef(e,u),f.CrossToRef(h,_,y);let R=y.length();if(R<.001)return s.copyFrom(e),f.Distance(t,e);y.normalizeFromLength(R);let d=u.length();if(d<.001)return s.copyFrom(e),0;u.normalizeFromLength(d);let z=f.Dot(y,u),w=T.Vector3[5],p=T.Vector3[6];w.copyFrom(y).scaleInPlace(-d*z),p.copyFrom(t).addInPlace(w);let F=T.Vector3[4],M=T.Vector3[5],g=T.Vector3[7],I=T.Vector3[8];F.copyFrom(h).scaleInPlace(1/m),I.copyFrom(_).scaleInPlace(1/c),F.addInPlace(I).scaleInPlace(-1),M.copyFrom(h).scaleInPlace(-1/m),I.copyFrom(l).scaleInPlace(1/x),M.addInPlace(I).scaleInPlace(-1),g.copyFrom(l).scaleInPlace(-1/x),I.copyFrom(_).scaleInPlace(-1/c),g.addInPlace(I).scaleInPlace(-1);let A=T.Vector3[9];A.copyFrom(p).subtractInPlace(e),f.CrossToRef(F,A,I);let P=f.Dot(I,y);A.copyFrom(p).subtractInPlace(r),f.CrossToRef(M,A,I);let D=f.Dot(I,y);A.copyFrom(p).subtractInPlace(i),f.CrossToRef(g,A,I);let C=f.Dot(I,y),V=T.Vector3[10];P>0&&D<0?(V.copyFrom(h),o=e,a=r):D>0&&C<0?(V.copyFrom(l),o=r,a=i):(V.copyFrom(_).scaleInPlace(-1),o=i,a=e);let v=T.Vector3[9],L=T.Vector3[4];if(o.subtractToRef(p,I),a.subtractToRef(p,v),f.CrossToRef(I,v,L),!(0>f.Dot(L,y)))return s.copyFrom(p),Math.abs(d*z);let k=T.Vector3[5];f.CrossToRef(V,L,k),k.normalize();let O=T.Vector3[9];O.copyFrom(o).subtractInPlace(p);let H=O.length();if(H<.001)return s.copyFrom(o),f.Distance(t,o);O.normalizeFromLength(H);let U=f.Dot(k,O),b=T.Vector3[7];b.copyFrom(p).addInPlace(k.scaleInPlace(H*U)),I.copyFrom(b).subtractInPlace(o),d=V.length(),V.normalizeFromLength(d);let S=f.Dot(I,V)/Math.max(d,.001);return S=(0,n.Clamp)(S,0,1),b.copyFrom(o).addInPlace(V.scaleInPlace(S*d)),s.copyFrom(b),f.Distance(t,b)}static Center(t,e){return f.CenterToRef(t,e,f.Zero())}static CenterToRef(t,e,r){return r.copyFromFloats((t._x+e._x)/2,(t._y+e._y)/2,(t._z+e._z)/2)}static RotationFromAxis(t,e,r){let i=new f;return f.RotationFromAxisToRef(t,e,r,i),i}static RotationFromAxisToRef(t,e,r,i){let s=T.Quaternion[0];return d.RotationQuaternionFromAxisToRef(t,e,r,s),s.toEulerAnglesToRef(i),i}}f._V8PerformanceHack=new f(.5,.5,.5),f._UpReadOnly=f.Up(),f._DownReadOnly=f.Down(),f._LeftHandedForwardReadOnly=f.Forward(!1),f._RightHandedForwardReadOnly=f.Forward(!0),f._LeftHandedBackwardReadOnly=f.Backward(!1),f._RightHandedBackwardReadOnly=f.Backward(!0),f._RightReadOnly=f.Right(),f._LeftReadOnly=f.Left(),f._ZeroReadOnly=f.Zero(),f._OneReadOnly=f.One();class R{get x(){return this._x}set x(t){this._x=t,this._isDirty=!0}get y(){return this._y}set y(t){this._y=t,this._isDirty=!0}get z(){return this._z}set z(t){this._z=t,this._isDirty=!0}get w(){return this._w}set w(t){this._w=t,this._isDirty=!0}constructor(t=0,e=0,r=0,i=0){this._isDirty=!0,this._x=t,this._y=e,this._z=r,this._w=i}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Vector4"}getHashCode(){let t=c(this._x),e=c(this._y),r=c(this._z),i=c(this._w),s=t;return 397*(s=397*(s=397*s^e)^r)^i}asArray(){return[this._x,this._y,this._z,this._w]}toArray(t,e){return void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,this}fromArray(t,e=0){return R.FromArrayToRef(t,e,this),this}addInPlace(t){return this.x+=t._x,this.y+=t._y,this.z+=t._z,this.w+=t._w,this}addInPlaceFromFloats(t,e,r,i){return this.x+=t,this.y+=e,this.z+=r,this.w+=i,this}add(t){return new R(this._x+t.x,this._y+t.y,this._z+t.z,this._w+t.w)}addToRef(t,e){return e.x=this._x+t.x,e.y=this._y+t.y,e.z=this._z+t.z,e.w=this._w+t.w,e}subtractInPlace(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subtract(t){return new R(this._x-t.x,this._y-t.y,this._z-t.z,this._w-t.w)}subtractToRef(t,e){return e.x=this._x-t.x,e.y=this._y-t.y,e.z=this._z-t.z,e.w=this._w-t.w,e}subtractFromFloats(t,e,r,i){return new R(this._x-t,this._y-e,this._z-r,this._w-i)}subtractFromFloatsToRef(t,e,r,i,s){return s.x=this._x-t,s.y=this._y-e,s.z=this._z-r,s.w=this._w-i,s}negate(){return new R(-this._x,-this._y,-this._z,-this._w)}negateInPlace(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this}negateToRef(t){return t.x=-this._x,t.y=-this._y,t.z=-this._z,t.w=-this._w,t}scaleInPlace(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}scale(t){return new R(this._x*t,this._y*t,this._z*t,this._w*t)}scaleToRef(t,e){return e.x=this._x*t,e.y=this._y*t,e.z=this._z*t,e.w=this._w*t,e}scaleAndAddToRef(t,e){return e.x+=this._x*t,e.y+=this._y*t,e.z+=this._z*t,e.w+=this._w*t,e}equals(t){return t&&this._x===t.x&&this._y===t.y&&this._z===t.z&&this._w===t.w}equalsWithEpsilon(t,e=.001){return t&&(0,n.WithinEpsilon)(this._x,t.x,e)&&(0,n.WithinEpsilon)(this._y,t.y,e)&&(0,n.WithinEpsilon)(this._z,t.z,e)&&(0,n.WithinEpsilon)(this._w,t.w,e)}equalsToFloats(t,e,r,i){return this._x===t&&this._y===e&&this._z===r&&this._w===i}multiplyInPlace(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiply(t){return new R(this._x*t.x,this._y*t.y,this._z*t.z,this._w*t.w)}multiplyToRef(t,e){return e.x=this._x*t.x,e.y=this._y*t.y,e.z=this._z*t.z,e.w=this._w*t.w,e}multiplyByFloats(t,e,r,i){return new R(this._x*t,this._y*e,this._z*r,this._w*i)}divide(t){return new R(this._x/t.x,this._y/t.y,this._z/t.z,this._w/t.w)}divideToRef(t,e){return e.x=this._x/t.x,e.y=this._y/t.y,e.z=this._z/t.z,e.w=this._w/t.w,e}divideInPlace(t){return this.divideToRef(t,this)}minimizeInPlace(t){return t.x<this._x&&(this.x=t.x),t.y<this._y&&(this.y=t.y),t.z<this._z&&(this.z=t.z),t.w<this._w&&(this.w=t.w),this}maximizeInPlace(t){return t.x>this._x&&(this.x=t.x),t.y>this._y&&(this.y=t.y),t.z>this._z&&(this.z=t.z),t.w>this._w&&(this.w=t.w),this}minimizeInPlaceFromFloats(t,e,r,i){return this.x=Math.min(t,this._x),this.y=Math.min(e,this._y),this.z=Math.min(r,this._z),this.w=Math.min(i,this._w),this}maximizeInPlaceFromFloats(t,e,r,i){return this.x=Math.max(t,this._x),this.y=Math.max(e,this._y),this.z=Math.max(r,this._z),this.w=Math.max(i,this._w),this}floorToRef(t){return t.x=Math.floor(this._x),t.y=Math.floor(this._y),t.z=Math.floor(this._z),t.w=Math.floor(this._w),t}floor(){return new R(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z),Math.floor(this._w))}fractToRef(t){return t.x=this._x-Math.floor(this._x),t.y=this._y-Math.floor(this._y),t.z=this._z-Math.floor(this._z),t.w=this._w-Math.floor(this._w),t}fract(){return new R(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z),this._w-Math.floor(this._w))}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(t){return 0===t||1===t?this:this.scaleInPlace(1/t)}normalizeToNew(){return this.normalizeToRef(new R)}normalizeToRef(t){let e=this.length();return 0===e||1===e?(t.x=this._x,t.y=this._y,t.z=this._z,t.w=this._w,t):this.scaleToRef(1/e,t)}toVector3(){return new f(this._x,this._y,this._z)}clone(){return new R(this._x,this._y,this._z,this._w)}copyFrom(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}copyFromFloats(t,e,r,i){return this.x=t,this.y=e,this.z=r,this.w=i,this}set(t,e,r,i){return this.copyFromFloats(t,e,r,i)}setAll(t){return this.x=this.y=this.z=this.w=t,this}dot(t){return this._x*t.x+this._y*t.y+this._z*t.z+this._w*t.w}static FromArray(t,e){return e||(e=0),new R(t[e],t[e+1],t[e+2],t[e+3])}static FromArrayToRef(t,e,r){return r.x=t[e],r.y=t[e+1],r.z=t[e+2],r.w=t[e+3],r}static FromFloatArrayToRef(t,e,r){return R.FromArrayToRef(t,e,r),r}static FromFloatsToRef(t,e,r,i,s){return s.x=t,s.y=e,s.z=r,s.w=i,s}static Zero(){return new R(0,0,0,0)}static One(){return new R(1,1,1,1)}static Random(t=0,e=1){return new R((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.x=(0,n.RandomRange)(t,e),r.y=(0,n.RandomRange)(t,e),r.z=(0,n.RandomRange)(t,e),r.w=(0,n.RandomRange)(t,e),r}static Clamp(t,e,r){return R.ClampToRef(t,e,r,new R)}static ClampToRef(t,e,r,i){return i.x=(0,n.Clamp)(t.x,e.x,r.x),i.y=(0,n.Clamp)(t.y,e.y,r.y),i.z=(0,n.Clamp)(t.z,e.z,r.z),i.w=(0,n.Clamp)(t.w,e.w,r.w),i}static CheckExtends(t,e,r){e.minimizeInPlace(t),r.maximizeInPlace(t)}static get ZeroReadOnly(){return R._ZeroReadOnly}static Normalize(t){return R.NormalizeToRef(t,new R)}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Minimize(t,e){let r=new R;return r.copyFrom(t),r.minimizeInPlace(e),r}static Maximize(t,e){let r=new R;return r.copyFrom(t),r.maximizeInPlace(e),r}static Distance(t,e){return Math.sqrt(R.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t.x-e.x,i=t.y-e.y,s=t.z-e.z,o=t.w-e.w;return r*r+i*i+s*s+o*o}static Center(t,e){return R.CenterToRef(t,e,new R)}static CenterToRef(t,e,r){return r.x=(t.x+e.x)/2,r.y=(t.y+e.y)/2,r.z=(t.z+e.z)/2,r.w=(t.w+e.w)/2,r}static TransformCoordinates(t,e){return R.TransformCoordinatesToRef(t,e,new R)}static TransformCoordinatesToRef(t,e,r){return R.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,e,r),r}static TransformCoordinatesFromFloatsToRef(t,e,r,i,s){let o=i.m,a=t*o[0]+e*o[4]+r*o[8]+o[12],n=t*o[1]+e*o[5]+r*o[9]+o[13],h=t*o[2]+e*o[6]+r*o[10]+o[14],_=t*o[3]+e*o[7]+r*o[11]+o[15];return s.x=a,s.y=n,s.z=h,s.w=_,s}static TransformNormal(t,e){return R.TransformNormalToRef(t,e,new R)}static TransformNormalToRef(t,e,r){let i=e.m,s=t.x*i[0]+t.y*i[4]+t.z*i[8],o=t.x*i[1]+t.y*i[5]+t.z*i[9],a=t.x*i[2]+t.y*i[6]+t.z*i[10];return r.x=s,r.y=o,r.z=a,r.w=t.w,r}static TransformNormalFromFloatsToRef(t,e,r,i,s,o){let a=s.m;return o.x=t*a[0]+e*a[4]+r*a[8],o.y=t*a[1]+e*a[5]+r*a[9],o.z=t*a[2]+e*a[6]+r*a[10],o.w=i,o}static FromVector3(t,e=0){return new R(t._x,t._y,t._z,e)}static Dot(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w}}R._V8PerformanceHack=new R(.5,.5,.5,.5),R._ZeroReadOnly=R.Zero();class d{get x(){return this._x}set x(t){this._x=t,this._isDirty=!0}get y(){return this._y}set y(t){this._y=t,this._isDirty=!0}get z(){return this._z}set z(t){this._z=t,this._isDirty=!0}get w(){return this._w}set w(t){this._w=t,this._isDirty=!0}constructor(t=0,e=0,r=0,i=1){this._isDirty=!0,this._x=t,this._y=e,this._z=r,this._w=i}toString(){return`{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`}getClassName(){return"Quaternion"}getHashCode(){let t=c(this._x),e=c(this._y),r=c(this._z),i=c(this._w),s=t;return 397*(s=397*(s=397*s^e)^r)^i}asArray(){return[this._x,this._y,this._z,this._w]}toArray(t,e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,this}fromArray(t,e=0){return d.FromArrayToRef(t,e,this)}equals(t){return t&&this._x===t._x&&this._y===t._y&&this._z===t._z&&this._w===t._w}equalsWithEpsilon(t,e=.001){return t&&(0,n.WithinEpsilon)(this._x,t._x,e)&&(0,n.WithinEpsilon)(this._y,t._y,e)&&(0,n.WithinEpsilon)(this._z,t._z,e)&&(0,n.WithinEpsilon)(this._w,t._w,e)}isApprox(t,e=.001){return t&&((0,n.WithinEpsilon)(this._x,t._x,e)&&(0,n.WithinEpsilon)(this._y,t._y,e)&&(0,n.WithinEpsilon)(this._z,t._z,e)&&(0,n.WithinEpsilon)(this._w,t._w,e)||(0,n.WithinEpsilon)(this._x,-t._x,e)&&(0,n.WithinEpsilon)(this._y,-t._y,e)&&(0,n.WithinEpsilon)(this._z,-t._z,e)&&(0,n.WithinEpsilon)(this._w,-t._w,e))}clone(){return new d(this._x,this._y,this._z,this._w)}copyFrom(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._w=t._w,this._isDirty=!0,this}copyFromFloats(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._w=i,this._isDirty=!0,this}set(t,e,r,i){return this.copyFromFloats(t,e,r,i)}setAll(t){return this.copyFromFloats(t,t,t,t)}add(t){return new d(this._x+t._x,this._y+t._y,this._z+t._z,this._w+t._w)}addInPlace(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this._w+=t._w,this._isDirty=!0,this}addToRef(t,e){return e._x=this._x+t._x,e._y=this._y+t._y,e._z=this._z+t._z,e._w=this._w+t._w,e._isDirty=!0,e}addInPlaceFromFloats(t,e,r,i){return this._x+=t,this._y+=e,this._z+=r,this._w+=i,this._isDirty=!0,this}subtractToRef(t,e){return e._x=this._x-t._x,e._y=this._y-t._y,e._z=this._z-t._z,e._w=this._w-t._w,e._isDirty=!0,e}subtractFromFloats(t,e,r,i){return this.subtractFromFloatsToRef(t,e,r,i,new d)}subtractFromFloatsToRef(t,e,r,i,s){return s._x=this._x-t,s._y=this._y-e,s._z=this._z-r,s._w=this._w-i,s._isDirty=!0,s}subtract(t){return new d(this._x-t._x,this._y-t._y,this._z-t._z,this._w-t._w)}subtractInPlace(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this._w-=t._w,this._isDirty=!0,this}scale(t){return new d(this._x*t,this._y*t,this._z*t,this._w*t)}scaleToRef(t,e){return e._x=this._x*t,e._y=this._y*t,e._z=this._z*t,e._w=this._w*t,e._isDirty=!0,e}scaleInPlace(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this._isDirty=!0,this}scaleAndAddToRef(t,e){return e._x+=this._x*t,e._y+=this._y*t,e._z+=this._z*t,e._w+=this._w*t,e._isDirty=!0,e}multiply(t){let e=new d(0,0,0,1);return this.multiplyToRef(t,e),e}multiplyToRef(t,e){let r=this._x*t._w+this._y*t._z-this._z*t._y+this._w*t._x,i=-this._x*t._z+this._y*t._w+this._z*t._x+this._w*t._y,s=this._x*t._y-this._y*t._x+this._z*t._w+this._w*t._z,o=-this._x*t._x-this._y*t._y-this._z*t._z+this._w*t._w;return e.copyFromFloats(r,i,s,o),e}multiplyInPlace(t){return this.multiplyToRef(t,this)}multiplyByFloats(t,e,r,i){return this._x*=t,this._y*=e,this._z*=r,this._w*=i,this._isDirty=!0,this}divide(t){throw ReferenceError("Can not divide a quaternion")}divideToRef(t,e){throw ReferenceError("Can not divide a quaternion")}divideInPlace(t){throw ReferenceError("Can not divide a quaternion")}minimizeInPlace(){throw ReferenceError("Can not minimize a quaternion")}minimizeInPlaceFromFloats(){throw ReferenceError("Can not minimize a quaternion")}maximizeInPlace(){throw ReferenceError("Can not maximize a quaternion")}maximizeInPlaceFromFloats(){throw ReferenceError("Can not maximize a quaternion")}negate(){return this.negateToRef(new d)}negateInPlace(){return this._x=-this._x,this._y=-this._y,this._z=-this._z,this._w=-this._w,this._isDirty=!0,this}negateToRef(t){return t._x=-this._x,t._y=-this._y,t._z=-this._z,t._w=-this._w,t._isDirty=!0,t}equalsToFloats(t,e,r,i){return this._x===t&&this._y===e&&this._z===r&&this._w===i}floorToRef(t){throw ReferenceError("Can not floor a quaternion")}floor(){throw ReferenceError("Can not floor a quaternion")}fractToRef(t){throw ReferenceError("Can not fract a quaternion")}fract(){throw ReferenceError("Can not fract a quaternion")}conjugateToRef(t){return t.copyFromFloats(-this._x,-this._y,-this._z,this._w),t}conjugateInPlace(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this}conjugate(){return new d(-this._x,-this._y,-this._z,this._w)}invert(){let t=this.conjugate(),e=this.lengthSquared();return 0==e||1==e||t.scaleInPlace(1/e),t}invertInPlace(){this.conjugateInPlace();let t=this.lengthSquared();return 0==t||1==t||this.scaleInPlace(1/t),this}lengthSquared(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this.lengthSquared())}normalize(){return this.normalizeFromLength(this.length())}normalizeFromLength(t){return 0===t||1===t?this:this.scaleInPlace(1/t)}normalizeToNew(){let t=new d(0,0,0,1);return this.normalizeToRef(t),t}normalizeToRef(t){let e=this.length();return 0===e||1===e?t.copyFromFloats(this._x,this._y,this._z,this._w):this.scaleToRef(1/e,t)}toEulerAngles(){let t=f.Zero();return this.toEulerAnglesToRef(t),t}toEulerAnglesToRef(t){let e=this._z,r=this._x,i=this._y,s=this._w,o=i*e-r*s;if(o<-.4999999)t._y=2*Math.atan2(i,s),t._x=Math.PI/2,t._z=0,t._isDirty=!0;else if(o>.4999999)t._y=2*Math.atan2(i,s),t._x=-Math.PI/2,t._z=0,t._isDirty=!0;else{let a=s*s,n=e*e,h=r*r,_=i*i;t._z=Math.atan2(2*(r*i+e*s),-n-h+_+a),t._x=Math.asin(-2*o),t._y=Math.atan2(2*(e*r+i*s),n-h-_+a),t._isDirty=!0}return t}toAlphaBetaGammaToRef(t){let e=this._z,r=this._x,i=this._y,s=this._w,o=2*Math.atan2(Math.sqrt(r*r+i*i),Math.sqrt(e*e+s*s)),a=2*Math.atan2(e,s),n=2*Math.atan2(i,r);return t.set((a-n)/2,o,(a+n)/2),t}toRotationMatrix(t){return z.FromQuaternionToRef(this,t),t}fromRotationMatrix(t){return d.FromRotationMatrixToRef(t,this),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}toAxisAngle(){let t=f.Zero(),e=this.toAxisAngleToRef(t);return{axis:t,angle:e}}toAxisAngleToRef(t){let e,r=Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z),i=this._w;return r>0?(e=2*Math.atan2(r,i),t.set(this._x/r,this._y/r,this._z/r)):(e=0,t.set(1,0,0)),e}static FromRotationMatrix(t){let e=new d;return d.FromRotationMatrixToRef(t,e),e}static FromRotationMatrixToRef(t,e){let r,i=t.m,s=i[0],o=i[4],a=i[8],n=i[1],h=i[5],_=i[9],l=i[2],y=i[6],u=i[10],m=s+h+u;return m>0?(e._w=.25/(r=.5/Math.sqrt(m+1)),e._x=(y-_)*r,e._y=(a-l)*r,e._z=(n-o)*r):s>h&&s>u?(e._w=(y-_)/(r=2*Math.sqrt(1+s-h-u)),e._x=.25*r,e._y=(o+n)/r,e._z=(a+l)/r):h>u?(e._w=(a-l)/(r=2*Math.sqrt(1+h-s-u)),e._x=(o+n)/r,e._y=.25*r,e._z=(_+y)/r):(e._w=(n-o)/(r=2*Math.sqrt(1+u-s-h)),e._x=(a+l)/r,e._y=(_+y)/r,e._z=.25*r),e._isDirty=!0,e}static Dot(t,e){return t._x*e._x+t._y*e._y+t._z*e._z+t._w*e._w}static AreClose(t,e,r=.1){let i=d.Dot(t,e);return 1-i*i<=r}static SmoothToRef(t,e,r,i,s){let o=0===i?1:r/i;return o=(0,n.Clamp)(o,0,1),d.SlerpToRef(t,e,o,s),s}static Zero(){return new d(0,0,0,0)}static Inverse(t){return new d(-t._x,-t._y,-t._z,t._w)}static InverseToRef(t,e){return e.set(-t._x,-t._y,-t._z,t._w),e}static Identity(){return new d(0,0,0,1)}static IsIdentity(t){return t&&0===t._x&&0===t._y&&0===t._z&&1===t._w}static RotationAxis(t,e){return d.RotationAxisToRef(t,e,new d)}static RotationAxisToRef(t,e,r){r._w=Math.cos(e/2);let i=Math.sin(e/2)/t.length();return r._x=t._x*i,r._y=t._y*i,r._z=t._z*i,r._isDirty=!0,r}static FromArray(t,e){return e||(e=0),new d(t[e],t[e+1],t[e+2],t[e+3])}static FromArrayToRef(t,e,r){return r._x=t[e],r._y=t[e+1],r._z=t[e+2],r._w=t[e+3],r._isDirty=!0,r}static FromFloatsToRef(t,e,r,i,s){return s.copyFromFloats(t,e,r,i),s}static FromEulerAngles(t,e,r){let i=new d;return d.RotationYawPitchRollToRef(e,t,r,i),i}static FromEulerAnglesToRef(t,e,r,i){return d.RotationYawPitchRollToRef(e,t,r,i),i}static FromEulerVector(t){let e=new d;return d.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e}static FromEulerVectorToRef(t,e){return d.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e}static FromUnitVectorsToRef(t,e,r,i=.001){let s=f.Dot(t,e)+1;return s<i?Math.abs(t.x)>Math.abs(t.z)?r.set(-t.y,t.x,0,0):r.set(0,-t.z,t.y,0):(f.CrossToRef(t,e,w.Vector3[0]),r.set(w.Vector3[0].x,w.Vector3[0].y,w.Vector3[0].z,s)),r.normalize()}static RotationYawPitchRoll(t,e,r){let i=new d;return d.RotationYawPitchRollToRef(t,e,r,i),i}static RotationYawPitchRollToRef(t,e,r,i){let s=.5*r,o=.5*e,a=.5*t,n=Math.sin(s),h=Math.cos(s),_=Math.sin(o),l=Math.cos(o),y=Math.sin(a),u=Math.cos(a);return i._x=u*_*h+y*l*n,i._y=y*l*h-u*_*n,i._z=u*l*n-y*_*h,i._w=u*l*h+y*_*n,i._isDirty=!0,i}static RotationAlphaBetaGamma(t,e,r){let i=new d;return d.RotationAlphaBetaGammaToRef(t,e,r,i),i}static RotationAlphaBetaGammaToRef(t,e,r,i){let s=(r+t)*.5,o=(r-t)*.5,a=.5*e;return i._x=Math.cos(o)*Math.sin(a),i._y=Math.sin(o)*Math.sin(a),i._z=Math.sin(s)*Math.cos(a),i._w=Math.cos(s)*Math.cos(a),i._isDirty=!0,i}static RotationQuaternionFromAxis(t,e,r){let i=new d(0,0,0,0);return d.RotationQuaternionFromAxisToRef(t,e,r,i),i}static RotationQuaternionFromAxisToRef(t,e,r,i){let s=T.Matrix[0];return t=t.normalizeToRef(T.Vector3[0]),e=e.normalizeToRef(T.Vector3[1]),r=r.normalizeToRef(T.Vector3[2]),z.FromXYZAxesToRef(t,e,r,s),d.FromRotationMatrixToRef(s,i),i}static FromLookDirectionLH(t,e){let r=new d;return d.FromLookDirectionLHToRef(t,e,r),r}static FromLookDirectionLHToRef(t,e,r){let i=T.Matrix[0];return z.LookDirectionLHToRef(t,e,i),d.FromRotationMatrixToRef(i,r),r}static FromLookDirectionRH(t,e){let r=new d;return d.FromLookDirectionRHToRef(t,e,r),r}static FromLookDirectionRHToRef(t,e,r){let i=T.Matrix[0];return z.LookDirectionRHToRef(t,e,i),d.FromRotationMatrixToRef(i,r)}static Slerp(t,e,r){let i=d.Identity();return d.SlerpToRef(t,e,r,i),i}static SlerpToRef(t,e,r,i){let s,o,a=t._x*e._x+t._y*e._y+t._z*e._z+t._w*e._w,n=!1;if(a<0&&(n=!0,a=-a),a>.999999)o=1-r,s=n?-r:r;else{let t=Math.acos(a),e=1/Math.sin(t);o=Math.sin((1-r)*t)*e,s=n?-Math.sin(r*t)*e:Math.sin(r*t)*e}return i._x=o*t._x+s*e._x,i._y=o*t._y+s*e._y,i._z=o*t._z+s*e._z,i._w=o*t._w+s*e._w,i._isDirty=!0,i}static Hermite(t,e,r,i,s){let o=s*s,a=s*o,n=2*a-3*o+1,h=-2*a+3*o,_=a-2*o+s,l=a-o;return new d(t._x*n+r._x*h+e._x*_+i._x*l,t._y*n+r._y*h+e._y*_+i._y*l,t._z*n+r._z*h+e._z*_+i._z*l,t._w*n+r._w*h+e._w*_+i._w*l)}static Hermite1stDerivative(t,e,r,i,s){let o=new d;return this.Hermite1stDerivativeToRef(t,e,r,i,s,o),o}static Hermite1stDerivativeToRef(t,e,r,i,s,o){let a=s*s;return o._x=(a-s)*6*t._x+(3*a-4*s+1)*e._x+(-a+s)*6*r._x+(3*a-2*s)*i._x,o._y=(a-s)*6*t._y+(3*a-4*s+1)*e._y+(-a+s)*6*r._y+(3*a-2*s)*i._y,o._z=(a-s)*6*t._z+(3*a-4*s+1)*e._z+(-a+s)*6*r._z+(3*a-2*s)*i._z,o._w=(a-s)*6*t._w+(3*a-4*s+1)*e._w+(-a+s)*6*r._w+(3*a-2*s)*i._w,o._isDirty=!0,o}static Normalize(t){let e=d.Zero();return d.NormalizeToRef(t,e),e}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Clamp(t,e,r){let i=new d;return d.ClampToRef(t,e,r,i),i}static ClampToRef(t,e,r,i){return i.copyFromFloats((0,n.Clamp)(t.x,e.x,r.x),(0,n.Clamp)(t.y,e.y,r.y),(0,n.Clamp)(t.z,e.z,r.z),(0,n.Clamp)(t.w,e.w,r.w))}static Random(t=0,e=1){return new d((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.copyFromFloats((0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e),(0,n.RandomRange)(t,e))}static Minimize(){throw ReferenceError("Quaternion.Minimize does not make sense")}static Maximize(){throw ReferenceError("Quaternion.Maximize does not make sense")}static Distance(t,e){return Math.sqrt(d.DistanceSquared(t,e))}static DistanceSquared(t,e){let r=t.x-e.x,i=t.y-e.y,s=t.z-e.z,o=t.w-e.w;return r*r+i*i+s*s+o*o}static Center(t,e){return d.CenterToRef(t,e,d.Zero())}static CenterToRef(t,e,r){return r.copyFromFloats((t.x+e.x)/2,(t.y+e.y)/2,(t.z+e.z)/2,(t.w+e.w)/2)}}d._V8PerformanceHack=new d(.5,.5,.5,.5);class z{static get Use64Bits(){return o.PerformanceConfigurator.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=h._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0}_updateIdentityStatus(t,e=!1,r=!1,i=!0){this._isIdentity=t,this._isIdentity3x2=t||r,this._isIdentityDirty=!this._isIdentity&&e,this._isIdentity3x2Dirty=!this._isIdentity3x2&&i}constructor(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,o.PerformanceConfigurator.MatrixTrackPrecisionChange&&o.PerformanceConfigurator.MatrixTrackedMatrices.push(this),this._m=new o.PerformanceConfigurator.MatrixCurrentType(16),this.markAsUpdated()}isIdentity(){if(this._isIdentityDirty){this._isIdentityDirty=!1;let t=this._m;this._isIdentity=1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]}return this._isIdentity}isIdentityAs3x2(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,1!==this._m[0]||1!==this._m[5]||1!==this._m[15]||0!==this._m[1]||0!==this._m[2]||0!==this._m[3]||0!==this._m[4]||0!==this._m[6]||0!==this._m[7]||0!==this._m[8]||0!==this._m[9]||0!==this._m[10]||0!==this._m[11]||0!==this._m[12]||0!==this._m[13]||0!==this._m[14]?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2}determinant(){if(!0===this._isIdentity)return 1;let t=this._m,e=t[0],r=t[1],i=t[2],s=t[3],o=t[4],a=t[5],n=t[6],h=t[7],_=t[8],l=t[9],y=t[10],u=t[11],m=t[12],c=t[13],x=t[14],f=t[15],R=y*f-x*u,d=l*f-c*u,z=l*x-c*y,T=_*f-m*u,w=_*x-y*m,p=_*c-m*l;return e*(a*R-n*d+h*z)+-(r*(o*R-n*T+h*w))+i*(o*d-a*T+h*p)+-(s*(o*z-a*w+n*p))}toString(){return`{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}
|
|
2
|
+
${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}
|
|
3
|
+
${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}
|
|
4
|
+
${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`}toArray(t=null,e=0){if(!t)return this._m;let r=this._m;for(let i=0;i<16;i++)t[e+i]=r[i];return this}asArray(){return this._m}fromArray(t,e=0){return z.FromArrayToRef(t,e,this)}copyFromFloats(...t){return z.FromArrayToRef(t,0,this)}set(...t){let e=this._m;for(let r=0;r<16;r++)e[r]=t[r];return this.markAsUpdated(),this}setAll(t){let e=this._m;for(let r=0;r<16;r++)e[r]=t;return this.markAsUpdated(),this}invert(){return this.invertToRef(this),this}reset(){return z.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this}add(t){let e=new z;return this.addToRef(t,e),e}addToRef(t,e){let r=this._m,i=e._m,s=t.m;for(let t=0;t<16;t++)i[t]=r[t]+s[t];return e.markAsUpdated(),e}addToSelf(t){let e=this._m,r=t.m;return e[0]+=r[0],e[1]+=r[1],e[2]+=r[2],e[3]+=r[3],e[4]+=r[4],e[5]+=r[5],e[6]+=r[6],e[7]+=r[7],e[8]+=r[8],e[9]+=r[9],e[10]+=r[10],e[11]+=r[11],e[12]+=r[12],e[13]+=r[13],e[14]+=r[14],e[15]+=r[15],this.markAsUpdated(),this}addInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]+=r[t];return this.markAsUpdated(),this}addInPlaceFromFloats(...t){let e=this._m;for(let r=0;r<16;r++)e[r]+=t[r];return this.markAsUpdated(),this}subtract(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]-=r[t];return this.markAsUpdated(),this}subtractToRef(t,e){let r=this._m,i=t.m,s=e._m;for(let t=0;t<16;t++)s[t]=r[t]-i[t];return e.markAsUpdated(),e}subtractInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]-=r[t];return this.markAsUpdated(),this}subtractFromFloats(...t){return this.subtractFromFloatsToRef(...t,new z)}subtractFromFloatsToRef(...t){let e=t.pop(),r=this._m,i=e._m;for(let e=0;e<16;e++)i[e]=r[e]-t[e];return e.markAsUpdated(),e}invertToRef(t){return!0===this._isIdentity?z.IdentityToRef(t):u(this,t.asArray())?t.markAsUpdated():t.copyFrom(this),t}addAtIndex(t,e){return this._m[t]+=e,this.markAsUpdated(),this}multiplyAtIndex(t,e){return this._m[t]*=e,this.markAsUpdated(),this}setTranslationFromFloats(t,e,r){return this._m[12]=t,this._m[13]=e,this._m[14]=r,this.markAsUpdated(),this}addTranslationFromFloats(t,e,r){return this._m[12]+=t,this._m[13]+=e,this._m[14]+=r,this.markAsUpdated(),this}setTranslation(t){return this.setTranslationFromFloats(t._x,t._y,t._z)}getTranslation(){return new f(this._m[12],this._m[13],this._m[14])}getTranslationToRef(t){return t.x=this._m[12],t.y=this._m[13],t.z=this._m[14],t}removeRotationAndScaling(){let t=this.m;return z.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t[12],t[13],t[14],t[15],this),this._updateIdentityStatus(0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]),this}copyFrom(t){return t.copyToArray(this._m),this.updateFlag=t.updateFlag,this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this}copyToArray(t,e=0){return y(this,t,e),this}multiply(t){let e=new z;return this.multiplyToRef(t,e),e}multiplyInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]*=r[t];return this.markAsUpdated(),this}multiplyByFloats(...t){let e=this._m;for(let r=0;r<16;r++)e[r]*=t[r];return this.markAsUpdated(),this}multiplyByFloatsToRef(...t){let e=t.pop(),r=this._m,i=e._m;for(let e=0;e<16;e++)i[e]=r[e]*t[e];return e.markAsUpdated(),e}multiplyToRef(t,e){return this._isIdentity?e.copyFrom(t):t._isIdentity?e.copyFrom(this):(this.multiplyToArray(t,e._m,0),e.markAsUpdated()),e}multiplyToArray(t,e,r){return l(this,t,e,r),this}divide(t){return this.divideToRef(t,new z)}divideToRef(t,e){let r=this._m,i=t.m,s=e._m;for(let t=0;t<16;t++)s[t]=r[t]/i[t];return e.markAsUpdated(),e}divideInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]/=r[t];return this.markAsUpdated(),this}minimizeInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]=Math.min(e[t],r[t]);return this.markAsUpdated(),this}minimizeInPlaceFromFloats(...t){let e=this._m;for(let r=0;r<16;r++)e[r]=Math.min(e[r],t[r]);return this.markAsUpdated(),this}maximizeInPlace(t){let e=this._m,r=t.m;for(let t=0;t<16;t++)e[t]=Math.min(e[t],r[t]);return this.markAsUpdated(),this}maximizeInPlaceFromFloats(...t){let e=this._m;for(let r=0;r<16;r++)e[r]=Math.min(e[r],t[r]);return this.markAsUpdated(),this}negate(){return this.negateToRef(new z)}negateInPlace(){let t=this._m;for(let e=0;e<16;e++)t[e]=-t[e];return this.markAsUpdated(),this}negateToRef(t){let e=this._m,r=t._m;for(let t=0;t<16;t++)r[t]=-e[t];return t.markAsUpdated(),t}equals(t){if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;let e=this.m,r=t.m;return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]&&e[3]===r[3]&&e[4]===r[4]&&e[5]===r[5]&&e[6]===r[6]&&e[7]===r[7]&&e[8]===r[8]&&e[9]===r[9]&&e[10]===r[10]&&e[11]===r[11]&&e[12]===r[12]&&e[13]===r[13]&&e[14]===r[14]&&e[15]===r[15]}equalsWithEpsilon(t,e=0){let r=this._m,i=t.m;for(let t=0;t<16;t++)if(!(0,n.WithinEpsilon)(r[t],i[t],e))return!1;return!0}equalsToFloats(...t){let e=this._m;for(let r=0;r<16;r++)if(e[r]!=t[r])return!1;return!0}floor(){return this.floorToRef(new z)}floorToRef(t){let e=this._m,r=t._m;for(let t=0;t<16;t++)r[t]=Math.floor(e[t]);return t.markAsUpdated(),t}fract(){return this.fractToRef(new z)}fractToRef(t){let e=this._m,r=t._m;for(let t=0;t<16;t++)r[t]=e[t]-Math.floor(e[t]);return t.markAsUpdated(),t}clone(){let t=new z;return t.copyFrom(this),t}getClassName(){return"Matrix"}getHashCode(){let t=c(this._m[0]);for(let e=1;e<16;e++)t=397*t^c(this._m[e]);return t}decomposeToTransformNode(t){return t.rotationQuaternion=t.rotationQuaternion||new d,this.decompose(t.scaling,t.rotationQuaternion,t.position)}decompose(t,e,r,i,s=!0){if(this._isIdentity)return r&&r.setAll(0),t&&t.setAll(1),e&&e.copyFromFloats(0,0,0,1),!0;let o=this._m;if(r&&r.copyFromFloats(o[12],o[13],o[14]),(t=t||T.Vector3[0]).x=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]),t.y=Math.sqrt(o[4]*o[4]+o[5]*o[5]+o[6]*o[6]),t.z=Math.sqrt(o[8]*o[8]+o[9]*o[9]+o[10]*o[10]),i){let e=(s?i.absoluteScaling.x:i.scaling.x)<0?-1:1,r=(s?i.absoluteScaling.y:i.scaling.y)<0?-1:1,o=(s?i.absoluteScaling.z:i.scaling.z)<0?-1:1;t.x*=e,t.y*=r,t.z*=o}else 0>=this.determinant()&&(t.y*=-1);if(0===t._x||0===t._y||0===t._z)return e&&e.copyFromFloats(0,0,0,1),!1;if(e){let r=1/t._x,i=1/t._y,s=1/t._z;z.FromValuesToRef(o[0]*r,o[1]*r,o[2]*r,0,o[4]*i,o[5]*i,o[6]*i,0,o[8]*s,o[9]*s,o[10]*s,0,0,0,0,1,T.Matrix[0]),d.FromRotationMatrixToRef(T.Matrix[0],e)}return!0}getRow(t){if(t<0||t>3)return null;let e=4*t;return new R(this._m[e+0],this._m[e+1],this._m[e+2],this._m[e+3])}getRowToRef(t,e){if(t>=0&&t<=3){let r=4*t;e.x=this._m[r+0],e.y=this._m[r+1],e.z=this._m[r+2],e.w=this._m[r+3]}return e}setRow(t,e){return this.setRowFromFloats(t,e.x,e.y,e.z,e.w)}transpose(){let t=new z;return z.TransposeToRef(this,t),t}transposeToRef(t){return z.TransposeToRef(this,t),t}setRowFromFloats(t,e,r,i,s){if(t<0||t>3)return this;let o=4*t;return this._m[o+0]=e,this._m[o+1]=r,this._m[o+2]=i,this._m[o+3]=s,this.markAsUpdated(),this}scale(t){let e=new z;return this.scaleToRef(t,e),e}scaleToRef(t,e){for(let r=0;r<16;r++)e._m[r]=this._m[r]*t;return e.markAsUpdated(),e}scaleAndAddToRef(t,e){for(let r=0;r<16;r++)e._m[r]+=this._m[r]*t;return e.markAsUpdated(),e}scaleInPlace(t){let e=this._m;for(let r=0;r<16;r++)e[r]*=t;return this.markAsUpdated(),this}toNormalMatrix(t){let e=T.Matrix[0];this.invertToRef(e),e.transposeToRef(t);let r=t._m;return z.FromValuesToRef(r[0],r[1],r[2],0,r[4],r[5],r[6],0,r[8],r[9],r[10],0,0,0,0,1,t),t}getRotationMatrix(){let t=new z;return this.getRotationMatrixToRef(t),t}getRotationMatrixToRef(t){let e=T.Vector3[0];if(!this.decompose(e))return z.IdentityToRef(t),t;let r=this._m,i=1/e._x,s=1/e._y,o=1/e._z;return z.FromValuesToRef(r[0]*i,r[1]*i,r[2]*i,0,r[4]*s,r[5]*s,r[6]*s,0,r[8]*o,r[9]*o,r[10]*o,0,0,0,0,1,t),t}toggleModelMatrixHandInPlace(){let t=this._m;return t[2]*=-1,t[6]*=-1,t[8]*=-1,t[9]*=-1,t[14]*=-1,this.markAsUpdated(),this}toggleProjectionMatrixHandInPlace(){let t=this._m;return t[8]*=-1,t[9]*=-1,t[10]*=-1,t[11]*=-1,this.markAsUpdated(),this}static FromArray(t,e=0){let r=new z;return z.FromArrayToRef(t,e,r),r}static FromArrayToRef(t,e,r){for(let i=0;i<16;i++)r._m[i]=t[i+e];return r.markAsUpdated(),r}static FromFloat32ArrayToRefScaled(t,e,r,i){return i._m[0]=t[0+e]*r,i._m[1]=t[1+e]*r,i._m[2]=t[2+e]*r,i._m[3]=t[3+e]*r,i._m[4]=t[4+e]*r,i._m[5]=t[5+e]*r,i._m[6]=t[6+e]*r,i._m[7]=t[7+e]*r,i._m[8]=t[8+e]*r,i._m[9]=t[9+e]*r,i._m[10]=t[10+e]*r,i._m[11]=t[11+e]*r,i._m[12]=t[12+e]*r,i._m[13]=t[13+e]*r,i._m[14]=t[14+e]*r,i._m[15]=t[15+e]*r,i.markAsUpdated(),i}static get IdentityReadOnly(){return z._IdentityReadOnly}static FromValuesToRef(t,e,r,i,s,o,a,n,h,_,l,y,u,m,c,x,f){let R=f._m;R[0]=t,R[1]=e,R[2]=r,R[3]=i,R[4]=s,R[5]=o,R[6]=a,R[7]=n,R[8]=h,R[9]=_,R[10]=l,R[11]=y,R[12]=u,R[13]=m,R[14]=c,R[15]=x,f.markAsUpdated()}static FromValues(t,e,r,i,s,o,a,n,h,_,l,y,u,m,c,x){let f=new z,R=f._m;return R[0]=t,R[1]=e,R[2]=r,R[3]=i,R[4]=s,R[5]=o,R[6]=a,R[7]=n,R[8]=h,R[9]=_,R[10]=l,R[11]=y,R[12]=u,R[13]=m,R[14]=c,R[15]=x,f.markAsUpdated(),f}static Compose(t,e,r){let i=new z;return z.ComposeToRef(t,e,r,i),i}static ComposeToRef(t,e,r,i){let s=i._m,o=e._x,a=e._y,n=e._z,h=e._w,_=o+o,l=a+a,y=n+n,u=o*_,m=o*l,c=o*y,x=a*l,f=a*y,R=n*y,d=h*_,z=h*l,T=h*y,w=t._x,p=t._y,F=t._z;return s[0]=(1-(x+R))*w,s[1]=(m+T)*w,s[2]=(c-z)*w,s[3]=0,s[4]=(m-T)*p,s[5]=(1-(u+R))*p,s[6]=(f+d)*p,s[7]=0,s[8]=(c+z)*F,s[9]=(f-d)*F,s[10]=(1-(u+x))*F,s[11]=0,s[12]=r._x,s[13]=r._y,s[14]=r._z,s[15]=1,i.markAsUpdated(),i}static Identity(){let t=z.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return t._updateIdentityStatus(!0),t}static IdentityToRef(t){return z.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(!0),t}static Zero(){let t=z.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return t._updateIdentityStatus(!1),t}static RotationX(t){let e=new z;return z.RotationXToRef(t,e),e}static Invert(t){let e=new z;return t.invertToRef(e),e}static RotationXToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return z.FromValuesToRef(1,0,0,0,0,i,r,0,0,-r,i,0,0,0,0,1,e),e._updateIdentityStatus(1===i&&0===r),e}static RotationY(t){let e=new z;return z.RotationYToRef(t,e),e}static RotationYToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return z.FromValuesToRef(i,0,-r,0,0,1,0,0,r,0,i,0,0,0,0,1,e),e._updateIdentityStatus(1===i&&0===r),e}static RotationZ(t){let e=new z;return z.RotationZToRef(t,e),e}static RotationZToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return z.FromValuesToRef(i,r,0,0,-r,i,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(1===i&&0===r),e}static RotationAxis(t,e){let r=new z;return z.RotationAxisToRef(t,e,r),r}static RotationAxisToRef(t,e,r){let i=Math.sin(-e),s=Math.cos(-e),o=1-s;t=t.normalizeToRef(T.Vector3[0]);let a=r._m;return a[0]=t._x*t._x*o+s,a[1]=t._x*t._y*o-t._z*i,a[2]=t._x*t._z*o+t._y*i,a[3]=0,a[4]=t._y*t._x*o+t._z*i,a[5]=t._y*t._y*o+s,a[6]=t._y*t._z*o-t._x*i,a[7]=0,a[8]=t._z*t._x*o-t._y*i,a[9]=t._z*t._y*o+t._x*i,a[10]=t._z*t._z*o+s,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,r.markAsUpdated(),r}static RotationAlignToRef(t,e,r,i=!1){let s=f.Dot(e,t),o=r._m;if(s<-.999)o[0]=-1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=i?1:-1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=i?-1:1,o[11]=0;else{let r=f.Cross(e,t),i=1/(1+s);o[0]=r._x*r._x*i+s,o[1]=r._y*r._x*i-r._z,o[2]=r._z*r._x*i+r._y,o[3]=0,o[4]=r._x*r._y*i+r._z,o[5]=r._y*r._y*i+s,o[6]=r._z*r._y*i-r._x,o[7]=0,o[8]=r._x*r._z*i-r._y,o[9]=r._y*r._z*i+r._x,o[10]=r._z*r._z*i+s,o[11]=0}return o[12]=0,o[13]=0,o[14]=0,o[15]=1,r.markAsUpdated(),r}static RotationYawPitchRoll(t,e,r){let i=new z;return z.RotationYawPitchRollToRef(t,e,r,i),i}static RotationYawPitchRollToRef(t,e,r,i){return d.RotationYawPitchRollToRef(t,e,r,T.Quaternion[0]),T.Quaternion[0].toRotationMatrix(i),i}static Scaling(t,e,r){let i=new z;return z.ScalingToRef(t,e,r,i),i}static ScalingToRef(t,e,r,i){return z.FromValuesToRef(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1,i),i._updateIdentityStatus(1===t&&1===e&&1===r),i}static Translation(t,e,r){let i=new z;return z.TranslationToRef(t,e,r,i),i}static TranslationToRef(t,e,r,i){return z.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1,i),i._updateIdentityStatus(0===t&&0===e&&0===r),i}static Lerp(t,e,r){let i=new z;return z.LerpToRef(t,e,r,i),i}static LerpToRef(t,e,r,i){let s=i._m,o=t.m,a=e.m;for(let t=0;t<16;t++)s[t]=o[t]*(1-r)+a[t]*r;return i.markAsUpdated(),i}static DecomposeLerp(t,e,r){let i=new z;return z.DecomposeLerpToRef(t,e,r,i),i}static DecomposeLerpToRef(t,e,r,i){let s=T.Vector3[0],o=T.Quaternion[0],a=T.Vector3[1];t.decompose(s,o,a);let n=T.Vector3[2],h=T.Quaternion[1],_=T.Vector3[3];e.decompose(n,h,_);let l=T.Vector3[4];f.LerpToRef(s,n,r,l);let y=T.Quaternion[2];d.SlerpToRef(o,h,r,y);let u=T.Vector3[5];return f.LerpToRef(a,_,r,u),z.ComposeToRef(l,y,u,i),i}static LookAtLH(t,e,r){let i=new z;return z.LookAtLHToRef(t,e,r,i),i}static LookAtLHToRef(t,e,r,i){let s=T.Vector3[0],o=T.Vector3[1],a=T.Vector3[2];e.subtractToRef(t,a),a.normalize(),f.CrossToRef(r,a,s);let n=s.lengthSquared();0===n?s.x=1:s.normalizeFromLength(Math.sqrt(n)),f.CrossToRef(a,s,o),o.normalize();let h=-f.Dot(s,t),_=-f.Dot(o,t),l=-f.Dot(a,t);return z.FromValuesToRef(s._x,o._x,a._x,0,s._y,o._y,a._y,0,s._z,o._z,a._z,0,h,_,l,1,i),i}static LookAtRH(t,e,r){let i=new z;return z.LookAtRHToRef(t,e,r,i),i}static LookAtRHToRef(t,e,r,i){let s=T.Vector3[0],o=T.Vector3[1],a=T.Vector3[2];t.subtractToRef(e,a),a.normalize(),f.CrossToRef(r,a,s);let n=s.lengthSquared();0===n?s.x=1:s.normalizeFromLength(Math.sqrt(n)),f.CrossToRef(a,s,o),o.normalize();let h=-f.Dot(s,t),_=-f.Dot(o,t),l=-f.Dot(a,t);return z.FromValuesToRef(s._x,o._x,a._x,0,s._y,o._y,a._y,0,s._z,o._z,a._z,0,h,_,l,1,i),i}static LookDirectionLH(t,e){let r=new z;return z.LookDirectionLHToRef(t,e,r),r}static LookDirectionLHToRef(t,e,r){let i=T.Vector3[0];i.copyFrom(t),i.scaleInPlace(-1);let s=T.Vector3[1];return f.CrossToRef(e,i,s),z.FromValuesToRef(s._x,s._y,s._z,0,e._x,e._y,e._z,0,i._x,i._y,i._z,0,0,0,0,1,r),r}static LookDirectionRH(t,e){let r=new z;return z.LookDirectionRHToRef(t,e,r),r}static LookDirectionRHToRef(t,e,r){let i=T.Vector3[2];return f.CrossToRef(e,t,i),z.FromValuesToRef(i._x,i._y,i._z,0,e._x,e._y,e._z,0,t._x,t._y,t._z,0,0,0,0,1,r),r}static OrthoLH(t,e,r,i,s){let o=new z;return z.OrthoLHToRef(t,e,r,i,o,s),o}static OrthoLHToRef(t,e,r,i,s,o){let a=2/t,n=2/e,h=2/(i-r),_=-(i+r)/(i-r);return z.FromValuesToRef(a,0,0,0,0,n,0,0,0,0,h,0,0,0,_,1,s),o&&s.multiplyToRef(p,s),s._updateIdentityStatus(1===a&&1===n&&1===h&&0===_),s}static OrthoOffCenterLH(t,e,r,i,s,o,a){let n=new z;return z.OrthoOffCenterLHToRef(t,e,r,i,s,o,n,a),n}static OrthoOffCenterLHToRef(t,e,r,i,s,o,a,n){return z.FromValuesToRef(2/(e-t),0,0,0,0,2/(i-r),0,0,0,0,2/(o-s),0,(t+e)/(t-e),(i+r)/(r-i),-(o+s)/(o-s),1,a),n&&a.multiplyToRef(p,a),a.markAsUpdated(),a}static ObliqueOffCenterLHToRef(t,e,r,i,s,o,a,n,h,_,l){let y=-a*Math.cos(n),u=-a*Math.sin(n);return z.TranslationToRef(0,0,-h,T.Matrix[1]),z.FromValuesToRef(1,0,0,0,0,1,0,0,y,u,1,0,0,0,0,1,T.Matrix[0]),T.Matrix[1].multiplyToRef(T.Matrix[0],T.Matrix[0]),z.TranslationToRef(0,0,h,T.Matrix[1]),T.Matrix[0].multiplyToRef(T.Matrix[1],T.Matrix[0]),z.OrthoOffCenterLHToRef(t,e,r,i,s,o,_,l),T.Matrix[0].multiplyToRef(_,_),_}static OrthoOffCenterRH(t,e,r,i,s,o,a){let n=new z;return z.OrthoOffCenterRHToRef(t,e,r,i,s,o,n,a),n}static OrthoOffCenterRHToRef(t,e,r,i,s,o,a,n){return z.OrthoOffCenterLHToRef(t,e,r,i,s,o,a,n),a._m[10]*=-1,a}static ObliqueOffCenterRHToRef(t,e,r,i,s,o,a,n,h,_,l){let y=a*Math.cos(n),u=a*Math.sin(n);return z.TranslationToRef(0,0,h,T.Matrix[1]),z.FromValuesToRef(1,0,0,0,0,1,0,0,y,u,1,0,0,0,0,1,T.Matrix[0]),T.Matrix[1].multiplyToRef(T.Matrix[0],T.Matrix[0]),z.TranslationToRef(0,0,-h,T.Matrix[1]),T.Matrix[0].multiplyToRef(T.Matrix[1],T.Matrix[0]),z.OrthoOffCenterRHToRef(t,e,r,i,s,o,_,l),T.Matrix[0].multiplyToRef(_,_),_}static PerspectiveLH(t,e,r,i,s,o=0){let a=new z,n=Math.tan(o);return z.FromValuesToRef(2*r/t,0,0,0,0,2*r/e,0,n,0,0,(i+r)/(i-r),1,0,0,-2*i*r/(i-r),0,a),s&&a.multiplyToRef(p,a),a._updateIdentityStatus(!1),a}static PerspectiveFovLH(t,e,r,i,s,o=0,a=!1){let n=new z;return z.PerspectiveFovLHToRef(t,e,r,i,n,!0,s,o,a),n}static PerspectiveFovLHToRef(t,e,r,i,s,o=!0,a,n=0,h=!1){let _=1/Math.tan(.5*t),l=o?_/e:_,y=o?_:_*e,u=h&&0===r?-1:0!==i?(i+r)/(i-r):1,m=h&&0===r?2*i:0!==i?-2*i*r/(i-r):-2*r,c=Math.tan(n);return z.FromValuesToRef(l,0,0,0,0,y,0,c,0,0,u,1,0,0,m,0,s),a&&s.multiplyToRef(p,s),s._updateIdentityStatus(!1),s}static PerspectiveFovReverseLHToRef(t,e,r,i,s,o=!0,a,n=0){let h=1/Math.tan(.5*t),_=o?h/e:h,l=o?h:h*e,y=Math.tan(n);return z.FromValuesToRef(_,0,0,0,0,l,0,y,0,0,-r,1,0,0,1,0,s),a&&s.multiplyToRef(p,s),s._updateIdentityStatus(!1),s}static PerspectiveFovRH(t,e,r,i,s,o=0,a=!1){let n=new z;return z.PerspectiveFovRHToRef(t,e,r,i,n,!0,s,o,a),n}static PerspectiveFovRHToRef(t,e,r,i,s,o=!0,a,n=0,h=!1){let _=1/Math.tan(.5*t),l=o?_/e:_,y=o?_:_*e,u=h&&0===r?1:0!==i?-(i+r)/(i-r):-1,m=h&&0===r?2*i:0!==i?-2*i*r/(i-r):-2*r,c=Math.tan(n);return z.FromValuesToRef(l,0,0,0,0,y,0,c,0,0,u,-1,0,0,m,0,s),a&&s.multiplyToRef(p,s),s._updateIdentityStatus(!1),s}static PerspectiveFovReverseRHToRef(t,e,r,i,s,o=!0,a,n=0){let h=1/Math.tan(.5*t),_=o?h/e:h,l=o?h:h*e,y=Math.tan(n);return z.FromValuesToRef(_,0,0,0,0,l,0,y,0,0,-r,-1,0,0,-1,0,s),a&&s.multiplyToRef(p,s),s._updateIdentityStatus(!1),s}static GetFinalMatrix(t,e,r,i,s,o){let a=t.width,n=t.height,h=t.x,_=t.y,l=z.FromValues(a/2,0,0,0,0,-n/2,0,0,0,0,o-s,0,h+a/2,n/2+_,s,1),y=new z;return e.multiplyToRef(r,y),y.multiplyToRef(i,y),y.multiplyToRef(l,y)}static GetAsMatrix2x2(t){let e=t.m,r=[e[0],e[1],e[4],e[5]];return o.PerformanceConfigurator.MatrixUse64Bits?r:new Float32Array(r)}static GetAsMatrix3x3(t){let e=t.m,r=[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]];return o.PerformanceConfigurator.MatrixUse64Bits?r:new Float32Array(r)}static Transpose(t){let e=new z;return z.TransposeToRef(t,e),e}static TransposeToRef(t,e){let r=t.m,i=r[0],s=r[4],o=r[8],a=r[12],n=r[1],h=r[5],_=r[9],l=r[13],y=r[2],u=r[6],m=r[10],c=r[14],x=r[3],f=r[7],R=r[11],d=r[15],z=e._m;return z[0]=i,z[1]=s,z[2]=o,z[3]=a,z[4]=n,z[5]=h,z[6]=_,z[7]=l,z[8]=y,z[9]=u,z[10]=m,z[11]=c,z[12]=x,z[13]=f,z[14]=R,z[15]=d,e.markAsUpdated(),e._updateIdentityStatus(t._isIdentity,t._isIdentityDirty),e}static Reflection(t){let e=new z;return z.ReflectionToRef(t,e),e}static ReflectionToRef(t,e){t.normalize();let r=t.normal.x,i=t.normal.y,s=t.normal.z,o=-2*r,a=-2*i,n=-2*s;return z.FromValuesToRef(o*r+1,a*r,n*r,0,o*i,a*i+1,n*i,0,o*s,a*s,n*s+1,0,o*t.d,a*t.d,n*t.d,1,e),e}static FromXYZAxesToRef(t,e,r,i){return z.FromValuesToRef(t._x,t._y,t._z,0,e._x,e._y,e._z,0,r._x,r._y,r._z,0,0,0,0,1,i),i}static FromQuaternionToRef(t,e){let r=t._x*t._x,i=t._y*t._y,s=t._z*t._z,o=t._x*t._y,a=t._z*t._w,n=t._z*t._x,h=t._y*t._w,_=t._y*t._z,l=t._x*t._w;return e._m[0]=1-2*(i+s),e._m[1]=2*(o+a),e._m[2]=2*(n-h),e._m[3]=0,e._m[4]=2*(o-a),e._m[5]=1-2*(s+r),e._m[6]=2*(_+l),e._m[7]=0,e._m[8]=2*(n+h),e._m[9]=2*(_-l),e._m[10]=1-2*(i+r),e._m[11]=0,e._m[12]=0,e._m[13]=0,e._m[14]=0,e._m[15]=1,e.markAsUpdated(),e}}z._IdentityReadOnly=z.Identity();class T{}T.Vector3=i(11,f.Zero),T.Matrix=i(2,z.Identity),T.Quaternion=i(3,d.Zero);class w{}w.Vector2=i(3,x.Zero),w.Vector3=i(13,f.Zero),w.Vector4=i(3,R.Zero),w.Quaternion=i(3,d.Zero),w.Matrix=i(8,z.Identity);let p=z.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1),F=!1;t.s(["Matrix",0,z,"Quaternion",0,d,"RegisterMathVector",0,function(){F||(F=!0,Object.defineProperties(x.prototype,{dimension:{value:[2]},rank:{value:1}}),Object.defineProperties(f.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(R.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(d.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(z.prototype,{dimension:{value:[4,4]},rank:{value:2}}),(0,m.RegisterClass)("BABYLON.Vector2",x),(0,m.RegisterClass)("BABYLON.Vector3",f),(0,m.RegisterClass)("BABYLON.Vector4",R),(0,m.RegisterClass)("BABYLON.Matrix",z))},"TmpVectors",0,w,"Vector2",0,x,"Vector3",0,f,"Vector4",0,R],96265)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,23507,70227,54196,3717,92040,33457,97001,e=>{"use strict";var t,i=e.i(10272),r=e.i(37143),s=e.i(65740),n=e.i(99267),a=e.i(81623),l=e.i(35407),o=e.i(49007),h=e.i(48657),c=e.i(96265),u=e.i(89030);class d{constructor(e,t,i){this.vectors=(0,h.BuildArray)(8,c.Vector3.Zero),this.center=c.Vector3.Zero(),this.centerWorld=c.Vector3.Zero(),this.extendSize=c.Vector3.Zero(),this.extendSizeWorld=c.Vector3.Zero(),this.directions=(0,h.BuildArray)(3,c.Vector3.Zero),this.vectorsWorld=(0,h.BuildArray)(8,c.Vector3.Zero),this.minimumWorld=c.Vector3.Zero(),this.maximumWorld=c.Vector3.Zero(),this.minimum=c.Vector3.Zero(),this.maximum=c.Vector3.Zero(),this._drawWrapperFront=null,this._drawWrapperBack=null,this.reConstruct(e,t,i)}reConstruct(e,t,i){let r=e.x,s=e.y,n=e.z,a=t.x,l=t.y,o=t.z,h=this.vectors;this.minimum.copyFromFloats(r,s,n),this.maximum.copyFromFloats(a,l,o),h[0].copyFromFloats(r,s,n),h[1].copyFromFloats(a,l,o),h[2].copyFromFloats(a,s,n),h[3].copyFromFloats(r,l,n),h[4].copyFromFloats(r,s,o),h[5].copyFromFloats(a,l,n),h[6].copyFromFloats(r,l,o),h[7].copyFromFloats(a,s,o),t.addToRef(e,this.center).scaleInPlace(.5),t.subtractToRef(e,this.extendSize).scaleInPlace(.5),this._worldMatrix=i||c.Matrix.IdentityReadOnly,this._update(this._worldMatrix)}scale(e){let t=d._TmpVector3,i=this.maximum.subtractToRef(this.minimum,t[0]),r=i.length();i.normalizeFromLength(r);let s=r*e,n=i.scaleInPlace(.5*s),a=this.center.subtractToRef(n,t[1]),l=this.center.addToRef(n,t[2]);return this.reConstruct(a,l,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){let t=this.minimumWorld,i=this.maximumWorld,r=this.directions,s=this.vectorsWorld,n=this.vectors;if(e.isIdentity()){t.copyFrom(this.minimum),i.copyFrom(this.maximum);for(let e=0;e<8;++e)s[e].copyFrom(n[e]);this.extendSizeWorld.copyFrom(this.extendSize),this.centerWorld.copyFrom(this.center)}else{t.setAll(Number.MAX_VALUE),i.setAll(-Number.MAX_VALUE);for(let r=0;r<8;++r){let a=s[r];c.Vector3.TransformCoordinatesToRef(n[r],e,a),t.minimizeInPlace(a),i.maximizeInPlace(a)}i.subtractToRef(t,this.extendSizeWorld).scaleInPlace(.5),i.addToRef(t,this.centerWorld).scaleInPlace(.5)}c.Vector3.FromArrayToRef(e.m,0,r[0]),c.Vector3.FromArrayToRef(e.m,4,r[1]),c.Vector3.FromArrayToRef(e.m,8,r[2]),this._worldMatrix=e}isInFrustum(e){return d.IsInFrustum(this.vectorsWorld,e)}isCompletelyInFrustum(e){return d.IsCompletelyInFrustum(this.vectorsWorld,e)}intersectsPoint(e){let t=this.minimumWorld,i=this.maximumWorld,r=t.x,s=t.y,n=t.z,a=i.x,l=i.y,o=i.z,h=e.x,c=e.y,d=e.z,_=-u.Epsilon;return!(a-h<_)&&!(_>h-r)&&!(l-c<_)&&!(_>c-s)&&!(o-d<_)&&!(_>d-n)}intersectsSphere(e){return d.IntersectsSphere(this.minimumWorld,this.maximumWorld,e.centerWorld,e.radiusWorld)}intersectsMinMax(e,t){let i=this.minimumWorld,r=this.maximumWorld,s=i.x,n=i.y,a=i.z,l=r.x,o=r.y,h=r.z,c=e.x,u=e.y,d=e.z,_=t.x,p=t.y,E=t.z;return!(l<c)&&!(s>_)&&!(o<u)&&!(n>p)&&!(h<d)&&!(a>E)}dispose(){this._drawWrapperFront?.dispose(),this._drawWrapperBack?.dispose()}static Intersects(e,t){return e.intersectsMinMax(t.minimumWorld,t.maximumWorld)}static IntersectsSphere(e,t,i,r){let s=d._TmpVector3[0];return c.Vector3.ClampToRef(i,e,t,s),c.Vector3.DistanceSquared(i,s)<=r*r}static IsCompletelyInFrustum(e,t){for(let i=0;i<6;++i){let r=t[i];for(let t=0;t<8;++t)if(0>r.dotCoordinate(e[t]))return!1}return!0}static IsInFrustum(e,t){for(let i=0;i<6;++i){let r=!0,s=t[i];for(let t=0;t<8;++t)if(s.dotCoordinate(e[t])>=0){r=!1;break}if(r)return!1}return!0}}d._TmpVector3=(0,h.BuildArray)(3,c.Vector3.Zero);class _{constructor(e,t,i){this.center=c.Vector3.Zero(),this.centerWorld=c.Vector3.Zero(),this.minimum=c.Vector3.Zero(),this.maximum=c.Vector3.Zero(),this.reConstruct(e,t,i)}reConstruct(e,t,i){this.minimum.copyFrom(e),this.maximum.copyFrom(t);let r=c.Vector3.Distance(e,t);t.addToRef(e,this.center).scaleInPlace(.5),this.radius=.5*r,this._update(i||c.Matrix.IdentityReadOnly)}scale(e){let t=this.radius*e,i=_._TmpVector3,r=i[0].setAll(t),s=this.center.subtractToRef(r,i[1]),n=this.center.addToRef(r,i[2]);return this.reConstruct(s,n,this._worldMatrix),this}getWorldMatrix(){return this._worldMatrix}_update(e){if(e.isIdentity())this.centerWorld.copyFrom(this.center),this.radiusWorld=this.radius;else{c.Vector3.TransformCoordinatesToRef(this.center,e,this.centerWorld);let t=_._TmpVector3[0];c.Vector3.TransformNormalFromFloatsToRef(1,1,1,e,t),this.radiusWorld=Math.max(Math.abs(t.x),Math.abs(t.y),Math.abs(t.z))*this.radius}}isInFrustum(e){let t=this.centerWorld,i=this.radiusWorld;for(let r=0;r<6;r++)if(e[r].dotCoordinate(t)<=-i)return!1;return!0}isCenterInFrustum(e){let t=this.centerWorld;for(let i=0;i<6;i++)if(0>e[i].dotCoordinate(t))return!1;return!0}intersectsPoint(e){let t=c.Vector3.DistanceSquared(this.centerWorld,e);return!(this.radiusWorld*this.radiusWorld<t)}static Intersects(e,t){let i=c.Vector3.DistanceSquared(e.centerWorld,t.centerWorld),r=e.radiusWorld+t.radiusWorld;return!(r*r<i)}static CreateFromCenterAndRadius(e,t,i){this._TmpVector3[0].copyFrom(e),this._TmpVector3[1].copyFromFloats(0,0,t),this._TmpVector3[2].copyFrom(e),this._TmpVector3[0].addInPlace(this._TmpVector3[1]),this._TmpVector3[2].subtractInPlace(this._TmpVector3[1]);let r=new _(this._TmpVector3[0],this._TmpVector3[2]);return i?r._worldMatrix=i:r._worldMatrix=c.Matrix.Identity(),r}}_._TmpVector3=(0,h.BuildArray)(3,c.Vector3.Zero);let p={min:0,max:0},E={min:0,max:0},A=(e,t,i)=>{let r=c.Vector3.Dot(t.centerWorld,e),s=Math.abs(c.Vector3.Dot(t.directions[0],e))*t.extendSize.x+Math.abs(c.Vector3.Dot(t.directions[1],e))*t.extendSize.y+Math.abs(c.Vector3.Dot(t.directions[2],e))*t.extendSize.z;i.min=r-s,i.max=r+s},T=(e,t,i)=>(A(e,t,p),A(e,i,E),!(p.min>E.max||E.min>p.max));class f{constructor(e,t,i){this._isLocked=!1,this.boundingBox=new d(e,t,i),this.boundingSphere=new _(e,t,i)}reConstruct(e,t,i){this.boundingBox.reConstruct(e,t,i),this.boundingSphere.reConstruct(e,t,i)}get minimum(){return this.boundingBox.minimum}get maximum(){return this.boundingBox.maximum}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e}update(e){this._isLocked||(this.boundingBox._update(e),this.boundingSphere._update(e))}centerOn(e,t){let i=f._TmpVector3[0].copyFrom(e).subtractInPlace(t),r=f._TmpVector3[1].copyFrom(e).addInPlace(t);return this.boundingBox.reConstruct(i,r,this.boundingBox.getWorldMatrix()),this.boundingSphere.reConstruct(i,r,this.boundingBox.getWorldMatrix()),this}encapsulate(e){let t=c.Vector3.Minimize(this.minimum,e),i=c.Vector3.Maximize(this.maximum,e);return this.reConstruct(t,i,this.boundingBox.getWorldMatrix()),this}encapsulateBoundingInfo(e){let t=c.TmpVectors.Matrix[0];this.boundingBox.getWorldMatrix().invertToRef(t);let i=c.TmpVectors.Vector3[0];return c.Vector3.TransformCoordinatesToRef(e.boundingBox.minimumWorld,t,i),this.encapsulate(i),c.Vector3.TransformCoordinatesToRef(e.boundingBox.maximumWorld,t,i),this.encapsulate(i),this}scale(e){return this.boundingBox.scale(e),this.boundingSphere.scale(e),this}isInFrustum(e,t=0){return!!((2===t||3===t)&&this.boundingSphere.isCenterInFrustum(e))||!!this.boundingSphere.isInFrustum(e)&&(1===t||3===t||this.boundingBox.isInFrustum(e))}get diagonalLength(){let e=this.boundingBox;return e.maximumWorld.subtractToRef(e.minimumWorld,f._TmpVector3[0]).length()}isCompletelyInFrustum(e){return this.boundingBox.isCompletelyInFrustum(e)}_checkCollision(e){return e._canDoCollision(this.boundingSphere.centerWorld,this.boundingSphere.radiusWorld,this.boundingBox.minimumWorld,this.boundingBox.maximumWorld)}intersectsPoint(e){return!!this.boundingSphere.centerWorld&&!!this.boundingSphere.intersectsPoint(e)&&!!this.boundingBox.intersectsPoint(e)}intersects(e,t){if(!_.Intersects(this.boundingSphere,e.boundingSphere)||!d.Intersects(this.boundingBox,e.boundingBox))return!1;if(!t)return!0;let i=this.boundingBox,r=e.boundingBox;return!!T(i.directions[0],i,r)&&!!T(i.directions[1],i,r)&&!!T(i.directions[2],i,r)&&!!T(r.directions[0],i,r)&&!!T(r.directions[1],i,r)&&!!T(r.directions[2],i,r)&&!!T(c.Vector3.Cross(i.directions[0],r.directions[0]),i,r)&&!!T(c.Vector3.Cross(i.directions[0],r.directions[1]),i,r)&&!!T(c.Vector3.Cross(i.directions[0],r.directions[2]),i,r)&&!!T(c.Vector3.Cross(i.directions[1],r.directions[0]),i,r)&&!!T(c.Vector3.Cross(i.directions[1],r.directions[1]),i,r)&&!!T(c.Vector3.Cross(i.directions[1],r.directions[2]),i,r)&&!!T(c.Vector3.Cross(i.directions[2],r.directions[0]),i,r)&&!!T(c.Vector3.Cross(i.directions[2],r.directions[1]),i,r)&&!!T(c.Vector3.Cross(i.directions[2],r.directions[2]),i,r)&&!0}}f._TmpVector3=(0,h.BuildArray)(2,c.Vector3.Zero),e.s(["BoundingInfo",0,f],70227);class g{static extractMinAndMaxIndexed(e,t,i,r,s,n){for(let a=i;a<i+r;a++){let i=3*t[a],r=e[i],l=e[i+1],o=e[i+2];s.minimizeInPlaceFromFloats(r,l,o),n.maximizeInPlaceFromFloats(r,l,o)}}static extractMinAndMax(e,t,i,r,s,n){for(let a=t,l=t*r;a<t+i;a++,l+=r){let t=e[l],i=e[l+1],r=e[l+2];s.minimizeInPlaceFromFloats(t,i,r),n.maximizeInPlaceFromFloats(t,i,r)}}}function m(e,t,i,r,s=null){let n=new c.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new c.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return g.extractMinAndMaxIndexed(e,t,i,r,n,a),s&&(n.x-=n.x*s.x+s.y,n.y-=n.y*s.x+s.y,n.z-=n.z*s.x+s.y,a.x+=a.x*s.x+s.y,a.y+=a.y*s.x+s.y,a.z+=a.z*s.x+s.y),{minimum:n,maximum:a}}(0,i.__decorate)([r.nativeOverride.filter((...e)=>!Array.isArray(e[0])&&!Array.isArray(e[1]))],g,"extractMinAndMaxIndexed",null),(0,i.__decorate)([r.nativeOverride.filter((...e)=>!Array.isArray(e[0]))],g,"extractMinAndMax",null),e.s(["extractMinAndMax",0,function(e,t,i,r=null,s){let n=new c.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new c.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);return s||(s=3),g.extractMinAndMax(e,t,i,s,n,a),r&&(n.x-=n.x*r.x+r.y,n.y-=n.y*r.x+r.y,n.z-=n.z*r.x+r.y,a.x+=a.x*r.x+r.y,a.y+=a.y*r.x+r.y,a.z+=a.z*r.x+r.y),{minimum:n,maximum:a}},"extractMinAndMaxIndexed",0,m],54196);var M=e.i(44939),S=e.i(75405);class b{get materialDefines(){let e=this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.defines:this._getDrawWrapper()?.defines;return"string"==typeof e?null:e}set materialDefines(e){(this._mainDrawWrapperOverride??this._getDrawWrapper(void 0,!0)).defines=e}_getDrawWrapper(e,t=!1){e=e??this._engine.currentRenderPassId;let i=this._drawWrappers[e];return!i&&t&&(this._drawWrappers[e]=i=new M.DrawWrapper(this._mesh.getScene().getEngine())),i}_removeDrawWrapper(e,t=!0,i=!1){t&&this._drawWrappers[e]?.dispose(i),this._drawWrappers[e]=void 0}get effect(){return this._mainDrawWrapperOverride?this._mainDrawWrapperOverride.effect:this._getDrawWrapper()?.effect??null}get _drawWrapper(){return this._mainDrawWrapperOverride??this._getDrawWrapper(void 0,!0)}get _drawWrapperOverride(){return this._mainDrawWrapperOverride}_setMainDrawWrapperOverride(e){this._mainDrawWrapperOverride=e}setEffect(e,t=null,i,r=!0){let s=this._drawWrapper;s.setEffect(e,t,r),void 0!==i&&(s.materialContext=i),e||(s.defines=null,s.materialContext=void 0)}resetDrawCache(e,t=!1){if(this._drawWrappers)if(void 0!==e)return void this._removeDrawWrapper(e,!0,t);else for(let e of this._drawWrappers)e?.dispose(t);this._drawWrappers=[]}static AddToMesh(e,t,i,r,s,n,a,l=!0){return new b(e,t,i,r,s,n,a,l)}constructor(e,t,i,r,s,n,a,l=!0,o=!0){this.materialIndex=e,this.verticesStart=t,this.verticesCount=i,this.indexStart=r,this.indexCount=s,this._mainDrawWrapperOverride=null,this._linesIndexCount=0,this._linesIndexBuffer=null,this._lastColliderWorldVertices=null,this._lastColliderTransformMatrix=null,this._wasDispatched=!1,this._renderId=0,this._alphaIndex=0,this._distanceToCamera=0,this._currentMaterial=null,this._mesh=n,this._renderingMesh=a||n,o&&n.subMeshes.push(this),this._engine=this._mesh.getScene().getEngine(),this.resetDrawCache(),this._trianglePlanes=[],this._id=n.subMeshes.length-1,l&&(this.refreshBoundingInfo(),n.computeWorldMatrix(!0))}get IsGlobal(){return 0===this.verticesStart&&this.verticesCount===this._mesh.getTotalVertices()&&0===this.indexStart&&this.indexCount===this._mesh.getTotalIndices()}getBoundingInfo(){return this.IsGlobal||this._mesh.hasThinInstances?this._mesh.getBoundingInfo():this._boundingInfo}setBoundingInfo(e){return this._boundingInfo=e,this}getMesh(){return this._mesh}getRenderingMesh(){return this._renderingMesh}getReplacementMesh(){return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null}getEffectiveMesh(){return(this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:null)||this._renderingMesh}getMaterial(e=!0){let t=this._renderingMesh.getMaterialForRenderPass(this._engine.currentRenderPassId)??this._renderingMesh.material;if(!t)return e&&this._mesh.getScene()._hasDefaultMaterial?this._mesh.getScene().defaultMaterial:null;if(this._isMultiMaterial(t)){let e=t.getSubMaterial(this.materialIndex);return this._currentMaterial!==e&&(this._currentMaterial=e,this.resetDrawCache()),e}return t}_isMultiMaterial(e){return void 0!==e.getSubMaterial}refreshBoundingInfo(e=null){let t;if(this._lastColliderWorldVertices=null,this.IsGlobal||!this._renderingMesh||!this._renderingMesh.geometry)return this;if(e||(e=this._renderingMesh.getVerticesData(l.VertexBuffer.PositionKind)),!e)return this._boundingInfo=this._mesh.getBoundingInfo(),this;let i=this._renderingMesh.getIndices();if(0===this.indexStart&&this.indexCount===i.length){let e=this._renderingMesh.getBoundingInfo();t={minimum:e.minimum.clone(),maximum:e.maximum.clone()}}else t=m(e,i,this.indexStart,this.indexCount,this._renderingMesh.geometry.boundingBias);return this._boundingInfo?this._boundingInfo.reConstruct(t.minimum,t.maximum):this._boundingInfo=new f(t.minimum,t.maximum),this}_checkCollision(e){return this.getBoundingInfo()._checkCollision(e)}updateBoundingInfo(e){let t=this.getBoundingInfo();return t||(this.refreshBoundingInfo(),t=this.getBoundingInfo()),t&&t.update(e),this}isInFrustum(e){let t=this.getBoundingInfo();return!!t&&t.isInFrustum(e,this._mesh.cullingStrategy)}isCompletelyInFrustum(e){let t=this.getBoundingInfo();return!!t&&t.isCompletelyInFrustum(e)}render(e){return this._renderingMesh.render(this,e,this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh?this._mesh:void 0),this}_getLinesIndexBuffer(e,t){if(!this._linesIndexBuffer){let i=6*Math.floor(this.indexCount/3),r=this.verticesStart+this.verticesCount>65535?new Uint32Array(i):new Uint16Array(i),s=0;if(0===e.length)for(let e=this.indexStart;e<this.indexStart+this.indexCount;e+=3)r[s++]=e,r[s++]=e+1,r[s++]=e+1,r[s++]=e+2,r[s++]=e+2,r[s++]=e;else for(let t=this.indexStart;t<this.indexStart+this.indexCount;t+=3)r[s++]=e[t],r[s++]=e[t+1],r[s++]=e[t+1],r[s++]=e[t+2],r[s++]=e[t+2],r[s++]=e[t];this._linesIndexBuffer=t.createIndexBuffer(r),this._linesIndexCount=r.length}return this._linesIndexBuffer}canIntersects(e){let t=this.getBoundingInfo();return!!t&&e.intersectsBox(t.boundingBox)}intersects(e,t,i,r,s){let n=this.getMaterial();if(!n)return null;let a=3,l=!1;switch(n.fillMode){case 3:case 5:case 6:case 8:return null;case 7:a=1,l=!0}return 4===n.fillMode?i.length?this._intersectLines(e,t,i,this._mesh.intersectionThreshold,r):this._intersectUnIndexedLines(e,t,i,this._mesh.intersectionThreshold,r):!i.length&&this._mesh._unIndexed?this._intersectUnIndexedTriangles(e,t,i,r,s):this._intersectTriangles(e,t,i,a,l,r,s)}_intersectLines(e,t,i,r,s){let n=null;for(let a=this.indexStart;a<this.indexStart+this.indexCount;a+=2){let l=t[i[a]],h=t[i[a+1]],c=e.intersectionSegment(l,h,r);if(!(c<0)&&(s||!n||c<n.distance)&&((n=new o.IntersectionInfo(null,null,c)).faceId=a/2,s))break}return n}_intersectUnIndexedLines(e,t,i,r,s){let n=null;for(let i=this.verticesStart;i<this.verticesStart+this.verticesCount;i+=2){let a=t[i],l=t[i+1],h=e.intersectionSegment(a,l,r);if(!(h<0)&&(s||!n||h<n.distance)&&((n=new o.IntersectionInfo(null,null,h)).faceId=i/2,s))break}return n}_intersectTriangles(e,t,i,r,s,n,a){let l=null,o=-1;for(let h=this.indexStart;h<this.indexStart+this.indexCount-(3-r);h+=r){o++;let r=i[h],c=i[h+1],u=i[h+2];if(s&&0xffffffff===u){h+=2;continue}let d=t[r],_=t[c],p=t[u];if(!d||!_||!p||a&&!a(d,_,p,e,r,c,u))continue;let E=e.intersectsTriangle(d,_,p);if(E){if(E.distance<0)continue;if((n||!l||E.distance<l.distance)&&((l=E).faceId=o,n))break}}return l}_intersectUnIndexedTriangles(e,t,i,r,s){let n=null;for(let i=this.verticesStart;i<this.verticesStart+this.verticesCount;i+=3){let a=t[i],l=t[i+1],o=t[i+2];if(s&&!s(a,l,o,e,-1,-1,-1))continue;let h=e.intersectsTriangle(a,l,o);if(h){if(h.distance<0)continue;if((r||!n||h.distance<n.distance)&&((n=h).faceId=i/3,r))break}}return n}_rebuild(){this._linesIndexBuffer&&(this._linesIndexBuffer=null)}clone(e,t){let i=new b(this.materialIndex,this.verticesStart,this.verticesCount,this.indexStart,this.indexCount,e,t,!1);if(!this.IsGlobal){let e=this.getBoundingInfo();if(!e)return i;i._boundingInfo=new f(e.minimum,e.maximum)}return i}dispose(e=!1){this._linesIndexBuffer&&(this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer),this._linesIndexBuffer=null);let t=this._mesh.subMeshes.indexOf(this);this._mesh.subMeshes.splice(t,1),this.resetDrawCache(void 0,e)}getClassName(){return"SubMesh"}static CreateFromIndices(e,t,i,r,s,n=!0){let a=Number.MAX_VALUE,l=-Number.MAX_VALUE,o=(s||r).getIndices();for(let e=t;e<t+i;e++){let t=o[e];t<a&&(a=t),t>l&&(l=t)}return new b(e,a,l-a+1,t,i,r,s,n)}}(t=b.prototype).projectToRef??(t.projectToRef=(0,S._MissingSideEffect)("SubMesh","projectToRef")),e.s(["SubMesh",0,b],3717);var I=e.i(33855),P=e.i(13379),R=e.i(65002),C=e.i(80871);class x{constructor(){this.reset()}reset(){this.enabled=!1,this.mask=255,this.funcRef=1,this.funcMask=255,this.func=519,this.opStencilFail=7680,this.opDepthFail=7680,this.opStencilDepthPass=7681,this.backFunc=519,this.backOpStencilFail=7680,this.backOpDepthFail=7680,this.backOpStencilDepthPass=7681}get func(){return this._func}set func(e){this._func=e}get backFunc(){return this._backFunc}set backFunc(e){this._backFunc=e}get funcRef(){return this._funcRef}set funcRef(e){this._funcRef=e}get funcMask(){return this._funcMask}set funcMask(e){this._funcMask=e}get opStencilFail(){return this._opStencilFail}set opStencilFail(e){this._opStencilFail=e}get opDepthFail(){return this._opDepthFail}set opDepthFail(e){this._opDepthFail=e}get opStencilDepthPass(){return this._opStencilDepthPass}set opStencilDepthPass(e){this._opStencilDepthPass=e}get backOpStencilFail(){return this._backOpStencilFail}set backOpStencilFail(e){this._backOpStencilFail=e}get backOpDepthFail(){return this._backOpDepthFail}set backOpDepthFail(e){this._backOpDepthFail=e}get backOpStencilDepthPass(){return this._backOpStencilDepthPass}set backOpStencilDepthPass(e){this._backOpStencilDepthPass=e}get mask(){return this._mask}set mask(e){this._mask=e}get enabled(){return this._enabled}set enabled(e){this._enabled=e}getClassName(){return"MaterialStencilState"}copyTo(e){C.SerializationHelper.Clone(()=>e,this)}serialize(){return C.SerializationHelper.Serialize(this)}parse(e,t,i){C.SerializationHelper.Parse(()=>this,e,t,i)}}(0,i.__decorate)([(0,r.serialize)()],x.prototype,"func",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"backFunc",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"funcRef",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"funcMask",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"opStencilFail",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"opDepthFail",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"opStencilDepthPass",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"backOpStencilFail",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"backOpDepthFail",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"backOpStencilDepthPass",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"mask",null),(0,i.__decorate)([(0,r.serialize)()],x.prototype,"enabled",null);var D=e.i(21823),O=e.i(94160);function y(e,t,i){let r=!1,s=!!(e.clipPlane??t.clipPlane),n=!!(e.clipPlane2??t.clipPlane2),a=!!(e.clipPlane3??t.clipPlane3),l=!!(e.clipPlane4??t.clipPlane4),o=!!(e.clipPlane5??t.clipPlane5),h=!!(e.clipPlane6??t.clipPlane6);return i.CLIPPLANE!==s&&(i.CLIPPLANE=s,r=!0),i.CLIPPLANE2!==n&&(i.CLIPPLANE2=n,r=!0),i.CLIPPLANE3!==a&&(i.CLIPPLANE3=a,r=!0),i.CLIPPLANE4!==l&&(i.CLIPPLANE4=l,r=!0),i.CLIPPLANE5!==o&&(i.CLIPPLANE5=o,r=!0),i.CLIPPLANE6!==h&&(i.CLIPPLANE6=h,r=!0),r}function L(e,t,i){if(i){let r=O.FloatingOriginCurrentScene.getScene()?.floatingOriginOffset||c.Vector3.ZeroReadOnly;e.setFloat4(t,i.normal.x,i.normal.y,i.normal.z,i.d+c.Vector3.Dot(i.normal,r))}}e.s(["AddClipPlaneUniforms",0,function(e){-1===e.indexOf("vClipPlane")&&e.push("vClipPlane"),-1===e.indexOf("vClipPlane2")&&e.push("vClipPlane2"),-1===e.indexOf("vClipPlane3")&&e.push("vClipPlane3"),-1===e.indexOf("vClipPlane4")&&e.push("vClipPlane4"),-1===e.indexOf("vClipPlane5")&&e.push("vClipPlane5"),-1===e.indexOf("vClipPlane6")&&e.push("vClipPlane6")},"BindClipPlane",0,function(e,t,i){let r=t.clipPlane??i.clipPlane;L(e,"vClipPlane",r),L(e,"vClipPlane2",r=t.clipPlane2??i.clipPlane2),L(e,"vClipPlane3",r=t.clipPlane3??i.clipPlane3),L(e,"vClipPlane4",r=t.clipPlane4??i.clipPlane4),L(e,"vClipPlane5",r=t.clipPlane5??i.clipPlane5),L(e,"vClipPlane6",r=t.clipPlane6??i.clipPlane6)},"PrepareDefinesForClipPlanes",0,y,"PrepareStringDefinesForClipPlanes",0,function(e,t,i){let r=!!(e.clipPlane??t.clipPlane),s=!!(e.clipPlane2??t.clipPlane2),n=!!(e.clipPlane3??t.clipPlane3),a=!!(e.clipPlane4??t.clipPlane4),l=!!(e.clipPlane5??t.clipPlane5),o=!!(e.clipPlane6??t.clipPlane6);r&&i.push("#define CLIPPLANE"),s&&i.push("#define CLIPPLANE2"),n&&i.push("#define CLIPPLANE3"),a&&i.push("#define CLIPPLANE4"),l&&i.push("#define CLIPPLANE5"),o&&i.push("#define CLIPPLANE6")}],92040);var F=e.i(76535);class N{static get DiffuseTextureEnabled(){return this._DiffuseTextureEnabled}static set DiffuseTextureEnabled(e){this._DiffuseTextureEnabled!==e&&(this._DiffuseTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get BaseWeightTextureEnabled(){return this._BaseWeightTextureEnabled}static set BaseWeightTextureEnabled(e){this._BaseWeightTextureEnabled!==e&&(this._BaseWeightTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get BaseDiffuseRoughnessTextureEnabled(){return this._BaseDiffuseRoughnessTextureEnabled}static set BaseDiffuseRoughnessTextureEnabled(e){this._BaseDiffuseRoughnessTextureEnabled!==e&&(this._BaseDiffuseRoughnessTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get DetailTextureEnabled(){return this._DetailTextureEnabled}static set DetailTextureEnabled(e){this._DetailTextureEnabled!==e&&(this._DetailTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get DecalMapEnabled(){return this._DecalMapEnabled}static set DecalMapEnabled(e){this._DecalMapEnabled!==e&&(this._DecalMapEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get AmbientTextureEnabled(){return this._AmbientTextureEnabled}static set AmbientTextureEnabled(e){this._AmbientTextureEnabled!==e&&(this._AmbientTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get OpacityTextureEnabled(){return this._OpacityTextureEnabled}static set OpacityTextureEnabled(e){this._OpacityTextureEnabled!==e&&(this._OpacityTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get ReflectionTextureEnabled(){return this._ReflectionTextureEnabled}static set ReflectionTextureEnabled(e){this._ReflectionTextureEnabled!==e&&(this._ReflectionTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get EmissiveTextureEnabled(){return this._EmissiveTextureEnabled}static set EmissiveTextureEnabled(e){this._EmissiveTextureEnabled!==e&&(this._EmissiveTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get SpecularTextureEnabled(){return this._SpecularTextureEnabled}static set SpecularTextureEnabled(e){this._SpecularTextureEnabled!==e&&(this._SpecularTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get BumpTextureEnabled(){return this._BumpTextureEnabled}static set BumpTextureEnabled(e){this._BumpTextureEnabled!==e&&(this._BumpTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get LightmapTextureEnabled(){return this._LightmapTextureEnabled}static set LightmapTextureEnabled(e){this._LightmapTextureEnabled!==e&&(this._LightmapTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get RefractionTextureEnabled(){return this._RefractionTextureEnabled}static set RefractionTextureEnabled(e){this._RefractionTextureEnabled!==e&&(this._RefractionTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get ColorGradingTextureEnabled(){return this._ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(e){this._ColorGradingTextureEnabled!==e&&(this._ColorGradingTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get FresnelEnabled(){return this._FresnelEnabled}static set FresnelEnabled(e){this._FresnelEnabled!==e&&(this._FresnelEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(4))}static get ClearCoatTextureEnabled(){return this._ClearCoatTextureEnabled}static set ClearCoatTextureEnabled(e){this._ClearCoatTextureEnabled!==e&&(this._ClearCoatTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get ClearCoatBumpTextureEnabled(){return this._ClearCoatBumpTextureEnabled}static set ClearCoatBumpTextureEnabled(e){this._ClearCoatBumpTextureEnabled!==e&&(this._ClearCoatBumpTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get ClearCoatTintTextureEnabled(){return this._ClearCoatTintTextureEnabled}static set ClearCoatTintTextureEnabled(e){this._ClearCoatTintTextureEnabled!==e&&(this._ClearCoatTintTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get SheenTextureEnabled(){return this._SheenTextureEnabled}static set SheenTextureEnabled(e){this._SheenTextureEnabled!==e&&(this._SheenTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get AnisotropicTextureEnabled(){return this._AnisotropicTextureEnabled}static set AnisotropicTextureEnabled(e){this._AnisotropicTextureEnabled!==e&&(this._AnisotropicTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get ThicknessTextureEnabled(){return this._ThicknessTextureEnabled}static set ThicknessTextureEnabled(e){this._ThicknessTextureEnabled!==e&&(this._ThicknessTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get RefractionIntensityTextureEnabled(){return this._ThicknessTextureEnabled}static set RefractionIntensityTextureEnabled(e){this._RefractionIntensityTextureEnabled!==e&&(this._RefractionIntensityTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get TranslucencyIntensityTextureEnabled(){return this._TranslucencyIntensityTextureEnabled}static set TranslucencyIntensityTextureEnabled(e){this._TranslucencyIntensityTextureEnabled!==e&&(this._TranslucencyIntensityTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get TranslucencyColorTextureEnabled(){return this._TranslucencyColorTextureEnabled}static set TranslucencyColorTextureEnabled(e){this._TranslucencyColorTextureEnabled!==e&&(this._TranslucencyColorTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}static get IridescenceTextureEnabled(){return this._IridescenceTextureEnabled}static set IridescenceTextureEnabled(e){this._IridescenceTextureEnabled!==e&&(this._IridescenceTextureEnabled=e,F.AbstractEngine.MarkAllMaterialsAsDirty(1))}}N._DiffuseTextureEnabled=!0,N._BaseWeightTextureEnabled=!0,N._BaseDiffuseRoughnessTextureEnabled=!0,N._DetailTextureEnabled=!0,N._DecalMapEnabled=!0,N._AmbientTextureEnabled=!0,N._OpacityTextureEnabled=!0,N._ReflectionTextureEnabled=!0,N._EmissiveTextureEnabled=!0,N._SpecularTextureEnabled=!0,N._BumpTextureEnabled=!0,N._LightmapTextureEnabled=!0,N._RefractionTextureEnabled=!0,N._ColorGradingTextureEnabled=!0,N._FresnelEnabled=!0,N._ClearCoatTextureEnabled=!0,N._ClearCoatBumpTextureEnabled=!0,N._ClearCoatTintTextureEnabled=!0,N._SheenTextureEnabled=!0,N._AnisotropicTextureEnabled=!0,N._ThicknessTextureEnabled=!0,N._RefractionIntensityTextureEnabled=!0,N._TranslucencyIntensityTextureEnabled=!0,N._TranslucencyColorTextureEnabled=!0,N._IridescenceTextureEnabled=!0,e.s(["MaterialFlags",0,N],33457);let v={r:0,g:0,b:0},B={NUM_MORPH_INFLUENCERS:0,NORMAL:!1,TANGENT:!1,UV:!1,UV2:!1,COLOR:!1};function k(e,t,i,r=!0){let s=i.NUM_MORPH_INFLUENCERS;if(s>0&&a.EngineStore.LastCreatedEngine){let n=a.EngineStore.LastCreatedEngine.getCaps().maxVertexAttribs,l=t.morphTargetManager;if(l?.isUsingTextureForTargets)return;let o=l&&l.supportsPositions&&r,h=l&&l.supportsNormals&&i.NORMAL,c=l&&l.supportsTangents&&i.TANGENT,u=l&&l.supportsUVs&&i.UV1,d=l&&l.supportsUV2s&&i.UV2,_=l&&l.supportsColors&&i.VERTEXCOLOR;for(let i=0;i<s;i++)o&&e.push("position"+i),h&&e.push("normal"+i),c&&e.push("tangent"+i),u&&e.push("uv_"+i),d&&e.push("uv2_"+i),_&&e.push("color"+i),e.length>n&&P.Logger.Error("Cannot add more vertex attributes for mesh "+t.name)}}function U(e,t=!1){e.push("world0"),e.push("world1"),e.push("world2"),e.push("world3"),t&&(e.push("previousWorld0"),e.push("previousWorld1"),e.push("previousWorld2"),e.push("previousWorld3"))}function H(e,t){t.bindToEffect(e,"Scene")}let V=new WeakMap,W=new WeakSet;e.s(["AreLightsTexturesReady",0,function(e,t,i,r=!1){if(!e.lightsEnabled||r)return!0;let s=t.lightSources,n=Math.min(s.length,i);for(let e=0;e<n;e++)if(!s[e].areLightTexturesReady())return!1;return!0},"BindBonesParameters",0,function(e,t,i){if(t&&e&&(e.computeBonesUsingShaders&&t._bonesComputationForcedToCPU&&(e.computeBonesUsingShaders=!1),e.useBones&&e.computeBonesUsingShaders&&e.skeleton)){let r=e.skeleton;if(r.isUsingTextureForMatrices&&t.getUniformIndex("boneTextureInfo")>-1){let i=r.getTransformMatrixTexture(e);t.setTexture("boneSampler",i),t.setFloat2("boneTextureInfo",r._textureWidth,r._textureHeight)}else{let s=r.getTransformMatrices(e);s&&(t.setMatrices("mBones",s),i&&e.getScene().prePassRenderer&&e.getScene().prePassRenderer.getIndex(2))&&(i.previousBones[e.uniqueId]||(i.previousBones[e.uniqueId]=s.slice()),t.setMatrices("mPreviousBones",i.previousBones[e.uniqueId]),i.previousBones[e.uniqueId].set(s))}}},"BindFogParameters",0,function(e,t,i,r=!1){i&&e.fogEnabled&&(!t||t.applyFog)&&0!==e.fogMode&&(i.setFloat4("vFogInfos",e.fogMode,e.fogStart,e.fogEnd,e.fogDensity),r?(e.fogColor.toLinearSpaceToRef(v,e.getEngine().useExactSrgbConversions),i.setColor3("vFogColor",v)):i.setColor3("vFogColor",e.fogColor))},"BindIBLParameters",0,function(e,t,i,r,s=null,n=!1,a=!1,l=!1,o=!1,h=!1,c=!1,u=0){if(e.texturesEnabled&&s&&N.ReflectionTextureEnabled){if(i.updateMatrix("reflectionMatrix",s.getReflectionTextureMatrix()),i.updateFloat2("vReflectionInfos",s.level*e.iblIntensity,u),l&&s.boundingBoxSize&&(i.updateVector3("vReflectionPosition",s.boundingBoxPosition),i.updateVector3("vReflectionSize",s.boundingBoxSize)),n){let e=s.getSize().width;i.updateFloat2("vReflectionFilteringInfo",e,Math.log2(e))}if(h&&!t.USEIRRADIANCEMAP){let e=s.sphericalPolynomial;if(t.USESPHERICALFROMREFLECTIONMAP&&e)if(t.SPHERICAL_HARMONICS){let t=e.preScaledHarmonics;i.updateVector3("vSphericalL00",t.l00),i.updateVector3("vSphericalL1_1",t.l1_1),i.updateVector3("vSphericalL10",t.l10),i.updateVector3("vSphericalL11",t.l11),i.updateVector3("vSphericalL2_2",t.l2_2),i.updateVector3("vSphericalL2_1",t.l2_1),i.updateVector3("vSphericalL20",t.l20),i.updateVector3("vSphericalL21",t.l21),i.updateVector3("vSphericalL22",t.l22)}else i.updateFloat3("vSphericalX",e.x.x,e.x.y,e.x.z),i.updateFloat3("vSphericalY",e.y.x,e.y.y,e.y.z),i.updateFloat3("vSphericalZ",e.z.x,e.z.y,e.z.z),i.updateFloat3("vSphericalXX_ZZ",e.xx.x-e.zz.x,e.xx.y-e.zz.y,e.xx.z-e.zz.z),i.updateFloat3("vSphericalYY_ZZ",e.yy.x-e.zz.x,e.yy.y-e.zz.y,e.yy.z-e.zz.z),i.updateFloat3("vSphericalZZ",e.zz.x,e.zz.y,e.zz.z),i.updateFloat3("vSphericalXY",e.xy.x,e.xy.y,e.xy.z),i.updateFloat3("vSphericalYZ",e.yz.x,e.yz.y,e.yz.z),i.updateFloat3("vSphericalZX",e.zx.x,e.zx.y,e.zx.z)}else o&&t.USEIRRADIANCEMAP&&t.USE_IRRADIANCE_DOMINANT_DIRECTION&&s.irradianceTexture&&i.updateVector3("vReflectionDominantDirection",s.irradianceTexture._dominantDirection);a&&i.updateFloat3("vReflectionMicrosurfaceInfos",s.getSize().width,s.lodGenerationScale,s.lodGenerationOffset)}c&&i.updateColor3("vReflectionColor",r)},"BindLights",0,function(e,t,i,r,s=4){let n=Math.min(t.lightSources.length,s);for(let s=0;s<n;s++)!function(e,t,i,r,s,n=!0){e._bindLight(t,i,r,s,n)}(t.lightSources[s],s,e,i,"boolean"==typeof r?r:r.SPECULARTERM,t.receiveShadows)},"BindLogDepth",0,function(e,t,i){if(!e||e.LOGARITHMICDEPTH||e.indexOf&&e.indexOf("LOGARITHMICDEPTH")>=0){let e=i.activeCamera;1===e.mode&&P.Logger.Error("Logarithmic depth is not compatible with orthographic cameras!",20),t.setFloat("logarithmicDepthConstant",2/(Math.log(e.maxZ+1)/Math.LN2))}},"BindMorphTargetParameters",0,function(e,t){let i=e.morphTargetManager;e&&i&&t.setFloatArray("morphTargetInfluences",i.influences)},"BindSceneUniformBuffer",0,H,"BindTextureMatrix",0,function(e,t,i){let r=e.getTextureMatrix();t.updateMatrix(i+"Matrix",r)},"HandleFallbacksForShadows",0,function(e,t,i=4,r=0){let s=0;for(let n=0;n<i&&e["LIGHT"+n];n++)n>0&&(s=r+n,t.addFallback(s,"LIGHT"+n)),!e.SHADOWS&&(e["SHADOW"+n]&&t.addFallback(r,"SHADOW"+n),e["SHADOWPCF"+n]&&t.addFallback(r,"SHADOWPCF"+n),e["SHADOWPCSS"+n]&&t.addFallback(r,"SHADOWPCSS"+n),e["SHADOWPOISSON"+n]&&t.addFallback(r,"SHADOWPOISSON"+n),e["SHADOWESM"+n]&&t.addFallback(r,"SHADOWESM"+n),e["SHADOWCLOSEESM"+n]&&t.addFallback(r,"SHADOWCLOSEESM"+n));return s},"PrepareAttributesForBakedVertexAnimation",0,function(e,t,i){i.BAKED_VERTEX_ANIMATION_TEXTURE&&i.INSTANCES&&e.push("bakedVertexAnimationSettingsInstanced")},"PrepareAttributesForBones",0,function(e,t,i,r){i.NUM_BONE_INFLUENCERS>0&&(r.addCPUSkinningFallback(0,t),e.push("matricesIndices"),e.push("matricesWeights"),i.NUM_BONE_INFLUENCERS>4&&(e.push("matricesIndicesExtra"),e.push("matricesWeightsExtra")))},"PrepareAttributesForInstances",0,function(e,t){(t.INSTANCES||t.THIN_INSTANCES)&&U(e,!!t.PREPASS_VELOCITY),t.INSTANCESCOLOR&&e.push("instanceColor")},"PrepareAttributesForMorphTargets",0,k,"PrepareDefinesAndAttributesForMorphTargets",0,function(e,t,i,r,s,n,a,l,o,h){let c=e.numMaxInfluencers||e.numInfluencers;return c<=0?0:(t.push("#define MORPHTARGETS"),e.hasPositions&&t.push("#define MORPHTARGETTEXTURE_HASPOSITIONS"),e.hasNormals&&t.push("#define MORPHTARGETTEXTURE_HASNORMALS"),e.hasTangents&&t.push("#define MORPHTARGETTEXTURE_HASTANGENTS"),e.hasUVs&&t.push("#define MORPHTARGETTEXTURE_HASUVS"),e.hasUV2s&&t.push("#define MORPHTARGETTEXTURE_HASUV2S"),e.hasColors&&t.push("#define MORPHTARGETTEXTURE_HASCOLORS"),e.supportsPositions&&s&&t.push("#define MORPHTARGETS_POSITION"),e.supportsNormals&&n&&t.push("#define MORPHTARGETS_NORMAL"),e.supportsTangents&&a&&t.push("#define MORPHTARGETS_TANGENT"),e.supportsUVs&&l&&t.push("#define MORPHTARGETS_UV"),e.supportsUV2s&&o&&t.push("#define MORPHTARGETS_UV2"),e.supportsColors&&h&&t.push("#define MORPHTARGETS_COLOR"),t.push("#define NUM_MORPH_INFLUENCERS "+c),e.isUsingTextureForTargets&&t.push("#define MORPHTARGETS_TEXTURE"),B.NUM_MORPH_INFLUENCERS=c,B.NORMAL=n,B.TANGENT=a,B.UV=l,B.UV2=o,B.COLOR=h,k(i,r,B,s),c)},"PrepareDefinesForAttributes",0,function(e,t,i,r,s=!1,n=!0,a=!0){let l,o;if(!t._areAttributesDirty&&t._needNormals===t._normals&&t._needUVs===t._uvs)return!1;t._normals=t._needNormals,t._uvs=t._needUVs,t.NORMAL=t._needNormals&&e.isVerticesDataPresent("normal"),t._needNormals&&e.isVerticesDataPresent("tangent")&&(t.TANGENT=!0);for(let i=1;i<=6;++i)t["UV"+i]=!!t._needUVs&&e.isVerticesDataPresent(`uv${1===i?"":i}`);if(i){let i=e.useVertexColors&&e.isVerticesDataPresent("color");t.VERTEXCOLOR=i,t.VERTEXALPHA=e.hasVertexAlpha&&i&&n}return e.isVerticesDataPresent("instanceColor")&&(e.hasInstances||e.hasThinInstances)&&(t.INSTANCESCOLOR=!0),r&&function(e,t){if(e.useBones&&e.computeBonesUsingShaders&&e.skeleton){t.NUM_BONE_INFLUENCERS=e.numBoneInfluencers;let i=void 0!==t.BONETEXTURE;if(e.skeleton.isUsingTextureForMatrices&&i)t.BONETEXTURE=!0;else{t.BonesPerMesh=e.skeleton.bones.length+1,t.BONETEXTURE=!i&&void 0;let r=e.getScene(),s=r.prePassRenderer;s&&s.enabled&&(t.BONES_VELOCITY_ENABLED=-1===s.excludedSkinnedMesh.indexOf(e));let n=!0===t.MULTIVIEW,a=2*t.BonesPerMesh+ +!!n;if(V.get(e.skeleton)!==a){V.set(e.skeleton,a);let i=r.getEngine().getCaps().maxVertexUniformVectors;if(i&&!W.has(e.skeleton)){let r=4*t.BonesPerMesh,s=Math.max(i-(n?64:40),0);(r>s||n&&3*r>i)&&(W.add(e.skeleton),P.Logger.Warn(`Skeleton "${e.skeleton.name}": ${e.skeleton.bones.length} bones stored as vertex uniforms use ${r} of ~${s} usable uniform vectors${n?" (multiview)":""} on a device reporting ${i}. This can exceed the GPU vertex-uniform limit and make the mesh silently fail to render. Set skeleton.useTextureToStoreBoneMatrices = true to store bone matrices in a texture.`))}}}}else t.NUM_BONE_INFLUENCERS=0,t.BonesPerMesh=0,void 0!==t.BONETEXTURE&&(t.BONETEXTURE=!1)}(e,t),s&&((l=e.morphTargetManager)?(t.MORPHTARGETS_UV=l.supportsUVs&&t.UV1,t.MORPHTARGETS_UV2=l.supportsUV2s&&t.UV2,t.MORPHTARGETS_TANGENT=l.supportsTangents&&t.TANGENT,t.MORPHTARGETS_NORMAL=l.supportsNormals&&t.NORMAL,t.MORPHTARGETS_POSITION=l.supportsPositions,t.MORPHTARGETS_COLOR=l.supportsColors,t.MORPHTARGETTEXTURE_HASUVS=l.hasUVs,t.MORPHTARGETTEXTURE_HASUV2S=l.hasUV2s,t.MORPHTARGETTEXTURE_HASTANGENTS=l.hasTangents,t.MORPHTARGETTEXTURE_HASNORMALS=l.hasNormals,t.MORPHTARGETTEXTURE_HASPOSITIONS=l.hasPositions,t.MORPHTARGETTEXTURE_HASCOLORS=l.hasColors,t.NUM_MORPH_INFLUENCERS=l.numMaxInfluencers||l.numInfluencers,t.MORPHTARGETS=t.NUM_MORPH_INFLUENCERS>0,t.MORPHTARGETS_TEXTURE=l.isUsingTextureForTargets):(t.MORPHTARGETS_UV=!1,t.MORPHTARGETS_UV2=!1,t.MORPHTARGETS_TANGENT=!1,t.MORPHTARGETS_NORMAL=!1,t.MORPHTARGETS_POSITION=!1,t.MORPHTARGETS_COLOR=!1,t.MORPHTARGETTEXTURE_HASUVS=!1,t.MORPHTARGETTEXTURE_HASUV2S=!1,t.MORPHTARGETTEXTURE_HASTANGENTS=!1,t.MORPHTARGETTEXTURE_HASNORMALS=!1,t.MORPHTARGETTEXTURE_HASPOSITIONS=!1,t.MORPHTARGETTEXTURE_HAS_COLORS=!1,t.MORPHTARGETS=!1,t.NUM_MORPH_INFLUENCERS=0)),a&&(t.BAKED_VERTEX_ANIMATION_TEXTURE=!!(o=e.bakedVertexAnimationManager)&&!!o.isEnabled),!0},"PrepareDefinesForFrameBoundValues",0,function(e,t,i,r,s,n=null,a=!1){let l=function(e,t){let i=!1;if(e.activeCamera){let r=+!!t.CAMERA_ORTHOGRAPHIC,s=+!!t.CAMERA_PERSPECTIVE,n=+(1===e.activeCamera.mode),a=+(0===e.activeCamera.mode);(r^n||s^a)&&(t.CAMERA_ORTHOGRAPHIC=1===n,t.CAMERA_PERSPECTIVE=1===a,i=!0)}return i}(e,r);!1!==n&&(l=y(i,e,r)),!t.getColorWrite()!==r.DEPTHPREPASS&&(r.DEPTHPREPASS=!r.DEPTHPREPASS,l=!0),r.INSTANCES!==s&&(r.INSTANCES=s,l=!0),r.THIN_INSTANCES!==a&&(r.THIN_INSTANCES=a,l=!0),l&&r.markAsUnprocessed()},"PrepareDefinesForIBL",0,function(e,t,i,r=!1,s=8,n=!1){if(t&&N.ReflectionTextureEnabled){if(!t.isReadyOrNotBlocking())return!1;i._needNormals=!0,i.REFLECTION=!0,i.GAMMAREFLECTION=t.gammaSpace,i.RGBDREFLECTION=t.isRGBD,i.LODINREFLECTIONALPHA=t.lodLevelInAlpha,i.LINEARSPECULARREFLECTION=t.linearSpecularLOD,i.USEIRRADIANCEMAP=!1,i.LODBASEDMICROSFURACE=e.getEngine().getCaps().textureLOD;let a=e.getEngine();switch(r&&s>0?(i.NUM_SAMPLES=""+s,a._features.needTypeSuffixInShaderConstants&&(i.NUM_SAMPLES=i.NUM_SAMPLES+"u"),i.REALTIME_FILTERING=!0,e.iblCdfGenerator&&(i.IBL_CDF_FILTERING=!0)):i.REALTIME_FILTERING=!1,i.INVERTCUBICMAP=6===t.coordinatesMode,i.REFLECTIONMAP_3D=t.isCube,i.REFLECTIONMAP_OPPOSITEZ=i.REFLECTIONMAP_3D&&e.useRightHandedSystem?!t.invertZ:t.invertZ,i.REFLECTIONMAP_CUBIC=!1,i.REFLECTIONMAP_EXPLICIT=!1,i.REFLECTIONMAP_PLANAR=!1,i.REFLECTIONMAP_PROJECTION=!1,i.REFLECTIONMAP_SKYBOX=!1,i.REFLECTIONMAP_SPHERICAL=!1,i.REFLECTIONMAP_EQUIRECTANGULAR=!1,i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,t.coordinatesMode){case 0:i.REFLECTIONMAP_EXPLICIT=!0;break;case 2:i.REFLECTIONMAP_PLANAR=!0;break;case 4:i.REFLECTIONMAP_PROJECTION=!0;break;case 5:i.REFLECTIONMAP_SKYBOX=!0;break;case 1:i.REFLECTIONMAP_SPHERICAL=!0;break;case 7:i.REFLECTIONMAP_EQUIRECTANGULAR=!0;break;case 8:i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!0;break;case 9:i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!0;break;default:i.REFLECTIONMAP_CUBIC=!0,i.USE_LOCAL_REFLECTIONMAP_CUBIC=!!t.boundingBoxSize}5!==t.coordinatesMode&&(t.irradianceTexture?(i.USEIRRADIANCEMAP=!0,i.USESPHERICALFROMREFLECTIONMAP=!1,i.USESPHERICALINVERTEX=!1,t.irradianceTexture._dominantDirection?i.USE_IRRADIANCE_DOMINANT_DIRECTION=!0:i.USE_IRRADIANCE_DOMINANT_DIRECTION=!1):t.isCube&&(i.USESPHERICALFROMREFLECTIONMAP=!0,i.USEIRRADIANCEMAP=!1,i.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,i.USESPHERICALINVERTEX=n))}else i.REFLECTION=!1,i.REFLECTIONMAP_3D=!1,i.REFLECTIONMAP_SPHERICAL=!1,i.REFLECTIONMAP_PLANAR=!1,i.REFLECTIONMAP_CUBIC=!1,i.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,i.REFLECTIONMAP_PROJECTION=!1,i.REFLECTIONMAP_SKYBOX=!1,i.REFLECTIONMAP_EXPLICIT=!1,i.REFLECTIONMAP_EQUIRECTANGULAR=!1,i.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,i.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,i.INVERTCUBICMAP=!1,i.USESPHERICALFROMREFLECTIONMAP=!1,i.USEIRRADIANCEMAP=!1,i.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,i.USESPHERICALINVERTEX=!1,i.REFLECTIONMAP_OPPOSITEZ=!1,i.LODINREFLECTIONALPHA=!1,i.GAMMAREFLECTION=!1,i.RGBDREFLECTION=!1,i.LINEARSPECULARREFLECTION=!1;return!0},"PrepareDefinesForLights",0,function(e,t,i,r,s=4,n=!1){if(!i._areLightsDirty)return i._needNormals;let a=0,l={needNormals:i._needNormals,needRebuild:!1,lightmapMode:!1,shadowEnabled:!1,specularEnabled:!1};if(e.lightsEnabled&&!n){for(let n of t.lightSources)if(function(e,t,i,r,s,n,a){switch(a.needNormals=!0,void 0===s["LIGHT"+r]&&(a.needRebuild=!0),s["LIGHT"+r]=!0,s["SPOTLIGHT"+r]=!1,s["HEMILIGHT"+r]=!1,s["POINTLIGHT"+r]=!1,s["DIRLIGHT"+r]=!1,s["AREALIGHT"+r]=!1,s["CLUSTLIGHT"+r]=!1,i.prepareLightSpecificDefines(s,r),s["LIGHT_FALLOFF_PHYSICAL"+r]=!1,s["LIGHT_FALLOFF_GLTF"+r]=!1,s["LIGHT_FALLOFF_STANDARD"+r]=!1,i.falloffType){case D.LightConstants.FALLOFF_GLTF:s["LIGHT_FALLOFF_GLTF"+r]=!0;break;case D.LightConstants.FALLOFF_PHYSICAL:s["LIGHT_FALLOFF_PHYSICAL"+r]=!0;break;case D.LightConstants.FALLOFF_STANDARD:s["LIGHT_FALLOFF_STANDARD"+r]=!0}if(n&&!i.specular.equalsFloats(0,0,0)&&(a.specularEnabled=!0),s["SHADOW"+r]=!1,s["SHADOWCSM"+r]=!1,s["SHADOWCSMDEBUG"+r]=!1,s["SHADOWCSMNUM_CASCADES"+r]=!1,s["SHADOWCSMUSESHADOWMAXZ"+r]=!1,s["SHADOWCSMNOBLEND"+r]=!1,s["SHADOWCSM_RIGHTHANDED"+r]=!1,s["SHADOWPCF"+r]=!1,s["SHADOWPCSS"+r]=!1,s["SHADOWPOISSON"+r]=!1,s["SHADOWESM"+r]=!1,s["SHADOWCLOSEESM"+r]=!1,s["SHADOWCUBE"+r]=!1,s["SHADOWLOWQUALITY"+r]=!1,s["SHADOWMEDIUMQUALITY"+r]=!1,t&&t.receiveShadows&&e.shadowsEnabled&&i.shadowEnabled){let t=i.getShadowGenerator(e.activeCamera)??i.getShadowGenerator();if(t){let e=t.getShadowMap();e&&e.renderList&&e.renderList.length>0&&(a.shadowEnabled=!0,t.prepareDefines(s,r))}}i.lightmapMode!=D.LightConstants.LIGHTMAP_DEFAULT?(a.lightmapMode=!0,s["LIGHTMAPEXCLUDED"+r]=!0,s["LIGHTMAPNOSPECULAR"+r]=i.lightmapMode==D.LightConstants.LIGHTMAP_SHADOWSONLY):(s["LIGHTMAPEXCLUDED"+r]=!1,s["LIGHTMAPNOSPECULAR"+r]=!1)}(e,t,n,a,i,r,l),++a===s)break}i.SPECULARTERM=l.specularEnabled,i.SHADOWS=l.shadowEnabled;let o=Math.max(s,i.MAXLIGHTCOUNT||0);for(let e=a;e<o;e++)void 0!==i["LIGHT"+e]&&(i["LIGHT"+e]=!1,i["HEMILIGHT"+e]=!1,i["POINTLIGHT"+e]=!1,i["DIRLIGHT"+e]=!1,i["SPOTLIGHT"+e]=!1,i["AREALIGHT"+e]=!1,i["CLUSTLIGHT"+e]=!1,i["SHADOW"+e]=!1,i["SHADOWCSM"+e]=!1,i["SHADOWCSMDEBUG"+e]=!1,i["SHADOWCSMNUM_CASCADES"+e]=!1,i["SHADOWCSMUSESHADOWMAXZ"+e]=!1,i["SHADOWCSMNOBLEND"+e]=!1,i["SHADOWCSM_RIGHTHANDED"+e]=!1,i["SHADOWPCF"+e]=!1,i["SHADOWPCSS"+e]=!1,i["SHADOWPOISSON"+e]=!1,i["SHADOWESM"+e]=!1,i["SHADOWCLOSEESM"+e]=!1,i["SHADOWCUBE"+e]=!1,i["SHADOWLOWQUALITY"+e]=!1,i["SHADOWMEDIUMQUALITY"+e]=!1);i.LIGHTCOUNT=a,i.MAXLIGHTCOUNT=s;let h=e.getEngine().getCaps();return void 0===i.SHADOWFLOAT&&(l.needRebuild=!0),i.SHADOWFLOAT=l.shadowEnabled&&(h.textureFloatRender&&h.textureFloatLinearFiltering||h.textureHalfFloatRender&&h.textureHalfFloatLinearFiltering),i.LIGHTMAPEXCLUDED=l.lightmapMode,l.needRebuild&&i.rebuild(),l.needNormals},"PrepareDefinesForMergedUV",0,function(e,t,i){t._needUVs=!0,t[i]=!0,e.optimizeUVAllocation&&e.getTextureMatrix().isIdentityAs3x2()?(t[i+"DIRECTUV"]=e.coordinatesIndex+1,t["MAINUV"+(e.coordinatesIndex+1)]=!0):t[i+"DIRECTUV"]=0},"PrepareDefinesForMisc",0,function(e,t,i,r,s,n,a,l=!1,o=!1,h,c){if(a._areMiscDirty){a.LOGARITHMICDEPTH=i,a.POINTSIZE=r,a.FOG=s&&t.fogEnabled&&e.applyFog&&0!==t.fogMode,a.NONUNIFORMSCALING=e.nonUniformScaling,a.ALPHATEST=n,a.DECAL_AFTER_DETAIL=l,a.USE_VERTEX_PULLING=o,a.RIGHT_HANDED=t.useRightHandedSystem;let u=h?.geometry?.getIndexBuffer(),d=!!h&&h.isUnIndexed;a.VERTEX_PULLING_USE_INDEX_BUFFER=!!u&&!d,a.VERTEX_PULLING_INDEX_BUFFER_32BITS=!!u&&!d&&u.is32Bits,a.VERTEXOUTPUT_INVARIANT=!!c}},"PrepareDefinesForMultiview",0,function(e,t){if(e.activeCamera){let i=t.MULTIVIEW;t.MULTIVIEW=null!==e.activeCamera.outputRenderTarget&&e.activeCamera.outputRenderTarget.getViewCount()>1,t.MULTIVIEW!=i&&t.markAsUnprocessed()}},"PrepareDefinesForOIT",0,function(e,t,i){let r=t.ORDER_INDEPENDENT_TRANSPARENCY,s=t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS;t.ORDER_INDEPENDENT_TRANSPARENCY=e.useOrderIndependentTransparency&&i,t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!e.getEngine().getCaps().textureFloatLinearFiltering,(r!==t.ORDER_INDEPENDENT_TRANSPARENCY||s!==t.ORDER_INDEPENDENT_TRANSPARENCY_16BITS)&&t.markAsUnprocessed()},"PrepareDefinesForPrePass",0,function(e,t,i){let r=t.PREPASS;if(!t._arePrePassDirty)return;let s=[{type:1,define:"PREPASS_POSITION",index:"PREPASS_POSITION_INDEX"},{type:9,define:"PREPASS_LOCAL_POSITION",index:"PREPASS_LOCAL_POSITION_INDEX"},{type:2,define:"PREPASS_VELOCITY",index:"PREPASS_VELOCITY_INDEX"},{type:11,define:"PREPASS_VELOCITY_LINEAR",index:"PREPASS_VELOCITY_LINEAR_INDEX"},{type:3,define:"PREPASS_REFLECTIVITY",index:"PREPASS_REFLECTIVITY_INDEX"},{type:0,define:"PREPASS_IRRADIANCE_LEGACY",index:"PREPASS_IRRADIANCE_LEGACY_INDEX"},{type:7,define:"PREPASS_ALBEDO_SQRT",index:"PREPASS_ALBEDO_SQRT_INDEX"},{type:5,define:"PREPASS_DEPTH",index:"PREPASS_DEPTH_INDEX"},{type:10,define:"PREPASS_SCREENSPACE_DEPTH",index:"PREPASS_SCREENSPACE_DEPTH_INDEX"},{type:6,define:"PREPASS_NORMAL",index:"PREPASS_NORMAL_INDEX"},{type:8,define:"PREPASS_WORLD_NORMAL",index:"PREPASS_WORLD_NORMAL_INDEX"},{type:14,define:"PREPASS_IRRADIANCE",index:"PREPASS_IRRADIANCE_INDEX"}];if(e.prePassRenderer&&e.prePassRenderer.enabled&&i){t.PREPASS=!0,t.SCENE_MRT_COUNT=e.prePassRenderer.mrtCount,t.PREPASS_NORMAL_WORLDSPACE=e.prePassRenderer.generateNormalsInWorldSpace,t.PREPASS_COLOR=!0,t.PREPASS_COLOR_INDEX=0;for(let i=0;i<s.length;i++){let r=e.prePassRenderer.getIndex(s[i].type);-1!==r?(t[s[i].define]=!0,t[s[i].index]=r):t[s[i].define]=!1}}else{t.PREPASS=!1;for(let e=0;e<s.length;e++)t[s[e].define]=!1}t.PREPASS!=r&&(t.markAsUnprocessed(),t.markAsImageProcessingDirty())},"PrepareUniformLayoutForIBL",0,function(e,t=!1,i=!1,r=!1,s=!1,n=!1){e.addUniform("vReflectionInfos",2),e.addUniform("reflectionMatrix",16),t&&e.addUniform("vReflectionMicrosurfaceInfos",3),i&&(e.addUniform("vReflectionPosition",3),e.addUniform("vReflectionSize",3)),r&&(e.addUniform("vReflectionFilteringInfo",2),e.addUniform("vReflectionDominantDirection",3)),n&&e.addUniform("vReflectionColor",3),s&&(e.addUniform("vSphericalL00",3),e.addUniform("vSphericalL1_1",3),e.addUniform("vSphericalL10",3),e.addUniform("vSphericalL11",3),e.addUniform("vSphericalL2_2",3),e.addUniform("vSphericalL2_1",3),e.addUniform("vSphericalL20",3),e.addUniform("vSphericalL21",3),e.addUniform("vSphericalL22",3),e.addUniform("vSphericalX",3),e.addUniform("vSphericalY",3),e.addUniform("vSphericalZ",3),e.addUniform("vSphericalXX_ZZ",3),e.addUniform("vSphericalYY_ZZ",3),e.addUniform("vSphericalZZ",3),e.addUniform("vSphericalXY",3),e.addUniform("vSphericalYZ",3),e.addUniform("vSphericalZX",3))},"PrepareUniformsAndSamplersForIBL",0,function(e,t,i){let r=["vReflectionMicrosurfaceInfos","vReflectionDominantDirection","reflectionMatrix","vReflectionInfos","vReflectionPosition","vReflectionSize","vReflectionColor","vReflectionFilteringInfo"];i&&r.push("vSphericalX","vSphericalY","vSphericalZ","vSphericalXX_ZZ","vSphericalYY_ZZ","vSphericalZZ","vSphericalXY","vSphericalYZ","vSphericalZX","vSphericalL00","vSphericalL1_1","vSphericalL10","vSphericalL11","vSphericalL2_2","vSphericalL2_1","vSphericalL20","vSphericalL21","vSphericalL22"),e.push(...r),t.push("reflectionSampler","reflectionSamplerLow","reflectionSamplerHigh","irradianceSampler","icdfSampler")},"PrepareUniformsAndSamplersList",0,function(e,t,i,r=4){let s,n,a=null;e.uniformsNames?(s=e.uniformsNames,n=e.uniformBuffersNames,t=e.samplers,i=e.defines,r=e.maxSimultaneousLights||0,a=e.shaderLanguage??null):(s=e,t||(t=[]));for(let e=0;e<r&&i["LIGHT"+e];e++)!function(e,t,i,r,s=null,n=!1,a=!1,l=!1,o=!1,h=!1){s&&s.push("Light"+e),!n&&(t.push("vLightData"+e,"vLightDiffuse"+e,"vLightSpecular"+e,"vLightDirection"+e,"vLightWidth"+e,"vLightHeight"+e,"vLightFalloff"+e,"vLightGround"+e,"vSliceData"+e,"vSliceRanges"+e,"lightMatrix"+e,"shadowsInfo"+e,"depthValues"+e),i.push("shadowTexture"+e),i.push("depthTexture"+e),t.push("viewFrustumZ"+e,"cascadeBlendFactor"+e,"lightSizeUVCorrection"+e,"depthCorrection"+e,"penumbraDarkness"+e,"frustumLengths"+e),r&&(i.push("projectionLightTexture"+e),t.push("textureProjectionMatrix"+e)),a&&i.push("iesLightTexture"+e),o&&i.push("rectAreaLightEmissionTexture"+e),l&&(i.push("lightDataTexture"+e),h||i.push("tileMaskTexture"+e)))}(e,s,t,i["PROJECTEDLIGHTTEXTURE"+e],n,!1,i["IESLIGHTTEXTURE"+e],i["CLUSTLIGHT"+e],i["RECTAREALIGHTEMISSIONTEXTURE"+e],1===a);i.NUM_MORPH_INFLUENCERS&&(s.push("morphTargetInfluences"),s.push("morphTargetCount")),i.BAKED_VERTEX_ANIMATION_TEXTURE&&(s.push("bakedVertexAnimationSettings"),s.push("bakedVertexAnimationTextureSizeInverted"),s.push("bakedVertexAnimationTime"),t.push("bakedVertexAnimationTexture"))},"PushAttributesForInstances",0,U],97001);var w=e.i(18064);class G{get useVertexPulling(){return this._useVertexPulling}set useVertexPulling(e){this._useVertexPulling!==e&&(this._useVertexPulling=e,this.markAsDirty(G.MiscDirtyFlag))}get _supportGlowLayer(){return!1}set _glowModeEnabled(e){}get shaderLanguage(){return this._shaderLanguage}get canRenderToMRT(){return!1}set alpha(e){if(this._alpha===e)return;let t=this._alpha;this._alpha=e,(1===t||1===e)&&this.markAsDirty(G.MiscDirtyFlag+G.PrePassDirtyFlag)}get alpha(){return this._alpha}set backFaceCulling(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,this.markAsDirty(G.TextureDirtyFlag))}get backFaceCulling(){return this._backFaceCulling}set textureRepetitionMode(e){let t=Math.max(0,Math.min(0|e,4));this._textureRepetitionMode!==t&&(this._textureRepetitionMode=t,this.markAsDirty(G.TextureDirtyFlag))}get textureRepetitionMode(){return this._textureRepetitionMode}set cullBackFaces(e){this._cullBackFaces!==e&&(this._cullBackFaces=e,this.markAsDirty(G.TextureDirtyFlag))}get cullBackFaces(){return this._cullBackFaces}get blockDirtyMechanism(){return this._blockDirtyMechanism}set blockDirtyMechanism(e){this._blockDirtyMechanism!==e&&(this._blockDirtyMechanism=e,e||this.markDirty())}atomicMaterialsUpdate(e){this.blockDirtyMechanism=!0;try{e(this)}finally{this.blockDirtyMechanism=!1}}get hasRenderTargetTextures(){return this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._eventInfo.hasRenderTargetTextures}set onDispose(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)}get onBindObservable(){return this._onBindObservable||(this._onBindObservable=new n.Observable),this._onBindObservable}set onBind(e){this._onBindObserver&&this.onBindObservable.remove(this._onBindObserver),this._onBindObserver=this.onBindObservable.add(e)}get onUnBindObservable(){return this._onUnBindObservable||(this._onUnBindObservable=new n.Observable),this._onUnBindObservable}get onEffectCreatedObservable(){return this._onEffectCreatedObservable||(this._onEffectCreatedObservable=new n.Observable),this._onEffectCreatedObservable}set alphaMode(e){this._alphaMode[0]!==e&&(this._alphaMode[0]=e,this.markAsDirty(G.TextureDirtyFlag))}get alphaMode(){return this._alphaMode[0]}get alphaModes(){return this._alphaMode}setAlphaMode(e,t=0){this._alphaMode[t]!==e&&(this._alphaMode[t]=e,this.markAsDirty(G.TextureDirtyFlag))}set needDepthPrePass(e){this._needDepthPrePass!==e&&(this._needDepthPrePass=e,this._needDepthPrePass&&(this.checkReadyOnEveryCall=!0))}get needDepthPrePass(){return this._needDepthPrePass}get isPrePassCapable(){return!1}set fogEnabled(e){this._fogEnabled!==e&&(this._fogEnabled=e,this.markAsDirty(G.MiscDirtyFlag))}get fogEnabled(){return this._fogEnabled}get wireframe(){switch(this._fillMode){case G.WireFrameFillMode:case G.LineListDrawMode:case G.LineLoopDrawMode:case G.LineStripDrawMode:return!0}return this._scene.forceWireframe}set wireframe(e){this.fillMode=e?G.WireFrameFillMode:G.TriangleFillMode}get pointsCloud(){switch(this._fillMode){case G.PointFillMode:case G.PointListDrawMode:return!0}return this._scene.forcePointsCloud}set pointsCloud(e){this.fillMode=e?G.PointFillMode:G.TriangleFillMode}get fillMode(){return this._fillMode}set fillMode(e){this._fillMode!==e&&(this._fillMode=e,this.markAsDirty(G.MiscDirtyFlag))}get useLogarithmicDepth(){return this._useLogarithmicDepth}set useLogarithmicDepth(e){let t=this.getScene().getEngine().getCaps().fragmentDepthSupported;e&&!t&&P.Logger.Warn("Logarithmic depth has been requested for a material on a device that doesn't support it."),this._useLogarithmicDepth=e&&t,this._markAllSubMeshesAsMiscDirty()}get isVertexOutputInvariant(){return this._isVertexOutputInvariant}set isVertexOutputInvariant(e){this._isVertexOutputInvariant!==e&&(this._isVertexOutputInvariant=e,this._markAllSubMeshesAsMiscDirty())}_getDrawWrapper(){return this._drawWrapper}_setDrawWrapper(e){this._drawWrapper=e}constructor(e,t,i,r=!1){this.shadowDepthWrapper=null,this.allowShaderHotSwapping=!0,this._shaderLanguage=0,this._forceGLSL=!1,this._useVertexPulling=!1,this.metadata=null,this.reservedDataStore=null,this.checkReadyOnEveryCall=!1,this.checkReadyOnlyOnce=!1,this.state="",this._alpha=1,this._backFaceCulling=!0,this._textureRepetitionMode=0,this.textureRepetitionHexTilingParams=[1,.6,7,.5],this._cullBackFaces=!0,this._blockDirtyMechanism=!1,this.sideOrientation=null,this.onCompiled=null,this.onError=null,this.getRenderTargetTextures=null,this.doNotSerialize=!1,this._storeEffectOnSubMeshes=!1,this.animations=null,this.onDisposeObservable=new n.Observable,this._onDisposeObserver=null,this._onUnBindObservable=null,this._onBindObserver=null,this._alphaMode=[2],this._needDepthPrePass=!1,this.disableDepthWrite=!1,this.disableColorWrite=!1,this.forceDepthWrite=!1,this.depthFunction=0,this.separateCullingPass=!1,this._fogEnabled=!0,this.pointSize=1,this.zOffset=0,this.zOffsetUnits=0,this.stencil=new x,this._isVertexOutputInvariant=G.ForceVertexOutputInvariant,this._useUBO=!1,this._fillMode=G.TriangleFillMode,this._cachedDepthWriteState=!1,this._cachedColorWriteState=!1,this._cachedDepthFunctionState=0,this._indexInSceneMaterialArray=-1,this.meshMap=null,this._parentContainer=null,this._uniformBufferLayoutBuilt=!1,this._eventInfo={},this._callbackPluginEventGeneric=()=>void 0,this._callbackPluginEventIsReadyForSubMesh=()=>void 0,this._callbackPluginEventPrepareDefines=()=>void 0,this._callbackPluginEventPrepareDefinesBeforeAttributes=()=>void 0,this._callbackPluginEventHardBindForSubMesh=()=>void 0,this._callbackPluginEventBindForSubMesh=()=>void 0,this._callbackPluginEventHasRenderTargetTextures=()=>void 0,this._callbackPluginEventFillRenderTargetTextures=()=>void 0,this._transparencyMode=null,this.name=e;const l=t||a.EngineStore.LastCreatedScene;if(!l)return;this._scene=l,this._dirtyCallbacks={},this._forceGLSL=r,this._dirtyCallbacks[1]=this._markAllSubMeshesAsTexturesDirty.bind(this),this._dirtyCallbacks[2]=this._markAllSubMeshesAsLightsDirty.bind(this),this._dirtyCallbacks[4]=this._markAllSubMeshesAsFresnelDirty.bind(this),this._dirtyCallbacks[8]=this._markAllSubMeshesAsAttributesDirty.bind(this),this._dirtyCallbacks[16]=this._markAllSubMeshesAsMiscDirty.bind(this),this._dirtyCallbacks[32]=this._markAllSubMeshesAsPrePassDirty.bind(this),this._dirtyCallbacks[127]=this._markAllSubMeshesAsAllDirty.bind(this),this.id=e||s.Tools.RandomId(),this.uniqueId=this._scene.getUniqueId(),this._materialContext=this._scene.getEngine().createMaterialContext(),this._drawWrapper=new M.DrawWrapper(this._scene.getEngine(),!1),this._drawWrapper.materialContext=this._materialContext,this._uniformBuffer=new I.UniformBuffer(this._scene.getEngine(),void 0,void 0,e),this._useUBO=this.getScene().getEngine().supportsUniformBuffers,this._createUniformBuffer(),i||this._scene.addMaterial(this),this._scene.useMaterialMeshMap&&(this.meshMap={}),G.OnEventObservable.notifyObservers(this,1)}_createUniformBuffer(){let e=this.getScene().getEngine();this._uniformBuffer?.dispose(),e.isWebGPU&&!this._forceGLSL?(this._uniformBuffer=new I.UniformBuffer(e,void 0,void 0,this.name,!0),this._shaderLanguage=1):this._uniformBuffer=new I.UniformBuffer(this._scene.getEngine(),void 0,void 0,this.name),this._uniformBufferLayoutBuilt=!1}toString(e){return"Name: "+this.name}getClassName(){return"Material"}get _isMaterial(){return!0}get isFrozen(){return this.checkReadyOnlyOnce}freeze(){this.markDirty(),this.checkReadyOnlyOnce=!0}unfreeze(){this.markDirty(),this.checkReadyOnlyOnce=!1}isReady(e,t){return!0}isReadyForSubMesh(e,t,i){let r=t.materialDefines;return!!r&&(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=r,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),this._eventInfo.isReadyForSubMesh)}getEffect(){return this._drawWrapper.effect}getScene(){return this._scene}_getEffectiveOrientation(e){return null!==this.sideOrientation?this.sideOrientation:e.sideOrientation}get transparencyMode(){return this._transparencyMode}set transparencyMode(e){this._transparencyMode!==e&&(this._transparencyMode=e,this._markAllSubMeshesAsTexturesAndMiscDirty())}get _hasTransparencyMode(){return null!=this._transparencyMode}get _transparencyModeIsBlend(){return this._transparencyMode===G.MATERIAL_ALPHABLEND||this._transparencyMode===G.MATERIAL_ALPHATESTANDBLEND}get _transparencyModeIsTest(){return this._transparencyMode===G.MATERIAL_ALPHATEST||this._transparencyMode===G.MATERIAL_ALPHATESTANDBLEND}get _disableAlphaBlending(){return this._transparencyMode===G.MATERIAL_OPAQUE||this._transparencyMode===G.MATERIAL_ALPHATEST}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:!this._disableAlphaBlending&&this.alpha<1}needAlphaBlendingForMesh(e){return this._hasTransparencyMode?this._transparencyModeIsBlend:e.visibility<1||!this._disableAlphaBlending&&(e.hasVertexAlpha||this.needAlphaBlending())}needAlphaTesting(){return!!this._hasTransparencyMode&&this._transparencyModeIsTest}needAlphaTestingForMesh(e){return this._hasTransparencyMode?this._transparencyModeIsTest:!this.needAlphaBlendingForMesh(e)&&this.needAlphaTesting()}getAlphaTestTexture(){return null}markDirty(e=!1){for(let t of this.getScene().meshes)if(t.subMeshes){for(let i of t.subMeshes)if(i.getMaterial()===this)for(let t of i._drawWrappers)t&&this._materialContext===t.materialContext&&(t._wasPreviouslyReady=!1,t._wasPreviouslyUsingInstances=null,t._forceRebindOnNextCall=e)}e&&this.markAsDirty(G.AllDirtyFlag)}_preBind(e,t=null){let i=this._scene.getEngine(),r=(null==t?this.sideOrientation:t)===G.ClockWiseSideOrientation,s=e||this._getDrawWrapper();return(0,w.IsWrapper)(s)&&s.materialContext&&(s.materialContext.useVertexPulling=this.useVertexPulling),i.enableEffect(s),i.setState(this.backFaceCulling,this.zOffset,!1,r,this._scene._mirroredCameraPosition?!this.cullBackFaces:this.cullBackFaces,this.stencil,this.zOffsetUnits),r}bind(e,t){}buildUniformLayout(){let e=this._uniformBuffer;this._eventInfo.ubo=e,this._callbackPluginEventGeneric(8,this._eventInfo),e.create(),this._uniformBufferLayoutBuilt=!0}bindForSubMesh(e,t,i){let r=i._drawWrapper;this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),r._forceRebindOnNextCall=!1}bindOnlyWorldMatrix(e){}bindView(e){this._useUBO?this._needToBindSceneUbo=!0:e.setMatrix("view",this.getScene().getViewMatrix())}bindViewProjection(e){this._useUBO?this._needToBindSceneUbo=!0:(e.setMatrix("viewProjection",this.getScene().getTransformMatrix()),e.setMatrix("projection",this.getScene().getProjectionMatrix()),e.setMatrix("inverseProjection",this.getScene().getInverseProjectionMatrix()))}bindEyePosition(e,t){this._useUBO?this._needToBindSceneUbo=!0:this._scene.bindEyePosition(e,t)}_afterBind(e,t=null,i){if(this._scene._cachedMaterial=this,this._needToBindSceneUbo&&t&&(this._needToBindSceneUbo=!1,H(t,this.getScene().getSceneUniformBuffer()),this._scene.finalizeSceneUbo()),e?this._scene._cachedVisibility=e.visibility:this._scene._cachedVisibility=1,this._onBindObservable&&e&&this._onBindObservable.notifyObservers(e),this.disableDepthWrite){let e=this._scene.getEngine();this._cachedDepthWriteState=e.getDepthWrite(),e.setDepthWrite(!1)}if(this.disableColorWrite){let e=this._scene.getEngine();this._cachedColorWriteState=e.getColorWrite(),e.setColorWrite(!1)}if(0!==this.depthFunction){let e=this._scene.getEngine();this._cachedDepthFunctionState=e.getDepthFunction()||0,e.setDepthFunction(this.depthFunction)}}unbind(){this._scene.getSceneUniformBuffer().unbindEffect(),this._onUnBindObservable&&this._onUnBindObservable.notifyObservers(this),0!==this.depthFunction&&this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState),this.disableDepthWrite&&this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState),this.disableColorWrite&&this._scene.getEngine().setColorWrite(this._cachedColorWriteState)}getAnimatables(){return this._eventInfo.animatables=[],this._callbackPluginEventGeneric(256,this._eventInfo),this._eventInfo.animatables}getActiveTextures(){return this._eventInfo.activeTextures=[],this._callbackPluginEventGeneric(512,this._eventInfo),this._eventInfo.activeTextures}hasTexture(e){return this._eventInfo.hasTexture=!1,this._eventInfo.texture=e,this._callbackPluginEventGeneric(1024,this._eventInfo),this._eventInfo.hasTexture}clone(e){return null}_clonePlugins(e,t){let i={};if(this._serializePlugins(i),G._ParsePlugins(i,e,this._scene,t),this.pluginManager)for(let t of this.pluginManager._plugins){let i=e.pluginManager.getPlugin(t.name);i&&t.copyTo(i)}}getBindedMeshes(){if(!this.meshMap)return this._scene.meshes.filter(e=>e.material===this);{let e=[];for(let t in this.meshMap){let i=this.meshMap[t];i&&e.push(i)}return e}}forceCompilation(e,t,i,r){let s={clipPlane:!1,useInstances:!1,...i},n=this.getScene(),a=this.allowShaderHotSwapping;this.allowShaderHotSwapping=!1;let l=()=>{if(!this._scene||!this._scene.getEngine())return;let i=n.clipPlane;if(s.clipPlane&&(n.clipPlane=new R.Plane(0,0,0,1)),this._storeEffectOnSubMeshes){let i=!0,n=null;if(e.subMeshes){let t=new b(0,0,0,0,0,e,void 0,!1,!1);t.materialDefines&&(t.materialDefines._renderId=-1),this.isReadyForSubMesh(e,t,s.useInstances)||(t.effect&&t.effect.getCompilationError()&&t.effect.allFallbacksProcessed()?n=t.effect.getCompilationError():(i=!1,setTimeout(l,16)))}i&&(this.allowShaderHotSwapping=a,n&&r&&r(n),t&&t(this))}else this.isReady()?(this.allowShaderHotSwapping=a,t&&t(this)):setTimeout(l,16);s.clipPlane&&(n.clipPlane=i)};l()}async forceCompilationAsync(e,t){return await new Promise((i,r)=>{this.forceCompilation(e,()=>{i()},t,e=>{r(e)})})}markAsDirty(e){this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism||(G._DirtyCallbackArray.length=0,e&G.ImageProcessingDirtyFlag&&G._DirtyCallbackArray.push(G._ImageProcessingDirtyCallBack),e&G.TextureDirtyFlag&&G._DirtyCallbackArray.push(G._TextureDirtyCallBack),e&G.LightDirtyFlag&&G._DirtyCallbackArray.push(G._LightsDirtyCallBack),e&G.FresnelDirtyFlag&&G._DirtyCallbackArray.push(G._FresnelDirtyCallBack),e&G.AttributesDirtyFlag&&G._DirtyCallbackArray.push(G._AttributeDirtyCallBack),e&G.MiscDirtyFlag&&G._DirtyCallbackArray.push(G._MiscDirtyCallBack),e&G.PrePassDirtyFlag&&G._DirtyCallbackArray.push(G._PrePassDirtyCallBack),G._DirtyCallbackArray.length&&this._markAllSubMeshesAsDirty(G._RunDirtyCallBacks),this.getScene().resetCachedMaterial())}resetDrawCache(){for(let e of this.getScene().meshes)if(e.subMeshes)for(let t of e.subMeshes)t.getMaterial()===this&&t.resetDrawCache()}_markAllSubMeshesAsDirty(e){let t=this.getScene();if(!t.blockMaterialDirtyMechanism&&!this._blockDirtyMechanism){for(let i of t.meshes)if(i.subMeshes){for(let r of i.subMeshes)if((r.getMaterial()||(t._hasDefaultMaterial?t.defaultMaterial:null))===this)for(let t of r._drawWrappers)t&&t.defines&&t.defines.markAllAsDirty&&this._materialContext===t.materialContext&&e(t.defines)}}}_markScenePrePassDirty(){if(this.getScene().blockMaterialDirtyMechanism||this._blockDirtyMechanism)return;let e=this.getScene().enablePrePassRenderer();e&&e.markAsDirty()}_markAllSubMeshesAsAllDirty(){this._markAllSubMeshesAsDirty(G._AllDirtyCallBack)}_markAllSubMeshesAsImageProcessingDirty(){this._markAllSubMeshesAsDirty(G._ImageProcessingDirtyCallBack)}_markAllSubMeshesAsTexturesDirty(){this._markAllSubMeshesAsDirty(G._TextureDirtyCallBack)}_markAllSubMeshesAsFresnelDirty(){this._markAllSubMeshesAsDirty(G._FresnelDirtyCallBack)}_markAllSubMeshesAsFresnelAndMiscDirty(){this._markAllSubMeshesAsDirty(G._FresnelAndMiscDirtyCallBack)}_markAllSubMeshesAsLightsDirty(){this._markAllSubMeshesAsDirty(G._LightsDirtyCallBack)}_markAllSubMeshesAsAttributesDirty(){this._markAllSubMeshesAsDirty(G._AttributeDirtyCallBack)}_markAllSubMeshesAsMiscDirty(){this._markAllSubMeshesAsDirty(G._MiscDirtyCallBack)}_markAllSubMeshesAsPrePassDirty(){this._markAllSubMeshesAsDirty(G._PrePassDirtyCallBack)}_markAllSubMeshesAsTexturesAndMiscDirty(){this._markAllSubMeshesAsDirty(G._TextureAndMiscDirtyCallBack)}_checkScenePerformancePriority(){if(0!==this._scene.performancePriority){this.checkReadyOnlyOnce=!0;let e=this._scene.onScenePerformancePriorityChangedObservable.addOnce(()=>{this.checkReadyOnlyOnce=!1});this.onDisposeObservable.add(()=>{this._scene.onScenePerformancePriorityChangedObservable.remove(e)})}}setPrePassRenderer(e){return!1}dispose(e,t,i){let r=this.getScene();if(r.stopAnimation(this),r.freeProcessedMaterials(),r.removeMaterial(this),this._eventInfo.forceDisposeTextures=t,this._callbackPluginEventGeneric(2,this._eventInfo),this._parentContainer){let e=this._parentContainer.materials.indexOf(this);e>-1&&this._parentContainer.materials.splice(e,1),this._parentContainer=null}if(!0!==i)if(this.meshMap)for(let e in this.meshMap){let t=this.meshMap[e];this._disposeMeshResources(t)}else for(let e of r.meshes)this._disposeMeshResources(e);this._uniformBuffer.dispose(),this._drawWrapper.effect&&(this._storeEffectOnSubMeshes||this._drawWrapper.effect.dispose(),this._drawWrapper.effect=null),this.metadata=null,this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear(),this._onBindObservable&&this._onBindObservable.clear(),this._onUnBindObservable&&this._onUnBindObservable.clear(),this._onEffectCreatedObservable&&this._onEffectCreatedObservable.clear(),this._eventInfo&&(this._eventInfo={})}_disposeMeshResources(e){if(!e)return;let t=e.geometry,i=e._internalAbstractMeshDataInfo._materialForRenderPass;if(this._storeEffectOnSubMeshes){if(e.subMeshes&&i)for(let r of e.subMeshes){let e=r._drawWrappers;for(let s=0;s<e.length;s++){let n=e[s]?.effect;n&&i[s]===this&&(t?._releaseVertexArrayObject(n),r._removeDrawWrapper(s,!0,!0))}}}else t?._releaseVertexArrayObject(this._drawWrapper.effect);e.material!==this||e.sourceMesh||(e.material=null)}serialize(){let e=C.SerializationHelper.Serialize(this);return e.stencil=this.stencil.serialize(),e.uniqueId=this.uniqueId,this._serializePlugins(e),e}_serializePlugins(e){if(e.plugins={},this.pluginManager)for(let t of this.pluginManager._plugins)t.doNotSerialize||(e.plugins[t.getClassName()]=t.serialize())}static ParseAlphaMode(e,t){void 0!==e._alphaMode?t._alphaMode=Array.isArray(e._alphaMode)?e._alphaMode:[e._alphaMode]:void 0!==e.alphaMode?t._alphaMode=Array.isArray(e.alphaMode)?e.alphaMode:[e.alphaMode]:t._alphaMode=[2]}static Parse(e,t,i){if(e.customType){if("BABYLON.PBRMaterial"===e.customType&&e.overloadedAlbedo&&(e.customType="BABYLON.LegacyPBRMaterial",!BABYLON.LegacyPBRMaterial))return P.Logger.Error("Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library."),null}else e.customType="BABYLON.StandardMaterial";let r=s.Tools.Instantiate(e.customType).Parse(e,t,i);return r._loadedUniqueId=e.uniqueId,G.ParseAlphaMode(e,r),r}static _ParsePlugins(e,t,i,r){if(e.plugins)for(let n in e.plugins){let a=e.plugins[n],l=t.pluginManager?.getPlugin(a.name);if(!l){let e=s.Tools.Instantiate("BABYLON."+n);e&&(l=new e(t))}l?.parse(a,i,r)}}}G.TriangleFillMode=0,G.WireFrameFillMode=1,G.PointFillMode=2,G.PointListDrawMode=3,G.LineListDrawMode=4,G.LineLoopDrawMode=5,G.LineStripDrawMode=6,G.TriangleStripDrawMode=7,G.TriangleFanDrawMode=8,G.ClockWiseSideOrientation=0,G.CounterClockWiseSideOrientation=1,G.ImageProcessingDirtyFlag=64,G.TextureDirtyFlag=1,G.LightDirtyFlag=2,G.FresnelDirtyFlag=4,G.AttributesDirtyFlag=8,G.MiscDirtyFlag=16,G.PrePassDirtyFlag=32,G.AllDirtyFlag=127,G.MATERIAL_OPAQUE=0,G.MATERIAL_ALPHATEST=1,G.MATERIAL_ALPHABLEND=2,G.MATERIAL_ALPHATESTANDBLEND=3,G.MATERIAL_NORMALBLENDMETHOD_WHITEOUT=0,G.MATERIAL_NORMALBLENDMETHOD_RNM=1,G.LIGHTFALLOFF_PHYSICAL=0,G.LIGHTFALLOFF_GLTF=1,G.LIGHTFALLOFF_STANDARD=2,G.OnEventObservable=new n.Observable,G.ForceVertexOutputInvariant=!1,G._AllDirtyCallBack=e=>e.markAllAsDirty(),G._ImageProcessingDirtyCallBack=e=>e.markAsImageProcessingDirty(),G._TextureDirtyCallBack=e=>e.markAsTexturesDirty(),G._FresnelDirtyCallBack=e=>e.markAsFresnelDirty(),G._MiscDirtyCallBack=e=>e.markAsMiscDirty(),G._PrePassDirtyCallBack=e=>e.markAsPrePassDirty(),G._LightsDirtyCallBack=e=>e.markAsLightDirty(),G._AttributeDirtyCallBack=e=>e.markAsAttributesDirty(),G._FresnelAndMiscDirtyCallBack=e=>{G._FresnelDirtyCallBack(e),G._MiscDirtyCallBack(e)},G._TextureAndMiscDirtyCallBack=e=>{G._TextureDirtyCallBack(e),G._MiscDirtyCallBack(e)},G._DirtyCallbackArray=[],G._RunDirtyCallBacks=e=>{for(let t of G._DirtyCallbackArray)t(e)},(0,i.__decorate)([(0,r.serialize)()],G.prototype,"id",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"uniqueId",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"name",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"metadata",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"checkReadyOnEveryCall",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"checkReadyOnlyOnce",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"state",void 0),(0,i.__decorate)([(0,r.serialize)("alpha")],G.prototype,"_alpha",void 0),(0,i.__decorate)([(0,r.serialize)("backFaceCulling")],G.prototype,"_backFaceCulling",void 0),(0,i.__decorate)([(0,r.serialize)("textureRepetitionMode")],G.prototype,"_textureRepetitionMode",void 0),(0,i.__decorate)([(0,r.serialize)("textureRepetitionHexTilingParams")],G.prototype,"textureRepetitionHexTilingParams",void 0),(0,i.__decorate)([(0,r.serialize)("cullBackFaces")],G.prototype,"_cullBackFaces",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"sideOrientation",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"_alphaMode",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"_needDepthPrePass",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"disableDepthWrite",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"disableColorWrite",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"forceDepthWrite",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"depthFunction",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"separateCullingPass",void 0),(0,i.__decorate)([(0,r.serialize)("fogEnabled")],G.prototype,"_fogEnabled",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"pointSize",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"zOffset",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"zOffsetUnits",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"pointsCloud",null),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"fillMode",null),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"useLogarithmicDepth",null),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"_isVertexOutputInvariant",void 0),(0,i.__decorate)([(0,r.serialize)()],G.prototype,"transparencyMode",null),Object.getOwnPropertyDescriptor(G.prototype,"pluginManager")||Object.defineProperty(G.prototype,"pluginManager",(0,S._MissingSideEffectProperty)("Material","pluginManager")),e.s(["Material",0,G],23507)}]);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,85528,e=>{"use strict";var t=e.i(12423);let r="passCubePixelShader",u=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_cube<f32>;
|
|
2
|
+
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
3
|
+
@fragment
|
|
4
|
+
fn main(input: FragmentInputs)->FragmentOutputs {var uv: vec2f=input.vUV*2.0-1.0;
|
|
5
|
+
#ifdef POSITIVEX
|
|
6
|
+
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(1.001,uv.y,uv.x));
|
|
7
|
+
#endif
|
|
8
|
+
#ifdef NEGATIVEX
|
|
9
|
+
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(-1.001,uv.y,uv.x));
|
|
10
|
+
#endif
|
|
11
|
+
#ifdef POSITIVEY
|
|
12
|
+
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv.y,1.001,uv.x));
|
|
13
|
+
#endif
|
|
14
|
+
#ifdef NEGATIVEY
|
|
15
|
+
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv.y,-1.001,uv.x));
|
|
16
|
+
#endif
|
|
17
|
+
#ifdef POSITIVEZ
|
|
18
|
+
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv,1.001));
|
|
19
|
+
#endif
|
|
20
|
+
#ifdef NEGATIVEZ
|
|
21
|
+
fragmentOutputs.color=textureSample(textureSampler,textureSamplerSampler,vec3f(uv,-1.001));
|
|
22
|
+
#endif
|
|
23
|
+
}`;t.ShaderStore.ShadersStoreWGSL[r]||(t.ShaderStore.ShadersStoreWGSL[r]=u),e.s(["passCubePixelShaderWGSL",0,{name:r,shader:u}])}]);
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65296,e=>{"use strict";var r=e.i(12423);let o="helperFunctions",a=`const float PI=3.1415926535897932384626433832795;const float TWO_PI=6.283185307179586;const float HALF_PI=1.5707963267948966;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float RECIPROCAL_PI4=0.07957747154594767;const float HALF_MIN=5.96046448e-08;
|
|
2
|
+
const float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001;
|
|
3
|
+
#define saturate(x) clamp(x,0.0,1.0)
|
|
4
|
+
#define absEps(x) abs(x)+Epsilon
|
|
5
|
+
#define maxEps(x) max(x,Epsilon)
|
|
6
|
+
#define saturateEps(x) clamp(x,Epsilon,1.0)
|
|
7
|
+
mat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3(
|
|
8
|
+
vec3(i0.x,i1.x,i2.x),
|
|
9
|
+
vec3(i0.y,i1.y,i2.y),
|
|
10
|
+
vec3(i0.z,i1.z,i2.z)
|
|
11
|
+
);return outMatrix;}
|
|
12
|
+
mat3 inverseMat3(mat3 inMatrix) {float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),
|
|
13
|
+
b11,(a22*a00-a02*a20),(-a12*a00+a02*a10),
|
|
14
|
+
b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}
|
|
15
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
16
|
+
vec3 toLinearSpaceExact(vec3 color)
|
|
17
|
+
{vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));
|
|
18
|
+
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
19
|
+
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));
|
|
20
|
+
#else
|
|
21
|
+
return
|
|
22
|
+
vec3(
|
|
23
|
+
color.r<=0.04045 ? nearZeroSection.r : remainingSection.r,
|
|
24
|
+
color.g<=0.04045 ? nearZeroSection.g : remainingSection.g,
|
|
25
|
+
color.b<=0.04045 ? nearZeroSection.b : remainingSection.b);
|
|
26
|
+
#endif
|
|
27
|
+
}
|
|
28
|
+
vec3 toGammaSpaceExact(vec3 color)
|
|
29
|
+
{vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);
|
|
30
|
+
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
31
|
+
return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));
|
|
32
|
+
#else
|
|
33
|
+
return
|
|
34
|
+
vec3(
|
|
35
|
+
color.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,
|
|
36
|
+
color.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,
|
|
37
|
+
color.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);
|
|
38
|
+
#endif
|
|
39
|
+
}
|
|
40
|
+
#endif
|
|
41
|
+
float toLinearSpace(float color)
|
|
42
|
+
{
|
|
43
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
44
|
+
float nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection;
|
|
45
|
+
#else
|
|
46
|
+
return pow(color,LinearEncodePowerApprox);
|
|
47
|
+
#endif
|
|
48
|
+
}
|
|
49
|
+
vec3 toLinearSpace(vec3 color)
|
|
50
|
+
{
|
|
51
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
52
|
+
return toLinearSpaceExact(color);
|
|
53
|
+
#else
|
|
54
|
+
return pow(color,vec3(LinearEncodePowerApprox));
|
|
55
|
+
#endif
|
|
56
|
+
}
|
|
57
|
+
vec4 toLinearSpace(vec4 color)
|
|
58
|
+
{
|
|
59
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
60
|
+
return vec4(toLinearSpaceExact(color.rgb),color.a);
|
|
61
|
+
#else
|
|
62
|
+
return vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);
|
|
63
|
+
#endif
|
|
64
|
+
}
|
|
65
|
+
float toGammaSpace(float color)
|
|
66
|
+
{
|
|
67
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
68
|
+
float nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection;
|
|
69
|
+
#else
|
|
70
|
+
return pow(color,GammaEncodePowerApprox);
|
|
71
|
+
#endif
|
|
72
|
+
}
|
|
73
|
+
vec3 toGammaSpace(vec3 color)
|
|
74
|
+
{
|
|
75
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
76
|
+
return toGammaSpaceExact(color);
|
|
77
|
+
#else
|
|
78
|
+
return pow(color,vec3(GammaEncodePowerApprox));
|
|
79
|
+
#endif
|
|
80
|
+
}
|
|
81
|
+
vec4 toGammaSpace(vec4 color)
|
|
82
|
+
{
|
|
83
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
84
|
+
return vec4(toGammaSpaceExact(color.rgb),color.a);
|
|
85
|
+
#else
|
|
86
|
+
return vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);
|
|
87
|
+
#endif
|
|
88
|
+
}
|
|
89
|
+
float square(float value)
|
|
90
|
+
{return value*value;}
|
|
91
|
+
vec3 square(vec3 value)
|
|
92
|
+
{return value*value;}
|
|
93
|
+
float pow5(float value) {float sq=value*value;return sq*sq*value;}
|
|
94
|
+
vec3 double_refract(vec3 I,vec3 N,float eta) {vec3 Tfront=refract(I,N,1.0/eta);vec3 Nback=normalize(reflect(N,Tfront));return refract(Tfront,-Nback,eta);}
|
|
95
|
+
float getLuminanceUnclamped(vec3 color)
|
|
96
|
+
{return dot(color,LuminanceEncodeApprox);}
|
|
97
|
+
float getLuminance(vec3 color)
|
|
98
|
+
{return saturate(getLuminanceUnclamped(color));}
|
|
99
|
+
float getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}
|
|
100
|
+
float dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;}
|
|
101
|
+
const float rgbdMaxRange=255.;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max(color.r,max(color.g,color.b)));float D =max(rgbdMaxRange/maxRGB,1.);D =saturate(floor(D)/255.);vec3 rgb=color.rgb*D;rgb=toGammaSpace(rgb);return vec4(saturate(rgb),D);}
|
|
102
|
+
vec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;}
|
|
103
|
+
vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}
|
|
104
|
+
vec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*TWO_PI-PI;float latitude=HALF_PI-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
|
|
105
|
+
float sqrtClamped(float value) {return sqrt(max(value,0.));}
|
|
106
|
+
float avg(vec3 value) {return dot(value,vec3(0.333333333));}
|
|
107
|
+
#if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
|
|
108
|
+
uint extractBits(uint value,int offset,int width) {return (value>>offset) & ((1u<<width)-1u);}
|
|
109
|
+
int onlyBitPosition(uint value) {return (floatBitsToInt(float(value))>>23)-0x7f;}
|
|
110
|
+
vec3 singleScatterToMultiScatterAlbedo(vec3 rho_ss) {vec3 s=sqrt(max(vec3(1.0)-rho_ss,vec3(0.0)));return (vec3(1.0)-s)*(vec3(1.0)-vec3(0.139)*s)/(vec3(1.0)+vec3(1.17)*s);}
|
|
111
|
+
vec3 multiScatterToSingleScatterAlbedo(vec3 rho_ms) {vec3 s=4.09712+4.20863*rho_ms-sqrt(9.59217+41.6808*rho_ms+17.7126*rho_ms*rho_ms);return 1.0-s*s;}
|
|
112
|
+
vec3 multiScatterToSingleScatterAlbedo(vec3 rho_ms,float aniso) {vec3 s=4.09712+4.20863*rho_ms-sqrt(9.59217+41.6808*rho_ms+17.7126*rho_ms*rho_ms);return (1.0-s*s)/maxEps(1.0-aniso*s*s);}
|
|
113
|
+
float min3(vec3 v) {return min(v.x,min(v.y,v.z));}
|
|
114
|
+
float max3(vec3 v) {return max(v.x,max(v.y,v.z));}
|
|
115
|
+
float uint2float(uint i) {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}
|
|
116
|
+
vec2 plasticSequence(const uint rstate) {return vec2(uint2float(rstate*3242174889u),
|
|
117
|
+
uint2float(rstate*2447445414u));}
|
|
118
|
+
#endif
|
|
119
|
+
`;r.ShaderStore.IncludesShadersStore[o]||(r.ShaderStore.IncludesShadersStore[o]=a),e.s(["helperFunctions",0,{name:o,shader:a}])},94597,e=>{"use strict";var r=e.i(12423),o=e.i(65296);let a="rgbdDecodePixelShader",t=`varying vec2 vUV;uniform sampler2D textureSampler;
|
|
120
|
+
#include<helperFunctions>
|
|
121
|
+
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
122
|
+
void main(void)
|
|
123
|
+
{gl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);}`;for(let e of(r.ShaderStore.ShadersStore[a]||(r.ShaderStore.ShadersStore[a]=t),[o.helperFunctions]))r.ShaderStore.IncludesShadersStore[e.name]||(r.ShaderStore.IncludesShadersStore[e.name]=e.shader);e.s(["rgbdDecodePixelShader",0,{name:a,shader:t}])}]);
|