@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
@@ -18,12 +18,15 @@ import { POSE_ACCUMULATOR_SLOT_BYTES } from "./POSE_ACCUMULATOR_LAYOUT.js";
18
18
  import { GPUStateAuthorityFlags } from "../../../engine/ecs/gpu/GPUStateAuthorityFlags.js";
19
19
  import { gpu_authority_grant } from "../../../engine/ecs/gpu/gpu_authority_grant.js";
20
20
  import { gpu_authority_revoke } from "../../../engine/ecs/gpu/gpu_authority_revoke.js";
21
+ import { gpu_authority_held } from "../../../engine/ecs/gpu/gpu_authority_held.js";
22
+ import { GPU_AUTHORITY_EVENT_HOLD_CHANGE } from "../../../engine/ecs/gpu/GPU_AUTHORITY_EVENT_HOLD_CHANGE.js";
21
23
  import { row_of_entity } from "../scene/rows/GPUSceneRows.js";
22
24
  import { gpu_authority_declare } from "../../../engine/ecs/gpu/gpu_authority_declare.js";
23
25
  import { TransformAttachment } from "../../../engine/ecs/transform-attachment/TransformAttachment.js";
24
26
  import { TRANSFORM_ATTACHMENT_EVENT_CHANGE } from "../../../engine/ecs/transform-attachment/TRANSFORM_ATTACHMENT_EVENT_CHANGE.js";
25
27
  import { Transform64 } from "../../../engine/ecs/transform/Transform64.js";
26
28
  import { pose_evaluate_local } from "./pose/pose_evaluate_local.js";
29
+ import { PosePlayback } from "./pose/PosePlayback.js";
27
30
  import {
28
31
  shader_animation_apply,
29
32
  WORKGROUP_SIZE as ANIMATION_APPLY_WORKGROUP_SIZE,
@@ -61,12 +64,45 @@ const SEED = new Transform64();
61
64
  * The one playback a released joint is evaluated against: the clip that just left it, at the
62
65
  * time and weight it was last set to.
63
66
  *
64
- * @type {{clip: ShadeAnimationClip|null, time: number, weight: number}}
67
+ * @type {PosePlayback}
65
68
  */
66
- const SEED_PLAYBACK = { clip: null, time: 0, weight: 1 };
69
+ const SEED_PLAYBACK = new PosePlayback();
67
70
 
68
71
  const SEED_PLAYBACKS = [SEED_PLAYBACK];
69
72
 
73
+ /**
74
+ * The pose an entity rests at: the rest the CPU twin is handed for it (`pose_evaluate_local`'s
75
+ * `rest`, chosen as `t64_evaluate_world` and `T64WorldCache` choose it) — its offset from its
76
+ * parent, or its own pose when it is attached to nothing.
77
+ *
78
+ * @param {EntityComponentDataset} dataset
79
+ * @param {number} entity
80
+ * @returns {Transform64}
81
+ */
82
+ function rest_of(dataset, entity) {
83
+ const attachment = dataset.getComponent(entity, TransformAttachment);
84
+
85
+ return attachment !== undefined && attachment !== null && dataset.entityExists(attachment.parent)
86
+ ? attachment.transform
87
+ : dataset.getComponent(entity, Transform64);
88
+ }
89
+
90
+ /**
91
+ * The rotation an entity rests at, `[x, y, z, w]` — see {@link rest_of}. Read when a clip binds
92
+ * the entity, which is when its offset becomes the GPU's: this side writes no local pose into a
93
+ * driven entity's row after that. And read again when a CPU writer's hold on it ends, which is
94
+ * when its offset becomes the GPU's again — see {@link GPUAnimationManager#unmute}.
95
+ *
96
+ * @param {EntityComponentDataset} dataset
97
+ * @param {number} entity
98
+ * @returns {number[]}
99
+ */
100
+ function rest_rotation_of(dataset, entity) {
101
+ const rest = rest_of(dataset, entity);
102
+
103
+ return [rest.rotation_x, rest.rotation_y, rest.rotation_z, rest.rotation_w];
104
+ }
105
+
70
106
  /*
71
107
  Generated writers for the rows a registration adds as a run. Through `add_run` every row is a
72
108
  reflective walk of its type, and a run is one row per keyframe, binding or joint where a chain
@@ -96,6 +132,35 @@ const CLIP_BINDINGS_WRITER = generate_record_writer(ANIMATION_CLIP_STATE_STRUCT,
96
132
  */
97
133
  const CLIP_FLAGS_WORD = ANIMATION_CLIP_STATE_STRUCT.get('flags').offset / 4;
98
134
 
135
+ /**
136
+ * Word of a clip record holding the first row of its bindings — where a target's binding is found.
137
+ */
138
+ const CLIP_BINDINGS_FIRST_WORD = ANIMATION_CLIP_STATE_STRUCT.get('bindings_first').offset / 4;
139
+
140
+ /**
141
+ * A binding's `instance` alone: what muting a held target's binding writes.
142
+ */
143
+ const BINDING_INSTANCE_WRITER = generate_record_writer(ANIMATION_TRACK_BINDING_STRUCT, ['instance']);
144
+
145
+ /**
146
+ * Scratch record for {@link BINDING_INSTANCE_WRITER}.
147
+ *
148
+ * @type {{instance: number}}
149
+ */
150
+ const BINDING_INSTANCE = { instance: 0 };
151
+
152
+ /**
153
+ * A binding's `instance` and `rest_rotation`: what unmuting it when its target's hold ends writes.
154
+ */
155
+ const BINDING_UNMUTE_WRITER = generate_record_writer(ANIMATION_TRACK_BINDING_STRUCT, ['instance', 'rest_rotation']);
156
+
157
+ /**
158
+ * Scratch record for {@link BINDING_UNMUTE_WRITER}.
159
+ *
160
+ * @type {{instance: number, rest_rotation: number[]}}
161
+ */
162
+ const BINDING_UNMUTE = { instance: 0, rest_rotation: [0, 0, 0, 1] };
163
+
99
164
  /**
100
165
  * Word of a skin record holding its first joint row — where its matrices start.
101
166
  */
@@ -261,12 +326,14 @@ export class GPUAnimationManager {
261
326
  #skin_matrix_count = 0;
262
327
 
263
328
  /**
264
- * How many bound clips drive each entity, by entity. An entity's local TRS is the GPU's for
265
- * as long as this is above zero: the first clip to bind grants `GPUStateAuthority`'s
266
- * TransformAttachment bit, the last to unbind revokes it and marks the row so the CPU writes
267
- * the rest pose back. Stated on the entity, never inferred from the bindings.
329
+ * The bound clips that drive each entity, by entity — counted by the list's length, and named
330
+ * so that a hold can find the bindings to mute. An entity's local TRS is the GPU's while the
331
+ * list is not empty and no CPU writer holds it: the first clip to bind grants
332
+ * `GPUStateAuthority`'s TransformAttachment bit, the last to unbind revokes it and marks the
333
+ * row so the CPU writes the rest pose back. Stated on the entity, never inferred from the
334
+ * bindings.
268
335
  *
269
- * @type {Map<number, number>}
336
+ * @type {Map<number, number[]>}
270
337
  */
271
338
  #clips_driving = new Map();
272
339
 
@@ -296,7 +363,9 @@ export class GPUAnimationManager {
296
363
  *
297
364
  * Lazily allocated on first {@link ensure_pose_accumulator_capacity};
298
365
  * grows by doubling. Grow destroys the old buffer — since resolve
299
- * always leaves it zero, no copy is needed on grow.
366
+ * drains every sum and dirty mask, and the rest rotations are stored
367
+ * afresh by the contributions of the frame that reads them, no copy
368
+ * is needed on grow.
300
369
  *
301
370
  * @type {GPUBuffer|null}
302
371
  */
@@ -511,9 +580,10 @@ export class GPUAnimationManager {
511
580
  * by the per-frame dispatch driver after `scene.build` has
512
581
  * stabilised the transforms-table size for the frame.
513
582
  *
514
- * Grow destroys the previous GPU buffer; resolve always leaves the
515
- * accumulator zeroed at the end of each frame, so there's nothing
516
- * to copy across the realloc.
583
+ * Grow destroys the previous GPU buffer; resolve drains every sum
584
+ * and dirty mask at the end of each frame, and a slot's rest
585
+ * rotation is stored afresh by every frame that reads it, so there's
586
+ * nothing to copy across the realloc.
517
587
  *
518
588
  * @param {number} row_count
519
589
  */
@@ -685,11 +755,15 @@ export class GPUAnimationManager {
685
755
  * playing, not looping). The clip is inert at creation — call
686
756
  * {@link start} to begin GPU-side time advancement.
687
757
  *
758
+ * Each binding states its target's `rest_rotation`, `[x, y, z, w]`: what a Node3D target's
759
+ * rotation resolves to in a frame where every rotation contributed to it sums to nothing. Only
760
+ * a Node3D rotation binding reads it; {@link register_clip} takes it from the target entity.
761
+ *
688
762
  * @param {{
689
763
  * time?: number,
690
764
  * time_start?: number,
691
765
  * time_end?: number,
692
- * bindings: Array<{ track: number, instance: number, property: number }>,
766
+ * bindings: Array<{ track: number, instance: number, property: number, rest_rotation: ArrayLike<number> }>,
693
767
  * }} clip
694
768
  * @returns {number} clip id (index into the `animation_clips` table)
695
769
  */
@@ -724,8 +798,15 @@ export class GPUAnimationManager {
724
798
  assert.isNonNegativeInteger(b.track, `clip.bindings[${i}].track`);
725
799
  assert.isNonNegativeInteger(b.instance, `clip.bindings[${i}].instance`);
726
800
  assert.isNonNegativeInteger(b.property, `clip.bindings[${i}].property`);
801
+ assert.equal(b.rest_rotation.length, 4, `clip.bindings[${i}].rest_rotation.length`);
727
802
 
728
- rows[i] = { track: b.track, instance: b.instance, property: b.property, clip: clip_id };
803
+ rows[i] = {
804
+ track: b.track,
805
+ instance: b.instance,
806
+ property: b.property,
807
+ clip: clip_id,
808
+ rest_rotation: b.rest_rotation
809
+ };
729
810
  }
730
811
 
731
812
  const bindings_first = this.#database.get('animation_bindings').add_run_records(rows, BINDING_WRITER);
@@ -1194,6 +1275,7 @@ export class GPUAnimationManager {
1194
1275
  */
1195
1276
  #try_complete_clip(pending) {
1196
1277
  const rows = this.#scene_context.rows;
1278
+ const dataset = rows.dataset;
1197
1279
  const channels = pending.channels;
1198
1280
  const clip_id = pending.clip_id;
1199
1281
 
@@ -1208,9 +1290,15 @@ export class GPUAnimationManager {
1208
1290
 
1209
1291
  bindings[i] = {
1210
1292
  track: ch.track,
1211
- instance: row_of_entity(target),
1293
+ // a target a CPU writer holds is bound muted: see #mute
1294
+ instance: gpu_authority_held(dataset, target, GPUStateAuthorityFlags.TransformAttachment)
1295
+ ? GPU_DATABASE_NULL
1296
+ : row_of_entity(target),
1212
1297
  property: ch.property,
1213
1298
  clip: clip_id,
1299
+ // a held target's rest is the holder's pose of the moment, taken again when the
1300
+ // hold ends: see #unmute
1301
+ rest_rotation: rest_rotation_of(rows.dataset, target),
1214
1302
  };
1215
1303
  }
1216
1304
 
@@ -1227,8 +1315,9 @@ export class GPUAnimationManager {
1227
1315
 
1228
1316
  /**
1229
1317
  * Hand the entities a clip drives to the GPU: the first clip to bind an entity grants its
1230
- * TransformAttachment authority. Counted per entity, because two clips can drive one joint
1231
- * and it is the GPU's until the last of them leaves.
1318
+ * TransformAttachment authority — unless a CPU writer holds it, which the grant leaves be.
1319
+ * Listed per entity, because two clips can drive one joint and it is the GPU's until the last
1320
+ * of them leaves.
1232
1321
  *
1233
1322
  * @param {number} clip_id
1234
1323
  * @param {Array<{target: number}>} channels
@@ -1249,9 +1338,13 @@ export class GPUAnimationManager {
1249
1338
 
1250
1339
  targets.push(target);
1251
1340
 
1252
- const count = driving.get(target) ?? 0;
1341
+ let clips = driving.get(target);
1342
+
1343
+ if (clips === undefined) {
1344
+ clips = [];
1345
+
1346
+ driving.set(target, clips);
1253
1347
 
1254
- if (count === 0) {
1255
1348
  /*
1256
1349
  The first clip to drive a joint takes its offset, and with it the joint's world
1257
1350
  and every world below: the hierarchy pass composes the subtree from the rows, and
@@ -1264,15 +1357,22 @@ export class GPUAnimationManager {
1264
1357
  GPUStateAuthorityFlags.TransformAttachment | GPUStateAuthorityFlags.Transform64
1265
1358
  );
1266
1359
 
1360
+ // The offset as it stands is the clip's rest, and the row's on every axis it does
1361
+ // not key: an announcement still waiting for the flush is skipped once the bit is set.
1362
+ rows.mark_handover(target);
1363
+
1267
1364
  rows.for_each_descendant(target, descendant => {
1268
1365
  // a prefab declares its animated subtree; an entity attached under a joint
1269
1366
  // from elsewhere is declared here, at the one moment it is taken
1270
1367
  gpu_authority_declare(dataset, descendant);
1271
1368
  gpu_authority_grant(dataset, descendant, GPUStateAuthorityFlags.Transform64);
1272
1369
  });
1370
+
1371
+ // A CPU writer may hold the offset now or later; it says so on the entity.
1372
+ dataset.addEntityEventListener(target, GPU_AUTHORITY_EVENT_HOLD_CHANGE, this.#hold_changed, this);
1273
1373
  }
1274
1374
 
1275
- driving.set(target, count + 1);
1375
+ clips.push(clip_id);
1276
1376
  }
1277
1377
 
1278
1378
  this.#targets_by_clip.set(clip_id, targets);
@@ -1331,11 +1431,11 @@ export class GPUAnimationManager {
1331
1431
 
1332
1432
  for (let i = 0; i < targets.length; i++) {
1333
1433
  const target = targets[i];
1334
- const count = driving.get(target) - 1;
1434
+ const clips = driving.get(target);
1335
1435
 
1336
- if (count > 0) {
1337
- driving.set(target, count);
1436
+ clips.splice(clips.indexOf(clip_id), 1);
1338
1437
 
1438
+ if (clips.length > 0) {
1339
1439
  continue;
1340
1440
  }
1341
1441
 
@@ -1345,6 +1445,8 @@ export class GPUAnimationManager {
1345
1445
  continue;
1346
1446
  }
1347
1447
 
1448
+ dataset.removeEntityEventListener(target, GPU_AUTHORITY_EVENT_HOLD_CHANGE, this.#hold_changed, this);
1449
+
1348
1450
  /*
1349
1451
  The joint's offset comes back to the CPU seeded with the pose the clip left it in,
1350
1452
  evaluated at the clip's own last time and weight — what the accumulator last
@@ -1352,10 +1454,22 @@ export class GPUAnimationManager {
1352
1454
  snapping to the rest pose. Then the world of the joint and of everything under it
1353
1455
  that no other clip still drives from above, and the announcement that recomposes
1354
1456
  the returned subtree on this side and marks the row.
1457
+
1458
+ Unless a CPU writer holds the offset — a cloth simulating a cape joint the clip also
1459
+ keyed. Then the offset was never the clip's to hand back, and what the holder last
1460
+ wrote stands, after the hold as well: nothing binds the joint to take it back when the
1461
+ hold ends, so it stays the CPU's wherever the holder left it. That is the seed's own
1462
+ rule rather than an exception to it. The seed carries on from what is on screen, and a
1463
+ held joint shows its holder: the clip has been muted since the hold began, or since it
1464
+ bound, so its last pose is one the joint has not shown since, and seeding it would
1465
+ snap the joint there until the holder's next write put its own back. A holder that
1466
+ wants another offset left behind — one it captured — writes it before it lets go.
1355
1467
  */
1356
1468
  const attachment = dataset.getComponent(target, TransformAttachment);
1357
1469
 
1358
- if (attachment !== undefined && attachment !== null && shadow !== undefined) {
1470
+ const held = gpu_authority_held(dataset, target, GPUStateAuthorityFlags.TransformAttachment);
1471
+
1472
+ if (!held && attachment !== undefined && attachment !== null && shadow !== undefined) {
1359
1473
  SEED_PLAYBACK.clip = shadow.clip;
1360
1474
  SEED_PLAYBACK.time = shadow.time;
1361
1475
  SEED_PLAYBACK.weight = shadow.weight;
@@ -1388,6 +1502,120 @@ export class GPUAnimationManager {
1388
1502
  }
1389
1503
  }
1390
1504
 
1505
+ /**
1506
+ * A CPU writer took or gave back the offset of an entity a clip drives — see
1507
+ * `GPUStateAuthority#held`. Listened for on every driven entity, from the first clip that binds
1508
+ * it to the last that leaves.
1509
+ *
1510
+ * Taken: every binding naming the entity is muted, and the hold has already cleared the bit,
1511
+ * so from the next frame the row is the holder's offset and nothing else; the row is marked so
1512
+ * the flush carries it whether or not the holder has announced a write yet. Given back with a
1513
+ * clip still bound: unmuted with the rest the holder left, the row marked so that offset goes
1514
+ * up with it (`GPUSceneRows#mark_handover`), and the joint is the clip's again.
1515
+ *
1516
+ * @param {number} _event the entity, as {@link gpu_authority_hold} sends it
1517
+ * @param {number} entity
1518
+ */
1519
+ #hold_changed(_event, entity) {
1520
+ const rows = this.#scene_context.rows;
1521
+ const dataset = rows.dataset;
1522
+
1523
+ if (gpu_authority_held(dataset, entity, GPUStateAuthorityFlags.TransformAttachment)) {
1524
+ this.#mute(entity);
1525
+
1526
+ rows.mark_local(entity);
1527
+ } else {
1528
+ this.#unmute(entity, dataset);
1529
+
1530
+ rows.mark_handover(entity);
1531
+
1532
+ gpu_authority_grant(dataset, entity, GPUStateAuthorityFlags.TransformAttachment);
1533
+ }
1534
+ }
1535
+
1536
+ /**
1537
+ * Point every binding that names `entity` — in every clip driving it — at
1538
+ * {@link GPU_DATABASE_NULL}.
1539
+ *
1540
+ * **The bit does not stop a clip on the GPU.** No pass reads `GPUStateAuthority`: the apply
1541
+ * pass adds every binding into its target's accumulator slot and the resolve writes the row,
1542
+ * after the CPU's flush, every frame, whatever its weight. So a held joint whose bindings still
1543
+ * named its row would show the clip and not its holder. A muted binding names no object —
1544
+ * `write_object_property` writes nothing for the type bits of {@link GPU_DATABASE_NULL} —
1545
+ * so its target's slot stays empty and the resolve leaves the row as the flush wrote it. The
1546
+ * rest of the clip plays as before.
1547
+ *
1548
+ * Only the `instance` word of each binding is written.
1549
+ *
1550
+ * @param {number} entity
1551
+ */
1552
+ #mute(entity) {
1553
+ BINDING_INSTANCE.instance = GPU_DATABASE_NULL;
1554
+
1555
+ this.#write_bindings(entity, BINDING_INSTANCE, BINDING_INSTANCE_WRITER);
1556
+ }
1557
+
1558
+ /**
1559
+ * The reverse of {@link #mute}, when the hold ends: every binding naming `entity` names its row
1560
+ * again, and carries the rest the entity has now.
1561
+ *
1562
+ * The rest a binding took when it bound is not the rest any more. The holder wrote the offset
1563
+ * all through the hold and leaves it where it leaves it — its last pose, or one it captured and
1564
+ * put back — and that offset is the rest the CPU twin reads from here on. A binding that bound
1565
+ * before the hold took the rest from before it; one that bound during it, muted, took the
1566
+ * holder's pose of that moment. Either would resolve a rotation summing to nothing somewhere the
1567
+ * twin does not, and a socket would sit off the drawn mesh.
1568
+ *
1569
+ * @param {number} entity
1570
+ * @param {EntityComponentDataset} dataset
1571
+ */
1572
+ #unmute(entity, dataset) {
1573
+ const rest = rest_of(dataset, entity);
1574
+ const rest_rotation = BINDING_UNMUTE.rest_rotation;
1575
+
1576
+ BINDING_UNMUTE.instance = row_of_entity(entity);
1577
+
1578
+ rest_rotation[0] = rest.rotation_x;
1579
+ rest_rotation[1] = rest.rotation_y;
1580
+ rest_rotation[2] = rest.rotation_z;
1581
+ rest_rotation[3] = rest.rotation_w;
1582
+
1583
+ this.#write_bindings(entity, BINDING_UNMUTE, BINDING_UNMUTE_WRITER);
1584
+ }
1585
+
1586
+ /**
1587
+ * Write `fields` into every binding that names `entity`, in every clip driving it. A binding's
1588
+ * place in its clip's run is its channel's, so the clip's own channels say which rows of the
1589
+ * run to touch.
1590
+ *
1591
+ * @param {number} entity
1592
+ * @param {object} fields
1593
+ * @param {GPURecordWriter} writer
1594
+ */
1595
+ #write_bindings(entity, fields, writer) {
1596
+ const clips = this.#clips_driving.get(entity);
1597
+
1598
+ if (clips === undefined) {
1599
+ return;
1600
+ }
1601
+
1602
+ const clips_table = this.#database.get('animation_clips');
1603
+ const bindings = this.#database.get('animation_bindings');
1604
+
1605
+ for (let c = 0; c < clips.length; c++) {
1606
+ const clip_id = clips[c];
1607
+
1608
+ const first = clips_table.get_word(clip_id, CLIP_BINDINGS_FIRST_WORD);
1609
+ const channels = this.#playback_by_clip.get(clip_id).clip.channels;
1610
+
1611
+ for (let i = 0; i < channels.length; i++) {
1612
+ if (channels[i].target === entity) {
1613
+ bindings.set_fields(first + i, fields, writer);
1614
+ }
1615
+ }
1616
+ }
1617
+ }
1618
+
1391
1619
  /**
1392
1620
  * Drop a clip from the manager: its row, and with it the run of its bindings — the clip's range
1393
1621
  * owns the run, so the table removes it. Tolerates the clip still being pending (drains it from
@@ -11,15 +11,22 @@
11
11
  * Per-axis dirty bits live in a single dirty u32 (atomicOr to set,
12
12
  * atomicLoad in resolve, atomicStore(0) to clear).
13
13
  *
14
- * Layout in u32 indices (slot stride = 16 u32s = 64 bytes — 5 u32s of
15
- * tail padding give the slot a power-of-two stride so addressing is a
14
+ * Layout in u32 indices (slot stride = 16 u32s = 64 bytes — one u32 of
15
+ * tail padding gives the slot a power-of-two stride so addressing is a
16
16
  * shift, not a multiply):
17
17
  *
18
18
  * [0..3] translation.xyz (3 atomic<u32>, f32 bitcast)
19
19
  * [3..7] rotation.xyzw (4 atomic<u32>, f32 bitcast)
20
20
  * [7..10] scale.xyz (3 atomic<u32>, f32 bitcast)
21
21
  * [10] dirty_mask (atomic<u32>, see flag bits below)
22
- * [11..16] padding
22
+ * [11..15] rest_rotation.xyzw (4 atomic<u32>, f32 bitcast)
23
+ * [15] padding
24
+ *
25
+ * `rest_rotation` is not a sum. Every rotation contribution stores its
26
+ * target's rest rotation there, whatever its weight, and the resolve
27
+ * writes it to the row when the rotation sum has length zero. It is not
28
+ * drained: a row is only rotation-dirty in a frame some contribution
29
+ * stored it afresh.
23
30
  *
24
31
  * `dirty_mask` bit layout:
25
32
  * bits 0–2: translation x/y/z written this frame
@@ -35,7 +42,7 @@
35
42
  */
36
43
  /**
37
44
  * u32-stride per pose-accumulator slot. Picked to be a power of two so
38
- * `row << 4` works as the slot offset. 11 u32s are used, 5 are padding.
45
+ * `row << 4` works as the slot offset. 15 u32s are used, 1 is padding.
39
46
  * @type {number}
40
47
  */
41
48
  export const POSE_ACCUMULATOR_STRIDE: number;
@@ -51,6 +58,7 @@ export const POSE_ACCUMULATOR_OFFSET_TRANSLATION: 0;
51
58
  export const POSE_ACCUMULATOR_OFFSET_ROTATION: 3;
52
59
  export const POSE_ACCUMULATOR_OFFSET_SCALE: 7;
53
60
  export const POSE_ACCUMULATOR_OFFSET_DIRTY: 10;
61
+ export const POSE_ACCUMULATOR_OFFSET_REST_ROTATION: 11;
54
62
  /**
55
63
  * Dirty-mask bit layout. Per-axis for T/S, single bit for R.
56
64
  */
@@ -1 +1 @@
1
- {"version":3,"file":"POSE_ACCUMULATOR_LAYOUT.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;;GAIG;AACH,sCAFU,MAAM,CAE0B;AAE1C;;;;;GAKG;AACH,0CAFU,MAAM,CAEuD;AAEvE,gDAAgD;AAChD,oDAAqD;AACrD,iDAAkD;AAClD,8CAA+C;AAC/C,+CAAgD;AAEhD;;GAEG;AACH,mCAAoC;AACpC,mCAAoC;AACpC,mCAAoC;AACpC,kCAAmC;AACnC,mCAAoC;AACpC,mCAAoC;AACpC,mCAAoC"}
1
+ {"version":3,"file":"POSE_ACCUMULATOR_LAYOUT.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH;;;;GAIG;AACH,sCAFU,MAAM,CAE0B;AAE1C;;;;;GAKG;AACH,0CAFU,MAAM,CAEuD;AAEvE,gDAAgD;AAChD,oDAAqD;AACrD,iDAAkD;AAClD,8CAA+C;AAC/C,+CAAgD;AAChD,uDAAwD;AAExD;;GAEG;AACH,mCAAoC;AACpC,mCAAoC;AACpC,mCAAoC;AACpC,kCAAmC;AACnC,mCAAoC;AACpC,mCAAoC;AACpC,mCAAoC"}
@@ -11,15 +11,22 @@
11
11
  * Per-axis dirty bits live in a single dirty u32 (atomicOr to set,
12
12
  * atomicLoad in resolve, atomicStore(0) to clear).
13
13
  *
14
- * Layout in u32 indices (slot stride = 16 u32s = 64 bytes — 5 u32s of
15
- * tail padding give the slot a power-of-two stride so addressing is a
14
+ * Layout in u32 indices (slot stride = 16 u32s = 64 bytes — one u32 of
15
+ * tail padding gives the slot a power-of-two stride so addressing is a
16
16
  * shift, not a multiply):
17
17
  *
18
18
  * [0..3] translation.xyz (3 atomic<u32>, f32 bitcast)
19
19
  * [3..7] rotation.xyzw (4 atomic<u32>, f32 bitcast)
20
20
  * [7..10] scale.xyz (3 atomic<u32>, f32 bitcast)
21
21
  * [10] dirty_mask (atomic<u32>, see flag bits below)
22
- * [11..16] padding
22
+ * [11..15] rest_rotation.xyzw (4 atomic<u32>, f32 bitcast)
23
+ * [15] padding
24
+ *
25
+ * `rest_rotation` is not a sum. Every rotation contribution stores its
26
+ * target's rest rotation there, whatever its weight, and the resolve
27
+ * writes it to the row when the rotation sum has length zero. It is not
28
+ * drained: a row is only rotation-dirty in a frame some contribution
29
+ * stored it afresh.
23
30
  *
24
31
  * `dirty_mask` bit layout:
25
32
  * bits 0–2: translation x/y/z written this frame
@@ -36,7 +43,7 @@
36
43
 
37
44
  /**
38
45
  * u32-stride per pose-accumulator slot. Picked to be a power of two so
39
- * `row << 4` works as the slot offset. 11 u32s are used, 5 are padding.
46
+ * `row << 4` works as the slot offset. 15 u32s are used, 1 is padding.
40
47
  * @type {number}
41
48
  */
42
49
  export const POSE_ACCUMULATOR_STRIDE = 16;
@@ -54,6 +61,7 @@ export const POSE_ACCUMULATOR_OFFSET_TRANSLATION = 0;
54
61
  export const POSE_ACCUMULATOR_OFFSET_ROTATION = 3;
55
62
  export const POSE_ACCUMULATOR_OFFSET_SCALE = 7;
56
63
  export const POSE_ACCUMULATOR_OFFSET_DIRTY = 10;
64
+ export const POSE_ACCUMULATOR_OFFSET_REST_ROTATION = 11;
57
65
 
58
66
  /**
59
67
  * Dirty-mask bit layout. Per-axis for T/S, single bit for R.
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_pose_accumulator.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/animation/chunk_pose_accumulator.js"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;;GAgBG;AACH,qCAFU,SAAS,CA4FgB;0BA5HT,iCAAiC"}
1
+ {"version":3,"file":"chunk_pose_accumulator.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/animation/chunk_pose_accumulator.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;GAgBG;AACH,qCAFU,SAAS,CAwGgB;0BAzIT,iCAAiC"}
@@ -2,6 +2,7 @@ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
2
2
  import { chunk_atomic_add_f32_storage } from "../shader/chunk/atomic/chunk_atomic_add_f32_storage.js";
3
3
  import {
4
4
  POSE_ACCUMULATOR_OFFSET_DIRTY,
5
+ POSE_ACCUMULATOR_OFFSET_REST_ROTATION,
5
6
  POSE_ACCUMULATOR_OFFSET_ROTATION,
6
7
  POSE_ACCUMULATOR_OFFSET_SCALE,
7
8
  POSE_ACCUMULATOR_OFFSET_TRANSLATION,
@@ -40,6 +41,7 @@ const POSE_OFFSET_TRANSLATION: u32 = ${POSE_ACCUMULATOR_OFFSET_TRANSLATION}u;
40
41
  const POSE_OFFSET_ROTATION: u32 = ${POSE_ACCUMULATOR_OFFSET_ROTATION}u;
41
42
  const POSE_OFFSET_SCALE: u32 = ${POSE_ACCUMULATOR_OFFSET_SCALE}u;
42
43
  const POSE_OFFSET_DIRTY: u32 = ${POSE_ACCUMULATOR_OFFSET_DIRTY}u;
44
+ const POSE_OFFSET_REST_ROTATION: u32 = ${POSE_ACCUMULATOR_OFFSET_REST_ROTATION}u;
43
45
 
44
46
  const POSE_DIRTY_TX: u32 = ${POSE_DIRTY_TX}u;
45
47
  const POSE_DIRTY_TY: u32 = ${POSE_DIRTY_TY}u;
@@ -75,7 +77,7 @@ fn pose_accumulator_add_translation(row: u32, value: vec3<f32>, mask: u32) {
75
77
  }
76
78
  }
77
79
 
78
- fn pose_accumulator_add_rotation(row: u32, value: vec4<f32>, mask: u32, weight: f32) {
80
+ fn pose_accumulator_add_rotation(row: u32, value: vec4<f32>, mask: u32, weight: f32, rest: vec4<f32>) {
79
81
  // Rotation tracks normally cover all four channels (quaternion is one
80
82
  // unit). Channels missing from the mask must default to the identity
81
83
  // quaternion (0, 0, 0, 1): the evaluator leaves them at 0, which is
@@ -100,6 +102,17 @@ fn pose_accumulator_add_rotation(row: u32, value: vec4<f32>, mask: u32, weight:
100
102
  atomic_add_f32_storage(&pose_accumulator[base + 1u], value.y);
101
103
  atomic_add_f32_storage(&pose_accumulator[base + 2u], value.z);
102
104
  atomic_add_f32_storage(&pose_accumulator[base + 3u], w);
105
+
106
+ // The target's rest rotation, stored rather than added, by every contribution whatever its
107
+ // weight: the resolve writes it when the sum has length zero, which is every clip rotating the
108
+ // joint playing at weight zero, and by then the row holds the last clip's pose rather than the
109
+ // rest. Every binding of one target carries the same rest, so concurrent stores agree.
110
+ let rest_base = pose_accumulator_slot_base(row) + POSE_OFFSET_REST_ROTATION;
111
+ atomicStore(&pose_accumulator[rest_base + 0u], bitcast<u32>(rest.x));
112
+ atomicStore(&pose_accumulator[rest_base + 1u], bitcast<u32>(rest.y));
113
+ atomicStore(&pose_accumulator[rest_base + 2u], bitcast<u32>(rest.z));
114
+ atomicStore(&pose_accumulator[rest_base + 3u], bitcast<u32>(rest.w));
115
+
103
116
  atomicOr(&pose_accumulator[pose_accumulator_slot_base(row) + POSE_OFFSET_DIRTY], POSE_DIRTY_R);
104
117
  }
105
118
 
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @typedef {import("../ShadeAnimationChannel.js").ShadeAnimationChannel} ShadeAnimationChannel
3
+ * @typedef {import("../ShadeAnimationClip.js").ShadeAnimationClip} ShadeAnimationClip
4
+ */
5
+ /**
6
+ * What {@link PoseChannelIndex#group_of} answers for an entity the clip has no track for.
7
+ *
8
+ * @type {number}
9
+ */
10
+ export const POSE_CHANNEL_GROUP_NONE: number;
11
+ /**
12
+ * A clip's channels grouped by the entity each names, for the CPU pose twin to look one entity up
13
+ * in, rather than scan the whole clip for it once per level of every query.
14
+ *
15
+ * The groups are laid end to end in one array, each in the clip's own order, with a table of where
16
+ * each starts and a {@link Uint32Map} from entity to group: on a 70-joint clip of 210 channels it
17
+ * holds a few KiB, against the ~25 KiB of the clip itself, and nothing in it is handed out to be
18
+ * written. Read it with {@link group_of}, {@link first}, {@link end} and {@link channel}.
19
+ *
20
+ * Built once per clip ({@link of}) and checked, not rebuilt, each time a playback takes the clip
21
+ * again.
22
+ *
23
+ * @author Alex Goldring
24
+ * @copyright Company Named Limited (c) 2026
25
+ */
26
+ export class PoseChannelIndex {
27
+ /**
28
+ * The clip's index, as the clip holds its channels now: the one built before when it still
29
+ * holds, a new one otherwise.
30
+ *
31
+ * @param {ShadeAnimationClip} clip
32
+ * @returns {PoseChannelIndex}
33
+ */
34
+ static of(clip: ShadeAnimationClip): PoseChannelIndex;
35
+ /**
36
+ * @param {ShadeAnimationChannel[]} channels a clip's channels
37
+ */
38
+ constructor(channels: ShadeAnimationChannel[]);
39
+ /**
40
+ * The group of channels naming `entity`, or {@link POSE_CHANNEL_GROUP_NONE} where the clip has no
41
+ * track for it — which is most entities for most clips.
42
+ *
43
+ * @param {number} entity
44
+ * @returns {number}
45
+ */
46
+ group_of(entity: number): number;
47
+ /**
48
+ * @param {number} group
49
+ * @returns {number} the position of the group's first channel
50
+ */
51
+ first(group: number): number;
52
+ /**
53
+ * @param {number} group
54
+ * @returns {number} one past the position of the group's last channel
55
+ */
56
+ end(group: number): number;
57
+ /**
58
+ * @param {number} position from {@link first} up to {@link end}
59
+ * @returns {ShadeAnimationChannel}
60
+ */
61
+ channel(position: number): ShadeAnimationChannel;
62
+ /**
63
+ * Whether this still describes `channels`: every channel naming an entity is where this put it
64
+ * — the same channel, naming the same entity, in the same order among that entity's — and there
65
+ * are as many as there were. A walk of the clip without allocation.
66
+ *
67
+ * @param {ShadeAnimationChannel[]} channels
68
+ * @returns {boolean}
69
+ */
70
+ holds(channels: ShadeAnimationChannel[]): boolean;
71
+ #private;
72
+ }
73
+ export namespace PoseChannelIndex {
74
+ let EMPTY: PoseChannelIndex;
75
+ }
76
+ export type ShadeAnimationChannel = import("../ShadeAnimationChannel.js").ShadeAnimationChannel;
77
+ export type ShadeAnimationClip = import("../ShadeAnimationClip.js").ShadeAnimationClip;
78
+ //# sourceMappingURL=PoseChannelIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PoseChannelIndex.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/animation/pose/PoseChannelIndex.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;;GAIG;AACH,sCAFU,MAAM,CAEyC;AAmCzD;;;;;;;;;;;;;;GAcG;AACH;IAsLI;;;;;;OAMG;IACH,gBAHW,kBAAkB,GAChB,gBAAgB,CAe5B;IA7KD;;OAEG;IACH,sBAFW,qBAAqB,EAAE,EA0DjC;IAED;;;;;;OAMG;IACH,iBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,aAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,WAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,kBAHW,MAAM,GACJ,qBAAqB,CAIjC;IAED;;;;;;;OAOG;IACH,gBAHW,qBAAqB,EAAE,GACrB,OAAO,CAiDnB;;CAuBJ;;eAMS,gBAAgB;;oCA5Qb,OAAO,6BAA6B,EAAE,qBAAqB;iCAC3D,OAAO,0BAA0B,EAAE,kBAAkB"}