@woosh/meep-engine 2.118.4 → 2.118.6
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 +520 -479
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +520 -479
- package/package.json +4 -4
- package/src/core/binary/BitSet.d.ts +0 -5
- package/src/core/binary/BitSet.d.ts.map +1 -1
- package/src/core/binary/BitSet.js +2 -10
- package/src/core/binary/base64/Base64.d.ts.map +1 -0
- package/src/core/binary/largest_common_alignment_uint32.d.ts.map +1 -0
- package/src/core/{collection/array/typed → binary}/largest_common_alignment_uint32.js +1 -1
- package/src/core/collection/CuckooFilter.d.ts +34 -8
- package/src/core/collection/CuckooFilter.d.ts.map +1 -1
- package/src/core/collection/CuckooFilter.js +29 -1
- package/src/core/collection/array/typed/array_buffer_copy.d.ts.map +1 -1
- package/src/core/collection/array/typed/array_buffer_copy.js +3 -1
- package/src/core/collection/array/typed/is_array_buffer_equals.js +1 -1
- package/src/core/collection/array/typed/is_typed_array_equals.js +1 -1
- package/src/core/collection/map/HashMap.js +7 -7
- package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/AABB2.js +43 -22
- package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.js +6 -1
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts +3 -5
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts.map +1 -1
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.js +9 -19
- package/src/core/geom/2d/rectangle_to_aabb.d.ts +8 -0
- package/src/core/geom/2d/rectangle_to_aabb.d.ts.map +1 -0
- package/src/core/geom/2d/rectangle_to_aabb.js +29 -0
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +1 -1
- package/src/core/graph/graph_compute_distance_matrix.d.ts +1 -1
- package/src/core/graph/graph_compute_distance_matrix.d.ts.map +1 -1
- package/src/core/graph/graph_compute_distance_matrix.js +1 -1
- package/src/core/graph/graph_compute_laplacian_matrix.d.ts +1 -1
- package/src/core/graph/graph_compute_laplacian_matrix.d.ts.map +1 -1
- package/src/core/graph/graph_compute_laplacian_matrix.js +1 -1
- package/src/core/graph/layout/CircleLayout.js +2 -2
- package/src/core/graph/layout/box/BoxLayouter.d.ts.map +1 -1
- package/src/core/graph/layout/box/BoxLayouter.js +11 -5
- package/src/core/graph/layout/box/aabb2_force_into_container.d.ts +7 -0
- package/src/core/graph/layout/box/aabb2_force_into_container.d.ts.map +1 -0
- package/src/core/graph/layout/box/aabb2_force_into_container.js +56 -0
- package/src/core/graph/layout/box/applyCentralGravityAABB2.d.ts.map +1 -1
- package/src/core/graph/layout/box/applyCentralGravityAABB2.js +2 -8
- package/src/core/graph/layout/box/forceIntoBox.d.ts +4 -2
- package/src/core/graph/layout/box/forceIntoBox.d.ts.map +1 -1
- package/src/core/graph/layout/box/forceIntoBox.js +5 -31
- package/src/core/graph/layout/box/position_box_next_to_box.d.ts +10 -0
- package/src/core/graph/layout/box/position_box_next_to_box.d.ts.map +1 -0
- package/src/core/graph/layout/box/position_box_next_to_box.js +218 -0
- package/src/core/graph/layout/box/pullBoxTowardsPoint.d.ts.map +1 -1
- package/src/core/graph/layout/box/pullBoxTowardsPoint.js +8 -3
- package/src/core/graph/layout/box/resolveAABB2Overlap.d.ts +2 -2
- package/src/core/graph/layout/box/resolveAABB2Overlap.d.ts.map +1 -1
- package/src/core/graph/layout/box/resolveAABB2Overlap.js +12 -4
- package/src/core/graph/layout/box/resolveBoxOverlapUsingForce.d.ts +1 -0
- package/src/core/graph/layout/box/resolveBoxOverlapUsingForce.d.ts.map +1 -1
- package/src/core/graph/layout/box/resolveBoxOverlapUsingForce.js +1 -0
- package/src/core/math/hash/squirrel3.d.ts +1 -0
- package/src/core/math/hash/squirrel3.d.ts.map +1 -1
- package/src/core/math/hash/squirrel3.js +1 -0
- package/src/core/math/matrix/SquareMatrix.d.ts.map +1 -0
- package/src/core/{graph → math/matrix}/SquareMatrix.js +3 -3
- package/src/core/math/random/seededRandom_MersenneTwister.d.ts +7 -0
- package/src/core/math/random/seededRandom_MersenneTwister.d.ts.map +1 -0
- package/src/core/math/random/{seededRandomMersenneTwister.js → seededRandom_MersenneTwister.js} +4 -2
- package/src/core/math/spline/cubicCurve.d.ts +3 -8
- package/src/core/math/spline/cubicCurve.d.ts.map +1 -1
- package/src/core/math/spline/cubicCurve.js +4 -32
- package/src/core/model/reactive/js/compileReactiveToJS.d.ts.map +1 -1
- package/src/core/model/reactive/js/compileReactiveToJS.js +56 -1
- package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
- package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
- package/src/core/model/reactive/trigger/ReactiveTrigger.d.ts +2 -2
- package/src/core/model/reactive/trigger/ReactiveTrigger.d.ts.map +1 -1
- package/src/core/model/reactive/trigger/ReactiveTrigger.js +1 -1
- package/src/core/process/BaseProcess.d.ts.map +1 -1
- package/src/core/process/BaseProcess.js +8 -7
- package/src/core/process/SimpleLifecycle.d.ts +5 -0
- package/src/core/process/SimpleLifecycle.d.ts.map +1 -1
- package/src/core/process/SimpleLifecycle.js +8 -0
- package/src/core/process/task/Task.js +1 -1
- package/src/engine/animation/clip/AnimationClip.d.ts.map +1 -1
- package/src/engine/animation/clip/AnimationClip.js +50 -8
- package/src/engine/animation/clip/AnimationClipBinding.js +1 -1
- package/src/engine/animation/clip/AnimationTrack.d.ts +11 -1
- package/src/engine/animation/clip/AnimationTrack.d.ts.map +1 -1
- package/src/engine/animation/clip/AnimationTrack.js +50 -7
- package/src/engine/animation/curve/binding/BoundPlainNumericPropertyWriter.d.ts +8 -0
- package/src/engine/animation/curve/binding/BoundPlainNumericPropertyWriter.d.ts.map +1 -0
- package/src/engine/animation/curve/binding/BoundPlainNumericPropertyWriter.js +16 -0
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/splat/SplatMapping.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/splat/SplatMapping.js +6 -6
- package/src/engine/graphics/texture/sampler/Sampler2D.js +1 -1
- package/src/engine/intelligence/optimization/optimize_cyclic_sequence_pairwise.d.ts +12 -0
- package/src/engine/intelligence/optimization/optimize_cyclic_sequence_pairwise.d.ts.map +1 -0
- package/src/engine/intelligence/optimization/optimize_cyclic_sequence_pairwise.js +90 -0
- package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.d.ts +3 -3
- package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js +6 -6
- package/src/generation/grid/generation/discrete/GridTaskCellularAutomata.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskCellularAutomata.js +35 -31
- package/src/generation/grid/generation/grid/GridTaskAddNodesFixed.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/GridTaskAddNodesFixed.js +8 -11
- package/src/generation/grid/generation/road/RoadConnectionNetwork.d.ts +6 -2
- package/src/generation/grid/generation/road/RoadConnectionNetwork.d.ts.map +1 -1
- package/src/generation/grid/generation/road/RoadConnectionNetwork.js +36 -30
- package/src/generation/placement/action/GridCellAction.js +1 -1
- package/src/generation/theme/AreaTheme.d.ts.map +1 -1
- package/src/generation/theme/AreaTheme.js +0 -1
- package/src/generation/theme/TerrainLayerRule.d.ts.map +1 -1
- package/src/generation/theme/TerrainLayerRule.js +2 -1
- package/src/generation/theme/TerrainLayerRuleAggregator.d.ts +5 -1
- package/src/generation/theme/TerrainLayerRuleAggregator.d.ts.map +1 -1
- package/src/generation/theme/TerrainLayerRuleAggregator.js +7 -2
- package/src/generation/theme/ThemeEngine.d.ts +2 -2
- package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
- package/src/generation/theme/ThemeEngine.js +1 -4
- package/src/generation/theme/cell/CellProcessingRule.d.ts.map +1 -1
- package/src/generation/theme/cell/CellProcessingRule.js +10 -13
- package/src/generation/theme/cell/CellProcessingRuleSet.d.ts.map +1 -1
- package/src/generation/theme/cell/CellProcessingRuleSet.js +6 -7
- package/src/view/SVG.d.ts.map +1 -1
- package/src/view/SVG.js +0 -15
- package/src/view/html_element_to_aabb.d.ts +8 -0
- package/src/view/html_element_to_aabb.d.ts.map +1 -0
- package/src/view/html_element_to_aabb.js +29 -0
- package/src/view/tooltip/TooltipManager.d.ts.map +1 -1
- package/src/view/tooltip/TooltipManager.js +7 -9
- package/src/view/tooltip/TooltipView.d.ts +0 -1
- package/src/view/tooltip/TooltipView.d.ts.map +1 -1
- package/src/view/tooltip/TooltipView.js +10 -280
- package/src/view/tooltip/gml/TooltipParser.d.ts.map +1 -1
- package/src/view/tooltip/gml/TooltipParser.js +1 -13
- package/src/core/binary/Base64.d.ts.map +0 -1
- package/src/core/collection/array/typed/largest_common_alignment_uint32.d.ts.map +0 -1
- package/src/core/graph/SquareMatrix.d.ts.map +0 -1
- package/src/core/math/random/MersenneTwister.d.ts +0 -19
- package/src/core/math/random/MersenneTwister.d.ts.map +0 -1
- package/src/core/math/random/MersenneTwister.js +0 -212
- package/src/core/math/random/seededRandomMersenneTwister.d.ts +0 -7
- package/src/core/math/random/seededRandomMersenneTwister.d.ts.map +0 -1
- package/src/engine/simulation/DormandPrince.d.ts +0 -19
- package/src/engine/simulation/DormandPrince.d.ts.map +0 -1
- package/src/engine/simulation/DormandPrince.js +0 -242
- /package/src/core/binary/{Base64.d.ts → base64/Base64.d.ts} +0 -0
- /package/src/core/binary/{Base64.js → base64/Base64.js} +0 -0
- /package/src/core/{collection/array/typed → binary}/largest_common_alignment_uint32.d.ts +0 -0
- /package/src/core/{graph → math/matrix}/SquareMatrix.d.ts +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { create_simplex_noise_2d } from "../../../../core/math/noise/create_simplex_noise_2d.js";
|
|
1
2
|
import { seededRandom } from "../../../../core/math/random/seededRandom.js";
|
|
2
3
|
import { CellFilter } from "../../CellFilter.js";
|
|
3
|
-
import { CellFilterAdd } from "../math/algebra/CellFilterAdd.js";
|
|
4
|
-
import { CellFilterMultiply } from "../math/algebra/CellFilterMultiply.js";
|
|
5
4
|
import { CellFilterLiteralFloat } from "../CellFilterLiteralFloat.js";
|
|
5
|
+
import { CellFilterAdd } from "../math/algebra/CellFilterAdd.js";
|
|
6
6
|
import { CellFilterDivide } from "../math/algebra/CellFilterDivide.js";
|
|
7
|
-
import {
|
|
7
|
+
import { CellFilterMultiply } from "../math/algebra/CellFilterMultiply.js";
|
|
8
8
|
|
|
9
9
|
export class CellFilterSimplexNoise extends CellFilter {
|
|
10
10
|
|
|
@@ -37,9 +37,9 @@ export class CellFilterSimplexNoise extends CellFilter {
|
|
|
37
37
|
* Build a fractal noise filter with a given number of octaves
|
|
38
38
|
* @param {number} octaves
|
|
39
39
|
* @param {number} scale
|
|
40
|
-
* @param {number} persistence
|
|
41
|
-
* @param {number} lacunarity
|
|
42
|
-
* @param {number} seed
|
|
40
|
+
* @param {number} [persistence]
|
|
41
|
+
* @param {number} [lacunarity]
|
|
42
|
+
* @param {number} [seed]
|
|
43
43
|
* @returns {CellFilter}
|
|
44
44
|
*/
|
|
45
45
|
static fractal(octaves, scale, seed = 0, persistence = 0.5, lacunarity = 2) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskCellularAutomata.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskCellularAutomata.js"],"names":[],"mappings":"AASA;
|
|
1
|
+
{"version":3,"file":"GridTaskCellularAutomata.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskCellularAutomata.js"],"names":[],"mappings":"AASA;IA0BI;;;;;;OAMG;IACH;;;;;iCAyBC;IAvDD,mBAAe;IACf,oBAAgB;IAChB,kBAAc;IACd,qBAAiB;IAEjB;;;OAGG;IACH,OAFU,MAAM,CAEL;IAEX;;;OAGG;IACH,WAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,uBAAc;IAoCd,iDA8DC;CACJ;kCA7HiC,4BAA4B;sBALxC,4CAA4C"}
|
|
@@ -1,39 +1,37 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
1
2
|
import { seededRandom } from "../../../../core/math/random/seededRandom.js";
|
|
2
|
-
import { GridTaskGenerator } from "../../GridTaskGenerator.js";
|
|
3
|
-
import { CaveGeneratorCellularAutomata } from "../../../automata/CaveGeneratorCellularAutomata.js";
|
|
4
|
-
import { Sampler2D } from "../../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
5
3
|
import TaskGroup from "../../../../core/process/task/TaskGroup.js";
|
|
6
|
-
import { assert } from "../../../../core/assert.js";
|
|
7
4
|
import { actionTask } from "../../../../core/process/task/util/actionTask.js";
|
|
8
5
|
import { countTask } from "../../../../core/process/task/util/countTask.js";
|
|
6
|
+
import { Sampler2D } from "../../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
7
|
+
import { CaveGeneratorCellularAutomata } from "../../../automata/CaveGeneratorCellularAutomata.js";
|
|
8
|
+
import { GridTaskGenerator } from "../../GridTaskGenerator.js";
|
|
9
9
|
|
|
10
10
|
export class GridTaskCellularAutomata extends GridTaskGenerator {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.action = null;
|
|
36
|
-
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
marginLeft = 0;
|
|
14
|
+
marginRight = 0;
|
|
15
|
+
marginTop = 0;
|
|
16
|
+
marginBottom = 0;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {number}
|
|
21
|
+
*/
|
|
22
|
+
steps = 50;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Probability of cell being initialized at filled
|
|
26
|
+
* @type {number}
|
|
27
|
+
*/
|
|
28
|
+
threshold = 0.57;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {GridCellAction}
|
|
33
|
+
*/
|
|
34
|
+
action = null;
|
|
37
35
|
|
|
38
36
|
/**
|
|
39
37
|
*
|
|
@@ -42,7 +40,13 @@ export class GridTaskCellularAutomata extends GridTaskGenerator {
|
|
|
42
40
|
* @param {number} [margin]
|
|
43
41
|
* @param {number} [threshold]
|
|
44
42
|
*/
|
|
45
|
-
static from({
|
|
43
|
+
static from({
|
|
44
|
+
name = 'cellular automata',
|
|
45
|
+
action,
|
|
46
|
+
margin = 0,
|
|
47
|
+
threshold = 0.57
|
|
48
|
+
}) {
|
|
49
|
+
|
|
46
50
|
assert.equal(action.isGridCellAction, true, 'action.isGridCellAction !== true');
|
|
47
51
|
assert.isNumber(margin);
|
|
48
52
|
assert.isNumber(threshold);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskAddNodesFixed.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/grid/GridTaskAddNodesFixed.js"],"names":[],"mappings":"AAKA;
|
|
1
|
+
{"version":3,"file":"GridTaskAddNodesFixed.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/grid/GridTaskAddNodesFixed.js"],"names":[],"mappings":"AAKA;IAQI;;;;OAIG;IACH,uCAFY,qBAAqB,CAUhC;IAnBD;;;OAGG;IACH,yBAAa;IAiBb,+FASC;CACJ;kCAnCiC,4BAA4B"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { GridTaskGenerator } from "../../GridTaskGenerator.js";
|
|
2
|
-
import { MarkerNodeConsumerBuffer } from "../../../markers/emitter/MarkerNodeConsumerBuffer.js";
|
|
3
1
|
import { assert } from "../../../../core/assert.js";
|
|
4
2
|
import { actionTask } from "../../../../core/process/task/util/actionTask.js";
|
|
3
|
+
import { MarkerNodeConsumerBuffer } from "../../../markers/emitter/MarkerNodeConsumerBuffer.js";
|
|
4
|
+
import { GridTaskGenerator } from "../../GridTaskGenerator.js";
|
|
5
5
|
|
|
6
6
|
export class GridTaskAddNodesFixed extends GridTaskGenerator {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
this.nodes = null;
|
|
15
|
-
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @type {MarkerNodeEmitter}
|
|
11
|
+
*/
|
|
12
|
+
nodes = null;
|
|
16
13
|
|
|
17
14
|
/**
|
|
18
15
|
*
|
|
@@ -4,6 +4,10 @@ export class RoadConnectionNetwork {
|
|
|
4
4
|
* @type {QuadTreeNode<RoadConnection>}
|
|
5
5
|
*/
|
|
6
6
|
index: QuadTreeNode<RoadConnection>;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @type {number}
|
|
10
|
+
*/
|
|
7
11
|
width: number;
|
|
8
12
|
/**
|
|
9
13
|
*
|
|
@@ -12,9 +16,9 @@ export class RoadConnectionNetwork {
|
|
|
12
16
|
groupLookup: Map<number, RoadConnection[]>;
|
|
13
17
|
/**
|
|
14
18
|
*
|
|
15
|
-
* @param {
|
|
19
|
+
* @param {RoadConnection[]} result
|
|
16
20
|
*/
|
|
17
|
-
requestAll(result:
|
|
21
|
+
requestAll(result: RoadConnection[]): void;
|
|
18
22
|
/**
|
|
19
23
|
*
|
|
20
24
|
* @param {number} id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoadConnectionNetwork.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/road/RoadConnectionNetwork.js"],"names":[],"mappings":"AAcA;
|
|
1
|
+
{"version":3,"file":"RoadConnectionNetwork.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/road/RoadConnectionNetwork.js"],"names":[],"mappings":"AAcA;IAEI;;;OAGG;IACH,OAFU,4BAA4B,CAEX;IAE3B;;;OAGG;IACH,OAFU,MAAM,CAEL;IAEX;;;OAGG;IACH,aAFU,IAAI,MAAM,EAAE,gBAAgB,CAAC,CAEf;IAExB;;;OAGG;IACH,mBAFW,gBAAgB,QAI1B;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;OAKG;IACH,+BAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAoBnB;IAED;;;;;OAKG;IACH,+BAgBC;IAED;;;OAGG;IACH,gCAQC;IAED;;;;;;OAMG;IACH,uBALW,gBAAgB,KAChB,MAAM,KACN,MAAM,GACJ,MAAM,CAwClB;CACJ;6BA/J4B,oDAAoD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QuadTreeNode } from "../../../../core/geom/2d/quad-tree/QuadTreeNode.js";
|
|
2
|
-
import AABB2 from "../../../../core/geom/AABB2.js";
|
|
3
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
import AABB2 from "../../../../core/geom/2d/aabb/AABB2.js";
|
|
3
|
+
import { QuadTreeNode } from "../../../../core/geom/2d/quad-tree/QuadTreeNode.js";
|
|
4
4
|
import { PathEndPointKind } from "./PathEndPointKind.js";
|
|
5
5
|
import { readMarkerNodeGroupId } from "./readMarkerNodeGroupId.js";
|
|
6
6
|
|
|
@@ -8,31 +8,33 @@ import { readMarkerNodeGroupId } from "./readMarkerNodeGroupId.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @type {QuadTreeDatum<RoadConnection>[]}
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const scratch_paths = [];
|
|
12
12
|
|
|
13
13
|
const bounds = new AABB2();
|
|
14
14
|
|
|
15
15
|
export class RoadConnectionNetwork {
|
|
16
|
-
constructor() {
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @type {QuadTreeNode<RoadConnection>}
|
|
20
|
+
*/
|
|
21
|
+
index = new QuadTreeNode();
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @type {number}
|
|
26
|
+
*/
|
|
27
|
+
width = -1;
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @type {Map<number, RoadConnection[]>}
|
|
32
|
+
*/
|
|
33
|
+
groupLookup = new Map();
|
|
32
34
|
|
|
33
35
|
/**
|
|
34
36
|
*
|
|
35
|
-
* @param {
|
|
37
|
+
* @param {RoadConnection[]} result
|
|
36
38
|
*/
|
|
37
39
|
requestAll(result) {
|
|
38
40
|
this.index.getRawData(result);
|
|
@@ -69,6 +71,8 @@ export class RoadConnectionNetwork {
|
|
|
69
71
|
return true;
|
|
70
72
|
}
|
|
71
73
|
}
|
|
74
|
+
|
|
75
|
+
return false;
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
/**
|
|
@@ -122,35 +126,37 @@ export class RoadConnectionNetwork {
|
|
|
122
126
|
|
|
123
127
|
const q_x0 = x - 0.1;
|
|
124
128
|
const q_y0 = y - 0.1;
|
|
129
|
+
|
|
125
130
|
const q_x1 = x + 0.1;
|
|
126
131
|
const q_y1 = y + 0.1;
|
|
127
132
|
|
|
128
|
-
const
|
|
129
|
-
|
|
133
|
+
const intersection_count = this.index.requestDatumIntersectionsRectangle(
|
|
134
|
+
scratch_paths,
|
|
135
|
+
q_x0, q_y0,
|
|
136
|
+
q_x1, q_y1
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
let result_count = 0;
|
|
130
140
|
|
|
131
|
-
if (
|
|
141
|
+
if (intersection_count > 0) {
|
|
132
142
|
|
|
133
143
|
const index = x + y * this.width;
|
|
134
144
|
|
|
135
|
-
for (let j = 0; j <
|
|
145
|
+
for (let j = 0; j < intersection_count; j++) {
|
|
136
146
|
|
|
137
|
-
const
|
|
147
|
+
const datum = scratch_paths[j];
|
|
138
148
|
|
|
139
|
-
|
|
140
|
-
*
|
|
141
|
-
* @type {Path}
|
|
142
|
-
*/
|
|
143
|
-
const encounteredPath = encounteredPathDatum.data;
|
|
149
|
+
const path = datum.data;
|
|
144
150
|
|
|
145
|
-
if (
|
|
151
|
+
if (path.test(index)) {
|
|
146
152
|
|
|
147
|
-
result[
|
|
153
|
+
result[result_count++] = path;
|
|
148
154
|
|
|
149
155
|
}
|
|
150
156
|
|
|
151
157
|
}
|
|
152
158
|
}
|
|
153
159
|
|
|
154
|
-
return
|
|
160
|
+
return result_count;
|
|
155
161
|
}
|
|
156
162
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaTheme.d.ts","sourceRoot":"","sources":["../../../../src/generation/theme/AreaTheme.js"],"names":[],"mappings":"AAEA;IACI,eAAsB;IAEtB;;;OAGG;IACH,aAAa;
|
|
1
|
+
{"version":3,"file":"AreaTheme.d.ts","sourceRoot":"","sources":["../../../../src/generation/theme/AreaTheme.js"],"names":[],"mappings":"AAEA;IACI,eAAsB;IAEtB;;;OAGG;IACH,aAAa;CAChB;yBAVwB,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerrainLayerRule.d.ts","sourceRoot":"","sources":["../../../../src/generation/theme/TerrainLayerRule.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TerrainLayerRule.d.ts","sourceRoot":"","sources":["../../../../src/generation/theme/TerrainLayerRule.js"],"names":[],"mappings":"AAIA;IAcI;;;;;OAKG;IACH,uCAHW,uBAAuB,GACrB,gBAAgB,CAa5B;IA9BD;;;OAGG;IACH,mBAAwC;IAExC;;;OAGG;IACH,OAFU,uBAAuB,CAEK;CAqBzC;wCAlCuC,8BAA8B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { assert } from "../../core/assert.js";
|
|
2
|
+
import { CellFilterLiteralFloat } from "../filtering/numeric/CellFilterLiteralFloat.js";
|
|
2
3
|
import { TerrainLayerDescription } from "./TerrainLayerDescription.js";
|
|
3
4
|
|
|
4
5
|
export class TerrainLayerRule {
|
|
@@ -6,7 +7,7 @@ export class TerrainLayerRule {
|
|
|
6
7
|
*
|
|
7
8
|
* @type {CellFilter}
|
|
8
9
|
*/
|
|
9
|
-
filter =
|
|
10
|
+
filter = CellFilterLiteralFloat.from(1);
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
*
|
|
@@ -16,7 +16,11 @@ export class TerrainLayerRuleAggregator {
|
|
|
16
16
|
* @param {number} power
|
|
17
17
|
*/
|
|
18
18
|
add(layer: number, power: number): void;
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param {number} m What should the weights add up to?
|
|
22
|
+
*/
|
|
23
|
+
normalize(m?: number): void;
|
|
20
24
|
clear(): void;
|
|
21
25
|
}
|
|
22
26
|
//# sourceMappingURL=TerrainLayerRuleAggregator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerrainLayerRuleAggregator.d.ts","sourceRoot":"","sources":["../../../../src/generation/theme/TerrainLayerRuleAggregator.js"],"names":[],"mappings":"AAEA;IACI;;;OAGG;IACH,wBAFW,MAAM,
|
|
1
|
+
{"version":3,"file":"TerrainLayerRuleAggregator.d.ts","sourceRoot":"","sources":["../../../../src/generation/theme/TerrainLayerRuleAggregator.js"],"names":[],"mappings":"AAEA;IACI;;;OAGG;IACH,wBAFW,MAAM,EAYhB;IANG;;;OAGG;IACH,YAFU,MAAM,CAEY;IAC5B,qBAA0C;IAG9C;;;;OAIG;IACH,WAHW,MAAM,SACN,MAAM,QAIhB;IAED;;;OAGG;IACH,cAFW,MAAM,QAwBhB;IAED,cAEC;CACJ"}
|
|
@@ -7,7 +7,8 @@ export class TerrainLayerRuleAggregator {
|
|
|
7
7
|
*/
|
|
8
8
|
constructor(layerCount) {
|
|
9
9
|
|
|
10
|
-
assert.
|
|
10
|
+
assert.isNonNegativeInteger(layerCount, 'layerCount');
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
*
|
|
13
14
|
* @type {number}
|
|
@@ -25,7 +26,11 @@ export class TerrainLayerRuleAggregator {
|
|
|
25
26
|
this.powers[layer] += power;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param {number} m What should the weights add up to?
|
|
32
|
+
*/
|
|
33
|
+
normalize(m = 1) {
|
|
29
34
|
let magnitude = 0;
|
|
30
35
|
|
|
31
36
|
const layerCount = this.layerCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeEngine.d.ts","sourceRoot":"","sources":["../../../../src/generation/theme/ThemeEngine.js"],"names":[],"mappings":"AAoFA;IAEI;;;OAGG;IACH,OAFU,uBAAuB,CAEN;IAE3B;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"ThemeEngine.d.ts","sourceRoot":"","sources":["../../../../src/generation/theme/ThemeEngine.js"],"names":[],"mappings":"AAoFA;IAEI;;;OAGG;IACH,OAFU,uBAAuB,CAEN;IAE3B;;;OAGG;IACH,uBAFqB,MAAM,CAEF;IAEzB;;;;OAIG;IACH,uBAAsB;IAEtB,2BAEC;IAED;;;OAGG;IACH,sBAEC;IAED;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,4BAUC;IAED;;;;;;OAMG;IACH,4BALW,WAAW,KACX,MAAM,KACN,MAAM,GACJ,MAAM,CA8BlB;IAED;;;;;;OAMG;IACH,uBALW,MAAM,gDAGJ,IAAI,CAmChB;IAED;;;;;OAKG;IACH,sDAFa,SAAS,CA8KrB;IAED;;;;;;OAMG;IACH,+DAHW,MAAM,GACJ,IAAI,GAAC,SAAS,CAoG1B;IAED;;;;OAIG;IACH,kEAqCC;IAED;;;;OAIG;IACH,iCAFa,IAAI,CAIhB;IAED;;;;OAIG;IACH,uCAHa,SAAS,CAYrB;IAED;;;;;OAKG;IACH,oDAFa,SAAS,CA6DrB;CACJ;6BA/nB4B,8CAA8C;iBAK1D,iCAAiC;sBAC5B,sCAAsC"}
|
|
@@ -91,7 +91,7 @@ export class ThemeEngine {
|
|
|
91
91
|
areas = new QuadTreeNode();
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* @readonly
|
|
95
95
|
* @type {function():number}
|
|
96
96
|
*/
|
|
97
97
|
random = seededRandom(1);
|
|
@@ -235,9 +235,6 @@ export class ThemeEngine {
|
|
|
235
235
|
assert.equal(width, terrain.size.x);
|
|
236
236
|
assert.equal(height, terrain.size.y);
|
|
237
237
|
|
|
238
|
-
|
|
239
|
-
const random = this.random;
|
|
240
|
-
|
|
241
238
|
/**
|
|
242
239
|
*
|
|
243
240
|
* @type {AreaTheme[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellProcessingRule.d.ts","sourceRoot":"","sources":["../../../../../src/generation/theme/cell/CellProcessingRule.js"],"names":[],"mappings":"AAEA;
|
|
1
|
+
{"version":3,"file":"CellProcessingRule.d.ts","sourceRoot":"","sources":["../../../../../src/generation/theme/cell/CellProcessingRule.js"],"names":[],"mappings":"AAEA;IAcI;;;;OAIG;IACH,sFAUC;IA3BD;;;OAGG;IACH,mBAAc;IAEd;;;OAGG;IACH,iCAAc;IAmBd;;;;;OAKG;IACH,iBAJW,MAAM,qDAYhB;CACJ"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
2
|
|
|
3
3
|
export class CellProcessingRule {
|
|
4
|
-
constructor() {
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @type {ContinuousGridCellAction}
|
|
15
|
-
*/
|
|
16
|
-
this.action = null;
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @type {CellFilter}
|
|
8
|
+
*/
|
|
9
|
+
filter = null;
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @type {ContinuousGridCellAction}
|
|
14
|
+
*/
|
|
15
|
+
action = null;
|
|
19
16
|
|
|
20
17
|
/**
|
|
21
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellProcessingRuleSet.d.ts","sourceRoot":"","sources":["../../../../../src/generation/theme/cell/CellProcessingRuleSet.js"],"names":[],"mappings":"AAAA;
|
|
1
|
+
{"version":3,"file":"CellProcessingRuleSet.d.ts","sourceRoot":"","sources":["../../../../../src/generation/theme/cell/CellProcessingRuleSet.js"],"names":[],"mappings":"AAAA;IACI;;;OAGG;IACH,UAFU,oBAAoB,CAEhB;IAGd;;;OAGG;IACH,oCAEC;IAED;;;;;OAKG;IACH,iBAJW,MAAM,qDAYhB;CACJ"}
|
package/src/view/SVG.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SVG.d.ts","sourceRoot":"","sources":["../../../src/view/SVG.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SVG.d.ts","sourceRoot":"","sources":["../../../src/view/SVG.js"],"names":[],"mappings":"AA4BA;;;;;;GAMG;AACH,mCALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAmBlB;AApDD,yDAA0D;;;;;;;AAE1D;;;;;;;GAOG;AACH,4BANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAkBlB;AA4BD;;;;;;;;;GASG;AACH,6BARW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAyBlB;AAED;;;;GAIG;AACH,gDAFa,OAAO,CAInB"}
|
package/src/view/SVG.js
CHANGED
|
@@ -26,21 +26,6 @@ function svgArc(r0, r1, a0, a1) {
|
|
|
26
26
|
+ "Z";
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @param {number} centerX
|
|
32
|
-
* @param {number} centerY
|
|
33
|
-
* @param {number} radius
|
|
34
|
-
* @param {number} angle in radians
|
|
35
|
-
* @returns {{x: *, y: *}}
|
|
36
|
-
*/
|
|
37
|
-
function polarToCartesian(centerX, centerY, radius, angle) {
|
|
38
|
-
return {
|
|
39
|
-
x: centerX + (radius * Math.cos(angle)),
|
|
40
|
-
y: centerY + (radius * Math.sin(angle))
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
29
|
/**
|
|
45
30
|
*
|
|
46
31
|
* @param {number} r Outer Radius
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html_element_to_aabb.d.ts","sourceRoot":"","sources":["../../../src/view/html_element_to_aabb.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,yCAHW,OAAO,GACL,KAAK,CAuBjB;kBA5BiB,+BAA+B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import AABB2 from "../core/geom/2d/aabb/AABB2.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {Element} el
|
|
6
|
+
* @returns {AABB2}
|
|
7
|
+
*/
|
|
8
|
+
export function html_element_to_aabb(el) {
|
|
9
|
+
const clientRect = el.getBoundingClientRect();
|
|
10
|
+
|
|
11
|
+
let x0 = clientRect.left;
|
|
12
|
+
let y0 = clientRect.top;
|
|
13
|
+
let x1 = clientRect.right;
|
|
14
|
+
let y1 = clientRect.bottom;
|
|
15
|
+
|
|
16
|
+
// sanitize bounds
|
|
17
|
+
|
|
18
|
+
if (Number.isNaN(x1)) {
|
|
19
|
+
x1 = x0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (Number.isNaN(y1)) {
|
|
23
|
+
y1 = y0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// write bounds
|
|
27
|
+
|
|
28
|
+
return new AABB2(x0, y0, x1, y1);
|
|
29
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipManager.d.ts","sourceRoot":"","sources":["../../../../src/view/tooltip/TooltipManager.js"],"names":[],"mappings":"AAYA;IAGQ;;;OAGG;IACH,YAAe;IAEf;;;OAGG;IACH,aAFU,OAAK,IAAI,CAEe;IAKlC;;;OAGG;IACH,SAFU,aAAa,CAEJ;IAKnB,iBAQE;IAEF,6BAAoD;IAEpD;;;OAGG;IACH,MAFU,eAAe,CAEH;IAG1B;;;OAGG;IACH,UAFa,SAAS,CAIrB;IAED;;;;OAIG;IACH,gBAHW,SAAS,WACT,aAAa,QAavB;IADG,sBAAwB;IAG5B,wBAkBC;IAED,yBAUC;IAED,eAUC;IAED;;;;OAIG;IACH,qBAwCC;IAED;;;OAGG;IACH,0BA0BC;IAED;;;;OAIG;IACH,0BAFa,OAAO,CAInB;IAED;;;OAGG;IACH,6BASC;IAED;;;OAGG;IACH,qBAFW,WAAW,QAYrB;CAGJ;
|
|
1
|
+
{"version":3,"file":"TooltipManager.d.ts","sourceRoot":"","sources":["../../../../src/view/tooltip/TooltipManager.js"],"names":[],"mappings":"AAYA;IAGQ;;;OAGG;IACH,YAAe;IAEf;;;OAGG;IACH,aAFU,OAAK,IAAI,CAEe;IAKlC;;;OAGG;IACH,SAFU,aAAa,CAEJ;IAKnB,iBAQE;IAEF,6BAAoD;IAEpD;;;OAGG;IACH,MAFU,eAAe,CAEH;IAG1B;;;OAGG;IACH,UAFa,SAAS,CAIrB;IAED;;;;OAIG;IACH,gBAHW,SAAS,WACT,aAAa,QAavB;IADG,sBAAwB;IAG5B,wBAkBC;IAED,yBAUC;IAED,eAUC;IAED;;;;OAIG;IACH,qBAwCC;IAED;;;OAGG;IACH,0BA0BC;IAED;;;;OAIG;IACH,0BAFa,OAAO,CAInB;IAED;;;OAGG;IACH,6BASC;IAED;;;OAGG;IACH,qBAFW,WAAW,QAYrB;CAGJ;8BAjP6B,6CAA6C;iBAH1D,iCAAiC;+BADnB,mDAAmD;iBAFjE,oCAAoC;0BAQ3B,oBAAoB;wBACtB,kBAAkB"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { assert } from "../../core/assert.js";
|
|
2
|
+
import List from "../../core/collection/list/List.js";
|
|
2
3
|
import AABB2 from "../../core/geom/2d/aabb/AABB2.js";
|
|
3
|
-
import Task from "../../core/process/task/Task.js";
|
|
4
4
|
import ConcurrentExecutor from "../../core/process/executor/ConcurrentExecutor.js";
|
|
5
|
+
import Task from "../../core/process/task/Task.js";
|
|
5
6
|
import { TaskSignal } from "../../core/process/task/TaskSignal.js";
|
|
6
|
-
import
|
|
7
|
+
import { frameThrottle } from "../../engine/graphics/FrameThrottle.js";
|
|
7
8
|
import { PointerDevice } from "../../engine/input/devices/PointerDevice.js";
|
|
8
|
-
import
|
|
9
|
-
import { assert } from "../../core/assert.js";
|
|
9
|
+
import EmptyView from "../elements/EmptyView.js";
|
|
10
10
|
import { GMLEngine } from "./gml/GMLEngine.js";
|
|
11
|
-
import
|
|
11
|
+
import TooltipView from "./TooltipView.js";
|
|
12
12
|
|
|
13
|
-
class TooltipManager {
|
|
13
|
+
export class TooltipManager {
|
|
14
14
|
|
|
15
15
|
constructor() {
|
|
16
16
|
/**
|
|
@@ -247,5 +247,3 @@ class TooltipManager {
|
|
|
247
247
|
|
|
248
248
|
|
|
249
249
|
}
|
|
250
|
-
|
|
251
|
-
export { TooltipManager };
|
|
@@ -24,5 +24,4 @@ declare class TooltipView extends View<HTMLElement> {
|
|
|
24
24
|
import View from "../View.js";
|
|
25
25
|
import EmptyView from "../elements/EmptyView.js";
|
|
26
26
|
import { CompassArrowView } from "../elements/CompassArrowView.js";
|
|
27
|
-
import AABB2 from "../../core/geom/2d/aabb/AABB2.js";
|
|
28
27
|
//# sourceMappingURL=TooltipView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TooltipView.d.ts","sourceRoot":"","sources":["../../../../src/view/tooltip/TooltipView.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TooltipView.d.ts","sourceRoot":"","sources":["../../../../src/view/tooltip/TooltipView.js"],"names":[],"mappings":";AASA;IACI;;;;;OAKG;IACH,yCAHW,IAAI,EA+Bd;IAxBG;;;OAGG;IACH,iBAAgB;IAGhB,mBAAuC;IASvC,uBAA4B;IAO5B,0BAAuB;IAG3B;;;OAGG;IACH,4BAuCC;CACJ;iBApFgB,YAAY;sBAFP,0BAA0B;iCADf,iCAAiC"}
|