@woosh/meep-engine 2.115.0 → 2.116.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/bundle-worker-terrain.js +1 -1
- package/build/meep.cjs +204 -177
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +204 -177
- 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/array_replace_all.d.ts +2 -1
- package/src/core/collection/array/array_replace_all.d.ts.map +1 -1
- package/src/core/collection/array/array_replace_all.js +3 -0
- 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.d.ts.map +1 -1
- package/src/core/collection/list/List.js +8 -11
- package/src/core/collection/set/ArraySet.d.ts.map +1 -1
- package/src/core/collection/set/ArraySet.js +11 -1
- package/src/core/geom/3d/topology/expandConnectivityByLocality.js +2 -2
- package/src/core/math/physics/brdf/brdf_burley.d.ts.map +1 -1
- package/src/core/math/physics/brdf/brdf_burley.js +3 -14
- package/src/core/math/physics/bsdf/bsdf_schlick.js +1 -1
- package/src/core/math/physics/pdf/pdf_normal.d.ts +8 -0
- package/src/core/math/physics/pdf/pdf_normal.d.ts.map +1 -0
- package/src/core/math/physics/pdf/pdf_normal.js +11 -0
- package/src/core/math/physics/reflectivity_to_ior.d.ts.map +1 -1
- package/src/core/math/physics/reflectivity_to_ior.js +3 -1
- package/src/core/model/object/compareValues.js +3 -3
- package/src/core/primitives/strings/computeStringHash.d.ts +9 -1
- package/src/core/primitives/strings/computeStringHash.d.ts.map +1 -1
- package/src/core/primitives/strings/computeStringHash.js +10 -5
- package/src/engine/ecs/EntityComponentDataset.js +3 -3
- package/src/engine/graphics/ecs/mesh/SkeletonUtils.js +2 -2
- package/src/engine/graphics/sh3/gi/material/common.glsl +3 -2
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +4 -3
- package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/build_probes_for_scene.js +6 -3
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +16 -12
- package/src/engine/graphics/shaders/DenoiseShader.d.ts.map +1 -1
- package/src/engine/graphics/shaders/DenoiseShader.js +3 -12
- package/src/engine/input/ecs/components/InputBinding.d.ts.map +1 -1
- package/src/engine/input/ecs/components/InputBinding.js +3 -2
- package/src/engine/input/ecs/components/InputController.d.ts.map +1 -1
- package/src/engine/input/ecs/components/InputController.js +18 -1
- package/src/engine/input/ecs/controllers/KeyboardCameraController.js +9 -9
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DenoiseShader.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/shaders/DenoiseShader.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DenoiseShader.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/shaders/DenoiseShader.js"],"names":[],"mappings":"AA8DA;;;;;GAKG;AACH,sCAJW,MAAM,qBACN,MAAM;;;;;;;;YAyBD;;eAEG;;;;;;;;;;;;;;;;;EAiBlB;;IA/CD;;;;;OAKG;IACH,oBAJW,MAAM,qBACN,MAAM,EA4ChB;;wBA7GuB,OAAO"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Vector2 } from "three";
|
|
2
|
+
import { pdf_normal } from "../../../core/math/physics/pdf/pdf_normal.js";
|
|
2
3
|
|
|
3
4
|
const KERNEL_SIZE = 15;
|
|
4
5
|
|
|
@@ -59,16 +60,6 @@ void main(void) {
|
|
|
59
60
|
}
|
|
60
61
|
`;
|
|
61
62
|
|
|
62
|
-
/**
|
|
63
|
-
* Normal Probability Distribution Function
|
|
64
|
-
* @param {number} x
|
|
65
|
-
* @param {number} sigma
|
|
66
|
-
* @return {number}
|
|
67
|
-
*/
|
|
68
|
-
function normpdf(x, sigma) {
|
|
69
|
-
return 0.39894 * Math.exp(-0.5 * x * x / (sigma * sigma)) / sigma;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
63
|
/**
|
|
73
64
|
*
|
|
74
65
|
* @param {number} sigma
|
|
@@ -77,13 +68,13 @@ function normpdf(x, sigma) {
|
|
|
77
68
|
*/
|
|
78
69
|
export function DenoiseShader(sigma = 10, filterSmoothness = 0.2) {
|
|
79
70
|
// compute zNorm
|
|
80
|
-
const zNorm = 1 /
|
|
71
|
+
const zNorm = 1 / pdf_normal(0, filterSmoothness);
|
|
81
72
|
|
|
82
73
|
// build kernel
|
|
83
74
|
const kernel = new Float32Array(KERNEL_SIZE);
|
|
84
75
|
const kSize = Math.floor((KERNEL_SIZE - 1) / 2);
|
|
85
76
|
for (let i = 0; i <= kSize; i++) {
|
|
86
|
-
const v =
|
|
77
|
+
const v = pdf_normal(i, sigma);
|
|
87
78
|
|
|
88
79
|
kernel[kSize + i] = v;
|
|
89
80
|
kernel[kSize - i] = v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputBinding.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/ecs/components/InputBinding.js"],"names":[],"mappings":"AAEA;IACI;;;;;OAKG;IACH,2CAJW,MAAM,
|
|
1
|
+
{"version":3,"file":"InputBinding.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/ecs/components/InputBinding.js"],"names":[],"mappings":"AAEA;IACI;;;;;OAKG;IACH,2CAJW,MAAM,EAwBhB;IAfG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAChB;;;OAGG;IACH,mBAAwB;IACxB;;;OAGG;IACH,WAFU,OAAO,CAES;CAEjC"}
|
|
@@ -8,8 +8,9 @@ export class InputBinding {
|
|
|
8
8
|
* @param {boolean} [exclusive=false]
|
|
9
9
|
*/
|
|
10
10
|
constructor({ path, listener, exclusive = false }) {
|
|
11
|
-
assert.
|
|
12
|
-
assert.
|
|
11
|
+
assert.isString(path, 'path');
|
|
12
|
+
assert.isFunction(listener, 'listener');
|
|
13
|
+
assert.isBoolean(exclusive, 'exclusive');
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputController.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/ecs/components/InputController.js"],"names":[],"mappings":";AAMA;
|
|
1
|
+
{"version":3,"file":"InputController.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/ecs/components/InputController.js"],"names":[],"mappings":";AAMA;IAqCI;;;OAGG;IACH,8CAaC;IArDD;;;;OAIG;IACH,8BAYC;IATG,mBAAyB;IAMzB;;MAEC;IAGL;;;;;OAKG;IACH,WAJW,MAAM,qBAEJ,YAAY,CAWxB;CAoBJ;;;;;iBA5DgB,0CAA0C;mBACxC,0CAA0C;6BAChC,mBAAmB"}
|
|
@@ -7,7 +7,7 @@ import { InputBinding } from "./InputBinding.js";
|
|
|
7
7
|
class InputController {
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
10
|
-
* @param {Array} bindings
|
|
10
|
+
* @param {Array} [bindings]
|
|
11
11
|
* @constructor
|
|
12
12
|
*/
|
|
13
13
|
constructor(bindings = []) {
|
|
@@ -24,6 +24,23 @@ class InputController {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param {string} path
|
|
30
|
+
* @param {function} action
|
|
31
|
+
* @returns {InputBinding}
|
|
32
|
+
*/
|
|
33
|
+
bind(path, action) {
|
|
34
|
+
assert.isFunction(action, 'action');
|
|
35
|
+
assert.isString(path, 'path');
|
|
36
|
+
|
|
37
|
+
const binding = new InputBinding({ path, listener: action });
|
|
38
|
+
|
|
39
|
+
this.mapping.add(binding);
|
|
40
|
+
|
|
41
|
+
return binding;
|
|
42
|
+
}
|
|
43
|
+
|
|
27
44
|
/**
|
|
28
45
|
*
|
|
29
46
|
* @param {Array} bindings
|
|
@@ -45,19 +45,19 @@ class KeyboardCameraController {
|
|
|
45
45
|
function registerToggle(keys, object, propertyName) {
|
|
46
46
|
keys.forEach((keyName) => {
|
|
47
47
|
|
|
48
|
-
inputController.
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
inputController.bind(
|
|
49
|
+
"keyboard/keys/" + keyName + "/down",
|
|
50
|
+
() => {
|
|
51
51
|
object[propertyName] = true;
|
|
52
52
|
|
|
53
53
|
//send interaction event
|
|
54
54
|
ecd.sendEvent(cameraController.entity, 'user-input');
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
inputController.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
);
|
|
57
|
+
inputController.bind(
|
|
58
|
+
"keyboard/keys/" + keyName + "/up",
|
|
59
|
+
() => object[propertyName] = false
|
|
60
|
+
);
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -89,7 +89,7 @@ class KeyboardCameraController {
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
const displacement = cameraPanSpeed.clone().multiplyScalar(keyboardPanSpeed * timeDelta);
|
|
93
93
|
|
|
94
94
|
const camera_transform = ecd.getComponent(cameraController.entity, Transform);
|
|
95
95
|
|
|
@@ -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
|