@cimplify/sdk 0.109.0 → 0.111.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/CHANGELOG.md +54 -0
- package/README.md +18 -0
- package/dist/advanced.d.mts +4 -4
- package/dist/advanced.d.ts +4 -4
- package/dist/advanced.js +22 -22
- package/dist/advanced.mjs +3 -3
- package/dist/{audio-XU2sFNyO.d.mts → audio-DhvyjqdA.d.mts} +2 -2
- package/dist/{audio-8Igdy2WK.d.ts → audio-m0w8cnxq.d.ts} +2 -2
- package/dist/avatars.js +21 -21
- package/dist/avatars.mjs +3 -3
- package/dist/{backend-L4d_Ha0J.d.mts → backend-gUCzs5Kg.d.mts} +16 -2
- package/dist/{backend-L4d_Ha0J.d.ts → backend-gUCzs5Kg.d.ts} +16 -2
- package/dist/{catalogue-DLLsfuNg.d.ts → catalogue-1QcoGDO6.d.ts} +2 -2
- package/dist/{catalogue-BeBFWlHF.d.mts → catalogue-FdFQiWrU.d.mts} +2 -2
- package/dist/{chunk-HF2MZKP2.mjs → chunk-22BD3RHN.mjs} +6 -3
- package/dist/{chunk-B54P6RL2.js → chunk-2AQ237Y4.js} +30 -30
- package/dist/{chunk-W3VVG4NL.js → chunk-2O2CG465.js} +14 -2
- package/dist/{chunk-UPHTPBNQ.mjs → chunk-2QTQ6BUH.mjs} +1 -1
- package/dist/{chunk-BS65NRDW.js → chunk-3S6WPBZL.js} +16 -16
- package/dist/{chunk-PEZYNYJE.js → chunk-3TUOUP5T.js} +3 -3
- package/dist/{chunk-EB6EAOM5.mjs → chunk-3VEH23I5.mjs} +7 -10
- package/dist/{chunk-SYEO2WV4.mjs → chunk-42JTCWIE.mjs} +3 -3
- package/dist/{chunk-FB6YH2WW.js → chunk-4C7I3ELN.js} +4 -4
- package/dist/{chunk-UQYO3OM7.js → chunk-4ZDR72SG.js} +1 -2
- package/dist/{chunk-HPKKCUHU.js → chunk-52YS45RR.js} +13 -13
- package/dist/{chunk-6YVELDFK.mjs → chunk-5BYDGGWO.mjs} +1 -1
- package/dist/{chunk-YN24DET4.js → chunk-5HFMY3D7.js} +10 -10
- package/dist/{chunk-4CVB2ZTC.js → chunk-5LH2QN3T.js} +32 -29
- package/dist/{chunk-4A24F4ZV.mjs → chunk-5YFBGGCK.mjs} +4 -1
- package/dist/{chunk-NLAT3DB2.mjs → chunk-6DAEZKIG.mjs} +1 -1
- package/dist/{chunk-F6CHJXXK.mjs → chunk-6DATW7TB.mjs} +3 -3
- package/dist/{chunk-4RYATNVK.mjs → chunk-6H254EVP.mjs} +6 -11
- package/dist/{chunk-32U4BVJA.mjs → chunk-6PJWXIFX.mjs} +1 -1
- package/dist/{chunk-OMTVH334.js → chunk-6QANXRUM.js} +203 -186
- package/dist/{chunk-BHAGIIBI.js → chunk-6WUBSMTX.js} +82 -85
- package/dist/{chunk-EPYFN2A3.js → chunk-7AAIAVAA.js} +24 -20
- package/dist/{chunk-HZC27ICH.mjs → chunk-7BHW5GTC.mjs} +3 -3
- package/dist/{chunk-MB425DVA.mjs → chunk-7IQQQENP.mjs} +2 -2
- package/dist/{chunk-DJUUL67Z.js → chunk-7KFTYENS.js} +296 -296
- package/dist/{chunk-XLQSNQMP.js → chunk-7SM6XSPZ.js} +339 -339
- package/dist/{chunk-NBH64BDP.mjs → chunk-A33OORT7.mjs} +13 -1
- package/dist/{chunk-G2SXLGFY.js → chunk-A7BU3BK4.js} +7 -7
- package/dist/{chunk-ZNWS7NOW.mjs → chunk-A7V4L2IT.mjs} +2 -2
- package/dist/{chunk-O3SITS4R.mjs → chunk-AGV33FWC.mjs} +4 -4
- package/dist/{chunk-Z2DE3EHS.js → chunk-AHNR3BXI.js} +7 -7
- package/dist/{chunk-UQ4BHMLS.mjs → chunk-AQ5RLBU2.mjs} +5 -5
- package/dist/{chunk-J4HU2YQB.js → chunk-AQOE6WCG.js} +2 -2
- package/dist/{chunk-X57B7VQC.js → chunk-AYJPHKYV.js} +22 -22
- package/dist/{chunk-6XTWY6MH.js → chunk-AZAXD44P.js} +126 -42
- package/dist/{chunk-6ETDAU62.mjs → chunk-B45X3HPO.mjs} +98 -39
- package/dist/{chunk-QDW4EPWS.mjs → chunk-BBGKQIJJ.mjs} +1 -1
- package/dist/{chunk-NHYTO4VU.js → chunk-BP4JLSUA.js} +111 -120
- package/dist/{chunk-7INQVOHY.mjs → chunk-BU6OK542.mjs} +25 -8
- package/dist/{chunk-MKIJQL5Q.js → chunk-CJVEJPIG.js} +69 -69
- package/dist/{chunk-W23VX5MY.js → chunk-CVSRWM6W.js} +5 -5
- package/dist/{chunk-A7DK7QAG.mjs → chunk-CYBMFMJD.mjs} +1 -1
- package/dist/{chunk-BOTUAHP2.mjs → chunk-DS2VU4WW.mjs} +5 -20
- package/dist/{chunk-HMMFNLXZ.js → chunk-DSAG7T5P.js} +2 -2
- package/dist/{chunk-7GG4KNTL.mjs → chunk-E65WCTIG.mjs} +8 -4
- package/dist/{chunk-WXDVEXTW.mjs → chunk-ECDK6QBF.mjs} +1 -1
- package/dist/{chunk-5IRV36MS.mjs → chunk-EIB4OWVQ.mjs} +1 -1
- package/dist/{chunk-JLJ4FD5H.js → chunk-EQUZYCGO.js} +18 -18
- package/dist/{chunk-Q2Y3VMKH.js → chunk-ETZDIISN.js} +151 -151
- package/dist/{chunk-AKTWH3KJ.mjs → chunk-F3UJ6ZRM.mjs} +2 -2
- package/dist/{chunk-J6HRY5EQ.js → chunk-F63N2ZTQ.js} +232 -232
- package/dist/{chunk-MUEFTPNN.js → chunk-FE6VCE4K.js} +34 -34
- package/dist/{chunk-GCKWKLZF.mjs → chunk-FT6GFYJL.mjs} +17 -3
- package/dist/{chunk-2UYTS7SL.mjs → chunk-GCX7TY4D.mjs} +16 -16
- package/dist/{chunk-QDLMIHUH.js → chunk-GDB6TCSD.js} +7 -7
- package/dist/{chunk-7S7LDFGH.js → chunk-GDZT5LZ5.js} +12 -12
- package/dist/{chunk-TB2LS4CE.mjs → chunk-GHS6MIL6.mjs} +7 -11
- package/dist/{chunk-7OHZ56N7.mjs → chunk-GXKI64OT.mjs} +4 -4
- package/dist/{chunk-HRSIIDOZ.js → chunk-H3OQKK6X.js} +41 -41
- package/dist/{chunk-56BM75QX.js → chunk-H5DFSCJ6.js} +2 -2
- package/dist/{chunk-LMK775I4.mjs → chunk-HAGEIC2L.mjs} +1 -1
- package/dist/{chunk-6FZDMICK.js → chunk-HAJ4JRFO.js} +15 -15
- package/dist/{chunk-AWR2G5QN.js → chunk-HDR72GB6.js} +6 -11
- package/dist/{chunk-PTT6KIM6.js → chunk-HSEO6TPU.js} +9 -9
- package/dist/{chunk-CQSA2D2O.js → chunk-I5FOHCLH.js} +4 -31
- package/dist/{chunk-TMFB55IR.js → chunk-J2U6PJSO.js} +3 -30
- package/dist/{chunk-W77VO6LP.js → chunk-J5AJNY2N.js} +13 -13
- package/dist/{chunk-UKA7LHIT.js → chunk-JR3TNEQC.js} +98 -98
- package/dist/{chunk-P2O34BIO.mjs → chunk-JURRXY2J.mjs} +1 -1
- package/dist/{chunk-PKMVOVUA.mjs → chunk-K3HW5I2A.mjs} +1 -1
- package/dist/{chunk-BXUGKBMK.mjs → chunk-KDQOR4QQ.mjs} +1 -14
- package/dist/{chunk-KVZSYGTX.mjs → chunk-KGHJH5KJ.mjs} +1 -1
- package/dist/{chunk-3AKWZF3X.mjs → chunk-KK6HYVBI.mjs} +1 -1
- package/dist/{chunk-K6GK5B5J.js → chunk-KMKWGXMK.js} +6 -6
- package/dist/{chunk-EH4UG7IL.mjs → chunk-KU7O4IXU.mjs} +4 -4
- package/dist/{chunk-IHRMR3WV.mjs → chunk-KVFNRJOR.mjs} +9 -9
- package/dist/{chunk-A36JRXXH.mjs → chunk-KWZHIPRN.mjs} +26 -9
- package/dist/{chunk-HBZQ5HSV.mjs → chunk-LIV3KXJG.mjs} +1 -1
- package/dist/{chunk-S75PBSSL.mjs → chunk-ME6HGG4I.mjs} +92 -8
- package/dist/{chunk-SNNEOS5Z.js → chunk-MHDUUSG6.js} +75 -75
- package/dist/{chunk-FKYZCXFM.js → chunk-MIPO6F72.js} +3 -3
- package/dist/{chunk-MFWIHTEN.js → chunk-MTIHEW2M.js} +5 -5
- package/dist/{chunk-UCR5HRYM.js → chunk-NFXCKTE2.js} +17 -3
- package/dist/{chunk-M53GR3ZV.mjs → chunk-NHJUGZUR.mjs} +43 -5
- package/dist/{chunk-FAYK2MN6.js → chunk-NZTKLY2W.js} +14 -18
- package/dist/{chunk-EQW6PFC2.js → chunk-O2ICABUD.js} +2 -2
- package/dist/{chunk-5PW6DVHF.js → chunk-OIVVQQ22.js} +55 -37
- package/dist/{chunk-GBJ5CW3A.js → chunk-PKOZXD2Q.js} +30 -30
- package/dist/{chunk-NGN3JE5A.js → chunk-PQTQKNKD.js} +16 -7
- package/dist/{chunk-DFZWHNRG.js → chunk-QOCHWR4V.js} +105 -42
- package/dist/{chunk-PCVVQNBD.js → chunk-QS6TRHMR.js} +5 -5
- package/dist/{chunk-DXZZ27CV.js → chunk-RKBLPGPV.js} +245 -207
- package/dist/{chunk-765P2G7G.mjs → chunk-RUVGVNOF.mjs} +1 -1
- package/dist/{chunk-NJ7ZWH4U.mjs → chunk-SAFJIGYB.mjs} +1 -1
- package/dist/{chunk-AOPH2IZV.js → chunk-SKQFLBDD.js} +60 -22
- package/dist/{chunk-BUUA5XJV.js → chunk-TWM6DLYF.js} +2 -2
- package/dist/{chunk-YPL5TKI4.mjs → chunk-U6UVWEAK.mjs} +1 -1
- package/dist/{chunk-6YQDHXPL.mjs → chunk-UCEPNO6N.mjs} +46 -9
- package/dist/{chunk-U7RULAEP.mjs → chunk-UG5BTOTF.mjs} +2 -2
- package/dist/{chunk-MITGBWV7.mjs → chunk-UGH37BQW.mjs} +1 -1
- package/dist/{chunk-IZDWAL53.mjs → chunk-UJDQQTBS.mjs} +8 -8
- package/dist/{chunk-URRZ2SMI.mjs → chunk-V7ZRH3PY.mjs} +2 -2
- package/dist/{chunk-3H76N7G5.mjs → chunk-VBGHBL3E.mjs} +8 -17
- package/dist/{chunk-AZC2LTUI.js → chunk-VVE3Y76O.js} +2 -2
- package/dist/{chunk-BRAA7U3I.mjs → chunk-W65JIRI4.mjs} +1 -1
- package/dist/{chunk-KU4EDEKA.js → chunk-WKWTDZS7.js} +9 -9
- package/dist/{chunk-BTUSVHIE.mjs → chunk-WLSU5QJT.mjs} +2 -2
- package/dist/{chunk-NTTHAXHI.js → chunk-X5A5FOWW.js} +11 -8
- package/dist/{chunk-ODL55PYL.mjs → chunk-XD2PMH46.mjs} +16 -7
- package/dist/{chunk-OADW5BSV.js → chunk-XK6UDWJS.js} +2 -2
- package/dist/{chunk-7ZTEVNXO.mjs → chunk-Y65LXQGA.mjs} +8 -8
- package/dist/{chunk-Z3PGQRTX.mjs → chunk-Y66WVMO5.mjs} +3 -30
- package/dist/{chunk-VZAJDN5C.mjs → chunk-Y7JWLB25.mjs} +1 -1
- package/dist/{chunk-ZJGPD42I.js → chunk-YCDXAJKU.js} +3 -3
- package/dist/{chunk-NCTLCSLE.mjs → chunk-Z3A3AFVU.mjs} +1 -1
- package/dist/{chunk-AEEF3T2E.mjs → chunk-ZCY6YKKP.mjs} +3 -3
- package/dist/{chunk-M5FWHML6.js → chunk-ZMIL4ZOA.js} +5 -18
- package/dist/{chunk-D3JMTFOX.mjs → chunk-ZR5ULMN2.mjs} +1 -1
- package/dist/{client-C9hsiaki.d.ts → client-CChON4-x.d.ts} +2 -2
- package/dist/{client-CO8lw80Q.d.mts → client-EeuGm5gj.d.mts} +2 -2
- package/dist/{courier-CJasuxTU.d.ts → courier-Cnn-edJ4.d.ts} +5 -5
- package/dist/{courier-C2Vo2VlH.d.mts → courier-FmGfkvIN.d.mts} +5 -5
- package/dist/{crowd-D1ljcic8.d.ts → crowd-DdHFbqKK.d.ts} +1 -1
- package/dist/{crowd-B37S1apB.d.mts → crowd-hOVSAmA3.d.mts} +1 -1
- package/dist/{danfo-BsaPzhGi.d.mts → danfo-BEBapFlX.d.mts} +3 -3
- package/dist/{danfo-CCv23CPy.d.ts → danfo-UQ_PTIIx.d.ts} +3 -3
- package/dist/{elements-Bsfk7CPw.d.ts → elements-ss9xZgRg.d.mts} +47 -1
- package/dist/{elements-Bsfk7CPw.d.mts → elements-ss9xZgRg.d.ts} +47 -1
- package/dist/engines/godot.d.mts +1 -1
- package/dist/engines/godot.d.ts +1 -1
- package/dist/engines/wasm.d.mts +1 -1
- package/dist/engines/wasm.d.ts +1 -1
- package/dist/fallback-KDB4Y2CE.mjs +6 -0
- package/dist/fallback-Y26TQENE.js +19 -0
- package/dist/{five-a-side-DP84gMuh.d.mts → five-a-side-Bv1AOUy3.d.mts} +4 -4
- package/dist/{five-a-side-DO8SDqMb.d.ts → five-a-side-EC51SJY1.d.ts} +4 -4
- package/dist/{fluid-BkxNBD2t.d.ts → fluid-ARr0qUIL.d.ts} +168 -4
- package/dist/{fluid-BZ42EMds.d.mts → fluid-DLlEj2cs.d.mts} +168 -4
- package/dist/game/conformance.d.mts +7 -7
- package/dist/game/conformance.d.ts +7 -7
- package/dist/game/conformance.js +39 -41
- package/dist/game/conformance.mjs +17 -19
- package/dist/game/heap.d.mts +3 -3
- package/dist/game/heap.d.ts +3 -3
- package/dist/game/heap.js +13 -15
- package/dist/game/heap.mjs +4 -6
- package/dist/game/kit/canvas.d.mts +33 -34
- package/dist/game/kit/canvas.d.ts +33 -34
- package/dist/game/kit/canvas.js +569 -570
- package/dist/game/kit/canvas.mjs +52 -53
- package/dist/game/kit/courier.d.mts +9 -9
- package/dist/game/kit/courier.d.ts +9 -9
- package/dist/game/kit/courier.js +20 -20
- package/dist/game/kit/courier.mjs +17 -17
- package/dist/game/kit/danfo.d.mts +7 -7
- package/dist/game/kit/danfo.d.ts +7 -7
- package/dist/game/kit/danfo.js +30 -30
- package/dist/game/kit/danfo.mjs +15 -15
- package/dist/game/kit/engine.d.mts +12 -12
- package/dist/game/kit/engine.d.ts +12 -12
- package/dist/game/kit/engine.js +40 -41
- package/dist/game/kit/engine.mjs +11 -12
- package/dist/game/kit/five-a-side.d.mts +7 -7
- package/dist/game/kit/five-a-side.d.ts +7 -7
- package/dist/game/kit/five-a-side.js +24 -24
- package/dist/game/kit/five-a-side.mjs +14 -14
- package/dist/game/kit/frontier.d.mts +7 -7
- package/dist/game/kit/frontier.d.ts +7 -7
- package/dist/game/kit/genesis.d.mts +7 -7
- package/dist/game/kit/genesis.d.ts +7 -7
- package/dist/game/kit/ludo.d.mts +8 -8
- package/dist/game/kit/ludo.d.ts +8 -8
- package/dist/game/kit/ludo.js +24 -24
- package/dist/game/kit/ludo.mjs +14 -14
- package/dist/game/kit/runner.d.mts +8 -8
- package/dist/game/kit/runner.d.ts +8 -8
- package/dist/game/kit/runner.js +22 -22
- package/dist/game/kit/runner.mjs +14 -14
- package/dist/game/kit/shootout.d.mts +9 -9
- package/dist/game/kit/shootout.d.ts +9 -9
- package/dist/game/kit/shootout.js +33 -34
- package/dist/game/kit/shootout.mjs +18 -19
- package/dist/game/kit/tycoon.d.mts +9 -9
- package/dist/game/kit/tycoon.d.ts +9 -9
- package/dist/game/kit/tycoon.js +38 -38
- package/dist/game/kit/tycoon.mjs +14 -14
- package/dist/game/kit/word.d.mts +7 -7
- package/dist/game/kit/word.d.ts +7 -7
- package/dist/game/kit/word.js +22 -22
- package/dist/game/kit/word.mjs +14 -14
- package/dist/game/kit/worlds.d.mts +10 -10
- package/dist/game/kit/worlds.d.ts +10 -10
- package/dist/game/kit/worlds.js +22 -22
- package/dist/game/kit/worlds.mjs +17 -17
- package/dist/game/kit.d.mts +31 -32
- package/dist/game/kit.d.ts +31 -32
- package/dist/game/kit.js +523 -524
- package/dist/game/kit.mjs +38 -39
- package/dist/game/prepared.d.mts +6 -7
- package/dist/game/prepared.d.ts +6 -7
- package/dist/game/prepared.js +23 -24
- package/dist/game/prepared.mjs +12 -13
- package/dist/{game-BZAfgKV6.d.mts → game-Bx8onkhX.d.mts} +5 -97
- package/dist/{game-UoJWopvD.d.ts → game-fgQy2YIm.d.ts} +5 -97
- package/dist/game.d.mts +56 -18
- package/dist/game.d.ts +56 -18
- package/dist/game.js +922 -927
- package/dist/game.mjs +16 -17
- package/dist/{graphics-DNIAV5Mi.d.ts → graphics-C6YjWYvP.d.ts} +1 -1
- package/dist/{graphics-CGJDdtdT.d.mts → graphics-Dk2yQnYN.d.mts} +1 -1
- package/dist/{guest-CMCZeyh5.d.mts → guest-DrsA00XD.d.mts} +2 -7
- package/dist/{guest-CB458Hgw.d.ts → guest-wIdfoT05.d.ts} +2 -7
- package/dist/{hit-stop-D2Ca-i9-.d.mts → hit-stop-BKkVwTq7.d.mts} +1 -1
- package/dist/{hit-stop-Ca1OYk15.d.ts → hit-stop-D-8pPYnM.d.ts} +1 -1
- package/dist/{hot-B9BTmDz6.d.ts → hot-Crn9XpHJ.d.ts} +1 -1
- package/dist/{hot-B_L-GEHZ.d.mts → hot-DH3nOhQD.d.mts} +1 -1
- package/dist/{index-DPeyo938.d.ts → index-B8ybCKJI.d.ts} +3 -3
- package/dist/index-BB2gjVvA.d.mts +153 -0
- package/dist/index-BEfmBDAH.d.ts +153 -0
- package/dist/{index-D8ZDzms9.d.mts → index-DHjNHb1c.d.mts} +3 -3
- package/dist/{index-DFDeJxFQ.d.ts → index-DQK8sTfu.d.ts} +2 -2
- package/dist/{index-C76o9Pj4.d.mts → index-DSVkhRmW.d.mts} +2 -2
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +189 -177
- package/dist/index.mjs +8 -8
- package/dist/interactives-authoring.js +12 -1
- package/dist/interactives-authoring.mjs +12 -1
- package/dist/interactives-canvas.global.js +14 -39
- package/dist/interactives-guest.d.mts +2 -2
- package/dist/interactives-guest.d.ts +2 -2
- package/dist/interactives-guest.js +10 -10
- package/dist/interactives-guest.mjs +6 -6
- package/dist/interactives-jsc.global.js +4 -23
- package/dist/interactives-meters.d.mts +11 -11
- package/dist/interactives-meters.d.ts +11 -11
- package/dist/interactives-meters.js +65 -66
- package/dist/interactives-meters.mjs +17 -18
- package/dist/interactives-production.d.mts +5 -5
- package/dist/interactives-production.d.ts +5 -5
- package/dist/interactives-production.js +15 -16
- package/dist/interactives-production.mjs +3 -4
- package/dist/interactives-record.d.mts +3 -9
- package/dist/interactives-record.d.ts +3 -9
- package/dist/interactives-record.js +45 -65
- package/dist/interactives-record.mjs +19 -39
- package/dist/interactives-runtime.d.mts +3 -3
- package/dist/interactives-runtime.d.ts +3 -3
- package/dist/interactives-runtime.js +101 -105
- package/dist/interactives-runtime.mjs +6 -6
- package/dist/interactives-studio-kernel.global.js +1 -1
- package/dist/interactives-studio.d.mts +7 -7
- package/dist/interactives-studio.d.ts +7 -7
- package/dist/interactives-studio.js +136 -82
- package/dist/interactives-studio.mjs +65 -11
- package/dist/interactives-web.d.mts +14 -14
- package/dist/interactives-web.d.ts +14 -14
- package/dist/interactives-web.js +201 -198
- package/dist/interactives-web.mjs +33 -34
- package/dist/interactives.d.mts +7 -28
- package/dist/interactives.d.ts +7 -28
- package/dist/interactives.js +267 -313
- package/dist/interactives.mjs +26 -24
- package/dist/{juice-Dfgc1B1q.d.ts → juice-CoHxlpKA.d.ts} +1 -1
- package/dist/{juice-CsnrmTOk.d.mts → juice-DQztFS43.d.mts} +1 -1
- package/dist/{launch-CCsmv8HC.d.mts → launch-T2f4_Di4.d.mts} +6 -6
- package/dist/{launch-8W_Tojpz.d.ts → launch-d6oreMzR.d.ts} +6 -6
- package/dist/{local-DA_HpPOj.d.mts → local-D8_I6UeL.d.mts} +0 -5
- package/dist/{local-_mD0x-p_.d.ts → local-VZkqsCzR.d.ts} +0 -5
- package/dist/{ludo-BVHycBP-.d.ts → ludo-B8ClkDqr.d.ts} +4 -4
- package/dist/{ludo-BRaTcI3E.d.mts → ludo-BOuohQ-M.d.mts} +4 -4
- package/dist/mock/cli.mjs +25 -10
- package/dist/mock/library.js +25 -10
- package/dist/mock/library.mjs +25 -10
- package/dist/mock/msw.js +25 -10
- package/dist/mock/msw.mjs +25 -10
- package/dist/{native-CcMUV7rL.d.mts → native-BodxSh03.d.mts} +2 -2
- package/dist/{native-3f4Ht82c.d.ts → native-DUHMT8gA.d.ts} +2 -2
- package/dist/{online-CCy8pwOn.d.ts → online-XeymeM9s.d.ts} +1 -1
- package/dist/{online-smW2BO3Y.d.mts → online-d7W_Al9a.d.mts} +1 -1
- package/dist/{play-BhHHX1jD.d.ts → play-BRRlfLhX.d.ts} +5 -5
- package/dist/{play-Bn7NfGNE.d.mts → play-ClrMd_e8.d.mts} +5 -5
- package/dist/{policy-Dvnzg8ki.d.mts → policy-CCw8tXLm.d.mts} +19 -19
- package/dist/{policy-b3MVXMQu.d.ts → policy-CMqOSQIu.d.ts} +19 -19
- package/dist/{ports-CNeZdgVm.d.mts → ports-B_0v_P3A.d.mts} +1 -1
- package/dist/{ports-Vno6MDaR.d.ts → ports-CGU_3e_0.d.ts} +1 -1
- package/dist/{prefetch-BFg6lJyD.d.ts → prefetch-BHnicOQj.d.ts} +3 -3
- package/dist/{prefetch-BOoKX3qx.d.mts → prefetch-CBXgYacv.d.mts} +3 -3
- package/dist/{price-BIKJla_G.d.mts → price-B-w4PwHm.d.mts} +1 -1
- package/dist/{price-D1gE7Ek6.d.ts → price-BEvQFNJv.d.ts} +1 -1
- package/dist/react.d.mts +35 -27
- package/dist/react.d.ts +35 -27
- package/dist/react.js +276 -248
- package/dist/react.mjs +147 -119
- package/dist/{runner-BAG8EglP.d.ts → runner-CQcLL7By.d.ts} +6 -6
- package/dist/{runner-CKtKtIzc.d.mts → runner-D46Yj-wE.d.mts} +6 -6
- package/dist/{runtime-DfZp1Kwg.d.mts → runtime-BRWfkf_q.d.mts} +1 -8
- package/dist/{runtime-yHPgIJV-.d.ts → runtime-DyuBMkKM.d.ts} +1 -8
- package/dist/{scheduling-CnRAhWQL.d.ts → scheduling-D9WwOxbo.d.ts} +1 -1
- package/dist/{scheduling-lHyYoCa7.d.mts → scheduling-DDmrYCr-.d.mts} +1 -1
- package/dist/{server-DxcxjER1.d.ts → server-BiKwxvnf.d.ts} +2 -2
- package/dist/{server-lU3Sznd4.d.mts → server-DPdtl2dd.d.mts} +2 -2
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +10 -10
- package/dist/server.mjs +4 -4
- package/dist/{shootout-rK-oblpb.d.ts → shootout-BJZeX6FG.d.ts} +6 -6
- package/dist/{shootout-D998OWa-.d.mts → shootout-tcZd1Rxt.d.mts} +6 -6
- package/dist/styles.css +1 -1
- package/dist/{template-Byaueo34.d.mts → template-AhCdB1kW.d.mts} +3 -3
- package/dist/{template-BXE2L654.d.ts → template-BkEGVTQj.d.ts} +3 -3
- package/dist/{terrain-vgYkJPNx.d.ts → terrain-BMxEc6Oc.d.ts} +3 -3
- package/dist/{terrain-CR0NQZPl.d.mts → terrain-C-XC1Oui.d.mts} +3 -3
- package/dist/testing/msw.d.mts +3 -3
- package/dist/testing/msw.d.ts +3 -3
- package/dist/testing/msw.js +3 -3
- package/dist/testing/msw.mjs +2 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +25 -25
- package/dist/testing/suite.mjs +6 -6
- package/dist/testing.d.mts +5 -5
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js +117 -117
- package/dist/testing.mjs +7 -7
- package/dist/{tick-transport-Q_8syS8J.d.mts → tick-transport-C8QEh8Uw.d.mts} +1 -1
- package/dist/{tick-transport-xpMcMTs2.d.ts → tick-transport-UjHY3xK1.d.ts} +1 -1
- package/dist/{tree-BsXFWKQ6.d.mts → tree-C-Io2Hbx.d.mts} +1 -1
- package/dist/{tree-DW9x29Vv.d.ts → tree-CP_qSW4H.d.ts} +1 -1
- package/dist/{tycoon-BMAE5Wea.d.mts → tycoon-B5KHk2Xx.d.mts} +5 -5
- package/dist/{tycoon-dWvWTbE4.d.ts → tycoon-hmHo-3HX.d.ts} +5 -5
- package/dist/{types-AkQEePZo.d.mts → types-BQkxPwZP.d.mts} +1 -1
- package/dist/{types-BWaZJDla.d.ts → types-D_f6UUxM.d.ts} +1 -1
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +44 -32
- package/dist/utils.mjs +2 -2
- package/dist/{weave-delivery-3G03LdMM.d.mts → weave-delivery-CW-Kstut.d.mts} +10 -1
- package/dist/{weave-delivery-3G03LdMM.d.ts → weave-delivery-CW-Kstut.d.ts} +10 -1
- package/dist/{web-C8B9uVx_.d.ts → web-Dss74a7v.d.ts} +7 -7
- package/dist/{web-BqSEfX2o.d.mts → web-f9ZQPoyw.d.mts} +7 -7
- package/dist/{weight-BDABC8cN.d.ts → weight-CPGjsgjV.d.ts} +3 -3
- package/dist/{weight-Cee73u3d.d.mts → weight-tF1ODR1p.d.mts} +3 -3
- package/dist/{word-DB2CcI9q.d.mts → word-BcX9Jcmv.d.mts} +3 -3
- package/dist/{word-C1Q8oXuy.d.ts → word-C7sVPLHm.d.ts} +3 -3
- package/dist/{world-Bmh7K4tQ.d.ts → world-PvILHDR1.d.ts} +1 -1
- package/dist/{world-CPEjuctH.d.mts → world-qekkXjJv.d.mts} +1 -1
- package/dist/{worlds-ShY5h6Z_.d.ts → worlds-Br2Pb0Cs.d.ts} +6 -6
- package/dist/{worlds-CQgN3GnR.d.mts → worlds-D5ydYr7d.d.mts} +6 -6
- package/package.json +5 -3
- package/registry/cart-summary.json +1 -1
- package/registry/chat-widget.json +1 -1
- package/registry/price.json +1 -1
- package/registry/product-customizer.json +1 -1
- package/registry/search-input.json +1 -1
- package/dist/chunk-2LKAOU3L.mjs +0 -96
- package/dist/chunk-UWPQL2IQ.js +0 -104
- package/dist/fallback-Q5YYIMVJ.js +0 -20
- package/dist/fallback-XGBE3RXC.mjs +0 -7
- package/dist/index-C3KORE2U.d.mts +0 -86
- package/dist/index-Cv_rL5X0.d.ts +0 -86
- package/dist/split-Di9wBpNx.d.mts +0 -68
- package/dist/split-Di9wBpNx.d.ts +0 -68
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var chunk34XBXUMW_js = require('./chunk-34XBXUMW.js');
|
|
4
4
|
var chunkOXMIBOD4_js = require('./chunk-OXMIBOD4.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
5
|
+
var chunk5LH2QN3T_js = require('./chunk-5LH2QN3T.js');
|
|
6
|
+
var chunkAZAXD44P_js = require('./chunk-AZAXD44P.js');
|
|
7
|
+
var chunkVVE3Y76O_js = require('./chunk-VVE3Y76O.js');
|
|
8
|
+
var chunk3S6WPBZL_js = require('./chunk-3S6WPBZL.js');
|
|
9
9
|
var chunkG3EEC44R_js = require('./chunk-G3EEC44R.js');
|
|
10
10
|
var chunkRCQ2MPBV_js = require('./chunk-RCQ2MPBV.js');
|
|
11
11
|
var chunkU63OC4TQ_js = require('./chunk-U63OC4TQ.js');
|
|
@@ -13,17 +13,17 @@ var chunkMRFUNRAP_js = require('./chunk-MRFUNRAP.js');
|
|
|
13
13
|
var chunkIIDZ5WUX_js = require('./chunk-IIDZ5WUX.js');
|
|
14
14
|
var chunkYXGZQPUD_js = require('./chunk-YXGZQPUD.js');
|
|
15
15
|
var chunk5PJEXSOW_js = require('./chunk-5PJEXSOW.js');
|
|
16
|
-
var
|
|
16
|
+
var chunk5HFMY3D7_js = require('./chunk-5HFMY3D7.js');
|
|
17
17
|
var chunkNXLAZIJZ_js = require('./chunk-NXLAZIJZ.js');
|
|
18
|
-
var
|
|
19
|
-
var
|
|
18
|
+
var chunk7AAIAVAA_js = require('./chunk-7AAIAVAA.js');
|
|
19
|
+
var chunkX5A5FOWW_js = require('./chunk-X5A5FOWW.js');
|
|
20
20
|
require('./chunk-T2QQMX2N.js');
|
|
21
21
|
var chunkKZJRSXHK_js = require('./chunk-KZJRSXHK.js');
|
|
22
22
|
var chunkIR74FJHU_js = require('./chunk-IR74FJHU.js');
|
|
23
23
|
var chunkQQABGCMM_js = require('./chunk-QQABGCMM.js');
|
|
24
|
-
var
|
|
24
|
+
var chunkXK6UDWJS_js = require('./chunk-XK6UDWJS.js');
|
|
25
25
|
var chunkT7LOXGYX_js = require('./chunk-T7LOXGYX.js');
|
|
26
|
-
var
|
|
26
|
+
var chunk4ZDR72SG_js = require('./chunk-4ZDR72SG.js');
|
|
27
27
|
var chunkPTRNO5UD_js = require('./chunk-PTRNO5UD.js');
|
|
28
28
|
var chunk2V7IL4HC_js = require('./chunk-2V7IL4HC.js');
|
|
29
29
|
var chunkJGBCIKJV_js = require('./chunk-JGBCIKJV.js');
|
|
@@ -62,7 +62,7 @@ function impulseFrames(desc, sampleRate) {
|
|
|
62
62
|
function writeImpulse(desc, sampleRate, out) {
|
|
63
63
|
let frames = impulseFrames(desc, sampleRate), channels = desc.channels ?? (2);
|
|
64
64
|
if (out.length < frames * channels) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "impulse buffer is too small");
|
|
65
|
-
let decay = desc.decay ?? (2.5), damping = Math.min(1, Math.max(0, desc.damping ?? 0)), width2 = Math.min(1, Math.max(0, desc.width ?? 1)), delay = Math.round((desc.preDelay ?? 0) * sampleRate), random = new
|
|
65
|
+
let decay = desc.decay ?? (2.5), damping = Math.min(1, Math.max(0, desc.damping ?? 0)), width2 = Math.min(1, Math.max(0, desc.width ?? 1)), delay = Math.round((desc.preDelay ?? 0) * sampleRate), random = new chunk5LH2QN3T_js.SeededRandom(desc.seed ?? 0), lowLeft = 0, lowRight = 0;
|
|
66
66
|
for (let i = 0; i < frames; i++) {
|
|
67
67
|
let o = i * channels;
|
|
68
68
|
if (i < delay) {
|
|
@@ -82,17 +82,17 @@ function generateImpulse(desc, sampleRate, seed) {
|
|
|
82
82
|
// src/game/audio/music.ts
|
|
83
83
|
var DEFAULT_BEATS_PER_BAR = 4, DEFAULT_BARS = 1, POSITION_BAR = 0, POSITION_BEAT = 1, POSITION_FRACTION = 2;
|
|
84
84
|
function quantizeCode(quantize) {
|
|
85
|
-
if (quantize === "now") return
|
|
86
|
-
if (quantize === "beat") return
|
|
87
|
-
if (quantize === "bar") return
|
|
85
|
+
if (quantize === "now") return chunkX5A5FOWW_js.QUANTIZE_NOW;
|
|
86
|
+
if (quantize === "beat") return chunkX5A5FOWW_js.QUANTIZE_BEAT;
|
|
87
|
+
if (quantize === "bar") return chunkX5A5FOWW_js.QUANTIZE_BAR;
|
|
88
88
|
if (!Number.isInteger(quantize.bars) || quantize.bars < 1) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "a phrase is a whole number of bars, at least one");
|
|
89
|
-
return
|
|
89
|
+
return chunkX5A5FOWW_js.QUANTIZE_BAR + quantize.bars;
|
|
90
90
|
}
|
|
91
91
|
var Music = class {
|
|
92
92
|
constructor(port, defaultBus) {
|
|
93
|
-
this.sounds = new Int32Array(
|
|
94
|
-
this.gains = new Float32Array(
|
|
95
|
-
this.where = new Float64Array(
|
|
93
|
+
this.sounds = new Int32Array(chunkX5A5FOWW_js.MAX_STEMS);
|
|
94
|
+
this.gains = new Float32Array(chunkX5A5FOWW_js.MAX_STEMS);
|
|
95
|
+
this.where = new Float64Array(chunkX5A5FOWW_js.MUSIC_POSITION_WORDS);
|
|
96
96
|
this.port = port, this.defaultBus = defaultBus;
|
|
97
97
|
}
|
|
98
98
|
get available() {
|
|
@@ -115,7 +115,7 @@ var Music = class {
|
|
|
115
115
|
}
|
|
116
116
|
/** Plays the stems as one segment looping every `bars` bars from the next boundary; the playing segment stops there. */
|
|
117
117
|
play(stems, options = {}) {
|
|
118
|
-
if (this.require(), stems.length === 0 || stems.length >
|
|
118
|
+
if (this.require(), stems.length === 0 || stems.length > chunkX5A5FOWW_js.MAX_STEMS) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `a segment has 1 to ${chunkX5A5FOWW_js.MAX_STEMS} stems`);
|
|
119
119
|
let bars = options.bars ?? (1);
|
|
120
120
|
if (!Number.isInteger(bars) || bars < 1) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "a segment loops over a whole number of bars");
|
|
121
121
|
for (let i = 0; i < stems.length; i++)
|
|
@@ -132,8 +132,8 @@ var Music = class {
|
|
|
132
132
|
}
|
|
133
133
|
/** Sets one layer's gain, for the repeats playing and the ones to come. */
|
|
134
134
|
setLayer(layer, gain, rampSeconds = 0) {
|
|
135
|
-
if (this.require(), !Number.isInteger(layer) || layer < 0 || layer >=
|
|
136
|
-
throw new chunk2V7IL4HC_js.GameError("invalid_argument", `layers are 0 to ${
|
|
135
|
+
if (this.require(), !Number.isInteger(layer) || layer < 0 || layer >= chunkX5A5FOWW_js.MAX_STEMS || !(gain >= 0))
|
|
136
|
+
throw new chunk2V7IL4HC_js.GameError("invalid_argument", `layers are 0 to ${chunkX5A5FOWW_js.MAX_STEMS - 1} with a non-negative gain`);
|
|
137
137
|
this.port.musicLayer?.(layer, gain, rampSeconds);
|
|
138
138
|
}
|
|
139
139
|
/** Plays a one-shot on the next boundary. */
|
|
@@ -190,7 +190,7 @@ var StepPose = class {
|
|
|
190
190
|
// src/game/audio/audio.ts
|
|
191
191
|
var AXES2 = 3;
|
|
192
192
|
function filterKind(desc) {
|
|
193
|
-
let kind =
|
|
193
|
+
let kind = chunkX5A5FOWW_js.FILTER_KINDS.indexOf(desc.kind);
|
|
194
194
|
if (kind < 0) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `filter kind ${desc.kind} is unknown`);
|
|
195
195
|
if (!(desc.frequency > 0)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "filter frequency must be positive");
|
|
196
196
|
return kind;
|
|
@@ -201,8 +201,8 @@ function filterQ(desc) {
|
|
|
201
201
|
return q;
|
|
202
202
|
}
|
|
203
203
|
function checkedPriority(priority) {
|
|
204
|
-
if (!Number.isInteger(priority) || priority <
|
|
205
|
-
throw new chunk2V7IL4HC_js.GameError("invalid_argument", `a voice priority is a whole number from ${
|
|
204
|
+
if (!Number.isInteger(priority) || priority < chunkX5A5FOWW_js.MIN_PRIORITY || priority > chunkX5A5FOWW_js.MAX_PRIORITY)
|
|
205
|
+
throw new chunk2V7IL4HC_js.GameError("invalid_argument", `a voice priority is a whole number from ${chunkX5A5FOWW_js.MIN_PRIORITY} to ${chunkX5A5FOWW_js.MAX_PRIORITY}`);
|
|
206
206
|
return priority;
|
|
207
207
|
}
|
|
208
208
|
function scalarColumn(table, field) {
|
|
@@ -218,18 +218,18 @@ function vectorColumns(table, field, out, at) {
|
|
|
218
218
|
for (let k = 0; k < (3); k++) out[at + k] = scalarColumn(table, field[k]);
|
|
219
219
|
}
|
|
220
220
|
function emitterColumns(table, fields2) {
|
|
221
|
-
let columns = new Uint32Array(
|
|
222
|
-
return vectorColumns(table, fields2.position, columns,
|
|
221
|
+
let columns = new Uint32Array(chunkX5A5FOWW_js.EMITTER_COLUMNS).fill(chunkX5A5FOWW_js.NO_EMITTER_COLUMN);
|
|
222
|
+
return vectorColumns(table, fields2.position, columns, chunkX5A5FOWW_js.EMITTER_X), fields2.velocity !== void 0 && vectorColumns(table, fields2.velocity, columns, chunkX5A5FOWW_js.EMITTER_VX), fields2.gain !== void 0 && (columns[chunkX5A5FOWW_js.EMITTER_GAIN] = scalarColumn(table, fields2.gain)), fields2.pitch !== void 0 && (columns[chunkX5A5FOWW_js.EMITTER_PITCH] = scalarColumn(table, fields2.pitch)), columns;
|
|
223
223
|
}
|
|
224
224
|
var DEFAULT_REVERB = "hall", DEFAULT_FILTER_Q = Math.SQRT1_2;
|
|
225
225
|
function encodePanner(desc, out) {
|
|
226
|
-
let model =
|
|
226
|
+
let model = chunkX5A5FOWW_js.DISTANCE_MODELS.indexOf(desc.distanceModel ?? chunkX5A5FOWW_js.DEFAULT_PANNER.distanceModel);
|
|
227
227
|
if (model < 0) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `distance model ${desc.distanceModel} is unknown`);
|
|
228
|
-
let ref = desc.refDistance ??
|
|
228
|
+
let ref = desc.refDistance ?? chunkX5A5FOWW_js.DEFAULT_PANNER.refDistance, max = desc.maxDistance ?? chunkX5A5FOWW_js.DEFAULT_PANNER.maxDistance, rolloff = desc.rolloff ?? chunkX5A5FOWW_js.DEFAULT_PANNER.rolloff, inner = desc.coneInnerAngle ?? chunkX5A5FOWW_js.DEFAULT_PANNER.coneInnerAngle, outer = desc.coneOuterAngle ?? chunkX5A5FOWW_js.DEFAULT_PANNER.coneOuterAngle, outerGain = desc.coneOuterGain ?? chunkX5A5FOWW_js.DEFAULT_PANNER.coneOuterGain, doppler = desc.doppler ?? chunkX5A5FOWW_js.DEFAULT_PANNER.doppler;
|
|
229
229
|
if (!(ref >= 0) || !(max > 0) || !(rolloff >= 0)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "panner distances and rolloff must be non-negative");
|
|
230
230
|
if (!(inner >= 0 && inner <= (360) && outer >= 0 && outer <= (360))) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "cone angles are degrees from 0 to 360");
|
|
231
231
|
if (!(outerGain >= 0 && outerGain <= 1) || !(doppler >= 0)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "cone outer gain is 0 to 1 and doppler non-negative");
|
|
232
|
-
return out[
|
|
232
|
+
return out[chunkX5A5FOWW_js.SPATIAL_MODEL] = model, out[chunkX5A5FOWW_js.SPATIAL_REF_DISTANCE] = ref, out[chunkX5A5FOWW_js.SPATIAL_MAX_DISTANCE] = max, out[chunkX5A5FOWW_js.SPATIAL_ROLLOFF] = rolloff, out[chunkX5A5FOWW_js.SPATIAL_CONE_INNER] = inner, out[chunkX5A5FOWW_js.SPATIAL_CONE_OUTER] = outer, out[chunkX5A5FOWW_js.SPATIAL_CONE_OUTER_GAIN] = outerGain, out[chunkX5A5FOWW_js.SPATIAL_DOPPLER] = doppler, out;
|
|
233
233
|
}
|
|
234
234
|
function validateLoop(startSeconds, endSeconds) {
|
|
235
235
|
if (!Number.isFinite(startSeconds) || !Number.isFinite(endSeconds) || startSeconds < 0 || endSeconds < 0)
|
|
@@ -238,13 +238,13 @@ function validateLoop(startSeconds, endSeconds) {
|
|
|
238
238
|
}
|
|
239
239
|
var FULL_CIRCLE = 360, MASTER_PARENT = -1, NO_VOICE = -1, NO_BUS = -1, MAX_AUDIO_BUSES = 32, Audio = class {
|
|
240
240
|
constructor(port, transforms, maxVoices = 64) {
|
|
241
|
-
this.occlusion = new Float32Array(
|
|
241
|
+
this.occlusion = new Float32Array(chunkX5A5FOWW_js.OCCLUSION_WORDS);
|
|
242
242
|
this.listenerEntity = 4294967295;
|
|
243
243
|
this.duckBus = (-1);
|
|
244
244
|
this.duckRemaining = 0;
|
|
245
245
|
this.duckRelease = 0;
|
|
246
246
|
this.busGain = new Float32Array((32)).fill(1);
|
|
247
|
-
this.spatial = new Float32Array(
|
|
247
|
+
this.spatial = new Float32Array(chunkX5A5FOWW_js.SPATIAL_WORDS);
|
|
248
248
|
this.loopStarts = /* @__PURE__ */ new Map();
|
|
249
249
|
this.loopEnds = /* @__PURE__ */ new Map();
|
|
250
250
|
this.feeds = [];
|
|
@@ -259,7 +259,7 @@ var FULL_CIRCLE = 360, MASTER_PARENT = -1, NO_VOICE = -1, NO_BUS = -1, MAX_AUDIO
|
|
|
259
259
|
return this.require(this.port.capabilities.scheduling === true && this.port.nowFrame !== void 0, "sample-accurate scheduling"), this.port.nowFrame?.() ?? 0;
|
|
260
260
|
}
|
|
261
261
|
/** Plays `sound` starting on output frame `frame`, sample accurate in the mix; a past frame starts at once. */
|
|
262
|
-
playOn(frame, sound, bus, gain = 1, rate = 1, loop = false, priority =
|
|
262
|
+
playOn(frame, sound, bus, gain = 1, rate = 1, loop = false, priority = chunkX5A5FOWW_js.DEFAULT_PRIORITY) {
|
|
263
263
|
if (this.require(this.port.capabilities.scheduling === true && this.port.playOn !== void 0, "sample-accurate scheduling"), !Number.isInteger(frame) || frame < 0) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "a frame is a non-negative whole number");
|
|
264
264
|
let voice = this.port.playOn?.(sound, bus, gain, rate, loop, false, checkedPriority(priority), frame) ?? (-1);
|
|
265
265
|
return loop && this.applySoundLoop(voice, sound), voice;
|
|
@@ -279,7 +279,7 @@ var FULL_CIRCLE = 360, MASTER_PARENT = -1, NO_VOICE = -1, NO_BUS = -1, MAX_AUDIO
|
|
|
279
279
|
this.port.setVoiceOcclusion?.(voice, null);
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
|
-
let radius = desc.radius ??
|
|
282
|
+
let radius = desc.radius ?? chunkX5A5FOWW_js.DEFAULT_OCCLUSION.radius, gain = desc.occludedGain ?? chunkX5A5FOWW_js.DEFAULT_OCCLUSION.occludedGain, cutoff = desc.occludedCutoff ?? chunkX5A5FOWW_js.DEFAULT_OCCLUSION.occludedCutoff, smoothing = desc.smoothingSeconds ?? chunkX5A5FOWW_js.DEFAULT_OCCLUSION.smoothingSeconds;
|
|
283
283
|
if (!(radius >= 0) || !(gain >= 0 && gain <= 1) || !(cutoff > 0) || !(smoothing >= 0))
|
|
284
284
|
throw new chunk2V7IL4HC_js.GameError("invalid_argument", "occlusion takes a non-negative radius and smoothing, a gain of 0 to 1 and a positive cutoff");
|
|
285
285
|
this.occlusion[0] = radius, this.occlusion[1] = gain, this.occlusion[2] = cutoff, this.occlusion[3] = smoothing, this.port.setVoiceOcclusion?.(voice, this.occlusion);
|
|
@@ -317,23 +317,23 @@ var FULL_CIRCLE = 360, MASTER_PARENT = -1, NO_VOICE = -1, NO_BUS = -1, MAX_AUDIO
|
|
|
317
317
|
throw new chunk2V7IL4HC_js.GameError("invalid_argument", "sound PCM must be non-empty interleaved whole frames");
|
|
318
318
|
return this.port.createSound(samples2, channels, sampleRate);
|
|
319
319
|
}
|
|
320
|
-
play(sound, bus, gain = 1, rate = 1, loop = false, priority =
|
|
320
|
+
play(sound, bus, gain = 1, rate = 1, loop = false, priority = chunkX5A5FOWW_js.DEFAULT_PRIORITY) {
|
|
321
321
|
let voice = this.port.play(sound, bus, gain, rate, loop, false, checkedPriority(priority));
|
|
322
322
|
return loop && this.applySoundLoop(voice, sound), voice;
|
|
323
323
|
}
|
|
324
324
|
setSoundLimit(sound, limit2) {
|
|
325
325
|
if (this.require(this.port.capabilities.voiceLimits === true && this.port.setSoundLimit !== void 0, "sound voice limits"), limit2 === null) {
|
|
326
|
-
this.port.setSoundLimit?.(sound,
|
|
326
|
+
this.port.setSoundLimit?.(sound, chunkX5A5FOWW_js.UNLIMITED_VOICES, 0);
|
|
327
327
|
return;
|
|
328
328
|
}
|
|
329
|
-
let steal =
|
|
329
|
+
let steal = chunkX5A5FOWW_js.STEAL_POLICIES.indexOf(limit2.steal ?? "quietest");
|
|
330
330
|
if (steal < 0) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `steal policy ${limit2.steal} is unknown`);
|
|
331
331
|
if (!Number.isInteger(limit2.voices) || limit2.voices < 1) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "a sound limit allows at least one voice");
|
|
332
332
|
this.port.setSoundLimit?.(sound, limit2.voices, steal);
|
|
333
333
|
}
|
|
334
334
|
setVoiceBudget(voices) {
|
|
335
335
|
if (this.require(this.port.capabilities.voiceLimits === true && this.port.setVoiceBudget !== void 0, "a voice budget"), voices !== null && (!Number.isInteger(voices) || voices < 0)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "a voice budget is a whole number of voices");
|
|
336
|
-
this.port.setVoiceBudget?.(voices ??
|
|
336
|
+
this.port.setVoiceBudget?.(voices ?? chunkX5A5FOWW_js.UNLIMITED_VOICES);
|
|
337
337
|
}
|
|
338
338
|
setVolume(voice, gain, rampSeconds = 0) {
|
|
339
339
|
this.port.setVoiceGain(voice, gain, rampSeconds);
|
|
@@ -347,14 +347,14 @@ var FULL_CIRCLE = 360, MASTER_PARENT = -1, NO_VOICE = -1, NO_BUS = -1, MAX_AUDIO
|
|
|
347
347
|
}
|
|
348
348
|
setFilter(bus, desc) {
|
|
349
349
|
if (this.require(this.port.capabilities.filters, "bus filters"), desc === null) {
|
|
350
|
-
this.port.setBusFilter(bus,
|
|
350
|
+
this.port.setBusFilter(bus, chunkX5A5FOWW_js.FILTER_OFF, 0, 0, 0);
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
353
|
this.port.setBusFilter(bus, filterKind(desc), desc.frequency, filterQ(desc), desc.gain ?? 0);
|
|
354
354
|
}
|
|
355
355
|
setVoiceFilter(voice, desc) {
|
|
356
356
|
if (this.require(this.port.capabilities.voiceFilters === true && this.port.setVoiceFilter !== void 0, "voice filters"), desc === null) {
|
|
357
|
-
this.port.setVoiceFilter?.(voice,
|
|
357
|
+
this.port.setVoiceFilter?.(voice, chunkX5A5FOWW_js.FILTER_OFF, 0, 0, 0);
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
360
360
|
this.port.setVoiceFilter?.(voice, filterKind(desc), desc.frequency, filterQ(desc), desc.gain ?? 0);
|
|
@@ -364,7 +364,7 @@ var FULL_CIRCLE = 360, MASTER_PARENT = -1, NO_VOICE = -1, NO_BUS = -1, MAX_AUDIO
|
|
|
364
364
|
this.port.setLimiter?.(false, 0, 0);
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
|
-
let ceiling = desc.ceilingDb ??
|
|
367
|
+
let ceiling = desc.ceilingDb ?? chunkX5A5FOWW_js.DEFAULT_LIMITER_CEILING_DB, release2 = desc.releaseSeconds ?? chunkX5A5FOWW_js.DEFAULT_LIMITER_RELEASE_SECONDS;
|
|
368
368
|
if (!(ceiling <= 0)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "the limiter ceiling is at most 0 dBFS");
|
|
369
369
|
if (!(release2 >= 0) || !Number.isFinite(release2)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "the limiter release is a non-negative number of seconds");
|
|
370
370
|
this.port.setLimiter?.(true, ceiling, release2);
|
|
@@ -373,13 +373,13 @@ var FULL_CIRCLE = 360, MASTER_PARENT = -1, NO_VOICE = -1, NO_BUS = -1, MAX_AUDIO
|
|
|
373
373
|
this.require(this.port.capabilities.meters, "meters"), this.port.meter(bus, out);
|
|
374
374
|
}
|
|
375
375
|
createAnalyser(bus, desc = {}) {
|
|
376
|
-
return this.require(this.port.capabilities.analyser, "the analyser"), this.port.createAnalyser(bus,
|
|
376
|
+
return this.require(this.port.capabilities.analyser, "the analyser"), this.port.createAnalyser(bus, chunk7AAIAVAA_js.analyserSettings(desc));
|
|
377
377
|
}
|
|
378
378
|
frequencyData(analyser, out) {
|
|
379
|
-
this.port.readAnalyser(analyser,
|
|
379
|
+
this.port.readAnalyser(analyser, chunkX5A5FOWW_js.ANALYSER_FREQUENCY, out);
|
|
380
380
|
}
|
|
381
381
|
timeDomainData(analyser, out) {
|
|
382
|
-
this.port.readAnalyser(analyser,
|
|
382
|
+
this.port.readAnalyser(analyser, chunkX5A5FOWW_js.ANALYSER_TIME, out);
|
|
383
383
|
}
|
|
384
384
|
createReverb(desc = {}) {
|
|
385
385
|
this.require(this.port.capabilities.reverb, "convolution reverb");
|
|
@@ -440,7 +440,7 @@ var FULL_CIRCLE = 360, MASTER_PARENT = -1, NO_VOICE = -1, NO_BUS = -1, MAX_AUDIO
|
|
|
440
440
|
require(available, feature) {
|
|
441
441
|
if (!available) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", `${this.port.name} has no ${feature}`);
|
|
442
442
|
}
|
|
443
|
-
playAt(entity, sound, bus, gain = 1, rate = 1, loop = false, panner, priority =
|
|
443
|
+
playAt(entity, sound, bus, gain = 1, rate = 1, loop = false, panner, priority = chunkX5A5FOWW_js.DEFAULT_PRIORITY) {
|
|
444
444
|
let voice = this.port.play(sound, bus, gain, rate, loop, true, checkedPriority(priority));
|
|
445
445
|
loop && this.applySoundLoop(voice, sound), panner !== void 0 && this.setPanner(voice, panner);
|
|
446
446
|
for (let i = 0; i < this.voiceIds.length; i++)
|
|
@@ -464,9 +464,9 @@ var FULL_CIRCLE = 360, MASTER_PARENT = -1, NO_VOICE = -1, NO_BUS = -1, MAX_AUDIO
|
|
|
464
464
|
if (create === void 0 || this.port.feedEmitters === void 0 || this.port.capabilities.emitters !== true)
|
|
465
465
|
throw new chunk2V7IL4HC_js.GameError("unsupported_feature", `${this.port.name} has no emitter tables`);
|
|
466
466
|
if (!table.native) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "emitter tables must be kernel tables in engine memory");
|
|
467
|
-
let capacity = options.capacity ??
|
|
467
|
+
let capacity = options.capacity ?? chunkX5A5FOWW_js.DEFAULT_EMITTER_CAPACITY;
|
|
468
468
|
if (!Number.isInteger(capacity) || capacity < 1) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "emitter capacity must be a positive whole number");
|
|
469
|
-
let columns = emitterColumns(table, fields2), params = options.panner === void 0 ? null : encodePanner(options.panner, new Float32Array(
|
|
469
|
+
let columns = emitterColumns(table, fields2), params = options.panner === void 0 ? null : encodePanner(options.panner, new Float32Array(chunkX5A5FOWW_js.SPATIAL_WORDS)), bank = create.call(this.port, options.sound, bus, capacity, params);
|
|
470
470
|
if (bank < 0) throw new chunk2V7IL4HC_js.GameError("capacity_exceeded", "the audio mixer has no free emitter bank");
|
|
471
471
|
return this.feeds.push({ bank, table, columns }), bank;
|
|
472
472
|
}
|
|
@@ -3025,10 +3025,10 @@ function sink() {
|
|
|
3025
3025
|
return spawnSink;
|
|
3026
3026
|
}
|
|
3027
3027
|
function spawn(values) {
|
|
3028
|
-
sink().spawn(
|
|
3028
|
+
sink().spawn(chunk7AAIAVAA_js.emitRow(), values);
|
|
3029
3029
|
}
|
|
3030
3030
|
function despawn() {
|
|
3031
|
-
sink().kill(
|
|
3031
|
+
sink().kill(chunk7AAIAVAA_js.emitRow());
|
|
3032
3032
|
}
|
|
3033
3033
|
|
|
3034
3034
|
// src/game/kernel/transforms.ts
|
|
@@ -3061,12 +3061,12 @@ chunkJGBCIKJV_js.__export(transforms_exports, {
|
|
|
3061
3061
|
});
|
|
3062
3062
|
var F32 = 4;
|
|
3063
3063
|
function native(open, sizes) {
|
|
3064
|
-
let engine =
|
|
3064
|
+
let engine = chunk7AAIAVAA_js.transformEngine();
|
|
3065
3065
|
if (engine === null) return null;
|
|
3066
3066
|
let handle = open(engine);
|
|
3067
3067
|
if (handle === 0) return null;
|
|
3068
3068
|
let buffers = {};
|
|
3069
|
-
for (let key of Object.keys(sizes)) buffers[key] = new
|
|
3069
|
+
for (let key of Object.keys(sizes)) buffers[key] = new chunk7AAIAVAA_js.EngineBuffer(engine, sizes[key]);
|
|
3070
3070
|
return { engine, handle, buffers };
|
|
3071
3071
|
}
|
|
3072
3072
|
function put(view, source) {
|
|
@@ -3188,7 +3188,7 @@ var Convolver = class {
|
|
|
3188
3188
|
let bytes = n * (4);
|
|
3189
3189
|
this.native = native(
|
|
3190
3190
|
(e) => {
|
|
3191
|
-
let k = new
|
|
3191
|
+
let k = new chunk7AAIAVAA_js.EngineBuffer(e, bytes);
|
|
3192
3192
|
put(k.floats(n), kernel2);
|
|
3193
3193
|
let handle = e.exports.engine_transform_convolver_open(width2, height, k.pointer);
|
|
3194
3194
|
return k.free(), handle;
|
|
@@ -3411,12 +3411,12 @@ function seedDistance(width2, cell2, seed) {
|
|
|
3411
3411
|
}
|
|
3412
3412
|
var floodBuffers = null;
|
|
3413
3413
|
function nativeFlood(width2, height, mask, a, b, squared) {
|
|
3414
|
-
let engine =
|
|
3414
|
+
let engine = chunk7AAIAVAA_js.transformEngine();
|
|
3415
3415
|
if (engine === null) return false;
|
|
3416
3416
|
let n = width2 * height;
|
|
3417
3417
|
if (floodBuffers === null || floodBuffers.engine !== engine || floodBuffers.cells < n) {
|
|
3418
3418
|
if (floodBuffers !== null && floodBuffers.engine === engine) for (let buffer of [floodBuffers.mask, floodBuffers.a, floodBuffers.b, floodBuffers.out]) buffer.free();
|
|
3419
|
-
floodBuffers = { engine, cells: n, mask: new
|
|
3419
|
+
floodBuffers = { engine, cells: n, mask: new chunk7AAIAVAA_js.EngineBuffer(engine, n), a: new chunk7AAIAVAA_js.EngineBuffer(engine, n * (4)), b: new chunk7AAIAVAA_js.EngineBuffer(engine, n * (4)), out: new chunk7AAIAVAA_js.EngineBuffer(engine, n * (4)) };
|
|
3420
3420
|
}
|
|
3421
3421
|
let f = floodBuffers, view = f.mask.bytesView(n);
|
|
3422
3422
|
for (let i = 0; i < n; i++) view[i] = mask[i] !== 0 ? 1 : 0;
|
|
@@ -3735,9 +3735,9 @@ var NO_LIMIT = 4294967295, ALL_BITS = 4294967295, WIDE_PAIR = new Uint32Array(2)
|
|
|
3735
3735
|
function wideView2(target, key, field, kind, columns, cursor, writable) {
|
|
3736
3736
|
let lo = columns(field, 0), hi = columns(field, 1);
|
|
3737
3737
|
Object.defineProperty(target, key, {
|
|
3738
|
-
get: () => kind === "f64" ?
|
|
3738
|
+
get: () => kind === "f64" ? chunk7AAIAVAA_js.f64Bits(lo[cursor.row], hi[cursor.row]) : chunk7AAIAVAA_js.u64Words(lo[cursor.row], hi[cursor.row]),
|
|
3739
3739
|
set: writable ? (value) => {
|
|
3740
|
-
|
|
3740
|
+
chunk7AAIAVAA_js.writeWideArg(WIDE_PAIR, 0, kind, value), lo[cursor.row] = WIDE_PAIR[0], hi[cursor.row] = WIDE_PAIR[1];
|
|
3741
3741
|
} : readOnly,
|
|
3742
3742
|
enumerable: true
|
|
3743
3743
|
});
|
|
@@ -3937,7 +3937,7 @@ var TableViews = class {
|
|
|
3937
3937
|
let views = this.viewsFor(table), count = table.count;
|
|
3938
3938
|
plan.neighbours && views.takeSnapshot(count);
|
|
3939
3939
|
let cursor = views.cursor, entity = views.self, fn = plan.fn, tree = plan.tree, ran = 0, visit = (row) => {
|
|
3940
|
-
cursor.row = row,
|
|
3940
|
+
cursor.row = row, chunk7AAIAVAA_js.setEmitRow(row), fn !== null ? fn(entity, ...args) : tree !== null && tick(tree, entity, args), ran++;
|
|
3941
3941
|
};
|
|
3942
3942
|
if (selection) {
|
|
3943
3943
|
let rows = selection.rows, len2 = selection.length;
|
|
@@ -3951,7 +3951,7 @@ var TableViews = class {
|
|
|
3951
3951
|
// src/game/kernel/kernel.ts
|
|
3952
3952
|
var SAMPLER_PREFIX = "@", MICROS_PER_MS = 1e3;
|
|
3953
3953
|
function logCompute(diagnostic) {
|
|
3954
|
-
console.warn(
|
|
3954
|
+
console.warn(chunk7AAIAVAA_js.computeLogLine(diagnostic));
|
|
3955
3955
|
}
|
|
3956
3956
|
var OP_MASK = 255;
|
|
3957
3957
|
function isIndexable(value) {
|
|
@@ -3965,7 +3965,7 @@ function readsCells(program2) {
|
|
|
3965
3965
|
}
|
|
3966
3966
|
function samples(meta) {
|
|
3967
3967
|
let slots = meta.slots;
|
|
3968
|
-
for (let k = 0; k < slots.length; k++) if (slots[k].field.startsWith(SAMPLER_PREFIX) || slots[k].field.startsWith(
|
|
3968
|
+
for (let k = 0; k < slots.length; k++) if (slots[k].field.startsWith(SAMPLER_PREFIX) || slots[k].field.startsWith(chunk5HFMY3D7_js.KERNEL_ARRAY_PREFIX) || slots[k].field.startsWith(chunk5HFMY3D7_js.KERNEL_TABLE_PREFIX)) return true;
|
|
3969
3969
|
return false;
|
|
3970
3970
|
}
|
|
3971
3971
|
function crossesRows(program2) {
|
|
@@ -4048,7 +4048,7 @@ function configureKernels(next) {
|
|
|
4048
4048
|
if (next.cpuLanes !== void 0 && (!Number.isInteger(next.cpuLanes) || next.cpuLanes < 1)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "cpuLanes is a positive integer");
|
|
4049
4049
|
if (next.gpuCalibrate !== void 0 && (!Number.isInteger(next.gpuCalibrate) || next.gpuCalibrate < 0)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "gpuCalibrate is a run count, 0 to turn calibration off");
|
|
4050
4050
|
if (next.frameBudgetMs !== void 0 && !(next.frameBudgetMs >= 0 && Number.isFinite(next.frameBudgetMs))) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "frameBudgetMs is a finite number of milliseconds, 0 for no hint");
|
|
4051
|
-
if (next.cpuBackend !== void 0 && next.cpuBackend !== "auto" && !
|
|
4051
|
+
if (next.cpuBackend !== void 0 && next.cpuBackend !== "auto" && !chunk5HFMY3D7_js.CPU_BACKENDS.includes(next.cpuBackend)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `cpuBackend is "auto", "interpreter", "cranelift" or "wasm", not ${String(next.cpuBackend)}`);
|
|
4052
4052
|
return settings = { ...settings, ...next }, settings;
|
|
4053
4053
|
}
|
|
4054
4054
|
function nameOf(fn) {
|
|
@@ -4062,7 +4062,7 @@ function kernel(fn, options, payload) {
|
|
|
4062
4062
|
let compiled = typeof options == "string" ? options : payload, chosen = typeof options == "object" && options !== null ? options : {};
|
|
4063
4063
|
if (chosen.device !== void 0 && !DEVICES.includes(chosen.device)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `kernel device is "auto", "cpu" or "gpu", not ${String(chosen.device)}`);
|
|
4064
4064
|
if (chosen.feeds !== void 0 && !FEEDS.includes(chosen.feeds)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `kernel feeds is "host", "render" or "auto", not ${String(chosen.feeds)}`);
|
|
4065
|
-
if (chosen.priority !== void 0 && !
|
|
4065
|
+
if (chosen.priority !== void 0 && !chunk7AAIAVAA_js.KERNEL_PRIORITIES.includes(chosen.priority)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `kernel priority is "simulation", "presentation" or "optional", not ${String(chosen.priority)}`);
|
|
4066
4066
|
let bound = fn.bind(void 0), plan = { fn, tree: null, neighbours: readsNeighbours(fn) || compiledNeighbours(compiled) };
|
|
4067
4067
|
return attachInfo(bound, { name: nameOf(fn), plan, payload: compiled ?? null, device: chosen.device, feeds: chosen.feeds, priority: chosen.priority, compiled: void 0, runs: 0 });
|
|
4068
4068
|
}
|
|
@@ -4081,7 +4081,7 @@ function isKernel(value) {
|
|
|
4081
4081
|
function within(table, selection, target) {
|
|
4082
4082
|
return Object.freeze(target === void 0 ? { table, selection } : { table, selection, target });
|
|
4083
4083
|
}
|
|
4084
|
-
function onGpu(table, selection = null, mirror =
|
|
4084
|
+
function onGpu(table, selection = null, mirror = chunk5HFMY3D7_js.NO_FIELDS) {
|
|
4085
4085
|
return Object.freeze({ table, selection, target: "gpu", mirror });
|
|
4086
4086
|
}
|
|
4087
4087
|
function decodeBase64(text) {
|
|
@@ -4136,18 +4136,18 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4136
4136
|
byKernel === void 0 && (byKernel = /* @__PURE__ */ new Map(), this.machines.set(table, byKernel));
|
|
4137
4137
|
let vm = byKernel.get(program2);
|
|
4138
4138
|
vm === void 0 && (vm = new chunkKZJRSXHK_js.KernelVm(parsed, table.capacity), byKernel.set(program2, vm)), vm.services = this.services;
|
|
4139
|
-
let joined =
|
|
4139
|
+
let joined = chunk7AAIAVAA_js.hasData(meta) ? chunk7AAIAVAA_js.dataTables(meta, table, args) : null, values = joined === null ? args : chunk7AAIAVAA_js.scalarArgs(meta, args), columns = meta.slots.map((slot) => {
|
|
4140
4140
|
if (slot.scratch === true || slot.spawn === true) return SCRATCH_PLACEHOLDER;
|
|
4141
|
-
let foreign = joined === null ? null :
|
|
4141
|
+
let foreign = joined === null ? null : chunk7AAIAVAA_js.dataColumn(meta, joined, slot);
|
|
4142
4142
|
if (foreign !== null) return foreign;
|
|
4143
|
-
if (slot.field.startsWith(
|
|
4144
|
-
let name = slot.field.slice(
|
|
4143
|
+
if (slot.field.startsWith(chunk5HFMY3D7_js.KERNEL_TABLE_PREFIX)) {
|
|
4144
|
+
let name = slot.field.slice(chunk5HFMY3D7_js.KERNEL_TABLE_PREFIX.length), table2 = values[meta.args.findIndex((a) => a.name === name)];
|
|
4145
4145
|
if (!(slot.kind === "f32" ? table2 instanceof Float32Array : slot.kind === "i32" ? table2 instanceof Int32Array : table2 instanceof Uint32Array)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `kernel ${meta.name} reads table ${name}; pass a ${slot.kind === "f32" ? "Float32Array" : slot.kind === "i32" ? "Int32Array" : "Uint32Array"}`);
|
|
4146
4146
|
return { values: table2, storage: slot.kind === "f32" ? chunkKZJRSXHK_js.STORAGE_F32 : slot.kind === "i32" ? chunkKZJRSXHK_js.STORAGE_I32 : chunkKZJRSXHK_js.STORAGE_U32 };
|
|
4147
4147
|
}
|
|
4148
|
-
if (slot.field.startsWith(
|
|
4149
|
-
let array =
|
|
4150
|
-
if (array === null) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `kernel ${meta.name} writes kernel array ${slot.field.slice(
|
|
4148
|
+
if (slot.field.startsWith(chunk5HFMY3D7_js.KERNEL_ARRAY_PREFIX)) {
|
|
4149
|
+
let array = chunk5HFMY3D7_js.kernelArrayNamed(slot.field.slice(chunk5HFMY3D7_js.KERNEL_ARRAY_PREFIX.length));
|
|
4150
|
+
if (array === null) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `kernel ${meta.name} writes kernel array ${slot.field.slice(chunk5HFMY3D7_js.KERNEL_ARRAY_PREFIX.length)}; declare it with kernelArray(name, { kind, length }) before running the kernel`);
|
|
4151
4151
|
return { values: array.data, storage: array.kind === "f32" ? chunkKZJRSXHK_js.STORAGE_F32 : array.kind === "i32" ? chunkKZJRSXHK_js.STORAGE_I32 : chunkKZJRSXHK_js.STORAGE_U32 };
|
|
4152
4152
|
}
|
|
4153
4153
|
if (slot.field.startsWith(SAMPLER_PREFIX)) {
|
|
@@ -4160,7 +4160,7 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4160
4160
|
}), at = 0;
|
|
4161
4161
|
meta.args.forEach((arg, k) => {
|
|
4162
4162
|
let value = values[k];
|
|
4163
|
-
if (arg.kind === "f64" || arg.kind === "u64") at =
|
|
4163
|
+
if (arg.kind === "f64" || arg.kind === "u64") at = chunk7AAIAVAA_js.writeWideArg(this.words, at, arg.kind, value);
|
|
4164
4164
|
else if (arg.width === 1 && ArrayBuffer.isView(value)) this.words[at++] = value.length >>> 0;
|
|
4165
4165
|
else if (arg.width > 1 && isIndexable(value))
|
|
4166
4166
|
for (let c = 0; c < arg.width; c++)
|
|
@@ -4173,12 +4173,12 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4173
4173
|
let rows = selection === null ? null : selection.rows.subarray(0, selection.length);
|
|
4174
4174
|
if (joined !== null) {
|
|
4175
4175
|
let bound = this.bound.get(vm);
|
|
4176
|
-
bound === void 0 && (bound = /* @__PURE__ */ new Map(), this.bound.set(vm, bound)),
|
|
4176
|
+
bound === void 0 && (bound = /* @__PURE__ */ new Map(), this.bound.set(vm, bound)), chunk7AAIAVAA_js.bindData(vm.data, meta, joined, columns, bound);
|
|
4177
4177
|
}
|
|
4178
4178
|
let ran = vm.run(columns, table.count, rows, this.words);
|
|
4179
|
-
if (joined !== null && this.reports.set(program2,
|
|
4180
|
-
let into = this.into !== null && this.into !== table ? this.into : null, own = new
|
|
4181
|
-
|
|
4179
|
+
if (joined !== null && this.reports.set(program2, chunk7AAIAVAA_js.reportData(vm.data, meta)), meta.channels !== void 0 && meta.channels.length > 0 && (chunk7AAIAVAA_js.routeEvents(vm.events, meta.channels), vm.clearEvents()), vm.defers) {
|
|
4180
|
+
let into = this.into !== null && this.into !== table ? this.into : null, own = new chunk3S6WPBZL_js.TableSpawns(table, into === null ? meta : null);
|
|
4181
|
+
chunk3S6WPBZL_js.reportSpawns(vm.finish(own, into === null ? null : new chunk3S6WPBZL_js.TableSpawns(into, meta)), into ?? table, this.report);
|
|
4182
4182
|
}
|
|
4183
4183
|
return ran;
|
|
4184
4184
|
}
|
|
@@ -4201,11 +4201,11 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4201
4201
|
this.setRouters = /* @__PURE__ */ new WeakMap();
|
|
4202
4202
|
this.setMachines = /* @__PURE__ */ new Map();
|
|
4203
4203
|
this.setMachineBase = null;
|
|
4204
|
-
this.setScratch =
|
|
4204
|
+
this.setScratch = chunk5HFMY3D7_js.emptyEstimate();
|
|
4205
4205
|
this.world = null;
|
|
4206
|
-
this.sink = new
|
|
4206
|
+
this.sink = new chunk3S6WPBZL_js.PlainSpawns();
|
|
4207
4207
|
this.into = null;
|
|
4208
|
-
this.engine = engine, this.native = engine === null ? null : new
|
|
4208
|
+
this.engine = engine, this.native = engine === null ? null : new chunk3S6WPBZL_js.NativeKernels(engine), this.native !== null && (this.native.report = this.vm.report), this.gpu = engine === null ? null : chunk5HFMY3D7_js.GpuKernels.bind(engine.exports, engine.memory), this.compute = engine === null ? null : chunk7AAIAVAA_js.ComputeMonitor.bind(engine.exports, engine.memory), this.native !== null && (this.native.compute = this.compute), this.gpu !== null && (this.gpu.compute = this.compute);
|
|
4209
4209
|
let compute = this.compute;
|
|
4210
4210
|
this.inspector = engine === null || compute === null ? null : chunkPTRNO5UD_js.EngineInspector.bind(engine.exports, engine.memory, () => compute.boundKernels());
|
|
4211
4211
|
let inspector = this.inspector;
|
|
@@ -4274,7 +4274,7 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4274
4274
|
onGpu(compiled, info, table, selection, target, late, scratch2, mirror) {
|
|
4275
4275
|
let name = info.name;
|
|
4276
4276
|
if (target === "cpu" || settings.gpu === "off") return null;
|
|
4277
|
-
let fields2 = late && mirror ===
|
|
4277
|
+
let fields2 = late && mirror === chunk5HFMY3D7_js.NO_FIELDS && this.feedOf(info, compiled, table) === "render" ? writtenFields(compiled.meta) : mirror;
|
|
4278
4278
|
if (target === "gpu") {
|
|
4279
4279
|
if (this.gpu === null || !table.native || !this.gpu.available()) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", `kernel ${name} asked for the GPU, but this engine has no GPU kernels`);
|
|
4280
4280
|
let ran2 = this.gpu.run(compiled.meta, compiled.program, table, selection, scratch2, !late, fields2);
|
|
@@ -4302,7 +4302,7 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4302
4302
|
let router = byProgram.get(program2);
|
|
4303
4303
|
if (router === void 0) {
|
|
4304
4304
|
let pin = settings.gpuPins[name], runs = clockAvailable() ? settings.gpuCalibrate : 0;
|
|
4305
|
-
pin !== void 0 ? router = runs > 0 ?
|
|
4305
|
+
pin !== void 0 ? router = runs > 0 ? chunk5HFMY3D7_js.KernelRouter.replaying(machine, runs, pin) : chunk5HFMY3D7_js.KernelRouter.pinned(machine, pin) : router = runs > 0 ? chunk5HFMY3D7_js.KernelRouter.calibrating(machine, runs) : chunk5HFMY3D7_js.KernelRouter.model(machine), byProgram.set(program2, router);
|
|
4306
4306
|
} else router.machine !== machine && (router.machine = machine);
|
|
4307
4307
|
return router;
|
|
4308
4308
|
}
|
|
@@ -4332,7 +4332,7 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4332
4332
|
}
|
|
4333
4333
|
if (!usable || rows < settings.gpuRows || settings.mode !== "auto")
|
|
4334
4334
|
return cpu.runCpu(), "cpu";
|
|
4335
|
-
let router = this.setRouterFor(set2, table, cpu.cpuForm === "wasm" ? "wasm" : "interpreter"), e =
|
|
4335
|
+
let router = this.setRouterFor(set2, table, cpu.cpuForm === "wasm" ? "wasm" : "interpreter"), e = chunk5HFMY3D7_js.fillSetEstimate(set2.cpu, set2.gpuShape, router.machine, this.setScratch, cpu.cpuForm, chunk5HFMY3D7_js.hostEngine()), device = router.routeEstimate(e, rows, chunk5HFMY3D7_js.SET_ROW_BOUND), sampling = router.sampling, started = sampling ? clockNow() : 0;
|
|
4336
4336
|
if (device === "gpu" && !this.setOnGpu(set2, table) && (device = "cpu"), device === "cpu" && cpu.runCpu(), sampling) {
|
|
4337
4337
|
let before = router.pin;
|
|
4338
4338
|
router.recordEstimate(device, e, rows, (clockNow() - started) * (1e6));
|
|
@@ -4358,7 +4358,7 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4358
4358
|
let router = bySet.get(set2);
|
|
4359
4359
|
if (router === void 0) {
|
|
4360
4360
|
let pin = settings.gpuPins[set2.name], runs = clockAvailable() ? settings.gpuCalibrate : 0;
|
|
4361
|
-
pin !== void 0 ? router = runs > 0 ?
|
|
4361
|
+
pin !== void 0 ? router = runs > 0 ? chunk5HFMY3D7_js.KernelRouter.replaying(machine, runs, pin) : chunk5HFMY3D7_js.KernelRouter.pinned(machine, pin) : router = runs > 0 ? chunk5HFMY3D7_js.KernelRouter.calibrating(machine, runs) : chunk5HFMY3D7_js.KernelRouter.model(machine), bySet.set(set2, router);
|
|
4362
4362
|
} else router.machine !== machine && (router.machine = machine);
|
|
4363
4363
|
return router;
|
|
4364
4364
|
}
|
|
@@ -4385,7 +4385,7 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4385
4385
|
} finally {
|
|
4386
4386
|
if (setSpawnSink(sink2), this.world !== null && setKernelWorld(previous), this.sink.used) {
|
|
4387
4387
|
let into = this.into !== null && this.into !== table ? this.into : null;
|
|
4388
|
-
|
|
4388
|
+
chunk3S6WPBZL_js.reportSpawns(this.sink.finish(table, into, this.vm.report), into ?? table, this.vm.report);
|
|
4389
4389
|
}
|
|
4390
4390
|
}
|
|
4391
4391
|
}
|
|
@@ -4399,9 +4399,9 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4399
4399
|
if (info === void 0) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "run() takes a kernel made with kernel() or behaviour()");
|
|
4400
4400
|
let table = "selection" in set2 && "table" in set2 ? set2.table : set2, selection = "selection" in set2 && "table" in set2 ? set2.selection : null, compiled = compiledOf(info), chosen = "selection" in set2 && "table" in set2 ? set2.target : void 0, target = chosen ?? info.device ?? "auto", late = chosen === "gpu" || this.feedOf(info, compiled, table) === "render", into = "selection" in set2 && "table" in set2 ? set2.spawns ?? null : null;
|
|
4401
4401
|
this.into = into, this.vm.into = into;
|
|
4402
|
-
let level2 =
|
|
4402
|
+
let level2 = chunk7AAIAVAA_js.priorityLevel(info.priority);
|
|
4403
4403
|
if (this.native !== null && (this.native.into = into, this.native.priority = level2), this.gpu !== null && (this.gpu.priority = level2), compiled !== null) {
|
|
4404
|
-
let mirror = "selection" in set2 && "table" in set2 ? set2.mirror ??
|
|
4404
|
+
let mirror = "selection" in set2 && "table" in set2 ? set2.mirror ?? chunk5HFMY3D7_js.NO_FIELDS : chunk5HFMY3D7_js.NO_FIELDS, ran2 = this.onGpu(compiled, info, table, selection, target, late, scratch2, mirror);
|
|
4405
4405
|
if (ran2 !== null) return ran2;
|
|
4406
4406
|
} else if (target === "gpu")
|
|
4407
4407
|
throw new chunk2V7IL4HC_js.GameError("unsupported_feature", `kernel ${info.name} has no bytecode for the GPU`);
|
|
@@ -4414,7 +4414,7 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4414
4414
|
return this.gpu.afterCpu(table, compiled === null ? null : compiled.meta), this.noteCpuReads(compiled, table), sample3 !== null && work !== null && this.recordSample(sample3, this.sampleName, "cpu", work, started), ran;
|
|
4415
4415
|
}
|
|
4416
4416
|
onCpu(info, compiled, table, selection, scratch2) {
|
|
4417
|
-
let native2 = this.native !== null && compiled !== null && table.native && !samples(compiled.meta) && (!
|
|
4417
|
+
let native2 = this.native !== null && compiled !== null && table.native && !samples(compiled.meta) && (!chunk7AAIAVAA_js.hasData(compiled.meta) || this.native.acceptsData()) && this.native.accepts(compiled.program) ? this.native : null, bytecode = compiled === null ? null : native2 ?? this.vm, mode = settings.mode;
|
|
4418
4418
|
if (compiled !== null && native2 === null && mode === "auto" && twinOf(compiled.program) !== null) return this.plain(info, table, selection, scratch2);
|
|
4419
4419
|
if (mode === "native") {
|
|
4420
4420
|
if (native2 === null || compiled === null) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", `kernel ${info.name} has no bytecode for this engine`);
|
|
@@ -4424,7 +4424,7 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4424
4424
|
if (compiled === null) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", `kernel ${info.name} has no bytecode`);
|
|
4425
4425
|
return this.vm.run(compiled.meta, compiled.program, table, selection, scratch2);
|
|
4426
4426
|
}
|
|
4427
|
-
return mode === "auto" && native2 !== null && compiled !== null ? native2.run(compiled.meta, compiled.program, table, selection, scratch2) : mode === "auto" && compiled !== null && (readsCells(compiled.program) || crossesRows(compiled.program) ||
|
|
4427
|
+
return mode === "auto" && native2 !== null && compiled !== null ? native2.run(compiled.meta, compiled.program, table, selection, scratch2) : mode === "auto" && compiled !== null && (readsCells(compiled.program) || crossesRows(compiled.program) || chunk7AAIAVAA_js.hasData(compiled.meta)) ? this.vm.run(compiled.meta, compiled.program, table, selection, scratch2) : mode === "auto" ? this.plain(info, table, selection, scratch2) : compiled !== null && (readsCells(compiled.program) || crossesRows(compiled.program) || chunk7AAIAVAA_js.hasData(compiled.meta)) ? this.vm.run(compiled.meta, compiled.program, table, selection, scratch2) : mode !== "dev" || bytecode === null || compiled === null || writesEngine(compiled.program) ? this.plain(info, table, selection, scratch2) : (info.runs++, info.runs % settings.checkEvery !== 0 ? this.plain(info, table, selection, scratch2) : this.check(info, compiled, bytecode, table, selection, scratch2));
|
|
4428
4428
|
}
|
|
4429
4429
|
check(info, compiled, native2, table, selection, args) {
|
|
4430
4430
|
let columns = columnsOf(table), count = table.count, before = columns.map((c) => c.values.slice(0, count)), ran = this.plain(info, table, selection, args), fromJs = columns.map((c) => c.values.slice(0, count));
|
|
@@ -4452,7 +4452,7 @@ var STORAGE = { f32: chunkKZJRSXHK_js.STORAGE_F32, i32: chunkKZJRSXHK_js.STORAGE
|
|
|
4452
4452
|
}
|
|
4453
4453
|
}, defaultEngine = null, defaultRunner = null, autoKernels = /* @__PURE__ */ new WeakMap(), autoSet = { table: null, selection: null }, autoArgs = [];
|
|
4454
4454
|
function setDefaultKernelEngine(engine) {
|
|
4455
|
-
defaultRunner !== null && engine === defaultEngine || (defaultRunner?.dispose(), defaultEngine = engine, defaultRunner = new KernelRunner(engine), chunkNXLAZIJZ_js.setLockstepKernelHost(engineLockstepHost(engine)),
|
|
4455
|
+
defaultRunner !== null && engine === defaultEngine || (defaultRunner?.dispose(), defaultEngine = engine, defaultRunner = new KernelRunner(engine), chunkNXLAZIJZ_js.setLockstepKernelHost(engineLockstepHost(engine)), chunk5LH2QN3T_js.setLoopEngine(chunk5LH2QN3T_js.loopEngineOf(engine)));
|
|
4456
4456
|
}
|
|
4457
4457
|
function defaultKernelRunner() {
|
|
4458
4458
|
return defaultRunner === null && (defaultRunner = new KernelRunner(defaultEngine)), defaultRunner;
|
|
@@ -4649,7 +4649,7 @@ var Query = class {
|
|
|
4649
4649
|
register(type, capacity) {
|
|
4650
4650
|
let existing = this.stores[type.id];
|
|
4651
4651
|
if (existing) return existing;
|
|
4652
|
-
let store = new
|
|
4652
|
+
let store = new chunkAZAXD44P_js.ComponentStore(type, capacity ?? this.capacity, this.capacity, this.memory);
|
|
4653
4653
|
return this.stores[type.id] = store, this.storeList.push(store), this.views.push(...store.rollbackViews()), store;
|
|
4654
4654
|
}
|
|
4655
4655
|
store(type) {
|
|
@@ -4938,7 +4938,7 @@ function encodeArchetype(decl) {
|
|
|
4938
4938
|
out.u(1), out.u(decl.thinkEveryTicks), out.u(decl.senseEveryTicks), out.u(names.length), out.u(decl.actions.length), out.u(decl.needs.length), out.u(decl.schedule.length), out.u((sightDecl ? 1 : 0) | (decl.hearing ? 2 : 0)), out.f(decl.memorySeconds), out.f(decl.awarenessRadius), out.f(decl.scheduleJitterMinutes), out.f(decl.steering.maxSpeed), out.f(decl.steering.maxAcceleration), out.f(decl.steering.radius), out.f(decl.steering.separationWeight), out.f(decl.steering.separationRadius), out.u(MOTION_CODES[decl.steering.motion]), out.pair(decl.skill.reactionSeconds), out.pair(decl.skill.aimSigma), out.pair(decl.skill.perceptionScale), out.pair(decl.skill.tolerance), out.pair(decl.skill.mistakeChance), out.f(sightDecl?.range ?? 0), out.f(sightDecl?.fovCos ?? 0), out.f(sightDecl?.peripheralRange ?? 0), out.f(sightDecl?.peripheralCos ?? 0), out.f(sightDecl?.eyeHeight ?? 0), out.u(sightDecl?.lineOfSight ? 1 : 0), out.f(decl.hearing?.sensitivity ?? 0);
|
|
4939
4939
|
for (let name of names) {
|
|
4940
4940
|
let declared = decl.inputs[name], source = declared.source;
|
|
4941
|
-
source.kind === "builtin" ? (out.u(0), out.u(
|
|
4941
|
+
source.kind === "builtin" ? (out.u(0), out.u(chunk3S6WPBZL_js.BUILTIN_INPUTS.indexOf(source.input))) : source.kind === "game" ? (out.u(1), out.u(source.slot)) : (out.u(2), out.u(source.need)), out.f(declared.min), out.f(declared.max);
|
|
4942
4942
|
}
|
|
4943
4943
|
for (let declared of decl.actions) {
|
|
4944
4944
|
if (declared.considerations.length > 8)
|
|
@@ -5774,11 +5774,11 @@ var LINK_MIN_LENGTH = 0.01, MAX_NEIGHBOURS = 8, EPSILON = 1e-5, TINY = 1e-6, COR
|
|
|
5774
5774
|
this.rz = 0;
|
|
5775
5775
|
this.mesh = mesh, this.query = query, this.filter = filter, this.settings = settings2, this.links = links;
|
|
5776
5776
|
let n = settings2.maxAgents, cap = settings2.maxPathPolys;
|
|
5777
|
-
this.cap = cap, this.cornerFlags = new Uint8Array(n *
|
|
5777
|
+
this.cap = cap, this.cornerFlags = new Uint8Array(n * chunk3S6WPBZL_js.MAX_CORNERS), this.cornerRefs = new Float64Array(n * chunk3S6WPBZL_js.MAX_CORNERS).fill((-1)), this.corridor = new Float64Array(n * cap).fill((-1)), this.corridorLen = new Uint32Array(n), this.corridorAt = new Uint32Array(n), this.resume = new Uint8Array(n), this.endPoint = new Float64Array(n * 3), this.linkRef = new Float64Array(n).fill((-1)), this.linkFrom = new Float64Array(n * 3), this.linkTo = new Float64Array(n * 3), this.linkT = new Float64Array(n), this.afterLink = new Uint8Array(n), this.out = new Float32Array(n * 8), this.px = new Float64Array(n), this.py = new Float64Array(n), this.pz = new Float64Array(n), this.vx = new Float64Array(n), this.vz = new Float64Array(n), this.nx = new Float64Array(n), this.nz = new Float64Array(n), this.prefX = new Float64Array(n), this.prefZ = new Float64Array(n), this.radius = new Float64Array(n), this.speed = new Float64Array(n), this.accel = new Float64Array(n), this.poly = new Float64Array(n).fill((-1)), this.state = new Uint8Array(n), this.target = new Float64Array(n * 3), this.corners = new Float32Array(n * chunk3S6WPBZL_js.MAX_CORNERS * 3), this.cornerCount = new Uint8Array(n), this.cornerAt = new Uint8Array(n), this.ids = new Int32Array(n).fill((-1)), this.indexOf = new Int32Array(n).fill((-1)), this.free = new Int32Array(n);
|
|
5778
5778
|
for (let k = 0; k < n; k++) this.free[k] = n - 1 - k;
|
|
5779
5779
|
this.freeCount = n, this.requests = new Int32Array(n * 2), this.cornerViews = [], this.flagViews = [], this.refViews = [], this.corridorViews = [];
|
|
5780
5780
|
for (let i = 0; i < n; i++)
|
|
5781
|
-
this.cornerViews.push(this.corners.subarray(i *
|
|
5781
|
+
this.cornerViews.push(this.corners.subarray(i * chunk3S6WPBZL_js.MAX_CORNERS * 3, (i + 1) * chunk3S6WPBZL_js.MAX_CORNERS * 3)), this.flagViews.push(this.cornerFlags.subarray(i * chunk3S6WPBZL_js.MAX_CORNERS, (i + 1) * chunk3S6WPBZL_js.MAX_CORNERS)), this.refViews.push(this.cornerRefs.subarray(i * chunk3S6WPBZL_js.MAX_CORNERS, (i + 1) * chunk3S6WPBZL_js.MAX_CORNERS)), this.corridorViews.push(this.corridor.subarray(i * cap, (i + 1) * cap));
|
|
5782
5782
|
this.cellOf = new Int32Array(n), this.cellItems = new Int32Array(n);
|
|
5783
5783
|
}
|
|
5784
5784
|
get size() {
|
|
@@ -5803,7 +5803,7 @@ var LINK_MIN_LENGTH = 0.01, MAX_NEIGHBOURS = 8, EPSILON = 1e-5, TINY = 1e-6, COR
|
|
|
5803
5803
|
for (let c of bytes) c[i] = c[last];
|
|
5804
5804
|
this.corridorLen[i] = this.corridorLen[last], this.corridorAt[i] = this.corridorAt[last];
|
|
5805
5805
|
for (let c of [this.target, this.endPoint, this.linkFrom, this.linkTo]) c.copyWithin(i * 3, last * 3, last * 3 + 3);
|
|
5806
|
-
this.corners.copyWithin(i *
|
|
5806
|
+
this.corners.copyWithin(i * chunk3S6WPBZL_js.MAX_CORNERS * 3, last * chunk3S6WPBZL_js.MAX_CORNERS * 3, (last + 1) * chunk3S6WPBZL_js.MAX_CORNERS * 3), this.cornerFlags.copyWithin(i * chunk3S6WPBZL_js.MAX_CORNERS, last * chunk3S6WPBZL_js.MAX_CORNERS, (last + 1) * chunk3S6WPBZL_js.MAX_CORNERS), this.cornerRefs.copyWithin(i * chunk3S6WPBZL_js.MAX_CORNERS, last * chunk3S6WPBZL_js.MAX_CORNERS, (last + 1) * chunk3S6WPBZL_js.MAX_CORNERS), this.corridor.copyWithin(i * this.cap, last * this.cap, last * this.cap + this.corridorLen[last]);
|
|
5807
5807
|
let moved = this.ids[last];
|
|
5808
5808
|
this.ids[i] = moved, this.indexOf[moved] = i;
|
|
5809
5809
|
}
|
|
@@ -5856,7 +5856,7 @@ var LINK_MIN_LENGTH = 0.01, MAX_NEIGHBOURS = 8, EPSILON = 1e-5, TINY = 1e-6, COR
|
|
|
5856
5856
|
if (!(links && links.isLink(r) ? links.view(r) : this.mesh.tileOf(r) !== null)) return false;
|
|
5857
5857
|
}
|
|
5858
5858
|
let count = this.query.straightPathDetailed(this.px[i], this.py[i], this.pz[i], this.endPoint[i * 3], this.endPoint[i * 3 + 1], this.endPoint[i * 3 + 2], this.corridor, base + at, base + len2, this.cornerViews[i], this.flagViews[i], this.refViews[i]);
|
|
5859
|
-
return this.cornerCount[i] = count, this.cornerAt[i] = count > 1 && this.cornerFlags[i *
|
|
5859
|
+
return this.cornerCount[i] = count, this.cornerAt[i] = count > 1 && this.cornerFlags[i * chunk3S6WPBZL_js.MAX_CORNERS] !== (1) ? 1 : 0, true;
|
|
5860
5860
|
}
|
|
5861
5861
|
track(i) {
|
|
5862
5862
|
let base = i * this.cap, at = this.corridorAt[i], len2 = this.corridorLen[i], poly = this.poly[i];
|
|
@@ -5881,7 +5881,7 @@ var LINK_MIN_LENGTH = 0.01, MAX_NEIGHBOURS = 8, EPSILON = 1e-5, TINY = 1e-6, COR
|
|
|
5881
5881
|
rejoined || this.request(i);
|
|
5882
5882
|
}
|
|
5883
5883
|
beginLink(i) {
|
|
5884
|
-
let r = this.cornerRefs[i *
|
|
5884
|
+
let r = this.cornerRefs[i * chunk3S6WPBZL_js.MAX_CORNERS + this.cornerAt[i]], links = this.links;
|
|
5885
5885
|
if (!links || !links.view(r)) {
|
|
5886
5886
|
this.request(i);
|
|
5887
5887
|
return;
|
|
@@ -5935,7 +5935,7 @@ var LINK_MIN_LENGTH = 0.01, MAX_NEIGHBOURS = 8, EPSILON = 1e-5, TINY = 1e-6, COR
|
|
|
5935
5935
|
}
|
|
5936
5936
|
steer(i) {
|
|
5937
5937
|
if (this.prefX[i] = 0, this.prefZ[i] = 0, this.state[i] !== 2) return;
|
|
5938
|
-
let base = i *
|
|
5938
|
+
let base = i * chunk3S6WPBZL_js.MAX_CORNERS * 3, refreshed = false;
|
|
5939
5939
|
for (; ; ) {
|
|
5940
5940
|
let count = this.cornerCount[i], at = this.cornerAt[i];
|
|
5941
5941
|
if (at >= count) {
|
|
@@ -5943,12 +5943,12 @@ var LINK_MIN_LENGTH = 0.01, MAX_NEIGHBOURS = 8, EPSILON = 1e-5, TINY = 1e-6, COR
|
|
|
5943
5943
|
return;
|
|
5944
5944
|
}
|
|
5945
5945
|
let cx = this.corners[base + at * 3], cz = this.corners[base + at * 3 + 2], dx = cx - this.px[i], dz = cz - this.pz[i], distance = Math.sqrt(dx * dx + dz * dz);
|
|
5946
|
-
if (this.cornerFlags[i *
|
|
5946
|
+
if (this.cornerFlags[i * chunk3S6WPBZL_js.MAX_CORNERS + at] === (1)) {
|
|
5947
5947
|
distance <= (0.25) + this.radius[i] ? this.beginLink(i) : this.drive(i, dx, dz, distance, 1);
|
|
5948
5948
|
return;
|
|
5949
5949
|
}
|
|
5950
5950
|
if (at + 1 === count) {
|
|
5951
|
-
let truncated = count ===
|
|
5951
|
+
let truncated = count === chunk3S6WPBZL_js.MAX_CORNERS;
|
|
5952
5952
|
if (distance <= (0.2)) {
|
|
5953
5953
|
if (truncated && !refreshed) {
|
|
5954
5954
|
if (refreshed = true, this.refresh(i)) continue;
|
|
@@ -6391,7 +6391,7 @@ var EMPTY = new Float32Array(0), JsNav = class {
|
|
|
6391
6391
|
this.crowd = null;
|
|
6392
6392
|
this.traffic = null;
|
|
6393
6393
|
this.filter = new QueryFilterJs();
|
|
6394
|
-
this.extents =
|
|
6394
|
+
this.extents = chunk3S6WPBZL_js.DEFAULT_EXTENTS;
|
|
6395
6395
|
this.path = new Float64Array(0);
|
|
6396
6396
|
this.complete = false;
|
|
6397
6397
|
}
|
|
@@ -6412,7 +6412,7 @@ var EMPTY = new Float32Array(0), JsNav = class {
|
|
|
6412
6412
|
}
|
|
6413
6413
|
init(desc) {
|
|
6414
6414
|
let origin = desc.origin ?? [0, 0];
|
|
6415
|
-
this.extents = desc.extents ??
|
|
6415
|
+
this.extents = desc.extents ?? chunk3S6WPBZL_js.DEFAULT_EXTENTS;
|
|
6416
6416
|
let mesh = new NavMeshJs(origin[0], origin[1], desc.tileWorld, desc.maxTiles ?? 256), links = new NavLinksJs(), query = new NavQueryJs(mesh, desc.queryNodes ?? 2048, links), crowdQuery = new NavQueryJs(mesh, desc.queryNodes ?? 2048, links);
|
|
6417
6417
|
this.path = new Float64Array(desc.maxPathPolys ?? 256), this.mesh = mesh, this.links = links, this.query = query, this.crowd = new CrowdJs(
|
|
6418
6418
|
mesh,
|
|
@@ -6544,13 +6544,13 @@ function horizontal(position, area2, curve4, extra = {}) {
|
|
|
6544
6544
|
}
|
|
6545
6545
|
function rudder(z, y, area2, rate) {
|
|
6546
6546
|
return vertical([0, y, z], area2, { kind: "analytic", slope: (3), stall: (0.45), cd0: 0, induced: 0.1 }, {
|
|
6547
|
-
deflection:
|
|
6547
|
+
deflection: chunk3S6WPBZL_js.mix(1, -(0.6)),
|
|
6548
6548
|
maxDeflection: (0.6),
|
|
6549
6549
|
rate
|
|
6550
6550
|
});
|
|
6551
6551
|
}
|
|
6552
6552
|
function propeller(position, maxThrust, reverse, maxSpeed, rate) {
|
|
6553
|
-
return { position, maxThrust, reverse, maxSpeed, spoolRate: rate, medium: "water", throttle:
|
|
6553
|
+
return { position, maxThrust, reverse, maxSpeed, spoolRate: rate, medium: "water", throttle: chunk3S6WPBZL_js.mix(0, 1) };
|
|
6554
6554
|
}
|
|
6555
6555
|
function canoe() {
|
|
6556
6556
|
return {
|
|
@@ -6568,7 +6568,7 @@ function speedboat() {
|
|
|
6568
6568
|
thrusters: [
|
|
6569
6569
|
{
|
|
6570
6570
|
...propeller([0, -0.45, -3], 12e3, 0.4, 25, 2),
|
|
6571
|
-
vector: { axis: UP, angle:
|
|
6571
|
+
vector: { axis: UP, angle: chunk3S6WPBZL_js.mix(1, 0.5), maxAngle: 0.5, rate: 3 }
|
|
6572
6572
|
}
|
|
6573
6573
|
]
|
|
6574
6574
|
};
|
|
@@ -6589,7 +6589,7 @@ function sailboat() {
|
|
|
6589
6589
|
rudder(-3.8, -0.6, 0.6, 2),
|
|
6590
6590
|
vertical([0, -1.6, 0], 1.6, { kind: "analytic", slope: 5, stall: 0.3, cd0: 0, induced: 0 }),
|
|
6591
6591
|
vertical([0, 5, 0.3], 30, { kind: "analytic", slope: 5, stall: 0.35, cd0: 0.05, induced: 0.1 }, {
|
|
6592
|
-
deflection:
|
|
6592
|
+
deflection: chunk3S6WPBZL_js.mix(2, 1.4),
|
|
6593
6593
|
maxDeflection: 1.4,
|
|
6594
6594
|
rate: 0.6,
|
|
6595
6595
|
leeward: true
|
|
@@ -6692,7 +6692,7 @@ function wings(frame) {
|
|
|
6692
6692
|
stall: frame.stall,
|
|
6693
6693
|
cd0: frame.cd0
|
|
6694
6694
|
}, wing = (x, roll) => horizontal([x, 0.3, 0], frame.wingArea * 0.5, wingCurve, {
|
|
6695
|
-
deflection:
|
|
6695
|
+
deflection: chunk3S6WPBZL_js.mixWith(chunk3S6WPBZL_js.mix(1, roll), 4, (0.3)),
|
|
6696
6696
|
maxDeflection: frame.aileron + (0.3),
|
|
6697
6697
|
effectiveness: 0.4,
|
|
6698
6698
|
deflectionDrag: (0.15),
|
|
@@ -6702,12 +6702,12 @@ function wings(frame) {
|
|
|
6702
6702
|
wing(frame.wingX, frame.aileron),
|
|
6703
6703
|
wing(-frame.wingX, -frame.aileron),
|
|
6704
6704
|
horizontal([0, 0.3, frame.tailZ], frame.tailArea, tail(frame.tailArea, frame.tailSpan), {
|
|
6705
|
-
deflection:
|
|
6705
|
+
deflection: chunk3S6WPBZL_js.mix(0, -frame.elevator),
|
|
6706
6706
|
maxDeflection: frame.elevator,
|
|
6707
6707
|
effectiveness: 0.5
|
|
6708
6708
|
}),
|
|
6709
6709
|
vertical([0, 0.9, frame.tailZ], frame.finArea, tail(frame.finArea, frame.finSpan), {
|
|
6710
|
-
deflection:
|
|
6710
|
+
deflection: chunk3S6WPBZL_js.mix(2, -frame.rudder),
|
|
6711
6711
|
maxDeflection: frame.rudder,
|
|
6712
6712
|
effectiveness: 0.5
|
|
6713
6713
|
})
|
|
@@ -6717,7 +6717,7 @@ function airplane(body, frame, arcade) {
|
|
|
6717
6717
|
let weight = body.mass * (9.81), [nose, main, track, drop] = frame.gear;
|
|
6718
6718
|
return {
|
|
6719
6719
|
airDrag: [0.8, 1, 0.08],
|
|
6720
|
-
gear: { steer:
|
|
6720
|
+
gear: { steer: chunk3S6WPBZL_js.mix(2, 1), brake: chunk3S6WPBZL_js.mix(5, 1), deploy: chunk3S6WPBZL_js.mix(6, 1), retractRate: 0 },
|
|
6721
6721
|
assist: flightAssist(body.mass, arcade),
|
|
6722
6722
|
stall: frame.stall,
|
|
6723
6723
|
span: frame.wingSpan,
|
|
@@ -6727,7 +6727,7 @@ function airplane(body, frame, arcade) {
|
|
|
6727
6727
|
{
|
|
6728
6728
|
position: frame.engine,
|
|
6729
6729
|
maxThrust: frame.thrust,
|
|
6730
|
-
throttle:
|
|
6730
|
+
throttle: chunk3S6WPBZL_js.mix(3, 1),
|
|
6731
6731
|
spoolRate: frame.spool,
|
|
6732
6732
|
medium: "air",
|
|
6733
6733
|
maxSpeed: frame.propSpeed
|
|
@@ -6780,13 +6780,13 @@ function helicopter(body, arcade) {
|
|
|
6780
6780
|
position: [0, 1.5, 0],
|
|
6781
6781
|
radius: 5,
|
|
6782
6782
|
maxThrust,
|
|
6783
|
-
collective:
|
|
6784
|
-
cyclicPitch:
|
|
6785
|
-
cyclicRoll:
|
|
6783
|
+
collective: chunk3S6WPBZL_js.mix(0, 1),
|
|
6784
|
+
cyclicPitch: chunk3S6WPBZL_js.mix(1, -1),
|
|
6785
|
+
cyclicRoll: chunk3S6WPBZL_js.mix(2, -1),
|
|
6786
6786
|
cyclicTilt: 0.15,
|
|
6787
6787
|
hubStiffness: body.mass * 10,
|
|
6788
6788
|
torqueReaction: 0.1,
|
|
6789
|
-
power:
|
|
6789
|
+
power: chunk3S6WPBZL_js.mix(4, 1),
|
|
6790
6790
|
governorRate: 0.5,
|
|
6791
6791
|
rotorDrag: 0.3,
|
|
6792
6792
|
autorotation: 0.06,
|
|
@@ -6801,7 +6801,7 @@ function helicopter(body, arcade) {
|
|
|
6801
6801
|
maxThrust: tailThrust,
|
|
6802
6802
|
reverse: 1,
|
|
6803
6803
|
medium: "air",
|
|
6804
|
-
throttle:
|
|
6804
|
+
throttle: chunk3S6WPBZL_js.mixWith(chunk3S6WPBZL_js.mix(3, 0.5), 0, counter)
|
|
6805
6805
|
}
|
|
6806
6806
|
],
|
|
6807
6807
|
wheels: skids(body.mass, 0.9, 1, -0.8)
|
|
@@ -6815,7 +6815,7 @@ function quadcopter(body, arcade) {
|
|
|
6815
6815
|
[-1, -1],
|
|
6816
6816
|
[1, -1]
|
|
6817
6817
|
]) {
|
|
6818
|
-
let spin = x * z > 0 ? 1 : -1, collective =
|
|
6818
|
+
let spin = x * z > 0 ? 1 : -1, collective = chunk3S6WPBZL_js.mixWith(chunk3S6WPBZL_js.mixWith(chunk3S6WPBZL_js.mixWith(chunk3S6WPBZL_js.mix(0, 1), 1, -0.2 * z), 2, 0.2 * x), 3, -0.2 * spin);
|
|
6819
6819
|
rotors.push({ position: [x * 0.25, 0.05, z * 0.25], radius: 0.12, maxThrust: each2, collective, torqueReaction: 0.02 * spin });
|
|
6820
6820
|
}
|
|
6821
6821
|
let assist = hoverAssist(body.mass, arcade, arcade ? 0.1 : 0);
|
|
@@ -6827,7 +6827,7 @@ function quadcopter(body, arcade) {
|
|
|
6827
6827
|
};
|
|
6828
6828
|
}
|
|
6829
6829
|
function tiltrotor(body, arcade) {
|
|
6830
|
-
let maxThrust = body.mass * (9.81) * 0.8, tilt = { axis: PITCH_AXIS, angle:
|
|
6830
|
+
let maxThrust = body.mass * (9.81) * 0.8, tilt = { axis: PITCH_AXIS, angle: chunk3S6WPBZL_js.mix(7, HALF_PI), maxAngle: HALF_PI, rate: 0.3 }, assist = flightAssist(body.mass, arcade), frame = {
|
|
6831
6831
|
...LIGHT_PLANE,
|
|
6832
6832
|
wingX: 2.5,
|
|
6833
6833
|
wingArea: 25,
|
|
@@ -6851,7 +6851,7 @@ function tiltrotor(body, arcade) {
|
|
|
6851
6851
|
position: [x, 1, 0],
|
|
6852
6852
|
radius: 3,
|
|
6853
6853
|
maxThrust,
|
|
6854
|
-
collective:
|
|
6854
|
+
collective: chunk3S6WPBZL_js.mixWith(chunk3S6WPBZL_js.mix(3, 1), 1, 0.15 * Math.sign(x)),
|
|
6855
6855
|
governorRate: 0.5,
|
|
6856
6856
|
tilt
|
|
6857
6857
|
})),
|
|
@@ -6863,11 +6863,11 @@ function blimp(body) {
|
|
|
6863
6863
|
let fin = { kind: "wing", aspect: 2, stall: 0.35, cd0: (0.02) }, engine = (x) => ({
|
|
6864
6864
|
position: [x, -2.5, 0],
|
|
6865
6865
|
maxThrust: 1500,
|
|
6866
|
-
throttle:
|
|
6866
|
+
throttle: chunk3S6WPBZL_js.mixWith(chunk3S6WPBZL_js.mix(0, 1), 1, 0.5 * Math.sign(x)),
|
|
6867
6867
|
medium: "air",
|
|
6868
6868
|
spoolRate: 0.5,
|
|
6869
6869
|
reverse: 0.5,
|
|
6870
|
-
vector: { axis: PITCH_AXIS, angle:
|
|
6870
|
+
vector: { axis: PITCH_AXIS, angle: chunk3S6WPBZL_js.mix(2, -HALF_PI), maxAngle: HALF_PI, rate: 0.5 }
|
|
6871
6871
|
});
|
|
6872
6872
|
return {
|
|
6873
6873
|
airDrag: [40, 40, 8],
|
|
@@ -6876,7 +6876,7 @@ function blimp(body) {
|
|
|
6876
6876
|
thrusters: [engine(3.5), engine(-3.5)],
|
|
6877
6877
|
foils: [
|
|
6878
6878
|
horizontal([0, 0, -13], 12, fin),
|
|
6879
|
-
vertical([0, 2, -13], 10, fin, { deflection:
|
|
6879
|
+
vertical([0, 2, -13], 10, fin, { deflection: chunk3S6WPBZL_js.mix(1, -0.5), maxDeflection: 0.5, rate: 1 })
|
|
6880
6880
|
]
|
|
6881
6881
|
};
|
|
6882
6882
|
}
|
|
@@ -6933,25 +6933,25 @@ function tune(desc, tuning) {
|
|
|
6933
6933
|
}
|
|
6934
6934
|
|
|
6935
6935
|
// src/game/physics/craft/wire.ts
|
|
6936
|
-
var CRAFT_WIRE_VERSION = 1, CURVE_POINTS2 = 72, CURVE_SAMPLES = (72) + 1, CURVE_STEP2 =
|
|
6936
|
+
var CRAFT_WIRE_VERSION = 1, CURVE_POINTS2 = 72, CURVE_SAMPLES = (72) + 1, CURVE_STEP2 = chunk3S6WPBZL_js.TAU / (72), HULL_WORDS = 5, STALL_BLEND = 0.15, FLAT_PLATE_DRAG = 2, FLAT_PLATE_LIFT = 1, EFFICIENCY = 0.8, FORWARD2 = [0, 0, 1], UP2 = [0, 1, 0], RAY_EPSILON = 1e-7, SKEW = [1, 1e-3, 2e-3], MEDIUM_CODES = { any: 0, water: 1, air: 2 }, scratch = { sin: 0, cos: 0 };
|
|
6937
6937
|
function foil(alpha, slope, stall, cd0, induced, out) {
|
|
6938
6938
|
let attached = slope * Math.min(Math.max(alpha, -stall), stall);
|
|
6939
|
-
|
|
6939
|
+
chunk3S6WPBZL_js.sinCos(alpha, scratch);
|
|
6940
6940
|
let s = scratch.sin, c = scratch.cos, flat = (1) * 2 * s * c, t = Math.min(Math.max((Math.abs(alpha) - stall) / (0.15), 0), 1), cl = attached + (flat - attached) * t, cdAttached = cd0 + induced * cl * cl, cdFlat = cd0 + (2) * s * s;
|
|
6941
6941
|
return out[0] = cl, out[1] = cdAttached + (cdFlat - cdAttached) * t, out;
|
|
6942
6942
|
}
|
|
6943
6943
|
function curveSamples(curve4, out) {
|
|
6944
6944
|
let lift = [], drag = [], pair = new Float64Array(2);
|
|
6945
6945
|
for (let i = 0; i < CURVE_SAMPLES; i++) {
|
|
6946
|
-
let alpha = -
|
|
6946
|
+
let alpha = -chunk3S6WPBZL_js.PI + CURVE_STEP2 * i;
|
|
6947
6947
|
if (curve4.kind === "table") {
|
|
6948
|
-
lift.push(
|
|
6948
|
+
lift.push(chunk3S6WPBZL_js.sampleCurve(curve4.lift, alpha)), drag.push(chunk3S6WPBZL_js.sampleCurve(curve4.drag, alpha));
|
|
6949
6949
|
continue;
|
|
6950
6950
|
}
|
|
6951
|
-
let zero = curve4.zeroLift ?? 0, slope = curve4.kind === "wing" ?
|
|
6952
|
-
foil(
|
|
6951
|
+
let zero = curve4.zeroLift ?? 0, slope = curve4.kind === "wing" ? chunk3S6WPBZL_js.TAU * curve4.aspect / (curve4.aspect + 2) : curve4.slope, induced = curve4.kind === "wing" ? 1 / (chunk3S6WPBZL_js.PI * (0.8) * curve4.aspect) : curve4.induced;
|
|
6952
|
+
foil(chunk3S6WPBZL_js.wrapAngle(alpha - zero), slope, curve4.stall, curve4.cd0, induced, pair), lift.push(pair[0]), drag.push(pair[1]);
|
|
6953
6953
|
}
|
|
6954
|
-
curve4.kind === "table" && (
|
|
6954
|
+
curve4.kind === "table" && (chunk3S6WPBZL_js.validateCurve(curve4.lift, 64, "lift curve"), chunk3S6WPBZL_js.validateCurve(curve4.drag, 64, "drag curve")), out.push(...lift, ...drag);
|
|
6955
6955
|
}
|
|
6956
6956
|
function pushMix(out, mix2, fallback = 0) {
|
|
6957
6957
|
out.push(mix2 ? mix2.bias ?? 0 : fallback);
|
|
@@ -7265,7 +7265,7 @@ var Craft = class {
|
|
|
7265
7265
|
}, WaterControls = class {
|
|
7266
7266
|
constructor(port) {
|
|
7267
7267
|
this.one = new Float32Array(2);
|
|
7268
|
-
this.oneOut = new Float32Array(
|
|
7268
|
+
this.oneOut = new Float32Array(chunk3S6WPBZL_js.WATER_SAMPLE_WORDS);
|
|
7269
7269
|
this.level = 0;
|
|
7270
7270
|
this.currentX = 0;
|
|
7271
7271
|
this.currentZ = 0;
|
|
@@ -7279,7 +7279,7 @@ var Craft = class {
|
|
|
7279
7279
|
this.port.configureWater(desc), this.remember(desc);
|
|
7280
7280
|
}
|
|
7281
7281
|
sea(state, options = {}) {
|
|
7282
|
-
let wind = options.windDirection ?? 0, seed = options.seed ?? 1, desc =
|
|
7282
|
+
let wind = options.windDirection ?? 0, seed = options.seed ?? 1, desc = chunk3S6WPBZL_js.seaDesc(state, wind, seed);
|
|
7283
7283
|
return this.port.sea(state, wind, seed), this.remember(desc), desc;
|
|
7284
7284
|
}
|
|
7285
7285
|
ocean(desc) {
|
|
@@ -7335,13 +7335,13 @@ var Craft = class {
|
|
|
7335
7335
|
height(x, z) {
|
|
7336
7336
|
return this.one[0] = x, this.one[1] = z, this.port.sampleWater(this.one, 1, this.oneOut), this.oneOut[0];
|
|
7337
7337
|
}
|
|
7338
|
-
sample(x, z, out = new
|
|
7338
|
+
sample(x, z, out = new chunk3S6WPBZL_js.WaterSample()) {
|
|
7339
7339
|
this.one[0] = x, this.one[1] = z, this.port.sampleWater(this.one, 1, this.oneOut);
|
|
7340
7340
|
let o = this.oneOut;
|
|
7341
7341
|
return out.height = o[0], out.normalX = o[1], out.normalY = o[2], out.normalZ = o[3], out.velocityX = o[4], out.velocityY = o[5], out.velocityZ = o[6], out;
|
|
7342
7342
|
}
|
|
7343
7343
|
sampleBatch(points, count, out) {
|
|
7344
|
-
if (points.length < count * 2 || out.length < count *
|
|
7344
|
+
if (points.length < count * 2 || out.length < count * chunk3S6WPBZL_js.WATER_SAMPLE_WORDS)
|
|
7345
7345
|
throw new chunk2V7IL4HC_js.GameError("invalid_argument", "water sample buffers are too small");
|
|
7346
7346
|
this.port.sampleWater(points, count, out);
|
|
7347
7347
|
}
|
|
@@ -7403,7 +7403,7 @@ var Craft = class {
|
|
|
7403
7403
|
}
|
|
7404
7404
|
crumple(handle, geometry, vertices, options) {
|
|
7405
7405
|
if (!this.port.crumple) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", "vehicle crumple needs the native engine with feature soft_body_1");
|
|
7406
|
-
this.port.crumple(handle.id, vertices,
|
|
7406
|
+
this.port.crumple(handle.id, vertices, chunk5LH2QN3T_js.crumpleDesc(vertices, options)), this.crumpled.set(handle.id, geometry);
|
|
7407
7407
|
}
|
|
7408
7408
|
impact(handle, point, severity) {
|
|
7409
7409
|
return !this.port.impact || !this.crumpled.has(handle.id) ? false : this.port.impact(handle.id, [point.x, point.y, point.z], [severity.x, severity.y, severity.z]);
|
|
@@ -7448,7 +7448,7 @@ var RigidState = class {
|
|
|
7448
7448
|
this.position = new Float64Array(3);
|
|
7449
7449
|
this.linear = new Float64Array(3);
|
|
7450
7450
|
this.angular = new Float64Array(3);
|
|
7451
|
-
this.basis = new
|
|
7451
|
+
this.basis = new chunk3S6WPBZL_js.Basis();
|
|
7452
7452
|
}
|
|
7453
7453
|
pointVelocity(ox, oy, oz, out, at = 0) {
|
|
7454
7454
|
let w = this.angular;
|
|
@@ -7502,7 +7502,7 @@ function hinge(r) {
|
|
|
7502
7502
|
function rotate(v, axis, angle, sc, out) {
|
|
7503
7503
|
if (angle === 0)
|
|
7504
7504
|
return out[0] = v[0], out[1] = v[1], out[2] = v[2], out;
|
|
7505
|
-
|
|
7505
|
+
chunk3S6WPBZL_js.sinCos(angle, sc);
|
|
7506
7506
|
let s = sc.sin, c = sc.cos, kx = axis[1] * v[2] - axis[2] * v[1], ky = axis[2] * v[0] - axis[0] * v[2], kz = axis[0] * v[1] - axis[1] * v[0], d = (axis[0] * v[0] + axis[1] * v[1] + axis[2] * v[2]) * (1 - c);
|
|
7507
7507
|
return out[0] = v[0] * c + kx * s + axis[0] * d, out[1] = v[1] * c + ky * s + axis[1] * d, out[2] = v[2] * c + kz * s + axis[2] * d, out;
|
|
7508
7508
|
}
|
|
@@ -7518,7 +7518,7 @@ function groundEffect(gain, span, height) {
|
|
|
7518
7518
|
return 1 + gain * (1 - phi);
|
|
7519
7519
|
}
|
|
7520
7520
|
function sampleCurve2(cl, cd, alpha, out) {
|
|
7521
|
-
let position = clamp2((alpha +
|
|
7521
|
+
let position = clamp2((alpha + chunk3S6WPBZL_js.PI) / CURVE_STEP2, 0, (72)), index = Math.min(Math.floor(position), (72) - 1), t = position - index;
|
|
7522
7522
|
out[0] = cl[index] + (cl[index + 1] - cl[index]) * t, out[1] = cd[index] + (cd[index + 1] - cd[index]) * t;
|
|
7523
7523
|
}
|
|
7524
7524
|
var GearHits = class {
|
|
@@ -7542,7 +7542,7 @@ var GearHits = class {
|
|
|
7542
7542
|
this.previous = new Float64Array(8);
|
|
7543
7543
|
this.deployed = 1;
|
|
7544
7544
|
this.contacts = 0;
|
|
7545
|
-
this.sample = new
|
|
7545
|
+
this.sample = new chunk3S6WPBZL_js.WaterSample();
|
|
7546
7546
|
this.v = new Float64Array(12);
|
|
7547
7547
|
this.coefficients = new Float64Array(2);
|
|
7548
7548
|
this.sc = { sin: 0, cos: 0 };
|
|
@@ -7675,7 +7675,7 @@ var GearHits = class {
|
|
|
7675
7675
|
water.sample(wx, wz, this.sample), this.sample.height > wy && (this.wet[i] = 1, this.fluid[i * 3] = this.sample.velocityX, this.fluid[i * 3 + 1] = this.sample.velocityY, this.fluid[i * 3 + 2] = this.sample.velocityZ);
|
|
7676
7676
|
}
|
|
7677
7677
|
wetPossible && this.hullCount > 0 && (submerged = this.hydro(state, water, planing, wrench));
|
|
7678
|
-
let ge = groundEffect(this.groundEffect, this.span, ground), stalled = false, alphaOut =
|
|
7678
|
+
let ge = groundEffect(this.groundEffect, this.span, ground), stalled = false, alphaOut = chunk3S6WPBZL_js.atan2(-climb, Math.max(airX * b.bx + airY * b.by + airZ * b.bz, (1e-3)));
|
|
7679
7679
|
for (let i = 0; i < this.foils.length; i++) {
|
|
7680
7680
|
let f = this.foils[i], target = clamp2(evalMix(f.deflection, ch, 0), -f.maxDeflection, f.maxDeflection);
|
|
7681
7681
|
this.deflection[i] = approach(this.deflection[i], target, f.rate, dt);
|
|
@@ -7683,11 +7683,11 @@ var GearHits = class {
|
|
|
7683
7683
|
state.pointVelocity(ox, oy, oz, v, 0), b.toLocal(v[0] - this.fluid[i * 3], v[1] - this.fluid[i * 3 + 1], v[2] - this.fluid[i * 3 + 2], v, 3);
|
|
7684
7684
|
let uc = v[3] * f.chord[0] + v[4] * f.chord[1] + v[5] * f.chord[2], un = v[3] * f.normal[0] + v[4] * f.normal[1] + v[5] * f.normal[2], speed2 = uc * uc + un * un;
|
|
7685
7685
|
if (speed2 <= 0 || f.area <= 0) continue;
|
|
7686
|
-
let alpha =
|
|
7687
|
-
f.leeward && (d = alpha < 0 ? Math.abs(d) : -Math.abs(d)), sampleCurve2(f.cl, f.cd,
|
|
7686
|
+
let alpha = chunk3S6WPBZL_js.atan2(-un, uc), d = this.deflection[i];
|
|
7687
|
+
f.leeward && (d = alpha < 0 ? Math.abs(d) : -Math.abs(d)), sampleCurve2(f.cl, f.cd, chunk3S6WPBZL_js.wrapAngle(alpha + f.effectiveness * d), this.coefficients);
|
|
7688
7688
|
let cl = this.coefficients[0], cd = this.coefficients[1] + f.deflectionDrag * Math.abs(d);
|
|
7689
7689
|
f.groundEffect && !this.wet[i] && (cl *= ge, alphaOut = alpha, Math.abs(alpha) > this.stall && (stalled = true));
|
|
7690
|
-
let inverse = 1 / Math.sqrt(speed2), c = f.chord, n = f.normal, flowX = (c[0] * uc + n[0] * un) * inverse, flowY = (c[1] * uc + n[1] * un) * inverse, flowZ = (c[2] * uc + n[2] * un) * inverse, sx = c[1] * n[2] - c[2] * n[1], sy = c[2] * n[0] - c[0] * n[2], sz = c[0] * n[1] - c[1] * n[0], lx = sy * flowZ - sz * flowY, ly = sz * flowX - sx * flowZ, lz = sx * flowY - sy * flowX, k = 0.5 * (this.wet[i] ? rho :
|
|
7690
|
+
let inverse = 1 / Math.sqrt(speed2), c = f.chord, n = f.normal, flowX = (c[0] * uc + n[0] * un) * inverse, flowY = (c[1] * uc + n[1] * un) * inverse, flowZ = (c[2] * uc + n[2] * un) * inverse, sx = c[1] * n[2] - c[2] * n[1], sy = c[2] * n[0] - c[0] * n[2], sz = c[0] * n[1] - c[1] * n[0], lx = sy * flowZ - sz * flowY, ly = sz * flowX - sx * flowZ, lz = sx * flowY - sy * flowX, k = 0.5 * (this.wet[i] ? rho : chunk3S6WPBZL_js.AIR_DENSITY) * speed2 * f.area;
|
|
7691
7691
|
b.toWorld(lx * k * cl - flowX * k * cd, ly * k * cl - flowY * k * cd, lz * k * cl - flowZ * k * cd, v, 6), wrench.addAt(ox, oy, oz, v[6], v[7], v[8]);
|
|
7692
7692
|
}
|
|
7693
7693
|
let thrustTotal = 0, spoolTotal = 0;
|
|
@@ -7724,9 +7724,9 @@ var GearHits = class {
|
|
|
7724
7724
|
let r2 = this.rotor[i] * this.rotor[i], effective = clamp2(collective - inflowSpeed * rotor.inflow, 0, (1.2)), thrust = rotor.maxThrust * effective * r2 * groundEffect(rotor.groundEffect, 2 * rotor.radius, ground);
|
|
7725
7725
|
thrustTotal += thrust;
|
|
7726
7726
|
let pitch = clamp2(evalMix(rotor.cyclicPitch, ch, 0), -1, 1), roll = clamp2(evalMix(rotor.cyclicRoll, ch, 0), -1, 1);
|
|
7727
|
-
|
|
7727
|
+
chunk3S6WPBZL_js.sinCos(roll * rotor.cyclicTilt, this.sc);
|
|
7728
7728
|
let sr = this.sc.sin, cr = this.sc.cos;
|
|
7729
|
-
|
|
7729
|
+
chunk3S6WPBZL_js.sinCos(pitch * rotor.cyclicTilt, this.sc);
|
|
7730
7730
|
let sp = this.sc.sin, cp = this.sc.cos, dx = side[0] * sr * cp + axisLocal[0] * cr * cp + front[0] * sp, dy = side[1] * sr * cp + axisLocal[1] * cr * cp + front[1] * sp, dz = side[2] * sr * cp + axisLocal[2] * cr * cp + front[2] * sp;
|
|
7731
7731
|
b.toWorld(dx * thrust, dy * thrust, dz * thrust, v, 6), wrench.addAt(ox, oy, oz, v[6], v[7], v[8]);
|
|
7732
7732
|
let hub = rotor.hubStiffness * r2;
|
|
@@ -7746,7 +7746,7 @@ var GearHits = class {
|
|
|
7746
7746
|
}
|
|
7747
7747
|
if (this.airDrag[0] > 0 || this.airDrag[1] > 0 || this.airDrag[2] > 0) {
|
|
7748
7748
|
b.toLocal(airX, airY, airZ, v, 0);
|
|
7749
|
-
let k = -0.5 *
|
|
7749
|
+
let k = -0.5 * chunk3S6WPBZL_js.AIR_DENSITY * airspeed;
|
|
7750
7750
|
b.toWorld(k * this.airDrag[0] * v[0], k * this.airDrag[1] * v[1], k * this.airDrag[2] * v[2], v, 3), wrench.addAt(0, 0, 0, v[3], v[4], v[5]);
|
|
7751
7751
|
}
|
|
7752
7752
|
if (submerged > 0) {
|
|
@@ -7761,7 +7761,7 @@ var GearHits = class {
|
|
|
7761
7761
|
}
|
|
7762
7762
|
this.assistForces(state, ch, wrench), this.gear(state, hits, evalMix(this.gearSteer, ch, 0), evalMix(this.gearBrake, ch, 0), evalMix(this.gearDeploy, ch, 0), dt, wrench);
|
|
7763
7763
|
let t = this.telemetry;
|
|
7764
|
-
return t[0] = speed, t[1] = submerged, t[2] = planing, t[3] =
|
|
7764
|
+
return t[0] = speed, t[1] = submerged, t[2] = planing, t[3] = chunk3S6WPBZL_js.atan2(b.ry, b.uy), t[4] = airspeed, t[5] = alphaOut, t[6] = stalled ? 1 : 0, t[7] = ge, t[8] = this.contacts, t[9] = this.deployed, t[10] = spoolTotal / Math.max(this.thrusters.length, 1), t[11] = rotorTotal / Math.max(this.rotors.length, 1), t[12] = thrustTotal, t[13] = climb, t[14] = Math.hypot(wind[0] - state.linear[0], wind[1] - state.linear[1], wind[2] - state.linear[2]), t[15] = chunk3S6WPBZL_js.atan2(b.by, Math.hypot(b.bx, b.bz)), wrench;
|
|
7765
7765
|
}
|
|
7766
7766
|
hydro(state, water, planing, wrench) {
|
|
7767
7767
|
let b = state.basis, v = this.v, s = this.sample, rho = water.density, rhoG = rho * water.gravity, dragScale = 1 + (this.planingDrag - 1) * planing, submergedVolume = 0, line = water.crest() + (0.01) + Math.abs(water.crest()) * (1e-5), cols = this.columnX.length;
|
|
@@ -7798,7 +7798,7 @@ var GearHits = class {
|
|
|
7798
7798
|
if (level2 <= 0) return;
|
|
7799
7799
|
let [pitch, roll, yaw, lift] = this.assistChannels;
|
|
7800
7800
|
b.toLocal(airX, airY, airZ, this.v, 0);
|
|
7801
|
-
let alpha =
|
|
7801
|
+
let alpha = chunk3S6WPBZL_js.atan2(-this.v[1], Math.max(this.v[2], (1e-3)));
|
|
7802
7802
|
if (pitch !== 255 && ch[pitch] > 0 && alpha > this.stall - (0.08)) {
|
|
7803
7803
|
let room = clamp2((this.stall - alpha) / (0.08), 0, 1);
|
|
7804
7804
|
ch[pitch] *= 1 - level2 * this.assist[5] * (1 - room);
|
|
@@ -7829,7 +7829,7 @@ var GearHits = class {
|
|
|
7829
7829
|
if (load <= 0) continue;
|
|
7830
7830
|
contacts |= 1 << i, b.toWorld(w.position[0], w.position[1], w.position[2], v, 0);
|
|
7831
7831
|
let drop = length2 + w.radius, cx = v[0] - b.ux * drop, cy = v[1] - b.uy * drop, cz = v[2] - b.uz * drop, nx = hits.normal[i * 3], ny = hits.normal[i * 3 + 1], nz = hits.normal[i * 3 + 2];
|
|
7832
|
-
|
|
7832
|
+
chunk3S6WPBZL_js.sinCos(steer * w.steer, this.sc), b.toWorld(-this.sc.sin, 0, this.sc.cos, v, 3);
|
|
7833
7833
|
let along = v[3] * nx + v[4] * ny + v[5] * nz, fx = v[3] - nx * along, fy = v[4] - ny * along, fz = v[5] - nz * along, size2 = Math.hypot(fx, fy, fz);
|
|
7834
7834
|
size2 > 0 ? (fx /= size2, fy /= size2, fz /= size2) : (fx = b.bx, fy = b.by, fz = b.bz);
|
|
7835
7835
|
let lx = ny * fz - nz * fy, ly = nz * fx - nx * fz, lz = nx * fy - ny * fx;
|
|
@@ -7852,7 +7852,7 @@ var GearHits = class {
|
|
|
7852
7852
|
var SCRIPT_CRAFT_NAME = "script-craft", GROUND_PROBE_SPANS = 2, ScriptCraft = class {
|
|
7853
7853
|
constructor(port, transforms, stepSeconds, capacity = 64) {
|
|
7854
7854
|
this.name = SCRIPT_CRAFT_NAME;
|
|
7855
|
-
this.water = new
|
|
7855
|
+
this.water = new chunk3S6WPBZL_js.Water();
|
|
7856
7856
|
this.state = new RigidState();
|
|
7857
7857
|
this.wrench = new Wrench();
|
|
7858
7858
|
this.hits = new GearHits();
|
|
@@ -7868,7 +7868,7 @@ var SCRIPT_CRAFT_NAME = "script-craft", GROUND_PROBE_SPANS = 2, ScriptCraft = cl
|
|
|
7868
7868
|
this.water.configure(desc);
|
|
7869
7869
|
}
|
|
7870
7870
|
sea(state, windRadians, seed) {
|
|
7871
|
-
this.water.configure(
|
|
7871
|
+
this.water.configure(chunk3S6WPBZL_js.seaDesc(state, windRadians, seed));
|
|
7872
7872
|
}
|
|
7873
7873
|
setOcean(desc) {
|
|
7874
7874
|
this.ocean = desc;
|
|
@@ -7940,7 +7940,7 @@ var SCRIPT_CRAFT_NAME = "script-craft", GROUND_PROBE_SPANS = 2, ScriptCraft = cl
|
|
|
7940
7940
|
};
|
|
7941
7941
|
|
|
7942
7942
|
// src/game/physics/physics.ts
|
|
7943
|
-
var RigidBody =
|
|
7943
|
+
var RigidBody = chunkAZAXD44P_js.defineComponent("rigid_body", { body: "u32", kind: "u8" }), KIND_DYNAMIC = 0, KIND_KINEMATIC = 1, KIND_FIXED = 2, UP3 = [0, 1, 0], GROUP_MASK = 65535, BODY_WRITE_FORCE = 0, BODY_WRITE_IMPULSE = 1;
|
|
7944
7944
|
function boundedInteger(value, min, max, what) {
|
|
7945
7945
|
if (!Number.isInteger(value) || value < min || value > max)
|
|
7946
7946
|
throw new chunk2V7IL4HC_js.GameError("invalid_argument", `${what} must be an integer from ${min} to ${max}`);
|
|
@@ -7952,7 +7952,7 @@ function kindCode(kind) {
|
|
|
7952
7952
|
var Physics = class {
|
|
7953
7953
|
constructor(port, world, transforms, stepSeconds, options = {}) {
|
|
7954
7954
|
this.zero = new chunkRCQ2MPBV_js.Vec3();
|
|
7955
|
-
this.vehicleDesc = new Float32Array(
|
|
7955
|
+
this.vehicleDesc = new Float32Array(chunk3S6WPBZL_js.VEHICLE_DESC_WORDS);
|
|
7956
7956
|
this.vehicles = [];
|
|
7957
7957
|
this.rollbackStates = [];
|
|
7958
7958
|
this.enrolledIn = null;
|
|
@@ -8098,10 +8098,10 @@ var Physics = class {
|
|
|
8098
8098
|
return this.port.castShape(query, hit);
|
|
8099
8099
|
}
|
|
8100
8100
|
setColliderClass(collider, colliderClass) {
|
|
8101
|
-
this.port.setColliderClass(collider,
|
|
8101
|
+
this.port.setColliderClass(collider, chunk3S6WPBZL_js.checkColliderClass(colliderClass));
|
|
8102
8102
|
}
|
|
8103
8103
|
setContactRule(platformClass, otherClass, rule) {
|
|
8104
|
-
|
|
8104
|
+
chunk3S6WPBZL_js.checkColliderClass(platformClass), chunk3S6WPBZL_js.checkColliderClass(otherClass), this.port.setContactRule(platformClass, otherClass, rule);
|
|
8105
8105
|
}
|
|
8106
8106
|
setCollisionGroups(collider, membership, filter) {
|
|
8107
8107
|
if (!(Number.isInteger(membership) && Number.isInteger(filter) && membership >= 0 && filter >= 0 && membership <= (65535) && filter <= (65535)))
|
|
@@ -8109,7 +8109,7 @@ var Physics = class {
|
|
|
8109
8109
|
this.port.setCollisionGroups(collider, membership, filter);
|
|
8110
8110
|
}
|
|
8111
8111
|
removeContactRule(platformClass, otherClass) {
|
|
8112
|
-
this.setContactRule(platformClass, otherClass,
|
|
8112
|
+
this.setContactRule(platformClass, otherClass, chunk3S6WPBZL_js.NO_CONTACT_RULE);
|
|
8113
8113
|
}
|
|
8114
8114
|
ignoreContacts(classA, classB) {
|
|
8115
8115
|
this.setContactRule(classA, classB, { ignore: true });
|
|
@@ -8211,8 +8211,8 @@ var Physics = class {
|
|
|
8211
8211
|
createVehicle(entity, desc) {
|
|
8212
8212
|
let port = this.port.vehicles;
|
|
8213
8213
|
if (!port) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", `${this.port.name} physics has no vehicle controller`);
|
|
8214
|
-
|
|
8215
|
-
let id = port.createVehicle(this.bodyOf(entity), this.vehicleDesc), vehicle = new
|
|
8214
|
+
chunk3S6WPBZL_js.encodeVehicleDesc(desc, this.vehicleDesc);
|
|
8215
|
+
let id = port.createVehicle(this.bodyOf(entity), this.vehicleDesc), vehicle = new chunk3S6WPBZL_js.Vehicle(port, id, entity, desc.wheels.length);
|
|
8216
8216
|
for (let other of this.vehicles) other.refresh();
|
|
8217
8217
|
return this.vehicles.push(vehicle), vehicle;
|
|
8218
8218
|
}
|
|
@@ -8949,7 +8949,7 @@ function groupNames(mask) {
|
|
|
8949
8949
|
}
|
|
8950
8950
|
|
|
8951
8951
|
// src/game/transform.ts
|
|
8952
|
-
var Transform =
|
|
8952
|
+
var Transform = chunkAZAXD44P_js.defineComponent("transform", {
|
|
8953
8953
|
position: ["f32", 3],
|
|
8954
8954
|
rotation: ["f32", 4],
|
|
8955
8955
|
scale: ["f32", 3],
|
|
@@ -9233,43 +9233,43 @@ var Stats = class {
|
|
|
9233
9233
|
this.read = read;
|
|
9234
9234
|
}
|
|
9235
9235
|
get live() {
|
|
9236
|
-
return this.read()[
|
|
9236
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.live];
|
|
9237
9237
|
}
|
|
9238
9238
|
get loading() {
|
|
9239
|
-
return this.read()[
|
|
9239
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.loading];
|
|
9240
9240
|
}
|
|
9241
9241
|
get waiting() {
|
|
9242
|
-
return this.read()[
|
|
9242
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.waiting];
|
|
9243
9243
|
}
|
|
9244
9244
|
get failed() {
|
|
9245
|
-
return this.read()[
|
|
9245
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.failed];
|
|
9246
9246
|
}
|
|
9247
9247
|
get inflight() {
|
|
9248
|
-
return this.read()[
|
|
9248
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.inflight];
|
|
9249
9249
|
}
|
|
9250
9250
|
get installed() {
|
|
9251
|
-
return this.read()[
|
|
9251
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.installed];
|
|
9252
9252
|
}
|
|
9253
9253
|
get installedBytes() {
|
|
9254
|
-
return this.read()[
|
|
9254
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.installedBytes];
|
|
9255
9255
|
}
|
|
9256
9256
|
get evicted() {
|
|
9257
|
-
return this.read()[
|
|
9257
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.evicted];
|
|
9258
9258
|
}
|
|
9259
9259
|
get residentBytes() {
|
|
9260
|
-
return this.read()[
|
|
9260
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.residentKib] * (1024);
|
|
9261
9261
|
}
|
|
9262
9262
|
get poolBytes() {
|
|
9263
|
-
return this.read()[
|
|
9263
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.poolKib] * (1024);
|
|
9264
9264
|
}
|
|
9265
9265
|
get proxyBytes() {
|
|
9266
|
-
return this.read()[
|
|
9266
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.proxyKib] * (1024);
|
|
9267
9267
|
}
|
|
9268
9268
|
get sourceBytes() {
|
|
9269
|
-
return this.read()[
|
|
9269
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.sourceKib] * (1024);
|
|
9270
9270
|
}
|
|
9271
9271
|
get totalInstalls() {
|
|
9272
|
-
return this.read()[
|
|
9272
|
+
return this.read()[chunk7AAIAVAA_js.STREAM_REGISTER.totalInstalls];
|
|
9273
9273
|
}
|
|
9274
9274
|
}, WorldStream = class {
|
|
9275
9275
|
constructor(port, handle, options, physics, world, transforms, colliders, lazy = false) {
|
|
@@ -9279,8 +9279,8 @@ var Stats = class {
|
|
|
9279
9279
|
this.world = world;
|
|
9280
9280
|
this.transforms = transforms;
|
|
9281
9281
|
this.lazy = lazy;
|
|
9282
|
-
this.eye = new Float32Array(
|
|
9283
|
-
this.collider = new Float32Array(
|
|
9282
|
+
this.eye = new Float32Array(chunk7AAIAVAA_js.STREAM_EYE_FLOATS);
|
|
9283
|
+
this.collider = new Float32Array(chunk7AAIAVAA_js.STREAM_COLLIDER_FLOATS);
|
|
9284
9284
|
this.extents = [0, 0, 0];
|
|
9285
9285
|
this.offset = [0, 0, 0];
|
|
9286
9286
|
this.rotation = [0, 0, 0, 1];
|
|
@@ -9297,19 +9297,19 @@ var Stats = class {
|
|
|
9297
9297
|
let packs = lazy ? this.paths.length : 0;
|
|
9298
9298
|
this.kept = Array.from({ length: packs }, () => null), this.contended = Array.from({ length: packs }, () => null), this.fetching = new Uint8Array(packs), this.dropped = new Uint8Array(packs), this.retryAt = new Int32Array(packs).fill((-1)), this.retryPriority = new Uint8Array(packs), this.backoff = new Uint16Array(packs), this.stats = new Stats(() => this.view()), this.worldBytes = options.world, this.shape = worldShape(options.world), this.navHeld = Array.from({ length: this.shape.navPacks }, () => null), this.navLoaded = new Uint8Array(this.shape.navPacks);
|
|
9299
9299
|
let logic = options.colliders === false ? null : options.colliders ?? {}, actors = logic?.actors ?? (8), budget = logic?.budget ?? (16);
|
|
9300
|
-
this.actorBuffer = new Float32Array(actors *
|
|
9301
|
-
let reader = this.reader, eager = options.packs ?? (lazy || reader === null ? NO_PACKS : this.paths.map((path, pack) => reader.take(path, pack ===
|
|
9300
|
+
this.actorBuffer = new Float32Array(actors * chunk7AAIAVAA_js.STREAM_ACTOR_FLOATS), this.ops = new Uint32Array(logic && physics && colliders > 0 ? budget : 0), this.physicsOf = new Int32Array(this.ops.length > 0 ? colliders : 0).fill((-1)), this.desc = { shape: { kind: "cuboid", halfExtents: this.extents }, offset: this.offset, rotation: this.rotation, friction: (0.9) }, this.ops.length > 0 && port.openLogic(handle, logic?.stepSeconds ?? DEFAULT_STEP_SECONDS, budget, actors);
|
|
9301
|
+
let reader = this.reader, eager = options.packs ?? (lazy || reader === null ? NO_PACKS : this.paths.map((path, pack) => reader.take(path, pack === chunk7AAIAVAA_js.STREAM_START_PACK ? chunk7AAIAVAA_js.STREAM_PRIORITY_NOW : chunk7AAIAVAA_js.STREAM_PRIORITY_SOON)));
|
|
9302
9302
|
this.ready = this.feed(eager);
|
|
9303
9303
|
}
|
|
9304
9304
|
servePacks() {
|
|
9305
|
-
let registers = this.view(), asked = Math.min(registers[
|
|
9305
|
+
let registers = this.view(), asked = Math.min(registers[chunk7AAIAVAA_js.STREAM_PACK_REQUESTS], chunk7AAIAVAA_js.STREAM_MAX_PACK_REQUESTS);
|
|
9306
9306
|
for (let i = 0; i < asked; i++) {
|
|
9307
|
-
let word = registers[
|
|
9308
|
-
this.request(word &
|
|
9307
|
+
let word = registers[chunk7AAIAVAA_js.STREAM_REQUEST_LIST + i];
|
|
9308
|
+
this.request(word & chunk7AAIAVAA_js.STREAM_PACK_MASK, word >>> chunk7AAIAVAA_js.STREAM_PRIORITY_SHIFT);
|
|
9309
9309
|
}
|
|
9310
|
-
let released = Math.min(registers[
|
|
9310
|
+
let released = Math.min(registers[chunk7AAIAVAA_js.STREAM_PACK_RELEASES], chunk7AAIAVAA_js.STREAM_MAX_PACK_RELEASES);
|
|
9311
9311
|
for (let i = 0; i < released; i++) {
|
|
9312
|
-
let pack = registers[
|
|
9312
|
+
let pack = registers[chunk7AAIAVAA_js.STREAM_RELEASE_LIST + i];
|
|
9313
9313
|
pack >= this.shape.meshPacks && this.dropNav(pack - this.shape.meshPacks), pack < this.dropped.length && (this.dropped[pack] = this.fetching[pack], this.retryAt[pack] = (-1));
|
|
9314
9314
|
let path = this.paths[pack];
|
|
9315
9315
|
path !== void 0 && this.reader?.lazy?.(path) === true && this.reader.release?.(path);
|
|
@@ -9356,7 +9356,7 @@ var Stats = class {
|
|
|
9356
9356
|
providePack(pack, bytes) {
|
|
9357
9357
|
if (!this.closed)
|
|
9358
9358
|
try {
|
|
9359
|
-
this.contended[pack] = this.port.provide(this.handle, bytes) ===
|
|
9359
|
+
this.contended[pack] = this.port.provide(this.handle, bytes) === chunk7AAIAVAA_js.STREAM_PACK_CONTENDED ? bytes : null, this.holdNav(bytes);
|
|
9360
9360
|
} catch {
|
|
9361
9361
|
this.kept[pack] = null, this.contended[pack] = null;
|
|
9362
9362
|
}
|
|
@@ -9397,7 +9397,7 @@ var Stats = class {
|
|
|
9397
9397
|
}
|
|
9398
9398
|
provide(bytes) {
|
|
9399
9399
|
if (!this.closed) {
|
|
9400
|
-
if (this.port.provide(this.handle, bytes) ===
|
|
9400
|
+
if (this.port.provide(this.handle, bytes) === chunk7AAIAVAA_js.STREAM_PACK_CONTENDED) {
|
|
9401
9401
|
this.waitingEager.push(bytes);
|
|
9402
9402
|
return;
|
|
9403
9403
|
}
|
|
@@ -9419,12 +9419,12 @@ var Stats = class {
|
|
|
9419
9419
|
return this.lazy;
|
|
9420
9420
|
}
|
|
9421
9421
|
setActor(index, position) {
|
|
9422
|
-
let at = index *
|
|
9423
|
-
if (at + 1 >= this.actorBuffer.length) throw new chunk2V7IL4HC_js.GameError("capacity_exceeded", `world colliders track at most ${this.actorBuffer.length /
|
|
9422
|
+
let at = index * chunk7AAIAVAA_js.STREAM_ACTOR_FLOATS;
|
|
9423
|
+
if (at + 1 >= this.actorBuffer.length) throw new chunk2V7IL4HC_js.GameError("capacity_exceeded", `world colliders track at most ${this.actorBuffer.length / chunk7AAIAVAA_js.STREAM_ACTOR_FLOATS} actors`);
|
|
9424
9424
|
this.actorBuffer[at] = position.x, this.actorBuffer[at + 1] = position.z, index >= this.actorCount && (this.actorCount = index + 1);
|
|
9425
9425
|
}
|
|
9426
9426
|
setActorCount(count) {
|
|
9427
|
-
this.actorCount = Math.min(count, this.actorBuffer.length /
|
|
9427
|
+
this.actorCount = Math.min(count, this.actorBuffer.length / chunk7AAIAVAA_js.STREAM_ACTOR_FLOATS);
|
|
9428
9428
|
}
|
|
9429
9429
|
/**
|
|
9430
9430
|
* Streams the world's baked nav tiles into `nav`: tiles arrive with their nav packs as the camera nears the ground
|
|
@@ -9459,10 +9459,10 @@ var Stats = class {
|
|
|
9459
9459
|
let physics = this.physics;
|
|
9460
9460
|
if (this.closed || physics === null || this.ops.length === 0) return 0;
|
|
9461
9461
|
let n = this.port.stepLogic(this.handle, this.actorBuffer, this.actorCount, this.ops);
|
|
9462
|
-
if (this.collidersWaiting = n ===
|
|
9462
|
+
if (this.collidersWaiting = n === chunk7AAIAVAA_js.STREAM_PACK_CONTENDED, this.collidersWaiting) return 0;
|
|
9463
9463
|
for (let i = 0; i < n; i++) {
|
|
9464
9464
|
let op2 = this.ops[i], index = op2 >>> 1;
|
|
9465
|
-
(op2 &
|
|
9465
|
+
(op2 & chunk7AAIAVAA_js.STREAM_OP_INSERT) !== 0 ? this.insert(physics, index) : this.remove(physics, index);
|
|
9466
9466
|
}
|
|
9467
9467
|
return n;
|
|
9468
9468
|
}
|
|
@@ -9501,7 +9501,7 @@ var Stats = class {
|
|
|
9501
9501
|
let colliders = colliderCount(options.world), reader = options.assets ?? null;
|
|
9502
9502
|
if (options.packs === void 0 && (reader === null || options.packPaths === void 0))
|
|
9503
9503
|
throw new chunk2V7IL4HC_js.GameError("invalid_argument", "a world stream needs its packs, or packPaths with assets");
|
|
9504
|
-
let lazy = options.packs === void 0 && reader?.requests?.() === true && port.lazyPacks?.() === true, tier =
|
|
9504
|
+
let lazy = options.packs === void 0 && reader?.requests?.() === true && port.lazyPacks?.() === true, tier = chunk7AAIAVAA_js.TIER_INDEX[options.tier ?? "mid"] | (lazy ? chunk7AAIAVAA_js.STREAM_LAZY_PACKS_FLAG : 0), handle = port.open(options.world, options.materials, tier);
|
|
9505
9505
|
return new WorldStream(port, handle, options, this.physics, this.world, this.transforms, colliders, lazy);
|
|
9506
9506
|
}
|
|
9507
9507
|
};
|
|
@@ -9587,14 +9587,14 @@ var Fluid = class {
|
|
|
9587
9587
|
this.port = port;
|
|
9588
9588
|
this.transforms = transforms;
|
|
9589
9589
|
this.physics = physics;
|
|
9590
|
-
this.desc = new Float32Array(
|
|
9591
|
-
this.look = new Float32Array(
|
|
9592
|
-
this.emitter = new Float32Array(
|
|
9593
|
-
this.block = new Float32Array(
|
|
9594
|
-
this.forces = new Float32Array(
|
|
9590
|
+
this.desc = new Float32Array(chunk7AAIAVAA_js.FLUID_DESC_FLOATS);
|
|
9591
|
+
this.look = new Float32Array(chunk7AAIAVAA_js.FLUID_SURFACE_FLOATS);
|
|
9592
|
+
this.emitter = new Float32Array(chunk7AAIAVAA_js.FLUID_EMITTER_FLOATS);
|
|
9593
|
+
this.block = new Float32Array(chunk7AAIAVAA_js.FLUID_COLLIDER_FLOATS * chunk7AAIAVAA_js.FLUID_MAX_COLLIDERS);
|
|
9594
|
+
this.forces = new Float32Array(chunk7AAIAVAA_js.FLUID_FORCE_FLOATS);
|
|
9595
9595
|
this.slots = [];
|
|
9596
|
-
this.order = new Int32Array(
|
|
9597
|
-
this.used = new Array(
|
|
9596
|
+
this.order = new Int32Array(chunk7AAIAVAA_js.FLUID_MAX_COLLIDERS);
|
|
9597
|
+
this.used = new Array(chunk7AAIAVAA_js.FLUID_MAX_EMITTERS).fill(false);
|
|
9598
9598
|
this.position = new chunkRCQ2MPBV_js.Vec3();
|
|
9599
9599
|
this.rotation = new chunkRCQ2MPBV_js.Quat();
|
|
9600
9600
|
this.velocity = new chunkRCQ2MPBV_js.Vec3();
|
|
@@ -9603,7 +9603,7 @@ var Fluid = class {
|
|
|
9603
9603
|
this.offset = new chunkRCQ2MPBV_js.Vec3();
|
|
9604
9604
|
this.feedback = 0;
|
|
9605
9605
|
this.disposed = false;
|
|
9606
|
-
if ((port.caps &
|
|
9606
|
+
if ((port.caps & chunk7AAIAVAA_js.FLUID_CAP_SIMULATION) === 0)
|
|
9607
9607
|
throw new chunk2V7IL4HC_js.GameError("unsupported_feature", "this device has no GPU compute for fluids (engine feature fluid_1 reports no simulation)");
|
|
9608
9608
|
this.material = options.material ?? "water";
|
|
9609
9609
|
let cell2 = options.cell ?? (0.1);
|
|
@@ -9632,21 +9632,21 @@ var Fluid = class {
|
|
|
9632
9632
|
}
|
|
9633
9633
|
emit(desc) {
|
|
9634
9634
|
let index = this.used.indexOf(false);
|
|
9635
|
-
if (index < 0) throw new chunk2V7IL4HC_js.GameError("capacity_exceeded", `a fluid holds at most ${
|
|
9635
|
+
if (index < 0) throw new chunk2V7IL4HC_js.GameError("capacity_exceeded", `a fluid holds at most ${chunk7AAIAVAA_js.FLUID_MAX_EMITTERS} emitters`);
|
|
9636
9636
|
return this.setEmitter(index, desc), index;
|
|
9637
9637
|
}
|
|
9638
9638
|
pour(desc) {
|
|
9639
9639
|
if (desc.kind === "stream") throw new chunk2V7IL4HC_js.GameError("invalid_argument", "pour fills a box or a sphere once; use emit for streams");
|
|
9640
|
-
let index = this.used.indexOf(false), slot = index < 0 ?
|
|
9640
|
+
let index = this.used.indexOf(false), slot = index < 0 ? chunk7AAIAVAA_js.FLUID_MAX_EMITTERS - 1 : index;
|
|
9641
9641
|
packFluidEmitter(this.emitter, desc), this.port.emitter(this.id, slot, this.emitter);
|
|
9642
9642
|
}
|
|
9643
9643
|
setEmitter(index, desc) {
|
|
9644
|
-
if (index < 0 || index >=
|
|
9644
|
+
if (index < 0 || index >= chunk7AAIAVAA_js.FLUID_MAX_EMITTERS) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "emitter index out of range");
|
|
9645
9645
|
packFluidEmitter(this.emitter, desc), this.port.emitter(this.id, index, this.emitter), this.used[index] = desc !== null && desc.kind === "stream";
|
|
9646
9646
|
}
|
|
9647
9647
|
collider(entity, shape, options = {}) {
|
|
9648
9648
|
let index = this.slots.indexOf(null);
|
|
9649
|
-
if (index < 0 && (index = this.slots.length), index >=
|
|
9649
|
+
if (index < 0 && (index = this.slots.length), index >= chunk7AAIAVAA_js.FLUID_MAX_COLLIDERS) throw new chunk2V7IL4HC_js.GameError("capacity_exceeded", `a fluid couples at most ${chunk7AAIAVAA_js.FLUID_MAX_COLLIDERS} colliders`);
|
|
9650
9650
|
let kind = (0), extent = [0, 0, 0], volume = 0, centre = NO_OFFSET;
|
|
9651
9651
|
if ("sphere" in shape) extent = [shape.sphere, 0, 0];
|
|
9652
9652
|
else if ("box" in shape)
|
|
@@ -9680,15 +9680,15 @@ var Fluid = class {
|
|
|
9680
9680
|
for (let i = 0; i < this.slots.length; i++) {
|
|
9681
9681
|
let slot = this.slots[i];
|
|
9682
9682
|
if (slot === null) continue;
|
|
9683
|
-
let at = count *
|
|
9684
|
-
this.order[count] = i, this.transforms.position(slot.entity, this.position), this.transforms.rotation(slot.entity, this.rotation), slot.kind === (3) && (this.offset.set(slot.centre[0], slot.centre[1], slot.centre[2]).applyQuat(this.rotation), this.position.set(this.position.x + this.offset.x, this.position.y + this.offset.y, this.position.z + this.offset.z)), this.physics.hasBody(slot.entity) ? (this.physics.linearVelocity(slot.entity, this.velocity), this.physics.angularVelocity(slot.entity, this.spin)) : (this.velocity.set(0, 0, 0), this.spin.set(0, 0, 0)), b[at] = slot.kind, b[at + 1] = this.position.x, b[at + 2] = this.position.y, b[at + 3] = this.position.z, b[at + 4] = this.rotation.x, b[at + 5] = this.rotation.y, b[at + 6] = this.rotation.z, b[at + 7] = this.rotation.w, b[at + 8] = slot.extent[0], b[at + 9] = slot.extent[1], b[at + 10] = slot.extent[2], b[at + 11] = this.velocity.x, b[at + 12] = this.velocity.y, b[at + 13] = this.velocity.z, b[at + 14] = this.spin.x, b[at + 15] = this.spin.y, b[at + 16] = this.spin.z, b[at + 17] = slot.friction, b[at +
|
|
9683
|
+
let at = count * chunk7AAIAVAA_js.FLUID_COLLIDER_FLOATS, b = this.block;
|
|
9684
|
+
this.order[count] = i, this.transforms.position(slot.entity, this.position), this.transforms.rotation(slot.entity, this.rotation), slot.kind === (3) && (this.offset.set(slot.centre[0], slot.centre[1], slot.centre[2]).applyQuat(this.rotation), this.position.set(this.position.x + this.offset.x, this.position.y + this.offset.y, this.position.z + this.offset.z)), this.physics.hasBody(slot.entity) ? (this.physics.linearVelocity(slot.entity, this.velocity), this.physics.angularVelocity(slot.entity, this.spin)) : (this.velocity.set(0, 0, 0), this.spin.set(0, 0, 0)), b[at] = slot.kind, b[at + 1] = this.position.x, b[at + 2] = this.position.y, b[at + 3] = this.position.z, b[at + 4] = this.rotation.x, b[at + 5] = this.rotation.y, b[at + 6] = this.rotation.z, b[at + 7] = this.rotation.w, b[at + 8] = slot.extent[0], b[at + 9] = slot.extent[1], b[at + 10] = slot.extent[2], b[at + 11] = this.velocity.x, b[at + 12] = this.velocity.y, b[at + 13] = this.velocity.z, b[at + 14] = this.spin.x, b[at + 15] = this.spin.y, b[at + 16] = this.spin.z, b[at + 17] = slot.friction, b[at + chunk7AAIAVAA_js.FLUID_COLLIDER_VOLUME] = slot.volume, count++;
|
|
9685
9685
|
}
|
|
9686
9686
|
if (this.port.colliders(this.id, this.block, count), this.port.step(this.id, seconds), this.feedback !== 0) {
|
|
9687
9687
|
this.port.forces(this.id, this.forces);
|
|
9688
9688
|
for (let k = 0; k < count; k++) {
|
|
9689
9689
|
let slot = this.slots[this.order[k]];
|
|
9690
9690
|
if (slot === null || !slot.feedback || !this.physics.hasBody(slot.entity)) continue;
|
|
9691
|
-
let f = k *
|
|
9691
|
+
let f = k * chunk7AAIAVAA_js.FLUID_FORCE_WORDS;
|
|
9692
9692
|
this.impulse.set(this.forces[f], this.forces[f + 1], this.forces[f + 2]), this.physics.applyImpulse(slot.entity, this.impulse), this.impulse.set(this.forces[f + 3], this.forces[f + 4], this.forces[f + 5]), this.physics.applyTorqueImpulse(slot.entity, this.impulse);
|
|
9693
9693
|
}
|
|
9694
9694
|
}
|
|
@@ -9741,22 +9741,22 @@ var ReactiveFluid = class {
|
|
|
9741
9741
|
this.port = port;
|
|
9742
9742
|
this.chemistry = chemistry;
|
|
9743
9743
|
this.ownsChemistry = ownsChemistry;
|
|
9744
|
-
this.emitterWords = new Float32Array(
|
|
9744
|
+
this.emitterWords = new Float32Array(chunk7AAIAVAA_js.FLUID_EMITTER_FLOATS);
|
|
9745
9745
|
this.medium = null;
|
|
9746
9746
|
this.frame = 0;
|
|
9747
9747
|
this.disposed = false;
|
|
9748
9748
|
this.framesPerTick = whole(desc.framesPerTick ?? REACTIVE_DEFAULTS.framesPerTick, 1, (64), "framesPerTick"), this.volume = desc.volume, this.cells = [...desc.volume.cells];
|
|
9749
|
-
let w = new Uint32Array(
|
|
9750
|
-
for (let k = 0; k < (3); k++) w[
|
|
9751
|
-
f[
|
|
9749
|
+
let w = new Uint32Array(chunk7AAIAVAA_js.REACTIVE_DESC_WORDS), f = new Float32Array(w.buffer);
|
|
9750
|
+
for (let k = 0; k < (3); k++) w[chunk7AAIAVAA_js.REACTIVE_GRID + k] = whole(desc.volume.cells[k], 1, chunk7AAIAVAA_js.REACTIVE_MAX_EDGE, "a reactive volume axis");
|
|
9751
|
+
f[chunk7AAIAVAA_js.REACTIVE_ORIGIN] = finite2(desc.volume.origin.x, "the volume origin"), f[chunk7AAIAVAA_js.REACTIVE_ORIGIN + 1] = finite2(desc.volume.origin.y, "the volume origin"), f[chunk7AAIAVAA_js.REACTIVE_ORIGIN + 2] = finite2(desc.volume.origin.z, "the volume origin"), f[chunk7AAIAVAA_js.REACTIVE_CELL] = finite2(desc.volume.cell, "the volume cell"), w[chunk7AAIAVAA_js.REACTIVE_LIQUID] = this.species(desc.liquid), w[chunk7AAIAVAA_js.REACTIVE_LIQUID_KELVIN] = whole(desc.liquidKelvin ?? REACTIVE_DEFAULTS.liquidKelvin, 1, (7999), "liquidKelvin"), w[chunk7AAIAVAA_js.REACTIVE_PARCELS] = whole(desc.parcels ?? REACTIVE_DEFAULTS.parcels, 1, (255), "parcels"), f[chunk7AAIAVAA_js.REACTIVE_CONTACT] = finite2(desc.contact ?? REACTIVE_DEFAULTS.contact, "contact"), w[chunk7AAIAVAA_js.REACTIVE_COUPLING] = whole(Math.round((desc.coupling ?? REACTIVE_DEFAULTS.coupling) * (256)), 0, 4294967295, "coupling"), w[chunk7AAIAVAA_js.REACTIVE_MAX_PAIRS] = whole(desc.maxPairs ?? REACTIVE_DEFAULTS.maxPairs, 1, 4294967295, "maxPairs");
|
|
9752
9752
|
let seed = whole(desc.seed ?? REACTIVE_DEFAULTS.seed, 0, Number.MAX_SAFE_INTEGER, "seed");
|
|
9753
|
-
w[
|
|
9753
|
+
w[chunk7AAIAVAA_js.REACTIVE_SEED_LOW] = seed >>> 0, w[chunk7AAIAVAA_js.REACTIVE_SEED_HIGH] = Math.floor(seed / (4294967296)) >>> 0;
|
|
9754
9754
|
let smoke = desc.smoke ?? REACTIVE_DEFAULTS.smoke;
|
|
9755
|
-
if (smoke.length >
|
|
9756
|
-
for (let k = 0; k < smoke.length; k++) w[
|
|
9757
|
-
w[
|
|
9758
|
-
let fluid = new Float32Array(
|
|
9759
|
-
writeFluidGrid(fluid, desc.fluid, desc.fluid), this.handle = port.open(chemistry.handleValue, fluid, w), this.capacity = port.registers(this.handle)[
|
|
9755
|
+
if (smoke.length > chunk7AAIAVAA_js.REACTIVE_SMOKE_SPECIES) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `at most ${chunk7AAIAVAA_js.REACTIVE_SMOKE_SPECIES} smoke species`);
|
|
9756
|
+
for (let k = 0; k < smoke.length; k++) w[chunk7AAIAVAA_js.REACTIVE_SMOKE + k] = this.species(smoke[k]);
|
|
9757
|
+
w[chunk7AAIAVAA_js.REACTIVE_GLOW_FROM_K] = desc.glowFromK === void 0 ? (0) : whole(desc.glowFromK, 1, (7999), "glowFromK"), w[chunk7AAIAVAA_js.REACTIVE_GLOW_FULL_K] = desc.glowFullK === void 0 ? (0) : whole(desc.glowFullK, 1, (7999), "glowFullK"), w[chunk7AAIAVAA_js.REACTIVE_SMOKE_FULL] = desc.smokeFullParcels === void 0 ? (0) : whole(desc.smokeFullParcels, 1, (255), "smokeFullParcels"), w[chunk7AAIAVAA_js.REACTIVE_FLAME_EXTINCTION] = desc.flameExtinction === void 0 ? (0) : whole(Math.round(desc.flameExtinction * (256)), 1, 4294967295, "flameExtinction"), w[chunk7AAIAVAA_js.REACTIVE_PLUME_FROM_K] = desc.plumeFromK === void 0 ? (0) : whole(desc.plumeFromK, 1, (7999), "plumeFromK");
|
|
9758
|
+
let fluid = new Float32Array(chunk7AAIAVAA_js.FLUID_DESC_FLOATS);
|
|
9759
|
+
writeFluidGrid(fluid, desc.fluid, desc.fluid), this.handle = port.open(chemistry.handleValue, fluid, w), this.capacity = port.registers(this.handle)[chunk7AAIAVAA_js.REACTIVE_CAPACITY];
|
|
9760
9760
|
}
|
|
9761
9761
|
species(name) {
|
|
9762
9762
|
return typeof name == "number" ? whole(name, 1, 65535, "a material id") : this.chemistry.material(name);
|
|
@@ -9766,8 +9766,8 @@ var ReactiveFluid = class {
|
|
|
9766
9766
|
return this.handle;
|
|
9767
9767
|
}
|
|
9768
9768
|
hob(desc) {
|
|
9769
|
-
let w = new Uint32Array(
|
|
9770
|
-
w[
|
|
9769
|
+
let w = new Uint32Array(chunk7AAIAVAA_js.HOB_DESC_WORDS), cell2 = (value) => whole(value, 0, chunk7AAIAVAA_js.REACTIVE_MAX_EDGE, "a hob cell");
|
|
9770
|
+
w[chunk7AAIAVAA_js.HOB_FIRST] = cell2(desc.first[0]), w[chunk7AAIAVAA_js.HOB_FIRST + 1] = cell2(desc.first[1]), w[chunk7AAIAVAA_js.HOB_LAST] = cell2(desc.last[0]), w[chunk7AAIAVAA_js.HOB_LAST + 1] = cell2(desc.last[1]), w[chunk7AAIAVAA_js.HOB_LAYERS] = whole(desc.layers ?? REACTIVE_DEFAULTS.layers, 1, chunk7AAIAVAA_js.REACTIVE_MAX_EDGE, "layers"), w[chunk7AAIAVAA_js.HOB_METAL] = this.species(desc.metal ?? REACTIVE_DEFAULTS.metal), w[chunk7AAIAVAA_js.HOB_START_K] = whole(desc.startK ?? REACTIVE_DEFAULTS.startK, 1, (7999), "startK"), w[chunk7AAIAVAA_js.HOB_PAN_K] = whole(desc.panK, 1, (7999), "panK"), w[chunk7AAIAVAA_js.HOB_PAN_JOULES] = whole(desc.panJoules, 0, (2147483647), "panJoules"), w[chunk7AAIAVAA_js.HOB_FLAME_K] = whole(desc.flameK ?? REACTIVE_DEFAULTS.flameK, 1, (7999), "flameK"), w[chunk7AAIAVAA_js.HOB_FLAME_JOULES] = whole(desc.flameJoules ?? REACTIVE_DEFAULTS.flameJoules, 0, (2147483647), "flameJoules"), w[chunk7AAIAVAA_js.HOB_FLAME_LAYERS] = whole(desc.flameLayers ?? REACTIVE_DEFAULTS.flameLayers, 0, chunk7AAIAVAA_js.REACTIVE_MAX_EDGE, "flameLayers"), this.port.hob(this.live(), w);
|
|
9771
9771
|
}
|
|
9772
9772
|
setLit(on) {
|
|
9773
9773
|
this.port.lit(this.live(), on);
|
|
@@ -9776,10 +9776,10 @@ var ReactiveFluid = class {
|
|
|
9776
9776
|
packFluidEmitter(this.emitterWords, stream), this.port.emitter(this.live(), slot, this.emitterWords);
|
|
9777
9777
|
}
|
|
9778
9778
|
preheat(targetK, maxTicks = REACTIVE_DEFAULTS.preheatTicks) {
|
|
9779
|
-
return this.port.preheat(this.live(), whole(targetK, 1, (7999), "targetK"), whole(maxTicks, 0,
|
|
9779
|
+
return this.port.preheat(this.live(), whole(targetK, 1, (7999), "targetK"), whole(maxTicks, 0, chunk7AAIAVAA_js.REACTIVE_MAX_PREHEAT_TICKS, "maxTicks"));
|
|
9780
9780
|
}
|
|
9781
9781
|
step(seconds) {
|
|
9782
|
-
if (!(seconds >= 0 && seconds <=
|
|
9782
|
+
if (!(seconds >= 0 && seconds <= chunk7AAIAVAA_js.REACTIVE_MAX_STEP_SECONDS)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `a reactive step runs 0 to ${chunk7AAIAVAA_js.REACTIVE_MAX_STEP_SECONDS} s`);
|
|
9783
9783
|
let tick2 = this.frame % this.framesPerTick === 0;
|
|
9784
9784
|
return this.frame++, this.port.step(this.live(), seconds, tick2), tick2 && this.medium !== null && this.port.media(this.handle, this.medium.id), tick2;
|
|
9785
9785
|
}
|
|
@@ -9806,24 +9806,24 @@ var ReactiveFluid = class {
|
|
|
9806
9806
|
return this.port.texels(this.live(), this.cells[0] * this.cells[1] * this.cells[2]);
|
|
9807
9807
|
}
|
|
9808
9808
|
get particles() {
|
|
9809
|
-
return this.port.registers(this.live())[
|
|
9809
|
+
return this.port.registers(this.live())[chunk7AAIAVAA_js.REACTIVE_PARTICLES];
|
|
9810
9810
|
}
|
|
9811
9811
|
positions() {
|
|
9812
9812
|
return this.port.positions(this.live(), this.capacity);
|
|
9813
9813
|
}
|
|
9814
9814
|
get plumeCount() {
|
|
9815
|
-
return this.port.registers(this.live())[
|
|
9815
|
+
return this.port.registers(this.live())[chunk7AAIAVAA_js.REACTIVE_PLUME_COUNT];
|
|
9816
9816
|
}
|
|
9817
9817
|
plume(index, out) {
|
|
9818
9818
|
let r = this.port.registers(this.live());
|
|
9819
|
-
if (!(index >= 0 && index < Math.min(r[
|
|
9820
|
-
let at =
|
|
9821
|
-
for (let k = 0; k < (3); k++) out.cell[k] = r[at +
|
|
9822
|
-
return out.kelvin = r[at +
|
|
9819
|
+
if (!(index >= 0 && index < Math.min(r[chunk7AAIAVAA_js.REACTIVE_PLUME_COUNT], chunk7AAIAVAA_js.REACTIVE_MAX_PLUMES))) return false;
|
|
9820
|
+
let at = chunk7AAIAVAA_js.REACTIVE_PLUMES + index * chunk7AAIAVAA_js.REACTIVE_PLUME_WORDS;
|
|
9821
|
+
for (let k = 0; k < (3); k++) out.cell[k] = r[at + chunk7AAIAVAA_js.PLUME_CELL + k];
|
|
9822
|
+
return out.kelvin = r[at + chunk7AAIAVAA_js.PLUME_KELVIN], out.smoke = r[at + chunk7AAIAVAA_js.PLUME_SMOKE], out.position.x = asFloat(r[at + chunk7AAIAVAA_js.PLUME_WORLD]), out.position.y = asFloat(r[at + chunk7AAIAVAA_js.PLUME_WORLD + 1]), out.position.z = asFloat(r[at + chunk7AAIAVAA_js.PLUME_WORLD + 2]), true;
|
|
9823
9823
|
}
|
|
9824
9824
|
stats(out = createReactiveStats()) {
|
|
9825
9825
|
let r = this.port.registers(this.live());
|
|
9826
|
-
return out.tick = r[
|
|
9826
|
+
return out.tick = r[chunk7AAIAVAA_js.REACTIVE_TICK_LOW] + r[chunk7AAIAVAA_js.REACTIVE_TICK_HIGH] * (4294967296), out.particles = r[chunk7AAIAVAA_js.REACTIVE_PARTICLES], out.pairs = r[chunk7AAIAVAA_js.REACTIVE_PAIRS], out.droppedPairs = r[chunk7AAIAVAA_js.REACTIVE_DROPPED_PAIRS], out.fired = r[chunk7AAIAVAA_js.REACTIVE_FIRED], out.vented = r[chunk7AAIAVAA_js.REACTIVE_VENTED], out.retired = r[chunk7AAIAVAA_js.REACTIVE_RETIRED], out.panK = r[chunk7AAIAVAA_js.REACTIVE_PAN_K], out.burning = r[chunk7AAIAVAA_js.REACTIVE_BURNING], out.smoky = r[chunk7AAIAVAA_js.REACTIVE_SMOKY], out.hottestK = r[chunk7AAIAVAA_js.REACTIVE_HOTTEST_K], out.plumes = r[chunk7AAIAVAA_js.REACTIVE_PLUME_COUNT], out.lit = r[chunk7AAIAVAA_js.REACTIVE_LIT] !== 0, out;
|
|
9827
9827
|
}
|
|
9828
9828
|
digest() {
|
|
9829
9829
|
return this.port.digest(this.live());
|
|
@@ -9913,7 +9913,7 @@ var CAUSES = ["damage", "impact", "support", "overflow", "lifetime", "stress", "
|
|
|
9913
9913
|
graphics.attachNode(entity, node), fragments.push(entity), entities[i] = entity;
|
|
9914
9914
|
}
|
|
9915
9915
|
this.fragments = fragments;
|
|
9916
|
-
let d = new Float32Array(
|
|
9916
|
+
let d = new Float32Array(chunk7AAIAVAA_js.DESTRUCT_DESC_FLOATS);
|
|
9917
9917
|
d[0] = position.x, d[1] = position.y, d[2] = position.z, d.set(rotation, 3), d[7] = desc.health ?? 1, d[8] = desc.impactThreshold ?? 50, d[9] = desc.impactScale ?? 0.01, d[10] = desc.spread ?? 1, d[11] = desc.density ?? 2400, d[12] = desc.friction ?? 0.7, d[13] = desc.restitution ?? 0.05, d[14] = desc.breakSpeed ?? 2, d[15] = desc.maxDebris ?? 512, d[16] = desc.lifetime ?? 8, d[17] = desc.removeRetired ? 1 : 0, d[18] = desc.support ?? true ? 1 : 0, d[19] = scale2, d[20] = desc.collisionGroups?.membership ?? 0, d[21] = desc.collisionGroups?.filter ?? 0, d[22] = desc.maxBreaksPerStep ?? 64, d[23] = desc.debrisCollide ? 1 : 0, this.id = port.create(desc.fracture, entities, this.intact, d);
|
|
9918
9918
|
}
|
|
9919
9919
|
get attached() {
|
|
@@ -9928,15 +9928,15 @@ var CAUSES = ["damage", "impact", "support", "overflow", "lifetime", "stress", "
|
|
|
9928
9928
|
}
|
|
9929
9929
|
handle(words2, floats, at) {
|
|
9930
9930
|
let kind = words2[at], fragment = words2[at + 2], e = this.event;
|
|
9931
|
-
if (e.fragment = fragment, e.cause = CAUSES[words2[at + 3]] ?? "damage", e.x = floats[at + 4], e.y = floats[at + 5], e.z = floats[at + 6], e.speed = floats[at + 7], kind ===
|
|
9931
|
+
if (e.fragment = fragment, e.cause = CAUSES[words2[at + 3]] ?? "damage", e.x = floats[at + 4], e.y = floats[at + 5], e.z = floats[at + 6], e.speed = floats[at + 7], kind === chunk7AAIAVAA_js.DESTRUCT_KIND_INTACT_LOST)
|
|
9932
9932
|
e.kind = "intact_lost";
|
|
9933
|
-
else if (kind ===
|
|
9933
|
+
else if (kind === chunk7AAIAVAA_js.DESTRUCT_KIND_BREAK)
|
|
9934
9934
|
e.kind = "break", this.chipX += e.x, this.chipY += e.y, this.chipZ += e.z, this.chipCount++;
|
|
9935
|
-
else if (kind ===
|
|
9935
|
+
else if (kind === chunk7AAIAVAA_js.DESTRUCT_KIND_REMOVE)
|
|
9936
9936
|
e.kind = "remove";
|
|
9937
|
-
else if (kind ===
|
|
9937
|
+
else if (kind === chunk7AAIAVAA_js.DESTRUCT_KIND_RETIRE)
|
|
9938
9938
|
e.kind = "retire";
|
|
9939
|
-
else if (kind ===
|
|
9939
|
+
else if (kind === chunk7AAIAVAA_js.DESTRUCT_KIND_BOND)
|
|
9940
9940
|
e.kind = "bond";
|
|
9941
9941
|
else
|
|
9942
9942
|
return;
|
|
@@ -9972,7 +9972,7 @@ var CAUSES = ["damage", "impact", "support", "overflow", "lifetime", "stress", "
|
|
|
9972
9972
|
step(seconds) {
|
|
9973
9973
|
let events = this.port.update(seconds);
|
|
9974
9974
|
for (let i = 0; i < events.count; i++) {
|
|
9975
|
-
let at = events.offset + i *
|
|
9975
|
+
let at = events.offset + i * chunk7AAIAVAA_js.DESTRUCT_EVENT_WORDS;
|
|
9976
9976
|
this.items[events.words[at + 1]]?.handle(events.words, events.floats, at);
|
|
9977
9977
|
}
|
|
9978
9978
|
if (events.count > 0) for (let item of this.items) item?.flushChips();
|
|
@@ -10081,9 +10081,9 @@ var NEXT_SCENE_BUDGET = 4 * 1024 * 1024, ScenePrefetch = class {
|
|
|
10081
10081
|
this.sizes.set(path, bytes);
|
|
10082
10082
|
}
|
|
10083
10083
|
stream(layer, options = {}) {
|
|
10084
|
-
let built = layer instanceof
|
|
10084
|
+
let built = layer instanceof chunkVVE3Y76O_js.PrefetchLayer ? layer : new chunkVVE3Y76O_js.PrefetchLayer(layer), own = options.assets ?? null;
|
|
10085
10085
|
this.source === null && own !== null && (this.source = own);
|
|
10086
|
-
let predictor = new
|
|
10086
|
+
let predictor = new chunk5LH2QN3T_js.StreamPredictor(built, this.streamAssets(own), options);
|
|
10087
10087
|
return predictor.idle = this.idleMode, this.streams.push(predictor), this.stallChecks.push(options.stalled ?? null), this.overrides.push(own), predictor;
|
|
10088
10088
|
}
|
|
10089
10089
|
streamAssets(own) {
|
|
@@ -10096,11 +10096,11 @@ var NEXT_SCENE_BUDGET = 4 * 1024 * 1024, ScenePrefetch = class {
|
|
|
10096
10096
|
describe(name, desc) {
|
|
10097
10097
|
this.scenes.set(name, desc);
|
|
10098
10098
|
}
|
|
10099
|
-
scene(name, priority =
|
|
10099
|
+
scene(name, priority = chunk4ZDR72SG_js.ChunkPriority.prefetch) {
|
|
10100
10100
|
let desc = this.scenes.get(name);
|
|
10101
10101
|
if (desc === void 0) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `no prefetch description for scene ${name}; add assets to the scene or call game.prefetch.describe`);
|
|
10102
10102
|
let handle = this.running.get(name);
|
|
10103
|
-
return handle === void 0 && (handle = new ScenePrefetch(name, desc.assets ?? [], this), this.running.set(name, handle)), (this.depth.feed !== "none" || priority <
|
|
10103
|
+
return handle === void 0 && (handle = new ScenePrefetch(name, desc.assets ?? [], this), this.running.set(name, handle)), (this.depth.feed !== "none" || priority < chunk4ZDR72SG_js.ChunkPriority.prefetch) && handle.start(priority, this.limitFor(handle, priority)), handle;
|
|
10104
10104
|
}
|
|
10105
10105
|
cancelScene(name) {
|
|
10106
10106
|
let handle = this.running.get(name);
|
|
@@ -10129,11 +10129,11 @@ var NEXT_SCENE_BUDGET = 4 * 1024 * 1024, ScenePrefetch = class {
|
|
|
10129
10129
|
if (scene === null || this.assets === null) return;
|
|
10130
10130
|
let next = this.scenes.get(scene)?.next;
|
|
10131
10131
|
if (next !== void 0)
|
|
10132
|
-
for (let name of next) this.scenes.has(name) && this.scene(name,
|
|
10132
|
+
for (let name of next) this.scenes.has(name) && this.scene(name, chunk4ZDR72SG_js.ChunkPriority.prefetch).start(chunk4ZDR72SG_js.ChunkPriority.prefetch, idle ? 1 / 0 : this.limitFor(this.running.get(name), chunk4ZDR72SG_js.ChunkPriority.prefetch));
|
|
10133
10133
|
}
|
|
10134
10134
|
limitFor(handle, priority) {
|
|
10135
10135
|
if (handle === void 0) return 0;
|
|
10136
|
-
if (this.idleMode || priority <
|
|
10136
|
+
if (this.idleMode || priority < chunk4ZDR72SG_js.ChunkPriority.prefetch) return 1 / 0;
|
|
10137
10137
|
let budget = Math.min(NEXT_SCENE_BUDGET, this.depth.feed_bytes > 0 ? this.depth.feed_bytes : NEXT_SCENE_BUDGET), bytes = 0, count = 0;
|
|
10138
10138
|
for (let path of handle.paths) {
|
|
10139
10139
|
let size2 = this.sizes.get(path) ?? 0;
|
|
@@ -10515,7 +10515,7 @@ var StudioTimeline = class {
|
|
|
10515
10515
|
let travel = this.travel;
|
|
10516
10516
|
!this.recordingValue || !this.live || travel === null || this.holdingValue || this.log.record(
|
|
10517
10517
|
travel.tick,
|
|
10518
|
-
|
|
10518
|
+
chunk5LH2QN3T_js.drainSource(events, count),
|
|
10519
10519
|
nowMs,
|
|
10520
10520
|
count,
|
|
10521
10521
|
0,
|
|
@@ -10633,7 +10633,7 @@ function packSmokeDesc(desc, out) {
|
|
|
10633
10633
|
d.glowFullKelvin,
|
|
10634
10634
|
d.flameExtinction
|
|
10635
10635
|
];
|
|
10636
|
-
return out.set(values.slice(0,
|
|
10636
|
+
return out.set(values.slice(0, chunk7AAIAVAA_js.SMOKE_DESC_FLOATS)), out;
|
|
10637
10637
|
}
|
|
10638
10638
|
function unit(channel) {
|
|
10639
10639
|
return channel >= 0 && channel <= 1;
|
|
@@ -10643,7 +10643,7 @@ function packSmokeEmitter(emitter, out, at) {
|
|
|
10643
10643
|
out[at] = emitter.position.x, out[at + 1] = emitter.position.y, out[at + 2] = emitter.position.z, out[at + 3] = emitter.radius, out[at + 4] = emitter.density ?? 0, out[at + 5] = emitter.heat ?? 0, out[at + 6] = emitter.fuel ?? 0, out[at + 7] = v.x, out[at + 8] = v.y, out[at + 9] = v.z, out[at + 10] = emitter.strength ?? 0;
|
|
10644
10644
|
let tint = emitter.tint ?? SMOKE_WHITE;
|
|
10645
10645
|
if (!(unit(tint.r) && unit(tint.g) && unit(tint.b))) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "a flame tint takes channels from 0 to 1");
|
|
10646
|
-
out[at +
|
|
10646
|
+
out[at + chunk7AAIAVAA_js.SMOKE_TINT_AT] = tint.r, out[at + chunk7AAIAVAA_js.SMOKE_TINT_AT + 1] = tint.g, out[at + chunk7AAIAVAA_js.SMOKE_TINT_AT + 2] = tint.b;
|
|
10647
10647
|
}
|
|
10648
10648
|
function smokeMediumDesc(desc, look) {
|
|
10649
10649
|
return {
|
|
@@ -10656,14 +10656,14 @@ function smokeMediumDesc(desc, look) {
|
|
|
10656
10656
|
var SmokeVolume = class {
|
|
10657
10657
|
constructor(port, desc) {
|
|
10658
10658
|
this.port = port;
|
|
10659
|
-
this.emitterFloats = new Float32Array(
|
|
10659
|
+
this.emitterFloats = new Float32Array(chunk7AAIAVAA_js.SMOKE_MAX_EMITTERS * chunk7AAIAVAA_js.SMOKE_TINTED_EMITTER_FLOATS);
|
|
10660
10660
|
this.disposed = false;
|
|
10661
|
-
this.handle = port.create(packSmokeDesc(desc, new Float32Array(
|
|
10661
|
+
this.handle = port.create(packSmokeDesc(desc, new Float32Array(chunk7AAIAVAA_js.SMOKE_DESC_FLOATS)), desc.medium.id);
|
|
10662
10662
|
}
|
|
10663
10663
|
setEmitters(emitters) {
|
|
10664
10664
|
if (this.disposed) throw new chunk2V7IL4HC_js.GameError("unknown_resource", "this smoke volume was disposed");
|
|
10665
|
-
if (emitters.length >
|
|
10666
|
-
for (let i = 0; i < emitters.length; i++) packSmokeEmitter(emitters[i], this.emitterFloats, i *
|
|
10665
|
+
if (emitters.length > chunk7AAIAVAA_js.SMOKE_MAX_EMITTERS) throw new chunk2V7IL4HC_js.GameError("capacity_exceeded", `a smoke volume takes at most ${chunk7AAIAVAA_js.SMOKE_MAX_EMITTERS} emitters`);
|
|
10666
|
+
for (let i = 0; i < emitters.length; i++) packSmokeEmitter(emitters[i], this.emitterFloats, i * chunk7AAIAVAA_js.SMOKE_TINTED_EMITTER_FLOATS);
|
|
10667
10667
|
this.port.emitters(this.handle, this.emitterFloats, emitters.length);
|
|
10668
10668
|
}
|
|
10669
10669
|
follow(centre) {
|
|
@@ -10682,31 +10682,31 @@ var SmokeVolume = class {
|
|
|
10682
10682
|
// src/game/story/story.ts
|
|
10683
10683
|
var STORY_VARIABLE_TYPES = ["bool", "int", "number", "text"], STORY_PERSISTS = ["play", "player", "shared"], STORY_INTERACTIONS = ["tap", "hold", "swipe", "gift", "vote"];
|
|
10684
10684
|
var STORY_RULE_ACTIONS = ["set", "add", "go", "say", "show", "hide", "emit"], STORY_NODE_CODES = {
|
|
10685
|
-
variable:
|
|
10686
|
-
choice:
|
|
10687
|
-
beat:
|
|
10688
|
-
scene:
|
|
10689
|
-
track:
|
|
10690
|
-
actor:
|
|
10691
|
-
rule:
|
|
10692
|
-
action:
|
|
10685
|
+
variable: chunk3S6WPBZL_js.STORY_TEXT_VARIABLE,
|
|
10686
|
+
choice: chunk3S6WPBZL_js.STORY_TEXT_CHOICE,
|
|
10687
|
+
beat: chunk3S6WPBZL_js.STORY_TEXT_BEAT,
|
|
10688
|
+
scene: chunk3S6WPBZL_js.STORY_TEXT_SCENE,
|
|
10689
|
+
track: chunk3S6WPBZL_js.STORY_ID_TRACK,
|
|
10690
|
+
actor: chunk3S6WPBZL_js.STORY_TEXT_ACTOR,
|
|
10691
|
+
rule: chunk3S6WPBZL_js.STORY_TEXT_RULE,
|
|
10692
|
+
action: chunk3S6WPBZL_js.STORY_TEXT_ACTION
|
|
10693
10693
|
};
|
|
10694
10694
|
var HEX = 16, WORD_HEX = 8, TYPE_BOOL = 0, TYPE_INT = 1, TYPE_TEXT = 3, PERSIST_PLAY = 0, NO_KEY = 0, StoryPlayer = class {
|
|
10695
10695
|
constructor(port, program2, handlers = {}) {
|
|
10696
10696
|
this.port = port;
|
|
10697
10697
|
this.handlers = handlers;
|
|
10698
10698
|
this.byName = /* @__PURE__ */ new Map();
|
|
10699
|
-
this.inputs = new Uint32Array(
|
|
10699
|
+
this.inputs = new Uint32Array(chunk3S6WPBZL_js.STORY_MAX_INPUTS * chunk3S6WPBZL_js.STORY_INPUT_WORDS);
|
|
10700
10700
|
this.pending = 0;
|
|
10701
10701
|
this.disposed = false;
|
|
10702
10702
|
this.handle = port.create(program2), this.buffer = port.buffer(), this.views = port.views(this.handle);
|
|
10703
10703
|
let variables = [];
|
|
10704
|
-
for (let i = 0; i < this.views.registers[
|
|
10705
|
-
let packed = port.variable(this.handle, i), name = this.text(
|
|
10704
|
+
for (let i = 0; i < this.views.registers[chunk3S6WPBZL_js.STORY_VARIABLES]; i++) {
|
|
10705
|
+
let packed = port.variable(this.handle, i), name = this.text(chunk3S6WPBZL_js.STORY_TEXT_VARIABLE, i), variable = {
|
|
10706
10706
|
index: i,
|
|
10707
10707
|
name,
|
|
10708
|
-
type: STORY_VARIABLE_TYPES[packed &
|
|
10709
|
-
persist: STORY_PERSISTS[packed >>>
|
|
10708
|
+
type: STORY_VARIABLE_TYPES[packed & chunk3S6WPBZL_js.STORY_TYPE_MASK],
|
|
10709
|
+
persist: STORY_PERSISTS[packed >>> chunk3S6WPBZL_js.STORY_PERSIST_SHIFT & chunk3S6WPBZL_js.STORY_TYPE_MASK]
|
|
10710
10710
|
};
|
|
10711
10711
|
variables.push(variable), name !== "" && this.byName.set(name, variable);
|
|
10712
10712
|
}
|
|
@@ -10719,43 +10719,43 @@ var HEX = 16, WORD_HEX = 8, TYPE_BOOL = 0, TYPE_INT = 1, TYPE_TEXT = 3, PERSIST_
|
|
|
10719
10719
|
}
|
|
10720
10720
|
text(what, index, key = (0)) {
|
|
10721
10721
|
let at = this.port.textOf(this.handle, what, index, key);
|
|
10722
|
-
return at ===
|
|
10722
|
+
return at === chunk3S6WPBZL_js.STORY_NONE ? "" : this.port.programText(this.handle, at);
|
|
10723
10723
|
}
|
|
10724
10724
|
dispatch() {
|
|
10725
|
-
let { registers, events } = this.live(), h = this.handlers, count = registers[
|
|
10725
|
+
let { registers, events } = this.live(), h = this.handlers, count = registers[chunk3S6WPBZL_js.STORY_EVENT_COUNT];
|
|
10726
10726
|
for (let e = 0; e < count; e++) {
|
|
10727
|
-
let at = e *
|
|
10727
|
+
let at = e * chunk3S6WPBZL_js.STORY_EVENT_WORDS, a = events[at + 1], b = events[at + 2];
|
|
10728
10728
|
switch (events[at]) {
|
|
10729
|
-
case
|
|
10729
|
+
case chunk3S6WPBZL_js.STORY_EVENT_ENTERED:
|
|
10730
10730
|
h.entered?.(a, b);
|
|
10731
10731
|
break;
|
|
10732
|
-
case
|
|
10732
|
+
case chunk3S6WPBZL_js.STORY_EVENT_OFFERED:
|
|
10733
10733
|
h.offered?.(a);
|
|
10734
10734
|
break;
|
|
10735
|
-
case
|
|
10735
|
+
case chunk3S6WPBZL_js.STORY_EVENT_TAKEN:
|
|
10736
10736
|
h.taken?.(a);
|
|
10737
10737
|
break;
|
|
10738
|
-
case
|
|
10738
|
+
case chunk3S6WPBZL_js.STORY_EVENT_REFUSED:
|
|
10739
10739
|
h.refused?.(a);
|
|
10740
10740
|
break;
|
|
10741
|
-
case
|
|
10741
|
+
case chunk3S6WPBZL_js.STORY_EVENT_LOGIC:
|
|
10742
10742
|
h.logic?.(a, b);
|
|
10743
10743
|
break;
|
|
10744
|
-
case
|
|
10744
|
+
case chunk3S6WPBZL_js.STORY_EVENT_KEY:
|
|
10745
10745
|
h.key?.(a, b);
|
|
10746
10746
|
break;
|
|
10747
|
-
case
|
|
10747
|
+
case chunk3S6WPBZL_js.STORY_EVENT_FINISHED:
|
|
10748
10748
|
h.finished?.(a);
|
|
10749
10749
|
break;
|
|
10750
|
-
case
|
|
10750
|
+
case chunk3S6WPBZL_js.STORY_EVENT_RULE:
|
|
10751
10751
|
h.rule?.(a, b, STORY_RULE_ACTIONS[events[at + 3]]);
|
|
10752
10752
|
break;
|
|
10753
10753
|
}
|
|
10754
10754
|
}
|
|
10755
10755
|
}
|
|
10756
10756
|
queue(kind, a, b) {
|
|
10757
|
-
if (this.live(), this.pending ===
|
|
10758
|
-
let at = this.pending *
|
|
10757
|
+
if (this.live(), this.pending === chunk3S6WPBZL_js.STORY_MAX_INPUTS) throw new chunk2V7IL4HC_js.GameError("capacity_exceeded", `a story step takes at most ${chunk3S6WPBZL_js.STORY_MAX_INPUTS} inputs`);
|
|
10758
|
+
let at = this.pending * chunk3S6WPBZL_js.STORY_INPUT_WORDS;
|
|
10759
10759
|
this.inputs[at] = kind, this.inputs[at + 1] = a, this.inputs[at + 2] = b, this.pending++;
|
|
10760
10760
|
}
|
|
10761
10761
|
start() {
|
|
@@ -10767,13 +10767,13 @@ var HEX = 16, WORD_HEX = 8, TYPE_BOOL = 0, TYPE_INT = 1, TYPE_TEXT = 3, PERSIST_
|
|
|
10767
10767
|
this.pending = 0, this.port.step(this.handle, this.inputs, count), this.dispatch();
|
|
10768
10768
|
}
|
|
10769
10769
|
choose(choice) {
|
|
10770
|
-
this.queue(
|
|
10770
|
+
this.queue(chunk3S6WPBZL_js.STORY_INPUT_CHOOSE, choice, 0);
|
|
10771
10771
|
}
|
|
10772
|
-
interact(kind, target =
|
|
10773
|
-
this.queue(
|
|
10772
|
+
interact(kind, target = chunk3S6WPBZL_js.STORY_NONE) {
|
|
10773
|
+
this.queue(chunk3S6WPBZL_js.STORY_INPUT_INTERACT, STORY_INTERACTIONS.indexOf(kind), target);
|
|
10774
10774
|
}
|
|
10775
10775
|
gift(name) {
|
|
10776
|
-
this.queue(
|
|
10776
|
+
this.queue(chunk3S6WPBZL_js.STORY_INPUT_GIFT, this.port.textIndex(this.handle, name), 0);
|
|
10777
10777
|
}
|
|
10778
10778
|
seek(tick2) {
|
|
10779
10779
|
this.live(), this.port.seek(this.handle, tick2);
|
|
@@ -10782,25 +10782,25 @@ var HEX = 16, WORD_HEX = 8, TYPE_BOOL = 0, TYPE_INT = 1, TYPE_TEXT = 3, PERSIST_
|
|
|
10782
10782
|
return this.live(), this.port.available(this.handle, choice);
|
|
10783
10783
|
}
|
|
10784
10784
|
label(choice) {
|
|
10785
|
-
return this.text(
|
|
10785
|
+
return this.text(chunk3S6WPBZL_js.STORY_TEXT_CHOICE, choice);
|
|
10786
10786
|
}
|
|
10787
10787
|
beatName(beat) {
|
|
10788
|
-
return this.text(
|
|
10788
|
+
return this.text(chunk3S6WPBZL_js.STORY_TEXT_BEAT, beat);
|
|
10789
10789
|
}
|
|
10790
10790
|
sceneName(scene) {
|
|
10791
|
-
return this.text(
|
|
10791
|
+
return this.text(chunk3S6WPBZL_js.STORY_TEXT_SCENE, scene);
|
|
10792
10792
|
}
|
|
10793
10793
|
actorName(actor) {
|
|
10794
|
-
return this.text(
|
|
10794
|
+
return this.text(chunk3S6WPBZL_js.STORY_TEXT_ACTOR, actor);
|
|
10795
10795
|
}
|
|
10796
10796
|
keyText(track, key) {
|
|
10797
|
-
return this.text(
|
|
10797
|
+
return this.text(chunk3S6WPBZL_js.STORY_TEXT_KEY, track, key);
|
|
10798
10798
|
}
|
|
10799
10799
|
ruleName(rule) {
|
|
10800
|
-
return this.text(
|
|
10800
|
+
return this.text(chunk3S6WPBZL_js.STORY_TEXT_RULE, rule);
|
|
10801
10801
|
}
|
|
10802
10802
|
actionText(action3) {
|
|
10803
|
-
return this.text(
|
|
10803
|
+
return this.text(chunk3S6WPBZL_js.STORY_TEXT_ACTION, action3);
|
|
10804
10804
|
}
|
|
10805
10805
|
nodeId(kind, index) {
|
|
10806
10806
|
return this.live(), this.port.idOf(this.handle, STORY_NODE_CODES[kind], index);
|
|
@@ -10835,40 +10835,40 @@ var HEX = 16, WORD_HEX = 8, TYPE_BOOL = 0, TYPE_INT = 1, TYPE_TEXT = 3, PERSIST_
|
|
|
10835
10835
|
}
|
|
10836
10836
|
sample(index, out) {
|
|
10837
10837
|
let { registers, samples: samples2 } = this.live();
|
|
10838
|
-
if (index < 0 || index >= registers[
|
|
10839
|
-
let at = index *
|
|
10838
|
+
if (index < 0 || index >= registers[chunk3S6WPBZL_js.STORY_SAMPLE_COUNT]) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `the story has no sample ${index}`);
|
|
10839
|
+
let at = index * chunk3S6WPBZL_js.STORY_SAMPLE_WORDS;
|
|
10840
10840
|
return out.track = samples2[at], out.target = samples2[at + 1], out.channel = samples2[at + 2], out.key = samples2[at + 3], out.x = samples2[at + 4], out.y = samples2[at + 5], out.z = samples2[at + 6], out.w = samples2[at + 7], out;
|
|
10841
10841
|
}
|
|
10842
10842
|
get sampleCount() {
|
|
10843
|
-
return this.live().registers[
|
|
10843
|
+
return this.live().registers[chunk3S6WPBZL_js.STORY_SAMPLE_COUNT];
|
|
10844
10844
|
}
|
|
10845
10845
|
get beat() {
|
|
10846
|
-
return this.live().registers[
|
|
10846
|
+
return this.live().registers[chunk3S6WPBZL_js.STORY_BEAT];
|
|
10847
10847
|
}
|
|
10848
10848
|
get scene() {
|
|
10849
|
-
return this.live().registers[
|
|
10849
|
+
return this.live().registers[chunk3S6WPBZL_js.STORY_SCENE];
|
|
10850
10850
|
}
|
|
10851
10851
|
get beatTick() {
|
|
10852
|
-
return this.live().registers[
|
|
10852
|
+
return this.live().registers[chunk3S6WPBZL_js.STORY_BEAT_TICK];
|
|
10853
10853
|
}
|
|
10854
10854
|
get sceneTick() {
|
|
10855
|
-
return this.live().registers[
|
|
10855
|
+
return this.live().registers[chunk3S6WPBZL_js.STORY_SCENE_TICK];
|
|
10856
10856
|
}
|
|
10857
10857
|
get sceneLength() {
|
|
10858
|
-
return this.live().registers[
|
|
10858
|
+
return this.live().registers[chunk3S6WPBZL_js.STORY_SCENE_LENGTH];
|
|
10859
10859
|
}
|
|
10860
10860
|
get tickRate() {
|
|
10861
|
-
return this.live().registers[
|
|
10861
|
+
return this.live().registers[chunk3S6WPBZL_js.STORY_TICK_RATE];
|
|
10862
10862
|
}
|
|
10863
10863
|
get started() {
|
|
10864
|
-
return (this.live().registers[
|
|
10864
|
+
return (this.live().registers[chunk3S6WPBZL_js.STORY_FLAGS] & chunk3S6WPBZL_js.STORY_STARTED) !== 0;
|
|
10865
10865
|
}
|
|
10866
10866
|
get finished() {
|
|
10867
|
-
return (this.live().registers[
|
|
10867
|
+
return (this.live().registers[chunk3S6WPBZL_js.STORY_FLAGS] & chunk3S6WPBZL_js.STORY_FINISHED) !== 0;
|
|
10868
10868
|
}
|
|
10869
10869
|
digest() {
|
|
10870
10870
|
let r = this.live().registers;
|
|
10871
|
-
return r[
|
|
10871
|
+
return r[chunk3S6WPBZL_js.STORY_DIGEST + 1].toString((16)).padStart((8), "0") + r[chunk3S6WPBZL_js.STORY_DIGEST].toString((16)).padStart((8), "0");
|
|
10872
10872
|
}
|
|
10873
10873
|
dispose() {
|
|
10874
10874
|
this.disposed || (this.disposed = true, this.port.destroy(this.handle));
|
|
@@ -10895,7 +10895,7 @@ var GOVERNOR_SAMPLE_FRAMES = 16, Game = class {
|
|
|
10895
10895
|
this.stopTimeline = null;
|
|
10896
10896
|
this.disposed = false;
|
|
10897
10897
|
this.governorFrames = 0;
|
|
10898
|
-
this.backend = options.backend, this.world = new World(options.capacity ?? 4096, options.backend.memory), this.transforms = new Transforms(this.world, options.backend.transforms), this.loop = new chunkYXGZQPUD_js.FixedStepLoop(options), this.clock = this.loop.time.values, this.random = new
|
|
10898
|
+
this.backend = options.backend, this.world = new World(options.capacity ?? 4096, options.backend.memory), this.transforms = new Transforms(this.world, options.backend.transforms), this.loop = new chunkYXGZQPUD_js.FixedStepLoop(options), this.clock = this.loop.time.values, this.random = new chunk5LH2QN3T_js.SeededRandom(options.seed ?? 0), this.input = new chunk5LH2QN3T_js.InputActions(options.gestures), this.physics = new Physics(options.backend.physics, this.world, this.transforms, this.loop.stepSeconds, options.physics), this.physics.enrolRollback(this.world, this.random, this.loop), this.kernelRunner = new KernelRunner(options.backend.kernels ?? null), this.world.attachKernels(this.kernelRunner), setDefaultKernelEngine(options.backend.kernels ?? null), runGpuProbeIfAsked(), this.world.attachStreamer(new WorldStreamer(options.backend.streaming ?? null, this.world, this.transforms, this.physics)), this.nav = new Nav(options.backend.nav ?? new JsNav()), this.ai = options.backend.ai ? new GameAi(options.backend.ai) : null, this.graphics = new chunkAZAXD44P_js.Graphics(options.backend.graphics, this.world, this.transforms, options.backend.scenery ?? null), this.world.kernelServices({ physics: this.physics, nav: this.nav, graphics: this.graphics }), this.animation = new chunk34XBXUMW_js.Animation(this.world, this.transforms, options.animation), this.audio = new Audio(options.backend.audio, this.transforms, options.maxVoices), this.ui = new GameUi(options.ui ?? null, options.maxHudSlots), this.net = new chunkOXMIBOD4_js.GameNet(), this.scratch = new ScratchArena(options.scratch), this.scenes = new SceneManager();
|
|
10899
10899
|
let prefetch = new GamePrefetch(options.assets ?? null);
|
|
10900
10900
|
this.prefetch = prefetch, this.graphics.scenery.attachPrefetch(prefetch), this.scenes.onRegister((scene) => {
|
|
10901
10901
|
scene.prefetch !== void 0 && prefetch.describe(scene.name, scene.prefetch);
|
|
@@ -10909,14 +10909,14 @@ var GOVERNOR_SAMPLE_FRAMES = 16, Game = class {
|
|
|
10909
10909
|
this.meters?.playAs(null), this.meters = null;
|
|
10910
10910
|
return;
|
|
10911
10911
|
}
|
|
10912
|
-
let meters = this.meters ?? new
|
|
10912
|
+
let meters = this.meters ?? new chunkAZAXD44P_js.GameMeters(this, request.tier);
|
|
10913
10913
|
this.meters = meters, this.meterFrames = 0, meters.measureAs(request.tier, request.pin);
|
|
10914
10914
|
}
|
|
10915
10915
|
meter(meters) {
|
|
10916
|
-
if (meters.update(), ++this.meterFrames <
|
|
10916
|
+
if (meters.update(), ++this.meterFrames < chunkXK6UDWJS_js.METER_REPORT_FRAMES) return;
|
|
10917
10917
|
this.meterFrames = 0;
|
|
10918
10918
|
let readout = this.kernelRunner.inspectorReadout;
|
|
10919
|
-
readout !== null && meters.noteInspector(readout), meters.noteScriptHeap(
|
|
10919
|
+
readout !== null && meters.noteInspector(readout), meters.noteScriptHeap(chunkXK6UDWJS_js.meterScriptHeap()), chunkXK6UDWJS_js.reportMeters(meters.read());
|
|
10920
10920
|
}
|
|
10921
10921
|
get chemistry() {
|
|
10922
10922
|
if (this.chemistryApi === null) {
|
|
@@ -10950,7 +10950,7 @@ var GOVERNOR_SAMPLE_FRAMES = 16, Game = class {
|
|
|
10950
10950
|
if (this.softBodySystem === null) {
|
|
10951
10951
|
let port = this.backend.softBodies;
|
|
10952
10952
|
if (!port) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", "soft bodies need the native engine with feature soft_body_1");
|
|
10953
|
-
this.softBodySystem = new
|
|
10953
|
+
this.softBodySystem = new chunk5LH2QN3T_js.SoftBodies(port);
|
|
10954
10954
|
}
|
|
10955
10955
|
return this.softBodySystem;
|
|
10956
10956
|
}
|
|
@@ -10961,7 +10961,7 @@ var GOVERNOR_SAMPLE_FRAMES = 16, Game = class {
|
|
|
10961
10961
|
if (this.clothSystem === null) {
|
|
10962
10962
|
let port = this.backend.cloths;
|
|
10963
10963
|
if (!port) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", "cloth needs the native engine with feature cloth_1");
|
|
10964
|
-
this.clothSystem = new
|
|
10964
|
+
this.clothSystem = new chunk5LH2QN3T_js.Cloths(port);
|
|
10965
10965
|
}
|
|
10966
10966
|
return this.clothSystem;
|
|
10967
10967
|
}
|
|
@@ -11037,11 +11037,11 @@ var GOVERNOR_SAMPLE_FRAMES = 16, Game = class {
|
|
|
11037
11037
|
return this.scenes.reload(next, this);
|
|
11038
11038
|
}
|
|
11039
11039
|
start(scene) {
|
|
11040
|
-
this.scenes.switchTo(chunk5PJEXSOW_js.inspectScene((name) => this.scenes.has(name)) ?? scene), this.scenes.applyPending(this), this.stopMeters ?? (this.stopMeters =
|
|
11040
|
+
this.scenes.switchTo(chunk5PJEXSOW_js.inspectScene((name) => this.scenes.has(name)) ?? scene), this.scenes.applyPending(this), this.stopMeters ?? (this.stopMeters = chunkXK6UDWJS_js.watchMeters((request) => this.applyMeters(request))), this.stopTimeline ?? (this.stopTimeline = chunkXK6UDWJS_js.onStudio((message) => this.studio(message)));
|
|
11041
11041
|
}
|
|
11042
11042
|
studio(message) {
|
|
11043
11043
|
this.disposed || !message.topic.startsWith(TIMELINE_PREFIX) || (this.timeline ?? (this.timeline = new StudioTimeline(this.timelineGame(), (outgoing) => {
|
|
11044
|
-
|
|
11044
|
+
chunkXK6UDWJS_js.sendToStudio(outgoing);
|
|
11045
11045
|
})), this.timeline.handle(message));
|
|
11046
11046
|
}
|
|
11047
11047
|
timelineGame() {
|