@woosh/meep-engine 2.75.0 → 2.75.1
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 +19 -17
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +19 -17
- package/package.json +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_nearest_to_point.spec.js +75 -0
- package/src/core/events/signal/SignalBinding.js +18 -16
- package/src/core/model/ObservedBoolean.js +1 -1
package/build/meep.cjs
CHANGED
|
@@ -69796,30 +69796,37 @@ class ImageRGBADataLoader extends AssetLoader {
|
|
|
69796
69796
|
}
|
|
69797
69797
|
|
|
69798
69798
|
/**
|
|
69799
|
-
*
|
|
69800
|
-
* @copyright Alex Goldring 2018
|
|
69799
|
+
* Utility class for managing connection between listeners to signals
|
|
69801
69800
|
*/
|
|
69801
|
+
class SignalBinding {
|
|
69802
|
+
/**
|
|
69803
|
+
* State flag
|
|
69804
|
+
* @type {boolean}
|
|
69805
|
+
*/
|
|
69806
|
+
#linked = false;
|
|
69802
69807
|
|
|
69808
|
+
get linked() {
|
|
69809
|
+
return this.#linked;
|
|
69810
|
+
}
|
|
69803
69811
|
|
|
69804
|
-
class SignalBinding {
|
|
69805
69812
|
/**
|
|
69806
69813
|
*
|
|
69807
69814
|
* @param {Signal} signal
|
|
69808
69815
|
* @param {function} handler
|
|
69809
|
-
* @param {*} [context]
|
|
69816
|
+
* @param {*} [context] will be passed as thisArg to the handler
|
|
69810
69817
|
* @constructor
|
|
69811
69818
|
*/
|
|
69812
69819
|
constructor(signal, handler, context) {
|
|
69813
69820
|
if (typeof handler !== "function") {
|
|
69814
|
-
throw new TypeError(`handler must be a function, instead was ${handler}`);
|
|
69821
|
+
throw new TypeError(`handler must be a function, instead was '${typeof handler}'`);
|
|
69815
69822
|
}
|
|
69816
69823
|
|
|
69817
69824
|
if (typeof signal !== "object") {
|
|
69818
|
-
throw new TypeError(`signal must be of an object, instead was ${signal}`)
|
|
69825
|
+
throw new TypeError(`signal must be of an object, instead was '${typeof signal}'`)
|
|
69819
69826
|
}
|
|
69820
69827
|
|
|
69821
69828
|
if (typeof signal.add !== "function") {
|
|
69822
|
-
throw new TypeError(`signal.add must be a function, instead was ${signal.add}`);
|
|
69829
|
+
throw new TypeError(`signal.add must be a function, instead was '${typeof signal.add}'`);
|
|
69823
69830
|
}
|
|
69824
69831
|
|
|
69825
69832
|
/**
|
|
@@ -69840,11 +69847,6 @@ class SignalBinding {
|
|
|
69840
69847
|
*/
|
|
69841
69848
|
this.context = context;
|
|
69842
69849
|
|
|
69843
|
-
/**
|
|
69844
|
-
* State flag
|
|
69845
|
-
* @type {boolean}
|
|
69846
|
-
*/
|
|
69847
|
-
this.linked = false;
|
|
69848
69850
|
}
|
|
69849
69851
|
|
|
69850
69852
|
/**
|
|
@@ -69852,11 +69854,11 @@ class SignalBinding {
|
|
|
69852
69854
|
* Idempotent
|
|
69853
69855
|
*/
|
|
69854
69856
|
link() {
|
|
69855
|
-
if (this
|
|
69857
|
+
if (this.#linked) {
|
|
69856
69858
|
return;
|
|
69857
69859
|
}
|
|
69858
69860
|
|
|
69859
|
-
this
|
|
69861
|
+
this.#linked = true;
|
|
69860
69862
|
this.signal.add(this.handler, this.context);
|
|
69861
69863
|
}
|
|
69862
69864
|
|
|
@@ -69865,11 +69867,11 @@ class SignalBinding {
|
|
|
69865
69867
|
* Idempotent
|
|
69866
69868
|
*/
|
|
69867
69869
|
unlink() {
|
|
69868
|
-
if (!this
|
|
69870
|
+
if (!this.#linked) {
|
|
69869
69871
|
return;
|
|
69870
69872
|
}
|
|
69871
69873
|
|
|
69872
|
-
this
|
|
69874
|
+
this.#linked = false;
|
|
69873
69875
|
this.signal.remove(this.handler, this.context);
|
|
69874
69876
|
}
|
|
69875
69877
|
}
|
|
@@ -70349,7 +70351,7 @@ class ObservedBoolean extends Boolean {
|
|
|
70349
70351
|
|
|
70350
70352
|
/**
|
|
70351
70353
|
*
|
|
70352
|
-
* @param {function} f
|
|
70354
|
+
* @param {function(boolean)} f
|
|
70353
70355
|
*/
|
|
70354
70356
|
process(f) {
|
|
70355
70357
|
f(this.__value);
|