@n3rdw1z4rd/core 0.23.0 → 0.23.1
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/astar.d.ts +1 -3
- package/dist/astar.js +1 -2
- package/dist/canvas-renderer.d.ts +1 -3
- package/dist/canvas-renderer.js +1 -2
- package/dist/clock.d.ts +1 -3
- package/dist/clock.js +1 -2
- package/dist/color-palette.d.ts +1 -3
- package/dist/color-palette.js +1 -2
- package/dist/color.d.ts +1 -3
- package/dist/color.js +1 -2
- package/dist/disposable.d.ts +1 -3
- package/dist/disposable.js +1 -2
- package/dist/dungeon-generator.d.ts +2 -4
- package/dist/dungeon-generator.js +3 -4
- package/dist/ecs.d.ts +1 -3
- package/dist/ecs.js +1 -2
- package/dist/emitter.d.ts +1 -3
- package/dist/emitter.js +1 -2
- package/dist/event-queue.d.ts +1 -3
- package/dist/event-queue.js +1 -2
- package/dist/graph/doc.d.ts +2 -4
- package/dist/graph/doc.js +1 -2
- package/dist/graph/evaluate.d.ts +1 -3
- package/dist/graph/evaluate.js +1 -2
- package/dist/graph/index.d.ts +2 -2
- package/dist/graph/index.js +2 -2
- package/dist/graph/node.d.ts +1 -3
- package/dist/graph/node.js +1 -2
- package/dist/graph/nodes.d.ts +1 -3
- package/dist/graph/nodes.js +1 -2
- package/dist/graph/script.d.ts +1 -3
- package/dist/graph/script.js +1 -2
- package/dist/graph/sources.d.ts +1 -3
- package/dist/graph/sources.js +1 -2
- package/dist/graph/subgraph.d.ts +2 -4
- package/dist/graph/subgraph.js +1 -2
- package/dist/graph/types.d.ts +1 -3
- package/dist/graph/types.js +1 -2
- package/dist/graph.cjs +9 -17
- package/dist/graph.d.cts +1 -17
- package/dist/index.cjs +27 -52
- package/dist/index.d.cts +1 -63
- package/dist/index.d.ts +10 -10
- package/dist/index.js +14 -14
- package/dist/input/_input.d.ts +1 -3
- package/dist/input/_input.js +1 -2
- package/dist/input/action-map.d.ts +1 -3
- package/dist/input/action-map.js +1 -2
- package/dist/input/bindings.d.ts +1 -3
- package/dist/input/bindings.js +1 -2
- package/dist/input/gestures.d.ts +1 -3
- package/dist/input/gestures.js +1 -2
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +1 -1
- package/dist/input/input-action-map.d.ts +3 -5
- package/dist/input/input-action-map.js +3 -4
- package/dist/input/input.d.ts +2 -4
- package/dist/input/input.js +2 -3
- package/dist/log.d.ts +1 -3
- package/dist/log.js +1 -2
- package/dist/map2d.d.ts +1 -3
- package/dist/map2d.js +1 -2
- package/dist/{map3d-CHDJiq5T.d.cts → map3d-DRHhbrFn.d.cts} +0 -8
- package/dist/map3d.d.ts +1 -3
- package/dist/map3d.js +1 -2
- package/dist/math.d.ts +1 -3
- package/dist/math.js +1 -2
- package/dist/misc.d.ts +1 -3
- package/dist/misc.js +1 -2
- package/dist/observable.d.ts +1 -3
- package/dist/observable.js +1 -2
- package/dist/particle-renderer.d.ts +1 -3
- package/dist/particle-renderer.js +1 -2
- package/dist/particle-system-2d.d.ts +1 -3
- package/dist/particle-system-2d.js +3 -4
- package/dist/random.d.ts +1 -3
- package/dist/random.js +1 -2
- package/dist/rectangle.d.ts +1 -3
- package/dist/rectangle.js +1 -2
- package/dist/{rng-Dhqq7owV.cjs → rng-edL6atS3.cjs} +3 -6
- package/dist/rng.d.ts +1 -3
- package/dist/rng.js +2 -3
- package/dist/signal.d.ts +1 -3
- package/dist/signal.js +1 -2
- package/dist/spatial-partition-2d.d.ts +1 -3
- package/dist/spatial-partition-2d.js +1 -2
- package/dist/{spatial-partition-3d-CmSCL87Z.cjs → spatial-partition-3d-D1uyJVhM.cjs} +7 -13
- package/dist/spatial-partition-3d.d.ts +1 -3
- package/dist/spatial-partition-3d.js +1 -2
- package/dist/three/adaptive-grid.d.ts +1 -3
- package/dist/three/adaptive-grid.js +1 -2
- package/dist/three/asteroid-mesh.d.ts +1 -3
- package/dist/three/asteroid-mesh.js +1 -2
- package/dist/three/camera-rig.d.ts +1 -3
- package/dist/three/camera-rig.js +1 -2
- package/dist/three/cube-sphere-geometry.d.ts +1 -3
- package/dist/three/cube-sphere-geometry.js +1 -2
- package/dist/three/ecs.d.ts +1 -3
- package/dist/three/ecs.js +1 -2
- package/dist/three/editor-camera.d.ts +1 -3
- package/dist/three/editor-camera.js +1 -2
- package/dist/three/index.d.ts +4 -4
- package/dist/three/index.js +1 -1
- package/dist/three/particle-system-3d.d.ts +1 -3
- package/dist/three/particle-system-3d.js +3 -4
- package/dist/three/picking.d.ts +2 -4
- package/dist/three/picking.js +1 -2
- package/dist/three/renderer.d.ts +1 -3
- package/dist/three/renderer.js +1 -2
- package/dist/three/schema.d.ts +0 -2
- package/dist/three/schema.js +1 -2
- package/dist/three/starfield.d.ts +1 -3
- package/dist/three/starfield.js +1 -2
- package/dist/three/texture-atlas.d.ts +1 -3
- package/dist/three/texture-atlas.js +1 -2
- package/dist/three/texture-utils.d.ts +1 -3
- package/dist/three/texture-utils.js +1 -2
- package/dist/three/voxel-geometry.d.ts +2 -4
- package/dist/three/voxel-geometry.js +2 -3
- package/dist/three/voxel-mesh.d.ts +1 -3
- package/dist/three/voxel-mesh.js +1 -2
- package/dist/three/world.d.ts +0 -2
- package/dist/three/world.js +1 -2
- package/dist/three.cjs +18 -34
- package/dist/three.d.cts +1 -33
- package/dist/tilemap.d.ts +1 -3
- package/dist/tilemap.js +1 -2
- package/dist/types.d.ts +1 -3
- package/dist/vector.d.ts +1 -3
- package/dist/vector.js +1 -2
- package/dist/vite.cjs +1 -2
- package/dist/vite.d.cts +1 -3
- package/dist/vite.d.ts +1 -3
- package/dist/vite.js +1 -2
- package/dist/webgl-renderer.d.ts +1 -3
- package/dist/webgl-renderer.js +1 -2
- package/dist/webgl.d.ts +1 -3
- package/dist/webgl.js +1 -2
- package/dist/worker-interface.d.ts +1 -3
- package/dist/worker-interface.js +1 -2
- package/package.json +6 -6
package/dist/graph.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/graph/types.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Pin types. A type is a name (`number`, `vec2`, your own…) with a color for the editor;
|
|
4
3
|
* a trailing `[]` in a port declaration (`vec2[]`) makes the port a **list port** — it takes
|
|
@@ -53,8 +52,6 @@ export declare class TypeRegistry {
|
|
|
53
52
|
* @category Graph
|
|
54
53
|
*/
|
|
55
54
|
export declare const portTypes: TypeRegistry;
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/graph/node.d.ts
|
|
58
55
|
/**
|
|
59
56
|
* Node definitions: a node is a function with a typed interface.
|
|
60
57
|
*
|
|
@@ -205,8 +202,6 @@ export declare class NodeRegistry {
|
|
|
205
202
|
/** Called when a type is registered (or replaced) or removed; returns an unsubscribe. */
|
|
206
203
|
onChange(listener: (def: NodeDef, removed: boolean) => void): () => void;
|
|
207
204
|
}
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region src/graph/doc.d.ts
|
|
210
205
|
/**
|
|
211
206
|
* The graph document: plain JSON, saved and shared as-is.
|
|
212
207
|
*
|
|
@@ -344,8 +339,6 @@ export declare function canConnect(doc: GraphDoc, registry: NodeRegistry, from:
|
|
|
344
339
|
export declare function connect(doc: GraphDoc, registry: NodeRegistry, from: PortRef, to: PortRef, types?: TypeRegistry): GraphLink;
|
|
345
340
|
/** @category Graph */
|
|
346
341
|
export declare function disconnect(doc: GraphDoc, linkId: string): void;
|
|
347
|
-
//#endregion
|
|
348
|
-
//#region src/graph/evaluate.d.ts
|
|
349
342
|
/**
|
|
350
343
|
* Evaluates a graph: runs the nodes the outputs depend on, in dependency order, passing
|
|
351
344
|
* values along the links.
|
|
@@ -455,8 +448,6 @@ export interface EvaluateResult {
|
|
|
455
448
|
ran: string[];
|
|
456
449
|
results: Map<string, NodeResult>;
|
|
457
450
|
}
|
|
458
|
-
//#endregion
|
|
459
|
-
//#region src/graph/nodes.d.ts
|
|
460
451
|
/** @category Graph */
|
|
461
452
|
export declare const BUILTIN_NODES: NodeSpec[];
|
|
462
453
|
/**
|
|
@@ -465,8 +456,6 @@ export declare const BUILTIN_NODES: NodeSpec[];
|
|
|
465
456
|
* @category Graph
|
|
466
457
|
*/
|
|
467
458
|
export declare function createNodeRegistry(): NodeRegistry;
|
|
468
|
-
//#endregion
|
|
469
|
-
//#region src/graph/script.d.ts
|
|
470
459
|
/**
|
|
471
460
|
* Script nodes: a node type written as a plain ES module, compiled at runtime.
|
|
472
461
|
*
|
|
@@ -527,8 +516,6 @@ export interface ScriptOptions {
|
|
|
527
516
|
export declare function compileNodeScript(type: string, source: string, options?: ScriptOptions): Promise<NodeDef>;
|
|
528
517
|
/** A starting point for a new script node. @category Graph */
|
|
529
518
|
export declare const SCRIPT_NODE_TEMPLATE = "// A node is a function with a typed interface.\n// inputs: pins wired from other nodes (an unconnected one uses its widget value / default)\n// params: widgets on the node\n// outputs: what run() returns\n// A \"type[]\" pin takes (or gives) a whole list; a list wired into a plain pin runs\n// run() once per item and collects the results into lists.\n\nexport const inputs = {\n a: { type: 'number', default: 1 },\n b: { type: 'number', default: 2 },\n};\n\nexport const params = {\n scale: { type: 'number', default: 1, min: 0, max: 10, step: 0.1 },\n};\n\nexport const outputs = {\n result: 'number',\n};\n\nexport function run({ a, b }, { scale }, ctx) {\n return { result: (a + b) * scale };\n}\n";
|
|
530
|
-
//#endregion
|
|
531
|
-
//#region src/graph/sources.d.ts
|
|
532
519
|
/**
|
|
533
520
|
* The built-in nodes as script modules: the same interface and behaviour as the TypeScript
|
|
534
521
|
* definitions in `nodes.ts`, written self-contained so the editor can show a built-in's code
|
|
@@ -538,8 +525,6 @@ export declare const SCRIPT_NODE_TEMPLATE = "// A node is a function with a type
|
|
|
538
525
|
*/
|
|
539
526
|
/** @category Graph */
|
|
540
527
|
export declare const BUILTIN_SOURCES: Record<string, string>;
|
|
541
|
-
//#endregion
|
|
542
|
-
//#region src/graph/subgraph.d.ts
|
|
543
528
|
/**
|
|
544
529
|
* Subgraphs: a selection of nodes collapsed into one node type. The inner graph is stored in
|
|
545
530
|
* `doc.subgraphs[type]` with its interface — every wire that crossed the selection's edge
|
|
@@ -571,5 +556,4 @@ export declare function collapseToSubgraph(doc: GraphDoc, registry: NodeRegistry
|
|
|
571
556
|
* `defs`: where the definitions are (default: `doc.subgraphs`; pass the top-level document's
|
|
572
557
|
* when `doc` is itself a subgraph's inner graph).
|
|
573
558
|
*/
|
|
574
|
-
export declare function expandSubgraph(doc: GraphDoc, nodeId: string, defs?: Record<string, SubgraphDef> | undefined): string[];
|
|
575
|
-
//#endregion
|
|
559
|
+
export declare function expandSubgraph(doc: GraphDoc, nodeId: string, defs?: Record<string, SubgraphDef> | undefined): string[];
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rng = require("./rng-
|
|
3
|
-
const require_spatial_partition_3d = require("./spatial-partition-3d-
|
|
2
|
+
const require_rng = require("./rng-edL6atS3.cjs");
|
|
3
|
+
const require_spatial_partition_3d = require("./spatial-partition-3d-D1uyJVhM.cjs");
|
|
4
4
|
let heap_js = require("heap-js");
|
|
5
|
-
|
|
5
|
+
// src/astar.ts
|
|
6
6
|
const DEFAULT_MAX_NODES = 1e4;
|
|
7
7
|
const DIRECTIONS = [
|
|
8
8
|
[0, -1],
|
|
@@ -116,8 +116,7 @@ function buildPath(end) {
|
|
|
116
116
|
});
|
|
117
117
|
return path.reverse();
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
//#region src/canvas-renderer.ts
|
|
119
|
+
// src/canvas-renderer.ts
|
|
121
120
|
/**
|
|
122
121
|
* Fill / stroke color used when {@link DrawParams.color} is not given.
|
|
123
122
|
*
|
|
@@ -321,8 +320,7 @@ var CanvasRenderer = class {
|
|
|
321
320
|
else this.context.drawImage(image, x, y, width, height);
|
|
322
321
|
}
|
|
323
322
|
};
|
|
324
|
-
|
|
325
|
-
//#region src/clock.ts
|
|
323
|
+
// src/clock.ts
|
|
326
324
|
/**
|
|
327
325
|
* Milliseconds in one second.
|
|
328
326
|
*
|
|
@@ -428,8 +426,7 @@ var Clock = class {
|
|
|
428
426
|
this._fpsFrames = 0;
|
|
429
427
|
}
|
|
430
428
|
};
|
|
431
|
-
|
|
432
|
-
//#region src/color-palette.ts
|
|
429
|
+
// src/color-palette.ts
|
|
433
430
|
const DEFAULT_COLORS = [
|
|
434
431
|
[
|
|
435
432
|
237,
|
|
@@ -539,8 +536,7 @@ function buildColorPalette(grayscaleSteps = 8, colorSteps = 4, ...colors) {
|
|
|
539
536
|
for (const rgb of colorList) palette.push(...colorRamp(rgb, colorSteps));
|
|
540
537
|
return palette;
|
|
541
538
|
}
|
|
542
|
-
|
|
543
|
-
//#region src/disposable.ts
|
|
539
|
+
// src/disposable.ts
|
|
544
540
|
/**
|
|
545
541
|
* Collects cleanup functions (e.g. the unsubscribe functions returned by {@link Observable.subscribe}
|
|
546
542
|
* and {@link Signal.subscribe}) and runs them all at once.
|
|
@@ -570,8 +566,7 @@ var Disposable = class {
|
|
|
570
566
|
while (this.disposers.length) this.disposers.pop()?.();
|
|
571
567
|
}
|
|
572
568
|
};
|
|
573
|
-
|
|
574
|
-
//#region src/map2d.ts
|
|
569
|
+
// src/map2d.ts
|
|
575
570
|
/**
|
|
576
571
|
* Default "empty" value of a {@link Map2D}: cells holding it are not stored.
|
|
577
572
|
*
|
|
@@ -689,8 +684,7 @@ var Map2D = class {
|
|
|
689
684
|
});
|
|
690
685
|
}
|
|
691
686
|
};
|
|
692
|
-
|
|
693
|
-
//#region src/vector.ts
|
|
687
|
+
// src/vector.ts
|
|
694
688
|
/**
|
|
695
689
|
* Mutable 2D vector. Most methods modify the vector in place and return `this` for chaining;
|
|
696
690
|
* {@link Vector.clone} and {@link Vector.floored} return new vectors.
|
|
@@ -856,8 +850,7 @@ var Vector = class Vector {
|
|
|
856
850
|
return new Vector(-1, 0);
|
|
857
851
|
}
|
|
858
852
|
};
|
|
859
|
-
|
|
860
|
-
//#region src/rectangle.ts
|
|
853
|
+
// src/rectangle.ts
|
|
861
854
|
/**
|
|
862
855
|
* Axis-aligned rectangle given by its top-left corner (`x`, `y`) and size. Edges are inclusive
|
|
863
856
|
* in the containment and intersection tests.
|
|
@@ -923,8 +916,7 @@ var Rectangle = class Rectangle {
|
|
|
923
916
|
return this.contains(vec, padding);
|
|
924
917
|
}
|
|
925
918
|
};
|
|
926
|
-
|
|
927
|
-
//#region src/dungeon-generator.ts
|
|
919
|
+
// src/dungeon-generator.ts
|
|
928
920
|
/**
|
|
929
921
|
* Tile value for empty (unused) space.
|
|
930
922
|
*
|
|
@@ -1201,8 +1193,7 @@ function GenerateWalls(map) {
|
|
|
1201
1193
|
});
|
|
1202
1194
|
return [...walls.values()];
|
|
1203
1195
|
}
|
|
1204
|
-
|
|
1205
|
-
//#region src/ecs.ts
|
|
1196
|
+
// src/ecs.ts
|
|
1206
1197
|
/**
|
|
1207
1198
|
* A minimal entity-component store. Entities are integers; components are class instances stored
|
|
1208
1199
|
* per class, and {@link ECS.query} iterates the entities that have every requested component.
|
|
@@ -1301,8 +1292,7 @@ var ECS = class {
|
|
|
1301
1292
|
* @category ECS
|
|
1302
1293
|
*/
|
|
1303
1294
|
const ecs = new ECS();
|
|
1304
|
-
|
|
1305
|
-
//#region src/emitter.ts
|
|
1295
|
+
// src/emitter.ts
|
|
1306
1296
|
/**
|
|
1307
1297
|
* A string-keyed event emitter. Listeners get the emitted arguments followed by the event name,
|
|
1308
1298
|
* so one listener can tell apart the events it was added to.
|
|
@@ -1354,8 +1344,7 @@ var Emitter = class {
|
|
|
1354
1344
|
return this;
|
|
1355
1345
|
}
|
|
1356
1346
|
};
|
|
1357
|
-
|
|
1358
|
-
//#region src/event-queue.ts
|
|
1347
|
+
// src/event-queue.ts
|
|
1359
1348
|
/**
|
|
1360
1349
|
* A buffered queue of events: producers `emit()` events, and a consumer reads them later (e.g.
|
|
1361
1350
|
* once per frame) with `drain()`, or with `consume()` followed by `clear()`.
|
|
@@ -1393,8 +1382,7 @@ var EventQueue = class {
|
|
|
1393
1382
|
return this.events.length;
|
|
1394
1383
|
}
|
|
1395
1384
|
};
|
|
1396
|
-
|
|
1397
|
-
//#region src/input/bindings.ts
|
|
1385
|
+
// src/input/bindings.ts
|
|
1398
1386
|
/**
|
|
1399
1387
|
* W3C "standard" gamepad mapping, in button-index order (Xbox names; on PlayStation A = Cross,
|
|
1400
1388
|
* B = Circle, X = Square, Y = Triangle).
|
|
@@ -1642,8 +1630,7 @@ function bindingLabel(binding, keyLabels) {
|
|
|
1642
1630
|
case "xrAxis": return `${capitalize(binding.hand)} ${AXIS_NAMES[binding.axis][binding.direction > 0 ? 1 : 0]}`;
|
|
1643
1631
|
}
|
|
1644
1632
|
}
|
|
1645
|
-
|
|
1646
|
-
//#region src/input/action-map.ts
|
|
1633
|
+
// src/input/action-map.ts
|
|
1647
1634
|
/**
|
|
1648
1635
|
* Deadzone given to new actions when none is specified.
|
|
1649
1636
|
*
|
|
@@ -1797,8 +1784,7 @@ var ActionMap = class {
|
|
|
1797
1784
|
return this;
|
|
1798
1785
|
}
|
|
1799
1786
|
};
|
|
1800
|
-
|
|
1801
|
-
//#region src/input/gestures.ts
|
|
1787
|
+
// src/input/gestures.ts
|
|
1802
1788
|
const DEFAULT_THRESHOLDS = {
|
|
1803
1789
|
tapMaxDuration: 250,
|
|
1804
1790
|
tapMaxMovement: 10,
|
|
@@ -1981,8 +1967,7 @@ var GestureRecognizer = class {
|
|
|
1981
1967
|
return frame;
|
|
1982
1968
|
}
|
|
1983
1969
|
};
|
|
1984
|
-
|
|
1985
|
-
//#region src/input/input.ts
|
|
1970
|
+
// src/input/input.ts
|
|
1986
1971
|
const BUTTON_BITS = [
|
|
1987
1972
|
1,
|
|
1988
1973
|
4,
|
|
@@ -2221,8 +2206,7 @@ var Input = class Input extends Emitter {
|
|
|
2221
2206
|
return this._state[`button${buttonNumber}`]?.state ?? 0;
|
|
2222
2207
|
}
|
|
2223
2208
|
};
|
|
2224
|
-
|
|
2225
|
-
//#region src/observable.ts
|
|
2209
|
+
// src/observable.ts
|
|
2226
2210
|
/**
|
|
2227
2211
|
* A set of observers notified with a value (plus optional extra arguments). Observers are
|
|
2228
2212
|
* called in subscription order; subscribing the same function twice has no effect.
|
|
@@ -2273,8 +2257,7 @@ var Observable = class {
|
|
|
2273
2257
|
return this.observers.size;
|
|
2274
2258
|
}
|
|
2275
2259
|
};
|
|
2276
|
-
|
|
2277
|
-
//#region src/input/input-action-map.ts
|
|
2260
|
+
// src/input/input-action-map.ts
|
|
2278
2261
|
const ANY = -1;
|
|
2279
2262
|
const now = () => performance.now();
|
|
2280
2263
|
const MOUSE_BUTTONS = [
|
|
@@ -2956,8 +2939,7 @@ var InputActionMap = class {
|
|
|
2956
2939
|
});
|
|
2957
2940
|
}
|
|
2958
2941
|
};
|
|
2959
|
-
|
|
2960
|
-
//#region src/misc.ts
|
|
2942
|
+
// src/misc.ts
|
|
2961
2943
|
/**
|
|
2962
2944
|
* True if `target` is `null` or `undefined`.
|
|
2963
2945
|
* @category Utilities
|
|
@@ -3025,8 +3007,7 @@ const xyz2k = (x, y, z, delimiter = ",") => `${x}${delimiter}${y}${delimiter}${z
|
|
|
3025
3007
|
* @category Utilities
|
|
3026
3008
|
*/
|
|
3027
3009
|
const k2xyz = (key, delimiter = ",") => key.split(delimiter).map(parseFloat);
|
|
3028
|
-
|
|
3029
|
-
//#region src/particle-renderer.ts
|
|
3010
|
+
// src/particle-renderer.ts
|
|
3030
3011
|
/**
|
|
3031
3012
|
* Double-buffered square-pixel renderer for particle effects: draw with `setPixel()` into an
|
|
3032
3013
|
* offscreen buffer, then `render()` copies the buffer to the visible canvas and clears it.
|
|
@@ -3106,8 +3087,7 @@ var ParticleRenderer = class {
|
|
|
3106
3087
|
this.bufferContext.clearRect(0, 0, this._screenCanvas.width, this._screenCanvas.height);
|
|
3107
3088
|
}
|
|
3108
3089
|
};
|
|
3109
|
-
|
|
3110
|
-
//#region src/signal.ts
|
|
3090
|
+
// src/signal.ts
|
|
3111
3091
|
/**
|
|
3112
3092
|
* A value holder that notifies subscribers when the value changes (compared with `Object.is`).
|
|
3113
3093
|
* Subscribers are called immediately with the current value when they subscribe.
|
|
@@ -3146,8 +3126,7 @@ var Signal = class {
|
|
|
3146
3126
|
return () => this.subscribers.delete(subscriber);
|
|
3147
3127
|
}
|
|
3148
3128
|
};
|
|
3149
|
-
|
|
3150
|
-
//#region src/tilemap.ts
|
|
3129
|
+
// src/tilemap.ts
|
|
3151
3130
|
/**
|
|
3152
3131
|
* Sparse 2D grid of arbitrary values, keyed by floored integer coordinates. Simpler than
|
|
3153
3132
|
* {@link Map2D} (string keys, any value type, no default value or range limit).
|
|
@@ -3171,8 +3150,7 @@ var Tilemap = class {
|
|
|
3171
3150
|
this.map.set(this._key(x, y), v);
|
|
3172
3151
|
}
|
|
3173
3152
|
};
|
|
3174
|
-
|
|
3175
|
-
//#region src/webgl.ts
|
|
3153
|
+
// src/webgl.ts
|
|
3176
3154
|
/**
|
|
3177
3155
|
* Literal GLenum values, so importing this module doesn't require `WebGL2RenderingContext` to exist.
|
|
3178
3156
|
*
|
|
@@ -3798,8 +3776,7 @@ function Draw(gl, info, vertexArray, options = {}) {
|
|
|
3798
3776
|
else gl.drawArrays(mode, offset, count);
|
|
3799
3777
|
gl.bindVertexArray(null);
|
|
3800
3778
|
}
|
|
3801
|
-
|
|
3802
|
-
//#region src/webgl-renderer.ts
|
|
3779
|
+
// src/webgl-renderer.ts
|
|
3803
3780
|
/**
|
|
3804
3781
|
* A thin owner of a WebGL2 context: sizing (CSS pixels x pixel ratio), clearing, render targets,
|
|
3805
3782
|
* drawing, and context-loss notifications. Everything else is the webgl.ts wrappers on `gl`.
|
|
@@ -3935,8 +3912,7 @@ var WebGlRenderer = class {
|
|
|
3935
3912
|
this._listeners.push([type, listener]);
|
|
3936
3913
|
}
|
|
3937
3914
|
};
|
|
3938
|
-
|
|
3939
|
-
//#region src/worker-interface.ts
|
|
3915
|
+
// src/worker-interface.ts
|
|
3940
3916
|
/**
|
|
3941
3917
|
* Thin wrapper around a module `Worker` that exposes its errors and messages as
|
|
3942
3918
|
* {@link Observable}s.
|
|
@@ -3972,7 +3948,6 @@ var WorkerInterface = class {
|
|
|
3972
3948
|
this._worker.terminate();
|
|
3973
3949
|
}
|
|
3974
3950
|
};
|
|
3975
|
-
//#endregion
|
|
3976
3951
|
exports.ActionMap = ActionMap;
|
|
3977
3952
|
exports.BindRenderTarget = BindRenderTarget;
|
|
3978
3953
|
exports.CanvasRenderer = CanvasRenderer;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { _ as XYZ, a as Map3DCell, c as MAP_2D_MIN_COORD, d as ColorPalette, f as RGB, g as XY, h as NoiseFunction3D, i as Map3D, l as Map2D, m as KeyValue, n as MAP_3D_MAX_COORD, o as DEFAULT_MAP_2D_VALUE, p as buildColorPalette, r as MAP_3D_MIN_COORD, s as MAP_2D_MAX_COORD, t as DEFAULT_MAP_3D_VALUE, u as Map2DData } from "./map3d-
|
|
2
|
-
//#region src/astar.d.ts
|
|
1
|
+
import { _ as XYZ, a as Map3DCell, c as MAP_2D_MIN_COORD, d as ColorPalette, f as RGB, g as XY, h as NoiseFunction3D, i as Map3D, l as Map2D, m as KeyValue, n as MAP_3D_MAX_COORD, o as DEFAULT_MAP_2D_VALUE, p as buildColorPalette, r as MAP_3D_MIN_COORD, s as MAP_2D_MAX_COORD, t as DEFAULT_MAP_3D_VALUE, u as Map2DData } from "./map3d-DRHhbrFn.cjs";
|
|
3
2
|
/**
|
|
4
3
|
* Cost of stepping onto tile (x, y). Return `Infinity` for blocked tiles. Costs should be >= 1
|
|
5
4
|
* (the heuristic assumes it); use larger values for slower terrain or occupied tiles.
|
|
@@ -41,8 +40,6 @@ export interface PathOptions {
|
|
|
41
40
|
* @category Pathfinding & Procedural
|
|
42
41
|
*/
|
|
43
42
|
export declare function findPath(start: XY, goal: XY, cost: StepCost, options?: PathOptions): XY[];
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region src/canvas-renderer.d.ts
|
|
46
43
|
/**
|
|
47
44
|
* Anything a 2D context accepts as a fill or stroke style: a CSS color string, a gradient or a pattern.
|
|
48
45
|
*
|
|
@@ -197,8 +194,6 @@ export declare class CanvasRenderer {
|
|
|
197
194
|
*/
|
|
198
195
|
drawSprite(x: number, y: number, image: CanvasImageSource, width: number, height: number, params?: SpriteParams): void;
|
|
199
196
|
}
|
|
200
|
-
//#endregion
|
|
201
|
-
//#region src/clock.d.ts
|
|
202
197
|
/**
|
|
203
198
|
* Milliseconds in one second.
|
|
204
199
|
*
|
|
@@ -266,8 +261,6 @@ export declare class Clock {
|
|
|
266
261
|
stop(): void;
|
|
267
262
|
private _reset;
|
|
268
263
|
}
|
|
269
|
-
//#endregion
|
|
270
|
-
//#region src/color.d.ts
|
|
271
264
|
/**
|
|
272
265
|
* RGBA color with 8-bit channels (integers 0-255), kept in sync with an 8-digit hex string.
|
|
273
266
|
* Setting a channel rounds and clamps it to 0-255.
|
|
@@ -356,8 +349,6 @@ export declare class Color {
|
|
|
356
349
|
/** new fully transparent black (0, 0, 0, 0) */
|
|
357
350
|
static get TRANSPARENT(): Color;
|
|
358
351
|
}
|
|
359
|
-
//#endregion
|
|
360
|
-
//#region src/disposable.d.ts
|
|
361
352
|
/**
|
|
362
353
|
* Collects cleanup functions (e.g. the unsubscribe functions returned by {@link Observable.subscribe}
|
|
363
354
|
* and {@link Signal.subscribe}) and runs them all at once.
|
|
@@ -383,8 +374,6 @@ export declare class Disposable {
|
|
|
383
374
|
*/
|
|
384
375
|
dispose(): void;
|
|
385
376
|
}
|
|
386
|
-
//#endregion
|
|
387
|
-
//#region src/vector.d.ts
|
|
388
377
|
/**
|
|
389
378
|
* Mutable 2D vector. Most methods modify the vector in place and return `this` for chaining;
|
|
390
379
|
* {@link Vector.clone} and {@link Vector.floored} return new vectors.
|
|
@@ -460,8 +449,6 @@ export declare class Vector {
|
|
|
460
449
|
/** new (-1, 0) */
|
|
461
450
|
static get WEST(): Vector;
|
|
462
451
|
}
|
|
463
|
-
//#endregion
|
|
464
|
-
//#region src/rectangle.d.ts
|
|
465
452
|
/**
|
|
466
453
|
* Axis-aligned rectangle given by its top-left corner (`x`, `y`) and size. Edges are inclusive
|
|
467
454
|
* in the containment and intersection tests.
|
|
@@ -503,8 +490,6 @@ export declare class Rectangle {
|
|
|
503
490
|
/** Same as {@link Rectangle.contains} with a point. */
|
|
504
491
|
vectorInside(vec: Vector, padding?: number): boolean;
|
|
505
492
|
}
|
|
506
|
-
//#endregion
|
|
507
|
-
//#region src/dungeon-generator.d.ts
|
|
508
493
|
/**
|
|
509
494
|
* Two rooms to be joined by a corridor.
|
|
510
495
|
*
|
|
@@ -642,8 +627,6 @@ export declare function GenerateDoors(map: Map2D, paths: XY[][], params?: DoorsP
|
|
|
642
627
|
* @category Pathfinding & Procedural
|
|
643
628
|
*/
|
|
644
629
|
export declare function GenerateWalls(map: Map2D): XY[];
|
|
645
|
-
//#endregion
|
|
646
|
-
//#region src/ecs.d.ts
|
|
647
630
|
/**
|
|
648
631
|
* An entity id: a plain integer handed out by {@link ECS.createEntity}.
|
|
649
632
|
*
|
|
@@ -729,8 +712,6 @@ export declare class ECS {
|
|
|
729
712
|
* @category ECS
|
|
730
713
|
*/
|
|
731
714
|
export declare const ecs: ECS;
|
|
732
|
-
//#endregion
|
|
733
|
-
//#region src/emitter.d.ts
|
|
734
715
|
/**
|
|
735
716
|
* An {@link Emitter} listener: called with the emitted arguments, followed by the event name.
|
|
736
717
|
*
|
|
@@ -769,8 +750,6 @@ export declare class Emitter {
|
|
|
769
750
|
*/
|
|
770
751
|
off(eventName: string, listener?: Listener): this;
|
|
771
752
|
}
|
|
772
|
-
//#endregion
|
|
773
|
-
//#region src/event-queue.d.ts
|
|
774
753
|
/**
|
|
775
754
|
* A buffered queue of events: producers `emit()` events, and a consumer reads them later (e.g.
|
|
776
755
|
* once per frame) with `drain()`, or with `consume()` followed by `clear()`.
|
|
@@ -798,8 +777,6 @@ export declare class EventQueue<T> {
|
|
|
798
777
|
/** number of queued events */
|
|
799
778
|
get size(): number;
|
|
800
779
|
}
|
|
801
|
-
//#endregion
|
|
802
|
-
//#region src/input/bindings.d.ts
|
|
803
780
|
/**
|
|
804
781
|
* Modifier keys that must also be held for a key {@link Binding} to count (left or right side).
|
|
805
782
|
* Modifiers left out are not checked, so a binding without `ctrl` still fires while Ctrl is held.
|
|
@@ -1071,8 +1048,6 @@ export declare function bindingsEqual(a: Binding, b: Binding): boolean;
|
|
|
1071
1048
|
* @category Input
|
|
1072
1049
|
*/
|
|
1073
1050
|
export declare function bindingLabel(binding: Binding, keyLabels?: ReadonlyMap<string, string>): string;
|
|
1074
|
-
//#endregion
|
|
1075
|
-
//#region src/input/action-map.d.ts
|
|
1076
1051
|
/**
|
|
1077
1052
|
* Deadzone given to new actions when none is specified.
|
|
1078
1053
|
*
|
|
@@ -1184,8 +1159,6 @@ export declare class ActionMap {
|
|
|
1184
1159
|
*/
|
|
1185
1160
|
addDefaults(): this;
|
|
1186
1161
|
}
|
|
1187
|
-
//#endregion
|
|
1188
|
-
//#region src/input/gestures.d.ts
|
|
1189
1162
|
/**
|
|
1190
1163
|
* A finger currently on the screen, as reported by {@link GestureRecognizer.touches}.
|
|
1191
1164
|
*
|
|
@@ -1309,8 +1282,6 @@ export declare class GestureRecognizer {
|
|
|
1309
1282
|
/** Returns what happened since the last update. `time` is the current time in ms. */
|
|
1310
1283
|
update(time: number): GestureFrame;
|
|
1311
1284
|
}
|
|
1312
|
-
//#endregion
|
|
1313
|
-
//#region src/input/input.d.ts
|
|
1314
1285
|
/**
|
|
1315
1286
|
* Whether a key or button is down (`state` 1) or up (0), and when that last changed.
|
|
1316
1287
|
*
|
|
@@ -1409,8 +1380,6 @@ export declare class Input extends Emitter {
|
|
|
1409
1380
|
/** 1 if the button is down, else 0. */
|
|
1410
1381
|
getButtonState(buttonNumber: number): number;
|
|
1411
1382
|
}
|
|
1412
|
-
//#endregion
|
|
1413
|
-
//#region src/observable.d.ts
|
|
1414
1383
|
/**
|
|
1415
1384
|
* An {@link Observable} observer: called with the notified value (and any extra arguments).
|
|
1416
1385
|
*
|
|
@@ -1452,8 +1421,6 @@ export declare class Observable<T> {
|
|
|
1452
1421
|
/** number of observers */
|
|
1453
1422
|
get size(): number;
|
|
1454
1423
|
}
|
|
1455
|
-
//#endregion
|
|
1456
|
-
//#region src/input/input-action-map.d.ts
|
|
1457
1424
|
/**
|
|
1458
1425
|
* 0 = keyboard, mouse, pen, touch and VR; 1, 2, ... = gamepads.
|
|
1459
1426
|
*
|
|
@@ -1774,16 +1741,12 @@ export declare class InputActionMap {
|
|
|
1774
1741
|
private _onTouchUp;
|
|
1775
1742
|
private _onWheel;
|
|
1776
1743
|
}
|
|
1777
|
-
//#endregion
|
|
1778
|
-
//#region src/log.d.ts
|
|
1779
1744
|
/**
|
|
1780
1745
|
* `console.debug` with a bold gray `[dev]` prefix; takes the same arguments. Visible only when the
|
|
1781
1746
|
* console shows verbose/debug messages.
|
|
1782
1747
|
* @category Utilities
|
|
1783
1748
|
*/
|
|
1784
1749
|
export declare const log: (...args: any[]) => void;
|
|
1785
|
-
//#endregion
|
|
1786
|
-
//#region src/math.d.ts
|
|
1787
1750
|
/**
|
|
1788
1751
|
* π, half a turn in radians.
|
|
1789
1752
|
* @category Math & Random
|
|
@@ -1958,8 +1921,6 @@ export declare const hash32: (n: number) => number;
|
|
|
1958
1921
|
* @category Math & Random
|
|
1959
1922
|
*/
|
|
1960
1923
|
export declare const hash32mix: (...values: number[]) => number;
|
|
1961
|
-
//#endregion
|
|
1962
|
-
//#region src/misc.d.ts
|
|
1963
1924
|
/**
|
|
1964
1925
|
* True if `target` is `null` or `undefined`.
|
|
1965
1926
|
* @category Utilities
|
|
@@ -2003,8 +1964,6 @@ export declare const xyz2k: (x: number, y: number, z: number, delimiter?: string
|
|
|
2003
1964
|
* @category Utilities
|
|
2004
1965
|
*/
|
|
2005
1966
|
export declare const k2xyz: (key: string, delimiter?: string) => [number, number, number];
|
|
2006
|
-
//#endregion
|
|
2007
|
-
//#region src/particle-renderer.d.ts
|
|
2008
1967
|
/**
|
|
2009
1968
|
* Double-buffered square-pixel renderer for particle effects: draw with `setPixel()` into an
|
|
2010
1969
|
* offscreen buffer, then `render()` copies the buffer to the visible canvas and clears it.
|
|
@@ -2049,8 +2008,6 @@ export declare class ParticleRenderer {
|
|
|
2049
2008
|
/** Replaces the visible canvas with the buffer's contents, then clears the buffer for the next frame. */
|
|
2050
2009
|
render(): void;
|
|
2051
2010
|
}
|
|
2052
|
-
//#endregion
|
|
2053
|
-
//#region src/particle-system-2d.d.ts
|
|
2054
2011
|
/**
|
|
2055
2012
|
* A `size` x `size` attraction matrix with values in [-1, 1). Deterministic: the same `size` and
|
|
2056
2013
|
* `seed` always give the same matrix.
|
|
@@ -2108,8 +2065,6 @@ export declare class ParticleSystem2d {
|
|
|
2108
2065
|
*/
|
|
2109
2066
|
update(renderer: ParticleRenderer, dt: number): void;
|
|
2110
2067
|
}
|
|
2111
|
-
//#endregion
|
|
2112
|
-
//#region src/random.d.ts
|
|
2113
2068
|
/**
|
|
2114
2069
|
* Hash-based random numbers. The static methods are pure functions of their arguments (the same
|
|
2115
2070
|
* inputs always give the same result), which makes them handy for coordinate-based noise; an
|
|
@@ -2154,8 +2109,6 @@ export declare class Random {
|
|
|
2154
2109
|
/** Next angle in radians in [0, 2π); advances the seed. */
|
|
2155
2110
|
angle(): number;
|
|
2156
2111
|
}
|
|
2157
|
-
//#endregion
|
|
2158
|
-
//#region src/rng.d.ts
|
|
2159
2112
|
/**
|
|
2160
2113
|
* Seeded random number generator with helpers for ranges, picking, shuffling, geometric points,
|
|
2161
2114
|
* Gaussian samples and matrices. Every call advances the underlying {@link Random}, so a given
|
|
@@ -2225,8 +2178,6 @@ export declare class Rng {
|
|
|
2225
2178
|
* @category Math & Random
|
|
2226
2179
|
*/
|
|
2227
2180
|
export declare const rng: Rng;
|
|
2228
|
-
//#endregion
|
|
2229
|
-
//#region src/signal.d.ts
|
|
2230
2181
|
/**
|
|
2231
2182
|
* A {@link Signal} subscriber: called with the new value.
|
|
2232
2183
|
*
|
|
@@ -2259,8 +2210,6 @@ export declare class Signal<T> {
|
|
|
2259
2210
|
/** Adds a subscriber and calls it right away with the current value; returns a function that removes it. */
|
|
2260
2211
|
subscribe(subscriber: Subscriber<T>): () => void;
|
|
2261
2212
|
}
|
|
2262
|
-
//#endregion
|
|
2263
|
-
//#region src/spatial-partition-2d.d.ts
|
|
2264
2213
|
/**
|
|
2265
2214
|
* Anything with a position that a {@link SpatialPartition2d} can bucket.
|
|
2266
2215
|
*
|
|
@@ -2301,8 +2250,6 @@ export declare class SpatialPartition2d {
|
|
|
2301
2250
|
*/
|
|
2302
2251
|
getCellNeighbors(x: number, y: number): SpatialPartitionEntity2d[][];
|
|
2303
2252
|
}
|
|
2304
|
-
//#endregion
|
|
2305
|
-
//#region src/spatial-partition-3d.d.ts
|
|
2306
2253
|
/**
|
|
2307
2254
|
* Anything with a position that a {@link SpatialPartition3d} can bucket.
|
|
2308
2255
|
*
|
|
@@ -2345,8 +2292,6 @@ export declare class SpatialPartition3d {
|
|
|
2345
2292
|
/** Puts `entity` in the cell its current position falls in. */
|
|
2346
2293
|
addEntity(entity: SpatialPartitionEntity3d): void;
|
|
2347
2294
|
}
|
|
2348
|
-
//#endregion
|
|
2349
|
-
//#region src/tilemap.d.ts
|
|
2350
2295
|
/**
|
|
2351
2296
|
* Sparse 2D grid of arbitrary values, keyed by floored integer coordinates. Simpler than
|
|
2352
2297
|
* {@link Map2D} (string keys, any value type, no default value or range limit).
|
|
@@ -2362,8 +2307,6 @@ export declare class Tilemap<T = number> {
|
|
|
2362
2307
|
/** Sets the tile containing (x, y). */
|
|
2363
2308
|
set(x: number, y: number, v: T): void;
|
|
2364
2309
|
}
|
|
2365
|
-
//#endregion
|
|
2366
|
-
//#region src/webgl.d.ts
|
|
2367
2310
|
/**
|
|
2368
2311
|
* Literal GLenum values, so importing this module doesn't require `WebGL2RenderingContext` to exist.
|
|
2369
2312
|
*
|
|
@@ -2719,8 +2662,6 @@ export interface DrawOptions {
|
|
|
2719
2662
|
* @category WebGL
|
|
2720
2663
|
*/
|
|
2721
2664
|
export declare function Draw(gl: WebGL2RenderingContext, info: ProgramInfo, vertexArray: VertexArrayInfo, options?: DrawOptions): void;
|
|
2722
|
-
//#endregion
|
|
2723
|
-
//#region src/webgl-renderer.d.ts
|
|
2724
2665
|
/**
|
|
2725
2666
|
* Options for the {@link WebGlRenderer} constructor.
|
|
2726
2667
|
*
|
|
@@ -2806,8 +2747,6 @@ export declare class WebGlRenderer {
|
|
|
2806
2747
|
dispose(): void;
|
|
2807
2748
|
private _listen;
|
|
2808
2749
|
}
|
|
2809
|
-
//#endregion
|
|
2810
|
-
//#region src/worker-interface.d.ts
|
|
2811
2750
|
/**
|
|
2812
2751
|
* Thin wrapper around a module `Worker` that exposes its errors and messages as
|
|
2813
2752
|
* {@link Observable}s.
|
|
@@ -2835,5 +2774,4 @@ export declare class WorkerInterface<TReceive = any, TSend = any> {
|
|
|
2835
2774
|
/** Stops the worker immediately. */
|
|
2836
2775
|
terminate(): void;
|
|
2837
2776
|
}
|
|
2838
|
-
//#endregion
|
|
2839
2777
|
export { ColorPalette, DEFAULT_MAP_2D_VALUE, DEFAULT_MAP_3D_VALUE, KeyValue, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map2D, Map2DData, Map3D, Map3DCell, NoiseFunction3D, RGB, XY, XYZ, buildColorPalette };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { KeyValue, NoiseFunction3D, XY, XYZ } from "./types.js";
|
|
2
1
|
import { PathOptions, StepCost, findPath } from "./astar.js";
|
|
3
2
|
import { CanvasColor, CanvasRenderer, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_PIXEL_SIZE, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE, DrawParams, SpriteParams } from "./canvas-renderer.js";
|
|
4
3
|
import { Clock, ClockCallback, ONE_SECOND } from "./clock.js";
|
|
5
4
|
import { ColorPalette, RGB, buildColorPalette } from "./color-palette.js";
|
|
6
5
|
import { Color } from "./color.js";
|
|
7
6
|
import { Disposable } from "./disposable.js";
|
|
8
|
-
import { DEFAULT_MAP_2D_VALUE, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, Map2D, Map2DData } from "./map2d.js";
|
|
9
|
-
import { Vector } from "./vector.js";
|
|
10
|
-
import { Rectangle } from "./rectangle.js";
|
|
11
7
|
import { DoorsParams, GenerateDoors, GenerateRooms, GenerateRoomsParams, GenerateWalls, PathsParams, PointPair, RectPair, RoomsParams, TILE_EMPTY, TILE_FLOOR, TILE_PATH } from "./dungeon-generator.js";
|
|
12
8
|
import { Component, ComponentInstances, ComponentType, ECS, Entity, System, ecs } from "./ecs.js";
|
|
13
9
|
import { Emitter, Listener } from "./emitter.js";
|
|
14
10
|
import { EventQueue } from "./event-queue.js";
|
|
11
|
+
import { log } from "./log.js";
|
|
12
|
+
import { DEFAULT_MAP_2D_VALUE, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, Map2D, Map2DData } from "./map2d.js";
|
|
13
|
+
import { DEFAULT_MAP_3D_VALUE, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map3D, Map3DCell } from "./map3d.js";
|
|
14
|
+
import { DEG2RAD, E, EPSILON, HALF_PI, LN10, LN2, LOG10E, LOG2E, PI, QUARTER_PI, RAD2DEG, SQRT1_2, SQRT2, TAU, clamp, degrees, distance2d, distance3d, fract, hash32, hash32mix, inverseLerp, lerp, manhattanDistance, mod, nearlyEqual, normalizeRadians, radians, roundTo, saturate, smoothstep, squaredDistance, wrap } from "./math.js";
|
|
15
15
|
import { Binding, GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, GamepadAxis, GamepadButton, Gesture, GestureBinding, KeyBinding, KeyModifiers, MouseBinding, MouseButton, PadAxisBinding, PadBinding, WheelBinding, WheelDirection, XRAxis, XRAxisBinding, XRBinding, XRButton, XRHand, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis } from "./input/bindings.js";
|
|
16
16
|
import { Action, ActionMap, ActionMapJSON, ActionOptions, ActionRepeat, DEFAULT_DEADZONE, DEFAULT_REPEAT } from "./input/action-map.js";
|
|
17
17
|
import { GestureEvent, GestureFrame, GestureRecognizer, GestureThresholds, TouchPoint } from "./input/gestures.js";
|
|
18
18
|
import { Input, InputState } from "./input/input.js";
|
|
19
|
-
import { Observable, Observer } from "./observable.js";
|
|
20
|
-
import { ActionEvent, ActionPhase, CaptureOptions, DeviceQuery, GamepadInfo, InputActionMap, InputActionMapOptions, InputDevice, InputDeviceType, PointerState, XRSessionLike } from "./input/input-action-map.js";
|
|
21
|
-
import { log } from "./log.js";
|
|
22
|
-
import { DEFAULT_MAP_3D_VALUE, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map3D, Map3DCell } from "./map3d.js";
|
|
23
|
-
import { DEG2RAD, E, EPSILON, HALF_PI, LN10, LN2, LOG10E, LOG2E, PI, QUARTER_PI, RAD2DEG, SQRT1_2, SQRT2, TAU, clamp, degrees, distance2d, distance3d, fract, hash32, hash32mix, inverseLerp, lerp, manhattanDistance, mod, nearlyEqual, normalizeRadians, radians, roundTo, saturate, smoothstep, squaredDistance, wrap } from "./math.js";
|
|
24
19
|
import { GetUrlParams, getRedYellowGreenGradientHex, isNullOrUndefined, isPositiveString, k2xy, k2xyz, xy2k, xyz2k } from "./misc.js";
|
|
20
|
+
import { ActionEvent, ActionPhase, CaptureOptions, DeviceQuery, GamepadInfo, InputActionMap, InputActionMapOptions, InputDevice, InputDeviceType, PointerState, XRSessionLike } from "./input/input-action-map.js";
|
|
21
|
+
import { Observable, Observer } from "./observable.js";
|
|
25
22
|
import { ParticleRenderer } from "./particle-renderer.js";
|
|
26
23
|
import { ParticleSystem2d, randomMatrix } from "./particle-system-2d.js";
|
|
27
24
|
import { Random } from "./random.js";
|
|
25
|
+
import { Rectangle } from "./rectangle.js";
|
|
28
26
|
import { Rng, rng } from "./rng.js";
|
|
29
27
|
import { Signal, Subscriber } from "./signal.js";
|
|
30
28
|
import { SpatialPartition2d, SpatialPartitionEntity2d } from "./spatial-partition-2d.js";
|
|
31
29
|
import { SpatialPartition3d, SpatialPartitionEntity3d } from "./spatial-partition-3d.js";
|
|
32
30
|
import { Tilemap } from "./tilemap.js";
|
|
33
|
-
import {
|
|
31
|
+
import { KeyValue, NoiseFunction3D, XY, XYZ } from "./types.js";
|
|
32
|
+
import { Vector } from "./vector.js";
|
|
34
33
|
import { RendererParams, WebGlRenderer } from "./webgl-renderer.js";
|
|
34
|
+
import { AttributeInfo, AttributeSource, BindRenderTarget, BufferOptions, CompileShader, CreateBuffer, CreateProgram, CreateProgramInfo, CreateRenderTarget, CreateTexture, CreateVertexArray, CreateWebGlContext, DeleteProgramInfo, DeleteRenderTarget, DeleteTexture, DeleteVertexArray, Draw, DrawOptions, GetProgramLocations, LoadWebGlTexture, ProgramInfo, ProgramLocations, RenderTarget, RenderTargetOptions, ResizeRenderTarget, ResizeWebGlContext, SetUniforms, ShaderType, TextureData, TextureInfo, TextureOptions, UniformInfo, UniformValue, UpdateBuffer, UpdateTexture, VertexArrayInfo } from "./webgl.js";
|
|
35
35
|
import { WorkerInterface } from "./worker-interface.js";
|
|
36
36
|
export { Action, ActionEvent, ActionMap, ActionMapJSON, ActionOptions, ActionPhase, ActionRepeat, AttributeInfo, AttributeSource, BindRenderTarget, Binding, BufferOptions, CanvasColor, CanvasRenderer, CaptureOptions, Clock, ClockCallback, Color, ColorPalette, CompileShader, Component, ComponentInstances, ComponentType, CreateBuffer, CreateProgram, CreateProgramInfo, CreateRenderTarget, CreateTexture, CreateVertexArray, CreateWebGlContext, DEFAULT_COLOR, DEFAULT_DEADZONE, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_MAP_2D_VALUE, DEFAULT_MAP_3D_VALUE, DEFAULT_PIXEL_SIZE, DEFAULT_REPEAT, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE, DEG2RAD, DeleteProgramInfo, DeleteRenderTarget, DeleteTexture, DeleteVertexArray, DeviceQuery, Disposable, DoorsParams, Draw, DrawOptions, DrawParams, E, ECS, EPSILON, Emitter, Entity, EventQueue, GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, GamepadAxis, GamepadButton, GamepadInfo, GenerateDoors, GenerateRooms, GenerateRoomsParams, GenerateWalls, Gesture, GestureBinding, GestureEvent, GestureFrame, GestureRecognizer, GestureThresholds, GetProgramLocations, GetUrlParams, HALF_PI, Input, InputActionMap, InputActionMapOptions, InputDevice, InputDeviceType, InputState, KeyBinding, KeyModifiers, KeyValue, LN10, LN2, LOG10E, LOG2E, Listener, LoadWebGlTexture, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map2D, Map2DData, Map3D, Map3DCell, MouseBinding, MouseButton, NoiseFunction3D, ONE_SECOND, Observable, Observer, PI, PadAxisBinding, PadBinding, ParticleRenderer, ParticleSystem2d, PathOptions, PathsParams, PointPair, PointerState, ProgramInfo, ProgramLocations, QUARTER_PI, RAD2DEG, RGB, Random, RectPair, Rectangle, RenderTarget, RenderTargetOptions, RendererParams, ResizeRenderTarget, ResizeWebGlContext, Rng, RoomsParams, SQRT1_2, SQRT2, SetUniforms, ShaderType, Signal, SpatialPartition2d, SpatialPartition3d, SpatialPartitionEntity2d, SpatialPartitionEntity3d, SpriteParams, StepCost, Subscriber, System, TAU, TILE_EMPTY, TILE_FLOOR, TILE_PATH, TextureData, TextureInfo, TextureOptions, Tilemap, TouchPoint, UniformInfo, UniformValue, UpdateBuffer, UpdateTexture, Vector, VertexArrayInfo, WebGlRenderer, WheelBinding, WheelDirection, WorkerInterface, XRAxis, XRAxisBinding, XRBinding, XRButton, XRHand, XRSessionLike, XR_AXES, XR_BUTTONS, XY, XYZ, bindingLabel, bindingsEqual, buildColorPalette, clamp, controlId, degrees, distance2d, distance3d, ecs, findPath, fract, gesture, getRedYellowGreenGradientHex, hash32, hash32mix, inverseLerp, isNullOrUndefined, isPositiveString, k2xy, k2xyz, key, lerp, log, manhattanDistance, mod, mouse, nearlyEqual, normalizeRadians, pad, padAxis, radians, randomMatrix, rng, roundTo, saturate, smoothstep, squaredDistance, wheel, wrap, xr, xrAxis, xy2k, xyz2k };
|