@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,257 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {RigidBodyVector} from './rigid-body-properties';
|
|
6
|
+
|
|
7
|
+
/** Grid in the collider's local Z-up frame, with row-major scalar heights. */
|
|
8
|
+
export type GPURigidBodyHeightField = {
|
|
9
|
+
/** Number of columns, including both ends of the tile. */
|
|
10
|
+
width: number;
|
|
11
|
+
/** Number of rows, including both ends of the tile. */
|
|
12
|
+
height: number;
|
|
13
|
+
/** First sample in local XY, after any cell-registration shift. */
|
|
14
|
+
origin?: readonly [number, number];
|
|
15
|
+
/** Metric column basis vector. Defaults to a unit step along X. */
|
|
16
|
+
columnStep?: readonly [number, number];
|
|
17
|
+
/** Metric row basis vector. Defaults to a unit step along Y. */
|
|
18
|
+
rowStep?: readonly [number, number];
|
|
19
|
+
/** The diagonal connecting opposite samples in each cell. */
|
|
20
|
+
diagonal?: '00-11' | '10-01';
|
|
21
|
+
/** Missing heights allocate a vacant slot. Nonfinite or masked samples omit their triangles. */
|
|
22
|
+
heights?: Float32Array | Float64Array;
|
|
23
|
+
/** Optional row-major mask with zero for an absent sample. */
|
|
24
|
+
validity?: Uint8Array;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** Structural subset of math.gl HeightField needed to create a collider without a terrain dependency. */
|
|
28
|
+
export type GPURigidBodyHeightFieldSource = {
|
|
29
|
+
/** Source column count. */
|
|
30
|
+
readonly width: number;
|
|
31
|
+
/** Source row count. */
|
|
32
|
+
readonly height: number;
|
|
33
|
+
/** Metric source origin before applying sample registration. */
|
|
34
|
+
readonly origin: readonly [number, number];
|
|
35
|
+
/** Metric column basis vector. */
|
|
36
|
+
readonly columnStep: readonly [number, number];
|
|
37
|
+
/** Metric row basis vector. */
|
|
38
|
+
readonly rowStep: readonly [number, number];
|
|
39
|
+
/** Placement of the first sample relative to the source origin. */
|
|
40
|
+
readonly registration: 'vertex' | 'cell';
|
|
41
|
+
/** Authored triangle diagonal used for each cell. */
|
|
42
|
+
readonly diagonal: '00-11' | '10-01';
|
|
43
|
+
/** Return detached row-major data and validity. */
|
|
44
|
+
copyData(): {heights: Float32Array | Float64Array; validity: Uint8Array};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** Detach math.gl samples and express them relative to the supplied collider origin. */
|
|
48
|
+
export function makeRigidBodyHeightField(
|
|
49
|
+
source: GPURigidBodyHeightFieldSource,
|
|
50
|
+
colliderOrigin: RigidBodyVector
|
|
51
|
+
): GPURigidBodyHeightField {
|
|
52
|
+
const samples = source.copyData();
|
|
53
|
+
const registrationOffset = source.registration === 'cell' ? 0.5 : 0;
|
|
54
|
+
return {
|
|
55
|
+
width: source.width,
|
|
56
|
+
height: source.height,
|
|
57
|
+
origin: [
|
|
58
|
+
source.origin[0] -
|
|
59
|
+
colliderOrigin[0] +
|
|
60
|
+
registrationOffset * (source.columnStep[0] + source.rowStep[0]),
|
|
61
|
+
source.origin[1] -
|
|
62
|
+
colliderOrigin[1] +
|
|
63
|
+
registrationOffset * (source.columnStep[1] + source.rowStep[1])
|
|
64
|
+
],
|
|
65
|
+
columnStep: [...source.columnStep],
|
|
66
|
+
rowStep: [...source.rowStep],
|
|
67
|
+
diagonal: source.diagonal,
|
|
68
|
+
heights: Float64Array.from(samples.heights, height => height - colliderOrigin[2]),
|
|
69
|
+
validity: samples.validity
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** One reserved f32 value marks a missing height in the GPU data. */
|
|
74
|
+
const MISSING_HEIGHT = Math.fround(3.402823e38);
|
|
75
|
+
/** Leaves cover a contiguous range from a single row of at most eight cells. */
|
|
76
|
+
const CELLS_PER_LEAF = 8;
|
|
77
|
+
|
|
78
|
+
/** Exact fixed payload size, independent of height values and missing-data masks. */
|
|
79
|
+
export function getRigidBodyHeightFieldPageWords(width: number, height: number): number {
|
|
80
|
+
const sampleCount = width * height;
|
|
81
|
+
if (
|
|
82
|
+
!Number.isSafeInteger(width) ||
|
|
83
|
+
!Number.isSafeInteger(height) ||
|
|
84
|
+
width < 2 ||
|
|
85
|
+
height < 2 ||
|
|
86
|
+
sampleCount > 1_000_000
|
|
87
|
+
)
|
|
88
|
+
throw new Error('Invalid height-field grid');
|
|
89
|
+
// Every row eventually uses the same bisection of its columns. Interleaving the
|
|
90
|
+
// row splits changes traversal order, but the full binary tree has 2 * leaves - 1 nodes.
|
|
91
|
+
const memo = new Map<number, number>();
|
|
92
|
+
/** Count single-row leaves after the same column bisection used by the packer. */
|
|
93
|
+
const countLeaves = (columns: number): number => {
|
|
94
|
+
if (columns <= CELLS_PER_LEAF) return 1;
|
|
95
|
+
const cached = memo.get(columns);
|
|
96
|
+
if (cached !== undefined) return cached;
|
|
97
|
+
const half = Math.floor(columns / 2);
|
|
98
|
+
const leaves = countLeaves(half) + countLeaves(columns - half);
|
|
99
|
+
memo.set(columns, leaves);
|
|
100
|
+
return leaves;
|
|
101
|
+
};
|
|
102
|
+
const leaves = countLeaves(width - 1) * (height - 1);
|
|
103
|
+
return 8 + Math.ceil(sampleCount / 4) * 4 + (2 * leaves - 1) * 12;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Pack scalar samples and a bounded stackless hierarchy, with no stored vertices or triangle indices. */
|
|
107
|
+
export function packRigidBodyHeightField(field: GPURigidBodyHeightField) {
|
|
108
|
+
const {width, height, heights, validity, diagonal = '00-11'} = field;
|
|
109
|
+
const sampleCount = width * height;
|
|
110
|
+
if (
|
|
111
|
+
!Number.isSafeInteger(width) ||
|
|
112
|
+
!Number.isSafeInteger(height) ||
|
|
113
|
+
width < 2 ||
|
|
114
|
+
height < 2 ||
|
|
115
|
+
sampleCount > 1_000_000 ||
|
|
116
|
+
(heights && heights.length !== sampleCount) ||
|
|
117
|
+
(validity && validity.length !== sampleCount) ||
|
|
118
|
+
(diagonal !== '00-11' && diagonal !== '10-01')
|
|
119
|
+
)
|
|
120
|
+
throw new Error('Invalid height-field grid');
|
|
121
|
+
|
|
122
|
+
const origin = (field.origin ?? [0, 0]).map(Math.fround);
|
|
123
|
+
const columnStep = (field.columnStep ?? [1, 0]).map(Math.fround);
|
|
124
|
+
const rowStep = (field.rowStep ?? [0, 1]).map(Math.fround);
|
|
125
|
+
const determinant = columnStep[0] * rowStep[1] - columnStep[1] * rowStep[0];
|
|
126
|
+
const horizontalScale = [0, 1].map(
|
|
127
|
+
axis =>
|
|
128
|
+
Math.abs(origin[axis]) +
|
|
129
|
+
Math.abs(columnStep[axis]) * (width - 1) +
|
|
130
|
+
Math.abs(rowStep[axis]) * (height - 1)
|
|
131
|
+
);
|
|
132
|
+
if (
|
|
133
|
+
origin.length !== 2 ||
|
|
134
|
+
columnStep.length !== 2 ||
|
|
135
|
+
rowStep.length !== 2 ||
|
|
136
|
+
![...origin, ...columnStep, ...rowStep, ...horizontalScale].every(value =>
|
|
137
|
+
Number.isFinite(Math.fround(value))
|
|
138
|
+
) ||
|
|
139
|
+
Math.abs(determinant) <= 1e-7 * Math.hypot(...columnStep) * Math.hypot(...rowStep)
|
|
140
|
+
)
|
|
141
|
+
throw new Error('Invalid height-field transform');
|
|
142
|
+
|
|
143
|
+
// Match shader arithmetic at the sample positions, padding conservative XY bounds
|
|
144
|
+
// for separate rounding of the index products and sum.
|
|
145
|
+
const roundingPadding = horizontalScale.map(value => value * 2 ** -21);
|
|
146
|
+
const nodeOffset = 2 + Math.ceil(sampleCount / 4);
|
|
147
|
+
const data = new Array<number>(nodeOffset * 4).fill(MISSING_HEIGHT);
|
|
148
|
+
data.splice(
|
|
149
|
+
0,
|
|
150
|
+
8,
|
|
151
|
+
...columnStep,
|
|
152
|
+
...rowStep,
|
|
153
|
+
...origin,
|
|
154
|
+
width,
|
|
155
|
+
Number(diagonal === '10-01') + 2 * Number(determinant < 0)
|
|
156
|
+
);
|
|
157
|
+
for (let index = 0; heights && index < sampleCount; index++) {
|
|
158
|
+
if (validity?.[index] === 0 || !Number.isFinite(heights[index])) continue;
|
|
159
|
+
const sample = Math.fround(heights[index]);
|
|
160
|
+
if (!Number.isFinite(sample) || sample === MISSING_HEIGHT)
|
|
161
|
+
throw new Error('Height-field sample exceeds float32 range');
|
|
162
|
+
data[8 + index] = sample;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** Build deterministic rectangular nodes even for an empty or partially loaded slot. */
|
|
166
|
+
const appendNode = (
|
|
167
|
+
firstColumn: number,
|
|
168
|
+
firstRow: number,
|
|
169
|
+
columns: number,
|
|
170
|
+
rows: number
|
|
171
|
+
): number => {
|
|
172
|
+
const offset = data.length;
|
|
173
|
+
data.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
174
|
+
let minimumHeight = Infinity;
|
|
175
|
+
let maximumHeight = -Infinity;
|
|
176
|
+
if (rows === 1 && columns <= CELLS_PER_LEAF) {
|
|
177
|
+
const firstSample = firstRow * width + firstColumn;
|
|
178
|
+
for (let column = 0; column < columns; column++) {
|
|
179
|
+
const sample = 8 + firstSample + column;
|
|
180
|
+
const first = data[sample];
|
|
181
|
+
const second = data[sample + 1];
|
|
182
|
+
const third = data[sample + width];
|
|
183
|
+
const fourth = data[sample + width + 1];
|
|
184
|
+
const triangles =
|
|
185
|
+
diagonal === '00-11'
|
|
186
|
+
? [first, second, fourth, first, fourth, third]
|
|
187
|
+
: [first, second, third, second, fourth, third];
|
|
188
|
+
for (let triangle = 0; triangle < 6; triangle += 3) {
|
|
189
|
+
const cornerA = triangles[triangle];
|
|
190
|
+
const cornerB = triangles[triangle + 1];
|
|
191
|
+
const cornerC = triangles[triangle + 2];
|
|
192
|
+
if (
|
|
193
|
+
cornerA === MISSING_HEIGHT ||
|
|
194
|
+
cornerB === MISSING_HEIGHT ||
|
|
195
|
+
cornerC === MISSING_HEIGHT
|
|
196
|
+
)
|
|
197
|
+
continue;
|
|
198
|
+
minimumHeight = Math.min(minimumHeight, cornerA, cornerB, cornerC);
|
|
199
|
+
maximumHeight = Math.max(maximumHeight, cornerA, cornerB, cornerC);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
data[offset + 7] = minimumHeight <= maximumHeight ? columns * 2 : 0;
|
|
203
|
+
data[offset + 8] = 2 * (firstRow * (width - 1) + firstColumn);
|
|
204
|
+
} else {
|
|
205
|
+
let firstChild: number;
|
|
206
|
+
let secondChild: number;
|
|
207
|
+
if (columns > CELLS_PER_LEAF && (rows === 1 || columns >= rows * CELLS_PER_LEAF)) {
|
|
208
|
+
const split = Math.floor(columns / 2);
|
|
209
|
+
firstChild = appendNode(firstColumn, firstRow, split, rows);
|
|
210
|
+
secondChild = appendNode(firstColumn + split, firstRow, columns - split, rows);
|
|
211
|
+
} else {
|
|
212
|
+
const split = Math.floor(rows / 2);
|
|
213
|
+
firstChild = appendNode(firstColumn, firstRow, columns, split);
|
|
214
|
+
secondChild = appendNode(firstColumn, firstRow + split, columns, rows - split);
|
|
215
|
+
}
|
|
216
|
+
minimumHeight = Math.min(data[firstChild + 2], data[secondChild + 2]);
|
|
217
|
+
maximumHeight = Math.max(data[firstChild + 6], data[secondChild + 6]);
|
|
218
|
+
}
|
|
219
|
+
if (minimumHeight <= maximumHeight) {
|
|
220
|
+
for (let axis = 0; axis < 2; axis++) {
|
|
221
|
+
const first = origin[axis] + firstColumn * columnStep[axis] + firstRow * rowStep[axis];
|
|
222
|
+
const column = columns * columnStep[axis];
|
|
223
|
+
const row = rows * rowStep[axis];
|
|
224
|
+
data[offset + axis] =
|
|
225
|
+
first + Math.min(0, column) + Math.min(0, row) - roundingPadding[axis];
|
|
226
|
+
data[offset + 4 + axis] =
|
|
227
|
+
first + Math.max(0, column) + Math.max(0, row) + roundingPadding[axis];
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
data[offset + 2] = minimumHeight;
|
|
231
|
+
data[offset + 6] = maximumHeight;
|
|
232
|
+
data[offset + 3] = (data.length - nodeOffset * 4) / 12;
|
|
233
|
+
return offset;
|
|
234
|
+
};
|
|
235
|
+
const root = appendNode(0, 0, width - 1, height - 1);
|
|
236
|
+
const active = data[root + 2] <= data[root + 6];
|
|
237
|
+
// Empty hierarchy branches have reversed finite bounds. Readers skip them without
|
|
238
|
+
// evaluating a cast against invalid limits. The allocation stays identical on reload.
|
|
239
|
+
for (let offset = root; offset < data.length; offset += 12) {
|
|
240
|
+
if (data[offset + 2] > data[offset + 6]) {
|
|
241
|
+
data[offset + 2] = 1;
|
|
242
|
+
data[offset + 6] = -1;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
const extent = active
|
|
246
|
+
? [0, 1, 2].map(axis => Math.max(Math.abs(data[root + axis]), Math.abs(data[root + 4 + axis])))
|
|
247
|
+
: [0, 0, 0];
|
|
248
|
+
if (!extent.every(value => Number.isFinite(Math.fround(value))))
|
|
249
|
+
throw new Error('Height-field bounds exceed float32 range');
|
|
250
|
+
return {
|
|
251
|
+
data,
|
|
252
|
+
extent,
|
|
253
|
+
nodeOffset,
|
|
254
|
+
nodeCount: active ? (data.length - root) / 12 : 0,
|
|
255
|
+
triangleCount: active ? (width - 1) * (height - 1) * 2 : 0
|
|
256
|
+
};
|
|
257
|
+
}
|
|
@@ -44,12 +44,13 @@ fn queueMeshPairContacts(pair:u32,first:u32,second:u32,previous:Manifold){
|
|
|
44
44
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
45
45
|
let minimum=readGeometry(outerOffset+outerNode*3u);
|
|
46
46
|
let maximum=readGeometry(outerOffset+outerNode*3u+1u);
|
|
47
|
-
if(any(maximum.xyz<outerLower)||any(minimum.xyz>outerUpper)){outerNode=u32(minimum.w);continue;}
|
|
47
|
+
if(any(minimum.xyz>maximum.xyz)||any(maximum.xyz<outerLower)||any(minimum.xyz>outerUpper)){outerNode=u32(minimum.w);continue;}
|
|
48
48
|
if(maximum.w>0.0){
|
|
49
49
|
let start=u32(readGeometry(outerOffset+outerNode*3u+2u).x);
|
|
50
50
|
for(var offset=0u;offset<u32(maximum.w);offset++){
|
|
51
51
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
52
52
|
let outerTriangle=start+offset;
|
|
53
|
+
if(!meshTriangleActive(outerMesh,outerTriangle)){continue;}
|
|
53
54
|
var lower=vec3f(3.402823e38);var upper=vec3f(-3.402823e38);
|
|
54
55
|
for(var corner=0u;corner<3u;corner++){
|
|
55
56
|
let worldPoint=colliderPosition(outerMesh)+rotate(colliderRotation(outerMesh),triangleVertex(outerMesh,outerTriangle,corner));
|
|
@@ -63,12 +64,13 @@ fn queueMeshPairContacts(pair:u32,first:u32,second:u32,previous:Manifold){
|
|
|
63
64
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
64
65
|
let queryMinimum=readGeometry(queryOffset+queryNode*3u);
|
|
65
66
|
let queryMaximum=readGeometry(queryOffset+queryNode*3u+1u);
|
|
66
|
-
if(any(queryMaximum.xyz<lower)||any(queryMinimum.xyz>upper)){queryNode=u32(queryMinimum.w);continue;}
|
|
67
|
+
if(any(queryMinimum.xyz>queryMaximum.xyz)||any(queryMaximum.xyz<lower)||any(queryMinimum.xyz>upper)){queryNode=u32(queryMinimum.w);continue;}
|
|
67
68
|
if(queryMaximum.w>0.0){
|
|
68
69
|
let queryStart=u32(readGeometry(queryOffset+queryNode*3u+2u).x);
|
|
69
70
|
for(var queryIndex=0u;queryIndex<u32(queryMaximum.w);queryIndex++){
|
|
70
71
|
if(work>=MESH_TRAVERSAL_BUDGET){exhausted=true;break;}work++;
|
|
71
72
|
let queryTriangle=queryStart+queryIndex;
|
|
73
|
+
if(!meshTriangleActive(queryMesh,queryTriangle)){continue;}
|
|
72
74
|
let firstPoint=triangleVertex(queryMesh,queryTriangle,0u);
|
|
73
75
|
let secondPoint=triangleVertex(queryMesh,queryTriangle,1u);
|
|
74
76
|
let thirdPoint=triangleVertex(queryMesh,queryTriangle,2u);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import type {Geometry} from '@math.gl/geometry/primitives';
|
|
5
6
|
import {makeExactOrientation} from './rigid-body-orientation';
|
|
6
7
|
|
|
7
8
|
export type RigidBodyMeshGeometry = {
|
|
@@ -151,6 +152,31 @@ export function makeConvexHullGeometry(positions: ArrayLike<number>): RigidBodyM
|
|
|
151
152
|
export function makeTriangleMeshGeometry(
|
|
152
153
|
positions: ArrayLike<number>,
|
|
153
154
|
indices: ArrayLike<number>
|
|
155
|
+
): RigidBodyMeshGeometry {
|
|
156
|
+
return cookTriangleMeshGeometry(positions, indices, false);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Cook a CPU triangle surface, including a math.gl HeightFieldGeometry, for a static collider. */
|
|
160
|
+
export function makeStaticTriangleMeshGeometry(geometry: Geometry): RigidBodyMeshGeometry {
|
|
161
|
+
const position = geometry.attributes['POSITION'];
|
|
162
|
+
if (geometry.topology !== 'triangle-list' || position?.size !== 3)
|
|
163
|
+
throw new Error('Static surfaces require triangle-list POSITION geometry');
|
|
164
|
+
const sourceIndices = geometry.indices?.value;
|
|
165
|
+
if (
|
|
166
|
+
geometry.vertexCount > Math.min(sourceIndices?.length ?? position.value.length / 3, 3_000_000)
|
|
167
|
+
)
|
|
168
|
+
throw new Error('Invalid mesh vertex count');
|
|
169
|
+
const indices =
|
|
170
|
+
sourceIndices?.subarray(0, geometry.vertexCount) ??
|
|
171
|
+
Array.from({length: geometry.vertexCount}, (_, index) => index);
|
|
172
|
+
return cookTriangleMeshGeometry(position.value, indices, true);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** Build collision data from authored triangles, with optional mass properties for dynamic meshes. */
|
|
176
|
+
function cookTriangleMeshGeometry(
|
|
177
|
+
positions: ArrayLike<number>,
|
|
178
|
+
indices: ArrayLike<number>,
|
|
179
|
+
staticSurface: boolean
|
|
154
180
|
): RigidBodyMeshGeometry {
|
|
155
181
|
if (
|
|
156
182
|
!Number.isSafeInteger(positions.length) ||
|
|
@@ -163,25 +189,34 @@ export function makeTriangleMeshGeometry(
|
|
|
163
189
|
throw new Error('Incomplete mesh geometry');
|
|
164
190
|
if (positions.length > 3_000_000 || indices.length > 3_000_000)
|
|
165
191
|
throw new Error('Mesh geometry capacity exceeded');
|
|
166
|
-
const vertices = Array.from(positions, Math.fround);
|
|
167
192
|
const triangles = Array.from(indices);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
triangles.some(index => !Number.isInteger(index) || index < 0 || index >= vertices.length / 3)
|
|
171
|
-
)
|
|
193
|
+
const vertexCount = positions.length / 3;
|
|
194
|
+
if (triangles.some(index => !Number.isInteger(index) || index < 0 || index >= vertexCount))
|
|
172
195
|
throw new Error('Invalid mesh geometry');
|
|
196
|
+
const vertices = staticSurface
|
|
197
|
+
? compactSurfaceVertices(positions, triangles)
|
|
198
|
+
: Array.from(positions, Math.fround);
|
|
199
|
+
if (!vertices.every(Number.isFinite)) throw new Error('Invalid mesh geometry');
|
|
173
200
|
const point = (index: number): Point => [
|
|
174
201
|
vertices[index * 3],
|
|
175
202
|
vertices[index * 3 + 1],
|
|
176
203
|
vertices[index * 3 + 2]
|
|
177
204
|
];
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
);
|
|
205
|
+
// Cache each face's bounds and centroid key once. BVH sorting must not allocate per comparison.
|
|
206
|
+
const triangleCount = triangles.length / 3;
|
|
207
|
+
const triangleBounds = new Float32Array(triangleCount * 6);
|
|
208
|
+
const triangleCentroids = new Float64Array(triangleCount * 3);
|
|
209
|
+
for (let triangle = 0; triangle < triangleCount; triangle++) {
|
|
210
|
+
const first = point(triangles[triangle * 3]);
|
|
211
|
+
const second = point(triangles[triangle * 3 + 1]);
|
|
212
|
+
const third = point(triangles[triangle * 3 + 2]);
|
|
213
|
+
const normal = cross(subtract(second, first), subtract(third, first));
|
|
184
214
|
if (normal.every(value => value === 0)) throw new Error('Degenerate mesh triangle');
|
|
215
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
216
|
+
triangleBounds[triangle * 6 + axis] = Math.min(first[axis], second[axis], third[axis]);
|
|
217
|
+
triangleBounds[triangle * 6 + axis + 3] = Math.max(first[axis], second[axis], third[axis]);
|
|
218
|
+
triangleCentroids[triangle * 3 + axis] = first[axis] + second[axis] + third[axis];
|
|
219
|
+
}
|
|
185
220
|
}
|
|
186
221
|
const minimum: Point = [Infinity, Infinity, Infinity],
|
|
187
222
|
maximum: Point = [-Infinity, -Infinity, -Infinity];
|
|
@@ -198,36 +233,51 @@ export function makeTriangleMeshGeometry(
|
|
|
198
233
|
const lower: Point = [Infinity, Infinity, Infinity],
|
|
199
234
|
upper: Point = [-Infinity, -Infinity, -Infinity];
|
|
200
235
|
for (const triangle of faces)
|
|
201
|
-
for (let
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
lower[axis] = Math.min(lower[axis], vertex[axis]);
|
|
205
|
-
upper[axis] = Math.max(upper[axis], vertex[axis]);
|
|
206
|
-
}
|
|
236
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
237
|
+
lower[axis] = Math.min(lower[axis], triangleBounds[triangle * 6 + axis]);
|
|
238
|
+
upper[axis] = Math.max(upper[axis], triangleBounds[triangle * 6 + axis + 3]);
|
|
207
239
|
}
|
|
208
240
|
if (faces.length <= 4) {
|
|
209
241
|
nodes[offset + 7] = faces.length;
|
|
210
242
|
nodes[offset + 8] = ordered.length / 3;
|
|
211
243
|
for (const triangle of faces)
|
|
212
|
-
ordered.push(
|
|
244
|
+
ordered.push(
|
|
245
|
+
triangles[triangle * 3],
|
|
246
|
+
triangles[triangle * 3 + 1],
|
|
247
|
+
triangles[triangle * 3 + 2]
|
|
248
|
+
);
|
|
213
249
|
} else {
|
|
214
250
|
let axis = 0;
|
|
215
251
|
for (let candidate = 1; candidate < 3; candidate++)
|
|
216
252
|
if (upper[candidate] - lower[candidate] > upper[axis] - lower[axis]) axis = candidate;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
faces.sort((first, second) => centroid(first) - centroid(second));
|
|
253
|
+
faces.sort(
|
|
254
|
+
(first, second) =>
|
|
255
|
+
triangleCentroids[first * 3 + axis] - triangleCentroids[second * 3 + axis]
|
|
256
|
+
);
|
|
222
257
|
const middle = faces.length >> 1;
|
|
223
258
|
build(faces.slice(0, middle));
|
|
224
259
|
build(faces.slice(middle));
|
|
225
260
|
}
|
|
226
|
-
|
|
227
|
-
|
|
261
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
262
|
+
nodes[offset + axis] = lower[axis];
|
|
263
|
+
nodes[offset + 4 + axis] = upper[axis];
|
|
264
|
+
}
|
|
228
265
|
nodes[offset + 3] = nodes.length / 12;
|
|
229
266
|
};
|
|
230
|
-
build(Array.from({length:
|
|
267
|
+
build(Array.from({length: triangleCount}, (_, index) => index));
|
|
268
|
+
if (staticSurface) {
|
|
269
|
+
return {
|
|
270
|
+
positions: vertices,
|
|
271
|
+
indices: ordered,
|
|
272
|
+
minimum,
|
|
273
|
+
maximum,
|
|
274
|
+
nodes,
|
|
275
|
+
closed: false,
|
|
276
|
+
volume: 0,
|
|
277
|
+
center: [0, 0, 0],
|
|
278
|
+
tensor: Array<number>(9).fill(0)
|
|
279
|
+
};
|
|
280
|
+
}
|
|
231
281
|
// Weld by coordinates for topology checks: glTF often splits vertices at UV seams.
|
|
232
282
|
const vertexKeys = Array.from({length: vertices.length / 3}, (_, index) =>
|
|
233
283
|
point(index).join(',')
|
|
@@ -294,3 +344,24 @@ export function makeTriangleMeshGeometry(
|
|
|
294
344
|
tensor
|
|
295
345
|
};
|
|
296
346
|
}
|
|
347
|
+
|
|
348
|
+
/** Remap a detached index list and retain only vertices referenced by the surface. */
|
|
349
|
+
function compactSurfaceVertices(positions: ArrayLike<number>, triangles: number[]): number[] {
|
|
350
|
+
const remapped = new Int32Array(positions.length / 3);
|
|
351
|
+
remapped.fill(-1);
|
|
352
|
+
const vertices: number[] = [];
|
|
353
|
+
for (let index = 0; index < triangles.length; index++) {
|
|
354
|
+
const sourceVertex = triangles[index];
|
|
355
|
+
if (remapped[sourceVertex] < 0) {
|
|
356
|
+
remapped[sourceVertex] = vertices.length / 3;
|
|
357
|
+
const offset = sourceVertex * 3;
|
|
358
|
+
vertices.push(
|
|
359
|
+
Math.fround(positions[offset]),
|
|
360
|
+
Math.fround(positions[offset + 1]),
|
|
361
|
+
Math.fround(positions[offset + 2])
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
triangles[index] = remapped[sourceVertex];
|
|
365
|
+
}
|
|
366
|
+
return vertices;
|
|
367
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
/** Sparse contact adjacency and block-Jacobi impulses; each dispatch has exclusive output owners. */
|
|
6
|
-
export function getRigidBodyParallelShader(ensemble: boolean): string {
|
|
6
|
+
export function getRigidBodyParallelShader(ensemble: boolean, blockContacts = false): string {
|
|
7
7
|
return /* wgsl */ `
|
|
8
8
|
struct ParallelState {
|
|
9
9
|
diagnostics:array<atomic<u32>,4>,
|
|
@@ -173,32 +173,55 @@ fn writePairDeltas(pair:u32,first:u32,second:u32,impulse:vec3f,firstTorque:vec3f
|
|
|
173
173
|
let relaxation=settings.stability.w/f32(max(1u,max(atomicLoad(¶llelState.degrees[first]),atomicLoad(¶llelState.degrees[second]))));
|
|
174
174
|
var firstLinear=velocities[first].xyz;var secondLinear=velocities[second].xyz;
|
|
175
175
|
var firstAngular=angularVelocities[first].xyz;var secondAngular=angularVelocities[second].xyz;
|
|
176
|
+
${
|
|
177
|
+
blockContacts
|
|
178
|
+
? `
|
|
179
|
+
// Solve the contact patch locally, then relax the whole block once. No extra dispatches.
|
|
180
|
+
var contacts:array<Contact,4>;
|
|
181
|
+
for(var slot=0u;slot<manifolds[pair].count;slot++){contacts[slot]=manifolds[pair].contacts[slot];}
|
|
182
|
+
for(var sweep=0u;sweep<2u;sweep++){
|
|
183
|
+
`
|
|
184
|
+
: ''
|
|
185
|
+
}
|
|
176
186
|
for(var slot=0u;slot<manifolds[pair].count;slot++){
|
|
177
|
-
var contact
|
|
187
|
+
var contact=${blockContacts ? 'contacts[slot]' : 'manifolds[pair].contacts[slot]'};let point=contact.point.xyz;let normal=contact.normal.xyz;
|
|
178
188
|
let firstLever=point-positions[first].xyz;let secondLever=point-positions[second].xyz;
|
|
179
189
|
let relative=secondLinear+cross(secondAngular,secondLever)-firstLinear-cross(firstAngular,firstLever);
|
|
180
190
|
let normalMass=effectiveMass(first,second,point,normal);if(normalMass<=0.0){continue;}
|
|
181
191
|
let bias=min(settings.stability.z,settings.stability.y*max(0.0,contact.point.w-settings.solver.x)/settings.gravity.w);
|
|
182
192
|
let desiredImpulse=max(0.0,contact.impulse.x+(max(bias,contact.normal.w)-dot(relative,normal))/normalMass);
|
|
183
|
-
let change=(desiredImpulse-contact.impulse.x)
|
|
193
|
+
let change=(desiredImpulse-contact.impulse.x)*${blockContacts ? '1.0' : 'relaxation'};contact.impulse.x+=change;
|
|
184
194
|
var impulse=normal*change;
|
|
185
195
|
if(dynamic(first)){firstLinear-=impulse*velocities[first].w;firstAngular-=inverseInertia(first,cross(firstLever,impulse));}
|
|
186
196
|
if(dynamic(second)){secondLinear+=impulse*velocities[second].w;secondAngular+=inverseInertia(second,cross(secondLever,impulse));}
|
|
187
197
|
let after=secondLinear+cross(secondAngular,secondLever)-firstLinear-cross(firstAngular,firstLever);
|
|
188
198
|
let tangent=solveFriction(firstCollider,secondCollider,contact,after);
|
|
189
|
-
var relaxedTangent=contact.tangent.xyz+(tangent-contact.tangent.xyz)
|
|
199
|
+
var relaxedTangent=contact.tangent.xyz+(tangent-contact.tangent.xyz)*${blockContacts ? '1.0' : 'relaxation'};
|
|
190
200
|
// A falling normal impulse must shrink the cone even when under-relaxing.
|
|
191
201
|
let staticLimit=frictionCoefficient(firstCollider,secondCollider,false)*contact.impulse.x;
|
|
192
202
|
if(length(relaxedTangent)>staticLimit){relaxedTangent*=staticLimit/max(1e-30,length(relaxedTangent));}
|
|
193
203
|
impulse=relaxedTangent-contact.tangent.xyz;contact.tangent=vec4f(relaxedTangent,0);
|
|
194
204
|
if(dynamic(first)){firstLinear-=impulse*velocities[first].w;firstAngular-=inverseInertia(first,cross(firstLever,impulse));}
|
|
195
205
|
if(dynamic(second)){secondLinear+=impulse*velocities[second].w;secondAngular+=inverseInertia(second,cross(secondLever,impulse));}
|
|
196
|
-
manifolds[pair].contacts[slot]=contact;
|
|
206
|
+
${blockContacts ? 'contacts[slot]' : 'manifolds[pair].contacts[slot]'}=contact;
|
|
207
|
+
}
|
|
208
|
+
${
|
|
209
|
+
blockContacts
|
|
210
|
+
? `
|
|
211
|
+
}
|
|
212
|
+
// Interpolation of feasible impulses preserves the friction cone, including unloading.
|
|
213
|
+
for(var slot=0u;slot<manifolds[pair].count;slot++){
|
|
214
|
+
let previous=manifolds[pair].contacts[slot];
|
|
215
|
+
manifolds[pair].contacts[slot].impulse.x=mix(previous.impulse.x,contacts[slot].impulse.x,relaxation);
|
|
216
|
+
manifolds[pair].contacts[slot].tangent=mix(previous.tangent,contacts[slot].tangent,relaxation);
|
|
217
|
+
}
|
|
218
|
+
`
|
|
219
|
+
: ''
|
|
197
220
|
}
|
|
198
|
-
parallelState.deltas[pair*4u]=vec4f(firstLinear-velocities[first].xyz,0);
|
|
199
|
-
parallelState.deltas[pair*4u+1u]=vec4f(firstAngular-angularVelocities[first].xyz,0);
|
|
200
|
-
parallelState.deltas[pair*4u+2u]=vec4f(secondLinear-velocities[second].xyz,0);
|
|
201
|
-
parallelState.deltas[pair*4u+3u]=vec4f(secondAngular-angularVelocities[second].xyz,0);
|
|
221
|
+
parallelState.deltas[pair*4u]=vec4f((firstLinear-velocities[first].xyz)*${blockContacts ? 'relaxation' : '1.0'},0);
|
|
222
|
+
parallelState.deltas[pair*4u+1u]=vec4f((firstAngular-angularVelocities[first].xyz)*${blockContacts ? 'relaxation' : '1.0'},0);
|
|
223
|
+
parallelState.deltas[pair*4u+2u]=vec4f((secondLinear-velocities[second].xyz)*${blockContacts ? 'relaxation' : '1.0'},0);
|
|
224
|
+
parallelState.deltas[pair*4u+3u]=vec4f((secondAngular-angularVelocities[second].xyz)*${blockContacts ? 'relaxation' : '1.0'},0);
|
|
202
225
|
}
|
|
203
226
|
@compute @workgroup_size(64) fn parallelGather(@builtin(global_invocation_id) invocation:vec3u){
|
|
204
227
|
var body=invocation.x;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4, Quaternion} from '@math.gl/core';
|
|
5
|
+
import {Matrix4, Quaternion} from '@math.gl/core/matrix';
|
|
6
|
+
import type {GPURigidBodyHeightField} from './rigid-body-height-field';
|
|
6
7
|
import type {RigidBodyMeshGeometry} from './rigid-body-mesh';
|
|
7
8
|
import {getRigidBodyShapeProperties} from './rigid-body-shape-properties';
|
|
8
9
|
|
|
@@ -16,7 +17,9 @@ export type GPURigidBodyShape =
|
|
|
16
17
|
| {type: 'capsule'; height: number; radiusBottom: number; radiusTop: number}
|
|
17
18
|
| {type: 'cylinder'; height: number; radiusBottom: number; radiusTop: number}
|
|
18
19
|
| {type: 'convex-hull'; geometry: RigidBodyMeshGeometry}
|
|
19
|
-
| {type: 'triangle-mesh'; geometry: RigidBodyMeshGeometry}
|
|
20
|
+
| {type: 'triangle-mesh'; geometry: RigidBodyMeshGeometry}
|
|
21
|
+
/** Static Z-up terrain with on-GPU triangle reconstruction. */
|
|
22
|
+
| {type: 'height-field'; field: GPURigidBodyHeightField};
|
|
20
23
|
export type GPURigidBodyMaterial = {
|
|
21
24
|
restitution?: number;
|
|
22
25
|
staticFriction?: number;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
createBoundKernelAsync
|
|
9
9
|
} from '../gpu-core/utils/bound-kernel';
|
|
10
10
|
import {Buffer, type CommandEncoder} from '@luma.gl/core';
|
|
11
|
-
import {Matrix4} from '@math.gl/core';
|
|
11
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
12
12
|
import {normalizeRigidBodyRotation} from './rigid-body-properties';
|
|
13
13
|
|
|
14
14
|
import type {
|
|
@@ -63,15 +63,17 @@ fn closestSurface(collider:u32,point:vec3f)->SurfacePoint{
|
|
|
63
63
|
loop{
|
|
64
64
|
if(node>=nodeCount){break;}if(work>=MESH_TRAVERSAL_BUDGET){complete=0u;break;}work++;
|
|
65
65
|
let lower=readGeometry(nodeOffset+node*3u);let upper=readGeometry(nodeOffset+node*3u+1u);
|
|
66
|
-
if(distance(point,clamp(point,lower.xyz,upper.xyz))>best){node=u32(lower.w);continue;}
|
|
66
|
+
if(any(lower.xyz>upper.xyz)||distance(point,clamp(point,lower.xyz,upper.xyz))>best){node=u32(lower.w);continue;}
|
|
67
67
|
if(upper.w>0.0){let start=u32(readGeometry(nodeOffset+node*3u+2u).x);
|
|
68
68
|
for(var offset=0u;offset<u32(upper.w);offset++){
|
|
69
69
|
if(work>=MESH_TRAVERSAL_BUDGET){complete=0u;break;}work++;
|
|
70
|
+
if(!meshTriangleActive(collider,start+offset)){continue;}
|
|
70
71
|
let candidate=closestTriangle(point,triangleVertex(collider,start+offset,0u),triangleVertex(collider,start+offset,1u),triangleVertex(collider,start+offset,2u));
|
|
71
72
|
let separation=distance(point,candidate);if(separation<best){best=separation;nearest=candidate;}
|
|
72
73
|
}
|
|
73
74
|
}if(complete==0u){break;}node++;
|
|
74
75
|
}
|
|
76
|
+
if(best==3.402823e38){return SurfacePoint(point,best,complete);}
|
|
75
77
|
}
|
|
76
78
|
return SurfacePoint(nearest,select(distance(point,nearest),0.0,inside),complete);
|
|
77
79
|
}
|
|
@@ -125,6 +127,12 @@ fn sweepBox(origin:vec3f,direction:vec3f,maximumDistance:f32,radius:f32,extent:v
|
|
|
125
127
|
if(result.hit!=0u){result.distance=nearest;result.point=origin+direction*nearest-result.normal*radius;}
|
|
126
128
|
return result;
|
|
127
129
|
}
|
|
130
|
+
// Drop the dominant normal component for ray edge tests. An on-edge ray can
|
|
131
|
+
// otherwise look outside when the computed plane intersection rounds off-plane.
|
|
132
|
+
fn rayTriangleEdge(edge:vec3f,offset:vec3f,normal:vec3f,axis:u32)->bool{
|
|
133
|
+
let horizontal=(axis+1u)%3u;let vertical=(axis+2u)%3u;
|
|
134
|
+
return (edge[horizontal]*offset[vertical]-edge[vertical]*offset[horizontal])*normal[axis]>=0.0;
|
|
135
|
+
}
|
|
128
136
|
// A triangle's sphere expansion is convex. Ignore only a departing initial touch
|
|
129
137
|
// on that triangle; other triangles in the same nonconvex mesh remain candidates.
|
|
130
138
|
fn sweepTriangle(origin:vec3f,direction:vec3f,maximumDistance:f32,radius:f32,first:vec3f,second:vec3f,third:vec3f,skipSeparating:bool)->SphereSweep{
|
|
@@ -161,9 +169,18 @@ fn sweepTriangle(origin:vec3f,direction:vec3f,maximumDistance:f32,radius:f32,fir
|
|
|
161
169
|
let travelled=(sign*radius-dot(origin-first,normal))/denominator;
|
|
162
170
|
let point=origin+direction*travelled-normal*(sign*radius);
|
|
163
171
|
if(travelled<0.0||travelled>nearest){continue;}
|
|
164
|
-
|
|
165
|
-
|
|
172
|
+
let firstSide=(second-first)/edgeScale;let secondSide=(third-second)/edgeScale;let thirdSide=(first-third)/edgeScale;
|
|
173
|
+
let firstOffset=(point-first)/edgeScale;let secondOffset=(point-second)/edgeScale;let thirdOffset=(point-third)/edgeScale;
|
|
174
|
+
var inside=false;
|
|
175
|
+
if(radius==0.0){
|
|
176
|
+
let magnitude=abs(normal);
|
|
177
|
+
var axis=select(0u,1u,magnitude.y>magnitude.x);
|
|
178
|
+
if(magnitude.z>magnitude[axis]){axis=2u;}
|
|
179
|
+
inside=rayTriangleEdge(firstSide,firstOffset,normal,axis)&&rayTriangleEdge(secondSide,secondOffset,normal,axis)&&rayTriangleEdge(thirdSide,thirdOffset,normal,axis);
|
|
180
|
+
}else{
|
|
181
|
+
inside=dot(cross(firstSide,firstOffset),normal)>=0.0&&dot(cross(secondSide,secondOffset),normal)>=0.0&&dot(cross(thirdSide,thirdOffset),normal)>=0.0;
|
|
166
182
|
}
|
|
183
|
+
if(inside){nearest=travelled;result.hit=1u;result.normal=normal*sign;}
|
|
167
184
|
}}
|
|
168
185
|
if(radius>0.0){
|
|
169
186
|
var vertices=array<vec3f,3>(first,second,third);
|
|
@@ -205,10 +222,11 @@ fn sweepMesh(collider:u32,origin:vec3f,direction:vec3f,maximumDistance:f32,radiu
|
|
|
205
222
|
loop{
|
|
206
223
|
if(node>=nodeCount){break;}if(work>=MESH_TRAVERSAL_BUDGET){result.complete=0u;return result;}work++;
|
|
207
224
|
let lower=readGeometry(nodeOffset+node*3u);let upper=readGeometry(nodeOffset+node*3u+1u);
|
|
208
|
-
if(
|
|
225
|
+
if(any(lower.xyz>upper.xyz)||!intersectsSweepBounds(origin,direction,nearest,lower.xyz-vec3f(radius),upper.xyz+vec3f(radius))){node=u32(lower.w);continue;}
|
|
209
226
|
if(upper.w>0.0){let start=u32(readGeometry(nodeOffset+node*3u+2u).x);
|
|
210
227
|
for(var offset=0u;offset<u32(upper.w);offset++){
|
|
211
228
|
if(work>=MESH_TRAVERSAL_BUDGET){result.complete=0u;return result;}work++;
|
|
229
|
+
if(!meshTriangleActive(collider,start+offset)){continue;}
|
|
212
230
|
let candidate=sweepTriangle(origin,direction,nearest,radius,triangleVertex(collider,start+offset,0u),triangleVertex(collider,start+offset,1u),triangleVertex(collider,start+offset,2u),skipSeparating);
|
|
213
231
|
if(candidate.hit!=0u){nearest=candidate.distance;result=candidate;}
|
|
214
232
|
}
|