@woosh/meep-engine 2.115.0 → 2.116.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 +144 -144
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +144 -144
- package/editor/view/ecs/HierarchicalEntityListView.js +2 -2
- package/package.json +1 -1
- package/src/core/collection/array/{compareArrays.d.ts → array_compare.d.ts} +2 -2
- package/src/core/collection/array/array_compare.d.ts.map +1 -0
- package/src/core/collection/array/{compareArrays.js → array_compare.js} +5 -1
- package/src/core/collection/array/{arrayIndexByEquality.d.ts → array_index_by_equality.d.ts} +2 -2
- package/src/core/collection/array/array_index_by_equality.d.ts.map +1 -0
- package/src/core/collection/array/{arrayIndexByEquality.js → array_index_by_equality.js} +1 -1
- package/src/core/collection/array/array_pick_best_element.d.ts.map +1 -0
- package/src/core/collection/array/{arrayPickBestElement.js → array_pick_best_element.js} +2 -2
- package/src/core/collection/array/array_pick_best_elements.d.ts +8 -0
- package/src/core/collection/array/array_pick_best_elements.d.ts.map +1 -0
- package/src/core/collection/array/{arrayPickBestElements.js → array_pick_best_elements.js} +1 -1
- package/src/core/collection/array/{arraySetDiff.d.ts → array_set_diff.d.ts} +3 -3
- package/src/core/collection/array/array_set_diff.d.ts.map +1 -0
- package/src/core/collection/array/{arraySetDiff.js → array_set_diff.js} +4 -4
- package/src/core/collection/array/{arraySetSortingDiff.d.ts → array_set_diff_sorting.d.ts} +2 -2
- package/src/core/collection/array/array_set_diff_sorting.d.ts.map +1 -0
- package/src/core/collection/array/{arraySetSortingDiff.js → array_set_diff_sorting.js} +1 -1
- package/src/core/collection/list/FilteredListProjection.d.ts.map +1 -1
- package/src/core/collection/list/FilteredListProjection.js +2 -2
- package/src/core/collection/list/List.js +4 -4
- package/src/core/geom/3d/topology/expandConnectivityByLocality.js +2 -2
- package/src/core/model/object/compareValues.js +3 -3
- package/src/engine/ecs/EntityComponentDataset.js +3 -3
- package/src/engine/graphics/ecs/mesh/SkeletonUtils.js +2 -2
- package/src/engine/platform/WebEnginePlatform.d.ts.map +1 -1
- package/src/engine/platform/WebEnginePlatform.js +4 -4
- package/src/engine/save/GameStateLoader.js +2 -2
- package/src/engine/ui/cursor/CursorCoalescence.d.ts.map +1 -1
- package/src/engine/ui/cursor/CursorCoalescence.js +2 -2
- package/src/view/elements/radial/RadialMenu.js +2 -2
- package/src/core/collection/array/arrayIndexByEquality.d.ts.map +0 -1
- package/src/core/collection/array/arrayPickBestElement.d.ts.map +0 -1
- package/src/core/collection/array/arrayPickBestElements.d.ts +0 -8
- package/src/core/collection/array/arrayPickBestElements.d.ts.map +0 -1
- package/src/core/collection/array/arraySetDiff.d.ts.map +0 -1
- package/src/core/collection/array/arraySetSortingDiff.d.ts.map +0 -1
- package/src/core/collection/array/compareArrays.d.ts.map +0 -1
- /package/src/core/collection/array/{arrayPickBestElement.d.ts → array_pick_best_element.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { array_copy } from "../../../collection/array/array_copy.js";
|
|
2
|
-
import {
|
|
2
|
+
import { array_set_diff_sorting } from "../../../collection/array/array_set_diff_sorting.js";
|
|
3
3
|
import { compareFaces } from "./compareFaces.js";
|
|
4
4
|
import { computeTopoMeshVertexDuplicates } from "./computeTopoMeshVertexDuplicates.js";
|
|
5
5
|
import { query_edge_other_vertex } from "./query/query_edge_other_vertex.js";
|
|
@@ -53,7 +53,7 @@ function connectEdges(a, b) {
|
|
|
53
53
|
const faces_a = a.faces;
|
|
54
54
|
const faces_b = b.faces;
|
|
55
55
|
|
|
56
|
-
const diff =
|
|
56
|
+
const diff = array_set_diff_sorting(faces_a, faces_b, compareFaces);
|
|
57
57
|
|
|
58
58
|
const unique_a = diff.uniqueA;
|
|
59
59
|
const unique_b = diff.uniqueB;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { array_compare } from "../../collection/array/array_compare.js";
|
|
2
2
|
import { extractFunctionBody } from "../../function/extractFunctionBody.js";
|
|
3
3
|
import { compareBooleans } from "../../primitives/boolean/compareBooleans.js";
|
|
4
4
|
import { number_compare_ascending } from "../../primitives/numbers/number_compare_ascending.js";
|
|
@@ -42,13 +42,13 @@ export function compareValues(a, b) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
if (Array.isArray(a) && Array.isArray(b)) {
|
|
45
|
-
return
|
|
45
|
+
return array_compare(a, b, compareValues);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const aKeys = Object.keys(a);
|
|
49
49
|
const bKeys = Object.keys(b);
|
|
50
50
|
|
|
51
|
-
const dKeys =
|
|
51
|
+
const dKeys = array_compare(aKeys, bKeys, compareStrings);
|
|
52
52
|
|
|
53
53
|
if (dKeys !== 0) {
|
|
54
54
|
return dKeys;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { assert } from "../../core/assert.js";
|
|
2
2
|
import { BitSet } from "../../core/binary/BitSet.js";
|
|
3
|
+
import { array_set_diff } from "../../core/collection/array/array_set_diff.js";
|
|
3
4
|
import { array_shrink_to_size } from "../../core/collection/array/array_shrink_to_size.js";
|
|
4
|
-
import { arraySetDiff } from "../../core/collection/array/arraySetDiff.js";
|
|
5
5
|
import { findSignalHandlerIndexByHandle } from "../../core/events/signal/findSignalHandlerIndexByHandle.js";
|
|
6
6
|
import {
|
|
7
7
|
findSignalHandlerIndexByHandleAndContext
|
|
@@ -463,7 +463,7 @@ export class EntityComponentDataset {
|
|
|
463
463
|
|
|
464
464
|
const newComponentTypeCount = map.length;
|
|
465
465
|
|
|
466
|
-
const diff =
|
|
466
|
+
const diff = array_set_diff(map, this.componentTypeMap);
|
|
467
467
|
|
|
468
468
|
const typesToAdd = diff.uniqueA;
|
|
469
469
|
const typesToRemove = diff.uniqueB;
|
|
@@ -681,7 +681,7 @@ export class EntityComponentDataset {
|
|
|
681
681
|
* @returns {boolean} false if no new classes were added, true if at least one new class was added
|
|
682
682
|
*/
|
|
683
683
|
registerManyComponentTypes(types) {
|
|
684
|
-
const diff =
|
|
684
|
+
const diff = array_set_diff(types, this.componentTypeMap);
|
|
685
685
|
|
|
686
686
|
if (diff.uniqueA.length === 0) {
|
|
687
687
|
// all classes area already registered
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bone } from "three";
|
|
2
|
-
import {
|
|
2
|
+
import { array_pick_best_element } from "../../../../core/collection/array/array_pick_best_element.js";
|
|
3
3
|
import { string_compute_similarity } from "../../../../core/primitives/strings/string_compute_similarity.js";
|
|
4
4
|
import { extractName } from "../../../../extractName.js";
|
|
5
5
|
import { BoneMapping } from "./skeleton/BoneMapping.js";
|
|
@@ -43,7 +43,7 @@ export function getSkeletonBone(component, boneName) {
|
|
|
43
43
|
//bone not found
|
|
44
44
|
|
|
45
45
|
//try to find similar bones
|
|
46
|
-
const bestMatch =
|
|
46
|
+
const bestMatch = array_pick_best_element(bones, function (bone) {
|
|
47
47
|
return string_compute_similarity(bone.name, boneName);
|
|
48
48
|
});
|
|
49
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebEnginePlatform.d.ts","sourceRoot":"","sources":["../../../../src/engine/platform/WebEnginePlatform.js"],"names":[],"mappings":"AAMA;IACI;;OAiBC;IAZG;;;OAGG;IACH,SAFU,OAAO,CAE6C;IAG9D;;;OAGG;IACH,cAFU,yBAAyB,CAE4B;IAGnE,sBAEC;IAED,mDAEC;IAED,2CA+DC;CACJ;+
|
|
1
|
+
{"version":3,"file":"WebEnginePlatform.d.ts","sourceRoot":"","sources":["../../../../src/engine/platform/WebEnginePlatform.js"],"names":[],"mappings":"AAMA;IACI;;OAiBC;IAZG;;;OAGG;IACH,SAFU,OAAO,CAE6C;IAG9D;;;OAGG;IACH,cAFU,yBAAyB,CAE4B;IAGnE,sBAEC;IAED,mDAEC;IAED,2CA+DC;CACJ;+BA/F8B,qBAAqB;0CAFV,sDAAsD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IndexedDBStorage } from "../save/storage/IndexedDBStorage.js";
|
|
1
|
+
import { array_pick_best_element } from "../../core/collection/array/array_pick_best_element.js";
|
|
3
2
|
import { StorageAchievementGateway } from "../achievements/gateway/StorageAchievementGateway.js";
|
|
4
|
-
import {
|
|
3
|
+
import { IndexedDBStorage } from "../save/storage/IndexedDBStorage.js";
|
|
4
|
+
import { EnginePlatform } from "./EnginePlatform.js";
|
|
5
5
|
import { getURLHash } from "./GetURLHash.js";
|
|
6
6
|
|
|
7
7
|
export class WebEnginePlatform extends EnginePlatform {
|
|
@@ -76,7 +76,7 @@ export class WebEnginePlatform extends EnginePlatform {
|
|
|
76
76
|
};
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
const best =
|
|
79
|
+
const best = array_pick_best_element(scoredKeys, o => o.score);
|
|
80
80
|
|
|
81
81
|
if (best.score === 0) {
|
|
82
82
|
return 'en-gb';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GameSaveStateMetadata } from "../../../../view/game/save/GameSaveStateMetadata.js";
|
|
2
|
-
import {
|
|
2
|
+
import { array_pick_best_element } from "../../core/collection/array/array_pick_best_element.js";
|
|
3
3
|
import { EnginePlugin } from "../plugin/EnginePlugin.js";
|
|
4
4
|
|
|
5
5
|
class GameStateLoader extends EnginePlugin {
|
|
@@ -98,7 +98,7 @@ class GameStateLoader extends EnginePlugin {
|
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
//find most recent
|
|
101
|
-
const mostRecent =
|
|
101
|
+
const mostRecent = array_pick_best_element(matches, m => m.timestamp);
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
if (mostRecent === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CursorCoalescence.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ui/cursor/CursorCoalescence.js"],"names":[],"mappings":"AAGA;IAGQ;;;OAGG;IACH,kBAFU,UAAU,EAAE,CAOrB;IAED,eAAiB;IAGrB;;;OAGG;IACH,0BAFW,UAAU,EAAE,QAItB;IAED,cAEC;IAED;;;OAGG;IACH,YAFW,UAAU,QAMpB;IAED;;OAEG;IACH,OAFa,UAAU,CAKtB;CACJ;
|
|
1
|
+
{"version":3,"file":"CursorCoalescence.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ui/cursor/CursorCoalescence.js"],"names":[],"mappings":"AAGA;IAGQ;;;OAGG;IACH,kBAFU,UAAU,EAAE,CAOrB;IAED,eAAiB;IAGrB;;;OAGG;IACH,0BAFW,UAAU,EAAE,QAItB;IAED,cAEC;IAED;;;OAGG;IACH,YAFW,UAAU,QAMpB;IAED;;OAEG;IACH,OAFa,UAAU,CAKtB;CACJ;2BAhD0B,iBAAiB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { array_pick_best_element } from "../../../core/collection/array/array_pick_best_element.js";
|
|
1
2
|
import { CursorType } from "./CursorType.js";
|
|
2
|
-
import { arrayPickBestElement } from "../../../core/collection/array/arrayPickBestElement.js";
|
|
3
3
|
|
|
4
4
|
export class CursorCoalescence {
|
|
5
5
|
constructor() {
|
|
@@ -45,6 +45,6 @@ export class CursorCoalescence {
|
|
|
45
45
|
*/
|
|
46
46
|
get() {
|
|
47
47
|
//pick best
|
|
48
|
-
return
|
|
48
|
+
return array_pick_best_element(this.cursors, c => this.cursorPriorities.indexOf(c));
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { array_set_diff } from "../../../core/collection/array/array_set_diff.js";
|
|
2
2
|
import List from "../../../core/collection/list/List.js";
|
|
3
3
|
import Vector2 from "../../../core/geom/Vector2.js";
|
|
4
4
|
import SVG from "../../SVG.js";
|
|
@@ -366,7 +366,7 @@ class RadialMenu extends View {
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
const diff =
|
|
369
|
+
const diff = array_set_diff(this.selected.asArray(), selected);
|
|
370
370
|
|
|
371
371
|
const removals = diff.uniqueA;
|
|
372
372
|
const additions = diff.uniqueB;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrayIndexByEquality.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/arrayIndexByEquality.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,8EAFa,MAAM,CAclB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrayPickBestElement.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/arrayPickBestElement.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,2EAkCC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrayPickBestElements.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/arrayPickBestElements.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,8EA0CC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arraySetDiff.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/arraySetDiff.js"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH;;;;EAoCC;6BAhD4B,gCAAgC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arraySetSortingDiff.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/arraySetSortingDiff.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH;;;;EAsDC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compareArrays.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/compareArrays.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,qFAHyB,MAAM,GACnB,MAAM,CAwBjB"}
|
/package/src/core/collection/array/{arrayPickBestElement.d.ts → array_pick_best_element.d.ts}
RENAMED
|
File without changes
|