@n3rdw1z4rd/core 0.22.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.
Files changed (142) hide show
  1. package/README.md +59 -4
  2. package/dist/astar.d.ts +1 -3
  3. package/dist/astar.js +1 -2
  4. package/dist/canvas-renderer.d.ts +1 -3
  5. package/dist/canvas-renderer.js +1 -2
  6. package/dist/clock.d.ts +1 -3
  7. package/dist/clock.js +1 -2
  8. package/dist/color-palette.d.ts +1 -3
  9. package/dist/color-palette.js +1 -2
  10. package/dist/color.d.ts +1 -3
  11. package/dist/color.js +1 -2
  12. package/dist/disposable.d.ts +1 -3
  13. package/dist/disposable.js +1 -2
  14. package/dist/dungeon-generator.d.ts +2 -4
  15. package/dist/dungeon-generator.js +3 -4
  16. package/dist/ecs.d.ts +1 -3
  17. package/dist/ecs.js +1 -2
  18. package/dist/emitter.d.ts +1 -3
  19. package/dist/emitter.js +1 -2
  20. package/dist/event-queue.d.ts +1 -3
  21. package/dist/event-queue.js +1 -2
  22. package/dist/graph/doc.d.ts +2 -4
  23. package/dist/graph/doc.js +1 -2
  24. package/dist/graph/evaluate.d.ts +1 -3
  25. package/dist/graph/evaluate.js +1 -2
  26. package/dist/graph/index.d.ts +4 -4
  27. package/dist/graph/index.js +4 -4
  28. package/dist/graph/node.d.ts +7 -9
  29. package/dist/graph/node.js +1 -2
  30. package/dist/graph/nodes.d.ts +1 -3
  31. package/dist/graph/nodes.js +1 -2
  32. package/dist/graph/script.d.ts +37 -40
  33. package/dist/graph/script.js +14 -60
  34. package/dist/graph/sources.d.ts +1 -3
  35. package/dist/graph/sources.js +1 -2
  36. package/dist/graph/subgraph.d.ts +2 -4
  37. package/dist/graph/subgraph.js +1 -2
  38. package/dist/graph/types.d.ts +3 -5
  39. package/dist/graph/types.js +2 -3
  40. package/dist/graph.cjs +22 -77
  41. package/dist/graph.d.cts +44 -61
  42. package/dist/index.cjs +27 -52
  43. package/dist/index.d.cts +1 -63
  44. package/dist/index.d.ts +10 -10
  45. package/dist/index.js +14 -14
  46. package/dist/input/_input.d.ts +1 -3
  47. package/dist/input/_input.js +1 -2
  48. package/dist/input/action-map.d.ts +1 -3
  49. package/dist/input/action-map.js +1 -2
  50. package/dist/input/bindings.d.ts +1 -3
  51. package/dist/input/bindings.js +1 -2
  52. package/dist/input/gestures.d.ts +1 -3
  53. package/dist/input/gestures.js +1 -2
  54. package/dist/input/index.d.ts +1 -1
  55. package/dist/input/index.js +1 -1
  56. package/dist/input/input-action-map.d.ts +3 -5
  57. package/dist/input/input-action-map.js +3 -4
  58. package/dist/input/input.d.ts +2 -4
  59. package/dist/input/input.js +2 -3
  60. package/dist/log.d.ts +1 -3
  61. package/dist/log.js +1 -2
  62. package/dist/map2d.d.ts +1 -3
  63. package/dist/map2d.js +1 -2
  64. package/dist/{map3d-CHDJiq5T.d.cts → map3d-DRHhbrFn.d.cts} +0 -8
  65. package/dist/map3d.d.ts +1 -3
  66. package/dist/map3d.js +1 -2
  67. package/dist/math.d.ts +1 -3
  68. package/dist/math.js +1 -2
  69. package/dist/misc.d.ts +1 -3
  70. package/dist/misc.js +1 -2
  71. package/dist/observable.d.ts +1 -3
  72. package/dist/observable.js +1 -2
  73. package/dist/particle-renderer.d.ts +1 -3
  74. package/dist/particle-renderer.js +1 -2
  75. package/dist/particle-system-2d.d.ts +1 -3
  76. package/dist/particle-system-2d.js +3 -4
  77. package/dist/random.d.ts +1 -3
  78. package/dist/random.js +1 -2
  79. package/dist/rectangle.d.ts +1 -3
  80. package/dist/rectangle.js +1 -2
  81. package/dist/{rng-Dhqq7owV.cjs → rng-edL6atS3.cjs} +3 -6
  82. package/dist/rng.d.ts +1 -3
  83. package/dist/rng.js +2 -3
  84. package/dist/signal.d.ts +1 -3
  85. package/dist/signal.js +1 -2
  86. package/dist/spatial-partition-2d.d.ts +1 -3
  87. package/dist/spatial-partition-2d.js +1 -2
  88. package/dist/{spatial-partition-3d-CmSCL87Z.cjs → spatial-partition-3d-D1uyJVhM.cjs} +7 -13
  89. package/dist/spatial-partition-3d.d.ts +1 -3
  90. package/dist/spatial-partition-3d.js +1 -2
  91. package/dist/three/adaptive-grid.d.ts +1 -3
  92. package/dist/three/adaptive-grid.js +1 -2
  93. package/dist/three/asteroid-mesh.d.ts +1 -3
  94. package/dist/three/asteroid-mesh.js +1 -2
  95. package/dist/three/camera-rig.d.ts +1 -3
  96. package/dist/three/camera-rig.js +1 -2
  97. package/dist/three/cube-sphere-geometry.d.ts +1 -3
  98. package/dist/three/cube-sphere-geometry.js +1 -2
  99. package/dist/three/ecs.d.ts +1 -3
  100. package/dist/three/ecs.js +1 -2
  101. package/dist/three/editor-camera.d.ts +1 -3
  102. package/dist/three/editor-camera.js +1 -2
  103. package/dist/three/index.d.ts +4 -4
  104. package/dist/three/index.js +1 -1
  105. package/dist/three/particle-system-3d.d.ts +1 -3
  106. package/dist/three/particle-system-3d.js +3 -4
  107. package/dist/three/picking.d.ts +2 -4
  108. package/dist/three/picking.js +1 -2
  109. package/dist/three/renderer.d.ts +1 -3
  110. package/dist/three/renderer.js +1 -2
  111. package/dist/three/schema.d.ts +0 -2
  112. package/dist/three/schema.js +1 -2
  113. package/dist/three/starfield.d.ts +1 -3
  114. package/dist/three/starfield.js +1 -2
  115. package/dist/three/texture-atlas.d.ts +1 -3
  116. package/dist/three/texture-atlas.js +1 -2
  117. package/dist/three/texture-utils.d.ts +1 -3
  118. package/dist/three/texture-utils.js +1 -2
  119. package/dist/three/voxel-geometry.d.ts +2 -4
  120. package/dist/three/voxel-geometry.js +2 -3
  121. package/dist/three/voxel-mesh.d.ts +1 -3
  122. package/dist/three/voxel-mesh.js +1 -2
  123. package/dist/three/world.d.ts +0 -2
  124. package/dist/three/world.js +1 -2
  125. package/dist/three.cjs +18 -34
  126. package/dist/three.d.cts +1 -33
  127. package/dist/tilemap.d.ts +1 -3
  128. package/dist/tilemap.js +1 -2
  129. package/dist/types.d.ts +1 -3
  130. package/dist/vector.d.ts +1 -3
  131. package/dist/vector.js +1 -2
  132. package/dist/vite.cjs +1 -2
  133. package/dist/vite.d.cts +1 -3
  134. package/dist/vite.d.ts +1 -3
  135. package/dist/vite.js +1 -2
  136. package/dist/webgl-renderer.d.ts +1 -3
  137. package/dist/webgl-renderer.js +1 -2
  138. package/dist/webgl.d.ts +1 -3
  139. package/dist/webgl.js +1 -2
  140. package/dist/worker-interface.d.ts +1 -3
  141. package/dist/worker-interface.js +1 -2
  142. package/package.json +6 -6
@@ -1,4 +1,3 @@
1
- //#region src/types.d.ts
2
1
  /**
3
2
  * Any object with numeric `x` and `y`, such as a {@link Vector}.
4
3
  * @property x horizontal coordinate
@@ -31,8 +30,6 @@ type KeyValue = Record<string, any>;
31
30
  * @category Math & Random
32
31
  */
33
32
  type NoiseFunction3D = (x: number, y: number, z: number) => number;
34
- //#endregion
35
- //#region src/color-palette.d.ts
36
33
  /**
37
34
  * Color as `[r, g, b]`, each 0-255.
38
35
  * @category Color
@@ -56,8 +53,6 @@ type ColorPalette = readonly number[];
56
53
  * @category Color
57
54
  */
58
55
  declare function buildColorPalette(grayscaleSteps?: number, colorSteps?: number, ...colors: RGB[]): ColorPalette;
59
- //#endregion
60
- //#region src/map2d.d.ts
61
56
  /**
62
57
  * Default "empty" value of a {@link Map2D}: cells holding it are not stored.
63
58
  *
@@ -139,8 +134,6 @@ declare class Map2D {
139
134
  */
140
135
  forEachInArea(x1: number, y1: number, x2: number, y2: number, callback: (x: number, y: number, n: number) => void): void;
141
136
  }
142
- //#endregion
143
- //#region src/map3d.d.ts
144
137
  /**
145
138
  * Default "empty" value of a {@link Map3D}: cells holding it are not stored.
146
139
  *
@@ -232,5 +225,4 @@ declare class Map3D {
232
225
  /** Copies every stored cell of a {@link Map2D} into a new map, at z = 0. */
233
226
  static fromMap2D(map2d: Map2D, defaultValue?: number): Map3D;
234
227
  }
235
- //#endregion
236
228
  export { XYZ as _, Map3DCell as a, MAP_2D_MIN_COORD as c, ColorPalette as d, RGB as f, XY as g, NoiseFunction3D as h, Map3D as i, Map2D as l, KeyValue as m, MAP_3D_MAX_COORD as n, DEFAULT_MAP_2D_VALUE as o, buildColorPalette as p, MAP_3D_MIN_COORD as r, MAP_2D_MAX_COORD as s, DEFAULT_MAP_3D_VALUE as t, Map2DData as u };
package/dist/map3d.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Map2D, Map2DData } from "./map2d.js";
2
- //#region src/map3d.d.ts
3
2
  /**
4
3
  * Default "empty" value of a {@link Map3D}: cells holding it are not stored.
5
4
  *
@@ -90,5 +89,4 @@ export declare class Map3D {
90
89
  import(data: Map3DCell[]): void;
91
90
  /** Copies every stored cell of a {@link Map2D} into a new map, at z = 0. */
92
91
  static fromMap2D(map2d: Map2D, defaultValue?: number): Map3D;
93
- }
94
- //#endregion
92
+ }
package/dist/map3d.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/map3d.ts
1
+ // src/map3d.ts
2
2
  /**
3
3
  * Default "empty" value of a {@link Map3D}: cells holding it are not stored.
4
4
  *
@@ -144,5 +144,4 @@ var Map3D = class Map3D {
144
144
  return map3d;
145
145
  }
146
146
  };
147
- //#endregion
148
147
  export { DEFAULT_MAP_3D_VALUE, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map3D };
package/dist/math.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/math.d.ts
2
1
  /**
3
2
  * π, half a turn in radians.
4
3
  * @category Math & Random
@@ -172,5 +171,4 @@ export declare const hash32: (n: number) => number;
172
171
  * unsigned 32-bit integer by folding them through {@link hash32}. Order matters; no values gives 0.
173
172
  * @category Math & Random
174
173
  */
175
- export declare const hash32mix: (...values: number[]) => number;
176
- //#endregion
174
+ export declare const hash32mix: (...values: number[]) => number;
package/dist/math.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/math.ts
1
+ // src/math.ts
2
2
  /**
3
3
  * π, half a turn in radians.
4
4
  * @category Math & Random
@@ -202,5 +202,4 @@ const hash32mix = (...values) => {
202
202
  }
203
203
  return n;
204
204
  };
205
- //#endregion
206
205
  export { 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 };
package/dist/misc.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { KeyValue } from "./types.js";
2
- //#region src/misc.d.ts
3
2
  /**
4
3
  * True if `target` is `null` or `undefined`.
5
4
  * @category Utilities
@@ -42,5 +41,4 @@ export declare const xyz2k: (x: number, y: number, z: number, delimiter?: string
42
41
  * Splits a key made by {@link xyz2k} back into `[x, y, z]` (parsed with `parseFloat`).
43
42
  * @category Utilities
44
43
  */
45
- export declare const k2xyz: (key: string, delimiter?: string) => [number, number, number];
46
- //#endregion
44
+ export declare const k2xyz: (key: string, delimiter?: string) => [number, number, number];
package/dist/misc.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { clamp } from "./math.js";
2
- //#region src/misc.ts
2
+ // src/misc.ts
3
3
  /**
4
4
  * True if `target` is `null` or `undefined`.
5
5
  * @category Utilities
@@ -67,5 +67,4 @@ const xyz2k = (x, y, z, delimiter = ",") => `${x}${delimiter}${y}${delimiter}${z
67
67
  * @category Utilities
68
68
  */
69
69
  const k2xyz = (key, delimiter = ",") => key.split(delimiter).map(parseFloat);
70
- //#endregion
71
70
  export { GetUrlParams, getRedYellowGreenGradientHex, isNullOrUndefined, isPositiveString, k2xy, k2xyz, xy2k, xyz2k };
@@ -1,4 +1,3 @@
1
- //#region src/observable.d.ts
2
1
  /**
3
2
  * An {@link Observable} observer: called with the notified value (and any extra arguments).
4
3
  *
@@ -39,5 +38,4 @@ export declare class Observable<T> {
39
38
  clear(): void;
40
39
  /** number of observers */
41
40
  get size(): number;
42
- }
43
- //#endregion
41
+ }
@@ -1,4 +1,4 @@
1
- //#region src/observable.ts
1
+ // src/observable.ts
2
2
  /**
3
3
  * A set of observers notified with a value (plus optional extra arguments). Observers are
4
4
  * called in subscription order; subscribing the same function twice has no effect.
@@ -49,5 +49,4 @@ var Observable = class {
49
49
  return this.observers.size;
50
50
  }
51
51
  };
52
- //#endregion
53
52
  export { Observable };
@@ -1,5 +1,4 @@
1
1
  import { Color } from "./color.js";
2
- //#region src/particle-renderer.d.ts
3
2
  /**
4
3
  * Double-buffered square-pixel renderer for particle effects: draw with `setPixel()` into an
5
4
  * offscreen buffer, then `render()` copies the buffer to the visible canvas and clears it.
@@ -43,5 +42,4 @@ export declare class ParticleRenderer {
43
42
  setPixel(x: number, y: number, color: Color, size?: number): void;
44
43
  /** Replaces the visible canvas with the buffer's contents, then clears the buffer for the next frame. */
45
44
  render(): void;
46
- }
47
- //#endregion
45
+ }
@@ -1,4 +1,4 @@
1
- //#region src/particle-renderer.ts
1
+ // src/particle-renderer.ts
2
2
  /**
3
3
  * Double-buffered square-pixel renderer for particle effects: draw with `setPixel()` into an
4
4
  * offscreen buffer, then `render()` copies the buffer to the visible canvas and clears it.
@@ -78,5 +78,4 @@ var ParticleRenderer = class {
78
78
  this.bufferContext.clearRect(0, 0, this._screenCanvas.width, this._screenCanvas.height);
79
79
  }
80
80
  };
81
- //#endregion
82
81
  export { ParticleRenderer };
@@ -1,5 +1,4 @@
1
1
  import { ParticleRenderer } from "./particle-renderer.js";
2
- //#region src/particle-system-2d.d.ts
3
2
  /**
4
3
  * A `size` x `size` attraction matrix with values in [-1, 1). Deterministic: the same `size` and
5
4
  * `seed` always give the same matrix.
@@ -56,5 +55,4 @@ export declare class ParticleSystem2d {
56
55
  * `dt` is capped to {@link ParticleSystem2d.maxDeltaTime}.
57
56
  */
58
57
  update(renderer: ParticleRenderer, dt: number): void;
59
- }
60
- //#endregion
58
+ }
@@ -1,9 +1,9 @@
1
- import { fract } from "./math.js";
2
1
  import { Color } from "./color.js";
3
- import { Random } from "./random.js";
2
+ import { fract } from "./math.js";
4
3
  import { rng } from "./rng.js";
5
4
  import { SpatialPartition2d } from "./spatial-partition-2d.js";
6
- //#region src/particle-system-2d.ts
5
+ import { Random } from "./random.js";
6
+ // src/particle-system-2d.ts
7
7
  /**
8
8
  * A `size` x `size` attraction matrix with values in [-1, 1). Deterministic: the same `size` and
9
9
  * `seed` always give the same matrix.
@@ -143,5 +143,4 @@ var ParticleSystem2d = class {
143
143
  this._updatePositions(dt, renderer);
144
144
  }
145
145
  };
146
- //#endregion
147
146
  export { ParticleSystem2d, randomMatrix };
package/dist/random.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/random.d.ts
2
1
  /**
3
2
  * Hash-based random numbers. The static methods are pure functions of their arguments (the same
4
3
  * inputs always give the same result), which makes them handy for coordinate-based noise; an
@@ -42,5 +41,4 @@ export declare class Random {
42
41
  sign(): -1 | 1;
43
42
  /** Next angle in radians in [0, 2π); advances the seed. */
44
43
  angle(): number;
45
- }
46
- //#endregion
44
+ }
package/dist/random.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { TAU, hash32mix } from "./math.js";
2
- //#region src/random.ts
2
+ // src/random.ts
3
3
  /**
4
4
  * Hash-based random numbers. The static methods are pure functions of their arguments (the same
5
5
  * inputs always give the same result), which makes them handy for coordinate-based noise; an
@@ -70,5 +70,4 @@ var Random = class Random {
70
70
  return Random.angle(this._seed++);
71
71
  }
72
72
  };
73
- //#endregion
74
73
  export { Random };
@@ -1,5 +1,4 @@
1
1
  import { Vector } from "./vector.js";
2
- //#region src/rectangle.d.ts
3
2
  /**
4
3
  * Axis-aligned rectangle given by its top-left corner (`x`, `y`) and size. Edges are inclusive
5
4
  * in the containment and intersection tests.
@@ -40,5 +39,4 @@ export declare class Rectangle {
40
39
  grow(padding: number): Rectangle;
41
40
  /** Same as {@link Rectangle.contains} with a point. */
42
41
  vectorInside(vec: Vector, padding?: number): boolean;
43
- }
44
- //#endregion
42
+ }
package/dist/rectangle.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Vector } from "./vector.js";
2
- //#region src/rectangle.ts
2
+ // src/rectangle.ts
3
3
  /**
4
4
  * Axis-aligned rectangle given by its top-left corner (`x`, `y`) and size. Edges are inclusive
5
5
  * in the containment and intersection tests.
@@ -65,5 +65,4 @@ var Rectangle = class Rectangle {
65
65
  return this.contains(vec, padding);
66
66
  }
67
67
  };
68
- //#endregion
69
68
  export { Rectangle };
@@ -1,4 +1,4 @@
1
- //#region src/math.ts
1
+ // src/math.ts
2
2
  /**
3
3
  * π, half a turn in radians.
4
4
  * @category Math & Random
@@ -202,8 +202,7 @@ const hash32mix = (...values) => {
202
202
  }
203
203
  return n;
204
204
  };
205
- //#endregion
206
- //#region src/random.ts
205
+ // src/random.ts
207
206
  /**
208
207
  * Hash-based random numbers. The static methods are pure functions of their arguments (the same
209
208
  * inputs always give the same result), which makes them handy for coordinate-based noise; an
@@ -274,8 +273,7 @@ var Random = class Random {
274
273
  return Random.angle(this._seed++);
275
274
  }
276
275
  };
277
- //#endregion
278
- //#region src/rng.ts
276
+ // src/rng.ts
279
277
  /**
280
278
  * Seeded random number generator with helpers for ranges, picking, shuffling, geometric points,
281
279
  * Gaussian samples and matrices. Every call advances the underlying {@link Random}, so a given
@@ -423,7 +421,6 @@ var Rng = class {
423
421
  * @category Math & Random
424
422
  */
425
423
  const rng = new Rng();
426
- //#endregion
427
424
  Object.defineProperty(exports, "DEG2RAD", {
428
425
  enumerable: true,
429
426
  get: function() {
package/dist/rng.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Random } from "./random.js";
2
- //#region src/rng.d.ts
3
2
  /**
4
3
  * Seeded random number generator with helpers for ranges, picking, shuffling, geometric points,
5
4
  * Gaussian samples and matrices. Every call advances the underlying {@link Random}, so a given
@@ -68,5 +67,4 @@ export declare class Rng {
68
67
  * Shared {@link Rng} seeded from `Date.now()` at module load; set `rng.seed` for reproducible results.
69
68
  * @category Math & Random
70
69
  */
71
- export declare const rng: Rng;
72
- //#endregion
70
+ export declare const rng: Rng;
package/dist/rng.js CHANGED
@@ -1,6 +1,6 @@
1
- import { TAU } from "./math.js";
2
1
  import { Random } from "./random.js";
3
- //#region src/rng.ts
2
+ import { TAU } from "./math.js";
3
+ // src/rng.ts
4
4
  /**
5
5
  * Seeded random number generator with helpers for ranges, picking, shuffling, geometric points,
6
6
  * Gaussian samples and matrices. Every call advances the underlying {@link Random}, so a given
@@ -148,5 +148,4 @@ var Rng = class {
148
148
  * @category Math & Random
149
149
  */
150
150
  const rng = new Rng();
151
- //#endregion
152
151
  export { Rng, rng };
package/dist/signal.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/signal.d.ts
2
1
  /**
3
2
  * A {@link Signal} subscriber: called with the new value.
4
3
  *
@@ -30,5 +29,4 @@ export declare class Signal<T> {
30
29
  set(value: T): void;
31
30
  /** Adds a subscriber and calls it right away with the current value; returns a function that removes it. */
32
31
  subscribe(subscriber: Subscriber<T>): () => void;
33
- }
34
- //#endregion
32
+ }
package/dist/signal.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/signal.ts
1
+ // src/signal.ts
2
2
  /**
3
3
  * A value holder that notifies subscribers when the value changes (compared with `Object.is`).
4
4
  * Subscribers are called immediately with the current value when they subscribe.
@@ -37,5 +37,4 @@ var Signal = class {
37
37
  return () => this.subscribers.delete(subscriber);
38
38
  }
39
39
  };
40
- //#endregion
41
40
  export { Signal };
@@ -1,4 +1,3 @@
1
- //#region src/spatial-partition-2d.d.ts
2
1
  /**
3
2
  * Anything with a position that a {@link SpatialPartition2d} can bucket.
4
3
  *
@@ -38,5 +37,4 @@ export declare class SpatialPartition2d {
38
37
  * axis the block has fewer than 9 cells.
39
38
  */
40
39
  getCellNeighbors(x: number, y: number): SpatialPartitionEntity2d[][];
41
- }
42
- //#endregion
40
+ }
@@ -1,5 +1,5 @@
1
1
  import { mod } from "./math.js";
2
- //#region src/spatial-partition-2d.ts
2
+ // src/spatial-partition-2d.ts
3
3
  /**
4
4
  * Uniform grid over the wrapping unit square [0, 1)², for finding nearby entities without
5
5
  * comparing every pair. The grid has `ceil(1 / cellSize)` cells per axis.
@@ -48,5 +48,4 @@ var SpatialPartition2d = class {
48
48
  return [...neighbors];
49
49
  }
50
50
  };
51
- //#endregion
52
51
  export { SpatialPartition2d };
@@ -1,13 +1,12 @@
1
- const require_rng = require("./rng-Dhqq7owV.cjs");
2
- //#region src/log.ts
1
+ const require_rng = require("./rng-edL6atS3.cjs");
2
+ // src/log.ts
3
3
  /**
4
4
  * `console.debug` with a bold gray `[dev]` prefix; takes the same arguments. Visible only when the
5
5
  * console shows verbose/debug messages.
6
6
  * @category Utilities
7
7
  */
8
8
  const log = console.debug.bind(console, "%c[dev]", "font-weight: bold; color: #888;");
9
- //#endregion
10
- //#region src/color.ts
9
+ // src/color.ts
11
10
  /**
12
11
  * RGBA color with 8-bit channels (integers 0-255), kept in sync with an 8-digit hex string.
13
12
  * Setting a channel rounds and clamps it to 0-255.
@@ -227,8 +226,7 @@ var Color = class Color {
227
226
  return new Color(0, 0, 0, 0);
228
227
  }
229
228
  };
230
- //#endregion
231
- //#region src/map3d.ts
229
+ // src/map3d.ts
232
230
  /**
233
231
  * Default "empty" value of a {@link Map3D}: cells holding it are not stored.
234
232
  *
@@ -374,8 +372,7 @@ var Map3D = class Map3D {
374
372
  return map3d;
375
373
  }
376
374
  };
377
- //#endregion
378
- //#region src/spatial-partition-2d.ts
375
+ // src/spatial-partition-2d.ts
379
376
  /**
380
377
  * Uniform grid over the wrapping unit square [0, 1)², for finding nearby entities without
381
378
  * comparing every pair. The grid has `ceil(1 / cellSize)` cells per axis.
@@ -424,8 +421,7 @@ var SpatialPartition2d = class {
424
421
  return [...neighbors];
425
422
  }
426
423
  };
427
- //#endregion
428
- //#region src/particle-system-2d.ts
424
+ // src/particle-system-2d.ts
429
425
  /**
430
426
  * A `size` x `size` attraction matrix with values in [-1, 1). Deterministic: the same `size` and
431
427
  * `seed` always give the same matrix.
@@ -565,8 +561,7 @@ var ParticleSystem2d = class {
565
561
  this._updatePositions(dt, renderer);
566
562
  }
567
563
  };
568
- //#endregion
569
- //#region src/spatial-partition-3d.ts
564
+ // src/spatial-partition-3d.ts
570
565
  /**
571
566
  * Uniform grid over the wrapping unit cube [0, 1)³, for finding nearby entities without comparing
572
567
  * every pair. The grid has `ceil(1 / cellSize)` cells per axis.
@@ -620,7 +615,6 @@ var SpatialPartition3d = class {
620
615
  this.getCell(entity.x, entity.y, entity.z).push(entity);
621
616
  }
622
617
  };
623
- //#endregion
624
618
  Object.defineProperty(exports, "Color", {
625
619
  enumerable: true,
626
620
  get: function() {
@@ -1,4 +1,3 @@
1
- //#region src/spatial-partition-3d.d.ts
2
1
  /**
3
2
  * Anything with a position that a {@link SpatialPartition3d} can bucket.
4
3
  *
@@ -40,5 +39,4 @@ export declare class SpatialPartition3d {
40
39
  getCellNeighbors(cx: number, cy: number, cz: number): SpatialPartitionEntity3d[][];
41
40
  /** Puts `entity` in the cell its current position falls in. */
42
41
  addEntity(entity: SpatialPartitionEntity3d): void;
43
- }
44
- //#endregion
42
+ }
@@ -1,5 +1,5 @@
1
1
  import { mod } from "./math.js";
2
- //#region src/spatial-partition-3d.ts
2
+ // src/spatial-partition-3d.ts
3
3
  /**
4
4
  * Uniform grid over the wrapping unit cube [0, 1)³, for finding nearby entities without comparing
5
5
  * every pair. The grid has `ceil(1 / cellSize)` cells per axis.
@@ -53,5 +53,4 @@ var SpatialPartition3d = class {
53
53
  this.getCell(entity.x, entity.y, entity.z).push(entity);
54
54
  }
55
55
  };
56
- //#endregion
57
56
  export { SpatialPartition3d };
@@ -1,6 +1,5 @@
1
1
  import { EditorCamera } from "./editor-camera.js";
2
2
  import { BufferGeometry, ColorRepresentation, LineBasicMaterial, LineSegments } from "three";
3
- //#region src/three/adaptive-grid.d.ts
4
3
  /**
5
4
  * An infinite-looking grid on the XY plane for editor views: each {@link AdaptiveGrid.update}
6
5
  * rebuilds just the lines in view, doubling the spacing when zoomed out so lines never get
@@ -39,5 +38,4 @@ export declare class AdaptiveGrid extends LineSegments<BufferGeometry, LineBasic
39
38
  update(view: EditorCamera, cell: number, z?: number): void;
40
39
  private ensure;
41
40
  dispose(): void;
42
- }
43
- //#endregion
41
+ }
@@ -1,5 +1,5 @@
1
1
  import { BufferAttribute, BufferGeometry, Color, LineBasicMaterial, LineSegments } from "three";
2
- //#region src/three/adaptive-grid.ts
2
+ // src/three/adaptive-grid.ts
3
3
  /**
4
4
  * An infinite-looking grid on the XY plane for editor views: each {@link AdaptiveGrid.update}
5
5
  * rebuilds just the lines in view, doubling the spacing when zoomed out so lines never get
@@ -123,5 +123,4 @@ var AdaptiveGrid = class extends LineSegments {
123
123
  this.material.dispose();
124
124
  }
125
125
  };
126
- //#endregion
127
126
  export { AdaptiveGrid };
@@ -1,6 +1,5 @@
1
1
  import { NoiseFunction3D } from "../types.js";
2
2
  import { Mesh } from "three";
3
- //#region src/three/asteroid-mesh.d.ts
4
3
  /**
5
4
  * Options for the {@link AsteroidMesh} constructor.
6
5
  *
@@ -37,5 +36,4 @@ export interface AsteroidOptions {
37
36
  */
38
37
  export declare class AsteroidMesh extends Mesh {
39
38
  constructor(options: AsteroidOptions);
40
- }
41
- //#endregion
39
+ }
@@ -1,5 +1,5 @@
1
1
  import { IcosahedronGeometry, Mesh, MeshStandardMaterial } from "three";
2
- //#region src/three/asteroid-mesh.ts
2
+ // src/three/asteroid-mesh.ts
3
3
  /**
4
4
  * Lumpy rock: an icosphere whose vertices are pushed in and out by 3D noise, with a
5
5
  * `MeshStandardMaterial`. The geometry is non-indexed, so normals are per face (a faceted look).
@@ -40,5 +40,4 @@ var AsteroidMesh = class extends Mesh {
40
40
  this.geometry.computeVertexNormals();
41
41
  }
42
42
  };
43
- //#endregion
44
43
  export { AsteroidMesh };
@@ -1,5 +1,4 @@
1
1
  import { Group, Object3D, PerspectiveCamera, Vector3 } from "three";
2
- //#region src/three/camera-rig.d.ts
3
2
  /**
4
3
  * Options for the {@link CameraRig} constructor.
5
4
  *
@@ -136,5 +135,4 @@ export declare class CameraRig extends Group {
136
135
  private _clampDistance;
137
136
  private _clampPitch;
138
137
  private _setFirstPerson;
139
- }
140
- //#endregion
138
+ }
@@ -1,6 +1,6 @@
1
1
  import { clamp, lerp, radians, saturate } from "../math.js";
2
2
  import { Group, PerspectiveCamera, Raycaster, Vector3 } from "three";
3
- //#region src/three/camera-rig.ts
3
+ // src/three/camera-rig.ts
4
4
  const DEFAULT_DISTANCE = 5;
5
5
  const damp = (current, target, damping, deltaTime) => damping > 0 ? lerp(current, target, 1 - Math.exp(-damping * deltaTime)) : target;
6
6
  /**
@@ -193,5 +193,4 @@ var CameraRig = class extends Group {
193
193
  this.onModeChange?.(firstPerson);
194
194
  }
195
195
  };
196
- //#endregion
197
196
  export { CameraRig };
@@ -1,6 +1,5 @@
1
1
  import { NoiseFunction3D } from "../types.js";
2
2
  import { BufferGeometry } from "three";
3
- //#region src/three/cube-sphere-geometry.d.ts
4
3
  /**
5
4
  * A sphere built from a subdivided cube, for planets and other displaced spheres.
6
5
  *
@@ -51,5 +50,4 @@ export declare class CubeSphereGeometry extends BufferGeometry {
51
50
  * (https://mathproofs.blogspot.com/2005/07/mapping-cube-to-sphere.html)
52
51
  */
53
52
  static spherify(x: number, y: number, z: number): [number, number, number];
54
- }
55
- //#endregion
53
+ }
@@ -1,5 +1,5 @@
1
1
  import { BufferAttribute, BufferGeometry } from "three";
2
- //#region src/three/cube-sphere-geometry.ts
2
+ // src/three/cube-sphere-geometry.ts
3
3
  const FACES = [
4
4
  {
5
5
  n: [
@@ -235,5 +235,4 @@ var CubeSphereGeometry = class CubeSphereGeometry extends BufferGeometry {
235
235
  ];
236
236
  }
237
237
  };
238
- //#endregion
239
238
  export { CubeSphereGeometry };
@@ -1,5 +1,4 @@
1
1
  import { Object3D } from "three";
2
- //#region src/three/ecs.d.ts
3
2
  /**
4
3
  * A component: any plain object of data, stored by name on a {@link ThreeEntity}.
5
4
  *
@@ -73,5 +72,4 @@ export declare function IsThreeEntity(obj: Object3D): boolean;
73
72
  *
74
73
  * @category ECS
75
74
  */
76
- export type ThreeSystem = (entities: Map<string, ThreeEntity>, delta: number, ...args: any) => void;
77
- //#endregion
75
+ export type ThreeSystem = (entities: Map<string, ThreeEntity>, delta: number, ...args: any) => void;
package/dist/three/ecs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Group } from "three";
2
- //#region src/three/ecs.ts
2
+ // src/three/ecs.ts
3
3
  let entityCounter = 0;
4
4
  /**
5
5
  * Returns a new id `"entity_<n>"` from a module-level counter (unique per page load, not random).
@@ -62,5 +62,4 @@ function RemoveThreeComponent(entity, name) {
62
62
  function IsThreeEntity(obj) {
63
63
  return obj.userData.entityId !== void 0;
64
64
  }
65
- //#endregion
66
65
  export { AddThreeComponent, CreateThreeEntity, GenerateEntityId, GetThreeComponent, IsThreeEntity, RemoveThreeComponent };
@@ -1,5 +1,4 @@
1
1
  import { OrthographicCamera, PerspectiveCamera, Raycaster, Vector3 } from "three";
2
- //#region src/three/editor-camera.d.ts
3
2
  /** Screen edges covered by UI, CSS px. */
4
3
  export interface ViewInsets {
5
4
  l: number;
@@ -89,5 +88,4 @@ export declare class EditorCamera {
89
88
  * clear of `insets` (screen edges covered by UI). Keeps yaw/pitch.
90
89
  */
91
90
  fit(minX: number, minY: number, maxX: number, maxY: number, insets?: ViewInsets, margin?: number, maxZoom?: number): void;
92
- }
93
- //#endregion
91
+ }
@@ -1,5 +1,5 @@
1
1
  import { MathUtils, OrthographicCamera, PerspectiveCamera, Plane, Raycaster, Vector2, Vector3 } from "three";
2
- //#region src/three/editor-camera.ts
2
+ // src/three/editor-camera.ts
3
3
  /**
4
4
  * An editor viewport camera: orthographic or perspective, with pan, zoom-at-cursor, orbit
5
5
  * and fit-to-bounds, and conversions between screen (CSS px, relative to the canvas) and
@@ -170,5 +170,4 @@ var EditorCamera = class {
170
170
  this.pan((insets.l - insets.r) / 2, (insets.t - insets.b) / 2);
171
171
  }
172
172
  };
173
- //#endregion
174
173
  export { EditorCamera };
@@ -1,17 +1,17 @@
1
- import { EditorCamera, ViewInsets } from "./editor-camera.js";
2
1
  import { AdaptiveGrid } from "./adaptive-grid.js";
3
2
  import { AsteroidMesh, AsteroidOptions } from "./asteroid-mesh.js";
4
3
  import { CameraRig, CameraRigParams, PitchLimits } from "./camera-rig.js";
5
4
  import { CubeSphereGeometry } from "./cube-sphere-geometry.js";
6
5
  import { AddThreeComponent, CreateThreeEntity, GenerateEntityId, GetThreeComponent, IsThreeEntity, RemoveThreeComponent, ThreeComponent, ThreeEntity, ThreeSystem } from "./ecs.js";
6
+ import { EditorCamera, ViewInsets } from "./editor-camera.js";
7
7
  import { ParticleSystem3d } from "./particle-system-3d.js";
8
- import { ComponentRegistry, ComponentSchema, ComponentType, FieldDef, FieldType, applyFieldValue, component, componentToJson, componentType, components, defineComponent, field, fieldToJson, inferFieldType } from "./schema.js";
9
- import { ComponentRef, EntityDoc, SCENE_FORMAT, SCENE_VERSION, SceneDoc, World, WorldEvents, WorldSystem } from "./world.js";
10
8
  import { EntityHit, PickOptions, entityOf, pickEntity } from "./picking.js";
11
9
  import { Renderer } from "./renderer.js";
10
+ import { ComponentRegistry, ComponentSchema, ComponentType, FieldDef, FieldType, applyFieldValue, component, componentToJson, componentType, components, defineComponent, field, fieldToJson, inferFieldType } from "./schema.js";
12
11
  import { CreateStarfield, CreateSystemStar } from "./starfield.js";
13
- import { CreateSubTexture, LoadTexture, TextureData } from "./texture-utils.js";
14
12
  import { AtlasParams, TextureAtlas, UV } from "./texture-atlas.js";
13
+ import { CreateSubTexture, LoadTexture, TextureData } from "./texture-utils.js";
15
14
  import { BuildVoxelGeometryOptions, VoxelGeometry, buildVoxelGeometry } from "./voxel-geometry.js";
16
15
  import { VoxelBounds, VoxelMesh, VoxelMeshOptions } from "./voxel-mesh.js";
16
+ import { ComponentRef, EntityDoc, SCENE_FORMAT, SCENE_VERSION, SceneDoc, World, WorldEvents, WorldSystem } from "./world.js";
17
17
  export { AdaptiveGrid, AddThreeComponent, AsteroidMesh, AsteroidOptions, AtlasParams, BuildVoxelGeometryOptions, CameraRig, CameraRigParams, ComponentRef, ComponentRegistry, ComponentSchema, ComponentType, CreateStarfield, CreateSubTexture, CreateSystemStar, CreateThreeEntity, CubeSphereGeometry, EditorCamera, EntityDoc, EntityHit, FieldDef, FieldType, GenerateEntityId, GetThreeComponent, IsThreeEntity, LoadTexture, ParticleSystem3d, PickOptions, PitchLimits, RemoveThreeComponent, Renderer, SCENE_FORMAT, SCENE_VERSION, SceneDoc, TextureAtlas, TextureData, ThreeComponent, ThreeEntity, ThreeSystem, UV, ViewInsets, VoxelBounds, VoxelGeometry, VoxelMesh, VoxelMeshOptions, World, WorldEvents, WorldSystem, applyFieldValue, buildVoxelGeometry, component, componentToJson, componentType, components, defineComponent, entityOf, field, fieldToJson, inferFieldType, pickEntity };