@woosh/meep-engine 2.156.0 → 2.157.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/README.md +1 -3
- package/editor/view/ecs/components/common/AutoCanvasView.js +100 -53
- package/editor/view/ecs/components/common/TextController.js +59 -0
- package/editor/view/node-graph/NodeGraphCamera.js +90 -0
- package/editor/view/node-graph/NodeGraphEditorView.js +121 -22
- package/editor/view/node-graph/NodeGraphSelection.js +89 -0
- package/editor/view/node-graph/NodeGraphView.js +669 -453
- package/editor/view/node-graph/NodeView.js +211 -135
- package/editor/view/node-graph/actions/ConnectionCreateAction.js +53 -0
- package/editor/view/node-graph/actions/ConnectionDeleteAction.js +36 -0
- package/editor/view/node-graph/actions/NodeDeleteAction.js +88 -0
- package/editor/view/node-graph/actions/NodeParameterSetAction.js +52 -0
- package/editor/view/node-graph/actions/NodesMoveAction.js +41 -0
- package/editor/view/node-graph/actions/SelectionSetAction.js +60 -0
- package/editor/view/node-graph/connection_wire_geometry.js +107 -0
- package/package.json +1 -1
- package/samples/generation/SampleGenerator0.js +8 -1
- package/src/core/binary/reinterpret_float32_as_uint32.d.ts +7 -0
- package/src/core/binary/reinterpret_float32_as_uint32.d.ts.map +1 -0
- package/src/core/binary/reinterpret_float32_as_uint32.js +13 -0
- package/src/core/binary/reinterpret_uint32_as_float32.d.ts +7 -0
- package/src/core/binary/reinterpret_uint32_as_float32.d.ts.map +1 -0
- package/src/core/binary/reinterpret_uint32_as_float32.js +14 -0
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_incremental.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_incremental.js +1 -3
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_sphere.d.ts +12 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_sphere.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_sphere.js +92 -0
- package/src/core/bvh8/BVH8.d.ts +127 -0
- package/src/core/bvh8/BVH8.d.ts.map +1 -0
- package/src/core/bvh8/BVH8.js +436 -0
- package/src/core/bvh8/NOTES.md +63 -0
- package/src/core/bvh8/build/BVH8Converter.d.ts +59 -0
- package/src/core/bvh8/build/BVH8Converter.d.ts.map +1 -0
- package/src/core/bvh8/build/BVH8Converter.js +588 -0
- package/src/core/bvh8/build/NodeProxy.d.ts +66 -0
- package/src/core/bvh8/build/NodeProxy.d.ts.map +1 -0
- package/src/core/bvh8/build/NodeProxy.js +308 -0
- package/src/core/bvh8/build/TriangleCluster.d.ts +29 -0
- package/src/core/bvh8/build/TriangleCluster.d.ts.map +1 -0
- package/src/core/bvh8/build/TriangleCluster.js +123 -0
- package/src/core/bvh8/build/aabb3_compute_merge_cost.d.ts +8 -0
- package/src/core/bvh8/build/aabb3_compute_merge_cost.d.ts.map +1 -0
- package/src/core/bvh8/build/aabb3_compute_merge_cost.js +29 -0
- package/src/core/bvh8/build/aabb3_from_triangle_by_index.d.ts +10 -0
- package/src/core/bvh8/build/aabb3_from_triangle_by_index.d.ts.map +1 -0
- package/src/core/bvh8/build/aabb3_from_triangle_by_index.js +18 -0
- package/src/core/bvh8/build/bvh8_build_for_geometry.d.ts +10 -0
- package/src/core/bvh8/build/bvh8_build_for_geometry.d.ts.map +1 -0
- package/src/core/bvh8/build/bvh8_build_for_geometry.js +303 -0
- package/src/core/bvh8/build/bvh8_from_proxy.d.ts +9 -0
- package/src/core/bvh8/build/bvh8_from_proxy.d.ts.map +1 -0
- package/src/core/bvh8/build/bvh8_from_proxy.js +256 -0
- package/src/core/bvh8/build/byte.d.ts +7 -0
- package/src/core/bvh8/build/byte.d.ts.map +1 -0
- package/src/core/bvh8/build/byte.js +10 -0
- package/src/core/bvh8/build/encode_bounds_e.d.ts +9 -0
- package/src/core/bvh8/build/encode_bounds_e.d.ts.map +1 -0
- package/src/core/bvh8/build/encode_bounds_e.js +12 -0
- package/src/core/bvh8/bvh8_convert_to_dot.d.ts +11 -0
- package/src/core/bvh8/bvh8_convert_to_dot.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_convert_to_dot.js +133 -0
- package/src/core/bvh8/bvh8_count_primitives.d.ts +22 -0
- package/src/core/bvh8/bvh8_count_primitives.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_count_primitives.js +98 -0
- package/src/core/bvh8/bvh8_geometry_validate.d.ts +16 -0
- package/src/core/bvh8/bvh8_geometry_validate.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_geometry_validate.js +149 -0
- package/src/core/bvh8/bvh8_geometry_validate_indirect.d.ts +16 -0
- package/src/core/bvh8/bvh8_geometry_validate_indirect.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_geometry_validate_indirect.js +177 -0
- package/src/core/bvh8/bvh8_get_node_bounds.d.ts +9 -0
- package/src/core/bvh8/bvh8_get_node_bounds.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_get_node_bounds.js +35 -0
- package/src/core/bvh8/bvh8_get_node_child_bounds.d.ts +10 -0
- package/src/core/bvh8/bvh8_get_node_child_bounds.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_get_node_child_bounds.js +53 -0
- package/src/core/bvh8/bvh8_node_child_surface_area.d.ts +9 -0
- package/src/core/bvh8/bvh8_node_child_surface_area.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_node_child_surface_area.js +18 -0
- package/src/core/bvh8/bvh8_node_count_triangles.d.ts +8 -0
- package/src/core/bvh8/bvh8_node_count_triangles.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_node_count_triangles.js +28 -0
- package/src/core/bvh8/bvh8_quality.d.ts +8 -0
- package/src/core/bvh8/bvh8_quality.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_quality.js +73 -0
- package/src/core/bvh8/bvh8_validate_structure.d.ts +15 -0
- package/src/core/bvh8/bvh8_validate_structure.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_validate_structure.js +87 -0
- package/src/core/collection/Uint32MinHeap.d.ts +56 -0
- package/src/core/collection/Uint32MinHeap.d.ts.map +1 -0
- package/src/core/collection/Uint32MinHeap.js +109 -0
- package/src/core/collection/list/FilteredListProjection.js +1 -1
- package/src/{engine/physics/island → core/collection/union-find}/union_find.d.ts +8 -5
- package/src/core/collection/union-find/union_find.d.ts.map +1 -0
- package/src/{engine/physics/island → core/collection/union-find}/union_find.js +8 -5
- package/src/core/dom/isImageBitmap.d.ts +7 -0
- package/src/core/dom/isImageBitmap.d.ts.map +1 -0
- package/src/core/dom/isImageBitmap.js +12 -0
- package/src/core/function/frameThrottle.d.ts +8 -0
- package/src/core/function/frameThrottle.d.ts.map +1 -0
- package/src/core/function/frameThrottle.js +23 -0
- package/src/{engine/physics/narrowphase/clip_against_axis_uv.d.ts → core/geom/2d/polygon/polygon2_clip_axis_halfplane.d.ts} +3 -3
- package/src/core/geom/2d/polygon/polygon2_clip_axis_halfplane.d.ts.map +1 -0
- package/src/{engine/physics/narrowphase/clip_against_axis_uv.js → core/geom/2d/polygon/polygon2_clip_axis_halfplane.js} +51 -51
- package/src/{engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts → core/geom/3d/aabb/aabb3_transform_oriented_inverse.d.ts} +9 -7
- package/src/core/geom/3d/aabb/aabb3_transform_oriented_inverse.d.ts.map +1 -0
- package/src/{engine/physics/narrowphase/decomposition/aabb_world_to_local.js → core/geom/3d/aabb/aabb3_transform_oriented_inverse.js} +9 -7
- package/src/core/geom/3d/aabb/compute_triangle_group_aabb3.d.ts +12 -0
- package/src/core/geom/3d/aabb/compute_triangle_group_aabb3.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/compute_triangle_group_aabb3.js +46 -0
- package/src/core/geom/3d/box/box3_projected_half_extent.d.ts +28 -0
- package/src/core/geom/3d/box/box3_projected_half_extent.d.ts.map +1 -0
- package/src/core/geom/3d/box/box3_projected_half_extent.js +35 -0
- package/src/core/geom/3d/frustum/read_cluster_frustum_corners.js +1 -1
- package/src/core/geom/3d/frustum/read_frustum_corner.d.ts +9 -0
- package/src/core/geom/3d/frustum/read_frustum_corner.d.ts.map +1 -0
- package/src/core/geom/3d/frustum/read_frustum_corner.js +14 -0
- package/src/core/geom/3d/gjk/gjk.d.ts.map +1 -0
- package/src/{engine/physics → core/geom/3d}/gjk/gjk.js +430 -372
- package/src/{engine/physics → core/geom/3d}/gjk/gjk_epa_penetration.d.ts +8 -5
- package/src/core/geom/3d/gjk/gjk_epa_penetration.d.ts.map +1 -0
- package/src/{engine/physics → core/geom/3d}/gjk/gjk_epa_penetration.js +520 -544
- package/src/{engine/physics → core/geom/3d}/gjk/minkowski_support.d.ts +5 -4
- package/src/core/geom/3d/gjk/minkowski_support.d.ts.map +1 -0
- package/src/{engine/physics → core/geom/3d}/gjk/minkowski_support.js +71 -70
- package/src/{engine/physics → core/geom/3d}/gjk/mpr.d.ts +3 -3
- package/src/core/geom/3d/gjk/mpr.d.ts.map +1 -0
- package/src/{engine/physics → core/geom/3d}/gjk/mpr.js +368 -362
- package/src/{engine/physics/integration/quat_integrate.d.ts → core/geom/3d/quaternion/quat3_integrate.d.ts} +2 -2
- package/src/core/geom/3d/quaternion/quat3_integrate.d.ts.map +1 -0
- package/src/{engine/physics/integration/quat_integrate.js → core/geom/3d/quaternion/quat3_integrate.js} +1 -1
- package/src/{engine/physics/narrowphase/PosedShape.d.ts → core/geom/3d/shape/PosedShape3D.d.ts} +9 -8
- package/src/{engine/physics/narrowphase/PosedShape.d.ts.map → core/geom/3d/shape/PosedShape3D.d.ts.map} +1 -1
- package/src/{engine/physics/narrowphase/PosedShape.js → core/geom/3d/shape/PosedShape3D.js} +10 -9
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/TransformedShape3D.js +15 -11
- package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts +1 -1
- package/src/core/geom/vec3/v3_quat3_apply_inverse.js +1 -1
- package/src/core/math/complex/complex_add.d.ts +1 -1
- package/src/core/math/complex/complex_add.d.ts.map +1 -1
- package/src/core/math/complex/complex_add.js +12 -3
- package/src/core/math/complex/complex_div.d.ts +1 -1
- package/src/core/math/complex/complex_div.d.ts.map +1 -1
- package/src/core/math/complex/complex_div.js +11 -4
- package/src/core/math/complex/complex_mul.d.ts +1 -1
- package/src/core/math/complex/complex_mul.d.ts.map +1 -1
- package/src/core/math/complex/complex_mul.js +10 -3
- package/src/core/math/complex/complex_sub.d.ts +1 -1
- package/src/core/math/complex/complex_sub.d.ts.map +1 -1
- package/src/core/math/complex/complex_sub.js +12 -3
- package/src/{engine/physics/fluid/solver/optimal_sor_omega.d.ts → core/math/linalg/sor_optimal_omega.d.ts} +4 -3
- package/src/core/math/linalg/sor_optimal_omega.d.ts.map +1 -0
- package/src/{engine/physics/fluid/solver/optimal_sor_omega.js → core/math/linalg/sor_optimal_omega.js} +4 -3
- package/src/core/math/lookup/ParameterLookupTable.d.ts +123 -0
- package/src/core/math/lookup/ParameterLookupTable.d.ts.map +1 -0
- package/src/core/math/lookup/ParameterLookupTable.js +495 -0
- package/src/core/math/lookup/ParameterLookupTableFlags.d.ts +5 -0
- package/src/core/math/lookup/ParameterLookupTableFlags.d.ts.map +1 -0
- package/src/core/math/lookup/ParameterLookupTableFlags.js +6 -0
- package/src/core/math/physics/kinematics/computeInterceptPoint.d.ts.map +1 -0
- package/src/{engine/physics → core/math/physics/kinematics}/computeInterceptPoint.js +79 -79
- package/src/core/math/physics/mie/ri_air.d.ts.map +1 -1
- package/src/core/math/physics/mie/ri_air.js +1 -3
- package/src/core/math/physics/mie/ri_ammonium_sulfate.d.ts.map +1 -1
- package/src/core/math/physics/mie/ri_ammonium_sulfate.js +1 -3
- package/src/core/math/physics/mie/ri_brine.d.ts.map +1 -1
- package/src/core/math/physics/mie/ri_brine.js +1 -3
- package/src/core/math/physics/mie/ri_dust.d.ts.map +1 -1
- package/src/core/math/physics/mie/ri_dust.js +1 -3
- package/src/core/math/physics/mie/ri_pollen.d.ts.map +1 -1
- package/src/core/math/physics/mie/ri_pollen.js +1 -3
- package/src/core/math/physics/mie/ri_smoke.d.ts.map +1 -1
- package/src/core/math/physics/mie/ri_smoke.js +1 -3
- package/src/core/math/physics/mie/ri_soot.d.ts.map +1 -1
- package/src/core/math/physics/mie/ri_soot.js +1 -3
- package/src/core/math/physics/mie/ri_water.d.ts.map +1 -1
- package/src/core/math/physics/mie/ri_water.js +1 -3
- package/src/core/math/random/random_pick_weighted_index.d.ts +10 -0
- package/src/core/math/random/random_pick_weighted_index.d.ts.map +1 -0
- package/src/core/math/random/random_pick_weighted_index.js +26 -0
- package/src/core/model/node-graph/NodeGraph.d.ts +9 -0
- package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
- package/src/core/model/node-graph/NodeGraph.js +38 -0
- package/src/core/model/node-graph/visual/NodeGraphVisualData.d.ts +23 -0
- package/src/core/model/node-graph/visual/NodeGraphVisualData.d.ts.map +1 -1
- package/src/core/model/node-graph/visual/NodeGraphVisualData.js +54 -0
- package/src/core/path/convertPathToURL.d.ts +9 -0
- package/src/core/path/convertPathToURL.d.ts.map +1 -0
- package/src/core/path/convertPathToURL.js +107 -0
- package/src/core/process/worker/WorkerBuilder.js +1 -1
- package/src/core/process/worker/extractTransferables.js +1 -1
- package/src/engine/animation/curve/draw/build_tangent_editor.d.ts.map +1 -1
- package/src/engine/animation/curve/draw/build_tangent_editor.js +8 -1
- package/src/engine/animation/curve/editor/createKeyframeDraggableAspect.d.ts.map +1 -1
- package/src/engine/animation/curve/editor/createKeyframeDraggableAspect.js +11 -5
- package/src/engine/asset/Asset.d.ts.map +1 -1
- package/src/engine/asset/Asset.js +16 -6
- package/src/engine/asset/AssetManager.d.ts +61 -52
- package/src/engine/asset/AssetManager.d.ts.map +1 -1
- package/src/engine/asset/AssetManager.js +1411 -1045
- package/src/engine/asset/AssetRequest.d.ts +1 -1
- package/src/engine/asset/AssetRequest.d.ts.map +1 -1
- package/src/engine/asset/AssetRequest.js +1 -1
- package/src/engine/asset/AssetRequestScope.d.ts.map +1 -1
- package/src/engine/asset/AssetRequestScope.js +7 -0
- package/src/engine/asset/PendingAsset.d.ts +32 -1
- package/src/engine/asset/PendingAsset.d.ts.map +1 -1
- package/src/engine/asset/PendingAsset.js +108 -61
- package/src/engine/asset/loaders/ArrayBufferLoader.js +2 -2
- package/src/engine/asset/loaders/AssetLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/AssetLoader.js +19 -2
- package/src/engine/asset/loaders/GLTFAssetLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/GLTFAssetLoader.js +123 -114
- package/src/engine/asset/loaders/JavascriptAssetLoader.d.ts +1 -1
- package/src/engine/asset/loaders/JavascriptAssetLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/JavascriptAssetLoader.js +31 -47
- package/src/engine/asset/loaders/JsonAssetLoader.js +1 -1
- package/src/engine/asset/loaders/SVGAssetLoader.js +2 -2
- package/src/engine/asset/loaders/SoundAssetLoader.js +1 -1
- package/src/engine/asset/loaders/TextAssetLoader.js +2 -2
- package/src/{core → engine/asset/loaders}/font/FontAsset.d.ts +1 -1
- package/src/engine/asset/loaders/font/FontAsset.d.ts.map +1 -0
- package/src/{core → engine/asset/loaders}/font/FontAsset.js +21 -21
- package/src/{core → engine/asset/loaders}/font/FontAssetLoader.d.ts +1 -1
- package/src/engine/asset/loaders/font/FontAssetLoader.d.ts.map +1 -0
- package/src/{core → engine/asset/loaders}/font/FontAssetLoader.js +20 -20
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts +1 -1
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +11 -20
- package/src/engine/asset/loaders/texture/TextureAssetLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/texture/TextureAssetLoader.js +8 -2
- package/src/engine/asset/preloader/AssetPreloader.js +1 -1
- package/src/engine/ecs/sockets/serialization/AttachmentSocketsAssetLoader.d.ts +1 -1
- package/src/engine/ecs/sockets/serialization/AttachmentSocketsAssetLoader.d.ts.map +1 -1
- package/src/engine/ecs/sockets/serialization/AttachmentSocketsAssetLoader.js +19 -22
- package/src/engine/graphics/FrameThrottle.d.ts +1 -7
- package/src/engine/graphics/FrameThrottle.d.ts.map +1 -1
- package/src/engine/graphics/FrameThrottle.js +2 -24
- package/src/{core/geom/3d/shape/util → engine/graphics/debug}/shape_to_visual_entity.d.ts +1 -1
- package/src/engine/graphics/debug/shape_to_visual_entity.d.ts.map +1 -0
- package/src/{core/geom/3d/shape/util → engine/graphics/debug}/shape_to_visual_entity.js +159 -159
- package/src/{core/geom/3d/tetrahedra → engine/graphics/debug}/visualize_tetrahedral_mesh.d.ts +1 -1
- package/src/engine/graphics/debug/visualize_tetrahedral_mesh.d.ts.map +1 -0
- package/src/{core/geom/3d/tetrahedra → engine/graphics/debug}/visualize_tetrahedral_mesh.js +46 -46
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionAssetLoader.d.ts +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionAssetLoader.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionAssetLoader.js +22 -32
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.js +2 -76
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +2 -427
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTableFlags.d.ts +1 -4
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTableFlags.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTableFlags.js +2 -6
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +1 -1
- package/src/engine/graphics/render/forward_plus/read_frustum_corner.d.ts +1 -8
- package/src/engine/graphics/render/forward_plus/read_frustum_corner.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/read_frustum_corner.js +2 -14
- package/src/engine/graphics/sh3/path_tracer/geometry/compute_triangle_group_aabb3.d.ts +1 -11
- package/src/engine/graphics/sh3/path_tracer/geometry/compute_triangle_group_aabb3.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/geometry/compute_triangle_group_aabb3.js +2 -46
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +1 -1
- package/src/engine/graphics/texture/3d/scs3d_sample_linear3.d.ts +27 -0
- package/src/engine/graphics/texture/3d/scs3d_sample_linear3.d.ts.map +1 -0
- package/src/engine/graphics/texture/3d/scs3d_sample_linear3.js +81 -0
- package/src/engine/graphics/texture/isImageBitmap.d.ts +1 -6
- package/src/engine/graphics/texture/isImageBitmap.d.ts.map +1 -1
- package/src/engine/graphics/texture/isImageBitmap.js +2 -12
- package/src/{core/process/action → engine/intelligence/behavior/util}/AsynchronousDelayAction.d.ts +2 -2
- package/src/engine/intelligence/behavior/util/AsynchronousDelayAction.d.ts.map +1 -0
- package/src/{core/process/action → engine/intelligence/behavior/util}/AsynchronousDelayAction.js +55 -55
- package/src/engine/network/NetworkSession.d.ts +12 -1
- package/src/engine/network/NetworkSession.d.ts.map +1 -1
- package/src/engine/network/NetworkSession.js +52 -1
- package/src/engine/network/README.md +45 -0
- package/src/engine/network/convertPathToURL.d.ts +1 -8
- package/src/engine/network/convertPathToURL.d.ts.map +1 -1
- package/src/engine/network/convertPathToURL.js +2 -107
- package/src/engine/network/core/quantize/quantize_float.d.ts.map +1 -1
- package/src/engine/network/core/quantize/quantize_float.js +7 -0
- package/src/engine/network/core/quantize/quantize_position.d.ts.map +1 -1
- package/src/engine/network/core/quantize/quantize_position.js +12 -1
- package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.js +15 -1
- package/src/engine/network/replication/Replicator.d.ts +8 -0
- package/src/engine/network/replication/Replicator.d.ts.map +1 -1
- package/src/engine/network/replication/Replicator.js +48 -0
- package/src/engine/network/transport/Channel.d.ts.map +1 -1
- package/src/engine/network/transport/Channel.js +46 -12
- package/src/engine/network/transport/ReliableCommandPipeline.d.ts +16 -0
- package/src/engine/network/transport/ReliableCommandPipeline.d.ts.map +1 -1
- package/src/engine/network/transport/ReliableCommandPipeline.js +29 -0
- package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/NodeUDPTransport.js +7 -1
- package/src/engine/network/transport/fragments/packet_size.d.ts +5 -5
- package/src/engine/network/transport/fragments/packet_size.d.ts.map +1 -1
- package/src/engine/network/transport/fragments/packet_size.js +5 -5
- package/src/engine/physics/BULLET_REVIEW.md +1 -1
- package/src/engine/physics/JOLT_REVIEW.md +2 -2
- package/src/engine/physics/PLAN.md +1094 -945
- package/src/engine/physics/RAPIER_REVIEW.md +2 -2
- package/src/engine/physics/body/BodyStorage.d.ts +2 -12
- package/src/engine/physics/body/BodyStorage.d.ts.map +1 -1
- package/src/engine/physics/body/BodyStorage.js +406 -452
- package/src/engine/physics/body/SolverBodyState.d.ts.map +1 -1
- package/src/engine/physics/body/SolverBodyState.js +12 -3
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +28 -3
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -1
- package/src/engine/physics/broadphase/compute_fat_world_aabb.js +60 -24
- package/src/engine/physics/broadphase/generate_pairs.d.ts +9 -5
- package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -1
- package/src/engine/physics/broadphase/generate_pairs.js +52 -37
- package/src/engine/physics/ccd/linear_sweep.d.ts +15 -5
- package/src/engine/physics/ccd/linear_sweep.d.ts.map +1 -1
- package/src/engine/physics/ccd/linear_sweep.js +122 -40
- package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
- package/src/engine/physics/constraint/solve_constraints.js +830 -805
- package/src/engine/physics/contact/ManifoldStore.d.ts +91 -16
- package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -1
- package/src/engine/physics/contact/ManifoldStore.js +204 -60
- package/src/engine/physics/ecs/BodyKind.d.ts +7 -3
- package/src/engine/physics/ecs/BodyKind.d.ts.map +1 -1
- package/src/engine/physics/ecs/BodyKind.js +29 -25
- package/src/engine/physics/ecs/Collider.d.ts +7 -0
- package/src/engine/physics/ecs/Collider.d.ts.map +1 -1
- package/src/engine/physics/ecs/Collider.js +7 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.js +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +110 -6
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +467 -45
- package/src/engine/physics/ecs/RigidBody.d.ts +20 -5
- package/src/engine/physics/ecs/RigidBody.d.ts.map +1 -1
- package/src/engine/physics/ecs/RigidBody.js +307 -286
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts +6 -3
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts.map +1 -1
- package/src/engine/physics/ecs/RigidBodyFlags.js +31 -28
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts +12 -4
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts.map +1 -1
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.js +19 -5
- package/src/engine/physics/ecs/RigidBodySerializationUpgrader_0_1.d.ts +10 -0
- package/src/engine/physics/ecs/RigidBodySerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBodySerializationUpgrader_0_1.js +37 -0
- package/src/engine/physics/ecs/find_non_finite_physics_state.d.ts +28 -0
- package/src/engine/physics/ecs/find_non_finite_physics_state.d.ts.map +1 -0
- package/src/engine/physics/ecs/find_non_finite_physics_state.js +76 -0
- package/src/engine/physics/events/ContactEventBuffer.d.ts +11 -0
- package/src/engine/physics/events/ContactEventBuffer.d.ts.map +1 -1
- package/src/engine/physics/events/ContactEventBuffer.js +40 -0
- package/src/engine/physics/events/diff_manifolds.d.ts +30 -13
- package/src/engine/physics/events/diff_manifolds.d.ts.map +1 -1
- package/src/engine/physics/events/diff_manifolds.js +87 -50
- package/src/engine/physics/fluid/FluidField.d.ts +45 -17
- package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidField.js +53 -23
- package/src/engine/physics/fluid/FluidSimulator.d.ts +141 -5
- package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidSimulator.js +336 -43
- package/src/engine/physics/fluid/REVIEW_02_PLAN.md +114 -0
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +4 -3
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidComponent.js +4 -3
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
- package/src/engine/physics/fluid/effector/AmbientWindFluidEffector.d.ts +41 -0
- package/src/engine/physics/fluid/effector/AmbientWindFluidEffector.d.ts.map +1 -0
- package/src/engine/physics/fluid/effector/AmbientWindFluidEffector.js +124 -0
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts +27 -8
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.js +67 -18
- package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_scalar.d.ts +42 -0
- package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_scalar.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_scalar.js +136 -0
- package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.d.ts +37 -0
- package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_advect_maccormack_velocity.js +169 -0
- package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.d.ts +36 -0
- package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_advect_sl_velocity.js +100 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts +6 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.js +6 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts +7 -2
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.js +17 -12
- package/src/engine/physics/fluid/solver/v3_grid_apply_vorticity_confinement.d.ts +42 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_vorticity_confinement.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_vorticity_confinement.js +131 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts +32 -22
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.js +43 -26
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_constant.d.ts +31 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_constant.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_constant.js +77 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts +26 -19
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.js +46 -42
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts +38 -10
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.js +158 -75
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +22 -17
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +108 -96
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts +30 -1
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -1
- package/src/engine/physics/inertia/world_inverse_inertia.js +160 -116
- package/src/engine/physics/integration/integrate_position.js +97 -97
- package/src/engine/physics/island/IslandBuilder.d.ts +49 -8
- package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -1
- package/src/engine/physics/island/IslandBuilder.js +93 -14
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/box_box_manifold.js +683 -673
- package/src/engine/physics/narrowphase/box_triangle_contact.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/box_triangle_contact.js +899 -749
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts +27 -0
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/capsule_contacts.js +624 -459
- package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/capsule_triangle_contact.js +58 -38
- package/src/engine/physics/narrowphase/compute_penetration.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/compute_penetration.js +369 -325
- package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts +3 -1
- package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/convex_convex_manifold.js +568 -422
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts +6 -3
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.js +66 -10
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts +4 -1
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +97 -94
- package/src/engine/physics/narrowphase/mesh_mesh_tet_manifold.js +117 -117
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/narrowphase_step.js +1738 -1739
- package/src/engine/physics/narrowphase/reduce_manifold_contacts.d.ts +14 -7
- package/src/engine/physics/narrowphase/reduce_manifold_contacts.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/reduce_manifold_contacts.js +74 -69
- package/src/engine/physics/persistence/solver_caches.d.ts +20 -0
- package/src/engine/physics/persistence/solver_caches.d.ts.map +1 -0
- package/src/engine/physics/persistence/solver_caches.js +309 -0
- package/src/engine/physics/queries/overlap_shape.d.ts.map +1 -1
- package/src/engine/physics/queries/overlap_shape.js +187 -184
- package/src/engine/physics/queries/raycast.d.ts +3 -2
- package/src/engine/physics/queries/raycast.d.ts.map +1 -1
- package/src/engine/physics/queries/raycast.js +37 -11
- package/src/engine/physics/queries/shape_cast.d.ts +18 -5
- package/src/engine/physics/queries/shape_cast.d.ts.map +1 -1
- package/src/engine/physics/queries/shape_cast.js +417 -393
- package/src/engine/physics/solver/solve_contacts.d.ts +22 -6
- package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -1
- package/src/engine/physics/solver/solve_contacts.js +1482 -1338
- package/src/engine/physics/vehicle/RaycastVehicle.d.ts.map +1 -1
- package/src/engine/physics/vehicle/RaycastVehicle.js +344 -339
- package/src/engine/ui/DraggableAspect.d.ts +12 -3
- package/src/engine/ui/DraggableAspect.d.ts.map +1 -1
- package/src/engine/ui/DraggableAspect.js +115 -83
- package/src/generation/COORDINATES.md +54 -0
- package/src/generation/GridTaskGroup.js +2 -2
- package/src/generation/REVIEW_01_ACTION_PLAN.md +628 -0
- package/src/generation/automata/CaveGeneratorCellularAutomata.d.ts +9 -1
- package/src/generation/automata/CaveGeneratorCellularAutomata.d.ts.map +1 -1
- package/src/generation/automata/CaveGeneratorCellularAutomata.js +79 -59
- package/src/generation/automata/CellularAutomata.d.ts +6 -3
- package/src/generation/automata/CellularAutomata.d.ts.map +1 -1
- package/src/generation/automata/CellularAutomata.js +22 -19
- package/src/generation/filtering/CellFilter.d.ts +17 -0
- package/src/generation/filtering/CellFilter.d.ts.map +1 -1
- package/src/generation/filtering/CellFilter.js +117 -77
- package/src/generation/filtering/CellFilterCellMatcher.d.ts.map +1 -1
- package/src/generation/filtering/CellFilterCellMatcher.js +2 -0
- package/src/generation/filtering/boolean/CellFilterLiteralBoolean.d.ts +5 -0
- package/src/generation/filtering/boolean/CellFilterLiteralBoolean.d.ts.map +1 -1
- package/src/generation/filtering/boolean/CellFilterLiteralBoolean.js +15 -0
- package/src/generation/filtering/core/CellFilterBinaryOperation.d.ts +0 -1
- package/src/generation/filtering/core/CellFilterBinaryOperation.d.ts.map +1 -1
- package/src/generation/filtering/core/CellFilterBinaryOperation.js +37 -50
- package/src/generation/filtering/core/CellFilterOperationTertiary.d.ts +0 -1
- package/src/generation/filtering/core/CellFilterOperationTertiary.d.ts.map +1 -1
- package/src/generation/filtering/core/CellFilterOperationTertiary.js +43 -59
- package/src/generation/filtering/core/CellFilterUnaryOperation.d.ts +0 -1
- package/src/generation/filtering/core/CellFilterUnaryOperation.d.ts.map +1 -1
- package/src/generation/filtering/core/CellFilterUnaryOperation.js +29 -33
- package/src/generation/filtering/numeric/CellFilterCache.d.ts +1 -0
- package/src/generation/filtering/numeric/CellFilterCache.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.d.ts +3 -2
- package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.js +9 -35
- package/src/generation/filtering/numeric/complex/CellFilterCurvature.d.ts +0 -1
- package/src/generation/filtering/numeric/complex/CellFilterCurvature.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterCurvature.js +19 -43
- package/src/generation/filtering/numeric/complex/CellFilterFXAA.d.ts +0 -1
- package/src/generation/filtering/numeric/complex/CellFilterFXAA.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterFXAA.js +2 -6
- package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js +9 -12
- package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js +2 -1
- package/src/generation/filtering/numeric/complex/CellFilterSobel.d.ts +0 -1
- package/src/generation/filtering/numeric/complex/CellFilterSobel.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterSobel.js +2 -6
- package/src/generation/filtering/numeric/math/CellFilterInverseLerp.d.ts +5 -4
- package/src/generation/filtering/numeric/math/CellFilterInverseLerp.d.ts.map +1 -1
- package/src/generation/filtering/numeric/math/CellFilterInverseLerp.js +5 -4
- package/src/generation/filtering/numeric/process/computeFilterSurfaceNormal.d.ts +17 -0
- package/src/generation/filtering/numeric/process/computeFilterSurfaceNormal.d.ts.map +1 -0
- package/src/generation/filtering/numeric/process/computeFilterSurfaceNormal.js +42 -0
- package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts.map +1 -1
- package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js +7 -1
- package/src/generation/filtering/numeric/util/populateSampler2DFromCellFilter.d.ts.map +1 -1
- package/src/generation/filtering/numeric/util/populateSampler2DFromCellFilter.js +7 -10
- package/src/generation/filtering/numeric/util/sampler_from_filter.d.ts.map +1 -1
- package/src/generation/filtering/numeric/util/sampler_from_filter.js +2 -1
- package/src/generation/grid/GridData.d.ts.map +1 -1
- package/src/generation/grid/GridData.js +14 -1
- package/src/generation/grid/actions/ContinuousGridCellAction.d.ts +10 -3
- package/src/generation/grid/actions/ContinuousGridCellAction.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellAction.js +18 -3
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.d.ts +11 -1
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js +13 -3
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.d.ts +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.js +2 -2
- package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.d.ts +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.js +4 -6
- package/src/generation/grid/coords/grid_to_texel.d.ts +9 -0
- package/src/generation/grid/coords/grid_to_texel.d.ts.map +1 -0
- package/src/generation/grid/coords/grid_to_texel.js +10 -0
- package/src/generation/grid/coords/texel_to_grid.d.ts +9 -0
- package/src/generation/grid/coords/texel_to_grid.d.ts.map +1 -0
- package/src/generation/grid/coords/texel_to_grid.js +10 -0
- package/src/generation/grid/generation/GridTaskApplyActionToCells.d.ts +2 -2
- package/src/generation/grid/generation/GridTaskApplyActionToCells.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskApplyActionToCells.js +10 -6
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +20 -21
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts +7 -0
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.js +18 -10
- package/src/generation/grid/generation/discrete/GridTaskCellularAutomata.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskCellularAutomata.js +16 -7
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts +5 -3
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +26 -23
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +10 -1
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.js +4 -0
- package/src/generation/grid/generation/road/GridTaskGenerateRoads.d.ts +15 -8
- package/src/generation/grid/generation/road/GridTaskGenerateRoads.d.ts.map +1 -1
- package/src/generation/grid/generation/road/GridTaskGenerateRoads.js +89 -92
- package/src/generation/markers/GridActionRuleSet.d.ts.map +1 -1
- package/src/generation/markers/GridActionRuleSet.js +10 -2
- package/src/generation/markers/GridCellActionPlaceMarker.d.ts +11 -0
- package/src/generation/markers/GridCellActionPlaceMarker.d.ts.map +1 -1
- package/src/generation/markers/GridCellActionPlaceMarker.js +20 -3
- package/src/generation/markers/GridCellActionPlaceMarkerGroup.d.ts +3 -1
- package/src/generation/markers/GridCellActionPlaceMarkerGroup.d.ts.map +1 -1
- package/src/generation/markers/GridCellActionPlaceMarkerGroup.js +9 -2
- package/src/generation/markers/MarkerNode.d.ts +8 -3
- package/src/generation/markers/MarkerNode.d.ts.map +1 -1
- package/src/generation/markers/MarkerNode.js +12 -5
- package/src/generation/markers/actions/MarkerNodeActionEntityPlacement.js +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessor.d.ts +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessor.d.ts.map +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessor.js +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorClingToTerrain.d.ts +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorClingToTerrain.d.ts.map +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorClingToTerrain.js +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.d.ts +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.d.ts.map +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.js +2 -2
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorSequence.d.ts +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorSequence.d.ts.map +1 -1
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorSequence.js +2 -2
- package/src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.d.ts.map +1 -1
- package/src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.js +6 -4
- package/src/generation/markers/actions/probability/MarkerNodeActionWeightedElement.d.ts.map +1 -1
- package/src/generation/markers/actions/probability/MarkerNodeActionWeightedElement.js +1 -3
- package/src/generation/markers/actions/terrain/MarkerNodeActionPaintTerrain.d.ts.map +1 -1
- package/src/generation/markers/actions/terrain/MarkerNodeActionPaintTerrain.js +12 -11
- package/src/generation/markers/matcher/MarkerNodeMatcherAnd.js +2 -2
- package/src/generation/markers/transform/MarkerNodeTransformer.d.ts +4 -1
- package/src/generation/markers/transform/MarkerNodeTransformer.d.ts.map +1 -1
- package/src/generation/markers/transform/MarkerNodeTransformer.js +4 -1
- package/src/generation/markers/transform/MarkerNodeTransformerAddPositionYFromFilter.d.ts.map +1 -1
- package/src/generation/markers/transform/MarkerNodeTransformerAddPositionYFromFilter.js +1 -3
- package/src/generation/markers/transform/MarkerNodeTransformerOffsetPosition.d.ts +5 -0
- package/src/generation/markers/transform/MarkerNodeTransformerOffsetPosition.d.ts.map +1 -1
- package/src/generation/markers/transform/MarkerNodeTransformerOffsetPosition.js +15 -0
- package/src/generation/markers/transform/MarkerNodeTransformerRecordProperty.d.ts.map +1 -1
- package/src/generation/markers/transform/MarkerNodeTransformerRecordProperty.js +1 -3
- package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilter.d.ts.map +1 -1
- package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilter.js +2 -4
- package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilterGradient.d.ts.map +1 -1
- package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilterGradient.js +1 -3
- package/src/generation/placement/GridCellPlacementRule.d.ts.map +1 -1
- package/src/generation/placement/GridCellPlacementRule.js +1 -3
- package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts.map +1 -1
- package/src/generation/placement/action/GridCellActionWriteFilterToLayer.js +8 -10
- package/src/generation/placement/action/random/weighted/CellActionSelectWeightedRandom.d.ts.map +1 -1
- package/src/generation/placement/action/random/weighted/CellActionSelectWeightedRandom.js +6 -4
- package/src/generation/placement/action/random/weighted/WeightedGridCellAction.d.ts.map +1 -1
- package/src/generation/placement/action/random/weighted/WeightedGridCellAction.js +1 -3
- package/src/generation/rules/CellMatcher.d.ts +3 -1
- package/src/generation/rules/CellMatcher.d.ts.map +1 -1
- package/src/generation/rules/CellMatcher.js +3 -1
- package/src/generation/rules/CellMatcherFromFilter.d.ts.map +1 -1
- package/src/generation/rules/CellMatcherFromFilter.js +1 -3
- package/src/generation/rules/CellMatcherLayerBitMaskTest.d.ts.map +1 -1
- package/src/generation/rules/CellMatcherLayerBitMaskTest.js +6 -20
- package/src/generation/test_support/executeTaskTreeSync.d.ts +9 -0
- package/src/generation/test_support/executeTaskTreeSync.d.ts.map +1 -0
- package/src/generation/test_support/executeTaskTreeSync.js +78 -0
- package/src/generation/theme/TerrainLayerRuleAggregator.d.ts +2 -1
- package/src/generation/theme/TerrainLayerRuleAggregator.d.ts.map +1 -1
- package/src/generation/theme/TerrainLayerRuleAggregator.js +9 -6
- package/src/generation/theme/Theme.d.ts +1 -1
- package/src/generation/theme/Theme.d.ts.map +1 -1
- package/src/generation/theme/Theme.js +2 -2
- package/src/generation/theme/ThemeEngine.d.ts +3 -3
- package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
- package/src/generation/theme/ThemeEngine.js +26 -16
- package/src/generation/theme/cell/CellProcessingRule.d.ts +3 -3
- package/src/generation/theme/cell/CellProcessingRule.d.ts.map +1 -1
- package/src/generation/theme/cell/CellProcessingRule.js +6 -10
- package/src/generation/theme/cell/CellProcessingRuleSet.d.ts +1 -1
- package/src/generation/theme/cell/CellProcessingRuleSet.d.ts.map +1 -1
- package/src/generation/theme/cell/CellProcessingRuleSet.js +2 -2
- package/src/view/common/ListView.js +1 -1
- package/src/view/elements/BottomLeftResizeHandleView.d.ts.map +1 -1
- package/src/view/elements/BottomLeftResizeHandleView.js +13 -5
- package/src/core/font/FontAsset.d.ts.map +0 -1
- package/src/core/font/FontAssetLoader.d.ts.map +0 -1
- package/src/core/geom/3d/shape/util/shape_to_visual_entity.d.ts.map +0 -1
- package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.d.ts.map +0 -1
- package/src/core/process/action/AsynchronousDelayAction.d.ts.map +0 -1
- package/src/engine/physics/computeInterceptPoint.d.ts.map +0 -1
- package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts.map +0 -1
- package/src/engine/physics/gjk/gjk.d.ts.map +0 -1
- package/src/engine/physics/gjk/gjk_epa_penetration.d.ts.map +0 -1
- package/src/engine/physics/gjk/minkowski_support.d.ts.map +0 -1
- package/src/engine/physics/gjk/mpr.d.ts.map +0 -1
- package/src/engine/physics/integration/quat_integrate.d.ts.map +0 -1
- package/src/engine/physics/island/union_find.d.ts.map +0 -1
- package/src/engine/physics/narrowphase/clip_against_axis_uv.d.ts.map +0 -1
- package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts.map +0 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskDistanceToMarkers.d.ts +0 -21
- package/src/generation/grid/generation/discrete/layer/GridTaskDistanceToMarkers.d.ts.map +0 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskDistanceToMarkers.js +0 -68
- package/src/generation/grid/generation/grid/GridTaskGridAlignedNodeGenerator.d.ts +0 -10
- package/src/generation/grid/generation/grid/GridTaskGridAlignedNodeGenerator.d.ts.map +0 -1
- package/src/generation/grid/generation/grid/GridTaskGridAlignedNodeGenerator.js +0 -17
- /package/src/{engine/physics → core/geom/3d}/gjk/NOTES.md +0 -0
- /package/src/{engine/physics → core/geom/3d}/gjk/gjk.d.ts +0 -0
- /package/src/{engine/physics → core/math/physics/kinematics}/computeInterceptPoint.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolverBodyState.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/body/SolverBodyState.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SolverBodyState.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/body/SolverBodyState.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,+CAA+C;AAC/C,6BAA8B;AAC9B,oFAAoF;AACpF,4BAA6B;AAC7B,4BAA6B;AAC7B,4BAA6B;AAC7B,oFAAoF;AACpF,uBAAwB;AACxB,uBAAwB;AACxB,uBAAwB;AACxB,uBAAwB;AACxB,kCAAkC;AAClC,yBAA0B;AAC1B,yBAA0B;AAC1B,0BAA2B;AAC3B,mCAAmC;AACnC,0BAA2B;AAC3B,0BAA2B;AAC3B,0BAA2B;AAE3B,wBAAwB;AACxB,4BAA6B;AAE7B;IACI,uCAoCC;IAjCG;;;OAGG;IACH,MAFU,YAAY,CAEwB;IAE9C;;;;;OAKG;IACH,gBAAkC;IAElC;;;;OAIG;IACH,mBAAsC;IAEtC,eAAe;IACf,yBAAyB;IAEzB;;;;OAIG;IACH,cAAc;IAEd,eAAe;IACf,mBAAqB;IAGzB;;;OAGG;IACH,6BAEC;IAED;;;;;OAKG;IACH,WAFW,MAAM,QAiBhB;IAED;;;;;;;;OAQG;IACH,YAJW,MAAM,6CAsDhB;IAED;;;;;;;OAOG;IACH,gBAFW,WAAW,QAoBrB;IAED;;;OAGG;IACH,eAeC;CACJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ceilPowerOfTwo } from "../../../core/binary/operations/ceilPowerOfTwo.js";
|
|
2
2
|
import { BodyKind } from "../ecs/BodyKind.js";
|
|
3
|
+
import { RigidBodyFlags } from "../ecs/RigidBodyFlags.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* # SolverBodyState — data-oriented mirror of the per-body solver hot state
|
|
@@ -171,10 +172,18 @@ export class SolverBodyState {
|
|
|
171
172
|
const dynamic = rb.kind === BodyKind.Dynamic;
|
|
172
173
|
if (dynamic) {
|
|
173
174
|
d[base + SBS_INV_MASS] = rb.mass > 0 ? 1 / rb.mass : 0;
|
|
175
|
+
// LockRot*: a locked BODY-LOCAL angular DOF gathers zero inverse
|
|
176
|
+
// inertia, so no contact or joint impulse can rotate the body
|
|
177
|
+
// about that local axis (world_inverse_inertia_apply rotates this
|
|
178
|
+
// diagonal, so the lock follows the body's orientation). Note the
|
|
179
|
+
// flag does not cancel a PRE-EXISTING spin about the axis — no
|
|
180
|
+
// impulse can change it any more; callers zero angularVelocity
|
|
181
|
+
// themselves when locking a body mid-spin.
|
|
174
182
|
const ii = rb.inverseInertiaLocal;
|
|
175
|
-
|
|
176
|
-
d[base +
|
|
177
|
-
d[base +
|
|
183
|
+
const flags = rb.flags;
|
|
184
|
+
d[base + SBS_INV_I_X] = (flags & RigidBodyFlags.LockRotX) !== 0 ? 0 : ii.x;
|
|
185
|
+
d[base + SBS_INV_I_Y] = (flags & RigidBodyFlags.LockRotY) !== 0 ? 0 : ii.y;
|
|
186
|
+
d[base + SBS_INV_I_Z] = (flags & RigidBodyFlags.LockRotZ) !== 0 ? 0 : ii.z;
|
|
178
187
|
} else {
|
|
179
188
|
// Static / Kinematic: immovable to the solver — no inverse mass,
|
|
180
189
|
// no inverse inertia (mirrors the object path's `kind` guards).
|
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Tight world AABB of a shape under a pose — the containment probe for the
|
|
3
|
+
* stage-2 refit skip, and the base box {@link fatten_world_aabb} pads.
|
|
4
|
+
*
|
|
5
|
+
* @param {number[]|Float32Array|Float64Array} result
|
|
6
|
+
* @param {number} result_offset
|
|
7
|
+
* @param {AbstractShape3D} shape
|
|
8
|
+
* @param {Transform} transform
|
|
9
|
+
*/
|
|
10
|
+
export function compute_world_aabb(result: number[] | Float32Array | Float64Array, result_offset: number, shape: AbstractShape3D, transform: Transform): void;
|
|
11
|
+
/**
|
|
12
|
+
* Inflate a world AABB in place: a symmetric constant slack plus a
|
|
13
|
+
* DIRECTIONAL velocity pad — each axis extends only toward where the body is
|
|
14
|
+
* heading (`lower += min(v·dt·k, 0)`, `upper += max(v·dt·k, 0)`). A symmetric
|
|
15
|
+
* velocity pad swept up to ~8× the volume a moving body can actually reach
|
|
16
|
+
* this step, manufacturing false broadphase pairs at speed for nothing.
|
|
17
|
+
*
|
|
18
|
+
* @param {number[]|Float32Array|Float64Array} aabb inflated in place
|
|
19
|
+
* @param {number} offset
|
|
20
|
+
* @param {number} vx world linear velocity x
|
|
21
|
+
* @param {number} vy world linear velocity y
|
|
22
|
+
* @param {number} vz world linear velocity z
|
|
23
|
+
* @param {number} dt step size
|
|
24
|
+
*/
|
|
25
|
+
export function fatten_world_aabb(aabb: number[] | Float32Array | Float64Array, offset: number, vx: number, vy: number, vz: number, dt: number): void;
|
|
26
|
+
/**
|
|
27
|
+
* Compute the inflated world AABB of a shape under a pose, padded by a
|
|
28
|
+
* symmetric constant slack and a directional velocity-proportional swept
|
|
29
|
+
* extent. The output is the thing to hand to `BVH#node_move_aabb`.
|
|
5
30
|
*
|
|
6
31
|
* @param {number[]|Float32Array|Float64Array} result
|
|
7
32
|
* @param {number} result_offset
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute_fat_world_aabb.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/broadphase/compute_fat_world_aabb.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compute_fat_world_aabb.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/broadphase/compute_fat_world_aabb.js"],"names":[],"mappings":"AAuBA;;;;;;;;GAQG;AACH,2CALW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,sDAiBhB;AAED;;;;;;;;;;;;;GAaG;AACH,wCAPW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,UAClC,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAchB;AAED;;;;;;;;;;;;;GAaG;AACH,+CATW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,oDAGN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAShB"}
|
|
@@ -4,38 +4,33 @@ const scratch_local = new Float64Array(6);
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Constant inflation applied to a world AABB so a small motion doesn't churn
|
|
7
|
-
* the broadphase. Tuned to Box2D / Bullet conventions.
|
|
7
|
+
* the broadphase. Tuned to Box2D / Bullet conventions. Symmetric: jitter has
|
|
8
|
+
* no preferred direction.
|
|
8
9
|
* @type {number}
|
|
9
10
|
*/
|
|
10
11
|
const FAT_LINEAR = 0.05;
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
|
-
* Per-second-of-velocity inflation. Two seconds of motion is a generous
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Per-second-of-velocity inflation. Two seconds of motion is a generous
|
|
15
|
+
* look-ahead; the refit skip at the call site (PhysicsSystem stage 2 keeps a
|
|
16
|
+
* leaf's stored fat AABB while the body's tight AABB stays inside it) is what
|
|
17
|
+
* turns the look-ahead into amortised refit savings, so this is a hint, not
|
|
18
|
+
* an upper bound. Applied DIRECTIONALLY — only ahead of the velocity; the
|
|
19
|
+
* swept volume of this step's motion has no trailing side.
|
|
16
20
|
* @type {number}
|
|
17
21
|
*/
|
|
18
22
|
const FAT_VELOCITY_MULTIPLIER = 2;
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* thing to hand to `BVH#node_move_aabb`.
|
|
25
|
+
* Tight world AABB of a shape under a pose — the containment probe for the
|
|
26
|
+
* stage-2 refit skip, and the base box {@link fatten_world_aabb} pads.
|
|
24
27
|
*
|
|
25
28
|
* @param {number[]|Float32Array|Float64Array} result
|
|
26
29
|
* @param {number} result_offset
|
|
27
30
|
* @param {AbstractShape3D} shape
|
|
28
31
|
* @param {Transform} transform
|
|
29
|
-
* @param {number} vx world linear velocity x
|
|
30
|
-
* @param {number} vy world linear velocity y
|
|
31
|
-
* @param {number} vz world linear velocity z
|
|
32
|
-
* @param {number} dt step size
|
|
33
32
|
*/
|
|
34
|
-
export function
|
|
35
|
-
result, result_offset,
|
|
36
|
-
shape, transform,
|
|
37
|
-
vx, vy, vz, dt
|
|
38
|
-
) {
|
|
33
|
+
export function compute_world_aabb(result, result_offset, shape, transform) {
|
|
39
34
|
shape.compute_bounding_box(scratch_local);
|
|
40
35
|
|
|
41
36
|
const p = transform.position;
|
|
@@ -48,14 +43,55 @@ export function compute_fat_world_aabb(
|
|
|
48
43
|
p.x, p.y, p.z,
|
|
49
44
|
q.x, q.y, q.z, q.w
|
|
50
45
|
);
|
|
46
|
+
}
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Inflate a world AABB in place: a symmetric constant slack plus a
|
|
50
|
+
* DIRECTIONAL velocity pad — each axis extends only toward where the body is
|
|
51
|
+
* heading (`lower += min(v·dt·k, 0)`, `upper += max(v·dt·k, 0)`). A symmetric
|
|
52
|
+
* velocity pad swept up to ~8× the volume a moving body can actually reach
|
|
53
|
+
* this step, manufacturing false broadphase pairs at speed for nothing.
|
|
54
|
+
*
|
|
55
|
+
* @param {number[]|Float32Array|Float64Array} aabb inflated in place
|
|
56
|
+
* @param {number} offset
|
|
57
|
+
* @param {number} vx world linear velocity x
|
|
58
|
+
* @param {number} vy world linear velocity y
|
|
59
|
+
* @param {number} vz world linear velocity z
|
|
60
|
+
* @param {number} dt step size
|
|
61
|
+
*/
|
|
62
|
+
export function fatten_world_aabb(aabb, offset, vx, vy, vz, dt) {
|
|
63
|
+
const k = FAT_VELOCITY_MULTIPLIER * dt;
|
|
64
|
+
const px = vx * k;
|
|
65
|
+
const py = vy * k;
|
|
66
|
+
const pz = vz * k;
|
|
54
67
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
aabb[offset] += (px < 0 ? px : 0) - FAT_LINEAR;
|
|
69
|
+
aabb[offset + 1] += (py < 0 ? py : 0) - FAT_LINEAR;
|
|
70
|
+
aabb[offset + 2] += (pz < 0 ? pz : 0) - FAT_LINEAR;
|
|
71
|
+
aabb[offset + 3] += (px > 0 ? px : 0) + FAT_LINEAR;
|
|
72
|
+
aabb[offset + 4] += (py > 0 ? py : 0) + FAT_LINEAR;
|
|
73
|
+
aabb[offset + 5] += (pz > 0 ? pz : 0) + FAT_LINEAR;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Compute the inflated world AABB of a shape under a pose, padded by a
|
|
78
|
+
* symmetric constant slack and a directional velocity-proportional swept
|
|
79
|
+
* extent. The output is the thing to hand to `BVH#node_move_aabb`.
|
|
80
|
+
*
|
|
81
|
+
* @param {number[]|Float32Array|Float64Array} result
|
|
82
|
+
* @param {number} result_offset
|
|
83
|
+
* @param {AbstractShape3D} shape
|
|
84
|
+
* @param {Transform} transform
|
|
85
|
+
* @param {number} vx world linear velocity x
|
|
86
|
+
* @param {number} vy world linear velocity y
|
|
87
|
+
* @param {number} vz world linear velocity z
|
|
88
|
+
* @param {number} dt step size
|
|
89
|
+
*/
|
|
90
|
+
export function compute_fat_world_aabb(
|
|
91
|
+
result, result_offset,
|
|
92
|
+
shape, transform,
|
|
93
|
+
vx, vy, vz, dt
|
|
94
|
+
) {
|
|
95
|
+
compute_world_aabb(result, result_offset, shape, transform);
|
|
96
|
+
fatten_world_aabb(result, result_offset, vx, vy, vz, dt);
|
|
61
97
|
}
|
|
@@ -11,11 +11,15 @@
|
|
|
11
11
|
* canonical `(min, max)` pair list — narrowphase then resolves the
|
|
12
12
|
* collider-cross-product internally.
|
|
13
13
|
*
|
|
14
|
-
* Determinism: pair
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* Determinism: each pair's (A, B) assignment is ENTITY-canonical — the
|
|
15
|
+
* body with the smaller entity id is A. Packed body ids encode slot
|
|
16
|
+
* allocation history, which two engines holding identical body state need
|
|
17
|
+
* not share; the A/B roles leak into everything downstream (contact
|
|
18
|
+
* witness sides, normal orientation, tangent-basis derivation, event
|
|
19
|
+
* payloads), so they must derive from the cross-engine identity. Pair
|
|
20
|
+
* encounter ORDER, by contrast, is allowed to vary (awake-list × BVH
|
|
21
|
+
* traversal history): every outcome-coupled consumer re-orders by entity
|
|
22
|
+
* key (islands sort contacts, events sort canonically).
|
|
19
23
|
*
|
|
20
24
|
* @param {BodyStorage} storage
|
|
21
25
|
* @param {BVH} dynamic_bvh
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate_pairs.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/broadphase/generate_pairs.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate_pairs.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/broadphase/generate_pairs.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,uIATW,MAAM,MAAM;IAAC,QAAQ,WAAW;IAAC,SAAS,YAAY;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CAAC,+CAElF,MAAM,OAAO,MAAM,KAAK,OAAO,oCAyFhD"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { assert } from "../../../core/assert.js";
|
|
2
1
|
import { bvh_query_user_data_overlaps_aabb } from "../../../core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.js";
|
|
3
|
-
import { pack_body_id } from "../body/BodyStorage.js";
|
|
2
|
+
import { body_id_index, pack_body_id } from "../body/BodyStorage.js";
|
|
4
3
|
|
|
5
4
|
const scratch_aabb = new Float64Array(6);
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Per-leaf candidate buffer. `let` + grow-and-retry (the BVH query returns
|
|
8
|
+
* the TRUE overlap count and drops writes past the end): a fixed cap would
|
|
9
|
+
* deterministically drop the SAME trailing candidates every frame — a
|
|
10
|
+
* permanently missed contact in dense scenes, not a transient.
|
|
11
|
+
* @type {Uint32Array}
|
|
12
|
+
*/
|
|
13
|
+
let candidates = new Uint32Array(1024);
|
|
7
14
|
|
|
8
15
|
/**
|
|
9
16
|
* Iterate every awake body, query both BVHs from each of its attached
|
|
@@ -18,11 +25,15 @@ const candidates = new Uint32Array(1024);
|
|
|
18
25
|
* canonical `(min, max)` pair list — narrowphase then resolves the
|
|
19
26
|
* collider-cross-product internally.
|
|
20
27
|
*
|
|
21
|
-
* Determinism: pair
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
28
|
+
* Determinism: each pair's (A, B) assignment is ENTITY-canonical — the
|
|
29
|
+
* body with the smaller entity id is A. Packed body ids encode slot
|
|
30
|
+
* allocation history, which two engines holding identical body state need
|
|
31
|
+
* not share; the A/B roles leak into everything downstream (contact
|
|
32
|
+
* witness sides, normal orientation, tangent-basis derivation, event
|
|
33
|
+
* payloads), so they must derive from the cross-engine identity. Pair
|
|
34
|
+
* encounter ORDER, by contrast, is allowed to vary (awake-list × BVH
|
|
35
|
+
* traversal history): every outcome-coupled consumer re-orders by entity
|
|
36
|
+
* key (islands sort contacts, events sort canonically).
|
|
26
37
|
*
|
|
27
38
|
* @param {BodyStorage} storage
|
|
28
39
|
* @param {BVH} dynamic_bvh
|
|
@@ -58,34 +69,34 @@ export function generate_pairs(
|
|
|
58
69
|
|
|
59
70
|
const gen = storage.generation_at(body_idx);
|
|
60
71
|
const my_packed = pack_body_id(body_idx, gen); // single-source the bit layout
|
|
72
|
+
const my_entity = storage.entity_at(body_idx);
|
|
61
73
|
|
|
62
74
|
for (let k = 0; k < list.length; k++) {
|
|
63
75
|
const node = list[k].bvhNode;
|
|
64
76
|
dynamic_bvh.node_get_aabb(node, scratch_aabb);
|
|
65
77
|
|
|
66
|
-
// Dynamic ↔ Dynamic.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// the overflow deterministically — the fat AABBs persist, so any
|
|
81
|
-
// missed pair is re-detected next frame.
|
|
82
|
-
if (n > candidates.length) n = candidates.length;
|
|
78
|
+
// Dynamic ↔ Dynamic. Grow-and-retry: the query returns the TRUE
|
|
79
|
+
// overlap count and drops writes past the buffer end, so on
|
|
80
|
+
// overflow we re-query into a doubled buffer (deterministic
|
|
81
|
+
// queries → converges in one resize, amortised to zero).
|
|
82
|
+
let n;
|
|
83
|
+
for (;;) {
|
|
84
|
+
n = bvh_query_user_data_overlaps_aabb(
|
|
85
|
+
candidates, 0,
|
|
86
|
+
dynamic_bvh,
|
|
87
|
+
scratch_aabb
|
|
88
|
+
);
|
|
89
|
+
if (n <= candidates.length) break;
|
|
90
|
+
candidates = new Uint32Array(Math.max(n, candidates.length * 2));
|
|
91
|
+
}
|
|
83
92
|
for (let c = 0; c < n; c++) {
|
|
84
93
|
const other = candidates[c];
|
|
85
94
|
if (other === my_packed) continue;
|
|
86
95
|
|
|
87
|
-
|
|
88
|
-
const
|
|
96
|
+
// Entity-canonical roles — see the header.
|
|
97
|
+
const other_entity = storage.entity_at(body_id_index(other));
|
|
98
|
+
const idA = my_entity < other_entity ? my_packed : other;
|
|
99
|
+
const idB = my_entity < other_entity ? other : my_packed;
|
|
89
100
|
|
|
90
101
|
const existing = manifolds.find(idA, idB);
|
|
91
102
|
if (existing !== -1 && manifolds.is_touched(existing)) continue;
|
|
@@ -94,18 +105,22 @@ export function generate_pairs(
|
|
|
94
105
|
pair_list_out.push(idA, idB);
|
|
95
106
|
}
|
|
96
107
|
|
|
97
|
-
// Dynamic ↔ Static.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
// Dynamic ↔ Static. Same grow-and-retry as the dynamic loop.
|
|
109
|
+
for (;;) {
|
|
110
|
+
n = bvh_query_user_data_overlaps_aabb(
|
|
111
|
+
candidates, 0,
|
|
112
|
+
static_bvh,
|
|
113
|
+
scratch_aabb
|
|
114
|
+
);
|
|
115
|
+
if (n <= candidates.length) break;
|
|
116
|
+
candidates = new Uint32Array(Math.max(n, candidates.length * 2));
|
|
117
|
+
}
|
|
105
118
|
for (let c = 0; c < n; c++) {
|
|
106
119
|
const other = candidates[c];
|
|
107
|
-
|
|
108
|
-
const
|
|
120
|
+
|
|
121
|
+
const other_entity = storage.entity_at(body_id_index(other));
|
|
122
|
+
const idA = my_entity < other_entity ? my_packed : other;
|
|
123
|
+
const idB = my_entity < other_entity ? other : my_packed;
|
|
109
124
|
|
|
110
125
|
const existing = manifolds.find(idA, idB);
|
|
111
126
|
if (existing !== -1 && manifolds.is_touched(existing)) continue;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Sweep `shape` (held at the fixed `rotation`) linearly from `(fx,fy,fz)` to
|
|
3
|
-
* `(tx,ty,tz)` through both broadphase trees, ignoring
|
|
4
|
-
* `exclude_entity
|
|
3
|
+
* `(tx,ty,tz)` through both broadphase trees, ignoring the BODY owned by
|
|
4
|
+
* `exclude_entity` (all its colliders, including ones attached to child
|
|
5
|
+
* entities), sensors, and any pair the system's layer/mask + user contact
|
|
6
|
+
* filter rejects.
|
|
5
7
|
*
|
|
6
8
|
* Returns the traversable fraction of the segment in `[0, 1]`: `1` means the
|
|
7
9
|
* path is clear; a value `< 1` means a blocker was hit at that fraction and
|
|
@@ -18,7 +20,8 @@
|
|
|
18
20
|
* @param {number} tx
|
|
19
21
|
* @param {number} ty
|
|
20
22
|
* @param {number} tz
|
|
21
|
-
* @param {number} exclude_entity entity
|
|
23
|
+
* @param {number} exclude_entity entity owning the swept body (the body is
|
|
24
|
+
* resolved and excluded by BODY id); -1 for an unowned sweep
|
|
22
25
|
* @param {PhysicsSurfacePoint} result populated on hit; untouched on a clear path
|
|
23
26
|
* @returns {number} traversable fraction in [0, 1]
|
|
24
27
|
*/
|
|
@@ -37,8 +40,15 @@ export function ccd_sweep_segment(system: import("../ecs/PhysicsSystem.js").Phys
|
|
|
37
40
|
*
|
|
38
41
|
* Start-of-step positions are captured into `system.__ccd_start_pos` (3 doubles
|
|
39
42
|
* per body index) before the substep loop; this pass reads the final pose from
|
|
40
|
-
* the live Transform.
|
|
41
|
-
*
|
|
43
|
+
* the live Transform.
|
|
44
|
+
*
|
|
45
|
+
* Bodies are processed in ENTITY order, not awake-list order. CCD order is
|
|
46
|
+
* outcome-coupled: an earlier body's clamp moves the pose a later body's
|
|
47
|
+
* sweep tests against, so two mutually-blocking CCD movers resolve
|
|
48
|
+
* differently under different orders. The awake list encodes wake/sleep
|
|
49
|
+
* HISTORY (swap-remove + append), which two engines holding identical body
|
|
50
|
+
* state need not share; entity order is derivable from state alone — the
|
|
51
|
+
* determinism contract.
|
|
42
52
|
*
|
|
43
53
|
* @param {import("../ecs/PhysicsSystem.js").PhysicsSystem} system
|
|
44
54
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linear_sweep.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/ccd/linear_sweep.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linear_sweep.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/ccd/linear_sweep.js"],"names":[],"mappings":"AA6HA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,0CAdW,OAAO,yBAAyB,EAAE,aAAa,SAC/C,OAAO,gDAAgD,EAAE,eAAe,YACxE;IAAC,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAC;IAAA,CAAC,EAAC,MAAM,CAAA;CAAC,MACrC,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,kBACN,MAAM,UAEN,mBAAmB,GACjB,MAAM,CA2ClB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oCAFW,OAAO,yBAAyB,EAAE,aAAa,QAwGzD;AAvTD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,qCAFU,MAAM,CAE2B;oCArDP,mCAAmC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BODY_INDEX_ABSENT, body_id_index, pack_body_id } from "../body/BodyStorage.js";
|
|
2
2
|
import { BodyKind } from "../ecs/BodyKind.js";
|
|
3
|
+
import { is_sensor } from "../ecs/is_sensor.js";
|
|
3
4
|
import { RigidBodyFlags } from "../ecs/RigidBodyFlags.js";
|
|
4
5
|
import { PhysicsSurfacePoint } from "../queries/PhysicsSurfacePoint.js";
|
|
5
6
|
import { shape_cast } from "../queries/shape_cast.js";
|
|
@@ -56,46 +57,78 @@ import { shape_cast } from "../queries/shape_cast.js";
|
|
|
56
57
|
*/
|
|
57
58
|
export const CCD_MIN_SWEEP_DISTANCE = 1e-3;
|
|
58
59
|
|
|
59
|
-
/**
|
|
60
|
-
* Impact distances at or below this (metres) mean the body was already
|
|
61
|
-
* overlapping the target at the start of the step — i.e. a resting / sliding
|
|
62
|
-
* contact the discrete solver owns, not a tunnel. The sweep ignores these so
|
|
63
|
-
* CCD never clamps a body to a surface it is merely sitting or sliding on.
|
|
64
|
-
* @type {number}
|
|
65
|
-
*/
|
|
66
|
-
const CCD_INITIAL_OVERLAP_EPS = 1e-6;
|
|
67
|
-
|
|
68
60
|
// ── Module scratch ──────────────────────────────────────────────────────────
|
|
69
61
|
// CCD runs inside the step loop; reuse buffers so the pass allocates nothing.
|
|
70
62
|
|
|
71
|
-
/**
|
|
72
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Swept ray, re-seeded per sweep (origin, unit direction, tMax). A plain
|
|
65
|
+
* DOUBLE-precision ray-like rather than a `Ray3`: Ray3 is Float32Array-backed,
|
|
66
|
+
* and funnelling the f64 sweep endpoints through f32 quantises them (~1 mm at
|
|
67
|
+
* |coord| ≈ 10⁴, ~16 mm at 10⁵) — visible TOI jitter far from the world
|
|
68
|
+
* origin. {@link shape_cast} reads only the named accessors, so a ray-like
|
|
69
|
+
* object preserves the Transform's full f64 precision end to end.
|
|
70
|
+
*/
|
|
71
|
+
const _ray = {
|
|
72
|
+
origin_x: 0, origin_y: 0, origin_z: 0,
|
|
73
|
+
direction_x: 0, direction_y: 0, direction_z: 0,
|
|
74
|
+
tMax: 0,
|
|
75
|
+
};
|
|
73
76
|
|
|
74
77
|
/** Sweep result reused across bodies inside {@link ccd_resolve}. */
|
|
75
78
|
const _hit = new PhysicsSurfacePoint();
|
|
76
79
|
|
|
77
80
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
+
* CCD-eligible body indices of the current pass, ordered by ENTITY id.
|
|
82
|
+
* Grows by doubling; module-scoped so the pass allocates nothing in steady
|
|
83
|
+
* state.
|
|
84
|
+
* @type {Uint32Array}
|
|
85
|
+
*/
|
|
86
|
+
let _ccd_order = new Uint32Array(64);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* System the current sweep runs against. Module-scoped so {@link _ccd_filter}
|
|
90
|
+
* stays a stable, non-allocating reference handed to {@link shape_cast}.
|
|
91
|
+
* @type {import("../ecs/PhysicsSystem.js").PhysicsSystem|null}
|
|
92
|
+
*/
|
|
93
|
+
let _system = null;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Packed body id of the swept body — excluded from its own sweep; -1 when the
|
|
97
|
+
* sweep has no owning body (then only the sensor rule applies).
|
|
81
98
|
* @type {number}
|
|
82
99
|
*/
|
|
83
|
-
let
|
|
100
|
+
let _self_body_id = -1;
|
|
84
101
|
|
|
85
102
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
103
|
+
* Sweep filter, mirroring the discrete pipeline's pair acceptance:
|
|
104
|
+
* - never the swept body itself. BODY-id exclusion: every collider of a
|
|
105
|
+
* compound body carries the body id in the broadphase, including ones
|
|
106
|
+
* attached to child entities — entity comparison missed those, the body
|
|
107
|
+
* swept against itself at t = 0, and the t = 0 hit disabled its CCD;
|
|
108
|
+
* - sensors are not solid surfaces — a sweep passes through a trigger
|
|
109
|
+
* volume (same rule and rationale as {@link raycast});
|
|
110
|
+
* - layer/mask + the user contact filter via `system.__pair_filter`, so CCD
|
|
111
|
+
* never clamps a body onto geometry the discrete solver would not
|
|
112
|
+
* collide it with.
|
|
113
|
+
*
|
|
114
|
+
* @param {number} entity candidate body's entity
|
|
115
|
+
* @param {Collider} collider candidate body's primary collider
|
|
116
|
+
* @param {number} body_id candidate's packed body id
|
|
89
117
|
* @returns {boolean}
|
|
90
118
|
*/
|
|
91
|
-
function
|
|
92
|
-
|
|
119
|
+
function _ccd_filter(entity, collider, body_id) {
|
|
120
|
+
if (body_id === _self_body_id) return false;
|
|
121
|
+
if (is_sensor(_system.__bodies[body_id_index(body_id)], collider)) return false;
|
|
122
|
+
if (_self_body_id !== -1 && !_system.__pair_filter(_self_body_id, body_id)) return false;
|
|
123
|
+
return true;
|
|
93
124
|
}
|
|
94
125
|
|
|
95
126
|
/**
|
|
96
127
|
* Sweep `shape` (held at the fixed `rotation`) linearly from `(fx,fy,fz)` to
|
|
97
|
-
* `(tx,ty,tz)` through both broadphase trees, ignoring
|
|
98
|
-
* `exclude_entity
|
|
128
|
+
* `(tx,ty,tz)` through both broadphase trees, ignoring the BODY owned by
|
|
129
|
+
* `exclude_entity` (all its colliders, including ones attached to child
|
|
130
|
+
* entities), sensors, and any pair the system's layer/mask + user contact
|
|
131
|
+
* filter rejects.
|
|
99
132
|
*
|
|
100
133
|
* Returns the traversable fraction of the segment in `[0, 1]`: `1` means the
|
|
101
134
|
* path is clear; a value `< 1` means a blocker was hit at that fraction and
|
|
@@ -112,7 +145,8 @@ function _exclude_self(entity) {
|
|
|
112
145
|
* @param {number} tx
|
|
113
146
|
* @param {number} ty
|
|
114
147
|
* @param {number} tz
|
|
115
|
-
* @param {number} exclude_entity entity
|
|
148
|
+
* @param {number} exclude_entity entity owning the swept body (the body is
|
|
149
|
+
* resolved and excluded by BODY id); -1 for an unowned sweep
|
|
116
150
|
* @param {PhysicsSurfacePoint} result populated on hit; untouched on a clear path
|
|
117
151
|
* @returns {number} traversable fraction in [0, 1]
|
|
118
152
|
*/
|
|
@@ -128,21 +162,29 @@ export function ccd_sweep_segment(
|
|
|
128
162
|
if (len === 0) return 1;
|
|
129
163
|
|
|
130
164
|
const inv = 1 / len;
|
|
131
|
-
_ray
|
|
132
|
-
_ray
|
|
133
|
-
_ray
|
|
165
|
+
_ray.origin_x = fx; _ray.origin_y = fy; _ray.origin_z = fz;
|
|
166
|
+
_ray.direction_x = dx * inv; _ray.direction_y = dy * inv; _ray.direction_z = dz * inv;
|
|
167
|
+
_ray.tMax = len; // tMax in metres — direction is unit length
|
|
134
168
|
|
|
135
|
-
|
|
136
|
-
|
|
169
|
+
// Resolve the swept body once: self-exclusion compares packed BODY ids in
|
|
170
|
+
// the filter (broadphase leaves carry body ids), and the pair filter needs
|
|
171
|
+
// the id pair.
|
|
172
|
+
const storage = system.storage;
|
|
173
|
+
const self_idx = exclude_entity >= 0 ? storage.index_of_entity(exclude_entity) : BODY_INDEX_ABSENT;
|
|
174
|
+
_self_body_id = self_idx === BODY_INDEX_ABSENT ? -1 : pack_body_id(self_idx, storage.generation_at(self_idx));
|
|
175
|
+
_system = system;
|
|
176
|
+
|
|
177
|
+
// skip_initial_overlaps: a candidate already overlapping at the segment
|
|
178
|
+
// start is a resting / sliding contact the discrete solver owns, not a
|
|
179
|
+
// tunnel — the cast steps over it PER CANDIDATE and keeps scanning, so a
|
|
180
|
+
// body sliding on the ground still gets swept against every real blocker
|
|
181
|
+
// along its path. (A whole-sweep "t ≈ 0 means resting" bail-out is wrong
|
|
182
|
+
// twice over: one resting contact would disable CCD against everything
|
|
183
|
+
// else, and a genuine first impact a hair ahead would be dropped too.)
|
|
184
|
+
if (!shape_cast(system, _ray, shape, rotation, result, _ccd_filter, true)) {
|
|
137
185
|
return 1;
|
|
138
186
|
}
|
|
139
187
|
|
|
140
|
-
// An impact at t ≈ 0 means the swept shape was already overlapping the
|
|
141
|
-
// target at the segment start — a resting / sliding contact, not a tunnel.
|
|
142
|
-
// The discrete solver owns it; clamping here would freeze a body onto a
|
|
143
|
-
// surface it is sitting or sliding on. Treat as a clear path.
|
|
144
|
-
if (result.t <= CCD_INITIAL_OVERLAP_EPS) return 1;
|
|
145
|
-
|
|
146
188
|
// result.t is the impact distance along the unit direction; normalise to a
|
|
147
189
|
// segment fraction. shape_cast reports the just-SEPARATING side of its
|
|
148
190
|
// bisection, so the swept shape at `result.t` is provably not overlapping —
|
|
@@ -160,8 +202,15 @@ export function ccd_sweep_segment(
|
|
|
160
202
|
*
|
|
161
203
|
* Start-of-step positions are captured into `system.__ccd_start_pos` (3 doubles
|
|
162
204
|
* per body index) before the substep loop; this pass reads the final pose from
|
|
163
|
-
* the live Transform.
|
|
164
|
-
*
|
|
205
|
+
* the live Transform.
|
|
206
|
+
*
|
|
207
|
+
* Bodies are processed in ENTITY order, not awake-list order. CCD order is
|
|
208
|
+
* outcome-coupled: an earlier body's clamp moves the pose a later body's
|
|
209
|
+
* sweep tests against, so two mutually-blocking CCD movers resolve
|
|
210
|
+
* differently under different orders. The awake list encodes wake/sleep
|
|
211
|
+
* HISTORY (swap-remove + append), which two engines holding identical body
|
|
212
|
+
* state need not share; entity order is derivable from state alone — the
|
|
213
|
+
* determinism contract.
|
|
165
214
|
*
|
|
166
215
|
* @param {import("../ecs/PhysicsSystem.js").PhysicsSystem} system
|
|
167
216
|
*/
|
|
@@ -172,6 +221,8 @@ export function ccd_resolve(system) {
|
|
|
172
221
|
const start = system.__ccd_start_pos;
|
|
173
222
|
const CCD = RigidBodyFlags.CCD;
|
|
174
223
|
|
|
224
|
+
// Collect the CCD-eligible awake bodies…
|
|
225
|
+
let n = 0;
|
|
175
226
|
for (let i = 0; i < count; i++) {
|
|
176
227
|
const idx = storage.awake_at(i);
|
|
177
228
|
|
|
@@ -182,6 +233,32 @@ export function ccd_resolve(system) {
|
|
|
182
233
|
|
|
183
234
|
const list = lists[idx];
|
|
184
235
|
if (list === undefined || list.length === 0) continue;
|
|
236
|
+
|
|
237
|
+
if (n === _ccd_order.length) {
|
|
238
|
+
const next = new Uint32Array(_ccd_order.length * 2);
|
|
239
|
+
next.set(_ccd_order);
|
|
240
|
+
_ccd_order = next;
|
|
241
|
+
}
|
|
242
|
+
_ccd_order[n++] = idx;
|
|
243
|
+
}
|
|
244
|
+
if (n === 0) return;
|
|
245
|
+
|
|
246
|
+
// …and order them by entity (insertion sort; CCD bodies are few).
|
|
247
|
+
for (let i = 1; i < n; i++) {
|
|
248
|
+
const idx = _ccd_order[i];
|
|
249
|
+
const key = storage.entity_at(idx);
|
|
250
|
+
let j = i - 1;
|
|
251
|
+
while (j >= 0 && storage.entity_at(_ccd_order[j]) > key) {
|
|
252
|
+
_ccd_order[j + 1] = _ccd_order[j];
|
|
253
|
+
j--;
|
|
254
|
+
}
|
|
255
|
+
_ccd_order[j + 1] = idx;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
for (let i = 0; i < n; i++) {
|
|
259
|
+
const idx = _ccd_order[i];
|
|
260
|
+
const rb = system.__bodies[idx];
|
|
261
|
+
const list = lists[idx];
|
|
185
262
|
const primary = list[0];
|
|
186
263
|
const tr = primary.transform;
|
|
187
264
|
const p = tr.position;
|
|
@@ -203,15 +280,20 @@ export function ccd_resolve(system) {
|
|
|
203
280
|
// jitter) — avoids a degenerate sweep and the query cost. NOT tied to
|
|
204
281
|
// body size: a body tunnels a thin obstacle at speeds well below its
|
|
205
282
|
// own extent, so the threshold is a small absolute slop. A resting /
|
|
206
|
-
// sliding body that does clear it is still safe — the
|
|
207
|
-
//
|
|
283
|
+
// sliding body that does clear it is still safe — the cast skips
|
|
284
|
+
// candidates it already overlaps at the start (skip_initial_overlaps),
|
|
285
|
+
// sweeping only against real blockers along the path.
|
|
208
286
|
if (disp2 <= CCD_MIN_SWEEP_DISTANCE * CCD_MIN_SWEEP_DISTANCE) continue;
|
|
209
287
|
|
|
210
288
|
const shape = primary.collider.shape;
|
|
289
|
+
// Exclude by the body's OWN entity (which resolves to its body id) —
|
|
290
|
+
// NOT primary.entity: a compound body's primary collider can live on a
|
|
291
|
+
// CHILD entity, and excluding that child would leave the body's other
|
|
292
|
+
// leaves visible to its own sweep (self-hit at t = 0).
|
|
211
293
|
const frac = ccd_sweep_segment(
|
|
212
294
|
system, shape, tr.rotation,
|
|
213
295
|
sx, sy, sz, ex, ey, ez,
|
|
214
|
-
|
|
296
|
+
storage.entity_at(idx), _hit,
|
|
215
297
|
);
|
|
216
298
|
if (frac >= 1) continue; // clear path — no tunnelling this step
|
|
217
299
|
|