@adobe/data-gpu 0.9.74 → 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
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { solidDefaults } from "../material-defaults.js";
|
|
2
|
+
import type { MaterialDefinition } from "../material-definition.js";
|
|
3
|
+
import { StressStrainCurve } from "../stress-strain-curve/stress-strain-curve.js";
|
|
4
|
+
import type { PropertiesJson } from "./properties-json.js";
|
|
5
|
+
|
|
6
|
+
export const toDefinition = (props: PropertiesJson): MaterialDefinition => ({
|
|
7
|
+
baseColorFactor: [...props.baseColorFactor],
|
|
8
|
+
emissiveFactor: [...props.emissiveFactor],
|
|
9
|
+
metallicFactor: props.metallicFactor,
|
|
10
|
+
roughnessFactor: props.roughnessFactor,
|
|
11
|
+
irReflectance: props.irReflectance,
|
|
12
|
+
irEmission: props.irEmission,
|
|
13
|
+
emissionMode: props.emissionMode,
|
|
14
|
+
restitution: props.restitution,
|
|
15
|
+
density: props.density,
|
|
16
|
+
viscosity: props.viscosity,
|
|
17
|
+
heatCapacity: props.heatCapacity,
|
|
18
|
+
thermalConductivity: props.thermalConductivity,
|
|
19
|
+
friction: props.friction ?? solidDefaults.friction,
|
|
20
|
+
compliance: props.compliance ?? solidDefaults.compliance,
|
|
21
|
+
normalScale: props.normalScale ?? solidDefaults.normalScale,
|
|
22
|
+
occlusionStrength: props.occlusionStrength ?? solidDefaults.occlusionStrength,
|
|
23
|
+
baseColorUrl: "",
|
|
24
|
+
metallicRoughnessUrl: "",
|
|
25
|
+
normalUrl: "",
|
|
26
|
+
occlusionUrl: "",
|
|
27
|
+
emissiveUrl: "",
|
|
28
|
+
stressStrainCurve: StressStrainCurve.create({
|
|
29
|
+
tensileYieldStrainStress: [...props.stressStrainCurve.tensileYieldStrainStress],
|
|
30
|
+
tensileFractureStrainStress: [...props.stressStrainCurve.tensileFractureStrainStress],
|
|
31
|
+
compressiveYieldStrainStress: [...props.stressStrainCurve.compressiveYieldStrainStress],
|
|
32
|
+
compressiveFractureStrainStress: [...props.stressStrainCurve.compressiveFractureStrainStress],
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/** Accept legacy JSON field names (baseColor, metallic, specificHeatCapacity, …). */
|
|
37
|
+
export const toDefinitionFromUnknown = (props: Record<string, unknown>): MaterialDefinition | null => {
|
|
38
|
+
const baseColorFactor = props.baseColorFactor ?? props.baseColor;
|
|
39
|
+
const emissiveFactor = props.emissiveFactor ?? props.emissionRgb;
|
|
40
|
+
const metallicFactor = props.metallicFactor ?? props.metallic;
|
|
41
|
+
const roughnessFactor = props.roughnessFactor ?? props.roughness;
|
|
42
|
+
const heatCapacity = props.heatCapacity ?? props.specificHeatCapacity;
|
|
43
|
+
if (
|
|
44
|
+
!Array.isArray(baseColorFactor) || baseColorFactor.length !== 4
|
|
45
|
+
|| !Array.isArray(emissiveFactor) || emissiveFactor.length !== 3
|
|
46
|
+
|| typeof metallicFactor !== "number"
|
|
47
|
+
|| typeof roughnessFactor !== "number"
|
|
48
|
+
|| typeof heatCapacity !== "number"
|
|
49
|
+
|| typeof props.stressStrainCurve !== "object"
|
|
50
|
+
) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return toDefinition({
|
|
54
|
+
baseColorFactor: baseColorFactor as unknown as PropertiesJson["baseColorFactor"],
|
|
55
|
+
emissiveFactor: emissiveFactor as unknown as PropertiesJson["emissiveFactor"],
|
|
56
|
+
metallicFactor: metallicFactor as number,
|
|
57
|
+
roughnessFactor: roughnessFactor as number,
|
|
58
|
+
irReflectance: (props.irReflectance as number) ?? 0,
|
|
59
|
+
irEmission: (props.irEmission as number) ?? 0,
|
|
60
|
+
emissionMode: (props.emissionMode as number) ?? 0,
|
|
61
|
+
density: props.density as number,
|
|
62
|
+
viscosity: (props.viscosity as number) ?? 0,
|
|
63
|
+
heatCapacity: heatCapacity as number,
|
|
64
|
+
thermalConductivity: (props.thermalConductivity as number) ?? 0,
|
|
65
|
+
restitution: (props.restitution as number) ?? 0,
|
|
66
|
+
friction: props.friction as number | undefined,
|
|
67
|
+
compliance: props.compliance as number | undefined,
|
|
68
|
+
stressStrainCurve: props.stressStrainCurve as PropertiesJson["stressStrainCurve"],
|
|
69
|
+
});
|
|
70
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
|
|
3
|
+
import type { Entity } from "@adobe/data/ecs";
|
|
4
|
+
|
|
5
|
+
/** Store or transaction surface that exposes the material name index. */
|
|
6
|
+
export interface MaterialByNameLookup {
|
|
7
|
+
indexes: {
|
|
8
|
+
materialByName: { get(args: { name: string }): Entity | null };
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MaterialDefinition } from "./material-definition.js";
|
|
2
|
+
import { StressStrainCurve } from "./stress-strain-curve/stress-strain-curve.js";
|
|
3
|
+
|
|
4
|
+
/** Shared defaults for solid materials missing optional simulation / PBR fields. */
|
|
5
|
+
export const solidDefaults = {
|
|
6
|
+
friction: 0.5,
|
|
7
|
+
compliance: 1e-8,
|
|
8
|
+
normalScale: 1,
|
|
9
|
+
occlusionStrength: 1,
|
|
10
|
+
viscosity: 0,
|
|
11
|
+
thermalConductivity: 0,
|
|
12
|
+
irReflectance: 0,
|
|
13
|
+
irEmission: 0,
|
|
14
|
+
emissionMode: 0,
|
|
15
|
+
baseColorUrl: "",
|
|
16
|
+
metallicRoughnessUrl: "",
|
|
17
|
+
normalUrl: "",
|
|
18
|
+
occlusionUrl: "",
|
|
19
|
+
emissiveUrl: "",
|
|
20
|
+
stressStrainCurve: StressStrainCurve.create({
|
|
21
|
+
tensileYieldStrainStress: [0, 0],
|
|
22
|
+
tensileFractureStrainStress: [0, 0],
|
|
23
|
+
compressiveYieldStrainStress: [0, 0],
|
|
24
|
+
compressiveFractureStrainStress: [0, 0],
|
|
25
|
+
}),
|
|
26
|
+
} as const satisfies Partial<MaterialDefinition>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { Database } from "@adobe/data/ecs";
|
|
3
|
+
import { plugin } from "./material-plugin.js";
|
|
4
|
+
import { assembleMaterialRow } from "./assemble-material-row.js";
|
|
5
|
+
import { requireMaterial } from "./require-material.js";
|
|
6
|
+
import { solidDefaults } from "./material-defaults.js";
|
|
7
|
+
import { StressStrainCurve } from "./stress-strain-curve/stress-strain-curve.js";
|
|
8
|
+
|
|
9
|
+
const noSolidCurve = StressStrainCurve.create({
|
|
10
|
+
tensileYieldStrainStress: [0, 0],
|
|
11
|
+
tensileFractureStrainStress: [0, 0],
|
|
12
|
+
compressiveYieldStrainStress: [0, 0],
|
|
13
|
+
compressiveFractureStrainStress: [0, 0],
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const rockRow = {
|
|
17
|
+
name: "rock",
|
|
18
|
+
...solidDefaults,
|
|
19
|
+
baseColorFactor: [0.5, 0.5, 0.5, 1] as const,
|
|
20
|
+
emissiveFactor: [0, 0, 0] as const,
|
|
21
|
+
metallicFactor: 0,
|
|
22
|
+
roughnessFactor: 0.8,
|
|
23
|
+
irReflectance: 0.1,
|
|
24
|
+
irEmission: 0,
|
|
25
|
+
emissionMode: 0,
|
|
26
|
+
restitution: 0.15,
|
|
27
|
+
density: 2650,
|
|
28
|
+
viscosity: 0,
|
|
29
|
+
heatCapacity: 800,
|
|
30
|
+
thermalConductivity: 4,
|
|
31
|
+
stressStrainCurve: noSolidCurve,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
describe("materialByName index", () => {
|
|
35
|
+
it("returns the material entity for a known name", () => {
|
|
36
|
+
const db = Database.create(plugin);
|
|
37
|
+
const rock = db.transactions.insertMaterial(rockRow);
|
|
38
|
+
expect(db.indexes.materialByName.get({ name: "rock" })).toBe(rock);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("returns null for an unknown name", () => {
|
|
42
|
+
const db = Database.create(plugin);
|
|
43
|
+
expect(db.indexes.materialByName.get({ name: "missing" })).toBeNull();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("is populated by seedStandardMaterials", () => {
|
|
47
|
+
const db = Database.create(plugin);
|
|
48
|
+
db.transactions.seedStandardMaterials();
|
|
49
|
+
expect(db.indexes.materialByName.get({ name: "steel" })).not.toBeNull();
|
|
50
|
+
expect(db.indexes.materialByName.get({ name: "ice" })).not.toBeNull();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("rejects duplicate material names", () => {
|
|
54
|
+
const db = Database.create(plugin);
|
|
55
|
+
db.transactions.insertMaterial(rockRow);
|
|
56
|
+
expect(() => db.transactions.insertMaterial(rockRow)).toThrow(/Unique index conflict/);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("insertMaterial validates required fields", () => {
|
|
60
|
+
const db = Database.create(plugin);
|
|
61
|
+
expect(() => db.transactions.insertMaterial({ ...rockRow, density: undefined as unknown as number })).toThrow(/missing required fields.*density/);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
describe("requireMaterial", () => {
|
|
66
|
+
it("returns the material entity for a known name", () => {
|
|
67
|
+
const db = Database.create(plugin);
|
|
68
|
+
const rock = db.transactions.insertMaterial(rockRow);
|
|
69
|
+
expect(requireMaterial(db, "rock")).toBe(rock);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("throws when the material was never seeded", () => {
|
|
73
|
+
const db = Database.create(plugin);
|
|
74
|
+
expect(() => requireMaterial(db, "missing")).toThrow(/Material "missing" is not in the registry/);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe("assembleMaterialRow", () => {
|
|
79
|
+
it("throws when a required field is missing from the definition", () => {
|
|
80
|
+
expect(() => assembleMaterialRow("bad", { baseColorFactor: [1, 1, 1, 1] })).toThrow(/missing required fields.*density/);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("merges solidDefaults and returns a full row", () => {
|
|
84
|
+
const row = assembleMaterialRow("rock", {
|
|
85
|
+
baseColorFactor: [0.5, 0.5, 0.5, 1],
|
|
86
|
+
emissiveFactor: [0, 0, 0],
|
|
87
|
+
metallicFactor: 0,
|
|
88
|
+
roughnessFactor: 0.8,
|
|
89
|
+
density: 2650,
|
|
90
|
+
restitution: 0.15,
|
|
91
|
+
heatCapacity: 800,
|
|
92
|
+
});
|
|
93
|
+
expect(row.name).toBe("rock");
|
|
94
|
+
expect(row.density).toBe(2650);
|
|
95
|
+
expect(row.friction).toBe(solidDefaults.friction);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -1,61 +1,89 @@
|
|
|
1
|
-
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
-
|
|
3
1
|
import { Database, Entity } from "@adobe/data/ecs";
|
|
4
|
-
import { F32, Vec3, Vec4 } from "@adobe/data/math";
|
|
2
|
+
import { F32, U32, Vec3, Vec4 } from "@adobe/data/math";
|
|
3
|
+
import { definitions } from "./definitions.js";
|
|
4
|
+
import type { Material } from "./material.js";
|
|
5
|
+
import type { MaterialDefinition } from "./material-definition.js";
|
|
6
|
+
import type { MaterialName } from "./material-name.js";
|
|
7
|
+
import { solidDefaults } from "./material-defaults.js";
|
|
8
|
+
import { assembleMaterialRow } from "./assemble-material-row.js";
|
|
5
9
|
import { standardMaterials } from "./standard-materials.js";
|
|
10
|
+
import { StressStrainCurve } from "./stress-strain-curve/stress-strain-curve.js";
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* by
|
|
11
|
-
* renderer). A body / model references a material by `Entity` id; the
|
|
12
|
-
* render-side `materialGpu` plugin derives GPU textures + a palette from these
|
|
13
|
-
* rows and caches them, rebuilding only when a new material appears.
|
|
14
|
-
*
|
|
15
|
-
* `seedStandardMaterials` inserts the standard library and records a
|
|
16
|
-
* `name → Entity` lookup in the `materials` resource.
|
|
13
|
+
* Material registry — each material type is one `Material` entity with every
|
|
14
|
+
* property as its own ECS component. Bodies reference a material by entity id.
|
|
15
|
+
* Lookup by name via `indexes.materialByName`.
|
|
17
16
|
*/
|
|
18
17
|
export const plugin = Database.Plugin.create({
|
|
19
18
|
components: {
|
|
20
|
-
/** Reference
|
|
21
|
-
material:
|
|
22
|
-
name:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
/** Reference on a body, prop, or voxel to a Material registry entity. */
|
|
20
|
+
material: Entity.schema,
|
|
21
|
+
name: { type: "string" },
|
|
22
|
+
// rigid-body physics
|
|
23
|
+
density: F32.schema,
|
|
24
|
+
restitution: F32.schema,
|
|
25
|
+
friction: F32.schema,
|
|
26
|
+
compliance: F32.schema,
|
|
27
|
+
heatCapacity: F32.schema,
|
|
28
|
+
// simulation
|
|
29
|
+
viscosity: F32.schema,
|
|
30
|
+
thermalConductivity: F32.schema,
|
|
31
|
+
stressStrainCurve: StressStrainCurve.schema,
|
|
32
|
+
// visible PBR
|
|
33
|
+
baseColorFactor: Vec4.schema,
|
|
34
|
+
emissiveFactor: Vec3.schema,
|
|
35
|
+
metallicFactor: F32.schema,
|
|
36
|
+
roughnessFactor: F32.schema,
|
|
37
|
+
normalScale: F32.schema,
|
|
38
|
+
occlusionStrength: F32.schema,
|
|
39
|
+
irReflectance: F32.schema,
|
|
40
|
+
irEmission: F32.schema,
|
|
41
|
+
emissionMode: U32.schema,
|
|
42
|
+
// texture sources
|
|
43
|
+
baseColorUrl: { type: "string" },
|
|
35
44
|
metallicRoughnessUrl: { type: "string" },
|
|
36
|
-
normalUrl:
|
|
37
|
-
occlusionUrl:
|
|
38
|
-
emissiveUrl:
|
|
39
|
-
},
|
|
40
|
-
resources: {
|
|
41
|
-
/** name → Material entity, populated by `seedStandardMaterials`. */
|
|
42
|
-
materials: { default: {} as Record<string, Entity> },
|
|
45
|
+
normalUrl: { type: "string" },
|
|
46
|
+
occlusionUrl: { type: "string" },
|
|
47
|
+
emissiveUrl: { type: "string" },
|
|
43
48
|
},
|
|
44
49
|
archetypes: {
|
|
45
50
|
Material: [
|
|
46
51
|
"name",
|
|
47
52
|
"density", "restitution", "friction", "compliance", "heatCapacity",
|
|
48
|
-
"
|
|
53
|
+
"viscosity", "thermalConductivity", "stressStrainCurve",
|
|
54
|
+
"baseColorFactor", "emissiveFactor", "metallicFactor", "roughnessFactor",
|
|
55
|
+
"normalScale", "occlusionStrength", "irReflectance", "irEmission", "emissionMode",
|
|
49
56
|
"baseColorUrl", "metallicRoughnessUrl", "normalUrl", "occlusionUrl", "emissiveUrl",
|
|
50
57
|
],
|
|
51
58
|
},
|
|
59
|
+
indexes: {
|
|
60
|
+
materialByName: { key: "name", unique: true, archetype: "Material" },
|
|
61
|
+
},
|
|
52
62
|
transactions: {
|
|
63
|
+
insertMaterial(t, row: Material): Entity {
|
|
64
|
+
const { name, ...definition } = row;
|
|
65
|
+
return t.archetypes.Material.insert(assembleMaterialRow(name, definition));
|
|
66
|
+
},
|
|
67
|
+
insertMaterialDefinition(t, args: { name: string; definition: MaterialDefinition }): Entity {
|
|
68
|
+
return t.archetypes.Material.insert(assembleMaterialRow(args.name, args.definition));
|
|
69
|
+
},
|
|
70
|
+
insertMaterialDefinitions(t, defs: Readonly<Record<string, MaterialDefinition>>): void {
|
|
71
|
+
for (const [name, definition] of Object.entries(defs)) {
|
|
72
|
+
t.archetypes.Material.insert(assembleMaterialRow(name, definition));
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
/** Textured PBR library used by graphics samples (rubber, wood, stone, steel, ice). */
|
|
53
76
|
seedStandardMaterials(t) {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
77
|
+
for (const row of standardMaterials) {
|
|
78
|
+
const { name, ...definition } = row;
|
|
79
|
+
t.archetypes.Material.insert(assembleMaterialRow(name, definition));
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
/** Solid material library from `definitions` (authored catalog). */
|
|
83
|
+
seedDefinitionMaterials(t) {
|
|
84
|
+
for (const name of Object.keys(definitions) as MaterialName[]) {
|
|
85
|
+
t.archetypes.Material.insert(assembleMaterialRow(name, definitions[name]));
|
|
57
86
|
}
|
|
58
|
-
t.resources.materials = map;
|
|
59
87
|
},
|
|
60
88
|
},
|
|
61
89
|
});
|
package/src/material/material.ts
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
-
|
|
3
1
|
import type { Vec3, Vec4 } from "@adobe/data/math";
|
|
2
|
+
import type { StressStrainCurve } from "./stress-strain-curve/stress-strain-curve.js";
|
|
3
|
+
|
|
4
|
+
/** One row of the `Material` archetype — one entity per material type. */
|
|
5
|
+
export type Material = {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
|
|
8
|
+
// rigid-body physics
|
|
9
|
+
readonly density: number;
|
|
10
|
+
readonly restitution: number;
|
|
11
|
+
readonly friction: number;
|
|
12
|
+
readonly compliance: number;
|
|
13
|
+
readonly heatCapacity: number;
|
|
14
|
+
|
|
15
|
+
// simulation (thermal / fluid / mechanical)
|
|
16
|
+
readonly viscosity: number;
|
|
17
|
+
readonly thermalConductivity: number;
|
|
18
|
+
readonly stressStrainCurve: StressStrainCurve;
|
|
19
|
+
|
|
20
|
+
// visible PBR factors
|
|
21
|
+
readonly baseColorFactor: Vec4;
|
|
22
|
+
readonly emissiveFactor: Vec3;
|
|
23
|
+
readonly metallicFactor: number;
|
|
24
|
+
readonly roughnessFactor: number;
|
|
25
|
+
readonly normalScale: number;
|
|
26
|
+
readonly occlusionStrength: number;
|
|
27
|
+
readonly irReflectance: number;
|
|
28
|
+
readonly irEmission: number;
|
|
29
|
+
readonly emissionMode: number;
|
|
4
30
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* neutral fallback layer". `metallicRoughnessUrl` and `occlusionUrl` may point
|
|
13
|
-
* at the same ARM image (AO = R, Roughness = G, Metalness = B).
|
|
14
|
-
*/
|
|
15
|
-
export interface Material {
|
|
16
|
-
name: string;
|
|
17
|
-
// physical (read by any solver)
|
|
18
|
-
density: number;
|
|
19
|
-
restitution: number;
|
|
20
|
-
friction: number;
|
|
21
|
-
compliance: number;
|
|
22
|
-
heatCapacity: number;
|
|
23
|
-
// visible PBR factors (multipliers over the sampled maps)
|
|
24
|
-
baseColorFactor: Vec4;
|
|
25
|
-
emissiveFactor: Vec3;
|
|
26
|
-
metallicFactor: number;
|
|
27
|
-
roughnessFactor: number;
|
|
28
|
-
normalScale: number;
|
|
29
|
-
occlusionStrength: number;
|
|
30
|
-
// texture sources, fetched at runtime ("" = neutral fallback layer)
|
|
31
|
-
baseColorUrl: string;
|
|
32
|
-
metallicRoughnessUrl: string;
|
|
33
|
-
normalUrl: string;
|
|
34
|
-
occlusionUrl: string;
|
|
35
|
-
emissiveUrl: string;
|
|
36
|
-
}
|
|
31
|
+
// texture sources ("" = factor-only / neutral GPU layer)
|
|
32
|
+
readonly baseColorUrl: string;
|
|
33
|
+
readonly metallicRoughnessUrl: string;
|
|
34
|
+
readonly normalUrl: string;
|
|
35
|
+
readonly occlusionUrl: string;
|
|
36
|
+
readonly emissiveUrl: string;
|
|
37
|
+
};
|
|
37
38
|
|
|
38
39
|
export * as Material from "./public.js";
|
package/src/material/public.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export * from "./material-plugin.js";
|
|
4
|
+
export * from "./emission-mode.js";
|
|
5
|
+
export * from "./assemble-material-row.js";
|
|
6
|
+
export * from "./require-material.js";
|
|
7
|
+
export * from "./material-by-name-lookup.js";
|
|
8
|
+
export * from "./standard-material-names.js";
|
|
9
|
+
export * from "./standard-materials.js";
|
|
10
|
+
export * from "./definitions.js";
|
|
11
|
+
export * from "./material-defaults.js";
|
|
12
|
+
export * from "./material-name.js";
|
|
13
|
+
export * from "./material.js";
|
|
14
|
+
export * as MaterialJson from "./json/public.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
|
|
3
|
+
import type { Entity } from "@adobe/data/ecs";
|
|
4
|
+
import type { MaterialByNameLookup } from "./material-by-name-lookup.js";
|
|
5
|
+
|
|
6
|
+
/** Returns the material entity for `name`, or throws if it was never seeded. */
|
|
7
|
+
export const requireMaterial = (db: MaterialByNameLookup, name: string): Entity => {
|
|
8
|
+
const material = db.indexes.materialByName.get({ name });
|
|
9
|
+
if (material == null) {
|
|
10
|
+
throw new Error(
|
|
11
|
+
`Material "${name}" is not in the registry — seed materials first (seedStandardMaterials or seedDefinitionMaterials).`,
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
return material;
|
|
15
|
+
};
|
|
@@ -1,43 +1,37 @@
|
|
|
1
1
|
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
-
//
|
|
3
|
-
// PBR texture maps © Poly Haven, CC0 (https://polyhaven.com). Fetched at
|
|
4
|
-
// runtime by URL — never committed (see data-gpu-samples/CLAUDE.md). Poly
|
|
5
|
-
// Haven's `arm` map packs AO(R) / Roughness(G) / Metalness(B), matching glTF's
|
|
6
|
-
// occlusion + metallicRoughness channel conventions.
|
|
7
2
|
|
|
8
3
|
import type { Material } from "./material.js";
|
|
4
|
+
import { solidDefaults } from "./material-defaults.js";
|
|
9
5
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* factors are left at 1 and baseColor white.
|
|
17
|
-
*/
|
|
18
|
-
function standard(
|
|
19
|
-
name: string, slug: string,
|
|
6
|
+
/** Factor-only sample materials (no map URLs — rendered via `pbrFactorRender`). */
|
|
7
|
+
function factor(
|
|
8
|
+
name: string,
|
|
9
|
+
baseColorFactor: [number, number, number, number],
|
|
10
|
+
metallicFactor: number,
|
|
11
|
+
roughnessFactor: number,
|
|
20
12
|
density: number, restitution: number, friction: number, compliance: number, heatCapacity: number,
|
|
21
13
|
): Material {
|
|
22
14
|
return {
|
|
23
15
|
name,
|
|
16
|
+
...solidDefaults,
|
|
24
17
|
density, restitution, friction, compliance, heatCapacity,
|
|
25
|
-
baseColorFactor
|
|
18
|
+
baseColorFactor,
|
|
26
19
|
emissiveFactor: [0, 0, 0],
|
|
27
|
-
metallicFactor
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
metallicFactor,
|
|
21
|
+
roughnessFactor,
|
|
22
|
+
baseColorUrl: "",
|
|
23
|
+
metallicRoughnessUrl: "",
|
|
24
|
+
normalUrl: "",
|
|
25
|
+
occlusionUrl: "",
|
|
32
26
|
emissiveUrl: "",
|
|
33
27
|
};
|
|
34
28
|
}
|
|
35
29
|
|
|
36
|
-
/**
|
|
30
|
+
/** Small factor library seeded by `seedStandardMaterials`. */
|
|
37
31
|
export const standardMaterials: readonly Material[] = [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
factor("rubber", [0.15, 0.15, 0.15, 1], 0.0, 0.90, 1.1, 0.80, 0.90, 1e-5, 2.0),
|
|
33
|
+
factor("wood", [0.55, 0.35, 0.20, 1], 0.0, 0.75, 0.6, 0.35, 0.70, 5e-7, 1.7),
|
|
34
|
+
factor("stone", [0.45, 0.43, 0.40, 1], 0.05, 0.85, 2.6, 0.20, 0.85, 1e-8, 0.8),
|
|
35
|
+
factor("steel", [0.70, 0.72, 0.75, 1], 0.9, 0.35, 7.8, 0.45, 0.50, 1e-9, 0.5),
|
|
36
|
+
factor("ice", [0.85, 0.92, 0.95, 1], 0.0, 0.15, 0.92, 0.25, 0.05, 5e-9, 2.1),
|
|
43
37
|
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Vec2 } from "@adobe/data/math";
|
|
2
|
+
import type { StressStrainCurve } from "./stress-strain-curve.js";
|
|
3
|
+
|
|
4
|
+
export const create = (args: {
|
|
5
|
+
readonly tensileYieldStrainStress: Vec2;
|
|
6
|
+
readonly tensileFractureStrainStress: Vec2;
|
|
7
|
+
readonly compressiveYieldStrainStress: Vec2;
|
|
8
|
+
readonly compressiveFractureStrainStress: Vec2;
|
|
9
|
+
}): StressStrainCurve => args;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { getStructLayout } from "@adobe/data/typed-buffer";
|
|
3
|
+
import { StressStrainCurve } from "./stress-strain-curve.js";
|
|
4
|
+
|
|
5
|
+
describe("StressStrainCurve.schema — struct layout", () => {
|
|
6
|
+
it("is a valid struct layout", () => {
|
|
7
|
+
expect(() => getStructLayout(StressStrainCurve.schema)).not.toThrow();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("uses packed layout with four vec2 fields", () => {
|
|
11
|
+
const layout = getStructLayout(StressStrainCurve.schema);
|
|
12
|
+
|
|
13
|
+
expect(layout.layout).toBe("packed");
|
|
14
|
+
expect(layout.size).toBe(32);
|
|
15
|
+
expect(layout.fields.tensileYieldStrainStress.offset).toBe(0);
|
|
16
|
+
expect(layout.fields.tensileFractureStrainStress.offset).toBe(8);
|
|
17
|
+
expect(layout.fields.compressiveYieldStrainStress.offset).toBe(16);
|
|
18
|
+
expect(layout.fields.compressiveFractureStrainStress.offset).toBe(24);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Vec2 } from "@adobe/data/math";
|
|
2
|
+
import { Schema } from "@adobe/data/schema";
|
|
3
|
+
|
|
4
|
+
/** Uniaxial bilinear σ–ε curve points. Each Vec2 is [engineering strain, stress MPa]. */
|
|
5
|
+
export const schema = {
|
|
6
|
+
type: "object",
|
|
7
|
+
layout: "packed",
|
|
8
|
+
properties: {
|
|
9
|
+
tensileYieldStrainStress: Vec2.schema,
|
|
10
|
+
tensileFractureStrainStress: Vec2.schema,
|
|
11
|
+
compressiveYieldStrainStress: Vec2.schema,
|
|
12
|
+
compressiveFractureStrainStress: Vec2.schema,
|
|
13
|
+
},
|
|
14
|
+
required: [
|
|
15
|
+
"tensileYieldStrainStress",
|
|
16
|
+
"tensileFractureStrainStress",
|
|
17
|
+
"compressiveYieldStrainStress",
|
|
18
|
+
"compressiveFractureStrainStress",
|
|
19
|
+
],
|
|
20
|
+
} as const satisfies Schema;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Schema } from "@adobe/data/schema";
|
|
2
|
+
import type { Assert, Equal } from "@adobe/data/types";
|
|
3
|
+
import { schema } from "./schema.js";
|
|
4
|
+
|
|
5
|
+
export type StressStrainCurve = Schema.ToType<typeof schema>;
|
|
6
|
+
|
|
7
|
+
type _StressStrainCurveMatchesSchema = Assert<
|
|
8
|
+
Equal<StressStrainCurve, Schema.ToType<typeof schema>>
|
|
9
|
+
>;
|
|
10
|
+
|
|
11
|
+
export * as StressStrainCurve from "./public.js";
|
package/src/physics/README.md
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
# Physics — feature roadmap
|
|
2
2
|
|
|
3
|
-
A general-purpose, solver-agnostic physics layer for `@adobe/data-gpu`, suitable
|
|
3
|
+
A general-purpose, solver-agnostic physics layer for `@adobe/data-gpu/physics`, suitable
|
|
4
4
|
for games, visualisation, and film/animation. Bodies are authored as ECS data
|
|
5
5
|
against a shared seam (`physicsData`); a pluggable **solver** (Jolt or Rapier)
|
|
6
6
|
advances them each frame. See `solvers/README.md` for choosing a solver.
|
|
7
7
|
|
|
8
|
+
```ts
|
|
9
|
+
import { physicsData, joltSolver, rapierSolver } from "@adobe/data-gpu/physics";
|
|
10
|
+
import { core } from "@adobe/data-gpu";
|
|
11
|
+
import { physicsRenderBridge } from "@adobe/data-gpu/graphics";
|
|
12
|
+
|
|
13
|
+
const scene = Database.Plugin.combine(core, physicsData, joltSolver, physicsRenderBridge);
|
|
14
|
+
```
|
|
15
|
+
|
|
8
16
|
This file is the running plan — check the box when a feature lands so we don't
|
|
9
17
|
lose track. Keep it honest about approximations and limitations.
|
|
10
18
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
|
|
3
|
+
/** Physics archetypes whose visual mesh is the collider primitive (not an external override). */
|
|
4
|
+
export const COLLIDER_PRIMITIVE_RENDER_ARCHETYPES = [
|
|
5
|
+
"RigidBody",
|
|
6
|
+
"StaticCollider",
|
|
7
|
+
"ConvexBody",
|
|
8
|
+
"MeshCollider",
|
|
9
|
+
] as const;
|