@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
@@ -17,6 +17,8 @@
17
17
  * to synthesise some arbitrary unit vector and hand it over as though it were a
18
18
  * measurement.
19
19
  *
20
+ * An indexed form of {@link tri3_compute_normal_area_weighted_array}, which holds the arithmetic.
21
+ *
20
22
  * Single-face callers — a raycast normal, a plane side test — want
21
23
  * {@link geometry_construct_triangle_normal} instead.
22
24
  *
@@ -1 +1 @@
1
- {"version":3,"file":"geometry_construct_triangle_normal_area_weighted.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,sEARW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,cAClC,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,aACN,MAAM,EAAE,GAAC,YAAY,GACnB,IAAI,CAwBhB"}
1
+ {"version":3,"file":"geometry_construct_triangle_normal_area_weighted.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,sEARW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,cAClC,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,aACN,MAAM,EAAE,GAAC,YAAY,GACnB,IAAI,CAShB"}
@@ -1,3 +1,5 @@
1
+ import { tri3_compute_normal_area_weighted_array } from "../../../core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.js";
2
+
1
3
  /**
2
4
  * The face normal of an indexed triangle, NOT normalised — the raw
3
5
  * `(c - b) × (a - b)`, whose magnitude is twice the triangle's area.
@@ -17,6 +19,8 @@
17
19
  * to synthesise some arbitrary unit vector and hand it over as though it were a
18
20
  * measurement.
19
21
  *
22
+ * An indexed form of {@link tri3_compute_normal_area_weighted_array}, which holds the arithmetic.
23
+ *
20
24
  * Single-face callers — a raycast normal, a plane side test — want
21
25
  * {@link geometry_construct_triangle_normal} instead.
22
26
  *
@@ -29,25 +33,10 @@
29
33
  * @returns {void}
30
34
  */
31
35
  export function geometry_construct_triangle_normal_area_weighted(out, out_offset, a, b, c, positions) {
32
-
33
- const a_address = a * 3;
34
- const b_address = b * 3;
35
- const c_address = c * 3;
36
-
37
- const bx = positions[b_address];
38
- const by = positions[b_address + 1];
39
- const bz = positions[b_address + 2];
40
-
41
- const cb_x = positions[c_address] - bx;
42
- const cb_y = positions[c_address + 1] - by;
43
- const cb_z = positions[c_address + 2] - bz;
44
-
45
- const ab_x = positions[a_address] - bx;
46
- const ab_y = positions[a_address + 1] - by;
47
- const ab_z = positions[a_address + 2] - bz;
48
-
49
- // the same winding `tri3_compute_normal` uses, so the direction agrees
50
- out[out_offset] = cb_y * ab_z - cb_z * ab_y;
51
- out[out_offset + 1] = cb_z * ab_x - cb_x * ab_z;
52
- out[out_offset + 2] = cb_x * ab_y - cb_y * ab_x;
36
+ tri3_compute_normal_area_weighted_array(
37
+ out, out_offset,
38
+ positions, a * 3,
39
+ positions, b * 3,
40
+ positions, c * 3
41
+ );
53
42
  }
@@ -2,6 +2,14 @@
2
2
  * Drives every entity's {@link AnimationGraphController}: runs its clock, and tells the renderer
3
3
  * what its clips weigh and where they are playing.
4
4
  *
5
+ * **The clips are the entity's {@link AnimationClips}.** An entity is driven while it carries both
6
+ * components, whoever put them there — a model `MeshSystem` loaded, or a rig built in code. New
7
+ * clips are a new component, which this system sees as the entity leaving and coming back.
8
+ *
9
+ * **Every node the clips key holds a row here** ({@link hold_clip_targets}), from the graph being
10
+ * bound to the clips until they go. A clip binds only once all of them do, and a keyed node outside
11
+ * every skin with nothing drawn under it — a socket, say — is held by no other system.
12
+ *
5
13
  * **It is the CPU that plays the animation and the GPU that draws it.** Shade can advance a clip
6
14
  * itself, and this never asks it to — `AnimationClipFlags.Playing` is left clear and every audible
7
15
  * clip's time is written down each frame from the controller's own clock. That is I-4: the pose
@@ -10,33 +18,38 @@
10
18
  *
11
19
  * **Nothing here is culled.** The legacy system skipped entities smaller than 32 px², which let
12
20
  * camera framing decide whether a footstep effect or an ability release ever happened. The clock and
13
- * its notifications are gameplay and run for every entity whose model has arrived; what may be
21
+ * its notifications are gameplay and run for every entity whose clips have arrived; what may be
14
22
  * culled is drawing, and drawing is Shade's to cull.
15
23
  */
16
24
  export class AnimationGraphSystem extends System<any> {
17
25
  /**
18
26
  * @param {GraphicsEngine} graphics
19
- * @param {MeshSystem} meshes
27
+ * @param {Scene} scene
20
28
  */
21
- constructor(graphics: GraphicsEngine, meshes: MeshSystem);
22
- dependencies: (typeof SGMesh | typeof AnimationGraphController)[];
29
+ constructor(graphics: GraphicsEngine, scene: Scene);
30
+ dependencies: (typeof AnimationGraphController | typeof AnimationClips)[];
23
31
  components_used: ResourceAccessSpecification<typeof AnimationGraphController>[];
24
32
  /**
33
+ * Only noted here: the graph is bound to the clips by the next {@link update}. A link can happen
34
+ * anywhere the components are added — inside a model's spawn, for one `MeshSystem` loads — and a
35
+ * graph naming a clip the entity has not got throws, which belongs in this system's tick and not
36
+ * in whoever added the component.
37
+ *
25
38
  * @param {AnimationGraphController} controller
26
- * @param {SGMesh} model
39
+ * @param {AnimationClips} clips
27
40
  * @param {number} entity
28
41
  */
29
- link(controller: AnimationGraphController, model: SGMesh, entity: number): void;
42
+ link(controller: AnimationGraphController, clips: AnimationClips, entity: number): void;
30
43
  /**
31
- * What the entity's model is playing, in the form the CPU pose evaluator takes: one entry per
32
- * clip **this graph names**, at the weight and the time the renderer has been given.
44
+ * What the entity is playing, in the form the CPU pose evaluator takes: one entry per clip
45
+ * **this graph names**, at the weight and the time the renderer has been given.
33
46
  *
34
47
  * **The clips the graph does not name are not here, because they are not registered** (D37).
35
48
  * The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
36
49
  * all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
37
50
  * leaving them at rest. The answer is not to hand those clips to the evaluator so it can make
38
51
  * the same mistake; it is not to bind them. What the graph never names, nothing plays, and the
39
- * joints it alone would have driven stay where the model rests.
52
+ * joints it alone would have driven stay where they rest.
40
53
  *
41
54
  * A clip the graph names but is not currently playing **is** here, at weight zero, because it is
42
55
  * bound and the accumulator does see it.
@@ -47,21 +60,23 @@ export class AnimationGraphSystem extends System<any> {
47
60
  * @param {PosePlayback[]} target appended to
48
61
  * @param {number} entity
49
62
  * @returns {boolean} whether this system is driving the entity — `false` for one with no
50
- * {@link AnimationGraphController}, and for one whose model has not arrived
63
+ * {@link AnimationGraphController} or no {@link AnimationClips}, and for one whose clips arrived
64
+ * since the last update
51
65
  */
52
66
  write_pose_playbacks(target: PosePlayback[], entity: number): boolean;
53
67
  /**
54
68
  * @param {AnimationGraphController} controller
55
- * @param {SGMesh} model
69
+ * @param {AnimationClips} clips
56
70
  * @param {number} entity
57
71
  */
58
- unlink(controller: AnimationGraphController, model: SGMesh, entity: number): void;
72
+ unlink(controller: AnimationGraphController, clips: AnimationClips, entity: number): void;
73
+ startup(entityManager: any): Promise<void>;
59
74
  shutdown(entityManager: any): Promise<void>;
60
75
  #private;
61
76
  }
62
77
  import { System } from "../ecs/System.js";
63
- import { SGMesh } from "../graphics/ecs/mesh-v2/aggregate/SGMesh.js";
64
78
  import { AnimationGraphController } from "./animation/AnimationGraphController.js";
79
+ import { AnimationClips } from "./animation/AnimationClips.js";
65
80
  import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
66
81
  import { PosePlayback } from "../../shade/renderer/animation/pose/PosePlayback.js";
67
82
  //# sourceMappingURL=AnimationGraphSystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnimationGraphSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/AnimationGraphSystem.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;GAcG;AACH;IAmBI;;;OAGG;IACH,0DAgBC;IAPG,kEAAsD;IAItD,gFAEC;IAGL;;;;OAIG;IACH,iBAJW,wBAAwB,SACxB,MAAM,UACN,MAAM,QAahB;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,6BALW,YAAY,EAAE,UACd,MAAM,GACJ,OAAO,CA+CnB;IAED;;;;OAIG;IACH,mBAJW,wBAAwB,SACxB,MAAM,UACN,MAAM,QAYhB;IAED,4CAQC;;CA4JJ;uBA5UsB,kBAAkB;uBAClB,6CAA6C;yCAC3B,yCAAyC;4CAJtC,iDAAiD;6BAChE,qDAAqD"}
1
+ {"version":3,"file":"AnimationGraphSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/AnimationGraphSystem.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAyBI;;;OAGG;IACH,oDAgBC;IAPG,0EAA8D;IAI9D,gFAEC;IAGL;;;;;;;;;OASG;IACH,iBAJW,wBAAwB,SACxB,cAAc,UACd,MAAM,QAehB;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,6BANW,YAAY,EAAE,UACd,MAAM,GACJ,OAAO,CAgDnB;IAED;;;;OAIG;IACH,mBAJW,wBAAwB,SACxB,cAAc,UACd,MAAM,QAkBhB;IAED,2CAaC;IAED,4CAWC;;CA2JJ;uBAvXsB,kBAAkB;yCAEA,yCAAyC;+BADnD,+BAA+B;4CAHlB,iDAAiD;6BAChE,qDAAqD"}
@@ -3,18 +3,24 @@ import { ResourceAccessKind } from "../../core/model/ResourceAccessKind.js";
3
3
  import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
4
4
  import { PosePlayback } from "../../shade/renderer/animation/pose/PosePlayback.js";
5
5
  import { System } from "../ecs/System.js";
6
- import { SGMesh } from "../graphics/ecs/mesh-v2/aggregate/SGMesh.js";
6
+ import { AnimationClips } from "./animation/AnimationClips.js";
7
7
  import { AnimationGraphController } from "./animation/AnimationGraphController.js";
8
8
  import { write_graph_playback } from "./animation/write_graph_playback.js";
9
- import {
10
- register_instance_clips,
11
- unregister_instance_clips
12
- } from "./register_instance_animation.js";
9
+ import { hold_clip_targets, register_clips, release_clip_targets, unregister_clips } from "./register_clips.js";
10
+ import { RowChains } from "./RowChains.js";
13
11
 
14
12
  /**
15
13
  * Drives every entity's {@link AnimationGraphController}: runs its clock, and tells the renderer
16
14
  * what its clips weigh and where they are playing.
17
15
  *
16
+ * **The clips are the entity's {@link AnimationClips}.** An entity is driven while it carries both
17
+ * components, whoever put them there — a model `MeshSystem` loaded, or a rig built in code. New
18
+ * clips are a new component, which this system sees as the entity leaving and coming back.
19
+ *
20
+ * **Every node the clips key holds a row here** ({@link hold_clip_targets}), from the graph being
21
+ * bound to the clips until they go. A clip binds only once all of them do, and a keyed node outside
22
+ * every skin with nothing drawn under it — a socket, say — is held by no other system.
23
+ *
18
24
  * **It is the CPU that plays the animation and the GPU that draws it.** Shade can advance a clip
19
25
  * itself, and this never asks it to — `AnimationClipFlags.Playing` is left clear and every audible
20
26
  * clip's time is written down each frame from the controller's own clock. That is I-4: the pose
@@ -23,7 +29,7 @@ import {
23
29
  *
24
30
  * **Nothing here is culled.** The legacy system skipped entities smaller than 32 px², which let
25
31
  * camera framing decide whether a footstep effect or an ability release ever happened. The clock and
26
- * its notifications are gameplay and run for every entity whose model has arrived; what may be
32
+ * its notifications are gameplay and run for every entity whose clips have arrived; what may be
27
33
  * culled is drawing, and drawing is Shade's to cull.
28
34
  */
29
35
  export class AnimationGraphSystem extends System {
@@ -33,32 +39,38 @@ export class AnimationGraphSystem extends System {
33
39
  #graphics;
34
40
 
35
41
  /**
36
- * The system that owns the scene, the model instances, and the ids the animation manager issued
37
- * for them.
42
+ * The scene whose GPU context issues the clip ids.
38
43
  *
39
- * @type {MeshSystem}
44
+ * @type {Scene}
40
45
  */
41
- #meshes;
46
+ #scene;
42
47
 
43
48
  /**
44
- * @type {Map<number, {controller: AnimationGraphController, instance: PrefabInstance|null, clip_registration: InstanceClipRegistration|null, slots: Int32Array, played_slots: Int32Array, clip_ids: Int32Array, weights: Float32Array, poses: PosePlayback[]}>}
49
+ * @type {Map<number, {controller: AnimationGraphController, clips: ShadeAnimationClip[], bound: boolean, held: boolean, clip_registration: ClipRegistration|null, slots: Int32Array, played_slots: Int32Array, clip_ids: Int32Array, weights: Float32Array, poses: PosePlayback[]}>}
45
50
  */
46
51
  #entries = new Map();
47
52
 
53
+ /**
54
+ * The chains of the nodes the clips key. Null until the system has a dataset.
55
+ *
56
+ * @type {RowChains|null}
57
+ */
58
+ #chains = null;
59
+
48
60
  /**
49
61
  * @param {GraphicsEngine} graphics
50
- * @param {MeshSystem} meshes
62
+ * @param {Scene} scene
51
63
  */
52
- constructor(graphics, meshes) {
64
+ constructor(graphics, scene) {
53
65
  super();
54
66
 
55
67
  assert.defined(graphics, 'graphics');
56
- assert.defined(meshes, 'meshes');
68
+ assert.equal(scene?.isScene, true, 'scene.isScene !== true');
57
69
 
58
70
  this.#graphics = graphics;
59
- this.#meshes = meshes;
71
+ this.#scene = scene;
60
72
 
61
- this.dependencies = [AnimationGraphController, SGMesh];
73
+ this.dependencies = [AnimationGraphController, AnimationClips];
62
74
 
63
75
  // this tick's clip times are this system's to set: whatever evaluates a pose from them
64
76
  // (exact queries, IK's base pose) reads AnimationGraphController and so runs after it
@@ -68,14 +80,21 @@ export class AnimationGraphSystem extends System {
68
80
  }
69
81
 
70
82
  /**
83
+ * Only noted here: the graph is bound to the clips by the next {@link update}. A link can happen
84
+ * anywhere the components are added — inside a model's spawn, for one `MeshSystem` loads — and a
85
+ * graph naming a clip the entity has not got throws, which belongs in this system's tick and not
86
+ * in whoever added the component.
87
+ *
71
88
  * @param {AnimationGraphController} controller
72
- * @param {SGMesh} model
89
+ * @param {AnimationClips} clips
73
90
  * @param {number} entity
74
91
  */
75
- link(controller, model, entity) {
92
+ link(controller, clips, entity) {
76
93
  this.#entries.set(entity, {
77
94
  controller,
78
- instance: null,
95
+ clips: clips.clips,
96
+ bound: false,
97
+ held: false,
79
98
  clip_registration: null,
80
99
  slots: new Int32Array(0),
81
100
  played_slots: new Int32Array(0),
@@ -86,15 +105,15 @@ export class AnimationGraphSystem extends System {
86
105
  }
87
106
 
88
107
  /**
89
- * What the entity's model is playing, in the form the CPU pose evaluator takes: one entry per
90
- * clip **this graph names**, at the weight and the time the renderer has been given.
108
+ * What the entity is playing, in the form the CPU pose evaluator takes: one entry per clip
109
+ * **this graph names**, at the weight and the time the renderer has been given.
91
110
  *
92
111
  * **The clips the graph does not name are not here, because they are not registered** (D37).
93
112
  * The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
94
113
  * all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
95
114
  * leaving them at rest. The answer is not to hand those clips to the evaluator so it can make
96
115
  * the same mistake; it is not to bind them. What the graph never names, nothing plays, and the
97
- * joints it alone would have driven stay where the model rests.
116
+ * joints it alone would have driven stay where they rest.
98
117
  *
99
118
  * A clip the graph names but is not currently playing **is** here, at weight zero, because it is
100
119
  * bound and the accumulator does see it.
@@ -105,16 +124,17 @@ export class AnimationGraphSystem extends System {
105
124
  * @param {PosePlayback[]} target appended to
106
125
  * @param {number} entity
107
126
  * @returns {boolean} whether this system is driving the entity — `false` for one with no
108
- * {@link AnimationGraphController}, and for one whose model has not arrived
127
+ * {@link AnimationGraphController} or no {@link AnimationClips}, and for one whose clips arrived
128
+ * since the last update
109
129
  */
110
130
  write_pose_playbacks(target, entity) {
111
131
  const entry = this.#entries.get(entity);
112
132
 
113
- if (entry === undefined || entry.instance === null) {
133
+ if (entry === undefined || !entry.bound) {
114
134
  return false;
115
135
  }
116
136
 
117
- const clips = entry.instance.clips;
137
+ const clips = entry.clips;
118
138
  const poses = entry.poses;
119
139
  const played = entry.played_slots;
120
140
 
@@ -136,7 +156,7 @@ export class AnimationGraphSystem extends System {
136
156
  const weight = weights[i];
137
157
 
138
158
  // assignment rather than accumulation, and it matters only where two of the graph's
139
- // clips are one clip of the model: the renderer is written to in this order too, so the
159
+ // clips are one clip of the entity: the renderer is written to in this order too, so the
140
160
  // last of them is what it holds
141
161
  pose.weight = weight;
142
162
 
@@ -155,21 +175,42 @@ export class AnimationGraphSystem extends System {
155
175
 
156
176
  /**
157
177
  * @param {AnimationGraphController} controller
158
- * @param {SGMesh} model
178
+ * @param {AnimationClips} clips
159
179
  * @param {number} entity
160
180
  */
161
- unlink(controller, model, entity) {
181
+ unlink(controller, clips, entity) {
162
182
  controller.unlink();
163
183
 
164
184
  const entry = this.#entries.get(entity);
165
185
 
166
186
  if (entry !== undefined) {
167
187
  this.#release_clips(entry);
188
+
189
+ if (entry.held) {
190
+ release_clip_targets(this.#chains, entry.clips);
191
+
192
+ entry.held = false;
193
+ }
168
194
  }
169
195
 
170
196
  this.#entries.delete(entity);
171
197
  }
172
198
 
199
+ async startup(entityManager) {
200
+ // the scene's rows are this dataset's entities; the first system to place one says so
201
+ const dataset = entityManager.dataset;
202
+ const scene = this.#scene;
203
+
204
+ assert.ok(
205
+ scene.dataset === null || scene.dataset === undefined || scene.dataset === dataset,
206
+ 'the scene is bound to another dataset'
207
+ );
208
+
209
+ scene.dataset = dataset;
210
+
211
+ this.#chains = new RowChains(dataset);
212
+ }
213
+
173
214
  async shutdown(entityManager) {
174
215
  for (const entry of this.#entries.values()) {
175
216
  entry.controller.unlink();
@@ -178,6 +219,9 @@ export class AnimationGraphSystem extends System {
178
219
  }
179
220
 
180
221
  this.#entries.clear();
222
+
223
+ this.#chains.destroy();
224
+ this.#chains = null;
181
225
  }
182
226
 
183
227
  /**
@@ -186,7 +230,7 @@ export class AnimationGraphSystem extends System {
186
230
  * **An id may only be handed back to the manager that issued it.** A renderer restart replaces
187
231
  * the GPU scene context and voids every id it gave out, so a registration stamped with a context
188
232
  * that is no longer current is forgotten rather than returned — returning it would corrupt a
189
- * stranger's table. Same rule as {@link unregister_instance_animation}, same `===`.
233
+ * stranger's table. Same rule as {@link unregister_clips}, same `===`.
190
234
  *
191
235
  * @param {object} entry
192
236
  */
@@ -197,8 +241,8 @@ export class AnimationGraphSystem extends System {
197
241
  return;
198
242
  }
199
243
 
200
- if (registration.context === this.#graphics.scene_context(this.#meshes.scene)) {
201
- unregister_instance_clips(registration);
244
+ if (registration.context === this.#graphics.scene_context(this.#scene)) {
245
+ unregister_clips(registration);
202
246
  }
203
247
 
204
248
  entry.clip_registration = null;
@@ -210,22 +254,18 @@ export class AnimationGraphSystem extends System {
210
254
  update(time_delta_seconds) {
211
255
  const ecd = this.entityManager.dataset;
212
256
 
213
- const context = this.#graphics.scene_context(this.#meshes.scene);
257
+ const context = this.#graphics.scene_context(this.#scene);
214
258
 
215
259
  // No device — before the first start, and again after a stop. The clocks still run: a unit
216
260
  // that fires an ability while the renderer is being replaced still fires it.
217
261
  const manager = context === null ? null : context.animation_manager;
218
262
 
219
- for (const [entity, entry] of this.#entries) {
220
- const instance = this.#meshes.instance_of(entity);
221
-
222
- if (instance === null) {
223
- // the model has not arrived, and its clips are what say how long they run
224
- continue;
225
- }
263
+ // a new context after a restart is acquired in whole; until there is one, holds are recorded
264
+ this.#chains.bind(context === null ? null : context.rows);
226
265
 
227
- if (instance !== entry.instance) {
228
- this.#bind_model(entry, entity, instance, ecd);
266
+ for (const [entity, entry] of this.#entries) {
267
+ if (!entry.bound) {
268
+ this.#bind_clips(entry, entity, ecd);
229
269
  }
230
270
 
231
271
  entry.controller.tick(time_delta_seconds);
@@ -240,7 +280,7 @@ export class AnimationGraphSystem extends System {
240
280
  noticed — in one comparison, without depending on when anything last ran.
241
281
  */
242
282
  if (entry.clip_registration === null || entry.clip_registration.context !== context) {
243
- this.#bind_gpu(entry, instance, context);
283
+ this.#bind_gpu(entry, context);
244
284
  }
245
285
 
246
286
  write_graph_playback(manager, entry.controller, entry.clip_ids, entry.weights);
@@ -248,15 +288,16 @@ export class AnimationGraphSystem extends System {
248
288
  }
249
289
 
250
290
  /**
251
- * Bind the graph to a model: work out which of the model's clips each of the graph's clips is,
252
- * how long each of them runs, and start the graph on that.
291
+ * Bind the graph to the entity's clips: work out which of them each of the graph's clips is, how
292
+ * long each of them runs, and start the graph on that.
253
293
  *
254
294
  * @param {object} entry
255
295
  * @param {number} entity
256
- * @param {PrefabInstance} instance
257
296
  * @param {EntityComponentDataset} ecd
258
297
  */
259
- #bind_model(entry, entity, instance, ecd) {
298
+ #bind_clips(entry, entity, ecd) {
299
+ const clips = entry.clips;
300
+
260
301
  const clip_index = entry.controller.def.clipIndex;
261
302
  const clip_count = clip_index.length;
262
303
 
@@ -266,26 +307,25 @@ export class AnimationGraphSystem extends System {
266
307
  for (let i = 0; i < clip_count; i++) {
267
308
  const name = clip_index[i].name;
268
309
 
269
- const slot = instance.clips.findIndex(clip => clip.name === name);
310
+ const slot = clips.findIndex(clip => clip.name === name);
270
311
 
271
312
  if (slot === -1) {
272
- throw new Error(`Animation clip '${name}' is not in the model`);
313
+ throw new Error(`Animation clip '${name}' is not among the clips of entity ${entity}`);
273
314
  }
274
315
 
275
316
  slots[i] = slot;
276
- durations[i] = instance.clips[slot].duration;
317
+ durations[i] = clips[slot].duration;
277
318
  }
278
319
 
279
320
  entry.controller.unlink();
280
321
  entry.controller.link(entity, ecd, durations);
281
322
 
282
- entry.instance = instance;
283
323
  entry.slots = slots;
284
324
 
285
325
  /*
286
- The distinct clips of the model this graph plays. Two states can name one clip — an idle a
287
- hurt returns to, say — and it is one row on the GPU either way, so it is one entry here:
288
- registered once, reported to the pose evaluator once.
326
+ The distinct clips this graph plays. Two states can name one clip — an idle a hurt returns
327
+ to, say — and it is one row on the GPU either way, so it is one entry here: registered once,
328
+ reported to the pose evaluator once.
289
329
  */
290
330
  const played = [];
291
331
 
@@ -299,28 +339,31 @@ export class AnimationGraphSystem extends System {
299
339
 
300
340
  entry.clip_ids = new Int32Array(clip_count);
301
341
  entry.weights = new Float32Array(clip_count).fill(-1);
302
- entry.poses = instance.clips.map(() => new PosePlayback());
342
+ entry.poses = clips.map(() => new PosePlayback());
343
+
344
+ entry.bound = true;
345
+
346
+ // past the throw above, so a graph that cannot be bound holds nothing; and before anything
347
+ // registers, so the clips bind in the update that registers them
348
+ hold_clip_targets(this.#chains, clips);
303
349
 
304
- // ids the manager issued for the model that was here before name clips this one does not
305
- // have
306
- this.#release_clips(entry);
350
+ entry.held = true;
307
351
  }
308
352
 
309
353
  /**
310
354
  * Make this graph's clips playable, and take up the ids that come back.
311
355
  *
312
356
  * **Only the clips the graph names are registered** (D37), so there is nothing to silence: a
313
- * clip of the model no state plays is never bound, never marks a joint, and leaves the joints
314
- * only it would have driven at rest. What this used to do instead — register everything and then
315
- * write a zero weight over the surplus — kept them bound, and a bound clip at weight zero
316
- * resolves its joints to zero rather than to the model's own pose.
357
+ * clip no state plays is never bound, never marks a joint, and leaves the joints only it would
358
+ * have driven at rest. What this used to do instead — register everything and then write a zero
359
+ * weight over the surplus — kept them bound, and a bound clip at weight zero resolves its joints
360
+ * to zero rather than to the rig's own pose.
317
361
  *
318
362
  * @param {object} entry
319
- * @param {PrefabInstance} instance
320
363
  * @param {GPUSceneContext} context
321
364
  */
322
- #bind_gpu(entry, instance, context) {
323
- const registration = register_instance_clips(context, instance, entry.played_slots);
365
+ #bind_gpu(entry, context) {
366
+ const registration = register_clips(context, entry.clips, entry.played_slots);
324
367
 
325
368
  const slots = entry.slots;
326
369
  const clip_ids = entry.clip_ids;
@@ -4,9 +4,17 @@
4
4
  *
5
5
  * The list path is what the game uses wherever there is no state machine — buildings, critters and
6
6
  * the strategy map's groups — and {@link ClipListPlayer} is what plays it. This is the ECS half:
7
- * which entity has which model, and when the ids the renderer issued for it stopped meaning
7
+ * which clips each entity has, and when the ids the renderer issued for them stopped meaning
8
8
  * anything.
9
9
  *
10
+ * **The clips are the entity's {@link AnimationClips}.** An entity is driven while it carries both
11
+ * components, whoever put them there — a model `MeshSystem` loaded, or a rig built in code. New
12
+ * clips are a new component, which this system sees as the entity leaving and coming back.
13
+ *
14
+ * **Every node the clips key holds a row here** ({@link hold_clip_targets}), from the clips being
15
+ * taken up until they go. A clip binds only once all of them do, and a keyed node outside every skin
16
+ * with nothing drawn under it is held by no other system.
17
+ *
10
18
  * **It is the CPU that plays the animation and the GPU that draws it.** Shade can advance a clip
11
19
  * itself, and this never asks it to — `AnimationClipFlags.Playing` is left clear and every audible
12
20
  * clip's time is written down each frame from the player's own clock. That is I-4: the pose
@@ -20,31 +28,31 @@
20
28
  export class AnimationSystem extends System<any> {
21
29
  /**
22
30
  * @param {GraphicsEngine} graphics
23
- * @param {MeshSystem} meshes
31
+ * @param {Scene} scene
24
32
  */
25
- constructor(graphics: GraphicsEngine, meshes: MeshSystem);
26
- dependencies: (typeof SGMesh | typeof Animation)[];
33
+ constructor(graphics: GraphicsEngine, scene: Scene);
34
+ dependencies: (typeof Animation | typeof AnimationClips)[];
27
35
  components_used: ResourceAccessSpecification<typeof Animation>[];
28
36
  /**
29
37
  * What an entity is playing, and where each of them is.
30
38
  *
31
39
  * One entry per clip in the component's list, in the list's own order. Empty for an entity this
32
- * system is not driving — one that has left, or one whose model has not arrived, which is the
33
- * same wait the clip durations are on.
40
+ * system is not driving — one that has left, or one whose clips arrived since the last update.
34
41
  *
35
42
  * @param {number} entity
36
43
  * @returns {ClipPlayback[]}
37
44
  */
38
45
  playbacks_of(entity: number): ClipPlayback[];
39
46
  /**
40
- * What the entity's model is playing, in the form the CPU pose evaluator takes: one entry per
41
- * clip the model carries, at the weight and the time the renderer has been given.
47
+ * What the entity is playing, in the form the CPU pose evaluator takes: one entry per clip of its
48
+ * {@link AnimationClips} that the list names, at the weight and the time the renderer has been
49
+ * given.
42
50
  *
43
51
  * **Only the clips the list names are here, because they are the only ones registered** (D37).
44
52
  * The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
45
53
  * all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
46
54
  * leaving them at rest. The answer is not to hand the surplus to the evaluator so it agrees with
47
- * a mistake; it is not to bind them, and then a clip of the model nothing names moves nothing.
55
+ * a mistake; it is not to bind them, and then a clip nothing names moves nothing.
48
56
  *
49
57
  * The entries are this system's own and are rewritten by the next call, which is what keeps a
50
58
  * query on a per-frame path from allocating.
@@ -52,27 +60,33 @@ export class AnimationSystem extends System<any> {
52
60
  * @param {PosePlayback[]} target appended to
53
61
  * @param {number} entity
54
62
  * @returns {boolean} whether this system is driving the entity — `false` for one with no
55
- * {@link Animation}, and for one whose model has not arrived
63
+ * {@link Animation} or no {@link AnimationClips}, and for one whose clips arrived since the last
64
+ * update
56
65
  */
57
66
  write_pose_playbacks(target: PosePlayback[], entity: number): boolean;
58
67
  /**
68
+ * Only noted here: the clips are taken up by the next {@link update}. A link can happen anywhere
69
+ * the components are added — inside a model's spawn, for one `MeshSystem` loads — and binding is
70
+ * this system's work, on its own tick.
71
+ *
59
72
  * @param {Animation} component
60
- * @param {SGMesh} model
73
+ * @param {AnimationClips} clips
61
74
  * @param {number} entity
62
75
  */
63
- link(component: Animation, model: SGMesh, entity: number): void;
76
+ link(component: Animation, clips: AnimationClips, entity: number): void;
64
77
  /**
65
78
  * @param {Animation} component
66
- * @param {SGMesh} model
79
+ * @param {AnimationClips} clips
67
80
  * @param {number} entity
68
81
  */
69
- unlink(component: Animation, model: SGMesh, entity: number): void;
82
+ unlink(component: Animation, clips: AnimationClips, entity: number): void;
83
+ startup(entityManager: any): Promise<void>;
70
84
  shutdown(entityManager: any): Promise<void>;
71
85
  #private;
72
86
  }
73
87
  import { System } from "../ecs/System.js";
74
- import { SGMesh } from "../graphics/ecs/mesh-v2/aggregate/SGMesh.js";
75
88
  import { Animation } from "../ecs/animation/Animation.js";
89
+ import { AnimationClips } from "./animation/AnimationClips.js";
76
90
  import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
77
91
  import { PosePlayback } from "../../shade/renderer/animation/pose/PosePlayback.js";
78
92
  //# sourceMappingURL=AnimationSystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/AnimationSystem.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAmBI;;;OAGG;IACH,0DAgBC;IAPG,mDAAuC;IAIvC,iEAEC;IAGL;;;;;;;;;OASG;IACH,qBAHW,MAAM,GACJ,cAAc,CAU1B;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,6BALW,YAAY,EAAE,UACd,MAAM,GACJ,OAAO,CAwCnB;IAED;;;;OAIG;IACH,gBAJW,SAAS,SACT,MAAM,UACN,MAAM,QAWhB;IAED;;;;OAIG;IACH,kBAJW,SAAS,SACT,MAAM,UACN,MAAM,QAUhB;IAED,4CAMC;;CAsKJ;uBAlWsB,kBAAkB;uBAClB,6CAA6C;0BAF1C,+BAA+B;4CAFb,iDAAiD;6BAChE,qDAAqD"}
1
+ {"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/AnimationSystem.js"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAyBI;;;OAGG;IACH,oDAgBC;IAPG,2DAA+C;IAI/C,iEAEC;IAGL;;;;;;;;OAQG;IACH,qBAHW,MAAM,GACJ,cAAc,CAU1B;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,6BANW,YAAY,EAAE,UACd,MAAM,GACJ,OAAO,CAyCnB;IAED;;;;;;;;OAQG;IACH,gBAJW,SAAS,SACT,cAAc,UACd,MAAM,QAahB;IAED;;;;OAIG;IACH,kBAJW,SAAS,SACT,cAAc,UACd,MAAM,QAgBhB;IAED,2CAaC;IAED,4CASC;;CA8KJ;uBArZsB,kBAAkB;0BADf,+BAA+B;+BAE1B,+BAA+B;4CAJlB,iDAAiD;6BAChE,qDAAqD"}