@woosh/meep-engine 3.40.0 → 3.42.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 (539) hide show
  1. package/build/bundle-worker-image-decoder.js +1 -1
  2. package/build/bundle-worker-terrain.js +1 -1
  3. package/editor/selection/editor_pick.d.ts.map +1 -1
  4. package/editor/selection/editor_pick.js +2 -1
  5. package/editor/tools/TransformToolV2.d.ts.map +1 -1
  6. package/editor/tools/TransformToolV2.js +7 -1
  7. package/editor/tools/engine/ToolEngine.d.ts.map +1 -1
  8. package/editor/tools/engine/ToolEngine.js +10 -0
  9. package/editor/tools/v2/TransformControls.d.ts.map +1 -1
  10. package/editor/tools/v2/TransformControls.js +7 -20
  11. package/editor/tools/v2/handle/gizmo_drag_plane.d.ts.map +1 -1
  12. package/editor/tools/v2/handle/gizmo_drag_plane.js +4 -0
  13. package/editor/view/ecs/EntityEditor.d.ts.map +1 -1
  14. package/editor/view/ecs/EntityEditor.js +3 -1
  15. package/editor/view/node-graph/NodeGraphView.d.ts.map +1 -1
  16. package/editor/view/node-graph/NodeGraphView.js +28 -12
  17. package/package.json +1 -1
  18. package/samples/engine/first-scene/index.html +4 -1
  19. package/samples/engine/first-scene/main.js +14 -9
  20. package/src/core/binary/utf8/utf8_decode.js +3 -3
  21. package/src/core/bvh2/binary/2/bvh32_query_user_data_ray.d.ts.map +1 -1
  22. package/src/core/bvh2/binary/2/bvh32_query_user_data_ray.js +112 -113
  23. package/src/core/bvh2/bvh3/ebvh_nodes_sort_sah_local4.js +2 -2
  24. package/src/core/cache/wtinylfu/benchmark/CacheWTinylfu.bench.md +14 -14
  25. package/src/core/collection/RingBuffer.d.ts.map +1 -1
  26. package/src/core/collection/RingBuffer.js +4 -0
  27. package/src/core/collection/array/array_contains_duplicates.d.ts.map +1 -1
  28. package/src/core/collection/array/array_contains_duplicates.js +2 -1
  29. package/src/core/collection/array/array_copy.d.ts.map +1 -1
  30. package/src/core/collection/array/array_copy.js +23 -0
  31. package/src/core/collection/array/typed/sparse_typed_array_hash.d.ts +2 -2
  32. package/src/core/collection/array/typed/sparse_typed_array_hash.d.ts.map +1 -1
  33. package/src/core/collection/array/typed/sparse_typed_array_hash.js +9 -8
  34. package/src/core/collection/array/typed/uint16_array_hash.d.ts +2 -2
  35. package/src/core/collection/array/typed/uint16_array_hash.js +4 -4
  36. package/src/core/collection/array/typed/uint8_array_hash.d.ts +2 -2
  37. package/src/core/collection/array/typed/uint8_array_hash.js +4 -4
  38. package/src/core/collection/array/weightedRandomFromArray.d.ts +1 -0
  39. package/src/core/collection/array/weightedRandomFromArray.d.ts.map +1 -1
  40. package/src/core/collection/array/weightedRandomFromArray.js +9 -1
  41. package/src/core/collection/heap/BinaryHeap.d.ts.map +1 -1
  42. package/src/core/collection/heap/BinaryHeap.js +4 -0
  43. package/src/core/collection/list/List.d.ts.map +1 -1
  44. package/src/core/collection/list/List.js +4 -2
  45. package/src/core/collection/set/ArraySet.js +1 -1
  46. package/src/core/collection/set/HashSet.d.ts +1 -1
  47. package/src/core/collection/set/HashSet.d.ts.map +1 -1
  48. package/src/core/collection/set/HashSet.js +4 -2
  49. package/src/core/debug/matchers/IsEqual.js +1 -1
  50. package/src/core/debug/matchers/IsIterableContaining.d.ts.map +1 -1
  51. package/src/core/debug/matchers/IsIterableContaining.js +61 -74
  52. package/src/core/events/signal/SignalBinding.js +101 -101
  53. package/src/core/function/extractFunctionBody.js +13 -13
  54. package/src/core/function/objectsEqual.d.ts.map +1 -1
  55. package/src/core/function/objectsEqual.js +15 -14
  56. package/src/core/geom/3d/frustum/frustum3_compute_closest_point.d.ts.map +1 -1
  57. package/src/core/geom/3d/frustum/frustum3_compute_closest_point.js +207 -172
  58. package/src/core/geom/3d/gjk/gjk_epa_penetration.d.ts.map +1 -1
  59. package/src/core/geom/3d/gjk/gjk_epa_penetration.js +5 -4
  60. package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.d.ts.map +1 -1
  61. package/src/core/geom/3d/line/line3_compute_segment_point_distance_eikonal.js +8 -2
  62. package/src/core/geom/3d/quaternion/swing_twist_clamp.d.ts +24 -0
  63. package/src/core/geom/3d/quaternion/swing_twist_clamp.d.ts.map +1 -0
  64. package/src/core/geom/3d/quaternion/swing_twist_clamp.js +62 -0
  65. package/src/core/geom/3d/quaternion/swing_twist_compose.d.ts +15 -0
  66. package/src/core/geom/3d/quaternion/swing_twist_compose.d.ts.map +1 -0
  67. package/src/core/geom/3d/quaternion/swing_twist_compose.js +36 -0
  68. package/src/core/geom/3d/quaternion/swing_twist_error.d.ts +39 -0
  69. package/src/core/geom/3d/quaternion/swing_twist_error.d.ts.map +1 -0
  70. package/src/core/geom/3d/quaternion/swing_twist_error.js +85 -0
  71. package/src/core/geom/3d/triangle/tri3_ray_intersection.d.ts +20 -0
  72. package/src/core/geom/3d/triangle/tri3_ray_intersection.d.ts.map +1 -1
  73. package/src/core/geom/3d/triangle/tri3_ray_intersection.js +182 -0
  74. package/src/core/geom/vec3/v3_rigid_align_paired_unit_vectors.d.ts +11 -6
  75. package/src/core/geom/vec3/v3_rigid_align_paired_unit_vectors.d.ts.map +1 -1
  76. package/src/core/geom/vec3/v3_rigid_align_paired_unit_vectors.js +27 -13
  77. package/src/core/math/linalg/eigen/matrix_symmetric_4x4_eigen.d.ts +25 -0
  78. package/src/core/math/linalg/eigen/matrix_symmetric_4x4_eigen.d.ts.map +1 -0
  79. package/src/core/math/linalg/eigen/matrix_symmetric_4x4_eigen.js +166 -0
  80. package/src/core/math/linalg/eigen/matrix_top_eigenvector_power_iteration.d.ts +5 -3
  81. package/src/core/math/linalg/eigen/matrix_top_eigenvector_power_iteration.d.ts.map +1 -1
  82. package/src/core/math/linalg/eigen/matrix_top_eigenvector_power_iteration.js +5 -3
  83. package/src/core/math/noise/curl_noise_3dt.d.ts.map +1 -1
  84. package/src/core/math/noise/curl_noise_3dt.js +20 -10
  85. package/src/core/math/noise/sdnoise.d.ts +16 -5
  86. package/src/core/math/noise/sdnoise.d.ts.map +1 -1
  87. package/src/core/math/noise/sdnoise.js +43 -9
  88. package/src/core/math/spline/spline3_hermite_nearest_point.d.ts +16 -1
  89. package/src/core/math/spline/spline3_hermite_nearest_point.d.ts.map +1 -1
  90. package/src/core/math/spline/spline3_hermite_nearest_point.js +44 -3
  91. package/src/engine/Engine.d.ts.map +1 -1
  92. package/src/engine/Engine.js +6 -2
  93. package/src/engine/animation/curve/AnimationCurve.d.ts +3 -0
  94. package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
  95. package/src/engine/animation/curve/AnimationCurve.js +6 -1
  96. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +9 -0
  97. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
  98. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +26 -0
  99. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
  100. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +2 -0
  101. package/src/engine/control/first-person/abilities/AbilitySet.d.ts.map +1 -1
  102. package/src/engine/control/first-person/abilities/AbilitySet.js +9 -0
  103. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -1
  104. package/src/engine/control/first-person/abilities/LedgeGrab.js +6 -0
  105. package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -1
  106. package/src/engine/control/first-person/abilities/Slide.js +1 -0
  107. package/src/engine/control/first-person/abilities/WallRun.d.ts +4 -1
  108. package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -1
  109. package/src/engine/control/first-person/abilities/WallRun.js +13 -1
  110. package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts +1 -1
  111. package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts.map +1 -1
  112. package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.js +6 -5
  113. package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts +3 -3
  114. package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts.map +1 -1
  115. package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.js +9 -8
  116. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -1
  117. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +13 -4
  118. package/src/engine/ecs/EntityManager.d.ts +9 -1
  119. package/src/engine/ecs/EntityManager.d.ts.map +1 -1
  120. package/src/engine/ecs/EntityManager.js +44 -42
  121. package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.d.ts.map +1 -1
  122. package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +2 -1
  123. package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.d.ts.map +1 -1
  124. package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.js +1 -0
  125. package/src/engine/ecs/fow/FogOfWarRevealerSystem.d.ts.map +1 -1
  126. package/src/engine/ecs/fow/FogOfWarRevealerSystem.js +3 -0
  127. package/src/engine/ecs/gpu/GPUStateAuthority.d.ts +20 -0
  128. package/src/engine/ecs/gpu/GPUStateAuthority.d.ts.map +1 -1
  129. package/src/engine/ecs/gpu/GPUStateAuthority.js +21 -0
  130. package/src/engine/ecs/gpu/GPU_AUTHORITY_EVENT_HOLD_CHANGE.d.ts +13 -0
  131. package/src/engine/ecs/gpu/GPU_AUTHORITY_EVENT_HOLD_CHANGE.d.ts.map +1 -0
  132. package/src/engine/ecs/gpu/GPU_AUTHORITY_EVENT_HOLD_CHANGE.js +12 -0
  133. package/src/engine/ecs/gpu/gpu_authority_grant.d.ts +6 -0
  134. package/src/engine/ecs/gpu/gpu_authority_grant.d.ts.map +1 -1
  135. package/src/engine/ecs/gpu/gpu_authority_grant.js +7 -1
  136. package/src/engine/ecs/gpu/gpu_authority_held.d.ts +14 -0
  137. package/src/engine/ecs/gpu/gpu_authority_held.d.ts.map +1 -0
  138. package/src/engine/ecs/gpu/gpu_authority_held.js +23 -0
  139. package/src/engine/ecs/gpu/gpu_authority_hold.d.ts +23 -0
  140. package/src/engine/ecs/gpu/gpu_authority_hold.d.ts.map +1 -0
  141. package/src/engine/ecs/gpu/gpu_authority_hold.js +41 -0
  142. package/src/engine/ecs/gpu/gpu_authority_unhold.d.ts +14 -0
  143. package/src/engine/ecs/gpu/gpu_authority_unhold.d.ts.map +1 -0
  144. package/src/engine/ecs/gpu/gpu_authority_unhold.js +32 -0
  145. package/src/engine/ecs/ik/IKGoal.d.ts +59 -0
  146. package/src/engine/ecs/ik/IKGoal.d.ts.map +1 -0
  147. package/src/engine/ecs/ik/IKGoal.js +83 -0
  148. package/src/engine/ecs/ik/IKGoalSystem.d.ts +75 -0
  149. package/src/engine/ecs/ik/IKGoalSystem.d.ts.map +1 -0
  150. package/src/engine/ecs/ik/IKGoalSystem.js +1456 -0
  151. package/src/engine/ecs/ik/PLAN.md +179 -0
  152. package/src/engine/ecs/parent/EntityNode.js +3 -3
  153. package/src/engine/ecs/speaker/VoiceSystem.d.ts +2 -2
  154. package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
  155. package/src/engine/ecs/speaker/VoiceSystem.js +4 -0
  156. package/src/engine/ecs/storage/BinaryBufferDeSerializer.js +5 -5
  157. package/src/engine/ecs/storage/BinaryBufferSerializer.d.ts.map +1 -1
  158. package/src/engine/ecs/storage/BinaryBufferSerializer.js +4 -5
  159. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts.map +1 -1
  160. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +3 -2
  161. package/src/engine/ecs/storage/binary/SERIALIZATION_COVERAGE.md +7 -3
  162. package/src/engine/ecs/storage/binary/object/BinaryObjectSerializationAdapter2.js +1 -1
  163. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.d.ts.map +1 -1
  164. package/src/engine/ecs/storage/binary/object-v2/BinaryObjectDeSerializer.js +8 -1
  165. package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
  166. package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +9 -2
  167. package/src/engine/ecs/system/orderSystemsByDeclaredAccess.d.ts +33 -0
  168. package/src/engine/ecs/system/orderSystemsByDeclaredAccess.d.ts.map +1 -0
  169. package/src/engine/ecs/system/orderSystemsByDeclaredAccess.js +282 -0
  170. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts.map +1 -1
  171. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.js +5 -2
  172. package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.d.ts.map +1 -1
  173. package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.js +3 -0
  174. package/src/engine/ecs/terrain/ecs/splat/SplatMapping.d.ts.map +1 -1
  175. package/src/engine/ecs/terrain/ecs/splat/SplatMapping.js +1 -0
  176. package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +1 -1
  177. package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts.map +1 -1
  178. package/src/engine/ecs/terrain/tiles/TerrainTile.js +13 -1
  179. package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
  180. package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +1 -0
  181. package/src/engine/ecs/transform/T64WorldCache.js +139 -139
  182. package/src/engine/ecs/transform/t64_evaluate_local.d.ts +25 -0
  183. package/src/engine/ecs/transform/t64_evaluate_local.d.ts.map +1 -0
  184. package/src/engine/ecs/transform/t64_evaluate_local.js +35 -0
  185. package/src/engine/ecs/transform/t64_evaluate_world.d.ts +5 -3
  186. package/src/engine/ecs/transform/t64_evaluate_world.d.ts.map +1 -1
  187. package/src/engine/ecs/transform/t64_evaluate_world.js +128 -126
  188. package/src/engine/graphics/ecs/light/LightSerializationAdapter.d.ts.map +1 -1
  189. package/src/engine/graphics/ecs/light/LightSerializationAdapter.js +13 -1
  190. package/src/engine/graphics/ecs/light/LightSerializationUpgrader_0_1.d.ts +5 -0
  191. package/src/engine/graphics/ecs/light/LightSerializationUpgrader_0_1.d.ts.map +1 -0
  192. package/src/engine/graphics/ecs/light/LightSerializationUpgrader_0_1.js +27 -0
  193. package/src/engine/graphics/ecs/water/Water.d.ts +11 -0
  194. package/src/engine/graphics/ecs/water/Water.d.ts.map +1 -1
  195. package/src/engine/graphics/ecs/water/Water.js +17 -0
  196. package/src/engine/graphics/ecs/water/WaterSerializationAdapter.d.ts.map +1 -1
  197. package/src/engine/graphics/ecs/water/WaterSerializationAdapter.js +3 -1
  198. package/src/engine/graphics/ecs/water/WaterSerializationUpgrader_4_5.d.ts +9 -0
  199. package/src/engine/graphics/ecs/water/WaterSerializationUpgrader_4_5.d.ts.map +1 -0
  200. package/src/engine/graphics/ecs/water/WaterSerializationUpgrader_4_5.js +24 -0
  201. package/src/engine/graphics/ecs/water/WaterWaves.d.ts +30 -9
  202. package/src/engine/graphics/ecs/water/WaterWaves.d.ts.map +1 -1
  203. package/src/engine/graphics/ecs/water/WaterWaves.js +41 -9
  204. package/src/engine/graphics/ecs/water/WaterWavesSerializationAdapter.d.ts.map +1 -1
  205. package/src/engine/graphics/ecs/water/WaterWavesSerializationAdapter.js +30 -26
  206. package/src/engine/graphics/ecs/water/WaterWavesSerializationUpgrader_0_1.d.ts +6 -0
  207. package/src/engine/graphics/ecs/water/WaterWavesSerializationUpgrader_0_1.d.ts.map +1 -0
  208. package/src/engine/graphics/ecs/water/WaterWavesSerializationUpgrader_0_1.js +22 -0
  209. package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_raycast.d.ts.map +1 -1
  210. package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_raycast.js +3 -5
  211. package/src/engine/graphics/texture/3d/scs3d_sample_linear3.d.ts +20 -0
  212. package/src/engine/graphics/texture/3d/scs3d_sample_linear3.d.ts.map +1 -1
  213. package/src/engine/graphics/texture/3d/scs3d_sample_linear3.js +36 -0
  214. package/src/engine/graphics3/AnimationGraphSystem.d.ts +2 -0
  215. package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
  216. package/src/engine/graphics3/AnimationGraphSystem.js +337 -329
  217. package/src/engine/graphics3/AnimationSystem.d.ts +2 -0
  218. package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
  219. package/src/engine/graphics3/AnimationSystem.js +360 -352
  220. package/src/engine/graphics3/WaterSystem.d.ts +12 -3
  221. package/src/engine/graphics3/WaterSystem.d.ts.map +1 -1
  222. package/src/engine/graphics3/WaterSystem.js +78 -46
  223. package/src/engine/input/devices/PointerDevice.d.ts.map +1 -1
  224. package/src/engine/input/devices/PointerDevice.js +29 -4
  225. package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -0
  226. package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts.map +1 -1
  227. package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +14 -3
  228. package/src/engine/physics/cloth/MEASUREMENTS.md +130 -0
  229. package/src/engine/physics/cloth/PLAN.md +16 -1
  230. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts +5 -6
  231. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts.map +1 -1
  232. package/src/engine/physics/cloth/ecs/ClothColliderSystem.js +5 -6
  233. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +4 -7
  234. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
  235. package/src/engine/physics/cloth/ecs/ClothInstance.js +4 -7
  236. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +4 -3
  237. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
  238. package/src/engine/physics/cloth/ecs/ClothSystem.js +4 -3
  239. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
  240. package/src/engine/physics/cloth/ecs/ClothWorld.js +10 -0
  241. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +24 -24
  242. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -1
  243. package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +46 -43
  244. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +1 -1
  245. package/src/engine/physics/cloth/ecs/cloth_write_back.js +1 -1
  246. package/src/engine/physics/constraint/solve_constraints.d.ts +0 -35
  247. package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
  248. package/src/engine/physics/constraint/solve_constraints.js +1 -83
  249. package/src/engine/physics/ecs/ContactProbe.d.ts +73 -0
  250. package/src/engine/physics/ecs/ContactProbe.d.ts.map +1 -0
  251. package/src/engine/physics/ecs/ContactProbe.js +103 -0
  252. package/src/engine/physics/ecs/ContactProbeSystem.d.ts +44 -0
  253. package/src/engine/physics/ecs/ContactProbeSystem.d.ts.map +1 -0
  254. package/src/engine/physics/ecs/ContactProbeSystem.js +397 -0
  255. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +1 -1
  256. package/src/engine/physics/fluid/ecs/FluidComponent.js +1 -1
  257. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  258. package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.d.ts.map +1 -1
  259. package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.js +12 -3
  260. package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.d.ts.map +1 -1
  261. package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.js +8 -2
  262. package/src/engine/physics/fluid/solver/v3_grid_sample_scalar_masked.d.ts +19 -0
  263. package/src/engine/physics/fluid/solver/v3_grid_sample_scalar_masked.d.ts.map +1 -1
  264. package/src/engine/physics/fluid/solver/v3_grid_sample_scalar_masked.js +41 -2
  265. package/src/engine/physics/fluid/solver/v3_mac_advect_scalar.d.ts.map +1 -1
  266. package/src/engine/physics/fluid/solver/v3_mac_advect_scalar.js +9 -3
  267. package/src/engine/physics/fluid/solver/v3_mac_advect_sl_velocity.d.ts.map +1 -1
  268. package/src/engine/physics/fluid/solver/v3_mac_advect_sl_velocity.js +26 -10
  269. package/src/engine/physics/inverse_kinematics/frame_fabrik/FrameFabrikProblem.d.ts +205 -0
  270. package/src/engine/physics/inverse_kinematics/frame_fabrik/FrameFabrikProblem.d.ts.map +1 -0
  271. package/src/engine/physics/inverse_kinematics/frame_fabrik/FrameFabrikProblem.js +245 -0
  272. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_limit_from_joint.d.ts +21 -0
  273. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_limit_from_joint.d.ts.map +1 -0
  274. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_limit_from_joint.js +63 -0
  275. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.d.ts +33 -0
  276. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.d.ts.map +1 -0
  277. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.js +874 -0
  278. package/src/engine/physics/inverse_kinematics/joint_hinge_mid_axis.d.ts +27 -0
  279. package/src/engine/physics/inverse_kinematics/joint_hinge_mid_axis.d.ts.map +1 -0
  280. package/src/engine/physics/inverse_kinematics/joint_hinge_mid_axis.js +77 -0
  281. package/src/engine/physics/inverse_kinematics/two_bone_path_solve.d.ts +36 -0
  282. package/src/engine/physics/inverse_kinematics/two_bone_path_solve.d.ts.map +1 -0
  283. package/src/engine/physics/inverse_kinematics/two_bone_path_solve.js +97 -0
  284. package/src/engine/physics/inverse_kinematics/two_joint_ik.d.ts +33 -11
  285. package/src/engine/physics/inverse_kinematics/two_joint_ik.d.ts.map +1 -1
  286. package/src/engine/physics/inverse_kinematics/two_joint_ik.js +158 -67
  287. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.d.ts +3 -6
  288. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.d.ts.map +1 -1
  289. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +22 -9
  290. package/src/engine/ui/DraggableAspect.d.ts +5 -1
  291. package/src/engine/ui/DraggableAspect.d.ts.map +1 -1
  292. package/src/engine/ui/DraggableAspect.js +61 -4
  293. package/src/format/image/avif/heif/ItemProperty.d.ts +1 -1
  294. package/src/format/image/avif/heif/ItemProperty.js +1 -1
  295. package/src/format/image/png/chunk/png_chunk_decode_iTXt.d.ts.map +1 -1
  296. package/src/format/image/png/chunk/png_chunk_decode_iTXt.js +17 -6
  297. package/src/shade/device/mock/SoftwareGPUDevice.d.ts +2 -4
  298. package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
  299. package/src/shade/device/mock/SoftwareGPUDevice.js +20 -13
  300. package/src/shade/playground/skinned_blas_refit/sweep_views.d.ts.map +1 -1
  301. package/src/shade/playground/skinned_blas_refit/sweep_views.js +2 -1
  302. package/src/shade/playground/water_refraction/README.md +10 -11
  303. package/src/shade/playground/water_refraction/main.js +9 -8
  304. package/src/shade/playground/water_refraction/world.js +1 -1
  305. package/src/shade/playground/water_surface/README.md +43 -0
  306. package/src/shade/playground/water_surface/index.html +30 -0
  307. package/src/shade/playground/water_surface/main.d.ts +2 -0
  308. package/src/shade/playground/water_surface/main.d.ts.map +1 -0
  309. package/src/shade/playground/water_surface/main.js +154 -0
  310. package/src/shade/playground/water_surface/world.d.ts +44 -0
  311. package/src/shade/playground/water_surface/world.d.ts.map +1 -0
  312. package/src/shade/playground/water_surface/world.js +160 -0
  313. package/src/shade/renderer/animation/ANIMATION_TRACK_BINDING_STRUCT.d.ts.map +1 -1
  314. package/src/shade/renderer/animation/ANIMATION_TRACK_BINDING_STRUCT.js +10 -1
  315. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +10 -4
  316. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  317. package/src/shade/renderer/animation/GPUAnimationManager.js +251 -23
  318. package/src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.d.ts +12 -4
  319. package/src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.d.ts.map +1 -1
  320. package/src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.js +12 -4
  321. package/src/shade/renderer/animation/chunk_pose_accumulator.d.ts.map +1 -1
  322. package/src/shade/renderer/animation/chunk_pose_accumulator.js +14 -1
  323. package/src/shade/renderer/animation/pose/PoseChannelIndex.d.ts +78 -0
  324. package/src/shade/renderer/animation/pose/PoseChannelIndex.d.ts.map +1 -0
  325. package/src/shade/renderer/animation/pose/PoseChannelIndex.js +274 -0
  326. package/src/shade/renderer/animation/pose/PosePlayback.d.ts +40 -3
  327. package/src/shade/renderer/animation/pose/PosePlayback.d.ts.map +1 -1
  328. package/src/shade/renderer/animation/pose/PosePlayback.js +77 -3
  329. package/src/shade/renderer/animation/pose/pose_evaluate_local.d.ts +21 -3
  330. package/src/shade/renderer/animation/pose/pose_evaluate_local.d.ts.map +1 -1
  331. package/src/shade/renderer/animation/pose/pose_evaluate_local.js +79 -11
  332. package/src/shade/renderer/animation/shader_animation_apply.js +1 -1
  333. package/src/shade/renderer/animation/shader_animation_pose_resolve.d.ts +3 -2
  334. package/src/shade/renderer/animation/shader_animation_pose_resolve.d.ts.map +1 -1
  335. package/src/shade/renderer/animation/shader_animation_pose_resolve.js +187 -176
  336. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  337. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +5 -0
  338. package/src/shade/renderer/binding/BufferBinding.js +2 -2
  339. package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts.map +1 -1
  340. package/src/shade/renderer/buffer/table/GPUTypedTable.js +5 -3
  341. package/src/shade/renderer/buffer/table/GPUTypedTableDescriptor.d.ts +10 -3
  342. package/src/shade/renderer/buffer/table/GPUTypedTableDescriptor.d.ts.map +1 -1
  343. package/src/shade/renderer/buffer/table/GPUTypedTableDescriptor.js +17 -9
  344. package/src/shade/renderer/camera/orbital/OrbitalCameraInput.d.ts +3 -0
  345. package/src/shade/renderer/camera/orbital/OrbitalCameraInput.d.ts.map +1 -1
  346. package/src/shade/renderer/camera/orbital/OrbitalCameraInput.js +16 -0
  347. package/src/shade/renderer/camera/orbital/OrbitalCameraRig.d.ts +2 -0
  348. package/src/shade/renderer/camera/orbital/OrbitalCameraRig.d.ts.map +1 -1
  349. package/src/shade/renderer/camera/orbital/OrbitalCameraRig.js +11 -0
  350. package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.d.ts +1 -1
  351. package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.d.ts.map +1 -1
  352. package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.js +9 -3
  353. package/src/shade/renderer/geometry/util/geometry_simplify_redundant_topology.d.ts.map +1 -1
  354. package/src/shade/renderer/geometry/util/geometry_simplify_redundant_topology.js +2 -2
  355. package/src/shade/renderer/geometry/virtual/format/vgeo_validate_container.d.ts.map +1 -1
  356. package/src/shade/renderer/geometry/virtual/format/vgeo_validate_container.js +85 -0
  357. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
  358. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +12 -6
  359. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts.map +1 -1
  360. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.js +7 -0
  361. package/src/shade/renderer/geometry/virtual/runtime/VGeoRuntimeTables.d.ts.map +1 -1
  362. package/src/shade/renderer/geometry/virtual/runtime/VGeoRuntimeTables.js +3 -1
  363. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  364. package/src/shade/renderer/object_property/chunk_write_object_property.d.ts +3 -1
  365. package/src/shade/renderer/object_property/chunk_write_object_property.d.ts.map +1 -1
  366. package/src/shade/renderer/object_property/chunk_write_object_property.js +5 -2
  367. package/src/shade/renderer/object_property/chunk_write_object_property_node3d.d.ts +4 -0
  368. package/src/shade/renderer/object_property/chunk_write_object_property_node3d.d.ts.map +1 -1
  369. package/src/shade/renderer/object_property/chunk_write_object_property_node3d.js +6 -1
  370. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  371. package/src/shade/renderer/scene/SCENE_DATABASE_SPEC.js +2 -1
  372. package/src/shade/renderer/scene/optimization/geometry/geometry_deduplicate.d.ts +1 -1
  373. package/src/shade/renderer/scene/optimization/geometry/geometry_deduplicate.d.ts.map +1 -1
  374. package/src/shade/renderer/scene/optimization/geometry/geometry_deduplicate.js +135 -73
  375. package/src/shade/renderer/scene/optimization/geometry/internal/cover_greedy.d.ts +7 -0
  376. package/src/shade/renderer/scene/optimization/geometry/internal/cover_greedy.d.ts.map +1 -1
  377. package/src/shade/renderer/scene/optimization/geometry/internal/cover_greedy.js +29 -1
  378. package/src/shade/renderer/scene/optimization/geometry/internal/face_neighbourhood_hash.d.ts +19 -0
  379. package/src/shade/renderer/scene/optimization/geometry/internal/face_neighbourhood_hash.d.ts.map +1 -0
  380. package/src/shade/renderer/scene/optimization/geometry/internal/face_neighbourhood_hash.js +167 -0
  381. package/src/shade/renderer/scene/optimization/geometry/internal/neighbourhood_anchor_index.d.ts +25 -0
  382. package/src/shade/renderer/scene/optimization/geometry/internal/neighbourhood_anchor_index.d.ts.map +1 -0
  383. package/src/shade/renderer/scene/optimization/geometry/internal/neighbourhood_anchor_index.js +124 -0
  384. package/src/shade/renderer/scene/optimization/geometry/internal/seed_correspondence_from_face_pair.d.ts +19 -0
  385. package/src/shade/renderer/scene/optimization/geometry/internal/seed_correspondence_from_face_pair.d.ts.map +1 -0
  386. package/src/shade/renderer/scene/optimization/geometry/internal/seed_correspondence_from_face_pair.js +48 -0
  387. package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts +17 -1
  388. package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts.map +1 -1
  389. package/src/shade/renderer/scene/rows/GPUSceneRows.js +29 -3
  390. package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128_inverse.d.ts +13 -0
  391. package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128_inverse.d.ts.map +1 -0
  392. package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128_inverse.js +42 -0
  393. package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128x4_inverse_workgroup.d.ts +15 -0
  394. package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128x4_inverse_workgroup.d.ts.map +1 -0
  395. package/src/shade/renderer/shader/chunk/math/fft/chunk_fft128x4_inverse_workgroup.js +39 -0
  396. package/src/shade/renderer/shader/resource/ShaderResourceSetDescriptor.d.ts.map +1 -1
  397. package/src/shade/renderer/shader/resource/ShaderResourceSetDescriptor.js +2 -0
  398. package/src/shade/renderer/water/GPUWaterRenderer.d.ts +15 -0
  399. package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
  400. package/src/shade/renderer/water/GPUWaterRenderer.js +110 -30
  401. package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts +16 -8
  402. package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
  403. package/src/shade/renderer/water/medium/GPUWaterBodies.js +31 -26
  404. package/src/shade/renderer/water/medium/shader_water_meshlets.d.ts +0 -1
  405. package/src/shade/renderer/water/medium/shader_water_meshlets.d.ts.map +1 -1
  406. package/src/shade/renderer/water/medium/shader_water_meshlets.js +1 -39
  407. package/src/shade/renderer/water/shader_water.d.ts +0 -1
  408. package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
  409. package/src/shade/renderer/water/shader_water.js +201 -72
  410. package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts +70 -0
  411. package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -0
  412. package/src/shade/renderer/water/surface/GPUWaterSurface.js +199 -0
  413. package/src/shade/renderer/water/surface/WATER_WAVE_RECORD_STRUCT.d.ts +5 -2
  414. package/src/shade/renderer/water/surface/WATER_WAVE_RECORD_STRUCT.d.ts.map +1 -1
  415. package/src/shade/renderer/water/surface/WATER_WAVE_RECORD_STRUCT.js +32 -12
  416. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +22 -0
  417. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts.map +1 -0
  418. package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +217 -0
  419. package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts +65 -11
  420. package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
  421. package/src/shade/renderer/water/surface/graph_water_tessellation.js +163 -28
  422. package/src/shade/renderer/water/surface/lod/WATER_LOD.d.ts +51 -0
  423. package/src/shade/renderer/water/surface/lod/WATER_LOD.d.ts.map +1 -0
  424. package/src/shade/renderer/water/surface/lod/WATER_LOD.js +95 -0
  425. package/src/shade/renderer/water/surface/lod/chunk_water_lod.d.ts +10 -0
  426. package/src/shade/renderer/water/surface/lod/chunk_water_lod.d.ts.map +1 -0
  427. package/src/shade/renderer/water/surface/lod/chunk_water_lod.js +127 -0
  428. package/src/shade/renderer/water/surface/lod/chunk_water_lod_cell.d.ts +17 -0
  429. package/src/shade/renderer/water/surface/lod/chunk_water_lod_cell.d.ts.map +1 -0
  430. package/src/shade/renderer/water/surface/lod/chunk_water_lod_cell.js +246 -0
  431. package/src/shade/renderer/water/surface/lod/shader_water_lod.d.ts +118 -0
  432. package/src/shade/renderer/water/surface/lod/shader_water_lod.d.ts.map +1 -0
  433. package/src/shade/renderer/water/surface/lod/shader_water_lod.js +727 -0
  434. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts +60 -0
  435. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -0
  436. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +228 -0
  437. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts +17 -0
  438. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -0
  439. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +49 -0
  440. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +22 -0
  441. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -0
  442. package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +143 -0
  443. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +15 -0
  444. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -0
  445. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +121 -0
  446. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +83 -0
  447. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -0
  448. package/src/shade/renderer/water/surface/particles/shader_water_particles.js +502 -0
  449. package/src/shade/renderer/water/surface/shader_water_cull.d.ts +42 -0
  450. package/src/shade/renderer/water/surface/shader_water_cull.d.ts.map +1 -0
  451. package/src/shade/renderer/water/surface/shader_water_cull.js +269 -0
  452. package/src/shade/renderer/water/surface/shader_water_waves_combine.d.ts +15 -0
  453. package/src/shade/renderer/water/surface/shader_water_waves_combine.d.ts.map +1 -0
  454. package/src/shade/renderer/water/surface/shader_water_waves_combine.js +73 -0
  455. package/src/shade/renderer/water/surface/shader_water_waves_derive.d.ts +11 -0
  456. package/src/shade/renderer/water/surface/shader_water_waves_derive.d.ts.map +1 -0
  457. package/src/shade/renderer/water/surface/shader_water_waves_derive.js +78 -0
  458. package/src/shade/renderer/water/surface/spectrum/GPUWaterSpectrum.d.ts +35 -0
  459. package/src/shade/renderer/water/surface/spectrum/GPUWaterSpectrum.d.ts.map +1 -0
  460. package/src/shade/renderer/water/surface/spectrum/GPUWaterSpectrum.js +103 -0
  461. package/src/shade/renderer/water/surface/spectrum/WATER_BAND_STATE.d.ts +22 -0
  462. package/src/shade/renderer/water/surface/spectrum/WATER_BAND_STATE.d.ts.map +1 -0
  463. package/src/shade/renderer/water/surface/spectrum/WATER_BAND_STATE.js +57 -0
  464. package/src/shade/renderer/water/surface/spectrum/WATER_SPECTRUM.d.ts +22 -0
  465. package/src/shade/renderer/water/surface/spectrum/WATER_SPECTRUM.d.ts.map +1 -0
  466. package/src/shade/renderer/water/surface/spectrum/WATER_SPECTRUM.js +25 -0
  467. package/src/shade/renderer/water/surface/spectrum/chunk_water_jonswap.d.ts +14 -0
  468. package/src/shade/renderer/water/surface/spectrum/chunk_water_jonswap.d.ts.map +1 -0
  469. package/src/shade/renderer/water/surface/spectrum/chunk_water_jonswap.js +48 -0
  470. package/src/shade/renderer/water/surface/spectrum/chunk_water_spectrum.d.ts +23 -0
  471. package/src/shade/renderer/water/surface/spectrum/chunk_water_spectrum.d.ts.map +1 -0
  472. package/src/shade/renderer/water/surface/spectrum/chunk_water_spectrum.js +169 -0
  473. package/src/shade/renderer/water/surface/spectrum/shader_water_spectrum.d.ts +26 -0
  474. package/src/shade/renderer/water/surface/spectrum/shader_water_spectrum.d.ts.map +1 -0
  475. package/src/shade/renderer/water/surface/spectrum/shader_water_spectrum.js +161 -0
  476. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts.map +1 -1
  477. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +18 -6
  478. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  479. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +11 -3
  480. package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.d.ts +0 -28
  481. package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.d.ts.map +0 -1
  482. package/src/core/geom/2d/polygon/polygon2_triangulate.corpus.js +0 -86
  483. package/src/engine/ecs/ik/IKConstraint.d.ts +0 -52
  484. package/src/engine/ecs/ik/IKConstraint.d.ts.map +0 -1
  485. package/src/engine/ecs/ik/IKConstraint.js +0 -95
  486. package/src/engine/ecs/ik/IKProblem.d.ts +0 -45
  487. package/src/engine/ecs/ik/IKProblem.d.ts.map +0 -1
  488. package/src/engine/ecs/ik/IKProblem.js +0 -58
  489. package/src/engine/ecs/ik/IKSolver.d.ts +0 -8
  490. package/src/engine/ecs/ik/IKSolver.d.ts.map +0 -1
  491. package/src/engine/ecs/ik/IKSolver.js +0 -9
  492. package/src/engine/ecs/ik/InverseKinematics.d.ts +0 -48
  493. package/src/engine/ecs/ik/InverseKinematics.d.ts.map +0 -1
  494. package/src/engine/ecs/ik/InverseKinematics.js +0 -119
  495. package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.d.ts +0 -19
  496. package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.d.ts.map +0 -1
  497. package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.js +0 -72
  498. package/src/engine/ecs/ik/InverseKinematicsSystem.d.ts +0 -54
  499. package/src/engine/ecs/ik/InverseKinematicsSystem.d.ts.map +0 -1
  500. package/src/engine/ecs/ik/InverseKinematicsSystem.js +0 -212
  501. package/src/engine/ecs/ik/OneBoneSurfaceAlignmentSolver.d.ts +0 -8
  502. package/src/engine/ecs/ik/OneBoneSurfaceAlignmentSolver.d.ts.map +0 -1
  503. package/src/engine/ecs/ik/OneBoneSurfaceAlignmentSolver.js +0 -153
  504. package/src/engine/ecs/ik/TwoBoneInverseKinematicsSolver.d.ts +0 -5
  505. package/src/engine/ecs/ik/TwoBoneInverseKinematicsSolver.d.ts.map +0 -1
  506. package/src/engine/ecs/ik/TwoBoneInverseKinematicsSolver.js +0 -120
  507. package/src/engine/ecs/ik/ik_bone_chain.d.ts +0 -64
  508. package/src/engine/ecs/ik/ik_bone_chain.d.ts.map +0 -1
  509. package/src/engine/ecs/ik/ik_bone_chain.js +0 -142
  510. package/src/engine/ecs/ik/ik_probe_terrain_contact.d.ts +0 -42
  511. package/src/engine/ecs/ik/ik_probe_terrain_contact.d.ts.map +0 -1
  512. package/src/engine/ecs/ik/ik_probe_terrain_contact.js +0 -123
  513. package/src/engine/ecs/ik/ik_write_local_rotation.d.ts +0 -18
  514. package/src/engine/ecs/ik/ik_write_local_rotation.d.ts.map +0 -1
  515. package/src/engine/ecs/ik/ik_write_local_rotation.js +0 -32
  516. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts +0 -29
  517. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts.map +0 -1
  518. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.js +0 -44
  519. package/src/shade/renderer/water/medium/shader_water_bodies_derive.d.ts +0 -4
  520. package/src/shade/renderer/water/medium/shader_water_bodies_derive.d.ts.map +0 -1
  521. package/src/shade/renderer/water/medium/shader_water_bodies_derive.js +0 -32
  522. package/src/shade/renderer/water/surface/GPUWaterWaveSimulation.d.ts +0 -25
  523. package/src/shade/renderer/water/surface/GPUWaterWaveSimulation.d.ts.map +0 -1
  524. package/src/shade/renderer/water/surface/GPUWaterWaveSimulation.js +0 -128
  525. package/src/shade/renderer/water/surface/chunk_water_tessellation.d.ts +0 -9
  526. package/src/shade/renderer/water/surface/chunk_water_tessellation.d.ts.map +0 -1
  527. package/src/shade/renderer/water/surface/chunk_water_tessellation.js +0 -144
  528. package/src/shade/renderer/water/surface/chunk_water_wave.d.ts +0 -13
  529. package/src/shade/renderer/water/surface/chunk_water_wave.d.ts.map +0 -1
  530. package/src/shade/renderer/water/surface/chunk_water_wave.js +0 -40
  531. package/src/shade/renderer/water/surface/shader_water_tiles.d.ts +0 -4
  532. package/src/shade/renderer/water/surface/shader_water_tiles.d.ts.map +0 -1
  533. package/src/shade/renderer/water/surface/shader_water_tiles.js +0 -123
  534. package/src/shade/renderer/water/surface/shader_water_wave_batch.d.ts +0 -6
  535. package/src/shade/renderer/water/surface/shader_water_wave_batch.d.ts.map +0 -1
  536. package/src/shade/renderer/water/surface/shader_water_wave_batch.js +0 -85
  537. package/src/shade/renderer/water/surface/shader_water_wave_domain.d.ts +0 -6
  538. package/src/shade/renderer/water/surface/shader_water_wave_domain.d.ts.map +0 -1
  539. package/src/shade/renderer/water/surface/shader_water_wave_domain.js +0 -83
@@ -1 +1 @@
1
- {"version":3,"file":"ClothColliderSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/ClothColliderSystem.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH;;IAEI,8EAAsD;IAEtD,wKAIE;IAEF;;OAEG;IACH,OAFU,kBAAkB,CAEK;IAEjC;;;;;;OAMG;IACH,kBAAsB;IAEtB;;;;;;;;OAQG;IACH,iBAAc;IAEd;;;;;OAKG;IACH,qBALW,aAAa,YACb,QAAQ,aACR,WAAW,UACX,MAAM,QAoChB;IAED;;;;;OAKG;IACH,uBALW,aAAa,YACb,QAAQ,aACR,WAAW,UACX,MAAM,QAqBhB;IAED;;;;;;OAMG;IACH,WAFa,IAAI,CAkChB;IAED;;;;;;;;OAQG;IACH,uBAHW,MAAM,GACJ,IAAI,CAyBhB;IAED;;;;;;OAMG;IACH,gBAWC;IAED;;;OAGG;IACH,iBAHW,MAAM,GACJ,MAAM,CAIlB;CACJ;uBAtQsB,wBAAwB;4BAMxC,uCAAuC;yBACrB,uBAAuB;8BAElB,oBAAoB;4CAVN,uDAAuD;mCAShE,mCAAmC"}
1
+ {"version":3,"file":"ClothColliderSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/ClothColliderSystem.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH;;IAEI,8EAAsD;IAEtD,wKAIE;IAEF;;OAEG;IACH,OAFU,kBAAkB,CAEK;IAEjC;;;;;;OAMG;IACH,kBAAsB;IAEtB;;;;;;;;OAQG;IACH,iBAAc;IAEd;;;;;OAKG;IACH,qBALW,aAAa,YACb,QAAQ,aACR,WAAW,UACX,MAAM,QAoChB;IAED;;;;;OAKG;IACH,uBALW,aAAa,YACb,QAAQ,aACR,WAAW,UACX,MAAM,QAqBhB;IAED;;;;;;OAMG;IACH,WAFa,IAAI,CAkChB;IAED;;;;;;;;OAQG;IACH,uBAHW,MAAM,GACJ,IAAI,CAyBhB;IAED;;;;;;OAMG;IACH,gBAWC;IAED;;;OAGG;IACH,iBAHW,MAAM,GACJ,MAAM,CAIlB;CACJ;uBArQsB,wBAAwB;4BAMxC,uCAAuC;yBACrB,uBAAuB;8BAElB,oBAAoB;4CAVN,uDAAuD;mCAShE,mCAAmC"}
@@ -26,12 +26,11 @@ import { ClothColliderFlags } from "./ClothColliderFlags.js";
26
26
  * ## It has no `fixedUpdate`, and that is §4.1 applied a second time
27
27
  *
28
28
  * The index has to be refreshed from the world's transforms **before** any
29
- * cloth reads it, and the engine's two ordering mechanisms cannot express that:
30
- * `updateExecutionOrder` scores a system as a sum over the components it
31
- * references and sorts descending, so a system can only be moved *earlier* by
32
- * touching more, and `ClothSystem` — which reads and writes `Transform64` and
33
- * `TransformAttachment` — outscores a system that only reads. Registration
34
- * order does not break a non-tie.
29
+ * cloth reads it, and the derived order says the opposite: `updateExecutionOrder`
30
+ * runs a writer of a component before its readers, `ClothSystem` writes
31
+ * `Transform64`, and the index is not a component, so a system that steps only
32
+ * to read transforms into it would run after cloth. Registration order breaks
33
+ * only the ties that leaves.
35
34
  *
36
35
  * §4.1's conclusion applies unchanged: the answer is not a third mechanism, it
37
36
  * is not needing one. So this system does not step at all. {@link refresh} is
@@ -478,15 +478,12 @@ export class ClothInstance {
478
478
  */
479
479
  gather_reach: number;
480
480
  /**
481
- * The joint entities this cloth's rig seeding took `TransformAttachment`
482
- * authority from, so that removing the cloth can give it back. `null` on
483
- * the entity path and before the first rig seeding.
484
- *
485
- * Only the ones the revoke actually changed: a joint that was already the
486
- * CPU's is not one cloth has anything to hand back.
481
+ * The joint entities this cloth's rig seeding holds `TransformAttachment`
482
+ * on (`gpu_authority_hold`), so that removing the cloth can end the hold.
483
+ * `null` on the entity path and before the first rig seeding.
487
484
  * @type {number[]|null}
488
485
  */
489
- revoked_joints: number[] | null;
486
+ held_joints: number[] | null;
490
487
  /**
491
488
  * Where every particle was when the current sleep window opened, or `null`
492
489
  * before the first step — §7 P5's sleep test measures displacement from
@@ -1 +1 @@
1
- {"version":3,"file":"ClothInstance.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/ClothInstance.js"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"ClothInstance.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/ClothInstance.js"],"names":[],"mappings":"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"}
@@ -538,15 +538,12 @@ export class ClothInstance {
538
538
  gather_reach = 0;
539
539
 
540
540
  /**
541
- * The joint entities this cloth's rig seeding took `TransformAttachment`
542
- * authority from, so that removing the cloth can give it back. `null` on
543
- * the entity path and before the first rig seeding.
544
- *
545
- * Only the ones the revoke actually changed: a joint that was already the
546
- * CPU's is not one cloth has anything to hand back.
541
+ * The joint entities this cloth's rig seeding holds `TransformAttachment`
542
+ * on (`gpu_authority_hold`), so that removing the cloth can end the hold.
543
+ * `null` on the entity path and before the first rig seeding.
547
544
  * @type {number[]|null}
548
545
  */
549
- revoked_joints = null;
546
+ held_joints = null;
550
547
 
551
548
  /**
552
549
  * Where every particle was when the current sleep window opened, or `null`
@@ -37,9 +37,10 @@
37
37
  * recomposed.
38
38
  *
39
39
  * The declaration is the honest one — cloth reads `Cloth` and `ClothExclude`,
40
- * and reads and writes both `Transform64` and `TransformAttachment`. That puts
41
- * it before `TransformAttachmentSystem`, which is right: cloth writes the local
42
- * transforms and the attachment system is their reader.
40
+ * and reads and writes both `Transform64` and `TransformAttachment`. It runs
41
+ * before `TransformAttachmentSystem`, which is right — cloth writes the local
42
+ * transforms and the attachment system is their reader — and the passes are what
43
+ * guarantee it: cloth steps in `fixedUpdate`, the attachment system in `update`.
43
44
  *
44
45
  * @author Alex Goldring
45
46
  * @copyright Company Named Limited (c) 2026
@@ -1 +1 @@
1
- {"version":3,"file":"ClothSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/ClothSystem.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH;;IAEI,oDAAoC;IAEpC,iUAOE;IAEF;;OAEG;IACH,OAFU,UAAU,CAEK;IAEzB;;;;;;;;;;;;OAYG;IACH,iBAAyD;IAEzD;;;;;;OAMG;IACH,qBAAkB;IAUlB;;OAEG;IACH,iCAEC;IAbD;;;OAGG;IACH,4BAEC;IAkBD;;OAEG;IACH,qBAEC;IAdD;;;;OAIG;IACH,gBAEC;IASD;;;;OAIG;IACH,iCAEC;IAUD;;OAEG;IACH;4BAToC,MAAM,KAAG,CAAC,iBAAe,IAAI,CAAC;OAWjE;IAbD;;;OAGG;IACH;4BAFoC,MAAM,KAAG,CAAC,iBAAe,IAAI,CAAC;MAIjE;IASD;;;OAGG;IACH,uCAFa,QAAQ,IAAI,CAAC,CAIzB;IAED;;;OAGG;IACH,wDAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,wDAFa,IAAI,CAIhB;IAED;;;;OAIG;IACH,YAJW,KAAK,aACL,WAAW,UACX,MAAM,QAIhB;IAED;;;;OAIG;IACH,cAJW,KAAK,aACL,WAAW,UACX,MAAM,QAIhB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,IAAI,CAIhB;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,IAAI,CAIhB;IAED;;;OAGG;IACH,mBAHW,MAAM,GACJ,gBAAc,SAAS,CAInC;CA2EJ;uBAxSsB,wBAAwB;4BAInB,uCAAuC;sBAE7C,YAAY;4CAPU,uDAAuD;oCAI5F,0DAA0D;8BAInC,oBAAoB;6BACrB,mBAAmB;yBACvB,eAAe;2BACb,iBAAiB"}
1
+ {"version":3,"file":"ClothSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/ClothSystem.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH;;IAEI,oDAAoC;IAEpC,iUAOE;IAEF;;OAEG;IACH,OAFU,UAAU,CAEK;IAEzB;;;;;;;;;;;;OAYG;IACH,iBAAyD;IAEzD;;;;;;OAMG;IACH,qBAAkB;IAUlB;;OAEG;IACH,iCAEC;IAbD;;;OAGG;IACH,4BAEC;IAkBD;;OAEG;IACH,qBAEC;IAdD;;;;OAIG;IACH,gBAEC;IASD;;;;OAIG;IACH,iCAEC;IAUD;;OAEG;IACH;4BAToC,MAAM,KAAG,CAAC,iBAAe,IAAI,CAAC;OAWjE;IAbD;;;OAGG;IACH;4BAFoC,MAAM,KAAG,CAAC,iBAAe,IAAI,CAAC;MAIjE;IASD;;;OAGG;IACH,uCAFa,QAAQ,IAAI,CAAC,CAIzB;IAED;;;OAGG;IACH,wDAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,wDAFa,IAAI,CAIhB;IAED;;;;OAIG;IACH,YAJW,KAAK,aACL,WAAW,UACX,MAAM,QAIhB;IAED;;;;OAIG;IACH,cAJW,KAAK,aACL,WAAW,UACX,MAAM,QAIhB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,IAAI,CAIhB;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,IAAI,CAIhB;IAED;;;OAGG;IACH,mBAHW,MAAM,GACJ,gBAAc,SAAS,CAInC;CA2EJ;uBAzSsB,wBAAwB;4BAInB,uCAAuC;sBAE7C,YAAY;4CAPU,uDAAuD;oCAI5F,0DAA0D;8BAInC,oBAAoB;6BACrB,mBAAmB;yBACvB,eAAe;2BACb,iBAAiB"}
@@ -51,9 +51,10 @@ import { ClothWorld } from "./ClothWorld.js";
51
51
  * recomposed.
52
52
  *
53
53
  * The declaration is the honest one — cloth reads `Cloth` and `ClothExclude`,
54
- * and reads and writes both `Transform64` and `TransformAttachment`. That puts
55
- * it before `TransformAttachmentSystem`, which is right: cloth writes the local
56
- * transforms and the attachment system is their reader.
54
+ * and reads and writes both `Transform64` and `TransformAttachment`. It runs
55
+ * before `TransformAttachmentSystem`, which is right — cloth writes the local
56
+ * transforms and the attachment system is their reader — and the passes are what
57
+ * guarantee it: cloth steps in `fixedUpdate`, the attachment system in `update`.
57
58
  *
58
59
  * @author Alex Goldring
59
60
  * @copyright Company Named Limited (c) 2026
@@ -1 +1 @@
1
- {"version":3,"file":"ClothWorld.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/ClothWorld.js"],"names":[],"mappings":"AA2DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH;IAEI;;;OAGG;IACH,SAFU,YAAY,CAEoB;IAE1C;;;;;;;;;;;;OAYG;IACH,WAFU,aAAa,EAAE,CAEV;IAEf;;;;;;;;;;;;;;;OAeG;IACH,QAFU;QAAC,WAAW,SAAW,MAAM,KAAG,CAAC,iBAAe,IAAI,CAAC,CAAA;KAAC,GAAC,IAAI,CAEvD;IAEd;;OAEG;IACH,eAFU,gBAAc,IAAI,CAEP;IAErB;;OAEG;IACH,aAFU,yBAAyB,GAAC,IAAI,CAErB;IAEnB;;;;;;OAMG;IACH,WAFU,mBAAmB,GAAC,IAAI,CAEjB;IAEjB;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAFU,oBAAkB,IAAI,CAEpB;IAEZ;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAFU,MAAM,CAEP;IAET;;;;;OAKG;IACH,uBAAmB;IAEnB;;;;;OAKG;IACH,cAFU,OAAO,CAEI;IAErB;;;OAGG;IACH,oBAAwB;IAExB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAKE;IAEF;;;;;OAKG;IACH,2CAiBC;IAED;;;;;OAKG;IACH,YALW,KAAK,kCAEL,MAAM,GACJ,aAAa,CAczB;IAED;;;;;;;;OAQG;IACH,iDAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,iDAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,eAHW,MAAM,GACJ,aAAa,GAAC,SAAS,CA0BnC;IAyED;;;;;;;;;;;OAWG;IACH,eAHW,MAAM,GACJ,aAAa,GAAC,SAAS,CAanC;IAED;;;;;;;OAOG;IACH,aAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;OAGG;IACH,mBAHW,MAAM,GACJ,aAAa,GAAC,SAAS,CAInC;IAED;;;;;OAKG;IACH,uCAFW,MAAM,QAgBhB;IAED;;;;;;;;;OASG;IACH,wBANW,aAAa,mCAEb,MAAM,GACJ,OAAO,CA8BnB;IAED;;;;;;;OAOG;IACH,iBAJW,aAAa,gCAEX,IAAI,CA4ChB;IAwFD;;;;;;;;;;;OAWG;IACH,kBAPW,aAAa,MACb,MAAM,UACN,YAAY,UACZ,MAAM,GACJ,OAAO,CA0PnB;;CA8EJ;8BA3/B6B,oBAAoB;0CAjB3C,gEAAgE;oCAcnC,0BAA0B;sBA4BxC,YAAY"}
1
+ {"version":3,"file":"ClothWorld.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/ClothWorld.js"],"names":[],"mappings":"AA2DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH;IAEI;;;OAGG;IACH,SAFU,YAAY,CAEoB;IAE1C;;;;;;;;;;;;OAYG;IACH,WAFU,aAAa,EAAE,CAEV;IAEf;;;;;;;;;;;;;;;OAeG;IACH,QAFU;QAAC,WAAW,SAAW,MAAM,KAAG,CAAC,iBAAe,IAAI,CAAC,CAAA;KAAC,GAAC,IAAI,CAEvD;IAEd;;OAEG;IACH,eAFU,gBAAc,IAAI,CAEP;IAErB;;OAEG;IACH,aAFU,yBAAyB,GAAC,IAAI,CAErB;IAEnB;;;;;;OAMG;IACH,WAFU,mBAAmB,GAAC,IAAI,CAEjB;IAEjB;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAFU,oBAAkB,IAAI,CAEpB;IAEZ;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAFU,MAAM,CAEP;IAET;;;;;OAKG;IACH,uBAAmB;IAEnB;;;;;OAKG;IACH,cAFU,OAAO,CAEI;IAErB;;;OAGG;IACH,oBAAwB;IAExB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAKE;IAEF;;;;;OAKG;IACH,2CAiBC;IAED;;;;;OAKG;IACH,YALW,KAAK,kCAEL,MAAM,GACJ,aAAa,CAczB;IAED;;;;;;;;OAQG;IACH,iDAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,iDAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,eAHW,MAAM,GACJ,aAAa,GAAC,SAAS,CA0BnC;IAyED;;;;;;;;;;;OAWG;IACH,eAHW,MAAM,GACJ,aAAa,GAAC,SAAS,CAuBnC;IAED;;;;;;;OAOG;IACH,aAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;OAGG;IACH,mBAHW,MAAM,GACJ,aAAa,GAAC,SAAS,CAInC;IAED;;;;;OAKG;IACH,uCAFW,MAAM,QAgBhB;IAED;;;;;;;;;OASG;IACH,wBANW,aAAa,mCAEb,MAAM,GACJ,OAAO,CA8BnB;IAED;;;;;;;OAOG;IACH,iBAJW,aAAa,gCAEX,IAAI,CA4ChB;IAwFD;;;;;;;;;;;OAWG;IACH,kBAPW,aAAa,MACb,MAAM,UACN,YAAY,UACZ,MAAM,GACJ,OAAO,CA0PnB;;CA8EJ;8BArgC6B,oBAAoB;0CAjB3C,gEAAgE;oCAcnC,0BAA0B;sBA4BxC,YAAY"}
@@ -478,6 +478,16 @@ export class ClothWorld {
478
478
  return undefined;
479
479
  }
480
480
 
481
+ // A rig's holds on its joints go with the binding being thrown away. Kept across the gap
482
+ // they would outlive `seeded`, which is all `#release` asks: a garment removed, or a rig
483
+ // refused, before the next seeding took them over would leave its joints held, the clips
484
+ // that key them muted, and nothing writing them.
485
+ const ecd = this.entityManager === null ? null : this.entityManager.dataset;
486
+
487
+ if (ecd !== null && ecd !== undefined) {
488
+ cloth_release_rig(instance, ecd);
489
+ }
490
+
481
491
  instance.seeded = false;
482
492
  instance.anchor_valid = false;
483
493
 
@@ -7,22 +7,23 @@
7
7
  * identical either way; only seeding and write-back differ", and this file plus
8
8
  * `cloth_write_back_rig.js` is the whole of the difference.
9
9
  *
10
- * ## The joints are entities, and cloth takes them back from the GPU
10
+ * ## The joints are entities, and cloth holds their offsets
11
11
  *
12
12
  * A skinned model is a prefab spawned as entities, so a joint is an entity with
13
13
  * a `TransformAttachment` — the offset from its parent joint — and a
14
- * `GPUStateAuthority` saying who writes that offset's row. A joint a clip
15
- * drives is the GPU's: the clip resolves the row on the GPU and the CPU never
16
- * writes it, so the attachment's offset stops describing it. Cloth writing that
17
- * offset on such a joint would be writing to something nothing reads.
14
+ * `GPUStateAuthority` saying who writes that offset's row. A clip bound to a
15
+ * joint writes the row on the GPU every frame, through the pose accumulator,
16
+ * after the CPU's flush and whatever any bit says. The bit states that, and
17
+ * stops the flush from racing it; it does not stop the clip.
18
18
  *
19
- * So the seed **revokes** the GPU's authority over every joint it drives. The
20
- * consequence is stated rather than hidden: a joint cloth simulates stops being
21
- * animatable by a clip, because two writers of one row is the race the
22
- * authority component exists to prevent. That is the right trade for a cape —
23
- * the whole point of simulating it is that nobody keyframes it — and it is an
24
- * authoring error for a garment whose joints are also keyed, which is why the
25
- * seed says so.
19
+ * So the seed **holds** every joint it drives (`gpu_authority_hold`): the bit
20
+ * clears, the animation manager mutes every binding that names the joint, and
21
+ * the row is what the write-back wrote. A clip that binds a held joint later
22
+ * binds muted, and one that leaves it leaves cloth's offset alone. Ending the
23
+ * hold grants nothing; a clip still bound takes the joint back. So a cape
24
+ * simulates under a clip that keys its bones too — exporters often bake every
25
+ * bone — and the exact evaluation (`t64_evaluate_world`) answers a held joint
26
+ * with cloth's offset, as the GPU shows it.
26
27
  *
27
28
  * ## The animated pose is constant, exactly as it is for a rope
28
29
  *
@@ -32,7 +33,7 @@
32
33
  * animated pose comes from the skeleton and is live".
33
34
  *
34
35
  * For a **rigged** garment it is not live either, and the reason is the
35
- * authority claim above: cloth owns those joints, so nothing else poses them,
36
+ * hold above: cloth owns those joints, so nothing else poses them,
36
37
  * so their authored pose is the proxy's baked bind pose — constant in the
37
38
  * anchor's frame, exactly as a rope's is. What moves is the anchor, and the
38
39
  * anchor is a joint of the character's own animated skeleton, whose pose the
@@ -52,18 +53,17 @@
52
53
  */
53
54
  export function cloth_seed_rig(instance: ClothInstance, proxy: ClothProxy, joints: number[], ecd: EntityComponentDataset, dt: number): void;
54
55
  /**
55
- * Give back every joint's `TransformAttachment` authority that this cloth's
56
- * seeding took from the GPU.
56
+ * End the hold this cloth's seeding took on every joint's `TransformAttachment`.
57
57
  *
58
- * The seed revokes so that the write-back reaches the row at all, and the
59
- * consequence the module docblock states — "a joint cloth simulates stops being
60
- * animatable by a clip" — is only the right trade while the cloth is *there*.
61
- * A garment removed and nothing re-granting leaves its joints owned by a CPU
62
- * that is no longer writing them: neither animated nor simulated, and stuck in
63
- * the pose the solver stopped in.
64
- *
65
- * Only the joints the revoke actually changed are given back, so a joint that
66
- * was already the CPU's before cloth arrived stays the CPU's.
58
+ * Ending a hold grants nothing, and that is the point: who writes a joint once
59
+ * the garment is gone is not cloth's to say. A clip still bound to the joint
60
+ * takes it back (the animation manager hears the hold end); a joint no clip
61
+ * binds stays the CPU's, holding the offset cloth last wrote. Either way the
62
+ * joint starts from that offset: a clip taking it back rests there, and finds
63
+ * it in the row on every axis it does not key. Granting it here
64
+ * instead — as this did — hands a joint whose clip left during the hold to a
65
+ * GPU that has nothing to write into it: the flush skips the row, no clip pass
66
+ * writes it, and the joint is frozen for good.
67
67
  *
68
68
  * @param {ClothInstance} instance
69
69
  * @param {EntityComponentDataset} ecd
@@ -1 +1 @@
1
- {"version":3,"file":"cloth_seed_rig.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/cloth_seed_rig.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH;;;;;;;;GAQG;AACH,mFAJW,MAAM,EAAE,mCAER,MAAM,QAkFhB;AAoED;;;;;;;;;;;;;;;;;GAiBG;AACH,yFAFa,IAAI,CAoBhB"}
1
+ {"version":3,"file":"cloth_seed_rig.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/cloth_seed_rig.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH;;;;;;;;GAQG;AACH,mFAJW,MAAM,EAAE,mCAER,MAAM,QAqFhB;AAoED;;;;;;;;;;;;;;;;GAgBG;AACH,yFAFa,IAAI,CAoBhB"}
@@ -2,8 +2,8 @@ import { assert } from "../../../../core/assert.js";
2
2
  import { quat3_multiply } from "../../../../core/geom/3d/quaternion/quat3_multiply.js";
3
3
  import { v3_quaternion_apply } from "../../../../core/geom/vec3/v3_quaternion_apply.js";
4
4
  import { GPUStateAuthorityFlags } from "../../../ecs/gpu/GPUStateAuthorityFlags.js";
5
- import { gpu_authority_grant } from "../../../ecs/gpu/gpu_authority_grant.js";
6
- import { gpu_authority_revoke } from "../../../ecs/gpu/gpu_authority_revoke.js";
5
+ import { gpu_authority_hold } from "../../../ecs/gpu/gpu_authority_hold.js";
6
+ import { gpu_authority_unhold } from "../../../ecs/gpu/gpu_authority_unhold.js";
7
7
  import { TransformAttachment } from "../../../ecs/transform-attachment/TransformAttachment.js";
8
8
  import { cloth_build_children, cloth_build_rows } from "./cloth_build_rows.js";
9
9
 
@@ -16,22 +16,23 @@ import { cloth_build_children, cloth_build_rows } from "./cloth_build_rows.js";
16
16
  * identical either way; only seeding and write-back differ", and this file plus
17
17
  * `cloth_write_back_rig.js` is the whole of the difference.
18
18
  *
19
- * ## The joints are entities, and cloth takes them back from the GPU
19
+ * ## The joints are entities, and cloth holds their offsets
20
20
  *
21
21
  * A skinned model is a prefab spawned as entities, so a joint is an entity with
22
22
  * a `TransformAttachment` — the offset from its parent joint — and a
23
- * `GPUStateAuthority` saying who writes that offset's row. A joint a clip
24
- * drives is the GPU's: the clip resolves the row on the GPU and the CPU never
25
- * writes it, so the attachment's offset stops describing it. Cloth writing that
26
- * offset on such a joint would be writing to something nothing reads.
23
+ * `GPUStateAuthority` saying who writes that offset's row. A clip bound to a
24
+ * joint writes the row on the GPU every frame, through the pose accumulator,
25
+ * after the CPU's flush and whatever any bit says. The bit states that, and
26
+ * stops the flush from racing it; it does not stop the clip.
27
27
  *
28
- * So the seed **revokes** the GPU's authority over every joint it drives. The
29
- * consequence is stated rather than hidden: a joint cloth simulates stops being
30
- * animatable by a clip, because two writers of one row is the race the
31
- * authority component exists to prevent. That is the right trade for a cape —
32
- * the whole point of simulating it is that nobody keyframes it — and it is an
33
- * authoring error for a garment whose joints are also keyed, which is why the
34
- * seed says so.
28
+ * So the seed **holds** every joint it drives (`gpu_authority_hold`): the bit
29
+ * clears, the animation manager mutes every binding that names the joint, and
30
+ * the row is what the write-back wrote. A clip that binds a held joint later
31
+ * binds muted, and one that leaves it leaves cloth's offset alone. Ending the
32
+ * hold grants nothing; a clip still bound takes the joint back. So a cape
33
+ * simulates under a clip that keys its bones too — exporters often bake every
34
+ * bone — and the exact evaluation (`t64_evaluate_world`) answers a held joint
35
+ * with cloth's offset, as the GPU shows it.
35
36
  *
36
37
  * ## The animated pose is constant, exactly as it is for a rope
37
38
  *
@@ -41,7 +42,7 @@ import { cloth_build_children, cloth_build_rows } from "./cloth_build_rows.js";
41
42
  * animated pose comes from the skeleton and is live".
42
43
  *
43
44
  * For a **rigged** garment it is not live either, and the reason is the
44
- * authority claim above: cloth owns those joints, so nothing else poses them,
45
+ * hold above: cloth owns those joints, so nothing else poses them,
45
46
  * so their authored pose is the proxy's baked bind pose — constant in the
46
47
  * anchor's frame, exactly as a rope's is. What moves is the anchor, and the
47
48
  * anchor is a joint of the character's own animated skeleton, whose pose the
@@ -63,6 +64,10 @@ import { cloth_build_children, cloth_build_rows } from "./cloth_build_rows.js";
63
64
  export function cloth_seed_rig(instance, proxy, joints, ecd, dt) {
64
65
  assert.ok(proxy.isClothProxy === true, 'proxy must be a ClothProxy');
65
66
 
67
+ // Seeding takes the joints from nothing: `ClothWorld#reseed`, the only way back to an unseeded
68
+ // instance, gives the last seeding's holds back first.
69
+ assert.equal(instance.held_joints, null, 'a rig seeds over a rig that still holds its joints; ClothWorld#reseed gives them back first');
70
+
66
71
  const joint_count = proxy.joint_count;
67
72
 
68
73
  // Node 0 is the anchor, exactly as it is for the entity path: the fixed
@@ -89,10 +94,10 @@ export function cloth_seed_rig(instance, proxy, joints, ecd, dt) {
89
94
 
90
95
  node_attachment[0] = null;
91
96
 
92
- // What this seeding took, so that giving it back is possible. A revoke that
93
- // nothing can undo is half a transaction, and the half that is missing is
94
- // the one that runs when the garment is removed.
95
- const revoked = [];
97
+ // What this seeding holds, so that giving it back is possible. A hold that
98
+ // nothing ends is half a transaction, and the half that is missing is the
99
+ // one that runs when the garment is removed.
100
+ const held = [];
96
101
 
97
102
  for (let i = 0; i < joint_count; i++) {
98
103
  const joint = joints[proxy.joint[i]];
@@ -108,15 +113,14 @@ export function cloth_seed_rig(instance, proxy, joints, ecd, dt) {
108
113
 
109
114
  node_attachment[i + 1] = attachment;
110
115
 
111
- // See the module docblock. A clip-driven joint's offset is the GPU's, and taking it back
112
- // is what makes the write-back reach the row at all. An entity that never declared has
113
- // nothing to take back.
114
- if (gpu_authority_revoke(ecd, joint, GPUStateAuthorityFlags.TransformAttachment)) {
115
- revoked.push(joint);
116
- }
116
+ // See the module docblock. Every joint, whether or not a clip drives it now: one may bind
117
+ // it later, and the hold is what it finds there.
118
+ gpu_authority_hold(ecd, joint, GPUStateAuthorityFlags.TransformAttachment);
119
+
120
+ held.push(joint);
117
121
  }
118
122
 
119
- instance.revoked_joints = revoked;
123
+ instance.held_joints = held;
120
124
 
121
125
  instance.node_joint = node_joint;
122
126
  instance.node_attachment = node_attachment;
@@ -209,41 +213,40 @@ function read_bind_pose(instance, proxy) {
209
213
  }
210
214
 
211
215
  /**
212
- * Give back every joint's `TransformAttachment` authority that this cloth's
213
- * seeding took from the GPU.
214
- *
215
- * The seed revokes so that the write-back reaches the row at all, and the
216
- * consequence the module docblock states — "a joint cloth simulates stops being
217
- * animatable by a clip" — is only the right trade while the cloth is *there*.
218
- * A garment removed and nothing re-granting leaves its joints owned by a CPU
219
- * that is no longer writing them: neither animated nor simulated, and stuck in
220
- * the pose the solver stopped in.
216
+ * End the hold this cloth's seeding took on every joint's `TransformAttachment`.
221
217
  *
222
- * Only the joints the revoke actually changed are given back, so a joint that
223
- * was already the CPU's before cloth arrived stays the CPU's.
218
+ * Ending a hold grants nothing, and that is the point: who writes a joint once
219
+ * the garment is gone is not cloth's to say. A clip still bound to the joint
220
+ * takes it back (the animation manager hears the hold end); a joint no clip
221
+ * binds stays the CPU's, holding the offset cloth last wrote. Either way the
222
+ * joint starts from that offset: a clip taking it back rests there, and finds
223
+ * it in the row on every axis it does not key. Granting it here
224
+ * instead — as this did — hands a joint whose clip left during the hold to a
225
+ * GPU that has nothing to write into it: the flush skips the row, no clip pass
226
+ * writes it, and the joint is frozen for good.
224
227
  *
225
228
  * @param {ClothInstance} instance
226
229
  * @param {EntityComponentDataset} ecd
227
230
  * @returns {void}
228
231
  */
229
232
  export function cloth_release_rig(instance, ecd) {
230
- const revoked = instance.revoked_joints;
233
+ const held = instance.held_joints;
231
234
 
232
- if (revoked === null) {
235
+ if (held === null) {
233
236
  return;
234
237
  }
235
238
 
236
- for (let i = 0; i < revoked.length; i++) {
237
- const joint = revoked[i];
239
+ for (let i = 0; i < held.length; i++) {
240
+ const joint = held[i];
238
241
 
239
242
  if (!ecd.entityExists(joint)) {
240
243
  continue;
241
244
  }
242
245
 
243
- gpu_authority_grant(ecd, joint, GPUStateAuthorityFlags.TransformAttachment);
246
+ gpu_authority_unhold(ecd, joint, GPUStateAuthorityFlags.TransformAttachment);
244
247
  }
245
248
 
246
- instance.revoked_joints = null;
249
+ instance.held_joints = null;
247
250
  }
248
251
 
249
252
  const COMPOSE = new Float64Array(3);
@@ -21,7 +21,7 @@
21
21
  * worst a shape one fixed step stale.
22
22
  *
23
23
  * That is also the shape of the engine's own precedent:
24
- * `InverseKinematicsSystem` reads world transforms the hierarchy has composed
24
+ * `IKGoalSystem` evaluates the world poses the hierarchy composes
25
25
  * and writes local ones back, and §11.2's rig path writes
26
26
  * `Node3D.transform_local` for the same reason — a local transform is what a
27
27
  * joint angle *is*.
@@ -33,7 +33,7 @@ import { cloth_reconstruct_pose } from "./cloth_reconstruct_pose.js";
33
33
  * worst a shape one fixed step stale.
34
34
  *
35
35
  * That is also the shape of the engine's own precedent:
36
- * `InverseKinematicsSystem` reads world transforms the hierarchy has composed
36
+ * `IKGoalSystem` evaluates the world poses the hierarchy composes
37
37
  * and writes local ones back, and §11.2's rig path writes
38
38
  * `Node3D.transform_local` for the same reason — a local transform is what a
39
39
  * joint angle *is*.
@@ -1,38 +1,3 @@
1
- /**
2
- * Swing-twist decomposition of the relative rotation `qD = conj(qA)⊗qB`, giving
3
- * the per-frame-axis angular positions used by wide-cone angular DOFs.
4
- *
5
- * Decomposes `qD = swing ⊗ twist`, with **twist** the rotation about frame
6
- * axis X (the bone / twist axis) and **swing** the residual tilt (a rotation
7
- * about an axis in the YZ plane that carries X to its new direction). Writes,
8
- * into `out`:
9
- * - `out[0]` = signed twist angle about X, in `(−π, π]` — *exact*, so a twist
10
- * limit engages at the true angle, not the `2·sin(θ/2)` small-angle proxy;
11
- * - `out[1]`, `out[2]` = the swing angle distributed over Y and Z
12
- * (`φ·axis`, φ the true swing angle), so independent Y/Z swing limits form
13
- * an accurate (box-shaped) cone that holds at large tilt.
14
- * Reduces continuously to the small-angle vector near identity. Pure scratch /
15
- * locals — no allocation, suitable for the per-substep hot loop. (The Quaternion
16
- * class has an object-based `computeSwingAndTwist`; this is the inlined,
17
- * allocation-free form — see the bench that justifies it.)
18
- *
19
- * @param {number} dx qD x
20
- * @param {number} dy qD y
21
- * @param {number} dz qD z
22
- * @param {number} dw qD w
23
- * @param {Float64Array} out length-3 destination (frame-axis positions)
24
- */
25
- export function swing_twist_error(dx: number, dy: number, dz: number, dw: number, out: Float64Array): void;
26
- /**
27
- * {@link swing_twist_error} with `qD` read from `q[q_offset ..+3]`, `[x, y, z, w]`: the one place the
28
- * arithmetic lives. For a caller whose inlining budget is spent, where a call taking the four numbers
29
- * would box each into a new heap object.
30
- *
31
- * @param {Float64Array} q
32
- * @param {number} q_offset
33
- * @param {Float64Array} out length-3 destination (frame-axis positions)
34
- */
35
- export function swing_twist_error_array(q: Float64Array, q_offset: number, out: Float64Array): void;
36
1
  /**
37
2
  * Solve every joint for one substep: prepare each joint's rows at the current
38
3
  * poses, then run `iters` Gauss-Seidel passes over all of them. The first pass
@@ -1 +1 @@
1
- {"version":3,"file":"solve_constraints.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/constraint/solve_constraints.js"],"names":[],"mappings":"AAwZA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,sCANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,OACN,YAAY,QAWtB;AAKD;;;;;;;;GAQG;AACH,2CAJW,YAAY,YACZ,MAAM,OACN,YAAY,QAoCtB;AA+gBD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qCAXW,OAAO,iCAEP,MAAM,SAEN,MAAM,YAGN,OAAO,QAgCjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qCAJW,OAAO,mCAEP,OAAO,QAgBjB"}
1
+ {"version":3,"file":"solve_constraints.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/constraint/solve_constraints.js"],"names":[],"mappings":"AAs6BA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qCAXW,OAAO,iCAEP,MAAM,SAEN,MAAM,YAGN,OAAO,QAgCjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qCAJW,OAAO,mCAEP,OAAO,QAgBjB"}
@@ -2,6 +2,7 @@ import { assert } from "../../../core/assert.js";
2
2
  import { apply_impulse_to_body } from "../solver/apply_impulse_to_body.js";
3
3
  import { quat3_multiply_array } from "../../../core/geom/3d/quaternion/quat3_multiply.js";
4
4
  import { quat3_to_matrix3_array } from "../../../core/geom/3d/quaternion/quat3_to_matrix3.js";
5
+ import { swing_twist_error_array } from "../../../core/geom/3d/quaternion/swing_twist_error.js";
5
6
  import { v3_quaternion_apply_array } from "../../../core/geom/vec3/v3_quaternion_apply.js";
6
7
  import { TRANSFORM64_ROTATION_OFFSET } from "../../ecs/transform/Transform64.js";
7
8
  import { body_id_index } from "../body/BodyStorage.js";
@@ -406,89 +407,6 @@ function invert_sym3(K, out) {
406
407
  return true;
407
408
  }
408
409
 
409
- /**
410
- * Swing-twist decomposition of the relative rotation `qD = conj(qA)⊗qB`, giving
411
- * the per-frame-axis angular positions used by wide-cone angular DOFs.
412
- *
413
- * Decomposes `qD = swing ⊗ twist`, with **twist** the rotation about frame
414
- * axis X (the bone / twist axis) and **swing** the residual tilt (a rotation
415
- * about an axis in the YZ plane that carries X to its new direction). Writes,
416
- * into `out`:
417
- * - `out[0]` = signed twist angle about X, in `(−π, π]` — *exact*, so a twist
418
- * limit engages at the true angle, not the `2·sin(θ/2)` small-angle proxy;
419
- * - `out[1]`, `out[2]` = the swing angle distributed over Y and Z
420
- * (`φ·axis`, φ the true swing angle), so independent Y/Z swing limits form
421
- * an accurate (box-shaped) cone that holds at large tilt.
422
- * Reduces continuously to the small-angle vector near identity. Pure scratch /
423
- * locals — no allocation, suitable for the per-substep hot loop. (The Quaternion
424
- * class has an object-based `computeSwingAndTwist`; this is the inlined,
425
- * allocation-free form — see the bench that justifies it.)
426
- *
427
- * @param {number} dx qD x
428
- * @param {number} dy qD y
429
- * @param {number} dz qD z
430
- * @param {number} dw qD w
431
- * @param {Float64Array} out length-3 destination (frame-axis positions)
432
- */
433
- export function swing_twist_error(dx, dy, dz, dw, out) {
434
- const q = swing_twist_inputs;
435
-
436
- q[0] = dx;
437
- q[1] = dy;
438
- q[2] = dz;
439
- q[3] = dw;
440
-
441
- swing_twist_error_array(q, 0, out);
442
- }
443
-
444
- /** Where {@link swing_twist_error} packs its quaternion. */
445
- const swing_twist_inputs = new Float64Array(4);
446
-
447
- /**
448
- * {@link swing_twist_error} with `qD` read from `q[q_offset ..+3]`, `[x, y, z, w]`: the one place the
449
- * arithmetic lives. For a caller whose inlining budget is spent, where a call taking the four numbers
450
- * would box each into a new heap object.
451
- *
452
- * @param {Float64Array} q
453
- * @param {number} q_offset
454
- * @param {Float64Array} out length-3 destination (frame-axis positions)
455
- */
456
- export function swing_twist_error_array(q, q_offset, out) {
457
- let dx = q[q_offset], dy = q[q_offset + 1], dz = q[q_offset + 2], dw = q[q_offset + 3];
458
-
459
- // Shortest arc: work with the hemisphere where dw ≥ 0.
460
- if (dw < 0) { dx = -dx; dy = -dy; dz = -dz; dw = -dw; }
461
-
462
- const nxt = Math.sqrt(dx * dx + dw * dw); // |twist| (before normalising)
463
- let sy, sz, sw;
464
- if (nxt < 1e-12) {
465
- // dw ≈ 0 and dx ≈ 0: a ~180° pure swing — twist is undefined, take 0.
466
- out[0] = 0;
467
- // Swing is qD itself; distribute its angle over Y/Z below.
468
- sy = dy; sz = dz; sw = dw;
469
- } else {
470
- out[0] = 2 * Math.atan2(dx, dw); // exact signed twist about X
471
- const tx = dx / nxt, tw = dw / nxt; // normalised twist (tx,0,0,tw)
472
- // swing = qD ⊗ conj(twist); its X component is identically 0.
473
- sy = dy * tw - dz * tx;
474
- sz = dy * tx + dz * tw;
475
- sw = dw * tw + dx * tx;
476
- }
477
-
478
- if (sw < 0) { sy = -sy; sz = -sz; sw = -sw; }
479
- const syz = Math.sqrt(sy * sy + sz * sz);
480
- if (syz < 1e-9) {
481
- // Near-zero swing: small-angle vector (continuous with φ·axis as φ→0).
482
- out[1] = 2 * sy;
483
- out[2] = 2 * sz;
484
- } else {
485
- const phi = 2 * Math.atan2(syz, sw); // exact swing angle in [0, π]
486
- const s = phi / syz;
487
- out[1] = sy * s;
488
- out[2] = sz * s;
489
- }
490
- }
491
-
492
410
  /**
493
411
  * Fill the row parameters for one DOF given its mode, signed position and
494
412
  * signed velocity.