excalibur 0.33.0-alpha.99 → 1.1.0-alpha.310
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/.nvmrc +1 -1
- package/CHANGELOG.md +206 -5
- package/build/esm/excalibur.development.js +37363 -35202
- package/build/esm/excalibur.js +37363 -35202
- package/build/esm/excalibur.min.development.js +18360 -23963
- package/build/esm/excalibur.min.js +18360 -23963
- package/build/{dist → esm/src/engine}/actions/action/move-by.d.ts +1 -4
- package/build/{dist → esm/src/engine}/actions/action/move-to.d.ts +1 -4
- package/build/{dist → esm/src/engine}/actions/action/repeat-forever.d.ts +8 -0
- package/build/{dist → esm/src/engine}/actions/action/rotate-by.d.ts +9 -3
- package/build/{dist → esm/src/engine}/actions/action-context.d.ts +9 -43
- package/build/{dist → esm/src/engine}/actions/actions-component.d.ts +3 -41
- package/build/{dist → esm/src/engine}/actions/actions-system.d.ts +2 -3
- package/build/{dist → esm/src/engine}/actions/index.d.ts +0 -2
- package/build/{dist → esm/src/engine}/actor.d.ts +19 -30
- package/build/{dist → esm/src/engine}/camera.d.ts +13 -10
- package/build/{dist → esm/src/engine}/collision/body-component.d.ts +11 -20
- package/build/{dist → esm/src/engine}/collision/bounding-box.d.ts +3 -10
- package/build/{dist → esm/src/engine}/collision/collider-component.d.ts +17 -2
- package/build/{dist → esm/src/engine}/collision/colliders/circle-collider.d.ts +8 -0
- package/build/{dist → esm/src/engine}/collision/colliders/closest-line-jump-table.d.ts +1 -1
- package/build/{dist → esm/src/engine}/collision/colliders/collider.d.ts +7 -1
- package/build/{dist/collision/colliders/shape.d.ts → esm/src/engine/collision/colliders/colliders.d.ts} +50 -0
- package/build/{dist → esm/src/engine}/collision/colliders/collision-jump-table.d.ts +2 -1
- package/build/{dist → esm/src/engine}/collision/colliders/edge-collider.d.ts +25 -1
- package/build/{dist → esm/src/engine}/collision/colliders/polygon-collider.d.ts +23 -0
- package/build/esm/src/engine/collision/colliders/sat-shape.d.ts +27 -0
- package/build/{dist → esm/src/engine}/collision/colliders/separating-axis.d.ts +11 -6
- package/build/{dist → esm/src/engine}/collision/collision-system.d.ts +9 -5
- package/build/{dist → esm/src/engine}/collision/detection/collision-contact.d.ts +6 -0
- package/build/{dist → esm/src/engine}/collision/detection/dynamic-tree.d.ts +9 -11
- package/build/{dist → esm/src/engine}/collision/detection/pair.d.ts +9 -0
- package/build/{dist → esm/src/engine}/collision/detection/quad-tree.d.ts +2 -2
- package/build/{dist → esm/src/engine}/collision/detection/sparse-hash-grid-collision-processor.d.ts +7 -2
- package/build/{dist → esm/src/engine}/collision/detection/sparse-hash-grid.d.ts +11 -3
- package/build/{dist → esm/src/engine}/collision/group/collision-group-manager.d.ts +1 -1
- package/build/{dist → esm/src/engine}/collision/index.d.ts +2 -1
- package/build/{dist → esm/src/engine}/collision/motion-system.d.ts +2 -3
- package/build/{dist → esm/src/engine}/collision/physics-config.d.ts +7 -0
- package/build/{dist → esm/src/engine}/collision/physics-world.d.ts +34 -33
- package/build/esm/src/engine/collision/solver/realistic-solver.d.ts +50 -0
- package/build/{dist → esm/src/engine}/collision/solver/solver.d.ts +4 -2
- package/build/{dist → esm/src/engine}/debug/debug-config.d.ts +16 -0
- package/build/{dist → esm/src/engine}/debug/debug-system.d.ts +3 -3
- package/build/esm/src/engine/deprecated.d.ts +1 -0
- package/build/{dist → esm/src/engine}/director/director.d.ts +13 -8
- package/build/{dist → esm/src/engine}/director/slide.d.ts +2 -2
- package/build/{dist → esm/src/engine}/director/transition.d.ts +1 -4
- package/build/{dist → esm/src/engine}/engine.d.ts +58 -8
- package/build/{dist → esm/src/engine}/entity-component-system/component.d.ts +1 -1
- package/build/{dist → esm/src/engine}/entity-component-system/components/motion-component.d.ts +1 -0
- package/build/{dist → esm/src/engine}/entity-component-system/components/pause-component.d.ts +2 -0
- package/build/{dist → esm/src/engine}/entity-component-system/components/tags-component.d.ts +1 -0
- package/build/{dist → esm/src/engine}/entity-component-system/components/transform-component.d.ts +1 -0
- package/build/{dist → esm/src/engine}/entity-component-system/entity.d.ts +0 -10
- package/build/{dist → esm/src/engine}/entity-component-system/index.d.ts +0 -1
- package/build/{dist → esm/src/engine}/entity-component-system/query.d.ts +1 -1
- package/build/{dist → esm/src/engine}/entity-component-system/system.d.ts +11 -4
- package/build/{dist → esm/src/engine}/entity-component-system/world.d.ts +1 -5
- package/build/{dist → esm/src/engine}/events/media-events.d.ts +3 -3
- package/build/{dist → esm/src/engine}/events.d.ts +4 -4
- package/build/{dist → esm/src/engine}/graphics/animation.d.ts +15 -5
- package/build/{dist → esm/src/engine}/graphics/context/circle-renderer/circle-renderer.d.ts +5 -0
- package/build/{dist → esm/src/engine}/graphics/context/debug-text.d.ts +13 -1
- package/build/{dist → esm/src/engine}/graphics/context/excalibur-graphics-context-2d-canvas.d.ts +13 -3
- package/build/{dist → esm/src/engine}/graphics/context/excalibur-graphics-context-webgl.d.ts +43 -6
- package/build/{dist → esm/src/engine}/graphics/context/excalibur-graphics-context.d.ts +108 -4
- package/build/esm/src/engine/graphics/context/framebuffer.d.ts +154 -0
- package/build/esm/src/engine/graphics/context/glsl.d.ts +47 -0
- package/build/{dist → esm/src/engine}/graphics/context/material-renderer/material-renderer.d.ts +1 -0
- package/build/esm/src/engine/graphics/context/material.d.ts +208 -0
- package/build/esm/src/engine/graphics/context/shader-pipeline/effects/bloom-effect.d.ts +80 -0
- package/build/esm/src/engine/graphics/context/shader-pipeline/effects/blur-passes.d.ts +75 -0
- package/build/esm/src/engine/graphics/context/shader-pipeline/effects/glow-passes.d.ts +93 -0
- package/build/esm/src/engine/graphics/context/shader-pipeline/shader-pass.d.ts +138 -0
- package/build/esm/src/engine/graphics/context/shader-pipeline/shader-pipeline.d.ts +91 -0
- package/build/{dist → esm/src/engine}/graphics/context/shader.d.ts +43 -6
- package/build/{dist → esm/src/engine}/graphics/context/texture-loader.d.ts +1 -1
- package/build/{dist → esm/src/engine}/graphics/context/webgl-util.d.ts +2 -2
- package/build/{dist → esm/src/engine}/graphics/debug-graphics-component.d.ts +1 -0
- package/build/{dist → esm/src/engine}/graphics/filtering.d.ts +1 -1
- package/build/{dist → esm/src/engine}/graphics/font-common.d.ts +2 -2
- package/build/{dist → esm/src/engine}/graphics/font-text-instance.d.ts +5 -5
- package/build/{dist → esm/src/engine}/graphics/font.d.ts +3 -3
- package/build/{dist → esm/src/engine}/graphics/graphics-component.d.ts +28 -15
- package/build/{dist → esm/src/engine}/graphics/graphics-group.d.ts +6 -0
- package/build/{dist → esm/src/engine}/graphics/graphics-system.d.ts +3 -3
- package/build/{dist → esm/src/engine}/graphics/image-source.d.ts +1 -1
- package/build/{dist → esm/src/engine}/graphics/index.d.ts +8 -0
- package/build/{dist → esm/src/engine}/graphics/offscreen-system.d.ts +2 -2
- package/build/{dist → esm/src/engine}/graphics/parallax-component.d.ts +1 -0
- package/build/{dist → esm/src/engine}/graphics/post-processor/color-blindness-post-processor.d.ts +3 -5
- package/build/esm/src/engine/graphics/post-processor/post-processor.d.ts +66 -0
- package/build/esm/src/engine/graphics/post-processor/shader-pipeline-post-processor.d.ts +45 -0
- package/build/{dist → esm/src/engine}/graphics/sprite-font.d.ts +3 -3
- package/build/{dist → esm/src/engine}/index.d.ts +5 -5
- package/build/{dist → esm/src/engine}/input/gamepad.d.ts +4 -7
- package/build/{dist → esm/src/engine}/input/keyboard.d.ts +3 -3
- package/build/{dist → esm/src/engine}/input/pointer-component.d.ts +1 -0
- package/build/{dist → esm/src/engine}/input/pointer-event-receiver.d.ts +13 -0
- package/build/{dist → esm/src/engine}/input/pointer-system.d.ts +3 -3
- package/build/{dist → esm/src/engine}/interfaces/index.d.ts +0 -2
- package/build/{dist → esm/src/engine}/label.d.ts +2 -2
- package/build/esm/src/engine/lighting/cone-light-component.d.ts +47 -0
- package/build/esm/src/engine/lighting/darkness-component.d.ts +34 -0
- package/build/esm/src/engine/lighting/flicker-options.d.ts +17 -0
- package/build/esm/src/engine/lighting/flicker-system.d.ts +19 -0
- package/build/esm/src/engine/lighting/index.d.ts +8 -0
- package/build/esm/src/engine/lighting/light-occluder-component.d.ts +66 -0
- package/build/esm/src/engine/lighting/lighting-config.d.ts +47 -0
- package/build/esm/src/engine/lighting/lighting-system.d.ts +153 -0
- package/build/esm/src/engine/lighting/point-light-component.d.ts +46 -0
- package/build/{dist → esm/src/engine}/math/affine-matrix.d.ts +8 -1
- package/build/esm/src/engine/math/coord-plane.d.ts +52 -0
- package/build/{dist → esm/src/engine}/math/graph.d.ts +2 -3
- package/build/{dist → esm/src/engine}/math/index.d.ts +2 -0
- package/build/{dist → esm/src/engine}/math/line-segment.d.ts +1 -1
- package/build/{dist → esm/src/engine}/math/matrix.d.ts +25 -0
- package/build/{dist → esm/src/engine}/math/ray.d.ts +1 -1
- package/build/{dist → esm/src/engine}/math/transform.d.ts +9 -0
- package/build/{dist → esm/src/engine}/math/vector.d.ts +16 -13
- package/build/esm/src/engine/math/vector3.d.ts +163 -0
- package/build/esm/src/engine/math/vector4.d.ts +157 -0
- package/build/{dist → esm/src/engine}/particles/gpu-particle-emitter.d.ts +2 -2
- package/build/{dist → esm/src/engine}/particles/particle-emitter.d.ts +2 -2
- package/build/{dist → esm/src/engine}/particles/particles.d.ts +6 -1
- package/build/esm/src/engine/plugin.d.ts +253 -0
- package/build/{dist → esm/src/engine}/resources/resource.d.ts +8 -0
- package/build/{dist → esm/src/engine}/resources/sound/index.d.ts +1 -1
- package/build/esm/src/engine/resources/sound/sound-manager.d.ts +378 -0
- package/build/esm/src/engine/resources/sound/sound-track.d.ts +176 -0
- package/build/esm/src/engine/resources/sound/sound.d.ts +351 -0
- package/build/{dist → esm/src/engine}/scene.d.ts +13 -7
- package/build/{dist → esm/src/engine}/screen-element.d.ts +2 -2
- package/build/{dist → esm/src/engine}/screen.d.ts +97 -29
- package/build/{dist → esm/src/engine}/tile-map/isometric-entity-component.d.ts +1 -0
- package/build/{dist → esm/src/engine}/tile-map/isometric-entity-system.d.ts +2 -3
- package/build/{dist → esm/src/engine}/tile-map/isometric-map.d.ts +0 -10
- package/build/{dist → esm/src/engine}/tile-map/tile-map.d.ts +2 -0
- package/build/{dist → esm/src/engine}/timer.d.ts +5 -8
- package/build/{dist/util/pool.d.ts → esm/src/engine/util/arena-pool.d.ts} +15 -4
- package/build/{dist → esm/src/engine}/util/browser.d.ts +8 -0
- package/build/{dist → esm/src/engine}/util/detector.d.ts +1 -1
- package/build/{dist → esm/src/engine}/util/draw-util.d.ts +2 -2
- package/build/{dist → esm/src/engine}/util/index.d.ts +0 -1
- package/build/{dist → esm/src/engine}/util/pause-system.d.ts +7 -1
- package/build/{dist → esm/src/engine}/util/rental-pool.d.ts +1 -0
- package/build/{dist → esm/src/engine}/util/serializer.d.ts +1 -1
- package/build/{dist → esm/src/engine}/util/state-machine.d.ts +1 -1
- package/package.json +38 -44
- package/tsconfig.json +38 -1
- package/.devcontainer/devcontainer.json +0 -26
- package/.git-blame-ignore-revs +0 -3
- package/.gitattributes +0 -70
- package/.gitmodules +0 -0
- package/.husky/pre-commit +0 -1
- package/.prettierrc +0 -8
- package/build/dist/collision/solver/realistic-solver.d.ts +0 -28
- package/build/dist/deprecated.d.ts +0 -0
- package/build/dist/entity-component-system/tag-query.d.ts +0 -28
- package/build/dist/excalibur.development.js +0 -35408
- package/build/dist/excalibur.js +0 -35408
- package/build/dist/excalibur.min.development.js +0 -931
- package/build/dist/excalibur.min.js +0 -931
- package/build/dist/graphics/context/material.d.ts +0 -102
- package/build/dist/graphics/context/render-source.d.ts +0 -7
- package/build/dist/graphics/context/render-target.d.ts +0 -60
- package/build/dist/graphics/post-processor/post-processor.d.ts +0 -36
- package/build/dist/interfaces/audio-implementation.d.ts +0 -25
- package/build/dist/interfaces/audio.d.ts +0 -55
- package/build/dist/math/coord-plane.d.ts +0 -15
- package/build/dist/resources/sound/sound-manager.d.ts +0 -102
- package/build/dist/resources/sound/sound.d.ts +0 -215
- package/build/dist/resources/sound/web-audio-instance.d.ts +0 -49
- package/build/dist/util/decorators.d.ts +0 -15
- package/build/dist/util/easing-functions.d.ts +0 -89
- package/build/dist/util/sound.d.ts +0 -5
- package/deno.json +0 -10
- package/eslint.config.mjs +0 -210
- package/playground/README.md +0 -71
- package/playground/index.html +0 -75
- package/playground/package-lock.json +0 -1976
- package/playground/package.json +0 -27
- package/playground/public/favicon.ico +0 -0
- package/playground/public/icon.png +0 -0
- package/playground/public/logo-white@2x.png +0 -0
- package/playground/public/logo@2x.png +0 -0
- package/playground/public/player-run.png +0 -0
- package/playground/public/rpg-audio/License.txt +0 -21
- package/playground/public/rpg-audio/audio/handleCoins.ogg +0 -0
- package/playground/public/social.jpg +0 -0
- package/playground/public/social.png +0 -0
- package/playground/public/tiny-town/License.txt +0 -22
- package/playground/public/tiny-town/tilemap/tilemap.png +0 -0
- package/playground/tsconfig.json +0 -26
- package/playground/tsdown.config.ts +0 -13
- package/playground/vite.config.ts +0 -5
- package/vite.config.common.js +0 -27
- package/vite.config.ts +0 -78
- package/vitest.config.ts +0 -41
- /package/build/{dist → esm/src/engine}/actions/action/action-sequence.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/blink.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/call-method.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/curve-by.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/curve-to.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/delay.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/die.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/ease-by.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/ease-to.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/fade.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/flash.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/follow.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/meet.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/parallel-actions.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/repeat.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/rotate-to.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/scale-by.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action/scale-to.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action-queue.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/action.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/actions/actionable.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/colliders/composite-collider.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/collision-type.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/detection/collision-processor.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/detection/dynamic-tree-collision-processor.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/detection/ray-cast-hit.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/detection/ray-cast-options.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/detection/spatial-partition-strategy.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/group/collision-group.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/integrator.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/island.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/side.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/solver/arcade-solver.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/solver/contact-bias.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/solver/contact-constraint-point.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/collision/solver-strategy.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/color.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/context.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/debug/debug-flags.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/debug/index.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/director/cross-fade.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/director/default-loader.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/director/fade-in-out.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/director/index.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/director/loader.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/entity-component-system/entity-manager.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/entity-component-system/priority.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/entity-component-system/query-manager.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/entity-component-system/system-manager.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/entity-component-system/types.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/event-emitter.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/events/ex-event.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/events/pointer-events.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/excalibur.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/flags.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/garbage-collector.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/canvas.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/circle.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/debug-circle-renderer/debug-circle-renderer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/debug-line-renderer/debug-line-renderer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/debug-point-renderer/debug-point-renderer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/draw-call.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/image-renderer/image-renderer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/image-renderer-v2/image-renderer-v2.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/particle-renderer/particle-renderer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/quad-index-buffer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/rectangle-renderer/rectangle-renderer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/renderer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/screen-pass-painter/screen-pass-painter.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/state-stack.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/transform-stack.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/uniform-buffer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/vertex-buffer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/context/vertex-layout.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/debug.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/font-cache.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/graphic.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/graphics-diagnostics.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/line.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/nine-slice.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/polygon.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/post-processor/color-blindness-mode.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/post-processor/screen-shader.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/raster.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/rectangle.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/sprite-sheet.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/sprite.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/text.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/tiled-animation.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/tiled-sprite.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/transform-interpolation.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/graphics/wrapping.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/id.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/capture-pointer-config.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/input-host.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/input-mapper.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/native-pointer-button.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/pointer-abstraction.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/pointer-button.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/pointer-event.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/pointer-events-to-object-dispatcher.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/pointer-scope.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/pointer-type.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/wheel-delta-mode.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/input/wheel-event.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/interfaces/clonable.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/interfaces/evented.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/interfaces/lifecycle-events.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/interfaces/loadable.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/interfaces/pointer-event-handlers.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/math/bezier-curve.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/math/easings.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/math/global-coordinates.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/math/lerp.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/math/projection.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/math/random.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/math/rotation-type.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/math/util.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/math/vector-view.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/math/watch-vector.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/particles/emitter-type.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/particles/gpu-particle-renderer.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/particles/index.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/polyfill.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/resources/font.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/resources/gif.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/resources/index.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/resources/sound/audio-context.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/tile-map/index.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/trigger.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/assert.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/clock.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/coroutine.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/fps.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/future.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/iframe.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/log.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/observable.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/required.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/semaphore.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/string.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/toaster.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/util.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/watch.d.ts +0 -0
- /package/build/{dist → esm/src/engine}/util/web-audio.d.ts +0 -0
|
@@ -27,13 +27,19 @@ export declare abstract class Collider implements Clonable<Collider> {
|
|
|
27
27
|
*/
|
|
28
28
|
composite: CompositeCollider | null;
|
|
29
29
|
events: EventEmitter<any>;
|
|
30
|
+
protected _worldVersion: number;
|
|
31
|
+
/**
|
|
32
|
+
* Increments whenever this collider's world space geometry changes (owner transform, offset or shape), cheap change
|
|
33
|
+
* detection for spatial data structures
|
|
34
|
+
*/
|
|
35
|
+
get worldVersion(): number;
|
|
30
36
|
/**
|
|
31
37
|
* Returns a boolean indicating whether this body collided with
|
|
32
38
|
* or was in stationary contact with
|
|
33
39
|
* the body of the other {@apilink Collider}
|
|
34
40
|
*/
|
|
35
41
|
touching(other: Collider): boolean;
|
|
36
|
-
owner: Entity;
|
|
42
|
+
owner: Entity | null;
|
|
37
43
|
/**
|
|
38
44
|
* Pixel offset of the collision collider relative to the collider, by default (0, 0) meaning the collider is positioned
|
|
39
45
|
* on top of the collider.
|
|
@@ -3,8 +3,53 @@ import { CircleCollider } from './circle-collider';
|
|
|
3
3
|
import { EdgeCollider } from './edge-collider';
|
|
4
4
|
import { Vector } from '../../math/vector';
|
|
5
5
|
import { CompositeCollider } from './composite-collider';
|
|
6
|
+
export declare class Colliders {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a box collider, under the hood defines a {@apilink PolygonCollider} collider
|
|
9
|
+
* @param width Width of the box
|
|
10
|
+
* @param height Height of the box
|
|
11
|
+
* @param anchor Anchor of the box (default (.5, .5)) which positions the box relative to the center of the collider's position
|
|
12
|
+
* @param offset Optional offset relative to the collider in local coordinates
|
|
13
|
+
*/
|
|
14
|
+
static Box(width: number, height: number, anchor?: Vector, offset?: Vector): PolygonCollider;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new {@apilink PolygonCollider | `arbitrary polygon`} collider
|
|
17
|
+
*
|
|
18
|
+
* PolygonColliders are useful for creating convex polygon shapes
|
|
19
|
+
* @param points Points specified in counter clockwise
|
|
20
|
+
* @param offset Optional offset relative to the collider in local coordinates
|
|
21
|
+
*/
|
|
22
|
+
static Polygon(points: Vector[], offset?: Vector, suppressConvexWarning?: boolean): PolygonCollider;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new {@apilink CircleCollider | `circle`} collider
|
|
25
|
+
*
|
|
26
|
+
* Circle colliders are useful for balls, or to make collisions more forgiving on sharp edges
|
|
27
|
+
* @param radius Radius of the circle collider
|
|
28
|
+
* @param offset Optional offset relative to the collider in local coordinates
|
|
29
|
+
*/
|
|
30
|
+
static Circle(radius: number, offset?: Vector): CircleCollider;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new {@apilink EdgeCollider | `edge`} collider
|
|
33
|
+
*
|
|
34
|
+
* Edge colliders are useful for floors, walls, and other barriers
|
|
35
|
+
* @param begin Beginning of the edge in local coordinates to the collider
|
|
36
|
+
* @param end Ending of the edge in local coordinates to the collider
|
|
37
|
+
*/
|
|
38
|
+
static Edge(begin: Vector, end: Vector): EdgeCollider;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new capsule shaped {@apilink CompositeCollider} using 2 circles and a box
|
|
41
|
+
*
|
|
42
|
+
* Capsule colliders are useful for platformers with incline or jagged floors to have a smooth
|
|
43
|
+
* player experience.
|
|
44
|
+
* @param width
|
|
45
|
+
* @param height
|
|
46
|
+
* @param offset Optional offset
|
|
47
|
+
*/
|
|
48
|
+
static Capsule(width: number, height: number, offset?: Vector): CompositeCollider;
|
|
49
|
+
}
|
|
6
50
|
/**
|
|
7
51
|
* Excalibur helper for defining colliders quickly
|
|
52
|
+
* @deprecated use Colliders.*
|
|
8
53
|
*/
|
|
9
54
|
export declare class Shape {
|
|
10
55
|
/**
|
|
@@ -13,6 +58,7 @@ export declare class Shape {
|
|
|
13
58
|
* @param height Height of the box
|
|
14
59
|
* @param anchor Anchor of the box (default (.5, .5)) which positions the box relative to the center of the collider's position
|
|
15
60
|
* @param offset Optional offset relative to the collider in local coordinates
|
|
61
|
+
* @deprecated use Colliders.Box
|
|
16
62
|
*/
|
|
17
63
|
static Box(width: number, height: number, anchor?: Vector, offset?: Vector): PolygonCollider;
|
|
18
64
|
/**
|
|
@@ -21,6 +67,7 @@ export declare class Shape {
|
|
|
21
67
|
* PolygonColliders are useful for creating convex polygon shapes
|
|
22
68
|
* @param points Points specified in counter clockwise
|
|
23
69
|
* @param offset Optional offset relative to the collider in local coordinates
|
|
70
|
+
* @deprecated Use Colliders.Polygon
|
|
24
71
|
*/
|
|
25
72
|
static Polygon(points: Vector[], offset?: Vector, suppressConvexWarning?: boolean): PolygonCollider;
|
|
26
73
|
/**
|
|
@@ -29,6 +76,7 @@ export declare class Shape {
|
|
|
29
76
|
* Circle colliders are useful for balls, or to make collisions more forgiving on sharp edges
|
|
30
77
|
* @param radius Radius of the circle collider
|
|
31
78
|
* @param offset Optional offset relative to the collider in local coordinates
|
|
79
|
+
* @deprecated Use Colliders.Circle
|
|
32
80
|
*/
|
|
33
81
|
static Circle(radius: number, offset?: Vector): CircleCollider;
|
|
34
82
|
/**
|
|
@@ -37,6 +85,7 @@ export declare class Shape {
|
|
|
37
85
|
* Edge colliders are useful for floors, walls, and other barriers
|
|
38
86
|
* @param begin Beginning of the edge in local coordinates to the collider
|
|
39
87
|
* @param end Ending of the edge in local coordinates to the collider
|
|
88
|
+
* @deprecated Use Colliders.Edge
|
|
40
89
|
*/
|
|
41
90
|
static Edge(begin: Vector, end: Vector): EdgeCollider;
|
|
42
91
|
/**
|
|
@@ -47,6 +96,7 @@ export declare class Shape {
|
|
|
47
96
|
* @param width
|
|
48
97
|
* @param height
|
|
49
98
|
* @param offset Optional offset
|
|
99
|
+
* @deprecated Use Colliders.Capsule
|
|
50
100
|
*/
|
|
51
101
|
static Capsule(width: number, height: number, offset?: Vector): CompositeCollider;
|
|
52
102
|
}
|
|
@@ -2,6 +2,7 @@ import { CircleCollider } from './circle-collider';
|
|
|
2
2
|
import { CollisionContact } from '../detection/collision-contact';
|
|
3
3
|
import { PolygonCollider } from './polygon-collider';
|
|
4
4
|
import { EdgeCollider } from './edge-collider';
|
|
5
|
+
import type { SatShape } from './sat-shape';
|
|
5
6
|
import { Vector } from '../../math/vector';
|
|
6
7
|
export declare const CollisionJumpTable: {
|
|
7
8
|
CollideCircleCircle(circleA: CircleCollider, circleB: CircleCollider): CollisionContact[];
|
|
@@ -9,6 +10,6 @@ export declare const CollisionJumpTable: {
|
|
|
9
10
|
CollideCircleEdge(circle: CircleCollider, edge: EdgeCollider): CollisionContact[];
|
|
10
11
|
CollideEdgeEdge(): CollisionContact[];
|
|
11
12
|
CollidePolygonEdge(polygon: PolygonCollider, edge: EdgeCollider): CollisionContact[];
|
|
12
|
-
CollidePolygonPolygon(polyA:
|
|
13
|
+
CollidePolygonPolygon(polyA: SatShape, polyB: SatShape): CollisionContact[];
|
|
13
14
|
FindContactSeparation(contact: CollisionContact, localPoint: Vector): number;
|
|
14
15
|
};
|
|
@@ -7,7 +7,7 @@ import type { Ray } from '../../math/ray';
|
|
|
7
7
|
import type { Color } from '../../color';
|
|
8
8
|
import { Collider } from './collider';
|
|
9
9
|
import type { ExcaliburGraphicsContext } from '../../graphics/context/excalibur-graphics-context';
|
|
10
|
-
import
|
|
10
|
+
import { Transform } from '../../math/transform';
|
|
11
11
|
import type { RayCastHit } from '../detection/ray-cast-hit';
|
|
12
12
|
export interface EdgeColliderOptions {
|
|
13
13
|
/**
|
|
@@ -32,6 +32,30 @@ export declare class EdgeCollider extends Collider {
|
|
|
32
32
|
end: Vector;
|
|
33
33
|
private _transform;
|
|
34
34
|
private _globalMatrix;
|
|
35
|
+
private _syncedVersion;
|
|
36
|
+
private _syncedOffsetX;
|
|
37
|
+
private _syncedOffsetY;
|
|
38
|
+
/**
|
|
39
|
+
* Rebuilds the world matrix from the owner transform if it (or the offset) changed since the last sync
|
|
40
|
+
*/
|
|
41
|
+
private _ensureWorld;
|
|
42
|
+
get worldVersion(): number;
|
|
43
|
+
private _satPoints;
|
|
44
|
+
private _satNormals;
|
|
45
|
+
private _satCacheKey;
|
|
46
|
+
/**
|
|
47
|
+
* The transform from local edge space to world space, offset is baked into {@apilink EdgeCollider.points}
|
|
48
|
+
*/
|
|
49
|
+
get transform(): Transform;
|
|
50
|
+
private _updateSatShape;
|
|
51
|
+
/**
|
|
52
|
+
* The edge as two points in local space (offset applied), ordered begin -> end
|
|
53
|
+
*/
|
|
54
|
+
get points(): readonly Vector[];
|
|
55
|
+
/**
|
|
56
|
+
* Outward normals for the two sides (begin -> end and end -> begin) of the edge in local space
|
|
57
|
+
*/
|
|
58
|
+
get normals(): readonly Vector[];
|
|
35
59
|
constructor(options: EdgeColliderOptions);
|
|
36
60
|
/**
|
|
37
61
|
* Returns a clone of this Edge, not associated with any collider
|
|
@@ -50,6 +50,9 @@ export declare class PolygonCollider extends Collider {
|
|
|
50
50
|
*/
|
|
51
51
|
get points(): Vector[];
|
|
52
52
|
private _transform;
|
|
53
|
+
/**
|
|
54
|
+
* The world transform snapshot, synced with the owner transform on access
|
|
55
|
+
*/
|
|
53
56
|
get transform(): Transform;
|
|
54
57
|
private _transformedPoints;
|
|
55
58
|
private _sides;
|
|
@@ -123,6 +126,17 @@ export declare class PolygonCollider extends Collider {
|
|
|
123
126
|
* @param transform
|
|
124
127
|
*/
|
|
125
128
|
update(transform: Transform): void;
|
|
129
|
+
private _ownerTransform;
|
|
130
|
+
private _syncedVersion;
|
|
131
|
+
private _syncedOffsetX;
|
|
132
|
+
private _syncedOffsetY;
|
|
133
|
+
private _appliedMirrorX;
|
|
134
|
+
private _appliedMirrorY;
|
|
135
|
+
/**
|
|
136
|
+
* Rebuilds the world transform snapshot from the owner transform if anything changed since the last sync
|
|
137
|
+
*/
|
|
138
|
+
private _sync;
|
|
139
|
+
get worldVersion(): number;
|
|
126
140
|
/**
|
|
127
141
|
* Tests if a point is contained in this collider in world space
|
|
128
142
|
*/
|
|
@@ -151,6 +165,15 @@ export declare class PolygonCollider extends Collider {
|
|
|
151
165
|
distance: Vector;
|
|
152
166
|
face: LineSegment;
|
|
153
167
|
};
|
|
168
|
+
/**
|
|
169
|
+
* Get the axis aligned bounding box for the polygon collider in world coordinates
|
|
170
|
+
*/
|
|
171
|
+
private _boundsDirty;
|
|
172
|
+
private _bounds;
|
|
173
|
+
/**
|
|
174
|
+
* World space bounds cached until the collider is updated, internal so callers can't mutate the cache
|
|
175
|
+
*/
|
|
176
|
+
private _getWorldBounds;
|
|
154
177
|
/**
|
|
155
178
|
* Get the axis aligned bounding box for the polygon collider in world coordinates
|
|
156
179
|
*/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Vector } from '../../math/vector';
|
|
2
|
+
import type { Id } from '../../id';
|
|
3
|
+
import type { Transform } from '../../math/transform';
|
|
4
|
+
/**
|
|
5
|
+
* Minimal convex shape description the separating axis test and contact clipping operate on.
|
|
6
|
+
*
|
|
7
|
+
* {@apilink PolygonCollider} and {@apilink EdgeCollider} (as a two-sided, two point "polygon") both satisfy this.
|
|
8
|
+
*/
|
|
9
|
+
export interface SatShape {
|
|
10
|
+
id: Id<'collider'>;
|
|
11
|
+
/**
|
|
12
|
+
* Points in local space (relative to `transform`), in perimeter order
|
|
13
|
+
*/
|
|
14
|
+
points: readonly Vector[];
|
|
15
|
+
/**
|
|
16
|
+
* Outward normal for the side starting at each point, normals[i] belongs to side points[i] -> points[(i + 1) % length]
|
|
17
|
+
*/
|
|
18
|
+
normals: readonly Vector[];
|
|
19
|
+
/**
|
|
20
|
+
* Transform from local space to world space
|
|
21
|
+
*/
|
|
22
|
+
transform: Transform;
|
|
23
|
+
/**
|
|
24
|
+
* Center of the shape in world space
|
|
25
|
+
*/
|
|
26
|
+
center: Vector;
|
|
27
|
+
}
|
|
@@ -3,7 +3,14 @@ import type { Vector } from '../../math/vector';
|
|
|
3
3
|
import type { Collider } from './collider';
|
|
4
4
|
import type { CircleCollider } from './circle-collider';
|
|
5
5
|
import type { PolygonCollider } from './polygon-collider';
|
|
6
|
-
import {
|
|
6
|
+
import { ArenaPool } from '../../util/arena-pool';
|
|
7
|
+
import type { SatShape } from './sat-shape';
|
|
8
|
+
export type { SatShape } from './sat-shape';
|
|
9
|
+
/**
|
|
10
|
+
* Deep copies separation info out of the per frame {@apilink SeparatingAxis.SeparationPool} so it can outlive the frame
|
|
11
|
+
* @param info
|
|
12
|
+
*/
|
|
13
|
+
export declare function cloneSeparationInfo(info: SeparationInfo): SeparationInfo;
|
|
7
14
|
/**
|
|
8
15
|
* Specific information about a contact and it's separation
|
|
9
16
|
*/
|
|
@@ -46,13 +53,11 @@ export declare class SeparationInfo {
|
|
|
46
53
|
localPoint?: Vector;
|
|
47
54
|
}
|
|
48
55
|
export declare class SeparatingAxis {
|
|
49
|
-
static SeparationPool:
|
|
56
|
+
static SeparationPool: ArenaPool<SeparationInfo>;
|
|
50
57
|
private static _ZERO;
|
|
51
|
-
private static _SCRATCH_POINT;
|
|
52
|
-
private static _SCRATCH_SUB_POINT;
|
|
53
|
-
private static _SCRATCH_NORMAL;
|
|
54
58
|
private static _SCRATCH_MATRIX;
|
|
55
|
-
static
|
|
59
|
+
private static _SEPARATION_CACHE;
|
|
60
|
+
static findPolygonPolygonSeparation(polyA: SatShape, polyB: SatShape): SeparationInfo;
|
|
56
61
|
static findCirclePolygonSeparation(circle: CircleCollider, polygon: PolygonCollider): Vector | null;
|
|
57
62
|
static findPolygonPolygonSeparationDegenerate(polyA: PolygonCollider, polyB: PolygonCollider): SeparationInfo;
|
|
58
63
|
}
|
|
@@ -7,12 +7,11 @@ import type { ExcaliburGraphicsContext } from '../graphics/context/excalibur-gra
|
|
|
7
7
|
import type { Scene } from '../scene';
|
|
8
8
|
import type { PhysicsWorld } from './physics-world';
|
|
9
9
|
import { BodyComponent } from './index';
|
|
10
|
-
import { PauseComponent } from '../entity-component-system/components/pause-component';
|
|
11
10
|
export declare class CollisionSystem extends System {
|
|
12
11
|
private _physics;
|
|
13
12
|
static priority: -5;
|
|
14
13
|
systemType: SystemType;
|
|
15
|
-
query: Query<ComponentCtor<TransformComponent> | ComponentCtor<ColliderComponent
|
|
14
|
+
query: Query<ComponentCtor<TransformComponent> | ComponentCtor<ColliderComponent>>;
|
|
16
15
|
bodyQuery: Query<ComponentCtor<BodyComponent>>;
|
|
17
16
|
private _engine;
|
|
18
17
|
private _configDirty;
|
|
@@ -26,9 +25,14 @@ export declare class CollisionSystem extends System {
|
|
|
26
25
|
private _trackCollider;
|
|
27
26
|
private _untrackCollider;
|
|
28
27
|
constructor(world: World, _physics: PhysicsWorld);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
onInitialize(world: World, scene: Scene): void;
|
|
29
|
+
onUpdate(elapsed: number): void;
|
|
30
|
+
onPostUpdate(): void;
|
|
31
|
+
private _recordContacts;
|
|
32
|
+
/**
|
|
33
|
+
* Binds every active collider to its owner transform (a cheap no-op once bound) and returns the flattened list
|
|
34
|
+
*/
|
|
35
|
+
private _updateColliders;
|
|
32
36
|
getSolver(): CollisionSolver;
|
|
33
37
|
debug(ex: ExcaliburGraphicsContext): void;
|
|
34
38
|
runContactStartEnd(): void;
|
|
@@ -46,6 +46,12 @@ export declare class CollisionContact {
|
|
|
46
46
|
info: SeparationInfo;
|
|
47
47
|
bodyA: BodyComponent | null;
|
|
48
48
|
bodyB: BodyComponent | null;
|
|
49
|
+
private _persisted;
|
|
50
|
+
/**
|
|
51
|
+
* Takes ownership of the pooled narrowphase data so this contact can be carried across frames without being
|
|
52
|
+
* detected again, used for contacts between bodies that can't move (asleep, or asleep against fixed geometry)
|
|
53
|
+
*/
|
|
54
|
+
persist(): void;
|
|
49
55
|
constructor(colliderA: Collider, colliderB: Collider, mtv: Vector, normal: Vector, tangent: Vector, points: Vector[], localPoints: Vector[], info: SeparationInfo);
|
|
50
56
|
isCanceled(): boolean;
|
|
51
57
|
cancel(): void;
|
|
@@ -8,18 +8,18 @@ import type { DynamicTreeConfig } from '../physics-config';
|
|
|
8
8
|
* Dynamic Tree Node used for tracking bounds within the tree
|
|
9
9
|
*/
|
|
10
10
|
export declare class TreeNode<T> {
|
|
11
|
-
parent
|
|
12
|
-
left: TreeNode<T
|
|
13
|
-
right: TreeNode<T
|
|
11
|
+
parent: TreeNode<T> | null;
|
|
12
|
+
left: TreeNode<T> | null;
|
|
13
|
+
right: TreeNode<T> | null;
|
|
14
14
|
bounds: BoundingBox;
|
|
15
15
|
height: number;
|
|
16
|
-
data: T;
|
|
17
|
-
constructor(parent?: TreeNode<T>);
|
|
16
|
+
data: T | null;
|
|
17
|
+
constructor(parent?: TreeNode<T> | null);
|
|
18
18
|
isLeaf(): boolean;
|
|
19
19
|
}
|
|
20
20
|
export interface ColliderProxy<T> {
|
|
21
21
|
id: Id<'collider'>;
|
|
22
|
-
owner: T;
|
|
22
|
+
owner: T | null;
|
|
23
23
|
bounds: BoundingBox;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -32,10 +32,8 @@ export interface ColliderProxy<T> {
|
|
|
32
32
|
export declare class DynamicTree<TProxy extends ColliderProxy<Entity>> {
|
|
33
33
|
private _config;
|
|
34
34
|
worldBounds: BoundingBox;
|
|
35
|
-
root: TreeNode<TProxy
|
|
36
|
-
nodes:
|
|
37
|
-
[key: number]: TreeNode<TProxy>;
|
|
38
|
-
};
|
|
35
|
+
root: TreeNode<TProxy> | null;
|
|
36
|
+
nodes: Record<number, TreeNode<TProxy>>;
|
|
39
37
|
constructor(_config: Required<DynamicTreeConfig>, worldBounds?: BoundingBox);
|
|
40
38
|
/**
|
|
41
39
|
* Inserts a node into the dynamic tree
|
|
@@ -81,7 +79,7 @@ export declare class DynamicTree<TProxy extends ColliderProxy<Entity>> {
|
|
|
81
79
|
* callback indicates that your are complete with your query and do not want to continue. Return false will continue searching
|
|
82
80
|
* the tree until all possible bodies that would intersect with the ray have been returned.
|
|
83
81
|
*/
|
|
84
|
-
rayCastQuery(ray: Ray, max: number, callback: (other: TProxy) => boolean): void;
|
|
82
|
+
rayCastQuery(ray: Ray, max: number | undefined, callback: (other: TProxy) => boolean): void;
|
|
85
83
|
getNodes(): TreeNode<TProxy>[];
|
|
86
84
|
debug(ex: ExcaliburGraphicsContext): void;
|
|
87
85
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CollisionContact } from './collision-contact';
|
|
2
|
+
import { BodyComponent } from '../body-component';
|
|
2
3
|
import type { Id } from '../../id';
|
|
3
4
|
import type { Collider } from '../colliders/collider';
|
|
4
5
|
/**
|
|
@@ -15,6 +16,14 @@ export declare class Pair {
|
|
|
15
16
|
* @param colliderB
|
|
16
17
|
*/
|
|
17
18
|
static canCollide(colliderA: Collider, colliderB: Collider): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* A pair is dormant when neither body can move: both are asleep, or one is asleep against a
|
|
21
|
+
* {@apilink CollisionType.Fixed} body. Dormant pairs need no collision detection, the collision system
|
|
22
|
+
* carries their last contact over unchanged until one of them wakes.
|
|
23
|
+
* @param bodyA
|
|
24
|
+
* @param bodyB
|
|
25
|
+
*/
|
|
26
|
+
static isDormant(bodyA: BodyComponent | null | undefined, bodyB: BodyComponent | null | undefined): boolean;
|
|
18
27
|
/**
|
|
19
28
|
* Returns whether or not it is possible for the pairs to collide
|
|
20
29
|
*/
|
|
@@ -14,7 +14,7 @@ export interface QuadTreeOptions {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare class QuadTree<TItem extends QuadTreeItem> {
|
|
16
16
|
bounds: BoundingBox;
|
|
17
|
-
options
|
|
17
|
+
options: QuadTreeOptions;
|
|
18
18
|
private _defaultOptions;
|
|
19
19
|
halfWidth: number;
|
|
20
20
|
halfHeight: number;
|
|
@@ -24,7 +24,7 @@ export declare class QuadTree<TItem extends QuadTreeItem> {
|
|
|
24
24
|
topRight: QuadTree<TItem> | null;
|
|
25
25
|
bottomLeft: QuadTree<TItem> | null;
|
|
26
26
|
bottomRight: QuadTree<TItem> | null;
|
|
27
|
-
constructor(bounds: BoundingBox, options
|
|
27
|
+
constructor(bounds: BoundingBox, options: QuadTreeOptions);
|
|
28
28
|
/**
|
|
29
29
|
* Splits the quad tree one level deeper
|
|
30
30
|
*/
|
package/build/{dist → esm/src/engine}/collision/detection/sparse-hash-grid-collision-processor.d.ts
RENAMED
|
@@ -3,7 +3,7 @@ import type { Entity } from '../../entity-component-system';
|
|
|
3
3
|
import type { ExcaliburGraphicsContext } from '../../graphics/context/excalibur-graphics-context';
|
|
4
4
|
import type { Ray } from '../../math/ray';
|
|
5
5
|
import type { Vector } from '../../math/vector';
|
|
6
|
-
import {
|
|
6
|
+
import { ArenaPool } from '../../util/arena-pool';
|
|
7
7
|
import { BodyComponent } from '../body-component';
|
|
8
8
|
import type { BoundingBox } from '../bounding-box';
|
|
9
9
|
import type { Collider } from '../colliders/collider';
|
|
@@ -49,6 +49,11 @@ export declare class HashColliderProxy extends HashGridProxy<Collider> {
|
|
|
49
49
|
*/
|
|
50
50
|
readonly gridSize: number;
|
|
51
51
|
constructor(collider: Collider, gridSize: number);
|
|
52
|
+
private _lastWorldVersion;
|
|
53
|
+
/**
|
|
54
|
+
* Skips the bounds refresh and cell comparison entirely when the collider's world geometry hasn't changed
|
|
55
|
+
*/
|
|
56
|
+
hasChanged(): boolean;
|
|
52
57
|
/**
|
|
53
58
|
* Updates the hashed bounds coordinates
|
|
54
59
|
*/
|
|
@@ -63,7 +68,7 @@ export declare class SparseHashGridCollisionProcessor implements CollisionProces
|
|
|
63
68
|
readonly hashGrid: SparseHashGrid<Collider, HashColliderProxy>;
|
|
64
69
|
private _pairs;
|
|
65
70
|
private _nonPairs;
|
|
66
|
-
_pairPool:
|
|
71
|
+
_pairPool: ArenaPool<Pair>;
|
|
67
72
|
constructor(options: {
|
|
68
73
|
size: number;
|
|
69
74
|
});
|
|
@@ -32,6 +32,9 @@ export declare class HashGridProxy<T extends {
|
|
|
32
32
|
constructor(object: T, gridSize: number);
|
|
33
33
|
/**
|
|
34
34
|
* Has the hashed bounds changed
|
|
35
|
+
*
|
|
36
|
+
* Refreshes `bounds` as a side effect (via {@apilink updateBounds}) so callers that need the current
|
|
37
|
+
* bounds regardless of the result (see {@apilink SparseHashGrid.update}) don't have to recompute them
|
|
35
38
|
*/
|
|
36
39
|
hasChanged(): boolean;
|
|
37
40
|
/**
|
|
@@ -44,6 +47,8 @@ export declare class HashGridProxy<T extends {
|
|
|
44
47
|
updateBounds(): void;
|
|
45
48
|
/**
|
|
46
49
|
* Updates the hashed bounds coordinates
|
|
50
|
+
*
|
|
51
|
+
* Only called after {@apilink hasChanged} returns true, which has already refreshed `bounds`
|
|
47
52
|
*/
|
|
48
53
|
update(): void;
|
|
49
54
|
}
|
|
@@ -51,17 +56,17 @@ export declare class HashGridCell<TObject extends {
|
|
|
51
56
|
bounds: BoundingBox;
|
|
52
57
|
}, TProxy extends HashGridProxy<TObject> = HashGridProxy<TObject>> {
|
|
53
58
|
proxies: TProxy[];
|
|
54
|
-
key:
|
|
59
|
+
key: number | bigint;
|
|
55
60
|
x: number;
|
|
56
61
|
y: number;
|
|
57
62
|
configure(x: number, y: number): void;
|
|
58
|
-
static calculateHashKey(x: number, y: number):
|
|
63
|
+
static calculateHashKey(x: number, y: number): number | bigint;
|
|
59
64
|
}
|
|
60
65
|
export declare class SparseHashGrid<TObject extends {
|
|
61
66
|
bounds: BoundingBox;
|
|
62
67
|
}, TProxy extends HashGridProxy<TObject> = HashGridProxy<TObject>> {
|
|
63
68
|
readonly gridSize: number;
|
|
64
|
-
readonly sparseHashGrid: Map<
|
|
69
|
+
readonly sparseHashGrid: Map<number | bigint, HashGridCell<TObject, TProxy>>;
|
|
65
70
|
readonly objectToProxy: Map<TObject, TProxy>;
|
|
66
71
|
bounds: BoundingBox;
|
|
67
72
|
private _hashGridCellPool;
|
|
@@ -75,6 +80,9 @@ export declare class SparseHashGrid<TObject extends {
|
|
|
75
80
|
get(xCoord: number, yCoord: number): HashGridCell<TObject>;
|
|
76
81
|
private _insert;
|
|
77
82
|
private _remove;
|
|
83
|
+
/**
|
|
84
|
+
* **WARNING** TObjects must use the same coordPlan on their .bounds to work properly
|
|
85
|
+
*/
|
|
78
86
|
track(target: TObject): void;
|
|
79
87
|
untrack(target: TObject): void;
|
|
80
88
|
update(targets: TObject[]): number;
|
|
@@ -22,7 +22,7 @@ export declare class CollisionGroupManager {
|
|
|
22
22
|
* Get a collision group by it's name
|
|
23
23
|
* @param name
|
|
24
24
|
*/
|
|
25
|
-
static groupByName(name: string): CollisionGroup;
|
|
25
|
+
static groupByName(name: string): CollisionGroup | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* Resets the managers internal group management state
|
|
28
28
|
*/
|
|
@@ -4,7 +4,7 @@ export * from './collision-type';
|
|
|
4
4
|
export * from './solver-strategy';
|
|
5
5
|
export * from './colliders/collider';
|
|
6
6
|
export * from './bounding-box';
|
|
7
|
-
export * from './colliders/
|
|
7
|
+
export * from './colliders/colliders';
|
|
8
8
|
export * from './colliders/collider';
|
|
9
9
|
export * from './colliders/composite-collider';
|
|
10
10
|
export * from './colliders/circle-collider';
|
|
@@ -12,6 +12,7 @@ export * from './colliders/edge-collider';
|
|
|
12
12
|
export * from './colliders/polygon-collider';
|
|
13
13
|
export * from './colliders/collision-jump-table';
|
|
14
14
|
export * from './colliders/closest-line-jump-table';
|
|
15
|
+
export type * from './colliders/sat-shape';
|
|
15
16
|
export * from './colliders/separating-axis';
|
|
16
17
|
export * from './group/collision-group';
|
|
17
18
|
export * from './group/collision-group-manager';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Entity, Query, World } from '../entity-component-system';
|
|
2
2
|
import { MotionComponent } from '../entity-component-system/components/motion-component';
|
|
3
|
-
import { PauseComponent } from '../entity-component-system/components/pause-component';
|
|
4
3
|
import { TransformComponent } from '../entity-component-system/components/transform-component';
|
|
5
4
|
import { System, SystemType } from '../entity-component-system/system';
|
|
6
5
|
import type { PhysicsWorld } from './physics-world';
|
|
@@ -10,9 +9,9 @@ export declare class MotionSystem extends System {
|
|
|
10
9
|
static priority: -5;
|
|
11
10
|
systemType: SystemType;
|
|
12
11
|
private _physicsConfigDirty;
|
|
13
|
-
query: Query<typeof TransformComponent | typeof MotionComponent
|
|
12
|
+
query: Query<typeof TransformComponent | typeof MotionComponent>;
|
|
14
13
|
private _createPhysicsQuery;
|
|
15
14
|
constructor(world: World, physics: PhysicsWorld);
|
|
16
|
-
|
|
15
|
+
onUpdate(elapsed: number): void;
|
|
17
16
|
captureOldTransformWithChildren(entity: Entity): void;
|
|
18
17
|
}
|
|
@@ -213,6 +213,13 @@ export interface PhysicsConfig {
|
|
|
213
213
|
* Default true
|
|
214
214
|
*/
|
|
215
215
|
warmStart?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Largest single position correction allowed per position iteration, in pixels. Prevents large overlaps
|
|
218
|
+
* from causing a single too-large correction (popping)
|
|
219
|
+
*
|
|
220
|
+
* Default -5
|
|
221
|
+
*/
|
|
222
|
+
maxPositionCorrection?: number;
|
|
216
223
|
};
|
|
217
224
|
}
|
|
218
225
|
export type BodyConfig = DeepRequired<Pick<PhysicsConfig, 'bodies'>['bodies']>;
|
|
@@ -7,46 +7,47 @@ import type { Vector } from '../math/vector';
|
|
|
7
7
|
import { SpatialPartitionStrategy } from './detection/spatial-partition-strategy';
|
|
8
8
|
export declare class PhysicsWorld {
|
|
9
9
|
$configUpdate: Observable<Required<{
|
|
10
|
-
enabled?: boolean;
|
|
10
|
+
enabled?: boolean | undefined;
|
|
11
11
|
integration?: Required<{
|
|
12
|
-
onScreenOnly?: boolean;
|
|
13
|
-
}>;
|
|
14
|
-
gravity?: Vector;
|
|
15
|
-
solver?: import("./solver-strategy").SolverStrategy;
|
|
16
|
-
substep?: number;
|
|
12
|
+
onScreenOnly?: boolean | undefined;
|
|
13
|
+
} | undefined>;
|
|
14
|
+
gravity?: Vector | undefined;
|
|
15
|
+
solver?: import("./solver-strategy").SolverStrategy | undefined;
|
|
16
|
+
substep?: number | undefined;
|
|
17
17
|
colliders?: Required<{
|
|
18
|
-
compositeStrategy?: "separate" | "together";
|
|
19
|
-
}>;
|
|
18
|
+
compositeStrategy?: "separate" | "together" | undefined;
|
|
19
|
+
} | undefined>;
|
|
20
20
|
continuous?: Required<{
|
|
21
|
-
checkForFastBodies?: boolean;
|
|
22
|
-
disableMinimumSpeedForFastBody?: boolean;
|
|
23
|
-
surfaceEpsilon?: number;
|
|
24
|
-
}>;
|
|
21
|
+
checkForFastBodies?: boolean | undefined;
|
|
22
|
+
disableMinimumSpeedForFastBody?: boolean | undefined;
|
|
23
|
+
surfaceEpsilon?: number | undefined;
|
|
24
|
+
} | undefined>;
|
|
25
25
|
bodies?: Required<{
|
|
26
|
-
defaultMass?: number;
|
|
27
|
-
sleepEpsilon?: number;
|
|
28
|
-
wakeThreshold?: number;
|
|
29
|
-
sleepBias?: number;
|
|
30
|
-
sleepTimeThreshold?: number;
|
|
31
|
-
canSleepByDefault?: boolean;
|
|
32
|
-
}>;
|
|
33
|
-
spatialPartition?: SpatialPartitionStrategy;
|
|
34
|
-
sparseHashGrid?: import("./physics-config").SparseHashGridConfig;
|
|
26
|
+
defaultMass?: number | undefined;
|
|
27
|
+
sleepEpsilon?: number | undefined;
|
|
28
|
+
wakeThreshold?: number | undefined;
|
|
29
|
+
sleepBias?: number | undefined;
|
|
30
|
+
sleepTimeThreshold?: number | undefined;
|
|
31
|
+
canSleepByDefault?: boolean | undefined;
|
|
32
|
+
} | undefined>;
|
|
33
|
+
spatialPartition?: SpatialPartitionStrategy | undefined;
|
|
34
|
+
sparseHashGrid?: import("./physics-config").SparseHashGridConfig | undefined;
|
|
35
35
|
dynamicTree?: Required<{
|
|
36
|
-
boundsPadding?: number;
|
|
37
|
-
velocityMultiplier?: number;
|
|
38
|
-
}>;
|
|
36
|
+
boundsPadding?: number | undefined;
|
|
37
|
+
velocityMultiplier?: number | undefined;
|
|
38
|
+
} | undefined>;
|
|
39
39
|
arcade?: Required<{
|
|
40
|
-
contactSolveBias?: import("./index").ContactSolveBias;
|
|
41
|
-
}>;
|
|
40
|
+
contactSolveBias?: import("./index").ContactSolveBias | undefined;
|
|
41
|
+
} | undefined>;
|
|
42
42
|
realistic?: Required<{
|
|
43
|
-
contactSolveBias?: import("./index").ContactSolveBias;
|
|
44
|
-
positionIterations?: number;
|
|
45
|
-
velocityIterations?: number;
|
|
46
|
-
slop?: number;
|
|
47
|
-
steeringFactor?: number;
|
|
48
|
-
warmStart?: boolean;
|
|
49
|
-
|
|
43
|
+
contactSolveBias?: import("./index").ContactSolveBias | undefined;
|
|
44
|
+
positionIterations?: number | undefined;
|
|
45
|
+
velocityIterations?: number | undefined;
|
|
46
|
+
slop?: number | undefined;
|
|
47
|
+
steeringFactor?: number | undefined;
|
|
48
|
+
warmStart?: boolean | undefined;
|
|
49
|
+
maxPositionCorrection?: number | undefined;
|
|
50
|
+
} | undefined>;
|
|
50
51
|
}>>;
|
|
51
52
|
private _configDirty;
|
|
52
53
|
private _config;
|