melonjs 20.3.0 → 20.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -19
- package/build/application/application.d.ts +0 -17
- package/build/application/application.d.ts.map +1 -1
- package/build/application/settings.d.ts +3 -0
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/backend/engine.d.ts +0 -19
- package/build/audio/backend/engine.d.ts.map +1 -1
- package/build/audio/backend/sound.d.ts +1 -51
- package/build/audio/backend/sound.d.ts.map +1 -1
- package/build/audio/backend/spatial.d.ts.map +1 -1
- package/build/audio/backend/types.d.ts +11 -1
- package/build/audio/backend/types.d.ts.map +1 -1
- package/build/audio/backend/voice.d.ts +0 -25
- package/build/audio/backend/voice.d.ts.map +1 -1
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/procedural.d.ts +7 -2
- package/build/audio/procedural.d.ts.map +1 -1
- package/build/audio/state.d.ts +6 -79
- package/build/audio/state.d.ts.map +1 -1
- package/build/audio/types.d.ts +22 -0
- package/build/audio/types.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +28 -68
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +110 -82
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/camera/effects/fade_effect.d.ts +0 -5
- package/build/camera/effects/fade_effect.d.ts.map +1 -1
- package/build/camera/effects/mask_effect.d.ts +0 -5
- package/build/camera/effects/mask_effect.d.ts.map +1 -1
- package/build/camera/fog.d.ts +118 -0
- package/build/camera/fog.d.ts.map +1 -0
- package/build/geometries/box3d.d.ts +0 -28
- package/build/geometries/box3d.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +0 -20
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/observablePoint.d.ts +0 -3
- package/build/geometries/observablePoint.d.ts.map +1 -1
- package/build/geometries/path2d.d.ts +0 -19
- package/build/geometries/path2d.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +7 -13
- 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 +5 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3697 -563
- package/build/index.js.map +4 -4
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/input/pointer.d.ts +0 -4
- package/build/input/pointer.d.ts.map +1 -1
- package/build/input/pointerevent.d.ts +0 -6
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/lang/deprecated.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts +44 -82
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/level/gltf/GLTFScene.d.ts +1 -44
- package/build/level/gltf/GLTFScene.d.ts.map +1 -1
- package/build/level/gltf/gltf_sampler.d.ts +1 -48
- package/build/level/gltf/gltf_sampler.d.ts.map +1 -1
- package/build/level/level.d.ts +195 -113
- package/build/level/level.d.ts.map +1 -1
- package/build/level/tiled/TMXGroup.d.ts +1 -65
- package/build/level/tiled/TMXGroup.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +0 -44
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +1 -136
- package/build/level/tiled/TMXObject.d.ts.map +1 -1
- package/build/level/tiled/TMXObjectFactory.d.ts +1 -40
- package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
- package/build/level/tiled/TMXTile.d.ts +1 -30
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +0 -10
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +0 -113
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts +0 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
- package/build/level/tiled/TMXUtils.d.ts +1 -43
- package/build/level/tiled/TMXUtils.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts +1 -7
- package/build/level/tiled/factories/shape.d.ts.map +1 -1
- package/build/level/tiled/factories/text.d.ts +1 -7
- package/build/level/tiled/factories/text.d.ts.map +1 -1
- package/build/level/tiled/factories/tile.d.ts +1 -7
- package/build/level/tiled/factories/tile.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +0 -60
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +0 -42
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +0 -5
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +0 -31
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +2 -2
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/autodetect.d.ts +1 -6
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
- package/build/lighting/light2d.d.ts +0 -25
- package/build/lighting/light2d.d.ts.map +1 -1
- package/build/lighting/light3d.d.ts +20 -63
- package/build/lighting/light3d.d.ts.map +1 -1
- package/build/loader/loader.d.ts +146 -37
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts +0 -33
- package/build/loader/loadingscreen.d.ts.map +1 -1
- package/build/loader/parsers/aseprite.d.ts +0 -13
- package/build/loader/parsers/aseprite.d.ts.map +1 -1
- package/build/loader/parsers/audio.d.ts +1 -30
- package/build/loader/parsers/audio.d.ts.map +1 -1
- package/build/loader/parsers/binary.d.ts +1 -10
- package/build/loader/parsers/binary.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -1
- package/build/loader/parsers/fontface.d.ts +1 -13
- package/build/loader/parsers/fontface.d.ts.map +1 -1
- package/build/loader/parsers/gltf.d.ts +1 -70
- package/build/loader/parsers/gltf.d.ts.map +1 -1
- package/build/loader/parsers/image.d.ts +1 -22
- package/build/loader/parsers/image.d.ts.map +1 -1
- package/build/loader/parsers/json.d.ts +1 -10
- package/build/loader/parsers/json.d.ts.map +1 -1
- package/build/loader/parsers/mtl.d.ts +1 -28
- package/build/loader/parsers/mtl.d.ts.map +1 -1
- package/build/loader/parsers/obj.d.ts +1 -59
- package/build/loader/parsers/obj.d.ts.map +1 -1
- package/build/loader/parsers/pbr.d.ts +1 -62
- package/build/loader/parsers/pbr.d.ts.map +1 -1
- package/build/loader/parsers/script.d.ts +1 -10
- package/build/loader/parsers/script.d.ts.map +1 -1
- package/build/loader/parsers/shader.d.ts +1 -52
- package/build/loader/parsers/shader.d.ts.map +1 -1
- package/build/loader/parsers/tmx.d.ts +1 -10
- package/build/loader/parsers/tmx.d.ts.map +1 -1
- package/build/loader/parsers/video.d.ts +1 -10
- package/build/loader/parsers/video.d.ts.map +1 -1
- package/build/math/color.d.ts.map +1 -1
- package/build/math/noise.d.ts +0 -40
- package/build/math/noise.d.ts.map +1 -1
- package/build/math/observableVector2d.d.ts +0 -3
- package/build/math/observableVector2d.d.ts.map +1 -1
- package/build/math/observableVector3d.d.ts +0 -3
- package/build/math/observableVector3d.d.ts.map +1 -1
- package/build/math/vector2d.d.ts +0 -6
- package/build/math/vector2d.d.ts.map +1 -1
- package/build/math/vertex.d.ts +25 -0
- package/build/math/vertex.d.ts.map +1 -1
- package/build/particles/emitter.d.ts +0 -65
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +0 -81
- package/build/particles/particle.d.ts.map +1 -1
- package/build/physics/bounds.d.ts +0 -1
- package/build/physics/bounds.d.ts.map +1 -1
- package/build/physics/broadphase/broadphase.d.ts +0 -7
- package/build/physics/broadphase/broadphase.d.ts.map +1 -1
- package/build/physics/broadphase/octree.d.ts +0 -91
- package/build/physics/broadphase/octree.d.ts.map +1 -1
- package/build/physics/broadphase/quadtree.d.ts +0 -47
- package/build/physics/broadphase/quadtree.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +2 -65
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts +0 -312
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/physics/builtin/sat.d.ts +1 -48
- package/build/physics/builtin/sat.d.ts.map +1 -1
- package/build/physics/builtin/sat3d.d.ts +1 -56
- package/build/physics/builtin/sat3d.d.ts.map +1 -1
- package/build/physics/collision.d.ts +0 -2
- package/build/physics/collision.d.ts.map +1 -1
- package/build/physics/response.d.ts +0 -1
- package/build/physics/response.d.ts.map +1 -1
- package/build/physics/world.d.ts.map +1 -1
- package/build/renderable/anchorPoint.d.ts +1 -73
- package/build/renderable/anchorPoint.d.ts.map +1 -1
- package/build/renderable/animation.d.ts +21 -13
- 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 +27 -60
- 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 +55 -108
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +257 -231
- 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 +18 -44
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +0 -45
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +12 -97
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +32 -21
- 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 +75 -20
- 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/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 +5 -50
- package/build/state/stage.d.ts.map +1 -1
- package/build/state/state.d.ts.map +1 -1
- package/build/system/device.d.ts +1 -13
- package/build/system/device.d.ts.map +1 -1
- package/build/system/dom.d.ts +1 -8
- package/build/system/dom.d.ts.map +1 -1
- package/build/system/legacy_pool.d.ts +1 -6
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/system/platform.d.ts +0 -1
- package/build/system/platform.d.ts.map +1 -1
- package/build/system/pool.d.ts +0 -9
- package/build/system/pool.d.ts.map +1 -1
- package/build/system/save.d.ts +44 -1
- package/build/system/save.d.ts.map +1 -1
- package/build/system/timer.d.ts +0 -20
- package/build/system/timer.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +0 -62
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/utils/array-multimap.d.ts +1 -13
- package/build/utils/array-multimap.d.ts.map +1 -1
- package/build/utils/decode.d.ts.map +1 -1
- package/build/utils/fetchdata.d.ts +1 -31
- package/build/utils/fetchdata.d.ts.map +1 -1
- package/build/utils/utils.d.ts +0 -13
- package/build/utils/utils.d.ts.map +1 -1
- package/build/video/blendmodes.d.ts +1 -106
- package/build/video/blendmodes.d.ts.map +1 -1
- package/build/video/buffer/index.d.ts +1 -39
- package/build/video/buffer/index.d.ts.map +1 -1
- package/build/video/buffer/vertex.d.ts +1 -82
- package/build/video/buffer/vertex.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +2 -23
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/canvas_factory.d.ts +1 -24
- package/build/video/canvas_factory.d.ts.map +1 -1
- package/build/video/effects/blendEffect.d.ts +0 -54
- package/build/video/effects/blendEffect.d.ts.map +1 -1
- package/build/video/effects/colorMatrix.d.ts +0 -10
- package/build/video/effects/colorMatrix.d.ts.map +1 -1
- package/build/video/effects/glsl_realization.d.ts +1 -17
- package/build/video/effects/glsl_realization.d.ts.map +1 -1
- package/build/video/effects/mesh_splice.d.ts +2 -0
- package/build/video/effects/mesh_splice.d.ts.map +1 -0
- package/build/video/effects/radialGradient.d.ts +0 -1
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +12 -241
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/wgsl/layout.d.ts +1 -27
- package/build/video/effects/wgsl/layout.d.ts.map +1 -1
- package/build/video/effects/wgsl/parse.d.ts +1 -8
- package/build/video/effects/wgsl/parse.d.ts.map +1 -1
- package/build/video/effects/wgsl/scaffold.d.ts +1 -42
- package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
- package/build/video/effects/wgsl_realization.d.ts +1 -82
- package/build/video/effects/wgsl_realization.d.ts.map +1 -1
- package/build/video/gpu/batcher.d.ts +1 -13
- package/build/video/gpu/batcher.d.ts.map +1 -1
- package/build/video/gpu/instancerecord.d.ts +1 -163
- package/build/video/gpu/instancerecord.d.ts.map +1 -1
- package/build/video/gpu/meshchunk.d.ts +1 -48
- package/build/video/gpu/meshchunk.d.ts.map +1 -1
- package/build/video/gpu/meshvertex.d.ts +1 -53
- package/build/video/gpu/meshvertex.d.ts.map +1 -1
- package/build/video/gpu/primitives.d.ts +1 -59
- package/build/video/gpu/primitives.d.ts.map +1 -1
- package/build/video/gpu/quadcorners.d.ts +1 -10
- package/build/video/gpu/quadcorners.d.ts.map +1 -1
- package/build/video/gpu/textureslots.d.ts +1 -121
- package/build/video/gpu/textureslots.d.ts.map +1 -1
- package/build/video/gpu/texturestore.d.ts +1 -138
- package/build/video/gpu/texturestore.d.ts.map +1 -1
- package/build/video/gpu/topology.d.ts.map +1 -1
- package/build/video/gpu/vertexformat.d.ts +0 -28
- package/build/video/gpu/vertexformat.d.ts.map +1 -1
- package/build/video/gradient.d.ts +15 -77
- package/build/video/gradient.d.ts.map +1 -1
- package/build/video/renderer.d.ts +21 -102
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +0 -51
- package/build/video/renderstate.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +0 -10
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +1 -82
- package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
- package/build/video/rendertarget/webglrendertarget.d.ts +1 -64
- package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webgpurendertarget.d.ts +0 -8
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +1 -75
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +0 -136
- package/build/video/texture/cache.d.ts.map +1 -1
- package/build/video/texture/frametexture.d.ts +1 -71
- package/build/video/texture/frametexture.d.ts.map +1 -1
- package/build/video/texture/noise_texture2d.d.ts +101 -77
- 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 +7 -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 +22 -285
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +0 -6
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +0 -8
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/mesh_batcher.d.ts +7 -231
- 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 +1 -88
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +5 -4
- package/skills/melonjs/SKILL.md +1 -1
- package/skills/melonjs-3d/SKILL.md +453 -5
- package/skills/melonjs-3d-assets/SKILL.md +164 -6
- package/skills/melonjs-audio/SKILL.md +38 -0
- package/skills/melonjs-camera-and-drawing/SKILL.md +49 -0
- package/skills/melonjs-effects-and-shaders/SKILL.md +95 -2
- package/skills/melonjs-loading-assets/SKILL.md +127 -2
- package/skills/melonjs-performance/SKILL.md +60 -1
- package/skills/melonjs-physics/SKILL.md +78 -0
- package/skills/melonjs-renderables/SKILL.md +63 -1
- package/skills/melonjs-renderer-backends/SKILL.md +19 -0
- package/skills/melonjs-scenes-and-state/SKILL.md +56 -0
- package/skills/melonjs-tilemaps/SKILL.md +31 -11
- package/skills/melonjs-ui-and-text/SKILL.md +131 -117
|
@@ -5,10 +5,7 @@ import { Matrix3d } from "../math/matrix3d.ts";
|
|
|
5
5
|
import { Vector2d } from "../math/vector2d.ts";
|
|
6
6
|
import { Vector3d } from "../math/vector3d.ts";
|
|
7
7
|
import { Bounds } from "./../physics/bounds.ts";
|
|
8
|
-
import type Container from "./../renderable/container.js";
|
|
9
8
|
import Renderable from "./../renderable/renderable.js";
|
|
10
|
-
import ColorMatrixEffect from "./../video/effects/colorMatrix.js";
|
|
11
|
-
import type Renderer from "./../video/renderer.js";
|
|
12
9
|
import type CameraEffect from "./effects/camera_effect.ts";
|
|
13
10
|
/**
|
|
14
11
|
* @import Entity from "./../renderable/entity/entity.js";
|
|
@@ -108,10 +105,6 @@ export default class Camera2d extends Renderable {
|
|
|
108
105
|
* @default 0
|
|
109
106
|
*/
|
|
110
107
|
screenY: number;
|
|
111
|
-
/**
|
|
112
|
-
* @ignore
|
|
113
|
-
*/
|
|
114
|
-
_zoom: number;
|
|
115
108
|
/**
|
|
116
109
|
* the world-space projection matrix for non-default cameras (offset/zoomed).
|
|
117
110
|
* Maps world coordinates to the camera's screen viewport.
|
|
@@ -130,21 +123,11 @@ export default class Camera2d extends Renderable {
|
|
|
130
123
|
* @default true
|
|
131
124
|
*/
|
|
132
125
|
autoResize: boolean;
|
|
133
|
-
/**
|
|
134
|
-
* cached world view bounds
|
|
135
|
-
* @ignore
|
|
136
|
-
*/
|
|
137
|
-
_worldView: Bounds;
|
|
138
126
|
/**
|
|
139
127
|
* the default camera projection matrix
|
|
140
128
|
* (2d cameras use an orthographic projection by default).
|
|
141
129
|
*/
|
|
142
130
|
projectionMatrix: Matrix3d;
|
|
143
|
-
/**
|
|
144
|
-
* the invert camera transform used to unproject points
|
|
145
|
-
* @ignore
|
|
146
|
-
*/
|
|
147
|
-
invCurrentTransform: Matrix3d;
|
|
148
131
|
/** offset for shake effect */
|
|
149
132
|
offset: Vector2d;
|
|
150
133
|
/** target to follow */
|
|
@@ -167,8 +150,6 @@ export default class Camera2d extends Renderable {
|
|
|
167
150
|
* camera.colorMatrix.identity();
|
|
168
151
|
*/
|
|
169
152
|
colorMatrix: ColorMatrix;
|
|
170
|
-
/** @ignore */
|
|
171
|
-
_colorMatrixEffect: ColorMatrixEffect | null;
|
|
172
153
|
/** the camera deadzone */
|
|
173
154
|
deadzone: Rect;
|
|
174
155
|
/**
|
|
@@ -178,12 +159,6 @@ export default class Camera2d extends Renderable {
|
|
|
178
159
|
* @param maxY - end y offset
|
|
179
160
|
*/
|
|
180
161
|
constructor(minX: number, minY: number, maxX: number, maxY: number);
|
|
181
|
-
/** @ignore */
|
|
182
|
-
_updateProjectionMatrix(): void;
|
|
183
|
-
/** @ignore */
|
|
184
|
-
_followH(target: Vector2d | Vector3d): number;
|
|
185
|
-
/** @ignore */
|
|
186
|
-
_followV(target: Vector2d | Vector3d): number;
|
|
187
162
|
/**
|
|
188
163
|
* the zoom level of this camera.
|
|
189
164
|
* Values less than 1 zoom out (show more of the world),
|
|
@@ -193,6 +168,34 @@ export default class Camera2d extends Renderable {
|
|
|
193
168
|
* // zoom out to show the full level in a 180x100 minimap
|
|
194
169
|
* camera.zoom = Math.min(180 / levelWidth, 100 / levelHeight);
|
|
195
170
|
*/
|
|
171
|
+
/**
|
|
172
|
+
* Roll this camera in the screen plane, in radians — the 2D spelling of
|
|
173
|
+
* {@link Camera3d#roll}, so a helper that banks "a camera" works on either.
|
|
174
|
+
*
|
|
175
|
+
* Absolute and idempotent: assigning the same angle twice leaves the view
|
|
176
|
+
* where it was. It is a thin accessor over the camera's own
|
|
177
|
+
* `currentTransform`, which is what {@link Renderable#rotate} writes and
|
|
178
|
+
* what `worldToLocal` / `localToWorld` already undo — so picking under a
|
|
179
|
+
* rolled 2D camera stays correct for free.
|
|
180
|
+
*
|
|
181
|
+
* A 2D camera has no pitch or yaw, so a screen-plane rotation is its only
|
|
182
|
+
* rotation; on a `Camera3d` the roll is a real view angle instead, because
|
|
183
|
+
* a 3D view is built from its three angles and never reads
|
|
184
|
+
* `currentTransform`.
|
|
185
|
+
*
|
|
186
|
+
* This OWNS the camera's `currentTransform`: the setter rebuilds it rather
|
|
187
|
+
* than composing onto it, so assigning every frame cannot drift and
|
|
188
|
+
* `roll = 0` lands back on an exact identity. (A delta-based version does
|
|
189
|
+
* neither — a banking camera would accumulate float error across thousands
|
|
190
|
+
* of frames.) The cost is that a manual `rotate()` / `scale()` on the
|
|
191
|
+
* camera itself is discarded by the next assignment; a camera has `zoom`
|
|
192
|
+
* and `shake` for those jobs, and neither touches this matrix.
|
|
193
|
+
* @default 0
|
|
194
|
+
* @example
|
|
195
|
+
* camera.roll = Math.PI / 32; // a slight dutch angle
|
|
196
|
+
*/
|
|
197
|
+
get roll(): number;
|
|
198
|
+
set roll(value: number);
|
|
196
199
|
get zoom(): number;
|
|
197
200
|
set zoom(value: number);
|
|
198
201
|
/**
|
|
@@ -279,10 +282,6 @@ export default class Camera2d extends Renderable {
|
|
|
279
282
|
* @param y - vertical position
|
|
280
283
|
*/
|
|
281
284
|
moveTo(x: number, y: number): void;
|
|
282
|
-
/** @ignore */
|
|
283
|
-
updateTarget(dt?: number): void;
|
|
284
|
-
/** @ignore */
|
|
285
|
-
update(dt?: number): boolean;
|
|
286
285
|
/**
|
|
287
286
|
* shake the camera
|
|
288
287
|
* @param intensity - maximum offset that the screen can be moved
|
|
@@ -374,45 +373,6 @@ export default class Camera2d extends Renderable {
|
|
|
374
373
|
* @returns a vector with the converted local coordinates
|
|
375
374
|
*/
|
|
376
375
|
worldToLocal(x: number, y: number, v?: Vector2d): Vector2d;
|
|
377
|
-
/**
|
|
378
|
-
* Build and install the world + screen projections used when this
|
|
379
|
-
* camera is non-default (split-screen, picture-in-picture, etc.).
|
|
380
|
-
* Default behavior is a shifted ortho that places the camera's
|
|
381
|
-
* world view at the camera's screen-rect within the full renderer
|
|
382
|
-
* viewport. Subclasses (e.g. Camera3d) override this to install a
|
|
383
|
-
* perspective `worldProjection` instead.
|
|
384
|
-
* @ignore
|
|
385
|
-
*/
|
|
386
|
-
_setupNonDefaultProjection(renderer: Renderer): void;
|
|
387
|
-
/**
|
|
388
|
-
* render the camera effects
|
|
389
|
-
* @ignore
|
|
390
|
-
*/
|
|
391
|
-
drawFX(renderer: Renderer): void;
|
|
392
|
-
/**
|
|
393
|
-
* draw all objects visible in this viewport
|
|
394
|
-
* @ignore
|
|
395
|
-
*/
|
|
396
|
-
draw(renderer: Renderer, container: Container): void;
|
|
397
|
-
/**
|
|
398
|
-
* Apply the world-to-camera-view transform to the container before
|
|
399
|
-
* its draw walk. Camera2d translates by `-camera.pos` (plus shake
|
|
400
|
-
* offset); Camera3d overrides this to additionally rotate by
|
|
401
|
-
* `-camera.pitch` / `-camera.yaw` in the correct order.
|
|
402
|
-
* @ignore
|
|
403
|
-
*/
|
|
404
|
-
_applyContainerViewTransform(container: Container, translateX: number, translateY: number): void;
|
|
405
|
-
/**
|
|
406
|
-
* Revert the transform applied by {@link Camera2d#_applyContainerViewTransform}.
|
|
407
|
-
* Must undo each mutation in reverse order. Subclasses overriding
|
|
408
|
-
* `_applyContainerViewTransform` should override this too.
|
|
409
|
-
* @ignore
|
|
410
|
-
*/
|
|
411
|
-
_revertContainerViewTransform(container: Container, translateX: number, translateY: number): void;
|
|
412
|
-
/**
|
|
413
|
-
* @ignore
|
|
414
|
-
*/
|
|
415
|
-
destroy(): void;
|
|
416
376
|
}
|
|
417
377
|
export {};
|
|
418
378
|
//# sourceMappingURL=camera2d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera2d.d.ts","sourceRoot":"","sources":["../../src/camera/camera2d.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAc,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"camera2d.d.ts","sourceRoot":"","sources":["../../src/camera/camera2d.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAc,MAAM,wBAAwB,CAAC;AAE5D,OAAO,UAAU,MAAM,+BAA+B,CAAC;AAcvD,OAAO,KAAK,YAAY,MAAM,4BAA4B,CAAC;AAK3D;;;;GAIG;AAEH,UAAU,QAAQ;IACjB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrB,QAAQ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QAAQ;CAmR1D"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ObservableVector3d } from "../math/observableVector3d.ts";
|
|
2
2
|
import { Vector2d } from "../math/vector2d.ts";
|
|
3
3
|
import { Vector3d } from "../math/vector3d.ts";
|
|
4
|
-
import type Container from "./../renderable/container.js";
|
|
5
4
|
import type Renderable from "./../renderable/renderable.js";
|
|
6
|
-
import type Renderer from "./../video/renderer.js";
|
|
7
5
|
import Camera2d from "./camera2d.ts";
|
|
6
|
+
import type { FogOptions } from "./fog.ts";
|
|
8
7
|
import Frustum, { type FrustumOptions } from "./frustum.ts";
|
|
8
|
+
export type { Fog3dState, FogMode, FogOptions } from "./fog.ts";
|
|
9
9
|
/**
|
|
10
10
|
* A perspective camera that extends {@link Camera2d} with a view
|
|
11
11
|
* {@link Frustum} (fov / aspect / near / far) and orientation
|
|
@@ -30,9 +30,11 @@ import Frustum, { type FrustumOptions } from "./frustum.ts";
|
|
|
30
30
|
* farther from the camera and renders smaller. Matches melonJS's
|
|
31
31
|
* 2D conventions so existing Camera2d code translates directly.
|
|
32
32
|
* - **Rotations are extrinsic XY.** `pitch` (X axis, look up/down) and
|
|
33
|
-
* `yaw` (Y axis, look left/right)
|
|
34
|
-
*
|
|
35
|
-
*
|
|
33
|
+
* `yaw` (Y axis, look left/right) and `roll` (Z axis, bank the horizon).
|
|
34
|
+
* The view is `R(yaw) ∘ R(pitch) ∘ R(roll)` inverted; the frustum planes are
|
|
35
|
+
* extracted from that same matrix, so culling follows a banked view. The
|
|
36
|
+
* inherited `currentTransform` is still NOT read — `camera.rotate()` on a
|
|
37
|
+
* 3D camera does nothing, so set `roll` rather than rotating the camera.
|
|
36
38
|
* - **Follow offset (PR B scope).** When a target is set,
|
|
37
39
|
* `followOffset` is applied in **world space**:
|
|
38
40
|
* `camera.pos = target.pos + followOffset`. Target-rotation-aware
|
|
@@ -93,6 +95,25 @@ export default class Camera3d extends Camera2d {
|
|
|
93
95
|
* @default 0
|
|
94
96
|
*/
|
|
95
97
|
yaw: number;
|
|
98
|
+
/**
|
|
99
|
+
* Z-axis rotation in radians (bank the horizon). Positive values
|
|
100
|
+
* roll the camera clockwise, so the world tilts anticlockwise —
|
|
101
|
+
* the view from a cockpit banking right.
|
|
102
|
+
*
|
|
103
|
+
* Completes the `pitch` / `yaw` / `roll` trio. Note this is NOT the
|
|
104
|
+
* inherited {@link Renderable#rotation}: a 3D camera builds its view
|
|
105
|
+
* from these three angles and never reads `currentTransform`, which
|
|
106
|
+
* is why `camera.rotate()` on a `Camera3d` is silently inert. A
|
|
107
|
+
* `Camera2d` is the other way round — it has no `roll` because a
|
|
108
|
+
* screen-plane rotation IS its only rotation, and `rotate()` already
|
|
109
|
+
* does it through `currentTransform`.
|
|
110
|
+
* @default 0
|
|
111
|
+
* @example
|
|
112
|
+
* // bank with the player's steering, as a flight game would
|
|
113
|
+
* camera.roll = (player.pos.x / PLAY_BOUND_X) * MAX_BANK;
|
|
114
|
+
*/
|
|
115
|
+
get roll(): number;
|
|
116
|
+
set roll(value: number);
|
|
96
117
|
/**
|
|
97
118
|
* World-space offset from the followed target. When `target` is
|
|
98
119
|
* set via {@link Camera2d#follow}, the camera position resolves to
|
|
@@ -158,6 +179,90 @@ export default class Camera3d extends Camera2d {
|
|
|
158
179
|
* @returns this camera (chainable)
|
|
159
180
|
*/
|
|
160
181
|
setClipPlanes(near: number, far: number): this;
|
|
182
|
+
/**
|
|
183
|
+
* Enable, reconfigure, or switch off distance fog for this camera.
|
|
184
|
+
*
|
|
185
|
+
* Fog fades mesh geometry toward a colour with distance, which is what
|
|
186
|
+
* stops a 3D scene reading as flat cut-outs and lets props appear at the
|
|
187
|
+
* far plane without a visible edge. It is **off until you call this**, and
|
|
188
|
+
* a scene that never does renders exactly as it did before.
|
|
189
|
+
*
|
|
190
|
+
* Two curves, chosen with `mode`:
|
|
191
|
+
*
|
|
192
|
+
* | mode | parameters | character |
|
|
193
|
+
* | --- | --- | --- |
|
|
194
|
+
* | `"linear"` (default) | `near`, `far` | you name the two distances |
|
|
195
|
+
* | `"exp2"` | `density` | clear up close, closes fast at range |
|
|
196
|
+
*
|
|
197
|
+
* Every parameter is optional, and an omitted one is **resolved live each
|
|
198
|
+
* frame** rather than captured here: distances track the camera's own clip
|
|
199
|
+
* planes and the colour tracks `renderer.backgroundColor`. That is
|
|
200
|
+
* deliberate — fog distances that silently disagreed with the clip planes
|
|
201
|
+
* after a later {@link Camera3d#setClipPlanes} call would clip geometry
|
|
202
|
+
* before it finished fading, and a fog colour that did not follow a
|
|
203
|
+
* day/night background fade would leave a band at the horizon.
|
|
204
|
+
*
|
|
205
|
+
* Fog is per camera, so a split-screen or minimap view fogs independently
|
|
206
|
+
* — and a `Camera2d` never fogs at all.
|
|
207
|
+
*
|
|
208
|
+
* `heightFalloff` adds a second falloff with altitude, so mist pools in low
|
|
209
|
+
* ground instead of hanging at every height equally. It defaults to 0,
|
|
210
|
+
* which is uniform fog — not a special case, the same integral with the
|
|
211
|
+
* dial at zero.
|
|
212
|
+
* @param options - fog settings, or `null` to switch fog off
|
|
213
|
+
* @returns this camera (chainable)
|
|
214
|
+
* @throws {Error} on an unknown `mode`, a non-finite or negative distance,
|
|
215
|
+
* `far` at or below `near`, or a density at or below zero
|
|
216
|
+
* @example
|
|
217
|
+
* // A typical outdoor scene: set the sky, size the frustum to the level,
|
|
218
|
+
* // then let fog take its distances and its colour from both.
|
|
219
|
+
* class GameStage extends Stage {
|
|
220
|
+
* onResetEvent(app) {
|
|
221
|
+
* app.renderer.backgroundColor.parseCSS("#cfe6f7");
|
|
222
|
+
*
|
|
223
|
+
* const camera = app.viewport; // a Camera3d
|
|
224
|
+
* camera.setClipPlanes(1, 9000);
|
|
225
|
+
* // no colour passed: it tracks `backgroundColor`, so the terrain
|
|
226
|
+
* // dissolves into the sky and props arrive without a hard edge
|
|
227
|
+
* camera.setFog({ near: 1200, far: 7000 });
|
|
228
|
+
* }
|
|
229
|
+
* }
|
|
230
|
+
* @example
|
|
231
|
+
* // A single density instead of two distances. Omit it and it resolves to
|
|
232
|
+
* // `2 / far`, which reads the same at any world scale.
|
|
233
|
+
* camera.setFog({ mode: "exp2", density: 0.0004 });
|
|
234
|
+
* @example
|
|
235
|
+
* // Fog that is deliberately NOT the sky — a green murk under a blue sky.
|
|
236
|
+
* // Passing a `Color` keeps it by reference, so this fog can be animated
|
|
237
|
+
* // by mutating the colour, without calling `setFog` again.
|
|
238
|
+
* const murk = new Color(90, 120, 80);
|
|
239
|
+
* camera.setFog({ far: 5000, color: murk });
|
|
240
|
+
* murk.setColor(60, 90, 55); // thickens over the next frame
|
|
241
|
+
* @example
|
|
242
|
+
* // Mist pooling in a valley: dense along the floor, thinning up the
|
|
243
|
+
* // walls so the tree line stays crisp. Render space is Y-down, so
|
|
244
|
+
* // `fogHeight` is the floor and density rises BELOW it.
|
|
245
|
+
* camera.setFog({
|
|
246
|
+
* near: 1200,
|
|
247
|
+
* far: 7000,
|
|
248
|
+
* fogHeight: 0,
|
|
249
|
+
* heightFalloff: 0.0015,
|
|
250
|
+
* });
|
|
251
|
+
* @example
|
|
252
|
+
* // Everything is optional: with nothing at all, fog spans the camera's
|
|
253
|
+
* // own clip planes in the backdrop's colour.
|
|
254
|
+
* camera.setFog({});
|
|
255
|
+
* camera.setFog(null); // and off again
|
|
256
|
+
* @see Camera3d#setClipPlanes
|
|
257
|
+
* @see Mesh#fog
|
|
258
|
+
*/
|
|
259
|
+
setFog(options: FogOptions | null): this;
|
|
260
|
+
/**
|
|
261
|
+
* The fog settings as given to {@link Camera3d#setFog}, or `null` when fog
|
|
262
|
+
* is off. The omitted fields are not filled in here — they are resolved
|
|
263
|
+
* per frame against the clip planes and the renderer's background colour.
|
|
264
|
+
*/
|
|
265
|
+
get fog(): FogOptions | null;
|
|
161
266
|
/**
|
|
162
267
|
* Write the camera's world-space orientation basis into the given vectors:
|
|
163
268
|
* `right` (camera local +X), `up` (+Y), and `forward` (+Z — the direction the
|
|
@@ -189,27 +294,6 @@ export default class Camera3d extends Camera2d {
|
|
|
189
294
|
* @returns `out`
|
|
190
295
|
*/
|
|
191
296
|
getForward(out: Vector3d): Vector3d;
|
|
192
|
-
/**
|
|
193
|
-
* Rebuild the projection matrix from the frustum. Called by the
|
|
194
|
-
* base `Camera2d` constructor and by `resize()`. Camera3d's
|
|
195
|
-
* version replaces the ortho matrix with the frustum's perspective.
|
|
196
|
-
* @ignore
|
|
197
|
-
*/
|
|
198
|
-
_updateProjectionMatrix(): void;
|
|
199
|
-
/**
|
|
200
|
-
* Override Camera2d's non-default projection setup so that a Camera3d
|
|
201
|
-
* used in split-screen / picture-in-picture still renders the world
|
|
202
|
-
* with perspective instead of falling back to a 2D ortho. The
|
|
203
|
-
* camera's perspective `projectionMatrix` is mirrored into
|
|
204
|
-
* `worldProjection`; the surrounding `clipRect` set by the base
|
|
205
|
-
* `draw()` handles confining the draw region to the camera's
|
|
206
|
-
* sub-screen rect, and the frustum's `aspect` is already in sync
|
|
207
|
-
* with the camera's width/height. `screenProjection` is left alone
|
|
208
|
-
* because it was already set up correctly in
|
|
209
|
-
* {@link Camera3d#_updateProjectionMatrix}.
|
|
210
|
-
* @ignore
|
|
211
|
-
*/
|
|
212
|
-
_setupNonDefaultProjection(renderer: Renderer): void;
|
|
213
297
|
/**
|
|
214
298
|
* Resize the camera viewport and recompute aspect ratio.
|
|
215
299
|
* @param w - new width
|
|
@@ -217,23 +301,6 @@ export default class Camera3d extends Camera2d {
|
|
|
217
301
|
* @returns this camera
|
|
218
302
|
*/
|
|
219
303
|
resize(w: number, h: number): this;
|
|
220
|
-
/**
|
|
221
|
-
* Apply the camera's full 3D view transform to the world container.
|
|
222
|
-
* Order: rotate first (pitch, yaw), then translate by `-camera.pos`.
|
|
223
|
-
* Post-multiplication semantics give us
|
|
224
|
-
* `currentTransform = R⁻¹ ∘ T(-pos)` — applied to a world point,
|
|
225
|
-
* this subtracts the camera position then rotates by the camera's
|
|
226
|
-
* inverse orientation, which is the standard view transform.
|
|
227
|
-
* @ignore
|
|
228
|
-
*/
|
|
229
|
-
_applyContainerViewTransform(container: Container, translateX: number, translateY: number): void;
|
|
230
|
-
/**
|
|
231
|
-
* Revert {@link Camera3d#_applyContainerViewTransform} in reverse
|
|
232
|
-
* order to restore the container's `currentTransform` to its
|
|
233
|
-
* pre-camera state.
|
|
234
|
-
* @ignore
|
|
235
|
-
*/
|
|
236
|
-
_revertContainerViewTransform(container: Container, translateX: number, translateY: number): void;
|
|
237
304
|
/**
|
|
238
305
|
* Point the camera at a world-space target by deriving pitch and
|
|
239
306
|
* yaw from the direction (target − camera.pos). Roll is unaffected.
|
|
@@ -275,27 +342,6 @@ export default class Camera3d extends Camera2d {
|
|
|
275
342
|
* @returns this camera
|
|
276
343
|
*/
|
|
277
344
|
setFollowOffset(x: number, y: number, z: number): this;
|
|
278
|
-
/**
|
|
279
|
-
* Override Camera2d's 2D follow logic to additionally resolve
|
|
280
|
-
* `followOffset` against the target's z. When `target` is set, the
|
|
281
|
-
* camera's world position becomes `target.pos + followOffset`.
|
|
282
|
-
*
|
|
283
|
-
* **Semantic change vs Camera2d.follow:** this override **does not
|
|
284
|
-
* honor `follow_axis`, `deadzone`, or `smoothFollow` / `damping`**.
|
|
285
|
-
* Camera3d tracks its target exactly each frame because the typical
|
|
286
|
-
* 3D use case (behind-the-plane follow-cam, third-person orbit) wants
|
|
287
|
-
* 1:1 tracking with no scroll-deadzone. If you need damped or
|
|
288
|
-
* axis-constrained follow under perspective, set `target = null` and
|
|
289
|
-
* lerp `camera.pos` toward the target manually in your `update()`.
|
|
290
|
-
*
|
|
291
|
-
* **PR B scope:** `followOffset` is treated as **world-space**.
|
|
292
|
-
* Target-rotation-aware follow (where the offset rotates with the
|
|
293
|
-
* target's orientation, spring-arm style) lands when a
|
|
294
|
-
* showcase (AfterBurner's banking jet) demands it.
|
|
295
|
-
* @param dt - delta time in milliseconds (ignored — no damping)
|
|
296
|
-
* @ignore
|
|
297
|
-
*/
|
|
298
|
-
updateTarget(dt?: number): void;
|
|
299
345
|
/**
|
|
300
346
|
* Visibility check used by `Container.update` (in turn driving
|
|
301
347
|
* `Container.draw`) to skip rendering off-screen children.
|
|
@@ -347,16 +393,6 @@ export default class Camera3d extends Camera2d {
|
|
|
347
393
|
broadphase: unknown;
|
|
348
394
|
sortOn: string;
|
|
349
395
|
}, out?: Renderable[]): Renderable[];
|
|
350
|
-
/**
|
|
351
|
-
* Per-frame update — extends Camera2d's behavior (target follow,
|
|
352
|
-
* camera effects) with rebuilding the frustum's six bounding
|
|
353
|
-
* planes so {@link Camera3d#isVisible} returns accurate results
|
|
354
|
-
* for the current camera state.
|
|
355
|
-
* @param dt - delta time in milliseconds
|
|
356
|
-
* @returns true if the camera's state changed
|
|
357
|
-
* @ignore
|
|
358
|
-
*/
|
|
359
|
-
update(dt?: number): boolean;
|
|
360
396
|
/**
|
|
361
397
|
* Project a world-space point to 2D screen (canvas pixel) coordinates
|
|
362
398
|
* through this camera's view + perspective projection (perspective divide
|
|
@@ -374,13 +410,5 @@ export default class Camera3d extends Camera2d {
|
|
|
374
410
|
* @returns the screen-space pixel coordinates, or `null` if behind the camera
|
|
375
411
|
*/
|
|
376
412
|
worldToScreen(world: Vector3d, out?: Vector2d): Vector2d | null;
|
|
377
|
-
/**
|
|
378
|
-
* Recompute the frustum's six bounding planes from the current
|
|
379
|
-
* `projectionMatrix × viewMatrix` (the world → clip matrix).
|
|
380
|
-
* Called from {@link Camera3d#update} each frame; `isVisible`
|
|
381
|
-
* then tests against the cached planes.
|
|
382
|
-
* @ignore
|
|
383
|
-
*/
|
|
384
|
-
_rebuildFrustumPlanes(): void;
|
|
385
413
|
}
|
|
386
414
|
//# sourceMappingURL=camera3d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera3d.d.ts","sourceRoot":"","sources":["../../src/camera/camera3d.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"camera3d.d.ts","sourceRoot":"","sources":["../../src/camera/camera3d.ts"],"names":[],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Q,GAAG,IAAI;IAIjC;;;;;;;;OAQG;IACH,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAoDtD;;;;;;;;;;;;;;;;;OAiBG;IACM,SAAS,CACjB,GAAG,EAAE,UAAU,EACf,QAAQ,GAAE,OAAsB,GAC9B,OAAO;IAwCV;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,YAAY,CACX,KAAK,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAC9C,GAAG,CAAC,EAAE,UAAU,EAAE,GAChB,UAAU,EAAE;IAkCf;;;;;;;;;;;;;;;OAeG;IACH,aAAa,CACZ,KAAK,EAAE,QAAQ,EACf,GAAG,GAAE,QAAyB,GAC5B,QAAQ,GAAG,IAAI;CAyElB"}
|
|
@@ -34,11 +34,6 @@ export default class FadeEffect extends CameraEffect {
|
|
|
34
34
|
* fade direction: "in" fades to the color, "out" fades from the color back to transparent
|
|
35
35
|
*/
|
|
36
36
|
direction: "in" | "out";
|
|
37
|
-
/**
|
|
38
|
-
* target alpha value for completion check
|
|
39
|
-
* @ignore
|
|
40
|
-
*/
|
|
41
|
-
_targetAlpha: number;
|
|
42
37
|
/**
|
|
43
38
|
* @param camera - the camera to apply the fade to
|
|
44
39
|
* @param options - fade parameters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fade_effect.d.ts","sourceRoot":"","sources":["../../../src/camera/effects/fade_effect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,uBAAuB,CAAC;AAE/C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C;;;;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askEffect extends CameraEffect {
|
|
|
59
59
|
* optional callback when transition completes
|
|
60
60
|
*/
|
|
61
61
|
onComplete: (() => void) | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* pooled shape used for rendering (avoids per-frame allocation)
|
|
64
|
-
* @ignore
|
|
65
|
-
*/
|
|
66
|
-
_maskShape: MaskShape;
|
|
67
62
|
/**
|
|
68
63
|
* @param camera - the camera to apply the transition to
|
|
69
64
|
* @param options - transition parameters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask_effect.d.ts","sourceRoot":"","sources":["../../../src/camera/effects/mask_effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,OAAO,EAAe,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,uBAAuB,CAAC;AAE/C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C,KAAK,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,YAAY;IACnD;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC;IAE7B;;OAEG;IACH,UAAU,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"m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,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAwB7D,OAAO,IAAI,IAAI;CAqBxB"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Distance-fog types, in their own module so `Camera2d` can declare the
|
|
3
|
+
* resolver hook that `Camera3d` overrides without the two importing each
|
|
4
|
+
* other.
|
|
5
|
+
*/
|
|
6
|
+
import type { Color } from "../math/color.ts";
|
|
7
|
+
/**
|
|
8
|
+
* Which curve maps distance to fog density.
|
|
9
|
+
*
|
|
10
|
+
* `"linear"` is parameterised by two distances and `"exp2"` by a single
|
|
11
|
+
* density — the two parameterisations inherited from fixed-function graphics
|
|
12
|
+
* pipelines, and still what stylised scenes want.
|
|
13
|
+
*/
|
|
14
|
+
export type FogMode = "linear" | "exp2";
|
|
15
|
+
/**
|
|
16
|
+
* {@link Camera3d#setFog} options. Every field is optional: the defaults are
|
|
17
|
+
* resolved live each frame, so fog stays consistent with the camera and the
|
|
18
|
+
* backdrop instead of drifting out of step with them.
|
|
19
|
+
*
|
|
20
|
+
* The values you DO pass are read once, at the call. Mutating this object
|
|
21
|
+
* afterwards has no effect — and would have skipped `setFog`'s validation if it
|
|
22
|
+
* did. The one live handle is a {@link Color} passed as `color`, which is kept
|
|
23
|
+
* by reference so it can be animated; see that field.
|
|
24
|
+
*/
|
|
25
|
+
export interface FogOptions {
|
|
26
|
+
/**
|
|
27
|
+
* the curve mapping distance to density.
|
|
28
|
+
* @default "linear"
|
|
29
|
+
*/
|
|
30
|
+
mode?: FogMode;
|
|
31
|
+
/**
|
|
32
|
+
* linear only — distance at which fog starts. Omit and it tracks the
|
|
33
|
+
* camera's own `near` clip plane.
|
|
34
|
+
*/
|
|
35
|
+
near?: number;
|
|
36
|
+
/**
|
|
37
|
+
* linear only — distance at which fog fully hides the scene. Omit and it
|
|
38
|
+
* tracks the camera's own `far` clip plane, which is what keeps geometry
|
|
39
|
+
* from clipping before it has finished fading.
|
|
40
|
+
*/
|
|
41
|
+
far?: number;
|
|
42
|
+
/**
|
|
43
|
+
* exp2 only — how fast the scene colour is lost with distance. Omit and it
|
|
44
|
+
* resolves to `2 / far`, leaving a few percent of the scene colour at the
|
|
45
|
+
* far plane whatever the world scale.
|
|
46
|
+
*/
|
|
47
|
+
density?: number;
|
|
48
|
+
/**
|
|
49
|
+
* fog colour. Omit and it tracks `renderer.backgroundColor` live, so
|
|
50
|
+
* geometry dissolves into the backdrop with no extra work — including
|
|
51
|
+
* through a day/night fade. A {@link Color} is kept **by reference**, so
|
|
52
|
+
* mutating it animates the fog; a CSS string or `[r, g, b]` in 0..1 is
|
|
53
|
+
* parsed into a colour this camera owns.
|
|
54
|
+
*/
|
|
55
|
+
color?: Color | string | [number, number, number];
|
|
56
|
+
/**
|
|
57
|
+
* World Y at which the fog is at its reference density. Only meaningful
|
|
58
|
+
* alongside a non-zero {@link FogOptions.heightFalloff}.
|
|
59
|
+
* @default 0
|
|
60
|
+
*/
|
|
61
|
+
fogHeight?: number;
|
|
62
|
+
/**
|
|
63
|
+
* How fast fog density drops with altitude, so mist pools in low ground
|
|
64
|
+
* instead of filling the sky as readily as the valley floor.
|
|
65
|
+
*
|
|
66
|
+
* **Zero — the default — is uniform fog**, which is the fog that shipped
|
|
67
|
+
* without this: `exp(0)` is 1, density is the same at every altitude, and
|
|
68
|
+
* the maths collapses exactly. Raise it and density falls off above
|
|
69
|
+
* `fogHeight`, leaving ridges and sky clear while the hollows stay thick.
|
|
70
|
+
*
|
|
71
|
+
* Render space is **Y-down**, so density rises as `y` INCREASES — the
|
|
72
|
+
* opposite sign to every published height-fog formula, which assume Y-up.
|
|
73
|
+
* @default 0
|
|
74
|
+
*/
|
|
75
|
+
heightFalloff?: number;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The resolved per-frame fog values handed to the renderer. Distances are
|
|
79
|
+
* pre-baked into the form the shaders want so neither backend divides.
|
|
80
|
+
* Hidden from the docs but deliberately kept in the emitted `.d.ts`:
|
|
81
|
+
* `camera3d.d.ts` imports this type, so removing it would leave a dangling
|
|
82
|
+
* import in the published types.
|
|
83
|
+
* @ignore
|
|
84
|
+
*/
|
|
85
|
+
export interface Fog3dState {
|
|
86
|
+
/** 1 = linear, 2 = exp2 (0 never reaches the renderer — null does) */
|
|
87
|
+
mode: number;
|
|
88
|
+
/** linear: distance at which fog starts */
|
|
89
|
+
near: number;
|
|
90
|
+
/** linear: 1 / (far - near) */
|
|
91
|
+
invRange: number;
|
|
92
|
+
/** exp2: density */
|
|
93
|
+
density: number;
|
|
94
|
+
/** straight (unpremultiplied) fog colour, 3 components in 0..1 */
|
|
95
|
+
color: Float32Array;
|
|
96
|
+
/**
|
|
97
|
+
* The height falloff folded into the world-up axis, expressed in VIEW
|
|
98
|
+
* space — 3 components. The shaders need the fragment's height above the
|
|
99
|
+
* camera, and the matrix they have is not the camera's view alone:
|
|
100
|
+
* `Container.draw` folds every ancestor into it, so the position the
|
|
101
|
+
* vertex stage computes is the mesh's parent space rather than the world.
|
|
102
|
+
* Dotting this against the view-space position recovers the world height
|
|
103
|
+
* difference whatever those ancestors do — scale, rotation or both — and
|
|
104
|
+
* carries the falloff with it, so the shader's exponent is one dot
|
|
105
|
+
* product. All zero when the falloff is 0, which is what makes uniform
|
|
106
|
+
* fog fall out of the same expression rather than needing a branch.
|
|
107
|
+
*/
|
|
108
|
+
heightAxis: Float32Array;
|
|
109
|
+
/**
|
|
110
|
+
* The altitude term of the height integral, `exp(k * (cameraY -
|
|
111
|
+
* fogHeight))`, evaluated once per frame here rather than per vertex in
|
|
112
|
+
* the shader — both operands are camera-global. Clamped before the
|
|
113
|
+
* exponential: a camera far below the reference height would otherwise
|
|
114
|
+
* overflow it and whiten the frame. Exactly 1 when the falloff is 0.
|
|
115
|
+
*/
|
|
116
|
+
heightBase: number;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=fog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fog.d.ts","sourceRoot":"","sources":["../../src/camera/fog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IAC1B,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,KAAK,EAAE,YAAY,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,UAAU,EAAE,YAAY,CAAC;IACzB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Vector3d } from "../math/vector3d.ts";
|
|
2
2
|
import { Bounds } from "../physics/bounds.ts";
|
|
3
3
|
import { AABB3d } from "../physics/broadphase/aabb3d.ts";
|
|
4
|
-
import { Polygon } from "./polygon.ts";
|
|
5
4
|
/**
|
|
6
5
|
* An axis-aligned 3D box, usable as a {@link Body} collision shape.
|
|
7
6
|
*
|
|
@@ -54,22 +53,6 @@ export declare class Box3d {
|
|
|
54
53
|
* @default "Box3d"
|
|
55
54
|
*/
|
|
56
55
|
type: string;
|
|
57
|
-
/**
|
|
58
|
-
* 2D XY footprint, kept in sync by {@link Box3d#setShape}. This is what
|
|
59
|
-
* {@link Box3d#getBounds} hands back, so every legacy 2D consumer
|
|
60
|
-
* ({@link Body#bounds}, the broadphase pre-gate, debug draw) sees a
|
|
61
|
-
* plain rectangle and needs no 3D awareness.
|
|
62
|
-
* @ignore
|
|
63
|
-
*/
|
|
64
|
-
_bounds: Bounds;
|
|
65
|
-
/**
|
|
66
|
-
* XY footprint as a {@link Polygon}, kept in sync by
|
|
67
|
-
* {@link Box3d#setShape}. The degraded `Box3d` × planar-shape tests
|
|
68
|
-
* hand this to the existing polygon SAT, so no polygon is allocated
|
|
69
|
-
* per collision test.
|
|
70
|
-
* @ignore
|
|
71
|
-
*/
|
|
72
|
-
_footprint: Polygon;
|
|
73
56
|
/**
|
|
74
57
|
* @param x - center of the box on the horizontal axis
|
|
75
58
|
* @param y - center of the box on the vertical axis
|
|
@@ -90,17 +73,6 @@ export declare class Box3d {
|
|
|
90
73
|
* @returns this box, for chaining
|
|
91
74
|
*/
|
|
92
75
|
setShape(x: number, y: number, z: number, width: number, height: number, depth: number): this;
|
|
93
|
-
/**
|
|
94
|
-
* Rebuild the cached XY footprint (both the {@link Bounds} and the
|
|
95
|
-
* {@link Polygon}) from the current center and half-extents.
|
|
96
|
-
*
|
|
97
|
-
* The footprint polygon's `pos` is the **min corner**, not the center,
|
|
98
|
-
* because the SAT narrowphase resolves a shape's absolute position as
|
|
99
|
-
* `renderable.pos + ancestor.getAbsolutePosition() + shape.pos` and
|
|
100
|
-
* then treats `points` as offsets from it.
|
|
101
|
-
* @ignore
|
|
102
|
-
*/
|
|
103
|
-
_syncFootprint(): void;
|
|
104
76
|
/**
|
|
105
77
|
* width of the box
|
|
106
78
|
*/
|