@woosh/meep-engine 2.75.7 → 2.75.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/build/meep.cjs +1052 -1234
  3. package/build/meep.min.js +1 -1
  4. package/build/meep.module.js +1052 -1234
  5. package/editor/actions/concrete/ModifyPatchSampler2DAction.js +6 -3
  6. package/editor/actions/concrete/PatchTerrainTextureAction.js +6 -3
  7. package/editor/ecs/component/createObjectEditor.js +2 -2
  8. package/editor/process/EditorProcess.js +12 -16
  9. package/editor/process/ProcessEngine.js +9 -10
  10. package/package.json +1 -1
  11. package/src/core/binary/dec2hex.js +1 -1
  12. package/src/{engine/ecs/ik/IKMath.js → core/geom/vec3/v3_computeOffsetVector.js} +1 -1
  13. package/src/core/math/newton_solver_1d.js +13 -4
  14. package/src/core/math/solveQuadratic.js +5 -3
  15. package/src/core/math/spline/catmull_rom_compute_T.js +19 -0
  16. package/src/{engine/navigation/ecs/components → core/math/spline}/computeCatmullRomSpline.js +3 -3
  17. package/src/{engine/navigation/ecs/components → core/math/spline}/computeCatmullRomSplineUniformDistance.js +3 -3
  18. package/src/core/math/spline/computeNonuniformCatmullRomSplineSample.js +109 -0
  19. package/src/core/math/spline/interpolate_bicubic.js +12 -0
  20. package/src/core/math/spline/spline_catmullrom_1d.js +120 -0
  21. package/src/core/model/object/ImmutableObjectPool.js +14 -5
  22. package/src/engine/control/ControlContext.js +25 -27
  23. package/src/engine/ecs/EntityManager.js +12 -9
  24. package/src/engine/ecs/EntityObserver.js +26 -22
  25. package/src/engine/ecs/binding/ComponentPropertyPath.js +12 -12
  26. package/src/engine/ecs/components/Motion.js +5 -7
  27. package/src/engine/ecs/components/SerializationMetadata.js +5 -3
  28. package/src/engine/ecs/dynamic_actions/actions/definition/AbstractActionDescription.js +0 -2
  29. package/src/engine/ecs/dynamic_actions/actions/definition/ActionSequenceDescription.js +7 -9
  30. package/src/engine/ecs/dynamic_actions/actions/definition/DelayActionDescription.js +3 -5
  31. package/src/engine/ecs/dynamic_actions/actions/definition/SendRequestActionDescription.js +6 -8
  32. package/src/engine/ecs/dynamic_actions/actions/definition/SpeakLineActionDescription.js +14 -17
  33. package/src/engine/ecs/dynamic_actions/actions/definition/WeightedRandomActionDescription.js +8 -11
  34. package/src/engine/ecs/dynamic_actions/actions/definition/WriteToBlackboardActionDescription.js +15 -18
  35. package/src/engine/ecs/ik/OneBoneSurfaceAlignmentSolver.js +7 -7
  36. package/src/engine/ecs/ik/TwoBoneInverseKinematicsSolver.js +6 -6
  37. package/src/engine/ecs/parent/EntityNode.js +39 -37
  38. package/src/engine/ecs/speaker/VoiceSystem.js +36 -39
  39. package/src/engine/ecs/storage/BinaryBufferDeSerializer.js +7 -9
  40. package/src/engine/ecs/storage/BinaryBufferSerializer.js +15 -16
  41. package/src/engine/ecs/storage/binary/BinaryClassUpgrader.js +10 -59
  42. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +14 -15
  43. package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js +3 -3
  44. package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.js +60 -62
  45. package/src/engine/ecs/storage/binary/executeBinaryClassUpgraderChain.js +46 -0
  46. package/src/engine/ecs/storage/binary/object/BinaryObjectSerializationAdapter.js +2 -2
  47. package/src/engine/ecs/system/SystemEntityContext.js +25 -23
  48. package/src/engine/ecs/tag/find_entities_with_tag.js +18 -0
  49. package/src/engine/ecs/terrain/TerrainClouds.js +23 -24
  50. package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.js +37 -31
  51. package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.js +8 -7
  52. package/src/engine/ecs/terrain/ecs/splat/SplatMapMaterialPatch.js +5 -2
  53. package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +15 -14
  54. package/src/engine/ecs/tooltip/TooltipComponent.js +6 -7
  55. package/src/engine/graphics/camera/testClippingPlaneComputation.js +0 -4
  56. package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +1 -5
  57. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +2 -6
  58. package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +12 -14
  59. package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +22 -20
  60. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +3 -4
  61. package/src/engine/graphics/render/RendererPool.js +36 -40
  62. package/src/engine/graphics/render/buffer/FrameBuffer.js +25 -24
  63. package/src/engine/graphics/render/buffer/RenderGraph.js +21 -21
  64. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +0 -4
  65. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -5
  66. package/src/engine/graphics/render/frame_graph/IRenderContext.js +31 -1
  67. package/src/engine/graphics/render/frame_graph/RenderGraph.js +5 -5
  68. package/src/engine/graphics/render/frame_graph/RenderTarget.js +9 -0
  69. package/src/engine/graphics/render/frame_graph/RenderTextureManager.js +57 -0
  70. package/src/engine/graphics/render/frame_graph/ResourceEntry.js +7 -5
  71. package/src/engine/graphics/render/frame_graph/TextureDescriptor.js +48 -33
  72. package/src/engine/graphics/render/frame_graph/TextureInitialState.js +14 -0
  73. package/src/engine/graphics/render/frame_graph/sample/deferred/CopyPass.js +20 -0
  74. package/src/engine/graphics/render/frame_graph/sample/deferred/LightingPass.js +4 -0
  75. package/src/engine/graphics/render/frame_graph/sample/deferred/run.js +34 -6
  76. package/src/engine/graphics/render/frame_graph/webgl/WebGLRenderContext.js +34 -0
  77. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +3 -6
  78. package/src/engine/graphics/sh3/gi/prototypeSHGI.js +92 -0
  79. package/src/engine/graphics/shadows/testShadowMapRendering.js +0 -2
  80. package/src/engine/graphics/texture/atlas/TextureAtlas.js +13 -11
  81. package/src/engine/graphics/texture/sampler/Sampler2D.js +15 -366
  82. package/src/engine/graphics/texture/sampler/Sampler2D.spec.js +0 -31
  83. package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.js +166 -0
  84. package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.spec.js +31 -0
  85. package/src/engine/graphics/texture/sampler/sampler2d_paint.js +81 -0
  86. package/src/engine/graphics/texture/sampler/sampler2d_sub_copy_same_item_size.js +50 -0
  87. package/src/engine/graphics/texture/virtual/{v2/VirtualTextureMemoryMapping.js → VirtualTextureMemoryMapping.js} +2 -26
  88. package/src/engine/graphics/texture/virtual/{v2/VirtualTexturePage.js → VirtualTexturePage.js} +10 -10
  89. package/src/engine/graphics/texture/virtual/{v2/VirtualTextureTileLoader.js → VirtualTextureTileLoader.js} +7 -7
  90. package/src/engine/graphics/texture/virtual/{v2/VirtualTextureUsage.js → VirtualTextureUsage.js} +1 -1
  91. package/src/engine/graphics/texture/virtual/{v2/VirtualTextureUsageUpdater.js → VirtualTextureUsageUpdater.js} +7 -7
  92. package/src/engine/graphics/texture/virtual/{v2/debug → debug}/ResidencyDebugView.js +4 -4
  93. package/src/engine/graphics/texture/virtual/{v2/debug → debug}/UsageDebugView.js +2 -2
  94. package/src/engine/graphics/texture/virtual/{v2/debug → debug}/UsagePyramidDebugView.js +4 -4
  95. package/src/engine/graphics/texture/virtual/{v2/prototype.js → prototype.js} +7 -7
  96. package/src/engine/graphics/texture/virtual/{v2/tile → tile}/compose_finger_print.js +1 -1
  97. package/src/engine/graphics/texture/virtual/{v2/tile → tile}/compose_tile_address.js +2 -2
  98. package/src/engine/graphics/texture/virtual/{v2/tile → tile}/tile_address_to_finger_print.js +1 -1
  99. package/src/engine/navigation/ecs/components/Path.js +10 -9
  100. package/src/engine/physics/computeInterceptPoint.js +44 -0
  101. package/src/engine/plugin/EnginePlugin.js +1 -2
  102. package/src/engine/ecs/components/AlignToVelocity.js +0 -9
  103. package/src/engine/ecs/components/CharacterController.js +0 -31
  104. package/src/engine/ecs/components/PhysicalBody.js +0 -51
  105. package/src/engine/ecs/components/Steering.js +0 -111
  106. package/src/engine/ecs/components/SteeringSerializationAdapter.js +0 -34
  107. package/src/engine/ecs/storage/json/Blueprint.js +0 -129
  108. package/src/engine/ecs/storage/json/EntityFactory.js +0 -207
  109. package/src/engine/ecs/storage/json/JSONDeSerializer.js +0 -148
  110. package/src/engine/ecs/storage/json/JSONSerializer.js +0 -132
  111. package/src/engine/ecs/storage/json/README.md +0 -5
  112. package/src/engine/ecs/systems/AlignToVelocitySystem.js +0 -51
  113. package/src/engine/ecs/systems/CharacterControlSystem.js +0 -134
  114. package/src/engine/ecs/systems/PhysicsSystem.js +0 -89
  115. package/src/engine/ecs/systems/PropertySetSystem.js +0 -18
  116. package/src/engine/ecs/systems/SteeringSystem.js +0 -171
  117. package/src/engine/ecs/systems/TagSystem.d.ts +0 -5
  118. package/src/engine/ecs/systems/TagSystem.js +0 -31
  119. package/src/engine/graphics/render/webgpu/sample/MeshInstance.js +0 -108
  120. package/src/engine/graphics/render/webgpu/sample/fragmentDeferredRendering.wgsl +0 -71
  121. package/src/engine/graphics/render/webgpu/sample/fragmentGBuffersDebugView.wgsl +0 -39
  122. package/src/engine/graphics/render/webgpu/sample/fragmentWriteGBuffers.wgsl +0 -21
  123. package/src/engine/graphics/render/webgpu/sample/lightUpdate.wgsl +0 -41
  124. package/src/engine/graphics/render/webgpu/sample/main.js +0 -605
  125. package/src/engine/graphics/render/webgpu/sample/vertexTextureQuad.wgsl +0 -9
  126. package/src/engine/graphics/render/webgpu/sample/vertexWriteGBuffers.wgsl +0 -30
  127. package/src/engine/graphics/texture/sampler/bicubic.js +0 -59
  128. package/src/engine/graphics/texture/sampler/bicubic.spec.js +0 -13
  129. package/src/engine/graphics/texture/virtual/TileOperation.js +0 -13
  130. package/src/engine/graphics/texture/virtual/TileTree.js +0 -150
  131. package/src/engine/graphics/texture/virtual/TileTree.spec.js +0 -58
  132. package/src/engine/graphics/texture/virtual/TileUsage.js +0 -137
  133. package/src/engine/graphics/texture/virtual/VirtualTexture.js +0 -238
  134. package/src/engine/graphics/texture/virtual/VirtualTexture.spec.js +0 -39
  135. package/src/engine/graphics/texture/virtual/page/TilePage.js +0 -148
  136. package/src/engine/graphics/texture/virtual/page/TilePageSlot.js +0 -36
  137. package/src/engine/graphics/texture/virtual/tile/Tile.js +0 -44
  138. package/src/engine/graphics/texture/virtual/tile/Tile.spec.js +0 -11
  139. package/src/engine/graphics/texture/virtual/tile/TileAddress.js +0 -63
  140. package/src/engine/graphics/texture/virtual/tile/TileAddress.spec.js +0 -30
  141. package/src/engine/graphics/texture/virtual/tile/TileLoader.js +0 -178
  142. package/src/engine/graphics/texture/virtual/tile/TileRequest.js +0 -40
  143. package/src/engine/graphics/texture/virtual/tile/TileStatus.js +0 -10
  144. package/src/engine/navigation/ecs/components/computeNonuniformCatmullRomSplineSample.js +0 -242
  145. /package/src/engine/graphics/texture/virtual/{v2/NOTES.md → NOTES.md} +0 -0
  146. /package/src/engine/graphics/texture/virtual/{v2/VirtualTextureMaterial.js → VirtualTextureMaterial.js} +0 -0
  147. /package/src/engine/graphics/texture/virtual/{v2/VirtualTextureUsageShader.js → VirtualTextureUsageShader.js} +0 -0
  148. /package/src/engine/graphics/texture/virtual/{v2/tile → tile}/VirtualTextureTile.js +0 -0
  149. /package/src/engine/graphics/texture/virtual/{v2/tile → tile}/decompose_finger_print.js +0 -0
  150. /package/src/engine/graphics/texture/virtual/{v2/tile → tile}/finger_print_to_tile_address.js +0 -0
@@ -0,0 +1,57 @@
1
+ import { ImmutableObjectPool } from "../../../../core/model/object/ImmutableObjectPool.js";
2
+
3
+
4
+ export class RenderTextureManager {
5
+
6
+
7
+ /**
8
+ *
9
+ * @type {IRenderContext|null}
10
+ */
11
+ #ctx = null;
12
+
13
+ /**
14
+ *
15
+ * @type {ImmutableObjectPool<TextureDescriptor, RenderTarget>}
16
+ */
17
+ #cache = new ImmutableObjectPool();
18
+
19
+ attach(ctx) {
20
+ this.#ctx = ctx;
21
+ }
22
+
23
+ constructor() {
24
+ this.#cache.onRemoved.add((descriptor, texture) => {
25
+
26
+ this.#ctx.destroyRenderTarget(texture);
27
+
28
+ });
29
+ }
30
+
31
+ /**
32
+ *
33
+ * @param {TextureDescriptor} descriptor
34
+ * @returns {RenderTarget}
35
+ */
36
+ get(descriptor) {
37
+ const existing = this.#cache.get(descriptor);
38
+
39
+ if (existing !== undefined) {
40
+ return existing;
41
+ }
42
+
43
+ // nothing in cache, create a new one
44
+ return this.#ctx.createRenderTarget(descriptor);
45
+
46
+ }
47
+
48
+ /**
49
+ *
50
+ * @param {RenderTarget} handle
51
+ */
52
+ release(handle) {
53
+
54
+ this.#cache.add(handle.descriptor, handle);
55
+
56
+ }
57
+ }
@@ -1,5 +1,5 @@
1
- import { TextureDescriptor } from "./TextureDescriptor.js";
2
1
  import { assert } from "../../../../core/assert.js";
2
+ import { TextureDescriptor } from "./TextureDescriptor.js";
3
3
 
4
4
  /**
5
5
  * @template T
@@ -39,20 +39,22 @@ export class ResourceEntry {
39
39
 
40
40
  /**
41
41
  * Creates actual resource
42
+ * @param {RenderTextureManager} resources
42
43
  */
43
- create() {
44
+ create(resources) {
44
45
  assert.ok(this.isTransient(), 'Only transient resources can be allocated');
45
46
 
46
- throw new Error('Not Implemented');
47
+ this.resource = resources.get(this.resource_descriptor)
47
48
  }
48
49
 
49
50
  /**
50
51
  * De-allocated memory for the resource
52
+ * @param {RenderTextureManager} resources
51
53
  */
52
- destroy() {
54
+ destroy(resources) {
53
55
  assert.ok(this.isTransient(), 'Only transient resources can be destroyed, that is resources that are created by the graph itself');
54
56
 
55
- throw new Error('Not Implemented');
57
+ resources.release(this.resource);
56
58
  }
57
59
 
58
60
  isImported() {
@@ -1,48 +1,63 @@
1
1
  import { BinaryDataType } from "../../../../core/binary/type/BinaryDataType.js";
2
+ import { computeHashIntegerArray } from "../../../../core/collection/array/computeHashIntegerArray.js";
3
+ import { computeStringHash } from "../../../../core/primitives/strings/computeStringHash.js";
4
+ import { TextureInitialState } from "./TextureInitialState.js";
5
+
6
+ export class TextureDescriptor {
2
7
 
3
- export const TextureInitialState = {
4
8
  /**
5
- * Clear the texture.
9
+ *
10
+ * @type {number}
6
11
  */
7
- Clear: 0,
12
+ height = 0;
8
13
  /**
9
- * Doesn't matter. No need to clear
14
+ *
15
+ * @type {number}
10
16
  */
11
- Undefined: 1
12
- };
17
+ width = 0;
13
18
 
14
- export class TextureDescriptor {
15
- constructor() {
16
- /**
17
- *
18
- * @type {number}
19
- */
20
- this.height = 0;
21
- /**
22
- *
23
- * @type {number}
24
- */
25
- this.width = 0;
19
+ /**
20
+ * Render texture type
21
+ * @type {BinaryDataType}
22
+ */
23
+ format = BinaryDataType.Uint8;
24
+
25
+ /**
26
+ *
27
+ * @type {number}
28
+ */
29
+ channel_count = 1;
26
30
 
27
- /**
28
- * Render texture type
29
- * @type {BinaryDataType}
30
- */
31
- this.format = BinaryDataType.Uint8;
31
+ /**
32
+ * What should the texture be initialized to
33
+ * @type {number}
34
+ */
35
+ initial_state = TextureInitialState.Clear;
32
36
 
33
- /**
34
- *
35
- * @type {number}
36
- */
37
- this.channel_count = 1;
37
+ hash() {
38
+ return computeHashIntegerArray(
39
+ this.width,
40
+ this.height,
41
+ computeStringHash(this.format),
42
+ this.channel_count,
43
+ )
44
+ }
38
45
 
39
- /**
40
- * What should the texture be initialized to
41
- * @type {number}
42
- */
43
- this.initial_state = TextureInitialState.Clear;
46
+ /**
47
+ *
48
+ * @param {TextureDescriptor} other
49
+ * @returns {boolean}
50
+ */
51
+ equals(other) {
52
+ return this.width === other.width
53
+ && this.height === other.height
54
+ && this.format === other.format
55
+ && this.channel_count === other.channel_count
56
+ && this.initial_state === other.initial_state
57
+ ;
44
58
  }
45
59
 
60
+
46
61
  static from({
47
62
  height = 0,
48
63
  width = 0,
@@ -0,0 +1,14 @@
1
+ /**
2
+ *
3
+ * @enum {number}
4
+ */
5
+ export const TextureInitialState = {
6
+ /**
7
+ * Clear the texture.
8
+ */
9
+ Clear: 0,
10
+ /**
11
+ * Doesn't matter. No need to clear
12
+ */
13
+ Undefined: 1
14
+ };
@@ -0,0 +1,20 @@
1
+ import { RenderPass } from "../../RenderPass.js";
2
+
3
+ export class CopyPass extends RenderPass {
4
+ name = "Copy"
5
+
6
+ setup(builder, { input, output }) {
7
+
8
+ builder.read(input);
9
+
10
+ const destination = builder.write(output);
11
+
12
+ return {
13
+ output: destination
14
+ }
15
+ }
16
+
17
+ execute(data, resources, render_context) {
18
+
19
+ }
20
+ }
@@ -21,4 +21,8 @@ export class LightingPass extends RenderPass {
21
21
  output: destination
22
22
  };
23
23
  }
24
+
25
+ execute(data, resources, render_context) {
26
+ // TODO implement
27
+ }
24
28
  }
@@ -1,8 +1,8 @@
1
- import { GBufferDrawPass } from "./GBufferDrawPass.js";
2
- import { LightingPass } from "./LightingPass.js";
3
1
  import { RenderGraph } from "../../RenderGraph.js";
4
- import { WebGLRenderContext } from "../../webgl/WebGLRenderContext.js";
5
2
  import { TextureDescriptor } from "../../TextureDescriptor.js";
3
+ import { WebGLRenderContext } from "../../webgl/WebGLRenderContext.js";
4
+ import { GBufferDrawPass } from "./GBufferDrawPass.js";
5
+ import { LightingPass } from "./LightingPass.js";
6
6
 
7
7
 
8
8
  const graph = new RenderGraph();
@@ -23,9 +23,37 @@ const p_p = new LightingPass({
23
23
  });
24
24
  graph.add(p_p);
25
25
 
26
- const ctx = new WebGLRenderContext();
26
+ function makeContext() {
27
+ const canvas = document.createElement('canvas');
27
28
 
28
- graph.compile();
29
29
 
30
+ canvas.width = 800;
31
+ canvas.height = 600;
32
+
33
+ document.body.appendChild(canvas);
34
+
35
+ const ctx = canvas.getContext("webgl2");
36
+
37
+ return new WebGLRenderContext(ctx);
38
+ }
39
+
40
+ const ctx = makeContext();
41
+
42
+
43
+ graph.compile();
30
44
  console.log(graph.exportToDot());
31
- graph.execute(ctx);
45
+
46
+
47
+ function render() {
48
+ graph.compile();
49
+
50
+ graph.execute(ctx);
51
+ }
52
+
53
+ function update() {
54
+ requestAnimationFrame(update);
55
+
56
+ render();
57
+ }
58
+
59
+ update();
@@ -1,5 +1,39 @@
1
1
  import { IRenderContext } from "../IRenderContext.js";
2
+ import { RenderTarget } from "../RenderTarget.js";
2
3
 
3
4
  export class WebGLRenderContext extends IRenderContext {
5
+ /**
6
+ *
7
+ * @type {WebGL2RenderingContext|null}
8
+ */
9
+ #gl = null;
4
10
 
11
+ /**
12
+ *
13
+ * @param {WebGL2RenderingContext} ctx
14
+ */
15
+ constructor(ctx) {
16
+ super();
17
+
18
+ this.#gl = ctx;
19
+ }
20
+
21
+ /**
22
+ *
23
+ * @param {TextureDescriptor} descriptor
24
+ */
25
+ createRenderTarget(descriptor) {
26
+ console.log("createRenderTarget", descriptor)
27
+
28
+ const rt = new RenderTarget();
29
+
30
+ rt.descriptor = descriptor;
31
+ rt.handle = 0;
32
+
33
+ return rt;
34
+ }
35
+
36
+ destroyRenderTarget(target) {
37
+ return true;
38
+ }
5
39
  }
@@ -1,5 +1,6 @@
1
1
  import { mat4 } from "gl-matrix";
2
2
  import FacingDirectionSystem from "../../../../../../../model/game/ecs/system/FacingDirectionSystem.js";
3
+ import { initializeEditor } from "../../../../../../../model/game/initializeEditor.js";
3
4
  import { makeEngineOptionsModel } from "../../../../../../../model/game/options/makeEngineOptionsModel.js";
4
5
  import { enableEditor } from "../../../../../../editor/enableEditor.js";
5
6
  import { AABB3 } from "../../../../../core/geom/3d/aabb/AABB3.js";
@@ -26,12 +27,10 @@ import HeadsUpDisplaySystem from "../../../../ecs/gui/hud/HeadsUpDisplaySystem.j
26
27
  import ViewportPosition from "../../../../ecs/gui/position/ViewportPosition.js";
27
28
  import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
28
29
  import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
30
+ import RenderSystem from "../../../../ecs/renderable/RenderSystem.js";
29
31
  import AnimationSystem from "../../../../ecs/systems/AnimationSystem.js";
30
32
  import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
31
- import RenderSystem from "../../../../ecs/systems/RenderSystem.js";
32
33
  import ScriptSystem from "../../../../ecs/systems/ScriptSystem.js";
33
- import SteeringSystem from "../../../../ecs/systems/SteeringSystem.js";
34
- import TagSystem from "../../../../ecs/systems/TagSystem.js";
35
34
  import TimerSystem from "../../../../ecs/systems/TimerSystem.js";
36
35
  import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
37
36
  import TerrainSystem from "../../../../ecs/terrain/ecs/TerrainSystem.js";
@@ -89,9 +88,7 @@ function makeConfig(engine) {
89
88
  new ScriptSystem(),
90
89
  new FacingDirectionSystem(),
91
90
  new PathFollowingSystem(),
92
- new SteeringSystem(),
93
91
  new MotionSystem(),
94
- new TagSystem(),
95
92
  new AttachmentSystem(),
96
93
  new SoundEmitterSystem(assetManager, sound.destination, sound.context),
97
94
  new SoundControllerSystem(),
@@ -151,7 +148,7 @@ async function init(harness) {
151
148
 
152
149
  await makeConfig(engine).apply(engine);
153
150
 
154
- enableEditor(engine);
151
+ enableEditor(engine, initializeEditor);
155
152
 
156
153
  await load_and_set_cubemap_v0(engine.graphics, 'data/textures/cubemaps/hip_miramar/32/', '.png');
157
154
 
@@ -0,0 +1,92 @@
1
+ import { make_justified_point_grid } from "../../../../core/geom/3d/util/make_justified_point_grid.js";
2
+ import Vector2 from "../../../../core/geom/Vector2.js";
3
+ import Vector3 from "../../../../core/geom/Vector3.js";
4
+ import { GameAssetType } from "../../../asset/GameAssetType.js";
5
+ import { GLTFAssetLoader } from "../../../asset/loaders/GLTFAssetLoader.js";
6
+ import { TextureAssetLoader } from "../../../asset/loaders/texture/TextureAssetLoader.js";
7
+ import Entity from "../../../ecs/Entity.js";
8
+ import { TransformAttachmentSystem } from "../../../ecs/transform-attachment/TransformAttachmentSystem.js";
9
+ import { Transform } from "../../../ecs/transform/Transform.js";
10
+ import { EngineHarness } from "../../../EngineHarness.js";
11
+ import { BehaviorSystem } from "../../../intelligence/behavior/ecs/BehaviorSystem.js";
12
+ import { SGMesh } from "../../ecs/mesh-v2/aggregate/SGMesh.js";
13
+ import { SGMeshSystem } from "../../ecs/mesh-v2/aggregate/SGMeshSystem.js";
14
+ import { ShadedGeometry } from "../../ecs/mesh-v2/ShadedGeometry.js";
15
+ import { ShadedGeometrySystem } from "../../ecs/mesh-v2/ShadedGeometrySystem.js";
16
+
17
+
18
+ /**
19
+ *
20
+ * @param {AABB3} bounds
21
+ * @param {number} [spacing]
22
+ */
23
+ function buildProbeGrid(bounds, spacing = 1) {
24
+ const positions = [];
25
+
26
+ make_justified_point_grid(bounds, spacing, (x, y, z) => {
27
+ positions.push(x, y, z);
28
+ })
29
+
30
+ }
31
+
32
+ /**
33
+ *
34
+ * @param {Engine} engine
35
+ */
36
+ async function buildGI(engine) {
37
+
38
+ const ecd = engine.entityManager.dataset;
39
+
40
+ ecd.traverseEntities([ShadedGeometry, Transform], (sg, transform, entity) => {
41
+
42
+ });
43
+
44
+ new Entity()
45
+ .add(SGMesh.fromURL("moicon/gnutti_not_optimized/model.gltf"))
46
+ .add(Transform.fromJSON({
47
+ position: { x: 10, y: 3, z: 10 },
48
+ scale: 1.5
49
+ }));
50
+
51
+ }
52
+
53
+
54
+ function init() {
55
+
56
+ /**
57
+ *
58
+ * @param {Engine} engine
59
+ */
60
+ async function main(engine) {
61
+
62
+ await EngineHarness.buildBasics({
63
+ engine,
64
+ focus: new Vector3(128, 0, 128),
65
+ distance: 30,
66
+ terrainResolution: 1,
67
+ terrainSize: new Vector2(128, 128),
68
+ enableWater: false,
69
+ });
70
+
71
+ }
72
+
73
+ new EngineHarness().initialize({
74
+ configuration(config, engine) {
75
+ config.addLoader(GameAssetType.Texture, new TextureAssetLoader());
76
+
77
+ const gltfAssetLoader = new GLTFAssetLoader();
78
+
79
+ config.addLoader(GameAssetType.ModelGLTF_JSON, gltfAssetLoader);
80
+ config.addLoader(GameAssetType.ModelGLTF, gltfAssetLoader);
81
+
82
+ config.addSystem(new BehaviorSystem(engine))
83
+ config.addSystem(new SGMeshSystem(engine));
84
+ config.addSystem(new ShadedGeometrySystem(engine));
85
+ config.addSystem(new TransformAttachmentSystem(engine));
86
+ }
87
+ })
88
+ .then(main);
89
+ }
90
+
91
+
92
+ init();
@@ -14,7 +14,6 @@ import HeadsUpDisplaySystem from "../../ecs/gui/hud/HeadsUpDisplaySystem.js";
14
14
  import ViewportPosition from "../../ecs/gui/position/ViewportPosition.js";
15
15
  import ViewportPositionSystem from "../../ecs/gui/position/ViewportPositionSystem.js";
16
16
  import AnimationSystem from "../../ecs/systems/AnimationSystem.js";
17
- import TagSystem from "../../ecs/systems/TagSystem.js";
18
17
  import ClingToTerrainSystem from "../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
19
18
  import TerrainSystem from "../../ecs/terrain/ecs/TerrainSystem.js";
20
19
  import { EngineConfiguration } from "../../EngineConfiguration.js";
@@ -69,7 +68,6 @@ function makeConfig(engine) {
69
68
  initializeGameBinarySerializationRegistry(engine.binarySerializationRegistry);
70
69
 
71
70
  config.addManySystems(
72
- new TagSystem(),
73
71
  new AttachmentSystem(),
74
72
  new SoundEmitterSystem(assetManager, sound.destination, sound.context),
75
73
  new SoundControllerSystem(),
@@ -1,19 +1,20 @@
1
- import { MaxRectanglesPacker } from "../../../../core/geom/packing/max-rect/MaxRectangles.js";
2
- import { max2 } from "../../../../core/math/max2.js";
3
- import { Sampler2D } from "../sampler/Sampler2D.js";
4
- import IdPool from "../../../../core/IdPool.js";
5
- import Vector2 from "../../../../core/geom/Vector2.js";
6
- import { AtlasPatch } from "./AtlasPatch.js";
7
- import { AtlasPatchFlag } from "./AtlasPatchFlag.js";
8
- import Signal from "../../../../core/events/signal/Signal.js";
9
1
  import { assert } from "../../../../core/assert.js";
2
+ import { ceilPowerOfTwo } from "../../../../core/binary/operations/ceilPowerOfTwo.js";
10
3
  import { BinaryDataType } from "../../../../core/binary/type/BinaryDataType.js";
11
4
  import {
12
5
  DataType2TypedArrayConstructorMapping
13
6
  } from "../../../../core/binary/type/DataType2TypedArrayConstructorMapping.js";
14
- import { AbstractTextureAtlas } from "./AbstractTextureAtlas.js";
7
+ import Signal from "../../../../core/events/signal/Signal.js";
8
+ import { MaxRectanglesPacker } from "../../../../core/geom/packing/max-rect/MaxRectangles.js";
9
+ import Vector2 from "../../../../core/geom/Vector2.js";
10
+ import IdPool from "../../../../core/IdPool.js";
11
+ import { max2 } from "../../../../core/math/max2.js";
15
12
  import { invokeObjectClone } from "../../../../core/model/object/invokeObjectClone.js";
16
- import { ceilPowerOfTwo } from "../../../../core/binary/operations/ceilPowerOfTwo.js";
13
+ import { Sampler2D } from "../sampler/Sampler2D.js";
14
+ import { sampler2d_sub_copy_same_item_size } from "../sampler/sampler2d_sub_copy_same_item_size.js";
15
+ import { AbstractTextureAtlas } from "./AbstractTextureAtlas.js";
16
+ import { AtlasPatch } from "./AtlasPatch.js";
17
+ import { AtlasPatchFlag } from "./AtlasPatchFlag.js";
17
18
 
18
19
  export class TextureAtlas extends AbstractTextureAtlas {
19
20
  /**
@@ -213,7 +214,8 @@ export class TextureAtlas extends AbstractTextureAtlas {
213
214
  const patch_position = patch.position;
214
215
  const patch_size = patch.size;
215
216
 
216
- target.copy_sameItemSize(
217
+ sampler2d_sub_copy_same_item_size(
218
+ target,
217
219
  source,
218
220
  0, 0,
219
221
  patch_position.x, patch_position.y, patch_size.x, patch_size.y