@luma.gl/graph 10.0.0-alpha.9 → 10.0.0-beta.2
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/LICENSE +4 -4
- package/THIRD-PARTY-NOTICES.md +19 -0
- package/dist/arrow/arrow-colors.cjs +99 -18
- package/dist/arrow/arrow-colors.d.ts +27 -10
- package/dist/arrow/arrow-colors.d.ts.map +1 -1
- package/dist/arrow/arrow-colors.js +107 -24
- package/dist/arrow/arrow-colors.js.map +1 -1
- package/dist/arrow/arrow-utils/arrow-paths.cjs +4 -3
- package/dist/arrow/arrow-utils/arrow-paths.d.ts.map +1 -1
- package/dist/arrow/arrow-utils/arrow-paths.js +5 -4
- package/dist/arrow/arrow-utils/arrow-paths.js.map +1 -1
- package/dist/arrow/cpu/arrow-coordinate-projection.cjs +30 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.d.ts +5 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.js +9 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.js.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.cjs +31 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts +2 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.js +5 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.js.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.cjs +99 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts +9 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.js +100 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.js.map +1 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.cjs +9 -371
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts +8 -28
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js +4 -381
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.cjs +11 -11
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts +2 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js +4 -4
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js.map +1 -1
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.cjs +2 -2
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js +1 -1
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js.map +1 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.cjs +27 -8
- package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts +11 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.js +33 -8
- package/dist/arrow/gpu/arrow-column-gpu-vector.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +68 -3
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +9 -2
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +76 -3
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.cjs +8 -6
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts +1 -0
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js +17 -7
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +35 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +6 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +40 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
- package/dist/arrow/index.cjs +19 -2
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/index.d.ts +5 -2
- package/dist/arrow/index.d.ts.map +1 -1
- package/dist/arrow/index.js +4 -1
- package/dist/arrow/index.js.map +1 -1
- package/dist/arrow/internal.cjs.map +2 -2
- package/dist/dist.dev.js +3820 -1646
- package/dist/dist.min.js +450 -136
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/simulation/index.cjs.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/geospatial/gpu-point-spatial-query.cjs +2 -15
- package/dist/geospatial/gpu-point-spatial-query.d.ts.map +1 -1
- package/dist/geospatial/gpu-point-spatial-query.js +2 -15
- package/dist/geospatial/gpu-point-spatial-query.js.map +1 -1
- package/dist/geospatial/index.cjs.map +2 -2
- package/dist/gpu-a5/index.cjs.map +1 -1
- package/dist/gpu-core/compiled-gpu-graph.cjs +47 -0
- package/dist/gpu-core/compiled-gpu-graph.d.ts +5 -0
- package/dist/gpu-core/compiled-gpu-graph.d.ts.map +1 -1
- package/dist/gpu-core/compiled-gpu-graph.js +54 -1
- package/dist/gpu-core/compiled-gpu-graph.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-compiler.cjs +11 -2
- package/dist/gpu-core/gpu-command-graph-compiler.d.ts +2 -1
- package/dist/gpu-core/gpu-command-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-compiler.js +13 -2
- package/dist/gpu-core/gpu-command-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-types.d.ts +16 -1
- package/dist/gpu-core/gpu-command-graph-types.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-types.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph.cjs +34 -11
- package/dist/gpu-core/gpu-command-graph.d.ts +17 -8
- package/dist/gpu-core/gpu-command-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph.js +39 -11
- package/dist/gpu-core/gpu-command-graph.js.map +1 -1
- package/dist/gpu-core/gpu-cpu-execution.cjs +279 -0
- package/dist/gpu-core/gpu-cpu-execution.d.ts +22 -0
- package/dist/gpu-core/gpu-cpu-execution.d.ts.map +1 -0
- package/dist/gpu-core/gpu-cpu-execution.js +294 -0
- package/dist/gpu-core/gpu-cpu-execution.js.map +1 -0
- package/dist/gpu-core/gpu-cpu-operation.cjs +54 -0
- package/dist/gpu-core/gpu-cpu-operation.d.ts +40 -0
- package/dist/gpu-core/gpu-cpu-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-cpu-operation.js +35 -0
- package/dist/gpu-core/gpu-cpu-operation.js.map +1 -0
- package/dist/gpu-core/gpu-dispatch-utils.cjs +7 -3
- package/dist/gpu-core/gpu-dispatch-utils.d.ts +2 -0
- package/dist/gpu-core/gpu-dispatch-utils.d.ts.map +1 -1
- package/dist/gpu-core/gpu-dispatch-utils.js +4 -1
- package/dist/gpu-core/gpu-dispatch-utils.js.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.cjs +2 -2
- package/dist/gpu-core/gpu-expression-operation.d.ts +1 -1
- package/dist/gpu-core/gpu-expression-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.js +1 -1
- package/dist/gpu-core/gpu-expression-operation.js.map +1 -1
- package/dist/gpu-core/gpu-expression-plan.cjs +5 -1
- package/dist/gpu-core/gpu-expression-plan.d.ts +3 -2
- package/dist/gpu-core/gpu-expression-plan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-plan.js +7 -1
- package/dist/gpu-core/gpu-expression-plan.js.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.cjs +48 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts +1 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.js +50 -0
- package/dist/gpu-core/gpu-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-graph.d.ts +2 -2
- package/dist/gpu-core/gpu-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph.js.map +1 -1
- package/dist/gpu-core/gpu-grid-aggregation.cjs +2 -5
- package/dist/gpu-core/gpu-grid-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-aggregation.js +2 -5
- package/dist/gpu-core/gpu-grid-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-grid-binning.cjs +2 -5
- package/dist/gpu-core/gpu-grid-binning.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-binning.js +2 -5
- package/dist/gpu-core/gpu-grid-binning.js.map +1 -1
- package/dist/gpu-core/gpu-grid-coordinate.cjs +41 -0
- package/dist/gpu-core/gpu-grid-coordinate.d.ts +7 -0
- package/dist/gpu-core/gpu-grid-coordinate.d.ts.map +1 -0
- package/dist/gpu-core/gpu-grid-coordinate.js +24 -0
- package/dist/gpu-core/gpu-grid-coordinate.js.map +1 -0
- package/dist/gpu-core/gpu-grid-index-internals.cjs +2 -15
- package/dist/gpu-core/gpu-grid-index-internals.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-index-internals.js +2 -15
- package/dist/gpu-core/gpu-grid-index-internals.js.map +1 -1
- package/dist/gpu-core/gpu-grid-index-query.cjs +2 -16
- package/dist/gpu-core/gpu-grid-index-query.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-index-query.js +2 -16
- package/dist/gpu-core/gpu-grid-index-query.js.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.cjs +7 -15
- package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.js +7 -18
- package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-operation.d.ts +4 -4
- package/dist/gpu-core/gpu-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-operation.js.map +1 -1
- package/dist/gpu-core/gpu-reduction.cjs +6 -14
- package/dist/gpu-core/gpu-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-reduction.js +6 -15
- package/dist/gpu-core/gpu-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-render-operation.cjs +39 -0
- package/dist/gpu-core/gpu-render-operation.d.ts +21 -0
- package/dist/gpu-core/gpu-render-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-render-operation.js +22 -0
- package/dist/gpu-core/gpu-render-operation.js.map +1 -0
- package/dist/gpu-core/gpu-scan.cjs +46 -32
- package/dist/gpu-core/gpu-scan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-scan.js +56 -44
- package/dist/gpu-core/gpu-scan.js.map +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.cjs +12 -9
- package/dist/gpu-core/gpu-segmented-reduction.d.ts +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.js +12 -9
- package/dist/gpu-core/gpu-segmented-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-segmented-scan.cjs +73 -16
- package/dist/gpu-core/gpu-segmented-scan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-segmented-scan.js +73 -16
- package/dist/gpu-core/gpu-segmented-scan.js.map +1 -1
- package/dist/gpu-core/gpu-semantic-aggregation-operation.cjs +112 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts +71 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js +92 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.cjs +267 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.d.ts +29 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.d.ts.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.js +260 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.js.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-operation.cjs +85 -0
- package/dist/gpu-core/gpu-shader-pass-operation.d.ts +32 -0
- package/dist/gpu-core/gpu-shader-pass-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-operation.js +74 -0
- package/dist/gpu-core/gpu-shader-pass-operation.js.map +1 -0
- package/dist/gpu-core/gpu-texture-plan.d.ts +3 -2
- package/dist/gpu-core/gpu-texture-plan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-texture-plan.js.map +1 -1
- package/dist/gpu-core/index.cjs +32 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +21 -1
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +10 -0
- package/dist/gpu-core/index.js.map +1 -1
- package/dist/gpu-data/color-conversion.cjs +105 -0
- package/dist/gpu-data/color-conversion.d.ts +30 -0
- package/dist/gpu-data/color-conversion.d.ts.map +1 -0
- package/dist/gpu-data/color-conversion.js +109 -0
- package/dist/gpu-data/color-conversion.js.map +1 -0
- package/dist/gpu-data/cpu-data.cjs +60 -0
- package/dist/gpu-data/cpu-data.d.ts +28 -0
- package/dist/gpu-data/cpu-data.d.ts.map +1 -0
- package/dist/gpu-data/cpu-data.js +41 -0
- package/dist/gpu-data/cpu-data.js.map +1 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.cjs +98 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts +9 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts.map +1 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.js +85 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.js.map +1 -0
- package/dist/gpu-data/cpu-vector.cjs +42 -0
- package/dist/gpu-data/cpu-vector.d.ts +17 -0
- package/dist/gpu-data/cpu-vector.d.ts.map +1 -0
- package/dist/gpu-data/cpu-vector.js +21 -0
- package/dist/gpu-data/cpu-vector.js.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.cjs +41 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts +5 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.js +19 -0
- package/dist/gpu-data/gpu-data-buffer-props.js.map +1 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.cjs +50 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts +41 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts.map +1 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.js +45 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.js.map +1 -0
- package/dist/gpu-data/index.cjs +21 -2
- package/dist/gpu-data/index.cjs.map +3 -3
- package/dist/gpu-data/index.d.ts +6 -0
- package/dist/gpu-data/index.d.ts.map +1 -1
- package/dist/gpu-data/index.js +5 -0
- package/dist/gpu-data/index.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.cjs +8 -19
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.js +14 -26
- package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.cjs +87 -5
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts +2 -1
- package/dist/gpu-dataframe/gpu-expression-shader.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression-shader.js +101 -5
- package/dist/gpu-dataframe/gpu-expression-shader.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.cjs +177 -2
- package/dist/gpu-dataframe/gpu-expression.d.ts +60 -2
- package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.js +187 -0
- package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.cjs +0 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js +0 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.cjs +2 -2
- package/dist/gpu-dataframe/gpu-global-aggregation-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js +5 -3
- package/dist/gpu-dataframe/gpu-global-aggregation-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.cjs +23 -11
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js +24 -12
- package/dist/gpu-dataframe/gpu-global-sort-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.cjs +0 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js +0 -1
- package/dist/gpu-dataframe/gpu-group-aggregation-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-group-by-query.cjs +2 -2
- package/dist/gpu-dataframe/gpu-group-by-query.js +5 -3
- 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 +0 -2
- package/dist/gpu-dataframe/gpu-join-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-join-compiler.js +0 -2
- package/dist/gpu-dataframe/gpu-join-compiler.js.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.cjs +3 -1
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts +0 -1
- package/dist/gpu-dataframe/gpu-query-compiler.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-query-compiler.js +3 -1
- 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 +20 -2
- package/dist/gpu-dataframe/index.cjs.map +3 -3
- package/dist/gpu-dataframe/index.d.ts +6 -2
- package/dist/gpu-dataframe/index.d.ts.map +1 -1
- package/dist/gpu-dataframe/index.js +3 -1
- package/dist/gpu-dataframe/index.js.map +1 -1
- package/dist/gpu-dataframe/portable-expression.cjs +167 -0
- package/dist/gpu-dataframe/portable-expression.d.ts +21 -0
- package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -0
- package/dist/gpu-dataframe/portable-expression.js +162 -0
- package/dist/gpu-dataframe/portable-expression.js.map +1 -0
- package/dist/gpu-dggs/benchmarks.cjs.map +1 -1
- package/dist/gpu-dggs/index.cjs.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-geometry/index.cjs.map +1 -1
- package/dist/gpu-graph/index.cjs +8 -0
- package/dist/gpu-graph/index.cjs.map +3 -3
- package/dist/gpu-graph/index.d.ts +4 -0
- package/dist/gpu-graph/index.d.ts.map +1 -1
- package/dist/gpu-graph/index.js +2 -0
- package/dist/gpu-graph/index.js.map +1 -1
- package/dist/gpu-graph-algorithms/benchmarks.cjs.map +2 -2
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.cjs +2 -15
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.d.ts.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js +2 -15
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js.map +1 -1
- package/dist/gpu-graph-algorithms/index.cjs.map +2 -2
- 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-h3/index.cjs.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 +97 -5
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts +31 -2
- package/dist/gpu-physics/gpu-physics-ensemble.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-physics-ensemble.js +99 -3
- package/dist/gpu-physics/gpu-physics-ensemble.js.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.cjs +568 -77
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +86 -0
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +617 -76
- 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 +9 -2
- 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-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-reset.cjs +36 -7
- 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 +42 -7
- package/dist/gpu-physics/rigid-body-ensemble-reset.js.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.cjs +23 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts +4 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.js +25 -1
- package/dist/gpu-physics/rigid-body-ensemble-transaction.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-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-parallel-shaders.cjs +24 -9
- package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.js +28 -9
- package/dist/gpu-physics/rigid-body-parallel-shaders.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-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 +12 -6
- 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 +15 -7
- 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 +1 -0
- package/dist/gpu-physics/rigid-body-triggers.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-triggers.js +1 -0
- package/dist/gpu-physics/rigid-body-triggers.js.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.cjs +145 -0
- package/dist/gpu-physics/rigid-body-vehicle.d.ts +47 -0
- package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-vehicle.js +119 -0
- package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -0
- package/dist/gpu-pointcloud/index.cjs.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/coordinate-projection-graph.cjs +59 -0
- package/dist/gpu-project/coordinate-projection-graph.d.ts +23 -0
- package/dist/gpu-project/coordinate-projection-graph.d.ts.map +1 -0
- package/dist/gpu-project/coordinate-projection-graph.js +40 -0
- package/dist/gpu-project/coordinate-projection-graph.js.map +1 -0
- package/dist/gpu-project/cpu-geoarrow.cjs +112 -0
- package/dist/gpu-project/cpu-geoarrow.d.ts +10 -0
- package/dist/gpu-project/cpu-geoarrow.d.ts.map +1 -0
- package/dist/gpu-project/cpu-geoarrow.js +103 -0
- package/dist/gpu-project/cpu-geoarrow.js.map +1 -0
- package/dist/gpu-project/cpu-geometry-pipelines.cjs +134 -0
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts +19 -0
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts.map +1 -0
- package/dist/gpu-project/cpu-geometry-pipelines.js +114 -0
- package/dist/gpu-project/cpu-geometry-pipelines.js.map +1 -0
- package/dist/gpu-project/cpu-projection-operation.cjs +54 -0
- package/dist/gpu-project/cpu-projection-operation.d.ts +14 -0
- package/dist/gpu-project/cpu-projection-operation.d.ts.map +1 -0
- package/dist/gpu-project/cpu-projection-operation.js +37 -0
- package/dist/gpu-project/cpu-projection-operation.js.map +1 -0
- package/dist/gpu-project/crs.cjs.map +3 -3
- package/dist/gpu-project/crs.d.ts +1 -1
- package/dist/gpu-project/geoarrow.cjs +36 -0
- package/dist/gpu-project/geoarrow.cjs.map +6 -0
- package/dist/gpu-project/geoarrow.d.ts +3 -0
- package/dist/gpu-project/geoarrow.d.ts.map +1 -0
- package/dist/gpu-project/geoarrow.js +7 -0
- package/dist/gpu-project/geoarrow.js.map +1 -0
- package/dist/gpu-project/graph.cjs +27 -0
- package/dist/gpu-project/graph.cjs.map +6 -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 +6 -0
- package/dist/gpu-project/graph.js.map +1 -0
- package/dist/gpu-project/index.cjs +3 -0
- package/dist/gpu-project/index.cjs.map +3 -3
- package/dist/gpu-project/index.d.ts +1 -0
- package/dist/gpu-project/index.d.ts.map +1 -1
- package/dist/gpu-project/index.js +1 -0
- package/dist/gpu-project/index.js.map +1 -1
- 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-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/compiled-gpu-expression-graph.cjs +75 -5
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts +5 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts.map +1 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js +86 -6
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.cjs +9 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts +2 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js +10 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js.map +1 -1
- 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/gpu-simple-graph.cjs +126 -10
- package/dist/gpu-simple-graph/gpu-simple-graph.d.ts +36 -11
- package/dist/gpu-simple-graph/gpu-simple-graph.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph.js +137 -12
- package/dist/gpu-simple-graph/gpu-simple-graph.js.map +1 -1
- package/dist/gpu-simple-graph/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/index.d.ts +1 -1
- package/dist/gpu-simple-graph/index.d.ts.map +1 -1
- package/dist/gpu-simple-graph/index.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.cjs +25 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +7 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js +28 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.cjs +7 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts +2 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js +7 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js.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/operations/convert-colors.cjs +6 -6
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts +5 -1
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.js +12 -7
- package/dist/gpu-simple-graph/operations/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.cjs +16 -33
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js +22 -35
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgl/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.cjs +31 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js +42 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/index.cjs.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 +159 -328
- package/dist/gpu-sql/gpu-sql.d.ts +1 -1
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +186 -340
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +3 -3
- package/dist/gpu-tables/index.cjs.map +2 -2
- package/dist/gpu-tables/table/gpu-table.cjs +2 -2
- package/dist/gpu-tables/table/gpu-table.d.ts.map +1 -1
- package/dist/gpu-tables/table/gpu-table.js +2 -2
- package/dist/gpu-tables/table/gpu-table.js.map +1 -1
- package/dist/gpu-timeseries/index.cjs.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +30 -16
- package/src/arrow/arrow-colors.ts +194 -33
- package/src/arrow/arrow-utils/arrow-paths.ts +5 -3
- package/src/arrow/cpu/arrow-coordinate-projection.ts +18 -0
- package/src/arrow/cpu/arrow-cpu-pipelines.ts +9 -0
- package/src/arrow/cpu/arrow-cpu-vector-adapters.ts +153 -0
- package/src/arrow/geoarrow/arrow-geoarrow-adapter.ts +21 -493
- package/src/arrow/geoarrow/arrow-geoarrow-conversion.ts +7 -5
- package/src/arrow/geoarrow/arrow-polygon-tessellation.ts +1 -1
- package/src/arrow/gpu/arrow-column-gpu-vector.ts +67 -14
- package/src/arrow/gpu/arrow-gpu-table-conversion.ts +96 -4
- package/src/arrow/gpu/arrow-gpu-vector-adapters.ts +20 -7
- package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +49 -6
- package/src/arrow/index.ts +14 -0
- package/src/experimental-models.ts +5 -0
- package/src/experimental-simulation.ts +5 -0
- package/src/geospatial/gpu-point-spatial-query.ts +2 -15
- package/src/gpu-core/compiled-gpu-graph.ts +73 -1
- package/src/gpu-core/gpu-command-graph-compiler.ts +25 -2
- package/src/gpu-core/gpu-command-graph-types.ts +20 -0
- package/src/gpu-core/gpu-command-graph.ts +48 -11
- package/src/gpu-core/gpu-cpu-execution.ts +345 -0
- package/src/gpu-core/gpu-cpu-operation.ts +65 -0
- package/src/gpu-core/gpu-dispatch-utils.ts +13 -1
- package/src/gpu-core/gpu-expression-operation.ts +1 -1
- package/src/gpu-core/gpu-expression-plan.ts +11 -3
- package/src/gpu-core/gpu-graph-compiler.ts +61 -0
- package/src/gpu-core/gpu-graph.ts +3 -3
- package/src/gpu-core/gpu-grid-aggregation.ts +2 -5
- package/src/gpu-core/gpu-grid-binning.ts +2 -5
- package/src/gpu-core/gpu-grid-coordinate.ts +24 -0
- package/src/gpu-core/gpu-grid-index-internals.ts +2 -15
- package/src/gpu-core/gpu-grid-index-query.ts +2 -16
- package/src/gpu-core/gpu-group-aggregation.ts +38 -50
- package/src/gpu-core/gpu-operation.ts +9 -7
- package/src/gpu-core/gpu-reduction.ts +32 -42
- package/src/gpu-core/gpu-render-operation.ts +42 -0
- package/src/gpu-core/gpu-scan.ts +59 -45
- package/src/gpu-core/gpu-segmented-reduction.ts +20 -10
- package/src/gpu-core/gpu-segmented-scan.ts +82 -17
- package/src/gpu-core/gpu-semantic-aggregation-operation.ts +150 -0
- package/src/gpu-core/gpu-shader-pass-kernel.ts +307 -0
- package/src/gpu-core/gpu-shader-pass-operation.ts +103 -0
- package/src/gpu-core/gpu-texture-plan.ts +3 -2
- package/src/gpu-core/index.ts +39 -0
- package/src/gpu-data/color-conversion.ts +158 -0
- package/src/gpu-data/cpu-data.ts +62 -0
- package/src/gpu-data/cpu-gpu-vector-transfer.ts +110 -0
- package/src/gpu-data/cpu-vector.ts +31 -0
- package/src/gpu-data/gpu-data-buffer-props.ts +25 -0
- package/src/gpu-data/gpu-vector-wgsl-layout.ts +79 -0
- package/src/gpu-data/index.ts +15 -0
- package/src/gpu-dataframe/gpu-data-frame-query.ts +24 -31
- package/src/gpu-dataframe/gpu-expression-shader.ts +128 -7
- package/src/gpu-dataframe/gpu-expression.ts +259 -1
- package/src/gpu-dataframe/gpu-global-aggregation-compiler.ts +0 -1
- package/src/gpu-dataframe/gpu-global-aggregation-query.ts +5 -3
- package/src/gpu-dataframe/gpu-global-sort-compiler.ts +26 -12
- package/src/gpu-dataframe/gpu-group-aggregation-compiler.ts +0 -1
- package/src/gpu-dataframe/gpu-group-by-query.ts +5 -3
- package/src/gpu-dataframe/gpu-histogram-compiler.ts +0 -1
- package/src/gpu-dataframe/gpu-join-compiler.ts +0 -2
- package/src/gpu-dataframe/gpu-query-compiler.ts +3 -3
- 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 +26 -2
- package/src/gpu-dataframe/portable-expression.ts +194 -0
- package/src/gpu-dggs-benchmarks.ts +5 -0
- package/src/gpu-graph/index.ts +17 -0
- package/src/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.ts +2 -15
- package/src/gpu-graph-algorithms-benchmarks.ts +5 -0
- package/src/gpu-physics/gpu-physics-ensemble-terrain.ts +114 -0
- package/src/gpu-physics/gpu-physics-ensemble.ts +147 -4
- package/src/gpu-physics/gpu-rigid-body-world.ts +797 -102
- package/src/gpu-physics/index.ts +38 -0
- package/src/gpu-physics/rigid-body-bounds-shaders.ts +16 -1
- package/src/gpu-physics/rigid-body-convex-shaders.ts +3 -2
- package/src/gpu-physics/rigid-body-ensemble-reset.ts +48 -8
- package/src/gpu-physics/rigid-body-ensemble-transaction.ts +34 -1
- 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-mesh-query-shaders.ts +4 -2
- package/src/gpu-physics/rigid-body-mesh.ts +97 -26
- package/src/gpu-physics/rigid-body-parallel-shaders.ts +32 -9
- 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-query-geometry.ts +22 -4
- package/src/gpu-physics/rigid-body-shaders.ts +19 -7
- 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 +1 -0
- package/src/gpu-physics/rigid-body-vehicle.ts +166 -0
- package/src/gpu-project/README.md +2 -2
- package/src/gpu-project/coordinate-projection-graph.ts +59 -0
- package/src/gpu-project/cpu-geoarrow.ts +135 -0
- package/src/gpu-project/cpu-geometry-pipelines.ts +159 -0
- package/src/gpu-project/cpu-projection-operation.ts +49 -0
- package/src/gpu-project/crs.ts +2 -2
- package/src/gpu-project/geoarrow.ts +11 -0
- package/src/gpu-project/graph.ts +10 -0
- package/src/gpu-project/index.ts +2 -0
- 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-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/compiled-gpu-expression-graph.ts +97 -6
- package/src/gpu-simple-graph/gpu-simple-graph-lowering.ts +11 -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/gpu-simple-graph.ts +163 -19
- package/src/gpu-simple-graph/index.ts +1 -0
- package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +25 -1
- package/src/gpu-simple-graph/operation/gpu-vector-evaluator.ts +7 -0
- package/src/gpu-simple-graph/operation/operation.ts +1 -1
- package/src/gpu-simple-graph/operations/convert-colors.ts +22 -7
- package/src/gpu-simple-graph/operations/cpu/convert-colors.ts +31 -48
- package/src/gpu-simple-graph/operations/swizzle.ts +1 -1
- package/src/gpu-simple-graph/operations/webgpu/convert-colors.ts +47 -13
- 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 +238 -354
- package/src/gpu-tables/table/gpu-table.ts +2 -1
- package/src/index.ts +21 -0
|
@@ -23,9 +23,11 @@ module.exports = __toCommonJS(gpu_rigid_body_world_exports);
|
|
|
23
23
|
var import_bound_kernel = require("../gpu-core/utils/bound-kernel.cjs");
|
|
24
24
|
var import_core = require("@luma.gl/core");
|
|
25
25
|
var import_rigid_body_origin = require("./rigid-body-origin.cjs");
|
|
26
|
+
var import_rigid_body_height_field = require("./rigid-body-height-field.cjs");
|
|
26
27
|
var import_rigid_body_shape_properties = require("./rigid-body-shape-properties.cjs");
|
|
27
28
|
var import_rigid_body_ensemble_shaders = require("./rigid-body-ensemble-shaders.cjs");
|
|
28
29
|
var import_rigid_body_ensemble_reset = require("./rigid-body-ensemble-reset.cjs");
|
|
30
|
+
var import_rigid_body_terrain_atlas = require("./rigid-body-terrain-atlas.cjs");
|
|
29
31
|
var import_rigid_body_geometry = require("./rigid-body-geometry.cjs");
|
|
30
32
|
var import_rigid_body_properties = require("./rigid-body-properties.cjs");
|
|
31
33
|
var import_gpu_command_node = require("../gpu-core/gpu-command-node.cjs");
|
|
@@ -41,6 +43,7 @@ var import_rigid_body_transaction = require("./rigid-body-transaction.cjs");
|
|
|
41
43
|
var import_rigid_body_joints = require("./rigid-body-joints.cjs");
|
|
42
44
|
var import_rigid_body_publication = require("./rigid-body-publication.cjs");
|
|
43
45
|
var import_rigid_body_shaders = require("./rigid-body-shaders.cjs");
|
|
46
|
+
var import_rigid_body_vehicle = require("./rigid-body-vehicle.cjs");
|
|
44
47
|
var import_rigid_body_events = require("./rigid-body-events.cjs");
|
|
45
48
|
var import_rigid_body_queries = require("./rigid-body-queries.cjs");
|
|
46
49
|
class GPURigidBodyWorld {
|
|
@@ -71,6 +74,13 @@ class GPURigidBodyWorld {
|
|
|
71
74
|
eventRead = null;
|
|
72
75
|
queryComputation = null;
|
|
73
76
|
queryReduction = null;
|
|
77
|
+
/** Chassis definitions in GPU storage order. */
|
|
78
|
+
vehicles;
|
|
79
|
+
/** Whether any chassis has more than one terrain candidate. */
|
|
80
|
+
multiSurfaceVehicles;
|
|
81
|
+
/** Number of vehicles in each equal-sized ensemble partition, or zero for a standalone world. */
|
|
82
|
+
vehiclesPerInstance;
|
|
83
|
+
vehicleBuffer = null;
|
|
74
84
|
querySettings = null;
|
|
75
85
|
querySelection = null;
|
|
76
86
|
queryOutput = null;
|
|
@@ -78,9 +88,23 @@ class GPURigidBodyWorld {
|
|
|
78
88
|
targets = null;
|
|
79
89
|
simulationStatistics = null;
|
|
80
90
|
colliders;
|
|
91
|
+
bodyColliderStarts;
|
|
92
|
+
ensembleTerrainSlots;
|
|
81
93
|
props;
|
|
82
94
|
ownedBuffers = [];
|
|
95
|
+
allocationPlan;
|
|
83
96
|
ensembleBuffer = null;
|
|
97
|
+
/** Byte offsets of writable fixed-dimension height fields in the world metadata buffer. */
|
|
98
|
+
heightFieldSlots = /* @__PURE__ */ new Map();
|
|
99
|
+
/** Float32-exact edit stamp, restored together with the contact cache. */
|
|
100
|
+
terrainRevision = 1;
|
|
101
|
+
terrainWake = null;
|
|
102
|
+
/** Page ownership and live lease counts for an opt-in fused atlas. */
|
|
103
|
+
terrainAtlas;
|
|
104
|
+
/** Start of the shared atlas in the GPU metadata buffer, measured in 32-bit words. */
|
|
105
|
+
terrainAtlasWord = 0;
|
|
106
|
+
/** Start of the shader geometry region in the GPU metadata buffer, measured in 32-bit words. */
|
|
107
|
+
terrainGeometryWord = 0;
|
|
84
108
|
ensembleResetOrigin;
|
|
85
109
|
ensembleReset;
|
|
86
110
|
initialEnsembleBodies;
|
|
@@ -97,7 +121,7 @@ class GPURigidBodyWorld {
|
|
|
97
121
|
gpuCheckpoints = /* @__PURE__ */ new Set();
|
|
98
122
|
broadPhaseCounters = null;
|
|
99
123
|
constructor(props) {
|
|
100
|
-
var _a, _b, _c, _d, _e;
|
|
124
|
+
var _a, _b, _c, _d, _e, _f;
|
|
101
125
|
for (const damping of [props.linearDamping ?? 0, props.angularDamping ?? 0]) {
|
|
102
126
|
if (!Number.isFinite(damping) || damping < 0)
|
|
103
127
|
throw new Error("Invalid damping");
|
|
@@ -109,6 +133,8 @@ class GPURigidBodyWorld {
|
|
|
109
133
|
this.solver = props.solver ?? "ordered";
|
|
110
134
|
if (!["ordered", "parallel"].includes(this.solver))
|
|
111
135
|
throw new Error("Invalid rigid-body solver");
|
|
136
|
+
if (!["scalar", "block"].includes(props.parallelContactSolver ?? "scalar"))
|
|
137
|
+
throw new Error("Invalid parallel contact solver");
|
|
112
138
|
(0, import_rigid_body_joints.validateRigidBodyJoints)(props.joints ?? [], props.bodies, this.solver);
|
|
113
139
|
const colliderCount = props.bodies.reduce((sum, body) => {
|
|
114
140
|
var _a2;
|
|
@@ -144,6 +170,8 @@ class GPURigidBodyWorld {
|
|
|
144
170
|
throw new Error("Supply shape or colliders");
|
|
145
171
|
const shapes = body.colliders ?? (body.shape ? [{ shape: body.shape }] : []);
|
|
146
172
|
for (const collider of shapes) {
|
|
173
|
+
if (collider.shape.type === "height-field" && (body.mode ?? (body.mass === 0 ? "static" : "dynamic")) !== "static")
|
|
174
|
+
throw new Error("Height fields require static bodies");
|
|
147
175
|
const properties = (0, import_rigid_body_shape_properties.getRigidBodyShapeProperties)(collider.shape);
|
|
148
176
|
if (!Number.isFinite(properties.volume) || !properties.center.every(Number.isFinite) || !properties.tensor.every(Number.isFinite))
|
|
149
177
|
throw new Error("Invalid shape properties");
|
|
@@ -201,7 +229,7 @@ class GPURigidBodyWorld {
|
|
|
201
229
|
if (!["all-pairs", "hierarchical-grid"].includes(this.broadPhase) || !Number.isSafeInteger(this.maximumPairs) || this.maximumPairs < 1 || this.maximumPairs > 1073741824 || this.broadPhase === "hierarchical-grid" && (this.maximumPairs & this.maximumPairs - 1) !== 0)
|
|
202
230
|
throw new Error("Invalid rigid-body pair capacity");
|
|
203
231
|
if (props.continuous) {
|
|
204
|
-
if (props.failurePolicy !== "rollback" || !Number.isInteger(props.continuous.maximumImpacts ?? 4) || (props.continuous.maximumImpacts ?? 4) < 1 || (props.continuous.maximumImpacts ?? 4) > 16 || !["sphere-static", "convex"].includes(props.continuous.mode ?? "sphere-static") || !Number.isSafeInteger(props.continuous.maximumCandidates ?? this.maximumPairs) || (props.continuous.maximumCandidates ?? this.maximumPairs) < 1 || (props.continuous.maximumCandidates ?? this.maximumPairs) > 1073741824 || props.continuous.mode === "convex" && (Boolean((_d = props.joints) == null ? void 0 : _d.length) || colliders.some((collider) => ["plane", "triangle-mesh"].includes(collider.shape.type))))
|
|
232
|
+
if (props.failurePolicy !== "rollback" || !Number.isInteger(props.continuous.maximumImpacts ?? 4) || (props.continuous.maximumImpacts ?? 4) < 1 || (props.continuous.maximumImpacts ?? 4) > 16 || !["sphere-static", "convex"].includes(props.continuous.mode ?? "sphere-static") || !Number.isSafeInteger(props.continuous.maximumCandidates ?? this.maximumPairs) || (props.continuous.maximumCandidates ?? this.maximumPairs) < 1 || (props.continuous.maximumCandidates ?? this.maximumPairs) > 1073741824 || props.continuous.mode === "convex" && (Boolean((_d = props.joints) == null ? void 0 : _d.length) || colliders.some((collider) => ["plane", "triangle-mesh", "height-field"].includes(collider.shape.type))))
|
|
205
233
|
throw new Error("Invalid continuous settings");
|
|
206
234
|
for (const index of props.continuous.bodies) {
|
|
207
235
|
const body = props.bodies[index];
|
|
@@ -216,14 +244,71 @@ class GPURigidBodyWorld {
|
|
|
216
244
|
(0, import_rigid_body_triggers.makeRigidBodyTriggerLayout)(props.triggers, colliders);
|
|
217
245
|
}
|
|
218
246
|
const definitions = structuredClone({ colliders, props });
|
|
219
|
-
this.colliders = definitions.colliders;
|
|
220
247
|
this.props = definitions.props;
|
|
248
|
+
this.colliders = definitions.colliders;
|
|
249
|
+
this.ensembleTerrainSlots = new Set(this.props.ensembleTerrainSlots);
|
|
250
|
+
if (this.ensembleTerrainSlots.size && (!this.props.ensembleBodiesPerInstance || [...this.ensembleTerrainSlots].some((index) => {
|
|
251
|
+
var _a2;
|
|
252
|
+
return ((_a2 = this.colliders[index]) == null ? void 0 : _a2.shape.type) !== "height-field";
|
|
253
|
+
})))
|
|
254
|
+
throw new Error("Invalid ensemble terrain slots");
|
|
255
|
+
if (this.props.ensembleTerrainAtlas) {
|
|
256
|
+
this.terrainAtlas = new import_rigid_body_terrain_atlas.RigidBodyTerrainAtlas(this.props.ensembleTerrainAtlas, Array.from(this.ensembleTerrainSlots, (collider) => {
|
|
257
|
+
const shape = this.colliders[collider].shape;
|
|
258
|
+
if (shape.type !== "height-field")
|
|
259
|
+
throw new Error("Invalid ensemble terrain slot");
|
|
260
|
+
return { collider, width: shape.field.width, height: shape.field.height };
|
|
261
|
+
}));
|
|
262
|
+
}
|
|
263
|
+
this.bodyColliderStarts = new Uint32Array(this.count + 1);
|
|
264
|
+
let colliderIndex = 0;
|
|
265
|
+
for (let body = 0; body < this.count; body++) {
|
|
266
|
+
this.bodyColliderStarts[body] = colliderIndex;
|
|
267
|
+
while (((_f = this.colliders[colliderIndex]) == null ? void 0 : _f.body) === body)
|
|
268
|
+
colliderIndex++;
|
|
269
|
+
}
|
|
270
|
+
this.bodyColliderStarts[this.count] = colliderIndex;
|
|
271
|
+
if (this.props.vehicle && this.props.vehicles)
|
|
272
|
+
throw new Error("Choose vehicle or vehicles");
|
|
273
|
+
this.vehicles = this.props.vehicles ?? (this.props.vehicle ? [this.props.vehicle] : []);
|
|
274
|
+
this.multiSurfaceVehicles = this.vehicles.some((vehicle) => {
|
|
275
|
+
var _a2;
|
|
276
|
+
return (_a2 = vehicle.additionalTerrainColliders) == null ? void 0 : _a2.length;
|
|
277
|
+
});
|
|
278
|
+
const bodiesPerInstance = props.ensembleBodiesPerInstance;
|
|
279
|
+
const collidersPerInstance = props.collisionPartitionSize;
|
|
280
|
+
this.vehiclesPerInstance = bodiesPerInstance ? this.vehicles.length / (this.count / bodiesPerInstance) : 0;
|
|
281
|
+
if (!Number.isInteger(this.vehiclesPerInstance))
|
|
282
|
+
throw new Error("Invalid ensemble vehicle layout");
|
|
283
|
+
const vehicleChassis = /* @__PURE__ */ new Set();
|
|
284
|
+
for (const [vehicleIndex, vehicle] of this.vehicles.entries()) {
|
|
285
|
+
const instance = bodiesPerInstance ? Math.floor(vehicleIndex / this.vehiclesPerInstance) : 0;
|
|
286
|
+
const terrainIndices = [
|
|
287
|
+
vehicle.terrainCollider,
|
|
288
|
+
...vehicle.additionalTerrainColliders ?? []
|
|
289
|
+
];
|
|
290
|
+
const chassis = this.props.bodies[vehicle.chassis];
|
|
291
|
+
if (!chassis || vehicleChassis.has(vehicle.chassis) || terrainIndices.length > 4 || new Set(terrainIndices).size !== terrainIndices.length || terrainIndices.some((colliderIndex2) => {
|
|
292
|
+
const collider = this.colliders[colliderIndex2];
|
|
293
|
+
const ground = collider && this.props.bodies[collider.body];
|
|
294
|
+
return !ground || collider.isTrigger || this.getBodyMode(collider.body) !== "static" || bodiesPerInstance && Math.floor(colliderIndex2 / collidersPerInstance) !== instance;
|
|
295
|
+
}) || (chassis.mode ?? (chassis.mass === 0 ? "static" : "dynamic")) !== "dynamic" || vehicle.wheels.length !== 4 || bodiesPerInstance && Math.floor(vehicle.chassis / bodiesPerInstance) !== instance || ![vehicle.radius, vehicle.travel, vehicle.springRate, vehicle.wheelInertia].every((value) => Number.isFinite(value) && value > 0) || ![vehicle.damping, vehicle.grip, vehicle.motorTorque, vehicle.brakeTorque].every((value) => Number.isFinite(value) && value >= 0) || vehicle.steeringWheelbase !== void 0 && (!Number.isFinite(Math.fround(vehicle.steeringWheelbase)) || vehicle.steeringWheelbase <= 0) || !Number.isFinite(Math.fround(vehicle.antiRollRate ?? 0)) || (vehicle.antiRollRate ?? 0) < 0 || vehicle.slipGain !== void 0 && (vehicle.slipGain.length !== 2 || !vehicle.slipGain.every((gain) => Number.isFinite(Math.fround(gain)) && gain >= 0)) || vehicle.wheels.some((wheel) => wheel.mount.length !== 3 || !wheel.mount.every(Number.isFinite)))
|
|
296
|
+
throw new Error("Invalid vehicle configuration");
|
|
297
|
+
vehicleChassis.add(vehicle.chassis);
|
|
298
|
+
}
|
|
221
299
|
if (props.ensembleBodiesPerInstance)
|
|
222
300
|
this.initialEnsembleBodies = this.props.bodies.slice(0, props.ensembleBodiesPerInstance);
|
|
223
301
|
}
|
|
302
|
+
/** Allocation size including optional immutable terrain rows after the wheel state. */
|
|
303
|
+
getVehicleByteLength() {
|
|
304
|
+
return this.vehicles.length * (import_rigid_body_vehicle.VEHICLE_STRIDE + (this.multiSurfaceVehicles ? import_rigid_body_vehicle.VEHICLE_TERRAIN_ROW_SIZE : 0));
|
|
305
|
+
}
|
|
224
306
|
getStorageLayout() {
|
|
225
|
-
var _a, _b, _c;
|
|
226
|
-
const packed = (0, import_rigid_body_geometry.packRigidBodyShapes)(this.colliders);
|
|
307
|
+
var _a, _b, _c, _d;
|
|
308
|
+
const packed = (0, import_rigid_body_geometry.packRigidBodyShapes)(this.colliders, Boolean(this.props.ensembleBodiesPerInstance), this.ensembleTerrainSlots, Boolean(this.terrainAtlas));
|
|
309
|
+
const geometryWords = packed.geometry.length + (((_a = this.terrainAtlas) == null ? void 0 : _a.wordLength) ?? 0);
|
|
310
|
+
if (this.terrainAtlas && geometryWords >= 2 ** 26)
|
|
311
|
+
throw new Error("Terrain atlas exceeds address capacity");
|
|
227
312
|
const sparse = this.broadPhase === "hierarchical-grid";
|
|
228
313
|
const extended = this.colliders.some((collider) => collider.shape.type !== "sphere" && collider.shape.type !== "box" || collider.isTrigger && collider.shape.type !== "sphere");
|
|
229
314
|
const parallel = this.solver === "parallel";
|
|
@@ -232,9 +317,20 @@ class GPURigidBodyWorld {
|
|
|
232
317
|
sparse,
|
|
233
318
|
extended,
|
|
234
319
|
parallel,
|
|
235
|
-
...(0, import_rigid_body_capacity.getRigidBodyStorageLayout)(this.count, this.colliderStorageCount, this.maximumPairs,
|
|
320
|
+
...(0, import_rigid_body_capacity.getRigidBodyStorageLayout)(this.count, this.colliderStorageCount, this.maximumPairs, geometryWords, sparse, extended, parallel, this.props.eventCapacity ?? 0, this.props.enableQueries ?? false, this.props.failurePolicy === "rollback", Boolean(this.props.continuous), ((_b = this.props.joints) == null ? void 0 : _b.length) ?? 0, this.props.ensembleBodiesPerInstance ? this.count / this.props.ensembleBodiesPerInstance : 0)
|
|
236
321
|
};
|
|
237
|
-
if (
|
|
322
|
+
if (this.vehicles.length) {
|
|
323
|
+
const byteLength = this.getVehicleByteLength();
|
|
324
|
+
storage.buffers.push({ name: "vehicle", byteLength, uniform: false });
|
|
325
|
+
if (this.props.failurePolicy === "rollback") {
|
|
326
|
+
storage.buffers.push({
|
|
327
|
+
name: this.vehiclesPerInstance ? "checkpoint-vehicles" : "checkpoint-7",
|
|
328
|
+
byteLength: this.vehiclesPerInstance ? this.vehicles.length * import_rigid_body_vehicle.VEHICLE_STRIDE : byteLength,
|
|
329
|
+
uniform: false
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (((_c = this.props.continuous) == null ? void 0 : _c.mode) === "convex") {
|
|
238
334
|
storage.buffers = storage.buffers.filter((buffer) => buffer.name !== "continuous-previous");
|
|
239
335
|
storage.buffers.push({ name: "continuous-dispatch", byteLength: 16, uniform: false });
|
|
240
336
|
storage.buffers.push({
|
|
@@ -245,7 +341,7 @@ class GPURigidBodyWorld {
|
|
|
245
341
|
}
|
|
246
342
|
if (this.props.publicationBounds || this.props.publishPoses)
|
|
247
343
|
storage.buffers.push({ name: "pose-metadata", byteLength: this.count * 48, uniform: false }, { name: "pose-matrices", byteLength: this.count * 64, uniform: false }, { name: "pose-bounds", byteLength: this.count * 32, uniform: false });
|
|
248
|
-
const triggerLayout = ((
|
|
344
|
+
const triggerLayout = ((_d = this.props.triggers) == null ? void 0 : _d.length) ? (0, import_rigid_body_triggers.makeRigidBodyTriggerLayout)(this.props.triggers, this.colliders) : void 0;
|
|
249
345
|
if (triggerLayout)
|
|
250
346
|
storage.buffers.push({ name: "trigger-previous", byteLength: this.colliderStorageCount * 16, uniform: false }, { name: "trigger-groups", byteLength: triggerLayout.groups.byteLength, uniform: false }, { name: "trigger-pairs", byteLength: triggerLayout.pairs.byteLength, uniform: false }, {
|
|
251
347
|
name: "trigger-samples",
|
|
@@ -278,7 +374,7 @@ class GPURigidBodyWorld {
|
|
|
278
374
|
if (!this.device || !this.ensembleBuffer || this.destroyed)
|
|
279
375
|
throw new Error("World has no ensemble scheduler");
|
|
280
376
|
this.ensembleResetOrigin ??= this.origin;
|
|
281
|
-
this.ensembleReset ??= (0, import_rigid_body_ensemble_reset.makeEnsembleReset)(this.device, this.id, this.ownedBuffers, this.count, this.props.ensembleBodiesPerInstance, this.props.collisionPartitionSize, this.maximumPairs);
|
|
377
|
+
this.ensembleReset ??= (0, import_rigid_body_ensemble_reset.makeEnsembleReset)(this.device, this.id, this.ownedBuffers, this.count, this.props.ensembleBodiesPerInstance, this.props.collisionPartitionSize, this.maximumPairs, this.vehiclesPerInstance, this.ensembleTerrainSlots);
|
|
282
378
|
return this.ensembleReset.byteLength;
|
|
283
379
|
}
|
|
284
380
|
resetEnsembleInstance(instance) {
|
|
@@ -289,32 +385,35 @@ class GPURigidBodyWorld {
|
|
|
289
385
|
const colliderStart = instance * this.props.collisionPartitionSize;
|
|
290
386
|
let colliderIndex = colliderStart;
|
|
291
387
|
const restored = this.initialEnsembleBodies.map((body) => {
|
|
292
|
-
|
|
293
|
-
|
|
388
|
+
const { shape, colliders, ...properties } = body;
|
|
389
|
+
const resetCollider = (definition) => {
|
|
390
|
+
var _a;
|
|
391
|
+
const index = colliderIndex++;
|
|
392
|
+
const { body: _, ...current } = this.colliders[index];
|
|
393
|
+
if (this.ensembleTerrainSlots.has(index))
|
|
394
|
+
return current;
|
|
294
395
|
return {
|
|
295
|
-
...
|
|
296
|
-
shape:
|
|
396
|
+
...definition,
|
|
397
|
+
shape: definition.shape.type === "convex-hull" || definition.shape.type === "triangle-mesh" ? current.shape : definition.shape,
|
|
398
|
+
excludedColliders: (_a = definition.excludedColliders) == null ? void 0 : _a.map((index2) => index2 + colliderStart)
|
|
297
399
|
};
|
|
298
|
-
}
|
|
299
|
-
return {
|
|
300
|
-
...body,
|
|
301
|
-
colliders: body.colliders.map((collider) => {
|
|
302
|
-
var _a;
|
|
303
|
-
const current = this.colliders[colliderIndex++].shape;
|
|
304
|
-
return {
|
|
305
|
-
...collider,
|
|
306
|
-
shape: collider.shape.type === "convex-hull" || collider.shape.type === "triangle-mesh" ? current : collider.shape,
|
|
307
|
-
excludedColliders: (_a = collider.excludedColliders) == null ? void 0 : _a.map((index) => index + colliderStart)
|
|
308
|
-
};
|
|
309
|
-
})
|
|
310
400
|
};
|
|
401
|
+
if (shape && !this.ensembleTerrainSlots.has(colliderIndex))
|
|
402
|
+
return { ...body, shape: resetCollider({ shape }).shape };
|
|
403
|
+
return { ...properties, colliders: (colliders ?? [{ shape }]).map(resetCollider) };
|
|
311
404
|
});
|
|
312
|
-
const definitions =
|
|
405
|
+
const definitions = this.props.bodies;
|
|
313
406
|
definitions.splice(bodyStart, restored.length, ...restored);
|
|
314
|
-
this.
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
407
|
+
this.restoreColliderDefinitions(bodyStart, bodyStart + restored.length);
|
|
408
|
+
const metadata = this.ownedBuffers.find((buffer) => buffer.id === `${this.id}-bodies`);
|
|
409
|
+
for (let index = colliderStart; index < colliderIndex; index++) {
|
|
410
|
+
this.colliderShapeScales.delete(index);
|
|
411
|
+
if (!this.ensembleTerrainSlots.has(index))
|
|
412
|
+
continue;
|
|
413
|
+
const collider = this.colliders[index];
|
|
414
|
+
const center = definitions[collider.body].centerOfMass ?? [0, 0, 0];
|
|
415
|
+
metadata.write(new Float32Array((collider.position ?? [0, 0, 0]).map((value, axis) => value - center[axis])), this.count * 48 + index * 96 + 16);
|
|
416
|
+
}
|
|
318
417
|
this.ensembleReset.reset(instance, this.origin.map((value, axis) => value - this.ensembleResetOrigin[axis]));
|
|
319
418
|
this.ensembleBuffer.write(new Uint32Array([0, 0, 0, 0, 1, 1]), (16 + instance * 8 + 1) * 4);
|
|
320
419
|
if (this.encodePosePublication) {
|
|
@@ -359,6 +458,7 @@ class GPURigidBodyWorld {
|
|
|
359
458
|
claimedContacts,
|
|
360
459
|
journaledContacts,
|
|
361
460
|
bodySnapshotBytes: activeBodies * 80,
|
|
461
|
+
vehicleSnapshotBytes: activeInstances * this.vehiclesPerInstance * import_rigid_body_vehicle.VEHICLE_STRIDE,
|
|
362
462
|
contactSnapshotBytes: journaledContacts * 416,
|
|
363
463
|
allocatorSnapshotBytes: (8 + activeInstances * 2 + journaledContacts * 3) * 4,
|
|
364
464
|
residentInstances: this.count / this.props.ensembleBodiesPerInstance,
|
|
@@ -372,7 +472,7 @@ class GPURigidBodyWorld {
|
|
|
372
472
|
}
|
|
373
473
|
/** Allocation preflight without GPU allocation. Graph scratch and driver overhead are separate. */
|
|
374
474
|
getCapacityInfo() {
|
|
375
|
-
const {
|
|
475
|
+
const buffers = this.allocationPlan ? this.allocationPlan.map((buffer) => ({ ...buffer })) : this.getStorageLayout().buffers;
|
|
376
476
|
return {
|
|
377
477
|
bodyCount: this.count,
|
|
378
478
|
colliderCount: this.colliderCount,
|
|
@@ -391,11 +491,14 @@ class GPURigidBodyWorld {
|
|
|
391
491
|
throw new Error("Rigid-body pair dispatch exceeds device limits");
|
|
392
492
|
if (((_a = this.props.continuous) == null ? void 0 : _a.mode) === "convex" && Math.max(Math.ceil((this.props.continuous.maximumCandidates ?? this.maximumPairs) / 64), Math.ceil(2 ** Math.ceil(Math.log2(Math.max(1, this.colliders.length))) / 64)) > graph.device.limits.maxComputeWorkgroupsPerDimension)
|
|
393
493
|
throw new Error("Continuous candidate dispatch exceeds device limits");
|
|
494
|
+
if (!this.vehiclesPerInstance && this.vehicles.length > graph.device.limits.maxComputeWorkgroupsPerDimension)
|
|
495
|
+
throw new Error("Vehicle dispatch exceeds device limits");
|
|
394
496
|
for (const buffer of allocationPlan) {
|
|
395
497
|
const bindingLimit = buffer.uniform ? graph.device.limits.maxUniformBufferBindingSize : graph.device.limits.maxStorageBufferBindingSize;
|
|
396
498
|
if (buffer.byteLength > Math.min(graph.device.limits.maxBufferSize, bindingLimit))
|
|
397
499
|
throw new Error(`Rigid-body ${buffer.name} storage exceeds device limits`);
|
|
398
500
|
}
|
|
501
|
+
this.allocationPlan = allocationPlan;
|
|
399
502
|
this.device = graph.device;
|
|
400
503
|
const allocate = (name, data, uniform = false) => {
|
|
401
504
|
const buffer = graph.device.createBuffer({
|
|
@@ -417,6 +520,29 @@ class GPURigidBodyWorld {
|
|
|
417
520
|
} : void 0;
|
|
418
521
|
const metadata = new Float32Array(metadataLength);
|
|
419
522
|
metadata.set(packed.geometry, geometryOffset);
|
|
523
|
+
if (this.terrainAtlas) {
|
|
524
|
+
this.terrainGeometryWord = geometryOffset;
|
|
525
|
+
this.terrainAtlasWord = geometryOffset + packed.geometry.length;
|
|
526
|
+
const { wordsByCollider, uploads } = this.terrainAtlas.bind(Array.from(packed.atlasFields, ([collider, field]) => ({
|
|
527
|
+
collider,
|
|
528
|
+
data: new Float32Array(field.data)
|
|
529
|
+
})));
|
|
530
|
+
for (const { word, data } of uploads)
|
|
531
|
+
metadata.set(data, this.terrainAtlasWord + word);
|
|
532
|
+
for (const [collider, word] of wordsByCollider) {
|
|
533
|
+
const field = packed.atlasFields.get(collider);
|
|
534
|
+
const address = (packed.geometry.length + word) / 4;
|
|
535
|
+
const shape = packed.shapes[collider];
|
|
536
|
+
shape.padding[0] = address;
|
|
537
|
+
shape.padding[3] = field.triangleCount;
|
|
538
|
+
shape.policies[0] = address + field.nodeOffset;
|
|
539
|
+
shape.policies[1] = field.nodeCount;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
this.heightFieldSlots = new Map(Array.from(packed.heightFields, ([collider, offset]) => [
|
|
543
|
+
collider,
|
|
544
|
+
(geometryOffset + offset * 4) * 4
|
|
545
|
+
]));
|
|
420
546
|
const bodyColliders = Array.from({ length: this.count }, () => []);
|
|
421
547
|
if (this.colliderCount)
|
|
422
548
|
for (const collider of this.colliders)
|
|
@@ -474,7 +600,10 @@ class GPURigidBodyWorld {
|
|
|
474
600
|
(material == null ? void 0 : material.restitutionCombine) ? policies.indexOf(material.restitutionCombine) : 4,
|
|
475
601
|
(material == null ? void 0 : material.frictionCombine) ? policies.indexOf(material.frictionCombine) : 4,
|
|
476
602
|
...shape.policies,
|
|
477
|
-
|
|
603
|
+
shape.padding[0],
|
|
604
|
+
shape.padding[1],
|
|
605
|
+
this.ensembleTerrainSlots.has(index) ? 1 : shape.padding[2],
|
|
606
|
+
shape.padding[3]
|
|
478
607
|
], this.count * 12 + index * 24);
|
|
479
608
|
}
|
|
480
609
|
const exclusionOffset = this.count * 12 + this.colliderStorageCount * 24;
|
|
@@ -572,7 +701,7 @@ class GPURigidBodyWorld {
|
|
|
572
701
|
byteLength: objectAttributes.byteLength,
|
|
573
702
|
usage: import_core.Buffer.STORAGE
|
|
574
703
|
}, objectAttributes), { format: "uint32", length: this.colliderStorageCount }) : void 0;
|
|
575
|
-
const source = (0, import_rigid_body_shaders.getRigidBodyShader)(this.count, this.props.iterations ?? 16, this.colliderStorageCount, extended, sparseLayout, parallel, this.props.maximumMeshTraversalTestsPerPair ?? 65536, (0, import_rigid_body_joints.getRigidBodyJointShader)(this.props.joints ?? [], this.props.bodies), Boolean((_d = this.props.joints) == null ? void 0 : _d.length), this.props.linearDamping ?? 0, this.props.angularDamping ?? 0, ((_e = this.props.joints) == null ? void 0 : _e.length) ?? 0, this.props.compactContacts ?? true, this.props.collisionPartitionSize, this.props.ensembleBodiesPerInstance);
|
|
704
|
+
const source = (0, import_rigid_body_shaders.getRigidBodyShader)(this.count, this.props.iterations ?? 16, this.colliderStorageCount, extended, sparseLayout, parallel, this.props.maximumMeshTraversalTestsPerPair ?? 65536, (0, import_rigid_body_joints.getRigidBodyJointShader)(this.props.joints ?? [], this.props.bodies), Boolean((_d = this.props.joints) == null ? void 0 : _d.length), this.props.linearDamping ?? 0, this.props.angularDamping ?? 0, ((_e = this.props.joints) == null ? void 0 : _e.length) ?? 0, this.props.compactContacts ?? true, this.props.collisionPartitionSize, this.props.ensembleBodiesPerInstance, this.props.parallelContactSolver === "block", this.colliders.some((collider) => collider.shape.type === "height-field"));
|
|
576
705
|
const parallelBindings = {
|
|
577
706
|
parallelReset: ["parallelState"],
|
|
578
707
|
parallelResetCounters: ["parallelState"],
|
|
@@ -642,29 +771,6 @@ class GPURigidBodyWorld {
|
|
|
642
771
|
}
|
|
643
772
|
this.simulationStatistics = allocate("simulation-statistics", 64);
|
|
644
773
|
const statisticsResource = graph.importBuffer({ id: `${this.id}-statistics`, byteLength: 64, usage: import_core.Buffer.STORAGE }, this.simulationStatistics);
|
|
645
|
-
const checkpointStates = [
|
|
646
|
-
"positions",
|
|
647
|
-
"orientations",
|
|
648
|
-
"velocities",
|
|
649
|
-
"angularVelocities",
|
|
650
|
-
"sleepStates",
|
|
651
|
-
"targets"
|
|
652
|
-
].map((name) => {
|
|
653
|
-
const binding = bindings.find((binding2) => binding2.name === name);
|
|
654
|
-
return { buffer: binding.buffer, resource: binding.resource };
|
|
655
|
-
});
|
|
656
|
-
const restoreCheckpoint = this.props.failurePolicy === "rollback" ? this.ensembleBuffer ? (0, import_rigid_body_ensemble_transaction.addEnsembleCheckpoint)(graph, this.id, checkpointStates, { buffer: this.simulationStatistics, resource: statisticsResource }, bindings.find((binding) => binding.name === "ensemble"), bindings.find((binding) => binding.name === "manifolds"), this.props.ensembleBodiesPerInstance, this.maximumPairs, allocate) : (0, import_rigid_body_transaction.addRigidBodyCheckpoint)(graph, this.id, [
|
|
657
|
-
"positions",
|
|
658
|
-
"orientations",
|
|
659
|
-
"velocities",
|
|
660
|
-
"angularVelocities",
|
|
661
|
-
"sleepStates",
|
|
662
|
-
"targets",
|
|
663
|
-
...this.ensembleBuffer ? [] : ["manifolds"]
|
|
664
|
-
].map((name) => {
|
|
665
|
-
const binding = bindings.find((binding2) => binding2.name === name);
|
|
666
|
-
return { buffer: binding.buffer, resource: binding.resource };
|
|
667
|
-
}), { buffer: this.simulationStatistics, resource: statisticsResource }, allocate) : void 0;
|
|
668
774
|
const continuousSelection = new Uint32Array(this.count);
|
|
669
775
|
for (const body of ((_g = this.props.continuous) == null ? void 0 : _g.bodies) ?? [])
|
|
670
776
|
continuousSelection[body] = this.colliders.findIndex((collider) => collider.body === body) + 1;
|
|
@@ -699,6 +805,142 @@ class GPURigidBodyWorld {
|
|
|
699
805
|
parallelMarkSleep: "Identify islands whose bodies are quiet enough to sleep.",
|
|
700
806
|
parallelSleep: "Put quiet constraint islands to sleep."
|
|
701
807
|
};
|
|
808
|
+
let vehicleResource;
|
|
809
|
+
let addVehiclePass;
|
|
810
|
+
if (this.vehicles.length) {
|
|
811
|
+
const packed2 = new Float32Array(this.getVehicleByteLength() / 4);
|
|
812
|
+
for (const [vehicleIndex, vehicle] of this.vehicles.entries()) {
|
|
813
|
+
const data = packed2.subarray(vehicleIndex * import_rigid_body_vehicle.VEHICLE_STRIDE / 4, (vehicleIndex + 1) * import_rigid_body_vehicle.VEHICLE_STRIDE / 4);
|
|
814
|
+
data.set([
|
|
815
|
+
vehicle.radius,
|
|
816
|
+
vehicle.travel,
|
|
817
|
+
vehicle.springRate,
|
|
818
|
+
vehicle.damping,
|
|
819
|
+
vehicle.grip,
|
|
820
|
+
vehicle.motorTorque,
|
|
821
|
+
vehicle.brakeTorque,
|
|
822
|
+
vehicle.wheelInertia
|
|
823
|
+
], 4);
|
|
824
|
+
new Uint32Array(data.buffer, data.byteOffset, data.length).set([vehicle.chassis, vehicle.terrainCollider], 12);
|
|
825
|
+
data.set([vehicle.steeringWheelbase ?? 0, vehicle.antiRollRate ?? 0], 14);
|
|
826
|
+
const [longitudinalGain, lateralGain] = vehicle.slipGain ?? [1.1, 1.5];
|
|
827
|
+
vehicle.wheels.forEach((wheel, index) => {
|
|
828
|
+
const offset = 16 + index * 12;
|
|
829
|
+
data.set([...wheel.mount, longitudinalGain + 1], offset);
|
|
830
|
+
data.set([Number(Boolean(wheel.steer)), Number(Boolean(wheel.drive)), lateralGain + 1], offset + 4);
|
|
831
|
+
data[offset + 10] = vehicle.travel;
|
|
832
|
+
data.set([
|
|
833
|
+
1,
|
|
834
|
+
0,
|
|
835
|
+
0,
|
|
836
|
+
0,
|
|
837
|
+
0,
|
|
838
|
+
1,
|
|
839
|
+
0,
|
|
840
|
+
0,
|
|
841
|
+
0,
|
|
842
|
+
0,
|
|
843
|
+
1,
|
|
844
|
+
0,
|
|
845
|
+
wheel.mount[0],
|
|
846
|
+
wheel.mount[1],
|
|
847
|
+
wheel.mount[2] - vehicle.travel,
|
|
848
|
+
1
|
|
849
|
+
], 64 + 16 * index);
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
if (this.multiSurfaceVehicles) {
|
|
853
|
+
const terrainRows = new Uint32Array(packed2.buffer, this.vehicles.length * import_rigid_body_vehicle.VEHICLE_STRIDE);
|
|
854
|
+
terrainRows.fill(4294967295);
|
|
855
|
+
for (const [vehicleIndex, vehicle] of this.vehicles.entries())
|
|
856
|
+
terrainRows.set(vehicle.additionalTerrainColliders ?? [], vehicleIndex * (import_rigid_body_vehicle.VEHICLE_TERRAIN_ROW_SIZE / 4));
|
|
857
|
+
}
|
|
858
|
+
this.vehicleBuffer = allocate("vehicle", packed2);
|
|
859
|
+
vehicleResource = {
|
|
860
|
+
buffer: this.vehicleBuffer,
|
|
861
|
+
resource: graph.importBuffer({
|
|
862
|
+
id: this.id + "-vehicle",
|
|
863
|
+
byteLength: packed2.byteLength,
|
|
864
|
+
usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_SRC
|
|
865
|
+
}, this.vehicleBuffer)
|
|
866
|
+
};
|
|
867
|
+
const ensembleBinding = bindings.find((binding) => binding.name === "ensemble");
|
|
868
|
+
const vehicleBindings = [
|
|
869
|
+
...bindings.filter((binding) => [
|
|
870
|
+
"settings",
|
|
871
|
+
"positions",
|
|
872
|
+
"orientations",
|
|
873
|
+
"velocities",
|
|
874
|
+
"angularVelocities",
|
|
875
|
+
"bodies",
|
|
876
|
+
"sleepStates",
|
|
877
|
+
"ensemble"
|
|
878
|
+
].includes(binding.name)),
|
|
879
|
+
{ name: "vehicle", location: 12, ...vehicleResource }
|
|
880
|
+
];
|
|
881
|
+
const properties = {
|
|
882
|
+
id: this.id + "-suspension",
|
|
883
|
+
source: (0, import_rigid_body_ensemble_shaders.readOnlyEnsembleShader)(source) + import_rigid_body_query_geometry.RIGID_BODY_QUERY_GEOMETRY_SHADER + (0, import_rigid_body_vehicle.getVehicleShader)(this.vehicles.length, this.multiSurfaceVehicles, this.vehiclesPerInstance),
|
|
884
|
+
entryPoint: "advanceVehicle",
|
|
885
|
+
shaderLayout: {
|
|
886
|
+
bindings: vehicleBindings.map(({ name, location }) => name === "settings" ? { name, location, group: 0, type: "uniform" } : {
|
|
887
|
+
name,
|
|
888
|
+
location,
|
|
889
|
+
group: 0,
|
|
890
|
+
type: name === "bodies" || name === "ensemble" ? "read-only-storage" : "storage"
|
|
891
|
+
})
|
|
892
|
+
}
|
|
893
|
+
};
|
|
894
|
+
const executable = (computation) => ({
|
|
895
|
+
encode: ({ computePass, getBuffer }) => {
|
|
896
|
+
Object.assign(computation.bindings, Object.fromEntries(vehicleBindings.map((binding) => [binding.name, getBuffer(binding.resource)])));
|
|
897
|
+
if (ensembleBinding)
|
|
898
|
+
computation.kernel.dispatchIndirect(computePass, {
|
|
899
|
+
bindings: computation.bindings,
|
|
900
|
+
indirectBuffer: getBuffer(ensembleBinding.resource),
|
|
901
|
+
indirectOffset: 16
|
|
902
|
+
});
|
|
903
|
+
else
|
|
904
|
+
computation.kernel.dispatch(computePass, {
|
|
905
|
+
bindings: computation.bindings,
|
|
906
|
+
x: this.vehicles.length
|
|
907
|
+
});
|
|
908
|
+
},
|
|
909
|
+
destroy: () => computation.kernel.destroy()
|
|
910
|
+
});
|
|
911
|
+
addVehiclePass = () => graph.addComputePass({
|
|
912
|
+
id: properties.id,
|
|
913
|
+
description: "Sweep four wheels and apply suspension and tire forces per chassis.",
|
|
914
|
+
resources: [
|
|
915
|
+
...vehicleBindings.map((binding) => ({
|
|
916
|
+
buffer: binding.resource,
|
|
917
|
+
usage: binding.name === "settings" ? "uniform" : binding.name === "bodies" || binding.name === "ensemble" ? "storage-read" : "storage-read-write"
|
|
918
|
+
})),
|
|
919
|
+
...ensembleBinding ? [{ buffer: ensembleBinding.resource, usage: "indirect" }] : []
|
|
920
|
+
],
|
|
921
|
+
compile: () => executable((0, import_bound_kernel.createBoundKernel)(graph.device, properties)),
|
|
922
|
+
compileAsync: async () => executable(await (0, import_bound_kernel.createBoundKernelAsync)(graph.device, properties))
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
const checkpointStates = [
|
|
926
|
+
"positions",
|
|
927
|
+
"orientations",
|
|
928
|
+
"velocities",
|
|
929
|
+
"angularVelocities",
|
|
930
|
+
"sleepStates",
|
|
931
|
+
"targets"
|
|
932
|
+
].map((name) => {
|
|
933
|
+
const binding = bindings.find((binding2) => binding2.name === name);
|
|
934
|
+
return { buffer: binding.buffer, resource: binding.resource };
|
|
935
|
+
});
|
|
936
|
+
const restoreCheckpoint = this.props.failurePolicy === "rollback" ? this.ensembleBuffer ? (0, import_rigid_body_ensemble_transaction.addEnsembleCheckpoint)(graph, this.id, checkpointStates, { buffer: this.simulationStatistics, resource: statisticsResource }, bindings.find((binding) => binding.name === "ensemble"), bindings.find((binding) => binding.name === "manifolds"), this.props.ensembleBodiesPerInstance, this.maximumPairs, allocate, vehicleResource && {
|
|
937
|
+
state: vehicleResource,
|
|
938
|
+
vehiclesPerInstance: this.vehiclesPerInstance
|
|
939
|
+
}) : (0, import_rigid_body_transaction.addRigidBodyCheckpoint)(graph, this.id, [
|
|
940
|
+
...checkpointStates,
|
|
941
|
+
bindings.find((binding) => binding.name === "manifolds"),
|
|
942
|
+
...vehicleResource ? [vehicleResource] : []
|
|
943
|
+
], { buffer: this.simulationStatistics, resource: statisticsResource }, allocate) : void 0;
|
|
702
944
|
for (const entryPoint of [
|
|
703
945
|
...this.ensembleBuffer ? ["ensembleClear", "ensembleMark", "ensembleCompact", "ensembleDispatch"] : [],
|
|
704
946
|
"integrate",
|
|
@@ -727,8 +969,10 @@ class GPURigidBodyWorld {
|
|
|
727
969
|
"parallelSleep"
|
|
728
970
|
] : [...extended && ((_j = this.props.joints) == null ? void 0 : _j.length) ? ["meshCollect"] : [], "solve", "finish"]
|
|
729
971
|
]) {
|
|
730
|
-
if (entryPoint === "integrate")
|
|
972
|
+
if (entryPoint === "integrate") {
|
|
731
973
|
(_k = restoreCheckpoint == null ? void 0 : restoreCheckpoint.save) == null ? void 0 : _k.call(restoreCheckpoint);
|
|
974
|
+
addVehiclePass == null ? void 0 : addVehiclePass();
|
|
975
|
+
}
|
|
732
976
|
if (sparse && entryPoint === "collide") {
|
|
733
977
|
const bodyBinding = bindings.find((binding) => binding.name === "bodies");
|
|
734
978
|
const minimumBinding = bindings.find((binding) => binding.name === "minima");
|
|
@@ -1188,6 +1432,48 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1188
1432
|
},
|
|
1189
1433
|
bindings: Object.fromEntries(Object.entries(controlProperties.bindings).filter(([name]) => invalidationBindings.includes(name)))
|
|
1190
1434
|
});
|
|
1435
|
+
if (this.heightFieldSlots.size && !this.ensembleBuffer) {
|
|
1436
|
+
this.terrainWake = (0, import_bound_kernel.createBoundKernel)(graph.device, {
|
|
1437
|
+
id: `${this.id}-terrain-wake`,
|
|
1438
|
+
entryPoint: "wakeTerrain",
|
|
1439
|
+
source: controlProperties.source + /* wgsl */
|
|
1440
|
+
`
|
|
1441
|
+
@group(0) @binding(26) var<storage,read_write> terrainSleep:array<atomic<u32>>;
|
|
1442
|
+
@compute @workgroup_size(64) fn wakeTerrain(@builtin(global_invocation_id) invocation:vec3u) {
|
|
1443
|
+
let collider=invocation.x;if(collider>=COLLIDER_COUNT){return;}
|
|
1444
|
+
let body=colliderBody(collider);if(!dynamic(body)){return;}
|
|
1445
|
+
let tile=command.bodyIndex.x;if(bodies.colliders[tile].padding.w==0.0){return;}
|
|
1446
|
+
if(any(abs(colliderPosition(collider)-colliderPosition(tile))>shapeWorldExtent(collider)+shapeWorldExtent(tile)+vec3f(settings.solver.x))){return;}
|
|
1447
|
+
// Several colliders on one sleeping body may all overlap the tile.
|
|
1448
|
+
for(var axis=0u;axis<4u;axis++){atomicStore(&terrainSleep[body*4u+axis],0u);}
|
|
1449
|
+
}`,
|
|
1450
|
+
shaderLayout: {
|
|
1451
|
+
bindings: [
|
|
1452
|
+
...shaderLayout.bindings.filter((binding) => ["settings", "positions", "orientations", "bodies"].includes(binding.name)),
|
|
1453
|
+
{ name: "command", group: 0, location: 8, type: "uniform" },
|
|
1454
|
+
{ name: "terrainSleep", group: 0, location: 26, type: "storage" }
|
|
1455
|
+
]
|
|
1456
|
+
},
|
|
1457
|
+
bindings: {
|
|
1458
|
+
settings: buffers.settings,
|
|
1459
|
+
positions: buffers.positions,
|
|
1460
|
+
orientations: buffers.orientations,
|
|
1461
|
+
bodies: buffers.bodies,
|
|
1462
|
+
command: this.controlSettings,
|
|
1463
|
+
terrainSleep: this.sleepStates
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
/** Wake sleeping bodies overlapping one published terrain footprint. */
|
|
1469
|
+
wakeTerrainFootprint(collider) {
|
|
1470
|
+
const { kernel, bindings } = this.terrainWake;
|
|
1471
|
+
this.controlSettings.write(new Uint32Array([collider]), 48);
|
|
1472
|
+
const encoder = this.device.createCommandEncoder();
|
|
1473
|
+
const pass = encoder.beginComputePass();
|
|
1474
|
+
kernel.dispatch(pass, { bindings, x: Math.ceil(this.colliderStorageCount / 64) });
|
|
1475
|
+
pass.end();
|
|
1476
|
+
this.device.submit(encoder.finish());
|
|
1191
1477
|
}
|
|
1192
1478
|
invalidateState(pass) {
|
|
1193
1479
|
var _a, _b;
|
|
@@ -1220,6 +1506,80 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1220
1506
|
const definition = this.props.bodies[body];
|
|
1221
1507
|
return definition ? definition.mode ?? ((definition.mass ?? 1) === 0 ? "static" : "dynamic") : void 0;
|
|
1222
1508
|
}
|
|
1509
|
+
/** Set signed throttle, steering angle in radians and brake fraction for upcoming substeps. */
|
|
1510
|
+
setVehicleControls(throttle, steering, brake, vehicleIndex = 0) {
|
|
1511
|
+
if (!this.vehicleBuffer || this.destroyed || !this.vehicles[vehicleIndex] || ![throttle, steering, brake].every((value) => Number.isFinite(Math.fround(value))))
|
|
1512
|
+
throw new Error("Invalid vehicle controls");
|
|
1513
|
+
this.vehicleBuffer.write(new Float32Array([
|
|
1514
|
+
Math.max(-1, Math.min(1, throttle)),
|
|
1515
|
+
steering,
|
|
1516
|
+
Math.max(0, Math.min(1, brake)),
|
|
1517
|
+
0
|
|
1518
|
+
]), vehicleIndex * import_rigid_body_vehicle.VEHICLE_STRIDE);
|
|
1519
|
+
if (this.vehiclesPerInstance) {
|
|
1520
|
+
const instance = Math.floor(vehicleIndex / this.vehiclesPerInstance);
|
|
1521
|
+
this.ensembleBuffer.write(new Uint32Array([1]), (16 + instance * 8 + 6) * 4);
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
/** Borrow four column-major wheel transforms relative to the chassis node, ordered by mount. */
|
|
1525
|
+
get vehicleWheelPoses() {
|
|
1526
|
+
return this.getVehicleWheelPoses();
|
|
1527
|
+
}
|
|
1528
|
+
/** Borrow the indexed vehicle’s four chassis-local wheel poses, in mount order. */
|
|
1529
|
+
getVehicleWheelPoses(vehicleIndex = 0) {
|
|
1530
|
+
return this.vehicleBuffer && !this.destroyed && this.vehicles[vehicleIndex] ? {
|
|
1531
|
+
buffer: this.vehicleBuffer,
|
|
1532
|
+
byteOffset: vehicleIndex * import_rigid_body_vehicle.VEHICLE_STRIDE + 256,
|
|
1533
|
+
byteLength: 256
|
|
1534
|
+
} : null;
|
|
1535
|
+
}
|
|
1536
|
+
/** Transfer wheel motion between rebuilt worlds for wheels with matching chassis-local mounts. */
|
|
1537
|
+
copyVehicleMotionFrom(previous, vehicleIndex = 0, previousVehicleIndex = 0) {
|
|
1538
|
+
var _a;
|
|
1539
|
+
const sourceBuffer = previous.vehicleBuffer;
|
|
1540
|
+
const destinationBuffer = this.vehicleBuffer;
|
|
1541
|
+
const previousVehicle = previous.vehicles[previousVehicleIndex];
|
|
1542
|
+
if (!this.device || !sourceBuffer || !destinationBuffer || !previousVehicle)
|
|
1543
|
+
return;
|
|
1544
|
+
const encoder = this.device.createCommandEncoder();
|
|
1545
|
+
(_a = this.vehicles[vehicleIndex]) == null ? void 0 : _a.wheels.forEach((wheel, index) => {
|
|
1546
|
+
const sourceIndex = previousVehicle.wheels.findIndex((source) => source.mount.every((coordinate, axis) => coordinate === wheel.mount[axis]));
|
|
1547
|
+
if (sourceIndex < 0)
|
|
1548
|
+
return;
|
|
1549
|
+
encoder.copyBufferToBuffer({
|
|
1550
|
+
sourceBuffer,
|
|
1551
|
+
destinationBuffer,
|
|
1552
|
+
sourceOffset: previousVehicleIndex * import_rigid_body_vehicle.VEHICLE_STRIDE + 92 + sourceIndex * 48,
|
|
1553
|
+
destinationOffset: vehicleIndex * import_rigid_body_vehicle.VEHICLE_STRIDE + 92 + index * 48,
|
|
1554
|
+
size: 20
|
|
1555
|
+
});
|
|
1556
|
+
encoder.copyBufferToBuffer({
|
|
1557
|
+
sourceBuffer,
|
|
1558
|
+
destinationBuffer,
|
|
1559
|
+
sourceOffset: previousVehicleIndex * import_rigid_body_vehicle.VEHICLE_STRIDE + 256 + sourceIndex * 64,
|
|
1560
|
+
destinationOffset: vehicleIndex * import_rigid_body_vehicle.VEHICLE_STRIDE + 256 + index * 64,
|
|
1561
|
+
size: 64
|
|
1562
|
+
});
|
|
1563
|
+
});
|
|
1564
|
+
this.device.submit(encoder.finish());
|
|
1565
|
+
}
|
|
1566
|
+
/** Read wheel spin, angle, suspension length and normal load after submitted steps. */
|
|
1567
|
+
async readVehicleWheels(vehicleIndex = 0) {
|
|
1568
|
+
if (!this.vehicleBuffer || this.destroyed || !this.vehicles[vehicleIndex])
|
|
1569
|
+
throw new Error("Vehicle unavailable");
|
|
1570
|
+
const bytes = await this.vehicleBuffer.readAsync(vehicleIndex * import_rigid_body_vehicle.VEHICLE_STRIDE, 256);
|
|
1571
|
+
const values = new Float32Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 4);
|
|
1572
|
+
return Array.from({ length: 4 }, (_, index) => {
|
|
1573
|
+
const offset = 24 + index * 12;
|
|
1574
|
+
return {
|
|
1575
|
+
speed: values[offset],
|
|
1576
|
+
angle: values[offset + 1],
|
|
1577
|
+
length: values[offset + 2],
|
|
1578
|
+
load: values[offset + 3],
|
|
1579
|
+
steering: values[offset - 1]
|
|
1580
|
+
};
|
|
1581
|
+
});
|
|
1582
|
+
}
|
|
1223
1583
|
/** Submit an impulse at a world-space point, or the current GPU center of mass when omitted. */
|
|
1224
1584
|
applyImpulse(body, impulse, point) {
|
|
1225
1585
|
if (!this.control || !this.device || !this.controlSettings || this.destroyed || !Number.isInteger(body) || body < 0 || body >= this.count || ![...impulse, ...point ?? []].every(Number.isFinite))
|
|
@@ -1300,7 +1660,7 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1300
1660
|
const shape = structuredClone(edit.shape);
|
|
1301
1661
|
if (edit.shapeScale && (edit.shapeScale.length !== 3 || edit.shapeScale.some((value) => !Number.isFinite(value) || value <= 0)))
|
|
1302
1662
|
throw new Error("Invalid collider shape scale");
|
|
1303
|
-
if (indices.has(edit.collider) || previous.type !== shape.type || shape.type === "convex-hull" || shape.type === "triangle-mesh")
|
|
1663
|
+
if (indices.has(edit.collider) || previous.type !== shape.type || shape.type === "convex-hull" || shape.type === "triangle-mesh" || shape.type === "height-field")
|
|
1304
1664
|
throw new Error("Shape edit requires a topology rebuild");
|
|
1305
1665
|
indices.add(edit.collider);
|
|
1306
1666
|
const properties = (0, import_rigid_body_shape_properties.getRigidBodyShapeProperties)(shape);
|
|
@@ -1333,6 +1693,94 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1333
1693
|
this.setBodyParameters(body, {});
|
|
1334
1694
|
}
|
|
1335
1695
|
}
|
|
1696
|
+
/**
|
|
1697
|
+
* Replace or evict fixed-dimension height-field tiles between submissions.
|
|
1698
|
+
* Optional positions are in each collider's body-local frame. The caller owns
|
|
1699
|
+
* tile selection and must submit already encoded steps before editing residency.
|
|
1700
|
+
*/
|
|
1701
|
+
setHeightFieldTiles(edits) {
|
|
1702
|
+
var _a;
|
|
1703
|
+
if (!edits.length)
|
|
1704
|
+
return;
|
|
1705
|
+
const metadata = this.ownedBuffers.find((buffer) => buffer.id === `${this.id}-bodies`);
|
|
1706
|
+
if (!metadata || this.destroyed || this.queryPending || this.eventRead || this.triggerRead)
|
|
1707
|
+
throw new Error("Terrain streaming requires an idle attached world");
|
|
1708
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1709
|
+
const packedFields = this.terrainAtlas ? /* @__PURE__ */ new Map() : void 0;
|
|
1710
|
+
const replacements = edits.map(({ collider: colliderIndex, field, position }) => {
|
|
1711
|
+
const collider = this.colliders[colliderIndex];
|
|
1712
|
+
const offset = this.heightFieldSlots.get(colliderIndex);
|
|
1713
|
+
if (offset === void 0 && !(this.terrainAtlas && this.ensembleTerrainSlots.has(colliderIndex)) || (collider == null ? void 0 : collider.shape.type) !== "height-field" || seen.has(colliderIndex))
|
|
1714
|
+
throw new Error("Invalid writable height-field slot");
|
|
1715
|
+
seen.add(colliderIndex);
|
|
1716
|
+
const previous = collider.shape.field;
|
|
1717
|
+
if (field && (field.width !== previous.width || field.height !== previous.height))
|
|
1718
|
+
throw new Error("Height-field slot dimensions are fixed");
|
|
1719
|
+
const center = this.props.bodies[collider.body].centerOfMass ?? [0, 0, 0];
|
|
1720
|
+
const localOffset = position == null ? void 0 : position.map((value, axis) => value - center[axis]);
|
|
1721
|
+
if (position && (position.length !== 3 || !(localOffset == null ? void 0 : localOffset.every((value) => Number.isFinite(Math.fround(value))))))
|
|
1722
|
+
throw new Error("Invalid height-field tile position");
|
|
1723
|
+
let payload = field ? packedFields == null ? void 0 : packedFields.get(field) : void 0;
|
|
1724
|
+
if (!payload) {
|
|
1725
|
+
const next = field ? structuredClone(field) : { ...previous, heights: void 0, validity: void 0 };
|
|
1726
|
+
const packed = (0, import_rigid_body_height_field.packRigidBodyHeightField)(next);
|
|
1727
|
+
const data = packedFields && packed.nodeCount ? new Float32Array(packed.data) : null;
|
|
1728
|
+
payload = { field: next, packed, data };
|
|
1729
|
+
if (field)
|
|
1730
|
+
packedFields == null ? void 0 : packedFields.set(field, payload);
|
|
1731
|
+
}
|
|
1732
|
+
return { collider, colliderIndex, offset, position, localOffset, ...payload };
|
|
1733
|
+
});
|
|
1734
|
+
const atlas = (_a = this.terrainAtlas) == null ? void 0 : _a.bind(replacements.map(({ colliderIndex, data }) => ({ collider: colliderIndex, data })));
|
|
1735
|
+
if (this.terrainRevision === 16777215) {
|
|
1736
|
+
this.wake();
|
|
1737
|
+
this.terrainRevision = 1;
|
|
1738
|
+
}
|
|
1739
|
+
const revision = ++this.terrainRevision;
|
|
1740
|
+
for (const { word, data } of (atlas == null ? void 0 : atlas.uploads) ?? [])
|
|
1741
|
+
metadata.write(data, (this.terrainAtlasWord + word) * 4);
|
|
1742
|
+
const changedBodies = /* @__PURE__ */ new Set();
|
|
1743
|
+
const affectedInstances = /* @__PURE__ */ new Set();
|
|
1744
|
+
for (const replacement of replacements) {
|
|
1745
|
+
const { collider, colliderIndex, offset, field, position, localOffset, packed } = replacement;
|
|
1746
|
+
const base = this.count * 48 + colliderIndex * 96;
|
|
1747
|
+
if (this.terrainWake)
|
|
1748
|
+
this.wakeTerrainFootprint(colliderIndex);
|
|
1749
|
+
if (atlas) {
|
|
1750
|
+
const word = atlas.wordsByCollider.get(colliderIndex);
|
|
1751
|
+
const address = word === void 0 ? 0 : (this.terrainAtlasWord - this.terrainGeometryWord + word) / 4;
|
|
1752
|
+
metadata.write(new Float32Array([
|
|
1753
|
+
word === void 0 ? 0 : address + packed.nodeOffset,
|
|
1754
|
+
packed.nodeCount,
|
|
1755
|
+
address
|
|
1756
|
+
]), base + 72);
|
|
1757
|
+
} else {
|
|
1758
|
+
metadata.write(new Float32Array(packed.data), offset);
|
|
1759
|
+
metadata.write(new Float32Array([packed.nodeCount]), base + 76);
|
|
1760
|
+
}
|
|
1761
|
+
metadata.write(new Float32Array(packed.extent), base);
|
|
1762
|
+
metadata.write(new Float32Array([revision, packed.triangleCount]), base + 88);
|
|
1763
|
+
if (position && localOffset) {
|
|
1764
|
+
metadata.write(new Float32Array(localOffset), base + 16);
|
|
1765
|
+
collider.position = [...position];
|
|
1766
|
+
}
|
|
1767
|
+
collider.shape = { type: "height-field", field };
|
|
1768
|
+
changedBodies.add(collider.body);
|
|
1769
|
+
if (this.terrainWake)
|
|
1770
|
+
this.wakeTerrainFootprint(colliderIndex);
|
|
1771
|
+
if (this.props.ensembleBodiesPerInstance)
|
|
1772
|
+
affectedInstances.add(Math.floor(collider.body / this.props.ensembleBodiesPerInstance));
|
|
1773
|
+
}
|
|
1774
|
+
for (const body of changedBodies)
|
|
1775
|
+
this.updateColliderDefinitions(body);
|
|
1776
|
+
for (const instance of affectedInstances)
|
|
1777
|
+
this.wakeEnsembleInstance(instance);
|
|
1778
|
+
}
|
|
1779
|
+
/** Shared atlas utilization, when the fused layout enabled page sharing. */
|
|
1780
|
+
getTerrainAtlasStats() {
|
|
1781
|
+
var _a;
|
|
1782
|
+
return (_a = this.terrainAtlas) == null ? void 0 : _a.getStats();
|
|
1783
|
+
}
|
|
1336
1784
|
/** Change an existing collider material between submissions, invalidating cached friction. */
|
|
1337
1785
|
setColliderMaterial(colliderIndex, material) {
|
|
1338
1786
|
const collider = this.colliders[colliderIndex];
|
|
@@ -1392,10 +1840,8 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1392
1840
|
}
|
|
1393
1841
|
updateColliderDefinitions(bodyIndex) {
|
|
1394
1842
|
const { shape, colliders, ...properties } = this.props.bodies[bodyIndex];
|
|
1395
|
-
const updated = this.colliders.
|
|
1396
|
-
|
|
1397
|
-
bodies[bodyIndex] = { ...properties, colliders: updated };
|
|
1398
|
-
this.props.bodies = bodies;
|
|
1843
|
+
const updated = this.colliders.slice(this.bodyColliderStarts[bodyIndex], this.bodyColliderStarts[bodyIndex + 1]).map(({ body, ...candidate }) => candidate);
|
|
1844
|
+
this.props.bodies[bodyIndex] = { ...properties, colliders: updated };
|
|
1399
1845
|
}
|
|
1400
1846
|
getColliderMaterial(collider) {
|
|
1401
1847
|
const definition = this.colliders[collider];
|
|
@@ -1403,14 +1849,17 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1403
1849
|
throw new Error("Invalid collider");
|
|
1404
1850
|
return structuredClone(definition.material ?? {});
|
|
1405
1851
|
}
|
|
1406
|
-
restoreColliderDefinitions() {
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
const
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1852
|
+
restoreColliderDefinitions(first = 0, end = this.count) {
|
|
1853
|
+
for (let body = first; body < end; body++) {
|
|
1854
|
+
const definition = this.props.bodies[body];
|
|
1855
|
+
const colliders = definition.colliders ?? (definition.shape ? [{ shape: definition.shape }] : []);
|
|
1856
|
+
for (const [index, source] of colliders.entries()) {
|
|
1857
|
+
const collider = this.colliders[this.bodyColliderStarts[body] + index];
|
|
1858
|
+
collider.shape = source.shape;
|
|
1859
|
+
collider.material = source.material;
|
|
1860
|
+
collider.position = source.position;
|
|
1861
|
+
collider.orientation = source.orientation;
|
|
1862
|
+
}
|
|
1414
1863
|
}
|
|
1415
1864
|
}
|
|
1416
1865
|
/** Update motion properties between submissions; preserve the node pose when its COM changes. */
|
|
@@ -1437,9 +1886,12 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1437
1886
|
(0, import_rigid_body_joints.validateRigidBodyJoints)(this.props.joints, proposedBodies, this.solver);
|
|
1438
1887
|
}
|
|
1439
1888
|
const colliders = this.colliders.filter((collider) => collider.body === bodyIndex);
|
|
1440
|
-
for (const collider of colliders)
|
|
1889
|
+
for (const collider of colliders) {
|
|
1890
|
+
if (collider.shape.type === "height-field" && mode !== "static")
|
|
1891
|
+
throw new Error("Height fields require static bodies");
|
|
1441
1892
|
if ((collider.shape.type === "convex-hull" || collider.shape.type === "triangle-mesh") && mode !== "static" && mass > 0 && (!collider.shape.geometry.closed || !((0, import_rigid_body_shape_properties.getRigidBodyShapeProperties)(collider.shape).volume > 0)))
|
|
1442
1893
|
throw new Error("Dynamic meshes require closed positive-volume geometry");
|
|
1894
|
+
}
|
|
1443
1895
|
if (((_b = this.props.continuous) == null ? void 0 : _b.bodies.includes(bodyIndex)) && (mode !== "dynamic" || mass === 0 || this.props.continuous.mode !== "convex" && (colliders[0].position ?? [0, 0, 0]).some((value, axis) => value !== center[axis])))
|
|
1444
1896
|
throw new Error("Mutation exceeds the continuous body envelope");
|
|
1445
1897
|
const compound = (0, import_rigid_body_properties.getCompoundBodyInertia)(mass, colliders, center);
|
|
@@ -1719,6 +2171,7 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1719
2171
|
}
|
|
1720
2172
|
/** Reusable same-world GPU checkpoint; copies state without CPU pose or buffer readback. */
|
|
1721
2173
|
createGPUCheckpoint(options = {}) {
|
|
2174
|
+
var _a;
|
|
1722
2175
|
if (!this.device || this.destroyed)
|
|
1723
2176
|
throw new Error("Checkpoint requires an attached world");
|
|
1724
2177
|
const device = this.device;
|
|
@@ -1731,6 +2184,8 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1731
2184
|
let bodyDefinitions = structuredClone(this.props.bodies);
|
|
1732
2185
|
let contactCursor = 0;
|
|
1733
2186
|
let triggerCursor = 0;
|
|
2187
|
+
let terrainRevision = this.terrainRevision;
|
|
2188
|
+
let terrainAtlas = (_a = this.terrainAtlas) == null ? void 0 : _a.snapshot();
|
|
1734
2189
|
try {
|
|
1735
2190
|
for (const buffer of checkpointBuffers)
|
|
1736
2191
|
snapshots.push(device.createBuffer({
|
|
@@ -1760,6 +2215,7 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1760
2215
|
const checkpoint = {
|
|
1761
2216
|
byteLength: snapshots.reduce((sum, buffer) => sum + buffer.byteLength, 0),
|
|
1762
2217
|
save: () => {
|
|
2218
|
+
var _a2;
|
|
1763
2219
|
copy(false);
|
|
1764
2220
|
origin = [...this.worldOrigin];
|
|
1765
2221
|
joints = structuredClone(this.props.joints);
|
|
@@ -1768,6 +2224,8 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1768
2224
|
publicationBounds = structuredClone(this.props.publicationBounds);
|
|
1769
2225
|
contactCursor = this.eventCursor;
|
|
1770
2226
|
triggerCursor = this.triggerCursor;
|
|
2227
|
+
terrainRevision = this.terrainRevision;
|
|
2228
|
+
terrainAtlas = (_a2 = this.terrainAtlas) == null ? void 0 : _a2.snapshot();
|
|
1771
2229
|
saved = true;
|
|
1772
2230
|
},
|
|
1773
2231
|
restore: () => {
|
|
@@ -1782,6 +2240,9 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1782
2240
|
this.props.publicationBounds = structuredClone(publicationBounds);
|
|
1783
2241
|
this.eventCursor = contactCursor;
|
|
1784
2242
|
this.triggerCursor = triggerCursor;
|
|
2243
|
+
this.terrainRevision = terrainRevision;
|
|
2244
|
+
if (terrainAtlas)
|
|
2245
|
+
this.terrainAtlas.restore(terrainAtlas.leases, (_word, _words, page) => terrainAtlas.payloads.get(page));
|
|
1785
2246
|
},
|
|
1786
2247
|
destroy: () => {
|
|
1787
2248
|
if (released)
|
|
@@ -1797,6 +2258,7 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1797
2258
|
}
|
|
1798
2259
|
/** Stop graph submissions and controls first; includes diagnostics, caches and event history. */
|
|
1799
2260
|
async captureState(options = {}) {
|
|
2261
|
+
var _a;
|
|
1800
2262
|
if (!this.device || this.destroyed || this.queryPending || this.eventRead || this.triggerRead)
|
|
1801
2263
|
throw new Error("Capture requires an idle attached world");
|
|
1802
2264
|
return {
|
|
@@ -1807,6 +2269,8 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1807
2269
|
colliderShapeScales: structuredClone([...this.colliderShapeScales]),
|
|
1808
2270
|
contactCursor: this.eventCursor,
|
|
1809
2271
|
triggerCursor: this.triggerCursor,
|
|
2272
|
+
terrainRevision: this.terrainRevision,
|
|
2273
|
+
terrainAtlasLeases: (_a = this.terrainAtlas) == null ? void 0 : _a.getLeases(),
|
|
1810
2274
|
buffers: await Promise.all(this.getSnapshotBuffers(options.includeRollbackScratch).map(async (buffer) => ({
|
|
1811
2275
|
name: buffer.id.slice(this.id.length + 1),
|
|
1812
2276
|
data: new Uint8Array(await buffer.readAsync())
|
|
@@ -1816,7 +2280,8 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1816
2280
|
/** Restore between submissions on the same configuration and implementation; no implicit wake. */
|
|
1817
2281
|
restoreState(capture) {
|
|
1818
2282
|
const checkpointBuffers = this.getSnapshotBuffers(capture.includeRollbackScratch);
|
|
1819
|
-
|
|
2283
|
+
const terrainRevision = capture.terrainRevision ?? 1;
|
|
2284
|
+
if (!this.device || this.destroyed || this.queryPending || this.eventRead || this.triggerRead || capture.version !== 1 || Boolean(capture.terrainAtlasLeases) !== Boolean(this.terrainAtlas) || !Number.isInteger(terrainRevision) || terrainRevision < 1 || terrainRevision > 16777215 || capture.origin !== void 0 && (capture.origin.length !== 3 || !capture.origin.every(Number.isFinite)) || capture.buffers.length !== checkpointBuffers.length || serializeCaptureProps(capture.props) !== serializeCaptureProps(this.props) || ![capture.contactCursor, capture.triggerCursor].every((value) => Number.isInteger(value) && value >= 0 && value <= 4294967295))
|
|
1820
2285
|
throw new Error("Incompatible rigid-body capture");
|
|
1821
2286
|
const shapeScales = new Map(capture.colliderShapeScales ?? []);
|
|
1822
2287
|
for (const [index, scale] of shapeScales) {
|
|
@@ -1829,6 +2294,26 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1829
2294
|
if (saved.name !== buffer.id.slice(this.id.length + 1) || !(saved.data instanceof Uint8Array) || saved.data.byteLength !== buffer.byteLength)
|
|
1830
2295
|
throw new Error("Incompatible rigid-body capture storage");
|
|
1831
2296
|
}
|
|
2297
|
+
if (this.terrainAtlas && capture.terrainAtlasLeases) {
|
|
2298
|
+
const metadata = capture.buffers.find((buffer) => buffer.name === "bodies").data;
|
|
2299
|
+
const view = new DataView(metadata.buffer, metadata.byteOffset, metadata.byteLength);
|
|
2300
|
+
const colliderBase = this.count * 48;
|
|
2301
|
+
let active = 0;
|
|
2302
|
+
for (const collider of this.ensembleTerrainSlots)
|
|
2303
|
+
if (view.getFloat32(colliderBase + collider * 96 + 76, true) > 0)
|
|
2304
|
+
active++;
|
|
2305
|
+
if (active !== capture.terrainAtlasLeases.length)
|
|
2306
|
+
throw new Error("Incomplete captured terrain atlas leases");
|
|
2307
|
+
this.terrainAtlas.restore(capture.terrainAtlasLeases, (word, words) => {
|
|
2308
|
+
const first = (this.terrainAtlasWord + word) * 4;
|
|
2309
|
+
return new Float32Array(metadata.slice(first, first + words * 4).buffer);
|
|
2310
|
+
}, (collider, word) => {
|
|
2311
|
+
const base = colliderBase + collider * 96;
|
|
2312
|
+
const address = (this.terrainAtlasWord - this.terrainGeometryWord + word) / 4;
|
|
2313
|
+
if (view.getFloat32(base + 76, true) <= 0 || view.getFloat32(base + 80, true) !== address)
|
|
2314
|
+
throw new Error("Captured terrain collider has an invalid page address");
|
|
2315
|
+
});
|
|
2316
|
+
}
|
|
1832
2317
|
for (const [index, buffer] of checkpointBuffers.entries())
|
|
1833
2318
|
buffer.write(capture.buffers[index].data);
|
|
1834
2319
|
this.props.joints = structuredClone(capture.props.joints);
|
|
@@ -1839,6 +2324,7 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1839
2324
|
this.worldOrigin = [...capture.origin ?? [0, 0, 0]];
|
|
1840
2325
|
this.eventCursor = capture.contactCursor;
|
|
1841
2326
|
this.triggerCursor = capture.triggerCursor;
|
|
2327
|
+
this.terrainRevision = terrainRevision;
|
|
1842
2328
|
}
|
|
1843
2329
|
/** Stop submissions first. Reconstruct with these accepted poses and larger budgets after rollback. */
|
|
1844
2330
|
async getRecoveryProps(overrides = {}) {
|
|
@@ -1928,7 +2414,7 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1928
2414
|
}
|
|
1929
2415
|
/** Destroy the compiled graph and finish readbacks before destroying its world. */
|
|
1930
2416
|
destroy() {
|
|
1931
|
-
var _a, _b, _c, _d, _e;
|
|
2417
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1932
2418
|
if (this.destroyed)
|
|
1933
2419
|
return;
|
|
1934
2420
|
(_a = this.ensembleReset) == null ? void 0 : _a.destroy();
|
|
@@ -1937,8 +2423,9 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
|
|
|
1937
2423
|
this.destroyed = true;
|
|
1938
2424
|
(_b = this.control) == null ? void 0 : _b.kernel.destroy();
|
|
1939
2425
|
(_c = this.invalidation) == null ? void 0 : _c.kernel.destroy();
|
|
1940
|
-
(_d = this.
|
|
1941
|
-
(_e = this.
|
|
2426
|
+
(_d = this.terrainWake) == null ? void 0 : _d.kernel.destroy();
|
|
2427
|
+
(_e = this.queryComputation) == null ? void 0 : _e.kernel.destroy();
|
|
2428
|
+
(_f = this.queryReduction) == null ? void 0 : _f.kernel.destroy();
|
|
1942
2429
|
for (const buffer of this.ownedBuffers)
|
|
1943
2430
|
buffer.destroy();
|
|
1944
2431
|
this.ownedBuffers.length = 0;
|
|
@@ -1954,10 +2441,14 @@ function serializeCaptureProps(props) {
|
|
|
1954
2441
|
...body,
|
|
1955
2442
|
shape: void 0,
|
|
1956
2443
|
colliders: (body.colliders ?? [{ shape: body.shape }]).map((collider) => {
|
|
1957
|
-
var _a2, _b, _c;
|
|
2444
|
+
var _a2, _b, _c, _d;
|
|
1958
2445
|
return {
|
|
1959
2446
|
...collider,
|
|
1960
|
-
shape: ((_a2 = collider.shape) == null ? void 0 : _a2.type) === "convex-hull" || ((_b = collider.shape) == null ? void 0 : _b.type) === "triangle-mesh" ? collider.shape :
|
|
2447
|
+
shape: ((_a2 = collider.shape) == null ? void 0 : _a2.type) === "convex-hull" || ((_b = collider.shape) == null ? void 0 : _b.type) === "triangle-mesh" ? collider.shape : ((_c = collider.shape) == null ? void 0 : _c.type) === "height-field" ? {
|
|
2448
|
+
type: collider.shape.type,
|
|
2449
|
+
width: collider.shape.field.width,
|
|
2450
|
+
height: collider.shape.field.height
|
|
2451
|
+
} : { type: (_d = collider.shape) == null ? void 0 : _d.type },
|
|
1961
2452
|
material: void 0,
|
|
1962
2453
|
position: void 0,
|
|
1963
2454
|
orientation: void 0
|