@woosh/meep-engine 2.118.7 → 2.118.9
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 +11 -145
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +11 -145
- package/package.json +1 -1
- package/samples/generation/SampleGenerator0.js +55 -55
- package/samples/generation/generators/interactive/mir_generator_place_buff_objects.js +21 -23
- package/samples/generation/generators/mir_generator_place_bases.js +20 -20
- package/samples/generation/generators/mir_generator_place_road_decorators.js +11 -11
- package/src/core/color/Color.js +1 -1
- package/src/core/color/operations/color_darken.d.ts +8 -0
- package/src/core/color/operations/color_darken.d.ts.map +1 -0
- package/src/core/color/operations/color_darken.js +27 -0
- package/src/core/color/operations/color_desaturate.d.ts +3 -2
- package/src/core/color/operations/color_desaturate.d.ts.map +1 -1
- package/src/core/color/operations/color_desaturate.js +16 -5
- package/src/core/color/operations/color_lighten.d.ts +8 -0
- package/src/core/color/operations/color_lighten.d.ts.map +1 -0
- package/src/core/color/operations/color_lighten.js +27 -0
- package/src/core/color/operations/color_saturate.d.ts +8 -0
- package/src/core/color/operations/color_saturate.d.ts.map +1 -0
- package/src/core/color/operations/color_saturate.js +27 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts +9 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts.map +1 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.js +29 -0
- package/src/core/math/gaussian.d.ts.map +1 -1
- package/src/core/math/gaussian.js +4 -1
- package/src/core/math/physics/pdf/pdf_GGX.d.ts +3 -3
- package/src/core/math/physics/pdf/pdf_GGX.d.ts.map +1 -1
- package/src/core/math/physics/pdf/pdf_GGX.js +7 -6
- package/src/core/model/ObservedBoolean.js +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.d.ts +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.js +7 -7
- package/src/core/model/object/validatedObjectValueByKey.js +1 -1
- package/src/core/model/reactive/transform/{ReactiveTypeInferrence.d.ts → inferReactiveExpressionTypes.d.ts} +1 -1
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.d.ts.map +1 -0
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.js +60 -0
- package/src/core/model/reactive/trigger/ReactiveTrigger.js +1 -1
- package/src/core/process/delay.d.ts.map +1 -1
- package/src/core/process/delay.js +6 -0
- package/src/core/process/task/TaskGroup.d.ts.map +1 -1
- package/src/core/process/task/TaskGroup.js +3 -8
- package/src/core/process/undo/ActionGroup.d.ts.map +1 -1
- package/src/core/process/undo/ActionGroup.js +6 -9
- package/src/core/process/worker/extractTransferables.d.ts +3 -2
- package/src/core/process/worker/extractTransferables.d.ts.map +1 -1
- package/src/core/process/worker/extractTransferables.js +32 -12
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +3 -1
- package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics/GraphicsEngine.js +4 -0
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.js +4 -0
- package/src/generation/grid/actions/ContinuousGridCellAction.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellAction.js +6 -8
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js +20 -22
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +23 -28
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.js +7 -10
- package/src/generation/grid/generation/GridTaskSequence.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskSequence.js +2 -5
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.d.ts → GridTaskActionRuleSet.d.ts} +1 -1
- package/src/generation/grid/generation/discrete/GridTaskActionRuleSet.d.ts.map +1 -0
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.js → GridTaskActionRuleSet.js} +13 -16
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +51 -53
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +20 -23
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.js +38 -39
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.js +8 -11
- package/src/generation/grid/generation/road/PathEndPoint.d.ts.map +1 -1
- package/src/generation/grid/generation/road/PathEndPoint.js +8 -10
- package/src/generation/grid/generation/road/RoadConnection.d.ts.map +1 -1
- package/src/generation/grid/generation/road/RoadConnection.js +4 -5
- package/src/generation/markers/GridCellActionPlaceMarker.d.ts.map +1 -1
- package/src/generation/markers/GridCellActionPlaceMarker.js +7 -5
- package/src/view/common/LabelView.d.ts.map +1 -1
- package/src/view/common/LabelView.js +0 -3
- package/src/core/model/LinearValue.d.ts +0 -88
- package/src/core/model/LinearValue.d.ts.map +0 -1
- package/src/core/model/LinearValue.js +0 -140
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.d.ts.map +0 -1
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.js +0 -54
- package/src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.d.ts.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
|
+
import { clamp01 } from "../../math/clamp01.js";
|
|
3
|
+
import { Color } from "../Color.js";
|
|
4
|
+
import { linear_srgb_to_okhsv } from "../oklab/linear_srgb_to_okhsv.js";
|
|
5
|
+
import { okhsv_to_linear_srgb } from "../oklab/okhsv_to_linear_srgb.js";
|
|
6
|
+
|
|
7
|
+
const hsv = [0, 0, 0];
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {Color} input
|
|
12
|
+
* @param {number} amount
|
|
13
|
+
*/
|
|
14
|
+
export function color_lighten(input, amount = 1) {
|
|
15
|
+
assert.isNumber(amount, 'amount');
|
|
16
|
+
assert.greaterThanOrEqual(amount, 0, 'amount');
|
|
17
|
+
|
|
18
|
+
const r = new Color();
|
|
19
|
+
|
|
20
|
+
linear_srgb_to_okhsv(hsv, input.r, input.g, input.b);
|
|
21
|
+
|
|
22
|
+
hsv[2] = clamp01(hsv[2] * (1 + amount));
|
|
23
|
+
|
|
24
|
+
okhsv_to_linear_srgb(r, ...hsv);
|
|
25
|
+
|
|
26
|
+
return r;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_saturate.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_saturate.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,sCAHW,KAAK,WACL,MAAM,SAehB;sBAxBqB,aAAa"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
|
+
import { clamp01 } from "../../math/clamp01.js";
|
|
3
|
+
import { Color } from "../Color.js";
|
|
4
|
+
import { linear_srgb_to_okhsv } from "../oklab/linear_srgb_to_okhsv.js";
|
|
5
|
+
import { okhsv_to_linear_srgb } from "../oklab/okhsv_to_linear_srgb.js";
|
|
6
|
+
|
|
7
|
+
const hsv = [0,0,0];
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {Color} input
|
|
12
|
+
* @param {number} [amount]
|
|
13
|
+
*/
|
|
14
|
+
export function color_saturate(input, amount=1) {
|
|
15
|
+
assert.isNumber(amount,'amount');
|
|
16
|
+
assert.greaterThanOrEqual(amount,0,'amount');
|
|
17
|
+
|
|
18
|
+
const r = new Color();
|
|
19
|
+
|
|
20
|
+
linear_srgb_to_okhsv(hsv, input.r,input.g, input.b);
|
|
21
|
+
|
|
22
|
+
hsv[1] = clamp01(hsv[1] * (1 + amount));
|
|
23
|
+
|
|
24
|
+
okhsv_to_linear_srgb(r, ...hsv);
|
|
25
|
+
|
|
26
|
+
return r;
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @template T
|
|
3
|
+
* @param {T[]} result
|
|
4
|
+
* @param {number} result_offset
|
|
5
|
+
* @param {QuadTreeNode<T>} root
|
|
6
|
+
* @returns {number}
|
|
7
|
+
*/
|
|
8
|
+
export function qt_collect_data_all<T>(result: T[], result_offset: number, root: QuadTreeNode<T>): number;
|
|
9
|
+
//# sourceMappingURL=qt_collect_data_all.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qt_collect_data_all.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/quad-tree/qt_collect_data_all.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,mEAJW,MAAM,0BAEJ,MAAM,CAuBlB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @template T
|
|
3
|
+
* @param {T[]} result
|
|
4
|
+
* @param {number} result_offset
|
|
5
|
+
* @param {QuadTreeNode<T>} root
|
|
6
|
+
* @returns {number}
|
|
7
|
+
*/
|
|
8
|
+
export function qt_collect_data_all(result, result_offset, root) {
|
|
9
|
+
|
|
10
|
+
const data = root.data;
|
|
11
|
+
const data_count = data.length;
|
|
12
|
+
|
|
13
|
+
let cursor = result_offset;
|
|
14
|
+
|
|
15
|
+
for (let i = 0; i < data_count; i++) {
|
|
16
|
+
result[cursor++] = data[i].data;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (root.isSplit()) {
|
|
20
|
+
|
|
21
|
+
cursor += qt_collect_data_all(result, cursor, root.topLeft);
|
|
22
|
+
cursor += qt_collect_data_all(result, cursor, root.topRight);
|
|
23
|
+
cursor += qt_collect_data_all(result, cursor, root.bottomLeft);
|
|
24
|
+
cursor += qt_collect_data_all(result, cursor, root.bottomRight);
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return cursor - result_offset;
|
|
29
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gaussian.d.ts","sourceRoot":"","sources":["../../../../src/core/math/gaussian.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,gCAJW,MAAM,KACN,MAAM,GACJ,MAAM,
|
|
1
|
+
{"version":3,"file":"gaussian.d.ts","sourceRoot":"","sources":["../../../../src/core/math/gaussian.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,gCAJW,MAAM,KACN,MAAM,GACJ,MAAM,CAOlB"}
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
* V = view direction
|
|
8
8
|
* H = normalize( V + L )
|
|
9
9
|
*
|
|
10
|
-
* @param {number}
|
|
11
|
-
* @param {number}
|
|
10
|
+
* @param {number} NoH dot product of N and H
|
|
11
|
+
* @param {number} HoV dot product of H and V
|
|
12
12
|
* @param {number} roughness
|
|
13
13
|
* @returns {number}
|
|
14
14
|
*/
|
|
15
|
-
export function pdf_GGX(
|
|
15
|
+
export function pdf_GGX(NoH: number, HoV: number, roughness: number): number;
|
|
16
16
|
//# sourceMappingURL=pdf_GGX.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf_GGX.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/pdf/pdf_GGX.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH
|
|
1
|
+
{"version":3,"file":"pdf_GGX.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/physics/pdf/pdf_GGX.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,6BALW,MAAM,OACN,MAAM,aACN,MAAM,GACJ,MAAM,CAalB"}
|
|
@@ -7,19 +7,20 @@
|
|
|
7
7
|
* V = view direction
|
|
8
8
|
* H = normalize( V + L )
|
|
9
9
|
*
|
|
10
|
-
* @param {number}
|
|
11
|
-
* @param {number}
|
|
10
|
+
* @param {number} NoH dot product of N and H
|
|
11
|
+
* @param {number} HoV dot product of H and V
|
|
12
12
|
* @param {number} roughness
|
|
13
13
|
* @returns {number}
|
|
14
14
|
*/
|
|
15
|
-
export function pdf_GGX(
|
|
15
|
+
export function pdf_GGX(NoH, HoV, roughness) {
|
|
16
|
+
// convert to perceptual roughness
|
|
16
17
|
const m2 = roughness * roughness;
|
|
17
18
|
|
|
18
|
-
const X =
|
|
19
|
+
const X = NoH * NoH * (m2 - 1) + 1;
|
|
19
20
|
|
|
20
21
|
const d = m2 / (Math.PI * X * X);
|
|
21
22
|
|
|
22
|
-
const pM = d *
|
|
23
|
+
const pM = d * NoH;
|
|
23
24
|
|
|
24
|
-
return pM / (4 *
|
|
25
|
+
return pM / (4 * HoV);
|
|
25
26
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
3
|
* @param {NodeGraph} graph
|
|
4
|
-
* @param {{nodes
|
|
4
|
+
* @param {{nodes?:[], connections?:[], descriptions?:[]}} json
|
|
5
5
|
* @param {NodeRegistry} [node_registry]
|
|
6
6
|
* @param {Map<string, function>} [deserializers]
|
|
7
7
|
* @param {boolean} [allow_node_id_collisions]
|
|
@@ -130,7 +130,7 @@ async function deserializeNodeDescriptors(j_descriptions, deserializers, node_re
|
|
|
130
130
|
/**
|
|
131
131
|
*
|
|
132
132
|
* @param {NodeGraph} graph
|
|
133
|
-
* @param {{nodes
|
|
133
|
+
* @param {{nodes?:[], connections?:[], descriptions?:[]}} json
|
|
134
134
|
* @param {NodeRegistry} [node_registry]
|
|
135
135
|
* @param {Map<string, function>} [deserializers]
|
|
136
136
|
* @param {boolean} [allow_node_id_collisions]
|
|
@@ -143,13 +143,13 @@ export async function deserializeNodeGraphFromJSON({
|
|
|
143
143
|
allow_node_id_collisions = false
|
|
144
144
|
}) {
|
|
145
145
|
|
|
146
|
-
const j_nodes = json.nodes;
|
|
147
|
-
const j_connections = json.connections;
|
|
148
|
-
const j_descriptions = json.descriptions;
|
|
146
|
+
const j_nodes = json.nodes ?? [];
|
|
147
|
+
const j_connections = json.connections ?? [];
|
|
148
|
+
const j_descriptions = json.descriptions ?? [];
|
|
149
149
|
|
|
150
|
-
assert.
|
|
151
|
-
assert.
|
|
152
|
-
assert.
|
|
150
|
+
assert.isArray(j_nodes, 'json.nodes');
|
|
151
|
+
assert.isArray(j_connections, 'json.connections');
|
|
152
|
+
assert.isArray(j_descriptions, 'json.descriptions');
|
|
153
153
|
|
|
154
154
|
graph.reset();
|
|
155
155
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inferReactiveExpressionTypes.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/transform/inferReactiveExpressionTypes.js"],"names":[],"mappings":"AAqDA;;;GAGG;AACH,4EAEC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import DataType from "../../../parser/simple/DataType.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {ReactiveExpression} node
|
|
6
|
+
* @param {DataType} type
|
|
7
|
+
*/
|
|
8
|
+
function setNodeType(node, type) {
|
|
9
|
+
if (node.dataType === DataType.Any) {
|
|
10
|
+
node.dataType = type;
|
|
11
|
+
} else if (node.dataType !== type) {
|
|
12
|
+
//wrong type
|
|
13
|
+
console.warn(`Expected member or logic expression to have type '${type}', instead was '${node.dataType}'`, node);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param {ReactiveExpression} v
|
|
20
|
+
*/
|
|
21
|
+
function infer_one(v) {
|
|
22
|
+
if (v.isBinaryExpression) {
|
|
23
|
+
if (v.left !== null && v.right !== null) {
|
|
24
|
+
if (v.isLogicExpression) {
|
|
25
|
+
setNodeType(v.left, DataType.Boolean);
|
|
26
|
+
setNodeType(v.right, DataType.Boolean);
|
|
27
|
+
} else if (v.isComparativeExpression) {
|
|
28
|
+
if (v.isReactiveEquals || v.isReactiveNotEquals) {
|
|
29
|
+
if (v.left.dataType !== DataType.Any) {
|
|
30
|
+
setNodeType(v.right, v.left.dataType);
|
|
31
|
+
} else if (v.right.dataType !== DataType.Any) {
|
|
32
|
+
setNodeType(v.left, v.right.dataType);
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
setNodeType(v.left, DataType.Number);
|
|
36
|
+
setNodeType(v.right, DataType.Number);
|
|
37
|
+
}
|
|
38
|
+
} else if (v.isArithmeticExpression) {
|
|
39
|
+
setNodeType(v.left, DataType.Number);
|
|
40
|
+
setNodeType(v.right, DataType.Number);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
} else if (v.isUnaryExpression) {
|
|
44
|
+
if (v.source !== null) {
|
|
45
|
+
if (v.isLogicExpression) {
|
|
46
|
+
setNodeType(v.source, DataType.Boolean);
|
|
47
|
+
} else if (v.isArithmeticExpression) {
|
|
48
|
+
setNodeType(v.source, DataType.Number);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Infer types in an expression tree, input tree is mutated as a result
|
|
56
|
+
* @param {ReactiveExpression} exp
|
|
57
|
+
*/
|
|
58
|
+
export function inferReactiveExpressionTypes(exp) {
|
|
59
|
+
exp.traverse(infer_one);
|
|
60
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { assert } from "../../../assert.js";
|
|
2
2
|
import { compileReactiveExpression } from "../../../lang/reactive/compileReactiveExpression.js";
|
|
3
3
|
import DataType from "../../../parser/simple/DataType.js";
|
|
4
|
-
import { inferReactiveExpressionTypes } from "../transform/
|
|
4
|
+
import { inferReactiveExpressionTypes } from "../transform/inferReactiveExpressionTypes.js";
|
|
5
5
|
|
|
6
6
|
export class ReactiveTrigger {
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../../src/core/process/delay.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../../src/core/process/delay.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,kCAHW,MAAM,GACL,QAAQ,OAAO,CAAC,CAU3B"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { assert } from "../assert.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
*
|
|
3
5
|
* @param {number} timeout_ms in milliseconds
|
|
4
6
|
* @return {Promise<unknown>}
|
|
5
7
|
*/
|
|
6
8
|
export function delay(timeout_ms) {
|
|
9
|
+
assert.isNumber(timeout_ms,'timeout_ms');
|
|
10
|
+
assert.greaterThanOrEqual(timeout_ms,0);
|
|
11
|
+
assert.isFiniteNumber(timeout_ms,'timeout_ms');
|
|
12
|
+
|
|
7
13
|
return new Promise((resolve, reject) => {
|
|
8
14
|
setTimeout(resolve, timeout_ms);
|
|
9
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskGroup.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/task/TaskGroup.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TaskGroup.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/task/TaskGroup.js"],"names":[],"mappings":";AASA;IACI;;;;;OAKG;IACH,sBAJW,CAAC,IAAI,GAAC,SAAS,CAAC,EAAE,SAClB,MAAM,EAmChB;IA5BG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,UAFU,CAAC,IAAI,GAAC,SAAS,CAAC,EAAE,CAEJ;IAExB;;;;MAIC;IAED;;;OAGG;IACH,OAFU,eAAe,CAE0B;IACnD;;;OAGG;IACH,sBAFU,OAAO,CAEM;IAG3B;;;OAGG;IACH,sBAFa,MAAM,CAiBlB;IAED;;;;OAIG;IACH,gBAHW,IAAI,GAAC,SAAS,GACZ,OAAO,CAInB;IAED;;;OAGG;IACH,sBAFW,CAAC,IAAI,GAAC,SAAS,CAAC,EAAE,QAQ5B;IAED;;;OAGG;IACH,0BAFW,IAAI,GAAC,SAAS,QAkBxB;IAED,yCAUC;IAED;;;OAGG;IACH,wBAFa,MAAM,CAmBlB;IAED;;;OAGG;IACH,2BAFa,MAAM,CAyBlB;IAED,0BAmCC;IAED;;;;OAIG;IACH,sCAEC;IAED;;;OAGG;IACH,WAFa,QAAQ,OAAO,CAAC,CAI5B;CACJ;iBAjOgB,WAAW;mBAHT,+BAA+B;4BAEtB,gCAAgC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { assert } from "../../assert.js";
|
|
2
2
|
import LineBuilder from "../../codegen/LineBuilder.js";
|
|
3
|
+
import { array_push_if_unique } from "../../collection/array/array_push_if_unique.js";
|
|
3
4
|
import Signal from "../../events/signal/Signal.js";
|
|
4
5
|
import { objectKeyByValue } from "../../model/object/objectKeyByValue.js";
|
|
5
6
|
import ObservedInteger from "../../model/ObservedInteger.js";
|
|
@@ -74,13 +75,7 @@ class TaskGroup {
|
|
|
74
75
|
* @returns {boolean}
|
|
75
76
|
*/
|
|
76
77
|
addChild(child) {
|
|
77
|
-
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
this.children.push(child);
|
|
82
|
-
|
|
83
|
-
return true;
|
|
78
|
+
return array_push_if_unique(this.children, child);
|
|
84
79
|
}
|
|
85
80
|
|
|
86
81
|
/**
|
|
@@ -232,7 +227,7 @@ class TaskGroup {
|
|
|
232
227
|
* @returns {Promise<unknown>}
|
|
233
228
|
*/
|
|
234
229
|
promise() {
|
|
235
|
-
return
|
|
230
|
+
return new Promise((resolve, reject) => this.join(resolve, reject));
|
|
236
231
|
}
|
|
237
232
|
}
|
|
238
233
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionGroup.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/undo/ActionGroup.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"ActionGroup.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/undo/ActionGroup.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAQI;;;;OAIG;IACH,qDAMC;IAjBD;;;OAGG;IACH,gBAAa;IA6Bb,mCAQC;IAED,oCASC;CACJ;uBA5DsB,aAAa"}
|
|
@@ -4,15 +4,12 @@ import { Action } from "./Action.js";
|
|
|
4
4
|
* @template CTX
|
|
5
5
|
*/
|
|
6
6
|
export class ActionGroup extends Action {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
* @type {Action[]}
|
|
11
|
+
*/
|
|
12
|
+
members = [];
|
|
16
13
|
|
|
17
14
|
/**
|
|
18
15
|
* @template T
|
|
@@ -58,7 +55,7 @@ export class ActionGroup extends Action {
|
|
|
58
55
|
for (let i = n - 1; i >= 0; i--) {
|
|
59
56
|
const action = members[i];
|
|
60
57
|
|
|
61
|
-
|
|
58
|
+
await action.revert(context);
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
61
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* @param {*}
|
|
3
|
+
* @param {*} value
|
|
4
4
|
* @param {Array} result
|
|
5
|
+
* @returns {number} number of elements added to result array
|
|
5
6
|
* @preserve
|
|
6
7
|
*/
|
|
7
|
-
export function extractTransferables(
|
|
8
|
+
export function extractTransferables(value: any, result: any[]): number;
|
|
8
9
|
//# sourceMappingURL=extractTransferables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractTransferables.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/extractTransferables.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractTransferables.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/extractTransferables.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,iEAHa,MAAM,CAqClB"}
|
|
@@ -1,25 +1,45 @@
|
|
|
1
1
|
import { isImageBitmap } from "../../../engine/graphics/texture/isImageBitmap.js";
|
|
2
|
+
import { array_push_if_unique } from "../../collection/array/array_push_if_unique.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
*
|
|
5
|
-
* @param {*}
|
|
6
|
+
* @param {*} value
|
|
6
7
|
* @param {Array} result
|
|
8
|
+
* @returns {number} number of elements added to result array
|
|
7
9
|
* @preserve
|
|
8
10
|
*/
|
|
9
|
-
export function extractTransferables(
|
|
10
|
-
|
|
11
|
+
export function extractTransferables(value, result) {
|
|
12
|
+
let count = 0;
|
|
13
|
+
|
|
14
|
+
if (typeof value !== "object") {
|
|
15
|
+
|
|
11
16
|
// not an object, skip
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
result
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
} else if (value instanceof ArrayBuffer) {
|
|
19
|
+
|
|
20
|
+
if (array_push_if_unique(result, value)) {
|
|
21
|
+
count++;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
} else if (value.buffer instanceof ArrayBuffer) {
|
|
25
|
+
|
|
26
|
+
if (array_push_if_unique(result, value.buffer)) {
|
|
27
|
+
count++;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
} else if (isImageBitmap(value)) {
|
|
31
|
+
|
|
32
|
+
if (array_push_if_unique(result, value)) {
|
|
33
|
+
count++;
|
|
34
|
+
}
|
|
35
|
+
|
|
18
36
|
} else {
|
|
19
|
-
for (let i in
|
|
20
|
-
if (
|
|
21
|
-
extractTransferables(
|
|
37
|
+
for (let i in value) {
|
|
38
|
+
if (value.hasOwnProperty(i)) {
|
|
39
|
+
count += extractTransferables(value[i], result);
|
|
22
40
|
}
|
|
23
41
|
}
|
|
24
42
|
}
|
|
43
|
+
|
|
44
|
+
return count;
|
|
25
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicRuleDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DynamicRuleDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js"],"names":[],"mappings":"AAUA;IACI;;;OAGG;IACH,IAFU,MAAM,CAEG;IAEnB;;;OAGG;IACH,8BAAiB;IACjB;;;OAGG;IACH,kCAAc;IACd;;;OAGG;IACH,YAFU,mBAAmB,CAEb;IAChB;;;OAGG;IACH,UAFU,MAAM,CAEH;IACb;;;OAGG;IACH,6BAAyB;IACzB;;;OAGG;IACH,kBAFU,8BAA8B,EAAE,CAEpB;IAEtB;;;;OAIG;IACH,cAHW,sBAAsB,GACpB,OAAO,CAInB;IAED;;;OAGG;IACH,0BAFa,MAAM,CAIlB;IAED,yCAEC;IAED,cA+BC;IAED;;;;;;aA2BC;CACJ;+CA1H8C,qCAAqC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
2
|
import { compileReactiveExpression } from "../../../../core/lang/reactive/compileReactiveExpression.js";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
inferReactiveExpressionTypes
|
|
5
|
+
} from "../../../../core/model/reactive/transform/inferReactiveExpressionTypes.js";
|
|
4
6
|
import DataType from "../../../../core/parser/simple/DataType.js";
|
|
5
7
|
import { UUID } from "../../guid/UUID.js";
|
|
6
8
|
import { deserializeActionFromJSON } from "../actions/definition/deserializeActionFromJSON.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphicsEngine.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics/GraphicsEngine.js"],"names":[],"mappings":"AA0DA;
|
|
1
|
+
{"version":3,"file":"GraphicsEngine.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics/GraphicsEngine.js"],"names":[],"mappings":"AA0DA;IAOI;;;;;OAKG;IACH,+BAJW,MAAM,EAuKhB;IA7KD,gCAEC;IAgBG;;;;OAIG;IACH,2BAA+C;IAK/C;;;;;QAOI;;WAEG;;QAEH;;WAEG;;;;;MAMN;IAED;;OAEG;IACH,YAFU,OAAO,CAEe;IAEhC;;;OAGG;IACH,QAFU,kBAAkB,CAEU;IAWtC;;;OAGG;IACH,aAAkB;IAGlB;;;OAGG;IACH,cAFU,KAAK,CAEgB;IAK/B;;;OAGG;IACH,QAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,UAFU,aAAa,CAEH;IAGpB,+BAA0C;IAU1C;;OAEG;IACH,eAA+B;IAI/B;;;OAGG;IACH,uBAFU,kBAAkB,CAEgB;IAE5C;;;OAGG;IACH,oBAFU,iBAAiB,CAEsB;IAEjD;;;OAGG;IACH,gBAFU,iBAAiB,CAES;IAEpC;;;OAGG;IACH,sBAAoC;IAGpC;;;;OAIG;IACH,UAFU,OAAO,CAEG;IAEpB;;;OAGG;IACH,UAFU,OAAO,CAEG;IAEpB;;;OAGG;IACH,YAFU,MAAM,CAEG;IACnB,kKAcI;IAGR;;;OAGG;IACH,sBAFa,eAAe,CAI3B;IAED;;;OAGG;IACH,eAFa,aAAa,CAIzB;IAED,mBA0BC;IAED;;;OAGG;IACH,iCAOC;IAED;;;OAGG;IACH,0BAFa,MAAM,CAIlB;IAED,+BAcC;IAED,cAgEC;IAzBsB,8BAA0C;IA2BjE;;;OAGG;IACH,cAFa,MAAM,CAYlB;IAED;;OAEG;IACH,aAQC;IAED;;OAEG;IACH,yBAQC;IAED;;;;;;OAMG;IACH,yBALW,MAAM,KACN,MAAM,6CAMhB;IAED;;;;OAIG;IACH,8BAHW,iBAAe,UACf,iBAAe,QAczB;IAED;;;;;OAKG;IACH,8BAQC;IAED,0BAEC;IAED;;;OAGG;IACH,4BAFW,cAAc,QA8BxB;IAED;;OAEG;IACH,qBAqBC;IAED;;OAEG;IACH,0BAeC;IAED;;OAEG;IACH,eA8CC;;CACJ;mBAjlBkB,oCAAoC;oBACnC,4BAA4B;mCAab,uCAAuC;sBAjBnE,OAAO;uBAYS,wBAAwB;8BAZxC,OAAO;4BAWc,+BAA+B;mCAKxB,uCAAuC;kCAKxC,gCAAgC;kCADhC,oCAAoC;gCAPtC,uCAAuC;+BAKxC,4BAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/camera/CameraSystem.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,4DAHW,YAAY,YACZ,UAAU,QAsBpB;AAED;
|
|
1
|
+
{"version":3,"file":"CameraSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/camera/CameraSystem.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,4DAHW,YAAY,YACZ,UAAU,QAsBpB;AAED;IAmOI;;;;OAIG;IACH,8EAOC;IAED;;;;OAIG;IACH,0DAFa;QAAC,SAAS,EAAC,CAAC,MAAM,GAAC,SAAS,CAAC,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAc1D;IAED;;;;OAIG;IACH,uEAFoB,YAAY,EAAE,gBAqBjC;IA3RD;;;;OAIG;IACH,sCAuDC;IAhDG,WAA2B;IAE3B,mDAAuC;IAEvC,8DAEC;IAQD;;OAEG;IACH,yBAAwB;IAExB,kBAAoB;IAKpB;;;;;OAKG;IACH,+BAeC;IAED,sBAAwB;IAI5B;;;;;OAKG;IACH,aAHW,MAAM,aADN,SAAS,uBAyEnB;IAED;;;;;OAKG;IACH,eAHW,MAAM,aADN,SAAS,uBAiBnB;IAED,0EAqDC;IAED,2EAQC;CA4DJ;uBAjUsB,aAAa;uBARb,qCAAqC;uBAGrC,wBAAwB;0BACrB,qCAAqC;4CAFnB,uDAAuD;wCAL1D,OAAO"}
|
|
@@ -54,6 +54,10 @@ export class CameraSystem extends System {
|
|
|
54
54
|
constructor(graphics) {
|
|
55
55
|
super();
|
|
56
56
|
|
|
57
|
+
assert.defined(graphics,'graphics');
|
|
58
|
+
assert.notNull(graphics,'graphics');
|
|
59
|
+
assert.equal(graphics.isGraphicsEngine, true,'graphics.isGraphicsEngine !== true');
|
|
60
|
+
|
|
57
61
|
this.scene = graphics.scene;
|
|
58
62
|
|
|
59
63
|
this.dependencies = [Camera, Transform];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContinuousGridCellAction.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/actions/ContinuousGridCellAction.js"],"names":[],"mappings":"AAAA;
|
|
1
|
+
{"version":3,"file":"ContinuousGridCellAction.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/actions/ContinuousGridCellAction.js"],"names":[],"mappings":"AAAA;IAEI;;;;OAIG;IACH,sBAAsB;IAGtB;;;OAGG;IACH,2BAEC;IAED;;;;;OAKG;IACH,iBAJW,MAAM,qDAMhB;IAED,iBAEC;IAED;;;;;;;;OAQG;IACH,wDALW,MAAM,KACN,MAAM,YACN,MAAM,8BAKhB;IAIL;;;OAGG;IACH,qCAFU,OAAO,CAE4C;CAP5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContinuousGridCellActionSetTerrainHeight.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js"],"names":[],"mappings":"AAQA;
|
|
1
|
+
{"version":3,"file":"ContinuousGridCellActionSetTerrainHeight.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js"],"names":[],"mappings":"AAQA;IAEI;;;OAGG;IACH,eAFU,SAAS,CAEE;IAErB;;;OAGG;IACH,mBAAwC;IAGxC,iDAeC;IAED,iFAsDC;CACJ;yCAzFwC,+BAA+B;0BAF9C,uDAAuD"}
|