@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
@@ -47,6 +47,26 @@ export class GPUStateAuthority {
47
47
  * @type {number}
48
48
  */
49
49
  flags: number;
50
+ /**
51
+ * Bitwise OR of the {@link GPUStateAuthorityFlags} a CPU writer holds against the GPU: a cloth
52
+ * simulating a cape joint's offset, while a clip may be bound to the same joint.
53
+ *
54
+ * Two writers want one component, and a hold is how the CPU one wins. A held bit is never set
55
+ * in {@link flags}: holding clears it, and a GPU writer's grant does not set it while the hold
56
+ * lasts. Whoever writes on the GPU hears of the hold (see
57
+ * {@link GPU_AUTHORITY_EVENT_HOLD_CHANGE}) and stops, and takes the component back when it
58
+ * ends. So {@link flags} stays the one statement of who writes, and what is held is why the GPU
59
+ * does not.
60
+ *
61
+ * One holder per component: a second CPU writer of the same component is the same race in
62
+ * another place, and holding twice is an error.
63
+ *
64
+ * Read it through {@link gpu_authority_held} and write it through {@link gpu_authority_hold} /
65
+ * {@link gpu_authority_unhold}.
66
+ *
67
+ * @type {number}
68
+ */
69
+ held: number;
50
70
  }
51
71
  export namespace GPUStateAuthority {
52
72
  let typeName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"GPUStateAuthority.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/GPUStateAuthority.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;IAYI;;;OAGG;IACH,oBAHW,MAAM,GACJ,iBAAiB,CAQ7B;IArBD;;;;;;;;OAQG;IACH,OAFU,MAAM,CAEN;CAab;;kBAIS,MAAM;sBASN,OAAO"}
1
+ {"version":3,"file":"GPUStateAuthority.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/GPUStateAuthority.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;IAiCI;;;OAGG;IACH,oBAHW,MAAM,GACJ,iBAAiB,CAQ7B;IA1CD;;;;;;;;OAQG;IACH,OAFU,MAAM,CAEN;IAEV;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAFU,MAAM,CAEP;CAaZ;;kBAIS,MAAM;sBASN,OAAO"}
@@ -43,6 +43,27 @@ export class GPUStateAuthority {
43
43
  */
44
44
  flags = 0;
45
45
 
46
+ /**
47
+ * Bitwise OR of the {@link GPUStateAuthorityFlags} a CPU writer holds against the GPU: a cloth
48
+ * simulating a cape joint's offset, while a clip may be bound to the same joint.
49
+ *
50
+ * Two writers want one component, and a hold is how the CPU one wins. A held bit is never set
51
+ * in {@link flags}: holding clears it, and a GPU writer's grant does not set it while the hold
52
+ * lasts. Whoever writes on the GPU hears of the hold (see
53
+ * {@link GPU_AUTHORITY_EVENT_HOLD_CHANGE}) and stops, and takes the component back when it
54
+ * ends. So {@link flags} stays the one statement of who writes, and what is held is why the GPU
55
+ * does not.
56
+ *
57
+ * One holder per component: a second CPU writer of the same component is the same race in
58
+ * another place, and holding twice is an error.
59
+ *
60
+ * Read it through {@link gpu_authority_held} and write it through {@link gpu_authority_hold} /
61
+ * {@link gpu_authority_unhold}.
62
+ *
63
+ * @type {number}
64
+ */
65
+ held = 0;
66
+
46
67
  /**
47
68
  * @param {number} [flags]
48
69
  * @returns {GPUStateAuthority}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Sent on an entity when a CPU writer takes or gives back a component it holds against the GPU —
3
+ * see {@link GPUStateAuthority#held}. The payload is the entity.
4
+ *
5
+ * What a GPU writer listens for on the entities it drives: a hold means stop writing, and the end of
6
+ * one means it may take the component back. Read the state off the entity rather than off the
7
+ * event; one event names both transitions.
8
+ *
9
+ * @author Alex Goldring
10
+ * @copyright Company Named Limited (c) 2026
11
+ */
12
+ export const GPU_AUTHORITY_EVENT_HOLD_CHANGE: "@gpu_authority/hold_change";
13
+ //# sourceMappingURL=GPU_AUTHORITY_EVENT_HOLD_CHANGE.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GPU_AUTHORITY_EVENT_HOLD_CHANGE.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/GPU_AUTHORITY_EVENT_HOLD_CHANGE.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,2EAA4E"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Sent on an entity when a CPU writer takes or gives back a component it holds against the GPU —
3
+ * see {@link GPUStateAuthority#held}. The payload is the entity.
4
+ *
5
+ * What a GPU writer listens for on the entities it drives: a hold means stop writing, and the end of
6
+ * one means it may take the component back. Read the state off the entity rather than off the
7
+ * event; one event names both transitions.
8
+ *
9
+ * @author Alex Goldring
10
+ * @copyright Company Named Limited (c) 2026
11
+ */
12
+ export const GPU_AUTHORITY_EVENT_HOLD_CHANGE = "@gpu_authority/hold_change";
@@ -6,10 +6,16 @@
6
6
  * declaration site that was missed, and adding the component here to paper over it is exactly the
7
7
  * structural churn the declaration exists to avoid.
8
8
  *
9
+ * **A component a CPU writer holds is not granted** (see {@link GPUStateAuthority#held}). The hold
10
+ * is the reason, stated on the same component, and the GPU side takes the bit when the hold ends —
11
+ * {@link gpu_authority_unhold} says so on the entity. A clip binding a cloth's cape joint grants
12
+ * the joint's world and not its offset.
13
+ *
9
14
  * @param {EntityComponentDataset} dataset
10
15
  * @param {number} entity
11
16
  * @param {number} flags one or more {@link GPUStateAuthorityFlags}
12
17
  * @returns {boolean} whether anything changed — `false` when the GPU already owned all of them
18
+ * that are not held
13
19
  */
14
20
  export function gpu_authority_grant(dataset: EntityComponentDataset, entity: number, flags: number): boolean;
15
21
  //# sourceMappingURL=gpu_authority_grant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gpu_authority_grant.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/gpu_authority_grant.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,6EAJW,MAAM,SACN,MAAM,GACJ,OAAO,CAsBnB"}
1
+ {"version":3,"file":"gpu_authority_grant.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/gpu_authority_grant.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AACH,6EALW,MAAM,SACN,MAAM,GACJ,OAAO,CAuBnB"}
@@ -10,10 +10,16 @@ import { GPU_STATE_AUTHORITY_FLAGS_ALL, gpu_state_authority_flag_names } from ".
10
10
  * declaration site that was missed, and adding the component here to paper over it is exactly the
11
11
  * structural churn the declaration exists to avoid.
12
12
  *
13
+ * **A component a CPU writer holds is not granted** (see {@link GPUStateAuthority#held}). The hold
14
+ * is the reason, stated on the same component, and the GPU side takes the bit when the hold ends —
15
+ * {@link gpu_authority_unhold} says so on the entity. A clip binding a cloth's cape joint grants
16
+ * the joint's world and not its offset.
17
+ *
13
18
  * @param {EntityComponentDataset} dataset
14
19
  * @param {number} entity
15
20
  * @param {number} flags one or more {@link GPUStateAuthorityFlags}
16
21
  * @returns {boolean} whether anything changed — `false` when the GPU already owned all of them
22
+ * that are not held
17
23
  */
18
24
  export function gpu_authority_grant(dataset, entity, flags) {
19
25
  assert.defined(dataset, 'dataset');
@@ -26,7 +32,7 @@ export function gpu_authority_grant(dataset, entity, flags) {
26
32
  assert.ok(authority !== undefined && authority !== null, `entity ${entity} has no GPUStateAuthority — it must be declared at creation, see gpu_authority_declare`);
27
33
 
28
34
  const before = authority.flags;
29
- const after = before | flags;
35
+ const after = before | (flags & ~authority.held);
30
36
 
31
37
  if (after === before) {
32
38
  return false;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Does a CPU writer hold component X of entity E against the GPU? See
3
+ * {@link GPUStateAuthority#held}.
4
+ *
5
+ * Asks for **all** of `flags`, as {@link gpu_authority_has} does. No component means nothing is
6
+ * held.
7
+ *
8
+ * @param {EntityComponentDataset} dataset
9
+ * @param {number} entity
10
+ * @param {number} flags one or more {@link GPUStateAuthorityFlags}
11
+ * @returns {boolean}
12
+ */
13
+ export function gpu_authority_held(dataset: EntityComponentDataset, entity: number, flags: number): boolean;
14
+ //# sourceMappingURL=gpu_authority_held.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpu_authority_held.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/gpu_authority_held.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,4EAJW,MAAM,SACN,MAAM,GACJ,OAAO,CAUnB"}
@@ -0,0 +1,23 @@
1
+ import { GPUStateAuthority } from "./GPUStateAuthority.js";
2
+
3
+ /**
4
+ * Does a CPU writer hold component X of entity E against the GPU? See
5
+ * {@link GPUStateAuthority#held}.
6
+ *
7
+ * Asks for **all** of `flags`, as {@link gpu_authority_has} does. No component means nothing is
8
+ * held.
9
+ *
10
+ * @param {EntityComponentDataset} dataset
11
+ * @param {number} entity
12
+ * @param {number} flags one or more {@link GPUStateAuthorityFlags}
13
+ * @returns {boolean}
14
+ */
15
+ export function gpu_authority_held(dataset, entity, flags) {
16
+ const authority = dataset.getComponent(entity, GPUStateAuthority);
17
+
18
+ if (authority === undefined || authority === null) {
19
+ return false;
20
+ }
21
+
22
+ return (authority.held & flags) === flags;
23
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Take these components for a CPU writer, against whatever writes them on the GPU, for as long as
3
+ * the hold lasts.
4
+ *
5
+ * A revoke says the GPU stopped writing. A hold says the CPU needs the component **whether or not
6
+ * the GPU wants it**: a cloth over a cape whose clip keys the same joints. The bits clear, the GPU
7
+ * side cannot grant them back until {@link gpu_authority_unhold}, and
8
+ * {@link GPU_AUTHORITY_EVENT_HOLD_CHANGE} tells a GPU writer already driving the entity to stop.
9
+ *
10
+ * Declares the entity if it never was. A hold is a claim and has to be visible on the entity; an
11
+ * entity no clip has ever been able to target carries no {@link GPUStateAuthority}, and a clip that
12
+ * binds it later must find the hold there. Seeding a garment is that entity's moment, as binding is
13
+ * for a joint attached under an animated one.
14
+ *
15
+ * **Holding does not seed a value.** The component holds what the CPU last wrote, which for a joint
16
+ * a clip was resolving is not this frame's pose; the holder writes its own before anything reads it.
17
+ *
18
+ * @param {EntityComponentDataset} dataset
19
+ * @param {number} entity
20
+ * @param {number} flags one or more {@link GPUStateAuthorityFlags}, none of them already held
21
+ */
22
+ export function gpu_authority_hold(dataset: EntityComponentDataset, entity: number, flags: number): void;
23
+ //# sourceMappingURL=gpu_authority_hold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpu_authority_hold.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/gpu_authority_hold.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,4EAHW,MAAM,SACN,MAAM,QAgBhB"}
@@ -0,0 +1,41 @@
1
+ import { assert } from "../../../core/assert.js";
2
+ import { GPU_AUTHORITY_EVENT_HOLD_CHANGE } from "./GPU_AUTHORITY_EVENT_HOLD_CHANGE.js";
3
+ import { GPU_STATE_AUTHORITY_FLAGS_ALL, gpu_state_authority_flag_names } from "./GPUStateAuthorityFlags.js";
4
+ import { gpu_authority_declare } from "./gpu_authority_declare.js";
5
+
6
+ /**
7
+ * Take these components for a CPU writer, against whatever writes them on the GPU, for as long as
8
+ * the hold lasts.
9
+ *
10
+ * A revoke says the GPU stopped writing. A hold says the CPU needs the component **whether or not
11
+ * the GPU wants it**: a cloth over a cape whose clip keys the same joints. The bits clear, the GPU
12
+ * side cannot grant them back until {@link gpu_authority_unhold}, and
13
+ * {@link GPU_AUTHORITY_EVENT_HOLD_CHANGE} tells a GPU writer already driving the entity to stop.
14
+ *
15
+ * Declares the entity if it never was. A hold is a claim and has to be visible on the entity; an
16
+ * entity no clip has ever been able to target carries no {@link GPUStateAuthority}, and a clip that
17
+ * binds it later must find the hold there. Seeding a garment is that entity's moment, as binding is
18
+ * for a joint attached under an animated one.
19
+ *
20
+ * **Holding does not seed a value.** The component holds what the CPU last wrote, which for a joint
21
+ * a clip was resolving is not this frame's pose; the holder writes its own before anything reads it.
22
+ *
23
+ * @param {EntityComponentDataset} dataset
24
+ * @param {number} entity
25
+ * @param {number} flags one or more {@link GPUStateAuthorityFlags}, none of them already held
26
+ */
27
+ export function gpu_authority_hold(dataset, entity, flags) {
28
+ assert.defined(dataset, 'dataset');
29
+ assert.isNonNegativeInteger(entity, 'entity');
30
+ assert.isNonNegativeInteger(flags, 'flags');
31
+ assert.equal(flags & ~GPU_STATE_AUTHORITY_FLAGS_ALL, 0, `flags (${gpu_state_authority_flag_names(flags)}) contains bits GPUStateAuthorityFlags does not assign`);
32
+
33
+ const authority = gpu_authority_declare(dataset, entity);
34
+
35
+ assert.equal(authority.held & flags, 0, `entity ${entity} is already held for ${gpu_state_authority_flag_names(authority.held & flags)}: two CPU writers of one component`);
36
+
37
+ authority.held |= flags;
38
+ authority.flags &= ~flags;
39
+
40
+ dataset.sendEvent(entity, GPU_AUTHORITY_EVENT_HOLD_CHANGE, entity);
41
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * End a CPU writer's hold on these components — the reverse of {@link gpu_authority_hold}.
3
+ *
4
+ * **Grants nothing.** Whether the GPU writes the component now is not the holder's to say: a clip
5
+ * may have bound the joint during the hold, or left it. The event tells whatever drives the entity
6
+ * on the GPU, and that writer takes the component back if it still wants it. With nothing driving
7
+ * it, it stays the CPU's, holding what the holder last wrote.
8
+ *
9
+ * @param {EntityComponentDataset} dataset
10
+ * @param {number} entity
11
+ * @param {number} flags one or more {@link GPUStateAuthorityFlags}, every one of them held
12
+ */
13
+ export function gpu_authority_unhold(dataset: EntityComponentDataset, entity: number, flags: number): void;
14
+ //# sourceMappingURL=gpu_authority_unhold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gpu_authority_unhold.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/gpu/gpu_authority_unhold.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,8EAHW,MAAM,SACN,MAAM,QAgBhB"}
@@ -0,0 +1,32 @@
1
+ import { assert } from "../../../core/assert.js";
2
+ import { GPU_AUTHORITY_EVENT_HOLD_CHANGE } from "./GPU_AUTHORITY_EVENT_HOLD_CHANGE.js";
3
+ import { GPUStateAuthority } from "./GPUStateAuthority.js";
4
+ import { GPU_STATE_AUTHORITY_FLAGS_ALL, gpu_state_authority_flag_names } from "./GPUStateAuthorityFlags.js";
5
+
6
+ /**
7
+ * End a CPU writer's hold on these components — the reverse of {@link gpu_authority_hold}.
8
+ *
9
+ * **Grants nothing.** Whether the GPU writes the component now is not the holder's to say: a clip
10
+ * may have bound the joint during the hold, or left it. The event tells whatever drives the entity
11
+ * on the GPU, and that writer takes the component back if it still wants it. With nothing driving
12
+ * it, it stays the CPU's, holding what the holder last wrote.
13
+ *
14
+ * @param {EntityComponentDataset} dataset
15
+ * @param {number} entity
16
+ * @param {number} flags one or more {@link GPUStateAuthorityFlags}, every one of them held
17
+ */
18
+ export function gpu_authority_unhold(dataset, entity, flags) {
19
+ assert.defined(dataset, 'dataset');
20
+ assert.isNonNegativeInteger(entity, 'entity');
21
+ assert.isNonNegativeInteger(flags, 'flags');
22
+ assert.equal(flags & ~GPU_STATE_AUTHORITY_FLAGS_ALL, 0, `flags (${gpu_state_authority_flag_names(flags)}) contains bits GPUStateAuthorityFlags does not assign`);
23
+
24
+ const authority = dataset.getComponent(entity, GPUStateAuthority);
25
+
26
+ assert.ok(authority !== undefined && authority !== null, `entity ${entity} has no GPUStateAuthority, so nothing holds it`);
27
+ assert.equal(authority.held & flags, flags, `entity ${entity} is not held for ${gpu_state_authority_flag_names(flags & ~authority.held)}`);
28
+
29
+ authority.held &= ~flags;
30
+
31
+ dataset.sendEvent(entity, GPU_AUTHORITY_EVENT_HOLD_CHANGE, entity);
32
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * A goal for the bone it sits on, the effector: bring it to where its target entity is, turning the
3
+ * bones from it up to {@link chain_root}. {@link IKGoalSystem} solves it.
4
+ *
5
+ * The tree is the {@link TransformAttachment} hierarchy, and the goal's path runs from the effector
6
+ * up to its chain root. A link of the path turns; the chain root turns and never moves. Joint limits
7
+ * are the physics `Joint` on each bone of the path.
8
+ *
9
+ * - The references are entities and are fixed while the component is attached: remove it and add it
10
+ * back to change them.
11
+ * - The goal removes itself when its target or any bone of its path is destroyed.
12
+ * - Weights are 0..1. Position weight 0 gives the pose the bones would have without the goal, and the
13
+ * pose is continuous in it. Rotation weight 0 leaves the effector's rotation riding its chain; 1
14
+ * gives it the target's.
15
+ *
16
+ * Bones are spawned with their model and never saved, and an entity id means nothing in a save, so
17
+ * neither is this.
18
+ *
19
+ * @author Alex Goldring
20
+ * @copyright Company Named Limited (c) 2026
21
+ */
22
+ export class IKGoal {
23
+ /**
24
+ * @param {{target:number, chain_root:number, position_weight:number, rotation_weight:number}} options
25
+ * every field required
26
+ * @returns {IKGoal}
27
+ */
28
+ static from({ target, chain_root, position_weight, rotation_weight }: {
29
+ target: number;
30
+ chain_root: number;
31
+ position_weight: number;
32
+ rotation_weight: number;
33
+ }): IKGoal;
34
+ /**
35
+ * The entity whose world pose the effector is brought to.
36
+ * @type {number}
37
+ */
38
+ target: number;
39
+ /**
40
+ * The highest bone the goal turns: the effector itself or one of its ancestors.
41
+ * @type {number}
42
+ */
43
+ chain_root: number;
44
+ /**
45
+ * How far toward the target the effector is pulled, 0..1.
46
+ * @type {number}
47
+ */
48
+ position_weight: number;
49
+ /**
50
+ * How far toward the target's rotation the effector is turned, 0..1.
51
+ * @type {number}
52
+ */
53
+ rotation_weight: number;
54
+ }
55
+ export namespace IKGoal {
56
+ let typeName: string;
57
+ let serializable: boolean;
58
+ }
59
+ //# sourceMappingURL=IKGoal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IKGoal.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/ik/IKGoal.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAyBI;;;;OAIG;IACH,sEAJW;QAAC,MAAM,EAAC,MAAM,CAAC;QAAC,UAAU,EAAC,MAAM,CAAC;QAAC,eAAe,EAAC,MAAM,CAAC;QAAC,eAAe,EAAC,MAAM,CAAA;KAAC,GAEhF,MAAM,CAkBlB;IA7CD;;;OAGG;IACH,QAFU,MAAM,CAEJ;IAEZ;;;OAGG;IACH,YAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,iBAFU,MAAM,CAEI;CAwBvB;;kBAIS,MAAM;sBAMN,OAAO"}
@@ -0,0 +1,83 @@
1
+ import { assert } from "../../../core/assert.js";
2
+
3
+ /**
4
+ * A goal for the bone it sits on, the effector: bring it to where its target entity is, turning the
5
+ * bones from it up to {@link chain_root}. {@link IKGoalSystem} solves it.
6
+ *
7
+ * The tree is the {@link TransformAttachment} hierarchy, and the goal's path runs from the effector
8
+ * up to its chain root. A link of the path turns; the chain root turns and never moves. Joint limits
9
+ * are the physics `Joint` on each bone of the path.
10
+ *
11
+ * - The references are entities and are fixed while the component is attached: remove it and add it
12
+ * back to change them.
13
+ * - The goal removes itself when its target or any bone of its path is destroyed.
14
+ * - Weights are 0..1. Position weight 0 gives the pose the bones would have without the goal, and the
15
+ * pose is continuous in it. Rotation weight 0 leaves the effector's rotation riding its chain; 1
16
+ * gives it the target's.
17
+ *
18
+ * Bones are spawned with their model and never saved, and an entity id means nothing in a save, so
19
+ * neither is this.
20
+ *
21
+ * @author Alex Goldring
22
+ * @copyright Company Named Limited (c) 2026
23
+ */
24
+ export class IKGoal {
25
+ /**
26
+ * The entity whose world pose the effector is brought to.
27
+ * @type {number}
28
+ */
29
+ target = -1;
30
+
31
+ /**
32
+ * The highest bone the goal turns: the effector itself or one of its ancestors.
33
+ * @type {number}
34
+ */
35
+ chain_root = -1;
36
+
37
+ /**
38
+ * How far toward the target the effector is pulled, 0..1.
39
+ * @type {number}
40
+ */
41
+ position_weight = 0;
42
+
43
+ /**
44
+ * How far toward the target's rotation the effector is turned, 0..1.
45
+ * @type {number}
46
+ */
47
+ rotation_weight = 0;
48
+
49
+ /**
50
+ * @param {{target:number, chain_root:number, position_weight:number, rotation_weight:number}} options
51
+ * every field required
52
+ * @returns {IKGoal}
53
+ */
54
+ static from({ target, chain_root, position_weight, rotation_weight }) {
55
+ assert.isNonNegativeInteger(target, 'target');
56
+ assert.isNonNegativeInteger(chain_root, 'chain_root');
57
+ assert.isNumber(position_weight, 'position_weight');
58
+ assert.isNumber(rotation_weight, 'rotation_weight');
59
+ assert.ok(position_weight >= 0 && position_weight <= 1, 'position_weight is within 0..1');
60
+ assert.ok(rotation_weight >= 0 && rotation_weight <= 1, 'rotation_weight is within 0..1');
61
+
62
+ const goal = new IKGoal();
63
+
64
+ goal.target = target;
65
+ goal.chain_root = chain_root;
66
+ goal.position_weight = position_weight;
67
+ goal.rotation_weight = rotation_weight;
68
+
69
+ return goal;
70
+ }
71
+ }
72
+
73
+ /**
74
+ * @readonly
75
+ * @type {string}
76
+ */
77
+ IKGoal.typeName = "IKGoal";
78
+
79
+ /**
80
+ * Entity ids are transient and bones are never saved: serialization is not applicable.
81
+ * @type {boolean}
82
+ */
83
+ IKGoal.serializable = false;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Brings bones to their goals ({@link IKGoal}): frame FABRIK over the connected paths of a model, or,
3
+ * for a lone path of three bones, the analytic two-bone solve.
4
+ *
5
+ * **IK holds the bones it poses** (`gpu_authority_hold` on their {@link TransformAttachment}), as
6
+ * cloth holds a cape's. The animation manager mutes every clip binding that names a held bone, and
7
+ * everything downstream — the GPU hierarchy, `t64_evaluate_world`, sockets, cloth anchors — reads the
8
+ * held offset, which IK writes every tick. Nothing downstream knows IK exists.
9
+ *
10
+ * - **Link:** a goal's path is held bone by bone, each offset captured, and the animated pose
11
+ * written at once, so no frame shows the bind pose.
12
+ * - **Every tick:** each bone's animated local pose is evaluated from its clips with the captured
13
+ * offset as its rest (`pose_evaluate_local`, never a held offset, which is IK's own answer), the
14
+ * paths are solved, and each held bone's whole local pose is written: translation, rotation and
15
+ * scale, since a hold mutes every channel.
16
+ * - **Unlink:** the captured offset is written back and the hold ended, for every bone no other goal
17
+ * still needs.
18
+ *
19
+ * A goal is rejected, holding nothing, for a chain root that is not the effector or an ancestor of
20
+ * it, a chain root that is no bone, a target that is gone or hangs below the goal's own path, a
21
+ * two-bone path whose knee has no bend side, and a cycle of groups each waiting on another. Each is a
22
+ * real branch and an assert, because asserts are stripped in production.
23
+ *
24
+ * A target hanging below another goal's bones in the same group is read from the solver's frames on
25
+ * every iteration. One hanging below another group's bones waits for that group to solve and write.
26
+ *
27
+ * Declared access: IK reads {@link Animation} and {@link AnimationGraphController}, which their
28
+ * drivers write, so it runs after the drivers have set this tick's clip times. A system that places a
29
+ * target through its own `TransformAttachment` (a physics contact probe) reads and writes that
30
+ * component as IK does: declared access leaves the two a cycle, and the scheduler keeps their
31
+ * registration order, so register it first.
32
+ *
33
+ * @author Alex Goldring
34
+ * @copyright Company Named Limited (c) 2026
35
+ */
36
+ export class IKGoalSystem extends System<any> {
37
+ constructor();
38
+ dependencies: (typeof TransformAttachment | typeof IKGoal)[];
39
+ components_used: (ResourceAccessSpecification<typeof Transform64> | ResourceAccessSpecification<typeof AnimationGraphController> | ResourceAccessSpecification<typeof Animation> | ResourceAccessSpecification<typeof IKGoal> | ResourceAccessSpecification<typeof TransformAttachment> | ResourceAccessSpecification<typeof GPUStateAuthority> | ResourceAccessSpecification<typeof ParentEntity> | ResourceAccessSpecification<typeof Joint>)[];
40
+ /**
41
+ * The most iterations a frame FABRIK solve runs.
42
+ * @type {number}
43
+ */
44
+ max_iterations: number;
45
+ /**
46
+ * A frame FABRIK solve stops once an iteration moves no bone this far, in world units.
47
+ * @type {number}
48
+ */
49
+ tolerance: number;
50
+ /**
51
+ * @param {IKGoal} goal
52
+ * @param {TransformAttachment} attachment
53
+ * @param {number} entity
54
+ */
55
+ link(goal: IKGoal, attachment: TransformAttachment, entity: number): void;
56
+ /**
57
+ * @param {IKGoal} goal
58
+ * @param {TransformAttachment} attachment
59
+ * @param {number} entity
60
+ */
61
+ unlink(goal: IKGoal, attachment: TransformAttachment, entity: number): void;
62
+ update(time_delta_seconds: any): void;
63
+ #private;
64
+ }
65
+ import { System } from "../System.js";
66
+ import { TransformAttachment } from "../transform-attachment/TransformAttachment.js";
67
+ import { IKGoal } from "./IKGoal.js";
68
+ import { Transform64 } from "../transform/Transform64.js";
69
+ import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
70
+ import { AnimationGraphController } from "../../graphics3/animation/AnimationGraphController.js";
71
+ import { Animation } from "../animation/Animation.js";
72
+ import { GPUStateAuthority } from "../gpu/GPUStateAuthority.js";
73
+ import { ParentEntity } from "../parent/ParentEntity.js";
74
+ import { Joint } from "../../physics/ecs/Joint.js";
75
+ //# sourceMappingURL=IKGoalSystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IKGoalSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/ik/IKGoalSystem.js"],"names":[],"mappings":"AAyOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;;IAEI,6DAA6C;IAE7C,kbASE;IAEF;;;OAGG;IACH,gBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,WAFU,MAAM,CAEC;IAkDjB;;;;OAIG;IACH,WAJW,MAAM,cACN,mBAAmB,UACnB,MAAM,QAgChB;IAED;;;;OAIG;IACH,aAJW,MAAM,cACN,mBAAmB,UACnB,MAAM,QAkBhB;IAED,sCA+BC;;CA6nBJ;uBA1hCsB,cAAc;oCAED,gDAAgD;uBAQ7D,aAAa;4BAD7B,6BAA6B;4CA1BQ,oDAAoD;yCAEvD,uDAAuD;0BAQtE,2BAA2B;kCAEnB,6BAA6B;6BAIlC,2BAA2B;sBAPlC,4BAA4B"}