@zylem/game-lib 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +106 -0
- package/dist/behaviors.js +396 -6
- package/dist/behaviors.js.map +1 -0
- package/dist/blueprints-BOCc3Wve.d.ts +26 -0
- package/dist/{src/lib/camera/zylem-camera.d.ts → camera-CpbDr4-V.d.ts} +48 -27
- package/dist/camera.d.ts +5 -0
- package/dist/camera.js +608 -4
- package/dist/camera.js.map +1 -0
- package/dist/core-CZhozNRH.d.ts +466 -0
- package/dist/core.d.ts +10 -0
- package/dist/core.js +5761 -9
- package/dist/core.js.map +1 -0
- package/dist/entities-BAxfJOkk.d.ts +307 -0
- package/dist/entities.d.ts +6 -0
- package/dist/entities.js +2284 -17
- package/dist/entities.js.map +1 -0
- package/dist/{src/lib/interfaces/entity.d.ts → entity-Bq_eNEDI.d.ts} +8 -6
- package/dist/entity-COvRtFNG.d.ts +395 -0
- package/dist/main.d.ts +211 -0
- package/dist/main.js +7600 -56
- package/dist/main.js.map +1 -0
- package/dist/moveable-B_vyA6cw.d.ts +67 -0
- package/dist/stage-types-CD21XoIU.d.ts +338 -0
- package/dist/stage.d.ts +46 -0
- package/dist/stage.js +2765 -4
- package/dist/stage.js.map +1 -0
- package/dist/transformable-CUhvyuYO.d.ts +67 -0
- package/package.json +11 -47
- 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.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
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"00-readme-example.d.ts","sourceRoot":"","sources":["../../examples/00-readme-example.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"01-basic.d.ts","sourceRoot":"","sources":["../../examples/01-basic.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"01.1-basic-ball.d.ts","sourceRoot":"","sources":["../../examples/01.1-basic-ball.ts"],"names":[],"mappings":";AAiBA;;;;;;GAMG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"01.2-ricochet-test.d.ts","sourceRoot":"","sources":["../../examples/01.2-ricochet-test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"01.3-rect.d.ts","sourceRoot":"","sources":["../../examples/01.3-rect.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"02-input.d.ts","sourceRoot":"","sources":["../../examples/02-input.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"03-stage-test.d.ts","sourceRoot":"","sources":["../../../examples/03-stage-test/03-stage-test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stage0.d.ts","sourceRoot":"","sources":["../../../examples/03-stage-test/stage0.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS,2CAEpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stage1.d.ts","sourceRoot":"","sources":["../../../examples/03-stage-test/stage1.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,2CAET,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stage2.d.ts","sourceRoot":"","sources":["../../../examples/03-stage-test/stage2.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,2CAEX,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stage3.d.ts","sourceRoot":"","sources":["../../../examples/03-stage-test/stage3.ts"],"names":[],"mappings":"AAiEA,eAAO,MAAM,MAAM,2CAGoC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"03.1-stage-variable.d.ts","sourceRoot":"","sources":["../../examples/03.1-stage-variable.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* import { update } from '../src/lib/actions/update';
|
|
5
|
-
* import { sphere } from '../src/lib/entities';
|
|
6
|
-
* const mySphere = await sphere({
|
|
7
|
-
* size: new Vector3(4, 4, 4),
|
|
8
|
-
* position: { x: 0, y: 0, z: 0 },
|
|
9
|
-
* collision: { static: false },
|
|
10
|
-
* material: { path: marsSurfacePath },
|
|
11
|
-
* });
|
|
12
|
-
*
|
|
13
|
-
* update(mySphere, (context) => {
|
|
14
|
-
*
|
|
15
|
-
* });
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
//# sourceMappingURL=04-vessel-test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"04-vessel-test.d.ts","sourceRoot":"","sources":["../../examples/04-vessel-test.ts"],"names":[],"mappings":";AAwBA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"05-camera-test.d.ts","sourceRoot":"","sources":["../../examples/05-camera-test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"06-entity-test.d.ts","sourceRoot":"","sources":["../../examples/06-entity-test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"07-behaviors.d.ts","sourceRoot":"","sources":["../../examples/07-behaviors.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"07.01-behavior-context.d.ts","sourceRoot":"","sources":["../../examples/07.01-behavior-context.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"08-pong.d.ts","sourceRoot":"","sources":["../../examples/08-pong.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"08.01-breakout.d.ts","sourceRoot":"","sources":["../../examples/08.01-breakout.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"09-space-invaders.d.ts","sourceRoot":"","sources":["../../examples/09-space-invaders.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"10-asteroids.d.ts","sourceRoot":"","sources":["../../examples/10-asteroids.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"11-2d-platformer.d.ts","sourceRoot":"","sources":["../../examples/11-2d-platformer.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"12-3d-platformer.d.ts","sourceRoot":"","sources":["../../examples/12-3d-platformer.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"13-fps.d.ts","sourceRoot":"","sources":["../../examples/13-fps.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"14-strategy.d.ts","sourceRoot":"","sources":["../../examples/14-strategy.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"15-zylem-planet-demo.d.ts","sourceRoot":"","sources":["../../examples/15-zylem-planet-demo.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"16-timbotron.d.ts","sourceRoot":"","sources":["../../examples/16-timbotron.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"17-stress-test.d.ts","sourceRoot":"","sources":["../../examples/17-stress-test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"architecture-test.d.ts","sourceRoot":"","sources":["../../examples/architecture-test.ts"],"names":[],"mappings":""}
|
package/dist/examples/utils.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ZylemBox } from "../src/lib/entities/box";
|
|
2
|
-
import { ZylemSphere } from "../src/lib/entities/sphere";
|
|
3
|
-
import { Vector2 } from "three";
|
|
4
|
-
export type PlaygroundPlaneType = 'grass' | 'dirt' | 'wood' | 'mars' | 'steel';
|
|
5
|
-
export declare const playgroundPlane: (type: PlaygroundPlaneType, size?: Vector2) => Promise<import("../src/lib/entities").ZylemPlane>;
|
|
6
|
-
export type PlaygroundActorType = 'player' | 'mascot';
|
|
7
|
-
export declare const playgroundActor: (type: PlaygroundActorType) => Promise<import("../src/lib/entities").ZylemActor>;
|
|
8
|
-
export declare const playgroundPlatforms: () => Promise<ZylemBox[]>;
|
|
9
|
-
export declare const createSpheres: (count: number) => Promise<ZylemSphere[]>;
|
|
10
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../examples/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAS,OAAO,EAAW,MAAM,OAAO,CAAC;AAkBhD,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAU/E,eAAO,MAAM,eAAe,GAAU,MAAM,mBAAmB,EAAE,OAAM,OAA+B,sDAYrG,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAoCtD,eAAO,MAAM,eAAe,GAAU,MAAM,mBAAmB,sDAW9D,CAAA;AAED,eAAO,MAAM,mBAAmB,2BA+F/B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,OAAO,MAAM,2BAIhD,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
function s(t, e) {
|
|
2
|
-
setTimeout(e, t);
|
|
3
|
-
}
|
|
4
|
-
const c = /* @__PURE__ */ (() => {
|
|
5
|
-
let t = !1;
|
|
6
|
-
return (e, n) => {
|
|
7
|
-
e && !t ? (t = !0, n()) : e || (t = !1);
|
|
8
|
-
};
|
|
9
|
-
})(), u = /* @__PURE__ */ (() => {
|
|
10
|
-
let t = !1;
|
|
11
|
-
return (e, n) => {
|
|
12
|
-
!e && t ? (t = !1, n()) : e && (t = !0);
|
|
13
|
-
};
|
|
14
|
-
})(), f = /* @__PURE__ */ (() => {
|
|
15
|
-
let t = -1 / 0, e = !1;
|
|
16
|
-
return ({ timer: n, immediate: o = !0 }, l, r) => {
|
|
17
|
-
let i = Date.now();
|
|
18
|
-
!e && !o && (e = !0, t = i);
|
|
19
|
-
const a = i - t;
|
|
20
|
-
a >= n && (t = i, l()), r({ delta: a });
|
|
21
|
-
};
|
|
22
|
-
})(), m = /* @__PURE__ */ (() => {
|
|
23
|
-
let t = 0;
|
|
24
|
-
return (e, n) => {
|
|
25
|
-
const o = Date.now();
|
|
26
|
-
o - t >= e && (t = o, n());
|
|
27
|
-
};
|
|
28
|
-
})();
|
|
29
|
-
export {
|
|
30
|
-
c as actionOnPress,
|
|
31
|
-
u as actionOnRelease,
|
|
32
|
-
f as actionWithCooldown,
|
|
33
|
-
m as actionWithThrottle,
|
|
34
|
-
s as wait
|
|
35
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
const y = {
|
|
2
|
-
boundaries: {
|
|
3
|
-
top: 0,
|
|
4
|
-
bottom: 0,
|
|
5
|
-
left: 0,
|
|
6
|
-
right: 0
|
|
7
|
-
},
|
|
8
|
-
stopMovement: !0
|
|
9
|
-
};
|
|
10
|
-
function d(i = {}) {
|
|
11
|
-
return {
|
|
12
|
-
type: "update",
|
|
13
|
-
handler: (n) => {
|
|
14
|
-
a(n, i);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function a(i, n) {
|
|
19
|
-
const { me: r } = i, { boundaries: s, onBoundary: u } = {
|
|
20
|
-
...y,
|
|
21
|
-
...n
|
|
22
|
-
}, e = r.getPosition();
|
|
23
|
-
if (!e)
|
|
24
|
-
return;
|
|
25
|
-
let t = { top: !1, bottom: !1, left: !1, right: !1 };
|
|
26
|
-
if (e.x <= s.left ? t.left = !0 : e.x >= s.right && (t.right = !0), e.y <= s.bottom ? t.bottom = !0 : e.y >= s.top && (t.top = !0), (n.stopMovement ?? !0) && t) {
|
|
27
|
-
const o = r.getVelocity() ?? { x: 0, y: 0 };
|
|
28
|
-
let { x: f, y: l } = o;
|
|
29
|
-
(o?.y < 0 && t.bottom || o?.y > 0 && t.top) && (l = 0), (o?.x < 0 && t.left || o?.x > 0 && t.right) && (f = 0), r.moveXY(f, l);
|
|
30
|
-
}
|
|
31
|
-
u && t && u({
|
|
32
|
-
me: r,
|
|
33
|
-
boundary: t,
|
|
34
|
-
position: { x: e.x, y: e.y, z: e.z },
|
|
35
|
-
updateContext: i
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
export {
|
|
39
|
-
d as boundary2d
|
|
40
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { matchesCollisionSelector as T } from "../../../collision/utils.js";
|
|
2
|
-
import { clamp as E } from "./ricochet.js";
|
|
3
|
-
function tt(O = {}, b) {
|
|
4
|
-
return {
|
|
5
|
-
type: "collision",
|
|
6
|
-
handler: (D) => {
|
|
7
|
-
Z(D, O, b);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
function Z(O, b, D) {
|
|
12
|
-
const { entity: K, other: y } = O, f = K;
|
|
13
|
-
if (y.collider?.isSensor())
|
|
14
|
-
return;
|
|
15
|
-
const { minSpeed: C = 2, maxSpeed: H = 20, separation: U = 0, collisionWith: L = void 0 } = {
|
|
16
|
-
...b
|
|
17
|
-
}, I = b?.reflectionMode ?? "angled", W = b?.maxAngleDeg ?? 60, _ = b?.speedUpFactor ?? 1.05, j = b?.minOffsetForAngle ?? 0.15, G = b?.centerRetentionFactor ?? 0.5;
|
|
18
|
-
if (!T(y, L))
|
|
19
|
-
return;
|
|
20
|
-
const i = f.getPosition(), X = y.body?.translation(), e = f.getVelocity();
|
|
21
|
-
if (!i || !X || !e)
|
|
22
|
-
return;
|
|
23
|
-
let c = e.x, o = e.y, Y = i.x, P = i.y;
|
|
24
|
-
const p = i.x - X.x, m = i.y - X.y;
|
|
25
|
-
let n = null, s = null;
|
|
26
|
-
const u = y.collider?.shape;
|
|
27
|
-
if (u && (u.halfExtents && (n = Math.abs(u.halfExtents.x ?? u.halfExtents[0] ?? null), s = Math.abs(u.halfExtents.y ?? u.halfExtents[1] ?? null)), (n == null || s == null) && typeof u.radius == "number" && (n = n ?? Math.abs(u.radius), s = s ?? Math.abs(u.radius))), (n == null || s == null) && typeof y.collider?.halfExtents == "function") {
|
|
28
|
-
const t = y.collider.halfExtents();
|
|
29
|
-
t && (n = n ?? Math.abs(t.x), s = s ?? Math.abs(t.y));
|
|
30
|
-
}
|
|
31
|
-
if ((n == null || s == null) && typeof y.collider?.radius == "function") {
|
|
32
|
-
const t = y.collider.radius();
|
|
33
|
-
typeof t == "number" && (n = n ?? Math.abs(t), s = s ?? Math.abs(t));
|
|
34
|
-
}
|
|
35
|
-
let q = 0, z = 0;
|
|
36
|
-
n && s ? (q = E(p / n, -1, 1), z = E(m / s, -1, 1)) : (q = Math.sign(p), z = Math.sign(m));
|
|
37
|
-
let J = Math.abs(m) >= Math.abs(p), a = null, l = null;
|
|
38
|
-
const M = f.collider?.shape;
|
|
39
|
-
if (M && (M.halfExtents && (a = Math.abs(M.halfExtents.x ?? M.halfExtents[0] ?? null), l = Math.abs(M.halfExtents.y ?? M.halfExtents[1] ?? null)), (a == null || l == null) && typeof M.radius == "number" && (a = a ?? Math.abs(M.radius), l = l ?? Math.abs(M.radius))), (a == null || l == null) && typeof f.collider?.halfExtents == "function") {
|
|
40
|
-
const t = f.collider.halfExtents();
|
|
41
|
-
t && (a = a ?? Math.abs(t.x), l = l ?? Math.abs(t.y));
|
|
42
|
-
}
|
|
43
|
-
if ((a == null || l == null) && typeof f.collider?.radius == "function") {
|
|
44
|
-
const t = f.collider.radius();
|
|
45
|
-
typeof t == "number" && (a = a ?? Math.abs(t), l = l ?? Math.abs(t));
|
|
46
|
-
}
|
|
47
|
-
if (n != null && s != null && a != null && l != null) {
|
|
48
|
-
const t = a + n - Math.abs(p), r = l + s - Math.abs(m);
|
|
49
|
-
!Number.isNaN(t) && !Number.isNaN(r) && (J = r <= t);
|
|
50
|
-
}
|
|
51
|
-
let F = !1;
|
|
52
|
-
if (J) {
|
|
53
|
-
const t = (s ?? 0) + (l ?? 0) + U;
|
|
54
|
-
if (P = X.y + (m > 0 ? t : -t), Y = i.x, n != null && s != null && n > s && I === "angled") {
|
|
55
|
-
const v = W * Math.PI / 180, g = Math.max(0, Math.min(1, j)), N = E(q, -1, 1), V = Math.abs(N), S = Math.sqrt(e.x * e.x + e.y * e.y), h = E(S * _, C, H);
|
|
56
|
-
if (V > g) {
|
|
57
|
-
const d = (V - g) / (1 - g), x = Math.sign(N) * (d * v), A = Math.cos(x), w = Math.sin(x), B = Math.abs(h * A), Q = h * w;
|
|
58
|
-
o = m > 0 ? B : -B, c = Q;
|
|
59
|
-
} else {
|
|
60
|
-
const d = e.x * G, x = Math.max(0, h * h - d * d), A = Math.sqrt(x);
|
|
61
|
-
o = m > 0 ? A : -A, c = d;
|
|
62
|
-
}
|
|
63
|
-
F = !0;
|
|
64
|
-
} else
|
|
65
|
-
o = m > 0 ? Math.abs(e.y) : -Math.abs(e.y), I === "simple" && (F = !0);
|
|
66
|
-
} else {
|
|
67
|
-
const t = (n ?? 0) + (a ?? 0) + U;
|
|
68
|
-
if (Y = X.x + (p > 0 ? t : -t), P = i.y, I === "angled") {
|
|
69
|
-
const r = W * Math.PI / 180, v = Math.max(0, Math.min(1, j)), g = E(z, -1, 1), N = Math.abs(g), V = Math.sqrt(e.x * e.x + e.y * e.y), S = E(V * _, C, H);
|
|
70
|
-
if (N > v) {
|
|
71
|
-
const h = (N - v) / (1 - v), d = Math.sign(g) * (h * r), x = Math.cos(d), A = Math.sin(d), w = Math.abs(S * x), B = S * A;
|
|
72
|
-
c = p > 0 ? w : -w, o = B;
|
|
73
|
-
} else {
|
|
74
|
-
const h = e.y * G, d = Math.max(0, S * S - h * h), x = Math.sqrt(d);
|
|
75
|
-
c = p > 0 ? x : -x, o = h;
|
|
76
|
-
}
|
|
77
|
-
F = !0;
|
|
78
|
-
} else
|
|
79
|
-
c = p > 0 ? Math.abs(e.x) : -Math.abs(e.x), o = e.y, F = !0;
|
|
80
|
-
}
|
|
81
|
-
if (!F) {
|
|
82
|
-
const t = Math.abs(c), r = Math.abs(o), v = Math.sign(q) * Math.abs(q) * t, g = Math.sign(z) * Math.abs(z) * r;
|
|
83
|
-
c += v, o += g;
|
|
84
|
-
}
|
|
85
|
-
const R = Math.sqrt(c * c + o * o);
|
|
86
|
-
if (R > 0) {
|
|
87
|
-
const t = E(R, C, H);
|
|
88
|
-
if (t !== R) {
|
|
89
|
-
const r = t / R;
|
|
90
|
-
c *= r, o *= r;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
(Y !== i.x || P !== i.y) && (f.setPosition(Y, P, i.z), f.moveXY(c, o), D && f.getVelocity() && D({
|
|
94
|
-
position: { x: Y, y: P, z: i.z },
|
|
95
|
-
...O
|
|
96
|
-
}));
|
|
97
|
-
}
|
|
98
|
-
export {
|
|
99
|
-
tt as ricochet2DCollision
|
|
100
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { clamp as g } from "./ricochet.js";
|
|
2
|
-
function w(a = {}, u) {
|
|
3
|
-
return {
|
|
4
|
-
type: "update",
|
|
5
|
-
handler: (y) => {
|
|
6
|
-
M(y, a, u);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
function M(a, u, y) {
|
|
11
|
-
const { me: r } = a, { restitution: d = 0, minSpeed: b = 2, maxSpeed: x = 20, boundaries: e = { top: 5, bottom: -5, left: -6.5, right: 6.5 }, separation: p = 0 } = { ...u }, t = r.getPosition(), o = r.getVelocity();
|
|
12
|
-
if (!t || !o)
|
|
13
|
-
return;
|
|
14
|
-
let i = o.x, n = o.y, c = t.x, l = t.y, s = null;
|
|
15
|
-
t.x <= e.left ? (i = Math.abs(o.x), c = e.left + p, s = "left") : t.x >= e.right && (i = -Math.abs(o.x), c = e.right - p, s = "right"), t.y <= e.bottom ? (n = Math.abs(o.y), l = e.bottom + p, s = "bottom") : t.y >= e.top && (n = -Math.abs(o.y), l = e.top - p, s = "top");
|
|
16
|
-
const h = Math.sqrt(i * i + n * n);
|
|
17
|
-
if (h > 0) {
|
|
18
|
-
const f = g(h, b, x);
|
|
19
|
-
if (f !== h) {
|
|
20
|
-
const m = f / h;
|
|
21
|
-
i *= m, n *= m;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
if (d && (i *= d, n *= d), (c !== t.x || l !== t.y) && (r.setPosition(c, l, t.z), r.moveXY(i, n), y && s)) {
|
|
25
|
-
const f = r.getVelocity();
|
|
26
|
-
f && y({
|
|
27
|
-
boundary: s,
|
|
28
|
-
position: { x: c, y: l, z: t.z },
|
|
29
|
-
velocityBefore: o,
|
|
30
|
-
velocityAfter: f,
|
|
31
|
-
...a
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
w as ricochet2DInBounds
|
|
37
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { Vector3 as l } from "three";
|
|
2
|
-
function b(o, e) {
|
|
3
|
-
if (!o.body)
|
|
4
|
-
return;
|
|
5
|
-
const n = o.body.linvel(), r = new l(e, n.y, n.z);
|
|
6
|
-
o.body.setLinvel(r, !0);
|
|
7
|
-
}
|
|
8
|
-
function y(o, e) {
|
|
9
|
-
if (!o.body)
|
|
10
|
-
return;
|
|
11
|
-
const n = o.body.linvel(), r = new l(n.x, e, n.z);
|
|
12
|
-
o.body.setLinvel(r, !0);
|
|
13
|
-
}
|
|
14
|
-
function m(o, e) {
|
|
15
|
-
if (!o.body)
|
|
16
|
-
return;
|
|
17
|
-
const n = o.body.linvel(), r = new l(n.x, n.y, e);
|
|
18
|
-
o.body.setLinvel(r, !0);
|
|
19
|
-
}
|
|
20
|
-
function w(o, e, n) {
|
|
21
|
-
if (!o.body)
|
|
22
|
-
return;
|
|
23
|
-
const r = o.body.linvel(), c = new l(e, n, r.z);
|
|
24
|
-
o.body.setLinvel(c, !0);
|
|
25
|
-
}
|
|
26
|
-
function V(o, e, n) {
|
|
27
|
-
if (!o.body)
|
|
28
|
-
return;
|
|
29
|
-
const r = o.body.linvel(), c = new l(e, r.y, n);
|
|
30
|
-
o.body.setLinvel(c, !0);
|
|
31
|
-
}
|
|
32
|
-
function P(o, e) {
|
|
33
|
-
if (!o.body)
|
|
34
|
-
return;
|
|
35
|
-
const n = o.body.linvel(), r = new l(n.x + e.x, n.y + e.y, n.z + e.z);
|
|
36
|
-
o.body.setLinvel(r, !0);
|
|
37
|
-
}
|
|
38
|
-
function p(o) {
|
|
39
|
-
o.body && (o.body.setLinvel(new l(0, 0, 0), !0), o.body.setLinearDamping(5));
|
|
40
|
-
}
|
|
41
|
-
function x(o, e, n) {
|
|
42
|
-
const r = Math.sin(-n) * e, c = Math.cos(-n) * e;
|
|
43
|
-
w(o, r, c);
|
|
44
|
-
}
|
|
45
|
-
function u(o) {
|
|
46
|
-
return o.body ? o.body.translation() : null;
|
|
47
|
-
}
|
|
48
|
-
function X(o) {
|
|
49
|
-
return o.body ? o.body.linvel() : null;
|
|
50
|
-
}
|
|
51
|
-
function f(o, e, n, r) {
|
|
52
|
-
o.body && o.body.setTranslation({ x: e, y: n, z: r }, !0);
|
|
53
|
-
}
|
|
54
|
-
function z(o, e) {
|
|
55
|
-
if (!o.body)
|
|
56
|
-
return;
|
|
57
|
-
const { y: n, z: r } = o.body.translation();
|
|
58
|
-
o.body.setTranslation({ x: e, y: n, z: r }, !0);
|
|
59
|
-
}
|
|
60
|
-
function L(o, e) {
|
|
61
|
-
if (!o.body)
|
|
62
|
-
return;
|
|
63
|
-
const { x: n, z: r } = o.body.translation();
|
|
64
|
-
o.body.setTranslation({ x: n, y: e, z: r }, !0);
|
|
65
|
-
}
|
|
66
|
-
function Y(o, e) {
|
|
67
|
-
if (!o.body)
|
|
68
|
-
return;
|
|
69
|
-
const { x: n, y: r } = o.body.translation();
|
|
70
|
-
o.body.setTranslation({ x: n, y: r, z: e }, !0);
|
|
71
|
-
}
|
|
72
|
-
function g(o, e, n) {
|
|
73
|
-
const r = u(o);
|
|
74
|
-
if (!r)
|
|
75
|
-
return;
|
|
76
|
-
const { x: c, y: t } = r, i = c > e ? -e : c < -e ? e : c, s = t > n ? -n : t < -n ? n : t;
|
|
77
|
-
(i !== c || s !== t) && f(o, i, s, 0);
|
|
78
|
-
}
|
|
79
|
-
function T(o, e, n, r) {
|
|
80
|
-
const c = u(o);
|
|
81
|
-
if (!c)
|
|
82
|
-
return;
|
|
83
|
-
const { x: t, y: i, z: s } = c, a = t > e ? -e : t < -e ? e : t, d = i > n ? -n : i < -n ? n : i, v = s > r ? -r : s < -r ? r : s;
|
|
84
|
-
(a !== t || d !== i || v !== s) && f(o, a, d, v);
|
|
85
|
-
}
|
|
86
|
-
function A(o) {
|
|
87
|
-
const e = o;
|
|
88
|
-
return e.moveX = (n) => b(o, n), e.moveY = (n) => y(o, n), e.moveZ = (n) => m(o, n), e.moveXY = (n, r) => w(o, n, r), e.moveXZ = (n, r) => V(o, n, r), e.move = (n) => P(o, n), e.resetVelocity = () => p(o), e.moveForwardXY = (n, r) => x(o, n, r), e.getPosition = () => u(o), e.getVelocity = () => X(o), e.setPosition = (n, r, c) => f(o, n, r, c), e.setPositionX = (n) => z(o, n), e.setPositionY = (n) => L(o, n), e.setPositionZ = (n) => Y(o, n), e.wrapAroundXY = (n, r) => g(o, n, r), e.wrapAround3D = (n, r, c) => T(o, n, r, c), e;
|
|
89
|
-
}
|
|
90
|
-
export {
|
|
91
|
-
u as getPosition,
|
|
92
|
-
X as getVelocity,
|
|
93
|
-
A as makeMoveable,
|
|
94
|
-
P as move,
|
|
95
|
-
x as moveForwardXY,
|
|
96
|
-
b as moveX,
|
|
97
|
-
w as moveXY,
|
|
98
|
-
V as moveXZ,
|
|
99
|
-
y as moveY,
|
|
100
|
-
m as moveZ,
|
|
101
|
-
p as resetVelocity,
|
|
102
|
-
f as setPosition,
|
|
103
|
-
z as setPositionX,
|
|
104
|
-
L as setPositionY,
|
|
105
|
-
Y as setPositionZ,
|
|
106
|
-
T as wrapAround3D,
|
|
107
|
-
g as wrapAroundXY
|
|
108
|
-
};
|