@woosh/meep-engine 2.118.8 → 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 +10 -144
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +10 -144
- 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/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
|
@@ -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"}
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
1
2
|
import { lerp } from "../../../core/math/lerp.js";
|
|
2
3
|
import { min2 } from "../../../core/math/min2.js";
|
|
3
|
-
import {
|
|
4
|
+
import { obtainTerrain } from "../../../engine/ecs/terrain/util/obtainTerrain.js";
|
|
4
5
|
import { Sampler2D } from "../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
5
|
-
import { assert } from "../../../core/assert.js";
|
|
6
6
|
import { CellFilterLiteralFloat } from "../../filtering/numeric/CellFilterLiteralFloat.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ContinuousGridCellAction } from "./ContinuousGridCellAction.js";
|
|
8
8
|
|
|
9
9
|
export class ContinuousGridCellActionSetTerrainHeight extends ContinuousGridCellAction {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @type {Sampler2D}
|
|
14
|
+
*/
|
|
15
|
+
heightSampler = null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Target height
|
|
19
|
+
* @type {CellFilter}
|
|
20
|
+
*/
|
|
21
|
+
target = CellFilterLiteralFloat.from(0);
|
|
18
22
|
|
|
19
|
-
/**
|
|
20
|
-
* Target height
|
|
21
|
-
* @type {CellFilter}
|
|
22
|
-
*/
|
|
23
|
-
this.target = CellFilterLiteralFloat.from(0);
|
|
24
|
-
}
|
|
25
23
|
|
|
26
24
|
initialize(seed, ecd, grid) {
|
|
27
25
|
super.initialize(seed, ecd, grid);
|
|
@@ -57,8 +55,8 @@ export class ContinuousGridCellActionSetTerrainHeight extends ContinuousGridCell
|
|
|
57
55
|
const gs_x_1 = g_width - 1;
|
|
58
56
|
const gs_y_1 = g_height - 1;
|
|
59
57
|
|
|
60
|
-
const u = x / gs_x_1;
|
|
61
|
-
const v = y / gs_y_1;
|
|
58
|
+
const u = gs_x_1 > 0 ? x / gs_x_1 : 0;
|
|
59
|
+
const v = gs_y_1 > 0 ? y / gs_y_1 : 0;
|
|
62
60
|
|
|
63
61
|
const hs_x_1 = h_width - 1;
|
|
64
62
|
const hs_y_1 = h_height - 1;
|
|
@@ -68,16 +66,16 @@ export class ContinuousGridCellActionSetTerrainHeight extends ContinuousGridCell
|
|
|
68
66
|
|
|
69
67
|
//round down to nearest integer
|
|
70
68
|
const x0 = Math.floor(s_x);
|
|
71
|
-
const x1 = min2(hs_x_1, Math.ceil(s_x
|
|
69
|
+
const x1 = min2(hs_x_1, Math.ceil(s_x ));
|
|
72
70
|
|
|
73
71
|
const y0 = Math.floor(s_y);
|
|
74
|
-
const y1 = min2(hs_y_1, Math.ceil(s_y
|
|
72
|
+
const y1 = min2(hs_y_1, Math.ceil(s_y ));
|
|
75
73
|
|
|
76
|
-
for (let _y = y0; _y
|
|
74
|
+
for (let _y = y0; _y <= y1; _y++) {
|
|
77
75
|
//convert coordinates to grid space
|
|
78
76
|
const _gy = (_y / hs_y_1) * gs_y_1;
|
|
79
77
|
|
|
80
|
-
for (let _x = x0; _x
|
|
78
|
+
for (let _x = x0; _x <= x1; _x++) {
|
|
81
79
|
|
|
82
80
|
//convert coordinates to grid space
|
|
83
81
|
const _gx = (_x / hs_x_1) * gs_x_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskDensityMarkerDistribution.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskDensityMarkerDistribution.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridTaskDensityMarkerDistribution.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskDensityMarkerDistribution.js"],"names":[],"mappings":"AAwBA;IA4BI;;;;;;OAMG;IACH,2EAHW,eAAe,SACf,MAAM,qCAgBhB;IA/CD;;;OAGG;IACH,oBAAe;IAEf;;;OAGG;IACH,kCAAc;IAEd;;;OAGG;IACH,OAFU,eAAe,CAES;IAElC;;;;OAIG;IACH,eAAW;IA2BX;;;;;;;OAOG;IACH,6EAkFC;IAED;;;;;;;;;OASG;IACH,kBARW,MAAM,sBAEN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,IAAI,CAkIhB;IAGD,iDAkEC;CACJ;kCA3WiC,yBAAyB;gCAT3B,gDAAgD;iBAI/D,oCAAoC;sBAC/B,yCAAyC"}
|
|
@@ -19,41 +19,36 @@ import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
|
19
19
|
* @param {number} radius
|
|
20
20
|
*/
|
|
21
21
|
function estimateDensityTarget(radius) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return area;
|
|
22
|
+
return Math.PI * radius * radius;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
|
|
28
25
|
export class GridTaskDensityMarkerDistribution extends GridTaskGenerator {
|
|
29
|
-
constructor() {
|
|
30
|
-
super();
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @type {CellFilter}
|
|
30
|
+
*/
|
|
31
|
+
density = null;
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @type {GridCellActionPlaceMarker}
|
|
36
|
+
*/
|
|
37
|
+
action = null;
|
|
43
38
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @type {NumericInterval}
|
|
42
|
+
*/
|
|
43
|
+
scale = new NumericInterval(1, 1);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* RNG seed offset
|
|
47
|
+
* @type {number}
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
__seed = 0;
|
|
49
51
|
|
|
50
|
-
/**
|
|
51
|
-
* RNG seed offset
|
|
52
|
-
* @type {number}
|
|
53
|
-
* @private
|
|
54
|
-
*/
|
|
55
|
-
this.__seed = 0;
|
|
56
|
-
}
|
|
57
52
|
|
|
58
53
|
/**
|
|
59
54
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskExecuteRuleTimes.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskExecuteRuleTimes.js"],"names":[],"mappings":"AAUA;
|
|
1
|
+
{"version":3,"file":"GridTaskExecuteRuleTimes.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskExecuteRuleTimes.js"],"names":[],"mappings":"AAUA;IAUI;;;;OAIG;IACH,iDAFW,MAAM,4BAShB;IApBG;;;OAGG;IACH,4BAAY;IAEZ,cAAU;IAgBd,iDA+EC;CACJ;kCA1GiC,yBAAyB;sBAHrC,yCAAyC"}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
+
import { BitSet } from "../../../core/binary/BitSet.js";
|
|
2
|
+
import { PI_HALF } from "../../../core/math/PI_HALF.js";
|
|
3
|
+
import { randomIntegerBetween } from "../../../core/math/random/randomIntegerBetween.js";
|
|
1
4
|
import { seededRandom } from "../../../core/math/random/seededRandom.js";
|
|
2
|
-
import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
3
5
|
import Task from "../../../core/process/task/Task.js";
|
|
4
|
-
import { TaskSignal } from "../../../core/process/task/TaskSignal.js";
|
|
5
|
-
import { BitSet } from "../../../core/binary/BitSet.js";
|
|
6
6
|
import TaskGroup from "../../../core/process/task/TaskGroup.js";
|
|
7
|
-
import {
|
|
7
|
+
import { TaskSignal } from "../../../core/process/task/TaskSignal.js";
|
|
8
8
|
import { actionTask } from "../../../core/process/task/util/actionTask.js";
|
|
9
|
-
import {
|
|
9
|
+
import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
10
10
|
|
|
11
11
|
export class GridTaskExecuteRuleTimes extends GridTaskGenerator {
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
14
|
*
|
|
17
15
|
* @type {GridCellPlacementRule}
|
|
18
16
|
*/
|
|
19
|
-
|
|
17
|
+
rule = null;
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
}
|
|
19
|
+
count = 1;
|
|
23
20
|
|
|
24
21
|
/**
|
|
25
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskSequence.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskSequence.js"],"names":[],"mappings":"AAGA;
|
|
1
|
+
{"version":3,"file":"GridTaskSequence.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskSequence.js"],"names":[],"mappings":"AAGA;IAQI;;;;OAIG;IACH,sBAHW,iBAAiB,EAAE,GACjB,gBAAgB,CAQ5B;IAjBG;;;OAGG;IACH,UAFU,iBAAiB,EAAE,CAEf;IAelB,iDA2BC;CACJ;kCAnDiC,yBAAyB;sBADrC,yCAAyC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
2
1
|
import TaskGroup from "../../../core/process/task/TaskGroup.js";
|
|
2
|
+
import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
3
3
|
|
|
4
4
|
export class GridTaskSequence extends GridTaskGenerator {
|
|
5
|
-
constructor() {
|
|
6
|
-
super();
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
*
|
|
10
8
|
* @type {GridTaskGenerator[]}
|
|
11
9
|
*/
|
|
12
|
-
|
|
13
|
-
}
|
|
10
|
+
children = [];
|
|
14
11
|
|
|
15
12
|
/**
|
|
16
13
|
*
|
|
@@ -24,4 +24,4 @@ export class GridTaskActionRuleSet extends GridTaskGenerator {
|
|
|
24
24
|
build(grid: any, ecd: any, seed: any): any;
|
|
25
25
|
}
|
|
26
26
|
import { GridTaskGenerator } from "../../GridTaskGenerator.js";
|
|
27
|
-
//# sourceMappingURL=
|
|
27
|
+
//# sourceMappingURL=GridTaskActionRuleSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridTaskActionRuleSet.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskActionRuleSet.js"],"names":[],"mappings":"AAGA;IAcI;;;;;;OAMG;IACH;;;;QAFa,qBAAqB,CAejC;IAhCD;;;OAGG;IACH,yBAAa;IAEb;;;OAGG;IACH,YAFU,MAAM,CAED;IAwBf,2CAEC;CACJ;kCAzCiC,4BAA4B"}
|