@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
|
@@ -1,59 +1,84 @@
|
|
|
1
|
-
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
1
|
import { Database, Entity } from "@adobe/data/ecs";
|
|
3
|
-
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 { assembleMaterialRow } from "./assemble-material-row.js";
|
|
4
5
|
import { standardMaterials } from "./standard-materials.js";
|
|
6
|
+
import { StressStrainCurve } from "./stress-strain-curve/stress-strain-curve.js";
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* by
|
|
9
|
-
* renderer). A body / model references a material by `Entity` id; the
|
|
10
|
-
* render-side `materialGpu` plugin derives GPU textures + a palette from these
|
|
11
|
-
* rows and caches them, rebuilding only when a new material appears.
|
|
12
|
-
*
|
|
13
|
-
* `seedStandardMaterials` inserts the standard library and records a
|
|
14
|
-
* `name → Entity` lookup in the `materials` resource.
|
|
8
|
+
* Material registry — each material type is one `Material` entity with every
|
|
9
|
+
* property as its own ECS component. Bodies reference a material by entity id.
|
|
10
|
+
* Lookup by name via `indexes.materialByName`.
|
|
15
11
|
*/
|
|
16
12
|
export const plugin = Database.Plugin.create({
|
|
17
13
|
components: {
|
|
18
|
-
/** Reference
|
|
14
|
+
/** Reference on a body, prop, or voxel to a Material registry entity. */
|
|
19
15
|
material: Entity.schema,
|
|
20
16
|
name: { type: "string" },
|
|
17
|
+
// rigid-body physics
|
|
21
18
|
density: F32.schema,
|
|
22
19
|
restitution: F32.schema,
|
|
23
20
|
friction: F32.schema,
|
|
24
21
|
compliance: F32.schema,
|
|
25
22
|
heatCapacity: F32.schema,
|
|
23
|
+
// simulation
|
|
24
|
+
viscosity: F32.schema,
|
|
25
|
+
thermalConductivity: F32.schema,
|
|
26
|
+
stressStrainCurve: StressStrainCurve.schema,
|
|
27
|
+
// visible PBR
|
|
26
28
|
baseColorFactor: Vec4.schema,
|
|
27
29
|
emissiveFactor: Vec3.schema,
|
|
28
30
|
metallicFactor: F32.schema,
|
|
29
31
|
roughnessFactor: F32.schema,
|
|
30
32
|
normalScale: F32.schema,
|
|
31
33
|
occlusionStrength: F32.schema,
|
|
34
|
+
irReflectance: F32.schema,
|
|
35
|
+
irEmission: F32.schema,
|
|
36
|
+
emissionMode: U32.schema,
|
|
37
|
+
// texture sources
|
|
32
38
|
baseColorUrl: { type: "string" },
|
|
33
39
|
metallicRoughnessUrl: { type: "string" },
|
|
34
40
|
normalUrl: { type: "string" },
|
|
35
41
|
occlusionUrl: { type: "string" },
|
|
36
42
|
emissiveUrl: { type: "string" },
|
|
37
43
|
},
|
|
38
|
-
resources: {
|
|
39
|
-
/** name → Material entity, populated by `seedStandardMaterials`. */
|
|
40
|
-
materials: { default: {} },
|
|
41
|
-
},
|
|
42
44
|
archetypes: {
|
|
43
45
|
Material: [
|
|
44
46
|
"name",
|
|
45
47
|
"density", "restitution", "friction", "compliance", "heatCapacity",
|
|
46
|
-
"
|
|
48
|
+
"viscosity", "thermalConductivity", "stressStrainCurve",
|
|
49
|
+
"baseColorFactor", "emissiveFactor", "metallicFactor", "roughnessFactor",
|
|
50
|
+
"normalScale", "occlusionStrength", "irReflectance", "irEmission", "emissionMode",
|
|
47
51
|
"baseColorUrl", "metallicRoughnessUrl", "normalUrl", "occlusionUrl", "emissiveUrl",
|
|
48
52
|
],
|
|
49
53
|
},
|
|
54
|
+
indexes: {
|
|
55
|
+
materialByName: { key: "name", unique: true, archetype: "Material" },
|
|
56
|
+
},
|
|
50
57
|
transactions: {
|
|
58
|
+
insertMaterial(t, row) {
|
|
59
|
+
const { name, ...definition } = row;
|
|
60
|
+
return t.archetypes.Material.insert(assembleMaterialRow(name, definition));
|
|
61
|
+
},
|
|
62
|
+
insertMaterialDefinition(t, args) {
|
|
63
|
+
return t.archetypes.Material.insert(assembleMaterialRow(args.name, args.definition));
|
|
64
|
+
},
|
|
65
|
+
insertMaterialDefinitions(t, defs) {
|
|
66
|
+
for (const [name, definition] of Object.entries(defs)) {
|
|
67
|
+
t.archetypes.Material.insert(assembleMaterialRow(name, definition));
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
/** Textured PBR library used by graphics samples (rubber, wood, stone, steel, ice). */
|
|
51
71
|
seedStandardMaterials(t) {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
72
|
+
for (const row of standardMaterials) {
|
|
73
|
+
const { name, ...definition } = row;
|
|
74
|
+
t.archetypes.Material.insert(assembleMaterialRow(name, definition));
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
/** Solid material library from `definitions` (authored catalog). */
|
|
78
|
+
seedDefinitionMaterials(t) {
|
|
79
|
+
for (const name of Object.keys(definitions)) {
|
|
80
|
+
t.archetypes.Material.insert(assembleMaterialRow(name, definitions[name]));
|
|
55
81
|
}
|
|
56
|
-
t.resources.materials = map;
|
|
57
82
|
},
|
|
58
83
|
},
|
|
59
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material-plugin.js","sourceRoot":"","sources":["../../src/material/material-plugin.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"material-plugin.js","sourceRoot":"","sources":["../../src/material/material-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAEjF;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACzC,UAAU,EAAE;QACR,yEAAyE;QACzE,QAAQ,EAAE,MAAM,CAAC,MAAM;QACvB,IA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CAAC;YACrB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAmB,EAAE,CAAC;gBAC5D,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC/E,CAAC;QACL,CAAC;KACJ;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
const noSolidCurve = StressStrainCurve.create({
|
|
9
|
+
tensileYieldStrainStress: [0, 0],
|
|
10
|
+
tensileFractureStrainStress: [0, 0],
|
|
11
|
+
compressiveYieldStrainStress: [0, 0],
|
|
12
|
+
compressiveFractureStrainStress: [0, 0],
|
|
13
|
+
});
|
|
14
|
+
const rockRow = {
|
|
15
|
+
name: "rock",
|
|
16
|
+
...solidDefaults,
|
|
17
|
+
baseColorFactor: [0.5, 0.5, 0.5, 1],
|
|
18
|
+
emissiveFactor: [0, 0, 0],
|
|
19
|
+
metallicFactor: 0,
|
|
20
|
+
roughnessFactor: 0.8,
|
|
21
|
+
irReflectance: 0.1,
|
|
22
|
+
irEmission: 0,
|
|
23
|
+
emissionMode: 0,
|
|
24
|
+
restitution: 0.15,
|
|
25
|
+
density: 2650,
|
|
26
|
+
viscosity: 0,
|
|
27
|
+
heatCapacity: 800,
|
|
28
|
+
thermalConductivity: 4,
|
|
29
|
+
stressStrainCurve: noSolidCurve,
|
|
30
|
+
};
|
|
31
|
+
describe("materialByName index", () => {
|
|
32
|
+
it("returns the material entity for a known name", () => {
|
|
33
|
+
const db = Database.create(plugin);
|
|
34
|
+
const rock = db.transactions.insertMaterial(rockRow);
|
|
35
|
+
expect(db.indexes.materialByName.get({ name: "rock" })).toBe(rock);
|
|
36
|
+
});
|
|
37
|
+
it("returns null for an unknown name", () => {
|
|
38
|
+
const db = Database.create(plugin);
|
|
39
|
+
expect(db.indexes.materialByName.get({ name: "missing" })).toBeNull();
|
|
40
|
+
});
|
|
41
|
+
it("is populated by seedStandardMaterials", () => {
|
|
42
|
+
const db = Database.create(plugin);
|
|
43
|
+
db.transactions.seedStandardMaterials();
|
|
44
|
+
expect(db.indexes.materialByName.get({ name: "steel" })).not.toBeNull();
|
|
45
|
+
expect(db.indexes.materialByName.get({ name: "ice" })).not.toBeNull();
|
|
46
|
+
});
|
|
47
|
+
it("rejects duplicate material names", () => {
|
|
48
|
+
const db = Database.create(plugin);
|
|
49
|
+
db.transactions.insertMaterial(rockRow);
|
|
50
|
+
expect(() => db.transactions.insertMaterial(rockRow)).toThrow(/Unique index conflict/);
|
|
51
|
+
});
|
|
52
|
+
it("insertMaterial validates required fields", () => {
|
|
53
|
+
const db = Database.create(plugin);
|
|
54
|
+
expect(() => db.transactions.insertMaterial({ ...rockRow, density: undefined })).toThrow(/missing required fields.*density/);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
describe("requireMaterial", () => {
|
|
58
|
+
it("returns the material entity for a known name", () => {
|
|
59
|
+
const db = Database.create(plugin);
|
|
60
|
+
const rock = db.transactions.insertMaterial(rockRow);
|
|
61
|
+
expect(requireMaterial(db, "rock")).toBe(rock);
|
|
62
|
+
});
|
|
63
|
+
it("throws when the material was never seeded", () => {
|
|
64
|
+
const db = Database.create(plugin);
|
|
65
|
+
expect(() => requireMaterial(db, "missing")).toThrow(/Material "missing" is not in the registry/);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
describe("assembleMaterialRow", () => {
|
|
69
|
+
it("throws when a required field is missing from the definition", () => {
|
|
70
|
+
expect(() => assembleMaterialRow("bad", { baseColorFactor: [1, 1, 1, 1] })).toThrow(/missing required fields.*density/);
|
|
71
|
+
});
|
|
72
|
+
it("merges solidDefaults and returns a full row", () => {
|
|
73
|
+
const row = assembleMaterialRow("rock", {
|
|
74
|
+
baseColorFactor: [0.5, 0.5, 0.5, 1],
|
|
75
|
+
emissiveFactor: [0, 0, 0],
|
|
76
|
+
metallicFactor: 0,
|
|
77
|
+
roughnessFactor: 0.8,
|
|
78
|
+
density: 2650,
|
|
79
|
+
restitution: 0.15,
|
|
80
|
+
heatCapacity: 800,
|
|
81
|
+
});
|
|
82
|
+
expect(row.name).toBe("rock");
|
|
83
|
+
expect(row.density).toBe(2650);
|
|
84
|
+
expect(row.friction).toBe(solidDefaults.friction);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=material-plugin.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material-plugin.test.js","sourceRoot":"","sources":["../../src/material/material-plugin.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAEjF,MAAM,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC;IAC1C,wBAAwB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAChC,2BAA2B,EAAE,CAAC,CAAC,EAAE,CAA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AE,GAAG;SACpB,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import type { Vec3, Vec4 } from "@adobe/data/math";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
emissiveUrl: string;
|
|
30
|
-
}
|
|
2
|
+
import type { StressStrainCurve } from "./stress-strain-curve/stress-strain-curve.js";
|
|
3
|
+
/** One row of the `Material` archetype — one entity per material type. */
|
|
4
|
+
export type Material = {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly density: number;
|
|
7
|
+
readonly restitution: number;
|
|
8
|
+
readonly friction: number;
|
|
9
|
+
readonly compliance: number;
|
|
10
|
+
readonly heatCapacity: number;
|
|
11
|
+
readonly viscosity: number;
|
|
12
|
+
readonly thermalConductivity: number;
|
|
13
|
+
readonly stressStrainCurve: StressStrainCurve;
|
|
14
|
+
readonly baseColorFactor: Vec4;
|
|
15
|
+
readonly emissiveFactor: Vec3;
|
|
16
|
+
readonly metallicFactor: number;
|
|
17
|
+
readonly roughnessFactor: number;
|
|
18
|
+
readonly normalScale: number;
|
|
19
|
+
readonly occlusionStrength: number;
|
|
20
|
+
readonly irReflectance: number;
|
|
21
|
+
readonly irEmission: number;
|
|
22
|
+
readonly emissionMode: number;
|
|
23
|
+
readonly baseColorUrl: string;
|
|
24
|
+
readonly metallicRoughnessUrl: string;
|
|
25
|
+
readonly normalUrl: string;
|
|
26
|
+
readonly occlusionUrl: string;
|
|
27
|
+
readonly emissiveUrl: string;
|
|
28
|
+
};
|
|
31
29
|
export * as Material from "./public.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"material.js","sourceRoot":"","sources":["../../src/material/material.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"material.js","sourceRoot":"","sources":["../../src/material/material.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC"}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from "./material-plugin.js";
|
|
2
|
+
export * from "./emission-mode.js";
|
|
3
|
+
export * from "./assemble-material-row.js";
|
|
4
|
+
export * from "./require-material.js";
|
|
5
|
+
export * from "./material-by-name-lookup.js";
|
|
6
|
+
export * from "./standard-material-names.js";
|
|
7
|
+
export * from "./standard-materials.js";
|
|
8
|
+
export * from "./definitions.js";
|
|
9
|
+
export * from "./material-defaults.js";
|
|
10
|
+
export * from "./material-name.js";
|
|
11
|
+
export * from "./material.js";
|
|
12
|
+
export * as MaterialJson from "./json/public.js";
|
package/dist/material/public.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export * from "./material-plugin.js";
|
|
3
|
+
export * from "./emission-mode.js";
|
|
4
|
+
export * from "./assemble-material-row.js";
|
|
5
|
+
export * from "./require-material.js";
|
|
6
|
+
export * from "./material-by-name-lookup.js";
|
|
7
|
+
export * from "./standard-material-names.js";
|
|
8
|
+
export * from "./standard-materials.js";
|
|
9
|
+
export * from "./definitions.js";
|
|
10
|
+
export * from "./material-defaults.js";
|
|
11
|
+
export * from "./material-name.js";
|
|
12
|
+
export * from "./material.js";
|
|
13
|
+
export * as MaterialJson from "./json/public.js";
|
|
4
14
|
//# sourceMappingURL=public.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/material/public.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/material/public.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Entity } from "@adobe/data/ecs";
|
|
2
|
+
import type { MaterialByNameLookup } from "./material-by-name-lookup.js";
|
|
3
|
+
/** Returns the material entity for `name`, or throws if it was never seeded. */
|
|
4
|
+
export declare const requireMaterial: (db: MaterialByNameLookup, name: string) => Entity;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
+
/** Returns the material entity for `name`, or throws if it was never seeded. */
|
|
3
|
+
export const requireMaterial = (db, name) => {
|
|
4
|
+
const material = db.indexes.materialByName.get({ name });
|
|
5
|
+
if (material == null) {
|
|
6
|
+
throw new Error(`Material "${name}" is not in the registry — seed materials first (seedStandardMaterials or seedDefinitionMaterials).`);
|
|
7
|
+
}
|
|
8
|
+
return material;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=require-material.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-material.js","sourceRoot":"","sources":["../../src/material/require-material.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAKvD,gFAAgF;AAChF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAwB,EAAE,IAAY,EAAU,EAAE;IAC9E,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CACX,aAAa,IAAI,qGAAqG,CACzH,CAAC;IACN,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standard-material-names.js","sourceRoot":"","sources":["../../src/material/standard-material-names.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,+CAA+C;AAC/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC"}
|
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
// © 2026 Adobe. MIT License. See /LICENSE for details.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// Haven's `arm` map packs AO(R) / Roughness(G) / Metalness(B), matching glTF's
|
|
6
|
-
// occlusion + metallicRoughness channel conventions.
|
|
7
|
-
const tex = (slug, map) => `https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/${slug}/${slug}_${map}_1k.jpg`;
|
|
8
|
-
/**
|
|
9
|
-
* A standard material: physical constants (the old material table) plus neutral
|
|
10
|
-
* visible factors — the textures supply colour / roughness / metalness, so the
|
|
11
|
-
* factors are left at 1 and baseColor white.
|
|
12
|
-
*/
|
|
13
|
-
function standard(name, slug, density, restitution, friction, compliance, heatCapacity) {
|
|
2
|
+
import { solidDefaults } from "./material-defaults.js";
|
|
3
|
+
/** Factor-only sample materials (no map URLs — rendered via `pbrFactorRender`). */
|
|
4
|
+
function factor(name, baseColorFactor, metallicFactor, roughnessFactor, density, restitution, friction, compliance, heatCapacity) {
|
|
14
5
|
return {
|
|
15
6
|
name,
|
|
7
|
+
...solidDefaults,
|
|
16
8
|
density, restitution, friction, compliance, heatCapacity,
|
|
17
|
-
baseColorFactor
|
|
9
|
+
baseColorFactor,
|
|
18
10
|
emissiveFactor: [0, 0, 0],
|
|
19
|
-
metallicFactor
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
metallicFactor,
|
|
12
|
+
roughnessFactor,
|
|
13
|
+
baseColorUrl: "",
|
|
14
|
+
metallicRoughnessUrl: "",
|
|
15
|
+
normalUrl: "",
|
|
16
|
+
occlusionUrl: "",
|
|
24
17
|
emissiveUrl: "",
|
|
25
18
|
};
|
|
26
19
|
}
|
|
27
|
-
/**
|
|
20
|
+
/** Small factor library seeded by `seedStandardMaterials`. */
|
|
28
21
|
export const standardMaterials = [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
factor("rubber", [0.15, 0.15, 0.15, 1], 0.0, 0.90, 1.1, 0.80, 0.90, 1e-5, 2.0),
|
|
23
|
+
factor("wood", [0.55, 0.35, 0.20, 1], 0.0, 0.75, 0.6, 0.35, 0.70, 5e-7, 1.7),
|
|
24
|
+
factor("stone", [0.45, 0.43, 0.40, 1], 0.05, 0.85, 2.6, 0.20, 0.85, 1e-8, 0.8),
|
|
25
|
+
factor("steel", [0.70, 0.72, 0.75, 1], 0.9, 0.35, 7.8, 0.45, 0.50, 1e-9, 0.5),
|
|
26
|
+
factor("ice", [0.85, 0.92, 0.95, 1], 0.0, 0.15, 0.92, 0.25, 0.05, 5e-9, 2.1),
|
|
34
27
|
];
|
|
35
28
|
//# sourceMappingURL=standard-materials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-materials.js","sourceRoot":"","sources":["../../src/material/standard-materials.ts"],"names":[],"mappings":"AAAA,uDAAuD;
|
|
1
|
+
{"version":3,"file":"standard-materials.js","sourceRoot":"","sources":["../../src/material/standard-materials.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAGvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,mFAAmF;AACnF,SAAS,MAAM,CACX,IAAY,EACZ,eAAiD,EACjD,cAAsB,EACtB,eAAuB,EACvB,OAAe,EAAE,WAAmB,EAAE,QAAgB,EAAE,UAAkB,EAAE,YAAoB;IAEhG,OAAO;QACH,IAAI;QACJ,GAAG,aAAa;QAChB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY;QACxD,eAAe;QACf,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACzB,cAAc;QACd,eAAe;QACf,YAAY,EAAE,EAAE;QAChB,oBAAoB,EAAE,EAAE;QACxB,SAAS,EAAE,EAAE;QACb,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,EAAE;KAClB,CAAC;AACN,CAAC;AAED,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAwB;IAClD,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAG,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;IAC/E,MAAM,CAAC,MAAM,EAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAG,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;IAC/E,MAAM,CAAC,OAAO,EAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAG,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;IAChF,MAAM,CAAC,OAAO,EAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAG,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;IAC/E,MAAM,CAAC,KAAK,EAAK,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;CAClF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Vec2 } from "@adobe/data/math";
|
|
2
|
+
import type { StressStrainCurve } from "./stress-strain-curve.js";
|
|
3
|
+
export declare const create: (args: {
|
|
4
|
+
readonly tensileYieldStrainStress: Vec2;
|
|
5
|
+
readonly tensileFractureStrainStress: Vec2;
|
|
6
|
+
readonly compressiveYieldStrainStress: Vec2;
|
|
7
|
+
readonly compressiveFractureStrainStress: Vec2;
|
|
8
|
+
}) => StressStrainCurve;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/material/stress-strain-curve/create.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,IAKtB,EAAqB,EAAE,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/material/stress-strain-curve/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Uniaxial bilinear σ–ε curve points. Each Vec2 is [engineering strain, stress MPa]. */
|
|
2
|
+
export declare const schema: {
|
|
3
|
+
readonly type: "object";
|
|
4
|
+
readonly layout: "packed";
|
|
5
|
+
readonly properties: {
|
|
6
|
+
readonly tensileYieldStrainStress: {
|
|
7
|
+
readonly type: "array";
|
|
8
|
+
readonly items: {
|
|
9
|
+
readonly type: "number";
|
|
10
|
+
readonly precision: 1;
|
|
11
|
+
readonly default: number;
|
|
12
|
+
};
|
|
13
|
+
readonly minItems: 2;
|
|
14
|
+
readonly maxItems: 2;
|
|
15
|
+
readonly default: readonly [0, 0];
|
|
16
|
+
};
|
|
17
|
+
readonly tensileFractureStrainStress: {
|
|
18
|
+
readonly type: "array";
|
|
19
|
+
readonly items: {
|
|
20
|
+
readonly type: "number";
|
|
21
|
+
readonly precision: 1;
|
|
22
|
+
readonly default: number;
|
|
23
|
+
};
|
|
24
|
+
readonly minItems: 2;
|
|
25
|
+
readonly maxItems: 2;
|
|
26
|
+
readonly default: readonly [0, 0];
|
|
27
|
+
};
|
|
28
|
+
readonly compressiveYieldStrainStress: {
|
|
29
|
+
readonly type: "array";
|
|
30
|
+
readonly items: {
|
|
31
|
+
readonly type: "number";
|
|
32
|
+
readonly precision: 1;
|
|
33
|
+
readonly default: number;
|
|
34
|
+
};
|
|
35
|
+
readonly minItems: 2;
|
|
36
|
+
readonly maxItems: 2;
|
|
37
|
+
readonly default: readonly [0, 0];
|
|
38
|
+
};
|
|
39
|
+
readonly compressiveFractureStrainStress: {
|
|
40
|
+
readonly type: "array";
|
|
41
|
+
readonly items: {
|
|
42
|
+
readonly type: "number";
|
|
43
|
+
readonly precision: 1;
|
|
44
|
+
readonly default: number;
|
|
45
|
+
};
|
|
46
|
+
readonly minItems: 2;
|
|
47
|
+
readonly maxItems: 2;
|
|
48
|
+
readonly default: readonly [0, 0];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly required: readonly ["tensileYieldStrainStress", "tensileFractureStrainStress", "compressiveYieldStrainStress", "compressiveFractureStrainStress"];
|
|
52
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Vec2 } from "@adobe/data/math";
|
|
2
|
+
/** Uniaxial bilinear σ–ε curve points. Each Vec2 is [engineering strain, stress MPa]. */
|
|
3
|
+
export const schema = {
|
|
4
|
+
type: "object",
|
|
5
|
+
layout: "packed",
|
|
6
|
+
properties: {
|
|
7
|
+
tensileYieldStrainStress: Vec2.schema,
|
|
8
|
+
tensileFractureStrainStress: Vec2.schema,
|
|
9
|
+
compressiveYieldStrainStress: Vec2.schema,
|
|
10
|
+
compressiveFractureStrainStress: Vec2.schema,
|
|
11
|
+
},
|
|
12
|
+
required: [
|
|
13
|
+
"tensileYieldStrainStress",
|
|
14
|
+
"tensileFractureStrainStress",
|
|
15
|
+
"compressiveYieldStrainStress",
|
|
16
|
+
"compressiveFractureStrainStress",
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/material/stress-strain-curve/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGxC,yFAAyF;AACzF,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE;QACR,wBAAwB,EAAE,IAAI,CAAC,MAAM;QACrC,2BAA2B,EAAE,IAAI,CAAC,MAAM;QACxC,4BAA4B,EAAE,IAAI,CAAC,MAAM;QACzC,+BAA+B,EAAE,IAAI,CAAC,MAAM;KAC/C;IACD,QAAQ,EAAE;QACN,0BAA0B;QAC1B,6BAA6B;QAC7B,8BAA8B;QAC9B,iCAAiC;KACpC;CACsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { getStructLayout } from "@adobe/data/typed-buffer";
|
|
3
|
+
import { StressStrainCurve } from "./stress-strain-curve.js";
|
|
4
|
+
describe("StressStrainCurve.schema — struct layout", () => {
|
|
5
|
+
it("is a valid struct layout", () => {
|
|
6
|
+
expect(() => getStructLayout(StressStrainCurve.schema)).not.toThrow();
|
|
7
|
+
});
|
|
8
|
+
it("uses packed layout with four vec2 fields", () => {
|
|
9
|
+
const layout = getStructLayout(StressStrainCurve.schema);
|
|
10
|
+
expect(layout.layout).toBe("packed");
|
|
11
|
+
expect(layout.size).toBe(32);
|
|
12
|
+
expect(layout.fields.tensileYieldStrainStress.offset).toBe(0);
|
|
13
|
+
expect(layout.fields.tensileFractureStrainStress.offset).toBe(8);
|
|
14
|
+
expect(layout.fields.compressiveYieldStrainStress.offset).toBe(16);
|
|
15
|
+
expect(layout.fields.compressiveFractureStrainStress.offset).toBe(24);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=schema.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.test.js","sourceRoot":"","sources":["../../../src/material/stress-strain-curve/schema.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,QAAQ,CAAC,0CAA0C,EAAE,GAAG,EAAE;IACtD,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAChC,MAAM,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAChD,MAAM,MAAM,GAAG,eAAe,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAEzD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,+BAA+B,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stress-strain-curve.js","sourceRoot":"","sources":["../../../src/material/stress-strain-curve/stress-strain-curve.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,iBAAiB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mass-from-volume.js","sourceRoot":"","sources":["../../../../src/physics/body/collider-shape/mass-from-volume.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,wEAAwE;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,OAAe,EAAU,EAAE,CAAC,MAAM,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|