@woosh/meep-engine 2.155.0 → 2.156.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 (475) hide show
  1. package/README.md +1 -1
  2. package/build/bundle-worker-image-decoder.js +1 -1
  3. package/build/bundle-worker-terrain.js +1 -1
  4. package/editor/view/ecs/ComponentControlView.d.ts +0 -9
  5. package/editor/view/ecs/ComponentControlView.js +2 -98
  6. package/package.json +1 -1
  7. package/src/core/binary/32BitEncoder.js +1 -1
  8. package/src/core/binary/to_half_float_uint16.js +3 -3
  9. package/src/core/bvh2/bvh3/ebvh_build_hierarchy_radix.d.ts.map +1 -1
  10. package/src/core/bvh2/bvh3/ebvh_build_hierarchy_radix.js +275 -253
  11. package/src/core/cache/Cache.d.ts.map +1 -1
  12. package/src/core/cache/Cache.js +7 -0
  13. package/src/core/cache/FrequencySketch.d.ts.map +1 -1
  14. package/src/core/cache/FrequencySketch.js +8 -4
  15. package/src/core/clipboard/obtainClipBoard.d.ts +6 -0
  16. package/src/core/clipboard/obtainClipBoard.d.ts.map +1 -0
  17. package/src/core/clipboard/obtainClipBoard.js +29 -0
  18. package/src/core/clipboard/safeClipboardReadText.d.ts +6 -0
  19. package/src/core/clipboard/safeClipboardReadText.d.ts.map +1 -0
  20. package/src/core/clipboard/safeClipboardReadText.js +55 -0
  21. package/src/core/clipboard/safeClipboardWriteText.d.ts +8 -0
  22. package/src/core/clipboard/safeClipboardWriteText.d.ts.map +1 -0
  23. package/src/core/clipboard/safeClipboardWriteText.js +23 -0
  24. package/src/core/collection/array/array_quick_sort_by_lookup_map.js +1 -1
  25. package/src/core/collection/array/array_set_diff_sorting.d.ts.map +1 -1
  26. package/src/core/collection/array/array_set_diff_sorting.js +4 -1
  27. package/src/core/collection/array/array_shuffle.d.ts.map +1 -1
  28. package/src/core/collection/array/array_shuffle.js +30 -27
  29. package/src/core/collection/array/binarySearchLowIndex.d.ts.map +1 -1
  30. package/src/core/collection/array/binarySearchLowIndex.js +4 -3
  31. package/src/core/collection/array/typed/array_buffer_hash.js +1 -1
  32. package/src/core/collection/array/typed/is_typed_array_equals.d.ts.map +1 -1
  33. package/src/core/collection/array/typed/is_typed_array_equals.js +12 -2
  34. package/src/core/collection/heap/BinaryHeap.d.ts.map +1 -1
  35. package/src/core/collection/heap/BinaryHeap.js +12 -2
  36. package/src/core/collection/queue/Deque.d.ts.map +1 -1
  37. package/src/core/collection/queue/Deque.js +10 -8
  38. package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
  39. package/src/core/collection/table/RowFirstTable.js +4 -2
  40. package/src/core/collection/table/RowFirstTableSpec.js +2 -2
  41. package/src/core/color/operations/color_lerp.d.ts.map +1 -1
  42. package/src/core/color/operations/color_lerp.js +10 -3
  43. package/src/core/color/rgb2uint32.js +1 -1
  44. package/src/core/color/rgbe9995_to_rgb.js +1 -1
  45. package/src/core/function/objectsEqual.d.ts.map +1 -1
  46. package/src/core/function/objectsEqual.js +2 -1
  47. package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
  48. package/src/core/geom/2d/aabb/AABB2.js +12 -11
  49. package/src/core/geom/2d/convex-hull/convex_hull_jarvis_2d.d.ts.map +1 -1
  50. package/src/core/geom/2d/convex-hull/convex_hull_jarvis_2d.js +30 -4
  51. package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.d.ts.map +1 -1
  52. package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.js +6 -2
  53. package/src/core/geom/2d/hash-grid/SpatialHashGrid.d.ts.map +1 -1
  54. package/src/core/geom/2d/hash-grid/SpatialHashGrid.js +388 -386
  55. package/src/core/geom/2d/hash-grid/shg_query_elements_line.d.ts.map +1 -1
  56. package/src/core/geom/2d/hash-grid/shg_query_elements_line.js +8 -3
  57. package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts.map +1 -1
  58. package/src/core/geom/2d/quad-tree/QuadTreeDatum.js +9 -1
  59. package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.d.ts +3 -1
  60. package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.d.ts.map +1 -1
  61. package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.js +3 -1
  62. package/src/core/geom/2d/quad-tree-binary/QuadTree.js +714 -714
  63. package/src/core/geom/2d/r-tree/StaticR2Tree.d.ts.map +1 -1
  64. package/src/core/geom/2d/r-tree/StaticR2Tree.js +5 -4
  65. package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.d.ts.map +1 -1
  66. package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.js +33 -29
  67. package/src/core/geom/3d/aabb/aabb3_near_distance_to_intersection_ray_segment.d.ts.map +1 -1
  68. package/src/core/geom/3d/aabb/aabb3_near_distance_to_intersection_ray_segment.js +3 -1
  69. package/src/core/geom/3d/aabb/aabb3_signed_distance_to_aabb3.d.ts.map +1 -1
  70. package/src/core/geom/3d/aabb/aabb3_signed_distance_to_aabb3.js +10 -7
  71. package/src/core/geom/3d/aabb/aabb3_transformed_compute_plane_side.d.ts.map +1 -1
  72. package/src/core/geom/3d/aabb/aabb3_transformed_compute_plane_side.js +30 -9
  73. package/src/core/geom/3d/aabb/compute_aabb_from_points.js +3 -3
  74. package/src/core/geom/3d/box/box3_raycast.d.ts +37 -0
  75. package/src/core/geom/3d/box/box3_raycast.d.ts.map +1 -0
  76. package/src/core/geom/3d/box/box3_raycast.js +81 -0
  77. package/src/core/geom/3d/capsule/capsule_raycast.d.ts +35 -0
  78. package/src/core/geom/3d/capsule/capsule_raycast.d.ts.map +1 -0
  79. package/src/core/geom/3d/capsule/capsule_raycast.js +93 -0
  80. package/src/core/geom/3d/cone/compute_bounding_cone_of_2_cones.d.ts.map +1 -1
  81. package/src/core/geom/3d/cone/compute_bounding_cone_of_2_cones.js +4 -0
  82. package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +1 -1
  83. package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.d.ts.map +1 -1
  84. package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.js +3 -2
  85. package/src/core/geom/3d/mat4/decompose_matrix_4_array.d.ts.map +1 -1
  86. package/src/core/geom/3d/mat4/decompose_matrix_4_array.js +12 -2
  87. package/src/core/geom/3d/mat4/eulerAnglesFromMatrix.js +2 -2
  88. package/src/core/geom/3d/mat4/m4_multiply_alphatensor.d.ts +1 -1
  89. package/src/core/geom/3d/mat4/m4_multiply_alphatensor.d.ts.map +1 -1
  90. package/src/core/geom/3d/mat4/m4_multiply_alphatensor.js +19 -13
  91. package/src/core/geom/3d/octahedra/octahedral_direction_to_uv.d.ts.map +1 -1
  92. package/src/core/geom/3d/octahedra/octahedral_direction_to_uv.js +3 -2
  93. package/src/core/geom/3d/plane/plane3_compute_plane_intersection.js +3 -2
  94. package/src/core/geom/3d/shape/MeshShape3D.d.ts.map +1 -1
  95. package/src/core/geom/3d/shape/MeshShape3D.js +7 -0
  96. package/src/core/geom/3d/shape/UnionShape3D.d.ts.map +1 -1
  97. package/src/core/geom/3d/shape/UnionShape3D.js +3 -2
  98. package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts.map +1 -1
  99. package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.js +153 -148
  100. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts.map +1 -1
  101. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +7 -0
  102. package/src/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.d.ts.map +1 -1
  103. package/src/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.js +13 -10
  104. package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.d.ts +1 -1
  105. package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.js +2 -2
  106. package/src/core/geom/3d/sphere/sphere_raycast.d.ts +33 -0
  107. package/src/core/geom/3d/sphere/sphere_raycast.d.ts.map +1 -0
  108. package/src/core/geom/3d/sphere/sphere_raycast.js +47 -0
  109. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.d.ts +24 -0
  110. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.d.ts.map +1 -0
  111. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.js +39 -0
  112. package/src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.d.ts.map +1 -1
  113. package/src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.js +4 -2
  114. package/src/core/geom/3d/topology/bounds/computeTriangleClusterNormalBoundingCone.js +3 -3
  115. package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.js +1 -1
  116. package/src/core/geom/3d/topology/tm_vertex_compute_normal.d.ts.map +1 -1
  117. package/src/core/geom/3d/topology/tm_vertex_compute_normal.js +4 -2
  118. package/src/core/geom/3d/util/make_justified_point_grid.d.ts.map +1 -1
  119. package/src/core/geom/3d/util/make_justified_point_grid.js +18 -10
  120. package/src/core/geom/ConicRay.d.ts.map +1 -1
  121. package/src/core/geom/ConicRay.js +11 -13
  122. package/src/core/geom/packing/max-rect/removeRedundantBoxes.d.ts.map +1 -1
  123. package/src/core/geom/packing/max-rect/removeRedundantBoxes.js +19 -4
  124. package/src/core/geom/vec3/v3_orthonormal_matrix_from_normal.d.ts.map +1 -0
  125. package/src/{engine/graphics/sh3/path_tracer/sampling → core/geom/vec3}/v3_orthonormal_matrix_from_normal.js +1 -1
  126. package/src/core/graph/coloring/colorizeGraph.js +2 -2
  127. package/src/core/graph/csr/CSRGraph.d.ts.map +1 -1
  128. package/src/core/graph/csr/CSRGraph.js +325 -319
  129. package/src/core/graph/layout/CircleLayout.d.ts.map +1 -1
  130. package/src/core/graph/layout/CircleLayout.js +8 -6
  131. package/src/core/graph/metis/native/refine/compute_kway_params.d.ts.map +1 -1
  132. package/src/core/graph/metis/native/refine/compute_kway_params.js +139 -138
  133. package/src/core/graph/mn_graph_coarsen.d.ts.map +1 -1
  134. package/src/core/graph/mn_graph_coarsen.js +4 -2
  135. package/src/core/graph/v2/NodeContainer.js +7 -7
  136. package/src/core/localization/LocalizationEngine.js +1 -1
  137. package/src/core/math/bell_membership_function.d.ts.map +1 -1
  138. package/src/core/math/bell_membership_function.js +3 -1
  139. package/src/core/math/complex/complex_add.d.ts +4 -4
  140. package/src/core/math/complex/complex_add.d.ts.map +1 -1
  141. package/src/core/math/complex/complex_add.js +3 -3
  142. package/src/core/math/complex/complex_div.d.ts +4 -4
  143. package/src/core/math/complex/complex_div.d.ts.map +1 -1
  144. package/src/core/math/complex/complex_div.js +3 -3
  145. package/src/core/math/complex/complex_mul.d.ts +4 -4
  146. package/src/core/math/complex/complex_mul.d.ts.map +1 -1
  147. package/src/core/math/complex/complex_mul.js +3 -3
  148. package/src/core/math/complex/complex_sub.d.ts +4 -4
  149. package/src/core/math/complex/complex_sub.d.ts.map +1 -1
  150. package/src/core/math/complex/complex_sub.js +3 -3
  151. package/src/core/math/idct_1d.d.ts +4 -4
  152. package/src/core/math/idct_1d.d.ts.map +1 -1
  153. package/src/core/math/idct_1d.js +3 -3
  154. package/src/core/math/noise/create_simplex_noise_2d.d.ts.map +1 -1
  155. package/src/core/math/noise/create_simplex_noise_2d.js +4 -2
  156. package/src/core/math/noise/sdnoise.d.ts.map +1 -1
  157. package/src/core/math/noise/sdnoise.js +12 -9
  158. package/src/core/math/physics/mie/compute_bhmie_optical_properties.d.ts.map +1 -1
  159. package/src/core/math/physics/mie/compute_bhmie_optical_properties.js +94 -50
  160. package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts +3 -6
  161. package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts.map +1 -1
  162. package/src/core/math/physics/mie/lorenz_mie_coefs.js +180 -157
  163. package/src/core/math/physics/mie/mie_ab_to_optical_properties.d.ts +3 -4
  164. package/src/core/math/physics/mie/mie_ab_to_optical_properties.d.ts.map +1 -1
  165. package/src/core/math/physics/mie/mie_ab_to_optical_properties.js +47 -21
  166. package/src/core/math/random/randomIntegerBetween.d.ts.map +1 -1
  167. package/src/core/math/random/randomIntegerBetween.js +4 -1
  168. package/src/core/math/solveCubic.d.ts.map +1 -1
  169. package/src/core/math/solveCubic.js +95 -82
  170. package/src/core/math/spline/computeCatmullRomSplineUniformDistance.d.ts.map +1 -1
  171. package/src/core/math/spline/computeCatmullRomSplineUniformDistance.js +13 -0
  172. package/src/core/math/statistics/softmax.js +1 -1
  173. package/src/core/model/node-graph/visual/NodeGraphVisualData.d.ts +1 -0
  174. package/src/core/model/node-graph/visual/NodeGraphVisualData.d.ts.map +1 -1
  175. package/src/core/model/node-graph/visual/NodeGraphVisualData.js +2 -1
  176. package/src/core/model/node-graph/visual/NodeVisualData.js +1 -1
  177. package/src/core/model/object/ImmutableObjectPool.d.ts +7 -0
  178. package/src/core/model/object/ImmutableObjectPool.d.ts.map +1 -1
  179. package/src/core/model/object/ImmutableObjectPool.js +20 -10
  180. package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.d.ts.map +1 -1
  181. package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.js +39 -2
  182. package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
  183. package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -0
  184. package/src/core/parser/simple/readHexToken.d.ts.map +1 -1
  185. package/src/core/parser/simple/readHexToken.js +6 -0
  186. package/src/core/primitives/numbers/number_pretty_print.d.ts.map +1 -1
  187. package/src/core/primitives/numbers/number_pretty_print.js +4 -1
  188. package/src/core/primitives/strings/string_jaro_winkler.js +1 -1
  189. package/src/core/process/CompositeProcess.js +1 -1
  190. package/src/core/process/action/AsynchronousDelayAction.d.ts.map +1 -1
  191. package/src/core/process/action/AsynchronousDelayAction.js +3 -0
  192. package/src/core/process/executor/ConcurrentExecutor.d.ts.map +1 -1
  193. package/src/core/process/executor/ConcurrentExecutor.js +3 -2
  194. package/src/core/process/task/util/randomCountTask.d.ts.map +1 -1
  195. package/src/core/process/task/util/randomCountTask.js +3 -1
  196. package/src/core/process/undo/ActionProcessor.d.ts.map +1 -1
  197. package/src/core/process/undo/ActionProcessor.js +5 -3
  198. package/src/core/process/worker/WorkerBuilder.js +3 -3
  199. package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
  200. package/src/engine/animation/curve/AnimationCurve.js +4 -2
  201. package/src/engine/control/first-person/DESIGN.md +1 -1
  202. package/src/engine/control/first-person/FirstPersonMotionPhase.d.ts +55 -0
  203. package/src/engine/control/first-person/FirstPersonMotionPhase.d.ts.map +1 -0
  204. package/src/engine/control/first-person/FirstPersonMotionPhase.js +134 -0
  205. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +23 -2
  206. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
  207. package/src/engine/control/first-person/FirstPersonPlayerController.js +1 -1
  208. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +168 -0
  209. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
  210. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +115 -0
  211. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +71 -0
  212. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
  213. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +255 -55
  214. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts +82 -43
  215. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -1
  216. package/src/engine/control/first-person/abilities/LedgeGrab.js +405 -213
  217. package/src/engine/control/first-person/abilities/Mantle.d.ts +6 -0
  218. package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -1
  219. package/src/engine/control/first-person/abilities/Mantle.js +104 -45
  220. package/src/engine/control/first-person/abilities/ScrambleUp.d.ts +61 -0
  221. package/src/engine/control/first-person/abilities/ScrambleUp.d.ts.map +1 -0
  222. package/src/engine/control/first-person/abilities/ScrambleUp.js +182 -0
  223. package/src/engine/control/first-person/math/jumpDynamics.d.ts +84 -0
  224. package/src/engine/control/first-person/math/jumpDynamics.d.ts.map +1 -0
  225. package/src/engine/control/first-person/math/jumpDynamics.js +108 -0
  226. package/src/engine/control/first-person/prototype_first_person_controller.js +45 -1
  227. package/src/engine/graphics/camera/testClippingPlaneComputation.js +1 -1
  228. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +1 -1
  229. package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +1 -1
  230. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +1 -1
  231. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -1
  232. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +1 -1
  233. package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +1 -1
  234. package/src/engine/graphics/shadows/testShadowMapRendering.js +1 -1
  235. package/src/engine/physics/CONSTRAINT_SOLVER_BENCH_LOG.md +208 -0
  236. package/src/engine/physics/CONSTRAINT_SOLVER_IMPROVEMENTS_PLAN.md +364 -0
  237. package/src/engine/physics/PLAN.md +6 -5
  238. package/src/engine/physics/constraint/solve_constraints.d.ts +4 -1
  239. package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
  240. package/src/engine/physics/constraint/solve_constraints.js +147 -33
  241. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  242. package/src/engine/physics/ecs/PhysicsSystem.js +1750 -1747
  243. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
  244. package/src/engine/physics/gjk/gjk_epa_penetration.d.ts.map +1 -1
  245. package/src/engine/physics/gjk/gjk_epa_penetration.js +5 -9
  246. package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts.map +1 -1
  247. package/src/engine/physics/narrowphase/convex_convex_manifold.js +22 -25
  248. package/src/engine/physics/narrowphase/convex_decomposition.d.ts +32 -13
  249. package/src/engine/physics/narrowphase/convex_decomposition.d.ts.map +1 -1
  250. package/src/engine/physics/narrowphase/convex_decomposition.js +61 -65
  251. package/src/engine/physics/narrowphase/mesh_convex_hull.d.ts.map +1 -1
  252. package/src/engine/physics/narrowphase/mesh_convex_hull.js +13 -8
  253. package/src/engine/physics/narrowphase/refine_ray_concave.d.ts.map +1 -1
  254. package/src/engine/physics/narrowphase/refine_ray_concave.js +5 -3
  255. package/src/engine/physics/narrowphase/refine_ray_hit.d.ts.map +1 -1
  256. package/src/engine/physics/narrowphase/refine_ray_hit.js +81 -78
  257. package/src/engine/sound/SoundEngine.d.ts.map +1 -1
  258. package/src/engine/sound/SoundEngine.js +28 -0
  259. package/src/engine/sound/dB2Volume.d.ts +1 -1
  260. package/src/engine/sound/dB2Volume.d.ts.map +1 -1
  261. package/src/engine/sound/dB2Volume.js +1 -1
  262. package/src/engine/sound/ecs/SoundController.d.ts +4 -0
  263. package/src/engine/sound/ecs/SoundController.d.ts.map +1 -1
  264. package/src/engine/sound/ecs/SoundController.js +4 -0
  265. package/src/engine/sound/ecs/SoundControllerSystem.d.ts +5 -0
  266. package/src/engine/sound/ecs/SoundControllerSystem.d.ts.map +1 -1
  267. package/src/engine/sound/ecs/SoundControllerSystem.js +5 -0
  268. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +69 -0
  269. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -0
  270. package/src/engine/sound/ecs/audio/AudioEmitter.js +83 -0
  271. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +97 -0
  272. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -0
  273. package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +238 -0
  274. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +90 -0
  275. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -0
  276. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +324 -0
  277. package/src/engine/sound/ecs/audio/SpatialAudioIndex.d.ts +59 -0
  278. package/src/engine/sound/ecs/audio/SpatialAudioIndex.d.ts.map +1 -0
  279. package/src/engine/sound/ecs/audio/SpatialAudioIndex.js +140 -0
  280. package/src/engine/sound/ecs/emitter/SoundEmitter.d.ts +16 -65
  281. package/src/engine/sound/ecs/emitter/SoundEmitter.d.ts.map +1 -1
  282. package/src/engine/sound/ecs/emitter/SoundEmitter.js +19 -224
  283. package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.d.ts +26 -29
  284. package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.d.ts.map +1 -1
  285. package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.js +168 -135
  286. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts +36 -59
  287. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts.map +1 -1
  288. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +154 -390
  289. package/src/engine/sound/ecs/emitter/SoundTrack.d.ts +20 -23
  290. package/src/engine/sound/ecs/emitter/SoundTrack.d.ts.map +1 -1
  291. package/src/engine/sound/ecs/emitter/SoundTrack.js +34 -152
  292. package/src/engine/sound/sopra/IMPLEMENTATION_PLAN.md +993 -0
  293. package/src/engine/sound/sopra/README.md +643 -7
  294. package/src/engine/sound/sopra/SopraEngine.d.ts +229 -0
  295. package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -0
  296. package/src/engine/sound/sopra/SopraEngine.js +423 -0
  297. package/src/engine/sound/sopra/asset/AssetManagerBufferProvider.d.ts +26 -0
  298. package/src/engine/sound/sopra/asset/AssetManagerBufferProvider.d.ts.map +1 -0
  299. package/src/engine/sound/sopra/asset/AssetManagerBufferProvider.js +71 -0
  300. package/src/engine/sound/sopra/asset/BufferProvider.d.ts +24 -0
  301. package/src/engine/sound/sopra/asset/BufferProvider.d.ts.map +1 -0
  302. package/src/engine/sound/sopra/asset/BufferProvider.js +29 -0
  303. package/src/engine/sound/sopra/asset/StubBufferProvider.d.ts +31 -0
  304. package/src/engine/sound/sopra/asset/StubBufferProvider.d.ts.map +1 -0
  305. package/src/engine/sound/sopra/asset/StubBufferProvider.js +58 -0
  306. package/src/engine/sound/sopra/definition/BusDefinition.d.ts +83 -0
  307. package/src/engine/sound/sopra/definition/BusDefinition.d.ts.map +1 -0
  308. package/src/engine/sound/sopra/definition/BusDefinition.js +142 -0
  309. package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.d.ts +17 -0
  310. package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.d.ts.map +1 -0
  311. package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.js +54 -0
  312. package/src/engine/sound/sopra/definition/DuckingRule.d.ts +71 -0
  313. package/src/engine/sound/sopra/definition/DuckingRule.d.ts.map +1 -0
  314. package/src/engine/sound/sopra/definition/DuckingRule.js +106 -0
  315. package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.d.ts +18 -0
  316. package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.d.ts.map +1 -0
  317. package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.js +31 -0
  318. package/src/engine/sound/sopra/definition/EventDescription.d.ts +132 -0
  319. package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -0
  320. package/src/engine/sound/sopra/definition/EventDescription.js +259 -0
  321. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +17 -0
  322. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -0
  323. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.js +71 -0
  324. package/src/engine/sound/sopra/definition/MixerSnapshot.d.ts +51 -0
  325. package/src/engine/sound/sopra/definition/MixerSnapshot.d.ts.map +1 -0
  326. package/src/engine/sound/sopra/definition/MixerSnapshot.js +83 -0
  327. package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.d.ts +18 -0
  328. package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.d.ts.map +1 -0
  329. package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.js +39 -0
  330. package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts +72 -0
  331. package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts.map +1 -0
  332. package/src/engine/sound/sopra/definition/ParameterDefinition.js +117 -0
  333. package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.d.ts +18 -0
  334. package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.d.ts.map +1 -0
  335. package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.js +31 -0
  336. package/src/engine/sound/sopra/definition/SopraPanningModel.d.ts +14 -0
  337. package/src/engine/sound/sopra/definition/SopraPanningModel.d.ts.map +1 -0
  338. package/src/engine/sound/sopra/definition/SopraPanningModel.js +20 -0
  339. package/src/engine/sound/sopra/definition/VoiceStealMode.d.ts +10 -0
  340. package/src/engine/sound/sopra/definition/VoiceStealMode.d.ts.map +1 -0
  341. package/src/engine/sound/sopra/definition/VoiceStealMode.js +18 -0
  342. package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.d.ts +93 -0
  343. package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.d.ts.map +1 -0
  344. package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.js +109 -0
  345. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts +80 -0
  346. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts.map +1 -0
  347. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.js +181 -0
  348. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.d.ts +17 -0
  349. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.d.ts.map +1 -0
  350. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.js +74 -0
  351. package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.d.ts +34 -0
  352. package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.d.ts.map +1 -0
  353. package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.js +100 -0
  354. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.d.ts +101 -0
  355. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.d.ts.map +1 -0
  356. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +230 -0
  357. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.d.ts +17 -0
  358. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.d.ts.map +1 -0
  359. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.js +54 -0
  360. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts +103 -0
  361. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts.map +1 -0
  362. package/src/engine/sound/sopra/definition/clip/SampleAudioClip.js +191 -0
  363. package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.d.ts +18 -0
  364. package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.d.ts.map +1 -0
  365. package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.js +39 -0
  366. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClip.d.ts +40 -0
  367. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClip.d.ts.map +1 -0
  368. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClip.js +91 -0
  369. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.d.ts +17 -0
  370. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.d.ts.map +1 -0
  371. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.js +42 -0
  372. package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.d.ts +44 -0
  373. package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.d.ts.map +1 -0
  374. package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.js +77 -0
  375. package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.d.ts +18 -0
  376. package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.d.ts.map +1 -0
  377. package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.js +27 -0
  378. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts +65 -0
  379. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts.map +1 -0
  380. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.js +131 -0
  381. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.d.ts +17 -0
  382. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.d.ts.map +1 -0
  383. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.js +41 -0
  384. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts +24 -0
  385. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts.map +1 -0
  386. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.js +24 -0
  387. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts +70 -0
  388. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts.map +1 -0
  389. package/src/engine/sound/sopra/definition/effect/CompressorEffect.js +120 -0
  390. package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.d.ts +18 -0
  391. package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.d.ts.map +1 -0
  392. package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.js +31 -0
  393. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts +74 -0
  394. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts.map +1 -0
  395. package/src/engine/sound/sopra/definition/effect/EqEffect.js +128 -0
  396. package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.d.ts +18 -0
  397. package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.d.ts.map +1 -0
  398. package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.js +29 -0
  399. package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts +49 -0
  400. package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts.map +1 -0
  401. package/src/engine/sound/sopra/definition/effect/ReverbEffect.js +101 -0
  402. package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.d.ts +18 -0
  403. package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.d.ts.map +1 -0
  404. package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.js +25 -0
  405. package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.d.ts +31 -0
  406. package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.d.ts.map +1 -0
  407. package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.js +106 -0
  408. package/src/engine/sound/sopra/runtime/BusGraph.d.ts +79 -0
  409. package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -0
  410. package/src/engine/sound/sopra/runtime/BusGraph.js +227 -0
  411. package/src/engine/sound/sopra/runtime/EventInstance.d.ts +144 -0
  412. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -0
  413. package/src/engine/sound/sopra/runtime/EventInstance.js +579 -0
  414. package/src/engine/sound/sopra/runtime/ParameterStore.d.ts +42 -0
  415. package/src/engine/sound/sopra/runtime/ParameterStore.d.ts.map +1 -0
  416. package/src/engine/sound/sopra/runtime/ParameterStore.js +98 -0
  417. package/src/engine/sound/sopra/runtime/SopraPlaybackContext.d.ts +42 -0
  418. package/src/engine/sound/sopra/runtime/SopraPlaybackContext.d.ts.map +1 -0
  419. package/src/engine/sound/sopra/runtime/SopraPlaybackContext.js +68 -0
  420. package/src/engine/sound/sopra/runtime/Voice.d.ts +67 -0
  421. package/src/engine/sound/sopra/runtime/Voice.d.ts.map +1 -0
  422. package/src/engine/sound/sopra/runtime/Voice.js +145 -0
  423. package/src/engine/sound/sopra/runtime/VoiceManager.d.ts +38 -0
  424. package/src/engine/sound/sopra/runtime/VoiceManager.d.ts.map +1 -0
  425. package/src/engine/sound/sopra/runtime/VoiceManager.js +136 -0
  426. package/src/engine/sound/sopra/runtime/VoicePool.d.ts +12 -0
  427. package/src/engine/sound/sopra/runtime/VoicePool.d.ts.map +1 -0
  428. package/src/engine/sound/sopra/runtime/VoicePool.js +17 -0
  429. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts +11 -0
  430. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts.map +1 -0
  431. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.js +42 -0
  432. package/src/engine/sound/sopra/serialization/sopraJSON.d.ts +33 -0
  433. package/src/engine/sound/sopra/serialization/sopraJSON.d.ts.map +1 -0
  434. package/src/engine/sound/sopra/serialization/sopraJSON.js +99 -0
  435. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts +27 -0
  436. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts.map +1 -0
  437. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.js +49 -0
  438. package/src/engine/sound/sopra/util/MockAudioContext.d.ts +74 -0
  439. package/src/engine/sound/sopra/util/MockAudioContext.d.ts.map +1 -0
  440. package/src/engine/sound/sopra/util/MockAudioContext.js +215 -0
  441. package/src/engine/sound/sopra/util/buildAttenuationCurve.d.ts +15 -0
  442. package/src/engine/sound/sopra/util/buildAttenuationCurve.d.ts.map +1 -0
  443. package/src/engine/sound/sopra/util/buildAttenuationCurve.js +40 -0
  444. package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts +34 -0
  445. package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts.map +1 -0
  446. package/src/engine/sound/sopra/util/fadeOutAndStop.js +60 -0
  447. package/src/engine/sound/volume2dB.d.ts +1 -1
  448. package/src/engine/sound/volume2dB.d.ts.map +1 -1
  449. package/src/engine/sound/volume2dB.js +1 -1
  450. package/src/engine/graphics/sh3/path_tracer/sampling/v3_orthonormal_matrix_from_normal.d.ts.map +0 -1
  451. package/src/engine/physics/narrowphase/ray_shapes.d.ts +0 -66
  452. package/src/engine/physics/narrowphase/ray_shapes.d.ts.map +0 -1
  453. package/src/engine/physics/narrowphase/ray_shapes.js +0 -187
  454. package/src/engine/sound/ecs/emitter/SoundEmitterChannel.d.ts +0 -23
  455. package/src/engine/sound/ecs/emitter/SoundEmitterChannel.d.ts.map +0 -1
  456. package/src/engine/sound/ecs/emitter/SoundEmitterChannel.js +0 -32
  457. package/src/engine/sound/ecs/emitter/SoundTrackNodes.d.ts +0 -18
  458. package/src/engine/sound/ecs/emitter/SoundTrackNodes.d.ts.map +0 -1
  459. package/src/engine/sound/ecs/emitter/SoundTrackNodes.js +0 -18
  460. package/src/engine/sound/sopra/AbstractAudioClip.d.ts +0 -26
  461. package/src/engine/sound/sopra/AbstractAudioClip.d.ts.map +0 -1
  462. package/src/engine/sound/sopra/AbstractAudioClip.js +0 -29
  463. package/src/engine/sound/sopra/ContainerAudioClip.d.ts +0 -12
  464. package/src/engine/sound/sopra/ContainerAudioClip.d.ts.map +0 -1
  465. package/src/engine/sound/sopra/ContainerAudioClip.js +0 -13
  466. package/src/engine/sound/sopra/RandomContainerAudioClip.d.ts +0 -12
  467. package/src/engine/sound/sopra/RandomContainerAudioClip.d.ts.map +0 -1
  468. package/src/engine/sound/sopra/RandomContainerAudioClip.js +0 -15
  469. package/src/engine/sound/sopra/SequenceContainerAudioClip.d.ts +0 -7
  470. package/src/engine/sound/sopra/SequenceContainerAudioClip.d.ts.map +0 -1
  471. package/src/engine/sound/sopra/SequenceContainerAudioClip.js +0 -8
  472. package/src/engine/sound/sopra/SilenceAudioClip.d.ts +0 -13
  473. package/src/engine/sound/sopra/SilenceAudioClip.d.ts.map +0 -1
  474. package/src/engine/sound/sopra/SilenceAudioClip.js +0 -15
  475. /package/src/{engine/graphics/sh3/path_tracer/sampling → core/geom/vec3}/v3_orthonormal_matrix_from_normal.d.ts +0 -0
@@ -1,82 +1,95 @@
1
- import { assert } from "../assert.js";
2
- import { EPSILON } from "./EPSILON.js";
3
- import { solveQuadratic } from "./solveQuadratic.js";
4
-
5
- const ONE_THIRD = 1.0 / 3.0;
6
- const TWO_THIRDS_PI = 2.0 * Math.PI / 3.0;
7
-
8
- /**
9
- * Return real solutions for a cubic polynomial: ax³ + bx² + cx + d
10
- * Repeated roots are written once each — multiplicity is not duplicated in the output.
11
- * Imaginary roots are not provided.
12
- *
13
- * @param {number[]|Float32Array|Float64Array} result solutions are written here
14
- * @param {number} result_offset offset into result array where solutions are written to
15
- * @param {number} a
16
- * @param {number} b
17
- * @param {number} c
18
- * @param {number} d
19
- * @returns {number} number of real roots found (0, 1, 2, or 3)
20
- */
21
- export function solveCubic(result, result_offset, a, b, c, d) {
22
- assert.isNumber(a, 'a');
23
- assert.isNumber(b, 'b');
24
- assert.isNumber(c, 'c');
25
- assert.isNumber(d, 'd');
26
-
27
- if (Math.abs(a) < EPSILON) {
28
- // degrade to quadratic
29
- return solveQuadratic(result, result_offset, b, c, d);
30
- }
31
-
32
- // normalize: x³ + B·x² + C·x + D = 0
33
- const inv_a = 1 / a;
34
- const B = b * inv_a;
35
- const C = c * inv_a;
36
- const D = d * inv_a;
37
-
38
- // depress via x = y - B/3 → y³ + p·y + q = 0
39
- const B_third = B * ONE_THIRD;
40
- const p = C - B * B_third;
41
- const q = 2 * B_third * B_third * B_third - C * B_third + D;
42
-
43
- if (Math.abs(p) < EPSILON && Math.abs(q) < EPSILON) {
44
- // triple root at y = 0
45
- result[result_offset] = -B_third;
46
- return 1;
47
- }
48
-
49
- // Cardano's discriminant criterion. ratio = (q/2)² + (p/3)³.
50
- // ratio > 0 → one real root, two complex
51
- // ratio = 0 → repeated real roots (single + double, or triple covered above)
52
- // ratio < 0 → three distinct real roots
53
- const half_q = q * 0.5;
54
- const third_p = p * ONE_THIRD;
55
- const ratio = half_q * half_q + third_p * third_p * third_p;
56
-
57
- if (ratio > EPSILON) {
58
- const sqrt_ratio = Math.sqrt(ratio);
59
- const u = Math.cbrt(-half_q + sqrt_ratio);
60
- const v = Math.cbrt(-half_q - sqrt_ratio);
61
-
62
- result[result_offset] = u + v - B_third;
63
- return 1;
64
- }
65
-
66
- if (ratio < -EPSILON) {
67
- // p must be negative for ratio < 0; sqrt(-p/3) is real
68
- const m = 2 * Math.sqrt(-third_p);
69
- const theta_third = ONE_THIRD * Math.acos(3 * q / (p * m));
70
-
71
- result[result_offset] = m * Math.cos(theta_third) - B_third;
72
- result[result_offset + 1] = m * Math.cos(theta_third - TWO_THIRDS_PI) - B_third;
73
- result[result_offset + 2] = m * Math.cos(theta_third - 2 * TWO_THIRDS_PI) - B_third;
74
- return 3;
75
- }
76
-
77
- // ratio ≈ 0: simple + double root
78
- const u = Math.cbrt(-half_q);
79
- result[result_offset] = 2 * u - B_third;
80
- result[result_offset + 1] = -u - B_third;
81
- return 2;
82
- }
1
+ import { assert } from "../assert.js";
2
+ import { EPSILON } from "./EPSILON.js";
3
+ import { solveQuadratic } from "./solveQuadratic.js";
4
+
5
+ const ONE_THIRD = 1.0 / 3.0;
6
+ const TWO_THIRDS_PI = 2.0 * Math.PI / 3.0;
7
+
8
+ /**
9
+ * Return real solutions for a cubic polynomial: ax³ + bx² + cx + d
10
+ * Repeated roots are written once each — multiplicity is not duplicated in the output.
11
+ * Imaginary roots are not provided.
12
+ *
13
+ * @param {number[]|Float32Array|Float64Array} result solutions are written here
14
+ * @param {number} result_offset offset into result array where solutions are written to
15
+ * @param {number} a
16
+ * @param {number} b
17
+ * @param {number} c
18
+ * @param {number} d
19
+ * @returns {number} number of real roots found (0, 1, 2, or 3)
20
+ */
21
+ export function solveCubic(result, result_offset, a, b, c, d) {
22
+ assert.isNumber(a, 'a');
23
+ assert.isNumber(b, 'b');
24
+ assert.isNumber(c, 'c');
25
+ assert.isNumber(d, 'd');
26
+
27
+ if (Math.abs(a) < EPSILON) {
28
+ // degrade to quadratic
29
+ return solveQuadratic(result, result_offset, b, c, d);
30
+ }
31
+
32
+ // normalize: x³ + B·x² + C·x + D = 0
33
+ const inv_a = 1 / a;
34
+ const B = b * inv_a;
35
+ const C = c * inv_a;
36
+ const D = d * inv_a;
37
+
38
+ // depress via x = y - B/3 → y³ + p·y + q = 0
39
+ const B_third = B * ONE_THIRD;
40
+ const p = C - B * B_third;
41
+ const q = 2 * B_third * B_third * B_third - C * B_third + D;
42
+
43
+ // Scale-invariant triple-root test. p has the units of root² and q of root³, so compare each against the
44
+ // coefficient scale raised to the matching power. An absolute `< EPSILON` test wrongly classified cubics
45
+ // whose roots are merely small (p and q tiny in absolute terms but the roots well separated) as a triple
46
+ // root. Exact p === 0 && q === 0 still passes here, routing to the triple-root branch.
47
+ const coeff_scale = Math.max(1, Math.abs(B));
48
+ if (
49
+ Math.abs(p) < EPSILON * coeff_scale * coeff_scale
50
+ && Math.abs(q) < EPSILON * coeff_scale * coeff_scale * coeff_scale
51
+ ) {
52
+ // triple root at y = 0
53
+ result[result_offset] = -B_third;
54
+ return 1;
55
+ }
56
+
57
+ // Cardano's discriminant criterion. ratio = (q/2)² + (p/3)³.
58
+ // ratio > 0 → one real root, two complex
59
+ // ratio = 0 → repeated real roots (single + double, or triple covered above)
60
+ // ratio < 0 → three distinct real roots
61
+ const half_q = q * 0.5;
62
+ const third_p = p * ONE_THIRD;
63
+ const ratio = half_q * half_q + third_p * third_p * third_p;
64
+
65
+ // Relative dead-band: ratio has the units of root⁶, exactly like its two constituent terms. An absolute
66
+ // EPSILON band dropped a real root for small-magnitude roots (ratio tiny but genuinely non-zero); scale the
67
+ // tolerance by the magnitude of the constituent terms instead.
68
+ const ratio_tol = EPSILON * Math.max(half_q * half_q, Math.abs(third_p * third_p * third_p));
69
+
70
+ if (ratio > ratio_tol) {
71
+ const sqrt_ratio = Math.sqrt(ratio);
72
+ const u = Math.cbrt(-half_q + sqrt_ratio);
73
+ const v = Math.cbrt(-half_q - sqrt_ratio);
74
+
75
+ result[result_offset] = u + v - B_third;
76
+ return 1;
77
+ }
78
+
79
+ if (ratio < -ratio_tol) {
80
+ // p must be negative for ratio < 0; sqrt(-p/3) is real
81
+ const m = 2 * Math.sqrt(-third_p);
82
+ const theta_third = ONE_THIRD * Math.acos(3 * q / (p * m));
83
+
84
+ result[result_offset] = m * Math.cos(theta_third) - B_third;
85
+ result[result_offset + 1] = m * Math.cos(theta_third - TWO_THIRDS_PI) - B_third;
86
+ result[result_offset + 2] = m * Math.cos(theta_third - 2 * TWO_THIRDS_PI) - B_third;
87
+ return 3;
88
+ }
89
+
90
+ // ratio ≈ 0: simple + double root
91
+ const u = Math.cbrt(-half_q);
92
+ result[result_offset] = 2 * u - B_third;
93
+ result[result_offset + 1] = -u - B_third;
94
+ return 2;
95
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"computeCatmullRomSplineUniformDistance.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/spline/computeCatmullRomSplineUniformDistance.js"],"names":[],"mappings":"AA+BA;;;;;;;;GAQG;AACH,+DAPW,MAAM,EAAE,GAAC,YAAY,SACrB,MAAM,EAAE,GAAC,YAAY,gBACrB,MAAM,cACN,MAAM,gBACN,MAAM,UACN,MAAM,QAuFhB"}
1
+ {"version":3,"file":"computeCatmullRomSplineUniformDistance.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/spline/computeCatmullRomSplineUniformDistance.js"],"names":[],"mappings":"AA+BA;;;;;;;;GAQG;AACH,+DAPW,MAAM,EAAE,GAAC,YAAY,SACrB,MAAM,EAAE,GAAC,YAAY,gBACrB,MAAM,cACN,MAAM,gBACN,MAAM,UACN,MAAM,QAoGhB"}
@@ -69,6 +69,19 @@ export function computeCatmullRomSplineUniformDistance(result, input, input_leng
69
69
 
70
70
  const step_distance = distances_sum / (sample_count - 1);
71
71
 
72
+ if (!(step_distance > 0)) {
73
+ // Degenerate input. When the total path length is 0 (all control points coincide) step_distance is 0,
74
+ // which would make the sampling loop below spin forever (next_point_distance never advances). When
75
+ // sample_count < 2 it is Infinity/NaN. In every such case collapse all requested samples onto the first
76
+ // input point. The `!(step_distance > 0)` test also covers NaN and -0. Note: when sample_count is 0 this
77
+ // loop is a no-op, which is the correct (empty) result.
78
+ for (let i = 0; i < sample_count; i++) {
79
+ array_copy(input, 0, result, i * dimensions, dimensions);
80
+ }
81
+
82
+ return;
83
+ }
84
+
72
85
  let cursor_index = 0;
73
86
 
74
87
  let current_input_distance = 0;
@@ -14,7 +14,7 @@ export function softmax(z, i, k) {
14
14
  // NOTE that if we want to compute softmax for an entire vector, it could be far more efficient
15
15
  let sum = 0;
16
16
 
17
- for (let j = 1; j < k; j++) {
17
+ for (let j = 0; j < k; j++) {
18
18
 
19
19
  sum += Math.exp(z[j]);
20
20
 
@@ -45,6 +45,7 @@ export class NodeGraphVisualData {
45
45
  getNode(id: number): NodeVisualData | undefined;
46
46
  toJSON(): {
47
47
  nodes: {};
48
+ dataColors: {};
48
49
  };
49
50
  fromJSON(json: any): void;
50
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NodeGraphVisualData.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/visual/NodeGraphVisualData.js"],"names":[],"mappings":"AASA;IAEI;;;OAGG;IACH,OAFU,IAAI,MAAM,EAAE,cAAc,CAAC,CAEnB;IAElB;;;OAGG;IACH,YAFU,IAAI,MAAM,EAAE,KAAK,CAAC,CAEL;IAEvB;;;OAGG;IACH,wCAgBC;IAED;;;OAGG;IACH,+BAwHC;IAED;;;;OAIG;IACH,iBAHW,MAAM,SACN,KAAK,QAMf;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,KAAK,CAIjB;IAED;;;;OAIG;IACH,YAHW,MAAM,QACN,cAAc,QAIxB;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,cAAc,GAAC,SAAS,CAIpC;IAED;;MAgBC;IAED,0BA0BC;CACJ;+BAvP8B,qBAAqB;sBAL9B,yBAAyB"}
1
+ {"version":3,"file":"NodeGraphVisualData.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/visual/NodeGraphVisualData.js"],"names":[],"mappings":"AASA;IAEI;;;OAGG;IACH,OAFU,IAAI,MAAM,EAAE,cAAc,CAAC,CAEnB;IAElB;;;OAGG;IACH,YAFU,IAAI,MAAM,EAAE,KAAK,CAAC,CAEL;IAEvB;;;OAGG;IACH,wCAgBC;IAED;;;OAGG;IACH,+BAwHC;IAED;;;;OAIG;IACH,iBAHW,MAAM,SACN,KAAK,QAMf;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,KAAK,CAIjB;IAED;;;;OAIG;IACH,YAHW,MAAM,QACN,cAAc,QAIxB;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,cAAc,GAAC,SAAS,CAIpC;IAED;;;MAiBC;IAED,0BA0BC;CACJ;+BAxP8B,qBAAqB;sBAL9B,yBAAyB"}
@@ -221,7 +221,8 @@ export class NodeGraphVisualData {
221
221
  }
222
222
 
223
223
  return {
224
- nodes
224
+ nodes,
225
+ dataColors
225
226
  };
226
227
  }
227
228
 
@@ -64,6 +64,6 @@ export class NodeVisualData {
64
64
  fromJSON(json) {
65
65
  this.id = json.id;
66
66
  this.dimensions.fromJSON(json.dimensions);
67
- this.ports.fromJSON(json, PortVisualData);
67
+ this.ports.fromJSON(json.ports, PortVisualData);
68
68
  }
69
69
  }
@@ -44,6 +44,13 @@ export class ImmutableObjectPool<Key, Value> {
44
44
  */
45
45
  size: number;
46
46
  get(key: any): Value;
47
+ /**
48
+ * Detach an element from the global eviction list, keeping the head/tail pointers consistent.
49
+ * Does NOT touch the per-key bucket, size, or the onRemoved signal.
50
+ * @param {CacheElement<Key,Value>} el
51
+ * @private
52
+ */
53
+ private __unlinkFromList;
47
54
  /**
48
55
  * Removed all elements from cache
49
56
  * NOTE: {@link onRemoved} signal *does* get triggered for each element
@@ -1 +1 @@
1
- {"version":3,"file":"ImmutableObjectPool.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/object/ImmutableObjectPool.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAyBI;;;OAoBC;IA5CD;;;OAGG;IACH,oBAFU,OAAO,GAAG,EAAC,KAAK,CAAC,CAEH;IACxB;;;OAGG;IACH,MAFU,QAAQ,GAAG,EAAE,aAAa,GAAG,EAAC,KAAK,CAAC,EAAE,CAAC,CAE5B;IAErB;;;;OAIG;IACH,gBAAe;IACf;;;;OAIG;IACH,eAAc;IAKV;;;OAGG;IACH,UAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,gBAFU,MAAM,CAEoB;IAEpC;;;OAGG;IACH,MAFU,MAAM,CAEH;IAGjB,qBAuBC;IAED;;;OAGG;IACH,cAIC;IAED;;;;OAIG;IACH,wBA0BC;IAED,mCA2CC;CACJ;mBApKkB,+BAA+B;wBAD1B,iCAAiC;6BAD5B,6BAA6B"}
1
+ {"version":3,"file":"ImmutableObjectPool.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/object/ImmutableObjectPool.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAyBI;;;OAoBC;IA5CD;;;OAGG;IACH,oBAFU,OAAO,GAAG,EAAC,KAAK,CAAC,CAEH;IACxB;;;OAGG;IACH,MAFU,QAAQ,GAAG,EAAE,aAAa,GAAG,EAAC,KAAK,CAAC,EAAE,CAAC,CAE5B;IAErB;;;;OAIG;IACH,gBAAe;IACf;;;;OAIG;IACH,eAAc;IAKV;;;OAGG;IACH,UAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,gBAFU,MAAM,CAEoB;IAEpC;;;OAGG;IACH,MAFU,MAAM,CAEH;IAGjB,qBAuBC;IAED;;;;;OAKG;IACH,yBAUC;IAED;;;OAGG;IACH,cAIC;IAED;;;;OAIG;IACH,wBAkBC;IAED,mCA2CC;CACJ;mBA9KkB,+BAA+B;wBAD1B,iCAAiC;6BAD5B,6BAA6B"}
@@ -70,13 +70,31 @@ export class ImmutableObjectPool {
70
70
  this.data.delete(key);
71
71
  }
72
72
 
73
- element.unlink();
73
+ this.__unlinkFromList(element);
74
74
 
75
75
  this.size--;
76
76
 
77
77
  return element.value;
78
78
  }
79
79
 
80
+ /**
81
+ * Detach an element from the global eviction list, keeping the head/tail pointers consistent.
82
+ * Does NOT touch the per-key bucket, size, or the onRemoved signal.
83
+ * @param {CacheElement<Key,Value>} el
84
+ * @private
85
+ */
86
+ __unlinkFromList(el) {
87
+ if (el === this.__first) {
88
+ this.__first = el.next;
89
+ }
90
+
91
+ if (el === this.__last) {
92
+ this.__last = el.previous;
93
+ }
94
+
95
+ el.unlink();
96
+ }
97
+
80
98
  /**
81
99
  * Removed all elements from cache
82
100
  * NOTE: {@link onRemoved} signal *does* get triggered for each element
@@ -93,15 +111,7 @@ export class ImmutableObjectPool {
93
111
  * @private
94
112
  */
95
113
  __removeElement(el) {
96
- if (el === this.__first) {
97
- this.__first = el.next;
98
- }
99
-
100
- if (el === this.__last) {
101
- this.__last = el.previous;
102
- }
103
-
104
- el.unlink();
114
+ this.__unlinkFromList(el);
105
115
 
106
116
  const key = el.key;
107
117
 
@@ -1 +1 @@
1
- {"version":3,"file":"MultiPredicateEvaluator.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/evaluation/MultiPredicateEvaluator.js"],"names":[],"mappings":"AAuGA;;GAEG;AACH;IACI;;;OAGG;IACH,4DAFwC,MAAM,EA4E7C;IAzEG;;;OAGG;IACH,+CAFwC,MAAM,CAER;IAEtC;;;OAGG;IACH,YAFU,oBAAoB,CAEV;IAEpB;;;OAGG;IACH,WAFU,MAAM,CAEa;IAE7B;;;;OAIG;IACH,iCAA4C;IAE5C;;;OAGG;IACH,aAFU,MAAM,CAEe;IAG/B;;;;OAIG;IACH,+BAA2C;IAE3C;;;;OAIG;IACH,iCAAkC;IAElC;;;;OAIG;IACH,sCAAuC;IAEvC;;;;OAIG;IACH,kBAAmB;IAEnB;;;;OAIG;IACH,oBAAoB;IAEpB;;;;OAIG;IACH,0BAA0B;IAG9B;;;OAGG;IACH,kBAFW,oBAAoB,QAsC9B;IAED;;;;;;OAMG;IACH,2BAuCC;IAED;;;;;OAKG;IACH,uBAiCC;IAED;;;;OAIG;IACH,0BAcC;IAED;;;;;OAKG;IACH,uBA2FC;IAGD,+BAOC;IAED,iBAEC;IAED;;OAEG;IACH,QAFa,qBAAmB,SAAS,CA4BxC;CACJ;uBAjesB,2BAA2B"}
1
+ {"version":3,"file":"MultiPredicateEvaluator.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/evaluation/MultiPredicateEvaluator.js"],"names":[],"mappings":"AAuGA;;GAEG;AACH;IACI;;;OAGG;IACH,4DAFwC,MAAM,EA4E7C;IAzEG;;;OAGG;IACH,+CAFwC,MAAM,CAER;IAEtC;;;OAGG;IACH,YAFU,oBAAoB,CAEV;IAEpB;;;OAGG;IACH,WAFU,MAAM,CAEa;IAE7B;;;;OAIG;IACH,iCAA4C;IAE5C;;;OAGG;IACH,aAFU,MAAM,CAEe;IAG/B;;;;OAIG;IACH,+BAA2C;IAE3C;;;;OAIG;IACH,iCAAkC;IAElC;;;;OAIG;IACH,sCAAuC;IAEvC;;;;OAIG;IACH,kBAAmB;IAEnB;;;;OAIG;IACH,oBAAoB;IAEpB;;;;OAIG;IACH,0BAA0B;IAG9B;;;OAGG;IACH,kBAFW,oBAAoB,QAsC9B;IAED;;;;;;OAMG;IACH,2BAuCC;IAED;;;;;OAKG;IACH,uBAiCC;IAED;;;;OAIG;IACH,0BAcC;IAED;;;;;OAKG;IACH,uBAgIC;IAGD,+BAOC;IAED,iBAEC;IAED;;OAEG;IACH,QAFa,qBAAmB,SAAS,CA4BxC;CACJ;uBAtgBsB,2BAA2B"}
@@ -303,11 +303,11 @@ export class MultiPredicateEvaluator {
303
303
  const parent = parents[i];
304
304
 
305
305
  if (value === false) {
306
- if (parent.isReactiveAnd === true) {
306
+ if (parent.expression.isReactiveAnd === true) {
307
307
  this.__assign_value(parent, false);
308
308
  }
309
309
  } else {
310
- if (parent.isReactiveOr === true) {
310
+ if (parent.expression.isReactiveOr === true) {
311
311
  this.__assign_value(parent, true);
312
312
  }
313
313
  }
@@ -393,6 +393,43 @@ export class MultiPredicateEvaluator {
393
393
 
394
394
  return false;
395
395
  }
396
+ } else if (expression.isReactiveAnd === true || expression.isReactiveOr === true) {
397
+
398
+ // Short-circuiting boolean AND/OR: a determinable result must be produced from whichever operand
399
+ // resolves, WITHOUT requiring the other operand to resolve (mirrors ReactiveAnd/ReactiveOr.evaluate).
400
+ // The generic binary branch below would instead require BOTH operands to resolve and drop the whole
401
+ // predicate when one operand is an unresolved reference.
402
+ const left_node = node.children[0];
403
+ const right_node = node.children[1];
404
+
405
+ const is_and = expression.isReactiveAnd === true;
406
+ const short_circuit_value = !is_and; // false short-circuits AND, true short-circuits OR
407
+
408
+ let resolved = false;
409
+
410
+ if (this.__resolve_node(left_node)) {
411
+ const left_value = left_node.getValue();
412
+
413
+ if (left_value === short_circuit_value) {
414
+ value = short_circuit_value;
415
+ resolved = true;
416
+ } else if (this.__resolve_node(right_node)) {
417
+ value = expression.transform(left_value, right_node.getValue());
418
+ resolved = true;
419
+ }
420
+ } else if (this.__resolve_node(right_node)) {
421
+ const right_value = right_node.getValue();
422
+
423
+ if (right_value === short_circuit_value) {
424
+ value = short_circuit_value;
425
+ resolved = true;
426
+ }
427
+ }
428
+
429
+ if (!resolved) {
430
+ return false;
431
+ }
432
+
396
433
  } else if (expression.isBinaryExpression) {
397
434
 
398
435
  const children = node.children;
@@ -1 +1 @@
1
- {"version":3,"file":"ReactiveReference.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/model/reactive/model/terminal/ReactiveReference.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH;IAoII;;;;;OAKG;IACH,oBAJW,2CAAuC,SACvC,MAAM,GACJ,iBAAiB,CAe7B;IArJD;;;OAGG;IACH,mBAFW,MAAM,EAkBhB;IAXG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,QAFU,mDAA0C,CAElC;IAGtB;;;OAGG;IACH,YAFW,iBAAiB,QAU3B;IAED;;;OAGG;IACH,SAFY,iBAAiB,CAQ5B;IAED,gCAEC;IAED;;;;;OAKG;IACH;;;aAoBC;IAED;;;OAGG;IACH,mBAYC;IAED,wBAKC;IAED,iBAEC;IAGD,eAKC;IAED,0BAMC;IA8BL;;;OAGG;IACH,qBAFU,OAAO,CAEqB;IAEtC;;;OAGG;IACH,sBAFU,OAAO,CAEsB;CAZtC;mCAhKkC,0BAA0B"}
1
+ {"version":3,"file":"ReactiveReference.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/model/reactive/model/terminal/ReactiveReference.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH;IAsII;;;;;OAKG;IACH,oBAJW,2CAAuC,SACvC,MAAM,GACJ,iBAAiB,CAe7B;IAvJD;;;OAGG;IACH,mBAFW,MAAM,EAkBhB;IAXG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,QAFU,mDAA0C,CAElC;IAGtB;;;OAGG;IACH,YAFW,iBAAiB,QAY3B;IAED;;;OAGG;IACH,SAFY,iBAAiB,CAQ5B;IAED,gCAEC;IAED;;;;;OAKG;IACH;;;aAoBC;IAED;;;OAGG;IACH,mBAYC;IAED,wBAKC;IAED,iBAEC;IAGD,eAKC;IAED,0BAMC;IA8BL;;;OAGG;IACH,qBAFU,OAAO,CAEqB;IAEtC;;;OAGG;IACH,sBAFU,OAAO,CAEsB;CAZtC;mCAlKkC,0BAA0B"}
@@ -39,6 +39,8 @@ export class ReactiveReference extends ReactiveExpression {
39
39
  */
40
40
  copy(other) {
41
41
  this.name = other.name;
42
+ // preserve the instance dataType (mirrors from()); without this the clone reverts to DataType.Any
43
+ this.dataType = other.dataType;
42
44
 
43
45
  this.disconnect();
44
46
 
@@ -1 +1 @@
1
- {"version":3,"file":"readHexToken.d.ts","sourceRoot":"","sources":["../../../../../src/core/parser/simple/readHexToken.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,mCALW,MAAM,UACN,MAAM,UACN,MAAM,SA0FhB"}
1
+ {"version":3,"file":"readHexToken.d.ts","sourceRoot":"","sources":["../../../../../src/core/parser/simple/readHexToken.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,mCALW,MAAM,UACN,MAAM,UACN,MAAM,SAgGhB"}
@@ -95,6 +95,12 @@ export function readHexToken(text, cursor, length) {
95
95
  value = value * 16 + digit;
96
96
  }
97
97
 
98
+ if (i === cursor + 2) {
99
+ // no hex digits were consumed after the "0x" prefix. This covers both "0xZ" (loop breaks immediately)
100
+ // and "0x" at end of input (loop body never runs); the per-character `i === cursor` guard above is dead
101
+ // code because i starts at cursor + 2.
102
+ throw new ParserError(i, `Expected at least one hex digit [0-9,A-F] after '0x'`, text);
103
+ }
98
104
 
99
105
  return new Token(value, cursor, i, "uint", DataType.Number);
100
106
  }
@@ -1 +1 @@
1
- {"version":3,"file":"number_pretty_print.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/numbers/number_pretty_print.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAM,CAmBlB"}
1
+ {"version":3,"file":"number_pretty_print.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/numbers/number_pretty_print.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAM,CAsBlB"}
@@ -14,7 +14,10 @@ export function number_pretty_print(value) {
14
14
 
15
15
  const fraction = value % 1;
16
16
 
17
- const would_produce_decimals = fraction * Math.pow(10, MAX_DECIMALS) > 0;
17
+ // Use the magnitude: for negative values `fraction` is negative, so `fraction * 100 > 0` was false and the
18
+ // decimals were dropped. `>= 1` also correctly treats fractions that round to nothing at MAX_DECIMALS as
19
+ // having no displayable decimals.
20
+ const would_produce_decimals = Math.abs(fraction) * Math.pow(10, MAX_DECIMALS) >= 1;
18
21
 
19
22
  if (would_produce_decimals && Math.abs(value) < 100) {
20
23
  const truncated = value.toFixed(MAX_DECIMALS);
@@ -61,5 +61,5 @@ function getPrefix(a1, a2, character_limit) {
61
61
  }
62
62
  }
63
63
 
64
- return ++p;
64
+ return p;
65
65
  }
@@ -42,6 +42,6 @@ export class CompositeProcess extends BaseProcess {
42
42
 
43
43
  this.children.forEach(c => c.shutdown());
44
44
 
45
- super.startup();
45
+ super.shutdown();
46
46
  }
47
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AsynchronousDelayAction.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/action/AsynchronousDelayAction.js"],"names":[],"mappings":"AAUA;IAEI;;;;OAIG;IACH,+CAFW,MAAM,EAqBhB;IAdG,8BAAgB;IAChB,eAAkB;IAElB,iBAA4B;IAahC,wBAMC;CAOJ;mCA3CkC,yBAAyB;mBARzC,+BAA+B"}
1
+ {"version":3,"file":"AsynchronousDelayAction.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/action/AsynchronousDelayAction.js"],"names":[],"mappings":"AAUA;IAEI;;;;OAIG;IACH,+CAFW,MAAM,EAqBhB;IAdG,8BAAgB;IAChB,eAAkB;IAElB,iBAA4B;IAahC,wBASC;CAOJ;mCA9CkC,yBAAyB;mBARzC,+BAA+B"}
@@ -39,6 +39,9 @@ export class AsynchronousDelayAction extends AsynchronousAction {
39
39
  cancel() {
40
40
  if (this.status === TaskState.RUNNING) {
41
41
  this.__entity.destroy();
42
+ // transition state and notify listeners, mirroring AsynchronousActionSequence.cancel
43
+ this.status = TaskState.CANCELLED;
44
+ this.on.cancelled.send0();
42
45
  }
43
46
 
44
47
  return Promise.resolve();
@@ -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,qBA8BC;IAED;;;;OAIG;IACH,sBAFa,OAAO,CAYnB;IAwLD;;;OAGG;IACH,aAQC;IAED,0BAMC;;CACJ;;;;mBAhgBkB,+BAA+B;wBAogBxC,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,qBA+BC;IAED;;;;OAIG;IACH,sBAFa,OAAO,CAYnB;IAwLD;;;OAGG;IACH,aAQC;IAED,0BAMC;;CACJ;;;;mBAjgBkB,+BAA+B;wBAqgBxC,MAAM"}
@@ -277,8 +277,9 @@ class ConcurrentExecutor {
277
277
  //attempt to start the task
278
278
  this.startTask(unresolvedTask);
279
279
 
280
- //task start could have altered unresolved queue, re-initialize iteration
281
- i = 0;
280
+ //task start could have altered unresolved queue, re-initialize iteration.
281
+ //use -1 so the loop's i++ restarts at index 0; i=0 would skip the element now at index 0.
282
+ i = -1;
282
283
  l = queueUnresolved.length;
283
284
 
284
285
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"randomCountTask.d.ts","sourceRoot":"","sources":["../../../../../../src/core/process/task/util/randomCountTask.js"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,sCANW,MAAM,WACN,MAAM,mBAAa,MAAM,CAAA,SACzB,MAAM,mBAAa,MAAM,CAAA,kBAEvB,IAAI,CAoDhB;iBA7DgB,YAAY"}
1
+ {"version":3,"file":"randomCountTask.d.ts","sourceRoot":"","sources":["../../../../../../src/core/process/task/util/randomCountTask.js"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,sCANW,MAAM,WACN,MAAM,mBAAa,MAAM,CAAA,SACzB,MAAM,mBAAa,MAAM,CAAA,kBAEvB,IAAI,CAsDhB;iBA/DgB,YAAY"}
@@ -17,7 +17,9 @@ export function randomCountTask(seed, initial, limit, callback) {
17
17
 
18
18
  const span = limit - initial;
19
19
 
20
- const sequence = new Uint16Array(span);
20
+ // Uint32Array, not Uint16Array: the sequence stores indices 0..span-1, which overflow a Uint16 once
21
+ // span exceeds 65535 (sequence[i] = i would wrap), corrupting the produced order.
22
+ const sequence = new Uint32Array(span);
21
23
 
22
24
  let i = 0;
23
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"ActionProcessor.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/undo/ActionProcessor.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH;IACI;;;;OAIG;IACH,0BA4DC;IA3DG;;;OAGG;IACH,SAFU,YAAY,CAEG;IAEzB;;;OAGG;IACH,aAAsB;IAEtB;;;OAGG;IACH,aAAe;IAEf;;OAEG;IACH,QAFU,MAAM,CAED;IAEf;;;OAGG;IACH,oBAFU,MAAM,CAEW;IAE3B;;;OAGG;IACH,kBAFU,MAAM,CAEa;IAE7B;;;OAGG;IACH,oBAFU,MAAM,CAEmB;IAEnC;;;OAGG;IACH,6GAA+B;IAE/B;;;OAGG;IACH,+GAAiC;IAEjC;;;;OAIG;IACH,uBAAuC;IAG3C;;;OAGG;IACH,gBAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,GACJ,CAAC,CAWb;IAED;;OAEG;IACH,cAGC;IAED;;;;;;;;OAQG;IACH,wBAFW,MAAM,QAqChB;IAED;;;OAGG;IACH,oCAiCC;IAED,uBA2BC;IAED;;;;;OAKG;IACH,2CAcC;IAED;;;;;OAKG;IACH,4BAJW,CAAC,GACC,OAAO,CAWnB;IAED;;;;;;OAMG;IACH,4BAyDC;IAED,sBAQC;IAED;;;;OAIG;IACH,sBAmCC;IAED;;OAEG;IACH,sBAQC;IAED;;;;OAIG;IACH,sBA0BC;IAED;;;OAGG;IACH,gBAFW,QAAQ,iBAuBlB;IAED;;;OAGG;IACH,kCAQC;IAED;;;;;OAKG;IACH,oBAgBC;IAED;;;;OAIG;IACH,kBAMC;CACJ;iBAzfgB,+BAA+B;qBAG3B,WAAW;mBAFb,+BAA+B"}
1
+ {"version":3,"file":"ActionProcessor.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/undo/ActionProcessor.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH;IACI;;;;OAIG;IACH,0BA4DC;IA3DG;;;OAGG;IACH,SAFU,YAAY,CAEG;IAEzB;;;OAGG;IACH,aAAsB;IAEtB;;;OAGG;IACH,aAAe;IAEf;;OAEG;IACH,QAFU,MAAM,CAED;IAEf;;;OAGG;IACH,oBAFU,MAAM,CAEW;IAE3B;;;OAGG;IACH,kBAFU,MAAM,CAEa;IAE7B;;;OAGG;IACH,oBAFU,MAAM,CAEmB;IAEnC;;;OAGG;IACH,6GAA+B;IAE/B;;;OAGG;IACH,+GAAiC;IAEjC;;;;OAIG;IACH,uBAAuC;IAG3C;;;OAGG;IACH,gBAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,GACJ,CAAC,CAWb;IAED;;OAEG;IACH,cAGC;IAED;;;;;;;;OAQG;IACH,wBAFW,MAAM,QAuChB;IAED;;;OAGG;IACH,oCAiCC;IAED,uBA2BC;IAED;;;;;OAKG;IACH,2CAcC;IAED;;;;;OAKG;IACH,4BAJW,CAAC,GACC,OAAO,CAWnB;IAED;;;;;;OAMG;IACH,4BAyDC;IAED,sBAQC;IAED;;;;OAIG;IACH,sBAmCC;IAED;;OAEG;IACH,sBAQC;IAED;;;;OAIG;IACH,sBA0BC;IAED;;;OAGG;IACH,gBAFW,QAAQ,iBAuBlB;IAED;;;OAGG;IACH,kCAQC;IAED;;;;;OAKG;IACH,oBAgBC;IAED;;;;OAIG;IACH,kBAMC;CACJ;iBA3fgB,+BAA+B;qBAG3B,WAAW;mBAFb,+BAA+B"}
@@ -147,13 +147,15 @@ export class ActionProcessor {
147
147
  mark.index -= recordsToDrop;
148
148
  }
149
149
 
150
- //update cursor
151
- this.cursor -= recordsToDrop;
150
+ //update cursor (clamp: recordsToDrop can exceed the cursor, e.g. dropping history after some undos)
151
+ this.cursor = Math.max(0, this.cursor - recordsToDrop);
152
152
 
153
153
  // dispatch signal
154
154
  dropped_marks.forEach(this.onMarkRemoved.send1, this.onMarkRemoved);
155
155
 
156
- // update history
156
+ // update history: actually drop the records. List.crop(start, end) keeps [start, end), so this removes
157
+ // the first recordsToDrop records and keeps the remainder (consistent with the shifted marks/cursor).
158
+ this.history.crop(recordsToDrop, this.history.length);
157
159
 
158
160
  }
159
161
 
@@ -118,8 +118,8 @@ class WorkerBuilder {
118
118
  Array.prototype.push.apply(codeLines, [
119
119
  //language=js
120
120
  `function extractTransferables(obj, result) {
121
- if (typeof obj !== "object") {
122
- return; //not an object, skip
121
+ if (obj === null || typeof obj !== "object") {
122
+ return; //not an object (or null, which typeof reports as "object"), skip
123
123
  } else if (obj instanceof ArrayBuffer) {
124
124
  result.push(obj);
125
125
  } else if (obj.buffer instanceof ArrayBuffer) {
@@ -167,7 +167,7 @@ class WorkerBuilder {
167
167
  try {
168
168
  const method_result = method.apply(null, parameters);
169
169
 
170
- if(typeof method_result.then === "function"){
170
+ if(method_result != null && typeof method_result.then === "function"){
171
171
  // thenable
172
172
  method_result.then(sendResult, sendError);
173
173
  }else{
@@ -1 +1 @@
1
- {"version":3,"file":"AnimationCurve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/AnimationCurve.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,gDANwB,QAAQ;IAqZ5B;;;;OAIG;IACH,kBAHW,QAAQ,EAAE,GACR,cAAc,CAQ1B;IAED;;;;;;;;;OASG;IACH,6BANW,MAAM,eACN,MAAM,YACN,MAAM,aACN,MAAM,GACL,cAAc,CAUzB;IAED;;;;;;OAMG;IACH,4BALW,MAAM,YACN,MAAM,UACN,MAAM,GACL,cAAc,CAOzB;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,eACN,MAAM,YACN,MAAM,aACN,MAAM,GACL,cAAc,CAezB;IAldD;;;;;OAKG;IACH,eAFU,QAAQ,EAAE,CAEV;IAEV;;;;;OAKG;IACH,SAHW,QAAQ,GACN,MAAM,CAuClB;IAED;;;OAGG;IACH,cAFW,QAAQ,EAAE,QAUpB;IAED;;;;OAIG;IACH,YAHW,QAAQ,GACN,OAAO,CAYnB;IAED;;OAEG;IACH,cAEC;IAGD;;;OAGG;IACH,WAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,qBAEC;IAED;;;;OAIG;IACH,yBAUC;IAED;;;;OAIG;IACH,uBAUC;IAED;;;;OAIG;IACH,uBAcC;IAED;;;;;;OAMG;IACH,qBAHW,MAAM,GACJ,MAAM,CAmDlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACL,MAAM,CAoCjB;IAED;;;;OAIG;IACH,qBAFW,MAAM,QAmChB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;IAED;;OAEG;IACH,yBAQC;IAGD;;;OAGG;IACH,YAFW,cAAc,QAIxB;IAED;;;OAGG;IACH,SAFY,cAAc,CAQzB;IAED;;;;OAIG;IACH,cAHW,cAAc,GACb,OAAO,CAIlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;MAIC;IAED;;aAkBC;IAoFL;;;;OAIG;IACH,2BAFU,OAAO,CAEwB;IAGzC;;;OAGG;IACH,mBAA+B;IA9F3B,wDAQC;CAuEJ;yBA/ewB,eAAe"}
1
+ {"version":3,"file":"AnimationCurve.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/AnimationCurve.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,gDANwB,QAAQ;IAuZ5B;;;;OAIG;IACH,kBAHW,QAAQ,EAAE,GACR,cAAc,CAQ1B;IAED;;;;;;;;;OASG;IACH,6BANW,MAAM,eACN,MAAM,YACN,MAAM,aACN,MAAM,GACL,cAAc,CAUzB;IAED;;;;;;OAMG;IACH,4BALW,MAAM,YACN,MAAM,UACN,MAAM,GACL,cAAc,CAOzB;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,eACN,MAAM,YACN,MAAM,aACN,MAAM,GACL,cAAc,CAezB;IApdD;;;;;OAKG;IACH,eAFU,QAAQ,EAAE,CAEV;IAEV;;;;;OAKG;IACH,SAHW,QAAQ,GACN,MAAM,CAuClB;IAED;;;OAGG;IACH,cAFW,QAAQ,EAAE,QAUpB;IAED;;;;OAIG;IACH,YAHW,QAAQ,GACN,OAAO,CAYnB;IAED;;OAEG;IACH,cAEC;IAGD;;;OAGG;IACH,WAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,qBAEC;IAED;;;;OAIG;IACH,yBAUC;IAED;;;;OAIG;IACH,uBAUC;IAED;;;;OAIG;IACH,uBAcC;IAED;;;;;;OAMG;IACH,qBAHW,MAAM,GACJ,MAAM,CAmDlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACL,MAAM,CAoCjB;IAED;;;;OAIG;IACH,qBAFW,MAAM,QAqChB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;IAED;;OAEG;IACH,yBAQC;IAGD;;;OAGG;IACH,YAFW,cAAc,QAIxB;IAED;;;OAGG;IACH,SAFY,cAAc,CAQzB;IAED;;;;OAIG;IACH,cAHW,cAAc,GACb,OAAO,CAIlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;MAIC;IAED;;aAkBC;IAoFL;;;;OAIG;IACH,2BAFU,OAAO,CAEwB;IAGzC;;;OAGG;IACH,mBAA+B;IA9F3B,wDAQC;CAuEJ;yBAjfwB,eAAe"}
@@ -321,7 +321,9 @@ export class AnimationCurve {
321
321
  const time_span = key_main.time - key_previous.time;
322
322
  const value_span = key_main.value - key_previous.value;
323
323
 
324
- key_main.inTangent = value_span / time_span;
324
+ // a zero-width span (coincident keys) has no defined slope, treat it as flat
325
+ // to avoid NaN/Infinity, matching inverseLerp and AnimationCurve.linear
326
+ key_main.inTangent = time_span === 0 ? 0 : value_span / time_span;
325
327
  }
326
328
 
327
329
 
@@ -331,7 +333,7 @@ export class AnimationCurve {
331
333
  const time_span = key_next.time - key_main.time;
332
334
  const value_span = key_next.value - key_main.value;
333
335
 
334
- key_main.outTangent = value_span / time_span;
336
+ key_main.outTangent = time_span === 0 ? 0 : value_span / time_span;
335
337
  }
336
338
  }
337
339
 
@@ -537,7 +537,7 @@ For landing recovery, use the same form with `zeta = 0.55` so it overshoots once
537
537
  ### 5.4 Edge cases and rules
538
538
 
539
539
  - **Look-pitch clamp** is *non-wrapping*: the pitch is stored as a separate scalar so it cannot accidentally roll over. Yaw on the body wraps freely.
540
- - **Crouch under a ceiling**: if `intent.crouch` releases but the entity cannot stand up (raycast collides), the controller *holds* crouch and exposes `state.crouchBlocked = true`. Standing happens automatically when clear. This rule lives in the controller because it's universal; the raycast itself is a service-injection point.
540
+ - **Posture is intent-driven; ceilings only block RISING, never push you down**: low geometry constrains posture in exactly one direction. If `intent.crouch` releases but an *already-crouched* (or -prone) entity cannot grow into the taller posture (headroom up-cast collides), the controller *holds* the lower posture and exposes `state.crouchBlocked = true`; standing resumes automatically when clear. The converse is deliberately NOT done: a *standing* player who walks under a low overhang is **not** auto-crouched, and a crouching player who meets a sub-crouch overhang is **not** auto-proned. Their current-posture capsule simply doesn't fit, so the mover blocks their forward motion — "if I can't clear it, I don't move forward." Dropping to a lower stance is always the player's choice (press crouch / slide), never the ceiling's. This rule lives in the controller because it's universal; the headroom cast itself is a service-injection point.
541
541
  - **Sprint requires forward intent**: sideways-only or backwards movement should not consume exertion at sprint rates. Specifically `sprint = intent.sprint && intent.move.y > 0.5 && state.grounded`.
542
542
  - **No bob in air**: stride does not advance while `!grounded`. Phase freezes so landing doesn't re-fire a stale footstep.
543
543
  - **Jump cancel during anticipation**: if grounded becomes false during anticipation (e.g. ground pulled out), drop the queued impulse and emit `onLeaveGround{reason:"fall"}` without `onJumpStart`.