@woosh/meep-engine 2.52.0 → 2.53.0

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.
Files changed (73) hide show
  1. package/editor/actions/concrete/WriteGridValueAction.js +1 -1
  2. package/editor/ecs/component/prototypeObjectEditor.js +1 -1
  3. package/editor/process/ObstacleGridDisplayProcess.js +2 -2
  4. package/editor/process/symbolic/makeGridPositionSymbolDisplay.js +1 -1
  5. package/editor/tools/GridPaintTool.js +2 -2
  6. package/package.json +4 -3
  7. package/samples/generation/SampleGenerator0.js +1 -1
  8. package/samples/generation/generators/interactive/mir_generator_place_buff_objects.js +1 -1
  9. package/samples/generation/generators/mir_generator_place_bases.js +1 -1
  10. package/samples/generation/generators/mir_generator_place_road_decorators.js +1 -1
  11. package/samples/generation/generators/mir_generator_place_starting_point.js +1 -1
  12. package/samples/generation/main.js +2 -2
  13. package/samples/generation/rules/matcher_play_area.js +1 -1
  14. package/samples/generation/rules/matcher_tag_occupied.js +1 -1
  15. package/samples/generation/rules/matcher_tag_traversable.js +1 -1
  16. package/samples/generation/themes/SampleTheme0.js +5 -5
  17. package/src/core/collection/table/RowFirstTableSpec.js +8 -4
  18. package/src/core/geom/3d/matrix/MATRIX_4_IDENTITY.spec.js +10 -0
  19. package/src/engine/Engine.spec.js +4 -0
  20. package/src/engine/ecs/EntityComponentDataset.js +1 -1
  21. package/src/engine/ecs/EntityObserver.spec.js +1 -1
  22. package/src/engine/ecs/dynamic_actions/actions/definition/{WhiteToBlackboardActionDescription.js → WriteToBlackboardActionDescription.js} +2 -2
  23. package/src/engine/ecs/dynamic_actions/actions/definition/deserializeActionFromJSON.js +2 -2
  24. package/src/engine/ecs/guid/GUIDSerializationAdapter.spec.js +21 -0
  25. package/src/engine/ecs/parent/EntityNode.js +1 -1
  26. package/src/engine/ecs/parent/EntityNode.spec.js +104 -0
  27. package/src/engine/ecs/speaker/Voice.js +4 -0
  28. package/src/engine/ecs/team/Team.js +0 -44
  29. package/src/engine/ecs/team/TeamSerializationAdapter.js +46 -0
  30. package/src/engine/ecs/transform/Transform.js +1 -1
  31. package/src/engine/ecs/transform/Transform.spec.js +24 -0
  32. package/src/engine/graphics/camera/testClippingPlaneComputation.js +2 -2
  33. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +2 -2
  34. package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +2 -2
  35. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +2 -2
  36. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +2 -2
  37. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +2 -2
  38. package/src/engine/graphics/texture/TextureBackedMemoryRegion.js +4 -1
  39. package/src/engine/graphics/texture/sampler/filter/filter_lanczos3.js +7 -2
  40. package/src/engine/grid/{components → grid2transform}/GridPosition2Transform.js +0 -41
  41. package/src/engine/grid/grid2transform/GridPosition2TransformSerializationUpgrader_0_1.js +40 -0
  42. package/src/engine/grid/{systems → grid2transform}/GridPosition2TransformSystem.js +3 -3
  43. package/src/engine/grid/{components → position}/GridPosition.js +4 -0
  44. package/src/engine/grid/{systems → position}/GridPositionSystem.js +1 -1
  45. package/src/engine/grid/transform2grid/Transform2GridPositionSystem.js +1 -1
  46. package/src/engine/input/devices/PointerDevice.spec.js +5 -0
  47. package/src/engine/navigation/ecs/components/computeCatmullRomSpline.js +5 -1
  48. package/src/engine/navigation/ecs/path_following/PathFollower.js +40 -32
  49. package/src/engine/navigation/ecs/path_following/PathFollower.spec.js +27 -0
  50. package/src/generation/filtering/CellFilter.js +6 -9
  51. package/src/generation/filtering/boolean/CellFilterLiteralBoolean.js +1 -4
  52. package/src/generation/filtering/core/CellFilterBinaryOperation.js +12 -15
  53. package/src/generation/filtering/core/CellFilterOperationTertiary.js +15 -19
  54. package/src/generation/filtering/numeric/CellFilterLiteralFloat.js +6 -9
  55. package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.js +1 -1
  56. package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.js +2 -2
  57. package/src/generation/grid/generation/road/GridTaskGenerateRoads.js +1 -1
  58. package/src/generation/markers/actions/MarkerNodeActionEntityPlacement.js +1 -1
  59. package/src/engine/graphics/texture/ExportCanvasAsPNG.js +0 -7
  60. package/src/engine/navigation/PathFinder.js +0 -172
  61. package/src/engine/navigation/PathWorker.js +0 -78
  62. package/src/engine/navigation/ecs/systems/PathFinderSystem.js +0 -63
  63. package/src/engine/navigation/ecs/systems/PathSystem.js +0 -19
  64. package/src/engine/navigation/funnel/Funnel.js +0 -196
  65. package/src/generation/ZoneNode.js +0 -9
  66. /package/{src/generation → samples/generation/grid}/GridTags.js +0 -0
  67. /package/src/engine/grid/{components → grid2transform}/GridPosition2TransformFlags.js +0 -0
  68. /package/src/engine/grid/{components → grid2transform}/GridPosition2TransformSerializationAdapter.js +0 -0
  69. /package/src/engine/grid/{components → obstacle}/GridObstacle.js +0 -0
  70. /package/src/engine/grid/{components → obstacle}/GridObstacle.spec.js +0 -0
  71. /package/src/engine/grid/{components → obstacle}/GridObstacleSerializationAdapter.js +0 -0
  72. /package/src/engine/grid/{components → position}/GridPositionSerializationAdapter.js +0 -0
  73. /package/src/engine/grid/{components → position}/GridPositionSerializationUpdater_0_1.js +0 -0
@@ -24,10 +24,10 @@ import WaterSystem from "../../../ecs/water/WaterSystem.js";
24
24
  import Trail2DSystem from "../../../ecs/trail2d/Trail2DSystem.js";
25
25
  import { Foliage2System } from "../../../../ecs/foliage/ecs/Foliage2System.js";
26
26
  import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
27
- import { GridPosition2TransformSystem } from "../../../../grid/systems/GridPosition2TransformSystem.js";
27
+ import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
28
28
  import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
29
29
  import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
30
- import GridPositionSystem from "../../../../grid/systems/GridPositionSystem.js";
30
+ import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
31
31
  import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
32
32
  import { InputSystem } from "../../../../input/ecs/systems/InputSystem.js";
33
33
  import MeshHighlightSystem from "../../../ecs/highlight/system/MeshHighlightSystem.js";
@@ -25,10 +25,10 @@ import WaterSystem from "../../../ecs/water/WaterSystem.js";
25
25
  import Trail2DSystem from "../../../ecs/trail2d/Trail2DSystem.js";
26
26
  import { Foliage2System } from "../../../../ecs/foliage/ecs/Foliage2System.js";
27
27
  import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
28
- import { GridPosition2TransformSystem } from "../../../../grid/systems/GridPosition2TransformSystem.js";
28
+ import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
29
29
  import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
30
30
  import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
31
- import GridPositionSystem from "../../../../grid/systems/GridPositionSystem.js";
31
+ import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
32
32
  import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
33
33
  import { InputSystem } from "../../../../input/ecs/systems/InputSystem.js";
34
34
  import MeshHighlightSystem from "../../../ecs/highlight/system/MeshHighlightSystem.js";
@@ -24,10 +24,10 @@ import WaterSystem from "../../../ecs/water/WaterSystem.js";
24
24
  import Trail2DSystem from "../../../ecs/trail2d/Trail2DSystem.js";
25
25
  import { Foliage2System } from "../../../../ecs/foliage/ecs/Foliage2System.js";
26
26
  import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
27
- import { GridPosition2TransformSystem } from "../../../../grid/systems/GridPosition2TransformSystem.js";
27
+ import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
28
28
  import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
29
29
  import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
30
- import GridPositionSystem from "../../../../grid/systems/GridPositionSystem.js";
30
+ import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
31
31
  import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
32
32
  import { InputSystem } from "../../../../input/ecs/systems/InputSystem.js";
33
33
  import MeshHighlightSystem from "../../../ecs/highlight/system/MeshHighlightSystem.js";
@@ -21,7 +21,10 @@ const DATA_TEXTURE_WIDTH = 128;
21
21
  const SHRINK_FACTOR = 0.5;
22
22
  const GROW_FACTOR = 1.05;
23
23
 
24
-
24
+ /**
25
+ * Mainly used for storing non-color data in GPU memory
26
+ * Useful for things like simulation and running general purpose GPU compute inside fragment shaders
27
+ */
25
28
  export class TextureBackedMemoryRegion {
26
29
 
27
30
  constructor() {
@@ -5,15 +5,20 @@ export function filter_lanczos3(x) {
5
5
  // x = -x;
6
6
  // }
7
7
 
8
- if (x > 3) {
8
+ const lobes = 3;
9
+
10
+ if (x > lobes) {
9
11
  return 0;
10
12
  }
11
13
 
12
14
  if (x < 1.1920929e-7) {
15
+ // distance is very close to 0
13
16
  return 1;
14
17
  }
15
18
 
16
- return (3 * Math.sin(Math.PI * x) * Math.sin(Math.PI * x / 3)) / (Math.PI * Math.PI * x * x);
19
+ const px = Math.PI * x;
20
+
21
+ return (lobes * Math.sin(px) * Math.sin(px / lobes)) / (px * px);
17
22
 
18
23
  }
19
24
 
@@ -1,5 +1,4 @@
1
1
  import Vector2 from "../../../core/geom/Vector2.js";
2
- import { BinaryClassUpgrader } from "../../ecs/storage/binary/BinaryClassUpgrader.js";
3
2
  import { GridPosition2TransformFlags } from "./GridPosition2TransformFlags.js";
4
3
 
5
4
  /**
@@ -121,43 +120,3 @@ export class GridPosition2Transform {
121
120
  }
122
121
 
123
122
  GridPosition2Transform.typeName = "GridPosition2Transform";
124
-
125
-
126
- export class GridPosition2TransformSerializationUpgrader_0_1 extends BinaryClassUpgrader {
127
- constructor() {
128
- super();
129
-
130
- //
131
- this.__startVersion = 0;
132
- this.__targetVersion = 1;
133
- }
134
-
135
- upgrade(source, target) {
136
- const offsetX = source.readFloat64();
137
- const offsetY = source.readFloat64();
138
-
139
- let header = 3;
140
- if (offsetX === 0 && offsetY === 0) {
141
- header = 0;
142
- } else if (offsetX === 0) {
143
- header = 2;
144
- } else if (offsetY === 0) {
145
- header = 1;
146
- } else {
147
- //both coordinates are present
148
- header = 3;
149
- }
150
-
151
- target.writeUint8(header);
152
-
153
- if ((header & 1) !== 0) {
154
- //write X
155
- target.writeFloat32(offsetX);
156
- }
157
-
158
- if ((header & 2) !== 0) {
159
- //write Y
160
- target.writeFloat32(offsetY);
161
- }
162
- }
163
- }
@@ -0,0 +1,40 @@
1
+ import { BinaryClassUpgrader } from "../../ecs/storage/binary/BinaryClassUpgrader.js";
2
+
3
+ export class GridPosition2TransformSerializationUpgrader_0_1 extends BinaryClassUpgrader {
4
+ constructor() {
5
+ super();
6
+
7
+ //
8
+ this.__startVersion = 0;
9
+ this.__targetVersion = 1;
10
+ }
11
+
12
+ upgrade(source, target) {
13
+ const offsetX = source.readFloat64();
14
+ const offsetY = source.readFloat64();
15
+
16
+ let header = 3;
17
+ if (offsetX === 0 && offsetY === 0) {
18
+ header = 0;
19
+ } else if (offsetX === 0) {
20
+ header = 2;
21
+ } else if (offsetY === 0) {
22
+ header = 1;
23
+ } else {
24
+ //both coordinates are present
25
+ header = 3;
26
+ }
27
+
28
+ target.writeUint8(header);
29
+
30
+ if ((header & 1) !== 0) {
31
+ //write X
32
+ target.writeFloat32(offsetX);
33
+ }
34
+
35
+ if ((header & 2) !== 0) {
36
+ //write Y
37
+ target.writeFloat32(offsetY);
38
+ }
39
+ }
40
+ }
@@ -3,10 +3,10 @@
3
3
  */
4
4
  import { System } from '../../ecs/System.js';
5
5
  import { Transform } from '../../ecs/transform/Transform.js';
6
- import GridPosition from '../components/GridPosition.js';
7
- import { GridPosition2Transform } from '../components/GridPosition2Transform.js';
6
+ import GridPosition from '../position/GridPosition.js';
7
+ import { GridPosition2Transform } from './GridPosition2Transform.js';
8
8
  import Vector3 from "../../../core/geom/Vector3.js";
9
- import { GridPosition2TransformFlags } from "../components/GridPosition2TransformFlags.js";
9
+ import { GridPosition2TransformFlags } from "./GridPosition2TransformFlags.js";
10
10
  import { obtainTerrain } from "../../ecs/terrain/util/obtainTerrain.js";
11
11
  import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
12
12
  import { ResourceAccessKind } from "../../../core/model/ResourceAccessKind.js";
@@ -10,6 +10,10 @@ import Vector2 from '../../../core/geom/Vector2.js';
10
10
  */
11
11
  class GridPosition extends Vector2 {
12
12
 
13
+ /**
14
+ *
15
+ * @return {GridPosition}
16
+ */
13
17
  clone() {
14
18
  const clone = new GridPosition();
15
19
 
@@ -2,7 +2,7 @@
2
2
  * Created by Alex on 13/10/2014.
3
3
  */
4
4
  import { System } from '../../ecs/System.js';
5
- import GridPosition from '../components/GridPosition.js';
5
+ import GridPosition from './GridPosition.js';
6
6
  import { QuadTreeNode } from "../../../core/geom/2d/quad-tree/QuadTreeNode.js";
7
7
 
8
8
  class GridPositionSystem extends System {
@@ -1,6 +1,6 @@
1
1
  import { System } from "../../ecs/System.js";
2
2
  import { Transform2GridPosition } from "./Transform2GridPosition.js";
3
- import GridPosition from "../components/GridPosition.js";
3
+ import GridPosition from "../position/GridPosition.js";
4
4
  import { Transform } from "../../ecs/transform/Transform.js";
5
5
  import Vector2 from "../../../core/geom/Vector2.js";
6
6
  import { Transform2GridPositionMode } from "./Transform2GridPositionMode.js";
@@ -1,5 +1,10 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+
1
5
  import { PointerDevice } from "./PointerDevice.js";
2
6
 
7
+
3
8
  test("constructor does not throw", () => {
4
9
  const element = document.createElement('div');
5
10
 
@@ -38,7 +38,11 @@ const p3 = [];
38
38
  * @param {number} sample_count number of discrete points to be generated
39
39
  * @param {number} [alpha=0.5] parameter for control point weights (see non-parametric catmull-rom for details on "alpha" definition)
40
40
  */
41
- export function computeCatmullRomSpline(result, input, input_length, dimensions, sample_count, alpha = 0.5) {
41
+ export function computeCatmullRomSpline(
42
+ result,
43
+ input, input_length,
44
+ dimensions, sample_count, alpha = 0.5
45
+ ) {
42
46
  assert.greaterThan(dimensions, 0, 'number of dimensions must be greater than 0');
43
47
  assert.isNonNegativeInteger(dimensions, 'dimensions');
44
48
 
@@ -19,39 +19,40 @@ const DEFAULT_FLAGS = PathFollowerFlags.Active
19
19
  | PathFollowerFlags.WriteRotationZ
20
20
  ;
21
21
 
22
+ const DEFAULT_MAX_MOVE_DISTANCE = 100000;
23
+
22
24
  class PathFollower {
23
- constructor() {
24
-
25
- /**
26
- * Movement speed along the path in world units per second
27
- * @type {Vector1}
28
- */
29
- this.speed = new Vector1(DEFAULT_SPEED);
30
-
31
- /**
32
- * Speed at which path follower can adjust rotation in Rad/s
33
- * @type {Vector1}
34
- */
35
- this.rotationSpeed = new Vector1(DEFAULT_ROTATION_SPEED);
36
-
37
- /**
38
- *
39
- * @type {number}
40
- */
41
- this.flags = DEFAULT_FLAGS;
42
25
 
43
- /**
44
- * Maximum distance that the follower can move along the path in a single step
45
- * @type {number}
46
- */
47
- this.maxMoveDistance = 100000;
48
-
49
- /**
50
- * Absolute position along the path
51
- * @type {number}
52
- */
53
- this.position = 0;
54
- }
26
+ /**
27
+ * Movement speed along the path in world units per second
28
+ * @type {Vector1}
29
+ */
30
+ speed = new Vector1(DEFAULT_SPEED);
31
+
32
+ /**
33
+ * Speed at which path follower can adjust rotation in Rad/s
34
+ * @type {Vector1}
35
+ */
36
+ rotationSpeed = new Vector1(DEFAULT_ROTATION_SPEED);
37
+
38
+ /**
39
+ *
40
+ * @type {number}
41
+ */
42
+ flags = DEFAULT_FLAGS;
43
+
44
+ /**
45
+ * Maximum distance that the follower can move along the path in a single step
46
+ * @type {number}
47
+ */
48
+ maxMoveDistance = DEFAULT_MAX_MOVE_DISTANCE;
49
+
50
+ /**
51
+ * Absolute position along the path
52
+ * @type {number}
53
+ */
54
+ position = 0;
55
+
55
56
 
56
57
  get rotationAlignment() {
57
58
  throw new Error(`deprecated, use relevant flag instead`);
@@ -138,7 +139,8 @@ class PathFollower {
138
139
 
139
140
  speed: this.speed.toJSON(),
140
141
  rotationSpeed: this.rotationSpeed.toJSON(),
141
- position: this.position
142
+ position: this.position,
143
+ maxMoveDistance: this.maxMoveDistance
142
144
  };
143
145
  }
144
146
 
@@ -176,6 +178,12 @@ class PathFollower {
176
178
  this.rotationSpeed.set(DEFAULT_ROTATION_SPEED);
177
179
  }
178
180
 
181
+ if (typeof json.maxMoveDistance === "number") {
182
+ this.maxMoveDistance = json.maxMoveDistance;
183
+ } else {
184
+ this.maxMoveDistance = DEFAULT_MAX_MOVE_DISTANCE;
185
+ }
186
+
179
187
  if (json.writePositionX !== undefined) {
180
188
  this.writeFlag(PathFollowerFlags.WritePositionX, json.writePositionX);
181
189
  }
@@ -0,0 +1,27 @@
1
+ import PathFollower from "./PathFollower.js";
2
+
3
+ test("constructor does not throw", () => {
4
+ new PathFollower();
5
+ });
6
+
7
+
8
+ test("to/from JSON consistency", () => {
9
+
10
+ const source = new PathFollower();
11
+
12
+ source.speed.set(13);
13
+ source.rotationSpeed.set(17);
14
+ source.flags = 0b1010100101;
15
+ source.maxMoveDistance = 123;
16
+ source.position = 27;
17
+
18
+ const destination = new PathFollower();
19
+
20
+ destination.fromJSON(source.toJSON());
21
+
22
+ expect(destination.speed.getValue()).toEqual(13);
23
+ expect(destination.rotationSpeed.getValue()).toEqual(17);
24
+ expect(destination.flags).toEqual(0b1010100101);
25
+ expect(destination.maxMoveDistance).toEqual(123);
26
+ expect(destination.position).toEqual(27)
27
+ });
@@ -3,15 +3,12 @@ import DataType from "../../core/parser/simple/DataType.js";
3
3
 
4
4
  export class CellFilter {
5
5
 
6
- constructor() {
7
- /**
8
- *
9
- * @type {boolean}
10
- * @protected
11
- */
12
- this.__initialized = false;
13
-
14
- }
6
+ /**
7
+ *
8
+ * @type {boolean}
9
+ * @protected
10
+ */
11
+ __initialized = false;
15
12
 
16
13
  /**
17
14
  *
@@ -3,11 +3,8 @@ import DataType from "../../../core/parser/simple/DataType.js";
3
3
  import { assert } from "../../../core/assert.js";
4
4
 
5
5
  export class CellFilterLiteralBoolean extends CellFilter {
6
- constructor() {
7
- super();
8
6
 
9
- this.value = true;
10
- }
7
+ value = true;
11
8
 
12
9
  /**
13
10
  *
@@ -1,21 +1,18 @@
1
1
  import { CellFilter } from "../CellFilter.js";
2
2
 
3
3
  export class CellFilterBinaryOperation extends CellFilter {
4
- constructor() {
5
- super();
6
-
7
- /**
8
- *
9
- * @type {CellFilter}
10
- */
11
- this.left = null;
12
-
13
- /**
14
- *
15
- * @type {CellFilter}
16
- */
17
- this.right = null;
18
- }
4
+
5
+ /**
6
+ *
7
+ * @type {CellFilter}
8
+ */
9
+ left = null;
10
+
11
+ /**
12
+ *
13
+ * @type {CellFilter}
14
+ */
15
+ right = null;
19
16
 
20
17
  /**
21
18
  * @template T,R
@@ -1,26 +1,22 @@
1
1
  import { CellFilter } from "../CellFilter.js";
2
2
 
3
3
  export class CellFilterOperationTertiary extends CellFilter {
4
- constructor() {
5
- super();
6
-
7
- /**
8
- *
9
- * @type {CellFilter}
10
- */
11
- this.a = null;
12
- /**
13
- *
14
- * @type {CellFilter}
15
- */
16
- this.b = null;
17
- /**
18
- *
19
- * @type {CellFilter}
20
- */
21
- this.c = null;
22
4
 
23
- }
5
+ /**
6
+ *
7
+ * @type {CellFilter}
8
+ */
9
+ a = null;
10
+ /**
11
+ *
12
+ * @type {CellFilter}
13
+ */
14
+ b = null;
15
+ /**
16
+ *
17
+ * @type {CellFilter}
18
+ */
19
+ c = null;
24
20
 
25
21
  /**
26
22
  *
@@ -2,15 +2,12 @@ import { CellFilter } from "../CellFilter.js";
2
2
  import { assert } from "../../../core/assert.js";
3
3
 
4
4
  export class CellFilterLiteralFloat extends CellFilter {
5
- constructor() {
6
- super();
7
-
8
- /**
9
- *
10
- * @type {number}
11
- */
12
- this.value = 1;
13
- }
5
+
6
+ /**
7
+ *
8
+ * @type {number}
9
+ */
10
+ value = 1;
14
11
 
15
12
  /**
16
13
  *
@@ -1,7 +1,7 @@
1
1
  import { ContinuousGridCellAction } from "./ContinuousGridCellAction.js";
2
2
  import Terrain from "../../../engine/ecs/terrain/ecs/Terrain.js";
3
3
  import { assert } from "../../../core/assert.js";
4
- import GridObstacle from "../../../engine/grid/components/GridObstacle.js";
4
+ import GridObstacle from "../../../engine/grid/obstacle/GridObstacle.js";
5
5
  import { CellFilterLiteralFloat } from "../../filtering/numeric/CellFilterLiteralFloat.js";
6
6
 
7
7
  export class ContinuousGridCellActionSetTerrainObstacle extends ContinuousGridCellAction {
@@ -1,8 +1,8 @@
1
1
  import { ContinuousGridCellAction } from "./ContinuousGridCellAction.js";
2
2
  import { CellFilterLiteralFloat } from "../../filtering/numeric/CellFilterLiteralFloat.js";
3
3
  import Terrain from "../../../engine/ecs/terrain/ecs/Terrain.js";
4
- import GridPosition from "../../../engine/grid/components/GridPosition.js";
5
- import GridObstacle from "../../../engine/grid/components/GridObstacle.js";
4
+ import GridPosition from "../../../engine/grid/position/GridPosition.js";
5
+ import GridObstacle from "../../../engine/grid/obstacle/GridObstacle.js";
6
6
 
7
7
 
8
8
  export class ContinuousGridCellActionWriteObstacle extends ContinuousGridCellAction {
@@ -9,7 +9,7 @@ import { BitSet } from "../../../../core/binary/BitSet.js";
9
9
  import { matcher_tag_traversable } from "../../../../../samples/generation/rules/matcher_tag_traversable.js";
10
10
  import { buildPathFromDistanceMap } from "../util/buildPathFromDistanceMap.js";
11
11
  import { GridCellActionPlaceTags } from "../../../placement/action/GridCellActionPlaceTags.js";
12
- import { GridTags } from "../../../GridTags.js";
12
+ import { GridTags } from "../../../../../samples/generation/grid/GridTags.js";
13
13
  import { CellMatcher } from "../../../rules/CellMatcher.js";
14
14
  import { collectIteratorValueToArray } from "../../../../core/collection/collectIteratorValueToArray.js";
15
15
  import { QuadTreeNode } from "../../../../core/geom/2d/quad-tree/QuadTreeNode.js";
@@ -1,5 +1,5 @@
1
1
  import { MarkerNodeAction } from "./MarkerNodeAction.js";
2
- import GridPosition from "../../../engine/grid/components/GridPosition.js";
2
+ import GridPosition from "../../../engine/grid/position/GridPosition.js";
3
3
  import { Transform } from "../../../engine/ecs/transform/Transform.js";
4
4
  import { EntityBlueprint } from "../../../engine/ecs/EntityBlueprint.js";
5
5
 
@@ -1,7 +0,0 @@
1
- /**
2
- * Created by Alex on 26/04/2015.
3
- */
4
- export default function (canvas) {
5
- const dataURL = canvas.toDataURL("image/png;base64;");
6
- window.open(dataURL, "", "width=" + canvas.width + ",height=" + canvas.height);
7
- };