@woosh/meep-engine 2.165.0 → 2.165.2

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 (205) hide show
  1. package/README.md +137 -108
  2. package/build/bundle-worker-image-decoder.js +1 -1
  3. package/package.json +1 -1
  4. package/samples/generation/SampleGenerator0.js +3 -3
  5. package/samples/generation/filters/SampleGroundMoistureFilter.js +63 -56
  6. package/samples/generation/filters/SampleNoise20_0.js +6 -1
  7. package/samples/generation/themes/SampleTheme0.js +47 -47
  8. package/src/core/color/YCoCg/rgb_to_ycocg.d.ts +17 -0
  9. package/src/core/color/YCoCg/rgb_to_ycocg.d.ts.map +1 -0
  10. package/src/core/color/YCoCg/rgb_to_ycocg.js +20 -0
  11. package/src/core/color/YCoCg/ycocg_to_rgb.d.ts +14 -0
  12. package/src/core/color/YCoCg/ycocg_to_rgb.d.ts.map +1 -0
  13. package/src/core/color/YCoCg/ycocg_to_rgb.js +17 -0
  14. package/src/engine/REVIEW_2026_07_03.md +211 -0
  15. package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts.map +1 -1
  16. package/src/engine/animation/curve/actionProcessorOperations/curveActions.js +3 -2
  17. package/src/engine/animation/curve/compression/sample_animation_curve_to_float_array.js +1 -1
  18. package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts.map +1 -1
  19. package/src/engine/animation/keyed2/AnimationTrackPlayback.js +3 -1
  20. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js +2 -2
  21. package/src/engine/asset/preloader/AssetPreloader.d.ts.map +1 -1
  22. package/src/engine/asset/preloader/AssetPreloader.js +6 -0
  23. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -1
  24. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +5 -2
  25. package/src/engine/ecs/Entity.js +1 -1
  26. package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
  27. package/src/engine/ecs/EntityComponentDataset.js +1 -0
  28. package/src/engine/ecs/EntityManager.d.ts.map +1 -1
  29. package/src/engine/ecs/EntityManager.js +12 -8
  30. package/src/engine/ecs/EntityObserver.js +1 -1
  31. package/src/engine/ecs/System.d.ts.map +1 -1
  32. package/src/engine/ecs/System.js +4 -0
  33. package/src/engine/ecs/animation/AnimationClip.js +1 -1
  34. package/src/engine/ecs/attachment/AttachmentSystem.js +2 -2
  35. package/src/engine/ecs/attachment/TransformAttachmentBinding.d.ts.map +1 -1
  36. package/src/engine/ecs/attachment/TransformAttachmentBinding.js +11 -0
  37. package/src/engine/ecs/fow/FogOfWar.js +2 -2
  38. package/src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.d.ts.map +1 -1
  39. package/src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.js +27 -9
  40. package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +1 -1
  41. package/src/engine/ecs/gui/position/ViewportPosition.d.ts +3 -1
  42. package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
  43. package/src/engine/ecs/gui/position/ViewportPosition.js +4 -1
  44. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts +10 -0
  45. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts.map +1 -1
  46. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +43 -0
  47. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts +93 -0
  48. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts.map +1 -0
  49. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.js +315 -0
  50. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.d.ts +48 -0
  51. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.d.ts.map +1 -0
  52. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.js +331 -0
  53. package/src/engine/ecs/storage/binary/object-v2/DESIGN.md +199 -0
  54. package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.d.ts +53 -0
  55. package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.d.ts.map +1 -0
  56. package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.js +57 -0
  57. package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.d.ts +53 -0
  58. package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.d.ts.map +1 -0
  59. package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.js +56 -0
  60. package/src/engine/ecs/storage/binary/object-v2/README.md +110 -0
  61. package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.d.ts +13 -0
  62. package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.d.ts.map +1 -0
  63. package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.js +48 -0
  64. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts +29 -0
  65. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts.map +1 -0
  66. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.js +44 -0
  67. package/src/engine/ecs/system_validate_class.d.ts.map +1 -1
  68. package/src/engine/ecs/system_validate_class.js +9 -2
  69. package/src/engine/graphics/camera/makeScreenScissorFrustum.d.ts.map +1 -1
  70. package/src/engine/graphics/camera/makeScreenScissorFrustum.js +11 -10
  71. package/src/engine/graphics/canvas/canvas2d_draw_linear_scale.d.ts.map +1 -1
  72. package/src/engine/graphics/canvas/canvas2d_draw_linear_scale.js +3 -1
  73. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.d.ts +1 -1
  74. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.d.ts.map +1 -1
  75. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.js +2 -2
  76. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.d.ts.map +1 -1
  77. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.js +2 -0
  78. package/src/engine/graphics/ecs/camera/Camera.d.ts.map +1 -1
  79. package/src/engine/graphics/ecs/camera/Camera.js +4 -0
  80. package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.d.ts.map +1 -1
  81. package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.js +7 -2
  82. package/src/engine/graphics/ecs/camera/set_camera_aspect_ratio.js +1 -1
  83. package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.d.ts.map +1 -1
  84. package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.js +4 -1
  85. package/src/engine/graphics/ecs/light/binding/LightBinding.js +2 -2
  86. package/src/engine/graphics/ecs/mesh/MeshSystem.js +1 -1
  87. package/src/engine/graphics/ecs/mesh/SkeletonUtils.js +1 -1
  88. package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.js +1 -1
  89. package/src/engine/graphics/ecs/water/WaterSystem.d.ts +6 -0
  90. package/src/engine/graphics/ecs/water/WaterSystem.d.ts.map +1 -1
  91. package/src/engine/graphics/ecs/water/WaterSystem.js +12 -1
  92. package/src/engine/graphics/geometry/buffered/ensureGeometryBoundingSphere.js +1 -1
  93. package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.d.ts.map +1 -1
  94. package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.js +0 -15
  95. package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.js +10 -10
  96. package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js +1 -1
  97. package/src/engine/graphics/material/SplatMaterial.js +1 -1
  98. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
  99. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +3 -2
  100. package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.js +1 -1
  101. package/src/engine/graphics/particles/particular/group/ParticleGroup.d.ts.map +1 -1
  102. package/src/engine/graphics/particles/particular/group/ParticleGroup.js +3 -2
  103. package/src/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.js +1 -1
  104. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts +1 -8
  105. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts.map +1 -1
  106. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.js +2 -14
  107. package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.d.ts +9 -0
  108. package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.d.ts.map +1 -0
  109. package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.js +14 -0
  110. package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts.map +1 -1
  111. package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.js +4 -1
  112. package/src/engine/graphics/sh3/lpg/LightProbeGrid.d.ts +69 -0
  113. package/src/engine/graphics/sh3/lpg/LightProbeGrid.d.ts.map +1 -0
  114. package/src/engine/graphics/sh3/lpg/LightProbeGrid.js +173 -0
  115. package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.d.ts +24 -0
  116. package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.d.ts.map +1 -0
  117. package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.js +88 -0
  118. package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.d.ts +20 -0
  119. package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.d.ts.map +1 -0
  120. package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.js +79 -0
  121. package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.d.ts +11 -0
  122. package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.d.ts.map +1 -0
  123. package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.js +84 -0
  124. package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.d.ts +29 -0
  125. package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.d.ts.map +1 -0
  126. package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.js +160 -0
  127. package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.d.ts +23 -0
  128. package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.d.ts.map +1 -0
  129. package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.js +228 -0
  130. package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.d.ts +2 -0
  131. package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.d.ts.map +1 -0
  132. package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.js +24 -0
  133. package/src/engine/graphics/sh3/lpg/material/common.d.ts +3 -0
  134. package/src/engine/graphics/sh3/lpg/material/common.d.ts.map +1 -0
  135. package/src/engine/graphics/sh3/lpg/material/common.js +73 -0
  136. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.d.ts +6 -0
  137. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.d.ts.map +1 -0
  138. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.js +42 -0
  139. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.d.ts +6 -0
  140. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.d.ts.map +1 -0
  141. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.js +49 -0
  142. package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts +9 -0
  143. package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts.map +1 -0
  144. package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.js +12 -0
  145. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.d.ts +6 -0
  146. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.d.ts.map +1 -0
  147. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.js +30 -0
  148. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.d.ts +6 -0
  149. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.d.ts.map +1 -0
  150. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.js +41 -0
  151. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.d.ts +3 -0
  152. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.d.ts.map +1 -0
  153. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.js +15 -0
  154. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.d.ts +3 -0
  155. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.d.ts.map +1 -0
  156. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.js +9 -0
  157. package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts +9 -0
  158. package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts.map +1 -0
  159. package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.js +12 -0
  160. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts +20 -0
  161. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts.map +1 -0
  162. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.js +59 -0
  163. package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.d.ts.map +1 -1
  164. package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js +8 -0
  165. package/src/engine/graphics/sh3/prototypeLightProbeGrid.d.ts +2 -0
  166. package/src/engine/graphics/sh3/prototypeLightProbeGrid.d.ts.map +1 -0
  167. package/src/engine/graphics/sh3/prototypeLightProbeGrid.js +170 -0
  168. package/src/engine/graphics/texture/atlas/AtlasLookupTexture.js +1 -1
  169. package/src/engine/graphics/texture/atlas/CachingTextureAtlas.js +1 -1
  170. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.js +1 -1
  171. package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.js +3 -3
  172. package/src/engine/graphics/util/build_max_height_pyramid.d.ts.map +1 -1
  173. package/src/engine/graphics/util/build_max_height_pyramid.js +5 -2
  174. package/src/engine/grid/transform2grid/Transform2GridPositionSystem.js +1 -1
  175. package/src/engine/input/ecs/components/InputBinding.d.ts +7 -1
  176. package/src/engine/input/ecs/components/InputBinding.d.ts.map +1 -1
  177. package/src/engine/input/ecs/components/InputBinding.js +8 -1
  178. package/src/engine/input/ecs/systems/InputControllerSystem.js +1 -1
  179. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts +2 -1
  180. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts.map +1 -1
  181. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js +6 -2
  182. package/src/engine/intelligence/behavior/selector/WeightedElement.js +1 -1
  183. package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts.map +1 -1
  184. package/src/engine/knowledge/database/StaticKnowledgeDatabase.js +2 -4
  185. package/src/engine/logging/elastic/ElasticSearchLogger.d.ts +1 -2
  186. package/src/engine/logging/elastic/ElasticSearchLogger.d.ts.map +1 -1
  187. package/src/engine/logging/elastic/ElasticSearchLogger.js +14 -10
  188. package/src/engine/navigation/ecs/path_following/PathFollower.js +1 -1
  189. package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
  190. package/src/engine/navigation/grid/find_path_on_grid_astar.js +5 -2
  191. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +1 -1
  192. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
  193. package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +17 -0
  194. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  195. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
  196. package/src/engine/scene/SceneManager.d.ts.map +1 -1
  197. package/src/engine/scene/SceneManager.js +4 -2
  198. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  199. package/src/engine/simulation/Ticker.js +9 -0
  200. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts.map +1 -1
  201. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +6 -1
  202. package/src/engine/sound/material/concrete/json/serializeSoundMaterialToJSON.js +1 -1
  203. package/src/generation/theme/ThemeEngine.d.ts +9 -0
  204. package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
  205. package/src/generation/theme/ThemeEngine.js +37 -2
@@ -1 +1 @@
1
- {"version":3,"file":"StaticKnowledgeDatabase.d.ts","sourceRoot":"","sources":["../../../../../src/engine/knowledge/database/StaticKnowledgeDatabase.js"],"names":[],"mappings":"mCAWU,MAAM;;;;;;;AAShB;IAEI;;;OAGG;IACH,SAFU,aAAa,oBAAoB,CAAC,CAEmC;IAG/E;;;;OAIG;IACH,gBAAa;IAQb;;;OAGG;IACH,qCAEC;IAGD;;OAEG;IACH,cAUC;IAED;;;;;OAKG;IACH,QAJW,MAAM,QACN,MAAM,yCAiChB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,0CAAmC,SAAS,CAkBxD;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,gCAA4B,SAAS,CAUjD;IAGD;;;OAGG;IACH,wBAcC;IAED;;;;OAIG;IACH,qDAiBC;IAGD;;;;;;OAMG;IACH,qBAQC;IAED;;;;;OAKG;IACH,mEAmBC;IAED;;;;;;;OAOG;IACH,qBAeC;IAED;;;;;;OAMG;IACH,mBAIC;IAED;;;;;OAKG;IACH,mEAmCC;IAGL,mCAA2D;;CAF1D;yBArTwB,qCAAqC;mDAIX,yCAAyC"}
1
+ {"version":3,"file":"StaticKnowledgeDatabase.d.ts","sourceRoot":"","sources":["../../../../../src/engine/knowledge/database/StaticKnowledgeDatabase.js"],"names":[],"mappings":"mCAWU,MAAM;;;;;;;AAShB;IAEI;;;OAGG;IACH,SAFU,aAAa,oBAAoB,CAAC,CAEmC;IAG/E;;;;OAIG;IACH,gBAAa;IAQb;;;OAGG;IACH,qCAEC;IAGD;;OAEG;IACH,cAUC;IAED;;;;;OAKG;IACH,QAJW,MAAM,QACN,MAAM,yCAiChB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,0CAAmC,SAAS,CAkBxD;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,gCAA4B,SAAS,CAUjD;IAGD;;;OAGG;IACH,wBAcC;IAED;;;;OAIG;IACH,qDAiBC;IAGD;;;;;;OAMG;IACH,qBAQC;IAED;;;;;OAKG;IACH,mEAiBC;IAED;;;;;;;OAOG;IACH,qBAeC;IAED;;;;;;OAMG;IACH,mBAIC;IAED;;;;;OAKG;IACH,mEAmCC;IAGL,mCAA2D;;CAF1D;yBAnTwB,qCAAqC;mDAIX,yCAAyC"}
@@ -214,7 +214,7 @@ export class StaticKnowledgeDatabase {
214
214
 
215
215
  const promise = this.__link_table(d, am, executor);
216
216
 
217
- promise.catch((e) => {
217
+ return promise.catch((e) => {
218
218
  /**
219
219
  *
220
220
  * @type {StaticKnowledgeDataTable}
@@ -225,9 +225,7 @@ export class StaticKnowledgeDatabase {
225
225
  });
226
226
  });
227
227
 
228
- return Promise.all([
229
- promises
230
- ]);
228
+ return Promise.all(promises);
231
229
  }
232
230
 
233
231
  /**
@@ -38,7 +38,7 @@ export class ElasticSearchLogger extends LoggerBackend {
38
38
  * @type {number}
39
39
  * @private
40
40
  */
41
- private __timeout_ms;
41
+ private __timeout;
42
42
  /**
43
43
  *
44
44
  * @type {any}
@@ -46,7 +46,6 @@ export class ElasticSearchLogger extends LoggerBackend {
46
46
  */
47
47
  private __bound_flush;
48
48
  flush(): void;
49
- __timeout: number | NodeJS.Timeout;
50
49
  __prod(): void;
51
50
  log(level: any, message: any): void;
52
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ElasticSearchLogger.d.ts","sourceRoot":"","sources":["../../../../../src/engine/logging/elastic/ElasticSearchLogger.js"],"names":[],"mappings":"AAmCA;IACI;;;OAqDC;IA/CG;;;;OAIG;IACH,iBAA2B;IAE3B;;;;OAIG;IACH,qBAAuB;IACvB;;;;OAIG;IACH,wBAA2B;IAE3B;;;;OAIG;IACH,cAAgB;IAEhB;;;;OAIG;IACH,iBAAsB;IAEtB;;;;OAIG;IACH,qBAAsB;IAEtB;;;;OAIG;IACH,sBAA0C;IAG9C,cAuCC;IAlCO,mCAAmB;IAoC3B,eAOC;IAED,oCAUC;CACJ;8BAvJ6B,qBAAqB"}
1
+ {"version":3,"file":"ElasticSearchLogger.d.ts","sourceRoot":"","sources":["../../../../../src/engine/logging/elastic/ElasticSearchLogger.js"],"names":[],"mappings":"AAmCA;IACI;;;OAqDC;IA/CG;;;;OAIG;IACH,iBAA2B;IAE3B;;;;OAIG;IACH,qBAAuB;IACvB;;;;OAIG;IACH,wBAA2B;IAE3B;;;;OAIG;IACH,cAAgB;IAEhB;;;;OAIG;IACH,iBAAsB;IAEtB;;;;OAIG;IACH,kBAAmB;IAEnB;;;;OAIG;IACH,sBAA0C;IAG9C,cA2CC;IAED,eAOC;IAED,oCAUC;CACJ;8BA3J6B,qBAAqB"}
@@ -79,7 +79,7 @@ export class ElasticSearchLogger extends LoggerBackend {
79
79
  * @type {number}
80
80
  * @private
81
81
  */
82
- this.__timeout_ms = -1;
82
+ this.__timeout = -1;
83
83
 
84
84
  /**
85
85
  *
@@ -104,20 +104,24 @@ export class ElasticSearchLogger extends LoggerBackend {
104
104
  return;
105
105
  }
106
106
 
107
- const data = [];
107
+ // Elasticsearch _bulk expects NDJSON: an action line followed by the
108
+ // document line for each record, newline-delimited, with a trailing
109
+ // newline. A single JSON array is rejected with HTTP 400.
110
+ const lines = [];
108
111
 
109
112
  while (!buffer.isEmpty()) {
110
113
  const record = buffer.removeFirst();
111
114
 
112
- data.push({
113
- create: {
114
- '@timestamp': record.time,
115
- 'level': record.level,
116
- 'message': record.message
117
- }
118
- });
115
+ lines.push(JSON.stringify({ create: {} }));
116
+ lines.push(JSON.stringify({
117
+ '@timestamp': record.time,
118
+ 'level': record.level,
119
+ 'message': record.message
120
+ }));
119
121
  }
120
122
 
123
+ const body = lines.join('\n') + '\n';
124
+
121
125
  const xhr = new XMLHttpRequest();
122
126
 
123
127
  xhr.onreadystatechange = (evt) => {
@@ -127,7 +131,7 @@ export class ElasticSearchLogger extends LoggerBackend {
127
131
  xhr.open('POST', `${this.__url}/${this.__target}/_bulk`, true);
128
132
  xhr.overrideMimeType('text/plain');
129
133
 
130
- xhr.send(JSON.stringify(data));
134
+ xhr.send(body);
131
135
  }
132
136
 
133
137
  __prod() {
@@ -158,7 +158,7 @@ class PathFollower {
158
158
  }
159
159
 
160
160
  if (typeof json.loop === "boolean") {
161
- this.writeFlag(PathFollowerFlags.Loop, json.active);
161
+ this.writeFlag(PathFollowerFlags.Loop, json.loop);
162
162
  }
163
163
 
164
164
  if (typeof json.speed === "number") {
@@ -1 +1 @@
1
- {"version":3,"file":"find_path_on_grid_astar.d.ts","sourceRoot":"","sources":["../../../../../src/engine/navigation/grid/find_path_on_grid_astar.js"],"names":[],"mappings":"AAoMA;;;;;;;;;GASG;AACH,+CARW,MAAM,EAAE,GAAC,UAAU,GAAC,WAAW,GAAC,YAAY,SAC5C,MAAM,UACN,MAAM,SACN,MAAM,QACN,MAAM,eACN,MAAM,GACJ,MAAO,MAAM,CAAC,CAqG1B"}
1
+ {"version":3,"file":"find_path_on_grid_astar.d.ts","sourceRoot":"","sources":["../../../../../src/engine/navigation/grid/find_path_on_grid_astar.js"],"names":[],"mappings":"AAuMA;;;;;;;;;GASG;AACH,+CARW,MAAM,EAAE,GAAC,UAAU,GAAC,WAAW,GAAC,YAAY,SAC5C,MAAM,UACN,MAAM,SACN,MAAM,QACN,MAAM,eACN,MAAM,GACJ,MAAO,MAAM,CAAC,CAqG1B"}
@@ -178,8 +178,11 @@ function heuristic(index0, index1, width) {
178
178
  const dx = x2 - x1;
179
179
  const dy = y2 - y1;
180
180
 
181
- // we skip expensive SQRT, but still get a good guiding heuristic which has the same monotonic order
182
- return dx * dx + dy * dy;
181
+ // Manhattan distance. The grid is 4-connected with a minimum step cost of 1,
182
+ // so |dx|+|dy| never overestimates the true cost — it is admissible and
183
+ // consistent, which A* requires to return least-cost paths. The previous
184
+ // squared-euclidean estimate overestimated and produced non-optimal routes.
185
+ return Math.abs(dx) + Math.abs(dy);
183
186
  }
184
187
 
185
188
 
@@ -62,7 +62,7 @@ export class ServerAuthoritativeServer {
62
62
  * input-to-feedback latency (client prediction hides it). Default 0
63
63
  * reproduces pre-feature behavior.
64
64
  */
65
- constructor({ world, binary_registry, replicated_components, action_classes, scope_filter, frame_capacity, initial_buffer_size, simulation_delay_ticks, max_pending_future_lead, max_pending_total, }: {
65
+ constructor({ world, binary_registry, replicated_components, action_classes, scope_filter, frame_capacity, initial_buffer_size, simulation_delay_ticks, max_pending_future_lead, max_pending_total, identity_class, server_peer_id, }: {
66
66
  world: EntityComponentDataset;
67
67
  binary_registry: BinarySerializationRegistry;
68
68
  replicated_components: Function[];
@@ -1 +1 @@
1
- {"version":3,"file":"ServerAuthoritativeServer.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/orchestrator/ServerAuthoritativeServer.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH;IAaI;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uMApBW;QACV,KAAS,yBAAyB;QAClC,eAAmB,8BAA8B;QACjD,qBAAyB,EAAE,UAAU,CAAC;QACtC,cAAkB,EAAE,UAAU,CAAC;QAC/B,YAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,cAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,mBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,sBAA0B,CAAC,EAAE,MAAM,CAAC;KACjC,EAqMH;IA3KG,0BAA0B;IAC1B,MADW,WAAW,CASpB;IAEF,qCAAqC;IACrC,8BAAkB;IAClB,gCAAgC;IAChC,4BAAkC;IAClC,mCAAmC;IACnC,iCAAsC;IACtC,wBAAwB;IACxB,sBAAsC;IACtC,gCAAgC;IAChC,mCAAgD;IAChD,0CAA0C;IAC1C,gDAAsD;IAEtD,2BAA2B;IAC3B,eADW,YAAY,CAKrB;IAEF;;;;;;OAMG;IACH,6BAFU,MAAM,CAEqB;IAErC;;;;OAIG;IACH,wBAFU,MAAM,CAEoC;IAEpD;;;;;;;;;OASG;IACH,yBAFU,MAAM,CAEsC;IAEtD;;;;;;;;;OASG;IACH,mBAFU,MAAM,CAE0B;IAE1C;;;;;OAKG;IACH,mBAFU,MAAM,CAEW;IA+C3B;;;;;;;;;;;OAWG;IACH,YAFU,MAAM,CAEc;IAE9B;;;;;;;OAOG;IACH,gBAFU,MAAM,CAEkB;IAElC;;;;;;;;;;;OAWG;IACH,UAFU,MAAM,CAEY;IAE5B;;;;;;;OAOG;IACH,wBAFU,MAAM,CAE0B;IAG9C;;;;;;;OAOG;IACH,sBAHW,MAAM,aACN,MAAM,QAIhB;IAED;;;OAGG;IACH,yBAFW,MAAM,QAIhB;IAED;;;;;;;;OAQG;IACH,yBALW,MAAM,gBACN,MAAM,cACN,MAAM,kBACA,YAAY,KAAK,IAAI,QAIrC;IAED;;;;OAIG;IACH,qBAFW,MAAM,6CAIhB;IAED;;;;;;;;OAQG;IACH,qCAFW,MAAM,QAIhB;IAED;;;;;;;;;;;;OAYG;IACH,oBAFW,MAAM,QA2ChB;IAED;;;;;;;;OAQG;IACH,+BAHW,MAAM,GACJ,MAAM,CAOlB;IA2GD;;;;OAIG;IACH,yBAFa,MAAM,CAIlB;;CA0HJ;4BAnnB2B,kBAAkB;6BADjB,wBAAwB;mBAJlC,uCAAuC;6BAH7B,sCAAsC"}
1
+ {"version":3,"file":"ServerAuthoritativeServer.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/orchestrator/ServerAuthoritativeServer.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH;IAaI;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uOApBW;QACV,KAAS,yBAAyB;QAClC,eAAmB,8BAA8B;QACjD,qBAAyB,EAAE,UAAU,CAAC;QACtC,cAAkB,EAAE,UAAU,CAAC;QAC/B,YAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,cAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,mBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,sBAA0B,CAAC,EAAE,MAAM,CAAC;KACjC,EAoNH;IAxLG,0BAA0B;IAC1B,MADW,WAAW,CASpB;IAEF,qCAAqC;IACrC,8BAAkB;IAClB,gCAAgC;IAChC,4BAAkC;IAclC,mCAAmC;IACnC,iCAAsC;IACtC,wBAAwB;IACxB,sBAAsC;IACtC,gCAAgC;IAChC,mCAAgD;IAChD,0CAA0C;IAC1C,gDAAsD;IAEtD,2BAA2B;IAC3B,eADW,YAAY,CAKrB;IAEF;;;;;;OAMG;IACH,6BAFU,MAAM,CAEqB;IAErC;;;;OAIG;IACH,wBAFU,MAAM,CAEoC;IAEpD;;;;;;;;;OASG;IACH,yBAFU,MAAM,CAEsC;IAEtD;;;;;;;;;OASG;IACH,mBAFU,MAAM,CAE0B;IAE1C;;;;;OAKG;IACH,mBAFU,MAAM,CAEW;IA+C3B;;;;;;;;;;;OAWG;IACH,YAFU,MAAM,CAEc;IAE9B;;;;;;;OAOG;IACH,gBAFU,MAAM,CAEkB;IAElC;;;;;;;;;;;OAWG;IACH,UAFU,MAAM,CAEY;IAE5B;;;;;;;OAOG;IACH,wBAFU,MAAM,CAE0B;IAG9C;;;;;;;OAOG;IACH,sBAHW,MAAM,aACN,MAAM,QAIhB;IAED;;;OAGG;IACH,yBAFW,MAAM,QAIhB;IAED;;;;;;;;OAQG;IACH,yBALW,MAAM,gBACN,MAAM,cACN,MAAM,kBACA,YAAY,KAAK,IAAI,QAIrC;IAED;;;;OAIG;IACH,qBAFW,MAAM,6CAIhB;IAED;;;;;;;;OAQG;IACH,qCAFW,MAAM,QAIhB;IAED;;;;;;;;;;;;OAYG;IACH,oBAFW,MAAM,QA2ChB;IAED;;;;;;;;OAQG;IACH,+BAHW,MAAM,GACJ,MAAM,CAOlB;IA2GD;;;;OAIG;IACH,yBAFa,MAAM,CAIlB;;CA0HJ;4BAloB2B,kBAAkB;6BADjB,wBAAwB;mBANlC,uCAAuC;6BAH7B,sCAAsC"}
@@ -4,6 +4,8 @@ import { binarySearchHighIndex } from "../../../core/collection/array/binarySear
4
4
  import { fastArrayEquals } from "../../../core/collection/array/fastArrayEquals.js";
5
5
  import Signal from "../../../core/events/signal/Signal.js";
6
6
  import { number_compare_ascending } from "../../../core/primitives/numbers/number_compare_ascending.js";
7
+ import { NetworkIdentity } from "../ecs/components/NetworkIdentity.js";
8
+ import { make_owner_authorization } from "../ecs/owner_authorization.js";
7
9
  import { Replicator } from "../replication/Replicator.js";
8
10
  import { AlwaysRelevantScope } from "../replication/ScopeFilter.js";
9
11
  import { RewindEngine } from "../sim/RewindEngine.js";
@@ -96,6 +98,8 @@ export class ServerAuthoritativeServer {
96
98
  simulation_delay_ticks = 0,
97
99
  max_pending_future_lead = 256,
98
100
  max_pending_total = 4096,
101
+ identity_class = NetworkIdentity,
102
+ server_peer_id = -1,
99
103
  }) {
100
104
  assert.isNonNegativeInteger(simulation_delay_ticks, 'simulation_delay_ticks');
101
105
  assert.isPositiveInteger(max_pending_future_lead, 'max_pending_future_lead');
@@ -115,6 +119,19 @@ export class ServerAuthoritativeServer {
115
119
  this.world = world;
116
120
  /** @type {SimActionExecutor} */
117
121
  this.executor = this.peer.executor;
122
+
123
+ // Secure-by-default inbound authorization: a remote peer may only mutate
124
+ // entities it owns (identity.owner_peer_id === sender); the authoritative
125
+ // server (sender === server_peer_id) may mutate anything. Without this a
126
+ // connected peer can craft an action targeting another peer's — or a
127
+ // server-owned — entity and drive it. Games that intentionally allow
128
+ // shared mutation can overwrite `executor.authorize` (e.g. set it to null)
129
+ // after construction.
130
+ this.executor.authorize = make_owner_authorization({
131
+ world,
132
+ identity_class,
133
+ server_peer_id,
134
+ });
118
135
  /** @type {ReplicationSlotTable} */
119
136
  this.slot_table = this.peer.slot_table;
120
137
  /** @type {ActionLog} */
@@ -64,11 +64,11 @@ export class FluidObstacleSystem extends System<any, any, any, any, any> {
64
64
  /**
65
65
  * @param {FluidComponent} fluid
66
66
  */
67
- static "__#148@#refresh_masks"(fluid: FluidComponent): void;
67
+ static "__#154@#refresh_masks"(fluid: FluidComponent): void;
68
68
  /**
69
69
  * @param {FluidComponent} fluid
70
70
  */
71
- static "__#148@#clear_field"(fluid: FluidComponent): void;
71
+ static "__#154@#clear_field"(fluid: FluidComponent): void;
72
72
  /**
73
73
  * Mark every cell of `fluid` whose centre lies within `inflation` of the
74
74
  * posed shape as solid. Iteration is clipped to the shape's world AABB
@@ -80,7 +80,7 @@ export class FluidObstacleSystem extends System<any, any, any, any, any> {
80
80
  * @param {number} inflation world-units SDF threshold
81
81
  * @param {Float64Array} point length-3 scratch
82
82
  */
83
- static "__#148@#voxelize"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array): void;
83
+ static "__#154@#voxelize"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array): void;
84
84
  /**
85
85
  * Write the obstacle's translation velocity onto every face of every cell
86
86
  * it voxelized — the moving-wall boundary condition. Runs AFTER the mask
@@ -100,7 +100,7 @@ export class FluidObstacleSystem extends System<any, any, any, any, any> {
100
100
  * @param {number} wvy
101
101
  * @param {number} wvz
102
102
  */
103
- static "__#148@#stamp_wall_velocity"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array, wvx: number, wvy: number, wvz: number): void;
103
+ static "__#154@#stamp_wall_velocity"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array, wvx: number, wvy: number, wvz: number): void;
104
104
  constructor();
105
105
  dependencies: (typeof FluidObstacle)[];
106
106
  components_used: (ResourceAccessSpecification<typeof RigidBody> | ResourceAccessSpecification<typeof Collider> | ResourceAccessSpecification<typeof Transform> | ResourceAccessSpecification<typeof FluidComponent> | ResourceAccessSpecification<typeof FluidObstacle>)[];
@@ -38,7 +38,7 @@ export class FluidSystem extends System<any, any, any, any, any> {
38
38
  * @param {FluidEffectorsComponent} effectors_component
39
39
  * @param {Transform} transform
40
40
  */
41
- static "__#147@#sync_effectors_from_transform"(effectors_component: FluidEffectorsComponent, transform: Transform): void;
41
+ static "__#153@#sync_effectors_from_transform"(effectors_component: FluidEffectorsComponent, transform: Transform): void;
42
42
  /**
43
43
  * Visitor for the (FluidComponent, Transform) traversal — keeps the field's
44
44
  * grid origin locked to a cell-aligned position near the transform.
@@ -61,7 +61,7 @@ export class FluidSystem extends System<any, any, any, any, any> {
61
61
  * @param {FluidComponent} component
62
62
  * @param {Transform} transform
63
63
  */
64
- static "__#147@#reanchor_field"(component: FluidComponent, transform: Transform): void;
64
+ static "__#153@#reanchor_field"(component: FluidComponent, transform: Transform): void;
65
65
  /**
66
66
  * Write the world-to-grid affine for a FluidComponent into `out`. Axis-aligned,
67
67
  * uniform-scale, so the matrix is sparse:
@@ -76,7 +76,7 @@ export class FluidSystem extends System<any, any, any, any, any> {
76
76
  * @param {Float32Array} out length-16
77
77
  * @param {FluidComponent} component
78
78
  */
79
- static "__#147@#build_world_to_grid"(out: Float32Array, component: FluidComponent): void;
79
+ static "__#153@#build_world_to_grid"(out: Float32Array, component: FluidComponent): void;
80
80
  constructor();
81
81
  dependencies: (typeof FluidComponent)[];
82
82
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SceneManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/scene/SceneManager.js"],"names":[],"mappings":";AAKA;IA6BI;;;;;OAKG;IACH,2BAJW,aAAa,gBA8BvB;IAtDD;;;OAGG;IACH,2BAEC;IAQD;;;OAGG;IACH,oCAEC;IAUG;;OAEG;IACH,QAFU,KAAK,KAAK,CAAC,CAEG;IAQxB;;;OAGG;IACH,aAAkB;IAElB;;;;;OAKG;IACH,uBAAe;IAGnB;;;;OAIG;IACH,aAHW,MAAM,GACJ,KAAK,CAQjB;IAED;;;OAGG;IACH,WAFW,KAAK,QAQf;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,MAAM,CAalB;IAED;;;;OAIG;IACH,mBAHW,MAAM,aAOhB;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,OAAO,CAqBnB;IAED;;;OAGG;IACH,SAFa,YAAY,CAYxB;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,wBA+BC;IAED;;;OAGG;IACH,sBA2BC;IAED;;OAEG;IACH,+BAQC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,qCAEC;IAED;;;OAGG;IACH,UAFW,MAAM,QAqBhB;IAED;;;OAGG;IACH,cAFW,MAAM,QAOhB;IAED;;;OAGG;IACH,YAFa,MAAM,CAQlB;IAED;;OAEG;IACH,kBAEC;IAED,6BAEC;;CACJ;kBAxUiB,YAAY;8BADA,yBAAyB;iBADtC,oCAAoC"}
1
+ {"version":3,"file":"SceneManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/scene/SceneManager.js"],"names":[],"mappings":";AAKA;IA6BI;;;;;OAKG;IACH,2BAJW,aAAa,gBA8BvB;IAtDD;;;OAGG;IACH,2BAEC;IAQD;;;OAGG;IACH,oCAEC;IAUG;;OAEG;IACH,QAFU,KAAK,KAAK,CAAC,CAEG;IAQxB;;;OAGG;IACH,aAAkB;IAElB;;;;;OAKG;IACH,uBAAe;IAGnB;;;;OAIG;IACH,aAHW,MAAM,GACJ,KAAK,CAQjB;IAED;;;OAGG;IACH,WAFW,KAAK,QAQf;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,MAAM,CAalB;IAED;;;;OAIG;IACH,mBAHW,MAAM,aAOhB;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,OAAO,CAqBnB;IAED;;;OAGG;IACH,SAFa,YAAY,CAcxB;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,wBA+BC;IAED;;;OAGG;IACH,sBA2BC;IAED;;OAEG;IACH,+BAQC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,qCAEC;IAED;;;OAGG;IACH,UAFW,MAAM,QAqBhB;IAED;;;OAGG;IACH,cAFW,MAAM,QAOhB;IAED;;;OAGG;IACH,YAFa,MAAM,CAQlB;IAED;;OAEG;IACH,kBAEC;IAED,6BAEC;;CACJ;kBA1UiB,YAAY;8BADA,yBAAyB;iBADtC,oCAAoC"}
@@ -153,8 +153,10 @@ class SceneManager {
153
153
  clear() {
154
154
 
155
155
  if (this.#current_scene !== null) {
156
- this.#current_scene.active.set(false);
157
- this.#entity_manager.detachDataset();
156
+ // route through deactivateScene so the scene's clock speed modifiers
157
+ // are removed and its modifier listeners are unwatched, not just the
158
+ // dataset detached (otherwise slow-mo etc. leaks onto the next scene)
159
+ this.deactivateScene(this.#current_scene);
158
160
 
159
161
  this.#current_scene = null;
160
162
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Ticker.d.ts","sourceRoot":"","sources":["../../../../src/engine/simulation/Ticker.js"],"names":[],"mappings":";AAIA;;;;;;;;;;;;;;GAcG;AACH;IACI;;;OAGG;IACH,gBAFU,KAAK,CAEK;IAEpB;;;;;;;;;;;;OAYG;IACH,uBAFU,OAAO,CAEY;IAwB7B;;;;OAIG;IACH,iBAFU,OAAO,MAAM,CAAC,CAEF;IA+GtB;;;OAGG;IACH,uBAFW,MAAM,QAyDhB;IAED,cAOC;IAED,eAQC;IAED,aAUC;;CACJ;kBA5QiB,aAAa;mBADZ,oCAAoC"}
1
+ {"version":3,"file":"Ticker.d.ts","sourceRoot":"","sources":["../../../../src/engine/simulation/Ticker.js"],"names":[],"mappings":";AAIA;;;;;;;;;;;;;;GAcG;AACH;IACI;;;OAGG;IACH,gBAFU,KAAK,CAEK;IAEpB;;;;;;;;;;;;OAYG;IACH,uBAFU,OAAO,CAEY;IAwB7B;;;;OAIG;IACH,iBAFU,OAAO,MAAM,CAAC,CAEF;IA+GtB;;;OAGG;IACH,uBAFW,MAAM,QAyDhB;IAED,cAWC;IAED,eAaC;IAED,aAUC;;CACJ;kBArRiB,aAAa;mBADZ,oCAAoC"}
@@ -245,6 +245,10 @@ class Ticker {
245
245
  }
246
246
 
247
247
  this.#isRunning = false;
248
+
249
+ //freeze the clock so no simulation time accrues while paused; without this
250
+ //the first getDelta() after resume() returns the whole paused duration
251
+ this.clock.pause();
248
252
  }
249
253
 
250
254
  resume() {
@@ -255,6 +259,11 @@ class Ticker {
255
259
 
256
260
 
257
261
  this.#isRunning = true;
262
+
263
+ //discard the time spent paused and restart from the current moment,
264
+ //mirroring #resume() for the background-suspend path
265
+ this.clock.getDelta();
266
+ this.clock.start();
258
267
  }
259
268
 
260
269
  stop() {
@@ -1 +1 @@
1
- {"version":3,"file":"SoundEmitterSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/sound/ecs/emitter/SoundEmitterSystem.js"],"names":[],"mappings":"mCAWU,MAAM;;;;;;AAQhB;;;;;;;;;;;;;GAaG;AACH;IACI;;;;OAIG;IACH,kEA4CC;IAzCG,yDAA6C;IAE7C;;OAEG;IACH,yBAA8B;IAE9B;;OAEG;IACH,iBAFU,YAAY,CAEoB;IAE1C,qBAA8C;IAE9C,2BAAgC;IAIhC;;;;OAIG;IACH,mBAAkF;IAElF;;;;OAIG;IACH;YAFiB,MAAM,GAAC,MAAM;MAM7B;IAED;;;OAGG;IACH,MAFU,4BAA4B,EAAE,CAE1B;IAGlB;;;;OAIG;IACH,gCAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,sCAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,cAJW,YAAY,aACZ,SAAS,UACT,MAAM,QAahB;IAED;;;;OAIG;IACH,gBAJW,YAAY,aACZ,SAAS,UACT,MAAM,QAUhB;IAED,6BAgBC;CACJ;uBAvJsB,wBAAwB;0BACrB,qCAAqC;6BAGlC,mBAAmB;6CACH,mCAAmC"}
1
+ {"version":3,"file":"SoundEmitterSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/sound/ecs/emitter/SoundEmitterSystem.js"],"names":[],"mappings":"mCAWU,MAAM;;;;;;AAQhB;;;;;;;;;;;;;GAaG;AACH;IACI;;;;OAIG;IACH,kEA4CC;IAzCG,yDAA6C;IAE7C;;OAEG;IACH,yBAA8B;IAE9B;;OAEG;IACH,iBAFU,YAAY,CAEoB;IAE1C,qBAA8C;IAE9C,2BAAgC;IAIhC;;;;OAIG;IACH,mBAAkF;IAElF;;;;OAIG;IACH;YAFiB,MAAM,GAAC,MAAM;MAM7B;IAED;;;OAGG;IACH,MAFU,4BAA4B,EAAE,CAE1B;IAGlB;;;;OAIG;IACH,gCAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,sCAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,cAJW,YAAY,aACZ,SAAS,UACT,MAAM,QAahB;IAED;;;;OAIG;IACH,gBAJW,YAAY,aACZ,SAAS,UACT,MAAM,QAUhB;IAED,6BAqBC;CACJ;uBA5JsB,wBAAwB;0BACrB,qCAAqC;6BAGlC,mBAAmB;6CACH,mCAAmC"}
@@ -145,7 +145,12 @@ export class SoundEmitterSystem extends System {
145
145
  if (soundListener.entity !== -1) {
146
146
  const listenerTransform = ecd.getComponent(soundListener.entity, Transform);
147
147
 
148
- sopra.setListener(listenerTransform.position);
148
+ // a SoundListener entity is expected to also carry a Transform, but
149
+ // guard the gap (component construction order, non-spatial listener)
150
+ // rather than dereference undefined and freeze all audio every frame
151
+ if (listenerTransform !== undefined) {
152
+ sopra.setListener(listenerTransform.position);
153
+ }
149
154
  }
150
155
  }
151
156
 
@@ -1,6 +1,6 @@
1
1
  export function serializeSoundMaterialToJSON(material) {
2
2
  return {
3
- type: Object.getPrototypeOf(material).typeName,
3
+ type: material.constructor.typeName,
4
4
  data: material.toJSON()
5
5
  };
6
6
  }
@@ -69,6 +69,15 @@ export class ThemeEngine {
69
69
  */
70
70
  applyCellRules(grid: GridData, ecd: EntityComponentDataset): Task;
71
71
  /**
72
+ * Synchronize the GPU-side terrain state after theming has mutated the CPU-side data
73
+ * behind the renderer's back.
74
+ *
75
+ * {@link applyTerrainThemes} adds the real terrain layers and paints splat weights, and
76
+ * the cell rules write heights, all straight into the backing arrays — none of which
77
+ * flags the corresponding GPU resources dirty. If the {@link Terrain} was linked (and
78
+ * thus already rendering) before theming, the shader keeps rendering the link-time state
79
+ * — 0 layers, an empty splat map, pre-generation heights — showing up as black or
80
+ * partially-textured terrain.
72
81
  *
73
82
  * @param {Terrain} terrain
74
83
  * @returns {Task}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeEngine.d.ts","sourceRoot":"","sources":["../../../../src/generation/theme/ThemeEngine.js"],"names":[],"mappings":"AAqFA;IAEI;;;OAGG;IACH,OAFU,uBAAuB,CAEN;IAE3B;;;OAGG;IACH,uBAFqB,MAAM,CAEF;IAEzB;;;;OAIG;IACH,uBAAsB;IAEtB,2BAEC;IAED;;;OAGG;IACH,sBAEC;IAED;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,4BAUC;IAED;;;;;;OAMG;IACH,4BALW,WAAW,KACX,MAAM,KACN,MAAM,GACJ,MAAM,CA8BlB;IAED;;;;;;OAMG;IACH,oEAHW,MAAM,GACJ,IAAI,CAmChB;IAED;;;;;OAKG;IACH,sDAFa,SAAS,CAgLrB;IAED;;;;;;OAMG;IACH,+DAHW,MAAM,GACJ,IAAI,GAAC,SAAS,CA2G1B;IAED;;;;OAIG;IACH,kEAqCC;IAED;;;;OAIG;IACH,iCAFa,IAAI,CAIhB;IAED;;;;OAIG;IACH,uCAHa,SAAS,CAYrB;IAED;;;;;OAKG;IACH,oDAFa,SAAS,CA6DrB;CACJ;6BAzoB4B,8CAA8C;iBAM1D,iCAAiC;sBAC5B,sCAAsC"}
1
+ {"version":3,"file":"ThemeEngine.d.ts","sourceRoot":"","sources":["../../../../src/generation/theme/ThemeEngine.js"],"names":[],"mappings":"AAoFA;IAEI;;;OAGG;IACH,OAFU,uBAAuB,CAEN;IAE3B;;;OAGG;IACH,uBAFqB,MAAM,CAEF;IAEzB;;;;OAIG;IACH,uBAAsB;IAEtB,2BAEC;IAED;;;OAGG;IACH,sBAEC;IAED;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,4BAUC;IAED;;;;;;OAMG;IACH,4BALW,WAAW,KACX,MAAM,KACN,MAAM,GACJ,MAAM,CA8BlB;IAED;;;;;;OAMG;IACH,oEAHW,MAAM,GACJ,IAAI,CAmChB;IAED;;;;;OAKG;IACH,sDAFa,SAAS,CAgLrB;IAED;;;;;;OAMG;IACH,+DAHW,MAAM,GACJ,IAAI,GAAC,SAAS,CA2G1B;IAED;;;;OAIG;IACH,kEAqCC;IAED;;;;;;;;;;;;;OAaG;IACH,iCAFa,IAAI,CA+BhB;IAED;;;;OAIG;IACH,uCAHa,SAAS,CAYrB;IAED;;;;;OAKG;IACH,oDAFa,SAAS,CA6DrB;CACJ;6BA5qB4B,8CAA8C;iBAM1D,iCAAiC;sBAC5B,sCAAsC"}
@@ -12,7 +12,6 @@ import TaskGroup from "../../core/process/task/TaskGroup.js";
12
12
  import { TaskSignal } from "../../core/process/task/TaskSignal.js";
13
13
  import { actionTask } from "../../core/process/task/util/actionTask.js";
14
14
  import { countTask } from "../../core/process/task/util/countTask.js";
15
- import { emptyTask } from "../../core/process/task/util/emptyTask.js";
16
15
  import { futureTask } from "../../core/process/task/util/futureTask.js";
17
16
  import { TerrainLayer } from "../../engine/ecs/terrain/ecs/layers/TerrainLayer.js";
18
17
  import { TerrainFlags } from "../../engine/ecs/terrain/ecs/TerrainFlags.js";
@@ -560,12 +559,48 @@ export class ThemeEngine {
560
559
  }
561
560
 
562
561
  /**
562
+ * Synchronize the GPU-side terrain state after theming has mutated the CPU-side data
563
+ * behind the renderer's back.
564
+ *
565
+ * {@link applyTerrainThemes} adds the real terrain layers and paints splat weights, and
566
+ * the cell rules write heights, all straight into the backing arrays — none of which
567
+ * flags the corresponding GPU resources dirty. If the {@link Terrain} was linked (and
568
+ * thus already rendering) before theming, the shader keeps rendering the link-time state
569
+ * — 0 layers, an empty splat map, pre-generation heights — showing up as black or
570
+ * partially-textured terrain.
563
571
  *
564
572
  * @param {Terrain} terrain
565
573
  * @returns {Task}
566
574
  */
567
575
  updateTerrain(terrain) {
568
- return emptyTask();
576
+ return futureTask(new Future((resolve, reject) => {
577
+
578
+ // The material was baked with the layer count present at link time (0 in the
579
+ // "generate into a live terrain" flow); recompile it with the real count and
580
+ // rebind the splat / diffuse / scale samplers. Idempotent — updateMaterial()
581
+ // only recompiles when the layer count actually changed.
582
+ terrain.updateMaterial();
583
+
584
+ // Splat weights were written straight into the raw weightData backing store,
585
+ // bypassing the SplatMapping mutators that are the only writers to flag the
586
+ // texture dirty; force a fresh upload of the completed weights.
587
+ terrain.splat.weightTexture.needsUpdate = true;
588
+
589
+ // Heights were written into samplerHeight (which shares its buffer with
590
+ // heightTexture) without flagging the GPU copy dirty; re-upload it.
591
+ terrain.updateHeightTexture();
592
+
593
+ // Re-sync the build worker's height snapshot and the tile height range so that
594
+ // tiles streamed in after generation reflect the generated heights. This needs a
595
+ // running build worker; when the terrain is not linked the worker is stopped and
596
+ // the next startBuildService() (on link) re-syncs, so there is nothing to await.
597
+ if (terrain.getFlag(TerrainFlags.Linked)) {
598
+ terrain.updateWorkerHeights().then(resolve, reject);
599
+ } else {
600
+ resolve();
601
+ }
602
+
603
+ }), 'Synchronize terrain GPU state');
569
604
  }
570
605
 
571
606
  /**