@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.
- package/build/meep.cjs +42 -35
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +42 -35
- package/package.json +1 -1
- package/src/core/geom/2d/circle/Circle.d.ts +0 -8
- package/src/core/geom/2d/circle/Circle.d.ts.map +1 -1
- package/src/core/geom/2d/circle/Circle.js +85 -85
- package/src/core/geom/ConicRay.d.ts +3 -1
- package/src/core/geom/ConicRay.d.ts.map +1 -1
- package/src/core/geom/ConicRay.js +7 -5
- package/src/core/geom/Vector1.d.ts.map +1 -1
- package/src/core/geom/Vector1.js +3 -0
- package/src/core/geom/Vector2.d.ts.map +1 -1
- package/src/core/geom/Vector2.js +6 -3
- package/src/core/geom/Vector3.js +1 -1
- package/src/core/geom/vec3/v3_angle_cos_between.spec.d.ts +2 -0
- package/src/core/geom/vec3/v3_angle_cos_between.spec.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_angle_cos_between.spec.js +124 -0
- package/src/core/geom/vec3/v3_distance_above_plane.d.ts +13 -4
- package/src/core/geom/vec3/v3_distance_sqr.d.ts +12 -1
- package/src/core/geom/vec3/v3_length.d.ts +9 -1
- package/src/core/lang/reactive/compileReactiveExpression.d.ts.map +1 -1
- package/src/core/lang/reactive/compileReactiveExpression.js +1 -3
- package/src/core/lang/reactive/pegjs/ReactivePegCompiler.d.ts.map +1 -1
- package/src/core/lang/reactive/pegjs/ReactivePegCompiler.js +11 -5
- package/src/core/math/PI_RECIPROCAL.d.ts +6 -0
- package/src/core/math/PI_RECIPROCAL.d.ts.map +1 -0
- package/src/core/math/PI_RECIPROCAL.js +5 -0
- package/src/core/math/newton_solver_1d.d.ts +4 -3
- package/src/core/math/newton_solver_1d.d.ts.map +1 -1
- package/src/core/math/newton_solver_1d.js +4 -3
- package/src/core/math/physics/brdf/D_GGX.d.ts.map +1 -1
- package/src/core/math/physics/brdf/D_GGX.js +4 -1
- package/src/core/math/physics/brdf/brdf_burley.d.ts.map +1 -1
- package/src/core/math/physics/brdf/brdf_burley.js +5 -1
- package/src/core/math/physics/irradiance/interpolate_irradiance_smith.d.ts.map +1 -1
- package/src/core/math/physics/irradiance/interpolate_irradiance_smith.js +3 -3
- package/src/core/primitives/strings/insert_after.spec.d.ts +2 -0
- package/src/core/primitives/strings/insert_after.spec.d.ts.map +1 -0
- package/src/core/primitives/strings/insert_after.spec.js +16 -0
- package/src/core/primitives/strings/insert_before.spec.d.ts +2 -0
- package/src/core/primitives/strings/insert_before.spec.d.ts.map +1 -0
- package/src/core/primitives/strings/insert_before.spec.js +16 -0
- package/src/core/process/executor/ConcurrentExecutor.d.ts.map +1 -1
- package/src/core/process/executor/ConcurrentExecutor.js +10 -4
- package/src/core/time/current_time_in_seconds.d.ts.map +1 -1
- package/src/core/time/current_time_in_seconds.js +1 -1
- package/src/engine/animation/curve/compute_curve_aabb.d.ts.map +1 -1
- package/src/engine/animation/curve/compute_curve_aabb.js +19 -16
- package/src/engine/ecs/fow/FogOfWar.d.ts.map +1 -1
- package/src/engine/ecs/fow/FogOfWar.js +10 -10
- package/src/engine/ecs/fow/FogOfWar.spec.js +5 -6
- package/src/engine/google/loadGTAG.d.ts +7 -0
- package/src/engine/google/loadGTAG.d.ts.map +1 -0
- package/src/engine/google/loadGTAG.js +32 -0
- package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField.js +6 -1
- package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField_Chamfer.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/distance/computeUnsignedDistanceField_Chamfer.js +17 -1
- package/src/engine/metrics/GoogleAnalyticsMetrics.d.ts +2 -1
- package/src/engine/metrics/GoogleAnalyticsMetrics.d.ts.map +1 -1
- package/src/engine/metrics/GoogleAnalyticsMetrics.js +4 -39
- package/src/engine/notify/NotificationLog.d.ts +1 -2
- package/src/engine/notify/NotificationLog.d.ts.map +1 -1
- package/src/engine/notify/NotificationLog.js +33 -32
- package/src/core/lang/reactive/nearley/Reactive.ne +0 -87
- package/src/engine/compression/CompressionService.d.ts +0 -19
- package/src/engine/compression/CompressionService.d.ts.map +0 -1
- 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
|
|
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
|
|
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 (
|
|
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 (
|
|
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
|
|
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
|
-
|
|
102726
|
+
class NotificationLog {
|
|
102721
102727
|
/**
|
|
102722
102728
|
* @readonly
|
|
102723
102729
|
* @type {List<Notification>}
|
|
102724
102730
|
*/
|
|
102725
|
-
|
|
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
|
-
|
|
102732
|
-
}
|
|
102737
|
+
maxLength = 1000;
|
|
102733
102738
|
|
|
102734
|
-
/**
|
|
102735
|
-
|
|
102736
|
-
|
|
102737
|
-
|
|
102738
|
-
|
|
102739
|
-
|
|
102740
|
-
|
|
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
|
-
|
|
102747
|
+
this.addNotification(notification);
|
|
102743
102748
|
|
|
102744
|
-
|
|
102745
|
-
}
|
|
102749
|
+
return notification;
|
|
102750
|
+
}
|
|
102746
102751
|
|
|
102747
|
-
/**
|
|
102748
|
-
|
|
102749
|
-
|
|
102750
|
-
|
|
102751
|
-
|
|
102752
|
+
/**
|
|
102753
|
+
*
|
|
102754
|
+
* @param {Notification} notification
|
|
102755
|
+
*/
|
|
102756
|
+
addNotification(notification) {
|
|
102752
102757
|
|
|
102753
|
-
|
|
102754
|
-
|
|
102758
|
+
// Crop notification log to size
|
|
102759
|
+
const length = this.elements.length;
|
|
102755
102760
|
|
|
102756
|
-
|
|
102761
|
+
const target = this.maxLength - 1;
|
|
102757
102762
|
|
|
102758
|
-
|
|
102759
|
-
|
|
102760
|
-
|
|
102763
|
+
if (length > target) {
|
|
102764
|
+
// too many elements, drop some
|
|
102765
|
+
this.elements.crop(length - target, length);
|
|
102766
|
+
}
|
|
102761
102767
|
|
|
102762
|
-
|
|
102763
|
-
}
|
|
102768
|
+
this.elements.add(notification);
|
|
102769
|
+
}
|
|
102770
|
+
}
|
|
102764
102771
|
|
|
102765
102772
|
class LogDisplay {
|
|
102766
102773
|
/**
|