@woosh/meep-engine 2.47.36 → 2.47.38
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 +28 -12
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +28 -12
- package/package.json +1 -1
- package/src/core/collection/array/isArraysEqualWithComparator.js +9 -6
- package/src/core/model/object/objectDeepEquals.js +22 -6
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.d.ts +5 -1
package/build/meep.module.js
CHANGED
|
@@ -77596,28 +77596,31 @@ function planesEqual(a, b) {
|
|
|
77596
77596
|
* @template T
|
|
77597
77597
|
* @param {T[]} a
|
|
77598
77598
|
* @param {T[]} b
|
|
77599
|
-
* @param {function(T,T):boolean}
|
|
77599
|
+
* @param {function(T,T):boolean} elements_equal
|
|
77600
77600
|
* @returns {boolean}
|
|
77601
77601
|
*/
|
|
77602
|
-
function isArraysEqualWithComparator(a, b,
|
|
77602
|
+
function isArraysEqualWithComparator(a, b, elements_equal) {
|
|
77603
77603
|
if (a === b) {
|
|
77604
|
+
// same object
|
|
77604
77605
|
return true;
|
|
77605
77606
|
}
|
|
77606
77607
|
|
|
77607
77608
|
if (a === null || b === null || a === undefined || b === undefined) {
|
|
77609
|
+
// check if one of the arrays is missing
|
|
77608
77610
|
return false
|
|
77609
77611
|
}
|
|
77610
77612
|
|
|
77611
|
-
const
|
|
77612
|
-
|
|
77613
|
+
const element_count = a.length;
|
|
77614
|
+
|
|
77615
|
+
if (element_count !== b.length) {
|
|
77613
77616
|
return false;
|
|
77614
77617
|
}
|
|
77615
77618
|
|
|
77616
|
-
for (let i = 0; i <
|
|
77619
|
+
for (let i = 0; i < element_count; i++) {
|
|
77617
77620
|
const aE = a[i];
|
|
77618
77621
|
const bE = b[i];
|
|
77619
77622
|
|
|
77620
|
-
if (!
|
|
77623
|
+
if (!elements_equal(aE, bE)) {
|
|
77621
77624
|
return false;
|
|
77622
77625
|
}
|
|
77623
77626
|
}
|
|
@@ -100733,16 +100736,29 @@ function objectDeepEquals(a, b) {
|
|
|
100733
100736
|
}
|
|
100734
100737
|
|
|
100735
100738
|
if (tA === "object") {
|
|
100736
|
-
|
|
100737
|
-
|
|
100738
|
-
if (!
|
|
100739
|
+
if (Array.isArray(a)) {
|
|
100740
|
+
// special fast path for arrays
|
|
100741
|
+
if (!Array.isArray(b)) {
|
|
100742
|
+
// one is an array, the other is not
|
|
100739
100743
|
return false;
|
|
100740
100744
|
}
|
|
100745
|
+
return isArraysEqualWithComparator(a, b, objectDeepEquals);
|
|
100741
100746
|
}
|
|
100742
100747
|
|
|
100743
|
-
|
|
100744
|
-
|
|
100745
|
-
|
|
100748
|
+
const keys_a = Object.keys(a);
|
|
100749
|
+
const keys_b = Object.keys(b);
|
|
100750
|
+
|
|
100751
|
+
if (!isArrayEqualStrict(keys_a, keys_b)) {
|
|
100752
|
+
// different fields
|
|
100753
|
+
return false;
|
|
100754
|
+
}
|
|
100755
|
+
|
|
100756
|
+
const key_count = keys_a.length;
|
|
100757
|
+
|
|
100758
|
+
for (let i = 0; i < key_count; i++) {
|
|
100759
|
+
const key = keys_a[i];
|
|
100760
|
+
|
|
100761
|
+
if (!objectDeepEquals(a[key], b[key])) {
|
|
100746
100762
|
return false;
|
|
100747
100763
|
}
|
|
100748
100764
|
}
|
package/package.json
CHANGED
|
@@ -2,28 +2,31 @@
|
|
|
2
2
|
* @template T
|
|
3
3
|
* @param {T[]} a
|
|
4
4
|
* @param {T[]} b
|
|
5
|
-
* @param {function(T,T):boolean}
|
|
5
|
+
* @param {function(T,T):boolean} elements_equal
|
|
6
6
|
* @returns {boolean}
|
|
7
7
|
*/
|
|
8
|
-
export function isArraysEqualWithComparator(a, b,
|
|
8
|
+
export function isArraysEqualWithComparator(a, b, elements_equal) {
|
|
9
9
|
if (a === b) {
|
|
10
|
+
// same object
|
|
10
11
|
return true;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
if (a === null || b === null || a === undefined || b === undefined) {
|
|
15
|
+
// check if one of the arrays is missing
|
|
14
16
|
return false
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
+
const element_count = a.length;
|
|
20
|
+
|
|
21
|
+
if (element_count !== b.length) {
|
|
19
22
|
return false;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
for (let i = 0; i <
|
|
25
|
+
for (let i = 0; i < element_count; i++) {
|
|
23
26
|
const aE = a[i];
|
|
24
27
|
const bE = b[i];
|
|
25
28
|
|
|
26
|
-
if (!
|
|
29
|
+
if (!elements_equal(aE, bE)) {
|
|
27
30
|
return false;
|
|
28
31
|
}
|
|
29
32
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { isArraysEqualWithComparator } from "../../collection/array/isArraysEqualWithComparator.js";
|
|
2
|
+
import { isArrayEqualStrict } from "../../collection/array/isArrayEqualStrict.js";
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* @template A,B
|
|
3
6
|
* @param {A} a
|
|
@@ -13,16 +16,29 @@ export function objectDeepEquals(a, b) {
|
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
if (tA === "object") {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (!
|
|
19
|
+
if (Array.isArray(a)) {
|
|
20
|
+
// special fast path for arrays
|
|
21
|
+
if (!Array.isArray(b)) {
|
|
22
|
+
// one is an array, the other is not
|
|
19
23
|
return false;
|
|
20
24
|
}
|
|
25
|
+
return isArraysEqualWithComparator(a, b, objectDeepEquals);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const keys_a = Object.keys(a);
|
|
29
|
+
const keys_b = Object.keys(b);
|
|
30
|
+
|
|
31
|
+
if (!isArrayEqualStrict(keys_a, keys_b)) {
|
|
32
|
+
// different fields
|
|
33
|
+
return false;
|
|
21
34
|
}
|
|
22
35
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
36
|
+
const key_count = keys_a.length;
|
|
37
|
+
|
|
38
|
+
for (let i = 0; i < key_count; i++) {
|
|
39
|
+
const key = keys_a[i];
|
|
40
|
+
|
|
41
|
+
if (!objectDeepEquals(a[key], b[key])) {
|
|
26
42
|
return false;
|
|
27
43
|
}
|
|
28
44
|
}
|
|
@@ -16,5 +16,9 @@ export class FPDecalSystem extends System<Decal, Transform> {
|
|
|
16
16
|
): { entity: number, component: Decal, contact: SurfacePoint3 }[]
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
queryOverlapFrustum(
|
|
19
|
+
queryOverlapFrustum(
|
|
20
|
+
result: ArrayLike<number>,
|
|
21
|
+
result_offset: number,
|
|
22
|
+
planes: ArrayLike<number>
|
|
23
|
+
): number
|
|
20
24
|
}
|