@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
|
@@ -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"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { GridTaskGenerator } from "../../GridTaskGenerator.js";
|
|
2
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
import { GridTaskGenerator } from "../../GridTaskGenerator.js";
|
|
3
3
|
|
|
4
4
|
export class GridTaskActionRuleSet extends GridTaskGenerator {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
this.resolution = 1;
|
|
19
|
-
}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @type {GridActionRuleSet}
|
|
9
|
+
*/
|
|
10
|
+
rules = null;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @type {number}
|
|
15
|
+
*/
|
|
16
|
+
resolution = 1;
|
|
20
17
|
|
|
21
18
|
/**
|
|
22
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskConnectRooms.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskConnectRooms.js"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH;
|
|
1
|
+
{"version":3,"file":"GridTaskConnectRooms.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskConnectRooms.js"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH;IAqDI;;;;;;;OAOG;IACH;;;;;QAFa,oBAAoB,CAiBhC;IA1ED;;;OAGG;IACH,qBAAe;IAEf;;;OAGG;IACH,wBAAoC;IAEpC;;;OAGG;IACH,yBAFU,MAAM,EAAE,CAShB;IAEF;;;OAGG;IACH,uBAFU,MAAM,EAAE,CAahB;IAEF,kBAAc;IAEd;;;OAGG;IACH,uBAAa;IA4Bb;;;;;OAKG;IACH,sCAHW,OAAO,GACL,IAAI,CAqChB;IAED;;;;;;OAMG;IACH,qBALW,MAAM,KACN,MAAM,6BAEN,MAAM,QA8DhB;IAED;;;;;;;OAOG;IACH,mCANW,OAAO,aACP,WAAW,6BAEX,MAAM,GACJ,OAAO,CAwFnB;IAED;;;;;;;;OAQG;IACH,gBAPW,MAAM,KACN,MAAM,aACN,MAAM,6BAEN,WAAW,aACX,MAAM,QAuEhB;IAED;;;;;;;OAOG;IACH,mCALW,MAAM,EAAE,aACR,MAAM,aACN,MAAM,EAAE,GACN,SAAS,CAyBrB;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,0BAEN,MAAM,EAAE,aACR,MAAM,aACN,MAAM,EAAE,QAWlB;IAED,iDAuEC;CACJ;kCAxfiC,4BAA4B;oBAT1C,kCAAkC;iBAErC,uCAAuC;uBANjC,mCAAmC;0BAUhC,0DAA0D;sBAH9D,4CAA4C"}
|
|
@@ -28,59 +28,57 @@ const ESTIMATED_TILES_PER_ROOM = 900;
|
|
|
28
28
|
* 5) perform the connection, expand the "connected" room and repeat steps from 3
|
|
29
29
|
*/
|
|
30
30
|
export class GridTaskConnectRooms extends GridTaskGenerator {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
this.action = null
|
|
83
|
-
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Matches a room tile
|
|
34
|
+
* @type {CellMatcher}
|
|
35
|
+
*/
|
|
36
|
+
matcher = null;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Matches tiles that can be tunneled through
|
|
40
|
+
* @type {CellMatcher}
|
|
41
|
+
*/
|
|
42
|
+
modifiable = matcher_tag_unoccupied;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @type {number[]}
|
|
47
|
+
*/
|
|
48
|
+
neighbourhoodSearchMask = [
|
|
49
|
+
0, -1,
|
|
50
|
+
|
|
51
|
+
-1, 0,
|
|
52
|
+
1, 0,
|
|
53
|
+
|
|
54
|
+
0, 1,
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @type {number[]}
|
|
60
|
+
*/
|
|
61
|
+
neighbourhoodDrawMask = [
|
|
62
|
+
-1, -1,
|
|
63
|
+
0, -1,
|
|
64
|
+
1, -1,
|
|
65
|
+
|
|
66
|
+
-1, 0,
|
|
67
|
+
1, 0,
|
|
68
|
+
|
|
69
|
+
-1, 1,
|
|
70
|
+
0, 1,
|
|
71
|
+
1, 1
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
thickness = 3;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Action to perform on created corridors
|
|
78
|
+
* @type {GridCellAction}
|
|
79
|
+
*/
|
|
80
|
+
action = null
|
|
81
|
+
|
|
84
82
|
|
|
85
83
|
/**
|
|
86
84
|
*
|
package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskBuildSourceDistanceMap.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js"],"names":[],"mappings":"AAUA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"GridTaskBuildSourceDistanceMap.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js"],"names":[],"mappings":"AAUA;;GAEG;AACH;IA0BI;;;;;;;OAOG;IACH;;;;;;uCAgBC;IAhDD;;;OAGG;IACH,2BAAqB;IAErB;;;OAGG;IACH,yBAAmB;IAEnB;;;OAGG;IACH,cAAa;IAEb;;;OAGG;IACH,SAFU,MAAM,CAEA;IA4BhB,iDA8IC;CACJ;kCAxMiC,+BAA+B;sBAJ3C,+CAA+C"}
|
|
@@ -12,33 +12,30 @@ import { GridTaskGenerator } from "../../../GridTaskGenerator.js";
|
|
|
12
12
|
* Build a map of distances across the grid, using 2 concepts: source cells and passable cells. Source cells are where the distance is 0, and passable cells are those that can be travelled through
|
|
13
13
|
*/
|
|
14
14
|
export class GridTaskBuildSourceDistanceMap extends GridTaskGenerator {
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @type {CellMatcher}
|
|
19
|
+
*/
|
|
20
|
+
sourceMatcher = null;
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {CellMatcher}
|
|
25
|
+
*/
|
|
26
|
+
passMatcher = null;
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
/**
|
|
29
|
+
* ID of the target layer
|
|
30
|
+
* @type {String}
|
|
31
|
+
*/
|
|
32
|
+
layer = null;
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
38
|
+
initial = 65535;
|
|
42
39
|
|
|
43
40
|
/**
|
|
44
41
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellSupplierBestN.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/grid/generation/grid/select/CellSupplierBestN.js"],"names":[],"mappings":"AAyBA;
|
|
1
|
+
{"version":3,"file":"CellSupplierBestN.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/grid/generation/grid/select/CellSupplierBestN.js"],"names":[],"mappings":"AAyBA;IAsCI;;;;;OAKG;IACH,0FAqBC;IA/DD;;;OAGG;IACH,SAFU,aAAW,IAAI,CAEV;IAEf;;;OAGG;IACH,QAFU,MAAM,CAEL;IAEX;;;OAGG;IACH,UAFU;QAAC,CAAC,EAAC,MAAM,CAAC;QAAC,CAAC,EAAC,MAAM,CAAC;QAAC,QAAQ,EAAC,MAAM,CAAA;KAAC,EAAE,CAEnC;IAEd;;;OAGG;IACH,WAFU,cAAY,IAAI,CAET;IAEjB;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,gBAFU,OAAO,CAEM;IA+BvB,uCA8EC;CAgBJ;6BAvL4B,mBAAmB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CellSupplier } from "./CellSupplier.js";
|
|
2
1
|
import { assert } from "../../../../../core/assert.js";
|
|
3
|
-
import { CellMatcherAny } from "../../../../rules/CellMatcherAny.js";
|
|
4
2
|
import { PI_HALF } from "../../../../../core/math/PI_HALF.js";
|
|
3
|
+
import { CellMatcherAny } from "../../../../rules/CellMatcherAny.js";
|
|
4
|
+
import { CellSupplier } from "./CellSupplier.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
@@ -24,44 +24,42 @@ function byIndex(a, b) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export class CellSupplierBestN extends CellSupplier {
|
|
27
|
-
constructor() {
|
|
28
|
-
super();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @type {CellFilter|null}
|
|
34
|
-
*/
|
|
35
|
-
this.fitness = null;
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @type {number}
|
|
39
|
-
*/
|
|
40
|
-
this.cursor = 0;
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* @type {{x:number, y:number, rotation:number}[]}
|
|
44
|
-
*/
|
|
45
|
-
this.elements = [];
|
|
46
27
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {CellFilter|null}
|
|
31
|
+
*/
|
|
32
|
+
fitness = null;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
38
|
+
cursor = 0;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {{x:number, y:number, rotation:number}[]}
|
|
43
|
+
*/
|
|
44
|
+
elements = [];
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {CellMatcher|null}
|
|
49
|
+
*/
|
|
50
|
+
predicate = null;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {number}
|
|
55
|
+
*/
|
|
56
|
+
limit = 0;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {boolean}
|
|
61
|
+
*/
|
|
62
|
+
allow_rotation = false;
|
|
65
63
|
|
|
66
64
|
/**
|
|
67
65
|
* @param {CellFilter} fitness
|
|
@@ -75,6 +73,7 @@ export class CellSupplierBestN extends CellSupplier {
|
|
|
75
73
|
limit = 1,
|
|
76
74
|
allow_rotation = false
|
|
77
75
|
}) {
|
|
76
|
+
|
|
78
77
|
assert.isNumber(limit, 'limit');
|
|
79
78
|
assert.isNonNegativeInteger(limit, 'limit');
|
|
80
79
|
assert.equal(fitness.isCellFilter, true, 'fitness.isCellFilter !== true');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellSupplierPathUpHill.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/grid/generation/grid/select/CellSupplierPathUpHill.js"],"names":[],"mappings":"AAUA;;;GAGG;AACH;
|
|
1
|
+
{"version":3,"file":"CellSupplierPathUpHill.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/grid/generation/grid/select/CellSupplierPathUpHill.js"],"names":[],"mappings":"AAUA;;;GAGG;AACH;IAyCI;;;;OAIG;IACH,4EAUC;IAtDG;;;OAGG;IACH,QAFU,cAAY,IAAI,CAEZ;IAEd;;;OAGG;IACH,OAFU,aAAW,IAAI,CAEZ;IAEb;;;;OAIG;IACH,mBAA0B;IAC1B;;;;OAIG;IACH,sBAA6B;IAE7B;;;;OAIG;IACH,wBAAuB;IAEvB;;;;OAIG;IACH,eAAc;IAmBlB,uCAiCC;CA8EJ;6BArL4B,mBAAmB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CellSupplier } from "./CellSupplier.js";
|
|
2
|
-
import { BitSet } from "../../../../../core/binary/BitSet.js";
|
|
3
1
|
import { assert } from "../../../../../core/assert.js";
|
|
2
|
+
import { BitSet } from "../../../../../core/binary/BitSet.js";
|
|
3
|
+
import { CellSupplier } from "./CellSupplier.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
@@ -13,48 +13,45 @@ const scratch_neighbours = new Uint32Array(4);
|
|
|
13
13
|
* Useful for tracing paths between features, such as path between a shipyard and the nearest water source
|
|
14
14
|
*/
|
|
15
15
|
export class CellSupplierPathUpHill extends CellSupplier {
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
16
|
|
|
19
17
|
/**
|
|
20
18
|
*
|
|
21
19
|
* @type {CellMatcher|null}
|
|
22
20
|
*/
|
|
23
|
-
|
|
21
|
+
source = null;
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
*
|
|
27
25
|
* @type {CellFilter|null}
|
|
28
26
|
*/
|
|
29
|
-
|
|
27
|
+
value = null;
|
|
30
28
|
|
|
31
29
|
/**
|
|
32
30
|
*
|
|
33
31
|
* @type {BitSet}
|
|
34
32
|
* @private
|
|
35
33
|
*/
|
|
36
|
-
|
|
34
|
+
__open_set = new BitSet();
|
|
37
35
|
/**
|
|
38
36
|
*
|
|
39
37
|
* @type {BitSet}
|
|
40
38
|
* @private
|
|
41
39
|
*/
|
|
42
|
-
|
|
40
|
+
__visited_set = new BitSet();
|
|
43
41
|
|
|
44
42
|
/**
|
|
45
43
|
*
|
|
46
44
|
* @type { Float32Array|null}
|
|
47
45
|
* @private
|
|
48
46
|
*/
|
|
49
|
-
|
|
47
|
+
__cached_values = null;
|
|
50
48
|
|
|
51
49
|
/**
|
|
52
50
|
*
|
|
53
51
|
* @type {GridData|null}
|
|
54
52
|
* @private
|
|
55
53
|
*/
|
|
56
|
-
|
|
57
|
-
}
|
|
54
|
+
__grid = null;
|
|
58
55
|
|
|
59
56
|
/**
|
|
60
57
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathEndPoint.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/road/PathEndPoint.js"],"names":[],"mappings":"AAKA;
|
|
1
|
+
{"version":3,"file":"PathEndPoint.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/road/PathEndPoint.js"],"names":[],"mappings":"AAKA;IAYI;;;;OAIG;IACH,mCAFa,YAAY,CAaxB;IAED;;;;;;OAMG;IACH,mBALW,MAAM,KACN,MAAM,eAEJ,YAAY,CAUxB;IA3CD,kBAAyB;IAEzB,aAAgC;IAEhC;;;OAGG;IACH,YAFU,iBAAe,CAEP;IAsClB;;;;OAIG;IACH,oCAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,4BAHW,MAAM,GACJ,OAAO,CAInB;CACJ;oBArEmB,kCAAkC"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
1
2
|
import Vector2 from "../../../../core/geom/Vector2.js";
|
|
2
3
|
import { PathEndPointKind } from "./PathEndPointKind.js";
|
|
3
|
-
import { assert } from "../../../../core/assert.js";
|
|
4
4
|
import { readMarkerNodeGroupId } from "./readMarkerNodeGroupId.js";
|
|
5
5
|
|
|
6
6
|
export class PathEndPoint {
|
|
7
|
-
constructor() {
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
position = new Vector2();
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
type = PathEndPointKind.Unknown;
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @type {MarkerNode|Path}
|
|
15
|
+
*/
|
|
16
|
+
attachment = null;
|
|
19
17
|
|
|
20
18
|
/**
|
|
21
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoadConnection.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/road/RoadConnection.js"],"names":[],"mappings":"AAEA;
|
|
1
|
+
{"version":3,"file":"RoadConnection.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/road/RoadConnection.js"],"names":[],"mappings":"AAEA;IAqBI;;;;;OAKG;IACH,iEAFW,MAAM,EAAE,kBAgBlB;IAvCG;;;OAGG;IACH,qBAAc;IAEd;;;OAGG;IACH,qBAAc;IAEd;;;OAGG;IACH,SAFU,MAAM,EAAE,CAEL;IAyBjB;;;;OAIG;IACH,oCAFW,MAAM,QAuBhB;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,OAAO,CAcnB;IAED;;;;OAIG;IACH,4CAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,4BAHW,MAAM,GACJ,OAAO,CAInB;CACJ"}
|