@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
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var rigid_body_height_field_exports = {};
|
|
19
|
+
__export(rigid_body_height_field_exports, {
|
|
20
|
+
getRigidBodyHeightFieldPageWords: () => getRigidBodyHeightFieldPageWords,
|
|
21
|
+
makeRigidBodyHeightField: () => makeRigidBodyHeightField,
|
|
22
|
+
packRigidBodyHeightField: () => packRigidBodyHeightField
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(rigid_body_height_field_exports);
|
|
25
|
+
function makeRigidBodyHeightField(source, colliderOrigin) {
|
|
26
|
+
const samples = source.copyData();
|
|
27
|
+
const registrationOffset = source.registration === "cell" ? 0.5 : 0;
|
|
28
|
+
return {
|
|
29
|
+
width: source.width,
|
|
30
|
+
height: source.height,
|
|
31
|
+
origin: [
|
|
32
|
+
source.origin[0] - colliderOrigin[0] + registrationOffset * (source.columnStep[0] + source.rowStep[0]),
|
|
33
|
+
source.origin[1] - colliderOrigin[1] + registrationOffset * (source.columnStep[1] + source.rowStep[1])
|
|
34
|
+
],
|
|
35
|
+
columnStep: [...source.columnStep],
|
|
36
|
+
rowStep: [...source.rowStep],
|
|
37
|
+
diagonal: source.diagonal,
|
|
38
|
+
heights: Float64Array.from(samples.heights, (height) => height - colliderOrigin[2]),
|
|
39
|
+
validity: samples.validity
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const MISSING_HEIGHT = Math.fround(3402823e32);
|
|
43
|
+
const CELLS_PER_LEAF = 8;
|
|
44
|
+
function getRigidBodyHeightFieldPageWords(width, height) {
|
|
45
|
+
const sampleCount = width * height;
|
|
46
|
+
if (!Number.isSafeInteger(width) || !Number.isSafeInteger(height) || width < 2 || height < 2 || sampleCount > 1e6)
|
|
47
|
+
throw new Error("Invalid height-field grid");
|
|
48
|
+
const memo = /* @__PURE__ */ new Map();
|
|
49
|
+
const countLeaves = (columns) => {
|
|
50
|
+
if (columns <= CELLS_PER_LEAF)
|
|
51
|
+
return 1;
|
|
52
|
+
const cached = memo.get(columns);
|
|
53
|
+
if (cached !== void 0)
|
|
54
|
+
return cached;
|
|
55
|
+
const half = Math.floor(columns / 2);
|
|
56
|
+
const leaves2 = countLeaves(half) + countLeaves(columns - half);
|
|
57
|
+
memo.set(columns, leaves2);
|
|
58
|
+
return leaves2;
|
|
59
|
+
};
|
|
60
|
+
const leaves = countLeaves(width - 1) * (height - 1);
|
|
61
|
+
return 8 + Math.ceil(sampleCount / 4) * 4 + (2 * leaves - 1) * 12;
|
|
62
|
+
}
|
|
63
|
+
function packRigidBodyHeightField(field) {
|
|
64
|
+
const { width, height, heights, validity, diagonal = "00-11" } = field;
|
|
65
|
+
const sampleCount = width * height;
|
|
66
|
+
if (!Number.isSafeInteger(width) || !Number.isSafeInteger(height) || width < 2 || height < 2 || sampleCount > 1e6 || heights && heights.length !== sampleCount || validity && validity.length !== sampleCount || diagonal !== "00-11" && diagonal !== "10-01")
|
|
67
|
+
throw new Error("Invalid height-field grid");
|
|
68
|
+
const origin = (field.origin ?? [0, 0]).map(Math.fround);
|
|
69
|
+
const columnStep = (field.columnStep ?? [1, 0]).map(Math.fround);
|
|
70
|
+
const rowStep = (field.rowStep ?? [0, 1]).map(Math.fround);
|
|
71
|
+
const determinant = columnStep[0] * rowStep[1] - columnStep[1] * rowStep[0];
|
|
72
|
+
const horizontalScale = [0, 1].map((axis) => Math.abs(origin[axis]) + Math.abs(columnStep[axis]) * (width - 1) + Math.abs(rowStep[axis]) * (height - 1));
|
|
73
|
+
if (origin.length !== 2 || columnStep.length !== 2 || rowStep.length !== 2 || ![...origin, ...columnStep, ...rowStep, ...horizontalScale].every((value) => Number.isFinite(Math.fround(value))) || Math.abs(determinant) <= 1e-7 * Math.hypot(...columnStep) * Math.hypot(...rowStep))
|
|
74
|
+
throw new Error("Invalid height-field transform");
|
|
75
|
+
const roundingPadding = horizontalScale.map((value) => value * 2 ** -21);
|
|
76
|
+
const nodeOffset = 2 + Math.ceil(sampleCount / 4);
|
|
77
|
+
const data = new Array(nodeOffset * 4).fill(MISSING_HEIGHT);
|
|
78
|
+
data.splice(0, 8, ...columnStep, ...rowStep, ...origin, width, Number(diagonal === "10-01") + 2 * Number(determinant < 0));
|
|
79
|
+
for (let index = 0; heights && index < sampleCount; index++) {
|
|
80
|
+
if ((validity == null ? void 0 : validity[index]) === 0 || !Number.isFinite(heights[index]))
|
|
81
|
+
continue;
|
|
82
|
+
const sample = Math.fround(heights[index]);
|
|
83
|
+
if (!Number.isFinite(sample) || sample === MISSING_HEIGHT)
|
|
84
|
+
throw new Error("Height-field sample exceeds float32 range");
|
|
85
|
+
data[8 + index] = sample;
|
|
86
|
+
}
|
|
87
|
+
const appendNode = (firstColumn, firstRow, columns, rows) => {
|
|
88
|
+
const offset = data.length;
|
|
89
|
+
data.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
90
|
+
let minimumHeight = Infinity;
|
|
91
|
+
let maximumHeight = -Infinity;
|
|
92
|
+
if (rows === 1 && columns <= CELLS_PER_LEAF) {
|
|
93
|
+
const firstSample = firstRow * width + firstColumn;
|
|
94
|
+
for (let column = 0; column < columns; column++) {
|
|
95
|
+
const sample = 8 + firstSample + column;
|
|
96
|
+
const first = data[sample];
|
|
97
|
+
const second = data[sample + 1];
|
|
98
|
+
const third = data[sample + width];
|
|
99
|
+
const fourth = data[sample + width + 1];
|
|
100
|
+
const triangles = diagonal === "00-11" ? [first, second, fourth, first, fourth, third] : [first, second, third, second, fourth, third];
|
|
101
|
+
for (let triangle = 0; triangle < 6; triangle += 3) {
|
|
102
|
+
const cornerA = triangles[triangle];
|
|
103
|
+
const cornerB = triangles[triangle + 1];
|
|
104
|
+
const cornerC = triangles[triangle + 2];
|
|
105
|
+
if (cornerA === MISSING_HEIGHT || cornerB === MISSING_HEIGHT || cornerC === MISSING_HEIGHT)
|
|
106
|
+
continue;
|
|
107
|
+
minimumHeight = Math.min(minimumHeight, cornerA, cornerB, cornerC);
|
|
108
|
+
maximumHeight = Math.max(maximumHeight, cornerA, cornerB, cornerC);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
data[offset + 7] = minimumHeight <= maximumHeight ? columns * 2 : 0;
|
|
112
|
+
data[offset + 8] = 2 * (firstRow * (width - 1) + firstColumn);
|
|
113
|
+
} else {
|
|
114
|
+
let firstChild;
|
|
115
|
+
let secondChild;
|
|
116
|
+
if (columns > CELLS_PER_LEAF && (rows === 1 || columns >= rows * CELLS_PER_LEAF)) {
|
|
117
|
+
const split = Math.floor(columns / 2);
|
|
118
|
+
firstChild = appendNode(firstColumn, firstRow, split, rows);
|
|
119
|
+
secondChild = appendNode(firstColumn + split, firstRow, columns - split, rows);
|
|
120
|
+
} else {
|
|
121
|
+
const split = Math.floor(rows / 2);
|
|
122
|
+
firstChild = appendNode(firstColumn, firstRow, columns, split);
|
|
123
|
+
secondChild = appendNode(firstColumn, firstRow + split, columns, rows - split);
|
|
124
|
+
}
|
|
125
|
+
minimumHeight = Math.min(data[firstChild + 2], data[secondChild + 2]);
|
|
126
|
+
maximumHeight = Math.max(data[firstChild + 6], data[secondChild + 6]);
|
|
127
|
+
}
|
|
128
|
+
if (minimumHeight <= maximumHeight) {
|
|
129
|
+
for (let axis = 0; axis < 2; axis++) {
|
|
130
|
+
const first = origin[axis] + firstColumn * columnStep[axis] + firstRow * rowStep[axis];
|
|
131
|
+
const column = columns * columnStep[axis];
|
|
132
|
+
const row = rows * rowStep[axis];
|
|
133
|
+
data[offset + axis] = first + Math.min(0, column) + Math.min(0, row) - roundingPadding[axis];
|
|
134
|
+
data[offset + 4 + axis] = first + Math.max(0, column) + Math.max(0, row) + roundingPadding[axis];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
data[offset + 2] = minimumHeight;
|
|
138
|
+
data[offset + 6] = maximumHeight;
|
|
139
|
+
data[offset + 3] = (data.length - nodeOffset * 4) / 12;
|
|
140
|
+
return offset;
|
|
141
|
+
};
|
|
142
|
+
const root = appendNode(0, 0, width - 1, height - 1);
|
|
143
|
+
const active = data[root + 2] <= data[root + 6];
|
|
144
|
+
for (let offset = root; offset < data.length; offset += 12) {
|
|
145
|
+
if (data[offset + 2] > data[offset + 6]) {
|
|
146
|
+
data[offset + 2] = 1;
|
|
147
|
+
data[offset + 6] = -1;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const extent = active ? [0, 1, 2].map((axis) => Math.max(Math.abs(data[root + axis]), Math.abs(data[root + 4 + axis]))) : [0, 0, 0];
|
|
151
|
+
if (!extent.every((value) => Number.isFinite(Math.fround(value))))
|
|
152
|
+
throw new Error("Height-field bounds exceed float32 range");
|
|
153
|
+
return {
|
|
154
|
+
data,
|
|
155
|
+
extent,
|
|
156
|
+
nodeOffset,
|
|
157
|
+
nodeCount: active ? (data.length - root) / 12 : 0,
|
|
158
|
+
triangleCount: active ? (width - 1) * (height - 1) * 2 : 0
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
162
|
+
0 && (module.exports = {
|
|
163
|
+
getRigidBodyHeightFieldPageWords,
|
|
164
|
+
makeRigidBodyHeightField,
|
|
165
|
+
packRigidBodyHeightField
|
|
166
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { RigidBodyVector } from "./rigid-body-properties.js";
|
|
2
|
+
/** Grid in the collider's local Z-up frame, with row-major scalar heights. */
|
|
3
|
+
export type GPURigidBodyHeightField = {
|
|
4
|
+
/** Number of columns, including both ends of the tile. */
|
|
5
|
+
width: number;
|
|
6
|
+
/** Number of rows, including both ends of the tile. */
|
|
7
|
+
height: number;
|
|
8
|
+
/** First sample in local XY, after any cell-registration shift. */
|
|
9
|
+
origin?: readonly [number, number];
|
|
10
|
+
/** Metric column basis vector. Defaults to a unit step along X. */
|
|
11
|
+
columnStep?: readonly [number, number];
|
|
12
|
+
/** Metric row basis vector. Defaults to a unit step along Y. */
|
|
13
|
+
rowStep?: readonly [number, number];
|
|
14
|
+
/** The diagonal connecting opposite samples in each cell. */
|
|
15
|
+
diagonal?: '00-11' | '10-01';
|
|
16
|
+
/** Missing heights allocate a vacant slot. Nonfinite or masked samples omit their triangles. */
|
|
17
|
+
heights?: Float32Array | Float64Array;
|
|
18
|
+
/** Optional row-major mask with zero for an absent sample. */
|
|
19
|
+
validity?: Uint8Array;
|
|
20
|
+
};
|
|
21
|
+
/** Structural subset of math.gl HeightField needed to create a collider without a terrain dependency. */
|
|
22
|
+
export type GPURigidBodyHeightFieldSource = {
|
|
23
|
+
/** Source column count. */
|
|
24
|
+
readonly width: number;
|
|
25
|
+
/** Source row count. */
|
|
26
|
+
readonly height: number;
|
|
27
|
+
/** Metric source origin before applying sample registration. */
|
|
28
|
+
readonly origin: readonly [number, number];
|
|
29
|
+
/** Metric column basis vector. */
|
|
30
|
+
readonly columnStep: readonly [number, number];
|
|
31
|
+
/** Metric row basis vector. */
|
|
32
|
+
readonly rowStep: readonly [number, number];
|
|
33
|
+
/** Placement of the first sample relative to the source origin. */
|
|
34
|
+
readonly registration: 'vertex' | 'cell';
|
|
35
|
+
/** Authored triangle diagonal used for each cell. */
|
|
36
|
+
readonly diagonal: '00-11' | '10-01';
|
|
37
|
+
/** Return detached row-major data and validity. */
|
|
38
|
+
copyData(): {
|
|
39
|
+
heights: Float32Array | Float64Array;
|
|
40
|
+
validity: Uint8Array;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/** Detach math.gl samples and express them relative to the supplied collider origin. */
|
|
44
|
+
export declare function makeRigidBodyHeightField(source: GPURigidBodyHeightFieldSource, colliderOrigin: RigidBodyVector): GPURigidBodyHeightField;
|
|
45
|
+
/** Exact fixed payload size, independent of height values and missing-data masks. */
|
|
46
|
+
export declare function getRigidBodyHeightFieldPageWords(width: number, height: number): number;
|
|
47
|
+
/** Pack scalar samples and a bounded stackless hierarchy, with no stored vertices or triangle indices. */
|
|
48
|
+
export declare function packRigidBodyHeightField(field: GPURigidBodyHeightField): {
|
|
49
|
+
data: number[];
|
|
50
|
+
extent: number[];
|
|
51
|
+
nodeOffset: number;
|
|
52
|
+
nodeCount: number;
|
|
53
|
+
triangleCount: number;
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=rigid-body-height-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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AQ,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;IACrC,mDAAmD;IACnD,QAAQ,IAAI;QAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAAC;QAAC,QAAQ,EAAE,UAAU,CAAA;KAAC,CAAC;CAC1E,CAAC;AAEF,wFAAwF;AACxF,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,6BAA6B,EACrC,cAAc,EAAE,eAAe,GAC9B,uBAAuB,CAoBzB;AAOD,qFAAqF;AACrF,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAyBtF;AAED,0GAA0G;AAC1G,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,uBAAuB;;;;;;EAsJtE"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/** Detach math.gl samples and express them relative to the supplied collider origin. */
|
|
5
|
+
export function makeRigidBodyHeightField(source, colliderOrigin) {
|
|
6
|
+
const samples = source.copyData();
|
|
7
|
+
const registrationOffset = source.registration === 'cell' ? 0.5 : 0;
|
|
8
|
+
return {
|
|
9
|
+
width: source.width,
|
|
10
|
+
height: source.height,
|
|
11
|
+
origin: [
|
|
12
|
+
source.origin[0] -
|
|
13
|
+
colliderOrigin[0] +
|
|
14
|
+
registrationOffset * (source.columnStep[0] + source.rowStep[0]),
|
|
15
|
+
source.origin[1] -
|
|
16
|
+
colliderOrigin[1] +
|
|
17
|
+
registrationOffset * (source.columnStep[1] + source.rowStep[1])
|
|
18
|
+
],
|
|
19
|
+
columnStep: [...source.columnStep],
|
|
20
|
+
rowStep: [...source.rowStep],
|
|
21
|
+
diagonal: source.diagonal,
|
|
22
|
+
heights: Float64Array.from(samples.heights, height => height - colliderOrigin[2]),
|
|
23
|
+
validity: samples.validity
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** One reserved f32 value marks a missing height in the GPU data. */
|
|
27
|
+
const MISSING_HEIGHT = Math.fround(3.402823e38);
|
|
28
|
+
/** Leaves cover a contiguous range from a single row of at most eight cells. */
|
|
29
|
+
const CELLS_PER_LEAF = 8;
|
|
30
|
+
/** Exact fixed payload size, independent of height values and missing-data masks. */
|
|
31
|
+
export function getRigidBodyHeightFieldPageWords(width, height) {
|
|
32
|
+
const sampleCount = width * height;
|
|
33
|
+
if (!Number.isSafeInteger(width) ||
|
|
34
|
+
!Number.isSafeInteger(height) ||
|
|
35
|
+
width < 2 ||
|
|
36
|
+
height < 2 ||
|
|
37
|
+
sampleCount > 1_000_000)
|
|
38
|
+
throw new Error('Invalid height-field grid');
|
|
39
|
+
// Every row eventually uses the same bisection of its columns. Interleaving the
|
|
40
|
+
// row splits changes traversal order, but the full binary tree has 2 * leaves - 1 nodes.
|
|
41
|
+
const memo = new Map();
|
|
42
|
+
/** Count single-row leaves after the same column bisection used by the packer. */
|
|
43
|
+
const countLeaves = (columns) => {
|
|
44
|
+
if (columns <= CELLS_PER_LEAF)
|
|
45
|
+
return 1;
|
|
46
|
+
const cached = memo.get(columns);
|
|
47
|
+
if (cached !== undefined)
|
|
48
|
+
return cached;
|
|
49
|
+
const half = Math.floor(columns / 2);
|
|
50
|
+
const leaves = countLeaves(half) + countLeaves(columns - half);
|
|
51
|
+
memo.set(columns, leaves);
|
|
52
|
+
return leaves;
|
|
53
|
+
};
|
|
54
|
+
const leaves = countLeaves(width - 1) * (height - 1);
|
|
55
|
+
return 8 + Math.ceil(sampleCount / 4) * 4 + (2 * leaves - 1) * 12;
|
|
56
|
+
}
|
|
57
|
+
/** Pack scalar samples and a bounded stackless hierarchy, with no stored vertices or triangle indices. */
|
|
58
|
+
export function packRigidBodyHeightField(field) {
|
|
59
|
+
const { width, height, heights, validity, diagonal = '00-11' } = field;
|
|
60
|
+
const sampleCount = width * height;
|
|
61
|
+
if (!Number.isSafeInteger(width) ||
|
|
62
|
+
!Number.isSafeInteger(height) ||
|
|
63
|
+
width < 2 ||
|
|
64
|
+
height < 2 ||
|
|
65
|
+
sampleCount > 1_000_000 ||
|
|
66
|
+
(heights && heights.length !== sampleCount) ||
|
|
67
|
+
(validity && validity.length !== sampleCount) ||
|
|
68
|
+
(diagonal !== '00-11' && diagonal !== '10-01'))
|
|
69
|
+
throw new Error('Invalid height-field grid');
|
|
70
|
+
const origin = (field.origin ?? [0, 0]).map(Math.fround);
|
|
71
|
+
const columnStep = (field.columnStep ?? [1, 0]).map(Math.fround);
|
|
72
|
+
const rowStep = (field.rowStep ?? [0, 1]).map(Math.fround);
|
|
73
|
+
const determinant = columnStep[0] * rowStep[1] - columnStep[1] * rowStep[0];
|
|
74
|
+
const horizontalScale = [0, 1].map(axis => Math.abs(origin[axis]) +
|
|
75
|
+
Math.abs(columnStep[axis]) * (width - 1) +
|
|
76
|
+
Math.abs(rowStep[axis]) * (height - 1));
|
|
77
|
+
if (origin.length !== 2 ||
|
|
78
|
+
columnStep.length !== 2 ||
|
|
79
|
+
rowStep.length !== 2 ||
|
|
80
|
+
![...origin, ...columnStep, ...rowStep, ...horizontalScale].every(value => Number.isFinite(Math.fround(value))) ||
|
|
81
|
+
Math.abs(determinant) <= 1e-7 * Math.hypot(...columnStep) * Math.hypot(...rowStep))
|
|
82
|
+
throw new Error('Invalid height-field transform');
|
|
83
|
+
// Match shader arithmetic at the sample positions, padding conservative XY bounds
|
|
84
|
+
// for separate rounding of the index products and sum.
|
|
85
|
+
const roundingPadding = horizontalScale.map(value => value * 2 ** -21);
|
|
86
|
+
const nodeOffset = 2 + Math.ceil(sampleCount / 4);
|
|
87
|
+
const data = new Array(nodeOffset * 4).fill(MISSING_HEIGHT);
|
|
88
|
+
data.splice(0, 8, ...columnStep, ...rowStep, ...origin, width, Number(diagonal === '10-01') + 2 * Number(determinant < 0));
|
|
89
|
+
for (let index = 0; heights && index < sampleCount; index++) {
|
|
90
|
+
if (validity?.[index] === 0 || !Number.isFinite(heights[index]))
|
|
91
|
+
continue;
|
|
92
|
+
const sample = Math.fround(heights[index]);
|
|
93
|
+
if (!Number.isFinite(sample) || sample === MISSING_HEIGHT)
|
|
94
|
+
throw new Error('Height-field sample exceeds float32 range');
|
|
95
|
+
data[8 + index] = sample;
|
|
96
|
+
}
|
|
97
|
+
/** Build deterministic rectangular nodes even for an empty or partially loaded slot. */
|
|
98
|
+
const appendNode = (firstColumn, firstRow, columns, rows) => {
|
|
99
|
+
const offset = data.length;
|
|
100
|
+
data.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
101
|
+
let minimumHeight = Infinity;
|
|
102
|
+
let maximumHeight = -Infinity;
|
|
103
|
+
if (rows === 1 && columns <= CELLS_PER_LEAF) {
|
|
104
|
+
const firstSample = firstRow * width + firstColumn;
|
|
105
|
+
for (let column = 0; column < columns; column++) {
|
|
106
|
+
const sample = 8 + firstSample + column;
|
|
107
|
+
const first = data[sample];
|
|
108
|
+
const second = data[sample + 1];
|
|
109
|
+
const third = data[sample + width];
|
|
110
|
+
const fourth = data[sample + width + 1];
|
|
111
|
+
const triangles = diagonal === '00-11'
|
|
112
|
+
? [first, second, fourth, first, fourth, third]
|
|
113
|
+
: [first, second, third, second, fourth, third];
|
|
114
|
+
for (let triangle = 0; triangle < 6; triangle += 3) {
|
|
115
|
+
const cornerA = triangles[triangle];
|
|
116
|
+
const cornerB = triangles[triangle + 1];
|
|
117
|
+
const cornerC = triangles[triangle + 2];
|
|
118
|
+
if (cornerA === MISSING_HEIGHT ||
|
|
119
|
+
cornerB === MISSING_HEIGHT ||
|
|
120
|
+
cornerC === MISSING_HEIGHT)
|
|
121
|
+
continue;
|
|
122
|
+
minimumHeight = Math.min(minimumHeight, cornerA, cornerB, cornerC);
|
|
123
|
+
maximumHeight = Math.max(maximumHeight, cornerA, cornerB, cornerC);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
data[offset + 7] = minimumHeight <= maximumHeight ? columns * 2 : 0;
|
|
127
|
+
data[offset + 8] = 2 * (firstRow * (width - 1) + firstColumn);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
let firstChild;
|
|
131
|
+
let secondChild;
|
|
132
|
+
if (columns > CELLS_PER_LEAF && (rows === 1 || columns >= rows * CELLS_PER_LEAF)) {
|
|
133
|
+
const split = Math.floor(columns / 2);
|
|
134
|
+
firstChild = appendNode(firstColumn, firstRow, split, rows);
|
|
135
|
+
secondChild = appendNode(firstColumn + split, firstRow, columns - split, rows);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
const split = Math.floor(rows / 2);
|
|
139
|
+
firstChild = appendNode(firstColumn, firstRow, columns, split);
|
|
140
|
+
secondChild = appendNode(firstColumn, firstRow + split, columns, rows - split);
|
|
141
|
+
}
|
|
142
|
+
minimumHeight = Math.min(data[firstChild + 2], data[secondChild + 2]);
|
|
143
|
+
maximumHeight = Math.max(data[firstChild + 6], data[secondChild + 6]);
|
|
144
|
+
}
|
|
145
|
+
if (minimumHeight <= maximumHeight) {
|
|
146
|
+
for (let axis = 0; axis < 2; axis++) {
|
|
147
|
+
const first = origin[axis] + firstColumn * columnStep[axis] + firstRow * rowStep[axis];
|
|
148
|
+
const column = columns * columnStep[axis];
|
|
149
|
+
const row = rows * rowStep[axis];
|
|
150
|
+
data[offset + axis] =
|
|
151
|
+
first + Math.min(0, column) + Math.min(0, row) - roundingPadding[axis];
|
|
152
|
+
data[offset + 4 + axis] =
|
|
153
|
+
first + Math.max(0, column) + Math.max(0, row) + roundingPadding[axis];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
data[offset + 2] = minimumHeight;
|
|
157
|
+
data[offset + 6] = maximumHeight;
|
|
158
|
+
data[offset + 3] = (data.length - nodeOffset * 4) / 12;
|
|
159
|
+
return offset;
|
|
160
|
+
};
|
|
161
|
+
const root = appendNode(0, 0, width - 1, height - 1);
|
|
162
|
+
const active = data[root + 2] <= data[root + 6];
|
|
163
|
+
// Empty hierarchy branches have reversed finite bounds. Readers skip them without
|
|
164
|
+
// evaluating a cast against invalid limits. The allocation stays identical on reload.
|
|
165
|
+
for (let offset = root; offset < data.length; offset += 12) {
|
|
166
|
+
if (data[offset + 2] > data[offset + 6]) {
|
|
167
|
+
data[offset + 2] = 1;
|
|
168
|
+
data[offset + 6] = -1;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const extent = active
|
|
172
|
+
? [0, 1, 2].map(axis => Math.max(Math.abs(data[root + axis]), Math.abs(data[root + 4 + axis])))
|
|
173
|
+
: [0, 0, 0];
|
|
174
|
+
if (!extent.every(value => Number.isFinite(Math.fround(value))))
|
|
175
|
+
throw new Error('Height-field bounds exceed float32 range');
|
|
176
|
+
return {
|
|
177
|
+
data,
|
|
178
|
+
extent,
|
|
179
|
+
nodeOffset,
|
|
180
|
+
nodeCount: active ? (data.length - root) / 12 : 0,
|
|
181
|
+
triangleCount: active ? (width - 1) * (height - 1) * 2 : 0
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=rigid-body-height-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rigid-body-height-field.js","sourceRoot":"","sources":["../../src/gpu-physics/rigid-body-height-field.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AA4C5D,wFAAwF;AACxF,MAAM,UAAU,wBAAwB,CACtC,MAAqC,EACrC,cAA+B;IAE/B,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClC,MAAM,kBAAkB,GAAG,MAAM,CAAC,YAAY,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE;YACN,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;gBACd,cAAc,CAA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+outerNode*3u);
|
|
65
65
|
let maximum=readGeometry(outerOffset+outerNode*3u+1u);
|
|
66
|
-
if(any(maximum.xyz<outerLower)||any(minimum.xyz>outerUpper)){outerNode=u32(minimum.w);continue;}
|
|
66
|
+
if(any(minimum.xyz>maximum.xyz)||any(maximum.xyz<outerLower)||any(minimum.xyz>outerUpper)){outerNode=u32(minimum.w);continue;}
|
|
67
67
|
if(maximum.w>0.0){
|
|
68
68
|
let start=u32(readGeometry(outerOffset+outerNode*3u+2u).x);
|
|
69
69
|
for(var offset=0u;offset<u32(maximum.w);offset++){
|
|
70
70
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
71
71
|
let outerTriangle=start+offset;
|
|
72
|
+
if(!meshTriangleActive(outerMesh,outerTriangle)){continue;}
|
|
72
73
|
var lower=vec3f(3.402823e38);var upper=vec3f(-3.402823e38);
|
|
73
74
|
for(var corner=0u;corner<3u;corner++){
|
|
74
75
|
let worldPoint=colliderPosition(outerMesh)+rotate(colliderRotation(outerMesh),triangleVertex(outerMesh,outerTriangle,corner));
|
|
@@ -82,12 +83,13 @@ fn queueMeshPairContacts(pair:u32,first:u32,second:u32,previous:Manifold){
|
|
|
82
83
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
83
84
|
let queryMinimum=readGeometry(queryOffset+queryNode*3u);
|
|
84
85
|
let queryMaximum=readGeometry(queryOffset+queryNode*3u+1u);
|
|
85
|
-
if(any(queryMaximum.xyz<lower)||any(queryMinimum.xyz>upper)){queryNode=u32(queryMinimum.w);continue;}
|
|
86
|
+
if(any(queryMinimum.xyz>queryMaximum.xyz)||any(queryMaximum.xyz<lower)||any(queryMinimum.xyz>upper)){queryNode=u32(queryMinimum.w);continue;}
|
|
86
87
|
if(queryMaximum.w>0.0){
|
|
87
88
|
let queryStart=u32(readGeometry(queryOffset+queryNode*3u+2u).x);
|
|
88
89
|
for(var queryIndex=0u;queryIndex<u32(queryMaximum.w);queryIndex++){
|
|
89
90
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
90
91
|
let queryTriangle=queryStart+queryIndex;
|
|
92
|
+
if(!meshTriangleActive(queryMesh,queryTriangle)){continue;}
|
|
91
93
|
let firstPoint=triangleVertex(queryMesh,queryTriangle,0u);
|
|
92
94
|
let secondPoint=triangleVertex(queryMesh,queryTriangle,1u);
|
|
93
95
|
let thirdPoint=triangleVertex(queryMesh,queryTriangle,2u);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Bounded triangle-pair discovery over cooked, stackless mesh hierarchies. */
|
|
2
|
-
export declare const RIGID_BODY_MESH_QUERY_SHADER = "\nfn addMeshCounter(counter:ptr<storage,atomic<u32>,read_write>,increment:u32)->u32 {\n var previous=atomicLoad(counter);\n loop {\n let replacement=previous+min(increment,0xffffffffu-previous);\n let exchanged=atomicCompareExchangeWeak(counter,previous,replacement);\n if(exchanged.exchanged){return previous;}\n previous=exchanged.old_value;\n }\n}\nfn reserveMeshTasks(requested:u32)->vec2u {\n let reserved=addMeshCounter(&meshTasks.count,requested);\n let start=min(reserved,MESH_TASK_CAPACITY);\n let retained=min(requested,MESH_TASK_CAPACITY-start);\n atomicMax(&targets.dispatch,(start+retained+31u)/32u);\n if(retained<requested){addMeshCounter(&meshTasks.overflow,requested-retained);}\n return vec2u(start,retained);\n}\nfn queueMeshPairContacts(pair:u32,first:u32,second:u32,previous:Manifold){\n // Traverse the smaller mesh outside; every candidate still retains both original IDs.\n let outerMesh=select(first,second,bodies.colliders[first].padding.w>bodies.colliders[second].padding.w);\n let queryMesh=select(first,second,outerMesh==first);\n let outerOffset=u32(bodies.colliders[outerMesh].policies.z);\n let outerCount=u32(bodies.colliders[outerMesh].policies.w);\n let queryOffset=u32(bodies.colliders[queryMesh].policies.z);\n let queryCount=u32(bodies.colliders[queryMesh].policies.w);\n let queryCenter=colliderLocal(outerMesh,colliderPosition(queryMesh)-colliderPosition(outerMesh));\n let queryExtent=shapeWorldExtent(queryMesh);\n var outerExtent=vec3f(0);\n for(var coordinate=0u;coordinate<3u;coordinate++){\n outerExtent[coordinate]=dot(abs(axis(outerMesh,coordinate)),queryExtent)+settings.solver.x;\n }\n let outerLower=queryCenter-outerExtent;let outerUpper=queryCenter+outerExtent;\n var candidates=0u;var written=0u;var reservation=vec2u(0);\n for(var traversal=0u;traversal<2u;traversal++){\n var work=0u;var exhausted=false;var outerNode=0u;\n loop {\n if(outerNode>=outerCount){break;}\n if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;\n let minimum=readGeometry(outerOffset+outerNode*3u);\n let maximum=readGeometry(outerOffset+outerNode*3u+1u);\n if(any(maximum.xyz<outerLower)||any(minimum.xyz>outerUpper)){outerNode=u32(minimum.w);continue;}\n if(maximum.w>0.0){\n let start=u32(readGeometry(outerOffset+outerNode*3u+2u).x);\n for(var offset=0u;offset<u32(maximum.w);offset++){\n if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;\n let outerTriangle=start+offset;\n var lower=vec3f(3.402823e38);var upper=vec3f(-3.402823e38);\n for(var corner=0u;corner<3u;corner++){\n let worldPoint=colliderPosition(outerMesh)+rotate(colliderRotation(outerMesh),triangleVertex(outerMesh,outerTriangle,corner));\n let point=colliderLocal(queryMesh,worldPoint-colliderPosition(queryMesh));\n lower=min(lower,point);upper=max(upper,point);\n }\n lower-=vec3f(settings.solver.x);upper+=vec3f(settings.solver.x);\n var queryNode=0u;\n loop {\n if(queryNode>=queryCount){break;}\n if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;\n let queryMinimum=readGeometry(queryOffset+queryNode*3u);\n let queryMaximum=readGeometry(queryOffset+queryNode*3u+1u);\n if(any(queryMaximum.xyz<lower)||any(queryMinimum.xyz>upper)){queryNode=u32(queryMinimum.w);continue;}\n if(queryMaximum.w>0.0){\n let queryStart=u32(readGeometry(queryOffset+queryNode*3u+2u).x);\n for(var queryIndex=0u;queryIndex<u32(queryMaximum.w);queryIndex++){\n if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;\n let queryTriangle=queryStart+queryIndex;\n let firstPoint=triangleVertex(queryMesh,queryTriangle,0u);\n let secondPoint=triangleVertex(queryMesh,queryTriangle,1u);\n let thirdPoint=triangleVertex(queryMesh,queryTriangle,2u);\n if(any(max(firstPoint,max(secondPoint,thirdPoint))<lower)||any(min(firstPoint,min(secondPoint,thirdPoint))>upper)){continue;}\n if(traversal==0u){candidates++;}\n else if(written<reservation.y){\n meshTasks.entries[reservation.x+written].key=vec4u(first,second,\n select(queryTriangle,outerTriangle,outerMesh==first),select(outerTriangle,queryTriangle,outerMesh==first));\n written++;\n }\n }\n }\n if(exhausted){break;}queryNode++;\n }\n if(exhausted){break;}\n }\n }\n if(exhausted){break;}outerNode++;\n }\n if(traversal==0u){\n if(exhausted){addMeshCounter(&meshTasks.incomplete,1u);}\n reservation=reserveMeshTasks(candidates);\n }\n }\n manifolds[pair].padding=vec3u(previous.count,reservation.x,reservation.y);\n}\n";
|
|
2
|
+
export declare const RIGID_BODY_MESH_QUERY_SHADER = "\nfn addMeshCounter(counter:ptr<storage,atomic<u32>,read_write>,increment:u32)->u32 {\n var previous=atomicLoad(counter);\n loop {\n let replacement=previous+min(increment,0xffffffffu-previous);\n let exchanged=atomicCompareExchangeWeak(counter,previous,replacement);\n if(exchanged.exchanged){return previous;}\n previous=exchanged.old_value;\n }\n}\nfn reserveMeshTasks(requested:u32)->vec2u {\n let reserved=addMeshCounter(&meshTasks.count,requested);\n let start=min(reserved,MESH_TASK_CAPACITY);\n let retained=min(requested,MESH_TASK_CAPACITY-start);\n atomicMax(&targets.dispatch,(start+retained+31u)/32u);\n if(retained<requested){addMeshCounter(&meshTasks.overflow,requested-retained);}\n return vec2u(start,retained);\n}\nfn queueMeshPairContacts(pair:u32,first:u32,second:u32,previous:Manifold){\n // Traverse the smaller mesh outside; every candidate still retains both original IDs.\n let outerMesh=select(first,second,bodies.colliders[first].padding.w>bodies.colliders[second].padding.w);\n let queryMesh=select(first,second,outerMesh==first);\n let outerOffset=u32(bodies.colliders[outerMesh].policies.z);\n let outerCount=u32(bodies.colliders[outerMesh].policies.w);\n let queryOffset=u32(bodies.colliders[queryMesh].policies.z);\n let queryCount=u32(bodies.colliders[queryMesh].policies.w);\n let queryCenter=colliderLocal(outerMesh,colliderPosition(queryMesh)-colliderPosition(outerMesh));\n let queryExtent=shapeWorldExtent(queryMesh);\n var outerExtent=vec3f(0);\n for(var coordinate=0u;coordinate<3u;coordinate++){\n outerExtent[coordinate]=dot(abs(axis(outerMesh,coordinate)),queryExtent)+settings.solver.x;\n }\n let outerLower=queryCenter-outerExtent;let outerUpper=queryCenter+outerExtent;\n var candidates=0u;var written=0u;var reservation=vec2u(0);\n for(var traversal=0u;traversal<2u;traversal++){\n var work=0u;var exhausted=false;var outerNode=0u;\n loop {\n if(outerNode>=outerCount){break;}\n if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;\n let minimum=readGeometry(outerOffset+outerNode*3u);\n let maximum=readGeometry(outerOffset+outerNode*3u+1u);\n if(any(minimum.xyz>maximum.xyz)||any(maximum.xyz<outerLower)||any(minimum.xyz>outerUpper)){outerNode=u32(minimum.w);continue;}\n if(maximum.w>0.0){\n let start=u32(readGeometry(outerOffset+outerNode*3u+2u).x);\n for(var offset=0u;offset<u32(maximum.w);offset++){\n if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;\n let outerTriangle=start+offset;\n if(!meshTriangleActive(outerMesh,outerTriangle)){continue;}\n var lower=vec3f(3.402823e38);var upper=vec3f(-3.402823e38);\n for(var corner=0u;corner<3u;corner++){\n let worldPoint=colliderPosition(outerMesh)+rotate(colliderRotation(outerMesh),triangleVertex(outerMesh,outerTriangle,corner));\n let point=colliderLocal(queryMesh,worldPoint-colliderPosition(queryMesh));\n lower=min(lower,point);upper=max(upper,point);\n }\n lower-=vec3f(settings.solver.x);upper+=vec3f(settings.solver.x);\n var queryNode=0u;\n loop {\n if(queryNode>=queryCount){break;}\n if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;\n let queryMinimum=readGeometry(queryOffset+queryNode*3u);\n let queryMaximum=readGeometry(queryOffset+queryNode*3u+1u);\n if(any(queryMinimum.xyz>queryMaximum.xyz)||any(queryMaximum.xyz<lower)||any(queryMinimum.xyz>upper)){queryNode=u32(queryMinimum.w);continue;}\n if(queryMaximum.w>0.0){\n let queryStart=u32(readGeometry(queryOffset+queryNode*3u+2u).x);\n for(var queryIndex=0u;queryIndex<u32(queryMaximum.w);queryIndex++){\n if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;\n let queryTriangle=queryStart+queryIndex;\n if(!meshTriangleActive(queryMesh,queryTriangle)){continue;}\n let firstPoint=triangleVertex(queryMesh,queryTriangle,0u);\n let secondPoint=triangleVertex(queryMesh,queryTriangle,1u);\n let thirdPoint=triangleVertex(queryMesh,queryTriangle,2u);\n if(any(max(firstPoint,max(secondPoint,thirdPoint))<lower)||any(min(firstPoint,min(secondPoint,thirdPoint))>upper)){continue;}\n if(traversal==0u){candidates++;}\n else if(written<reservation.y){\n meshTasks.entries[reservation.x+written].key=vec4u(first,second,\n select(queryTriangle,outerTriangle,outerMesh==first),select(outerTriangle,queryTriangle,outerMesh==first));\n written++;\n }\n }\n }\n if(exhausted){break;}queryNode++;\n }\n if(exhausted){break;}\n }\n }\n if(exhausted){break;}outerNode++;\n }\n if(traversal==0u){\n if(exhausted){addMeshCounter(&meshTasks.incomplete,1u);}\n reservation=reserveMeshTasks(candidates);\n }\n }\n manifolds[pair].padding=vec3u(previous.count,reservation.x,reservation.y);\n}\n";
|
|
3
3
|
//# sourceMappingURL=rigid-body-mesh-query-shaders.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rigid-body-mesh-query-shaders.d.ts","sourceRoot":"","sources":["../../src/gpu-physics/rigid-body-mesh-query-shaders.ts"],"names":[],"mappings":"AAIA,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"rigid-body-mesh-query-shaders.d.ts","sourceRoot":"","sources":["../../src/gpu-physics/rigid-body-mesh-query-shaders.ts"],"names":[],"mappings":"AAIA,+EAA+E;AAC/E,eAAO,MAAM,4BAA4B,0uJA8FxC,CAAC"}
|
|
@@ -43,12 +43,13 @@ fn queueMeshPairContacts(pair:u32,first:u32,second:u32,previous:Manifold){
|
|
|
43
43
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
44
44
|
let minimum=readGeometry(outerOffset+outerNode*3u);
|
|
45
45
|
let maximum=readGeometry(outerOffset+outerNode*3u+1u);
|
|
46
|
-
if(any(maximum.xyz<outerLower)||any(minimum.xyz>outerUpper)){outerNode=u32(minimum.w);continue;}
|
|
46
|
+
if(any(minimum.xyz>maximum.xyz)||any(maximum.xyz<outerLower)||any(minimum.xyz>outerUpper)){outerNode=u32(minimum.w);continue;}
|
|
47
47
|
if(maximum.w>0.0){
|
|
48
48
|
let start=u32(readGeometry(outerOffset+outerNode*3u+2u).x);
|
|
49
49
|
for(var offset=0u;offset<u32(maximum.w);offset++){
|
|
50
50
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
51
51
|
let outerTriangle=start+offset;
|
|
52
|
+
if(!meshTriangleActive(outerMesh,outerTriangle)){continue;}
|
|
52
53
|
var lower=vec3f(3.402823e38);var upper=vec3f(-3.402823e38);
|
|
53
54
|
for(var corner=0u;corner<3u;corner++){
|
|
54
55
|
let worldPoint=colliderPosition(outerMesh)+rotate(colliderRotation(outerMesh),triangleVertex(outerMesh,outerTriangle,corner));
|
|
@@ -62,12 +63,13 @@ fn queueMeshPairContacts(pair:u32,first:u32,second:u32,previous:Manifold){
|
|
|
62
63
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
63
64
|
let queryMinimum=readGeometry(queryOffset+queryNode*3u);
|
|
64
65
|
let queryMaximum=readGeometry(queryOffset+queryNode*3u+1u);
|
|
65
|
-
if(any(queryMaximum.xyz<lower)||any(queryMinimum.xyz>upper)){queryNode=u32(queryMinimum.w);continue;}
|
|
66
|
+
if(any(queryMinimum.xyz>queryMaximum.xyz)||any(queryMaximum.xyz<lower)||any(queryMinimum.xyz>upper)){queryNode=u32(queryMinimum.w);continue;}
|
|
66
67
|
if(queryMaximum.w>0.0){
|
|
67
68
|
let queryStart=u32(readGeometry(queryOffset+queryNode*3u+2u).x);
|
|
68
69
|
for(var queryIndex=0u;queryIndex<u32(queryMaximum.w);queryIndex++){
|
|
69
70
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
70
71
|
let queryTriangle=queryStart+queryIndex;
|
|
72
|
+
if(!meshTriangleActive(queryMesh,queryTriangle)){continue;}
|
|
71
73
|
let firstPoint=triangleVertex(queryMesh,queryTriangle,0u);
|
|
72
74
|
let secondPoint=triangleVertex(queryMesh,queryTriangle,1u);
|
|
73
75
|
let thirdPoint=triangleVertex(queryMesh,queryTriangle,2u);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rigid-body-mesh-query-shaders.js","sourceRoot":"","sources":["../../src/gpu-physics/rigid-body-mesh-query-shaders.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"rigid-body-mesh-query-shaders.js","sourceRoot":"","sources":["../../src/gpu-physics/rigid-body-mesh-query-shaders.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FtD,CAAC"}
|