@woosh/meep-engine 2.119.8 → 2.119.10

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 (90) hide show
  1. package/package.json +1 -1
  2. package/src/core/color/hex/hex2rgb.js +1 -1
  3. package/src/core/color/operations/color_darken.d.ts +1 -0
  4. package/src/core/color/operations/color_darken.d.ts.map +1 -1
  5. package/src/core/color/operations/color_darken.js +1 -0
  6. package/src/core/color/operations/color_desaturate.d.ts +1 -0
  7. package/src/core/color/operations/color_desaturate.d.ts.map +1 -1
  8. package/src/core/color/operations/color_desaturate.js +1 -0
  9. package/src/core/color/operations/color_lerp.d.ts +11 -0
  10. package/src/core/color/operations/color_lerp.d.ts.map +1 -0
  11. package/src/core/color/operations/color_lerp.js +35 -0
  12. package/src/core/color/operations/color_lighten.d.ts +1 -0
  13. package/src/core/color/operations/color_lighten.d.ts.map +1 -1
  14. package/src/core/color/operations/color_lighten.js +1 -0
  15. package/src/core/color/operations/color_saturate.d.ts +1 -0
  16. package/src/core/color/operations/color_saturate.d.ts.map +1 -1
  17. package/src/core/color/operations/color_saturate.js +1 -0
  18. package/src/core/color/parse_color.d.ts.map +1 -1
  19. package/src/core/color/parse_color.js +2 -1
  20. package/src/core/debug/matchers/AllOf.d.ts.map +1 -1
  21. package/src/core/debug/matchers/AllOf.js +1 -1
  22. package/src/core/debug/matchers/IsAnything.d.ts +1 -1
  23. package/src/core/debug/matchers/IsAnything.d.ts.map +1 -1
  24. package/src/core/debug/matchers/IsAnything.js +1 -1
  25. package/src/core/debug/matchers/IsIn.d.ts +4 -1
  26. package/src/core/debug/matchers/IsIn.d.ts.map +1 -1
  27. package/src/core/debug/matchers/IsIn.js +3 -0
  28. package/src/core/debug/matchers/IsNot.d.ts +6 -3
  29. package/src/core/debug/matchers/IsNot.d.ts.map +1 -1
  30. package/src/core/debug/matchers/IsNot.js +6 -3
  31. package/src/core/debug/matchers/matchers.d.ts +3 -3
  32. package/src/core/debug/matchers/matchers.d.ts.map +1 -1
  33. package/src/core/debug/matchers/matchers.js +9 -9
  34. package/src/core/geom/3d/compute_triangle_normal.js +1 -1
  35. package/src/core/geom/3d/cone/computeConeBoundingBox.d.ts +1 -1
  36. package/src/core/geom/3d/cone/computeConeBoundingBox.d.ts.map +1 -1
  37. package/src/core/geom/3d/cone/computeConeBoundingBox.js +9 -2
  38. package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +2 -2
  39. package/src/core/geom/3d/ray/ray3_array_apply_matrix4.d.ts.map +1 -1
  40. package/src/core/geom/3d/ray/ray3_array_apply_matrix4.js +5 -35
  41. package/src/core/geom/3d/ray/{ray_computeNearestPointToPoint.d.ts → ray3_compute_nearest_point_to_point.d.ts} +2 -2
  42. package/src/core/geom/3d/ray/ray3_compute_nearest_point_to_point.d.ts.map +1 -0
  43. package/src/core/geom/3d/ray/{ray_computeNearestPointToPoint.js → ray3_compute_nearest_point_to_point.js} +2 -2
  44. package/src/core/geom/3d/ray/ray3_distance_to_point.d.ts +2 -0
  45. package/src/core/geom/3d/ray/ray3_distance_to_point.d.ts.map +1 -0
  46. package/src/core/geom/3d/ray/{ray_distance_to_point.js → ray3_distance_to_point.js} +2 -2
  47. package/src/core/geom/3d/topology/simplify/compute_face_normal_change_dot_product.js +1 -1
  48. package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts.map +1 -0
  49. package/src/core/geom/3d/{v3_compute_triangle_normal.js → triangle/v3_compute_triangle_normal.js} +1 -1
  50. package/src/core/geom/vec3/v3_negate_array.d.ts.map +1 -0
  51. package/src/core/math/random/randomFromArray.d.ts +2 -2
  52. package/src/core/math/random/randomFromArray.js +2 -2
  53. package/src/engine/ecs/EntityReference.d.ts +1 -1
  54. package/src/engine/ecs/gui/position/ViewportPositionSystem.d.ts.map +1 -1
  55. package/src/engine/ecs/gui/position/ViewportPositionSystem.js +3 -0
  56. package/src/engine/graphics/geometry/geometry_construct_triangle_normal.js +1 -1
  57. package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.js +1 -1
  58. package/src/engine/physics/gjk/expanding_polytope_algorithm.js +2 -2
  59. package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.d.ts.map +1 -1
  60. package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.js +11 -6
  61. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +4 -4
  62. package/src/engine/sound/ecs/emitter/SoundTrack.d.ts +9 -3
  63. package/src/engine/sound/ecs/emitter/SoundTrack.d.ts.map +1 -1
  64. package/src/engine/sound/ecs/emitter/SoundTrack.js +17 -1
  65. package/src/view/tooltip/TooltipManager.d.ts +9 -0
  66. package/src/view/tooltip/TooltipManager.d.ts.map +1 -1
  67. package/src/view/tooltip/TooltipManager.js +27 -16
  68. package/src/core/geom/2d/shape/AbstractShape.d.ts +0 -31
  69. package/src/core/geom/2d/shape/AbstractShape.d.ts.map +0 -1
  70. package/src/core/geom/2d/shape/AbstractShape.js +0 -51
  71. package/src/core/geom/2d/shape/CircleShape.d.ts +0 -47
  72. package/src/core/geom/2d/shape/CircleShape.d.ts.map +0 -1
  73. package/src/core/geom/2d/shape/CircleShape.js +0 -109
  74. package/src/core/geom/2d/shape/PointShape.d.ts +0 -21
  75. package/src/core/geom/2d/shape/PointShape.d.ts.map +0 -1
  76. package/src/core/geom/2d/shape/PointShape.js +0 -34
  77. package/src/core/geom/2d/shape/Shape2DType.d.ts +0 -7
  78. package/src/core/geom/2d/shape/Shape2DType.d.ts.map +0 -1
  79. package/src/core/geom/2d/shape/Shape2DType.js +0 -9
  80. package/src/core/geom/3d/ray/ray_computeNearestPointToPoint.d.ts.map +0 -1
  81. package/src/core/geom/3d/ray/ray_distance_to_point.d.ts +0 -2
  82. package/src/core/geom/3d/ray/ray_distance_to_point.d.ts.map +0 -1
  83. package/src/core/geom/3d/v3_compute_triangle_normal.d.ts.map +0 -1
  84. package/src/core/geom/3d/v3_negate_array.d.ts.map +0 -1
  85. package/src/core/math/random/seededRandom_sine.d.ts +0 -2
  86. package/src/core/math/random/seededRandom_sine.d.ts.map +0 -1
  87. package/src/core/math/random/seededRandom_sine.js +0 -33
  88. /package/src/core/geom/3d/{v3_compute_triangle_normal.d.ts → triangle/v3_compute_triangle_normal.d.ts} +0 -0
  89. /package/src/core/geom/{3d → vec3}/v3_negate_array.d.ts +0 -0
  90. /package/src/core/geom/{3d → vec3}/v3_negate_array.js +0 -0
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.119.8",
8
+ "version": "2.119.10",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -17,7 +17,7 @@ export function hex2rgb(hex) {
17
17
  if (hex.length > 7) {
18
18
  result.a = hex2dec(hex.slice(7, 9));
19
19
  }else{
20
- result.a = 1;
20
+ result.a = 0xFF;
21
21
  }
22
22
 
23
23
  return result;
@@ -2,6 +2,7 @@
2
2
  *
3
3
  * @param {Color} input
4
4
  * @param {number} [amount]
5
+ * @returns {Color}
5
6
  */
6
7
  export function color_darken(input: Color, amount?: number): Color;
7
8
  import { Color } from "../Color.js";
@@ -1 +1 @@
1
- {"version":3,"file":"color_darken.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_darken.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,oCAHW,KAAK,WACL,MAAM,SAehB;sBAxBqB,aAAa"}
1
+ {"version":3,"file":"color_darken.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_darken.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,oCAJW,KAAK,WACL,MAAM,GACJ,KAAK,CAejB;sBAzBqB,aAAa"}
@@ -10,6 +10,7 @@ const hsv = [0, 0, 0];
10
10
  *
11
11
  * @param {Color} input
12
12
  * @param {number} [amount]
13
+ * @returns {Color}
13
14
  */
14
15
  export function color_darken(input, amount = 1) {
15
16
  assert.isNumber(amount, 'amount');
@@ -2,6 +2,7 @@
2
2
  *
3
3
  * @param {Color} input
4
4
  * @param {number} [amount]
5
+ * @returns {Color}
5
6
  */
6
7
  export function color_desaturate(input: Color, amount?: number): Color;
7
8
  import { Color } from "../Color.js";
@@ -1 +1 @@
1
- {"version":3,"file":"color_desaturate.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_desaturate.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wCAHW,KAAK,WACL,MAAM,SAehB;sBAxBqB,aAAa"}
1
+ {"version":3,"file":"color_desaturate.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_desaturate.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,wCAJW,KAAK,WACL,MAAM,GACJ,KAAK,CAejB;sBAzBqB,aAAa"}
@@ -10,6 +10,7 @@ const hsv = [0, 0, 0];
10
10
  *
11
11
  * @param {Color} input
12
12
  * @param {number} [amount]
13
+ * @returns {Color}
13
14
  */
14
15
  export function color_desaturate(input, amount=1) {
15
16
  assert.isNumber(amount,'amount');
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Performs linear interpolation of two colors in perceptual color space,
3
+ * Useful for palette generation and other use cases where perceptual likeness is important
4
+ * @param {Color} color_0
5
+ * @param {Color} color_1
6
+ * @param {number} t
7
+ * @returns {Color}
8
+ */
9
+ export function color_lerp(color_0: Color, color_1: Color, t: number): Color;
10
+ import { Color } from "../Color.js";
11
+ //# sourceMappingURL=color_lerp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color_lerp.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_lerp.js"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,oCALW,KAAK,WACL,KAAK,KACL,MAAM,GACJ,KAAK,CAkBjB;sBAhCqB,aAAa"}
@@ -0,0 +1,35 @@
1
+ import { assert } from "../../assert.js";
2
+ import { lerp } from "../../math/lerp.js";
3
+ import { Color } from "../Color.js";
4
+ import { linear_srgb_to_okhsv } from "../oklab/linear_srgb_to_okhsv.js";
5
+ import { okhsv_to_linear_srgb } from "../oklab/okhsv_to_linear_srgb.js";
6
+
7
+ const hsv_0 = [0, 0, 0];
8
+ const hsv_1 = [0, 0, 0];
9
+ const hsv_2 = [0, 0, 0];
10
+
11
+ /**
12
+ * Performs linear interpolation of two colors in perceptual color space,
13
+ * Useful for palette generation and other use cases where perceptual likeness is important
14
+ * @param {Color} color_0
15
+ * @param {Color} color_1
16
+ * @param {number} t
17
+ * @returns {Color}
18
+ */
19
+ export function color_lerp(color_0, color_1, t) {
20
+ assert.isNumber(t, 't');
21
+
22
+ const r = new Color();
23
+
24
+ linear_srgb_to_okhsv(hsv_0, color_0.r, color_0.g, color_0.b);
25
+ linear_srgb_to_okhsv(hsv_1, color_1.r, color_1.g, color_1.b);
26
+
27
+ for (let i = 0; i < 3; i++) {
28
+ hsv_2[i] = lerp(hsv_0[i], hsv_1[i], t);
29
+ }
30
+
31
+ okhsv_to_linear_srgb(r, ...hsv_2);
32
+ r.a = lerp(color_0.a, color_1.a, t);
33
+
34
+ return r;
35
+ }
@@ -2,6 +2,7 @@
2
2
  *
3
3
  * @param {Color} input
4
4
  * @param {number} amount
5
+ * @returns {Color}
5
6
  */
6
7
  export function color_lighten(input: Color, amount?: number): Color;
7
8
  import { Color } from "../Color.js";
@@ -1 +1 @@
1
- {"version":3,"file":"color_lighten.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_lighten.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,qCAHW,KAAK,WACL,MAAM,SAehB;sBAxBqB,aAAa"}
1
+ {"version":3,"file":"color_lighten.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_lighten.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,qCAJW,KAAK,WACL,MAAM,GACJ,KAAK,CAejB;sBAzBqB,aAAa"}
@@ -10,6 +10,7 @@ const hsv = [0, 0, 0];
10
10
  *
11
11
  * @param {Color} input
12
12
  * @param {number} amount
13
+ * @returns {Color}
13
14
  */
14
15
  export function color_lighten(input, amount = 1) {
15
16
  assert.isNumber(amount, 'amount');
@@ -2,6 +2,7 @@
2
2
  *
3
3
  * @param {Color} input
4
4
  * @param {number} [amount]
5
+ * @returns {Color}
5
6
  */
6
7
  export function color_saturate(input: Color, amount?: number): Color;
7
8
  import { Color } from "../Color.js";
@@ -1 +1 @@
1
- {"version":3,"file":"color_saturate.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_saturate.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,sCAHW,KAAK,WACL,MAAM,SAehB;sBAxBqB,aAAa"}
1
+ {"version":3,"file":"color_saturate.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_saturate.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,sCAJW,KAAK,WACL,MAAM,GACJ,KAAK,CAejB;sBAzBqB,aAAa"}
@@ -10,6 +10,7 @@ const hsv = [0,0,0];
10
10
  *
11
11
  * @param {Color} input
12
12
  * @param {number} [amount]
13
+ * @returns {Color}
13
14
  */
14
15
  export function color_saturate(input, amount=1) {
15
16
  assert.isNumber(amount,'amount');
@@ -1 +1 @@
1
- {"version":3,"file":"parse_color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/parse_color.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,+BAHW,MAAM,GAAC,MAAM,GACX,MAAM,EAAE,CAsEpB"}
1
+ {"version":3,"file":"parse_color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/parse_color.js"],"names":[],"mappings":"AASA;;;;GAIG;AACH,+BAHW,MAAM,GAAC,MAAM,GACX,MAAM,EAAE,CAsEpB"}
@@ -1,3 +1,4 @@
1
+ import { uint8_to_float } from "../binary/uint8_to_float.js";
1
2
  import { hex2rgb } from "./hex/hex2rgb.js";
2
3
  import { hsv2rgb } from "./hsv/hsv2rgb.js";
3
4
 
@@ -56,7 +57,7 @@ export function parse_color(c) {
56
57
  r = rgb.r;
57
58
  g = rgb.g;
58
59
  b = rgb.b;
59
- a = rgb.a;
60
+ a = uint8_to_float(rgb.a);
60
61
 
61
62
 
62
63
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"AllOf.d.ts","sourceRoot":"","sources":["../../../../../src/core/debug/matchers/AllOf.js"],"names":[],"mappings":"AAIA;IAMI;;;OAGG;IACH,sBAFW,cAAS,EAMnB;IAED,uDAYC;IAED,mCAEC;;CACJ;4BAnC2B,mBAAmB;wBAFvB,eAAe"}
1
+ {"version":3,"file":"AllOf.d.ts","sourceRoot":"","sources":["../../../../../src/core/debug/matchers/AllOf.js"],"names":[],"mappings":"AAIA;IAMI;;;OAGG;IACH,sBAFW,cAAS,EAMnB;IAED,uDAYC;IAED,mCAEC;;CACJ;4BArC2B,mBAAmB;wBACvB,eAAe"}
@@ -1,6 +1,6 @@
1
+ import { BaseMatcher } from "../BaseMatcher.js";
1
2
  import { Matcher } from "../Matcher.js";
2
3
  import { NullDescription } from "../NullDescription.js";
3
- import { BaseMatcher } from "../BaseMatcher.js";
4
4
 
5
5
  export class AllOf extends BaseMatcher {
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  export class IsAnything extends BaseMatcher {
2
2
  constructor(message?: string);
3
3
  message: string;
4
- matches(item: any, mismatch_description?: any): boolean;
4
+ matches(item: any, mismatch_description: any): boolean;
5
5
  describeTo(description: any): void;
6
6
  }
7
7
  import { BaseMatcher } from "../BaseMatcher.js";
@@ -1 +1 @@
1
- {"version":3,"file":"IsAnything.d.ts","sourceRoot":"","sources":["../../../../../src/core/debug/matchers/IsAnything.js"],"names":[],"mappings":"AAEA;IAGI,8BAIC;IAND,gBAAO;IAQP,wDAEC;IAED,mCAEC;CACJ;4BAlB2B,mBAAmB"}
1
+ {"version":3,"file":"IsAnything.d.ts","sourceRoot":"","sources":["../../../../../src/core/debug/matchers/IsAnything.js"],"names":[],"mappings":"AAEA;IAGI,8BAIC;IAND,gBAAO;IAQP,uDAEC;IAED,mCAEC;CACJ;4BAlB2B,mBAAmB"}
@@ -9,7 +9,7 @@ export class IsAnything extends BaseMatcher {
9
9
  this.message = message;
10
10
  }
11
11
 
12
- matches(item, mismatch_description = NullDescription.INSTANCE) {
12
+ matches(item, mismatch_description) {
13
13
  return false;
14
14
  }
15
15
 
@@ -2,7 +2,10 @@
2
2
  * @template T
3
3
  */
4
4
  export class IsIn<T> extends BaseMatcher {
5
- constructor(collection: any);
5
+ /**
6
+ * @param {T[]} collection
7
+ */
8
+ constructor(collection: T[]);
6
9
  matches(item: any, mismatch_description: any): boolean;
7
10
  describeTo(description: any): void;
8
11
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"IsIn.d.ts","sourceRoot":"","sources":["../../../../../src/core/debug/matchers/IsIn.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAMI,6BAIC;IAED,uDAEC;IAED,mCAGC;;CAEJ;4BA1B2B,mBAAmB"}
1
+ {"version":3,"file":"IsIn.d.ts","sourceRoot":"","sources":["../../../../../src/core/debug/matchers/IsIn.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAMI;;OAEG;IACH,wBAFW,CAAC,EAAE,EAMb;IAED,uDAEC;IAED,mCAGC;;CAEJ;4BA7B2B,mBAAmB"}
@@ -9,6 +9,9 @@ export class IsIn extends BaseMatcher {
9
9
  */
10
10
  #collection = []
11
11
 
12
+ /**
13
+ * @param {T[]} collection
14
+ */
12
15
  constructor(collection) {
13
16
  super();
14
17
 
@@ -1,9 +1,12 @@
1
- export class IsNot extends BaseMatcher {
1
+ /**
2
+ * @template T
3
+ */
4
+ export class IsNot<T> extends BaseMatcher {
2
5
  /**
3
6
  *
4
- * @param {Matcher} matcher
7
+ * @param {Matcher<T>} matcher
5
8
  */
6
- constructor(matcher: Matcher<any>);
9
+ constructor(matcher: Matcher<T>);
7
10
  matches(item: any, mismatch_description: any): boolean;
8
11
  describeTo(description: any): void;
9
12
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"IsNot.d.ts","sourceRoot":"","sources":["../../../../../src/core/debug/matchers/IsNot.js"],"names":[],"mappings":"AAGA;IAMI;;;OAGG;IACH,mCAGC;IAED,uDAEC;IAED,mCAEC;;CACJ;4BAxB2B,mBAAmB;wBADvB,eAAe"}
1
+ {"version":3,"file":"IsNot.d.ts","sourceRoot":"","sources":["../../../../../src/core/debug/matchers/IsNot.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAMI;;;OAGG;IACH,qBAFW,QAAQ,CAAC,CAAC,EAKpB;IAED,uDAEC;IAED,mCAEC;;CACJ;4BA5B2B,mBAAmB;wBACvB,eAAe"}
@@ -1,15 +1,18 @@
1
- import { Matcher } from "../Matcher.js";
2
1
  import { BaseMatcher } from "../BaseMatcher.js";
2
+ import { Matcher } from "../Matcher.js";
3
3
 
4
+ /**
5
+ * @template T
6
+ */
4
7
  export class IsNot extends BaseMatcher {
5
8
  /**
6
- * @type {Matcher}
9
+ * @type {Matcher<T>}
7
10
  */
8
11
  #matcher
9
12
 
10
13
  /**
11
14
  *
12
- * @param {Matcher} matcher
15
+ * @param {Matcher<T>} matcher
13
16
  */
14
17
  constructor(matcher) {
15
18
  super();
@@ -49,11 +49,11 @@ export function isUndefined<T_1>(): Matcher<T_1>;
49
49
  */
50
50
  export function isDefined<T_1>(): Matcher<T_1>;
51
51
  /**
52
- * @template
52
+ * @template T
53
53
  * @param {Matcher|T} value
54
54
  * @return {Matcher<T>}
55
55
  */
56
- export function hasItem(value: Matcher<any> | T): Matcher<T>;
56
+ export function hasItem<T_1>(value: Matcher<any> | T_1): Matcher<T_1>;
57
57
  /**
58
58
  * @template T
59
59
  * @param {T[]} array
@@ -83,6 +83,6 @@ export function nothing<T_1>(message?: string): Matcher<T_1>;
83
83
  * @template T
84
84
  * @return {Matcher<T>}
85
85
  */
86
- export function isNoUndefined<T_1>(): Matcher<T_1>;
86
+ export function isNotUndefined<T_1>(): Matcher<T_1>;
87
87
  import { Matcher } from "../Matcher.js";
88
88
  //# sourceMappingURL=matchers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"matchers.d.ts","sourceRoot":"","sources":["../../../../../src/core/debug/matchers/matchers.js"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,oEAEC;AAED;;;;GAIG;AACH,oEAEC;AAED;;;;GAIG;AACH,8DAEC;AAED;;;;GAIG;AACH,uDAEC;AAED;;;;GAIG;AACH,0DAEC;AAED;;;GAGG;AACH,4CAEC;AAED;;;GAGG;AACH,+CAEC;AAED;;;GAGG;AACH,iDAEC;AAED;;;GAGG;AACH,+CAEC;AAQD;;;;GAIG;AACH,+BAHW,eAAQ,CAAC,GACR,QAAQ,CAAC,CAAC,CAQrB;AAED;;;;GAIG;AACH,sDAEC;AAGD;;;;GAIG;AACH,6DAEC;AAcD;;;;;GAKG;AACH,wCAHW,MAAM,gBAKhB;AAED;;;;GAIG;AACH,uCAHW,MAAM,gBAWhB;AAjFD;;;GAGG;AACH,mDAEC;wBAjFuB,eAAe"}
1
+ {"version":3,"file":"matchers.d.ts","sourceRoot":"","sources":["../../../../../src/core/debug/matchers/matchers.js"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,oEAEC;AAED;;;;GAIG;AACH,oEAEC;AAED;;;;GAIG;AACH,8DAEC;AAED;;;;GAIG;AACH,uDAEC;AAED;;;;GAIG;AACH,0DAEC;AAED;;;GAGG;AACH,4CAEC;AAED;;;GAGG;AACH,+CAEC;AAED;;;GAGG;AACH,iDAEC;AAED;;;GAGG;AACH,+CAEC;AAQD;;;;GAIG;AACH,sEAMC;AAED;;;;GAIG;AACH,sDAEC;AAGD;;;;GAIG;AACH,6DAEC;AAcD;;;;;GAKG;AACH,wCAHW,MAAM,gBAKhB;AAED;;;;GAIG;AACH,uCAHW,MAAM,gBAWhB;AAjFD;;;GAGG;AACH,oDAEC;wBAvFuB,eAAe"}
@@ -1,14 +1,14 @@
1
- import { AnyOf } from "./AnyOf.js";
1
+ import { Matcher } from "../Matcher.js";
2
2
  import { AllOf } from "./AllOf.js";
3
- import { IsNot } from "./IsNot.js";
3
+ import { AnyOf } from "./AnyOf.js";
4
+ import { DescribeAs } from "./DescribeAs.js";
5
+ import { IsAnything } from "./IsAnything.js";
4
6
  import { IsEqual } from "./IsEqual.js";
5
- import { IsNull } from "./IsNull.js";
7
+ import { IsIn } from "./IsIn.js";
6
8
  import { IsIterableContaining } from "./IsIterableContaining.js";
7
- import { Matcher } from "../Matcher.js";
9
+ import { IsNot } from "./IsNot.js";
10
+ import { IsNull } from "./IsNull.js";
8
11
  import { IsUndefined } from "./IsUndefined.js";
9
- import { IsIn } from "./IsIn.js";
10
- import { IsAnything } from "./IsAnything.js";
11
- import { DescribeAs } from "./DescribeAs.js";
12
12
 
13
13
  /**
14
14
  * @template T
@@ -91,10 +91,10 @@ export function isDefined() {
91
91
  * @template T
92
92
  * @return {Matcher<T>}
93
93
  */
94
- export const isNoUndefined = isDefined;
94
+ export const isNotUndefined = isDefined;
95
95
 
96
96
  /**
97
- * @template
97
+ * @template T
98
98
  * @param {Matcher|T} value
99
99
  * @return {Matcher<T>}
100
100
  */
@@ -1,4 +1,4 @@
1
- import { v3_compute_triangle_normal } from "./v3_compute_triangle_normal.js";
1
+ import { v3_compute_triangle_normal } from "./triangle/v3_compute_triangle_normal.js";
2
2
 
3
3
  /**
4
4
  *
@@ -7,7 +7,7 @@
7
7
  * @param {number} directionX
8
8
  * @param {number} directionY
9
9
  * @param {number} directionZ
10
- * @param {number} angle
10
+ * @param {number} angle in Radians
11
11
  * @param {number} length
12
12
  */
13
13
  export function computeConeBoundingBox(result: number[] | ArrayLike<number> | Float32Array, originX: number, originY: number, originZ: number, directionX: number, directionY: number, directionZ: number, angle: number, length: number): void;
@@ -1 +1 @@
1
- {"version":3,"file":"computeConeBoundingBox.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/cone/computeConeBoundingBox.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,+CAVW,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,WACvC,MAAM,WACN,MAAM,WACN,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,SACN,MAAM,UACN,MAAM,QAoChB"}
1
+ {"version":3,"file":"computeConeBoundingBox.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/cone/computeConeBoundingBox.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,+CAVW,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,WACvC,MAAM,WACN,MAAM,WACN,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,SACN,MAAM,UACN,MAAM,QA2ChB"}
@@ -11,10 +11,17 @@ import { v3_angle_between } from "../../vec3/v3_angle_between.js";
11
11
  * @param {number} directionX
12
12
  * @param {number} directionY
13
13
  * @param {number} directionZ
14
- * @param {number} angle
14
+ * @param {number} angle in Radians
15
15
  * @param {number} length
16
16
  */
17
- export function computeConeBoundingBox(result, originX, originY, originZ, directionX, directionY, directionZ, angle, length) {
17
+ export function computeConeBoundingBox(
18
+ result,
19
+ originX, originY, originZ,
20
+ directionX, directionY, directionZ,
21
+ angle,
22
+ length
23
+ ) {
24
+
18
25
  const ax = v3_angle_between(directionX, directionY, directionZ, 1, 0, 0);
19
26
  const ay = v3_angle_between(directionX, directionY, directionZ, 0, 1, 0);
20
27
  const az = v3_angle_between(directionX, directionY, directionZ, 0, 0, 1);
@@ -5,7 +5,7 @@ import { plane3_project_point } from "../plane/plane3_project_point.js";
5
5
  import {
6
6
  plane3_three_compute_convex_3_plane_intersection
7
7
  } from "../plane/plane3_three_compute_convex_3_plane_intersection.js";
8
- import { ray_computeNearestPointToPoint } from "../ray/ray_computeNearestPointToPoint.js";
8
+ import { ray3_compute_nearest_point_to_point } from "../ray/ray3_compute_nearest_point_to_point.js";
9
9
 
10
10
  /**
11
11
  *
@@ -88,7 +88,7 @@ export function frustum3_computeNearestPointToPoint(result, planes, target_x, ta
88
88
  throw new Error('Planes are parallel and do not intersect, likely an invalid frustum');
89
89
  }
90
90
 
91
- ray_computeNearestPointToPoint(result,
91
+ ray3_compute_nearest_point_to_point(result,
92
92
  scratch_v3_0.x, scratch_v3_0.y, scratch_v3_0.z,
93
93
  scratch_v3_1.x, scratch_v3_1.y, scratch_v3_1.z,
94
94
  target_x, target_y, target_z
@@ -1 +1 @@
1
- {"version":3,"file":"ray3_array_apply_matrix4.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/ray/ray3_array_apply_matrix4.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,iDAPW,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,iBACvC,MAAM,SACN,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,gBACvC,MAAM,MACN,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,GACrC,OAAO,CAkDnB"}
1
+ {"version":3,"file":"ray3_array_apply_matrix4.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/ray/ray3_array_apply_matrix4.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,iDAPW,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,iBACvC,MAAM,SACN,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,gBACvC,MAAM,MACN,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,GACrC,OAAO,CAmBnB"}
@@ -1,4 +1,5 @@
1
- import { v3_length } from "../../vec3/v3_length.js";
1
+ import { v3_array_matrix4_rotate } from "../../vec3/v3_array_matrix4_rotate.js";
2
+ import { v3_matrix4_multiply } from "../../vec3/v3_matrix4_multiply.js";
2
3
 
3
4
  /**
4
5
  *
@@ -10,14 +11,11 @@ import { v3_length } from "../../vec3/v3_length.js";
10
11
  * @returns {boolean} false if matrix transformation is impossible, such as when scale of the matrix is 0
11
12
  */
12
13
  export function ray3_array_apply_matrix4(output, output_offset, input, input_offset, m4) {
14
+
13
15
  const origin_x = input[input_offset + 0];
14
16
  const origin_y = input[input_offset + 1];
15
17
  const origin_z = input[input_offset + 2];
16
18
 
17
- const direction_x = input[input_offset + 3];
18
- const direction_y = input[input_offset + 4];
19
- const direction_z = input[input_offset + 5];
20
-
21
19
  // transform ray to local space (inlined for speed)
22
20
  const det = m4[3] * origin_x + m4[7] * origin_y + m4[11] * origin_z + m4[15];
23
21
 
@@ -25,36 +23,8 @@ export function ray3_array_apply_matrix4(output, output_offset, input, input_off
25
23
  return false;
26
24
  }
27
25
 
28
- const inv_w = 1 / det;
29
-
30
- const out_origin_x = (m4[0] * origin_x + m4[4] * origin_y + m4[8] * origin_z + m4[12]) * inv_w;
31
- const out_origin_y = (m4[1] * origin_x + m4[5] * origin_y + m4[9] * origin_z + m4[13]) * inv_w;
32
- const out_origin_z = (m4[2] * origin_x + m4[6] * origin_y + m4[10] * origin_z + m4[14]) * inv_w;
33
-
34
- const out_direction_x = m4[0] * direction_x + m4[4] * direction_y + m4[8] * direction_z;
35
- const out_direction_y = m4[1] * direction_x + m4[5] * direction_y + m4[9] * direction_z;
36
- const out_direction_z = m4[2] * direction_x + m4[6] * direction_y + m4[10] * direction_z;
37
-
38
- // normalize direction
39
- const out_direction_magnitude = v3_length(out_direction_x, out_direction_y, out_direction_z);
40
-
41
- if (out_direction_magnitude === 0) {
42
- return false;
43
- }
44
-
45
- const out_direction_magnitude_inverse = 1 / out_direction_magnitude;
46
-
47
- const out_direction_normalized_x = out_direction_x * out_direction_magnitude_inverse;
48
- const out_direction_normalized_y = out_direction_y * out_direction_magnitude_inverse;
49
- const out_direction_normalized_z = out_direction_z * out_direction_magnitude_inverse;
50
-
51
- output[output_offset + 0] = out_origin_x;
52
- output[output_offset + 1] = out_origin_y;
53
- output[output_offset + 2] = out_origin_z;
54
-
55
- output[output_offset + 3] = out_direction_normalized_x;
56
- output[output_offset + 4] = out_direction_normalized_y;
57
- output[output_offset + 5] = out_direction_normalized_z;
26
+ v3_matrix4_multiply(output, output_offset, input, input_offset, m4);
27
+ v3_array_matrix4_rotate(output, output_offset + 3, input, input_offset + 3, m4);
58
28
 
59
29
  return true;
60
30
  }
@@ -12,5 +12,5 @@
12
12
  * @param {number} pz
13
13
  * @returns {number} distance from origin, negative means that the point lies behind the origin in the direction opposite to the ray's own
14
14
  */
15
- export function ray_computeNearestPointToPoint(result: Vector3, origin_x: number, origin_y: number, origin_z: number, direction_x: number, direction_y: number, direction_z: number, px: number, py: number, pz: number): number;
16
- //# sourceMappingURL=ray_computeNearestPointToPoint.d.ts.map
15
+ export function ray3_compute_nearest_point_to_point(result: Vector3, origin_x: number, origin_y: number, origin_z: number, direction_x: number, direction_y: number, direction_z: number, px: number, py: number, pz: number): number;
16
+ //# sourceMappingURL=ray3_compute_nearest_point_to_point.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ray3_compute_nearest_point_to_point.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/ray/ray3_compute_nearest_point_to_point.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,+EAXW,MAAM,YACN,MAAM,YACN,MAAM,eACN,MAAM,eACN,MAAM,eACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CA4BlB"}
@@ -14,14 +14,14 @@ import { v3_dot } from "../../vec3/v3_dot.js";
14
14
  * @param {number} pz
15
15
  * @returns {number} distance from origin, negative means that the point lies behind the origin in the direction opposite to the ray's own
16
16
  */
17
- export function ray_computeNearestPointToPoint(
17
+ export function ray3_compute_nearest_point_to_point(
18
18
  result,
19
19
  origin_x, origin_y, origin_z,
20
20
  direction_x, direction_y, direction_z,
21
21
  px, py, pz
22
22
  ) {
23
23
 
24
- // find closest point
24
+ // find the closest point
25
25
  const sp0_x = px - origin_x;
26
26
  const sp0_y = py - origin_y;
27
27
  const sp0_z = pz - origin_z;
@@ -0,0 +1,2 @@
1
+ export function ray3_distance_to_point(origin_x: any, origin_y: any, origin_z: any, direction_x: any, direction_y: any, direction_z: any, ref_x: any, ref_y: any, ref_z: any): number;
2
+ //# sourceMappingURL=ray3_distance_to_point.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ray3_distance_to_point.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/ray/ray3_distance_to_point.js"],"names":[],"mappings":"AAEA,sLAWC"}
@@ -1,7 +1,7 @@
1
1
  import { v3_dot } from "../../vec3/v3_dot.js";
2
2
 
3
- export function ray_distance_to_point(origin_x, origin_y, origin_z, direction_x, direction_y, direction_z,ref_x, ref_y, ref_z){
4
- // find closest point
3
+ export function ray3_distance_to_point(origin_x, origin_y, origin_z, direction_x, direction_y, direction_z, ref_x, ref_y, ref_z){
4
+ // find the closest point
5
5
  const sp0_x = ref_x - origin_x;
6
6
  const sp0_y = ref_y - origin_y;
7
7
  const sp0_z = ref_z - origin_z;
@@ -1,5 +1,5 @@
1
1
  import { v3_dot } from "../../../vec3/v3_dot.js";
2
- import { v3_compute_triangle_normal } from "../../v3_compute_triangle_normal.js";
2
+ import { v3_compute_triangle_normal } from "../../triangle/v3_compute_triangle_normal.js";
3
3
 
4
4
  const scratch_normal = new Float32Array(6);
5
5
 
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3_compute_triangle_normal.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/triangle/v3_compute_triangle_normal.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,mDAZW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,QA0ChB"}
@@ -1,4 +1,4 @@
1
- import { v3_length_sqr } from "../vec3/v3_length_sqr.js";
1
+ import { v3_length_sqr } from "../../vec3/v3_length_sqr.js";
2
2
 
3
3
  /**
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3_negate_array.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_negate_array.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wCALW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,SACN,MAAM,EAAE,GAAC,YAAY,gBACrB,MAAM,QAUhB"}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @template T
3
- * @param {function} random
3
+ * @param {function} random if you don't have a custom RNG, you can always pass {@link Math.random} instead
4
4
  * @param {T[]} array
5
- * @returns {T}
5
+ * @returns {T|undefined} returns undefined only if that value is in the array or if array is empty
6
6
  */
7
7
  export function randomFromArray<T>(random: Function, array: T[]): T;
8
8
  //# sourceMappingURL=randomFromArray.d.ts.map
@@ -3,9 +3,9 @@ import { randomIntegerBetween } from "./randomIntegerBetween.js";
3
3
 
4
4
  /**
5
5
  * @template T
6
- * @param {function} random
6
+ * @param {function} random if you don't have a custom RNG, you can always pass {@link Math.random} instead
7
7
  * @param {T[]} array
8
- * @returns {T}
8
+ * @returns {T|undefined} returns undefined only if that value is in the array or if array is empty
9
9
  */
10
10
  export function randomFromArray(random, array) {
11
11
  assert.isArray(array, 'array');
@@ -28,7 +28,7 @@ export class EntityReference {
28
28
  */
29
29
  equals(other: EntityReference): boolean;
30
30
  /**
31
- *
31
+ * Checks whether referenced entity exists and the generation matches
32
32
  * @param {EntityComponentDataset} ecd
33
33
  * @returns {boolean}
34
34
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ViewportPositionSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/gui/position/ViewportPositionSystem.js"],"names":[],"mappings":";AAsBA;IACI,+BAoBC;IAjBG,8DAAkD;IAElD,kEAEC;IAED,kBAAgC;IAEhC,yCAME;IAEF,SAAc;IAGlB,0EAIC;IAED,2EAIC;IAED;;;OAGG;IACH,sBAHW,UAAU,MACV,gBAAgB,QAkE1B;IAED;;;;;OAKG;IACH,SAJW,gBAAgB,MAChB,UAAU,qBA2BpB;IAED;;;;;OAKG;IACH,WAJW,gBAAgB,MAChB,UAAU,qBAmBpB;IA4EL;;;OAGG;IACH,mCAFU,OAAO,CAEwC;CA7ExD;uBAlLsB,iBAAiB;uBACjB,kBAAkB;6BAEZ,uBAAuB;4CAJR,uDAAuD;8BAJrE,iDAAiD"}
1
+ {"version":3,"file":"ViewportPositionSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/gui/position/ViewportPositionSystem.js"],"names":[],"mappings":";AAsBA;IACI,+BAoBC;IAjBG,8DAAkD;IAElD,kEAEC;IAED,kBAAgC;IAEhC,yCAME;IAEF,SAAc;IAGlB,0EAIC;IAED,2EAIC;IAED;;;OAGG;IACH,sBAHW,UAAU,MACV,gBAAgB,QAkE1B;IAED;;;;;OAKG;IACH,SAJW,gBAAgB,MAChB,UAAU,qBA8BpB;IAED;;;;;OAKG;IACH,WAJW,gBAAgB,MAChB,UAAU,qBAmBpB;IA4EL;;;OAGG;IACH,mCAFU,OAAO,CAEwC;CA7ExD;uBArLsB,iBAAiB;uBACjB,kBAAkB;6BAEZ,uBAAuB;4CAJR,uDAAuD;8BAJrE,iDAAiD"}
@@ -152,6 +152,9 @@ class ViewportPositionSystem extends System {
152
152
  vp.anchor.onChanged.add(updatePosition, eventContext);
153
153
  vp.enabled.onChanged.add(updatePosition, eventContext);
154
154
 
155
+ // track size of the element as that has an impact as well
156
+ el.view.size.onChanged.add(updatePosition, eventContext);
157
+
155
158
  this.entityManager.dataset.addEntityEventListener(entity, GUIElementEvent.Initialized, updatePosition, eventContext);
156
159
 
157
160
  el.view.addClass(CSS_CLASS);