melonjs 19.4.0 → 19.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +18 -2
  2. package/build/application/application.d.ts.map +1 -1
  3. package/build/application/settings.d.ts +25 -2
  4. package/build/application/settings.d.ts.map +1 -1
  5. package/build/audio/audio.d.ts +77 -253
  6. package/build/audio/audio.d.ts.map +1 -1
  7. package/build/audio/backend.d.ts +121 -0
  8. package/build/audio/backend.d.ts.map +1 -0
  9. package/build/audio/playback.d.ts +157 -0
  10. package/build/audio/playback.d.ts.map +1 -0
  11. package/build/audio/procedural.d.ts +105 -0
  12. package/build/audio/procedural.d.ts.map +1 -0
  13. package/build/audio/types.d.ts +205 -0
  14. package/build/audio/types.d.ts.map +1 -0
  15. package/build/index.d.ts +6 -3
  16. package/build/index.d.ts.map +1 -1
  17. package/build/index.js +2273 -379
  18. package/build/index.js.map +4 -4
  19. package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
  20. package/build/level/tiled/TMXTileset.d.ts +12 -0
  21. package/build/level/tiled/TMXTileset.d.ts.map +1 -1
  22. package/build/level/tiled/factories/shape.d.ts +1 -1
  23. package/build/level/tiled/factories/shape.d.ts.map +1 -1
  24. package/build/level/tiled/factories/tile.d.ts.map +1 -1
  25. package/build/loader/loader.d.ts +2 -2
  26. package/build/loader/loader.d.ts.map +1 -1
  27. package/build/loader/parsers/aseprite.d.ts +37 -0
  28. package/build/loader/parsers/aseprite.d.ts.map +1 -0
  29. package/build/physics/adapter.d.ts +560 -0
  30. package/build/physics/adapter.d.ts.map +1 -0
  31. package/build/physics/bounds.d.ts +18 -5
  32. package/build/physics/bounds.d.ts.map +1 -1
  33. package/build/physics/builtin/body.d.ts +605 -0
  34. package/build/physics/builtin/body.d.ts.map +1 -0
  35. package/build/physics/builtin/builtin-adapter.d.ts +91 -0
  36. package/build/physics/builtin/builtin-adapter.d.ts.map +1 -0
  37. package/build/physics/builtin/detector.d.ts +167 -0
  38. package/build/physics/builtin/detector.d.ts.map +1 -0
  39. package/build/physics/builtin/quadtree.d.ts +112 -0
  40. package/build/physics/builtin/quadtree.d.ts.map +1 -0
  41. package/build/physics/builtin/raycast.d.ts +4 -0
  42. package/build/physics/builtin/raycast.d.ts.map +1 -0
  43. package/build/physics/{sat.d.ts → builtin/sat.d.ts} +7 -7
  44. package/build/physics/builtin/sat.d.ts.map +1 -0
  45. package/build/physics/world.d.ts +61 -26
  46. package/build/physics/world.d.ts.map +1 -1
  47. package/build/renderable/collectable.d.ts +7 -1
  48. package/build/renderable/collectable.d.ts.map +1 -1
  49. package/build/renderable/container.d.ts +0 -13
  50. package/build/renderable/container.d.ts.map +1 -1
  51. package/build/renderable/renderable.d.ts +78 -17
  52. package/build/renderable/renderable.d.ts.map +1 -1
  53. package/build/renderable/trigger.d.ts +14 -1
  54. package/build/renderable/trigger.d.ts.map +1 -1
  55. package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
  56. package/build/system/timer.d.ts +0 -5
  57. package/build/system/timer.d.ts.map +1 -1
  58. package/build/video/canvas/canvas_renderer.d.ts +0 -130
  59. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  60. package/build/video/renderer.d.ts +111 -0
  61. package/build/video/renderer.d.ts.map +1 -1
  62. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  63. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  64. package/build/video/webgl/effects/shine.d.ts +87 -0
  65. package/build/video/webgl/effects/shine.d.ts.map +1 -0
  66. package/build/video/webgl/webgl_renderer.d.ts +0 -106
  67. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  68. package/package.json +1 -1
  69. package/build/physics/body.d.ts +0 -351
  70. package/build/physics/body.d.ts.map +0 -1
  71. package/build/physics/detector.d.ts +0 -72
  72. package/build/physics/detector.d.ts.map +0 -1
  73. package/build/physics/quadtree.d.ts +0 -69
  74. package/build/physics/quadtree.d.ts.map +0 -1
  75. package/build/physics/sat.d.ts.map +0 -1
@@ -0,0 +1,91 @@
1
+ import type { Rect } from "../../geometries/rectangle.ts";
2
+ import { Vector2d } from "../../math/vector2d.ts";
3
+ import type Renderable from "../../renderable/renderable.js";
4
+ import type { AdapterCapabilities, AdapterOptions, BodyDefinition, BodyShape, PhysicsAdapter, RaycastHit } from "../adapter.ts";
5
+ import type { Bounds } from "../bounds.ts";
6
+ import type World from "../world.js";
7
+ import Body from "./body.js";
8
+ import Detector from "./detector.js";
9
+ /**
10
+ * Default {@link PhysicsAdapter} that wraps melonJS's native SAT-based
11
+ * physics. Owns the active body set, the {@link Detector}, gravity, and
12
+ * the simulation step. Returns the legacy {@link Body} class as its body
13
+ * handle so existing property-based game code (`body.vel.x = 5`,
14
+ * `body.isStatic = true`) keeps working unchanged.
15
+ *
16
+ * Instantiated by default during `Application` construction; user code
17
+ * only touches this directly when explicitly wiring it via
18
+ * `new Application(w, h, { physic: { adapter: new BuiltinAdapter() } })`.
19
+ * @category Physics
20
+ */
21
+ export default class BuiltinAdapter implements PhysicsAdapter {
22
+ /**
23
+ * Short adapter identifier exposed as `world.physic`. Lets user code
24
+ * branch on the active physics implementation without importing the
25
+ * concrete adapter class.
26
+ */
27
+ readonly physicLabel = "builtin";
28
+ /**
29
+ * Advertised capabilities; user code may branch on these.
30
+ */
31
+ readonly capabilities: AdapterCapabilities;
32
+ /**
33
+ * World gravity. Mutate to change at runtime.
34
+ * @default <0, 0.98>
35
+ */
36
+ gravity: Vector2d;
37
+ /**
38
+ * Active physics bodies in this simulation.
39
+ */
40
+ readonly bodies: Set<Body>;
41
+ /**
42
+ * Collision detector instance, created in {@link init}.
43
+ */
44
+ detector: Detector;
45
+ /**
46
+ * Back-reference to the owning world, set in {@link init}.
47
+ */
48
+ private world;
49
+ constructor(options?: AdapterOptions);
50
+ init(world: World): void;
51
+ destroy(): void;
52
+ step(dt: number): void;
53
+ syncFromPhysics(): void;
54
+ addBody(renderable: Renderable, def: BodyDefinition): Body;
55
+ removeBody(renderable: Renderable): void;
56
+ updateShape(renderable: Renderable, shapes: BodyShape[]): void;
57
+ getVelocity(renderable: Renderable, out?: Vector2d): Vector2d;
58
+ setVelocity(renderable: Renderable, v: Vector2d): void;
59
+ applyForce(renderable: Renderable, force: Vector2d, point?: Vector2d): void;
60
+ applyImpulse(renderable: Renderable, impulse: Vector2d): void;
61
+ setPosition(renderable: Renderable, p: Vector2d): void;
62
+ setAngle(renderable: Renderable, angle: number): void;
63
+ getAngle(renderable: Renderable): number;
64
+ setAngularVelocity(renderable: Renderable, omega: number): void;
65
+ getAngularVelocity(renderable: Renderable): number;
66
+ applyTorque(renderable: Renderable, torque: number): void;
67
+ setStatic(renderable: Renderable, isStatic: boolean): void;
68
+ setGravityScale(renderable: Renderable, scale: number): void;
69
+ setFrictionAir(renderable: Renderable, friction: number | {
70
+ x: number;
71
+ y: number;
72
+ }): void;
73
+ setMaxVelocity(renderable: Renderable, limit: {
74
+ x: number;
75
+ y: number;
76
+ }): void;
77
+ getMaxVelocity(renderable: Renderable): {
78
+ x: number;
79
+ y: number;
80
+ };
81
+ setCollisionType(renderable: Renderable, type: number): void;
82
+ setCollisionMask(renderable: Renderable, mask: number): void;
83
+ setSensor(renderable: Renderable, isSensor: boolean): void;
84
+ getBodyAABB(renderable: Renderable, out: Bounds): Bounds | undefined;
85
+ getBodyShapes(renderable: Renderable): readonly BodyShape[];
86
+ isGrounded(renderable: Renderable): boolean;
87
+ raycast(from: Vector2d, to: Vector2d): RaycastHit | null;
88
+ queryAABB(rect: Rect): Renderable[];
89
+ applyGravity(body: Body): void;
90
+ }
91
+ //# sourceMappingURL=builtin-adapter.d.ts.map
@@ -0,0 +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,QAAQ,EAAE,MAAM,wB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B,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAI5D,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI;IAS1D,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAiBpE,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,SAAS,EAAE;IAc3D,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO;IAQ3C,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,UAAU,GAAG,IAAI;IAaxD,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,EAAE;IA0BnC,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;CAa9B"}
@@ -0,0 +1,167 @@
1
+ export default Detector;
2
+ /**
3
+ * the Detector class contains methods for detecting collisions between bodies using a broadphase algorithm.
4
+ */
5
+ declare class Detector {
6
+ /**
7
+ * @param {Container} world - the physic world this detector is bind to
8
+ */
9
+ constructor(world: Container);
10
+ world: Container;
11
+ /**
12
+ * the default response object used for collisions
13
+ * (will be automatically populated by the collides functions)
14
+ * @type {ResponseObject}
15
+ */
16
+ response: ResponseObject;
17
+ /**
18
+ * Pairs (key → [renderableA, renderableB]) that were colliding in
19
+ * the previous step. Diffed against `_frameSeen` at end of step
20
+ * to fire `onCollisionEnd` for pairs that just separated.
21
+ * @ignore
22
+ */
23
+ _activePairs: Map<any, any>;
24
+ /**
25
+ * Pairs seen during the current step. Built up as the per-object
26
+ * `collisions()` calls run; consumed by `endFrame()`.
27
+ * @ignore
28
+ */
29
+ _frameSeen: Map<any, any>;
30
+ /**
31
+ * Two-slot pool of "symmetric view" objects passed to the new
32
+ * collision lifecycle handlers (`onCollisionStart` /
33
+ * `onCollisionActive` / `onCollisionEnd`). Each view carries the
34
+ * receiver-symmetric form: `a` = receiver, `b` = partner,
35
+ * `normal` = MTV of receiver, `depth` = penetration scalar,
36
+ * plus the SAT-legacy `overlapN` / `overlapV` / `overlap` fields
37
+ * flipped to match the same convention.
38
+ *
39
+ * Two slots are needed because both views may be live at the
40
+ * same time (one handler can dispatch into the other through
41
+ * world mutation). Slot 0 is used for the original-a-side
42
+ * dispatch, slot 1 for the original-b-side.
43
+ * @ignore
44
+ */
45
+ _symViews: {
46
+ a: null;
47
+ b: null;
48
+ overlap: number;
49
+ overlapN: {
50
+ x: number;
51
+ y: number;
52
+ };
53
+ overlapV: {
54
+ x: number;
55
+ y: number;
56
+ };
57
+ normal: {
58
+ x: number;
59
+ y: number;
60
+ };
61
+ depth: number;
62
+ }[];
63
+ /**
64
+ * Populate one of the pooled symmetric views from a SAT response.
65
+ * `flip=false` builds the view for `response.a`'s side (legacy
66
+ * fields kept as-is, `normal = -overlapN` = MTV of original a).
67
+ * `flip=true` builds it for `response.b`'s side: `a` / `b` swap,
68
+ * `overlapN` / `overlapV` negated, `normal = +overlapN` (the MTV
69
+ * of original b).
70
+ * @ignore
71
+ */
72
+ _fillSymView(slot: any, satResponse: any, flip: any): {
73
+ a: null;
74
+ b: null;
75
+ overlap: number;
76
+ overlapN: {
77
+ x: number;
78
+ y: number;
79
+ };
80
+ overlapV: {
81
+ x: number;
82
+ y: number;
83
+ };
84
+ normal: {
85
+ x: number;
86
+ y: number;
87
+ };
88
+ depth: number;
89
+ };
90
+ /**
91
+ * Called by the adapter at the start of a physics step. Resets the
92
+ * "seen this frame" set so the end-of-step diff can fire
93
+ * `onCollisionEnd` for pairs that no longer overlap.
94
+ * @ignore
95
+ */
96
+ beginFrame(): void;
97
+ /**
98
+ * Called by the adapter at the end of a physics step. Diffs the
99
+ * "seen this frame" set against the previous-frame active pairs:
100
+ * - pairs in active but not seen → fire onCollisionEnd
101
+ * - swap active ← seen for the next step's diff
102
+ * @ignore
103
+ */
104
+ endFrame(): void;
105
+ /**
106
+ * Build a stable order-independent key for a pair of renderables,
107
+ * using their GUID. Returns undefined if either lacks a GUID (defensive
108
+ * — detached or pool-recycled objects mid-step).
109
+ * @ignore
110
+ */
111
+ _pairKey(a: any, b: any): string | undefined;
112
+ /**
113
+ * determine if two objects should collide (based on both respective objects body collision mask and type).<br>
114
+ * you can redefine this function if you need any specific rules over what should collide with what.
115
+ * @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
116
+ * @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
117
+ * @returns {boolean} true if they should collide, false otherwise
118
+ */
119
+ shouldCollide(a: Renderable | Container | Entity | Sprite | NineSliceSprite, b: Renderable | Container | Entity | Sprite | NineSliceSprite): boolean;
120
+ /**
121
+ * detect collision between two bodies.
122
+ * @param {Body} bodyA - a reference to body A.
123
+ * @param {Body} bodyB - a reference to body B.
124
+ * @returns {boolean} true if colliding
125
+ */
126
+ collides(bodyA: Body, bodyB: Body, response?: ResponseObject): boolean;
127
+ /**
128
+ * find all the collisions for the specified object using a broadphase algorithm
129
+ * @ignore
130
+ * @param {Renderable|Container|Entity|Sprite|NineSliceSprite} objA - object to be tested for collision
131
+ * @returns {boolean} in case of collision, false otherwise
132
+ */
133
+ collisions(objA: Renderable | Container | Entity | Sprite | NineSliceSprite): boolean;
134
+ /**
135
+ * Checks for object colliding with the given line
136
+ * @ignore
137
+ * @param {Line} line - line to be tested for collision
138
+ * @param {Array.<Renderable>} [result] - a user defined array that will be populated with intersecting physic objects.
139
+ * @returns {Array.<Renderable>} an array of intersecting physic objects
140
+ * @example
141
+ * // define a line accross the viewport
142
+ * let ray = new Line(
143
+ * // absolute position of the line
144
+ * 0, 0, [
145
+ * // starting point relative to the initial position
146
+ * new Vector2d(0, 0),
147
+ * // ending point
148
+ * new Vector2d(app.viewport.width, app.viewport.height)
149
+ * ]);
150
+ *
151
+ * // check for collition
152
+ * result = me.collision.rayCast(ray);
153
+ *
154
+ * if (result.length > 0) {
155
+ * // ...
156
+ * }
157
+ */
158
+ rayCast(line: Line, result?: Array<Renderable>): Array<Renderable>;
159
+ }
160
+ import type Container from "../../renderable/container.js";
161
+ import ResponseObject from "../response.js";
162
+ import type Renderable from "../../renderable/renderable.js";
163
+ import type Entity from "../../renderable/entity/entity.js";
164
+ import type Sprite from "../../renderable/sprite.js";
165
+ import type NineSliceSprite from "../../renderable/nineslicesprite.js";
166
+ import type { Line } from "../../geometries/line.ts";
167
+ //# sourceMappingURL=detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/detector.js"],"names":[],"mappings":";AA4CA;;GAEG;AACH;IACC;;OAEG;IACH,mBAFW,SAAS,EA6DnB;IAzDA,iBAAkB;IAElB;;;;OAIG;IACH,UAFU,cAAc,CAEY;IAEpC;;;;;OAKG;IACH,4BAA6B;IAC7B;;;;OAIG;IACH,0BAA2B;IAC3B;;;;;;;;;;;;;;OAcG;IACH;;;;;;;;;;;;;;;;;QAmBC;IAGF;;;;;;;;OAQG;IACH;;;;;;;;;;;;;;;;;MA4BC;IAED;;;;;OAKG;IACH,mBAEC;IAED;;;;;;OAMG;IACH,iBA6BC;IAED;;;;;OAKG;IACH,6CAOC;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,8BACF,OAAO,CAkCnB;IAED;;;;;OAKG;IACH,iBAHW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CAqLnB;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,cArBW,IAAI,WACJ,KAAK,CAAE,UAAU,CAAC,GAChB,KAAK,CAAE,UAAU,CAAC,CAqC9B;CACD;2BA3dyB,+BAA+B;2BAhC9B,gBAAgB;4BAiChB,gCAAgC;wBAFpC,mCAAmC;wBAGnC,4BAA4B;iCACnB,qCAAqC;0BAC9C,0BAA0B"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * a QuadTree implementation in JavaScript, a 2d spatial subdivision algorithm.
3
+ * @category Physics
4
+ * @see game.world.broadphase
5
+ */
6
+ export default class QuadTree {
7
+ /**
8
+ * @param {World} world - the physic world this QuadTree belongs to
9
+ * @param {Bounds} bounds - bounds of the node
10
+ * @param {number} [max_objects=4] - max objects a node can hold before splitting into 4 subnodes
11
+ * @param {number} [max_levels=4] - total max levels inside root Quadtree
12
+ * @param {number} [level] - deepth level, required for subnodes
13
+ */
14
+ constructor(world: World, bounds: Bounds, max_objects?: number, max_levels?: number, level?: number);
15
+ world: World;
16
+ bounds: Bounds;
17
+ max_objects: number;
18
+ max_levels: number;
19
+ level: number;
20
+ objects: any[];
21
+ nodes: any[];
22
+ /**
23
+ * Total number of objects in this subtree (this node's own
24
+ * `objects` plus every descendant's). Maintained by `insert`
25
+ * and `remove` so `isPrunable` / `hasChildren` are O(1) reads
26
+ * instead of O(tree-size) walks. Reset to 0 in `clear`.
27
+ * @ignore
28
+ */
29
+ _subtreeCount: number;
30
+ /**
31
+ * Root-only scratch array reused across `retrieve` calls to
32
+ * avoid allocating a fresh array per pointer event / per
33
+ * narrow-phase query. Only the root allocates one; recursive
34
+ * subnode calls receive the array via the `result` arg.
35
+ * @ignore
36
+ */
37
+ _retrieveScratch: never[] | null;
38
+ split(): void;
39
+ getIndex(item: any): number;
40
+ /**
41
+ * Insert the given object container into the node.
42
+ * @param {Container} container - group of objects to be added
43
+ */
44
+ insertContainer(container: Container): void;
45
+ /**
46
+ * Insert the given object into the node. If the node
47
+ * exceeds the capacity, it will split and add all
48
+ * objects to their corresponding subnodes.
49
+ * @param {object} item - object to be added
50
+ */
51
+ insert(item: object): void;
52
+ /**
53
+ * Recursively remove the given container and its descendants from
54
+ * the quadtree. Mirrors `insertContainer` so the broadphase can be
55
+ * kept in sync when a subtree is detached via
56
+ * `Container.removeChildNow` between two `world.update()` rebuilds
57
+ * (pointer events fire async in that window and would otherwise
58
+ * hit destroyed renderables).
59
+ * @param {Container} container - group of objects to be removed
60
+ */
61
+ removeContainer(container: Container): void;
62
+ /**
63
+ * Return all objects that could collide with the given object.
64
+ *
65
+ * **Re-entrancy contract:** when called with no explicit `result`
66
+ * argument, this method reuses a single root-level scratch array to
67
+ * avoid per-frame allocations. The returned reference is therefore
68
+ * **not safe to retain** past the next `retrieve()` call, AND it is
69
+ * **not safe to issue another scratch-mode `retrieve()` while iterating
70
+ * the previous result** — the second call clears the scratch and
71
+ * refills it, corrupting the outer iteration. In-engine callers
72
+ * (`pointerevent.ts`, `detector.js`) iterate synchronously and never
73
+ * recurse into `retrieve()`, so they're fine. User-facing portable
74
+ * APIs (`adapter.queryAABB`, `adapter.raycast`) pass their own array
75
+ * via the `result` parameter, which bypasses the scratch entirely
76
+ * and is safe to call from inside collision handlers.
77
+ *
78
+ * @param {object} item - object to be checked against
79
+ * @param {object} [fn] - a sorting function for the returned array
80
+ * @param {object[]} [result] - optional caller-supplied result array.
81
+ * Pass an explicit (typically empty) array to sidestep the shared
82
+ * scratch — required for re-entrancy safety.
83
+ * @returns {object[]} array with all detected objects
84
+ */
85
+ retrieve(item: object, fn?: object, result?: object[]): object[];
86
+ /**
87
+ * Remove the given item from the quadtree.
88
+ * (this function won't recalculate the impacted node)
89
+ * @param {object} item - object to be removed
90
+ * @returns {boolean} true if the item was found and removed.
91
+ */
92
+ remove(item: object): boolean;
93
+ /**
94
+ * return true if the node is prunable
95
+ * @returns {boolean} true if the node is prunable
96
+ */
97
+ isPrunable(): boolean;
98
+ /**
99
+ * return true if the node has any children
100
+ * @returns {boolean} true if the node has any children
101
+ */
102
+ hasChildren(): boolean;
103
+ /**
104
+ * clear the quadtree
105
+ * @param {Bounds} [bounds=this.bounds] - the bounds to be cleared
106
+ */
107
+ clear(bounds?: Bounds): void;
108
+ }
109
+ import type World from "../world.js";
110
+ import type { Bounds } from "../bounds.ts";
111
+ import type Container from "../../renderable/container.js";
112
+ //# sourceMappingURL=quadtree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quadtree.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/quadtree.js"],"names":[],"mappings":"AA2DA;;;;GAIG;AACH;IACC;;;;;;OAMG;IACH,mBANW,KAAK,UACL,MAAM,gBACN,MAAM,eACN,MAAM,UACN,MAAM,EA+BhB;IA5BA,aAAkB;IAClB,eAAoB;IAEpB,oBAA8B;IAC9B,mBAA4B;IAE5B,cAAkB;IAElB,eAAiB;IACjB,aAAe;IAEf;;;;;;OAMG;IACH,sBAAsB;IAEtB;;;;;;OAMG;IACH,iCAA+C;IAMhD,cA8DC;IAOD,4BA+CC;IAED;;;OAGG;IACH,2BAFW,SAAS,QA2BnB;IAED;;;;;OAKG;IACH,aAFW,MAAM,QA+ChB;IAED;;;;;;;;OAQG;IACH,2BAFW,SAAS,QAuBnB;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,eAPW,MAAM,OACN,MAAM,WACN,MAAM,EAAE,GAGN,MAAM,EAAE,CAwCpB;IAED;;;;;OAKG;IACH,aAHW,MAAM,GACJ,OAAO,CAsEnB;IAED;;;OAGG;IACH,cAFa,OAAO,CAMnB;IAED;;;OAGG;IACH,eAFa,OAAO,CAOnB;IAED;;;OAGG;IACH,eAFW,MAAM,QAwBhB;CACD;uBA5gBqB,aAAa;4BAEV,cAAc;2BADb,+BAA+B"}
@@ -0,0 +1,4 @@
1
+ import type { RaycastHit } from "../adapter.ts";
2
+ import type World from "../world.js";
3
+ export declare function raycastQuery(world: World, fromX: number, fromY: number, toX: number, toY: number): RaycastHit[];
4
+ //# sourceMappingURL=raycast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raycast.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/raycast.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AA8KrC,wBAAgB,YAAY,CAC3B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACT,UAAU,EAAE,CA4Gd"}
@@ -46,11 +46,11 @@ export function testPolygonEllipse(a: Renderable | Container | Entity | Sprite |
46
46
  * @returns {boolean} true if they intersect, false if they don't.
47
47
  */
48
48
  export function testEllipsePolygon(a: Renderable | Container | Entity | Sprite | NineSliceSprite, ellipseA: Ellipse, b: Renderable | Container | Entity | Sprite | NineSliceSprite, polyB: Polygon, response?: Response | undefined): boolean;
49
- import type Renderable from "./../renderable/renderable.js";
50
- import type Container from "./../renderable/container.js";
51
- import type Entity from "./../renderable/entity/entity.js";
52
- import type Sprite from "./../renderable/sprite.js";
53
- import type NineSliceSprite from "./../renderable/nineslicesprite.js";
54
- import type { Polygon } from "../geometries/polygon.ts";
55
- import type { Ellipse } from "./../geometries/ellipse.ts";
49
+ import type Renderable from "../../renderable/renderable.js";
50
+ import type Container from "../../renderable/container.js";
51
+ import type Entity from "../../renderable/entity/entity.js";
52
+ import type Sprite from "../../renderable/sprite.js";
53
+ import type NineSliceSprite from "../../renderable/nineslicesprite.js";
54
+ import type { Polygon } from "../../geometries/polygon.ts";
55
+ import type { Ellipse } from "../../geometries/ellipse.ts";
56
56
  //# sourceMappingURL=sat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sat.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/sat.js"],"names":[],"mappings":"AAiNA;;;;;;;;;GASG;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,CA8CnB;AAED;;;;;;;;;;GAUG;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,CAiEnB;AAED;;;;;;;;;GASG;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,CAsKnB;AAED;;;;;;;;;;;;GAYG;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;4BAvhB0B,gCAAgC;2BADjC,+BAA+B;wBADlC,mCAAmC;wBAGnC,4BAA4B;iCACnB,qCAAqC;6BAC3C,6BAA6B;6BAC7B,6BAA6B"}
@@ -1,7 +1,3 @@
1
- /**
2
- * @import Application from "./../application/application.ts";
3
- * @import Body from "./body.js";
4
- */
5
1
  /**
6
2
  * an object representing the physic world, and responsible for managing and updating all children and physics
7
3
  * @category Container
@@ -12,20 +8,38 @@ export default class World extends Container {
12
8
  * @param {number} [y=0] - position of the container (accessible via the inherited pos.y property)
13
9
  * @param {number} [width=Infinity] - width of the world container
14
10
  * @param {number} [height=Infinity] - height of the world container
11
+ * @param {PhysicsAdapter} [adapter] - physics adapter to use; defaults to a new {@link BuiltinAdapter} instance
15
12
  */
16
- constructor(x?: number, y?: number, width?: number, height?: number);
13
+ constructor(x?: number, y?: number, width?: number, height?: number, adapter?: PhysicsAdapter);
17
14
  /**
18
15
  * the application (game) this physic world belong to
19
16
  * @type {Application}
20
17
  */
21
18
  app: Application;
22
19
  /**
23
- * the physic engine used by melonJS
20
+ * Identifier of the active physics adapter, taken from the
21
+ * adapter's `physicLabel` field at `Application` construction —
22
+ * `"builtin"` (default — `BuiltinAdapter`), `"matter"`
23
+ * (`@melonjs/matter-adapter`), or a third-party label.
24
+ * The reserved value `"none"` is set when physics is disabled via
25
+ * `physic: "none"` in `ApplicationSettings`; `World.step` skips
26
+ * the simulation entirely under that label, and the rest of the
27
+ * world container behaves like a pure scene graph.
28
+ *
29
+ * User code can branch on the value without importing the
30
+ * adapter class:
31
+ *
32
+ * ```ts
33
+ * if (app.world.physic === "matter") {
34
+ * // matter-only setup (constraints, native queries, …)
35
+ * }
36
+ * ```
24
37
  * @see ApplicationSettings.physic
38
+ * @see PhysicsAdapter.physicLabel
25
39
  * @type {string}
26
40
  * @default "builtin"
27
41
  * @example
28
- * // disable builtin physic
42
+ * // disable physics entirely
29
43
  * app.world.physic = "none";
30
44
  */
31
45
  physic: string;
@@ -36,12 +50,6 @@ export default class World extends Container {
36
50
  * @see timer.maxfps
37
51
  */
38
52
  fps: number;
39
- /**
40
- * world gravity
41
- * @type {Vector2d}
42
- * @default <0,0.98>
43
- */
44
- gravity: Vector2d;
45
53
  /**
46
54
  * Enabled pre-rendering for all tile layers. <br>
47
55
  * If false layers are rendered dynamically, if true layers are first fully rendered into an offscreen canvas.<br>
@@ -68,22 +76,47 @@ export default class World extends Container {
68
76
  */
69
77
  gpuTilemap: boolean;
70
78
  /**
71
- * the active physic bodies in this simulation
72
- * @type {Set<Body>}
79
+ * the physics adapter driving this world. Defaults to a
80
+ * {@link BuiltinAdapter} wrapping the engine's native SAT-based
81
+ * physics. Override at `Application` construction time via
82
+ * `settings.physic.adapter`. Cannot be swapped at runtime.
83
+ * @type {PhysicsAdapter}
73
84
  */
74
- bodies: Set<Body>;
85
+ adapter: PhysicsAdapter;
75
86
  /**
76
87
  * the instance of the game world quadtree used for broadphase (used by the builtin physic and pointer event implementation)
77
88
  * @type {QuadTree}
78
89
  */
79
90
  broadphase: QuadTree;
80
91
  /**
81
- * the collision detector instance used by this world instance
82
- * @type {Detector}
92
+ * Active physics bodies in this simulation. Backed by the active
93
+ * adapter; mutating this set directly is no longer the recommended
94
+ * pattern — use `world.adapter.addBody(...)` / `removeBody(...)`.
95
+ *
96
+ * Adapters that don't expose a native `bodies` Set (e.g. third-party
97
+ * integrations that own their own body storage) cause this getter
98
+ * to return a frozen empty Set, so any `world.bodies.add(...)`
99
+ * attempt throws `TypeError` instead of silently mutating a
100
+ * throwaway.
101
+ * @returns {Set<Body>}
102
+ */
103
+ get bodies(): Set<Body>;
104
+ set gravity(v: Vector2d);
105
+ /**
106
+ * world gravity. Mutate to change at runtime.
107
+ * @returns {Vector2d}
108
+ */
109
+ get gravity(): Vector2d;
110
+ /**
111
+ * the collision detector instance used by this world instance.
112
+ * Available only when the active adapter is {@link BuiltinAdapter}.
113
+ * @returns {Detector | undefined}
83
114
  */
84
- detector: Detector;
115
+ get detector(): Detector | undefined;
85
116
  /**
86
- * Add a physic body to the game world
117
+ * Add a physic body to the game world. Legacy API for code that
118
+ * constructed `new Body(...)` directly and now wants to register it
119
+ * with the active physics adapter.
87
120
  * @see Container.addChild
88
121
  * @param {Body} body
89
122
  * @returns {World} this game world
@@ -97,21 +130,23 @@ export default class World extends Container {
97
130
  */
98
131
  removeBody(body: Body): World;
99
132
  /**
100
- * Apply gravity to the given body
133
+ * Apply gravity to the given body. Backward-compat shim; the actual
134
+ * simulation runs through the active adapter.
101
135
  * @private
102
136
  * @param {Body} body
103
137
  */
104
138
  private bodyApplyGravity;
105
139
  /**
106
- * update the builtin physic simulation by one step (called by the game world update method)
140
+ * update the physics simulation by one step (called by the game world update method)
107
141
  * @param {number} dt - the time passed since the last frame update
108
142
  */
109
143
  step(dt: number): void;
110
144
  }
111
145
  import Container from "../renderable/container.js";
112
146
  import type Application from "./../application/application.ts";
113
- import { Vector2d } from "../math/vector2d.ts";
114
- import type Body from "./body.js";
115
- import QuadTree from "./quadtree.js";
116
- import Detector from "./detector.js";
147
+ import type { PhysicsAdapter } from "./adapter.ts";
148
+ import QuadTree from "./builtin/quadtree.js";
149
+ import type Body from "./builtin/body.js";
150
+ import type { Vector2d } from "../math/vector2d.ts";
151
+ import type Detector from "./builtin/detector.js";
117
152
  //# sourceMappingURL=world.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../../src/physics/world.js"],"names":[],"mappings":"AAeA;;;GAGG;AAEH;;;GAGG;AACH;IACC;;;;;OAKG;IACH,gBALW,MAAM,MACN,MAAM,UACN,MAAM,WACN,MAAM,EAsGhB;IA1FA;;;OAGG;IACH,KAFU,WAAW,CAED;IAEpB;;;;;;;;OAQG;IACH,QANU,MAAM,CAMO;IAEvB;;;;;OAKG;IACH,YAAa;IAEb;;;;OAIG;IACH,SAHU,QAAQ,CAGkB;IAEpC;;;;;;;OAOG;IACH,WAHU,OAAO,CAGK;IAEtB;;;;;;;;;;;;;;OAcG;IACH,YAHU,OAAO,CAGK;IAEtB;;;OAGG;IACH,QAFU,GAAG,CAAC,IAAI,CAAC,CAEI;IAEvB;;;OAGG;IACH,YAFU,QAAQ,CAOjB;IAED;;;OAGG;IACH,UAFU,QAAQ,CAEgB;IA6CnC;;;;;OAKG;IACH,cAHW,IAAI,GACF,KAAK,CAQjB;IAED;;;;;OAKG;IACH,iBAHW,IAAI,GACF,KAAK,CAQjB;IAED;;;;OAIG;IACH,yBASC;IAuBD;;;OAGG;IACH,SAFW,MAAM,QAiChB;CACD;sBAzQqB,4BAA4B;6BActB,iCAAiC;yBAfpC,qBAAqB;sBAgBzB,WAAW;qBAJX,eAAe;qBADf,eAAe"}
1
+ {"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../../src/physics/world.js"],"names":[],"mappings":"AA8BA;;;GAGG;AACH;IACC;;;;;;OAMG;IACH,gBANW,MAAM,MACN,MAAM,UACN,MAAM,WACN,MAAM,YACN,cAAc,EAoHxB;IAlGA;;;OAGG;IACH,KAFU,WAAW,CAED;IAEpB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,QANU,MAAM,CAMO;IAEvB;;;;;OAKG;IACH,YAAa;IAEb;;;;;;;OAOG;IACH,WAHU,OAAO,CAGK;IAEtB;;;;;;;;;;;;;;OAcG;IACH,YAHU,OAAO,CAGK;IAEtB;;;;;;OAMG;IACH,SAFU,cAAc,CAEsB;IAG9C;;;OAGG;IACH,YAFU,QAAQ,CAOjB;IAYF;;;;;;;;;;;OAWG;IACH,cAFa,GAAG,CAAC,IAAI,CAAC,CAOrB;IASD,eALa,QAAQ,EAOpB;IATD;;;OAGG;IACH,eAFa,QAAQ,CAIpB;IAKD;;;;OAIG;IACH,gBAFa,QAAQ,GAAG,SAAS,CAIhC;IAsCD;;;;;;;OAOG;IACH,cAHW,IAAI,GACF,KAAK,CASjB;IAED;;;;;OAKG;IACH,iBAHW,IAAI,GACF,KAAK,CASjB;IAED;;;;;OAKG;IACH,yBAIC;IAuBD;;;OAGG;IACH,SAFW,MAAM,QAWhB;CACD;sBAvTqB,4BAA4B;6BAatB,iCAAiC;oCAI1B,cAAc;qBAR5B,uBAAuB;sBAKvB,mBAAmB;8BAEX,qBAAqB;0BADzB,uBAAuB"}
@@ -12,7 +12,13 @@ export default class Collectable extends Sprite {
12
12
  name: any;
13
13
  type: any;
14
14
  id: any;
15
- body: any;
15
+ bodyDef: {
16
+ type: string;
17
+ shapes: any[];
18
+ collisionType: number;
19
+ collisionMask: number;
20
+ isSensor: boolean;
21
+ };
16
22
  }
17
23
  import Sprite from "./sprite.js";
18
24
  //# 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;;;;OAIG;IACH,eAJW,MAAM,KACN,MAAM,YACN,MAAM,EAgChB;IA1BA,UAAyB;IACzB,UAAyB;IACzB,QAAqB;IAWrB,UAAiC;CAclC;mBA3CkB,aAAa"}
1
+ {"version":3,"file":"collectable.d.ts","sourceRoot":"","sources":["../../src/renderable/collectable.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH;IACC;;;;OAIG;IACH,eAJW,MAAM,KACN,MAAM,YACN,MAAM,EA4ChB;IAtCA,UAAyB;IACzB,UAAyB;IACzB,QAAqB;IAoBrB;;;;;;MAOC;CAUF;mBAvDkB,aAAa"}
@@ -104,11 +104,6 @@ export default class Container extends Renderable {
104
104
  * this.backgroundColor.setColor(255, 0, 0);
105
105
  */
106
106
  backgroundColor: Color;
107
- /**
108
- * Used by the debug panel plugin
109
- * @ignore
110
- */
111
- drawCount: number;
112
107
  set sortOn(value: string);
113
108
  /**
114
109
  * The property of the child object that should be used to sort on this container.
@@ -260,10 +255,6 @@ export default class Container extends Renderable {
260
255
  * @returns {Container} root container
261
256
  */
262
257
  getRootAncestor(): Container;
263
- /**
264
- * @ignore
265
- */
266
- onActivateEvent(): void;
267
258
  /**
268
259
  * Invokes the removeChildNow in a defer, to ensure the child is removed safely after the update & draw stack has completed. <br>
269
260
  * if the given child implements an onDeactivateEvent() method, that method will be called once the child is removed from this container.
@@ -311,10 +302,6 @@ export default class Container extends Renderable {
311
302
  * @param {boolean} [recursive=false] - recursively sort all containers if true
312
303
  */
313
304
  sort(recursive?: boolean): void;
314
- /**
315
- * @ignore
316
- */
317
- onDeactivateEvent(): void;
318
305
  /**
319
306
  * Z Sorting function
320
307
  * @ignore
@@ -1 +1 @@
1
- {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/renderable/container.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;;GASG;AACH;IACC;;;;;;;OAOG;IACH,gBAPW,MAAM,MACN,MAAM,UACN,MAAM,WACN,MAAM,SACN,OAAO,EAgHjB;IAzGA;;;OAGG;IACH,iBAAuB;IAEvB;;;;OAIG;IACH,MAHU,OAAO,CAGD;IAEhB;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;IACH,iBAFW,UAAU,GAAC,MAAM,GAAC,MAAM,GAAC,WAAW,GAAC,OAAO,GAAC,SAAS,GAAC,UAAU,GAAC,eAAe,GAAC,UAAU,GAAC,UAAU,GAAC,OAAO,GAAC,aAAa,GAAC,eAAe,GAAC,YAAY,GAAC,IAAI,GAAC,UAAU,QAapL;IAED;;;OAGG;IACH,oBAFW,UAAU,GAAC,MAAM,GAAC,MAAM,GAAC,WAAW,GAAC,OAAO,GAAC,SAAS,GAAC,UAAU,GAAC,eAAe,GAAC,UAAU,GAAC,UAAU,GAAC,OAAO,GAAC,aAAa,GAAC,eAAe,GAAC,YAAY,GAAC,IAAI,GAAC,UAAU,QAiBpL;IAED;;;OAGG;IACH,iBAFW,OAAO,QAuBjB;IAED;;OAEG;IACH,0BAMC;IAED;;;OAGG;IACH,+BAEC;IAED;;;OAGG;IACH,sCAEC;IAED;;;OAGG;IACH,+BAEC;IAED;;;OAGG;IACH,+BAEC;CA4ID;uBAv+BsB,iBAAiB;2BAchB,oBAAoB;wBACrB,oBAAoB;wBACpB,aAAa;6BACR,kBAAkB;yBACtB,cAAc;+BACR,gBAAgB;gCACf,gBAAgB;iCACf,sBAAsB;4BAC3B,iBAAiB;4BACjB,iBAAiB;yBACpB,cAAc;+BACR,uBAAuB;iCACrB,yBAAyB;8BAC5B,sBAAsB;sBAC9B,gBAAgB;4BACV,sBAAsB;4BACxB,wBAAwB"}
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/renderable/container.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;;GASG;AACH;IACC;;;;;;;OAOG;IACH,gBAPW,MAAM,MACN,MAAM,UACN,MAAM,WACN,MAAM,SACN,OAAO,EA0GjB;IAnGA;;;OAGG;IACH,iBAAuB;IAEvB;;;;OAIG;IACH,MAHU,OAAO,CAGD;IAEhB;;;OAGG;IACH,4BAAyB;IAEzB;;;;;OAKG;IACH,SAHU,MAAM,CAG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