@woosh/meep-engine 2.168.0 → 2.169.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/README.md +2 -2
  2. package/build/bundle-worker-image-decoder.js +1 -1
  3. package/package.json +1 -1
  4. package/src/REVIEW_2026_08_06/adv-core.md +511 -0
  5. package/src/REVIEW_2026_08_06/adv-gfx.md +480 -0
  6. package/src/REVIEW_2026_08_06/adv-view.md +446 -0
  7. package/src/REVIEW_2026_08_06/api-core.md +296 -0
  8. package/src/REVIEW_2026_08_06/api-engine.md +195 -0
  9. package/src/REVIEW_2026_08_06/bvh-phys-sound-net.md +507 -0
  10. package/src/REVIEW_2026_08_06/core-binary.md +348 -0
  11. package/src/REVIEW_2026_08_06/core-collection.md +376 -0
  12. package/src/REVIEW_2026_08_06/core-math.md +221 -0
  13. package/src/REVIEW_2026_08_06/core-process.md +266 -0
  14. package/src/REVIEW_2026_08_06/core-science.md +223 -0
  15. package/src/REVIEW_2026_08_06/engine-ai-nav.md +279 -0
  16. package/src/REVIEW_2026_08_06/engine-animation.md +167 -0
  17. package/src/REVIEW_2026_08_06/engine-asset.md +166 -0
  18. package/src/REVIEW_2026_08_06/engine-ecs.md +920 -0
  19. package/src/REVIEW_2026_08_06/engine-input.md +197 -0
  20. package/src/REVIEW_2026_08_06/engine-misc.md +248 -0
  21. package/src/REVIEW_2026_08_06/engine-terrain.md +52 -0
  22. package/src/REVIEW_2026_08_06/generation.md +176 -0
  23. package/src/REVIEW_2026_08_06/geom-2d.md +434 -0
  24. package/src/REVIEW_2026_08_06/geom-3d.md +117 -0
  25. package/src/REVIEW_2026_08_06/gfx-gi.md +143 -0
  26. package/src/REVIEW_2026_08_06/gfx-render.md +740 -0
  27. package/src/REVIEW_2026_08_06/gfx-texture.md +690 -0
  28. package/src/REVIEW_2026_08_06/prior-criticals.md +49 -0
  29. package/src/REVIEW_2026_08_06/prior-highs.md +138 -0
  30. package/src/REVIEW_2026_08_06/test-gaps.md +364 -0
  31. package/src/REVIEW_2026_08_06/view.md +667 -0
  32. package/src/REVIEW_2026_08_06.md +571 -0
  33. package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
  34. package/src/core/binary/BinaryBuffer.js +12 -1
  35. package/src/core/binary/BitImage2.d.ts +5 -1
  36. package/src/core/binary/BitImage2.d.ts.map +1 -1
  37. package/src/core/binary/BitImage2.js +5 -1
  38. package/src/core/bvh8/build/NodeProxy.d.ts.map +1 -1
  39. package/src/core/bvh8/build/NodeProxy.js +314 -308
  40. package/src/core/collection/list/List.d.ts +15 -0
  41. package/src/core/collection/list/List.d.ts.map +1 -1
  42. package/src/core/collection/list/List.js +34 -0
  43. package/src/core/collection/list/SortedListProjection.d.ts.map +1 -1
  44. package/src/core/collection/list/SortedListProjection.js +4 -1
  45. package/src/core/collection/map/BiMap.d.ts +25 -2
  46. package/src/core/collection/map/BiMap.d.ts.map +1 -1
  47. package/src/core/collection/map/BiMap.js +57 -3
  48. package/src/core/debug/matchers/IsAnything.d.ts.map +1 -1
  49. package/src/core/debug/matchers/IsAnything.js +5 -1
  50. package/src/core/events/signal/Signal.d.ts.map +1 -1
  51. package/src/core/events/signal/Signal.js +3 -1
  52. package/src/core/geom/2d/polygon/TRIANGULATION_DESIGN.md +433 -0
  53. package/src/core/geom/2d/polygon/polygon2_is_counter_clockwise.d.ts +31 -0
  54. package/src/core/geom/2d/polygon/polygon2_is_counter_clockwise.d.ts.map +1 -0
  55. package/src/core/geom/2d/polygon/polygon2_is_counter_clockwise.js +84 -0
  56. package/src/core/geom/2d/polygon/polygon2_signed_area.d.ts +24 -2
  57. package/src/core/geom/2d/polygon/polygon2_signed_area.d.ts.map +1 -1
  58. package/src/core/geom/2d/polygon/polygon2_signed_area.js +52 -34
  59. package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.d.ts +28 -0
  60. package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.d.ts.map +1 -0
  61. package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.js +86 -0
  62. package/src/core/geom/2d/polygon/polygon2_triangulate.d.ts +40 -0
  63. package/src/core/geom/2d/polygon/polygon2_triangulate.d.ts.map +1 -0
  64. package/src/core/geom/2d/polygon/polygon2_triangulate.js +1280 -0
  65. package/src/core/geom/2d/polygon/polygon2_triangulation_deviation.d.ts +28 -0
  66. package/src/core/geom/2d/polygon/polygon2_triangulation_deviation.d.ts.map +1 -0
  67. package/src/core/geom/2d/polygon/polygon2_triangulation_deviation.js +77 -0
  68. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts +6 -3
  69. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts.map +1 -1
  70. package/src/core/geom/2d/triangle/tri2_rasterize_conservative.js +26 -13
  71. package/src/core/geom/2d/triangle/tri2_signed_area.d.ts +17 -1
  72. package/src/core/geom/2d/triangle/tri2_signed_area.d.ts.map +1 -1
  73. package/src/core/geom/2d/triangle/tri2_signed_area.js +35 -23
  74. package/src/core/geom/2d/v2_morton_encode.d.ts +20 -0
  75. package/src/core/geom/2d/v2_morton_encode.d.ts.map +1 -0
  76. package/src/core/geom/2d/v2_morton_encode.js +23 -0
  77. package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts.map +1 -1
  78. package/src/core/geom/3d/atlas/segment/atlas_merge_charts.js +4 -1
  79. package/src/core/geom/3d/polygon/polygon3_compute_normal.d.ts +27 -0
  80. package/src/core/geom/3d/polygon/polygon3_compute_normal.d.ts.map +1 -0
  81. package/src/core/geom/3d/polygon/polygon3_compute_normal.js +60 -0
  82. package/src/core/geom/3d/polygon/polygon3_triangulate.d.ts +34 -0
  83. package/src/core/geom/3d/polygon/polygon3_triangulate.d.ts.map +1 -0
  84. package/src/core/geom/3d/polygon/polygon3_triangulate.js +94 -0
  85. package/src/core/geom/3d/quaternion/quat3_multiply.d.ts +8 -2
  86. package/src/core/geom/3d/quaternion/quat3_multiply.d.ts.map +1 -1
  87. package/src/core/geom/3d/quaternion/quat3_multiply.js +8 -2
  88. package/src/core/geom/3d/shape/ConvexHullShape3D.d.ts.map +1 -1
  89. package/src/core/geom/3d/shape/ConvexHullShape3D.js +32 -2
  90. package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_triangulate.d.ts +23 -6
  91. package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_triangulate.d.ts.map +1 -1
  92. package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_triangulate.js +268 -124
  93. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_assert_valid.d.ts +17 -0
  94. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_assert_valid.d.ts.map +1 -0
  95. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_assert_valid.js +44 -0
  96. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_count_edge_faces.d.ts +20 -0
  97. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_count_edge_faces.d.ts.map +1 -0
  98. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_count_edge_faces.js +40 -0
  99. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_closed.d.ts +19 -0
  100. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_closed.d.ts.map +1 -0
  101. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_closed.js +34 -0
  102. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_manifold.d.ts +22 -0
  103. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_manifold.d.ts.map +1 -0
  104. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_is_manifold.js +37 -0
  105. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_validate.d.ts +87 -0
  106. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_validate.d.ts.map +1 -0
  107. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_validate.js +599 -0
  108. package/src/core/geom/3d/triangle/tri3_compute_signed_volume.d.ts +32 -0
  109. package/src/core/geom/3d/triangle/tri3_compute_signed_volume.d.ts.map +1 -1
  110. package/src/core/geom/3d/triangle/tri3_compute_signed_volume.js +66 -7
  111. package/src/core/geom/3d/triangle/tri3_mesh_compute_signed_volume.d.ts +22 -1
  112. package/src/core/geom/3d/triangle/tri3_mesh_compute_signed_volume.d.ts.map +1 -1
  113. package/src/core/geom/3d/triangle/tri3_mesh_compute_signed_volume.js +83 -38
  114. package/src/core/geom/MANIFOLD_COMPARISON_2026_08_01.md +554 -0
  115. package/src/core/geom/vec3/v3_cotangent.d.ts +6 -2
  116. package/src/core/geom/vec3/v3_cotangent.d.ts.map +1 -1
  117. package/src/core/geom/vec3/v3_cotangent.js +6 -2
  118. package/src/core/geom/vec3/v3_cross.d.ts +6 -2
  119. package/src/core/geom/vec3/v3_cross.d.ts.map +1 -1
  120. package/src/core/geom/vec3/v3_cross.js +6 -2
  121. package/src/core/geom/vec3/v3_multiply.d.ts +6 -2
  122. package/src/core/geom/vec3/v3_multiply.d.ts.map +1 -1
  123. package/src/core/geom/vec3/v3_multiply.js +6 -2
  124. package/src/core/geom/vec3/v3_subtract.d.ts +6 -2
  125. package/src/core/geom/vec3/v3_subtract.d.ts.map +1 -1
  126. package/src/core/geom/vec3/v3_subtract.js +6 -2
  127. package/src/core/localization/Localization.js +1 -1
  128. package/src/core/math/random/randomSeed.d.ts +13 -0
  129. package/src/core/math/random/randomSeed.d.ts.map +1 -0
  130. package/src/core/math/random/randomSeed.js +16 -0
  131. package/src/core/math/spline/spline3_hermite_apply_transform.d.ts +50 -0
  132. package/src/core/math/spline/spline3_hermite_apply_transform.d.ts.map +1 -0
  133. package/src/core/math/spline/spline3_hermite_apply_transform.js +107 -0
  134. package/src/core/math/spline/spline3_hermite_reverse.d.ts +34 -0
  135. package/src/core/math/spline/spline3_hermite_reverse.d.ts.map +1 -0
  136. package/src/core/math/spline/spline3_hermite_reverse.js +49 -0
  137. package/src/core/math/statistics/hammersley_sequence.d.ts +17 -4
  138. package/src/core/math/statistics/hammersley_sequence.d.ts.map +1 -1
  139. package/src/core/math/statistics/hammersley_sequence.js +25 -16
  140. package/src/core/process/Future.d.ts.map +1 -1
  141. package/src/core/process/Future.js +12 -0
  142. package/src/core/process/PromiseWatcher.d.ts.map +1 -1
  143. package/src/core/process/PromiseWatcher.js +9 -2
  144. package/src/core/process/executor/ConcurrentExecutor.d.ts.map +1 -1
  145. package/src/core/process/executor/ConcurrentExecutor.js +12 -2
  146. package/src/core/process/worker/WorkerProxy.d.ts.map +1 -1
  147. package/src/core/process/worker/WorkerProxy.js +5 -2
  148. package/src/core/process/worker/extractTransferables.d.ts.map +1 -1
  149. package/src/core/process/worker/extractTransferables.js +4 -1
  150. package/src/engine/Engine.d.ts +12 -12
  151. package/src/engine/Engine.d.ts.map +1 -1
  152. package/src/engine/Engine.js +149 -10
  153. package/src/engine/EngineHarness.d.ts.map +1 -1
  154. package/src/engine/EngineHarness.js +4 -1
  155. package/src/engine/asset/loaders/ArrayBufferLoader.d.ts.map +1 -1
  156. package/src/engine/asset/loaders/ArrayBufferLoader.js +7 -0
  157. package/src/engine/ecs/speaker/lines/sets/LineSetDescription.d.ts.map +1 -1
  158. package/src/engine/ecs/speaker/lines/sets/LineSetDescription.js +3 -1
  159. package/src/engine/ecs/terrain/ecs/TerrainSystem.d.ts.map +1 -1
  160. package/src/engine/ecs/terrain/ecs/TerrainSystem.js +4 -1
  161. package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts +29 -0
  162. package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
  163. package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +84 -23
  164. package/src/engine/graphics/CONTEXT_LOSS_RECOVERY_PLAN.md +446 -0
  165. package/src/engine/graphics/GraphicsEngine.d.ts +56 -7
  166. package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
  167. package/src/engine/graphics/GraphicsEngine.js +196 -24
  168. package/src/engine/graphics/context/WebGLContextFailureReason.d.ts +9 -0
  169. package/src/engine/graphics/context/WebGLContextFailureReason.d.ts.map +1 -0
  170. package/src/engine/graphics/context/WebGLContextFailureReason.js +17 -0
  171. package/src/engine/graphics/context/WebGLContextMonitor.d.ts +106 -0
  172. package/src/engine/graphics/context/WebGLContextMonitor.d.ts.map +1 -0
  173. package/src/engine/graphics/context/WebGLContextMonitor.js +341 -0
  174. package/src/engine/graphics/context/WebGLContextState.d.ts +14 -0
  175. package/src/engine/graphics/context/WebGLContextState.d.ts.map +1 -0
  176. package/src/engine/graphics/context/WebGLContextState.js +24 -0
  177. package/src/engine/graphics/context/testWebGLContextLoss.d.ts +2 -0
  178. package/src/engine/graphics/context/testWebGLContextLoss.d.ts.map +1 -0
  179. package/src/engine/graphics/context/testWebGLContextLoss.js +696 -0
  180. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.d.ts.map +1 -1
  181. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.js +68 -32
  182. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationUpgrader_0_1.d.ts +14 -0
  183. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationUpgrader_0_1.d.ts.map +1 -0
  184. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationUpgrader_0_1.js +41 -0
  185. package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +1 -1
  186. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
  187. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +5 -0
  188. package/src/engine/graphics/ecs/trail2d/Trail2D.d.ts +5 -1
  189. package/src/engine/graphics/ecs/trail2d/Trail2D.d.ts.map +1 -1
  190. package/src/engine/graphics/ecs/trail2d/Trail2D.js +15 -0
  191. package/src/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts +1 -1
  192. package/src/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts.map +1 -1
  193. package/src/engine/graphics/ecs/trail2d/Trail2DSystem.js +2 -1
  194. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts +4 -1
  195. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts.map +1 -1
  196. package/src/engine/graphics/ecs/trail3d/Trail3D.js +488 -476
  197. package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts +1 -1
  198. package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts.map +1 -1
  199. package/src/engine/graphics/ecs/trail3d/Trail3DSystem.js +280 -253
  200. package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.d.ts.map +1 -1
  201. package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.js +3 -2
  202. package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.d.ts.map +1 -1
  203. package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.js +3 -1
  204. package/src/engine/graphics/geometry/computeMeshSurfaceArea.js +1 -1
  205. package/src/engine/graphics/load_and_set_cubemap_v0.d.ts +5 -0
  206. package/src/engine/graphics/load_and_set_cubemap_v0.d.ts.map +1 -1
  207. package/src/engine/graphics/load_and_set_cubemap_v0.js +26 -21
  208. package/src/engine/graphics/particles/particular/group/ParticleGroup.d.ts.map +1 -1
  209. package/src/engine/graphics/particles/particular/group/ParticleGroup.js +19 -8
  210. package/src/engine/graphics/particles/particular/group/optimizeCommandQueue.js +1 -1
  211. package/src/engine/graphics/texture/atlas/AtlasLookupTexture.d.ts.map +1 -1
  212. package/src/engine/graphics/texture/atlas/AtlasLookupTexture.js +10 -3
  213. package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
  214. package/src/engine/graphics/texture/atlas/TextureAtlas.js +4 -1
  215. package/src/engine/graphics/texture/atlas/gpu/WebGLTextureAtlas.d.ts.map +1 -1
  216. package/src/engine/graphics/texture/atlas/gpu/WebGLTextureAtlas.js +11 -0
  217. package/src/engine/graphics/texture/cubemap/load_environment_map.d.ts.map +1 -1
  218. package/src/engine/graphics/texture/cubemap/load_environment_map.js +5 -2
  219. package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_Chamfer.d.ts.map +1 -1
  220. package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_Chamfer.js +26 -18
  221. package/src/engine/graphics/texture/sampler/filter/sampler2d_blur_gaussian.d.ts +15 -2
  222. package/src/engine/graphics/texture/sampler/filter/sampler2d_blur_gaussian.d.ts.map +1 -1
  223. package/src/engine/graphics/texture/sampler/filter/sampler2d_blur_gaussian.js +29 -3
  224. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.d.ts +11 -1
  225. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.d.ts.map +1 -1
  226. package/src/engine/graphics/texture/sampler/resize/sampler2d_scale_down_lanczos.js +158 -171
  227. package/src/engine/graphics/texture/sampler/sampler2d_paint.js +1 -1
  228. package/src/engine/graphics/texture/sampler/util/bitSet2Sampler2D.js +2 -2
  229. package/src/engine/input/ecs/util/TopDownCameraControllerHelper.d.ts.map +1 -1
  230. package/src/engine/input/ecs/util/TopDownCameraControllerHelper.js +10 -3
  231. package/src/engine/navigation/ecs/components/PathSerializationUpgrader_2_3.d.ts +14 -0
  232. package/src/engine/navigation/ecs/components/PathSerializationUpgrader_2_3.d.ts.map +1 -0
  233. package/src/engine/navigation/ecs/components/PathSerializationUpgrader_2_3.js +38 -0
  234. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
  235. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +433 -425
  236. package/src/engine/physics/constraint/solve_constraints.d.ts +4 -1
  237. package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
  238. package/src/engine/physics/constraint/solve_constraints.js +38 -13
  239. package/src/engine/physics/contact/ManifoldStore.d.ts +15 -3
  240. package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -1
  241. package/src/engine/physics/contact/ManifoldStore.js +15 -3
  242. package/src/engine/physics/ecs/Joint.d.ts +7 -4
  243. package/src/engine/physics/ecs/Joint.d.ts.map +1 -1
  244. package/src/engine/physics/ecs/Joint.js +7 -4
  245. package/src/engine/physics/ecs/PhysicsSystem.d.ts +14 -0
  246. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  247. package/src/engine/physics/ecs/PhysicsSystem.js +16 -0
  248. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  249. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
  250. package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts +15 -7
  251. package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts.map +1 -1
  252. package/src/engine/physics/narrowphase/convex_convex_manifold.js +33 -10
  253. package/src/engine/physics/narrowphase/refine_ray_concave.d.ts +6 -2
  254. package/src/engine/physics/narrowphase/refine_ray_concave.d.ts.map +1 -1
  255. package/src/engine/physics/narrowphase/refine_ray_concave.js +6 -2
  256. package/src/engine/physics/narrowphase/refine_ray_hit.d.ts +6 -2
  257. package/src/engine/physics/narrowphase/refine_ray_hit.d.ts.map +1 -1
  258. package/src/engine/physics/narrowphase/refine_ray_hit.js +6 -2
  259. package/src/engine/physics/queries/raycast.d.ts.map +1 -1
  260. package/src/engine/physics/queries/raycast.js +11 -4
  261. package/src/engine/save/storage/IndexedDBStorage.d.ts.map +1 -1
  262. package/src/engine/save/storage/IndexedDBStorage.js +21 -3
  263. package/src/engine/simulation/Ticker.d.ts +12 -0
  264. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  265. package/src/engine/simulation/Ticker.js +18 -0
  266. package/src/engine/sound/simulation/AcousticSimulator.d.ts.map +1 -1
  267. package/src/engine/sound/simulation/AcousticSimulator.js +9 -1
  268. package/src/engine/sound/simulation/core/VolumeField.d.ts +6 -2
  269. package/src/engine/sound/simulation/core/VolumeField.d.ts.map +1 -1
  270. package/src/engine/sound/simulation/core/VolumeField.js +6 -2
  271. package/src/engine/sound/simulation/probe/AcousticProbeField.d.ts +6 -2
  272. package/src/engine/sound/simulation/probe/AcousticProbeField.d.ts.map +1 -1
  273. package/src/engine/sound/simulation/probe/AcousticProbeField.js +6 -2
  274. package/src/engine/sound/simulation/probe/acoustic_probe_transfer.d.ts +6 -2
  275. package/src/engine/sound/simulation/probe/acoustic_probe_transfer.d.ts.map +1 -1
  276. package/src/engine/sound/simulation/probe/acoustic_probe_transfer.js +6 -2
  277. package/src/engine/sound/simulation/probe/bakeProbeReflectors.d.ts +3 -1
  278. package/src/engine/sound/simulation/probe/bakeProbeReflectors.d.ts.map +1 -1
  279. package/src/engine/sound/simulation/probe/bakeProbeReflectors.js +3 -1
  280. package/src/engine/ui/GUIEngine.d.ts.map +1 -1
  281. package/src/engine/ui/GUIEngine.js +8 -1
  282. package/src/generation/theme/TerrainTheme.d.ts.map +1 -1
  283. package/src/generation/theme/TerrainTheme.js +2 -1
  284. package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
  285. package/src/generation/theme/ThemeEngine.js +6 -5
  286. package/src/view/ViewGroup.d.ts.map +1 -1
  287. package/src/view/ViewGroup.js +9 -7
  288. package/src/view/graphics/WebGLContextFailureView.d.ts +19 -0
  289. package/src/view/graphics/WebGLContextFailureView.d.ts.map +1 -0
  290. package/src/view/graphics/WebGLContextFailureView.js +76 -0
  291. package/src/view/minimap/Minimap.d.ts +8 -0
  292. package/src/view/minimap/Minimap.d.ts.map +1 -1
  293. package/src/view/minimap/Minimap.js +16 -3
  294. package/src/view/minimap/dom/MinimapMarkerView.d.ts.map +1 -1
  295. package/src/view/minimap/dom/MinimapMarkerView.js +3 -1
@@ -6,8 +6,12 @@
6
6
  *
7
7
  * @param {number[]|Float32Array|Float64Array} result destination
8
8
  * @param {number} result_offset offset into `result`
9
- * @param {number} ax @param {number} ay @param {number} az first factor
10
- * @param {number} bx @param {number} by @param {number} bz second factor
9
+ * @param {number} ax first factor x
10
+ * @param {number} ay first factor y
11
+ * @param {number} az first factor z
12
+ * @param {number} bx second factor x
13
+ * @param {number} by second factor y
14
+ * @param {number} bz second factor z
11
15
  *
12
16
  * @author Alex Goldring
13
17
  * @copyright Company Named Limited (c) 2026
@@ -6,8 +6,12 @@
6
6
  *
7
7
  * @param {number[]|Float32Array|Float64Array} result destination
8
8
  * @param {number} result_offset offset into `result`
9
- * @param {number} ax @param {number} ay @param {number} az minuend
10
- * @param {number} bx @param {number} by @param {number} bz subtrahend
9
+ * @param {number} ax minuend x
10
+ * @param {number} ay minuend y
11
+ * @param {number} az minuend z
12
+ * @param {number} bx subtrahend x
13
+ * @param {number} by subtrahend y
14
+ * @param {number} bz subtrahend z
11
15
  *
12
16
  * @author Alex Goldring
13
17
  * @copyright Company Named Limited (c) 2026
@@ -1 +1 @@
1
- {"version":3,"file":"v3_subtract.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_subtract.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,oCARW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,MACN,MAAM,MAAa,MAAM,MAAa,MAAM,MAC5C,MAAM,MAAa,MAAM,MAAa,MAAM,QAStD"}
1
+ {"version":3,"file":"v3_subtract.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_subtract.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oCAZW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAShB"}
@@ -6,8 +6,12 @@
6
6
  *
7
7
  * @param {number[]|Float32Array|Float64Array} result destination
8
8
  * @param {number} result_offset offset into `result`
9
- * @param {number} ax @param {number} ay @param {number} az minuend
10
- * @param {number} bx @param {number} by @param {number} bz subtrahend
9
+ * @param {number} ax minuend x
10
+ * @param {number} ay minuend y
11
+ * @param {number} az minuend z
12
+ * @param {number} bx subtrahend x
13
+ * @param {number} by subtrahend y
14
+ * @param {number} bz subtrahend z
11
15
  *
12
16
  * @author Alex Goldring
13
17
  * @copyright Company Named Limited (c) 2026
@@ -139,7 +139,7 @@ export class Localization {
139
139
 
140
140
  while (_path.endsWith('/') || _path.endsWith('\\')) {
141
141
  // remove trailing slash if present
142
- _path.slice(0, _path.length - 1);
142
+ _path = _path.slice(0, _path.length - 1);
143
143
  }
144
144
 
145
145
  const pLoadData = am.promise(`${_path}/${locale}.json`, "json")
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Draw a child seed from an existing generator.
3
+ *
4
+ * Seeded generators here consume an integer. Mulberry32 mixes its seed with
5
+ * bitwise operators, which coerce to int32 and discard any fractional part, so
6
+ * handing it a raw `random()` result -- a value in [0,1) -- collapses every
7
+ * distinct parent seed onto the same stream. Widen to an integer first.
8
+ *
9
+ * @param {function():number} random
10
+ * @returns {number} integer in [0, 2^32)
11
+ */
12
+ export function randomSeed(random: () => number): number;
13
+ //# sourceMappingURL=randomSeed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"randomSeed.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/random/randomSeed.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,yCAHsB,MAAM,GACf,MAAM,CAIlB"}
@@ -0,0 +1,16 @@
1
+ import { randomIntegerBetween } from "./randomIntegerBetween.js";
2
+
3
+ /**
4
+ * Draw a child seed from an existing generator.
5
+ *
6
+ * Seeded generators here consume an integer. Mulberry32 mixes its seed with
7
+ * bitwise operators, which coerce to int32 and discard any fractional part, so
8
+ * handing it a raw `random()` result -- a value in [0,1) -- collapses every
9
+ * distinct parent seed onto the same stream. Widen to an integer first.
10
+ *
11
+ * @param {function():number} random
12
+ * @returns {number} integer in [0, 2^32)
13
+ */
14
+ export function randomSeed(random) {
15
+ return randomIntegerBetween(random, 0, 0xFFFFFFFF);
16
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Apply a 4x4 affine matrix to a 3d cubic Hermite segment.
3
+ *
4
+ * The result is written as twelve values in control-point order --
5
+ * `[p0x, p0y, p0z, p1x, p1y, p1z, m0x, m0y, m0z, m1x, m1y, m1z]` -- matching
6
+ * the `(p0, p1, m0, m1)` argument order the rest of the `spline3_hermite_*`
7
+ * family uses, note the stride and offset.
8
+ *
9
+ * Endpoints transform as points, so the translation column applies. Tangents
10
+ * transform as directions, so it does not, and -- unlike
11
+ * {@link m4_transform_direction_v3_buffer}, which is written for normals -- they
12
+ * are deliberately NOT re-normalised: a Hermite tangent's magnitude is part of
13
+ * the curve's shape, and rescaling it would change the geometry rather than
14
+ * move it. Under this rule the transformed segment is exactly the image of the
15
+ * original curve: `T(H(u)) = H_transformed(u)` for every `u`.
16
+ *
17
+ * The matrix must be AFFINE — the perspective row must be zero and `m4[15]`
18
+ * must be 1. This is a real restriction, not defensive book-keeping: a
19
+ * projective map sends a polynomial cubic to a *rational* cubic, which no
20
+ * Hermite segment can represent, so a perspective matrix here would silently
21
+ * produce a curve that is merely plausible.
22
+ *
23
+ * Matrix layout is meep's usual column-major (OpenGL) convention, so `m4[0..2]`
24
+ * is the X axis, `m4[4..6]` the Y axis, `m4[8..10]` the Z axis and `m4[12..14]`
25
+ * the translation.
26
+ *
27
+ * Safe to use in place: the inputs are scalars, so they are already read before
28
+ * anything is written.
29
+ *
30
+ * @param {number[]|Float32Array|Float64Array} output where to write the result
31
+ * @param {number} output_offset where to start writing
32
+ * @param {number} output_stride step between result values, useful when working in higher dimensions. Typically, this will be 1.
33
+ * @param {number} p0x
34
+ * @param {number} p0y
35
+ * @param {number} p0z
36
+ * @param {number} p1x
37
+ * @param {number} p1y
38
+ * @param {number} p1z
39
+ * @param {number} m0x tangent at p0
40
+ * @param {number} m0y tangent at p0
41
+ * @param {number} m0z tangent at p0
42
+ * @param {number} m1x tangent at p1
43
+ * @param {number} m1y tangent at p1
44
+ * @param {number} m1z tangent at p1
45
+ * @param {number[]|Float32Array|Float64Array} m4 column-major affine 4x4 matrix
46
+ * @author Alex Goldring
47
+ * @copyright Company Named Limited (c) 2026
48
+ */
49
+ export function spline3_hermite_apply_transform(output: number[] | Float32Array | Float64Array, output_offset: number, output_stride: number, p0x: number, p0y: number, p0z: number, p1x: number, p1y: number, p1z: number, m0x: number, m0y: number, m0z: number, m1x: number, m1y: number, m1z: number, m4: number[] | Float32Array | Float64Array): void;
50
+ //# sourceMappingURL=spline3_hermite_apply_transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spline3_hermite_apply_transform.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/spline/spline3_hermite_apply_transform.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wDAnBW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,iBACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,MACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,QAmD5C"}
@@ -0,0 +1,107 @@
1
+ import { assert } from "../../assert.js";
2
+
3
+ /**
4
+ * How far the perspective row may drift from `(0, 0, 0, 1)` and still count as
5
+ * affine. Loose enough to accept a matrix that has been inverted or composed a
6
+ * few times, tight enough that a real perspective matrix — whose `m4[11]` is
7
+ * typically −1 — is nowhere near it.
8
+ * @type {number}
9
+ */
10
+ const AFFINE_EPSILON = 1e-9;
11
+
12
+ /**
13
+ * Apply a 4x4 affine matrix to a 3d cubic Hermite segment.
14
+ *
15
+ * The result is written as twelve values in control-point order --
16
+ * `[p0x, p0y, p0z, p1x, p1y, p1z, m0x, m0y, m0z, m1x, m1y, m1z]` -- matching
17
+ * the `(p0, p1, m0, m1)` argument order the rest of the `spline3_hermite_*`
18
+ * family uses, note the stride and offset.
19
+ *
20
+ * Endpoints transform as points, so the translation column applies. Tangents
21
+ * transform as directions, so it does not, and -- unlike
22
+ * {@link m4_transform_direction_v3_buffer}, which is written for normals -- they
23
+ * are deliberately NOT re-normalised: a Hermite tangent's magnitude is part of
24
+ * the curve's shape, and rescaling it would change the geometry rather than
25
+ * move it. Under this rule the transformed segment is exactly the image of the
26
+ * original curve: `T(H(u)) = H_transformed(u)` for every `u`.
27
+ *
28
+ * The matrix must be AFFINE — the perspective row must be zero and `m4[15]`
29
+ * must be 1. This is a real restriction, not defensive book-keeping: a
30
+ * projective map sends a polynomial cubic to a *rational* cubic, which no
31
+ * Hermite segment can represent, so a perspective matrix here would silently
32
+ * produce a curve that is merely plausible.
33
+ *
34
+ * Matrix layout is meep's usual column-major (OpenGL) convention, so `m4[0..2]`
35
+ * is the X axis, `m4[4..6]` the Y axis, `m4[8..10]` the Z axis and `m4[12..14]`
36
+ * the translation.
37
+ *
38
+ * Safe to use in place: the inputs are scalars, so they are already read before
39
+ * anything is written.
40
+ *
41
+ * @param {number[]|Float32Array|Float64Array} output where to write the result
42
+ * @param {number} output_offset where to start writing
43
+ * @param {number} output_stride step between result values, useful when working in higher dimensions. Typically, this will be 1.
44
+ * @param {number} p0x
45
+ * @param {number} p0y
46
+ * @param {number} p0z
47
+ * @param {number} p1x
48
+ * @param {number} p1y
49
+ * @param {number} p1z
50
+ * @param {number} m0x tangent at p0
51
+ * @param {number} m0y tangent at p0
52
+ * @param {number} m0z tangent at p0
53
+ * @param {number} m1x tangent at p1
54
+ * @param {number} m1y tangent at p1
55
+ * @param {number} m1z tangent at p1
56
+ * @param {number[]|Float32Array|Float64Array} m4 column-major affine 4x4 matrix
57
+ * @author Alex Goldring
58
+ * @copyright Company Named Limited (c) 2026
59
+ */
60
+ export function spline3_hermite_apply_transform(
61
+ output,
62
+ output_offset,
63
+ output_stride,
64
+ p0x, p0y, p0z,
65
+ p1x, p1y, p1z,
66
+ m0x, m0y, m0z,
67
+ m1x, m1y, m1z,
68
+ m4
69
+ ) {
70
+ assert.isNonNegativeInteger(output_offset, 'output_offset');
71
+ assert.isNonNegativeInteger(output_stride, 'output_stride');
72
+ assert.greaterThanOrEqual(output_stride, 1, 'output_stride must be at least 1');
73
+
74
+ // Tolerance, not equality: an affine matrix that has been through
75
+ // m4_invert or a chain of m4_multiply comes back with a perspective row
76
+ // that is affine to rounding rather than exactly so. Measured, 37% of
77
+ // Float64Array inverses of a random affine matrix land on
78
+ // `m4[15] = 1 ± 1e-13`; meep's own Float32Array matrices snap back to
79
+ // exactly 1, which is why the spec's fixtures did not catch this.
80
+ assert.ok(Math.abs(m4[3]) <= AFFINE_EPSILON, 'm4[3] must be 0, matrix must be affine');
81
+ assert.ok(Math.abs(m4[7]) <= AFFINE_EPSILON, 'm4[7] must be 0, matrix must be affine');
82
+ assert.ok(Math.abs(m4[11]) <= AFFINE_EPSILON, 'm4[11] must be 0, matrix must be affine');
83
+ assert.ok(Math.abs(m4[15] - 1) <= AFFINE_EPSILON, 'm4[15] must be 1, matrix must be affine');
84
+
85
+ const a0 = m4[0], a1 = m4[1], a2 = m4[2];
86
+ const b0 = m4[4], b1 = m4[5], b2 = m4[6];
87
+ const c0 = m4[8], c1 = m4[9], c2 = m4[10];
88
+ const tx = m4[12], ty = m4[13], tz = m4[14];
89
+
90
+ // endpoints: homogeneous points, translation column included
91
+ output[output_offset] = a0 * p0x + b0 * p0y + c0 * p0z + tx;
92
+ output[output_offset + output_stride] = a1 * p0x + b1 * p0y + c1 * p0z + ty;
93
+ output[output_offset + output_stride * 2] = a2 * p0x + b2 * p0y + c2 * p0z + tz;
94
+
95
+ output[output_offset + output_stride * 3] = a0 * p1x + b0 * p1y + c0 * p1z + tx;
96
+ output[output_offset + output_stride * 4] = a1 * p1x + b1 * p1y + c1 * p1z + ty;
97
+ output[output_offset + output_stride * 5] = a2 * p1x + b2 * p1y + c2 * p1z + tz;
98
+
99
+ // tangents: directions, translation column dropped, magnitude preserved
100
+ output[output_offset + output_stride * 6] = a0 * m0x + b0 * m0y + c0 * m0z;
101
+ output[output_offset + output_stride * 7] = a1 * m0x + b1 * m0y + c1 * m0z;
102
+ output[output_offset + output_stride * 8] = a2 * m0x + b2 * m0y + c2 * m0z;
103
+
104
+ output[output_offset + output_stride * 9] = a0 * m1x + b0 * m1y + c0 * m1z;
105
+ output[output_offset + output_stride * 10] = a1 * m1x + b1 * m1y + c1 * m1z;
106
+ output[output_offset + output_stride * 11] = a2 * m1x + b2 * m1y + c2 * m1z;
107
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Reverse the parameterisation of a cubic Hermite segment: writes the curve
3
+ * `R(u) = H(1 - u)`, which traces exactly the same points in the opposite
4
+ * direction.
5
+ *
6
+ * The result is written in the same `[p0, p1, m0, m1]` order every other
7
+ * `spline3_hermite_*` function uses, note the stride and offset.
8
+ *
9
+ * Reversal negates the tangents as well as swapping the endpoints. From
10
+ * `R'(u) = -H'(1 - u)` we get `R'(0) = -H'(1) = -m1` and `R'(1) = -H'(0) = -m0`,
11
+ * so the result is `[p1, p0, -m1, -m0]`. Writing `[p1, p0, m1, m0]` without the
12
+ * sign flip is the classic mistake: it yields a curve through the same two
13
+ * endpoints that bulges the wrong way, which is easy to miss on a nearly
14
+ * straight segment and obvious on a curved one.
15
+ *
16
+ * Exact — every output is an input or an input with its sign flipped, so there
17
+ * is no rounding, and reversing twice returns the original four values.
18
+ *
19
+ * Safe to use in place: the inputs are scalars, so they are already read before
20
+ * anything is written. `output` may be the very array the values came from,
21
+ * at the same offset.
22
+ *
23
+ * @param {number[]|Float32Array|Float64Array} output where to write the result
24
+ * @param {number} output_offset where to start writing
25
+ * @param {number} output_stride step between result values, useful when working in higher dimensions. Typically, this will be 1.
26
+ * @param {number} p0
27
+ * @param {number} p1
28
+ * @param {number} m0 tangent at p0
29
+ * @param {number} m1 tangent at p1
30
+ * @author Alex Goldring
31
+ * @copyright Company Named Limited (c) 2026
32
+ */
33
+ export function spline3_hermite_reverse(output: number[] | Float32Array | Float64Array, output_offset: number, output_stride: number, p0: number, p1: number, m0: number, m1: number): void;
34
+ //# sourceMappingURL=spline3_hermite_reverse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spline3_hermite_reverse.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/spline/spline3_hermite_reverse.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,gDAVW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,iBACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAkBhB"}
@@ -0,0 +1,49 @@
1
+ import { assert } from "../../assert.js";
2
+
3
+ /**
4
+ * Reverse the parameterisation of a cubic Hermite segment: writes the curve
5
+ * `R(u) = H(1 - u)`, which traces exactly the same points in the opposite
6
+ * direction.
7
+ *
8
+ * The result is written in the same `[p0, p1, m0, m1]` order every other
9
+ * `spline3_hermite_*` function uses, note the stride and offset.
10
+ *
11
+ * Reversal negates the tangents as well as swapping the endpoints. From
12
+ * `R'(u) = -H'(1 - u)` we get `R'(0) = -H'(1) = -m1` and `R'(1) = -H'(0) = -m0`,
13
+ * so the result is `[p1, p0, -m1, -m0]`. Writing `[p1, p0, m1, m0]` without the
14
+ * sign flip is the classic mistake: it yields a curve through the same two
15
+ * endpoints that bulges the wrong way, which is easy to miss on a nearly
16
+ * straight segment and obvious on a curved one.
17
+ *
18
+ * Exact — every output is an input or an input with its sign flipped, so there
19
+ * is no rounding, and reversing twice returns the original four values.
20
+ *
21
+ * Safe to use in place: the inputs are scalars, so they are already read before
22
+ * anything is written. `output` may be the very array the values came from,
23
+ * at the same offset.
24
+ *
25
+ * @param {number[]|Float32Array|Float64Array} output where to write the result
26
+ * @param {number} output_offset where to start writing
27
+ * @param {number} output_stride step between result values, useful when working in higher dimensions. Typically, this will be 1.
28
+ * @param {number} p0
29
+ * @param {number} p1
30
+ * @param {number} m0 tangent at p0
31
+ * @param {number} m1 tangent at p1
32
+ * @author Alex Goldring
33
+ * @copyright Company Named Limited (c) 2026
34
+ */
35
+ export function spline3_hermite_reverse(
36
+ output,
37
+ output_offset,
38
+ output_stride,
39
+ p0, p1, m0, m1
40
+ ) {
41
+ assert.isNonNegativeInteger(output_offset, 'output_offset');
42
+ assert.isNonNegativeInteger(output_stride, 'output_stride');
43
+ assert.greaterThanOrEqual(output_stride, 1, 'output_stride must be at least 1');
44
+
45
+ output[output_offset] = p1;
46
+ output[output_offset + output_stride] = p0;
47
+ output[output_offset + output_stride * 2] = -m1;
48
+ output[output_offset + output_stride * 3] = -m0;
49
+ }
@@ -1,9 +1,22 @@
1
1
  /**
2
- * Low discrepancy sequence
2
+ * Second coordinate of the Hammersley set: the van der Corput radical inverse
3
+ * of `i` in base `R`.
4
+ *
5
+ * Computed in closed form, as {@link halton_sequence} does. The previous
6
+ * incremental formulation restarted from zero and applied `i` successive
7
+ * additions, so for any base whose reciprocal is not exactly representable --
8
+ * base 3 among them -- rounding accumulated until the comparisons inside it
9
+ * stopped agreeing with exact arithmetic and the sequence collapsed onto a
10
+ * short cycle. It was also O(i) per element, and therefore quadratic to
11
+ * enumerate; this is O(log i).
12
+ *
13
+ * The radical inverse does not depend on the size of the set, so the `count`
14
+ * parameter this used to take is gone: the first Hammersley coordinate is
15
+ * `i / count` and belongs to the caller. It was never read by the body.
16
+ *
3
17
  * @param {number} i index of sequence element
4
18
  * @param {number} R a prime number
5
- * @param {number} count how many elements in the sequence
6
- * @returns {number}
19
+ * @returns {number} value in [0,1)
7
20
  */
8
- export function hammersley_sequence(i: number, R: number, count: number): number;
21
+ export function hammersley_sequence(i: number, R: number): number;
9
22
  //# sourceMappingURL=hammersley_sequence.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hammersley_sequence.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/statistics/hammersley_sequence.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,uCALW,MAAM,KACN,MAAM,SACN,MAAM,GACJ,MAAM,CAkBlB"}
1
+ {"version":3,"file":"hammersley_sequence.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/statistics/hammersley_sequence.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,uCAJW,MAAM,KACN,MAAM,GACJ,MAAM,CAelB"}
@@ -1,25 +1,34 @@
1
1
  /**
2
- * Low discrepancy sequence
2
+ * Second coordinate of the Hammersley set: the van der Corput radical inverse
3
+ * of `i` in base `R`.
4
+ *
5
+ * Computed in closed form, as {@link halton_sequence} does. The previous
6
+ * incremental formulation restarted from zero and applied `i` successive
7
+ * additions, so for any base whose reciprocal is not exactly representable --
8
+ * base 3 among them -- rounding accumulated until the comparisons inside it
9
+ * stopped agreeing with exact arithmetic and the sequence collapsed onto a
10
+ * short cycle. It was also O(i) per element, and therefore quadratic to
11
+ * enumerate; this is O(log i).
12
+ *
13
+ * The radical inverse does not depend on the size of the set, so the `count`
14
+ * parameter this used to take is gone: the first Hammersley coordinate is
15
+ * `i / count` and belongs to the caller. It was never read by the body.
16
+ *
3
17
  * @param {number} i index of sequence element
4
18
  * @param {number} R a prime number
5
- * @param {number} count how many elements in the sequence
6
- * @returns {number}
19
+ * @returns {number} value in [0,1)
7
20
  */
8
- export function hammersley_sequence(i, R, count) {
21
+ export function hammersley_sequence(i, R) {
9
22
 
10
- let t = i / count;
23
+ let result = 0;
24
+ let f = 1;
25
+ let n = i;
11
26
 
12
- for (let j = 0; j < i; j++) {
13
- const x = 1 - t;
14
- let y = 1 / R;
15
-
16
- while (x <= y) {
17
- y = y / R;
18
- }
19
-
20
- t += (R + 1) * y - 1;
27
+ while (n > 0) {
28
+ f = f / R;
29
+ result = result + f * (n % R);
30
+ n = (n / R) >>> 0;
21
31
  }
22
32
 
23
- return t;
33
+ return result;
24
34
  }
25
-
@@ -1 +1 @@
1
- {"version":3,"file":"Future.d.ts","sourceRoot":"","sources":["../../../../src/core/process/Future.js"],"names":[],"mappings":"2BAEU,MAAM;;;;;;;;AAiBhB;IACI;;;;;;OAMG;IACH,2BASC;IARG,cAAwB;IACxB,cAAiC;IAEjC,0BAA4B;IAC5B,qBAA2B;IAE3B,2BAA6B;IAC7B,mBAAyB;IAG7B;;;;OAIG;IACH,0BAQC;IAED;;;OAGG;IACH,yBAGC;IAED;;;OAGG;IACH,2BAWC;IAED,gBAmBC;IAED;;;;OAIG;IACH,iGAeC;IAED;;;OAGG;IACH,yCAMC;CACJ"}
1
+ {"version":3,"file":"Future.d.ts","sourceRoot":"","sources":["../../../../src/core/process/Future.js"],"names":[],"mappings":"2BAEU,MAAM;;;;;;;;AAiBhB;IACI;;;;;;OAMG;IACH,2BASC;IARG,cAAwB;IACxB,cAAiC;IAEjC,0BAA4B;IAC5B,qBAA2B;IAE3B,2BAA6B;IAC7B,mBAAyB;IAG7B;;;;OAIG;IACH,0BAaC;IAED;;;OAGG;IACH,yBAGC;IAED;;;OAGG;IACH,2BAkBC;IAED,gBAmBC;IAED;;;;OAIG;IACH,iGAeC;IAED;;;OAGG;IACH,yCAMC;CACJ"}
@@ -42,6 +42,11 @@ class Future {
42
42
  * @private
43
43
  */
44
44
  __handleRejection(reason) {
45
+ if (this.state !== FutureStates.PENDING) {
46
+ // already settled; first settlement wins, as with a Promise
47
+ return;
48
+ }
49
+
45
50
  this.state = FutureStates.REJECTED;
46
51
  this.rejectionReason = reason;
47
52
  fastForEach(this.callbacksRejection, function (cb) {
@@ -65,6 +70,13 @@ class Future {
65
70
  * @private
66
71
  */
67
72
  __handleResolution(v) {
73
+ if (this.state !== FutureStates.PENDING) {
74
+ // already settled; without this a resolver that rejects and then
75
+ // resolves flips a rejected future to resolved, and its rejection
76
+ // handlers have already run
77
+ return;
78
+ }
79
+
68
80
  this.state = FutureStates.RESOLVED;
69
81
 
70
82
  this.resolvedValue = v;
@@ -1 +1 @@
1
- {"version":3,"file":"PromiseWatcher.d.ts","sourceRoot":"","sources":["../../../../src/core/process/PromiseWatcher.js"],"names":[],"mappings":"AAGA;IAEQ;;;OAGG;IACH,YAFU,kBAAa,CAEK;IAE5B;;;OAGG;IACH,iBAFU,OAAO,CAEoB;IAMzC;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,sBAEC;IAED;;;OAGG;IACH,iCAMC;CACJ;iBAhDgB,4BAA4B;oBACzB,oBAAoB"}
1
+ {"version":3,"file":"PromiseWatcher.d.ts","sourceRoot":"","sources":["../../../../src/core/process/PromiseWatcher.js"],"names":[],"mappings":"AAGA;IAEQ;;;OAGG;IACH,YAFU,kBAAa,CAEK;IAE5B;;;OAGG;IACH,iBAFU,OAAO,CAEoB;IAMzC;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,sBAEC;IAED;;;OAGG;IACH,iCAaC;CACJ;iBAvDgB,4BAA4B;oBACzB,oBAAoB"}
@@ -42,8 +42,15 @@ export class PromiseWatcher {
42
42
  add(promise) {
43
43
  this.unresolved.add(promise);
44
44
 
45
- promise.finally(() => {
45
+ const settled = () => {
46
46
  this.unresolved.removeOneOf(promise);
47
- });
47
+ };
48
+
49
+ // `finally` returns a *new* promise that rejects with the same reason,
50
+ // and discarding it leaves that rejection unhandled -- which terminates
51
+ // the process under Node's default policy, even when the caller has
52
+ // attached its own catch to `promise`. Handling both outcomes here
53
+ // settles the derived promise instead of abandoning it.
54
+ promise.then(settled, settled);
48
55
  }
49
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ConcurrentExecutor.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/executor/ConcurrentExecutor.js"],"names":[],"mappings":";AAgBA;;GAEG;AACH;IAaI;;;;;OAKG;IACH,wBAJW,MAAM,aACN,MAAM,EAwChB;IApCG;;;OAGG;IACH,WAFU,MAAM,CAEU;IAC1B;;;OAGG;IACH,UAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,iBAFU,MAAM,CAES;IAEzB;;;OAGG;IACH,YAFU,MAAM,CAEI;IAEpB;;;;MAIC;IAED,cAAiB;IAEjB;;;OAGG;IACH,QAFU,MAAM,GAAC,gBAAgB,CAES;IAG9C;;;OAGG;IACH,qCAmEC;IAED;;;OAGG;IACH,oCAaC;IAED;;;;OAIG;IACH,wBAFY,OAAO,CAwBlB;IAED;;;OAGG;IACH,sBAGC;IAED;;;OAGG;IACH,eAFW,MAAM,QAMhB;IAED;;;;OAIG;IACH,kBAkCC;IAED;;OAEG;IACH,qBA+BC;IAED;;;;OAIG;IACH,sBAFa,OAAO,CAYnB;IAwLD;;;OAGG;IACH,aAQC;IAED,0BAMC;;CACJ;;;;mBAjgBkB,+BAA+B;wBAqgBxC,MAAM"}
1
+ {"version":3,"file":"ConcurrentExecutor.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/executor/ConcurrentExecutor.js"],"names":[],"mappings":";AAgBA;;GAEG;AACH;IAaI;;;;;OAKG;IACH,wBAJW,MAAM,aACN,MAAM,EAwChB;IApCG;;;OAGG;IACH,WAFU,MAAM,CAEU;IAC1B;;;OAGG;IACH,UAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,iBAFU,MAAM,CAES;IAEzB;;;OAGG;IACH,YAFU,MAAM,CAEI;IAEpB;;;;MAIC;IAED,cAAiB;IAEjB;;;OAGG;IACH,QAFU,MAAM,GAAC,gBAAgB,CAES;IAG9C;;;OAGG;IACH,qCAmEC;IAED;;;OAGG;IACH,oCAaC;IAED;;;;OAIG;IACH,wBAFY,OAAO,CAwBlB;IAED;;;OAGG;IACH,sBAGC;IAED;;;OAGG;IACH,eAFW,MAAM,QAMhB;IAED;;;;OAIG;IACH,kBAkCC;IAED;;OAEG;IACH,qBAyCC;IAED;;;;OAIG;IACH,sBAFa,OAAO,CAYnB;IAwLD;;;OAGG;IACH,aAQC;IAED,0BAMC;;CACJ;;;;mBA3gBkB,+BAA+B;wBA+gBxC,MAAM"}
@@ -285,8 +285,18 @@ class ConcurrentExecutor {
285
285
  break;
286
286
  case ResolutionType.FAILED:
287
287
  queueUnresolved.splice(i, 1);
288
- l--;
289
- i--;
288
+
289
+ // Dropping it from the queue is not enough: the task still
290
+ // has to reach a terminal state, or its promise never
291
+ // settles and everything awaiting it waits forever.
292
+ unresolvedTask.state.set(TaskState.FAILED);
293
+
294
+ // its own dependants are now resolvable too, and they may
295
+ // sit earlier in the queue, so rescan from the start the
296
+ // same way a READY transition does
297
+ i = -1;
298
+ l = queueUnresolved.length;
299
+
290
300
  break;
291
301
  }
292
302
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WorkerProxy.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/WorkerProxy.js"],"names":[],"mappings":"2BAIU,MAAM;AADhB;;GAEG;AACH;;;;GAIG;;AAqCH;IA4CI;;;;OAIG;IACH,iBAHW,MAAM,gBAQhB;IApDD;;;;OAIG;IACH,kBAAe;IAEf;;;OAGG;IACH,iBAAgC;IAEhC;;;;OAIG;IACH,kBAAiB;IAEjB;;;;OAIG;IACH,iBAAgB;IAEhB;;;;OAIG;IACH,qBAAiB;IAEjB;;;;;OAKG;IACH,eAAiB;IAQb,YAAc;IACd,aAAsB;IAK1B;;;;;;OAMG;IACH,wBAJW,MAAM,2BAsDhB;IAED;;;;OAIG;IACH,qBAgBC;IAED;;;OAGG;IACH,sBAQC;IAED;;;;OAIG;IACH,wBAqCC;IAED,qBAEC;IAED;;OAEG;IACH,aAFa,YAAY,CAIxB;IAED;;;;OAIG;IACH,aAMC;IAED;;;;;OAKG;IACH,kBAJW,MAAM,eACN,MAAM,GACJ,OAAO,CAkCnB;IAED,4BAmBC;IAED;;;;;;OAMG;IACH,cAqBC;IAED;;;;;;;OAOG;IACH,sBAmBC;IAED;;;OAGG;IACH,yBAaC;CACJ"}
1
+ {"version":3,"file":"WorkerProxy.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/WorkerProxy.js"],"names":[],"mappings":"2BAIU,MAAM;AADhB;;GAEG;AACH;;;;GAIG;;AAqCH;IA4CI;;;;OAIG;IACH,iBAHW,MAAM,gBAQhB;IApDD;;;;OAIG;IACH,kBAAe;IAEf;;;OAGG;IACH,iBAAgC;IAEhC;;;;OAIG;IACH,kBAAiB;IAEjB;;;;OAIG;IACH,iBAAgB;IAEhB;;;;OAIG;IACH,qBAAiB;IAEjB;;;;;OAKG;IACH,eAAiB;IAQb,YAAc;IACd,aAAsB;IAK1B;;;;;;OAMG;IACH,wBAJW,MAAM,2BAyDhB;IAED;;;;OAIG;IACH,qBAgBC;IAED;;;OAGG;IACH,sBAQC;IAED;;;;OAIG;IACH,wBAqCC;IAED,qBAEC;IAED;;OAEG;IACH,aAFa,YAAY,CAIxB;IAED;;;;OAIG;IACH,aAMC;IAED;;;;;OAKG;IACH,kBAJW,MAAM,eACN,MAAM,GACJ,OAAO,CAkCnB;IAED,4BAmBC;IAED;;;;;;OAMG;IACH,cAqBC;IAED;;;;;;;OAOG;IACH,sBAmBC;IAED;;;OAGG;IACH,yBAaC;CACJ"}
@@ -152,9 +152,12 @@ class WorkerProxy {
152
152
  };
153
153
 
154
154
  if (!trySendMessage(this.__worker, message)) {
155
- // failed to send the message
156
- // drop the pending request
155
+ // failed to send the message. Dropping the pending request
156
+ // is not enough: nothing will ever resolve or reject it, so
157
+ // the caller waits forever.
157
158
  array_remove_first(pending, request);
159
+
160
+ reject(new Error(`Failed to send message for method '${name}' to worker`));
158
161
  }
159
162
  }
160
163
  });
@@ -1 +1 @@
1
- {"version":3,"file":"extractTransferables.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/extractTransferables.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,iEAHa,MAAM,CAqClB"}
1
+ {"version":3,"file":"extractTransferables.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/extractTransferables.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,iEAHa,MAAM,CAwClB"}
@@ -11,8 +11,11 @@ import { isImageBitmap } from "../../dom/isImageBitmap.js";
11
11
  export function extractTransferables(value, result) {
12
12
  let count = 0;
13
13
 
14
- if (typeof value !== "object") {
14
+ if (value === null || typeof value !== "object") {
15
15
 
16
+ // null is typeof "object", and reaching the `value.buffer` branch with
17
+ // it throws. The inlined copy of this walk in WorkerBuilder already
18
+ // guards for it.
16
19
  // not an object, skip
17
20
 
18
21
  } else if (value instanceof ArrayBuffer) {
@@ -10,6 +10,16 @@ declare class Engine {
10
10
  * @constructor
11
11
  */
12
12
  constructor(platform: EnginePlatform, { entityManager, enableGraphics, enableAudio, debug }?: EntityManager);
13
+ /**
14
+ * Absent when the engine is constructed with `enableGraphics: false`.
15
+ * @type {GraphicsEngine|null}
16
+ */
17
+ graphics: GraphicsEngine | null;
18
+ /**
19
+ * Absent when the engine is constructed with `enableAudio: false`.
20
+ * @type {SoundEngine|null}
21
+ */
22
+ sound: SoundEngine | null;
13
23
  viewStack: ViewStack;
14
24
  /**
15
25
  *
@@ -84,16 +94,6 @@ declare class Engine {
84
94
  storage: Storage;
85
95
  localization: Localization;
86
96
  camera: ThreePerspectiveCamera;
87
- /**
88
- *
89
- * @type {GraphicsEngine}
90
- */
91
- graphics: GraphicsEngine;
92
- /**
93
- *
94
- * @type {SoundEngine}
95
- */
96
- sound: SoundEngine;
97
97
  /**
98
98
  * Graphical User Interface engine
99
99
  * @type {GUIEngine}
@@ -145,6 +145,8 @@ declare class Engine {
145
145
  readonly isEngine: boolean;
146
146
  #private;
147
147
  }
148
+ import { GraphicsEngine } from './graphics/GraphicsEngine.js';
149
+ import SoundEngine from './sound/SoundEngine.js';
148
150
  import { ViewStack } from "../view/elements/navigation/ViewStack.js";
149
151
  import { StaticKnowledgeDatabase } from "./knowledge/database/StaticKnowledgeDatabase.js";
150
152
  import { EnginePluginManager } from "./plugin/EnginePluginManager.js";
@@ -163,8 +165,6 @@ declare class EngineSettings {
163
165
  }
164
166
  import { Localization } from "../core/localization/Localization.js";
165
167
  import { PerspectiveCamera as ThreePerspectiveCamera } from 'three';
166
- import { GraphicsEngine } from './graphics/GraphicsEngine.js';
167
- import SoundEngine from './sound/SoundEngine.js';
168
168
  import GUIEngine from './ui/GUIEngine.js';
169
169
  import SceneManager from "./scene/SceneManager.js";
170
170
  import { PointerDevice } from "./input/devices/PointerDevice.js";
@@ -1 +1 @@
1
- {"version":3,"file":"Engine.d.ts","sourceRoot":"","sources":["../../../src/engine/Engine.js"],"names":[],"mappings":";AA8CA;IAqCI;;;;;;;;OAQG;IACH,8FANW,aAAa,EAsOvB;IA3QD,qBAA4B;IAE5B;;;;;;;;;OASG;IACH,0BAFU,uBAAuB,CAEe;IAEhD;;;OAGG;IACH,kBAFU,mBAAmB,CAEO;IAEpC;;;;OAIG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,mBAFU,kBAAkB,CAEa;IAmBrC;;;OAGG;IACH,yBAAwB;IAKxB;;;OAGG;IACH,aAFU,gBAAgB,CAEe;IAGzC,yCAAkE;IAK9D,mBAAkC;IAMtC;;;OAGG;IACH,cAFU,aAAa,MAAM,CAAC,CAK5B;IAEF,8CAiCE;IA4BF;;;OAGG;IACH,SAFU,WAAW,CAEoB;IAEzC;;;OAGG;IACH,oCAA0C;IAE1C;;;OAGG;IACH,sCAFU,2BAA2B,CAE+B;IAEpE,yBAAoC;IAGpC;;OAEG;IACH,aAAkB;IAElB;;;OAGG;IACH,SAFU,OAAO,CAEwB;IAGzC,2BAAsC;IAOtC,+BAA6E;IAUzE;;;OAGG;IACH,UAFU,cAAc,CAEM;IAiB9B;;;OAGG;IACH,OAFU,WAAW,CAEG;IAK5B;;;OAGG;IACH,KAFU,SAAS,CAEO;IAE1B;;;OAGG;IACH,uBAFU,YAAY,CAEqD;IAI3E;;;;MAIC;IAaD;;;OAGG;IACH,kBAFU,OAAO,CAEW;IAsBhC,wBAgCC;IApBG,oBAAwB;IAsB5B,2BAgCC;IAED,oBAiBC;IAED;;;OAGG;IACH,+CAUC;IAED,eAwBC;IAED;;;OAGG;IACH,sBA0CC;IAqBD;;OAEG;IACH,sBAqBC;IAED,aAEC;IAED;;OAEG;IACH,4BAOC;IAIL;;;OAGG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;0BA/iByB,0CAA0C;wCAa5B,iDAAiD;oCAGrD,iCAAiC;mBAElD,wBAAwB;+BApBZ,gDAAgD;iCAM9C,+CAA+C;6BAFnD,yBAAyB;uCAIf,6DAA6D;4BASxE,0BAA0B;+BAnBvB,iCAAiC;4CAYpB,qDAAqD;AAgBjG;IACI,gDAA2D;IAC3D,0BAAkC;IAClC,iCAAyC;CAC5C;6BAjC4B,sCAAsC;4DAHP,OAAO;+BAiBpC,8BAA8B;wBAUrC,wBAAwB;sBAE1B,mBAAmB;yBAJhB,yBAAyB;8BALpB,kCAAkC;2BADrC,mCAAmC;8BADhC,kCAAkC;sBAX1C,+BAA+B;+BAItB,qCAAqC;8BAItC,wBAAwB;4BAV1B,kCAAkC;oBAH1C,yBAAyB"}
1
+ {"version":3,"file":"Engine.d.ts","sourceRoot":"","sources":["../../../src/engine/Engine.js"],"names":[],"mappings":";AAuDA;IAoEI;;;;;;;;OAQG;IACH,8FANW,aAAa,EA0OvB;IA3RD;;;OAGG;IACH,UAFU,cAAc,GAAC,IAAI,CAEb;IAEhB;;;OAGG;IACH,OAFU,WAAW,GAAC,IAAI,CAEb;IAEb,qBAA4B;IAE5B;;;;;;;;;OASG;IACH,0BAFU,uBAAuB,CAEe;IAEhD;;;OAGG;IACH,kBAFU,mBAAmB,CAEO;IAEpC;;;;OAIG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,mBAFU,kBAAkB,CAEa;IAmBrC;;;OAGG;IACH,yBAAwB;IAKxB;;;OAGG;IACH,aAFU,gBAAgB,CAEe;IAGzC,yCAAkE;IAK9D,mBAAkC;IAMtC;;;OAGG;IACH,cAFU,aAAa,MAAM,CAAC,CAK5B;IAEF,8CAiCE;IA4BF;;;OAGG;IACH,SAFU,WAAW,CAEoB;IAEzC;;;OAGG;IACH,oCAA0C;IAE1C;;;OAGG;IACH,sCAFU,2BAA2B,CAE+B;IAEpE,yBAAoC;IAGpC;;OAEG;IACH,aAAkB;IAElB;;;OAGG;IACH,SAFU,OAAO,CAEwB;IAGzC,2BAAsC;IAOtC,+BAA6E;IA4C7E;;;OAGG;IACH,KAFU,SAAS,CAEO;IAE1B;;;OAGG;IACH,uBAFU,YAAY,CAEqD;IAI3E;;;;MAIC;IAaD;;;OAGG;IACH,kBAFU,OAAO,CAEW;IAiGhC,wBAgCC;IApBG,oBAAwB;IAsB5B,2BAgCC;IAED,oBAiBC;IAED;;;OAGG;IACH,+CAUC;IAED,eA6BC;IAED;;;OAGG;IACH,sBAmDC;IAqBD;;OAEG;IACH,sBA2BC;IAED,aAEC;IAED;;OAEG;IACH,4BAOC;IAIL;;;OAGG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;+BAhrB8B,8BAA8B;wBAUrC,wBAAwB;0BApBtB,0CAA0C;wCAc5B,iDAAiD;oCAGrD,iCAAiC;mBAElD,wBAAwB;+BArBZ,gDAAgD;iCAO9C,+CAA+C;6BAFnD,yBAAyB;uCAIf,6DAA6D;4BASxE,0BAA0B;+BApBvB,iCAAiC;4CAapB,qDAAqD;AAgBjG;IACI,gDAA2D;IAC3D,0BAAkC;IAClC,iCAAyC;CAC5C;6BAlC4B,sCAAsC;4DAHP,OAAO;sBA8B7C,mBAAmB;yBAJhB,yBAAyB;8BALpB,kCAAkC;2BADrC,mCAAmC;8BADhC,kCAAkC;sBAZ1C,+BAA+B;+BAKtB,qCAAqC;8BAItC,wBAAwB;4BAX1B,kCAAkC;oBAH1C,yBAAyB"}