@luma.gl/graph 10.0.0-beta.1 → 10.0.0-beta.3
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/dist/arrow/gpu/arrow-gpu-analytics-adapters.cjs +22 -9
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts +11 -2
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js +27 -10
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.cjs +24 -13
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts +9 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.js +41 -14
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +24 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +10 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +29 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
- package/dist/arrow/index.cjs +2 -0
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/index.d.ts +1 -1
- package/dist/arrow/index.d.ts.map +1 -1
- package/dist/arrow/index.js +1 -1
- package/dist/arrow/index.js.map +1 -1
- package/dist/experimental-models.cjs +21 -0
- package/dist/experimental-models.d.ts +2 -0
- package/dist/experimental-models.d.ts.map +1 -0
- package/dist/experimental-models.js +5 -0
- package/dist/experimental-models.js.map +1 -0
- package/dist/experimental-simulation.cjs +21 -0
- package/dist/experimental-simulation.d.ts +2 -0
- package/dist/experimental-simulation.d.ts.map +1 -0
- package/dist/experimental-simulation.js +5 -0
- package/dist/experimental-simulation.js.map +1 -0
- package/dist/gpu-core/gpu-bvh-bounds.cjs +63 -0
- package/dist/gpu-core/gpu-bvh-bounds.d.ts +32 -0
- package/dist/gpu-core/gpu-bvh-bounds.d.ts.map +1 -0
- package/dist/gpu-core/gpu-bvh-bounds.js +56 -0
- package/dist/gpu-core/gpu-bvh-bounds.js.map +1 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.cjs +92 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.d.ts +41 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.d.ts.map +1 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.js +85 -0
- package/dist/gpu-core/gpu-command-graph-submission-pacer.js.map +1 -0
- package/dist/gpu-core/index.cjs +6 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +4 -0
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +2 -0
- package/dist/gpu-core/index.js.map +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.cjs +6 -6
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.d.ts +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.js +6 -6
- package/dist/gpu-dataframe/gpu-analytics-compiler-utils.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.cjs +60 -15
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts +13 -2
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.js +69 -18
- package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame.cjs +1 -3
- package/dist/gpu-dataframe/gpu-data-frame.d.ts +10 -0
- package/dist/gpu-dataframe/gpu-data-frame.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame.js +1 -3
- package/dist/gpu-dataframe/gpu-data-frame.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.cjs +157 -25
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts +9 -5
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.js +184 -25
- package/dist/gpu-dataframe/gpu-expression-shader.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.cjs +100 -8
- package/dist/gpu-dataframe/gpu-expression.d.ts +35 -3
- package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.js +92 -6
- package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.cjs +2 -3
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js +4 -3
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.cjs +4 -4
- package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts +5 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js +11 -5
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.cjs +136 -99
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts +7 -2
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js +135 -97
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.cjs +286 -49
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts +17 -2
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js +290 -40
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.cjs +10 -8
- package/dist/gpu-dataframe/gpu-group-by-query.d.ts +7 -1
- package/dist/gpu-dataframe/gpu-group-by-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.js +14 -8
- package/dist/gpu-dataframe/gpu-group-by-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.cjs +0 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.js +0 -1
- package/dist/gpu-dataframe/gpu-histogram-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.cjs +8 -8
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.js +9 -9
- package/dist/gpu-dataframe/gpu-join-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.cjs +38 -10
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts +3 -2
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.js +37 -9
- package/dist/gpu-dataframe/gpu-query-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.cjs +0 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.js +0 -1
- package/dist/gpu-dataframe/gpu-sort-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-query.cjs +13 -5
- package/dist/gpu-dataframe/gpu-sort-query.d.ts +4 -1
- package/dist/gpu-dataframe/gpu-sort-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-sort-query.js +14 -5
- package/dist/gpu-dataframe/gpu-sort-query.js.map +1 -1
- package/dist/gpu-dataframe/index.cjs +12 -2
- package/dist/gpu-dataframe/index.cjs.map +3 -3
- package/dist/gpu-dataframe/index.d.ts +3 -3
- package/dist/gpu-dataframe/index.d.ts.map +1 -1
- package/dist/gpu-dataframe/index.js +2 -2
- package/dist/gpu-dataframe/index.js.map +1 -1
- package/dist/gpu-dataframe/portable-expression.cjs +68 -4
- package/dist/gpu-dataframe/portable-expression.d.ts +3 -1
- package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/portable-expression.js +69 -5
- package/dist/gpu-dataframe/portable-expression.js.map +1 -1
- package/dist/gpu-dggs-benchmarks.cjs +21 -0
- package/dist/gpu-dggs-benchmarks.d.ts +2 -0
- package/dist/gpu-dggs-benchmarks.d.ts.map +1 -0
- package/dist/gpu-dggs-benchmarks.js +5 -0
- package/dist/gpu-dggs-benchmarks.js.map +1 -0
- package/dist/gpu-graph-algorithms-benchmarks.cjs +21 -0
- package/dist/gpu-graph-algorithms-benchmarks.d.ts +2 -0
- package/dist/gpu-graph-algorithms-benchmarks.d.ts.map +1 -0
- package/dist/gpu-graph-algorithms-benchmarks.js +5 -0
- package/dist/gpu-graph-algorithms-benchmarks.js.map +1 -0
- package/dist/gpu-physics/gpu-physics-batch.cjs +11 -10
- package/dist/gpu-physics/gpu-physics-batch.d.ts +1 -0
- package/dist/gpu-physics/gpu-physics-batch.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-physics-batch.js +14 -10
- package/dist/gpu-physics/gpu-physics-batch.js.map +1 -1
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.cjs +116 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.d.ts +42 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.d.ts.map +1 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.js +90 -0
- package/dist/gpu-physics/gpu-physics-ensemble-terrain.js.map +1 -0
- package/dist/gpu-physics/gpu-physics-ensemble.cjs +105 -8
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts +40 -2
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-physics-ensemble.js +109 -6
- package/dist/gpu-physics/gpu-physics-ensemble.js.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.cjs +737 -213
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +111 -5
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +842 -231
- package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
- package/dist/gpu-physics/index.cjs +23 -2
- package/dist/gpu-physics/index.cjs.map +3 -3
- package/dist/gpu-physics/index.d.ts +10 -3
- package/dist/gpu-physics/index.d.ts.map +1 -1
- package/dist/gpu-physics/index.js +6 -1
- package/dist/gpu-physics/index.js.map +1 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.cjs +21 -8
- package/dist/gpu-physics/rigid-body-bounds-shaders.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.js +15 -1
- package/dist/gpu-physics/rigid-body-bounds-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.cjs +10 -6
- package/dist/gpu-physics/rigid-body-cache-shaders.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-cache-shaders.js +15 -6
- package/dist/gpu-physics/rigid-body-cache-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-capacity.cjs +15 -2
- package/dist/gpu-physics/rigid-body-capacity.d.ts +3 -1
- package/dist/gpu-physics/rigid-body-capacity.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-capacity.js +21 -2
- package/dist/gpu-physics/rigid-body-capacity.js.map +1 -1
- package/dist/gpu-physics/rigid-body-cast-index.cjs +192 -0
- package/dist/gpu-physics/rigid-body-cast-index.d.ts +44 -0
- package/dist/gpu-physics/rigid-body-cast-index.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-cast-index.js +194 -0
- package/dist/gpu-physics/rigid-body-cast-index.js.map +1 -0
- package/dist/gpu-physics/rigid-body-convex-shaders.cjs +3 -2
- package/dist/gpu-physics/rigid-body-convex-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-convex-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-convex-shaders.js +3 -2
- package/dist/gpu-physics/rigid-body-convex-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.cjs +4 -2
- package/dist/gpu-physics/rigid-body-ensemble-layout.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-layout.js +5 -2
- package/dist/gpu-physics/rigid-body-ensemble-layout.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.cjs +45 -14
- package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-reset.js +53 -14
- package/dist/gpu-physics/rigid-body-ensemble-reset.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-shaders.cjs +14 -7
- package/dist/gpu-physics/rigid-body-ensemble-shaders.d.ts +5 -0
- package/dist/gpu-physics/rigid-body-ensemble-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-shaders.js +17 -7
- package/dist/gpu-physics/rigid-body-ensemble-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.cjs +40 -8
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts +5 -2
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.js +49 -9
- package/dist/gpu-physics/rigid-body-ensemble-transaction.js.map +1 -1
- package/dist/gpu-physics/rigid-body-event-compaction.cjs +184 -0
- package/dist/gpu-physics/rigid-body-event-compaction.d.ts +35 -0
- package/dist/gpu-physics/rigid-body-event-compaction.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-event-compaction.js +168 -0
- package/dist/gpu-physics/rigid-body-event-compaction.js.map +1 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.cjs +51 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.d.ts +33 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.js +34 -0
- package/dist/gpu-physics/rigid-body-event-snapshot.js.map +1 -0
- package/dist/gpu-physics/rigid-body-events.cjs +57 -25
- package/dist/gpu-physics/rigid-body-events.d.ts +2 -1
- package/dist/gpu-physics/rigid-body-events.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-events.js +60 -25
- package/dist/gpu-physics/rigid-body-events.js.map +1 -1
- package/dist/gpu-physics/rigid-body-geometry.cjs +41 -4
- package/dist/gpu-physics/rigid-body-geometry.d.ts +10 -1
- package/dist/gpu-physics/rigid-body-geometry.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-geometry.js +44 -3
- package/dist/gpu-physics/rigid-body-geometry.js.map +1 -1
- package/dist/gpu-physics/rigid-body-height-field-shader.cjs +80 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.d.ts +3 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.js +56 -0
- package/dist/gpu-physics/rigid-body-height-field-shader.js.map +1 -0
- package/dist/gpu-physics/rigid-body-height-field.cjs +166 -0
- package/dist/gpu-physics/rigid-body-height-field.d.ts +55 -0
- package/dist/gpu-physics/rigid-body-height-field.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-height-field.js +184 -0
- package/dist/gpu-physics/rigid-body-height-field.js.map +1 -0
- package/dist/gpu-physics/rigid-body-joints.cjs +8 -3
- package/dist/gpu-physics/rigid-body-joints.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-joints.js +10 -6
- package/dist/gpu-physics/rigid-body-joints.js.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.cjs +4 -2
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.js +4 -2
- package/dist/gpu-physics/rigid-body-mesh-query-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh.cjs +72 -17
- package/dist/gpu-physics/rigid-body-mesh.d.ts +3 -0
- package/dist/gpu-physics/rigid-body-mesh.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-mesh.js +76 -20
- package/dist/gpu-physics/rigid-body-mesh.js.map +1 -1
- package/dist/gpu-physics/rigid-body-properties.cjs +4 -4
- package/dist/gpu-physics/rigid-body-properties.d.ts +6 -0
- package/dist/gpu-physics/rigid-body-properties.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-properties.js +1 -1
- package/dist/gpu-physics/rigid-body-properties.js.map +1 -1
- package/dist/gpu-physics/rigid-body-publication.cjs +2 -2
- package/dist/gpu-physics/rigid-body-publication.js +1 -1
- package/dist/gpu-physics/rigid-body-publication.js.map +1 -1
- package/dist/gpu-physics/rigid-body-queries.cjs +159 -16
- package/dist/gpu-physics/rigid-body-queries.d.ts +24 -1
- package/dist/gpu-physics/rigid-body-queries.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-queries.js +166 -14
- package/dist/gpu-physics/rigid-body-queries.js.map +1 -1
- package/dist/gpu-physics/rigid-body-query-geometry.cjs +22 -4
- package/dist/gpu-physics/rigid-body-query-geometry.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-query-geometry.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-query-geometry.js +22 -4
- package/dist/gpu-physics/rigid-body-query-geometry.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.cjs +13 -7
- package/dist/gpu-physics/rigid-body-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.js +16 -8
- package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shape-properties.cjs +2 -0
- package/dist/gpu-physics/rigid-body-shape-properties.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-shape-properties.js +2 -0
- package/dist/gpu-physics/rigid-body-shape-properties.js.map +1 -1
- package/dist/gpu-physics/rigid-body-terrain-atlas.cjs +287 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.d.ts +87 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.js +275 -0
- package/dist/gpu-physics/rigid-body-terrain-atlas.js.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.cjs +240 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.d.ts +76 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.js +247 -0
- package/dist/gpu-physics/rigid-body-terrain-lod.js.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.cjs +215 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.d.ts +25 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.js +218 -0
- package/dist/gpu-physics/rigid-body-terrain-stitch.js.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.cjs +263 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.d.ts +97 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.js +250 -0
- package/dist/gpu-physics/rigid-body-terrain-stream.js.map +1 -0
- package/dist/gpu-physics/rigid-body-triggers.cjs +54 -15
- package/dist/gpu-physics/rigid-body-triggers.d.ts +1 -0
- package/dist/gpu-physics/rigid-body-triggers.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-triggers.js +56 -15
- package/dist/gpu-physics/rigid-body-triggers.js.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.cjs +99 -44
- package/dist/gpu-physics/rigid-body-vehicle.d.ts +15 -3
- package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.js +93 -40
- package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -1
- package/dist/gpu-physics/sphere-world-shaders.cjs +48 -20
- package/dist/gpu-physics/sphere-world-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/sphere-world-shaders.js +51 -21
- package/dist/gpu-physics/sphere-world-shaders.js.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts +1 -1
- package/dist/gpu-project/cpu-projection-operation.d.ts +1 -1
- package/dist/gpu-project/crs.cjs.map +3 -3
- package/dist/gpu-project/crs.d.ts +1 -1
- package/dist/gpu-project/index.cjs.map +2 -2
- package/dist/gpu-project/projection-crs-benchmark.cjs +2 -2
- package/dist/gpu-project/projection-crs-benchmark.d.ts +1 -1
- package/dist/gpu-project/projection-crs-benchmark.js +1 -1
- package/dist/gpu-project/projection-crs-input.cjs +7 -7
- package/dist/gpu-project/projection-crs-input.d.ts +1 -1
- package/dist/gpu-project/projection-crs-input.js +4 -4
- package/dist/gpu-project/projection-engine.d.ts +2 -2
- package/dist/gpu-project/projection-program.cjs +2 -9
- package/dist/gpu-project/projection-program.d.ts.map +1 -1
- package/dist/gpu-project/projection-program.js +1 -8
- package/dist/gpu-project/projection-program.js.map +1 -1
- package/dist/gpu-project-benchmarks.cjs +21 -0
- package/dist/gpu-project-benchmarks.d.ts +2 -0
- package/dist/gpu-project-benchmarks.d.ts.map +1 -0
- package/dist/gpu-project-benchmarks.js +5 -0
- package/dist/gpu-project-benchmarks.js.map +1 -0
- package/dist/gpu-project-crs.cjs +21 -0
- package/dist/gpu-project-crs.d.ts +2 -0
- package/dist/gpu-project-crs.d.ts.map +1 -0
- package/dist/gpu-project-crs.js +5 -0
- package/dist/gpu-project-crs.js.map +1 -0
- package/dist/gpu-project-geoarrow.cjs +21 -0
- package/dist/gpu-project-geoarrow.d.ts +2 -0
- package/dist/gpu-project-geoarrow.d.ts.map +1 -0
- package/dist/gpu-project-geoarrow.js +5 -0
- package/dist/gpu-project-geoarrow.js.map +1 -0
- package/dist/gpu-project-graph.cjs +21 -0
- package/dist/gpu-project-graph.d.ts +2 -0
- package/dist/gpu-project-graph.d.ts.map +1 -0
- package/dist/gpu-project-graph.js +5 -0
- package/dist/gpu-project-graph.js.map +1 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-transfer.d.ts +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-transfer.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-value.d.ts +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-value.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/operation.d.ts +1 -1
- package/dist/gpu-simple-graph/operation/operation.d.ts.map +1 -1
- package/dist/gpu-simple-graph-cpu.cjs +21 -0
- package/dist/gpu-simple-graph-cpu.d.ts +2 -0
- package/dist/gpu-simple-graph-cpu.d.ts.map +1 -0
- package/dist/gpu-simple-graph-cpu.js +5 -0
- package/dist/gpu-simple-graph-cpu.js.map +1 -0
- package/dist/gpu-simple-graph-webgl.cjs +21 -0
- package/dist/gpu-simple-graph-webgl.d.ts +2 -0
- package/dist/gpu-simple-graph-webgl.d.ts.map +1 -0
- package/dist/gpu-simple-graph-webgl.js +5 -0
- package/dist/gpu-simple-graph-webgl.js.map +1 -0
- package/dist/gpu-simple-graph-webgpu.cjs +21 -0
- package/dist/gpu-simple-graph-webgpu.d.ts +2 -0
- package/dist/gpu-simple-graph-webgpu.d.ts.map +1 -0
- package/dist/gpu-simple-graph-webgpu.js +5 -0
- package/dist/gpu-simple-graph-webgpu.js.map +1 -0
- package/dist/gpu-sql/gpu-sql.cjs +269 -171
- package/dist/gpu-sql/gpu-sql.d.ts +36 -1
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +313 -181
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +3 -3
- package/dist/gpu-sql/index.d.ts +1 -1
- package/dist/gpu-sql/index.d.ts.map +1 -1
- package/dist/utils/float32.cjs +35 -0
- package/dist/utils/float32.d.ts +3 -0
- package/dist/utils/float32.d.ts.map +1 -0
- package/dist/utils/float32.js +16 -0
- package/dist/utils/float32.js.map +1 -0
- package/package.json +19 -19
- package/src/arrow/gpu/arrow-gpu-analytics-adapters.ts +77 -25
- package/src/arrow/gpu/arrow-gpu-analytics-readback.ts +52 -16
- package/src/arrow/gpu/arrow-gpu-table-conversion.ts +46 -1
- package/src/arrow/index.ts +1 -0
- package/src/experimental-models.ts +5 -0
- package/src/experimental-simulation.ts +5 -0
- package/src/gpu-core/gpu-bvh-bounds.ts +84 -0
- package/src/gpu-core/gpu-command-graph-submission-pacer.ts +102 -0
- package/src/gpu-core/index.ts +5 -0
- package/src/gpu-dataframe/gpu-analytics-compiler-utils.ts +7 -10
- package/src/gpu-dataframe/gpu-data-frame-query.ts +119 -25
- package/src/gpu-dataframe/gpu-data-frame.ts +35 -2
- package/src/gpu-dataframe/gpu-expression-shader.ts +267 -32
- package/src/gpu-dataframe/gpu-expression.ts +186 -10
- package/src/gpu-dataframe/gpu-global-aggregation-compiler.ts +6 -3
- package/src/gpu-dataframe/gpu-global-aggregation-query.ts +17 -6
- package/src/gpu-dataframe/gpu-global-sort-compiler.ts +177 -105
- package/src/gpu-dataframe/gpu-group-aggregation-compiler.ts +469 -53
- package/src/gpu-dataframe/gpu-group-by-query.ts +29 -13
- package/src/gpu-dataframe/gpu-histogram-compiler.ts +0 -1
- package/src/gpu-dataframe/gpu-join-compiler.ts +12 -8
- package/src/gpu-dataframe/gpu-query-compiler.ts +61 -19
- package/src/gpu-dataframe/gpu-sort-compiler.ts +0 -1
- package/src/gpu-dataframe/gpu-sort-query.ts +31 -5
- package/src/gpu-dataframe/index.ts +16 -3
- package/src/gpu-dataframe/portable-expression.ts +81 -4
- package/src/gpu-dggs-benchmarks.ts +5 -0
- package/src/gpu-graph-algorithms-benchmarks.ts +5 -0
- package/src/gpu-physics/gpu-physics-batch.ts +19 -13
- package/src/gpu-physics/gpu-physics-ensemble-terrain.ts +114 -0
- package/src/gpu-physics/gpu-physics-ensemble.ts +166 -7
- package/src/gpu-physics/gpu-rigid-body-world.ts +1085 -287
- package/src/gpu-physics/index.ts +46 -0
- package/src/gpu-physics/rigid-body-bounds-shaders.ts +16 -1
- package/src/gpu-physics/rigid-body-cache-shaders.ts +18 -6
- package/src/gpu-physics/rigid-body-capacity.ts +25 -4
- package/src/gpu-physics/rigid-body-cast-index.ts +277 -0
- package/src/gpu-physics/rigid-body-convex-shaders.ts +3 -2
- package/src/gpu-physics/rigid-body-ensemble-layout.ts +6 -2
- package/src/gpu-physics/rigid-body-ensemble-reset.ts +67 -15
- package/src/gpu-physics/rigid-body-ensemble-shaders.ts +18 -7
- package/src/gpu-physics/rigid-body-ensemble-transaction.ts +61 -10
- package/src/gpu-physics/rigid-body-event-compaction.ts +252 -0
- package/src/gpu-physics/rigid-body-event-snapshot.ts +76 -0
- package/src/gpu-physics/rigid-body-events.ts +63 -25
- package/src/gpu-physics/rigid-body-geometry.ts +49 -4
- package/src/gpu-physics/rigid-body-height-field-shader.ts +56 -0
- package/src/gpu-physics/rigid-body-height-field.ts +257 -0
- package/src/gpu-physics/rigid-body-joints.ts +9 -11
- package/src/gpu-physics/rigid-body-mesh-query-shaders.ts +4 -2
- package/src/gpu-physics/rigid-body-mesh.ts +97 -26
- package/src/gpu-physics/rigid-body-properties.ts +5 -2
- package/src/gpu-physics/rigid-body-publication.ts +1 -1
- package/src/gpu-physics/rigid-body-queries.ts +202 -14
- package/src/gpu-physics/rigid-body-query-geometry.ts +22 -4
- package/src/gpu-physics/rigid-body-shaders.ts +20 -8
- package/src/gpu-physics/rigid-body-shape-properties.ts +2 -0
- package/src/gpu-physics/rigid-body-terrain-atlas.ts +378 -0
- package/src/gpu-physics/rigid-body-terrain-lod.ts +332 -0
- package/src/gpu-physics/rigid-body-terrain-stitch.ts +286 -0
- package/src/gpu-physics/rigid-body-terrain-stream.ts +323 -0
- package/src/gpu-physics/rigid-body-triggers.ts +65 -20
- package/src/gpu-physics/rigid-body-vehicle.ts +108 -41
- package/src/gpu-physics/sphere-world-shaders.ts +53 -21
- package/src/gpu-project/README.md +2 -2
- package/src/gpu-project/cpu-geometry-pipelines.ts +1 -1
- package/src/gpu-project/cpu-projection-operation.ts +1 -1
- package/src/gpu-project/crs.ts +2 -2
- package/src/gpu-project/projection-crs-benchmark.ts +2 -2
- package/src/gpu-project/projection-crs-input.ts +4 -4
- package/src/gpu-project/projection-engine.ts +2 -2
- package/src/gpu-project/projection-program.ts +1 -9
- package/src/gpu-project-benchmarks.ts +5 -0
- package/src/gpu-project-crs.ts +5 -0
- package/src/gpu-project-geoarrow.ts +5 -0
- package/src/gpu-project-graph.ts +5 -0
- package/src/gpu-simple-graph/gpu-simple-graph-transfer.ts +1 -1
- package/src/gpu-simple-graph/gpu-simple-graph-value.ts +1 -1
- package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +1 -1
- package/src/gpu-simple-graph/operation/operation.ts +1 -1
- package/src/gpu-simple-graph/operations/swizzle.ts +1 -1
- package/src/gpu-simple-graph-cpu.ts +5 -0
- package/src/gpu-simple-graph-webgl.ts +5 -0
- package/src/gpu-simple-graph-webgpu.ts +5 -0
- package/src/gpu-sql/gpu-sql.ts +535 -223
- package/src/gpu-sql/index.ts +1 -1
- package/src/utils/float32.ts +16 -0
package/src/gpu-physics/index.ts
CHANGED
|
@@ -23,8 +23,39 @@ export {makeSphereBoxPlanes, getBodyInertia, type GPUSphereBox} from './sphere-s
|
|
|
23
23
|
export {
|
|
24
24
|
makeConvexHullGeometry,
|
|
25
25
|
makeTriangleMeshGeometry,
|
|
26
|
+
makeStaticTriangleMeshGeometry,
|
|
26
27
|
type RigidBodyMeshGeometry
|
|
27
28
|
} from './rigid-body-mesh';
|
|
29
|
+
export {
|
|
30
|
+
makeRigidBodyHeightField,
|
|
31
|
+
type GPURigidBodyHeightField,
|
|
32
|
+
type GPURigidBodyHeightFieldSource
|
|
33
|
+
} from './rigid-body-height-field';
|
|
34
|
+
export {
|
|
35
|
+
stitchRigidBodyTerrainTiles,
|
|
36
|
+
type GPURigidBodyTerrainEdge,
|
|
37
|
+
type GPURigidBodyTerrainSeam,
|
|
38
|
+
type GPURigidBodyTerrainTile
|
|
39
|
+
} from './rigid-body-terrain-stitch';
|
|
40
|
+
export {
|
|
41
|
+
GPURigidBodyTerrainStream,
|
|
42
|
+
makeRigidBodyTerrainFetchProvider,
|
|
43
|
+
type GPURigidBodyTerrainFetchProps,
|
|
44
|
+
type GPURigidBodyTerrainProvider,
|
|
45
|
+
type GPURigidBodyTerrainSlot,
|
|
46
|
+
type GPURigidBodyTerrainStreamProps,
|
|
47
|
+
type GPURigidBodyTerrainWindow
|
|
48
|
+
} from './rigid-body-terrain-stream';
|
|
49
|
+
export {
|
|
50
|
+
GPURigidBodyTerrainSelector,
|
|
51
|
+
getRigidBodyTerrainTileBounds,
|
|
52
|
+
type GPURigidBodyTerrainAddress,
|
|
53
|
+
type GPURigidBodyTerrainBounds,
|
|
54
|
+
type GPURigidBodySelectedTerrainTile,
|
|
55
|
+
type GPURigidBodyTerrainFocus,
|
|
56
|
+
type GPURigidBodyTerrainSelection,
|
|
57
|
+
type GPURigidBodyTerrainSelectorProps
|
|
58
|
+
} from './rigid-body-terrain-lod';
|
|
28
59
|
export {getRigidBodyShapeProperties} from './rigid-body-shape-properties';
|
|
29
60
|
export {
|
|
30
61
|
getSphereClothReference,
|
|
@@ -63,6 +94,8 @@ export type {
|
|
|
63
94
|
GPURigidBodySphereCastQuery,
|
|
64
95
|
GPURigidBodyOverlapQuery,
|
|
65
96
|
GPURigidBodyQueryFilter,
|
|
97
|
+
GPURigidBodyBatchCast,
|
|
98
|
+
GPURigidBodyBatchCastOptions,
|
|
66
99
|
GPURigidBodyQueryHit,
|
|
67
100
|
GPURigidBodyQueryResult
|
|
68
101
|
} from './rigid-body-queries';
|
|
@@ -74,6 +107,13 @@ export type {
|
|
|
74
107
|
GPURigidBodyTriggerEvent,
|
|
75
108
|
GPURigidBodyTriggerBatch
|
|
76
109
|
} from './rigid-body-triggers';
|
|
110
|
+
export type {
|
|
111
|
+
GPURigidBodyActiveContact,
|
|
112
|
+
GPURigidBodyActiveTrigger,
|
|
113
|
+
GPURigidBodyContactSnapshot,
|
|
114
|
+
GPURigidBodyEventSnapshot,
|
|
115
|
+
GPURigidBodyTriggerSnapshot
|
|
116
|
+
} from './rigid-body-event-snapshot';
|
|
77
117
|
export {decodeRigidBodyTriggerEvents} from './rigid-body-triggers';
|
|
78
118
|
|
|
79
119
|
export type {GPURigidBodyJoint, GPURigidBodyJointFrame} from './rigid-body-joints';
|
|
@@ -81,6 +121,7 @@ export type {GPURigidBodyJoint, GPURigidBodyJointFrame} from './rigid-body-joint
|
|
|
81
121
|
export type {
|
|
82
122
|
GPURigidBodyCapture,
|
|
83
123
|
GPURigidBodyGPUCheckpoint,
|
|
124
|
+
GPURigidBodyHeightFieldEdit,
|
|
84
125
|
GPURigidBodyParameters
|
|
85
126
|
} from './gpu-rigid-body-world';
|
|
86
127
|
|
|
@@ -111,6 +152,11 @@ export type {
|
|
|
111
152
|
} from './gpu-physics-batch';
|
|
112
153
|
|
|
113
154
|
export {GPUPhysicsEnsemble, type GPUPhysicsEnsembleProps} from './gpu-physics-ensemble';
|
|
155
|
+
export type {
|
|
156
|
+
GPUPhysicsTerrainAtlasPool,
|
|
157
|
+
GPUPhysicsTerrainAtlasStats
|
|
158
|
+
} from './rigid-body-terrain-atlas';
|
|
159
|
+
export {GPUPhysicsEnsembleTerrain} from './gpu-physics-ensemble-terrain';
|
|
114
160
|
|
|
115
161
|
export type {GPURigidBodyJointLimit, GPURigidBodyJointDrive} from './joint-types';
|
|
116
162
|
|
|
@@ -2,8 +2,22 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import {RIGID_BODY_HEIGHT_FIELD_SHADER} from './rigid-body-height-field-shader';
|
|
6
|
+
|
|
7
|
+
/** Common mesh surface helpers, with height-field decoding only in worlds using it. */
|
|
8
|
+
export function getRigidBodyBoundsShader(heightFields: boolean): string {
|
|
9
|
+
return /* wgsl */ `
|
|
10
|
+
${heightFields ? RIGID_BODY_HEIGHT_FIELD_SHADER : ''}
|
|
11
|
+
fn meshTriangleActive(collider:u32,triangle:u32)->bool{
|
|
12
|
+
${heightFields ? 'if(bodies.colliders[collider].padding.y<0.0){return heightFieldTriangleActive(collider,triangle);}' : ''}
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
fn meshTriangleData(collider:u32,triangle:u32)->u32{
|
|
16
|
+
${heightFields ? 'if(bodies.colliders[collider].padding.y<0.0){return heightFieldTriangleData(collider,triangle);}' : ''}
|
|
17
|
+
return u32(readGeometry(u32(bodies.colliders[collider].padding.z)+triangle).w);
|
|
18
|
+
}
|
|
6
19
|
fn triangleVertex(collider:u32, triangle:u32, corner:u32)->vec3f {
|
|
20
|
+
${heightFields ? 'if(bodies.colliders[collider].padding.y<0.0){return heightFieldTriangleVertex(collider,triangle,corner);}' : ''}
|
|
7
21
|
let indices=readGeometry(u32(bodies.colliders[collider].padding.z)+triangle);
|
|
8
22
|
return readGeometry(u32(bodies.colliders[collider].padding.x)+u32(indices[corner])).xyz;
|
|
9
23
|
}
|
|
@@ -35,6 +49,7 @@ fn shapeWorldExtent(collider:u32)->vec3f {
|
|
|
35
49
|
return abs(axis(collider,0u))*extent.x+abs(axis(collider,1u))*extent.y+abs(axis(collider,2u))*extent.z;
|
|
36
50
|
}
|
|
37
51
|
`;
|
|
52
|
+
}
|
|
38
53
|
|
|
39
54
|
export const RIGID_BODY_BOUND_PUBLICATION_SHADER = /* wgsl */ `
|
|
40
55
|
@group(0) @binding(24) var<storage,read_write> minima:array<f32>;
|
|
@@ -8,10 +8,15 @@ export type RigidBodySparseShaderLayout = {
|
|
|
8
8
|
diagnosticOffset: number;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
/** Build sparse cache ownership and optional partition-local overflow reporting. */
|
|
11
12
|
export function getRigidBodyCacheShader(
|
|
12
13
|
layout: RigidBodySparseShaderLayout,
|
|
13
|
-
ensemble = false
|
|
14
|
+
ensemble = false,
|
|
15
|
+
pairsPerInstance?: number
|
|
14
16
|
): string {
|
|
17
|
+
// Disjoint ranges ensure a sibling cannot claim an address that a failed instance must restore.
|
|
18
|
+
/** Use the selected capacity as a power-of-two mask within the owning cache range. */
|
|
19
|
+
const capacity = pairsPerInstance ? `${pairsPerInstance}u` : 'PAIR_CAPACITY';
|
|
15
20
|
let source = /* wgsl */ `
|
|
16
21
|
const EMPTY_PAIR:u32=0u;
|
|
17
22
|
const DELETED_PAIR:u32=0xffffffffu;
|
|
@@ -24,11 +29,12 @@ fn claimManifold(first:u32,second:u32)->u32{
|
|
|
24
29
|
let key=((first<<16u)|second)+1u;
|
|
25
30
|
var mixed=(key^(key>>16u))*2246822519u;
|
|
26
31
|
mixed=(mixed^(mixed>>13u))*3266489917u;
|
|
27
|
-
let
|
|
32
|
+
${pairsPerInstance ? `let instanceIndex=first/INSTANCE_COLLIDERS;let base=instanceIndex*${capacity};` : 'let base=0u;'}
|
|
33
|
+
let origin=(mixed^(mixed>>16u))&(${capacity}-1u);
|
|
28
34
|
for(var attempt=0u;attempt<8u;attempt++){
|
|
29
35
|
var reusable=DELETED_PAIR;var observed=DELETED_PAIR;
|
|
30
|
-
for(var probe=0u;probe<min(
|
|
31
|
-
let slot=(origin+probe)&(
|
|
36
|
+
for(var probe=0u;probe<min(${capacity},128u);probe++){
|
|
37
|
+
let slot=base+((origin+probe)&(${capacity}-1u));let stored=atomicLoad(&targets.keys[slot].key);
|
|
32
38
|
if(stored==key){targets.keys[slot].epoch=targets.frame;manifolds[slot].first=first;manifolds[slot].second=second;return slot;}
|
|
33
39
|
if(stored==DELETED_PAIR&&reusable==DELETED_PAIR){reusable=slot;observed=DELETED_PAIR;}
|
|
34
40
|
if(stored==EMPTY_PAIR){if(reusable==DELETED_PAIR){reusable=slot;observed=EMPTY_PAIR;}break;}
|
|
@@ -40,7 +46,12 @@ fn claimManifold(first:u32,second:u32)->u32{
|
|
|
40
46
|
manifolds[reusable].first=first;manifolds[reusable].second=second;return reusable;
|
|
41
47
|
}
|
|
42
48
|
}
|
|
43
|
-
|
|
49
|
+
${
|
|
50
|
+
pairsPerInstance
|
|
51
|
+
? 'atomicStore(&targets.instanceFailures[instanceIndex],1u);atomicStore(&targets.instanceFailures[INSTANCE_COUNT],1u);'
|
|
52
|
+
: 'atomicAdd(&targets.cacheDropped,1u);'
|
|
53
|
+
}
|
|
54
|
+
return DELETED_PAIR;
|
|
44
55
|
}
|
|
45
56
|
var<workgroup> cacheEpoch:u32;
|
|
46
57
|
@compute @workgroup_size(64) fn prepare(@builtin(local_invocation_index) invocation:u32){
|
|
@@ -86,11 +97,12 @@ fn journalManifold(pair:u32,key:u32){
|
|
|
86
97
|
let count=atomicLoad(&targets.reserved0);
|
|
87
98
|
for(var index=invocation;index<count;index+=64u){targets.journalMarks[targets.journalSlots[index]]=0u;}
|
|
88
99
|
storageBarrier();
|
|
89
|
-
if(invocation==0u){targets.frame++;atomicStore(&targets.reserved0,0u);atomicStore(&targets.reserved1,0u);atomicStore(&targets.reserved2,0u);atomicStore(&targets.cacheDropped,0u);}
|
|
100
|
+
if(invocation==0u){targets.frame++;atomicStore(&targets.reserved0,0u);atomicStore(&targets.reserved1,0u);atomicStore(&targets.reserved2,0u);atomicStore(&targets.cacheDropped,0u);${pairsPerInstance ? 'atomicStore(&targets.instanceFailures[INSTANCE_COUNT],0u);' : ''}}
|
|
90
101
|
}
|
|
91
102
|
@compute @workgroup_size(64) fn prepare(@builtin(global_invocation_id) invocation:vec3u){
|
|
92
103
|
let work=invocation.x;if(work>=atomicLoad(&ensemble[0])){return;}
|
|
93
104
|
let instance=atomicLoad(&ensemble[INSTANCE_QUEUE+work]);
|
|
105
|
+
${pairsPerInstance ? 'atomicStore(&targets.instanceFailures[instance],0u);' : ''}
|
|
94
106
|
targets.instanceFrames[instance]++;let epoch=targets.instanceFrames[instance];
|
|
95
107
|
var previous=0u;var link=atomicLoad(&targets.instanceHeads[instance]);
|
|
96
108
|
loop{
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import {getEnsembleContactLayout} from './rigid-body-ensemble-layout';
|
|
2
|
-
import {RIGID_BODY_JOINT_STATE_BYTES} from './rigid-body-joints';
|
|
3
1
|
// luma.gl
|
|
4
2
|
// SPDX-License-Identifier: MIT
|
|
5
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
6
4
|
|
|
5
|
+
import {RIGID_BODY_CAST_COMMAND_BYTES, RIGID_BODY_BATCH_RESULT_BYTES} from './rigid-body-queries';
|
|
6
|
+
import {getEnsembleContactLayout} from './rigid-body-ensemble-layout';
|
|
7
|
+
import {RIGID_BODY_JOINT_STATE_BYTES} from './rigid-body-joints';
|
|
8
|
+
|
|
7
9
|
export type GPURigidBodyCapacityInfo = {
|
|
8
10
|
bodyCount: number;
|
|
9
11
|
colliderCount: number;
|
|
10
12
|
maximumPairs: number;
|
|
11
13
|
/** World-owned buffers only; excludes graph scratch, pipelines and driver allocation overhead. */
|
|
12
14
|
ownedBufferBytes: number;
|
|
15
|
+
/** Private cast index scratch. Upper bound before attachment, physical allocation afterward. */
|
|
16
|
+
queryIndexScratchBytes: number;
|
|
13
17
|
buffers: {name: string; byteLength: number; uniform: boolean}[];
|
|
14
18
|
pairWorkgroups: number;
|
|
15
19
|
};
|
|
@@ -28,7 +32,9 @@ export function getRigidBodyStorageLayout(
|
|
|
28
32
|
rollback = false,
|
|
29
33
|
continuous = false,
|
|
30
34
|
jointCount = 0,
|
|
31
|
-
ensembleInstances = 0
|
|
35
|
+
ensembleInstances = 0,
|
|
36
|
+
independentRecovery = false,
|
|
37
|
+
queryBatchCapacity = 0
|
|
32
38
|
) {
|
|
33
39
|
const geometryOffset = Math.ceil((bodyCount * 12 + colliderCount * 26) / 4) * 4;
|
|
34
40
|
const pairOffset = Math.ceil((geometryOffset + geometryWords) / 64) * 64;
|
|
@@ -49,7 +55,8 @@ export function getRigidBodyStorageLayout(
|
|
|
49
55
|
{
|
|
50
56
|
name: 'targets',
|
|
51
57
|
byteLength: ensembleInstances
|
|
52
|
-
? getEnsembleContactLayout(bodyCount, ensembleInstances, maximumPairs)
|
|
58
|
+
? getEnsembleContactLayout(bodyCount, ensembleInstances, maximumPairs, independentRecovery)
|
|
59
|
+
.byteLength
|
|
53
60
|
: Math.ceil((bodyCount * 32 + (sparse ? 32 + maximumPairs * 8 : 16)) / 16) * 16 +
|
|
54
61
|
jointCount * RIGID_BODY_JOINT_STATE_BYTES,
|
|
55
62
|
uniform: false
|
|
@@ -76,6 +83,20 @@ export function getRigidBodyStorageLayout(
|
|
|
76
83
|
{name: 'query-output', byteLength: 16 + Math.max(1, colliderCount) * 48, uniform: false}
|
|
77
84
|
]
|
|
78
85
|
: []),
|
|
86
|
+
...(queryBatchCapacity
|
|
87
|
+
? [
|
|
88
|
+
{
|
|
89
|
+
name: 'query-batch-commands',
|
|
90
|
+
byteLength: queryBatchCapacity * RIGID_BODY_CAST_COMMAND_BYTES,
|
|
91
|
+
uniform: false
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'query-batch-results',
|
|
95
|
+
byteLength: queryBatchCapacity * RIGID_BODY_BATCH_RESULT_BYTES,
|
|
96
|
+
uniform: false
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
: []),
|
|
79
100
|
...(extended ? [{name: 'mesh-tasks', byteLength: 16 + 65536 * 48, uniform: false}] : []),
|
|
80
101
|
...(parallel
|
|
81
102
|
? [
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {Buffer, type BindingDeclaration, type Device} from '@luma.gl/core';
|
|
6
|
+
import {GPUBVH} from '../gpu-core/gpu-bvh';
|
|
7
|
+
import {
|
|
8
|
+
GPUCommandGraph,
|
|
9
|
+
type CompiledGPUCommandGraph,
|
|
10
|
+
type GraphBufferHandle
|
|
11
|
+
} from '../gpu-core/gpu-command-graph';
|
|
12
|
+
import {Kernel} from '../execution/compute/kernel';
|
|
13
|
+
import {getRigidBodyBatchCastShader} from './rigid-body-queries';
|
|
14
|
+
import {
|
|
15
|
+
normalizeRigidBodyRotation,
|
|
16
|
+
rotateRigidBodyVector,
|
|
17
|
+
type GPURigidBody,
|
|
18
|
+
type GPURigidBodyCollider
|
|
19
|
+
} from './rigid-body-properties';
|
|
20
|
+
|
|
21
|
+
/** Authored locality and stable query identities for a refittable index. */
|
|
22
|
+
export type RigidBodyCastOrder = {
|
|
23
|
+
/** Collider IDs, with indexed primitives first. */
|
|
24
|
+
indices: Uint32Array;
|
|
25
|
+
/** Inverse permutation for sorting small explicit selections. */
|
|
26
|
+
ranks: Uint32Array;
|
|
27
|
+
/** Sphere and box count in the indexed prefix. */
|
|
28
|
+
indexedCount: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** Index colliders whose exact intersection does not use a traversal budget. */
|
|
32
|
+
export function canIndexRigidBodyCastCollider(collider: GPURigidBodyCollider): boolean {
|
|
33
|
+
return collider.shape.type === 'sphere' || collider.shape.type === 'box';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Size the implicit complete binary tree, including padded leaves. */
|
|
37
|
+
function getCastIndexShape(indexedCount: number) {
|
|
38
|
+
/** Zero primitives require no private query graph. */
|
|
39
|
+
const leafCapacity = indexedCount ? 2 ** Math.ceil(Math.log2(indexedCount)) : 0;
|
|
40
|
+
return {leafCapacity, nodeCount: Math.max(0, leafCapacity * 2 - 1)};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Bound scratch before compilation and transient buffer aliasing. */
|
|
44
|
+
export function estimateRigidBodyCastIndexBytes(indexedCount: number): number {
|
|
45
|
+
if (!indexedCount) return 0;
|
|
46
|
+
/** Source and node bounds have two float32x3 rows. Node children add two words. */
|
|
47
|
+
const {leafCapacity, nodeCount} = getCastIndexShape(indexedCount);
|
|
48
|
+
return indexedCount * 24 + nodeCount * 32 + leafCapacity * 4 + 8;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Sort primitive leaves by position once. GPU refits preserve this order as bodies move. */
|
|
52
|
+
export function getRigidBodyCastOrder(
|
|
53
|
+
colliders: readonly (GPURigidBodyCollider & {body: number})[],
|
|
54
|
+
bodies: readonly GPURigidBody[]
|
|
55
|
+
): RigidBodyCastOrder {
|
|
56
|
+
/** Separate the primitives whose exact intersection has no traversal budget. */
|
|
57
|
+
const primitives: {index: number; center: number[]; key: number}[] = [];
|
|
58
|
+
/** Retain direct traversal for extended shapes to preserve their completion status. */
|
|
59
|
+
const extended: number[] = [];
|
|
60
|
+
/** Authored center range for quantization. */
|
|
61
|
+
const lower = [Infinity, Infinity, Infinity];
|
|
62
|
+
/** Authored center range for quantization. */
|
|
63
|
+
const upper = [-Infinity, -Infinity, -Infinity];
|
|
64
|
+
for (const [index, collider] of colliders.entries()) {
|
|
65
|
+
if (!canIndexRigidBodyCastCollider(collider)) {
|
|
66
|
+
extended.push(index);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
/** Map compound offsets out of the authored body frame before ordering the leaves. */
|
|
70
|
+
const body = bodies[collider.body];
|
|
71
|
+
/** Collider translation relative to the authored body origin in world axes. */
|
|
72
|
+
const offset = collider.position
|
|
73
|
+
? rotateRigidBodyVector(normalizeRigidBodyRotation(body.orientation), collider.position)
|
|
74
|
+
: [0, 0, 0];
|
|
75
|
+
/** Include each collider center even when one body owns several separated primitives. */
|
|
76
|
+
const center = body.position.map((value, coordinate) => value + offset[coordinate]);
|
|
77
|
+
for (let coordinate = 0; coordinate < 3; coordinate++) {
|
|
78
|
+
lower[coordinate] = Math.min(lower[coordinate], center[coordinate]);
|
|
79
|
+
upper[coordinate] = Math.max(upper[coordinate], center[coordinate]);
|
|
80
|
+
}
|
|
81
|
+
primitives.push({index, center, key: 0});
|
|
82
|
+
}
|
|
83
|
+
for (const primitive of primitives) {
|
|
84
|
+
for (let coordinate = 0; coordinate < 3; coordinate++) {
|
|
85
|
+
/** Ten bits per axis keep the Morton key inside a uint32. */
|
|
86
|
+
const span = upper[coordinate] - lower[coordinate];
|
|
87
|
+
/** Clamp the endpoint and handle a flat axis without dividing by zero. */
|
|
88
|
+
const quantized =
|
|
89
|
+
span > 0
|
|
90
|
+
? Math.floor(((primitive.center[coordinate] - lower[coordinate]) / span) * 1023)
|
|
91
|
+
: 0;
|
|
92
|
+
for (let bit = 0; bit < 10; bit++) {
|
|
93
|
+
primitive.key |= ((quantized >> bit) & 1) << (3 * bit + coordinate);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
primitives.sort((first, second) => first.key - second.key);
|
|
98
|
+
/** Restore caller-facing collider identities after traversal. */
|
|
99
|
+
const indices = Uint32Array.from([...primitives.map(primitive => primitive.index), ...extended]);
|
|
100
|
+
/** Use the same topology when an application passes a subset in a different order. */
|
|
101
|
+
const ranks = new Uint32Array(indices.length);
|
|
102
|
+
for (const [rank, index] of indices.entries()) ranks[index] = rank;
|
|
103
|
+
return {indices, ranks, indexedCount: primitives.length};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Gather conservative world-space bounds for the selected primitive prefix. */
|
|
107
|
+
function getGatherCastBoundsShader(indexedCount: number): string {
|
|
108
|
+
return /* wgsl */ `
|
|
109
|
+
@group(0) @binding(24) var<storage,read_write> sourceMinima:array<f32>;
|
|
110
|
+
@group(0) @binding(25) var<storage,read_write> sourceMaxima:array<f32>;
|
|
111
|
+
@group(0) @binding(30) var<storage,read> batchCommands:array<Query>;
|
|
112
|
+
|
|
113
|
+
@compute @workgroup_size(64) fn gatherCastBounds(@builtin(global_invocation_id) invocation:vec3u){
|
|
114
|
+
let row=invocation.x;
|
|
115
|
+
if(row>=${indexedCount}u){return;}
|
|
116
|
+
let largest=0x1.fffffep127f;
|
|
117
|
+
var lower=vec3f(largest);
|
|
118
|
+
var upper=vec3f(-largest);
|
|
119
|
+
if(row<batchCommands[0].settings.y){
|
|
120
|
+
let collider=querySelection[row];
|
|
121
|
+
let center=colliderPosition(collider);
|
|
122
|
+
let shape=bodies.colliders[collider].shape;
|
|
123
|
+
var extent=vec3f(shape.x);
|
|
124
|
+
if(shape.w==1.0){extent=shapeWorldExtent(collider);}
|
|
125
|
+
// Cover float32 pose and slab arithmetic, including the narrow phase's
|
|
126
|
+
// near-tangent sphere sweep tolerance.
|
|
127
|
+
let padding=max(vec3f(1e-7),(abs(center)+extent)*2e-6);
|
|
128
|
+
lower=center-extent-padding;
|
|
129
|
+
upper=center+extent+padding;
|
|
130
|
+
if(!all(abs(lower)<=vec3f(largest))||!all(abs(upper)<=vec3f(largest))){
|
|
131
|
+
lower=vec3f(-largest);
|
|
132
|
+
upper=vec3f(largest);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
for(var coordinate=0u;coordinate<3u;coordinate++){
|
|
136
|
+
sourceMinima[row*3u+coordinate]=lower[coordinate];
|
|
137
|
+
sourceMaxima[row*3u+coordinate]=upper[coordinate];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Index construction and traversal inputs borrowed from the rigid-body world. */
|
|
144
|
+
type RigidBodyCastIndexProps = {
|
|
145
|
+
/** Prefix for graph resources and passes. */
|
|
146
|
+
id: string;
|
|
147
|
+
/** WGSL containing shared geometry and cast declarations. */
|
|
148
|
+
source: string;
|
|
149
|
+
/** Binding declarations for the shared batch cast shader. */
|
|
150
|
+
layout: readonly BindingDeclaration[];
|
|
151
|
+
/** Borrowed world buffers and batch staging. */
|
|
152
|
+
buffers: {
|
|
153
|
+
positions: Buffer;
|
|
154
|
+
orientations: Buffer;
|
|
155
|
+
bodies: Buffer;
|
|
156
|
+
querySelection: Buffer;
|
|
157
|
+
batchCommands: Buffer;
|
|
158
|
+
batchResults: Buffer;
|
|
159
|
+
};
|
|
160
|
+
/** Maximum number of indexed leaves. */
|
|
161
|
+
indexedCount: number;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/** Compile one private query graph. Holds no ownership of world state or query staging. */
|
|
165
|
+
export function createRigidBodyCastIndex(
|
|
166
|
+
device: Device,
|
|
167
|
+
{id, source, layout, buffers, indexedCount}: RigidBodyCastIndexProps
|
|
168
|
+
): CompiledGPUCommandGraph<number> {
|
|
169
|
+
/** Keep refits separate from the application simulation graph. */
|
|
170
|
+
const graph = new GPUCommandGraph<number>(device, {id});
|
|
171
|
+
/** Import each world buffer once so graph dependencies track the same handles. */
|
|
172
|
+
const resources = Object.fromEntries(
|
|
173
|
+
Object.entries(buffers).map(([name, buffer]) => [
|
|
174
|
+
name,
|
|
175
|
+
graph.importBuffer({id: name, byteLength: buffer.byteLength, usage: buffer.usage}, buffer)
|
|
176
|
+
])
|
|
177
|
+
);
|
|
178
|
+
/** Every internal and leaf row uses the same packed bounds format. */
|
|
179
|
+
const {leafCapacity, nodeCount} = getCastIndexShape(indexedCount);
|
|
180
|
+
/** Allocate a packed scratch view owned by the query graph. */
|
|
181
|
+
function createView<Format extends 'float32x3' | 'uint32x2' | 'uint32'>(
|
|
182
|
+
name: string,
|
|
183
|
+
format: Format,
|
|
184
|
+
length: number
|
|
185
|
+
) {
|
|
186
|
+
/** Three floats for bounds or one or two words for topology. */
|
|
187
|
+
const rowBytes = format === 'float32x3' ? 12 : format === 'uint32x2' ? 8 : 4;
|
|
188
|
+
return graph.createDataView(
|
|
189
|
+
graph.createTransientBuffer({id: name, byteLength: length * rowBytes, usage: Buffer.STORAGE}),
|
|
190
|
+
{format, length}
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** Shared BVH primitive publishes stable implicit leaves and refits from the current poses. */
|
|
195
|
+
const hierarchy = new GPUBVH({
|
|
196
|
+
id,
|
|
197
|
+
leafCapacity,
|
|
198
|
+
minima: createView('source-minima', 'float32x3', indexedCount),
|
|
199
|
+
maxima: createView('source-maxima', 'float32x3', indexedCount),
|
|
200
|
+
nodeMinima: createView('node-minima', 'float32x3', nodeCount),
|
|
201
|
+
nodeMaxima: createView('node-maxima', 'float32x3', nodeCount),
|
|
202
|
+
nodeChildren: createView('children', 'uint32x2', nodeCount),
|
|
203
|
+
leafIds: createView('leaf-ids', 'uint32', leafCapacity),
|
|
204
|
+
count: createView('count', 'uint32', 1),
|
|
205
|
+
overflow: createView('overflow', 'uint32', 1)
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
/** Add one compute node with explicit hazards for the external world and tree scratch. */
|
|
209
|
+
function addPass(
|
|
210
|
+
entryPoint: string,
|
|
211
|
+
shaderSource: string,
|
|
212
|
+
bindings: Record<string, GraphBufferHandle>,
|
|
213
|
+
writes: readonly string[],
|
|
214
|
+
workgroups?: number
|
|
215
|
+
): void {
|
|
216
|
+
/** The shader shares declarations with the unindexed pipeline. */
|
|
217
|
+
const bindingLayout = [
|
|
218
|
+
...layout,
|
|
219
|
+
{name: 'sourceMinima', group: 0, location: 24, type: 'storage' as const},
|
|
220
|
+
{name: 'sourceMaxima', group: 0, location: 25, type: 'storage' as const},
|
|
221
|
+
{name: 'nodeMinima', group: 0, location: 26, type: 'read-only-storage' as const},
|
|
222
|
+
{name: 'nodeMaxima', group: 0, location: 27, type: 'read-only-storage' as const}
|
|
223
|
+
].filter(binding => binding.name in bindings);
|
|
224
|
+
graph.addComputePass({
|
|
225
|
+
id: `${id}-${entryPoint}`,
|
|
226
|
+
resources: Object.entries(bindings).map(([name, buffer]) => ({
|
|
227
|
+
buffer,
|
|
228
|
+
usage: writes.includes(name) ? 'storage-read-write' : 'storage-read'
|
|
229
|
+
})),
|
|
230
|
+
compile: () => {
|
|
231
|
+
/** Compile once and resolve graph-owned temporary buffers at encode time. */
|
|
232
|
+
const kernel = new Kernel(device, {
|
|
233
|
+
id: `${id}-${entryPoint}`,
|
|
234
|
+
source: shaderSource,
|
|
235
|
+
entryPoint,
|
|
236
|
+
shaderLayout: {bindings: bindingLayout}
|
|
237
|
+
});
|
|
238
|
+
return {
|
|
239
|
+
encode: ({computePass, getBuffer, parameters}) =>
|
|
240
|
+
kernel.dispatch(computePass, {
|
|
241
|
+
bindings: Object.fromEntries(
|
|
242
|
+
Object.entries(bindings).map(([name, handle]) => [name, getBuffer(handle)])
|
|
243
|
+
),
|
|
244
|
+
x: workgroups ?? parameters
|
|
245
|
+
}),
|
|
246
|
+
destroy: () => kernel.destroy()
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** The shared geometry source defines the command struct and collider pose helpers. */
|
|
253
|
+
const {batchResults, ...inputs} = resources;
|
|
254
|
+
addPass(
|
|
255
|
+
'gatherCastBounds',
|
|
256
|
+
source + getGatherCastBoundsShader(indexedCount),
|
|
257
|
+
{
|
|
258
|
+
...inputs,
|
|
259
|
+
sourceMinima: hierarchy.minima.buffer,
|
|
260
|
+
sourceMaxima: hierarchy.maxima.buffer
|
|
261
|
+
},
|
|
262
|
+
['sourceMinima', 'sourceMaxima'],
|
|
263
|
+
Math.ceil(indexedCount / 64)
|
|
264
|
+
);
|
|
265
|
+
graph.add(hierarchy);
|
|
266
|
+
addPass(
|
|
267
|
+
'castBatch',
|
|
268
|
+
source + getRigidBodyBatchCastShader(leafCapacity),
|
|
269
|
+
{
|
|
270
|
+
...resources,
|
|
271
|
+
nodeMinima: hierarchy.nodeMinima.buffer,
|
|
272
|
+
nodeMaxima: hierarchy.nodeMaxima.buffer
|
|
273
|
+
},
|
|
274
|
+
['batchResults']
|
|
275
|
+
);
|
|
276
|
+
return graph.compile();
|
|
277
|
+
}
|
|
@@ -97,7 +97,7 @@ fn convexContact(first:u32,second:u32,firstTriangle:i32,secondTriangle:i32)->Con
|
|
|
97
97
|
let faceNormal=normalize(cross(firstEdge,secondEdge));
|
|
98
98
|
let delta=center-closest;let magnitude=length(delta);let radius=bodies.colliders[sphere].shape.x;
|
|
99
99
|
var hit:ConvexHit;if(magnitude>radius+settings.solver.x){return hit;}
|
|
100
|
-
let internalEdges=
|
|
100
|
+
let internalEdges=meshTriangleData(mesh,triangle)%8u;
|
|
101
101
|
// Opposite barycentric coordinate identifies an edge. Internal coplanar edges are
|
|
102
102
|
// not collision ridges: their adjacent triangle owns the face witness instead.
|
|
103
103
|
for(var edge=0u;edge<3u;edge++){
|
|
@@ -185,9 +185,10 @@ fn collideExtended(pair:u32,first:u32,second:u32,previous:Manifold){
|
|
|
185
185
|
for(var traversal=0u;traversal<2u;traversal++){
|
|
186
186
|
var node=0u;var work=0u;var exhausted=false;
|
|
187
187
|
loop{if(node>=count){break;}if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;let minimum=readGeometry(offset+node*3u);let maximum=readGeometry(offset+node*3u+1u);
|
|
188
|
-
if(any(maximum.xyz<lower)||any(minimum.xyz>upper)){node=u32(minimum.w);continue;}
|
|
188
|
+
if(any(minimum.xyz>maximum.xyz)||any(maximum.xyz<lower)||any(minimum.xyz>upper)){node=u32(minimum.w);continue;}
|
|
189
189
|
if(maximum.w>0.0){let start=u32(readGeometry(offset+node*3u+2u).x);for(var index=0u;index<u32(maximum.w);index++){
|
|
190
190
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
191
|
+
if(!meshTriangleActive(mesh,start+index)){continue;}
|
|
191
192
|
let firstPoint=triangleVertex(mesh,start+index,0u);let secondPoint=triangleVertex(mesh,start+index,1u);let thirdPoint=triangleVertex(mesh,start+index,2u);
|
|
192
193
|
if(any(max(firstPoint,max(secondPoint,thirdPoint))<lower)||any(min(firstPoint,min(secondPoint,thirdPoint))>upper)){continue;}
|
|
193
194
|
if(traversal==0u){candidates++;}
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
export function getEnsembleContactLayout(
|
|
7
7
|
bodyCount: number,
|
|
8
8
|
instances: number,
|
|
9
|
-
maximumPairs: number
|
|
9
|
+
maximumPairs: number,
|
|
10
|
+
independentRecovery = false
|
|
10
11
|
) {
|
|
11
12
|
const keyOffset = bodyCount * 8 + 8;
|
|
12
13
|
const headOffset = keyOffset + maximumPairs * 2;
|
|
@@ -20,6 +21,8 @@ export function getEnsembleContactLayout(
|
|
|
20
21
|
const savedFrameOffset = savedHeadOffset + instances;
|
|
21
22
|
const savedHeaderOffset = savedFrameOffset + instances;
|
|
22
23
|
const savedManifoldOffset = Math.ceil((savedHeaderOffset + 8) / 4) * 4;
|
|
24
|
+
/** Local fault words and one aggregate flag follow the journal payloads. */
|
|
25
|
+
const failureOffset = savedManifoldOffset + maximumPairs * 104;
|
|
23
26
|
return {
|
|
24
27
|
keyOffset,
|
|
25
28
|
headOffset,
|
|
@@ -33,6 +36,7 @@ export function getEnsembleContactLayout(
|
|
|
33
36
|
savedFrameOffset,
|
|
34
37
|
savedHeaderOffset,
|
|
35
38
|
savedManifoldOffset,
|
|
36
|
-
|
|
39
|
+
failureOffset,
|
|
40
|
+
byteLength: (failureOffset + (independentRecovery ? Math.ceil((instances + 1) / 4) * 4 : 0)) * 4
|
|
37
41
|
};
|
|
38
42
|
}
|