@woosh/meep-engine 3.42.0 → 3.44.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 (345) hide show
  1. package/editor/prototypeEditorShell.d.ts.map +1 -1
  2. package/editor/prototypeEditorShell.js +4 -2
  3. package/package.json +91 -96
  4. package/src/engine/Clock.d.ts +15 -0
  5. package/src/engine/Clock.d.ts.map +1 -1
  6. package/src/engine/Clock.js +29 -5
  7. package/src/engine/Engine.d.ts.map +1 -1
  8. package/src/engine/Engine.js +11 -19
  9. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts +57 -0
  10. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts.map +1 -0
  11. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.js +84 -0
  12. package/src/engine/graphics3/AnimationGraphSystem.d.ts +23 -13
  13. package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
  14. package/src/engine/graphics3/AnimationGraphSystem.js +61 -64
  15. package/src/engine/graphics3/AnimationSystem.d.ts +24 -15
  16. package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
  17. package/src/engine/graphics3/AnimationSystem.js +67 -61
  18. package/src/engine/graphics3/MeshSkinSystem.d.ts +56 -0
  19. package/src/engine/graphics3/MeshSkinSystem.d.ts.map +1 -0
  20. package/src/engine/graphics3/MeshSkinSystem.js +317 -0
  21. package/src/engine/graphics3/MeshSystem.d.ts +15 -35
  22. package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
  23. package/src/engine/graphics3/MeshSystem.js +21 -298
  24. package/src/engine/graphics3/RowChains.d.ts +76 -0
  25. package/src/engine/graphics3/RowChains.d.ts.map +1 -0
  26. package/src/engine/graphics3/RowChains.js +347 -0
  27. package/src/engine/graphics3/ShadedGeometrySystem.d.ts +6 -0
  28. package/src/engine/graphics3/ShadedGeometrySystem.d.ts.map +1 -1
  29. package/src/engine/graphics3/ShadedGeometrySystem.js +329 -309
  30. package/src/engine/graphics3/animation/AnimationClips.d.ts +56 -0
  31. package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -0
  32. package/src/engine/graphics3/animation/AnimationClips.js +79 -0
  33. package/src/engine/graphics3/animation/ClipListPlayer.d.ts +13 -14
  34. package/src/engine/graphics3/animation/ClipListPlayer.d.ts.map +1 -1
  35. package/src/engine/graphics3/animation/ClipListPlayer.js +262 -263
  36. package/src/engine/graphics3/animation/write_clip_playback.d.ts +3 -3
  37. package/src/engine/graphics3/animation/write_clip_playback.js +4 -4
  38. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts +5 -0
  39. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts.map +1 -1
  40. package/src/engine/graphics3/pose/query_entity_node_world_pose.js +80 -75
  41. package/src/engine/graphics3/prefab/PrefabInstance.d.ts +4 -24
  42. package/src/engine/graphics3/prefab/PrefabInstance.d.ts.map +1 -1
  43. package/src/engine/graphics3/prefab/PrefabInstance.js +60 -80
  44. package/src/engine/graphics3/prefab/prefab_instantiate.d.ts +16 -3
  45. package/src/engine/graphics3/prefab/prefab_instantiate.d.ts.map +1 -1
  46. package/src/engine/graphics3/prefab/prefab_instantiate.js +49 -12
  47. package/src/engine/graphics3/prefab/prefab_place.d.ts +31 -17
  48. package/src/engine/graphics3/prefab/prefab_place.d.ts.map +1 -1
  49. package/src/engine/graphics3/prefab/prefab_place.js +175 -130
  50. package/src/engine/graphics3/register_clips.d.ts +64 -0
  51. package/src/engine/graphics3/register_clips.d.ts.map +1 -0
  52. package/src/engine/graphics3/register_clips.js +114 -0
  53. package/src/engine/physics/cloth/MEASUREMENTS.md +795 -0
  54. package/src/engine/physics/cloth/PLAN.md +339 -9
  55. package/src/engine/physics/cloth/build/ClothProxy.d.ts +113 -61
  56. package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -1
  57. package/src/engine/physics/cloth/build/ClothProxy.js +142 -77
  58. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts +22 -0
  59. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts.map +1 -0
  60. package/src/engine/physics/cloth/build/cloth_bind_in_frame.js +75 -0
  61. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +43 -30
  62. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -1
  63. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +357 -284
  64. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts +62 -0
  65. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts.map +1 -0
  66. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.js +280 -0
  67. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +1 -1
  68. package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +1 -1
  69. package/src/engine/physics/cloth/ecs/Cloth.d.ts +17 -9
  70. package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
  71. package/src/engine/physics/cloth/ecs/Cloth.js +220 -212
  72. package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +6 -0
  73. package/src/engine/physics/cloth/ecs/ClothHold.d.ts +91 -0
  74. package/src/engine/physics/cloth/ecs/ClothHold.d.ts.map +1 -0
  75. package/src/engine/physics/cloth/ecs/ClothHold.js +103 -0
  76. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +254 -48
  77. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
  78. package/src/engine/physics/cloth/ecs/ClothInstance.js +277 -47
  79. package/src/engine/physics/cloth/ecs/ClothPin.d.ts +73 -0
  80. package/src/engine/physics/cloth/ecs/ClothPin.d.ts.map +1 -0
  81. package/src/engine/physics/cloth/ecs/ClothPin.js +92 -0
  82. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts +36 -0
  83. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts.map +1 -0
  84. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.js +61 -0
  85. package/src/engine/physics/cloth/ecs/ClothRig.d.ts +23 -17
  86. package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -1
  87. package/src/engine/physics/cloth/ecs/ClothRig.js +29 -27
  88. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +12 -14
  89. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
  90. package/src/engine/physics/cloth/ecs/ClothSystem.js +20 -15
  91. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +57 -36
  92. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
  93. package/src/engine/physics/cloth/ecs/ClothWorld.js +816 -179
  94. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +12 -13
  95. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -1
  96. package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +20 -14
  97. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +63 -11
  98. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
  99. package/src/engine/physics/cloth/ecs/cloth_build_rows.js +321 -84
  100. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts +9 -7
  101. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
  102. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +9 -7
  103. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +3 -3
  104. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +30 -30
  105. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +37 -0
  106. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts.map +1 -0
  107. package/src/engine/physics/cloth/ecs/cloth_geodesic.js +142 -0
  108. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts +97 -0
  109. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts.map +1 -0
  110. package/src/engine/physics/cloth/ecs/cloth_holds.js +608 -0
  111. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +2 -2
  112. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -1
  113. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +160 -9
  114. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +17 -22
  115. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -1
  116. package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +55 -117
  117. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +21 -6
  118. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
  119. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +44 -15
  120. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +5 -0
  121. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
  122. package/src/engine/physics/cloth/ecs/cloth_write_back.js +60 -16
  123. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -1
  124. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +65 -58
  125. package/src/engine/physics/cloth/playground/collide_main.js +1 -1
  126. package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -1
  127. package/src/engine/physics/cloth/playground/garment_build.js +17 -5
  128. package/src/engine/physics/cloth/playground/garment_main.js +1 -1
  129. package/src/engine/physics/cloth/playground/rig_build.d.ts.map +1 -1
  130. package/src/engine/physics/cloth/playground/rig_build.js +302 -296
  131. package/src/engine/physics/cloth/solver/ClothState.d.ts +45 -7
  132. package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
  133. package/src/engine/physics/cloth/solver/ClothState.js +63 -7
  134. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts +6 -1
  135. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -1
  136. package/src/engine/physics/cloth/solver/cloth_contact_find.js +7 -2
  137. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts +114 -0
  138. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts.map +1 -0
  139. package/src/engine/physics/cloth/solver/cloth_hold_line.js +362 -0
  140. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +6 -2
  141. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -1
  142. package/src/engine/physics/cloth/solver/cloth_self_find.js +13 -13
  143. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +24 -12
  144. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
  145. package/src/engine/physics/cloth/solver/cloth_solver_constants.js +24 -12
  146. package/src/engine/physics/cloth/solver/cloth_step.d.ts +16 -0
  147. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  148. package/src/engine/physics/cloth/solver/cloth_step.js +183 -20
  149. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +1 -0
  150. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -1
  151. package/src/engine/physics/cloth/solver/cloth_step_instance.js +10 -3
  152. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts +1 -1
  153. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts.map +1 -1
  154. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.js +353 -346
  155. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +7 -5
  156. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -1
  157. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +7 -5
  158. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +9 -9
  159. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -1
  160. package/src/engine/physics/cloth/wind/cloth_sample_air.js +26 -26
  161. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  162. package/src/engine/simulation/Ticker.d.ts +13 -0
  163. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  164. package/src/engine/simulation/Ticker.js +43 -8
  165. package/src/shade/RENDERER_CONTRACT.md +8 -2
  166. package/src/shade/playground/mesh_row_ceiling/main.js +2 -1
  167. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  168. package/src/shade/playground/skinned_blas_refit/main.js +11 -19
  169. package/src/shade/playground/skinned_blas_refit/place_character.d.ts +6 -3
  170. package/src/shade/playground/skinned_blas_refit/place_character.d.ts.map +1 -1
  171. package/src/shade/playground/skinned_blas_refit/place_character.js +90 -90
  172. package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
  173. package/src/shade/playground/skinned_mesh_soup/main.js +502 -509
  174. package/src/shade/playground/texture_encode/README.md +129 -109
  175. package/src/shade/playground/texture_encode/main.js +1430 -1430
  176. package/src/shade/playground/vgeo_runtime/README.md +5 -4
  177. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  178. package/src/shade/renderer/Renderer.js +6 -5
  179. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +45 -14
  180. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  181. package/src/shade/renderer/animation/GPUAnimationManager.js +316 -64
  182. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +5 -0
  183. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  184. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +11 -1
  185. package/src/shade/renderer/atmosphere/GPUSky.d.ts +12 -0
  186. package/src/shade/renderer/atmosphere/GPUSky.d.ts.map +1 -1
  187. package/src/shade/renderer/atmosphere/GPUSky.js +162 -147
  188. package/src/shade/renderer/geometry/BoxGeometry.d.ts +1 -11
  189. package/src/shade/renderer/geometry/BoxGeometry.d.ts.map +1 -1
  190. package/src/shade/renderer/geometry/BoxGeometry.js +6 -13
  191. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts +19 -0
  192. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts.map +1 -0
  193. package/src/shade/renderer/geometry/CapsuleGeometry.js +24 -0
  194. package/src/shade/renderer/geometry/ConeGeometry.d.ts +20 -0
  195. package/src/shade/renderer/geometry/ConeGeometry.d.ts.map +1 -0
  196. package/src/shade/renderer/geometry/ConeGeometry.js +33 -0
  197. package/src/shade/renderer/geometry/CylinderGeometry.d.ts +21 -0
  198. package/src/shade/renderer/geometry/CylinderGeometry.d.ts.map +1 -0
  199. package/src/shade/renderer/geometry/CylinderGeometry.js +35 -0
  200. package/src/shade/renderer/geometry/PlaneGeometry.d.ts +17 -0
  201. package/src/shade/renderer/geometry/PlaneGeometry.d.ts.map +1 -0
  202. package/src/shade/renderer/geometry/PlaneGeometry.js +22 -0
  203. package/src/shade/renderer/geometry/TorusGeometry.d.ts +18 -0
  204. package/src/shade/renderer/geometry/TorusGeometry.d.ts.map +1 -0
  205. package/src/shade/renderer/geometry/TorusGeometry.js +23 -0
  206. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts +21 -0
  207. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts.map +1 -0
  208. package/src/shade/renderer/geometry/UVSphereGeometry.js +34 -0
  209. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts +19 -0
  210. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts.map +1 -0
  211. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.js +205 -0
  212. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts +21 -0
  213. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts.map +1 -0
  214. package/src/shade/renderer/geometry/primitives/make_cone_geometry.js +36 -0
  215. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts +1 -1
  216. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts.map +1 -1
  217. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.js +44 -9
  218. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts +20 -0
  219. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts.map +1 -0
  220. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.js +190 -0
  221. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
  222. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +7 -2
  223. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts +26 -8
  224. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts.map +1 -1
  225. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js +56 -39
  226. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts +7 -0
  227. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts.map +1 -1
  228. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js +46 -4
  229. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.d.ts.map +1 -1
  230. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js +4 -2
  231. package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +2 -2
  232. package/src/shade/renderer/gpu_primitive/sort/defs.js +79 -79
  233. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +1 -1
  234. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
  235. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +7 -3
  236. package/src/shade/renderer/lightmap/bake/shader_lightmap_denoise_sh.d.ts.map +1 -1
  237. package/src/shade/renderer/lightmap/bake/shader_lightmap_denoise_sh.js +10 -3
  238. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  239. package/src/shade/renderer/particles/DESIGN.md +13 -9
  240. package/src/shade/renderer/particles/GPUParticleSystem.js +1 -1
  241. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +4 -3
  242. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
  243. package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +200 -194
  244. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  245. package/src/shade/renderer/particles/graph_particles.js +6 -2
  246. package/src/shade/renderer/particles/shaders/chunk_particle_lighting.d.ts +1 -1
  247. package/src/shade/renderer/particles/shaders/chunk_particle_lighting.js +1 -1
  248. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
  249. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +334 -329
  250. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  251. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  252. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +7 -2
  253. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
  254. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +16 -4
  255. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +3 -2
  256. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
  257. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +3 -2
  258. package/src/shade/renderer/scene/GPUSceneContext.d.ts +9 -1
  259. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  260. package/src/shade/renderer/scene/GPUSceneContext.js +23 -1
  261. package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +2444 -2345
  262. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
  263. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +312 -310
  264. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +3 -3
  265. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
  266. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +383 -375
  267. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
  268. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +349 -346
  269. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +58 -0
  270. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -0
  271. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +536 -0
  272. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +21 -7
  273. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
  274. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +291 -327
  275. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts +25 -0
  276. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts.map +1 -0
  277. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.js +99 -0
  278. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +5 -3
  279. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -1
  280. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +47 -71
  281. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts +10 -0
  282. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts.map +1 -0
  283. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +50 -0
  284. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +4 -5
  285. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -1
  286. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +7 -8
  287. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +4 -1
  288. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
  289. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +74 -3
  290. package/src/shade/renderer/volumetrics/NOTES.md +1023 -957
  291. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts +5 -4
  292. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts.map +1 -1
  293. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.js +5 -4
  294. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.d.ts +1 -1
  295. package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.js +1 -1
  296. package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.d.ts +1 -1
  297. package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.js +1 -1
  298. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts +41 -0
  299. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts.map +1 -0
  300. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.js +112 -0
  301. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts +9 -23
  302. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts.map +1 -1
  303. package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +18 -126
  304. package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.d.ts +22 -0
  305. package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.d.ts.map +1 -0
  306. package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.js +228 -0
  307. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
  308. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +0 -53
  309. package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
  310. package/src/shade/renderer/water/chunk_water_transport.js +7 -5
  311. package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
  312. package/src/shade/renderer/water/medium/GPUWaterBodies.js +8 -2
  313. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts +3 -2
  314. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts.map +1 -1
  315. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.js +3 -2
  316. package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
  317. package/src/shade/renderer/water/shader_water.js +3 -1
  318. package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -1
  319. package/src/shade/renderer/water/surface/GPUWaterSurface.js +3 -1
  320. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +4 -3
  321. package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts.map +1 -1
  322. package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +17 -7
  323. package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
  324. package/src/shade/renderer/water/surface/graph_water_tessellation.js +11 -4
  325. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  326. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +93 -30
  327. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
  328. package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +13 -5
  329. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +29 -8
  330. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
  331. package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +155 -30
  332. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +6 -1
  333. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
  334. package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +157 -39
  335. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +91 -21
  336. package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
  337. package/src/shade/renderer/water/surface/particles/shader_water_particles.js +442 -70
  338. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +11 -3
  339. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  340. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +3 -0
  341. package/src/shade/wgsl/validate_wgsl_source.d.ts.map +1 -1
  342. package/src/shade/wgsl/validate_wgsl_source.js +74 -3
  343. package/src/engine/graphics3/register_instance_animation.d.ts +0 -114
  344. package/src/engine/graphics3/register_instance_animation.d.ts.map +0 -1
  345. package/src/engine/graphics3/register_instance_animation.js +0 -201
@@ -1 +1 @@
1
- {"version":3,"file":"prototypeEditorShell.d.ts","sourceRoot":"","sources":["../../editor/prototypeEditorShell.js"],"names":[],"mappings":"AAuLA;;;;;GAKG;AACH,2BAFU,QAAQ;IAAC,MAAM,SAAS;IAAC,MAAM,SAAS;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,OAAO,UAAS;CAAC,CAAC,CAEzD"}
1
+ {"version":3,"file":"prototypeEditorShell.d.ts","sourceRoot":"","sources":["../../editor/prototypeEditorShell.js"],"names":[],"mappings":"AAyLA;;;;;GAKG;AACH,2BAFU,QAAQ;IAAC,MAAM,SAAS;IAAC,MAAM,SAAS;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,OAAO,UAAS;CAAC,CAAC,CAEzD"}
@@ -32,6 +32,7 @@ import {
32
32
  import {
33
33
  ShadedGeometrySystem
34
34
  } from "../src/engine/graphics3/ShadedGeometrySystem.js";
35
+ import { MeshSkinSystem } from "../src/engine/graphics3/MeshSkinSystem.js";
35
36
  import { GPUParticleEmitterSystem } from "../src/engine/graphics3/GPUParticleEmitterSystem.js";
36
37
  import { enableEditor } from "./enableEditor.js";
37
38
 
@@ -96,9 +97,10 @@ async function addGraphicsSystems(engine) {
96
97
 
97
98
  await em.addSystem(meshes);
98
99
 
99
- // a model with neither skin nor clip becomes entities, and its primitives are drawn by the
100
- // system that owns primitives (D47)
100
+ // a model becomes entities: its primitives are drawn by the system that owns primitives
101
+ // (D47), and the skinned ones deformed by the system that owns skins
101
102
  await em.addSystem(new ShadedGeometrySystem(engine.graphics, EngineHarness.shadeScene(engine)));
103
+ await em.addSystem(new MeshSkinSystem(engine.graphics, EngineHarness.shadeScene(engine)));
102
104
 
103
105
  /*
104
106
  One outline pass and both of its sources, because the editor offers a `Highlight` editor and
package/package.json CHANGED
@@ -1,96 +1,91 @@
1
- {
2
- "name": "@woosh/meep-engine",
3
- "license": "SEE LICENSE IN LICENSE",
4
- "productName": "Meep",
5
- "homepage": "https://meep.company-named.com/",
6
- "description": "Advanced 3D game engine",
7
- "type": "module",
8
- "author": "Alexander Goldring",
9
- "version": "3.42.0",
10
- "exports": {
11
- "./build/*": "./build/*",
12
- "./src/*": "./src/*",
13
- "./editor/*": "./editor/*",
14
- "./samples/*": "./samples/*",
15
- "./*.md": "./*.md",
16
- "./package.json": "./package.json"
17
- },
18
- "sideEffects": [
19
- "**/*.css",
20
- "**/*.scss"
21
- ],
22
- "scripts": {
23
- "test:ci": "node scripts/check-types.mjs && vitest run --coverage --reporter=default --reporter=junit --outputFile=junit.xml",
24
- "build-module": "rollup -c rollup.config.js",
25
- "publish-npm": "npm publish",
26
- "generate-types": "tsc --project tsconfig.types.json",
27
- "check-types": "node scripts/check-types.mjs",
28
- "test": "vitest run",
29
- "test:extended": "vitest run --mode extended",
30
- "test:all": "vitest run --mode all",
31
- "dev": "vite"
32
- },
33
- "browserslist": [
34
- "last 2 chrome version",
35
- "last 2 firefox version",
36
- "last 2 safari version"
37
- ],
38
- "files": [
39
- "build",
40
- "src",
41
- "editor",
42
- "samples",
43
- "package.json",
44
- "README.md",
45
- "!src/**/*.spec.js",
46
- "!samples/**/*.spec.js",
47
- "!editor/**/*.spec.js",
48
- "!src/**/__fixtures__/**",
49
- "!src/shade/renderer/texture/noise/stbn/images/**"
50
- ],
51
- "dependencies": {
52
- "opentype.js": "1.3.4",
53
- "robust-predicates": "3.0.3"
54
- },
55
- "peerDependencies": {
56
- "dat.gui": ">=0.7.0"
57
- },
58
- "devDependencies": {
59
- "@rollup/plugin-commonjs": "29.0.3",
60
- "@rollup/plugin-node-resolve": "16.0.3",
61
- "@rollup/plugin-strip": "3.0.4",
62
- "@rollup/plugin-terser": "1.0.0",
63
- "@vitest/coverage-v8": "^5.0.0",
64
- "@webgpu/types": "0.1.72",
65
- "jsdom": "^30.0.1",
66
- "rollup": "4.63.1",
67
- "typescript": "5.4.5",
68
- "vite": "^8.2.2",
69
- "vitest": "^5.0.0",
70
- "web-tree-sitter": "^0.27.0"
71
- },
72
- "keywords": [
73
- "game-engine",
74
- "gamedev",
75
- "ecs",
76
- "entity-component-system",
77
- "data-oriented",
78
- "zero-allocation",
79
- "modular",
80
- "tree-shaking",
81
- "3d",
82
- "webgpu",
83
- "webaudio",
84
- "particles",
85
- "bvh",
86
- "behavior-tree",
87
- "inverse-kinematics",
88
- "fabrik",
89
- "clustered-lighting",
90
- "color-management",
91
- "typescript"
92
- ],
93
- "engines": {
94
- "node": ">=24"
95
- }
96
- }
1
+ {
2
+ "name": "@woosh/meep-engine",
3
+ "license": "SEE LICENSE IN LICENSE",
4
+ "productName": "Meep",
5
+ "homepage": "https://meep.company-named.com/",
6
+ "description": "Advanced 3D game engine",
7
+ "type": "module",
8
+ "author": "Alexander Goldring",
9
+ "version": "3.44.0",
10
+ "exports": {
11
+ "./build/*": "./build/*",
12
+ "./src/*": "./src/*",
13
+ "./editor/*": "./editor/*",
14
+ "./samples/*": "./samples/*",
15
+ "./*.md": "./*.md",
16
+ "./package.json": "./package.json"
17
+ },
18
+ "sideEffects": [
19
+ "**/*.css",
20
+ "**/*.scss"
21
+ ],
22
+ "scripts": {
23
+ "test:ci": "node scripts/check-types.mjs && vitest run --coverage --reporter=default --reporter=junit --outputFile=junit.xml",
24
+ "build-module": "rollup -c rollup.config.js",
25
+ "publish-npm": "npm publish",
26
+ "generate-types": "tsc --project tsconfig.types.json",
27
+ "check-types": "node scripts/check-types.mjs",
28
+ "test": "vitest run",
29
+ "test:extended": "vitest run --mode extended",
30
+ "test:all": "vitest run --mode all",
31
+ "dev": "vite"
32
+ },
33
+ "browserslist": [
34
+ "last 2 chrome version",
35
+ "last 2 firefox version",
36
+ "last 2 safari version"
37
+ ],
38
+ "files": [
39
+ "build",
40
+ "src",
41
+ "editor",
42
+ "samples",
43
+ "package.json",
44
+ "README.md"
45
+ ],
46
+ "dependencies": {
47
+ "opentype.js": "1.3.4",
48
+ "robust-predicates": "3.0.3"
49
+ },
50
+ "peerDependencies": {
51
+ "dat.gui": ">=0.7.0"
52
+ },
53
+ "devDependencies": {
54
+ "@rollup/plugin-commonjs": "29.0.3",
55
+ "@rollup/plugin-node-resolve": "16.0.3",
56
+ "@rollup/plugin-strip": "3.0.4",
57
+ "@rollup/plugin-terser": "1.0.0",
58
+ "@vitest/coverage-v8": "^5.0.0",
59
+ "@webgpu/types": "0.1.72",
60
+ "jsdom": "^30.0.1",
61
+ "rollup": "4.63.1",
62
+ "typescript": "5.4.5",
63
+ "vite": "^8.2.2",
64
+ "vitest": "^5.0.0",
65
+ "web-tree-sitter": "^0.27.0"
66
+ },
67
+ "keywords": [
68
+ "game-engine",
69
+ "gamedev",
70
+ "ecs",
71
+ "entity-component-system",
72
+ "data-oriented",
73
+ "zero-allocation",
74
+ "modular",
75
+ "tree-shaking",
76
+ "3d",
77
+ "webgpu",
78
+ "webaudio",
79
+ "particles",
80
+ "bvh",
81
+ "behavior-tree",
82
+ "inverse-kinematics",
83
+ "fabrik",
84
+ "clustered-lighting",
85
+ "color-management",
86
+ "typescript"
87
+ ],
88
+ "engines": {
89
+ "node": ">=24"
90
+ }
91
+ }
@@ -52,6 +52,21 @@ declare class Clock {
52
52
  * @returns {number} in seconds
53
53
  */
54
54
  getDelta(): number;
55
+ /**
56
+ * {@link getDelta}, measured to a given moment instead of to now - an animation frame's
57
+ * timestamp, so that the simulation shown by a frame is the simulation at that frame's time and
58
+ * not at whenever the code reading the clock happened to run.
59
+ *
60
+ * Only a moment between the clock's last reading and now can be measured to; anything else is
61
+ * measured to now. A frame's timestamp is when the frame began, so it can sit behind a reading
62
+ * taken earlier in that frame (a resume() from an input handler). And it is only on this
63
+ * clock's timeline where the environment keeps its promise that it is - jsdom stamps frames
64
+ * 1.5 s behind `performance.now()`, a `Date.now()` polyfill decades ahead - and measured to
65
+ * those, the clock froze or leapt.
66
+ * @param {number} time in seconds, on the {@link current_time_in_seconds} timeline
67
+ * @returns {number} in seconds
68
+ */
69
+ getDeltaAt(time: number): number;
55
70
  /**
56
71
  *
57
72
  * @returns {number} in seconds
@@ -1 +1 @@
1
- {"version":3,"file":"Clock.d.ts","sourceRoot":"","sources":["../../../src/engine/Clock.js"],"names":[],"mappings":";AAcA;;GAEG;AACH;IAEI;;;;OAIG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,oBAAoB;IAGpB;;;;;;OAMG;IACH,gBAHU,IAAI,CAGM;IAMpB;;;OAGG;IACH,0BAEC;IAED;;;OAGG;IACH,yBAEC;IAED,cAIC;IAED,aAEC;IAED,cAeC;IAED;;;OAGG;IACH,YAFa,MAAM,CAOlB;IAED;;;OAGG;IACH,qBAFa,MAAM,CAOlB;IAED;;;;OAIG;IACH,kBAFY,MAAM,CAIjB;IAED,cAGC;CACJ;iBA1IgB,4BAA4B"}
1
+ {"version":3,"file":"Clock.d.ts","sourceRoot":"","sources":["../../../src/engine/Clock.js"],"names":[],"mappings":";AAcA;;GAEG;AACH;IAEI;;;;OAIG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,oBAAoB;IAGpB;;;;;;OAMG;IACH,gBAHU,IAAI,CAGM;IAMpB;;;OAGG;IACH,0BAEC;IAED;;;OAGG;IACH,yBAEC;IAED,cAIC;IAED,aAEC;IAED,cAeC;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;;;;;;;;;;;OAaG;IACH,iBAHW,MAAM,GACJ,MAAM,CAalB;IAED;;;OAGG;IACH,qBAFa,MAAM,CAOlB;IAED;;;;OAIG;IACH,kBAFY,MAAM,CAIjB;IAED,cAGC;CACJ;iBAlKgB,4BAA4B"}
@@ -4,9 +4,9 @@ import { current_time_in_seconds } from "../core/time/current_time_in_seconds.js
4
4
  /**
5
5
  *
6
6
  * @param {Clock} clock
7
+ * @param {number} now in seconds, on the {@link current_time_in_seconds} timeline
7
8
  */
8
- function updateElapsedTime(clock) {
9
- const now = current_time_in_seconds();
9
+ function updateElapsedTime(clock, now) {
10
10
  const delta = (now - clock.__lastMeasurement) * clock.speed;
11
11
  clock.__lastMeasurement = now;
12
12
  clock.elapsedTime += delta;
@@ -98,7 +98,7 @@ class Clock {
98
98
 
99
99
  this.__isRunning = false;
100
100
  //update time
101
- updateElapsedTime(this);
101
+ updateElapsedTime(this, current_time_in_seconds());
102
102
  }
103
103
 
104
104
  /**
@@ -106,7 +106,31 @@ class Clock {
106
106
  * @returns {number} in seconds
107
107
  */
108
108
  getDelta() {
109
- const elapsedTime = this.updateElapsedTime();
109
+ return this.getDeltaAt(current_time_in_seconds());
110
+ }
111
+
112
+ /**
113
+ * {@link getDelta}, measured to a given moment instead of to now - an animation frame's
114
+ * timestamp, so that the simulation shown by a frame is the simulation at that frame's time and
115
+ * not at whenever the code reading the clock happened to run.
116
+ *
117
+ * Only a moment between the clock's last reading and now can be measured to; anything else is
118
+ * measured to now. A frame's timestamp is when the frame began, so it can sit behind a reading
119
+ * taken earlier in that frame (a resume() from an input handler). And it is only on this
120
+ * clock's timeline where the environment keeps its promise that it is - jsdom stamps frames
121
+ * 1.5 s behind `performance.now()`, a `Date.now()` polyfill decades ahead - and measured to
122
+ * those, the clock froze or leapt.
123
+ * @param {number} time in seconds, on the {@link current_time_in_seconds} timeline
124
+ * @returns {number} in seconds
125
+ */
126
+ getDeltaAt(time) {
127
+ if (this.__isRunning) {
128
+ const now = current_time_in_seconds();
129
+
130
+ updateElapsedTime(this, time >= this.__lastMeasurement && time <= now ? time : now);
131
+ }
132
+
133
+ const elapsedTime = this.elapsedTime;
110
134
  const delta = elapsedTime - this.timeAtDelta;
111
135
  this.timeAtDelta = elapsedTime;
112
136
  return delta;
@@ -118,7 +142,7 @@ class Clock {
118
142
  */
119
143
  updateElapsedTime() {
120
144
  if (this.__isRunning) {
121
- updateElapsedTime(this);
145
+ updateElapsedTime(this, current_time_in_seconds());
122
146
  }
123
147
  return this.elapsedTime;
124
148
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Engine.d.ts","sourceRoot":"","sources":["../../../src/engine/Engine.js"],"names":[],"mappings":";6BAqCa,OAAO,8BAA8B,EAAE,cAAc;AAwClE;IAiGI;;;;;;;;;OASG;IACH,sBARW,cAAc;QAEU,aAAa,GAArC,aAAa;QACK,cAAc,GAAhC,OAAO;QACW,WAAW,GAA7B,OAAO;QACW,KAAK,GAAvB,OAAO;OAiPjB;IAtSD;;;OAGG;IACH,UAFU,cAAc,GAAC,IAAI,CAEb;IAEhB;;;OAGG;IACH,OAFU,WAAW,GAAC,IAAI,CAEb;IAEb,qBAA4B;IAE5B;;;;;;;;;OASG;IACH,0BAFU,uBAAuB,CAEe;IAEhD;;;OAGG;IACH,kBAFU,mBAAmB,CAEO;IAEpC;;;;OAIG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,mBAFU,kBAAkB,CAEa;IAoBrC;;;OAGG;IACH,UAFU,cAAc,CAEA;IAKxB;;;OAGG;IACH,aAFU,gBAAgB,CAEe;IAGzC,yCAAkE;IAK9D,6BAAkC;IAMtC;;;OAGG;IACH,cAFU,aAAa,MAAM,CAAC,CAK5B;IAEF,8CAiCE;IAgCF;;;OAGG;IACH,SAFU,WAAW,CAEoB;IAEzC;;;OAGG;IACH,oCAA0C;IAE1C;;;OAGG;IACH,sCAFU,2BAA2B,CAE+B;IAEpE,yBAAoC;IAGpC;;OAEG;IACH,aAAkB;IAElB;;;OAGG;IACH,SAFU,OAAO,CAEwB;IAGzC,2BAAsC;IAuCtC;;;OAGG;IACH,KAFU,SAAS,CAEO;IAE1B;;;OAGG;IACH,uBAFU,YAAY,CAEqD;IAI3E;;;;;MAKC;IA8BD;;;OAGG;IACH,kBAFU,OAAO,CAEW;IAwIhC,wBAgCC;IApBG,oBAAwB;IAsB5B,2BA8CC;IAED,oBAiBC;IAED;;;OAGG;IACH,+CAUC;IAED,eAkDC;IAED;;;OAGG;IACH,sBA2GC;IAqBD;;OAEG;IACH,sBAgEC;IAED,aAEC;IAED;;OAEG;IACH,4BAOC;IAIL;;;OAGG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;+BAt5B8B,+BAA+B;wBAWtC,wBAAwB;0BArBtB,0CAA0C;wCAeN,iDAAiD;oCAG3E,iCAAiC;mBAElD,wBAAwB;+BAtBZ,gDAAgD;iCAO9C,+CAA+C;8BAGlD,wBAAwB;6BALzB,yBAAyB;uCAIf,6DAA6D;4BAUxE,0BAA0B;+BArBvB,iCAAiC;4CAapB,qDAAqD;AAgBjG;;GAEG;AAGH;IACI,gDAA2D;IAC3D,0BAAkC;IAClC,iCAAyC;CAC5C;6BAvC4B,sCAAsC;sBA4B7C,mBAAmB;yBAJhB,yBAAyB;8BALpB,kCAAkC;2BADrC,mCAAmC;8BAFhC,kCAAkC;8BAClC,kCAAkC;sBAb1C,+BAA+B;+BAKtB,qCAAqC;4BAPxC,kCAAkC;oBAH1C,yBAAyB"}
1
+ {"version":3,"file":"Engine.d.ts","sourceRoot":"","sources":["../../../src/engine/Engine.js"],"names":[],"mappings":";6BAqCa,OAAO,8BAA8B,EAAE,cAAc;AAwClE;IA4FI;;;;;;;;;OASG;IACH,sBARW,cAAc;QAEU,aAAa,GAArC,aAAa;QACK,cAAc,GAAhC,OAAO;QACW,WAAW,GAA7B,OAAO;QACW,KAAK,GAAvB,OAAO;OAiPjB;IAtSD;;;OAGG;IACH,UAFU,cAAc,GAAC,IAAI,CAEb;IAEhB;;;OAGG;IACH,OAFU,WAAW,GAAC,IAAI,CAEb;IAEb,qBAA4B;IAE5B;;;;;;;;;OASG;IACH,0BAFU,uBAAuB,CAEe;IAEhD;;;OAGG;IACH,kBAFU,mBAAmB,CAEO;IAEpC;;;;OAIG;IACH,iBAFU,MAAM,CAEM;IAEtB;;;;OAIG;IACH,mBAFU,kBAAkB,CAEa;IAoBrC;;;OAGG;IACH,UAFU,cAAc,CAEA;IAKxB;;;OAGG;IACH,aAFU,gBAAgB,CAEe;IAGzC,yCAAkE;IAK9D,6BAAkC;IAMtC;;;OAGG;IACH,cAFU,aAAa,MAAM,CAAC,CAK5B;IAEF,8CAiCE;IAgCF;;;OAGG;IACH,SAFU,WAAW,CAEoB;IAEzC;;;OAGG;IACH,oCAA0C;IAE1C;;;OAGG;IACH,sCAFU,2BAA2B,CAE+B;IAEpE,yBAAoC;IAGpC;;OAEG;IACH,aAAkB;IAElB;;;OAGG;IACH,SAFU,OAAO,CAEwB;IAGzC,2BAAsC;IAuCtC;;;OAGG;IACH,KAFU,SAAS,CAEO;IAE1B;;;OAGG;IACH,uBAFU,YAAY,CAEqD;IAI3E;;;;;MAKC;IA8BD;;;OAGG;IACH,kBAFU,OAAO,CAEW;IAwIhC,wBAgCC;IApBG,oBAAwB;IAsB5B,2BA8CC;IAED,oBAiBC;IAED;;;OAGG;IACH,+CAUC;IAED,eAkDC;IAED;;;OAGG;IACH,sBA0GC;IAoBD;;OAEG;IACH,sBA+DC;IAED,aAEC;IAED;;OAEG;IACH,4BAOC;IAIL;;;OAGG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;+BA94B8B,+BAA+B;wBAWtC,wBAAwB;0BArBtB,0CAA0C;wCAeN,iDAAiD;oCAG3E,iCAAiC;mBAElD,wBAAwB;+BAtBZ,gDAAgD;iCAO9C,+CAA+C;8BAGlD,wBAAwB;6BALzB,yBAAyB;uCAIf,6DAA6D;4BAUxE,0BAA0B;+BArBvB,iCAAiC;4CAapB,qDAAqD;AAgBjG;;GAEG;AAGH;IACI,gDAA2D;IAC3D,0BAAkC;IAClC,iCAAyC;CAC5C;6BAvC4B,sCAAsC;sBA4B7C,mBAAmB;yBAJhB,yBAAyB;8BALpB,kCAAkC;2BADrC,mCAAmC;8BAFhC,kCAAkC;8BAClC,kCAAkC;sBAb1C,+BAA+B;+BAKtB,qCAAqC;4BAPxC,kCAAkC;oBAH1C,yBAAyB"}
@@ -86,11 +86,6 @@ class Engine {
86
86
  */
87
87
  #last_render_simulation_time = 0;
88
88
 
89
- /**
90
- * Handle of the pending render-loop frame, `-1` when the loop is not running
91
- * @type {number}
92
- */
93
- #animation_frame_handle = -1;
94
89
 
95
90
  /**
96
91
  * Handle of the pending "pause the simulation, this outage is taking a while" timer, `-1` when none
@@ -699,14 +694,14 @@ class Engine {
699
694
  scene's speed modifiers (see SceneManager), so a paused game holds its particles still
700
695
  and a slowed one slows them. A wall-clock measurement would do neither.
701
696
 
702
- `updateElapsedTime` advances the clock and reads it without touching the anchor
703
- `getDelta` keeps, so this does not consume the delta the entity manager's tick is
704
- about to be handed.
697
+ Read, not advanced: a frame draws right after the ticker advanced the clock to the
698
+ frame's timestamp (see Ticker#onFrame), so this is the simulation time of the frame.
699
+ Advancing it here would step the renderer by however long that tick took to run.
705
700
 
706
701
  Moved only when a frame is actually drawn, so simulation time that passes while
707
702
  rendering is off is caught up by the next frame rather than lost.
708
703
  */
709
- const simulation_time = this.ticker.clock.updateElapsedTime();
704
+ const simulation_time = this.ticker.clock.getElapsedTime();
710
705
  const time_delta_seconds = simulation_time - this.#last_render_simulation_time;
711
706
 
712
707
  this.#last_render_simulation_time = simulation_time;
@@ -781,10 +776,9 @@ class Engine {
781
776
 
782
777
  this.#last_frame_timestamp = performance.now();
783
778
 
784
- /**
785
- * Starting the engine
786
- */
787
- this.#animation_frame_handle = requestAnimationFrame(this.#animation_frame);
779
+ // Drawn from the ticker's frame, after that frame's tick. A render loop of its own drew
780
+ // each frame before the tick, i.e. the simulation as of whenever the previous tick ran.
781
+ this.ticker.onFrame.add(this.#animation_frame);
788
782
 
789
783
  //start simulation
790
784
  this.ticker.start({ maxTimeout: 200 });
@@ -835,13 +829,12 @@ class Engine {
835
829
  }
836
830
 
837
831
  /**
838
- * Fired every animation frame via {@link requestAnimationFrame}
832
+ * Fired every animation frame via {@link Ticker#onFrame}
839
833
  */
840
834
  #animation_frame = () => {
841
835
 
842
836
  const t0 = this.#last_frame_timestamp;
843
837
  const t1 = performance.now();
844
- this.#animation_frame_handle = requestAnimationFrame(this.#animation_frame);
845
838
  this.render();
846
839
 
847
840
  const frame_delay = (t1 - t0) / 1000;
@@ -865,10 +858,9 @@ class Engine {
865
858
  // running, which would abort the whole teardown below
866
859
  this.ticker.stop();
867
860
 
868
- // and the render loop, which re-requests itself every frame and would
869
- // otherwise keep calling render() on a torn-down engine forever
870
- cancelAnimationFrame(this.#animation_frame_handle);
871
- this.#animation_frame_handle = -1;
861
+ // which also ends the render loop, as it draws from the ticker's frames. Unsubscribed too,
862
+ // so a restart does not draw twice per frame
863
+ this.ticker.onFrame.remove(this.#animation_frame);
872
864
 
873
865
  // the input devices the constructor started. The gamepad one polls on its own animation
874
866
  // frame loop, so left alone it outlives the engine the same way the render loop would;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * How the geometry on this entity deforms: the joints its vertices are weighted to, as entities,
3
+ * and where each joint stood when the mesh was bound to it.
4
+ *
5
+ * **It describes the mesh, so it lives on the mesh entity.** The geometry's per-vertex joint indices
6
+ * index {@link joints}, and an inverse bind belongs to the pair (this mesh, that joint) — one joint
7
+ * can bind with different matrices in different skins. The joints are entities like any other: a
8
+ * clip, IK, a ragdoll or a cloth moves them, and the skin follows.
9
+ *
10
+ * The geometry beside it says it draws a deformed clone (`ShadedGeometryFlags.Skinned`); without
11
+ * that it draws the shared source and nothing would deform. `MeshSkinSystem` deforms it; a model
12
+ * loaded by `MeshSystem` carries one on each skinned primitive, and code builds one the same way.
13
+ *
14
+ * **Replaced, never edited.** A skin is registered once with the joints and matrices it has then;
15
+ * to change either, take the component off and put another on. Meshes of one model that share a
16
+ * skeleton and bind it the same way — a body and its hair — share one registration on the GPU,
17
+ * whether or not they share the arrays.
18
+ *
19
+ * **Not saved**, for the reason {@link ShadedGeometry} is not: the joint indices address the vertex
20
+ * attribute of a geometry no save holds, so whatever builds the geometry builds its skin.
21
+ *
22
+ * @author Alex Goldring
23
+ * @copyright Company Named Limited (c) 2026
24
+ */
25
+ export class MeshSkin {
26
+ /**
27
+ * @param {Int32Array} joints entities
28
+ * @param {Float32Array} inverse_bind_matrices `joints.length` × 16
29
+ * @returns {MeshSkin}
30
+ */
31
+ static from(joints: Int32Array, inverse_bind_matrices: Float32Array): MeshSkin;
32
+ /**
33
+ * The joints, as entities, in the order the geometry's per-vertex joint indices address them.
34
+ * Read-only once the component is on an entity.
35
+ *
36
+ * @type {Int32Array}
37
+ */
38
+ joints: Int32Array;
39
+ /**
40
+ * `joints.length` × 16 column-major matrices, flat: joint `j`'s at `[j * 16, j * 16 + 16)`, taking
41
+ * a vertex from the mesh's frame into the joint's at bind. Read-only, and shared — a model's
42
+ * placements all hold the one array their prefab compiled.
43
+ *
44
+ * @type {Float32Array}
45
+ */
46
+ inverse_bind_matrices: Float32Array;
47
+ /**
48
+ * @readonly
49
+ * @type {boolean}
50
+ */
51
+ readonly isMeshSkin: boolean;
52
+ }
53
+ export namespace MeshSkin {
54
+ let typeName: string;
55
+ let serializable: boolean;
56
+ }
57
+ //# sourceMappingURL=MeshSkin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MeshSkin.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/mesh-v2/MeshSkin.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IAkBI;;;;OAIG;IACH,oBAJW,UAAU,yBACV,YAAY,GACV,QAAQ,CAiBpB;IArCD;;;;;OAKG;IACH,QAFU,UAAU,CAEO;IAE3B;;;;;;OAMG;IACH,uBAFU,YAAY,CAEsB;IAyBhD;;;OAGG;IACH,qBAFU,OAAO,CAEY;CAN5B;;kBAUS,MAAM;sBAMN,OAAO"}
@@ -0,0 +1,84 @@
1
+ import { assert } from "../../../../core/assert.js";
2
+
3
+ /**
4
+ * How the geometry on this entity deforms: the joints its vertices are weighted to, as entities,
5
+ * and where each joint stood when the mesh was bound to it.
6
+ *
7
+ * **It describes the mesh, so it lives on the mesh entity.** The geometry's per-vertex joint indices
8
+ * index {@link joints}, and an inverse bind belongs to the pair (this mesh, that joint) — one joint
9
+ * can bind with different matrices in different skins. The joints are entities like any other: a
10
+ * clip, IK, a ragdoll or a cloth moves them, and the skin follows.
11
+ *
12
+ * The geometry beside it says it draws a deformed clone (`ShadedGeometryFlags.Skinned`); without
13
+ * that it draws the shared source and nothing would deform. `MeshSkinSystem` deforms it; a model
14
+ * loaded by `MeshSystem` carries one on each skinned primitive, and code builds one the same way.
15
+ *
16
+ * **Replaced, never edited.** A skin is registered once with the joints and matrices it has then;
17
+ * to change either, take the component off and put another on. Meshes of one model that share a
18
+ * skeleton and bind it the same way — a body and its hair — share one registration on the GPU,
19
+ * whether or not they share the arrays.
20
+ *
21
+ * **Not saved**, for the reason {@link ShadedGeometry} is not: the joint indices address the vertex
22
+ * attribute of a geometry no save holds, so whatever builds the geometry builds its skin.
23
+ *
24
+ * @author Alex Goldring
25
+ * @copyright Company Named Limited (c) 2026
26
+ */
27
+ export class MeshSkin {
28
+ /**
29
+ * The joints, as entities, in the order the geometry's per-vertex joint indices address them.
30
+ * Read-only once the component is on an entity.
31
+ *
32
+ * @type {Int32Array}
33
+ */
34
+ joints = new Int32Array(0);
35
+
36
+ /**
37
+ * `joints.length` × 16 column-major matrices, flat: joint `j`'s at `[j * 16, j * 16 + 16)`, taking
38
+ * a vertex from the mesh's frame into the joint's at bind. Read-only, and shared — a model's
39
+ * placements all hold the one array their prefab compiled.
40
+ *
41
+ * @type {Float32Array}
42
+ */
43
+ inverse_bind_matrices = new Float32Array(0);
44
+
45
+ /**
46
+ * @param {Int32Array} joints entities
47
+ * @param {Float32Array} inverse_bind_matrices `joints.length` × 16
48
+ * @returns {MeshSkin}
49
+ */
50
+ static from(joints, inverse_bind_matrices) {
51
+ assert.equal(joints instanceof Int32Array, true, 'joints must be an Int32Array of entities');
52
+ assert.greaterThanOrEqual(joints.length, 1, 'a skin has at least one joint');
53
+ assert.equal(inverse_bind_matrices instanceof Float32Array, true, 'inverse_bind_matrices must be a Float32Array');
54
+ assert.equal(
55
+ inverse_bind_matrices.length, joints.length * 16,
56
+ 'inverse_bind_matrices.length !== joints.length * 16'
57
+ );
58
+
59
+ const r = new MeshSkin();
60
+
61
+ r.joints = joints;
62
+ r.inverse_bind_matrices = inverse_bind_matrices;
63
+
64
+ return r;
65
+ }
66
+ }
67
+
68
+ /**
69
+ * @readonly
70
+ * @type {boolean}
71
+ */
72
+ MeshSkin.prototype.isMeshSkin = true;
73
+
74
+ /**
75
+ * @readonly
76
+ * @type {string}
77
+ */
78
+ MeshSkin.typeName = "MeshSkin";
79
+
80
+ /**
81
+ * @readonly
82
+ * @type {boolean}
83
+ */
84
+ MeshSkin.serializable = false;
@@ -2,6 +2,10 @@
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
+ *
5
9
  * **It is the CPU that plays the animation and the GPU that draws it.** Shade can advance a clip
6
10
  * itself, and this never asks it to — `AnimationClipFlags.Playing` is left clear and every audible
7
11
  * clip's time is written down each frame from the controller's own clock. That is I-4: the pose
@@ -10,33 +14,38 @@
10
14
  *
11
15
  * **Nothing here is culled.** The legacy system skipped entities smaller than 32 px², which let
12
16
  * 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
17
+ * its notifications are gameplay and run for every entity whose clips have arrived; what may be
14
18
  * culled is drawing, and drawing is Shade's to cull.
15
19
  */
16
20
  export class AnimationGraphSystem extends System<any> {
17
21
  /**
18
22
  * @param {GraphicsEngine} graphics
19
- * @param {MeshSystem} meshes
23
+ * @param {Scene} scene
20
24
  */
21
- constructor(graphics: GraphicsEngine, meshes: MeshSystem);
22
- dependencies: (typeof SGMesh | typeof AnimationGraphController)[];
25
+ constructor(graphics: GraphicsEngine, scene: Scene);
26
+ dependencies: (typeof AnimationGraphController | typeof AnimationClips)[];
23
27
  components_used: ResourceAccessSpecification<typeof AnimationGraphController>[];
24
28
  /**
29
+ * Only noted here: the graph is bound to the clips by the next {@link update}. A link can happen
30
+ * anywhere the components are added — inside a model's spawn, for one `MeshSystem` loads — and a
31
+ * graph naming a clip the entity has not got throws, which belongs in this system's tick and not
32
+ * in whoever added the component.
33
+ *
25
34
  * @param {AnimationGraphController} controller
26
- * @param {SGMesh} model
35
+ * @param {AnimationClips} clips
27
36
  * @param {number} entity
28
37
  */
29
- link(controller: AnimationGraphController, model: SGMesh, entity: number): void;
38
+ link(controller: AnimationGraphController, clips: AnimationClips, entity: number): void;
30
39
  /**
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.
40
+ * What the entity is playing, in the form the CPU pose evaluator takes: one entry per clip
41
+ * **this graph names**, at the weight and the time the renderer has been given.
33
42
  *
34
43
  * **The clips the graph does not name are not here, because they are not registered** (D37).
35
44
  * The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
36
45
  * all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
37
46
  * leaving them at rest. The answer is not to hand those clips to the evaluator so it can make
38
47
  * 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.
48
+ * joints it alone would have driven stay where they rest.
40
49
  *
41
50
  * A clip the graph names but is not currently playing **is** here, at weight zero, because it is
42
51
  * bound and the accumulator does see it.
@@ -47,21 +56,22 @@ export class AnimationGraphSystem extends System<any> {
47
56
  * @param {PosePlayback[]} target appended to
48
57
  * @param {number} entity
49
58
  * @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
59
+ * {@link AnimationGraphController} or no {@link AnimationClips}, and for one whose clips arrived
60
+ * since the last update
51
61
  */
52
62
  write_pose_playbacks(target: PosePlayback[], entity: number): boolean;
53
63
  /**
54
64
  * @param {AnimationGraphController} controller
55
- * @param {SGMesh} model
65
+ * @param {AnimationClips} clips
56
66
  * @param {number} entity
57
67
  */
58
- unlink(controller: AnimationGraphController, model: SGMesh, entity: number): void;
68
+ unlink(controller: AnimationGraphController, clips: AnimationClips, entity: number): void;
59
69
  shutdown(entityManager: any): Promise<void>;
60
70
  #private;
61
71
  }
62
72
  import { System } from "../ecs/System.js";
63
- import { SGMesh } from "../graphics/ecs/mesh-v2/aggregate/SGMesh.js";
64
73
  import { AnimationGraphController } from "./animation/AnimationGraphController.js";
74
+ import { AnimationClips } from "./animation/AnimationClips.js";
65
75
  import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
66
76
  import { PosePlayback } from "../../shade/renderer/animation/pose/PosePlayback.js";
67
77
  //# 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":"AAUA;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAkBI;;;OAGG;IACH,oDAgBC;IAPG,0EAA8D;IAI9D,gFAEC;IAGL;;;;;;;;;OASG;IACH,iBAJW,wBAAwB,SACxB,cAAc,UACd,MAAM,QAchB;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,6BANW,YAAY,EAAE,UACd,MAAM,GACJ,OAAO,CAgDnB;IAED;;;;OAIG;IACH,mBAJW,wBAAwB,SACxB,cAAc,UACd,MAAM,QAYhB;IAED,4CAQC;;CAkJJ;uBAzUsB,kBAAkB;yCAEA,yCAAyC;+BADnD,+BAA+B;4CAHlB,iDAAiD;6BAChE,qDAAqD"}