@uptimizr/dashboard 0.1.2 → 0.2.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/out/404.html +1 -1
- package/out/__next.__PAGE__.txt +4 -4
- package/out/__next._full.txt +11 -11
- package/out/__next._head.txt +4 -4
- package/out/__next._index.txt +4 -4
- package/out/__next._tree.txt +2 -2
- package/out/_next/static/chunks/002cjeoit6-up.js +1 -0
- package/out/_next/static/chunks/02n1uiltexy3w.js +1 -0
- package/out/_next/static/chunks/03ab2khhe8-x5.js +1 -0
- package/out/_next/static/chunks/04_yytpc2paxy.js +1 -0
- package/out/_next/static/chunks/06qot1qvlsqaz.js +1 -0
- package/out/_next/static/chunks/07eeopuufsqp-.js +1501 -0
- package/out/_next/static/chunks/08a5xek662n8n.js +1 -0
- package/out/_next/static/chunks/08wuc9--s8zn_.js +1 -0
- package/out/_next/static/chunks/0927l-ygd5c8d.js +1 -0
- package/out/_next/static/chunks/09510356f0lad.js +1 -0
- package/out/_next/static/chunks/0_eu72k69lxj7.js +1 -0
- package/out/_next/static/chunks/0beajlqy8p8b5.js +1 -0
- package/out/_next/static/chunks/0c83pe1mpx456.js +1 -0
- package/out/_next/static/chunks/0echnagbkyx79.js +1198 -0
- package/out/_next/static/chunks/0eh1ml86u8dh7.js +1 -0
- package/out/_next/static/chunks/0fh-9h9ylxskr.js +674 -0
- package/out/_next/static/chunks/0fzmc1up21g1i.js +1 -0
- package/out/_next/static/chunks/0g_v2zswo4l6f.js +1 -0
- package/out/_next/static/chunks/0grlb9lo8e502.js +1 -0
- package/out/_next/static/chunks/0h22pg-0xrxnm.js +1 -0
- package/out/_next/static/chunks/0j6p1pmc14t96.js +1 -0
- package/out/_next/static/chunks/0j_6dx-sttgsy.js +1 -0
- package/out/_next/static/chunks/0j__xaq_8_di1.js +1 -0
- package/out/_next/static/chunks/0kfd-cvj5fvtz.js +1 -0
- package/out/_next/static/chunks/0o_mp98xzqfyf.js +1 -0
- package/out/_next/static/chunks/0otsec99kdkt7.js +213 -0
- package/out/_next/static/chunks/0ql-s-tsmel_u.js +151 -0
- package/out/_next/static/chunks/0r47gs_e93cka.js +1 -0
- package/out/_next/static/chunks/0sqys6o2pbe1q.js +1328 -0
- package/out/_next/static/chunks/0titqrn1qmcsv.js +1 -0
- package/out/_next/static/chunks/0tnlbw78tgaxp.js +4 -0
- package/out/_next/static/chunks/0tw4dyl-cp-hd.js +1 -0
- package/out/_next/static/chunks/0vbce-8omgurc.js +1 -0
- package/out/_next/static/chunks/0vfsg5byzep_0.js +1 -0
- package/out/_next/static/chunks/{0gv7mblzv3dl3.js → 0w8_1yjvol1f0.js} +20 -20
- package/out/_next/static/chunks/0xh144a5fz58h.js +1 -0
- package/out/_next/static/chunks/0xjltg_pph0c8.js +1 -0
- package/out/_next/static/chunks/0yeqgh0dnas8d.js +1 -0
- package/out/_next/static/chunks/101-7e_7up7rk.js +1 -0
- package/out/_next/static/chunks/128e51hj_04r0.js +1 -0
- package/out/_next/static/chunks/{10fnxpln_5xfd.js → 12kv810lohbsx.js} +2 -2
- package/out/_next/static/chunks/137xbvd4nd41j.js +3 -0
- package/out/_next/static/chunks/14bws-suyy5zu.js +1 -0
- package/out/_next/static/chunks/14ggsmqwej_tt.js +1656 -0
- package/out/_next/static/chunks/17genz6pkmty_.js +1 -0
- package/out/_next/static/chunks/17xd8hnazzr0g.js +1454 -0
- package/out/_next/static/chunks/18dczy9ylt2s_.js +1 -0
- package/out/_next/static/chunks/18xs_kvsaolb0.js +1 -0
- package/out/_next/static/chunks/19016f8-ry0z6.js +1 -0
- package/out/_next/static/chunks/1_6oejyxj39li.js +1 -0
- package/out/_next/static/chunks/1_aon8nz9p1fr.js +1 -0
- package/out/_next/static/chunks/1_qzlkuxukhpq.js +779 -0
- package/out/_next/static/chunks/1akaj5rhgitn3.js +1 -0
- package/out/_next/static/chunks/1bvl1ws7b_3gn.js +1 -0
- package/out/_next/static/chunks/1cdbk6kxyr1c9.js +1 -0
- package/out/_next/static/chunks/1fbjkk55uu4_g.js +1 -0
- package/out/_next/static/chunks/1furcfsgrw_3g.js +1 -0
- package/out/_next/static/chunks/1g0-f1g3gn_rs.js +1 -0
- package/out/_next/static/chunks/1g7emwu85bifo.js +557 -0
- package/out/_next/static/chunks/{37vzwr3ciejf1.js → 1gs-5722l4u59.js} +1 -1
- package/out/_next/static/chunks/1gt4kh0_xmigy.js +1 -0
- package/out/_next/static/chunks/1h8xzuuhhglu9.js +1 -0
- package/out/_next/static/chunks/1hatz-jlztrn0.js +1 -0
- package/out/_next/static/chunks/1iioifo7i0t0_.js +1 -0
- package/out/_next/static/chunks/{0impkpmxx3ttp.js → 1iiz7jqgj20z0.js} +1 -1
- package/out/_next/static/chunks/1kujmd5n0j9nk.js +1 -0
- package/out/_next/static/chunks/{2kazjq29jeamx.js → 1ltux4lwz7muf.js} +160 -372
- package/out/_next/static/chunks/1m_buecgcq67j.js +740 -0
- package/out/_next/static/chunks/1n9sy0yt5d2vq.js +1 -0
- package/out/_next/static/chunks/1p1gz6dseck--.js +1 -0
- package/out/_next/static/chunks/1p1xtsfwvpuqo.js +1 -0
- package/out/_next/static/chunks/1p8f6okk2ewbz.js +1 -0
- package/out/_next/static/chunks/1qg_etglhvp9h.js +740 -0
- package/out/_next/static/chunks/1th_t5ujeqlkf.js +1 -0
- package/out/_next/static/chunks/1thr-mdzbu96v.js +1 -0
- package/out/_next/static/chunks/1tta1a064979p.js +1 -0
- package/out/_next/static/chunks/1u_riwm0nfww7.js +1 -0
- package/out/_next/static/chunks/1ua15kzid0_8p.js +2560 -0
- package/out/_next/static/chunks/1uu-rt_8p1edp.js +2712 -0
- package/out/_next/static/chunks/1uu93wuxigx4k.js +1 -0
- package/out/_next/static/chunks/{1flb8adpj6_2o.js → 1xpwp4m1tqugp.js} +1 -1
- package/out/_next/static/chunks/1ynju1jqfrcv0.js +1 -0
- package/out/_next/static/chunks/1zfojlgb15okk.js +1 -0
- package/out/_next/static/chunks/1zj8x5wbgnzz-.js +1 -0
- package/out/_next/static/chunks/1zl6t15gh34nn.js +1 -0
- package/out/_next/static/chunks/{1thjncpj7u6pq.js → 223vrr_4sfhsj.js} +1 -1
- package/out/_next/static/chunks/22cr2b04btguf.js +1 -0
- package/out/_next/static/chunks/242xhzxxetctz.js +1 -0
- package/out/_next/static/chunks/24essz5mmvx-6.js +1 -0
- package/out/_next/static/chunks/256k1jw1m--l7.js +146 -0
- package/out/_next/static/chunks/259obyrpxcv6r.js +1 -0
- package/out/_next/static/chunks/26v9yqicofqba.js +1 -0
- package/out/_next/static/chunks/290d93hmm_e8b.js +1 -0
- package/out/_next/static/chunks/2_2fk7iddrs43.js +1 -0
- package/out/_next/static/chunks/{00k_j_r7bv_eb.js → 2bjlls8-qe05r.js} +9 -9
- package/out/_next/static/chunks/2ckd7f1wbfod-.js +1 -0
- package/out/_next/static/chunks/{163fa70v4mgxj.js → 2d6hru4qo23tt.js} +1 -1
- package/out/_next/static/chunks/2ejvntxtvf5o9.js +1 -0
- package/out/_next/static/chunks/2f7_3tzf7xhps.js +1 -0
- package/out/_next/static/chunks/2gxd_o1g89_bv.js +1 -0
- package/out/_next/static/chunks/2hd2txb4-m9k1.js +1 -0
- package/out/_next/static/chunks/2hpxou_cnp4f_.js +1 -0
- package/out/_next/static/chunks/2izioctrfc0s5.js +1 -0
- package/out/_next/static/chunks/2jhnk4h4n0udv.js +1 -0
- package/out/_next/static/chunks/2jpkhkk9zi8-f.js +1 -0
- package/out/_next/static/chunks/2kpet_l1kq2sx.js +1 -0
- package/out/_next/static/chunks/2mdbvf1b5h00_.css +3 -0
- package/out/_next/static/chunks/2nck5w4c7leb7.js +1 -0
- package/out/_next/static/chunks/2our10fwtj87e.js +1 -0
- package/out/_next/static/chunks/2qq3uzsbiicw3.js +1194 -0
- package/out/_next/static/chunks/2qqqpu0ahfdda.js +1 -0
- package/out/_next/static/chunks/2u-f7mmxvk8wj.js +1 -0
- package/out/_next/static/chunks/2ue1wo4ryk87z.js +1 -0
- package/out/_next/static/chunks/2uk-vwlxe9-xr.js +1 -0
- package/out/_next/static/chunks/2ur5-lxdvv1jm.js +1 -0
- package/out/_next/static/chunks/2veqsohwfhfqc.js +1 -0
- package/out/_next/static/chunks/2vqlv9wnewhu9.js +1 -0
- package/out/_next/static/chunks/{1zvc1tv--w8nn.js → 2wzshintp5lf8.js} +1 -1
- package/out/_next/static/chunks/2x-00glogc485.js +1 -0
- package/out/_next/static/chunks/2yfxy0f5fqs4o.js +1 -0
- package/out/_next/static/chunks/2z88mt3ixktu3.js +1 -0
- package/out/_next/static/chunks/2z_jn9ud28fk7.js +1 -0
- package/out/_next/static/chunks/3-eswqjobiqk1.js +1 -0
- package/out/_next/static/chunks/30-tbi7pys6fp.js +4 -0
- package/out/_next/static/chunks/30c-nsedy_ce0.js +1 -0
- package/out/_next/static/chunks/31u5lbu1vxznh.js +1 -0
- package/out/_next/static/chunks/{2feca0xcipcyt.js → 32ahba5ezp467.js} +156 -156
- package/out/_next/static/chunks/337hn35kts7ud.js +1 -0
- package/out/_next/static/chunks/33dgpebv-tf73.js +1 -0
- package/out/_next/static/chunks/36jkdhq6kb-cf.js +1 -0
- package/out/_next/static/chunks/37epa8fz59vba.js +1166 -0
- package/out/_next/static/chunks/3833xfnz0a-ub.js +1 -0
- package/out/_next/static/chunks/38awrh_qxn22k.js +1 -0
- package/out/_next/static/chunks/{0wrm9jr-9bw0e.js → 38x3c1ra5slhe.js} +383 -913
- package/out/_next/static/chunks/39idqlqlcp5b9.js +1 -0
- package/out/_next/static/chunks/{2a3spdq-m8drh.js → 3_gku1pwluoo0.js} +1 -1
- package/out/_next/static/chunks/3_mu-4rdjajna.js +1450 -0
- package/out/_next/static/chunks/3coacc4-g-g5c.js +1 -0
- package/out/_next/static/chunks/3e00fzdfkclzq.js +1 -0
- package/out/_next/static/chunks/3e8fmlq0k5wkg.js +1 -0
- package/out/_next/static/chunks/3e9tzyrt4_98z.js +1 -0
- package/out/_next/static/chunks/3edelqkq92pil.js +1 -0
- package/out/_next/static/chunks/3figbil1t4ssj.js +593 -0
- package/out/_next/static/chunks/3gimb3z_mteou.js +1 -0
- package/out/_next/static/chunks/{2p2vv6cc9i-3q.js → 3idaz_s77e-j_.js} +9 -9
- package/out/_next/static/chunks/3j-4wuhs5weba.js +1 -0
- package/out/_next/static/chunks/3jjfnwvybayy7.js +1 -0
- package/out/_next/static/chunks/3jwm5dfk_78gc.js +1 -0
- package/out/_next/static/chunks/3k9d4ylc3li2t.js +1352 -0
- package/out/_next/static/chunks/3l3_0ack3gy4k.js +1 -0
- package/out/_next/static/chunks/3lwhs5ja7tun3.js +1 -0
- package/out/_next/static/chunks/3m6nmp2dca6un.js +1342 -0
- package/out/_next/static/chunks/3mbnfpufs2-7e.js +7 -0
- package/out/_next/static/chunks/3mcd08gmt038z.js +1 -0
- package/out/_next/static/chunks/3mt5th7b1i_u9.js +1 -0
- package/out/_next/static/chunks/3ne77mjdz2y7o.js +1 -0
- package/out/_next/static/chunks/3puhrqtujktyv.js +1 -0
- package/out/_next/static/chunks/3rdifucupcgkg.js +1 -0
- package/out/_next/static/chunks/3riekaxl3uxfb.js +1195 -0
- package/out/_next/static/chunks/3sdoskq_buttj.js +1 -0
- package/out/_next/static/chunks/3tg-ma9tv9xu4.js +1 -0
- package/out/_next/static/chunks/3tm-pqpmq_ppw.js +1 -0
- package/out/_next/static/chunks/3w9go565cjhq3.js +1636 -0
- package/out/_next/static/chunks/3wi9gzq2mtr_q.js +8 -0
- package/out/_next/static/chunks/3xagd_2_9zft2.js +1 -0
- package/out/_next/static/chunks/3xsq_anpad-fb.js +1 -0
- package/out/_next/static/chunks/3ycv2qq7vpbua.js +1 -0
- package/out/_next/static/chunks/3z84au-mitjjw.js +1 -0
- package/out/_next/static/chunks/4030dhur2h70-.js +1 -0
- package/out/_next/static/chunks/40ffffml4h_3r.js +4 -0
- package/out/_next/static/chunks/{3-shckrcpvbxu.js → 41wt50z9tx9cx.js} +108 -711
- package/out/_next/static/chunks/431slrqh0wa0g.js +1 -0
- package/out/_next/static/chunks/43s_lbd1i2krj.js +1 -0
- package/out/_next/static/chunks/{0-2y-_oomza2l.js → 44nxswtahaq4w.js} +18 -18
- package/out/_next/static/chunks/45bwefvdpztfs.js +1 -0
- package/out/_next/static/chunks/{turbopack-0sgd6pfbe1fy6.js → turbopack-19105pdhzxp1x.js} +1 -1
- package/out/_not-found/__next._full.txt +9 -9
- package/out/_not-found/__next._head.txt +4 -4
- package/out/_not-found/__next._index.txt +4 -4
- package/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/out/_not-found/__next._not-found.txt +3 -3
- package/out/_not-found/__next._tree.txt +2 -2
- package/out/_not-found.html +1 -1
- package/out/_not-found.txt +9 -9
- package/out/index.html +1 -1
- package/out/index.txt +11 -11
- package/package.json +5 -4
- package/out/_next/static/chunks/068j6934u8j16.js +0 -1
- package/out/_next/static/chunks/09e4adtr6w0xe.js +0 -1
- package/out/_next/static/chunks/0_rf76jneiwal.js +0 -176
- package/out/_next/static/chunks/0aznt7717miff.js +0 -1
- package/out/_next/static/chunks/0cu-q5q3a7uf3.js +0 -1
- package/out/_next/static/chunks/0fskcfh9vbhtv.js +0 -1
- package/out/_next/static/chunks/0gg-ii7i6d_p6.js +0 -1
- package/out/_next/static/chunks/0tx1j_ghpz7rc.css +0 -3
- package/out/_next/static/chunks/0ufbyo1x3qkmo.js +0 -1
- package/out/_next/static/chunks/0wwcfw8i3j_zx.js +0 -1
- package/out/_next/static/chunks/0wwkrsvxwi57d.js +0 -1
- package/out/_next/static/chunks/0ys9-ozuluawt.js +0 -1
- package/out/_next/static/chunks/1-61zh4waha61.js +0 -1
- package/out/_next/static/chunks/10r_824wzt8hj.js +0 -1
- package/out/_next/static/chunks/123xxske5c9na.js +0 -1
- package/out/_next/static/chunks/13isnf0--pmx1.js +0 -1
- package/out/_next/static/chunks/157d9euci08yu.js +0 -1
- package/out/_next/static/chunks/18u58lorfahxi.js +0 -4
- package/out/_next/static/chunks/1_aahautsz2v_.js +0 -1
- package/out/_next/static/chunks/1o1d0p-v1z8ty.js +0 -1
- package/out/_next/static/chunks/1vdjn0pkoyypn.js +0 -1
- package/out/_next/static/chunks/1yehxf-fmeicg.js +0 -1
- package/out/_next/static/chunks/1zx2q-r32thv1.js +0 -4
- package/out/_next/static/chunks/2-sjjedfr0kfq.js +0 -1
- package/out/_next/static/chunks/25b9x-li-tvk2.js +0 -1
- package/out/_next/static/chunks/2aelw3far6rii.js +0 -1
- package/out/_next/static/chunks/2aor7m-wbis85.js +0 -1
- package/out/_next/static/chunks/2clzipqap01hp.js +0 -1
- package/out/_next/static/chunks/2fh-_9b6tqhvb.js +0 -1
- package/out/_next/static/chunks/2g5gecypj0rqe.js +0 -1
- package/out/_next/static/chunks/2szdcpl41-kzv.js +0 -1
- package/out/_next/static/chunks/2u6shh3oeycm-.js +0 -1
- package/out/_next/static/chunks/2unhhuv0arlcv.js +0 -1
- package/out/_next/static/chunks/2z5eqx5do5std.js +0 -1
- package/out/_next/static/chunks/310uz81hnnzsu.js +0 -1
- package/out/_next/static/chunks/3aqbf_wkg2sih.js +0 -3
- package/out/_next/static/chunks/3i3gbhccmhu7j.js +0 -210
- package/out/_next/static/chunks/3mqy-84_ul3t2.js +0 -1
- package/out/_next/static/chunks/3nz-dh9d7cehk.js +0 -1
- package/out/_next/static/chunks/3pufs8g4ui943.js +0 -1
- package/out/_next/static/chunks/3t06schbtqonl.js +0 -1
- package/out/_next/static/chunks/3v3-7fio3nw_t.js +0 -1
- package/out/_next/static/chunks/3v5ha25nxo43j.js +0 -1
- package/out/_next/static/chunks/3zskk1hxu3-_o.js +0 -1
- /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_buildManifest.js +0 -0
- /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36516,e=>{"use strict";var t=e.i(99267),r=e.i(96265),s=e.i(58720),i=e.i(63132),n=e.i(68179),a=e.i(13379),h=e.i(33855),o=e.i(471),d=e.i(48657),c=e.i(23240),l=e.i(45707),_=e.i(21823);class g{get renderList(){return this._renderList}set renderList(e){this._renderList!==e&&(this._unObserveRenderList&&(this._unObserveRenderList(),this._unObserveRenderList=null),e&&(this._unObserveRenderList=(0,d._ObserveArray)(e,this._renderListHasChanged)),this._renderList=e)}get disableImageProcessing(){return this._disableImageProcessing}set disableImageProcessing(e){e!==this._disableImageProcessing&&(this._disableImageProcessing=e,this._scene.markAllMaterialsAsDirty(64))}get disableDepthPrePass(){return this._disableDepthPrePass}set disableDepthPrePass(e){this._disableDepthPrePass=e,this._renderingManager.disableDepthPrePass=e}get name(){return this._name}set name(e){if(this._name!==e){if(this._name=e,this._sceneUBOs)for(let e=0;e<this._sceneUBOs.length;++e)this._sceneUBOs[e].name=`Scene ubo #${e} for ${this.name}`;if(this._scene)for(let e=0;e<this._renderPassIds.length;++e){let t=this._renderPassIds[e];this._engine._renderPassNames[t]=`${this._name}#${e}`}}}get renderPassIds(){return this._renderPassIds}get currentRefreshId(){return this._currentRefreshId}getActiveMeshes(){return this._activeMeshes}setMaterialForRendering(e,t){let r;r=Array.isArray(e)?e:[e];for(let e=0;e<r.length;++e)for(let s=0;s<this.options.numPasses;++s){let i=r[e];r[e].isAnInstance&&(i=r[e].sourceMesh),i.setMaterialForRenderPass(this._renderPassIds[s],void 0!==t?Array.isArray(t)?t[s]:t:void 0)}}_freezeActiveMeshes(e){this._freezeActiveMeshesCancel=(0,c._RetryWithInterval)(()=>this._checkReadiness(),()=>{if(this._freezeActiveMeshesCancel=null,e)for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._freeze();this._prepareRenderingManager(0,!0),this._isFrozen=!0},(e,t)=>{this._freezeActiveMeshesCancel=null,t?(a.Logger.Error("ObjectRenderer: Timeout while waiting for the renderer to be ready."),e&&a.Logger.Error(e)):(a.Logger.Error("ObjectRenderer: An unexpected error occurred while waiting for the renderer to be ready."),e&&(a.Logger.Error(e),e.stack&&a.Logger.Error(e.stack)))})}_unfreezeActiveMeshes(){this._freezeActiveMeshesCancel?.(),this._freezeActiveMeshesCancel=null;for(let e=0;e<this._activeMeshes.length;e++)this._activeMeshes.data[e]._unFreeze();this._isFrozen=!1}constructor(e,r,s){this._unObserveRenderList=null,this._renderListHasChanged=(e,t)=>{let r=this._renderList?this._renderList.length:0;if(0===t&&r>0||0===r)for(let e of this._scene.meshes)e._markSubMeshesAsLightDirty()},this.particleSystemList=null,this.getCustomRenderList=null,this.renderMeshes=!0,this.renderDepthOnlyMeshes=!0,this.renderOpaqueMeshes=!0,this.renderAlphaTestMeshes=!0,this.renderTransparentMeshes=!0,this.renderParticles=!0,this.renderSprites=!1,this.forceLayerMaskCheck=!1,this.enableBoundingBoxRendering=!1,this.enableOutlineRendering=!0,this._disableImageProcessing=!1,this.dontSetTransformationMatrix=!1,this._disableDepthPrePass=!1,this.onBeforeRenderObservable=new t.Observable,this.onAfterRenderObservable=new t.Observable,this.onBeforeRenderingManagerRenderObservable=new t.Observable,this.onAfterRenderingManagerRenderObservable=new t.Observable,this.onInitRenderingObservable=new t.Observable,this.onFinishRenderingObservable=new t.Observable,this.onFastPathRenderObservable=new t.Observable,this._currentRefreshId=-1,this._refreshRate=1,this._currentApplyByPostProcessSetting=!1,this._activeMeshes=new l.SmartArray(256),this._activeBoundingBoxes=new l.SmartArray(32),this._currentFrameId=-1,this._currentSceneUBOIndex=0,this._isFrozen=!1,this._freezeActiveMeshesCancel=null,this._currentSceneCamera=null,this.name=e,this._scene=r,this._engine=this._scene.getEngine(),this._useUBO=this._engine.supportsUniformBuffers,this.renderList=[],this._renderPassIds=[],this.options={numPasses:1,doNotChangeAspectRatio:!0,enableClusteredLights:!1,...s},this._createRenderPassId(),this.renderPassId=this._renderPassIds[0],this._renderingManager=new o.RenderingManager(r),this._renderingManager._useSceneAutoClearSetup=!0,this.options.enableClusteredLights&&this.onInitRenderingObservable.add(()=>{for(let e of this._scene.lights)e.getTypeID()===_.LightConstants.LIGHTTYPEID_CLUSTERED_CONTAINER&&e.isSupported&&e._updateBatches(this.activeCamera).render()}),this._scene.addObjectRenderer(this)}_releaseRenderPassId(){for(let e=0;e<this.options.numPasses;++e)this._engine.releaseRenderPassId(this._renderPassIds[e]);this._renderPassIds.length=0}_createRenderPassId(){this._releaseRenderPassId();for(let e=0;e<this.options.numPasses;++e)this._renderPassIds[e]=this._engine.createRenderPassId(`${this.name}#${e}`)}_createSceneUBO(e,t){let r=this._scene.getEngine(),s=new h.UniformBuffer(r,void 0,t,e,void 0,!1);return s.addUniform("viewProjection",16),t&&s.addUniform("viewProjectionR",16),s.addUniform("view",16),s.addUniform("projection",16),s.addUniform("vEyePosition",4),s.addUniform("inverseProjection",16),s}_getSceneUBO(){this._currentFrameId!==this._engine.frameId&&(this._currentSceneUBOIndex=0,this._currentFrameId=this._engine.frameId),this._sceneUBOs||(this._sceneUBOs=[],this._sceneUBOIsMultiview=[]);let e=this._engine._currentRenderTarget,t=!!(e&&e.texture?.isMultiview)||!!this._scene._multiviewSceneUboIsActive;if(this._currentSceneUBOIndex>=this._sceneUBOs.length){let e=this._sceneUBOs.length;this._sceneUBOs.push(this._createSceneUBO(`Scene ubo #${e} for ${this.name}`,t)),this._sceneUBOIsMultiview.push(t)}else this._sceneUBOIsMultiview[this._currentSceneUBOIndex]!==t&&(this._sceneUBOs[this._currentSceneUBOIndex].dispose(),this._sceneUBOs[this._currentSceneUBOIndex]=this._createSceneUBO(`Scene ubo #${this._currentSceneUBOIndex} for ${this.name}`,t),this._sceneUBOIsMultiview[this._currentSceneUBOIndex]=t);let r=this._sceneUBOs[this._currentSceneUBOIndex++];return r.unbindEffect(),r}resetRefreshCounter(){this._currentRefreshId=-1}get refreshRate(){return this._refreshRate}set refreshRate(e){this._refreshRate=e,this.resetRefreshCounter()}shouldRender(){return!!this._engine.snapshotRendering||(-1===this._currentRefreshId||this.refreshRate===this._currentRefreshId?(this._currentRefreshId=1,!0):(this._currentRefreshId++,!1))}isReadyForRendering(e,t){this.prepareRenderList(),this.initRender(e,t);let r=this._checkReadiness();return this.finishRender(),r}prepareRenderList(){let e=this._scene;if(this._waitingRenderList){if(!this.renderListPredicate){this.renderList=[];for(let t=0;t<this._waitingRenderList.length;t++){let r=this._waitingRenderList[t],s=e.getMeshById(r);s&&this.renderList.push(s)}}this._waitingRenderList=void 0}if(this.renderListPredicate){this.renderList?this.renderList.length=0:this.renderList=[];let e=this._scene.meshes;for(let t=0;t<e.length;t++){let r=e[t];this.renderListPredicate(r)&&this.renderList.push(r)}}this._currentApplyByPostProcessSetting=this._scene.imageProcessingConfiguration.applyByPostProcess,this._disableImageProcessing&&(this._scene.imageProcessingConfiguration._applyByPostProcess=this._disableImageProcessing)}initRender(e,t){let r=this.activeCamera??this._scene.activeCamera;this._currentSceneCamera=this._scene.activeCamera,this._useUBO&&(this._currentSceneUBO=this._scene.getSceneUniformBuffer(),this._currentSceneUBO.unbindEffect(),this._scene.setSceneUniformBuffer(this._getSceneUBO())),this.onInitRenderingObservable.notifyObservers(this),r&&(this.dontSetTransformationMatrix||this._scene.setTransformMatrix(r.getViewMatrix(),r.getProjectionMatrix(!0)),this._scene._activeCamera=r,this._engine.setViewport(r.rigParent?r.rigParent.viewport:r.viewport,e,t)),this._useUBO&&this._scene.finalizeSceneUbo(),this._defaultRenderListPrepared=!1}finishRender(){let e=this._scene;this._useUBO&&this._scene.setSceneUniformBuffer(this._currentSceneUBO),this._disableImageProcessing&&(e.imageProcessingConfiguration._applyByPostProcess=this._currentApplyByPostProcessSetting),e._activeCamera=this._currentSceneCamera,this._currentSceneCamera&&(this.activeCamera&&this.activeCamera!==e.activeCamera&&e.setTransformMatrix(this._currentSceneCamera.getViewMatrix(),this._currentSceneCamera.getProjectionMatrix(!0)),this._engine.setViewport(this._currentSceneCamera.viewport)),e.resetCachedMaterial(),this.onFinishRenderingObservable.notifyObservers(this)}render(e=0,t=!1){let r=this._engine.currentRenderPassId;if(this._engine.currentRenderPassId=this._renderPassIds[e],this.onBeforeRenderObservable.notifyObservers(e),this._engine.snapshotRendering&&1===this._engine.snapshotRenderingMode)this.onFastPathRenderObservable.notifyObservers(e);else{let t=this._prepareRenderingManager(e),r=this._scene.getOutlineRenderer?.(),s=r?.enabled;r&&(r.enabled=this.enableOutlineRendering),this.onBeforeRenderingManagerRenderObservable.notifyObservers(e),this._renderingManager.render(this.customRenderFunction,t,this.renderParticles,this.renderSprites,this.renderDepthOnlyMeshes,this.renderOpaqueMeshes,this.renderAlphaTestMeshes,this.renderTransparentMeshes,this.customRenderTransparentSubMeshes),this.onAfterRenderingManagerRenderObservable.notifyObservers(e),r&&(r.enabled=s)}t||this.onAfterRenderObservable.notifyObservers(e),this._engine.currentRenderPassId=r}_checkReadiness(){let e=this._scene,t=this._engine.currentRenderPassId,r=!0;e.getViewMatrix()||e.updateTransformMatrix();let s=this.options.numPasses;for(let t=0;t<s&&r;t++){let i=this.renderList?this.renderList:e.frameGraph?e.meshes:e.getActiveMeshes().data,n=this.renderList||e.frameGraph?i.length:e.getActiveMeshes().length;this._engine.currentRenderPassId=this._renderPassIds[t],this.onBeforeRenderObservable.notifyObservers(t);let a=null,h=n;this.getCustomRenderList&&(a=this.getCustomRenderList(t,i,n))&&(h=a.length),a||(a=i),this.options.doNotChangeAspectRatio||e.updateTransformMatrix(!0);for(let e=0;e<h&&r;++e){let t=a[e];if(t.isEnabled()&&!t.isBlocked&&t.isVisible&&t.subMeshes){if(this.customIsReadyFunction){if(!this.customIsReadyFunction(t,this.refreshRate,!0)){r=!1;continue}}else if(!t.isReady(!0)){r=!1;continue}}}this.onAfterRenderObservable.notifyObservers(t),s>1&&(e.incrementRenderId(),e.resetCachedMaterial())}for(let t of this.particleSystemList||e.particleSystems)t.isReady()||(r=!1);return this._engine.currentRenderPassId=t,r}_prepareRenderingManager(e=0,t=!1){let r,s,i=this._scene,n=null,a=this.renderList?this.renderList:i.frameGraph?i.meshes:i.getActiveMeshes().data,h=this.renderList||i.frameGraph?a.length:i.getActiveMeshes().length;if(this.getCustomRenderList&&(n=this.getCustomRenderList(e,a,h)),n)r=n.length,s=this.forceLayerMaskCheck;else{if(this._defaultRenderListPrepared&&!t&&!this._engine.isWebGPU)return a;this._defaultRenderListPrepared=!0,n=a,r=h,s=!this.renderList||this.forceLayerMaskCheck}let o=i.activeCamera,d=this.cameraForLOD??o,c=i.getBoundingBoxRenderer?.();if(i._activeMeshesFrozen&&this._isFrozen){if(this._renderingManager.resetSprites(),this.enableBoundingBoxRendering&&c){c.reset();for(let e=0;e<this._activeBoundingBoxes.length;e++){let t=this._activeBoundingBoxes.data[e];c.renderList.push(t)}}return n}if(this._renderingManager.reset(),this._activeMeshes.reset(),this._activeBoundingBoxes.reset(),c&&c.reset(),this.renderMeshes){let e=i.getRenderId(),t=i.getFrameId();for(let a=0;a<r;a++){let r=n[a];if(r&&!r.isBlocked){let n,a;if(this.customIsReadyFunction){if(!this.customIsReadyFunction(r,this.refreshRate,!1)){this.resetRefreshCounter();continue}}else if(!r.isReady(0===this.refreshRate)){this.resetRefreshCounter();continue}if(d){let e=r._internalAbstractMeshDataInfo._currentLOD.get(d);e&&e[1]===t?n=e[0]:(n=i.customLODSelector?i.customLODSelector(r,d):r.getLOD(d),e?(e[0]=n,e[1]=t):r._internalAbstractMeshDataInfo._currentLOD.set(d,[n,t]))}else n=r;if(!n)continue;if(n!==r&&0!==n.billboardMode&&n.computeWorldMatrix(),n._preActivateForIntermediateRendering(e),a=!!s&&!!o&&(r.layerMask&o.layerMask)==0,r.isEnabled()&&r.isVisible&&r.subMeshes&&!a){if(this._activeMeshes.push(r),n._internalAbstractMeshDataInfo._wasActiveLastFrame=!0,n!==r&&n._activate(e,!0),this.enableBoundingBoxRendering&&c&&c._preActiveMesh(r),r._activate(e,!0)&&r.subMeshes.length){r.isAnInstance?r._internalAbstractMeshDataInfo._actAsRegularMesh&&(n=r):n._internalAbstractMeshDataInfo._onlyForInstancesIntermediate=!1,n._internalAbstractMeshDataInfo._isActiveIntermediate=!0,i._prepareSkeleton(n);for(let e=0;e<n.subMeshes.length;e++){let t=n.subMeshes[e];this.enableBoundingBoxRendering&&c&&c._evaluateSubMesh(r,t),this._renderingManager.dispatch(t,n)}}r._postActivate()}}}}if(this.enableBoundingBoxRendering&&c&&t)for(let e=0;e<c.renderList.length;e++){let t=c.renderList.data[e];this._activeBoundingBoxes.push(t)}if(this._scene.particlesEnabled&&this.renderParticles){this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);let e=this.particleSystemList||i.particleSystems;for(let t=0;t<e.length;t++){let r=e[t],s=r.emitter;r.isStarted()&&s&&(!s.position||s.isEnabled())&&this._renderingManager.dispatchParticles(r)}this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene)}return n}get renderingManager(){return this._renderingManager}setRenderingOrder(e,t=null,r=null,s=null){this._renderingManager.setRenderingOrder(e,t,r,s)}setRenderingAutoClearDepthStencil(e,t,r=!0,s=!0){this._renderingManager.setRenderingAutoClearDepthStencil(e,t,r,s),this._renderingManager._useSceneAutoClearSetup=!1}clone(){let e=new g(this.name,this._scene,this.options);return this.renderList&&(e.renderList=this.renderList.slice(0)),e}dispose(){let e=this.renderList?this.renderList:this._scene.getActiveMeshes().data,t=this.renderList?this.renderList.length:this._scene.getActiveMeshes().length;for(let r=0;r<t;r++){let t=e[r];t&&void 0!==t.getMaterialForRenderPass(this.renderPassId)&&t.setMaterialForRenderPass(this.renderPassId,void 0)}if(this.onInitRenderingObservable.clear(),this.onFinishRenderingObservable.clear(),this.onBeforeRenderObservable.clear(),this.onAfterRenderObservable.clear(),this.onBeforeRenderingManagerRenderObservable.clear(),this.onAfterRenderingManagerRenderObservable.clear(),this.onFastPathRenderObservable.clear(),this._releaseRenderPassId(),this.renderList=null,this._sceneUBOs)for(let e of this._sceneUBOs)e.dispose();this._sceneUBOs=void 0,this._scene.removeObjectRenderer(this)}_rebuild(){this.refreshRate===g.REFRESHRATE_RENDER_ONCE&&(this.refreshRate=g.REFRESHRATE_RENDER_ONCE)}freeRenderingGroups(){this._renderingManager&&this._renderingManager.freeRenderingGroups()}}g.REFRESHRATE_RENDER_ONCE=0,g.REFRESHRATE_RENDER_ONEVERYFRAME=1,g.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=2;var u=e.i(99904),R=e.i(75405);class b extends s.Texture{get renderListPredicate(){return this._objectRenderer.renderListPredicate}set renderListPredicate(e){this._objectRenderer.renderListPredicate=e}get renderList(){return this._objectRenderer.renderList}set renderList(e){this._objectRenderer.renderList=e}get particleSystemList(){return this._objectRenderer.particleSystemList}set particleSystemList(e){this._objectRenderer.particleSystemList=e}get getCustomRenderList(){return this._objectRenderer.getCustomRenderList}set getCustomRenderList(e){this._objectRenderer.getCustomRenderList=e}get renderParticles(){return this._objectRenderer.renderParticles}set renderParticles(e){this._objectRenderer.renderParticles=e}get renderSprites(){return this._objectRenderer.renderSprites}set renderSprites(e){this._objectRenderer.renderSprites=e}get enableBoundingBoxRendering(){return this._objectRenderer.enableBoundingBoxRendering}set enableBoundingBoxRendering(e){this._objectRenderer.enableBoundingBoxRendering=e}get enableOutlineRendering(){return this._objectRenderer.enableOutlineRendering}set enableOutlineRendering(e){this._objectRenderer.enableOutlineRendering=e}get forceLayerMaskCheck(){return this._objectRenderer.forceLayerMaskCheck}set forceLayerMaskCheck(e){this._objectRenderer.forceLayerMaskCheck=e}get activeCamera(){return this._objectRenderer.activeCamera}set activeCamera(e){this._objectRenderer.activeCamera=e}get cameraForLOD(){return this._objectRenderer.cameraForLOD}set cameraForLOD(e){this._objectRenderer.cameraForLOD=e}get disableImageProcessing(){return this._objectRenderer.disableImageProcessing}set disableImageProcessing(e){this._objectRenderer.disableImageProcessing=e}get customIsReadyFunction(){return this._objectRenderer.customIsReadyFunction}set customIsReadyFunction(e){this._objectRenderer.customIsReadyFunction=e}get customRenderFunction(){return this._objectRenderer.customRenderFunction}set customRenderFunction(e){this._objectRenderer.customRenderFunction=e}get postProcesses(){return this._postProcesses}get _prePassEnabled(){return!!this._prePassRenderTarget&&this._prePassRenderTarget.enabled}set onAfterUnbind(e){this._onAfterUnbindObserver&&this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver),this._onAfterUnbindObserver=this.onAfterUnbindObservable.add(e)}get onBeforeRenderObservable(){return this._objectRenderer.onBeforeRenderObservable}set onBeforeRender(e){this._onBeforeRenderObserver&&this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=this.onBeforeRenderObservable.add(e)}get onAfterRenderObservable(){return this._objectRenderer.onAfterRenderObservable}set onAfterRender(e){this._onAfterRenderObserver&&this.onAfterRenderObservable.remove(this._onAfterRenderObserver),this._onAfterRenderObserver=this.onAfterRenderObservable.add(e)}set onClear(e){this._onClearObserver&&this.onClearObservable.remove(this._onClearObserver),this._onClearObserver=this.onClearObservable.add(e)}get _waitingRenderList(){return this._objectRenderer._waitingRenderList}set _waitingRenderList(e){this._objectRenderer._waitingRenderList=e}get renderPassId(){return this._objectRenderer.renderPassId}get renderPassIds(){return this._objectRenderer.renderPassIds}get currentRefreshId(){return this._objectRenderer.currentRefreshId}setMaterialForRendering(e,t){this._objectRenderer.setMaterialForRendering(e,t)}get isMulti(){return this._renderTarget?.isMulti??!1}get renderTargetOptions(){return this._renderTargetOptions}get renderTarget(){return this._renderTarget}_onRatioRescale(){this._sizeRatio&&this.resize(this._initialSizeParameter)}set boundingBoxSize(e){if(this._boundingBoxSize&&this._boundingBoxSize.equals(e))return;this._boundingBoxSize=e;let t=this.getScene();t&&t.markAllMaterialsAsDirty(1)}get boundingBoxSize(){return this._boundingBoxSize}get depthStencilTexture(){return this._renderTarget?._depthStencilTexture??null}constructor(e,i,n,h=!1,o=!0,d=0,c=!1,l=s.Texture.TRILINEAR_SAMPLINGMODE,_=!0,u=!1,R=!1,b=5,f=!1,p,O,m=!1,v=!1){let P,M,T=!0,S=!1;if("object"==typeof h){const e=h;h=!!e.generateMipMaps,o=e.doNotChangeAspectRatio??!0,d=e.type??0,c=!!e.isCube,l=e.samplingMode??s.Texture.TRILINEAR_SAMPLINGMODE,_=e.generateDepthBuffer??!0,u=!!e.generateStencilBuffer,R=!!e.isMulti,b=e.format??5,f=!!e.delayAllocation,p=e.samples,O=e.creationFlags,m=!!e.noColorAttachment,v=!!e.useSRGBBuffer,P=e.colorAttachment,T=e.gammaSpace??T,M=e.existingObjectRenderer,S=!!e.enableClusteredLights}if(super(null,n,!h,void 0,l,void 0,void 0,void 0,void 0,b),this.ignoreCameraViewport=!1,this.onBeforeBindObservable=new t.Observable,this.onAfterUnbindObservable=new t.Observable,this.onClearObservable=new t.Observable,this.onResizeObservable=new t.Observable,this._cleared=!1,this.skipInitialClear=!1,this._samples=1,this._canRescale=!0,this._renderTarget=null,this._dontDisposeObjectRenderer=!1,this.boundingBoxPosition=r.Vector3.Zero(),this._disableEngineStages=!1,this._dumpToolsLoading=!1,!(n=this.getScene()))return;const L=this.getScene().getEngine();if(this._gammaSpace=T,this._coordinatesMode=s.Texture.PROJECTION_MODE,this.name=e,this.isRenderTarget=!0,this._initialSizeParameter=i,this._dontDisposeObjectRenderer=!!M,this._processSizeParameter(i),this._objectRenderer=M??new g(e,n,{numPasses:c?6:this.getRenderLayers()||1,doNotChangeAspectRatio:o,enableClusteredLights:S}),this._onBeforeRenderingManagerRenderObserver=this._objectRenderer.onBeforeRenderingManagerRenderObservable.add(()=>{let e=this._scene;if(!this._disableEngineStages)for(let t of e._beforeRenderTargetClearStage)t.action(this,this._currentFaceIndex,this._currentLayer);if(this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(L):this.skipInitialClear||L.clear(this.clearColor??e.clearColor,!0,!0,!0),this._doNotChangeAspectRatio||e.updateTransformMatrix(!0),!this._disableEngineStages)for(let t of e._beforeRenderTargetDrawStage)t.action(this,this._currentFaceIndex,this._currentLayer);L._debugPushGroup&&L._debugPushGroup(`Render to ${this.name} (face #${this._currentFaceIndex} layer #${this._currentLayer})`)}),this._onAfterRenderingManagerRenderObserver=this._objectRenderer.onAfterRenderingManagerRenderObservable.add(()=>{if(L._debugPopGroup&&L._debugPopGroup(),!this._disableEngineStages)for(let e of this._scene._afterRenderTargetDrawStage)e.action(this,this._currentFaceIndex,this._currentLayer);let e=this._texture?.generateMipMaps??!1;if(this._texture&&(this._texture.generateMipMaps=!1),this._postProcessManager?this._postProcessManager._finalizeFrame(!1,this._renderTarget??void 0,this._currentFaceIndex,this._postProcesses,this.ignoreCameraViewport):this._currentUseCameraPostProcess&&this._scene.postProcessManager._finalizeFrame(!1,this._renderTarget??void 0,this._currentFaceIndex),!this._disableEngineStages)for(let e of this._scene._afterRenderTargetPostProcessStage)e.action(this,this._currentFaceIndex,this._currentLayer);this._texture&&(this._texture.generateMipMaps=e),this._doNotChangeAspectRatio||this._scene.updateTransformMatrix(!0),this._currentDumpForDebug&&(this._dumpTools?this._dumpTools.DumpFramebuffer(this.getRenderWidth(),this.getRenderHeight(),L):a.Logger.Error("dumpTools module is still being loaded. To speed up the process import dump tools directly in your project"))}),this._onFastPathRenderObserver=this._objectRenderer.onFastPathRenderObservable.add(()=>{this.onClearObservable.hasObservers()?this.onClearObservable.notifyObservers(L):this.skipInitialClear||L.clear(this.clearColor||this._scene.clearColor,!0,!0,!0)}),this._resizeObserver=L.onResizeObservable.add(()=>{}),this._generateMipMaps=!!h,this._doNotChangeAspectRatio=o,R)return;this._renderTargetOptions={generateMipMaps:h,type:d,format:this._format??void 0,samplingMode:this.samplingMode,generateDepthBuffer:_,generateStencilBuffer:u,samples:p,creationFlags:O,noColorAttachment:m,useSRGBBuffer:v,colorAttachment:P,label:this.name},this.samplingMode===s.Texture.NEAREST_SAMPLINGMODE&&(this.wrapU=s.Texture.CLAMP_ADDRESSMODE,this.wrapV=s.Texture.CLAMP_ADDRESSMODE),f||(c?(this._renderTarget=n.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions),this.coordinatesMode=s.Texture.INVCUBIC_MODE,this._textureMatrix=r.Matrix.Identity()):this._renderTarget=n.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,void 0!==p&&(this.samples=p))}createDepthStencilTexture(e=0,t=!0,r=!1,s=1,i=14,n){this._renderTarget?.createDepthStencilTexture(e,t,r,s,i,n)}_processSizeParameter(e){if(e.ratio){this._sizeRatio=e.ratio;let t=this._getEngine();this._size={width:this._bestReflectionRenderTargetDimension(t.getRenderWidth(),this._sizeRatio),height:this._bestReflectionRenderTargetDimension(t.getRenderHeight(),this._sizeRatio)}}else this._size=e}get samples(){return this._renderTarget?.samples??this._samples}set samples(e){this._renderTarget&&(this._samples=this._renderTarget.setSamples(e))}addPostProcess(e){if(!this._postProcessManager){let e=this.getScene();if(!e)return;this._postProcessManager=new i.PostProcessManager(e),this._postProcesses=[]}this._postProcesses.push(e),this._postProcesses[0].autoClear=!1}clearPostProcesses(e=!1){if(this._postProcesses){if(e)for(let e of this._postProcesses)e.dispose();this._postProcesses=[]}}removePostProcess(e){if(!this._postProcesses)return;let t=this._postProcesses.indexOf(e);-1!==t&&(this._postProcesses.splice(t,1),this._postProcesses.length>0&&(this._postProcesses[0].autoClear=!1))}resetRefreshCounter(){this._objectRenderer.resetRefreshCounter()}get refreshRate(){return this._objectRenderer.refreshRate}set refreshRate(e){this._objectRenderer.refreshRate=e}_shouldRender(){return this._objectRenderer.shouldRender()}getRenderSize(){return this.getRenderWidth()}getRenderWidth(){return this._size.width?this._size.width:this._size}getRenderHeight(){return this._size.width?this._size.height:this._size}getRenderLayers(){let e=this._size.layers;if(e)return e;let t=this._size.depth;return t||0}disableRescaling(){this._canRescale=!1}get canRescale(){return this._canRescale}scale(e){let t=Math.max(1,this.getRenderSize()*e);this.resize(t)}getReflectionTextureMatrix(){return this.isCube?this._textureMatrix:super.getReflectionTextureMatrix()}resize(e){let t=this.isCube;this._renderTarget?.dispose(),this._renderTarget=null;let r=this.getScene();r&&(this._processSizeParameter(e),t?this._renderTarget=r.getEngine().createRenderTargetCubeTexture(this.getRenderSize(),this._renderTargetOptions):this._renderTarget=r.getEngine().createRenderTargetTexture(this._size,this._renderTargetOptions),this._texture=this._renderTarget.texture,void 0!==this._renderTargetOptions.samples&&(this.samples=this._renderTargetOptions.samples),this.onResizeObservable.hasObservers()&&this.onResizeObservable.notifyObservers(this))}render(e=!1,t=!1){this._render(e,t)}isReadyForRendering(){this._dumpToolsLoading||(this._dumpToolsLoading=!0,e.A(49950).then(e=>this._dumpTools=e)),this._objectRenderer.prepareRenderList(),this.onBeforeBindObservable.notifyObservers(this),this._objectRenderer.initRender(this.getRenderWidth(),this.getRenderHeight());let t=this._objectRenderer._checkReadiness();return this.onAfterUnbindObservable.notifyObservers(this),this._objectRenderer.finishRender(),t}_render(e=!1,t=!1){let r=this.getScene();if(!r)return;void 0!==this.useCameraPostProcesses&&(e=this.useCameraPostProcesses);let s=r.getEngine();if(s._debugPushGroup&&s._debugPushGroup(`Render to ${this.name}`),this._objectRenderer.prepareRenderList(),this.onBeforeBindObservable.notifyObservers(this),this._objectRenderer.initRender(this.getRenderWidth(),this.getRenderHeight()),(this.is2DArray||this.is3D)&&!this.isMulti)for(let s=0;s<this.getRenderLayers();s++)this._renderToTarget(0,e,t,s),r.incrementRenderId(),r.resetCachedMaterial();else if(this.isCube&&!this.isMulti)for(let s=0;s<6;s++)this._renderToTarget(s,e,t),r.incrementRenderId(),r.resetCachedMaterial();else this._renderToTarget(0,e,t);this.onAfterUnbindObservable.notifyObservers(this),this._objectRenderer.finishRender(),s._debugPopGroup&&s._debugPopGroup()}_bestReflectionRenderTargetDimension(e,t){let r=e*t,s=(0,n.NearestPOT)(r+16384/(128+r));return Math.min((0,n.FloorPOT)(e),s)}_bindFrameBuffer(e=0,t=0){let r=this.getScene();if(!r)return;let s=r.getEngine();this._renderTarget&&s.bindFramebuffer(this._renderTarget,this.isCube?e:void 0,void 0,void 0,this.ignoreCameraViewport,0,t)}_unbindFrameBuffer(e,t){this._renderTarget&&e.unBindFramebuffer(this._renderTarget,this.isCube,()=>{this.onAfterRenderObservable.notifyObservers(t)})}_prepareFrame(e,t,r,s){this._postProcessManager?this._prePassEnabled||this._postProcessManager._prepareFrame(this._texture,this._postProcesses)||this._bindFrameBuffer(t,r):s&&e.postProcessManager._prepareFrame(this._texture)||this._bindFrameBuffer(t,r)}_renderToTarget(e,t,r,s=0){let i=this.getScene();if(!i)return;let n=i.getEngine();this._currentFaceIndex=e,this._currentLayer=s,this._currentUseCameraPostProcess=t,this._currentDumpForDebug=r,this._prepareFrame(i,e,s,t),this._objectRenderer.render(e+s,!0),this._unbindFrameBuffer(n,e),this._texture&&this.isCube&&5===e&&n.generateMipMapsForCubemap(this._texture,!0)}setRenderingOrder(e,t=null,r=null,s=null){this._objectRenderer.setRenderingOrder(e,t,r,s)}setRenderingAutoClearDepthStencil(e,t){this._objectRenderer.setRenderingAutoClearDepthStencil(e,t)}clone(){let e=this.getSize(),t=new b(this.name,e,this.getScene(),this._renderTargetOptions.generateMipMaps,this._doNotChangeAspectRatio,this._renderTargetOptions.type,this.isCube,this._renderTargetOptions.samplingMode,this._renderTargetOptions.generateDepthBuffer,this._renderTargetOptions.generateStencilBuffer,void 0,this._renderTargetOptions.format,void 0,this._renderTargetOptions.samples);return t.hasAlpha=this.hasAlpha,t.level=this.level,t.coordinatesMode=this.coordinatesMode,this.renderList&&(t.renderList=this.renderList.slice(0)),t}serialize(){if(!this.name)return null;let e=super.serialize();if(e.renderTargetSize=this.getRenderSize(),e.renderList=[],this.renderList)for(let t=0;t<this.renderList.length;t++)e.renderList.push(this.renderList[t].id);return e}disposeFramebufferObjects(){this._renderTarget?.dispose(!0)}releaseInternalTexture(){this._renderTarget?.releaseTextures(),this._texture=null}dispose(){this.onResizeObservable.clear(),this.onClearObservable.clear(),this.onAfterUnbindObservable.clear(),this.onBeforeBindObservable.clear(),this._postProcessManager&&(this._postProcessManager.dispose(),this._postProcessManager=null),this._prePassRenderTarget&&this._prePassRenderTarget.dispose(),this._objectRenderer.onBeforeRenderingManagerRenderObservable.remove(this._onBeforeRenderingManagerRenderObserver),this._objectRenderer.onAfterRenderingManagerRenderObservable.remove(this._onAfterRenderingManagerRenderObserver),this._objectRenderer.onFastPathRenderObservable.remove(this._onFastPathRenderObserver),this._dontDisposeObjectRenderer||this._objectRenderer.dispose(),this.clearPostProcesses(!0),this._resizeObserver&&(this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver),this._resizeObserver=null);let e=this.getScene();if(!e)return;let t=e.customRenderTargets.indexOf(this);for(let r of(t>=0&&e.customRenderTargets.splice(t,1),e.cameras))(t=r.customRenderTargets.indexOf(this))>=0&&r.customRenderTargets.splice(t,1);this._renderTarget?.dispose(),this._renderTarget=null,this._texture=null,super.dispose()}_rebuild(){this._objectRenderer._rebuild(),this._postProcessManager&&this._postProcessManager._rebuild()}freeRenderingGroups(){this._objectRenderer.freeRenderingGroups()}getViewCount(){return 1}}b.REFRESHRATE_RENDER_ONCE=g.REFRESHRATE_RENDER_ONCE,b.REFRESHRATE_RENDER_ONEVERYFRAME=g.REFRESHRATE_RENDER_ONEVERYFRAME,b.REFRESHRATE_RENDER_ONEVERYTWOFRAMES=g.REFRESHRATE_RENDER_ONEVERYTWOFRAMES;let f=!1;Object.getOwnPropertyDescriptor(b.prototype,"noPrePassRenderer")||Object.defineProperty(b.prototype,"noPrePassRenderer",(0,R._MissingSideEffectProperty)("RenderTargetTexture","noPrePassRenderer")),e.s(["RegisterRenderTargetTexture",0,function(){f||(f=!0,u.Effect.prototype.setDepthStencilTexture=function(e,t){this._engine.setDepthStencilTexture(this._samplers[e],this._uniforms[e],t,e)},s.Texture._CreateRenderTargetTexture=(e,t,r,s,i)=>new b(e,t,r,s))},"RenderTargetTexture",0,b],36516)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24574,e=>{"use strict";class t{get underlyingResource(){return null}constructor(){this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=t._Counter++}}t._Counter=0,e.s(["DataBuffer",0,t])},18064,30419,29485,e=>{"use strict";e.s(["IsWrapper",0,function(e){return void 0===e.getPipelineContext}],18064),e.s(["WebGLShaderProcessor",0,class{constructor(){this.shaderLanguage=0}postProcessor(e,t,r,i,s){return s.drawBuffersExtensionDisabled&&(e=e.replace(/#extension.+GL_EXT_draw_buffers.+(enable|require)/g,"")),e}}],30419);let t=/(flat\s)?\s*varying\s*.*/;e.s(["WebGL2ShaderProcessor",0,class{constructor(){this.shaderLanguage=0}attributeProcessor(e){return e.replace("attribute","in")}varyingCheck(e,r){return t.test(e)}varyingProcessor(e,t){return e.replace("varying",t?"in":"out")}postProcessor(e,t,r){let i=-1!==e.search(/#extension.+GL_EXT_draw_buffers.+require/);if(e=(e=e.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"")).replace(/texture2D\s*\(/g,"texture("),r){let r=-1!==e.search(/layout *\(location *= *0\) *out/g),s=-1!==t.indexOf("#define DUAL_SOURCE_BLENDING");s&&(e="#extension GL_EXT_blend_func_extended : require\n"+e),e=(e=(e=(e=(e=(e=(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/void\s+?main\s*\(/g,(i||r?"":s?"layout(location = 0, index = 0) out vec4 glFragColor;\nlayout(location = 0, index = 1) out vec4 glFragColor2;\n":"layout(location = 0) out vec4 glFragColor;\n")+"void main(")}else if(t.indexOf("#define VERTEXOUTPUT_INVARIANT")>=0&&(e="invariant gl_Position;\n"+e),-1!==t.indexOf("#define MULTIVIEW"))return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e;return e}}],29485)},71379,20483,40462,79814,e=>{"use strict";var t,r,i,s,a,n,_,l,h=e.i(99904),u=e.i(8881),o=e.i(76535),c=e.i(18064),g=e.i(13379),f=e.i(64545),d=e.i(30419),E=e.i(29485),T=e.i(24574);class R extends T.DataBuffer{constructor(e){super(),this._buffer=e}get underlyingResource(){return this._buffer}}e.s(["WebGLDataBuffer",0,R],20483);var p=e.i(68179);class A{get underlyingResource(){return this._webGLTexture}constructor(e=null,t){if(this._MSAARenderBuffers=null,this._context=t,!e&&!(e=t.createTexture()))throw Error("Unable to create webGL texture");this.set(e)}setUsage(){}set(e){this._webGLTexture=e}reset(){this._webGLTexture=null,this._MSAARenderBuffers=null}addMSAARenderBuffer(e){this._MSAARenderBuffers||(this._MSAARenderBuffers=[]),this._MSAARenderBuffers.push(e)}releaseMSAARenderBuffers(){if(this._MSAARenderBuffers){for(let e of this._MSAARenderBuffers)this._context.deleteRenderbuffer(e);this._MSAARenderBuffers=null}}getMSAARenderBuffer(e=0){return this._MSAARenderBuffers?.[e]??null}release(){this.releaseMSAARenderBuffers(),this._webGLTexture&&this._context.deleteTexture(this._webGLTexture),this.reset()}}e.s(["WebGLHardwareTexture",0,A],40462);var x=e.i(84201),S=e.i(75017),b=e.i(28799);function m(e){return 13===e||14===e||15===e||16===e||17===e||18===e||19===e}function B(e){return 13===e||17===e||18===e||19===e}e.s(["HasStencilAspect",0,B,"IsDepthTexture",0,m],79814);var C=e.i(41520),P=e.i(75405);class L{}class M extends o.AbstractEngine{get name(){return this._name}set name(e){this._name=e}get version(){return this._webGLVersion}static get ShadersRepository(){return h.Effect.ShadersRepository}static set ShadersRepository(e){h.Effect.ShadersRepository=e}get supportsUniformBuffers(){return this.webGLVersion>1&&!this.disableUniformBuffers}get needPOTTextures(){return this._webGLVersion<2||this.forcePOTTextures}get _supportsHardwareTextureRescaling(){return!1}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e}snapshotRenderingReset(){this.snapshotRendering=!1}constructor(e,t,r,i){let s;if(r=r||{},super(t??r.antialias,r,i),this._name="WebGL",this.forcePOTTextures=!1,this.validateShaderPrograms=!1,this.disableUniformBuffers=!1,this._webGLVersion=1,this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=[],this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=[],this._currentInstanceLocations=[],this._currentInstanceBuffers=[],this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=[],this._maxSimultaneousTextures=0,this._maxMSAASamplesOverride=null,this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},!e)return;if(e.getContext){if(s=e,void 0===r.preserveDrawingBuffer&&(r.preserveDrawingBuffer=!1),void 0===r.xrCompatible&&(r.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const e=navigator.userAgent;for(const t of M.ExceptionList){const i=t.key,s=t.targets;if(new RegExp(i).test(e)){if(t.capture&&t.captureConstraint){const r=t.capture,i=t.captureConstraint,s=new RegExp(r).exec(e);if(s&&s.length>0&&parseInt(s[s.length-1])>=i)continue}for(const e of s)switch(e){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":r.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1}}}}if(this._doNotHandleContextLost?this._onContextLost=()=>{(0,u.deleteStateObject)(this._gl)}:(this._onContextLost=e=>{e.preventDefault(),this._contextWasLost=!0,(0,u.deleteStateObject)(this._gl),g.Logger.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(()=>this._initGLContext())},s.addEventListener("webglcontextrestored",this._onContextRestored,!1),r.powerPreference=r.powerPreference||"high-performance"),s.addEventListener("webglcontextlost",this._onContextLost,!1),this._badDesktopOS&&(r.xrCompatible=!1),!r.disableWebGL2Support)try{this._gl=s.getContext("webgl2",r)||s.getContext("experimental-webgl2",r),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch(e){}if(!this._gl){if(!s)throw Error("The provided canvas is null or undefined.");try{this._gl=s.getContext("webgl",r)||s.getContext("experimental-webgl",r)}catch(e){throw Error("WebGL not supported",{cause:e})}}if(!this._gl)throw Error("WebGL not supported")}else{this._gl=e,s=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const t=this._gl.getContextAttributes();t&&(r.stencil=t.stencil)}this._sharedInit(s),this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),void 0!==r.useHighPrecisionFloats&&(this._highPrecisionShadersAllowed=r.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let e=0;e<this._caps.maxVertexAttribs;e++)this._currentBufferPointers[e]=new L;this._shaderProcessor=this.webGLVersion>1?new E.WebGL2ShaderProcessor:new d.WebGLShaderProcessor;const a=`Babylon.js v${M.Version}`;g.Logger.Log(a+` - ${this.description}`),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",a);const n=(0,u.getStateObject)(this._gl);n.validateShaderPrograms=this.validateShaderPrograms,n.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){return null}areAllEffectsReady(){for(let e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0}_initGLContext(){this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),shaderFloatPrecision:0,parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||null!==this._gl.getExtension("OES_standard_derivatives"),maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),fragmentDepthSupported:this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),blendFloat:null!==this._gl.getExtension("EXT_float_blend"),supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:1!==this._webGLVersion,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1,textureNorm16:!!this._gl.getExtension("EXT_texture_norm16"),blendParametersPerTarget:!1,dualSourceBlending:!1,supportReadWriteStorageTextures:!1},this._caps.supportFloatTexturesResolve=this._caps.colorBufferFloat,this._caps.rg11b10ufColorRenderable=this._caps.colorBufferFloat,this._glVersion=this._gl.getParameter(this._gl.VERSION);let e=this._gl.getExtension("WEBGL_debug_renderer_info");null!=e&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),36193!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=36193),34842!==this._gl.RGBA16F&&(this._gl.RGBA16F=34842),34836!==this._gl.RGBA32F&&(this._gl.RGBA32F=34836),35056!==this._gl.DEPTH24_STENCIL8&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=(this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)??0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!!(this._caps.textureFloat&&this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!!(this._caps.textureFloat&&this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.textureNorm16&&(this._gl.R16_EXT=33322,this._gl.RG16_EXT=33324,this._gl.RGB16_EXT=32852,this._gl.RGBA16_EXT=32859,this._gl.R16_SNORM_EXT=36760,this._gl.RG16_SNORM_EXT=36761,this._gl.RGB16_SNORM_EXT=36762,this._gl.RGBA16_SNORM_EXT=36763);let t=this._gl.getExtension("OES_draw_buffers_indexed");if(this._caps.blendParametersPerTarget=!!t,this._alphaState=new C.AlphaState(this._caps.blendParametersPerTarget),t&&(this._gl.blendEquationSeparateIndexed=t.blendEquationSeparateiOES.bind(t),this._gl.blendEquationIndexed=t.blendEquationiOES.bind(t),this._gl.blendFuncSeparateIndexed=t.blendFuncSeparateiOES.bind(t),this._gl.blendFuncIndexed=t.blendFunciOES.bind(t),this._gl.colorMaskIndexed=t.colorMaskiOES.bind(t),this._gl.disableIndexed=t.disableiOES.bind(t),this._gl.enableIndexed=t.enableiOES.bind(t)),this._caps.dualSourceBlending=!!this._gl.getExtension("WEBGL_blend_func_extended"),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&5131!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=null!==this._maxMSAASamplesOverride?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES),this._caps.maxDrawBuffers=this._gl.getParameter(this._gl.MAX_DRAW_BUFFERS);else{let e=this._gl.getExtension("WEBGL_draw_buffers");if(null!==e){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=e.drawBuffersWEBGL.bind(e),this._caps.maxDrawBuffers=this._gl.getParameter(e.MAX_DRAW_BUFFERS_WEBGL),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let t=0;t<16;t++)this._gl["COLOR_ATTACHMENT"+t+"_WEBGL"]=e["COLOR_ATTACHMENT"+t+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{let e=this._gl.getExtension("WEBGL_depth_texture");null!=e&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=e.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{let e=this._gl.getExtension("OES_vertex_array_object");null!=e&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=e.createVertexArrayOES.bind(e),this._gl.bindVertexArray=e.bindVertexArrayOES.bind(e),this._gl.deleteVertexArray=e.deleteVertexArrayOES.bind(e))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{let e=this._gl.getExtension("ANGLE_instanced_arrays");null!=e?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=e.drawArraysInstancedANGLE.bind(e),this._gl.drawElementsInstanced=e.drawElementsInstancedANGLE.bind(e),this._gl.vertexAttribDivisor=e.vertexAttribDivisorANGLE.bind(e)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){let e=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),t=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);if(e&&t&&(this._caps.highPrecisionShaderSupported=0!==e.precision&&0!==t.precision,this._caps.shaderFloatPrecision=Math.min(e.precision,t.precision)),!this._shouldUseHighPrecisionShader){let e=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.MEDIUM_FLOAT),t=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.MEDIUM_FLOAT);e&&t&&(this._caps.shaderFloatPrecision=Math.min(e.precision,t.precision))}this._caps.shaderFloatPrecision<10&&(this._caps.shaderFloatPrecision=10)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{let e=this._gl.getExtension("EXT_blend_minmax");null!=e&&(this._caps.blendMinMax=!0,this._gl.MAX=e.MAX_EXT,this._gl.MIN=e.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{let e=this._gl.getExtension("EXT_sRGB");null!=e&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:e.SRGB_EXT,SRGB8:e.SRGB_ALPHA_EXT,SRGB8_ALPHA8:e.SRGB_ALPHA_EXT})}if(this._creationOptions){let e=this._creationOptions.forceSRGBBufferSupportState;void 0!==e&&(this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&e)}}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let e=0;e<this._maxSimultaneousTextures;e++)this._nextFreeTextureSlots.push(e);"Mali-G72"===this._glRenderer&&(this._caps.disableMorphTargetTexture=!0)}_initFeatures(){this._features={forceBitmapOverHTMLImageElement:"u"<typeof HTMLImageElement,supportRenderAndCopyToLodForFloatTextures:1!==this._webGLVersion,supportDepthStencilTexture:1!==this._webGLVersion,supportShadowSamplers:1!==this._webGLVersion,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:1!==this._webGLVersion,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:1!==this._webGLVersion,basisNeedsPOT:1===this._webGLVersion,support3DTextures:1!==this._webGLVersion,needTypeSuffixInShaderConstants:1!==this._webGLVersion,supportMSAA:1!==this._webGLVersion,supportSSAO2:1!==this._webGLVersion,supportIBLShadows:1!==this._webGLVersion,supportExtendedTextureFormats:1!==this._webGLVersion,supportSwitchCaseInShader:1!==this._webGLVersion,supportSyncTextureRead:!0,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!1,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1}}get webGLVersion(){return this._webGLVersion}getClassName(){return"ThinEngine"}_prepareWorkingCanvas(){if(this._workingCanvas)return;this._workingCanvas=this.createCanvas(1,1);let e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}getInfo(){return this.getGlInfo()}getGlInfo(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}}extractDriverInfo(){let e=this.getGlInfo();return e&&e.renderer?e.renderer:""}getRenderWidth(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth}getRenderHeight(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight}clear(e,t,r,i=!1,s=0){let a=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=a;let n=0;if(t&&e){let t=!0;if(this._currentRenderTarget){let r=this._currentRenderTarget.texture?.format;if(8===r||9===r||10===r||11===r){let r=this._currentRenderTarget.texture?.type;7===r||5===r?(M._TempClearColorUint32[0]=255*e.r,M._TempClearColorUint32[1]=255*e.g,M._TempClearColorUint32[2]=255*e.b,M._TempClearColorUint32[3]=255*e.a,this._gl.clearBufferuiv(this._gl.COLOR,0,M._TempClearColorUint32)):(M._TempClearColorInt32[0]=255*e.r,M._TempClearColorInt32[1]=255*e.g,M._TempClearColorInt32[2]=255*e.b,M._TempClearColorInt32[3]=255*e.a,this._gl.clearBufferiv(this._gl.COLOR,0,M._TempClearColorInt32)),t=!1}}t&&(this._gl.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),n|=this._gl.COLOR_BUFFER_BIT)}r&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),n|=this._gl.DEPTH_BUFFER_BIT),i&&(this._gl.clearStencil(s),n|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(n)}_viewport(e,t,r,i){(e!==this._viewportCached.x||t!==this._viewportCached.y||r!==this._viewportCached.z||i!==this._viewportCached.w)&&(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=r,this._viewportCached.w=i,this._gl.viewport(e,t,r,i))}endFrame(){super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){throw Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,r,i,s,a=0,n=0){this._currentRenderTarget&&this._resolveAndGenerateMipMapsFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(e._framebuffer);let _=this._gl;e.isMulti||(e.is2DArray||e.is3D?(_.framebufferTextureLayer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,e.texture._hardwareTexture?.underlyingResource,a,n),e._currentLOD=a):e.isCube?_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.texture._hardwareTexture?.underlyingResource,a):e._currentLOD!==a&&(_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_2D,e.texture._hardwareTexture?.underlyingResource,a),e._currentLOD=a));let l=e._depthStencilTexture;if(l){e.is3D&&(e.texture.width!==l.width||e.texture.height!==l.height||e.texture.depth!==l.depth)&&g.Logger.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");let r=e._depthStencilTextureWithStencil?_.DEPTH_STENCIL_ATTACHMENT:_.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?_.framebufferTextureLayer(_.FRAMEBUFFER,r,l._hardwareTexture?.underlyingResource,a,n):e.isCube?_.framebufferTexture2D(_.FRAMEBUFFER,r,_.TEXTURE_CUBE_MAP_POSITIVE_X+t,l._hardwareTexture?.underlyingResource,a):_.framebufferTexture2D(_.FRAMEBUFFER,r,_.TEXTURE_2D,l._hardwareTexture?.underlyingResource,a)}e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._MSAAFramebuffer),this._cachedViewport&&!s?this.setViewport(this._cachedViewport,r,i):(!r&&(r=e.width,a&&(r/=Math.pow(2,a))),!i&&(i=e.height,a&&(i/=Math.pow(2,a))),this._viewport(0,0,r,i)),this.wipeCaches()}setStateCullFaceType(e,t){let r=this.cullBackFaces??e??!0?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==r||t)&&(this._depthCullingState.cullFace=r)}setState(e,t=0,r,i=!1,s,a,n=0){(this._depthCullingState.cull!==e||r)&&(this._depthCullingState.cull=e),this.setStateCullFaceType(s,r),this.setZOffset(t),this.setZOffsetUnits(n);let _=i?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==_||r)&&(this._depthCullingState.frontFace=_),this._stencilStateComposer.stencilMaterial=a}_resolveAndGenerateMipMapsFramebuffer(e,t=!1){e.disableAutomaticMSAAResolve||(e.isMulti?this.resolveMultiFramebuffer(e):this.resolveFramebuffer(e)),t||(e.isMulti?this.generateMipMapsMultiFramebuffer(e):this.generateMipMapsFramebuffer(e))}_bindUnboundFramebuffer(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){return null===this._currentFramebuffer}generateMipmaps(e){let t=this._getTextureTarget(e);this._bindTextureDirectly(t,e,!0),this._gl.generateMipmap(t),this._bindTextureDirectly(t,null)}unBindFramebuffer(e,t,r){this._currentRenderTarget=null,this._resolveAndGenerateMipMapsFramebuffer(e,t),r&&(e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._framebuffer),r()),this._bindUnboundFramebuffer(null)}generateMipMapsFramebuffer(e){!e.isMulti&&e.texture?.generateMipMaps&&!e.isCube&&this.generateMipmaps(e.texture)}resolveFramebuffer(e){let t=this._gl;if(!e._MSAAFramebuffer||e.isMulti)return;let r=e.resolveMSAAColors?t.COLOR_BUFFER_BIT:0;r|=e._generateDepthBuffer&&e.resolveMSAADepth?t.DEPTH_BUFFER_BIT:0,r|=e._generateStencilBuffer&&e.resolveMSAAStencil?t.STENCIL_BUFFER_BIT:0,t.bindFramebuffer(t.READ_FRAMEBUFFER,e._MSAAFramebuffer),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,e._framebuffer),t.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,r,t.NEAREST)}flushFramebuffer(){this._gl.flush()}restoreDefaultFramebuffer(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_resetVertexBufferBinding(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null}createVertexBuffer(e,t,r){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){let r=this._gl.createBuffer();if(!r)throw Error("Unable to create vertex buffer");let i=new R(r);return this.bindArrayBuffer(i),"number"!=typeof e?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),i.capacity=4*e.length):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),i.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),i.capacity=e),this._resetVertexBufferBinding(),i.references=1,i}createDynamicVertexBuffer(e,t){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,r){let i=this._gl.createBuffer(),s=new R(i);if(!i)throw Error("Unable to create index buffer");this.bindIndexBuffer(s);let a=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,a,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),s.references=1,s.is32Bits=4===a.BYTES_PER_ELEMENT,s}_normalizeIndexData(e){if(2===e.BYTES_PER_ELEMENT)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;else for(let t=0;t<e.length;t++)if(e[t]>=65535)return new Uint32Array(e)}return new Uint16Array(e)}bindArrayBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)}bindUniformBlock(e,t,r){let i=e.program,s=this._gl.getUniformBlockIndex(i,t);this._gl.uniformBlockBinding(i,s,r)}bindIndexBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)}_bindBuffer(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)}updateArrayBuffer(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)}_vertexAttribPointer(e,t,r,i,s,a,n){let _=this._currentBufferPointers[t];if(!_)return;let l=!1;_.active?(_.buffer!==e&&(_.buffer=e,l=!0),_.size!==r&&(_.size=r,l=!0),_.type!==i&&(_.type=i,l=!0),_.normalized!==s&&(_.normalized=s,l=!0),_.stride!==a&&(_.stride=a,l=!0),_.offset!==n&&(_.offset=n,l=!0)):(l=!0,_.active=!0,_.index=t,_.size=r,_.type=i,_.normalized=s,_.stride=a,_.offset=n,_.buffer=e),(l||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),i===this._gl.UNSIGNED_INT||i===this._gl.INT?this._gl.vertexAttribIPointer(t,r,i,a,n):this._gl.vertexAttribPointer(t,r,i,s,a,n))}_bindIndexBufferWithCache(e){null!=e&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,r){let i=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let s=0;s<i.length;s++){let a=t.getAttributeLocation(s);if(a>=0){let t=i[s],n=null;if(r&&(n=r[t]),n||(n=e[t]),!n)continue;this._gl.enableVertexAttribArray(a),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[a]=!0);let _=n.getBuffer();_&&(this._vertexAttribPointer(_,a,n.getSize(),n.type,n.normalized,n.byteStride,n.byteOffset),n.getIsInstanced()&&(this._gl.vertexAttribDivisor(a,n.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(a),this._currentInstanceBuffers.push(_))))}}}recordVertexArrayObject(e,t,r,i){let s=this._gl.createVertexArray();if(!s)throw Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(s),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,r,i),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),s}bindVertexArrayObject(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=null!=t&&t.is32Bits,this._mustWipeVertexAttributes=!0)}bindBuffersDirectly(e,t,r,i,s){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==s){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=s;let t=s.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let a=0;for(let n=0;n<t;n++)if(n<r.length){let t=s.getAttributeLocation(n);t>=0&&(this._gl.enableVertexAttribArray(t),this._vertexAttribArraysEnabled[t]=!0,this._vertexAttribPointer(e,t,r[n],this._gl.FLOAT,!1,i,a)),a+=4*r[n]}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,r,i){(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==r)&&(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=r,this._bindVertexBuffersAttributes(e,r,i)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){let e;for(let t=0,r=this._currentInstanceLocations.length;t<r;t++){let r=this._currentInstanceBuffers[t];e!=r&&r.references&&(e=r,this.bindArrayBuffer(r));let i=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(i,0)}this._currentInstanceBuffers.length=0,this._currentInstanceLocations.length=0}releaseVertexArrayObject(e){this._gl.deleteVertexArray(e)}_releaseBuffer(e){return e.references--,0===e.references&&(this._deleteBuffer(e),!0)}_deleteBuffer(e){this._gl.deleteBuffer(e.underlyingResource)}updateAndBindInstancesBuffer(e,t,r){if(this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),void 0!==r[0].index)this.bindInstancesBuffer(e,r,!0);else for(let t=0;t<4;t++){let i=r[t];this._vertexAttribArraysEnabled[i]||(this._gl.enableVertexAttribArray(i),this._vertexAttribArraysEnabled[i]=!0),this._vertexAttribPointer(e,i,4,this._gl.FLOAT,!1,64,16*t),this._gl.vertexAttribDivisor(i,1),this._currentInstanceLocations.push(i),this._currentInstanceBuffers.push(e)}}bindInstancesBuffer(e,t,r=!0){this.bindArrayBuffer(e);let i=0;if(r)for(let e=0;e<t.length;e++)i+=4*t[e].attributeSize;for(let r=0;r<t.length;r++){let s=t[r];void 0===s.index&&(s.index=this._currentEffect.getAttributeLocationByName(s.attributeName)),s.index<0||(this._vertexAttribArraysEnabled[s.index]||(this._gl.enableVertexAttribArray(s.index),this._vertexAttribArraysEnabled[s.index]=!0),this._vertexAttribPointer(e,s.index,s.attributeSize,s.attributeType||this._gl.FLOAT,s.normalized||!1,i,s.offset),this._gl.vertexAttribDivisor(s.index,void 0===s.divisor?1:s.divisor),this._currentInstanceLocations.push(s.index),this._currentInstanceBuffers.push(e))}}disableInstanceAttributeByName(e){if(!this._currentEffect)return;let t=this._currentEffect.getAttributeLocationByName(e);this.disableInstanceAttribute(t)}disableInstanceAttribute(e){let t,r=!1;for(;-1!==(t=this._currentInstanceLocations.indexOf(e));)this._currentInstanceLocations.splice(t,1),this._currentInstanceBuffers.splice(t,1),r=!0;r&&(this._gl.vertexAttribDivisor(e,0),this.disableAttributeByIndex(e))}disableAttributeByIndex(e){this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1}draw(e,t,r,i){this.drawElementsType(+!e,t,r,i)}drawPointClouds(e,t,r){this.drawArraysType(2,e,t,r)}drawUnIndexed(e,t,r,i){this.drawArraysType(+!e,t,r,i)}drawElementsType(e,t,r,i){this.applyStates(),this._reportDrawCall();let s=this._drawMode(e),a=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,n=this._uintIndicesCurrentlySet?4:2;i?this._gl.drawElementsInstanced(s,r,a,t*n,i):this._gl.drawElements(s,r,a,t*n)}drawArraysType(e,t,r,i){this.applyStates(),this._reportDrawCall();let s=this._drawMode(e);i?this._gl.drawArraysInstanced(s,t,r,i):this._gl.drawArrays(s,t,r)}_drawMode(e){switch(e){case 0:default:return this._gl.TRIANGLES;case 2:case 3:return this._gl.POINTS;case 1:case 4:return this._gl.LINES;case 5:return this._gl.LINE_LOOP;case 6:return this._gl.LINE_STRIP;case 7:return this._gl.TRIANGLE_STRIP;case 8:return this._gl.TRIANGLE_FAN}}_releaseEffect(e){this._compiledEffects[e._key]&&delete this._compiledEffects[e._key];let t=e.getPipelineContext();t&&this._deletePipelineContext(t)}_deletePipelineContext(e){e&&e.program&&(e.program.__SPECTOR_rebuildProgram=null,(0,b.resetCachedPipeline)(e),this._gl&&(this._currentProgram===e.program&&this._setProgram(null),this._gl.deleteProgram(e.program)))}_getGlobalDefines(e){return(0,S._GetGlobalDefines)(e,this.isNDCHalfZRange,this.useReverseDepthBuffer,this.useExactSrgbConversions)}createEffect(e,t,r,i,s,a,n,_,l,o=0,c){let g="string"==typeof e?e:e.vertexToken||e.vertexSource||e.vertexElement||e.vertex,f="string"==typeof e?e:e.fragmentToken||e.fragmentSource||e.fragmentElement||e.fragment,d=this._getGlobalDefines(),E=void 0!==t.attributes,T=s??t.defines??"";d&&(T+=d);let R=g+"+"+f+"@"+T;if(this._compiledEffects[R]){let e=this._compiledEffects[R];return n&&e.isReady()&&n(e),e._refCount++,e}this._gl&&(0,u.getStateObject)(this._gl);let p=new h.Effect(e,t,E?this:r,i,this,s,a,n,_,l,R,t.shaderLanguage??o,t.extraInitializationsAsync??c);return this._compiledEffects[R]=p,p}_getShaderSource(e){return this._gl.getShaderSource(e)}createRawShaderProgram(e,t,r,i,s=null){let a=(0,u.getStateObject)(this._gl);return a._contextWasLost=this._contextWasLost,a.validateShaderPrograms=this.validateShaderPrograms,(0,u.createRawShaderProgram)(e,t,r,i||this._gl,s)}createShaderProgram(e,t,r,i,s,a=null){let n=(0,u.getStateObject)(this._gl);return n._contextWasLost=this._contextWasLost,n.validateShaderPrograms=this.validateShaderPrograms,(0,u.createShaderProgram)(e,t,r,i,s||this._gl,a)}inlineShaderCode(e){return e}createPipelineContext(e){this._gl&&((0,u.getStateObject)(this._gl).parallelShaderCompile=this._caps.parallelShaderCompile);let t=(0,u.createPipelineContext)(this._gl,e);return t.engine=this,t}createMaterialContext(){}createDrawContext(){}_finalizePipelineContext(e){return(0,u._finalizePipelineContext)(e,this._gl,this.validateShaderPrograms)}_preparePipelineContextAsync(e,t,r,i,s,a,n,_,l,h,o){let c=(0,u.getStateObject)(this._gl);return c._contextWasLost=this._contextWasLost,c.validateShaderPrograms=this.validateShaderPrograms,c._createShaderProgramInjection=this._createShaderProgram.bind(this),c.createRawShaderProgramInjection=this.createRawShaderProgram.bind(this),c.createShaderProgramInjection=this.createShaderProgram.bind(this),c.loadFileInjection=this._loadFile.bind(this),(0,u._preparePipelineContext)(e,t,r,i,s,a,n,_,l,h,o)}_createShaderProgram(e,t,r,i,s=null){return(0,u._createShaderProgram)(e,t,r,i,s)}_isRenderingStateCompiled(e){return!this._isDisposed&&(0,u._isRenderingStateCompiled)(e,this._gl,this.validateShaderPrograms)}_executeWhenRenderingStateIsCompiled(e,t){(0,u._executeWhenRenderingStateIsCompiled)(e,t)}getUniforms(e,t){let r=[];for(let i=0;i<t.length;i++)r.push(this._gl.getUniformLocation(e.program,t[i]));return r}getAttributes(e,t){let r=[];for(let i=0;i<t.length;i++)try{r.push(this._gl.getAttribLocation(e.program,t[i]))}catch(e){r.push(-1)}return r}enableEffect(e){(e=null!==e&&(0,c.IsWrapper)(e)?e.effect:e)&&e!==this._currentEffect&&(this._stencilStateComposer.stencilMaterial=void 0,this.bindSamplers(e),this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))}setInt(e,t){return!!e&&(this._gl.uniform1i(e,t),!0)}setInt2(e,t,r){return!!e&&(this._gl.uniform2i(e,t,r),!0)}setInt3(e,t,r,i){return!!e&&(this._gl.uniform3i(e,t,r,i),!0)}setInt4(e,t,r,i,s){return!!e&&(this._gl.uniform4i(e,t,r,i,s),!0)}setIntArray(e,t){return!!e&&(this._gl.uniform1iv(e,t),!0)}setIntArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2iv(e,t),!0)}setIntArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3iv(e,t),!0)}setIntArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4iv(e,t),!0)}setUInt(e,t){return!!e&&(this._gl.uniform1ui(e,t),!0)}setUInt2(e,t,r){return!!e&&(this._gl.uniform2ui(e,t,r),!0)}setUInt3(e,t,r,i){return!!e&&(this._gl.uniform3ui(e,t,r,i),!0)}setUInt4(e,t,r,i,s){return!!e&&(this._gl.uniform4ui(e,t,r,i,s),!0)}setUIntArray(e,t){return!!e&&(this._gl.uniform1uiv(e,t),!0)}setUIntArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2uiv(e,t),!0)}setUIntArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3uiv(e,t),!0)}setUIntArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4uiv(e,t),!0)}setArray(e,t){return!!e&&!(t.length<1)&&(this._gl.uniform1fv(e,t),!0)}setArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2fv(e,t),!0)}setArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3fv(e,t),!0)}setArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4fv(e,t),!0)}setMatrices(e,t){return!!e&&(this._gl.uniformMatrix4fv(e,!1,t),!0)}setMatrix3x3(e,t){return!!e&&(this._gl.uniformMatrix3fv(e,!1,t),!0)}setMatrix2x2(e,t){return!!e&&(this._gl.uniformMatrix2fv(e,!1,t),!0)}setFloat(e,t){return!!e&&(this._gl.uniform1f(e,t),!0)}setFloat2(e,t,r){return!!e&&(this._gl.uniform2f(e,t,r),!0)}setFloat3(e,t,r,i){return!!e&&(this._gl.uniform3f(e,t,r,i),!0)}setFloat4(e,t,r,i,s){return!!e&&(this._gl.uniform4f(e,t,r,i,s),!0)}applyStates(){if(this._depthCullingState.apply(this._gl),this._stencilStateComposer.apply(this._gl),this._alphaState.apply(this._gl,this._currentRenderTarget&&this._currentRenderTarget.textures?this._currentRenderTarget.textures.length:1),this._colorWriteChanged){this._colorWriteChanged=!1;let e=this._colorWrite;this._gl.colorMask(e,e,e,e)}}wipeCaches(e){(!this.preventCacheWipeBetweenFrames||e)&&(this._currentEffect=null,this._viewportCached.x=0,this._viewportCached.y=0,this._viewportCached.z=0,this._viewportCached.w=0,this._unbindVertexArrayObject(),e&&(this._currentProgram=null,this.resetTextureCache(),this._stencilStateComposer.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=this._gl.LEQUAL,this._alphaState.reset(),this._resetAlphaMode(),this._colorWrite=!0,this._colorWriteChanged=!0,this._unpackFlipYCached=null,this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),this._mustWipeVertexAttributes=!0,this.unbindAllAttributes()),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this.bindIndexBuffer(null))}_getSamplingParameters(e,t){let r=this._gl,i=r.NEAREST,s=r.NEAREST,a=!1;switch(e){case 11:i=r.LINEAR,s=t?r.LINEAR_MIPMAP_NEAREST:r.LINEAR;break;case 3:i=r.LINEAR,a=!0,s=t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR;break;case 8:a=!0,i=r.NEAREST,s=t?r.NEAREST_MIPMAP_LINEAR:r.NEAREST;break;case 4:i=r.NEAREST,s=t?r.NEAREST_MIPMAP_NEAREST:r.NEAREST;break;case 5:i=r.NEAREST,s=t?r.LINEAR_MIPMAP_NEAREST:r.LINEAR;break;case 6:a=!0,i=r.NEAREST,s=t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR;break;case 7:i=r.NEAREST,s=r.LINEAR;break;case 1:i=r.NEAREST,s=r.NEAREST;break;case 9:i=r.LINEAR,s=t?r.NEAREST_MIPMAP_NEAREST:r.NEAREST;break;case 10:a=!0,i=r.LINEAR,s=t?r.NEAREST_MIPMAP_LINEAR:r.NEAREST;break;case 2:i=r.LINEAR,s=r.LINEAR;break;case 12:i=r.LINEAR,s=r.NEAREST}return{min:s,mag:i,hasMipMaps:a}}_createTexture(){let e=this._gl.createTexture();if(!e)throw Error("Unable to create texture");return e}_createHardwareTexture(){return new A(this._createTexture(),this._gl)}_createInternalTexture(e,t,r=!0,i=0){let s,a,n=!1,_=0,l=3,h=5,u=!1,o=1,c=!1,f=0,d=!1;void 0!==t&&"object"==typeof t?(s=!!t.generateMipMaps,n=!!t.createMipMaps,_=void 0===t.type?0:t.type,l=void 0===t.samplingMode?3:t.samplingMode,h=void 0===t.format?5:t.format,u=void 0!==t.useSRGBBuffer&&t.useSRGBBuffer,o=t.samples??1,a=t.label,c=!!t.createMSAATexture,f=t.comparisonFunction||0,d=!!t.isCube):s=!!t,u&&(u=this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU)),(1!==_||this._caps.textureFloatLinearFiltering)&&(2!==_||this._caps.textureHalfFloatLinearFiltering)||(l=1),1!==_||this._caps.textureFloat||(_=0,g.Logger.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));let E=m(h),T=B(h),R=this._gl,p=new x.InternalTexture(this,i),A=e.width||e,S=e.height||e,b=e.depth||0,C=e.layers||0,P=this._getSamplingParameters(l,(s||n)&&!E),L=0!==C?R.TEXTURE_2D_ARRAY:0!==b?R.TEXTURE_3D:d?R.TEXTURE_CUBE_MAP:R.TEXTURE_2D,M=E?this._getInternalFormatFromDepthTextureFormat(h,!0,T):this._getRGBABufferInternalSizedFormat(_,h,u),G=E?T?R.DEPTH_STENCIL:R.DEPTH_COMPONENT:this._getInternalFormat(h),I=E?this._getWebGLTextureTypeFromDepthTextureFormat(h):this._getWebGLTextureType(_);if(this._bindTextureDirectly(L,p),0!==C)p.is2DArray=!0,R.texImage3D(L,0,M,A,S,C,0,G,I,null);else if(0!==b)p.is3D=!0,R.texImage3D(L,0,M,A,S,b,0,G,I,null);else if(d){p.isCube=!0;for(let e=0;e<6;e++)R.texImage2D(R.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,M,A,S,0,G,I,null)}else R.texImage2D(L,0,M,A,S,0,G,I,null);if(R.texParameteri(L,R.TEXTURE_MAG_FILTER,P.mag),R.texParameteri(L,R.TEXTURE_MIN_FILTER,P.min),R.texParameteri(L,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(L,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),E&&this.webGLVersion>1&&(0===f?(R.texParameteri(L,R.TEXTURE_COMPARE_FUNC,515),R.texParameteri(L,R.TEXTURE_COMPARE_MODE,R.NONE)):(R.texParameteri(L,R.TEXTURE_COMPARE_FUNC,f),R.texParameteri(L,R.TEXTURE_COMPARE_MODE,R.COMPARE_REF_TO_TEXTURE))),(s||n)&&this._gl.generateMipmap(L),this._bindTextureDirectly(L,null),p._useSRGBBuffer=u,p.baseWidth=A,p.baseHeight=S,p.width=A,p.height=S,p.depth=C||b,p.isReady=!0,p.samples=o,p.generateMipMaps=s,p.samplingMode=l,p.type=_,p.format=h,p.label=a,p.comparisonFunction=f,this._internalTexturesCache.push(p),c){let e;if(!(e=m(p.format)?this._setupFramebufferDepthAttachments(B(p.format),19!==p.format,p.width,p.height,o,p.format,!0):this._createRenderBuffer(p.width,p.height,o,-1,this._getRGBABufferInternalSizedFormat(p.type,p.format,p._useSRGBBuffer),-1)))throw Error("Unable to create render buffer");p._autoMSAAManagement=!0;let t=p._hardwareTexture;t||(t=p._hardwareTexture=this._createHardwareTexture()),t.addMSAARenderBuffer(e)}return p}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,r,i,s=3,a=null,n=null,_=null,l=null,h=null,u=null,o,c,g,f){return this._createTextureBase(e,t,r,i,s,a,n,(...e)=>this._prepareWebGLTexture(...e,h),(e,t,r,s,a,n)=>{let _=this._gl,l=r.width===e&&r.height===t;a._creationFlags=g??0;let h=this._getTexImageParametersForCreateTexture(a.format,a._useSRGBBuffer);if(l)return _.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,r),!1;let u=this._caps.maxTextureSize;if(r.width>u||r.height>u||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!!this._workingCanvas&&!!this._workingContext&&(this._workingCanvas.width=e,this._workingCanvas.height=t,this._workingContext.drawImage(r,0,0,r.width,r.height,0,0,e,t),_.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,this._workingCanvas),a.width=e,a.height=t,!1);{let e=new x.InternalTexture(this,2);this._bindTextureDirectly(_.TEXTURE_2D,e,!0),_.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,r),this._rescaleTexture(e,a,i,h.format,()=>{this._releaseTexture(e),this._bindTextureDirectly(_.TEXTURE_2D,a,!0),n()})}return!0},_,l,h,u,o,c,f)}_getTexImageParametersForCreateTexture(e,t){let r,i;return 1===this.webGLVersion?i=r=this._getInternalFormat(e,t):(r=this._getInternalFormat(e,!1),i=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:i,format:r,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,r,i,s){}_unpackFlipY(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,+!!e),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))}_getUnpackAlignement(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)}_getTextureTarget(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D}updateTextureSamplingMode(e,t,r=!1){let i=this._getTextureTarget(t),s=this._getSamplingParameters(e,t.useMipMaps||r);this._setTextureParameterInteger(i,this._gl.TEXTURE_MAG_FILTER,s.mag,t),this._setTextureParameterInteger(i,this._gl.TEXTURE_MIN_FILTER,s.min),r&&s.hasMipMaps&&(t.generateMipMaps=!0,this._gl.generateMipmap(i)),this._bindTextureDirectly(i,null),t.samplingMode=e}updateTextureDimensions(e,t,r,i=1){}updateTextureWrappingMode(e,t,r=null,i=null){let s=this._getTextureTarget(e);null!==t&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),null!==r&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(r),e),e._cachedWrapV=r),(e.is2DArray||e.is3D)&&null!==i&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(i),e),e._cachedWrapR=i),this._bindTextureDirectly(s,null)}_uploadCompressedDataToTextureDirectly(e,t,r,i,s,a=0,n=0){let _=this._gl,l=_.TEXTURE_2D;if(e.isCube&&(l=_.TEXTURE_CUBE_MAP_POSITIVE_X+a),e._useSRGBBuffer)switch(t){case 37492:case 36196:this._caps.etc2?t=_.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case 37496:this._caps.etc2?t=_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case 36492:t=_.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case 37808:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case 37809:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;break;case 37810:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;break;case 37811:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;break;case 37812:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;break;case 37813:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;break;case 37814:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;break;case 37815:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;break;case 37816:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;break;case 37817:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;break;case 37818:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;break;case 37819:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;break;case 37820:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;break;case 37821:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;break;case 33776:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33777:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33779:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1}if(e.generateMipMaps){let a=e._hardwareTexture;a.memoryAllocated||(_.texStorage2D(e.isCube?_.TEXTURE_CUBE_MAP:_.TEXTURE_2D,Math.floor(Math.log2(Math.max(r,i)))+1,t,e.width,e.height),a.memoryAllocated=!0),this._gl.compressedTexSubImage2D(l,n,0,0,r,i,t,s)}else this._gl.compressedTexImage2D(l,n,t,r,i,0,s)}_uploadDataToTextureDirectly(e,t,r=0,i=0,s,a=!1){let n=this._gl,_=this._getWebGLTextureType(e.type),l=this._getInternalFormat(e.format),h=void 0===s?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(s,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let u=n.TEXTURE_2D;e.isCube&&(u=n.TEXTURE_CUBE_MAP_POSITIVE_X+r);let o=Math.round(Math.log(e.width)*Math.LOG2E),c=Math.round(Math.log(e.height)*Math.LOG2E),g=a?e.width:Math.pow(2,Math.max(o-i,0)),f=a?e.height:Math.pow(2,Math.max(c-i,0));n.texImage2D(u,i,h,g,f,0,l,_,t)}updateTextureData(e,t,r,i,s,a,n=0,_=0,l=!1){let h=this._gl,u=this._getWebGLTextureType(e.type),o=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let c=h.TEXTURE_2D,g=h.TEXTURE_2D;e.isCube&&(g=h.TEXTURE_CUBE_MAP_POSITIVE_X+n,c=h.TEXTURE_CUBE_MAP),this._bindTextureDirectly(c,e,!0),h.texSubImage2D(g,_,r,i,s,a,o,u,t),l&&this._gl.generateMipmap(g),this._bindTextureDirectly(c,null)}_uploadArrayBufferViewToTexture(e,t,r=0,i=0){let s=this._gl,a=e.isCube?s.TEXTURE_CUBE_MAP:s.TEXTURE_2D;this._bindTextureDirectly(a,e,!0),this._uploadDataToTextureDirectly(e,t,r,i),this._bindTextureDirectly(a,null,!0)}_prepareWebGLTextureContinuation(e,t,r,i,s){let a=this._gl;if(!a)return;let n=this._getSamplingParameters(s,!r);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,n.mag),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,n.min),r||i||a.generateMipmap(a.TEXTURE_2D),this._bindTextureDirectly(a.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,r,i,s,a,n,_,l,h){let u=this.getCaps().maxTextureSize,o=Math.min(u,this.needPOTTextures?(0,p.GetExponentOfTwo)(i.width,u):i.width),c=Math.min(u,this.needPOTTextures?(0,p.GetExponentOfTwo)(i.height,u):i.height),g=this._gl;if(g){if(!e._hardwareTexture){r&&r.removePendingData(e);return}this._bindTextureDirectly(g.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===s||!!s),e.baseWidth=i.width,e.baseHeight=i.height,e.width=o,e.height=c,e.isReady=!0,e.type=-1!==e.type?e.type:0,e.format=-1!==e.format?e.format:h??(".jpg"!==t||e._useSRGBBuffer?5:4),_(o,c,i,t,e,()=>{this._prepareWebGLTextureContinuation(e,r,a,n,l)})||this._prepareWebGLTextureContinuation(e,r,a,n,l)}}_getInternalFormatFromDepthTextureFormat(e,t,r){let i=this._gl;if(!t)return i.STENCIL_INDEX8;let s=r?i.DEPTH_STENCIL:i.DEPTH_COMPONENT;return this.webGLVersion>1?15===e?s=i.DEPTH_COMPONENT16:16===e?s=i.DEPTH_COMPONENT24:17===e||13===e?s=r?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24:14===e?s=i.DEPTH_COMPONENT32F:18===e&&(s=r?i.DEPTH32F_STENCIL8:i.DEPTH_COMPONENT32F):s=i.DEPTH_COMPONENT16,s}_getWebGLTextureTypeFromDepthTextureFormat(e){let t=this._gl,r=t.UNSIGNED_INT;return 15===e?r=t.UNSIGNED_SHORT:17===e||13===e?r=t.UNSIGNED_INT_24_8:14===e?r=t.FLOAT:18===e?r=t.FLOAT_32_UNSIGNED_INT_24_8_REV:19===e&&(r=t.UNSIGNED_BYTE),r}_setupFramebufferDepthAttachments(e,t,r,i,s=1,a,n=!1){let _=this._gl;a=a??(e?13:14);let l=this._getInternalFormatFromDepthTextureFormat(a,t,e);return e&&t?this._createRenderBuffer(r,i,s,_.DEPTH_STENCIL,l,n?-1:_.DEPTH_STENCIL_ATTACHMENT):t?this._createRenderBuffer(r,i,s,l,l,n?-1:_.DEPTH_ATTACHMENT):e?this._createRenderBuffer(r,i,s,l,l,n?-1:_.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,r,i,s,a,n=!0){let _=this._gl.createRenderbuffer();return this._updateRenderBuffer(_,e,t,r,i,s,a,n)}_updateRenderBuffer(e,t,r,i,s,a,n,_=!0){let l=this._gl;return l.bindRenderbuffer(l.RENDERBUFFER,e),i>1&&l.renderbufferStorageMultisample?l.renderbufferStorageMultisample(l.RENDERBUFFER,i,a,t,r):l.renderbufferStorage(l.RENDERBUFFER,s,t,r),-1!==n&&l.framebufferRenderbuffer(l.FRAMEBUFFER,n,l.RENDERBUFFER,e),_&&l.bindRenderbuffer(l.RENDERBUFFER,null),e}_releaseTexture(e){this._deleteTexture(e._hardwareTexture),this.unbindAllTextures();let t=this._internalTexturesCache.indexOf(e);-1!==t&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_deleteTexture(e){e?.release()}_setProgram(e){this._currentProgram!==e&&((0,u._setProgram)(e,this._gl),this._currentProgram=e)}bindSamplers(e){let t=e.getPipelineContext();this._setProgram(t.program);let r=e.getSamplers();for(let t=0;t<r.length;t++){let i=e.getUniform(r[t]);i&&(this._boundUniforms[t]=i)}this._currentEffect=null}_activateCurrentTexture(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)}_bindTextureDirectly(e,t,r=!1,i=!1){let s=!1,a=t&&t._associatedChannel>-1;if(r&&a&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||i){if(this._activateCurrentTexture(),t&&t.isMultiview)throw g.Logger.Error(["_bindTextureDirectly called with a multiview texture!",e,t]),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,t?._hardwareTexture?.underlyingResource??null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else r&&(s=!0,this._activateCurrentTexture());return a&&!r&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),s}_bindTexture(e,t,r){if(void 0===e)return;t&&(t._associatedChannel=e),this._activeChannel=e;let i=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(i,t)}unbindAllTextures(){for(let e=0;e<this._maxSimultaneousTextures;e++)this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))}setTexture(e,t,r,i){void 0!==e&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,r))}_bindSamplerUniformToChannel(e,t){let r=this._boundUniforms[e];r&&r._currentState!==t&&(this._gl.uniform1i(r,t),r._currentState=t)}_getTextureWrapMode(e){switch(e){case 1:break;case 0:return this._gl.CLAMP_TO_EDGE;case 2:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT}_setTexture(e,t,r=!1,i=!1,s=""){let a;if(!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video){this._activeChannel=e;let r=t.getInternalTexture();r&&(r._associatedChannel=e),t.update()}else if(4===t.delayLoadState)return t.delayLoad(),!1;a=i?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,!r&&a&&(a._associatedChannel=e);let n=!0;this._boundTexturesCache[e]===a&&(r||this._bindSamplerUniformToChannel(a._associatedChannel,e),n=!1),this._activeChannel=e;let _=this._getTextureTarget(a);if(n&&this._bindTextureDirectly(_,a,r),a&&!a.isMultiview){if(a.isCube&&a._cachedCoordinatesMode!==t.coordinatesMode){a._cachedCoordinatesMode=t.coordinatesMode;let e=+(3!==t.coordinatesMode&&5!==t.coordinatesMode);t.wrapU=e,t.wrapV=e}a._cachedWrapU!==t.wrapU&&(a._cachedWrapU=t.wrapU,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),a)),a._cachedWrapV!==t.wrapV&&(a._cachedWrapV=t.wrapV,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),a)),a.is3D&&a._cachedWrapR!==t.wrapR&&(a._cachedWrapR=t.wrapR,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),a)),this._setAnisotropicLevel(_,a,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,r,i){if(void 0!==e&&t){this._textureUnits&&this._textureUnits.length===r.length||(this._textureUnits=new Int32Array(r.length));for(let t=0;t<r.length;t++){let i=r[t].getInternalTexture();i?(this._textureUnits[t]=e+t,i._associatedChannel=e+t):this._textureUnits[t]=-1}this._gl.uniform1iv(t,this._textureUnits);for(let e=0;e<r.length;e++)this._setTexture(this._textureUnits[e],r[e],!0)}}_setAnisotropicLevel(e,t,r){let i=this._caps.textureAnisotropicFilterExtension;11!==t.samplingMode&&3!==t.samplingMode&&2!==t.samplingMode&&(r=1),i&&t._cachedAnisotropicFilteringLevel!==r&&(this._setTextureParameterFloat(e,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(r,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=r)}_setTextureParameterFloat(e,t,r,i){this._bindTextureDirectly(e,i,!0,!0),this._gl.texParameterf(e,t,r)}_setTextureParameterInteger(e,t,r,i){i&&this._bindTextureDirectly(e,i,!0,!0),this._gl.texParameteri(e,t,r)}unbindAllAttributes(){if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(let e=0;e<this._caps.maxVertexAttribs;e++)this.disableAttributeByIndex(e);return}for(let e=0,t=this._vertexAttribArraysEnabled.length;e<t;e++)!(e>=this._caps.maxVertexAttribs)&&this._vertexAttribArraysEnabled[e]&&this.disableAttributeByIndex(e)}releaseEffects(){this._compiledEffects={},this.onReleaseEffectsObservable.notifyObservers(this)}dispose(){(0,f.IsWindowObjectExist)()&&this._renderingCanvas&&(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._onContextRestored&&this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored)),super.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.unbindAllAttributes(),this._boundUniforms={},this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._currentProgram=null,this._creationOptions.loseContextOnDispose&&this._gl.getExtension("WEBGL_lose_context")?.loseContext(),(0,u.deleteStateObject)(this._gl)}attachContextLostEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)}attachContextRestoredEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)}getError(){return this._gl.getError()}_canRenderToFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(1)}_canRenderToHalfFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(2)}_canRenderToFramebuffer(e){let t=this._gl;for(;t.getError()!==t.NO_ERROR;);let r=!0,i=t.createTexture();t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);let s=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0);let a=t.checkFramebufferStatus(t.FRAMEBUFFER);if((r=(r=r&&a===t.FRAMEBUFFER_COMPLETE)&&t.getError()===t.NO_ERROR)&&(t.clear(t.COLOR_BUFFER_BIT),r=r&&t.getError()===t.NO_ERROR),r){t.bindFramebuffer(t.FRAMEBUFFER,null);let e=t.RGBA,i=t.UNSIGNED_BYTE,s=new Uint8Array(4);t.readPixels(0,0,1,1,e,i,s),r=r&&t.getError()===t.NO_ERROR}for(t.deleteTexture(i),t.deleteFramebuffer(s),t.bindFramebuffer(t.FRAMEBUFFER,null);!r&&t.getError()!==t.NO_ERROR;);return r}_getWebGLTextureType(e){if(1===this._webGLVersion){switch(e){case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT_OES;case 0:break;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case 3:return this._gl.BYTE;case 0:break;case 4:return this._gl.SHORT;case 5:return this._gl.UNSIGNED_SHORT;case 6:return this._gl.INT;case 7:return this._gl.UNSIGNED_INT;case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5;case 11:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case 12:return this._gl.UNSIGNED_INT_24_8;case 13:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case 14:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case 15:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE}_getInternalFormat(e,t=!1){let r=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:r=this._gl.ALPHA;break;case 1:r=this._gl.LUMINANCE;break;case 2:r=this._gl.LUMINANCE_ALPHA;break;case 6:case 33322:case 36760:r=this._gl.RED;break;case 7:case 33324:case 36761:r=this._gl.RG;break;case 4:case 32852:case 36762:r=t?this._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:case 32859:case 36763:r=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA}if(this._webGLVersion>1)switch(e){case 8:r=this._gl.RED_INTEGER;break;case 9:r=this._gl.RG_INTEGER;break;case 10:r=this._gl.RGB_INTEGER;break;case 11:r=this._gl.RGBA_INTEGER}return r}_getRGBABufferInternalSizedFormat(e,t,r=!1){if(1===this._webGLVersion){if(void 0!==t)switch(t){case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return r?this._glSRGBExtensionValues.SRGB:this._gl.RGB}return this._gl.RGBA}switch(e){case 3:switch(t){case 6:return this._gl.R8_SNORM;case 7:return this._gl.RG8_SNORM;case 4:return this._gl.RGB8_SNORM;case 8:return this._gl.R8I;case 9:return this._gl.RG8I;case 10:return this._gl.RGB8I;case 11:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case 0:switch(t){case 6:return this._gl.R8;case 7:return this._gl.RG8;case 4:return r?this._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return r?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8;case 8:return this._gl.R8UI;case 9:return this._gl.RG8UI;case 10:return this._gl.RGB8UI;case 11:return this._gl.RGBA8UI;case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case 4:switch(t){case 8:return this._gl.R16I;case 36760:return this._gl.R16_SNORM_EXT;case 36761:return this._gl.RG16_SNORM_EXT;case 36762:return this._gl.RGB16_SNORM_EXT;case 36763:return this._gl.RGBA16_SNORM_EXT;case 9:return this._gl.RG16I;case 10:return this._gl.RGB16I;default:return this._gl.RGBA16I}case 5:switch(t){case 8:return this._gl.R16UI;case 33322:return this._gl.R16_EXT;case 33324:return this._gl.RG16_EXT;case 32852:return this._gl.RGB16_EXT;case 32859:return this._gl.RGBA16_EXT;case 9:return this._gl.RG16UI;case 10:return this._gl.RGB16UI;default:return this._gl.RGBA16UI}case 6:switch(t){case 8:return this._gl.R32I;case 9:return this._gl.RG32I;case 10:return this._gl.RGB32I;default:return this._gl.RGBA32I}case 7:switch(t){case 8:return this._gl.R32UI;case 9:return this._gl.RG32UI;case 10:return this._gl.RGB32UI;default:return this._gl.RGBA32UI}case 1:switch(t){case 6:return this._gl.R32F;case 7:return this._gl.RG32F;case 4:return this._gl.RGB32F;default:return this._gl.RGBA32F}case 2:switch(t){case 6:return this._gl.R16F;case 7:return this._gl.RG16F;case 4:return this._gl.RGB16F;default:return this._gl.RGBA16F}case 10:return this._gl.RGB565;case 13:return this._gl.R11F_G11F_B10F;case 14:return this._gl.RGB9_E5;case 8:return this._gl.RGBA4;case 9:return this._gl.RGB5_A1;case 11:switch(t){case 5:default:return this._gl.RGB10_A2;case 11:return this._gl.RGB10_A2UI}}return r?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}readPixels(e,t,r,i,s=!0,a=!0,n=null){let _=s?this._gl.RGBA:this._gl.RGB,l=r*i*(s?4:3);if(n){if(n.length<l)return g.Logger.Error(`Data buffer is too small to store the read pixels (${n.length} should be more than ${l})`),Promise.resolve(n)}else n=new Uint8Array(l);return a&&this.flushFramebuffer(),this._gl.readPixels(e,t,r,i,_,this._gl.UNSIGNED_BYTE,n),Promise.resolve(n)}static get IsSupportedAsync(){return Promise.resolve(this.isSupported())}static get IsSupported(){return this.isSupported()}static isSupported(){if(null!==this._HasMajorPerformanceCaveat)return!this._HasMajorPerformanceCaveat;if(null===this._IsSupported)try{let e=o.AbstractEngine._CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=null!=t&&!!globalThis.WebGLRenderingContext}catch(e){this._IsSupported=!1}return this._IsSupported}static get HasMajorPerformanceCaveat(){if(null===this._HasMajorPerformanceCaveat)try{let e=o.AbstractEngine._CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch(e){this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat}}M._TempClearColorUint32=new Uint32Array(4),M._TempClearColorInt32=new Int32Array(4),M.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/12\\d\\..+?Mobile",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:".*AppleWebKit.*(15.4).*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]},{key:".*(15.4).*AppleWebKit.*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]}],M._ConcatenateShader=S._ConcatenateShader,M._IsSupported=null,M._HasMajorPerformanceCaveat=null,(t=M.prototype).startTimeQuery??(t.startTimeQuery=(0,P._MissingSideEffect)("ThinEngine","startTimeQuery")),(r=M.prototype).endTimeQuery??(r.endTimeQuery=(0,P._MissingSideEffect)("ThinEngine","endTimeQuery")),(i=M.prototype).createUniformBuffer??(i.createUniformBuffer=(0,P._MissingSideEffect)("ThinEngine","createUniformBuffer")),(s=M.prototype).createDynamicUniformBuffer??(s.createDynamicUniformBuffer=(0,P._MissingSideEffect)("ThinEngine","createDynamicUniformBuffer")),(a=M.prototype).updateUniformBuffer??(a.updateUniformBuffer=(0,P._MissingSideEffect)("ThinEngine","updateUniformBuffer")),(n=M.prototype).bindUniformBuffer??(n.bindUniformBuffer=(0,P._MissingSideEffect)("ThinEngine","bindUniformBuffer")),(_=M.prototype).bindUniformBufferBase??(_.bindUniformBufferBase=(0,P._MissingSideEffect)("ThinEngine","bindUniformBufferBase")),(l=M.prototype).bindUniformBlock??(l.bindUniformBlock=(0,P._MissingSideEffect)("ThinEngine","bindUniformBlock")),e.s(["ThinEngine",0,M],71379)}]);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89030,t=>{"use strict";let e=(1+Math.sqrt(5))/2;t.s(["Epsilon",0,.001,"PHI",0,e,"ToGammaSpace",0,1/2.2,"ToLinearSpace",0,2.2])},48657,t=>{"use strict";function e(t,e){let r=[];for(let i=0;i<t;++i)r.push(e());return r}let r=["push","splice","pop","shift","unshift"];t.s(["BuildArray",0,e,"BuildTuple",0,function(t,r){return e(t,r)},"_ObserveArray",0,function(t,e){let i=r.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 i)t?.()}}])},96265,88438,t=>{"use strict";var e=t.i(89030),r=t.i(48657),i=t.i(86985),s=t.i(81623),o=t.i(46703);class a{}function n(t){t.updateFlag=a._UpdateFlagSeed++}function h(t,e,r,i=0){let s=t.asArray(),o=e.asArray(),a=s[0],n=s[1],_=s[2],l=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],E=o[14],U=o[15];r[i]=a*F+n*A+_*V+l*O,r[i+1]=a*M+n*P+_*v+l*H,r[i+2]=a*g+n*D+_*L+l*E,r[i+3]=a*I+n*C+_*k+l*U,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*E,r[i+7]=y*I+u*C+m*k+c*U,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*E,r[i+11]=x*I+f*C+R*k+d*U,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*E,r[i+15]=z*I+T*C+w*k+p*U}function _(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 l(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,E=_*c-m*l,U=h*c-u*l,b=h*m-u*_,S=n*c-y*l,q=n*m-y*_,B=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*E-o*U+a*b)*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*E-o*S+a*q)*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*U-s*S+a*B)*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*b-s*q+o*B)*C,!0}a._UpdateFlagSeed=0,t.s(["CopyMatrixToArray",0,_,"InvertMatrixToArray",0,l,"InvertMatrixToRef",0,function(t,e){let r=l(t,e.asArray());return r&&n(e),r},"MatrixManagement",0,a,"MultiplyMatricesToArray",0,h,"MultiplyMatricesToRef",0,function(t,e,r,i=0){h(t,e,r.asArray(),i),n(r)}],88438);var y=t.i(77052);let u=t=>parseInt(t.toString().replace(/\W/g,""));class m{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=u(this.x),e=u(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 m.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 m(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 m(this.x+t.x,this.y+t.y)}subtract(t){return new m(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 m(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 m(this.x*t,this.y*e)}divide(t){return new m(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 m(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 m(-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 m(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,r=e.Epsilon){return t&&(0,o.WithinEpsilon)(this.x,t.x,r)&&(0,o.WithinEpsilon)(this.y,t.y,r)}equalsToFloats(t,e){return this.x===t&&this.y===e}floor(){return new m(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 m(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 m)}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 m;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 m(this.x,this.y)}dot(t){return this.x*t.x+this.y*t.y}static Zero(){return new m(0,0)}static One(){return new m(1,1)}static Random(t=0,e=1){return new m((0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.copyFromFloats((0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e))}static get ZeroReadOnly(){return m._ZeroReadOnly}static FromArray(t,e=0){return new m(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 m(.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,o.Clamp)(t.x,e.x,r.x),i.y=(0,o.Clamp)(t.y,e.y,r.y),i}static Clamp(t,e,r){return new m((0,o.Clamp)(t.x,e.x,r.x),(0,o.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 m(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 m)}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 m.LerpToRef(t,e,r,new m)}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 m.NormalizeToRef(t,new m)}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Minimize(t,e){return new m(t.x<e.x?t.x:e.x,t.y<e.y?t.y:e.y)}static Maximize(t,e){return new m(t.x>e.x?t.x:e.x,t.y>e.y?t.y:e.y)}static Transform(t,e){return m.TransformToRef(t,e,new m)}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(m.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 m.CenterToRef(t,e,new m)}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=m.DistanceSquared(e,r);if(0===i)return m.Distance(t,e);let s=r.subtract(e),o=Math.max(0,Math.min(1,m.Dot(t.subtract(e),s)/i)),a=e.add(s.multiplyByFloats(o,o));return m.Distance(t,a)}}m._V8PerformanceHack=new m(.5,.5),m._ZeroReadOnly=m.Zero();class c{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=u(this._x),e=u(this._y),r=u(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 c.FromArrayToRef(t,e,this),this}toQuaternion(){return f.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 c(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 c(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 c(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 c(-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 c(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 c)}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 c)}projectOnPlaneToRef(t,e,r){let i=t.normal,s=t.d,o=d.Vector3[0];this.subtractToRef(e,o),o.normalize();let a=c.Dot(o,i);if(1e-10>Math.abs(a))r.setAll(1/0);else{let t=-(c.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,r=e.Epsilon){return t&&(0,o.WithinEpsilon)(this._x,t._x,r)&&(0,o.WithinEpsilon)(this._y,t._y,r)&&(0,o.WithinEpsilon)(this._z,t._z,r)}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 c(this._x*t,this._y*e,this._z*r)}divide(t){return new c(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,o.WithinEpsilon)(e,r,t))return!0;let i=Math.abs(this._z);return!((0,o.WithinEpsilon)(e,i,t)&&(0,o.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 c(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 c(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=d.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(d.Matrix[0]),c.TransformCoordinatesToRef(this,d.Matrix[0],e),e}rotateByQuaternionAroundPointToRef(t,e,r){return this.subtractToRef(e,d.Vector3[0]),d.Vector3[0].rotateByQuaternionToRef(t,d.Vector3[0]),e.addToRef(d.Vector3[0],r),r}cross(t){return c.CrossToRef(this,t,new c)}normalizeFromLength(t){return 0===t||1===t?this:this.scaleInPlace(1/t)}normalizeToNew(){return this.normalizeToRef(new c)}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 c(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=c.Dot(t,r);return(s-i)/(s-c.Dot(e,r))}static GetAngleBetweenVectors(t,e,r){let i=t.normalizeToRef(d.Vector3[1]),s=e.normalizeToRef(d.Vector3[2]),a=c.Dot(i,s),n=Math.acos(a=(0,o.Clamp)(a,-1,1)),h=d.Vector3[3];return(c.CrossToRef(i,s,h),c.Dot(h,r)>0)?isNaN(n)?0:n:isNaN(n)?-Math.PI:-Math.acos(a)}static GetAngleBetweenVectorsOnPlane(t,e,r){d.Vector3[0].copyFrom(t);let i=d.Vector3[0];d.Vector3[1].copyFrom(e);let s=d.Vector3[1];d.Vector3[2].copyFrom(r);let a=d.Vector3[2],n=d.Vector3[3],h=d.Vector3[4];i.normalize(),s.normalize(),a.normalize(),c.CrossToRef(a,i,n),c.CrossToRef(n,a,h);let _=Math.atan2(c.Dot(s,n),c.Dot(s,h));return(0,o.NormalizeRadians)(_)}static PitchYawRollToMoveBetweenPointsToRef(t,e,r){let i=z.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=c.Zero();return c.PitchYawRollToMoveBetweenPointsToRef(t,e,r)}static SlerpToRef(t,r,i,s){let a,n;i=(0,o.Clamp)(i,0,1);let h=d.Vector3[0],_=d.Vector3[1];h.copyFrom(t);let l=h.length();h.normalizeFromLength(l),_.copyFrom(r);let y=_.length();_.normalizeFromLength(y);let u=c.Dot(h,_);if(u<1-e.Epsilon){let t=Math.acos(u),e=1/Math.sin(t);a=Math.sin((1-i)*t)*e,n=Math.sin(i*t)*e}else a=1-i,n=i;return h.scaleInPlace(a),_.scaleInPlace(n),s.copyFrom(h).addInPlace(_),s.scaleInPlace((0,o.Lerp)(l,y,i)),s}static SmoothToRef(t,e,r,i,s){return c.SlerpToRef(t,e,0===i?1:r/i,s),s}static FromArray(t,e=0){return new c(t[e],t[e+1],t[e+2])}static FromFloatArray(t,e){return c.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 c.FromArrayToRef(t,e,r)}static FromFloatsToRef(t,e,r,i){return i.copyFromFloats(t,e,r),i}static Zero(){return new c(0,0,0)}static One(){return new c(1,1,1)}static Up(){return new c(0,1,0)}static get UpReadOnly(){return c._UpReadOnly}static get DownReadOnly(){return c._DownReadOnly}static get RightReadOnly(){return c._RightReadOnly}static get LeftReadOnly(){return c._LeftReadOnly}static get LeftHandedForwardReadOnly(){return c._LeftHandedForwardReadOnly}static get RightHandedForwardReadOnly(){return c._RightHandedForwardReadOnly}static get LeftHandedBackwardReadOnly(){return c._LeftHandedBackwardReadOnly}static get RightHandedBackwardReadOnly(){return c._RightHandedBackwardReadOnly}static get ZeroReadOnly(){return c._ZeroReadOnly}static get OneReadOnly(){return c._OneReadOnly}static Down(){return new c(0,-1,0)}static Forward(t=!1){return new c(0,0,t?-1:1)}static Backward(t=!1){return new c(0,0,t?1:-1)}static Right(){return new c(1,0,0)}static Left(){return new c(-1,0,0)}static Random(t=0,e=1){return new c((0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.copyFromFloats((0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e))}static TransformCoordinates(t,e){let r=c.Zero();return c.TransformCoordinatesToRef(t,e,r),r}static TransformCoordinatesToRef(t,e,r){return c.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=c.Zero();return c.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 c(.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 c;return c.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 c(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 c;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 c(0,0,0);return c.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 c;return c.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=c.Zero();return c.NormalizeToRef(t,e),e}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Project(t,e,r,i){let s=new c;return c.ProjectToRef(t,e,r,i,s),s}static ProjectToRef(t,e,r,i,o){let a=i.width,n=i.height,h=i.x,_=i.y,l=d.Matrix[1],y=s.EngineStore.LastCreatedEngine?.isNDCHalfZRange;R.FromValuesToRef(a/2,0,0,0,0,-n/2,0,0,0,0,y?1:.5,0,h+a/2,n/2+_,.5*!y,1,l);let u=d.Matrix[0];return e.multiplyToRef(r,u),u.multiplyToRef(l,u),c.TransformCoordinatesToRef(t,u,o),o}static Reflect(t,e){return this.ReflectToRef(t,e,new c)}static ReflectToRef(t,e,r){let i=z.Vector3[0];return i.copyFrom(e).scaleInPlace(2*c.Dot(t,e)),r.copyFrom(t).subtractInPlace(i)}static UnprojectFromTransform(t,e,r,i,s){return this.Unproject(t,e,r,i,s,R.IdentityReadOnly)}static Unproject(t,e,r,i,s,o){let a=new c;return c.UnprojectToRef(t,e,r,i,s,o,a),a}static UnprojectToRef(t,e,r,i,s,o,a){return c.UnprojectFloatsToRef(t._x,t._y,t._z,e,r,i,s,o,a),a}static UnprojectFloatsToRef(t,e,r,i,o,a,n,h,_){let l=d.Matrix[0];a.multiplyToRef(n,l),l.multiplyToRef(h,l),l.invert();let y=d.Vector3[0];return y.x=t/i*2-1,y.y=-(e/o*2-1),s.EngineStore.LastCreatedEngine?.isNDCHalfZRange?y.z=r:y.z=2*r-1,c.TransformCoordinatesToRef(y,l,_),_}static Minimize(t,e){let r=new c;return r.copyFrom(t),r.minimizeInPlace(e),r}static Maximize(t,e){let r=new c;return r.copyFrom(t),r.maximizeInPlace(e),r}static Distance(t,e){return Math.sqrt(c.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,r,i,s,a){let n,h,_=d.Vector3[0],l=d.Vector3[1],y=d.Vector3[2],u=d.Vector3[3],m=d.Vector3[4];i.subtractToRef(r,_),s.subtractToRef(r,l),s.subtractToRef(i,y);let x=_.length(),f=l.length(),R=y.length();if(x<e.Epsilon||f<e.Epsilon||R<e.Epsilon)return a.copyFrom(r),c.Distance(t,r);t.subtractToRef(r,m),c.CrossToRef(_,l,u);let z=u.length();if(z<e.Epsilon)return a.copyFrom(r),c.Distance(t,r);u.normalizeFromLength(z);let T=m.length();if(T<e.Epsilon)return a.copyFrom(r),0;m.normalizeFromLength(T);let w=c.Dot(u,m),p=d.Vector3[5],F=d.Vector3[6];p.copyFrom(u).scaleInPlace(-T*w),F.copyFrom(t).addInPlace(p);let M=d.Vector3[4],g=d.Vector3[5],I=d.Vector3[7],A=d.Vector3[8];M.copyFrom(_).scaleInPlace(1/x),A.copyFrom(l).scaleInPlace(1/f),M.addInPlace(A).scaleInPlace(-1),g.copyFrom(_).scaleInPlace(-1/x),A.copyFrom(y).scaleInPlace(1/R),g.addInPlace(A).scaleInPlace(-1),I.copyFrom(y).scaleInPlace(-1/R),A.copyFrom(l).scaleInPlace(-1/f),I.addInPlace(A).scaleInPlace(-1);let P=d.Vector3[9];P.copyFrom(F).subtractInPlace(r),c.CrossToRef(M,P,A);let D=c.Dot(A,u);P.copyFrom(F).subtractInPlace(i),c.CrossToRef(g,P,A);let C=c.Dot(A,u);P.copyFrom(F).subtractInPlace(s),c.CrossToRef(I,P,A);let V=c.Dot(A,u),v=d.Vector3[10];D>0&&C<0?(v.copyFrom(_),n=r,h=i):C>0&&V<0?(v.copyFrom(y),n=i,h=s):(v.copyFrom(l).scaleInPlace(-1),n=s,h=r);let L=d.Vector3[9],k=d.Vector3[4];if(n.subtractToRef(F,A),h.subtractToRef(F,L),c.CrossToRef(A,L,k),!(0>c.Dot(k,u)))return a.copyFrom(F),Math.abs(T*w);let O=d.Vector3[5];c.CrossToRef(v,k,O),O.normalize();let H=d.Vector3[9];H.copyFrom(n).subtractInPlace(F);let E=H.length();if(E<e.Epsilon)return a.copyFrom(n),c.Distance(t,n);H.normalizeFromLength(E);let U=c.Dot(O,H),b=d.Vector3[7];b.copyFrom(F).addInPlace(O.scaleInPlace(E*U)),A.copyFrom(b).subtractInPlace(n),T=v.length(),v.normalizeFromLength(T);let S=c.Dot(A,v)/Math.max(T,e.Epsilon);return S=(0,o.Clamp)(S,0,1),b.copyFrom(n).addInPlace(v.scaleInPlace(S*T)),a.copyFrom(b),c.Distance(t,b)}static Center(t,e){return c.CenterToRef(t,e,c.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 c;return c.RotationFromAxisToRef(t,e,r,i),i}static RotationFromAxisToRef(t,e,r,i){let s=d.Quaternion[0];return f.RotationQuaternionFromAxisToRef(t,e,r,s),s.toEulerAnglesToRef(i),i}}c._V8PerformanceHack=new c(.5,.5,.5),c._UpReadOnly=c.Up(),c._DownReadOnly=c.Down(),c._LeftHandedForwardReadOnly=c.Forward(!1),c._RightHandedForwardReadOnly=c.Forward(!0),c._LeftHandedBackwardReadOnly=c.Backward(!1),c._RightHandedBackwardReadOnly=c.Backward(!0),c._RightReadOnly=c.Right(),c._LeftReadOnly=c.Left(),c._ZeroReadOnly=c.Zero(),c._OneReadOnly=c.One();class x{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=u(this._x),e=u(this._y),r=u(this._z),i=u(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 x.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 x(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 x(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 x(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 x(-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 x(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,r=e.Epsilon){return t&&(0,o.WithinEpsilon)(this._x,t.x,r)&&(0,o.WithinEpsilon)(this._y,t.y,r)&&(0,o.WithinEpsilon)(this._z,t.z,r)&&(0,o.WithinEpsilon)(this._w,t.w,r)}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 x(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 x(this._x*t,this._y*e,this._z*r,this._w*i)}divide(t){return new x(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 x(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 x(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 x)}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 c(this._x,this._y,this._z)}clone(){return new x(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 x(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 x.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 x(0,0,0,0)}static One(){return new x(1,1,1,1)}static Random(t=0,e=1){return new x((0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.x=(0,o.RandomRange)(t,e),r.y=(0,o.RandomRange)(t,e),r.z=(0,o.RandomRange)(t,e),r.w=(0,o.RandomRange)(t,e),r}static Clamp(t,e,r){return x.ClampToRef(t,e,r,new x)}static ClampToRef(t,e,r,i){return i.x=(0,o.Clamp)(t.x,e.x,r.x),i.y=(0,o.Clamp)(t.y,e.y,r.y),i.z=(0,o.Clamp)(t.z,e.z,r.z),i.w=(0,o.Clamp)(t.w,e.w,r.w),i}static CheckExtends(t,e,r){e.minimizeInPlace(t),r.maximizeInPlace(t)}static get ZeroReadOnly(){return x._ZeroReadOnly}static Normalize(t){return x.NormalizeToRef(t,new x)}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Minimize(t,e){let r=new x;return r.copyFrom(t),r.minimizeInPlace(e),r}static Maximize(t,e){let r=new x;return r.copyFrom(t),r.maximizeInPlace(e),r}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,s=t.z-e.z,o=t.w-e.w;return r*r+i*i+s*s+o*o}static Center(t,e){return x.CenterToRef(t,e,new x)}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 x.TransformCoordinatesToRef(t,e,new x)}static TransformCoordinatesToRef(t,e,r){return x.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 x.TransformNormalToRef(t,e,new x)}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 x(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}}x._V8PerformanceHack=new x(.5,.5,.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}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=u(this._x),e=u(this._y),r=u(this._z),i=u(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 f.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,r=e.Epsilon){return t&&(0,o.WithinEpsilon)(this._x,t._x,r)&&(0,o.WithinEpsilon)(this._y,t._y,r)&&(0,o.WithinEpsilon)(this._z,t._z,r)&&(0,o.WithinEpsilon)(this._w,t._w,r)}isApprox(t,r=e.Epsilon){return t&&((0,o.WithinEpsilon)(this._x,t._x,r)&&(0,o.WithinEpsilon)(this._y,t._y,r)&&(0,o.WithinEpsilon)(this._z,t._z,r)&&(0,o.WithinEpsilon)(this._w,t._w,r)||(0,o.WithinEpsilon)(this._x,-t._x,r)&&(0,o.WithinEpsilon)(this._y,-t._y,r)&&(0,o.WithinEpsilon)(this._z,-t._z,r)&&(0,o.WithinEpsilon)(this._w,-t._w,r))}clone(){return new f(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 f(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 f)}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 f(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 f(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 f(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 f)}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 f(-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 f(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=c.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 R.FromQuaternionToRef(this,t),t}fromRotationMatrix(t){return f.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=c.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 f;return f.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=f.Dot(t,e);return 1-i*i<=r}static SmoothToRef(t,e,r,i,s){let a=0===i?1:r/i;return a=(0,o.Clamp)(a,0,1),f.SlerpToRef(t,e,a,s),s}static Zero(){return new f(0,0,0,0)}static Inverse(t){return new f(-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 f(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 f.RotationAxisToRef(t,e,new f)}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 f(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 f;return f.RotationYawPitchRollToRef(e,t,r,i),i}static FromEulerAnglesToRef(t,e,r,i){return f.RotationYawPitchRollToRef(e,t,r,i),i}static FromEulerVector(t){let e=new f;return f.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e}static FromEulerVectorToRef(t,e){return f.RotationYawPitchRollToRef(t._y,t._x,t._z,e),e}static FromUnitVectorsToRef(t,r,i,s=e.Epsilon){let o=c.Dot(t,r)+1;return o<s?Math.abs(t.x)>Math.abs(t.z)?i.set(-t.y,t.x,0,0):i.set(0,-t.z,t.y,0):(c.CrossToRef(t,r,z.Vector3[0]),i.set(z.Vector3[0].x,z.Vector3[0].y,z.Vector3[0].z,o)),i.normalize()}static RotationYawPitchRoll(t,e,r){let i=new f;return f.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 f;return f.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 f(0,0,0,0);return f.RotationQuaternionFromAxisToRef(t,e,r,i),i}static RotationQuaternionFromAxisToRef(t,e,r,i){let s=d.Matrix[0];return t=t.normalizeToRef(d.Vector3[0]),e=e.normalizeToRef(d.Vector3[1]),r=r.normalizeToRef(d.Vector3[2]),R.FromXYZAxesToRef(t,e,r,s),f.FromRotationMatrixToRef(s,i),i}static FromLookDirectionLH(t,e){let r=new f;return f.FromLookDirectionLHToRef(t,e,r),r}static FromLookDirectionLHToRef(t,e,r){let i=d.Matrix[0];return R.LookDirectionLHToRef(t,e,i),f.FromRotationMatrixToRef(i,r),r}static FromLookDirectionRH(t,e){let r=new f;return f.FromLookDirectionRHToRef(t,e,r),r}static FromLookDirectionRHToRef(t,e,r){let i=d.Matrix[0];return R.LookDirectionRHToRef(t,e,i),f.FromRotationMatrixToRef(i,r)}static Slerp(t,e,r){let i=f.Identity();return f.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 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,t._w*n+r._w*h+e._w*_+i._w*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._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=f.Zero();return f.NormalizeToRef(t,e),e}static NormalizeToRef(t,e){return t.normalizeToRef(e),e}static Clamp(t,e,r){let i=new f;return f.ClampToRef(t,e,r,i),i}static ClampToRef(t,e,r,i){return i.copyFromFloats((0,o.Clamp)(t.x,e.x,r.x),(0,o.Clamp)(t.y,e.y,r.y),(0,o.Clamp)(t.z,e.z,r.z),(0,o.Clamp)(t.w,e.w,r.w))}static Random(t=0,e=1){return new f((0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e))}static RandomToRef(t=0,e=1,r){return r.copyFromFloats((0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e),(0,o.RandomRange)(t,e),(0,o.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(f.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 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,(t.w+e.w)/2)}}f._V8PerformanceHack=new f(.5,.5,.5,.5);class R{static get Use64Bits(){return i.PerformanceConfigurator.MatrixUse64Bits}get m(){return this._m}markAsUpdated(){this.updateFlag=a._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,i.PerformanceConfigurator.MatrixTrackPrecisionChange&&i.PerformanceConfigurator.MatrixTrackedMatrices.push(this),this._m=new i.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 R.FromArrayToRef(t,e,this)}copyFromFloats(...t){return R.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 R.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 R;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 R)}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?R.IdentityToRef(t):l(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 c(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 R.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 _(this,t,e),this}multiply(t){let e=new R;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 h(this,t,e,r),this}divide(t){return this.divideToRef(t,new R)}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 R)}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,o.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 R)}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 R)}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 R;return t.copyFrom(this),t}getClassName(){return"Matrix"}getHashCode(){let t=u(this._m[0]);for(let e=1;e<16;e++)t=397*t^u(this._m[e]);return t}decomposeToTransformNode(t){return t.rotationQuaternion=t.rotationQuaternion||new f,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||d.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;R.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,d.Matrix[0]),f.FromRotationMatrixToRef(d.Matrix[0],e)}return!0}getRow(t){if(t<0||t>3)return null;let e=4*t;return new x(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 R;return R.TransposeToRef(this,t),t}transposeToRef(t){return R.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 R;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=d.Matrix[0];this.invertToRef(e),e.transposeToRef(t);let r=t._m;return R.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 R;return this.getRotationMatrixToRef(t),t}getRotationMatrixToRef(t){let e=d.Vector3[0];if(!this.decompose(e))return R.IdentityToRef(t),t;let r=this._m,i=1/e._x,s=1/e._y,o=1/e._z;return R.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 R;return R.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 R._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 R,d=f._m;return d[0]=t,d[1]=e,d[2]=r,d[3]=i,d[4]=s,d[5]=o,d[6]=a,d[7]=n,d[8]=h,d[9]=_,d[10]=l,d[11]=y,d[12]=u,d[13]=m,d[14]=c,d[15]=x,f.markAsUpdated(),f}static Compose(t,e,r){let i=new R;return R.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=R.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 R.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=R.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 R;return R.RotationXToRef(t,e),e}static Invert(t){let e=new R;return t.invertToRef(e),e}static RotationXToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return R.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 R;return R.RotationYToRef(t,e),e}static RotationYToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return R.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 R;return R.RotationZToRef(t,e),e}static RotationZToRef(t,e){let r=Math.sin(t),i=Math.cos(t);return R.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 R;return R.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(d.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,r,i,s=!1){let o=c.Dot(r,t),a=i._m;if(o<-1+e.Epsilon)a[0]=-1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=s?1:-1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s?-1:1,a[11]=0;else{let e=c.Cross(r,t),i=1/(1+o);a[0]=e._x*e._x*i+o,a[1]=e._y*e._x*i-e._z,a[2]=e._z*e._x*i+e._y,a[3]=0,a[4]=e._x*e._y*i+e._z,a[5]=e._y*e._y*i+o,a[6]=e._z*e._y*i-e._x,a[7]=0,a[8]=e._x*e._z*i-e._y,a[9]=e._y*e._z*i+e._x,a[10]=e._z*e._z*i+o,a[11]=0}return a[12]=0,a[13]=0,a[14]=0,a[15]=1,i.markAsUpdated(),i}static RotationYawPitchRoll(t,e,r){let i=new R;return R.RotationYawPitchRollToRef(t,e,r,i),i}static RotationYawPitchRollToRef(t,e,r,i){return f.RotationYawPitchRollToRef(t,e,r,d.Quaternion[0]),d.Quaternion[0].toRotationMatrix(i),i}static Scaling(t,e,r){let i=new R;return R.ScalingToRef(t,e,r,i),i}static ScalingToRef(t,e,r,i){return R.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 R;return R.TranslationToRef(t,e,r,i),i}static TranslationToRef(t,e,r,i){return R.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 R;return R.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 R;return R.DecomposeLerpToRef(t,e,r,i),i}static DecomposeLerpToRef(t,e,r,i){let s=d.Vector3[0],o=d.Quaternion[0],a=d.Vector3[1];t.decompose(s,o,a);let n=d.Vector3[2],h=d.Quaternion[1],_=d.Vector3[3];e.decompose(n,h,_);let l=d.Vector3[4];c.LerpToRef(s,n,r,l);let y=d.Quaternion[2];f.SlerpToRef(o,h,r,y);let u=d.Vector3[5];return c.LerpToRef(a,_,r,u),R.ComposeToRef(l,y,u,i),i}static LookAtLH(t,e,r){let i=new R;return R.LookAtLHToRef(t,e,r,i),i}static LookAtLHToRef(t,e,r,i){let s=d.Vector3[0],o=d.Vector3[1],a=d.Vector3[2];e.subtractToRef(t,a),a.normalize(),c.CrossToRef(r,a,s);let n=s.lengthSquared();0===n?s.x=1:s.normalizeFromLength(Math.sqrt(n)),c.CrossToRef(a,s,o),o.normalize();let h=-c.Dot(s,t),_=-c.Dot(o,t),l=-c.Dot(a,t);return R.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 R;return R.LookAtRHToRef(t,e,r,i),i}static LookAtRHToRef(t,e,r,i){let s=d.Vector3[0],o=d.Vector3[1],a=d.Vector3[2];t.subtractToRef(e,a),a.normalize(),c.CrossToRef(r,a,s);let n=s.lengthSquared();0===n?s.x=1:s.normalizeFromLength(Math.sqrt(n)),c.CrossToRef(a,s,o),o.normalize();let h=-c.Dot(s,t),_=-c.Dot(o,t),l=-c.Dot(a,t);return R.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 R;return R.LookDirectionLHToRef(t,e,r),r}static LookDirectionLHToRef(t,e,r){let i=d.Vector3[0];i.copyFrom(t),i.scaleInPlace(-1);let s=d.Vector3[1];return c.CrossToRef(e,i,s),R.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 R;return R.LookDirectionRHToRef(t,e,r),r}static LookDirectionRHToRef(t,e,r){let i=d.Vector3[2];return c.CrossToRef(e,t,i),R.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 R;return R.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 R.FromValuesToRef(a,0,0,0,0,n,0,0,0,0,h,0,0,0,_,1,s),o&&s.multiplyToRef(T,s),s._updateIdentityStatus(1===a&&1===n&&1===h&&0===_),s}static OrthoOffCenterLH(t,e,r,i,s,o,a){let n=new R;return R.OrthoOffCenterLHToRef(t,e,r,i,s,o,n,a),n}static OrthoOffCenterLHToRef(t,e,r,i,s,o,a,n){return R.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(T,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 R.TranslationToRef(0,0,-h,d.Matrix[1]),R.FromValuesToRef(1,0,0,0,0,1,0,0,y,u,1,0,0,0,0,1,d.Matrix[0]),d.Matrix[1].multiplyToRef(d.Matrix[0],d.Matrix[0]),R.TranslationToRef(0,0,h,d.Matrix[1]),d.Matrix[0].multiplyToRef(d.Matrix[1],d.Matrix[0]),R.OrthoOffCenterLHToRef(t,e,r,i,s,o,_,l),d.Matrix[0].multiplyToRef(_,_),_}static OrthoOffCenterRH(t,e,r,i,s,o,a){let n=new R;return R.OrthoOffCenterRHToRef(t,e,r,i,s,o,n,a),n}static OrthoOffCenterRHToRef(t,e,r,i,s,o,a,n){return R.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 R.TranslationToRef(0,0,h,d.Matrix[1]),R.FromValuesToRef(1,0,0,0,0,1,0,0,y,u,1,0,0,0,0,1,d.Matrix[0]),d.Matrix[1].multiplyToRef(d.Matrix[0],d.Matrix[0]),R.TranslationToRef(0,0,-h,d.Matrix[1]),d.Matrix[0].multiplyToRef(d.Matrix[1],d.Matrix[0]),R.OrthoOffCenterRHToRef(t,e,r,i,s,o,_,l),d.Matrix[0].multiplyToRef(_,_),_}static PerspectiveLH(t,e,r,i,s,o=0){let a=new R,n=Math.tan(o);return R.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(T,a),a._updateIdentityStatus(!1),a}static PerspectiveFovLH(t,e,r,i,s,o=0,a=!1){let n=new R;return R.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 R.FromValuesToRef(l,0,0,0,0,y,0,c,0,0,u,1,0,0,m,0,s),a&&s.multiplyToRef(T,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 R.FromValuesToRef(_,0,0,0,0,l,0,y,0,0,-r,1,0,0,1,0,s),a&&s.multiplyToRef(T,s),s._updateIdentityStatus(!1),s}static PerspectiveFovRH(t,e,r,i,s,o=0,a=!1){let n=new R;return R.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 R.FromValuesToRef(l,0,0,0,0,y,0,c,0,0,u,-1,0,0,m,0,s),a&&s.multiplyToRef(T,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 R.FromValuesToRef(_,0,0,0,0,l,0,y,0,0,-r,-1,0,0,-1,0,s),a&&s.multiplyToRef(T,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=R.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 R;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 i.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 i.PerformanceConfigurator.MatrixUse64Bits?r:new Float32Array(r)}static Transpose(t){let e=new R;return R.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 R;return R.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 R.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 R.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}}R._IdentityReadOnly=R.Identity();class d{}d.Vector3=(0,r.BuildTuple)(11,c.Zero),d.Matrix=(0,r.BuildTuple)(2,R.Identity),d.Quaternion=(0,r.BuildTuple)(3,f.Zero);class z{}z.Vector2=(0,r.BuildTuple)(3,m.Zero),z.Vector3=(0,r.BuildTuple)(13,c.Zero),z.Vector4=(0,r.BuildTuple)(3,x.Zero),z.Quaternion=(0,r.BuildTuple)(3,f.Zero),z.Matrix=(0,r.BuildTuple)(8,R.Identity);let T=R.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1),w=!1;t.s(["Matrix",0,R,"Quaternion",0,f,"RegisterMathVector",0,function(){w||(w=!0,Object.defineProperties(m.prototype,{dimension:{value:[2]},rank:{value:1}}),Object.defineProperties(c.prototype,{dimension:{value:[3]},rank:{value:1}}),Object.defineProperties(x.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(f.prototype,{dimension:{value:[4]},rank:{value:1}}),Object.defineProperties(R.prototype,{dimension:{value:[4,4]},rank:{value:2}}),(0,y.RegisterClass)("BABYLON.Vector2",m),(0,y.RegisterClass)("BABYLON.Vector3",c),(0,y.RegisterClass)("BABYLON.Vector4",x),(0,y.RegisterClass)("BABYLON.Matrix",R))},"TmpVectors",0,z,"Vector2",0,m,"Vector3",0,c,"Vector4",0,x],96265)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25877,r=>{"use strict";var e=r.i(25742),o=r.i(5110);let a="cachedOperationValue",t="cachedExecutionId";class l extends e.FlowGraphBlock{constructor(r,e){super(e),this.value=this.registerDataOutput("value",r),this.isValid=this.registerDataOutput("isValid",o.RichTypeBoolean)}_updateOutputs(r){let e=r._getExecutionVariable(this,t,-1),o=r._getExecutionVariable(this,a,null);if(null!=o&&e===r.executionId)this.isValid.setValue(!0,r),this.value.setValue(o,r);else try{let e=this._doOperation(r);if(null==e)return void this.isValid.setValue(!1,r);r._setExecutionVariable(this,a,e),r._setExecutionVariable(this,t,r.executionId),this.value.setValue(e,r),this.isValid.setValue(!0,r)}catch(e){this.isValid.setValue(!1,r)}}}r.s(["FlowGraphCachedOperationBlock",0,l])},69823,r=>{"use strict";var e=r.i(25877);class o extends e.FlowGraphCachedOperationBlock{constructor(r,e,o,a,t){super(e,t),this._operation=o,this._className=a,this.a=this.registerDataInput("a",r)}_doOperation(r){return this._operation(this.a.getValue(r))}getClassName(){return this._className}}r.s(["FlowGraphUnaryOperationBlock",0,o])},16357,r=>{"use strict";var e=r.i(25877);class o extends e.FlowGraphCachedOperationBlock{constructor(r,e,o,a,t,l){super(o,l),this._operation=a,this._className=t,this.a=this.registerDataInput("a",r),this.b=this.registerDataInput("b",e)}_doOperation(r){let e=this.a.getValue(r),o=this.b.getValue(r);return this._operation(e,o)}getClassName(){return this._className}}r.s(["FlowGraphBinaryOperationBlock",0,o])},25620,r=>{"use strict";var e=r.i(5110),o=r.i(16357),a=r.i(25877);class t extends a.FlowGraphCachedOperationBlock{constructor(r,e,o,a){super(r,a),this._operation=e,this._className=o}_doOperation(r){return this._operation(r)}getClassName(){return this._className}}var l=r.i(96265),p=r.i(69823),c=a;class s extends c.FlowGraphCachedOperationBlock{constructor(r,e,o,a,t,l,p){super(a,p),this._operation=t,this._className=l,this.a=this.registerDataInput("a",r),this.b=this.registerDataInput("b",e),this.c=this.registerDataInput("c",o)}_doOperation(r){return this._operation(this.a.getValue(r),this.b.getValue(r),this.c.getValue(r))}getClassName(){return this._className}}var i=r.i(65487),h=r.i(49658),n=r.i(63719),u=r.i(77052);class y extends o.FlowGraphBinaryOperationBlock{constructor(r){super((0,e.getRichTypeByFlowGraphType)(r?.type),(0,e.getRichTypeByFlowGraphType)(r?.type),(0,e.getRichTypeByFlowGraphType)(r?.type),(r,e)=>this._polymorphicAdd(r,e),"FlowGraphAddBlock",r)}_polymorphicAdd(r,e){let o=(0,n._GetClassNameOf)(r),a=(0,n._GetClassNameOf)(e);if((0,n._AreSameVectorOrQuaternionClass)(o,a)||(0,n._AreSameMatrixClass)(o,a)||(0,n._AreSameIntegerClass)(o,a))return r.add(e);if("Quaternion"===o||"Vector4"===a)return new l.Vector4(r.x,r.y,r.z,r.w).addInPlace(e);if("Vector4"===o||"Quaternion"===a)return r.add(e);if(this.config?.preventIntegerFloatArithmetic&&typeof r!=typeof e)throw Error("Cannot add different types of numbers.");return(0,n.getNumericValue)(r)+(0,n.getNumericValue)(e)}}class w extends o.FlowGraphBinaryOperationBlock{constructor(r){super((0,e.getRichTypeByFlowGraphType)(r?.type),(0,e.getRichTypeByFlowGraphType)(r?.type),(0,e.getRichTypeByFlowGraphType)(r?.type),(r,e)=>this._polymorphicSubtract(r,e),"FlowGraphSubtractBlock",r)}_polymorphicSubtract(r,e){let o=(0,n._GetClassNameOf)(r),a=(0,n._GetClassNameOf)(e);if((0,n._AreSameVectorOrQuaternionClass)(o,a)||(0,n._AreSameIntegerClass)(o,a)||(0,n._AreSameMatrixClass)(o,a))return r.subtract(e);if("Quaternion"===o||"Vector4"===a)return new l.Vector4(r.x,r.y,r.z,r.w).subtractInPlace(e);if("Vector4"===o||"Quaternion"===a)return r.subtract(e);if(this.config?.preventIntegerFloatArithmetic&&typeof r!=typeof e)throw Error("Cannot add different types of numbers.");return(0,n.getNumericValue)(r)-(0,n.getNumericValue)(e)}}class G extends o.FlowGraphBinaryOperationBlock{constructor(r){super((0,e.getRichTypeByFlowGraphType)(r?.type),(0,e.getRichTypeByFlowGraphType)(r?.type),(0,e.getRichTypeByFlowGraphType)(r?.type),(r,e)=>this._polymorphicMultiply(r,e),"FlowGraphMultiplyBlock",r)}_polymorphicMultiply(r,e){let o=(0,n._GetClassNameOf)(r),a=(0,n._GetClassNameOf)(e);if((0,n._AreSameVectorOrQuaternionClass)(o,a)||(0,n._AreSameIntegerClass)(o,a))return r.multiply(e);if("Quaternion"===o||"Vector4"===a)return new l.Vector4(r.x,r.y,r.z,r.w).multiplyInPlace(e);if("Vector4"===o||"Quaternion"===a)return r.multiply(e);if((0,n._AreSameMatrixClass)(o,a))if(!this.config?.useMatrixPerComponent)return e.multiply(r);else{let a=r.m;for(let r=0;r<a.length;r++)a[r]*=e.m[r];return"Matrix2D"===o?new h.FlowGraphMatrix2D(a):"Matrix3D"===o?new h.FlowGraphMatrix3D(a):l.Matrix.FromArray(a)}if(this.config?.preventIntegerFloatArithmetic&&typeof r!=typeof e)throw Error("Cannot add different types of numbers.");return(0,n.getNumericValue)(r)*(0,n.getNumericValue)(e)}}class F extends o.FlowGraphBinaryOperationBlock{constructor(r){super((0,e.getRichTypeByFlowGraphType)(r?.type),(0,e.getRichTypeByFlowGraphType)(r?.type),(0,e.getRichTypeByFlowGraphType)(r?.type),(r,e)=>this._polymorphicDivide(r,e),"FlowGraphDivideBlock",r)}_polymorphicDivide(r,e){let o=(0,n._GetClassNameOf)(r),a=(0,n._GetClassNameOf)(e);if((0,n._AreSameVectorOrQuaternionClass)(o,a)||(0,n._AreSameIntegerClass)(o,a))return r.divide(e);if("Quaternion"===o||"Quaternion"===a){let o=r.clone();return o.x/=e.x,o.y/=e.y,o.z/=e.z,o.w/=e.w,o}if("Quaternion"===o||"Vector4"===a)return new l.Vector4(r.x,r.y,r.z,r.w).divideInPlace(e);if("Vector4"===o||"Quaternion"===a)return r.divide(e);if((0,n._AreSameMatrixClass)(o,a))if(!this.config?.useMatrixPerComponent)return r.divide(e);else{let a=r.m;for(let r=0;r<a.length;r++)a[r]/=e.m[r];return"Matrix2D"===o?new h.FlowGraphMatrix2D(a):"Matrix3D"===o?new h.FlowGraphMatrix3D(a):l.Matrix.FromArray(a)}else{if(this.config?.preventIntegerFloatArithmetic&&typeof r!=typeof e)throw Error("Cannot add different types of numbers.");return(0,n.getNumericValue)(r)/(0,n.getNumericValue)(e)}}}class B extends t{constructor(r){super(e.RichTypeNumber,r=>this._random(r),"FlowGraphRandomBlock",r),this.min=this.registerDataInput("min",e.RichTypeNumber,r?.min??0),this.max=this.registerDataInput("max",e.RichTypeNumber,r?.max??1),r?.seed&&(this._seed=r.seed)}_isSeed(r=this._seed){return void 0!==r}_getRandomValue(){if(this._isSeed(this._seed)){let r=1e4*Math.sin(this._seed++);return r-Math.floor(r)}return Math.random()}_random(r){let e=this.min.getValue(r),o=this.max.getValue(r);return this._getRandomValue()*(o-e)+e}}class k extends t{constructor(r){super(e.RichTypeNumber,()=>Math.E,"FlowGraphEBlock",r)}}class m extends t{constructor(r){super(e.RichTypeNumber,()=>Math.PI,"FlowGraphPIBlock",r)}}class g extends t{constructor(r){super(e.RichTypeNumber,()=>1/0,"FlowGraphInfBlock",r)}}class R extends t{constructor(r){super(e.RichTypeNumber,()=>NaN,"FlowGraphNaNBlock",r)}}function T(r,e){switch((0,n._GetClassNameOf)(r)){case"FlowGraphInteger":return new i.FlowGraphInteger(e(r.value));case"Vector2":return new l.Vector2(e(r.x),e(r.y));case"Vector3":return new l.Vector3(e(r.x),e(r.y),e(r.z));case"Vector4":return new l.Vector4(e(r.x),e(r.y),e(r.z),e(r.w));case"Quaternion":return new l.Quaternion(e(r.x),e(r.y),e(r.z),e(r.w));case"Matrix":return l.Matrix.FromArray(r.m.map(e));case"Matrix2D":return new h.FlowGraphMatrix2D(r.m.map(e));case"Matrix3D":return new h.FlowGraphMatrix3D(r.m.map(e));default:return e(r)}}class d extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeNumber,e.RichTypeNumber,r=>this._polymorphicAbs(r),"FlowGraphAbsBlock",r)}_polymorphicAbs(r){return T(r,Math.abs)}}class _ extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeNumber,e.RichTypeNumber,r=>this._polymorphicSign(r),"FlowGraphSignBlock",r)}_polymorphicSign(r){return T(r,Math.sign)}}class x extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeNumber,e.RichTypeNumber,r=>this._polymorphicTrunc(r),"FlowGraphTruncBlock",r)}_polymorphicTrunc(r){return T(r,Math.trunc)}}class A extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeNumber,e.RichTypeNumber,r=>this._polymorphicFloor(r),"FlowGraphFloorBlock",r)}_polymorphicFloor(r){return T(r,Math.floor)}}class f extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,r=>this._polymorphicCeiling(r),"FlowGraphCeilBlock",r)}_polymorphicCeiling(r){return T(r,Math.ceil)}}class C extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,r=>this._polymorphicRound(r),"FlowGraphRoundBlock",r)}_polymorphicRound(r){return T(r,r=>r<0&&this.config?.roundHalfAwayFromZero?-Math.round(-r):Math.round(r))}}class N extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,r=>this._polymorphicFraction(r),"FlowGraphFractBlock",r)}_polymorphicFraction(r){return T(r,r=>r-Math.floor(r))}}class O extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,r=>this._polymorphicNeg(r),"FlowGraphNegationBlock",r)}_polymorphicNeg(r){return T(r,r=>-r)}}function M(r,e,o){switch((0,n._GetClassNameOf)(r)){case"FlowGraphInteger":return new i.FlowGraphInteger(o(r.value,e.value));case"Vector2":return new l.Vector2(o(r.x,e.x),o(r.y,e.y));case"Vector3":return new l.Vector3(o(r.x,e.x),o(r.y,e.y),o(r.z,e.z));case"Vector4":return new l.Vector4(o(r.x,e.x),o(r.y,e.y),o(r.z,e.z),o(r.w,e.w));case"Quaternion":return new l.Quaternion(o(r.x,e.x),o(r.y,e.y),o(r.z,e.z),o(r.w,e.w));case"Matrix":return l.Matrix.FromArray(r.m.map((r,a)=>o(r,e.m[a])));case"Matrix2D":return new h.FlowGraphMatrix2D(r.m.map((r,a)=>o(r,e.m[a])));case"Matrix3D":return new h.FlowGraphMatrix3D(r.m.map((r,a)=>o(r,e.m[a])));default:return o((0,n.getNumericValue)(r),(0,n.getNumericValue)(e))}}class b extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeAny,(r,e)=>this._polymorphicRemainder(r,e),"FlowGraphModuloBlock",r)}_polymorphicRemainder(r,e){return M(r,e,(r,e)=>r%e)}}class I extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeAny,(r,e)=>this._polymorphicMin(r,e),"FlowGraphMinBlock",r)}_polymorphicMin(r,e){return M(r,e,Math.min)}}class V extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeAny,(r,e)=>this._polymorphicMax(r,e),"FlowGraphMaxBlock",r)}_polymorphicMax(r,e){return M(r,e,Math.max)}}function S(r,e,o){return Math.min(Math.max(r,Math.min(e,o)),Math.max(e,o))}function v(r,e,o,a){switch((0,n._GetClassNameOf)(r)){case"FlowGraphInteger":return new i.FlowGraphInteger(a(r.value,e.value,o.value));case"Vector2":return new l.Vector2(a(r.x,e.x,o.x),a(r.y,e.y,o.y));case"Vector3":return new l.Vector3(a(r.x,e.x,o.x),a(r.y,e.y,o.y),a(r.z,e.z,o.z));case"Vector4":return new l.Vector4(a(r.x,e.x,o.x),a(r.y,e.y,o.y),a(r.z,e.z,o.z),a(r.w,e.w,o.w));case"Quaternion":return new l.Quaternion(a(r.x,e.x,o.x),a(r.y,e.y,o.y),a(r.z,e.z,o.z),a(r.w,e.w,o.w));case"Matrix":return l.Matrix.FromArray(r.m.map((r,t)=>a(r,e.m[t],o.m[t])));case"Matrix2D":return new h.FlowGraphMatrix2D(r.m.map((r,t)=>a(r,e.m[t],o.m[t])));case"Matrix3D":return new h.FlowGraphMatrix3D(r.m.map((r,t)=>a(r,e.m[t],o.m[t])));default:return a((0,n.getNumericValue)(r),(0,n.getNumericValue)(e),(0,n.getNumericValue)(o))}}class D extends s{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeAny,e.RichTypeAny,(r,e,o)=>this._polymorphicClamp(r,e,o),"FlowGraphClampBlock",r)}_polymorphicClamp(r,e,o){return v(r,e,o,S)}}function E(r){return Math.min(Math.max(r,0),1)}class L extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,r=>this._polymorphicSaturate(r),"FlowGraphSaturateBlock",r)}_polymorphicSaturate(r){return T(r,E)}}function U(r,e,o){return(1-o)*r+o*e}class q extends s{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeAny,e.RichTypeAny,(r,e,o)=>this._polymorphicInterpolate(r,e,o),"FlowGraphMathInterpolationBlock",r)}_polymorphicInterpolate(r,e,o){return v(r,e,o,U)}}class z extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeBoolean,(r,e)=>this._polymorphicEq(r,e),"FlowGraphEqualityBlock",r)}_polymorphicEq(r,e){let o=(0,n._GetClassNameOf)(r),a=(0,n._GetClassNameOf)(e);return typeof r==typeof e&&((0,n._AreSameVectorOrQuaternionClass)(o,a)||(0,n._AreSameMatrixClass)(o,a)||(0,n._AreSameIntegerClass)(o,a)?r.equals(e):r===e)}}function P(r,e,o){if((0,n.isNumeric)(r)&&(0,n.isNumeric)(e))return o((0,n.getNumericValue)(r),(0,n.getNumericValue)(e));throw Error(`Cannot compare ${r} and ${e}`)}class Q extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeBoolean,(r,e)=>this._polymorphicLessThan(r,e),"FlowGraphLessThanBlock",r)}_polymorphicLessThan(r,e){return P(r,e,(r,e)=>r<e)}}class $ extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeBoolean,(r,e)=>this._polymorphicLessThanOrEqual(r,e),"FlowGraphLessThanOrEqualBlock",r)}_polymorphicLessThanOrEqual(r,e){return P(r,e,(r,e)=>r<=e)}}class Z extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeBoolean,(r,e)=>this._polymorphicGreaterThan(r,e),"FlowGraphGreaterThanBlock",r)}_polymorphicGreaterThan(r,e){return P(r,e,(r,e)=>r>e)}}class j extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeBoolean,(r,e)=>this._polymorphicGreaterThanOrEqual(r,e),"FlowGraphGreaterThanOrEqualBlock",r)}_polymorphicGreaterThanOrEqual(r,e){return P(r,e,(r,e)=>r>=e)}}class X extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeBoolean,r=>this._polymorphicIsNan(r),"FlowGraphIsNaNBlock",r)}_polymorphicIsNan(r){if((0,n.isNumeric)(r,!0))return isNaN((0,n.getNumericValue)(r));throw Error(`Cannot get NaN of ${r}`)}}class K extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeBoolean,r=>this._polymorphicIsInf(r),"FlowGraphIsInfBlock",r)}_polymorphicIsInf(r){if((0,n.isNumeric)(r))return!isFinite((0,n.getNumericValue)(r));throw Error(`Cannot get isInf of ${r}`)}}class H extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,r=>this._polymorphicDegToRad(r),"FlowGraphDegToRadBlock",r)}_degToRad(r){return r*Math.PI/180}_polymorphicDegToRad(r){return T(r,this._degToRad)}}class J extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,r=>this._polymorphicRadToDeg(r),"FlowGraphRadToDegBlock",r)}_radToDeg(r){return 180*r/Math.PI}_polymorphicRadToDeg(r){return T(r,this._radToDeg)}}class W extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeNumber,e.RichTypeNumber,r=>this._polymorphicSin(r),"FlowGraphSinBlock",r)}_polymorphicSin(r){return T(r,Math.sin)}}class Y extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeNumber,e.RichTypeNumber,r=>this._polymorphicCos(r),"FlowGraphCosBlock",r)}_polymorphicCos(r){return T(r,Math.cos)}}class rr extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeNumber,e.RichTypeNumber,r=>this._polymorphicTan(r),"FlowGraphTanBlock",r)}_polymorphicTan(r){return T(r,Math.tan)}}class re extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeNumber,e.RichTypeNumber,r=>this._polymorphicAsin(r),"FlowGraphASinBlock",r)}_polymorphicAsin(r){return T(r,Math.asin)}}class ro extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeNumber,e.RichTypeNumber,r=>this._polymorphicAcos(r),"FlowGraphACosBlock",r)}_polymorphicAcos(r){return T(r,Math.acos)}}class ra extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeNumber,e.RichTypeNumber,r=>this._polymorphicAtan(r),"FlowGraphATanBlock",r)}_polymorphicAtan(r){return T(r,Math.atan)}}class rt extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,e.RichTypeAny,(r,e)=>this._polymorphicAtan2(r,e),"FlowGraphATan2Block",r)}_polymorphicAtan2(r,e){return M(r,e,Math.atan2)}}class rl extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,r=>this._polymorphicSinh(r),"FlowGraphSinhBlock",r)}_polymorphicSinh(r){return T(r,Math.sinh)}}class rp extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,r=>this._polymorphicCosh(r),"FlowGraphCoshBlock",r)}_polymorphicCosh(r){return T(r,Math.cosh)}}class rc extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeAny,r=>this._polymorphicTanh(r),"FlowGraphTanhBlock",r)}_polymorphicTanh(r){return T(r,Math.tanh)}}class rs extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeNumber,r=>this._polymorphicAsinh(r),"FlowGraphASinhBlock",r)}_polymorphicAsinh(r){return T(r,Math.asinh)}}class ri extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeNumber,r=>this._polymorphicAcosh(r),"FlowGraphACoshBlock",r)}_polymorphicAcosh(r){return T(r,Math.acosh)}}class rh extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeNumber,r=>this._polymorphicAtanh(r),"FlowGraphATanhBlock",r)}_polymorphicAtanh(r){return T(r,Math.atanh)}}class rn extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeNumber,r=>this._polymorphicExp(r),"FlowGraphExponentialBlock",r)}_polymorphicExp(r){return T(r,Math.exp)}}class ru extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeNumber,r=>this._polymorphicLog(r),"FlowGraphLogBlock",r)}_polymorphicLog(r){return T(r,Math.log)}}class ry extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeNumber,r=>this._polymorphicLog2(r),"FlowGraphLog2Block",r)}_polymorphicLog2(r){return T(r,Math.log2)}}class rw extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeNumber,r=>this._polymorphicLog10(r),"FlowGraphLog10Block",r)}_polymorphicLog10(r){return T(r,Math.log10)}}class rG extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeNumber,r=>this._polymorphicSqrt(r),"FlowGraphSquareRootBlock",r)}_polymorphicSqrt(r){return T(r,Math.sqrt)}}class rF extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeNumber,r=>this._polymorphicCubeRoot(r),"FlowGraphCubeRootBlock",r)}_polymorphicCubeRoot(r){return T(r,Math.cbrt)}}class rB extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeAny,e.RichTypeNumber,e.RichTypeNumber,(r,e)=>this._polymorphicPow(r,e),"FlowGraphPowerBlock",r)}_polymorphicPow(r,e){return M(r,e,Math.pow)}}class rk extends p.FlowGraphUnaryOperationBlock{constructor(r){super((0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),(0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),r=>"boolean"==typeof r?!r:"number"==typeof r?~r:new i.FlowGraphInteger(~r.value),"FlowGraphBitwiseNotBlock",r)}}class rm extends o.FlowGraphBinaryOperationBlock{constructor(r){super((0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),(0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),(0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),(r,e)=>{if("boolean"==typeof r&&"boolean"==typeof e)return r&&e;if("number"==typeof r&&"number"==typeof e)return r&e;if("object"==typeof r&&"object"==typeof e)return new i.FlowGraphInteger(r.value&e.value);throw Error(`Cannot perform bitwise AND on ${r} and ${e}`)},"FlowGraphBitwiseAndBlock",r)}}class rg extends o.FlowGraphBinaryOperationBlock{constructor(r){super((0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),(0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),(0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),(r,e)=>{if("boolean"==typeof r&&"boolean"==typeof e)return r||e;if("number"==typeof r&&"number"==typeof e)return r|e;if("object"==typeof r&&"object"==typeof e)return new i.FlowGraphInteger(r.value|e.value);throw Error(`Cannot perform bitwise OR on ${r} and ${e}`)},"FlowGraphBitwiseOrBlock",r)}}class rR extends o.FlowGraphBinaryOperationBlock{constructor(r){super((0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),(0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),(0,e.getRichTypeByFlowGraphType)(r?.valueType||"FlowGraphInteger"),(r,e)=>{if("boolean"==typeof r&&"boolean"==typeof e)return r!==e;if("number"==typeof r&&"number"==typeof e)return r^e;if("object"==typeof r&&"object"==typeof e)return new i.FlowGraphInteger(r.value^e.value);throw Error(`Cannot perform bitwise XOR on ${r} and ${e}`)},"FlowGraphBitwiseXorBlock",r)}}class rT extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeFlowGraphInteger,e.RichTypeFlowGraphInteger,e.RichTypeFlowGraphInteger,(r,e)=>new i.FlowGraphInteger(r.value<<e.value),"FlowGraphBitwiseLeftShiftBlock",r)}}class rd extends o.FlowGraphBinaryOperationBlock{constructor(r){super(e.RichTypeFlowGraphInteger,e.RichTypeFlowGraphInteger,e.RichTypeFlowGraphInteger,(r,e)=>new i.FlowGraphInteger(r.value>>e.value),"FlowGraphBitwiseRightShiftBlock",r)}}class r_ extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeFlowGraphInteger,e.RichTypeFlowGraphInteger,r=>new i.FlowGraphInteger(Math.clz32(r.value)),"FlowGraphLeadingZerosBlock",r)}}class rx extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeFlowGraphInteger,e.RichTypeFlowGraphInteger,r=>new i.FlowGraphInteger(r.value?31-Math.clz32(r.value&-r.value):32),"FlowGraphTrailingZerosBlock",r)}}class rA extends p.FlowGraphUnaryOperationBlock{constructor(r){super(e.RichTypeFlowGraphInteger,e.RichTypeFlowGraphInteger,r=>new i.FlowGraphInteger(function(r){let e=0;for(;r;)e+=1&r,r>>=1;return e}(r.value)),"FlowGraphOneBitsCounterBlock",r)}}let rf=!1;function rC(){rf||(rf=!0,(0,u.RegisterClass)("FlowGraphAddBlock",y),(0,u.RegisterClass)("FlowGraphSubtractBlock",w),(0,u.RegisterClass)("FlowGraphMultiplyBlock",G),(0,u.RegisterClass)("FlowGraphDivideBlock",F),(0,u.RegisterClass)("FlowGraphRandomBlock",B),(0,u.RegisterClass)("FlowGraphEBlock",k),(0,u.RegisterClass)("FlowGraphPIBlock",m),(0,u.RegisterClass)("FlowGraphInfBlock",g),(0,u.RegisterClass)("FlowGraphNaNBlock",R),(0,u.RegisterClass)("FlowGraphAbsBlock",d),(0,u.RegisterClass)("FlowGraphSignBlock",_),(0,u.RegisterClass)("FlowGraphTruncBlock",x),(0,u.RegisterClass)("FlowGraphFloorBlock",A),(0,u.RegisterClass)("FlowGraphCeilBlock",f),(0,u.RegisterClass)("FlowGraphRoundBlock",C),(0,u.RegisterClass)("FlowGraphFractBlock",N),(0,u.RegisterClass)("FlowGraphNegationBlock",O),(0,u.RegisterClass)("FlowGraphModuloBlock",b),(0,u.RegisterClass)("FlowGraphMinBlock",I),(0,u.RegisterClass)("FlowGraphMaxBlock",V),(0,u.RegisterClass)("FlowGraphClampBlock",D),(0,u.RegisterClass)("FlowGraphSaturateBlock",L),(0,u.RegisterClass)("FlowGraphMathInterpolationBlock",q),(0,u.RegisterClass)("FlowGraphEqualityBlock",z),(0,u.RegisterClass)("FlowGraphLessThanBlock",Q),(0,u.RegisterClass)("FlowGraphLessThanOrEqualBlock",$),(0,u.RegisterClass)("FlowGraphGreaterThanBlock",Z),(0,u.RegisterClass)("FlowGraphGreaterThanOrEqualBlock",j),(0,u.RegisterClass)("FlowGraphIsNaNBlock",X),(0,u.RegisterClass)("FlowGraphIsInfBlock",K),(0,u.RegisterClass)("FlowGraphDegToRadBlock",H),(0,u.RegisterClass)("FlowGraphRadToDegBlock",J),(0,u.RegisterClass)("FlowGraphASinBlock",re),(0,u.RegisterClass)("FlowGraphACosBlock",ro),(0,u.RegisterClass)("FlowGraphATanBlock",ra),(0,u.RegisterClass)("FlowGraphATan2Block",rt),(0,u.RegisterClass)("FlowGraphSinhBlock",rl),(0,u.RegisterClass)("FlowGraphCoshBlock",rp),(0,u.RegisterClass)("FlowGraphTanhBlock",rc),(0,u.RegisterClass)("FlowGraphASinhBlock",rs),(0,u.RegisterClass)("FlowGraphACoshBlock",ri),(0,u.RegisterClass)("FlowGraphATanhBlock",rh),(0,u.RegisterClass)("FlowGraphExponentialBlock",rn),(0,u.RegisterClass)("FlowGraphLogBlock",ru),(0,u.RegisterClass)("FlowGraphLog2Block",ry),(0,u.RegisterClass)("FlowGraphLog10Block",rw),(0,u.RegisterClass)("FlowGraphSquareRootBlock",rG),(0,u.RegisterClass)("FlowGraphCubeRootBlock",rF),(0,u.RegisterClass)("FlowGraphPowerBlock",rB),(0,u.RegisterClass)("FlowGraphBitwiseNotBlock",rk),(0,u.RegisterClass)("FlowGraphBitwiseAndBlock",rm),(0,u.RegisterClass)("FlowGraphBitwiseOrBlock",rg),(0,u.RegisterClass)("FlowGraphBitwiseXorBlock",rR),(0,u.RegisterClass)("FlowGraphBitwiseLeftShiftBlock",rT),(0,u.RegisterClass)("FlowGraphBitwiseRightShiftBlock",rd),(0,u.RegisterClass)("FlowGraphLeadingZerosBlock",r_),(0,u.RegisterClass)("FlowGraphTrailingZerosBlock",rx),(0,u.RegisterClass)("FlowGraphOneBitsCounterBlock",rA))}r.s(["FlowGraphAbsBlock",0,d,"FlowGraphAcosBlock",0,ro,"FlowGraphAcoshBlock",0,ri,"FlowGraphAddBlock",0,y,"FlowGraphAsinBlock",0,re,"FlowGraphAsinhBlock",0,rs,"FlowGraphAtan2Block",0,rt,"FlowGraphAtanBlock",0,ra,"FlowGraphAtanhBlock",0,rh,"FlowGraphBitwiseAndBlock",0,rm,"FlowGraphBitwiseLeftShiftBlock",0,rT,"FlowGraphBitwiseNotBlock",0,rk,"FlowGraphBitwiseOrBlock",0,rg,"FlowGraphBitwiseRightShiftBlock",0,rd,"FlowGraphBitwiseXorBlock",0,rR,"FlowGraphCeilBlock",0,f,"FlowGraphClampBlock",0,D,"FlowGraphCosBlock",0,Y,"FlowGraphCoshBlock",0,rp,"FlowGraphCubeRootBlock",0,rF,"FlowGraphDegToRadBlock",0,H,"FlowGraphDivideBlock",0,F,"FlowGraphEBlock",0,k,"FlowGraphEqualityBlock",0,z,"FlowGraphExpBlock",0,rn,"FlowGraphFloorBlock",0,A,"FlowGraphFractionBlock",0,N,"FlowGraphGreaterThanBlock",0,Z,"FlowGraphGreaterThanOrEqualBlock",0,j,"FlowGraphInfBlock",0,g,"FlowGraphIsInfinityBlock",0,K,"FlowGraphIsNanBlock",0,X,"FlowGraphLeadingZerosBlock",0,r_,"FlowGraphLessThanBlock",0,Q,"FlowGraphLessThanOrEqualBlock",0,$,"FlowGraphLog10Block",0,rw,"FlowGraphLog2Block",0,ry,"FlowGraphLogBlock",0,ru,"FlowGraphMathInterpolationBlock",0,q,"FlowGraphMaxBlock",0,V,"FlowGraphMinBlock",0,I,"FlowGraphModuloBlock",0,b,"FlowGraphMultiplyBlock",0,G,"FlowGraphNaNBlock",0,R,"FlowGraphNegationBlock",0,O,"FlowGraphOneBitsCounterBlock",0,rA,"FlowGraphPiBlock",0,m,"FlowGraphPowerBlock",0,rB,"FlowGraphRadToDegBlock",0,J,"FlowGraphRandomBlock",0,B,"FlowGraphRoundBlock",0,C,"FlowGraphSaturateBlock",0,L,"FlowGraphSignBlock",0,_,"FlowGraphSinBlock",0,W,"FlowGraphSinhBlock",0,rl,"FlowGraphSquareRootBlock",0,rG,"FlowGraphSubtractBlock",0,w,"FlowGraphTanBlock",0,rr,"FlowGraphTanhBlock",0,rc,"FlowGraphTrailingZerosBlock",0,rx,"FlowGraphTruncBlock",0,x,"RegisterFlowGraphMathBlocks",0,rC],64245),rC(),r.s([],85729),r.i(85729),r.i(64245),r.s(["FlowGraphAbsBlock",0,d,"FlowGraphAcosBlock",0,ro,"FlowGraphAcoshBlock",0,ri,"FlowGraphAddBlock",0,y,"FlowGraphAsinBlock",0,re,"FlowGraphAsinhBlock",0,rs,"FlowGraphAtan2Block",0,rt,"FlowGraphAtanBlock",0,ra,"FlowGraphAtanhBlock",0,rh,"FlowGraphBitwiseAndBlock",0,rm,"FlowGraphBitwiseLeftShiftBlock",0,rT,"FlowGraphBitwiseNotBlock",0,rk,"FlowGraphBitwiseOrBlock",0,rg,"FlowGraphBitwiseRightShiftBlock",0,rd,"FlowGraphBitwiseXorBlock",0,rR,"FlowGraphCeilBlock",0,f,"FlowGraphClampBlock",0,D,"FlowGraphCosBlock",0,Y,"FlowGraphCoshBlock",0,rp,"FlowGraphCubeRootBlock",0,rF,"FlowGraphDegToRadBlock",0,H,"FlowGraphDivideBlock",0,F,"FlowGraphEBlock",0,k,"FlowGraphEqualityBlock",0,z,"FlowGraphExpBlock",0,rn,"FlowGraphFloorBlock",0,A,"FlowGraphFractionBlock",0,N,"FlowGraphGreaterThanBlock",0,Z,"FlowGraphGreaterThanOrEqualBlock",0,j,"FlowGraphInfBlock",0,g,"FlowGraphIsInfinityBlock",0,K,"FlowGraphIsNanBlock",0,X,"FlowGraphLeadingZerosBlock",0,r_,"FlowGraphLessThanBlock",0,Q,"FlowGraphLessThanOrEqualBlock",0,$,"FlowGraphLog10Block",0,rw,"FlowGraphLog2Block",0,ry,"FlowGraphLogBlock",0,ru,"FlowGraphMathInterpolationBlock",0,q,"FlowGraphMaxBlock",0,V,"FlowGraphMinBlock",0,I,"FlowGraphModuloBlock",0,b,"FlowGraphMultiplyBlock",0,G,"FlowGraphNaNBlock",0,R,"FlowGraphNegationBlock",0,O,"FlowGraphOneBitsCounterBlock",0,rA,"FlowGraphPiBlock",0,m,"FlowGraphPowerBlock",0,rB,"FlowGraphRadToDegBlock",0,J,"FlowGraphRandomBlock",0,B,"FlowGraphRoundBlock",0,C,"FlowGraphSaturateBlock",0,L,"FlowGraphSignBlock",0,_,"FlowGraphSinBlock",0,W,"FlowGraphSinhBlock",0,rl,"FlowGraphSquareRootBlock",0,rG,"FlowGraphSubtractBlock",0,w,"FlowGraphTanBlock",0,rr,"FlowGraphTanhBlock",0,rc,"FlowGraphTrailingZerosBlock",0,rx,"FlowGraphTruncBlock",0,x],25620)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33855,21823,t=>{"use strict";var e=t.i(13379),r=t.i(65740);class i{constructor(t,e,r=!1,i,f=!1,s){this._uniformNames=[],this._valueCache={},this._engine=t,this._noUBO=!t.supportsUniformBuffers||f,this._dynamic=r,this._name=i??"no-name",this._data=e||[],this._uniformLocations={},this._uniformSizes={},this._uniformArraySizes={},this._uniformLocationPointer=0,this._needSync=!1,this._trackUBOsInFrame=!1,(void 0===s&&this._engine._features.trackUbosInFrame||!0===s)&&(this._buffers=[],this._bufferIndex=-1,this._bufferUpdatedLastFrame=!1,this._createBufferOnWrite=!1,this._currentFrameId=0,this._trackUBOsInFrame=!0),this._noUBO?(this.updateMatrix3x3=this._updateMatrix3x3ForEffect,this.updateMatrix2x2=this._updateMatrix2x2ForEffect,this.updateFloat=this._updateFloatForEffect,this.updateFloat2=this._updateFloat2ForEffect,this.updateFloat3=this._updateFloat3ForEffect,this.updateFloat4=this._updateFloat4ForEffect,this.updateFloatArray=this._updateFloatArrayForEffect,this.updateArray=this._updateArrayForEffect,this.updateIntArray=this._updateIntArrayForEffect,this.updateUIntArray=this._updateUIntArrayForEffect,this.updateMatrix=this._updateMatrixForEffect,this.updateMatrices=this._updateMatricesForEffect,this.updateVector3=this._updateVector3ForEffect,this.updateVector4=this._updateVector4ForEffect,this.updateColor3=this._updateColor3ForEffect,this.updateColor4=this._updateColor4ForEffect,this.updateDirectColor4=this._updateDirectColor4ForEffect,this.updateInt=this._updateIntForEffect,this.updateInt2=this._updateInt2ForEffect,this.updateInt3=this._updateInt3ForEffect,this.updateInt4=this._updateInt4ForEffect,this.updateUInt=this._updateUIntForEffect,this.updateUInt2=this._updateUInt2ForEffect,this.updateUInt3=this._updateUInt3ForEffect,this.updateUInt4=this._updateUInt4ForEffect):(this._engine._uniformBuffers.push(this),this.updateMatrix3x3=this._updateMatrix3x3ForUniform,this.updateMatrix2x2=this._updateMatrix2x2ForUniform,this.updateFloat=this._updateFloatForUniform,this.updateFloat2=this._updateFloat2ForUniform,this.updateFloat3=this._updateFloat3ForUniform,this.updateFloat4=this._updateFloat4ForUniform,this.updateFloatArray=this._updateFloatArrayForUniform,this.updateArray=this._updateArrayForUniform,this.updateIntArray=this._updateIntArrayForUniform,this.updateUIntArray=this._updateUIntArrayForUniform,this.updateMatrix=this._updateMatrixForUniform,this.updateMatrices=this._updateMatricesForUniform,this.updateVector3=this._updateVector3ForUniform,this.updateVector4=this._updateVector4ForUniform,this.updateColor3=this._updateColor3ForUniform,this.updateColor4=this._updateColor4ForUniform,this.updateDirectColor4=this._updateDirectColor4ForUniform,this.updateInt=this._updateIntForUniform,this.updateInt2=this._updateInt2ForUniform,this.updateInt3=this._updateInt3ForUniform,this.updateInt4=this._updateInt4ForUniform,this.updateUInt=this._updateUIntForUniform,this.updateUInt2=this._updateUInt2ForUniform,this.updateUInt3=this._updateUInt3ForUniform,this.updateUInt4=this._updateUInt4ForUniform)}get useUbo(){return!this._noUBO}get isSync(){return!this._needSync}isDynamic(){return this._dynamic}getData(){return this._bufferData}getBuffer(){return this._buffer}getUniformNames(){return this._uniformNames}_fillAlignment(t){let e;if(e=t<=2?t:4,this._uniformLocationPointer%e!=0){let t=this._uniformLocationPointer;this._uniformLocationPointer+=e-this._uniformLocationPointer%e;let r=this._uniformLocationPointer-t;for(let t=0;t<r;t++)this._data.push(0)}}addUniform(t,e,r=0){let i;if((r>0&&"number"==typeof e&&(this._uniformArraySizes[t]={strideSize:e,arraySize:r}),void 0===this._uniformLocations[t])&&(this._uniformNames.push(t),!this._noUBO)){if(r>0){if(e instanceof Array)throw"addUniform should not be use with Array in UBO: "+t;if(this._fillAlignment(4),16==e)e*=r;else{let t=4-e;e=e*r+t*r}i=[];for(let t=0;t<e;t++)i.push(0)}else{if(e instanceof Array)e=(i=e).length;else{i=[];for(let t=0;t<e;t++)i.push(0)}this._fillAlignment(e)}this._uniformSizes[t]=e,this._uniformLocations[t]=this._uniformLocationPointer,this._uniformLocationPointer+=e;for(let t=0;t<e;t++)this._data.push(i[t]);this._needSync=!0}}addMatrix(t,e){this.addUniform(t,Array.prototype.slice.call(e.asArray()))}addFloat2(t,e,r){this.addUniform(t,[e,r])}addFloat3(t,e,r,i){this.addUniform(t,[e,r,i])}addColor3(t,e){let r=[e.r,e.g,e.b];this.addUniform(t,r)}addColor4(t,e,r){let i=[e.r,e.g,e.b,r];this.addUniform(t,i)}addVector3(t,e){let r=[e.x,e.y,e.z];this.addUniform(t,r)}addMatrix3x3(t){this.addUniform(t,12)}addMatrix2x2(t){this.addUniform(t,8)}create(){this._noUBO||this._buffer||(this._fillAlignment(4),this._bufferData=new Float32Array(this._data),this._rebuild(),this._needSync=!0)}_getNamesDebug(){let t=[],e=0;for(let r in this._uniformLocations)if(t.push(r),10==++e)break;return t.join(",")}_rebuild(){!this._noUBO&&this._bufferData&&(this._dynamic?this._buffer=this._engine.createDynamicUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()):this._buffer=this._engine.createUniformBuffer(this._bufferData,this._name+"_UniformList:"+this._getNamesDebug()),this._trackUBOsInFrame&&(this._buffers.push([this._buffer,this._engine._features.checkUbosContentBeforeUpload?this._bufferData.slice():void 0]),this._bufferIndex=this._buffers.length-1,this._createBufferOnWrite=!1))}_rebuildAfterContextLost(){this._trackUBOsInFrame&&(this._buffers=[],this._currentFrameId=0),this._rebuild()}get _numBuffers(){return this._buffers.length}get _indexBuffer(){return this._bufferIndex}get name(){return this._name}set name(t){this._name=t}get currentEffect(){return this._currentEffect}_buffersEqual(t,e){for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}_copyBuffer(t,e){for(let r=0;r<t.length;++r)e[r]=t[r]}update(){if(!this._noUBO){if(this.bindUniformBuffer(),!this._buffer)return void this.create();if(!this._dynamic&&!this._needSync){this._createBufferOnWrite=this._trackUBOsInFrame;return}if(this._buffers&&this._buffers.length>1&&this._buffers[this._bufferIndex][1])if(this._buffersEqual(this._bufferData,this._buffers[this._bufferIndex][1])){this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame;return}else this._copyBuffer(this._bufferData,this._buffers[this._bufferIndex][1]);this._bufferUpdatedLastFrame=!0,this._engine.updateUniformBuffer(this._buffer,this._bufferData),this._needSync=!1,this._createBufferOnWrite=this._trackUBOsInFrame}}_createNewBuffer(){this._bufferIndex+1<this._buffers.length?(this._bufferIndex++,this._buffer=this._buffers[this._bufferIndex][0],this._createBufferOnWrite=!1,this._needSync=!0):this._rebuild()}_checkNewFrame(){this._trackUBOsInFrame&&this._currentFrameId!==this._engine.frameId&&(this._currentFrameId=this._engine.frameId,this._createBufferOnWrite=!1,this._buffers&&this._buffers.length>0?(1===this._buffers.length?this._needSync=!this._bufferUpdatedLastFrame:this._needSync=0!==this._bufferIndex,this._bufferIndex=0,this._buffer=this._buffers[this._bufferIndex][0]):this._bufferIndex=-1)}updateUniform(t,r,i){this._checkNewFrame();let f=this._uniformLocations[t];if(void 0===f){if(this._buffer)return void e.Logger.Error("Cannot add an uniform after UBO has been created. uniformName="+t);this.addUniform(t,i),f=this._uniformLocations[t]}if(this._buffer||this.create(),this._dynamic)for(let t=0;t<i;t++)this._bufferData[f+t]=r[t];else{let t=!1;for(let e=0;e<i;e++)(16!==i||this._engine._features.uniformBufferHardCheckMatrix)&&this._bufferData[f+e]===Math.fround(r[e])||(t=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[f+e]=r[e]);this._needSync=this._needSync||t}}updateUniformArray(t,i,f){this._checkNewFrame();let s=this._uniformLocations[t];if(void 0===s)return void e.Logger.Error("Cannot add an uniform Array dynamically. Please, add it using addUniform and make sure that uniform buffers are supported by the current engine.");this._buffer||this.create();let a=this._uniformArraySizes[t];if(this._dynamic)for(let t=0;t<f;t++)this._bufferData[s+t]=i[t];else{let t=!1,e=0,n=0;for(let u=0;u<f;u++)if(this._bufferData[s+4*n+e]!==r.Tools.FloatRound(i[u])&&(t=!0,this._createBufferOnWrite&&this._createNewBuffer(),this._bufferData[s+4*n+e]=i[u]),++e===a.strideSize){for(;e<4;e++)this._bufferData[s+4*n+e]=0;e=0,n++}this._needSync=this._needSync||t}}_cacheMatrix(t,e){this._checkNewFrame();let r=this._valueCache[t],i=e.updateFlag;return(void 0===r||r!==i)&&(this._valueCache[t]=i,!0)}_updateMatrix3x3ForUniform(t,e){for(let t=0;t<3;t++)i._TempBuffer[4*t]=e[3*t],i._TempBuffer[4*t+1]=e[3*t+1],i._TempBuffer[4*t+2]=e[3*t+2],i._TempBuffer[4*t+3]=0;this.updateUniform(t,i._TempBuffer,12)}_updateMatrix3x3ForEffect(t,e){this._currentEffect.setMatrix3x3(t,e)}_updateMatrix2x2ForEffect(t,e){this._currentEffect.setMatrix2x2(t,e)}_updateMatrix2x2ForUniform(t,e){for(let t=0;t<2;t++)i._TempBuffer[4*t]=e[2*t],i._TempBuffer[4*t+1]=e[2*t+1],i._TempBuffer[4*t+2]=0,i._TempBuffer[4*t+3]=0;this.updateUniform(t,i._TempBuffer,8)}_updateFloatForEffect(t,e,r=""){this._currentEffect.setFloat(t+r,e)}_updateFloatForUniform(t,e){i._TempBuffer[0]=e,this.updateUniform(t,i._TempBuffer,1)}_updateFloat2ForEffect(t,e,r,i=""){this._currentEffect.setFloat2(t+i,e,r)}_updateFloat2ForUniform(t,e,r){i._TempBuffer[0]=e,i._TempBuffer[1]=r,this.updateUniform(t,i._TempBuffer,2)}_updateFloat3ForEffect(t,e,r,i,f=""){this._currentEffect.setFloat3(t+f,e,r,i)}_updateFloat3ForUniform(t,e,r,f){i._TempBuffer[0]=e,i._TempBuffer[1]=r,i._TempBuffer[2]=f,this.updateUniform(t,i._TempBuffer,3)}_updateFloat4ForEffect(t,e,r,i,f,s=""){this._currentEffect.setFloat4(t+s,e,r,i,f)}_updateFloat4ForUniform(t,e,r,f,s){i._TempBuffer[0]=e,i._TempBuffer[1]=r,i._TempBuffer[2]=f,i._TempBuffer[3]=s,this.updateUniform(t,i._TempBuffer,4)}_updateFloatArrayForEffect(t,e,r=""){switch(this._uniformArraySizes[t]?.strideSize){case 2:this._currentEffect.setFloatArray2(t+r,e);break;case 3:this._currentEffect.setFloatArray3(t+r,e);break;case 4:this._currentEffect.setFloatArray4(t+r,e);break;default:this._currentEffect.setFloatArray(t+r,e)}}_updateFloatArrayForUniform(t,e){this.updateUniformArray(t,e,e.length)}_updateArrayForEffect(t,e){this._currentEffect.setArray(t,e)}_updateArrayForUniform(t,e){this.updateUniformArray(t,e,e.length)}_updateIntArrayForEffect(t,e){this._currentEffect.setIntArray(t,e)}_updateIntArrayForUniform(t,e){i._TempBufferInt32View.set(e),this.updateUniformArray(t,i._TempBuffer,e.length)}_updateUIntArrayForEffect(t,e){this._currentEffect.setUIntArray(t,e)}_updateUIntArrayForUniform(t,e){i._TempBufferUInt32View.set(e),this.updateUniformArray(t,i._TempBuffer,e.length)}_updateMatrixForEffect(t,e){this._currentEffect.setMatrix(t,e)}_updateMatrixForUniform(t,e){this._cacheMatrix(t,e)&&this.updateUniform(t,e.asArray(),16)}_updateMatricesForEffect(t,e){this._currentEffect.setMatrices(t,e)}_updateMatricesForUniform(t,e){this.updateUniform(t,e,e.length)}_updateVector3ForEffect(t,e){this._currentEffect.setVector3(t,e)}_updateVector3ForUniform(t,e){i._TempBuffer[0]=e.x,i._TempBuffer[1]=e.y,i._TempBuffer[2]=e.z,this.updateUniform(t,i._TempBuffer,3)}_updateVector4ForEffect(t,e){this._currentEffect.setVector4(t,e)}_updateVector4ForUniform(t,e){i._TempBuffer[0]=e.x,i._TempBuffer[1]=e.y,i._TempBuffer[2]=e.z,i._TempBuffer[3]=e.w,this.updateUniform(t,i._TempBuffer,4)}_updateColor3ForEffect(t,e,r=""){this._currentEffect.setColor3(t+r,e)}_updateColor3ForUniform(t,e){i._TempBuffer[0]=e.r,i._TempBuffer[1]=e.g,i._TempBuffer[2]=e.b,this.updateUniform(t,i._TempBuffer,3)}_updateColor4ForEffect(t,e,r,i=""){this._currentEffect.setColor4(t+i,e,r)}_updateDirectColor4ForEffect(t,e,r=""){this._currentEffect.setDirectColor4(t+r,e)}_updateColor4ForUniform(t,e,r){i._TempBuffer[0]=e.r,i._TempBuffer[1]=e.g,i._TempBuffer[2]=e.b,i._TempBuffer[3]=r,this.updateUniform(t,i._TempBuffer,4)}_updateDirectColor4ForUniform(t,e){i._TempBuffer[0]=e.r,i._TempBuffer[1]=e.g,i._TempBuffer[2]=e.b,i._TempBuffer[3]=e.a,this.updateUniform(t,i._TempBuffer,4)}_updateIntForEffect(t,e,r=""){this._currentEffect.setInt(t+r,e)}_updateIntForUniform(t,e){i._TempBufferInt32View[0]=e,this.updateUniform(t,i._TempBuffer,1)}_updateInt2ForEffect(t,e,r,i=""){this._currentEffect.setInt2(t+i,e,r)}_updateInt2ForUniform(t,e,r){i._TempBufferInt32View[0]=e,i._TempBufferInt32View[1]=r,this.updateUniform(t,i._TempBuffer,2)}_updateInt3ForEffect(t,e,r,i,f=""){this._currentEffect.setInt3(t+f,e,r,i)}_updateInt3ForUniform(t,e,r,f){i._TempBufferInt32View[0]=e,i._TempBufferInt32View[1]=r,i._TempBufferInt32View[2]=f,this.updateUniform(t,i._TempBuffer,3)}_updateInt4ForEffect(t,e,r,i,f,s=""){this._currentEffect.setInt4(t+s,e,r,i,f)}_updateInt4ForUniform(t,e,r,f,s){i._TempBufferInt32View[0]=e,i._TempBufferInt32View[1]=r,i._TempBufferInt32View[2]=f,i._TempBufferInt32View[3]=s,this.updateUniform(t,i._TempBuffer,4)}_updateUIntForEffect(t,e,r=""){this._currentEffect.setUInt(t+r,e)}_updateUIntForUniform(t,e){i._TempBufferUInt32View[0]=e,this.updateUniform(t,i._TempBuffer,1)}_updateUInt2ForEffect(t,e,r,i=""){this._currentEffect.setUInt2(t+i,e,r)}_updateUInt2ForUniform(t,e,r){i._TempBufferUInt32View[0]=e,i._TempBufferUInt32View[1]=r,this.updateUniform(t,i._TempBuffer,2)}_updateUInt3ForEffect(t,e,r,i,f=""){this._currentEffect.setUInt3(t+f,e,r,i)}_updateUInt3ForUniform(t,e,r,f){i._TempBufferUInt32View[0]=e,i._TempBufferUInt32View[1]=r,i._TempBufferUInt32View[2]=f,this.updateUniform(t,i._TempBuffer,3)}_updateUInt4ForEffect(t,e,r,i,f,s=""){this._currentEffect.setUInt4(t+s,e,r,i,f)}_updateUInt4ForUniform(t,e,r,f,s){i._TempBufferUInt32View[0]=e,i._TempBufferUInt32View[1]=r,i._TempBufferUInt32View[2]=f,i._TempBufferUInt32View[3]=s,this.updateUniform(t,i._TempBuffer,4)}setTexture(t,e){this._currentEffect.setTexture(t,e)}setTextureArray(t,e){this._currentEffect.setTextureArray(t,e)}bindTexture(t,e){this._currentEffect._bindTexture(t,e)}updateUniformDirectly(t,e){this.updateUniform(t,e,e.length),this.update()}bindToEffect(t,e){this._currentEffect=t,this._currentEffectName=e}bindUniformBuffer(){!this._noUBO&&this._buffer&&this._currentEffect&&this._currentEffect.bindUniformBuffer(this._buffer,this._currentEffectName)}unbindEffect(){this._currentEffect=void 0,this._currentEffectName=void 0}setDataBuffer(t){if(!this._buffers)return this._buffer===t;for(let e=0;e<this._buffers.length;++e)if(this._buffers[e][0]===t)return this._bufferIndex=e,this._buffer=t,this._createBufferOnWrite=!1,this._currentEffect=void 0,this._buffers.length>1&&this._buffers[e][1]&&this._bufferData.set(this._buffers[e][1]),this._valueCache={},this._currentFrameId=this._engine.frameId,!0;return!1}has(t){return void 0!==this._uniformLocations[t]}dispose(){if(this._noUBO)return;let t=this._engine._uniformBuffers,e=t.indexOf(this);if(-1!==e&&(t[e]=t[t.length-1],t.pop()),this._trackUBOsInFrame&&this._buffers)for(let t=0;t<this._buffers.length;++t){let e=this._buffers[t][0];this._engine._releaseBuffer(e)}else this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._buffer=null)}}i._MAX_UNIFORM_SIZE=256,i._TempBuffer=new Float32Array(i._MAX_UNIFORM_SIZE),i._TempBufferInt32View=new Int32Array(i._TempBuffer.buffer),i._TempBufferUInt32View=new Uint32Array(i._TempBuffer.buffer),t.s(["UniformBuffer",0,i],33855);class f{static CompareLightsPriority(t,e){return t.shadowEnabled!==e.shadowEnabled?!!e.shadowEnabled-!!t.shadowEnabled:e.renderPriority-t.renderPriority}}f.FALLOFF_DEFAULT=0,f.FALLOFF_PHYSICAL=1,f.FALLOFF_GLTF=2,f.FALLOFF_STANDARD=3,f.LIGHTMAP_DEFAULT=0,f.LIGHTMAP_SPECULAR=1,f.LIGHTMAP_SHADOWSONLY=2,f.INTENSITYMODE_AUTOMATIC=0,f.INTENSITYMODE_LUMINOUSPOWER=1,f.INTENSITYMODE_LUMINOUSINTENSITY=2,f.INTENSITYMODE_ILLUMINANCE=3,f.INTENSITYMODE_LUMINANCE=4,f.LIGHTTYPEID_POINTLIGHT=0,f.LIGHTTYPEID_DIRECTIONALLIGHT=1,f.LIGHTTYPEID_SPOTLIGHT=2,f.LIGHTTYPEID_HEMISPHERICLIGHT=3,f.LIGHTTYPEID_RECT_AREALIGHT=4,f.LIGHTTYPEID_CLUSTERED_CONTAINER=5,t.s(["LightConstants",0,f],21823)},55069,t=>{"use strict";var e=t.i(71379);let r=!1;t.s(["RegisterEngineDynamicBuffer",0,function(){r||(r=!0,e.ThinEngine.prototype.updateDynamicIndexBuffer=function(t,e,r=0){let i;this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER]=null,this.bindIndexBuffer(t),i=t.is32Bits?e instanceof Uint32Array?e:new Uint32Array(e):e instanceof Uint16Array?e:new Uint16Array(e),this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,i,this._gl.DYNAMIC_DRAW),this._resetIndexBufferBinding()},e.ThinEngine.prototype.updateDynamicVertexBuffer=function(t,e,r,i){this.bindArrayBuffer(t),void 0===r&&(r=0);let f=e.byteLength||e.length;void 0===i||i>=f&&0===r?e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,new Float32Array(e)):this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,e):e instanceof Array?this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,new Float32Array(e).subarray(0,i/4)):(e=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,i):new Uint8Array(e,0,i),this._gl.bufferSubData(this._gl.ARRAY_BUFFER,r,e)),this._resetVertexBufferBinding()})}])},35407,t=>{"use strict";var e=t.i(24574),r=t.i(13379),i=t.i(38118),f=t.i(55069),s=t.i(75405);class a{get isDisposed(){return this._isDisposed}constructor(t,r,i,s=0,a=!1,n=!1,u=!1,_,o){this._isAlreadyOwned=!1,this._isDisposed=!1,(0,f.RegisterEngineDynamicBuffer)(),t&&t.getScene?this._engine=t.getScene().getEngine():this._engine=t,this._updatable=i,this._instanced=n,this._divisor=_||1,this._label=o,r instanceof e.DataBuffer?(this._data=null,this._buffer=r):(this._data=r,this._buffer=null),this.byteStride=u?s:s*Float32Array.BYTES_PER_ELEMENT,a||this.create()}createVertexBuffer(t,e,r,i,f,s=!1,a){let u=s?e:e*Float32Array.BYTES_PER_ELEMENT,_=i?s?i:i*Float32Array.BYTES_PER_ELEMENT:this.byteStride;return new n(this._engine,this,t,this._updatable,!0,_,void 0===f?this._instanced:f,u,r,void 0,void 0,!0,this._divisor||a)}isUpdatable(){return this._updatable}getData(){return this._data}getBuffer(){return this._buffer}getStrideSize(){return this.byteStride/Float32Array.BYTES_PER_ELEMENT}create(t=null){!t&&this._buffer||(t=t||this._data)&&(this._buffer?this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,t),this._data=t):this._updatable?(this._buffer=this._engine.createDynamicVertexBuffer(t,this._label),this._data=t):this._buffer=this._engine.createVertexBuffer(t,void 0,this._label))}_rebuild(){if(this._data)this._buffer=null,this.create(this._data);else if(this._buffer){if(this._buffer.capacity>0)return void(this._updatable?this._buffer=this._engine.createDynamicVertexBuffer(this._buffer.capacity,this._label):this._buffer=this._engine.createVertexBuffer(this._buffer.capacity,void 0,this._label));r.Logger.Warn(`Missing data for buffer "${this._label}" ${this._buffer?"(uniqueId: "+this._buffer.uniqueId+")":""}. Buffer reconstruction failed.`),this._buffer=null}}update(t){this.create(t)}updateDirectly(t,e,r,i=!1){this._buffer&&this._updatable&&(this._engine.updateDynamicVertexBuffer(this._buffer,t,i?e:e*Float32Array.BYTES_PER_ELEMENT,r?r*this.byteStride:void 0),0===e&&void 0===r?this._data=t:this._data=null)}_increaseReferences(){if(this._buffer){if(!this._isAlreadyOwned){this._isAlreadyOwned=!0;return}this._buffer.references++}}dispose(){this._buffer&&this._engine._releaseBuffer(this._buffer)&&(this._isDisposed=!0,this._data=null,this._buffer=null)}}class n{get isDisposed(){return this._isDisposed}get instanceDivisor(){return this._instanceDivisor}set instanceDivisor(t){let e=0!=t;this._instanceDivisor=t,e!==this._instanced&&(this._instanced=e,this._computeHashCode())}get _maxVerticesCount(){let t=this.getData();return t?Array.isArray(t)?t.length/(this.byteStride/4)-this.byteOffset/4:(t.byteLength-this.byteOffset)/this.byteStride:0}constructor(t,e,r,f,s,o,h,d,E,c,p=!1,l=!1,T=1,m=!1){let A;if(this._isDisposed=!1,this.engine=t,"object"==typeof f&&null!==f?(A=f.updatable??!1,s=f.postponeInternalCreation,o=f.stride,h=f.instanced,d=f.offset,E=f.size,c=f.type,p=f.normalized??!1,l=f.useBytes??!1,T=f.divisor??1,m=f.takeBufferOwnership??!1,this._label=f.label):A=!!f,e instanceof a?(this._buffer=e,this._ownsBuffer=m):(this._buffer=new a(t,e,A,o,s,h,l,T,this._label),this._ownsBuffer=!0),this.uniqueId=n._Counter++,this._kind=r,void 0===c){const t=this.getData();this.type=t?_(t):n.FLOAT}else this.type=c;const R=(0,i.GetTypeByteLength)(this.type);l?(this._size=E||(o?o/R:u(r)),this.byteStride=o||this._buffer.byteStride||this._size*R,this.byteOffset=d||0):(this._size=E||o||u(r),this.byteStride=o?o*R:this._buffer.byteStride||this._size*R,this.byteOffset=(d||0)*R),this.normalized=p,this._instanced=void 0!==h&&h,this._instanceDivisor=h?T:0,this._alignBuffer(),this._computeHashCode()}static _GetTypeHashIndex(t){switch(t){case n.BYTE:return 0;case n.UNSIGNED_BYTE:return 1;case n.SHORT:return 2;case n.UNSIGNED_SHORT:return 3;case n.INT:return 4;case n.UNSIGNED_INT:return 5;case n.FLOAT:return 6;case n.HALF_FLOAT:return 7;default:throw Error(`Invalid vertex buffer type '${t}'`)}}_computeHashCode(){this.hashCode=(0|n._GetTypeHashIndex(this.type))+(!!this.normalized<<3)+(this._size-1<<4)+(!!this._instanced<<6)+(this.byteStride<<12)}_rebuild(){this._buffer?._rebuild()}getKind(){return this._kind}isUpdatable(){return this._buffer.isUpdatable()}getData(){return this._buffer.getData()}getFloatData(t,e){let r=this.getData();return r?(0,i.GetFloatData)(r,this._size,this.type,this.byteOffset,this.byteStride,this.normalized,t,e):null}getBuffer(){return this._buffer.getBuffer()}getWrapperBuffer(){return this._buffer}getStrideSize(){return this.byteStride/(0,i.GetTypeByteLength)(this.type)}getOffset(){return this.byteOffset/(0,i.GetTypeByteLength)(this.type)}getSize(t=!1){return t?this._size*(0,i.GetTypeByteLength)(this.type):this._size}getIsInstanced(){return this._instanced}getInstanceDivisor(){return this._instanceDivisor}create(t){this._buffer.create(t),this._alignBuffer()}update(t){this._buffer.update(t),this._alignBuffer()}updateDirectly(t,e,r=!1){this._buffer.updateDirectly(t,e,void 0,r),this._alignBuffer()}dispose(){this._ownsBuffer&&this._buffer.dispose(),this._isDisposed=!0}forEach(t,e){(0,i.EnumerateFloatValues)(this._buffer.getData(),this.byteOffset,this.byteStride,this._size,this.type,t,this.normalized,(t,r)=>{for(let i=0;i<this._size;i++)e(t[i],r+i)})}_alignBuffer(){}}function u(t){switch(t){case n.UVKind:case n.UV2Kind:case n.UV3Kind:case n.UV4Kind:case n.UV5Kind:case n.UV6Kind:return 2;case n.NormalKind:case n.PositionKind:return 3;case n.ColorKind:case n.ColorInstanceKind:case n.MatricesIndicesKind:case n.MatricesIndicesExtraKind:case n.MatricesWeightsKind:case n.MatricesWeightsExtraKind:case n.TangentKind:return 4;default:throw Error("Invalid kind '"+t+"'")}}function _(t){if(t instanceof Int8Array)return n.BYTE;if(t instanceof Uint8Array)return n.UNSIGNED_BYTE;if(t instanceof Int16Array)return n.SHORT;if(t instanceof Uint16Array)return n.UNSIGNED_SHORT;if(t instanceof Int32Array)return n.INT;else if(t instanceof Uint32Array)return n.UNSIGNED_INT;else return n.FLOAT}function o(t){return(0,i.GetTypeByteLength)(t)}function h(t,e,r,f,s,a,n,u){(0,i.EnumerateFloatValues)(t,e,r,f,s,a,n,(t,e)=>{for(let r=0;r<f;r++)u(t[r],e+r)})}function d(t,e,r,f,s,a,n,u){return(0,i.GetFloatData)(t,e,r,f,s,a,n,u)}n._Counter=0,n.BYTE=5120,n.UNSIGNED_BYTE=5121,n.SHORT=5122,n.UNSIGNED_SHORT=5123,n.INT=5124,n.UNSIGNED_INT=5125,n.FLOAT=5126,n.HALF_FLOAT=5131,n.PositionKind="position",n.NormalKind="normal",n.TangentKind="tangent",n.UVKind="uv",n.UV2Kind="uv2",n.UV3Kind="uv3",n.UV4Kind="uv4",n.UV5Kind="uv5",n.UV6Kind="uv6",n.ColorKind="color",n.ColorInstanceKind="instanceColor",n.MatricesIndicesKind="matricesIndices",n.MatricesWeightsKind="matricesWeights",n.MatricesIndicesExtraKind="matricesIndicesExtra",n.MatricesWeightsExtraKind="matricesWeightsExtra";let E=!1;Object.getOwnPropertyDescriptor(n.prototype,"effectiveByteStride")||Object.defineProperty(n.prototype,"effectiveByteStride",(0,s._MissingSideEffectProperty)("VertexBuffer","effectiveByteStride")),Object.getOwnPropertyDescriptor(n.prototype,"effectiveByteOffset")||Object.defineProperty(n.prototype,"effectiveByteOffset",(0,s._MissingSideEffectProperty)("VertexBuffer","effectiveByteOffset")),Object.getOwnPropertyDescriptor(n.prototype,"effectiveBuffer")||Object.defineProperty(n.prototype,"effectiveBuffer",(0,s._MissingSideEffectProperty)("VertexBuffer","effectiveBuffer")),t.s(["Buffer",0,a,"RegisterVertexBuffer",0,function(){E||(E=!0,n.DeduceStride=u,n.GetDataType=_,n.GetTypeByteLength=o,n.ForEach=h,n.GetFloatData=d)},"VertexBuffer",0,n,"VertexBufferDeduceStride",0,u,"VertexBufferForEach",0,h,"VertexBufferGetTypeByteLength",0,o])},45707,t=>{"use strict";class e{constructor(t){this.length=0,this.data=Array(t),this._id=e._GlobalId++}push(t){this.data[this.length++]=t,this.length>this.data.length&&(this.data.length*=2)}forEach(t){for(let e=0;e<this.length;e++)t(this.data[e])}sort(t){this.data.sort(t)}reset(){this.length=0}dispose(){this.reset(),this.data&&(this.data.length=0)}concat(t){if(0!==t.length){this.length+t.length>this.data.length&&(this.data.length=(this.length+t.length)*2);for(let e=0;e<t.length;e++)this.data[this.length++]=(t.data||t)[e]}}indexOf(t){let e=this.data.indexOf(t);return e>=this.length?-1:e}contains(t){return -1!==this.indexOf(t)}}e._GlobalId=0,t.s(["SmartArray",0,e,"SmartArrayNoDuplicate",0,class extends e{constructor(){super(...arguments),this._duplicateId=0}push(t){super.push(t),t.__smartArrayFlags||(t.__smartArrayFlags={}),t.__smartArrayFlags[this._id]=this._duplicateId}pushNoDuplicate(t){return(!t.__smartArrayFlags||t.__smartArrayFlags[this._id]!==this._duplicateId)&&(this.push(t),!0)}reset(){super.reset(),this._duplicateId++}concatWithNoDuplicate(t){if(0!==t.length){this.length+t.length>this.data.length&&(this.data.length=(this.length+t.length)*2);for(let e=0;e<t.length;e++){let r=(t.data||t)[e];this.pushNoDuplicate(r)}}}}])},94160,t=>{"use strict";var e=t.i(99904),r=t.i(96265),i=t.i(88438),f=t.i(33855);let s=new r.Matrix,a=new r.Matrix,n=new r.Matrix,u={getScene:()=>void 0,eyeAtCamera:!0};function _(t,e,r){let i=r.asArray(),f=e.asArray();for(let t=0;t<16;t++)i[t]=f[t];return i[12]-=t.x,i[13]-=t.y,i[14]-=t.z,r.markAsUpdated(),r}function o(t,e,r){if(!u.eyeAtCamera)return(0,i.InvertMatrixToRef)(e,a),_(t,a,n),(0,i.InvertMatrixToRef)(n,r),r;let f=r.asArray(),s=e.asArray();for(let t=0;t<16;t++)f[t]=s[t];return f[12]=0,f[13]=0,f[14]=0,r.markAsUpdated(),r}function h(t,e,r,f){return(0,i.MultiplyMatricesToRef)(o(t,e,f),r,f),f}function d(t,e,r,f){return(0,i.InvertMatrixToRef)(r,a),(0,i.MultiplyMatricesToRef)(e,a,n),_(t,n,a),o(t,r,n),(0,i.MultiplyMatricesToRef)(a,n,f),f}function E(t,e,r,f,s,u){return(0,i.InvertMatrixToRef)(r,a),(0,i.MultiplyMatricesToRef)(e,a,n),_(t,n,a),h(t,f,s,n),(0,i.MultiplyMatricesToRef)(a,n,u),u}function c(t,e){let r=u.getScene();if(!r||s===e)return e;s.updateFlag=e.updateFlag;let i=r.floatingOriginOffset;switch(t){case"world":return _(i,e,s);case"view":return o(i,e,s);case"worldView":return d(i,e,r.getViewMatrix(),s);case"viewProjection":return h(i,r.getViewMatrix(),r.getProjectionMatrix(),s);case"worldViewProjection":return E(i,e,r.getTransformMatrix(),r.getViewMatrix(),r.getProjectionMatrix(),s);default:if(t.startsWith("u_")){let f=t.toLowerCase();if(f.startsWith("u_worldviewprojection"))return E(i,e,r.getTransformMatrix(),r.getViewMatrix(),r.getProjectionMatrix(),s);if(f.startsWith("u_viewprojection"))return h(i,r.getViewMatrix(),r.getProjectionMatrix(),s);if(f.startsWith("u_worldview"))return d(i,e,r.getViewMatrix(),s);if(f.startsWith("u_world"))return _(i,e,s);if(f.startsWith("u_view"))return o(i,e,s)}return e}}let p=f.UniformBuffer,l=e.Effect,T=p.prototype._updateMatrixForUniform,m=e.Effect.prototype.setMatrix;t.s(["FloatingOriginCurrentScene",0,u,"OverrideMatrixFunctions",0,function(){l.prototype._setMatrixOverride=m,l.prototype.setMatrix=function(t,e){return this._setMatrixOverride(t,c(t,e)),this},p.prototype._updateMatrixForUniformOverride=T,p.prototype._updateMatrixForUniform=function(t,e){this._updateMatrixForUniformOverride(t,c(t,e))}},"ResetMatrixFunctions",0,function(){e.Effect.prototype.setMatrix=m,l._setMatrixOverride=void 0,p.prototype._updateMatrixForUniform=T,p.prototype._updateMatrixForUniformOverride=void 0}])},19905,t=>{"use strict";class e{}e.NAME_EFFECTLAYER="EffectLayer",e.NAME_LAYER="Layer",e.NAME_LENSFLARESYSTEM="LensFlareSystem",e.NAME_BOUNDINGBOXRENDERER="BoundingBoxRenderer",e.NAME_PARTICLESYSTEM="ParticleSystem",e.NAME_GAMEPAD="Gamepad",e.NAME_SIMPLIFICATIONQUEUE="SimplificationQueue",e.NAME_GEOMETRYBUFFERRENDERER="GeometryBufferRenderer",e.NAME_PREPASSRENDERER="PrePassRenderer",e.NAME_DEPTHRENDERER="DepthRenderer",e.NAME_DEPTHPEELINGRENDERER="DepthPeelingRenderer",e.NAME_POSTPROCESSRENDERPIPELINEMANAGER="PostProcessRenderPipelineManager",e.NAME_SPRITE="Sprite",e.NAME_SUBSURFACE="SubSurface",e.NAME_OUTLINERENDERER="Outline",e.NAME_PROCEDURALTEXTURE="ProceduralTexture",e.NAME_SHADOWGENERATOR="ShadowGenerator",e.NAME_OCTREE="Octree",e.NAME_PHYSICSENGINE="PhysicsEngine",e.NAME_AUDIO="Audio",e.NAME_FLUIDRENDERER="FluidRenderer",e.NAME_IBLCDFGENERATOR="iblCDFGenerator",e.NAME_CLUSTEREDLIGHTING="ClusteredLighting",e.STEP_ISREADYFORMESH_EFFECTLAYER=0,e.STEP_ISREADYFORMESH_DEPTHRENDERER=1,e.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER=0,e.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER=0,e.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER=0,e.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER=1,e.STEP_BEFORECAMERADRAW_PREPASS=0,e.STEP_BEFORECAMERADRAW_EFFECTLAYER=1,e.STEP_BEFORECAMERADRAW_LAYER=2,e.STEP_BEFORERENDERTARGETDRAW_PREPASS=0,e.STEP_BEFORERENDERTARGETDRAW_LAYER=1,e.STEP_BEFORERENDERINGMESH_PREPASS=0,e.STEP_BEFORERENDERINGMESH_OUTLINE=1,e.STEP_AFTERRENDERINGMESH_PREPASS=0,e.STEP_AFTERRENDERINGMESH_OUTLINE=1,e.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW=0,e.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER=1,e.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE=0,e.STEP_BEFORECLEAR_PROCEDURALTEXTURE=0,e.STEP_BEFORECLEAR_PREPASS=1,e.STEP_BEFORERENDERTARGETCLEAR_PREPASS=0,e.STEP_AFTERRENDERTARGETDRAW_PREPASS=0,e.STEP_AFTERRENDERTARGETDRAW_LAYER=1,e.STEP_AFTERCAMERADRAW_PREPASS=0,e.STEP_AFTERCAMERADRAW_EFFECTLAYER=1,e.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM=2,e.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW=3,e.STEP_AFTERCAMERADRAW_LAYER=4,e.STEP_AFTERCAMERADRAW_FLUIDRENDERER=5,e.STEP_AFTERCAMERAPOSTPROCESS_LAYER=0,e.STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER=0,e.STEP_AFTERRENDER_AUDIO=0,e.STEP_GATHERRENDERTARGETS_DEPTHRENDERER=0,e.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER=1,e.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR=2,e.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER=3,e.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER=0,e.STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER=1,e.STEP_GATHERACTIVECAMERARENDERTARGETS_CLUSTEREDLIGHTING=2,e.STEP_POINTERMOVE_SPRITE=0,e.STEP_POINTERDOWN_SPRITE=0,e.STEP_POINTERUP_SPRITE=0;class r extends Array{constructor(t){super(...t)}static Create(){return Object.create(r.prototype)}registerStep(t,e,r){let i=0;for(;i<this.length&&!(t<this[i].index);i++);this.splice(i,0,{index:t,component:e,action:r.bind(e)})}clear(){this.length=0}}t.s(["SceneComponentConstants",0,e,"Stage",0,r])}]);
|