@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,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Where the air comes from — one interface, two answers
|
|
3
|
+
*
|
|
4
|
+
* §10's design in one sentence: this engine has something better than a wind
|
|
5
|
+
* zone, so cloth should **sample** the air rather than invent it. Two things can
|
|
6
|
+
* answer "how fast is the air at this point": a running fluid simulation
|
|
7
|
+
* ({@link ClothFluidWind}), and an ambient model for everywhere a simulation is
|
|
8
|
+
* not ({@link ClothAmbientWind}). §10 asks for both to be read "through *the
|
|
9
|
+
* same interface*, so the cloth code has one path and does not branch on whether
|
|
10
|
+
* a simulation is present", and this is that interface.
|
|
11
|
+
*
|
|
12
|
+
* It is two questions rather than one, and the second is what makes the feature
|
|
13
|
+
* affordable:
|
|
14
|
+
*
|
|
15
|
+
* - {@link sample} answers the air's **world** velocity at a world point, in
|
|
16
|
+
* metres per second.
|
|
17
|
+
* - {@link varies} answers whether it is worth asking {@link sample} more than
|
|
18
|
+
* once for a given box. An ambient source answers `false` for every box and a
|
|
19
|
+
* whole garment costs one sample; a fluid source answers `true` only where one
|
|
20
|
+
* of its fields actually reaches, which is §10's "a cloth outside every fluid
|
|
21
|
+
* field's bounds skips it entirely" expressed as a question the cloth can ask.
|
|
22
|
+
*
|
|
23
|
+
* ## Determinism, because two systems share one of these
|
|
24
|
+
*
|
|
25
|
+
* `ClothSystem` and `WorkerClothSystem` share a {@link ClothWorld} and therefore
|
|
26
|
+
* share its wind source, and §12's bit-parity gate is over the whole
|
|
27
|
+
* `ClothState` buffer at every step. The air is sampled **once**, by the world,
|
|
28
|
+
* into that buffer — so the two systems do not agree about the wind, they read
|
|
29
|
+
* the same bytes of it. What this interface has to promise is only that
|
|
30
|
+
* {@link sample} is a pure function of ({@link begin}'s `time`, the point), with
|
|
31
|
+
* no wall clock and no random source: a gust that consulted `Date.now()` would
|
|
32
|
+
* make two runs of the same scene differ and would take the parity spec's
|
|
33
|
+
* guarantee with it.
|
|
34
|
+
*
|
|
35
|
+
* @author Alex Goldring
|
|
36
|
+
* @copyright Company Named Limited (c) 2026
|
|
37
|
+
*/
|
|
38
|
+
export class AbstractClothWind {
|
|
39
|
+
/**
|
|
40
|
+
* Called once per fixed step, before any cloth is advanced, so a source that
|
|
41
|
+
* moves with time or with the scene can refresh itself once rather than once
|
|
42
|
+
* a cloth.
|
|
43
|
+
*
|
|
44
|
+
* `time` is the cloth world's own accumulated fixed-step clock rather than a
|
|
45
|
+
* wall clock, which is what keeps a gust reproducible — see the note above.
|
|
46
|
+
*
|
|
47
|
+
* @param {number} time seconds since the cloth world started stepping
|
|
48
|
+
* @param {EntityComponentDataset} ecd for a source that reads components
|
|
49
|
+
* @returns {void}
|
|
50
|
+
*/
|
|
51
|
+
begin(time: number, ecd: EntityComponentDataset): void;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the air could differ from point to point inside this box — and so
|
|
54
|
+
* whether a caller has to sample per particle instead of once.
|
|
55
|
+
*
|
|
56
|
+
* Answering `false` is a promise rather than a hint: the caller will sample
|
|
57
|
+
* one point and apply the answer to every particle of the cloth.
|
|
58
|
+
*
|
|
59
|
+
* @param {number} min_x world-space, metres
|
|
60
|
+
* @param {number} min_y
|
|
61
|
+
* @param {number} min_z
|
|
62
|
+
* @param {number} max_x
|
|
63
|
+
* @param {number} max_y
|
|
64
|
+
* @param {number} max_z
|
|
65
|
+
* @returns {boolean}
|
|
66
|
+
*/
|
|
67
|
+
varies(min_x: number, min_y: number, min_z: number, max_x: number, max_y: number, max_z: number): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The air's velocity at a world point, **metres per second**.
|
|
70
|
+
*
|
|
71
|
+
* The units are worth stating because the field this is most often reading
|
|
72
|
+
* does not use them: `FluidField#sampleVelocity` answers in *grid cells* per
|
|
73
|
+
* second and documents that it deliberately does not rescale, on the
|
|
74
|
+
* assumption that its callers want a direction times a magnitude. Cloth is
|
|
75
|
+
* not such a caller — its drag row is an acceleration toward a velocity, and
|
|
76
|
+
* a velocity in cells is a garment that blows differently depending on how
|
|
77
|
+
* finely someone voxelised the room. {@link ClothFluidWind} multiplies by
|
|
78
|
+
* `cell_size`. `MEASUREMENTS.md` §45.
|
|
79
|
+
*
|
|
80
|
+
* @param {Float64Array|number[]} out length 3
|
|
81
|
+
* @param {number} x world-space, metres
|
|
82
|
+
* @param {number} y
|
|
83
|
+
* @param {number} z
|
|
84
|
+
* @returns {Float64Array|number[]} `out`, for chaining
|
|
85
|
+
*/
|
|
86
|
+
sample(out: Float64Array | number[], x: number, y: number, z: number): Float64Array | number[];
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=AbstractClothWind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractClothWind.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/wind/AbstractClothWind.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH;IAEI;;;;;;;;;;;OAWG;IACH,YAJW,MAAM,gCAEJ,IAAI,CAIhB;IAED;;;;;;;;;;;;;;OAcG;IACH,cARW,MAAM,SACN,MAAM,SACN,MAAM,SACN,MAAM,SACN,MAAM,SACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,YANW,YAAY,GAAC,MAAM,EAAE,KACrB,MAAM,KACN,MAAM,KACN,MAAM,GACJ,YAAY,GAAC,MAAM,EAAE,CAQjC;CACJ"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Where the air comes from — one interface, two answers
|
|
3
|
+
*
|
|
4
|
+
* §10's design in one sentence: this engine has something better than a wind
|
|
5
|
+
* zone, so cloth should **sample** the air rather than invent it. Two things can
|
|
6
|
+
* answer "how fast is the air at this point": a running fluid simulation
|
|
7
|
+
* ({@link ClothFluidWind}), and an ambient model for everywhere a simulation is
|
|
8
|
+
* not ({@link ClothAmbientWind}). §10 asks for both to be read "through *the
|
|
9
|
+
* same interface*, so the cloth code has one path and does not branch on whether
|
|
10
|
+
* a simulation is present", and this is that interface.
|
|
11
|
+
*
|
|
12
|
+
* It is two questions rather than one, and the second is what makes the feature
|
|
13
|
+
* affordable:
|
|
14
|
+
*
|
|
15
|
+
* - {@link sample} answers the air's **world** velocity at a world point, in
|
|
16
|
+
* metres per second.
|
|
17
|
+
* - {@link varies} answers whether it is worth asking {@link sample} more than
|
|
18
|
+
* once for a given box. An ambient source answers `false` for every box and a
|
|
19
|
+
* whole garment costs one sample; a fluid source answers `true` only where one
|
|
20
|
+
* of its fields actually reaches, which is §10's "a cloth outside every fluid
|
|
21
|
+
* field's bounds skips it entirely" expressed as a question the cloth can ask.
|
|
22
|
+
*
|
|
23
|
+
* ## Determinism, because two systems share one of these
|
|
24
|
+
*
|
|
25
|
+
* `ClothSystem` and `WorkerClothSystem` share a {@link ClothWorld} and therefore
|
|
26
|
+
* share its wind source, and §12's bit-parity gate is over the whole
|
|
27
|
+
* `ClothState` buffer at every step. The air is sampled **once**, by the world,
|
|
28
|
+
* into that buffer — so the two systems do not agree about the wind, they read
|
|
29
|
+
* the same bytes of it. What this interface has to promise is only that
|
|
30
|
+
* {@link sample} is a pure function of ({@link begin}'s `time`, the point), with
|
|
31
|
+
* no wall clock and no random source: a gust that consulted `Date.now()` would
|
|
32
|
+
* make two runs of the same scene differ and would take the parity spec's
|
|
33
|
+
* guarantee with it.
|
|
34
|
+
*
|
|
35
|
+
* @author Alex Goldring
|
|
36
|
+
* @copyright Company Named Limited (c) 2026
|
|
37
|
+
*/
|
|
38
|
+
export class AbstractClothWind {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Called once per fixed step, before any cloth is advanced, so a source that
|
|
42
|
+
* moves with time or with the scene can refresh itself once rather than once
|
|
43
|
+
* a cloth.
|
|
44
|
+
*
|
|
45
|
+
* `time` is the cloth world's own accumulated fixed-step clock rather than a
|
|
46
|
+
* wall clock, which is what keeps a gust reproducible — see the note above.
|
|
47
|
+
*
|
|
48
|
+
* @param {number} time seconds since the cloth world started stepping
|
|
49
|
+
* @param {EntityComponentDataset} ecd for a source that reads components
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
begin(time, ecd) {
|
|
53
|
+
// A constant atmosphere has nothing to refresh.
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Whether the air could differ from point to point inside this box — and so
|
|
58
|
+
* whether a caller has to sample per particle instead of once.
|
|
59
|
+
*
|
|
60
|
+
* Answering `false` is a promise rather than a hint: the caller will sample
|
|
61
|
+
* one point and apply the answer to every particle of the cloth.
|
|
62
|
+
*
|
|
63
|
+
* @param {number} min_x world-space, metres
|
|
64
|
+
* @param {number} min_y
|
|
65
|
+
* @param {number} min_z
|
|
66
|
+
* @param {number} max_x
|
|
67
|
+
* @param {number} max_y
|
|
68
|
+
* @param {number} max_z
|
|
69
|
+
* @returns {boolean}
|
|
70
|
+
*/
|
|
71
|
+
varies(min_x, min_y, min_z, max_x, max_y, max_z) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The air's velocity at a world point, **metres per second**.
|
|
77
|
+
*
|
|
78
|
+
* The units are worth stating because the field this is most often reading
|
|
79
|
+
* does not use them: `FluidField#sampleVelocity` answers in *grid cells* per
|
|
80
|
+
* second and documents that it deliberately does not rescale, on the
|
|
81
|
+
* assumption that its callers want a direction times a magnitude. Cloth is
|
|
82
|
+
* not such a caller — its drag row is an acceleration toward a velocity, and
|
|
83
|
+
* a velocity in cells is a garment that blows differently depending on how
|
|
84
|
+
* finely someone voxelised the room. {@link ClothFluidWind} multiplies by
|
|
85
|
+
* `cell_size`. `MEASUREMENTS.md` §45.
|
|
86
|
+
*
|
|
87
|
+
* @param {Float64Array|number[]} out length 3
|
|
88
|
+
* @param {number} x world-space, metres
|
|
89
|
+
* @param {number} y
|
|
90
|
+
* @param {number} z
|
|
91
|
+
* @returns {Float64Array|number[]} `out`, for chaining
|
|
92
|
+
*/
|
|
93
|
+
sample(out, x, y, z) {
|
|
94
|
+
out[0] = 0;
|
|
95
|
+
out[1] = 0;
|
|
96
|
+
out[2] = 0;
|
|
97
|
+
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # The air everywhere a fluid simulation is not
|
|
3
|
+
*
|
|
4
|
+
* §10's fallback: "a `GlobalFluidEffector`-shaped ambient term — a constant
|
|
5
|
+
* `wind` vector plus a small band-limited noise for gusting". The shape is
|
|
6
|
+
* deliberate. `GlobalFluidEffector` with a `wind` and a `drag` makes every fluid
|
|
7
|
+
* field relax *toward* `wind`, so a field with one in the scene already reads
|
|
8
|
+
* `wind` away from whatever is disturbing it — which means this is not an
|
|
9
|
+
* approximation of the simulation, it is **the same far field the simulation
|
|
10
|
+
* has**, evaluated where no simulation exists. A cloth walking out of a fluid
|
|
11
|
+
* volume walks into the volume's own ambient rather than into still air.
|
|
12
|
+
*
|
|
13
|
+
* ## The gust is three sinusoids, not a noise function
|
|
14
|
+
*
|
|
15
|
+
* "Band-limited" is exactly what a sum of sinusoids is, and the three properties
|
|
16
|
+
* that matters for here are all free: it is bounded (so `gust` is a real
|
|
17
|
+
* amplitude rather than a scale factor over an unbounded tail), it is smooth
|
|
18
|
+
* (so a settled banner is lifted rather than kicked), and it carries **no
|
|
19
|
+
* state** — `g(t)` is a pure function of the cloth world's own fixed-step clock,
|
|
20
|
+
* which is what lets two systems sharing this source produce bit-identical
|
|
21
|
+
* cloth. A value-noise lattice would need a seed and an interpolation rule to
|
|
22
|
+
* buy the same three.
|
|
23
|
+
*
|
|
24
|
+
* The three components sit at 1, 2.41 and 5.83 times the base frequency, which
|
|
25
|
+
* are mutually irrational enough that the pattern does not visibly repeat, and
|
|
26
|
+
* the three axes are offset in phase so the gust turns as well as pulses. It is
|
|
27
|
+
* the cheapest thing that reads as weather; it is not turbulence, and a scene
|
|
28
|
+
* that wants turbulence has a fluid simulator.
|
|
29
|
+
*
|
|
30
|
+
* ## Uniform in space, and that is the interesting limit
|
|
31
|
+
*
|
|
32
|
+
* {@link varies} is always `false`, so a whole garment costs **one** sample —
|
|
33
|
+
* which is what makes the no-simulation case essentially free on the main thread
|
|
34
|
+
* regardless of particle count (`MEASUREMENTS.md` §47). The cost is that the
|
|
35
|
+
* whole cloth is lifted together and a long banner does not see a gust arrive at
|
|
36
|
+
* one end before the other. Spatial structure is the thing a fluid field has and
|
|
37
|
+
* this does not, and §10's argument is that building a second, worse one here
|
|
38
|
+
* would be the duplication the design exists to avoid.
|
|
39
|
+
*
|
|
40
|
+
* @author Alex Goldring
|
|
41
|
+
* @copyright Company Named Limited (c) 2026
|
|
42
|
+
*/
|
|
43
|
+
export class ClothAmbientWind extends AbstractClothWind {
|
|
44
|
+
/**
|
|
45
|
+
* Prevailing wind, world-space metres per second. The same quantity and the
|
|
46
|
+
* same units as `GlobalFluidEffector#wind`.
|
|
47
|
+
* @type {Float64Array}
|
|
48
|
+
*/
|
|
49
|
+
wind: Float64Array;
|
|
50
|
+
/**
|
|
51
|
+
* Peak gust speed on top of {@link wind}, metres per second. The gust is
|
|
52
|
+
* bounded by exactly this — the component amplitudes below sum to one — so
|
|
53
|
+
* the air's speed never leaves `|wind| ± gust`.
|
|
54
|
+
* @type {number}
|
|
55
|
+
*/
|
|
56
|
+
gust: number;
|
|
57
|
+
/**
|
|
58
|
+
* Period of the gust's slowest component, seconds. Four is a breeze that
|
|
59
|
+
* arrives and leaves a few times a minute; a fraction of a second is a
|
|
60
|
+
* flutter.
|
|
61
|
+
* @type {number}
|
|
62
|
+
*/
|
|
63
|
+
period: number;
|
|
64
|
+
/**
|
|
65
|
+
* @type {number}
|
|
66
|
+
* @private
|
|
67
|
+
*/
|
|
68
|
+
private __time;
|
|
69
|
+
/**
|
|
70
|
+
* @param {number} time
|
|
71
|
+
* @param {EntityComponentDataset} [ecd]
|
|
72
|
+
* @returns {void}
|
|
73
|
+
*/
|
|
74
|
+
begin(time: number, ecd?: EntityComponentDataset): void;
|
|
75
|
+
/**
|
|
76
|
+
* Always `false`: the ambient is one vector for the whole world at any
|
|
77
|
+
* instant, so one sample describes a garment exactly rather than
|
|
78
|
+
* approximately.
|
|
79
|
+
*
|
|
80
|
+
* @returns {boolean}
|
|
81
|
+
*/
|
|
82
|
+
varies(): boolean;
|
|
83
|
+
}
|
|
84
|
+
import { AbstractClothWind } from "./AbstractClothWind.js";
|
|
85
|
+
//# sourceMappingURL=ClothAmbientWind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClothAmbientWind.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/wind/ClothAmbientWind.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH;IAEI;;;;OAIG;IACH,MAFU,YAAY,CAEK;IAE3B;;;;;OAKG;IACH,MAFU,MAAM,CAEP;IAET;;;;;OAKG;IACH,QAFU,MAAM,CAEL;IAEX;;;OAGG;IACH,eAAW;IAEX;;;;OAIG;IACH,YAJW,MAAM,iCAEJ,IAAI,CAIhB;IAED;;;;;;OAMG;IACH,UAFa,OAAO,CAInB;CAsCJ;kCAnIiC,wBAAwB"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { AbstractClothWind } from "./AbstractClothWind.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* # The air everywhere a fluid simulation is not
|
|
5
|
+
*
|
|
6
|
+
* §10's fallback: "a `GlobalFluidEffector`-shaped ambient term — a constant
|
|
7
|
+
* `wind` vector plus a small band-limited noise for gusting". The shape is
|
|
8
|
+
* deliberate. `GlobalFluidEffector` with a `wind` and a `drag` makes every fluid
|
|
9
|
+
* field relax *toward* `wind`, so a field with one in the scene already reads
|
|
10
|
+
* `wind` away from whatever is disturbing it — which means this is not an
|
|
11
|
+
* approximation of the simulation, it is **the same far field the simulation
|
|
12
|
+
* has**, evaluated where no simulation exists. A cloth walking out of a fluid
|
|
13
|
+
* volume walks into the volume's own ambient rather than into still air.
|
|
14
|
+
*
|
|
15
|
+
* ## The gust is three sinusoids, not a noise function
|
|
16
|
+
*
|
|
17
|
+
* "Band-limited" is exactly what a sum of sinusoids is, and the three properties
|
|
18
|
+
* that matters for here are all free: it is bounded (so `gust` is a real
|
|
19
|
+
* amplitude rather than a scale factor over an unbounded tail), it is smooth
|
|
20
|
+
* (so a settled banner is lifted rather than kicked), and it carries **no
|
|
21
|
+
* state** — `g(t)` is a pure function of the cloth world's own fixed-step clock,
|
|
22
|
+
* which is what lets two systems sharing this source produce bit-identical
|
|
23
|
+
* cloth. A value-noise lattice would need a seed and an interpolation rule to
|
|
24
|
+
* buy the same three.
|
|
25
|
+
*
|
|
26
|
+
* The three components sit at 1, 2.41 and 5.83 times the base frequency, which
|
|
27
|
+
* are mutually irrational enough that the pattern does not visibly repeat, and
|
|
28
|
+
* the three axes are offset in phase so the gust turns as well as pulses. It is
|
|
29
|
+
* the cheapest thing that reads as weather; it is not turbulence, and a scene
|
|
30
|
+
* that wants turbulence has a fluid simulator.
|
|
31
|
+
*
|
|
32
|
+
* ## Uniform in space, and that is the interesting limit
|
|
33
|
+
*
|
|
34
|
+
* {@link varies} is always `false`, so a whole garment costs **one** sample —
|
|
35
|
+
* which is what makes the no-simulation case essentially free on the main thread
|
|
36
|
+
* regardless of particle count (`MEASUREMENTS.md` §47). The cost is that the
|
|
37
|
+
* whole cloth is lifted together and a long banner does not see a gust arrive at
|
|
38
|
+
* one end before the other. Spatial structure is the thing a fluid field has and
|
|
39
|
+
* this does not, and §10's argument is that building a second, worse one here
|
|
40
|
+
* would be the duplication the design exists to avoid.
|
|
41
|
+
*
|
|
42
|
+
* @author Alex Goldring
|
|
43
|
+
* @copyright Company Named Limited (c) 2026
|
|
44
|
+
*/
|
|
45
|
+
export class ClothAmbientWind extends AbstractClothWind {
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Prevailing wind, world-space metres per second. The same quantity and the
|
|
49
|
+
* same units as `GlobalFluidEffector#wind`.
|
|
50
|
+
* @type {Float64Array}
|
|
51
|
+
*/
|
|
52
|
+
wind = new Float64Array(3);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Peak gust speed on top of {@link wind}, metres per second. The gust is
|
|
56
|
+
* bounded by exactly this — the component amplitudes below sum to one — so
|
|
57
|
+
* the air's speed never leaves `|wind| ± gust`.
|
|
58
|
+
* @type {number}
|
|
59
|
+
*/
|
|
60
|
+
gust = 0;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Period of the gust's slowest component, seconds. Four is a breeze that
|
|
64
|
+
* arrives and leaves a few times a minute; a fraction of a second is a
|
|
65
|
+
* flutter.
|
|
66
|
+
* @type {number}
|
|
67
|
+
*/
|
|
68
|
+
period = 4;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @type {number}
|
|
72
|
+
* @private
|
|
73
|
+
*/
|
|
74
|
+
__time = 0;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @param {number} time
|
|
78
|
+
* @param {EntityComponentDataset} [ecd]
|
|
79
|
+
* @returns {void}
|
|
80
|
+
*/
|
|
81
|
+
begin(time, ecd) {
|
|
82
|
+
this.__time = time;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Always `false`: the ambient is one vector for the whole world at any
|
|
87
|
+
* instant, so one sample describes a garment exactly rather than
|
|
88
|
+
* approximately.
|
|
89
|
+
*
|
|
90
|
+
* @returns {boolean}
|
|
91
|
+
*/
|
|
92
|
+
varies() {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @param {Float64Array|number[]} out
|
|
98
|
+
* @param {number} x unused — the ambient has no spatial structure
|
|
99
|
+
* @param {number} y
|
|
100
|
+
* @param {number} z
|
|
101
|
+
* @returns {Float64Array|number[]}
|
|
102
|
+
*/
|
|
103
|
+
sample(out, x, y, z) {
|
|
104
|
+
const wind = this.wind;
|
|
105
|
+
|
|
106
|
+
out[0] = wind[0];
|
|
107
|
+
out[1] = wind[1];
|
|
108
|
+
out[2] = wind[2];
|
|
109
|
+
|
|
110
|
+
const gust = this.gust;
|
|
111
|
+
|
|
112
|
+
if (gust === 0) {
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const period = this.period > 0 ? this.period : 1;
|
|
117
|
+
|
|
118
|
+
const w = 2 * Math.PI * this.__time / period;
|
|
119
|
+
|
|
120
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
121
|
+
const phase = PHASE[axis];
|
|
122
|
+
|
|
123
|
+
out[axis] += gust * (
|
|
124
|
+
AMPLITUDE_0 * Math.sin(w * RATE_0 + phase)
|
|
125
|
+
+ AMPLITUDE_1 * Math.sin(w * RATE_1 + phase * 2)
|
|
126
|
+
+ AMPLITUDE_2 * Math.sin(w * RATE_2 + phase * 3)
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return out;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Component rates, as multiples of the base frequency. Mutually irrational
|
|
136
|
+
* enough that the sum's own period is far longer than anyone watches.
|
|
137
|
+
* @type {number}
|
|
138
|
+
* @private
|
|
139
|
+
*/
|
|
140
|
+
const RATE_0 = 1;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @type {number}
|
|
144
|
+
* @private
|
|
145
|
+
*/
|
|
146
|
+
const RATE_1 = 2.41;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @type {number}
|
|
150
|
+
* @private
|
|
151
|
+
*/
|
|
152
|
+
const RATE_2 = 5.83;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Component amplitudes. They sum to exactly one, which is what makes
|
|
156
|
+
* {@link ClothAmbientWind#gust} a bound rather than a scale — a pink-ish
|
|
157
|
+
* `1 : 1/2 : 1/4` normalised by its own total.
|
|
158
|
+
* @type {number}
|
|
159
|
+
* @private
|
|
160
|
+
*/
|
|
161
|
+
const AMPLITUDE_0 = 4 / 7;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @type {number}
|
|
165
|
+
* @private
|
|
166
|
+
*/
|
|
167
|
+
const AMPLITUDE_1 = 2 / 7;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @type {number}
|
|
171
|
+
* @private
|
|
172
|
+
*/
|
|
173
|
+
const AMPLITUDE_2 = 1 / 7;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Per-axis phase offsets, so the three axes are not a single pulse along the
|
|
177
|
+
* diagonal. Thirds of a turn, scaled per component so the axes stay apart at
|
|
178
|
+
* every rate rather than only at the slowest.
|
|
179
|
+
* @type {number[]}
|
|
180
|
+
* @private
|
|
181
|
+
*/
|
|
182
|
+
const PHASE = [0, 2 * Math.PI / 3, 4 * Math.PI / 3];
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # The air, read out of the fluid simulation that is already running
|
|
3
|
+
*
|
|
4
|
+
* §10's whole argument: this engine has a fluid simulator, `FluidObstacle`
|
|
5
|
+
* already voxelises physics colliders into it, so a character running past a
|
|
6
|
+
* cape gets a **wake** without anything cloth-specific being authored. This is
|
|
7
|
+
* the source that reads it — every enabled {@link FluidComponent} in the scene,
|
|
8
|
+
* sampled trilinearly where a particle actually is.
|
|
9
|
+
*
|
|
10
|
+
* Where no field reaches, {@link ambient} answers instead, so this is the one
|
|
11
|
+
* source a scene needs rather than a thing to switch between: a banner inside a
|
|
12
|
+
* wind tunnel volume reads the tunnel, the same banner carried outside reads the
|
|
13
|
+
* prevailing weather, and the cloth never learns which happened.
|
|
14
|
+
*
|
|
15
|
+
* ## Two units problems, and they are the reason this class exists at all
|
|
16
|
+
*
|
|
17
|
+
* A caller cannot simply forward `FluidComponent#sampleVelocityAtWorld`:
|
|
18
|
+
*
|
|
19
|
+
* - **Cells, not metres.** `FluidField#sampleVelocity` answers in *grid cells*
|
|
20
|
+
* per second and says so — it "does NOT rescale them, on the assumption that
|
|
21
|
+
* callers (vegetation sway, dust drift) interpret the field as a direction ×
|
|
22
|
+
* magnitude wind". Cloth's drag row is a relaxation toward a **velocity**, so
|
|
23
|
+
* the same wind voxelised at 0.25 m instead of 1 m would blow a garment four
|
|
24
|
+
* times as hard. The multiply by `cell_size` is here. `MEASUREMENTS.md` §45.
|
|
25
|
+
* - **Unbuilt fields read as null.** A `FluidComponent` exists from the moment
|
|
26
|
+
* the entity is spawned and its field's buffers arrive at `build()`. Sampling
|
|
27
|
+
* before that is a null dereference rather than a zero, so an unbuilt field is
|
|
28
|
+
* skipped exactly like a disabled one.
|
|
29
|
+
*
|
|
30
|
+
* ## The field list is rebuilt once a step, not once a cloth
|
|
31
|
+
*
|
|
32
|
+
* {@link begin} walks the dataset and caches each live field with its world
|
|
33
|
+
* box. Every cloth's {@link varies} and every particle's {@link sample} then
|
|
34
|
+
* read that cache, so a scene with twenty garments and one wind volume walks the
|
|
35
|
+
* dataset once. `FluidSystem` does the equivalent per field for its effectors
|
|
36
|
+
* and notes the same trade.
|
|
37
|
+
*
|
|
38
|
+
* ## What it does not do
|
|
39
|
+
*
|
|
40
|
+
* **It does not blend at a field's edge.** A point inside a field's box reads
|
|
41
|
+
* the field and a point outside reads the ambient, so a garment straddling the
|
|
42
|
+
* boundary sees a step in the air rather than a ramp. In a scene where the
|
|
43
|
+
* ambient is the far field the volume relaxes toward — `GlobalFluidEffector`'s
|
|
44
|
+
* `wind` — the step is small and mostly the disturbance the volume exists to
|
|
45
|
+
* carry; where it is not, it is visible, and the answer is a volume large enough
|
|
46
|
+
* to hold what moves through it. **Overlapping fields are resolved by order**,
|
|
47
|
+
* first match wins, which is the same arbitrary-but-deterministic rule
|
|
48
|
+
* `FluidSystem` applies when it steps them independently.
|
|
49
|
+
*
|
|
50
|
+
* @author Alex Goldring
|
|
51
|
+
* @copyright Company Named Limited (c) 2026
|
|
52
|
+
*/
|
|
53
|
+
export class ClothFluidWind extends AbstractClothWind {
|
|
54
|
+
/**
|
|
55
|
+
* What the air is where no field reaches. Present rather than optional
|
|
56
|
+
* because "outside every fluid volume" is most of the world.
|
|
57
|
+
* @type {ClothAmbientWind}
|
|
58
|
+
*/
|
|
59
|
+
ambient: ClothAmbientWind;
|
|
60
|
+
/**
|
|
61
|
+
* Live fields this step: the component and its world box, six words each.
|
|
62
|
+
* @type {FluidComponent[]}
|
|
63
|
+
* @private
|
|
64
|
+
*/
|
|
65
|
+
private __components;
|
|
66
|
+
/**
|
|
67
|
+
* @type {number[]}
|
|
68
|
+
* @private
|
|
69
|
+
*/
|
|
70
|
+
private __bounds;
|
|
71
|
+
/**
|
|
72
|
+
* @type {number}
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
private __count;
|
|
76
|
+
}
|
|
77
|
+
import { AbstractClothWind } from "./AbstractClothWind.js";
|
|
78
|
+
import { ClothAmbientWind } from "./ClothAmbientWind.js";
|
|
79
|
+
//# sourceMappingURL=ClothFluidWind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClothFluidWind.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/cloth/wind/ClothFluidWind.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH;IAEI;;;;OAIG;IACH,SAFU,gBAAgB,CAEO;IAEjC;;;;OAIG;IACH,qBAAkB;IAElB;;;OAGG;IACH,iBAAc;IAEd;;;OAGG;IACH,gBAAY;CA+Hf;kCAhNiC,wBAAwB;iCACzB,uBAAuB"}
|