@luma.gl/engine 10.0.0-beta.1 → 10.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation/deform-positions.d.ts +1 -1
- package/dist/animation/deform-positions.d.ts.map +1 -1
- package/dist/animation/skin.cjs +4 -4
- package/dist/animation/skin.d.ts +1 -1
- package/dist/animation/skin.d.ts.map +1 -1
- package/dist/animation/skin.js +1 -1
- package/dist/animation/skin.js.map +1 -1
- package/dist/animation/texture-transform.cjs +7 -7
- package/dist/animation/texture-transform.js +1 -1
- package/dist/animation/texture-transform.js.map +1 -1
- package/dist/arrow/arrow-mesh-types.d.ts +1 -1
- package/dist/arrow/arrow-mesh-types.d.ts.map +1 -1
- package/dist/arrow/index.cjs.map +2 -2
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.cjs +2 -2
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.d.ts +1 -1
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.js +1 -1
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.cjs +1 -0
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.d.ts.map +1 -1
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.js +1 -0
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.js.map +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.cjs +2 -2
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js.map +1 -1
- package/dist/audio/audio-controller.cjs +6 -6
- package/dist/audio/audio-controller.d.ts +1 -1
- package/dist/audio/audio-controller.d.ts.map +1 -1
- package/dist/audio/audio-controller.js +1 -1
- package/dist/audio/audio-controller.js.map +1 -1
- package/dist/audio/audio-environment.cjs +6 -6
- package/dist/audio/audio-environment.d.ts +1 -1
- package/dist/audio/audio-environment.d.ts.map +1 -1
- package/dist/audio/audio-environment.js +1 -1
- package/dist/audio/audio-environment.js.map +1 -1
- package/dist/compute/computation.d.ts +1 -1
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/debug/pixel-data-utils.d.ts +1 -1
- package/dist/debug/pixel-data-utils.d.ts.map +1 -1
- package/dist/dist.dev.js +293 -229
- package/dist/dist.min.js +73 -59
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/gtao.cjs +4 -4
- package/dist/effects/passes/screen-space/gtao.d.ts +1 -1
- package/dist/effects/passes/screen-space/gtao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/gtao.js +1 -1
- package/dist/effects/passes/screen-space/gtao.js.map +1 -1
- package/dist/effects/passes/screen-space/height-fog.d.ts +1 -1
- package/dist/effects/passes/screen-space/height-fog.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts +1 -1
- package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts.map +1 -1
- package/dist/experimental/controls/index.cjs +0 -3
- package/dist/experimental/controls/index.cjs.map +2 -2
- package/dist/experimental/controls/index.d.ts +0 -2
- package/dist/experimental/controls/index.d.ts.map +1 -1
- package/dist/experimental/controls/index.js +0 -1
- package/dist/experimental/controls/index.js.map +1 -1
- package/dist/experimental/webxr/webxr-input.d.ts +1 -1
- package/dist/experimental/webxr/webxr-input.d.ts.map +1 -1
- package/dist/experimental-controls.cjs +21 -0
- package/dist/experimental-controls.d.ts +2 -0
- package/dist/experimental-controls.d.ts.map +1 -0
- package/dist/experimental-controls.js +5 -0
- package/dist/experimental-controls.js.map +1 -0
- package/dist/experimental-materials.cjs +21 -0
- package/dist/experimental-materials.d.ts +2 -0
- package/dist/experimental-materials.d.ts.map +1 -0
- package/dist/experimental-materials.js +5 -0
- package/dist/experimental-materials.js.map +1 -0
- package/dist/experimental-textures.cjs +21 -0
- package/dist/experimental-textures.d.ts +2 -0
- package/dist/experimental-textures.d.ts.map +1 -0
- package/dist/experimental-textures.js +5 -0
- package/dist/experimental-textures.js.map +1 -0
- package/dist/{experimental/controls/orbit-controls.cjs → experimental-webxr.cjs} +5 -11
- package/dist/experimental-webxr.d.ts +2 -0
- package/dist/experimental-webxr.d.ts.map +1 -0
- package/dist/experimental-webxr.js +5 -0
- package/dist/experimental-webxr.js.map +1 -0
- package/dist/geometry/edge-geometry.d.ts +1 -1
- package/dist/geometry/edge-geometry.d.ts.map +1 -1
- package/dist/geometry/geometry-primitives.cjs +18 -17
- package/dist/geometry/geometry-primitives.d.ts +2 -2
- package/dist/geometry/geometry-primitives.d.ts.map +1 -1
- package/dist/geometry/geometry-primitives.js +3 -2
- package/dist/geometry/geometry-primitives.js.map +1 -1
- package/dist/geometry/geometry-table.d.ts +1 -1
- package/dist/geometry/geometry-table.d.ts.map +1 -1
- package/dist/geometry/geometry-utils.cjs +6 -6
- package/dist/geometry/geometry-utils.d.ts +2 -2
- package/dist/geometry/geometry-utils.d.ts.map +1 -1
- package/dist/geometry/geometry-utils.js +1 -1
- package/dist/geometry/geometry-utils.js.map +1 -1
- package/dist/geometry/geometry.cjs +2 -2
- package/dist/geometry/geometry.d.ts +4 -3
- package/dist/geometry/geometry.d.ts.map +1 -1
- package/dist/geometry/geometry.js +1 -1
- package/dist/geometry/geometry.js.map +1 -1
- package/dist/geometry/gpu-geometry.d.ts +1 -1
- package/dist/geometry/gpu-geometry.d.ts.map +1 -1
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts +1 -1
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts.map +1 -1
- package/dist/geometry/ring-geometry.cjs +6 -6
- package/dist/geometry/ring-geometry.d.ts +1 -1
- package/dist/geometry/ring-geometry.d.ts.map +1 -1
- package/dist/geometry/ring-geometry.js +2 -2
- package/dist/geometry/ring-geometry.js.map +1 -1
- package/dist/gltf/gltf/create-composed-scenegraphs-from-gltf.cjs +80 -0
- package/dist/gltf/gltf/create-composed-scenegraphs-from-gltf.d.ts +28 -0
- package/dist/gltf/gltf/create-composed-scenegraphs-from-gltf.d.ts.map +1 -0
- package/dist/gltf/gltf/create-composed-scenegraphs-from-gltf.js +74 -0
- package/dist/gltf/gltf/create-composed-scenegraphs-from-gltf.js.map +1 -0
- package/dist/gltf/gltf/create-gltf-model.d.ts +1 -1
- package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +13 -4
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js +11 -0
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts +2 -1
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.js.map +1 -1
- package/dist/gltf/gltf/gltf-instancing.cjs +2 -2
- package/dist/gltf/gltf/gltf-instancing.d.ts +1 -1
- package/dist/gltf/gltf/gltf-instancing.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-instancing.js +1 -1
- package/dist/gltf/gltf/gltf-instancing.js.map +1 -1
- package/dist/gltf/gltf/gltf-lightmap.cjs +2 -2
- package/dist/gltf/gltf/gltf-lightmap.d.ts +1 -1
- package/dist/gltf/gltf/gltf-lightmap.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-lightmap.js +1 -1
- package/dist/gltf/gltf/gltf-lightmap.js.map +1 -1
- package/dist/gltf/gltf/gltf-skin.cjs +1 -1
- package/dist/gltf/gltf/gltf-skin.js +2 -2
- package/dist/gltf/gltf/gltf-skin.js.map +1 -1
- package/dist/gltf/index.cjs +3 -0
- package/dist/gltf/index.cjs.map +3 -3
- package/dist/gltf/index.d.ts +1 -0
- package/dist/gltf/index.d.ts.map +1 -1
- package/dist/gltf/index.js +1 -0
- package/dist/gltf/index.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-lights.cjs +5 -5
- package/dist/gltf/parsers/parse-gltf-lights.js +1 -1
- package/dist/gltf/parsers/parse-gltf-lights.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-physics-pointer.cjs +1 -1
- package/dist/gltf/parsers/parse-gltf-physics-pointer.js +1 -1
- package/dist/gltf/parsers/parse-gltf-physics-pointer.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf.cjs +2 -1
- package/dist/gltf/parsers/parse-gltf.d.ts +2 -0
- package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf.js +3 -1
- package/dist/gltf/parsers/parse-gltf.js.map +1 -1
- package/dist/gltf/parsers/parse-pbr-material.cjs +27 -27
- package/dist/gltf/parsers/parse-pbr-material.js +1 -1
- package/dist/gltf/parsers/parse-pbr-material.js.map +1 -1
- package/dist/gltf/physics/export-state.cjs +118 -17
- package/dist/gltf/physics/export-state.d.ts +9 -2
- package/dist/gltf/physics/export-state.d.ts.map +1 -1
- package/dist/gltf/physics/export-state.js +172 -19
- package/dist/gltf/physics/export-state.js.map +1 -1
- package/dist/gltf/physics/index.cjs.map +2 -2
- package/dist/gltf/physics/index.d.ts +1 -1
- package/dist/gltf/physics/index.d.ts.map +1 -1
- package/dist/gltf/physics/index.js.map +1 -1
- package/dist/gltf/physics/mesh-snapshot.cjs +3 -3
- package/dist/gltf/physics/mesh-snapshot.js +1 -1
- package/dist/gltf/physics/mesh-snapshot.js.map +1 -1
- package/dist/gltf/physics/node-collision-geometry.cjs +3 -3
- package/dist/gltf/physics/node-collision-geometry.js +1 -1
- package/dist/gltf/physics/node-collision-geometry.js.map +1 -1
- package/dist/gltf/physics/parse-gltf-physics.cjs +20 -17
- package/dist/gltf/physics/parse-gltf-physics.d.ts.map +1 -1
- package/dist/gltf/physics/parse-gltf-physics.js +7 -3
- package/dist/gltf/physics/parse-gltf-physics.js.map +1 -1
- package/dist/gltf/physics/parse-physics-joints.cjs +3 -3
- package/dist/gltf/physics/parse-physics-joints.d.ts +1 -1
- package/dist/gltf/physics/parse-physics-joints.d.ts.map +1 -1
- package/dist/gltf/physics/parse-physics-joints.js +1 -1
- package/dist/gltf/physics/parse-physics-joints.js.map +1 -1
- package/dist/gltf/physics/physics-types.d.ts +4 -0
- package/dist/gltf/physics/physics-types.d.ts.map +1 -1
- package/dist/gltf/physics/property-bindings.cjs +9 -6
- package/dist/gltf/physics/property-bindings.d.ts.map +1 -1
- package/dist/gltf/physics/property-bindings.js +12 -3
- package/dist/gltf/physics/property-bindings.js.map +1 -1
- package/dist/gltf/types/gltf-postprocessed-schema.d.ts +4 -0
- package/dist/gltf/types/gltf-postprocessed-schema.d.ts.map +1 -1
- package/dist/gltf/types/gltf-types.d.ts +2 -0
- package/dist/gltf/types/gltf-types.d.ts.map +1 -1
- package/dist/graph/models/index.cjs.map +2 -2
- package/dist/graph/models/path/path-storage-model.cjs +8 -8
- package/dist/graph/models/path/path-storage-model.d.ts +1 -1
- package/dist/graph/models/path/path-storage-model.js +2 -2
- package/dist/graph/models/polygon/polygon-attribute-model.cjs +4 -4
- package/dist/graph/models/polygon/polygon-attribute-model.d.ts +1 -1
- package/dist/graph/models/polygon/polygon-attribute-model.js +1 -1
- package/dist/graph/models/polygon/polygon-shaders.d.ts +1 -1
- package/dist/graph/models/polygon/polygon-storage-model.cjs +4 -4
- package/dist/graph/models/polygon/polygon-storage-model.d.ts +1 -1
- package/dist/graph/models/polygon/polygon-storage-model.js +1 -1
- package/dist/graph/physics/index.cjs +3 -0
- package/dist/graph/physics/index.cjs.map +3 -3
- package/dist/graph/physics/index.d.ts +2 -1
- package/dist/graph/physics/index.d.ts.map +1 -1
- package/dist/graph/physics/index.js +1 -0
- package/dist/graph/physics/index.js.map +1 -1
- package/dist/graph/physics/physics-controller-geometry.cjs +8 -8
- package/dist/graph/physics/physics-controller-geometry.js +2 -2
- package/dist/graph/physics/physics-controller-geometry.js.map +1 -1
- package/dist/graph/physics/physics-controller.cjs +95 -31
- package/dist/graph/physics/physics-controller.d.ts +36 -9
- package/dist/graph/physics/physics-controller.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller.js +96 -31
- package/dist/graph/physics/physics-controller.js.map +1 -1
- package/dist/graph/physics/physics-scenegraph.cjs +4 -4
- package/dist/graph/physics/physics-scenegraph.d.ts +1 -1
- package/dist/graph/physics/physics-scenegraph.d.ts.map +1 -1
- package/dist/graph/physics/physics-scenegraph.js +1 -1
- package/dist/graph/physics/physics-scenegraph.js.map +1 -1
- package/dist/graph/physics/scenegraph-instance.cjs +14 -7
- package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-instance.js +15 -7
- package/dist/graph/physics/scenegraph-instance.js.map +1 -1
- package/dist/graph/physics/scenegraph-motion.cjs +7 -7
- package/dist/graph/physics/scenegraph-motion.d.ts +1 -1
- package/dist/graph/physics/scenegraph-motion.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-motion.js +1 -1
- package/dist/graph/physics/scenegraph-motion.js.map +1 -1
- package/dist/graph/physics/scenegraph-properties.cjs +3 -3
- package/dist/graph/physics/scenegraph-properties.js +1 -1
- package/dist/graph/physics/scenegraph-properties.js.map +1 -1
- package/dist/graph/physics/scenegraph-publication.cjs +5 -5
- package/dist/graph/physics/scenegraph-publication.d.ts +1 -1
- package/dist/graph/physics/scenegraph-publication.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-publication.js +1 -1
- package/dist/graph/physics/scenegraph-publication.js.map +1 -1
- package/dist/graph/physics/scenegraph-ragdoll.cjs +132 -0
- package/dist/graph/physics/scenegraph-ragdoll.d.ts +32 -0
- package/dist/graph/physics/scenegraph-ragdoll.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-ragdoll.js +117 -0
- package/dist/graph/physics/scenegraph-ragdoll.js.map +1 -0
- package/dist/graph/tables/index.cjs.map +2 -2
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.cjs +3 -3
- package/dist/lighting/ambient-occlusion-pass.d.ts +2 -1
- package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.js +1 -1
- package/dist/lighting/ambient-occlusion-pass.js.map +1 -1
- package/dist/lighting/clustered-light-grid.d.ts +1 -1
- package/dist/lighting/clustered-light-grid.d.ts.map +1 -1
- package/dist/lighting/contact-shadow-pass.cjs +2 -2
- package/dist/lighting/contact-shadow-pass.d.ts +2 -1
- package/dist/lighting/contact-shadow-pass.d.ts.map +1 -1
- package/dist/lighting/contact-shadow-pass.js +1 -1
- package/dist/lighting/contact-shadow-pass.js.map +1 -1
- package/dist/lighting/index.cjs.map +2 -2
- package/dist/lighting/lightmap-atlas.cjs +6 -6
- package/dist/lighting/lightmap-atlas.d.ts +1 -1
- package/dist/lighting/lightmap-atlas.d.ts.map +1 -1
- package/dist/lighting/lightmap-atlas.js +1 -1
- package/dist/lighting/lightmap-atlas.js.map +1 -1
- package/dist/lighting/reflection-probe.cjs +4 -4
- package/dist/lighting/reflection-probe.d.ts +2 -1
- package/dist/lighting/reflection-probe.d.ts.map +1 -1
- package/dist/lighting/reflection-probe.js +1 -1
- package/dist/lighting/reflection-probe.js.map +1 -1
- package/dist/lighting/shadow-map-renderer.cjs +13 -13
- package/dist/lighting/shadow-map-renderer.d.ts +2 -2
- package/dist/lighting/shadow-map-renderer.d.ts.map +1 -1
- package/dist/lighting/shadow-map-renderer.js +1 -1
- package/dist/lighting/shadow-map-renderer.js.map +1 -1
- package/dist/model/gpu-vector-model.d.ts +1 -1
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/model.d.ts +1 -1
- package/dist/model/model.d.ts.map +1 -1
- package/dist/models/light-model-utils.cjs +2 -2
- package/dist/models/light-model-utils.d.ts +1 -1
- package/dist/models/light-model-utils.d.ts.map +1 -1
- package/dist/models/light-model-utils.js +1 -1
- package/dist/models/light-model-utils.js.map +1 -1
- package/dist/modules/picking/color-picking.d.ts +1 -1
- package/dist/modules/picking/index-color-picking.d.ts +1 -1
- package/dist/modules/picking/index-picking.d.ts +1 -1
- package/dist/modules/picking/legacy-color-picking.d.ts +1 -1
- package/dist/modules/picking/picking-uniforms.d.ts +1 -1
- package/dist/modules/picking/picking-uniforms.d.ts.map +1 -1
- package/dist/modules/picking/picking.d.ts +1 -1
- package/dist/scenegraph/controllers/area-light-controller.cjs +11 -11
- package/dist/scenegraph/controllers/area-light-controller.js +1 -1
- package/dist/scenegraph/controllers/area-light-controller.js.map +1 -1
- package/dist/scenegraph/controllers/billboard-controller.cjs +28 -28
- package/dist/scenegraph/controllers/billboard-controller.d.ts +2 -1
- package/dist/scenegraph/controllers/billboard-controller.d.ts.map +1 -1
- package/dist/scenegraph/controllers/billboard-controller.js +1 -1
- package/dist/scenegraph/controllers/billboard-controller.js.map +1 -1
- package/dist/scenegraph/controllers/joint-controller.cjs +5 -5
- package/dist/scenegraph/controllers/joint-controller.js +1 -1
- package/dist/scenegraph/controllers/joint-controller.js.map +1 -1
- package/dist/scenegraph/controllers/punctual-light-controller.cjs +2 -2
- package/dist/scenegraph/controllers/punctual-light-controller.d.ts +1 -1
- package/dist/scenegraph/controllers/punctual-light-controller.d.ts.map +1 -1
- package/dist/scenegraph/controllers/punctual-light-controller.js +1 -1
- package/dist/scenegraph/controllers/punctual-light-controller.js.map +1 -1
- package/dist/scenegraph/controllers/skin-controller.cjs +22 -3
- package/dist/scenegraph/controllers/skin-controller.d.ts +4 -0
- package/dist/scenegraph/controllers/skin-controller.d.ts.map +1 -1
- package/dist/scenegraph/controllers/skin-controller.js +22 -2
- package/dist/scenegraph/controllers/skin-controller.js.map +1 -1
- package/dist/scenegraph/group-node.cjs +14 -14
- package/dist/scenegraph/group-node.d.ts +2 -2
- package/dist/scenegraph/group-node.d.ts.map +1 -1
- package/dist/scenegraph/group-node.js +1 -1
- package/dist/scenegraph/group-node.js.map +1 -1
- package/dist/scenegraph/model-node.d.ts +1 -1
- package/dist/scenegraph/model-node.d.ts.map +1 -1
- package/dist/scenegraph/physics-transforms.cjs +2 -2
- package/dist/scenegraph/physics-transforms.d.ts +1 -1
- package/dist/scenegraph/physics-transforms.d.ts.map +1 -1
- package/dist/scenegraph/physics-transforms.js +1 -1
- package/dist/scenegraph/physics-transforms.js.map +1 -1
- package/dist/scenegraph/scenegraph-bounds.cjs +3 -3
- package/dist/scenegraph/scenegraph-bounds.d.ts +1 -1
- package/dist/scenegraph/scenegraph-bounds.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-bounds.js +1 -1
- package/dist/scenegraph/scenegraph-bounds.js.map +1 -1
- package/dist/scenegraph/scenegraph-node.cjs +7 -7
- package/dist/scenegraph/scenegraph-node.d.ts +2 -1
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-node.js +1 -1
- package/dist/scenegraph/scenegraph-node.js.map +1 -1
- package/dist/scenegraph/transform-source.d.ts +1 -1
- package/dist/scenegraph/transform-source.d.ts.map +1 -1
- package/dist/shader-plugins/depth-interval.cjs +60 -0
- package/dist/shader-plugins/depth-interval.d.ts +10 -0
- package/dist/shader-plugins/depth-interval.d.ts.map +1 -0
- package/dist/shader-plugins/depth-interval.js +42 -0
- package/dist/shader-plugins/depth-interval.js.map +1 -0
- package/dist/splats/index.cjs.map +2 -2
- package/dist/splats/index.d.ts +1 -1
- package/dist/splats/index.d.ts.map +1 -1
- package/dist/splats/index.js.map +1 -1
- package/dist/splats/splat-picking.d.ts +2 -2
- package/dist/splats/splat-picking.d.ts.map +1 -1
- package/dist/splats/splat-renderer.cjs +51 -2
- package/dist/splats/splat-renderer.d.ts +15 -1
- package/dist/splats/splat-renderer.d.ts.map +1 -1
- package/dist/splats/splat-renderer.js +61 -2
- package/dist/splats/splat-renderer.js.map +1 -1
- package/dist/splats/splat-shaders.cjs +46 -3
- package/dist/splats/splat-shaders.d.ts +5 -3
- package/dist/splats/splat-shaders.d.ts.map +1 -1
- package/dist/splats/splat-shaders.js +42 -3
- package/dist/splats/splat-shaders.js.map +1 -1
- package/dist/text/text-3d/extrude.cjs +15 -15
- package/dist/text/text-3d/extrude.js +1 -1
- package/dist/text/text-3d/extrude.js.map +1 -1
- package/dist/text/text-3d/index.cjs.map +2 -2
- package/dist/text/text-3d/paths/curves.cjs +5 -5
- package/dist/text/text-3d/paths/curves.d.ts +1 -1
- package/dist/text/text-3d/paths/curves.d.ts.map +1 -1
- package/dist/text/text-3d/paths/curves.js +1 -1
- package/dist/text/text-3d/paths/curves.js.map +1 -1
- package/dist/text/text-3d/paths/path.cjs +5 -5
- package/dist/text/text-3d/paths/path.d.ts +1 -1
- package/dist/text/text-3d/paths/path.d.ts.map +1 -1
- package/dist/text/text-3d/paths/path.js +1 -1
- package/dist/text/text-3d/paths/path.js.map +1 -1
- package/dist/text/text-3d/paths/shape-path.d.ts +1 -1
- package/dist/text/text-3d/paths/shape-path.d.ts.map +1 -1
- package/dist/text/text-3d/paths/shape-utils.cjs +2 -2
- package/dist/text/text-3d/paths/shape-utils.d.ts +1 -1
- package/dist/text/text-3d/paths/shape-utils.d.ts.map +1 -1
- package/dist/text/text-3d/paths/shape-utils.js +1 -1
- package/dist/text/text-3d/paths/shape-utils.js.map +1 -1
- package/package.json +12 -12
- package/src/animation/deform-positions.ts +1 -1
- package/src/animation/skin.ts +2 -1
- package/src/animation/texture-transform.ts +1 -1
- package/src/arrow/arrow-geometry.ts +1 -1
- package/src/arrow/arrow-mesh-types.ts +1 -1
- package/src/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.ts +1 -1
- package/src/arrow/renderers/path/transforms/gpu-path-float64-deltas.ts +1 -0
- package/src/arrow/renderers/polygon/renderers/arrow-polygon-renderer.ts +1 -1
- package/src/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.ts +1 -1
- package/src/audio/audio-controller.ts +1 -1
- package/src/audio/audio-environment.ts +1 -1
- package/src/compute/computation.ts +1 -1
- package/src/debug/pixel-data-utils.ts +1 -1
- package/src/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.ts +1 -1
- package/src/effects/passes/screen-space/clustered-volumetric-lighting.ts +1 -1
- package/src/effects/passes/screen-space/gtao.ts +1 -1
- package/src/effects/passes/screen-space/height-fog.ts +1 -1
- package/src/effects/passes/screen-space/screen-space-global-illumination.ts +1 -1
- package/src/effects/passes/screen-space/screen-space-reflections.ts +1 -1
- package/src/effects/passes/screen-space/ssr-camera-temporal.ts +1 -1
- package/src/experimental/controls/index.ts +0 -2
- package/src/experimental/webxr/webxr-input.ts +1 -1
- package/{dist/experimental/controls/orbit-controls.js → src/experimental-controls.ts} +2 -2
- package/src/experimental-materials.ts +5 -0
- package/src/experimental-textures.ts +5 -0
- package/src/experimental-webxr.ts +5 -0
- package/src/geometry/edge-geometry.ts +2 -2
- package/src/geometry/geometry-primitives.ts +6 -3
- package/src/geometry/geometry-table.ts +1 -1
- package/src/geometry/geometry-utils.ts +3 -3
- package/src/geometry/geometry.ts +7 -7
- package/src/geometry/gpu-geometry.ts +1 -1
- package/src/geometry/gpu-vector-geometry-adapter.ts +1 -1
- package/src/geometry/ring-geometry.ts +2 -2
- package/src/gltf/gltf/create-composed-scenegraphs-from-gltf.ts +100 -0
- package/src/gltf/gltf/create-gltf-model.ts +1 -1
- package/src/gltf/gltf/create-scenegraph-from-gltf.ts +12 -0
- package/src/gltf/gltf/gltf-animated-crowd.ts +2 -1
- package/src/gltf/gltf/gltf-instancing.ts +1 -1
- package/src/gltf/gltf/gltf-lightmap.ts +1 -1
- package/src/gltf/gltf/gltf-skin.ts +2 -2
- package/src/gltf/index.ts +5 -0
- package/src/gltf/parsers/parse-gltf-lights.ts +1 -1
- package/src/gltf/parsers/parse-gltf-physics-pointer.ts +1 -1
- package/src/gltf/parsers/parse-gltf.ts +6 -4
- package/src/gltf/parsers/parse-pbr-material.ts +1 -1
- package/src/gltf/physics/README.md +16 -0
- package/src/gltf/physics/export-state.ts +216 -19
- package/src/gltf/physics/index.ts +1 -1
- package/src/gltf/physics/mesh-snapshot.ts +1 -1
- package/src/gltf/physics/node-collision-geometry.ts +1 -1
- package/src/gltf/physics/parse-gltf-physics.ts +6 -3
- package/src/gltf/physics/parse-physics-joints.ts +1 -1
- package/src/gltf/physics/physics-types.ts +4 -0
- package/src/gltf/physics/property-bindings.ts +11 -3
- package/src/gltf/types/gltf-postprocessed-schema.ts +4 -0
- package/src/gltf/types/gltf-types.ts +2 -0
- package/src/graph/models/path/path-storage-model.ts +3 -3
- package/src/graph/models/polygon/polygon-attribute-model.ts +1 -1
- package/src/graph/models/polygon/polygon-storage-model.ts +1 -1
- package/src/graph/physics/index.ts +2 -0
- package/src/graph/physics/physics-controller-geometry.ts +2 -2
- package/src/graph/physics/physics-controller.ts +139 -40
- package/src/graph/physics/physics-scenegraph.ts +1 -1
- package/src/graph/physics/scenegraph-instance.ts +25 -9
- package/src/graph/physics/scenegraph-motion.ts +1 -1
- package/src/graph/physics/scenegraph-properties.ts +1 -1
- package/src/graph/physics/scenegraph-publication.ts +1 -1
- package/src/graph/physics/scenegraph-ragdoll.ts +133 -0
- package/src/index.ts +2 -0
- package/src/lighting/ambient-occlusion-pass.ts +2 -1
- package/src/lighting/clustered-light-grid.ts +1 -1
- package/src/lighting/contact-shadow-pass.ts +2 -1
- package/src/lighting/lightmap-atlas.ts +1 -1
- package/src/lighting/reflection-probe.ts +2 -1
- package/src/lighting/shadow-map-renderer.ts +2 -2
- package/src/model/gpu-vector-model.ts +1 -1
- package/src/model/model.ts +1 -1
- package/src/models/light-model-utils.ts +2 -1
- package/src/modules/picking/legacy-picking-manager.ts +1 -1
- package/src/modules/picking/picking-uniforms.ts +1 -1
- package/src/scenegraph/controllers/area-light-controller.ts +1 -1
- package/src/scenegraph/controllers/billboard-controller.ts +2 -1
- package/src/scenegraph/controllers/joint-controller.ts +1 -1
- package/src/scenegraph/controllers/punctual-light-controller.ts +1 -1
- package/src/scenegraph/controllers/skin-controller.ts +21 -2
- package/src/scenegraph/group-node.ts +2 -2
- package/src/scenegraph/model-node.ts +1 -1
- package/src/scenegraph/physics-transforms.ts +1 -1
- package/src/scenegraph/scenegraph-bounds.ts +2 -2
- package/src/scenegraph/scenegraph-node.ts +2 -1
- package/src/scenegraph/transform-source.ts +1 -1
- package/src/shader-plugins/depth-interval.ts +45 -0
- package/src/splats/README.md +10 -0
- package/src/splats/index.ts +1 -0
- package/src/splats/splat-renderer.ts +82 -2
- package/src/splats/splat-shaders.ts +48 -3
- package/src/text/text-3d/extrude.ts +1 -1
- package/src/text/text-3d/font.ts +1 -1
- package/src/text/text-3d/paths/curves.ts +1 -1
- package/src/text/text-3d/paths/path.ts +1 -1
- package/src/text/text-3d/paths/shape-path.ts +1 -1
- package/src/text/text-3d/paths/shape-utils.ts +2 -2
- package/dist/experimental/controls/orbit-controls.d.ts +0 -3
- package/dist/experimental/controls/orbit-controls.d.ts.map +0 -1
- package/dist/experimental/controls/orbit-controls.js.map +0 -1
- package/src/experimental/controls/orbit-controls.ts +0 -6
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {assert, type Device} from '@luma.gl/core';
|
|
6
|
-
import type {Geometry} from '@math.gl/geometry';
|
|
6
|
+
import type {Geometry} from '@math.gl/geometry/primitives';
|
|
7
7
|
import type {
|
|
8
8
|
GPURigidBody,
|
|
9
9
|
GPURigidBodyShape,
|
|
10
|
+
GPURigidBodyVehicle,
|
|
10
11
|
GPURigidBodyWorldProps
|
|
11
12
|
} from '@luma.gl/graph/gpu-physics';
|
|
12
13
|
import {rotateRigidBodyVector} from '@luma.gl/graph/gpu-physics';
|
|
@@ -46,12 +47,26 @@ export type PhysicsBodyOptions = Pick<
|
|
|
46
47
|
};
|
|
47
48
|
export type PhysicsControllerProps = Omit<
|
|
48
49
|
GPURigidBodyWorldProps,
|
|
49
|
-
'bodies' | 'publicationBounds' | 'publishPoses' | 'joints' | 'vehicle'
|
|
50
|
+
'bodies' | 'publicationBounds' | 'publishPoses' | 'joints' | 'vehicle' | 'vehicles'
|
|
50
51
|
> & {
|
|
51
52
|
scene: GroupNode;
|
|
52
53
|
/** Bound catch-up work; excess elapsed time is reported, not silently simulated. */
|
|
53
54
|
maximumSubsteps?: number;
|
|
54
55
|
};
|
|
56
|
+
/** Vehicle tuning for a chassis and terrain identified by scenegraph references. */
|
|
57
|
+
export type PhysicsVehicleOptions = Omit<
|
|
58
|
+
GPURigidBodyVehicle,
|
|
59
|
+
'chassis' | 'terrainCollider' | 'additionalTerrainColliders'
|
|
60
|
+
>;
|
|
61
|
+
|
|
62
|
+
/** Authored terrain and tuning retained under the chassis node's identity. */
|
|
63
|
+
type PhysicsVehicleAttachment = {
|
|
64
|
+
/** One to four static nodes, in contact preference order. */
|
|
65
|
+
terrain: readonly ScenegraphNode[];
|
|
66
|
+
/** Wheel geometry and force settings. */
|
|
67
|
+
options: PhysicsVehicleOptions;
|
|
68
|
+
};
|
|
69
|
+
|
|
55
70
|
export type PhysicsBodyPose = {
|
|
56
71
|
/** World-space scene-node origin, rather than the internal center of mass. */
|
|
57
72
|
position: readonly [number, number, number];
|
|
@@ -80,11 +95,10 @@ export class PhysicsController {
|
|
|
80
95
|
private readonly definitions = new Map<ScenegraphNode, PhysicsBodyOptions>();
|
|
81
96
|
private readonly handles = new Map<ScenegraphNode, PhysicsBody>();
|
|
82
97
|
private readonly manualTargets = new Set<ScenegraphNode>();
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
};
|
|
98
|
+
/** Attachments in stable insertion order for unqualified legacy controls. */
|
|
99
|
+
private readonly vehicleAttachments = new Map<ScenegraphNode, PhysicsVehicleAttachment>();
|
|
100
|
+
/** Indices for the current compiled revision. */
|
|
101
|
+
private vehicleIndices = new Map<ScenegraphNode, number>();
|
|
88
102
|
private readonly joints: ScenegraphJoint[] = [];
|
|
89
103
|
private indices: ReadonlyMap<ScenegraphNode, number> = new Map();
|
|
90
104
|
private session?: ScenegraphPhysicsSession;
|
|
@@ -200,40 +214,110 @@ export class PhysicsController {
|
|
|
200
214
|
this.assertEditable();
|
|
201
215
|
const node = this.resolveNode(reference);
|
|
202
216
|
if (!node || !this.definitions.delete(node)) return false;
|
|
203
|
-
|
|
204
|
-
|
|
217
|
+
for (const [chassis, attachment] of this.vehicleAttachments) {
|
|
218
|
+
if (chassis === node || attachment.terrain.includes(node))
|
|
219
|
+
this.vehicleAttachments.delete(chassis);
|
|
220
|
+
}
|
|
205
221
|
this.handles.delete(node);
|
|
206
222
|
this.manualTargets.delete(node);
|
|
207
223
|
this.dirty = true;
|
|
208
224
|
return true;
|
|
209
225
|
}
|
|
210
226
|
|
|
211
|
-
/**
|
|
227
|
+
/** Replace the fleet with one chassis using a single terrain node, for legacy callers. */
|
|
212
228
|
setVehicle(
|
|
213
229
|
chassis: PhysicsNodeReference,
|
|
214
230
|
terrain: PhysicsNodeReference,
|
|
215
|
-
options:
|
|
231
|
+
options: PhysicsVehicleOptions
|
|
232
|
+
): void {
|
|
233
|
+
this.setVehicleAttachment(chassis, [terrain], options, true);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** Attach another independently controlled chassis to one to four static terrain nodes. */
|
|
237
|
+
addVehicle(
|
|
238
|
+
chassis: PhysicsNodeReference,
|
|
239
|
+
terrain: readonly PhysicsNodeReference[],
|
|
240
|
+
options: PhysicsVehicleOptions
|
|
216
241
|
): void {
|
|
242
|
+
this.setVehicleAttachment(chassis, terrain, options, false);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** Remove one chassis's suspension on the next preparation without removing its rigid body. */
|
|
246
|
+
removeVehicle(chassis: PhysicsNodeReference): boolean {
|
|
217
247
|
this.assertEditable();
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
if (!chassisNode || !terrainNode) throw new Error('Missing vehicle attachment');
|
|
221
|
-
this.vehicleAttachment = {
|
|
222
|
-
chassis: chassisNode,
|
|
223
|
-
terrain: terrainNode,
|
|
224
|
-
options: structuredClone(options)
|
|
225
|
-
};
|
|
248
|
+
const node = this.resolveNode(chassis);
|
|
249
|
+
if (!node || !this.vehicleAttachments.delete(node)) return false;
|
|
226
250
|
this.dirty = true;
|
|
251
|
+
return true;
|
|
227
252
|
}
|
|
228
253
|
|
|
229
|
-
/** Borrow
|
|
254
|
+
/** Borrow the first registered vehicle's wheel poses after preparation. */
|
|
230
255
|
get vehicleWheelPoses() {
|
|
231
256
|
return this.requireReady().world.vehicleWheelPoses;
|
|
232
257
|
}
|
|
233
258
|
|
|
234
|
-
/**
|
|
235
|
-
|
|
236
|
-
this.requireReady().world.
|
|
259
|
+
/** Borrow a registered chassis's wheel transforms after preparation. */
|
|
260
|
+
getVehicleWheelPoses(chassis: PhysicsNodeReference) {
|
|
261
|
+
return this.requireReady().world.getVehicleWheelPoses(this.getVehicleIndex(chassis));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** Read wheel telemetry for the selected chassis, or for the first chassis by default. */
|
|
265
|
+
readVehicleWheels(chassis?: PhysicsNodeReference) {
|
|
266
|
+
const session = this.requireReady();
|
|
267
|
+
const vehicleIndex = this.getVehicleIndex(chassis);
|
|
268
|
+
return this.exclusive(() => session.withWorld(world => world.readVehicleWheels(vehicleIndex)));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Set controls for the selected chassis, or for the first chassis by default. */
|
|
272
|
+
setVehicleControls(
|
|
273
|
+
throttle: number,
|
|
274
|
+
steering: number,
|
|
275
|
+
brake: number,
|
|
276
|
+
chassis?: PhysicsNodeReference
|
|
277
|
+
): void {
|
|
278
|
+
this.requireReady().world.setVehicleControls(
|
|
279
|
+
throttle,
|
|
280
|
+
steering,
|
|
281
|
+
brake,
|
|
282
|
+
this.getVehicleIndex(chassis)
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** Validate path references before replacing or appending an attachment. */
|
|
287
|
+
private setVehicleAttachment(
|
|
288
|
+
chassis: PhysicsNodeReference,
|
|
289
|
+
terrain: readonly PhysicsNodeReference[],
|
|
290
|
+
options: PhysicsVehicleOptions,
|
|
291
|
+
replace: boolean
|
|
292
|
+
): void {
|
|
293
|
+
this.assertEditable();
|
|
294
|
+
const chassisNode = this.resolveNode(chassis);
|
|
295
|
+
if (!chassisNode || (!replace && this.vehicleAttachments.has(chassisNode)))
|
|
296
|
+
throw new Error('Missing or duplicate vehicle chassis');
|
|
297
|
+
const terrainNodes = terrain.map(reference => {
|
|
298
|
+
const terrainNode = this.resolveNode(reference);
|
|
299
|
+
if (!terrainNode) throw new Error('Missing vehicle terrain');
|
|
300
|
+
return terrainNode;
|
|
301
|
+
});
|
|
302
|
+
if (
|
|
303
|
+
!terrainNodes.length ||
|
|
304
|
+
terrainNodes.length > 4 ||
|
|
305
|
+
new Set(terrainNodes).size !== terrainNodes.length
|
|
306
|
+
)
|
|
307
|
+
throw new Error('Vehicle requires one to four distinct terrain nodes');
|
|
308
|
+
const tuning = structuredClone(options);
|
|
309
|
+
if (replace) this.vehicleAttachments.clear();
|
|
310
|
+
this.vehicleAttachments.set(chassisNode, {terrain: terrainNodes, options: tuning});
|
|
311
|
+
this.dirty = true;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** Resolve a chassis to the vehicle slot of the compiled world. */
|
|
315
|
+
private getVehicleIndex(reference?: PhysicsNodeReference): number {
|
|
316
|
+
if (reference === undefined) return 0;
|
|
317
|
+
const node = this.resolveNode(reference);
|
|
318
|
+
const vehicleIndex = node && this.vehicleIndices.get(node);
|
|
319
|
+
if (vehicleIndex === undefined) throw new Error('Vehicle chassis is not attached');
|
|
320
|
+
return vehicleIndex;
|
|
237
321
|
}
|
|
238
322
|
|
|
239
323
|
addJoint(options: PhysicsJointOptions): ScenegraphJoint {
|
|
@@ -274,28 +358,41 @@ export class PhysicsController {
|
|
|
274
358
|
this.worldOptions,
|
|
275
359
|
this.joints
|
|
276
360
|
);
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
const terrain = scene.definition.bodies.get(this.vehicleAttachment.terrain);
|
|
361
|
+
const vehicleIndices = new Map<ScenegraphNode, number>();
|
|
362
|
+
if (this.vehicleAttachments.size) {
|
|
280
363
|
const bodies = scene.definition.world.bodies;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
(
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
.
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
364
|
+
const colliderOffsets: number[] = [];
|
|
365
|
+
let offset = 0;
|
|
366
|
+
for (const body of bodies) {
|
|
367
|
+
colliderOffsets.push(offset);
|
|
368
|
+
offset += body.colliders?.length ?? 1;
|
|
369
|
+
}
|
|
370
|
+
scene.definition.world.vehicles = Array.from(
|
|
371
|
+
this.vehicleAttachments,
|
|
372
|
+
([node, attachment], index) => {
|
|
373
|
+
const chassis = scene.definition.bodies.get(node);
|
|
374
|
+
if (chassis === undefined)
|
|
375
|
+
throw new Error('Vehicle chassis requires a registered body');
|
|
376
|
+
const terrainColliders = attachment.terrain.map(terrainNode => {
|
|
377
|
+
const terrain = scene.definition.bodies.get(terrainNode);
|
|
378
|
+
if (terrain === undefined || (bodies[terrain].colliders?.length ?? 1) !== 1)
|
|
379
|
+
throw new Error('Vehicle terrain nodes require one registered collider each');
|
|
380
|
+
return colliderOffsets[terrain];
|
|
381
|
+
});
|
|
382
|
+
vehicleIndices.set(node, index);
|
|
383
|
+
return {
|
|
384
|
+
...attachment.options,
|
|
385
|
+
chassis,
|
|
386
|
+
terrainCollider: terrainColliders[0],
|
|
387
|
+
additionalTerrainColliders: terrainColliders.slice(1)
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
);
|
|
295
391
|
}
|
|
296
392
|
if (this.session) await this.session.rebuild(async () => scene, preserveState);
|
|
297
393
|
else this.session = await ScenegraphPhysicsSession.create(this.device, scene);
|
|
298
394
|
this.indices = scene.definition.bodies;
|
|
395
|
+
this.vehicleIndices = vehicleIndices;
|
|
299
396
|
this.manualTargets.clear();
|
|
300
397
|
this.accumulator = 0;
|
|
301
398
|
this.dirty = false;
|
|
@@ -370,6 +467,8 @@ export class PhysicsController {
|
|
|
370
467
|
this.session = undefined;
|
|
371
468
|
this.handles.clear();
|
|
372
469
|
this.definitions.clear();
|
|
470
|
+
this.vehicleAttachments.clear();
|
|
471
|
+
this.vehicleIndices.clear();
|
|
373
472
|
this.manualTargets.clear();
|
|
374
473
|
this.joints.length = 0;
|
|
375
474
|
this.indices = new Map();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
import {CubeGeometry, GroupNode, ScenegraphNode, type Geometry} from '../../index';
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import {makeConvexHullGeometry, makeTriangleMeshGeometry} from '@luma.gl/graph/gpu-physics';
|
|
7
7
|
import {normalizeRigidBodyRotation, type GPURigidBody} from '@luma.gl/graph/gpu-physics';
|
|
8
8
|
import type {GPURigidBodyBounds} from '@luma.gl/graph/gpu-physics';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {assert, type Device, type CommandEncoder} from '@luma.gl/core';
|
|
6
|
-
import {Vector3} from '@math.gl/core';
|
|
6
|
+
import {Vector3} from '@math.gl/core/matrix';
|
|
7
7
|
import type {ScenegraphNode} from '../../index';
|
|
8
8
|
import {GPUCommandGraph} from '@luma.gl/graph/gpu-core';
|
|
9
9
|
import {
|
|
@@ -227,14 +227,30 @@ export class ScenegraphPhysicsInstance {
|
|
|
227
227
|
}
|
|
228
228
|
const replacement = await compile(this.device, props);
|
|
229
229
|
try {
|
|
230
|
-
if (preserveState
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
)
|
|
237
|
-
|
|
230
|
+
if (preserveState) {
|
|
231
|
+
const previousProps = this.definition.world;
|
|
232
|
+
const previousVehicles =
|
|
233
|
+
previousProps.vehicles ?? (previousProps.vehicle ? [previousProps.vehicle] : []);
|
|
234
|
+
const vehicles = props.vehicles ?? (props.vehicle ? [props.vehicle] : []);
|
|
235
|
+
const previousVehicleIndices = new Map(
|
|
236
|
+
previousVehicles.map((vehicle, index) => [vehicle.chassis, index])
|
|
237
|
+
);
|
|
238
|
+
const vehicleIndices = new Map(
|
|
239
|
+
vehicles.map((vehicle, index) => [vehicle.chassis, index])
|
|
240
|
+
);
|
|
241
|
+
for (const [node, bodyIndex] of authored.bodies) {
|
|
242
|
+
const previousBodyIndex = this.definition.bodies.get(node);
|
|
243
|
+
const vehicleIndex = vehicleIndices.get(bodyIndex);
|
|
244
|
+
const previousVehicleIndex =
|
|
245
|
+
previousBodyIndex === undefined
|
|
246
|
+
? undefined
|
|
247
|
+
: previousVehicleIndices.get(previousBodyIndex);
|
|
248
|
+
if (vehicleIndex !== undefined && previousVehicleIndex !== undefined)
|
|
249
|
+
replacement.world.copyVehicleMotionFrom(
|
|
250
|
+
this.world,
|
|
251
|
+
vehicleIndex,
|
|
252
|
+
previousVehicleIndex
|
|
253
|
+
);
|
|
238
254
|
}
|
|
239
255
|
}
|
|
240
256
|
prepare?.(replacement.world);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import {GroupNode, decomposePhysicsTransform, type ScenegraphNode} from '../../index';
|
|
7
7
|
import {scaleRigidBodyShape} from '@luma.gl/graph/gpu-physics';
|
|
8
8
|
import type {GPURigidBodyWorld} from '@luma.gl/graph/gpu-physics';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import type {InteractivityPropertyAdapter} from '../../index';
|
|
7
7
|
import type {GPURigidBodyWorld, GPURigidBodyParameters} from '@luma.gl/graph/gpu-physics';
|
|
8
8
|
import type {GPURigidBodyGeneralConstraint} from '@luma.gl/graph/gpu-physics';
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {Buffer, type CommandEncoder, type Device} from '@luma.gl/core';
|
|
6
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
7
|
+
import {Computation} from '../../compute/computation';
|
|
8
|
+
import type {SkinBinding, SkinController} from '../../scenegraph/controllers/skin-controller';
|
|
9
|
+
import type {ScenegraphPhysicsPublication} from './scenegraph-publication';
|
|
10
|
+
|
|
11
|
+
/** Writes the same mesh-local matrices consumed by the standard skin shader. */
|
|
12
|
+
const PALETTE_SOURCE = /* wgsl */ `
|
|
13
|
+
@group(0) @binding(0) var<storage, read> bodyPoses: array<mat4x4<f32>>;
|
|
14
|
+
@group(0) @binding(1) var<storage, read> bodyIndices: array<u32>;
|
|
15
|
+
@group(0) @binding(2) var<storage, read> paletteTransforms: array<mat4x4<f32>>;
|
|
16
|
+
@group(0) @binding(3) var<storage, read_write> jointPalette: array<mat4x4<f32>>;
|
|
17
|
+
|
|
18
|
+
@compute @workgroup_size(32)
|
|
19
|
+
fn main(@builtin(global_invocation_id) invocation: vec3<u32>) {
|
|
20
|
+
let joint = invocation.x;
|
|
21
|
+
if (joint >= arrayLength(&bodyIndices)) { return; }
|
|
22
|
+
jointPalette[joint] = paletteTransforms[0] * bodyPoses[bodyIndices[joint]]
|
|
23
|
+
* paletteTransforms[joint + 1];
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
/** Connects a physics publication to an existing WebGPU skin palette. */
|
|
28
|
+
export class ScenegraphRagdoll {
|
|
29
|
+
/** One body index for each skin joint, in original palette order. */
|
|
30
|
+
private readonly indices: Buffer;
|
|
31
|
+
/** Inverse mesh transform followed by body-local joint and inverse bind transforms. */
|
|
32
|
+
private readonly transforms: Buffer;
|
|
33
|
+
/** Borrowed storage palette owned by the SkinController. */
|
|
34
|
+
private readonly palette: Buffer;
|
|
35
|
+
/** Compute pipeline used exclusively to transfer solved poses to this skin. */
|
|
36
|
+
private readonly computation: Computation;
|
|
37
|
+
/** Identifies the publication revision from which the joint mappings were built. */
|
|
38
|
+
private publication?: ScenegraphPhysicsPublication;
|
|
39
|
+
/** Releases exclusive GPU write access to the palette. */
|
|
40
|
+
private releasePalette?: () => void;
|
|
41
|
+
|
|
42
|
+
/** Use an existing skin and its WebGPU storage palette. The caller owns its physics session. */
|
|
43
|
+
constructor(
|
|
44
|
+
device: Device,
|
|
45
|
+
private readonly skins: SkinController,
|
|
46
|
+
private readonly binding: SkinBinding
|
|
47
|
+
) {
|
|
48
|
+
if (
|
|
49
|
+
device.type !== 'webgpu' ||
|
|
50
|
+
!(binding.skinJointMatrices instanceof Buffer) ||
|
|
51
|
+
!binding.joints.length ||
|
|
52
|
+
!skins.bindings.includes(binding)
|
|
53
|
+
) {
|
|
54
|
+
throw new Error('ScenegraphRagdoll requires a WebGPU storage skin palette');
|
|
55
|
+
}
|
|
56
|
+
this.palette = binding.skinJointMatrices;
|
|
57
|
+
this.computation = new Computation(device, {id: 'ragdoll-palette', source: PALETTE_SOURCE});
|
|
58
|
+
this.indices = device.createBuffer({
|
|
59
|
+
id: 'ragdoll-body-indices',
|
|
60
|
+
byteLength: binding.joints.length * 4,
|
|
61
|
+
usage: Buffer.STORAGE | Buffer.COPY_DST
|
|
62
|
+
});
|
|
63
|
+
this.transforms = device.createBuffer({
|
|
64
|
+
id: 'ragdoll-palette-transforms',
|
|
65
|
+
byteLength: (binding.joints.length + 1) * 64,
|
|
66
|
+
usage: Buffer.STORAGE | Buffer.COPY_DST
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Encode after physics and before drawing. Supply the full mesh matrix in the publication's origin-relative frame. */
|
|
71
|
+
encode(
|
|
72
|
+
encoder: CommandEncoder,
|
|
73
|
+
publication: ScenegraphPhysicsPublication,
|
|
74
|
+
meshWorldMatrix: Matrix4
|
|
75
|
+
): void {
|
|
76
|
+
if (publication !== this.publication) this.bindPublication(publication);
|
|
77
|
+
/** Only the authored mesh frame is uploaded each frame. The solved transforms stay on the GPU. */
|
|
78
|
+
const inverseMesh = new Float32Array(meshWorldMatrix.clone().invert());
|
|
79
|
+
this.transforms.write(inverseMesh);
|
|
80
|
+
this.computation.predraw(encoder);
|
|
81
|
+
/** Schedule palette generation after physics pose publication in the same command buffer. */
|
|
82
|
+
const pass = encoder.beginComputePass({id: 'ragdoll-skinning'});
|
|
83
|
+
this.computation.dispatch(pass, Math.ceil(this.binding.joints.length / 32));
|
|
84
|
+
pass.end();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Return palette control to the scenegraph animator before sampling a fresh animation pose. */
|
|
88
|
+
reset(): void {
|
|
89
|
+
this.releasePalette?.();
|
|
90
|
+
this.releasePalette = undefined;
|
|
91
|
+
this.publication = undefined;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Release compute resources. Destroy the ragdoll before its shared skin controller. */
|
|
95
|
+
destroy(): void {
|
|
96
|
+
this.reset();
|
|
97
|
+
this.computation.destroy();
|
|
98
|
+
this.indices.destroy();
|
|
99
|
+
this.transforms.destroy();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Resolve joints through the same scenegraph publication used by rigid rendering. */
|
|
103
|
+
private bindPublication(publication: ScenegraphPhysicsPublication): void {
|
|
104
|
+
/** Authoring resolves each joint to its closest ancestor body and body-local frame. */
|
|
105
|
+
const indices = new Uint32Array(this.binding.joints.length);
|
|
106
|
+
/** Fold each inverse bind matrix into its body-local joint frame once per handoff. */
|
|
107
|
+
const transforms = new Float32Array(this.binding.joints.length * 16);
|
|
108
|
+
for (const [index, joint] of this.binding.joints.entries()) {
|
|
109
|
+
/** Bones and rigid joint attachment nodes remain distinct scenegraph objects. */
|
|
110
|
+
const target = publication.bindings.get(joint);
|
|
111
|
+
if (!target) throw new Error(`No published rigid body for skin joint ${joint.id}`);
|
|
112
|
+
indices[index] = target.body;
|
|
113
|
+
/** The publication's transform retains authored scale and mesh-to-body offsets. */
|
|
114
|
+
const transform = target.localMatrix.clone();
|
|
115
|
+
if (this.binding.inverseBindMatrices) {
|
|
116
|
+
transform.multiplyRight(
|
|
117
|
+
this.binding.inverseBindMatrices.subarray(index * 16, index * 16 + 16)
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
transforms.set(transform, index * 16);
|
|
121
|
+
}
|
|
122
|
+
this.releasePalette ??= this.skins.claimGPUPalette(this.binding);
|
|
123
|
+
this.indices.write(indices);
|
|
124
|
+
this.transforms.write(transforms, 64);
|
|
125
|
+
this.computation.setBindings({
|
|
126
|
+
bodyPoses: publication.matrices,
|
|
127
|
+
bodyIndices: this.indices,
|
|
128
|
+
paletteTransforms: this.transforms,
|
|
129
|
+
jointPalette: this.palette
|
|
130
|
+
});
|
|
131
|
+
this.publication = publication;
|
|
132
|
+
}
|
|
133
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -373,3 +373,5 @@ export {deformPositions} from './animation/deform-positions';
|
|
|
373
373
|
export {createAreaLightLTCTextures} from './lighting/ltc-textures';
|
|
374
374
|
|
|
375
375
|
export {makeGPUVectorGeometry} from './geometry/gpu-vector-geometry-adapter';
|
|
376
|
+
|
|
377
|
+
export {makeDepthIntervalPlugin} from './shader-plugins/depth-interval';
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
import {assert, type Device, type Texture} from '@luma.gl/core';
|
|
5
5
|
import type {CompositeShaderPass} from '@luma.gl/shaders';
|
|
6
|
-
import {Matrix4
|
|
6
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
7
|
+
import {type NumberArray16} from '@math.gl/core/types';
|
|
7
8
|
import {ShaderPassRenderer} from '../passes/shader-pass-renderer';
|
|
8
9
|
import {ssaoEvaluate} from '../effects/passes/screen-space/ssao';
|
|
9
10
|
import {gtaoEvaluate} from '../effects/passes/screen-space/gtao';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type {CommandEncoder, Device} from '@luma.gl/core';
|
|
6
6
|
import {assert, Buffer} from '@luma.gl/core';
|
|
7
7
|
import {Computation} from '../compute/computation';
|
|
8
|
-
import type {Matrix4Like} from '@math.gl/core';
|
|
8
|
+
import type {Matrix4Like} from '@math.gl/core/matrix';
|
|
9
9
|
|
|
10
10
|
/** Byte layout of each point-light record. The grid ignores the consumer payload. */
|
|
11
11
|
export const CLUSTERED_POINT_LIGHT_LAYOUT = Object.freeze({
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
type CompositeShaderPass,
|
|
9
9
|
type ContactTraceUniforms
|
|
10
10
|
} from '@luma.gl/shaders';
|
|
11
|
-
import {Matrix4
|
|
11
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
12
|
+
import {type NumberArray3, type NumberArray16} from '@math.gl/core/types';
|
|
12
13
|
import {ShaderPassRenderer} from '../passes/shader-pass-renderer';
|
|
13
14
|
import {SHADOW_QUALITY_SETTINGS} from './shadow-quality';
|
|
14
15
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
3
3
|
|
|
4
4
|
import {assert} from '@luma.gl/core';
|
|
5
|
-
import {Matrix4, Vector3} from '@math.gl/core';
|
|
5
|
+
import {Matrix4, Vector3} from '@math.gl/core/matrix';
|
|
6
6
|
import {Geometry, type GeometryAttribute} from '../geometry/geometry';
|
|
7
7
|
|
|
8
8
|
export type LightmapAtlasInput = {
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
Texture,
|
|
10
10
|
type TextureView
|
|
11
11
|
} from '@luma.gl/core';
|
|
12
|
-
import {Matrix4
|
|
12
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
13
|
+
import {type NumberArray3} from '@math.gl/core/types';
|
|
13
14
|
import {PBR_ENVIRONMENT_FRAGMENT_WGSL, pbrEnvironmentFilter} from '@luma.gl/shaders';
|
|
14
15
|
import {ClipSpace} from '../models/clip-space';
|
|
15
16
|
import {ShaderInputs} from '../shader-inputs';
|
|
@@ -11,8 +11,8 @@ import type {
|
|
|
11
11
|
TextureView
|
|
12
12
|
} from '@luma.gl/core';
|
|
13
13
|
import {Device, Texture as TextureResource} from '@luma.gl/core';
|
|
14
|
-
import {Matrix4, radians} from '@math.gl/core';
|
|
15
|
-
import type {NumberArray3, NumberArray16} from '@math.gl/core';
|
|
14
|
+
import {Matrix4, radians} from '@math.gl/core/matrix';
|
|
15
|
+
import type {NumberArray3, NumberArray16} from '@math.gl/core/types';
|
|
16
16
|
import {SHADOW_QUALITY_SETTINGS} from './shadow-quality';
|
|
17
17
|
import type {
|
|
18
18
|
DirectionalShadowLight,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {NumberArray4, NumberArray6, TypedArray} from '@math.gl/core';
|
|
5
|
+
import type {NumberArray4, NumberArray6, TypedArray} from '@math.gl/core/types';
|
|
6
6
|
import {
|
|
7
7
|
type RenderPipelineProps,
|
|
8
8
|
type RenderPipelineParameters,
|
package/src/model/model.ts
CHANGED
|
@@ -2,7 +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';
|
|
5
|
+
import type {Geometry} from '@math.gl/geometry/primitives';
|
|
6
6
|
import type {CommandEncoder, Device, Binding, BindingsByGroup} from '@luma.gl/core';
|
|
7
7
|
import {
|
|
8
8
|
GPUVectorModel,
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {Buffer, Device, type RenderPass, type RenderPipelineParameters} from '@luma.gl/core';
|
|
6
|
-
import {Matrix4
|
|
6
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
7
|
+
import {type NumericArray} from '@math.gl/core/types';
|
|
7
8
|
import type {DirectionalLight, Light, PointLight, ShaderModule, SpotLight} from '@luma.gl/shaders';
|
|
8
9
|
import {Model, type ModelProps} from '../model/model';
|
|
9
10
|
import type {ModelDrawOptions} from '../model/gpu-vector-model';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {Device, Framebuffer} from '@luma.gl/core';
|
|
6
6
|
import {picking} from '@luma.gl/shaders';
|
|
7
7
|
import {ShaderInputs} from '../../shader-inputs';
|
|
8
|
-
import {NumberArray3} from '@math.gl/core';
|
|
8
|
+
import {NumberArray3} from '@math.gl/core/types';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Helper class for using the legacy picking module
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {NumberArray4} from '@math.gl/core';
|
|
5
|
+
import type {NumberArray4} from '@math.gl/core/types';
|
|
6
6
|
import type {ShaderModule} from '@luma.gl/shaders';
|
|
7
7
|
|
|
8
8
|
/** Default color for auto highlight, a cyan color */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import {assert} from '@luma.gl/core';
|
|
6
6
|
import {GroupNode} from '../group-node';
|
|
7
|
-
import {Matrix4, Vector3} from '@math.gl/core';
|
|
7
|
+
import {Matrix4, Vector3} from '@math.gl/core/matrix';
|
|
8
8
|
import type {AreaLight} from '@luma.gl/shaders';
|
|
9
9
|
|
|
10
10
|
export type AreaLightDefinition = {
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import {assert} from '@luma.gl/core';
|
|
6
6
|
import {GroupNode} from '../group-node';
|
|
7
7
|
import {ScenegraphNode} from '../scenegraph-node';
|
|
8
|
-
import {Matrix4, Vector3
|
|
8
|
+
import {Matrix4, Vector3} from '@math.gl/core/matrix';
|
|
9
|
+
import {type NumericArray} from '@math.gl/core/types';
|
|
9
10
|
|
|
10
11
|
/** Camera-facing surface orientation and overlay behavior. */
|
|
11
12
|
export type BillboardOrientation = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {Matrix4} from '@math.gl/core';
|
|
5
|
+
import {Matrix4} from '@math.gl/core/matrix';
|
|
6
6
|
import {ScenegraphNode} from '../scenegraph-node';
|
|
7
7
|
import {GroupNode} from '../group-node';
|
|
8
8
|
import {decomposePhysicsTransform} from '../physics-transforms';
|