@zylem/game-lib 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/{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 -15
- package/dist/stage.js.map +1 -0
- package/dist/transformable-CUhvyuYO.d.ts +67 -0
- package/package.json +12 -42
- package/LICENSE +0 -21
- package/dist/.vite/manifest.json +0 -676
- package/dist/api/actions.d.ts +0 -5
- package/dist/api/actions.d.ts.map +0 -1
- package/dist/api/behaviors.d.ts +0 -4
- package/dist/api/behaviors.d.ts.map +0 -1
- package/dist/api/camera.d.ts +0 -4
- package/dist/api/camera.d.ts.map +0 -1
- package/dist/api/core.d.ts +0 -6
- package/dist/api/core.d.ts.map +0 -1
- package/dist/api/entities.d.ts +0 -9
- package/dist/api/entities.d.ts.map +0 -1
- package/dist/api/main.d.ts +0 -32
- package/dist/api/main.d.ts.map +0 -1
- package/dist/api/stage.d.ts +0 -6
- package/dist/api/stage.d.ts.map +0 -1
- package/dist/assets/zylem-logo.png +0 -0
- package/dist/lib/actions/behaviors/actions.d.ts +0 -11
- package/dist/lib/actions/behaviors/actions.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/actions.js +0 -35
- package/dist/lib/actions/behaviors/behavior.d.ts +0 -6
- package/dist/lib/actions/behaviors/behavior.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/boundaries/boundary.d.ts +0 -37
- package/dist/lib/actions/behaviors/boundaries/boundary.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/boundaries/boundary.js +0 -40
- package/dist/lib/actions/behaviors/character-controller.d.ts +0 -6
- package/dist/lib/actions/behaviors/character-controller.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/debug/debug-collision.d.ts +0 -6
- package/dist/lib/actions/behaviors/debug/debug-collision.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/debug/debug-update.d.ts +0 -5
- package/dist/lib/actions/behaviors/debug/debug-update.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/debug/debug.d.ts +0 -10
- package/dist/lib/actions/behaviors/debug/debug.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/movement/movement-sequence-2d.d.ts +0 -24
- package/dist/lib/actions/behaviors/movement/movement-sequence-2d.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts +0 -11
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.js +0 -100
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts +0 -12
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.js +0 -37
- package/dist/lib/actions/behaviors/ricochet/ricochet.d.ts +0 -44
- package/dist/lib/actions/behaviors/ricochet/ricochet.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/ricochet/ricochet.js +0 -6
- package/dist/lib/actions/behaviors/zylem-behavior.d.ts +0 -2
- package/dist/lib/actions/behaviors/zylem-behavior.d.ts.map +0 -1
- package/dist/lib/actions/capabilities/moveable.d.ts +0 -125
- package/dist/lib/actions/capabilities/moveable.d.ts.map +0 -1
- package/dist/lib/actions/capabilities/moveable.js +0 -108
- package/dist/lib/actions/capabilities/rotatable.d.ts +0 -111
- package/dist/lib/actions/capabilities/rotatable.d.ts.map +0 -1
- package/dist/lib/actions/capabilities/rotatable.js +0 -82
- package/dist/lib/actions/capabilities/transformable.d.ts +0 -7
- package/dist/lib/actions/capabilities/transformable.d.ts.map +0 -1
- package/dist/lib/actions/capabilities/transformable.js +0 -9
- package/dist/lib/actions/global-change.d.ts +0 -23
- package/dist/lib/actions/global-change.d.ts.map +0 -1
- package/dist/lib/actions/global-change.js +0 -40
- package/dist/lib/camera/camera.d.ts +0 -16
- package/dist/lib/camera/camera.d.ts.map +0 -1
- package/dist/lib/camera/camera.js +0 -19
- package/dist/lib/camera/fixed-2d.d.ts +0 -32
- package/dist/lib/camera/fixed-2d.d.ts.map +0 -1
- package/dist/lib/camera/fixed-2d.js +0 -30
- package/dist/lib/camera/perspective.d.ts +0 -9
- package/dist/lib/camera/perspective.d.ts.map +0 -1
- package/dist/lib/camera/perspective.js +0 -10
- package/dist/lib/camera/third-person.d.ts +0 -32
- package/dist/lib/camera/third-person.d.ts.map +0 -1
- package/dist/lib/camera/third-person.js +0 -42
- package/dist/lib/camera/zylem-camera.d.ts.map +0 -1
- package/dist/lib/camera/zylem-camera.js +0 -208
- package/dist/lib/collision/collision-builder.d.ts +0 -17
- package/dist/lib/collision/collision-builder.d.ts.map +0 -1
- package/dist/lib/collision/collision-builder.js +0 -46
- package/dist/lib/collision/collision-delegate.d.ts +0 -6
- package/dist/lib/collision/collision-delegate.d.ts.map +0 -1
- package/dist/lib/collision/collision-delegate.js +0 -6
- package/dist/lib/collision/collision-group.d.ts +0 -11
- package/dist/lib/collision/collision-group.d.ts.map +0 -1
- package/dist/lib/collision/collision-mask.d.ts +0 -18
- package/dist/lib/collision/collision-mask.d.ts.map +0 -1
- package/dist/lib/collision/collision.d.ts +0 -19
- package/dist/lib/collision/collision.d.ts.map +0 -1
- package/dist/lib/collision/utils.d.ts +0 -15
- package/dist/lib/collision/utils.d.ts.map +0 -1
- package/dist/lib/collision/utils.js +0 -24
- package/dist/lib/collision/world.d.ts +0 -23
- package/dist/lib/collision/world.d.ts.map +0 -1
- package/dist/lib/collision/world.js +0 -77
- package/dist/lib/core/asset-manager.d.ts +0 -2
- package/dist/lib/core/asset-manager.d.ts.map +0 -1
- package/dist/lib/core/base-node-life-cycle.d.ts +0 -68
- package/dist/lib/core/base-node-life-cycle.d.ts.map +0 -1
- package/dist/lib/core/base-node.d.ts +0 -37
- package/dist/lib/core/base-node.d.ts.map +0 -1
- package/dist/lib/core/base-node.js +0 -62
- package/dist/lib/core/entity-asset-loader.d.ts +0 -16
- package/dist/lib/core/entity-asset-loader.d.ts.map +0 -1
- package/dist/lib/core/entity-asset-loader.js +0 -54
- package/dist/lib/core/errors.d.ts +0 -5
- package/dist/lib/core/errors.d.ts.map +0 -1
- package/dist/lib/core/flags.d.ts +0 -3
- package/dist/lib/core/flags.d.ts.map +0 -1
- package/dist/lib/core/index.d.ts +0 -5
- package/dist/lib/core/index.d.ts.map +0 -1
- package/dist/lib/core/lazy-loader.d.ts +0 -80
- package/dist/lib/core/lazy-loader.d.ts.map +0 -1
- package/dist/lib/core/lifecycle-base.d.ts +0 -17
- package/dist/lib/core/lifecycle-base.d.ts.map +0 -1
- package/dist/lib/core/lifecycle-base.js +0 -20
- package/dist/lib/core/preset-shader.d.ts +0 -8
- package/dist/lib/core/preset-shader.d.ts.map +0 -1
- package/dist/lib/core/preset-shader.js +0 -26
- package/dist/lib/core/three-addons/Timer.d.ts +0 -92
- package/dist/lib/core/three-addons/Timer.d.ts.map +0 -1
- package/dist/lib/core/three-addons/Timer.js +0 -103
- package/dist/lib/core/utility/nodes.d.ts +0 -13
- package/dist/lib/core/utility/nodes.d.ts.map +0 -1
- package/dist/lib/core/utility/nodes.js +0 -31
- package/dist/lib/core/utility/strings.d.ts +0 -3
- package/dist/lib/core/utility/strings.d.ts.map +0 -1
- package/dist/lib/core/utility/strings.js +0 -14
- package/dist/lib/core/utility/vector.d.ts +0 -8
- package/dist/lib/core/utility/vector.d.ts.map +0 -1
- package/dist/lib/core/utility/vector.js +0 -8
- package/dist/lib/core/vector.d.ts +0 -4
- package/dist/lib/core/vector.d.ts.map +0 -1
- package/dist/lib/core/vessel.d.ts +0 -13
- package/dist/lib/core/vessel.d.ts.map +0 -1
- package/dist/lib/core/vessel.js +0 -26
- package/dist/lib/debug/console/console-state.d.ts +0 -20
- package/dist/lib/debug/console/console-state.d.ts.map +0 -1
- package/dist/lib/debug/console/console-state.js +0 -11
- package/dist/lib/debug/console/console-store.d.ts +0 -6
- package/dist/lib/debug/console/console-store.d.ts.map +0 -1
- package/dist/lib/debug/debug-state.d.ts +0 -38
- package/dist/lib/debug/debug-state.d.ts.map +0 -1
- package/dist/lib/debug/debug-state.js +0 -40
- package/dist/lib/debug/debug-store.d.ts +0 -15
- package/dist/lib/debug/debug-store.d.ts.map +0 -1
- package/dist/lib/debug/state-based-debug-loader.d.ts +0 -8
- package/dist/lib/debug/state-based-debug-loader.d.ts.map +0 -1
- package/dist/lib/device/aspect-ratio.d.ts +0 -38
- package/dist/lib/device/aspect-ratio.d.ts.map +0 -1
- package/dist/lib/device/aspect-ratio.js +0 -44
- package/dist/lib/device/desktop.d.ts +0 -2
- package/dist/lib/device/desktop.d.ts.map +0 -1
- package/dist/lib/device/mobile.d.ts +0 -2
- package/dist/lib/device/mobile.d.ts.map +0 -1
- package/dist/lib/device/tablet.d.ts +0 -2
- package/dist/lib/device/tablet.d.ts.map +0 -1
- package/dist/lib/entities/actor.d.ts +0 -44
- package/dist/lib/entities/actor.d.ts.map +0 -1
- package/dist/lib/entities/actor.js +0 -122
- package/dist/lib/entities/box.d.ts +0 -27
- package/dist/lib/entities/box.d.ts.map +0 -1
- package/dist/lib/entities/box.js +0 -68
- package/dist/lib/entities/builder.d.ts +0 -28
- package/dist/lib/entities/builder.d.ts.map +0 -1
- package/dist/lib/entities/builder.js +0 -79
- package/dist/lib/entities/create.d.ts +0 -15
- package/dist/lib/entities/create.d.ts.map +0 -1
- package/dist/lib/entities/create.js +0 -31
- package/dist/lib/entities/delegates/animation.d.ts +0 -33
- package/dist/lib/entities/delegates/animation.d.ts.map +0 -1
- package/dist/lib/entities/delegates/animation.js +0 -58
- package/dist/lib/entities/delegates/debug.d.ts +0 -29
- package/dist/lib/entities/delegates/debug.d.ts.map +0 -1
- package/dist/lib/entities/delegates/debug.js +0 -71
- package/dist/lib/entities/delegates/loader.d.ts +0 -12
- package/dist/lib/entities/delegates/loader.d.ts.map +0 -1
- package/dist/lib/entities/delegates/loader.js +0 -19
- package/dist/lib/entities/destroy.d.ts +0 -4
- package/dist/lib/entities/destroy.d.ts.map +0 -1
- package/dist/lib/entities/destroy.js +0 -15
- package/dist/lib/entities/entity.d.ts +0 -96
- package/dist/lib/entities/entity.d.ts.map +0 -1
- package/dist/lib/entities/entity.js +0 -120
- package/dist/lib/entities/index.d.ts +0 -12
- package/dist/lib/entities/index.d.ts.map +0 -1
- package/dist/lib/entities/plane.d.ts +0 -36
- package/dist/lib/entities/plane.d.ts.map +0 -1
- package/dist/lib/entities/plane.js +0 -81
- package/dist/lib/entities/rect.d.ts +0 -63
- package/dist/lib/entities/rect.d.ts.map +0 -1
- package/dist/lib/entities/rect.js +0 -160
- package/dist/lib/entities/sphere.d.ts +0 -29
- package/dist/lib/entities/sphere.d.ts.map +0 -1
- package/dist/lib/entities/sphere.js +0 -68
- package/dist/lib/entities/sprite.d.ts +0 -53
- package/dist/lib/entities/sprite.d.ts.map +0 -1
- package/dist/lib/entities/sprite.js +0 -118
- package/dist/lib/entities/text.d.ts +0 -49
- package/dist/lib/entities/text.d.ts.map +0 -1
- package/dist/lib/entities/text.js +0 -140
- package/dist/lib/entities/zone.d.ts +0 -54
- package/dist/lib/entities/zone.d.ts.map +0 -1
- package/dist/lib/entities/zone.js +0 -103
- package/dist/lib/game/game-blueprint.d.ts +0 -38
- package/dist/lib/game/game-blueprint.d.ts.map +0 -1
- package/dist/lib/game/game-canvas.d.ts +0 -35
- package/dist/lib/game/game-canvas.d.ts.map +0 -1
- package/dist/lib/game/game-canvas.js +0 -57
- package/dist/lib/game/game-config.d.ts +0 -59
- package/dist/lib/game/game-config.d.ts.map +0 -1
- package/dist/lib/game/game-config.js +0 -78
- package/dist/lib/game/game-default.d.ts +0 -14
- package/dist/lib/game/game-default.d.ts.map +0 -1
- package/dist/lib/game/game-default.js +0 -23
- package/dist/lib/game/game-interfaces.d.ts +0 -29
- package/dist/lib/game/game-interfaces.d.ts.map +0 -1
- package/dist/lib/game/game-retro-resolutions.d.ts +0 -25
- package/dist/lib/game/game-retro-resolutions.d.ts.map +0 -1
- package/dist/lib/game/game-retro-resolutions.js +0 -80
- package/dist/lib/game/game-state.d.ts +0 -11
- package/dist/lib/game/game-state.d.ts.map +0 -1
- package/dist/lib/game/game-state.js +0 -17
- package/dist/lib/game/game.d.ts +0 -37
- package/dist/lib/game/game.d.ts.map +0 -1
- package/dist/lib/game/game.js +0 -109
- package/dist/lib/game/zylem-game.d.ts +0 -58
- package/dist/lib/game/zylem-game.d.ts.map +0 -1
- package/dist/lib/game/zylem-game.js +0 -140
- package/dist/lib/graphics/geometries/XZPlaneGeometry.d.ts +0 -8
- package/dist/lib/graphics/geometries/XZPlaneGeometry.d.ts.map +0 -1
- package/dist/lib/graphics/geometries/XZPlaneGeometry.js +0 -34
- package/dist/lib/graphics/material.d.ts +0 -29
- package/dist/lib/graphics/material.d.ts.map +0 -1
- package/dist/lib/graphics/material.js +0 -64
- package/dist/lib/graphics/mesh.d.ts +0 -19
- package/dist/lib/graphics/mesh.d.ts.map +0 -1
- package/dist/lib/graphics/mesh.js +0 -14
- package/dist/lib/graphics/render-pass.d.ts +0 -17
- package/dist/lib/graphics/render-pass.d.ts.map +0 -1
- 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.d.ts +0 -50
- package/dist/lib/graphics/zylem-scene.d.ts.map +0 -1
- package/dist/lib/graphics/zylem-scene.js +0 -75
- package/dist/lib/input/gamepad-provider.d.ts +0 -14
- package/dist/lib/input/gamepad-provider.d.ts.map +0 -1
- package/dist/lib/input/gamepad-provider.js +0 -58
- package/dist/lib/input/input-manager.d.ts +0 -15
- package/dist/lib/input/input-manager.d.ts.map +0 -1
- package/dist/lib/input/input-manager.js +0 -70
- package/dist/lib/input/input-provider.d.ts +0 -7
- package/dist/lib/input/input-provider.d.ts.map +0 -1
- package/dist/lib/input/input.d.ts +0 -48
- package/dist/lib/input/input.d.ts.map +0 -1
- package/dist/lib/input/keyboard-provider.d.ts +0 -21
- package/dist/lib/input/keyboard-provider.d.ts.map +0 -1
- package/dist/lib/input/keyboard-provider.js +0 -120
- package/dist/lib/interfaces/entity.d.ts +0 -26
- package/dist/lib/interfaces/entity.d.ts.map +0 -1
- package/dist/lib/sounds/index.d.ts +0 -3
- package/dist/lib/sounds/index.d.ts.map +0 -1
- package/dist/lib/sounds/ping-pong-sound.d.ts +0 -5
- package/dist/lib/sounds/ping-pong-sound.d.ts.map +0 -1
- package/dist/lib/sounds/ricochet-sound.d.ts +0 -5
- package/dist/lib/sounds/ricochet-sound.d.ts.map +0 -1
- package/dist/lib/stage/debug-entity-cursor.d.ts +0 -24
- package/dist/lib/stage/debug-entity-cursor.d.ts.map +0 -1
- package/dist/lib/stage/debug-entity-cursor.js +0 -53
- package/dist/lib/stage/entity-spawner.d.ts +0 -9
- package/dist/lib/stage/entity-spawner.d.ts.map +0 -1
- package/dist/lib/stage/entity-spawner.js +0 -27
- package/dist/lib/stage/stage-blueprint.d.ts +0 -45
- package/dist/lib/stage/stage-blueprint.d.ts.map +0 -1
- package/dist/lib/stage/stage-blueprint.js +0 -56
- package/dist/lib/stage/stage-camera-debug-delegate.d.ts +0 -14
- package/dist/lib/stage/stage-camera-debug-delegate.d.ts.map +0 -1
- package/dist/lib/stage/stage-debug-delegate.d.ts +0 -26
- package/dist/lib/stage/stage-debug-delegate.d.ts.map +0 -1
- package/dist/lib/stage/stage-debug-delegate.js +0 -100
- package/dist/lib/stage/stage-default.d.ts +0 -3
- package/dist/lib/stage/stage-default.d.ts.map +0 -1
- package/dist/lib/stage/stage-default.js +0 -32
- package/dist/lib/stage/stage-state.d.ts +0 -14
- package/dist/lib/stage/stage-state.d.ts.map +0 -1
- package/dist/lib/stage/stage-state.js +0 -36
- package/dist/lib/stage/stage.d.ts +0 -33
- package/dist/lib/stage/stage.d.ts.map +0 -1
- package/dist/lib/stage/stage.js +0 -60
- package/dist/lib/stage/zylem-stage.d.ts +0 -128
- package/dist/lib/stage/zylem-stage.d.ts.map +0 -1
- package/dist/lib/stage/zylem-stage.js +0 -268
- package/dist/lib/systems/test-system.d.ts +0 -2
- package/dist/lib/systems/test-system.d.ts.map +0 -1
- package/dist/lib/systems/transformable.system.d.ts +0 -25
- package/dist/lib/systems/transformable.system.d.ts.map +0 -1
- package/dist/lib/systems/transformable.system.js +0 -43
- package/dist/lib/types/entity-types.d.ts +0 -24
- package/dist/lib/types/entity-types.d.ts.map +0 -1
- package/dist/lib/types/index.d.ts +0 -3
- package/dist/lib/types/index.d.ts.map +0 -1
- package/dist/lib/types/stage-types.d.ts +0 -26
- package/dist/lib/types/stage-types.d.ts.map +0 -1
- package/dist/lib/ui/Debug.d.ts +0 -6
- package/dist/lib/ui/Debug.d.ts.map +0 -1
- package/dist/lib/ui/console/Console.d.ts +0 -7
- package/dist/lib/ui/console/Console.d.ts.map +0 -1
- package/dist/lib/ui/debug-panel/AccordionMenu.d.ts +0 -7
- package/dist/lib/ui/debug-panel/AccordionMenu.d.ts.map +0 -1
- package/dist/lib/ui/debug-panel/Menu.d.ts +0 -6
- package/dist/lib/ui/debug-panel/Menu.d.ts.map +0 -1
- package/dist/lib/ui/debug-panel/sections/EntitiesSection.d.ts +0 -4
- package/dist/lib/ui/debug-panel/sections/EntitiesSection.d.ts.map +0 -1
- package/dist/lib/ui/debug-panel/sections/GameSection.d.ts +0 -3
- package/dist/lib/ui/debug-panel/sections/GameSection.d.ts.map +0 -1
- package/dist/lib/ui/debug-panel/sections/StagesSection.d.ts +0 -3
- package/dist/lib/ui/debug-panel/sections/StagesSection.d.ts.map +0 -1
- package/dist/lib/ui/debug-panel/sections/all.d.ts +0 -4
- package/dist/lib/ui/debug-panel/sections/all.d.ts.map +0 -1
- package/dist/lib/ui/toolbar/Toolbar.d.ts +0 -6
- package/dist/lib/ui/toolbar/Toolbar.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/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,125 +0,0 @@
|
|
|
1
|
-
import { Vector3 } from 'three';
|
|
2
|
-
import { RigidBody, Vector } from '@dimforge/rapier3d-compat';
|
|
3
|
-
export interface EntityWithBody {
|
|
4
|
-
body: RigidBody | null;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Move an entity along the X axis, preserving other velocities
|
|
8
|
-
*/
|
|
9
|
-
export declare function moveX(entity: EntityWithBody, delta: number): void;
|
|
10
|
-
/**
|
|
11
|
-
* Move an entity along the Y axis, preserving other velocities
|
|
12
|
-
*/
|
|
13
|
-
export declare function moveY(entity: EntityWithBody, delta: number): void;
|
|
14
|
-
/**
|
|
15
|
-
* Move an entity along the Z axis, preserving other velocities
|
|
16
|
-
*/
|
|
17
|
-
export declare function moveZ(entity: EntityWithBody, delta: number): void;
|
|
18
|
-
/**
|
|
19
|
-
* Move an entity along the X and Y axis, preserving Z velocity
|
|
20
|
-
*/
|
|
21
|
-
export declare function moveXY(entity: EntityWithBody, deltaX: number, deltaY: number): void;
|
|
22
|
-
/**
|
|
23
|
-
* Move an entity along the X and Z axis, preserving Y velocity
|
|
24
|
-
*/
|
|
25
|
-
export declare function moveXZ(entity: EntityWithBody, deltaX: number, deltaZ: number): void;
|
|
26
|
-
/**
|
|
27
|
-
* Move entity based on a vector, adding to existing velocities
|
|
28
|
-
*/
|
|
29
|
-
export declare function move(entity: EntityWithBody, vector: Vector3): void;
|
|
30
|
-
/**
|
|
31
|
-
* Reset entity velocity
|
|
32
|
-
*/
|
|
33
|
-
export declare function resetVelocity(entity: EntityWithBody): void;
|
|
34
|
-
/**
|
|
35
|
-
* Move entity forward in 2D space, preserving Z velocity
|
|
36
|
-
*/
|
|
37
|
-
export declare function moveForwardXY(entity: EntityWithBody, delta: number, rotation2DAngle: number): void;
|
|
38
|
-
/**
|
|
39
|
-
* Get entity position
|
|
40
|
-
*/
|
|
41
|
-
export declare function getPosition(entity: EntityWithBody): Vector | null;
|
|
42
|
-
/**
|
|
43
|
-
* Get entity velocity
|
|
44
|
-
*/
|
|
45
|
-
export declare function getVelocity(entity: EntityWithBody): Vector | null;
|
|
46
|
-
/**
|
|
47
|
-
* Set entity position
|
|
48
|
-
*/
|
|
49
|
-
export declare function setPosition(entity: EntityWithBody, x: number, y: number, z: number): void;
|
|
50
|
-
/**
|
|
51
|
-
* Set entity X position
|
|
52
|
-
*/
|
|
53
|
-
export declare function setPositionX(entity: EntityWithBody, x: number): void;
|
|
54
|
-
/**
|
|
55
|
-
* Set entity Y position
|
|
56
|
-
*/
|
|
57
|
-
export declare function setPositionY(entity: EntityWithBody, y: number): void;
|
|
58
|
-
/**
|
|
59
|
-
* Set entity Z position
|
|
60
|
-
*/
|
|
61
|
-
export declare function setPositionZ(entity: EntityWithBody, z: number): void;
|
|
62
|
-
/**
|
|
63
|
-
* Wrap entity around 2D bounds
|
|
64
|
-
*/
|
|
65
|
-
export declare function wrapAroundXY(entity: EntityWithBody, boundsX: number, boundsY: number): void;
|
|
66
|
-
/**
|
|
67
|
-
* Wrap entity around 3D bounds
|
|
68
|
-
*/
|
|
69
|
-
export declare function wrapAround3D(entity: EntityWithBody, boundsX: number, boundsY: number, boundsZ: number): void;
|
|
70
|
-
/**
|
|
71
|
-
* Enhanced moveable entity with bound methods
|
|
72
|
-
*/
|
|
73
|
-
export interface MoveableEntity extends EntityWithBody {
|
|
74
|
-
moveX(delta: number): void;
|
|
75
|
-
moveY(delta: number): void;
|
|
76
|
-
moveZ(delta: number): void;
|
|
77
|
-
moveXY(deltaX: number, deltaY: number): void;
|
|
78
|
-
moveXZ(deltaX: number, deltaZ: number): void;
|
|
79
|
-
move(vector: Vector3): void;
|
|
80
|
-
resetVelocity(): void;
|
|
81
|
-
moveForwardXY(delta: number, rotation2DAngle: number): void;
|
|
82
|
-
getPosition(): Vector | null;
|
|
83
|
-
getVelocity(): Vector | null;
|
|
84
|
-
setPosition(x: number, y: number, z: number): void;
|
|
85
|
-
setPositionX(x: number): void;
|
|
86
|
-
setPositionY(y: number): void;
|
|
87
|
-
setPositionZ(z: number): void;
|
|
88
|
-
wrapAroundXY(boundsX: number, boundsY: number): void;
|
|
89
|
-
wrapAround3D(boundsX: number, boundsY: number, boundsZ: number): void;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Class decorator to enhance an entity with additive movement methods
|
|
93
|
-
*/
|
|
94
|
-
export declare function moveable<T extends {
|
|
95
|
-
new (...args: any[]): EntityWithBody;
|
|
96
|
-
}>(constructor: T): {
|
|
97
|
-
new (...args: any[]): {
|
|
98
|
-
moveX(delta: number): void;
|
|
99
|
-
moveY(delta: number): void;
|
|
100
|
-
moveZ(delta: number): void;
|
|
101
|
-
moveXY(deltaX: number, deltaY: number): void;
|
|
102
|
-
moveXZ(deltaX: number, deltaZ: number): void;
|
|
103
|
-
move(vector: Vector3): void;
|
|
104
|
-
resetVelocity(): void;
|
|
105
|
-
moveForwardXY(delta: number, rotation2DAngle: number): void;
|
|
106
|
-
getPosition(): Vector | null;
|
|
107
|
-
getVelocity(): Vector | null;
|
|
108
|
-
setPosition(x: number, y: number, z: number): void;
|
|
109
|
-
setPositionX(x: number): void;
|
|
110
|
-
setPositionY(y: number): void;
|
|
111
|
-
setPositionZ(z: number): void;
|
|
112
|
-
wrapAroundXY(boundsX: number, boundsY: number): void;
|
|
113
|
-
wrapAround3D(boundsX: number, boundsY: number, boundsZ: number): void;
|
|
114
|
-
body: RigidBody | null;
|
|
115
|
-
};
|
|
116
|
-
} & T;
|
|
117
|
-
/**
|
|
118
|
-
* Enhance an entity with additive movement methods (retained for compatibility)
|
|
119
|
-
*/
|
|
120
|
-
export declare function makeMoveable<T extends EntityWithBody>(entity: T): T & MoveableEntity;
|
|
121
|
-
/**
|
|
122
|
-
* Wrap a standalone function with movement capabilities
|
|
123
|
-
*/
|
|
124
|
-
export declare function withMovement<T extends (...args: any[]) => any>(fn: T, entity: EntityWithBody): (...args: Parameters<T>) => ReturnType<T> & MoveableEntity;
|
|
125
|
-
//# sourceMappingURL=moveable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"moveable.d.ts","sourceRoot":"","sources":["../../../../src/l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AG,IAAI;;MAqPtB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,cAAc,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,cAAc,CAqBpF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAC7D,EAAE,EAAE,CAAC,EACL,MAAM,EAAE,cAAc,GACpB,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,cAAc,CAO5D"}
|
|
@@ -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
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { Vector3 } from 'three';
|
|
2
|
-
import { RigidBody } from '@dimforge/rapier3d-compat';
|
|
3
|
-
export interface RotatableEntity {
|
|
4
|
-
body: RigidBody | null;
|
|
5
|
-
group: any;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Rotate an entity in the direction of a movement vector
|
|
9
|
-
*/
|
|
10
|
-
export declare function rotateInDirection(entity: RotatableEntity, moveVector: Vector3): void;
|
|
11
|
-
/**
|
|
12
|
-
* Rotate an entity around the Y axis using Euler angles
|
|
13
|
-
*/
|
|
14
|
-
export declare function rotateYEuler(entity: RotatableEntity, amount: number): void;
|
|
15
|
-
/**
|
|
16
|
-
* Rotate an entity using Euler angles
|
|
17
|
-
*/
|
|
18
|
-
export declare function rotateEuler(entity: RotatableEntity, rotation: Vector3): void;
|
|
19
|
-
/**
|
|
20
|
-
* Rotate an entity around the Y axis
|
|
21
|
-
*/
|
|
22
|
-
export declare function rotateY(entity: RotatableEntity, delta: number): void;
|
|
23
|
-
/**
|
|
24
|
-
* Rotate an entity around the Z axis
|
|
25
|
-
*/
|
|
26
|
-
export declare function rotateZ(entity: RotatableEntity, delta: number): void;
|
|
27
|
-
/**
|
|
28
|
-
* Set rotation around Y axis
|
|
29
|
-
*/
|
|
30
|
-
export declare function setRotationY(entity: RotatableEntity, y: number): void;
|
|
31
|
-
/**
|
|
32
|
-
* Set rotation around Y axis
|
|
33
|
-
*/
|
|
34
|
-
export declare function setRotationDegreesY(entity: RotatableEntity, y: number): void;
|
|
35
|
-
/**
|
|
36
|
-
* Set rotation around X axis
|
|
37
|
-
*/
|
|
38
|
-
export declare function setRotationX(entity: RotatableEntity, x: number): void;
|
|
39
|
-
/**
|
|
40
|
-
* Set rotation around X axis
|
|
41
|
-
*/
|
|
42
|
-
export declare function setRotationDegreesX(entity: RotatableEntity, x: number): void;
|
|
43
|
-
/**
|
|
44
|
-
* Set rotation around Z axis
|
|
45
|
-
*/
|
|
46
|
-
export declare function setRotationZ(entity: RotatableEntity, z: number): void;
|
|
47
|
-
/**
|
|
48
|
-
* Set rotation around Z axis
|
|
49
|
-
*/
|
|
50
|
-
export declare function setRotationDegreesZ(entity: RotatableEntity, z: number): void;
|
|
51
|
-
/**
|
|
52
|
-
* Set rotation for all axes
|
|
53
|
-
*/
|
|
54
|
-
export declare function setRotation(entity: RotatableEntity, x: number, y: number, z: number): void;
|
|
55
|
-
/**
|
|
56
|
-
* Set rotation for all axes
|
|
57
|
-
*/
|
|
58
|
-
export declare function setRotationDegrees(entity: RotatableEntity, x: number, y: number, z: number): void;
|
|
59
|
-
/**
|
|
60
|
-
* Get current rotation
|
|
61
|
-
*/
|
|
62
|
-
export declare function getRotation(entity: RotatableEntity): any;
|
|
63
|
-
/**
|
|
64
|
-
* Rotatable entity API with bound methods
|
|
65
|
-
*/
|
|
66
|
-
export interface RotatableEntityAPI extends RotatableEntity {
|
|
67
|
-
rotateInDirection(moveVector: Vector3): void;
|
|
68
|
-
rotateYEuler(amount: number): void;
|
|
69
|
-
rotateEuler(rotation: Vector3): void;
|
|
70
|
-
rotateY(delta: number): void;
|
|
71
|
-
rotateZ(delta: number): void;
|
|
72
|
-
setRotationY(y: number): void;
|
|
73
|
-
setRotationX(x: number): void;
|
|
74
|
-
setRotationZ(z: number): void;
|
|
75
|
-
setRotationDegrees(x: number, y: number, z: number): void;
|
|
76
|
-
setRotationDegreesY(y: number): void;
|
|
77
|
-
setRotationDegreesX(x: number): void;
|
|
78
|
-
setRotationDegreesZ(z: number): void;
|
|
79
|
-
setRotation(x: number, y: number, z: number): void;
|
|
80
|
-
getRotation(): any;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Class decorator to enhance an entity with rotatable methods
|
|
84
|
-
*/
|
|
85
|
-
export declare function rotatable<T extends {
|
|
86
|
-
new (...args: any[]): RotatableEntity;
|
|
87
|
-
}>(constructor: T): {
|
|
88
|
-
new (...args: any[]): {
|
|
89
|
-
rotateInDirection(moveVector: Vector3): void;
|
|
90
|
-
rotateYEuler(amount: number): void;
|
|
91
|
-
rotateEuler(rotation: Vector3): void;
|
|
92
|
-
rotateY(delta: number): void;
|
|
93
|
-
rotateZ(delta: number): void;
|
|
94
|
-
setRotationY(y: number): void;
|
|
95
|
-
setRotationX(x: number): void;
|
|
96
|
-
setRotationZ(z: number): void;
|
|
97
|
-
setRotationDegrees(x: number, y: number, z: number): void;
|
|
98
|
-
setRotationDegreesY(y: number): void;
|
|
99
|
-
setRotationDegreesX(x: number): void;
|
|
100
|
-
setRotationDegreesZ(z: number): void;
|
|
101
|
-
setRotation(x: number, y: number, z: number): void;
|
|
102
|
-
getRotation(): any;
|
|
103
|
-
body: RigidBody | null;
|
|
104
|
-
group: any;
|
|
105
|
-
};
|
|
106
|
-
} & T;
|
|
107
|
-
/**
|
|
108
|
-
* Enhance an entity instance with rotatable methods
|
|
109
|
-
*/
|
|
110
|
-
export declare function makeRotatable<T extends RotatableEntity>(entity: T): T & RotatableEntityAPI;
|
|
111
|
-
//# sourceMappingURL=rotatable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rotatable.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/capabilities/rotatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAAyB,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,GAAG,CAAC;CACX;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAIpF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAE1E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAI5E;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,MAAM,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GAAG,IAAI;+BAGb,MAAM,GAAG,IAAI;+BAGb,MAAM,GAAG,IAAI;uBAGrB,MAAM,KAAK,MAAM,KAAK,MAAM,GAAG,IAAI;uBAGnC,GAAG;cA7Lb,SAAS,GAAG,IAAI;eACf,GAAG;;MAgMV;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,eAAe,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAmB1F"}
|
|
@@ -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,7 +0,0 @@
|
|
|
1
|
-
import { EntityWithBody, MoveableEntity } from './moveable';
|
|
2
|
-
import { RotatableEntity, RotatableEntityAPI } from './rotatable';
|
|
3
|
-
/**
|
|
4
|
-
* Enhance an entity with both movement and rotation capabilities.
|
|
5
|
-
*/
|
|
6
|
-
export declare function makeTransformable<T extends RotatableEntity & EntityWithBody>(entity: T): T & MoveableEntity & RotatableEntityAPI;
|
|
7
|
-
//# sourceMappingURL=transformable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformable.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/capabilities/transformable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAiB,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjF;;GAEG;AACH,wBAAgB,iBAAiB,CAChC,CAAC,SAAS,eAAe,GAAG,cAAc,EACzC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,cAAc,GAAG,kBAAkB,CAIpD"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { UpdateContext } from "../core/base-node-life-cycle";
|
|
2
|
-
/**
|
|
3
|
-
* Listen for a single global key change inside an onUpdate pipeline.
|
|
4
|
-
* Usage: onUpdate(globalChange('p1Score', (value) => { ... }))
|
|
5
|
-
*/
|
|
6
|
-
export declare function globalChange<T = any>(key: string, callback: (value: T, ctx: UpdateContext<any>) => void): (ctx: UpdateContext<any>) => void;
|
|
7
|
-
/**
|
|
8
|
-
* Listen for multiple global key changes inside an onUpdate pipeline.
|
|
9
|
-
* Calls back when any of the provided keys changes.
|
|
10
|
-
* Usage: onUpdate(globalChanges(['p1Score','p2Score'], ([p1,p2]) => { ... }))
|
|
11
|
-
*/
|
|
12
|
-
export declare function globalChanges<T = any>(keys: string[], callback: (values: T[], ctx: UpdateContext<any>) => void): (ctx: UpdateContext<any>) => void;
|
|
13
|
-
/**
|
|
14
|
-
* Listen for a single stage variable change inside an onUpdate pipeline.
|
|
15
|
-
* Usage: onUpdate(variableChange('score', (value, ctx) => { ... }))
|
|
16
|
-
*/
|
|
17
|
-
export declare function variableChange<T = any>(key: string, callback: (value: T, ctx: UpdateContext<any>) => void): (ctx: UpdateContext<any>) => void;
|
|
18
|
-
/**
|
|
19
|
-
* Listen for multiple stage variable changes; fires when any changes.
|
|
20
|
-
* Usage: onUpdate(variableChanges(['a','b'], ([a,b], ctx) => { ... }))
|
|
21
|
-
*/
|
|
22
|
-
export declare function variableChanges<T = any>(keys: string[], callback: (values: T[], ctx: UpdateContext<any>) => void): (ctx: UpdateContext<any>) => void;
|
|
23
|
-
//# sourceMappingURL=global-change.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global-change.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/global-change.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,GAAG,GAAG,EACnC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,IAAI,IAG7C,KAAK,aAAa,CAAC,GAAG,CAAC,UAU/B;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,GAAG,GAAG,EACpC,IAAI,EAAE,MAAM,EAAE,EACd,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,IAAI,IAGhD,KAAK,aAAa,CAAC,GAAG,CAAC,UAa/B;AAGD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,GAAG,GAAG,EACrC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,IAAI,IAG7C,KAAK,aAAa,CAAC,GAAG,CAAC,UAU/B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,GAAG,EACtC,IAAI,EAAE,MAAM,EAAE,EACd,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,IAAI,IAGhD,KAAK,aAAa,CAAC,GAAG,CAAC,UAc/B"}
|
|
@@ -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,16 +0,0 @@
|
|
|
1
|
-
import { Vector2, Vector3 } from "three";
|
|
2
|
-
import { PerspectiveType } from "./perspective";
|
|
3
|
-
import { ZylemCamera } from "./zylem-camera";
|
|
4
|
-
export interface CameraOptions {
|
|
5
|
-
perspective?: PerspectiveType;
|
|
6
|
-
position?: Vector3;
|
|
7
|
-
target?: Vector3;
|
|
8
|
-
zoom?: number;
|
|
9
|
-
screenResolution?: Vector2;
|
|
10
|
-
}
|
|
11
|
-
export declare class CameraWrapper {
|
|
12
|
-
cameraRef: ZylemCamera;
|
|
13
|
-
constructor(camera: ZylemCamera);
|
|
14
|
-
}
|
|
15
|
-
export declare function camera(options: CameraOptions): CameraWrapper;
|
|
16
|
-
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/lib/camera/camera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC7B,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBAAa,aAAa;IACzB,SAAS,EAAE,WAAW,CAAC;gBAEX,MAAM,EAAE,WAAW;CAG/B;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAa5D"}
|
|
@@ -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,32 +0,0 @@
|
|
|
1
|
-
import { Scene, Vector2, WebGLRenderer } from 'three';
|
|
2
|
-
import { PerspectiveController, ZylemCamera } from './zylem-camera';
|
|
3
|
-
/**
|
|
4
|
-
* Fixed 2D Camera Controller
|
|
5
|
-
* Maintains a static 2D camera view with no automatic following or movement
|
|
6
|
-
*/
|
|
7
|
-
export declare class Fixed2DCamera implements PerspectiveController {
|
|
8
|
-
screenResolution: Vector2 | null;
|
|
9
|
-
renderer: WebGLRenderer | null;
|
|
10
|
-
scene: Scene | null;
|
|
11
|
-
cameraRef: ZylemCamera | null;
|
|
12
|
-
constructor();
|
|
13
|
-
/**
|
|
14
|
-
* Setup the fixed 2D camera controller
|
|
15
|
-
*/
|
|
16
|
-
setup(params: {
|
|
17
|
-
screenResolution: Vector2;
|
|
18
|
-
renderer: WebGLRenderer;
|
|
19
|
-
scene: Scene;
|
|
20
|
-
camera: ZylemCamera;
|
|
21
|
-
}): void;
|
|
22
|
-
/**
|
|
23
|
-
* Update the fixed 2D camera
|
|
24
|
-
* Fixed cameras don't need to update position/rotation automatically
|
|
25
|
-
*/
|
|
26
|
-
update(delta: number): void;
|
|
27
|
-
/**
|
|
28
|
-
* Handle resize events for 2D camera
|
|
29
|
-
*/
|
|
30
|
-
resize(width: number, height: number): void;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=fixed-2d.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fixed-2d.d.ts","sourceRoot":"","sources":["../../../src/lib/camera/fixed-2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEpE;;;GAGG;AACH,qBAAa,aAAc,YAAW,qBAAqB;IAC1D,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAQ;IACxC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAQ;IACtC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAQ;IAC3B,SAAS,EAAE,WAAW,GAAG,IAAI,CAAQ;;IAMrC;;OAEG;IACH,KAAK,CAAC,MAAM,EAAE;QAAE,gBAAgB,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAE;IAYvG;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM;IAKpB;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAQpC"}
|
|
@@ -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,9 +0,0 @@
|
|
|
1
|
-
export declare const Perspectives: {
|
|
2
|
-
readonly FirstPerson: "first-person";
|
|
3
|
-
readonly ThirdPerson: "third-person";
|
|
4
|
-
readonly Isometric: "isometric";
|
|
5
|
-
readonly Flat2D: "flat-2d";
|
|
6
|
-
readonly Fixed2D: "fixed-2d";
|
|
7
|
-
};
|
|
8
|
-
export type PerspectiveType = (typeof Perspectives)[keyof typeof Perspectives];
|
|
9
|
-
//# sourceMappingURL=perspective.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"perspective.d.ts","sourceRoot":"","sources":["../../../src/lib/camera/perspective.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
|