@woosh/meep-engine 2.164.0 → 2.165.1

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 (451) hide show
  1. package/README.md +137 -108
  2. package/build/bundle-worker-image-decoder.js +1 -1
  3. package/build/bundle-worker-terrain.js +1 -1
  4. package/package.json +1 -1
  5. package/samples/generation/SampleGenerator0.js +3 -3
  6. package/samples/generation/filters/SampleGroundMoistureFilter.js +63 -56
  7. package/samples/generation/filters/SampleNoise20_0.js +6 -1
  8. package/samples/generation/themes/SampleTheme0.js +47 -47
  9. package/src/core/binary/BitImage2.d.ts +91 -0
  10. package/src/core/binary/BitImage2.d.ts.map +1 -0
  11. package/src/core/binary/BitImage2.js +242 -0
  12. package/src/core/color/YCoCg/rgb_to_ycocg.d.ts +17 -0
  13. package/src/core/color/YCoCg/rgb_to_ycocg.d.ts.map +1 -0
  14. package/src/core/color/YCoCg/rgb_to_ycocg.js +20 -0
  15. package/src/core/color/YCoCg/ycocg_to_rgb.d.ts +14 -0
  16. package/src/core/color/YCoCg/ycocg_to_rgb.d.ts.map +1 -0
  17. package/src/core/color/YCoCg/ycocg_to_rgb.js +17 -0
  18. package/src/core/geom/2d/oriented-box/min_area_rect_2d.d.ts +22 -0
  19. package/src/core/geom/2d/oriented-box/min_area_rect_2d.d.ts.map +1 -0
  20. package/src/core/geom/2d/oriented-box/min_area_rect_2d.js +69 -0
  21. package/src/core/geom/2d/packing/skyline.d.ts +116 -0
  22. package/src/core/geom/2d/packing/skyline.d.ts.map +1 -0
  23. package/src/core/geom/2d/packing/skyline.js +258 -0
  24. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts +18 -0
  25. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts.map +1 -0
  26. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.js +86 -0
  27. package/src/core/geom/3d/atlas/ATLAS_PORT_PLAN.md +486 -0
  28. package/src/core/geom/3d/atlas/BFF_PLAN.md +174 -0
  29. package/src/core/geom/3d/atlas/Chart.d.ts +58 -0
  30. package/src/core/geom/3d/atlas/Chart.d.ts.map +1 -0
  31. package/src/core/geom/3d/atlas/Chart.js +77 -0
  32. package/src/core/geom/3d/atlas/REVIEW_02.md +392 -0
  33. package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts +73 -0
  34. package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts.map +1 -0
  35. package/src/core/geom/3d/atlas/atlas_bench_lib.js +315 -0
  36. package/src/core/geom/3d/atlas/atlas_chart_type.d.ts +17 -0
  37. package/src/core/geom/3d/atlas/atlas_chart_type.d.ts.map +1 -0
  38. package/src/core/geom/3d/atlas/atlas_chart_type.js +16 -0
  39. package/src/core/geom/3d/atlas/atlas_compute_charts.d.ts +25 -0
  40. package/src/core/geom/3d/atlas/atlas_compute_charts.d.ts.map +1 -0
  41. package/src/core/geom/3d/atlas/atlas_compute_charts.js +188 -0
  42. package/src/core/geom/3d/atlas/atlas_extract_chart.d.ts +17 -0
  43. package/src/core/geom/3d/atlas/atlas_extract_chart.d.ts.map +1 -0
  44. package/src/core/geom/3d/atlas/atlas_extract_chart.js +107 -0
  45. package/src/core/geom/3d/atlas/atlas_generate.d.ts +39 -0
  46. package/src/core/geom/3d/atlas/atlas_generate.d.ts.map +1 -0
  47. package/src/core/geom/3d/atlas/atlas_generate.js +43 -0
  48. package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts +84 -0
  49. package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts.map +1 -0
  50. package/src/core/geom/3d/atlas/atlas_test_fixtures.js +266 -0
  51. package/src/core/geom/3d/atlas/atlas_write_chart_uvs.d.ts +25 -0
  52. package/src/core/geom/3d/atlas/atlas_write_chart_uvs.d.ts.map +1 -0
  53. package/src/core/geom/3d/atlas/atlas_write_chart_uvs.js +36 -0
  54. package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.d.ts +22 -0
  55. package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.d.ts.map +1 -0
  56. package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.js +62 -0
  57. package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.d.ts +9 -0
  58. package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.d.ts.map +1 -0
  59. package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.js +33 -0
  60. package/src/core/geom/3d/atlas/data/atlas_build_face_areas.d.ts +9 -0
  61. package/src/core/geom/3d/atlas/data/atlas_build_face_areas.d.ts.map +1 -0
  62. package/src/core/geom/3d/atlas/data/atlas_build_face_areas.js +50 -0
  63. package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.d.ts +27 -0
  64. package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.d.ts.map +1 -0
  65. package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.js +39 -0
  66. package/src/core/geom/3d/atlas/io/bt_loop_uv.d.ts +22 -0
  67. package/src/core/geom/3d/atlas/io/bt_loop_uv.d.ts.map +1 -0
  68. package/src/core/geom/3d/atlas/io/bt_loop_uv.js +57 -0
  69. package/src/core/geom/3d/atlas/pack/ChartPlacement.d.ts +36 -0
  70. package/src/core/geom/3d/atlas/pack/ChartPlacement.d.ts.map +1 -0
  71. package/src/core/geom/3d/atlas/pack/ChartPlacement.js +46 -0
  72. package/src/core/geom/3d/atlas/pack/atlas_pack_charts.d.ts +62 -0
  73. package/src/core/geom/3d/atlas/pack/atlas_pack_charts.d.ts.map +1 -0
  74. package/src/core/geom/3d/atlas/pack/atlas_pack_charts.js +551 -0
  75. package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.d.ts +22 -0
  76. package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.d.ts.map +1 -0
  77. package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.js +73 -0
  78. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.d.ts +37 -0
  79. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.d.ts.map +1 -0
  80. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.js +270 -0
  81. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.d.ts +23 -0
  82. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.d.ts.map +1 -0
  83. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.js +224 -0
  84. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.d.ts +14 -0
  85. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.d.ts.map +1 -0
  86. package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.js +38 -0
  87. package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.d.ts +22 -0
  88. package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.d.ts.map +1 -0
  89. package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.js +86 -0
  90. package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.d.ts +20 -0
  91. package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.d.ts.map +1 -0
  92. package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.js +183 -0
  93. package/src/core/geom/3d/atlas/param/fit_plane_basis.d.ts +27 -0
  94. package/src/core/geom/3d/atlas/param/fit_plane_basis.d.ts.map +1 -0
  95. package/src/core/geom/3d/atlas/param/fit_plane_basis.js +66 -0
  96. package/src/core/geom/3d/atlas/segment/RegionGraph.d.ts +31 -0
  97. package/src/core/geom/3d/atlas/segment/RegionGraph.d.ts.map +1 -0
  98. package/src/core/geom/3d/atlas/segment/RegionGraph.js +40 -0
  99. package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.d.ts +23 -0
  100. package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.d.ts.map +1 -0
  101. package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.js +136 -0
  102. package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.d.ts +24 -0
  103. package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.d.ts.map +1 -0
  104. package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.js +77 -0
  105. package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts +27 -0
  106. package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts.map +1 -0
  107. package/src/core/geom/3d/atlas/segment/atlas_merge_charts.js +113 -0
  108. package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts +44 -0
  109. package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts.map +1 -0
  110. package/src/core/geom/3d/atlas/segment/atlas_segment_charts.js +275 -0
  111. package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts +22 -0
  112. package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts.map +1 -0
  113. package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.js +199 -0
  114. package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.d.ts +32 -0
  115. package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.d.ts.map +1 -0
  116. package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.js +64 -0
  117. package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.d.ts +20 -0
  118. package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.d.ts.map +1 -0
  119. package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.js +66 -0
  120. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts.map +1 -1
  121. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +13 -11
  122. package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.d.ts.map +1 -1
  123. package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.js +4 -3
  124. package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.d.ts.map +1 -1
  125. package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.js +4 -3
  126. package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.d.ts.map +1 -1
  127. package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.js +4 -3
  128. package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.d.ts.map +1 -1
  129. package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.js +10 -6
  130. package/src/core/geom/3d/topology/struct/TopoMesh.js +2 -2
  131. package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts +0 -2
  132. package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts.map +1 -1
  133. package/src/core/geom/3d/topology/struct/TopoTriangle.js +2 -2
  134. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.d.ts.map +1 -1
  135. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.js +8 -27
  136. package/src/core/geom/vec3/v3_cotangent.d.ts +20 -0
  137. package/src/core/geom/vec3/v3_cotangent.d.ts.map +1 -0
  138. package/src/core/geom/vec3/v3_cotangent.js +29 -0
  139. package/src/core/geom/vec3/v3_matrix3_multiply.d.ts +19 -0
  140. package/src/core/geom/vec3/v3_matrix3_multiply.d.ts.map +1 -0
  141. package/src/core/geom/vec3/v3_matrix3_multiply.js +30 -0
  142. package/src/core/geom/vec3/v3_multiply.d.ts +16 -0
  143. package/src/core/geom/vec3/v3_multiply.d.ts.map +1 -0
  144. package/src/core/geom/vec3/v3_multiply.js +19 -0
  145. package/src/core/math/linalg/cg/cg_solve.d.ts +24 -0
  146. package/src/core/math/linalg/cg/cg_solve.d.ts.map +1 -0
  147. package/src/core/math/linalg/cg/cg_solve.js +106 -0
  148. package/src/core/math/linalg/cg/cg_solve_normal_equations.d.ts +21 -0
  149. package/src/core/math/linalg/cg/cg_solve_normal_equations.d.ts.map +1 -0
  150. package/src/core/math/linalg/cg/cg_solve_normal_equations.js +59 -0
  151. package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts +19 -0
  152. package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts.map +1 -0
  153. package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.js +117 -0
  154. package/src/core/math/linalg/sparse/SparseMatrixCSR.d.ts +50 -0
  155. package/src/core/math/linalg/sparse/SparseMatrixCSR.d.ts.map +1 -0
  156. package/src/core/math/linalg/sparse/SparseMatrixCSR.js +88 -0
  157. package/src/core/math/linalg/sparse/spm_matvec.d.ts +9 -0
  158. package/src/core/math/linalg/sparse/spm_matvec.d.ts.map +1 -0
  159. package/src/core/math/linalg/sparse/spm_matvec.js +22 -0
  160. package/src/core/math/linalg/sparse/spm_matvec_transpose.d.ts +12 -0
  161. package/src/core/math/linalg/sparse/spm_matvec_transpose.d.ts.map +1 -0
  162. package/src/core/math/linalg/sparse/spm_matvec_transpose.js +29 -0
  163. package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.d.ts +39 -0
  164. package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.js +22 -1
  165. package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.d.ts.map +1 -1
  166. package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.js +32 -9
  167. package/src/core/math/physics/mie/compute_mie_phase.d.ts +2 -3
  168. package/src/core/math/physics/mie/compute_mie_phase.d.ts.map +1 -1
  169. package/src/core/math/physics/mie/compute_mie_phase.js +1 -3
  170. package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts +0 -1
  171. package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts.map +1 -1
  172. package/src/core/math/physics/mie/lorenz_mie_coefs.js +0 -7
  173. package/src/engine/REVIEW_2026_07_03.md +211 -0
  174. package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts.map +1 -1
  175. package/src/engine/animation/curve/actionProcessorOperations/curveActions.js +3 -2
  176. package/src/engine/animation/curve/compression/sample_animation_curve_to_float_array.js +1 -1
  177. package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts.map +1 -1
  178. package/src/engine/animation/keyed2/AnimationTrackPlayback.js +3 -1
  179. package/src/engine/asset/loaders/image/png/filter/png_filter_unFilterNone.js +2 -2
  180. package/src/engine/asset/preloader/AssetPreloader.d.ts.map +1 -1
  181. package/src/engine/asset/preloader/AssetPreloader.js +6 -0
  182. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -1
  183. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +5 -2
  184. package/src/engine/ecs/Entity.js +1 -1
  185. package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
  186. package/src/engine/ecs/EntityComponentDataset.js +1 -0
  187. package/src/engine/ecs/EntityManager.js +1 -1
  188. package/src/engine/ecs/EntityObserver.js +1 -1
  189. package/src/engine/ecs/animation/AnimationClip.js +1 -1
  190. package/src/engine/ecs/attachment/AttachmentSystem.js +2 -2
  191. package/src/engine/ecs/attachment/TransformAttachmentBinding.d.ts.map +1 -1
  192. package/src/engine/ecs/attachment/TransformAttachmentBinding.js +14 -3
  193. package/src/engine/ecs/fow/FogOfWar.js +2 -2
  194. package/src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.d.ts.map +1 -1
  195. package/src/engine/ecs/fow/shader/screenSpaceFogOfWarShader.js +8 -0
  196. package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +3 -3
  197. package/src/engine/ecs/gui/position/ViewportPosition.d.ts +3 -1
  198. package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
  199. package/src/engine/ecs/gui/position/ViewportPosition.js +4 -1
  200. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts +10 -0
  201. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts.map +1 -1
  202. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +43 -0
  203. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts +93 -0
  204. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts.map +1 -0
  205. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.js +315 -0
  206. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.d.ts +48 -0
  207. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.d.ts.map +1 -0
  208. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectSerializer.js +331 -0
  209. package/src/engine/ecs/storage/binary/object-v2/DESIGN.md +199 -0
  210. package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.d.ts +53 -0
  211. package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.d.ts.map +1 -0
  212. package/src/engine/ecs/storage/binary/object-v2/ObjectBinaryFormat.js +57 -0
  213. package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.d.ts +53 -0
  214. package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.d.ts.map +1 -0
  215. package/src/engine/ecs/storage/binary/object-v2/ObjectSerializationAdapter.js +56 -0
  216. package/src/engine/ecs/storage/binary/object-v2/README.md +110 -0
  217. package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.d.ts +13 -0
  218. package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.d.ts.map +1 -0
  219. package/src/engine/ecs/storage/binary/object-v2/objectStringCodec.js +48 -0
  220. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts +29 -0
  221. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts.map +1 -0
  222. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.js +44 -0
  223. package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
  224. package/src/engine/ecs/terrain/ecs/Terrain.js +4 -3
  225. package/src/engine/ecs/terrain/tiles/TerrainTile.js +2 -2
  226. package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
  227. package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +9 -8
  228. package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
  229. package/src/engine/graphics/GraphicsEngine.js +2 -1
  230. package/src/engine/graphics/camera/makeScreenScissorFrustum.d.ts.map +1 -1
  231. package/src/engine/graphics/camera/makeScreenScissorFrustum.js +11 -10
  232. package/src/engine/graphics/canvas/canvas2d_draw_linear_scale.d.ts.map +1 -1
  233. package/src/engine/graphics/canvas/canvas2d_draw_linear_scale.js +3 -1
  234. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.d.ts +1 -1
  235. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.d.ts.map +1 -1
  236. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/readAnimationGraphDefinitionFromJSON.js +2 -2
  237. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.d.ts.map +1 -1
  238. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/writeAnimationGraphDefinitionToJSON.js +2 -0
  239. package/src/engine/graphics/ecs/camera/Camera.d.ts.map +1 -1
  240. package/src/engine/graphics/ecs/camera/Camera.js +4 -0
  241. package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.d.ts.map +1 -1
  242. package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.js +7 -2
  243. package/src/engine/graphics/ecs/camera/set_camera_aspect_ratio.js +1 -1
  244. package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +2 -2
  245. package/src/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +2 -2
  246. package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.d.ts.map +1 -1
  247. package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.js +4 -1
  248. package/src/engine/graphics/ecs/light/binding/LightBinding.js +2 -2
  249. package/src/engine/graphics/ecs/mesh/MeshSystem.js +1 -1
  250. package/src/engine/graphics/ecs/mesh/SkeletonUtils.js +1 -1
  251. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +2 -2
  252. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
  253. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +0 -1
  254. package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.js +1 -1
  255. package/src/engine/graphics/ecs/path/tube/build/computeFrenetFrames.d.ts.map +1 -1
  256. package/src/engine/graphics/ecs/path/tube/build/computeFrenetFrames.js +8 -7
  257. package/src/engine/graphics/ecs/water/WaterSystem.d.ts +6 -0
  258. package/src/engine/graphics/ecs/water/WaterSystem.d.ts.map +1 -1
  259. package/src/engine/graphics/ecs/water/WaterSystem.js +12 -1
  260. package/src/engine/graphics/geometry/MikkT/AvgTSpace.d.ts.map +1 -1
  261. package/src/engine/graphics/geometry/MikkT/AvgTSpace.js +11 -6
  262. package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.d.ts.map +1 -1
  263. package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.js +2 -3
  264. package/src/engine/graphics/geometry/MikkT/CalcTexArea.d.ts.map +1 -1
  265. package/src/engine/graphics/geometry/MikkT/CalcTexArea.js +3 -4
  266. package/src/engine/graphics/geometry/MikkT/DegenEpilogue.js +4 -4
  267. package/src/engine/graphics/geometry/MikkT/EvalTspace.d.ts.map +1 -1
  268. package/src/engine/graphics/geometry/MikkT/EvalTspace.js +11 -8
  269. package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.d.ts.map +1 -1
  270. package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.js +7 -8
  271. package/src/engine/graphics/geometry/MikkT/GenerateTSpaces.js +8 -8
  272. package/src/engine/graphics/geometry/MikkT/InitTriInfo.d.ts.map +1 -1
  273. package/src/engine/graphics/geometry/MikkT/InitTriInfo.js +30 -25
  274. package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +7 -7
  275. package/src/engine/graphics/geometry/MikkT/NormalizeSafe.d.ts +0 -1
  276. package/src/engine/graphics/geometry/MikkT/NormalizeSafe.d.ts.map +1 -1
  277. package/src/engine/graphics/geometry/MikkT/NormalizeSafe.js +6 -4
  278. package/src/engine/graphics/geometry/MikkT/STSpace.d.ts +0 -2
  279. package/src/engine/graphics/geometry/MikkT/STSpace.d.ts.map +1 -1
  280. package/src/engine/graphics/geometry/MikkT/STSpace.js +3 -3
  281. package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.d.ts +0 -2
  282. package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.d.ts.map +1 -1
  283. package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.js +0 -1
  284. package/src/engine/graphics/geometry/buffered/ensureGeometryBoundingSphere.js +1 -1
  285. package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.d.ts.map +1 -1
  286. package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.js +0 -15
  287. package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.js +10 -10
  288. package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js +1 -1
  289. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts +0 -2
  290. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts.map +1 -1
  291. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +4 -3
  292. package/src/engine/graphics/impostors/octahedral/grid/HemiOctahedralUvEncoder.js +2 -2
  293. package/src/engine/graphics/impostors/octahedral/grid/UvEncoder.d.ts +17 -7
  294. package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.js +2 -2
  295. package/src/engine/graphics/material/SplatMaterial.js +1 -1
  296. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
  297. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +3 -2
  298. package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.js +1 -1
  299. package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.js +3 -3
  300. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +4 -3
  301. package/src/engine/graphics/particles/particular/group/ParticleGroup.d.ts.map +1 -1
  302. package/src/engine/graphics/particles/particular/group/ParticleGroup.js +3 -2
  303. package/src/engine/graphics/render/forward_plus/LightManager.js +2 -2
  304. package/src/engine/graphics/render/forward_plus/model/Decal.d.ts +0 -2
  305. package/src/engine/graphics/render/forward_plus/model/Decal.d.ts.map +1 -1
  306. package/src/engine/graphics/render/forward_plus/model/Decal.js +3 -3
  307. package/src/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.js +1 -1
  308. package/src/engine/graphics/render/forward_plus/prototype/prototypeLightManager.js +4 -3
  309. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +6 -4
  310. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts +1 -8
  311. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts.map +1 -1
  312. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.js +2 -14
  313. package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.d.ts +9 -0
  314. package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.d.ts.map +1 -0
  315. package/src/engine/graphics/sh3/gi/material/ProbeResolutionStage.js +14 -0
  316. package/src/engine/graphics/sh3/lightmap/ARTIFACTS_PLAN.md +146 -0
  317. package/src/engine/graphics/sh3/lightmap/CODE_REVIEW.md +121 -0
  318. package/src/engine/graphics/sh3/lightmap/LIGHTMAPPER_REVIEW.md +183 -0
  319. package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts +90 -0
  320. package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts.map +1 -0
  321. package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.js +681 -0
  322. package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.d.ts +32 -0
  323. package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.d.ts.map +1 -0
  324. package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.js +155 -0
  325. package/src/engine/graphics/sh3/lightmap/lightmap_denoise.d.ts +49 -0
  326. package/src/engine/graphics/sh3/lightmap/lightmap_denoise.d.ts.map +1 -0
  327. package/src/engine/graphics/sh3/lightmap/lightmap_denoise.js +136 -0
  328. package/src/engine/graphics/sh3/lightmap/lightmap_dilate.d.ts +19 -0
  329. package/src/engine/graphics/sh3/lightmap/lightmap_dilate.d.ts.map +1 -0
  330. package/src/engine/graphics/sh3/lightmap/lightmap_dilate.js +89 -0
  331. package/src/engine/graphics/sh3/lightmap/lightmap_gather.d.ts +54 -0
  332. package/src/engine/graphics/sh3/lightmap/lightmap_gather.d.ts.map +1 -0
  333. package/src/engine/graphics/sh3/lightmap/lightmap_gather.js +168 -0
  334. package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.d.ts +30 -0
  335. package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.d.ts.map +1 -0
  336. package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.js +145 -0
  337. package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.d.ts +38 -0
  338. package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.d.ts.map +1 -0
  339. package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.js +152 -0
  340. package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.d.ts +2 -0
  341. package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.d.ts.map +1 -0
  342. package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.js +186 -0
  343. package/src/engine/graphics/sh3/lpg/LightProbeGrid.d.ts +69 -0
  344. package/src/engine/graphics/sh3/lpg/LightProbeGrid.d.ts.map +1 -0
  345. package/src/engine/graphics/sh3/lpg/LightProbeGrid.js +173 -0
  346. package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.d.ts +24 -0
  347. package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.d.ts.map +1 -0
  348. package/src/engine/graphics/sh3/lpg/LightProbeGridBaker.js +88 -0
  349. package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.d.ts +20 -0
  350. package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.d.ts.map +1 -0
  351. package/src/engine/graphics/sh3/lpg/build_light_probe_grid_for_scene.js +79 -0
  352. package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.d.ts +11 -0
  353. package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.d.ts.map +1 -0
  354. package/src/engine/graphics/sh3/lpg/light_probe_grid_obtain_storage_cached.js +84 -0
  355. package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.d.ts +29 -0
  356. package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.d.ts.map +1 -0
  357. package/src/engine/graphics/sh3/lpg/light_probe_grid_textures.js +160 -0
  358. package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.d.ts +23 -0
  359. package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.d.ts.map +1 -0
  360. package/src/engine/graphics/sh3/lpg/material/LightProbeGridMaterialTransformer.js +228 -0
  361. package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.d.ts +2 -0
  362. package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.d.ts.map +1 -0
  363. package/src/engine/graphics/sh3/lpg/material/chunk_lpg_get_irradiance_at.js +24 -0
  364. package/src/engine/graphics/sh3/lpg/material/common.d.ts +3 -0
  365. package/src/engine/graphics/sh3/lpg/material/common.d.ts.map +1 -0
  366. package/src/engine/graphics/sh3/lpg/material/common.js +73 -0
  367. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.d.ts +6 -0
  368. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.d.ts.map +1 -0
  369. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_fragment_shader.js +42 -0
  370. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.d.ts +6 -0
  371. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.d.ts.map +1 -0
  372. package/src/engine/graphics/sh3/lpg/material/space_fragment/build_vertex_shader.js +49 -0
  373. package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts +9 -0
  374. package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.d.ts.map +1 -0
  375. package/src/engine/graphics/sh3/lpg/material/space_fragment/space_fragment_transform_shader.js +12 -0
  376. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.d.ts +6 -0
  377. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.d.ts.map +1 -0
  378. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_fragment_shader.js +30 -0
  379. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.d.ts +6 -0
  380. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.d.ts.map +1 -0
  381. package/src/engine/graphics/sh3/lpg/material/space_vertex/build_vertex_shader.js +41 -0
  382. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.d.ts +3 -0
  383. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.d.ts.map +1 -0
  384. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.frag.js +15 -0
  385. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.d.ts +3 -0
  386. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.d.ts.map +1 -0
  387. package/src/engine/graphics/sh3/lpg/material/space_vertex/preamble.vert.js +9 -0
  388. package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts +9 -0
  389. package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.d.ts.map +1 -0
  390. package/src/engine/graphics/sh3/lpg/material/space_vertex/space_vertex_transform_shader.js +12 -0
  391. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts +20 -0
  392. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts.map +1 -0
  393. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.js +59 -0
  394. package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts.map +1 -1
  395. package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.js +2 -2
  396. package/src/engine/graphics/sh3/path_tracer/PathTracer.js +2 -2
  397. package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.d.ts.map +1 -1
  398. package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js +8 -0
  399. package/src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.d.ts.map +1 -1
  400. package/src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.js +6 -4
  401. package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +3 -3
  402. package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts.map +1 -1
  403. package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +5 -4
  404. package/src/engine/graphics/sh3/prototypeLightProbeGrid.d.ts +2 -0
  405. package/src/engine/graphics/sh3/prototypeLightProbeGrid.d.ts.map +1 -0
  406. package/src/engine/graphics/sh3/prototypeLightProbeGrid.js +170 -0
  407. package/src/engine/graphics/sh3/sky/hosek/prototype_hosek.js +2 -2
  408. package/src/engine/graphics/texture/atlas/AtlasLookupTexture.js +1 -1
  409. package/src/engine/graphics/texture/atlas/CachingTextureAtlas.js +1 -1
  410. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.js +1 -1
  411. package/src/engine/graphics/texture/sampler/sampler2d_copy_with_margins.js +3 -3
  412. package/src/engine/graphics/util/build_max_height_pyramid.d.ts.map +1 -1
  413. package/src/engine/graphics/util/build_max_height_pyramid.js +5 -2
  414. package/src/engine/grid/transform2grid/Transform2GridPositionSystem.js +1 -1
  415. package/src/engine/input/devices/KeyboardDevice.d.ts +61 -14
  416. package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
  417. package/src/engine/input/devices/KeyboardDevice.js +41 -15
  418. package/src/engine/input/devices/isHTMLElementFocusable.d.ts.map +1 -1
  419. package/src/engine/input/devices/isHTMLElementFocusable.js +2 -9
  420. package/src/engine/input/ecs/components/InputBinding.d.ts +7 -1
  421. package/src/engine/input/ecs/components/InputBinding.d.ts.map +1 -1
  422. package/src/engine/input/ecs/components/InputBinding.js +8 -1
  423. package/src/engine/input/ecs/systems/InputControllerSystem.js +1 -1
  424. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts +2 -1
  425. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts.map +1 -1
  426. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js +6 -2
  427. package/src/engine/intelligence/behavior/selector/WeightedElement.js +1 -1
  428. package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts.map +1 -1
  429. package/src/engine/knowledge/database/StaticKnowledgeDatabase.js +2 -4
  430. package/src/engine/logging/elastic/ElasticSearchLogger.d.ts +1 -2
  431. package/src/engine/logging/elastic/ElasticSearchLogger.d.ts.map +1 -1
  432. package/src/engine/logging/elastic/ElasticSearchLogger.js +14 -10
  433. package/src/engine/navigation/ecs/path_following/PathFollower.js +1 -1
  434. package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
  435. package/src/engine/navigation/grid/find_path_on_grid_astar.js +5 -2
  436. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +1 -1
  437. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
  438. package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +17 -0
  439. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  440. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
  441. package/src/engine/scene/SceneManager.d.ts.map +1 -1
  442. package/src/engine/scene/SceneManager.js +4 -2
  443. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  444. package/src/engine/simulation/Ticker.js +9 -0
  445. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts.map +1 -1
  446. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +6 -1
  447. package/src/engine/sound/material/concrete/json/serializeSoundMaterialToJSON.js +1 -1
  448. package/src/engine/sound/simulation/prototypeAcousticSolver.js +261 -143
  449. package/src/generation/theme/ThemeEngine.d.ts +9 -0
  450. package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
  451. package/src/generation/theme/ThemeEngine.js +37 -2
@@ -0,0 +1,170 @@
1
+ import { GUI } from "dat.gui";
2
+ import '../../../../../../../css/game.scss';
3
+ import { Color } from "../../../core/color/Color.js";
4
+ import { kelvin_to_rgb } from "../../../core/color/kelvin/kelvin_to_rgb.js";
5
+ import { AABB3 } from "../../../core/geom/3d/aabb/AABB3.js";
6
+ import Vector3 from "../../../core/geom/Vector3.js";
7
+ import { max2 } from "../../../core/math/max2.js";
8
+ import { min2 } from "../../../core/math/min2.js";
9
+ import { RAD_TO_DEG } from "../../../core/math/RAD_TO_DEG.js";
10
+ import { v3_length } from "../../../core/geom/vec3/v3_length.js";
11
+ import { GLTFAssetLoader } from "../../asset/loaders/GLTFAssetLoader.js";
12
+ import GUIElementSystem from "../../ecs/gui/GUIElementSystem.js";
13
+ import ViewportPositionSystem from "../../ecs/gui/position/ViewportPositionSystem.js";
14
+ import { TransformAttachmentSystem } from "../../ecs/transform-attachment/TransformAttachmentSystem.js";
15
+ import { EngineHarness } from "../../EngineHarness.js";
16
+ import { Camera } from "../ecs/camera/Camera.js";
17
+ import { focal_length_to_fov } from "../ecs/camera/focal_length_to_fov.js";
18
+ import TopDownCameraController from "../ecs/camera/topdown/TopDownCameraController.js";
19
+ import LightSystem from "../ecs/light/LightSystem.js";
20
+ import { SGMeshSystem } from "../ecs/mesh-v2/aggregate/SGMeshSystem.js";
21
+ import { ShadedGeometry } from "../ecs/mesh-v2/ShadedGeometry.js";
22
+ import { ShadedGeometryFlags } from "../ecs/mesh-v2/ShadedGeometryFlags.js";
23
+ import { ShadedGeometrySystem } from "../ecs/mesh-v2/ShadedGeometrySystem.js";
24
+ import { three_object_to_entity_composition } from "../ecs/mesh-v2/three_object_to_entity_composition.js";
25
+ import { GizmoRenderingPlugin } from "../render/gizmo/GizmoRenderingPlugin.js";
26
+ import { ProbeResolutionStage } from "./gi/material/ProbeResolutionStage.js";
27
+ import { light_probe_grid_bake_via_task } from "./lpg/build_light_probe_grid_for_scene.js";
28
+ import { LightProbeGrid } from "./lpg/LightProbeGrid.js";
29
+ import { light_probe_grid_obtain_storage_cached } from "./lpg/light_probe_grid_obtain_storage_cached.js";
30
+ import { LightProbeGridMaterialTransformer } from "./lpg/material/LightProbeGridMaterialTransformer.js";
31
+
32
+ /**
33
+ *
34
+ * @param {Engine} engine
35
+ * @return {Promise<void>}
36
+ */
37
+ async function main(engine) {
38
+ const grid = new LightProbeGrid();
39
+
40
+ const transformer = new LightProbeGridMaterialTransformer({
41
+ grid,
42
+ stage: ProbeResolutionStage.Fragment
43
+ });
44
+
45
+ engine.graphics.getMaterialManager().addCompileStep(transformer);
46
+
47
+ await EngineHarness.buildBasics({
48
+ engine,
49
+ showFps: false,
50
+ enableWater: false,
51
+ enableTerrain: false,
52
+ enableLights: false,
53
+ cameraFarDistance: 200,
54
+ cameraController: false,
55
+ focus: { x: 0, y: 0, z: 0 },
56
+ pitch: 1,
57
+ yaw: -1.54,
58
+ distance: 54,
59
+ cameraFieldOfView: focal_length_to_fov(50, 25) * RAD_TO_DEG
60
+ });
61
+
62
+ const sun_color = new Color();
63
+
64
+ kelvin_to_rgb(sun_color, 0, 5000);
65
+
66
+ await EngineHarness.buildLights({
67
+ engine,
68
+ shadowmapResolution: 4096,
69
+ ambientIntensity: 0.0,
70
+ sun: sun_color,
71
+ sunIntensity: 3,
72
+ sunDirection: new Vector3(1.2, -1, 0.2)
73
+ })
74
+
75
+ engine.graphics.getRenderer().setClearColor('#1e3441', 1);
76
+
77
+ const ecd = engine.entityManager.dataset;
78
+
79
+ const path = 'data/models/pica_pica/pica_pica.gltf';
80
+
81
+ const mesh_asset = await engine.assetManager.promise(path, 'model/gltf+json');
82
+ const gltf = mesh_asset.gltf;
83
+
84
+ const composition = three_object_to_entity_composition(gltf.scene);
85
+
86
+ composition.traverse(n => {
87
+
88
+ /**
89
+ * @type {ShadedGeometry}
90
+ */
91
+ const sg = n.entity.getComponent(ShadedGeometry);
92
+
93
+ if (sg === null) {
94
+ return;
95
+ }
96
+
97
+ sg.writeFlag(ShadedGeometryFlags.CastShadow | ShadedGeometryFlags.ReceiveShadow, true);
98
+
99
+ const material = sg.material;
100
+ if (material !== null) {
101
+ material.depthTest = true;
102
+ material.depthWrite = true;
103
+ }
104
+ });
105
+
106
+ composition.build(ecd);
107
+
108
+ /**
109
+ * @type {AABB3}
110
+ */
111
+ const mesh_bounds = mesh_asset.boundingBox;
112
+
113
+ const model_footprint = v3_length(mesh_bounds.getExtentsX(), mesh_bounds.getExtentsY(), mesh_bounds.getExtentsZ());
114
+
115
+ const camera = ecd.getAnyComponent(Camera);
116
+ camera.component.clip_far = max2(100, model_footprint * 3);
117
+ const camera_controller = ecd.getComponent(camera.entity, TopDownCameraController);
118
+ camera_controller.distanceMax = model_footprint * 2;
119
+ camera_controller.distanceMin = min2(camera_controller.distanceMin, model_footprint * 0.01);
120
+ mesh_bounds.getCenter(camera_controller.target)
121
+
122
+ const spacing = model_footprint * 0.1;
123
+
124
+ console.time('getGrid');
125
+ await light_probe_grid_obtain_storage_cached({ engine, path, grid, spacing });
126
+ console.timeEnd('getGrid');
127
+
128
+ console.log('LPG:', grid);
129
+
130
+ transformer.update();
131
+
132
+ const gui = new GUI();
133
+ gui.add(transformer, 'intensity').min(0).max(10);
134
+
135
+ gui.add({
136
+ async bake() {
137
+ const grid_bounds = new AABB3(0, 0, 0, 1, 1, 1);
138
+ grid_bounds.copy(mesh_bounds);
139
+ grid_bounds.grow(spacing * 1.05);
140
+
141
+ grid.build(
142
+ grid_bounds,
143
+ max2(2, Math.ceil(grid_bounds.getExtentsX() / spacing) + 1),
144
+ max2(2, Math.ceil(grid_bounds.getExtentsY() / spacing) + 1),
145
+ max2(2, Math.ceil(grid_bounds.getExtentsZ() / spacing) + 1)
146
+ );
147
+
148
+ await light_probe_grid_bake_via_task(grid, ecd, engine);
149
+
150
+ transformer.update();
151
+ }
152
+ }, "bake").name("Bake");
153
+ }
154
+
155
+ new EngineHarness().initialize({
156
+ configuration(config, engine) {
157
+ config.addSystem(new ShadedGeometrySystem(engine));
158
+ config.addSystem(new LightSystem(engine, {
159
+ shadowResolution: 8192
160
+ }));
161
+ config.addSystem(new SGMeshSystem(engine));
162
+ config.addSystem(new TransformAttachmentSystem());
163
+ config.addSystem(new GUIElementSystem(engine.gui.view, engine));
164
+ config.addSystem(new ViewportPositionSystem(engine.gui.view.size));
165
+
166
+ config.addLoader('model/gltf+json', new GLTFAssetLoader());
167
+
168
+ config.addPlugin(GizmoRenderingPlugin);
169
+ }
170
+ }).then(main);
@@ -1,4 +1,4 @@
1
- import { vec3 } from "gl-matrix";
1
+ import { v3_normalize_array } from "../../../../../core/geom/vec3/v3_normalize_array.js";
2
2
  import { CanvasView } from "../../../../../view/elements/CanvasView.js";
3
3
  import { Sampler2D } from "../../../texture/sampler/Sampler2D.js";
4
4
  import sampler2D2Canvas from "../../../texture/sampler/sampler2d_to_html_canvas.js";
@@ -52,7 +52,7 @@ for (let i = 0; i < sampler.width; i++) {
52
52
 
53
53
  const direction = [v_x, v_z, v_y];
54
54
 
55
- vec3.normalize(direction, direction);
55
+ v3_normalize_array(direction, 0, direction, 0);
56
56
 
57
57
  sky(color, 0, direction, 0);
58
58
 
@@ -77,7 +77,7 @@ export class AtlasLookupTexture {
77
77
  data[address] = position.x;
78
78
  data[address + 1] = position.y;
79
79
 
80
- data[address + 2] = size.y;
80
+ data[address + 2] = size.x;
81
81
  data[address + 3] = size.y;
82
82
  }
83
83
 
@@ -150,7 +150,7 @@ export class CachingTextureAtlas extends AbstractTextureAtlas {
150
150
  * @private
151
151
  */
152
152
  __evict_all() {
153
- for (let i = this.__cached_patches.length - 1; i > 0; i--) {
153
+ for (let i = this.__cached_patches.length - 1; i >= 0; i--) {
154
154
  this.__evict(i);
155
155
  }
156
156
  }
@@ -90,7 +90,7 @@ export function sampler2d_scale_down_lanczos(source, destination, lobes = 2) {
90
90
  const ratio_x = source_width / d_w;
91
91
  const ratio_y = source_height / d_h;
92
92
 
93
- const rcp_ratio_y = 2 / ratio_x;
93
+ const rcp_ratio_y = 2 / ratio_y;
94
94
  const rcp_ratio_x = 2 / ratio_x;
95
95
 
96
96
 
@@ -121,7 +121,7 @@ export function sampler2d_copy_with_margins(
121
121
 
122
122
  //Write Bottom-left margin
123
123
  sOffset = (sourceY + height - 1) * sRowSize + sourceX * dItemSize;
124
- for (y = destinationY + width, yMax = Math.min(destination.height, y + marginBottom); y < yMax; y++) {
124
+ for (y = destinationY + height, yMax = Math.min(destination.height, y + marginBottom); y < yMax; y++) {
125
125
  dA = y * dRowSize;
126
126
 
127
127
  for (x = Math.max(0, destinationX - marginLeft), xMax = destinationX; x < xMax; x++) {
@@ -135,7 +135,7 @@ export function sampler2d_copy_with_margins(
135
135
  }
136
136
  //Write Bottom margin
137
137
  sA = (sourceY + height - 1) * sRowSize;
138
- for (y = destinationY + width, yMax = Math.min(destination.height, y + marginBottom); y < yMax; y++) {
138
+ for (y = destinationY + height, yMax = Math.min(destination.height, y + marginBottom); y < yMax; y++) {
139
139
  dA = y * dRowSize;
140
140
 
141
141
  for (x = 0; x < width; x++) {
@@ -149,7 +149,7 @@ export function sampler2d_copy_with_margins(
149
149
  }
150
150
  //Write Bottom-right margin
151
151
  sOffset = (sourceY + height - 1) * sRowSize + (sourceX + width - 1) * dItemSize;
152
- for (y = destinationY + width, yMax = Math.min(destination.height, y + marginBottom); y < yMax; y++) {
152
+ for (y = destinationY + height, yMax = Math.min(destination.height, y + marginBottom); y < yMax; y++) {
153
153
  dA = y * dRowSize;
154
154
 
155
155
  for (x = destinationX + width, xMax = Math.min(destination.width, x + marginRight); x < xMax; x++) {
@@ -1 +1 @@
1
- {"version":3,"file":"build_max_height_pyramid.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/util/build_max_height_pyramid.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,8DAFa,kBAAkB,CA2G9B;mCAxI4F,OAAO"}
1
+ {"version":3,"file":"build_max_height_pyramid.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/util/build_max_height_pyramid.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,8DAFa,kBAAkB,CA8G9B;mCA3I4F,OAAO"}
@@ -44,8 +44,11 @@ export function build_max_height_pyramid(sampler) {
44
44
  let prevData = sampler.data;
45
45
 
46
46
  while (prevW > 1 || prevH > 1) {
47
- const curW = Math.max(1, prevW >> 1);
48
- const curH = Math.max(1, prevH >> 1);
47
+ // round UP so an odd dimension's last row/column is still folded
48
+ // into a coarse texel (the sx1/sy1 clamps below cover the overhang);
49
+ // a floor here would drop it and make the Hi-Z pyramid under-report.
50
+ const curW = Math.max(1, (prevW + 1) >> 1);
51
+ const curH = Math.max(1, (prevH + 1) >> 1);
49
52
  const curData = new Float32Array(curW * curH);
50
53
 
51
54
  const lastSrcX = prevW - 1;
@@ -53,7 +53,7 @@ class Synchronizer {
53
53
  break;
54
54
 
55
55
  case Transform2GridPositionMode.Ceil:
56
- v2.floor();
56
+ v2.ceil();
57
57
  break;
58
58
 
59
59
  case Transform2GridPositionMode.Round:
@@ -1,14 +1,61 @@
1
- import {InputDeviceSwitch} from "./InputDeviceSwitch";
2
- import Signal from "../../../core/events/signal/Signal";
3
-
4
- export default class KeyboardDevice {
5
- constructor(domElement:EventTarget|Element)
6
-
7
- readonly on: {up:Signal,down:Signal}
8
-
9
- readonly keys:{[key:string]:InputDeviceSwitch}
10
-
11
- start():void
12
-
13
- stop():void
14
- }
1
+ export default KeyboardDevice;
2
+ /**
3
+ * Provides keyboard input.
4
+ * Listens for key events on a DOM element and provides signals and state for key presses.
5
+ * NOTE: if the bound element loses focus within the page (e.g. you hold "A" and click on some other element),
6
+ * the key remains pressed and the eventual physical release is picked up at the window level.
7
+ * NOTE: when the window itself loses focus (e.g. switching to another application), key releases can no longer
8
+ * be observed at all, so any "pressed" keys are forcibly released with the appropriate signal.
9
+ *
10
+ * @author Alex Goldring
11
+ * @copyright Company Named Limited (c) 2026
12
+ */
13
+ declare class KeyboardDevice {
14
+ /**
15
+ * @param {EventTarget|Element} domElement The DOM element to listen for keyboard events on. This element *must* be focusable (e.g., have a `tabindex` attribute).
16
+ * @throws {TypeError} If the provided `domElement` is not focusable and doesn't have a `tabindex` attribute.
17
+ */
18
+ constructor(domElement: EventTarget | Element);
19
+ /**
20
+ * @readonly
21
+ */
22
+ readonly on: {
23
+ /**
24
+ * Fires when any key is pressed
25
+ * @type {Signal<KeyboardEvent>}
26
+ */
27
+ down: Signal<KeyboardEvent>;
28
+ /**
29
+ * Fires when any key is released
30
+ * @type {Signal<KeyboardEvent>}
31
+ */
32
+ up: Signal<KeyboardEvent>;
33
+ };
34
+ /**
35
+ * See {@link KeyCodes} for valid IDs
36
+ * @readonly
37
+ * @type {Object<InputDeviceSwitch>}
38
+ *
39
+ * @example
40
+ * const is_enter_pressed = keyboard.keys.enter.is_down;
41
+ */
42
+ readonly keys: any;
43
+ /**
44
+ * The DOM element being listened to.
45
+ * @type {EventTarget}
46
+ */
47
+ domElement: EventTarget;
48
+ /**
49
+ * Starts listening for keyboard events on the associated DOM element.
50
+ * @returns {void}
51
+ */
52
+ start(): void;
53
+ /**
54
+ * Stops listening for keyboard events.
55
+ * @returns {void}
56
+ */
57
+ stop(): void;
58
+ #private;
59
+ }
60
+ import Signal from "../../../core/events/signal/Signal.js";
61
+ //# sourceMappingURL=KeyboardDevice.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"KeyboardDevice.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/KeyboardDevice.js"],"names":[],"mappings":";AAYA;;;;;;;;GAQG;AACH;IA4BI;;;OAGG;IACH,wBAHW,WAAW,GAAC,OAAO,EAgC7B;IA3DD;;OAEG;IACH;QACI;;;WAGG;cADO,OAAO,aAAa,CAAC;QAG/B;;;WAGG;YADO,OAAO,aAAa,CAAC;MAGjC;IAEF;;;;;;;OAOG;IACH,mBAAU;IAkBN;;;OAGG;IACH,YAFU,WAAW,CAEO;IA8FhC;;;OAGG;IACH,SAFa,IAAI,CAahB;IAED;;;OAGG;IACH,QAFa,IAAI,CAahB;;CAEJ;mBArMkB,uCAAuC"}
1
+ {"version":3,"file":"KeyboardDevice.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/KeyboardDevice.js"],"names":[],"mappings":";AAYA;;;;;;;;;;GAUG;AACH;IA4BI;;;OAGG;IACH,wBAHW,WAAW,GAAC,OAAO,EAgC7B;IA3DD;;OAEG;IACH;QACI;;;WAGG;cADO,OAAO,aAAa,CAAC;QAG/B;;;WAGG;YADO,OAAO,aAAa,CAAC;MAGjC;IAEF;;;;;;;OAOG;IACH,mBAAU;IAkBN;;;OAGG;IACH,YAFU,WAAW,CAEO;IA2HhC;;;OAGG;IACH,SAFa,IAAI,CAWhB;IAED;;;OAGG;IACH,QAFa,IAAI,CAUhB;;CAEJ;mBA/NkB,uCAAuC"}
@@ -13,8 +13,10 @@ const codeToKeyNameMap = [];
13
13
  /**
14
14
  * Provides keyboard input.
15
15
  * Listens for key events on a DOM element and provides signals and state for key presses.
16
- * NOTE: when losing focus of the application, any "pressed" keys will be automatically released.
17
- * For example, if you hold "A" and click over into another application window - A will be forcibly released with appropriate signal.
16
+ * NOTE: if the bound element loses focus within the page (e.g. you hold "A" and click on some other element),
17
+ * the key remains pressed and the eventual physical release is picked up at the window level.
18
+ * NOTE: when the window itself loses focus (e.g. switching to another application), key releases can no longer
19
+ * be observed at all, so any "pressed" keys are forcibly released with the appropriate signal.
18
20
  *
19
21
  * @author Alex Goldring
20
22
  * @copyright Company Named Limited (c) 2026
@@ -60,7 +62,7 @@ class KeyboardDevice {
60
62
  !isHTMLElementFocusable(domElement)
61
63
  && domElement.getAttribute('tabindex') === null
62
64
  ) {
63
- new TypeError('Supplied element is not inherently focusable and does not have tabindex attribute, so it must have a tabindex attribute in order to be able receive keyboard events. Something like tabindex=0 would suffice.');
65
+ throw new TypeError('Supplied element is not inherently focusable and does not have tabindex attribute, so it must have a tabindex attribute in order to be able receive keyboard events. Something like tabindex=0 would suffice.');
64
66
  }
65
67
 
66
68
  /**
@@ -149,12 +151,41 @@ class KeyboardDevice {
149
151
 
150
152
  }
151
153
 
154
+ /**
155
+ * Recovery handler for key releases that happen while the bound element does not have focus.
156
+ * Covers the scenario where a key is pressed on the element, focus is then lost to another
157
+ * element in the page (e.g. via a mouse click), and only then is the physical key released.
158
+ * Registered on window in the bubble phase, so for keys released while the element still has
159
+ * focus the element-scoped handler runs first and this one sees the key as already released.
160
+ *
161
+ * @param {KeyboardEvent} event
162
+ */
163
+ #handlerWindowKeyUp = (event) => {
164
+ const keyName = codeToKeyNameMap[event.keyCode];
165
+
166
+ if (keyName === undefined) {
167
+ return;
168
+ }
169
+
170
+ const button = this.keys[keyName];
171
+
172
+ if (button.is_up) {
173
+ // key is not tracked as pressed; either it was never pressed via this device,
174
+ // or the element-scoped handler has already processed this release
175
+ return;
176
+ }
177
+
178
+ this.on.up.send1(event);
179
+
180
+ button.release();
181
+ }
182
+
152
183
  /**
153
184
  *
154
185
  * @param {FocusEvent} event
155
186
  */
156
- #handleGlobalBlurEvent = (event) => {
157
- // Element lost focus, we won't be able to capture key-up events
187
+ #handleWindowBlurEvent = (event) => {
188
+ // Window lost focus, we won't be able to capture key-up events
158
189
  // release all keys
159
190
  for (let keyName in KeyCodes) {
160
191
  this.keys[keyName].release();
@@ -170,12 +201,10 @@ class KeyboardDevice {
170
201
  el.addEventListener(KeyboardEvents.KeyDown, this.#handlerKeyDown);
171
202
  el.addEventListener(KeyboardEvents.KeyUp, this.#handlerKeyUp);
172
203
 
173
- el.addEventListener('blur', this.#handleGlobalBlurEvent);
204
+ // catch releases of tracked keys that happen after the element lost focus within the page
205
+ window.addEventListener(KeyboardEvents.KeyUp, this.#handlerWindowKeyUp);
174
206
 
175
- //https://w3c.github.io/uievents/#event-type-focusout
176
- el.addEventListener('focusout', this.#handleGlobalBlurEvent);
177
-
178
- window.addEventListener('blur', this.#handleGlobalBlurEvent);
207
+ window.addEventListener('blur', this.#handleWindowBlurEvent);
179
208
  }
180
209
 
181
210
  /**
@@ -187,12 +216,9 @@ class KeyboardDevice {
187
216
  el.removeEventListener(KeyboardEvents.KeyDown, this.#handlerKeyDown);
188
217
  el.removeEventListener(KeyboardEvents.KeyUp, this.#handlerKeyUp);
189
218
 
190
- el.removeEventListener('blur', this.#handleGlobalBlurEvent);
191
-
192
- //https://w3c.github.io/uievents/#event-type-focusout
193
- el.removeEventListener('focusout', this.#handleGlobalBlurEvent);
219
+ window.removeEventListener(KeyboardEvents.KeyUp, this.#handlerWindowKeyUp);
194
220
 
195
- window.removeEventListener('blur', this.#handleGlobalBlurEvent);
221
+ window.removeEventListener('blur', this.#handleWindowBlurEvent);
196
222
  }
197
223
 
198
224
  }
@@ -1 +1 @@
1
- {"version":3,"file":"isHTMLElementFocusable.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/isHTMLElementFocusable.js"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,2CAFW,OAAO,WASjB"}
1
+ {"version":3,"file":"isHTMLElementFocusable.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/isHTMLElementFocusable.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH,2CAFW,OAAO,WASjB"}
@@ -5,17 +5,10 @@
5
5
  * @returns {boolean}
6
6
  */
7
7
  function isInstanceOf(thing, klass) {
8
- if (klass === undefined) {
8
+ // constructors are functions; the check also guards against the class being absent in the environment
9
+ if (typeof klass !== "function") {
9
10
  return false;
10
11
  }
11
- if (klass === null) {
12
- return false;
13
- }
14
-
15
- if (typeof klass !== "object") {
16
- return false;
17
- }
18
-
19
12
 
20
13
  return thing instanceof klass;
21
14
  }
@@ -4,8 +4,9 @@ export class InputBinding {
4
4
  * @param {string} path
5
5
  * @param {function} listener
6
6
  * @param {boolean} [exclusive=false]
7
+ * @param {number} [priority=0] higher priority bindings on the same path are dispatched first
7
8
  */
8
- constructor({ path, listener, exclusive }: string);
9
+ constructor({ path, listener, exclusive, priority }: string);
9
10
  /**
10
11
  *
11
12
  * @type {string}
@@ -21,5 +22,10 @@ export class InputBinding {
21
22
  * @type {boolean}
22
23
  */
23
24
  exclusive: boolean;
25
+ /**
26
+ * Higher priority bindings on the same path are dispatched first.
27
+ * @type {number}
28
+ */
29
+ priority: number;
24
30
  }
25
31
  //# sourceMappingURL=InputBinding.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputBinding.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/ecs/components/InputBinding.js"],"names":[],"mappings":"AAEA;IACI;;;;;OAKG;IACH,2CAJW,MAAM,EAwBhB;IAfG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAChB;;;OAGG;IACH,mBAAwB;IACxB;;;OAGG;IACH,WAFU,OAAO,CAES;CAEjC"}
1
+ {"version":3,"file":"InputBinding.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/ecs/components/InputBinding.js"],"names":[],"mappings":"AAEA;IACI;;;;;;OAMG;IACH,qDALW,MAAM,EA+BhB;IApBG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAChB;;;OAGG;IACH,mBAAwB;IACxB;;;OAGG;IACH,WAFU,OAAO,CAES;IAC1B;;;OAGG;IACH,UAFU,MAAM,CAEQ;CAE/B"}
@@ -6,11 +6,13 @@ export class InputBinding {
6
6
  * @param {string} path
7
7
  * @param {function} listener
8
8
  * @param {boolean} [exclusive=false]
9
+ * @param {number} [priority=0] higher priority bindings on the same path are dispatched first
9
10
  */
10
- constructor({ path, listener, exclusive = false }) {
11
+ constructor({ path, listener, exclusive = false, priority = 0 }) {
11
12
  assert.isString(path, 'path');
12
13
  assert.isFunction(listener, 'listener');
13
14
  assert.isBoolean(exclusive, 'exclusive');
15
+ assert.isNumber(priority, 'priority');
14
16
 
15
17
  /**
16
18
  *
@@ -27,5 +29,10 @@ export class InputBinding {
27
29
  * @type {boolean}
28
30
  */
29
31
  this.exclusive = exclusive;
32
+ /**
33
+ * Higher priority bindings on the same path are dispatched first.
34
+ * @type {number}
35
+ */
36
+ this.priority = priority;
30
37
  }
31
38
  }
@@ -103,7 +103,7 @@ function getOrCreateProxy(proxies, path, signal) {
103
103
  } else if (!a.exclusive && b.exclusive) {
104
104
  return 1;
105
105
  } else {
106
- return b.priotity - a.priority;
106
+ return b.priority - a.priority;
107
107
  }
108
108
  });
109
109
  }
@@ -5,9 +5,10 @@ export class OverrideContextBehavior extends AbstractDecoratorBehavior {
5
5
  * @param {Behavior} source
6
6
  * @return {OverrideContextBehavior}
7
7
  */
8
- static from(context: any, source: Behavior): OverrideContextBehavior;
8
+ static from(context: any, source: Behavior<any>): OverrideContextBehavior;
9
9
  __override_context: {};
10
10
  tick(timeDelta: any): import("../BehaviorStatus.js").BehaviorStatus;
11
11
  }
12
12
  import { AbstractDecoratorBehavior } from "./AbstractDecoratorBehavior.js";
13
+ import { Behavior } from "../Behavior.js";
13
14
  //# sourceMappingURL=OverrideContextBehavior.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OverrideContextBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js"],"names":[],"mappings":"AAEA;IAII;;;;;OAKG;IACH,6CAFY,uBAAuB,CASlC;IAfD,uBAAwB;IAiBxB,oEAIC;CASJ;0CAlCyC,gCAAgC"}
1
+ {"version":3,"file":"OverrideContextBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js"],"names":[],"mappings":"AAGA;IAII;;;;;OAKG;IACH,kDAFY,uBAAuB,CASlC;IAfD,uBAAwB;IAiBxB,oEAIC;CAYJ;0CArCyC,gCAAgC;yBADjD,gBAAgB"}
@@ -1,3 +1,4 @@
1
+ import { Behavior } from "../Behavior.js";
1
2
  import { AbstractDecoratorBehavior } from "./AbstractDecoratorBehavior.js";
2
3
 
3
4
  export class OverrideContextBehavior extends AbstractDecoratorBehavior {
@@ -26,10 +27,13 @@ export class OverrideContextBehavior extends AbstractDecoratorBehavior {
26
27
  }
27
28
 
28
29
  initialize(context) {
29
- super.initialize(context);
30
-
31
30
  const child_context = Object.assign({}, context, this.__override_context);
32
31
 
33
32
  this.__source.initialize(child_context);
33
+
34
+ // NOTE: deliberately not super.initialize() — AbstractDecoratorBehavior
35
+ // would re-initialize the source a second time with the un-overridden
36
+ // context. Do only the Behavior-level self-init.
37
+ Behavior.prototype.initialize.call(this, context);
34
38
  }
35
39
  }
@@ -58,7 +58,7 @@ export class WeightedElement {
58
58
  */
59
59
  equals(other) {
60
60
  return this.weight === other.weight
61
- && invokeObjectEquals(this.data, other.element);
61
+ && invokeObjectEquals(this.data, other.data);
62
62
  }
63
63
 
64
64
  /**
@@ -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"}