melonjs 20.6.0 → 20.8.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 +6 -3
- package/build/application/defaultApplicationSettings.d.ts +5 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -1
- package/build/application/header.d.ts.map +1 -1
- package/build/application/settings.d.ts +88 -0
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/backend/engine.d.ts +0 -1
- package/build/audio/backend/sound.d.ts +0 -1
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +95 -8
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/geometries/box3d.d.ts +24 -6
- package/build/geometries/box3d.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +14 -0
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +14 -0
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/geometries/sphere.d.ts +35 -6
- package/build/geometries/sphere.d.ts.map +1 -1
- package/build/index.d.ts +10 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +23361 -20195
- package/build/index.js.map +4 -4
- package/build/input/pointerevent.d.ts +8 -0
- 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 +17 -31
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/level/gltf/GLTFScene.d.ts +40 -1
- package/build/level/gltf/GLTFScene.d.ts.map +1 -1
- package/build/level/level.d.ts +36 -0
- package/build/level/level.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +5 -2
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +0 -1
- package/build/level/tiled/TMXTile.d.ts +2 -1
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +7 -4
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +1 -1
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts +5 -0
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts +0 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +6 -5
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +5 -0
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +8 -7
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +5 -0
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +19 -4
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/autodetect.d.ts +0 -4
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
- package/build/lighting/light2d.d.ts +68 -2
- package/build/lighting/light2d.d.ts.map +1 -1
- package/build/lighting/light3d.d.ts.map +1 -1
- package/build/loader/loader.d.ts +63 -0
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts +1 -2
- package/build/loader/loadingscreen.d.ts.map +1 -1
- package/build/loader/parsers/fontface.d.ts +2 -0
- package/build/loader/parsers/fontface.d.ts.map +1 -1
- package/build/loader/parsers/mtl.d.ts.map +1 -1
- package/build/loader/parsers/shader.d.ts +0 -2
- package/build/math/color.d.ts +27 -4
- package/build/math/color.d.ts.map +1 -1
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +22 -1
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +69 -0
- package/build/particles/settings.d.ts.map +1 -1
- package/build/physics/adapter.d.ts +152 -3
- package/build/physics/adapter.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +9 -18
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/builtin-adapter.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts +0 -1
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/physics/builtin/sat.d.ts +0 -7
- package/build/physics/builtin/sat.d.ts.map +1 -1
- package/build/physics/builtin/sat3d.d.ts +46 -0
- package/build/physics/builtin/sat3d.d.ts.map +1 -1
- package/build/physics/physicseditor.d.ts +2 -0
- package/build/physics/physicseditor.d.ts.map +1 -0
- package/build/physics/response.d.ts +45 -62
- package/build/physics/response.d.ts.map +1 -1
- package/build/renderable/collectable.d.ts +6 -1
- package/build/renderable/collectable.d.ts.map +1 -1
- package/build/renderable/colorlayer.d.ts +4 -4
- package/build/renderable/colorlayer.d.ts.map +1 -1
- package/build/renderable/container.d.ts +23 -17
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +14 -16
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts +1 -1
- package/build/renderable/groundshadow.d.ts +1 -0
- package/build/renderable/groundshadow.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts +12 -5
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/instanced_mesh.d.ts +2 -9
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +306 -5
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/nineslicesprite.d.ts +3 -13
- package/build/renderable/nineslicesprite.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +129 -28
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +77 -19
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +27 -16
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +13 -3
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts +0 -4
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +5 -3
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/text/textmetrics.d.ts +2 -0
- package/build/renderable/text/textmetrics.d.ts.map +1 -1
- package/build/renderable/trail.d.ts +0 -1
- package/build/renderable/trail.d.ts.map +1 -1
- package/build/renderable/trigger.d.ts +39 -14
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/progressbar.d.ts +194 -0
- package/build/renderable/ui/progressbar.d.ts.map +1 -0
- package/build/renderable/ui/uibaseelement.d.ts +48 -3
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
- package/build/renderable/ui/uispriteelement.d.ts +19 -3
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/state/stage.d.ts +22 -0
- package/build/state/stage.d.ts.map +1 -1
- package/build/system/legacy_pool.d.ts +2 -2
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/system/pool.d.ts +10 -0
- package/build/system/pool.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +49 -2
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/video/buffer/vertex.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +34 -23
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/effects/blendEffect.d.ts +0 -1
- package/build/video/effects/bloom.d.ts +72 -0
- package/build/video/effects/bloom.d.ts.map +1 -0
- package/build/video/effects/blur.d.ts +3 -2
- package/build/video/effects/blur.d.ts.map +1 -1
- package/build/video/effects/chromaticAberration.d.ts +3 -2
- package/build/video/effects/chromaticAberration.d.ts.map +1 -1
- package/build/video/effects/colorMatrix.d.ts +3 -2
- package/build/video/effects/colorMatrix.d.ts.map +1 -1
- package/build/video/effects/desaturate.d.ts +10 -2
- package/build/video/effects/desaturate.d.ts.map +1 -1
- package/build/video/effects/dissolve.d.ts +3 -2
- package/build/video/effects/dissolve.d.ts.map +1 -1
- package/build/video/effects/dropShadow.d.ts +3 -2
- package/build/video/effects/dropShadow.d.ts.map +1 -1
- package/build/video/effects/flash.d.ts +3 -2
- package/build/video/effects/flash.d.ts.map +1 -1
- package/build/video/effects/glow.d.ts +3 -2
- package/build/video/effects/glow.d.ts.map +1 -1
- package/build/video/effects/hologram.d.ts +3 -2
- package/build/video/effects/hologram.d.ts.map +1 -1
- package/build/video/effects/invert.d.ts +10 -2
- package/build/video/effects/invert.d.ts.map +1 -1
- package/build/video/effects/outline.d.ts +3 -2
- package/build/video/effects/outline.d.ts.map +1 -1
- package/build/video/effects/pixelate.d.ts +3 -2
- package/build/video/effects/pixelate.d.ts.map +1 -1
- package/build/video/effects/radialGradient.d.ts +8 -3
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/scanline.d.ts +3 -2
- package/build/video/effects/scanline.d.ts.map +1 -1
- package/build/video/effects/sepia.d.ts +10 -2
- package/build/video/effects/sepia.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +10 -4
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/shine.d.ts +3 -2
- package/build/video/effects/shine.d.ts.map +1 -1
- package/build/video/effects/tintPulse.d.ts +3 -2
- package/build/video/effects/tintPulse.d.ts.map +1 -1
- package/build/video/effects/tonemap.d.ts +121 -0
- package/build/video/effects/tonemap.d.ts.map +1 -0
- package/build/video/effects/vignette.d.ts +3 -2
- package/build/video/effects/vignette.d.ts.map +1 -1
- package/build/video/effects/wave.d.ts +3 -2
- package/build/video/effects/wave.d.ts.map +1 -1
- package/build/video/gpu/meshmaterial.d.ts +2 -0
- package/build/video/gpu/meshmaterial.d.ts.map +1 -0
- package/build/video/gpu/vertexformat.d.ts +26 -0
- package/build/video/gpu/vertexformat.d.ts.map +1 -1
- package/build/video/gradient.d.ts +0 -1
- package/build/video/gradient.d.ts.map +1 -1
- package/build/video/renderer.d.ts +111 -7
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +2 -0
- package/build/video/renderstate.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +3 -4
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +0 -1
- package/build/video/rendertarget/webglrendertarget.d.ts +0 -1
- package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webgpurendertarget.d.ts +18 -2
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +1 -0
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +1 -3
- package/build/video/texture/frametexture.d.ts +0 -1
- package/build/video/texture/frametexture.d.ts.map +1 -1
- package/build/video/texture/noise_texture2d.d.ts +1 -0
- package/build/video/texture/noise_texture2d.d.ts.map +1 -1
- package/build/video/utils/autodetect.d.ts +0 -2
- package/build/video/webgl/batchers/batcher.d.ts +0 -9
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts +13 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts +4 -2
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/mesh_batcher.d.ts +2 -3
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts +4 -0
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +0 -1
- package/build/video/webgl/buffer/retained_geometry.d.ts +0 -1
- package/build/video/webgl/glshader.d.ts +5 -3
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +0 -4
- package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
- package/build/video/webgl/texture/store.d.ts +0 -1
- package/build/video/webgl/webgl_renderer.d.ts +63 -24
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +17 -0
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/mesh_batcher.d.ts +0 -3
- package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -2
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/webgpu_batcher.d.ts +0 -2
- package/build/video/webgpu/batchers/webgpu_batcher.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +0 -2
- package/build/video/webgpu/texture/frametexture.d.ts +0 -2
- package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
- package/build/video/webgpu/texture/store.d.ts +0 -1
- package/build/video/webgpu/texture/store.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +8 -75
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/melonjs-3d/SKILL.md +293 -19
- package/skills/melonjs-3d-assets/SKILL.md +123 -13
- package/skills/melonjs-camera-and-drawing/SKILL.md +57 -1
- package/skills/melonjs-effects-and-shaders/SKILL.md +341 -29
- package/skills/melonjs-input/SKILL.md +48 -4
- package/skills/melonjs-lighting/SKILL.md +45 -1
- package/skills/melonjs-loading-assets/SKILL.md +1 -1
- package/skills/melonjs-particles-and-trails/SKILL.md +106 -4
- package/skills/melonjs-performance/SKILL.md +79 -2
- package/skills/melonjs-physics/SKILL.md +420 -29
- package/skills/melonjs-renderables/SKILL.md +15 -1
- package/skills/melonjs-scenes-and-state/SKILL.md +121 -1
- package/skills/melonjs-tilemaps/SKILL.md +9 -0
- package/skills/melonjs-ui-and-text/SKILL.md +165 -4
- package/build/level/gltf/srgb.d.ts +0 -20
- package/build/level/gltf/srgb.d.ts.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Box3d } from "../geometries/box3d.ts";
|
|
1
2
|
import type { Ellipse } from "../geometries/ellipse.ts";
|
|
2
3
|
import type { Polygon } from "../geometries/polygon.ts";
|
|
3
4
|
import type { Rect } from "../geometries/rectangle.ts";
|
|
@@ -25,8 +26,15 @@ export type BodyType = "static" | "dynamic" | "kinematic";
|
|
|
25
26
|
* them onto per-fixture filters, which Box2D provides natively). The matter
|
|
26
27
|
* adapter does NOT — its `collisionFilter` and `isSensor` belong to a body, not
|
|
27
28
|
* to the parts it is built from, so per-shape values are ignored there.
|
|
29
|
+
*
|
|
30
|
+
* **The two 3D shapes are builtin-only.** `Box3d` and `Sphere` exist because
|
|
31
|
+
* the builtin solver resolves along Z; the matter and planck adapters are 2D
|
|
32
|
+
* engines with no depth to resolve and THROW when handed either one. They are
|
|
33
|
+
* in this union because a body definition is otherwise portable and these are
|
|
34
|
+
* body shapes, not because every adapter accepts them: a game that wants to
|
|
35
|
+
* stay adapter-portable builds its bodies from the planar three.
|
|
28
36
|
*/
|
|
29
|
-
export type BodyShape = Rect | Ellipse | Polygon;
|
|
37
|
+
export type BodyShape = Rect | Ellipse | Polygon | Box3d | Sphere;
|
|
30
38
|
/**
|
|
31
39
|
* One overlapping SHAPE pair, passed to the shape-level collision lifecycle
|
|
32
40
|
* hooks (`onShapeCollisionStart`, `onShapeCollisionActive`,
|
|
@@ -302,7 +310,12 @@ export interface PhysicsBody {
|
|
|
302
310
|
export interface BodyDefinition {
|
|
303
311
|
/** simulation kind */
|
|
304
312
|
type: BodyType;
|
|
305
|
-
/**
|
|
313
|
+
/**
|
|
314
|
+
* collision shapes (one or more — compound body support). Already
|
|
315
|
+
* resolved: a definition naming a collision shape file is a
|
|
316
|
+
* {@link BodyDefinitionInit}, and the engine resolves it before any
|
|
317
|
+
* adapter is handed it.
|
|
318
|
+
*/
|
|
306
319
|
shapes: BodyShape[];
|
|
307
320
|
/** mass per unit area; defaults are adapter-specific */
|
|
308
321
|
density?: number;
|
|
@@ -311,6 +324,12 @@ export interface BodyDefinition {
|
|
|
311
324
|
* off every frame regardless of contact, creating terminal velocity.
|
|
312
325
|
* Number applies uniformly; `{x, y}` damps each axis independently
|
|
313
326
|
* (melonJS-specific — Matter only supports scalar and will average).
|
|
327
|
+
*
|
|
328
|
+
* It damps ROTATION as well as translation on the matter and planck
|
|
329
|
+
* adapters, so it is also what stops a body spinning once something has
|
|
330
|
+
* set it turning. Left at `0`, a spin never decays. The builtin adapter
|
|
331
|
+
* maps it onto its per-axis `body.friction` damping vector instead, and
|
|
332
|
+
* has no rotation to damp.
|
|
314
333
|
*/
|
|
315
334
|
frictionAir?: number | {
|
|
316
335
|
x: number;
|
|
@@ -351,7 +370,21 @@ export interface BodyDefinition {
|
|
|
351
370
|
x: number;
|
|
352
371
|
y: number;
|
|
353
372
|
};
|
|
354
|
-
/**
|
|
373
|
+
/**
|
|
374
|
+
* Disable rotation simulation, so the body keeps whatever angle it has.
|
|
375
|
+
*
|
|
376
|
+
* Defaults to whatever the underlying engine defaults to, which for both
|
|
377
|
+
* matter and planck is `false`: a rigid body turns when something turns
|
|
378
|
+
* it. Pass `true` for anything that must stay upright, such as a
|
|
379
|
+
* platformer actor that should never tip over.
|
|
380
|
+
*
|
|
381
|
+
* The builtin adapter ignores this field, since its rotation is visual
|
|
382
|
+
* only and its collision shapes never turn either way.
|
|
383
|
+
* @default false
|
|
384
|
+
* @example
|
|
385
|
+
* // a character that stays upright whatever it walks into
|
|
386
|
+
* this.bodyDef = { type: "dynamic", shapes: [...], fixedRotation: true };
|
|
387
|
+
*/
|
|
355
388
|
fixedRotation?: boolean;
|
|
356
389
|
/** the body generates collision events but no physical response */
|
|
357
390
|
isSensor?: boolean;
|
|
@@ -369,6 +402,122 @@ export interface BodyDefinition {
|
|
|
369
402
|
/** arbitrary user data attached to the body */
|
|
370
403
|
userData?: unknown;
|
|
371
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* One fixture of a collision shape file, as exported by a physics-shape
|
|
407
|
+
* editor. Geometry is either a polygon outline or a circle, and the material
|
|
408
|
+
* values beside it are custom parameters the exporter template declares rather
|
|
409
|
+
* than guaranteed fields, so the spelling varies between templates. melonJS
|
|
410
|
+
* reads the common ones.
|
|
411
|
+
*
|
|
412
|
+
* Reached through {@link BodyDefinitionInit.shapes}; never written by hand in
|
|
413
|
+
* the usual case, where `shapes` names the preloaded file instead.
|
|
414
|
+
*/
|
|
415
|
+
export interface ShapeEntry {
|
|
416
|
+
/** polygon outline as a flat `[x0, y0, x1, y1, …]` coordinate list */
|
|
417
|
+
shape?: number[];
|
|
418
|
+
/**
|
|
419
|
+
* polygon outline as points. A concave outline is exported already
|
|
420
|
+
* decomposed, so this is normally a list of convex pieces, each of which
|
|
421
|
+
* becomes its own {@link Polygon}; a single outline is also read.
|
|
422
|
+
*/
|
|
423
|
+
vertices?: {
|
|
424
|
+
x: number;
|
|
425
|
+
y: number;
|
|
426
|
+
}[] | {
|
|
427
|
+
x: number;
|
|
428
|
+
y: number;
|
|
429
|
+
}[][];
|
|
430
|
+
/** circle geometry, becoming an {@link Ellipse} */
|
|
431
|
+
circle?: {
|
|
432
|
+
x: number;
|
|
433
|
+
y: number;
|
|
434
|
+
radius: number;
|
|
435
|
+
};
|
|
436
|
+
/** circle radius, when the centre sits beside it rather than inside it */
|
|
437
|
+
radius?: number;
|
|
438
|
+
/** circle centre, paired with a sibling `radius` */
|
|
439
|
+
center?: {
|
|
440
|
+
x: number;
|
|
441
|
+
y: number;
|
|
442
|
+
};
|
|
443
|
+
/** mass per unit area */
|
|
444
|
+
density?: number;
|
|
445
|
+
/** surface friction during contact */
|
|
446
|
+
friction?: number;
|
|
447
|
+
/** bounciness; `restitution` is the other spelling */
|
|
448
|
+
bounce?: number;
|
|
449
|
+
/** bounciness; `bounce` is the other spelling */
|
|
450
|
+
restitution?: number;
|
|
451
|
+
/** the fixture reports collisions without a physical response */
|
|
452
|
+
isSensor?: boolean;
|
|
453
|
+
/**
|
|
454
|
+
* Collision filtering, in melonJS's own names, for a file written or
|
|
455
|
+
* adjusted by hand. These are {@link collision.types} values.
|
|
456
|
+
*
|
|
457
|
+
* The exporting tool's own `filter` block (`categoryBits` / `maskBits`,
|
|
458
|
+
* in any spelling) is deliberately NOT read: those numbers live in that
|
|
459
|
+
* tool's namespace, a template writes its defaults for every fixture
|
|
460
|
+
* whether or not the author set anything, and its default category `1`
|
|
461
|
+
* is melonJS's `PLAYER_OBJECT`. Importing them would silently tag a shape
|
|
462
|
+
* as something it is not and stop it colliding. Set filtering on the body
|
|
463
|
+
* definition instead.
|
|
464
|
+
*/
|
|
465
|
+
collisionType?: number;
|
|
466
|
+
/** collision filtering, in melonJS's own names. See above. */
|
|
467
|
+
collisionMask?: number;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* A body definition as authored, before the engine resolves it.
|
|
471
|
+
*
|
|
472
|
+
* This is what {@link Renderable#bodyDef} takes. It is a
|
|
473
|
+
* {@link BodyDefinition} whose `shapes` may additionally name a collision
|
|
474
|
+
* shape file, which is resolved into real shapes when the renderable is added
|
|
475
|
+
* to a container — so every adapter receives the same
|
|
476
|
+
* {@link BodyDefinition}, and one definition works unchanged on the builtin,
|
|
477
|
+
* matter and planck backends alike.
|
|
478
|
+
* @example
|
|
479
|
+
* // preload the file the shape editor exported, like any other JSON
|
|
480
|
+
* { name: "shapes", type: "json", src: "data/physics/shapes.json" }
|
|
481
|
+
*
|
|
482
|
+
* // then name it, and the body inside it to use
|
|
483
|
+
* new Sprite(x, y, {
|
|
484
|
+
* image: "hotdog",
|
|
485
|
+
* bodyDef: { type: "dynamic", shapes: "shapes", id: "hotdog" },
|
|
486
|
+
* });
|
|
487
|
+
*
|
|
488
|
+
* // material values the file carries are applied unless the definition
|
|
489
|
+
* // states otherwise, so this body bounces at 0.9 whatever the file says
|
|
490
|
+
* { type: "dynamic", shapes: "shapes", id: "hotdog", restitution: 0.9 }
|
|
491
|
+
*
|
|
492
|
+
* // authored shapes still work, and the two can be mixed
|
|
493
|
+
* { type: "static", shapes: [new Rect(0, 0, 32, 32)] }
|
|
494
|
+
*/
|
|
495
|
+
export interface BodyDefinitionInit extends Omit<BodyDefinition, "shapes"> {
|
|
496
|
+
/**
|
|
497
|
+
* The body's collision shapes, as any of:
|
|
498
|
+
*
|
|
499
|
+
* - real shapes, the usual case
|
|
500
|
+
* - the name a collision shape file was preloaded under, paired with
|
|
501
|
+
* {@link BodyDefinitionInit.id}
|
|
502
|
+
* - the exported fixtures themselves, for a file read by hand
|
|
503
|
+
*
|
|
504
|
+
* Shapes are OWNED by the body they are given to, and a rotating body
|
|
505
|
+
* mutates them in place, so never share one array between two bodies.
|
|
506
|
+
* Naming the file instead sidesteps this: every body resolved from it
|
|
507
|
+
* mints its own shapes.
|
|
508
|
+
*/
|
|
509
|
+
shapes: BodyShape[] | ShapeEntry[] | string;
|
|
510
|
+
/**
|
|
511
|
+
* Which body to read out of the file, when `shapes` names one. A
|
|
512
|
+
* collision shape file usually holds a map of body name to fixtures, and
|
|
513
|
+
* this is the name the shapes were authored under.
|
|
514
|
+
*
|
|
515
|
+
* Not needed for a single-body export, where the file IS one body's
|
|
516
|
+
* fixture list with no map above it; there is nothing for an id to name,
|
|
517
|
+
* and the whole file is used.
|
|
518
|
+
*/
|
|
519
|
+
id?: string;
|
|
520
|
+
}
|
|
372
521
|
/**
|
|
373
522
|
* Adapter feature flags. The engine reads these to negotiate optional
|
|
374
523
|
* capabilities; user code can branch on them to gracefully degrade when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/physics/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,OAA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203
|
public maxVelZ: number;
|
|
204
204
|
/**
|
|
205
|
-
* `true` when at least one of this body's shapes
|
|
206
|
-
*
|
|
205
|
+
* `true` when at least one of this body's shapes has a depth extent
|
|
206
|
+
* and can therefore be resolved along z: a {@link Box3d} or a
|
|
207
|
+
* {@link Sphere}.
|
|
207
208
|
* Maintained by {@link Body#addShape} / {@link Body#removeShape}.
|
|
208
209
|
* @readonly
|
|
209
210
|
* @public
|
|
@@ -485,8 +486,12 @@ export default class Body {
|
|
|
485
486
|
* torso.isTrigger = true; // detect hits, never get pushed by them
|
|
486
487
|
* this.body.addShape(feet);
|
|
487
488
|
* this.body.addShape(torso);
|
|
488
|
-
*
|
|
489
|
-
*
|
|
489
|
+
* @example
|
|
490
|
+
* // an exported shape list is DEPRECATED here since 20.7.0: it reaches
|
|
491
|
+
* // the builtin solver only. Name the asset from a body definition
|
|
492
|
+
* // instead, which every backend understands.
|
|
493
|
+
* this.body.addShape(me.loader.getJSON("shapesdef").banana); // warns
|
|
494
|
+
* this.bodyDef = { type: "dynamic", shapes: "shapesdef", id: "banana" };
|
|
490
495
|
*/
|
|
491
496
|
addShape(shape: Rect | Polygon | Line | Ellipse | Point | Point[] | Bounds | object): number;
|
|
492
497
|
/**
|
|
@@ -502,20 +507,6 @@ export default class Body {
|
|
|
502
507
|
* @param {number} [index=0] - the shape object for which to set the vertices
|
|
503
508
|
*/
|
|
504
509
|
addVertices(vertices: Vector2d[], index?: number): void;
|
|
505
|
-
/**
|
|
506
|
-
* add collision mesh based on a JSON object
|
|
507
|
-
* (this will also apply any physic properties defined in the given JSON file)
|
|
508
|
-
* @param {object} json - a JSON object as exported from a Physics Editor tool
|
|
509
|
-
* @param {string} [id] - an optional shape identifier within the given the json object
|
|
510
|
-
* @see https://www.codeandweb.com/physicseditor
|
|
511
|
-
* @returns {number} how many shapes were added to the body
|
|
512
|
-
* @example
|
|
513
|
-
* // define the body based on the banana shape
|
|
514
|
-
* this.body.fromJSON(me.loader.getJSON("shapesdef").banana);
|
|
515
|
-
* // or ...
|
|
516
|
-
* this.body.fromJSON(me.loader.getJSON("shapesdef"), "banana");
|
|
517
|
-
*/
|
|
518
|
-
fromJSON(json: object, id?: string): number;
|
|
519
510
|
/**
|
|
520
511
|
* return the collision shape at the given index
|
|
521
512
|
* @param {number} [index=0] - the shape object at the specified index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/body.js"],"names":[],"mappings":"AA+
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/body.js"],"names":[],"mappings":"AA+CA;;;;GAIG;AACH;IACC;;;;OAIG;IACH,sBAJW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,WAClD,IAAI,GAAC,IAAI,EAAE,GAAC,OAAO,GAAC,OAAO,EAAE,GAAC,IAAI,GAAC,IAAI,EAAE,GAAC,OAAO,GAAC,OAAO,EAAE,GAAC,KAAK,GAAC,KAAK,EAAE,GAAC,MAAM,GAAC,MAAM,EAAE,GAAC,MAAM,2BAiZ1G;IA7YA;;;;;;OAMG;IACH,iBAHU,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,CAGpC;IAGvB;;;;OAIG;IACH,eAFU,MAAM,CAEc;IAI9B;;;;;;;;;OASG;IACH,QAFU,CAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,KAAK,CAAC,EAAE,CAExB;IAGjB;;;;;;;;OAQG;IACH,eAJU,MAAM,CAI+B;IAE/C;;;;;;;;;OASG;IACH,sBAPU,MAAM,CAOiC;IAGhD;;;;;;;OAOG;IACH,YAHU,QAAQ,CAGW;IAK7B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,cAlBU,QAAQ,CAkBa;IAK/B;;;;;OAKG;IACH,iBAHU,QAAQ,CAGgB;IAInC;;;;;;OAMG;IACH,eAHU,MAAM,CAGD;IAEf;;;;;OAK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;;;;;;;;;;;;OAgBG;IACH,sCAVW,MAAM,QAwBhB;IAED;;;;;;;;;;;;OAYG;IACH,kBAXc,CAAC,MAAM,GAAC,QAAQ,CAAC,EAAA,GAClB,OAAO,CA+BnB;IAED;;;;;;OAMG;IACH,cAJW,MAAM,MACN,QAAQ,GACN,IAAI,CAgChB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,KACN,MAAM,MACN,MAAM,QAQhB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,MACN,MAAM,MACN,MAAM,QAQhB;IAED;;;;;;;;;;;OAWG;IACH,oBAFa,OAAO,CA4FnB;IAED;;;;OAIG;IACH,gBAqFC;CACD;4BAzkD0B,gCAAgC;2BADjC,+BAA+B;wBADlC,mCAAmC;wBAGnC,4BAA4B;iCACnB,qCAAqC;uBAtBlC,cAAc;wBATZ,6BAA6B;qBAFnC,0BAA0B;wBADpB,6BAA6B;sBAEjC,2BAA2B;yBAOrB,wBAAwB;qBAL1C,+BAA+B;sBALnB,2BAA2B;gCAqC7B,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-adapter.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/builtin-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EACX,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,SAAS,EACT,cAAc,EACd,UAAU,EACV,YAAY,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,KAAK,MAAM,aA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from "../../renderable/entity/entity.js";
|
|
37
37
|
import type Sprite from "../../renderable/sprite.js";
|
|
38
38
|
import type NineSliceSprite from "../../renderable/nineslicesprite.js";
|
|
39
|
-
import type { Line } from "../../geometries/line.ts";
|
|
40
39
|
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/detector.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/detector.js"],"names":[],"mappings":";AA+GA;;GAEG;AACH;IACC;;OAEG;IACH,mBAFW,SAAS,EAkLnB;IA9KA,iBAAkB;IAElB;;;;OAIG;IACH,UAFU,cAAc,CAEY;IAEpC;;;;;;;;OAQG;IACH,mCAA8C;IAE9C;;;;;;OAMG;IACH,2BAA4B;IAC5B;;;;;OAKG;IACH,yBAA0B;IAC1B;;;;;;;;;;;;;;;OAeG;IACH;;;;;;;;;;;;;;;;;;;;;;;QAyCC;IAED;;;;;;;OAOG;IACH,gCAAiC;IACjC;;;OAGG;IACH,8BAA+B;IAE/B;;;;;;;OAOG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;QAmCC;IAED;;;;;;OAMG;IACH,+EAAuB;IACvB;;;OAGG;IACH,iBAAuB;IACvB;;;OAGG;IACH,uGAEC;IAGF;;;;;;;;;OASG;IACH;;;;;;;;;;;;;;;;;;;;;;;MA0CC;IAED;;;;;;OAMG;IACH,mBAGC;IAED;;;;;;;OAOG;IACH,iBA0DC;IAED;;;;;;OAMG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;MAsBC;IAED;;;;;;OAMG;IACH,4CAOC;IAED;;;;;;;;;;;;;;OAcG;IACH,yEAFa,OAAO,CAuBnB;IAED;;;;;;;;;;;;;;OAcG;IACH,2EAqBC;IAED;;;;;;;;;OASG;IACH,sCAMC;IAED;;;;;;OAMG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;MA2CC;IAED;;;;;OAKG;IACH,oFAyCC;IAED;;;;;;;;;OASG;IACH,yBAGC;IAED;;;;;;;;;;;;;OAaG;IACH,uEAFa,OAAO,CAanB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,uBAHW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,QAClD,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,QA2H5D;IAED;;;;;;OAMG;IACH,iBAJW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,KAClD,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CAiBnB;IAED;;;;;OAKG;IACH,gBAJW,IAAI,SACJ,IAAI,qDACF,OAAO,CA0InB;IAED;;;;;;OAMG;IACH,iBAHW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CA8LnB;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,cArBW,IAAI,WACJ,KAAK,CAAE,UAAU,CAAC,GAChB,KAAK,CAAE,UAAU,CAAC,CAqC9B;CACD;2BAzpCyB,+BAA+B;2BAnG9B,gBAAgB;4BAoGhB,gCAAgC;wBAFpC,mCAAmC;wBAGnC,4BAA4B;iCACnB,qCAAqC;0BAC9C,0BAA0B"}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import type Renderable from "../../renderable/renderable.js";
|
|
3
|
-
import type Container from "../../renderable/container.js";
|
|
4
|
-
import type Entity from "../../renderable/entity/entity.js";
|
|
5
|
-
import type Sprite from "../../renderable/sprite.js";
|
|
6
|
-
import type NineSliceSprite from "../../renderable/nineslicesprite.js";
|
|
7
|
-
import type { Polygon } from "../../geometries/polygon.ts";
|
|
8
|
-
import type { Ellipse } from "../../geometries/ellipse.ts";
|
|
9
2
|
//# sourceMappingURL=sat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sat.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/sat.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sat.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/sat.js"],"names":[],"mappings":"AAwQA;;;;;;;;;;GAUG;AACH,sCAPW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,SAClD,OAAO,KACP,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,SAClD,OAAO,aACP,QAAQ,YAAC,GACP,OAAO,CAmDnB;AAED;;;;;;;;;;;GAWG;AACH,sCARW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,YAClD,OAAO,KACP,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,YAClD,OAAO,aACP,QAAQ,YAAC,GAEP,OAAO,CAqEnB;AAED;;;;;;;;;;GAUG;AACH,sCAPW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,SAClD,OAAO,KACP,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,YAClD,OAAO,aACP,QAAQ,YAAC,GACP,OAAO,CAyKnB;AAED;;;;;;;;;;;;;GAaG;AACH,sCARW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,YAClD,OAAO,KACP,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,SAClD,OAAO,aACP,QAAQ,YAAC,GAEP,OAAO,CAiBnB;4BA9lB0B,gCAAgC;2BADjC,+BAA+B;wBADlC,mCAAmC;wBAGnC,4BAA4B;iCACnB,qCAAqC;6BAC3C,6BAA6B;6BAC7B,6BAA6B"}
|
|
@@ -1,4 +1,50 @@
|
|
|
1
1
|
|
|
2
|
+
/**
|
|
3
|
+
* Check whether two {@link Sphere} shapes collide.
|
|
4
|
+
*
|
|
5
|
+
* The simplest test there is — centres closer than the sum of the radii —
|
|
6
|
+
* and the only 3D shape that needs no orientation, which is why it is the
|
|
7
|
+
* one to reach for when the things being tested tumble or sit on a curved
|
|
8
|
+
* surface.
|
|
9
|
+
* @param {Renderable} a - a reference to the object A.
|
|
10
|
+
* @param {Sphere} sphereA - a reference to the object A Sphere to be tested
|
|
11
|
+
* @param {Renderable} b - a reference to the object B.
|
|
12
|
+
* @param {Sphere} sphereB - a reference to the object B Sphere to be tested
|
|
13
|
+
* @param {object} [response] - Response object that will be populated if they intersect.
|
|
14
|
+
* @returns {boolean} true if they intersect, false if they don't.
|
|
15
|
+
*/
|
|
16
|
+
export function testSphereSphere(a: Renderable, sphereA: Sphere, b: Renderable, sphereB: Sphere, response?: object): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Check whether a {@link Sphere} collides with a {@link Box3d}.
|
|
19
|
+
*
|
|
20
|
+
* Against the closest point on the box, which is the centre clamped to the
|
|
21
|
+
* box's extents. That point is the centre itself when the sphere is INSIDE
|
|
22
|
+
* the box, leaving no direction to separate along, so that case falls back
|
|
23
|
+
* to the least-penetrated face, which is the rule {@link testBox3dBox3d}
|
|
24
|
+
* uses throughout, down to resolving an exact tie X → Y → Z.
|
|
25
|
+
* @param {Renderable} a - a reference to the object A.
|
|
26
|
+
* @param {Sphere} sphereA - a reference to the object A Sphere to be tested
|
|
27
|
+
* @param {Renderable} b - a reference to the object B.
|
|
28
|
+
* @param {Box3d} boxB - a reference to the object B Box3d to be tested
|
|
29
|
+
* @param {object} [response] - Response object that will be populated if they intersect.
|
|
30
|
+
* @returns {boolean} true if they intersect, false if they don't.
|
|
31
|
+
*/
|
|
32
|
+
export function testSphereBox3d(a: Renderable, sphereA: Sphere, b: Renderable, boxB: Box3d, response?: object): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Box-first form of {@link testSphereBox3d}.
|
|
35
|
+
*
|
|
36
|
+
* The response is written from the SPHERE's point of view by the call it
|
|
37
|
+
* delegates to, so the normal is flipped back afterwards — the same shape
|
|
38
|
+
* the planar pairs use for their mirrored entries.
|
|
39
|
+
* @param {Renderable} a - a reference to the object A.
|
|
40
|
+
* @param {Box3d} boxA - a reference to the object A Box3d to be tested
|
|
41
|
+
* @param {Renderable} b - a reference to the object B.
|
|
42
|
+
* @param {Sphere} sphereB - a reference to the object B Sphere to be tested
|
|
43
|
+
* @param {object} [response] - Response object that will be populated if they intersect.
|
|
44
|
+
* @returns {boolean} true if they intersect, false if they don't.
|
|
45
|
+
*/
|
|
46
|
+
export function testBox3dSphere(a: Renderable, boxA: Box3d, b: Renderable, sphereB: Sphere, response?: object): boolean;
|
|
2
47
|
import type Renderable from "../../renderable/renderable.js";
|
|
3
48
|
import type { Box3d } from "../../geometries/box3d.ts";
|
|
49
|
+
import type { Sphere } from "../../geometries/sphere.ts";
|
|
4
50
|
//# sourceMappingURL=sat3d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sat3d.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/sat3d.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sat3d.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/sat3d.js"],"names":[],"mappings":"AA0DA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,kCAPW,UAAU,QACV,KAAK,KACL,UAAU,QACV,KAAK,aACL,MAAM,GACJ,OAAO,CA+EnB;AAyBD;;;;;;;;;;;;;GAaG;AACH,oCAPW,UAAU,WACV,MAAM,KACN,UAAU,WACV,MAAM,aACN,MAAM,GACJ,OAAO,CAqCnB;AAED;;;;;;;;;;;;;;GAcG;AACH,mCAPW,UAAU,WACV,MAAM,KACN,UAAU,QACV,KAAK,aACL,MAAM,GACJ,OAAO,CA0DnB;AAED;;;;;;;;;;;;GAYG;AACH,mCAPW,UAAU,QACV,KAAK,KACL,UAAU,WACV,MAAM,aACN,MAAM,GACJ,OAAO,CAmBnB;AAED;;;;;;;;;;;;;;GAcG;AACH,gGAEC;AAED;;;;GAIG;AACH,gGAEC;AAED;;;;;GAKG;AACH,mGAEC;AAED;;;;;GAKG;AACH,mGAEC;AAsCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qCATW,UAAU,WACV,MAAM,KACN,UAAU,SACV,OAAO,aACP,MAAM,GACJ,OAAO,CAMnB;AAED;;;;;;;;;;GAUG;AACH,qCATW,UAAU,SACV,OAAO,KACP,UAAU,WACV,MAAM,aACN,MAAM,GACJ,OAAO,CAMnB;AAED;;;;;;;;;;;GAWG;AACH,qCATW,UAAU,WACV,MAAM,KACN,UAAU,YACV,OAAO,aACP,MAAM,GACJ,OAAO,CAMnB;AAED;;;;;;;;;;;GAWG;AACH,qCATW,UAAU,YACV,OAAO,KACP,UAAU,WACV,MAAM,aACN,MAAM,GACJ,OAAO,CAMnB;4BAne0B,gCAAgC;2BAJnC,2BAA2B;4BAC1B,4BAA4B;6BAC3B,6BAA6B;wBAX/B,6BAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"physicseditor.d.ts","sourceRoot":"","sources":["../../src/physics/physicseditor.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;GAUG;AACH,oCALW,GAAC,GACC,OAAO,CAsBnB;AAED;;;;;;;;GAQG;AACH,6CALW,GAAC,GACC,OAAO,CAqBnB;AAyRD;;;;;;;;;;;;;GAaG;AACH,2CANW,MAAM,SACN,MAAM,GACJ,MAAM,CAsFlB"}
|
|
@@ -1,72 +1,33 @@
|
|
|
1
1
|
export default ResponseObject;
|
|
2
|
+
/**
|
|
3
|
+
* additional import for TypeScript
|
|
4
|
+
* @import Renderable from "../renderable/renderable.js";
|
|
5
|
+
*/
|
|
2
6
|
/**
|
|
3
7
|
* An object representing the result of an intersection.
|
|
4
8
|
*/
|
|
5
|
-
|
|
9
|
+
declare class ResponseObject {
|
|
6
10
|
/**
|
|
7
11
|
* The first object participating in the intersection
|
|
12
|
+
* @type {Renderable|null}
|
|
8
13
|
*/
|
|
9
|
-
a: Renderable;
|
|
14
|
+
a: Renderable | null;
|
|
10
15
|
/**
|
|
11
16
|
* The second object participating in the intersection
|
|
17
|
+
* @type {Renderable|null}
|
|
12
18
|
*/
|
|
13
|
-
b: Renderable;
|
|
14
|
-
/**
|
|
15
|
-
* Magnitude of the overlap on the shortest colliding axis
|
|
16
|
-
*/
|
|
17
|
-
overlap: number;
|
|
18
|
-
/**
|
|
19
|
-
* The overlap vector (i.e. `overlapN.scale(overlap, overlap)`). If this vector is subtracted from the position of a, a and b will no longer be colliding
|
|
20
|
-
*/
|
|
21
|
-
overlapV: Vector2d;
|
|
19
|
+
b: Renderable | null;
|
|
22
20
|
/**
|
|
23
21
|
* The shortest colliding axis (unit-vector)
|
|
22
|
+
* @type {Vector2d}
|
|
24
23
|
*/
|
|
25
24
|
overlapN: Vector2d;
|
|
26
25
|
/**
|
|
27
|
-
* The
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* The Z component of the overlap vector (i.e. `overlapNZ * overlap`). Always `0` for a collision between planar shapes
|
|
32
|
-
*/
|
|
33
|
-
overlapZ: number;
|
|
34
|
-
/**
|
|
35
|
-
* Whether the first object is entirely inside the second
|
|
36
|
-
*/
|
|
37
|
-
aInB: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Whether the second object is entirely inside the first
|
|
26
|
+
* The overlap vector (i.e. `overlapN.scale(overlap, overlap)`). If
|
|
27
|
+
* this vector is subtracted from the position of a, a and b will no
|
|
28
|
+
* longer be colliding
|
|
29
|
+
* @type {Vector2d}
|
|
40
30
|
*/
|
|
41
|
-
bInA: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The index of the colliding shape for the object a body
|
|
44
|
-
*/
|
|
45
|
-
indexShapeA: number;
|
|
46
|
-
/**
|
|
47
|
-
* The index of the colliding shape for the object b body
|
|
48
|
-
*/
|
|
49
|
-
indexShapeB: number;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* An object representing the result of an intersection.
|
|
53
|
-
* @typedef {object} ResponseObject
|
|
54
|
-
* @property {Renderable} a The first object participating in the intersection
|
|
55
|
-
* @property {Renderable} b The second object participating in the intersection
|
|
56
|
-
* @property {number} overlap Magnitude of the overlap on the shortest colliding axis
|
|
57
|
-
* @property {Vector2d} overlapV The overlap vector (i.e. `overlapN.scale(overlap, overlap)`). If this vector is subtracted from the position of a, a and b will no longer be colliding
|
|
58
|
-
* @property {Vector2d} overlapN The shortest colliding axis (unit-vector)
|
|
59
|
-
* @property {number} overlapNZ The Z component of the shortest colliding axis, as a unit scalar (`-1`, `0` or `1`). Always `0` for a collision between planar shapes
|
|
60
|
-
* @property {number} overlapZ The Z component of the overlap vector (i.e. `overlapNZ * overlap`). Always `0` for a collision between planar shapes
|
|
61
|
-
* @property {boolean} aInB Whether the first object is entirely inside the second
|
|
62
|
-
* @property {boolean} bInA Whether the second object is entirely inside the first
|
|
63
|
-
* @property {number} indexShapeA The index of the colliding shape for the object a body
|
|
64
|
-
* @property {number} indexShapeB The index of the colliding shape for the object b body
|
|
65
|
-
*/
|
|
66
|
-
declare class ResponseObject {
|
|
67
|
-
a: any;
|
|
68
|
-
b: any;
|
|
69
|
-
overlapN: Vector2d;
|
|
70
31
|
overlapV: Vector2d;
|
|
71
32
|
/**
|
|
72
33
|
* Z half of the minimum translation axis.
|
|
@@ -76,24 +37,45 @@ declare class ResponseObject {
|
|
|
76
37
|
* subclass of {@link Vector2d} — retyping them would break every
|
|
77
38
|
* existing consumer of a 2D collision response.
|
|
78
39
|
*
|
|
79
|
-
* The
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* unchanged as `overlapZ = overlapNZ * overlap`, and a collision
|
|
83
|
-
* resolved along Z leaves `overlapN` / `overlapV` at zero — a legacy
|
|
84
|
-
* 2D handler reading them applies no push, which is correct, because
|
|
85
|
-
* there is no 2D push to apply.
|
|
40
|
+
* The 2D invariant `overlapV = overlapN * overlap` extends unchanged
|
|
41
|
+
* as `overlapZ = overlapNZ * overlap`, and `overlapN` together with
|
|
42
|
+
* `overlapNZ` is always a 3D unit vector.
|
|
86
43
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
44
|
+
* How that vector is SHAPED depends on which 3D shapes met:
|
|
45
|
+
*
|
|
46
|
+
* - A {@link Box3d} pair separates along one world axis, so exactly
|
|
47
|
+
* one of `overlapN.x`, `overlapN.y` and `overlapNZ` is non-zero and
|
|
48
|
+
* that one is `-1` or `1`. A contact resolved along Z leaves
|
|
49
|
+
* `overlapN` / `overlapV` at zero, so a legacy 2D handler reading
|
|
50
|
+
* them applies no push, which is correct — there is no 2D push to
|
|
51
|
+
* apply.
|
|
52
|
+
* - A {@link Sphere} against anything separates along the line
|
|
53
|
+
* between the two closest points, which is generally DIAGONAL: all
|
|
54
|
+
* three components can be non-zero at once, and each is any value
|
|
55
|
+
* in `[-1, 1]`. A handler that branches on `overlapNZ !== 0` and
|
|
56
|
+
* then ignores `overlapV` drops the planar half of such a contact.
|
|
57
|
+
* Subtract both halves, or read `overlap` along the full normal.
|
|
58
|
+
*
|
|
59
|
+
* Both are `0` for every planar shape pair, so nothing about a 2D
|
|
60
|
+
* collision changed.
|
|
89
61
|
*/
|
|
90
62
|
overlapNZ: number;
|
|
63
|
+
/**
|
|
64
|
+
* The Z component of the overlap vector (i.e. `overlapNZ * overlap`).
|
|
65
|
+
* Always `0` for a collision between planar shapes
|
|
66
|
+
* @type {number}
|
|
67
|
+
*/
|
|
91
68
|
overlapZ: number;
|
|
69
|
+
/** Whether the first object is entirely inside the second */
|
|
92
70
|
aInB: boolean;
|
|
71
|
+
/** Whether the second object is entirely inside the first */
|
|
93
72
|
bInA: boolean;
|
|
73
|
+
/** The index of the colliding shape for the object a body */
|
|
94
74
|
indexShapeA: number;
|
|
75
|
+
/** The index of the colliding shape for the object b body */
|
|
95
76
|
indexShapeB: number;
|
|
96
77
|
isTriggerContact: boolean;
|
|
78
|
+
/** Magnitude of the overlap on the shortest colliding axis */
|
|
97
79
|
overlap: number;
|
|
98
80
|
/**
|
|
99
81
|
* Set some values of the response back to their defaults. <br>
|
|
@@ -105,5 +87,6 @@ declare class ResponseObject {
|
|
|
105
87
|
*/
|
|
106
88
|
public clear(): object;
|
|
107
89
|
}
|
|
90
|
+
import type Renderable from "../renderable/renderable.js";
|
|
108
91
|
import { Vector2d } from "../math/vector2d.ts";
|
|
109
92
|
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/physics/response.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/physics/response.js"],"names":[],"mappings":";AAEA;;;GAGG;AACH;;GAEG;AACH;IAEE;;;OAGG;IACH,GAFU,UAAU,GAAC,IAAI,CAEZ;IACb;;;OAGG;IACH,GAFU,UAAU,GAAC,IAAI,CAEZ;IACb;;;OAGG;IACH,UAFU,QAAQ,CAEY;IAC9B;;;;;OAKG;IACH,UAFU,QAAQ,CAEY;IAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,kBAAkB;IAClB;;;;OAIG;IACH,UAFU,MAAM,CAEC;IACjB,6DAA6D;IAC7D,cAAgB;IAChB,6DAA6D;IAC7D,cAAgB;IAChB,6DAA6D;IAC7D,oBAAqB;IACrB,6DAA6D;IAC7D,oBAAqB;IACrB,0BAA6B;IAC7B,8DAA8D;IAC9D,gBAA+B;IAGhC;;;;;;;OAOG;IACH,gBAFa,MAAM,CAelB;CACD;4BArG0B,6BAA6B;yBAJ/B,qBAAqB"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* additional import for TypeScript
|
|
3
|
+
* @import {Vector2d} from "../math/vector2d.ts";
|
|
4
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* a basic collectable helper class for immovable object (e.g. a coin)
|
|
3
7
|
* @category Game Objects
|
|
@@ -13,7 +17,7 @@ export default class Collectable extends Sprite {
|
|
|
13
17
|
anchorPoint?: string | Vector2d | {
|
|
14
18
|
x: number;
|
|
15
19
|
y: number;
|
|
16
|
-
};
|
|
20
|
+
} | undefined;
|
|
17
21
|
});
|
|
18
22
|
name: any;
|
|
19
23
|
type: any;
|
|
@@ -27,4 +31,5 @@ export default class Collectable extends Sprite {
|
|
|
27
31
|
};
|
|
28
32
|
}
|
|
29
33
|
import Sprite from "./sprite.js";
|
|
34
|
+
import type { Vector2d } from "../math/vector2d.ts";
|
|
30
35
|
//# sourceMappingURL=collectable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectable.d.ts","sourceRoot":"","sources":["../../src/renderable/collectable.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH;IACC;;;;;OAKG;IACH,eALW,MAAM,KACN,MAAM,YAEd;QAAuD,WAAW
|
|
1
|
+
{"version":3,"file":"collectable.d.ts","sourceRoot":"","sources":["../../src/renderable/collectable.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH;;;GAGG;AACH;IACC;;;;;OAKG;IACH,eALW,MAAM,KACN,MAAM,YAEd;QAAuD,WAAW;eAAvC,MAAM;eAAG,MAAM;;KAC5C,EA+CA;IA1CA,UAAyB;IACzB,UAAyB;IACzB,QAAqB;IAoBrB;;;;;;MAOC;CAcF;mBAhEkB,aAAa;8BAIL,qBAAqB"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @import CanvasRenderer from "./../video/canvas/canvas_renderer.js";
|
|
5
5
|
* @import WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
6
6
|
* @import Camera2d from "./../camera/camera2d.ts";
|
|
7
|
+
* @import Renderer from "../video/renderer.js";
|
|
7
8
|
*/
|
|
8
9
|
/**
|
|
9
10
|
* a generic Color Layer Object. Fills the entire Canvas with the color not just the container the object belongs to.
|
|
@@ -24,14 +25,13 @@ export default class ColorLayer extends Renderable {
|
|
|
24
25
|
onResetEvent(name: any, color: any, z?: number): void;
|
|
25
26
|
/**
|
|
26
27
|
* draw this color layer (automatically called by melonJS)
|
|
27
|
-
* @param {
|
|
28
|
+
* @param {Renderer} renderer - a renderer instance
|
|
28
29
|
* @param {Camera2d} [viewport] - the viewport to (re)draw
|
|
29
30
|
*/
|
|
30
|
-
draw(renderer:
|
|
31
|
+
draw(renderer: Renderer, viewport?: Camera2d): void;
|
|
31
32
|
}
|
|
32
33
|
import Renderable from "./renderable.js";
|
|
33
34
|
import type { Color } from "./../math/color.ts";
|
|
34
|
-
import type
|
|
35
|
-
import type WebGLRenderer from "./../video/webgl/webgl_renderer.js";
|
|
35
|
+
import type Renderer from "../video/renderer.js";
|
|
36
36
|
import type Camera2d from "./../camera/camera2d.ts";
|
|
37
37
|
//# sourceMappingURL=colorlayer.d.ts.map
|