melonjs 20.3.0 → 20.4.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 +19 -19
- package/build/application/application.d.ts +0 -17
- package/build/application/application.d.ts.map +1 -1
- package/build/application/settings.d.ts +3 -0
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/backend/engine.d.ts +0 -19
- package/build/audio/backend/engine.d.ts.map +1 -1
- package/build/audio/backend/sound.d.ts +1 -51
- package/build/audio/backend/sound.d.ts.map +1 -1
- package/build/audio/backend/spatial.d.ts.map +1 -1
- package/build/audio/backend/types.d.ts +11 -1
- package/build/audio/backend/types.d.ts.map +1 -1
- package/build/audio/backend/voice.d.ts +0 -25
- package/build/audio/backend/voice.d.ts.map +1 -1
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/procedural.d.ts.map +1 -1
- package/build/audio/state.d.ts +6 -79
- package/build/audio/state.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +0 -68
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +86 -79
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/camera/effects/fade_effect.d.ts +0 -5
- package/build/camera/effects/fade_effect.d.ts.map +1 -1
- package/build/camera/effects/mask_effect.d.ts +0 -5
- package/build/camera/effects/mask_effect.d.ts.map +1 -1
- package/build/camera/fog.d.ts +118 -0
- package/build/camera/fog.d.ts.map +1 -0
- package/build/geometries/box3d.d.ts +0 -28
- package/build/geometries/box3d.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +0 -20
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/observablePoint.d.ts +0 -3
- package/build/geometries/observablePoint.d.ts.map +1 -1
- package/build/geometries/path2d.d.ts +0 -19
- package/build/geometries/path2d.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +0 -12
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/geometries/roundrect.d.ts +0 -18
- package/build/geometries/roundrect.d.ts.map +1 -1
- package/build/geometries/sphere.d.ts +0 -9
- package/build/geometries/sphere.d.ts.map +1 -1
- package/build/geometries/toarccanvas.d.ts.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2652 -413
- package/build/index.js.map +3 -3
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/input/pointer.d.ts +0 -4
- package/build/input/pointer.d.ts.map +1 -1
- package/build/input/pointerevent.d.ts +0 -6
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/lang/deprecated.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts +0 -81
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/level/gltf/GLTFScene.d.ts +1 -44
- package/build/level/gltf/GLTFScene.d.ts.map +1 -1
- package/build/level/gltf/gltf_sampler.d.ts +1 -48
- package/build/level/gltf/gltf_sampler.d.ts.map +1 -1
- package/build/level/level.d.ts +195 -113
- package/build/level/level.d.ts.map +1 -1
- package/build/level/tiled/TMXGroup.d.ts +1 -65
- package/build/level/tiled/TMXGroup.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +0 -44
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +1 -136
- package/build/level/tiled/TMXObject.d.ts.map +1 -1
- package/build/level/tiled/TMXObjectFactory.d.ts +1 -40
- package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
- package/build/level/tiled/TMXTile.d.ts +1 -30
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +0 -10
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +0 -113
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts +0 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
- package/build/level/tiled/TMXUtils.d.ts +1 -43
- package/build/level/tiled/TMXUtils.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts +1 -7
- package/build/level/tiled/factories/shape.d.ts.map +1 -1
- package/build/level/tiled/factories/text.d.ts +1 -7
- package/build/level/tiled/factories/text.d.ts.map +1 -1
- package/build/level/tiled/factories/tile.d.ts +1 -7
- package/build/level/tiled/factories/tile.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +0 -60
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +0 -42
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +0 -5
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +0 -31
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +2 -2
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/autodetect.d.ts +1 -6
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
- package/build/lighting/light2d.d.ts +0 -25
- package/build/lighting/light2d.d.ts.map +1 -1
- package/build/lighting/light3d.d.ts +0 -16
- package/build/lighting/light3d.d.ts.map +1 -1
- package/build/loader/loader.d.ts +42 -33
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts +0 -33
- package/build/loader/loadingscreen.d.ts.map +1 -1
- package/build/loader/parsers/aseprite.d.ts +0 -13
- package/build/loader/parsers/aseprite.d.ts.map +1 -1
- package/build/loader/parsers/audio.d.ts +1 -30
- package/build/loader/parsers/audio.d.ts.map +1 -1
- package/build/loader/parsers/binary.d.ts +1 -10
- package/build/loader/parsers/binary.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -1
- package/build/loader/parsers/fontface.d.ts +1 -13
- package/build/loader/parsers/fontface.d.ts.map +1 -1
- package/build/loader/parsers/gltf.d.ts +1 -70
- package/build/loader/parsers/gltf.d.ts.map +1 -1
- package/build/loader/parsers/image.d.ts +1 -22
- package/build/loader/parsers/image.d.ts.map +1 -1
- package/build/loader/parsers/json.d.ts +1 -10
- package/build/loader/parsers/json.d.ts.map +1 -1
- package/build/loader/parsers/mtl.d.ts +1 -28
- package/build/loader/parsers/mtl.d.ts.map +1 -1
- package/build/loader/parsers/obj.d.ts +1 -59
- package/build/loader/parsers/obj.d.ts.map +1 -1
- package/build/loader/parsers/pbr.d.ts +1 -62
- package/build/loader/parsers/pbr.d.ts.map +1 -1
- package/build/loader/parsers/script.d.ts +1 -10
- package/build/loader/parsers/script.d.ts.map +1 -1
- package/build/loader/parsers/shader.d.ts +1 -52
- package/build/loader/parsers/shader.d.ts.map +1 -1
- package/build/loader/parsers/tmx.d.ts +1 -10
- package/build/loader/parsers/tmx.d.ts.map +1 -1
- package/build/loader/parsers/video.d.ts +1 -10
- package/build/loader/parsers/video.d.ts.map +1 -1
- package/build/math/color.d.ts.map +1 -1
- package/build/math/noise.d.ts +0 -40
- package/build/math/noise.d.ts.map +1 -1
- package/build/math/observableVector2d.d.ts +0 -3
- package/build/math/observableVector2d.d.ts.map +1 -1
- package/build/math/observableVector3d.d.ts +0 -3
- package/build/math/observableVector3d.d.ts.map +1 -1
- package/build/math/vector2d.d.ts +0 -6
- package/build/math/vector2d.d.ts.map +1 -1
- package/build/math/vertex.d.ts +25 -0
- package/build/math/vertex.d.ts.map +1 -1
- package/build/particles/emitter.d.ts +0 -65
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +0 -81
- package/build/particles/particle.d.ts.map +1 -1
- package/build/physics/bounds.d.ts +0 -1
- package/build/physics/bounds.d.ts.map +1 -1
- package/build/physics/broadphase/broadphase.d.ts +0 -7
- package/build/physics/broadphase/broadphase.d.ts.map +1 -1
- package/build/physics/broadphase/octree.d.ts +0 -91
- package/build/physics/broadphase/octree.d.ts.map +1 -1
- package/build/physics/broadphase/quadtree.d.ts +0 -47
- package/build/physics/broadphase/quadtree.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +2 -65
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts +0 -312
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/physics/builtin/sat.d.ts +1 -48
- package/build/physics/builtin/sat.d.ts.map +1 -1
- package/build/physics/builtin/sat3d.d.ts +1 -56
- package/build/physics/builtin/sat3d.d.ts.map +1 -1
- package/build/physics/collision.d.ts +0 -2
- package/build/physics/collision.d.ts.map +1 -1
- package/build/physics/response.d.ts +0 -1
- package/build/physics/response.d.ts.map +1 -1
- package/build/physics/world.d.ts.map +1 -1
- package/build/renderable/anchorPoint.d.ts +1 -73
- package/build/renderable/anchorPoint.d.ts.map +1 -1
- package/build/renderable/animation.d.ts +0 -7
- package/build/renderable/animation.d.ts.map +1 -1
- package/build/renderable/colorlayer.d.ts +0 -5
- package/build/renderable/colorlayer.d.ts.map +1 -1
- package/build/renderable/container.d.ts +0 -55
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/draggable.d.ts +0 -5
- package/build/renderable/draggable.d.ts.map +1 -1
- package/build/renderable/dragndrop.d.ts +1 -12
- package/build/renderable/dragndrop.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +0 -8
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts +0 -41
- package/build/renderable/frameAnimation.d.ts.map +1 -1
- package/build/renderable/groundshadow.d.ts +1 -91
- package/build/renderable/groundshadow.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts +0 -29
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/instanced_mesh.d.ts +26 -104
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +130 -141
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/nineslicesprite.d.ts +0 -4
- package/build/renderable/nineslicesprite.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +1 -44
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +0 -45
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +0 -95
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +0 -14
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts +0 -22
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/glyph.d.ts +1 -39
- package/build/renderable/text/glyph.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +0 -20
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/text/textstyle.d.ts +1 -5
- package/build/renderable/text/textstyle.d.ts.map +1 -1
- package/build/renderable/trail.d.ts +0 -29
- package/build/renderable/trail.d.ts.map +1 -1
- package/build/renderable/trigger.d.ts +0 -6
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/uibaseelement.d.ts +0 -40
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
- package/build/renderable/ui/uispriteelement.d.ts +0 -35
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/state/stage.d.ts +0 -66
- package/build/state/stage.d.ts.map +1 -1
- package/build/state/state.d.ts.map +1 -1
- package/build/system/device.d.ts +0 -12
- package/build/system/device.d.ts.map +1 -1
- package/build/system/dom.d.ts +1 -8
- package/build/system/dom.d.ts.map +1 -1
- package/build/system/legacy_pool.d.ts +1 -6
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/system/platform.d.ts +0 -1
- package/build/system/platform.d.ts.map +1 -1
- package/build/system/pool.d.ts +0 -9
- package/build/system/pool.d.ts.map +1 -1
- package/build/system/save.d.ts.map +1 -1
- package/build/system/timer.d.ts +0 -20
- package/build/system/timer.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +0 -62
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/utils/array-multimap.d.ts +1 -13
- package/build/utils/array-multimap.d.ts.map +1 -1
- package/build/utils/decode.d.ts.map +1 -1
- package/build/utils/fetchdata.d.ts +1 -31
- package/build/utils/fetchdata.d.ts.map +1 -1
- package/build/utils/utils.d.ts +0 -13
- package/build/utils/utils.d.ts.map +1 -1
- package/build/video/blendmodes.d.ts +1 -106
- package/build/video/blendmodes.d.ts.map +1 -1
- package/build/video/buffer/index.d.ts +1 -39
- package/build/video/buffer/index.d.ts.map +1 -1
- package/build/video/buffer/vertex.d.ts +1 -82
- package/build/video/buffer/vertex.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +2 -23
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/canvas_factory.d.ts +1 -24
- package/build/video/canvas_factory.d.ts.map +1 -1
- package/build/video/effects/blendEffect.d.ts +0 -54
- package/build/video/effects/blendEffect.d.ts.map +1 -1
- package/build/video/effects/colorMatrix.d.ts +0 -10
- package/build/video/effects/colorMatrix.d.ts.map +1 -1
- package/build/video/effects/glsl_realization.d.ts +1 -17
- package/build/video/effects/glsl_realization.d.ts.map +1 -1
- package/build/video/effects/radialGradient.d.ts +0 -1
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +0 -113
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/wgsl/layout.d.ts +1 -27
- package/build/video/effects/wgsl/layout.d.ts.map +1 -1
- package/build/video/effects/wgsl/parse.d.ts +1 -8
- package/build/video/effects/wgsl/parse.d.ts.map +1 -1
- package/build/video/effects/wgsl/scaffold.d.ts +1 -42
- package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
- package/build/video/effects/wgsl_realization.d.ts +1 -82
- package/build/video/effects/wgsl_realization.d.ts.map +1 -1
- package/build/video/gpu/batcher.d.ts +1 -13
- package/build/video/gpu/batcher.d.ts.map +1 -1
- package/build/video/gpu/instancerecord.d.ts +1 -163
- package/build/video/gpu/instancerecord.d.ts.map +1 -1
- package/build/video/gpu/meshchunk.d.ts +1 -48
- package/build/video/gpu/meshchunk.d.ts.map +1 -1
- package/build/video/gpu/meshvertex.d.ts +1 -53
- package/build/video/gpu/meshvertex.d.ts.map +1 -1
- package/build/video/gpu/primitives.d.ts +1 -59
- package/build/video/gpu/primitives.d.ts.map +1 -1
- package/build/video/gpu/quadcorners.d.ts +1 -10
- package/build/video/gpu/quadcorners.d.ts.map +1 -1
- package/build/video/gpu/textureslots.d.ts +1 -121
- package/build/video/gpu/textureslots.d.ts.map +1 -1
- package/build/video/gpu/texturestore.d.ts +1 -138
- package/build/video/gpu/texturestore.d.ts.map +1 -1
- package/build/video/gpu/topology.d.ts.map +1 -1
- package/build/video/gpu/vertexformat.d.ts +0 -28
- package/build/video/gpu/vertexformat.d.ts.map +1 -1
- package/build/video/gradient.d.ts +0 -81
- package/build/video/gradient.d.ts.map +1 -1
- package/build/video/renderer.d.ts +21 -102
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +0 -51
- package/build/video/renderstate.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +0 -10
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +1 -82
- package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
- package/build/video/rendertarget/webglrendertarget.d.ts +1 -64
- package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webgpurendertarget.d.ts +0 -8
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +1 -75
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +0 -136
- package/build/video/texture/cache.d.ts.map +1 -1
- package/build/video/texture/frametexture.d.ts +1 -71
- package/build/video/texture/frametexture.d.ts.map +1 -1
- package/build/video/texture/noise_texture2d.d.ts +0 -43
- package/build/video/texture/noise_texture2d.d.ts.map +1 -1
- package/build/video/texture/parser/aseprite.d.ts +1 -8
- package/build/video/texture/parser/aseprite.d.ts.map +1 -1
- package/build/video/texture/parser/spritesheet.d.ts +1 -8
- package/build/video/texture/parser/spritesheet.d.ts.map +1 -1
- package/build/video/texture/parser/texturepacker.d.ts +1 -8
- package/build/video/texture/parser/texturepacker.d.ts.map +1 -1
- package/build/video/texture/resource.d.ts +0 -9
- package/build/video/texture/resource.d.ts.map +1 -1
- package/build/video/texture/texture2d.d.ts +0 -11
- package/build/video/texture/texture2d.d.ts.map +1 -1
- package/build/video/utils/autodetect.d.ts +1 -5
- package/build/video/utils/autodetect.d.ts.map +1 -1
- package/build/video/webgl/batchers/batcher.d.ts +0 -55
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +0 -14
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts +0 -72
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts +0 -89
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/mesh_batcher.d.ts +14 -343
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/primitive_batcher.d.ts +0 -10
- package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts +0 -30
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +1 -36
- package/build/video/webgl/buffer/index.d.ts.map +1 -1
- package/build/video/webgl/buffer/instance_buffer.d.ts +1 -53
- package/build/video/webgl/buffer/instance_buffer.d.ts.map +1 -1
- package/build/video/webgl/buffer/retained_geometry.d.ts +1 -81
- package/build/video/webgl/buffer/retained_geometry.d.ts.map +1 -1
- package/build/video/webgl/buffer/uniformblock.d.ts +1 -80
- package/build/video/webgl/buffer/uniformblock.d.ts.map +1 -1
- package/build/video/webgl/buffer/vertexstate.d.ts +1 -100
- package/build/video/webgl/buffer/vertexstate.d.ts.map +1 -1
- package/build/video/webgl/glshader.d.ts +0 -49
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/lighting/pack3d.d.ts +1 -47
- package/build/video/webgl/lighting/pack3d.d.ts.map +1 -1
- package/build/video/webgl/lighting/std140.d.ts +1 -109
- package/build/video/webgl/lighting/std140.d.ts.map +1 -1
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +1 -103
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
- package/build/video/webgl/shaders/multitexture-lit.d.ts +1 -26
- package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
- package/build/video/webgl/shaders/multitexture.d.ts +1 -9
- package/build/video/webgl/shaders/multitexture.d.ts.map +1 -1
- package/build/video/webgl/texture/store.d.ts +1 -50
- package/build/video/webgl/texture/store.d.ts.map +1 -1
- package/build/video/webgl/utils/attributes.d.ts +1 -11
- package/build/video/webgl/utils/attributes.d.ts.map +1 -1
- package/build/video/webgl/utils/maxtextures.d.ts +1 -36
- package/build/video/webgl/utils/maxtextures.d.ts.map +1 -1
- package/build/video/webgl/utils/precision.d.ts +1 -14
- package/build/video/webgl/utils/precision.d.ts.map +1 -1
- package/build/video/webgl/utils/program.d.ts +1 -5
- package/build/video/webgl/utils/program.d.ts.map +1 -1
- package/build/video/webgl/utils/samplercache.d.ts +1 -68
- package/build/video/webgl/utils/samplercache.d.ts.map +1 -1
- package/build/video/webgl/utils/string.d.ts +1 -21
- package/build/video/webgl/utils/string.d.ts.map +1 -1
- package/build/video/webgl/utils/topology.d.ts +1 -23
- package/build/video/webgl/utils/topology.d.ts.map +1 -1
- package/build/video/webgl/utils/uniforms.d.ts +1 -25
- package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
- package/build/video/webgl/utils/vertexformat.d.ts +1 -26
- package/build/video/webgl/utils/vertexformat.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts +22 -285
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +0 -6
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +0 -8
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/mesh_batcher.d.ts +1 -230
- package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -82
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/buffer/arena.d.ts +1 -63
- package/build/video/webgpu/buffer/arena.d.ts.map +1 -1
- package/build/video/webgpu/buffer/instance_buffer.d.ts +1 -64
- package/build/video/webgpu/buffer/instance_buffer.d.ts.map +1 -1
- package/build/video/webgpu/buffer/retained_geometry.d.ts +1 -54
- package/build/video/webgpu/buffer/retained_geometry.d.ts.map +1 -1
- package/build/video/webgpu/buffer/uniformring.d.ts +1 -67
- package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -1
- package/build/video/webgpu/effect_binding.d.ts +1 -16
- package/build/video/webgpu/effect_binding.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/bindgroups.d.ts +1 -32
- package/build/video/webgpu/pipeline/bindgroups.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/cache.d.ts +1 -163
- package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +1 -87
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
- package/build/video/webgpu/shaders/mesh-instanced.d.ts +1 -43
- package/build/video/webgpu/shaders/mesh-instanced.d.ts.map +1 -1
- package/build/video/webgpu/texture/compressed.d.ts +1 -32
- package/build/video/webgpu/texture/compressed.d.ts.map +1 -1
- package/build/video/webgpu/texture/frametexture.d.ts +1 -62
- package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
- package/build/video/webgpu/texture/store.d.ts +1 -147
- package/build/video/webgpu/texture/store.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +0 -88
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +5 -4
- package/skills/melonjs/SKILL.md +1 -1
- package/skills/melonjs-3d/SKILL.md +301 -2
- package/skills/melonjs-3d-assets/SKILL.md +25 -6
- package/skills/melonjs-audio/SKILL.md +21 -0
- package/skills/melonjs-camera-and-drawing/SKILL.md +4 -0
- package/skills/melonjs-effects-and-shaders/SKILL.md +2 -1
- package/skills/melonjs-loading-assets/SKILL.md +30 -1
- package/skills/melonjs-performance/SKILL.md +5 -0
- package/skills/melonjs-tilemaps/SKILL.md +31 -11
- package/skills/melonjs-ui-and-text/SKILL.md +17 -127
|
@@ -57,11 +57,14 @@ export default class Mesh extends Renderable {
|
|
|
57
57
|
* @param {number} [settings.alphaCutoff=0] - alpha cutout threshold. Fragments whose final alpha is below this value are discarded (hard-edged cutout — foliage, fences, decals — with no blending or sorting). `0` disables the cutout. Set automatically by the glTF loader from a material's `alphaMode: "MASK"`. GPU mesh path only (WebGL and WebGPU; the Canvas renderer ignores it).
|
|
58
58
|
* @param {number[]|Float32Array} [settings.emissive] - emissive (self-illumination) color `[r, g, b]` (0..1, may exceed 1 for HDR glow) added on top of the lit/unlit color so the surface glows regardless of scene lights (neon, lava, screens). Omit / all-zero for no emission. Set automatically by the glTF loader (`emissiveFactor`) and OBJ loader (MTL `Ke`). GPU mesh path only (WebGL and WebGPU; the Canvas renderer ignores it).
|
|
59
59
|
* @param {boolean} [settings.lit=false] - shade this mesh with the scene's {@link Light3d} lights (the lit mesh pipeline) instead of rendering fullbright. Set automatically by the glTF importer when the scene carries a directional, point or spot light. With `lit` on and no lights present the batcher uploads a white ambient, so the result is indistinguishable from unlit.
|
|
60
|
-
* @param {number[]
|
|
60
|
+
* @param {Uint32Array|Color[]|number[]} [settings.vertexColors] - per-vertex colour, one entry per vertex, multiplied into {@link Mesh#tint}. Either packed RGBA8 (`Uint32Array`, the form the batchers read — no conversion) or one {@link Color} per vertex. Omit for plain white. Lets a single mesh carry a gradient — fading a terrain toward the sky with distance, darkening a crease — which a per-object `tint` cannot express. An explicit value wins over the colours a multi-material OBJ bakes from its MTL.
|
|
61
|
+
* @param {number[]|Float32Array} [settings.normals] - per-vertex normals for the lit path. An explicit value wins over the ones an OBJ or glTF source supplies; omit it and they are taken from the model, or generated from the geometry when the mesh is `lit`. Generated normals average per vertex where faces share vertices (smooth shading) and equal the face normal where they do not (flat shading) — the geometry decides, not a flag.
|
|
61
62
|
* @param {number[]|Float32Array} [settings.specular] - specular color `[r, g, b]` (0..1) for the lit path. Set by the OBJ loader from MTL `Ks`, and derived from glTF metallic/roughness.
|
|
62
63
|
* @param {number} [settings.shininess=0] - specular exponent for the lit path (MTL `Ns`). `0` for a fully diffuse surface.
|
|
63
64
|
* @param {string|TextureAtlas|HTMLImageElement} [settings.alphaMap] - per-texel opacity map, sampled in addition to the diffuse texture (MTL `map_d`).
|
|
64
65
|
* @param {boolean} [settings.castGroundShadow] - give this mesh a blob ground shadow, overriding the application's `castGroundShadow` setting in both directions. Omit to inherit. Needs a GPU backend and a `Camera3d`.
|
|
66
|
+
* @param {boolean} [settings.transparent] - draw in the transparent pass (blended, back-to-front, no depth write). Omit and a mesh goes transparent whenever its draw alpha is fractional; `true` for soft-alpha textures; `false` to stay opaque however faded
|
|
67
|
+
* @param {boolean} [settings.fog] - set `false` to exempt this mesh from the camera's distance fog ({@link Camera3d#setFog}); omit to fog whenever the camera does
|
|
65
68
|
* @param {number} [settings.shadowGroundY] - world Y of the floor the shadow lands on. Omit and the blob sits at the object's own base at full strength; set it and the blob shrinks and fades as the object rises. Render space is Y-down, so the floor is a **greater** Y than the object above it.
|
|
66
69
|
* @param {number} [settings.shadowOpacity=0.45] - opacity of the shadow directly beneath the object, before any height fade.
|
|
67
70
|
* @example
|
|
@@ -127,11 +130,14 @@ export default class Mesh extends Renderable {
|
|
|
127
130
|
alphaCutoff?: number | undefined;
|
|
128
131
|
emissive?: number[] | Float32Array<ArrayBufferLike> | undefined;
|
|
129
132
|
lit?: boolean | undefined;
|
|
133
|
+
vertexColors?: number[] | Uint32Array<ArrayBufferLike> | Color[] | undefined;
|
|
130
134
|
normals?: number[] | Float32Array<ArrayBufferLike> | undefined;
|
|
131
135
|
specular?: number[] | Float32Array<ArrayBufferLike> | undefined;
|
|
132
136
|
shininess?: number | undefined;
|
|
133
137
|
alphaMap?: string | HTMLImageElement | TextureAtlas | undefined;
|
|
134
138
|
castGroundShadow?: boolean | undefined;
|
|
139
|
+
transparent?: boolean | undefined;
|
|
140
|
+
fog?: boolean | undefined;
|
|
135
141
|
shadowGroundY?: number | undefined;
|
|
136
142
|
shadowOpacity?: number | undefined;
|
|
137
143
|
});
|
|
@@ -150,7 +156,6 @@ export default class Mesh extends Renderable {
|
|
|
150
156
|
* @type {number}
|
|
151
157
|
*/
|
|
152
158
|
vertexCount: number;
|
|
153
|
-
_indicesOriginal: number[];
|
|
154
159
|
/**
|
|
155
160
|
* the projected vertex positions.
|
|
156
161
|
*
|
|
@@ -268,6 +273,102 @@ export default class Mesh extends Renderable {
|
|
|
268
273
|
* @see Mesh#shadowGroundY
|
|
269
274
|
*/
|
|
270
275
|
castGroundShadow: boolean | undefined;
|
|
276
|
+
/**
|
|
277
|
+
* Whether this mesh is affected by the camera's distance fog
|
|
278
|
+
* ({@link Camera3d#setFog}).
|
|
279
|
+
*
|
|
280
|
+
* Left **unset** (`undefined`, the default) the mesh fogs whenever the
|
|
281
|
+
* camera drawing it has fog — which for a scene that never enables fog
|
|
282
|
+
* means never. Set it to `false` and this mesh is never fogged, however
|
|
283
|
+
* far away it is: the escape hatch for something that has to stay
|
|
284
|
+
* readable at any distance, such as an objective marker or a waypoint.
|
|
285
|
+
* `true` is accepted for symmetry and behaves as the default.
|
|
286
|
+
*
|
|
287
|
+
* It exempts the **mesh**, not the ground shadow it casts. A blob is a
|
|
288
|
+
* mark on the floor and fogs with the floor it lies on — one staying
|
|
289
|
+
* crisp under an object whose surroundings had dissolved would read as
|
|
290
|
+
* a fault rather than as emphasis. The blob quad is also shared by
|
|
291
|
+
* every caster in the scene, so it carries no per-object state to read.
|
|
292
|
+
*
|
|
293
|
+
* Emissive surfaces fog too — light travelling through fog is
|
|
294
|
+
* attenuated like anything else — so a neon sign that should punch
|
|
295
|
+
* through wants `fog: false` rather than a brighter emissive.
|
|
296
|
+
* @type {boolean|undefined}
|
|
297
|
+
* @default undefined
|
|
298
|
+
* @see Camera3d#setFog
|
|
299
|
+
* @example
|
|
300
|
+
* // the world fogs; this waypoint stays readable at any distance
|
|
301
|
+
* camera.setFog({ near: 1200, far: 7000 });
|
|
302
|
+
*
|
|
303
|
+
* const marker = new Mesh(0, 0, {
|
|
304
|
+
* ...beaconGeometry,
|
|
305
|
+
* emissive: [1, 0.6, 0],
|
|
306
|
+
* fog: false,
|
|
307
|
+
* });
|
|
308
|
+
* // or afterwards, on anything already built
|
|
309
|
+
* marker.fog = false;
|
|
310
|
+
*/
|
|
311
|
+
fog: boolean | undefined;
|
|
312
|
+
/**
|
|
313
|
+
* Whether this mesh draws in the **transparent pass** — blended,
|
|
314
|
+
* back-to-front, writing no depth — instead of the opaque one.
|
|
315
|
+
*
|
|
316
|
+
* Left **unset** (`undefined`, the default) the mesh goes transparent
|
|
317
|
+
* whenever the draw resolves to fractional alpha, so `setOpacity(0.5)`
|
|
318
|
+
* simply fades it. That is the useful default because the opaque path
|
|
319
|
+
* writes premultiplied colour with blending off: a faded mesh comes out
|
|
320
|
+
* *darkened toward black* rather than see-through, which is a defect
|
|
321
|
+
* rather than a contract — the fully transparent end of the same range
|
|
322
|
+
* used to paint an opaque black silhouette until it was fixed.
|
|
323
|
+
*
|
|
324
|
+
* Set it **`true`** when the transparency lives in the TEXTURE rather
|
|
325
|
+
* than in the opacity — a soft-edged glow, smoke, a glTF material with
|
|
326
|
+
* `alphaMode: "BLEND"`. The automatic check reads the draw's alpha and
|
|
327
|
+
* cannot see into the texture. The glTF loader does not set this for
|
|
328
|
+
* you: one loaded mesh can merge several materials, and this flag
|
|
329
|
+
* routes the whole mesh, so a `"BLEND"` material sharing geometry with
|
|
330
|
+
* an opaque one would drag the opaque half into the transparent pass.
|
|
331
|
+
* Note that `alphaCutoff` discards texels before blending sees them, so
|
|
332
|
+
* a soft edge needs a low cutoff (see {@link Sprite3d}, which lowers
|
|
333
|
+
* its default for exactly this). The cutoff thresholds the MATERIAL's
|
|
334
|
+
* alpha, not the drawn alpha, so a fading cutout mesh keeps its shape
|
|
335
|
+
* rather than disappearing at its own threshold.
|
|
336
|
+
*
|
|
337
|
+
* The pass composites premultiplied, which is what the mesh vertex
|
|
338
|
+
* stage always emits. A texture uploaded with straight alpha and drawn
|
|
339
|
+
* with `transparent: true` therefore reads slightly bright at its soft
|
|
340
|
+
* texels; upload it premultiplied (the default) and it is exact.
|
|
341
|
+
*
|
|
342
|
+
* {@link Renderable#blendMode} is honoured per entry, with one limit:
|
|
343
|
+
* the advanced modes (`"overlay"`, `"difference"`, and the rest that
|
|
344
|
+
* need a compositing pass) fall back to `"normal"` here on both
|
|
345
|
+
* backends, since the pass rasterizes directly into the target.
|
|
346
|
+
*
|
|
347
|
+
* Set it **`false`** to keep a mesh in the opaque pass however it is
|
|
348
|
+
* faded — it will darken rather than fade, and it will keep writing
|
|
349
|
+
* depth.
|
|
350
|
+
*
|
|
351
|
+
* Sorting is **per object**, by distance from the camera, so two
|
|
352
|
+
* intersecting or mutually enclosing transparent meshes may pop as the
|
|
353
|
+
* camera moves; split them, or accept it. Needs a GPU backend and a
|
|
354
|
+
* {@link Camera3d} — the 2D-camera path is unaffected.
|
|
355
|
+
* @type {boolean|undefined}
|
|
356
|
+
* @default undefined
|
|
357
|
+
* @see Renderable#blendMode
|
|
358
|
+
* @example
|
|
359
|
+
* // a ghost that fades in — nothing else needed
|
|
360
|
+
* ghost.setOpacity(0.4);
|
|
361
|
+
*
|
|
362
|
+
* // a glow that blends at full opacity, and additively
|
|
363
|
+
* const glow = new Mesh(0, 0, {
|
|
364
|
+
* ...quad,
|
|
365
|
+
* texture: glowTexture,
|
|
366
|
+
* transparent: true,
|
|
367
|
+
* blendMode: "additive",
|
|
368
|
+
* alphaCutoff: 0,
|
|
369
|
+
* });
|
|
370
|
+
*/
|
|
371
|
+
transparent: boolean | undefined;
|
|
271
372
|
/**
|
|
272
373
|
* World Y of the floor the shadow lands on, or `undefined` (the
|
|
273
374
|
* default) to mean "this object is standing on the ground" — the
|
|
@@ -293,17 +394,6 @@ export default class Mesh extends Renderable {
|
|
|
293
394
|
* @default 0.45
|
|
294
395
|
*/
|
|
295
396
|
shadowOpacity: number;
|
|
296
|
-
/**
|
|
297
|
-
* Cached horizontal half-extent used to size the shadow, resolved on
|
|
298
|
-
* first shadowed draw. Cached because the alternative is a
|
|
299
|
-
* `getBounds3d()` per frame per shadow, which re-bounds every source
|
|
300
|
-
* vertex through the model matrix.
|
|
301
|
-
* @ignore
|
|
302
|
-
*/
|
|
303
|
-
_shadowHalfX: number;
|
|
304
|
-
_shadowHalfZ: number;
|
|
305
|
-
_shadowGeomVersion: number;
|
|
306
|
-
_shadowHasHeight: boolean;
|
|
307
397
|
/**
|
|
308
398
|
* whether to cull back-facing triangles
|
|
309
399
|
* @type {boolean}
|
|
@@ -377,9 +467,15 @@ export default class Mesh extends Renderable {
|
|
|
377
467
|
* material has its own dedup scope in the OBJ parser), so
|
|
378
468
|
* every vertex belongs to exactly one material group and
|
|
379
469
|
* carries that group's color unambiguously.
|
|
380
|
-
*
|
|
470
|
+
*
|
|
471
|
+
* This is also what `settings.vertexColors` and
|
|
472
|
+
* {@link Mesh#setVertexColor} populate, so procedural geometry
|
|
473
|
+
* can carry a gradient a per-object `tint` cannot express.
|
|
474
|
+
* `undefined` when every vertex is plain white.
|
|
475
|
+
* @type {Uint32Array|undefined}
|
|
476
|
+
* @see Mesh#setVertexColor
|
|
381
477
|
*/
|
|
382
|
-
vertexColors: Uint32Array;
|
|
478
|
+
vertexColors: Uint32Array | undefined;
|
|
383
479
|
texture: any;
|
|
384
480
|
/**
|
|
385
481
|
* Index ranges that each need their own diffuse texture bound, for a
|
|
@@ -430,23 +526,6 @@ export default class Mesh extends Renderable {
|
|
|
430
526
|
* @type {Matrix3d}
|
|
431
527
|
*/
|
|
432
528
|
projectionMatrix: Matrix3d;
|
|
433
|
-
/** @ignore */
|
|
434
|
-
_anchorBaked: boolean;
|
|
435
|
-
/** @ignore */
|
|
436
|
-
_hullPoints: Vector2d[];
|
|
437
|
-
/** @ignore */
|
|
438
|
-
_hullPolygon: Polygon | null;
|
|
439
|
-
/** @ignore */
|
|
440
|
-
_geometryVersion: number;
|
|
441
|
-
/**
|
|
442
|
-
* Project all vertices through projectionMatrix × currentTransform
|
|
443
|
-
* and store the results in `this.vertices`.
|
|
444
|
-
* @param {number} [offsetX=0] - x offset added to each projected vertex
|
|
445
|
-
* @param {number} [offsetY=0] - y offset added to each projected vertex
|
|
446
|
-
* @param {number} [zScale=0] - scale factor for Z output (0 = skip Z, 1000 = depth buffer range)
|
|
447
|
-
* @ignore
|
|
448
|
-
*/
|
|
449
|
-
_projectVertices(offsetX?: number, offsetY?: number, zScale?: number): void;
|
|
450
529
|
/**
|
|
451
530
|
* Signal that this mesh's geometry itself has changed — its vertices, UVs,
|
|
452
531
|
* indices, normals or per-vertex colours were edited in place.
|
|
@@ -463,80 +542,29 @@ export default class Mesh extends Renderable {
|
|
|
463
542
|
*/
|
|
464
543
|
set needsUpdate(value: any);
|
|
465
544
|
/**
|
|
466
|
-
*
|
|
467
|
-
* geometry sits in the world.
|
|
545
|
+
* Set one vertex's colour, multiplied into {@link Mesh#tint}.
|
|
468
546
|
*
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
*
|
|
547
|
+
* The mesh starts carrying per-vertex colour on the first call — every
|
|
548
|
+
* other vertex is white until coloured, so a mesh built without
|
|
549
|
+
* `settings.vertexColors` looks unchanged until you touch it.
|
|
472
550
|
*
|
|
473
|
-
*
|
|
551
|
+
* Out-of-range indices are ignored rather than throwing, matching
|
|
552
|
+
* {@link InstancedMesh#setInstanceColor}.
|
|
474
553
|
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
* @
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
* perspective that's meaningful only under Camera2d) and emits
|
|
488
|
-
* vertices that the active 3D camera then projects via its own
|
|
489
|
-
* view + projection matrices, the same way it does for Sprites.
|
|
490
|
-
*
|
|
491
|
-
* Per-vertex math: `currentTransform × originalVertex`, then a uniform
|
|
492
|
-
* scale by `this.width`, the Y-up→Y-down bridge (negate Y, and also Z when
|
|
493
|
-
* {@link Mesh#rightHanded} is set so the bridge is a rotation rather than a
|
|
494
|
-
* mirror), and a translate to `(offsetX, offsetY, offsetZ)`.
|
|
495
|
-
*
|
|
496
|
-
* @param {number} offsetX - world X to place the mesh center at
|
|
497
|
-
* @param {number} offsetY - world Y to place the mesh center at
|
|
498
|
-
* @param {number} offsetZ - world Z to place the mesh center at
|
|
499
|
-
* @ignore
|
|
500
|
-
*/
|
|
501
|
-
_projectVerticesWorld(offsetX: number, offsetY: number, offsetZ: number): void;
|
|
502
|
-
/**
|
|
503
|
-
* Project {@link Mesh#originalNormals} into world space for lit shading,
|
|
504
|
-
* storing the result in {@link Mesh#normals}. Applies the rotation/scale of
|
|
505
|
-
* {@link Renderable#currentTransform} (no translation), the same Y-down /
|
|
506
|
-
* `rightHanded` Y/Z bridge as {@link Mesh#_projectVerticesWorld}, then
|
|
507
|
-
* renormalizes. No-op when the mesh has no source normals.
|
|
508
|
-
*
|
|
509
|
-
* Note: uses the transform's rotation/scale columns directly rather than
|
|
510
|
-
* the inverse-transpose, so normals are exact under rotation + uniform
|
|
511
|
-
* scale (the common case); a strongly non-uniform scale would skew them
|
|
512
|
-
* slightly — acceptable for the diffuse lighting path.
|
|
513
|
-
* @ignore
|
|
514
|
-
*/
|
|
515
|
-
_projectNormalsWorld(): void;
|
|
516
|
-
/**
|
|
517
|
-
* Build the winding-reversed indices buffer used by the Camera3d
|
|
518
|
-
* world-space path. Called once, lazily, the first time the mesh
|
|
519
|
-
* draws under Camera3d. Why: the world-space path Y-flips vertices
|
|
520
|
-
* on output (a reflection, det = -1), which inverts triangle
|
|
521
|
-
* winding in screen space. Without the swap, `cullBackFaces: true`
|
|
522
|
-
* would end up culling the front faces and the model would look
|
|
523
|
-
* hollow.
|
|
524
|
-
*
|
|
525
|
-
* Both buffers are kept alive — `_indicesOriginal` is the original
|
|
526
|
-
* OBJ-shared (or user-supplied) winding, `_indicesReversed` is the
|
|
527
|
-
* Camera3d-flipped copy. `draw()` swaps `this.indices` between them
|
|
528
|
-
* each frame based on the active camera, so a Mesh that was first
|
|
529
|
-
* drawn under Camera3d and later re-parented to a Camera2d stage
|
|
530
|
-
* (e.g. a level transition into a 2D minigame) gets its original
|
|
531
|
-
* winding back and stays correctly oriented under
|
|
532
|
-
* `cullBackFaces: true`.
|
|
533
|
-
* @param {boolean} [needsReversedIndices=true] - build the winding-reversed index copy. `false` on the retained path, which corrects winding with `frontFace` and would otherwise duplicate the index array for nothing.
|
|
534
|
-
* @ignore
|
|
554
|
+
* Bumps {@link Mesh#needsUpdate} for you: the retained `Camera3d` path
|
|
555
|
+
* uploads geometry once and compares the version, so a colour written
|
|
556
|
+
* without it would apply on the immediate path and silently not on the
|
|
557
|
+
* retained one.
|
|
558
|
+
* @param {number} index - the vertex to colour
|
|
559
|
+
* @param {Color} color - the vertex colour
|
|
560
|
+
* @example
|
|
561
|
+
* // fade a procedural terrain toward the sky with distance
|
|
562
|
+
* for (let i = 0; i < mesh.vertexCount; i++) {
|
|
563
|
+
* const t = Math.min(1, mesh.originalVertices[i * 3 + 2] / 6000);
|
|
564
|
+
* mesh.setVertexColor(i, haze.copy(ground).lerp(sky, t));
|
|
565
|
+
* }
|
|
535
566
|
*/
|
|
536
|
-
|
|
537
|
-
_indicesReversed: any;
|
|
538
|
-
_worldSpace: boolean | undefined;
|
|
539
|
-
_useWorldSpace: boolean | undefined;
|
|
567
|
+
setVertexColor(index: number, color: Color): void;
|
|
540
568
|
/**
|
|
541
569
|
* The mesh's world-space 3D axis-aligned bounding box. This is the 3D analog
|
|
542
570
|
* of {@link Renderable#getBounds} (which returns a flat 2D box from
|
|
@@ -552,39 +580,6 @@ export default class Mesh extends Renderable {
|
|
|
552
580
|
* @returns {AABB3d} the world-space bounding box (reused instance)
|
|
553
581
|
*/
|
|
554
582
|
getBounds3d(): AABB3d;
|
|
555
|
-
/** @ignore */
|
|
556
|
-
_bounds3d: AABB3d | undefined;
|
|
557
|
-
/**
|
|
558
|
-
* Whether this mesh casts a ground shadow on this draw (#1515).
|
|
559
|
-
*
|
|
560
|
-
* Precedence, most specific first: the mesh's own `castGroundShadow`, then
|
|
561
|
-
* the application's `castGroundShadow` setting. A per-mesh value is an
|
|
562
|
-
* explicit instruction and is obeyed as given; the application default is a
|
|
563
|
-
* blanket one, so it skips meshes with no vertical extent — which is what a
|
|
564
|
-
* ground plane is, and a flat plane lying on the floor has nothing to cast.
|
|
565
|
-
* Read off the renderer rather than the global application instance, the
|
|
566
|
-
* same way the `textureFilter` default is.
|
|
567
|
-
* @param {WebGLRenderer|WebGPURenderer} renderer - the active renderer
|
|
568
|
-
* @returns {boolean} true if a shadow should be drawn
|
|
569
|
-
* @ignore
|
|
570
|
-
*/
|
|
571
|
-
_castsGroundShadow(renderer: WebGLRenderer | WebGPURenderer): boolean;
|
|
572
|
-
/**
|
|
573
|
-
* Measure the model-space footprint the blob is built from, and whether the
|
|
574
|
-
* geometry has any height at all — once per geometry version.
|
|
575
|
-
* @ignore
|
|
576
|
-
*/
|
|
577
|
-
_measureShadowFootprint(): void;
|
|
578
|
-
/**
|
|
579
|
-
* Draw this mesh's ground shadow: the shared blob quad, flattened onto the
|
|
580
|
-
* ground plane beneath the object (#1515).
|
|
581
|
-
*
|
|
582
|
-
* The quad is shared by every shadow in the scene and its geometry is
|
|
583
|
-
* uploaded once, so this is one draw and no allocation.
|
|
584
|
-
* @param {WebGLRenderer} renderer - the active renderer
|
|
585
|
-
* @ignore
|
|
586
|
-
*/
|
|
587
|
-
_drawGroundShadow(renderer: WebGLRenderer): void;
|
|
588
583
|
/**
|
|
589
584
|
* Render the mesh at its current state (transforms, projection, tint) to an offscreen canvas.
|
|
590
585
|
* The returned canvas can be used with `renderer.drawImage()`, as a `Sprite` image source,
|
|
@@ -608,12 +603,6 @@ export default class Mesh extends Renderable {
|
|
|
608
603
|
* const sprite = new me.Sprite(100, 100, { image: bitmap });
|
|
609
604
|
*/
|
|
610
605
|
toImageBitmap(): Promise<ImageBitmap>;
|
|
611
|
-
/**
|
|
612
|
-
* Release this mesh's GPU-resident geometry, if a renderer is holding any,
|
|
613
|
-
* then destroy the renderable.
|
|
614
|
-
* @ignore
|
|
615
|
-
*/
|
|
616
|
-
destroy(): void;
|
|
617
606
|
}
|
|
618
607
|
import Renderable from "./renderable.js";
|
|
619
608
|
import { TextureAtlas } from "./../video/texture/atlas.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesh.d.ts","sourceRoot":"","sources":["../../src/renderable/mesh.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mesh.d.ts","sourceRoot":"","sources":["../../src/renderable/mesh.js"],"names":[],"mappings":"AA4QA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2EG;IACH,eA3EW,MAAM,KACN,MAAM,YAEd;QAA0B,KAAK;QACU,QAAQ;QACR,GAAG;QACJ,OAAO;QACS,OAAO;QACrC,QAAQ;QACT,KAAK,EAAtB,MAAM;QACY,MAAM;QACL,aAAa;QACb,SAAS;QACV,KAAK;QACJ,WAAW;QACZ,aAAa;QACb,aAAa;QACb,WAAW;QACI,QAAQ;QACtB,GAAG;QACkB,YAAY;QACnB,OAAO;QACP,QAAQ;QACvB,SAAS;QACqB,QAAQ;QACrC,gBAAgB;QAChB,WAAW;QACX,GAAG;QACJ,aAAa;QACb,aAAa;KACvC,EA80BF;IApxBC;;;OAGG;IACH,kBAFU,YAAY,CAEkB;IAExC;;;OAGG;IACH,KAFU,YAAY,CAEA;IAqBtB;;;OAGG;IACH,aAFU,MAAM,CAEsB;IAmCvC;;;OAGG;IACH,2BAAoC;IAIpC;;;;;;;;;;;;;;OAcG;IACH,UAFU,YAAY,CAEgC;IAEtD;;;;;OAKG;IACH,iBAFU,YAAY,GAAC,SAAS,CAclB;IAcd;;;;;;;;;OASG;IACH,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AJW,aAAa,QAoJvB;IA0ID;;;;;;;;;;;;OAYG;IACH,YATa,iBAAiB,CAoH7B;IAED;;;;;;;OAOG;IACH,iBALa,OAAO,CAAC,WAAW,CAAC,CAOhC;IAED;;;;;OAKG;IACH,gBAMC;CACD;uBAniEsB,iBAAiB;6BAHX,6BAA6B;sBAXpC,kBAAkB;yBACf,qBAAqB;yBACrB,qBAAqB;wBALtB,0BAA0B;uBAY3B,iCAAiC;+BAU1B,oCAAoC"}
|
|
@@ -65,10 +65,6 @@ export default class NineSliceSprite extends Sprite {
|
|
|
65
65
|
nss_height: number;
|
|
66
66
|
insetx: number | undefined;
|
|
67
67
|
insety: number | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* @ignore
|
|
70
|
-
*/
|
|
71
|
-
draw(renderer: any): void;
|
|
72
68
|
}
|
|
73
69
|
import Sprite from "./sprite.js";
|
|
74
70
|
import type { TextureAtlas } from "./../video/texture/atlas.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nineslicesprite.d.ts","sourceRoot":"","sources":["../../src/renderable/nineslicesprite.js"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,eAxBW,MAAM,KACN,MAAM,YAEd;QAAyB,KAAK,EAAtB,MAAM;QACW,MAAM,EAAvB,MAAM;QACY,MAAM;QACN,MAAM;QACyD,KAAK,EAAtF,gBAAgB,GAAC,iBAAiB,GAAC,YAAY,GAAC,eAAe,GAAC,MAAM;QACpD,IAAI;QACJ,MAAM;QACN,UAAU;QACV,WAAW;QACL,IAAI;QACV,KAAK;QACL,KAAK;QACwB,WAAW,GAA1D,MAAM,GAAC,QAAQ,GAAC;YAAC,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAA;SAAC;KAC3C,EA8BF;IASD,iBALU,MAAM,EAOf;IATD;;;OAGG;IACH,aAFU,MAAM,CAIf;IAYD,kBALU,MAAM,EAOf;IATD;;;OAGG;IACH,cAFU,MAAM,CAIf;IAxBA,kBAA2B;IAC3B,mBAA6B;IAE7B,2BAA6B;IAC7B,2BAA6B;
|
|
1
|
+
{"version":3,"file":"nineslicesprite.d.ts","sourceRoot":"","sources":["../../src/renderable/nineslicesprite.js"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,eAxBW,MAAM,KACN,MAAM,YAEd;QAAyB,KAAK,EAAtB,MAAM;QACW,MAAM,EAAvB,MAAM;QACY,MAAM;QACN,MAAM;QACyD,KAAK,EAAtF,gBAAgB,GAAC,iBAAiB,GAAC,YAAY,GAAC,eAAe,GAAC,MAAM;QACpD,IAAI;QACJ,MAAM;QACN,UAAU;QACV,WAAW;QACL,IAAI;QACV,KAAK;QACL,KAAK;QACwB,WAAW,GAA1D,MAAM,GAAC,QAAQ,GAAC;YAAC,CAAC,EAAC,MAAM,CAAC;YAAA,CAAC,EAAC,MAAM,CAAA;SAAC;KAC3C,EA8BF;IASD,iBALU,MAAM,EAOf;IATD;;;OAGG;IACH,aAFU,MAAM,CAIf;IAYD,kBALU,MAAM,EAOf;IATD;;;OAGG;IACH,cAFU,MAAM,CAIf;IAxBA,kBAA2B;IAC3B,mBAA6B;IAE7B,2BAA6B;IAC7B,2BAA6B;IAmD9B;;;OAGG;IACH,0BA6EC;CACD;mBA7MkB,aAAa;kCAKC,6BAA6B;2BADtC,oBAAoB"}
|
|
@@ -241,11 +241,6 @@ export default class Renderable extends Rect {
|
|
|
241
241
|
* mySprite.postEffects = [new SepiaEffect(renderer), new VignetteEffect(renderer)];
|
|
242
242
|
*/
|
|
243
243
|
postEffects: Array<GLShader | ShaderEffect>;
|
|
244
|
-
/**
|
|
245
|
-
* whether this renderable manages its own FBO lifecycle (e.g. Camera2d)
|
|
246
|
-
* @ignore
|
|
247
|
-
*/
|
|
248
|
-
_postEffectManaged: boolean;
|
|
249
244
|
/**
|
|
250
245
|
* the blend mode to be applied to this renderable — any of the modes
|
|
251
246
|
* listed on {@link CanvasRenderer#setBlendMode}, honoured identically by
|
|
@@ -262,45 +257,12 @@ export default class Renderable extends Rect {
|
|
|
262
257
|
* @default ""
|
|
263
258
|
*/
|
|
264
259
|
name: string;
|
|
265
|
-
/**
|
|
266
|
-
* to identify the object as a renderable object
|
|
267
|
-
* @ignore
|
|
268
|
-
*/
|
|
269
|
-
isRenderable: boolean;
|
|
270
260
|
/**
|
|
271
261
|
* If true then physic collision and input events will not impact this renderable
|
|
272
262
|
* @type {boolean}
|
|
273
263
|
* @default true
|
|
274
264
|
*/
|
|
275
265
|
isKinematic: boolean;
|
|
276
|
-
/**
|
|
277
|
-
* cache the absolute position of the renderable
|
|
278
|
-
* @ignore
|
|
279
|
-
*/
|
|
280
|
-
_absPos: import("../index.ts").Vector3d | undefined;
|
|
281
|
-
/**
|
|
282
|
-
* keep track of when we flip
|
|
283
|
-
* @ignore
|
|
284
|
-
*/
|
|
285
|
-
_flip: {
|
|
286
|
-
x: boolean;
|
|
287
|
-
y: boolean;
|
|
288
|
-
};
|
|
289
|
-
/**
|
|
290
|
-
* viewport flag
|
|
291
|
-
* @ignore
|
|
292
|
-
*/
|
|
293
|
-
_inViewport: boolean;
|
|
294
|
-
/**
|
|
295
|
-
* cache value for the parentApp
|
|
296
|
-
* @ignore
|
|
297
|
-
*/
|
|
298
|
-
_parentApp: any;
|
|
299
|
-
/**
|
|
300
|
-
* renderable cache tint value used by the getter/setter
|
|
301
|
-
* @ignore
|
|
302
|
-
*/
|
|
303
|
-
_tint: import("../index.ts").Color;
|
|
304
266
|
/**
|
|
305
267
|
* returns the parent application (or game) to which this renderable is attached to
|
|
306
268
|
* @return {Application} the parent application or undefined if not attached to any container/app
|
|
@@ -664,12 +626,7 @@ export default class Renderable extends Rect {
|
|
|
664
626
|
* return true;
|
|
665
627
|
* }
|
|
666
628
|
*/
|
|
667
|
-
onCollision(
|
|
668
|
-
/**
|
|
669
|
-
* Destroy function<br>
|
|
670
|
-
* @ignore
|
|
671
|
-
*/
|
|
672
|
-
destroy(...args: any[]): void;
|
|
629
|
+
onCollision(response: import("../physics/response.js").default, other: Renderable): boolean;
|
|
673
630
|
/**
|
|
674
631
|
* OnDestroy Notification function<br>
|
|
675
632
|
* Called by engine before deleting the object. Receives whatever
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderable.d.ts","sourceRoot":"","sources":["../../src/renderable/renderable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderable.d.ts","sourceRoot":"","sources":["../../src/renderable/renderable.js"],"names":[],"mappings":"AA6CA;;;GAGG;AACH;IAkBG,iBAAmB;IAGpB;;;;;;;;;;;;;;;OAeG;IACH,aAHU,eAAe,CAMvB;IAGD;;;;;;;OAOG;IACH,kBAFU,QAAQ,CAEoB;IAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,MAlCU,WAAW,CAkCA;IAErB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAHU,MAAM,GAAC,SAAS,CAGF;IAExB;;;;;OAKG;IACH,MAFU,MAAM,CAEK;IAErB;;;;;;;;;;OAUG;IACH,6BAAmC;IAEnC;;;;OAIG;IACH,cAHU,OAAO,CAGQ;IAEzB;;;;OAIG;IACH,kBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,cAHU,OAAO,CAGQ;IAEzB;;;;;OAKG;IACH,UAHU,OAAO,CAGI;IAErB;;;;;;;OAOG;IACH,qBAHU,OAAO,CAGe;IAEhC;;;;;;;;;;;;;;;;OAgBG;IACH,eAdU,OAAO,CAcQ;IAEzB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBAJU,OAAO,CAIe;IAEhC;;;;;;;OAOG;IACH,OAHU,MAAM,CAGA;IAEhB;;;;OAIG;IACH,UAHU,SAAS,GAAC,MAAM,CAGD;IAEzB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAlBU,IAAI,GAAC,SAA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AFW,cAAc,GAAC,aAAa,QAqBtC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IAEH,sBAfW,OAAO,wBAAwB,EAAE,OAAO,SACxC,UAAU,GACR,OAAO,CAqBnB;IAkCD;;;;OAIG;IACH,8BA6DC;IAED;;;;;;;OAOG;IACH,yBAFc,GAAC,EAAA,QAId;IAED;;;;;;;;OAQG;IACH,0BAHc,GAAC,EAAA,QAKd;IAED;;;;;;;OAOG;IACH,4BAHc,GAAC,EAAA,QAKd;CACD;qBA50CoB,8BAA8B;gCADnB,kCAAkC;yBAKzC,qBAAqB;2BAWpB,gBAAgB;wBADnB,oBAAoB;+BAKf,8BAA8B;6BADhC,0BAA0B;0BAF7B,yBAAyB;6BACtB,4BAA4B;6BAG1B,iCAAiC;gCAC9B,sCAAsC;+BACvC,oCAAoC"}
|
|
@@ -66,7 +66,6 @@ export default class Sprite extends Renderable {
|
|
|
66
66
|
} | undefined;
|
|
67
67
|
normalMap?: string | ImageBitmap | HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | Texture2d | undefined;
|
|
68
68
|
});
|
|
69
|
-
_frameAnim: FrameAnimation;
|
|
70
69
|
/**
|
|
71
70
|
* global offset for the position to draw from on the source image.
|
|
72
71
|
* @type {Vector2d}
|
|
@@ -89,22 +88,6 @@ export default class Sprite extends Renderable {
|
|
|
89
88
|
* @type {TextureAtlas}
|
|
90
89
|
*/
|
|
91
90
|
source: TextureAtlas;
|
|
92
|
-
/**
|
|
93
|
-
* backing field for the `normalMap` accessor — see the getter/setter
|
|
94
|
-
* defined on the class for the public API and validation rules.
|
|
95
|
-
* @ignore
|
|
96
|
-
*/
|
|
97
|
-
_normalMap: ImageBitmap | HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | null;
|
|
98
|
-
/**
|
|
99
|
-
* flicker settings
|
|
100
|
-
* @ignore
|
|
101
|
-
*/
|
|
102
|
-
_flicker: {
|
|
103
|
-
isFlickering: boolean;
|
|
104
|
-
duration: number;
|
|
105
|
-
callback: null;
|
|
106
|
-
elapsed: number;
|
|
107
|
-
};
|
|
108
91
|
image: any;
|
|
109
92
|
textureAtlas: any;
|
|
110
93
|
width: any;
|
|
@@ -116,13 +99,6 @@ export default class Sprite extends Renderable {
|
|
|
116
99
|
* @default false
|
|
117
100
|
*/
|
|
118
101
|
get animationpause(): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* pause the video when losing focus
|
|
121
|
-
* @ignore
|
|
122
|
-
*/
|
|
123
|
-
removeStatePauseListener: (() => void) | undefined;
|
|
124
|
-
_lastVideoFrameVersion: number | undefined;
|
|
125
|
-
_videoFrameHandle: any;
|
|
126
102
|
set normalMap(value: HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap | null);
|
|
127
103
|
/**
|
|
128
104
|
* The optional normal-map image paired with this sprite's color
|
|
@@ -312,14 +288,6 @@ export default class Sprite extends Renderable {
|
|
|
312
288
|
* mySprite.setRegion(mytexture.getRegion("shadedDark13.png"));
|
|
313
289
|
*/
|
|
314
290
|
setRegion(region: object): Sprite;
|
|
315
|
-
/**
|
|
316
|
-
* Apply the current frame's texture region to this sprite's geometry: swap
|
|
317
|
-
* the source sub-texture, then resolve size / anchor (honoring trimming).
|
|
318
|
-
* Invoked by the shared {@link FrameAnimation} engine via `setRegion`.
|
|
319
|
-
* @param {object} region - the texture region object
|
|
320
|
-
* @ignore
|
|
321
|
-
*/
|
|
322
|
-
_applyFrame(region: object): void;
|
|
323
291
|
/**
|
|
324
292
|
* force the current animation frame index.
|
|
325
293
|
* @param {number} [index=0] - animation frame index
|
|
@@ -334,13 +302,6 @@ export default class Sprite extends Renderable {
|
|
|
334
302
|
* @returns {number} current animation frame index
|
|
335
303
|
*/
|
|
336
304
|
getCurrentAnimationFrame(): number;
|
|
337
|
-
/**
|
|
338
|
-
* Returns the frame object by the index.
|
|
339
|
-
* @ignore
|
|
340
|
-
* @param {number} id - the frame id
|
|
341
|
-
* @returns {number} if using number indices. Returns {object} containing frame data if using texture atlas
|
|
342
|
-
*/
|
|
343
|
-
getAnimationFrameObjectByIndex(id: number): number;
|
|
344
305
|
/**
|
|
345
306
|
* Prepare the rendering context before drawing this sprite (automatically called by melonJS).
|
|
346
307
|
* Extends `Renderable.preDraw` to publish this sprite's `normalMap` (if any)
|
|
@@ -357,14 +318,8 @@ export default class Sprite extends Renderable {
|
|
|
357
318
|
/**
|
|
358
319
|
* draw this sprite (automatically called by melonJS)
|
|
359
320
|
* @param {Renderer} renderer - a renderer instance
|
|
360
|
-
* @param {Camera2d} [viewport] - the viewport to (re)draw
|
|
361
321
|
*/
|
|
362
322
|
draw(renderer: Renderer): void;
|
|
363
|
-
/**
|
|
364
|
-
* Destroy function<br>
|
|
365
|
-
* @ignore
|
|
366
|
-
*/
|
|
367
|
-
destroy(): void;
|
|
368
323
|
}
|
|
369
324
|
import Renderable from "./renderable.js";
|
|
370
325
|
import FrameAnimation from "./frameAnimation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprite.d.ts","sourceRoot":"","sources":["../../src/renderable/sprite.js"],"names":[],"mappings":"AAcA;;;;GAIG;AAEH;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACH,eA1CW,MAAM,KACN,MAAM,YAEd;QAAoH,KAAK,EAAjH,gBAAgB,GAAC,iBAAiB,GAAC,gBAAgB,GAAC,SAAS,GAAC,YAAY,GAAC,eAAe,GAAC,MAAM;QAC/E,IAAI;QACJ,MAAM;QACN,UAAU;QACV,WAAW;QACL,IAAI;QACV,KAAK;QACL,KAAK;QACwB,WAAW;eAAvC,MAAM;eAAG,MAAM;;QACyD,SAAS;KAC5G,
|
|
1
|
+
{"version":3,"file":"sprite.d.ts","sourceRoot":"","sources":["../../src/renderable/sprite.js"],"names":[],"mappings":"AAcA;;;;GAIG;AAEH;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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