melonjs 20.7.0 → 20.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/build/application/application.d.ts +66 -8
- package/build/application/application.d.ts.map +1 -1
- package/build/application/defaultApplicationSettings.d.ts +6 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -1
- package/build/application/header.d.ts.map +1 -1
- package/build/application/resize.d.ts +25 -0
- package/build/application/resize.d.ts.map +1 -1
- package/build/application/scaleMethods.d.ts +13 -3
- package/build/application/scaleMethods.d.ts.map +1 -1
- package/build/application/settings.d.ts +144 -5
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +29 -5
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/autopause.d.ts +36 -0
- package/build/audio/autopause.d.ts.map +1 -0
- package/build/audio/backend/engine.d.ts +10 -1
- package/build/audio/backend/engine.d.ts.map +1 -1
- package/build/audio/backend/sound.d.ts +0 -1
- package/build/audio/backend/sound.d.ts.map +1 -1
- package/build/audio/backend/spatial.d.ts.map +1 -1
- package/build/audio/context.d.ts +35 -0
- package/build/audio/context.d.ts.map +1 -0
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/procedural.d.ts.map +1 -1
- package/build/audio/spatial.d.ts +87 -0
- package/build/audio/spatial.d.ts.map +1 -0
- package/build/audio/state.d.ts +1 -0
- package/build/audio/state.d.ts.map +1 -1
- package/build/audio/types.d.ts +46 -6
- package/build/audio/types.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +95 -8
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/camera/effects/fade_effect.d.ts.map +1 -1
- package/build/camera/effects/mask_effect.d.ts.map +1 -1
- package/build/camera/effects/shake_effect.d.ts.map +1 -1
- package/build/geometries/box3d.d.ts +25 -7
- package/build/geometries/box3d.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +15 -1
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/line.d.ts +1 -1
- package/build/geometries/line.d.ts.map +1 -1
- package/build/geometries/point.d.ts +1 -1
- package/build/geometries/point.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +15 -1
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/geometries/rectangle.d.ts +1 -1
- package/build/geometries/rectangle.d.ts.map +1 -1
- package/build/geometries/roundrect.d.ts +1 -1
- package/build/geometries/roundrect.d.ts.map +1 -1
- package/build/geometries/sphere.d.ts +36 -7
- package/build/geometries/sphere.d.ts.map +1 -1
- package/build/index.d.ts +16 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +38172 -33633
- package/build/index.js.map +4 -4
- package/build/input/gamepad.d.ts +129 -3
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/input/pointerevent.d.ts +8 -0
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts +20 -33
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/level/gltf/GLTFScene.d.ts +40 -1
- package/build/level/gltf/GLTFScene.d.ts.map +1 -1
- package/build/level/level.d.ts +35 -0
- package/build/level/level.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +5 -2
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +0 -1
- package/build/level/tiled/TMXObjectFactory.d.ts +3 -2
- package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
- package/build/level/tiled/TMXTile.d.ts +2 -1
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +7 -4
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +1 -1
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts +5 -0
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts +0 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +6 -5
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +5 -0
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +5 -7
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +5 -0
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +19 -4
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/autodetect.d.ts +0 -4
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
- package/build/loader/cache.d.ts +220 -0
- package/build/loader/cache.d.ts.map +1 -1
- package/build/loader/loader.d.ts +20 -340
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts +1 -2
- package/build/loader/loadingscreen.d.ts.map +1 -1
- package/build/loader/parsers/gltf.d.ts +115 -0
- package/build/loader/parsers/gltf.d.ts.map +1 -1
- package/build/loader/parsers/shader.d.ts +0 -2
- package/build/math/color.d.ts +28 -5
- package/build/math/color.d.ts.map +1 -1
- package/build/math/matrix2d.d.ts +1 -1
- package/build/math/matrix2d.d.ts.map +1 -1
- package/build/math/matrix3d.d.ts +1 -1
- package/build/math/matrix3d.d.ts.map +1 -1
- package/build/math/observableVector2d.d.ts +14 -2
- package/build/math/observableVector2d.d.ts.map +1 -1
- package/build/math/observableVector3d.d.ts +15 -1
- package/build/math/observableVector3d.d.ts.map +1 -1
- package/build/math/vector2d.d.ts +31 -1
- package/build/math/vector2d.d.ts.map +1 -1
- package/build/math/vector3d.d.ts +38 -1
- package/build/math/vector3d.d.ts.map +1 -1
- package/build/math/vertex.d.ts.map +1 -1
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +29 -2
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +104 -0
- package/build/particles/settings.d.ts.map +1 -1
- package/build/physics/adapter.d.ts +9 -1
- package/build/physics/adapter.d.ts.map +1 -1
- package/build/physics/bounds.d.ts +1 -1
- package/build/physics/bounds.d.ts.map +1 -1
- package/build/physics/broadphase/octree.d.ts +24 -0
- package/build/physics/broadphase/octree.d.ts.map +1 -1
- package/build/physics/broadphase/quadtree.d.ts +31 -0
- package/build/physics/broadphase/quadtree.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +17 -2
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/builtin-adapter.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts +0 -1
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/physics/builtin/sat.d.ts +0 -7
- package/build/physics/builtin/sat3d.d.ts +46 -0
- package/build/physics/builtin/sat3d.d.ts.map +1 -1
- package/build/physics/response.d.ts +45 -62
- package/build/physics/response.d.ts.map +1 -1
- package/build/pool.d.ts +4 -0
- package/build/pool.d.ts.map +1 -1
- package/build/renderable/collectable.d.ts +6 -1
- package/build/renderable/collectable.d.ts.map +1 -1
- package/build/renderable/colorlayer.d.ts +17 -4
- package/build/renderable/colorlayer.d.ts.map +1 -1
- package/build/renderable/container.d.ts +23 -17
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +12 -16
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts +1 -1
- package/build/renderable/groundshadow.d.ts +1 -0
- package/build/renderable/groundshadow.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts +12 -5
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/instanced_mesh.d.ts +56 -7
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +369 -4
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/nineslicesprite.d.ts +3 -13
- package/build/renderable/nineslicesprite.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +129 -28
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +7 -20
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +31 -16
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +76 -5
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts +1 -5
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/glypheffect.d.ts +44 -0
- package/build/renderable/text/glypheffect.d.ts.map +1 -0
- package/build/renderable/text/text.d.ts +22 -3
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/text/textmetrics.d.ts +2 -0
- package/build/renderable/text/textmetrics.d.ts.map +1 -1
- package/build/renderable/trail.d.ts +0 -1
- package/build/renderable/trail.d.ts.map +1 -1
- package/build/renderable/trail3d.d.ts +174 -0
- package/build/renderable/trail3d.d.ts.map +1 -0
- package/build/renderable/trigger.d.ts +28 -5
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/panelpaint.d.ts +5 -0
- package/build/renderable/ui/panelpaint.d.ts.map +1 -0
- package/build/renderable/ui/progressbar.d.ts +192 -0
- package/build/renderable/ui/progressbar.d.ts.map +1 -0
- package/build/renderable/ui/uibaseelement.d.ts +48 -3
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
- package/build/renderable/ui/uipanel.d.ts +245 -0
- package/build/renderable/ui/uipanel.d.ts.map +1 -0
- package/build/renderable/ui/uispriteelement.d.ts +19 -3
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/renderable/ui/uitextbutton.d.ts +30 -1
- package/build/renderable/ui/uitextbutton.d.ts.map +1 -1
- package/build/state/state.d.ts.map +1 -1
- package/build/system/bootstrap.d.ts.map +1 -1
- package/build/system/legacy_pool.d.ts +24 -4
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/system/pool.d.ts +15 -8
- package/build/system/pool.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +50 -3
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +34 -23
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/effects/blendEffect.d.ts +0 -1
- package/build/video/effects/bloom.d.ts +72 -0
- package/build/video/effects/bloom.d.ts.map +1 -0
- package/build/video/effects/blur.d.ts +3 -2
- package/build/video/effects/blur.d.ts.map +1 -1
- package/build/video/effects/chromaticAberration.d.ts +3 -2
- package/build/video/effects/chromaticAberration.d.ts.map +1 -1
- package/build/video/effects/colorMatrix.d.ts +3 -2
- package/build/video/effects/colorMatrix.d.ts.map +1 -1
- package/build/video/effects/desaturate.d.ts +10 -2
- package/build/video/effects/desaturate.d.ts.map +1 -1
- package/build/video/effects/dissolve.d.ts +3 -2
- package/build/video/effects/dissolve.d.ts.map +1 -1
- package/build/video/effects/dropShadow.d.ts +3 -2
- package/build/video/effects/dropShadow.d.ts.map +1 -1
- package/build/video/effects/flash.d.ts +3 -2
- package/build/video/effects/flash.d.ts.map +1 -1
- package/build/video/effects/glow.d.ts +3 -2
- package/build/video/effects/glow.d.ts.map +1 -1
- package/build/video/effects/hologram.d.ts +3 -2
- package/build/video/effects/hologram.d.ts.map +1 -1
- package/build/video/effects/invert.d.ts +10 -2
- package/build/video/effects/invert.d.ts.map +1 -1
- package/build/video/effects/outline.d.ts +3 -2
- package/build/video/effects/outline.d.ts.map +1 -1
- package/build/video/effects/pixelate.d.ts +3 -2
- package/build/video/effects/pixelate.d.ts.map +1 -1
- package/build/video/effects/radialGradient.d.ts +8 -3
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/scanline.d.ts +3 -2
- package/build/video/effects/scanline.d.ts.map +1 -1
- package/build/video/effects/sepia.d.ts +10 -2
- package/build/video/effects/sepia.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +10 -4
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/shine.d.ts +3 -2
- package/build/video/effects/shine.d.ts.map +1 -1
- package/build/video/effects/tintPulse.d.ts +3 -7
- package/build/video/effects/tintPulse.d.ts.map +1 -1
- package/build/video/effects/tonemap.d.ts +121 -0
- package/build/video/effects/tonemap.d.ts.map +1 -0
- package/build/video/effects/vignette.d.ts +3 -2
- package/build/video/effects/vignette.d.ts.map +1 -1
- package/build/video/effects/wave.d.ts +3 -7
- package/build/video/effects/wave.d.ts.map +1 -1
- package/build/video/gpu/batcher.d.ts +8 -2
- package/build/video/gpu/batcher.d.ts.map +1 -1
- package/build/video/gpu/vertexformat.d.ts +26 -0
- package/build/video/gpu/vertexformat.d.ts.map +1 -1
- package/build/video/gradient.d.ts +1 -1
- package/build/video/gradient.d.ts.map +1 -1
- package/build/video/renderer.d.ts +111 -7
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +2 -0
- package/build/video/renderstate.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +3 -4
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +0 -1
- package/build/video/rendertarget/rendertarget.d.ts +12 -5
- package/build/video/rendertarget/rendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webglrendertarget.d.ts +0 -1
- package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webgpurendertarget.d.ts +24 -14
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +2 -1
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +1 -3
- package/build/video/texture/frametexture.d.ts +0 -1
- package/build/video/texture/frametexture.d.ts.map +1 -1
- package/build/video/texture/noise_texture2d.d.ts +1 -0
- package/build/video/texture/noise_texture2d.d.ts.map +1 -1
- package/build/video/texture/texture2d.d.ts +6 -0
- package/build/video/texture/texture2d.d.ts.map +1 -1
- package/build/video/utils/autodetect.d.ts +0 -2
- package/build/video/webgl/batchers/batcher.d.ts +0 -9
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts +2 -0
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts +4 -2
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/mesh_batcher.d.ts +0 -3
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts +4 -0
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +0 -1
- package/build/video/webgl/buffer/retained_geometry.d.ts +0 -1
- package/build/video/webgl/glshader.d.ts +5 -3
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +0 -4
- package/build/video/webgl/texture/store.d.ts +0 -1
- package/build/video/webgl/webgl_renderer.d.ts +63 -24
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/mesh_batcher.d.ts +0 -3
- package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -2
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/webgpu_batcher.d.ts +0 -2
- package/build/video/webgpu/batchers/webgpu_batcher.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +0 -2
- package/build/video/webgpu/texture/frametexture.d.ts +0 -2
- package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
- package/build/video/webgpu/texture/store.d.ts +0 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +7 -75
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +2 -2
- package/skills/AGENTS.md +1 -1
- package/skills/melonjs/SKILL.md +2 -0
- package/skills/melonjs-3d/SKILL.md +454 -22
- package/skills/melonjs-3d-assets/SKILL.md +111 -10
- package/skills/melonjs-audio/SKILL.md +229 -8
- package/skills/melonjs-camera-and-drawing/SKILL.md +127 -1
- package/skills/melonjs-display-and-scaling/SKILL.md +273 -0
- package/skills/melonjs-effects-and-shaders/SKILL.md +341 -29
- package/skills/melonjs-events/SKILL.md +8 -6
- package/skills/melonjs-input/SKILL.md +147 -7
- package/skills/melonjs-math/SKILL.md +313 -0
- package/skills/melonjs-particles-and-trails/SKILL.md +189 -13
- package/skills/melonjs-performance/SKILL.md +131 -23
- package/skills/melonjs-physics/SKILL.md +103 -28
- package/skills/melonjs-renderables/SKILL.md +8 -2
- package/skills/melonjs-scenes-and-state/SKILL.md +134 -3
- package/skills/melonjs-sprites-and-animation/SKILL.md +9 -4
- package/skills/melonjs-tilemaps/SKILL.md +40 -12
- package/skills/melonjs-ui-and-text/SKILL.md +546 -7
- package/build/level/gltf/srgb.d.ts +0 -20
- package/build/level/gltf/srgb.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groundshadow.d.ts","sourceRoot":"","sources":["../../src/renderable/groundshadow.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;GAUG;AACH,oCAJa,iBAAiB,GAAC,eAAe,CAuC7C;AAED;;;;;GAKG;AACH,2CAEC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,4CANW,YAAY,eACZ,MAAM,GACJ,OAAO,CA+BnB;AAkBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wCARW,MAAM,OACN,OAAO,wBAGL,MAAM,CAkClB;AAED
|
|
1
|
+
{"version":3,"file":"groundshadow.d.ts","sourceRoot":"","sources":["../../src/renderable/groundshadow.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;GAUG;AACH,oCAJa,iBAAiB,GAAC,eAAe,CAuC7C;AAED;;;;;GAKG;AACH,2CAEC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,4CANW,YAAY,eACZ,MAAM,GACJ,OAAO,CA+BnB;AAkBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wCARW,MAAM,OACN,OAAO,wBAGL,MAAM,CAkClB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,kCATW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,OACN,YAAY,QAoBtB;AAuBD;;;;;;;;;;;;;;GAcG;AACH,oCAPW,MAAM,MACN,MAAM,MACN,MAAM,OACN,YAAY,QAgBtB;AAcD;;;;;;;;;;GAUG;AACH,4CALW,MAAM,GACJ,MAAM,CASlB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iCAVW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QACN,MAAM,OACN,YAAY,GAAC,MAAM,EAAE,GACnB,YAAY,GAAC,MAAM,EAAE,CASjC;AAuDD,oKAgFC;AAED;;;;;;GAMG;AACH,6CAJW,MAAM,QAWhB;AAhQD;;;;;;;;;;;;;;;;;;GAkBG;AACH,yCAAkE;AA+BlE,oDAAoD;AACpD;;;;;;;;GAQG;AACH,iCAAkC,CAAC,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* additional import for TypeScript
|
|
3
|
-
* @import {Vector2d} from "../math/vector2d.
|
|
3
|
+
* @import {Vector2d} from "../math/vector2d.ts";
|
|
4
|
+
* @import Camera2d from "../camera/camera2d.ts";
|
|
5
|
+
* @import CanvasRenderer from "../video/canvas/canvas_renderer.js";
|
|
6
|
+
* @import {CompressedImage} from "../loader/parsers/compressed_textures/compressed_image.js";
|
|
7
|
+
* @import WebGLRenderer from "../video/webgl/webgl_renderer.js";
|
|
8
|
+
* @import Renderer from "../video/renderer.js";
|
|
4
9
|
*/
|
|
5
10
|
/**
|
|
6
11
|
* a generic Image Layer Object
|
|
@@ -70,13 +75,15 @@ export default class ImageLayer extends Sprite {
|
|
|
70
75
|
resize(w: number, h: number): this;
|
|
71
76
|
/**
|
|
72
77
|
* draw this ImageLayer (automatically called by melonJS)
|
|
73
|
-
* @
|
|
74
|
-
* @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance
|
|
78
|
+
* @param {Renderer} renderer - a renderer instance
|
|
75
79
|
* @param {Camera2d} [viewport] - the viewport to (re)draw
|
|
76
80
|
*/
|
|
77
|
-
|
|
81
|
+
draw(renderer: Renderer, viewport?: Camera2d): void;
|
|
78
82
|
onDeactivateEvent(): void;
|
|
79
83
|
}
|
|
80
84
|
import Sprite from "./sprite.js";
|
|
81
|
-
import type { Vector2d } from "../math/vector2d.
|
|
85
|
+
import type { Vector2d } from "../math/vector2d.ts";
|
|
86
|
+
import type Renderer from "../video/renderer.js";
|
|
87
|
+
import type Camera2d from "../camera/camera2d.ts";
|
|
88
|
+
import type { CompressedImage } from "../loader/parsers/compressed_textures/compressed_image.js";
|
|
82
89
|
//# sourceMappingURL=imagelayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imagelayer.d.ts","sourceRoot":"","sources":["../../src/renderable/imagelayer.js"],"names":[],"mappings":"AAaA
|
|
1
|
+
{"version":3,"file":"imagelayer.d.ts","sourceRoot":"","sources":["../../src/renderable/imagelayer.js"],"names":[],"mappings":"AAaA;;;;;;;;GAQG;AAEH;;;GAGG;AACH;IACC;;;;;;;;;;;;;;;;OAgBG;IACH,eAhBW,MAAM,KACN,MAAM,YAEd;QAA4E,KAAK,EAAzE,gBAAgB,GAAC,iBAAiB,GAAC,eAAe,GAAC,MAAM;QACvC,IAAI;QACJ,CAAC;QACQ,KAAK;QACsB,MAAM;QACN,WAAW;eAAvC,MAAM;eAAG,MAAM;;KACjD,EAgEF;IAlCA;;;;;;;;;OASG;IACH,OAHU,QAAQ,CAGqB;IAyCxC,kBAPU,MAAM,EA+Bf;IAvCD;;;;;;;;;;OAUG;IACH,cAHU,MAAM,CAKf;IAGA;;;OAGG;IACH,4BAAoB;IAGlB,6BAAoB;IACpB,6BAAoB;IAkBvB,wBAsBC;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAOhB;IAED;;;;OAIG;IACH,sBASC;IARA;;;OAGG;IACH,cAGC;IAGF;;;;OAIG;IACH,oBA+CC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,6BAmBC;IAED;;;;OAIG;IACH,eAHW,QAAQ,aACR,QAAQ,QAyElB;IAGD,0BAMC;CAYD;mBAxXkB,aAAa;8BAIL,qBAAqB;0BAKvB,sBAAsB;0BAJtB,uBAAuB;qCAEd,2DAA2D"}
|
|
@@ -139,7 +139,7 @@ export default class InstancedMesh extends Mesh {
|
|
|
139
139
|
* @returns {number} the new instance's index
|
|
140
140
|
*/
|
|
141
141
|
addInstance(transform?: Matrix3d, options?: {
|
|
142
|
-
color?:
|
|
142
|
+
color?: Color | undefined;
|
|
143
143
|
data?: number[] | undefined;
|
|
144
144
|
}): number;
|
|
145
145
|
/**
|
|
@@ -200,13 +200,61 @@ export default class InstancedMesh extends Mesh {
|
|
|
200
200
|
*/
|
|
201
201
|
set needsInstanceUpdate(value: any);
|
|
202
202
|
/**
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance
|
|
207
|
-
* @param {Camera2d} [viewport] - the camera rendering this frame
|
|
203
|
+
* Release the instance records along with the mesh.
|
|
204
|
+
* @ignore
|
|
205
|
+
* @internal
|
|
208
206
|
*/
|
|
209
|
-
|
|
207
|
+
/**
|
|
208
|
+
* Draw a ground shadow for every visible instance — one call for the whole
|
|
209
|
+
* set, over the instance buffer the mesh itself just drew from (#1515).
|
|
210
|
+
*
|
|
211
|
+
* The group matrix is passed with its Y ROW replaced by the floor's
|
|
212
|
+
* plane equation and its translation Y set to the ground, so whatever Y
|
|
213
|
+
* the shadow vertex stage produces is projected onto the floor. That is
|
|
214
|
+
* what lets the ground reach the shader without a new uniform, and it
|
|
215
|
+
* is why a tilted floor costs no shader change either: a gradient in
|
|
216
|
+
* that row is a slope, zero is level.
|
|
217
|
+
*
|
|
218
|
+
* One plane serves the whole set, level or tilted. Per-instance ground
|
|
219
|
+
* height would have to ride the `instanceData` slot, which the built-in
|
|
220
|
+
* shading already reads as emissive.
|
|
221
|
+
* @param {WebGLRenderer} renderer - the active renderer
|
|
222
|
+
* @ignore
|
|
223
|
+
* @internal
|
|
224
|
+
* @example
|
|
225
|
+
* // A scatter's blobs share ONE plane, so a scatter over curved ground is
|
|
226
|
+
* // one set per flat facet, each with that facet's own plane. Everything
|
|
227
|
+
* // else is one value for the whole set, which is all a set can carry.
|
|
228
|
+
* const bank = new InstancedMesh(0, 0, {
|
|
229
|
+
* ...fernGeometry,
|
|
230
|
+
* instanceCount: 60,
|
|
231
|
+
* castGroundShadow: true,
|
|
232
|
+
* shadowGroundY: planeHeightAtTheSetsOrigin,
|
|
233
|
+
* shadowGroundNormal: [facetNx, facetNy, 0], // world up is (0,-1,0)
|
|
234
|
+
* shadowLight: sun,
|
|
235
|
+
* shadowOffset: 0.6,
|
|
236
|
+
* shadowStretch: 1.8,
|
|
237
|
+
* });
|
|
238
|
+
*/
|
|
239
|
+
/**
|
|
240
|
+
* Refused here, rather than accepted and quietly ignored.
|
|
241
|
+
*
|
|
242
|
+
* A set gets ONE plane and ONE shared quad, and this tier builds that
|
|
243
|
+
* plane through the set's own origin so the translation's x and z drop
|
|
244
|
+
* out of the intercept, which is then `groundY + lift / nY`. An
|
|
245
|
+
* arbitrary point does not drop out, and that `nY` is why the tilt
|
|
246
|
+
* ceiling cannot be lifted here either. Supporting it means a different
|
|
247
|
+
* derivation, not a different value.
|
|
248
|
+
*
|
|
249
|
+
* Inherited from {@link Mesh} it would have stored the point and handed
|
|
250
|
+
* it back from the getter while changing nothing on screen, which is the
|
|
251
|
+
* worse failure: a game would have every reason to believe it worked.
|
|
252
|
+
* @param {number[]|Vector3d|undefined} value - ignored
|
|
253
|
+
* @see Mesh#shadowGroundPoint
|
|
254
|
+
*/
|
|
255
|
+
set shadowGroundPoint(value: number[] | Vector3d | undefined);
|
|
256
|
+
/** @ignore */
|
|
257
|
+
get shadowGroundPoint(): number[] | Vector3d | undefined;
|
|
210
258
|
}
|
|
211
259
|
/**
|
|
212
260
|
* Everything {@link InstancedMesh} takes: the instancing settings, plus every
|
|
@@ -230,4 +278,5 @@ export type InstancedMeshOwnSettings = {
|
|
|
230
278
|
export type InstancedMeshSettings = InstancedMeshOwnSettings & import("./mesh.js").MeshSettings;
|
|
231
279
|
import Mesh from "./mesh.js";
|
|
232
280
|
import { Matrix3d } from "../math/matrix3d.ts";
|
|
281
|
+
import type { Color } from "../math/color.ts";
|
|
233
282
|
//# sourceMappingURL=instanced_mesh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instanced_mesh.d.ts","sourceRoot":"","sources":["../../src/renderable/instanced_mesh.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instanced_mesh.d.ts","sourceRoot":"","sources":["../../src/renderable/instanced_mesh.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH;;;;;;;;GAQG;AAEH;;GAEG;AAEH;IACC;;;;OAIG;IACH,eAJW,MAAM,KACN,MAAM,YACN,qBAAqB,EAyF/B;IApFA;;;;;;;OAOG;IACH,gBAJU,MAAM,CAOf;IAED;;;;;;;OAOG;IACH,gBAFU,YAAY,CAEmB;IAEzC;;;;;;OAMG;IACH,kBAJU,MAAM,CAIS;IAUzB;;;OAGG;IACH,0BAA0B;IAG1B;;;OAGG;IACH,0BAA0B;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AE,GAAC,QAAQ,GAAC,SAAS,CAerC;IAVC,wCAA8B;IAYhC,gDAyOC;CAOD;;;;;;;;;;oBA/3Ba,MAAM;;;;qBACN,OAAO;;;;mBACP,OAAO;;oCAIR,wBAAwB,GAAG,OAAO,WAAW,EAAE,YAAY;iBAxHvD,WAAW;yBAfH,qBAAqB;2BAqBtB,kBAAkB;4BAEjB,sBAAsB;gCAHhB,oCAAoC;0BAD1C,uBAAuB"}
|
|
@@ -305,6 +305,45 @@ export default class Mesh extends Renderable {
|
|
|
305
305
|
* });
|
|
306
306
|
*/
|
|
307
307
|
transparent: boolean | undefined;
|
|
308
|
+
/**
|
|
309
|
+
* Whether geometry in front of this mesh hides it.
|
|
310
|
+
*
|
|
311
|
+
* Depth TEST, not depth WRITE. The two are different questions and the
|
|
312
|
+
* engine answers them in different places: writing is policy, and the
|
|
313
|
+
* transparent pass already turns it off for everything blended so
|
|
314
|
+
* overlapping draws blend instead of fighting. Testing is an authoring
|
|
315
|
+
* choice, and this is it.
|
|
316
|
+
*
|
|
317
|
+
* `false` is for something with no surface to be occluded ON. An
|
|
318
|
+
* additive glow is the case that forced it: it is a screen-space
|
|
319
|
+
* effect wearing a mesh's clothes, carrying a world position only so
|
|
320
|
+
* it can sort and move with the thing it belongs to. Left depth
|
|
321
|
+
* tested, a flat billboard is sliced along a straight line the moment
|
|
322
|
+
* any geometry is nearer at some pixel — most visibly where a glowing
|
|
323
|
+
* object passes near the limb of something round.
|
|
324
|
+
*
|
|
325
|
+
* Leave it `true` for anything that is genuinely in the scene. A
|
|
326
|
+
* muzzle flash behind a wall should still be behind the wall; this is
|
|
327
|
+
* not a synonym for "additive".
|
|
328
|
+
*
|
|
329
|
+
* Honoured in the transparent pass, so a mesh wanting it also wants
|
|
330
|
+
* {@link Mesh#transparent}. The Canvas renderer has no depth buffer
|
|
331
|
+
* and ignores it.
|
|
332
|
+
* @type {boolean}
|
|
333
|
+
* @default true
|
|
334
|
+
* @example
|
|
335
|
+
* // a glow that belongs to the rock, but is never cut by the planet
|
|
336
|
+
* const halo = new Sprite3d(0, 0, {
|
|
337
|
+
* image: glowTexture,
|
|
338
|
+
* width: 64, height: 64,
|
|
339
|
+
* billboard: "spherical",
|
|
340
|
+
* blendMode: "additive",
|
|
341
|
+
* transparent: true,
|
|
342
|
+
* alphaCutoff: 0,
|
|
343
|
+
* depthTest: false,
|
|
344
|
+
* });
|
|
345
|
+
*/
|
|
346
|
+
depthTest: boolean;
|
|
308
347
|
/**
|
|
309
348
|
* World Y of the floor the shadow lands on, or `undefined` (the
|
|
310
349
|
* default) to mean "this object is standing on the ground" — the
|
|
@@ -321,6 +360,14 @@ export default class Mesh extends Renderable {
|
|
|
321
360
|
* object above it.
|
|
322
361
|
* @type {number|undefined}
|
|
323
362
|
* @default undefined
|
|
363
|
+
* @example
|
|
364
|
+
* // a collectible bobbing above the floor: naming the floor is what
|
|
365
|
+
* // lets the blob shrink and fade as it rises. Left unset the blob
|
|
366
|
+
* // rides the object's own base and never leaves it.
|
|
367
|
+
* const coin = new Mesh(x, floorY, { ...geometry, castGroundShadow: true });
|
|
368
|
+
* coin.shadowGroundY = floorY;
|
|
369
|
+
* coin.pos.y = floorY - 40 - 30 * Math.sin(t);
|
|
370
|
+
* @see Mesh#shadowGroundPoint
|
|
324
371
|
*/
|
|
325
372
|
shadowGroundY: number | undefined;
|
|
326
373
|
/**
|
|
@@ -330,6 +377,196 @@ export default class Mesh extends Renderable {
|
|
|
330
377
|
* @default 0.45
|
|
331
378
|
*/
|
|
332
379
|
shadowOpacity: number;
|
|
380
|
+
/**
|
|
381
|
+
* Multiplier for the ground shadow's footprint, independent of the
|
|
382
|
+
* object's size, ground height and opacity. Values above `1` can reveal
|
|
383
|
+
* the blob beneath a wide prop; values below `1` tighten it.
|
|
384
|
+
* Non-positive or non-finite values hide the shadow. Can be changed live
|
|
385
|
+
* on an {@link InstancedMesh} too: the set's shared quad is rewritten in
|
|
386
|
+
* place rather than rebuilt, so animating it allocates nothing.
|
|
387
|
+
* @type {number}
|
|
388
|
+
* @default 1
|
|
389
|
+
* @example
|
|
390
|
+
* // a crate's own blob hides underneath it, so widen it until the edge
|
|
391
|
+
* // shows; `0` and below hide the shadow and leave the mesh drawn
|
|
392
|
+
* crate.shadowScale = 1.6;
|
|
393
|
+
*/
|
|
394
|
+
shadowScale: number;
|
|
395
|
+
/**
|
|
396
|
+
* How far to slide the ground shadow along
|
|
397
|
+
* {@link Mesh#shadowDirectionX}/{@link Mesh#shadowDirectionZ}, in
|
|
398
|
+
* multiples of the blob's OWN radius, which is what gives the look of
|
|
399
|
+
* a light that is not directly overhead.
|
|
400
|
+
*
|
|
401
|
+
* A ratio rather than a world distance. The distance that reads right
|
|
402
|
+
* is the one that shifts a stretched ellipse far enough for its
|
|
403
|
+
* trailing edge to stay at the caster's feet, which is about
|
|
404
|
+
* `stretch - 1` of its radius, so a world distance has to be retuned
|
|
405
|
+
* for every size of thing and cannot serve the parts of one glTF model
|
|
406
|
+
* at all. {@link Mesh#shadowScale} rides in that radius, so widening
|
|
407
|
+
* the blob carries the offset with it.
|
|
408
|
+
*
|
|
409
|
+
* Honoured ONLY when the floor has been NAMED, by
|
|
410
|
+
* {@link Mesh#shadowGroundY} or by {@link Mesh#shadowGroundPoint}. The
|
|
411
|
+
* blob is a flat quad on one named plane with no contact with terrain,
|
|
412
|
+
* so sliding it across a plane the game has not named puts it somewhere
|
|
413
|
+
* there may be no floor at all. Naming the floor is the game saying
|
|
414
|
+
* where it is, and that is the only case where an offset is honest.
|
|
415
|
+
*
|
|
416
|
+
* An {@link InstancedMesh} honours it too, as one throw shared by the
|
|
417
|
+
* whole set, measured in the SET's own blob radius.
|
|
418
|
+
* @type {number}
|
|
419
|
+
* @default 0
|
|
420
|
+
*/
|
|
421
|
+
shadowOffset: number;
|
|
422
|
+
/**
|
|
423
|
+
* How much longer the ground shadow is along its direction, for the
|
|
424
|
+
* look of a low light. `1` leaves it round.
|
|
425
|
+
*
|
|
426
|
+
* Clamped to 3, and the blob fades as it stretches: this is art
|
|
427
|
+
* direction, not a projection, and the further it is pulled the less
|
|
428
|
+
* there is to believe. Values below `1` are treated as `1`; shortening
|
|
429
|
+
* the blob is what {@link Mesh#shadowScale} is for.
|
|
430
|
+
*
|
|
431
|
+
* An {@link InstancedMesh} honours it too: one stretch along one
|
|
432
|
+
* direction for the whole set, baked into the quad its blobs share
|
|
433
|
+
* rather than into the matrix that also places them.
|
|
434
|
+
* @type {number}
|
|
435
|
+
* @default 1
|
|
436
|
+
*/
|
|
437
|
+
shadowStretch: number;
|
|
438
|
+
/**
|
|
439
|
+
* X of the ground direction the shadow is cast along.
|
|
440
|
+
* @type {number}
|
|
441
|
+
* @default 0
|
|
442
|
+
* @see Mesh#shadowOffset
|
|
443
|
+
*/
|
|
444
|
+
shadowDirectionX: number;
|
|
445
|
+
/**
|
|
446
|
+
* Z of the ground direction the shadow is cast along. Together with
|
|
447
|
+
* {@link Mesh#shadowDirectionX}, a zero-length pair means no offset and
|
|
448
|
+
* no stretch.
|
|
449
|
+
* @type {number}
|
|
450
|
+
* @default 0
|
|
451
|
+
* @see Mesh#shadowOffset
|
|
452
|
+
*/
|
|
453
|
+
shadowDirectionZ: number;
|
|
454
|
+
/**
|
|
455
|
+
* A {@link Light3d} to take the shadow direction from, instead of
|
|
456
|
+
* setting it by hand.
|
|
457
|
+
*
|
|
458
|
+
* Read every draw, so a sun that moves carries the shadow with it.
|
|
459
|
+
* NOTHING is inferred: the engine never picks a dominant light for you,
|
|
460
|
+
* because a scene with several has no non-arbitrary answer and one with
|
|
461
|
+
* none has no answer at all. Name the light or get no direction.
|
|
462
|
+
* @type {Light3d|undefined}
|
|
463
|
+
* @example
|
|
464
|
+
* // one sun, every shadow in the scene following it. Read every draw,
|
|
465
|
+
* // so a day/night cycle needs nothing else.
|
|
466
|
+
* const sun = new Light3d({ direction: [0.4, 1, 0.2] });
|
|
467
|
+
* app.world.addChild(sun);
|
|
468
|
+
* for (const prop of props) {
|
|
469
|
+
* prop.castGroundShadow = true;
|
|
470
|
+
* prop.shadowGroundY = floorY;
|
|
471
|
+
* prop.shadowLight = sun; // instead of shadowDirectionX / Z
|
|
472
|
+
* prop.shadowOffset = 0.8; // slid out from its feet, in blob radii
|
|
473
|
+
* prop.shadowStretch = 2; // and pulled long, for a low sun
|
|
474
|
+
* }
|
|
475
|
+
* // later: turning the sun turns every blob with it
|
|
476
|
+
* sun.direction.set(Math.sin(t), 1, Math.cos(t)).normalize();
|
|
477
|
+
*/
|
|
478
|
+
shadowLight: Light3d | undefined;
|
|
479
|
+
/**
|
|
480
|
+
* Takes an array or a `Vector3d` and keeps a copy of its own, so a game
|
|
481
|
+
* placing these from one scratch vector per frame does not end up with
|
|
482
|
+
* every shadow in the scene sharing a point. `undefined` goes back to
|
|
483
|
+
* `shadowGroundY` and the caster's own column.
|
|
484
|
+
* @param {number[]|Vector3d|undefined} value - the point on the floor
|
|
485
|
+
* @example
|
|
486
|
+
* // a rock resting on a globe: the contact point is radially below it,
|
|
487
|
+
* // and the floor it lands on faces the same way
|
|
488
|
+
* rock.shadowGroundPoint = surfacePoint;
|
|
489
|
+
* rock.shadowGroundNormal = outwardNormal;
|
|
490
|
+
*/
|
|
491
|
+
set shadowGroundPoint(value: number[] | Vector3d | undefined);
|
|
492
|
+
/**
|
|
493
|
+
* The point on the floor the blob lands on, for ground that is not flat.
|
|
494
|
+
*
|
|
495
|
+
* {@link Mesh#shadowGroundY} names a HEIGHT and lets the caster's own
|
|
496
|
+
* vertical column supply the rest, which is a flat-world assumption: the
|
|
497
|
+
* blob can only ever be directly below the thing casting it. That is the
|
|
498
|
+
* right answer for a platformer, and the wrong one anywhere "down" is not
|
|
499
|
+
* world down. On a sphere it is radial, so a blob pinned to the column
|
|
500
|
+
* lands BESIDE its caster by the drop times the tangent of the tilt.
|
|
501
|
+
*
|
|
502
|
+
* Set this and the blob goes where you put it. It supersedes
|
|
503
|
+
* `shadowGroundY`, which it already contains, and it names a floor the
|
|
504
|
+
* same way, so {@link Mesh#shadowOffset} and the height fade work with it;
|
|
505
|
+
* pair it with {@link Mesh#shadowGroundNormal} to say which way that floor
|
|
506
|
+
* faces, and the fade is then measured along that normal rather than
|
|
507
|
+
* straight down.
|
|
508
|
+
* Per object only. An {@link InstancedMesh} shares one plane across a
|
|
509
|
+
* set, built through the set's own origin, and refuses this with a
|
|
510
|
+
* warning rather than accepting it silently. `level.load()` and
|
|
511
|
+
* `GLTFScene` do not forward it either, since one point shared by every
|
|
512
|
+
* part of a scene would stack that scene's blobs on a single spot; set
|
|
513
|
+
* it on the part you want after the load.
|
|
514
|
+
* @type {Vector3d|undefined}
|
|
515
|
+
* @default undefined
|
|
516
|
+
* @see Mesh#shadowGroundY
|
|
517
|
+
* @see Mesh#shadowGroundNormal
|
|
518
|
+
*/
|
|
519
|
+
get shadowGroundPoint(): Vector3d | undefined;
|
|
520
|
+
/**
|
|
521
|
+
* Takes an array or a `Vector3d` and keeps a normalized copy of its own,
|
|
522
|
+
* so a game that goes on mutating what it passed does not steer this
|
|
523
|
+
* mesh's shadow by accident. `undefined` puts the blob back level.
|
|
524
|
+
* @param {number[]|Vector3d|undefined} value - the floor's up normal
|
|
525
|
+
* @example
|
|
526
|
+
* // a prop standing on a 20 degree hillside: `shadowGroundY` says where
|
|
527
|
+
* // the floor is, this says which way it faces. World up is (0, -1, 0),
|
|
528
|
+
* // because render space is Y-down.
|
|
529
|
+
* prop.shadowGroundY = groundAt(prop.pos.x);
|
|
530
|
+
* prop.shadowGroundNormal = [Math.sin(0.35), -Math.cos(0.35), 0];
|
|
531
|
+
*/
|
|
532
|
+
set shadowGroundNormal(value: number[] | Vector3d | undefined);
|
|
533
|
+
/**
|
|
534
|
+
* The UP normal of the floor this object's shadow lands on, for a
|
|
535
|
+
* surface that is not level.
|
|
536
|
+
*
|
|
537
|
+
* {@link Mesh#shadowGroundY} says where the floor is and this says
|
|
538
|
+
* which way it faces, so it is honoured only alongside it: tilting the
|
|
539
|
+
* fallback plane, which is the caster's own bounds, has no anchor to
|
|
540
|
+
* tilt about. Defaults to world up, which is `(0, -1, 0)` because
|
|
541
|
+
* render space is Y-down, and that default reproduces a level blob
|
|
542
|
+
* exactly.
|
|
543
|
+
*
|
|
544
|
+
* The blob is ROTATED onto the plane, not projected, so it keeps its
|
|
545
|
+
* shape; it sits directly under the caster rather than sliding along the
|
|
546
|
+
* slope, unless {@link Mesh#shadowGroundPoint} says otherwise, and it is
|
|
547
|
+
* still a flat quad with no contact with what it lies on.
|
|
548
|
+
*
|
|
549
|
+
* The tilt is clamped at 75 degrees ALONGSIDE `shadowGroundY`, past
|
|
550
|
+
* which an edge-on blob has nothing left to show. That ceiling measures
|
|
551
|
+
* the tilt from world up, which stands in for "tilted away from the
|
|
552
|
+
* viewer" only while the camera looks down the Y axis; it is lifted
|
|
553
|
+
* alongside `shadowGroundPoint`, where a point and a normal state the
|
|
554
|
+
* plane outright and there is nothing left to guess.
|
|
555
|
+
*
|
|
556
|
+
* On an {@link InstancedMesh} the plane serves the WHOLE set: it passes
|
|
557
|
+
* through the set's origin at `shadowGroundY` and faces this way, and
|
|
558
|
+
* every blob is projected onto it whatever height its own instance sits
|
|
559
|
+
* at, exactly as the level case puts every blob at one height. A scatter
|
|
560
|
+
* spread over curved ground is therefore one set per flat facet, each
|
|
561
|
+
* with the facet's own plane, not one set with an averaged normal.
|
|
562
|
+
* @type {Vector3d|undefined}
|
|
563
|
+
* @default undefined
|
|
564
|
+
* @example
|
|
565
|
+
* // a prop resting on a 20 degree slope that falls away along +x
|
|
566
|
+
* prop.shadowGroundY = floorY;
|
|
567
|
+
* prop.shadowGroundNormal = [Math.sin(0.35), -Math.cos(0.35), 0];
|
|
568
|
+
*/
|
|
569
|
+
get shadowGroundNormal(): Vector3d | undefined;
|
|
333
570
|
/**
|
|
334
571
|
* whether to cull back-facing triangles
|
|
335
572
|
* @type {boolean}
|
|
@@ -502,6 +739,29 @@ export default class Mesh extends Renderable {
|
|
|
502
739
|
* }
|
|
503
740
|
*/
|
|
504
741
|
setVertexColor(index: number, color: Color): void;
|
|
742
|
+
set shader(value: GLShader | undefined);
|
|
743
|
+
/**
|
|
744
|
+
* A custom shader hosted on this mesh's draw, replacing the built-in
|
|
745
|
+
* mesh shading: a {@link GLShader} carrying a `{vertex, fragment}`
|
|
746
|
+
* GLSL program (hosted by the WebGL renderer) and/or a complete
|
|
747
|
+
* `wgsl` module (hosted by the WebGPU renderer — see the GLShader
|
|
748
|
+
* class docs for the module contract). One object serves both
|
|
749
|
+
* backends; a shader without a realization for the active backend
|
|
750
|
+
* (or `null`) degrades to the built-in shading. The tint, texture,
|
|
751
|
+
* placement and (for `lit` meshes) light data keep flowing through
|
|
752
|
+
* their usual uniforms — the custom shader decides what to do with
|
|
753
|
+
* them.
|
|
754
|
+
* @type {GLShader|undefined}
|
|
755
|
+
* @example
|
|
756
|
+
* me.loader.preload([{ name: "toon", type: "shader", src: {
|
|
757
|
+
* vertex: "shaders/toon.vert", // GLSL pair for WebGL
|
|
758
|
+
* fragment: "shaders/toon.frag",
|
|
759
|
+
* wgsl: "shaders/toon.wgsl", // complete module for WebGPU
|
|
760
|
+
* }}], () => {
|
|
761
|
+
* myMesh.addPostEffect(me.loader.getShader("toon"));
|
|
762
|
+
* });
|
|
763
|
+
*/
|
|
764
|
+
get shader(): GLShader | undefined;
|
|
505
765
|
/**
|
|
506
766
|
* The mesh's world-space 3D axis-aligned bounding box. This is the 3D analog
|
|
507
767
|
* of {@link Renderable#getBounds} (which returns a flat 2D box from
|
|
@@ -517,6 +777,69 @@ export default class Mesh extends Renderable {
|
|
|
517
777
|
* @returns {AABB3d} the world-space bounding box (reused instance)
|
|
518
778
|
*/
|
|
519
779
|
getBounds3d(): AABB3d;
|
|
780
|
+
/**
|
|
781
|
+
* Tint this mesh from a LINEAR material factor.
|
|
782
|
+
*
|
|
783
|
+
* The counterpart of {@link Renderable#setTint}, which takes an ordinary
|
|
784
|
+
* sRGB colour: this one takes the form a renderer's own colour space
|
|
785
|
+
* states it in, which in practice means a glTF `baseColorFactor`, and
|
|
786
|
+
* encodes it. Scaling such a value by 255 into `setColor` instead renders
|
|
787
|
+
* the material 60 to 70 counts too dark in the midtones.
|
|
788
|
+
*
|
|
789
|
+
* The same thing the `baseColorFactor` SETTING does at construction, so a
|
|
790
|
+
* material that changes during play is reached the same way as one that
|
|
791
|
+
* is set up front. `emissive`, `specular` and `shininess` are all
|
|
792
|
+
* settable after construction; this was the one material value that was
|
|
793
|
+
* not.
|
|
794
|
+
*
|
|
795
|
+
* A METHOD rather than a property, deliberately: the factor is encoded
|
|
796
|
+
* into {@link Renderable#tint} and nothing holds the original, so a
|
|
797
|
+
* readable `baseColorFactor` would either have to invert the encoding or
|
|
798
|
+
* keep a copy that goes stale the moment anything writes `tint`.
|
|
799
|
+
* @param {number[]|Float32Array} factor - `[r, g, b]` in 0..1, linear
|
|
800
|
+
* @returns {this} this mesh, for chaining
|
|
801
|
+
* @example
|
|
802
|
+
* // what the glTF loader hands back, applied by hand
|
|
803
|
+
* mesh.setBaseColorFactor(node.baseColorFactor);
|
|
804
|
+
* // and the sRGB counterpart, for a colour a game picked
|
|
805
|
+
* mesh.setTint("#ff8800");
|
|
806
|
+
*/
|
|
807
|
+
setBaseColorFactor(factor: number[] | Float32Array): this;
|
|
808
|
+
/**
|
|
809
|
+
* Draw the mesh (automatically called by melonJS). Picks between two
|
|
810
|
+
* projection paths based on the camera that was active when this mesh
|
|
811
|
+
* was added to the world (captured in {@link Mesh#onActivateEvent}):
|
|
812
|
+
*
|
|
813
|
+
* - **Camera3d** → world-space output via {@link Mesh#_projectVerticesWorld}.
|
|
814
|
+
* Vertices land in world coordinates at `(pos.x, pos.y, depth)`; the
|
|
815
|
+
* camera's perspective handles the final projection per-frame on the
|
|
816
|
+
* GPU. Triangle winding is reversed once at first draw so back-face
|
|
817
|
+
* culling stays correct under the Y-flip.
|
|
818
|
+
* - **Camera2d** (or no camera) → legacy self-projection via
|
|
819
|
+
* {@link Mesh#projectionMatrix} × {@link Renderable#currentTransform},
|
|
820
|
+
* emitting vertices in pixel-ish space directly. Backwards-compatible
|
|
821
|
+
* with single-mesh-in-a-2D-scene usage.
|
|
822
|
+
*
|
|
823
|
+
* Multi-material meshes need no extra `drawMesh` calls per material vs
|
|
824
|
+
* single-material — each material's diffuse color is baked into
|
|
825
|
+
* `vertexColors` at construction time and pushed through the renderer's
|
|
826
|
+
* per-vertex `aColor` (GPU backends) or per-triangle solid-fill (Canvas)
|
|
827
|
+
* path. The GPU batchers may still chunk very large meshes across multiple
|
|
828
|
+
* `drawElements` calls to fit its vertex/index buffer limits, and split the
|
|
829
|
+
* draw once per entry in {@link Mesh#textureGroups} when the materials
|
|
830
|
+
* carry different diffuse textures (#1573).
|
|
831
|
+
*
|
|
832
|
+
* The active path is picked from the `viewport` passed in by
|
|
833
|
+
* `Container.draw`, NOT from the activation-time `_useWorldSpace`
|
|
834
|
+
* flag. The flag is kept as a fallback only for callers that
|
|
835
|
+
* invoke `draw(renderer)` without a viewport (tests, batched
|
|
836
|
+
* builds). Without the per-draw read, a stage with multiple
|
|
837
|
+
* cameras (Camera3d main + Camera2d minimap, say) would run the
|
|
838
|
+
* wrong projection on whichever camera didn't match activation.
|
|
839
|
+
* @param {Renderer} renderer - a renderer instance
|
|
840
|
+
* @param {Camera2d} [viewport] - the camera rendering this frame
|
|
841
|
+
*/
|
|
842
|
+
draw(renderer: Renderer, viewport?: Camera2d): void;
|
|
520
843
|
/**
|
|
521
844
|
* Render the mesh at its current state (transforms, projection, tint) to an offscreen canvas.
|
|
522
845
|
* The returned canvas can be used with `renderer.drawImage()`, as a `Sprite` image source,
|
|
@@ -576,7 +899,7 @@ export type MeshSettings = {
|
|
|
576
899
|
/**
|
|
577
900
|
* - display width in pixels. With normalization on (the default) the model is scaled to fit this size; with `normalize: false` this is the uniform pixels-per-unit scale applied to the raw geometry. With `normalize: false` and an explicit `scale`, an omitted `width`/`height` is derived from the GEOMETRY's own extent, the way a Sprite takes its size from its frame — a mesh that reports no extent misleads frustum culling, pointer picking and the physics broadphase alike.
|
|
578
901
|
*/
|
|
579
|
-
width
|
|
902
|
+
width?: number;
|
|
580
903
|
/**
|
|
581
904
|
* - display height in pixels (normalized models only; ignored when `normalize: false`)
|
|
582
905
|
*/
|
|
@@ -625,6 +948,10 @@ export type MeshSettings = {
|
|
|
625
948
|
* - 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.
|
|
626
949
|
*/
|
|
627
950
|
normals?: number[] | Float32Array;
|
|
951
|
+
/**
|
|
952
|
+
* - the material's base colour factor `[r, g, b]` in 0..1, LINEAR, applied as the mesh tint. That is the form a glTF material states it in (spec 3.9.2) and the form the loader hands back, so a mesh built from a node passes the node's own field straight through. It is ENCODED rather than scaled: a linear factor pushed through `tint.setColor` by multiplying by 255 renders every untextured material 60 to 70 counts too dark in the midtones, which reads as a lighting fault and gets debugged as one. For an ordinary sRGB colour use {@link Renderable#setTint}. The type admits `undefined` deliberately: the loader declares the field optional, so `baseColorFactor: node.baseColorFactor` is the headline use and it has to compile for a consumer building under `exactOptionalPropertyTypes`.
|
|
953
|
+
*/
|
|
954
|
+
baseColorFactor?: number[] | Float32Array | undefined;
|
|
628
955
|
/**
|
|
629
956
|
* - 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.
|
|
630
957
|
*/
|
|
@@ -649,6 +976,10 @@ export type MeshSettings = {
|
|
|
649
976
|
* - 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
|
|
650
977
|
*/
|
|
651
978
|
transparent?: boolean;
|
|
979
|
+
/**
|
|
980
|
+
* - whether geometry in front of this mesh hides it. `false` draws it over whatever is already there, for a glow or an overlay that has no surface to be occluded ON. Separate from the depth WRITE the transparent pass turns off on its own. Transparent pass only, GPU backends only
|
|
981
|
+
*/
|
|
982
|
+
depthTest?: boolean;
|
|
652
983
|
/**
|
|
653
984
|
* - set `false` to exempt this mesh from the camera's distance fog ({@link Camera3d#setFog}); omit to fog whenever the camera does
|
|
654
985
|
*/
|
|
@@ -661,14 +992,48 @@ export type MeshSettings = {
|
|
|
661
992
|
* - opacity of the shadow directly beneath the object, before any height fade.
|
|
662
993
|
*/
|
|
663
994
|
shadowOpacity?: number;
|
|
995
|
+
/**
|
|
996
|
+
* - multiplier for the ground shadow's footprint. Non-positive or non-finite values hide the shadow without hiding the mesh.
|
|
997
|
+
*/
|
|
998
|
+
shadowScale?: number;
|
|
999
|
+
/**
|
|
1000
|
+
* - how far to slide the shadow along `shadowDirectionX`/`shadowDirectionZ`, in multiples of the blob's own radius, for the look of a light that is not directly overhead. A ratio rather than a world distance so one value serves casters of any size. Honoured only when the floor has been named, by `shadowGroundY` or by `shadowGroundPoint`, since the blob is a flat quad and sliding it off a plane the game has NOT named puts it somewhere there is no floor. On an `InstancedMesh` it is one throw for the whole set.
|
|
1001
|
+
*/
|
|
1002
|
+
shadowOffset?: number;
|
|
1003
|
+
/**
|
|
1004
|
+
* - how much longer the blob is along `shadowDirectionX`/`shadowDirectionZ`, for the look of a low light. Clamped to 3, and the shadow fades as it stretches. On an `InstancedMesh` it is one stretch for the whole set.
|
|
1005
|
+
*/
|
|
1006
|
+
shadowStretch?: number;
|
|
1007
|
+
/**
|
|
1008
|
+
* - x of the ground direction the shadow is cast along. Together with `shadowDirectionZ`, zero length means no offset and no stretch.
|
|
1009
|
+
*/
|
|
1010
|
+
shadowDirectionX?: number;
|
|
1011
|
+
/**
|
|
1012
|
+
* - z of the ground direction the shadow is cast along.
|
|
1013
|
+
*/
|
|
1014
|
+
shadowDirectionZ?: number;
|
|
1015
|
+
/**
|
|
1016
|
+
* - the point on the floor the blob lands on, for ground that is not flat. Supersedes `shadowGroundY`, which can only put the blob on the caster's own vertical column; anywhere "down" is not world down, such as on a sphere, that lands the blob beside its caster rather than under it. Names a floor the same way `shadowGroundY` does, so `shadowOffset` and the height fade work with it.
|
|
1017
|
+
*/
|
|
1018
|
+
shadowGroundPoint?: number[] | Vector3d;
|
|
1019
|
+
/**
|
|
1020
|
+
* - the UP normal of the floor the shadow lands on, for a surface that is not level. Needs the floor to be named, by `shadowGroundY` or by `shadowGroundPoint`; this says which way it faces. Defaults to world up. The tilt is clamped at 75 degrees alongside `shadowGroundY`, and NOT clamped alongside `shadowGroundPoint`, which states the plane outright. On an `InstancedMesh` one plane serves the whole set, through the set's origin at `shadowGroundY`, so a scatter over curved ground is one set per facet.
|
|
1021
|
+
*/
|
|
1022
|
+
shadowGroundNormal?: number[] | Vector3d;
|
|
1023
|
+
/**
|
|
1024
|
+
* - a {@link Light3d} to take the direction from instead of setting it by hand. Read every draw, so a moving sun carries the shadow with it. Nothing is inferred from the scene: no light here means no direction.
|
|
1025
|
+
*/
|
|
1026
|
+
shadowLight?: Light3d;
|
|
664
1027
|
};
|
|
665
1028
|
import Renderable from "./renderable.js";
|
|
666
1029
|
import { TextureAtlas } from "./../video/texture/atlas.js";
|
|
1030
|
+
import type { Light3d } from "../lighting/light3d.ts";
|
|
1031
|
+
import { Vector3d } from "../math/vector3d.ts";
|
|
667
1032
|
import { Color } from "../math/color.ts";
|
|
668
1033
|
import { Matrix3d } from "../math/matrix3d.ts";
|
|
669
|
-
import
|
|
670
|
-
import { Polygon } from "../geometries/polygon.ts";
|
|
1034
|
+
import type GLShader from "../video/webgl/glshader.js";
|
|
671
1035
|
import { AABB3d } from "../physics/broadphase/aabb3d.ts";
|
|
672
|
-
import
|
|
1036
|
+
import Renderer from "./../video/renderer.js";
|
|
1037
|
+
import type Camera2d from "../camera/camera2d.ts";
|
|
673
1038
|
import Texture2d from "./../video/texture/texture2d.ts";
|
|
674
1039
|
//# sourceMappingURL=mesh.d.ts.map
|
|
@@ -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":"AAmjBA;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,eAhDW,MAAM,KACN,MAAM,YACN,YAAY,EA8iCtB;IAn/BC;;;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;IAEd;;;;;;;;;OASG;IACH,SAFU,YAAY,CAE+B;IAErD;;;;;;;;;OASG;IACH,KAHU,OAAO,CAGe;IAEhC;;;;;;;;;OASG;IACH,aAHU,MAAM,CAIoD;IAEpE;;;;;;;;;OASG;IACH,UAFU,YAAY,GAAC,SAAS,CAEa;IAE7C;;;;;;;;;;;;OAYG;IACH,UAHU,YAAY,GAAC,SAAS,CAGa;IAE7C;;;;;;;;OAQG;IACH,WAHU,MAAM,CAIgD;IAWhE;;;;;;;;;;OAUG;IACH,UAFU,YAAY,GAAC,SAAS,CAEP;IAEzB;;;;;;;;;;;;;;;OAeG;IACH,WAFU,YAAY,GAAC,SAAS,CAEN;IAE1B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,kBAJU,OAAO,GAAC,SAAS,CAOd;IAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,KAfU,OAAO,GAAC,SAAS,CAe4C;IAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0DG;IACH,aAhBU,OAAO,GAAC,SAAS,CAmBd;IAEb;;;;;;;;;;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OAAO;;;;mBACP,WAAW,GAAC,KAAK,EAAE,GAAC,MAAM,EAAE;;;;cAC5B,MAAM,EAAE,GAAC,YAAY;;;;sBACrB,MAAM,EAAE,GAAC,YAAY,GAAC,SAAS;;;;eAC/B,MAAM,EAAE,GAAC,YAAY;;;;gBACrB,MAAM;;;;gBACN,MAAM,GAAC,YAAY,GAAC,gBAAgB;;;;eACpC,MAAM,GAAC,YAAY,GAAC,gBAAgB;;;;uBACpC,OAAO;;;;kBACP,OAAO;;;;gBACP,OAAO;;;;UACP,OAAO;;;;oBACP,MAAM;;;;oBACN,MAAM;;;;kBACN,MAAM;;;;mBACN,MAAM;;;;oBACN,MAAM;;;;uBACN,MAAM;;;;uBACN,MAAM;;;;wBACN,MAAM,EAAE,GAAC,QAAQ;;;;yBACjB,MAAM,EAAE,GAAC,QAAQ;;;;kBACjB,OAAO;;uBAldE,iBAAiB;6BAVX,6BAA6B;6BAuBhC,wBAAwB;yBAhCzB,qBAAqB;sBAHxB,kBAAkB;yBACf,qBAAqB;yBACrB,qBAAqB;wBALtB,0BAA0B;0BAuCzB,4BAA4B;uBA1B9B,iCAAiC;+BAuB1B,oCAAoC;qBAtB7C,wBAAwB;0BAuBpB,uBAAuB;sBArB1B,iCAAiC"}
|
|
@@ -47,20 +47,8 @@ export default class NineSliceSprite extends Sprite {
|
|
|
47
47
|
anchorPoint?: string | Vector2d | {
|
|
48
48
|
x: number;
|
|
49
49
|
y: number;
|
|
50
|
-
};
|
|
50
|
+
} | undefined;
|
|
51
51
|
});
|
|
52
|
-
set width(value: number);
|
|
53
|
-
/**
|
|
54
|
-
* width of the NineSliceSprite
|
|
55
|
-
* @type {number}
|
|
56
|
-
*/
|
|
57
|
-
get width(): number;
|
|
58
|
-
set height(value: number);
|
|
59
|
-
/**
|
|
60
|
-
* height of the NineSliceSprite
|
|
61
|
-
* @type {number}
|
|
62
|
-
*/
|
|
63
|
-
get height(): number;
|
|
64
52
|
nss_width: number;
|
|
65
53
|
nss_height: number;
|
|
66
54
|
insetx: number | undefined;
|
|
@@ -68,5 +56,7 @@ export default class NineSliceSprite extends Sprite {
|
|
|
68
56
|
}
|
|
69
57
|
import Sprite from "./sprite.js";
|
|
70
58
|
import type { TextureAtlas } from "./../video/texture/atlas.js";
|
|
59
|
+
import type { CompressedImage } from "../loader/parsers/compressed_textures/compressed_image.js";
|
|
71
60
|
import type { Color } from "./../math/color.ts";
|
|
61
|
+
import type { Vector2d } from "../math/vector2d.ts";
|
|
72
62
|
//# sourceMappingURL=nineslicesprite.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nineslicesprite.d.ts","sourceRoot":"","sources":["../../src/renderable/nineslicesprite.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nineslicesprite.d.ts","sourceRoot":"","sources":["../../src/renderable/nineslicesprite.js"],"names":[],"mappings":"AAoBA;;;;;;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;eAAvC,MAAM;eAAG,MAAM;;KAC1C,EA8BF;IALA,kBAA2B;IAC3B,mBAA6B;IAE7B,2BAA6B;IAC7B,2BAA6B;IAmD9B;;;OAGG;IACH,0BA6EC;CACD;mBA/MkB,aAAa;kCAKC,6BAA6B;qCAC5B,2DAA2D;2BAFrE,oBAAoB;8BAGjB,qBAAqB"}
|