@zylem/game-lib 0.5.0 → 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 (441) 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/{src/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 -4
  28. package/dist/stage.js.map +1 -0
  29. package/dist/transformable-CUhvyuYO.d.ts +67 -0
  30. package/package.json +9 -45
  31. package/LICENSE +0 -21
  32. package/dist/.vite/manifest.json +0 -716
  33. package/dist/assets/zylem-logo.png +0 -0
  34. package/dist/examples/00-readme-example.d.ts +0 -2
  35. package/dist/examples/00-readme-example.d.ts.map +0 -1
  36. package/dist/examples/01-basic.d.ts +0 -2
  37. package/dist/examples/01-basic.d.ts.map +0 -1
  38. package/dist/examples/01.1-basic-ball.d.ts +0 -9
  39. package/dist/examples/01.1-basic-ball.d.ts.map +0 -1
  40. package/dist/examples/01.2-ricochet-test.d.ts +0 -2
  41. package/dist/examples/01.2-ricochet-test.d.ts.map +0 -1
  42. package/dist/examples/01.3-rect.d.ts +0 -2
  43. package/dist/examples/01.3-rect.d.ts.map +0 -1
  44. package/dist/examples/02-input.d.ts +0 -2
  45. package/dist/examples/02-input.d.ts.map +0 -1
  46. package/dist/examples/03-stage-test/03-stage-test.d.ts +0 -2
  47. package/dist/examples/03-stage-test/03-stage-test.d.ts.map +0 -1
  48. package/dist/examples/03-stage-test/stage0.d.ts +0 -2
  49. package/dist/examples/03-stage-test/stage0.d.ts.map +0 -1
  50. package/dist/examples/03-stage-test/stage1.d.ts +0 -2
  51. package/dist/examples/03-stage-test/stage1.d.ts.map +0 -1
  52. package/dist/examples/03-stage-test/stage2.d.ts +0 -2
  53. package/dist/examples/03-stage-test/stage2.d.ts.map +0 -1
  54. package/dist/examples/03-stage-test/stage3.d.ts +0 -2
  55. package/dist/examples/03-stage-test/stage3.d.ts.map +0 -1
  56. package/dist/examples/03.1-stage-variable.d.ts +0 -2
  57. package/dist/examples/03.1-stage-variable.d.ts.map +0 -1
  58. package/dist/examples/04-vessel-test.d.ts +0 -18
  59. package/dist/examples/04-vessel-test.d.ts.map +0 -1
  60. package/dist/examples/05-camera-test.d.ts +0 -2
  61. package/dist/examples/05-camera-test.d.ts.map +0 -1
  62. package/dist/examples/06-entity-test.d.ts +0 -2
  63. package/dist/examples/06-entity-test.d.ts.map +0 -1
  64. package/dist/examples/07-behaviors.d.ts +0 -2
  65. package/dist/examples/07-behaviors.d.ts.map +0 -1
  66. package/dist/examples/07.01-behavior-context.d.ts +0 -2
  67. package/dist/examples/07.01-behavior-context.d.ts.map +0 -1
  68. package/dist/examples/08-pong.d.ts +0 -2
  69. package/dist/examples/08-pong.d.ts.map +0 -1
  70. package/dist/examples/08.01-breakout.d.ts +0 -2
  71. package/dist/examples/08.01-breakout.d.ts.map +0 -1
  72. package/dist/examples/09-space-invaders.d.ts +0 -2
  73. package/dist/examples/09-space-invaders.d.ts.map +0 -1
  74. package/dist/examples/10-asteroids.d.ts +0 -2
  75. package/dist/examples/10-asteroids.d.ts.map +0 -1
  76. package/dist/examples/11-2d-platformer.d.ts +0 -2
  77. package/dist/examples/11-2d-platformer.d.ts.map +0 -1
  78. package/dist/examples/12-3d-platformer.d.ts +0 -2
  79. package/dist/examples/12-3d-platformer.d.ts.map +0 -1
  80. package/dist/examples/13-fps.d.ts +0 -2
  81. package/dist/examples/13-fps.d.ts.map +0 -1
  82. package/dist/examples/14-strategy.d.ts +0 -2
  83. package/dist/examples/14-strategy.d.ts.map +0 -1
  84. package/dist/examples/15-zylem-planet-demo.d.ts +0 -2
  85. package/dist/examples/15-zylem-planet-demo.d.ts.map +0 -1
  86. package/dist/examples/16-timbotron.d.ts +0 -2
  87. package/dist/examples/16-timbotron.d.ts.map +0 -1
  88. package/dist/examples/17-stress-test.d.ts +0 -2
  89. package/dist/examples/17-stress-test.d.ts.map +0 -1
  90. package/dist/examples/architecture-test.d.ts +0 -2
  91. package/dist/examples/architecture-test.d.ts.map +0 -1
  92. package/dist/examples/utils.d.ts +0 -10
  93. package/dist/examples/utils.d.ts.map +0 -1
  94. package/dist/lib/actions/behaviors/actions.js +0 -35
  95. package/dist/lib/actions/behaviors/boundaries/boundary.js +0 -40
  96. package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.js +0 -100
  97. package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.js +0 -37
  98. package/dist/lib/actions/behaviors/ricochet/ricochet.js +0 -6
  99. package/dist/lib/actions/capabilities/moveable.js +0 -108
  100. package/dist/lib/actions/capabilities/rotatable.js +0 -82
  101. package/dist/lib/actions/capabilities/transformable.js +0 -9
  102. package/dist/lib/actions/global-change.js +0 -40
  103. package/dist/lib/camera/camera.js +0 -19
  104. package/dist/lib/camera/fixed-2d.js +0 -30
  105. package/dist/lib/camera/perspective.js +0 -10
  106. package/dist/lib/camera/third-person.js +0 -42
  107. package/dist/lib/camera/zylem-camera.js +0 -208
  108. package/dist/lib/collision/collision-builder.js +0 -46
  109. package/dist/lib/collision/collision-delegate.js +0 -6
  110. package/dist/lib/collision/utils.js +0 -24
  111. package/dist/lib/collision/world.js +0 -77
  112. package/dist/lib/core/base-node.js +0 -61
  113. package/dist/lib/core/entity-asset-loader.js +0 -54
  114. package/dist/lib/core/lifecycle-base.js +0 -20
  115. package/dist/lib/core/preset-shader.js +0 -26
  116. package/dist/lib/core/three-addons/Timer.js +0 -103
  117. package/dist/lib/core/utility/nodes.js +0 -31
  118. package/dist/lib/core/utility/strings.js +0 -14
  119. package/dist/lib/core/utility/vector.js +0 -8
  120. package/dist/lib/core/vessel.js +0 -26
  121. package/dist/lib/debug/console/console-state.js +0 -11
  122. package/dist/lib/debug/debug-state.js +0 -40
  123. package/dist/lib/device/aspect-ratio.js +0 -44
  124. package/dist/lib/entities/actor.js +0 -122
  125. package/dist/lib/entities/box.js +0 -68
  126. package/dist/lib/entities/builder.js +0 -79
  127. package/dist/lib/entities/create.js +0 -31
  128. package/dist/lib/entities/delegates/animation.js +0 -58
  129. package/dist/lib/entities/delegates/debug.js +0 -71
  130. package/dist/lib/entities/delegates/loader.js +0 -19
  131. package/dist/lib/entities/destroy.js +0 -15
  132. package/dist/lib/entities/entity-factory.js +0 -24
  133. package/dist/lib/entities/entity.js +0 -121
  134. package/dist/lib/entities/plane.js +0 -81
  135. package/dist/lib/entities/rect.js +0 -160
  136. package/dist/lib/entities/sphere.js +0 -68
  137. package/dist/lib/entities/sprite.js +0 -125
  138. package/dist/lib/entities/text.js +0 -140
  139. package/dist/lib/entities/zone.js +0 -103
  140. package/dist/lib/game/game-canvas.js +0 -57
  141. package/dist/lib/game/game-config.js +0 -78
  142. package/dist/lib/game/game-default.js +0 -23
  143. package/dist/lib/game/game-retro-resolutions.js +0 -80
  144. package/dist/lib/game/game-state.js +0 -17
  145. package/dist/lib/game/game.js +0 -131
  146. package/dist/lib/game/zylem-game.js +0 -140
  147. package/dist/lib/graphics/geometries/XZPlaneGeometry.js +0 -34
  148. package/dist/lib/graphics/material.js +0 -64
  149. package/dist/lib/graphics/mesh.js +0 -14
  150. package/dist/lib/graphics/render-pass.js +0 -56
  151. package/dist/lib/graphics/shaders/fragment/debug.glsl.js +0 -23
  152. package/dist/lib/graphics/shaders/fragment/fire.glsl.js +0 -52
  153. package/dist/lib/graphics/shaders/fragment/standard.glsl.js +0 -11
  154. package/dist/lib/graphics/shaders/fragment/stars.glsl.js +0 -44
  155. package/dist/lib/graphics/shaders/vertex/debug.glsl.js +0 -15
  156. package/dist/lib/graphics/shaders/vertex/object-shader.glsl.js +0 -11
  157. package/dist/lib/graphics/shaders/vertex/standard.glsl.js +0 -9
  158. package/dist/lib/graphics/zylem-scene.js +0 -75
  159. package/dist/lib/input/gamepad-provider.js +0 -58
  160. package/dist/lib/input/input-manager.js +0 -70
  161. package/dist/lib/input/keyboard-provider.js +0 -120
  162. package/dist/lib/stage/debug-entity-cursor.js +0 -53
  163. package/dist/lib/stage/entity-spawner.js +0 -27
  164. package/dist/lib/stage/stage-debug-delegate.js +0 -100
  165. package/dist/lib/stage/stage-default.js +0 -32
  166. package/dist/lib/stage/stage-factory.js +0 -22
  167. package/dist/lib/stage/stage-manager.js +0 -49
  168. package/dist/lib/stage/stage-state.js +0 -36
  169. package/dist/lib/stage/stage.js +0 -67
  170. package/dist/lib/stage/zylem-stage.js +0 -268
  171. package/dist/lib/systems/transformable.system.js +0 -43
  172. package/dist/node_modules/.pnpm/idb-keyval@6.2.2/node_modules/idb-keyval/dist/index.js +0 -34
  173. package/dist/node_modules/.pnpm/msgpackr@1.11.5/node_modules/msgpackr/pack.js +0 -520
  174. package/dist/node_modules/.pnpm/msgpackr@1.11.5/node_modules/msgpackr/unpack.js +0 -672
  175. package/dist/src/api/actions.d.ts +0 -5
  176. package/dist/src/api/actions.d.ts.map +0 -1
  177. package/dist/src/api/behaviors.d.ts +0 -4
  178. package/dist/src/api/behaviors.d.ts.map +0 -1
  179. package/dist/src/api/camera.d.ts +0 -4
  180. package/dist/src/api/camera.d.ts.map +0 -1
  181. package/dist/src/api/core.d.ts +0 -6
  182. package/dist/src/api/core.d.ts.map +0 -1
  183. package/dist/src/api/entities.d.ts +0 -9
  184. package/dist/src/api/entities.d.ts.map +0 -1
  185. package/dist/src/api/main.d.ts +0 -32
  186. package/dist/src/api/main.d.ts.map +0 -1
  187. package/dist/src/api/stage.d.ts +0 -5
  188. package/dist/src/api/stage.d.ts.map +0 -1
  189. package/dist/src/lib/actions/behaviors/actions.d.ts +0 -11
  190. package/dist/src/lib/actions/behaviors/actions.d.ts.map +0 -1
  191. package/dist/src/lib/actions/behaviors/behavior.d.ts +0 -6
  192. package/dist/src/lib/actions/behaviors/behavior.d.ts.map +0 -1
  193. package/dist/src/lib/actions/behaviors/boundaries/boundary.d.ts +0 -37
  194. package/dist/src/lib/actions/behaviors/boundaries/boundary.d.ts.map +0 -1
  195. package/dist/src/lib/actions/behaviors/character-controller.d.ts +0 -6
  196. package/dist/src/lib/actions/behaviors/character-controller.d.ts.map +0 -1
  197. package/dist/src/lib/actions/behaviors/debug/debug-collision.d.ts +0 -6
  198. package/dist/src/lib/actions/behaviors/debug/debug-collision.d.ts.map +0 -1
  199. package/dist/src/lib/actions/behaviors/debug/debug-update.d.ts +0 -5
  200. package/dist/src/lib/actions/behaviors/debug/debug-update.d.ts.map +0 -1
  201. package/dist/src/lib/actions/behaviors/debug/debug.d.ts +0 -10
  202. package/dist/src/lib/actions/behaviors/debug/debug.d.ts.map +0 -1
  203. package/dist/src/lib/actions/behaviors/movement/movement-sequence-2d.d.ts +0 -24
  204. package/dist/src/lib/actions/behaviors/movement/movement-sequence-2d.d.ts.map +0 -1
  205. package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts +0 -11
  206. package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts.map +0 -1
  207. package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts +0 -12
  208. package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts.map +0 -1
  209. package/dist/src/lib/actions/behaviors/ricochet/ricochet.d.ts +0 -44
  210. package/dist/src/lib/actions/behaviors/ricochet/ricochet.d.ts.map +0 -1
  211. package/dist/src/lib/actions/behaviors/zylem-behavior.d.ts +0 -2
  212. package/dist/src/lib/actions/behaviors/zylem-behavior.d.ts.map +0 -1
  213. package/dist/src/lib/actions/capabilities/moveable.d.ts +0 -125
  214. package/dist/src/lib/actions/capabilities/moveable.d.ts.map +0 -1
  215. package/dist/src/lib/actions/capabilities/rotatable.d.ts +0 -111
  216. package/dist/src/lib/actions/capabilities/rotatable.d.ts.map +0 -1
  217. package/dist/src/lib/actions/capabilities/transformable.d.ts +0 -7
  218. package/dist/src/lib/actions/capabilities/transformable.d.ts.map +0 -1
  219. package/dist/src/lib/actions/global-change.d.ts +0 -23
  220. package/dist/src/lib/actions/global-change.d.ts.map +0 -1
  221. package/dist/src/lib/camera/camera.d.ts +0 -16
  222. package/dist/src/lib/camera/camera.d.ts.map +0 -1
  223. package/dist/src/lib/camera/fixed-2d.d.ts +0 -32
  224. package/dist/src/lib/camera/fixed-2d.d.ts.map +0 -1
  225. package/dist/src/lib/camera/perspective.d.ts +0 -9
  226. package/dist/src/lib/camera/perspective.d.ts.map +0 -1
  227. package/dist/src/lib/camera/third-person.d.ts +0 -32
  228. package/dist/src/lib/camera/third-person.d.ts.map +0 -1
  229. package/dist/src/lib/camera/zylem-camera.d.ts.map +0 -1
  230. package/dist/src/lib/collision/collision-builder.d.ts +0 -17
  231. package/dist/src/lib/collision/collision-builder.d.ts.map +0 -1
  232. package/dist/src/lib/collision/collision-delegate.d.ts +0 -6
  233. package/dist/src/lib/collision/collision-delegate.d.ts.map +0 -1
  234. package/dist/src/lib/collision/collision-group.d.ts +0 -11
  235. package/dist/src/lib/collision/collision-group.d.ts.map +0 -1
  236. package/dist/src/lib/collision/collision-mask.d.ts +0 -18
  237. package/dist/src/lib/collision/collision-mask.d.ts.map +0 -1
  238. package/dist/src/lib/collision/collision.d.ts +0 -19
  239. package/dist/src/lib/collision/collision.d.ts.map +0 -1
  240. package/dist/src/lib/collision/utils.d.ts +0 -15
  241. package/dist/src/lib/collision/utils.d.ts.map +0 -1
  242. package/dist/src/lib/collision/world.d.ts +0 -23
  243. package/dist/src/lib/collision/world.d.ts.map +0 -1
  244. package/dist/src/lib/core/asset-manager.d.ts +0 -2
  245. package/dist/src/lib/core/asset-manager.d.ts.map +0 -1
  246. package/dist/src/lib/core/base-node-life-cycle.d.ts +0 -54
  247. package/dist/src/lib/core/base-node-life-cycle.d.ts.map +0 -1
  248. package/dist/src/lib/core/base-node.d.ts +0 -36
  249. package/dist/src/lib/core/base-node.d.ts.map +0 -1
  250. package/dist/src/lib/core/blueprints.d.ts +0 -22
  251. package/dist/src/lib/core/blueprints.d.ts.map +0 -1
  252. package/dist/src/lib/core/entity-asset-loader.d.ts +0 -16
  253. package/dist/src/lib/core/entity-asset-loader.d.ts.map +0 -1
  254. package/dist/src/lib/core/errors.d.ts +0 -5
  255. package/dist/src/lib/core/errors.d.ts.map +0 -1
  256. package/dist/src/lib/core/flags.d.ts +0 -3
  257. package/dist/src/lib/core/flags.d.ts.map +0 -1
  258. package/dist/src/lib/core/index.d.ts +0 -5
  259. package/dist/src/lib/core/index.d.ts.map +0 -1
  260. package/dist/src/lib/core/interfaces.d.ts +0 -25
  261. package/dist/src/lib/core/interfaces.d.ts.map +0 -1
  262. package/dist/src/lib/core/lazy-loader.d.ts +0 -80
  263. package/dist/src/lib/core/lazy-loader.d.ts.map +0 -1
  264. package/dist/src/lib/core/lifecycle-base.d.ts +0 -17
  265. package/dist/src/lib/core/lifecycle-base.d.ts.map +0 -1
  266. package/dist/src/lib/core/node-interface.d.ts +0 -12
  267. package/dist/src/lib/core/node-interface.d.ts.map +0 -1
  268. package/dist/src/lib/core/preset-shader.d.ts +0 -8
  269. package/dist/src/lib/core/preset-shader.d.ts.map +0 -1
  270. package/dist/src/lib/core/three-addons/Timer.d.ts +0 -92
  271. package/dist/src/lib/core/three-addons/Timer.d.ts.map +0 -1
  272. package/dist/src/lib/core/utility/nodes.d.ts +0 -13
  273. package/dist/src/lib/core/utility/nodes.d.ts.map +0 -1
  274. package/dist/src/lib/core/utility/strings.d.ts +0 -3
  275. package/dist/src/lib/core/utility/strings.d.ts.map +0 -1
  276. package/dist/src/lib/core/utility/vector.d.ts +0 -8
  277. package/dist/src/lib/core/utility/vector.d.ts.map +0 -1
  278. package/dist/src/lib/core/vector.d.ts +0 -4
  279. package/dist/src/lib/core/vector.d.ts.map +0 -1
  280. package/dist/src/lib/core/vessel.d.ts +0 -13
  281. package/dist/src/lib/core/vessel.d.ts.map +0 -1
  282. package/dist/src/lib/debug/console/console-state.d.ts +0 -20
  283. package/dist/src/lib/debug/console/console-state.d.ts.map +0 -1
  284. package/dist/src/lib/debug/console/console-store.d.ts +0 -6
  285. package/dist/src/lib/debug/console/console-store.d.ts.map +0 -1
  286. package/dist/src/lib/debug/debug-state.d.ts +0 -38
  287. package/dist/src/lib/debug/debug-state.d.ts.map +0 -1
  288. package/dist/src/lib/debug/debug-store.d.ts +0 -15
  289. package/dist/src/lib/debug/debug-store.d.ts.map +0 -1
  290. package/dist/src/lib/debug/state-based-debug-loader.d.ts +0 -8
  291. package/dist/src/lib/debug/state-based-debug-loader.d.ts.map +0 -1
  292. package/dist/src/lib/device/aspect-ratio.d.ts +0 -38
  293. package/dist/src/lib/device/aspect-ratio.d.ts.map +0 -1
  294. package/dist/src/lib/device/desktop.d.ts +0 -2
  295. package/dist/src/lib/device/desktop.d.ts.map +0 -1
  296. package/dist/src/lib/device/mobile.d.ts +0 -2
  297. package/dist/src/lib/device/mobile.d.ts.map +0 -1
  298. package/dist/src/lib/device/tablet.d.ts +0 -2
  299. package/dist/src/lib/device/tablet.d.ts.map +0 -1
  300. package/dist/src/lib/entities/actor.d.ts +0 -44
  301. package/dist/src/lib/entities/actor.d.ts.map +0 -1
  302. package/dist/src/lib/entities/box.d.ts +0 -27
  303. package/dist/src/lib/entities/box.d.ts.map +0 -1
  304. package/dist/src/lib/entities/builder.d.ts +0 -28
  305. package/dist/src/lib/entities/builder.d.ts.map +0 -1
  306. package/dist/src/lib/entities/create.d.ts +0 -15
  307. package/dist/src/lib/entities/create.d.ts.map +0 -1
  308. package/dist/src/lib/entities/delegates/animation.d.ts +0 -33
  309. package/dist/src/lib/entities/delegates/animation.d.ts.map +0 -1
  310. package/dist/src/lib/entities/delegates/debug.d.ts +0 -29
  311. package/dist/src/lib/entities/delegates/debug.d.ts.map +0 -1
  312. package/dist/src/lib/entities/delegates/loader.d.ts +0 -12
  313. package/dist/src/lib/entities/delegates/loader.d.ts.map +0 -1
  314. package/dist/src/lib/entities/destroy.d.ts +0 -4
  315. package/dist/src/lib/entities/destroy.d.ts.map +0 -1
  316. package/dist/src/lib/entities/entity-factory.d.ts +0 -10
  317. package/dist/src/lib/entities/entity-factory.d.ts.map +0 -1
  318. package/dist/src/lib/entities/entity.d.ts +0 -98
  319. package/dist/src/lib/entities/entity.d.ts.map +0 -1
  320. package/dist/src/lib/entities/index.d.ts +0 -12
  321. package/dist/src/lib/entities/index.d.ts.map +0 -1
  322. package/dist/src/lib/entities/plane.d.ts +0 -36
  323. package/dist/src/lib/entities/plane.d.ts.map +0 -1
  324. package/dist/src/lib/entities/rect.d.ts +0 -63
  325. package/dist/src/lib/entities/rect.d.ts.map +0 -1
  326. package/dist/src/lib/entities/sphere.d.ts +0 -29
  327. package/dist/src/lib/entities/sphere.d.ts.map +0 -1
  328. package/dist/src/lib/entities/sprite.d.ts +0 -54
  329. package/dist/src/lib/entities/sprite.d.ts.map +0 -1
  330. package/dist/src/lib/entities/text.d.ts +0 -49
  331. package/dist/src/lib/entities/text.d.ts.map +0 -1
  332. package/dist/src/lib/entities/zone.d.ts +0 -54
  333. package/dist/src/lib/entities/zone.d.ts.map +0 -1
  334. package/dist/src/lib/game/game-blueprint.d.ts +0 -38
  335. package/dist/src/lib/game/game-blueprint.d.ts.map +0 -1
  336. package/dist/src/lib/game/game-canvas.d.ts +0 -35
  337. package/dist/src/lib/game/game-canvas.d.ts.map +0 -1
  338. package/dist/src/lib/game/game-config.d.ts +0 -59
  339. package/dist/src/lib/game/game-config.d.ts.map +0 -1
  340. package/dist/src/lib/game/game-default.d.ts +0 -14
  341. package/dist/src/lib/game/game-default.d.ts.map +0 -1
  342. package/dist/src/lib/game/game-interfaces.d.ts +0 -29
  343. package/dist/src/lib/game/game-interfaces.d.ts.map +0 -1
  344. package/dist/src/lib/game/game-retro-resolutions.d.ts +0 -25
  345. package/dist/src/lib/game/game-retro-resolutions.d.ts.map +0 -1
  346. package/dist/src/lib/game/game-state.d.ts +0 -11
  347. package/dist/src/lib/game/game-state.d.ts.map +0 -1
  348. package/dist/src/lib/game/game.d.ts +0 -39
  349. package/dist/src/lib/game/game.d.ts.map +0 -1
  350. package/dist/src/lib/game/zylem-game.d.ts +0 -58
  351. package/dist/src/lib/game/zylem-game.d.ts.map +0 -1
  352. package/dist/src/lib/graphics/geometries/XZPlaneGeometry.d.ts +0 -8
  353. package/dist/src/lib/graphics/geometries/XZPlaneGeometry.d.ts.map +0 -1
  354. package/dist/src/lib/graphics/material.d.ts +0 -29
  355. package/dist/src/lib/graphics/material.d.ts.map +0 -1
  356. package/dist/src/lib/graphics/mesh.d.ts +0 -19
  357. package/dist/src/lib/graphics/mesh.d.ts.map +0 -1
  358. package/dist/src/lib/graphics/render-pass.d.ts +0 -17
  359. package/dist/src/lib/graphics/render-pass.d.ts.map +0 -1
  360. package/dist/src/lib/graphics/zylem-scene.d.ts +0 -50
  361. package/dist/src/lib/graphics/zylem-scene.d.ts.map +0 -1
  362. package/dist/src/lib/input/gamepad-provider.d.ts +0 -14
  363. package/dist/src/lib/input/gamepad-provider.d.ts.map +0 -1
  364. package/dist/src/lib/input/input-manager.d.ts +0 -15
  365. package/dist/src/lib/input/input-manager.d.ts.map +0 -1
  366. package/dist/src/lib/input/input-provider.d.ts +0 -7
  367. package/dist/src/lib/input/input-provider.d.ts.map +0 -1
  368. package/dist/src/lib/input/input.d.ts +0 -48
  369. package/dist/src/lib/input/input.d.ts.map +0 -1
  370. package/dist/src/lib/input/keyboard-provider.d.ts +0 -21
  371. package/dist/src/lib/input/keyboard-provider.d.ts.map +0 -1
  372. package/dist/src/lib/interfaces/entity.d.ts +0 -26
  373. package/dist/src/lib/interfaces/entity.d.ts.map +0 -1
  374. package/dist/src/lib/sounds/index.d.ts +0 -3
  375. package/dist/src/lib/sounds/index.d.ts.map +0 -1
  376. package/dist/src/lib/sounds/ping-pong-sound.d.ts +0 -5
  377. package/dist/src/lib/sounds/ping-pong-sound.d.ts.map +0 -1
  378. package/dist/src/lib/sounds/ricochet-sound.d.ts +0 -5
  379. package/dist/src/lib/sounds/ricochet-sound.d.ts.map +0 -1
  380. package/dist/src/lib/stage/debug-entity-cursor.d.ts +0 -24
  381. package/dist/src/lib/stage/debug-entity-cursor.d.ts.map +0 -1
  382. package/dist/src/lib/stage/entity-spawner.d.ts +0 -9
  383. package/dist/src/lib/stage/entity-spawner.d.ts.map +0 -1
  384. package/dist/src/lib/stage/stage-camera-debug-delegate.d.ts +0 -14
  385. package/dist/src/lib/stage/stage-camera-debug-delegate.d.ts.map +0 -1
  386. package/dist/src/lib/stage/stage-debug-delegate.d.ts +0 -26
  387. package/dist/src/lib/stage/stage-debug-delegate.d.ts.map +0 -1
  388. package/dist/src/lib/stage/stage-default.d.ts +0 -3
  389. package/dist/src/lib/stage/stage-default.d.ts.map +0 -1
  390. package/dist/src/lib/stage/stage-factory.d.ts +0 -6
  391. package/dist/src/lib/stage/stage-factory.d.ts.map +0 -1
  392. package/dist/src/lib/stage/stage-manager.d.ts +0 -30
  393. package/dist/src/lib/stage/stage-manager.d.ts.map +0 -1
  394. package/dist/src/lib/stage/stage-state.d.ts +0 -14
  395. package/dist/src/lib/stage/stage-state.d.ts.map +0 -1
  396. package/dist/src/lib/stage/stage.d.ts +0 -35
  397. package/dist/src/lib/stage/stage.d.ts.map +0 -1
  398. package/dist/src/lib/stage/zylem-stage.d.ts +0 -128
  399. package/dist/src/lib/stage/zylem-stage.d.ts.map +0 -1
  400. package/dist/src/lib/systems/test-system.d.ts +0 -2
  401. package/dist/src/lib/systems/test-system.d.ts.map +0 -1
  402. package/dist/src/lib/systems/transformable.system.d.ts +0 -25
  403. package/dist/src/lib/systems/transformable.system.d.ts.map +0 -1
  404. package/dist/src/lib/types/entity-types.d.ts +0 -24
  405. package/dist/src/lib/types/entity-types.d.ts.map +0 -1
  406. package/dist/src/lib/types/index.d.ts +0 -3
  407. package/dist/src/lib/types/index.d.ts.map +0 -1
  408. package/dist/src/lib/types/stage-types.d.ts +0 -26
  409. package/dist/src/lib/types/stage-types.d.ts.map +0 -1
  410. package/dist/src/lib/ui/Debug.d.ts +0 -6
  411. package/dist/src/lib/ui/Debug.d.ts.map +0 -1
  412. package/dist/src/lib/ui/console/Console.d.ts +0 -7
  413. package/dist/src/lib/ui/console/Console.d.ts.map +0 -1
  414. package/dist/src/lib/ui/debug-panel/AccordionMenu.d.ts +0 -7
  415. package/dist/src/lib/ui/debug-panel/AccordionMenu.d.ts.map +0 -1
  416. package/dist/src/lib/ui/debug-panel/Menu.d.ts +0 -6
  417. package/dist/src/lib/ui/debug-panel/Menu.d.ts.map +0 -1
  418. package/dist/src/lib/ui/debug-panel/sections/EntitiesSection.d.ts +0 -4
  419. package/dist/src/lib/ui/debug-panel/sections/EntitiesSection.d.ts.map +0 -1
  420. package/dist/src/lib/ui/debug-panel/sections/GameSection.d.ts +0 -3
  421. package/dist/src/lib/ui/debug-panel/sections/GameSection.d.ts.map +0 -1
  422. package/dist/src/lib/ui/debug-panel/sections/StagesSection.d.ts +0 -3
  423. package/dist/src/lib/ui/debug-panel/sections/StagesSection.d.ts.map +0 -1
  424. package/dist/src/lib/ui/debug-panel/sections/all.d.ts +0 -4
  425. package/dist/src/lib/ui/debug-panel/sections/all.d.ts.map +0 -1
  426. package/dist/src/lib/ui/toolbar/Toolbar.d.ts +0 -6
  427. package/dist/src/lib/ui/toolbar/Toolbar.d.ts.map +0 -1
  428. package/dist/tests/e2e/basic-game.spec.d.ts +0 -2
  429. package/dist/tests/e2e/basic-game.spec.d.ts.map +0 -1
  430. package/dist/tests/integration/debug.sim.spec.d.ts +0 -2
  431. package/dist/tests/integration/debug.sim.spec.d.ts.map +0 -1
  432. package/dist/tests/unit/collision/collision.spec.d.ts +0 -2
  433. package/dist/tests/unit/collision/collision.spec.d.ts.map +0 -1
  434. package/dist/tests/unit/core/base-node.spec.d.ts +0 -2
  435. package/dist/tests/unit/core/base-node.spec.d.ts.map +0 -1
  436. package/dist/tests/unit/core/game.spec.d.ts +0 -2
  437. package/dist/tests/unit/core/game.spec.d.ts.map +0 -1
  438. package/dist/tests/unit/core/stage.spec.d.ts +0 -2
  439. package/dist/tests/unit/core/stage.spec.d.ts.map +0 -1
  440. package/dist/tests/unit/core/vessel.spec.d.ts +0 -2
  441. package/dist/tests/unit/core/vessel.spec.d.ts.map +0 -1
@@ -1,82 +0,0 @@
1
- import { Vector3 as g, Euler as i, MathUtils as a, Quaternion as l } from "three";
2
- function b(o, t) {
3
- if (!o.body)
4
- return;
5
- const e = Math.atan2(-t.x, t.z);
6
- c(o, e);
7
- }
8
- function c(o, t) {
9
- f(o, new g(0, -t, 0));
10
- }
11
- function f(o, t) {
12
- if (!o.group)
13
- return;
14
- const e = new i(t.x, t.y, t.z);
15
- o.group.setRotationFromEuler(e);
16
- }
17
- function h(o, t) {
18
- s(o, t);
19
- }
20
- function D(o, t) {
21
- u(o, t);
22
- }
23
- function s(o, t) {
24
- if (!o.body)
25
- return;
26
- const e = t / 2, r = Math.cos(e), n = Math.sin(e);
27
- o.body.setRotation({ w: r, x: 0, y: n, z: 0 }, !0);
28
- }
29
- function w(o, t) {
30
- o.body && s(o, a.degToRad(t));
31
- }
32
- function R(o, t) {
33
- if (!o.body)
34
- return;
35
- const e = t / 2, r = Math.cos(e), n = Math.sin(e);
36
- o.body.setRotation({ w: r, x: n, y: 0, z: 0 }, !0);
37
- }
38
- function x(o, t) {
39
- o.body && R(o, a.degToRad(t));
40
- }
41
- function u(o, t) {
42
- if (!o.body)
43
- return;
44
- const e = t / 2, r = Math.cos(e), n = Math.sin(e);
45
- o.body.setRotation({ w: r, x: 0, y: 0, z: n }, !0);
46
- }
47
- function z(o, t) {
48
- o.body && u(o, a.degToRad(t));
49
- }
50
- function d(o, t, e, r) {
51
- if (!o.body)
52
- return;
53
- const n = new l().setFromEuler(new i(t, e, r));
54
- o.body.setRotation({ w: n.w, x: n.x, y: n.y, z: n.z }, !0);
55
- }
56
- function E(o, t, e, r) {
57
- o.body && d(o, a.degToRad(t), a.degToRad(e), a.degToRad(r));
58
- }
59
- function M(o) {
60
- return o.body ? o.body.rotation() : null;
61
- }
62
- function m(o) {
63
- const t = o;
64
- return t.rotateInDirection = (e) => b(o, e), t.rotateYEuler = (e) => c(o, e), t.rotateEuler = (e) => f(o, e), t.rotateY = (e) => h(o, e), t.rotateZ = (e) => D(o, e), t.setRotationY = (e) => s(o, e), t.setRotationX = (e) => R(o, e), t.setRotationZ = (e) => u(o, e), t.setRotationDegreesY = (e) => w(o, e), t.setRotationDegreesX = (e) => x(o, e), t.setRotationDegreesZ = (e) => z(o, e), t.setRotationDegrees = (e, r, n) => E(o, e, r, n), t.setRotation = (e, r, n) => d(o, e, r, n), t.getRotation = () => M(o), t;
65
- }
66
- export {
67
- M as getRotation,
68
- m as makeRotatable,
69
- f as rotateEuler,
70
- b as rotateInDirection,
71
- h as rotateY,
72
- c as rotateYEuler,
73
- D as rotateZ,
74
- d as setRotation,
75
- E as setRotationDegrees,
76
- x as setRotationDegreesX,
77
- w as setRotationDegreesY,
78
- z as setRotationDegreesZ,
79
- R as setRotationX,
80
- s as setRotationY,
81
- u as setRotationZ
82
- };
@@ -1,9 +0,0 @@
1
- import { makeMoveable as e } from "./moveable.js";
2
- import { makeRotatable as a } from "./rotatable.js";
3
- function i(t) {
4
- const o = e(t);
5
- return a(o);
6
- }
7
- export {
8
- i as makeTransformable
9
- };
@@ -1,40 +0,0 @@
1
- function v(r, l) {
2
- let n;
3
- return (a) => {
4
- const e = a.globals?.[r];
5
- n !== e && (n === void 0 && e === void 0 || l(e, a), n = e);
6
- };
7
- }
8
- function d(r, l) {
9
- let n = new Array(r.length).fill(void 0);
10
- return (a) => {
11
- const e = r.map((t) => a.globals?.[t]);
12
- if (e.some((t, o) => n[o] !== t)) {
13
- const t = n.every((i) => i === void 0), o = e.every((i) => i === void 0);
14
- t && o || l(e, a), n = e;
15
- }
16
- };
17
- }
18
- function f(r, l) {
19
- let n;
20
- return (a) => {
21
- const e = a.stage?.getVariable?.(r) ?? void 0;
22
- n !== e && (n === void 0 && e === void 0 || l(e, a), n = e);
23
- };
24
- }
25
- function g(r, l) {
26
- let n = new Array(r.length).fill(void 0);
27
- return (a) => {
28
- const e = (o) => a.stage?.getVariable?.(o), s = r.map(e);
29
- if (s.some((o, i) => n[i] !== o)) {
30
- const o = n.every((u) => u === void 0), i = s.every((u) => u === void 0);
31
- o && i || l(s, a), n = s;
32
- }
33
- };
34
- }
35
- export {
36
- v as globalChange,
37
- d as globalChanges,
38
- f as variableChange,
39
- g as variableChanges
40
- };
@@ -1,19 +0,0 @@
1
- import { Vector2 as c, Vector3 as a } from "three";
2
- import { ZylemCamera as m } from "./zylem-camera.js";
3
- class o {
4
- cameraRef;
5
- constructor(r) {
6
- this.cameraRef = r;
7
- }
8
- }
9
- function w(e) {
10
- const r = e.screenResolution || new c(window.innerWidth, window.innerHeight);
11
- let n = 10;
12
- e.perspective === "fixed-2d" && (n = e.zoom || 10);
13
- const t = new m(e.perspective || "third-person", r, n);
14
- return t.move(e.position || new a(0, 0, 0)), t.camera.lookAt(e.target || new a(0, 0, 0)), new o(t);
15
- }
16
- export {
17
- o as CameraWrapper,
18
- w as camera
19
- };
@@ -1,30 +0,0 @@
1
- class c {
2
- screenResolution = null;
3
- renderer = null;
4
- scene = null;
5
- cameraRef = null;
6
- constructor() {
7
- }
8
- /**
9
- * Setup the fixed 2D camera controller
10
- */
11
- setup(e) {
12
- const { screenResolution: s, renderer: r, scene: t, camera: n } = e;
13
- this.screenResolution = s, this.renderer = r, this.scene = t, this.cameraRef = n, this.cameraRef.camera.position.set(0, 0, 10), this.cameraRef.camera.lookAt(0, 0, 0);
14
- }
15
- /**
16
- * Update the fixed 2D camera
17
- * Fixed cameras don't need to update position/rotation automatically
18
- */
19
- update(e) {
20
- }
21
- /**
22
- * Handle resize events for 2D camera
23
- */
24
- resize(e, s) {
25
- this.screenResolution && this.screenResolution.set(e, s);
26
- }
27
- }
28
- export {
29
- c as Fixed2DCamera
30
- };
@@ -1,10 +0,0 @@
1
- const e = {
2
- FirstPerson: "first-person",
3
- ThirdPerson: "third-person",
4
- Isometric: "isometric",
5
- Flat2D: "flat-2d",
6
- Fixed2D: "fixed-2d"
7
- };
8
- export {
9
- e as Perspectives
10
- };
@@ -1,42 +0,0 @@
1
- import { Vector3 as a } from "three";
2
- class c {
3
- distance;
4
- screenResolution = null;
5
- renderer = null;
6
- scene = null;
7
- cameraRef = null;
8
- constructor() {
9
- this.distance = new a(0, 5, 8);
10
- }
11
- /**
12
- * Setup the third person camera controller
13
- */
14
- setup(e) {
15
- const { screenResolution: t, renderer: s, scene: r, camera: i } = e;
16
- this.screenResolution = t, this.renderer = s, this.scene = r, this.cameraRef = i;
17
- }
18
- /**
19
- * Update the third person camera
20
- */
21
- update(e) {
22
- if (!this.cameraRef.target)
23
- return;
24
- const t = this.cameraRef.target.group.position.clone().add(this.distance);
25
- this.cameraRef.camera.position.lerp(t, 0.1), this.cameraRef.camera.lookAt(this.cameraRef.target.group.position);
26
- }
27
- /**
28
- * Handle resize events
29
- */
30
- resize(e, t) {
31
- this.screenResolution && this.screenResolution.set(e, t);
32
- }
33
- /**
34
- * Set the distance from the target
35
- */
36
- setDistance(e) {
37
- this.distance = e;
38
- }
39
- }
40
- export {
41
- c as ThirdPersonCamera
42
- };
@@ -1,208 +0,0 @@
1
- import { Vector3 as a, WebGLRenderer as c, Object3D as u, PerspectiveCamera as o, OrthographicCamera as n } from "three";
2
- import { OrbitControls as l } from "three/addons/controls/OrbitControls.js";
3
- import { Perspectives as s } from "./perspective.js";
4
- import { ThirdPersonCamera as h } from "./third-person.js";
5
- import { Fixed2DCamera as m } from "./fixed-2d.js";
6
- import { EffectComposer as b } from "three/examples/jsm/postprocessing/EffectComposer.js";
7
- import d from "../graphics/render-pass.js";
8
- class F {
9
- cameraRig;
10
- camera;
11
- screenResolution;
12
- renderer;
13
- composer;
14
- _perspective;
15
- orbitControls = null;
16
- target = null;
17
- sceneRef = null;
18
- frustumSize = 10;
19
- // Perspective controller delegation
20
- perspectiveController = null;
21
- debugDelegate = null;
22
- debugUnsubscribe = null;
23
- debugStateSnapshot = { enabled: !1, selected: [] };
24
- orbitTarget = null;
25
- orbitTargetWorldPos = new a();
26
- constructor(e, t, r = 10) {
27
- this._perspective = e, this.screenResolution = t, this.frustumSize = r, this.renderer = new c({ antialias: !1, alpha: !0 }), this.renderer.setSize(t.x, t.y), this.renderer.shadowMap.enabled = !0, this.composer = new b(this.renderer);
28
- const i = t.x / t.y;
29
- this.camera = this.createCameraForPerspective(i), this.cameraRig = new u(), this.cameraRig.position.set(0, 3, 10), this.cameraRig.add(this.camera), this.camera.lookAt(new a(0, 2, 0)), this.initializePerspectiveController();
30
- }
31
- /**
32
- * Setup the camera with a scene
33
- */
34
- async setup(e) {
35
- this.sceneRef = e, this.orbitControls === null && (this.orbitControls = new l(this.camera, this.renderer.domElement), this.orbitControls.enableDamping = !0, this.orbitControls.dampingFactor = 0.05, this.orbitControls.screenSpacePanning = !1, this.orbitControls.minDistance = 1, this.orbitControls.maxDistance = 500, this.orbitControls.maxPolarAngle = Math.PI / 2);
36
- let t = this.screenResolution.clone().divideScalar(2);
37
- t.x |= 0, t.y |= 0;
38
- const r = new d(t, e, this.camera);
39
- this.composer.addPass(r), this.perspectiveController && this.perspectiveController.setup({
40
- screenResolution: this.screenResolution,
41
- renderer: this.renderer,
42
- scene: e,
43
- camera: this
44
- }), this.renderer.setAnimationLoop((i) => {
45
- this.update(i || 0);
46
- });
47
- }
48
- /**
49
- * Update camera and render
50
- */
51
- update(e) {
52
- this.orbitControls && this.orbitTarget && (this.orbitTarget.getWorldPosition(this.orbitTargetWorldPos), this.orbitControls.target.copy(this.orbitTargetWorldPos)), this.orbitControls?.update(), this.perspectiveController && this.perspectiveController.update(e), this.composer.render(e);
53
- }
54
- /**
55
- * Dispose renderer, composer, controls, and detach from scene
56
- */
57
- destroy() {
58
- try {
59
- this.renderer.setAnimationLoop(null);
60
- } catch {
61
- }
62
- try {
63
- this.disableOrbitControls();
64
- } catch {
65
- }
66
- try {
67
- this.composer?.passes?.forEach((e) => e.dispose?.()), this.composer?.dispose?.();
68
- } catch {
69
- }
70
- try {
71
- this.renderer.dispose();
72
- } catch {
73
- }
74
- this.detachDebugDelegate(), this.sceneRef = null;
75
- }
76
- /**
77
- * Attach a delegate to react to debug state changes.
78
- */
79
- setDebugDelegate(e) {
80
- if (this.debugDelegate === e)
81
- return;
82
- if (this.detachDebugDelegate(), this.debugDelegate = e, !e) {
83
- this.applyDebugState({ enabled: !1, selected: [] });
84
- return;
85
- }
86
- const t = e.subscribe((r) => {
87
- this.applyDebugState(r);
88
- });
89
- this.debugUnsubscribe = () => {
90
- t?.();
91
- };
92
- }
93
- /**
94
- * Resize camera and renderer
95
- */
96
- resize(e, t) {
97
- this.screenResolution.set(e, t), this.renderer.setSize(e, t, !1), this.composer.setSize(e, t), this.camera instanceof o && (this.camera.aspect = e / t, this.camera.updateProjectionMatrix()), this.perspectiveController && this.perspectiveController.resize(e, t);
98
- }
99
- /**
100
- * Update renderer pixel ratio (DPR)
101
- */
102
- setPixelRatio(e) {
103
- const t = Math.max(1, Number.isFinite(e) ? e : 1);
104
- this.renderer.setPixelRatio(t);
105
- }
106
- /**
107
- * Create camera based on perspective type
108
- */
109
- createCameraForPerspective(e) {
110
- switch (this._perspective) {
111
- case s.ThirdPerson:
112
- return this.createThirdPersonCamera(e);
113
- case s.FirstPerson:
114
- return this.createFirstPersonCamera(e);
115
- case s.Isometric:
116
- return this.createIsometricCamera(e);
117
- case s.Flat2D:
118
- return this.createFlat2DCamera(e);
119
- case s.Fixed2D:
120
- return this.createFixed2DCamera(e);
121
- default:
122
- return this.createThirdPersonCamera(e);
123
- }
124
- }
125
- /**
126
- * Initialize perspective-specific controller
127
- */
128
- initializePerspectiveController() {
129
- switch (this._perspective) {
130
- case s.ThirdPerson:
131
- this.perspectiveController = new h();
132
- break;
133
- case s.Fixed2D:
134
- this.perspectiveController = new m();
135
- break;
136
- default:
137
- this.perspectiveController = new h();
138
- }
139
- }
140
- createThirdPersonCamera(e) {
141
- return new o(75, e, 0.1, 1e3);
142
- }
143
- createFirstPersonCamera(e) {
144
- return new o(75, e, 0.1, 1e3);
145
- }
146
- createIsometricCamera(e) {
147
- return new n(this.frustumSize * e / -2, this.frustumSize * e / 2, this.frustumSize / 2, this.frustumSize / -2, 1, 1e3);
148
- }
149
- createFlat2DCamera(e) {
150
- return new n(this.frustumSize * e / -2, this.frustumSize * e / 2, this.frustumSize / 2, this.frustumSize / -2, 1, 1e3);
151
- }
152
- createFixed2DCamera(e) {
153
- return this.createFlat2DCamera(e);
154
- }
155
- // Movement methods
156
- moveCamera(e) {
157
- (this._perspective === s.Flat2D || this._perspective === s.Fixed2D) && (this.frustumSize = e.z), this.cameraRig.position.set(e.x, e.y, e.z);
158
- }
159
- move(e) {
160
- this.moveCamera(e);
161
- }
162
- rotate(e, t, r) {
163
- this.cameraRig.rotateX(e), this.cameraRig.rotateY(t), this.cameraRig.rotateZ(r);
164
- }
165
- /**
166
- * Get the DOM element for the renderer
167
- */
168
- getDomElement() {
169
- return this.renderer.domElement;
170
- }
171
- applyDebugState(e) {
172
- this.debugStateSnapshot = {
173
- enabled: e.enabled,
174
- selected: [...e.selected]
175
- }, e.enabled ? (this.enableOrbitControls(), this.updateOrbitTargetFromSelection(e.selected)) : (this.orbitTarget = null, this.disableOrbitControls());
176
- }
177
- enableOrbitControls() {
178
- this.orbitControls || (this.orbitControls = new l(this.camera, this.renderer.domElement), this.orbitControls.enableDamping = !0, this.orbitControls.dampingFactor = 0.05, this.orbitControls.screenSpacePanning = !1, this.orbitControls.minDistance = 1, this.orbitControls.maxDistance = 500, this.orbitControls.maxPolarAngle = Math.PI / 2);
179
- }
180
- disableOrbitControls() {
181
- this.orbitControls && (this.orbitControls.dispose(), this.orbitControls = null);
182
- }
183
- updateOrbitTargetFromSelection(e) {
184
- if (!this.debugDelegate || e.length === 0) {
185
- this.orbitTarget = null;
186
- return;
187
- }
188
- for (let t = e.length - 1; t >= 0; t -= 1) {
189
- const r = e[t], i = this.debugDelegate.resolveTarget(r);
190
- if (i) {
191
- this.orbitTarget = i, this.orbitControls && (i.getWorldPosition(this.orbitTargetWorldPos), this.orbitControls.target.copy(this.orbitTargetWorldPos));
192
- return;
193
- }
194
- }
195
- this.orbitTarget = null;
196
- }
197
- detachDebugDelegate() {
198
- if (this.debugUnsubscribe)
199
- try {
200
- this.debugUnsubscribe();
201
- } catch {
202
- }
203
- this.debugUnsubscribe = null, this.debugDelegate = null;
204
- }
205
- }
206
- export {
207
- F as ZylemCamera
208
- };
@@ -1,46 +0,0 @@
1
- import { Vector3 as r, ActiveCollisionTypes as f, ColliderDesc as p, RigidBodyType as c, RigidBodyDesc as D } from "@dimforge/rapier3d-compat";
2
- const n = /* @__PURE__ */ new Map();
3
- let h = 0;
4
- function d(i) {
5
- let e = n.get(i);
6
- return e === void 0 && (e = h++ % 16, n.set(i, e)), e;
7
- }
8
- function C(i) {
9
- let e = 0;
10
- return i.forEach((s) => {
11
- const t = d(s);
12
- e |= 1 << t;
13
- }), e;
14
- }
15
- class g {
16
- static = !1;
17
- sensor = !1;
18
- gravity = new r(0, 0, 0);
19
- build(e) {
20
- const s = this.bodyDesc({
21
- isDynamicBody: !this.static
22
- }), t = this.collider(e), o = e.collisionType;
23
- if (o) {
24
- let u = d(o), l = 65535;
25
- e.collisionFilter && (l = C(e.collisionFilter)), t.setCollisionGroups(u << 16 | l);
26
- }
27
- const { KINEMATIC_FIXED: a, DEFAULT: y } = f;
28
- return t.activeCollisionTypes = this.sensor ? a : y, [s, t];
29
- }
30
- withCollision(e) {
31
- return this.sensor = e?.sensor ?? this.sensor, this.static = e?.static ?? this.static, this;
32
- }
33
- collider(e) {
34
- const s = e.size ?? new r(1, 1, 1), t = { x: s.x / 2, y: s.y / 2, z: s.z / 2 };
35
- return p.cuboid(t.x, t.y, t.z);
36
- }
37
- bodyDesc({ isDynamicBody: e = !0 }) {
38
- const s = e ? c.Dynamic : c.Fixed;
39
- return new D(s).setTranslation(0, 0, 0).setGravityScale(1).setCanSleep(!1).setCcdEnabled(!0);
40
- }
41
- }
42
- export {
43
- g as CollisionBuilder,
44
- C as createCollisionFilter,
45
- d as getOrCreateCollisionGroupId
46
- };
@@ -1,6 +0,0 @@
1
- function e(n) {
2
- return typeof n?.handlePostCollision == "function" && typeof n?.handleIntersectionEvent == "function";
3
- }
4
- export {
5
- e as isCollisionHandlerDelegate
6
- };
@@ -1,24 +0,0 @@
1
- import { getOrCreateCollisionGroupId as o } from "./collision-builder.js";
2
- function u(i, n) {
3
- if (!n)
4
- return !0;
5
- const r = i.name ?? "";
6
- if ("name" in n) {
7
- const e = n.name;
8
- return e instanceof RegExp ? e.test(r) : Array.isArray(e) ? e.some((t) => t === r) : r === e;
9
- } else if ("mask" in n) {
10
- const e = n.mask;
11
- if (e instanceof RegExp) {
12
- const t = i.collisionType ?? "";
13
- return e.test(t);
14
- } else {
15
- const t = i.collisionType ?? "", s = o(t);
16
- return (e & 1 << s) !== 0;
17
- }
18
- } else if ("test" in n)
19
- return !!n.test(i);
20
- return !0;
21
- }
22
- export {
23
- u as matchesCollisionSelector
24
- };
@@ -1,77 +0,0 @@
1
- import d from "@dimforge/rapier3d-compat";
2
- import { state as c } from "../game/game-state.js";
3
- import { ZylemActor as h } from "../entities/actor.js";
4
- import { isCollisionHandlerDelegate as n } from "./collision-delegate.js";
5
- class v {
6
- type = "World";
7
- world;
8
- collisionMap = /* @__PURE__ */ new Map();
9
- collisionBehaviorMap = /* @__PURE__ */ new Map();
10
- _removalMap = /* @__PURE__ */ new Map();
11
- static async loadPhysics(o) {
12
- return await d.init(), new d.World(o);
13
- }
14
- constructor(o) {
15
- this.world = o;
16
- }
17
- addEntity(o) {
18
- const i = this.world.createRigidBody(o.bodyDesc);
19
- o.body = i, o.body.userData = { uuid: o.uuid, ref: o }, this.world.gravity.x === 0 && this.world.gravity.y === 0 && this.world.gravity.z === 0 && (o.body.lockTranslations(!0, !0), o.body.lockRotations(!0, !0));
20
- const e = this.world.createCollider(o.colliderDesc, o.body);
21
- o.collider = e, (o.controlledRotation || o instanceof h) && (o.body.lockRotations(!0, !0), o.characterController = this.world.createCharacterController(0.01), o.characterController.setMaxSlopeClimbAngle(45 * Math.PI / 180), o.characterController.setMinSlopeSlideAngle(30 * Math.PI / 180), o.characterController.enableSnapToGround(0.01), o.characterController.setSlideEnabled(!0), o.characterController.setApplyImpulsesToDynamicBodies(!0), o.characterController.setCharacterMass(1)), this.collisionMap.set(o.uuid, o);
22
- }
23
- setForRemoval(o) {
24
- o.body && this._removalMap.set(o.uuid, o);
25
- }
26
- destroyEntity(o) {
27
- o.collider && this.world.removeCollider(o.collider, !0), o.body && (this.world.removeRigidBody(o.body), this.collisionMap.delete(o.uuid), this._removalMap.delete(o.uuid));
28
- }
29
- setup() {
30
- }
31
- update(o) {
32
- const { delta: i } = o;
33
- this.world && (this.updateColliders(i), this.updatePostCollisionBehaviors(i), this.world.step());
34
- }
35
- updatePostCollisionBehaviors(o) {
36
- const i = this.collisionBehaviorMap;
37
- for (let [e, a] of i) {
38
- const r = a;
39
- if (!n(r))
40
- return;
41
- r.handlePostCollision({ entity: r, delta: o }) || this.collisionBehaviorMap.delete(e);
42
- }
43
- }
44
- updateColliders(o) {
45
- const i = this.collisionMap;
46
- for (let [e, a] of i) {
47
- const r = a;
48
- if (r.body) {
49
- if (this._removalMap.get(r.uuid)) {
50
- this.destroyEntity(r);
51
- continue;
52
- }
53
- this.world.contactsWith(r.body.collider(0), (t) => {
54
- const s = t._parent.userData.uuid, l = i.get(s);
55
- l && r._collision && r._collision(l, c.globals);
56
- }), this.world.intersectionsWith(r.body.collider(0), (t) => {
57
- const s = t._parent.userData.uuid, l = i.get(s);
58
- l && (r._collision && r._collision(l, c.globals), n(l) && (l.handleIntersectionEvent({ entity: l, other: r, delta: o }), this.collisionBehaviorMap.set(s, l)));
59
- });
60
- }
61
- }
62
- }
63
- destroy() {
64
- try {
65
- for (const [, o] of this.collisionMap)
66
- try {
67
- this.destroyEntity(o);
68
- } catch {
69
- }
70
- this.collisionMap.clear(), this.collisionBehaviorMap.clear(), this._removalMap.clear(), this.world = void 0;
71
- } catch {
72
- }
73
- }
74
- }
75
- export {
76
- v as ZylemWorld
77
- };
@@ -1,61 +0,0 @@
1
- import { nanoid as o } from "nanoid";
2
- class s {
3
- parent = null;
4
- children = [];
5
- options;
6
- eid = 0;
7
- uuid = "";
8
- name = "";
9
- markedForRemoval = !1;
10
- setup = () => {
11
- };
12
- loaded = () => {
13
- };
14
- update = () => {
15
- };
16
- destroy = () => {
17
- };
18
- cleanup = () => {
19
- };
20
- constructor(t = []) {
21
- const e = t.filter((i) => !(i instanceof s)).reduce((i, n) => ({ ...i, ...n }), {});
22
- this.options = e, this.uuid = o();
23
- }
24
- setParent(t) {
25
- this.parent = t;
26
- }
27
- getParent() {
28
- return this.parent;
29
- }
30
- add(t) {
31
- this.children.push(t), t.setParent(this);
32
- }
33
- remove(t) {
34
- const e = this.children.indexOf(t);
35
- e !== -1 && (this.children.splice(e, 1), t.setParent(null));
36
- }
37
- getChildren() {
38
- return this.children;
39
- }
40
- isComposite() {
41
- return this.children.length > 0;
42
- }
43
- nodeSetup(t) {
44
- this.markedForRemoval = !1, typeof this._setup == "function" && this._setup(t), this.setup && this.setup(t), this.children.forEach((e) => e.nodeSetup(t));
45
- }
46
- nodeUpdate(t) {
47
- this.markedForRemoval || (typeof this._update == "function" && this._update(t), this.update && this.update(t), this.children.forEach((e) => e.nodeUpdate(t)));
48
- }
49
- nodeDestroy(t) {
50
- this.children.forEach((e) => e.nodeDestroy(t)), this.destroy && this.destroy(t), typeof this._destroy == "function" && this._destroy(t), this.markedForRemoval = !0;
51
- }
52
- getOptions() {
53
- return this.options;
54
- }
55
- setOptions(t) {
56
- this.options = { ...this.options, ...t };
57
- }
58
- }
59
- export {
60
- s as BaseNode
61
- };