@woosh/meep-engine 3.43.0 → 3.45.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 (466) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/editor/prototypeEditorShell.d.ts.map +1 -1
  3. package/editor/prototypeEditorShell.js +4 -2
  4. package/package.json +1 -1
  5. package/src/core/collection/array/array_sort_insertion_ascending.d.ts +19 -0
  6. package/src/core/collection/array/array_sort_insertion_ascending.d.ts.map +1 -0
  7. package/src/core/collection/array/array_sort_insertion_ascending.js +31 -0
  8. package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.d.ts +27 -0
  9. package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.d.ts.map +1 -0
  10. package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.js +39 -0
  11. package/src/core/geom/3d/aabb/aabb3_from_v3_array.d.ts.map +1 -1
  12. package/src/core/geom/3d/aabb/aabb3_from_v3_array.js +4 -1
  13. package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts +2 -2
  14. package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts.map +1 -1
  15. package/src/core/geom/3d/aabb/aabb3_transform_oriented.js +1 -1
  16. package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.d.ts +21 -0
  17. package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.d.ts.map +1 -0
  18. package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.js +36 -0
  19. package/src/core/geom/3d/pose/pose3_apply_point_array.d.ts +25 -0
  20. package/src/core/geom/3d/pose/pose3_apply_point_array.d.ts.map +1 -0
  21. package/src/core/geom/3d/pose/pose3_apply_point_array.js +40 -0
  22. package/src/core/geom/3d/pose/pose3_compose_array.d.ts +28 -0
  23. package/src/core/geom/3d/pose/pose3_compose_array.d.ts.map +1 -0
  24. package/src/core/geom/3d/pose/pose3_compose_array.js +41 -0
  25. package/src/core/geom/3d/pose/pose3_to_local_array.d.ts +29 -0
  26. package/src/core/geom/3d/pose/pose3_to_local_array.d.ts.map +1 -0
  27. package/src/core/geom/3d/pose/pose3_to_local_array.js +42 -0
  28. package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.d.ts +28 -0
  29. package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.d.ts.map +1 -0
  30. package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.js +66 -0
  31. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.d.ts +22 -0
  32. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.d.ts.map +1 -0
  33. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.js +30 -0
  34. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.d.ts +23 -0
  35. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.d.ts.map +1 -0
  36. package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.js +31 -0
  37. package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.d.ts +26 -0
  38. package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.d.ts.map +1 -0
  39. package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.js +46 -0
  40. package/src/core/geom/vec3/v3_distance_array.d.ts +11 -0
  41. package/src/core/geom/vec3/v3_distance_array.d.ts.map +1 -0
  42. package/src/core/geom/vec3/v3_distance_array.js +19 -0
  43. package/src/core/geom/vec3/v3_normalize_array_checked.d.ts +23 -0
  44. package/src/core/geom/vec3/v3_normalize_array_checked.d.ts.map +1 -0
  45. package/src/core/geom/vec3/v3_normalize_array_checked.js +49 -0
  46. package/src/core/geom/vec3/v3_reject_array.d.ts +15 -0
  47. package/src/core/geom/vec3/v3_reject_array.d.ts.map +1 -0
  48. package/src/core/geom/vec3/v3_reject_array.js +32 -0
  49. package/src/core/graph/csr/csr_build_incidence.d.ts +26 -0
  50. package/src/core/graph/csr/csr_build_incidence.d.ts.map +1 -0
  51. package/src/core/graph/csr/csr_build_incidence.js +71 -0
  52. package/src/core/graph/csr/csr_graph_color_greedy.d.ts +25 -0
  53. package/src/core/graph/csr/csr_graph_color_greedy.d.ts.map +1 -0
  54. package/src/core/graph/csr/csr_graph_color_greedy.js +83 -0
  55. package/src/core/graph/csr/csr_graph_validate_coloring.d.ts +15 -0
  56. package/src/core/graph/csr/csr_graph_validate_coloring.d.ts.map +1 -0
  57. package/src/core/graph/csr/csr_graph_validate_coloring.js +33 -0
  58. package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.d.ts +26 -0
  59. package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.d.ts.map +1 -0
  60. package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.js +71 -0
  61. package/src/core/math/max2_exact.d.ts +15 -0
  62. package/src/core/math/max2_exact.d.ts.map +1 -0
  63. package/src/core/math/max2_exact.js +30 -0
  64. package/src/core/math/min2_exact.d.ts +20 -0
  65. package/src/core/math/min2_exact.d.ts.map +1 -0
  66. package/src/core/math/min2_exact.js +35 -0
  67. package/src/engine/Clock.d.ts +15 -0
  68. package/src/engine/Clock.d.ts.map +1 -1
  69. package/src/engine/Clock.js +29 -5
  70. package/src/engine/Engine.d.ts.map +1 -1
  71. package/src/engine/Engine.js +11 -19
  72. package/src/engine/ecs/ik/IKGoalSystem.d.ts.map +1 -1
  73. package/src/engine/ecs/ik/IKGoalSystem.js +3 -19
  74. package/src/engine/ecs/parent/parent_entity_model_of.d.ts +17 -0
  75. package/src/engine/ecs/parent/parent_entity_model_of.d.ts.map +1 -0
  76. package/src/engine/ecs/parent/parent_entity_model_of.js +26 -0
  77. package/src/engine/ecs/transform/t64_read_pose_array.d.ts +15 -0
  78. package/src/engine/ecs/transform/t64_read_pose_array.d.ts.map +1 -0
  79. package/src/engine/ecs/transform/t64_read_pose_array.js +24 -0
  80. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts +57 -0
  81. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts.map +1 -0
  82. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.js +84 -0
  83. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts +2 -0
  84. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts.map +1 -1
  85. package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.js +10 -21
  86. package/src/engine/graphics3/AnimationGraphSystem.d.ts +28 -13
  87. package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
  88. package/src/engine/graphics3/AnimationGraphSystem.js +107 -64
  89. package/src/engine/graphics3/AnimationSystem.d.ts +29 -15
  90. package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
  91. package/src/engine/graphics3/AnimationSystem.js +112 -61
  92. package/src/engine/graphics3/MeshSkinSystem.d.ts +56 -0
  93. package/src/engine/graphics3/MeshSkinSystem.d.ts.map +1 -0
  94. package/src/engine/graphics3/MeshSkinSystem.js +317 -0
  95. package/src/engine/graphics3/MeshSystem.d.ts +15 -35
  96. package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
  97. package/src/engine/graphics3/MeshSystem.js +21 -298
  98. package/src/engine/graphics3/RowChains.d.ts +76 -0
  99. package/src/engine/graphics3/RowChains.d.ts.map +1 -0
  100. package/src/engine/graphics3/RowChains.js +347 -0
  101. package/src/engine/graphics3/ShadedGeometrySystem.d.ts +6 -0
  102. package/src/engine/graphics3/ShadedGeometrySystem.d.ts.map +1 -1
  103. package/src/engine/graphics3/ShadedGeometrySystem.js +329 -309
  104. package/src/engine/graphics3/animation/AnimationClips.d.ts +56 -0
  105. package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -0
  106. package/src/engine/graphics3/animation/AnimationClips.js +79 -0
  107. package/src/engine/graphics3/animation/ClipListPlayer.d.ts +13 -14
  108. package/src/engine/graphics3/animation/ClipListPlayer.d.ts.map +1 -1
  109. package/src/engine/graphics3/animation/ClipListPlayer.js +262 -263
  110. package/src/engine/graphics3/animation/write_clip_playback.d.ts +3 -3
  111. package/src/engine/graphics3/animation/write_clip_playback.js +4 -4
  112. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts +5 -0
  113. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts.map +1 -1
  114. package/src/engine/graphics3/pose/query_entity_node_world_pose.js +80 -75
  115. package/src/engine/graphics3/prefab/PrefabInstance.d.ts +4 -24
  116. package/src/engine/graphics3/prefab/PrefabInstance.d.ts.map +1 -1
  117. package/src/engine/graphics3/prefab/PrefabInstance.js +60 -80
  118. package/src/engine/graphics3/prefab/prefab_instantiate.d.ts +16 -3
  119. package/src/engine/graphics3/prefab/prefab_instantiate.d.ts.map +1 -1
  120. package/src/engine/graphics3/prefab/prefab_instantiate.js +49 -12
  121. package/src/engine/graphics3/prefab/prefab_place.d.ts +31 -17
  122. package/src/engine/graphics3/prefab/prefab_place.d.ts.map +1 -1
  123. package/src/engine/graphics3/prefab/prefab_place.js +175 -130
  124. package/src/engine/graphics3/register_clips.d.ts +93 -0
  125. package/src/engine/graphics3/register_clips.d.ts.map +1 -0
  126. package/src/engine/graphics3/register_clips.js +166 -0
  127. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +9 -0
  128. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -1
  129. package/src/engine/physics/broadphase/compute_fat_world_aabb.js +3 -1
  130. package/src/engine/physics/cloth/MEASUREMENTS.md +795 -0
  131. package/src/engine/physics/cloth/PLAN.md +349 -17
  132. package/src/engine/physics/cloth/build/ClothProxy.d.ts +113 -61
  133. package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -1
  134. package/src/engine/physics/cloth/build/ClothProxy.js +142 -77
  135. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts +44 -0
  136. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts.map +1 -0
  137. package/src/engine/physics/cloth/build/cloth_bind_in_frame.js +107 -0
  138. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +43 -30
  139. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -1
  140. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +371 -284
  141. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts +62 -0
  142. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts.map +1 -0
  143. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.js +275 -0
  144. package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts +7 -0
  145. package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts.map +1 -1
  146. package/src/engine/physics/cloth/collider/ClothColliderIndex.js +85 -67
  147. package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts.map +1 -1
  148. package/src/engine/physics/cloth/collider/cloth_collider_bounds.js +19 -101
  149. package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts +2 -5
  150. package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts.map +1 -1
  151. package/src/engine/physics/cloth/collider/cloth_collider_pack.js +7 -15
  152. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +1 -1
  153. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts.map +1 -1
  154. package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +17 -62
  155. package/src/engine/physics/cloth/ecs/Cloth.d.ts +17 -9
  156. package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
  157. package/src/engine/physics/cloth/ecs/Cloth.js +220 -212
  158. package/src/engine/physics/cloth/ecs/ClothColliderFlags.d.ts +0 -1
  159. package/src/engine/physics/cloth/ecs/ClothColliderFlags.js +6 -19
  160. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts +1 -2
  161. package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts.map +1 -1
  162. package/src/engine/physics/cloth/ecs/ClothColliderSystem.js +3 -12
  163. package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +6 -0
  164. package/src/engine/physics/cloth/ecs/ClothHold.d.ts +91 -0
  165. package/src/engine/physics/cloth/ecs/ClothHold.d.ts.map +1 -0
  166. package/src/engine/physics/cloth/ecs/ClothHold.js +103 -0
  167. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +254 -48
  168. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
  169. package/src/engine/physics/cloth/ecs/ClothInstance.js +277 -47
  170. package/src/engine/physics/cloth/ecs/ClothPin.d.ts +73 -0
  171. package/src/engine/physics/cloth/ecs/ClothPin.d.ts.map +1 -0
  172. package/src/engine/physics/cloth/ecs/ClothPin.js +92 -0
  173. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts +36 -0
  174. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts.map +1 -0
  175. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.js +61 -0
  176. package/src/engine/physics/cloth/ecs/ClothRig.d.ts +23 -17
  177. package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -1
  178. package/src/engine/physics/cloth/ecs/ClothRig.js +29 -27
  179. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +12 -14
  180. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
  181. package/src/engine/physics/cloth/ecs/ClothSystem.js +20 -15
  182. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +57 -36
  183. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
  184. package/src/engine/physics/cloth/ecs/ClothWorld.js +754 -207
  185. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +12 -13
  186. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -1
  187. package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +20 -14
  188. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +63 -11
  189. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
  190. package/src/engine/physics/cloth/ecs/cloth_build_rows.js +297 -101
  191. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts +9 -7
  192. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
  193. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +12 -10
  194. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +3 -3
  195. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts.map +1 -1
  196. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +60 -120
  197. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +37 -0
  198. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts.map +1 -0
  199. package/src/engine/physics/cloth/ecs/cloth_geodesic.js +135 -0
  200. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts +97 -0
  201. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts.map +1 -0
  202. package/src/engine/physics/cloth/ecs/cloth_holds.js +583 -0
  203. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +2 -2
  204. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -1
  205. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +168 -51
  206. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +17 -22
  207. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -1
  208. package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +55 -117
  209. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +21 -6
  210. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
  211. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +51 -42
  212. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +5 -0
  213. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
  214. package/src/engine/physics/cloth/ecs/cloth_write_back.js +62 -50
  215. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -1
  216. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +65 -58
  217. package/src/engine/physics/cloth/playground/cloth_playground_build.d.ts.map +1 -1
  218. package/src/engine/physics/cloth/playground/cloth_playground_build.js +2 -3
  219. package/src/engine/physics/cloth/playground/collide_main.js +3 -29
  220. package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -1
  221. package/src/engine/physics/cloth/playground/garment_build.js +17 -5
  222. package/src/engine/physics/cloth/playground/garment_main.js +5 -20
  223. package/src/engine/physics/cloth/playground/main.js +6 -48
  224. package/src/engine/physics/cloth/playground/rig_build.d.ts.map +1 -1
  225. package/src/engine/physics/cloth/playground/rig_build.js +302 -296
  226. package/src/engine/physics/cloth/playground/rig_main.js +947 -955
  227. package/src/engine/physics/cloth/playground/wind_main.js +8 -7
  228. package/src/engine/physics/cloth/solver/ClothState.d.ts +45 -7
  229. package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
  230. package/src/engine/physics/cloth/solver/ClothState.js +79 -83
  231. package/src/engine/physics/cloth/solver/cloth_color_particles.d.ts +10 -8
  232. package/src/engine/physics/cloth/solver/cloth_color_particles.d.ts.map +1 -1
  233. package/src/engine/physics/cloth/solver/cloth_color_particles.js +30 -102
  234. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts +6 -1
  235. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -1
  236. package/src/engine/physics/cloth/solver/cloth_contact_find.js +9 -3
  237. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts +114 -0
  238. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts.map +1 -0
  239. package/src/engine/physics/cloth/solver/cloth_hold_line.js +350 -0
  240. package/src/engine/physics/cloth/solver/cloth_kinetic_energy.d.ts +21 -0
  241. package/src/engine/physics/cloth/solver/cloth_kinetic_energy.d.ts.map +1 -0
  242. package/src/engine/physics/cloth/solver/cloth_kinetic_energy.js +45 -0
  243. package/src/engine/physics/cloth/solver/cloth_particle_coupling.d.ts +32 -0
  244. package/src/engine/physics/cloth/solver/cloth_particle_coupling.d.ts.map +1 -0
  245. package/src/engine/physics/cloth/solver/cloth_particle_coupling.js +133 -0
  246. package/src/engine/physics/cloth/solver/cloth_particle_of_source.d.ts +16 -0
  247. package/src/engine/physics/cloth/solver/cloth_particle_of_source.d.ts.map +1 -0
  248. package/src/engine/physics/cloth/solver/cloth_particle_of_source.js +19 -0
  249. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +6 -2
  250. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -1
  251. package/src/engine/physics/cloth/solver/cloth_self_find.js +19 -68
  252. package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts.map +1 -1
  253. package/src/engine/physics/cloth/solver/cloth_solve_vertex.js +30 -65
  254. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +24 -12
  255. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
  256. package/src/engine/physics/cloth/solver/cloth_solver_constants.js +24 -12
  257. package/src/engine/physics/cloth/solver/cloth_step.d.ts +16 -0
  258. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  259. package/src/engine/physics/cloth/solver/cloth_step.js +189 -48
  260. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +1 -0
  261. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -1
  262. package/src/engine/physics/cloth/solver/cloth_step_instance.js +12 -6
  263. package/src/engine/physics/cloth/solver/cloth_stretch_residual.d.ts +21 -0
  264. package/src/engine/physics/cloth/solver/cloth_stretch_residual.d.ts.map +1 -0
  265. package/src/engine/physics/cloth/solver/cloth_stretch_residual.js +54 -0
  266. package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.d.ts +15 -0
  267. package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.d.ts.map +1 -1
  268. package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.js +28 -0
  269. package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.d.ts +30 -0
  270. package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.d.ts.map +1 -0
  271. package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.js +56 -0
  272. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
  273. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +3 -17
  274. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts +1 -1
  275. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts.map +1 -1
  276. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.js +353 -346
  277. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +7 -5
  278. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -1
  279. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +7 -5
  280. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts +2 -1
  281. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -1
  282. package/src/engine/physics/cloth/wind/ClothFluidWind.js +7 -25
  283. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +12 -10
  284. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -1
  285. package/src/engine/physics/cloth/wind/cloth_sample_air.js +60 -82
  286. package/src/engine/physics/ecs/ContactProbeSystem.d.ts.map +1 -1
  287. package/src/engine/physics/ecs/ContactProbeSystem.js +2 -18
  288. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  289. package/src/engine/physics/ecs/PhysicsSystem.js +9 -50
  290. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  291. package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.d.ts +24 -0
  292. package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.d.ts.map +1 -0
  293. package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.js +42 -0
  294. package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.d.ts +25 -0
  295. package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.d.ts.map +1 -0
  296. package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.js +40 -0
  297. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.d.ts.map +1 -1
  298. package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.js +40 -90
  299. package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
  300. package/src/engine/physics/narrowphase/capsule_contacts.js +3 -5
  301. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -1
  302. package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +2 -14
  303. package/src/engine/physics/narrowphase/hull_sphere_contact.d.ts.map +1 -1
  304. package/src/engine/physics/narrowphase/hull_sphere_contact.js +2 -5
  305. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
  306. package/src/engine/physics/narrowphase/narrowphase_step.js +13 -32
  307. package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -1
  308. package/src/engine/physics/narrowphase/sphere_box_contact.js +2 -5
  309. package/src/engine/simulation/Ticker.d.ts +13 -0
  310. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  311. package/src/engine/simulation/Ticker.js +43 -8
  312. package/src/format/texture/basis/transcode/etc1s_to_astc.d.ts.map +1 -1
  313. package/src/format/texture/basis/transcode/etc1s_to_astc.js +2 -1
  314. package/src/shade/RENDERER_CONTRACT.md +8 -2
  315. package/src/shade/playground/image_decode_bench/main.js +2 -1
  316. package/src/shade/playground/mesh_row_ceiling/main.js +2 -1
  317. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
  318. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js +2 -1
  319. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  320. package/src/shade/playground/skinned_blas_refit/main.js +11 -19
  321. package/src/shade/playground/skinned_blas_refit/place_character.d.ts +6 -3
  322. package/src/shade/playground/skinned_blas_refit/place_character.d.ts.map +1 -1
  323. package/src/shade/playground/skinned_blas_refit/place_character.js +90 -90
  324. package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
  325. package/src/shade/playground/skinned_mesh_soup/main.js +502 -509
  326. package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.d.ts.map +1 -1
  327. package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.js +2 -1
  328. package/src/shade/playground/ssr_variance/statistics.d.ts.map +1 -1
  329. package/src/shade/playground/ssr_variance/statistics.js +2 -1
  330. package/src/shade/playground/texture_encode/README.md +129 -109
  331. package/src/shade/playground/texture_encode/main.d.ts.map +1 -1
  332. package/src/shade/playground/texture_encode/main.js +1431 -1430
  333. package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
  334. package/src/shade/playground/volumetrics_froxel/measure.js +2 -1
  335. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +45 -14
  336. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  337. package/src/shade/renderer/animation/GPUAnimationManager.js +316 -64
  338. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +5 -0
  339. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  340. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +11 -1
  341. package/src/shade/renderer/buffer/table/gpu_database_check_links.d.ts.map +1 -1
  342. package/src/shade/renderer/buffer/table/gpu_database_check_links.js +2 -1
  343. package/src/shade/renderer/geometry/BoxGeometry.d.ts +1 -11
  344. package/src/shade/renderer/geometry/BoxGeometry.d.ts.map +1 -1
  345. package/src/shade/renderer/geometry/BoxGeometry.js +6 -13
  346. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts +19 -0
  347. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts.map +1 -0
  348. package/src/shade/renderer/geometry/CapsuleGeometry.js +24 -0
  349. package/src/shade/renderer/geometry/ConeGeometry.d.ts +20 -0
  350. package/src/shade/renderer/geometry/ConeGeometry.d.ts.map +1 -0
  351. package/src/shade/renderer/geometry/ConeGeometry.js +33 -0
  352. package/src/shade/renderer/geometry/CylinderGeometry.d.ts +21 -0
  353. package/src/shade/renderer/geometry/CylinderGeometry.d.ts.map +1 -0
  354. package/src/shade/renderer/geometry/CylinderGeometry.js +35 -0
  355. package/src/shade/renderer/geometry/PlaneGeometry.d.ts +17 -0
  356. package/src/shade/renderer/geometry/PlaneGeometry.d.ts.map +1 -0
  357. package/src/shade/renderer/geometry/PlaneGeometry.js +22 -0
  358. package/src/shade/renderer/geometry/TorusGeometry.d.ts +18 -0
  359. package/src/shade/renderer/geometry/TorusGeometry.d.ts.map +1 -0
  360. package/src/shade/renderer/geometry/TorusGeometry.js +23 -0
  361. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts +21 -0
  362. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts.map +1 -0
  363. package/src/shade/renderer/geometry/UVSphereGeometry.js +34 -0
  364. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts +19 -0
  365. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts.map +1 -0
  366. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.js +205 -0
  367. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts +21 -0
  368. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts.map +1 -0
  369. package/src/shade/renderer/geometry/primitives/make_cone_geometry.js +36 -0
  370. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts +1 -1
  371. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts.map +1 -1
  372. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.js +44 -9
  373. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts +20 -0
  374. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts.map +1 -0
  375. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.js +190 -0
  376. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
  377. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +3 -2
  378. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.d.ts.map +1 -1
  379. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.js +2 -1
  380. package/src/shade/renderer/geometry/virtual/build/level/vgeo_partition_into_groups.d.ts.map +1 -1
  381. package/src/shade/renderer/geometry/virtual/build/level/vgeo_partition_into_groups.js +2 -1
  382. package/src/shade/renderer/geometry/virtual/build/level/vgeo_run_round.d.ts.map +1 -1
  383. package/src/shade/renderer/geometry/virtual/build/level/vgeo_run_round.js +2 -1
  384. package/src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.d.ts.map +1 -1
  385. package/src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.js +3 -2
  386. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.d.ts.map +1 -1
  387. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.js +2 -1
  388. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.d.ts.map +1 -1
  389. package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.js +2 -1
  390. package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.d.ts.map +1 -1
  391. package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.js +3 -2
  392. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
  393. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +7 -2
  394. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts +26 -8
  395. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts.map +1 -1
  396. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js +56 -39
  397. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts +7 -0
  398. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts.map +1 -1
  399. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js +46 -4
  400. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.d.ts.map +1 -1
  401. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js +4 -2
  402. package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +2 -2
  403. package/src/shade/renderer/gpu_primitive/sort/defs.js +79 -79
  404. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +1 -1
  405. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
  406. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +7 -3
  407. package/src/shade/renderer/particles/GPUParticleSystem.js +1 -1
  408. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +4 -3
  409. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
  410. package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +200 -194
  411. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  412. package/src/shade/renderer/particles/graph_particles.js +6 -2
  413. package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.d.ts.map +1 -1
  414. package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.js +3 -2
  415. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
  416. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +334 -329
  417. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  418. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +7 -2
  419. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
  420. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +16 -4
  421. package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +2444 -2345
  422. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
  423. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +312 -310
  424. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +3 -3
  425. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
  426. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +383 -375
  427. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
  428. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +349 -346
  429. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +58 -0
  430. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -0
  431. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +536 -0
  432. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +21 -7
  433. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
  434. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +291 -327
  435. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts +25 -0
  436. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts.map +1 -0
  437. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.js +99 -0
  438. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +5 -3
  439. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -1
  440. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +47 -71
  441. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts +10 -0
  442. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts.map +1 -0
  443. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +50 -0
  444. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +4 -5
  445. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -1
  446. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +7 -8
  447. package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
  448. package/src/shade/renderer/water/chunk_water_transport.js +7 -5
  449. package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
  450. package/src/shade/renderer/water/medium/GPUWaterBodies.js +8 -2
  451. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts +3 -2
  452. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts.map +1 -1
  453. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.js +3 -2
  454. package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
  455. package/src/shade/renderer/water/shader_water.js +3 -1
  456. package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -1
  457. package/src/shade/renderer/water/surface/GPUWaterSurface.js +3 -1
  458. package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
  459. package/src/shade/renderer/water/surface/graph_water_tessellation.js +11 -4
  460. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  461. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +37 -20
  462. package/src/shade/wgsl/validate_wgsl_source.d.ts.map +1 -1
  463. package/src/shade/wgsl/validate_wgsl_source.js +74 -3
  464. package/src/engine/graphics3/register_instance_animation.d.ts +0 -114
  465. package/src/engine/graphics3/register_instance_animation.d.ts.map +0 -1
  466. package/src/engine/graphics3/register_instance_animation.js +0 -201
@@ -9,63 +9,91 @@
9
9
  * ## Joints by index, resolved once
10
10
  *
11
11
  * Every field below is an integer or a float. **No names survive into the
12
- * runtime**, and that is §3.2's central commitment: a joint is a `Node3D` inside
13
- * a `SceneBundleInstance` rather than an entity, so an `EntityReference` to one
14
- * is impossible by construction, and reintroducing strings at runtime to work
15
- * around that would be the wrong answer. {@link joint} holds indices into
16
- * `Skin#joints`, resolved at build time from `SceneBundleInstance#nodes`.
12
+ * runtime**, and that is §3.2's central commitment. {@link joint} holds indices
13
+ * into `Skin#joints`, resolved at build time; indices into a skin are stable
14
+ * across respawns where entity ids are not.
17
15
  *
18
- * {@link joint_name} is the exception and it is build-time provenance: it is
16
+ * {@link particle_name} is the exception and it is build-time provenance: it is
19
17
  * what a diagnostic prints when a proxy does not fit the model it was pointed
20
18
  * at, and nothing on the step path reads it.
21
19
  *
22
- * ## The rigged form, which is the whole of M3
20
+ * ## Particles, and which of them cloth writes
23
21
  *
24
- * §11.2 has two cases and they differ only in where the joints and the weights
25
- * came from. **A rigged garment brings both**: an artist made 8–20 cape joints
26
- * and skinned the cape to them, so the proxy is thin — joint indices, the
27
- * topology connecting them, the bind pose, and `d_geo`. There is no binding
28
- * step and no generated geometry, because the artist's skin *is* the relation.
22
+ * Every particle is a joint of the skin. Most are the garment's own — an artist
23
+ * made 8–20 cape joints and skinned the cape to them — and those are the ones
24
+ * cloth simulates and writes ({@link output} set). The rest are the **bones the
25
+ * garment hangs from**: the parent of each of the garment's root joints, which
26
+ * is not the garment's to move. They are particles all the same, because the
27
+ * links from them to the roots are the first links of the fabric, and what holds
28
+ * them is whatever holds anything — a `ClothPin`, on the bone itself:
29
29
  *
30
- * The unrigged case generates a joint set and a skin for a garment that has
31
- * neither, and its extra data — the render mesh's generated weights and
32
- * inverse-bind matrices — is not in this class yet. §11.3 step 9 and §18's open
33
- * joint-budget question are what would add it.
30
+ * ```js
31
+ * for (const group of built.groups) {
32
+ * skin.joints[group.joint].add(ClothPin.from({ cloth: character, particles: group.particles }));
33
+ * }
34
+ * ```
35
+ *
36
+ * A garment hanging from one bone is today's cape; one hanging from both
37
+ * shoulders and the spine is the same proxy with three such particles.
38
+ *
39
+ * ## The fabric is the proxy's
40
+ *
41
+ * {@link edge}, {@link skip} and {@link hinge} are the particle graph the rows
42
+ * are built from — a joint chain's links and the pairs two links apart, or a
43
+ * sheet's triangle edges and the hinges across them. {@link parent} is a
44
+ * different thing: the hierarchy the *output* is written against, which for a
45
+ * chain happens to run along the same links and for a sheet runs nowhere — every
46
+ * joint of a generated skin hangs straight off the frame.
47
+ *
48
+ * ## The frame is named, and it holds nothing
49
+ *
50
+ * {@link frame} is the joint the garment **rides**: the cloth is simulated in its
51
+ * frame, and its motion is what §7 P7's inertia and limits soften. It is chosen
52
+ * at build — the one bone a garment hangs from, or the nearest joint above all
53
+ * of them — and it decides nothing about what is held.
34
54
  *
35
55
  * ## The bind pose is baked, not read
36
56
  *
37
- * {@link rest_position} and {@link rest_rotation} are the joints' **local**
38
- * transforms at bind time, carried in the proxy rather than read from the
39
- * instance at seed. Reading them from the instance works exactly once: cloth
40
- * takes ownership of `Node3D.transform_local` the moment it starts writing, so
41
- * a re-seed of a live garment would read the shape the solver left behind and
42
- * call it the authored pose. M1 solved the same problem for the entity path with
43
- * a per-seed capture (`remember_rest_pose`); a proxy can do better, because the
44
- * bind pose is build data and does not have to be remembered at all.
57
+ * {@link rest_position} and {@link rest_rotation} are each particle's bind pose
58
+ * **in the frame joint's bind pose**, carried in the proxy rather than read from
59
+ * the instance at seed. Reading them from the instance works exactly once: cloth
60
+ * takes ownership of the joints' offsets the moment it starts writing, so a
61
+ * re-seed of a live garment would read the shape the solver left behind and call
62
+ * it the authored pose.
45
63
  *
46
64
  * @author Alex Goldring
47
65
  * @copyright Company Named Limited (c) 2026
48
66
  */
49
67
  export class ClothProxy {
50
68
  /**
51
- * @param {object} description
69
+ * @param {object} description every field but `name` and `particle_name` required
52
70
  * @param {string} [description.name]
53
71
  * @param {Int32Array|number[]} description.joint
54
- * @param {Int32Array|number[]} description.joint_parent
55
- * @param {number} description.anchor
72
+ * @param {Uint8Array|number[]} description.output
73
+ * @param {Int32Array|number[]} description.parent
74
+ * @param {Int32Array|number[]} description.edge
75
+ * @param {Int32Array|number[]} description.skip
76
+ * @param {Int32Array|number[]} description.hinge
77
+ * @param {Int32Array|number[]} description.triangle
78
+ * @param {number} description.frame
56
79
  * @param {Float32Array|number[]} description.rest_position
57
80
  * @param {Float32Array|number[]} description.rest_rotation
58
- * @param {string[]} [description.joint_name]
81
+ * @param {string[]} [description.particle_name]
59
82
  * @returns {ClothProxy}
60
83
  */
61
- static from({ name, joint, joint_parent, anchor, rest_position, rest_rotation, joint_name }: {
84
+ static from({ name, joint, output, parent, edge, skip, hinge, triangle, frame, rest_position, rest_rotation, particle_name }: {
62
85
  name?: string;
63
86
  joint: Int32Array | number[];
64
- joint_parent: Int32Array | number[];
65
- anchor: number;
87
+ output: Uint8Array | number[];
88
+ parent: Int32Array | number[];
89
+ edge: Int32Array | number[];
90
+ skip: Int32Array | number[];
91
+ hinge: Int32Array | number[];
92
+ triangle: Int32Array | number[];
93
+ frame: number;
66
94
  rest_position: Float32Array | number[];
67
95
  rest_rotation: Float32Array | number[];
68
- joint_name?: string[];
96
+ particle_name?: string[];
69
97
  }): ClothProxy;
70
98
  /**
71
99
  * Name, for diagnostics and for a tool listing the proxies an asset carries.
@@ -73,57 +101,79 @@ export class ClothProxy {
73
101
  */
74
102
  name: string;
75
103
  /**
76
- * How many joints this proxy simulates. The anchor is **not** one of them.
104
+ * How many particles this proxy has.
77
105
  * @type {number}
78
106
  */
79
- joint_count: number;
107
+ particle_count: number;
80
108
  /**
81
- * Index into `Skin#joints` for each simulated joint.
109
+ * Index into `Skin#joints` for each particle.
82
110
  * @type {Int32Array}
83
111
  */
84
112
  joint: Int32Array;
85
113
  /**
86
- * Parent of each simulated joint, as an index into this proxy's own joint
87
- * list, or `-1` for a joint whose parent is the anchor.
114
+ * `1` for a garment joint cloth simulates and writes, `0` for a bone the
115
+ * garment hangs from, which cloth only reads.
116
+ * @type {Uint8Array}
117
+ */
118
+ output: Uint8Array;
119
+ /**
120
+ * Parent of each particle's joint, as an index into this proxy's own
121
+ * particles, or `-1` for a joint whose parent is not one of them: a bone the
122
+ * garment hangs from, or — for a garment that writes it — a joint hanging
123
+ * straight off the frame joint.
88
124
  *
89
- * A proxy's joints are stored **parents before children**, so one forward
90
- * pass composes the whole chain — the same ordering `cloth_seed_subtree`
91
- * gets from a breadth-first walk, and for the same reason.
125
+ * Parents before children, so one forward pass composes the whole forest —
126
+ * the same ordering `cloth_seed_subtree` gets from a breadth-first walk, and
127
+ * for the same reason.
92
128
  * @type {Int32Array}
93
129
  */
94
- joint_parent: Int32Array;
130
+ parent: Int32Array;
95
131
  /**
96
- * Index into `Skin#joints` of the joint the garment hangs from.
97
- *
98
- * It is not simulated, it is the cloth's local frame, and its `d_geo` is
99
- * zero — which is what makes §3.4's derived quantities collapse onto it
100
- * correctly without a second mechanism saying "this one is pinned".
101
- *
102
- * For a rigged garment the fixed set *is* the anchor, and it falls out of
103
- * the topology rather than out of skin weights: a joint whose parent is
104
- * outside the proxy is a joint the garment hangs from. §11.3's step 5 —
105
- * "particles whose skin weights are dominated by joints outside the
106
- * garment's own joint set are pinned" — is the **unrigged** rule, where the
107
- * particles are mesh vertices and there is no joint tree to read.
132
+ * The fabric: particle pairs joined by a hard stretch row, 2 per edge.
133
+ * @type {Int32Array}
134
+ */
135
+ edge: Int32Array;
136
+ /**
137
+ * A chain's bending: particle pairs two links apart, 2 per pair.
138
+ * @type {Int32Array}
139
+ */
140
+ skip: Int32Array;
141
+ /**
142
+ * A surface's bending: the shared edge, then the wing opposite it in each
143
+ * of its two triangles, 4 per hinge — `cloth_bend_row`'s stencil.
144
+ * @type {Int32Array}
145
+ */
146
+ hinge: Int32Array;
147
+ /**
148
+ * Triangles over the particles, 3 per triangle, for a garment that has a
149
+ * surface: what its joints' orientation is read off. Empty for a chain.
150
+ * @type {Int32Array}
151
+ */
152
+ triangle: Int32Array;
153
+ /**
154
+ * Index into `Skin#joints` of the joint whose frame the garment is
155
+ * simulated in.
108
156
  * @type {number}
109
157
  */
110
- anchor: number;
158
+ frame: number;
111
159
  /**
112
- * Each joint's bind-pose local translation, 3 per joint.
160
+ * Each particle's bind-pose position in the frame joint's bind pose, 3 per
161
+ * particle.
113
162
  * @type {Float32Array}
114
163
  */
115
164
  rest_position: Float32Array;
116
165
  /**
117
- * Each joint's bind-pose local rotation, 4 per joint.
166
+ * Each particle's bind-pose orientation in the frame joint's bind pose, 4
167
+ * per particle.
118
168
  * @type {Float32Array}
119
169
  */
120
170
  rest_rotation: Float32Array;
121
171
  /**
122
- * Names, in {@link joint} order, then the anchor's last. Build-time
123
- * provenance; nothing on the step path reads it.
172
+ * Names, in particle order. Build-time provenance; nothing on the step path
173
+ * reads it.
124
174
  * @type {string[]}
125
175
  */
126
- joint_name: string[];
176
+ particle_name: string[];
127
177
  /**
128
178
  * Whether this proxy can address the skin it is about to be used with.
129
179
  *
@@ -134,10 +184,12 @@ export class ClothProxy {
134
184
  * condition, and this is what turns it into a message naming the joint
135
185
  * instead of a garment simulating somebody's spine.
136
186
  *
137
- * @param {Skin} skin
187
+ * @param {{joints: ArrayLike<number>}} skin a `MeshSkin`, or anything with joints in the order the proxy indexes
138
188
  * @returns {string} empty when the proxy fits, otherwise what is wrong
139
189
  */
140
- checkAgainst(skin: Skin): string;
190
+ checkAgainst(skin: {
191
+ joints: ArrayLike<number>;
192
+ }): string;
141
193
  /**
142
194
  * @readonly
143
195
  * @type {boolean}
@@ -1 +1 @@
1
- {"version":3,"file":"ClothProxy.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/build/ClothProxy.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH;IAmEI;;;;;;;;;;OAUG;IACH;QATgC,IAAI,GAAzB,MAAM;QAC2B,KAAK,EAAtC,UAAU,GAAC,MAAM,EAAE;QACc,YAAY,EAA7C,UAAU,GAAC,MAAM,EAAE;QACC,MAAM,EAA1B,MAAM;QAC6B,aAAa,EAAhD,YAAY,GAAC,MAAM,EAAE;QACc,aAAa,EAAhD,YAAY,GAAC,MAAM,EAAE;QACE,UAAU,GAAjC,MAAM,EAAE;QACN,UAAU,CAuCtB;IAjHD;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,OAFU,UAAU,CAEP;IAEb;;;;;;;;OAQG;IACH,cAFU,UAAU,CAEA;IAEpB;;;;;;;;;;;;;;OAcG;IACH,QAFU,MAAM,CAEJ;IAEZ;;;OAGG;IACH,eAFU,YAAY,CAED;IAErB;;;OAGG;IACH,eAFU,YAAY,CAED;IAErB;;;;OAIG;IACH,YAFU,MAAM,EAAE,CAEF;IAoDhB;;;;;;;;;;;;OAYG;IACH,0BAFa,MAAM,CAqBlB;IAGL;;;OAGG;IACH,uBAFU,OAAO,CAEgB;CANhC"}
1
+ {"version":3,"file":"ClothProxy.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/build/ClothProxy.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH;IA8FI;;;;;;;;;;;;;;;OAeG;IACH;QAdgC,IAAI,GAAzB,MAAM;QAC2B,KAAK,EAAtC,UAAU,GAAC,MAAM,EAAE;QACc,MAAM,EAAvC,UAAU,GAAC,MAAM,EAAE;QACc,MAAM,EAAvC,UAAU,GAAC,MAAM,EAAE;QACc,IAAI,EAArC,UAAU,GAAC,MAAM,EAAE;QACc,IAAI,EAArC,UAAU,GAAC,MAAM,EAAE;QACc,KAAK,EAAtC,UAAU,GAAC,MAAM,EAAE;QACc,QAAQ,EAAzC,UAAU,GAAC,MAAM,EAAE;QACC,KAAK,EAAzB,MAAM;QAC6B,aAAa,EAAhD,YAAY,GAAC,MAAM,EAAE;QACc,aAAa,EAAhD,YAAY,GAAC,MAAM,EAAE;QACE,aAAa,GAApC,MAAM,EAAE;QACN,UAAU,CAsDtB;IAhKD;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,gBAFU,MAAM,CAEG;IAEnB;;;OAGG;IACH,OAFU,UAAU,CAEP;IAEb;;;;OAIG;IACH,QAFU,UAAU,CAEN;IAEd;;;;;;;;;;OAUG;IACH,QAFU,UAAU,CAEN;IAEd;;;OAGG;IACH,MAFU,UAAU,CAER;IAEZ;;;OAGG;IACH,MAFU,UAAU,CAER;IAEZ;;;;OAIG;IACH,OAFU,UAAU,CAEP;IAEb;;;;OAIG;IACH,UAFU,UAAU,CAEJ;IAEhB;;;;OAIG;IACH,OAFU,MAAM,CAEL;IAEX;;;;OAIG;IACH,eAFU,YAAY,CAED;IAErB;;;;OAIG;IACH,eAFU,YAAY,CAED;IAErB;;;;OAIG;IACH,eAFU,MAAM,EAAE,CAEC;IAwEnB;;;;;;;;;;;;OAYG;IACH,mBAHW;QAAC,MAAM,EAAE,UAAU,MAAM,CAAC,CAAA;KAAC,GACzB,MAAM,CAqBlB;IAGL;;;OAGG;IACH,uBAFU,OAAO,CAEgB;CANhC"}
@@ -11,39 +11,57 @@ import { assert } from "../../../../core/assert.js";
11
11
  * ## Joints by index, resolved once
12
12
  *
13
13
  * Every field below is an integer or a float. **No names survive into the
14
- * runtime**, and that is §3.2's central commitment: a joint is a `Node3D` inside
15
- * a `SceneBundleInstance` rather than an entity, so an `EntityReference` to one
16
- * is impossible by construction, and reintroducing strings at runtime to work
17
- * around that would be the wrong answer. {@link joint} holds indices into
18
- * `Skin#joints`, resolved at build time from `SceneBundleInstance#nodes`.
14
+ * runtime**, and that is §3.2's central commitment. {@link joint} holds indices
15
+ * into `Skin#joints`, resolved at build time; indices into a skin are stable
16
+ * across respawns where entity ids are not.
19
17
  *
20
- * {@link joint_name} is the exception and it is build-time provenance: it is
18
+ * {@link particle_name} is the exception and it is build-time provenance: it is
21
19
  * what a diagnostic prints when a proxy does not fit the model it was pointed
22
20
  * at, and nothing on the step path reads it.
23
21
  *
24
- * ## The rigged form, which is the whole of M3
22
+ * ## Particles, and which of them cloth writes
25
23
  *
26
- * §11.2 has two cases and they differ only in where the joints and the weights
27
- * came from. **A rigged garment brings both**: an artist made 8–20 cape joints
28
- * and skinned the cape to them, so the proxy is thin — joint indices, the
29
- * topology connecting them, the bind pose, and `d_geo`. There is no binding
30
- * step and no generated geometry, because the artist's skin *is* the relation.
24
+ * Every particle is a joint of the skin. Most are the garment's own — an artist
25
+ * made 8–20 cape joints and skinned the cape to them — and those are the ones
26
+ * cloth simulates and writes ({@link output} set). The rest are the **bones the
27
+ * garment hangs from**: the parent of each of the garment's root joints, which
28
+ * is not the garment's to move. They are particles all the same, because the
29
+ * links from them to the roots are the first links of the fabric, and what holds
30
+ * them is whatever holds anything — a `ClothPin`, on the bone itself:
31
31
  *
32
- * The unrigged case generates a joint set and a skin for a garment that has
33
- * neither, and its extra data — the render mesh's generated weights and
34
- * inverse-bind matrices — is not in this class yet. §11.3 step 9 and §18's open
35
- * joint-budget question are what would add it.
32
+ * ```js
33
+ * for (const group of built.groups) {
34
+ * skin.joints[group.joint].add(ClothPin.from({ cloth: character, particles: group.particles }));
35
+ * }
36
+ * ```
37
+ *
38
+ * A garment hanging from one bone is today's cape; one hanging from both
39
+ * shoulders and the spine is the same proxy with three such particles.
40
+ *
41
+ * ## The fabric is the proxy's
42
+ *
43
+ * {@link edge}, {@link skip} and {@link hinge} are the particle graph the rows
44
+ * are built from — a joint chain's links and the pairs two links apart, or a
45
+ * sheet's triangle edges and the hinges across them. {@link parent} is a
46
+ * different thing: the hierarchy the *output* is written against, which for a
47
+ * chain happens to run along the same links and for a sheet runs nowhere — every
48
+ * joint of a generated skin hangs straight off the frame.
49
+ *
50
+ * ## The frame is named, and it holds nothing
51
+ *
52
+ * {@link frame} is the joint the garment **rides**: the cloth is simulated in its
53
+ * frame, and its motion is what §7 P7's inertia and limits soften. It is chosen
54
+ * at build — the one bone a garment hangs from, or the nearest joint above all
55
+ * of them — and it decides nothing about what is held.
36
56
  *
37
57
  * ## The bind pose is baked, not read
38
58
  *
39
- * {@link rest_position} and {@link rest_rotation} are the joints' **local**
40
- * transforms at bind time, carried in the proxy rather than read from the
41
- * instance at seed. Reading them from the instance works exactly once: cloth
42
- * takes ownership of `Node3D.transform_local` the moment it starts writing, so
43
- * a re-seed of a live garment would read the shape the solver left behind and
44
- * call it the authored pose. M1 solved the same problem for the entity path with
45
- * a per-seed capture (`remember_rest_pose`); a proxy can do better, because the
46
- * bind pose is build data and does not have to be remembered at all.
59
+ * {@link rest_position} and {@link rest_rotation} are each particle's bind pose
60
+ * **in the frame joint's bind pose**, carried in the proxy rather than read from
61
+ * the instance at seed. Reading them from the instance works exactly once: cloth
62
+ * takes ownership of the joints' offsets the moment it starts writing, so a
63
+ * re-seed of a live garment would read the shape the solver left behind and call
64
+ * it the authored pose.
47
65
  *
48
66
  * @author Alex Goldring
49
67
  * @copyright Company Named Limited (c) 2026
@@ -57,110 +75,157 @@ export class ClothProxy {
57
75
  name = "";
58
76
 
59
77
  /**
60
- * How many joints this proxy simulates. The anchor is **not** one of them.
78
+ * How many particles this proxy has.
61
79
  * @type {number}
62
80
  */
63
- joint_count = 0;
81
+ particle_count = 0;
64
82
 
65
83
  /**
66
- * Index into `Skin#joints` for each simulated joint.
84
+ * Index into `Skin#joints` for each particle.
67
85
  * @type {Int32Array}
68
86
  */
69
87
  joint = null;
70
88
 
71
89
  /**
72
- * Parent of each simulated joint, as an index into this proxy's own joint
73
- * list, or `-1` for a joint whose parent is the anchor.
90
+ * `1` for a garment joint cloth simulates and writes, `0` for a bone the
91
+ * garment hangs from, which cloth only reads.
92
+ * @type {Uint8Array}
93
+ */
94
+ output = null;
95
+
96
+ /**
97
+ * Parent of each particle's joint, as an index into this proxy's own
98
+ * particles, or `-1` for a joint whose parent is not one of them: a bone the
99
+ * garment hangs from, or — for a garment that writes it — a joint hanging
100
+ * straight off the frame joint.
74
101
  *
75
- * A proxy's joints are stored **parents before children**, so one forward
76
- * pass composes the whole chain — the same ordering `cloth_seed_subtree`
77
- * gets from a breadth-first walk, and for the same reason.
102
+ * Parents before children, so one forward pass composes the whole forest —
103
+ * the same ordering `cloth_seed_subtree` gets from a breadth-first walk, and
104
+ * for the same reason.
78
105
  * @type {Int32Array}
79
106
  */
80
- joint_parent = null;
107
+ parent = null;
81
108
 
82
109
  /**
83
- * Index into `Skin#joints` of the joint the garment hangs from.
84
- *
85
- * It is not simulated, it is the cloth's local frame, and its `d_geo` is
86
- * zero — which is what makes §3.4's derived quantities collapse onto it
87
- * correctly without a second mechanism saying "this one is pinned".
88
- *
89
- * For a rigged garment the fixed set *is* the anchor, and it falls out of
90
- * the topology rather than out of skin weights: a joint whose parent is
91
- * outside the proxy is a joint the garment hangs from. §11.3's step 5 —
92
- * "particles whose skin weights are dominated by joints outside the
93
- * garment's own joint set are pinned" — is the **unrigged** rule, where the
94
- * particles are mesh vertices and there is no joint tree to read.
110
+ * The fabric: particle pairs joined by a hard stretch row, 2 per edge.
111
+ * @type {Int32Array}
112
+ */
113
+ edge = null;
114
+
115
+ /**
116
+ * A chain's bending: particle pairs two links apart, 2 per pair.
117
+ * @type {Int32Array}
118
+ */
119
+ skip = null;
120
+
121
+ /**
122
+ * A surface's bending: the shared edge, then the wing opposite it in each
123
+ * of its two triangles, 4 per hinge — `cloth_bend_row`'s stencil.
124
+ * @type {Int32Array}
125
+ */
126
+ hinge = null;
127
+
128
+ /**
129
+ * Triangles over the particles, 3 per triangle, for a garment that has a
130
+ * surface: what its joints' orientation is read off. Empty for a chain.
131
+ * @type {Int32Array}
132
+ */
133
+ triangle = null;
134
+
135
+ /**
136
+ * Index into `Skin#joints` of the joint whose frame the garment is
137
+ * simulated in.
95
138
  * @type {number}
96
139
  */
97
- anchor = -1;
140
+ frame = -1;
98
141
 
99
142
  /**
100
- * Each joint's bind-pose local translation, 3 per joint.
143
+ * Each particle's bind-pose position in the frame joint's bind pose, 3 per
144
+ * particle.
101
145
  * @type {Float32Array}
102
146
  */
103
147
  rest_position = null;
104
148
 
105
149
  /**
106
- * Each joint's bind-pose local rotation, 4 per joint.
150
+ * Each particle's bind-pose orientation in the frame joint's bind pose, 4
151
+ * per particle.
107
152
  * @type {Float32Array}
108
153
  */
109
154
  rest_rotation = null;
110
155
 
111
156
  /**
112
- * Names, in {@link joint} order, then the anchor's last. Build-time
113
- * provenance; nothing on the step path reads it.
157
+ * Names, in particle order. Build-time provenance; nothing on the step path
158
+ * reads it.
114
159
  * @type {string[]}
115
160
  */
116
- joint_name = [];
161
+ particle_name = [];
117
162
 
118
163
  /**
119
- * @param {object} description
164
+ * @param {object} description every field but `name` and `particle_name` required
120
165
  * @param {string} [description.name]
121
166
  * @param {Int32Array|number[]} description.joint
122
- * @param {Int32Array|number[]} description.joint_parent
123
- * @param {number} description.anchor
167
+ * @param {Uint8Array|number[]} description.output
168
+ * @param {Int32Array|number[]} description.parent
169
+ * @param {Int32Array|number[]} description.edge
170
+ * @param {Int32Array|number[]} description.skip
171
+ * @param {Int32Array|number[]} description.hinge
172
+ * @param {Int32Array|number[]} description.triangle
173
+ * @param {number} description.frame
124
174
  * @param {Float32Array|number[]} description.rest_position
125
175
  * @param {Float32Array|number[]} description.rest_rotation
126
- * @param {string[]} [description.joint_name]
176
+ * @param {string[]} [description.particle_name]
127
177
  * @returns {ClothProxy}
128
178
  */
129
179
  static from({
130
180
  name = "",
131
181
  joint,
132
- joint_parent,
133
- anchor,
182
+ output,
183
+ parent,
184
+ edge,
185
+ skip,
186
+ hinge,
187
+ triangle,
188
+ frame,
134
189
  rest_position,
135
190
  rest_rotation,
136
- joint_name = []
191
+ particle_name = []
137
192
  }) {
138
- const joint_count = joint.length;
193
+ const particle_count = joint.length;
139
194
 
140
- assert.equal(joint_parent.length, joint_count, 'joint_parent.length');
141
- assert.equal(rest_position.length, joint_count * 3, 'rest_position.length');
142
- assert.equal(rest_rotation.length, joint_count * 4, 'rest_rotation.length');
143
- assert.isNonNegativeInteger(anchor, 'anchor');
195
+ assert.equal(output.length, particle_count, 'output.length');
196
+ assert.equal(parent.length, particle_count, 'parent.length');
197
+ assert.equal(rest_position.length, particle_count * 3, 'rest_position.length');
198
+ assert.equal(rest_rotation.length, particle_count * 4, 'rest_rotation.length');
199
+ assert.isNonNegativeInteger(frame, 'frame');
200
+ assert.equal(edge.length % 2, 0, 'edge.length is a whole number of pairs');
201
+ assert.equal(skip.length % 2, 0, 'skip.length is a whole number of pairs');
202
+ assert.equal(hinge.length % 4, 0, 'hinge.length is a whole number of quads');
203
+ assert.equal(triangle.length % 3, 0, 'triangle.length is a whole number of triples');
144
204
 
145
- for (let i = 0; i < joint_count; i++) {
146
- // Parents before children: the composition down the chain is one
205
+ for (let i = 0; i < particle_count; i++) {
206
+ // Parents before children: the composition down the forest is one
147
207
  // forward pass and there is nowhere for a cycle to hide.
148
208
  assert.ok(
149
- joint_parent[i] < i,
150
- `ClothProxy joint ${i} has parent ${joint_parent[i]}, which is not before it`
209
+ parent[i] < i,
210
+ `ClothProxy particle ${i} has parent ${parent[i]}, which is not before it`
151
211
  );
152
212
  }
153
213
 
154
214
  const r = new ClothProxy();
155
215
 
156
216
  r.name = name;
157
- r.joint_count = joint_count;
217
+ r.particle_count = particle_count;
158
218
  r.joint = Int32Array.from(joint);
159
- r.joint_parent = Int32Array.from(joint_parent);
160
- r.anchor = anchor;
219
+ r.output = Uint8Array.from(output);
220
+ r.parent = Int32Array.from(parent);
221
+ r.edge = Int32Array.from(edge);
222
+ r.skip = Int32Array.from(skip);
223
+ r.hinge = Int32Array.from(hinge);
224
+ r.triangle = Int32Array.from(triangle);
225
+ r.frame = frame;
161
226
  r.rest_position = Float32Array.from(rest_position);
162
227
  r.rest_rotation = Float32Array.from(rest_rotation);
163
- r.joint_name = joint_name.slice();
228
+ r.particle_name = particle_name.slice();
164
229
 
165
230
  return r;
166
231
  }
@@ -175,7 +240,7 @@ export class ClothProxy {
175
240
  * condition, and this is what turns it into a message naming the joint
176
241
  * instead of a garment simulating somebody's spine.
177
242
  *
178
- * @param {Skin} skin
243
+ * @param {{joints: ArrayLike<number>}} skin a `MeshSkin`, or anything with joints in the order the proxy indexes
179
244
  * @returns {string} empty when the proxy fits, otherwise what is wrong
180
245
  */
181
246
  checkAgainst(skin) {
@@ -185,14 +250,14 @@ export class ClothProxy {
185
250
 
186
251
  const count = skin.joints.length;
187
252
 
188
- if (this.anchor >= count) {
189
- return `${this.name}: anchor is joint ${this.anchor} of a skin with ${count}`;
253
+ if (this.frame >= count) {
254
+ return `${this.name}: frame is joint ${this.frame} of a skin with ${count}`;
190
255
  }
191
256
 
192
- for (let i = 0; i < this.joint_count; i++) {
257
+ for (let i = 0; i < this.particle_count; i++) {
193
258
  if (this.joint[i] >= count) {
194
- return `${this.name}: joint ${i} (${this.joint_name[i] ?? '?'})`
195
- + ` is index ${this.joint[i]} of a skin with ${count}`;
259
+ return `${this.name}: particle ${i} (${this.particle_name[i] ?? '?'})`
260
+ + ` is joint ${this.joint[i]} of a skin with ${count}`;
196
261
  }
197
262
  }
198
263
 
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @typedef {import("../../../graphics3/prefab/Prefab.js").Prefab} Prefab
3
+ */
4
+ /**
5
+ * Each node's bind pose relative to the frame node's, composed from the
6
+ * prefab's local rest poses down from the frame, `[tx, ty, tz, qx, qy, qz, qw]`.
7
+ * Every node asked about hangs below the frame.
8
+ *
9
+ * Both proxy builders bake their rest pose this way — in the frame joint's own
10
+ * bind pose — so that a re-seed reads what was authored rather than what the
11
+ * solver left on the joints.
12
+ *
13
+ * Rigid, as every pose cloth holds is: a local scale is not applied. That is
14
+ * not a convention this can opt out of alone — the write-back is rigid too,
15
+ * and the GPU applies a parent's scale on top of what cloth writes, so a
16
+ * scaled bake would draw a scaled link twice over. A builder refuses a rig
17
+ * where it would matter, with {@link cloth_bind_scaled_above}.
18
+ *
19
+ * @author Alex Goldring
20
+ * @copyright Company Named Limited (c) 2026
21
+ *
22
+ * @param {Prefab} prefab
23
+ * @param {number} frame
24
+ * @returns {function(number): Float64Array}
25
+ */
26
+ export function cloth_bind_in_frame(prefab: Prefab, frame: number): (arg0: number) => Float64Array;
27
+ /**
28
+ * The nearest node above `node`, up to and including the prefab's root, whose
29
+ * rest scale is not one; or -1.
30
+ *
31
+ * Cloth simulates and writes back rigid poses, and everything under a scaled
32
+ * node is drawn scaled: a link below one is simulated at its authored length and
33
+ * drawn at that times the scale, and a scale above the frame draws the whole
34
+ * garment at another size than the one its colliders meet. Measured, a 10 cm
35
+ * chain under a joint scaled by 2: simulated links 0.1, drawn 0.2. A node's own
36
+ * scale moves nothing cloth places, so it is not asked about.
37
+ *
38
+ * @param {Prefab} prefab
39
+ * @param {number} node
40
+ * @returns {number}
41
+ */
42
+ export function cloth_bind_scaled_above(prefab: Prefab, node: number): number;
43
+ export type Prefab = import("../../../graphics3/prefab/Prefab.js").Prefab;
44
+ //# sourceMappingURL=cloth_bind_in_frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloth_bind_in_frame.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/build/cloth_bind_in_frame.js"],"names":[],"mappings":"AAOA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,4CAJW,MAAM,SACN,MAAM,UACK,MAAM,KAAG,YAAY,CAqC1C;AASD;;;;;;;;;;;;;;GAcG;AACH,gDAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAgBlB;qBAlGY,OAAO,qCAAqC,EAAE,MAAM"}