@woosh/meep-engine 2.102.0 → 2.103.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 (69) hide show
  1. package/build/meep.cjs +42 -35
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +42 -35
  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/metrics/GoogleAnalyticsMetrics.d.ts +2 -1
  61. package/src/engine/metrics/GoogleAnalyticsMetrics.d.ts.map +1 -1
  62. package/src/engine/metrics/GoogleAnalyticsMetrics.js +4 -39
  63. package/src/engine/notify/NotificationLog.d.ts +1 -2
  64. package/src/engine/notify/NotificationLog.d.ts.map +1 -1
  65. package/src/engine/notify/NotificationLog.js +33 -32
  66. package/src/core/lang/reactive/nearley/Reactive.ne +0 -87
  67. package/src/engine/compression/CompressionService.d.ts +0 -19
  68. package/src/engine/compression/CompressionService.d.ts.map +0 -1
  69. package/src/engine/compression/CompressionService.js +0 -144
package/build/meep.cjs CHANGED
@@ -2478,7 +2478,7 @@ let Vector3$1 = class Vector3 {
2478
2478
  }
2479
2479
 
2480
2480
  /**
2481
- * @param {number} [squaredError=0.01]
2481
+ * @param {number} [squaredError]
2482
2482
  * @return {boolean}
2483
2483
  */
2484
2484
  isNormalized(squaredError = 0.01) {
@@ -47474,10 +47474,8 @@ function v2_dot(x0, y0, x1, y1) {
47474
47474
  class Vector2 {
47475
47475
  /**
47476
47476
  *
47477
- * @param {number} [x=0
47477
+ * @param {number} [x=0]
47478
47478
  * @param {number} [y=0]
47479
- * @property {number} x
47480
- * @property {number} y
47481
47479
  * @constructor
47482
47480
  */
47483
47481
  constructor(x = 0, y = 0) {
@@ -50398,6 +50396,7 @@ class Vector1 extends Number {
50398
50396
  * @param {number} x
50399
50397
  */
50400
50398
  setSilent(x) {
50399
+
50401
50400
  this.x = x;
50402
50401
  }
50403
50402
 
@@ -83406,7 +83405,7 @@ class ModuleRegistry {
83406
83405
  * @param {TaskGroup|Task} t
83407
83406
  * @returns {boolean}
83408
83407
  */
83409
- function isGroup(t) {
83408
+ function isGroupTask(t) {
83410
83409
  return t.children instanceof Array;
83411
83410
  }
83412
83411
 
@@ -83414,7 +83413,12 @@ function isGroup(t) {
83414
83413
  * @class
83415
83414
  */
83416
83415
  class ConcurrentExecutor {
83416
+ /**
83417
+ * How many time-slice cycles have been executed this far. This is a monotonically increasing counter
83418
+ * @type {number}
83419
+ */
83417
83420
  #cycle_count = 0;
83421
+
83418
83422
  /**
83419
83423
  * Handle of the last scheduled `setTimeout`
83420
83424
  * @type {number}
@@ -83526,7 +83530,7 @@ class ConcurrentExecutor {
83526
83530
  const child = children[i];
83527
83531
  child.on.completed.add(subTaskCompleted);
83528
83532
  child.on.failed.add(subTaskFailed);
83529
- if (isGroup(child)) {
83533
+ if (isGroupTask(child)) {
83530
83534
  this.runGroup(child);
83531
83535
  } else {
83532
83536
  this.run(child);
@@ -83549,7 +83553,7 @@ class ConcurrentExecutor {
83549
83553
  for (let i = 0; i < n; i++) {
83550
83554
  const child = children[i];
83551
83555
 
83552
- if (isGroup(child)) {
83556
+ if (isGroupTask(child)) {
83553
83557
  this.removeGroup(child);
83554
83558
  } else {
83555
83559
  this.removeTask(child);
@@ -83646,7 +83650,7 @@ class ConcurrentExecutor {
83646
83650
  }
83647
83651
 
83648
83652
  /**
83649
- * Go through unresolved queue and move tasks who's dependencies have been completed to ready queue or fail them
83653
+ * Go through unresolved queue and move tasks whose dependencies have been completed to ready queue or fail them
83650
83654
  */
83651
83655
  resolveTasks() {
83652
83656
  const queueUnresolved = this.queueUnresolved;
@@ -83683,6 +83687,7 @@ class ConcurrentExecutor {
83683
83687
  /**
83684
83688
  *
83685
83689
  * @param {Task} task
83690
+ * @returns {boolean}
83686
83691
  */
83687
83692
  contains(task) {
83688
83693
  if (this.queueUnresolved.indexOf(task) !== -1) {
@@ -96213,6 +96218,7 @@ const source = typeof performance === "undefined" ? Date : performance;
96213
96218
  * @returns {number}
96214
96219
  */
96215
96220
  function current_time_in_seconds() {
96221
+ // time source produces value in milliseconds, we need to scale to seconds
96216
96222
  return source.now() * 1e-3;
96217
96223
  }
96218
96224
 
@@ -102717,50 +102723,51 @@ Notification.prototype.isNotification = true;
102717
102723
  */
102718
102724
 
102719
102725
 
102720
- function NotificationLog() {
102726
+ class NotificationLog {
102721
102727
  /**
102722
102728
  * @readonly
102723
102729
  * @type {List<Notification>}
102724
102730
  */
102725
- this.elements = new List();
102731
+ elements = new List();
102726
102732
 
102727
102733
  /**
102728
102734
  * Once number of entries in the log reaches this amount, the earliest entries will be removed to make space for new ones
102729
102735
  * @type {number}
102730
102736
  */
102731
- this.maxLength = 1000;
102732
- }
102737
+ maxLength = 1000;
102733
102738
 
102734
- /**
102735
- *
102736
- * @param {{}} options See Notification.constructor for details
102737
- * @returns {Notification}
102738
- */
102739
- NotificationLog.prototype.add = function (options) {
102740
- const notification = new Notification(options);
102739
+ /**
102740
+ *
102741
+ * @param {{}} options See {@link Notification.constructor} for details
102742
+ * @returns {Notification}
102743
+ */
102744
+ add(options) {
102745
+ const notification = new Notification(options);
102741
102746
 
102742
- this.addNotification(notification);
102747
+ this.addNotification(notification);
102743
102748
 
102744
- return notification;
102745
- };
102749
+ return notification;
102750
+ }
102746
102751
 
102747
- /**
102748
- *
102749
- * @param {Notification} notification
102750
- */
102751
- NotificationLog.prototype.addNotification = function (notification) {
102752
+ /**
102753
+ *
102754
+ * @param {Notification} notification
102755
+ */
102756
+ addNotification(notification) {
102752
102757
 
102753
- // Crop notification log to size
102754
- const length = this.elements.length;
102758
+ // Crop notification log to size
102759
+ const length = this.elements.length;
102755
102760
 
102756
- const target = this.maxLength - 1;
102761
+ const target = this.maxLength - 1;
102757
102762
 
102758
- if (length > target) {
102759
- this.elements.crop(length - target, length);
102760
- }
102763
+ if (length > target) {
102764
+ // too many elements, drop some
102765
+ this.elements.crop(length - target, length);
102766
+ }
102761
102767
 
102762
- this.elements.add(notification);
102763
- };
102768
+ this.elements.add(notification);
102769
+ }
102770
+ }
102764
102771
 
102765
102772
  class LogDisplay {
102766
102773
  /**