@woosh/meep-engine 2.60.0 → 2.61.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.
- package/build/meep.cjs +20211 -20240
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +20211 -20240
- package/package.json +1 -1
- package/src/core/binary/BitSet.js +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +30 -182
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.spec.js +27 -1
- package/src/core/geom/ConicRay.js +16 -21
- package/src/core/geom/ConicRay.spec.js +24 -0
- package/src/core/geom/packing/miniball/Miniball.js +68 -117
- package/src/core/geom/packing/miniball/Miniball.spec.js +3 -3
- package/src/core/geom/packing/miniball/Subspan.js +47 -34
- package/src/core/geom/packing/miniball/miniball_compute_quality.js +64 -0
- package/src/core/math/bessel_3.js +1 -0
- package/src/core/math/random/randomBytes.js +2 -2
- package/src/core/math/sqr.js +8 -0
- package/src/core/model/node-graph/Connection.js +21 -23
- package/src/core/model/node-graph/DataType.js +16 -17
- package/src/core/model/node-graph/NodeGraph.js +49 -50
- package/src/core/model/node-graph/node/NodeDescription.js +42 -44
- package/src/core/model/node-graph/node/NodeInstance.js +59 -60
- package/src/core/model/node-graph/node/NodeInstancePortReference.js +27 -29
- package/src/core/model/node-graph/node/NodeRegistry.js +16 -18
- package/src/core/model/node-graph/node/Port.js +35 -37
- package/src/core/model/node-graph/node/parameter/NodeParameterDescription.js +27 -13
- package/src/core/path/computePathDirectory.spec.js +8 -0
- package/src/core/process/BaseProcess.d.ts +5 -0
- package/src/core/process/WatchDog.js +76 -75
- package/src/core/process/action/AsynchronousAction.js +24 -22
- package/src/core/process/executor/profile/Profile.js +34 -24
- package/src/core/process/executor/profile/TraceEvent.js +75 -75
- package/src/core/process/worker/OnDemandWorkerManager.js +27 -30
- package/src/core/process/worker/WorkerBuilder.js +149 -149
- package/src/core/process/worker/WorkerProxy.js +25 -21
- package/src/core/process/worker/extractTransferables.js +2 -2
- package/src/engine/Engine.js +58 -53
- package/src/engine/EngineConfiguration.d.ts +4 -4
- package/src/engine/ecs/EntityManager.js +517 -614
- package/src/engine/ecs/System.js +2 -2
- package/src/engine/ecs/transform/Transform.d.ts +7 -5
- package/src/engine/ecs/transform/Transform.js +30 -16
- package/src/engine/ecs/validateSystem.js +89 -0
- package/src/engine/graphics/GraphicsEngine.js +433 -483
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +46 -48
- package/src/engine/graphics/ecs/camera/Camera.js +11 -11
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +2 -2
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +2 -2
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.js +2 -2
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +60 -62
- package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +20 -22
- package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.js +15 -4
- package/src/engine/graphics/particles/particular/engine/ParticularEngine.js +156 -180
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +69 -71
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +51 -53
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +67 -69
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +56 -58
- package/src/engine/graphics/shadows/testShadowMapRendering.js +30 -34
- package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.spec.js +22 -20
- package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_linear.js +10 -13
- package/src/engine/graphics/texture/virtual/VirtualTexture.spec.js +1 -1
- package/src/engine/plugin/EnginePluginManager.d.ts +6 -1
- package/src/engine/ecs/components/ClingToHeightMap.js +0 -19
- package/src/engine/ecs/components/SynchronizePosition.js +0 -15
- package/src/engine/ecs/systems/ClingToHeightMapSystem.js +0 -170
- package/src/engine/ecs/systems/SynchronizePositionSystem.js +0 -43
|
@@ -1,63 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
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 {Foliage2System} from "../../ecs/foliage/ecs/Foliage2System.js";
|
|
16
|
+
import {FogOfWarRevealerSystem} from "../../ecs/fow/FogOfWarRevealerSystem.js";
|
|
17
|
+
import {FogOfWarSystem} from "../../ecs/fow/FogOfWarSystem.js";
|
|
18
|
+
import GUIElement from "../../ecs/gui/GUIElement.js";
|
|
3
19
|
import GUIElementSystem from "../../ecs/gui/GUIElementSystem.js";
|
|
4
20
|
import HeadsUpDisplaySystem from "../../ecs/gui/hud/HeadsUpDisplaySystem.js";
|
|
21
|
+
import ViewportPosition from "../../ecs/gui/position/ViewportPosition.js";
|
|
22
|
+
import ViewportPositionSystem from "../../ecs/gui/position/ViewportPositionSystem.js";
|
|
23
|
+
import {InverseKinematicsSystem} from "../../ecs/ik/InverseKinematicsSystem.js";
|
|
24
|
+
import AnimationSystem from "../../ecs/systems/AnimationSystem.js";
|
|
25
|
+
import MotionSystem from "../../ecs/systems/MotionSystem.js";
|
|
26
|
+
import RenderSystem from "../../ecs/systems/RenderSystem.js";
|
|
5
27
|
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
28
|
import SteeringSystem from "../../ecs/systems/SteeringSystem.js";
|
|
9
|
-
import MotionSystem from "../../ecs/systems/MotionSystem.js";
|
|
10
29
|
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
30
|
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
31
|
import ClingToTerrainSystem from "../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
|
|
21
32
|
import TerrainSystem from "../../ecs/terrain/ecs/TerrainSystem.js";
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import { GridPosition2TransformSystem } from "../../grid/grid2transform/GridPosition2TransformSystem.js";
|
|
27
|
-
import { Transform2GridPositionSystem } from "../../grid/transform2grid/Transform2GridPositionSystem.js";
|
|
28
|
-
import SynchronizePositionSystem from "../../ecs/systems/SynchronizePositionSystem.js";
|
|
33
|
+
import {Transform} from "../../ecs/transform/Transform.js";
|
|
34
|
+
import {EngineConfiguration} from "../../EngineConfiguration.js";
|
|
35
|
+
import {EngineHarness} from "../../EngineHarness.js";
|
|
36
|
+
import {GridPosition2TransformSystem} from "../../grid/grid2transform/GridPosition2TransformSystem.js";
|
|
29
37
|
import GridPositionSystem from "../../grid/position/GridPositionSystem.js";
|
|
38
|
+
import {Transform2GridPositionSystem} from "../../grid/transform2grid/Transform2GridPositionSystem.js";
|
|
30
39
|
import InputControllerSystem from "../../input/ecs/systems/InputControllerSystem.js";
|
|
31
|
-
import {
|
|
40
|
+
import {InputSystem} from "../../input/ecs/systems/InputSystem.js";
|
|
41
|
+
import {BehaviorSystem} from "../../intelligence/behavior/ecs/BehaviorSystem.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";
|
|
46
|
+
import AnimationControllerSystem from "../ecs/animation/AnimationControllerSystem.js";
|
|
47
|
+
import {AnimationGraphSystem} from "../ecs/animation/animator/AnimationGraphSystem.js";
|
|
48
|
+
import {CameraSystem} from "../ecs/camera/CameraSystem.js";
|
|
49
|
+
import {frustum_from_camera} from "../ecs/camera/frustum_from_camera.js";
|
|
50
|
+
import TopDownCameraControllerSystem from "../ecs/camera/topdown/TopDownCameraControllerSystem.js";
|
|
51
|
+
import {TopDownCameraLanderSystem} from "../ecs/camera/topdown/TopDownCameraLanderSystem.js";
|
|
32
52
|
import MeshHighlightSystem from "../ecs/highlight/system/MeshHighlightSystem.js";
|
|
33
53
|
import LightSystem from "../ecs/light/LightSystem.js";
|
|
34
|
-
import AnimationControllerSystem from "../ecs/animation/AnimationControllerSystem.js";
|
|
35
|
-
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";
|
|
40
|
-
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";
|
|
51
|
-
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
54
|
import Mesh from "../ecs/mesh/Mesh.js";
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
55
|
+
import {MeshSystem} from "../ecs/mesh/MeshSystem.js";
|
|
56
|
+
import {PathDisplaySystem} from "../ecs/path/PathDisplaySystem.js";
|
|
57
|
+
import Trail2DSystem from "../ecs/trail2d/Trail2DSystem.js";
|
|
58
|
+
import WaterSystem from "../ecs/water/WaterSystem.js";
|
|
59
|
+
import {computeFrustumCorners} from "../render/forward_plus/computeFrustumCorners.js";
|
|
61
60
|
|
|
62
61
|
const engineHarness = new EngineHarness();
|
|
63
62
|
|
|
@@ -102,7 +101,6 @@ function makeConfig(engine) {
|
|
|
102
101
|
new ViewportPositionSystem(graphics.viewport.size),
|
|
103
102
|
new GridPosition2TransformSystem(),
|
|
104
103
|
new Transform2GridPositionSystem(),
|
|
105
|
-
new SynchronizePositionSystem(),
|
|
106
104
|
new GridPositionSystem(),
|
|
107
105
|
new InputControllerSystem(devices),
|
|
108
106
|
new InputSystem(devices),
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import {Frustum} from 'three';
|
|
7
|
+
import {assert} from "../../../../core/assert.js";
|
|
8
|
+
import {plane3_compute_ray_intersection} from "../../../../core/geom/3d/plane/plane3_compute_ray_intersection.js";
|
|
9
|
+
import {v3_distance_above_plane} from "../../../../core/geom/vec3/v3_distance_above_plane.js";
|
|
10
10
|
import Vector1 from "../../../../core/geom/Vector1.js";
|
|
11
|
-
import { unprojectPoint } from "./unprojectPoint.js";
|
|
12
11
|
import Vector3 from "../../../../core/geom/Vector3.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
12
|
+
import ObservedBoolean from "../../../../core/model/ObservedBoolean.js";
|
|
13
|
+
import ObservedEnum from "../../../../core/model/ObservedEnum.js";
|
|
14
|
+
import {frustum_from_camera} from "./frustum_from_camera.js";
|
|
15
|
+
import {invertQuaternionOrientation} from "./InvertQuaternionOrientation.js";
|
|
16
|
+
import {ProjectionType} from "./ProjectionType.js";
|
|
17
|
+
import {unprojectPoint} from "./unprojectPoint.js";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @class
|
|
@@ -51,7 +51,7 @@ export class Camera {
|
|
|
51
51
|
*
|
|
52
52
|
* @type {ObservedBoolean}
|
|
53
53
|
*/
|
|
54
|
-
this.active = new ObservedBoolean(
|
|
54
|
+
this.active = new ObservedBoolean(true);
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Near clipping plane
|
|
@@ -157,7 +157,7 @@ class Context extends SystemEntityContext {
|
|
|
157
157
|
this.__update_transform();
|
|
158
158
|
|
|
159
159
|
const transform = this.getTransform();
|
|
160
|
-
transform.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
174
|
+
transform.subscribe(copy_transform);
|
|
175
175
|
|
|
176
176
|
entity_node.on.destroyed.addOne(() => {
|
|
177
177
|
|
|
178
|
-
transform.
|
|
178
|
+
transform.unsubscribe(copy_transform);
|
|
179
179
|
|
|
180
180
|
});
|
|
181
181
|
|
|
@@ -1,76 +1,75 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
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";
|
|
16
|
+
import {Foliage2System} from "../../../../ecs/foliage/ecs/Foliage2System.js";
|
|
3
17
|
import GUIElementSystem from "../../../../ecs/gui/GUIElementSystem.js";
|
|
4
18
|
import HeadsUpDisplaySystem from "../../../../ecs/gui/hud/HeadsUpDisplaySystem.js";
|
|
19
|
+
import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
20
|
+
import {InverseKinematicsSystem} from "../../../../ecs/ik/InverseKinematicsSystem.js";
|
|
21
|
+
import AnimationSystem from "../../../../ecs/systems/AnimationSystem.js";
|
|
22
|
+
import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
|
|
5
23
|
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
24
|
import SteeringSystem from "../../../../ecs/systems/SteeringSystem.js";
|
|
9
|
-
import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
|
|
10
25
|
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
26
|
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
27
|
import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
|
|
22
28
|
import TerrainSystem from "../../../../ecs/terrain/ecs/TerrainSystem.js";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import { GridPosition2TransformSystem } from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
|
|
28
|
-
import { Transform2GridPositionSystem } from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
|
|
29
|
-
import SynchronizePositionSystem from "../../../../ecs/systems/SynchronizePositionSystem.js";
|
|
29
|
+
import {Transform} from "../../../../ecs/transform/Transform.js";
|
|
30
|
+
import {EngineConfiguration} from "../../../../EngineConfiguration.js";
|
|
31
|
+
import {EngineHarness} from "../../../../EngineHarness.js";
|
|
32
|
+
import {GridPosition2TransformSystem} from "../../../../grid/grid2transform/GridPosition2TransformSystem.js";
|
|
30
33
|
import GridPositionSystem from "../../../../grid/position/GridPositionSystem.js";
|
|
34
|
+
import {Transform2GridPositionSystem} from "../../../../grid/transform2grid/Transform2GridPositionSystem.js";
|
|
31
35
|
import InputControllerSystem from "../../../../input/ecs/systems/InputControllerSystem.js";
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import {
|
|
37
|
-
import
|
|
38
|
-
import {
|
|
39
|
-
import
|
|
36
|
+
import {InputSystem} from "../../../../input/ecs/systems/InputSystem.js";
|
|
37
|
+
import {BehaviorComponent} from "../../../../intelligence/behavior/ecs/BehaviorComponent.js";
|
|
38
|
+
import {BehaviorSystem} from "../../../../intelligence/behavior/ecs/BehaviorSystem.js";
|
|
39
|
+
import {computeCatmullRomSpline} from "../../../../navigation/ecs/components/computeCatmullRomSpline.js";
|
|
40
|
+
import {InterpolationType} from "../../../../navigation/ecs/components/InterpolationType.js";
|
|
41
|
+
import Path from "../../../../navigation/ecs/components/Path.js";
|
|
42
|
+
import {PathEvents} from "../../../../navigation/ecs/components/PathEvents.js";
|
|
43
|
+
import PathFollowingSystem from "../../../../navigation/ecs/path_following/PathFollowingSystem.js";
|
|
44
|
+
import {SoundEmitterSystem} from "../../../../sound/ecs/emitter/SoundEmitterSystem.js";
|
|
45
|
+
import SoundControllerSystem from "../../../../sound/ecs/SoundControllerSystem.js";
|
|
46
|
+
import SoundListenerSystem from "../../../../sound/ecs/SoundListenerSystem.js";
|
|
40
47
|
import {
|
|
41
48
|
AmbientOcclusionPostProcessEffect
|
|
42
49
|
} from "../../../render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js";
|
|
43
|
-
import
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import
|
|
47
|
-
import {
|
|
48
|
-
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
|
-
import Mesh from "../../mesh/Mesh.js";
|
|
58
|
-
import { Animation } from "../../../../ecs/animation/Animation.js";
|
|
50
|
+
import AnimationControllerSystem from "../../animation/AnimationControllerSystem.js";
|
|
51
|
+
import {AnimationGraphSystem} from "../../animation/animator/AnimationGraphSystem.js";
|
|
52
|
+
import {CameraSystem} from "../../camera/CameraSystem.js";
|
|
53
|
+
import TopDownCameraControllerSystem from "../../camera/topdown/TopDownCameraControllerSystem.js";
|
|
54
|
+
import {TopDownCameraLanderSystem} from "../../camera/topdown/TopDownCameraLanderSystem.js";
|
|
59
55
|
import Highlight from "../../highlight/Highlight.js";
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import {
|
|
63
|
-
import
|
|
64
|
-
import {
|
|
65
|
-
import
|
|
66
|
-
import
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
56
|
+
import MeshHighlightSystem from "../../highlight/system/MeshHighlightSystem.js";
|
|
57
|
+
import LightSystem from "../../light/LightSystem.js";
|
|
58
|
+
import {ShadedGeometrySystem} from "../../mesh-v2/ShadedGeometrySystem.js";
|
|
59
|
+
import Mesh from "../../mesh/Mesh.js";
|
|
60
|
+
import {MeshSystem} from "../../mesh/MeshSystem.js";
|
|
61
|
+
import Trail2DSystem from "../../trail2d/Trail2DSystem.js";
|
|
62
|
+
import WaterSystem from "../../water/WaterSystem.js";
|
|
63
|
+
import {EntityPathMarkerDefinition} from "../entity/EntityPathMarkerDefinition.js";
|
|
64
|
+
import {EntityPathStyle} from "../entity/EntityPathStyle.js";
|
|
65
|
+
import {PathDisplay} from "../PathDisplay.js";
|
|
66
|
+
import {PathDisplaySpec} from "../PathDisplaySpec.js";
|
|
67
|
+
import {PathDisplaySystem} from "../PathDisplaySystem.js";
|
|
68
|
+
import {PathDisplayType} from "../PathDisplayType.js";
|
|
69
|
+
import {RibbonPathStyle} from "../ribbon/RibbonPathStyle.js";
|
|
70
|
+
import {MatcapMaterialDefinition} from "./MatcapMaterialDefinition.js";
|
|
71
|
+
import {TubeMaterialType} from "./TubeMaterialType.js";
|
|
72
|
+
import {TubePathStyle} from "./TubePathStyle.js";
|
|
74
73
|
|
|
75
74
|
const engineHarness = new EngineHarness();
|
|
76
75
|
|
|
@@ -116,7 +115,6 @@ function makeConfig(engine) {
|
|
|
116
115
|
new ViewportPositionSystem(graphics.viewport.size),
|
|
117
116
|
new GridPosition2TransformSystem(),
|
|
118
117
|
new Transform2GridPositionSystem(),
|
|
119
|
-
new SynchronizePositionSystem(),
|
|
120
118
|
new GridPositionSystem(),
|
|
121
119
|
new InputControllerSystem(devices),
|
|
122
120
|
new InputSystem(devices),
|
|
@@ -326,7 +324,7 @@ function sample_style_tube() {
|
|
|
326
324
|
|
|
327
325
|
|
|
328
326
|
function main(engine) {
|
|
329
|
-
EngineHarness.buildBasics({
|
|
327
|
+
EngineHarness.buildBasics({engine});
|
|
330
328
|
|
|
331
329
|
const _p = new Path();
|
|
332
330
|
_p.interpolation = InterpolationType.CatmullRom;
|
|
@@ -377,7 +375,7 @@ function main(engine) {
|
|
|
377
375
|
let time = 0;
|
|
378
376
|
new Entity()
|
|
379
377
|
.add(BehaviorComponent.looping_function((delta) => {
|
|
380
|
-
time += delta*0.01;
|
|
378
|
+
time += delta * 0.01;
|
|
381
379
|
tube_style.path_mask[1] = pingpong(time, 1);
|
|
382
380
|
|
|
383
381
|
path_entity.sendEvent(PathEvents.Changed);
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
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
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
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 {
|
|
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
|
|
23
|
-
import
|
|
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),
|
|
@@ -21,9 +21,15 @@ import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
|
21
21
|
import { Cache } from "../../../../core/cache/Cache.js";
|
|
22
22
|
import { computeMaterialHash } from "../../../asset/loaders/material/computeMaterialHash.js";
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* @typedef {Object} CacheKey
|
|
26
|
+
* @property {Material} color
|
|
27
|
+
* @property {Material} depth
|
|
28
|
+
*/
|
|
29
|
+
|
|
24
30
|
/**
|
|
25
31
|
* @readonly
|
|
26
|
-
* @type {Cache<Material,
|
|
32
|
+
* @type {Cache<Material,CacheKey>}
|
|
27
33
|
*/
|
|
28
34
|
const material_cache = new Cache({
|
|
29
35
|
maxWeight: 1024,
|
|
@@ -38,14 +44,14 @@ export class InstancedMeshGroup {
|
|
|
38
44
|
constructor() {
|
|
39
45
|
/**
|
|
40
46
|
* Instanced geometry
|
|
41
|
-
* @type {
|
|
47
|
+
* @type {InstancedBufferGeometry|null}
|
|
42
48
|
* @private
|
|
43
49
|
*/
|
|
44
50
|
this.__threeGeometry = null;
|
|
45
51
|
|
|
46
52
|
/**
|
|
47
53
|
* Geometry of a single instance
|
|
48
|
-
* @type {
|
|
54
|
+
* @type {BufferGeometry|null}
|
|
49
55
|
* @private
|
|
50
56
|
*/
|
|
51
57
|
this.__threeInstanceGeometry = null;
|
|
@@ -73,7 +79,12 @@ export class InstancedMeshGroup {
|
|
|
73
79
|
*/
|
|
74
80
|
this.growConstant = 16;
|
|
75
81
|
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
* @type {number}
|
|
85
|
+
*/
|
|
76
86
|
this.shrinkFactor = 0.5;
|
|
87
|
+
|
|
77
88
|
/**
|
|
78
89
|
* Minimum capacity reduction for shrinkage to occur
|
|
79
90
|
* @type {number}
|
|
@@ -238,7 +249,7 @@ export class InstancedMeshGroup {
|
|
|
238
249
|
/**
|
|
239
250
|
*
|
|
240
251
|
* @param {THREE.Material|THREE.ShaderMaterial} sourceMaterial
|
|
241
|
-
* @returns {
|
|
252
|
+
* @returns {CacheKey}
|
|
242
253
|
*/
|
|
243
254
|
#buildMaterial(sourceMaterial) {
|
|
244
255
|
//console.warn(`building material : {id:${sourceMaterial.id}, name: ${sourceMaterial.name}, type: ${sourceMaterial.type}`)
|