@woosh/meep-engine 2.86.0 → 2.86.2

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.86.0",
8
+ "version": "2.86.2",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Squared distance between two points in 2d space
3
+ * @param {number} x0
4
+ * @param {number} y0
5
+ * @param {number} x1
6
+ * @param {number} y1
7
+ * @returns {number}
8
+ */
9
+ export function v2_distance_sqr(x0: number, y0: number, x1: number, y1: number): number;
10
+ //# sourceMappingURL=v2_distance_sqr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2_distance_sqr.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec2/v2_distance_sqr.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,oCANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CASlB"}
@@ -0,0 +1,19 @@
1
+ import { assert } from "../../assert.js";
2
+ import { v2_length_sqr } from "./v2_length_sqr.js";
3
+
4
+ /**
5
+ * Squared distance between two points in 2d space
6
+ * @param {number} x0
7
+ * @param {number} y0
8
+ * @param {number} x1
9
+ * @param {number} y1
10
+ * @returns {number}
11
+ */
12
+ export function v2_distance_sqr(x0, y0, x1, y1) {
13
+ assert.isNumber(x0, 'x0');
14
+ assert.isNumber(y0, 'x0');
15
+ assert.isNumber(x1, 'x0');
16
+ assert.isNumber(y1, 'x0');
17
+
18
+ return v2_length_sqr(x1 - x0, y1 - y0);
19
+ }
@@ -1,10 +1,19 @@
1
1
  /**
2
- *
3
- * @param {TerrainOverlay} overlay
4
- * @param {Sampler2D} sampler
5
- * @param {ParameterLookupTable} [lut]
6
- * @param {NumericInterval} range Range of values of interest within the sampler that are to be mapped onto LUT
7
- * @param {function(number):number} [lookupScaleFunction]
2
+ * @param {Object} params
3
+ * @param {TerrainOverlay} params.overlay
4
+ * @param {Sampler2D} params.sampler
5
+ * @param {ParameterLookupTable} [params.lut]
6
+ * @param {NumericInterval} [params.range] Range of values of interest within the sampler that are to be mapped onto LUT
7
+ * @param {function(number):number} [params.lookupScaleFunction]
8
8
  */
9
- export function paintTerrainOverlayViaLookupTable({ overlay, sampler, lut, range, lookupScaleFunction }: TerrainOverlay): void;
9
+ export function paintTerrainOverlayViaLookupTable({ overlay, sampler, lut, range, lookupScaleFunction }: {
10
+ overlay: TerrainOverlay;
11
+ sampler: Sampler2D;
12
+ lut?: ParameterLookupTable;
13
+ range?: NumericInterval;
14
+ lookupScaleFunction?: (arg0: number) => number;
15
+ }): void;
16
+ import { Sampler2D } from "../../../graphics/texture/sampler/Sampler2D.js";
17
+ import { ParameterLookupTable } from "../../../graphics/particles/particular/engine/parameter/ParameterLookupTable.js";
18
+ import { NumericInterval } from "../../../../core/math/interval/NumericInterval.js";
10
19
  //# sourceMappingURL=paintTerrainOverlayViaLookupTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paintTerrainOverlayViaLookupTable.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/util/paintTerrainOverlayViaLookupTable.js"],"names":[],"mappings":"AAkBA;;;;;;;GAOG;AACH,+HAwCC"}
1
+ {"version":3,"file":"paintTerrainOverlayViaLookupTable.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/util/paintTerrainOverlayViaLookupTable.js"],"names":[],"mappings":"AAmBA;;;;;;;GAOG;AACH;IANkC,OAAO;IACZ,OAAO,EAAzB,SAAS;IACqB,GAAG,GAAjC,oBAAoB;IACK,KAAK,GAA9B,eAAe;IACkB,mBAAmB,UAA3C,MAAM,KAAE,MAAM;SA0CjC;0BA9DyB,gDAAgD;qCAFrC,iFAAiF;gCADtF,mDAAmD"}
@@ -1,5 +1,6 @@
1
1
  import { passThrough } from "../../../../core/function/passThrough.js";
2
2
  import { clamp01 } from "../../../../core/math/clamp01.js";
3
+ import { NumericInterval } from "../../../../core/math/interval/NumericInterval.js";
3
4
  import { ParameterLookupTable } from "../../../graphics/particles/particular/engine/parameter/ParameterLookupTable.js";
4
5
  import { sampler2d_scale } from "../../../graphics/texture/sampler/resize/sampler2d_scale.js";
5
6
  import { Sampler2D } from "../../../graphics/texture/sampler/Sampler2D.js";
@@ -17,18 +18,18 @@ heatmap_lut.write([
17
18
  heatmap_lut.computeUniformPositions();
18
19
 
19
20
  /**
20
- *
21
- * @param {TerrainOverlay} overlay
22
- * @param {Sampler2D} sampler
23
- * @param {ParameterLookupTable} [lut]
24
- * @param {NumericInterval} range Range of values of interest within the sampler that are to be mapped onto LUT
25
- * @param {function(number):number} [lookupScaleFunction]
21
+ * @param {Object} params
22
+ * @param {TerrainOverlay} params.overlay
23
+ * @param {Sampler2D} params.sampler
24
+ * @param {ParameterLookupTable} [params.lut]
25
+ * @param {NumericInterval} [params.range] Range of values of interest within the sampler that are to be mapped onto LUT
26
+ * @param {function(number):number} [params.lookupScaleFunction]
26
27
  */
27
28
  export function paintTerrainOverlayViaLookupTable({
28
29
  overlay,
29
30
  sampler,
30
31
  lut = heatmap_lut,
31
- range,
32
+ range = new NumericInterval(0, 1),
32
33
  lookupScaleFunction = passThrough
33
34
  }) {
34
35
  let i, j;