@woosh/meep-engine 2.102.0 → 2.104.0

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 (71) hide show
  1. package/build/meep.cjs +57 -40
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +57 -40
  4. package/package.json +1 -1
  5. package/src/core/geom/2d/circle/Circle.d.ts +0 -8
  6. package/src/core/geom/2d/circle/Circle.d.ts.map +1 -1
  7. package/src/core/geom/2d/circle/Circle.js +85 -85
  8. package/src/core/geom/ConicRay.d.ts +3 -1
  9. package/src/core/geom/ConicRay.d.ts.map +1 -1
  10. package/src/core/geom/ConicRay.js +7 -5
  11. package/src/core/geom/Vector1.d.ts.map +1 -1
  12. package/src/core/geom/Vector1.js +3 -0
  13. package/src/core/geom/Vector2.d.ts.map +1 -1
  14. package/src/core/geom/Vector2.js +6 -3
  15. package/src/core/geom/Vector3.js +1 -1
  16. package/src/core/geom/vec3/v3_angle_cos_between.spec.d.ts +2 -0
  17. package/src/core/geom/vec3/v3_angle_cos_between.spec.d.ts.map +1 -0
  18. package/src/core/geom/vec3/v3_angle_cos_between.spec.js +124 -0
  19. package/src/core/geom/vec3/v3_distance_above_plane.d.ts +13 -4
  20. package/src/core/geom/vec3/v3_distance_sqr.d.ts +12 -1
  21. package/src/core/geom/vec3/v3_length.d.ts +9 -1
  22. package/src/core/lang/reactive/compileReactiveExpression.d.ts.map +1 -1
  23. package/src/core/lang/reactive/compileReactiveExpression.js +1 -3
  24. package/src/core/lang/reactive/pegjs/ReactivePegCompiler.d.ts.map +1 -1
  25. package/src/core/lang/reactive/pegjs/ReactivePegCompiler.js +11 -5
  26. package/src/core/math/PI_RECIPROCAL.d.ts +6 -0
  27. package/src/core/math/PI_RECIPROCAL.d.ts.map +1 -0
  28. package/src/core/math/PI_RECIPROCAL.js +5 -0
  29. package/src/core/math/newton_solver_1d.d.ts +4 -3
  30. package/src/core/math/newton_solver_1d.d.ts.map +1 -1
  31. package/src/core/math/newton_solver_1d.js +4 -3
  32. package/src/core/math/physics/brdf/D_GGX.d.ts.map +1 -1
  33. package/src/core/math/physics/brdf/D_GGX.js +4 -1
  34. package/src/core/math/physics/brdf/brdf_burley.d.ts.map +1 -1
  35. package/src/core/math/physics/brdf/brdf_burley.js +5 -1
  36. package/src/core/math/physics/irradiance/interpolate_irradiance_smith.d.ts.map +1 -1
  37. package/src/core/math/physics/irradiance/interpolate_irradiance_smith.js +3 -3
  38. package/src/core/primitives/strings/insert_after.spec.d.ts +2 -0
  39. package/src/core/primitives/strings/insert_after.spec.d.ts.map +1 -0
  40. package/src/core/primitives/strings/insert_after.spec.js +16 -0
  41. package/src/core/primitives/strings/insert_before.spec.d.ts +2 -0
  42. package/src/core/primitives/strings/insert_before.spec.d.ts.map +1 -0
  43. package/src/core/primitives/strings/insert_before.spec.js +16 -0
  44. package/src/core/process/executor/ConcurrentExecutor.d.ts.map +1 -1
  45. package/src/core/process/executor/ConcurrentExecutor.js +10 -4
  46. package/src/core/time/current_time_in_seconds.d.ts.map +1 -1
  47. package/src/core/time/current_time_in_seconds.js +1 -1
  48. package/src/engine/animation/curve/compute_curve_aabb.d.ts.map +1 -1
  49. package/src/engine/animation/curve/compute_curve_aabb.js +19 -16
  50. package/src/engine/ecs/fow/FogOfWar.d.ts.map +1 -1
  51. package/src/engine/ecs/fow/FogOfWar.js +10 -10
  52. package/src/engine/ecs/fow/FogOfWar.spec.js +5 -6
  53. package/src/engine/google/loadGTAG.d.ts +7 -0
  54. package/src/engine/google/loadGTAG.d.ts.map +1 -0
  55. package/src/engine/google/loadGTAG.js +32 -0
  56. package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField.d.ts.map +1 -1
  57. package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField.js +6 -1
  58. package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField_Chamfer.d.ts.map +1 -1
  59. package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField_Chamfer.js +17 -1
  60. package/src/engine/input/devices/PointerDevice.d.ts.map +1 -1
  61. package/src/engine/input/devices/PointerDevice.js +15 -5
  62. package/src/engine/metrics/GoogleAnalyticsMetrics.d.ts +2 -1
  63. package/src/engine/metrics/GoogleAnalyticsMetrics.d.ts.map +1 -1
  64. package/src/engine/metrics/GoogleAnalyticsMetrics.js +4 -39
  65. package/src/engine/notify/NotificationLog.d.ts +1 -2
  66. package/src/engine/notify/NotificationLog.d.ts.map +1 -1
  67. package/src/engine/notify/NotificationLog.js +33 -32
  68. package/src/core/lang/reactive/nearley/Reactive.ne +0 -87
  69. package/src/engine/compression/CompressionService.d.ts +0 -19
  70. package/src/engine/compression/CompressionService.d.ts.map +0 -1
  71. package/src/engine/compression/CompressionService.js +0 -144
@@ -2476,7 +2476,7 @@ let Vector3$1 = class Vector3 {
2476
2476
  }
2477
2477
 
2478
2478
  /**
2479
- * @param {number} [squaredError=0.01]
2479
+ * @param {number} [squaredError]
2480
2480
  * @return {boolean}
2481
2481
  */
2482
2482
  isNormalized(squaredError = 0.01) {
@@ -47472,10 +47472,8 @@ function v2_dot(x0, y0, x1, y1) {
47472
47472
  class Vector2 {
47473
47473
  /**
47474
47474
  *
47475
- * @param {number} [x=0
47475
+ * @param {number} [x=0]
47476
47476
  * @param {number} [y=0]
47477
- * @property {number} x
47478
- * @property {number} y
47479
47477
  * @constructor
47480
47478
  */
47481
47479
  constructor(x = 0, y = 0) {
@@ -50396,6 +50394,7 @@ class Vector1 extends Number {
50396
50394
  * @param {number} x
50397
50395
  */
50398
50396
  setSilent(x) {
50397
+
50399
50398
  this.x = x;
50400
50399
  }
50401
50400
 
@@ -83404,7 +83403,7 @@ class ModuleRegistry {
83404
83403
  * @param {TaskGroup|Task} t
83405
83404
  * @returns {boolean}
83406
83405
  */
83407
- function isGroup(t) {
83406
+ function isGroupTask(t) {
83408
83407
  return t.children instanceof Array;
83409
83408
  }
83410
83409
 
@@ -83412,7 +83411,12 @@ function isGroup(t) {
83412
83411
  * @class
83413
83412
  */
83414
83413
  class ConcurrentExecutor {
83414
+ /**
83415
+ * How many time-slice cycles have been executed this far. This is a monotonically increasing counter
83416
+ * @type {number}
83417
+ */
83415
83418
  #cycle_count = 0;
83419
+
83416
83420
  /**
83417
83421
  * Handle of the last scheduled `setTimeout`
83418
83422
  * @type {number}
@@ -83524,7 +83528,7 @@ class ConcurrentExecutor {
83524
83528
  const child = children[i];
83525
83529
  child.on.completed.add(subTaskCompleted);
83526
83530
  child.on.failed.add(subTaskFailed);
83527
- if (isGroup(child)) {
83531
+ if (isGroupTask(child)) {
83528
83532
  this.runGroup(child);
83529
83533
  } else {
83530
83534
  this.run(child);
@@ -83547,7 +83551,7 @@ class ConcurrentExecutor {
83547
83551
  for (let i = 0; i < n; i++) {
83548
83552
  const child = children[i];
83549
83553
 
83550
- if (isGroup(child)) {
83554
+ if (isGroupTask(child)) {
83551
83555
  this.removeGroup(child);
83552
83556
  } else {
83553
83557
  this.removeTask(child);
@@ -83644,7 +83648,7 @@ class ConcurrentExecutor {
83644
83648
  }
83645
83649
 
83646
83650
  /**
83647
- * Go through unresolved queue and move tasks who's dependencies have been completed to ready queue or fail them
83651
+ * Go through unresolved queue and move tasks whose dependencies have been completed to ready queue or fail them
83648
83652
  */
83649
83653
  resolveTasks() {
83650
83654
  const queueUnresolved = this.queueUnresolved;
@@ -83681,6 +83685,7 @@ class ConcurrentExecutor {
83681
83685
  /**
83682
83686
  *
83683
83687
  * @param {Task} task
83688
+ * @returns {boolean}
83684
83689
  */
83685
83690
  contains(task) {
83686
83691
  if (this.queueUnresolved.indexOf(task) !== -1) {
@@ -91414,6 +91419,12 @@ class PointerDevice {
91414
91419
  */
91415
91420
  #target = null;
91416
91421
 
91422
+ /**
91423
+ *
91424
+ * @type {Element|null}
91425
+ */
91426
+ #domElement = null;
91427
+
91417
91428
  /**
91418
91429
  * @private
91419
91430
  * @type {boolean}
@@ -91467,7 +91478,7 @@ class PointerDevice {
91467
91478
  *
91468
91479
  * @type {EventTarget}
91469
91480
  */
91470
- this.domElement = domElement;
91481
+ this.#domElement = domElement;
91471
91482
 
91472
91483
 
91473
91484
  this.#touchStart.add((param0, param1, param2) => {
@@ -91636,9 +91647,9 @@ class PointerDevice {
91636
91647
  *
91637
91648
  * @param {Element} el
91638
91649
  */
91639
- setTargetElement(el) {
91650
+ set domElement(el) {
91640
91651
 
91641
- if (this.#target === el) {
91652
+ if (this.#domElement === el) {
91642
91653
  // no change
91643
91654
  return;
91644
91655
  }
@@ -91650,7 +91661,7 @@ class PointerDevice {
91650
91661
  this.stop();
91651
91662
  }
91652
91663
 
91653
- this.#target = el;
91664
+ this.#domElement = el;
91654
91665
 
91655
91666
  if (was_running) {
91656
91667
  // restart to maintain original state
@@ -91658,6 +91669,10 @@ class PointerDevice {
91658
91669
  }
91659
91670
  }
91660
91671
 
91672
+ get domElement() {
91673
+ return this.#domElement;
91674
+ }
91675
+
91661
91676
  /**
91662
91677
  *
91663
91678
  * @param {Vector2} result
@@ -91677,7 +91692,7 @@ class PointerDevice {
91677
91692
 
91678
91693
  // console.warn("PointerDevice.start");
91679
91694
 
91680
- const domElement = this.domElement;
91695
+ const domElement = this.#domElement;
91681
91696
 
91682
91697
  domElement.addEventListener(MouseEvents.Move, this.#eventHandlerMouseMove);
91683
91698
  domElement.addEventListener(MouseEvents.Up, this.#eventHandlerMouseUp);
@@ -96211,6 +96226,7 @@ const source = typeof performance === "undefined" ? Date : performance;
96211
96226
  * @returns {number}
96212
96227
  */
96213
96228
  function current_time_in_seconds() {
96229
+ // time source produces value in milliseconds, we need to scale to seconds
96214
96230
  return source.now() * 1e-3;
96215
96231
  }
96216
96232
 
@@ -102715,50 +102731,51 @@ Notification.prototype.isNotification = true;
102715
102731
  */
102716
102732
 
102717
102733
 
102718
- function NotificationLog() {
102734
+ class NotificationLog {
102719
102735
  /**
102720
102736
  * @readonly
102721
102737
  * @type {List<Notification>}
102722
102738
  */
102723
- this.elements = new List();
102739
+ elements = new List();
102724
102740
 
102725
102741
  /**
102726
102742
  * Once number of entries in the log reaches this amount, the earliest entries will be removed to make space for new ones
102727
102743
  * @type {number}
102728
102744
  */
102729
- this.maxLength = 1000;
102730
- }
102745
+ maxLength = 1000;
102731
102746
 
102732
- /**
102733
- *
102734
- * @param {{}} options See Notification.constructor for details
102735
- * @returns {Notification}
102736
- */
102737
- NotificationLog.prototype.add = function (options) {
102738
- const notification = new Notification(options);
102747
+ /**
102748
+ *
102749
+ * @param {{}} options See {@link Notification.constructor} for details
102750
+ * @returns {Notification}
102751
+ */
102752
+ add(options) {
102753
+ const notification = new Notification(options);
102739
102754
 
102740
- this.addNotification(notification);
102755
+ this.addNotification(notification);
102741
102756
 
102742
- return notification;
102743
- };
102757
+ return notification;
102758
+ }
102744
102759
 
102745
- /**
102746
- *
102747
- * @param {Notification} notification
102748
- */
102749
- NotificationLog.prototype.addNotification = function (notification) {
102760
+ /**
102761
+ *
102762
+ * @param {Notification} notification
102763
+ */
102764
+ addNotification(notification) {
102750
102765
 
102751
- // Crop notification log to size
102752
- const length = this.elements.length;
102766
+ // Crop notification log to size
102767
+ const length = this.elements.length;
102753
102768
 
102754
- const target = this.maxLength - 1;
102769
+ const target = this.maxLength - 1;
102755
102770
 
102756
- if (length > target) {
102757
- this.elements.crop(length - target, length);
102758
- }
102771
+ if (length > target) {
102772
+ // too many elements, drop some
102773
+ this.elements.crop(length - target, length);
102774
+ }
102759
102775
 
102760
- this.elements.add(notification);
102761
- };
102776
+ this.elements.add(notification);
102777
+ }
102778
+ }
102762
102779
 
102763
102780
  class LogDisplay {
102764
102781
  /**
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.102.0",
8
+ "version": "2.104.0",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1,12 +1,4 @@
1
1
  export default Circle;
2
- /**
3
- * A circle or a 2-dimensional sphere. Represented as a position (x,y) and radius (r)
4
- * @param {Number} [x=0]
5
- * @param {Number} [y=0]
6
- * @param {Number} [r=0]
7
- * @constructor
8
- */
9
- declare function Circle(x?: number, y?: number, r?: number): void;
10
2
  declare class Circle {
11
3
  /**
12
4
  * A circle or a 2-dimensional sphere. Represented as a position (x,y) and radius (r)
@@ -1 +1 @@
1
- {"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/circle/Circle.js"],"names":[],"mappings":";AAEA;;;;;;GAMG;AACH,kEAkBC;;IAzBD;;;;;;OAMG;IACH,gDAkBC;IAjBG;;;OAGG;IACH,UAAU;IAEV;;;OAGG;IACH,UAAU;IAEV;;;OAGG;IACH,UAAU;IAGd;;;OAGG;IACH,oCAEC;IAED;;;;OAIG;IACH,2CAGC;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,OAAO,CAYnB;IAED;;;;OAIG;IACH,cAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;OAKG;IACH,OAJW,MAAM,KACN,MAAM,KACN,MAAM,QAOhB;IAED;;;OAGG;IACH,YAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,SAFa,MAAM,CAMlB"}
1
+ {"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/circle/Circle.js"],"names":[],"mappings":";AAEA;IACI;;;;;;OAMG;IACH,gDAkBC;IAjBG;;;OAGG;IACH,UAAU;IAEV;;;OAGG;IACH,UAAU;IAEV;;;OAGG;IACH,UAAU;IAGd;;;OAGG;IACH,oCAEC;IAED;;;;OAIG;IACH,2CAGC;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,OAAO,CAYnB;IAED;;;;OAIG;IACH,cAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;OAKG;IACH,OAJW,MAAM,KACN,MAAM,KACN,MAAM,QAOhB;IAED;;;OAGG;IACH,YAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,SAFa,MAAM,CAIlB;CACJ"}
@@ -1,105 +1,105 @@
1
1
  import { circle_intersects_circle } from "./circle_intersects_circle.js";
2
2
 
3
- /**
4
- * A circle or a 2-dimensional sphere. Represented as a position (x,y) and radius (r)
5
- * @param {Number} [x=0]
6
- * @param {Number} [y=0]
7
- * @param {Number} [r=0]
8
- * @constructor
9
- */
10
- function Circle(x = 0, y = 0, r = 0) {
3
+ class Circle {
11
4
  /**
12
- * Position along X axis
13
- * @type {Number}
5
+ * A circle or a 2-dimensional sphere. Represented as a position (x,y) and radius (r)
6
+ * @param {Number} [x=0]
7
+ * @param {Number} [y=0]
8
+ * @param {Number} [r=0]
9
+ * @constructor
14
10
  */
15
- this.x = x;
11
+ constructor(x = 0, y = 0, r = 0) {
12
+ /**
13
+ * Position along X axis
14
+ * @type {Number}
15
+ */
16
+ this.x = x;
17
+
18
+ /**
19
+ * Position along Y axis
20
+ * @type {Number}
21
+ */
22
+ this.y = y;
23
+
24
+ /**
25
+ * Radius
26
+ * @type {Number}
27
+ */
28
+ this.r = r;
29
+ }
16
30
 
17
31
  /**
18
- * Position along Y axis
19
- * @type {Number}
32
+ *
33
+ * @param {Vector2} target
20
34
  */
21
- this.y = y;
35
+ readPosition(target) {
36
+ target.set(this.x, this.y);
37
+ }
22
38
 
23
39
  /**
24
- * Radius
25
- * @type {Number}
40
+ *
41
+ * @param {Number} deltaX
42
+ * @param {Number} deltaY
26
43
  */
27
- this.r = r;
28
- }
29
-
30
- /**
31
- *
32
- * @param {Vector2} target
33
- */
34
- Circle.prototype.readPosition = function (target) {
35
- target.set(this.x, this.y);
36
- };
37
-
38
- /**
39
- *
40
- * @param {Number} deltaX
41
- * @param {Number} deltaY
42
- */
43
- Circle.prototype.move = function (deltaX, deltaY) {
44
- this.x += deltaX;
45
- this.y += deltaY;
46
- };
44
+ move(deltaX, deltaY) {
45
+ this.x += deltaX;
46
+ this.y += deltaY;
47
+ }
47
48
 
48
- /**
49
- *
50
- * @param {Circle} other
51
- * @returns {boolean}
52
- */
53
- Circle.prototype.overlaps = function (other) {
54
- const x0 = this.x;
55
- const y0 = this.y;
56
- const r0 = this.r;
57
-
58
- const x1 = other.x;
59
- const y1 = other.y;
60
- const r1 = other.r;
49
+ /**
50
+ *
51
+ * @param {Circle} other
52
+ * @returns {boolean}
53
+ */
54
+ overlaps(other) {
55
+ const x0 = this.x;
56
+ const y0 = this.y;
57
+ const r0 = this.r;
61
58
 
62
- return circle_intersects_circle(x0, y0, r0, x1, y1, r1);
63
- };
59
+ const x1 = other.x;
60
+ const y1 = other.y;
61
+ const r1 = other.r;
64
62
 
65
- /**
66
- *
67
- * @param {Circle} other
68
- * @returns {boolean}
69
- */
70
- Circle.prototype.equals = function (other) {
71
- return this.x === other.x && this.y === other.y && this.r === other.r;
72
- };
63
+ return circle_intersects_circle(x0, y0, r0, x1, y1, r1);
64
+ }
73
65
 
74
- /**
75
- *
76
- * @param {number} x
77
- * @param {number} y
78
- * @param {number} r
79
- */
80
- Circle.prototype.set = function (x, y, r) {
81
- this.x = x;
82
- this.y = y;
66
+ /**
67
+ *
68
+ * @param {Circle} other
69
+ * @returns {boolean}
70
+ */
71
+ equals(other) {
72
+ return this.x === other.x && this.y === other.y && this.r === other.r;
73
+ }
83
74
 
84
- this.r = r;
85
- };
75
+ /**
76
+ *
77
+ * @param {number} x
78
+ * @param {number} y
79
+ * @param {number} r
80
+ */
81
+ set(x, y, r) {
82
+ this.x = x;
83
+ this.y = y;
86
84
 
87
- /**
88
- *
89
- * @param {Circle} other
90
- */
91
- Circle.prototype.copy = function (other) {
92
- this.set(other.x, other.y, other.r);
93
- };
85
+ this.r = r;
86
+ }
94
87
 
95
- /**
96
- *
97
- * @returns {Circle}
98
- */
99
- Circle.prototype.clone = function () {
100
- const result = new Circle(this.x, this.y, this.r);
88
+ /**
89
+ *
90
+ * @param {Circle} other
91
+ */
92
+ copy(other) {
93
+ this.set(other.x, other.y, other.r);
94
+ }
101
95
 
102
- return result;
103
- };
96
+ /**
97
+ *
98
+ * @returns {Circle}
99
+ */
100
+ clone() {
101
+ return new Circle(this.x, this.y, this.r);
102
+ }
103
+ }
104
104
 
105
105
  export default Circle;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Represents a direction vector+angle
3
3
  * Mainly used inside particle systems for pick a motion direction at spawn
4
+ * @copyright "Company Named Limited"
4
5
  */
5
6
  export class ConicRay {
6
7
  /**
@@ -14,9 +15,10 @@ export class ConicRay {
14
15
  static fromScalars(x: number, y: number, z: number, angle: number): ConicRay;
15
16
  /**
16
17
  * Must be normalized
18
+ * @readonly
17
19
  * @type {Vector3}
18
20
  */
19
- direction: Vector3;
21
+ readonly direction: Vector3;
20
22
  /**
21
23
  * Half-angle of the cone, that is the angle between the center axis and the edge of the cone
22
24
  * In radians
@@ -1 +1 @@
1
- {"version":3,"file":"ConicRay.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/ConicRay.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH;IA2KI;;;;;;;OAOG;IACH,sBANW,MAAM,KACN,MAAM,KACN,MAAM,SACN,MAAM,GACJ,QAAQ,CAWpB;IA1LD;;;OAGG;IACH,WAFU,OAAO,CAEgB;IAEjC;;;;OAIG;IACH,OAFU,MAAM,CAEN;IAEV;;;MAKC;IAED,0BAGC;IAED;;;OAGG;IACH,2CAGC;IAED;;;OAGG;IACH,6CAMC;IAED;;;;OAIG;IACH,cAHW,QAAQ,GACN,OAAO,CAInB;IAED;;;;;OAKG;IACH,qBAJW,QAAQ,cACR,MAAM,GACJ,OAAO,CAKnB;IAED,eAKC;IAED;;;OAGG;IACH,YAFW,QAAQ,QAKlB;IAED;;;;OAIG;IACH,4BAHW,OAAO,GACL,OAAO,CAMnB;IAED;;;;;OAKG;IACH,gDAFW,OAAO,QAsEjB;CAoBJ;oBApMmB,cAAc"}
1
+ {"version":3,"file":"ConicRay.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/ConicRay.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH;IA4KI;;;;;;;OAOG;IACH,sBANW,MAAM,KACN,MAAM,KACN,MAAM,SACN,MAAM,GACJ,QAAQ,CAWpB;IA3LD;;;;OAIG;IACH,oBAFU,OAAO,CAEgB;IAEjC;;;;OAIG;IACH,OAFU,MAAM,CAEN;IAEV;;;MAKC;IAED,0BAGC;IAED;;;OAGG;IACH,2CAGC;IAED;;;OAGG;IACH,6CAMC;IAED;;;;OAIG;IACH,cAHW,QAAQ,GACN,OAAO,CAInB;IAED;;;;;OAKG;IACH,qBAJW,QAAQ,cACR,MAAM,GACJ,OAAO,CAKnB;IAED,eAKC;IAED;;;OAGG;IACH,YAFW,QAAQ,QAKlB;IAED;;;;OAIG;IACH,4BAHW,OAAO,GACL,OAAO,CAMnB;IAED;;;;;OAKG;IACH,gDAFW,OAAO,QAsEjB;CAoBJ;oBAtMmB,cAAc"}
@@ -1,19 +1,21 @@
1
- import {assert} from "../assert.js";
2
- import {computeHashIntegerArray} from "../collection/array/computeHashIntegerArray.js";
3
- import {EPSILON} from "../math/EPSILON.js";
4
- import {epsilonEquals} from "../math/epsilonEquals.js";
5
- import {computeHashFloat} from "../primitives/numbers/computeHashFloat.js";
1
+ import { assert } from "../assert.js";
2
+ import { computeHashIntegerArray } from "../collection/array/computeHashIntegerArray.js";
3
+ import { EPSILON } from "../math/EPSILON.js";
4
+ import { epsilonEquals } from "../math/epsilonEquals.js";
5
+ import { computeHashFloat } from "../primitives/numbers/computeHashFloat.js";
6
6
  import Vector3 from "./Vector3.js";
7
7
 
8
8
 
9
9
  /**
10
10
  * Represents a direction vector+angle
11
11
  * Mainly used inside particle systems for pick a motion direction at spawn
12
+ * @copyright "Company Named Limited"
12
13
  */
13
14
  export class ConicRay {
14
15
 
15
16
  /**
16
17
  * Must be normalized
18
+ * @readonly
17
19
  * @type {Vector3}
18
20
  */
19
21
  direction = new Vector3(0, 1, 0);
@@ -1 +1 @@
1
- {"version":3,"file":"Vector1.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector1.js"],"names":[],"mappings":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aAMP,OAAO;;mBAtSE,4BAA4B"}
1
+ {"version":3,"file":"Vector1.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector1.js"],"names":[],"mappings":";AAWA;IA2PI;;;;;OAKG;IACH,kBAJW,OAAO,KACP,OAAO,GACN,MAAM,CAIjB;IAlQD;;;;;;OAMG;IACH,gBALW,MAAM,EAchB;IAHG,UAAU;IAEV,0DAA6B;IAWjC;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,iBAHW,OAAO,GACL,MAAM,CAIlB;IAED;;;;OAIG;IACH,OAHW,MAAM,GACJ,OAAO,CAgBnB;IAED;;;OAGG;IACH,aAFW,MAAM,QAOhB;IAED;;;OAGG;IACH,UAFY,OAAO,CAIlB;IAED,kBAEC;IAED,kBAEC;IAED;;;;OAIG;IACH,iBAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,WAFW,OAAO,8BAAwB,WAIzC;IAED;;;;OAIG;IACH,iBAFY,OAAO,CAIlB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,OAAO,CAInB;IAED;;;;OAIG;IACH,gBAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,kBAFW,MAAM,QAIhB;IAED;;;;;OAKG;IACH,WAJW,MAAM,QACN,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,YAFW,OAAO,8BAAwB,QAIzC;IAED;;;OAGG;IACH,SAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,cAHW,OAAO,GACL,OAAO,CAInB;IAED;;OAEG;IACH,QAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,4BAGC;IAED,iBAEC;IAED,yBAEC;IAED;;;;OAIG;IACH,qBAHW,MAAM,EAAE,WACR,MAAM,QAIhB;IAED;;;;OAIG;IACH,oBAHW,MAAM,EAAE,WACR,MAAM,QAIhB;IAED,oBAEC;IAED;;;OAGG;IACH,2CAEC;IAED;;;OAGG;IACH,6CAIC;IAgBD,mBAEC;IAND,gBAEC;IAaL;;;OAGG;IACH,oBAFU,OAAO,CAEU;IAXvB,sDAIC;CACJ;;;cAYS,OAAO;aAMP,OAAO;;mBAzSE,4BAA4B"}
@@ -87,6 +87,9 @@ class Vector1 extends Number {
87
87
  * @param {number} x
88
88
  */
89
89
  setSilent(x) {
90
+ assert.isNumber( x,'x');
91
+ assert.notNaN(x, 'x');
92
+
90
93
  this.x = x;
91
94
  }
92
95
 
@@ -1 +1 @@
1
- {"version":3,"file":"Vector2.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector2.js"],"names":[],"mappings":";AAmBA;IACI;;;;;;;OAOG;IACH,gBANW,MAAM,cA0BhB;IAbG;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV,0DAA6B;IAGjC;;;;OAIG;IACH,qBAHW,MAAM,EAAE,WACR,MAAM,QAOhB;IAED;;;;OAIG;IACH,oBAHW,MAAM,EAAE,WACR,MAAM,QAKhB;IAED,iBAMC;IAED;;;;;OAKG;IACH,OAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAqBnB;IAED;;;;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAOhB;IAED;;;;OAIG;IACH,QAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,QAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;OAKG;IACH,QAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,OAAO,CAInB;IAED;;;;OAIG;IACH,cAHW,OAAO,KACP,OAAO,QAIjB;IAED;;;OAGG;IACH,SAFa,OAAO,CAInB;IAED;;;OAGG;IACH,QAFa,OAAO,CAInB;IAED;;OAEG;IACH,cAIC;IAED;;;OAGG;IACH,OAFa,OAAO,CAInB;IAED;;;;;OAKG;IACH,QAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;O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AAM,CAIlB;IAED;;;;OAIG;IACH,2BAHW,OAAO,GACL,MAAM,CAOlB;IAED;;OAEG;IACH,UAFa,MAAM,CAIlB;IAED;;OAEG;IACH,kBAWC;IAGD;;;OAGG;IACH,QAFa,MAAM,CAOlB;IAED;;;OAGG;IACH,cAFW,MAAM,QAahB;IAED;;;;;OAKG;IACH,6CAFa,OAAO,CAQnB;IAED,mBAEC;IAED;;;;OAIG;IACH,cAHW,OAAO,GACL,OAAO,CAInB;IAED;;;;;OAKG;IACH,qBAJW,OAAO,cACP,MAAM,GACL,OAAO,CAIlB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,cACN,MAAM,GACL,OAAO,CAKlB;IAUD,mBAEC;IAVD,gBAEC;IAUD,mBAEC;IAVD,gBAEC;IAsDL;;;OAGG;IACH,oBAFU,OAAO,CAEU;IA/CvB,sDAKC;CACJ;;mBAIS,OAAO;qBAMP,OAAO;qBAMP,OAAO;sBAMP,OAAO;qBAMP,OAAO;oBAKP,OAAO;;;mBA/pBE,4BAA4B;4BAQnB,uBAAuB"}
1
+ {"version":3,"file":"Vector2.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector2.js"],"names":[],"mappings":";AAmBA;IACI;;;;;OAKG;IACH,gBAJW,MAAM,MACN,MAAM,EAuBhB;IAbG;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV,0DAA6B;IAGjC;;;;OAIG;IACH,qBAHW,MAAM,EAAE,WACR,MAAM,QAOhB;IAED;;;;OAIG;IACH,oBAHW,MAAM,EAAE,WACR,MAAM,QAKhB;IAED,iBAMC;IAED;;;;;OAKG;IACH,OAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAqBnB;IAED;;;;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAYhB;IAED;;;;OAIG;IACH,QAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,QAHW,MAAM,GACJ,OAAO,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;OAIG;IACH,8CAIC;IAED;;;;OAIG;IACH,iDAIC;IAED;;;;OAIG;IACH,qBAHW,OAAO,GACL,MAAM,CAIlB;IAED;;;;;OAKG;IACH,eAJW,OAAO,KACP,OAAO,YACP,MAAM,QAOhB;IAED;;;OAGG;IACH,sBAFW,MAAM,EAAE,QAUlB;IAED;;;;OAIG;IACH,kBAHW,OAAO,GACL,MAAM,CAIlB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,KACN,MAAM,GACJ,MAAM,CAMlB;IAED;;;;;OAKG;IACH,eAJW,MAAM,KACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,2BAHW,OAAO,GACL,MAAM,CAOlB;IAED;;OAEG;IACH,UAFa,MAAM,CAIlB;IAED;;OAEG;IACH,kBAWC;IAGD;;;OAGG;IACH,QAFa,MAAM,CAOlB;IAED;;;OAGG;IACH,cAFW,MAAM,QAahB;IAED;;;;;OAKG;IACH,6CAFa,OAAO,CAQnB;IAED,mBAEC;IAED;;;;OAIG;IACH,cAHW,OAAO,GACL,OAAO,CAInB;IAED;;;;;OAKG;IACH,qBAJW,OAAO,cACP,MAAM,GACL,OAAO,CAIlB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,cACN,MAAM,GACL,OAAO,CAKlB;IAUD,mBAEC;IAVD,gBAEC;IAUD,mBAEC;IAVD,gBAEC;IAsDL;;;OAGG;IACH,oBAFU,OAAO,CAEU;IA/CvB,sDAKC;CACJ;;mBAIS,OAAO;qBAMP,OAAO;qBAMP,OAAO;sBAMP,OAAO;qBAMP,OAAO;oBAKP,OAAO;;;mBAlqBE,4BAA4B;4BAQnB,uBAAuB"}
@@ -20,10 +20,8 @@ import { v2_magnitude } from "./vec2/v2_magnitude.js";
20
20
  class Vector2 {
21
21
  /**
22
22
  *
23
- * @param {number} [x=0
23
+ * @param {number} [x=0]
24
24
  * @param {number} [y=0]
25
- * @property {number} x
26
- * @property {number} y
27
25
  * @constructor
28
26
  */
29
27
  constructor(x = 0, y = 0) {
@@ -111,6 +109,11 @@ class Vector2 {
111
109
  * @param {number} y
112
110
  */
113
111
  setSilent(x, y) {
112
+ assert.isNumber(x, 'x');
113
+ assert.isNumber(y, 'y');
114
+
115
+ assert.notNaN(x, 'x');
116
+ assert.notNaN(y, 'y');
114
117
 
115
118
  this.x = x;
116
119
  this.y = y;
@@ -407,7 +407,7 @@ class Vector3 {
407
407
  }
408
408
 
409
409
  /**
410
- * @param {number} [squaredError=0.01]
410
+ * @param {number} [squaredError]
411
411
  * @return {boolean}
412
412
  */
413
413
  isNormalized(squaredError = 0.01) {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=v3_angle_cos_between.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3_angle_cos_between.spec.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_angle_cos_between.spec.js"],"names":[],"mappings":""}