@woosh/meep-engine 2.60.1 → 2.62.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 (87) hide show
  1. package/build/meep.cjs +20244 -20262
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +20244 -20262
  4. package/package.json +1 -1
  5. package/src/core/binary/BitSet.js +1 -1
  6. package/src/core/bvh2/BinaryNode.js +16 -13
  7. package/src/core/bvh2/LeafNode.js +6 -3
  8. package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_sphere.js +81 -0
  9. package/src/core/geom/3d/aabb/AABB3.js +24 -36
  10. package/src/core/geom/3d/aabb/aabb3_array_compute_from_sphere.js +22 -0
  11. package/src/core/geom/3d/aabb/aabb3_array_intersects_sphere.js +22 -0
  12. package/src/core/geom/3d/aabb/aabb3_array_intersects_sphere_array.js +11 -0
  13. package/src/core/geom/3d/aabb/aabb3_signed_distance_to_aabb3.js +28 -0
  14. package/src/core/geom/3d/aabb/serializeAABB3Quantized16Uint.js +19 -10
  15. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +30 -182
  16. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.spec.js +27 -1
  17. package/src/core/geom/3d/tetrahedra/delaunay/Cavity.js +3 -4
  18. package/src/core/geom/ConicRay.js +16 -21
  19. package/src/core/geom/ConicRay.spec.js +24 -0
  20. package/src/core/geom/packing/miniball/Miniball.js +68 -117
  21. package/src/core/geom/packing/miniball/Miniball.spec.js +3 -3
  22. package/src/core/geom/packing/miniball/Subspan.js +47 -34
  23. package/src/core/geom/packing/miniball/miniball_compute_quality.js +64 -0
  24. package/src/core/math/bessel_3.js +1 -0
  25. package/src/core/math/random/randomBytes.js +2 -2
  26. package/src/core/math/sqr.js +8 -0
  27. package/src/core/model/node-graph/Connection.js +21 -23
  28. package/src/core/model/node-graph/DataType.js +16 -17
  29. package/src/core/model/node-graph/NodeGraph.js +49 -50
  30. package/src/core/model/node-graph/node/NodeDescription.js +42 -44
  31. package/src/core/model/node-graph/node/NodeInstance.js +59 -60
  32. package/src/core/model/node-graph/node/NodeInstancePortReference.js +27 -29
  33. package/src/core/model/node-graph/node/NodeRegistry.js +16 -18
  34. package/src/core/model/node-graph/node/Port.js +35 -37
  35. package/src/core/model/node-graph/node/parameter/NodeParameterDescription.js +27 -13
  36. package/src/core/path/computePathDirectory.spec.js +8 -0
  37. package/src/core/process/BaseProcess.d.ts +5 -0
  38. package/src/core/process/WatchDog.js +76 -75
  39. package/src/core/process/action/AsynchronousAction.js +24 -22
  40. package/src/core/process/executor/profile/Profile.js +34 -24
  41. package/src/core/process/executor/profile/TraceEvent.js +75 -75
  42. package/src/core/process/worker/OnDemandWorkerManager.js +27 -30
  43. package/src/core/process/worker/WorkerBuilder.js +149 -149
  44. package/src/core/process/worker/WorkerProxy.js +25 -21
  45. package/src/core/process/worker/extractTransferables.js +2 -2
  46. package/src/engine/Engine.js +58 -53
  47. package/src/engine/EngineConfiguration.d.ts +4 -4
  48. package/src/engine/ecs/EntityManager.js +517 -614
  49. package/src/engine/ecs/System.js +2 -2
  50. package/src/engine/ecs/foliage/ecs/Foliage2System.js +3 -0
  51. package/src/engine/ecs/foliage/ecs/InstancedMeshComponent.js +4 -1
  52. package/src/engine/ecs/foliage/ecs/convertInstancedMeshComponents2Entities.js +64 -0
  53. package/src/engine/ecs/foliage/ecs/{InstancedMeshUtils.js → optimizeIndividualMeshesEntitiesToInstances.js} +11 -70
  54. package/src/engine/ecs/transform/Transform.d.ts +7 -5
  55. package/src/engine/ecs/transform/Transform.js +30 -16
  56. package/src/engine/ecs/validateSystem.js +89 -0
  57. package/src/engine/graphics/GraphicsEngine.js +433 -483
  58. package/src/engine/graphics/camera/testClippingPlaneComputation.js +42 -46
  59. package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +2 -2
  60. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +2 -2
  61. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.js +2 -2
  62. package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +49 -52
  63. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +52 -56
  64. package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +20 -22
  65. package/src/engine/graphics/particles/ecs/ParticleEmitterSystem.js +43 -25
  66. package/src/engine/graphics/particles/particular/engine/ParticularEngine.js +160 -180
  67. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +37 -41
  68. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +63 -67
  69. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +46 -50
  70. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +61 -65
  71. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +48 -52
  72. package/src/engine/graphics/shadows/testShadowMapRendering.js +28 -32
  73. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.spec.js +22 -20
  74. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_linear.js +10 -13
  75. package/src/engine/graphics/texture/virtual/VirtualTexture.spec.js +1 -1
  76. package/src/engine/plugin/EnginePluginManager.d.ts +6 -1
  77. package/src/engine/sound/dB2Volume.js +8 -0
  78. package/src/engine/sound/ecs/emitter/SoundEmitter.js +125 -99
  79. package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.js +4 -42
  80. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +31 -121
  81. package/src/engine/sound/volume2dB.js +8 -0
  82. package/src/generation/theme/ThemeEngine.js +19 -53
  83. package/src/engine/ecs/components/ClingToHeightMap.js +0 -19
  84. package/src/engine/ecs/components/SynchronizePosition.js +0 -15
  85. package/src/engine/ecs/systems/ClingToHeightMapSystem.js +0 -170
  86. package/src/engine/ecs/systems/SynchronizePositionSystem.js +0 -43
  87. package/src/engine/graphics/geometry/bvh/buffered/BVHFromBufferGeometry.js +0 -133
@@ -1,63 +1,61 @@
1
- import { EngineHarness } from "../../EngineHarness.js";
2
- import { EngineConfiguration } from "../../EngineConfiguration.js";
1
+ import { Frustum, OrthographicCamera } from "three";
2
+ import FacingDirectionSystem from "../../../../../model/game/ecs/system/FacingDirectionSystem.js";
3
+ import { makeEngineOptionsModel } from "../../../../../model/game/options/makeEngineOptionsModel.js";
4
+ import { enableEditor } from "../../../../editor/enableEditor.js";
5
+ import {
6
+ ThreeClippingPlaneComputingBVHVisitor
7
+ } from "../../../core/bvh2/traversal/ThreeClippingPlaneComputingBVHVisitor.js";
8
+ import { RingBuffer } from "../../../core/collection/RingBuffer.js";
9
+ import { convex_hull_jarvis_2d } from "../../../core/geom/2d/convex-hull/convex_hull_jarvis_2d.js";
10
+ import Vector2 from "../../../core/geom/Vector2.js";
11
+ import Vector3 from "../../../core/geom/Vector3.js";
12
+ import { computeStatisticalMean } from "../../../core/math/statistics/computeStatisticalMean.js";
13
+ import { CanvasView } from "../../../view/elements/CanvasView.js";
14
+ import Entity from "../../ecs/Entity.js";
15
+ import { FogOfWarRevealerSystem } from "../../ecs/fow/FogOfWarRevealerSystem.js";
16
+ import { FogOfWarSystem } from "../../ecs/fow/FogOfWarSystem.js";
17
+ import GUIElement from "../../ecs/gui/GUIElement.js";
3
18
  import GUIElementSystem from "../../ecs/gui/GUIElementSystem.js";
4
19
  import HeadsUpDisplaySystem from "../../ecs/gui/hud/HeadsUpDisplaySystem.js";
20
+ import ViewportPosition from "../../ecs/gui/position/ViewportPosition.js";
21
+ import ViewportPositionSystem from "../../ecs/gui/position/ViewportPositionSystem.js";
22
+ import { InverseKinematicsSystem } from "../../ecs/ik/InverseKinematicsSystem.js";
23
+ import AnimationSystem from "../../ecs/systems/AnimationSystem.js";
24
+ import MotionSystem from "../../ecs/systems/MotionSystem.js";
25
+ import RenderSystem from "../../ecs/systems/RenderSystem.js";
5
26
  import ScriptSystem from "../../ecs/systems/ScriptSystem.js";
6
- import FacingDirectionSystem from "../../../../../model/game/ecs/system/FacingDirectionSystem.js";
7
- import PathFollowingSystem from "../../navigation/ecs/path_following/PathFollowingSystem.js";
8
27
  import SteeringSystem from "../../ecs/systems/SteeringSystem.js";
9
- import MotionSystem from "../../ecs/systems/MotionSystem.js";
10
28
  import TagSystem from "../../ecs/systems/TagSystem.js";
11
- import { SoundEmitterSystem } from "../../sound/ecs/emitter/SoundEmitterSystem.js";
12
- import SoundControllerSystem from "../../sound/ecs/SoundControllerSystem.js";
13
- import SoundListenerSystem from "../../sound/ecs/SoundListenerSystem.js";
14
29
  import TimerSystem from "../../ecs/systems/TimerSystem.js";
15
- import AnimationSystem from "../../ecs/systems/AnimationSystem.js";
16
- import TopDownCameraControllerSystem from "../ecs/camera/topdown/TopDownCameraControllerSystem.js";
17
- import { TopDownCameraLanderSystem } from "../ecs/camera/topdown/TopDownCameraLanderSystem.js";
18
- import { CameraSystem } from "../ecs/camera/CameraSystem.js";
19
- import { MeshSystem } from "../ecs/mesh/MeshSystem.js";
20
30
  import ClingToTerrainSystem from "../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
21
31
  import TerrainSystem from "../../ecs/terrain/ecs/TerrainSystem.js";
22
- import WaterSystem from "../ecs/water/WaterSystem.js";
23
- import Trail2DSystem from "../ecs/trail2d/Trail2DSystem.js";
24
- import { Foliage2System } from "../../ecs/foliage/ecs/Foliage2System.js";
25
- import ViewportPositionSystem from "../../ecs/gui/position/ViewportPositionSystem.js";
32
+ import { Transform } from "../../ecs/transform/Transform.js";
33
+ import { EngineConfiguration } from "../../EngineConfiguration.js";
34
+ import { EngineHarness } from "../../EngineHarness.js";
26
35
  import { GridPosition2TransformSystem } from "../../grid/grid2transform/GridPosition2TransformSystem.js";
27
- import { Transform2GridPositionSystem } from "../../grid/transform2grid/Transform2GridPositionSystem.js";
28
- import SynchronizePositionSystem from "../../ecs/systems/SynchronizePositionSystem.js";
29
36
  import GridPositionSystem from "../../grid/position/GridPositionSystem.js";
37
+ import { Transform2GridPositionSystem } from "../../grid/transform2grid/Transform2GridPositionSystem.js";
30
38
  import InputControllerSystem from "../../input/ecs/systems/InputControllerSystem.js";
31
39
  import { InputSystem } from "../../input/ecs/systems/InputSystem.js";
32
- import MeshHighlightSystem from "../ecs/highlight/system/MeshHighlightSystem.js";
33
- import LightSystem from "../ecs/light/LightSystem.js";
40
+ import { BehaviorSystem } from "../../intelligence/behavior/ecs/BehaviorSystem.js";
41
+ import PathFollowingSystem from "../../navigation/ecs/path_following/PathFollowingSystem.js";
42
+ import { SoundEmitterSystem } from "../../sound/ecs/emitter/SoundEmitterSystem.js";
43
+ import SoundControllerSystem from "../../sound/ecs/SoundControllerSystem.js";
44
+ import SoundListenerSystem from "../../sound/ecs/SoundListenerSystem.js";
34
45
  import AnimationControllerSystem from "../ecs/animation/AnimationControllerSystem.js";
35
46
  import { AnimationGraphSystem } from "../ecs/animation/animator/AnimationGraphSystem.js";
36
- import { FogOfWarSystem } from "../../ecs/fow/FogOfWarSystem.js";
37
- import { FogOfWarRevealerSystem } from "../../ecs/fow/FogOfWarRevealerSystem.js";
38
- import { BehaviorSystem } from "../../intelligence/behavior/ecs/BehaviorSystem.js";
39
- import { InverseKinematicsSystem } from "../../ecs/ik/InverseKinematicsSystem.js";
47
+ import { CameraSystem } from "../ecs/camera/CameraSystem.js";
48
+ import { frustum_from_camera } from "../ecs/camera/frustum_from_camera.js";
49
+ import TopDownCameraControllerSystem from "../ecs/camera/topdown/TopDownCameraControllerSystem.js";
50
+ import { TopDownCameraLanderSystem } from "../ecs/camera/topdown/TopDownCameraLanderSystem.js";
51
+ import MeshHighlightSystem from "../ecs/highlight/system/MeshHighlightSystem.js";
52
+ import LightSystem from "../ecs/light/LightSystem.js";
53
+ import Mesh from "../ecs/mesh/Mesh.js";
54
+ import { MeshSystem } from "../ecs/mesh/MeshSystem.js";
40
55
  import { PathDisplaySystem } from "../ecs/path/PathDisplaySystem.js";
41
- import RenderSystem from "../../ecs/systems/RenderSystem.js";
42
- import { makeEngineOptionsModel } from "../../../../../model/game/options/makeEngineOptionsModel.js";
43
- import { enableEditor } from "../../../../editor/enableEditor.js";
44
- import Vector3 from "../../../core/geom/Vector3.js";
45
- import { CanvasView } from "../../../view/elements/CanvasView.js";
46
- import Entity from "../../ecs/Entity.js";
47
- import GUIElement from "../../ecs/gui/GUIElement.js";
48
- import ViewportPosition from "../../ecs/gui/position/ViewportPosition.js";
49
- import Vector2 from "../../../core/geom/Vector2.js";
50
- import { Frustum, OrthographicCamera } from "three";
56
+ import Trail2DSystem from "../ecs/trail2d/Trail2DSystem.js";
57
+ import WaterSystem from "../ecs/water/WaterSystem.js";
51
58
  import { computeFrustumCorners } from "../render/forward_plus/computeFrustumCorners.js";
52
- import {
53
- ThreeClippingPlaneComputingBVHVisitor
54
- } from "../../../core/bvh2/traversal/ThreeClippingPlaneComputingBVHVisitor.js";
55
- import { RingBuffer } from "../../../core/collection/RingBuffer.js";
56
- import { computeStatisticalMean } from "../../../core/math/statistics/computeStatisticalMean.js";
57
- import { Transform } from "../../ecs/transform/Transform.js";
58
- import Mesh from "../ecs/mesh/Mesh.js";
59
- import { frustum_from_camera } from "../ecs/camera/frustum_from_camera.js";
60
- import { convex_hull_jarvis_2d } from "../../../core/geom/2d/convex-hull/convex_hull_jarvis_2d.js";
61
59
 
62
60
  const engineHarness = new EngineHarness();
63
61
 
@@ -98,11 +96,9 @@ function makeConfig(engine) {
98
96
  new TerrainSystem(graphics, assetManager),
99
97
  new WaterSystem(graphics),
100
98
  new Trail2DSystem(engine),
101
- new Foliage2System(assetManager, graphics),
102
99
  new ViewportPositionSystem(graphics.viewport.size),
103
100
  new GridPosition2TransformSystem(),
104
101
  new Transform2GridPositionSystem(),
105
- new SynchronizePositionSystem(),
106
102
  new GridPositionSystem(),
107
103
  new InputControllerSystem(devices),
108
104
  new InputSystem(devices),
@@ -157,7 +157,7 @@ class Context extends SystemEntityContext {
157
157
  this.__update_transform();
158
158
 
159
159
  const transform = this.getTransform();
160
- transform.subscribeAllChanges(this.__update_transform, this);
160
+ transform.subscribe(this.__update_transform, this);
161
161
 
162
162
  const decal_spec = this.getDecalComponent();
163
163
 
@@ -211,7 +211,7 @@ class Context extends SystemEntityContext {
211
211
  this.__fp_decal = null;
212
212
 
213
213
  const transform = this.getTransform();
214
- transform.subscribeAllChanges(this.__update_transform, this);
214
+ transform.subscribe(this.__update_transform, this);
215
215
 
216
216
  const decal_spec = this.getDecalComponent();
217
217
 
@@ -289,7 +289,7 @@ export class ShadedGeometrySystem extends System {
289
289
 
290
290
  sg.update_bounds();
291
291
 
292
- t.subscribeAllChanges(sg.updateTransform, sg);
292
+ t.subscribe(sg.updateTransform, sg);
293
293
 
294
294
  // remember entity for lookups
295
295
  sg.__entity = entity;
@@ -312,7 +312,7 @@ export class ShadedGeometrySystem extends System {
312
312
  * @param {number} entity
313
313
  */
314
314
  unlink(sg, t, entity) {
315
- t.unsubscribeAllChanges(sg.updateTransform, sg);
315
+ t.unsubscribe(sg.updateTransform, sg);
316
316
 
317
317
  // disconnect BVH
318
318
  sg.__bvh_leaf.unlink();
@@ -171,11 +171,11 @@ export class SGMeshSystem extends System {
171
171
 
172
172
  entity_node.build(ecd);
173
173
 
174
- transform.subscribeAllChanges(copy_transform);
174
+ transform.subscribe(copy_transform);
175
175
 
176
176
  entity_node.on.destroyed.addOne(() => {
177
177
 
178
- transform.unsubscribeAllChanges(copy_transform);
178
+ transform.unsubscribe(copy_transform);
179
179
 
180
180
  });
181
181
 
@@ -1,75 +1,73 @@
1
- import { EngineHarness } from "../../../EngineHarness.js";
1
+ import '../../../../../../../../css/game.scss';
2
+ import FacingDirectionSystem from "../../../../../../model/game/ecs/system/FacingDirectionSystem.js";
2
3
  import { makeEngineOptionsModel } from "../../../../../../model/game/options/makeEngineOptionsModel.js";
3
- import Path from "../../../navigation/ecs/components/Path.js";
4
+ import { enableEditor } from "../../../../../editor/enableEditor.js";
4
5
  import Vector3 from "../../../../core/geom/Vector3.js";
5
- import Highlight from "../highlight/Highlight.js";
6
- import { EntityPathStyle } from "./entity/EntityPathStyle.js";
7
- import { EntityPathMarkerDefinition } from "./entity/EntityPathMarkerDefinition.js";
8
- import { EntityBlueprint } from "../../../ecs/EntityBlueprint.js";
9
- import { Transform } from "../../../ecs/transform/Transform.js";
10
- import Mesh from "../mesh/Mesh.js";
6
+ import { CanvasView } from "../../../../view/elements/CanvasView.js";
7
+ import { GameAssetType } from "../../../asset/GameAssetType.js";
8
+ import { GLTFAssetLoader } from "../../../asset/loaders/GLTFAssetLoader.js";
9
+ import { ImageRGBADataLoader } from "../../../asset/loaders/image/ImageRGBADataLoader.js";
10
+ import { JsonAssetLoader } from "../../../asset/loaders/JsonAssetLoader.js";
11
+ import { TextureAssetLoader } from "../../../asset/loaders/texture/TextureAssetLoader.js";
11
12
  import { Animation } from "../../../ecs/animation/Animation.js";
12
- import { EngineConfiguration } from "../../../EngineConfiguration.js";
13
+ import { AttachmentSystem } from "../../../ecs/attachment/AttachmentSystem.js";
14
+ import Entity from "../../../ecs/Entity.js";
15
+ import { EntityBlueprint } from "../../../ecs/EntityBlueprint.js";
13
16
  import GUIElementSystem from "../../../ecs/gui/GUIElementSystem.js";
14
17
  import HeadsUpDisplaySystem from "../../../ecs/gui/hud/HeadsUpDisplaySystem.js";
18
+ import ViewportPositionSystem from "../../../ecs/gui/position/ViewportPositionSystem.js";
19
+ import { InverseKinematicsSystem } from "../../../ecs/ik/InverseKinematicsSystem.js";
20
+ import AnimationSystem from "../../../ecs/systems/AnimationSystem.js";
21
+ import MotionSystem from "../../../ecs/systems/MotionSystem.js";
15
22
  import ScriptSystem from "../../../ecs/systems/ScriptSystem.js";
16
- import FacingDirectionSystem from "../../../../../../model/game/ecs/system/FacingDirectionSystem.js";
17
- import PathFollowingSystem from "../../../navigation/ecs/path_following/PathFollowingSystem.js";
18
23
  import SteeringSystem from "../../../ecs/systems/SteeringSystem.js";
19
- import MotionSystem from "../../../ecs/systems/MotionSystem.js";
20
24
  import TagSystem from "../../../ecs/systems/TagSystem.js";
21
- import { AttachmentSystem } from "../../../ecs/attachment/AttachmentSystem.js";
22
25
  import TimerSystem from "../../../ecs/systems/TimerSystem.js";
23
- import AnimationSystem from "../../../ecs/systems/AnimationSystem.js";
24
- import TopDownCameraControllerSystem from "../camera/topdown/TopDownCameraControllerSystem.js";
25
- import { TopDownCameraLanderSystem } from "../camera/topdown/TopDownCameraLanderSystem.js";
26
- import { CameraSystem } from "../camera/CameraSystem.js";
27
- import { MeshSystem } from "../mesh/MeshSystem.js";
28
26
  import ClingToTerrainSystem from "../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
29
27
  import TerrainSystem from "../../../ecs/terrain/ecs/TerrainSystem.js";
30
- import WaterSystem from "../water/WaterSystem.js";
31
- import Trail2DSystem from "../trail2d/Trail2DSystem.js";
32
- import { Foliage2System } from "../../../ecs/foliage/ecs/Foliage2System.js";
33
- import ViewportPositionSystem from "../../../ecs/gui/position/ViewportPositionSystem.js";
28
+ import { Transform } from "../../../ecs/transform/Transform.js";
29
+ import { EngineConfiguration } from "../../../EngineConfiguration.js";
30
+ import { EngineHarness } from "../../../EngineHarness.js";
34
31
  import InputControllerSystem from "../../../input/ecs/systems/InputControllerSystem.js";
35
32
  import { InputSystem } from "../../../input/ecs/systems/InputSystem.js";
36
- import MeshHighlightSystem from "../highlight/system/MeshHighlightSystem.js";
37
- import LightSystem from "../light/LightSystem.js";
38
- import AnimationControllerSystem from "../animation/AnimationControllerSystem.js";
39
- import { AnimationGraphSystem } from "../animation/animator/AnimationGraphSystem.js";
40
33
  import { BehaviorSystem } from "../../../intelligence/behavior/ecs/BehaviorSystem.js";
41
- import { InverseKinematicsSystem } from "../../../ecs/ik/InverseKinematicsSystem.js";
42
- import { PathDisplaySystem } from "./PathDisplaySystem.js";
43
- import { PathDisplay } from "./PathDisplay.js";
44
- import { PathDisplayType } from "./PathDisplayType.js";
45
- import Entity from "../../../ecs/Entity.js";
46
- import { enableEditor } from "../../../../../editor/enableEditor.js";
47
- import { GameAssetType } from "../../../asset/GameAssetType.js";
48
- import { GLTFAssetLoader } from "../../../asset/loaders/GLTFAssetLoader.js";
49
- import { JsonAssetLoader } from "../../../asset/loaders/JsonAssetLoader.js";
50
- import { ImageRGBADataLoader } from "../../../asset/loaders/image/ImageRGBADataLoader.js";
34
+ import { computeCatmullRomSpline } from "../../../navigation/ecs/components/computeCatmullRomSpline.js";
35
+ import { InterpolationType } from "../../../navigation/ecs/components/InterpolationType.js";
36
+ import Path from "../../../navigation/ecs/components/Path.js";
37
+ import PathFollowingSystem from "../../../navigation/ecs/path_following/PathFollowingSystem.js";
51
38
  import {
52
39
  AmbientOcclusionPostProcessEffect
53
40
  } from "../../render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js";
54
- import { CanvasView } from "../../../../view/elements/CanvasView.js";
55
- import { computeCatmullRomSpline } from "../../../navigation/ecs/components/computeCatmullRomSpline.js";
56
- import { PathDisplaySpec } from "./PathDisplaySpec.js";
57
- import { InterpolationType } from "../../../navigation/ecs/components/InterpolationType.js";
58
- import { TubePathStyle } from "./tube/TubePathStyle.js";
59
- import { TubeMaterialType } from "./tube/TubeMaterialType.js";
60
- import { MatcapMaterialDefinition } from "./tube/MatcapMaterialDefinition.js";
61
- import { TextureAssetLoader } from "../../../asset/loaders/texture/TextureAssetLoader.js";
41
+ import { GizmoRenderingPlugin } from "../../render/gizmo/GizmoRenderingPlugin.js";
42
+ import AnimationControllerSystem from "../animation/AnimationControllerSystem.js";
43
+ import { AnimationGraphSystem } from "../animation/animator/AnimationGraphSystem.js";
44
+ import { Camera } from "../camera/Camera.js";
45
+ import { CameraSystem } from "../camera/CameraSystem.js";
46
+ import TopDownCameraControllerSystem from "../camera/topdown/TopDownCameraControllerSystem.js";
47
+ import { TopDownCameraLanderSystem } from "../camera/topdown/TopDownCameraLanderSystem.js";
48
+ import Highlight from "../highlight/Highlight.js";
49
+ import MeshHighlightSystem from "../highlight/system/MeshHighlightSystem.js";
50
+ import { ShadedGeometryHighlightSystem } from "../highlight/system/ShadedGeometryHighlightSystem.js";
51
+ import LightSystem from "../light/LightSystem.js";
62
52
  import { ShadedGeometrySystem } from "../mesh-v2/ShadedGeometrySystem.js";
63
- import { CapType } from "./tube/CapType.js";
64
- import { StandardMaterialDefinition } from "./tube/StandardMaterialDefinition.js";
53
+ import Mesh from "../mesh/Mesh.js";
54
+ import { MeshSystem } from "../mesh/MeshSystem.js";
55
+ import Trail2DSystem from "../trail2d/Trail2DSystem.js";
56
+ import WaterSystem from "../water/WaterSystem.js";
57
+ import { EntityPathMarkerDefinition } from "./entity/EntityPathMarkerDefinition.js";
58
+ import { EntityPathStyle } from "./entity/EntityPathStyle.js";
65
59
  import { PathDisplayHighlightSystem } from "./highlight/PathDisplayHighlightSystem.js";
66
- import { ShadedGeometryHighlightSystem } from "../highlight/system/ShadedGeometryHighlightSystem.js";
60
+ import { PathDisplay } from "./PathDisplay.js";
61
+ import { PathDisplaySpec } from "./PathDisplaySpec.js";
62
+ import { PathDisplaySystem } from "./PathDisplaySystem.js";
63
+ import { PathDisplayType } from "./PathDisplayType.js";
67
64
  import { BasicMaterialDefinition } from "./tube/BasicMaterialDefinition.js";
68
-
69
- import '../../../../../../../../css/game.scss';
70
- import { GizmoRenderingPlugin } from "../../render/gizmo/GizmoRenderingPlugin.js";
65
+ import { CapType } from "./tube/CapType.js";
66
+ import { MatcapMaterialDefinition } from "./tube/MatcapMaterialDefinition.js";
71
67
  import { PathNormalType } from "./tube/PathNormalType.js";
72
- import { Camera } from "../camera/Camera.js";
68
+ import { StandardMaterialDefinition } from "./tube/StandardMaterialDefinition.js";
69
+ import { TubeMaterialType } from "./tube/TubeMaterialType.js";
70
+ import { TubePathStyle } from "./tube/TubePathStyle.js";
73
71
 
74
72
  const engineHarness = new EngineHarness();
75
73
 
@@ -108,7 +106,6 @@ function makeConfig(engine) {
108
106
  new TerrainSystem(graphics, assetManager),
109
107
  new WaterSystem(graphics),
110
108
  new Trail2DSystem(engine),
111
- new Foliage2System(assetManager, graphics),
112
109
  new ViewportPositionSystem(graphics.viewport.size),
113
110
  new InputControllerSystem(devices),
114
111
  new InputSystem(devices),
@@ -1,76 +1,74 @@
1
- import { EngineHarness } from "../../../../EngineHarness.js";
2
- import { EngineConfiguration } from "../../../../EngineConfiguration.js";
1
+ import FacingDirectionSystem from "../../../../../../../model/game/ecs/system/FacingDirectionSystem.js";
2
+ import { makeEngineOptionsModel } from "../../../../../../../model/game/options/makeEngineOptionsModel.js";
3
+ import { enableEditor } from "../../../../../../editor/enableEditor.js";
4
+ import Vector3 from "../../../../../core/geom/Vector3.js";
5
+ import { pingpong } from "../../../../../core/math/pingpong.js";
6
+ import { CanvasView } from "../../../../../view/elements/CanvasView.js";
7
+ import { GameAssetType } from "../../../../asset/GameAssetType.js";
8
+ import { GLTFAssetLoader } from "../../../../asset/loaders/GLTFAssetLoader.js";
9
+ import { ImageRGBADataLoader } from "../../../../asset/loaders/image/ImageRGBADataLoader.js";
10
+ import { JsonAssetLoader } from "../../../../asset/loaders/JsonAssetLoader.js";
11
+ import { TextureAssetLoader } from "../../../../asset/loaders/texture/TextureAssetLoader.js";
12
+ import { Animation } from "../../../../ecs/animation/Animation.js";
13
+ import { AttachmentSystem } from "../../../../ecs/attachment/AttachmentSystem.js";
14
+ import Entity from "../../../../ecs/Entity.js";
15
+ import { EntityBlueprint } from "../../../../ecs/EntityBlueprint.js";
3
16
  import GUIElementSystem from "../../../../ecs/gui/GUIElementSystem.js";
4
17
  import HeadsUpDisplaySystem from "../../../../ecs/gui/hud/HeadsUpDisplaySystem.js";
18
+ import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
19
+ import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
20
+ import AnimationSystem from "../../../../ecs/systems/AnimationSystem.js";
21
+ import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
5
22
  import ScriptSystem from "../../../../ecs/systems/ScriptSystem.js";
6
- import FacingDirectionSystem from "../../../../../../../model/game/ecs/system/FacingDirectionSystem.js";
7
- import PathFollowingSystem from "../../../../navigation/ecs/path_following/PathFollowingSystem.js";
8
23
  import SteeringSystem from "../../../../ecs/systems/SteeringSystem.js";
9
- import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
10
24
  import TagSystem from "../../../../ecs/systems/TagSystem.js";
11
- import { AttachmentSystem } from "../../../../ecs/attachment/AttachmentSystem.js";
12
- import { SoundEmitterSystem } from "../../../../sound/ecs/emitter/SoundEmitterSystem.js";
13
- import SoundControllerSystem from "../../../../sound/ecs/SoundControllerSystem.js";
14
- import SoundListenerSystem from "../../../../sound/ecs/SoundListenerSystem.js";
15
25
  import TimerSystem from "../../../../ecs/systems/TimerSystem.js";
16
- import AnimationSystem from "../../../../ecs/systems/AnimationSystem.js";
17
- import TopDownCameraControllerSystem from "../../camera/topdown/TopDownCameraControllerSystem.js";
18
- import { TopDownCameraLanderSystem } from "../../camera/topdown/TopDownCameraLanderSystem.js";
19
- import { CameraSystem } from "../../camera/CameraSystem.js";
20
- import { MeshSystem } from "../../mesh/MeshSystem.js";
21
26
  import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
22
27
  import TerrainSystem from "../../../../ecs/terrain/ecs/TerrainSystem.js";
23
- import WaterSystem from "../../water/WaterSystem.js";
24
- import Trail2DSystem from "../../trail2d/Trail2DSystem.js";
25
- import { Foliage2System } from "../../../../ecs/foliage/ecs/Foliage2System.js";
26
- import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
28
+ import { Transform } from "../../../../ecs/transform/Transform.js";
29
+ import { EngineConfiguration } from "../../../../EngineConfiguration.js";
30
+ import { EngineHarness } from "../../../../EngineHarness.js";
27
31
  import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
28
- import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
29
- import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
30
32
  import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
33
+ import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
31
34
  import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
32
35
  import { InputSystem } from "../../../../input/ecs/systems/InputSystem.js";
33
- import MeshHighlightSystem from "../../highlight/system/MeshHighlightSystem.js";
34
- import LightSystem from "../../light/LightSystem.js";
35
- import AnimationControllerSystem from "../../animation/AnimationControllerSystem.js";
36
- import { AnimationGraphSystem } from "../../animation/animator/AnimationGraphSystem.js";
36
+ import { BehaviorComponent } from "../../../../intelligence/behavior/ecs/BehaviorComponent.js";
37
37
  import { BehaviorSystem } from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
38
- import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
39
- import { PathDisplaySystem } from "../PathDisplaySystem.js";
38
+ import { computeCatmullRomSpline } from "../../../../navigation/ecs/components/computeCatmullRomSpline.js";
39
+ import { InterpolationType } from "../../../../navigation/ecs/components/InterpolationType.js";
40
+ import Path from "../../../../navigation/ecs/components/Path.js";
41
+ import { PathEvents } from "../../../../navigation/ecs/components/PathEvents.js";
42
+ import PathFollowingSystem from "../../../../navigation/ecs/path_following/PathFollowingSystem.js";
43
+ import { SoundEmitterSystem } from "../../../../sound/ecs/emitter/SoundEmitterSystem.js";
44
+ import SoundControllerSystem from "../../../../sound/ecs/SoundControllerSystem.js";
45
+ import SoundListenerSystem from "../../../../sound/ecs/SoundListenerSystem.js";
40
46
  import {
41
47
  AmbientOcclusionPostProcessEffect
42
48
  } from "../../../render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js";
43
- import { GameAssetType } from "../../../../asset/GameAssetType.js";
44
- import { GLTFAssetLoader } from "../../../../asset/loaders/GLTFAssetLoader.js";
45
- import { JsonAssetLoader } from "../../../../asset/loaders/JsonAssetLoader.js";
46
- import { TextureAssetLoader } from "../../../../asset/loaders/texture/TextureAssetLoader.js";
47
- import { ImageRGBADataLoader } from "../../../../asset/loaders/image/ImageRGBADataLoader.js";
49
+ import AnimationControllerSystem from "../../animation/AnimationControllerSystem.js";
50
+ import { AnimationGraphSystem } from "../../animation/animator/AnimationGraphSystem.js";
51
+ import { CameraSystem } from "../../camera/CameraSystem.js";
52
+ import TopDownCameraControllerSystem from "../../camera/topdown/TopDownCameraControllerSystem.js";
53
+ import { TopDownCameraLanderSystem } from "../../camera/topdown/TopDownCameraLanderSystem.js";
54
+ import Highlight from "../../highlight/Highlight.js";
55
+ import MeshHighlightSystem from "../../highlight/system/MeshHighlightSystem.js";
56
+ import LightSystem from "../../light/LightSystem.js";
48
57
  import { ShadedGeometrySystem } from "../../mesh-v2/ShadedGeometrySystem.js";
49
- import { makeEngineOptionsModel } from "../../../../../../../model/game/options/makeEngineOptionsModel.js";
50
- import { enableEditor } from "../../../../../../editor/enableEditor.js";
51
- import { CanvasView } from "../../../../../view/elements/CanvasView.js";
52
- import { computeCatmullRomSpline } from "../../../../navigation/ecs/components/computeCatmullRomSpline.js";
53
- import { EntityPathStyle } from "../entity/EntityPathStyle.js";
54
- import { EntityPathMarkerDefinition } from "../entity/EntityPathMarkerDefinition.js";
55
- import { EntityBlueprint } from "../../../../ecs/EntityBlueprint.js";
56
- import { Transform } from "../../../../ecs/transform/Transform.js";
57
58
  import Mesh from "../../mesh/Mesh.js";
58
- import { Animation } from "../../../../ecs/animation/Animation.js";
59
- import Highlight from "../../highlight/Highlight.js";
60
- import { TubePathStyle } from "./TubePathStyle.js";
61
- import { TubeMaterialType } from "./TubeMaterialType.js";
62
- import { MatcapMaterialDefinition } from "./MatcapMaterialDefinition.js";
63
- import Path from "../../../../navigation/ecs/components/Path.js";
64
- import { InterpolationType } from "../../../../navigation/ecs/components/InterpolationType.js";
65
- import Vector3 from "../../../../../core/geom/Vector3.js";
66
- import { RibbonPathStyle } from "../ribbon/RibbonPathStyle.js";
59
+ import { MeshSystem } from "../../mesh/MeshSystem.js";
60
+ import Trail2DSystem from "../../trail2d/Trail2DSystem.js";
61
+ import WaterSystem from "../../water/WaterSystem.js";
62
+ import { EntityPathMarkerDefinition } from "../entity/EntityPathMarkerDefinition.js";
63
+ import { EntityPathStyle } from "../entity/EntityPathStyle.js";
67
64
  import { PathDisplay } from "../PathDisplay.js";
68
65
  import { PathDisplaySpec } from "../PathDisplaySpec.js";
66
+ import { PathDisplaySystem } from "../PathDisplaySystem.js";
69
67
  import { PathDisplayType } from "../PathDisplayType.js";
70
- import Entity from "../../../../ecs/Entity.js";
71
- import { BehaviorComponent } from "../../../../intelligence/behavior/ecs/BehaviorComponent.js";
72
- import { pingpong } from "../../../../../core/math/pingpong.js";
73
- import { PathEvents } from "../../../../navigation/ecs/components/PathEvents.js";
68
+ import { RibbonPathStyle } from "../ribbon/RibbonPathStyle.js";
69
+ import { MatcapMaterialDefinition } from "./MatcapMaterialDefinition.js";
70
+ import { TubeMaterialType } from "./TubeMaterialType.js";
71
+ import { TubePathStyle } from "./TubePathStyle.js";
74
72
 
75
73
  const engineHarness = new EngineHarness();
76
74
 
@@ -112,11 +110,9 @@ function makeConfig(engine) {
112
110
  new TerrainSystem(graphics, assetManager),
113
111
  new WaterSystem(graphics),
114
112
  new Trail2DSystem(engine),
115
- new Foliage2System(assetManager, graphics),
116
113
  new ViewportPositionSystem(graphics.viewport.size),
117
114
  new GridPosition2TransformSystem(),
118
115
  new Transform2GridPositionSystem(),
119
- new SynchronizePositionSystem(),
120
116
  new GridPositionSystem(),
121
117
  new InputControllerSystem(devices),
122
118
  new InputSystem(devices),
@@ -326,7 +322,7 @@ function sample_style_tube() {
326
322
 
327
323
 
328
324
  function main(engine) {
329
- EngineHarness.buildBasics({ engine });
325
+ EngineHarness.buildBasics({engine});
330
326
 
331
327
  const _p = new Path();
332
328
  _p.interpolation = InterpolationType.CatmullRom;
@@ -377,7 +373,7 @@ function main(engine) {
377
373
  let time = 0;
378
374
  new Entity()
379
375
  .add(BehaviorComponent.looping_function((delta) => {
380
- time += delta*0.01;
376
+ time += delta * 0.01;
381
377
  tube_style.path_mask[1] = pingpong(time, 1);
382
378
 
383
379
  path_entity.sendEvent(PathEvents.Changed);
@@ -1,32 +1,31 @@
1
- import { seededRandom } from "../../../../../core/math/random/seededRandom.js";
2
- import { EngineConfiguration } from "../../../../EngineConfiguration.js";
1
+ import SimplexNoise from 'simplex-noise';
2
+ import {makeEngineOptionsModel} from "../../../../../../../model/game/options/makeEngineOptionsModel.js";
3
+ import {enableEditor} from "../../../../../../editor/enableEditor.js";
4
+ import Vector2 from "../../../../../core/geom/Vector2.js";
5
+ import Vector3 from "../../../../../core/geom/Vector3.js";
6
+ import {seededRandom} from "../../../../../core/math/random/seededRandom.js";
7
+ import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
8
+ import RenderSystem from "../../../../ecs/systems/RenderSystem.js";
3
9
  import ScriptSystem from "../../../../ecs/systems/ScriptSystem.js";
4
- import PathFollowingSystem from "../../../../navigation/ecs/path_following/PathFollowingSystem.js";
5
10
  import TagSystem from "../../../../ecs/systems/TagSystem.js";
6
11
  import TimerSystem from "../../../../ecs/systems/TimerSystem.js";
7
- import TopDownCameraControllerSystem from "../../camera/topdown/TopDownCameraControllerSystem.js";
8
- import { TopDownCameraLanderSystem } from "../../camera/topdown/TopDownCameraLanderSystem.js";
9
- import { CameraSystem } from "../../camera/CameraSystem.js";
10
- import { MeshSystem } from "../../mesh/MeshSystem.js";
11
12
  import TerrainSystem from "../../../../ecs/terrain/ecs/TerrainSystem.js";
12
- import WaterSystem from "../../water/WaterSystem.js";
13
- import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
14
- import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
15
- import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
16
- import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
13
+ import {obtainTerrain} from "../../../../ecs/terrain/util/obtainTerrain.js";
14
+ import {EngineConfiguration} from "../../../../EngineConfiguration.js";
15
+ import {EngineHarness} from "../../../../EngineHarness.js";
16
+ import {GridPosition2TransformSystem} from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
17
17
  import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
18
+ import {Transform2GridPositionSystem} from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
18
19
  import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
19
- import { InputSystem } from "../../../../input/ecs/systems/InputSystem.js";
20
+ import {InputSystem} from "../../../../input/ecs/systems/InputSystem.js";
21
+ import PathFollowingSystem from "../../../../navigation/ecs/path_following/PathFollowingSystem.js";
22
+ import {CameraSystem} from "../../camera/CameraSystem.js";
23
+ import TopDownCameraControllerSystem from "../../camera/topdown/TopDownCameraControllerSystem.js";
24
+ import {TopDownCameraLanderSystem} from "../../camera/topdown/TopDownCameraLanderSystem.js";
20
25
  import MeshHighlightSystem from "../../highlight/system/MeshHighlightSystem.js";
21
26
  import LightSystem from "../../light/LightSystem.js";
22
- import RenderSystem from "../../../../ecs/systems/RenderSystem.js";
23
- import { makeEngineOptionsModel } from "../../../../../../../model/game/options/makeEngineOptionsModel.js";
24
- import { enableEditor } from "../../../../../../editor/enableEditor.js";
25
- import { EngineHarness } from "../../../../EngineHarness.js";
26
- import Vector2 from "../../../../../core/geom/Vector2.js";
27
- import Vector3 from "../../../../../core/geom/Vector3.js";
28
- import SimplexNoise from 'simplex-noise';
29
- import { obtainTerrain } from "../../../../ecs/terrain/util/obtainTerrain.js";
27
+ import {MeshSystem} from "../../mesh/MeshSystem.js";
28
+ import WaterSystem from "../../water/WaterSystem.js";
30
29
 
31
30
  const engineHarness = new EngineHarness();
32
31
 
@@ -52,7 +51,6 @@ function makeConfig(engine) {
52
51
  new ViewportPositionSystem(graphics.viewport.size),
53
52
  new GridPosition2TransformSystem(),
54
53
  new Transform2GridPositionSystem(),
55
- new SynchronizePositionSystem(),
56
54
  new GridPositionSystem(),
57
55
  new InputControllerSystem(devices),
58
56
  new InputSystem(devices),