@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.
Files changed (141) hide show
  1. package/dist/astar.d.ts +1 -3
  2. package/dist/astar.js +1 -2
  3. package/dist/canvas-renderer.d.ts +1 -3
  4. package/dist/canvas-renderer.js +1 -2
  5. package/dist/clock.d.ts +1 -3
  6. package/dist/clock.js +1 -2
  7. package/dist/color-palette.d.ts +1 -3
  8. package/dist/color-palette.js +1 -2
  9. package/dist/color.d.ts +1 -3
  10. package/dist/color.js +1 -2
  11. package/dist/disposable.d.ts +1 -3
  12. package/dist/disposable.js +1 -2
  13. package/dist/dungeon-generator.d.ts +2 -4
  14. package/dist/dungeon-generator.js +3 -4
  15. package/dist/ecs.d.ts +1 -3
  16. package/dist/ecs.js +1 -2
  17. package/dist/emitter.d.ts +1 -3
  18. package/dist/emitter.js +1 -2
  19. package/dist/event-queue.d.ts +1 -3
  20. package/dist/event-queue.js +1 -2
  21. package/dist/graph/doc.d.ts +2 -4
  22. package/dist/graph/doc.js +1 -2
  23. package/dist/graph/evaluate.d.ts +1 -3
  24. package/dist/graph/evaluate.js +1 -2
  25. package/dist/graph/index.d.ts +2 -2
  26. package/dist/graph/index.js +2 -2
  27. package/dist/graph/node.d.ts +1 -3
  28. package/dist/graph/node.js +1 -2
  29. package/dist/graph/nodes.d.ts +1 -3
  30. package/dist/graph/nodes.js +1 -2
  31. package/dist/graph/script.d.ts +1 -3
  32. package/dist/graph/script.js +1 -2
  33. package/dist/graph/sources.d.ts +1 -3
  34. package/dist/graph/sources.js +1 -2
  35. package/dist/graph/subgraph.d.ts +2 -4
  36. package/dist/graph/subgraph.js +1 -2
  37. package/dist/graph/types.d.ts +1 -3
  38. package/dist/graph/types.js +1 -2
  39. package/dist/graph.cjs +9 -17
  40. package/dist/graph.d.cts +1 -17
  41. package/dist/index.cjs +27 -52
  42. package/dist/index.d.cts +1 -63
  43. package/dist/index.d.ts +10 -10
  44. package/dist/index.js +14 -14
  45. package/dist/input/_input.d.ts +1 -3
  46. package/dist/input/_input.js +1 -2
  47. package/dist/input/action-map.d.ts +1 -3
  48. package/dist/input/action-map.js +1 -2
  49. package/dist/input/bindings.d.ts +1 -3
  50. package/dist/input/bindings.js +1 -2
  51. package/dist/input/gestures.d.ts +1 -3
  52. package/dist/input/gestures.js +1 -2
  53. package/dist/input/index.d.ts +1 -1
  54. package/dist/input/index.js +1 -1
  55. package/dist/input/input-action-map.d.ts +3 -5
  56. package/dist/input/input-action-map.js +3 -4
  57. package/dist/input/input.d.ts +2 -4
  58. package/dist/input/input.js +2 -3
  59. package/dist/log.d.ts +1 -3
  60. package/dist/log.js +1 -2
  61. package/dist/map2d.d.ts +1 -3
  62. package/dist/map2d.js +1 -2
  63. package/dist/{map3d-CHDJiq5T.d.cts → map3d-DRHhbrFn.d.cts} +0 -8
  64. package/dist/map3d.d.ts +1 -3
  65. package/dist/map3d.js +1 -2
  66. package/dist/math.d.ts +1 -3
  67. package/dist/math.js +1 -2
  68. package/dist/misc.d.ts +1 -3
  69. package/dist/misc.js +1 -2
  70. package/dist/observable.d.ts +1 -3
  71. package/dist/observable.js +1 -2
  72. package/dist/particle-renderer.d.ts +1 -3
  73. package/dist/particle-renderer.js +1 -2
  74. package/dist/particle-system-2d.d.ts +1 -3
  75. package/dist/particle-system-2d.js +3 -4
  76. package/dist/random.d.ts +1 -3
  77. package/dist/random.js +1 -2
  78. package/dist/rectangle.d.ts +1 -3
  79. package/dist/rectangle.js +1 -2
  80. package/dist/{rng-Dhqq7owV.cjs → rng-edL6atS3.cjs} +3 -6
  81. package/dist/rng.d.ts +1 -3
  82. package/dist/rng.js +2 -3
  83. package/dist/signal.d.ts +1 -3
  84. package/dist/signal.js +1 -2
  85. package/dist/spatial-partition-2d.d.ts +1 -3
  86. package/dist/spatial-partition-2d.js +1 -2
  87. package/dist/{spatial-partition-3d-CmSCL87Z.cjs → spatial-partition-3d-D1uyJVhM.cjs} +7 -13
  88. package/dist/spatial-partition-3d.d.ts +1 -3
  89. package/dist/spatial-partition-3d.js +1 -2
  90. package/dist/three/adaptive-grid.d.ts +1 -3
  91. package/dist/three/adaptive-grid.js +1 -2
  92. package/dist/three/asteroid-mesh.d.ts +1 -3
  93. package/dist/three/asteroid-mesh.js +1 -2
  94. package/dist/three/camera-rig.d.ts +1 -3
  95. package/dist/three/camera-rig.js +1 -2
  96. package/dist/three/cube-sphere-geometry.d.ts +1 -3
  97. package/dist/three/cube-sphere-geometry.js +1 -2
  98. package/dist/three/ecs.d.ts +1 -3
  99. package/dist/three/ecs.js +1 -2
  100. package/dist/three/editor-camera.d.ts +1 -3
  101. package/dist/three/editor-camera.js +1 -2
  102. package/dist/three/index.d.ts +4 -4
  103. package/dist/three/index.js +1 -1
  104. package/dist/three/particle-system-3d.d.ts +1 -3
  105. package/dist/three/particle-system-3d.js +3 -4
  106. package/dist/three/picking.d.ts +2 -4
  107. package/dist/three/picking.js +1 -2
  108. package/dist/three/renderer.d.ts +1 -3
  109. package/dist/three/renderer.js +1 -2
  110. package/dist/three/schema.d.ts +0 -2
  111. package/dist/three/schema.js +1 -2
  112. package/dist/three/starfield.d.ts +1 -3
  113. package/dist/three/starfield.js +1 -2
  114. package/dist/three/texture-atlas.d.ts +1 -3
  115. package/dist/three/texture-atlas.js +1 -2
  116. package/dist/three/texture-utils.d.ts +1 -3
  117. package/dist/three/texture-utils.js +1 -2
  118. package/dist/three/voxel-geometry.d.ts +2 -4
  119. package/dist/three/voxel-geometry.js +2 -3
  120. package/dist/three/voxel-mesh.d.ts +1 -3
  121. package/dist/three/voxel-mesh.js +1 -2
  122. package/dist/three/world.d.ts +0 -2
  123. package/dist/three/world.js +1 -2
  124. package/dist/three.cjs +18 -34
  125. package/dist/three.d.cts +1 -33
  126. package/dist/tilemap.d.ts +1 -3
  127. package/dist/tilemap.js +1 -2
  128. package/dist/types.d.ts +1 -3
  129. package/dist/vector.d.ts +1 -3
  130. package/dist/vector.js +1 -2
  131. package/dist/vite.cjs +1 -2
  132. package/dist/vite.d.cts +1 -3
  133. package/dist/vite.d.ts +1 -3
  134. package/dist/vite.js +1 -2
  135. package/dist/webgl-renderer.d.ts +1 -3
  136. package/dist/webgl-renderer.js +1 -2
  137. package/dist/webgl.d.ts +1 -3
  138. package/dist/webgl.js +1 -2
  139. package/dist/worker-interface.d.ts +1 -3
  140. package/dist/worker-interface.js +1 -2
  141. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1,35 +1,35 @@
1
- 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";
2
1
  import { findPath } from "./astar.js";
3
2
  import { CanvasRenderer, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_PIXEL_SIZE, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE } from "./canvas-renderer.js";
4
3
  import { Clock, ONE_SECOND } from "./clock.js";
5
4
  import { buildColorPalette } from "./color-palette.js";
6
- import { log } from "./log.js";
7
5
  import { Color } from "./color.js";
8
6
  import { Disposable } from "./disposable.js";
9
- import { DEFAULT_MAP_2D_VALUE, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, Map2D } from "./map2d.js";
10
- import { Random } from "./random.js";
11
- import { Rng, rng } from "./rng.js";
12
- import { Vector } from "./vector.js";
13
- import { Rectangle } from "./rectangle.js";
14
7
  import { GenerateDoors, GenerateRooms, GenerateWalls, TILE_EMPTY, TILE_FLOOR, TILE_PATH } from "./dungeon-generator.js";
15
8
  import { ECS, ecs } from "./ecs.js";
16
9
  import { Emitter } from "./emitter.js";
17
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 } from "./map2d.js";
13
+ import { DEFAULT_MAP_3D_VALUE, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map3D } 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
+ import { GetUrlParams, getRedYellowGreenGradientHex, isNullOrUndefined, isPositiveString, k2xy, k2xyz, xy2k, xyz2k } from "./misc.js";
16
+ import { Observable } from "./observable.js";
17
+ import { ParticleRenderer } from "./particle-renderer.js";
18
18
  import { GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis } from "./input/bindings.js";
19
19
  import { ActionMap, DEFAULT_DEADZONE, DEFAULT_REPEAT } from "./input/action-map.js";
20
20
  import { GestureRecognizer } from "./input/gestures.js";
21
21
  import { Input } from "./input/input.js";
22
- import { Observable } from "./observable.js";
23
- import { InputActionMap } from "./input/input-action-map.js";
24
- import { DEFAULT_MAP_3D_VALUE, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map3D } from "./map3d.js";
25
- import { GetUrlParams, getRedYellowGreenGradientHex, isNullOrUndefined, isPositiveString, k2xy, k2xyz, xy2k, xyz2k } from "./misc.js";
26
- import { ParticleRenderer } from "./particle-renderer.js";
27
- import { SpatialPartition2d } from "./spatial-partition-2d.js";
28
22
  import { ParticleSystem2d, randomMatrix } from "./particle-system-2d.js";
23
+ import { InputActionMap } from "./input/input-action-map.js";
24
+ import { Random } from "./random.js";
25
+ import { Rectangle } from "./rectangle.js";
26
+ import { Rng, rng } from "./rng.js";
29
27
  import { Signal } from "./signal.js";
28
+ import { SpatialPartition2d } from "./spatial-partition-2d.js";
30
29
  import { SpatialPartition3d } from "./spatial-partition-3d.js";
31
30
  import { Tilemap } from "./tilemap.js";
32
- import { BindRenderTarget, CompileShader, CreateBuffer, CreateProgram, CreateProgramInfo, CreateRenderTarget, CreateTexture, CreateVertexArray, CreateWebGlContext, DeleteProgramInfo, DeleteRenderTarget, DeleteTexture, DeleteVertexArray, Draw, GetProgramLocations, LoadWebGlTexture, ResizeRenderTarget, ResizeWebGlContext, SetUniforms, ShaderType, UpdateBuffer, UpdateTexture } from "./webgl.js";
31
+ import { Vector } from "./vector.js";
33
32
  import { WebGlRenderer } from "./webgl-renderer.js";
33
+ import { BindRenderTarget, CompileShader, CreateBuffer, CreateProgram, CreateProgramInfo, CreateRenderTarget, CreateTexture, CreateVertexArray, CreateWebGlContext, DeleteProgramInfo, DeleteRenderTarget, DeleteTexture, DeleteVertexArray, Draw, GetProgramLocations, LoadWebGlTexture, ResizeRenderTarget, ResizeWebGlContext, SetUniforms, ShaderType, UpdateBuffer, UpdateTexture } from "./webgl.js";
34
34
  import { WorkerInterface } from "./worker-interface.js";
35
35
  export { ActionMap, BindRenderTarget, CanvasRenderer, Clock, Color, CompileShader, 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, Disposable, Draw, E, ECS, EPSILON, Emitter, EventQueue, GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, GenerateDoors, GenerateRooms, GenerateWalls, GestureRecognizer, GetProgramLocations, GetUrlParams, HALF_PI, Input, InputActionMap, LN10, LN2, LOG10E, LOG2E, LoadWebGlTexture, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map2D, Map3D, ONE_SECOND, Observable, PI, ParticleRenderer, ParticleSystem2d, QUARTER_PI, RAD2DEG, Random, Rectangle, ResizeRenderTarget, ResizeWebGlContext, Rng, SQRT1_2, SQRT2, SetUniforms, ShaderType, Signal, SpatialPartition2d, SpatialPartition3d, TAU, TILE_EMPTY, TILE_FLOOR, TILE_PATH, Tilemap, UpdateBuffer, UpdateTexture, Vector, WebGlRenderer, WorkerInterface, XR_AXES, XR_BUTTONS, 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 };
@@ -1,5 +1,4 @@
1
1
  import { Emitter } from "../emitter.js";
2
- //#region src/input/_input.d.ts
3
2
  export interface InputState {
4
3
  state: number;
5
4
  timeStamp: number;
@@ -21,5 +20,4 @@ export declare class Input extends Emitter {
21
20
  getKeyState(keyCode: string): number;
22
21
  isButtonDown(buttonNumber: number): boolean;
23
22
  getButtonState(buttonNumber: number): number;
24
- }
25
- //#endregion
23
+ }
@@ -1,5 +1,5 @@
1
1
  import { Emitter } from "../emitter.js";
2
- //#region src/input/_input.ts
2
+ // src/input/_input.ts
3
3
  var Input = class Input extends Emitter {
4
4
  static _instance;
5
5
  static get instance() {
@@ -93,5 +93,4 @@ var Input = class Input extends Emitter {
93
93
  return this._state[`button${buttonNumber}`]?.state ?? 0;
94
94
  }
95
95
  };
96
- //#endregion
97
96
  export { Input };
@@ -1,5 +1,4 @@
1
1
  import { Binding } from "./bindings.js";
2
- //#region src/input/action-map.d.ts
3
2
  /**
4
3
  * Deadzone given to new actions when none is specified.
5
4
  *
@@ -110,5 +109,4 @@ export declare class ActionMap {
110
109
  * page actions auto-repeat ({@link DEFAULT_REPEAT}). Replaces existing ones.
111
110
  */
112
111
  addDefaults(): this;
113
- }
114
- //#endregion
112
+ }
@@ -1,5 +1,5 @@
1
1
  import { bindingsEqual, key, pad, padAxis } from "./bindings.js";
2
- //#region src/input/action-map.ts
2
+ // src/input/action-map.ts
3
3
  /**
4
4
  * Deadzone given to new actions when none is specified.
5
5
  *
@@ -153,5 +153,4 @@ var ActionMap = class {
153
153
  return this;
154
154
  }
155
155
  };
156
- //#endregion
157
156
  export { ActionMap, DEFAULT_DEADZONE, DEFAULT_REPEAT };
@@ -1,4 +1,3 @@
1
- //#region src/input/bindings.d.ts
2
1
  /**
3
2
  * Modifier keys that must also be held for a key {@link Binding} to count (left or right side).
4
3
  * Modifiers left out are not checked, so a binding without `ctrl` still fires while Ctrl is held.
@@ -269,5 +268,4 @@ export declare function bindingsEqual(a: Binding, b: Binding): boolean;
269
268
  *
270
269
  * @category Input
271
270
  */
272
- export declare function bindingLabel(binding: Binding, keyLabels?: ReadonlyMap<string, string>): string;
273
- //#endregion
271
+ export declare function bindingLabel(binding: Binding, keyLabels?: ReadonlyMap<string, string>): string;
@@ -1,4 +1,4 @@
1
- //#region src/input/bindings.ts
1
+ // src/input/bindings.ts
2
2
  /**
3
3
  * W3C "standard" gamepad mapping, in button-index order (Xbox names; on PlayStation A = Cross,
4
4
  * B = Circle, X = Square, Y = Triangle).
@@ -246,5 +246,4 @@ function bindingLabel(binding, keyLabels) {
246
246
  case "xrAxis": return `${capitalize(binding.hand)} ${AXIS_NAMES[binding.axis][binding.direction > 0 ? 1 : 0]}`;
247
247
  }
248
248
  }
249
- //#endregion
250
249
  export { GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis };
@@ -1,5 +1,4 @@
1
1
  import { Gesture } from "./bindings.js";
2
- //#region src/input/gestures.d.ts
3
2
  /**
4
3
  * A finger currently on the screen, as reported by {@link GestureRecognizer.touches}.
5
4
  *
@@ -122,5 +121,4 @@ export declare class GestureRecognizer {
122
121
  clear(): void;
123
122
  /** Returns what happened since the last update. `time` is the current time in ms. */
124
123
  update(time: number): GestureFrame;
125
- }
126
- //#endregion
124
+ }
@@ -1,4 +1,4 @@
1
- //#region src/input/gestures.ts
1
+ // src/input/gestures.ts
2
2
  const DEFAULT_THRESHOLDS = {
3
3
  tapMaxDuration: 250,
4
4
  tapMaxMovement: 10,
@@ -181,5 +181,4 @@ var GestureRecognizer = class {
181
181
  return frame;
182
182
  }
183
183
  };
184
- //#endregion
185
184
  export { GestureRecognizer };
@@ -1,5 +1,5 @@
1
- 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 "./bindings.js";
2
1
  import { Action, ActionMap, ActionMapJSON, ActionOptions, ActionRepeat, DEFAULT_DEADZONE, DEFAULT_REPEAT } from "./action-map.js";
2
+ 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 "./bindings.js";
3
3
  import { GestureEvent, GestureFrame, GestureRecognizer, GestureThresholds, TouchPoint } from "./gestures.js";
4
4
  import { Input, InputState } from "./input.js";
5
5
  import { ActionEvent, ActionPhase, CaptureOptions, DeviceQuery, GamepadInfo, InputActionMap, InputActionMapOptions, InputDevice, InputDeviceType, PointerState, XRSessionLike } from "./input-action-map.js";
@@ -1,5 +1,5 @@
1
- import { GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis } from "./bindings.js";
2
1
  import { ActionMap, DEFAULT_DEADZONE, DEFAULT_REPEAT } from "./action-map.js";
2
+ import { GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis } from "./bindings.js";
3
3
  import { GestureRecognizer } from "./gestures.js";
4
4
  import { Input } from "./input.js";
5
5
  import { InputActionMap } from "./input-action-map.js";
@@ -1,9 +1,8 @@
1
- import { Binding, MouseButton } from "./bindings.js";
1
+ import { Observable } from "../observable.js";
2
2
  import { ActionMap } from "./action-map.js";
3
3
  import { GestureFrame, GestureRecognizer, TouchPoint } from "./gestures.js";
4
4
  import { Input } from "./input.js";
5
- import { Observable } from "../observable.js";
6
- //#region src/input/input-action-map.d.ts
5
+ import { Binding, MouseButton } from "./bindings.js";
7
6
  /**
8
7
  * 0 = keyboard, mouse, pen, touch and VR; 1, 2, ... = gamepads.
9
8
  *
@@ -323,5 +322,4 @@ export declare class InputActionMap {
323
322
  private _onTouchMove;
324
323
  private _onTouchUp;
325
324
  private _onWheel;
326
- }
327
- //#endregion
325
+ }
@@ -1,9 +1,9 @@
1
- import { GAMEPAD_AXES, GAMEPAD_BUTTONS, XR_AXES, XR_BUTTONS, controlId } from "./bindings.js";
1
+ import { Observable } from "../observable.js";
2
2
  import { ActionMap } from "./action-map.js";
3
3
  import { GestureRecognizer } from "./gestures.js";
4
4
  import { Input } from "./input.js";
5
- import { Observable } from "../observable.js";
6
- //#region src/input/input-action-map.ts
5
+ import { GAMEPAD_AXES, GAMEPAD_BUTTONS, XR_AXES, XR_BUTTONS, controlId } from "./bindings.js";
6
+ // src/input/input-action-map.ts
7
7
  const ANY = -1;
8
8
  const now = () => performance.now();
9
9
  const MOUSE_BUTTONS = [
@@ -685,5 +685,4 @@ var InputActionMap = class {
685
685
  });
686
686
  }
687
687
  };
688
- //#endregion
689
688
  export { InputActionMap };
@@ -1,6 +1,5 @@
1
- import { Vector } from "../vector.js";
2
1
  import { Emitter } from "../emitter.js";
3
- //#region src/input/input.d.ts
2
+ import { Vector } from "../vector.js";
4
3
  /**
5
4
  * Whether a key or button is down (`state` 1) or up (0), and when that last changed.
6
5
  *
@@ -98,5 +97,4 @@ export declare class Input extends Emitter {
98
97
  isButtonDown(buttonNumber: number): boolean;
99
98
  /** 1 if the button is down, else 0. */
100
99
  getButtonState(buttonNumber: number): number;
101
- }
102
- //#endregion
100
+ }
@@ -1,6 +1,6 @@
1
- import { Vector } from "../vector.js";
2
1
  import { Emitter } from "../emitter.js";
3
- //#region src/input/input.ts
2
+ import { Vector } from "../vector.js";
3
+ // src/input/input.ts
4
4
  const BUTTON_BITS = [
5
5
  1,
6
6
  4,
@@ -239,5 +239,4 @@ var Input = class Input extends Emitter {
239
239
  return this._state[`button${buttonNumber}`]?.state ?? 0;
240
240
  }
241
241
  };
242
- //#endregion
243
242
  export { Input };
package/dist/log.d.ts CHANGED
@@ -1,8 +1,6 @@
1
- //#region src/log.d.ts
2
1
  /**
3
2
  * `console.debug` with a bold gray `[dev]` prefix; takes the same arguments. Visible only when the
4
3
  * console shows verbose/debug messages.
5
4
  * @category Utilities
6
5
  */
7
- export declare const log: (...args: any[]) => void;
8
- //#endregion
6
+ export declare const log: (...args: any[]) => void;
package/dist/log.js CHANGED
@@ -1,9 +1,8 @@
1
- //#region src/log.ts
1
+ // src/log.ts
2
2
  /**
3
3
  * `console.debug` with a bold gray `[dev]` prefix; takes the same arguments. Visible only when the
4
4
  * console shows verbose/debug messages.
5
5
  * @category Utilities
6
6
  */
7
7
  const log = console.debug.bind(console, "%c[dev]", "font-weight: bold; color: #888;");
8
- //#endregion
9
8
  export { log };
package/dist/map2d.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/map2d.d.ts
2
1
  /**
3
2
  * Default "empty" value of a {@link Map2D}: cells holding it are not stored.
4
3
  *
@@ -79,5 +78,4 @@ export declare class Map2D {
79
78
  * O(size), not O(area).
80
79
  */
81
80
  forEachInArea(x1: number, y1: number, x2: number, y2: number, callback: (x: number, y: number, n: number) => void): void;
82
- }
83
- //#endregion
81
+ }
package/dist/map2d.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/map2d.ts
1
+ // src/map2d.ts
2
2
  /**
3
3
  * Default "empty" value of a {@link Map2D}: cells holding it are not stored.
4
4
  *
@@ -116,5 +116,4 @@ var Map2D = class {
116
116
  });
117
117
  }
118
118
  };
119
- //#endregion
120
119
  export { DEFAULT_MAP_2D_VALUE, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, Map2D };
@@ -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 };