@woosh/meep-engine 3.24.0 → 3.25.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.
- package/package.json +1 -1
- package/src/engine/graphics3/PickingSystem.d.ts +3 -3
- package/src/engine/graphics3/PickingSystem.d.ts.map +1 -1
- package/src/engine/graphics3/PickingSystem.js +52 -55
- package/src/engine/graphics3/shader_picking_gather.d.ts +40 -0
- package/src/engine/graphics3/shader_picking_gather.d.ts.map +1 -0
- package/src/engine/graphics3/shader_picking_gather.js +120 -0
- package/src/engine/physics/cloth/MEASUREMENTS.md +1050 -0
- package/src/engine/physics/cloth/PLAN.md +411 -49
- package/src/engine/physics/cloth/ecs/ClothColliderSerializationAdapter.d.ts +52 -0
- package/src/engine/physics/cloth/ecs/ClothColliderSerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothColliderSerializationAdapter.js +70 -0
- package/src/engine/physics/cloth/ecs/ClothDynamics.d.ts +12 -3
- package/src/engine/physics/cloth/ecs/ClothDynamics.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothDynamics.js +340 -331
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +36 -22
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothInstance.js +38 -23
- package/src/engine/physics/cloth/ecs/ClothSerializationAdapter.d.ts +84 -0
- package/src/engine/physics/cloth/ecs/ClothSerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothSerializationAdapter.js +141 -0
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +51 -82
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothSystem.js +81 -869
- package/src/engine/physics/cloth/ecs/ClothWorkerCore.d.ts +48 -0
- package/src/engine/physics/cloth/ecs/ClothWorkerCore.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothWorkerCore.js +107 -0
- package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +286 -0
- package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothWorld.js +1104 -0
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +182 -0
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +562 -0
- package/src/engine/physics/cloth/ecs/cloth.worker.d.ts +2 -0
- package/src/engine/physics/cloth/ecs/cloth.worker.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth.worker.js +12 -0
- package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_build_rows.js +2 -1
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts +58 -0
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +341 -271
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +20 -2
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +39 -15
- package/src/engine/physics/cloth/ecs/cloth_worker_protocol.d.ts +29 -0
- package/src/engine/physics/cloth/ecs/cloth_worker_protocol.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_worker_protocol.js +78 -0
- package/src/engine/physics/cloth/ecs/makeClothWorker.d.ts +17 -0
- package/src/engine/physics/cloth/ecs/makeClothWorker.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/makeClothWorker.js +18 -0
- package/src/engine/physics/cloth/playground/README.md +73 -2
- package/src/engine/physics/cloth/playground/wind.html +166 -0
- package/src/engine/physics/cloth/playground/wind_build.d.ts +81 -0
- package/src/engine/physics/cloth/playground/wind_build.d.ts.map +1 -0
- package/src/engine/physics/cloth/playground/wind_build.js +141 -0
- package/src/engine/physics/cloth/playground/wind_main.d.ts +2 -0
- package/src/engine/physics/cloth/playground/wind_main.d.ts.map +1 -0
- package/src/engine/physics/cloth/playground/wind_main.js +681 -0
- package/src/engine/physics/cloth/solver/ClothState.d.ts +134 -79
- package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/ClothState.js +273 -12
- package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +33 -0
- package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_solver_constants.js +34 -0
- package/src/engine/physics/cloth/solver/cloth_step.d.ts +21 -2
- package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_step.js +173 -4
- package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +40 -0
- package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_step_instance.js +284 -0
- package/src/engine/physics/cloth/solver/cloth_wind_accelerate.d.ts +107 -0
- package/src/engine/physics/cloth/solver/cloth_wind_accelerate.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_wind_accelerate.js +263 -0
- package/src/engine/physics/cloth/wind/AbstractClothWind.d.ts +88 -0
- package/src/engine/physics/cloth/wind/AbstractClothWind.d.ts.map +1 -0
- package/src/engine/physics/cloth/wind/AbstractClothWind.js +100 -0
- package/src/engine/physics/cloth/wind/ClothAmbientWind.d.ts +85 -0
- package/src/engine/physics/cloth/wind/ClothAmbientWind.d.ts.map +1 -0
- package/src/engine/physics/cloth/wind/ClothAmbientWind.js +182 -0
- package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts +79 -0
- package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -0
- package/src/engine/physics/cloth/wind/ClothFluidWind.js +210 -0
- package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +101 -0
- package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -0
- package/src/engine/physics/cloth/wind/cloth_sample_air.js +290 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/device/mock/texture_copy.d.ts.map +1 -1
- package/src/shade/device/mock/texture_copy.js +28 -0
- package/src/shade/playground/vgeo_runtime/README.md +94 -0
- package/src/shade/playground/vgeo_runtime/index.html +62 -0
- package/src/shade/playground/vgeo_runtime/main.d.ts +2 -0
- package/src/shade/playground/vgeo_runtime/main.d.ts.map +1 -0
- package/src/shade/playground/vgeo_runtime/main.js +399 -0
- package/src/shade/playground/vgeo_viewer/sample_asset.js +1 -1
- package/src/shade/renderer/camera/Camera.d.ts +14 -0
- package/src/shade/renderer/camera/Camera.d.ts.map +1 -1
- package/src/shade/renderer/camera/Camera.js +7 -1
- package/src/shade/renderer/geometry/GEOMETRY_METADATA_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/geometry/GEOMETRY_METADATA_STRUCT.js +16 -1
- package/src/shade/renderer/geometry/GPUGeometryManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/GPUGeometryManager.js +29 -9
- package/src/shade/renderer/geometry/GPUGeometryMetadata.d.ts +10 -0
- package/src/shade/renderer/geometry/GPUGeometryMetadata.d.ts.map +1 -1
- package/src/shade/renderer/geometry/GPUGeometryMetadata.js +13 -0
- package/src/shade/renderer/geometry/virtual/VGEO_FORMAT.md +46 -18
- package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_DESIGN.md +70 -22
- package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_PLAN.md +97 -19
- package/src/shade/renderer/geometry/virtual/build/VGeoBuildOptions.d.ts +12 -2
- package/src/shade/renderer/geometry/virtual/build/VGeoBuildOptions.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/VGeoBuildOptions.js +14 -3
- package/src/shade/renderer/geometry/virtual/build/vgeo_assemble_pages.d.ts +2 -2
- package/src/shade/renderer/geometry/virtual/build/vgeo_assemble_pages.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/vgeo_assemble_pages.js +124 -6
- package/src/shade/renderer/geometry/virtual/build/vgeo_page_node_count.d.ts +22 -0
- package/src/shade/renderer/geometry/virtual/build/vgeo_page_node_count.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/build/vgeo_page_node_count.js +53 -0
- package/src/shade/renderer/geometry/virtual/format/VGeoWriteOptions.d.ts +8 -1
- package/src/shade/renderer/geometry/virtual/format/VGeoWriteOptions.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/VGeoWriteOptions.js +8 -1
- package/src/shade/renderer/geometry/virtual/format/header/VGEO_FEATURE_IGNORABLE_BOUNDED_PAGES.d.ts +16 -0
- package/src/shade/renderer/geometry/virtual/format/header/VGEO_FEATURE_IGNORABLE_BOUNDED_PAGES.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/format/header/VGEO_FEATURE_IGNORABLE_BOUNDED_PAGES.js +15 -0
- package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.d.ts +54 -0
- package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.js +53 -0
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerHeader.d.ts +13 -2
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerHeader.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerHeader.js +14 -2
- package/src/shade/renderer/geometry/virtual/format/read/VGeoPage.d.ts +100 -0
- package/src/shade/renderer/geometry/virtual/format/read/VGeoPage.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/VGeoPage.js +113 -0
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_read_header.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_read_header.js +5 -0
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_read_page.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_read_page.js +108 -0
- package/src/shade/renderer/geometry/virtual/format/vgeo_validate_container.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/vgeo_validate_container.js +23 -0
- package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.js +40 -0
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryPool.d.ts +228 -0
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryPool.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryPool.js +932 -0
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts +176 -0
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +425 -0
- package/src/shade/renderer/geometry/virtual/runtime/REVIEW_LEDGER.md +241 -0
- package/src/shade/renderer/geometry/virtual/runtime/RUNTIME_PLAN.md +574 -0
- package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts +120 -0
- package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.js +674 -0
- package/src/shade/renderer/geometry/virtual/runtime/VGeoRuntimeTables.d.ts +287 -0
- package/src/shade/renderer/geometry/virtual/runtime/VGeoRuntimeTables.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/VGeoRuntimeTables.js +976 -0
- package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts +42 -0
- package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.js +96 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_FLAG_CULL.d.ts +16 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_FLAG_CULL.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_FLAG_CULL.js +15 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.d.ts +19 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.js +83 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_WORKGROUP_SIZE.d.ts +9 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_WORKGROUP_SIZE.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_WORKGROUP_SIZE.js +8 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.d.ts +19 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js +160 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.d.ts +3 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js +255 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_queue_prepare.d.ts +3 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_queue_prepare.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_queue_prepare.js +80 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_seed.d.ts +3 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_seed.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_seed.js +144 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.d.ts +3 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.js +530 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/vgeo_cut_feedback_layout.d.ts +39 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/vgeo_cut_feedback_layout.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/cut/vgeo_cut_feedback_layout.js +54 -0
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_if_enabled.d.ts +41 -0
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_if_enabled.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_if_enabled.js +56 -0
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts +49 -0
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +328 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_OFFSET.d.ts +10 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_OFFSET.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_OFFSET.js +51 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_WORDS.d.ts +13 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_WORDS.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_WORDS.js +12 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT.d.ts +17 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT.js +99 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT_COUNT.d.ts +9 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT_COUNT.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT_COUNT.js +8 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_FEEDBACK_OFFSET.d.ts +7 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_FEEDBACK_OFFSET.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_FEEDBACK_OFFSET.js +27 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_NONE.d.ts +14 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_NONE.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_NONE.js +13 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_OFFSET.d.ts +7 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_OFFSET.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_OFFSET.js +35 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_WORDS.d.ts +9 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_WORDS.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_WORDS.js +8 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_FLAG_SELECTABLE.d.ts +15 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_FLAG_SELECTABLE.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_FLAG_SELECTABLE.js +14 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_OFFSET.d.ts +7 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_OFFSET.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_OFFSET.js +36 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_WORDS.d.ts +10 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_WORDS.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_WORDS.js +9 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.d.ts +11 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.js +54 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_WORDS.d.ts +9 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_WORDS.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_WORDS.js +8 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_LEAF_BIT.d.ts +11 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_LEAF_BIT.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_LEAF_BIT.js +10 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_OFFSET.d.ts +7 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_OFFSET.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_OFFSET.js +30 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_WORDS.d.ts +9 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_WORDS.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_WORDS.js +8 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NO_CHILD_PAGE.d.ts +13 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NO_CHILD_PAGE.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NO_CHILD_PAGE.js +12 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_NONE.d.ts +14 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_NONE.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_NONE.js +13 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_OFFSET.d.ts +11 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_OFFSET.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_OFFSET.js +61 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_WORDS.d.ts +9 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_WORDS.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_WORDS.js +8 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_ITEM_WORDS.d.ts +13 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_ITEM_WORDS.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_ITEM_WORDS.js +12 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_TARGET_GROUP_BIT.d.ts +9 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_TARGET_GROUP_BIT.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_TARGET_GROUP_BIT.js +8 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_WANT_WORDS.d.ts +20 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_WANT_WORDS.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_WANT_WORDS.js +19 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_meshlet_batch.d.ts +23 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_meshlet_batch.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_meshlet_batch.js +70 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_block_words.d.ts +18 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_block_words.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_block_words.js +25 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_slot_words.d.ts +35 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_slot_words.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_slot_words.js +41 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_write_page_block.d.ts +32 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_write_page_block.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_write_page_block.js +138 -0
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +9 -0
- package/src/shade/renderer/rasterize/fast/graph_rasterize_scene_fast.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/fast/graph_rasterize_scene_fast.js +12 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.js +12 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.js +10 -0
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +18 -0
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +647 -594
- package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts.map +1 -1
- package/src/shade/renderer/scene/rows/GPUSceneRows.js +22 -0
- package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.d.ts +35 -0
- package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.js +91 -0
- package/src/engine/graphics3/instantiate_scene_bundle.d.ts +0 -54
- package/src/engine/graphics3/instantiate_scene_bundle.d.ts.map +0 -1
- package/src/engine/graphics3/shade_node_to_entity_composition.d.ts +0 -39
- package/src/engine/graphics3/shade_node_to_entity_composition.d.ts.map +0 -1
- package/src/shade/renderer/animation/compute_skin_world_bounds.d.ts +0 -35
- package/src/shade/renderer/animation/compute_skin_world_bounds.d.ts.map +0 -1
- package/src/shade/renderer/animation/compute_skinned_mesh_clip_bounding_sphere.d.ts +0 -96
- package/src/shade/renderer/animation/compute_skinned_mesh_clip_bounding_sphere.d.ts.map +0 -1
- package/src/shade/renderer/animation/pose/pose_evaluate_world.d.ts +0 -20
- package/src/shade/renderer/animation/pose/pose_evaluate_world.d.ts.map +0 -1
- package/src/shade/renderer/animation/skin_bind_transform.d.ts +0 -25
- package/src/shade/renderer/animation/skin_bind_transform.d.ts.map +0 -1
- package/src/shade/renderer/animation/skin_frame_defect.d.ts +0 -34
- package/src/shade/renderer/animation/skin_frame_defect.d.ts.map +0 -1
- package/src/shade/renderer/animation/skin_joint_matrix.d.ts +0 -24
- package/src/shade/renderer/animation/skin_joint_matrix.d.ts.map +0 -1
- package/src/shade/renderer/animation/skin_normalize_mesh_frame.d.ts +0 -70
- package/src/shade/renderer/animation/skin_normalize_mesh_frame.d.ts.map +0 -1
- package/src/shade/renderer/buffer/table/GPUReadbackStagingRing.d.ts +0 -96
- package/src/shade/renderer/buffer/table/GPUReadbackStagingRing.d.ts.map +0 -1
- package/src/shade/renderer/scene/InstanceBatch.d.ts +0 -92
- package/src/shade/renderer/scene/InstanceBatch.d.ts.map +0 -1
- package/src/shade/renderer/scene/Mesh.d.ts +0 -55
- package/src/shade/renderer/scene/Mesh.d.ts.map +0 -1
- package/src/shade/renderer/scene/Node3D.d.ts +0 -159
- package/src/shade/renderer/scene/Node3D.d.ts.map +0 -1
- package/src/shade/renderer/scene/Node3DDirtyList.d.ts +0 -59
- package/src/shade/renderer/scene/Node3DDirtyList.d.ts.map +0 -1
- package/src/shade/renderer/scene/SceneNodeBinding.d.ts +0 -52
- package/src/shade/renderer/scene/SceneNodeBinding.d.ts.map +0 -1
- package/src/shade/renderer/scene/SkinnedMesh.d.ts +0 -27
- package/src/shade/renderer/scene/SkinnedMesh.d.ts.map +0 -1
- package/src/shade/renderer/scene/TransformAuthority.d.ts +0 -19
- package/src/shade/renderer/scene/TransformAuthority.d.ts.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker-side logic for {@link WorkerClothSystem}: holds one {@link ClothState}
|
|
3
|
+
* view per registered cloth and steps the ones the main thread nominates.
|
|
4
|
+
*
|
|
5
|
+
* The states are not copies. Each is a {@link ClothState} whose views are cut
|
|
6
|
+
* over the very memory the main thread's `ClothInstance` holds, so a step
|
|
7
|
+
* mutates that cloth in place and there is nothing to send back — the result is
|
|
8
|
+
* published by the {@link SystemWorkerHost} advancing `DONE`, and the three
|
|
9
|
+
* scalars a caller needs from a step are in the buffer too
|
|
10
|
+
* (`ClothState#result`).
|
|
11
|
+
*
|
|
12
|
+
* The exclusion set travels with the registration and *is* copied, because it is
|
|
13
|
+
* the one thing here that the step only reads: built once from the row tables
|
|
14
|
+
* when the cloth seeds, replaced by a re-seed, and never written by either side.
|
|
15
|
+
* A shared buffer for it would buy nothing and cost a region.
|
|
16
|
+
*
|
|
17
|
+
* Deliberately free of worker globals (`self`, `postMessage`, `Worker`) so it is
|
|
18
|
+
* ordinary node-testable code; {@link SystemWorkerHost} owns everything that
|
|
19
|
+
* needs a real worker.
|
|
20
|
+
*
|
|
21
|
+
* @author Alex Goldring
|
|
22
|
+
* @copyright Company Named Limited (c) 2026
|
|
23
|
+
*/
|
|
24
|
+
export class ClothWorkerCore {
|
|
25
|
+
/**
|
|
26
|
+
* @param {*} data
|
|
27
|
+
*/
|
|
28
|
+
handleMessage(data: any): void;
|
|
29
|
+
/**
|
|
30
|
+
* @returns {number} how many cloths are currently registered
|
|
31
|
+
*/
|
|
32
|
+
get cloth_count(): number;
|
|
33
|
+
/**
|
|
34
|
+
* @param {number} id
|
|
35
|
+
* @returns {ClothState|undefined} the worker's view of that cloth
|
|
36
|
+
*/
|
|
37
|
+
stateOf(id: number): ClothState | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Step every cloth the main thread nominated for this tick.
|
|
40
|
+
*
|
|
41
|
+
* @param {number} tick
|
|
42
|
+
* @param {Float64Array} command
|
|
43
|
+
*/
|
|
44
|
+
step(tick: number, command: Float64Array): void;
|
|
45
|
+
#private;
|
|
46
|
+
}
|
|
47
|
+
import { ClothState } from "../solver/ClothState.js";
|
|
48
|
+
//# sourceMappingURL=ClothWorkerCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClothWorkerCore.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/ClothWorkerCore.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAQI;;OAEG;IACH,+BAiBC;IAED;;OAEG;IACH,0BAEC;IAED;;;OAGG;IACH,YAHW,MAAM,GACJ,UAAU,GAAC,SAAS,CAMhC;IAED;;;;;OAKG;IACH,WAHW,MAAM,WACN,YAAY,QA2BtB;;CACJ;2BA1G0B,yBAAyB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ClothState } from "../solver/ClothState.js";
|
|
2
|
+
import { ClothStepParam, cloth_step_instance } from "../solver/cloth_step_instance.js";
|
|
3
|
+
import { ClothCommand, cloth_command_offset } from "./cloth_worker_protocol.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Worker-side logic for {@link WorkerClothSystem}: holds one {@link ClothState}
|
|
7
|
+
* view per registered cloth and steps the ones the main thread nominates.
|
|
8
|
+
*
|
|
9
|
+
* The states are not copies. Each is a {@link ClothState} whose views are cut
|
|
10
|
+
* over the very memory the main thread's `ClothInstance` holds, so a step
|
|
11
|
+
* mutates that cloth in place and there is nothing to send back — the result is
|
|
12
|
+
* published by the {@link SystemWorkerHost} advancing `DONE`, and the three
|
|
13
|
+
* scalars a caller needs from a step are in the buffer too
|
|
14
|
+
* (`ClothState#result`).
|
|
15
|
+
*
|
|
16
|
+
* The exclusion set travels with the registration and *is* copied, because it is
|
|
17
|
+
* the one thing here that the step only reads: built once from the row tables
|
|
18
|
+
* when the cloth seeds, replaced by a re-seed, and never written by either side.
|
|
19
|
+
* A shared buffer for it would buy nothing and cost a region.
|
|
20
|
+
*
|
|
21
|
+
* Deliberately free of worker globals (`self`, `postMessage`, `Worker`) so it is
|
|
22
|
+
* ordinary node-testable code; {@link SystemWorkerHost} owns everything that
|
|
23
|
+
* needs a real worker.
|
|
24
|
+
*
|
|
25
|
+
* @author Alex Goldring
|
|
26
|
+
* @copyright Company Named Limited (c) 2026
|
|
27
|
+
*/
|
|
28
|
+
export class ClothWorkerCore {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Registered cloths by id, populated over the cold plane.
|
|
32
|
+
* @type {Map<number, {state: ClothState, exclusions: {offset: Int32Array, partner: Int32Array}}>}
|
|
33
|
+
*/
|
|
34
|
+
#cloths = new Map();
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param {*} data
|
|
38
|
+
*/
|
|
39
|
+
handleMessage(data) {
|
|
40
|
+
if (data.type === "add_cloth") {
|
|
41
|
+
this.#cloths.set(data.id, {
|
|
42
|
+
state: ClothState.fromSharedDescriptor(data.state),
|
|
43
|
+
exclusions: data.self_exclusions
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (data.type === "remove_cloth") {
|
|
50
|
+
this.#cloths.delete(data.id);
|
|
51
|
+
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
throw new Error(`ClothWorkerCore: unknown message type '${data.type}'`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @returns {number} how many cloths are currently registered
|
|
60
|
+
*/
|
|
61
|
+
get cloth_count() {
|
|
62
|
+
return this.#cloths.size;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @param {number} id
|
|
67
|
+
* @returns {ClothState|undefined} the worker's view of that cloth
|
|
68
|
+
*/
|
|
69
|
+
stateOf(id) {
|
|
70
|
+
const entry = this.#cloths.get(id);
|
|
71
|
+
|
|
72
|
+
return entry === undefined ? undefined : entry.state;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Step every cloth the main thread nominated for this tick.
|
|
77
|
+
*
|
|
78
|
+
* @param {number} tick
|
|
79
|
+
* @param {Float64Array} command
|
|
80
|
+
*/
|
|
81
|
+
step(tick, command) {
|
|
82
|
+
const cloth_count = command[ClothCommand.CLOTH_COUNT];
|
|
83
|
+
|
|
84
|
+
for (let i = 0; i < cloth_count; i++) {
|
|
85
|
+
const offset = cloth_command_offset(i);
|
|
86
|
+
|
|
87
|
+
const entry = this.#cloths.get(command[offset + ClothStepParam.ID]);
|
|
88
|
+
|
|
89
|
+
if (entry === undefined) {
|
|
90
|
+
// The cloth was removed — or re-seeded, which retires its id —
|
|
91
|
+
// after this step was dispatched. An ordinary despawn or a
|
|
92
|
+
// structure change, not a protocol error: `remove_cloth` travels
|
|
93
|
+
// on the cold plane and can be delivered before the pump runs a
|
|
94
|
+
// step that was published earlier.
|
|
95
|
+
//
|
|
96
|
+
// Skipping is correct, because the main thread drops a cloth
|
|
97
|
+
// from the nomination list the moment it unlinks and never joins
|
|
98
|
+
// a result it did not nominate. Throwing here instead would fail
|
|
99
|
+
// the whole bridge — and with it every other cloth in the scene
|
|
100
|
+
// — every time a garment is despawned at the wrong moment.
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
cloth_step_instance(entry.state, entry.exclusions, command, offset);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Every cloth in a scene, and everything a step needs that is not arithmetic
|
|
3
|
+
*
|
|
4
|
+
* One {@link ClothInstance} per {@link Cloth} component, stepped at the fixed
|
|
5
|
+
* rate. Per step, per cloth: move the local frame with the anchor, point the
|
|
6
|
+
* leash rows at where they measure from, gather the colliders that could touch
|
|
7
|
+
* it, step, and put the result back on the subtree. The animated pose the
|
|
8
|
+
* leashes are measured against is not recomposed per step — in the entity path
|
|
9
|
+
* it is constant in the anchor's own frame, and `cloth_seed_subtree.js` bakes
|
|
10
|
+
* it.
|
|
11
|
+
*
|
|
12
|
+
* ## Why this is not a `System`
|
|
13
|
+
*
|
|
14
|
+
* Because two of them drive it. {@link ClothSystem} steps every cloth inline;
|
|
15
|
+
* {@link WorkerClothSystem} hands the arithmetic to a worker and joins it on the
|
|
16
|
+
* next tick. §12 asks those two to produce **bit-identical** results, and the
|
|
17
|
+
* cheapest way to be sure of that is for there to be one copy of everything
|
|
18
|
+
* except the dispatch — so the registry, the seeding, the frame handling, the
|
|
19
|
+
* broadphase and the write-back live here, and the two systems differ only in
|
|
20
|
+
* where {@link ClothWorld#prepare} and {@link ClothWorld#finish} are separated
|
|
21
|
+
* by a thread.
|
|
22
|
+
*
|
|
23
|
+
* That split is also exactly §12's: "arbitrary user-facing work — component
|
|
24
|
+
* reads, `Transform64` sync, index queries — stays on the main thread; the pure
|
|
25
|
+
* numeric step crosses". {@link ensure_seeded} and {@link advance} are the first
|
|
26
|
+
* half, `cloth_step_instance` is the second, {@link finish} is what the result
|
|
27
|
+
* is worth.
|
|
28
|
+
*
|
|
29
|
+
* Seeding is its own call rather than the top of {@link advance} because the
|
|
30
|
+
* worker needs to get between them: a cloth's `ClothState` is what it registers
|
|
31
|
+
* with the worker, so it has to exist — and be acknowledged — before the cloth
|
|
32
|
+
* can be nominated for a step, and a re-seed replaces it and starts that again.
|
|
33
|
+
*
|
|
34
|
+
* ## The parameter block
|
|
35
|
+
*
|
|
36
|
+
* {@link prepare} does not call the step and does not return its arguments; it
|
|
37
|
+
* **writes them into a `Float64` block** the caller supplies. For
|
|
38
|
+
* {@link ClothSystem} that block is a private scratch array and the step follows
|
|
39
|
+
* immediately; for {@link WorkerClothSystem} it is a slice of the shared command
|
|
40
|
+
* region and the step happens on another thread. Neither system ever computes a
|
|
41
|
+
* step parameter of its own, so neither can compute one differently.
|
|
42
|
+
*
|
|
43
|
+
* ## The local frame and the inertia model — §7 P7
|
|
44
|
+
*
|
|
45
|
+
* Particles live in the anchor's own frame. When the anchor moves, the cloth is
|
|
46
|
+
* asked how much of that motion it would like to feel:
|
|
47
|
+
* `ClothDynamics#inertia = 1` keeps every particle's **world** position and
|
|
48
|
+
* velocity, so a cape trails a sprinting character; `0` keeps their **local**
|
|
49
|
+
* ones, so the cloth rides the anchor as though it were standing still. The
|
|
50
|
+
* blend between the two is a lerp in the local frame, which is all the frame
|
|
51
|
+
* change is.
|
|
52
|
+
*
|
|
53
|
+
* The felt motion is limited before the blend, which is what makes "character
|
|
54
|
+
* sprints, cape behaves" a default rather than a tuning exercise, and the limits
|
|
55
|
+
* are derived from the cloth's own reach rather than authored.
|
|
56
|
+
*
|
|
57
|
+
* ## The wind — §10
|
|
58
|
+
*
|
|
59
|
+
* {@link wind} is a source of air and {@link advance} samples it into the
|
|
60
|
+
* cloth's own buffer, once per particle per step. That is the one piece of M6
|
|
61
|
+
* that stays on this thread: a fluid field is an ECS component holding a
|
|
62
|
+
* hundred thousand floats that its own solver rewrites every step, and the
|
|
63
|
+
* *answer* is three floats a particle. `cloth_sample_air.js` carries the
|
|
64
|
+
* decision; the aerodynamic arithmetic built on top of it lives in
|
|
65
|
+
* `cloth_step_instance` with everything else the budget is spent on.
|
|
66
|
+
*
|
|
67
|
+
* A source is optional and additive, like the collider index. With none, the
|
|
68
|
+
* step's drag response is zero, `cloth_step` takes the uniform-gravity path,
|
|
69
|
+
* and a scene produces the bytes M5 measured.
|
|
70
|
+
*
|
|
71
|
+
* ## Teleport — §7 P6
|
|
72
|
+
*
|
|
73
|
+
* Anchor motion past a threshold is not locomotion and is not treated as any
|
|
74
|
+
* amount of it. `ClothFlags.TeleportKeep` carries the shape across, which in a
|
|
75
|
+
* local frame is literally doing nothing; the default re-seeds at the animated
|
|
76
|
+
* pose with zero velocity and opens a stabilisation window in which the
|
|
77
|
+
* velocity limit ramps back from nothing, so the first steps after a reset
|
|
78
|
+
* cannot produce a whip.
|
|
79
|
+
*
|
|
80
|
+
* @author Alex Goldring
|
|
81
|
+
* @copyright Company Named Limited (c) 2026
|
|
82
|
+
*/
|
|
83
|
+
export class ClothWorld {
|
|
84
|
+
/**
|
|
85
|
+
* World gravity, m/s². Rotated into each cloth's local frame per step.
|
|
86
|
+
* @type {Float64Array}
|
|
87
|
+
*/
|
|
88
|
+
gravity: Float64Array;
|
|
89
|
+
/**
|
|
90
|
+
* Live cloths, ordered so that an instance whose anchor sits inside another
|
|
91
|
+
* instance's subtree steps after it.
|
|
92
|
+
* @type {ClothInstance[]}
|
|
93
|
+
*/
|
|
94
|
+
instances: ClothInstance[];
|
|
95
|
+
/**
|
|
96
|
+
* Where a skinned model instance comes from. Anything that answers
|
|
97
|
+
* `instance_of(entity)` with a `PrefabInstance` — skins whose joints
|
|
98
|
+
* are entities — will do, and {@link MeshSystem} is what does in a
|
|
99
|
+
* running engine.
|
|
100
|
+
*
|
|
101
|
+
* Public and assignable because a garment's joints are a *rendering*
|
|
102
|
+
* structure and `MeshSystem` needs a graphics engine, a scene and a loader
|
|
103
|
+
* to exist — so a spec that wants joints without a renderer sets this
|
|
104
|
+
* instead, and gets exactly the interface the system uses.
|
|
105
|
+
*
|
|
106
|
+
* `null` means no rig can seed, which is the same additive shape the
|
|
107
|
+
* collider index has: a scene without one gets M1's cloth rather than an
|
|
108
|
+
* error.
|
|
109
|
+
* @type {{instance_of: function(number): (PrefabInstance|null)}|null}
|
|
110
|
+
*/
|
|
111
|
+
models: {
|
|
112
|
+
instance_of: (arg0: number) => (PrefabInstance | null);
|
|
113
|
+
} | null;
|
|
114
|
+
/**
|
|
115
|
+
* @type {EntityManager|null}
|
|
116
|
+
*/
|
|
117
|
+
entityManager: EntityManager | null;
|
|
118
|
+
/**
|
|
119
|
+
* @type {TransformAttachmentSystem|null}
|
|
120
|
+
*/
|
|
121
|
+
attachments: TransformAttachmentSystem | null;
|
|
122
|
+
/**
|
|
123
|
+
* The collider index's owner, or `null` when the manager has none — in
|
|
124
|
+
* which case cloth simply does not collide, which is exactly M1's
|
|
125
|
+
* behaviour and is what makes the collision layer additive rather than a
|
|
126
|
+
* new requirement on every scene.
|
|
127
|
+
* @type {ClothColliderSystem|null}
|
|
128
|
+
*/
|
|
129
|
+
colliders: ClothColliderSystem | null;
|
|
130
|
+
/**
|
|
131
|
+
* Where the air comes from — §10. `null` means no air, which is the
|
|
132
|
+
* default and is **additive** in exactly the way the collider index is: a
|
|
133
|
+
* scene without one gets M5's cloth rather than an error, and adding one is
|
|
134
|
+
* the whole of turning wind on.
|
|
135
|
+
*
|
|
136
|
+
* Null rather than a still-air ambient, and the distinction is real. A
|
|
137
|
+
* source that answers zero everywhere is not "no wind": the drag row is a
|
|
138
|
+
* relaxation toward the air, so still air still resists a *moving* cloth,
|
|
139
|
+
* with the normal-facing factor making that resistance anisotropic. That is
|
|
140
|
+
* better physics than `ClothDynamics#damping`'s isotropic decay and it is
|
|
141
|
+
* not free — so it is a thing a scene asks for. What a cloth does in air
|
|
142
|
+
* that is not moving is `damping`'s job (§7 P5, where it is load-bearing);
|
|
143
|
+
* what it does in air that *is* is this.
|
|
144
|
+
*
|
|
145
|
+
* Assign {@link ClothAmbientWind} for weather, {@link ClothFluidWind} to
|
|
146
|
+
* read the fluid simulation and fall back to weather outside it.
|
|
147
|
+
* @type {AbstractClothWind|null}
|
|
148
|
+
*/
|
|
149
|
+
wind: AbstractClothWind | null;
|
|
150
|
+
/**
|
|
151
|
+
* Seconds of fixed step this world has **stepped**, which is the clock a
|
|
152
|
+
* wind source's gust is a function of.
|
|
153
|
+
*
|
|
154
|
+
* Accumulated from `dt` rather than read from a wall clock, because
|
|
155
|
+
* {@link ClothSystem} and {@link WorkerClothSystem} share this object and
|
|
156
|
+
* §12's parity gate is over every byte of every step: two runs of the same
|
|
157
|
+
* scene have the same `dt` sequence and therefore the same weather.
|
|
158
|
+
*
|
|
159
|
+
* **Stepped rather than ticked**, and that distinction is load-bearing
|
|
160
|
+
* rather than pedantic. A cloth under the worker is not advanced until its
|
|
161
|
+
* registration is acknowledged (§39), so the two systems reach a cloth's
|
|
162
|
+
* *first* step at different tick counts — and a clock that counted ticks
|
|
163
|
+
* would hand that cloth a different gust on the same step under the two
|
|
164
|
+
* systems, which is a divergence the parity gate would report and the design
|
|
165
|
+
* would deserve. So the clock moves when {@link advance} first runs in a
|
|
166
|
+
* tick: the world's weather is a function of how much cloth time has
|
|
167
|
+
* passed, not of how long something has been asking.
|
|
168
|
+
* @type {number}
|
|
169
|
+
*/
|
|
170
|
+
time: number;
|
|
171
|
+
/**
|
|
172
|
+
* Fixed-step seconds this tick owes the clock, consumed by the first
|
|
173
|
+
* {@link advance} — see {@link time}. Zero once spent.
|
|
174
|
+
* @type {number}
|
|
175
|
+
* @private
|
|
176
|
+
*/
|
|
177
|
+
private __wind_pending;
|
|
178
|
+
/**
|
|
179
|
+
* Whether a cloth's {@link ClothState} must be backed by a
|
|
180
|
+
* `SharedArrayBuffer`. Stamped onto every instance as it is linked;
|
|
181
|
+
* {@link WorkerClothSystem} sets it, {@link ClothSystem} leaves it alone.
|
|
182
|
+
* @type {boolean}
|
|
183
|
+
*/
|
|
184
|
+
shared_state: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* @type {Map<number, ClothInstance>}
|
|
187
|
+
* @private
|
|
188
|
+
*/
|
|
189
|
+
private __by_entity;
|
|
190
|
+
/**
|
|
191
|
+
* @type {boolean}
|
|
192
|
+
* @private
|
|
193
|
+
*/
|
|
194
|
+
private __order_dirty;
|
|
195
|
+
/**
|
|
196
|
+
* Resolve the systems a cloth world reads. Called from the owning system's
|
|
197
|
+
* `startup`.
|
|
198
|
+
*
|
|
199
|
+
* @param {EntityManager} entityManager
|
|
200
|
+
*/
|
|
201
|
+
attach(entityManager: EntityManager): void;
|
|
202
|
+
/**
|
|
203
|
+
* @param {Cloth} cloth
|
|
204
|
+
* @param {Transform64} transform
|
|
205
|
+
* @param {number} entity
|
|
206
|
+
* @returns {ClothInstance}
|
|
207
|
+
*/
|
|
208
|
+
link(cloth: Cloth, transform: Transform64, entity: number): ClothInstance;
|
|
209
|
+
/**
|
|
210
|
+
* @param {number} entity
|
|
211
|
+
* @returns {ClothInstance|undefined} the instance that was removed
|
|
212
|
+
*/
|
|
213
|
+
unlink(entity: number): ClothInstance | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* Throw away a cloth's binding so the next step walks its subtree again.
|
|
216
|
+
*
|
|
217
|
+
* The walk is done once, because a rope's links do not come and go. When
|
|
218
|
+
* they do — a chain gains a link, a rig is rebuilt — this is how you say so,
|
|
219
|
+
* and it is the same contract `TransformAttachment#parent` already carries:
|
|
220
|
+
* the structure is immutable while it is attached, and changing it is an
|
|
221
|
+
* explicit act rather than something the engine polls for.
|
|
222
|
+
*
|
|
223
|
+
* @param {number} entity
|
|
224
|
+
* @returns {ClothInstance|undefined} the instance that will re-seed
|
|
225
|
+
*/
|
|
226
|
+
reseed(entity: number): ClothInstance | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* Wake a sleeping cloth. Anchor motion and a `ClothDynamics` change do this
|
|
229
|
+
* on their own; a caller that has changed the world in some way the cloth
|
|
230
|
+
* cannot see — M6's wind, for one — says so here.
|
|
231
|
+
*
|
|
232
|
+
* @param {number} entity
|
|
233
|
+
* @returns {void}
|
|
234
|
+
*/
|
|
235
|
+
wake(entity: number): void;
|
|
236
|
+
/**
|
|
237
|
+
* @param {number} entity
|
|
238
|
+
* @returns {ClothInstance|undefined}
|
|
239
|
+
*/
|
|
240
|
+
instanceOf(entity: number): ClothInstance | undefined;
|
|
241
|
+
/**
|
|
242
|
+
* Everything that happens once per tick rather than once per cloth.
|
|
243
|
+
*
|
|
244
|
+
* @param {EntityComponentDataset} ecd
|
|
245
|
+
* @param {number} dt seconds
|
|
246
|
+
*/
|
|
247
|
+
begin(ecd: EntityComponentDataset, dt: number): void;
|
|
248
|
+
/**
|
|
249
|
+
* Make sure this cloth has a `ClothState` that matches its current
|
|
250
|
+
* `ClothDynamics`, seeding or re-seeding it if not.
|
|
251
|
+
*
|
|
252
|
+
* @param {ClothInstance} instance
|
|
253
|
+
* @param {EntityComponentDataset} ecd
|
|
254
|
+
* @param {number} dt seconds
|
|
255
|
+
* @returns {boolean} whether the cloth is ready to be stepped — `false` for
|
|
256
|
+
* one that has been refused, or a rig whose model has not loaded yet
|
|
257
|
+
*/
|
|
258
|
+
ensure_seeded(instance: ClothInstance, ecd: EntityComponentDataset, dt: number): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* Take what the step produced: the sleep test, and the pose onto whichever
|
|
261
|
+
* hierarchy this cloth was built on.
|
|
262
|
+
*
|
|
263
|
+
* @param {ClothInstance} instance
|
|
264
|
+
* @param {EntityComponentDataset} ecd
|
|
265
|
+
* @returns {void}
|
|
266
|
+
*/
|
|
267
|
+
finish(instance: ClothInstance, ecd: EntityComponentDataset): void;
|
|
268
|
+
/**
|
|
269
|
+
* Carry one seeded cloth to the edge of its step and write the parameters
|
|
270
|
+
* the step will run on: whatever the anchor did to the local frame, where
|
|
271
|
+
* the leash rows measure from, and the colliders within reach.
|
|
272
|
+
*
|
|
273
|
+
* @param {ClothInstance} instance
|
|
274
|
+
* @param {number} dt seconds
|
|
275
|
+
* @param {Float64Array} params
|
|
276
|
+
* @param {number} offset first word of this cloth's block in `params`
|
|
277
|
+
* @returns {boolean} whether the cloth should be stepped — `false` for one
|
|
278
|
+
* that is asleep, and then nothing has been written to `params`
|
|
279
|
+
*/
|
|
280
|
+
advance(instance: ClothInstance, dt: number, params: Float64Array, offset: number): boolean;
|
|
281
|
+
#private;
|
|
282
|
+
}
|
|
283
|
+
import { ClothInstance } from "./ClothInstance.js";
|
|
284
|
+
import { TransformAttachmentSystem } from "../../../ecs/transform-attachment/TransformAttachmentSystem.js";
|
|
285
|
+
import { ClothColliderSystem } from "./ClothColliderSystem.js";
|
|
286
|
+
//# sourceMappingURL=ClothWorld.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClothWorld.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/ecs/ClothWorld.js"],"names":[],"mappings":"AAsDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH;IAEI;;;OAGG;IACH,SAFU,YAAY,CAEoB;IAE1C;;;;OAIG;IACH,WAFU,aAAa,EAAE,CAEV;IAEf;;;;;;;;;;;;;;;OAeG;IACH,QAFU;QAAC,WAAW,SAAW,MAAM,KAAG,CAAC,iBAAe,IAAI,CAAC,CAAA;KAAC,GAAC,IAAI,CAEvD;IAEd;;OAEG;IACH,eAFU,gBAAc,IAAI,CAEP;IAErB;;OAEG;IACH,aAFU,yBAAyB,GAAC,IAAI,CAErB;IAEnB;;;;;;OAMG;IACH,WAFU,mBAAmB,GAAC,IAAI,CAEjB;IAEjB;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAFU,oBAAkB,IAAI,CAEpB;IAEZ;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAFU,MAAM,CAEP;IAET;;;;;OAKG;IACH,uBAAmB;IAEnB;;;;;OAKG;IACH,cAFU,OAAO,CAEI;IAErB;;;OAGG;IACH,oBAAwB;IAExB;;;OAGG;IACH,sBAAsB;IAEtB;;;;;OAKG;IACH,2CAiBC;IAED;;;;;OAKG;IACH,mDAHW,MAAM,GACJ,aAAa,CAgBzB;IAED;;;OAGG;IACH,eAHW,MAAM,GACJ,aAAa,GAAC,SAAS,CAkBnC;IAED;;;;;;;;;;;OAWG;IACH,eAHW,MAAM,GACJ,aAAa,GAAC,SAAS,CAenC;IAED;;;;;;;OAOG;IACH,aAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;OAGG;IACH,mBAHW,MAAM,GACJ,aAAa,GAAC,SAAS,CAInC;IAED;;;;;OAKG;IACH,uCAFW,MAAM,QAoBhB;IAED;;;;;;;;;OASG;IACH,wBANW,aAAa,mCAEb,MAAM,GACJ,OAAO,CA8BnB;IAED;;;;;;;OAOG;IACH,iBAJW,aAAa,gCAEX,IAAI,CA6BhB;IAmHD;;;;;;;;;;;OAWG;IACH,kBAPW,aAAa,MACb,MAAM,UACN,YAAY,UACZ,MAAM,GACJ,OAAO,CA+NnB;;CA8EJ;8BA92B6B,oBAAoB;0CAjB3C,gEAAgE;oCAcnC,0BAA0B"}
|