melonjs 17.3.0 → 18.0.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/{dist/types → build}/application/application.d.ts +16 -10
- package/build/application/application.d.ts.map +1 -0
- package/build/application/defaultApplicationSettings.d.ts +18 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -0
- package/build/application/header.d.ts +11 -0
- package/build/application/header.d.ts.map +1 -0
- package/{dist/types → build}/application/resize.d.ts +2 -0
- package/build/application/resize.d.ts.map +1 -0
- package/build/application/scaleMethods.d.ts +44 -0
- package/build/application/scaleMethods.d.ts.map +1 -0
- package/build/application/settings.d.ts +85 -0
- package/build/application/settings.d.ts.map +1 -0
- package/{dist/types → build}/audio/audio.d.ts +37 -59
- package/build/audio/audio.d.ts.map +1 -0
- package/{dist/types → build}/camera/camera2d.d.ts +42 -75
- package/build/camera/camera2d.d.ts.map +1 -0
- package/build/const.d.ts +14 -0
- package/build/const.d.ts.map +1 -0
- package/build/geometries/earcut.d.ts +3 -0
- package/build/geometries/earcut.d.ts.map +1 -0
- package/build/geometries/ellipse.d.ts +117 -0
- package/build/geometries/ellipse.d.ts.map +1 -0
- package/build/geometries/line.d.ts +39 -0
- package/build/geometries/line.d.ts.map +1 -0
- package/build/geometries/observablePoint.d.ts +75 -0
- package/build/geometries/observablePoint.d.ts.map +1 -0
- package/{dist/types → build}/geometries/path2d.d.ts +11 -5
- package/build/geometries/path2d.d.ts.map +1 -0
- package/build/geometries/point.d.ts +44 -0
- package/build/geometries/point.d.ts.map +1 -0
- package/build/geometries/polygon.d.ts +182 -0
- package/build/geometries/polygon.d.ts.map +1 -0
- package/build/geometries/rectangle.d.ts +135 -0
- package/build/geometries/rectangle.d.ts.map +1 -0
- package/build/geometries/roundrect.d.ts +67 -0
- package/build/geometries/roundrect.d.ts.map +1 -0
- package/build/geometries/toarccanvas.d.ts +28 -0
- package/build/geometries/toarccanvas.d.ts.map +1 -0
- package/{dist/types → build}/index.d.ts +41 -45
- package/build/index.d.ts.map +1 -0
- package/build/index.js +28318 -0
- package/build/index.js.map +7 -0
- package/{dist/types → build}/input/gamepad.d.ts +3 -11
- package/build/input/gamepad.d.ts.map +1 -0
- package/{dist/types → build}/input/input.d.ts +4 -2
- package/build/input/input.d.ts.map +1 -0
- package/build/input/key.d.ts +105 -0
- package/build/input/key.d.ts.map +1 -0
- package/build/input/keyboard.d.ts +72 -0
- package/build/input/keyboard.d.ts.map +1 -0
- package/build/input/pointer.d.ts +180 -0
- package/build/input/pointer.d.ts.map +1 -0
- package/{dist/types → build}/input/pointerevent.d.ts +17 -15
- package/build/input/pointerevent.d.ts.map +1 -0
- package/{dist/types → build}/lang/console.d.ts +1 -0
- package/build/lang/console.d.ts.map +1 -0
- package/build/lang/deprecated.d.ts +24 -0
- package/build/lang/deprecated.d.ts.map +1 -0
- package/{dist/types → build}/level/level.d.ts +7 -7
- package/build/level/level.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXGroup.d.ts +2 -2
- package/build/level/tiled/TMXGroup.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXLayer.d.ts +4 -4
- package/build/level/tiled/TMXLayer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXObject.d.ts +3 -3
- package/build/level/tiled/TMXObject.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTile.d.ts +4 -5
- package/build/level/tiled/TMXTile.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTileMap.d.ts +4 -4
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTileset.d.ts +3 -3
- package/build/level/tiled/TMXTileset.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTilesetGroup.d.ts +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXUtils.d.ts +2 -1
- package/build/level/tiled/TMXUtils.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/constants.d.ts +1 -0
- package/build/level/tiled/constants.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXHexagonalRenderer.d.ts +3 -4
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXIsometricRenderer.d.ts +2 -3
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +1 -2
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXRenderer.d.ts +7 -7
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXStaggeredRenderer.d.ts +1 -2
- package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/autodetect.d.ts +4 -3
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -0
- package/build/loader/cache.d.ts +10 -0
- package/build/loader/cache.d.ts.map +1 -0
- package/{dist/types → build}/loader/loader.d.ts +29 -53
- package/build/loader/loader.d.ts.map +1 -0
- package/{dist/types → build}/loader/loadingscreen.d.ts +1 -0
- package/build/loader/loadingscreen.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/binary.d.ts +2 -1
- package/build/loader/parsers/binary.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/compressed_textures/compressed_image.d.ts +1 -0
- package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/fetchdata.d.ts +2 -1
- package/build/loader/parsers/fetchdata.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/fontface.d.ts +2 -1
- package/build/loader/parsers/fontface.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/image.d.ts +2 -1
- package/build/loader/parsers/image.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/json.d.ts +2 -1
- package/build/loader/parsers/json.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/script.d.ts +2 -1
- package/build/loader/parsers/script.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/tmx.d.ts +2 -1
- package/build/loader/parsers/tmx.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/video.d.ts +2 -1
- package/build/loader/parsers/video.d.ts.map +1 -0
- package/build/math/color.d.ts +192 -0
- package/build/math/color.d.ts.map +1 -0
- package/build/math/math.d.ts +128 -0
- package/build/math/math.d.ts.map +1 -0
- package/build/math/matrix2d.d.ts +163 -0
- package/build/math/matrix2d.d.ts.map +1 -0
- package/build/math/matrix3d.d.ts +188 -0
- package/build/math/matrix3d.d.ts.map +1 -0
- package/build/math/observableVector2d.d.ts +286 -0
- package/build/math/observableVector2d.d.ts.map +1 -0
- package/build/math/observableVector2d_old.d.ts +76 -0
- package/build/math/observableVector2d_old.d.ts.map +1 -0
- package/build/math/observableVector3d.d.ts +283 -0
- package/build/math/observableVector3d.d.ts.map +1 -0
- package/build/math/observableVector3d_old.d.ts +81 -0
- package/build/math/observableVector3d_old.d.ts.map +1 -0
- package/build/math/vector2d.d.ts +253 -0
- package/build/math/vector2d.d.ts.map +1 -0
- package/build/math/vector3d.d.ts +242 -0
- package/build/math/vector3d.d.ts.map +1 -0
- package/{dist/types → build}/particles/emitter.d.ts +16 -40
- package/build/particles/emitter.d.ts.map +1 -0
- package/build/particles/particle.d.ts +47 -0
- package/build/particles/particle.d.ts.map +1 -0
- package/{dist/types → build}/particles/settings.d.ts +1 -0
- package/build/particles/settings.d.ts.map +1 -0
- package/{dist/types → build}/physics/body.d.ts +39 -21
- package/build/physics/body.d.ts.map +1 -0
- package/build/physics/bounds.d.ts +192 -0
- package/build/physics/bounds.d.ts.map +1 -0
- package/{dist/types → build}/physics/collision.d.ts +6 -4
- package/build/physics/collision.d.ts.map +1 -0
- package/{dist/types → build}/physics/detector.d.ts +13 -5
- package/build/physics/detector.d.ts.map +1 -0
- package/{dist/types → build}/physics/quadtree.d.ts +7 -18
- package/build/physics/quadtree.d.ts.map +1 -0
- package/{dist/types → build}/physics/response.d.ts +46 -5
- package/build/physics/response.d.ts.map +1 -0
- package/{dist/types → build}/physics/sat.d.ts +8 -0
- package/build/physics/sat.d.ts.map +1 -0
- package/{dist/types → build}/physics/world.d.ts +9 -4
- package/build/physics/world.d.ts.map +1 -0
- package/{dist/types → build}/plugin/plugin.d.ts +11 -18
- package/build/plugin/plugin.d.ts.map +1 -0
- package/build/polyfill/console.d.ts +2 -0
- package/build/polyfill/console.d.ts.map +1 -0
- package/build/polyfill/index.d.ts +6 -0
- package/build/polyfill/index.d.ts.map +1 -0
- package/build/polyfill/roundrect.d.ts +2 -0
- package/build/polyfill/roundrect.d.ts.map +1 -0
- package/build/pool.d.ts +39 -0
- package/build/pool.d.ts.map +1 -0
- package/{dist/types → build}/renderable/collectable.d.ts +2 -2
- package/build/renderable/collectable.d.ts.map +1 -0
- package/build/renderable/colorlayer.d.ts +41 -0
- package/build/renderable/colorlayer.d.ts.map +1 -0
- package/{dist/types → build}/renderable/container.d.ts +50 -19
- package/build/renderable/container.d.ts.map +1 -0
- package/{dist/types → build}/renderable/draggable.d.ts +5 -13
- package/build/renderable/draggable.d.ts.map +1 -0
- package/{dist/types → build}/renderable/dragndrop.d.ts +12 -21
- package/build/renderable/dragndrop.d.ts.map +1 -0
- package/{dist/types → build}/renderable/entity/entity.d.ts +17 -11
- package/build/renderable/entity/entity.d.ts.map +1 -0
- package/{dist/types → build}/renderable/imagelayer.d.ts +28 -8
- package/build/renderable/imagelayer.d.ts.map +1 -0
- package/build/renderable/light2d.d.ts +73 -0
- package/build/renderable/light2d.d.ts.map +1 -0
- package/{dist/types → build}/renderable/nineslicesprite.d.ts +9 -3
- package/build/renderable/nineslicesprite.d.ts.map +1 -0
- package/{dist/types → build}/renderable/renderable.d.ts +71 -50
- package/build/renderable/renderable.d.ts.map +1 -0
- package/{dist/types → build}/renderable/sprite.d.ts +34 -13
- package/build/renderable/sprite.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/bitmaptext.d.ts +7 -8
- package/build/renderable/text/bitmaptext.d.ts.map +1 -0
- package/build/renderable/text/bitmaptextdata.d.ts +17 -0
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/glyph.d.ts +15 -3
- package/build/renderable/text/glyph.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/text.d.ts +7 -16
- package/build/renderable/text/text.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/textmetrics.d.ts +8 -9
- package/build/renderable/text/textmetrics.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/textstyle.d.ts +1 -0
- package/build/renderable/text/textstyle.d.ts.map +1 -0
- package/{dist/types → build}/renderable/trigger.d.ts +22 -7
- package/build/renderable/trigger.d.ts.map +1 -0
- package/{dist/types → build}/renderable/ui/uibaseelement.d.ts +7 -7
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -0
- package/{dist/types → build}/renderable/ui/uispriteelement.d.ts +4 -6
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -0
- package/{dist/types → build}/renderable/ui/uitextbutton.d.ts +17 -4
- package/build/renderable/ui/uitextbutton.d.ts.map +1 -0
- package/{dist/types → build}/state/stage.d.ts +3 -3
- package/build/state/stage.d.ts.map +1 -0
- package/{dist/types → build}/state/state.d.ts +10 -9
- package/build/state/state.d.ts.map +1 -0
- package/{dist/types → build}/system/device.d.ts +49 -80
- package/build/system/device.d.ts.map +1 -0
- package/build/system/dom.d.ts +2 -0
- package/build/system/dom.d.ts.map +1 -0
- package/{dist/types → build}/system/event.d.ts +124 -291
- package/build/system/event.d.ts.map +1 -0
- package/build/system/eventEmitter.d.ts +19 -0
- package/build/system/eventEmitter.d.ts.map +1 -0
- package/build/system/eventEmitter.spec.d.ts +2 -0
- package/build/system/eventEmitter.spec.d.ts.map +1 -0
- package/{dist/types/system/pooling.d.ts → build/system/legacy_pool.d.ts} +22 -7
- package/build/system/legacy_pool.d.ts.map +1 -0
- package/build/system/platform.d.ts +34 -0
- package/build/system/platform.d.ts.map +1 -0
- package/build/system/pool.d.ts +26 -0
- package/build/system/pool.d.ts.map +1 -0
- package/build/system/save.d.ts +3 -0
- package/build/system/save.d.ts.map +1 -0
- package/build/system/timer.d.ts +118 -0
- package/build/system/timer.d.ts.map +1 -0
- package/build/tweens/easing.d.ts +93 -0
- package/build/tweens/easing.d.ts.map +1 -0
- package/build/tweens/interpolation.d.ts +7 -0
- package/build/tweens/interpolation.d.ts.map +1 -0
- package/build/tweens/tween.d.ts +234 -0
- package/build/tweens/tween.d.ts.map +1 -0
- package/build/utils/agent.d.ts +16 -0
- package/build/utils/agent.d.ts.map +1 -0
- package/build/utils/array-multimap.d.ts +14 -0
- package/build/utils/array-multimap.d.ts.map +1 -0
- package/build/utils/array.d.ts +30 -0
- package/build/utils/array.d.ts.map +1 -0
- package/build/utils/file.d.ts +16 -0
- package/build/utils/file.d.ts.map +1 -0
- package/build/utils/function.d.ts +24 -0
- package/build/utils/function.d.ts.map +1 -0
- package/build/utils/semver.d.ts +2 -0
- package/build/utils/semver.d.ts.map +1 -0
- package/build/utils/string.d.ts +35 -0
- package/build/utils/string.d.ts.map +1 -0
- package/build/utils/types.d.ts +5 -0
- package/build/utils/types.d.ts.map +1 -0
- package/build/utils/utils.d.ts +49 -0
- package/build/utils/utils.d.ts.map +1 -0
- package/build/version.d.ts +5 -0
- package/build/version.d.ts.map +1 -0
- package/{dist/types → build}/video/canvas/canvas_renderer.d.ts +58 -22
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -0
- package/{dist/types → build}/video/renderer.d.ts +38 -17
- package/build/video/renderer.d.ts.map +1 -0
- package/{dist/types → build}/video/rendertarget/canvasrendertarget.d.ts +20 -10
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/atlas.d.ts +14 -9
- package/build/video/texture/atlas.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/cache.d.ts +4 -3
- package/build/video/texture/cache.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/parser/aseprite.d.ts +1 -0
- package/build/video/texture/parser/aseprite.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/parser/spritesheet.d.ts +1 -0
- package/build/video/texture/parser/spritesheet.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/parser/texturepacker.d.ts +1 -0
- package/build/video/texture/parser/texturepacker.d.ts.map +1 -0
- package/build/video/utils/autodetect.d.ts +8 -0
- package/build/video/utils/autodetect.d.ts.map +1 -0
- package/{dist/types → build}/video/video.d.ts +4 -3
- package/build/video/video.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/buffer/vertex.d.ts +5 -6
- package/build/video/webgl/buffer/vertex.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/compositors/compositor.d.ts +9 -2
- package/build/video/webgl/compositors/compositor.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/compositors/primitive_compositor.d.ts +7 -3
- package/build/video/webgl/compositors/primitive_compositor.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/compositors/quad_compositor.d.ts +5 -5
- package/build/video/webgl/compositors/quad_compositor.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/glshader.d.ts +2 -2
- package/build/video/webgl/glshader.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/attributes.d.ts +1 -0
- package/build/video/webgl/utils/attributes.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/precision.d.ts +1 -0
- package/build/video/webgl/utils/precision.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/program.d.ts +1 -0
- package/build/video/webgl/utils/program.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/string.d.ts +1 -0
- package/build/video/webgl/utils/string.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/uniforms.d.ts +1 -0
- package/build/video/webgl/utils/uniforms.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/webgl_renderer.d.ts +55 -43
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -0
- package/package.json +83 -105
- package/LICENSE.md +0 -21
- package/README.md +0 -223
- package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +0 -14
- package/dist/melonjs.mjs/_virtual/earcut.js +0 -10
- package/dist/melonjs.mjs/_virtual/howler.js +0 -10
- package/dist/melonjs.mjs/_virtual/index.js +0 -10
- package/dist/melonjs.mjs/_virtual/re.js +0 -10
- package/dist/melonjs.mjs/application/application.js +0 -437
- package/dist/melonjs.mjs/application/header.js +0 -35
- package/dist/melonjs.mjs/application/resize.js +0 -123
- package/dist/melonjs.mjs/application/settings.js +0 -65
- package/dist/melonjs.mjs/audio/audio.js +0 -618
- package/dist/melonjs.mjs/camera/camera2d.js +0 -729
- package/dist/melonjs.mjs/const.js +0 -32
- package/dist/melonjs.mjs/geometries/ellipse.js +0 -245
- package/dist/melonjs.mjs/geometries/line.js +0 -108
- package/dist/melonjs.mjs/geometries/path2d.js +0 -474
- package/dist/melonjs.mjs/geometries/point.js +0 -80
- package/dist/melonjs.mjs/geometries/poly.js +0 -433
- package/dist/melonjs.mjs/geometries/rectangle.js +0 -330
- package/dist/melonjs.mjs/geometries/roundrect.js +0 -165
- package/dist/melonjs.mjs/geometries/toarccanvas.js +0 -103
- package/dist/melonjs.mjs/index.js +0 -239
- package/dist/melonjs.mjs/input/gamepad.js +0 -495
- package/dist/melonjs.mjs/input/input.js +0 -26
- package/dist/melonjs.mjs/input/keyboard.js +0 -470
- package/dist/melonjs.mjs/input/pointer.js +0 -393
- package/dist/melonjs.mjs/input/pointerevent.js +0 -803
- package/dist/melonjs.mjs/lang/console.js +0 -44
- package/dist/melonjs.mjs/lang/deprecated.js +0 -200
- package/dist/melonjs.mjs/level/level.js +0 -298
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +0 -120
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +0 -432
- package/dist/melonjs.mjs/level/tiled/TMXObject.js +0 -295
- package/dist/melonjs.mjs/level/tiled/TMXTile.js +0 -177
- package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +0 -574
- package/dist/melonjs.mjs/level/tiled/TMXTileset.js +0 -292
- package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +0 -74
- package/dist/melonjs.mjs/level/tiled/TMXUtils.js +0 -417
- package/dist/melonjs.mjs/level/tiled/constants.js +0 -17
- package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +0 -503
- package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +0 -215
- package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +0 -155
- package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +0 -113
- package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +0 -107
- package/dist/melonjs.mjs/level/tiled/renderer/autodetect.js +0 -38
- package/dist/melonjs.mjs/loader/cache.js +0 -30
- package/dist/melonjs.mjs/loader/loader.js +0 -728
- package/dist/melonjs.mjs/loader/loadingscreen.js +0 -118
- package/dist/melonjs.mjs/loader/melonjs_logo.png.js +0 -10
- package/dist/melonjs.mjs/loader/parsers/binary.js +0 -42
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/compressed_image.js +0 -58
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parseDDS.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parseKTX.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parseKTX2.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parsePKM.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parsePVR.js +0 -136
- package/dist/melonjs.mjs/loader/parsers/fetchdata.js +0 -62
- package/dist/melonjs.mjs/loader/parsers/fontface.js +0 -62
- package/dist/melonjs.mjs/loader/parsers/image.js +0 -129
- package/dist/melonjs.mjs/loader/parsers/json.js +0 -43
- package/dist/melonjs.mjs/loader/parsers/script.js +0 -46
- package/dist/melonjs.mjs/loader/parsers/tmx.js +0 -103
- package/dist/melonjs.mjs/loader/parsers/video.js +0 -99
- package/dist/melonjs.mjs/math/color.js +0 -635
- package/dist/melonjs.mjs/math/math.js +0 -221
- package/dist/melonjs.mjs/math/matrix2.js +0 -487
- package/dist/melonjs.mjs/math/matrix3.js +0 -621
- package/dist/melonjs.mjs/math/observable_vector2.js +0 -468
- package/dist/melonjs.mjs/math/observable_vector3.js +0 -558
- package/dist/melonjs.mjs/math/vector2.js +0 -431
- package/dist/melonjs.mjs/math/vector3.js +0 -468
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.js +0 -45
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/multimap.js +0 -130
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +0 -694
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +0 -352
- package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +0 -12
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +0 -3246
- package/dist/melonjs.mjs/node_modules/semver/classes/comparator.js +0 -165
- package/dist/melonjs.mjs/node_modules/semver/classes/range.js +0 -565
- package/dist/melonjs.mjs/node_modules/semver/classes/semver.js +0 -317
- package/dist/melonjs.mjs/node_modules/semver/functions/clean.js +0 -17
- package/dist/melonjs.mjs/node_modules/semver/functions/cmp.js +0 -68
- package/dist/melonjs.mjs/node_modules/semver/functions/coerce.js +0 -73
- package/dist/melonjs.mjs/node_modules/semver/functions/compare-build.js +0 -18
- package/dist/melonjs.mjs/node_modules/semver/functions/compare-loose.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/compare.js +0 -16
- package/dist/melonjs.mjs/node_modules/semver/functions/diff.js +0 -76
- package/dist/melonjs.mjs/node_modules/semver/functions/eq.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/gt.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/gte.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/inc.js +0 -30
- package/dist/melonjs.mjs/node_modules/semver/functions/lt.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/lte.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/major.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/minor.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/neq.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/parse.js +0 -27
- package/dist/melonjs.mjs/node_modules/semver/functions/patch.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/prerelease.js +0 -17
- package/dist/melonjs.mjs/node_modules/semver/functions/rcompare.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/rsort.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/satisfies.js +0 -21
- package/dist/melonjs.mjs/node_modules/semver/functions/sort.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/valid.js +0 -17
- package/dist/melonjs.mjs/node_modules/semver/index.js +0 -140
- package/dist/melonjs.mjs/node_modules/semver/internal/constants.js +0 -44
- package/dist/melonjs.mjs/node_modules/semver/internal/debug.js +0 -18
- package/dist/melonjs.mjs/node_modules/semver/internal/identifiers.js +0 -32
- package/dist/melonjs.mjs/node_modules/semver/internal/lrucache.js +0 -49
- package/dist/melonjs.mjs/node_modules/semver/internal/parse-options.js +0 -24
- package/dist/melonjs.mjs/node_modules/semver/internal/re.js +0 -234
- package/dist/melonjs.mjs/node_modules/semver/ranges/gtr.js +0 -15
- package/dist/melonjs.mjs/node_modules/semver/ranges/intersects.js +0 -18
- package/dist/melonjs.mjs/node_modules/semver/ranges/ltr.js +0 -15
- package/dist/melonjs.mjs/node_modules/semver/ranges/max-satisfying.js +0 -37
- package/dist/melonjs.mjs/node_modules/semver/ranges/min-satisfying.js +0 -36
- package/dist/melonjs.mjs/node_modules/semver/ranges/min-version.js +0 -74
- package/dist/melonjs.mjs/node_modules/semver/ranges/outside.js +0 -98
- package/dist/melonjs.mjs/node_modules/semver/ranges/simplify.js +0 -59
- package/dist/melonjs.mjs/node_modules/semver/ranges/subset.js +0 -261
- package/dist/melonjs.mjs/node_modules/semver/ranges/to-comparators.js +0 -19
- package/dist/melonjs.mjs/node_modules/semver/ranges/valid.js +0 -22
- package/dist/melonjs.mjs/particles/emitter.js +0 -265
- package/dist/melonjs.mjs/particles/particle.js +0 -186
- package/dist/melonjs.mjs/particles/settings.js +0 -317
- package/dist/melonjs.mjs/physics/body.js +0 -706
- package/dist/melonjs.mjs/physics/bounds.js +0 -409
- package/dist/melonjs.mjs/physics/collision.js +0 -130
- package/dist/melonjs.mjs/physics/detector.js +0 -218
- package/dist/melonjs.mjs/physics/quadtree.js +0 -396
- package/dist/melonjs.mjs/physics/response.js +0 -57
- package/dist/melonjs.mjs/physics/sat.js +0 -483
- package/dist/melonjs.mjs/physics/world.js +0 -224
- package/dist/melonjs.mjs/plugin/plugin.js +0 -168
- package/dist/melonjs.mjs/renderable/collectable.js +0 -60
- package/dist/melonjs.mjs/renderable/colorlayer.js +0 -78
- package/dist/melonjs.mjs/renderable/container.js +0 -994
- package/dist/melonjs.mjs/renderable/draggable.js +0 -121
- package/dist/melonjs.mjs/renderable/dragndrop.js +0 -114
- package/dist/melonjs.mjs/renderable/entity/entity.js +0 -254
- package/dist/melonjs.mjs/renderable/imagelayer.js +0 -288
- package/dist/melonjs.mjs/renderable/light2d.js +0 -164
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +0 -242
- package/dist/melonjs.mjs/renderable/renderable.js +0 -860
- package/dist/melonjs.mjs/renderable/sprite.js +0 -694
- package/dist/melonjs.mjs/renderable/text/bitmaptext.js +0 -421
- package/dist/melonjs.mjs/renderable/text/bitmaptextdata.js +0 -195
- package/dist/melonjs.mjs/renderable/text/glyph.js +0 -65
- package/dist/melonjs.mjs/renderable/text/text.js +0 -424
- package/dist/melonjs.mjs/renderable/text/textmetrics.js +0 -176
- package/dist/melonjs.mjs/renderable/text/textstyle.js +0 -21
- package/dist/melonjs.mjs/renderable/trigger.js +0 -158
- package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +0 -285
- package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +0 -231
- package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +0 -146
- package/dist/melonjs.mjs/state/stage.js +0 -235
- package/dist/melonjs.mjs/state/state.js +0 -548
- package/dist/melonjs.mjs/system/device.js +0 -872
- package/dist/melonjs.mjs/system/dom.js +0 -79
- package/dist/melonjs.mjs/system/event.js +0 -606
- package/dist/melonjs.mjs/system/platform.js +0 -43
- package/dist/melonjs.mjs/system/pooling.js +0 -182
- package/dist/melonjs.mjs/system/save.js +0 -157
- package/dist/melonjs.mjs/system/timer.js +0 -274
- package/dist/melonjs.mjs/tweens/easing.js +0 -334
- package/dist/melonjs.mjs/tweens/interpolation.js +0 -112
- package/dist/melonjs.mjs/tweens/tween.js +0 -479
- package/dist/melonjs.mjs/utils/agent.js +0 -77
- package/dist/melonjs.mjs/utils/array.js +0 -63
- package/dist/melonjs.mjs/utils/file.js +0 -54
- package/dist/melonjs.mjs/utils/function.js +0 -69
- package/dist/melonjs.mjs/utils/string.js +0 -82
- package/dist/melonjs.mjs/utils/utils.js +0 -139
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +0 -883
- package/dist/melonjs.mjs/video/renderer.js +0 -393
- package/dist/melonjs.mjs/video/rendertarget/canvasrendertarget.js +0 -310
- package/dist/melonjs.mjs/video/texture/atlas.js +0 -460
- package/dist/melonjs.mjs/video/texture/cache.js +0 -186
- package/dist/melonjs.mjs/video/texture/parser/aseprite.js +0 -78
- package/dist/melonjs.mjs/video/texture/parser/spritesheet.js +0 -77
- package/dist/melonjs.mjs/video/texture/parser/texturepacker.js +0 -64
- package/dist/melonjs.mjs/video/utils/autodetect.js +0 -27
- package/dist/melonjs.mjs/video/video.js +0 -142
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +0 -146
- package/dist/melonjs.mjs/video/webgl/compositors/compositor.js +0 -234
- package/dist/melonjs.mjs/video/webgl/compositors/primitive_compositor.js +0 -77
- package/dist/melonjs.mjs/video/webgl/compositors/quad_compositor.js +0 -254
- package/dist/melonjs.mjs/video/webgl/glshader.js +0 -166
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +0 -10
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +0 -10
- package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +0 -10
- package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +0 -10
- package/dist/melonjs.mjs/video/webgl/utils/attributes.js +0 -25
- package/dist/melonjs.mjs/video/webgl/utils/precision.js +0 -38
- package/dist/melonjs.mjs/video/webgl/utils/program.js +0 -67
- package/dist/melonjs.mjs/video/webgl/utils/string.js +0 -25
- package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +0 -92
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +0 -1199
- package/dist/melonjs.module.js +0 -42838
- package/dist/types/application/header.d.ts +0 -5
- package/dist/types/application/settings.d.ts +0 -105
- package/dist/types/const.d.ts +0 -21
- package/dist/types/geometries/ellipse.d.ts +0 -127
- package/dist/types/geometries/line.d.ts +0 -11
- package/dist/types/geometries/point.d.ts +0 -46
- package/dist/types/geometries/poly.d.ts +0 -175
- package/dist/types/geometries/rectangle.d.ts +0 -130
- package/dist/types/geometries/roundrect.d.ts +0 -43
- package/dist/types/geometries/toarccanvas.d.ts +0 -10
- package/dist/types/input/keyboard.d.ts +0 -205
- package/dist/types/input/pointer.d.ts +0 -261
- package/dist/types/lang/deprecated.d.ts +0 -68
- package/dist/types/loader/cache.d.ts +0 -9
- package/dist/types/loader/parsers/compressed_textures/parseDDS.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parseKTX.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parseKTX2.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parsePKM.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parsePVR.d.ts +0 -1
- package/dist/types/math/color.d.ts +0 -179
- package/dist/types/math/math.d.ts +0 -149
- package/dist/types/math/matrix2.d.ts +0 -165
- package/dist/types/math/matrix3.d.ts +0 -177
- package/dist/types/math/observable_vector2.d.ts +0 -278
- package/dist/types/math/observable_vector3.d.ts +0 -277
- package/dist/types/math/vector2.d.ts +0 -255
- package/dist/types/math/vector3.d.ts +0 -266
- package/dist/types/particles/particle.d.ts +0 -32
- package/dist/types/physics/bounds.d.ts +0 -195
- package/dist/types/polyfill/console.d.ts +0 -1
- package/dist/types/polyfill/index.d.ts +0 -1
- package/dist/types/polyfill/roundrect.d.ts +0 -1
- package/dist/types/renderable/colorlayer.d.ts +0 -28
- package/dist/types/renderable/light2d.d.ts +0 -58
- package/dist/types/renderable/text/bitmaptextdata.d.ts +0 -35
- package/dist/types/system/dom.d.ts +0 -1
- package/dist/types/system/platform.d.ts +0 -33
- package/dist/types/system/save.d.ts +0 -25
- package/dist/types/system/timer.d.ts +0 -126
- package/dist/types/tweens/easing.d.ts +0 -46
- package/dist/types/tweens/interpolation.d.ts +0 -18
- package/dist/types/tweens/tween.d.ts +0 -195
- package/dist/types/utils/agent.d.ts +0 -21
- package/dist/types/utils/array.d.ts +0 -39
- package/dist/types/utils/file.d.ts +0 -27
- package/dist/types/utils/function.d.ts +0 -31
- package/dist/types/utils/string.d.ts +0 -50
- package/dist/types/utils/utils.d.ts +0 -54
- package/dist/types/video/utils/autodetect.d.ts +0 -5
- package/src/application/application.js +0 -429
- package/src/application/header.js +0 -26
- package/src/application/resize.js +0 -114
- package/src/application/settings.js +0 -56
- package/src/audio/audio.js +0 -617
- package/src/camera/camera2d.js +0 -724
- package/src/const.js +0 -23
- package/src/geometries/ellipse.js +0 -236
- package/src/geometries/line.js +0 -99
- package/src/geometries/path2d.js +0 -464
- package/src/geometries/point.js +0 -71
- package/src/geometries/poly.js +0 -424
- package/src/geometries/rectangle.js +0 -321
- package/src/geometries/roundrect.js +0 -156
- package/src/geometries/toarccanvas.js +0 -94
- package/src/index.js +0 -315
- package/src/input/gamepad.js +0 -487
- package/src/input/input.js +0 -17
- package/src/input/keyboard.js +0 -461
- package/src/input/pointer.js +0 -386
- package/src/input/pointerevent.js +0 -794
- package/src/lang/console.js +0 -36
- package/src/lang/deprecated.js +0 -192
- package/src/level/level.js +0 -290
- package/src/level/tiled/TMXGroup.js +0 -111
- package/src/level/tiled/TMXLayer.js +0 -424
- package/src/level/tiled/TMXObject.js +0 -286
- package/src/level/tiled/TMXTile.js +0 -168
- package/src/level/tiled/TMXTileMap.js +0 -569
- package/src/level/tiled/TMXTileset.js +0 -284
- package/src/level/tiled/TMXTilesetGroup.js +0 -66
- package/src/level/tiled/TMXUtils.js +0 -408
- package/src/level/tiled/constants.js +0 -8
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +0 -497
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +0 -208
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +0 -149
- package/src/level/tiled/renderer/TMXRenderer.js +0 -103
- package/src/level/tiled/renderer/TMXStaggeredRenderer.js +0 -100
- package/src/level/tiled/renderer/autodetect.js +0 -29
- package/src/loader/cache.js +0 -22
- package/src/loader/loader.js +0 -727
- package/src/loader/loadingscreen.js +0 -112
- package/src/loader/melonjs_logo.png +0 -0
- package/src/loader/parsers/binary.js +0 -33
- package/src/loader/parsers/compressed_textures/compressed_image.js +0 -49
- package/src/loader/parsers/compressed_textures/parseDDS.js +0 -5
- package/src/loader/parsers/compressed_textures/parseKTX.js +0 -5
- package/src/loader/parsers/compressed_textures/parseKTX2.js +0 -5
- package/src/loader/parsers/compressed_textures/parsePKM.js +0 -5
- package/src/loader/parsers/compressed_textures/parsePVR.js +0 -127
- package/src/loader/parsers/fetchdata.js +0 -53
- package/src/loader/parsers/fontface.js +0 -54
- package/src/loader/parsers/image.js +0 -120
- package/src/loader/parsers/json.js +0 -35
- package/src/loader/parsers/script.js +0 -37
- package/src/loader/parsers/tmx.js +0 -95
- package/src/loader/parsers/video.js +0 -90
- package/src/math/color.js +0 -627
- package/src/math/math.js +0 -212
- package/src/math/matrix2.js +0 -479
- package/src/math/matrix3.js +0 -613
- package/src/math/observable_vector2.js +0 -460
- package/src/math/observable_vector3.js +0 -550
- package/src/math/vector2.js +0 -423
- package/src/math/vector3.js +0 -460
- package/src/particles/emitter.js +0 -258
- package/src/particles/particle.js +0 -178
- package/src/particles/settings.js +0 -310
- package/src/physics/body.js +0 -698
- package/src/physics/bounds.js +0 -401
- package/src/physics/collision.js +0 -123
- package/src/physics/detector.js +0 -209
- package/src/physics/quadtree.js +0 -387
- package/src/physics/response.js +0 -48
- package/src/physics/sat.js +0 -473
- package/src/physics/world.js +0 -216
- package/src/plugin/plugin.js +0 -159
- package/src/polyfill/console.js +0 -11
- package/src/polyfill/index.js +0 -13
- package/src/polyfill/roundrect.js +0 -237
- package/src/renderable/collectable.js +0 -51
- package/src/renderable/colorlayer.js +0 -70
- package/src/renderable/container.js +0 -985
- package/src/renderable/draggable.js +0 -114
- package/src/renderable/dragndrop.js +0 -106
- package/src/renderable/entity/entity.js +0 -246
- package/src/renderable/imagelayer.js +0 -280
- package/src/renderable/light2d.js +0 -155
- package/src/renderable/nineslicesprite.js +0 -233
- package/src/renderable/renderable.js +0 -852
- package/src/renderable/sprite.js +0 -685
- package/src/renderable/text/bitmaptext.js +0 -418
- package/src/renderable/text/bitmaptextdata.js +0 -186
- package/src/renderable/text/glyph.js +0 -57
- package/src/renderable/text/text.js +0 -415
- package/src/renderable/text/textmetrics.js +0 -167
- package/src/renderable/text/textstyle.js +0 -12
- package/src/renderable/trigger.js +0 -149
- package/src/renderable/ui/uibaseelement.js +0 -276
- package/src/renderable/ui/uispriteelement.js +0 -223
- package/src/renderable/ui/uitextbutton.js +0 -140
- package/src/state/stage.js +0 -226
- package/src/state/state.js +0 -541
- package/src/system/device.js +0 -863
- package/src/system/dom.js +0 -70
- package/src/system/event.js +0 -597
- package/src/system/platform.js +0 -34
- package/src/system/pooling.js +0 -190
- package/src/system/save.js +0 -148
- package/src/system/timer.js +0 -281
- package/src/tweens/easing.js +0 -325
- package/src/tweens/interpolation.js +0 -103
- package/src/tweens/tween.js +0 -470
- package/src/utils/agent.js +0 -68
- package/src/utils/array.js +0 -54
- package/src/utils/file.js +0 -46
- package/src/utils/function.js +0 -60
- package/src/utils/string.js +0 -73
- package/src/utils/utils.js +0 -127
- package/src/video/canvas/canvas_renderer.js +0 -874
- package/src/video/renderer.js +0 -384
- package/src/video/rendertarget/canvasrendertarget.js +0 -303
- package/src/video/texture/atlas.js +0 -451
- package/src/video/texture/cache.js +0 -178
- package/src/video/texture/parser/aseprite.js +0 -69
- package/src/video/texture/parser/spritesheet.js +0 -68
- package/src/video/texture/parser/texturepacker.js +0 -55
- package/src/video/utils/autodetect.js +0 -18
- package/src/video/video.js +0 -160
- package/src/video/webgl/buffer/vertex.js +0 -137
- package/src/video/webgl/compositors/compositor.js +0 -225
- package/src/video/webgl/compositors/primitive_compositor.js +0 -68
- package/src/video/webgl/compositors/quad_compositor.js +0 -245
- package/src/video/webgl/glshader.js +0 -158
- package/src/video/webgl/shaders/primitive.frag +0 -5
- package/src/video/webgl/shaders/primitive.vert +0 -15
- package/src/video/webgl/shaders/quad.frag +0 -7
- package/src/video/webgl/shaders/quad.vert +0 -18
- package/src/video/webgl/utils/attributes.js +0 -16
- package/src/video/webgl/utils/precision.js +0 -29
- package/src/video/webgl/utils/program.js +0 -58
- package/src/video/webgl/utils/string.js +0 -16
- package/src/video/webgl/utils/uniforms.js +0 -84
- package/src/video/webgl/webgl_renderer.js +0 -1190
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { Point } from "../geometries/point.ts";
|
|
2
|
+
import { Matrix2d } from "./matrix2d.ts";
|
|
3
|
+
import { Vector2d } from "./vector2d.ts";
|
|
4
|
+
import { Vector3d } from "./vector3d.ts";
|
|
5
|
+
type SixteenNumbers = [
|
|
6
|
+
number,
|
|
7
|
+
number,
|
|
8
|
+
number,
|
|
9
|
+
number,
|
|
10
|
+
number,
|
|
11
|
+
number,
|
|
12
|
+
number,
|
|
13
|
+
number,
|
|
14
|
+
number,
|
|
15
|
+
number,
|
|
16
|
+
number,
|
|
17
|
+
number,
|
|
18
|
+
number,
|
|
19
|
+
number,
|
|
20
|
+
number,
|
|
21
|
+
number
|
|
22
|
+
];
|
|
23
|
+
type ConstructorArg = [Matrix3d] | SixteenNumbers | [undefined] | [];
|
|
24
|
+
/**
|
|
25
|
+
* a 4x4 Matrix3d Object
|
|
26
|
+
*/
|
|
27
|
+
export declare class Matrix3d {
|
|
28
|
+
/**
|
|
29
|
+
* The matrix values
|
|
30
|
+
*/
|
|
31
|
+
val: Float32Array;
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new Matrix3d object.
|
|
34
|
+
* @param value - The values to initialize the matrix with.
|
|
35
|
+
*/
|
|
36
|
+
constructor(...value: ConstructorArg);
|
|
37
|
+
/**
|
|
38
|
+
* Gets the tx component of the matrix.
|
|
39
|
+
* @returns The tx component of the matrix.
|
|
40
|
+
*/
|
|
41
|
+
get tx(): number;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the ty component of the matrix.
|
|
44
|
+
* @returns The ty component of the matrix.
|
|
45
|
+
*/
|
|
46
|
+
get ty(): number;
|
|
47
|
+
/**
|
|
48
|
+
* Gets the tz component of the matrix.
|
|
49
|
+
* @returns The tz component of the matrix.
|
|
50
|
+
*/
|
|
51
|
+
get tz(): number;
|
|
52
|
+
/**
|
|
53
|
+
* reset the transformation matrix to the identity matrix (no transformation).<br>
|
|
54
|
+
* the identity matrix and parameters position : <br>
|
|
55
|
+
* <img src="images/identity-matrix_2x.png"/>
|
|
56
|
+
* @returns Reference to this object for method chaining
|
|
57
|
+
*/
|
|
58
|
+
identity(): this;
|
|
59
|
+
/**
|
|
60
|
+
* Set the matrix to the specified value.
|
|
61
|
+
* @param values - The matrix components.
|
|
62
|
+
* @returns Reference to this object for method chaining
|
|
63
|
+
*/
|
|
64
|
+
setTransform(...values: SixteenNumbers): this;
|
|
65
|
+
/**
|
|
66
|
+
* Copies over the values from another me.Matrix3d.
|
|
67
|
+
* @param m - the matrix object to copy from
|
|
68
|
+
* @returns Reference to this object for method chaining
|
|
69
|
+
*/
|
|
70
|
+
copy(m: Matrix3d): this;
|
|
71
|
+
/**
|
|
72
|
+
* Copies over the upper-left 2x2 values from the given me.Matrix2d
|
|
73
|
+
* @param m - the matrix object to copy from
|
|
74
|
+
* @returns Reference to this object for method chaining
|
|
75
|
+
*/
|
|
76
|
+
fromMat2d(m: Matrix2d): this;
|
|
77
|
+
/**
|
|
78
|
+
* multiply both matrix
|
|
79
|
+
* @param m - Other matrix
|
|
80
|
+
* @returns Reference to this object for method chaining
|
|
81
|
+
*/
|
|
82
|
+
multiply(m: Matrix3d): this;
|
|
83
|
+
/**
|
|
84
|
+
* Transpose the value of this matrix.
|
|
85
|
+
* @returns Reference to this object for method chaining
|
|
86
|
+
*/
|
|
87
|
+
transpose(): this;
|
|
88
|
+
/**
|
|
89
|
+
* invert this matrix, causing it to apply the opposite transformation.
|
|
90
|
+
* @returns Reference to this object for method chaining
|
|
91
|
+
*/
|
|
92
|
+
invert(): this;
|
|
93
|
+
/**
|
|
94
|
+
* apply the current transform to the given 2d or 3d vector or point
|
|
95
|
+
* @param v - the vector object to be transformed
|
|
96
|
+
* @returns result vector object.
|
|
97
|
+
*/
|
|
98
|
+
apply(v: Vector3d | Vector2d | Point): Vector2d | Point | Vector3d;
|
|
99
|
+
/**
|
|
100
|
+
* apply the inverted current transform to the given 2d or 3d vector
|
|
101
|
+
* @param v - the vector object to be transformed
|
|
102
|
+
* @returns result vector object.
|
|
103
|
+
*/
|
|
104
|
+
applyInverse(v: Vector3d | Vector2d): Vector2d | Vector3d;
|
|
105
|
+
/**
|
|
106
|
+
* generate an orthogonal projection matrix, with the result replacing the current matrix
|
|
107
|
+
* <img src="images/glOrtho.gif"/><br>
|
|
108
|
+
* @param left - farthest left on the x-axis
|
|
109
|
+
* @param right - farthest right on the x-axis
|
|
110
|
+
* @param bottom - farthest down on the y-axis
|
|
111
|
+
* @param top - farthest up on the y-axis
|
|
112
|
+
* @param near - distance to the near clipping plane along the -Z axis
|
|
113
|
+
* @param far - distance to the far clipping plane along the -Z axis
|
|
114
|
+
* @returns Reference to this object for method chaining
|
|
115
|
+
*/
|
|
116
|
+
ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): this;
|
|
117
|
+
/**
|
|
118
|
+
* scale the matrix
|
|
119
|
+
* @param x - a number representing the abscissa of the scaling vector.
|
|
120
|
+
* @param [y] - a number representing the ordinate of the scaling vector.
|
|
121
|
+
* @param [z] - a number representing the depth vector
|
|
122
|
+
* @returns Reference to this object for method chaining
|
|
123
|
+
*/
|
|
124
|
+
scale(x: number, y?: number, z?: number): this;
|
|
125
|
+
/**
|
|
126
|
+
* adds a 2D scaling transformation.
|
|
127
|
+
* @param v - scaling vector
|
|
128
|
+
* @returns Reference to this object for method chaining
|
|
129
|
+
*/
|
|
130
|
+
scaleV(v: Vector3d): this;
|
|
131
|
+
/**
|
|
132
|
+
* specifies a 2D scale operation using the [sx, 1] scaling vector
|
|
133
|
+
* @param x - x scaling vector
|
|
134
|
+
* @returns Reference to this object for method chaining
|
|
135
|
+
*/
|
|
136
|
+
scaleX(x: number): this;
|
|
137
|
+
/**
|
|
138
|
+
* specifies a 2D scale operation using the [1,sy] scaling vector
|
|
139
|
+
* @param y - y scaling vector
|
|
140
|
+
* @returns Reference to this object for method chaining
|
|
141
|
+
*/
|
|
142
|
+
scaleY(y: number): this;
|
|
143
|
+
/**
|
|
144
|
+
* rotate this matrix (counter-clockwise) by the specified angle (in radians).
|
|
145
|
+
* @param angle - Rotation angle in radians.
|
|
146
|
+
* @param v - the axis to rotate around
|
|
147
|
+
* @returns Reference to this object for method chaining
|
|
148
|
+
*/
|
|
149
|
+
rotate(angle: number, v: Vector3d): this | null;
|
|
150
|
+
/**
|
|
151
|
+
* translate the matrix position using the given vector
|
|
152
|
+
* @param x - a number representing the abscissa of the vector, or a vector object
|
|
153
|
+
* @param [y] - a number representing the ordinate of the vector.
|
|
154
|
+
* @param [z] - a number representing the depth of the vector
|
|
155
|
+
* @returns Reference to this object for method chaining
|
|
156
|
+
*/
|
|
157
|
+
translate(x: number, y: number, z?: number): Matrix3d;
|
|
158
|
+
translate(vector: Vector3d | Vector2d): Matrix3d;
|
|
159
|
+
/**
|
|
160
|
+
* Check if the matrix is an identity matrix.
|
|
161
|
+
* @returns true if the matrix is an identity matrix
|
|
162
|
+
*/
|
|
163
|
+
isIdentity(): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* return true if the two matrices are identical
|
|
166
|
+
* @param m - the other matrix
|
|
167
|
+
* @returns true if both are equals
|
|
168
|
+
*/
|
|
169
|
+
equals(m: Matrix3d): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Clone the Matrix
|
|
172
|
+
* @returns a cloned matrix
|
|
173
|
+
*/
|
|
174
|
+
clone(): Matrix3d;
|
|
175
|
+
/**
|
|
176
|
+
* return an array representation of this Matrix
|
|
177
|
+
* @returns internal matrix values
|
|
178
|
+
*/
|
|
179
|
+
toArray(): Float32Array<ArrayBufferLike>;
|
|
180
|
+
/**
|
|
181
|
+
* convert the object to a string representation
|
|
182
|
+
* @returns stringified representation
|
|
183
|
+
*/
|
|
184
|
+
toString(): string;
|
|
185
|
+
}
|
|
186
|
+
export declare const matrix3dPool: import("../system/pool.ts").Pool<Matrix3d, ConstructorArg>;
|
|
187
|
+
export {};
|
|
188
|
+
//# sourceMappingURL=matrix3d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix3d.d.ts","sourceRoot":"","sources":["../../src/math/matrix3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,KAAK,cAAc,GAAG;IACrB,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;CACN,CAAC;AAEF,KAAK,cAAc,GAAG,CAAC,QAAQ,CAAC,GAAG,cAAc,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;AAYrE;;GAEG;AACH,qBAAa,QAAQ;IACpB;;OAEG;IACH,GAAG,EAAE,YAAY,CAAC;IAElB;;;OAGG;gBACS,GAAG,KAAK,EAAE,cAAc;IAKpC;;;OAGG;IACH,IAAI,EAAE,WAEL;IAED;;;OAGG;IACH,IAAI,EAAE,WAEL;IAED;;;OAGG;IACH,IAAI,EAAE,WAEL;IAED;;;;;OAKG;IACH,QAAQ;IAIR;;;;OAIG;IACH,YAAY,CAAC,GAAG,MAAM,EAAE,cAAc;IAuBtC;;;;OAIG;IACH,IAAI,CAAC,CAAC,EAAE,QAAQ;IAKhB;;;;OAIG;IACH,SAAS,CAAC,CAAC,EAAE,QAAQ;IAsBrB;;;;OAIG;IACH,QAAQ,CAAC,CAAC,EAAE,QAAQ;IA+DpB;;;OAGG;IACH,SAAS;IAyBT;;;OAGG;IACH,MAAM;IAiEN;;;;OAIG;IACH,KAAK,CAAC,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,KAAK;IAkBpC;;;;OAIG;IACH,YAAY,CAAC,CAAC,EAAE,QAAQ,GAAG,QAAQ;IAWnC;;;;;;;;;;OAUG;IACH,KAAK,CACJ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM;IA2BZ;;;;;;OAMG;IACH,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,SAAI,EAAE,CAAC,SAAI;IAqB7B;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,QAAQ;IAIlB;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM;IAIhB;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM;IAIhB;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ;IA+DjC;;;;;;OAMG;IACH,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ;IACrD,SAAS,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ;IA6BhD;;;OAGG;IACH,UAAU;IAuBV;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,QAAQ;IAwBlB;;;OAGG;IACH,KAAK;IAIL;;;OAGG;IACH,OAAO;IAIP;;;OAGG;IACH,QAAQ;CASR;AAED,eAAO,MAAM,YAAY,4DAWxB,CAAC"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { Vector2d } from "./vector2d.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a point in a 3D coordinate vector that can be observed for changes.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ObservableVector2d {
|
|
6
|
+
private _callback;
|
|
7
|
+
private _vector2d;
|
|
8
|
+
private _revoke;
|
|
9
|
+
private callBackEnabled;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new ObservableVector3d instance.
|
|
12
|
+
* @param x - The x-coordinate of the vector. Default is 0.
|
|
13
|
+
* @param y - The y-coordinate of the vector. Default is 0.
|
|
14
|
+
* @param callback - The callback function to be called when the point changes. Default is undefined.
|
|
15
|
+
*/
|
|
16
|
+
constructor(x?: number, y?: number, callback?: () => void);
|
|
17
|
+
/**
|
|
18
|
+
* Sets the x and y coordinates of the point.
|
|
19
|
+
* @param x - The new x-coordinate value.
|
|
20
|
+
* @param y - The new y-coordinate value.
|
|
21
|
+
* @returns Reference to this object for method chaining.
|
|
22
|
+
*/
|
|
23
|
+
set(x?: number, y?: number): this;
|
|
24
|
+
/**
|
|
25
|
+
* Sets the x and y coordinates of the point without triggering the callback.
|
|
26
|
+
* @param x - The new x-coordinate value.
|
|
27
|
+
* @param y - The new y-coordinate value.
|
|
28
|
+
* @returns Reference to this object for method chaining.
|
|
29
|
+
*/
|
|
30
|
+
setMuted(x?: number, y?: number): this;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the x-coordinate of the point.
|
|
33
|
+
*/
|
|
34
|
+
get x(): number;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the x-coordinate of the point.
|
|
37
|
+
* @param value - The new x-coordinate value.
|
|
38
|
+
*/
|
|
39
|
+
set x(value: number);
|
|
40
|
+
/**
|
|
41
|
+
* Gets the y-coordinate of the point.
|
|
42
|
+
*/
|
|
43
|
+
get y(): number;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the y-coordinate of the point.
|
|
46
|
+
* @param value - The new y-coordinate value.
|
|
47
|
+
*/
|
|
48
|
+
set y(value: number);
|
|
49
|
+
/**
|
|
50
|
+
* Sets the callback function to be called when the point changes.
|
|
51
|
+
* @param callback - The callback function.
|
|
52
|
+
*/
|
|
53
|
+
setCallback(callback: () => void): void;
|
|
54
|
+
/**
|
|
55
|
+
* set the Vector x and y properties to 0
|
|
56
|
+
* @returns Reference to this object for method chaining
|
|
57
|
+
*/
|
|
58
|
+
setZero(): this;
|
|
59
|
+
/**
|
|
60
|
+
* set the Vector x and y properties using the passed vector
|
|
61
|
+
* @param v other vector
|
|
62
|
+
* @returns Reference to this object for method chaining
|
|
63
|
+
*/
|
|
64
|
+
setV(v: Vector2d | ObservableVector2d): this;
|
|
65
|
+
/**
|
|
66
|
+
* Add the passed vector to this vector
|
|
67
|
+
* @param v other vector
|
|
68
|
+
* @returns Reference to this object for method chaining
|
|
69
|
+
*/
|
|
70
|
+
add(v: Vector2d | ObservableVector2d): this;
|
|
71
|
+
/**
|
|
72
|
+
* Substract the passed vector to this vector
|
|
73
|
+
* @param v other vector
|
|
74
|
+
* @returns Reference to this object for method chaining
|
|
75
|
+
*/
|
|
76
|
+
sub(v: Vector2d | ObservableVector2d): this;
|
|
77
|
+
/**
|
|
78
|
+
* Multiply this vector values by the given scalar
|
|
79
|
+
* @param x x scale value
|
|
80
|
+
* @param [y] y scale value, if not passed, it uses the x value
|
|
81
|
+
* @returns Reference to this object for method chaining
|
|
82
|
+
*/
|
|
83
|
+
scale(x: number, y?: number): this;
|
|
84
|
+
/**
|
|
85
|
+
* Convert this vector into isometric coordinate space
|
|
86
|
+
* @returns Reference to this object for method chaining
|
|
87
|
+
*/
|
|
88
|
+
toIso(): this;
|
|
89
|
+
/**
|
|
90
|
+
* Convert this vector into 2d coordinate space
|
|
91
|
+
* @returns Reference to this object for method chaining
|
|
92
|
+
*/
|
|
93
|
+
to2d(): this;
|
|
94
|
+
/**
|
|
95
|
+
* Multiply this vector values by the passed vector
|
|
96
|
+
* @param v other vector
|
|
97
|
+
* @returns Reference to this object for method chaining
|
|
98
|
+
*/
|
|
99
|
+
scaleV(v: Vector2d | ObservableVector2d): this;
|
|
100
|
+
/**
|
|
101
|
+
* Divide this vector values by the passed value
|
|
102
|
+
* @param n - the value to divide the vector by
|
|
103
|
+
* @returns Reference to this object for method chaining
|
|
104
|
+
*/
|
|
105
|
+
div(n: number): this;
|
|
106
|
+
/**
|
|
107
|
+
* Update this vector values to absolute values
|
|
108
|
+
* @returns Reference to this object for method chaining
|
|
109
|
+
*/
|
|
110
|
+
abs(): this;
|
|
111
|
+
/**
|
|
112
|
+
* Clamp the vector value within the specified value range
|
|
113
|
+
* @param low minimum component value
|
|
114
|
+
* @param high maximum component value
|
|
115
|
+
* @returns new me.Vector2d
|
|
116
|
+
*/
|
|
117
|
+
clamp(low: number, high: number): Vector2d;
|
|
118
|
+
/**
|
|
119
|
+
* Clamp this vector value within the specified value range
|
|
120
|
+
* @param low minimum component value
|
|
121
|
+
* @param high maximum component value
|
|
122
|
+
* @returns Reference to this object for method chaining
|
|
123
|
+
*/
|
|
124
|
+
clampSelf(low: number, high: number): Vector2d;
|
|
125
|
+
/**
|
|
126
|
+
* Update this vector with the minimum value between this and the passed vector
|
|
127
|
+
* @param v other vector
|
|
128
|
+
* @returns Reference to this object for method chaining
|
|
129
|
+
*/
|
|
130
|
+
minV(v: Vector2d | ObservableVector2d): this;
|
|
131
|
+
/**
|
|
132
|
+
* Update this vector with the maximum value between this and the passed vector
|
|
133
|
+
* @param v other vector
|
|
134
|
+
* @returns Reference to this object for method chaining
|
|
135
|
+
*/
|
|
136
|
+
maxV(v: Vector2d | ObservableVector2d): this;
|
|
137
|
+
/**
|
|
138
|
+
* Floor the vector values
|
|
139
|
+
* @returns new Vector2d
|
|
140
|
+
*/
|
|
141
|
+
floor(): Vector2d;
|
|
142
|
+
/**
|
|
143
|
+
* Floor this vector values
|
|
144
|
+
* @returns Reference to this object for method chaining
|
|
145
|
+
*/
|
|
146
|
+
floorSelf(): Vector2d;
|
|
147
|
+
/**
|
|
148
|
+
* Ceil the vector values
|
|
149
|
+
* @returns new Vector2d
|
|
150
|
+
*/
|
|
151
|
+
ceil(): Vector2d;
|
|
152
|
+
/**
|
|
153
|
+
* Ceil this vector values
|
|
154
|
+
* @returns Reference to this object for method chaining
|
|
155
|
+
*/
|
|
156
|
+
ceilSelf(): Vector2d;
|
|
157
|
+
/**
|
|
158
|
+
* Negate the vector values
|
|
159
|
+
* @returns new Vector2d
|
|
160
|
+
*/
|
|
161
|
+
negate(): Vector2d;
|
|
162
|
+
/**
|
|
163
|
+
* Negate this vector values
|
|
164
|
+
* @returns Reference to this object for method chaining
|
|
165
|
+
*/
|
|
166
|
+
negateSelf(): Vector2d;
|
|
167
|
+
/**
|
|
168
|
+
* Copy the x,y values of the passed vector to this one
|
|
169
|
+
* @param v other vector
|
|
170
|
+
* @returns Reference to this object for method chaining
|
|
171
|
+
*/
|
|
172
|
+
copy(v: Vector2d | ObservableVector2d): this;
|
|
173
|
+
/**
|
|
174
|
+
* Checks if this vector is equal to another vector or a pair of coordinates.
|
|
175
|
+
* @param args - Either two numbers representing x and y coordinates or a single Vector2d object.
|
|
176
|
+
* @returns True if the coordinates are equal, false otherwise.
|
|
177
|
+
* @example
|
|
178
|
+
* let v1 = new Vector2d(3, 4);
|
|
179
|
+
* let v2 = new Vector2d(3, 4);
|
|
180
|
+
* v1.equals(v2); // returns true
|
|
181
|
+
* @example
|
|
182
|
+
* let v = new Vector2d(3, 4);
|
|
183
|
+
* v.equals(3, 4); // returns true
|
|
184
|
+
*/
|
|
185
|
+
equals(...args: [number, number] | [Vector2d] | [ObservableVector2d]): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* normalize this vector (scale the vector so that its magnitude is 1)
|
|
188
|
+
* @returns Reference to this object for method chaining
|
|
189
|
+
*/
|
|
190
|
+
normalize(): this;
|
|
191
|
+
/**
|
|
192
|
+
* change this vector to be perpendicular to what it was before.<br>
|
|
193
|
+
* (Effectively rotates it 90 degrees in a clockwise direction)
|
|
194
|
+
* @returns Reference to this object for method chaining
|
|
195
|
+
*/
|
|
196
|
+
perp(): this;
|
|
197
|
+
/**
|
|
198
|
+
* Rotate this vector (counter-clockwise) by the specified angle (in radians).
|
|
199
|
+
* @param angle - The angle to rotate (in radians)
|
|
200
|
+
* @param [v] - an optional point to rotate around
|
|
201
|
+
* @returns Reference to this object for method chaining
|
|
202
|
+
*/
|
|
203
|
+
rotate(angle: number, v?: Vector2d | ObservableVector2d): this;
|
|
204
|
+
/**
|
|
205
|
+
* return the dot product of this vector and the passed one
|
|
206
|
+
* @param v other vector
|
|
207
|
+
* @returns The dot product.
|
|
208
|
+
*/
|
|
209
|
+
dot(v: Vector2d | ObservableVector2d): number;
|
|
210
|
+
/**
|
|
211
|
+
* return the cross product of this vector and the passed one
|
|
212
|
+
* @param v other vector
|
|
213
|
+
* @returns The cross product.
|
|
214
|
+
*/
|
|
215
|
+
cross(v: Vector2d | ObservableVector2d): number;
|
|
216
|
+
/**
|
|
217
|
+
* return the square length of this vector
|
|
218
|
+
* @returns The length^2 of this vector.
|
|
219
|
+
*/
|
|
220
|
+
length2(): number;
|
|
221
|
+
/**
|
|
222
|
+
* return the length (magnitude) of this vector
|
|
223
|
+
* @returns the length of this vector
|
|
224
|
+
*/
|
|
225
|
+
length(): number;
|
|
226
|
+
/**
|
|
227
|
+
* Linearly interpolate between this vector and the given one.
|
|
228
|
+
* @param v other vector
|
|
229
|
+
* @param alpha - distance along the line (alpha = 0 will be this vector, and alpha = 1 will be the given one).
|
|
230
|
+
* @returns Reference to this object for method chaining
|
|
231
|
+
*/
|
|
232
|
+
lerp(v: Vector2d | ObservableVector2d, alpha: number): this;
|
|
233
|
+
/**
|
|
234
|
+
* interpolate the position of this vector towards the given one by the given maximum step.
|
|
235
|
+
* @param target vector to rotate towards
|
|
236
|
+
* @param step - the maximum step per iteration (Negative values will push the vector away from the target)
|
|
237
|
+
* @returns Reference to this object for method chaining
|
|
238
|
+
*/
|
|
239
|
+
moveTowards(target: Vector2d | ObservableVector2d, step: number): Vector2d | ObservableVector2d;
|
|
240
|
+
/**
|
|
241
|
+
* Calculates the Euclidean distance between this vector and another vector.
|
|
242
|
+
* @param v - The vector to which the distance is calculated.
|
|
243
|
+
* @returns The Euclidean distance between this vector and the given vector.
|
|
244
|
+
* @example
|
|
245
|
+
* let v1 = new Vector2d(3, 4);
|
|
246
|
+
* let v2 = new Vector2d(6, 8);
|
|
247
|
+
* v1.distance(v2); // returns 5
|
|
248
|
+
*/
|
|
249
|
+
distance(v: Vector2d | ObservableVector2d): number;
|
|
250
|
+
/**
|
|
251
|
+
* return the angle between this vector and the passed one
|
|
252
|
+
* @param v other vector
|
|
253
|
+
* @returns angle in radians
|
|
254
|
+
*/
|
|
255
|
+
angle(v: Vector2d | ObservableVector2d): number;
|
|
256
|
+
/**
|
|
257
|
+
* project this vector on to another vector.
|
|
258
|
+
* @param v - The vector to project onto.
|
|
259
|
+
* @returns Reference to this object for method chaining
|
|
260
|
+
*/
|
|
261
|
+
project(v: Vector2d | ObservableVector2d): this;
|
|
262
|
+
/**
|
|
263
|
+
* Project this vector onto a vector of unit length.<br>
|
|
264
|
+
* This is slightly more efficient than `project` when dealing with unit vectors.
|
|
265
|
+
* @param v - The unit vector to project onto.
|
|
266
|
+
* @returns Reference to this object for method chaining
|
|
267
|
+
*/
|
|
268
|
+
projectN(v: Vector2d | ObservableVector2d): this;
|
|
269
|
+
/**
|
|
270
|
+
* return a clone copy of this vector
|
|
271
|
+
* @param [cb] callback function to override the clone values
|
|
272
|
+
* @returns new Vector2d
|
|
273
|
+
*/
|
|
274
|
+
clone(cb?: () => void): ObservableVector2d;
|
|
275
|
+
/**
|
|
276
|
+
* convert the object to a string representation
|
|
277
|
+
* @returns stringified representation of this vector
|
|
278
|
+
*/
|
|
279
|
+
toString(): `x:${number},y:${number}`;
|
|
280
|
+
/**
|
|
281
|
+
* Revokes the proxy object, preventing further access to the ObservablePoint instance.
|
|
282
|
+
*/
|
|
283
|
+
revoke(): void;
|
|
284
|
+
}
|
|
285
|
+
export declare const observableVector2dPool: import("../system/pool.ts").Pool<ObservableVector2d, [x?: number | undefined, y?: number | undefined, callback?: () => void]>;
|
|
286
|
+
//# sourceMappingURL=observableVector2d.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observableVector2d.d.ts","sourceRoot":"","sources":["../../src/math/observableVector2d.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAezC;;GAEG;AACH,qBAAa,kBAAkB;IAC9B,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,OAAO,CAAa;IAE5B,OAAO,CAAC,eAAe,CAAiB;IAExC;;;;;OAKG;gBACS,CAAC,GAAE,MAAU,EAAE,CAAC,GAAE,MAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI;IAsB/D;;;;;OAKG;IACH,GAAG,CAAC,CAAC,SAAI,EAAE,CAAC,SAAI;IAShB;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,SAAI,EAAE,CAAC,SAAI;IAQrB;;OAEG;IACH,IAAI,CAAC,IAQQ,MAAM,CANlB;IAED;;;OAGG;IACH,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAElB;IAED;;OAEG;IACH,IAAI,CAAC,IAQQ,MAAM,CANlB;IAED;;;OAGG;IACH,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAElB;IAED;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIhC;;;OAGG;IACH,OAAO;IAIP;;;;OAIG;IACH,IAAI,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIrC;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIpC;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIpC;;;;;OAKG;IACH,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,SAAI;IAItB;;;OAGG;IACH,KAAK;IAIL;;;OAGG;IACH,IAAI;IAIJ;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIvC;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,MAAM;IAIb;;;OAGG;IACH,GAAG;IAOH;;;;;OAKG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAI/B;;;;;OAKG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAInC;;;;OAIG;IACH,IAAI,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIrC;;;;OAIG;IACH,IAAI,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIrC;;;OAGG;IACH,KAAK;IAIL;;;OAGG;IACH,SAAS;IAIT;;;OAGG;IACH,IAAI;IAIJ;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IACH,MAAM;IAIN;;;OAGG;IACH,UAAU;IAIV;;;;OAIG;IACH,IAAI,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIrC;;;;;;;;;;;OAWG;IACH,MAAM,CACL,GAAG,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAC3D,OAAO;IAOV;;;OAGG;IACH,SAAS;IAIT;;;;OAIG;IACH,IAAI;IAIJ;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAkBvD;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIpC;;;;OAIG;IACH,KAAK,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAItC;;;OAGG;IACH,OAAO;IAIP;;;OAGG;IACH,MAAM;IAIN;;;;;OAKG;IACH,IAAI,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB,EAAE,KAAK,EAAE,MAAM;IAKpD;;;;;OAKG;IACH,WAAW,CAAC,MAAM,EAAE,QAAQ,GAAG,kBAAkB,EAAE,IAAI,EAAE,MAAM;IAc/D;;;;;;;;OAQG;IACH,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIzC;;;;OAIG;IACH,KAAK,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAItC;;;;OAIG;IACH,OAAO,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIxC;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,kBAAkB;IAIzC;;;;OAIG;IACH,KAAK,CAAC,EAAE,CAAC,EAAE,MAAM,IAAI;IAIrB;;;OAGG;IACH,QAAQ;IAIR;;OAEG;IACH,MAAM;CAGN;AAED,eAAO,MAAM,sBAAsB,yHAEgC,IAAI,EAarE,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Vector2d } from "./vector2d";
|
|
2
|
+
/**
|
|
3
|
+
* Function type for the observable vector update callback.
|
|
4
|
+
* @param options - The update options.
|
|
5
|
+
* @param options.newX - The new x value.
|
|
6
|
+
* @param options.newY - The new y value.
|
|
7
|
+
* @param options.currentX - The current x value.
|
|
8
|
+
* @param options.currentY - The current y value.
|
|
9
|
+
* @returns - The updated values or undefined. If the values are returned, they will become the new x and y values.
|
|
10
|
+
*/
|
|
11
|
+
export type ObservableVector2dUpdateFn = (options: {
|
|
12
|
+
newX: number;
|
|
13
|
+
newY: number;
|
|
14
|
+
currentX: number;
|
|
15
|
+
currentY: number;
|
|
16
|
+
}) => {
|
|
17
|
+
x?: number | undefined;
|
|
18
|
+
y?: number | undefined;
|
|
19
|
+
} | void;
|
|
20
|
+
export interface ObservableVector2d extends Vector2d {
|
|
21
|
+
/**
|
|
22
|
+
* Returns a `Vector2d` copy of this `ObservableVector2d` object.
|
|
23
|
+
* @returns - The new Vector2d.
|
|
24
|
+
*/
|
|
25
|
+
toVector2d(): Vector2d;
|
|
26
|
+
/**
|
|
27
|
+
* Sets the vector value without triggering the callback.
|
|
28
|
+
* @param x - The x value of the vector.
|
|
29
|
+
* @param y - The y value of the vector.
|
|
30
|
+
* @returns - Reference to this object for method chaining.
|
|
31
|
+
*/
|
|
32
|
+
setMuted(x: number, y: number): ObservableVector2d;
|
|
33
|
+
/**
|
|
34
|
+
* Returns a clone copy of this vector.
|
|
35
|
+
* @returns - The cloned vector.
|
|
36
|
+
*/
|
|
37
|
+
clone(): ObservableVector2d;
|
|
38
|
+
/**
|
|
39
|
+
* Negates the vector values.
|
|
40
|
+
* @returns - The negated vector.
|
|
41
|
+
*/
|
|
42
|
+
negate(): ObservableVector2d;
|
|
43
|
+
/**
|
|
44
|
+
* Ceils the vector values.
|
|
45
|
+
* @returns - The ceiled vector.
|
|
46
|
+
*/
|
|
47
|
+
ceil(): ObservableVector2d;
|
|
48
|
+
/**
|
|
49
|
+
* Floors the vector values.
|
|
50
|
+
* @returns - The floored vector.
|
|
51
|
+
*/
|
|
52
|
+
floor(): ObservableVector2d;
|
|
53
|
+
/**
|
|
54
|
+
* Clamps the vector values within the specified value range.
|
|
55
|
+
* @param low - The lower bound.
|
|
56
|
+
* @param high - The upper bound.
|
|
57
|
+
* @returns - The clamped vector.
|
|
58
|
+
*/
|
|
59
|
+
clamp(low: number, high: number): ObservableVector2d;
|
|
60
|
+
}
|
|
61
|
+
interface CreateObservableVector2dOptions {
|
|
62
|
+
target: Vector2d;
|
|
63
|
+
updateFn: ObservableVector2dUpdateFn;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Creates an observable vector.
|
|
67
|
+
* This function wraps a given `Vector2d` object with a proxy that intercepts changes to the `x` and `y` properties,
|
|
68
|
+
* allowing for custom update logic via the provided `updateFn` callback.
|
|
69
|
+
* @param options - The options for creating the observable vector.
|
|
70
|
+
* @param options.target - The target vector to be made observable.
|
|
71
|
+
* @param options.updateFn - The update function to be called whenever the vector's properties change.
|
|
72
|
+
* @returns - The observable vector with additional methods for vector manipulation.
|
|
73
|
+
*/
|
|
74
|
+
export declare const createObservableVector2d: (options: CreateObservableVector2dOptions) => ObservableVector2d;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=observableVector2d_old.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observableVector2d_old.d.ts","sourceRoot":"","sources":["../../src/math/observableVector2d_old.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;AAepD;;;;;;;;GAQG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAAE;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACjB,KAAK;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,IAAI,CAAC;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,QAAQ;IACnD;;;OAGG;IACH,UAAU,IAAI,QAAQ,CAAC;IAEvB;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;IAEnD;;;OAGG;IACH,KAAK,IAAI,kBAAkB,CAAC;IAE5B;;;OAGG;IACH,MAAM,IAAI,kBAAkB,CAAC;IAE7B;;;OAGG;IACH,IAAI,IAAI,kBAAkB,CAAC;IAE3B;;;OAGG;IACH,KAAK,IAAI,kBAAkB,CAAC;IAE5B;;;;;OAKG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACrD;AAED,UAAU,+BAA+B;IACxC,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,0BAA0B,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GACpC,SAAS,+BAA+B,KAoFlC,kBACN,CAAC"}
|