@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
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
var chunkY4K22JL6_js = require('./chunk-Y4K22JL6.js');
|
|
4
4
|
var chunkFLWD6GRR_js = require('./chunk-FLWD6GRR.js');
|
|
5
5
|
var chunkDJ2C7AVG_js = require('./chunk-DJ2C7AVG.js');
|
|
6
|
-
var
|
|
6
|
+
var chunk7KFTYENS_js = require('./chunk-7KFTYENS.js');
|
|
7
7
|
var chunk34XBXUMW_js = require('./chunk-34XBXUMW.js');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
8
|
+
var chunk5LH2QN3T_js = require('./chunk-5LH2QN3T.js');
|
|
9
|
+
var chunkVVE3Y76O_js = require('./chunk-VVE3Y76O.js');
|
|
10
|
+
var chunkPKOZXD2Q_js = require('./chunk-PKOZXD2Q.js');
|
|
11
|
+
var chunk3S6WPBZL_js = require('./chunk-3S6WPBZL.js');
|
|
12
12
|
var chunkRCQ2MPBV_js = require('./chunk-RCQ2MPBV.js');
|
|
13
13
|
var chunkAZ5BGWHB_js = require('./chunk-AZ5BGWHB.js');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var chunk5HFMY3D7_js = require('./chunk-5HFMY3D7.js');
|
|
15
|
+
var chunk7AAIAVAA_js = require('./chunk-7AAIAVAA.js');
|
|
16
16
|
var chunkKZJRSXHK_js = require('./chunk-KZJRSXHK.js');
|
|
17
17
|
var chunkIR74FJHU_js = require('./chunk-IR74FJHU.js');
|
|
18
18
|
var chunkZJBRUH6V_js = require('./chunk-ZJBRUH6V.js');
|
|
19
|
-
var
|
|
19
|
+
var chunk4ZDR72SG_js = require('./chunk-4ZDR72SG.js');
|
|
20
20
|
var chunk2V7IL4HC_js = require('./chunk-2V7IL4HC.js');
|
|
21
21
|
var chunkJGBCIKJV_js = require('./chunk-JGBCIKJV.js');
|
|
22
22
|
|
|
@@ -111,21 +111,21 @@ function sqrtf(a) {
|
|
|
111
111
|
return Math.fround(Math.sqrt(Math.fround(a)));
|
|
112
112
|
}
|
|
113
113
|
function clampf(x, low, high) {
|
|
114
|
-
return
|
|
114
|
+
return chunk7KFTYENS_js.clamp(x, low, high);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// src/game/kernel/std/rules.ts
|
|
118
|
-
var STEER_STOP = 0, STEER_SEEK = 1, STEER_DIRECTION = 2, STEER_FACE = 3, SLOWING_SECONDS = Math.fround(0.5), MIN_SLOWING = Math.fround(0.5), MOVING_SPEED = Math.fround(0.01), MOVING_SQUARED = Math.fround(MOVING_SPEED * MOVING_SPEED), PHASE_X = Math.fround(0.73), PHASE_Y = Math.fround(1), PHASE_Z = Math.fround(1.31), LIFE_TINT = { kind:
|
|
118
|
+
var STEER_STOP = 0, STEER_SEEK = 1, STEER_DIRECTION = 2, STEER_FACE = 3, SLOWING_SECONDS = Math.fround(0.5), MIN_SLOWING = Math.fround(0.5), MOVING_SPEED = Math.fround(0.01), MOVING_SQUARED = Math.fround(MOVING_SPEED * MOVING_SPEED), PHASE_X = Math.fround(0.73), PHASE_Y = Math.fround(1), PHASE_Z = Math.fround(1.31), LIFE_TINT = { kind: chunk7KFTYENS_js.CurveKind.linear, channels: 4, keys: [0, 0.3, 0.7, 1], values: [1, 0.95, 0.65, 1, 1, 0.55, 0.12, 1, 0.6, 0.25, 0.1, 1, 0.35, 0.35, 0.35, 0] }, LIFE_SIZE = { kind: chunk7KFTYENS_js.CurveKind.hermite, keys: [0, 0.2, 1], values: [0.4, 1, 0.2], tangents: [4, 0, -1] };
|
|
119
119
|
function arriveVelocity(offset, arrive, top, throttle, slowing) {
|
|
120
|
-
let distance =
|
|
120
|
+
let distance = chunk7KFTYENS_js.len(offset), moving = distance > arrive && distance > 0, speed = mulf(mulf(top, throttle), Math.min(divf(distance, slowing), 1));
|
|
121
121
|
return { x: moving ? mulf(divf(offset.x, distance), speed) : 0, y: moving ? mulf(divf(offset.y, distance), speed) : 0 };
|
|
122
122
|
}
|
|
123
123
|
function separationPush(offset, radius) {
|
|
124
|
-
let distance =
|
|
124
|
+
let distance = chunk7KFTYENS_js.len(offset), near = distance > 0 && distance < radius, weight = subf(1, divf(distance, radius));
|
|
125
125
|
return { x: near ? mulf(divf(offset.x, distance), weight) : 0, y: near ? mulf(divf(offset.y, distance), weight) : 0 };
|
|
126
126
|
}
|
|
127
127
|
function limitLength2(v, limit) {
|
|
128
|
-
let squared =
|
|
128
|
+
let squared = chunk7KFTYENS_js.lenSq(v), over = squared > mulf(limit, limit), k = divf(limit, sqrtf(squared));
|
|
129
129
|
return { x: over ? mulf(v.x, k) : v.x, y: over ? mulf(v.y, k) : v.y };
|
|
130
130
|
}
|
|
131
131
|
function steerAccelerate(desired, vel, budget) {
|
|
@@ -133,7 +133,7 @@ function steerAccelerate(desired, vel, budget) {
|
|
|
133
133
|
return { x: addf(vel.x, change.x), y: addf(vel.y, change.y) };
|
|
134
134
|
}
|
|
135
135
|
function headingFrom(v, fallback, threshold) {
|
|
136
|
-
let squared =
|
|
136
|
+
let squared = chunk7KFTYENS_js.lenSq(v), moving = squared > threshold, length = sqrtf(squared);
|
|
137
137
|
return { x: moving ? divf(v.x, length) : fallback.x, y: moving ? divf(v.y, length) : fallback.y };
|
|
138
138
|
}
|
|
139
139
|
function steerAgent(e, dt, maxSpeed, maxAccel, separationRadius, separationWeight, kinematic) {
|
|
@@ -145,9 +145,9 @@ function steerAgent(e, dt, maxSpeed, maxAccel, separationRadius, separationWeigh
|
|
|
145
145
|
let speed = mulf(top, e.throttle);
|
|
146
146
|
dx = mulf(e.point.x, speed), dz = mulf(e.point.y, speed);
|
|
147
147
|
} else e.mode === (3) && (e.facing = headingFrom({ x: subf(e.point.x, e.pos.x), y: subf(e.point.y, e.pos.y) }, e.facing, 0));
|
|
148
|
-
if (!(dx === 0 && dz === 0 &&
|
|
149
|
-
let push =
|
|
150
|
-
for (let o of e.neighbours(separationRadius)) push =
|
|
148
|
+
if (!(dx === 0 && dz === 0 && chunk7KFTYENS_js.lenSq(e.vel) <= MOVING_SQUARED) && separationWeight > 0 && separationRadius > 0 && top > 0) {
|
|
149
|
+
let push = chunk7KFTYENS_js.vec2(0, 0);
|
|
150
|
+
for (let o of e.neighbours(separationRadius)) push = chunk7KFTYENS_js.add(push, separationPush({ x: subf(e.pos.x, o.pos.x), y: subf(e.pos.y, o.pos.y) }, separationRadius));
|
|
151
151
|
dx = addf(dx, mulf(mulf(push.x, top), separationWeight)), dz = addf(dz, mulf(mulf(push.y, top), separationWeight));
|
|
152
152
|
}
|
|
153
153
|
let desired = limitLength2({ x: dx, y: dz }, top);
|
|
@@ -189,7 +189,7 @@ function particleMotion(e, dt, gravity, drag, plane, bounce, collide, noise4) {
|
|
|
189
189
|
}
|
|
190
190
|
function particleLook(e) {
|
|
191
191
|
let t = Math.min(Math.max(divf(e.age, e.life), 0), 1);
|
|
192
|
-
e.tint =
|
|
192
|
+
e.tint = chunk7KFTYENS_js.gradient(LIFE_TINT, t), e.scale = chunk7KFTYENS_js.curve(LIFE_SIZE, t);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
// src/game/kernel/rules/particles.ts
|
|
@@ -206,7 +206,7 @@ var PARTICLE_FIELDS = {
|
|
|
206
206
|
scale: "f32"
|
|
207
207
|
};
|
|
208
208
|
function particleStep(e, dt, gravity, drag, plane, bounce, collide, noise4) {
|
|
209
|
-
particleMotion(e, dt, gravity, drag, plane, bounce, collide, noise4), e.age < e.life ||
|
|
209
|
+
particleMotion(e, dt, gravity, drag, plane, bounce, collide, noise4), e.age < e.life || chunk7KFTYENS_js.despawn();
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
// src/game/kernel/rules/steering.ts
|
|
@@ -236,11 +236,11 @@ function regenerate(e, tick, amount) {
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
// src/game/kernel/rules/index.ts
|
|
239
|
-
var steerAgents =
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
239
|
+
var steerAgents = chunk7KFTYENS_js.kernel(steerAgent, COMPILED_RULES.steerAgents), particleRules = chunk7KFTYENS_js.kernel(particleStep, COMPILED_RULES.particleRules), particleColours = chunk7KFTYENS_js.kernel(particleLook, COMPILED_RULES.particleColours), particleMotions = chunk7KFTYENS_js.kernel(particleMotion, COMPILED_RULES.particleMotions), regenerating = chunk7KFTYENS_js.kernel(regenerate, COMPILED_RULES.regenerate);
|
|
240
|
+
chunk7KFTYENS_js.registerNativeTwin(steerAgents, "steerAgent");
|
|
241
|
+
chunk7KFTYENS_js.registerNativeTwin(particleMotions, "particleMotion");
|
|
242
|
+
chunk7KFTYENS_js.registerNativeTwin(particleColours, "particleLook");
|
|
243
|
+
chunk7KFTYENS_js.registerNativeTwin(regenerating, "regenerate");
|
|
244
244
|
|
|
245
245
|
// src/game/kernel/model.ts
|
|
246
246
|
var VM_WALK_DEPTH = 8;
|
|
@@ -409,10 +409,10 @@ var JsTrees = class {
|
|
|
409
409
|
), this.ready);
|
|
410
410
|
}
|
|
411
411
|
async compile() {
|
|
412
|
-
if (!
|
|
413
|
-
let storages = [...Array.from({ length: this.columns }, () => chunkKZJRSXHK_js.STORAGE_F32), ...WALK_STORAGES.slice(0, this.arrays.length)], plans = this.programs.map((p) =>
|
|
412
|
+
if (!chunk5HFMY3D7_js.wasmInstantiates()) return false;
|
|
413
|
+
let storages = [...Array.from({ length: this.columns }, () => chunkKZJRSXHK_js.STORAGE_F32), ...WALK_STORAGES.slice(0, this.arrays.length)], plans = this.programs.map((p) => chunk3S6WPBZL_js.compileWasmKernel(p, storages));
|
|
414
414
|
if (plans.some((p) => p === null || p.stages.length > 0 || p.groups > 0)) return false;
|
|
415
|
-
let memory = new WebAssembly.Memory({ initial: this.pagesFor((1024)) }), imports =
|
|
415
|
+
let memory = new WebAssembly.Memory({ initial: this.pagesFor((1024)) }), imports = chunk3S6WPBZL_js.wasmKernelImports(memory), instances = await Promise.all(
|
|
416
416
|
plans.map(
|
|
417
417
|
(p) => WebAssembly.instantiate(
|
|
418
418
|
p.bytes,
|
|
@@ -472,7 +472,7 @@ function treeSteps(flat) {
|
|
|
472
472
|
function setShape(programs, upload, readback, steps) {
|
|
473
473
|
let instructions = 0, gathers = 0, transcendentals = 0, stages = 0;
|
|
474
474
|
for (let p of programs) {
|
|
475
|
-
let shape =
|
|
475
|
+
let shape = chunk5HFMY3D7_js.programShape(p);
|
|
476
476
|
instructions += shape.instructions, gathers += shape.gathers, transcendentals += shape.transcendentals, stages += shape.stages - 1;
|
|
477
477
|
}
|
|
478
478
|
return { parts: programs.length, instructions, gathers, transcendentals, stages, upload, readback, steps };
|
|
@@ -626,7 +626,7 @@ var GpuTrees = class {
|
|
|
626
626
|
if (n === 0) return 0;
|
|
627
627
|
let backend = this.chosen;
|
|
628
628
|
if (backend === "gpu" || backend === "auto") {
|
|
629
|
-
let runner =
|
|
629
|
+
let runner = chunk7KFTYENS_js.defaultKernelRunner(), gpu = backend === "gpu" || runner.gpuReady() ? this.gpuTrees() : null, device = gpu === null ? null : gpu.predict(runner, columns, outs, n, backend === "gpu" ? "gpu" : "auto");
|
|
630
630
|
if (device !== null)
|
|
631
631
|
return this.routed = device, n;
|
|
632
632
|
if (backend === "gpu") throw new chunk2V7IL4HC_js.GameError("unsupported_feature", `model ${info.name} asked for the GPU, but this engine has no GPU kernels or the model binds more than ${(64)} columns`);
|
|
@@ -777,7 +777,7 @@ function oklchToOklab(c) {
|
|
|
777
777
|
return { x: c.x, y: mulf(c.y, chunkFLWD6GRR_js.fcos(c.z)), z: mulf(c.y, chunkFLWD6GRR_js.fsin(c.z)) };
|
|
778
778
|
}
|
|
779
779
|
function mixOklab(a, b, t) {
|
|
780
|
-
return oklabToLinear(
|
|
780
|
+
return oklabToLinear(chunk7KFTYENS_js.lerp(linearToOklab(a), linearToOklab(b), t));
|
|
781
781
|
}
|
|
782
782
|
function luminance(c) {
|
|
783
783
|
return row(c, LUMA_R, LUMA_G, LUMA_B);
|
|
@@ -790,7 +790,7 @@ function unpremultiply(c) {
|
|
|
790
790
|
return { x: mulf(c.x, inv), y: mulf(c.y, inv), z: mulf(c.z, inv), w: c.w };
|
|
791
791
|
}
|
|
792
792
|
function blendOver(src, dst) {
|
|
793
|
-
return
|
|
793
|
+
return chunk7KFTYENS_js.add(src, chunk7KFTYENS_js.scale(dst, subf(1, src.w)));
|
|
794
794
|
}
|
|
795
795
|
|
|
796
796
|
// src/game/kernel/std/fixed.ts
|
|
@@ -1841,7 +1841,7 @@ function wideToF32(a) {
|
|
|
1841
1841
|
return negative ? -magnitude : magnitude;
|
|
1842
1842
|
}
|
|
1843
1843
|
function sinPhase(phase) {
|
|
1844
|
-
let index = phase >>> 22, frac = phase >>> 6 & 65535, s0 =
|
|
1844
|
+
let index = phase >>> 22, frac = phase >>> 6 & 65535, s0 = chunk7KFTYENS_js.lut(SIN_TABLE, Math.fround(index)) | 0, s1 = chunk7KFTYENS_js.lut(SIN_TABLE, Math.fround(index + 1)) | 0;
|
|
1845
1845
|
return s0 + (Math.imul(s1 - s0 | 0, frac) >> 16) | 0;
|
|
1846
1846
|
}
|
|
1847
1847
|
function fxFromInt(i) {
|
|
@@ -1959,10 +1959,10 @@ function smallestPositiveRoot(a, b, c) {
|
|
|
1959
1959
|
return lo >= 0 ? lo : hi >= 0 ? hi : (-1);
|
|
1960
1960
|
}
|
|
1961
1961
|
function interceptTime(relPos, relVel, speed) {
|
|
1962
|
-
return smallestPositiveRoot(subf(
|
|
1962
|
+
return smallestPositiveRoot(subf(chunk7KFTYENS_js.dot(relVel, relVel), mulf(speed, speed)), mulf(2, chunk7KFTYENS_js.dot(relPos, relVel)), chunk7KFTYENS_js.dot(relPos, relPos));
|
|
1963
1963
|
}
|
|
1964
1964
|
function interceptTime2(relPos, relVel, speed) {
|
|
1965
|
-
return smallestPositiveRoot(subf(
|
|
1965
|
+
return smallestPositiveRoot(subf(chunk7KFTYENS_js.dot(relVel, relVel), mulf(speed, speed)), mulf(2, chunk7KFTYENS_js.dot(relPos, relVel)), chunk7KFTYENS_js.dot(relPos, relPos));
|
|
1966
1966
|
}
|
|
1967
1967
|
function launchAngles(speed, distance, height, gravity) {
|
|
1968
1968
|
let v2 = mulf(speed, speed), disc = subf(mulf(v2, v2), mulf(gravity, madf(mulf(gravity, distance), distance, mulf(mulf(2, height), v2)))), root = sqrtf(Math.max(disc, 0)), gx = mulf(gravity, distance);
|
|
@@ -1973,65 +1973,65 @@ function launchSpeed(angle2, distance, height, gravity) {
|
|
|
1973
1973
|
return denom > 0 ? sqrtf(divf(mulf(mulf(gravity, distance), distance), denom)) : (-1);
|
|
1974
1974
|
}
|
|
1975
1975
|
function projectilePos(pos, vel, gravity, t) {
|
|
1976
|
-
return
|
|
1976
|
+
return chunk7KFTYENS_js.add(chunk7KFTYENS_js.add(pos, chunk7KFTYENS_js.scale(vel, t)), chunk7KFTYENS_js.scale(gravity, mulf(mulf(0.5, t), t)));
|
|
1977
1977
|
}
|
|
1978
1978
|
function projectileVel(vel, gravity, t) {
|
|
1979
|
-
return
|
|
1979
|
+
return chunk7KFTYENS_js.add(vel, chunk7KFTYENS_js.scale(gravity, t));
|
|
1980
1980
|
}
|
|
1981
1981
|
function dragPos(pos, vel, gravity, drag, t) {
|
|
1982
1982
|
if (drag <= EPSILON) return projectilePos(pos, vel, gravity, t);
|
|
1983
|
-
let inv = divf(1, drag), terminal =
|
|
1984
|
-
return
|
|
1983
|
+
let inv = divf(1, drag), terminal = chunk7KFTYENS_js.scale(gravity, inv), fade3 = mulf(subf(1, chunkFLWD6GRR_js.fexp(mulf(-drag, t))), inv);
|
|
1984
|
+
return chunk7KFTYENS_js.add(chunk7KFTYENS_js.add(pos, chunk7KFTYENS_js.scale(terminal, t)), chunk7KFTYENS_js.scale(chunk7KFTYENS_js.sub(vel, terminal), fade3));
|
|
1985
1985
|
}
|
|
1986
1986
|
function dragVel(vel, gravity, drag, t) {
|
|
1987
1987
|
if (drag <= EPSILON) return projectileVel(vel, gravity, t);
|
|
1988
|
-
let terminal =
|
|
1989
|
-
return
|
|
1988
|
+
let terminal = chunk7KFTYENS_js.scale(gravity, divf(1, drag));
|
|
1989
|
+
return chunk7KFTYENS_js.add(terminal, chunk7KFTYENS_js.scale(chunk7KFTYENS_js.sub(vel, terminal), chunkFLWD6GRR_js.fexp(mulf(-drag, t))));
|
|
1990
1990
|
}
|
|
1991
1991
|
function quadDragStep(pos, vel, gravity, drag, dt, substeps) {
|
|
1992
1992
|
let h = divf(dt, Math.fround(Math.max(substeps, 1))), p = pos, v = vel;
|
|
1993
1993
|
for (let k = 0; k < substeps; k++) {
|
|
1994
|
-
let speed = sqrtf(
|
|
1995
|
-
v =
|
|
1994
|
+
let speed = sqrtf(chunk7KFTYENS_js.dot(v, v)), accel = chunk7KFTYENS_js.sub(gravity, chunk7KFTYENS_js.scale(v, mulf(drag, speed)));
|
|
1995
|
+
v = chunk7KFTYENS_js.add(v, chunk7KFTYENS_js.scale(accel, h)), p = chunk7KFTYENS_js.add(p, chunk7KFTYENS_js.scale(v, h));
|
|
1996
1996
|
}
|
|
1997
1997
|
return { pos: p, vel: v };
|
|
1998
1998
|
}
|
|
1999
1999
|
function closestOnSegment(p, a, b) {
|
|
2000
|
-
let ab =
|
|
2001
|
-
return
|
|
2000
|
+
let ab = chunk7KFTYENS_js.sub(b, a), l = chunk7KFTYENS_js.dot(ab, ab), t = l > 0 ? chunk7KFTYENS_js.clamp(divf(chunk7KFTYENS_js.dot(chunk7KFTYENS_js.sub(p, a), ab), l), 0, 1) : 0;
|
|
2001
|
+
return chunk7KFTYENS_js.add(a, chunk7KFTYENS_js.scale(ab, t));
|
|
2002
2002
|
}
|
|
2003
2003
|
function segmentDistSq(p, a, b) {
|
|
2004
|
-
return
|
|
2004
|
+
return chunk7KFTYENS_js.lenSq(chunk7KFTYENS_js.sub(p, closestOnSegment(p, a, b)));
|
|
2005
2005
|
}
|
|
2006
2006
|
function closestOnTriangle(p, a, b, c) {
|
|
2007
|
-
let ab =
|
|
2007
|
+
let ab = chunk7KFTYENS_js.sub(b, a), ac = chunk7KFTYENS_js.sub(c, a), ap = chunk7KFTYENS_js.sub(p, a), d1 = chunk7KFTYENS_js.dot(ab, ap), d2 = chunk7KFTYENS_js.dot(ac, ap);
|
|
2008
2008
|
if (d1 <= 0 && d2 <= 0) return a;
|
|
2009
|
-
let bp =
|
|
2009
|
+
let bp = chunk7KFTYENS_js.sub(p, b), d3 = chunk7KFTYENS_js.dot(ab, bp), d4 = chunk7KFTYENS_js.dot(ac, bp);
|
|
2010
2010
|
if (d3 >= 0 && d4 <= d3) return b;
|
|
2011
2011
|
let vc = subf(mulf(d1, d4), mulf(d3, d2));
|
|
2012
|
-
if (vc <= 0 && d1 >= 0 && d3 <= 0) return
|
|
2013
|
-
let cp =
|
|
2012
|
+
if (vc <= 0 && d1 >= 0 && d3 <= 0) return chunk7KFTYENS_js.add(a, chunk7KFTYENS_js.scale(ab, divf(d1, subf(d1, d3))));
|
|
2013
|
+
let cp = chunk7KFTYENS_js.sub(p, c), d5 = chunk7KFTYENS_js.dot(ab, cp), d6 = chunk7KFTYENS_js.dot(ac, cp);
|
|
2014
2014
|
if (d6 >= 0 && d5 <= d6) return c;
|
|
2015
2015
|
let vb = subf(mulf(d5, d2), mulf(d1, d6));
|
|
2016
|
-
if (vb <= 0 && d2 >= 0 && d6 <= 0) return
|
|
2016
|
+
if (vb <= 0 && d2 >= 0 && d6 <= 0) return chunk7KFTYENS_js.add(a, chunk7KFTYENS_js.scale(ac, divf(d2, subf(d2, d6))));
|
|
2017
2017
|
let va = subf(mulf(d3, d6), mulf(d5, d4)), e43 = subf(d4, d3), e56 = subf(d5, d6);
|
|
2018
|
-
if (va <= 0 && e43 >= 0 && e56 >= 0) return
|
|
2018
|
+
if (va <= 0 && e43 >= 0 && e56 >= 0) return chunk7KFTYENS_js.add(b, chunk7KFTYENS_js.scale(chunk7KFTYENS_js.sub(c, b), divf(e43, addf(e43, e56))));
|
|
2019
2019
|
let denom = divf(1, addf(addf(va, vb), vc));
|
|
2020
|
-
return
|
|
2020
|
+
return chunk7KFTYENS_js.add(chunk7KFTYENS_js.add(a, chunk7KFTYENS_js.scale(ab, mulf(vb, denom))), chunk7KFTYENS_js.scale(ac, mulf(vc, denom)));
|
|
2021
2021
|
}
|
|
2022
2022
|
function closestInAabb(p, min, max) {
|
|
2023
2023
|
return { x: Math.min(Math.max(p.x, min.x), max.x), y: Math.min(Math.max(p.y, min.y), max.y), z: Math.min(Math.max(p.z, min.z), max.z) };
|
|
2024
2024
|
}
|
|
2025
2025
|
function closestInObb(p, center, rotation, half) {
|
|
2026
|
-
let local =
|
|
2027
|
-
return
|
|
2026
|
+
let local = chunk7KFTYENS_js.qrotate(chunk7KFTYENS_js.qconj(rotation), chunk7KFTYENS_js.sub(p, center)), clamped = { x: Math.min(Math.max(local.x, -half.x), half.x), y: Math.min(Math.max(local.y, -half.y), half.y), z: Math.min(Math.max(local.z, -half.z), half.z) };
|
|
2027
|
+
return chunk7KFTYENS_js.add(center, chunk7KFTYENS_js.qrotate(rotation, clamped));
|
|
2028
2028
|
}
|
|
2029
2029
|
function closestSegments(p1, q1, p2, q2) {
|
|
2030
|
-
let d1 =
|
|
2031
|
-
return { s, t, a: pa, b: pb, distSq:
|
|
2030
|
+
let d1 = chunk7KFTYENS_js.sub(q1, p1), d2 = chunk7KFTYENS_js.sub(q2, p2), r = chunk7KFTYENS_js.sub(p1, p2), a = chunk7KFTYENS_js.dot(d1, d1), e = chunk7KFTYENS_js.dot(d2, d2), f = chunk7KFTYENS_js.dot(d2, r), c = chunk7KFTYENS_js.dot(d1, r), b = chunk7KFTYENS_js.dot(d1, d2), denom = subf(mulf(a, e), mulf(b, b)), sFree = denom > 0 ? chunk7KFTYENS_js.clamp(divf(subf(mulf(b, f), mulf(c, e)), denom), 0, 1) : 0, tRaw = e > EPSILON ? divf(madf(b, sFree, f), e) : 0, sLow = a > EPSILON ? chunk7KFTYENS_js.clamp(divf(-c, a), 0, 1) : 0, sHigh = a > EPSILON ? chunk7KFTYENS_js.clamp(divf(subf(b, c), a), 0, 1) : 0, s = a <= EPSILON ? 0 : e <= EPSILON ? chunk7KFTYENS_js.clamp(divf(-c, a), 0, 1) : tRaw < 0 ? sLow : tRaw > 1 ? sHigh : sFree, t = a <= EPSILON ? e > EPSILON ? chunk7KFTYENS_js.clamp(divf(f, e), 0, 1) : 0 : e <= EPSILON ? 0 : chunk7KFTYENS_js.clamp(tRaw, 0, 1), pa = chunk7KFTYENS_js.add(p1, chunk7KFTYENS_js.scale(d1, s)), pb = chunk7KFTYENS_js.add(p2, chunk7KFTYENS_js.scale(d2, t));
|
|
2031
|
+
return { s, t, a: pa, b: pb, distSq: chunk7KFTYENS_js.lenSq(chunk7KFTYENS_js.sub(pa, pb)) };
|
|
2032
2032
|
}
|
|
2033
2033
|
function raySphere(origin, dir, center, radius) {
|
|
2034
|
-
let m =
|
|
2034
|
+
let m = chunk7KFTYENS_js.sub(origin, center), a = chunk7KFTYENS_js.dot(dir, dir), b = chunk7KFTYENS_js.dot(m, dir), c = subf(chunk7KFTYENS_js.dot(m, m), mulf(radius, radius)), disc = subf(mulf(b, b), mulf(a, c));
|
|
2035
2035
|
if (disc < 0 || a <= 0) return (-1);
|
|
2036
2036
|
let root = sqrtf(disc), t0 = divf(subf(-b, root), a), t1 = divf(addf(-b, root), a);
|
|
2037
2037
|
return t0 >= 0 ? t0 : t1 >= 0 ? 0 : (-1);
|
|
@@ -2041,15 +2041,15 @@ function rayAabb(origin, dir, min, max) {
|
|
|
2041
2041
|
return Math.min(Math.min(Math.max(ax, bx), Math.max(ay, by)), Math.max(az, bz)) >= Math.max(near, 0) ? Math.max(near, 0) : (-1);
|
|
2042
2042
|
}
|
|
2043
2043
|
function rayPlane(origin, dir, plane) {
|
|
2044
|
-
let n = { x: plane.x, y: plane.y, z: plane.z }, denom =
|
|
2044
|
+
let n = { x: plane.x, y: plane.y, z: plane.z }, denom = chunk7KFTYENS_js.dot(n, dir), t = divf(-addf(chunk7KFTYENS_js.dot(n, origin), plane.w), denom);
|
|
2045
2045
|
return Math.abs(denom) > EPSILON && t >= 0 ? t : (-1);
|
|
2046
2046
|
}
|
|
2047
2047
|
function rayTriangle(origin, dir, a, b, c) {
|
|
2048
|
-
let e1 =
|
|
2048
|
+
let e1 = chunk7KFTYENS_js.sub(b, a), e2 = chunk7KFTYENS_js.sub(c, a), p = chunk7KFTYENS_js.cross(dir, e2), det = chunk7KFTYENS_js.dot(e1, p), inv = divf(1, det), s = chunk7KFTYENS_js.sub(origin, a), u = mulf(chunk7KFTYENS_js.dot(s, p), inv), q = chunk7KFTYENS_js.cross(s, e1), v = mulf(chunk7KFTYENS_js.dot(dir, q), inv), t = mulf(chunk7KFTYENS_js.dot(e2, q), inv), hit = Math.abs(det) > EPSILON && u >= 0 && v >= 0 && addf(u, v) <= 1 && t >= 0;
|
|
2049
2049
|
return { t: hit ? t : (-1), u, v, hit };
|
|
2050
2050
|
}
|
|
2051
2051
|
function inCone(p, apex, axis, cosHalfAngle, range) {
|
|
2052
|
-
let d =
|
|
2052
|
+
let d = chunk7KFTYENS_js.sub(p, apex), along = chunk7KFTYENS_js.dot(d, axis), distSq2 = chunk7KFTYENS_js.dot(d, d), edge = mulf(mulf(cosHalfAngle, cosHalfAngle), distSq2), square = mulf(along, along);
|
|
2053
2053
|
return (cosHalfAngle < 0 ? along >= 0 || square <= edge : along >= 0 && square >= edge) && distSq2 <= mulf(range, range);
|
|
2054
2054
|
}
|
|
2055
2055
|
function inPolygon(p, vertices, count) {
|
|
@@ -2066,21 +2066,21 @@ function inTriangle(p, a, b, c) {
|
|
|
2066
2066
|
}
|
|
2067
2067
|
function spheresOverlap(c1, r1, c2, r2) {
|
|
2068
2068
|
let r = addf(r1, r2);
|
|
2069
|
-
return
|
|
2069
|
+
return chunk7KFTYENS_js.lenSq(chunk7KFTYENS_js.sub(c1, c2)) <= mulf(r, r);
|
|
2070
2070
|
}
|
|
2071
2071
|
function aabbOverlap(min1, max1, min2, max2) {
|
|
2072
2072
|
return min1.x <= max2.x && max1.x >= min2.x && min1.y <= max2.y && max1.y >= min2.y && min1.z <= max2.z && max1.z >= min2.z;
|
|
2073
2073
|
}
|
|
2074
2074
|
function sphereAabbOverlap(center, radius, min, max) {
|
|
2075
|
-
return
|
|
2075
|
+
return chunk7KFTYENS_js.lenSq(chunk7KFTYENS_js.sub(center, closestInAabb(center, min, max))) <= mulf(radius, radius);
|
|
2076
2076
|
}
|
|
2077
2077
|
function sweepSpherePlane(from, to, radius, plane) {
|
|
2078
|
-
let n = { x: plane.x, y: plane.y, z: plane.z }, d0 = subf(addf(
|
|
2078
|
+
let n = { x: plane.x, y: plane.y, z: plane.z }, d0 = subf(addf(chunk7KFTYENS_js.dot(n, from), plane.w), radius), d1 = subf(addf(chunk7KFTYENS_js.dot(n, to), plane.w), radius);
|
|
2079
2079
|
return d0 <= 0 ? 0 : d1 < 0 ? divf(d0, subf(d0, d1)) : (-1);
|
|
2080
2080
|
}
|
|
2081
2081
|
function planeFromPoints(a, b, c) {
|
|
2082
|
-
let n =
|
|
2083
|
-
return { x: unit.x, y: unit.y, z: unit.z, w: -
|
|
2082
|
+
let n = chunk7KFTYENS_js.cross(chunk7KFTYENS_js.sub(b, a), chunk7KFTYENS_js.sub(c, a)), l = sqrtf(chunk7KFTYENS_js.dot(n, n)), unit = l > 0 ? chunk7KFTYENS_js.scale(n, divf(1, l)) : { x: 0, y: 1, z: 0 };
|
|
2083
|
+
return { x: unit.x, y: unit.y, z: unit.z, w: -chunk7KFTYENS_js.dot(unit, a) };
|
|
2084
2084
|
}
|
|
2085
2085
|
|
|
2086
2086
|
// src/game/kernel/std/rotation.ts
|
|
@@ -2131,16 +2131,16 @@ function qToAxisAngle(q) {
|
|
|
2131
2131
|
return s < TINY ? { axis: { x: 1, y: 0, z: 0 }, angle: angle2 } : { axis: { x: divf(q.x, s), y: divf(q.y, s), z: divf(q.z, s) }, angle: angle2 };
|
|
2132
2132
|
}
|
|
2133
2133
|
function qFromTo(from, to) {
|
|
2134
|
-
let d =
|
|
2134
|
+
let d = chunk7KFTYENS_js.dot(from, to);
|
|
2135
2135
|
if (d < OPPOSITE) {
|
|
2136
|
-
let side = Math.abs(from.x) < 0.5 ?
|
|
2136
|
+
let side = Math.abs(from.x) < 0.5 ? chunk7KFTYENS_js.cross(from, { x: 1, y: 0, z: 0 }) : chunk7KFTYENS_js.cross(from, { x: 0, y: 1, z: 0 }), axis = chunk7KFTYENS_js.normalize(side);
|
|
2137
2137
|
return { x: axis.x, y: axis.y, z: axis.z, w: 0 };
|
|
2138
2138
|
}
|
|
2139
|
-
let c =
|
|
2139
|
+
let c = chunk7KFTYENS_js.cross(from, to);
|
|
2140
2140
|
return qnormalize({ x: c.x, y: c.y, z: c.z, w: addf(1, d) });
|
|
2141
2141
|
}
|
|
2142
2142
|
function qLookRotation(forward, up) {
|
|
2143
|
-
let f =
|
|
2143
|
+
let f = chunk7KFTYENS_js.normalize(forward), side = chunk7KFTYENS_js.cross(up, f), alt = Math.abs(f.x) < 0.5 ? chunk7KFTYENS_js.cross({ x: 1, y: 0, z: 0 }, f) : chunk7KFTYENS_js.cross({ x: 0, y: 1, z: 0 }, f), r = chunk7KFTYENS_js.len(side) > TINY ? chunk7KFTYENS_js.normalize(side) : chunk7KFTYENS_js.normalize(alt), u = chunk7KFTYENS_js.cross(f, r), trace = addf(addf(r.x, u.y), f.z);
|
|
2144
2144
|
if (trace > 0) {
|
|
2145
2145
|
let s2 = mulf(2, sqrtf(addf(trace, 1)));
|
|
2146
2146
|
return { x: divf(subf(u.z, f.y), s2), y: divf(subf(f.x, r.z), s2), z: divf(subf(r.y, u.x), s2), w: mulf(0.25, s2) };
|
|
@@ -2157,8 +2157,8 @@ function qLookRotation(forward, up) {
|
|
|
2157
2157
|
return { x: divf(addf(f.x, r.z), s), y: divf(addf(f.y, u.z), s), z: mulf(0.25, s), w: divf(subf(r.y, u.x), s) };
|
|
2158
2158
|
}
|
|
2159
2159
|
function qSwingTwist(q, axis) {
|
|
2160
|
-
let p =
|
|
2161
|
-
return { swing:
|
|
2160
|
+
let p = chunk7KFTYENS_js.dot({ x: q.x, y: q.y, z: q.z }, axis), raw = { x: mulf(axis.x, p), y: mulf(axis.y, p), z: mulf(axis.z, p), w: q.w }, l = sqrtf(qdot(raw, raw)), twist = l > TINY ? qscale(raw, divf(1, l)) : { x: 0, y: 0, z: 0, w: 1 };
|
|
2161
|
+
return { swing: chunk7KFTYENS_js.qmul(q, chunk7KFTYENS_js.qconj(twist)), twist };
|
|
2162
2162
|
}
|
|
2163
2163
|
function clampRotation(q, maxAngle) {
|
|
2164
2164
|
let w = clampf(q.w, -1, 1), flip = w < 0 ? -1 : 1, aw = mulf(w, flip);
|
|
@@ -2168,7 +2168,7 @@ function clampRotation(q, maxAngle) {
|
|
|
2168
2168
|
}
|
|
2169
2169
|
function qClampSwingTwist(q, axis, maxSwing, maxTwist) {
|
|
2170
2170
|
let parts = qSwingTwist(q, axis);
|
|
2171
|
-
return
|
|
2171
|
+
return chunk7KFTYENS_js.qmul(clampRotation(parts.swing, maxSwing), clampRotation(parts.twist, maxTwist));
|
|
2172
2172
|
}
|
|
2173
2173
|
function qFromEuler(euler) {
|
|
2174
2174
|
let hx = mulf(euler.x, 0.5), hy = mulf(euler.y, 0.5), hz = mulf(euler.z, 0.5), sx = chunkFLWD6GRR_js.fsin(hx), cx = chunkFLWD6GRR_js.fcos(hx), sy = chunkFLWD6GRR_js.fsin(hy), cy = chunkFLWD6GRR_js.fcos(hy), sz = chunkFLWD6GRR_js.fsin(hz), cz = chunkFLWD6GRR_js.fcos(hz);
|
|
@@ -2208,13 +2208,13 @@ function qAngle(a, b) {
|
|
|
2208
2208
|
return mulf(2, chunkFLWD6GRR_js.facos(Math.min(Math.abs(qdot(a, b)), 1)));
|
|
2209
2209
|
}
|
|
2210
2210
|
function qForward(q) {
|
|
2211
|
-
return
|
|
2211
|
+
return chunk7KFTYENS_js.qrotate(q, { x: 0, y: 0, z: 1 });
|
|
2212
2212
|
}
|
|
2213
2213
|
function qUp(q) {
|
|
2214
|
-
return
|
|
2214
|
+
return chunk7KFTYENS_js.qrotate(q, { x: 0, y: 1, z: 0 });
|
|
2215
2215
|
}
|
|
2216
2216
|
function qRight(q) {
|
|
2217
|
-
return
|
|
2217
|
+
return chunk7KFTYENS_js.qrotate(q, { x: 1, y: 0, z: 0 });
|
|
2218
2218
|
}
|
|
2219
2219
|
function packComponent(c, s) {
|
|
2220
2220
|
return (Math.min(Math.max(Math.round(mulf(c, s)), -(511)), (511)) | 0) + (511) >>> 0;
|
|
@@ -2228,10 +2228,10 @@ function packRotation(q) {
|
|
|
2228
2228
|
return (largest << (30) | packComponent(a, s) << (20) | packComponent(b, s) << (10) | packComponent(c, s)) >>> 0;
|
|
2229
2229
|
}
|
|
2230
2230
|
function qIntegrate(q, angularVelocity, dt) {
|
|
2231
|
-
let omega =
|
|
2231
|
+
let omega = chunk7KFTYENS_js.len(angularVelocity);
|
|
2232
2232
|
if (omega <= TINY) return q;
|
|
2233
|
-
let step = qFromAxisAngle(
|
|
2234
|
-
return qnormalize(
|
|
2233
|
+
let step = qFromAxisAngle(chunk7KFTYENS_js.scale(angularVelocity, divf(1, omega)), mulf(omega, dt));
|
|
2234
|
+
return qnormalize(chunk7KFTYENS_js.qmul(step, q));
|
|
2235
2235
|
}
|
|
2236
2236
|
|
|
2237
2237
|
// src/game/kernel/std/motion.ts
|
|
@@ -2259,26 +2259,26 @@ function smoothDamp(current, target, velocity, smoothTime, maxSpeed, dt) {
|
|
|
2259
2259
|
return subf(target, current) > 0 == out > target && (out = target, vel = 0), { value: out, velocity: vel };
|
|
2260
2260
|
}
|
|
2261
2261
|
function smoothDamp2(current, target, velocity, smoothTime, maxSpeed, dt) {
|
|
2262
|
-
let time = Math.max(MIN_SMOOTH, smoothTime), omega = divf(2, time), k = dampFactor(omega, dt), limit = mulf(maxSpeed, time), change =
|
|
2263
|
-
lengthSq > mulf(limit, limit) && (change =
|
|
2264
|
-
let goal =
|
|
2265
|
-
return
|
|
2262
|
+
let time = Math.max(MIN_SMOOTH, smoothTime), omega = divf(2, time), k = dampFactor(omega, dt), limit = mulf(maxSpeed, time), change = chunk7KFTYENS_js.sub(current, target), lengthSq = chunk7KFTYENS_js.dot(change, change);
|
|
2263
|
+
lengthSq > mulf(limit, limit) && (change = chunk7KFTYENS_js.scale(change, divf(limit, sqrtf(lengthSq))));
|
|
2264
|
+
let goal = chunk7KFTYENS_js.sub(current, change), temp = chunk7KFTYENS_js.scale(chunk7KFTYENS_js.add(velocity, chunk7KFTYENS_js.scale(change, omega)), dt), vel = chunk7KFTYENS_js.scale(chunk7KFTYENS_js.sub(velocity, chunk7KFTYENS_js.scale(temp, omega)), k), out = chunk7KFTYENS_js.add(goal, chunk7KFTYENS_js.scale(chunk7KFTYENS_js.add(change, temp), k));
|
|
2265
|
+
return chunk7KFTYENS_js.dot(chunk7KFTYENS_js.sub(target, current), chunk7KFTYENS_js.sub(out, target)) > 0 && (out = target, vel = { x: 0, y: 0 }), { value: out, velocity: vel };
|
|
2266
2266
|
}
|
|
2267
2267
|
function smoothDamp3(current, target, velocity, smoothTime, maxSpeed, dt) {
|
|
2268
|
-
let time = Math.max(MIN_SMOOTH, smoothTime), omega = divf(2, time), k = dampFactor(omega, dt), limit = mulf(maxSpeed, time), change =
|
|
2269
|
-
lengthSq > mulf(limit, limit) && (change =
|
|
2270
|
-
let goal =
|
|
2271
|
-
return
|
|
2268
|
+
let time = Math.max(MIN_SMOOTH, smoothTime), omega = divf(2, time), k = dampFactor(omega, dt), limit = mulf(maxSpeed, time), change = chunk7KFTYENS_js.sub(current, target), lengthSq = chunk7KFTYENS_js.dot(change, change);
|
|
2269
|
+
lengthSq > mulf(limit, limit) && (change = chunk7KFTYENS_js.scale(change, divf(limit, sqrtf(lengthSq))));
|
|
2270
|
+
let goal = chunk7KFTYENS_js.sub(current, change), temp = chunk7KFTYENS_js.scale(chunk7KFTYENS_js.add(velocity, chunk7KFTYENS_js.scale(change, omega)), dt), vel = chunk7KFTYENS_js.scale(chunk7KFTYENS_js.sub(velocity, chunk7KFTYENS_js.scale(temp, omega)), k), out = chunk7KFTYENS_js.add(goal, chunk7KFTYENS_js.scale(chunk7KFTYENS_js.add(change, temp), k));
|
|
2271
|
+
return chunk7KFTYENS_js.dot(chunk7KFTYENS_js.sub(target, current), chunk7KFTYENS_js.sub(out, target)) > 0 && (out = target, vel = { x: 0, y: 0, z: 0 }), { value: out, velocity: vel };
|
|
2272
2272
|
}
|
|
2273
2273
|
function expSmooth(current, target, rate, dt) {
|
|
2274
2274
|
let t = subf(1, chunkFLWD6GRR_js.fexp(mulf(-rate, dt)));
|
|
2275
2275
|
return addf(current, mulf(subf(target, current), t));
|
|
2276
2276
|
}
|
|
2277
2277
|
function expSmooth2(current, target, rate, dt) {
|
|
2278
|
-
return
|
|
2278
|
+
return chunk7KFTYENS_js.add(current, chunk7KFTYENS_js.scale(chunk7KFTYENS_js.sub(target, current), subf(1, chunkFLWD6GRR_js.fexp(mulf(-rate, dt)))));
|
|
2279
2279
|
}
|
|
2280
2280
|
function expSmooth3(current, target, rate, dt) {
|
|
2281
|
-
return
|
|
2281
|
+
return chunk7KFTYENS_js.add(current, chunk7KFTYENS_js.scale(chunk7KFTYENS_js.sub(target, current), subf(1, chunkFLWD6GRR_js.fexp(mulf(-rate, dt)))));
|
|
2282
2282
|
}
|
|
2283
2283
|
function approach(current, target, halfLife, dt) {
|
|
2284
2284
|
let keep = halfLife > 0 ? chunkFLWD6GRR_js.fpow(0.5, divf(dt, halfLife)) : 0;
|
|
@@ -2292,12 +2292,12 @@ function moveToward(current, target, maxDelta) {
|
|
|
2292
2292
|
return Math.abs(delta) <= maxDelta ? target : addf(current, delta > 0 ? maxDelta : -maxDelta);
|
|
2293
2293
|
}
|
|
2294
2294
|
function moveToward2(current, target, maxDelta) {
|
|
2295
|
-
let delta =
|
|
2296
|
-
return l <= maxDelta || l === 0 ? target :
|
|
2295
|
+
let delta = chunk7KFTYENS_js.sub(target, current), l = sqrtf(chunk7KFTYENS_js.dot(delta, delta));
|
|
2296
|
+
return l <= maxDelta || l === 0 ? target : chunk7KFTYENS_js.add(current, chunk7KFTYENS_js.scale(delta, divf(maxDelta, l)));
|
|
2297
2297
|
}
|
|
2298
2298
|
function moveToward3(current, target, maxDelta) {
|
|
2299
|
-
let delta =
|
|
2300
|
-
return l <= maxDelta || l === 0 ? target :
|
|
2299
|
+
let delta = chunk7KFTYENS_js.sub(target, current), l = sqrtf(chunk7KFTYENS_js.dot(delta, delta));
|
|
2300
|
+
return l <= maxDelta || l === 0 ? target : chunk7KFTYENS_js.add(current, chunk7KFTYENS_js.scale(delta, divf(maxDelta, l)));
|
|
2301
2301
|
}
|
|
2302
2302
|
function rotateToward(current, target, maxDelta) {
|
|
2303
2303
|
let delta = angleDiff(current, target);
|
|
@@ -2351,8 +2351,8 @@ function denseRelu(input2, weights, bias, out) {
|
|
|
2351
2351
|
function denseTable(input2, table, out) {
|
|
2352
2352
|
let o = out, biasAt = out.length * input2.length;
|
|
2353
2353
|
for (let j = 0; j < out.length; j++) {
|
|
2354
|
-
let acc =
|
|
2355
|
-
for (let i = 0; i < input2.length; i++) acc = madf(input2[i],
|
|
2354
|
+
let acc = chunk7KFTYENS_js.lut(table, Math.fround(biasAt + j));
|
|
2355
|
+
for (let i = 0; i < input2.length; i++) acc = madf(input2[i], chunk7KFTYENS_js.lut(table, Math.fround(j * input2.length + i)), acc);
|
|
2356
2356
|
o[j] = acc;
|
|
2357
2357
|
}
|
|
2358
2358
|
return o;
|
|
@@ -2432,11 +2432,11 @@ function value2(h, dx, dy) {
|
|
|
2432
2432
|
return t > 0 ? mulf(mulf(t2, t2), addf(mulf(g.x, dx), mulf(g.y, dy))) : 0;
|
|
2433
2433
|
}
|
|
2434
2434
|
function simplex2(x, y, seed = 0) {
|
|
2435
|
-
let s = mulf(addf(x, y), F2), i = Math.floor(addf(x, s)), j = Math.floor(addf(y, s)), t = mulf(addf(i, j), G2), x0 = subf(x, subf(i, t)), y0 = subf(y, subf(j, t)), upper = x0 > y0, i1 = upper ? 1 : 0, j1 = upper ? 0 : 1, ii = i | 0, jj = j | 0, c0 = value2(
|
|
2435
|
+
let s = mulf(addf(x, y), F2), i = Math.floor(addf(x, s)), j = Math.floor(addf(y, s)), t = mulf(addf(i, j), G2), x0 = subf(x, subf(i, t)), y0 = subf(y, subf(j, t)), upper = x0 > y0, i1 = upper ? 1 : 0, j1 = upper ? 0 : 1, ii = i | 0, jj = j | 0, c0 = value2(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, ii), jj), x0, y0), c1 = value2(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, ii + i1 | 0), jj + j1 | 0), addf(subf(x0, i1), G2), addf(subf(y0, j1), G2)), c2 = value2(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, ii + 1 | 0), jj + 1 | 0), addf(x0, G2X2M1), addf(y0, G2X2M1));
|
|
2436
2436
|
return mulf(SCALE2, addf(addf(c0, c1), c2));
|
|
2437
2437
|
}
|
|
2438
2438
|
function simplex2d(x, y, seed = 0) {
|
|
2439
|
-
let s = mulf(addf(x, y), F2), i = Math.floor(addf(x, s)), j = Math.floor(addf(y, s)), t = mulf(addf(i, j), G2), x0 = subf(x, subf(i, t)), y0 = subf(y, subf(j, t)), upper = x0 > y0, i1 = upper ? 1 : 0, j1 = upper ? 0 : 1, x1 = addf(subf(x0, i1), G2), y1 = addf(subf(y0, j1), G2), x2 = addf(x0, G2X2M1), y2 = addf(y0, G2X2M1), ii = i | 0, jj = j | 0, c0 = corner2(
|
|
2439
|
+
let s = mulf(addf(x, y), F2), i = Math.floor(addf(x, s)), j = Math.floor(addf(y, s)), t = mulf(addf(i, j), G2), x0 = subf(x, subf(i, t)), y0 = subf(y, subf(j, t)), upper = x0 > y0, i1 = upper ? 1 : 0, j1 = upper ? 0 : 1, x1 = addf(subf(x0, i1), G2), y1 = addf(subf(y0, j1), G2), x2 = addf(x0, G2X2M1), y2 = addf(y0, G2X2M1), ii = i | 0, jj = j | 0, c0 = corner2(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, ii), jj), x0, y0), c1 = corner2(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, ii + i1 | 0), jj + j1 | 0), x1, y1), c2 = corner2(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, ii + 1 | 0), jj + 1 | 0), x2, y2);
|
|
2440
2440
|
return {
|
|
2441
2441
|
x: mulf(SCALE2, addf(addf(c0.x, c1.x), c2.x)),
|
|
2442
2442
|
y: mulf(SCALE2, addf(addf(c0.y, c1.y), c2.y)),
|
|
@@ -2457,7 +2457,7 @@ function corner3(h, dx, dy, dz) {
|
|
|
2457
2457
|
};
|
|
2458
2458
|
}
|
|
2459
2459
|
function lattice3(seed, i, j, k) {
|
|
2460
|
-
return
|
|
2460
|
+
return chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, i), j), k);
|
|
2461
2461
|
}
|
|
2462
2462
|
function cell3(x, y, z) {
|
|
2463
2463
|
let s = mulf(addf(addf(x, y), z), F3), i = Math.floor(addf(x, s)), j = Math.floor(addf(y, s)), k = Math.floor(addf(z, s)), t = mulf(addf(addf(i, j), k), G3), x0 = subf(x, subf(i, t)), y0 = subf(y, subf(j, t)), z0 = subf(z, subf(k, t)), rx = (x0 > y0 ? 1 : 0) + (x0 > z0 ? 1 : 0), ry = (y0 >= x0 ? 1 : 0) + (y0 > z0 ? 1 : 0), rz = (z0 >= x0 ? 1 : 0) + (z0 >= y0 ? 1 : 0);
|
|
@@ -2497,7 +2497,7 @@ function corner4(h, dx, dy, dz, dw) {
|
|
|
2497
2497
|
return t > 0 ? mulf(mulf(t2, t2), gd) : 0;
|
|
2498
2498
|
}
|
|
2499
2499
|
function lattice4(seed, i, j, k, l) {
|
|
2500
|
-
return
|
|
2500
|
+
return chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, i), j), k), l);
|
|
2501
2501
|
}
|
|
2502
2502
|
function simplex4(x, y, z, w, seed = 0) {
|
|
2503
2503
|
let s = mulf(addf(addf(addf(x, y), z), w), F4), i = Math.floor(addf(x, s)), j = Math.floor(addf(y, s)), k = Math.floor(addf(z, s)), l = Math.floor(addf(w, s)), t = mulf(addf(addf(addf(i, j), k), l), G4), x0 = subf(x, subf(i, t)), y0 = subf(y, subf(j, t)), z0 = subf(z, subf(k, t)), w0 = subf(w, subf(l, t)), rx = (x0 > y0 ? 1 : 0) + (x0 > z0 ? 1 : 0) + (x0 > w0 ? 1 : 0), ry = (y0 >= x0 ? 1 : 0) + (y0 > z0 ? 1 : 0) + (y0 > w0 ? 1 : 0), rz = (z0 >= x0 ? 1 : 0) + (z0 >= y0 ? 1 : 0) + (z0 > w0 ? 1 : 0), rw = (w0 >= x0 ? 1 : 0) + (w0 >= y0 ? 1 : 0) + (w0 >= z0 ? 1 : 0), ii = i | 0, jj = j | 0, kk = k | 0, ll = l | 0, total = corner4(lattice4(seed, ii, jj, kk, ll), x0, y0, z0, w0);
|
|
@@ -2512,7 +2512,7 @@ function worley2(x, y, seed = 0) {
|
|
|
2512
2512
|
let cx = Math.floor(x), cy = Math.floor(y), ix = cx | 0, iy = cy | 0, f1 = 1 / 0, f2 = 1 / 0;
|
|
2513
2513
|
for (let dy = -1; dy <= 1; dy++)
|
|
2514
2514
|
for (let dx = -1; dx <= 1; dx++) {
|
|
2515
|
-
let h =
|
|
2515
|
+
let h = chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, ix + dx | 0), iy + dy | 0), px = subf(addf(addf(cx, dx), chunk7KFTYENS_js.rand01(h, 0)), x), py = subf(addf(addf(cy, dy), chunk7KFTYENS_js.rand01(h, 1)), y), d = addf(mulf(px, px), mulf(py, py));
|
|
2516
2516
|
f2 = d < f1 ? f1 : Math.min(f2, d), f1 = Math.min(f1, d);
|
|
2517
2517
|
}
|
|
2518
2518
|
return { x: sqrtf(f1), y: sqrtf(f2) };
|
|
@@ -2522,7 +2522,7 @@ function worley3(x, y, z, seed = 0) {
|
|
|
2522
2522
|
for (let dz = -1; dz <= 1; dz++)
|
|
2523
2523
|
for (let dy = -1; dy <= 1; dy++)
|
|
2524
2524
|
for (let dx = -1; dx <= 1; dx++) {
|
|
2525
|
-
let h = lattice3(seed, ix + dx | 0, iy + dy | 0, iz + dz | 0), px = subf(addf(addf(cx, dx),
|
|
2525
|
+
let h = lattice3(seed, ix + dx | 0, iy + dy | 0, iz + dz | 0), px = subf(addf(addf(cx, dx), chunk7KFTYENS_js.rand01(h, 0)), x), py = subf(addf(addf(cy, dy), chunk7KFTYENS_js.rand01(h, 1)), y), pz = subf(addf(addf(cz, dz), chunk7KFTYENS_js.rand01(h, 2)), z), d = addf(addf(mulf(px, px), mulf(py, py)), mulf(pz, pz));
|
|
2526
2526
|
f2 = d < f1 ? f1 : Math.min(f2, d), f1 = Math.min(f1, d);
|
|
2527
2527
|
}
|
|
2528
2528
|
return { x: sqrtf(f1), y: sqrtf(f2) };
|
|
@@ -2579,7 +2579,7 @@ function wrapIndex(i, period) {
|
|
|
2579
2579
|
return r < 0 ? r + p | 0 : r;
|
|
2580
2580
|
}
|
|
2581
2581
|
function lattice(seed, x, y) {
|
|
2582
|
-
return
|
|
2582
|
+
return chunk7KFTYENS_js.rand01(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, x), y), 0);
|
|
2583
2583
|
}
|
|
2584
2584
|
function fade(t) {
|
|
2585
2585
|
return mulf(mulf(mulf(t, t), t), madf(t, msub(t), FADE_C));
|
|
@@ -2614,17 +2614,17 @@ function texCells(u, v, period, jitter, seed = 0) {
|
|
|
2614
2614
|
let x = mulf(u, period), y = mulf(v, period), cx = Math.floor(x), cy = Math.floor(y), ix = cx | 0, iy = cy | 0, f1 = 1 / 0, f2 = 1 / 0, id = 0;
|
|
2615
2615
|
for (let dy = -1; dy <= 1; dy++)
|
|
2616
2616
|
for (let dx = -1; dx <= 1; dx++) {
|
|
2617
|
-
let h =
|
|
2618
|
-
d < f1 ? (f2 = f1, f1 = d, id =
|
|
2617
|
+
let h = chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, wrapIndex(ix + dx | 0, period)), wrapIndex(iy + dy | 0, period)), px = subf(addf(addf(cx, dx), madf(subf(chunk7KFTYENS_js.rand01(h, 0), HALF), jitter, HALF)), x), py = subf(addf(addf(cy, dy), madf(subf(chunk7KFTYENS_js.rand01(h, 1), HALF), jitter, HALF)), y), d = addf(mulf(px, px), mulf(py, py));
|
|
2618
|
+
d < f1 ? (f2 = f1, f1 = d, id = chunk7KFTYENS_js.rand01(h, 2)) : f2 = Math.min(f2, d);
|
|
2619
2619
|
}
|
|
2620
2620
|
return { x: sqrtf(f1), y: sqrtf(f2), z: id };
|
|
2621
2621
|
}
|
|
2622
2622
|
function texBricks(u, v, rows, columns, mortar, seed = 0) {
|
|
2623
|
-
let y = mulf(v, rows), row2 = Math.floor(y) | 0, shift = (row2 & 1) === 1 ? HALF : 0, x = addf(mulf(u, columns), shift), column = Math.floor(x) | 0, fx = subf(x, Math.floor(x)), fy = subf(y, Math.floor(y)), edgeX = mulf(Math.min(fx, subf(ONE2, fx)), divf(ONE2, columns)), edgeY = mulf(Math.min(fy, subf(ONE2, fy)), divf(ONE2, rows)), edge = Math.min(edgeX, edgeY), brick = edge > mortar ? ONE2 : 0, id =
|
|
2623
|
+
let y = mulf(v, rows), row2 = Math.floor(y) | 0, shift = (row2 & 1) === 1 ? HALF : 0, x = addf(mulf(u, columns), shift), column = Math.floor(x) | 0, fx = subf(x, Math.floor(x)), fy = subf(y, Math.floor(y)), edgeX = mulf(Math.min(fx, subf(ONE2, fx)), divf(ONE2, columns)), edgeY = mulf(Math.min(fy, subf(ONE2, fy)), divf(ONE2, rows)), edge = Math.min(edgeX, edgeY), brick = edge > mortar ? ONE2 : 0, id = chunk7KFTYENS_js.rand01(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, wrapIndex(column, columns)), row2 + (-2048144789) | 0), 0);
|
|
2624
2624
|
return { x: brick, y: id, z: edge };
|
|
2625
2625
|
}
|
|
2626
2626
|
function texTiles(u, v, count, grout, seed = 0) {
|
|
2627
|
-
let x = mulf(u, count), y = mulf(v, count), fx = subf(x, Math.floor(x)), fy = subf(y, Math.floor(y)), edge = divf(Math.min(Math.min(fx, subf(ONE2, fx)), Math.min(fy, subf(ONE2, fy))), count), id =
|
|
2627
|
+
let x = mulf(u, count), y = mulf(v, count), fx = subf(x, Math.floor(x)), fy = subf(y, Math.floor(y)), edge = divf(Math.min(Math.min(fx, subf(ONE2, fx)), Math.min(fy, subf(ONE2, fy))), count), id = chunk7KFTYENS_js.rand01(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, Math.floor(x) | 0), Math.floor(y) | 0), 0);
|
|
2628
2628
|
return { x: edge > grout ? ONE2 : 0, y: id, z: edge };
|
|
2629
2629
|
}
|
|
2630
2630
|
function texWeave(u, v, count) {
|
|
@@ -2649,51 +2649,51 @@ function texNormal(left, right, down, up, strength) {
|
|
|
2649
2649
|
// src/game/kernel/std/random.ts
|
|
2650
2650
|
var TWO_PI2 = Math.fround(2 * Math.PI), THIRD2 = Math.fround(1 / 3), PERMUTE_ROUNDS = 24, PERMUTE_FLIP = 1540483477;
|
|
2651
2651
|
function rngKey(seed, row2, tick, site) {
|
|
2652
|
-
return
|
|
2652
|
+
return chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, row2), chunk7KFTYENS_js.hash32(tick, site));
|
|
2653
2653
|
}
|
|
2654
2654
|
function randBits(key, n) {
|
|
2655
|
-
return
|
|
2655
|
+
return chunk7KFTYENS_js.hash32(key, n);
|
|
2656
2656
|
}
|
|
2657
2657
|
function randUnit(key, n) {
|
|
2658
|
-
return
|
|
2658
|
+
return chunk7KFTYENS_js.rand01(key, n);
|
|
2659
2659
|
}
|
|
2660
2660
|
function randRange(key, n, low, high) {
|
|
2661
|
-
return madf(
|
|
2661
|
+
return madf(chunk7KFTYENS_js.rand01(key, n), subf(high, low), low);
|
|
2662
2662
|
}
|
|
2663
2663
|
function randInt(key, n, low, high) {
|
|
2664
2664
|
let span = Math.fround(high - low | 0);
|
|
2665
|
-
return low + (Math.floor(mulf(
|
|
2665
|
+
return low + (Math.floor(mulf(chunk7KFTYENS_js.rand01(key, n), span)) | 0) | 0;
|
|
2666
2666
|
}
|
|
2667
2667
|
function randChance(key, n, probability) {
|
|
2668
|
-
return
|
|
2668
|
+
return chunk7KFTYENS_js.rand01(key, n) < Math.fround(probability);
|
|
2669
2669
|
}
|
|
2670
2670
|
function randNormal(key, n) {
|
|
2671
|
-
let sub2 =
|
|
2672
|
-
return mulf(r, chunkFLWD6GRR_js.fcos(mulf(TWO_PI2,
|
|
2671
|
+
let sub2 = chunk7KFTYENS_js.hash32(key, n), r = sqrtf(mulf(-2, chunkFLWD6GRR_js.flog(subf(1, chunk7KFTYENS_js.rand01(sub2, 0)))));
|
|
2672
|
+
return mulf(r, chunkFLWD6GRR_js.fcos(mulf(TWO_PI2, chunk7KFTYENS_js.rand01(sub2, 1))));
|
|
2673
2673
|
}
|
|
2674
2674
|
function randNormal2(key, n) {
|
|
2675
|
-
let sub2 =
|
|
2675
|
+
let sub2 = chunk7KFTYENS_js.hash32(key, n), r = sqrtf(mulf(-2, chunkFLWD6GRR_js.flog(subf(1, chunk7KFTYENS_js.rand01(sub2, 0))))), a = mulf(TWO_PI2, chunk7KFTYENS_js.rand01(sub2, 1));
|
|
2676
2676
|
return { x: mulf(r, chunkFLWD6GRR_js.fcos(a)), y: mulf(r, chunkFLWD6GRR_js.fsin(a)) };
|
|
2677
2677
|
}
|
|
2678
2678
|
function randGaussian(key, n, mean, deviation) {
|
|
2679
2679
|
return madf(randNormal(key, n), deviation, mean);
|
|
2680
2680
|
}
|
|
2681
2681
|
function randExp(key, n, rate) {
|
|
2682
|
-
return Math.fround(-chunkFLWD6GRR_js.flog(subf(1,
|
|
2682
|
+
return Math.fround(-chunkFLWD6GRR_js.flog(subf(1, chunk7KFTYENS_js.rand01(key, n))) / rate);
|
|
2683
2683
|
}
|
|
2684
2684
|
function randWeighted(key, n, weights) {
|
|
2685
2685
|
let total = 0;
|
|
2686
2686
|
for (let i = 0; i < weights.length; i++) total = addf(total, weights[i]);
|
|
2687
|
-
let target = mulf(
|
|
2687
|
+
let target = mulf(chunk7KFTYENS_js.rand01(key, n), total), acc = 0, pick2 = 0;
|
|
2688
2688
|
for (let i = 0; i < weights.length - 1; i++)
|
|
2689
2689
|
acc = addf(acc, weights[i]), acc <= target && (pick2 = i + 1);
|
|
2690
2690
|
return pick2;
|
|
2691
2691
|
}
|
|
2692
2692
|
function randShuffle(key, n, values, out) {
|
|
2693
|
-
let sub2 =
|
|
2693
|
+
let sub2 = chunk7KFTYENS_js.hash32(key, n), o = out;
|
|
2694
2694
|
for (let i = 0; i < values.length; i++) o[i] = values[i];
|
|
2695
2695
|
for (let i = values.length - 1; i > 0; i--) {
|
|
2696
|
-
let j = Math.floor(mulf(
|
|
2696
|
+
let j = Math.floor(mulf(chunk7KFTYENS_js.rand01(sub2, i), i + 1)) | 0, a = o[i], b = o[j];
|
|
2697
2697
|
o[j] = a, o[i] = b;
|
|
2698
2698
|
}
|
|
2699
2699
|
return o;
|
|
@@ -2701,30 +2701,30 @@ function randShuffle(key, n, values, out) {
|
|
|
2701
2701
|
function randPermute(key, index, count) {
|
|
2702
2702
|
let size = count > 1 ? count >>> 0 : 1, x = index >>> 0;
|
|
2703
2703
|
for (let r = 0; r < (24); r++) {
|
|
2704
|
-
let k =
|
|
2705
|
-
(
|
|
2704
|
+
let k = chunk7KFTYENS_js.hash32(key, r) % size, wrapped = k - x >>> 0, partner = k < x ? wrapped + size >>> 0 : wrapped, high = x > partner ? x : partner;
|
|
2705
|
+
(chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(key, r ^ (1540483477)), high) & 1) !== 0 && (x = partner);
|
|
2706
2706
|
}
|
|
2707
2707
|
return x;
|
|
2708
2708
|
}
|
|
2709
2709
|
function randInDisc(key, n) {
|
|
2710
|
-
let sub2 =
|
|
2710
|
+
let sub2 = chunk7KFTYENS_js.hash32(key, n), r = sqrtf(chunk7KFTYENS_js.rand01(sub2, 0)), a = mulf(TWO_PI2, chunk7KFTYENS_js.rand01(sub2, 1));
|
|
2711
2711
|
return { x: mulf(r, chunkFLWD6GRR_js.fcos(a)), y: mulf(r, chunkFLWD6GRR_js.fsin(a)) };
|
|
2712
2712
|
}
|
|
2713
2713
|
function randOnCircle(key, n) {
|
|
2714
|
-
let a = mulf(TWO_PI2,
|
|
2714
|
+
let a = mulf(TWO_PI2, chunk7KFTYENS_js.rand01(key, n));
|
|
2715
2715
|
return { x: chunkFLWD6GRR_js.fcos(a), y: chunkFLWD6GRR_js.fsin(a) };
|
|
2716
2716
|
}
|
|
2717
2717
|
function randOnSphere(key, n) {
|
|
2718
|
-
let sub2 =
|
|
2718
|
+
let sub2 = chunk7KFTYENS_js.hash32(key, n), z = subf(1, mulf(2, chunk7KFTYENS_js.rand01(sub2, 0))), r = sqrtf(Math.max(0, subf(1, mulf(z, z)))), a = mulf(TWO_PI2, chunk7KFTYENS_js.rand01(sub2, 1));
|
|
2719
2719
|
return { x: mulf(r, chunkFLWD6GRR_js.fcos(a)), y: mulf(r, chunkFLWD6GRR_js.fsin(a)), z };
|
|
2720
2720
|
}
|
|
2721
2721
|
function randInBall(key, n) {
|
|
2722
2722
|
let d = randOnSphere(key, n);
|
|
2723
|
-
return
|
|
2723
|
+
return chunk7KFTYENS_js.scale(d, chunkFLWD6GRR_js.fpow(chunk7KFTYENS_js.rand01(chunk7KFTYENS_js.hash32(key, n), 2), THIRD2));
|
|
2724
2724
|
}
|
|
2725
2725
|
function randHemisphere(key, n, normal) {
|
|
2726
2726
|
let d = randOnSphere(key, n);
|
|
2727
|
-
return
|
|
2727
|
+
return chunk7KFTYENS_js.dot(d, normal) < 0 ? chunk7KFTYENS_js.negate(d) : d;
|
|
2728
2728
|
}
|
|
2729
2729
|
function randCosHemisphere(key, n, normal) {
|
|
2730
2730
|
let p = randInDisc(key, n), up = sqrtf(Math.max(0, subf(subf(1, mulf(p.x, p.x)), mulf(p.y, p.y)))), frame = basisFrom(normal);
|
|
@@ -2735,10 +2735,10 @@ function randCosHemisphere(key, n, normal) {
|
|
|
2735
2735
|
};
|
|
2736
2736
|
}
|
|
2737
2737
|
function poissonPoint(cellX, cellY, cellSize, minDist, seed) {
|
|
2738
|
-
let h =
|
|
2738
|
+
let h = chunk7KFTYENS_js.hash32(chunk7KFTYENS_js.hash32(seed, cellX), cellY), margin = mulf(0.5, minDist), span = Math.max(0, subf(cellSize, minDist));
|
|
2739
2739
|
return {
|
|
2740
|
-
x: addf(mulf(Math.fround(cellX), cellSize), madf(
|
|
2741
|
-
y: addf(mulf(Math.fround(cellY), cellSize), madf(
|
|
2740
|
+
x: addf(mulf(Math.fround(cellX), cellSize), madf(chunk7KFTYENS_js.rand01(h, 0), span, margin)),
|
|
2741
|
+
y: addf(mulf(Math.fround(cellY), cellSize), madf(chunk7KFTYENS_js.rand01(h, 1), span, margin))
|
|
2742
2742
|
};
|
|
2743
2743
|
}
|
|
2744
2744
|
|
|
@@ -2747,23 +2747,23 @@ var POLY6 = Math.fround(315 / (64 * Math.PI)), SPIKY = Math.fround(-45 / Math.PI
|
|
|
2747
2747
|
function eulerStep(pos, vel, accel, dt, substeps) {
|
|
2748
2748
|
let h = divf(dt, Math.fround(Math.max(substeps, 1))), p = pos, v = vel;
|
|
2749
2749
|
for (let k = 0; k < substeps; k++)
|
|
2750
|
-
v =
|
|
2750
|
+
v = chunk7KFTYENS_js.add(v, chunk7KFTYENS_js.scale(accel(p, v), h)), p = chunk7KFTYENS_js.add(p, chunk7KFTYENS_js.scale(v, h));
|
|
2751
2751
|
return { pos: p, vel: v };
|
|
2752
2752
|
}
|
|
2753
2753
|
function verletStep(pos, vel, acc, accel, dt, substeps) {
|
|
2754
2754
|
let h = divf(dt, Math.fround(Math.max(substeps, 1))), half = mulf(0.5, h), hh = mulf(half, h), p = pos, v = vel, a = acc;
|
|
2755
2755
|
for (let k = 0; k < substeps; k++) {
|
|
2756
|
-
p =
|
|
2756
|
+
p = chunk7KFTYENS_js.add(chunk7KFTYENS_js.add(p, chunk7KFTYENS_js.scale(v, h)), chunk7KFTYENS_js.scale(a, hh));
|
|
2757
2757
|
let next = accel(p, v);
|
|
2758
|
-
v =
|
|
2758
|
+
v = chunk7KFTYENS_js.add(v, chunk7KFTYENS_js.scale(chunk7KFTYENS_js.add(a, next), half)), a = next;
|
|
2759
2759
|
}
|
|
2760
2760
|
return { pos: p, vel: v, acc: a };
|
|
2761
2761
|
}
|
|
2762
2762
|
function rk2Step(pos, vel, accel, dt, substeps) {
|
|
2763
2763
|
let h = divf(dt, Math.fround(Math.max(substeps, 1))), half = mulf(0.5, h), p = pos, v = vel;
|
|
2764
2764
|
for (let k = 0; k < substeps; k++) {
|
|
2765
|
-
let a0 = accel(p, v), pm =
|
|
2766
|
-
p =
|
|
2765
|
+
let a0 = accel(p, v), pm = chunk7KFTYENS_js.add(p, chunk7KFTYENS_js.scale(v, half)), vm = chunk7KFTYENS_js.add(v, chunk7KFTYENS_js.scale(a0, half)), am = accel(pm, vm);
|
|
2766
|
+
p = chunk7KFTYENS_js.add(p, chunk7KFTYENS_js.scale(vm, h)), v = chunk7KFTYENS_js.add(v, chunk7KFTYENS_js.scale(am, h));
|
|
2767
2767
|
}
|
|
2768
2768
|
return { pos: p, vel: v };
|
|
2769
2769
|
}
|
|
@@ -2772,27 +2772,27 @@ function sphPoly6(distSq2, h) {
|
|
|
2772
2772
|
return distSq2 < h2 && distSq2 >= 0 ? mulf(k, mulf(mulf(d, d), d)) : 0;
|
|
2773
2773
|
}
|
|
2774
2774
|
function sphSpikyGrad(offset, h) {
|
|
2775
|
-
let r = sqrtf(
|
|
2776
|
-
return r > 0 && r < h ?
|
|
2775
|
+
let r = sqrtf(chunk7KFTYENS_js.dot(offset, offset)), d = subf(h, r), h2 = mulf(h, h), h6 = mulf(mulf(h2, h2), h2), k = divf(mulf(SPIKY, mulf(d, d)), mulf(h6, r));
|
|
2776
|
+
return r > 0 && r < h ? chunk7KFTYENS_js.scale(offset, k) : { x: 0, y: 0, z: 0 };
|
|
2777
2777
|
}
|
|
2778
2778
|
function sphViscosityLap(r, h) {
|
|
2779
2779
|
let h2 = mulf(h, h), h6 = mulf(mulf(h2, h2), h2);
|
|
2780
2780
|
return r < h && r >= 0 ? mulf(divf(VISCOSITY, h6), subf(h, r)) : 0;
|
|
2781
2781
|
}
|
|
2782
2782
|
function reflectVelocity(vel, normal, restitution, friction) {
|
|
2783
|
-
let vn =
|
|
2783
|
+
let vn = chunk7KFTYENS_js.dot(vel, normal), normalPart = chunk7KFTYENS_js.scale(normal, vn), tangent = chunk7KFTYENS_js.sub(vel, normalPart), bounced = chunk7KFTYENS_js.sub(chunk7KFTYENS_js.scale(tangent, subf(1, friction)), chunk7KFTYENS_js.scale(normalPart, restitution));
|
|
2784
2784
|
return vn < 0 ? bounced : vel;
|
|
2785
2785
|
}
|
|
2786
2786
|
function sphereImpulse(p1, v1, m1, p2, v2, m2, restitution) {
|
|
2787
|
-
let d =
|
|
2787
|
+
let d = chunk7KFTYENS_js.sub(p2, p1), l = sqrtf(chunk7KFTYENS_js.dot(d, d)), n = l > 0 ? chunk7KFTYENS_js.scale(d, divf(1, l)) : { x: 1, y: 0, z: 0 }, closing = chunk7KFTYENS_js.dot(chunk7KFTYENS_js.sub(v2, v1), n), inv1 = divf(1, m1), inv2 = divf(1, m2), j = divf(mulf(-addf(1, restitution), closing), addf(inv1, inv2)), live = closing < 0;
|
|
2788
2788
|
return {
|
|
2789
|
-
v1: live ?
|
|
2790
|
-
v2: live ?
|
|
2789
|
+
v1: live ? chunk7KFTYENS_js.sub(v1, chunk7KFTYENS_js.scale(n, mulf(j, inv1))) : v1,
|
|
2790
|
+
v2: live ? chunk7KFTYENS_js.add(v2, chunk7KFTYENS_js.scale(n, mulf(j, inv2))) : v2
|
|
2791
2791
|
};
|
|
2792
2792
|
}
|
|
2793
2793
|
function springForce(p1, p2, v1, v2, rest, stiffness, damping) {
|
|
2794
|
-
let d =
|
|
2795
|
-
return
|
|
2794
|
+
let d = chunk7KFTYENS_js.sub(p2, p1), l = sqrtf(chunk7KFTYENS_js.dot(d, d)), n = l > 0 ? chunk7KFTYENS_js.scale(d, divf(1, l)) : { x: 0, y: 0, z: 0 }, stretch = subf(l, rest), rate = chunk7KFTYENS_js.dot(chunk7KFTYENS_js.sub(v2, v1), n);
|
|
2795
|
+
return chunk7KFTYENS_js.scale(n, addf(mulf(stiffness, stretch), mulf(damping, rate)));
|
|
2796
2796
|
}
|
|
2797
2797
|
|
|
2798
2798
|
// src/game/kernel/std/dct.ts
|
|
@@ -2945,23 +2945,23 @@ function sh4Basis(d) {
|
|
|
2945
2945
|
return { x: Y0, y: mulf(Y1, d.y), z: mulf(Y1, d.z), w: mulf(Y1, d.x) };
|
|
2946
2946
|
}
|
|
2947
2947
|
function sh4Project(d, value) {
|
|
2948
|
-
return
|
|
2948
|
+
return chunk7KFTYENS_js.scale(sh4Basis(d), value);
|
|
2949
2949
|
}
|
|
2950
2950
|
function sh4Eval(sh, d) {
|
|
2951
|
-
return
|
|
2951
|
+
return chunk7KFTYENS_js.dot(sh, sh4Basis(d));
|
|
2952
2952
|
}
|
|
2953
2953
|
function sh4Irradiance(sh, normal) {
|
|
2954
2954
|
let b = sh4Basis(normal), linear = addf(addf(mulf(sh.y, b.y), mulf(sh.z, b.z)), mulf(sh.w, b.w));
|
|
2955
2955
|
return addf(mulf(A0, mulf(sh.x, b.x)), mulf(A1, linear));
|
|
2956
2956
|
}
|
|
2957
2957
|
function sh4Add(a, b) {
|
|
2958
|
-
return
|
|
2958
|
+
return chunk7KFTYENS_js.add(a, b);
|
|
2959
2959
|
}
|
|
2960
2960
|
function sh4Scale(a, s) {
|
|
2961
|
-
return
|
|
2961
|
+
return chunk7KFTYENS_js.scale(a, s);
|
|
2962
2962
|
}
|
|
2963
2963
|
function sh4Rotate(sh, rotation) {
|
|
2964
|
-
let v =
|
|
2964
|
+
let v = chunk7KFTYENS_js.qrotate(rotation, { x: sh.w, y: sh.y, z: sh.z });
|
|
2965
2965
|
return { x: sh.x, y: v.y, z: v.z, w: v.x };
|
|
2966
2966
|
}
|
|
2967
2967
|
function sh9Basis(d, out) {
|
|
@@ -2991,7 +2991,7 @@ function sh9Scale(a, s, out) {
|
|
|
2991
2991
|
return o;
|
|
2992
2992
|
}
|
|
2993
2993
|
function sh9Rotate(sh, rotation, out) {
|
|
2994
|
-
let inverse =
|
|
2994
|
+
let inverse = chunk7KFTYENS_js.qconj(rotation), v = chunk7KFTYENS_js.qrotate(rotation, { x: sh[3], y: sh[1], z: sh[2] }), b0 = dot2(sh, band2(chunk7KFTYENS_js.qrotate(inverse, { x: 1, y: 0, z: 0 }))), b1 = dot2(sh, band2(chunk7KFTYENS_js.qrotate(inverse, { x: 0, y: 0, z: 1 }))), b2 = dot2(sh, band2(chunk7KFTYENS_js.qrotate(inverse, { x: K, y: K, z: 0 }))), b3 = dot2(sh, band2(chunk7KFTYENS_js.qrotate(inverse, { x: K, y: 0, z: K }))), b4 = dot2(sh, band2(chunk7KFTYENS_js.qrotate(inverse, { x: 0, y: K, z: K }))), o = out;
|
|
2995
2995
|
return o[0] = sh[0], o[1] = v.y, o[2] = v.z, o[3] = v.x, o[4] = addf(mulf(R1, b1), mulf(R2, b2)), o[5] = addf(mulf(R1, b0), mulf(R2, b4)), o[6] = mulf(R3, b1), o[7] = addf(subf(mulf(R2, b3), mulf(R1, b0)), -mulf(R1, b1)), o[8] = addf(mulf(R2, b0), mulf(R1, b1)), o;
|
|
2996
2996
|
}
|
|
2997
2997
|
|
|
@@ -6052,7 +6052,7 @@ var CHEMISTRY_PROMPT = "chemistry_invent", CHEMISTRY_SCHEMA = "chemistry_proposa
|
|
|
6052
6052
|
melt_k: { type: "integer", minimum: 0, maximum: 7999 },
|
|
6053
6053
|
boil_k: { type: "integer", minimum: 0, maximum: 7999 },
|
|
6054
6054
|
density: { type: "integer", minimum: 1, maximum: 3e4 },
|
|
6055
|
-
groups: { type: "array", maxItems: 4, items: { enum:
|
|
6055
|
+
groups: { type: "array", maxItems: 4, items: { enum: chunk7KFTYENS_js.CHEMISTRY_GROUPS } },
|
|
6056
6056
|
colour: { type: "string", pattern: "^#[0-9a-fA-F]{6}$" },
|
|
6057
6057
|
ignition_k: { type: "integer", minimum: 0, maximum: 7999 }
|
|
6058
6058
|
}
|
|
@@ -6133,7 +6133,7 @@ function proposalText(p) {
|
|
|
6133
6133
|
if (!NAME.test(m.name) || !FORMULA.test(m.formula)) throw new RangeError(`bad material ${m.name}`);
|
|
6134
6134
|
let parts = [`species ${m.name}`, `formula=${m.formula}`, `hf=${Math.round(m.formation_kj * 1e3)}`];
|
|
6135
6135
|
m.melt_k !== void 0 && m.melt_k > 0 && parts.push(`melt=${m.melt_k}:${Math.round(m.melt_k * 10)}`), m.boil_k !== void 0 && m.boil_k > 0 && parts.push(`boil=${m.boil_k}:${Math.round(m.boil_k * 88)}`), m.density !== void 0 && parts.push(`density=${m.density},${m.density}`);
|
|
6136
|
-
let groups = (m.groups ?? []).filter((g) =>
|
|
6136
|
+
let groups = (m.groups ?? []).filter((g) => chunk7KFTYENS_js.CHEMISTRY_GROUPS.includes(g));
|
|
6137
6137
|
groups.length > 0 ? parts.push(`groups=${[...groups, "custom"].join(",")}`) : parts.push("groups=custom"), m.colour !== void 0 && /^#[0-9a-fA-F]{6}$/.test(m.colour) && parts.push(`colour=${m.colour.slice(1)}ff`), m.ignition_k !== void 0 && m.ignition_k > 0 && parts.push(`ignition=${m.ignition_k}`), lines.push(parts.join(" "));
|
|
6138
6138
|
}
|
|
6139
6139
|
let r = p.reaction;
|
|
@@ -6792,7 +6792,7 @@ var Noise = class {
|
|
|
6792
6792
|
this.reseed(seed);
|
|
6793
6793
|
}
|
|
6794
6794
|
reseed(seed) {
|
|
6795
|
-
let random = new
|
|
6795
|
+
let random = new chunk5LH2QN3T_js.SeededRandom(seed), p = this.perm;
|
|
6796
6796
|
for (let i = 0; i < (256); i++) p[i] = i;
|
|
6797
6797
|
for (let i = (256) - 1; i > 0; i--) {
|
|
6798
6798
|
let j = random.int(0, i), t = p[i];
|
|
@@ -9288,31 +9288,31 @@ function encodeNavTile(desc) {
|
|
|
9288
9288
|
// src/game/ai/index.ts
|
|
9289
9289
|
var ai_exports = {};
|
|
9290
9290
|
chunkJGBCIKJV_js.__export(ai_exports, {
|
|
9291
|
-
AI_EVENT_WORDS: () =>
|
|
9292
|
-
AI_MAX_GAME_SLOTS: () =>
|
|
9293
|
-
AI_NONE: () =>
|
|
9294
|
-
AiEventKind: () =>
|
|
9295
|
-
BUILTIN_INPUTS: () =>
|
|
9296
|
-
DEFAULT_SKILL: () =>
|
|
9297
|
-
DEFAULT_STEERING: () =>
|
|
9298
|
-
GameAi: () =>
|
|
9291
|
+
AI_EVENT_WORDS: () => chunk3S6WPBZL_js.AI_EVENT_WORDS,
|
|
9292
|
+
AI_MAX_GAME_SLOTS: () => chunk3S6WPBZL_js.AI_MAX_GAME_SLOTS,
|
|
9293
|
+
AI_NONE: () => chunk3S6WPBZL_js.AI_NONE,
|
|
9294
|
+
AiEventKind: () => chunk3S6WPBZL_js.AiEventKind,
|
|
9295
|
+
BUILTIN_INPUTS: () => chunk3S6WPBZL_js.BUILTIN_INPUTS,
|
|
9296
|
+
DEFAULT_SKILL: () => chunk7KFTYENS_js.DEFAULT_SKILL,
|
|
9297
|
+
DEFAULT_STEERING: () => chunk7KFTYENS_js.DEFAULT_STEERING,
|
|
9298
|
+
GameAi: () => chunk7KFTYENS_js.GameAi,
|
|
9299
9299
|
KEEPER_GAME_SLOTS: () => KEEPER_GAME_SLOTS,
|
|
9300
|
-
PHASE_IDLE: () =>
|
|
9301
|
-
PHASE_RECOVER: () =>
|
|
9302
|
-
PHASE_STRIKE: () =>
|
|
9303
|
-
PHASE_WINDUP: () =>
|
|
9304
|
-
action: () =>
|
|
9305
|
-
actionIndex: () =>
|
|
9306
|
-
archetype: () =>
|
|
9307
|
-
behaviour: () =>
|
|
9308
|
-
consider: () =>
|
|
9309
|
-
curve: () =>
|
|
9310
|
-
deterministicCos: () =>
|
|
9311
|
-
encodeArchetype: () =>
|
|
9312
|
-
input: () =>
|
|
9300
|
+
PHASE_IDLE: () => chunk3S6WPBZL_js.PHASE_IDLE,
|
|
9301
|
+
PHASE_RECOVER: () => chunk3S6WPBZL_js.PHASE_RECOVER,
|
|
9302
|
+
PHASE_STRIKE: () => chunk3S6WPBZL_js.PHASE_STRIKE,
|
|
9303
|
+
PHASE_WINDUP: () => chunk3S6WPBZL_js.PHASE_WINDUP,
|
|
9304
|
+
action: () => chunk7KFTYENS_js.action2,
|
|
9305
|
+
actionIndex: () => chunk7KFTYENS_js.actionIndex,
|
|
9306
|
+
archetype: () => chunk7KFTYENS_js.archetype,
|
|
9307
|
+
behaviour: () => chunk7KFTYENS_js.behaviour2,
|
|
9308
|
+
consider: () => chunk7KFTYENS_js.consider,
|
|
9309
|
+
curve: () => chunk7KFTYENS_js.curve2,
|
|
9310
|
+
deterministicCos: () => chunk7KFTYENS_js.deterministicCos,
|
|
9311
|
+
encodeArchetype: () => chunk7KFTYENS_js.encodeArchetype,
|
|
9312
|
+
input: () => chunk7KFTYENS_js.input,
|
|
9313
9313
|
keeper: () => keeper,
|
|
9314
|
-
sight: () =>
|
|
9315
|
-
skill: () =>
|
|
9314
|
+
sight: () => chunk7KFTYENS_js.sight,
|
|
9315
|
+
skill: () => chunk7KFTYENS_js.skill
|
|
9316
9316
|
});
|
|
9317
9317
|
|
|
9318
9318
|
// src/game/ai/kits/keeper.ts
|
|
@@ -9332,26 +9332,26 @@ var KEEPER_GAME_SLOTS = {
|
|
|
9332
9332
|
guessBase: 0.32
|
|
9333
9333
|
};
|
|
9334
9334
|
function keeper(tuning = DEFAULT_KEEPER) {
|
|
9335
|
-
return
|
|
9335
|
+
return chunk7KFTYENS_js.archetype("keeper", {
|
|
9336
9336
|
inputs: {
|
|
9337
|
-
power:
|
|
9338
|
-
habit:
|
|
9339
|
-
pending:
|
|
9337
|
+
power: chunk7KFTYENS_js.input.game(KEEPER_GAME_SLOTS.shotPower, 0, 1),
|
|
9338
|
+
habit: chunk7KFTYENS_js.input.game(KEEPER_GAME_SLOTS.habitStrength, 0, 1),
|
|
9339
|
+
pending: chunk7KFTYENS_js.input.game(KEEPER_GAME_SLOTS.shotPending, 0, 1)
|
|
9340
9340
|
},
|
|
9341
9341
|
actions: [
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
behaviour:
|
|
9345
|
-
consider: [
|
|
9342
|
+
chunk7KFTYENS_js.action2("ready", { behaviour: chunk7KFTYENS_js.behaviour2.game(KEEPER_ACTIONS.ready), base: 0.2 }),
|
|
9343
|
+
chunk7KFTYENS_js.action2("read", {
|
|
9344
|
+
behaviour: chunk7KFTYENS_js.behaviour2.game(KEEPER_ACTIONS.read),
|
|
9345
|
+
consider: [chunk7KFTYENS_js.consider("pending", chunk7KFTYENS_js.curve2.step(0.5, 0, 1)), chunk7KFTYENS_js.consider("power", chunk7KFTYENS_js.curve2.linear(-0.5, 1))]
|
|
9346
9346
|
}),
|
|
9347
|
-
|
|
9348
|
-
behaviour:
|
|
9347
|
+
chunk7KFTYENS_js.action2("guess", {
|
|
9348
|
+
behaviour: chunk7KFTYENS_js.behaviour2.game(KEEPER_ACTIONS.guess),
|
|
9349
9349
|
base: tuning.guessBase * 2,
|
|
9350
|
-
consider: [
|
|
9350
|
+
consider: [chunk7KFTYENS_js.consider("pending", chunk7KFTYENS_js.curve2.step(0.5, 0, 1)), chunk7KFTYENS_js.consider("habit", chunk7KFTYENS_js.curve2.logistic(8, 0.5))]
|
|
9351
9351
|
})
|
|
9352
9352
|
],
|
|
9353
9353
|
steering: { maxSpeed: 0, separationWeight: 0, motion: "external" },
|
|
9354
|
-
skill:
|
|
9354
|
+
skill: chunk7KFTYENS_js.skill({
|
|
9355
9355
|
reactionSeconds: [tuning.reactSlowSeconds, tuning.reactFastSeconds],
|
|
9356
9356
|
aimSigma: [tuning.readNoiseAtSkill0, tuning.readNoiseAtSkill1],
|
|
9357
9357
|
tolerance: [0.35, 0.1],
|
|
@@ -10260,7 +10260,7 @@ var DEFAULT_FPS = 60, DEFAULT_CONCURRENCY = 4, DEFAULT_BUDGET = 64 * 1024 * 1024
|
|
|
10260
10260
|
let n = layer.entries;
|
|
10261
10261
|
this.host = new Uint8Array(n), this.hostPriority = new Uint8Array(n), this.arrived = new Uint8Array(n), this.cancelled = new Uint8Array(n), this.engine = new Uint8Array(n), this.latency = new Float64Array(n), this.remaining = new Float64Array(n);
|
|
10262
10262
|
for (let e = 0; e < n; e++) this.index.set(layer.paths[e], e);
|
|
10263
|
-
this.concurrency = Math.max(1, link.concurrency ?? (4)), this.budget = link.budgetBytes ?? DEFAULT_BUDGET, this.prefetchSlots = link.prefetchSlots ??
|
|
10263
|
+
this.concurrency = Math.max(1, link.concurrency ?? (4)), this.budget = link.budgetBytes ?? DEFAULT_BUDGET, this.prefetchSlots = link.prefetchSlots ?? chunk4ZDR72SG_js.prefetchSlots(this.concurrency), this.preemptive = link.preempt ?? true;
|
|
10264
10264
|
}
|
|
10265
10265
|
networkHint() {
|
|
10266
10266
|
return this.hint;
|
|
@@ -10273,7 +10273,7 @@ var DEFAULT_FPS = 60, DEFAULT_CONCURRENCY = 4, DEFAULT_BUDGET = 64 * 1024 * 1024
|
|
|
10273
10273
|
let e = this.index.get(path);
|
|
10274
10274
|
return e === void 0 ? false : this.host[e] !== (0) && this.cancelled[e] === 0 || this.engine[e] === (1);
|
|
10275
10275
|
}
|
|
10276
|
-
prefetch(path, priority =
|
|
10276
|
+
prefetch(path, priority = chunk4ZDR72SG_js.ChunkPriority.prefetch) {
|
|
10277
10277
|
let e = this.index.get(path);
|
|
10278
10278
|
return e === void 0 ? false : (this.arrived[e] === 1 || this.engine[e] !== (0) || (this.cancelled[e] = 0, this.request(e, priority), this.prefetchRequests++), true);
|
|
10279
10279
|
}
|
|
@@ -10290,11 +10290,11 @@ var DEFAULT_FPS = 60, DEFAULT_CONCURRENCY = 4, DEFAULT_BUDGET = 64 * 1024 * 1024
|
|
|
10290
10290
|
if (priority >= this.hostPriority[e]) return;
|
|
10291
10291
|
this.unqueue(e);
|
|
10292
10292
|
}
|
|
10293
|
-
this.host[e] = (1), this.hostPriority[e] = priority, this.queues[priority].push(e), priority <
|
|
10293
|
+
this.host[e] = (1), this.hostPriority[e] = priority, this.queues[priority].push(e), priority < chunk4ZDR72SG_js.ChunkPriority.prefetch && (this.urgentArrived = true);
|
|
10294
10294
|
}
|
|
10295
10295
|
urgentWaiting() {
|
|
10296
|
-
if (this.queues[
|
|
10297
|
-
for (let e of this.flying) if (this.hostPriority[e] <
|
|
10296
|
+
if (this.queues[chunk4ZDR72SG_js.ChunkPriority.now].length > 0 || this.queues[chunk4ZDR72SG_js.ChunkPriority.soon].length > 0) return true;
|
|
10297
|
+
for (let e of this.flying) if (this.hostPriority[e] < chunk4ZDR72SG_js.ChunkPriority.prefetch) return true;
|
|
10298
10298
|
return false;
|
|
10299
10299
|
}
|
|
10300
10300
|
unqueue(e) {
|
|
@@ -10307,13 +10307,13 @@ var DEFAULT_FPS = 60, DEFAULT_CONCURRENCY = 4, DEFAULT_BUDGET = 64 * 1024 * 1024
|
|
|
10307
10307
|
for (let p = 0; p < this.queues.length; p++) {
|
|
10308
10308
|
let queue2 = this.queues[p];
|
|
10309
10309
|
if (queue2.length !== 0) {
|
|
10310
|
-
if (p ===
|
|
10310
|
+
if (p === chunk4ZDR72SG_js.ChunkPriority.prefetch && (this.prefetchFlying() >= this.prefetchSlots || this.urgentWaiting())) return;
|
|
10311
10311
|
e = queue2.shift();
|
|
10312
10312
|
break;
|
|
10313
10313
|
}
|
|
10314
10314
|
}
|
|
10315
10315
|
if (e < 0) return;
|
|
10316
|
-
let bytes = this.layer.entryBytes[e], limit = this.hostPriority[e] ===
|
|
10316
|
+
let bytes = this.layer.entryBytes[e], limit = this.hostPriority[e] === chunk4ZDR72SG_js.ChunkPriority.prefetch ? this.budget * chunk4ZDR72SG_js.PREFETCH_BUDGET_SHARE : this.budget;
|
|
10317
10317
|
if (this.held + bytes > limit) {
|
|
10318
10318
|
this.host[e] = (0);
|
|
10319
10319
|
continue;
|
|
@@ -10323,19 +10323,19 @@ var DEFAULT_FPS = 60, DEFAULT_CONCURRENCY = 4, DEFAULT_BUDGET = 64 * 1024 * 1024
|
|
|
10323
10323
|
}
|
|
10324
10324
|
prefetchFlying() {
|
|
10325
10325
|
let n = 0;
|
|
10326
|
-
for (let e of this.flying) this.hostPriority[e] ===
|
|
10326
|
+
for (let e of this.flying) this.hostPriority[e] === chunk4ZDR72SG_js.ChunkPriority.prefetch && n++;
|
|
10327
10327
|
return n;
|
|
10328
10328
|
}
|
|
10329
10329
|
preempt() {
|
|
10330
10330
|
if (this.urgentArrived && (this.urgentArrived = false, !!this.urgentWaiting()))
|
|
10331
10331
|
for (let i = this.flying.length - 1; i >= 0; i--) {
|
|
10332
10332
|
let e = this.flying[i];
|
|
10333
|
-
if (this.hostPriority[e] ===
|
|
10333
|
+
if (this.hostPriority[e] === chunk4ZDR72SG_js.ChunkPriority.prefetch) {
|
|
10334
10334
|
if (this.flying.splice(i, 1), this.wasted += this.layer.entryBytes[e] - Math.max(0, this.remaining[e]), this.fetched += this.layer.entryBytes[e] - Math.max(0, this.remaining[e]), this.preempted++, this.cancelled[e] === 1) {
|
|
10335
10335
|
this.cancelled[e] = 0, this.host[e] = (0);
|
|
10336
10336
|
continue;
|
|
10337
10337
|
}
|
|
10338
|
-
this.host[e] = (1), this.queues[
|
|
10338
|
+
this.host[e] = (1), this.queues[chunk4ZDR72SG_js.ChunkPriority.prefetch].unshift(e);
|
|
10339
10339
|
}
|
|
10340
10340
|
}
|
|
10341
10341
|
}
|
|
@@ -10375,7 +10375,7 @@ function frameCount(path) {
|
|
|
10375
10375
|
return Array.isArray(path) ? path.length : Math.floor(path.length / 3);
|
|
10376
10376
|
}
|
|
10377
10377
|
function simulateStreaming(simulation) {
|
|
10378
|
-
let engine = simulation.engine, waiting = 0, engineDelivered = 0, flow2 = new Float64Array(
|
|
10378
|
+
let engine = simulation.engine, waiting = 0, engineDelivered = 0, flow2 = new Float64Array(chunkVVE3Y76O_js.FLOW_WORDS), layer = new chunkVVE3Y76O_js.PrefetchLayer({ ...simulation.layer, radius: engine.radius, need: engine.need, busy: () => waiting > 0, flow: flow2 }), host = new SimulatedHost(layer, simulation.link, simulation.network ?? null), predictor = simulation.predictor === false ? null : new chunk5LH2QN3T_js.StreamPredictor(layer, host, simulation.predictor ?? {}), fps = simulation.fps ?? (60), dt = 1 / fps, frames = frameCount(simulation.path), unload = engine.unload ?? engine.radius * UNLOAD_SHARE, inflight = engine.maxInflight ?? (8), eye = new Float64Array(3), gaps = new Float64Array(layer.count), order = [], startup = -1, startupBytes = 0, stalls = 0, firstStall = -1, deliver = (e) => {
|
|
10379
10379
|
if (host.engine[e] === (1)) {
|
|
10380
10380
|
host.engine[e] = (2), engineDelivered += layer.entryBytes[e];
|
|
10381
10381
|
return;
|
|
@@ -10398,7 +10398,7 @@ function simulateStreaming(simulation) {
|
|
|
10398
10398
|
host.arrived[e] = 0, host.engine[e] = (2), host.hits++;
|
|
10399
10399
|
continue;
|
|
10400
10400
|
}
|
|
10401
|
-
waiting >= inflight || (host.engine[e] = (1), waiting++, host.engineRequests++, host.request(e, first ?
|
|
10401
|
+
waiting >= inflight || (host.engine[e] = (1), waiting++, host.engineRequests++, host.request(e, first ? chunk4ZDR72SG_js.ChunkPriority.now : chunk4ZDR72SG_js.ChunkPriority.soon), first = false);
|
|
10402
10402
|
}
|
|
10403
10403
|
let backlog = 0;
|
|
10404
10404
|
for (let item = 0; item < layer.count; item++) {
|
|
@@ -10439,6 +10439,43 @@ function scriptedPath(keys, fps = (60)) {
|
|
|
10439
10439
|
return out;
|
|
10440
10440
|
}
|
|
10441
10441
|
|
|
10442
|
+
// src/game/scenery/twin.ts
|
|
10443
|
+
var CAPTURED = { hue: 0, saturation: 1, gain: 1 };
|
|
10444
|
+
function regionKey(region) {
|
|
10445
|
+
let id = Number(region);
|
|
10446
|
+
return Number.isInteger(id) && region.trim() !== "" ? id : region;
|
|
10447
|
+
}
|
|
10448
|
+
var SplatTwin = class {
|
|
10449
|
+
constructor(options) {
|
|
10450
|
+
this.touched = [];
|
|
10451
|
+
this.current = null;
|
|
10452
|
+
this.body = options.body, this.variants = options.variants, this.looks = options.looks;
|
|
10453
|
+
let first = options.selected ?? options.variants.find((variant) => variant.available)?.variant_id;
|
|
10454
|
+
first !== void 0 && this.select(first);
|
|
10455
|
+
}
|
|
10456
|
+
/** The selected variant, whose id goes to the cart or purchase intent. */
|
|
10457
|
+
get selected() {
|
|
10458
|
+
return this.current;
|
|
10459
|
+
}
|
|
10460
|
+
/** Whether a variant has a look of its own, so a picker can mark the ones the capture cannot show. */
|
|
10461
|
+
shows(variantId) {
|
|
10462
|
+
let variant = this.variants.find((candidate) => candidate.variant_id === variantId);
|
|
10463
|
+
return variant !== void 0 && this.lookOf(variant) !== null;
|
|
10464
|
+
}
|
|
10465
|
+
lookOf(variant) {
|
|
10466
|
+
return this.looks[variant.variant_id] ?? this.looks[variant.name] ?? null;
|
|
10467
|
+
}
|
|
10468
|
+
/** Shows a variant. It does not refuse an unavailable one: a shopper may look at a sold-out colour. */
|
|
10469
|
+
select(variantId) {
|
|
10470
|
+
let variant = this.variants.find((candidate) => candidate.variant_id === variantId);
|
|
10471
|
+
if (variant === void 0) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `this product has no variant ${variantId}`);
|
|
10472
|
+
let look = this.lookOf(variant) ?? {}, regions = Object.keys(look);
|
|
10473
|
+
for (let region of this.touched) region in look || this.body.edit(regionKey(region), CAPTURED);
|
|
10474
|
+
for (let region of regions) this.body.edit(regionKey(region), look[region]);
|
|
10475
|
+
return this.touched = regions, this.current = variant, variant;
|
|
10476
|
+
}
|
|
10477
|
+
};
|
|
10478
|
+
|
|
10442
10479
|
// src/game/scenes/compile.ts
|
|
10443
10480
|
var MM = 1e3, STEPS = 64, DEGREES_PER_STEP = 360 / (64), MAX_COUNT = 1024, MAX_SEED = 4294967295, MAX_CANDIDATES = 64, MAX_ITERATIONS = 256, MAX_TRIES = 32, DEFAULT_WITHIN = 2, DEFAULT_CANDIDATES = 12, DEFAULT_ITERATIONS = 32, DEFAULT_TRIES = 4, DEFAULT_RADIUS = 0.3, DEFAULT_EYE = 1.6, DEFAULT_CELL2 = 0.25, MIN_MITER = 0.2, AREA = "area", COMPASS = { north: 0, east: 16, south: 32, west: 48 }, EDGES = ["north", "south", "east", "west"], SIDES = ["center", "left", "right"], RELATIONS = ["near", "along", "facing", "on", "inside", "reachable_from", "visible_from"], OBJECT_FIELDS = /* @__PURE__ */ new Set(["kind", "count", "at", "yaw", "within", "offset", "clear", "no_overlap", "in_bounds", "spacing", ...RELATIONS]);
|
|
10444
10481
|
function mm(v) {
|
|
@@ -10931,7 +10968,7 @@ var ScatterColumns = class {
|
|
|
10931
10968
|
}
|
|
10932
10969
|
sculpt(op, x, z, radius, strength, target = Number.NaN, layer = 0) {
|
|
10933
10970
|
let b = this.brush;
|
|
10934
|
-
b[0] =
|
|
10971
|
+
b[0] = chunkPKOZXD2Q_js.BRUSH[op], b[1] = layer, b[2] = x, b[3] = z, b[4] = radius, b[5] = strength, b[6] = target;
|
|
10935
10972
|
let touched = this.port.sculpt(this.handle, b);
|
|
10936
10973
|
if (touched < 0) throw new chunk2V7IL4HC_js.GameError("invalid_argument", `the terrain refused the brush (${touched})`);
|
|
10937
10974
|
return touched;
|
|
@@ -10973,16 +11010,16 @@ var ScatterColumns = class {
|
|
|
10973
11010
|
return w[0] = r.area[0], w[1] = r.area[1], w[2] = r.area[2], w[3] = r.area[3], w[4] = r.seed, w[5] = r.kind, w[6] = r.spacing, w[7] = r.chance, w[8] = r.height[0], w[9] = r.height[1], w[10] = r.slope[0], w[11] = r.slope[1], w[12] = r.scale[0], w[13] = r.scale[1], w[14] = r.layer, w[15] = r.layerFloor, out.count = this.port.scatter(w, out.data, out.capacity), out.count;
|
|
10974
11011
|
}
|
|
10975
11012
|
get resident() {
|
|
10976
|
-
return this.registers()[
|
|
11013
|
+
return this.registers()[chunkPKOZXD2Q_js.TERRAIN_REGISTER.resident];
|
|
10977
11014
|
}
|
|
10978
11015
|
get nodes() {
|
|
10979
|
-
return this.registers()[
|
|
11016
|
+
return this.registers()[chunkPKOZXD2Q_js.TERRAIN_REGISTER.nodes];
|
|
10980
11017
|
}
|
|
10981
11018
|
get inflight() {
|
|
10982
|
-
return this.registers()[
|
|
11019
|
+
return this.registers()[chunkPKOZXD2Q_js.TERRAIN_REGISTER.inflight];
|
|
10983
11020
|
}
|
|
10984
11021
|
get totalInstalls() {
|
|
10985
|
-
return this.registers()[
|
|
11022
|
+
return this.registers()[chunkPKOZXD2Q_js.TERRAIN_REGISTER.totalInstalls];
|
|
10986
11023
|
}
|
|
10987
11024
|
dispose() {
|
|
10988
11025
|
this.closed || (this.closed = true, this.port.close(this.handle));
|
|
@@ -10991,23 +11028,23 @@ var ScatterColumns = class {
|
|
|
10991
11028
|
function openTerrain(port, options = {}) {
|
|
10992
11029
|
if (!port) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", "this game has no terrain backend");
|
|
10993
11030
|
let size = options.size ?? (2048), spacing = options.spacing ?? (1), levels = levelsFor(size, spacing), root = (128) * spacing * 2 ** (levels - 1), center = options.center ?? [0, 0], desc = new Float32Array(8);
|
|
10994
|
-
desc[0] = levels, desc[1] = spacing, desc[2] = center[0] - root / 2, desc[3] = center[1] - root / 2, desc[4] = options.heightMin ?? (-64), desc[5] = options.heightRange ?? (512), desc[6] =
|
|
11031
|
+
desc[0] = levels, desc[1] = spacing, desc[2] = center[0] - root / 2, desc[3] = center[1] - root / 2, desc[4] = options.heightMin ?? (-64), desc[5] = options.heightRange ?? (512), desc[6] = chunk7AAIAVAA_js.TIER_INDEX[options.tier ?? "mid"];
|
|
10995
11032
|
let r = { ...DEFAULT_RECIPE, ...options.recipe ?? {} }, recipe = new Float32Array(12);
|
|
10996
11033
|
recipe[0] = r.base, recipe[1] = r.amplitude, recipe[2] = r.octaves, recipe[3] = r.frequency, recipe[4] = r.lacunarity, recipe[5] = r.gain, recipe[6] = r.seed, recipe[7] = r.ridged, recipe[8] = r.warp, recipe[9] = r.rockSlope, recipe[10] = r.snowHeight, recipe[11] = r.sandHeight;
|
|
10997
|
-
let source = options.pack ?
|
|
11034
|
+
let source = options.pack ? chunkPKOZXD2Q_js.TERRAIN_SOURCE.pack : chunkPKOZXD2Q_js.TERRAIN_SOURCE.recipe;
|
|
10998
11035
|
return new Terrain(port, port.open(desc, source, recipe, options.pack ?? null));
|
|
10999
11036
|
}
|
|
11000
11037
|
function openPlanet(port, options) {
|
|
11001
11038
|
if (!port) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", "this game has no terrain backend");
|
|
11002
11039
|
if (!(options.radius > 0)) throw new chunk2V7IL4HC_js.GameError("invalid_argument", "a planet needs a positive radius");
|
|
11003
11040
|
let desc = new Float32Array(8);
|
|
11004
|
-
desc[0] = options.levels ?? 6, desc[6] =
|
|
11041
|
+
desc[0] = options.levels ?? 6, desc[6] = chunk7AAIAVAA_js.TIER_INDEX[options.tier ?? "mid"];
|
|
11005
11042
|
let recipe = new Float32Array(12);
|
|
11006
|
-
return recipe[0] = options.radius, recipe[1] = options.amplitude ?? 60, recipe[6] = options.seed ?? 1, new Terrain(port, port.open(desc,
|
|
11043
|
+
return recipe[0] = options.radius, recipe[1] = options.amplitude ?? 60, recipe[6] = options.seed ?? 1, new Terrain(port, port.open(desc, chunkPKOZXD2Q_js.TERRAIN_SOURCE.planet, recipe, null), options.radius);
|
|
11007
11044
|
}
|
|
11008
11045
|
function noise(port, kind, x, y, z, seed = 0) {
|
|
11009
11046
|
if (!port) throw new chunk2V7IL4HC_js.GameError("unsupported_feature", "this game has no terrain backend");
|
|
11010
|
-
return port.noise(
|
|
11047
|
+
return port.noise(chunkPKOZXD2Q_js.NOISE[kind], x, y, z, seed);
|
|
11011
11048
|
}
|
|
11012
11049
|
|
|
11013
11050
|
exports.AircraftInput = AircraftInput;
|
|
@@ -11082,6 +11119,7 @@ exports.ShapePath = ShapePath;
|
|
|
11082
11119
|
exports.ShapeUtils = ShapeUtils;
|
|
11083
11120
|
exports.Sphere = Sphere;
|
|
11084
11121
|
exports.Spherical = Spherical;
|
|
11122
|
+
exports.SplatTwin = SplatTwin;
|
|
11085
11123
|
exports.SplineCurve = SplineCurve;
|
|
11086
11124
|
exports.TRANSITION_PROGRESS = TRANSITION_PROGRESS;
|
|
11087
11125
|
exports.Terrain = Terrain;
|