melonjs 20.7.0 → 20.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/build/application/defaultApplicationSettings.d.ts +5 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -1
- package/build/application/header.d.ts.map +1 -1
- package/build/application/settings.d.ts +88 -0
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/backend/engine.d.ts +0 -1
- package/build/audio/backend/sound.d.ts +0 -1
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +95 -8
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/geometries/box3d.d.ts +24 -6
- package/build/geometries/box3d.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +14 -0
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +14 -0
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/geometries/sphere.d.ts +35 -6
- package/build/geometries/sphere.d.ts.map +1 -1
- package/build/index.d.ts +9 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2770 -538
- package/build/index.js.map +4 -4
- package/build/input/pointerevent.d.ts +8 -0
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts +17 -31
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/level/gltf/GLTFScene.d.ts +40 -1
- package/build/level/gltf/GLTFScene.d.ts.map +1 -1
- package/build/level/level.d.ts +35 -0
- package/build/level/level.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +5 -2
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +0 -1
- package/build/level/tiled/TMXTile.d.ts +2 -1
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +7 -4
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +1 -1
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts +5 -0
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts +0 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +6 -5
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +5 -0
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +8 -7
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +5 -0
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +19 -4
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/autodetect.d.ts +0 -4
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
- package/build/loader/loader.d.ts +9 -0
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts +1 -2
- package/build/loader/loadingscreen.d.ts.map +1 -1
- package/build/loader/parsers/shader.d.ts +0 -2
- package/build/math/color.d.ts +27 -4
- package/build/math/color.d.ts.map +1 -1
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +22 -1
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +69 -0
- package/build/particles/settings.d.ts.map +1 -1
- package/build/physics/adapter.d.ts +9 -1
- package/build/physics/adapter.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +3 -2
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/builtin-adapter.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts +0 -1
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/physics/builtin/sat.d.ts +0 -7
- package/build/physics/builtin/sat3d.d.ts +46 -0
- package/build/physics/builtin/sat3d.d.ts.map +1 -1
- package/build/physics/response.d.ts +45 -62
- package/build/physics/response.d.ts.map +1 -1
- package/build/renderable/collectable.d.ts +6 -1
- package/build/renderable/collectable.d.ts.map +1 -1
- package/build/renderable/colorlayer.d.ts +4 -4
- package/build/renderable/colorlayer.d.ts.map +1 -1
- package/build/renderable/container.d.ts +23 -17
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +12 -16
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts +1 -1
- package/build/renderable/groundshadow.d.ts +1 -0
- package/build/renderable/groundshadow.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts +12 -5
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/instanced_mesh.d.ts +2 -9
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +283 -4
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/nineslicesprite.d.ts +3 -13
- package/build/renderable/nineslicesprite.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +90 -27
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +5 -19
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +27 -16
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +13 -3
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts +0 -4
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +5 -3
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/text/textmetrics.d.ts +2 -0
- package/build/renderable/text/textmetrics.d.ts.map +1 -1
- package/build/renderable/trail.d.ts +0 -1
- package/build/renderable/trail.d.ts.map +1 -1
- package/build/renderable/trigger.d.ts +27 -5
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/progressbar.d.ts +194 -0
- package/build/renderable/ui/progressbar.d.ts.map +1 -0
- package/build/renderable/ui/uibaseelement.d.ts +48 -3
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
- package/build/renderable/ui/uispriteelement.d.ts +19 -3
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/system/legacy_pool.d.ts +2 -2
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/system/pool.d.ts +10 -0
- package/build/system/pool.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +49 -2
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +34 -23
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/effects/blendEffect.d.ts +0 -1
- package/build/video/effects/bloom.d.ts +72 -0
- package/build/video/effects/bloom.d.ts.map +1 -0
- package/build/video/effects/blur.d.ts +3 -2
- package/build/video/effects/blur.d.ts.map +1 -1
- package/build/video/effects/chromaticAberration.d.ts +3 -2
- package/build/video/effects/chromaticAberration.d.ts.map +1 -1
- package/build/video/effects/colorMatrix.d.ts +3 -2
- package/build/video/effects/colorMatrix.d.ts.map +1 -1
- package/build/video/effects/desaturate.d.ts +10 -2
- package/build/video/effects/desaturate.d.ts.map +1 -1
- package/build/video/effects/dissolve.d.ts +3 -2
- package/build/video/effects/dissolve.d.ts.map +1 -1
- package/build/video/effects/dropShadow.d.ts +3 -2
- package/build/video/effects/dropShadow.d.ts.map +1 -1
- package/build/video/effects/flash.d.ts +3 -2
- package/build/video/effects/flash.d.ts.map +1 -1
- package/build/video/effects/glow.d.ts +3 -2
- package/build/video/effects/glow.d.ts.map +1 -1
- package/build/video/effects/hologram.d.ts +3 -2
- package/build/video/effects/hologram.d.ts.map +1 -1
- package/build/video/effects/invert.d.ts +10 -2
- package/build/video/effects/invert.d.ts.map +1 -1
- package/build/video/effects/outline.d.ts +3 -2
- package/build/video/effects/outline.d.ts.map +1 -1
- package/build/video/effects/pixelate.d.ts +3 -2
- package/build/video/effects/pixelate.d.ts.map +1 -1
- package/build/video/effects/radialGradient.d.ts +8 -3
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/scanline.d.ts +3 -2
- package/build/video/effects/scanline.d.ts.map +1 -1
- package/build/video/effects/sepia.d.ts +10 -2
- package/build/video/effects/sepia.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +10 -4
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/shine.d.ts +3 -2
- package/build/video/effects/shine.d.ts.map +1 -1
- package/build/video/effects/tintPulse.d.ts +3 -2
- package/build/video/effects/tintPulse.d.ts.map +1 -1
- package/build/video/effects/tonemap.d.ts +121 -0
- package/build/video/effects/tonemap.d.ts.map +1 -0
- package/build/video/effects/vignette.d.ts +3 -2
- package/build/video/effects/vignette.d.ts.map +1 -1
- package/build/video/effects/wave.d.ts +3 -2
- package/build/video/effects/wave.d.ts.map +1 -1
- package/build/video/gpu/vertexformat.d.ts +26 -0
- package/build/video/gpu/vertexformat.d.ts.map +1 -1
- package/build/video/gradient.d.ts +0 -1
- package/build/video/gradient.d.ts.map +1 -1
- package/build/video/renderer.d.ts +111 -7
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +2 -0
- package/build/video/renderstate.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +3 -4
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +0 -1
- package/build/video/rendertarget/webglrendertarget.d.ts +0 -1
- package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webgpurendertarget.d.ts +18 -2
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +1 -0
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +1 -3
- package/build/video/texture/frametexture.d.ts +0 -1
- package/build/video/texture/frametexture.d.ts.map +1 -1
- package/build/video/texture/noise_texture2d.d.ts +1 -0
- package/build/video/texture/noise_texture2d.d.ts.map +1 -1
- package/build/video/utils/autodetect.d.ts +0 -2
- package/build/video/webgl/batchers/batcher.d.ts +0 -9
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts +11 -0
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts +4 -2
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/mesh_batcher.d.ts +0 -3
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts +4 -0
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +0 -1
- package/build/video/webgl/buffer/retained_geometry.d.ts +0 -1
- package/build/video/webgl/glshader.d.ts +5 -3
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +0 -4
- package/build/video/webgl/texture/store.d.ts +0 -1
- package/build/video/webgl/webgl_renderer.d.ts +63 -24
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/mesh_batcher.d.ts +0 -3
- package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -2
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/webgpu_batcher.d.ts +0 -2
- package/build/video/webgpu/batchers/webgpu_batcher.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +0 -2
- package/build/video/webgpu/texture/frametexture.d.ts +0 -2
- package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
- package/build/video/webgpu/texture/store.d.ts +0 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +7 -75
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/melonjs-3d/SKILL.md +277 -19
- package/skills/melonjs-3d-assets/SKILL.md +76 -9
- package/skills/melonjs-camera-and-drawing/SKILL.md +57 -1
- package/skills/melonjs-effects-and-shaders/SKILL.md +341 -29
- package/skills/melonjs-input/SKILL.md +48 -4
- package/skills/melonjs-particles-and-trails/SKILL.md +106 -4
- package/skills/melonjs-performance/SKILL.md +79 -2
- package/skills/melonjs-physics/SKILL.md +101 -27
- package/skills/melonjs-renderables/SKILL.md +2 -1
- package/skills/melonjs-scenes-and-state/SKILL.md +121 -1
- package/skills/melonjs-ui-and-text/SKILL.md +165 -4
- package/build/level/gltf/srgb.d.ts +0 -20
- package/build/level/gltf/srgb.d.ts.map +0 -1
package/build/math/color.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A color manipulation object.
|
|
3
|
-
* @category Math
|
|
4
|
-
*/
|
|
5
1
|
export declare class Color {
|
|
6
2
|
private normalizedRGBA;
|
|
7
3
|
/**
|
|
@@ -70,6 +66,33 @@ export declare class Color {
|
|
|
70
66
|
* @returns Reference to this object for method chaining.
|
|
71
67
|
*/
|
|
72
68
|
setFloat(r: number, g: number, b: number, alpha?: number): this;
|
|
69
|
+
/**
|
|
70
|
+
* Sets the color from LINEAR values, encoding them to sRGB.
|
|
71
|
+
*
|
|
72
|
+
* The sibling of {@link Color#setFloat}, which takes the same `0..1` range
|
|
73
|
+
* but treats it as already-sRGB. Which one you want depends entirely on
|
|
74
|
+
* where the numbers came from, and the two are NOT interchangeable: a
|
|
75
|
+
* linear `0.42` is sRGB `0.68`, not `0.42`.
|
|
76
|
+
*
|
|
77
|
+
* Reach for this whenever a value arrives from a renderer's own colour
|
|
78
|
+
* space rather than from a CSS string or an image. The common case is
|
|
79
|
+
* glTF, which defines `baseColorFactor` and `emissiveFactor` as linear
|
|
80
|
+
* (spec 3.9.2) — handing those straight to `setFloat` or scaling them by
|
|
81
|
+
* 255 into `setColor` renders every untextured material markedly too
|
|
82
|
+
* DARK, by 60 to 70 counts per channel in the midtones. It is an easy
|
|
83
|
+
* mistake to leave in, because the result still looks coherent, just
|
|
84
|
+
* moody, so lighting gets tuned against the wrong values.
|
|
85
|
+
* @param r - The red component [0.0 .. 1.0], linear.
|
|
86
|
+
* @param g - The green component [0.0 .. 1.0], linear.
|
|
87
|
+
* @param b - The blue component [0.0 .. 1.0], linear.
|
|
88
|
+
* @param [alpha=1.0] - The alpha value [0.0 .. 1.0]. Alpha is NOT a colour
|
|
89
|
+
* and carries no transfer function, so it is taken as-is.
|
|
90
|
+
* @returns Reference to this object for method chaining.
|
|
91
|
+
* @example
|
|
92
|
+
* // a glTF material factor, which the spec defines as linear
|
|
93
|
+
* mesh.tint.setLinear(...node.baseColorFactor);
|
|
94
|
+
*/
|
|
95
|
+
setLinear(r: number, g: number, b: number, alpha?: number): this;
|
|
73
96
|
/**
|
|
74
97
|
* Sets the color to the specified HSV values.
|
|
75
98
|
* @param h - The hue [0 .. 1].
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/math/color.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/math/color.ts"],"names":[],"mappings":"AAuOA,qBAAa,KAAK;IACjB,OAAO,CAAC,cAAc,CAAe;IAErC;;;;;;OAMG;gBACS,CAAC,GAAE,KAAK,GAAG,MAAM,GAAG,MAAU,EAAE,CAAC,SAAI,EAAE,CAAC,SAAI,EAAE,KAAK,SAAM;IAcrE;;;OAGG;IACH,IAAI,CAAC,WAEJ;IAED;;;OAGG;IACH,IAAI,CAAC,CAAC,KAAK,QAAA,EAEV;IAED;;;OA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,KAAK,EAAE,KAAK,EAAE,MAAM;IAYhC;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM;IAqBrB;;;;;OAKG;IACH,MAAM,CAAC,GAAG,SAAI,EAAE,GAAG,SAAM;IAgBzB;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,KAAK;IASnB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAQzB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAazB;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,IAAI,MAAM,EAAE,EAAE,IAAI,UAAQ;IAmD7C;;;;OAIG;IACH,QAAQ,CAAC,KAAK,SAAM;IAgBpB;;;OAGG;IACH,OAAO;IAIP;;;OAGG;IACH,KAAK;IAKL;;;;OAIG;IACH,MAAM,CAAC,KAAK,SAAyB;IAKrC;;;OAGG;IACH,KAAK;IAIL;;;;OAIG;IACH,MAAM,CAAC,KAAK,SAAa;CAGzB;AAED,eAAO,MAAM,SAAS,gKAwBpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/particles/emitter.ts"],"names":[],"mappings":"AAGA,OAAO,SAAS,MAAM,8BAA8B,CAAC;AAMrD,OAA+B,EAC9B,KAAK,uBAAuB,EAC5B,MAAM,eAAe,CAAC;AA+DvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAS;;IACrD;;OAEG;IACH,QAAQ,EAAE,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/particles/emitter.ts"],"names":[],"mappings":"AAGA,OAAO,SAAS,MAAM,8BAA8B,CAAC;AAMrD,OAA+B,EAC9B,KAAK,uBAAuB,EAC5B,MAAM,eAAe,CAAC;AA+DvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAS;;IACrD;;OAEG;IACH,QAAQ,EAAE,uBAAuB,CAAC;IA4HlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;gBAEF,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,GAAE,OAAO,CAAC,uBAAuB,CAAM;IAwCvC,KAAK,CAAC,QAAQ,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAAG,IAAI;IAqDrE;;;;;;;;;;;OAWG;IACH,IAAI,cAAc,IAAI,OAAO,GAAG,OAAO,GAAG,SAAS,CAElD;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,EAQtD;IAyHD;;;OAGG;IACH,eAAe,IAAI,MAAM;IAIzB;;;OAGG;IACH,eAAe,IAAI,MAAM;IAuEzB;;;OAGG;IACH,SAAS,IAAI,OAAO;IAIpB;;;OAGG;IACH,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAQxC;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;;OAGG;IACH,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;CAqLpC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Vector2d } from "../math/vector2d.ts";
|
|
2
|
+
import type { Bounds } from "../physics/bounds.ts";
|
|
2
3
|
import Renderable from "../renderable/renderable.js";
|
|
3
4
|
import ParticleEmitter from "./emitter.ts";
|
|
4
5
|
/**
|
|
@@ -7,7 +8,27 @@ import ParticleEmitter from "./emitter.ts";
|
|
|
7
8
|
*/
|
|
8
9
|
export default class Particle extends Renderable {
|
|
9
10
|
#private;
|
|
11
|
+
/**
|
|
12
|
+
* Launch velocity.
|
|
13
|
+
*
|
|
14
|
+
* `x` and `y` are the emitter's plane. `z` is only ever non-zero when the
|
|
15
|
+
* emitter was given an {@link ParticleEmitterSettings.elevation}, and the
|
|
16
|
+
* integration below skips it entirely when it is not: a 2D emitter runs
|
|
17
|
+
* exactly the path it ran before, rather than the 3D path with a zero in
|
|
18
|
+
* it.
|
|
19
|
+
*/
|
|
10
20
|
vel: Vector2d;
|
|
21
|
+
/**
|
|
22
|
+
* Velocity along Z, kept beside `vel` rather than in it.
|
|
23
|
+
*
|
|
24
|
+
* `vel` is pooled as a `Vector2d` and every existing effect reads it as
|
|
25
|
+
* one; widening the pooled type would make every 2D emitter carry a third
|
|
26
|
+
* component it never uses. A separate number costs one double per particle
|
|
27
|
+
* and leaves the 2D path untouched.
|
|
28
|
+
*/
|
|
29
|
+
velZ: number;
|
|
30
|
+
/** whether this particle has any Z motion at all; see {@link Particle#velZ} */
|
|
31
|
+
moves3d: boolean;
|
|
11
32
|
image: HTMLCanvasElement | HTMLImageElement;
|
|
12
33
|
life: number;
|
|
13
34
|
startLife: number;
|
|
@@ -22,7 +43,7 @@ export default class Particle extends Renderable {
|
|
|
22
43
|
* @param emitter - the particle emitter
|
|
23
44
|
*/
|
|
24
45
|
constructor(emitter: ParticleEmitter);
|
|
25
|
-
updateBounds(absolute?: boolean):
|
|
46
|
+
updateBounds(absolute?: boolean): Bounds;
|
|
26
47
|
}
|
|
27
48
|
export declare const particlePool: import("../system/pool.ts").Pool<Particle, [emitter: ParticleEmitter]>;
|
|
28
49
|
//# sourceMappingURL=particle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"particle.d.ts","sourceRoot":"","sources":["../../src/particles/particle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"particle.d.ts","sourceRoot":"","sources":["../../src/particles/particle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,UAAU,MAAM,6BAA6B,CAAC;AAIrD,OAAO,eAAe,MAAM,cAAc,CAAC;AAU3C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;;IAC/C;;;;;;;;OAQG;IACH,GAAG,EAAE,QAAQ,CAAC;IACd;;;;;;;OAOG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IAqBxB,KAAK,EAAE,OAAO,CAAC;IAEf;;OAEG;gBACS,OAAO,EAAE,eAAe;IAqb3B,YAAY,CAAC,QAAQ,UAAO;CA0GrC;AAED,eAAO,MAAM,YAAY,wEAWxB,CAAC"}
|
|
@@ -44,6 +44,10 @@ export interface ParticleEmitterSettings {
|
|
|
44
44
|
totalParticles: number;
|
|
45
45
|
/**
|
|
46
46
|
* Start angle for particle launch in Radians.
|
|
47
|
+
*
|
|
48
|
+
* This is the AZIMUTH: the direction within the emitter's XY plane. With
|
|
49
|
+
* {@link ParticleEmitterSettings.elevation} left at its default of `0`
|
|
50
|
+
* every particle stays in that plane, which is how all 2D emitters behave.
|
|
47
51
|
* @default Math.PI / 2
|
|
48
52
|
*/
|
|
49
53
|
angle: number;
|
|
@@ -52,6 +56,71 @@ export interface ParticleEmitterSettings {
|
|
|
52
56
|
* @default 0
|
|
53
57
|
*/
|
|
54
58
|
angleVariation: number;
|
|
59
|
+
/**
|
|
60
|
+
* Launch angle OUT of the emitter's plane, in radians.
|
|
61
|
+
*
|
|
62
|
+
* `0` fires along the plane, `Math.PI / 2` straight toward the viewer,
|
|
63
|
+
* `-Math.PI / 2` straight away. Combined with
|
|
64
|
+
* {@link ParticleEmitterSettings.elevationVariation} this is what turns a
|
|
65
|
+
* burst from a flat disc facing the camera into a sphere: without it a
|
|
66
|
+
* particle keeps the depth it was born at for its whole life, so no effect
|
|
67
|
+
* can expand along Z or trail away.
|
|
68
|
+
*
|
|
69
|
+
* Zero by default, and zero is not merely a value: an emitter with no
|
|
70
|
+
* elevation and no variation takes the same two trig call launch path it
|
|
71
|
+
* always did and never touches a Z component, so no existing effect pays
|
|
72
|
+
* anything for this.
|
|
73
|
+
* @default 0
|
|
74
|
+
* @example
|
|
75
|
+
* // a spherical burst rather than a disc
|
|
76
|
+
* new ParticleEmitter(x, y, {
|
|
77
|
+
* angle: 0, angleVariation: Math.PI * 2,
|
|
78
|
+
* elevation: 0, elevationVariation: Math.PI / 2,
|
|
79
|
+
* });
|
|
80
|
+
*/
|
|
81
|
+
elevation: number;
|
|
82
|
+
/**
|
|
83
|
+
* Variation in the launch elevation, in radians.
|
|
84
|
+
*
|
|
85
|
+
* `Math.PI / 2` with an `elevation` of `0` spreads particles over the
|
|
86
|
+
* whole sphere; a small value gives a cone around the azimuth.
|
|
87
|
+
* @default 0
|
|
88
|
+
*/
|
|
89
|
+
elevationVariation: number;
|
|
90
|
+
/**
|
|
91
|
+
* Narrowest angle off the launch axis a particle may be thrown, in radians.
|
|
92
|
+
*
|
|
93
|
+
* Together with {@link ParticleEmitterSettings.maxSpread} this selects a
|
|
94
|
+
* different way of aiming. Normally `angleVariation` and
|
|
95
|
+
* `elevationVariation` are sampled INDEPENDENTLY, which spreads particles
|
|
96
|
+
* over a rectangle of azimuth x elevation. That cannot describe a shape
|
|
97
|
+
* defined relative to a direction: a ring of debris leaving a point on a
|
|
98
|
+
* sphere is the set of directions at 90 degrees to that point's normal,
|
|
99
|
+
* and on a rectangle the required elevation is a function of the azimuth
|
|
100
|
+
* rather than independent of it.
|
|
101
|
+
*
|
|
102
|
+
* So when `maxSpread` is greater than zero, {@link
|
|
103
|
+
* ParticleEmitterSettings.angle} and {@link
|
|
104
|
+
* ParticleEmitterSettings.elevation} stop being a rectangle's centre and
|
|
105
|
+
* become an AXIS, and each particle is thrown at a polar angle between
|
|
106
|
+
* `minSpread` and `maxSpread` from it, around a uniformly random azimuth.
|
|
107
|
+
* `angleVariation` and `elevationVariation` are then unused.
|
|
108
|
+
*
|
|
109
|
+
* - `0` to `0.5` is a tight cone along the axis
|
|
110
|
+
* - either value at `Math.PI / 2` is a flat disc perpendicular to it
|
|
111
|
+
* - `0` to `Math.PI` is the whole sphere
|
|
112
|
+
* @default 0
|
|
113
|
+
*/
|
|
114
|
+
minSpread: number;
|
|
115
|
+
/**
|
|
116
|
+
* Widest angle off the launch axis a particle may be thrown, in radians.
|
|
117
|
+
*
|
|
118
|
+
* Zero, the default, leaves the emitter on the independent
|
|
119
|
+
* azimuth/elevation path it has always used. See {@link
|
|
120
|
+
* ParticleEmitterSettings.minSpread} for what a non-zero value switches to.
|
|
121
|
+
* @default 0
|
|
122
|
+
*/
|
|
123
|
+
maxSpread: number;
|
|
55
124
|
/**
|
|
56
125
|
* Minimum time each particle lives once it is emitted in ms.
|
|
57
126
|
* If greater than `maxLife`, it is clamped to `maxLife` at reset.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/particles/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAExD;;;;;OA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;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;;OAUG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;OAKG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IAE9C;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;;;;;;;;OAWG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;;;;;OAMG;IACH,qBAAqB,EAAE,OAAO,CAAC;IAE/B;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC1D;AAED;;;GAGG;AACH,QAAA,MAAM,8BAA8B,EAAE,uBAsCrC,CAAC;AAEF,eAAe,8BAA8B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Box3d } from "../geometries/box3d.ts";
|
|
1
2
|
import type { Ellipse } from "../geometries/ellipse.ts";
|
|
2
3
|
import type { Polygon } from "../geometries/polygon.ts";
|
|
3
4
|
import type { Rect } from "../geometries/rectangle.ts";
|
|
@@ -25,8 +26,15 @@ export type BodyType = "static" | "dynamic" | "kinematic";
|
|
|
25
26
|
* them onto per-fixture filters, which Box2D provides natively). The matter
|
|
26
27
|
* adapter does NOT — its `collisionFilter` and `isSensor` belong to a body, not
|
|
27
28
|
* to the parts it is built from, so per-shape values are ignored there.
|
|
29
|
+
*
|
|
30
|
+
* **The two 3D shapes are builtin-only.** `Box3d` and `Sphere` exist because
|
|
31
|
+
* the builtin solver resolves along Z; the matter and planck adapters are 2D
|
|
32
|
+
* engines with no depth to resolve and THROW when handed either one. They are
|
|
33
|
+
* in this union because a body definition is otherwise portable and these are
|
|
34
|
+
* body shapes, not because every adapter accepts them: a game that wants to
|
|
35
|
+
* stay adapter-portable builds its bodies from the planar three.
|
|
28
36
|
*/
|
|
29
|
-
export type BodyShape = Rect | Ellipse | Polygon;
|
|
37
|
+
export type BodyShape = Rect | Ellipse | Polygon | Box3d | Sphere;
|
|
30
38
|
/**
|
|
31
39
|
* One overlapping SHAPE pair, passed to the shape-level collision lifecycle
|
|
32
40
|
* hooks (`onShapeCollisionStart`, `onShapeCollisionActive`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/physics/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAA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E,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAE5D;;;;;;OAMG;IACH,UAAU,CAAC,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC;IAE7C;;;;;;;;;;OAUG;IACH,OAAO,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,IAAI,CAAC;IAC1D;;;;;;OAMG;IACH,SAAS,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC;IAC9D,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,EAAE,CAAC;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACH,WAAW,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,CAAC;IAC7D,WAAW,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,CAAC;IAE3C;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAErE;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,SAAS,EAAE,CAAC;CAC5D"}
|
|
@@ -202,8 +202,9 @@ export default class Body {
|
|
|
202
202
|
*/
|
|
203
203
|
public maxVelZ: number;
|
|
204
204
|
/**
|
|
205
|
-
* `true` when at least one of this body's shapes
|
|
206
|
-
*
|
|
205
|
+
* `true` when at least one of this body's shapes has a depth extent
|
|
206
|
+
* and can therefore be resolved along z: a {@link Box3d} or a
|
|
207
|
+
* {@link Sphere}.
|
|
207
208
|
* Maintained by {@link Body#addShape} / {@link Body#removeShape}.
|
|
208
209
|
* @readonly
|
|
209
210
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/body.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/body.js"],"names":[],"mappings":"AA+CA;;;;GAIG;AACH;IACC;;;;OAIG;IACH,sBAJW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,WAClD,IAAI,GAAC,IAAI,EAAE,GAAC,OAAO,GAAC,OAAO,EAAE,GAAC,IAAI,GAAC,IAAI,EAAE,GAAC,OAAO,GAAC,OAAO,EAAE,GAAC,KAAK,GAAC,KAAK,EAAE,GAAC,MAAM,GAAC,MAAM,EAAE,GAAC,MAAM,2BAiZ1G;IA7YA;;;;;;OAMG;IACH,iBAHU,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,CAGpC;IAGvB;;;;OAIG;IACH,eAFU,MAAM,CAEc;IAI9B;;;;;;;;;OASG;IACH,QAFU,CAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,KAAK,CAAC,EAAE,CAExB;IAGjB;;;;;;;;OAQG;IACH,eAJU,MAAM,CAI+B;IAE/C;;;;;;;;;OASG;IACH,sBAPU,MAAM,CAOiC;IAGhD;;;;;;;OAOG;IACH,YAHU,QAAQ,CAGW;IAK7B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,cAlBU,QAAQ,CAkBa;IAK/B;;;;;OAKG;IACH,iBAHU,QAAQ,CAGgB;IAInC;;;;;;OAMG;IACH,eAHU,MAAM,CAGD;IAEf;;;;;OAKG;IACH,aAHU,MAAM,CAGH;IAEb;;;;;;;;;;;;;OAaG;IACH,cANU,MAAM,CAMF;IAEd;;;;;;;;;;OAUG;IACH,wBANU,MAAM,CAMQ;IAExB;;;;;;;;;;;;;;;OAeG;IACH,oBAPU,MAAM,CAOI;IAEpB;;;;;;;;;;;;;;;OAeG;IACH,sBAPU,MAAM,CAOM;IAEtB;;;;;;;;;;;;;;;;;;;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AAM,QAQhB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,MACN,MAAM,MACN,MAAM,QAQhB;IAED;;;;;;;;;;;OAWG;IACH,oBAFa,OAAO,CA4FnB;IAED;;;;OAIG;IACH,gBAqFC;CACD;4BAzkD0B,gCAAgC;2BADjC,+BAA+B;wBADlC,mCAAmC;wBAGnC,4BAA4B;iCACnB,qCAAqC;uBAtBlC,cAAc;wBATZ,6BAA6B;qBAFnC,0BAA0B;wBADpB,6BAA6B;sBAEjC,2BAA2B;yBAOrB,wBAAwB;qBAL1C,+BAA+B;sBALnB,2BAA2B;gCAqC7B,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-adapter.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/builtin-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EACX,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,SAAS,EACT,cAAc,EACd,UAAU,EACV,YAAY,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"builtin-adapter.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/builtin-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAA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E,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAKhE,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAI5D,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAI5D,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI;IAS1D,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAoBpE,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,SAAS,EAAE;IA0C3D,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;IAQ3C,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,IAAI;IAaxD,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI;IA0J5D,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE;IAC3D,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE;IA+CzC,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,EAAE;IA0BnC,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;CAa9B"}
|
|
@@ -36,5 +36,4 @@ import type Renderable from "../../renderable/renderable.js";
|
|
|
36
36
|
import type Entity from "../../renderable/entity/entity.js";
|
|
37
37
|
import type Sprite from "../../renderable/sprite.js";
|
|
38
38
|
import type NineSliceSprite from "../../renderable/nineslicesprite.js";
|
|
39
|
-
import type { Line } from "../../geometries/line.ts";
|
|
40
39
|
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/detector.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/detector.js"],"names":[],"mappings":";AA+GA;;GAEG;AACH;IACC;;OAEG;IACH,mBAFW,SAAS,EAkLnB;IA9KA,iBAAkB;IAElB;;;;OAIG;IACH,UAFU,cAAc,CAEY;IAEpC;;;;;;;;OAQG;IACH,mCAA8C;IAE9C;;;;;;OAMG;IACH,2BAA4B;IAC5B;;;;;OAKG;IACH,yBAA0B;IAC1B;;;;;;;;;;;;;;;OAeG;IACH;;;;;;;;;;;;;;;;;;;;;;;QAyCC;IAED;;;;;;;OAOG;IACH,gCAAiC;IACjC;;;OAGG;IACH,8BAA+B;IAE/B;;;;;;;OAOG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;QAmCC;IAED;;;;;;OAMG;IACH,+EAAuB;IACvB;;;OAGG;IACH,iBAAuB;IACvB;;;OAGG;IACH,uGAEC;IAGF;;;;;;;;;OASG;IACH;;;;;;;;;;;;;;;;;;;;;;;MA0CC;IAED;;;;;;OAMG;IACH,mBAGC;IAED;;;;;;;OAOG;IACH,iBA0DC;IAED;;;;;;OAMG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;MAsBC;IAED;;;;;;OAMG;IACH,4CAOC;IAED;;;;;;;;;;;;;;OAcG;IACH,yEAFa,OAAO,CAuBnB;IAED;;;;;;;;;;;;;;OAcG;IACH,2EAqBC;IAED;;;;;;;;;OASG;IACH,sCAMC;IAED;;;;;;OAMG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;MA2CC;IAED;;;;;OAKG;IACH,oFAyCC;IAED;;;;;;;;;OASG;IACH,yBAGC;IAED;;;;;;;;;;;;;OAaG;IACH,uEAFa,OAAO,CAanB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,uBAHW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,QAClD,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,QA2H5D;IAED;;;;;;OAMG;IACH,iBAJW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,KAClD,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CAiBnB;IAED;;;;;OAKG;IACH,gBAJW,IAAI,SACJ,IAAI,qDACF,OAAO,CA0InB;IAED;;;;;;OAMG;IACH,iBAHW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CA8LnB;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,cArBW,IAAI,WACJ,KAAK,CAAE,UAAU,CAAC,GAChB,KAAK,CAAE,UAAU,CAAC,CAqC9B;CACD;2BAzpCyB,+BAA+B;2BAnG9B,gBAAgB;4BAoGhB,gCAAgC;wBAFpC,mCAAmC;wBAGnC,4BAA4B;iCACnB,qCAAqC;0BAC9C,0BAA0B"}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import type Renderable from "../../renderable/renderable.js";
|
|
3
|
-
import type Container from "../../renderable/container.js";
|
|
4
|
-
import type Entity from "../../renderable/entity/entity.js";
|
|
5
|
-
import type Sprite from "../../renderable/sprite.js";
|
|
6
|
-
import type NineSliceSprite from "../../renderable/nineslicesprite.js";
|
|
7
|
-
import type { Polygon } from "../../geometries/polygon.ts";
|
|
8
|
-
import type { Ellipse } from "../../geometries/ellipse.ts";
|
|
9
2
|
//# sourceMappingURL=sat.d.ts.map
|
|
@@ -1,4 +1,50 @@
|
|
|
1
1
|
|
|
2
|
+
/**
|
|
3
|
+
* Check whether two {@link Sphere} shapes collide.
|
|
4
|
+
*
|
|
5
|
+
* The simplest test there is — centres closer than the sum of the radii —
|
|
6
|
+
* and the only 3D shape that needs no orientation, which is why it is the
|
|
7
|
+
* one to reach for when the things being tested tumble or sit on a curved
|
|
8
|
+
* surface.
|
|
9
|
+
* @param {Renderable} a - a reference to the object A.
|
|
10
|
+
* @param {Sphere} sphereA - a reference to the object A Sphere to be tested
|
|
11
|
+
* @param {Renderable} b - a reference to the object B.
|
|
12
|
+
* @param {Sphere} sphereB - a reference to the object B Sphere to be tested
|
|
13
|
+
* @param {object} [response] - Response object that will be populated if they intersect.
|
|
14
|
+
* @returns {boolean} true if they intersect, false if they don't.
|
|
15
|
+
*/
|
|
16
|
+
export function testSphereSphere(a: Renderable, sphereA: Sphere, b: Renderable, sphereB: Sphere, response?: object): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Check whether a {@link Sphere} collides with a {@link Box3d}.
|
|
19
|
+
*
|
|
20
|
+
* Against the closest point on the box, which is the centre clamped to the
|
|
21
|
+
* box's extents. That point is the centre itself when the sphere is INSIDE
|
|
22
|
+
* the box, leaving no direction to separate along, so that case falls back
|
|
23
|
+
* to the least-penetrated face, which is the rule {@link testBox3dBox3d}
|
|
24
|
+
* uses throughout, down to resolving an exact tie X → Y → Z.
|
|
25
|
+
* @param {Renderable} a - a reference to the object A.
|
|
26
|
+
* @param {Sphere} sphereA - a reference to the object A Sphere to be tested
|
|
27
|
+
* @param {Renderable} b - a reference to the object B.
|
|
28
|
+
* @param {Box3d} boxB - a reference to the object B Box3d to be tested
|
|
29
|
+
* @param {object} [response] - Response object that will be populated if they intersect.
|
|
30
|
+
* @returns {boolean} true if they intersect, false if they don't.
|
|
31
|
+
*/
|
|
32
|
+
export function testSphereBox3d(a: Renderable, sphereA: Sphere, b: Renderable, boxB: Box3d, response?: object): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Box-first form of {@link testSphereBox3d}.
|
|
35
|
+
*
|
|
36
|
+
* The response is written from the SPHERE's point of view by the call it
|
|
37
|
+
* delegates to, so the normal is flipped back afterwards — the same shape
|
|
38
|
+
* the planar pairs use for their mirrored entries.
|
|
39
|
+
* @param {Renderable} a - a reference to the object A.
|
|
40
|
+
* @param {Box3d} boxA - a reference to the object A Box3d to be tested
|
|
41
|
+
* @param {Renderable} b - a reference to the object B.
|
|
42
|
+
* @param {Sphere} sphereB - a reference to the object B Sphere to be tested
|
|
43
|
+
* @param {object} [response] - Response object that will be populated if they intersect.
|
|
44
|
+
* @returns {boolean} true if they intersect, false if they don't.
|
|
45
|
+
*/
|
|
46
|
+
export function testBox3dSphere(a: Renderable, boxA: Box3d, b: Renderable, sphereB: Sphere, response?: object): boolean;
|
|
2
47
|
import type Renderable from "../../renderable/renderable.js";
|
|
3
48
|
import type { Box3d } from "../../geometries/box3d.ts";
|
|
49
|
+
import type { Sphere } from "../../geometries/sphere.ts";
|
|
4
50
|
//# sourceMappingURL=sat3d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sat3d.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/sat3d.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sat3d.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/sat3d.js"],"names":[],"mappings":"AA0DA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,kCAPW,UAAU,QACV,KAAK,KACL,UAAU,QACV,KAAK,aACL,MAAM,GACJ,OAAO,CA+EnB;AAyBD;;;;;;;;;;;;;GAaG;AACH,oCAPW,UAAU,WACV,MAAM,KACN,UAAU,WACV,MAAM,aACN,MAAM,GACJ,OAAO,CAqCnB;AAED;;;;;;;;;;;;;;GAcG;AACH,mCAPW,UAAU,WACV,MAAM,KACN,UAAU,QACV,KAAK,aACL,MAAM,GACJ,OAAO,CA0DnB;AAED;;;;;;;;;;;;GAYG;AACH,mCAPW,UAAU,QACV,KAAK,KACL,UAAU,WACV,MAAM,aACN,MAAM,GACJ,OAAO,CAmBnB;AAED;;;;;;;;;;;;;;GAcG;AACH,gGAEC;AAED;;;;GAIG;AACH,gGAEC;AAED;;;;;GAKG;AACH,mGAEC;AAED;;;;;GAKG;AACH,mGAEC;AAsCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qCATW,UAAU,WACV,MAAM,KACN,UAAU,SACV,OAAO,aACP,MAAM,GACJ,OAAO,CAMnB;AAED;;;;;;;;;;GAUG;AACH,qCATW,UAAU,SACV,OAAO,KACP,UAAU,WACV,MAAM,aACN,MAAM,GACJ,OAAO,CAMnB;AAED;;;;;;;;;;;GAWG;AACH,qCATW,UAAU,WACV,MAAM,KACN,UAAU,YACV,OAAO,aACP,MAAM,GACJ,OAAO,CAMnB;AAED;;;;;;;;;;;GAWG;AACH,qCATW,UAAU,YACV,OAAO,KACP,UAAU,WACV,MAAM,aACN,MAAM,GACJ,OAAO,CAMnB;4BAne0B,gCAAgC;2BAJnC,2BAA2B;4BAC1B,4BAA4B;6BAC3B,6BAA6B;wBAX/B,6BAA6B"}
|
|
@@ -1,72 +1,33 @@
|
|
|
1
1
|
export default ResponseObject;
|
|
2
|
+
/**
|
|
3
|
+
* additional import for TypeScript
|
|
4
|
+
* @import Renderable from "../renderable/renderable.js";
|
|
5
|
+
*/
|
|
2
6
|
/**
|
|
3
7
|
* An object representing the result of an intersection.
|
|
4
8
|
*/
|
|
5
|
-
|
|
9
|
+
declare class ResponseObject {
|
|
6
10
|
/**
|
|
7
11
|
* The first object participating in the intersection
|
|
12
|
+
* @type {Renderable|null}
|
|
8
13
|
*/
|
|
9
|
-
a: Renderable;
|
|
14
|
+
a: Renderable | null;
|
|
10
15
|
/**
|
|
11
16
|
* The second object participating in the intersection
|
|
17
|
+
* @type {Renderable|null}
|
|
12
18
|
*/
|
|
13
|
-
b: Renderable;
|
|
14
|
-
/**
|
|
15
|
-
* Magnitude of the overlap on the shortest colliding axis
|
|
16
|
-
*/
|
|
17
|
-
overlap: number;
|
|
18
|
-
/**
|
|
19
|
-
* The overlap vector (i.e. `overlapN.scale(overlap, overlap)`). If this vector is subtracted from the position of a, a and b will no longer be colliding
|
|
20
|
-
*/
|
|
21
|
-
overlapV: Vector2d;
|
|
19
|
+
b: Renderable | null;
|
|
22
20
|
/**
|
|
23
21
|
* The shortest colliding axis (unit-vector)
|
|
22
|
+
* @type {Vector2d}
|
|
24
23
|
*/
|
|
25
24
|
overlapN: Vector2d;
|
|
26
25
|
/**
|
|
27
|
-
* The
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* The Z component of the overlap vector (i.e. `overlapNZ * overlap`). Always `0` for a collision between planar shapes
|
|
32
|
-
*/
|
|
33
|
-
overlapZ: number;
|
|
34
|
-
/**
|
|
35
|
-
* Whether the first object is entirely inside the second
|
|
36
|
-
*/
|
|
37
|
-
aInB: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Whether the second object is entirely inside the first
|
|
26
|
+
* The overlap vector (i.e. `overlapN.scale(overlap, overlap)`). If
|
|
27
|
+
* this vector is subtracted from the position of a, a and b will no
|
|
28
|
+
* longer be colliding
|
|
29
|
+
* @type {Vector2d}
|
|
40
30
|
*/
|
|
41
|
-
bInA: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The index of the colliding shape for the object a body
|
|
44
|
-
*/
|
|
45
|
-
indexShapeA: number;
|
|
46
|
-
/**
|
|
47
|
-
* The index of the colliding shape for the object b body
|
|
48
|
-
*/
|
|
49
|
-
indexShapeB: number;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* An object representing the result of an intersection.
|
|
53
|
-
* @typedef {object} ResponseObject
|
|
54
|
-
* @property {Renderable} a The first object participating in the intersection
|
|
55
|
-
* @property {Renderable} b The second object participating in the intersection
|
|
56
|
-
* @property {number} overlap Magnitude of the overlap on the shortest colliding axis
|
|
57
|
-
* @property {Vector2d} overlapV The overlap vector (i.e. `overlapN.scale(overlap, overlap)`). If this vector is subtracted from the position of a, a and b will no longer be colliding
|
|
58
|
-
* @property {Vector2d} overlapN The shortest colliding axis (unit-vector)
|
|
59
|
-
* @property {number} overlapNZ The Z component of the shortest colliding axis, as a unit scalar (`-1`, `0` or `1`). Always `0` for a collision between planar shapes
|
|
60
|
-
* @property {number} overlapZ The Z component of the overlap vector (i.e. `overlapNZ * overlap`). Always `0` for a collision between planar shapes
|
|
61
|
-
* @property {boolean} aInB Whether the first object is entirely inside the second
|
|
62
|
-
* @property {boolean} bInA Whether the second object is entirely inside the first
|
|
63
|
-
* @property {number} indexShapeA The index of the colliding shape for the object a body
|
|
64
|
-
* @property {number} indexShapeB The index of the colliding shape for the object b body
|
|
65
|
-
*/
|
|
66
|
-
declare class ResponseObject {
|
|
67
|
-
a: any;
|
|
68
|
-
b: any;
|
|
69
|
-
overlapN: Vector2d;
|
|
70
31
|
overlapV: Vector2d;
|
|
71
32
|
/**
|
|
72
33
|
* Z half of the minimum translation axis.
|
|
@@ -76,24 +37,45 @@ declare class ResponseObject {
|
|
|
76
37
|
* subclass of {@link Vector2d} — retyping them would break every
|
|
77
38
|
* existing consumer of a 2D collision response.
|
|
78
39
|
*
|
|
79
|
-
* The
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* unchanged as `overlapZ = overlapNZ * overlap`, and a collision
|
|
83
|
-
* resolved along Z leaves `overlapN` / `overlapV` at zero — a legacy
|
|
84
|
-
* 2D handler reading them applies no push, which is correct, because
|
|
85
|
-
* there is no 2D push to apply.
|
|
40
|
+
* The 2D invariant `overlapV = overlapN * overlap` extends unchanged
|
|
41
|
+
* as `overlapZ = overlapNZ * overlap`, and `overlapN` together with
|
|
42
|
+
* `overlapNZ` is always a 3D unit vector.
|
|
86
43
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
44
|
+
* How that vector is SHAPED depends on which 3D shapes met:
|
|
45
|
+
*
|
|
46
|
+
* - A {@link Box3d} pair separates along one world axis, so exactly
|
|
47
|
+
* one of `overlapN.x`, `overlapN.y` and `overlapNZ` is non-zero and
|
|
48
|
+
* that one is `-1` or `1`. A contact resolved along Z leaves
|
|
49
|
+
* `overlapN` / `overlapV` at zero, so a legacy 2D handler reading
|
|
50
|
+
* them applies no push, which is correct — there is no 2D push to
|
|
51
|
+
* apply.
|
|
52
|
+
* - A {@link Sphere} against anything separates along the line
|
|
53
|
+
* between the two closest points, which is generally DIAGONAL: all
|
|
54
|
+
* three components can be non-zero at once, and each is any value
|
|
55
|
+
* in `[-1, 1]`. A handler that branches on `overlapNZ !== 0` and
|
|
56
|
+
* then ignores `overlapV` drops the planar half of such a contact.
|
|
57
|
+
* Subtract both halves, or read `overlap` along the full normal.
|
|
58
|
+
*
|
|
59
|
+
* Both are `0` for every planar shape pair, so nothing about a 2D
|
|
60
|
+
* collision changed.
|
|
89
61
|
*/
|
|
90
62
|
overlapNZ: number;
|
|
63
|
+
/**
|
|
64
|
+
* The Z component of the overlap vector (i.e. `overlapNZ * overlap`).
|
|
65
|
+
* Always `0` for a collision between planar shapes
|
|
66
|
+
* @type {number}
|
|
67
|
+
*/
|
|
91
68
|
overlapZ: number;
|
|
69
|
+
/** Whether the first object is entirely inside the second */
|
|
92
70
|
aInB: boolean;
|
|
71
|
+
/** Whether the second object is entirely inside the first */
|
|
93
72
|
bInA: boolean;
|
|
73
|
+
/** The index of the colliding shape for the object a body */
|
|
94
74
|
indexShapeA: number;
|
|
75
|
+
/** The index of the colliding shape for the object b body */
|
|
95
76
|
indexShapeB: number;
|
|
96
77
|
isTriggerContact: boolean;
|
|
78
|
+
/** Magnitude of the overlap on the shortest colliding axis */
|
|
97
79
|
overlap: number;
|
|
98
80
|
/**
|
|
99
81
|
* Set some values of the response back to their defaults. <br>
|
|
@@ -105,5 +87,6 @@ declare class ResponseObject {
|
|
|
105
87
|
*/
|
|
106
88
|
public clear(): object;
|
|
107
89
|
}
|
|
90
|
+
import type Renderable from "../renderable/renderable.js";
|
|
108
91
|
import { Vector2d } from "../math/vector2d.ts";
|
|
109
92
|
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/physics/response.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/physics/response.js"],"names":[],"mappings":";AAEA;;;GAGG;AACH;;GAEG;AACH;IAEE;;;OAGG;IACH,GAFU,UAAU,GAAC,IAAI,CAEZ;IACb;;;OAGG;IACH,GAFU,UAAU,GAAC,IAAI,CAEZ;IACb;;;OAGG;IACH,UAFU,QAAQ,CAEY;IAC9B;;;;;OAKG;IACH,UAFU,QAAQ,CAEY;IAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,kBAAkB;IAClB;;;;OAIG;IACH,UAFU,MAAM,CAEC;IACjB,6DAA6D;IAC7D,cAAgB;IAChB,6DAA6D;IAC7D,cAAgB;IAChB,6DAA6D;IAC7D,oBAAqB;IACrB,6DAA6D;IAC7D,oBAAqB;IACrB,0BAA6B;IAC7B,8DAA8D;IAC9D,gBAA+B;IAGhC;;;;;;;OAOG;IACH,gBAFa,MAAM,CAelB;CACD;4BArG0B,6BAA6B;yBAJ/B,qBAAqB"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* additional import for TypeScript
|
|
3
|
+
* @import {Vector2d} from "../math/vector2d.ts";
|
|
4
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* a basic collectable helper class for immovable object (e.g. a coin)
|
|
3
7
|
* @category Game Objects
|
|
@@ -13,7 +17,7 @@ export default class Collectable extends Sprite {
|
|
|
13
17
|
anchorPoint?: string | Vector2d | {
|
|
14
18
|
x: number;
|
|
15
19
|
y: number;
|
|
16
|
-
};
|
|
20
|
+
} | undefined;
|
|
17
21
|
});
|
|
18
22
|
name: any;
|
|
19
23
|
type: any;
|
|
@@ -27,4 +31,5 @@ export default class Collectable extends Sprite {
|
|
|
27
31
|
};
|
|
28
32
|
}
|
|
29
33
|
import Sprite from "./sprite.js";
|
|
34
|
+
import type { Vector2d } from "../math/vector2d.ts";
|
|
30
35
|
//# sourceMappingURL=collectable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectable.d.ts","sourceRoot":"","sources":["../../src/renderable/collectable.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH;IACC;;;;;OAKG;IACH,eALW,MAAM,KACN,MAAM,YAEd;QAAuD,WAAW
|
|
1
|
+
{"version":3,"file":"collectable.d.ts","sourceRoot":"","sources":["../../src/renderable/collectable.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH;;;GAGG;AACH;IACC;;;;;OAKG;IACH,eALW,MAAM,KACN,MAAM,YAEd;QAAuD,WAAW;eAAvC,MAAM;eAAG,MAAM;;KAC5C,EA+CA;IA1CA,UAAyB;IACzB,UAAyB;IACzB,QAAqB;IAoBrB;;;;;;MAOC;CAcF;mBAhEkB,aAAa;8BAIL,qBAAqB"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @import CanvasRenderer from "./../video/canvas/canvas_renderer.js";
|
|
5
5
|
* @import WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
6
6
|
* @import Camera2d from "./../camera/camera2d.ts";
|
|
7
|
+
* @import Renderer from "../video/renderer.js";
|
|
7
8
|
*/
|
|
8
9
|
/**
|
|
9
10
|
* a generic Color Layer Object. Fills the entire Canvas with the color not just the container the object belongs to.
|
|
@@ -24,14 +25,13 @@ export default class ColorLayer extends Renderable {
|
|
|
24
25
|
onResetEvent(name: any, color: any, z?: number): void;
|
|
25
26
|
/**
|
|
26
27
|
* draw this color layer (automatically called by melonJS)
|
|
27
|
-
* @param {
|
|
28
|
+
* @param {Renderer} renderer - a renderer instance
|
|
28
29
|
* @param {Camera2d} [viewport] - the viewport to (re)draw
|
|
29
30
|
*/
|
|
30
|
-
draw(renderer:
|
|
31
|
+
draw(renderer: Renderer, viewport?: Camera2d): void;
|
|
31
32
|
}
|
|
32
33
|
import Renderable from "./renderable.js";
|
|
33
34
|
import type { Color } from "./../math/color.ts";
|
|
34
|
-
import type
|
|
35
|
-
import type WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
35
|
+
import type Renderer from "../video/renderer.js";
|
|
36
36
|
import type Camera2d from "./../camera/camera2d.ts";
|
|
37
37
|
//# sourceMappingURL=colorlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorlayer.d.ts","sourceRoot":"","sources":["../../src/renderable/colorlayer.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"colorlayer.d.ts","sourceRoot":"","sources":["../../src/renderable/colorlayer.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAEH;;;GAGG;AACH;IACC;;;;OAIG;IACH,kBAJW,MAAM,SACN,KAAK,GAAC,MAAM,MACZ,MAAM,EAahB;IAPA;;;OAGG;IACH,OAFU,KAAK,CAE6B;IAK7C,sDAOC;IAED;;;;OAIG;IACH,eAHW,QAAQ,aACR,QAAQ,QAOlB;IAED;;;;OAIG;IACH,gBAIC;CACD;uBAjEsB,iBAAiB;2BAIhB,oBAAoB;0BAInB,sBAAsB;0BADtB,yBAAyB"}
|