melonjs 20.2.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 +86 -8
- package/build/application/application.d.ts +0 -17
- package/build/application/application.d.ts.map +1 -1
- package/build/application/settings.d.ts +6 -2
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +2 -2
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/backend/buffer.d.ts +26 -0
- package/build/audio/backend/buffer.d.ts.map +1 -0
- package/build/audio/backend/cache.d.ts +2 -0
- package/build/audio/backend/cache.d.ts.map +1 -0
- package/build/audio/backend/core.d.ts +24 -0
- package/build/audio/backend/core.d.ts.map +1 -0
- package/build/audio/backend/engine.d.ts +35 -0
- package/build/audio/backend/engine.d.ts.map +1 -0
- package/build/audio/backend/sound.d.ts +29 -0
- package/build/audio/backend/sound.d.ts.map +1 -0
- package/build/audio/backend/spatial.d.ts +191 -0
- package/build/audio/backend/spatial.d.ts.map +1 -0
- package/build/audio/backend/types.d.ts +107 -0
- package/build/audio/backend/types.d.ts.map +1 -0
- package/build/audio/backend/voice.d.ts +8 -0
- package/build/audio/backend/voice.d.ts.map +1 -0
- package/build/audio/playback.d.ts +49 -4
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/procedural.d.ts.map +1 -1
- package/build/audio/state.d.ts +69 -0
- package/build/audio/state.d.ts.map +1 -0
- package/build/audio/types.d.ts +93 -1
- package/build/audio/types.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 +91 -84
- 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/const.d.ts +2 -2
- 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 +12150 -11289
- package/build/index.js.map +4 -4
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/input/input.d.ts +19 -0
- package/build/input/input.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 +4 -2
- 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 +13 -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 +46 -73
- 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 +2 -0
- package/build/loader/parsers/audio.d.ts.map +1 -0
- 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/adapter.d.ts +3 -3
- 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 +5 -69
- 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/plugin/plugin.d.ts +9 -1
- package/build/plugin/plugin.d.ts.map +1 -1
- package/build/polyfill/index.d.ts +1 -4
- package/build/polyfill/index.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 +145 -140
- 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 +17 -54
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +7 -52
- 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 +4 -68
- 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/event.d.ts +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 +21 -2
- 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 +2 -0
- package/build/utils/fetchdata.d.ts.map +1 -0
- 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 +7 -25
- 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/blur.d.ts +4 -4
- package/build/video/effects/blur.d.ts.map +1 -1
- package/build/video/effects/chromaticAberration.d.ts +5 -5
- package/build/video/effects/chromaticAberration.d.ts.map +1 -1
- package/build/video/effects/colorMatrix.d.ts +5 -15
- package/build/video/effects/colorMatrix.d.ts.map +1 -1
- package/build/video/effects/desaturate.d.ts +5 -5
- package/build/video/effects/desaturate.d.ts.map +1 -1
- package/build/video/effects/dissolve.d.ts +4 -4
- package/build/video/effects/dissolve.d.ts.map +1 -1
- package/build/video/effects/dropShadow.d.ts +5 -5
- package/build/video/effects/dropShadow.d.ts.map +1 -1
- package/build/video/effects/flash.d.ts +4 -4
- package/build/video/effects/flash.d.ts.map +1 -1
- package/build/video/effects/glow.d.ts +5 -5
- package/build/video/effects/glow.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/hologram.d.ts +4 -4
- package/build/video/effects/hologram.d.ts.map +1 -1
- package/build/video/effects/invert.d.ts +5 -5
- package/build/video/effects/invert.d.ts.map +1 -1
- package/build/video/effects/outline.d.ts +6 -6
- package/build/video/effects/outline.d.ts.map +1 -1
- package/build/video/effects/pixelate.d.ts +4 -4
- package/build/video/effects/pixelate.d.ts.map +1 -1
- package/build/video/effects/radialGradient.d.ts +2 -3
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/scanline.d.ts +6 -6
- package/build/video/effects/scanline.d.ts.map +1 -1
- package/build/video/effects/sepia.d.ts +5 -5
- package/build/video/effects/sepia.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +12 -123
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/shine.d.ts +3 -3
- package/build/video/effects/shine.d.ts.map +1 -1
- package/build/video/effects/tintPulse.d.ts +4 -4
- package/build/video/effects/tintPulse.d.ts.map +1 -1
- package/build/video/effects/vignette.d.ts +6 -6
- package/build/video/effects/vignette.d.ts.map +1 -1
- package/build/video/effects/wave.d.ts +4 -4
- package/build/video/effects/wave.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 +2 -76
- 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 +2 -51
- 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 +24 -286
- 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 +2 -89
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +8 -11
- package/skills/AGENTS.md +67 -0
- package/skills/melonjs/SKILL.md +156 -0
- package/skills/melonjs-20-migration/SKILL.md +160 -0
- package/skills/melonjs-3d/SKILL.md +525 -0
- package/skills/melonjs-3d-assets/SKILL.md +258 -0
- package/skills/melonjs-audio/SKILL.md +236 -0
- package/skills/melonjs-camera-and-drawing/SKILL.md +175 -0
- package/skills/melonjs-deployment/SKILL.md +113 -0
- package/skills/melonjs-effects-and-shaders/SKILL.md +178 -0
- package/skills/melonjs-events/SKILL.md +159 -0
- package/skills/melonjs-getting-started/SKILL.md +183 -0
- package/skills/melonjs-input/SKILL.md +166 -0
- package/skills/melonjs-lighting/SKILL.md +139 -0
- package/skills/melonjs-loading-assets/SKILL.md +186 -0
- package/skills/melonjs-particles-and-trails/SKILL.md +136 -0
- package/skills/melonjs-performance/SKILL.md +183 -0
- package/skills/melonjs-physics/SKILL.md +321 -0
- package/skills/melonjs-plugins/SKILL.md +191 -0
- package/skills/melonjs-renderables/SKILL.md +214 -0
- package/skills/melonjs-renderer-backends/SKILL.md +173 -0
- package/skills/melonjs-scenes-and-state/SKILL.md +180 -0
- package/skills/melonjs-sprites-and-animation/SKILL.md +173 -0
- package/skills/melonjs-tilemaps/SKILL.md +213 -0
- package/skills/melonjs-ui-and-text/SKILL.md +65 -0
- package/build/audio/backend.d.ts +0 -140
- package/build/audio/backend.d.ts.map +0 -1
- package/build/loader/parsers/fetchdata.d.ts +0 -32
- package/build/loader/parsers/fetchdata.d.ts.map +0 -1
|
@@ -56,6 +56,17 @@ export default class Mesh extends Renderable {
|
|
|
56
56
|
* @param {string} [settings.textureFilter] - texture magnification filter (`"nearest"` for crisp pixel-art upscaling, `"linear"` for smooth) applied to the resolved texture. Omit to keep the renderer's global `antiAlias` default. On the mesh path, linear filtering also samples a generated mip chain with trilinear minification and 4× anisotropy (distant geometry stops shimmering) — `"nearest"` opts out, keeping crisp pixel-art models on hard level-0 sampling. GPU backends only (ignored by the Canvas renderer).
|
|
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
|
+
* @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 {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.
|
|
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.
|
|
63
|
+
* @param {number} [settings.shininess=0] - specular exponent for the lit path (MTL `Ns`). `0` for a fully diffuse surface.
|
|
64
|
+
* @param {string|TextureAtlas|HTMLImageElement} [settings.alphaMap] - per-texel opacity map, sampled in addition to the diffuse texture (MTL `map_d`).
|
|
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
|
|
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.
|
|
69
|
+
* @param {number} [settings.shadowOpacity=0.45] - opacity of the shadow directly beneath the object, before any height fade.
|
|
59
70
|
* @example
|
|
60
71
|
* // create from OBJ + MTL (texture auto-resolved from material)
|
|
61
72
|
* let mesh = new me.Mesh(0, 0, {
|
|
@@ -118,6 +129,17 @@ export default class Mesh extends Renderable {
|
|
|
118
129
|
textureFilter?: string | undefined;
|
|
119
130
|
alphaCutoff?: number | undefined;
|
|
120
131
|
emissive?: number[] | Float32Array<ArrayBufferLike> | undefined;
|
|
132
|
+
lit?: boolean | undefined;
|
|
133
|
+
vertexColors?: number[] | Uint32Array<ArrayBufferLike> | Color[] | undefined;
|
|
134
|
+
normals?: number[] | Float32Array<ArrayBufferLike> | undefined;
|
|
135
|
+
specular?: number[] | Float32Array<ArrayBufferLike> | undefined;
|
|
136
|
+
shininess?: number | undefined;
|
|
137
|
+
alphaMap?: string | HTMLImageElement | TextureAtlas | undefined;
|
|
138
|
+
castGroundShadow?: boolean | undefined;
|
|
139
|
+
transparent?: boolean | undefined;
|
|
140
|
+
fog?: boolean | undefined;
|
|
141
|
+
shadowGroundY?: number | undefined;
|
|
142
|
+
shadowOpacity?: number | undefined;
|
|
121
143
|
});
|
|
122
144
|
/**
|
|
123
145
|
* the original (untransformed) vertex positions as x,y,z triplets
|
|
@@ -134,7 +156,6 @@ export default class Mesh extends Renderable {
|
|
|
134
156
|
* @type {number}
|
|
135
157
|
*/
|
|
136
158
|
vertexCount: number;
|
|
137
|
-
_indicesOriginal: number[];
|
|
138
159
|
/**
|
|
139
160
|
* the projected vertex positions.
|
|
140
161
|
*
|
|
@@ -252,6 +273,102 @@ export default class Mesh extends Renderable {
|
|
|
252
273
|
* @see Mesh#shadowGroundY
|
|
253
274
|
*/
|
|
254
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;
|
|
255
372
|
/**
|
|
256
373
|
* World Y of the floor the shadow lands on, or `undefined` (the
|
|
257
374
|
* default) to mean "this object is standing on the ground" — the
|
|
@@ -277,17 +394,6 @@ export default class Mesh extends Renderable {
|
|
|
277
394
|
* @default 0.45
|
|
278
395
|
*/
|
|
279
396
|
shadowOpacity: number;
|
|
280
|
-
/**
|
|
281
|
-
* Cached horizontal half-extent used to size the shadow, resolved on
|
|
282
|
-
* first shadowed draw. Cached because the alternative is a
|
|
283
|
-
* `getBounds3d()` per frame per shadow, which re-bounds every source
|
|
284
|
-
* vertex through the model matrix.
|
|
285
|
-
* @ignore
|
|
286
|
-
*/
|
|
287
|
-
_shadowHalfX: number;
|
|
288
|
-
_shadowHalfZ: number;
|
|
289
|
-
_shadowGeomVersion: number;
|
|
290
|
-
_shadowHasHeight: boolean;
|
|
291
397
|
/**
|
|
292
398
|
* whether to cull back-facing triangles
|
|
293
399
|
* @type {boolean}
|
|
@@ -361,9 +467,15 @@ export default class Mesh extends Renderable {
|
|
|
361
467
|
* material has its own dedup scope in the OBJ parser), so
|
|
362
468
|
* every vertex belongs to exactly one material group and
|
|
363
469
|
* carries that group's color unambiguously.
|
|
364
|
-
*
|
|
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
|
|
365
477
|
*/
|
|
366
|
-
vertexColors: Uint32Array;
|
|
478
|
+
vertexColors: Uint32Array | undefined;
|
|
367
479
|
texture: any;
|
|
368
480
|
/**
|
|
369
481
|
* Index ranges that each need their own diffuse texture bound, for a
|
|
@@ -414,23 +526,6 @@ export default class Mesh extends Renderable {
|
|
|
414
526
|
* @type {Matrix3d}
|
|
415
527
|
*/
|
|
416
528
|
projectionMatrix: Matrix3d;
|
|
417
|
-
/** @ignore */
|
|
418
|
-
_anchorBaked: boolean;
|
|
419
|
-
/** @ignore */
|
|
420
|
-
_hullPoints: Vector2d[];
|
|
421
|
-
/** @ignore */
|
|
422
|
-
_hullPolygon: Polygon | null;
|
|
423
|
-
/** @ignore */
|
|
424
|
-
_geometryVersion: number;
|
|
425
|
-
/**
|
|
426
|
-
* Project all vertices through projectionMatrix × currentTransform
|
|
427
|
-
* and store the results in `this.vertices`.
|
|
428
|
-
* @param {number} [offsetX=0] - x offset added to each projected vertex
|
|
429
|
-
* @param {number} [offsetY=0] - y offset added to each projected vertex
|
|
430
|
-
* @param {number} [zScale=0] - scale factor for Z output (0 = skip Z, 1000 = depth buffer range)
|
|
431
|
-
* @ignore
|
|
432
|
-
*/
|
|
433
|
-
_projectVertices(offsetX?: number, offsetY?: number, zScale?: number): void;
|
|
434
529
|
/**
|
|
435
530
|
* Signal that this mesh's geometry itself has changed — its vertices, UVs,
|
|
436
531
|
* indices, normals or per-vertex colours were edited in place.
|
|
@@ -447,80 +542,29 @@ export default class Mesh extends Renderable {
|
|
|
447
542
|
*/
|
|
448
543
|
set needsUpdate(value: any);
|
|
449
544
|
/**
|
|
450
|
-
*
|
|
451
|
-
* geometry sits in the world.
|
|
545
|
+
* Set one vertex's colour, multiplied into {@link Mesh#tint}.
|
|
452
546
|
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
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.
|
|
456
550
|
*
|
|
457
|
-
*
|
|
551
|
+
* Out-of-range indices are ignored rather than throwing, matching
|
|
552
|
+
* {@link InstancedMesh#setInstanceColor}.
|
|
458
553
|
*
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
*
|
|
463
|
-
* @
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
* perspective that's meaningful only under Camera2d) and emits
|
|
472
|
-
* vertices that the active 3D camera then projects via its own
|
|
473
|
-
* view + projection matrices, the same way it does for Sprites.
|
|
474
|
-
*
|
|
475
|
-
* Per-vertex math: `currentTransform × originalVertex`, then a uniform
|
|
476
|
-
* scale by `this.width`, the Y-up→Y-down bridge (negate Y, and also Z when
|
|
477
|
-
* {@link Mesh#rightHanded} is set so the bridge is a rotation rather than a
|
|
478
|
-
* mirror), and a translate to `(offsetX, offsetY, offsetZ)`.
|
|
479
|
-
*
|
|
480
|
-
* @param {number} offsetX - world X to place the mesh center at
|
|
481
|
-
* @param {number} offsetY - world Y to place the mesh center at
|
|
482
|
-
* @param {number} offsetZ - world Z to place the mesh center at
|
|
483
|
-
* @ignore
|
|
484
|
-
*/
|
|
485
|
-
_projectVerticesWorld(offsetX: number, offsetY: number, offsetZ: number): void;
|
|
486
|
-
/**
|
|
487
|
-
* Project {@link Mesh#originalNormals} into world space for lit shading,
|
|
488
|
-
* storing the result in {@link Mesh#normals}. Applies the rotation/scale of
|
|
489
|
-
* {@link Renderable#currentTransform} (no translation), the same Y-down /
|
|
490
|
-
* `rightHanded` Y/Z bridge as {@link Mesh#_projectVerticesWorld}, then
|
|
491
|
-
* renormalizes. No-op when the mesh has no source normals.
|
|
492
|
-
*
|
|
493
|
-
* Note: uses the transform's rotation/scale columns directly rather than
|
|
494
|
-
* the inverse-transpose, so normals are exact under rotation + uniform
|
|
495
|
-
* scale (the common case); a strongly non-uniform scale would skew them
|
|
496
|
-
* slightly — acceptable for the diffuse lighting path.
|
|
497
|
-
* @ignore
|
|
498
|
-
*/
|
|
499
|
-
_projectNormalsWorld(): void;
|
|
500
|
-
/**
|
|
501
|
-
* Build the winding-reversed indices buffer used by the Camera3d
|
|
502
|
-
* world-space path. Called once, lazily, the first time the mesh
|
|
503
|
-
* draws under Camera3d. Why: the world-space path Y-flips vertices
|
|
504
|
-
* on output (a reflection, det = -1), which inverts triangle
|
|
505
|
-
* winding in screen space. Without the swap, `cullBackFaces: true`
|
|
506
|
-
* would end up culling the front faces and the model would look
|
|
507
|
-
* hollow.
|
|
508
|
-
*
|
|
509
|
-
* Both buffers are kept alive — `_indicesOriginal` is the original
|
|
510
|
-
* OBJ-shared (or user-supplied) winding, `_indicesReversed` is the
|
|
511
|
-
* Camera3d-flipped copy. `draw()` swaps `this.indices` between them
|
|
512
|
-
* each frame based on the active camera, so a Mesh that was first
|
|
513
|
-
* drawn under Camera3d and later re-parented to a Camera2d stage
|
|
514
|
-
* (e.g. a level transition into a 2D minigame) gets its original
|
|
515
|
-
* winding back and stays correctly oriented under
|
|
516
|
-
* `cullBackFaces: true`.
|
|
517
|
-
* @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.
|
|
518
|
-
* @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
|
+
* }
|
|
519
566
|
*/
|
|
520
|
-
|
|
521
|
-
_indicesReversed: any;
|
|
522
|
-
_worldSpace: boolean | undefined;
|
|
523
|
-
_useWorldSpace: boolean | undefined;
|
|
567
|
+
setVertexColor(index: number, color: Color): void;
|
|
524
568
|
/**
|
|
525
569
|
* The mesh's world-space 3D axis-aligned bounding box. This is the 3D analog
|
|
526
570
|
* of {@link Renderable#getBounds} (which returns a flat 2D box from
|
|
@@ -536,39 +580,6 @@ export default class Mesh extends Renderable {
|
|
|
536
580
|
* @returns {AABB3d} the world-space bounding box (reused instance)
|
|
537
581
|
*/
|
|
538
582
|
getBounds3d(): AABB3d;
|
|
539
|
-
/** @ignore */
|
|
540
|
-
_bounds3d: AABB3d | undefined;
|
|
541
|
-
/**
|
|
542
|
-
* Whether this mesh casts a ground shadow on this draw (#1515).
|
|
543
|
-
*
|
|
544
|
-
* Precedence, most specific first: the mesh's own `castGroundShadow`, then
|
|
545
|
-
* the application's `castGroundShadow` setting. A per-mesh value is an
|
|
546
|
-
* explicit instruction and is obeyed as given; the application default is a
|
|
547
|
-
* blanket one, so it skips meshes with no vertical extent — which is what a
|
|
548
|
-
* ground plane is, and a flat plane lying on the floor has nothing to cast.
|
|
549
|
-
* Read off the renderer rather than the global application instance, the
|
|
550
|
-
* same way the `textureFilter` default is.
|
|
551
|
-
* @param {WebGLRenderer|WebGPURenderer} renderer - the active renderer
|
|
552
|
-
* @returns {boolean} true if a shadow should be drawn
|
|
553
|
-
* @ignore
|
|
554
|
-
*/
|
|
555
|
-
_castsGroundShadow(renderer: WebGLRenderer | WebGPURenderer): boolean;
|
|
556
|
-
/**
|
|
557
|
-
* Measure the model-space footprint the blob is built from, and whether the
|
|
558
|
-
* geometry has any height at all — once per geometry version.
|
|
559
|
-
* @ignore
|
|
560
|
-
*/
|
|
561
|
-
_measureShadowFootprint(): void;
|
|
562
|
-
/**
|
|
563
|
-
* Draw this mesh's ground shadow: the shared blob quad, flattened onto the
|
|
564
|
-
* ground plane beneath the object (#1515).
|
|
565
|
-
*
|
|
566
|
-
* The quad is shared by every shadow in the scene and its geometry is
|
|
567
|
-
* uploaded once, so this is one draw and no allocation.
|
|
568
|
-
* @param {WebGLRenderer} renderer - the active renderer
|
|
569
|
-
* @ignore
|
|
570
|
-
*/
|
|
571
|
-
_drawGroundShadow(renderer: WebGLRenderer): void;
|
|
572
583
|
/**
|
|
573
584
|
* Render the mesh at its current state (transforms, projection, tint) to an offscreen canvas.
|
|
574
585
|
* The returned canvas can be used with `renderer.drawImage()`, as a `Sprite` image source,
|
|
@@ -592,12 +603,6 @@ export default class Mesh extends Renderable {
|
|
|
592
603
|
* const sprite = new me.Sprite(100, 100, { image: bitmap });
|
|
593
604
|
*/
|
|
594
605
|
toImageBitmap(): Promise<ImageBitmap>;
|
|
595
|
-
/**
|
|
596
|
-
* Release this mesh's GPU-resident geometry, if a renderer is holding any,
|
|
597
|
-
* then destroy the renderable.
|
|
598
|
-
* @ignore
|
|
599
|
-
*/
|
|
600
|
-
destroy(): void;
|
|
601
606
|
}
|
|
602
607
|
import Renderable from "./renderable.js";
|
|
603
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;;;;;;;;;;;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;OAcG;IACH,6BALW,aAAa,GAAC,cAAc,GAC1B,OAAO,CAkBnB;IAED;;;;;OAKG;IACH,gCA0BC;IAED;;;;;;;;;OASG;IACH,4BAJW,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"}
|
|
@@ -64,7 +64,7 @@ export default class Renderable extends Rect {
|
|
|
64
64
|
* this.isKinematic = false;
|
|
65
65
|
*
|
|
66
66
|
* // set the display to follow our position on both axis
|
|
67
|
-
* app.viewport.follow(this
|
|
67
|
+
* app.viewport.follow(this, app.viewport.AXIS.BOTH);
|
|
68
68
|
* }
|
|
69
69
|
*
|
|
70
70
|
* ...
|
|
@@ -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
|
|
@@ -610,8 +572,11 @@ export default class Renderable extends Rect {
|
|
|
610
572
|
* to the position or transforms set or applied by the preDraw method.
|
|
611
573
|
* The main draw loop will first call preDraw() to prepare the context for drawing the renderable,
|
|
612
574
|
* then draw() to draw the renderable, and finally postDraw() to clear the context.
|
|
613
|
-
* If you override this method, be mindful about the drawing logic
|
|
614
|
-
*
|
|
575
|
+
* If you override this method, be mindful about the drawing logic: `preDraw`
|
|
576
|
+
* applies this renderable's transforms, tint and anchor offset, but does
|
|
577
|
+
* **not** translate to `this.pos`. The renderer arrives positioned at the
|
|
578
|
+
* parent container's origin, so draw relative to `this.pos` — drawing at
|
|
579
|
+
* `(0, 0)` places the shape at the container's origin instead.
|
|
615
580
|
* @see Renderable#preDraw
|
|
616
581
|
* @see Renderable#postDraw
|
|
617
582
|
* @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance
|
|
@@ -647,7 +612,7 @@ export default class Renderable extends Rect {
|
|
|
647
612
|
* `onCollision` only when its every-frame, return-false, fixed-`a`/`b`
|
|
648
613
|
* semantics are what you want.
|
|
649
614
|
*
|
|
650
|
-
* @param {import("../physics/
|
|
615
|
+
* @param {import("../physics/response.js").default} response - the SAT response object; the legacy handler receives this, not the adapter's `CollisionResponse`, which is why `normal` and `depth` are absent from the table above
|
|
651
616
|
* @param {Renderable} other - the other renderable touching this one (a reference to response.a or response.b)
|
|
652
617
|
* @returns {boolean} true if the object should respond to the collision (its position and velocity will be corrected); the return value is only honored by the builtin SAT adapter.
|
|
653
618
|
* @example
|
|
@@ -661,18 +626,14 @@ export default class Renderable extends Rect {
|
|
|
661
626
|
* return true;
|
|
662
627
|
* }
|
|
663
628
|
*/
|
|
664
|
-
onCollision(
|
|
665
|
-
/**
|
|
666
|
-
* Destroy function<br>
|
|
667
|
-
* @ignore
|
|
668
|
-
*/
|
|
669
|
-
destroy(...args: any[]): void;
|
|
629
|
+
onCollision(response: import("../physics/response.js").default, other: Renderable): boolean;
|
|
670
630
|
/**
|
|
671
631
|
* OnDestroy Notification function<br>
|
|
672
|
-
* Called by engine before deleting the object.
|
|
673
|
-
*
|
|
674
|
-
*
|
|
675
|
-
*
|
|
632
|
+
* Called by engine before deleting the object. Receives whatever
|
|
633
|
+
* `destroy(...args)` was called with — the production path
|
|
634
|
+
* (`Container.removeChildNow`) passes nothing. {@link Stage} has its own
|
|
635
|
+
* `onDestroyEvent`, which does forward the active Application.
|
|
636
|
+
* @param {...*} _args - forwarded by `destroy(...args)`; normally empty
|
|
676
637
|
*/
|
|
677
638
|
onDestroyEvent(..._args: any[]): void;
|
|
678
639
|
/**
|
|
@@ -681,7 +642,8 @@ export default class Renderable extends Rect {
|
|
|
681
642
|
* Override to wire up input handlers, register external listeners,
|
|
682
643
|
* or grab adapter references — `this.parentApp` is guaranteed to be
|
|
683
644
|
* available here. Pair with {@link Renderable#onDeactivateEvent}.
|
|
684
|
-
* @param {...*} _args -
|
|
645
|
+
* @param {...*} _args - the rest parameter exists for subclass-signature
|
|
646
|
+
* compatibility; `Container.addChild` currently forwards nothing
|
|
685
647
|
*/
|
|
686
648
|
onActivateEvent(..._args: any[]): void;
|
|
687
649
|
/**
|
|
@@ -689,7 +651,8 @@ export default class Renderable extends Rect {
|
|
|
689
651
|
* removed from its container or its container is itself removed.
|
|
690
652
|
* Override to release input handlers, unsubscribe from events, or
|
|
691
653
|
* drop adapter references. Pair with {@link Renderable#onActivateEvent}.
|
|
692
|
-
* @param {...*} _args -
|
|
654
|
+
* @param {...*} _args - the rest parameter exists for subclass-signature
|
|
655
|
+
* compatibility; `Container.removeChildNow` currently forwards nothing
|
|
693
656
|
*/
|
|
694
657
|
onDeactivateEvent(..._args: any[]): void;
|
|
695
658
|
}
|
|
@@ -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,SAAS,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,CAkBxB;IAErB;;;;;;;;;;;;;;;;OAgBG;IACH,aAVU,KAAK,CAAC,QAAQ,GAAC,YAAY,CAAC,CAUjB;IAErB;;;;OAIG;IACH,4BAA+B;IAE/B;;;;;;;;OAQG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