@zylem/game-lib 0.4.1 → 0.5.1

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 (362) hide show
  1. package/README.md +23 -41
  2. package/dist/actions.d.ts +25 -0
  3. package/dist/actions.js +287 -8
  4. package/dist/actions.js.map +1 -0
  5. package/dist/behaviors.d.ts +108 -0
  6. package/dist/behaviors.js +396 -6
  7. package/dist/behaviors.js.map +1 -0
  8. package/dist/{lib/camera/zylem-camera.d.ts → camera-Dk-fOVZE.d.ts} +55 -8
  9. package/dist/camera.d.ts +5 -0
  10. package/dist/camera.js +504 -4
  11. package/dist/camera.js.map +1 -0
  12. package/dist/core-C2mjetAd.d.ts +431 -0
  13. package/dist/core.d.ts +9 -0
  14. package/dist/core.js +4780 -9
  15. package/dist/core.js.map +1 -0
  16. package/dist/entities.d.ts +269 -0
  17. package/dist/entities.js +2161 -17
  18. package/dist/entities.js.map +1 -0
  19. package/dist/entity-bQElAdpo.d.ts +347 -0
  20. package/dist/entity-spawner-DNnLYnZq.d.ts +11 -0
  21. package/dist/main.d.ts +135 -0
  22. package/dist/main.js +6599 -56
  23. package/dist/main.js.map +1 -0
  24. package/dist/moveable-B_vyA6cw.d.ts +67 -0
  25. package/dist/stage-CrmY7V0i.d.ts +287 -0
  26. package/dist/stage.d.ts +26 -0
  27. package/dist/stage.js +2229 -15
  28. package/dist/stage.js.map +1 -0
  29. package/dist/transformable-CUhvyuYO.d.ts +67 -0
  30. package/package.json +12 -42
  31. package/LICENSE +0 -21
  32. package/dist/.vite/manifest.json +0 -676
  33. package/dist/api/actions.d.ts +0 -5
  34. package/dist/api/actions.d.ts.map +0 -1
  35. package/dist/api/behaviors.d.ts +0 -4
  36. package/dist/api/behaviors.d.ts.map +0 -1
  37. package/dist/api/camera.d.ts +0 -4
  38. package/dist/api/camera.d.ts.map +0 -1
  39. package/dist/api/core.d.ts +0 -6
  40. package/dist/api/core.d.ts.map +0 -1
  41. package/dist/api/entities.d.ts +0 -9
  42. package/dist/api/entities.d.ts.map +0 -1
  43. package/dist/api/main.d.ts +0 -32
  44. package/dist/api/main.d.ts.map +0 -1
  45. package/dist/api/stage.d.ts +0 -6
  46. package/dist/api/stage.d.ts.map +0 -1
  47. package/dist/assets/zylem-logo.png +0 -0
  48. package/dist/lib/actions/behaviors/actions.d.ts +0 -11
  49. package/dist/lib/actions/behaviors/actions.d.ts.map +0 -1
  50. package/dist/lib/actions/behaviors/actions.js +0 -35
  51. package/dist/lib/actions/behaviors/behavior.d.ts +0 -6
  52. package/dist/lib/actions/behaviors/behavior.d.ts.map +0 -1
  53. package/dist/lib/actions/behaviors/boundaries/boundary.d.ts +0 -37
  54. package/dist/lib/actions/behaviors/boundaries/boundary.d.ts.map +0 -1
  55. package/dist/lib/actions/behaviors/boundaries/boundary.js +0 -40
  56. package/dist/lib/actions/behaviors/character-controller.d.ts +0 -6
  57. package/dist/lib/actions/behaviors/character-controller.d.ts.map +0 -1
  58. package/dist/lib/actions/behaviors/debug/debug-collision.d.ts +0 -6
  59. package/dist/lib/actions/behaviors/debug/debug-collision.d.ts.map +0 -1
  60. package/dist/lib/actions/behaviors/debug/debug-update.d.ts +0 -5
  61. package/dist/lib/actions/behaviors/debug/debug-update.d.ts.map +0 -1
  62. package/dist/lib/actions/behaviors/debug/debug.d.ts +0 -10
  63. package/dist/lib/actions/behaviors/debug/debug.d.ts.map +0 -1
  64. package/dist/lib/actions/behaviors/movement/movement-sequence-2d.d.ts +0 -24
  65. package/dist/lib/actions/behaviors/movement/movement-sequence-2d.d.ts.map +0 -1
  66. package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts +0 -11
  67. package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts.map +0 -1
  68. package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.js +0 -100
  69. package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts +0 -12
  70. package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts.map +0 -1
  71. package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.js +0 -37
  72. package/dist/lib/actions/behaviors/ricochet/ricochet.d.ts +0 -44
  73. package/dist/lib/actions/behaviors/ricochet/ricochet.d.ts.map +0 -1
  74. package/dist/lib/actions/behaviors/ricochet/ricochet.js +0 -6
  75. package/dist/lib/actions/behaviors/zylem-behavior.d.ts +0 -2
  76. package/dist/lib/actions/behaviors/zylem-behavior.d.ts.map +0 -1
  77. package/dist/lib/actions/capabilities/moveable.d.ts +0 -125
  78. package/dist/lib/actions/capabilities/moveable.d.ts.map +0 -1
  79. package/dist/lib/actions/capabilities/moveable.js +0 -108
  80. package/dist/lib/actions/capabilities/rotatable.d.ts +0 -111
  81. package/dist/lib/actions/capabilities/rotatable.d.ts.map +0 -1
  82. package/dist/lib/actions/capabilities/rotatable.js +0 -82
  83. package/dist/lib/actions/capabilities/transformable.d.ts +0 -7
  84. package/dist/lib/actions/capabilities/transformable.d.ts.map +0 -1
  85. package/dist/lib/actions/capabilities/transformable.js +0 -9
  86. package/dist/lib/actions/global-change.d.ts +0 -23
  87. package/dist/lib/actions/global-change.d.ts.map +0 -1
  88. package/dist/lib/actions/global-change.js +0 -40
  89. package/dist/lib/camera/camera.d.ts +0 -16
  90. package/dist/lib/camera/camera.d.ts.map +0 -1
  91. package/dist/lib/camera/camera.js +0 -19
  92. package/dist/lib/camera/fixed-2d.d.ts +0 -32
  93. package/dist/lib/camera/fixed-2d.d.ts.map +0 -1
  94. package/dist/lib/camera/fixed-2d.js +0 -30
  95. package/dist/lib/camera/perspective.d.ts +0 -9
  96. package/dist/lib/camera/perspective.d.ts.map +0 -1
  97. package/dist/lib/camera/perspective.js +0 -10
  98. package/dist/lib/camera/third-person.d.ts +0 -32
  99. package/dist/lib/camera/third-person.d.ts.map +0 -1
  100. package/dist/lib/camera/third-person.js +0 -42
  101. package/dist/lib/camera/zylem-camera.d.ts.map +0 -1
  102. package/dist/lib/camera/zylem-camera.js +0 -208
  103. package/dist/lib/collision/collision-builder.d.ts +0 -17
  104. package/dist/lib/collision/collision-builder.d.ts.map +0 -1
  105. package/dist/lib/collision/collision-builder.js +0 -46
  106. package/dist/lib/collision/collision-delegate.d.ts +0 -6
  107. package/dist/lib/collision/collision-delegate.d.ts.map +0 -1
  108. package/dist/lib/collision/collision-delegate.js +0 -6
  109. package/dist/lib/collision/collision-group.d.ts +0 -11
  110. package/dist/lib/collision/collision-group.d.ts.map +0 -1
  111. package/dist/lib/collision/collision-mask.d.ts +0 -18
  112. package/dist/lib/collision/collision-mask.d.ts.map +0 -1
  113. package/dist/lib/collision/collision.d.ts +0 -19
  114. package/dist/lib/collision/collision.d.ts.map +0 -1
  115. package/dist/lib/collision/utils.d.ts +0 -15
  116. package/dist/lib/collision/utils.d.ts.map +0 -1
  117. package/dist/lib/collision/utils.js +0 -24
  118. package/dist/lib/collision/world.d.ts +0 -23
  119. package/dist/lib/collision/world.d.ts.map +0 -1
  120. package/dist/lib/collision/world.js +0 -77
  121. package/dist/lib/core/asset-manager.d.ts +0 -2
  122. package/dist/lib/core/asset-manager.d.ts.map +0 -1
  123. package/dist/lib/core/base-node-life-cycle.d.ts +0 -68
  124. package/dist/lib/core/base-node-life-cycle.d.ts.map +0 -1
  125. package/dist/lib/core/base-node.d.ts +0 -37
  126. package/dist/lib/core/base-node.d.ts.map +0 -1
  127. package/dist/lib/core/base-node.js +0 -62
  128. package/dist/lib/core/entity-asset-loader.d.ts +0 -16
  129. package/dist/lib/core/entity-asset-loader.d.ts.map +0 -1
  130. package/dist/lib/core/entity-asset-loader.js +0 -54
  131. package/dist/lib/core/errors.d.ts +0 -5
  132. package/dist/lib/core/errors.d.ts.map +0 -1
  133. package/dist/lib/core/flags.d.ts +0 -3
  134. package/dist/lib/core/flags.d.ts.map +0 -1
  135. package/dist/lib/core/index.d.ts +0 -5
  136. package/dist/lib/core/index.d.ts.map +0 -1
  137. package/dist/lib/core/lazy-loader.d.ts +0 -80
  138. package/dist/lib/core/lazy-loader.d.ts.map +0 -1
  139. package/dist/lib/core/lifecycle-base.d.ts +0 -17
  140. package/dist/lib/core/lifecycle-base.d.ts.map +0 -1
  141. package/dist/lib/core/lifecycle-base.js +0 -20
  142. package/dist/lib/core/preset-shader.d.ts +0 -8
  143. package/dist/lib/core/preset-shader.d.ts.map +0 -1
  144. package/dist/lib/core/preset-shader.js +0 -26
  145. package/dist/lib/core/three-addons/Timer.d.ts +0 -92
  146. package/dist/lib/core/three-addons/Timer.d.ts.map +0 -1
  147. package/dist/lib/core/three-addons/Timer.js +0 -103
  148. package/dist/lib/core/utility/nodes.d.ts +0 -13
  149. package/dist/lib/core/utility/nodes.d.ts.map +0 -1
  150. package/dist/lib/core/utility/nodes.js +0 -31
  151. package/dist/lib/core/utility/strings.d.ts +0 -3
  152. package/dist/lib/core/utility/strings.d.ts.map +0 -1
  153. package/dist/lib/core/utility/strings.js +0 -14
  154. package/dist/lib/core/utility/vector.d.ts +0 -8
  155. package/dist/lib/core/utility/vector.d.ts.map +0 -1
  156. package/dist/lib/core/utility/vector.js +0 -8
  157. package/dist/lib/core/vector.d.ts +0 -4
  158. package/dist/lib/core/vector.d.ts.map +0 -1
  159. package/dist/lib/core/vessel.d.ts +0 -13
  160. package/dist/lib/core/vessel.d.ts.map +0 -1
  161. package/dist/lib/core/vessel.js +0 -26
  162. package/dist/lib/debug/console/console-state.d.ts +0 -20
  163. package/dist/lib/debug/console/console-state.d.ts.map +0 -1
  164. package/dist/lib/debug/console/console-state.js +0 -11
  165. package/dist/lib/debug/console/console-store.d.ts +0 -6
  166. package/dist/lib/debug/console/console-store.d.ts.map +0 -1
  167. package/dist/lib/debug/debug-state.d.ts +0 -38
  168. package/dist/lib/debug/debug-state.d.ts.map +0 -1
  169. package/dist/lib/debug/debug-state.js +0 -40
  170. package/dist/lib/debug/debug-store.d.ts +0 -15
  171. package/dist/lib/debug/debug-store.d.ts.map +0 -1
  172. package/dist/lib/debug/state-based-debug-loader.d.ts +0 -8
  173. package/dist/lib/debug/state-based-debug-loader.d.ts.map +0 -1
  174. package/dist/lib/device/aspect-ratio.d.ts +0 -38
  175. package/dist/lib/device/aspect-ratio.d.ts.map +0 -1
  176. package/dist/lib/device/aspect-ratio.js +0 -44
  177. package/dist/lib/device/desktop.d.ts +0 -2
  178. package/dist/lib/device/desktop.d.ts.map +0 -1
  179. package/dist/lib/device/mobile.d.ts +0 -2
  180. package/dist/lib/device/mobile.d.ts.map +0 -1
  181. package/dist/lib/device/tablet.d.ts +0 -2
  182. package/dist/lib/device/tablet.d.ts.map +0 -1
  183. package/dist/lib/entities/actor.d.ts +0 -44
  184. package/dist/lib/entities/actor.d.ts.map +0 -1
  185. package/dist/lib/entities/actor.js +0 -122
  186. package/dist/lib/entities/box.d.ts +0 -27
  187. package/dist/lib/entities/box.d.ts.map +0 -1
  188. package/dist/lib/entities/box.js +0 -68
  189. package/dist/lib/entities/builder.d.ts +0 -28
  190. package/dist/lib/entities/builder.d.ts.map +0 -1
  191. package/dist/lib/entities/builder.js +0 -79
  192. package/dist/lib/entities/create.d.ts +0 -15
  193. package/dist/lib/entities/create.d.ts.map +0 -1
  194. package/dist/lib/entities/create.js +0 -31
  195. package/dist/lib/entities/delegates/animation.d.ts +0 -33
  196. package/dist/lib/entities/delegates/animation.d.ts.map +0 -1
  197. package/dist/lib/entities/delegates/animation.js +0 -58
  198. package/dist/lib/entities/delegates/debug.d.ts +0 -29
  199. package/dist/lib/entities/delegates/debug.d.ts.map +0 -1
  200. package/dist/lib/entities/delegates/debug.js +0 -71
  201. package/dist/lib/entities/delegates/loader.d.ts +0 -12
  202. package/dist/lib/entities/delegates/loader.d.ts.map +0 -1
  203. package/dist/lib/entities/delegates/loader.js +0 -19
  204. package/dist/lib/entities/destroy.d.ts +0 -4
  205. package/dist/lib/entities/destroy.d.ts.map +0 -1
  206. package/dist/lib/entities/destroy.js +0 -15
  207. package/dist/lib/entities/entity.d.ts +0 -96
  208. package/dist/lib/entities/entity.d.ts.map +0 -1
  209. package/dist/lib/entities/entity.js +0 -120
  210. package/dist/lib/entities/index.d.ts +0 -12
  211. package/dist/lib/entities/index.d.ts.map +0 -1
  212. package/dist/lib/entities/plane.d.ts +0 -36
  213. package/dist/lib/entities/plane.d.ts.map +0 -1
  214. package/dist/lib/entities/plane.js +0 -81
  215. package/dist/lib/entities/rect.d.ts +0 -63
  216. package/dist/lib/entities/rect.d.ts.map +0 -1
  217. package/dist/lib/entities/rect.js +0 -160
  218. package/dist/lib/entities/sphere.d.ts +0 -29
  219. package/dist/lib/entities/sphere.d.ts.map +0 -1
  220. package/dist/lib/entities/sphere.js +0 -68
  221. package/dist/lib/entities/sprite.d.ts +0 -53
  222. package/dist/lib/entities/sprite.d.ts.map +0 -1
  223. package/dist/lib/entities/sprite.js +0 -118
  224. package/dist/lib/entities/text.d.ts +0 -49
  225. package/dist/lib/entities/text.d.ts.map +0 -1
  226. package/dist/lib/entities/text.js +0 -140
  227. package/dist/lib/entities/zone.d.ts +0 -54
  228. package/dist/lib/entities/zone.d.ts.map +0 -1
  229. package/dist/lib/entities/zone.js +0 -103
  230. package/dist/lib/game/game-blueprint.d.ts +0 -38
  231. package/dist/lib/game/game-blueprint.d.ts.map +0 -1
  232. package/dist/lib/game/game-canvas.d.ts +0 -35
  233. package/dist/lib/game/game-canvas.d.ts.map +0 -1
  234. package/dist/lib/game/game-canvas.js +0 -57
  235. package/dist/lib/game/game-config.d.ts +0 -59
  236. package/dist/lib/game/game-config.d.ts.map +0 -1
  237. package/dist/lib/game/game-config.js +0 -78
  238. package/dist/lib/game/game-default.d.ts +0 -14
  239. package/dist/lib/game/game-default.d.ts.map +0 -1
  240. package/dist/lib/game/game-default.js +0 -23
  241. package/dist/lib/game/game-interfaces.d.ts +0 -29
  242. package/dist/lib/game/game-interfaces.d.ts.map +0 -1
  243. package/dist/lib/game/game-retro-resolutions.d.ts +0 -25
  244. package/dist/lib/game/game-retro-resolutions.d.ts.map +0 -1
  245. package/dist/lib/game/game-retro-resolutions.js +0 -80
  246. package/dist/lib/game/game-state.d.ts +0 -11
  247. package/dist/lib/game/game-state.d.ts.map +0 -1
  248. package/dist/lib/game/game-state.js +0 -17
  249. package/dist/lib/game/game.d.ts +0 -37
  250. package/dist/lib/game/game.d.ts.map +0 -1
  251. package/dist/lib/game/game.js +0 -109
  252. package/dist/lib/game/zylem-game.d.ts +0 -58
  253. package/dist/lib/game/zylem-game.d.ts.map +0 -1
  254. package/dist/lib/game/zylem-game.js +0 -140
  255. package/dist/lib/graphics/geometries/XZPlaneGeometry.d.ts +0 -8
  256. package/dist/lib/graphics/geometries/XZPlaneGeometry.d.ts.map +0 -1
  257. package/dist/lib/graphics/geometries/XZPlaneGeometry.js +0 -34
  258. package/dist/lib/graphics/material.d.ts +0 -29
  259. package/dist/lib/graphics/material.d.ts.map +0 -1
  260. package/dist/lib/graphics/material.js +0 -64
  261. package/dist/lib/graphics/mesh.d.ts +0 -19
  262. package/dist/lib/graphics/mesh.d.ts.map +0 -1
  263. package/dist/lib/graphics/mesh.js +0 -14
  264. package/dist/lib/graphics/render-pass.d.ts +0 -17
  265. package/dist/lib/graphics/render-pass.d.ts.map +0 -1
  266. package/dist/lib/graphics/render-pass.js +0 -56
  267. package/dist/lib/graphics/shaders/fragment/debug.glsl.js +0 -23
  268. package/dist/lib/graphics/shaders/fragment/fire.glsl.js +0 -52
  269. package/dist/lib/graphics/shaders/fragment/standard.glsl.js +0 -11
  270. package/dist/lib/graphics/shaders/fragment/stars.glsl.js +0 -44
  271. package/dist/lib/graphics/shaders/vertex/debug.glsl.js +0 -15
  272. package/dist/lib/graphics/shaders/vertex/object-shader.glsl.js +0 -11
  273. package/dist/lib/graphics/shaders/vertex/standard.glsl.js +0 -9
  274. package/dist/lib/graphics/zylem-scene.d.ts +0 -50
  275. package/dist/lib/graphics/zylem-scene.d.ts.map +0 -1
  276. package/dist/lib/graphics/zylem-scene.js +0 -75
  277. package/dist/lib/input/gamepad-provider.d.ts +0 -14
  278. package/dist/lib/input/gamepad-provider.d.ts.map +0 -1
  279. package/dist/lib/input/gamepad-provider.js +0 -58
  280. package/dist/lib/input/input-manager.d.ts +0 -15
  281. package/dist/lib/input/input-manager.d.ts.map +0 -1
  282. package/dist/lib/input/input-manager.js +0 -70
  283. package/dist/lib/input/input-provider.d.ts +0 -7
  284. package/dist/lib/input/input-provider.d.ts.map +0 -1
  285. package/dist/lib/input/input.d.ts +0 -48
  286. package/dist/lib/input/input.d.ts.map +0 -1
  287. package/dist/lib/input/keyboard-provider.d.ts +0 -21
  288. package/dist/lib/input/keyboard-provider.d.ts.map +0 -1
  289. package/dist/lib/input/keyboard-provider.js +0 -120
  290. package/dist/lib/interfaces/entity.d.ts +0 -26
  291. package/dist/lib/interfaces/entity.d.ts.map +0 -1
  292. package/dist/lib/sounds/index.d.ts +0 -3
  293. package/dist/lib/sounds/index.d.ts.map +0 -1
  294. package/dist/lib/sounds/ping-pong-sound.d.ts +0 -5
  295. package/dist/lib/sounds/ping-pong-sound.d.ts.map +0 -1
  296. package/dist/lib/sounds/ricochet-sound.d.ts +0 -5
  297. package/dist/lib/sounds/ricochet-sound.d.ts.map +0 -1
  298. package/dist/lib/stage/debug-entity-cursor.d.ts +0 -24
  299. package/dist/lib/stage/debug-entity-cursor.d.ts.map +0 -1
  300. package/dist/lib/stage/debug-entity-cursor.js +0 -53
  301. package/dist/lib/stage/entity-spawner.d.ts +0 -9
  302. package/dist/lib/stage/entity-spawner.d.ts.map +0 -1
  303. package/dist/lib/stage/entity-spawner.js +0 -27
  304. package/dist/lib/stage/stage-blueprint.d.ts +0 -45
  305. package/dist/lib/stage/stage-blueprint.d.ts.map +0 -1
  306. package/dist/lib/stage/stage-blueprint.js +0 -56
  307. package/dist/lib/stage/stage-camera-debug-delegate.d.ts +0 -14
  308. package/dist/lib/stage/stage-camera-debug-delegate.d.ts.map +0 -1
  309. package/dist/lib/stage/stage-debug-delegate.d.ts +0 -26
  310. package/dist/lib/stage/stage-debug-delegate.d.ts.map +0 -1
  311. package/dist/lib/stage/stage-debug-delegate.js +0 -100
  312. package/dist/lib/stage/stage-default.d.ts +0 -3
  313. package/dist/lib/stage/stage-default.d.ts.map +0 -1
  314. package/dist/lib/stage/stage-default.js +0 -32
  315. package/dist/lib/stage/stage-state.d.ts +0 -14
  316. package/dist/lib/stage/stage-state.d.ts.map +0 -1
  317. package/dist/lib/stage/stage-state.js +0 -36
  318. package/dist/lib/stage/stage.d.ts +0 -33
  319. package/dist/lib/stage/stage.d.ts.map +0 -1
  320. package/dist/lib/stage/stage.js +0 -60
  321. package/dist/lib/stage/zylem-stage.d.ts +0 -128
  322. package/dist/lib/stage/zylem-stage.d.ts.map +0 -1
  323. package/dist/lib/stage/zylem-stage.js +0 -268
  324. package/dist/lib/systems/test-system.d.ts +0 -2
  325. package/dist/lib/systems/test-system.d.ts.map +0 -1
  326. package/dist/lib/systems/transformable.system.d.ts +0 -25
  327. package/dist/lib/systems/transformable.system.d.ts.map +0 -1
  328. package/dist/lib/systems/transformable.system.js +0 -43
  329. package/dist/lib/types/entity-types.d.ts +0 -24
  330. package/dist/lib/types/entity-types.d.ts.map +0 -1
  331. package/dist/lib/types/index.d.ts +0 -3
  332. package/dist/lib/types/index.d.ts.map +0 -1
  333. package/dist/lib/types/stage-types.d.ts +0 -26
  334. package/dist/lib/types/stage-types.d.ts.map +0 -1
  335. package/dist/lib/ui/Debug.d.ts +0 -6
  336. package/dist/lib/ui/Debug.d.ts.map +0 -1
  337. package/dist/lib/ui/console/Console.d.ts +0 -7
  338. package/dist/lib/ui/console/Console.d.ts.map +0 -1
  339. package/dist/lib/ui/debug-panel/AccordionMenu.d.ts +0 -7
  340. package/dist/lib/ui/debug-panel/AccordionMenu.d.ts.map +0 -1
  341. package/dist/lib/ui/debug-panel/Menu.d.ts +0 -6
  342. package/dist/lib/ui/debug-panel/Menu.d.ts.map +0 -1
  343. package/dist/lib/ui/debug-panel/sections/EntitiesSection.d.ts +0 -4
  344. package/dist/lib/ui/debug-panel/sections/EntitiesSection.d.ts.map +0 -1
  345. package/dist/lib/ui/debug-panel/sections/GameSection.d.ts +0 -3
  346. package/dist/lib/ui/debug-panel/sections/GameSection.d.ts.map +0 -1
  347. package/dist/lib/ui/debug-panel/sections/StagesSection.d.ts +0 -3
  348. package/dist/lib/ui/debug-panel/sections/StagesSection.d.ts.map +0 -1
  349. package/dist/lib/ui/debug-panel/sections/all.d.ts +0 -4
  350. package/dist/lib/ui/debug-panel/sections/all.d.ts.map +0 -1
  351. package/dist/lib/ui/toolbar/Toolbar.d.ts +0 -6
  352. package/dist/lib/ui/toolbar/Toolbar.d.ts.map +0 -1
  353. package/dist/tests/integration/debug.sim.spec.d.ts +0 -2
  354. package/dist/tests/integration/debug.sim.spec.d.ts.map +0 -1
  355. package/dist/tests/unit/collision/collision.spec.d.ts +0 -2
  356. package/dist/tests/unit/collision/collision.spec.d.ts.map +0 -1
  357. package/dist/tests/unit/core/game.spec.d.ts +0 -2
  358. package/dist/tests/unit/core/game.spec.d.ts.map +0 -1
  359. package/dist/tests/unit/core/stage.spec.d.ts +0 -2
  360. package/dist/tests/unit/core/stage.spec.d.ts.map +0 -1
  361. package/dist/tests/unit/core/vessel.spec.d.ts +0 -2
  362. package/dist/tests/unit/core/vessel.spec.d.ts.map +0 -1
@@ -1,13 +0,0 @@
1
- import { BaseNode } from '../base-node';
2
- import { Stage } from '../../stage/stage';
3
- import { GameEntityLifeCycle } from '../../entities/entity';
4
- import { BaseGlobals, ZylemGameConfig } from '../../game/game-interfaces';
5
- import { GameConfigLike } from '~/lib/game/game-config';
6
- export type GameOptions<TGlobals extends BaseGlobals> = Array<ZylemGameConfig<Stage, any, TGlobals> | GameConfigLike | Stage | GameEntityLifeCycle | BaseNode>;
7
- export declare function convertNodes<TGlobals extends BaseGlobals>(_options: GameOptions<TGlobals>): Promise<{
8
- id: string;
9
- globals: TGlobals;
10
- stages: Stage[];
11
- }>;
12
- export declare function hasStages<TGlobals extends BaseGlobals>(_options: GameOptions<TGlobals>): Boolean;
13
- //# sourceMappingURL=nodes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/utility/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAc,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAMxD,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,WAAW,IAAI,KAAK,CAC5D,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,GACrC,cAAc,GACd,KAAK,GACL,mBAAmB,GACnB,QAAQ,CACR,CAAC;AAEF,wBAAsB,YAAY,CAAC,QAAQ,SAAS,WAAW,EAC9D,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAAC,GAC7B,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,KAAK,EAAE,CAAA;CAAE,CAAC,CAgC7D;AAED,wBAAgB,SAAS,CAAC,QAAQ,SAAS,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAGhG"}
@@ -1,31 +0,0 @@
1
- import { BaseNode as r } from "../base-node.js";
2
- import { Stage as c } from "../../stage/stage.js";
3
- import { GameEntity as g } from "../../entities/entity.js";
4
- async function h(i) {
5
- const { getGameDefaultConfig: n } = await import("../../game/game-default.js");
6
- let s = { ...n() };
7
- const o = [], e = [], a = [];
8
- return Object.values(i).forEach((t) => {
9
- if (t instanceof c)
10
- e.push(t);
11
- else if (t instanceof g)
12
- a.push(t);
13
- else if (t instanceof r)
14
- a.push(t);
15
- else if (t?.constructor?.name === "Object" && typeof t == "object") {
16
- const f = Object.assign({ ...n() }, { ...t });
17
- o.push(f);
18
- }
19
- }), o.forEach((t) => {
20
- s = Object.assign(s, { ...t });
21
- }), e.forEach((t) => {
22
- t.addEntities(a);
23
- }), e.length ? s.stages = e : s.stages[0].addEntities(a), s;
24
- }
25
- function l(i) {
26
- return !!i.find((s) => s instanceof c);
27
- }
28
- export {
29
- h as convertNodes,
30
- l as hasStages
31
- };
@@ -1,3 +0,0 @@
1
- export declare function sortedStringify(obj: Record<string, any>): string;
2
- export declare function shortHash(objString: string): string;
3
- //# sourceMappingURL=strings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/utility/strings.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,UASvD;AAED,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,UAM1C"}
@@ -1,14 +0,0 @@
1
- function o(r) {
2
- const e = Object.keys(r).sort().reduce((t, n) => (t[n] = r[n], t), {});
3
- return JSON.stringify(e);
4
- }
5
- function s(r) {
6
- let e = 0;
7
- for (let t = 0; t < r.length; t++)
8
- e = Math.imul(31, e) + r.charCodeAt(t) | 0;
9
- return e.toString(36);
10
- }
11
- export {
12
- s as shortHash,
13
- o as sortedStringify
14
- };
@@ -1,8 +0,0 @@
1
- import { Color, Vector3 as ThreeVector3 } from 'three';
2
- import { Vector3 } from '@dimforge/rapier3d-compat';
3
- /**
4
- * @deprecated This type is deprecated.
5
- */
6
- export type Vect3 = ThreeVector3 | Vector3;
7
- export declare const ZylemBlueColor: Color;
8
- //# sourceMappingURL=vector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/utility/vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAGpD;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,YAAY,GAAG,OAAO,CAAC;AAE3C,eAAO,MAAM,cAAc,OAAuB,CAAC"}
@@ -1,8 +0,0 @@
1
- import { Color as r } from "three";
2
- import { Vector3 as o } from "@dimforge/rapier3d-compat";
3
- const t = new r("#0333EC");
4
- new o(0, 0, 0);
5
- new o(1, 1, 1);
6
- export {
7
- t as ZylemBlueColor
8
- };
@@ -1,4 +0,0 @@
1
- import { Vector3 as ThreeVector3 } from 'three';
2
- import { Vector3 as RapierVector3 } from '@dimforge/rapier3d-compat';
3
- export type Vec3 = ThreeVector3 | RapierVector3;
4
- //# sourceMappingURL=vector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vector.d.ts","sourceRoot":"","sources":["../../../src/lib/core/vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,MAAM,IAAI,GAAG,YAAY,GAAG,aAAa,CAAC"}
@@ -1,13 +0,0 @@
1
- import { BaseNode } from './base-node';
2
- import { SetupContext, UpdateContext, DestroyContext, LoadedContext, CleanupContext } from './base-node-life-cycle';
3
- export declare class Vessel extends BaseNode<{}, Vessel> {
4
- static type: symbol;
5
- protected _setup(_params: SetupContext<this>): void;
6
- protected _loaded(_params: LoadedContext<this>): Promise<void>;
7
- protected _update(_params: UpdateContext<this>): void;
8
- protected _destroy(_params: DestroyContext<this>): void;
9
- protected _cleanup(_params: CleanupContext<this>): Promise<void>;
10
- create(): this;
11
- }
12
- export declare function vessel(...args: Array<BaseNode>): BaseNode<{}, Vessel>;
13
- //# sourceMappingURL=vessel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vessel.d.ts","sourceRoot":"","sources":["../../../src/lib/core/vessel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACN,YAAY,EACZ,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,MAAM,wBAAwB,CAAC;AAIhC,qBAAa,MAAO,SAAQ,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAC/C,MAAM,CAAC,IAAI,SAAe;IAE1B,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,IAAI;cAEnC,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAEpE,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI;IAErD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;cAEvC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAE/D,MAAM,IAAI,IAAI;CAGrB;AAED,wBAAgB,MAAM,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAIrE"}
@@ -1,26 +0,0 @@
1
- import { BaseNode as t } from "./base-node.js";
2
- const r = Symbol("vessel");
3
- class n extends t {
4
- static type = r;
5
- _setup(s) {
6
- }
7
- async _loaded(s) {
8
- }
9
- _update(s) {
10
- }
11
- _destroy(s) {
12
- }
13
- async _cleanup(s) {
14
- }
15
- create() {
16
- return this;
17
- }
18
- }
19
- function o(...e) {
20
- const s = new n();
21
- return e.forEach((a) => s.add(a)), s;
22
- }
23
- export {
24
- n as Vessel,
25
- o as vessel
26
- };
@@ -1,20 +0,0 @@
1
- /**
2
- * Console state for managing debug console messages
3
- */
4
- export declare const consoleState: {
5
- messages: string[];
6
- };
7
- /**
8
- * Append a message to the debug console
9
- * @param message The message to append to the console
10
- */
11
- export declare const printToConsole: (message: string) => void;
12
- /**
13
- * Clear all messages from the debug console
14
- */
15
- export declare const clearConsole: () => void;
16
- /**
17
- * Get all console messages as a single string
18
- */
19
- export declare const getConsoleContent: () => string;
20
- //# sourceMappingURL=console-state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console-state.d.ts","sourceRoot":"","sources":["../../../../src/lib/debug/console/console-state.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,YAAY;cACR,MAAM,EAAE;CACvB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,SAI7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,YAExB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,cAE7B,CAAC"}
@@ -1,11 +0,0 @@
1
- import { proxy as s } from "valtio/vanilla";
2
- const o = s({
3
- messages: []
4
- }), n = (t) => {
5
- const e = `[${(/* @__PURE__ */ new Date()).toLocaleTimeString()}] ${t}`;
6
- o.messages.push(e);
7
- };
8
- export {
9
- o as consoleState,
10
- n as printToConsole
11
- };
@@ -1,6 +0,0 @@
1
- export declare const consoleStore: {
2
- messages: string[];
3
- }, setConsoleStore: import("solid-js/store").SetStoreFunction<{
4
- messages: string[];
5
- }>;
6
- //# sourceMappingURL=console-store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console-store.d.ts","sourceRoot":"","sources":["../../../../src/lib/debug/console/console-store.ts"],"names":[],"mappings":"AAIA,eAAO,MAAO,YAAY;cACT,MAAM,EAAE;GADG,eAAe;cAC1B,MAAM,EAAE;EACvB,CAAC"}
@@ -1,38 +0,0 @@
1
- export declare const DebugTools: {
2
- readonly NONE: "NONE";
3
- readonly SELECT: "SELECT";
4
- readonly ADD: "ADD";
5
- readonly DELETE: "DELETE";
6
- };
7
- declare const debugState: {
8
- on: boolean;
9
- paused: boolean;
10
- configuration: {
11
- showCollisionBounds: boolean;
12
- showModelBounds: boolean;
13
- showSpriteBounds: boolean;
14
- };
15
- hovered: string | null;
16
- selected: string[];
17
- tool: keyof typeof DebugTools;
18
- };
19
- declare const setDebugFlag: (flag?: boolean) => void;
20
- declare const setSelectedEntity: (uuid: string) => void;
21
- /**
22
- * Set the active debug tool and print the selection to the debug console.
23
- * @param tool The tool to activate
24
- */
25
- declare const setDebugTool: (tool: keyof typeof DebugTools) => void;
26
- declare const getDebugTool: () => "NONE" | "SELECT" | "ADD" | "DELETE";
27
- declare const setHoveredEntity: (uuid: string) => void;
28
- declare const resetHoveredEntity: () => void;
29
- declare const getHoveredEntity: () => string | null;
30
- export { debugState, setDebugFlag, setSelectedEntity, setDebugTool, getDebugTool, setHoveredEntity, resetHoveredEntity, getHoveredEntity };
31
- export declare const togglePause: () => void;
32
- /**
33
- * Set pause state directly and print the new state to the console.
34
- * @param paused Whether to pause (true) or resume (false)
35
- */
36
- export declare const setPaused: (paused: boolean) => void;
37
- export declare const isPaused: () => boolean;
38
- //# sourceMappingURL=debug-state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-state.d.ts","sourceRoot":"","sources":["../../../src/lib/debug/debug-state.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AAEX,QAAA,MAAM,UAAU;;;;;;;;aAQE,MAAM,GAAG,IAAI;cACd,MAAM,EAAE;UACC,MAAM,OAAO,UAAU;CAC/C,CAAC;AAEH,QAAA,MAAM,YAAY,GAAI,OAAM,OAAe,SAE1C,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,MAAM,MAAM,SAEtC,CAAA;AAMD;;;GAGG;AACH,QAAA,MAAM,YAAY,GAAI,MAAM,MAAM,OAAO,UAAU,SAQlD,CAAA;AAED,QAAA,MAAM,YAAY,4CAEjB,CAAA;AAED,QAAA,MAAM,gBAAgB,GAAI,MAAM,MAAM,SAErC,CAAA;AAED,QAAA,MAAM,kBAAkB,YAEvB,CAAA;AAED,QAAA,MAAM,gBAAgB,qBAErB,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAG,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC;AAE5I,eAAO,MAAM,WAAW,YAGvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,QAAQ,OAAO,SAGxC,CAAC;AAEF,eAAO,MAAM,QAAQ,eAA0B,CAAC"}
@@ -1,40 +0,0 @@
1
- import { proxy as s } from "valtio/vanilla";
2
- import { printToConsole as t } from "./console/console-state.js";
3
- const n = {
4
- NONE: "NONE",
5
- SELECT: "SELECT",
6
- DELETE: "DELETE"
7
- }, o = s({
8
- on: !1,
9
- paused: !1,
10
- configuration: {
11
- showCollisionBounds: !1,
12
- showModelBounds: !1,
13
- showSpriteBounds: !1
14
- },
15
- hovered: null,
16
- selected: [],
17
- tool: n.NONE
18
- }), r = (e = !1) => {
19
- o.on = e;
20
- }, u = (e) => {
21
- o.selected.push(e);
22
- }, E = () => o.tool, a = (e) => {
23
- o.hovered = e;
24
- }, c = () => {
25
- o.hovered = null;
26
- }, i = () => o.hovered, f = (e) => {
27
- o.paused = e, t(e ? "Paused" : "Resumed");
28
- }, p = () => o.paused;
29
- export {
30
- n as DebugTools,
31
- o as debugState,
32
- E as getDebugTool,
33
- i as getHoveredEntity,
34
- p as isPaused,
35
- c as resetHoveredEntity,
36
- r as setDebugFlag,
37
- a as setHoveredEntity,
38
- f as setPaused,
39
- u as setSelectedEntity
40
- };
@@ -1,15 +0,0 @@
1
- import { DebugTools } from './debug-state';
2
- export declare const debugStore: {
3
- debug: boolean;
4
- tool: keyof typeof DebugTools;
5
- paused: boolean;
6
- hovered: string | null;
7
- selected: string[];
8
- }, setDebugStore: import("solid-js/store").SetStoreFunction<{
9
- debug: boolean;
10
- tool: keyof typeof DebugTools;
11
- paused: boolean;
12
- hovered: string | null;
13
- selected: string[];
14
- }>;
15
- //# sourceMappingURL=debug-store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-store.d.ts","sourceRoot":"","sources":["../../../src/lib/debug/debug-store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAc,MAAM,eAAe,CAAC;AAEvD,eAAO,MAAO,UAAU;;UAEE,MAAM,OAAO,UAAU;;aAE/B,MAAM,GAAG,IAAI;cACd,MAAM,EAAE;GALC,aAAa;;UAEb,MAAM,OAAO,UAAU;;aAE/B,MAAM,GAAG,IAAI;cACd,MAAM,EAAE;EACvB,CAAC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * State-Based Debug Module Loader
3
- *
4
- * This approach integrates with the existing debug state system
5
- * and loads the debug module when debug state changes to true.
6
- */
7
- export {};
8
- //# sourceMappingURL=state-based-debug-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state-based-debug-loader.d.ts","sourceRoot":"","sources":["../../../src/lib/debug/state-based-debug-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -1,38 +0,0 @@
1
- export declare const AspectRatio: {
2
- readonly FourByThree: number;
3
- readonly SixteenByNine: number;
4
- readonly TwentyOneByNine: number;
5
- readonly OneByOne: number;
6
- };
7
- export type AspectRatioValue = (typeof AspectRatio)[keyof typeof AspectRatio] | number;
8
- /**
9
- * AspectRatioDelegate manages sizing a canvas to fit within a container
10
- * while preserving a target aspect ratio. It notifies a consumer via
11
- * onResize when the final width/height are applied so renderers/cameras
12
- * can update their viewports.
13
- */
14
- export declare class AspectRatioDelegate {
15
- container: HTMLElement;
16
- canvas: HTMLCanvasElement;
17
- aspectRatio: number;
18
- onResize?: (width: number, height: number) => void;
19
- private handleResizeBound;
20
- constructor(params: {
21
- container: HTMLElement;
22
- canvas: HTMLCanvasElement;
23
- aspectRatio: AspectRatioValue;
24
- onResize?: (width: number, height: number) => void;
25
- });
26
- /** Attach window resize listener and apply once. */
27
- attach(): void;
28
- /** Detach window resize listener. */
29
- detach(): void;
30
- /** Compute the largest size that fits container while preserving aspect. */
31
- measure(): {
32
- width: number;
33
- height: number;
34
- };
35
- /** Apply measured size to canvas and notify. */
36
- apply(): void;
37
- }
38
- //# sourceMappingURL=aspect-ratio.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aspect-ratio.d.ts","sourceRoot":"","sources":["../../../src/lib/device/aspect-ratio.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,GAAG,MAAM,CAAC;AAEvF;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC/B,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,OAAO,CAAC,iBAAiB,CAAa;gBAE1B,MAAM,EAAE;QACnB,SAAS,EAAE,WAAW,CAAC;QACvB,MAAM,EAAE,iBAAiB,CAAC;QAC1B,WAAW,EAAE,gBAAgB,CAAC;QAC9B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;KACnD;IAQD,oDAAoD;IACpD,MAAM;IAKN,qCAAqC;IACrC,MAAM;IAIN,4EAA4E;IAC5E,OAAO,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAkB5C,gDAAgD;IAChD,KAAK;CAOL"}
@@ -1,44 +0,0 @@
1
- const h = {
2
- FourByThree: 1.3333333333333333,
3
- SixteenByNine: 1.7777777777777777,
4
- TwentyOneByNine: 2.3333333333333335,
5
- OneByOne: 1
6
- };
7
- class a {
8
- container;
9
- canvas;
10
- aspectRatio;
11
- onResize;
12
- handleResizeBound;
13
- constructor(t) {
14
- this.container = t.container, this.canvas = t.canvas, this.aspectRatio = (typeof t.aspectRatio == "number", t.aspectRatio), this.onResize = t.onResize, this.handleResizeBound = this.apply.bind(this);
15
- }
16
- /** Attach window resize listener and apply once. */
17
- attach() {
18
- window.addEventListener("resize", this.handleResizeBound), this.apply();
19
- }
20
- /** Detach window resize listener. */
21
- detach() {
22
- window.removeEventListener("resize", this.handleResizeBound);
23
- }
24
- /** Compute the largest size that fits container while preserving aspect. */
25
- measure() {
26
- const t = this.container.clientWidth || window.innerWidth, e = this.container.clientHeight || window.innerHeight;
27
- if (t / e > this.aspectRatio) {
28
- const i = e;
29
- return { width: Math.round(i * this.aspectRatio), height: i };
30
- } else {
31
- const i = t, n = Math.round(i / this.aspectRatio);
32
- return { width: i, height: n };
33
- }
34
- }
35
- /** Apply measured size to canvas and notify. */
36
- apply() {
37
- const { width: t, height: e } = this.measure();
38
- this.canvas.style.width = `${t}px`, this.canvas.style.height = `${e}px`, this.onResize?.(t, e);
39
- }
40
- }
41
- export {
42
- h as AspectRatio,
43
- a as AspectRatioDelegate
44
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=desktop.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"desktop.d.ts","sourceRoot":"","sources":["../../../src/lib/device/desktop.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export declare function isMobile(): boolean;
2
- //# sourceMappingURL=mobile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mobile.d.ts","sourceRoot":"","sources":["../../../src/lib/device/mobile.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,YAKvB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=tablet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tablet.d.ts","sourceRoot":"","sources":["../../../src/lib/device/tablet.ts"],"names":[],"mappings":""}
@@ -1,44 +0,0 @@
1
- import { Object3D } from 'three';
2
- import { BaseNode } from '../core/base-node';
3
- import { GameEntityOptions, GameEntity } from './entity';
4
- import { UpdateContext } from '../core/base-node-life-cycle';
5
- import { EntityLoaderDelegate } from './delegates/loader';
6
- import { Vec3 } from '../core/vector';
7
- import { AnimationOptions } from './delegates/animation';
8
- import { MaterialOptions } from '../graphics/material';
9
- import { DebugInfoProvider } from './delegates/debug';
10
- type AnimationObject = {
11
- key?: string;
12
- path: string;
13
- };
14
- type ZylemActorOptions = GameEntityOptions & {
15
- static?: boolean;
16
- animations?: AnimationObject[];
17
- models?: string[];
18
- scale?: Vec3;
19
- material?: MaterialOptions;
20
- };
21
- export declare class ZylemActor extends GameEntity<ZylemActorOptions> implements EntityLoaderDelegate, DebugInfoProvider {
22
- static type: symbol;
23
- private _object;
24
- private _animationDelegate;
25
- private _modelFileNames;
26
- private _assetLoader;
27
- controlledRotation: boolean;
28
- constructor(options?: ZylemActorOptions);
29
- load(): Promise<void>;
30
- data(): Promise<any>;
31
- actorUpdate(params: UpdateContext<ZylemActorOptions>): Promise<void>;
32
- private loadModels;
33
- playAnimation(animationOptions: AnimationOptions): void;
34
- get object(): Object3D | null;
35
- /**
36
- * Provide custom debug information for the actor
37
- * This will be merged with the default debug information
38
- */
39
- getDebugInfo(): Record<string, any>;
40
- }
41
- type ActorOptions = BaseNode | ZylemActorOptions;
42
- export declare function actor(...args: Array<ActorOptions>): Promise<ZylemActor>;
43
- export {};
44
- //# sourceMappingURL=actor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../../src/lib/entities/actor.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,QAAQ,EAA+B,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAkB,MAAM,8BAA8B,CAAC;AAE7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAqB,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD,KAAK,eAAe,GAAG;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,KAAK,iBAAiB,GAAG,iBAAiB,GAAG;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC3B,CAAC;AA+DF,qBAAa,UAAW,SAAQ,UAAU,CAAC,iBAAiB,CAAE,YAAW,oBAAoB,EAAE,iBAAiB;IAC/G,MAAM,CAAC,IAAI,SAAc;IAEzB,OAAO,CAAC,OAAO,CAAyB;IACxC,OAAO,CAAC,kBAAkB,CAAkC;IAC5D,OAAO,CAAC,eAAe,CAAgB;IACvC,OAAO,CAAC,YAAY,CAA8C;IAElE,kBAAkB,EAAE,OAAO,CAAS;gBAExB,OAAO,CAAC,EAAE,iBAAiB;IASjC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IASrB,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC;IAOpB,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;YAI5D,UAAU;IAkBxB,aAAa,CAAC,gBAAgB,EAAE,gBAAgB;IAIhD,IAAI,MAAM,IAAI,QAAQ,GAAG,IAAI,CAE5B;IAED;;;OAGG;IACH,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAmCnC;AAED,KAAK,YAAY,GAAG,QAAQ,GAAG,iBAAiB,CAAC;AAEjD,wBAAsB,KAAK,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAS7E"}
@@ -1,122 +0,0 @@
1
- import { ColliderDesc as l, ActiveCollisionTypes as m } from "@dimforge/rapier3d-compat";
2
- import { Vector3 as r, Group as d, SkinnedMesh as u } from "three";
3
- import { GameEntity as p } from "./entity.js";
4
- import { createEntity as g } from "./create.js";
5
- import { EntityAssetLoader as y } from "../core/entity-asset-loader.js";
6
- import { AnimationDelegate as f } from "./delegates/animation.js";
7
- import { EntityCollisionBuilder as b, EntityBuilder as _ } from "./builder.js";
8
- const c = {
9
- position: { x: 0, y: 0, z: 0 },
10
- collision: {
11
- static: !1,
12
- size: new r(0.5, 0.5, 0.5),
13
- position: new r(0, 0, 0)
14
- },
15
- material: {
16
- shader: "standard"
17
- },
18
- animations: [],
19
- models: []
20
- };
21
- class j extends b {
22
- height = 1;
23
- objectModel = null;
24
- constructor(t) {
25
- super(), this.objectModel = t.objectModel;
26
- }
27
- createColliderFromObjectModel(t) {
28
- if (!t)
29
- return l.capsule(1, 1);
30
- const e = t.children.find((s) => s instanceof u).geometry;
31
- if (e && (e.computeBoundingBox(), e.boundingBox)) {
32
- const s = e.boundingBox.max.y, h = e.boundingBox.min.y;
33
- this.height = s - h;
34
- }
35
- this.height = 1;
36
- let o = l.capsule(this.height / 2, 1);
37
- return o.setSensor(!1), o.setTranslation(0, this.height + 0.5, 0), o.activeCollisionTypes = m.DEFAULT, o;
38
- }
39
- collider(t) {
40
- return this.createColliderFromObjectModel(this.objectModel);
41
- }
42
- }
43
- class C extends _ {
44
- createEntity(t) {
45
- return new a(t);
46
- }
47
- }
48
- const D = Symbol("Actor");
49
- class a extends p {
50
- static type = D;
51
- _object = null;
52
- _animationDelegate = null;
53
- _modelFileNames = [];
54
- _assetLoader = new y();
55
- controlledRotation = !1;
56
- constructor(t) {
57
- super(), this.options = { ...c, ...t }, this.lifeCycleDelegate = {
58
- update: [this.actorUpdate.bind(this)]
59
- }, this.controlledRotation = !0;
60
- }
61
- async load() {
62
- this._modelFileNames = this.options.models || [], await this.loadModels(), this._object && (this._animationDelegate = new f(this._object), await this._animationDelegate.loadAnimations(this.options.animations || []));
63
- }
64
- async data() {
65
- return {
66
- animations: this._animationDelegate?.animations,
67
- objectModel: this._object
68
- };
69
- }
70
- async actorUpdate(t) {
71
- this._animationDelegate?.update(t.delta);
72
- }
73
- async loadModels() {
74
- if (this._modelFileNames.length === 0)
75
- return;
76
- const t = this._modelFileNames.map((e) => this._assetLoader.loadFile(e)), i = await Promise.all(t);
77
- i[0]?.object && (this._object = i[0].object), this._object && (this.group = new d(), this.group.attach(this._object), this.group.scale.set(this.options.scale?.x || 1, this.options.scale?.y || 1, this.options.scale?.z || 1));
78
- }
79
- playAnimation(t) {
80
- this._animationDelegate?.playAnimation(t);
81
- }
82
- get object() {
83
- return this._object;
84
- }
85
- /**
86
- * Provide custom debug information for the actor
87
- * This will be merged with the default debug information
88
- */
89
- getDebugInfo() {
90
- const t = {
91
- type: "Actor",
92
- models: this._modelFileNames.length > 0 ? this._modelFileNames : "none",
93
- modelLoaded: !!this._object,
94
- scale: this.options.scale ? `${this.options.scale.x}, ${this.options.scale.y}, ${this.options.scale.z}` : "1, 1, 1"
95
- };
96
- if (this._animationDelegate && (t.currentAnimation = this._animationDelegate.currentAnimationKey || "none", t.animationsCount = this.options.animations?.length || 0), this._object) {
97
- let i = 0, e = 0;
98
- this._object.traverse((o) => {
99
- if (o.isMesh) {
100
- i++;
101
- const s = o.geometry;
102
- s && s.attributes.position && (e += s.attributes.position.count);
103
- }
104
- }), t.meshCount = i, t.vertexCount = e;
105
- }
106
- return t;
107
- }
108
- }
109
- async function T(...n) {
110
- return await g({
111
- args: n,
112
- defaultConfig: c,
113
- EntityClass: a,
114
- BuilderClass: C,
115
- CollisionBuilderClass: j,
116
- entityType: a.type
117
- });
118
- }
119
- export {
120
- a as ZylemActor,
121
- T as actor
122
- };
@@ -1,27 +0,0 @@
1
- import { ColliderDesc } from '@dimforge/rapier3d-compat';
2
- import { BoxGeometry } from 'three';
3
- import { BaseNode } from '../core/base-node';
4
- import { GameEntityOptions, GameEntity } from './entity';
5
- import { EntityBuilder } from './builder';
6
- import { EntityCollisionBuilder } from './builder';
7
- import { EntityMeshBuilder } from './builder';
8
- type ZylemBoxOptions = GameEntityOptions;
9
- export declare class BoxCollisionBuilder extends EntityCollisionBuilder {
10
- collider(options: GameEntityOptions): ColliderDesc;
11
- }
12
- export declare class BoxMeshBuilder extends EntityMeshBuilder {
13
- build(options: GameEntityOptions): BoxGeometry;
14
- }
15
- export declare class BoxBuilder extends EntityBuilder<ZylemBox, ZylemBoxOptions> {
16
- protected createEntity(options: Partial<ZylemBoxOptions>): ZylemBox;
17
- }
18
- export declare const BOX_TYPE: unique symbol;
19
- export declare class ZylemBox extends GameEntity<ZylemBoxOptions> {
20
- static type: symbol;
21
- constructor(options?: ZylemBoxOptions);
22
- buildInfo(): Record<string, any>;
23
- }
24
- type BoxOptions = BaseNode | ZylemBoxOptions;
25
- export declare function box(...args: Array<BoxOptions>): Promise<ZylemBox>;
26
- export {};
27
- //# sourceMappingURL=box.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../src/lib/entities/box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAS,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI9C,KAAK,eAAe,GAAG,iBAAiB,CAAC;AAczC,qBAAa,mBAAoB,SAAQ,sBAAsB;IAC9D,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,YAAY;CAMlD;AAED,qBAAa,cAAe,SAAQ,iBAAiB;IACpD,KAAK,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW;CAI9C;AAED,qBAAa,UAAW,SAAQ,aAAa,CAAC,QAAQ,EAAE,eAAe,CAAC;IACvE,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,QAAQ;CAGnE;AAED,eAAO,MAAM,QAAQ,eAAgB,CAAC;AAEtC,qBAAa,QAAS,SAAQ,UAAU,CAAC,eAAe,CAAC;IACxD,MAAM,CAAC,IAAI,SAAY;gBAEX,OAAO,CAAC,EAAE,eAAe;IAKrC,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAWhC;AAED,KAAK,UAAU,GAAG,QAAQ,GAAG,eAAe,CAAC;AAE7C,wBAAsB,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAUvE"}