@cimplify/sdk 0.108.0 → 0.110.2

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.
Files changed (608) hide show
  1. package/LICENSE +21 -0
  2. package/dist/advanced.d.mts +4 -3
  3. package/dist/advanced.d.ts +4 -3
  4. package/dist/advanced.js +24 -24
  5. package/dist/advanced.mjs +5 -5
  6. package/dist/animation-4EXBXRVX.js +27 -0
  7. package/dist/animation-6DICNWUP.mjs +6 -0
  8. package/dist/audio-DhvyjqdA.d.mts +249 -0
  9. package/dist/audio-m0w8cnxq.d.ts +249 -0
  10. package/dist/avatars.d.mts +110 -0
  11. package/dist/avatars.d.ts +110 -0
  12. package/dist/avatars.js +82 -0
  13. package/dist/avatars.mjs +5 -0
  14. package/dist/backend-gUCzs5Kg.d.mts +3866 -0
  15. package/dist/backend-gUCzs5Kg.d.ts +3866 -0
  16. package/dist/{catalogue-B4eLL8Mi.d.ts → catalogue-CPTMyBUz.d.mts} +109 -221
  17. package/dist/catalogue-DzrTXP3v.d.mts +541 -0
  18. package/dist/catalogue-DzrTXP3v.d.ts +541 -0
  19. package/dist/{catalogue-OT89_Ifs.d.mts → catalogue-OTuS5zp-.d.ts} +109 -221
  20. package/dist/chunk-22BD3RHN.mjs +1809 -0
  21. package/dist/chunk-25T4JHEA.mjs +21 -0
  22. package/dist/chunk-2AQ237Y4.js +508 -0
  23. package/dist/chunk-2IC4H6OV.mjs +48 -0
  24. package/dist/chunk-2LHLG4OB.mjs +71 -0
  25. package/dist/chunk-2O2CG465.js +1709 -0
  26. package/dist/chunk-2Q4DTHXK.js +316 -0
  27. package/dist/chunk-2QTQ6BUH.mjs +46 -0
  28. package/dist/chunk-2UN4SFLR.mjs +100 -0
  29. package/dist/chunk-2V75I7K3.js +454 -0
  30. package/dist/chunk-2V7IL4HC.js +10 -0
  31. package/dist/chunk-34XBXUMW.js +296 -0
  32. package/dist/chunk-3C4C654I.js +71 -0
  33. package/dist/chunk-3DAD2LDF.mjs +72 -0
  34. package/dist/chunk-3GXH2NFD.mjs +4 -0
  35. package/dist/chunk-3O47ZFW3.js +961 -0
  36. package/dist/chunk-3OY3VYNF.mjs +11 -0
  37. package/dist/chunk-3S6WPBZL.js +2936 -0
  38. package/dist/chunk-3TUOUP5T.js +399 -0
  39. package/dist/chunk-3VEH23I5.mjs +1380 -0
  40. package/dist/chunk-3ZYSAW2T.mjs +263 -0
  41. package/dist/chunk-4ANVF274.js +103 -0
  42. package/dist/chunk-4C7I3ELN.js +388 -0
  43. package/dist/chunk-4DYKAYFO.mjs +8 -0
  44. package/dist/chunk-4ZDR72SG.js +329 -0
  45. package/dist/chunk-52YS45RR.js +1066 -0
  46. package/dist/chunk-5325XSCH.js +107 -0
  47. package/dist/chunk-5AD5X6AV.js +13 -0
  48. package/dist/chunk-5BYDGGWO.mjs +197 -0
  49. package/dist/chunk-5C3C7VDM.mjs +55 -0
  50. package/dist/chunk-5HFMY3D7.js +660 -0
  51. package/dist/chunk-5LH2QN3T.js +1862 -0
  52. package/dist/chunk-5PJEXSOW.js +44 -0
  53. package/dist/chunk-5SXDH3Y7.js +90 -0
  54. package/dist/chunk-5YFBGGCK.mjs +502 -0
  55. package/dist/chunk-5YWN6H5Q.mjs +133 -0
  56. package/dist/chunk-66QP3SMN.js +402 -0
  57. package/dist/chunk-6DAEZKIG.mjs +385 -0
  58. package/dist/chunk-6DATW7TB.mjs +420 -0
  59. package/dist/{chunk-JRGK3NXR.mjs → chunk-6ETDAU62.mjs} +72 -212
  60. package/dist/chunk-6H254EVP.mjs +178 -0
  61. package/dist/chunk-6PFNJPBJ.mjs +820 -0
  62. package/dist/chunk-6PJWXIFX.mjs +357 -0
  63. package/dist/chunk-6SWKWCMS.js +80 -0
  64. package/dist/chunk-6VVXXX7S.js +808 -0
  65. package/dist/chunk-6WUBSMTX.js +1403 -0
  66. package/dist/chunk-73SGZLAQ.mjs +35 -0
  67. package/dist/chunk-76L2V6KD.mjs +4 -0
  68. package/dist/chunk-7AAIAVAA.js +1531 -0
  69. package/dist/chunk-7ARSJPV3.mjs +93 -0
  70. package/dist/chunk-7BHW5GTC.mjs +1234 -0
  71. package/dist/chunk-7DQSDKDU.js +6 -0
  72. package/dist/chunk-7IQQQENP.mjs +401 -0
  73. package/dist/chunk-7KFTYENS.js +11357 -0
  74. package/dist/chunk-7SM6XSPZ.js +3171 -0
  75. package/dist/chunk-7SXOHAIR.mjs +28 -0
  76. package/dist/chunk-A2MAX6S4.js +90 -0
  77. package/dist/chunk-A33OORT7.mjs +1530 -0
  78. package/dist/{chunk-U6ACF76H.mjs → chunk-A36JRXXH.mjs} +1075 -1845
  79. package/dist/chunk-A7BU3BK4.js +52 -0
  80. package/dist/chunk-A7MQSN2V.mjs +77 -0
  81. package/dist/chunk-A7V4L2IT.mjs +416 -0
  82. package/dist/chunk-AABEK6XU.js +226 -0
  83. package/dist/chunk-AGV33FWC.mjs +5005 -0
  84. package/dist/chunk-AHNR3BXI.js +108 -0
  85. package/dist/chunk-AQ5RLBU2.mjs +286 -0
  86. package/dist/chunk-AQOE6WCG.js +1270 -0
  87. package/dist/chunk-ATAWRACV.mjs +62 -0
  88. package/dist/chunk-ATCURNUV.js +14 -0
  89. package/dist/chunk-AWPV33OO.js +6 -0
  90. package/dist/chunk-AYJPHKYV.js +337 -0
  91. package/dist/chunk-AZ5BGWHB.js +162 -0
  92. package/dist/chunk-AZAXD44P.js +1373 -0
  93. package/dist/chunk-BBGKQIJJ.mjs +406 -0
  94. package/dist/chunk-BP4JLSUA.js +1453 -0
  95. package/dist/{chunk-SUCE7FWA.mjs → chunk-BTUSVHIE.mjs} +539 -978
  96. package/dist/chunk-BU6OK542.mjs +818 -0
  97. package/dist/chunk-CVSRWM6W.js +418 -0
  98. package/dist/chunk-CYBMFMJD.mjs +247 -0
  99. package/dist/chunk-DDJLDOUX.mjs +217 -0
  100. package/dist/{chunk-V32BCG7M.js → chunk-DFZWHNRG.js} +75 -215
  101. package/dist/chunk-DJ2C7AVG.js +644 -0
  102. package/dist/chunk-DS2VU4WW.mjs +102 -0
  103. package/dist/chunk-DSAG7T5P.js +7290 -0
  104. package/dist/chunk-E2QPPH7I.js +327 -0
  105. package/dist/chunk-E65WCTIG.mjs +1187 -0
  106. package/dist/{chunk-33VCYWVL.mjs → chunk-E6QQKDNE.mjs} +30 -42
  107. package/dist/chunk-ECDK6QBF.mjs +981 -0
  108. package/dist/chunk-EIB4OWVQ.mjs +620 -0
  109. package/dist/chunk-EQUZYCGO.js +250 -0
  110. package/dist/chunk-F3UJ6ZRM.mjs +313 -0
  111. package/dist/chunk-F63N2ZTQ.js +7023 -0
  112. package/dist/chunk-F6XRYEM3.mjs +26 -0
  113. package/dist/chunk-FE6VCE4K.js +5030 -0
  114. package/dist/chunk-FLWD6GRR.js +1372 -0
  115. package/dist/chunk-FQBFWJBS.mjs +110 -0
  116. package/dist/chunk-FXVJ2HFU.js +26 -0
  117. package/dist/chunk-FZMQMQBW.js +312 -0
  118. package/dist/chunk-G3EEC44R.js +53 -0
  119. package/dist/{chunk-KG3WT4PR.mjs → chunk-GCKWKLZF.mjs} +73 -104
  120. package/dist/chunk-GCX7TY4D.mjs +6826 -0
  121. package/dist/chunk-GDB6TCSD.js +450 -0
  122. package/dist/chunk-GDCV4IWO.mjs +21 -0
  123. package/dist/chunk-GDZT5LZ5.js +170 -0
  124. package/dist/chunk-GHPUYD4I.mjs +213 -0
  125. package/dist/chunk-GHS6MIL6.mjs +1432 -0
  126. package/dist/chunk-GPS2THCL.mjs +11 -0
  127. package/dist/{chunk-EV2EVOYS.js → chunk-GTJWQAGU.js} +31 -42
  128. package/dist/chunk-GVTI6UJQ.mjs +130 -0
  129. package/dist/chunk-GXKI64OT.mjs +1138 -0
  130. package/dist/chunk-GYDYF2WX.js +275 -0
  131. package/dist/chunk-GYLP6UG4.mjs +705 -0
  132. package/dist/chunk-H3OQKK6X.js +1158 -0
  133. package/dist/chunk-H5DFSCJ6.js +40 -0
  134. package/dist/chunk-HAGEIC2L.mjs +186 -0
  135. package/dist/chunk-HAJ4JRFO.js +293 -0
  136. package/dist/chunk-HDR72GB6.js +188 -0
  137. package/dist/chunk-HF5HPS4T.mjs +40 -0
  138. package/dist/chunk-HK6LOFDS.js +218 -0
  139. package/dist/chunk-HMWYTXCY.mjs +143 -0
  140. package/dist/chunk-HPCSRCMA.js +89 -0
  141. package/dist/chunk-HSEO6TPU.js +247 -0
  142. package/dist/chunk-I5FOHCLH.js +132 -0
  143. package/dist/chunk-IDLW4NWA.mjs +85 -0
  144. package/dist/chunk-IIDZ5WUX.js +61 -0
  145. package/dist/chunk-IR74FJHU.js +2332 -0
  146. package/dist/chunk-IRVFYAKP.mjs +100 -0
  147. package/dist/{chunk-XBL3TMPC.mjs → chunk-IZDWAL53.mjs} +1795 -3287
  148. package/dist/chunk-J2KZXIU3.js +51 -0
  149. package/dist/chunk-J2U6PJSO.js +91 -0
  150. package/dist/chunk-J5AJNY2N.js +283 -0
  151. package/dist/chunk-J6KQZ4FO.mjs +821 -0
  152. package/dist/{chunk-OWW5GUSB.js → chunk-JGBCIKJV.js} +7 -6
  153. package/dist/chunk-JKGTBMU7.mjs +25 -0
  154. package/dist/chunk-JR3TNEQC.js +422 -0
  155. package/dist/chunk-JURRXY2J.mjs +29 -0
  156. package/dist/chunk-K3HW5I2A.mjs +317 -0
  157. package/dist/chunk-K46SMZ66.mjs +103 -0
  158. package/dist/chunk-K4UDGE3Z.mjs +6 -0
  159. package/dist/chunk-KDQOR4QQ.mjs +350 -0
  160. package/dist/chunk-KDTVOLHI.mjs +288 -0
  161. package/dist/chunk-KGHJH5KJ.mjs +35 -0
  162. package/dist/chunk-KIZOA5LX.mjs +140 -0
  163. package/dist/chunk-KK6HYVBI.mjs +242 -0
  164. package/dist/chunk-KMKWGXMK.js +856 -0
  165. package/dist/chunk-KPA6K5IB.js +80 -0
  166. package/dist/chunk-KU7O4IXU.mjs +260 -0
  167. package/dist/chunk-KVFNRJOR.mjs +11142 -0
  168. package/dist/chunk-KZJRSXHK.js +2432 -0
  169. package/dist/chunk-LHWPRUJL.js +79 -0
  170. package/dist/chunk-LIV3KXJG.mjs +369 -0
  171. package/dist/chunk-LKV4LACG.js +21 -0
  172. package/dist/chunk-LUY45X3U.mjs +263 -0
  173. package/dist/chunk-LYEZZEEF.mjs +17 -0
  174. package/dist/chunk-M5EXQZYY.mjs +1519 -0
  175. package/dist/chunk-ME6HGG4I.mjs +1338 -0
  176. package/dist/chunk-MEXP6DA6.js +31 -0
  177. package/dist/chunk-MG52AW3H.js +902 -0
  178. package/dist/chunk-MIPO6F72.js +334 -0
  179. package/dist/{chunk-5QW7CQBA.js → chunk-MKIJQL5Q.js} +211 -321
  180. package/dist/chunk-MN3YETVN.mjs +17 -0
  181. package/dist/chunk-MOBSBXVE.mjs +2391 -0
  182. package/dist/chunk-MOMOZEUM.mjs +88 -0
  183. package/dist/chunk-MRFUNRAP.js +62 -0
  184. package/dist/chunk-MTIHEW2M.js +433 -0
  185. package/dist/chunk-N4RGGDEL.mjs +73 -0
  186. package/dist/chunk-NH654HAT.js +10 -0
  187. package/dist/chunk-NHJUGZUR.mjs +253 -0
  188. package/dist/chunk-NMQT4HG3.mjs +757 -0
  189. package/dist/chunk-NPSYB6DC.mjs +906 -0
  190. package/dist/chunk-NW2GPMSO.js +857 -0
  191. package/dist/chunk-NXKQOQ6L.js +76 -0
  192. package/dist/chunk-NXLAZIJZ.js +309 -0
  193. package/dist/chunk-NYWNA5CF.js +148 -0
  194. package/dist/chunk-NZTKLY2W.js +1442 -0
  195. package/dist/chunk-O2ICABUD.js +36 -0
  196. package/dist/chunk-OIVVQQ22.js +862 -0
  197. package/dist/chunk-OKC2B4O3.mjs +312 -0
  198. package/dist/chunk-OLWFPDBK.js +2220 -0
  199. package/dist/chunk-OMTVH334.js +3779 -0
  200. package/dist/chunk-OQRVEM56.mjs +362 -0
  201. package/dist/chunk-OXMIBOD4.js +337 -0
  202. package/dist/chunk-PBL6YL5L.mjs +288 -0
  203. package/dist/chunk-PDOELNNQ.js +97 -0
  204. package/dist/chunk-PDQJY2GZ.js +136 -0
  205. package/dist/chunk-PKOZXD2Q.js +1274 -0
  206. package/dist/chunk-PPF2BYFL.mjs +2191 -0
  207. package/dist/chunk-PQTQKNKD.js +539 -0
  208. package/dist/chunk-PRSR4FAV.mjs +81 -0
  209. package/dist/chunk-PTRNO5UD.js +95 -0
  210. package/dist/chunk-Q2Y3VMKH.js +2000 -0
  211. package/dist/chunk-QCZOE65N.js +96 -0
  212. package/dist/chunk-QDYFLATW.mjs +52 -0
  213. package/dist/chunk-QQABGCMM.js +22 -0
  214. package/dist/chunk-QS6TRHMR.js +345 -0
  215. package/dist/chunk-R56P64LB.mjs +208 -0
  216. package/dist/chunk-RCQ2MPBV.js +428 -0
  217. package/dist/chunk-RFVRPYR2.mjs +856 -0
  218. package/dist/chunk-RKBLPGPV.js +11521 -0
  219. package/dist/chunk-RM2V4IND.mjs +327 -0
  220. package/dist/chunk-RQXN5A34.mjs +613 -0
  221. package/dist/chunk-RUVGVNOF.mjs +2687 -0
  222. package/dist/chunk-SAFJIGYB.mjs +165 -0
  223. package/dist/chunk-SKQFLBDD.js +263 -0
  224. package/dist/chunk-SMK6JU2F.mjs +2092 -0
  225. package/dist/{chunk-UVRPC2P7.js → chunk-SNNEOS5Z.js} +1984 -3476
  226. package/dist/chunk-SPCRQ6NO.mjs +1246 -0
  227. package/dist/chunk-SWX4SALA.mjs +19 -0
  228. package/dist/{chunk-JVODCGFP.mjs → chunk-SYEO2WV4.mjs} +128 -238
  229. package/dist/chunk-T2QQMX2N.js +10 -0
  230. package/dist/chunk-T3AFF3L7.mjs +57 -0
  231. package/dist/chunk-T6Z2EXYL.js +712 -0
  232. package/dist/chunk-T7LOXGYX.js +118 -0
  233. package/dist/chunk-TJCAE7RC.mjs +1315 -0
  234. package/dist/chunk-TJI3K6RP.js +137 -0
  235. package/dist/chunk-TL2SVO4P.mjs +55 -0
  236. package/dist/chunk-TM63CYGN.mjs +399 -0
  237. package/dist/chunk-TU5RYTYU.mjs +13 -0
  238. package/dist/chunk-TVJZ4GPS.js +1553 -0
  239. package/dist/chunk-TWM6DLYF.js +371 -0
  240. package/dist/chunk-U63OC4TQ.js +30 -0
  241. package/dist/{chunk-L5GKVQVJ.js → chunk-U6BVSJZ6.js} +25 -57
  242. package/dist/chunk-U6UVWEAK.mjs +792 -0
  243. package/dist/chunk-UCEPNO6N.mjs +11048 -0
  244. package/dist/{chunk-ANT574FD.js → chunk-UCR5HRYM.js} +74 -105
  245. package/dist/chunk-UG5BTOTF.mjs +334 -0
  246. package/dist/chunk-UGH37BQW.mjs +157 -0
  247. package/dist/chunk-V7ZRH3PY.mjs +271 -0
  248. package/dist/chunk-VBGHBL3E.mjs +1394 -0
  249. package/dist/chunk-VRBDAS5I.js +920 -0
  250. package/dist/chunk-VVE3Y76O.js +230 -0
  251. package/dist/chunk-W65JIRI4.mjs +1182 -0
  252. package/dist/chunk-WHYKAT7G.js +62 -0
  253. package/dist/{chunk-YOIVZ6OA.mjs → chunk-WIZRUIZB.mjs} +25 -57
  254. package/dist/chunk-WKWTDZS7.js +385 -0
  255. package/dist/chunk-WLMINRC4.mjs +78 -0
  256. package/dist/chunk-WOF3AD3J.js +22 -0
  257. package/dist/chunk-WWKMOA76.js +1262 -0
  258. package/dist/chunk-X5A5FOWW.js +615 -0
  259. package/dist/chunk-X6CN6KQF.mjs +192 -0
  260. package/dist/chunk-XD2PMH46.mjs +517 -0
  261. package/dist/chunk-XJA2NGTI.mjs +88 -0
  262. package/dist/chunk-XJIHN3BY.mjs +8 -0
  263. package/dist/chunk-XK6UDWJS.js +203 -0
  264. package/dist/chunk-XPG3N5CF.mjs +415 -0
  265. package/dist/chunk-XVZ2NKSU.mjs +74 -0
  266. package/dist/chunk-XYP45OLE.js +117 -0
  267. package/dist/chunk-XZSDGZX6.mjs +301 -0
  268. package/dist/chunk-Y2EMGN4T.mjs +120 -0
  269. package/dist/chunk-Y3XWP5XW.mjs +298 -0
  270. package/dist/chunk-Y4K22JL6.js +228 -0
  271. package/dist/chunk-Y65LXQGA.mjs +3164 -0
  272. package/dist/chunk-Y66WVMO5.mjs +87 -0
  273. package/dist/chunk-Y7JWLB25.mjs +7280 -0
  274. package/dist/chunk-YCDXAJKU.js +175 -0
  275. package/dist/chunk-YRDQCCIS.js +152 -0
  276. package/dist/chunk-YV52DGSA.js +111 -0
  277. package/dist/chunk-YXGZQPUD.js +94 -0
  278. package/dist/chunk-Z3A3AFVU.mjs +102 -0
  279. package/dist/chunk-ZCY6YKKP.mjs +475 -0
  280. package/dist/chunk-ZEQHXVU5.js +215 -0
  281. package/dist/chunk-ZF7JCXCI.js +284 -0
  282. package/dist/chunk-ZJBRUH6V.js +29 -0
  283. package/dist/chunk-ZMIL4ZOA.js +365 -0
  284. package/dist/chunk-ZR5ULMN2.mjs +337 -0
  285. package/dist/chunk-ZXREOYOW.js +87 -0
  286. package/dist/{client-BSP9U1O1.d.mts → client-CX_WR0-J.d.mts} +2 -2
  287. package/dist/client-Dytx_ZTC.d.ts +230 -0
  288. package/dist/{client-B878xeAP.d.ts → client-dqOhP9Nc.d.ts} +2 -2
  289. package/dist/client-hTKbCuhG.d.mts +230 -0
  290. package/dist/clock-B-UAjkKa.d.mts +5 -0
  291. package/dist/clock-B-UAjkKa.d.ts +5 -0
  292. package/dist/config-BlXQluJR.d.mts +36 -0
  293. package/dist/config-BlXQluJR.d.ts +36 -0
  294. package/dist/courier-Cnn-edJ4.d.ts +95 -0
  295. package/dist/courier-FmGfkvIN.d.mts +95 -0
  296. package/dist/crowd-DdHFbqKK.d.ts +186 -0
  297. package/dist/crowd-hOVSAmA3.d.mts +186 -0
  298. package/dist/danfo-BEBapFlX.d.mts +146 -0
  299. package/dist/danfo-UQ_PTIIx.d.ts +146 -0
  300. package/dist/{elements-Bty6Qs_N.d.mts → elements-DdsRig-2.d.mts} +1548 -257
  301. package/dist/{elements-Bty6Qs_N.d.ts → elements-DdsRig-2.d.ts} +1548 -257
  302. package/dist/engines/godot.d.mts +56 -0
  303. package/dist/engines/godot.d.ts +56 -0
  304. package/dist/engines/godot.js +28 -0
  305. package/dist/engines/godot.mjs +3 -0
  306. package/dist/engines/wasm.d.mts +11 -0
  307. package/dist/engines/wasm.d.ts +11 -0
  308. package/dist/engines/wasm.js +178 -0
  309. package/dist/engines/wasm.mjs +176 -0
  310. package/dist/fallback-CrG_lTFk.d.mts +270 -0
  311. package/dist/fallback-CrG_lTFk.d.ts +270 -0
  312. package/dist/fallback-KDB4Y2CE.mjs +6 -0
  313. package/dist/fallback-Y26TQENE.js +19 -0
  314. package/dist/features-CZB4rmcD.d.mts +118 -0
  315. package/dist/features-CZB4rmcD.d.ts +118 -0
  316. package/dist/fit-BWiE7rgA.d.mts +44 -0
  317. package/dist/fit-DK0oT7zO.d.ts +44 -0
  318. package/dist/five-a-side-Bv1AOUy3.d.mts +115 -0
  319. package/dist/five-a-side-EC51SJY1.d.ts +115 -0
  320. package/dist/fluid-ARr0qUIL.d.ts +939 -0
  321. package/dist/fluid-DLlEj2cs.d.mts +939 -0
  322. package/dist/game/conformance.d.mts +84 -0
  323. package/dist/game/conformance.d.ts +84 -0
  324. package/dist/game/conformance.js +1025 -0
  325. package/dist/game/conformance.mjs +994 -0
  326. package/dist/game/heap.d.mts +40 -0
  327. package/dist/game/heap.d.ts +40 -0
  328. package/dist/game/heap.js +48 -0
  329. package/dist/game/heap.mjs +7 -0
  330. package/dist/game/kit/canvas.d.mts +240 -0
  331. package/dist/game/kit/canvas.d.ts +240 -0
  332. package/dist/game/kit/canvas.js +3566 -0
  333. package/dist/game/kit/canvas.mjs +1039 -0
  334. package/dist/game/kit/courier.d.mts +17 -0
  335. package/dist/game/kit/courier.d.ts +17 -0
  336. package/dist/game/kit/courier.js +66 -0
  337. package/dist/game/kit/courier.mjs +49 -0
  338. package/dist/game/kit/danfo.d.mts +11 -0
  339. package/dist/game/kit/danfo.d.ts +11 -0
  340. package/dist/game/kit/danfo.js +109 -0
  341. package/dist/game/kit/danfo.mjs +44 -0
  342. package/dist/game/kit/engine.d.mts +29 -0
  343. package/dist/game/kit/engine.d.ts +29 -0
  344. package/dist/game/kit/engine.js +183 -0
  345. package/dist/game/kit/engine.mjs +30 -0
  346. package/dist/game/kit/five-a-side.d.mts +11 -0
  347. package/dist/game/kit/five-a-side.d.ts +11 -0
  348. package/dist/game/kit/five-a-side.js +86 -0
  349. package/dist/game/kit/five-a-side.mjs +41 -0
  350. package/dist/game/kit/frontier.d.mts +344 -0
  351. package/dist/game/kit/frontier.d.ts +344 -0
  352. package/dist/game/kit/frontier.js +435 -0
  353. package/dist/game/kit/frontier.mjs +14 -0
  354. package/dist/game/kit/genesis.d.mts +752 -0
  355. package/dist/game/kit/genesis.d.ts +752 -0
  356. package/dist/game/kit/genesis.js +380 -0
  357. package/dist/game/kit/genesis.mjs +15 -0
  358. package/dist/game/kit/ludo.d.mts +15 -0
  359. package/dist/game/kit/ludo.d.ts +15 -0
  360. package/dist/game/kit/ludo.js +87 -0
  361. package/dist/game/kit/ludo.mjs +42 -0
  362. package/dist/game/kit/runner.d.mts +12 -0
  363. package/dist/game/kit/runner.d.ts +12 -0
  364. package/dist/game/kit/runner.js +83 -0
  365. package/dist/game/kit/runner.mjs +46 -0
  366. package/dist/game/kit/shootout.d.mts +13 -0
  367. package/dist/game/kit/shootout.d.ts +13 -0
  368. package/dist/game/kit/shootout.js +122 -0
  369. package/dist/game/kit/shootout.mjs +57 -0
  370. package/dist/game/kit/slots.d.mts +392 -0
  371. package/dist/game/kit/slots.d.ts +392 -0
  372. package/dist/game/kit/slots.js +215 -0
  373. package/dist/game/kit/slots.mjs +6 -0
  374. package/dist/game/kit/tycoon.d.mts +16 -0
  375. package/dist/game/kit/tycoon.d.ts +16 -0
  376. package/dist/game/kit/tycoon.js +145 -0
  377. package/dist/game/kit/tycoon.mjs +44 -0
  378. package/dist/game/kit/word.d.mts +11 -0
  379. package/dist/game/kit/word.d.ts +11 -0
  380. package/dist/game/kit/word.js +78 -0
  381. package/dist/game/kit/word.mjs +41 -0
  382. package/dist/game/kit/worlds.d.mts +18 -0
  383. package/dist/game/kit/worlds.d.ts +18 -0
  384. package/dist/game/kit/worlds.js +74 -0
  385. package/dist/game/kit/worlds.mjs +49 -0
  386. package/dist/game/kit.d.mts +53 -0
  387. package/dist/game/kit.d.ts +53 -0
  388. package/dist/game/kit.js +2610 -0
  389. package/dist/game/kit.mjs +101 -0
  390. package/dist/game/prepared.d.mts +14 -0
  391. package/dist/game/prepared.d.ts +14 -0
  392. package/dist/game/prepared.js +81 -0
  393. package/dist/game/prepared.mjs +32 -0
  394. package/dist/game-Bx8onkhX.d.mts +1451 -0
  395. package/dist/game-fgQy2YIm.d.ts +1451 -0
  396. package/dist/game-theme-CBTw1b_d.d.mts +35 -0
  397. package/dist/game-theme-Dg-ict5A.d.ts +35 -0
  398. package/dist/game.d.mts +3546 -0
  399. package/dist/game.d.ts +3546 -0
  400. package/dist/game.js +4455 -0
  401. package/dist/game.mjs +50 -0
  402. package/dist/graphics-C6YjWYvP.d.ts +5 -0
  403. package/dist/graphics-Dk2yQnYN.d.mts +5 -0
  404. package/dist/guest-DrsA00XD.d.mts +732 -0
  405. package/dist/guest-wIdfoT05.d.ts +732 -0
  406. package/dist/hit-stop-BKkVwTq7.d.mts +43 -0
  407. package/dist/hit-stop-D-8pPYnM.d.ts +43 -0
  408. package/dist/hot-Crn9XpHJ.d.ts +29 -0
  409. package/dist/hot-DH3nOhQD.d.mts +29 -0
  410. package/dist/{index-CQStGb3B.d.mts → index-6gkHMGAq.d.mts} +2 -2
  411. package/dist/index-B8ybCKJI.d.ts +41 -0
  412. package/dist/{index-DJwXmoaP.d.ts → index-B98Xac8e.d.ts} +2 -2
  413. package/dist/{index-B7oA_1XI.d.ts → index-B_ByTtIT.d.ts} +2 -2
  414. package/dist/index-DHjNHb1c.d.mts +41 -0
  415. package/dist/{index-DhUSTAhT.d.mts → index-DbAN_VQE.d.mts} +2 -2
  416. package/dist/index.d.mts +134 -24
  417. package/dist/index.d.ts +134 -24
  418. package/dist/index.js +407 -248
  419. package/dist/index.mjs +184 -58
  420. package/dist/interactives-authoring.d.mts +231 -0
  421. package/dist/interactives-authoring.d.ts +231 -0
  422. package/dist/interactives-authoring.js +1743 -0
  423. package/dist/interactives-authoring.mjs +1704 -0
  424. package/dist/interactives-canvas.global.js +148 -0
  425. package/dist/interactives-guest.d.mts +20 -0
  426. package/dist/interactives-guest.d.ts +20 -0
  427. package/dist/interactives-guest.js +63 -0
  428. package/dist/interactives-guest.json +1 -0
  429. package/dist/interactives-guest.mjs +61 -0
  430. package/dist/interactives-jsc.global.js +9357 -0
  431. package/dist/interactives-meters.d.mts +93 -0
  432. package/dist/interactives-meters.d.ts +93 -0
  433. package/dist/interactives-meters.js +252 -0
  434. package/dist/interactives-meters.mjs +68 -0
  435. package/dist/interactives-production.d.mts +430 -0
  436. package/dist/interactives-production.d.ts +430 -0
  437. package/dist/interactives-production.js +1231 -0
  438. package/dist/interactives-production.mjs +1170 -0
  439. package/dist/interactives-record.d.mts +112 -0
  440. package/dist/interactives-record.d.ts +112 -0
  441. package/dist/interactives-record.js +302 -0
  442. package/dist/interactives-record.mjs +295 -0
  443. package/dist/interactives-runtime.d.mts +61 -0
  444. package/dist/interactives-runtime.d.ts +61 -0
  445. package/dist/interactives-runtime.js +442 -0
  446. package/dist/interactives-runtime.mjs +25 -0
  447. package/dist/interactives-studio-kernel.global.js +1 -0
  448. package/dist/interactives-studio.d.mts +806 -0
  449. package/dist/interactives-studio.d.ts +806 -0
  450. package/dist/interactives-studio.js +5741 -0
  451. package/dist/interactives-studio.mjs +5651 -0
  452. package/dist/interactives-tick.d.mts +90 -0
  453. package/dist/interactives-tick.d.ts +90 -0
  454. package/dist/interactives-tick.js +203 -0
  455. package/dist/interactives-tick.mjs +6 -0
  456. package/dist/interactives-web.d.mts +762 -0
  457. package/dist/interactives-web.d.ts +762 -0
  458. package/dist/interactives-web.js +5000 -0
  459. package/dist/interactives-web.mjs +4628 -0
  460. package/dist/interactives.d.mts +2430 -0
  461. package/dist/interactives.d.ts +2430 -0
  462. package/dist/interactives.js +5723 -0
  463. package/dist/interactives.mjs +4333 -0
  464. package/dist/juice-CoHxlpKA.d.ts +42 -0
  465. package/dist/juice-DQztFS43.d.mts +42 -0
  466. package/dist/launch-T2f4_Di4.d.mts +151 -0
  467. package/dist/launch-d6oreMzR.d.ts +151 -0
  468. package/dist/library-DXYaMFhi.d.mts +69 -0
  469. package/dist/library-DXYaMFhi.d.ts +69 -0
  470. package/dist/link-BUTqGmyi.d.mts +38 -0
  471. package/dist/link-BUTqGmyi.d.ts +38 -0
  472. package/dist/lint.js +104 -204
  473. package/dist/lint.mjs +103 -203
  474. package/dist/local-D8_I6UeL.d.mts +6967 -0
  475. package/dist/local-VZkqsCzR.d.ts +6967 -0
  476. package/dist/lockstep-BLf6dglI.d.mts +321 -0
  477. package/dist/lockstep-D50Ia0JW.d.ts +321 -0
  478. package/dist/ludo-B8ClkDqr.d.ts +205 -0
  479. package/dist/ludo-BOuohQ-M.d.mts +205 -0
  480. package/dist/mock/cli.mjs +200 -56
  481. package/dist/mock/library.js +200 -56
  482. package/dist/mock/library.mjs +200 -56
  483. package/dist/mock/msw.js +200 -56
  484. package/dist/mock/msw.mjs +200 -56
  485. package/dist/native-BodxSh03.d.mts +16 -0
  486. package/dist/native-DUHMT8gA.d.ts +16 -0
  487. package/dist/network-ZXLD7l1b.d.mts +19 -0
  488. package/dist/network-ZXLD7l1b.d.ts +19 -0
  489. package/dist/online-XeymeM9s.d.ts +381 -0
  490. package/dist/online-d7W_Al9a.d.mts +381 -0
  491. package/dist/params-DxFb5G_U.d.mts +155 -0
  492. package/dist/params-DxFb5G_U.d.ts +155 -0
  493. package/dist/play-BRRlfLhX.d.ts +940 -0
  494. package/dist/play-ClrMd_e8.d.mts +940 -0
  495. package/dist/policy-CCw8tXLm.d.mts +3078 -0
  496. package/dist/policy-CMqOSQIu.d.ts +3078 -0
  497. package/dist/ports-B_0v_P3A.d.mts +13 -0
  498. package/dist/ports-CGU_3e_0.d.ts +13 -0
  499. package/dist/prefetch-BHnicOQj.d.ts +117 -0
  500. package/dist/prefetch-CBXgYacv.d.mts +117 -0
  501. package/dist/{price-CSztR02F.d.mts → price-BOzexBww.d.mts} +1 -1
  502. package/dist/{price-C_vasx9A.d.ts → price-C1h9sPxE.d.ts} +1 -1
  503. package/dist/protocol-C8qbpUbT.d.mts +242 -0
  504. package/dist/protocol-C8qbpUbT.d.ts +242 -0
  505. package/dist/rapier-AZHT4YI7.js +7886 -0
  506. package/dist/rapier-ODEPCQA6.mjs +7792 -0
  507. package/dist/react.d.mts +157 -15
  508. package/dist/react.d.ts +157 -15
  509. package/dist/react.js +5564 -5904
  510. package/dist/react.mjs +5451 -5808
  511. package/dist/runner-CQcLL7By.d.ts +189 -0
  512. package/dist/runner-D46Yj-wE.d.mts +189 -0
  513. package/dist/runtime-BRWfkf_q.d.mts +51 -0
  514. package/dist/runtime-DyuBMkKM.d.ts +51 -0
  515. package/dist/scheduling-D2ajXpMC.d.ts +224 -0
  516. package/dist/scheduling-DSRbbaZb.d.mts +224 -0
  517. package/dist/schema-BrWxzKp6.d.mts +63 -0
  518. package/dist/schema-BrWxzKp6.d.ts +63 -0
  519. package/dist/server/evict.js +34 -37
  520. package/dist/server/evict.mjs +34 -37
  521. package/dist/server/tanstack.d.mts +49 -3
  522. package/dist/server/tanstack.d.ts +49 -3
  523. package/dist/server/tanstack.js +169 -117
  524. package/dist/server/tanstack.mjs +166 -118
  525. package/dist/{server-Dckg4Vdr.d.ts → server-D29IIuDV.d.ts} +136 -130
  526. package/dist/{server-B6dW7-Lj.d.mts → server-DQMWPnc8.d.mts} +136 -130
  527. package/dist/server.d.mts +45 -5
  528. package/dist/server.d.ts +45 -5
  529. package/dist/server.js +171 -227
  530. package/dist/server.mjs +165 -225
  531. package/dist/session-grant-CJ27DwrT.d.mts +19 -0
  532. package/dist/session-grant-CJ27DwrT.d.ts +19 -0
  533. package/dist/shootout-BJZeX6FG.d.ts +140 -0
  534. package/dist/shootout-tcZd1Rxt.d.mts +140 -0
  535. package/dist/state-replica-stMtdkVD.d.mts +42 -0
  536. package/dist/state-replica-stMtdkVD.d.ts +42 -0
  537. package/dist/studio-CowqWqez.d.mts +14 -0
  538. package/dist/studio-CowqWqez.d.ts +14 -0
  539. package/dist/styles.css +1 -1
  540. package/dist/template-AhCdB1kW.d.mts +190 -0
  541. package/dist/template-BkEGVTQj.d.ts +190 -0
  542. package/dist/terrain-BMxEc6Oc.d.ts +429 -0
  543. package/dist/terrain-C-XC1Oui.d.mts +429 -0
  544. package/dist/testing/msw.d.mts +28 -4
  545. package/dist/testing/msw.d.ts +28 -4
  546. package/dist/testing/msw.js +15 -21
  547. package/dist/testing/msw.mjs +15 -21
  548. package/dist/testing/suite.d.mts +6 -5
  549. package/dist/testing/suite.d.ts +6 -5
  550. package/dist/testing/suite.js +89 -124
  551. package/dist/testing/suite.mjs +81 -116
  552. package/dist/testing.d.mts +27 -1227
  553. package/dist/testing.d.ts +27 -1227
  554. package/dist/testing.js +127 -131
  555. package/dist/testing.mjs +19 -23
  556. package/dist/tick-transport-C8QEh8Uw.d.mts +50 -0
  557. package/dist/tick-transport-UjHY3xK1.d.ts +50 -0
  558. package/dist/timeline-protocol-hp6e8zFB.d.mts +47 -0
  559. package/dist/timeline-protocol-hp6e8zFB.d.ts +47 -0
  560. package/dist/tokens-DhanQRQS.d.mts +21 -0
  561. package/dist/tokens-K8yxwd6G.d.ts +21 -0
  562. package/dist/tree-C-Io2Hbx.d.mts +35 -0
  563. package/dist/tree-CP_qSW4H.d.ts +35 -0
  564. package/dist/tycoon-B5KHk2Xx.d.mts +255 -0
  565. package/dist/tycoon-hmHo-3HX.d.ts +255 -0
  566. package/dist/types-BQkxPwZP.d.mts +219 -0
  567. package/dist/types-D_f6UUxM.d.ts +219 -0
  568. package/dist/ui-DwHicuFv.d.mts +563 -0
  569. package/dist/ui-hi7S2YcH.d.ts +563 -0
  570. package/dist/{sign-in-DQlIdqsi.d.mts → url-52ndUruG.d.mts} +15 -1
  571. package/dist/{sign-in-DQlIdqsi.d.ts → url-52ndUruG.d.ts} +15 -1
  572. package/dist/utils.d.mts +3 -3
  573. package/dist/utils.d.ts +3 -3
  574. package/dist/utils.js +37 -37
  575. package/dist/utils.mjs +4 -4
  576. package/dist/vars-Dc_PrhBK.d.mts +511 -0
  577. package/dist/vars-Dc_PrhBK.d.ts +511 -0
  578. package/dist/vm-IUARFFAI.mjs +63 -0
  579. package/dist/vm-N7L6MGGH.js +65 -0
  580. package/dist/weave-delivery-CW-Kstut.d.mts +360 -0
  581. package/dist/weave-delivery-CW-Kstut.d.ts +360 -0
  582. package/dist/web-Dss74a7v.d.ts +883 -0
  583. package/dist/web-f9ZQPoyw.d.mts +883 -0
  584. package/dist/web-transport-C7MkBL0a.d.ts +19 -0
  585. package/dist/web-transport-aYEqXMd9.d.mts +19 -0
  586. package/dist/weight-CPGjsgjV.d.ts +92 -0
  587. package/dist/weight-tF1ODR1p.d.mts +92 -0
  588. package/dist/word-BcX9Jcmv.d.mts +70 -0
  589. package/dist/word-C7sVPLHm.d.ts +70 -0
  590. package/dist/world-PvILHDR1.d.ts +2285 -0
  591. package/dist/world-qekkXjJv.d.mts +2285 -0
  592. package/dist/worlds-Br2Pb0Cs.d.ts +109 -0
  593. package/dist/worlds-D5ydYr7d.d.mts +109 -0
  594. package/engines/c/cimplify.h +108 -0
  595. package/engines/c/cimplify.lib.js +11 -0
  596. package/engines/godot/addons/cimplify/cimplify.gd +97 -0
  597. package/engines/rust/interactives-ctx/Cargo.toml +9 -0
  598. package/engines/rust/interactives-ctx/src/lib.rs +189 -0
  599. package/package.json +189 -3
  600. package/vendor/rapier3d-compat/LICENSE +201 -0
  601. package/vendor/rapier3d-compat/PATCHES.md +61 -0
  602. package/dist/chunk-2P4KXFB6.js +0 -274
  603. package/dist/chunk-3G6RQLXK.mjs +0 -21
  604. package/dist/chunk-3V4DVXV3.mjs +0 -254
  605. package/dist/chunk-EDK3LNM6.js +0 -2436
  606. package/dist/chunk-F7J3HK27.js +0 -4549
  607. package/dist/chunk-U4MW6PYU.mjs +0 -23
  608. package/dist/chunk-XREIZ56K.js +0 -26
@@ -0,0 +1,1066 @@
1
+ 'use strict';
2
+
3
+ var chunkNYWNA5CF_js = require('./chunk-NYWNA5CF.js');
4
+ var chunk5LH2QN3T_js = require('./chunk-5LH2QN3T.js');
5
+ var chunkYV52DGSA_js = require('./chunk-YV52DGSA.js');
6
+ var chunkG3EEC44R_js = require('./chunk-G3EEC44R.js');
7
+ var chunkRCQ2MPBV_js = require('./chunk-RCQ2MPBV.js');
8
+ var chunkMRFUNRAP_js = require('./chunk-MRFUNRAP.js');
9
+ var chunkYXGZQPUD_js = require('./chunk-YXGZQPUD.js');
10
+ var chunkVRBDAS5I_js = require('./chunk-VRBDAS5I.js');
11
+ var chunk2V7IL4HC_js = require('./chunk-2V7IL4HC.js');
12
+
13
+ // src/game/kit/character/motor.ts
14
+ var CHAR_VX = 0, CHAR_VY = 1, CHAR_VZ = 2, CHAR_HEADING = 3, CHAR_SPEED = 4, CHAR_COYOTE = 5, CHAR_BUFFER = 6, CHAR_CROUCH = 7, CHAR_GROUND_NX = 8, CHAR_GROUND_NY = 9, CHAR_GROUND_NZ = 10, CHAR_PLATFORM_VX = 11, CHAR_PLATFORM_VY = 12, CHAR_PLATFORM_VZ = 13, CHAR_AIR_SECONDS = 14, CHAR_LANDING_SPEED = 15, CHAR_MOVE_X = 16, CHAR_MOVE_Z = 17, CHAR_MOVE_MAGNITUDE = 18, CHAR_SPEED_NORMALIZED = 19, PLATFORM_X = 20, PLATFORM_Y = 21, PLATFORM_Z = 22, PLATFORM_YAW = 23, ROOT_DX = 24, ROOT_DZ = 25, ROOT_YAW = 26, PLATFORM_DX = 27, PLATFORM_DY = 28, PLATFORM_DZ = 29, PLATFORM_DYAW = 30, DT = 31, CACHED_DT = 32, TURN_K = 33, CROUCH_K = 34, SCRATCH = 35, SCRATCH_WORDS = 3, STATE_WORDS = (35) + (3), MOVE_IO_X = 0, MOVE_IO_Z = 1, MOVE_IO_MAGNITUDE = 2, ROOT_IO_DX = 0, ROOT_IO_DZ = 1, ROOT_IO_YAW = 2, DEFAULT_RADIUS = 0.35, DEFAULT_HEIGHT = 1.8, DEFAULT_CROUCH_HEIGHT = 1.15, DEFAULT_WALK_SPEED = 2, DEFAULT_RUN_SPEED = 5.4, DEFAULT_SPRINT_SPEED = 8, DEFAULT_CROUCH_SPEED = 1.9, DEFAULT_GROUND_ACCELERATION = 45, DEFAULT_GROUND_DECELERATION = 60, DEFAULT_AIR_ACCELERATION = 14, DEFAULT_JUMP_HEIGHT = 1.3, DEFAULT_GRAVITY = 24, DEFAULT_FALL_SCALE = 1.55, DEFAULT_CUT_SCALE = 2.8, DEFAULT_MAX_FALL = 42, DEFAULT_COYOTE = 0.11, DEFAULT_BUFFER = 0.13, DEFAULT_MAX_SLOPE = 46, DEFAULT_SLIDE_SLOPE = 50, DEFAULT_STEP_HEIGHT = 0.35, DEFAULT_SNAP = 0.3, DEFAULT_SKIN = 0.02, DEFAULT_TURN_SHARPNESS = 16, DEFAULT_MAX_TURN_SPEED = 14, DEFAULT_CROUCH_SHARPNESS = 14, DEFAULT_GROUND_STICK = 2, PROBE_DEPTH = 0.3, MIN_GROUND_NORMAL_Y = 0.2, TURN_MIN_INPUT = 0.05, SPRINT_MIN_INPUT = 0.5, WALK_INPUT = 0.5, CEILING_BLOCK = 0.5, STAND_CLEARANCE = 0.95, MIN_STEP = 1e-6, HALF = 0.5, NONE = chunkMRFUNRAP_js.NO_ENTITY, PLATFORM_PROBE = 0, PLATFORM_CURRENT = 1, PLATFORM_SLOTS = 2, TUNING_SPRINT = 0, TUNING_MAX_FALL = 1, TUNING_WORDS = 2, CharacterMotor = class {
15
+ constructor(physics, transforms, entity, options = {}) {
16
+ this.state = new Float64Array(STATE_WORDS);
17
+ this.tuning = new Float64Array((2));
18
+ this.grounded = false;
19
+ this.crouched = false;
20
+ this.sprinting = false;
21
+ this.jumping = false;
22
+ this.landed = false;
23
+ this.jumped = false;
24
+ this.landings = 0;
25
+ this.jumps = 0;
26
+ this.useRootMotion = false;
27
+ this.faceMovement = true;
28
+ this.wasGrounded = false;
29
+ this.jumpPressed = false;
30
+ this.jumpHeld = false;
31
+ this.sprintWanted = false;
32
+ this.crouchWanted = false;
33
+ this.platform = new Uint32Array((2)).fill(NONE);
34
+ this.onPlatform = false;
35
+ this.desired = new chunkRCQ2MPBV_js.Vec3();
36
+ this.moved = new chunkG3EEC44R_js.CharacterMove();
37
+ this.ray = new chunkG3EEC44R_js.RayQuery();
38
+ this.hit = new chunkG3EEC44R_js.RayHit();
39
+ this.cast = new chunkRCQ2MPBV_js.ShapeCastQuery();
40
+ this.physics = physics, this.transforms = transforms, this.entity = entity, this.radius = options.radius ?? (0.35), this.height = Math.max(options.height ?? (1.8), this.radius * 2), this.crouchHeight = chunkNYWNA5CF_js.clamp(options.crouchHeight ?? (1.15), this.radius * 2, this.height), this.walkSpeed = options.walkSpeed ?? (2), this.runSpeed = options.runSpeed ?? (5.4), this.sprintSpeed = options.sprintSpeed ?? (8), this.crouchSpeed = options.crouchSpeed ?? (1.9), this.groundAcceleration = options.groundAcceleration ?? (45), this.groundDeceleration = options.groundDeceleration ?? (60), this.airAcceleration = options.airAcceleration ?? (14), this.gravity = options.gravity ?? (24), this.jumpVelocity = Math.sqrt(2 * this.gravity * (options.jumpHeight ?? (1.3))), this.fallScale = options.fallGravityScale ?? (1.55), this.cutScale = options.jumpCutGravityScale ?? (2.8), this.maxFall = options.maxFallSpeed ?? (42), this.tuning[(0)] = this.sprintSpeed, this.tuning[(1)] = this.maxFall, this.coyoteSeconds = options.coyoteSeconds ?? (0.11), this.bufferSeconds = options.jumpBufferSeconds ?? (0.13), this.turnSharpness = options.turnSharpness ?? (16), this.maxTurnSpeed = options.maxTurnSpeed ?? (14), this.crouchSharpness = options.crouchSharpness ?? (14), this.groundStick = options.groundStickSpeed ?? (2), this.headingOffset = options.modelForward === -1 ? Math.PI : 0, this.body = physics.addBody(entity, { kind: "kinematic" });
41
+ let r = this.radius;
42
+ this.standCollider = physics.addCollider(entity, {
43
+ shape: { kind: "capsule", halfHeight: this.height / 2 - r, radius: r },
44
+ offset: [0, this.height / 2, 0]
45
+ }), this.crouchCollider = physics.addCollider(entity, {
46
+ shape: { kind: "capsule", halfHeight: this.crouchHeight / 2 - r, radius: r },
47
+ offset: [0, this.crouchHeight / 2, 0]
48
+ }), physics.setColliderEnabled(this.crouchCollider, false), this.controller = physics.createCharacterController({
49
+ offset: options.skin ?? (0.02),
50
+ maxSlopeClimbDegrees: options.maxSlopeDegrees ?? (46),
51
+ minSlopeSlideDegrees: options.slideSlopeDegrees ?? (50),
52
+ autostepMaxHeight: options.stepHeight ?? (0.35),
53
+ autostepMinWidth: r,
54
+ snapToGround: options.snapDistance ?? (0.3),
55
+ slide: true
56
+ }), this.state[(9)] = 1, this.state[(32)] = Number.NaN, this.cast.ball(r * (0.95)), this.cast.direction.set(0, 1, 0), this.ray.direction.set(0, -1, 0), this.writeRotation();
57
+ }
58
+ get collider() {
59
+ return this.crouched ? this.crouchCollider : this.standCollider;
60
+ }
61
+ get bodyId() {
62
+ return this.body;
63
+ }
64
+ get heading() {
65
+ return this.state[(3)];
66
+ }
67
+ set heading(value) {
68
+ this.state[(3)] = value, chunkNYWNA5CF_js.wrapAt(this.state, (3)), this.writeRotation();
69
+ }
70
+ faceView(view, yawIndex) {
71
+ let s = this.state;
72
+ s[(3)] = view[yawIndex] + Math.PI, chunkNYWNA5CF_js.wrapAt(s, (3)), this.writeRotation();
73
+ }
74
+ setMove(x, z, magnitude) {
75
+ let s = this.state;
76
+ s[(35)] = x, s[(35) + 1] = z, s[(35) + 2] = magnitude, this.setMoveFrom(s, (35));
77
+ }
78
+ setMoveFrom(io, at) {
79
+ let s = this.state, x = io[at + (0)], z = io[at + (1)], magnitude = io[at + (2)], length = (x * x + z * z) ** 0.5;
80
+ if (length < (1e-6) || magnitude <= 0) {
81
+ s[(16)] = 0, s[(17)] = 0, s[(18)] = 0;
82
+ return;
83
+ }
84
+ s[(16)] = x / length, s[(17)] = z / length, s[(18)] = magnitude > 1 ? 1 : magnitude;
85
+ }
86
+ setButtons(jumpPressed, jumpHeld, sprint, crouch) {
87
+ jumpPressed && (this.jumpPressed = true), this.jumpHeld = jumpHeld, this.sprintWanted = sprint, this.crouchWanted = crouch;
88
+ }
89
+ addRootMotionFrom(io, at) {
90
+ let s = this.state;
91
+ s[(24)] += io[at + (0)], s[(25)] += io[at + (1)], s[(26)] += io[at + (2)];
92
+ }
93
+ teleport(x, y, z) {
94
+ let v = this.desired.set(x, y, z);
95
+ this.physics.teleport(this.entity, v);
96
+ let s = this.state;
97
+ s[(0)] = 0, s[(1)] = 0, s[(2)] = 0, this.onPlatform = false, this.grounded = false, this.jumping = false;
98
+ }
99
+ step(clock) {
100
+ let s = this.state, dt = clock[chunkYXGZQPUD_js.FRAME_STEP_SECONDS_SLOT];
101
+ s[(31)] = dt, s[(32)] !== dt && (s[(32)] = dt, s[(33)] = chunkNYWNA5CF_js.dampFactor(this.turnSharpness, dt), s[(34)] = chunkNYWNA5CF_js.dampFactor(this.crouchSharpness, dt)), this.landed = false, this.jumped = false, this.updateCrouch(), this.trackPlatform(), this.grounded ? s[(5)] = this.coyoteSeconds : s[(5)] = s[(5)] > dt ? s[(5)] - dt : 0, this.jumpPressed ? s[(6)] = this.bufferSeconds : s[(6)] = s[(6)] > dt ? s[(6)] - dt : 0, this.jumpPressed = false, this.accelerate(), s[(6)] > 0 && s[(5)] > 0 && !this.crouched && (s[(1)] = this.jumpVelocity + (s[(12)] > 0 ? s[(12)] : 0), s[(0)] += s[(11)], s[(2)] += s[(13)], s[(5)] = 0, s[(6)] = 0, this.jumping = true, this.jumped = true, this.jumps++, this.grounded = false, this.onPlatform = false), this.fall(), this.move(), this.face(), this.probeGround();
102
+ }
103
+ updateCrouch() {
104
+ if (this.crouchWanted && !this.crouched) this.setCrouched(true);
105
+ else if (!this.crouchWanted && this.crouched) {
106
+ let p = this.transforms.row(this.entity) * 3, positions = this.transforms.store.fields.position, cast = this.cast, origin = cast.origin;
107
+ origin.x = positions[p], origin.y = positions[p + 1] + this.crouchHeight - this.radius, origin.z = positions[p + 2], cast.maxDistance = this.height - this.crouchHeight, cast.excludeBody = this.body, this.physics.castShape(cast, this.hit) || this.setCrouched(false);
108
+ }
109
+ let s = this.state, target = this.crouched ? 1 : 0;
110
+ s[(7)] += (target - s[(7)]) * s[(34)];
111
+ }
112
+ setCrouched(crouched) {
113
+ this.crouched = crouched, this.physics.setColliderEnabled(this.crouchCollider, crouched), this.physics.setColliderEnabled(this.standCollider, !crouched);
114
+ }
115
+ trackPlatform() {
116
+ let s = this.state;
117
+ s[(27)] = 0, s[(28)] = 0, s[(29)] = 0, s[(30)] = 0;
118
+ let platform = this.platform[(1)];
119
+ if (!this.onPlatform || !this.grounded) {
120
+ s[(11)] = 0, s[(12)] = 0, s[(13)] = 0;
121
+ return;
122
+ }
123
+ let dt = s[(31)], fields = this.transforms.store.fields, row = this.transforms.row(platform), at = row * 3, px = fields.position[at], py = fields.position[at + 1], pz = fields.position[at + 2];
124
+ chunkNYWNA5CF_js.yawInto(fields.rotation, row * 4, s, (35)), s[(30)] = s[(35)] - s[(23)], chunkNYWNA5CF_js.wrapAt(s, (30));
125
+ let dyaw = s[(30)], me = this.transforms.row(this.entity) * 3, ox = fields.position[me] - s[(20)], oz = fields.position[me + 2] - s[(22)], c = Math.cos(dyaw), n = Math.sin(dyaw), dx = px - s[(20)] + (ox * c + oz * n - ox), dz = pz - s[(22)] + (-ox * n + oz * c - oz), dy = py - s[(21)];
126
+ s[(27)] = dx, s[(28)] = dy, s[(29)] = dz, s[(11)] = dx / dt, s[(12)] = dy / dt, s[(13)] = dz / dt, s[(20)] = px, s[(21)] = py, s[(22)] = pz, s[(23)] = s[(35)];
127
+ }
128
+ accelerate() {
129
+ let s = this.state, dt = s[(31)], magnitude = s[(18)];
130
+ if (this.sprinting = this.sprintWanted && !this.crouched && magnitude >= (0.5), this.useRootMotion && this.grounded) {
131
+ s[(0)] = s[(24)] / dt, s[(2)] = s[(25)] / dt, s[(24)] = 0, s[(25)] = 0;
132
+ return;
133
+ }
134
+ s[(24)] = 0, s[(25)] = 0;
135
+ let speed;
136
+ this.crouched ? speed = this.crouchSpeed * magnitude : this.sprinting ? speed = this.tuning[(0)] : magnitude <= (0.5) ? speed = this.walkSpeed * magnitude / (0.5) : speed = this.walkSpeed + (this.runSpeed - this.walkSpeed) * (magnitude - (0.5)) / (1 - (0.5));
137
+ let tx = s[(16)] * speed, tz = s[(17)] * speed, vx = s[(0)], vz = s[(2)], dvx = tx - vx, dvz = tz - vz, gap = (dvx * dvx + dvz * dvz) ** 0.5;
138
+ if (gap < (1e-6)) return;
139
+ let rate = this.airAcceleration;
140
+ this.grounded && (rate = tx * tx + tz * tz >= vx * vx + vz * vz ? this.groundAcceleration : this.groundDeceleration);
141
+ let reach = rate * dt, k = gap > reach ? reach / gap : 1;
142
+ s[(0)] = vx + dvx * k, s[(2)] = vz + dvz * k;
143
+ }
144
+ fall() {
145
+ let s = this.state;
146
+ if (this.grounded) {
147
+ s[(1)] = 0;
148
+ return;
149
+ }
150
+ let vy = s[(1)], scale = vy > 0 ? this.jumping && !this.jumpHeld ? this.cutScale : 1 : this.fallScale, next = vy - this.gravity * scale * s[(31)], floor = -this.tuning[(1)];
151
+ s[(1)] = next < floor ? floor : next;
152
+ }
153
+ move() {
154
+ let s = this.state, dt = s[(31)], vx = s[(0)], vy = s[(1)], vz = s[(2)], dy = vy * dt + s[(28)];
155
+ this.grounded && s[(9)] > (0.2) && (dy -= (s[(8)] * vx + s[(10)] * vz) / s[(9)] * dt);
156
+ let desired = this.desired;
157
+ desired.x = vx * dt + s[(27)], desired.y = dy, desired.z = vz * dt + s[(29)];
158
+ let out = this.physics.moveCharacter(this.controller, this.crouched ? this.crouchCollider : this.standCollider, desired, this.moved), rising = this.jumping && vy > 0, grounded = out.grounded && !rising;
159
+ vy > 0 && dy > (1e-6) && out.y < dy * (0.5) && (s[(1)] = 0), s[(0)] = (out.x - s[(27)]) / dt, s[(2)] = (out.z - s[(29)]) / dt, s[(4)] = (s[(0)] * s[(0)] + s[(2)] * s[(2)]) ** 0.5, s[(19)] = this.runSpeed > 0 ? s[(4)] / this.runSpeed : 0, this.wasGrounded = this.grounded, this.grounded = grounded, grounded ? (this.wasGrounded || (this.landed = true, this.landings++, s[(15)] = vy < 0 ? -vy : 0), this.jumping = false, s[(14)] = 0) : (this.wasGrounded && !this.jumping && (s[(1)] = -this.groundStick), s[(14)] += dt);
160
+ }
161
+ face() {
162
+ let s = this.state;
163
+ if (s[(3)] += s[(30)], this.useRootMotion && (s[(3)] += s[(26)]), s[(26)] = 0, this.faceMovement && s[(18)] > (0.05)) {
164
+ s[(35)] = s[(16)], s[(35) + 1] = s[(17)], chunkNYWNA5CF_js.atan2Into(s, (35)), s[(35)] -= s[(3)], chunkNYWNA5CF_js.wrapAt(s, (35)), s[(35)] *= s[(33)], s[(35) + 1] = this.maxTurnSpeed * s[(31)], s[(35) + 2] = -s[(35) + 1];
165
+ let pick = s[(35)] > s[(35) + 1] ? 1 : s[(35)] < s[(35) + 2] ? 2 : 0;
166
+ s[(3)] += s[(35) + pick];
167
+ }
168
+ chunkNYWNA5CF_js.wrapAt(s, (3)), this.writeRotation();
169
+ }
170
+ writeRotation() {
171
+ let half = (this.state[(3)] + this.headingOffset) * (0.5), rotation = this.transforms.store.fields.rotation, o = this.transforms.row(this.entity) * 4;
172
+ rotation[o] = 0, rotation[o + 1] = Math.sin(half), rotation[o + 2] = 0, rotation[o + 3] = Math.cos(half);
173
+ }
174
+ probeGround() {
175
+ let s = this.state;
176
+ if (!this.grounded) {
177
+ this.onPlatform = false;
178
+ return;
179
+ }
180
+ let p = this.transforms.row(this.entity) * 3, positions = this.transforms.store.fields.position, ray = this.ray, origin = ray.origin;
181
+ origin.x = positions[p], origin.y = positions[p + 1] + this.radius, origin.z = positions[p + 2], ray.maxDistance = this.radius + (0.3), ray.excludeCollider = this.crouched ? this.crouchCollider : this.standCollider;
182
+ let hit = this.hit;
183
+ if (!this.physics.raycast(ray, hit)) {
184
+ s[(8)] = 0, s[(9)] = 1, s[(10)] = 0, this.onPlatform = false;
185
+ return;
186
+ }
187
+ s[(8)] = hit.normalX, s[(9)] = hit.normalY, s[(10)] = hit.normalZ;
188
+ let slot = this.platform;
189
+ if (slot[(0)] = this.physics.entityOfCollider(hit.collider), slot[(0)] === NONE) {
190
+ this.onPlatform = false;
191
+ return;
192
+ }
193
+ if (this.onPlatform && slot[(0)] === slot[(1)]) return;
194
+ slot[(1)] = slot[(0)], this.onPlatform = true;
195
+ let ground = slot[(1)], fields = this.transforms.store.fields, row = this.transforms.row(ground);
196
+ s[(20)] = fields.position[row * 3], s[(21)] = fields.position[row * 3 + 1], s[(22)] = fields.position[row * 3 + 2], chunkNYWNA5CF_js.yawInto(fields.rotation, row * 4, s, (23));
197
+ }
198
+ };
199
+
200
+ // src/game/kit/camera/follow.ts
201
+ var FOLLOW_CAMERA_X = 0, FOLLOW_CAMERA_Y = 1, FOLLOW_CAMERA_Z = 2, FOLLOW_YAW = 3, FOLLOW_PITCH = 4, FOLLOW_DISTANCE = 5, FOLLOW_PIVOT_X = 6, FOLLOW_PIVOT_Y = 7, FOLLOW_PIVOT_Z = 8, FOLLOW_SHOULDER = 9, FOLLOW_FOV = 10, FOLLOW_CLOSENESS = 11, IDLE = 12, SPRINT = 13, LOOK_X = 14, LOOK_Y = 15, RATE_X = 16, RATE_Y = 17, TARGET = 18, DT2 = 24, SCRATCH2 = 25, lockAngle = new Float64Array(2), BOOM = 26, STATE_WORDS2 = (26) + chunkNYWNA5CF_js.BOOM_IO_WORDS, MOVE_IN_X = 0, MOVE_IN_Y = 1, MOVE_OUT_X = 2, MOVE_OUT_Z = 3, MOVE_IO_WORDS = 4, DEFAULT_LOOK_SENSITIVITY = 62e-4, DEFAULT_GAMEPAD_LOOK_SPEED = 3.4, DEFAULT_DISTANCE = 4.2, DEFAULT_HEIGHT2 = 1.55, DEFAULT_CROUCH_HEIGHT2 = 1.05, DEFAULT_SHOULDER = 0.55, DEFAULT_PITCH = -0.3, DEFAULT_MIN_PITCH = -1.25, DEFAULT_MAX_PITCH = 0.95, DEFAULT_FOLLOW_SHARPNESS = 22, DEFAULT_VERTICAL_SHARPNESS = 8, DEFAULT_SHOULDER_SHARPNESS = 9, DEFAULT_RECOVER_SHARPNESS = 4.5, DEFAULT_RECENTER_DELAY = 1.5, DEFAULT_RECENTER_SHARPNESS = 1.8, MANUAL_RECENTER_SHARPNESS = 10, DEFAULT_FOV = 62, DEFAULT_SPRINT_KICK = 8, DEFAULT_FOV_SHARPNESS = 6, DEFAULT_LOCK_SOFT_ZONE = 0.12, DEFAULT_LOCK_SHARPNESS = 7, DEFAULT_LOCK_MAX_DISTANCE = 30, DEFAULT_LOCK_HEIGHT = 1.2, LOCK_PITCH_SHARE = 0.5, RECENTER_MIN_SPEED = 0.15, RECENTER_DONE = 0.02, CLOSE_DISTANCE = 1.1, MIN_LOCK_DISTANCE = 0.5, FollowCamera = class {
202
+ constructor(physics, transforms, camera, subject, options = {}) {
203
+ this.state = new Float64Array(STATE_WORDS2);
204
+ this.recenterPick = new Float64Array(2);
205
+ this.lockTarget = new Uint32Array(1).fill(chunkMRFUNRAP_js.NO_ENTITY);
206
+ this.locking = false;
207
+ this.recentering = false;
208
+ this.initialised = false;
209
+ this.transforms = transforms, this.camera = camera, this.subject = subject, this.boom = new chunkNYWNA5CF_js.CameraBoom(physics, options), this.distance = options.distance ?? (4.2), this.height = options.height ?? (1.55), this.crouchHeight = options.crouchHeight ?? (1.05), this.shoulder = options.shoulder ?? (0.55), this.shoulderSide = options.shoulderSide ?? 1, this.defaultPitch = options.pitch ?? (-0.3), this.minPitch = options.minPitch ?? (-1.25), this.maxPitch = options.maxPitch ?? (0.95), this.followSharpness = options.followSharpness ?? (22), this.verticalSharpness = options.verticalSharpness ?? (8), this.shoulderSharpness = options.shoulderSharpness ?? (9), this.recoverSharpness = options.recoverSharpness ?? (4.5), this.autoRecenter = options.autoRecenter ?? true, this.recenterDelay = options.recenterDelay ?? (1.5), this.recenterSharpness = options.recenterSharpness ?? (1.8), this.fov = options.fov ?? (62), this.sprintFovKick = options.sprintFovKick ?? (8), this.fovSharpness = options.fovSharpness ?? (6), this.lockSoftZone = options.lockSoftZone ?? (0.12), this.lockSharpness = options.lockSharpness ?? (7), this.lockMaxDistance = options.lockMaxDistance ?? (30), this.lockHeight = options.lockHeight ?? (1.2), this.lookSensitivity = options.lookSensitivity ?? (62e-4), this.gamepadLookSpeed = options.gamepadLookSpeed ?? (3.4), this.invertY = options.invertY ?? false, this.lens = new chunkNYWNA5CF_js.LensDriver(options.lens ?? null);
210
+ let s = this.state;
211
+ s[(3)] = subject.state[(3)] + Math.PI, chunkNYWNA5CF_js.wrapAt(s, (3)), s[(4)] = this.defaultPitch, s[(5)] = this.distance, s[(9)] = this.shoulder * this.shoulderSide, s[(10)] = this.fov;
212
+ }
213
+ get yaw() {
214
+ return this.state[(3)];
215
+ }
216
+ get pitch() {
217
+ return this.state[(4)];
218
+ }
219
+ get hasLock() {
220
+ return this.locking;
221
+ }
222
+ get locked() {
223
+ return this.lockTarget[0];
224
+ }
225
+ look(delta) {
226
+ this.state[(14)] += delta.x, this.state[(15)] += delta.y;
227
+ }
228
+ lookRateFrom(input, x, y) {
229
+ input.valueInto(x, this.state, (16)), input.valueInto(y, this.state, (17));
230
+ }
231
+ swapShoulder() {
232
+ this.shoulderSide = -this.shoulderSide;
233
+ }
234
+ recenter() {
235
+ this.recentering = true;
236
+ }
237
+ lockOn(target) {
238
+ this.lockTarget[0] = target, this.locking = target !== chunkMRFUNRAP_js.NO_ENTITY, this.locking && (this.recentering = false);
239
+ }
240
+ snap() {
241
+ this.initialised = false;
242
+ }
243
+ moveRelative(io, at) {
244
+ let yaw = this.state[(3)], sy = Math.sin(yaw), cy = Math.cos(yaw), x = io[at + (0)], y = io[at + (1)];
245
+ io[at + (2)] = cy * x - sy * y, io[at + (3)] = -sy * x - cy * y;
246
+ }
247
+ update(clock) {
248
+ let s = this.state, subject = this.subject, dt = clock[chunkYXGZQPUD_js.FRAME_SECONDS_SLOT];
249
+ s[(24)] = dt, this.applyLook(), chunkNYWNA5CF_js.interpolatedPosition(this.transforms, subject.entity, clock, s, (18));
250
+ let height = this.height + (this.crouchHeight - this.height) * subject.state[(7)], tx = s[(18)], ty = s[(18) + 1] + height, tz = s[(18) + 2];
251
+ if (!this.initialised)
252
+ s[(6)] = tx, s[(7)] = ty, s[(8)] = tz;
253
+ else {
254
+ let k = 1 - Math.exp(-this.followSharpness * dt);
255
+ s[(6)] += (tx - s[(6)]) * k, s[(8)] += (tz - s[(8)]) * k, s[(7)] += (ty - s[(7)]) * (1 - Math.exp(-this.verticalSharpness * dt));
256
+ }
257
+ this.steerLock() || this.steerRecenter(), s[(9)] += (this.shoulder * this.shoulderSide - s[(9)]) * (1 - Math.exp(-this.shoulderSharpness * dt)), s[(13)] += ((subject.sprinting ? 1 : 0) - s[(13)]) * (1 - Math.exp(-this.fovSharpness * dt)), s[(10)] = this.fov + this.sprintFovKick * s[(13)], this.lens.apply(s, (10)), this.place(), this.initialised = true;
258
+ }
259
+ applyLook() {
260
+ let s = this.state, dt = s[(24)], invert = this.invertY ? -1 : 1, yawDelta = -s[(14)] * this.lookSensitivity - s[(16)] * this.gamepadLookSpeed * dt, pitchDelta = (-s[(15)] * this.lookSensitivity - s[(17)] * this.gamepadLookSpeed * dt) * invert;
261
+ s[(14)] = 0, s[(15)] = 0, yawDelta !== 0 || pitchDelta !== 0 ? (s[(12)] = 0, this.recentering = false) : s[(12)] += dt, s[(3)] += yawDelta, chunkNYWNA5CF_js.wrapAt(s, (3));
262
+ let pitch = s[(4)] + pitchDelta;
263
+ s[(4)] = pitch < this.minPitch ? this.minPitch : pitch > this.maxPitch ? this.maxPitch : pitch;
264
+ }
265
+ steerLock() {
266
+ if (!this.locking) return false;
267
+ let target = this.lockTarget[0], s = this.state, dt = s[(24)], f = this.transforms.store.fields.position, o = this.transforms.row(target) * 3, dx = f[o] - s[(6)], dy = f[o + 1] + this.lockHeight - s[(7)], dz = f[o + 2] - s[(8)], flat = (dx * dx + dz * dz) ** 0.5;
268
+ if (flat < (0.5) || flat > this.lockMaxDistance) return false;
269
+ let angle = lockAngle;
270
+ angle[0] = -dx, angle[1] = -dz, chunkNYWNA5CF_js.atan2Into(angle, 0), s[(25)] = angle[0] - s[(3)], chunkNYWNA5CF_js.wrapAt(s, (25));
271
+ let error = s[(25)], excess = (error < 0 ? -error : error) - this.lockSoftZone;
272
+ excess > 0 && (s[(3)] += (error < 0 ? -excess : excess) * (1 - Math.exp(-this.lockSharpness * dt)), chunkNYWNA5CF_js.wrapAt(s, (3))), angle[0] = dy, angle[1] = flat, chunkNYWNA5CF_js.atan2Into(angle, 0);
273
+ let pitch = angle[0] * (0.5) + this.defaultPitch * (1 - (0.5));
274
+ return pitch = pitch < this.minPitch ? this.minPitch : pitch > this.maxPitch ? this.maxPitch : pitch, s[(4)] += (pitch - s[(4)]) * (1 - Math.exp(-this.lockSharpness * (0.5) * dt)), s[(12)] = 0, true;
275
+ }
276
+ steerRecenter() {
277
+ let s = this.state, subject = this.subject, manual = this.recentering, speedNormalized = subject.state[(19)], moving = speedNormalized > (0.15);
278
+ if (!manual && !(this.autoRecenter && moving && s[(12)] > this.recenterDelay)) return;
279
+ s[(25)] = subject.state[(3)] + Math.PI - s[(3)], chunkNYWNA5CF_js.wrapAt(s, (25));
280
+ let error = s[(25)], pick = this.recenterPick;
281
+ pick[0] = speedNormalized, pick[1] = 1, pick[0] = this.recenterSharpness * pick[speedNormalized < 1 ? 0 : 1], pick[1] = (10);
282
+ let k = 1 - Math.exp(-pick[manual ? 1 : 0] * s[(24)]);
283
+ s[(3)] += error * k, chunkNYWNA5CF_js.wrapAt(s, (3)), manual && (s[(4)] += (this.defaultPitch - s[(4)]) * k, Math.abs(error) < (0.02) && (this.recentering = false));
284
+ }
285
+ place() {
286
+ let s = this.state, yaw = s[(3)], pitch = s[(4)], sy = Math.sin(yaw), cy = Math.cos(yaw), sp = Math.sin(pitch), cp = Math.cos(pitch), fx = -sy * cp, fy = sp, fz = -cy * cp, px = s[(6)], py = s[(7)], pz = s[(8)], exclude = this.subject.bodyId, shoulder = s[(9)], side = shoulder < 0 ? -1 : 1;
287
+ s[(26) + chunkNYWNA5CF_js.BOOM_OX] = px, s[(26) + chunkNYWNA5CF_js.BOOM_OY] = py, s[(26) + chunkNYWNA5CF_js.BOOM_OZ] = pz, s[(26) + chunkNYWNA5CF_js.BOOM_DX] = cy * side, s[(26) + chunkNYWNA5CF_js.BOOM_DY] = 0, s[(26) + chunkNYWNA5CF_js.BOOM_DZ] = -sy * side, s[(26) + chunkNYWNA5CF_js.BOOM_DISTANCE] = shoulder * side, this.boom.cast(s, (26), exclude);
288
+ let lateral = s[(26) + chunkNYWNA5CF_js.BOOM_FREE] * side, ax = px + cy * lateral, az = pz - sy * lateral;
289
+ s[(26) + chunkNYWNA5CF_js.BOOM_OX] = ax, s[(26) + chunkNYWNA5CF_js.BOOM_OZ] = az, s[(26) + chunkNYWNA5CF_js.BOOM_DX] = -fx, s[(26) + chunkNYWNA5CF_js.BOOM_DY] = -fy, s[(26) + chunkNYWNA5CF_js.BOOM_DZ] = -fz, s[(26) + chunkNYWNA5CF_js.BOOM_DISTANCE] = this.distance, this.boom.cast(s, (26), exclude);
290
+ let allowed = s[(26) + chunkNYWNA5CF_js.BOOM_FREE], distance = s[(5)];
291
+ !this.initialised || allowed < distance ? distance = allowed : distance += (allowed - distance) * (1 - Math.exp(-this.recoverSharpness * s[(24)])), distance > allowed && (distance = allowed), s[(5)] = distance, s[(0)] = ax - fx * distance, s[(1)] = py - fy * distance, s[(2)] = az - fz * distance;
292
+ let close = 1 - distance / (1.1);
293
+ s[(11)] = close > 0 ? close : 0, chunkNYWNA5CF_js.placeCamera(this.transforms, this.camera, s, (0));
294
+ }
295
+ };
296
+
297
+ // src/game/kit/character/events.ts
298
+ var DEFAULT_CLIP_EVENT_CAPACITY = 64, ClipEventReader = class {
299
+ constructor(capacity = (64)) {
300
+ this.count = 0;
301
+ this.events = Array.from({ length: capacity }, chunkYV52DGSA_js.emptyClipEvent);
302
+ }
303
+ read(port) {
304
+ return this.count = port.readClipEvents(this.events), this.count;
305
+ }
306
+ };
307
+ function actionListed(actions, action) {
308
+ for (let i = 0; i < actions.length; i++) if (actions[i] === action) return true;
309
+ return false;
310
+ }
311
+
312
+ // src/game/kit/character/contact.ts
313
+ var CONTACT_WEIGHT = 0, CONTACT_PLANTED = 1, CONTACT_LOCKED = 2, CONTACT_LOCK_X = 3, CONTACT_LOCK_Y = 4, CONTACT_LOCK_Z = 5, CONTACT_LOCK_BLEND = 6, CONTACT_TILT_X = 7, CONTACT_TILT_Y = 8, CONTACT_TILT_Z = 9, CONTACT_TILT_WEIGHT = 10, CONTACT_EVENT_PLANTED = 11, CONTACT_WORDS = 12, DEFAULT_CONTACT_WEIGHT_SECONDS = 0.08, DEFAULT_CONTACT_RELEASE_SECONDS = 0.2, DEFAULT_CONTACT_MAX_SLIDE = 0.25, DEFAULT_MAX_FOOT_TILT = Math.PI / 6, DEFAULT_PLANT_THRESHOLD = 0.5, DEFAULT_FOOT_UP = [0, 1, 0], TARGET_Y = 1, TARGET_Z = 2, TARGET_WEIGHT = 3, MIN_HORIZONTAL = 1e-6, ON = 1, OFF = 0, EVENT_KIND = "event", NO_EVENT = -1;
314
+ function createFootTiltChain(port, root, bone, up = DEFAULT_FOOT_UP, maxTilt = DEFAULT_MAX_FOOT_TILT) {
315
+ return port.createIk(root, { solver: "lookAt", bones: [bone], forward: up, maxAngle: maxTilt });
316
+ }
317
+ var FootContact = class {
318
+ constructor(port, options, tuning = {}) {
319
+ this.state = new Float64Array((12));
320
+ this.clip = chunkYV52DGSA_js.emptyClipState();
321
+ this.port = port;
322
+ let curves = options.curves ?? [];
323
+ if (this.footDown = options.footDown ?? (-1), this.footUp = options.footUp ?? (-1), curves.length === 0 && this.footDown === (-1))
324
+ throw new chunk2V7IL4HC_js.GameError("invalid_argument", "a foot contact needs weight curves or a footDown clip event id");
325
+ this.actions = Float64Array.from(options.actions ?? []), this.curveAction = Float64Array.from(curves.map((c) => c.action)), this.curveStart = new Int32Array(curves.length + 1);
326
+ let keys = 0;
327
+ for (let c of curves) {
328
+ if (c.times.length === 0 || c.times.length !== c.weights.length)
329
+ throw new chunk2V7IL4HC_js.GameError("invalid_argument", "foot contact curves need matching time and weight keys");
330
+ keys += c.times.length;
331
+ }
332
+ this.times = new Float64Array(keys), this.weights = new Float64Array(keys);
333
+ let k = 0;
334
+ curves.forEach((c, i) => {
335
+ this.curveStart[i] = k;
336
+ for (let j = 0; j < c.times.length; j++, k++)
337
+ this.times[k] = c.times[j], this.weights[k] = c.weights[j];
338
+ }), this.curveStart[curves.length] = k, this.tilt = options.tilt ?? null, this.lock = tuning.lock ?? true, this.weightSeconds = tuning.weightSeconds ?? (0.08), this.releaseSeconds = tuning.releaseSeconds ?? (0.2), this.maxSlide = tuning.maxSlide ?? (0.25);
339
+ let maxTilt = tuning.maxTilt ?? DEFAULT_MAX_FOOT_TILT;
340
+ this.tiltCos = Math.cos(maxTilt), this.tiltSin = Math.sin(maxTilt), this.threshold = tuning.plantThreshold ?? (0.5);
341
+ }
342
+ get planted() {
343
+ return this.state[(1)] === (1);
344
+ }
345
+ get locked() {
346
+ return this.state[(2)] === (1);
347
+ }
348
+ consume(events, count) {
349
+ if (this.footDown === (-1)) return;
350
+ let s = this.state;
351
+ for (let i = 0; i < count; i++) {
352
+ let e = events[i];
353
+ e.kind === EVENT_KIND && (this.actions.length > 0 && !actionListed(this.actions, e.action) || (e.id === this.footDown ? s[(11)] = (1) : e.id === this.footUp && (s[(11)] = (0))));
354
+ }
355
+ }
356
+ sample(dt) {
357
+ let s = this.state;
358
+ if (this.curveAction.length > 0) {
359
+ let weight = 0;
360
+ for (let c = 0; c < this.curveAction.length; c++)
361
+ this.port.readClipState(this.curveAction[c], this.clip), weight += this.curveAt(c, this.clip.time) * this.clip.weight;
362
+ s[(0)] = weight < 0 ? 0 : weight > 1 ? 1 : weight, s[(1)] = s[(0)] >= this.threshold ? (1) : (0);
363
+ return;
364
+ }
365
+ let target = s[(11)], step = this.weightSeconds > 0 ? dt / this.weightSeconds : 1, w = s[(0)];
366
+ w < target ? s[(0)] = w + step >= target ? target : w + step : w > target && (s[(0)] = w - step <= target ? target : w - step), s[(1)] = target;
367
+ }
368
+ resolve(target, at, hit, nx, ny, nz, dt) {
369
+ let s = this.state;
370
+ this.lock && this.applyLock(target, at, hit, dt);
371
+ let weight = target[at + (3)] * s[(0)];
372
+ if (target[at + (3)] = weight, this.tilt === null) return;
373
+ let x = nx, y = ny, z = nz, horizontal = (x * x + z * z) ** 0.5;
374
+ if (y < this.tiltCos && horizontal > (1e-6)) {
375
+ let scale = this.tiltSin / horizontal;
376
+ x *= scale, z *= scale, y = this.tiltCos;
377
+ }
378
+ s[(7)] = target[at] + x, s[(8)] = target[at + (1)] + y, s[(9)] = target[at + (2)] + z, s[(10)] = hit ? weight : 0, this.port.setIkTargetFrom(this.tilt, s, (7));
379
+ }
380
+ applyLock(target, at, hit, dt) {
381
+ let s = this.state;
382
+ if (s[(1)] === (1) && hit) {
383
+ if (s[(2)] === (0)) this.latch(target, at);
384
+ else {
385
+ let dx = target[at] - s[(3)], dz = target[at + (2)] - s[(5)];
386
+ dx * dx + dz * dz > this.maxSlide * this.maxSlide && this.latch(target, at);
387
+ }
388
+ s[(6)] = 1;
389
+ } else {
390
+ s[(2)] = (0);
391
+ let step = this.releaseSeconds > 0 ? dt / this.releaseSeconds : 1, b2 = s[(6)] - step;
392
+ s[(6)] = b2 > 0 ? b2 : 0;
393
+ }
394
+ let b = s[(6)];
395
+ b <= 0 || (target[at] += (s[(3)] - target[at]) * b, target[at + (1)] += (s[(4)] - target[at + (1)]) * b, target[at + (2)] += (s[(5)] - target[at + (2)]) * b);
396
+ }
397
+ latch(target, at) {
398
+ let s = this.state;
399
+ s[(2)] = (1), s[(3)] = target[at], s[(4)] = target[at + (1)], s[(5)] = target[at + (2)];
400
+ }
401
+ curveAt(curve, time) {
402
+ let start = this.curveStart[curve], last = this.curveStart[curve + 1] - 1, times = this.times, weights = this.weights;
403
+ if (time <= times[start]) return weights[start];
404
+ if (time >= times[last]) return weights[last];
405
+ let lo = start, hi = last;
406
+ for (; hi - lo > 1; ) {
407
+ let mid = lo + hi >> 1;
408
+ times[mid] <= time ? lo = mid : hi = mid;
409
+ }
410
+ let span = times[hi] - times[lo], f = span > 0 ? (time - times[lo]) / span : 0;
411
+ return weights[lo] + (weights[hi] - weights[lo]) * f;
412
+ }
413
+ };
414
+
415
+ // src/game/kit/touch/layouts.ts
416
+ var BOTTOM_RIGHT = [1, 1];
417
+ function corner(dx, dy, size) {
418
+ return { anchor: BOTTOM_RIGHT, offset: [dx, dy], size };
419
+ }
420
+ var LEFT_STICK_RIGHT_BUTTONS = {
421
+ move: { zone: [0, 0.32, 0.5, 1], home: [0.16, 0.74] },
422
+ aim: null,
423
+ look: { zone: [0.5, 0, 1, 1] },
424
+ buttons: [corner(-82, -86, 78), corner(-176, -58, 62), corner(-70, -186, 62), corner(-166, -152, 54), corner(-250, -40, 48)]
425
+ }, TWIN_STICK = {
426
+ move: { zone: [0, 0.3, 0.5, 1], home: [0.16, 0.74] },
427
+ aim: { zone: [0.5, 0.3, 1, 1], home: [0.84, 0.74] },
428
+ look: null,
429
+ buttons: [corner(-70, -248, 58), corner(-146, -232, 50), corner(-212, -200, 46)]
430
+ }, ONE_THUMB = {
431
+ move: { zone: [0, 0.22, 1, 1], home: [0.5, 0.78] },
432
+ aim: null,
433
+ look: null,
434
+ buttons: [corner(-48, -500, 44)]
435
+ }, DRIVING = {
436
+ move: { zone: [0, 0.3, 0.5, 1], home: [0.18, 0.76] },
437
+ aim: null,
438
+ look: { zone: [0.5, 0, 1, 0.5] },
439
+ buttons: [corner(-84, -92, 86), corner(-190, -62, 66), corner(-74, -204, 58), corner(-176, -170, 48)]
440
+ };
441
+ function touchLayout(name) {
442
+ switch (name) {
443
+ case "twinStick":
444
+ return TWIN_STICK;
445
+ case "oneThumb":
446
+ return ONE_THUMB;
447
+ case "driving":
448
+ return DRIVING;
449
+ default:
450
+ return LEFT_STICK_RIGHT_BUTTONS;
451
+ }
452
+ }
453
+
454
+ // src/game/kit/touch/stick.ts
455
+ var STICK_X = 0, STICK_Y = 1, STICK_MAGNITUDE = 2, STICK_OUT_WORDS = 3, STICK_DX = 3, STICK_DY = 4, STICK_RADIUS = 5, STICK_DEAD_ZONE = 6, STICK_CURVE = 7, STICK_IO_WORDS = 8;
456
+ var scratch = new Float64Array(8);
457
+ function stickAxesCode(axes) {
458
+ return axes === "x" ? 1 : axes === "y" ? 2 : 0;
459
+ }
460
+ function shapeStickInto(io, axes) {
461
+ let dx = io[3], dy = io[4];
462
+ axes === 1 ? dy = 0 : axes === 2 && (dx = 0);
463
+ let radius = io[5], deadZone = io[6], length = (dx * dx + dy * dy) ** 0.5, travel = radius > 0 ? length / radius : 0;
464
+ if (travel > 1 && (travel = 1), travel <= deadZone || length === 0) {
465
+ io[0] = 0, io[1] = 0, io[2] = 0;
466
+ return;
467
+ }
468
+ let magnitude = (travel - deadZone) / (1 - deadZone), curve = io[7];
469
+ curve !== 1 && (magnitude = Math.pow(magnitude, curve));
470
+ let scale = magnitude / length;
471
+ io[0] = dx * scale, io[1] = -dy * scale, io[2] = magnitude;
472
+ }
473
+ function shapeStick(dx, dy, radius, deadZone, curve, axes, out, offset) {
474
+ let io = scratch;
475
+ io[3] = dx, io[4] = dy, io[5] = radius, io[6] = deadZone, io[7] = curve, shapeStickInto(io, axes), out[offset + 0] = io[0], out[offset + 1] = io[1], out[offset + 2] = io[2];
476
+ }
477
+ function followOriginInto(origin, at, target, targetAt, radius, radiusAt) {
478
+ let dx = target[targetAt] - origin[at], dy = target[targetAt + 1] - origin[at + 1], length = (dx * dx + dy * dy) ** 0.5, r = radius[radiusAt];
479
+ if (length <= r || length === 0) return;
480
+ let pull = 1 - r / length;
481
+ origin[at] += dx * pull, origin[at + 1] += dy * pull;
482
+ }
483
+ function followOrigin(origin, at, x, y, radius) {
484
+ let io = scratch;
485
+ io[0] = x, io[1] = y, io[2] = radius, followOriginInto(origin, at, io, 0, io, 2);
486
+ }
487
+
488
+ // src/game/kit/touch/touch-controls.ts
489
+ var STICK_MOVE = 0, STICK_AIM = 1, MAX_STICKS = 2, MAX_TOUCH_BUTTONS = 8, KIND_STICK = 0, KIND_LOOK = 1, KIND_BUTTON = 2, KIND_SHIFT = 4, INDEX_MASK = (1 << (4)) - 1, NO_OWNER = -1, NO_POINTER = -1, NO_SLOT = -1, ACCESSIBLE_STEP_SECONDS = 0.4, SEEN_WIDTH = 0, SEEN_HEIGHT = 1, SEEN_TOP = 2, SEEN_RIGHT = 3, SEEN_BOTTOM = 4, SEEN_LEFT = 5, SEEN_WORDS = 6, MOVE_LABEL = "Move", AIM_LABEL = "Aim", SIZED_BASE = 0, SIZED_KNOB = 1, SIZED_BUTTON = 2, MODE_HOLD = 0, MODE_TOGGLE = 1, REFERENCE_SHORT_SIDE = 390, MIN_UI_SCALE = 0.85, MAX_UI_SCALE = 1.4, DEFAULT_VIEWPORT_WIDTH = 844, DEFAULT_VIEWPORT_HEIGHT = 390, DEFAULT_STICK_RADIUS = 58, DEFAULT_DEAD_ZONE = 0.12, DEFAULT_CURVE = 1, DEFAULT_SNAP_SECONDS = 0.12, KNOB_FRACTION = 0.46, BUTTON_SLOP = 14, TAP_MAX_MS = 220, TAP_SLOP_FRACTION = 0.25, DOUBLE_TAP_MS = 280, DEFAULT_LOOK_SENSITIVITY2 = 1, DEFAULT_LOOK_INERTIA = 0.16, FLING_RELEASE_MS = 60, MIN_FLING_SPEED = 30, VELOCITY_BLEND = 0.6, MS_PER_SECOND = 1e3, DEFAULT_IDLE_OPACITY = 0.5, ACTIVE_OPACITY = 1, COOLDOWN_OPACITY = 0.55, VISUAL_EPSILON = 0.25, COOLDOWN_EPSILON = 1 / 256, SNAP_SETTLE = 3, DEFAULT_Z = 50, BORDER = 2, ALPHA_MASK = 4294967040, KNOB_ALPHA = 217, OVERLAY_ALPHA = 179, HALF2 = 0.5, RECT_WORDS = 4, PAIR = 2, ON2 = 1, OFF2 = 0, SAFE_LEFT = 0, SAFE_TOP = 1, SAFE_RIGHT = 2, SAFE_BOTTOM = 3, R_X = 0, R_Y = 1, R_TIME = 2, R_DT = 3, R_SCALE = 4, R_WIDTH = 5, R_HEIGHT = 6, R_LOOK_SENSITIVITY = 7, R_LOOK_INERTIA = 8, R_LOOK_LAST_MS = 9, R_SHOWN_ROOT = 10, R_IDLE_OPACITY = 11, R_SAFE = 12, REGISTER_WORDS = 16, TouchControls = class {
490
+ constructor(input, options = {}) {
491
+ this.reg = new Float64Array((16));
492
+ this.enabledState = true;
493
+ this.attached = false;
494
+ this.pointerId = new Int32Array(10).fill((-1));
495
+ this.pointerOwner = new Int32Array(10).fill((-1));
496
+ this.stickUsed = new Uint8Array((2));
497
+ this.stickSlotX = new Int32Array((2)).fill((-1));
498
+ this.stickSlotY = new Int32Array((2)).fill((-1));
499
+ this.stickSlotTap = new Int32Array((2)).fill((-1));
500
+ this.stickFloating = new Uint8Array((2));
501
+ this.stickFollow = new Uint8Array((2));
502
+ this.stickAxes = new Uint8Array((2));
503
+ this.stickBaseRadius = new Float64Array((2));
504
+ this.stickRadius = new Float64Array((2));
505
+ this.stickDead = new Float64Array((2));
506
+ this.stickCurve = new Float64Array((2));
507
+ this.stickSnap = new Float64Array((2));
508
+ this.stickZoneFraction = new Float64Array((2) * (4));
509
+ this.stickHomeFraction = new Float64Array((2) * (2));
510
+ this.stickZone = new Float64Array((2) * (4));
511
+ this.stickHome = new Float64Array((2) * (2));
512
+ this.stickOrigin = new Float64Array((2) * (2));
513
+ this.stickTouch = new Float64Array((2) * (2));
514
+ this.stickFollowTarget = new Float64Array((2));
515
+ this.stickPointer = new Int32Array((2)).fill((-1));
516
+ this.stickDownMs = new Float64Array((2));
517
+ this.stickMoved = new Uint8Array((2));
518
+ this.stickValue = new Float64Array((2) * 3);
519
+ this.stickKnob = new Float64Array((2) * (2));
520
+ this.stickShownBase = new Float64Array((2) * (2)).fill(Number.NaN);
521
+ this.stickShownKnob = new Float64Array((2) * (2)).fill(Number.NaN);
522
+ this.stickShownOpacity = new Float64Array((2)).fill(Number.NaN);
523
+ this.stickBaseNode = new Int32Array((2)).fill((-1));
524
+ this.stickKnobNode = new Int32Array((2)).fill((-1));
525
+ this.stickIo = new Float64Array(8);
526
+ this.stickAccessibleLeft = new Float64Array((2));
527
+ this.viewportSource = null;
528
+ this.seen = new Float64Array((6)).fill(Number.NaN);
529
+ this.lookUsed = false;
530
+ this.lookZoneFraction = new Float64Array((4));
531
+ this.lookZone = new Float64Array((4));
532
+ this.lookPointer = (-1);
533
+ this.lookLast = new Float64Array((2));
534
+ this.lookVelocity = new Float64Array((2));
535
+ this.lookCoasting = false;
536
+ this.buttonCount = 0;
537
+ this.buttonSlot = new Int32Array((8)).fill((-1));
538
+ this.buttonDoubleSlot = new Int32Array((8)).fill((-1));
539
+ this.buttonMode = new Uint8Array((8));
540
+ this.buttonLookThrough = new Uint8Array((8));
541
+ this.buttonCooldownTotal = new Float64Array((8));
542
+ this.buttonCooldownLeft = new Float64Array((8));
543
+ this.buttonSize = new Float64Array((8));
544
+ this.buttonCenter = new Float64Array((8) * (2));
545
+ this.buttonRadius = new Float64Array((8));
546
+ this.buttonPointer = new Int32Array((8)).fill((-1));
547
+ this.buttonToggled = new Uint8Array((8));
548
+ this.buttonLastUpMs = new Float64Array((8)).fill(-1 / 0);
549
+ this.buttonLast = new Float64Array((8) * (2));
550
+ this.buttonShownPressed = new Int8Array((8)).fill(-1);
551
+ this.buttonShownCooldown = new Float64Array((8)).fill(Number.NaN);
552
+ this.buttonShownCenter = new Float64Array((8) * (2)).fill(Number.NaN);
553
+ this.buttonNode = new Int32Array((8)).fill((-1));
554
+ this.buttonOverlayNode = new Int32Array((8)).fill((-1));
555
+ this.buttonIndex = /* @__PURE__ */ new Map();
556
+ this.placements = [];
557
+ this.pair = new Float32Array((2));
558
+ this.single = new Float32Array(1);
559
+ this.shade = new Float64Array(1);
560
+ this.buttonHighlightNode = new Int32Array((8)).fill((-1));
561
+ this.rootNode = (-1);
562
+ this.elements = [];
563
+ this.sizedElements = [];
564
+ this.sizedKind = [];
565
+ this.sizedIndex = [];
566
+ if (this.input = input, this.ui = options.ui ?? null, this.theme = options.theme ?? chunkVRBDAS5I_js.DEFAULT_THEME, this.layout = typeof options.layout == "object" ? options.layout : touchLayout(options.layout ?? "leftStickRightButtons"), this.autoHide = options.autoHide ?? true, this.reg[(11)] = options.idleOpacity ?? (0.5), this.reg[(10)] = Number.NaN, this.z = options.z ?? (50), this.pressScale = this.theme.press_scale, options.move !== null && this.layout.move !== null && this.addStick((0), options.move ?? {}, this.layout.move), options.aim !== void 0 && options.aim !== null && this.layout.aim !== null && this.addStick((1), options.aim, this.layout.aim), options.look !== null && this.layout.look !== null) {
567
+ let look = options.look ?? {};
568
+ this.lookUsed = true, copyRect(this.layout.look.zone, this.lookZoneFraction), this.reg[(7)] = look.sensitivity ?? (1), this.reg[(8)] = look.inertiaSeconds ?? (0.16);
569
+ }
570
+ let buttons = options.buttons ?? [];
571
+ for (let i = 0; i < buttons.length && i < this.layout.buttons.length && i < (8); i++) this.addButton(buttons[i], this.layout.buttons[i]);
572
+ let viewport = options.viewport;
573
+ this.resolve(viewport?.width ?? (844), viewport?.height ?? (390), viewport?.insets ?? null), this.ui !== null && this.build(this.ui, buttons);
574
+ }
575
+ get enabled() {
576
+ return this.enabledState;
577
+ }
578
+ get visible() {
579
+ return this.reg[(10)] === (1);
580
+ }
581
+ get activeTouches() {
582
+ let n = 0;
583
+ for (let i = 0; i < 10; i++) this.pointerId[i] !== (-1) && n++;
584
+ return n;
585
+ }
586
+ get viewportWidth() {
587
+ return this.reg[(5)];
588
+ }
589
+ get viewportHeight() {
590
+ return this.reg[(6)];
591
+ }
592
+ attach() {
593
+ return this.input.setPointerFilter(this), this.attached = true, this;
594
+ }
595
+ detach() {
596
+ this.attached && (this.input.setPointerFilter(null), this.attached = false, this.releaseAll());
597
+ }
598
+ setEnabled(enabled) {
599
+ enabled !== this.enabledState && (this.enabledState = enabled, enabled || this.releaseAll());
600
+ }
601
+ setViewport(width, height, insets = null) {
602
+ this.resolve(width, height, insets), this.ui !== null && this.resize();
603
+ }
604
+ followViewport(source) {
605
+ this.viewportSource = source, this.seen.fill(Number.NaN), source !== null && this.syncViewport(source);
606
+ }
607
+ syncViewport(source) {
608
+ let seen = this.seen, area = source.safe_area, top = area === void 0 ? 0 : area.top, right = area === void 0 ? 0 : area.right, bottom = area === void 0 ? 0 : area.bottom, left = area === void 0 ? 0 : area.left;
609
+ seen[(0)] === source.width && seen[(1)] === source.height && seen[(2)] === top && seen[(3)] === right && seen[(4)] === bottom && seen[(5)] === left || (seen[(0)] = source.width, seen[(1)] = source.height, seen[(2)] = top, seen[(3)] = right, seen[(4)] = bottom, seen[(5)] = left, this.setViewport(source.width, source.height, area ?? null));
610
+ }
611
+ button(control) {
612
+ let index = this.buttonIndex.get(control);
613
+ return index === void 0 ? -1 : index;
614
+ }
615
+ cooldown(button, seconds) {
616
+ button < 0 || button >= this.buttonCount || (this.buttonCooldownTotal[button] = seconds, this.buttonCooldownLeft[button] = seconds);
617
+ }
618
+ cooldownRemaining(button) {
619
+ return button < 0 || button >= this.buttonCount ? 0 : this.buttonCooldownLeft[button];
620
+ }
621
+ readStick(index, out, offset = 0) {
622
+ let o = index * 3;
623
+ out[offset + 0] = this.stickValue[o + 0], out[offset + 1] = this.stickValue[o + 1], out[offset + 2] = this.stickValue[o + 2];
624
+ }
625
+ readStickOrigin(index, out, offset = 0) {
626
+ out[offset] = this.stickOrigin[index * (2)], out[offset + 1] = this.stickOrigin[index * (2) + 1];
627
+ }
628
+ readButtonCenter(index, out, offset = 0) {
629
+ out[offset] = this.buttonCenter[index * (2)], out[offset + 1] = this.buttonCenter[index * (2) + 1];
630
+ }
631
+ buttonNodeId(index) {
632
+ return index < 0 || index >= this.buttonCount ? (-1) : this.buttonNode[index];
633
+ }
634
+ stickNodeId(index) {
635
+ return index < 0 || index >= (2) ? (-1) : this.stickBaseNode[index];
636
+ }
637
+ readStickZone(index, out, offset = 0) {
638
+ for (let k = 0; k < (4); k++) out[offset + k] = this.stickZone[index * (4) + k];
639
+ }
640
+ filterPointer(phase, id, stage) {
641
+ let r = this.reg, px = stage[chunk5LH2QN3T_js.STAGE_X] * r[(5)], py = stage[chunk5LH2QN3T_js.STAGE_Y] * r[(6)], time = stage[chunk5LH2QN3T_js.STAGE_TIME];
642
+ r[(0)] = px, r[(1)] = py, r[(2)] = time;
643
+ let input = this.input, inputStage = input.stage;
644
+ if (phase === "down") {
645
+ if (!this.enabledState) return false;
646
+ let owner2 = (-1), bestDistance = 1 / 0, slop = (14) * r[(4)];
647
+ for (let b = 0; b < this.buttonCount; b++) {
648
+ if (this.buttonPointer[b] !== (-1)) continue;
649
+ let dx = px - this.buttonCenter[b * (2)], dy = py - this.buttonCenter[b * (2) + 1], reach = this.buttonRadius[b] + slop, d = dx * dx + dy * dy;
650
+ d <= reach * reach && d < bestDistance && (bestDistance = d, owner2 = (2) << (4) | b);
651
+ }
652
+ if (owner2 === (-1)) {
653
+ let zone = this.stickZone;
654
+ for (let s = 0; s < (2); s++) {
655
+ if (this.stickUsed[s] === (0) || this.stickPointer[s] !== (-1)) continue;
656
+ let z = s * (4);
657
+ if (px >= zone[z] && px <= zone[z + 2] && py >= zone[z + 1] && py <= zone[z + 3]) {
658
+ owner2 = (0) << (4) | s;
659
+ break;
660
+ }
661
+ }
662
+ }
663
+ if (owner2 === (-1) && this.lookUsed && this.lookPointer === (-1)) {
664
+ let zone = this.lookZone;
665
+ px >= zone[0] && px <= zone[2] && py >= zone[1] && py <= zone[3] && (owner2 = (1) << (4));
666
+ }
667
+ if (owner2 === (-1)) return false;
668
+ let slot2 = -1;
669
+ for (let i = 0; i < 10; i++)
670
+ if (this.pointerId[i] === (-1)) {
671
+ slot2 = i;
672
+ break;
673
+ }
674
+ if (slot2 < 0) return false;
675
+ this.pointerId[slot2] = id, this.pointerOwner[slot2] = owner2;
676
+ let index2 = owner2 & INDEX_MASK, kind2 = owner2 >> (4);
677
+ if (kind2 === (0)) {
678
+ let o = index2 * (2);
679
+ if (this.stickPointer[index2] = id, this.stickDownMs[index2] = time, this.stickMoved[index2] = (0), this.stickFloating[index2] === (1)) {
680
+ let radius = this.stickRadius[index2], lx = r[(12) + (0)] + radius, hx = r[(12) + (2)] - radius, ly = r[(12) + (1)] + radius, hy = r[(12) + (3)] - radius;
681
+ this.stickOrigin[o] = lx > hx ? (lx + hx) * (0.5) : px < lx ? lx : px > hx ? hx : px, this.stickOrigin[o + 1] = ly > hy ? (ly + hy) * (0.5) : py < ly ? ly : py > hy ? hy : py;
682
+ } else
683
+ this.stickOrigin[o] = this.stickHome[o], this.stickOrigin[o + 1] = this.stickHome[o + 1];
684
+ this.stickTouch[o] = px, this.stickTouch[o + 1] = py, this.emitStick(index2);
685
+ } else if (kind2 === (1))
686
+ this.lookPointer = id, this.lookCoasting = false, this.lookLast[0] = px, this.lookLast[1] = py, r[(9)] = time, this.lookVelocity[0] = 0, this.lookVelocity[1] = 0;
687
+ else {
688
+ this.buttonPointer[index2] = id, this.buttonLast[index2 * (2)] = px, this.buttonLast[index2 * (2) + 1] = py;
689
+ let doubleSlot = this.buttonDoubleSlot[index2];
690
+ if (doubleSlot !== (-1) && time - this.buttonLastUpMs[index2] <= (280) && (inputStage[chunk5LH2QN3T_js.STAGE_X] = 1, inputStage[chunk5LH2QN3T_js.STAGE_TIME] = time, input.virtualStaged(doubleSlot), inputStage[chunk5LH2QN3T_js.STAGE_TIME] = time, input.virtualStaged(doubleSlot), this.buttonLastUpMs[index2] = -1 / 0), this.buttonCooldownLeft[index2] <= 0) {
691
+ let on = 1;
692
+ this.buttonMode[index2] === (1) && (on = this.buttonToggled[index2] === (1) ? (0) : (1), this.buttonToggled[index2] = on), inputStage[chunk5LH2QN3T_js.STAGE_X] = on, inputStage[chunk5LH2QN3T_js.STAGE_TIME] = time, input.virtualStaged(this.buttonSlot[index2]), this.buttonCooldownTotal[index2] > 0 && (this.buttonCooldownLeft[index2] = this.buttonCooldownTotal[index2]);
693
+ }
694
+ }
695
+ return true;
696
+ }
697
+ let slot = -1;
698
+ for (let i = 0; i < 10; i++)
699
+ if (this.pointerId[i] === id) {
700
+ slot = i;
701
+ break;
702
+ }
703
+ if (slot < 0) return false;
704
+ let owner = this.pointerOwner[slot], index = owner & INDEX_MASK, kind = owner >> (4);
705
+ if (kind === (0)) this.stickMove(index);
706
+ else if (kind === (1)) {
707
+ let sensitivity = r[(7)], dx = (px - this.lookLast[0]) * sensitivity, dy = (py - this.lookLast[1]) * sensitivity;
708
+ this.lookLast[0] = px, this.lookLast[1] = py, (dx !== 0 || dy !== 0) && (inputStage[chunk5LH2QN3T_js.STAGE_X] = dx, inputStage[chunk5LH2QN3T_js.STAGE_Y] = dy, inputStage[chunk5LH2QN3T_js.STAGE_TIME] = time, input.lookStaged());
709
+ let elapsed = time - r[(9)];
710
+ if (elapsed > 0) {
711
+ let v = this.lookVelocity;
712
+ v[0] += (dx * (1e3) / elapsed - v[0]) * (0.6), v[1] += (dy * (1e3) / elapsed - v[1]) * (0.6), r[(9)] = time;
713
+ }
714
+ } else if (this.buttonLookThrough[index] === (1)) {
715
+ let o = index * (2), sensitivity = r[(7)] > 0 ? r[(7)] : (1), dx = (px - this.buttonLast[o]) * sensitivity, dy = (py - this.buttonLast[o + 1]) * sensitivity;
716
+ this.buttonLast[o] = px, this.buttonLast[o + 1] = py, (dx !== 0 || dy !== 0) && (inputStage[chunk5LH2QN3T_js.STAGE_X] = dx, inputStage[chunk5LH2QN3T_js.STAGE_Y] = dy, inputStage[chunk5LH2QN3T_js.STAGE_TIME] = time, input.lookStaged());
717
+ }
718
+ if (phase === "move") return true;
719
+ if (this.pointerId[slot] = (-1), this.pointerOwner[slot] = (-1), kind === (0)) {
720
+ this.stickPointer[index] = (-1);
721
+ let tap = this.stickSlotTap[index];
722
+ tap !== (-1) && this.stickMoved[index] === (0) && time - this.stickDownMs[index] <= (220) && (inputStage[chunk5LH2QN3T_js.STAGE_X] = 1, inputStage[chunk5LH2QN3T_js.STAGE_TIME] = time, input.virtualStaged(tap), inputStage[chunk5LH2QN3T_js.STAGE_TIME] = time, input.virtualStaged(tap));
723
+ let io = this.stickIo;
724
+ io[0] = 0, io[1] = 0, io[2] = 0, this.publishStick(index);
725
+ } else if (kind === (1)) {
726
+ this.lookPointer = (-1);
727
+ let v = this.lookVelocity, fresh = time - r[(9)] <= (60);
728
+ this.lookCoasting = r[(8)] > 0 && fresh && v[0] * v[0] + v[1] * v[1] > (30) * (30), this.lookCoasting || (v[0] = 0, v[1] = 0);
729
+ } else
730
+ this.buttonPointer[index] = (-1), this.buttonLastUpMs[index] = time, this.buttonMode[index] === (0) && (inputStage[chunk5LH2QN3T_js.STAGE_X] = 0, inputStage[chunk5LH2QN3T_js.STAGE_TIME] = time, input.virtualStaged(this.buttonSlot[index]));
731
+ return true;
732
+ }
733
+ accessibleActivate(button, timeMs) {
734
+ if (button < 0 || button >= this.buttonCount || !this.enabledState || this.buttonCooldownLeft[button] > 0) return;
735
+ let input = this.input, stage = input.stage, slot = this.buttonSlot[button];
736
+ this.buttonMode[button] === (1) ? (this.buttonToggled[button] = this.buttonToggled[button] === (1) ? (0) : (1), stage[chunk5LH2QN3T_js.STAGE_X] = this.buttonToggled[button], stage[chunk5LH2QN3T_js.STAGE_TIME] = timeMs, input.virtualStaged(slot)) : (stage[chunk5LH2QN3T_js.STAGE_X] = 1, stage[chunk5LH2QN3T_js.STAGE_TIME] = timeMs, input.virtualStaged(slot), stage[chunk5LH2QN3T_js.STAGE_TIME] = timeMs, input.virtualStaged(slot)), this.buttonCooldownTotal[button] > 0 && (this.buttonCooldownLeft[button] = this.buttonCooldownTotal[button]);
737
+ }
738
+ accessibleStep(stick, action, timeMs) {
739
+ if (stick < 0 || stick >= (2) || this.stickUsed[stick] === (0) || !this.enabledState || this.stickPointer[stick] !== (-1)) return;
740
+ let direction = action === chunkVRBDAS5I_js.UiAction.increment ? 1 : action === chunkVRBDAS5I_js.UiAction.decrement ? -1 : 0;
741
+ if (direction === 0) return;
742
+ let io = this.stickIo, horizontal = this.stickAxes[stick] === 1;
743
+ io[0] = horizontal ? direction : 0, io[1] = horizontal ? 0 : direction, io[2] = 1, this.reg[(2)] = timeMs, this.publishStick(stick), this.stickAccessibleLeft[stick] = (0.4);
744
+ }
745
+ update(clock) {
746
+ let r = this.reg, dt = clock[chunkYXGZQPUD_js.FRAME_SECONDS_SLOT];
747
+ r[(3)] = dt, this.viewportSource !== null && this.syncViewport(this.viewportSource);
748
+ for (let s = 0; s < (2); s++) {
749
+ let left = this.stickAccessibleLeft[s];
750
+ if (left <= 0 || (this.stickAccessibleLeft[s] = left - dt, left - dt > 0 || this.stickPointer[s] !== (-1))) continue;
751
+ let io = this.stickIo;
752
+ io[0] = 0, io[1] = 0, io[2] = 0, this.publishStick(s);
753
+ }
754
+ for (let b = 0; b < this.buttonCount; b++) {
755
+ let left = this.buttonCooldownLeft[b];
756
+ left > 0 && (this.buttonCooldownLeft[b] = left - dt > 0 ? left - dt : 0);
757
+ }
758
+ if (this.lookCoasting) {
759
+ let v = this.lookVelocity, stage = this.input.stage;
760
+ stage[chunk5LH2QN3T_js.STAGE_X] = v[0] * dt, stage[chunk5LH2QN3T_js.STAGE_Y] = v[1] * dt, stage[chunk5LH2QN3T_js.STAGE_TIME] = r[(9)], this.input.lookStaged();
761
+ let decay = Math.exp(-dt / r[(8)]);
762
+ v[0] *= decay, v[1] *= decay, v[0] * v[0] + v[1] * v[1] < (30) * (30) && (v[0] = 0, v[1] = 0, this.lookCoasting = false);
763
+ }
764
+ let ui = this.ui;
765
+ if (ui === null) return;
766
+ let writer = ui.writer, records = writer.records;
767
+ this.drawVisibility(writer);
768
+ for (let s = 0; s < (2); s++) this.stickUsed[s] === (1) && this.drawStick(writer, s);
769
+ for (let b = 0; b < this.buttonCount; b++) this.drawButton(writer, b);
770
+ writer.records !== records && ui.touched();
771
+ }
772
+ dispose() {
773
+ this.detach();
774
+ for (let i = 0; i < this.elements.length; i++) this.elements[i].destroy();
775
+ this.elements.length = 0;
776
+ }
777
+ addStick(index, spec, placement) {
778
+ let input = this.input;
779
+ this.stickUsed[index] = (1);
780
+ let prefix = index === (0) ? "touch.move" : "touch.aim";
781
+ this.stickSlotX[index] = input.virtualControl(spec.x ?? `${prefix}.x`), this.stickSlotY[index] = input.virtualControl(spec.y ?? `${prefix}.y`), spec.tap !== void 0 && (this.stickSlotTap[index] = input.virtualControl(spec.tap));
782
+ let floating = (spec.mode ?? "floating") === "floating";
783
+ this.stickFloating[index] = floating ? (1) : (0), this.stickFollow[index] = spec.follow ?? floating ? (1) : (0), this.stickAxes[index] = stickAxesCode(spec.axes ?? "both"), this.stickBaseRadius[index] = spec.radius ?? (58), this.stickDead[index] = spec.deadZone ?? (0.12), this.stickCurve[index] = spec.curve ?? (1), this.stickSnap[index] = spec.snapSeconds ?? (0.12), copyRect(placement.zone, this.stickZoneFraction, index * (4)), this.stickHomeFraction[index * (2)] = placement.home[0], this.stickHomeFraction[index * (2) + 1] = placement.home[1];
784
+ }
785
+ addButton(spec, placement) {
786
+ let b = this.buttonCount++, input = this.input;
787
+ this.buttonSlot[b] = input.virtualControl(spec.control), spec.doubleTap !== void 0 && (this.buttonDoubleSlot[b] = input.virtualControl(spec.doubleTap)), this.buttonMode[b] = spec.mode === "toggle" ? (1) : (0), this.buttonLookThrough[b] = spec.lookThrough ? (1) : (0), this.buttonCooldownTotal[b] = spec.cooldownSeconds ?? 0, this.buttonSize[b] = spec.size ?? placement.size, this.buttonIndex.set(spec.control, b), this.placements.push(placement);
788
+ }
789
+ resolve(width, height, insets) {
790
+ let r = this.reg;
791
+ r[(5)] = width > 0 ? width : (844), r[(6)] = height > 0 ? height : (390), r[(12) + (0)] = insets?.left ?? 0, r[(12) + (1)] = insets?.top ?? 0, r[(12) + (2)] = r[(5)] - (insets?.right ?? 0), r[(12) + (3)] = r[(6)] - (insets?.bottom ?? 0);
792
+ let shortSide = Math.min(r[(5)], r[(6)]);
793
+ r[(4)] = Math.min((1.4), Math.max((0.85), shortSide / (390)));
794
+ let scale = r[(4)], sx = r[(12) + (0)], sy = r[(12) + (1)], sw = r[(12) + (2)] - sx, sh = r[(12) + (3)] - sy;
795
+ for (let s = 0; s < (2); s++) {
796
+ if (this.stickUsed[s] === (0)) continue;
797
+ this.stickRadius[s] = this.stickBaseRadius[s] * scale, this.placeRect(this.stickZoneFraction, s * (4), this.stickZone);
798
+ let hx = sx + sw * this.stickHomeFraction[s * (2)], hy = sy + sh * this.stickHomeFraction[s * (2) + 1];
799
+ this.stickHome[s * (2)] = hx, this.stickHome[s * (2) + 1] = hy, this.stickPointer[s] === (-1) && (this.stickOrigin[s * (2)] = hx, this.stickOrigin[s * (2) + 1] = hy);
800
+ }
801
+ this.lookUsed && this.placeRect(this.lookZoneFraction, 0, this.lookZone);
802
+ for (let b = 0; b < this.buttonCount; b++) {
803
+ let p = this.placements[b];
804
+ this.buttonRadius[b] = this.buttonSize[b] * scale / 2, this.buttonCenter[b * (2)] = sx + sw * p.anchor[0] + p.offset[0] * scale, this.buttonCenter[b * (2) + 1] = sy + sh * p.anchor[1] + p.offset[1] * scale;
805
+ }
806
+ }
807
+ placeRect(fractions, at, out) {
808
+ let r = this.reg, sx = r[(12) + (0)], sy = r[(12) + (1)], w = r[(12) + (2)] - sx, h = r[(12) + (3)] - sy;
809
+ out[at] = sx + w * fractions[at], out[at + 1] = sy + h * fractions[at + 1], out[at + 2] = sx + w * fractions[at + 2], out[at + 3] = sy + h * fractions[at + 3];
810
+ }
811
+ stickMove(s) {
812
+ let r = this.reg, o = s * (2);
813
+ if (this.stickTouch[o] = r[(0)], this.stickTouch[o + 1] = r[(1)], this.stickFollow[s] === (1)) {
814
+ let axes = this.stickAxes[s], target = this.stickFollowTarget;
815
+ target[0] = axes === 2 ? this.stickOrigin[o] : r[(0)], target[1] = axes === 1 ? this.stickOrigin[o + 1] : r[(1)], followOriginInto(this.stickOrigin, o, target, 0, this.stickRadius, s);
816
+ }
817
+ if (this.stickMoved[s] === (0)) {
818
+ let dx = r[(0)] - this.stickOrigin[o], dy = r[(1)] - this.stickOrigin[o + 1], slop = this.stickRadius[s] * (0.25);
819
+ dx * dx + dy * dy > slop * slop && (this.stickMoved[s] = (1));
820
+ }
821
+ this.emitStick(s);
822
+ }
823
+ stickRelease(s) {
824
+ this.stickPointer[s] = (-1), this.stickIo[0] = 0, this.stickIo[1] = 0, this.stickIo[2] = 0, this.publishStick(s);
825
+ }
826
+ emitStick(s) {
827
+ let o = s * (2), io = this.stickIo;
828
+ io[3] = this.stickTouch[o] - this.stickOrigin[o], io[4] = this.stickTouch[o + 1] - this.stickOrigin[o + 1], io[5] = this.stickRadius[s], io[6] = this.stickDead[s], io[7] = this.stickCurve[s], shapeStickInto(io, this.stickAxes[s]), this.publishStick(s);
829
+ }
830
+ publishStick(s) {
831
+ let io = this.stickIo, v = this.stickValue, o = s * 3, input = this.input, stage = input.stage;
832
+ v[o + 0] !== io[0] && this.stickSlotX[s] !== (-1) && (stage[chunk5LH2QN3T_js.STAGE_X] = io[0], stage[chunk5LH2QN3T_js.STAGE_TIME] = this.reg[(2)], input.virtualStaged(this.stickSlotX[s])), v[o + 1] !== io[1] && this.stickSlotY[s] !== (-1) && (stage[chunk5LH2QN3T_js.STAGE_X] = io[1], stage[chunk5LH2QN3T_js.STAGE_TIME] = this.reg[(2)], input.virtualStaged(this.stickSlotY[s])), v[o + 0] = io[0], v[o + 1] = io[1], v[o + 2] = io[2];
833
+ }
834
+ buttonRelease(b) {
835
+ if (this.buttonPointer[b] = (-1), this.buttonMode[b] !== (0)) return;
836
+ let stage = this.input.stage;
837
+ stage[chunk5LH2QN3T_js.STAGE_X] = 0, stage[chunk5LH2QN3T_js.STAGE_TIME] = this.reg[(2)], this.input.virtualStaged(this.buttonSlot[b]);
838
+ }
839
+ releaseAll() {
840
+ for (let i = 0; i < 10; i++) {
841
+ let owner = this.pointerOwner[i];
842
+ if (owner === (-1)) continue;
843
+ this.pointerId[i] = (-1), this.pointerOwner[i] = (-1);
844
+ let index = owner & INDEX_MASK, kind = owner >> (4);
845
+ kind === (0) ? this.stickRelease(index) : kind === (1) ? (this.lookPointer = (-1), this.lookCoasting = false) : this.buttonRelease(index);
846
+ }
847
+ }
848
+ drawVisibility(writer) {
849
+ let device = this.input.device, visible = this.enabledState;
850
+ visible && this.autoHide && (device === chunk5LH2QN3T_js.InputDevice.keyboard || device === chunk5LH2QN3T_js.InputDevice.gamepad) && this.activeTouches === 0 && (visible = false);
851
+ let opacity = visible ? (1) : 0;
852
+ opacity !== this.reg[(10)] && (this.reg[(10)] = opacity, this.single[0] = opacity, writer.propF32(this.rootNode, chunkVRBDAS5I_js.UiProp.opacity, this.single));
853
+ }
854
+ drawStick(writer, s) {
855
+ let o = s * (2), radius = this.stickRadius[s], active = this.stickPointer[s] !== (-1), knob = this.stickKnob;
856
+ if (active) {
857
+ let kx = this.stickTouch[o] - this.stickOrigin[o], ky = this.stickTouch[o + 1] - this.stickOrigin[o + 1], axes = this.stickAxes[s];
858
+ axes === 1 ? ky = 0 : axes === 2 && (kx = 0);
859
+ let length = (kx * kx + ky * ky) ** 0.5;
860
+ length > radius && (kx *= radius / length, ky *= radius / length), knob[o] = kx, knob[o + 1] = ky;
861
+ } else {
862
+ let k = 1 - Math.exp(-this.reg[(3)] * (3) / this.stickSnap[s]);
863
+ knob[o] -= knob[o] * k, knob[o + 1] -= knob[o + 1] * k, this.stickFloating[s] === (1) && (this.stickOrigin[o] = this.stickHome[o], this.stickOrigin[o + 1] = this.stickHome[o + 1]);
864
+ }
865
+ let shownBase = this.stickShownBase, baseX = this.stickOrigin[o] - radius, baseY = this.stickOrigin[o + 1] - radius;
866
+ Math.abs(shownBase[o] - baseX) < (0.25) && Math.abs(shownBase[o + 1] - baseY) < (0.25) || (shownBase[o] = baseX, shownBase[o + 1] = baseY, this.pair[0] = baseX, this.pair[1] = baseY, writer.propF32(this.stickBaseNode[s], chunkVRBDAS5I_js.UiProp.translate, this.pair));
867
+ let shownKnob = this.stickShownKnob;
868
+ Math.abs(shownKnob[o] - knob[o]) < (0.25) && Math.abs(shownKnob[o + 1] - knob[o + 1]) < (0.25) || (shownKnob[o] = knob[o], shownKnob[o + 1] = knob[o + 1], this.pair[0] = knob[o], this.pair[1] = knob[o + 1], writer.propF32(this.stickKnobNode[s], chunkVRBDAS5I_js.UiProp.translate, this.pair));
869
+ let shade = this.shade;
870
+ shade[0] = this.reg[(11)], active && (shade[0] = (1)), this.stickShownOpacity[s] !== shade[0] && (this.stickShownOpacity[s] = shade[0], this.single[0] = shade[0], writer.propF32(this.stickBaseNode[s], chunkVRBDAS5I_js.UiProp.opacity, this.single));
871
+ }
872
+ drawButton(writer, b) {
873
+ let node = this.buttonNode[b], o = b * (2), radius = this.buttonRadius[b], cx = this.buttonCenter[o] - radius, cy = this.buttonCenter[o + 1] - radius, shown = this.buttonShownCenter;
874
+ Math.abs(shown[o] - cx) < (0.25) && Math.abs(shown[o + 1] - cy) < (0.25) || (shown[o] = cx, shown[o + 1] = cy, this.pair[0] = cx, this.pair[1] = cy, writer.propF32(node, chunkVRBDAS5I_js.UiProp.translate, this.pair));
875
+ let held = this.buttonPointer[b] !== (-1) && this.buttonCooldownLeft[b] <= 0, lit = held || this.buttonMode[b] === (1) && this.buttonToggled[b] === (1), pressed = lit ? (1) : (0);
876
+ if (this.buttonShownPressed[b] !== pressed) {
877
+ this.buttonShownPressed[b] = pressed, this.single[0] = lit ? (1) : 0, writer.propF32(this.buttonHighlightNode[b], chunkVRBDAS5I_js.UiProp.opacity, this.single);
878
+ let scale = held ? this.pressScale : 1;
879
+ this.pair[0] = scale, this.pair[1] = scale, writer.propF32(node, chunkVRBDAS5I_js.UiProp.scale, this.pair);
880
+ }
881
+ let total = this.buttonCooldownTotal[b], shade = this.shade;
882
+ shade[0] = 0, total > 0 && (shade[0] = this.buttonCooldownLeft[b] / total);
883
+ let ratio = shade[0], before = this.buttonShownCooldown[b];
884
+ (before !== before || Math.abs(before - ratio) >= COOLDOWN_EPSILON || ratio === 0 && before !== 0) && (this.buttonShownCooldown[b] = ratio, this.pair[0] = 1, this.pair[1] = ratio, writer.propF32(this.buttonOverlayNode[b], chunkVRBDAS5I_js.UiProp.scale, this.pair), this.single[0] = ratio > 0 ? (0.55) : (1), writer.propF32(node, chunkVRBDAS5I_js.UiProp.opacity, this.single));
885
+ }
886
+ build(ui, buttons) {
887
+ let t = this.theme, root = ui.box({ position: "absolute", left: 0, top: 0, width: "100%", height: "100%", pointerEvents: "none" });
888
+ root.transition(["opacity"], { duration: t.motion, easing: "ease_out" }), ui.root(root, { anchor: "top_left", safe_area: false, z: this.z }), this.rootNode = root.id, this.elements.push(root);
889
+ for (let s = 0; s < (2); s++) {
890
+ if (this.stickUsed[s] === (0)) continue;
891
+ let base = ui.box({
892
+ position: "absolute",
893
+ left: 0,
894
+ top: 0,
895
+ fill: t.track,
896
+ borderWidth: (2),
897
+ borderColor: t.border,
898
+ pointerEvents: "none",
899
+ layer: true
900
+ });
901
+ base.transition(["opacity"], { duration: t.motion, easing: "ease_out" });
902
+ let stick = s;
903
+ base.accessibility({ role: "adjustable", label: s === (0) ? MOVE_LABEL : AIM_LABEL, actions: ["increment", "decrement"] }), base.on("action", (event) => this.accessibleStep(stick, event.value, event.time_ms));
904
+ let knob = ui.box({ position: "absolute", fill: (chunkVRBDAS5I_js.parseColor(t.text) & (4294967040) | (217)) >>> 0, pointerEvents: "none", layer: true });
905
+ base.append(knob), root.append(base), this.stickBaseNode[s] = base.id, this.stickKnobNode[s] = knob.id, this.elements.push(base, knob), this.sized(base, (0), s), this.sized(knob, (1), s);
906
+ }
907
+ for (let b = 0; b < this.buttonCount; b++) {
908
+ let spec = buttons[b], button = ui.box({
909
+ position: "absolute",
910
+ left: 0,
911
+ top: 0,
912
+ alignItems: "center",
913
+ justify: "center",
914
+ fill: t.raised,
915
+ borderWidth: (2),
916
+ borderColor: t.border,
917
+ clip: true,
918
+ pointerEvents: "none",
919
+ layer: true,
920
+ origin: [(0.5), (0.5)]
921
+ });
922
+ button.transition(["scale_x", "scale_y", "opacity"], { duration: t.motion, easing: "back_out" });
923
+ let highlight = ui.box({
924
+ position: "absolute",
925
+ left: 0,
926
+ top: 0,
927
+ width: "100%",
928
+ height: "100%",
929
+ fill: t.accent,
930
+ opacity: 0,
931
+ pointerEvents: "none",
932
+ layer: true
933
+ });
934
+ highlight.transition(["opacity"], { duration: t.motion, easing: "ease_out" }), button.append(highlight);
935
+ let overlay = ui.box({
936
+ position: "absolute",
937
+ left: 0,
938
+ top: 0,
939
+ width: "100%",
940
+ height: "100%",
941
+ fill: (chunkVRBDAS5I_js.parseColor(t.surface) & (4294967040) | (179)) >>> 0,
942
+ origin: [(0.5), 1],
943
+ pointerEvents: "none",
944
+ layer: true
945
+ });
946
+ if (button.append(overlay), spec.icon !== void 0) {
947
+ let size = t.body * 2, icon = ui.image(spec.icon, [size, size], { width: size, height: size, pointerEvents: "none" });
948
+ button.append(icon), this.elements.push(icon);
949
+ } else if (spec.label !== void 0) {
950
+ let label = ui.text(spec.label, { fontFamily: t.font, fontSize: t.small, textColor: t.text, textAlign: "center", pointerEvents: "none" });
951
+ button.append(label), this.elements.push(label);
952
+ }
953
+ button.accessibility({ role: "button", label: spec.label ?? spec.control, actions: ["activate"] });
954
+ let index = b;
955
+ button.on("tap", (event) => this.accessibleActivate(index, event.time_ms)), root.append(button), this.buttonNode[b] = button.id, this.buttonOverlayNode[b] = overlay.id, this.buttonHighlightNode[b] = highlight.id, this.elements.push(button, highlight, overlay), this.sized(button, (2), b);
956
+ }
957
+ this.resize();
958
+ }
959
+ sized(element, kind, index) {
960
+ this.sizedElements.push(element), this.sizedKind.push(kind), this.sizedIndex.push(index);
961
+ }
962
+ resize() {
963
+ for (let i = 0; i < this.sizedElements.length; i++) {
964
+ let element = this.sizedElements[i], index = this.sizedIndex[i], kind = this.sizedKind[i];
965
+ if (kind === (2)) {
966
+ let d = this.buttonRadius[index] * 2;
967
+ element.style({ width: d, height: d, radius: d / 2 });
968
+ } else if (kind === (0)) {
969
+ let d = this.stickRadius[index] * 2;
970
+ element.style({ width: d, height: d, radius: d / 2 });
971
+ } else {
972
+ let r = this.stickRadius[index], d = r * 2 * (0.46);
973
+ element.style({ width: d, height: d, radius: d / 2, left: r - d / 2, top: r - d / 2 });
974
+ }
975
+ }
976
+ this.stickShownBase.fill(Number.NaN), this.buttonShownCenter.fill(Number.NaN);
977
+ }
978
+ };
979
+ function copyRect(source, out, at = 0) {
980
+ out[at] = source[0], out[at + 1] = source[1], out[at + 2] = source[2], out[at + 3] = source[3];
981
+ }
982
+
983
+ exports.CHAR_AIR_SECONDS = (14);
984
+ exports.CHAR_BUFFER = (6);
985
+ exports.CHAR_COYOTE = (5);
986
+ exports.CHAR_CROUCH = (7);
987
+ exports.CHAR_GROUND_NX = (8);
988
+ exports.CHAR_GROUND_NY = (9);
989
+ exports.CHAR_GROUND_NZ = (10);
990
+ exports.CHAR_HEADING = (3);
991
+ exports.CHAR_LANDING_SPEED = (15);
992
+ exports.CHAR_MOVE_MAGNITUDE = (18);
993
+ exports.CHAR_MOVE_X = (16);
994
+ exports.CHAR_MOVE_Z = (17);
995
+ exports.CHAR_PLATFORM_VX = (11);
996
+ exports.CHAR_PLATFORM_VY = (12);
997
+ exports.CHAR_PLATFORM_VZ = (13);
998
+ exports.CHAR_SPEED = (4);
999
+ exports.CHAR_SPEED_NORMALIZED = (19);
1000
+ exports.CHAR_VX = (0);
1001
+ exports.CHAR_VY = (1);
1002
+ exports.CHAR_VZ = (2);
1003
+ exports.CONTACT_LOCKED = (2);
1004
+ exports.CONTACT_LOCK_BLEND = (6);
1005
+ exports.CONTACT_LOCK_X = (3);
1006
+ exports.CONTACT_LOCK_Y = (4);
1007
+ exports.CONTACT_LOCK_Z = (5);
1008
+ exports.CONTACT_PLANTED = (1);
1009
+ exports.CONTACT_WEIGHT = (0);
1010
+ exports.CharacterMotor = CharacterMotor;
1011
+ exports.ClipEventReader = ClipEventReader;
1012
+ exports.DEFAULT_CLIP_EVENT_CAPACITY = (64);
1013
+ exports.DEFAULT_CONTACT_MAX_SLIDE = (0.25);
1014
+ exports.DEFAULT_CONTACT_RELEASE_SECONDS = (0.2);
1015
+ exports.DEFAULT_CONTACT_WEIGHT_SECONDS = (0.08);
1016
+ exports.DEFAULT_FOOT_UP = DEFAULT_FOOT_UP;
1017
+ exports.DEFAULT_GAMEPAD_LOOK_SPEED = (3.4);
1018
+ exports.DEFAULT_LOOK_SENSITIVITY = (62e-4);
1019
+ exports.DEFAULT_MAX_FOOT_TILT = DEFAULT_MAX_FOOT_TILT;
1020
+ exports.DEFAULT_PLANT_THRESHOLD = (0.5);
1021
+ exports.FOLLOW_CAMERA_X = (0);
1022
+ exports.FOLLOW_CAMERA_Y = (1);
1023
+ exports.FOLLOW_CAMERA_Z = (2);
1024
+ exports.FOLLOW_CLOSENESS = (11);
1025
+ exports.FOLLOW_DISTANCE = (5);
1026
+ exports.FOLLOW_FOV = (10);
1027
+ exports.FOLLOW_PITCH = (4);
1028
+ exports.FOLLOW_PIVOT_X = (6);
1029
+ exports.FOLLOW_PIVOT_Y = (7);
1030
+ exports.FOLLOW_PIVOT_Z = (8);
1031
+ exports.FOLLOW_SHOULDER = (9);
1032
+ exports.FOLLOW_YAW = (3);
1033
+ exports.FollowCamera = FollowCamera;
1034
+ exports.FootContact = FootContact;
1035
+ exports.MAX_TOUCH_BUTTONS = (8);
1036
+ exports.MOVE_IN_X = (0);
1037
+ exports.MOVE_IN_Y = (1);
1038
+ exports.MOVE_IO_MAGNITUDE = (2);
1039
+ exports.MOVE_IO_WORDS = (4);
1040
+ exports.MOVE_IO_X = (0);
1041
+ exports.MOVE_IO_Z = (1);
1042
+ exports.MOVE_OUT_X = (2);
1043
+ exports.MOVE_OUT_Z = (3);
1044
+ exports.ROOT_IO_DX = (0);
1045
+ exports.ROOT_IO_DZ = (1);
1046
+ exports.ROOT_IO_YAW = (2);
1047
+ exports.STICK_AIM = (1);
1048
+ exports.STICK_CURVE = (7);
1049
+ exports.STICK_DEAD_ZONE = (6);
1050
+ exports.STICK_DX = (3);
1051
+ exports.STICK_DY = (4);
1052
+ exports.STICK_IO_WORDS = (8);
1053
+ exports.STICK_MAGNITUDE = (2);
1054
+ exports.STICK_MOVE = (0);
1055
+ exports.STICK_OUT_WORDS = (3);
1056
+ exports.STICK_RADIUS = (5);
1057
+ exports.STICK_X = (0);
1058
+ exports.STICK_Y = (1);
1059
+ exports.TouchControls = TouchControls;
1060
+ exports.actionListed = actionListed;
1061
+ exports.createFootTiltChain = createFootTiltChain;
1062
+ exports.followOrigin = followOrigin;
1063
+ exports.followOriginInto = followOriginInto;
1064
+ exports.shapeStick = shapeStick;
1065
+ exports.shapeStickInto = shapeStickInto;
1066
+ exports.touchLayout = touchLayout;