@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.
- package/README.md +23 -41
- package/dist/actions.d.ts +25 -0
- package/dist/actions.js +287 -8
- package/dist/actions.js.map +1 -0
- package/dist/behaviors.d.ts +108 -0
- package/dist/behaviors.js +396 -6
- package/dist/behaviors.js.map +1 -0
- package/dist/{src/lib/camera/zylem-camera.d.ts → camera-Dk-fOVZE.d.ts} +55 -8
- package/dist/camera.d.ts +5 -0
- package/dist/camera.js +504 -4
- package/dist/camera.js.map +1 -0
- package/dist/core-C2mjetAd.d.ts +431 -0
- package/dist/core.d.ts +9 -0
- package/dist/core.js +4780 -9
- package/dist/core.js.map +1 -0
- package/dist/entities.d.ts +269 -0
- package/dist/entities.js +2161 -17
- package/dist/entities.js.map +1 -0
- package/dist/entity-bQElAdpo.d.ts +347 -0
- package/dist/entity-spawner-DNnLYnZq.d.ts +11 -0
- package/dist/main.d.ts +135 -0
- package/dist/main.js +6599 -56
- package/dist/main.js.map +1 -0
- package/dist/moveable-B_vyA6cw.d.ts +67 -0
- package/dist/stage-CrmY7V0i.d.ts +287 -0
- package/dist/stage.d.ts +26 -0
- package/dist/stage.js +2229 -4
- package/dist/stage.js.map +1 -0
- package/dist/transformable-CUhvyuYO.d.ts +67 -0
- package/package.json +9 -45
- package/LICENSE +0 -21
- package/dist/.vite/manifest.json +0 -716
- package/dist/assets/zylem-logo.png +0 -0
- package/dist/examples/00-readme-example.d.ts +0 -2
- package/dist/examples/00-readme-example.d.ts.map +0 -1
- package/dist/examples/01-basic.d.ts +0 -2
- package/dist/examples/01-basic.d.ts.map +0 -1
- package/dist/examples/01.1-basic-ball.d.ts +0 -9
- package/dist/examples/01.1-basic-ball.d.ts.map +0 -1
- package/dist/examples/01.2-ricochet-test.d.ts +0 -2
- package/dist/examples/01.2-ricochet-test.d.ts.map +0 -1
- package/dist/examples/01.3-rect.d.ts +0 -2
- package/dist/examples/01.3-rect.d.ts.map +0 -1
- package/dist/examples/02-input.d.ts +0 -2
- package/dist/examples/02-input.d.ts.map +0 -1
- package/dist/examples/03-stage-test/03-stage-test.d.ts +0 -2
- package/dist/examples/03-stage-test/03-stage-test.d.ts.map +0 -1
- package/dist/examples/03-stage-test/stage0.d.ts +0 -2
- package/dist/examples/03-stage-test/stage0.d.ts.map +0 -1
- package/dist/examples/03-stage-test/stage1.d.ts +0 -2
- package/dist/examples/03-stage-test/stage1.d.ts.map +0 -1
- package/dist/examples/03-stage-test/stage2.d.ts +0 -2
- package/dist/examples/03-stage-test/stage2.d.ts.map +0 -1
- package/dist/examples/03-stage-test/stage3.d.ts +0 -2
- package/dist/examples/03-stage-test/stage3.d.ts.map +0 -1
- package/dist/examples/03.1-stage-variable.d.ts +0 -2
- package/dist/examples/03.1-stage-variable.d.ts.map +0 -1
- package/dist/examples/04-vessel-test.d.ts +0 -18
- package/dist/examples/04-vessel-test.d.ts.map +0 -1
- package/dist/examples/05-camera-test.d.ts +0 -2
- package/dist/examples/05-camera-test.d.ts.map +0 -1
- package/dist/examples/06-entity-test.d.ts +0 -2
- package/dist/examples/06-entity-test.d.ts.map +0 -1
- package/dist/examples/07-behaviors.d.ts +0 -2
- package/dist/examples/07-behaviors.d.ts.map +0 -1
- package/dist/examples/07.01-behavior-context.d.ts +0 -2
- package/dist/examples/07.01-behavior-context.d.ts.map +0 -1
- package/dist/examples/08-pong.d.ts +0 -2
- package/dist/examples/08-pong.d.ts.map +0 -1
- package/dist/examples/08.01-breakout.d.ts +0 -2
- package/dist/examples/08.01-breakout.d.ts.map +0 -1
- package/dist/examples/09-space-invaders.d.ts +0 -2
- package/dist/examples/09-space-invaders.d.ts.map +0 -1
- package/dist/examples/10-asteroids.d.ts +0 -2
- package/dist/examples/10-asteroids.d.ts.map +0 -1
- package/dist/examples/11-2d-platformer.d.ts +0 -2
- package/dist/examples/11-2d-platformer.d.ts.map +0 -1
- package/dist/examples/12-3d-platformer.d.ts +0 -2
- package/dist/examples/12-3d-platformer.d.ts.map +0 -1
- package/dist/examples/13-fps.d.ts +0 -2
- package/dist/examples/13-fps.d.ts.map +0 -1
- package/dist/examples/14-strategy.d.ts +0 -2
- package/dist/examples/14-strategy.d.ts.map +0 -1
- package/dist/examples/15-zylem-planet-demo.d.ts +0 -2
- package/dist/examples/15-zylem-planet-demo.d.ts.map +0 -1
- package/dist/examples/16-timbotron.d.ts +0 -2
- package/dist/examples/16-timbotron.d.ts.map +0 -1
- package/dist/examples/17-stress-test.d.ts +0 -2
- package/dist/examples/17-stress-test.d.ts.map +0 -1
- package/dist/examples/architecture-test.d.ts +0 -2
- package/dist/examples/architecture-test.d.ts.map +0 -1
- package/dist/examples/utils.d.ts +0 -10
- package/dist/examples/utils.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/actions.js +0 -35
- package/dist/lib/actions/behaviors/boundaries/boundary.js +0 -40
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.js +0 -100
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.js +0 -37
- package/dist/lib/actions/behaviors/ricochet/ricochet.js +0 -6
- package/dist/lib/actions/capabilities/moveable.js +0 -108
- package/dist/lib/actions/capabilities/rotatable.js +0 -82
- package/dist/lib/actions/capabilities/transformable.js +0 -9
- package/dist/lib/actions/global-change.js +0 -40
- package/dist/lib/camera/camera.js +0 -19
- package/dist/lib/camera/fixed-2d.js +0 -30
- package/dist/lib/camera/perspective.js +0 -10
- package/dist/lib/camera/third-person.js +0 -42
- package/dist/lib/camera/zylem-camera.js +0 -208
- package/dist/lib/collision/collision-builder.js +0 -46
- package/dist/lib/collision/collision-delegate.js +0 -6
- package/dist/lib/collision/utils.js +0 -24
- package/dist/lib/collision/world.js +0 -77
- package/dist/lib/core/base-node.js +0 -61
- package/dist/lib/core/entity-asset-loader.js +0 -54
- package/dist/lib/core/lifecycle-base.js +0 -20
- package/dist/lib/core/preset-shader.js +0 -26
- package/dist/lib/core/three-addons/Timer.js +0 -103
- package/dist/lib/core/utility/nodes.js +0 -31
- package/dist/lib/core/utility/strings.js +0 -14
- package/dist/lib/core/utility/vector.js +0 -8
- package/dist/lib/core/vessel.js +0 -26
- package/dist/lib/debug/console/console-state.js +0 -11
- package/dist/lib/debug/debug-state.js +0 -40
- package/dist/lib/device/aspect-ratio.js +0 -44
- package/dist/lib/entities/actor.js +0 -122
- package/dist/lib/entities/box.js +0 -68
- package/dist/lib/entities/builder.js +0 -79
- package/dist/lib/entities/create.js +0 -31
- package/dist/lib/entities/delegates/animation.js +0 -58
- package/dist/lib/entities/delegates/debug.js +0 -71
- package/dist/lib/entities/delegates/loader.js +0 -19
- package/dist/lib/entities/destroy.js +0 -15
- package/dist/lib/entities/entity-factory.js +0 -24
- package/dist/lib/entities/entity.js +0 -121
- package/dist/lib/entities/plane.js +0 -81
- package/dist/lib/entities/rect.js +0 -160
- package/dist/lib/entities/sphere.js +0 -68
- package/dist/lib/entities/sprite.js +0 -125
- package/dist/lib/entities/text.js +0 -140
- package/dist/lib/entities/zone.js +0 -103
- package/dist/lib/game/game-canvas.js +0 -57
- package/dist/lib/game/game-config.js +0 -78
- package/dist/lib/game/game-default.js +0 -23
- package/dist/lib/game/game-retro-resolutions.js +0 -80
- package/dist/lib/game/game-state.js +0 -17
- package/dist/lib/game/game.js +0 -131
- package/dist/lib/game/zylem-game.js +0 -140
- package/dist/lib/graphics/geometries/XZPlaneGeometry.js +0 -34
- package/dist/lib/graphics/material.js +0 -64
- package/dist/lib/graphics/mesh.js +0 -14
- package/dist/lib/graphics/render-pass.js +0 -56
- package/dist/lib/graphics/shaders/fragment/debug.glsl.js +0 -23
- package/dist/lib/graphics/shaders/fragment/fire.glsl.js +0 -52
- package/dist/lib/graphics/shaders/fragment/standard.glsl.js +0 -11
- package/dist/lib/graphics/shaders/fragment/stars.glsl.js +0 -44
- package/dist/lib/graphics/shaders/vertex/debug.glsl.js +0 -15
- package/dist/lib/graphics/shaders/vertex/object-shader.glsl.js +0 -11
- package/dist/lib/graphics/shaders/vertex/standard.glsl.js +0 -9
- package/dist/lib/graphics/zylem-scene.js +0 -75
- package/dist/lib/input/gamepad-provider.js +0 -58
- package/dist/lib/input/input-manager.js +0 -70
- package/dist/lib/input/keyboard-provider.js +0 -120
- package/dist/lib/stage/debug-entity-cursor.js +0 -53
- package/dist/lib/stage/entity-spawner.js +0 -27
- package/dist/lib/stage/stage-debug-delegate.js +0 -100
- package/dist/lib/stage/stage-default.js +0 -32
- package/dist/lib/stage/stage-factory.js +0 -22
- package/dist/lib/stage/stage-manager.js +0 -49
- package/dist/lib/stage/stage-state.js +0 -36
- package/dist/lib/stage/stage.js +0 -67
- package/dist/lib/stage/zylem-stage.js +0 -268
- package/dist/lib/systems/transformable.system.js +0 -43
- package/dist/node_modules/.pnpm/idb-keyval@6.2.2/node_modules/idb-keyval/dist/index.js +0 -34
- package/dist/node_modules/.pnpm/msgpackr@1.11.5/node_modules/msgpackr/pack.js +0 -520
- package/dist/node_modules/.pnpm/msgpackr@1.11.5/node_modules/msgpackr/unpack.js +0 -672
- package/dist/src/api/actions.d.ts +0 -5
- package/dist/src/api/actions.d.ts.map +0 -1
- package/dist/src/api/behaviors.d.ts +0 -4
- package/dist/src/api/behaviors.d.ts.map +0 -1
- package/dist/src/api/camera.d.ts +0 -4
- package/dist/src/api/camera.d.ts.map +0 -1
- package/dist/src/api/core.d.ts +0 -6
- package/dist/src/api/core.d.ts.map +0 -1
- package/dist/src/api/entities.d.ts +0 -9
- package/dist/src/api/entities.d.ts.map +0 -1
- package/dist/src/api/main.d.ts +0 -32
- package/dist/src/api/main.d.ts.map +0 -1
- package/dist/src/api/stage.d.ts +0 -5
- package/dist/src/api/stage.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/actions.d.ts +0 -11
- package/dist/src/lib/actions/behaviors/actions.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/behavior.d.ts +0 -6
- package/dist/src/lib/actions/behaviors/behavior.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/boundaries/boundary.d.ts +0 -37
- package/dist/src/lib/actions/behaviors/boundaries/boundary.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/character-controller.d.ts +0 -6
- package/dist/src/lib/actions/behaviors/character-controller.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/debug/debug-collision.d.ts +0 -6
- package/dist/src/lib/actions/behaviors/debug/debug-collision.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/debug/debug-update.d.ts +0 -5
- package/dist/src/lib/actions/behaviors/debug/debug-update.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/debug/debug.d.ts +0 -10
- package/dist/src/lib/actions/behaviors/debug/debug.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/movement/movement-sequence-2d.d.ts +0 -24
- package/dist/src/lib/actions/behaviors/movement/movement-sequence-2d.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts +0 -11
- package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts +0 -12
- package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/ricochet/ricochet.d.ts +0 -44
- package/dist/src/lib/actions/behaviors/ricochet/ricochet.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/zylem-behavior.d.ts +0 -2
- package/dist/src/lib/actions/behaviors/zylem-behavior.d.ts.map +0 -1
- package/dist/src/lib/actions/capabilities/moveable.d.ts +0 -125
- package/dist/src/lib/actions/capabilities/moveable.d.ts.map +0 -1
- package/dist/src/lib/actions/capabilities/rotatable.d.ts +0 -111
- package/dist/src/lib/actions/capabilities/rotatable.d.ts.map +0 -1
- package/dist/src/lib/actions/capabilities/transformable.d.ts +0 -7
- package/dist/src/lib/actions/capabilities/transformable.d.ts.map +0 -1
- package/dist/src/lib/actions/global-change.d.ts +0 -23
- package/dist/src/lib/actions/global-change.d.ts.map +0 -1
- package/dist/src/lib/camera/camera.d.ts +0 -16
- package/dist/src/lib/camera/camera.d.ts.map +0 -1
- package/dist/src/lib/camera/fixed-2d.d.ts +0 -32
- package/dist/src/lib/camera/fixed-2d.d.ts.map +0 -1
- package/dist/src/lib/camera/perspective.d.ts +0 -9
- package/dist/src/lib/camera/perspective.d.ts.map +0 -1
- package/dist/src/lib/camera/third-person.d.ts +0 -32
- package/dist/src/lib/camera/third-person.d.ts.map +0 -1
- package/dist/src/lib/camera/zylem-camera.d.ts.map +0 -1
- package/dist/src/lib/collision/collision-builder.d.ts +0 -17
- package/dist/src/lib/collision/collision-builder.d.ts.map +0 -1
- package/dist/src/lib/collision/collision-delegate.d.ts +0 -6
- package/dist/src/lib/collision/collision-delegate.d.ts.map +0 -1
- package/dist/src/lib/collision/collision-group.d.ts +0 -11
- package/dist/src/lib/collision/collision-group.d.ts.map +0 -1
- package/dist/src/lib/collision/collision-mask.d.ts +0 -18
- package/dist/src/lib/collision/collision-mask.d.ts.map +0 -1
- package/dist/src/lib/collision/collision.d.ts +0 -19
- package/dist/src/lib/collision/collision.d.ts.map +0 -1
- package/dist/src/lib/collision/utils.d.ts +0 -15
- package/dist/src/lib/collision/utils.d.ts.map +0 -1
- package/dist/src/lib/collision/world.d.ts +0 -23
- package/dist/src/lib/collision/world.d.ts.map +0 -1
- package/dist/src/lib/core/asset-manager.d.ts +0 -2
- package/dist/src/lib/core/asset-manager.d.ts.map +0 -1
- package/dist/src/lib/core/base-node-life-cycle.d.ts +0 -54
- package/dist/src/lib/core/base-node-life-cycle.d.ts.map +0 -1
- package/dist/src/lib/core/base-node.d.ts +0 -36
- package/dist/src/lib/core/base-node.d.ts.map +0 -1
- package/dist/src/lib/core/blueprints.d.ts +0 -22
- package/dist/src/lib/core/blueprints.d.ts.map +0 -1
- package/dist/src/lib/core/entity-asset-loader.d.ts +0 -16
- package/dist/src/lib/core/entity-asset-loader.d.ts.map +0 -1
- package/dist/src/lib/core/errors.d.ts +0 -5
- package/dist/src/lib/core/errors.d.ts.map +0 -1
- package/dist/src/lib/core/flags.d.ts +0 -3
- package/dist/src/lib/core/flags.d.ts.map +0 -1
- package/dist/src/lib/core/index.d.ts +0 -5
- package/dist/src/lib/core/index.d.ts.map +0 -1
- package/dist/src/lib/core/interfaces.d.ts +0 -25
- package/dist/src/lib/core/interfaces.d.ts.map +0 -1
- package/dist/src/lib/core/lazy-loader.d.ts +0 -80
- package/dist/src/lib/core/lazy-loader.d.ts.map +0 -1
- package/dist/src/lib/core/lifecycle-base.d.ts +0 -17
- package/dist/src/lib/core/lifecycle-base.d.ts.map +0 -1
- package/dist/src/lib/core/node-interface.d.ts +0 -12
- package/dist/src/lib/core/node-interface.d.ts.map +0 -1
- package/dist/src/lib/core/preset-shader.d.ts +0 -8
- package/dist/src/lib/core/preset-shader.d.ts.map +0 -1
- package/dist/src/lib/core/three-addons/Timer.d.ts +0 -92
- package/dist/src/lib/core/three-addons/Timer.d.ts.map +0 -1
- package/dist/src/lib/core/utility/nodes.d.ts +0 -13
- package/dist/src/lib/core/utility/nodes.d.ts.map +0 -1
- package/dist/src/lib/core/utility/strings.d.ts +0 -3
- package/dist/src/lib/core/utility/strings.d.ts.map +0 -1
- package/dist/src/lib/core/utility/vector.d.ts +0 -8
- package/dist/src/lib/core/utility/vector.d.ts.map +0 -1
- package/dist/src/lib/core/vector.d.ts +0 -4
- package/dist/src/lib/core/vector.d.ts.map +0 -1
- package/dist/src/lib/core/vessel.d.ts +0 -13
- package/dist/src/lib/core/vessel.d.ts.map +0 -1
- package/dist/src/lib/debug/console/console-state.d.ts +0 -20
- package/dist/src/lib/debug/console/console-state.d.ts.map +0 -1
- package/dist/src/lib/debug/console/console-store.d.ts +0 -6
- package/dist/src/lib/debug/console/console-store.d.ts.map +0 -1
- package/dist/src/lib/debug/debug-state.d.ts +0 -38
- package/dist/src/lib/debug/debug-state.d.ts.map +0 -1
- package/dist/src/lib/debug/debug-store.d.ts +0 -15
- package/dist/src/lib/debug/debug-store.d.ts.map +0 -1
- package/dist/src/lib/debug/state-based-debug-loader.d.ts +0 -8
- package/dist/src/lib/debug/state-based-debug-loader.d.ts.map +0 -1
- package/dist/src/lib/device/aspect-ratio.d.ts +0 -38
- package/dist/src/lib/device/aspect-ratio.d.ts.map +0 -1
- package/dist/src/lib/device/desktop.d.ts +0 -2
- package/dist/src/lib/device/desktop.d.ts.map +0 -1
- package/dist/src/lib/device/mobile.d.ts +0 -2
- package/dist/src/lib/device/mobile.d.ts.map +0 -1
- package/dist/src/lib/device/tablet.d.ts +0 -2
- package/dist/src/lib/device/tablet.d.ts.map +0 -1
- package/dist/src/lib/entities/actor.d.ts +0 -44
- package/dist/src/lib/entities/actor.d.ts.map +0 -1
- package/dist/src/lib/entities/box.d.ts +0 -27
- package/dist/src/lib/entities/box.d.ts.map +0 -1
- package/dist/src/lib/entities/builder.d.ts +0 -28
- package/dist/src/lib/entities/builder.d.ts.map +0 -1
- package/dist/src/lib/entities/create.d.ts +0 -15
- package/dist/src/lib/entities/create.d.ts.map +0 -1
- package/dist/src/lib/entities/delegates/animation.d.ts +0 -33
- package/dist/src/lib/entities/delegates/animation.d.ts.map +0 -1
- package/dist/src/lib/entities/delegates/debug.d.ts +0 -29
- package/dist/src/lib/entities/delegates/debug.d.ts.map +0 -1
- package/dist/src/lib/entities/delegates/loader.d.ts +0 -12
- package/dist/src/lib/entities/delegates/loader.d.ts.map +0 -1
- package/dist/src/lib/entities/destroy.d.ts +0 -4
- package/dist/src/lib/entities/destroy.d.ts.map +0 -1
- package/dist/src/lib/entities/entity-factory.d.ts +0 -10
- package/dist/src/lib/entities/entity-factory.d.ts.map +0 -1
- package/dist/src/lib/entities/entity.d.ts +0 -98
- package/dist/src/lib/entities/entity.d.ts.map +0 -1
- package/dist/src/lib/entities/index.d.ts +0 -12
- package/dist/src/lib/entities/index.d.ts.map +0 -1
- package/dist/src/lib/entities/plane.d.ts +0 -36
- package/dist/src/lib/entities/plane.d.ts.map +0 -1
- package/dist/src/lib/entities/rect.d.ts +0 -63
- package/dist/src/lib/entities/rect.d.ts.map +0 -1
- package/dist/src/lib/entities/sphere.d.ts +0 -29
- package/dist/src/lib/entities/sphere.d.ts.map +0 -1
- package/dist/src/lib/entities/sprite.d.ts +0 -54
- package/dist/src/lib/entities/sprite.d.ts.map +0 -1
- package/dist/src/lib/entities/text.d.ts +0 -49
- package/dist/src/lib/entities/text.d.ts.map +0 -1
- package/dist/src/lib/entities/zone.d.ts +0 -54
- package/dist/src/lib/entities/zone.d.ts.map +0 -1
- package/dist/src/lib/game/game-blueprint.d.ts +0 -38
- package/dist/src/lib/game/game-blueprint.d.ts.map +0 -1
- package/dist/src/lib/game/game-canvas.d.ts +0 -35
- package/dist/src/lib/game/game-canvas.d.ts.map +0 -1
- package/dist/src/lib/game/game-config.d.ts +0 -59
- package/dist/src/lib/game/game-config.d.ts.map +0 -1
- package/dist/src/lib/game/game-default.d.ts +0 -14
- package/dist/src/lib/game/game-default.d.ts.map +0 -1
- package/dist/src/lib/game/game-interfaces.d.ts +0 -29
- package/dist/src/lib/game/game-interfaces.d.ts.map +0 -1
- package/dist/src/lib/game/game-retro-resolutions.d.ts +0 -25
- package/dist/src/lib/game/game-retro-resolutions.d.ts.map +0 -1
- package/dist/src/lib/game/game-state.d.ts +0 -11
- package/dist/src/lib/game/game-state.d.ts.map +0 -1
- package/dist/src/lib/game/game.d.ts +0 -39
- package/dist/src/lib/game/game.d.ts.map +0 -1
- package/dist/src/lib/game/zylem-game.d.ts +0 -58
- package/dist/src/lib/game/zylem-game.d.ts.map +0 -1
- package/dist/src/lib/graphics/geometries/XZPlaneGeometry.d.ts +0 -8
- package/dist/src/lib/graphics/geometries/XZPlaneGeometry.d.ts.map +0 -1
- package/dist/src/lib/graphics/material.d.ts +0 -29
- package/dist/src/lib/graphics/material.d.ts.map +0 -1
- package/dist/src/lib/graphics/mesh.d.ts +0 -19
- package/dist/src/lib/graphics/mesh.d.ts.map +0 -1
- package/dist/src/lib/graphics/render-pass.d.ts +0 -17
- package/dist/src/lib/graphics/render-pass.d.ts.map +0 -1
- package/dist/src/lib/graphics/zylem-scene.d.ts +0 -50
- package/dist/src/lib/graphics/zylem-scene.d.ts.map +0 -1
- package/dist/src/lib/input/gamepad-provider.d.ts +0 -14
- package/dist/src/lib/input/gamepad-provider.d.ts.map +0 -1
- package/dist/src/lib/input/input-manager.d.ts +0 -15
- package/dist/src/lib/input/input-manager.d.ts.map +0 -1
- package/dist/src/lib/input/input-provider.d.ts +0 -7
- package/dist/src/lib/input/input-provider.d.ts.map +0 -1
- package/dist/src/lib/input/input.d.ts +0 -48
- package/dist/src/lib/input/input.d.ts.map +0 -1
- package/dist/src/lib/input/keyboard-provider.d.ts +0 -21
- package/dist/src/lib/input/keyboard-provider.d.ts.map +0 -1
- package/dist/src/lib/interfaces/entity.d.ts +0 -26
- package/dist/src/lib/interfaces/entity.d.ts.map +0 -1
- package/dist/src/lib/sounds/index.d.ts +0 -3
- package/dist/src/lib/sounds/index.d.ts.map +0 -1
- package/dist/src/lib/sounds/ping-pong-sound.d.ts +0 -5
- package/dist/src/lib/sounds/ping-pong-sound.d.ts.map +0 -1
- package/dist/src/lib/sounds/ricochet-sound.d.ts +0 -5
- package/dist/src/lib/sounds/ricochet-sound.d.ts.map +0 -1
- package/dist/src/lib/stage/debug-entity-cursor.d.ts +0 -24
- package/dist/src/lib/stage/debug-entity-cursor.d.ts.map +0 -1
- package/dist/src/lib/stage/entity-spawner.d.ts +0 -9
- package/dist/src/lib/stage/entity-spawner.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-camera-debug-delegate.d.ts +0 -14
- package/dist/src/lib/stage/stage-camera-debug-delegate.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-debug-delegate.d.ts +0 -26
- package/dist/src/lib/stage/stage-debug-delegate.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-default.d.ts +0 -3
- package/dist/src/lib/stage/stage-default.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-factory.d.ts +0 -6
- package/dist/src/lib/stage/stage-factory.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-manager.d.ts +0 -30
- package/dist/src/lib/stage/stage-manager.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-state.d.ts +0 -14
- package/dist/src/lib/stage/stage-state.d.ts.map +0 -1
- package/dist/src/lib/stage/stage.d.ts +0 -35
- package/dist/src/lib/stage/stage.d.ts.map +0 -1
- package/dist/src/lib/stage/zylem-stage.d.ts +0 -128
- package/dist/src/lib/stage/zylem-stage.d.ts.map +0 -1
- package/dist/src/lib/systems/test-system.d.ts +0 -2
- package/dist/src/lib/systems/test-system.d.ts.map +0 -1
- package/dist/src/lib/systems/transformable.system.d.ts +0 -25
- package/dist/src/lib/systems/transformable.system.d.ts.map +0 -1
- package/dist/src/lib/types/entity-types.d.ts +0 -24
- package/dist/src/lib/types/entity-types.d.ts.map +0 -1
- package/dist/src/lib/types/index.d.ts +0 -3
- package/dist/src/lib/types/index.d.ts.map +0 -1
- package/dist/src/lib/types/stage-types.d.ts +0 -26
- package/dist/src/lib/types/stage-types.d.ts.map +0 -1
- package/dist/src/lib/ui/Debug.d.ts +0 -6
- package/dist/src/lib/ui/Debug.d.ts.map +0 -1
- package/dist/src/lib/ui/console/Console.d.ts +0 -7
- package/dist/src/lib/ui/console/Console.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/AccordionMenu.d.ts +0 -7
- package/dist/src/lib/ui/debug-panel/AccordionMenu.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/Menu.d.ts +0 -6
- package/dist/src/lib/ui/debug-panel/Menu.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/sections/EntitiesSection.d.ts +0 -4
- package/dist/src/lib/ui/debug-panel/sections/EntitiesSection.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/sections/GameSection.d.ts +0 -3
- package/dist/src/lib/ui/debug-panel/sections/GameSection.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/sections/StagesSection.d.ts +0 -3
- package/dist/src/lib/ui/debug-panel/sections/StagesSection.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/sections/all.d.ts +0 -4
- package/dist/src/lib/ui/debug-panel/sections/all.d.ts.map +0 -1
- package/dist/src/lib/ui/toolbar/Toolbar.d.ts +0 -6
- package/dist/src/lib/ui/toolbar/Toolbar.d.ts.map +0 -1
- package/dist/tests/e2e/basic-game.spec.d.ts +0 -2
- package/dist/tests/e2e/basic-game.spec.d.ts.map +0 -1
- package/dist/tests/integration/debug.sim.spec.d.ts +0 -2
- package/dist/tests/integration/debug.sim.spec.d.ts.map +0 -1
- package/dist/tests/unit/collision/collision.spec.d.ts +0 -2
- package/dist/tests/unit/collision/collision.spec.d.ts.map +0 -1
- package/dist/tests/unit/core/base-node.spec.d.ts +0 -2
- package/dist/tests/unit/core/base-node.spec.d.ts.map +0 -1
- package/dist/tests/unit/core/game.spec.d.ts +0 -2
- package/dist/tests/unit/core/game.spec.d.ts.map +0 -1
- package/dist/tests/unit/core/stage.spec.d.ts +0 -2
- package/dist/tests/unit/core/stage.spec.d.ts.map +0 -1
- package/dist/tests/unit/core/vessel.spec.d.ts +0 -2
- package/dist/tests/unit/core/vessel.spec.d.ts.map +0 -1
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import { createWorld as c, addEntity as u, addComponent as f, removeEntity as p } from "bitecs";
|
|
2
|
-
import { Vector3 as o, Color as d, Vector2 as m } from "three";
|
|
3
|
-
import { ZylemWorld as l } from "../collision/world.js";
|
|
4
|
-
import { ZylemScene as y } from "../graphics/zylem-scene.js";
|
|
5
|
-
import { setStageBackgroundColor as g, setStageBackgroundImage as E, setStageVariables as b, resetStageVariables as w } from "./stage-state.js";
|
|
6
|
-
import { ZylemBlueColor as S } from "../core/utility/vector.js";
|
|
7
|
-
import { debugState as a } from "../debug/debug-state.js";
|
|
8
|
-
import { getGlobalState as h } from "../game/game-state.js";
|
|
9
|
-
import { LifeCycleBase as v } from "../core/lifecycle-base.js";
|
|
10
|
-
import M from "../systems/transformable.system.js";
|
|
11
|
-
import { BaseNode as _ } from "../core/base-node.js";
|
|
12
|
-
import { nanoid as C } from "nanoid";
|
|
13
|
-
import { Perspectives as D } from "../camera/perspective.js";
|
|
14
|
-
import { CameraWrapper as B } from "../camera/camera.js";
|
|
15
|
-
import { StageDebugDelegate as O } from "./stage-debug-delegate.js";
|
|
16
|
-
import { GameEntity as P } from "../entities/entity.js";
|
|
17
|
-
import { ZylemCamera as R } from "../camera/zylem-camera.js";
|
|
18
|
-
const W = "Stage";
|
|
19
|
-
class Y extends v {
|
|
20
|
-
type = W;
|
|
21
|
-
state = {
|
|
22
|
-
backgroundColor: S,
|
|
23
|
-
backgroundImage: null,
|
|
24
|
-
inputs: {
|
|
25
|
-
p1: ["gamepad-1", "keyboard"],
|
|
26
|
-
p2: ["gamepad-2", "keyboard"]
|
|
27
|
-
},
|
|
28
|
-
gravity: new o(0, 0, 0),
|
|
29
|
-
variables: {},
|
|
30
|
-
entities: []
|
|
31
|
-
};
|
|
32
|
-
gravity;
|
|
33
|
-
world;
|
|
34
|
-
scene;
|
|
35
|
-
children = [];
|
|
36
|
-
_childrenMap = /* @__PURE__ */ new Map();
|
|
37
|
-
_removalMap = /* @__PURE__ */ new Map();
|
|
38
|
-
pendingEntities = [];
|
|
39
|
-
pendingPromises = [];
|
|
40
|
-
isLoaded = !1;
|
|
41
|
-
_debugMap = /* @__PURE__ */ new Map();
|
|
42
|
-
entityAddedHandlers = [];
|
|
43
|
-
ecs = c();
|
|
44
|
-
testSystem = null;
|
|
45
|
-
transformSystem = null;
|
|
46
|
-
debugDelegate = null;
|
|
47
|
-
cameraDebugDelegate = null;
|
|
48
|
-
uuid;
|
|
49
|
-
wrapperRef = null;
|
|
50
|
-
camera;
|
|
51
|
-
cameraRef = null;
|
|
52
|
-
/**
|
|
53
|
-
* Create a new stage.
|
|
54
|
-
* @param options Stage options: partial config, camera, and initial entities or factories
|
|
55
|
-
*/
|
|
56
|
-
constructor(e = []) {
|
|
57
|
-
super(), this.world = null, this.scene = null, this.uuid = C();
|
|
58
|
-
const { config: t, entities: i, asyncEntities: s, camera: r } = this.parseOptions(e);
|
|
59
|
-
this.camera = r, this.children = i, this.pendingEntities = s, this.saveState({ ...this.state, ...t, entities: [] }), this.gravity = t.gravity ?? new o(0, 0, 0);
|
|
60
|
-
}
|
|
61
|
-
parseOptions(e) {
|
|
62
|
-
let t = {};
|
|
63
|
-
const i = [], s = [];
|
|
64
|
-
let r;
|
|
65
|
-
for (const n of e)
|
|
66
|
-
this.isCameraWrapper(n) ? r = n : this.isBaseNode(n) ? i.push(n) : this.isEntityInput(n) ? s.push(n) : this.isZylemStageConfig(n) && (t = { ...t, ...n });
|
|
67
|
-
return { config: t, entities: i, asyncEntities: s, camera: r };
|
|
68
|
-
}
|
|
69
|
-
isZylemStageConfig(e) {
|
|
70
|
-
return e && typeof e == "object" && !(e instanceof _) && !(e instanceof B);
|
|
71
|
-
}
|
|
72
|
-
isBaseNode(e) {
|
|
73
|
-
return e && typeof e == "object" && typeof e.create == "function";
|
|
74
|
-
}
|
|
75
|
-
isCameraWrapper(e) {
|
|
76
|
-
return e && typeof e == "object" && e.constructor.name === "CameraWrapper";
|
|
77
|
-
}
|
|
78
|
-
isEntityInput(e) {
|
|
79
|
-
return e ? !!(this.isBaseNode(e) || typeof e == "function" || typeof e == "object" && typeof e.then == "function") : !1;
|
|
80
|
-
}
|
|
81
|
-
isThenable(e) {
|
|
82
|
-
return !!e && typeof e.then == "function";
|
|
83
|
-
}
|
|
84
|
-
handleEntityImmediatelyOrQueue(e) {
|
|
85
|
-
this.isLoaded ? this.spawnEntity(e) : this.children.push(e);
|
|
86
|
-
}
|
|
87
|
-
handlePromiseWithSpawnOnResolve(e) {
|
|
88
|
-
this.isLoaded ? e.then((t) => this.spawnEntity(t)).catch((t) => console.error("Failed to build async entity", t)) : this.pendingPromises.push(e);
|
|
89
|
-
}
|
|
90
|
-
saveState(e) {
|
|
91
|
-
this.state = e;
|
|
92
|
-
}
|
|
93
|
-
setState() {
|
|
94
|
-
const { backgroundColor: e, backgroundImage: t } = this.state, i = e instanceof d ? e : new d(e);
|
|
95
|
-
g(i), E(t), b(this.state.variables ?? {});
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Load and initialize the stage's scene and world.
|
|
99
|
-
* @param id DOM element id for the renderer container
|
|
100
|
-
* @param camera Optional camera override
|
|
101
|
-
*/
|
|
102
|
-
async load(e, t) {
|
|
103
|
-
this.setState();
|
|
104
|
-
const i = t || (this.camera ? this.camera.cameraRef : this.createDefaultCamera());
|
|
105
|
-
this.cameraRef = i, this.scene = new y(e, i, this.state);
|
|
106
|
-
const s = await l.loadPhysics(this.gravity ?? new o(0, 0, 0));
|
|
107
|
-
this.world = new l(s), this.scene.setup();
|
|
108
|
-
for (let r of this.children)
|
|
109
|
-
this.spawnEntity(r);
|
|
110
|
-
if (this.pendingEntities.length && (this.enqueue(...this.pendingEntities), this.pendingEntities = []), this.pendingPromises.length) {
|
|
111
|
-
for (const r of this.pendingPromises)
|
|
112
|
-
r.then((n) => this.spawnEntity(n)).catch((n) => console.error("Failed to resolve pending stage entity", n));
|
|
113
|
-
this.pendingPromises = [];
|
|
114
|
-
}
|
|
115
|
-
this.transformSystem = M(this), this.isLoaded = !0;
|
|
116
|
-
}
|
|
117
|
-
createDefaultCamera() {
|
|
118
|
-
const e = window.innerWidth, t = window.innerHeight, i = new m(e, t);
|
|
119
|
-
return new R(D.ThirdPerson, i);
|
|
120
|
-
}
|
|
121
|
-
_setup(e) {
|
|
122
|
-
if (!this.scene || !this.world) {
|
|
123
|
-
this.logMissingEntities();
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
a.on && (this.debugDelegate = new O(this));
|
|
127
|
-
}
|
|
128
|
-
_update(e) {
|
|
129
|
-
const { delta: t } = e;
|
|
130
|
-
if (!this.scene || !this.world) {
|
|
131
|
-
this.logMissingEntities();
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
this.world.update(e), this.transformSystem(this.ecs), this._childrenMap.forEach((i, s) => {
|
|
135
|
-
i.nodeUpdate({
|
|
136
|
-
...e,
|
|
137
|
-
me: i
|
|
138
|
-
}), i.markedForRemoval && this.removeEntityByUuid(i.uuid);
|
|
139
|
-
}), this.scene.update({ delta: t });
|
|
140
|
-
}
|
|
141
|
-
outOfLoop() {
|
|
142
|
-
this.debugUpdate();
|
|
143
|
-
}
|
|
144
|
-
/** Update debug overlays and helpers if enabled. */
|
|
145
|
-
debugUpdate() {
|
|
146
|
-
a.on && this.debugDelegate?.update();
|
|
147
|
-
}
|
|
148
|
-
/** Cleanup owned resources when the stage is destroyed. */
|
|
149
|
-
_destroy(e) {
|
|
150
|
-
this._childrenMap.forEach((t) => {
|
|
151
|
-
try {
|
|
152
|
-
t.nodeDestroy({ me: t, globals: h() });
|
|
153
|
-
} catch {
|
|
154
|
-
}
|
|
155
|
-
}), this._childrenMap.clear(), this._removalMap.clear(), this._debugMap.clear(), this.world?.destroy(), this.scene?.destroy(), this.debugDelegate?.dispose(), this.cameraRef?.setDebugDelegate(null), this.cameraDebugDelegate = null, this.isLoaded = !1, this.world = null, this.scene = null, this.cameraRef = null, w();
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Create, register, and add an entity to the scene/world.
|
|
159
|
-
* Safe to call only after `load` when scene/world exist.
|
|
160
|
-
*/
|
|
161
|
-
async spawnEntity(e) {
|
|
162
|
-
if (!this.scene || !this.world)
|
|
163
|
-
return;
|
|
164
|
-
const t = e.create(), i = u(this.ecs);
|
|
165
|
-
if (t.eid = i, this.scene.addEntity(t), e.behaviors)
|
|
166
|
-
for (let s of e.behaviors) {
|
|
167
|
-
f(this.ecs, s.component, t.eid);
|
|
168
|
-
const r = Object.keys(s.values);
|
|
169
|
-
for (const n of r)
|
|
170
|
-
s.component[n][t.eid] = s.values[n];
|
|
171
|
-
}
|
|
172
|
-
t.colliderDesc && this.world.addEntity(t), e.nodeSetup({
|
|
173
|
-
me: e,
|
|
174
|
-
globals: h(),
|
|
175
|
-
camera: this.scene.zylemCamera
|
|
176
|
-
}), this.addEntityToStage(t);
|
|
177
|
-
}
|
|
178
|
-
buildEntityState(e) {
|
|
179
|
-
return e instanceof P ? { ...e.buildInfo() } : {
|
|
180
|
-
uuid: e.uuid,
|
|
181
|
-
name: e.name,
|
|
182
|
-
eid: e.eid
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
/** Add the entity to internal maps and notify listeners. */
|
|
186
|
-
addEntityToStage(e) {
|
|
187
|
-
this._childrenMap.set(e.eid, e), a.on && this._debugMap.set(e.uuid, e);
|
|
188
|
-
for (const t of this.entityAddedHandlers)
|
|
189
|
-
try {
|
|
190
|
-
t(e);
|
|
191
|
-
} catch (i) {
|
|
192
|
-
console.error("onEntityAdded handler failed", i);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Subscribe to entity-added events.
|
|
197
|
-
* @param callback Invoked for each entity when added
|
|
198
|
-
* @param options.replayExisting If true and stage already loaded, replays existing entities
|
|
199
|
-
* @returns Unsubscribe function
|
|
200
|
-
*/
|
|
201
|
-
onEntityAdded(e, t) {
|
|
202
|
-
return this.entityAddedHandlers.push(e), t?.replayExisting && this.isLoaded && this._childrenMap.forEach((i) => {
|
|
203
|
-
try {
|
|
204
|
-
e(i);
|
|
205
|
-
} catch (s) {
|
|
206
|
-
console.error("onEntityAdded replay failed", s);
|
|
207
|
-
}
|
|
208
|
-
}), () => {
|
|
209
|
-
this.entityAddedHandlers = this.entityAddedHandlers.filter((i) => i !== e);
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Remove an entity and its resources by its UUID.
|
|
214
|
-
* @returns true if removed, false if not found or stage not ready
|
|
215
|
-
*/
|
|
216
|
-
removeEntityByUuid(e) {
|
|
217
|
-
if (!this.scene || !this.world)
|
|
218
|
-
return !1;
|
|
219
|
-
const i = this.world.collisionMap.get(e) ?? this._debugMap.get(e);
|
|
220
|
-
if (!i)
|
|
221
|
-
return !1;
|
|
222
|
-
this.world.destroyEntity(i), i.group ? this.scene.scene.remove(i.group) : i.mesh && this.scene.scene.remove(i.mesh), p(this.ecs, i.eid);
|
|
223
|
-
let s = null;
|
|
224
|
-
return this._childrenMap.forEach((r, n) => {
|
|
225
|
-
r.uuid === e && (s = n);
|
|
226
|
-
}), s !== null && this._childrenMap.delete(s), this._debugMap.delete(e), !0;
|
|
227
|
-
}
|
|
228
|
-
/** Get an entity by its name; returns null if not found. */
|
|
229
|
-
getEntityByName(e) {
|
|
230
|
-
const i = Object.entries(Object.fromEntries(this._childrenMap)).map((s) => s[1]).find((s) => s.name === e);
|
|
231
|
-
return i || console.warn(`Entity ${e} not found`), i ?? null;
|
|
232
|
-
}
|
|
233
|
-
logMissingEntities() {
|
|
234
|
-
console.warn("Zylem world or scene is null");
|
|
235
|
-
}
|
|
236
|
-
/** Resize renderer viewport. */
|
|
237
|
-
resize(e, t) {
|
|
238
|
-
this.scene && this.scene.updateRenderer(e, t);
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Enqueue items to be spawned. Items can be:
|
|
242
|
-
* - BaseNode instances (immediate or deferred until load)
|
|
243
|
-
* - Factory functions returning BaseNode or Promise<BaseNode>
|
|
244
|
-
* - Promises resolving to BaseNode
|
|
245
|
-
*/
|
|
246
|
-
enqueue(...e) {
|
|
247
|
-
for (const t of e)
|
|
248
|
-
if (t) {
|
|
249
|
-
if (this.isBaseNode(t)) {
|
|
250
|
-
this.handleEntityImmediatelyOrQueue(t);
|
|
251
|
-
continue;
|
|
252
|
-
}
|
|
253
|
-
if (typeof t == "function") {
|
|
254
|
-
try {
|
|
255
|
-
const i = t();
|
|
256
|
-
this.isBaseNode(i) ? this.handleEntityImmediatelyOrQueue(i) : this.isThenable(i) && this.handlePromiseWithSpawnOnResolve(i);
|
|
257
|
-
} catch (i) {
|
|
258
|
-
console.error("Error executing entity factory", i);
|
|
259
|
-
}
|
|
260
|
-
continue;
|
|
261
|
-
}
|
|
262
|
-
this.isThenable(t) && this.handlePromiseWithSpawnOnResolve(t);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
export {
|
|
267
|
-
Y as ZylemStage
|
|
268
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { defineComponent as s, defineQuery as Q, defineSystem as R, Types as e } from "bitecs";
|
|
2
|
-
import { Quaternion as v } from "three";
|
|
3
|
-
const n = s({
|
|
4
|
-
x: e.f32,
|
|
5
|
-
y: e.f32,
|
|
6
|
-
z: e.f32
|
|
7
|
-
}), i = s({
|
|
8
|
-
x: e.f32,
|
|
9
|
-
y: e.f32,
|
|
10
|
-
z: e.f32,
|
|
11
|
-
w: e.f32
|
|
12
|
-
}), k = s({
|
|
13
|
-
x: e.f32,
|
|
14
|
-
y: e.f32,
|
|
15
|
-
z: e.f32
|
|
16
|
-
});
|
|
17
|
-
function E(y) {
|
|
18
|
-
const c = Q([n, i]), f = y._childrenMap;
|
|
19
|
-
return R((r) => {
|
|
20
|
-
const m = c(r);
|
|
21
|
-
if (f === void 0)
|
|
22
|
-
return r;
|
|
23
|
-
for (const [u, p] of f) {
|
|
24
|
-
const o = m[u], t = p;
|
|
25
|
-
if (t === void 0 || !t?.body || t.markedForRemoval)
|
|
26
|
-
continue;
|
|
27
|
-
const { x, y: d, z } = t.body.translation();
|
|
28
|
-
if (n.x[o] = x, n.y[o] = d, n.z[o] = z, t.group ? t.group.position.set(n.x[o], n.y[o], n.z[o]) : t.mesh && t.mesh.position.set(n.x[o], n.y[o], n.z[o]), t.controlledRotation)
|
|
29
|
-
continue;
|
|
30
|
-
const { x: l, y: g, z: h, w } = t.body.rotation();
|
|
31
|
-
i.x[o] = l, i.y[o] = g, i.z[o] = h, i.w[o] = w;
|
|
32
|
-
const a = new v(i.x[o], i.y[o], i.z[o], i.w[o]);
|
|
33
|
-
t.group ? t.group.setRotationFromQuaternion(a) : t.mesh && t.mesh.setRotationFromQuaternion(a);
|
|
34
|
-
}
|
|
35
|
-
return r;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
export {
|
|
39
|
-
E as default,
|
|
40
|
-
n as position,
|
|
41
|
-
i as rotation,
|
|
42
|
-
k as scale
|
|
43
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
function i(e) {
|
|
2
|
-
return new Promise((n, t) => {
|
|
3
|
-
e.oncomplete = e.onsuccess = () => n(e.result), e.onabort = e.onerror = () => t(e.error);
|
|
4
|
-
});
|
|
5
|
-
}
|
|
6
|
-
function f(e, n) {
|
|
7
|
-
let t;
|
|
8
|
-
const o = () => {
|
|
9
|
-
if (t)
|
|
10
|
-
return t;
|
|
11
|
-
const r = indexedDB.open(e);
|
|
12
|
-
return r.onupgradeneeded = () => r.result.createObjectStore(n), t = i(r), t.then((u) => {
|
|
13
|
-
u.onclose = () => t = void 0;
|
|
14
|
-
}, () => {
|
|
15
|
-
}), t;
|
|
16
|
-
};
|
|
17
|
-
return (r, u) => o().then((d) => u(d.transaction(n, r).objectStore(n)));
|
|
18
|
-
}
|
|
19
|
-
let c;
|
|
20
|
-
function a() {
|
|
21
|
-
return c || (c = f("keyval-store", "keyval")), c;
|
|
22
|
-
}
|
|
23
|
-
function l(e, n = a()) {
|
|
24
|
-
return n("readonly", (t) => i(t.get(e)));
|
|
25
|
-
}
|
|
26
|
-
function s(e, n, t = a()) {
|
|
27
|
-
return t("readwrite", (o) => (o.put(n, e), i(o.transaction)));
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
f as createStore,
|
|
31
|
-
l as get,
|
|
32
|
-
i as promisifyRequest,
|
|
33
|
-
s as set
|
|
34
|
-
};
|