melonjs 20.7.0 → 20.9.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 +7 -3
- package/build/application/application.d.ts +66 -8
- package/build/application/application.d.ts.map +1 -1
- package/build/application/defaultApplicationSettings.d.ts +6 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -1
- package/build/application/header.d.ts.map +1 -1
- package/build/application/resize.d.ts +25 -0
- package/build/application/resize.d.ts.map +1 -1
- package/build/application/scaleMethods.d.ts +13 -3
- package/build/application/scaleMethods.d.ts.map +1 -1
- package/build/application/settings.d.ts +144 -5
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +29 -5
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/autopause.d.ts +36 -0
- package/build/audio/autopause.d.ts.map +1 -0
- package/build/audio/backend/engine.d.ts +10 -1
- package/build/audio/backend/engine.d.ts.map +1 -1
- package/build/audio/backend/sound.d.ts +0 -1
- package/build/audio/backend/sound.d.ts.map +1 -1
- package/build/audio/backend/spatial.d.ts.map +1 -1
- package/build/audio/context.d.ts +35 -0
- package/build/audio/context.d.ts.map +1 -0
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/procedural.d.ts.map +1 -1
- package/build/audio/spatial.d.ts +87 -0
- package/build/audio/spatial.d.ts.map +1 -0
- package/build/audio/state.d.ts +1 -0
- package/build/audio/state.d.ts.map +1 -1
- package/build/audio/types.d.ts +46 -6
- package/build/audio/types.d.ts.map +1 -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/camera/effects/fade_effect.d.ts.map +1 -1
- package/build/camera/effects/mask_effect.d.ts.map +1 -1
- package/build/camera/effects/shake_effect.d.ts.map +1 -1
- package/build/geometries/box3d.d.ts +25 -7
- package/build/geometries/box3d.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +15 -1
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/line.d.ts +1 -1
- package/build/geometries/line.d.ts.map +1 -1
- package/build/geometries/point.d.ts +1 -1
- package/build/geometries/point.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +15 -1
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/geometries/rectangle.d.ts +1 -1
- package/build/geometries/rectangle.d.ts.map +1 -1
- package/build/geometries/roundrect.d.ts +1 -1
- package/build/geometries/roundrect.d.ts.map +1 -1
- package/build/geometries/sphere.d.ts +36 -7
- package/build/geometries/sphere.d.ts.map +1 -1
- package/build/index.d.ts +16 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +38172 -33633
- package/build/index.js.map +4 -4
- package/build/input/gamepad.d.ts +129 -3
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/input/pointerevent.d.ts +8 -0
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts +20 -33
- 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/TMXObjectFactory.d.ts +3 -2
- package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -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 +5 -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/cache.d.ts +220 -0
- package/build/loader/cache.d.ts.map +1 -1
- package/build/loader/loader.d.ts +20 -340
- 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/gltf.d.ts +115 -0
- package/build/loader/parsers/gltf.d.ts.map +1 -1
- package/build/loader/parsers/shader.d.ts +0 -2
- package/build/math/color.d.ts +28 -5
- package/build/math/color.d.ts.map +1 -1
- package/build/math/matrix2d.d.ts +1 -1
- package/build/math/matrix2d.d.ts.map +1 -1
- package/build/math/matrix3d.d.ts +1 -1
- package/build/math/matrix3d.d.ts.map +1 -1
- package/build/math/observableVector2d.d.ts +14 -2
- package/build/math/observableVector2d.d.ts.map +1 -1
- package/build/math/observableVector3d.d.ts +15 -1
- package/build/math/observableVector3d.d.ts.map +1 -1
- package/build/math/vector2d.d.ts +31 -1
- package/build/math/vector2d.d.ts.map +1 -1
- package/build/math/vector3d.d.ts +38 -1
- package/build/math/vector3d.d.ts.map +1 -1
- package/build/math/vertex.d.ts.map +1 -1
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +29 -2
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +104 -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/bounds.d.ts +1 -1
- package/build/physics/bounds.d.ts.map +1 -1
- package/build/physics/broadphase/octree.d.ts +24 -0
- package/build/physics/broadphase/octree.d.ts.map +1 -1
- package/build/physics/broadphase/quadtree.d.ts +31 -0
- package/build/physics/broadphase/quadtree.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +17 -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/pool.d.ts +4 -0
- package/build/pool.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 +17 -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 +56 -7
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +369 -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 +129 -28
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +7 -20
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +31 -16
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +76 -5
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts +1 -5
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/glypheffect.d.ts +44 -0
- package/build/renderable/text/glypheffect.d.ts.map +1 -0
- package/build/renderable/text/text.d.ts +22 -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/trail3d.d.ts +174 -0
- package/build/renderable/trail3d.d.ts.map +1 -0
- package/build/renderable/trigger.d.ts +28 -5
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/panelpaint.d.ts +5 -0
- package/build/renderable/ui/panelpaint.d.ts.map +1 -0
- package/build/renderable/ui/progressbar.d.ts +192 -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/uipanel.d.ts +245 -0
- package/build/renderable/ui/uipanel.d.ts.map +1 -0
- package/build/renderable/ui/uispriteelement.d.ts +19 -3
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/renderable/ui/uitextbutton.d.ts +30 -1
- package/build/renderable/ui/uitextbutton.d.ts.map +1 -1
- package/build/state/state.d.ts.map +1 -1
- package/build/system/bootstrap.d.ts.map +1 -1
- package/build/system/legacy_pool.d.ts +24 -4
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/system/pool.d.ts +15 -8
- package/build/system/pool.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +50 -3
- 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 -7
- 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 -7
- package/build/video/effects/wave.d.ts.map +1 -1
- package/build/video/gpu/batcher.d.ts +8 -2
- package/build/video/gpu/batcher.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 +1 -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/rendertarget.d.ts +12 -5
- package/build/video/rendertarget/rendertarget.d.ts.map +1 -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 +24 -14
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +2 -1
- 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/texture/texture2d.d.ts +6 -0
- package/build/video/texture/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 +2 -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 +2 -2
- package/skills/AGENTS.md +1 -1
- package/skills/melonjs/SKILL.md +2 -0
- package/skills/melonjs-3d/SKILL.md +454 -22
- package/skills/melonjs-3d-assets/SKILL.md +111 -10
- package/skills/melonjs-audio/SKILL.md +229 -8
- package/skills/melonjs-camera-and-drawing/SKILL.md +127 -1
- package/skills/melonjs-display-and-scaling/SKILL.md +273 -0
- package/skills/melonjs-effects-and-shaders/SKILL.md +341 -29
- package/skills/melonjs-events/SKILL.md +8 -6
- package/skills/melonjs-input/SKILL.md +147 -7
- package/skills/melonjs-math/SKILL.md +313 -0
- package/skills/melonjs-particles-and-trails/SKILL.md +189 -13
- package/skills/melonjs-performance/SKILL.md +131 -23
- package/skills/melonjs-physics/SKILL.md +103 -28
- package/skills/melonjs-renderables/SKILL.md +8 -2
- package/skills/melonjs-scenes-and-state/SKILL.md +134 -3
- package/skills/melonjs-sprites-and-animation/SKILL.md +9 -4
- package/skills/melonjs-tilemaps/SKILL.md +40 -12
- package/skills/melonjs-ui-and-text/SKILL.md +546 -7
- package/build/level/gltf/srgb.d.ts +0 -20
- package/build/level/gltf/srgb.d.ts.map +0 -1
|
@@ -24,6 +24,20 @@ export default class Body {
|
|
|
24
24
|
* @type {Bounds}
|
|
25
25
|
*/
|
|
26
26
|
public bounds: Bounds;
|
|
27
|
+
/**
|
|
28
|
+
* The body collision mask, that defines what should collide with what.<br>
|
|
29
|
+
* (by default will collide with all entities)
|
|
30
|
+
*
|
|
31
|
+
* Public, and not `@internal`: it is part of the portable
|
|
32
|
+
* {@link PhysicsBody} contract every adapter implements, this class's
|
|
33
|
+
* own examples assign to it, and stripping it made `Body` fail to
|
|
34
|
+
* satisfy `PhysicsBody` in the published declarations.
|
|
35
|
+
* @public
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @default collision.types.ALL_OBJECT
|
|
38
|
+
* @see collision.types
|
|
39
|
+
*/
|
|
40
|
+
public collisionMask: number;
|
|
27
41
|
/**
|
|
28
42
|
* define the collision type of the body for collision filtering
|
|
29
43
|
* @public
|
|
@@ -202,8 +216,9 @@ export default class Body {
|
|
|
202
216
|
*/
|
|
203
217
|
public maxVelZ: number;
|
|
204
218
|
/**
|
|
205
|
-
* `true` when at least one of this body's shapes
|
|
206
|
-
*
|
|
219
|
+
* `true` when at least one of this body's shapes has a depth extent
|
|
220
|
+
* and can therefore be resolved along z: a {@link Box3d} or a
|
|
221
|
+
* {@link Sphere}.
|
|
207
222
|
* Maintained by {@link Body#addShape} / {@link Body#removeShape}.
|
|
208
223
|
* @readonly
|
|
209
224
|
* @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,2BAqZ1G;IAjZA;;;;;;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;;;;;;;;;;;;OAYG;IACH,sBAJU,MAAM,CAI+B;IAE/C;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GAAC,IAAI,GAAC,OAAO,GAAC,KAAK,GACxB,MAAM,CAkBlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;;;;;;OAYG;IACH,2BARW,MAAM,QAUhB;IAED;;;;;;;OAOG;IACH,uBALW,MAAM,QAmBhB;IAED;;;;OAIG;IACH,6BAHW,cAAc,QAiKxB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,sCAVW,MAAM,QAwBhB;IAED;;;;;;;;;;;;OAYG;IACH,kBAXc,CAAC,MAAM,GAAC,QAAQ,CAAC,EAAA,GAClB,OAAO,CA+BnB;IAED;;;;;;OAMG;IACH,cAJW,MAAM,MACN,QAAQ,GACN,IAAI,CAgChB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,KACN,MAAM,MACN,MAAM,QAQhB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,MACN,MAAM,MACN,MAAM,QAQhB;IAED;;;;;;;;;;;OAWG;IACH,oBAFa,OAAO,CA4FnB;IAED;;;;OAIG;IACH,gBAqFC;CACD;4BA7kD0B,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,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,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"}
|
package/build/pool.d.ts
CHANGED
|
@@ -12,7 +12,9 @@ import { vector3dPool } from "./math/vector3d";
|
|
|
12
12
|
import type ParticleEmitter from "./particles/emitter";
|
|
13
13
|
import type Particle from "./particles/particle";
|
|
14
14
|
import { boundsPool } from "./physics/bounds";
|
|
15
|
+
import type { colorLayerPool } from "./renderable/colorlayer.js";
|
|
15
16
|
import { bitmapTextDataPool } from "./renderable/text/bitmaptextdata";
|
|
17
|
+
import type { textPool } from "./renderable/text/text.js";
|
|
16
18
|
import type { Pool } from "./system/pool";
|
|
17
19
|
import { tweenPool } from "./tweens/tween";
|
|
18
20
|
interface PoolMap {
|
|
@@ -29,6 +31,8 @@ interface PoolMap {
|
|
|
29
31
|
roundedRectangle: typeof roundedRectanglePool;
|
|
30
32
|
ellipse: typeof ellipsePool;
|
|
31
33
|
tween: typeof tweenPool;
|
|
34
|
+
text: typeof textPool;
|
|
35
|
+
colorLayer: typeof colorLayerPool;
|
|
32
36
|
particle: Pool<Particle, [emitter: ParticleEmitter]>;
|
|
33
37
|
bitmapTextData: typeof bitmapTextDataPool;
|
|
34
38
|
}
|
package/build/pool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,eAAe,MAAM,qBAAq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Q,EAAE,OAAO,YAAY,CAAC;IAC9B,KAAK,EAAE,OAAO,SAAS,CAAC;IACxB,QAAQ,EAAE,OAAO,YAAY,CAAC;IAC9B,QAAQ,EAAE,OAAO,YAAY,CAAC;IAC9B,MAAM,EAAE,OAAO,UAAU,CAAC;IAC1B,KAAK,EAAE,OAAO,SAAS,CAAC;IACxB,OAAO,EAAE,OAAO,WAAW,CAAC;IAC5B,IAAI,EAAE,OAAO,QAAQ,CAAC;IACtB,SAAS,EAAE,OAAO,QAAQ,CAAC;IAC3B,gBAAgB,EAAE,OAAO,oBAAoB,CAAC;IAC9C,OAAO,EAAE,OAAO,WAAW,CAAC;IAC5B,KAAK,EAAE,OAAO,SAAS,CAAC;IACxB,IAAI,EAAE,OAAO,QAAQ,CAAC;IACtB,UAAU,EAAE,OAAO,cAAc,CAAC;IAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IACrD,cAAc,EAAE,OAAO,kBAAkB,CAAC;CAC1C;AAED,KAAK,OAAO,GAAG,MAAM,OAAO,CAAC;AAE7B,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,OAAO,EAAE,KAAK,CAAC,KAAG,OAAO,CAAC,CAAC,CAE5D,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAO,MAOnC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -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,26 @@ 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
|
}
|
|
33
|
+
/**
|
|
34
|
+
* A pool of reusable {@link ColorLayer} instances.
|
|
35
|
+
*
|
|
36
|
+
* Reachable as `getPool("colorLayer")`. `release` it yourself when the layer
|
|
37
|
+
* is finished, or let a container do it: a layer this pool built carries the
|
|
38
|
+
* pool it came from, so removing it from a container releases it back. Pass
|
|
39
|
+
* `keepalive` to `removeChild()` to keep holding one.
|
|
40
|
+
* @example
|
|
41
|
+
* const flash = getPool("colorLayer").get("flash", "#ffffff", 10);
|
|
42
|
+
* // ... later
|
|
43
|
+
* getPool("colorLayer").release(flash);
|
|
44
|
+
*/
|
|
45
|
+
export const colorLayerPool: import("../index.ts").Pool<ColorLayer, [name: unknown, color: unknown, z: unknown]>;
|
|
32
46
|
import Renderable from "./renderable.js";
|
|
33
47
|
import type { Color } from "./../math/color.ts";
|
|
34
|
-
import type
|
|
35
|
-
import type WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
48
|
+
import type Renderer from "../video/renderer.js";
|
|
36
49
|
import type Camera2d from "./../camera/camera2d.ts";
|
|
37
50
|
//# sourceMappingURL=colorlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorlayer.d.ts","sourceRoot":"","sources":["../../src/renderable/colorlayer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"colorlayer.d.ts","sourceRoot":"","sources":["../../src/renderable/colorlayer.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH;;;GAGG;AACH;IACC;;;;OAIG;IACH,kBAJW,MAAM,SACN,KAAK,GAAC,MAAM,MACZ,MAAM,EAahB;IAPA;;;OAGG;IACH,OAFU,KAAK,CAE6B;IAK7C,sDAYC;IAED;;;;OAIG;IACH,eAHW,QAAQ,aACR,QAAQ,QAOlB;IAED;;;;OAIG;IACH,gBAIC;CACD;AAED;;;;;;;;;;;GAWG;AACH,iHAQG;uBA5F8C,iBAAiB;2BAI1C,oBAAoB;0BAInB,sBAAsB;0BADtB,yBAAyB"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @import NineSliceSprite from "./nineslicesprite.js";
|
|
11
11
|
* @import ImageLayer from "./imagelayer.js";
|
|
12
12
|
* @import ColorLayer from "./colorlayer.js";
|
|
13
|
-
* @import Light2d from "
|
|
13
|
+
* @import Light2d from "../lighting/light2d.ts";
|
|
14
14
|
* @import UIBaseElement from "./ui/uibaseelement.ts";
|
|
15
15
|
* @import UISpriteElement from "./ui/uispriteelement.ts";
|
|
16
16
|
* @import UITextButton from "./ui/uitextbutton.ts";
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
* @import {Bounds} from "./../physics/bounds.ts";
|
|
20
20
|
* @import CanvasRenderer from "./../video/canvas/canvas_renderer.js";
|
|
21
21
|
* @import WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
22
|
+
* @import {Matrix3d} from "../math/matrix3d.ts";
|
|
23
|
+
* @import Camera2d from "../camera/camera2d.ts";
|
|
24
|
+
* @import Renderer from "../video/renderer.js";
|
|
22
25
|
*/
|
|
23
26
|
/**
|
|
24
27
|
* Container represents a collection of child objects.
|
|
@@ -144,7 +147,13 @@ export default class Container extends Renderable {
|
|
|
144
147
|
* if the given child implements an onActivateEvent method, that method will be called
|
|
145
148
|
* once the child is added to this container.
|
|
146
149
|
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be added
|
|
147
|
-
* @param {number} [z] - forces the z index of the child to the specified
|
|
150
|
+
* @param {number} [z] - forces the z index of the child to the specified
|
|
151
|
+
* value. This depth is scoped to THIS container: it orders the child among
|
|
152
|
+
* its siblings only, and says nothing about children of another container.
|
|
153
|
+
* Both drawing and pointer hit-testing resolve a cross-container pair at
|
|
154
|
+
* the common ancestor instead, so to put a whole subtree in front use
|
|
155
|
+
* {@link Container#moveToTop} on the container rather than a large `z` on
|
|
156
|
+
* something inside it. Left out, `autoDepth` numbers children from 1.
|
|
148
157
|
* @returns {Renderable} the added child
|
|
149
158
|
*/
|
|
150
159
|
addChild(child: Renderable | Entity | Sprite | Collectable | Trigger | Draggable | DropTarget | NineSliceSprite | ImageLayer | ColorLayer | Light2d | UIBaseElement | UISpriteElement | UITextButton | Text | BitmapText, z?: number): Renderable;
|
|
@@ -256,12 +265,6 @@ export default class Container extends Renderable {
|
|
|
256
265
|
* @returns {Renderable[]} an array of renderable object
|
|
257
266
|
*/
|
|
258
267
|
getChildren(): Renderable[];
|
|
259
|
-
/**
|
|
260
|
-
* update the bounding box for this container.
|
|
261
|
-
* @param {boolean} [absolute=true] - update the bounds size and position in (world) absolute coordinates
|
|
262
|
-
* @returns {Bounds} this container bounding box Rectangle object
|
|
263
|
-
*/
|
|
264
|
-
updateBounds(absolute?: boolean): Bounds;
|
|
265
268
|
/**
|
|
266
269
|
* Checks if this container is root or if it's attached to the root container.
|
|
267
270
|
* @returns {boolean} true if this container is root or if it's attached to the root container
|
|
@@ -313,6 +316,11 @@ export default class Container extends Renderable {
|
|
|
313
316
|
moveDown(child: Renderable | Entity | Sprite | Collectable | Trigger | Draggable | DropTarget | NineSliceSprite | ImageLayer | ColorLayer | Light2d | UIBaseElement | UISpriteElement | UITextButton | Text | BitmapText): void;
|
|
314
317
|
/**
|
|
315
318
|
* Move the specified child to the top(z depth).
|
|
319
|
+
*
|
|
320
|
+
* Moves the whole subtree: the child's own children keep their depths among
|
|
321
|
+
* themselves and come with it, because depth is resolved per container. This
|
|
322
|
+
* is how one overlapping panel is brought in front of another, for drawing
|
|
323
|
+
* and for pointer hit-testing alike.
|
|
316
324
|
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - Child to be moved
|
|
317
325
|
*/
|
|
318
326
|
moveToTop(child: Renderable | Entity | Sprite | Collectable | Trigger | Draggable | DropTarget | NineSliceSprite | ImageLayer | ColorLayer | Light2d | UIBaseElement | UISpriteElement | UITextButton | Text | BitmapText): void;
|
|
@@ -337,15 +345,11 @@ export default class Container extends Renderable {
|
|
|
337
345
|
*/
|
|
338
346
|
sortNow(recursive?: boolean): void;
|
|
339
347
|
/**
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
* place in the world. A leaf renderable has no such term.
|
|
344
|
-
* @protected
|
|
345
|
-
* @param {Matrix3d} out - matrix to write into
|
|
346
|
-
* @returns {Matrix3d} `out`, for chaining
|
|
348
|
+
* draw this renderable (automatically called by melonJS)
|
|
349
|
+
* @param {Renderer} renderer - a renderer instance
|
|
350
|
+
* @param {Camera2d} [viewport] - the viewport to (re)draw
|
|
347
351
|
*/
|
|
348
|
-
|
|
352
|
+
draw(renderer: Renderer, viewport?: Camera2d): void;
|
|
349
353
|
}
|
|
350
354
|
import Renderable from "./renderable.js";
|
|
351
355
|
import type { Color } from "./../math/color.ts";
|
|
@@ -358,10 +362,12 @@ import type { DropTarget } from "./dragndrop.js";
|
|
|
358
362
|
import type NineSliceSprite from "./nineslicesprite.js";
|
|
359
363
|
import type ImageLayer from "./imagelayer.js";
|
|
360
364
|
import type ColorLayer from "./colorlayer.js";
|
|
365
|
+
import type Light2d from "../lighting/light2d.ts";
|
|
361
366
|
import type UIBaseElement from "./ui/uibaseelement.ts";
|
|
362
367
|
import type UISpriteElement from "./ui/uispriteelement.ts";
|
|
363
368
|
import type UITextButton from "./ui/uitextbutton.ts";
|
|
364
369
|
import type Text from "./text/text.js";
|
|
365
370
|
import type BitmapText from "./text/bitmaptext.js";
|
|
366
|
-
import type
|
|
371
|
+
import type Renderer from "../video/renderer.js";
|
|
372
|
+
import type Camera2d from "../camera/camera2d.ts";
|
|
367
373
|
//# sourceMappingURL=container.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/renderable/container.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/renderable/container.js"],"names":[],"mappings":"AAwMA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;GASG;AACH;IACC;;;;;;;OAOG;IACH,gBAPW,MAAM,MACN,MAAM,UACN,MAAM,WACN,MAAM,SACN,OAAO,EAsIjB;IA/HA;;;;OAIG;IACH,iBAAuB;IAEvB;;;;OAIG;IACH,MAHU,OAAO,CAGD;IAEhB;;;;OAIG;IACH,4BAAyB;IAEzB;;;;;;;OAOG;IACH,SALU,MAAM,CAKE;IAClB;;;OAGG;IACH,wCAA8B;IAE9B;;;;OAIG;IACH,UAHU,OAAO,CAGG;IAEpB;;;;OAIG;IACH,WAHU,OAAO,CAGI;IAErB;;;;OAIG;IACH,UAHU,OAAO,CAGI;IAErB;;;OAGG;IACH,0BAEC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,yBAJU,OAAO,CAImB;IAEpC;;;;;;;OAOG;IACH,iBANU,KAAK,CAMmC;IAqBjD,yCAMC;IAiCH,kBANU,GAAG,GAAC,GAAG,GAAC,GAAG,GAAC,OAAO,EAmB5B;IAzCD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,cAHU,GAAG,GAAC,GAAG,GAAC,GAAG,GAAC,OAAO,CAK5B;IAgBD;;OAEG;IACH,cAMC;IAED;;;;;;;;;;;;;;OAcG;IACH,sBAeC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,gBAVW,UAAU,GAAC,MAAM,GAAC,MAAM,GAAC,WAAW,GAAC,OAAO,GAAC,SAAS,GAAC,UAAU,GAAC,eAAe,GAAC,UAAU,GAAC,UAAU,GAAC,OAAO,GAAC,aAAa,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IAED;;;;OAIG;IACH,+BAEC;IAkKD;;;;OAIG;IACH,eAHW,QAAQ,aACR,QAAQ,QA4GlB;CACD;uBAriDsB,iBAAiB;2BA+LhB,oBAAoB;wBACrB,oBAAoB;wBACpB,aAAa;6BACR,kBAAkB;yBACtB,cAAc;+BACR,gBAAgB;gCACf,gBAAgB;iCACf,sBAAsB;4BAC3B,iBAAiB;4BACjB,iBAAiB;yBACpB,wBAAwB;+BAClB,uBAAuB;iCACrB,yBAAyB;8BAC5B,sBAAsB;sBAC9B,gBAAgB;4BACV,sBAAsB;0BAMxB,sBAAsB;0BADtB,uBAAuB"}
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
* @import {Bounds} from "./../../physics/bounds.ts";
|
|
7
7
|
* @import CanvasRenderer from "./../../video/canvas/canvas_renderer.js";
|
|
8
8
|
* @import WebGLRenderer from "./../../video/webgl/webgl_renderer.js";
|
|
9
|
+
* @import {Matrix3d} from "../../math/matrix3d.ts";
|
|
10
|
+
* @import {Vector2d} from "../../math/vector2d.ts";
|
|
11
|
+
* @import Camera2d from "../../camera/camera2d.ts";
|
|
12
|
+
* @import Renderer from "../../video/renderer.js";
|
|
9
13
|
**/
|
|
10
14
|
/**
|
|
11
15
|
* a Generic Object Entity
|
|
@@ -178,7 +182,7 @@ export default class Entity extends Renderable {
|
|
|
178
182
|
anchorPoint?: string | Vector2d | {
|
|
179
183
|
x: number;
|
|
180
184
|
y: number;
|
|
181
|
-
};
|
|
185
|
+
} | undefined;
|
|
182
186
|
framewidth?: number | undefined;
|
|
183
187
|
frameheight?: number | undefined;
|
|
184
188
|
type?: string | undefined;
|
|
@@ -203,34 +207,26 @@ export default class Entity extends Renderable {
|
|
|
203
207
|
* @type {boolean}
|
|
204
208
|
*/
|
|
205
209
|
alive: boolean;
|
|
206
|
-
/**
|
|
207
|
-
* update the bounding box for this entity.
|
|
208
|
-
* @param {boolean} [absolute=true] - update the bounds size and position in (world) absolute coordinates
|
|
209
|
-
* @returns {Bounds} this entity bounding box Rectangle object
|
|
210
|
-
*/
|
|
211
|
-
updateBounds(absolute?: boolean): Bounds;
|
|
212
210
|
/**
|
|
213
211
|
* update the bounds when the body is modified
|
|
214
212
|
*/
|
|
215
213
|
onBodyUpdate(): void;
|
|
216
214
|
preDraw(renderer: any): void;
|
|
217
215
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* class never applies. Mirrors the `preDraw` above instead.
|
|
222
|
-
* @protected
|
|
223
|
-
* @param {Matrix3d} out - matrix to write into
|
|
224
|
-
* @returns {Matrix3d} `out`, for chaining
|
|
216
|
+
* draw this entity (automatically called by melonJS)
|
|
217
|
+
* @param {Renderer} renderer - a renderer instance
|
|
218
|
+
* @param {Camera2d} [viewport] - the viewport to (re)draw
|
|
225
219
|
*/
|
|
226
|
-
|
|
220
|
+
draw(renderer: Renderer, viewport?: Camera2d): void;
|
|
227
221
|
/**
|
|
228
222
|
* onDeactivateEvent Notification function
|
|
229
223
|
*/
|
|
230
224
|
onDeactivateEvent(): void;
|
|
231
225
|
}
|
|
232
226
|
import Renderable from "../renderable.js";
|
|
233
|
-
import type
|
|
227
|
+
import type Renderer from "../../video/renderer.js";
|
|
228
|
+
import type Camera2d from "../../camera/camera2d.ts";
|
|
229
|
+
import type { Vector2d } from "../../math/vector2d.ts";
|
|
234
230
|
import type { Rect } from "./../../geometries/rectangle.ts";
|
|
235
231
|
import type { Polygon } from "../../geometries/polygon.ts";
|
|
236
232
|
import type { Line } from "./../../geometries/line.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/renderable/entity/entity.js"],"names":[],"mappings":"AAQA
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/renderable/entity/entity.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;IAYI;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6IG;AACH;IACC;;;OAGG;IACH,mCAAkC;IAElC;;;;;;;;;;;;;;;;;;OAkBG;IACH,eAlBW,MAAM,KACN,MAAM,YAGd;QAAyB,KAAK,EAAtB,MAAM;QACW,MAAM,EAAvB,MAAM;QACY,IAAI;QACJ,EAAE;QACI,KAAK;QACkB,WAAW;eAAvC,MAAM;eAAG,MAAM;;QAChB,UAAU;QACV,WAAW;QACX,IAAI;QACJ,aAAa;QACc,MAAM;QACjC,OAAO;KACjC,EAgGF;IApFA;;;;OAIG;IACH,gBAAkB;IA0FnB,sBAPU,UAAU,EAmBnB;IArBD;;;OAGG;IAEH,kBAHU,UAAU,CAKnB;IAxDA;;;OAGG;IACH,IAFU,MAAM,CAEW;IAE3B;;;;OAIG;IACH,OAFU,OAAO,CAEA;IA6DlB;;;OAGG;IACH,yBAKC;IAiCD;;OAEG;IACH,qBAEC;IAED,6BAkBC;IA2BD;;;;OAIG;IACH,eAHW,QAAQ,aACR,QAAQ,QAclB;IAoBD;;OAEG;IACH,0BAIC;CACD;uBA3bsB,kBAAkB;0BAchB,yBAAyB;0BADzB,0BAA0B;8BADxB,wBAAwB;0BAP5B,iCAAiC;6BAE9B,6BAA6B;0BAHhC,4BAA4B;6BAEzB,+BAA+B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* additional import for TypeScript
|
|
3
3
|
* @import { TextureAtlas } from "../video/texture/atlas.js";
|
|
4
|
-
* @import { Vector2d } from "../math/vector2d.
|
|
4
|
+
* @import { Vector2d } from "../math/vector2d.ts";
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* The shared **frame-animation engine** behind {@link Sprite} (2D) and
|