@adobe/data-gpu 0.9.75 → 0.9.76
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/CLAUDE.md +9 -0
- package/README.md +36 -0
- package/dist/core/core-plugin.d.ts +1 -1
- package/dist/core/public.d.ts +2 -0
- package/dist/core/public.js +4 -0
- package/dist/core/public.js.map +1 -0
- package/dist/graphics/animation/animation-data-plugin.d.ts +8 -0
- package/dist/graphics/animation/animation-plugin.d.ts +10 -2
- package/dist/graphics/camera/camera-plugin.d.ts +3 -3
- package/dist/graphics/camera/orbit/attach-orbit-drag.d.ts +1 -21
- package/dist/graphics/camera/orbit/attach-orbit-drag.js +0 -10
- package/dist/graphics/camera/orbit/attach-orbit-drag.js.map +1 -1
- package/dist/graphics/camera/orbit/orbit-data-plugin.d.ts +6 -6
- package/dist/graphics/camera/orbit/orbit-data-plugin.js +1 -1
- package/dist/graphics/camera/orbit/orbit-data-plugin.js.map +1 -1
- package/dist/graphics/camera/orbit/orbit-drag-service.d.ts +11 -0
- package/dist/graphics/camera/orbit/orbit-drag-service.js +3 -0
- package/dist/graphics/camera/orbit/orbit-drag-service.js.map +1 -0
- package/dist/graphics/camera/orbit/orbit-plugin.d.ts +6 -6
- package/dist/graphics/camera/orbit/orbit-system-plugin.d.ts +8 -8
- package/dist/graphics/camera/orbit/orbit-system-plugin.js +6 -9
- package/dist/graphics/camera/orbit/orbit-system-plugin.js.map +1 -1
- package/dist/graphics/camera/orbit/orbit.d.ts +5 -5
- package/dist/graphics/camera/orbit/public.d.ts +2 -2
- package/dist/graphics/camera/orbit/public.js +2 -1
- package/dist/graphics/camera/orbit/public.js.map +1 -1
- package/dist/graphics/graphics-plugin.d.ts +1 -1
- package/dist/graphics/index.d.ts +1 -0
- package/dist/graphics/index.js +3 -0
- package/dist/graphics/index.js.map +1 -0
- package/dist/graphics/picking/picking-plugin.d.ts +9871 -1912
- package/dist/graphics/picking/picking-plugin.js +3 -3
- package/dist/graphics/picking/picking-plugin.js.map +1 -1
- package/dist/graphics/public.d.ts +38 -0
- package/dist/graphics/public.js +40 -0
- package/dist/graphics/public.js.map +1 -0
- package/dist/graphics/rendering/bone-collider-plugin.d.ts +2967 -486
- package/dist/graphics/rendering/bone-collider-plugin.js +13 -12
- package/dist/graphics/rendering/bone-collider-plugin.js.map +1 -1
- package/dist/graphics/rendering/display-transform-plugin.d.ts +2 -0
- package/dist/graphics/rendering/display-transform-plugin.js +2 -2
- package/dist/graphics/rendering/display-transform-plugin.js.map +1 -1
- package/dist/graphics/rendering/ibl-render/ibl-render-plugin.d.ts +2857 -403
- package/dist/graphics/rendering/ibl-render/ibl-render-plugin.js +9 -9
- package/dist/graphics/rendering/ibl-render/ibl-render-plugin.js.map +1 -1
- package/dist/graphics/rendering/interpolation-plugin.d.ts +1040 -156
- package/dist/graphics/rendering/jolt-ragdoll-plugin.d.ts +3017 -538
- package/dist/graphics/rendering/jolt-ragdoll-plugin.js +6 -6
- package/dist/graphics/rendering/jolt-ragdoll-plugin.js.map +1 -1
- package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu-plugin.d.ts +1123 -0
- package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu-plugin.js +79 -0
- package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu-plugin.js.map +1 -0
- package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu.test.d.ts +1 -0
- package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu.test.js +18 -0
- package/dist/graphics/rendering/material-palette-gpu/material-palette-gpu.test.js.map +1 -0
- package/dist/graphics/rendering/material-palette-gpu/material-palette.d.ts +25 -0
- package/dist/graphics/rendering/material-palette-gpu/material-palette.js +27 -0
- package/dist/graphics/rendering/material-palette-gpu/material-palette.js.map +1 -0
- package/dist/graphics/rendering/material-palette-gpu/palette-bind-group.d.ts +3 -0
- package/dist/graphics/rendering/material-palette-gpu/palette-bind-group.js +22 -0
- package/dist/graphics/rendering/material-palette-gpu/palette-bind-group.js.map +1 -0
- package/dist/graphics/rendering/model-collider-plugin.d.ts +2903 -663
- package/dist/graphics/rendering/model-collider-plugin.js +11 -34
- package/dist/graphics/rendering/model-collider-plugin.js.map +1 -1
- package/dist/graphics/rendering/pbr-core-plugin.d.ts +16 -8
- package/dist/graphics/rendering/pbr-core-plugin.js +16 -19
- package/dist/graphics/rendering/pbr-core-plugin.js.map +1 -1
- package/dist/graphics/rendering/pbr-render/pbr-factor-render-plugin.d.ts +3514 -0
- package/dist/graphics/rendering/pbr-render/pbr-factor-render-plugin.js +189 -0
- package/dist/graphics/rendering/pbr-render/pbr-factor-render-plugin.js.map +1 -0
- package/dist/graphics/rendering/pbr-render/pbr-factor-shader.wgsl.d.ts +7 -0
- package/dist/graphics/rendering/pbr-render/pbr-factor-shader.wgsl.js +124 -0
- package/dist/graphics/rendering/pbr-render/pbr-factor-shader.wgsl.js.map +1 -0
- package/dist/graphics/rendering/pbr-render/physics-bridge-plugin.d.ts +769 -571
- package/dist/graphics/rendering/pbr-render/physics-bridge-plugin.js +98 -79
- package/dist/graphics/rendering/pbr-render/physics-bridge-plugin.js.map +1 -1
- package/dist/graphics/rendering/pbr-render/primitive-render-shared.d.ts +43 -0
- package/dist/graphics/rendering/pbr-render/primitive-render-shared.js +59 -0
- package/dist/graphics/rendering/pbr-render/primitive-render-shared.js.map +1 -0
- package/dist/graphics/rendering/skinning/skinning-plugin.d.ts +2930 -270
- package/dist/graphics/rendering/skinning/skinning-plugin.js +19 -40
- package/dist/graphics/rendering/skinning/skinning-plugin.js.map +1 -1
- package/dist/graphics/scene/model/geometry/public.d.ts +1 -0
- package/dist/graphics/scene/model/mesh/mesh.d.ts +13 -0
- package/dist/graphics/scene/model/mesh/mesh.js +3 -0
- package/dist/graphics/scene/model/mesh/mesh.js.map +1 -0
- package/dist/graphics/scene/model/mesh/public.d.ts +1 -0
- package/dist/graphics/scene/model/mesh/public.js +3 -0
- package/dist/graphics/scene/model/mesh/public.js.map +1 -0
- package/dist/graphics/scene/model/mesh-plugin.d.ts +5177 -0
- package/dist/graphics/scene/model/mesh-plugin.js +87 -0
- package/dist/graphics/scene/model/mesh-plugin.js.map +1 -0
- package/dist/graphics/scene/model/model-loader-plugin.d.ts +2728 -295
- package/dist/graphics/scene/model/model-loader-plugin.js +24 -42
- package/dist/graphics/scene/model/model-loader-plugin.js.map +1 -1
- package/dist/graphics/scene/model/model-plugin.d.ts +1 -352
- package/dist/graphics/scene/model/model-plugin.js +1 -37
- package/dist/graphics/scene/model/model-plugin.js.map +1 -1
- package/dist/graphics/scene/model/model.d.ts +2 -6
- package/dist/graphics/scene/model/model.js.map +1 -1
- package/dist/graphics/scene/model/public.d.ts +1 -1
- package/dist/graphics/scene/model/public.js +2 -1
- package/dist/graphics/scene/model/public.js.map +1 -1
- package/dist/graphics/scene/model/shape/bounds-from-shape-mesh.d.ts +4 -0
- package/dist/graphics/scene/model/shape/bounds-from-shape-mesh.js +25 -0
- package/dist/graphics/scene/model/shape/bounds-from-shape-mesh.js.map +1 -0
- package/dist/graphics/scene/model/shape/shape-geometry-plugin.d.ts +233 -386
- package/dist/graphics/scene/model/shape/shape-geometry-plugin.js +87 -18
- package/dist/graphics/scene/model/shape/shape-geometry-plugin.js.map +1 -1
- package/dist/graphics/scene/model/shape/shape-spec.d.ts +17 -0
- package/dist/graphics/scene/model/shape/shape-spec.js +3 -0
- package/dist/graphics/scene/model/shape/shape-spec.js.map +1 -0
- package/dist/graphics/scene/model/world-bounds-plugin.d.ts +2670 -245
- package/dist/graphics/scene/model/world-bounds-plugin.js +6 -25
- package/dist/graphics/scene/model/world-bounds-plugin.js.map +1 -1
- package/dist/graphics/scene/node/node-data-plugin.d.ts +15 -4
- package/dist/graphics/scene/node/node-data-plugin.js +12 -5
- package/dist/graphics/scene/node/node-data-plugin.js.map +1 -1
- package/dist/graphics/scene/node/node-data-plugin.test.d.ts +1 -0
- package/dist/graphics/scene/node/node-data-plugin.test.js +40 -0
- package/dist/graphics/scene/node/node-data-plugin.test.js.map +1 -0
- package/dist/graphics/scene/node/node-plugin.d.ts +8 -1
- package/dist/graphics/scene/node/transform-plugin.d.ts +8 -1
- package/dist/graphics/scene/scene-plugin.d.ts +2353 -100
- package/dist/graphics/scene/scene-plugin.js +3 -3
- package/dist/graphics/scene/scene-plugin.js.map +1 -1
- package/dist/graphics/scene/scene-uniforms/scene-uniforms-plugin.d.ts +3 -3
- package/dist/index.d.ts +1 -53
- package/dist/index.js +1 -54
- package/dist/index.js.map +1 -1
- package/dist/material/assemble-material-row.d.ts +4 -0
- package/dist/material/assemble-material-row.js +22 -0
- package/dist/material/assemble-material-row.js.map +1 -0
- package/dist/material/definitions.d.ts +833 -0
- package/dist/material/definitions.js +423 -0
- package/dist/material/definitions.js.map +1 -0
- package/dist/material/emission-mode.d.ts +8 -0
- package/dist/material/emission-mode.js +9 -0
- package/dist/material/emission-mode.js.map +1 -0
- package/dist/material/index.d.ts +1 -0
- package/dist/material/index.js +3 -0
- package/dist/material/index.js.map +1 -0
- package/dist/material/json/from-json-string.d.ts +2 -0
- package/dist/material/json/from-json-string.js +12 -0
- package/dist/material/json/from-json-string.js.map +1 -0
- package/dist/material/json/from-json.d.ts +10 -0
- package/dist/material/json/from-json.js +16 -0
- package/dist/material/json/from-json.js.map +1 -0
- package/dist/material/json/from-json.test.d.ts +1 -0
- package/dist/material/json/from-json.test.js +46 -0
- package/dist/material/json/from-json.test.js.map +1 -0
- package/dist/material/json/is-properties-json.d.ts +2 -0
- package/dist/material/json/is-properties-json.js +65 -0
- package/dist/material/json/is-properties-json.js.map +1 -0
- package/dist/material/json/library-json.d.ts +3 -0
- package/dist/material/json/library-json.js +2 -0
- package/dist/material/json/library-json.js.map +1 -0
- package/dist/material/json/load-json.d.ts +7 -0
- package/dist/material/json/load-json.js +10 -0
- package/dist/material/json/load-json.js.map +1 -0
- package/dist/material/json/properties-json.d.ts +25 -0
- package/dist/material/json/properties-json.js +2 -0
- package/dist/material/json/properties-json.js.map +1 -0
- package/dist/material/json/public.d.ts +9 -0
- package/dist/material/json/public.js +6 -0
- package/dist/material/json/public.js.map +1 -0
- package/dist/material/json/to-definition.d.ts +5 -0
- package/dist/material/json/to-definition.js +65 -0
- package/dist/material/json/to-definition.js.map +1 -0
- package/dist/material/material-by-name-lookup.d.ts +11 -0
- package/dist/material/material-by-name-lookup.js +3 -0
- package/dist/material/material-by-name-lookup.js.map +1 -0
- package/dist/material/material-defaults.d.ts +23 -0
- package/dist/material/material-defaults.js +25 -0
- package/dist/material/material-defaults.js.map +1 -0
- package/dist/material/material-definition.d.ts +3 -0
- package/dist/material/material-definition.js +2 -0
- package/dist/material/material-definition.js.map +1 -0
- package/dist/material/material-name.d.ts +2 -0
- package/dist/material/material-name.js +2 -0
- package/dist/material/material-name.js.map +1 -0
- package/dist/material/material-plugin.d.ts +891 -22
- package/dist/material/material-plugin.js +46 -21
- package/dist/material/material-plugin.js.map +1 -1
- package/dist/material/material-plugin.test.d.ts +1 -0
- package/dist/material/material-plugin.test.js +87 -0
- package/dist/material/material-plugin.test.js.map +1 -0
- package/dist/material/material.d.ts +27 -29
- package/dist/material/material.js +0 -1
- package/dist/material/material.js.map +1 -1
- package/dist/material/public.d.ts +12 -2
- package/dist/material/public.js +12 -2
- package/dist/material/public.js.map +1 -1
- package/dist/material/require-material.d.ts +4 -0
- package/dist/material/require-material.js +10 -0
- package/dist/material/require-material.js.map +1 -0
- package/dist/material/standard-material-names.d.ts +2 -0
- package/dist/material/standard-material-names.js +4 -0
- package/dist/material/standard-material-names.js.map +1 -0
- package/dist/material/standard-materials.d.ts +1 -1
- package/dist/material/standard-materials.js +17 -24
- package/dist/material/standard-materials.js.map +1 -1
- package/dist/material/stress-strain-curve/create.d.ts +8 -0
- package/dist/material/stress-strain-curve/create.js +2 -0
- package/dist/material/stress-strain-curve/create.js.map +1 -0
- package/dist/material/stress-strain-curve/public.d.ts +2 -0
- package/dist/material/stress-strain-curve/public.js +3 -0
- package/dist/material/stress-strain-curve/public.js.map +1 -0
- package/dist/material/stress-strain-curve/schema.d.ts +52 -0
- package/dist/material/stress-strain-curve/schema.js +19 -0
- package/dist/material/stress-strain-curve/schema.js.map +1 -0
- package/dist/material/stress-strain-curve/schema.test.d.ts +1 -0
- package/dist/material/stress-strain-curve/schema.test.js +18 -0
- package/dist/material/stress-strain-curve/schema.test.js.map +1 -0
- package/dist/material/stress-strain-curve/stress-strain-curve.d.ts +4 -0
- package/dist/material/stress-strain-curve/stress-strain-curve.js +2 -0
- package/dist/material/stress-strain-curve/stress-strain-curve.js.map +1 -0
- package/dist/physics/body/collider-shape/mass-from-volume.d.ts +2 -0
- package/dist/physics/body/collider-shape/mass-from-volume.js +4 -0
- package/dist/physics/body/collider-shape/mass-from-volume.js.map +1 -0
- package/dist/physics/body/collider-shape/mass-from-volume.test.d.ts +1 -0
- package/dist/physics/body/collider-shape/mass-from-volume.test.js +8 -0
- package/dist/physics/body/collider-shape/mass-from-volume.test.js.map +1 -0
- package/dist/physics/collider-primitive-render-archetype.d.ts +2 -0
- package/dist/physics/collider-primitive-render-archetype.js +3 -0
- package/dist/physics/collider-primitive-render-archetype.js.map +1 -0
- package/dist/physics/collider-primitive-render-archetypes.d.ts +2 -0
- package/dist/physics/collider-primitive-render-archetypes.js +9 -0
- package/dist/physics/collider-primitive-render-archetypes.js.map +1 -0
- package/dist/physics/index.d.ts +1 -0
- package/dist/physics/index.js +3 -0
- package/dist/physics/index.js.map +1 -0
- package/dist/physics/is-voxel-shape-physics-pending.d.ts +3 -0
- package/dist/physics/is-voxel-shape-physics-pending.js +7 -0
- package/dist/physics/is-voxel-shape-physics-pending.js.map +1 -0
- package/dist/physics/physics-clock/physics-clock.d.ts +15 -0
- package/dist/physics/physics-clock/physics-clock.js +3 -0
- package/dist/physics/physics-clock/physics-clock.js.map +1 -0
- package/dist/physics/physics-clock-plugin.d.ts +2 -22
- package/dist/physics/physics-clock-plugin.js +0 -2
- package/dist/physics/physics-clock-plugin.js.map +1 -1
- package/dist/physics/physics-clock.test.js.map +1 -1
- package/dist/physics/physics-data-plugin.d.ts +889 -13
- package/dist/physics/physics-data-plugin.js +8 -6
- package/dist/physics/physics-data-plugin.js.map +1 -1
- package/dist/physics/public.d.ts +21 -0
- package/dist/physics/public.js +23 -0
- package/dist/physics/public.js.map +1 -0
- package/dist/physics/ragdoll/bone-capsule.d.ts +8 -0
- package/dist/physics/ragdoll/bone-capsule.js +3 -0
- package/dist/physics/ragdoll/bone-capsule.js.map +1 -0
- package/dist/physics/ragdoll/fit-bone-capsules-input.d.ts +11 -0
- package/dist/physics/ragdoll/fit-bone-capsules-input.js +3 -0
- package/dist/physics/ragdoll/fit-bone-capsules-input.js.map +1 -0
- package/dist/physics/ragdoll/fit-bone-capsules.d.ts +2 -38
- package/dist/physics/ragdoll/fit-bone-capsules.js +13 -0
- package/dist/physics/ragdoll/fit-bone-capsules.js.map +1 -1
- package/dist/physics/ragdoll/fit-bone-capsules.test.js.map +1 -1
- package/dist/physics/ragdoll/skin-vertices.d.ts +6 -0
- package/dist/physics/ragdoll/skin-vertices.js +3 -0
- package/dist/physics/ragdoll/skin-vertices.js.map +1 -0
- package/dist/physics/rigid-body-components.d.ts +2 -0
- package/dist/physics/rigid-body-components.js +13 -0
- package/dist/physics/rigid-body-components.js.map +1 -0
- package/dist/physics/solvers/jolt-solver-plugin.d.ts +918 -41
- package/dist/physics/solvers/jolt-solver-plugin.js +19 -3
- package/dist/physics/solvers/jolt-solver-plugin.js.map +1 -1
- package/dist/physics/solvers/rapier-solver-plugin.d.ts +918 -41
- package/dist/physics/solvers/rapier-solver-plugin.js +7 -2
- package/dist/physics/solvers/rapier-solver-plugin.js.map +1 -1
- package/dist/physics/solvers/solver-benchmark-options.d.ts +14 -0
- package/dist/physics/solvers/solver-benchmark-options.js +3 -0
- package/dist/physics/solvers/solver-benchmark-options.js.map +1 -0
- package/dist/physics/solvers/solver-benchmark-result.d.ts +15 -0
- package/dist/physics/solvers/solver-benchmark-result.js +3 -0
- package/dist/physics/solvers/solver-benchmark-result.js.map +1 -0
- package/dist/physics/solvers/solver-benchmark.d.ts +2 -43
- package/dist/physics/solvers/solver-benchmark.js.map +1 -1
- package/dist/physics/static-collider-components.d.ts +2 -0
- package/dist/physics/static-collider-components.js +10 -0
- package/dist/physics/static-collider-components.js.map +1 -0
- package/package.json +14 -2
- package/src/core/public.ts +4 -0
- package/src/graphics/camera/orbit/attach-orbit-drag.ts +7 -27
- package/src/graphics/camera/orbit/orbit-data-plugin.ts +1 -1
- package/src/graphics/camera/orbit/orbit-drag-service.ts +13 -0
- package/src/graphics/camera/orbit/orbit-system-plugin.ts +6 -9
- package/src/graphics/camera/orbit/orbit.ts +5 -5
- package/src/graphics/camera/orbit/public.ts +2 -2
- package/src/graphics/index.ts +3 -0
- package/src/graphics/picking/picking-plugin.ts +4 -4
- package/src/graphics/public.ts +40 -0
- package/src/graphics/rendering/bone-collider-plugin.ts +16 -12
- package/src/graphics/rendering/display-transform-plugin.ts +2 -2
- package/src/graphics/rendering/ibl-render/ibl-render-plugin.ts +9 -9
- package/src/graphics/rendering/interpolation.test.ts +1 -1
- package/src/graphics/rendering/jolt-ragdoll-plugin.ts +11 -7
- package/src/graphics/rendering/material-palette-gpu/material-palette-gpu-plugin.ts +86 -0
- package/src/graphics/rendering/material-palette-gpu/material-palette-gpu.test.ts +20 -0
- package/src/graphics/rendering/material-palette-gpu/material-palette.ts +41 -0
- package/src/graphics/rendering/material-palette-gpu/palette-bind-group.ts +24 -0
- package/src/graphics/rendering/model-collider-plugin.ts +19 -35
- package/src/graphics/rendering/pbr-core-plugin.ts +16 -19
- package/src/graphics/rendering/pbr-render/{pbr-render-plugin.ts → pbr-factor-render-plugin.ts} +60 -111
- package/src/graphics/rendering/pbr-render/{pbr-array-shader.wgsl.ts → pbr-factor-shader.wgsl.ts} +19 -40
- package/src/graphics/rendering/pbr-render/physics-bridge-plugin.ts +95 -69
- package/src/graphics/rendering/pbr-render/primitive-render-shared.ts +76 -0
- package/src/graphics/rendering/skinning/skinning-plugin.ts +23 -41
- package/src/graphics/scene/model/geometry/public.ts +1 -1
- package/src/graphics/scene/model/mesh/mesh.ts +18 -0
- package/src/graphics/scene/model/mesh/public.ts +3 -0
- package/src/graphics/scene/model/mesh-plugin.ts +102 -0
- package/src/graphics/scene/model/model-loader-plugin.ts +25 -43
- package/src/graphics/scene/model/model-plugin.ts +1 -44
- package/src/graphics/scene/model/model.ts +2 -6
- package/src/graphics/scene/model/public.ts +3 -1
- package/src/graphics/scene/model/shape/bounds-from-shape-mesh.ts +20 -0
- package/src/graphics/scene/model/shape/shape-geometry-plugin.ts +97 -18
- package/src/graphics/scene/model/shape/shape-spec.ts +9 -0
- package/src/graphics/scene/model/world-bounds-plugin.ts +6 -25
- package/src/graphics/scene/node/node-data-plugin.test.ts +47 -0
- package/src/graphics/scene/node/node-data-plugin.ts +12 -5
- package/src/graphics/scene/scene-plugin.ts +3 -3
- package/src/index.ts +1 -70
- package/src/material/assemble-material-row.ts +26 -0
- package/src/material/definitions.ts +427 -0
- package/src/material/emission-mode.ts +11 -0
- package/src/material/index.ts +3 -0
- package/src/material/json/from-json-string.ts +11 -0
- package/src/material/json/from-json.test.ts +50 -0
- package/src/material/json/from-json.ts +23 -0
- package/src/material/json/is-properties-json.ts +77 -0
- package/src/material/json/library-json.ts +4 -0
- package/src/material/json/load-json.ts +15 -0
- package/src/material/json/properties-json.ts +25 -0
- package/src/material/json/public.ts +9 -0
- package/src/material/json/to-definition.ts +70 -0
- package/src/material/material-by-name-lookup.ts +10 -0
- package/src/material/material-defaults.ts +26 -0
- package/src/material/material-definition.ts +4 -0
- package/src/material/material-name.ts +3 -0
- package/src/material/material-plugin.test.ts +97 -0
- package/src/material/material-plugin.ts +67 -39
- package/src/material/material.ts +35 -34
- package/src/material/public.ts +12 -2
- package/src/material/require-material.ts +15 -0
- package/src/material/standard-material-names.ts +4 -0
- package/src/material/standard-materials.ts +21 -27
- package/src/material/stress-strain-curve/create.ts +9 -0
- package/src/material/stress-strain-curve/public.ts +2 -0
- package/src/material/stress-strain-curve/schema.test.ts +20 -0
- package/src/material/stress-strain-curve/schema.ts +20 -0
- package/src/material/stress-strain-curve/stress-strain-curve.ts +11 -0
- package/src/physics/README.md +9 -1
- package/src/physics/body/collider-shape/mass-from-volume.test.ts +8 -0
- package/src/physics/body/collider-shape/mass-from-volume.ts +4 -0
- package/src/physics/collider-primitive-render-archetype.ts +5 -0
- package/src/physics/collider-primitive-render-archetypes.ts +9 -0
- package/src/physics/index.ts +3 -0
- package/src/physics/is-voxel-shape-physics-pending.ts +9 -0
- package/src/physics/physics-clock/physics-clock.ts +17 -0
- package/src/physics/physics-clock-plugin.ts +1 -24
- package/src/physics/physics-clock.test.ts +2 -1
- package/src/physics/physics-data-plugin.ts +8 -6
- package/src/physics/public.ts +23 -0
- package/src/physics/ragdoll/bone-capsule.ts +11 -0
- package/src/physics/ragdoll/fit-bone-capsules-input.ts +14 -0
- package/src/physics/ragdoll/fit-bone-capsules.test.ts +2 -1
- package/src/physics/ragdoll/fit-bone-capsules.ts +2 -27
- package/src/physics/ragdoll/skin-vertices.ts +8 -0
- package/src/physics/rigid-body-components.ts +13 -0
- package/src/physics/solvers/README.md +4 -0
- package/src/physics/solvers/jolt-solver-plugin.ts +19 -5
- package/src/physics/solvers/rapier-solver-plugin.ts +5 -2
- package/src/physics/solvers/solver-benchmark-options.ts +16 -0
- package/src/physics/solvers/solver-benchmark-result.ts +17 -0
- package/src/physics/solvers/solver-benchmark.ts +2 -35
- package/src/physics/static-collider-components.ts +10 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/src/graphics/rendering/material-gpu/material-arrays.ts +0 -113
- package/src/graphics/rendering/material-gpu/material-bind-group.ts +0 -61
- package/src/graphics/rendering/material-gpu/material-gpu-plugin.ts +0 -95
- package/src/graphics/scene/model/geometry/geometry.ts +0 -12
|
@@ -1,33 +1,45 @@
|
|
|
1
1
|
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
2
|
|
|
3
3
|
import { Database, type Entity } from "@adobe/data/ecs";
|
|
4
|
+
import type { Aabb } from "@adobe/data/math";
|
|
4
5
|
import { Mat4x4 } from "@adobe/data/math";
|
|
5
6
|
import { pbrCore } from "../../../rendering/pbr-core-plugin.js";
|
|
6
7
|
import { core } from "../../../../core/core-plugin.js";
|
|
7
|
-
import {
|
|
8
|
+
import { mesh } from "../mesh-plugin.js";
|
|
8
9
|
import { unitSphere, unitCube } from "./shape-mesh.js";
|
|
9
10
|
import { uploadShapeMesh } from "./upload-shape-mesh.js";
|
|
11
|
+
import { boundsFromShapeMesh } from "./bounds-from-shape-mesh.js";
|
|
12
|
+
import { capsuleMesh, flatShadedMesh } from "./shape-mesh.js";
|
|
13
|
+
import { convexHullMesh } from "./convex-hull.js";
|
|
14
|
+
import type { ShapeSpec } from "./shape-spec.js";
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
|
-
* shapeGeometry —
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* render path. The two geometry entity ids are published in `_shapeGeometry`
|
|
16
|
-
* for the physics render bridge to reference (sphere / cuboid bodies). Built
|
|
17
|
-
* once when the device is ready.
|
|
17
|
+
* shapeGeometry — bakes built-in procedural meshes into `StaticMesh` + `_PbrPrimitive`
|
|
18
|
+
* (StandardVertex layout). Registers shared unit sphere/cube at init; provides
|
|
19
|
+
* `insertStaticMeshPrimitive` for direct bakes (capsule/hull caches, extensions, etc.).
|
|
18
20
|
*/
|
|
19
21
|
export const shapeGeometry = Database.Plugin.create({
|
|
20
|
-
|
|
22
|
+
imports: Database.Plugin.combine(pbrCore, mesh),
|
|
23
|
+
extends: core,
|
|
21
24
|
resources: {
|
|
22
|
-
|
|
25
|
+
_shapeMeshes: { default: null as { sphere: Entity; cube: Entity } | null, nonPersistent: true },
|
|
23
26
|
},
|
|
24
27
|
transactions: {
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
insertStaticMeshPrimitive(t, args: {
|
|
29
|
+
mesh?: Entity;
|
|
30
|
+
vertexBuffer: GPUBuffer;
|
|
31
|
+
indexBuffer: GPUBuffer;
|
|
32
|
+
indexCount: number;
|
|
33
|
+
localBounds: Aabb;
|
|
34
|
+
}): Entity {
|
|
35
|
+
const meshId = args.mesh ?? t.archetypes.StaticMesh.insert({ localBounds: args.localBounds });
|
|
36
|
+
if (args.mesh !== undefined) {
|
|
37
|
+
t.update(args.mesh, { localBounds: args.localBounds });
|
|
38
|
+
}
|
|
27
39
|
t.archetypes._PbrPrimitive.insert({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
_material: 0,
|
|
40
|
+
nonPersistent: true,
|
|
41
|
+
_mesh: meshId,
|
|
42
|
+
_material: 0,
|
|
31
43
|
_vertexBuffer: args.vertexBuffer,
|
|
32
44
|
_skinVertexBuffer: null,
|
|
33
45
|
_indexBuffer: args.indexBuffer,
|
|
@@ -35,7 +47,7 @@ export const shapeGeometry = Database.Plugin.create({
|
|
|
35
47
|
_indexFormat: "uint16",
|
|
36
48
|
_nodeLocalMatrix: Mat4x4.identity,
|
|
37
49
|
});
|
|
38
|
-
return
|
|
50
|
+
return meshId;
|
|
39
51
|
},
|
|
40
52
|
},
|
|
41
53
|
systems: {
|
|
@@ -50,12 +62,79 @@ export const shapeGeometry = Database.Plugin.create({
|
|
|
50
62
|
|
|
51
63
|
const s = uploadShapeMesh(device, unitSphere());
|
|
52
64
|
const c = uploadShapeMesh(device, unitCube());
|
|
53
|
-
const sphere = db.transactions.
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
const sphere = db.transactions.insertStaticMeshPrimitive({
|
|
66
|
+
vertexBuffer: s.vb, indexBuffer: s.ib, indexCount: s.count,
|
|
67
|
+
localBounds: boundsFromShapeMesh(unitSphere()),
|
|
68
|
+
});
|
|
69
|
+
const cube = db.transactions.insertStaticMeshPrimitive({
|
|
70
|
+
vertexBuffer: c.vb, indexBuffer: c.ib, indexCount: c.count,
|
|
71
|
+
localBounds: boundsFromShapeMesh(unitCube()),
|
|
72
|
+
});
|
|
73
|
+
db.store.resources._shapeMeshes = { sphere, cube };
|
|
56
74
|
done = true;
|
|
57
75
|
};
|
|
58
76
|
},
|
|
59
77
|
},
|
|
78
|
+
shapeMeshBake: {
|
|
79
|
+
schedule: { during: ["preUpdate"], after: ["shapeGeometryInit"] },
|
|
80
|
+
create: db => {
|
|
81
|
+
const bake = (spec: ShapeSpec): {
|
|
82
|
+
vb: GPUBuffer;
|
|
83
|
+
ib: GPUBuffer;
|
|
84
|
+
count: number;
|
|
85
|
+
localBounds: Aabb;
|
|
86
|
+
} | null => {
|
|
87
|
+
const { device } = db.store.resources;
|
|
88
|
+
if (!device) return null;
|
|
89
|
+
if (spec.kind === "unitSphere") {
|
|
90
|
+
const data = unitSphere();
|
|
91
|
+
const gpu = uploadShapeMesh(device, data);
|
|
92
|
+
return { ...gpu, localBounds: boundsFromShapeMesh(data) };
|
|
93
|
+
}
|
|
94
|
+
if (spec.kind === "unitBox") {
|
|
95
|
+
const data = unitCube();
|
|
96
|
+
const gpu = uploadShapeMesh(device, data);
|
|
97
|
+
return { ...gpu, localBounds: boundsFromShapeMesh(data) };
|
|
98
|
+
}
|
|
99
|
+
if (spec.kind === "capsule") {
|
|
100
|
+
const data = capsuleMesh(spec.radius, spec.halfHeight);
|
|
101
|
+
const gpu = uploadShapeMesh(device, data);
|
|
102
|
+
return { ...gpu, localBounds: boundsFromShapeMesh(data) };
|
|
103
|
+
}
|
|
104
|
+
if (spec.kind === "convexHull") {
|
|
105
|
+
const data = convexHullMesh(spec.points);
|
|
106
|
+
const gpu = uploadShapeMesh(device, data);
|
|
107
|
+
return { ...gpu, localBounds: boundsFromShapeMesh(data) };
|
|
108
|
+
}
|
|
109
|
+
if (spec.kind === "triMesh") {
|
|
110
|
+
const data = flatShadedMesh(spec.positions, spec.indices);
|
|
111
|
+
const gpu = uploadShapeMesh(device, data);
|
|
112
|
+
return { ...gpu, localBounds: boundsFromShapeMesh(data) };
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
};
|
|
116
|
+
return () => {
|
|
117
|
+
for (const arch of db.store.queryArchetypes(["shapeSpec"])) {
|
|
118
|
+
const ids = arch.columns.id;
|
|
119
|
+
const specs = arch.columns.shapeSpec;
|
|
120
|
+
for (let i = arch.rowCount - 1; i >= 0; i--) {
|
|
121
|
+
const spec = specs.get(i);
|
|
122
|
+
if (!spec) continue;
|
|
123
|
+
const meshId = ids.get(i);
|
|
124
|
+
const baked = bake(spec);
|
|
125
|
+
if (!baked) continue;
|
|
126
|
+
db.transactions.insertStaticMeshPrimitive({
|
|
127
|
+
mesh: meshId,
|
|
128
|
+
vertexBuffer: baked.vb,
|
|
129
|
+
indexBuffer: baked.ib,
|
|
130
|
+
indexCount: baked.count,
|
|
131
|
+
localBounds: baked.localBounds,
|
|
132
|
+
});
|
|
133
|
+
db.store.update(meshId, { shapeSpec: null });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
},
|
|
60
139
|
},
|
|
61
140
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
|
|
3
|
+
/** Authored procedural mesh intent — consumed by the shape baker, not the renderer. */
|
|
4
|
+
export type ShapeSpec =
|
|
5
|
+
| { kind: "unitSphere" }
|
|
6
|
+
| { kind: "unitBox" }
|
|
7
|
+
| { kind: "capsule"; radius: number; halfHeight: number }
|
|
8
|
+
| { kind: "convexHull"; points: Float32Array }
|
|
9
|
+
| { kind: "triMesh"; positions: Float32Array; indices: Uint32Array };
|
|
@@ -6,25 +6,8 @@ import { transform } from "../node/transform-plugin.js";
|
|
|
6
6
|
import { modelLoader } from "./model-loader-plugin.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* write: _worldBounds (archetype migration; unit placeholder)
|
|
12
|
-
*
|
|
13
|
-
* Adds the `_worldBounds` column to any Model that doesn't have it yet, so
|
|
14
|
-
* `worldBoundsSystem` can write directly without further migration.
|
|
15
|
-
*
|
|
16
|
-
* worldBoundsSystem
|
|
17
|
-
* query: Model+_worldMatrix+_worldBounds
|
|
18
|
-
* read: geometry → _bounds, _worldMatrix
|
|
19
|
-
* write: _worldBounds
|
|
20
|
-
*
|
|
21
|
-
* Transforms the asset-space AABB on each Model's `geometry` by the Model's
|
|
22
|
-
* `_worldMatrix` (all 8 corners, reduce to min/max) and writes the result.
|
|
23
|
-
* Geometries still loading have no `_bounds` yet — those Models are skipped
|
|
24
|
-
* until the asset finishes; their `_worldBounds` stays at its placeholder.
|
|
25
|
-
*
|
|
26
|
-
* Cost: one matrix-vec multiply × 8 corners × N visible Models, per frame.
|
|
27
|
-
* At N=1000 that's ~8K vec3 ops; well under 0.1ms on modern CPUs.
|
|
9
|
+
* worldBounds — derives `_worldBounds` on `Model` rows from each instance's
|
|
10
|
+
* mesh `localBounds` and `_worldMatrix`.
|
|
28
11
|
*/
|
|
29
12
|
export const worldBounds = Database.Plugin.create({
|
|
30
13
|
extends: Database.Plugin.combine(modelLoader, transform),
|
|
@@ -33,11 +16,10 @@ export const worldBounds = Database.Plugin.create({
|
|
|
33
16
|
schedule: { after: ["transformCreateWorldMatrix"] },
|
|
34
17
|
create: db => () => {
|
|
35
18
|
for (const arch of db.store.queryArchetypes(
|
|
36
|
-
["
|
|
19
|
+
["mesh", "_worldMatrix"],
|
|
37
20
|
{ exclude: ["_worldBounds"] },
|
|
38
21
|
)) {
|
|
39
22
|
const ids = arch.columns.id;
|
|
40
|
-
// Iterate tail→head: every row migrates out of this archetype.
|
|
41
23
|
for (let i = arch.rowCount - 1; i >= 0; i--) {
|
|
42
24
|
db.store.update(ids.get(i), { _worldBounds: Aabb.unit });
|
|
43
25
|
}
|
|
@@ -48,13 +30,13 @@ export const worldBounds = Database.Plugin.create({
|
|
|
48
30
|
schedule: { after: ["transformSystem", "worldBoundsCreate"] },
|
|
49
31
|
create: db => () => {
|
|
50
32
|
for (const arch of db.store.queryArchetypes([
|
|
51
|
-
"
|
|
33
|
+
"mesh", "_worldMatrix", "_worldBounds",
|
|
52
34
|
])) {
|
|
53
|
-
const
|
|
35
|
+
const meshRefs = arch.columns.mesh;
|
|
54
36
|
const worldMats = arch.columns._worldMatrix;
|
|
55
37
|
const worldBoundsCol = arch.columns._worldBounds;
|
|
56
38
|
for (let i = 0; i < arch.rowCount; i++) {
|
|
57
|
-
const localBounds = db.store.get(
|
|
39
|
+
const localBounds = db.store.get(meshRefs.get(i), "localBounds") as Aabb | null;
|
|
58
40
|
if (!localBounds) continue;
|
|
59
41
|
worldBoundsCol.set(i, transformAabb(localBounds, worldMats.get(i)));
|
|
60
42
|
}
|
|
@@ -68,7 +50,6 @@ const transformAabb = (local: Aabb, m: Mat4x4): Aabb => {
|
|
|
68
50
|
const { min, max } = local;
|
|
69
51
|
let minX = Infinity, minY = Infinity, minZ = Infinity;
|
|
70
52
|
let maxX = -Infinity, maxY = -Infinity, maxZ = -Infinity;
|
|
71
|
-
// The 8 box corners.
|
|
72
53
|
for (let cx = 0; cx < 2; cx++) {
|
|
73
54
|
for (let cy = 0; cy < 2; cy++) {
|
|
74
55
|
for (let cz = 0; cz < 2; cz++) {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { Database, Entity, type Store } from "@adobe/data/ecs";
|
|
3
|
+
import { nodeData } from "./node-data-plugin.js";
|
|
4
|
+
|
|
5
|
+
const createTestDb = () => Database.create(nodeData);
|
|
6
|
+
|
|
7
|
+
const storeOf = (db: ReturnType<typeof createTestDb>) =>
|
|
8
|
+
(db as unknown as { store: Store<any, any, any> }).store;
|
|
9
|
+
|
|
10
|
+
const identityNode = () => ({
|
|
11
|
+
position: [0, 0, 0] as const,
|
|
12
|
+
rotation: [0, 0, 0, 1] as const,
|
|
13
|
+
scale: [1, 1, 1] as const,
|
|
14
|
+
visible: true,
|
|
15
|
+
parent: 0 as Entity,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
describe("nodeChildrenOf index", () => {
|
|
19
|
+
it("finds direct children of a parent node", () => {
|
|
20
|
+
const db = createTestDb();
|
|
21
|
+
const store = storeOf(db);
|
|
22
|
+
store.archetypes.Node.insert(identityNode()); // entity 0 — keeps parent id non-zero
|
|
23
|
+
const parent = store.archetypes.Node.insert(identityNode());
|
|
24
|
+
const childA = store.archetypes.Node.insert({ ...identityNode(), parent });
|
|
25
|
+
const childB = store.archetypes.Node.insert({ ...identityNode(), parent });
|
|
26
|
+
store.archetypes.Node.insert(identityNode()); // other root (parent === 0)
|
|
27
|
+
|
|
28
|
+
const children = db.indexes.nodeChildrenOf.find({ parent });
|
|
29
|
+
expect(children).toHaveLength(2);
|
|
30
|
+
expect(children).toContain(childA);
|
|
31
|
+
expect(children).toContain(childB);
|
|
32
|
+
expect(children).not.toContain(parent);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("updates buckets when parent changes", () => {
|
|
36
|
+
const db = createTestDb();
|
|
37
|
+
const store = storeOf(db);
|
|
38
|
+
const parentA = store.archetypes.Node.insert(identityNode());
|
|
39
|
+
const parentB = store.archetypes.Node.insert(identityNode());
|
|
40
|
+
const child = store.archetypes.Node.insert({ ...identityNode(), parent: parentA });
|
|
41
|
+
|
|
42
|
+
expect(db.indexes.nodeChildrenOf.find({ parent: parentA })).toContain(child);
|
|
43
|
+
store.update(child, { parent: parentB });
|
|
44
|
+
expect(db.indexes.nodeChildrenOf.find({ parent: parentA })).not.toContain(child);
|
|
45
|
+
expect(db.indexes.nodeChildrenOf.find({ parent: parentB })).toContain(child);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -8,9 +8,13 @@ import { True } from "@adobe/data/schema";
|
|
|
8
8
|
* The transform-hierarchy core model. Every entity with a position in the
|
|
9
9
|
* world is a `Node` — see `node.ts` for the field bundle.
|
|
10
10
|
*
|
|
11
|
-
* `_worldMatrix` and `_worldBounds` are
|
|
12
|
-
* on the authored Node archetype — systems write them via
|
|
13
|
-
* migrating each entity once into a wider archetype.
|
|
11
|
+
* `_worldMatrix` and `_worldBounds` are derived components (`nonPersistent: true`)
|
|
12
|
+
* but NOT listed on the authored Node archetype — systems write them via
|
|
13
|
+
* `db.store.update`, migrating each entity once into a wider archetype.
|
|
14
|
+
*
|
|
15
|
+
* `indexes.nodeChildrenOf` lists direct children by parent entity id. Scoped
|
|
16
|
+
* to the Node archetype (and supersets such as Model) — not every column that
|
|
17
|
+
* happens to carry `parent`.
|
|
14
18
|
*/
|
|
15
19
|
export const nodeData = Database.Plugin.create({
|
|
16
20
|
components: {
|
|
@@ -19,10 +23,13 @@ export const nodeData = Database.Plugin.create({
|
|
|
19
23
|
rotation: Quat.schema,
|
|
20
24
|
scale: Vec3.schema,
|
|
21
25
|
parent: Entity.schema,
|
|
22
|
-
_worldMatrix: Mat4x4.schema,
|
|
23
|
-
_worldBounds: Aabb.schema,
|
|
26
|
+
_worldMatrix: { ...Mat4x4.schema, nonPersistent: true },
|
|
27
|
+
_worldBounds: { ...Aabb.schema, nonPersistent: true },
|
|
24
28
|
},
|
|
25
29
|
archetypes: {
|
|
26
30
|
Node: ["position", "rotation", "scale", "parent", "visible"],
|
|
27
31
|
},
|
|
32
|
+
indexes: {
|
|
33
|
+
nodeChildrenOf: { key: "parent", archetype: "Node" },
|
|
34
|
+
},
|
|
28
35
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Database } from "@adobe/data/ecs";
|
|
4
4
|
import { plugin as nodePlugin } from "./node/node-plugin.js";
|
|
5
|
-
import {
|
|
5
|
+
import { mesh } from "./model/mesh-plugin.js";
|
|
6
6
|
import { SceneUniforms } from "./scene-uniforms/scene-uniforms.js";
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -11,10 +11,10 @@ import { SceneUniforms } from "./scene-uniforms/scene-uniforms.js";
|
|
|
11
11
|
*
|
|
12
12
|
* Combines:
|
|
13
13
|
* - `Node.plugin` (node data + transform system)
|
|
14
|
-
* - `
|
|
14
|
+
* - `mesh` (Mesh asset + Model/MeshInstance archetypes)
|
|
15
15
|
* - `SceneUniforms.plugin` (camera resource + light resource + GPU uniform packing)
|
|
16
16
|
*
|
|
17
17
|
* Add a camera controller (e.g. `Orbit.plugin`), animation, and a renderer
|
|
18
18
|
* (`pbrIblRender`) to get a working interactive scene.
|
|
19
19
|
*/
|
|
20
|
-
export const scene = Database.Plugin.combine(nodePlugin,
|
|
20
|
+
export const scene = Database.Plugin.combine(nodePlugin, mesh, SceneUniforms.plugin);
|
package/src/index.ts
CHANGED
|
@@ -1,72 +1,3 @@
|
|
|
1
1
|
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
export { scene } from "./graphics/scene/scene-plugin.js";
|
|
5
|
-
|
|
6
|
-
// --- Authoring abstractions --------------------------------------------------
|
|
7
|
-
export { animation } from "./graphics/animation/animation-plugin.js";
|
|
8
|
-
export { AnimationTrack } from "./graphics/animation/animation-track/animation-track.js";
|
|
9
|
-
export { InterpolationMode } from "./graphics/animation/interpolation-mode/interpolation-mode.js";
|
|
10
|
-
|
|
11
|
-
// --- Infrastructure ----------------------------------------------------------
|
|
12
|
-
export { core } from "./core/core-plugin.js";
|
|
13
|
-
export { FrameTime } from "./core/frame-time/frame-time.js";
|
|
14
|
-
export { graphics } from "./graphics/graphics-plugin.js";
|
|
15
|
-
|
|
16
|
-
// --- Physics: shared rigid-body data model + pluggable solver seam -----------
|
|
17
|
-
export { physicsData } from "./physics/physics-data-plugin.js";
|
|
18
|
-
export { physicsClock } from "./physics/physics-clock-plugin.js";
|
|
19
|
-
export type { PhysicsClock } from "./physics/physics-clock-plugin.js";
|
|
20
|
-
export { jointData } from "./physics/joint/joint-plugin.js";
|
|
21
|
-
export type { Joint } from "./physics/joint/joint.js";
|
|
22
|
-
export { JointType } from "./physics/joint/joint-type/joint-type.js";
|
|
23
|
-
export type { RigidBody } from "./physics/body/rigid-body.js";
|
|
24
|
-
export type { StaticCollider } from "./physics/body/static-collider.js";
|
|
25
|
-
export { BodyType } from "./physics/body/body-type/body-type.js";
|
|
26
|
-
export { ColliderShape } from "./physics/body/collider-shape/collider-shape.js";
|
|
27
|
-
export { rapierSolver } from "./physics/solvers/rapier-solver-plugin.js";
|
|
28
|
-
export { joltSolver } from "./physics/solvers/jolt-solver-plugin.js";
|
|
29
|
-
export { runSolverBenchmark } from "./physics/solvers/solver-benchmark.js";
|
|
30
|
-
export type { SolverBenchmarkOptions, SolverBenchmarkResult } from "./physics/solvers/solver-benchmark.js";
|
|
31
|
-
|
|
32
|
-
// --- Material registry (authored entities: physical + visible PBR props) ------
|
|
33
|
-
export { Material } from "./material/material.js";
|
|
34
|
-
|
|
35
|
-
// --- System plugins (consumed via aggregators) -------------------------------
|
|
36
|
-
export { transform } from "./graphics/scene/node/transform-plugin.js";
|
|
37
|
-
export { pbrCore } from "./graphics/rendering/pbr-core-plugin.js";
|
|
38
|
-
export { modelLoader } from "./graphics/scene/model/model-loader-plugin.js";
|
|
39
|
-
export { pbrSkinning } from "./graphics/rendering/skinning/skinning-plugin.js";
|
|
40
|
-
export { picking } from "./graphics/picking/picking-plugin.js";
|
|
41
|
-
export type { PickHit } from "./graphics/picking/pick-hit.js";
|
|
42
|
-
|
|
43
|
-
// --- Rendering ---------------------------------------------------------------
|
|
44
|
-
export { rendering } from "./graphics/rendering/rendering-plugin.js";
|
|
45
|
-
export { pbrIblRender } from "./graphics/rendering/ibl-render/ibl-render-plugin.js";
|
|
46
|
-
export { materialGpu } from "./graphics/rendering/material-gpu/material-gpu-plugin.js";
|
|
47
|
-
export { pbrRender } from "./graphics/rendering/pbr-render/pbr-render-plugin.js";
|
|
48
|
-
export { physicsRenderBridge } from "./graphics/rendering/pbr-render/physics-bridge-plugin.js";
|
|
49
|
-
export { displayTransform } from "./graphics/rendering/display-transform-plugin.js";
|
|
50
|
-
export { interpolation } from "./graphics/rendering/interpolation-plugin.js";
|
|
51
|
-
export { modelCollider } from "./graphics/rendering/model-collider-plugin.js";
|
|
52
|
-
export { boneColliders } from "./graphics/rendering/bone-collider-plugin.js";
|
|
53
|
-
export { ragdollTrigger } from "./graphics/rendering/ragdoll-trigger-plugin.js";
|
|
54
|
-
export { joltRagdoll } from "./graphics/rendering/jolt-ragdoll-plugin.js";
|
|
55
|
-
export { fitBoneCapsules } from "./physics/ragdoll/fit-bone-capsules.js";
|
|
56
|
-
export type { BoneCapsule } from "./physics/ragdoll/fit-bone-capsules.js";
|
|
57
|
-
export { shapeGeometry } from "./graphics/scene/model/shape/shape-geometry-plugin.js";
|
|
58
|
-
|
|
59
|
-
// --- Types (type + namespace, access .plugin for the ECS plugin) -------------
|
|
60
|
-
export { Camera } from "./graphics/camera/camera.js";
|
|
61
|
-
export { Light } from "./graphics/scene/light/light.js";
|
|
62
|
-
export { Orbit } from "./graphics/camera/orbit/orbit.js";
|
|
63
|
-
export { Node } from "./graphics/scene/node/node.js";
|
|
64
|
-
export { Model } from "./graphics/scene/model/model.js";
|
|
65
|
-
export { Geometry } from "./graphics/scene/model/geometry/geometry.js";
|
|
66
|
-
export { SceneUniforms } from "./graphics/scene/scene-uniforms/scene-uniforms.js";
|
|
67
|
-
export { StandardVertex } from "./graphics/rendering/standard-vertex/standard-vertex.js";
|
|
68
|
-
export { VisibleMaterial } from "./graphics/rendering/visible-material/visible-material.js";
|
|
69
|
-
|
|
70
|
-
// --- Utilities ---------------------------------------------------------------
|
|
71
|
-
export { attachOrbitDrag } from "./graphics/camera/orbit/attach-orbit-drag.js";
|
|
72
|
-
export type { OrbitDragService } from "./graphics/camera/orbit/attach-orbit-drag.js";
|
|
3
|
+
export * from "./core/public.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
|
|
3
|
+
import type { Material } from "./material.js";
|
|
4
|
+
import type { MaterialDefinition } from "./material-definition.js";
|
|
5
|
+
import { solidDefaults } from "./material-defaults.js";
|
|
6
|
+
|
|
7
|
+
/** Fields that `solidDefaults` does not supply — must appear on every definition or full row. */
|
|
8
|
+
const REQUIRED_KEYS = [
|
|
9
|
+
"density",
|
|
10
|
+
"restitution",
|
|
11
|
+
"heatCapacity",
|
|
12
|
+
"baseColorFactor",
|
|
13
|
+
"emissiveFactor",
|
|
14
|
+
"metallicFactor",
|
|
15
|
+
"roughnessFactor",
|
|
16
|
+
] as const satisfies readonly (keyof Material)[];
|
|
17
|
+
|
|
18
|
+
/** Merge defaults + definition into a full `Material` row; throw if required fields are missing. */
|
|
19
|
+
export const assembleMaterialRow = (name: string, definition: MaterialDefinition): Material => {
|
|
20
|
+
const row = { name, ...solidDefaults, ...definition };
|
|
21
|
+
const missing = REQUIRED_KEYS.filter(key => row[key] === undefined);
|
|
22
|
+
if (missing.length > 0) {
|
|
23
|
+
throw new Error(`Material "${name}" is missing required fields: ${missing.join(", ")}`);
|
|
24
|
+
}
|
|
25
|
+
return row as Material;
|
|
26
|
+
};
|