@motionscript/core 0.1.0 → 0.1.1-alpha.1
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/CHANGELOG.md +16 -0
- package/dist/assets/asset-index.d.ts +1 -8
- package/dist/assets/asset-index.d.ts.map +1 -1
- package/dist/assets/asset-index.js +1 -8
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.d.ts +10 -72
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +3 -29
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts +8 -20
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +8 -20
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts +9 -51
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +13 -78
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/record.d.ts +2 -18
- package/dist/assets/record.d.ts.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.d.ts +3 -18
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +2 -11
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +2 -12
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -1
- package/dist/attributes/audio/effects/chain.js +1 -7
- package/dist/attributes/audio/effects/chain.js.map +1 -1
- package/dist/attributes/audio/effects/registry.d.ts +3 -18
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -1
- package/dist/attributes/audio/effects/registry.js +4 -23
- package/dist/attributes/audio/effects/registry.js.map +1 -1
- package/dist/attributes/audio/ramp.d.ts +5 -38
- package/dist/attributes/audio/ramp.d.ts.map +1 -1
- package/dist/attributes/audio/ramp.js +3 -28
- package/dist/attributes/audio/ramp.js.map +1 -1
- package/dist/attributes/audio/request.d.ts +10 -80
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +1 -4
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +2 -12
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +2 -11
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +2 -26
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +1 -9
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +1 -8
- package/dist/attributes/audio/transition.d.ts.map +1 -1
- package/dist/attributes/audio/transition.js.map +1 -1
- package/dist/attributes/layout/alignment.d.ts +6 -38
- package/dist/attributes/layout/alignment.d.ts.map +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +2 -27
- package/dist/attributes/layout/insets.d.ts.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +29 -114
- package/dist/attributes/layout/matrix2d.d.ts.map +1 -1
- package/dist/attributes/layout/matrix2d.js +26 -110
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +3 -25
- package/dist/attributes/layout/size.d.ts.map +1 -1
- package/dist/attributes/layout/size.js +2 -18
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.d.ts +16 -79
- package/dist/attributes/layout/space3d.d.ts.map +1 -1
- package/dist/attributes/layout/space3d.js +17 -81
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/layout/transform3d.d.ts +2 -23
- package/dist/attributes/layout/transform3d.d.ts.map +1 -1
- package/dist/attributes/layout/transform3d.js +1 -7
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/world-transform.d.ts +2 -16
- package/dist/attributes/layout/world-transform.d.ts.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +13 -73
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +9 -40
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +6 -45
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +6 -37
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +11 -83
- package/dist/attributes/render3d/orbit.d.ts.map +1 -1
- package/dist/attributes/render3d/orbit.js +10 -73
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -6
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.d.ts +4 -25
- package/dist/attributes/shape/corners/corner-style.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js +2 -12
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.d.ts +2 -21
- package/dist/attributes/shape/corners/corners.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corners.js +2 -12
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +2 -18
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js +3 -26
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +36 -328
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +24 -242
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +19 -127
- package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js +6 -33
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +6 -26
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +0 -3
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +2 -21
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +0 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +0 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +0 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -11
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +1 -6
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +4 -35
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +1 -7
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -22
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +0 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +0 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +2 -15
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +0 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +0 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +7 -47
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +1 -9
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +0 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +5 -29
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +0 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +3 -12
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +0 -1
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +2 -19
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +1 -5
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +11 -36
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +2 -8
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +3 -17
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +2 -11
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +0 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +2 -14
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +0 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +1 -15
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +0 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +1 -10
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +0 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +3 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +1 -2
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +2 -16
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +0 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +0 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +10 -53
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +2 -9
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +0 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +0 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +0 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +0 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +0 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +3 -24
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +1 -5
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +6 -41
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +7 -45
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +6 -30
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -1
- package/dist/attributes/shape/effects/spec.js +3 -9
- package/dist/attributes/shape/effects/spec.js.map +1 -1
- package/dist/attributes/shape/fill/blend.d.ts +1 -17
- package/dist/attributes/shape/fill/blend.d.ts.map +1 -1
- package/dist/attributes/shape/fill/blend.js +2 -15
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +17 -125
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +22 -109
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.d.ts +10 -35
- package/dist/attributes/shape/fill/coerce.d.ts.map +1 -1
- package/dist/attributes/shape/fill/coerce.js +12 -47
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +10 -44
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +15 -91
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +1 -8
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.js +2 -13
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -24
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.js +2 -9
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts +1 -14
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts +5 -28
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +0 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.d.ts +8 -21
- package/dist/attributes/shape/fill/implementations/grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js +2 -8
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts +13 -79
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +6 -23
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.d.ts +2 -15
- package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +11 -45
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +5 -17
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +12 -64
- package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +12 -50
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +2 -13
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +2 -9
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.d.ts +8 -49
- package/dist/attributes/shape/fill/media-preset.d.ts.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js +8 -35
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +2 -26
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +5 -40
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.d.ts +6 -30
- package/dist/attributes/shape/fill/union.d.ts.map +1 -1
- package/dist/attributes/shape/fill/union.js +1 -9
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +15 -168
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +8 -132
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.d.ts +1 -11
- package/dist/attributes/shape/filters/implementations/echo.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -6
- package/dist/attributes/shape/filters/index.d.ts.map +1 -1
- package/dist/attributes/shape/filters/index.js +0 -2
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +5 -35
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +7 -50
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +10 -51
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts +18 -106
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +15 -124
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.d.ts +6 -54
- package/dist/attributes/shape/path/bezier.d.ts.map +1 -1
- package/dist/attributes/shape/path/bezier.js +10 -98
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.d.ts +1 -11
- package/dist/attributes/shape/path/index.d.ts.map +1 -1
- package/dist/attributes/shape/path/index.js +1 -11
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.d.ts +5 -41
- package/dist/attributes/shape/path/measure.d.ts.map +1 -1
- package/dist/attributes/shape/path/measure.js +8 -57
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts +4 -41
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +17 -117
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +5 -19
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.d.ts +10 -67
- package/dist/attributes/shape/path/types.d.ts.map +1 -1
- package/dist/attributes/shape/path/types.js +0 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.d.ts +9 -63
- package/dist/attributes/shape/path/walk.d.ts.map +1 -1
- package/dist/attributes/shape/path/walk.js +21 -100
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +2 -14
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/language.js +1 -8
- package/dist/attributes/shape/shaders/language.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.d.ts +13 -78
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +1 -10
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +1 -11
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -28
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +3 -24
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.d.ts +3 -20
- package/dist/attributes/shape/shadow/shadow.d.ts.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js +0 -3
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +9 -58
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +0 -6
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +1 -8
- package/dist/attributes/shared/operators.d.ts.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.d.ts +1 -11
- package/dist/attributes/text/index.d.ts.map +1 -1
- package/dist/attributes/text/index.js +1 -11
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +4 -30
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +7 -23
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.d.ts +5 -28
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-5GLXFSCC.js +13 -0
- package/dist/browser/chunks/chunk-5GLXFSCC.js.map +7 -0
- package/dist/browser/chunks/{chunk-CCGVIR4F.js → chunk-5TDMGUXQ.js} +3 -3
- package/dist/browser/chunks/chunk-5TDMGUXQ.js.map +7 -0
- package/dist/browser/chunks/{chunk-4BDLFEOC.js → chunk-GEJEQQER.js} +1 -1
- package/dist/browser/chunks/chunk-GEJEQQER.js.map +7 -0
- package/dist/browser/chunks/chunk-MNMIIGNE.js +6 -0
- package/dist/browser/chunks/chunk-MNMIIGNE.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +3 -10
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +3 -10
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/geometry/geometry.d.ts +15 -62
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -1
- package/dist/components/builtins/geometry/geometry.js.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.d.ts +12 -61
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.js +29 -168
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
- package/dist/components/builtins/layout/layout.d.ts +1 -14
- package/dist/components/builtins/layout/layout.d.ts.map +1 -1
- package/dist/components/builtins/layout/layout.js.map +1 -1
- package/dist/components/builtins/media/media.d.ts +11 -51
- package/dist/components/builtins/media/media.d.ts.map +1 -1
- package/dist/components/builtins/media/media.js +3 -7
- package/dist/components/builtins/media/media.js.map +1 -1
- package/dist/components/builtins/text/number-format.d.ts +14 -47
- package/dist/components/builtins/text/number-format.d.ts.map +1 -1
- package/dist/components/builtins/text/number-format.js +19 -69
- package/dist/components/builtins/text/number-format.js.map +1 -1
- package/dist/components/builtins/text/number-pattern.d.ts +3 -37
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -1
- package/dist/components/builtins/text/number-pattern.js +6 -48
- package/dist/components/builtins/text/number-pattern.js.map +1 -1
- package/dist/components/builtins/text/text-defaults.d.ts +7 -25
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -1
- package/dist/components/builtins/text/text-defaults.js +7 -25
- package/dist/components/builtins/text/text-defaults.js.map +1 -1
- package/dist/components/builtins/text/text-layout.d.ts +2 -11
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -1
- package/dist/components/builtins/text/text-layout.js +7 -22
- package/dist/components/builtins/text/text-layout.js.map +1 -1
- package/dist/components/builtins/text/text.d.ts +8 -46
- package/dist/components/builtins/text/text.d.ts.map +1 -1
- package/dist/components/builtins/text/text.js.map +1 -1
- package/dist/components/builtins/three/canvas3d.d.ts +6 -51
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -1
- package/dist/components/builtins/three/canvas3d.js.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.d.ts +3 -39
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js +8 -46
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
- package/dist/components/builtins/three/three.d.ts +22 -117
- package/dist/components/builtins/three/three.d.ts.map +1 -1
- package/dist/components/builtins/three/three.js +5 -17
- package/dist/components/builtins/three/three.js.map +1 -1
- package/dist/components/factory/api.d.ts.map +1 -1
- package/dist/components/factory/api.js.map +1 -1
- package/dist/components/factory/style.d.ts +38 -0
- package/dist/components/factory/style.d.ts.map +1 -0
- package/dist/components/factory/style.js +104 -0
- package/dist/components/factory/style.js.map +1 -0
- package/dist/components/factory/types.d.ts +9 -0
- package/dist/components/factory/types.d.ts.map +1 -1
- package/dist/components/factory/types.js +11 -0
- package/dist/components/factory/types.js.map +1 -1
- package/dist/components/factory/views.d.ts.map +1 -1
- package/dist/components/factory/views.js +0 -2
- package/dist/components/factory/views.js.map +1 -1
- package/dist/components/trees/2d/group-bounds.d.ts +12 -41
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -1
- package/dist/components/trees/2d/group-bounds.js +3 -22
- package/dist/components/trees/2d/group-bounds.js.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.d.ts +8 -36
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.js +35 -127
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
- package/dist/components/trees/2d/node-motion.d.ts +4 -36
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -1
- package/dist/components/trees/2d/node-motion.js +3 -31
- package/dist/components/trees/2d/node-motion.js.map +1 -1
- package/dist/components/trees/2d/node-render.d.ts +3 -20
- package/dist/components/trees/2d/node-render.d.ts.map +1 -1
- package/dist/components/trees/2d/node-render.js +4 -23
- package/dist/components/trees/2d/node-render.js.map +1 -1
- package/dist/components/trees/2d/node-space.d.ts +4 -23
- package/dist/components/trees/2d/node-space.d.ts.map +1 -1
- package/dist/components/trees/2d/node-space.js +3 -17
- package/dist/components/trees/2d/node-space.js.map +1 -1
- package/dist/components/trees/2d/node-transform.d.ts +4 -33
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -1
- package/dist/components/trees/2d/node-transform.js +4 -33
- package/dist/components/trees/2d/node-transform.js.map +1 -1
- package/dist/components/trees/2d/node2d.d.ts +112 -622
- package/dist/components/trees/2d/node2d.d.ts.map +1 -1
- package/dist/components/trees/2d/node2d.js +131 -605
- package/dist/components/trees/2d/node2d.js.map +1 -1
- package/dist/components/trees/audio/node-audio.d.ts +17 -65
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
- package/dist/components/trees/audio/node-audio.js +18 -68
- package/dist/components/trees/audio/node-audio.js.map +1 -1
- package/dist/components/trees/node/node-editor-state.d.ts +5 -45
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -1
- package/dist/components/trees/node/node-editor-state.js +1 -13
- package/dist/components/trees/node/node-editor-state.js.map +1 -1
- package/dist/components/trees/node/node-reactive.d.ts +6 -53
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
- package/dist/components/trees/node/node-reactive.js +4 -33
- package/dist/components/trees/node/node-reactive.js.map +1 -1
- package/dist/components/trees/node/node-time.d.ts +2 -15
- package/dist/components/trees/node/node-time.d.ts.map +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -1
- package/dist/components/trees/node/node-walk.d.ts +7 -32
- package/dist/components/trees/node/node-walk.d.ts.map +1 -1
- package/dist/components/trees/node/node-walk.js +7 -32
- package/dist/components/trees/node/node-walk.js.map +1 -1
- package/dist/components/trees/node/node.d.ts +43 -248
- package/dist/components/trees/node/node.d.ts.map +1 -1
- package/dist/components/trees/node/node.js +51 -229
- package/dist/components/trees/node/node.js.map +1 -1
- package/dist/components/trees/root/canvas2d-node.d.ts +7 -60
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -1
- package/dist/components/trees/root/canvas2d-node.js +7 -47
- package/dist/components/trees/root/canvas2d-node.js.map +1 -1
- package/dist/components/trees/three/node3d.d.ts +24 -112
- package/dist/components/trees/three/node3d.d.ts.map +1 -1
- package/dist/components/trees/three/node3d.js +22 -104
- package/dist/components/trees/three/node3d.js.map +1 -1
- package/dist/document/audio.d.ts +9 -21
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +13 -28
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts +3 -9
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +43 -89
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +14 -37
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +22 -39
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +9 -43
- package/dist/document/deny-globals.d.ts.map +1 -1
- package/dist/document/deny-globals.js +18 -58
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts +6 -16
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +5 -11
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +5 -13
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +0 -2
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts +2 -2
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -18
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.d.ts +11 -41
- package/dist/document/expression/index.d.ts.map +1 -1
- package/dist/document/expression/index.js +11 -41
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.d.ts +3 -12
- package/dist/document/expression/ops.d.ts.map +1 -1
- package/dist/document/expression/ops.js +4 -20
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts +4 -14
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +34 -55
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +2 -8
- package/dist/document/expression/refs.d.ts.map +1 -1
- package/dist/document/expression/refs.js +2 -6
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.d.ts +18 -63
- package/dist/document/expression/types.d.ts.map +1 -1
- package/dist/document/expression/types.js +4 -15
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.d.ts +6 -20
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +18 -44
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.js +2 -3
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +7 -22
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +44 -15
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/missing-node.d.ts +4 -11
- package/dist/document/missing-node.d.ts.map +1 -1
- package/dist/document/missing-node.js +2 -5
- package/dist/document/missing-node.js.map +1 -1
- package/dist/document/node-decorator.d.ts +12 -53
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +16 -57
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +25 -62
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +18 -41
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js +4 -11
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +19 -52
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +2 -6
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +10 -20
- package/dist/document/prop-evolution.d.ts.map +1 -1
- package/dist/document/prop-evolution.js +3 -7
- package/dist/document/prop-evolution.js.map +1 -1
- package/dist/document/registry.d.ts +80 -318
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +43 -147
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +11 -23
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +15 -34
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.d.ts +6 -15
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +12 -21
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +56 -263
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +71 -275
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +90 -264
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +13 -30
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +10 -40
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +72 -137
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +4 -7
- package/dist/document/vocabulary.d.ts.map +1 -1
- package/dist/document/vocabulary.js +0 -1
- package/dist/document/vocabulary.js.map +1 -1
- package/dist/experimental.d.ts +2 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.d.ts +1 -11
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/flex.d.ts +6 -20
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +7 -28
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/ops.d.ts +2 -11
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +2 -22
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.d.ts +11 -55
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +7 -43
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js +4 -29
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +5 -31
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/stepped-clock.d.ts +1 -16
- package/dist/platform/stepped-clock.d.ts.map +1 -1
- package/dist/platform/stepped-clock.js +1 -16
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +8 -68
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +8 -60
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +11 -45
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +10 -37
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.d.ts +4 -14
- package/dist/project/config.d.ts.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/tree.d.ts +6 -35
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js +1 -8
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +2 -13
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/layout.d.ts +1 -12
- package/dist/props/layout.d.ts.map +1 -1
- package/dist/props/layout.js +1 -12
- package/dist/props/layout.js.map +1 -1
- package/dist/props/observer.d.ts +1 -7
- package/dist/props/observer.d.ts.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.d.ts +6 -19
- package/dist/props/slot.d.ts.map +1 -1
- package/dist/props/slot.js +5 -14
- package/dist/props/slot.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +8 -68
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +8 -69
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.d.ts +2 -16
- package/dist/render/clip-contains.d.ts.map +1 -1
- package/dist/render/clip-contains.js +21 -82
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +7 -25
- package/dist/render/clip.d.ts.map +1 -1
- package/dist/render/clip.js +5 -17
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.d.ts.map +1 -1
- package/dist/render/descriptors/ellipse.js +0 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/line.d.ts.map +1 -1
- package/dist/render/descriptors/line.js +0 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.d.ts +4 -32
- package/dist/render/descriptors/path-builder.d.ts.map +1 -1
- package/dist/render/descriptors/path-builder.js +3 -25
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.d.ts +1 -11
- package/dist/render/descriptors/path.d.ts.map +1 -1
- package/dist/render/descriptors/path.js +0 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.d.ts.map +1 -1
- package/dist/render/descriptors/polygon.js +0 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.d.ts.map +1 -1
- package/dist/render/descriptors/polygram.js +0 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.d.ts.map +1 -1
- package/dist/render/descriptors/rect.js +0 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.d.ts.map +1 -1
- package/dist/render/descriptors/richtext.js +0 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +17 -77
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js +13 -47
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +15 -94
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +8 -50
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +5 -16
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js +1 -17
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +24 -116
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +23 -108
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/measure-context.d.ts +5 -29
- package/dist/render/measure-context.d.ts.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.d.ts +2 -20
- package/dist/render/null-render-context.d.ts.map +1 -1
- package/dist/render/null-render-context.js +2 -20
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +52 -208
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/surface.d.ts +2 -19
- package/dist/render/surface.d.ts.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.d.ts +1 -17
- package/dist/render/text-defaults.d.ts.map +1 -1
- package/dist/render/text-defaults.js +6 -40
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.d.ts +12 -55
- package/dist/render/text-layout.d.ts.map +1 -1
- package/dist/render/text-layout.js +2 -16
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts +10 -32
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +2 -12
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.d.ts +8 -35
- package/dist/render3d/builders.d.ts.map +1 -1
- package/dist/render3d/builders.js +8 -35
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +10 -57
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +4 -26
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +7 -45
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +15 -85
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +18 -106
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js +2 -20
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +29 -133
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +23 -110
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -16
- package/dist/render3d/index.d.ts.map +1 -1
- package/dist/render3d/index.js +1 -16
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts.map +1 -1
- package/dist/render3d/inert.js +1 -14
- package/dist/render3d/inert.js.map +1 -1
- package/dist/render3d/light.d.ts +3 -26
- package/dist/render3d/light.d.ts.map +1 -1
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.d.ts +13 -87
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js +2 -16
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.d.ts +14 -68
- package/dist/render3d/matrix4.d.ts.map +1 -1
- package/dist/render3d/matrix4.js +11 -60
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.d.ts +13 -51
- package/dist/render3d/render-context3d.d.ts.map +1 -1
- package/dist/render3d/render-context3d.js +9 -21
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.d.ts +9 -53
- package/dist/render3d/resources.d.ts.map +1 -1
- package/dist/render3d/resources.js +8 -48
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.d.ts +7 -21
- package/dist/render3d/rounded-box.d.ts.map +1 -1
- package/dist/render3d/rounded-box.js +7 -46
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +20 -78
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +11 -53
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +12 -59
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.d.ts +2 -25
- package/dist/render3d/segments.d.ts.map +1 -1
- package/dist/render3d/segments.js +1 -11
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.d.ts +25 -112
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +3 -27
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.d.ts +2 -19
- package/dist/render3d/tracking.d.ts.map +1 -1
- package/dist/render3d/tracking.js +2 -19
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.d.ts +14 -60
- package/dist/render3d/transform.d.ts.map +1 -1
- package/dist/render3d/transform.js +0 -2
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +6 -48
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +4 -38
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +3 -27
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -33
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +34 -20
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +127 -31
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +14 -53
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js +6 -27
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts +7 -26
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +6 -18
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -2
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -2
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.d.ts +3 -9
- package/dist/runtime/builtin-context.d.ts.map +1 -1
- package/dist/runtime/builtin-context.js +3 -9
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +12 -39
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +21 -45
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +26 -68
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +47 -81
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +31 -85
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +16 -49
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +4 -15
- package/dist/runtime/frame-time.d.ts.map +1 -1
- package/dist/runtime/frame-time.js +5 -12
- package/dist/runtime/frame-time.js.map +1 -1
- package/dist/runtime/index.d.ts +0 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +0 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +59 -139
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +87 -157
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +39 -96
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +98 -141
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts +8 -17
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +7 -16
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +78 -207
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +111 -226
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.d.ts +6 -14
- package/dist/runtime/playback.d.ts.map +1 -1
- package/dist/runtime/playback.js +6 -14
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/project-assets.d.ts +6 -14
- package/dist/runtime/project-assets.d.ts.map +1 -1
- package/dist/runtime/project-assets.js +7 -16
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +22 -45
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +26 -46
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.d.ts +4 -10
- package/dist/runtime/settle.d.ts.map +1 -1
- package/dist/runtime/settle.js +4 -10
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +15 -37
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +27 -44
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +18 -47
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +13 -27
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -7
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +30 -138
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +6 -26
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +1 -6
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +6 -53
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +5 -40
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/curve.d.ts +2 -17
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +1 -6
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +0 -11
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +0 -23
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.d.ts +2 -18
- package/dist/tween/ease/spec.d.ts.map +1 -1
- package/dist/tween/ease/spec.js.map +1 -1
- package/dist/tween/inert.d.ts +1 -14
- package/dist/tween/inert.d.ts.map +1 -1
- package/dist/tween/inert.js +1 -14
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.d.ts +2 -26
- package/dist/tween/lerp.d.ts.map +1 -1
- package/dist/tween/lerp.js +2 -26
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.d.ts +9 -50
- package/dist/tween/loop.d.ts.map +1 -1
- package/dist/tween/loop.js +6 -31
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +2 -30
- package/dist/tween/prepare.d.ts.map +1 -1
- package/dist/tween/prepare.js +2 -30
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/stepper.d.ts +4 -25
- package/dist/tween/stepper.d.ts.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.d.ts +1 -8
- package/dist/tween/to-command.d.ts.map +1 -1
- package/dist/tween/to-command.js +2 -25
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/context.d.ts +4 -29
- package/dist/util/context.d.ts.map +1 -1
- package/dist/util/context.js +3 -15
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.d.ts +4 -29
- package/dist/util/csv.d.ts.map +1 -1
- package/dist/util/csv.js +3 -22
- package/dist/util/csv.js.map +1 -1
- package/dist/util/metrics.d.ts +2 -26
- package/dist/util/metrics.d.ts.map +1 -1
- package/dist/util/metrics.js +2 -26
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.d.ts +20 -87
- package/dist/util/random.d.ts.map +1 -1
- package/dist/util/random.js +20 -87
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.d.ts +6 -35
- package/dist/util/reference.d.ts.map +1 -1
- package/dist/util/reference.js +1 -4
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.d.ts +6 -27
- package/dist/util/scheduler.d.ts.map +1 -1
- package/dist/util/scheduler.js +8 -35
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +0 -7
- package/dist/browser/chunks/chunk-CCGVIR4F.js.map +0 -7
- package/dist/browser/chunks/chunk-N4WSN5WY.js +0 -13
- package/dist/browser/chunks/chunk-N4WSN5WY.js.map +0 -7
- package/dist/browser/chunks/chunk-WZSI3GSK.js +0 -6
- package/dist/browser/chunks/chunk-WZSI3GSK.js.map +0 -7
- package/dist/renamed-scene-names.d.ts +0 -17
- package/dist/renamed-scene-names.d.ts.map +0 -1
- package/dist/renamed-scene-names.js +0 -9
- package/dist/renamed-scene-names.js.map +0 -1
- package/dist/runtime/precompisition.d.ts +0 -24
- package/dist/runtime/precompisition.d.ts.map +0 -1
- package/dist/runtime/precompisition.js +0 -7
- package/dist/runtime/precompisition.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphics3d.d.ts","sourceRoot":"","sources":["../../src/render3d/graphics3d.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EACR,aAAa,EAAoB,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EACpF,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAClE,eAAe,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EACvE,eAAe,EAAE,mBAAmB,EAAE,cAAc,EACvD,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEtD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"graphics3d.d.ts","sourceRoot":"","sources":["../../src/render3d/graphics3d.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EACR,aAAa,EAAoB,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EACpF,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAClE,eAAe,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EACvE,eAAe,EAAE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3D } from "./inert.js";
|
|
3
|
-
/**
|
|
4
|
-
* Op kinds that put something in the scene (as opposed to shaping the tree).
|
|
5
|
-
*
|
|
6
|
-
* Shared with `Scene3D`, whose op list is this one plus `push`/`pop`/`light`/
|
|
7
|
-
* `camera` — so "is anything actually drawn here" has a single definition.
|
|
8
|
-
*/
|
|
3
|
+
/** Op kinds that put something in the scene; shared with `Scene3D` (this list plus `push`/`pop`/`light`/`camera`) so "is anything drawn here" has one definition. */
|
|
9
4
|
/** @internal */
|
|
10
5
|
export const DRAWABLE_KINDS = new Set([
|
|
11
6
|
"mesh", "light", "instances", "points", "line", "sprite", "model",
|
|
@@ -14,12 +9,7 @@ const TRANSFORM_KEYS = [
|
|
|
14
9
|
"position", "rotation", "quaternion", "scale", "lookAt",
|
|
15
10
|
"visible", "shadow", "renderOrder",
|
|
16
11
|
];
|
|
17
|
-
/**
|
|
18
|
-
* Shorthand keys copied straight onto the built descriptor.
|
|
19
|
-
*
|
|
20
|
-
* `fill` is deliberately absent: it resolves into `color` *and* `map` rather than
|
|
21
|
-
* being one field, so it is handled on its own in {@link resolveMaterialShorthand3D}.
|
|
22
|
-
*/
|
|
12
|
+
/** Shorthand keys copied straight onto the built descriptor. `fill` is absent: it resolves into `color` and `map`, handled in {@link resolveMaterialShorthand3D}. */
|
|
23
13
|
const MATERIAL_SHORTHAND_KEYS = [
|
|
24
14
|
"opacity", "roughness", "metalness",
|
|
25
15
|
"emission", "emissionStrength", "normalMap", "roughnessMap",
|
|
@@ -28,12 +18,7 @@ const MATERIAL_SHORTHAND_KEYS = [
|
|
|
28
18
|
];
|
|
29
19
|
/** Every key the shorthand owns, for stripping a geometry bag. */
|
|
30
20
|
const SHORTHAND_KEYS = [...MATERIAL_SHORTHAND_KEYS, "fill", "material", "unlit"];
|
|
31
|
-
/**
|
|
32
|
-
* Pull the {@link Transform3D} fields out of a shorthand bag. Takes `object` so
|
|
33
|
-
* the concrete option types at each call site pass without a cast, and returns
|
|
34
|
-
* `undefined` rather than `{}` when there is nothing to apply — an absent
|
|
35
|
-
* transform lets the renderer skip the matrix write entirely.
|
|
36
|
-
*/
|
|
21
|
+
/** Pulls the {@link Transform3D} fields out of a shorthand bag; `undefined` rather than `{}` when none, so the renderer can skip the matrix write. */
|
|
37
22
|
function pickTransform(source) {
|
|
38
23
|
const bag = source;
|
|
39
24
|
let out;
|
|
@@ -44,12 +29,9 @@ function pickTransform(source) {
|
|
|
44
29
|
return out;
|
|
45
30
|
}
|
|
46
31
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* Exported because `Mesh3D` desugars the identical bag from its own props: this
|
|
51
|
-
* is where `fill` becomes `color`-or-`map`, and two copies of that decision is
|
|
52
|
-
* two chances for a node and a builder call to paint differently.
|
|
32
|
+
* Builds the material a shorthand bag describes; always one, so a drawable op never needs "...or the default"
|
|
33
|
+
* handling. Exported because `Mesh3D` desugars the same bag from its props: one place decides how `fill` becomes
|
|
34
|
+
* `color`-or-`map`, so a node and a builder call paint alike.
|
|
53
35
|
*
|
|
54
36
|
* @internal
|
|
55
37
|
*/
|
|
@@ -83,65 +65,27 @@ function pickGeometry(source, type) {
|
|
|
83
65
|
}
|
|
84
66
|
return out;
|
|
85
67
|
}
|
|
86
|
-
// ─── Recorder ────────────────────────────────────────────────────────────────
|
|
87
68
|
/**
|
|
88
|
-
* What one 3D node draws
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* sprites, models), each with its own geometry, material and local transform.
|
|
92
|
-
* That is the whole surface: it holds no camera, no lights and no hierarchy,
|
|
93
|
-
* because those are properties of a *scene* rather than of a thing in one, and
|
|
94
|
-
* the `Node3D` tree owns them. The exact division `Graphics2D` and
|
|
95
|
-
* `RenderContext2D` already make in 2D.
|
|
69
|
+
* What one 3D node draws: the `Graphics2D` of 3D. Records an ordered list of drawables (meshes, instanced meshes,
|
|
70
|
+
* points, lines, sprites, models), each with its own geometry, material and local transform; camera, lights and
|
|
71
|
+
* hierarchy belong to the `Node3D` tree and its scene. A built `Graphics3D` is spliced into a {@link RenderContext3D}.
|
|
96
72
|
*
|
|
97
73
|
* render: (ctx) => ctx.draw(new Graphics3D()
|
|
98
74
|
* .box({ width: 2, cornerRadius: 0.15, fill: "#e0533d", roughness: 0.3 })),
|
|
99
75
|
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* ── One flat bag, deliberately ────────────────────────────────────────────────
|
|
104
|
-
* `Graphics2D` paints with a *chained* `.rect(…).fill(…)`, and this does not,
|
|
105
|
-
* which is the one place the two recorders diverge on purpose. In 2D a `fill` is
|
|
106
|
-
* a **group-scoped op** covering the shapes recorded before it; in 3D a material
|
|
107
|
-
* belongs to exactly one object, because a mesh *is* geometry plus material.
|
|
108
|
-
* A chained `.box().fill()` would imply a group material that has nothing to
|
|
109
|
-
* scope over, so the shape and what it is made of are stated together instead.
|
|
110
|
-
*
|
|
111
|
-
* ── Angles are DEGREES ────────────────────────────────────────────────────────
|
|
112
|
-
* Every angle here — Euler rotations, sweep arcs, UV rotation — is in degrees,
|
|
113
|
-
* matching the engine's 2D `rotation`. The renderer converts.
|
|
76
|
+
* One flat bag, not chained paint: in 2D a `fill` is a group-scoped op over earlier shapes, but in 3D a material
|
|
77
|
+
* belongs to exactly one object, so shape and material are stated together.
|
|
114
78
|
*
|
|
115
|
-
*
|
|
116
|
-
* A `Graphics3D` is rebuilt from scratch every frame, so animation is just
|
|
117
|
-
* reading the node's own state while building:
|
|
79
|
+
* Angles are DEGREES (Euler rotations, sweep arcs, UV rotation), matching 2D `rotation`; the renderer converts.
|
|
118
80
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* state: { spin: 0, lift: Types.custom<Vector3>([0, 0, 0], { lerp: lerpVector3 }) },
|
|
122
|
-
* render: (ctx, s) => ctx.draw(new Graphics3D()
|
|
123
|
-
* .box({ rotation: [0, s.spin, 0], position: s.lift })),
|
|
124
|
-
* });
|
|
125
|
-
* // a `to` of { spin: 360 } over two seconds turns it
|
|
81
|
+
* Rebuilt from scratch every frame, so animation is reading the node's own state while building. A state entry
|
|
82
|
+
* holding a non-number needs an explicit tween (`lerpVector3`, `lerpEuler3`, `slerpQuaternion`) or `to()` leaves it alone.
|
|
126
83
|
*
|
|
127
|
-
*
|
|
128
|
-
* tween (`lerpVector3`, `lerpEuler3`, `slerpQuaternion`) or `to()` has nothing
|
|
129
|
-
* to interpolate it with and leaves it alone.
|
|
84
|
+
* Reconciliation identity is derived from the owning `Node3D` plus a signature of what the op draws; there is no `key` to set.
|
|
130
85
|
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* `Node3D` plus a signature of what the op actually draws, so a builder that
|
|
135
|
-
* emits ops conditionally reuses the right cache entry with nothing written by
|
|
136
|
-
* hand. There is no `key` to set.
|
|
137
|
-
*
|
|
138
|
-
* ── What is cheap to animate ──────────────────────────────────────────────────
|
|
139
|
-
* Transforms and most material values are in-place writes, so they cost nothing
|
|
140
|
-
* per frame. **Geometry parameters are not** — three geometries are immutable, so
|
|
141
|
-
* tweening `.box({ width: this.size })` reallocates the mesh every frame. Scale
|
|
142
|
-
* the object instead: `.box({ width: 1, scale: [this.size, 1, 1] })`. The fields marked
|
|
143
|
-
* "structural" on `MaterialCommon3D` recompile the shader program and should be
|
|
144
|
-
* set once, not tweened.
|
|
86
|
+
* Transforms and most material values are cheap in-place writes. Geometry parameters are not (three geometries are
|
|
87
|
+
* immutable, so tweening `.box({ width })` reallocates every frame): scale the object instead. Fields marked
|
|
88
|
+
* "structural" on `MaterialCommon3D` recompile the shader and should be set once.
|
|
145
89
|
*/
|
|
146
90
|
export class Graphics3D {
|
|
147
91
|
_ops = [];
|
|
@@ -150,11 +94,7 @@ export class Graphics3D {
|
|
|
150
94
|
inspectDrawable3D(op);
|
|
151
95
|
this._ops.push(op);
|
|
152
96
|
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Record a mesh from an explicit geometry and material. The geometry sugar
|
|
156
|
-
* methods below all funnel here.
|
|
157
|
-
*/
|
|
97
|
+
/** Records a mesh from an explicit geometry and material; the sugar methods below funnel here. */
|
|
158
98
|
mesh(geometry, material, transform) {
|
|
159
99
|
this.record({
|
|
160
100
|
kind: "mesh",
|
|
@@ -211,14 +151,7 @@ export class Graphics3D {
|
|
|
211
151
|
tube(options) {
|
|
212
152
|
return this.sugar("tube", options);
|
|
213
153
|
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Record many copies of one geometry in a single draw call. The way to put
|
|
217
|
-
* thousands of objects on screen — a plain `mesh` per copy would not keep up.
|
|
218
|
-
*
|
|
219
|
-
* g3.instances(Geo.box({ width: 0.2 }), Mat.standard({ color: "cyan" }),
|
|
220
|
-
* positions.map(p => ({ position: p })))
|
|
221
|
-
*/
|
|
154
|
+
/** Records many copies of one geometry in a single draw call, for thousands of objects where a `mesh` per copy wouldn't keep up. */
|
|
222
155
|
instances(geometry, material, instances, options) {
|
|
223
156
|
this.record({
|
|
224
157
|
kind: "instances",
|
|
@@ -240,15 +173,7 @@ export class Graphics3D {
|
|
|
240
173
|
});
|
|
241
174
|
return this;
|
|
242
175
|
}
|
|
243
|
-
/**
|
|
244
|
-
* Record a line. Give it either explicit `points` or a `geometry` (typically
|
|
245
|
-
* `Geo.edges(...)` for a wireframe outline).
|
|
246
|
-
*
|
|
247
|
-
* `closed` joins the last point back to the first, as the 2D `line` op's
|
|
248
|
-
* own field does. `segments` treats the points as disjoint start/end pairs
|
|
249
|
-
* instead — the form `Geo.edges(...)` produces. (There is no subdivision to
|
|
250
|
-
* confuse it with: a line is drawn from the points it is given.)
|
|
251
|
-
*/
|
|
176
|
+
/** Records a line from explicit `points` or a `geometry` (typically `Geo.edges(...)`). `closed` joins the last point to the first; `segments` treats points as disjoint start/end pairs, the form `Geo.edges(...)` produces. */
|
|
252
177
|
line(options) {
|
|
253
178
|
const { points, geometry, material, closed, segments, stroke, opacity } = options;
|
|
254
179
|
if (!points && !geometry) {
|
|
@@ -289,14 +214,7 @@ export class Graphics3D {
|
|
|
289
214
|
});
|
|
290
215
|
return this;
|
|
291
216
|
}
|
|
292
|
-
/**
|
|
293
|
-
* Record a loaded model. **glTF/GLB only**: any other format (an `.obj`, say)
|
|
294
|
-
* resolves to an empty slot and draws nothing, and in development the first
|
|
295
|
-
* one recorded warns.
|
|
296
|
-
*
|
|
297
|
-
* Baked animation is sampled by explicit `time`, never advanced by a delta, so
|
|
298
|
-
* a model stays frame-identical under scrubbing.
|
|
299
|
-
*/
|
|
217
|
+
/** Records a loaded model. **glTF/GLB only**: any other format resolves to an empty slot and draws nothing (in development the first warns). Baked animation is sampled by explicit `time`, so a model stays frame-identical under scrubbing. */
|
|
300
218
|
model(options) {
|
|
301
219
|
const { src, animation, override } = options;
|
|
302
220
|
this.record({
|
|
@@ -310,7 +228,6 @@ export class Graphics3D {
|
|
|
310
228
|
});
|
|
311
229
|
return this;
|
|
312
230
|
}
|
|
313
|
-
// ─── Consumption ─────────────────────────────────────────────────────────
|
|
314
231
|
/** The recorded ops, in order. Replayed by the renderer. */
|
|
315
232
|
ops() {
|
|
316
233
|
return this._ops;
|
|
@@ -323,11 +240,7 @@ export class Graphics3D {
|
|
|
323
240
|
/** The buffer each points array was last flattened into, and the revision it was uploaded under. */
|
|
324
241
|
const lineBuffers = new WeakMap();
|
|
325
242
|
let lineRevision = 0;
|
|
326
|
-
/**
|
|
327
|
-
* `points` as a line's buffer. The same array holding the same values gets the
|
|
328
|
-
* same buffer and revision back, so a renderer uploads an unchanged line once,
|
|
329
|
-
* not every frame; the values are checked, so one changed in place still lands.
|
|
330
|
-
*/
|
|
243
|
+
/** `points` as a line's buffer. The same array with the same values gets the same buffer and revision back, so an unchanged line uploads once; values are checked, so an in-place change still lands. */
|
|
331
244
|
function lineBuffer(points) {
|
|
332
245
|
let kept = lineBuffers.get(points);
|
|
333
246
|
if (!kept || !holds(kept.position, points)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-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CAAC,CAAC;IACX,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import type { Color } from \"@/attributes/shape/fill/color/parser\";\nimport type {\n BoxGeometry3D, BufferGeometry3D, CapsuleGeometry3D, CircleGeometry3D, ConeGeometry3D,\n CylinderGeometry3D, ExtrudeGeometry3D, Geometry3D, LatheGeometry3D,\n PlaneGeometry3D, PolyhedronGeometry3D, RingGeometry3D, SphereGeometry3D,\n TorusGeometry3D, TorusKnotGeometry3D, TubeGeometry3D,\n} from \"./geometry\";\nimport type { Material3D, Shading3D } from \"./material\";\nimport type { Texture3D } from \"./texture\";\nimport { resolveFill3D, type Fill3D } from \"./fill3d\";\nimport { inspectDrawable3D } from \"./inert\";\nimport { type Transform3D, type Blend3D, type Faces3D } from \"./transform\";\nimport type { Vector3Input } from \"./vector3\";\n\n// ─── Ops ─────────────────────────────────────────────────────────────────────\n\n/** One clip of a model's baked animation, sampled at an explicit time. */\nexport interface ModelAnimation3D {\n /** Clip name, or its index in the file. Defaults to the first clip. */\n clip?: string | number;\n /**\n * Seconds into the clip. **Explicit by design** — the renderer seeks to this\n * time rather than advancing by a delta, which is what keeps a model's\n * animation identical whether the frame was reached by playing forward or by\n * scrubbing backwards.\n */\n time: number;\n /** Blend weight, for cross-fading clips. Default 1. */\n weight?: number;\n}\n\n/**\n * How a `line` op connects its points: in order, or as disjoint start/end pairs,\n * or in order and closed back to the start.\n */\nexport type LineMode3D = \"strip\" | \"segments\" | \"loop\";\n\n/**\n * One recorded operation in a {@link Graphics3D} command list.\n *\n * Every op draws something. Hierarchy, lights and the camera are *scene*\n * concerns, recorded by the `Node3D` tree into a `Scene3D` — this is only ever\n * \"what one node paints\", which is exactly what a `Graphics2D` is in 2D.\n *\n * A drawable's geometry and material are *inline sub-descriptors*, not ops,\n * because in a 3D scene graph they are properties of an object rather than\n * children of it.\n */\nexport type Graphics3DOp =\n | { kind: \"mesh\"; geometry: Geometry3D; material: Material3D | readonly Material3D[]; transform?: Transform3D }\n | {\n kind: \"instances\";\n geometry: Geometry3D;\n material: Material3D;\n /** Per-instance placement. Length drives the instance count. */\n instances: readonly Transform3D[];\n /** Per-instance tint. Needs a material that reads instance colour. */\n colors?: readonly Color[];\n transform?: Transform3D;\n }\n | { kind: \"points\"; geometry: Geometry3D; material: Material3D; transform?: Transform3D }\n | {\n kind: \"line\";\n geometry: Geometry3D;\n material: Material3D;\n mode: LineMode3D;\n transform?: Transform3D;\n }\n | { kind: \"sprite\"; material: Material3D; transform?: Transform3D }\n | {\n kind: \"model\";\n src: string;\n animation?: readonly ModelAnimation3D[];\n /** Replace materials on the loaded graph, keyed by mesh or material name. */\n override?: Readonly<Record<string, Material3D>>;\n transform?: Transform3D;\n };\n\n/**\n * Op kinds that put something in the scene (as opposed to shaping the tree).\n *\n * Shared with `Scene3D`, whose op list is this one plus `push`/`pop`/`light`/\n * `camera` — so \"is anything actually drawn here\" has a single definition.\n */\n/** @internal */\nexport const DRAWABLE_KINDS: ReadonlySet<string> = new Set([\n \"mesh\", \"light\", \"instances\", \"points\", \"line\", \"sprite\", \"model\",\n]);\n\n// ─── Shorthand ───────────────────────────────────────────────────────────────\n\n/**\n * Material fields promoted onto the geometry sugar methods, so the common case is\n * one flat call: `.box({ width: 2, fill: \"red\", roughness: 0.3 })`.\n *\n * `fill` is the whole 2D fill vocabulary — see {@link Fill3D} — and is what a\n * flat `color` plus a `map` slot used to be. The rest is surface *response*\n * (how light behaves on it) rather than colour, which is the line Spline's\n * material panel draws too and the reason those stay separate fields.\n *\n * These desugar at record time into a full {@link Material3D} — `standard` by\n * default, `basic` when {@link unlit} is set — so the recorded op list stays\n * canonical. Pass {@link material} to bypass the shorthand entirely; every\n * renderer-level knob that is not a design decision (`depthWrite`, `alphaTest`,\n * `toneMapped`, `polygonOffset`, …) lives there and only there.\n */\nexport interface MaterialShorthand3D {\n /** A full descriptor (or an array, for multi-material). Wins over the rest. */\n material?: Material3D | readonly Material3D[];\n /** What the surface is made of: a colour, a texture, a gradient, 2D content. */\n fill?: Fill3D;\n opacity?: number;\n roughness?: number;\n metalness?: number;\n /** Self-illumination. Bloom in the post chain is what makes it glow. */\n emission?: Color;\n emissionStrength?: number;\n normalMap?: Texture3D;\n roughnessMap?: Texture3D;\n metalnessMap?: Texture3D;\n aoMap?: Texture3D;\n alphaMap?: Texture3D;\n envMapIntensity?: number;\n wireframe?: boolean;\n /** Facet or smooth shading. Default `\"smooth\"`. */\n shading?: Shading3D;\n /** Which faces to rasterize. Default `\"front\"`. */\n faces?: Faces3D;\n vertexColors?: boolean;\n blend?: Blend3D;\n /** Shade with an unlit `basic` material instead of `standard`. */\n unlit?: boolean;\n}\n\n/** Transform + material shorthand, accepted by every geometry sugar method. */\nexport type MeshShorthand3D = Transform3D & MaterialShorthand3D;\n\nconst TRANSFORM_KEYS = [\n \"position\", \"rotation\", \"quaternion\", \"scale\", \"lookAt\",\n \"visible\", \"shadow\", \"renderOrder\",\n] as const;\n\n/**\n * Shorthand keys copied straight onto the built descriptor.\n *\n * `fill` is deliberately absent: it resolves into `color` *and* `map` rather than\n * being one field, so it is handled on its own in {@link resolveMaterialShorthand3D}.\n */\nconst MATERIAL_SHORTHAND_KEYS = [\n \"opacity\", \"roughness\", \"metalness\",\n \"emission\", \"emissionStrength\", \"normalMap\", \"roughnessMap\",\n \"metalnessMap\", \"aoMap\", \"alphaMap\", \"envMapIntensity\", \"wireframe\",\n \"shading\", \"faces\", \"vertexColors\", \"blend\",\n] as const;\n\n/** Every key the shorthand owns, for stripping a geometry bag. */\nconst SHORTHAND_KEYS: readonly string[] = [...MATERIAL_SHORTHAND_KEYS, \"fill\", \"material\", \"unlit\"];\n\n/**\n * Pull the {@link Transform3D} fields out of a shorthand bag. Takes `object` so\n * the concrete option types at each call site pass without a cast, and returns\n * `undefined` rather than `{}` when there is nothing to apply — an absent\n * transform lets the renderer skip the matrix write entirely.\n */\nfunction pickTransform(source: object): Transform3D | undefined {\n const bag = source as Record<string, unknown>;\n let out: Record<string, unknown> | undefined;\n for (const key of TRANSFORM_KEYS) {\n if (bag[key] !== undefined) (out ??= {})[key] = bag[key];\n }\n return out as Transform3D | undefined;\n}\n\n/**\n * Build the material a shorthand bag describes. Always returns one, so a recorded\n * drawable op never has to be interpreted with \"…or the default\" in mind.\n *\n * Exported because `Mesh3D` desugars the identical bag from its own props: this\n * is where `fill` becomes `color`-or-`map`, and two copies of that decision is\n * two chances for a node and a builder call to paint differently.\n *\n * @internal\n */\nexport function resolveMaterialShorthand3D(source: MaterialShorthand3D): Material3D | readonly Material3D[] {\n if (source.material !== undefined) return source.material;\n\n const material: Record<string, unknown> = { type: source.unlit ? \"basic\" : \"standard\" };\n\n const fill = resolveFill3D(source.fill);\n if (fill.color !== undefined) material.color = fill.color;\n if (fill.map !== undefined) material.map = fill.map;\n\n for (const key of MATERIAL_SHORTHAND_KEYS) {\n const value = (source as Record<string, unknown>)[key];\n if (value !== undefined) material[key] = value;\n }\n return material as unknown as Material3D;\n}\n\n/** Drop the shorthand/transform keys, leaving only a geometry's own params. */\nfunction pickGeometry<T>(source: object, type: string): T {\n const bag = source as Record<string, unknown>;\n const out: Record<string, unknown> = { type };\n for (const key in bag) {\n if (SHORTHAND_KEYS.includes(key)) continue;\n if ((TRANSFORM_KEYS as readonly string[]).includes(key)) continue;\n if (bag[key] !== undefined) out[key] = bag[key];\n }\n return out as T;\n}\n\n/** Geometry params only, with `type` and the inherited passthrough removed. */\ntype ParamsOf<G> = Omit<G, \"type\">;\n\n// ─── Recorder ────────────────────────────────────────────────────────────────\n\n/**\n * What one 3D node draws — the `Graphics2D` of 3D.\n *\n * Records an ordered list of drawables (meshes, instanced meshes, points, lines,\n * sprites, models), each with its own geometry, material and local transform.\n * That is the whole surface: it holds no camera, no lights and no hierarchy,\n * because those are properties of a *scene* rather than of a thing in one, and\n * the `Node3D` tree owns them. The exact division `Graphics2D` and\n * `RenderContext2D` already make in 2D.\n *\n * render: (ctx) => ctx.draw(new Graphics3D()\n * .box({ width: 2, cornerRadius: 0.15, fill: \"#e0533d\", roughness: 0.3 })),\n *\n * Nothing here touches a renderer: a built `Graphics3D` is handed to a\n * {@link RenderContext3D}, which splices its ops into the scene being recorded.\n *\n * ── One flat bag, deliberately ────────────────────────────────────────────────\n * `Graphics2D` paints with a *chained* `.rect(…).fill(…)`, and this does not,\n * which is the one place the two recorders diverge on purpose. In 2D a `fill` is\n * a **group-scoped op** covering the shapes recorded before it; in 3D a material\n * belongs to exactly one object, because a mesh *is* geometry plus material.\n * A chained `.box().fill()` would imply a group material that has nothing to\n * scope over, so the shape and what it is made of are stated together instead.\n *\n * ── Angles are DEGREES ────────────────────────────────────────────────────────\n * Every angle here — Euler rotations, sweep arcs, UV rotation — is in degrees,\n * matching the engine's 2D `rotation`. The renderer converts.\n *\n * ── Animation ─────────────────────────────────────────────────────────────────\n * A `Graphics3D` is rebuilt from scratch every frame, so animation is just\n * reading the node's own state while building:\n *\n * const Rig = component3d({\n * key: \"rig\",\n * state: { spin: 0, lift: Types.custom<Vector3>([0, 0, 0], { lerp: lerpVector3 }) },\n * render: (ctx, s) => ctx.draw(new Graphics3D()\n * .box({ rotation: [0, s.spin, 0], position: s.lift })),\n * });\n * // a `to` of { spin: 360 } over two seconds turns it\n *\n * Note the `lerp` on `lift`. An entry holding a non-number needs an explicit\n * tween (`lerpVector3`, `lerpEuler3`, `slerpQuaternion`) or `to()` has nothing\n * to interpolate it with and leaves it alone.\n *\n * ── Reconciliation identity ───────────────────────────────────────────────────\n * The renderer caches one live 3D object per op and mutates it between frames\n * rather than rebuilding. Identity is **derived**: it comes from the owning\n * `Node3D` plus a signature of what the op actually draws, so a builder that\n * emits ops conditionally reuses the right cache entry with nothing written by\n * hand. There is no `key` to set.\n *\n * ── What is cheap to animate ──────────────────────────────────────────────────\n * Transforms and most material values are in-place writes, so they cost nothing\n * per frame. **Geometry parameters are not** — three geometries are immutable, so\n * tweening `.box({ width: this.size })` reallocates the mesh every frame. Scale\n * the object instead: `.box({ width: 1, scale: [this.size, 1, 1] })`. The fields marked\n * \"structural\" on `MaterialCommon3D` recompile the shader program and should be\n * set once, not tweened.\n */\nexport class Graphics3D {\n private _ops: Graphics3DOp[] = [];\n\n /** Append one op, flagging (in development) inputs no renderer acts on. */\n private record(op: Graphics3DOp): void {\n inspectDrawable3D(op);\n this._ops.push(op);\n }\n\n // ─── Meshes ──────────────────────────────────────────────────────────────\n\n /**\n * Record a mesh from an explicit geometry and material. The geometry sugar\n * methods below all funnel here.\n */\n mesh(\n geometry: Geometry3D,\n material?: Material3D | readonly Material3D[],\n transform?: Transform3D,\n ): this {\n this.record({\n kind: \"mesh\",\n geometry,\n material: material ?? { type: \"standard\" },\n transform,\n });\n return this;\n }\n\n /** Record a mesh from a geometry `type` plus a flat shorthand bag. */\n private sugar(type: Geometry3D[\"type\"], options?: MeshShorthand3D): this {\n const source: MeshShorthand3D = options ?? {};\n return this.mesh(\n pickGeometry<Geometry3D>(source, type),\n resolveMaterialShorthand3D(source),\n pickTransform(source),\n );\n }\n\n box(options?: ParamsOf<BoxGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"box\", options);\n }\n sphere(options?: ParamsOf<SphereGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"sphere\", options);\n }\n plane(options?: ParamsOf<PlaneGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"plane\", options);\n }\n cylinder(options?: ParamsOf<CylinderGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"cylinder\", options);\n }\n cone(options?: ParamsOf<ConeGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"cone\", options);\n }\n torus(options?: ParamsOf<TorusGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"torus\", options);\n }\n torusKnot(options?: ParamsOf<TorusKnotGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"torusKnot\", options);\n }\n circle(options?: ParamsOf<CircleGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"circle\", options);\n }\n ring(options?: ParamsOf<RingGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"ring\", options);\n }\n capsule(options?: ParamsOf<CapsuleGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"capsule\", options);\n }\n polyhedron(options: ParamsOf<PolyhedronGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"polyhedron\", options);\n }\n extrude(options: ParamsOf<ExtrudeGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"extrude\", options);\n }\n lathe(options: ParamsOf<LatheGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"lathe\", options);\n }\n tube(options: ParamsOf<TubeGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"tube\", options);\n }\n\n // ─── Other drawables ─────────────────────────────────────────────────────\n\n /**\n * Record many copies of one geometry in a single draw call. The way to put\n * thousands of objects on screen — a plain `mesh` per copy would not keep up.\n *\n * g3.instances(Geo.box({ width: 0.2 }), Mat.standard({ color: \"cyan\" }),\n * positions.map(p => ({ position: p })))\n */\n instances(\n geometry: Geometry3D,\n material: Material3D,\n instances: readonly Transform3D[],\n options?: { colors?: readonly Color[]; transform?: Transform3D },\n ): this {\n this.record({\n kind: \"instances\",\n geometry,\n material,\n instances,\n colors: options?.colors,\n transform: options?.transform,\n });\n return this;\n }\n\n /** Record a point cloud — one sprite-like dot per vertex of `geometry`. */\n points(\n geometry: Geometry3D,\n material?: Material3D,\n transform?: Transform3D,\n ): this {\n this.record({\n kind: \"points\",\n geometry,\n material: material ?? { type: \"points\" },\n transform,\n });\n return this;\n }\n\n /**\n * Record a line. Give it either explicit `points` or a `geometry` (typically\n * `Geo.edges(...)` for a wireframe outline).\n *\n * `closed` joins the last point back to the first, as the 2D `line` op's\n * own field does. `segments` treats the points as disjoint start/end pairs\n * instead — the form `Geo.edges(...)` produces. (There is no subdivision to\n * confuse it with: a line is drawn from the points it is given.)\n */\n line(options: {\n points?: readonly Vector3Input[];\n geometry?: Geometry3D;\n material?: Material3D;\n /** Join the last point back to the first. */\n closed?: boolean;\n /** Treat the points as disjoint start/end pairs. */\n segments?: boolean;\n /** The line's paint. Cap and join have no meaning on a GL line. */\n stroke?: LineStroke3D;\n opacity?: number;\n transform?: Transform3D;\n } & Transform3D): this {\n const { points, geometry, material, closed, segments, stroke, opacity } = options;\n\n if (!points && !geometry) {\n throw new Error(\"Graphics3D.line() needs either `points` or `geometry`.\");\n }\n\n const resolved: Material3D = material ?? {\n type: stroke?.dash !== undefined ? \"lineDashed\" : \"lineBasic\",\n ...(stroke?.fill !== undefined ? { color: stroke.fill } : {}),\n ...(stroke?.weight !== undefined ? { width: stroke.weight } : {}),\n ...(stroke?.dash !== undefined\n ? { dashSize: stroke.dash[0], gapSize: stroke.dash[1] ?? stroke.dash[0] }\n : {}),\n ...(opacity !== undefined ? { opacity } : {}),\n } as Material3D;\n\n this.record({\n kind: \"line\",\n geometry: geometry ?? lineBuffer(points!),\n material: resolved,\n mode: segments ? \"segments\" : closed ? \"loop\" : \"strip\",\n transform: pickTransform(options),\n });\n return this;\n }\n\n /** Record a camera-facing textured quad. */\n sprite(options: { fill?: Fill3D; material?: Material3D; opacity?: number } & Transform3D): this {\n const { fill, material, opacity } = options;\n const paint = resolveFill3D(fill);\n const resolved: Material3D = material ?? {\n type: \"sprite\",\n ...(paint.map !== undefined ? { map: paint.map } : {}),\n ...(paint.color !== undefined ? { color: paint.color } : {}),\n ...(opacity !== undefined ? { opacity } : {}),\n } as Material3D;\n this.record({\n kind: \"sprite\",\n material: resolved,\n transform: pickTransform(options),\n });\n return this;\n }\n\n /**\n * Record a loaded model. **glTF/GLB only**: any other format (an `.obj`, say)\n * resolves to an empty slot and draws nothing, and in development the first\n * one recorded warns.\n *\n * Baked animation is sampled by explicit `time`, never advanced by a delta, so\n * a model stays frame-identical under scrubbing.\n */\n model(options: {\n src: string;\n animation?: ModelAnimation3D | readonly ModelAnimation3D[];\n override?: Readonly<Record<string, Material3D>>;\n } & Transform3D): this {\n const { src, animation, override } = options;\n this.record({\n kind: \"model\",\n src,\n animation: animation === undefined\n ? undefined\n : Array.isArray(animation) ? animation : [animation as ModelAnimation3D],\n override,\n transform: pickTransform(options),\n });\n return this;\n }\n\n // ─── Consumption ─────────────────────────────────────────────────────────\n\n /** The recorded ops, in order. Replayed by the renderer. */\n ops(): readonly Graphics3DOp[] {\n return this._ops;\n }\n\n /** True when this node draws nothing. */\n isEmpty(): boolean {\n return this._ops.length === 0;\n }\n}\n\n/**\n * A 3D line's paint, named after the 2D `Stroke` it mirrors.\n *\n * `cap`, `join` and the rest of the 2D stroke vocabulary are deliberately absent:\n * they describe a stroked *path*, and a GL line has no outline to cap. Note that\n * `weight` above 1 is ignored by most WebGL implementations — for a genuinely\n * thick line, draw a `tube`.\n */\nexport interface LineStroke3D {\n /** The line's colour. Named `fill` to match the 2D `Stroke`. */\n fill?: Color;\n weight?: number;\n /** Dash and gap lengths, in world units. */\n dash?: readonly [number, number?];\n}\n\n/** The buffer each points array was last flattened into, and the revision it was uploaded under. */\nconst lineBuffers = new WeakMap<readonly Vector3Input[], { readonly position: Float32Array; readonly revision: number }>();\nlet lineRevision = 0;\n\n/**\n * `points` as a line's buffer. The same array holding the same values gets the\n * same buffer and revision back, so a renderer uploads an unchanged line once,\n * not every frame; the values are checked, so one changed in place still lands.\n */\nfunction lineBuffer(points: readonly Vector3Input[]): BufferGeometry3D {\n let kept = lineBuffers.get(points);\n if (!kept || !holds(kept.position, points)) {\n kept = { position: flattenPoints(points), revision: ++lineRevision };\n lineBuffers.set(points, kept);\n }\n return { type: \"buffer\", position: kept.position, revision: kept.revision };\n}\n\n/** Flatten `Vector3Input`s into the packed `[x, y, z, …]` a buffer wants. */\nfunction flattenPoints(points: readonly Vector3Input[]): Float32Array {\n const out = new Float32Array(points.length * 3);\n let i = 0;\n for (const point of points) {\n if (typeof point === \"number\") {\n out[i] = out[i + 1] = out[i + 2] = point;\n } else if (Array.isArray(point)) {\n out[i] = point[0] ?? 0;\n out[i + 1] = point[1] ?? 0;\n out[i + 2] = point[2] ?? 0;\n } else {\n const v = point as { x: number; y: number; z: number };\n out[i] = v.x ?? 0;\n out[i + 1] = v.y ?? 0;\n out[i + 2] = v.z ?? 0;\n }\n i += 3;\n }\n return out;\n}\n\n/** Whether `buffer` is what flattening `points` would give. */\nfunction holds(buffer: Float32Array, points: readonly Vector3Input[]): boolean {\n if (buffer.length !== points.length * 3) return false;\n let i = 0;\n for (const point of points) {\n let x: number, y: number, z: number;\n if (typeof point === \"number\") {\n x = y = z = point;\n } else if (Array.isArray(point)) {\n x = point[0] ?? 0;\n y = point[1] ?? 0;\n z = point[2] ?? 0;\n } else {\n const v = point as { x: number; y: number; z: number };\n x = v.x ?? 0;\n y = v.y ?? 0;\n z = v.z ?? 0;\n }\n if (buffer[i] !== Math.fround(x) || buffer[i + 1] !== Math.fround(y) || buffer[i + 2] !== Math.fround(z)) return false;\n i += 3;\n }\n return true;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"graphics3d.js","sourceRoot":"","sources":["../../src/render3d/graphics3d.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAe,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgD5C,qKAAqK;AACrK,gBAAgB;AAChB,MAAM,CAAC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IACvD,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO;CACpE,CAAC,CAAC;AAwCH,MAAM,cAAc,GAAG;IACnB,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ;IACvD,SAAS,EAAE,QAAQ,EAAE,aAAa;CAC5B,CAAC;AAEX,qKAAqK;AACrK,MAAM,uBAAuB,GAAG;IAC5B,SAAS,EAAE,WAAW,EAAE,WAAW;IACnC,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,cAAc;IAC3D,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,WAAW;IACnE,SAAS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C;YACb,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACb,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QACvH,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import type { Color } from \"@/attributes/shape/fill/color/parser\";\nimport type {\n BoxGeometry3D, BufferGeometry3D, CapsuleGeometry3D, CircleGeometry3D, ConeGeometry3D,\n CylinderGeometry3D, ExtrudeGeometry3D, Geometry3D, LatheGeometry3D,\n PlaneGeometry3D, PolyhedronGeometry3D, RingGeometry3D, SphereGeometry3D,\n TorusGeometry3D, TorusKnotGeometry3D, TubeGeometry3D,\n} from \"./geometry\";\nimport type { Material3D, Shading3D } from \"./material\";\nimport type { Texture3D } from \"./texture\";\nimport { resolveFill3D, type Fill3D } from \"./fill3d\";\nimport { inspectDrawable3D } from \"./inert\";\nimport { type Transform3D, type Blend3D, type Faces3D } from \"./transform\";\nimport type { Vector3Input } from \"./vector3\";\n\n/** One clip of a model's baked animation, sampled at an explicit time. */\nexport interface ModelAnimation3D {\n /** Clip name, or its index in the file. Defaults to the first clip. */\n clip?: string | number;\n /** Seconds into the clip. **Explicit by design**: the renderer seeks to it rather than advancing by a delta, so animation is identical whether reached by playing forward or scrubbing back. */\n time: number;\n /** Blend weight, for cross-fading clips. Default 1. */\n weight?: number;\n}\n\n/** How a `line` op connects its points: in order, as disjoint start/end pairs, or in order and closed back to the start. */\nexport type LineMode3D = \"strip\" | \"segments\" | \"loop\";\n\n/** One recorded operation in a {@link Graphics3D} command list: what one node paints, like a `Graphics2D`. Hierarchy, lights and the camera are scene concerns recorded into a `Scene3D`. Geometry and material are inline sub-descriptors, not ops, since in a 3D graph they are properties of an object rather than children. */\nexport type Graphics3DOp =\n | { kind: \"mesh\"; geometry: Geometry3D; material: Material3D | readonly Material3D[]; transform?: Transform3D }\n | {\n kind: \"instances\";\n geometry: Geometry3D;\n material: Material3D;\n /** Per-instance placement. Length drives the instance count. */\n instances: readonly Transform3D[];\n /** Per-instance tint. Needs a material that reads instance colour. */\n colors?: readonly Color[];\n transform?: Transform3D;\n }\n | { kind: \"points\"; geometry: Geometry3D; material: Material3D; transform?: Transform3D }\n | {\n kind: \"line\";\n geometry: Geometry3D;\n material: Material3D;\n mode: LineMode3D;\n transform?: Transform3D;\n }\n | { kind: \"sprite\"; material: Material3D; transform?: Transform3D }\n | {\n kind: \"model\";\n src: string;\n animation?: readonly ModelAnimation3D[];\n /** Replace materials on the loaded graph, keyed by mesh or material name. */\n override?: Readonly<Record<string, Material3D>>;\n transform?: Transform3D;\n };\n\n/** Op kinds that put something in the scene; shared with `Scene3D` (this list plus `push`/`pop`/`light`/`camera`) so \"is anything drawn here\" has one definition. */\n/** @internal */\nexport const DRAWABLE_KINDS: ReadonlySet<string> = new Set([\n \"mesh\", \"light\", \"instances\", \"points\", \"line\", \"sprite\", \"model\",\n]);\n\n/**\n * Material fields promoted onto the geometry sugar methods so the common case is one flat call:\n * `.box({ width: 2, fill: \"red\", roughness: 0.3 })`. `fill` is the whole 2D fill vocabulary ({@link Fill3D}); the\n * rest is surface response rather than colour. These desugar at record time into a full {@link Material3D}\n * (`standard`, or `basic` when {@link unlit}), keeping the op list canonical. {@link material} bypasses the\n * shorthand; renderer-level knobs (`depthWrite`, `alphaTest`, `toneMapped`, `polygonOffset`, ...) live only there.\n */\nexport interface MaterialShorthand3D {\n /** A full descriptor (or an array, for multi-material). Wins over the rest. */\n material?: Material3D | readonly Material3D[];\n /** What the surface is made of: a colour, a texture, a gradient, 2D content. */\n fill?: Fill3D;\n opacity?: number;\n roughness?: number;\n metalness?: number;\n /** Self-illumination. Bloom in the post chain is what makes it glow. */\n emission?: Color;\n emissionStrength?: number;\n normalMap?: Texture3D;\n roughnessMap?: Texture3D;\n metalnessMap?: Texture3D;\n aoMap?: Texture3D;\n alphaMap?: Texture3D;\n envMapIntensity?: number;\n wireframe?: boolean;\n /** Facet or smooth shading. Default `\"smooth\"`. */\n shading?: Shading3D;\n /** Which faces to rasterize. Default `\"front\"`. */\n faces?: Faces3D;\n vertexColors?: boolean;\n blend?: Blend3D;\n /** Shade with an unlit `basic` material instead of `standard`. */\n unlit?: boolean;\n}\n\n/** Transform + material shorthand, accepted by every geometry sugar method. */\nexport type MeshShorthand3D = Transform3D & MaterialShorthand3D;\n\nconst TRANSFORM_KEYS = [\n \"position\", \"rotation\", \"quaternion\", \"scale\", \"lookAt\",\n \"visible\", \"shadow\", \"renderOrder\",\n] as const;\n\n/** Shorthand keys copied straight onto the built descriptor. `fill` is absent: it resolves into `color` and `map`, handled in {@link resolveMaterialShorthand3D}. */\nconst MATERIAL_SHORTHAND_KEYS = [\n \"opacity\", \"roughness\", \"metalness\",\n \"emission\", \"emissionStrength\", \"normalMap\", \"roughnessMap\",\n \"metalnessMap\", \"aoMap\", \"alphaMap\", \"envMapIntensity\", \"wireframe\",\n \"shading\", \"faces\", \"vertexColors\", \"blend\",\n] as const;\n\n/** Every key the shorthand owns, for stripping a geometry bag. */\nconst SHORTHAND_KEYS: readonly string[] = [...MATERIAL_SHORTHAND_KEYS, \"fill\", \"material\", \"unlit\"];\n\n/** Pulls the {@link Transform3D} fields out of a shorthand bag; `undefined` rather than `{}` when none, so the renderer can skip the matrix write. */\nfunction pickTransform(source: object): Transform3D | undefined {\n const bag = source as Record<string, unknown>;\n let out: Record<string, unknown> | undefined;\n for (const key of TRANSFORM_KEYS) {\n if (bag[key] !== undefined) (out ??= {})[key] = bag[key];\n }\n return out as Transform3D | undefined;\n}\n\n/**\n * Builds the material a shorthand bag describes; always one, so a drawable op never needs \"...or the default\"\n * handling. Exported because `Mesh3D` desugars the same bag from its props: one place decides how `fill` becomes\n * `color`-or-`map`, so a node and a builder call paint alike.\n *\n * @internal\n */\nexport function resolveMaterialShorthand3D(source: MaterialShorthand3D): Material3D | readonly Material3D[] {\n if (source.material !== undefined) return source.material;\n\n const material: Record<string, unknown> = { type: source.unlit ? \"basic\" : \"standard\" };\n\n const fill = resolveFill3D(source.fill);\n if (fill.color !== undefined) material.color = fill.color;\n if (fill.map !== undefined) material.map = fill.map;\n\n for (const key of MATERIAL_SHORTHAND_KEYS) {\n const value = (source as Record<string, unknown>)[key];\n if (value !== undefined) material[key] = value;\n }\n return material as unknown as Material3D;\n}\n\n/** Drop the shorthand/transform keys, leaving only a geometry's own params. */\nfunction pickGeometry<T>(source: object, type: string): T {\n const bag = source as Record<string, unknown>;\n const out: Record<string, unknown> = { type };\n for (const key in bag) {\n if (SHORTHAND_KEYS.includes(key)) continue;\n if ((TRANSFORM_KEYS as readonly string[]).includes(key)) continue;\n if (bag[key] !== undefined) out[key] = bag[key];\n }\n return out as T;\n}\n\n/** Geometry params only, with `type` and the inherited passthrough removed. */\ntype ParamsOf<G> = Omit<G, \"type\">;\n\n/**\n * What one 3D node draws: the `Graphics2D` of 3D. Records an ordered list of drawables (meshes, instanced meshes,\n * points, lines, sprites, models), each with its own geometry, material and local transform; camera, lights and\n * hierarchy belong to the `Node3D` tree and its scene. A built `Graphics3D` is spliced into a {@link RenderContext3D}.\n *\n * render: (ctx) => ctx.draw(new Graphics3D()\n * .box({ width: 2, cornerRadius: 0.15, fill: \"#e0533d\", roughness: 0.3 })),\n *\n * One flat bag, not chained paint: in 2D a `fill` is a group-scoped op over earlier shapes, but in 3D a material\n * belongs to exactly one object, so shape and material are stated together.\n *\n * Angles are DEGREES (Euler rotations, sweep arcs, UV rotation), matching 2D `rotation`; the renderer converts.\n *\n * Rebuilt from scratch every frame, so animation is reading the node's own state while building. A state entry\n * holding a non-number needs an explicit tween (`lerpVector3`, `lerpEuler3`, `slerpQuaternion`) or `to()` leaves it alone.\n *\n * Reconciliation identity is derived from the owning `Node3D` plus a signature of what the op draws; there is no `key` to set.\n *\n * Transforms and most material values are cheap in-place writes. Geometry parameters are not (three geometries are\n * immutable, so tweening `.box({ width })` reallocates every frame): scale the object instead. Fields marked\n * \"structural\" on `MaterialCommon3D` recompile the shader and should be set once.\n */\nexport class Graphics3D {\n private _ops: Graphics3DOp[] = [];\n\n /** Append one op, flagging (in development) inputs no renderer acts on. */\n private record(op: Graphics3DOp): void {\n inspectDrawable3D(op);\n this._ops.push(op);\n }\n\n /** Records a mesh from an explicit geometry and material; the sugar methods below funnel here. */\n mesh(\n geometry: Geometry3D,\n material?: Material3D | readonly Material3D[],\n transform?: Transform3D,\n ): this {\n this.record({\n kind: \"mesh\",\n geometry,\n material: material ?? { type: \"standard\" },\n transform,\n });\n return this;\n }\n\n /** Record a mesh from a geometry `type` plus a flat shorthand bag. */\n private sugar(type: Geometry3D[\"type\"], options?: MeshShorthand3D): this {\n const source: MeshShorthand3D = options ?? {};\n return this.mesh(\n pickGeometry<Geometry3D>(source, type),\n resolveMaterialShorthand3D(source),\n pickTransform(source),\n );\n }\n\n box(options?: ParamsOf<BoxGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"box\", options);\n }\n sphere(options?: ParamsOf<SphereGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"sphere\", options);\n }\n plane(options?: ParamsOf<PlaneGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"plane\", options);\n }\n cylinder(options?: ParamsOf<CylinderGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"cylinder\", options);\n }\n cone(options?: ParamsOf<ConeGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"cone\", options);\n }\n torus(options?: ParamsOf<TorusGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"torus\", options);\n }\n torusKnot(options?: ParamsOf<TorusKnotGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"torusKnot\", options);\n }\n circle(options?: ParamsOf<CircleGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"circle\", options);\n }\n ring(options?: ParamsOf<RingGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"ring\", options);\n }\n capsule(options?: ParamsOf<CapsuleGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"capsule\", options);\n }\n polyhedron(options: ParamsOf<PolyhedronGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"polyhedron\", options);\n }\n extrude(options: ParamsOf<ExtrudeGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"extrude\", options);\n }\n lathe(options: ParamsOf<LatheGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"lathe\", options);\n }\n tube(options: ParamsOf<TubeGeometry3D> & MeshShorthand3D): this {\n return this.sugar(\"tube\", options);\n }\n\n /** Records many copies of one geometry in a single draw call, for thousands of objects where a `mesh` per copy wouldn't keep up. */\n instances(\n geometry: Geometry3D,\n material: Material3D,\n instances: readonly Transform3D[],\n options?: { colors?: readonly Color[]; transform?: Transform3D },\n ): this {\n this.record({\n kind: \"instances\",\n geometry,\n material,\n instances,\n colors: options?.colors,\n transform: options?.transform,\n });\n return this;\n }\n\n /** Record a point cloud — one sprite-like dot per vertex of `geometry`. */\n points(\n geometry: Geometry3D,\n material?: Material3D,\n transform?: Transform3D,\n ): this {\n this.record({\n kind: \"points\",\n geometry,\n material: material ?? { type: \"points\" },\n transform,\n });\n return this;\n }\n\n /** Records a line from explicit `points` or a `geometry` (typically `Geo.edges(...)`). `closed` joins the last point to the first; `segments` treats points as disjoint start/end pairs, the form `Geo.edges(...)` produces. */\n line(options: {\n points?: readonly Vector3Input[];\n geometry?: Geometry3D;\n material?: Material3D;\n closed?: boolean;\n segments?: boolean;\n /** The line's paint. Cap and join have no meaning on a GL line. */\n stroke?: LineStroke3D;\n opacity?: number;\n transform?: Transform3D;\n } & Transform3D): this {\n const { points, geometry, material, closed, segments, stroke, opacity } = options;\n\n if (!points && !geometry) {\n throw new Error(\"Graphics3D.line() needs either `points` or `geometry`.\");\n }\n\n const resolved: Material3D = material ?? {\n type: stroke?.dash !== undefined ? \"lineDashed\" : \"lineBasic\",\n ...(stroke?.fill !== undefined ? { color: stroke.fill } : {}),\n ...(stroke?.weight !== undefined ? { width: stroke.weight } : {}),\n ...(stroke?.dash !== undefined\n ? { dashSize: stroke.dash[0], gapSize: stroke.dash[1] ?? stroke.dash[0] }\n : {}),\n ...(opacity !== undefined ? { opacity } : {}),\n } as Material3D;\n\n this.record({\n kind: \"line\",\n geometry: geometry ?? lineBuffer(points!),\n material: resolved,\n mode: segments ? \"segments\" : closed ? \"loop\" : \"strip\",\n transform: pickTransform(options),\n });\n return this;\n }\n\n /** Record a camera-facing textured quad. */\n sprite(options: { fill?: Fill3D; material?: Material3D; opacity?: number } & Transform3D): this {\n const { fill, material, opacity } = options;\n const paint = resolveFill3D(fill);\n const resolved: Material3D = material ?? {\n type: \"sprite\",\n ...(paint.map !== undefined ? { map: paint.map } : {}),\n ...(paint.color !== undefined ? { color: paint.color } : {}),\n ...(opacity !== undefined ? { opacity } : {}),\n } as Material3D;\n this.record({\n kind: \"sprite\",\n material: resolved,\n transform: pickTransform(options),\n });\n return this;\n }\n\n /** Records a loaded model. **glTF/GLB only**: any other format resolves to an empty slot and draws nothing (in development the first warns). Baked animation is sampled by explicit `time`, so a model stays frame-identical under scrubbing. */\n model(options: {\n src: string;\n animation?: ModelAnimation3D | readonly ModelAnimation3D[];\n override?: Readonly<Record<string, Material3D>>;\n } & Transform3D): this {\n const { src, animation, override } = options;\n this.record({\n kind: \"model\",\n src,\n animation: animation === undefined\n ? undefined\n : Array.isArray(animation) ? animation : [animation as ModelAnimation3D],\n override,\n transform: pickTransform(options),\n });\n return this;\n }\n\n /** The recorded ops, in order. Replayed by the renderer. */\n ops(): readonly Graphics3DOp[] {\n return this._ops;\n }\n\n /** True when this node draws nothing. */\n isEmpty(): boolean {\n return this._ops.length === 0;\n }\n}\n\n/** A 3D line's paint, mirroring the 2D `Stroke`. `cap`/`join` are absent (a GL line has no outline to cap); `weight` above 1 is ignored by most WebGL implementations, so draw a `tube` for a thick line. */\nexport interface LineStroke3D {\n /** The line's colour. Named `fill` to match the 2D `Stroke`. */\n fill?: Color;\n weight?: number;\n /** Dash and gap lengths, in world units. */\n dash?: readonly [number, number?];\n}\n\n/** The buffer each points array was last flattened into, and the revision it was uploaded under. */\nconst lineBuffers = new WeakMap<readonly Vector3Input[], { readonly position: Float32Array; readonly revision: number }>();\nlet lineRevision = 0;\n\n/** `points` as a line's buffer. The same array with the same values gets the same buffer and revision back, so an unchanged line uploads once; values are checked, so an in-place change still lands. */\nfunction lineBuffer(points: readonly Vector3Input[]): BufferGeometry3D {\n let kept = lineBuffers.get(points);\n if (!kept || !holds(kept.position, points)) {\n kept = { position: flattenPoints(points), revision: ++lineRevision };\n lineBuffers.set(points, kept);\n }\n return { type: \"buffer\", position: kept.position, revision: kept.revision };\n}\n\n/** Flatten `Vector3Input`s into the packed `[x, y, z, …]` a buffer wants. */\nfunction flattenPoints(points: readonly Vector3Input[]): Float32Array {\n const out = new Float32Array(points.length * 3);\n let i = 0;\n for (const point of points) {\n if (typeof point === \"number\") {\n out[i] = out[i + 1] = out[i + 2] = point;\n } else if (Array.isArray(point)) {\n out[i] = point[0] ?? 0;\n out[i + 1] = point[1] ?? 0;\n out[i + 2] = point[2] ?? 0;\n } else {\n const v = point as { x: number; y: number; z: number };\n out[i] = v.x ?? 0;\n out[i + 1] = v.y ?? 0;\n out[i + 2] = v.z ?? 0;\n }\n i += 3;\n }\n return out;\n}\n\n/** Whether `buffer` is what flattening `points` would give. */\nfunction holds(buffer: Float32Array, points: readonly Vector3Input[]): boolean {\n if (buffer.length !== points.length * 3) return false;\n let i = 0;\n for (const point of points) {\n let x: number, y: number, z: number;\n if (typeof point === \"number\") {\n x = y = z = point;\n } else if (Array.isArray(point)) {\n x = point[0] ?? 0;\n y = point[1] ?? 0;\n z = point[2] ?? 0;\n } else {\n const v = point as { x: number; y: number; z: number };\n x = v.x ?? 0;\n y = v.y ?? 0;\n z = v.z ?? 0;\n }\n if (buffer[i] !== Math.fround(x) || buffer[i + 1] !== Math.fround(y) || buffer[i + 2] !== Math.fround(z)) return false;\n i += 3;\n }\n return true;\n}\n"]}
|
package/dist/render3d/index.d.ts
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 3D scene description.
|
|
3
|
-
*
|
|
4
|
-
* The same split as 2D, one dimension over: a {@link Graphics3D} is what a single
|
|
5
|
-
* node draws (the `Graphics2D` of 3D), a {@link RenderContext3D} is what it draws
|
|
6
|
-
* *into*, and a {@link Scene3D} is the recorded result — camera, lights, fog and
|
|
7
|
-
* every drawable — that a backend replays.
|
|
8
|
-
*
|
|
9
|
-
* Unlike `@/render` (whose descriptors are `@internal`, since nodes build them on
|
|
10
|
-
* the author's behalf), the vocabulary here is **public**: a `Node3D` takes these
|
|
11
|
-
* descriptors as props, and a hand-built `Scene3D` is the escape hatch for
|
|
12
|
-
* painting 3D through an arbitrary 2D path.
|
|
13
|
-
*
|
|
14
|
-
* Nothing in this directory imports a renderer, and no field holds a DOM handle —
|
|
15
|
-
* so `three` never enters core.
|
|
16
|
-
*/
|
|
1
|
+
/** 3D scene description, the same split as 2D one dimension over: a {@link Graphics3D} is what a node draws, a {@link RenderContext3D} what it draws into, a {@link Scene3D} the recorded result a backend replays. Unlike `@/render` (descriptors `@internal`, as nodes build them for the author), this vocabulary is **public**: a `Node3D` takes these descriptors as props and a hand-built `Scene3D` paints 3D through an arbitrary 2D path. Nothing here imports a renderer or holds a DOM handle, so `three` never enters core. */
|
|
17
2
|
export { Graphics3D } from "./graphics3d.js";
|
|
18
3
|
export type { Graphics3DOp, LineMode3D, LineStroke3D, ModelAnimation3D, MaterialShorthand3D, MeshShorthand3D, } from "./graphics3d.js";
|
|
19
4
|
/** @internal */ export { DRAWABLE_KINDS, resolveMaterialShorthand3D } from "./graphics3d.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/render3d/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/render3d/index.ts"],"names":[],"mappings":"AAAA,2gBAA2gB;AAE3gB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EACR,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EACxD,mBAAmB,EAAE,eAAe,GACvC,MAAM,cAAc,CAAC;AACtB,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE3F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC7D,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EACH,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,mBAAmB,EAC7D,mBAAmB,EAAE,cAAc,EAAE,mBAAmB,EACxD,UAAU,EAAE,SAAS,EA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,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5E,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAChG,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/render3d/index.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 3D scene description.
|
|
3
|
-
*
|
|
4
|
-
* The same split as 2D, one dimension over: a {@link Graphics3D} is what a single
|
|
5
|
-
* node draws (the `Graphics2D` of 3D), a {@link RenderContext3D} is what it draws
|
|
6
|
-
* *into*, and a {@link Scene3D} is the recorded result — camera, lights, fog and
|
|
7
|
-
* every drawable — that a backend replays.
|
|
8
|
-
*
|
|
9
|
-
* Unlike `@/render` (whose descriptors are `@internal`, since nodes build them on
|
|
10
|
-
* the author's behalf), the vocabulary here is **public**: a `Node3D` takes these
|
|
11
|
-
* descriptors as props, and a hand-built `Scene3D` is the escape hatch for
|
|
12
|
-
* painting 3D through an arbitrary 2D path.
|
|
13
|
-
*
|
|
14
|
-
* Nothing in this directory imports a renderer, and no field holds a DOM handle —
|
|
15
|
-
* so `three` never enters core.
|
|
16
|
-
*/
|
|
1
|
+
/** 3D scene description, the same split as 2D one dimension over: a {@link Graphics3D} is what a node draws, a {@link RenderContext3D} what it draws into, a {@link Scene3D} the recorded result a backend replays. Unlike `@/render` (descriptors `@internal`, as nodes build them for the author), this vocabulary is **public**: a `Node3D` takes these descriptors as props and a hand-built `Scene3D` paints 3D through an arbitrary 2D path. Nothing here imports a renderer or holds a DOM handle, so `three` never enters core. */
|
|
17
2
|
export { Graphics3D } from "./graphics3d.js";
|
|
18
3
|
/** @internal */ export { DRAWABLE_KINDS, resolveMaterialShorthand3D } from "./graphics3d.js";
|
|
19
4
|
export { Scene3D } from "./scene3d.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/render3d/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/render3d/index.ts"],"names":[],"mappings":"AAAA,2gBAA2gB;AAE3gB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE3F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,EACH,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,mBAAmB,EAC7D,mBAAmB,EAAE,cAAc,EAAE,mBAAmB,EACxD,UAAU,EAAE,SAAS,EAAE,aAAa,GACvC,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/F,gBAAgB,CAAC,OAAO,EACpB,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EACtE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,GAC3E,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAU/E,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAS7E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAazH,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAKnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAMpD,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAExF,OAAO,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5E,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/** 3D scene description, the same split as 2D one dimension over: a {@link Graphics3D} is what a node draws, a {@link RenderContext3D} what it draws into, a {@link Scene3D} the recorded result a backend replays. Unlike `@/render` (descriptors `@internal`, as nodes build them for the author), this vocabulary is **public**: a `Node3D` takes these descriptors as props and a hand-built `Scene3D` paints 3D through an arbitrary 2D path. Nothing here imports a renderer or holds a DOM handle, so `three` never enters core. */\n\nexport { Graphics3D } from \"./graphics3d\";\nexport type {\n Graphics3DOp, LineMode3D, LineStroke3D, ModelAnimation3D,\n MaterialShorthand3D, MeshShorthand3D,\n} from \"./graphics3d\";\n/** @internal */ export { DRAWABLE_KINDS, resolveMaterialShorthand3D } from \"./graphics3d\";\n\nexport { Scene3D } from \"./scene3d\";\nexport type { Scene3DOp } from \"./scene3d\";\n\nexport { RenderContext3D } from \"./render-context3d\";\nexport type { Node3DRenderState } from \"./render-context3d\";\n\nexport { Geo, Mat, Tex } from \"./builders\";\n\nexport { resolveFill3D, looksLikeAssetPath } from \"./fill3d\";\nexport type { Fill3D, Fill3DOptions, ResolvedFill3D } from \"./fill3d\";\n\nexport { segmentsOf } from \"./segments\";\nexport type { Segments3D } from \"./segments\";\n\nexport { evaluateRoundedBox } from \"./rounded-box\";\nexport type { RoundedBoxOptions } from \"./rounded-box\";\n\nexport {\n lerpVector3, lerpEuler3, slerpQuaternion, normalizeQuaternion,\n quaternionFromEuler, resolveVector3, IDENTITY_QUATERNION,\n vector3Ops, euler3Ops, quaternionOps,\n} from \"./vector3\";\nexport type { Vector3, Vector3Input, Euler3, EulerOrder, Quaternion } from \"./vector3\";\n\nexport { shadowCasts, shadowReceives, resolveShadowOptions3D } from \"./transform\";\nexport type { Transform3D, Shadow3D, ShadowOptions3D, Faces3D, Blend3D } from \"./transform\";\n\nexport { geometryBounds3D } from \"./bounds3d\";\nexport type { Box3 } from \"./bounds3d\";\n/** @internal */ export { centeredBox3, corners3, transformBox3, unionBox3 } from \"./bounds3d\";\n\n/** @internal */ export {\n applyMatrix4, compose4, identity4, invert4, lookAtRotation4, multiply4,\n orthographic4, perspective4, rotationOf4, transformMatrix4, translation4,\n} from \"./matrix4\";\n/** @internal */ export type { Matrix4, Vector4 } from \"./matrix4\";\n\nexport { evaluateParametric, cylinderRadii, resolveBevel3D } from \"./geometry\";\nexport type {\n Geometry3D, Passthrough3D, Sweep3D, Bevel3D,\n BoxGeometry3D, SphereGeometry3D, PlaneGeometry3D, CylinderGeometry3D,\n ConeGeometry3D, TorusGeometry3D, TorusKnotGeometry3D, CircleGeometry3D,\n RingGeometry3D, CapsuleGeometry3D, PolyhedronGeometry3D, ExtrudeGeometry3D,\n LatheGeometry3D, TubeGeometry3D, BufferGeometry3D, ParametricGeometry3D,\n ParametricVertex3D, EdgesGeometry3D, WireframeGeometry3D, ModelGeometry3D,\n} from \"./geometry\";\n\nexport { MUTABLE_MATERIAL_KEYS, STRUCTURAL_MATERIAL_KEYS } from \"./material\";\nexport type {\n Material3D, MaterialCommon3D, Uniform3D, Shading3D,\n BasicMaterial3D, StandardMaterial3D, PhysicalMaterial3D, PhongMaterial3D,\n LambertMaterial3D, ToonMaterial3D, NormalMaterial3D, DepthMaterial3D,\n MatcapMaterial3D, PointsMaterial3D, LineBasicMaterial3D, LineDashedMaterial3D,\n SpriteMaterial3D, ShadowMaterial3D, ShaderMaterial3D,\n} from \"./material\";\n\nexport { isDataTexture3D, isSurfaceTexture3D, resolveTexture3D, resolveSurfaceSource, texture3DSource } from \"./texture\";\nexport type {\n Texture3D, ImageTexture3D, DataTexture3D, SurfaceTexture3D, TextureOptions3D,\n SurfaceSource3D, ResolvedSurfaceSource,\n TextureWrap3D, TextureFilter3D, TextureColorSpace3D,\n} from \"./texture\";\n\nexport type {\n LightData3D,\n AmbientLightData3D, HemisphereLightData3D, DirectionalLightData3D,\n PointLightData3D, SpotLightData3D, AreaLightData3D,\n} from \"./light\";\n\nexport { isOrbitCamera3D, resolveCameraPlacement } from \"./camera\";\nexport type {\n CameraData3D, CameraCommon3D, PerspectiveCameraData3D, OrthographicCameraData3D,\n} from \"./camera\";\n\nexport { resolveShadows3D } from \"./scene-settings\";\nexport type {\n FogData3D, EnvironmentData3D, ShadowSettings3D, Shadows3D,\n ToneSettings3D, ToneMapping3D, PostEffect3D,\n} from \"./scene-settings\";\n\n/** @internal */ export { forEachTexture3D, isTextureLike, TEXTURE_KEYS } from \"./walk\";\n\nexport { registerCanvas3DWarmup, registerCanvas3DResourceLoader } from \"./resources\";\nexport { canvas3DResourceKey, parseCanvas3DResourceKey } from \"./resources\";\nexport type { Canvas3DWarmup, Canvas3DResourceLoader, Canvas3DResourceKind } from \"./resources\";\n/** @internal */ export { warmCanvas3D, canvas3DResourceLoader, hasCanvas3DBackend } from \"./resources\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inert.d.ts","sourceRoot":"","sources":["../../src/render3d/inert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"inert.d.ts","sourceRoot":"","sources":["../../src/render3d/inert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAajD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAI9D;AAED,uFAAuF;AACvF,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAiCxD"}
|
package/dist/render3d/inert.js
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Development warnings for 3D inputs that are accepted, typed and recorded, and
|
|
3
|
-
* that no renderer acts on.
|
|
4
|
-
*
|
|
5
|
-
* A few corners of the 3D vocabulary are declared ahead of the backend: the post
|
|
6
|
-
* chain, HDR/EXR/cubemap environments, `params` on a geometry or an environment,
|
|
7
|
-
* `extends` on a shader material and OBJ models. Each is stored faithfully and
|
|
8
|
-
* read by nothing, so a scene that uses one renders exactly like a scene without
|
|
9
|
-
* it — and with no error, which is the part that costs an afternoon. These say so
|
|
10
|
-
* once, in development, naming the input and what to do instead.
|
|
11
|
-
*
|
|
12
|
-
* Each message is printed once per session. Nothing here changes what is
|
|
13
|
-
* recorded, so none of it can move a frame.
|
|
14
|
-
*/
|
|
1
|
+
/** Development warnings for 3D inputs that are accepted, typed and recorded but acted on by no renderer: the post chain, HDR/EXR/cubemap environments, `params` on a geometry or environment, `extends` on a shader material, OBJ models. Each renders exactly like a scene without it, silently, which costs an afternoon; these say so once per session, in development, naming the input and what to do instead. Nothing here changes what is recorded. */
|
|
15
2
|
const warned = new Set();
|
|
16
3
|
let development;
|
|
17
4
|
/** Read once: in Node, `process.env` is a lookup per access. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inert.js","sourceRoot":"","sources":["../../src/render3d/inert.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"inert.js","sourceRoot":"","sources":["../../src/render3d/inert.ts"],"names":[],"mappings":"AAGA,8bAA8b;AAE9b,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AACjC,IAAI,WAAgC,CAAC;AAErC,gEAAgE;AAChE,SAAS,aAAa;IAClB,OAAO,CAAC,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC;AACnE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,OAAe;IACpD,IAAI,CAAC,aAAa,EAAE,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO;IAChD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,oBAAoB;IAChC,MAAM,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAgB;IAC9C,IAAI,CAAC,aAAa,EAAE;QAAE,OAAO;IAE7B,IAAI,UAAU,IAAI,EAAE,EAAE,CAAC;QACnB,MAAM,MAAM,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;QAClC,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3C,WAAW,CACP,mBAAmB,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EACrC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,IAAI,mHAAmH;kBACrJ,gGAAgG,CACrG,CAAC;QACN,CAAC;IACL,CAAC;IAED,IAAI,UAAU,IAAI,EAAE,EAAE,CAAC;QACnB,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QAC3E,KAAK,MAAM,QAAQ,IAAI,SAAkC,EAAE,CAAC;YACxD,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,QAAQ,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;gBACzD,WAAW,CACP,gBAAgB,EAChB,eAAe,QAAQ,CAAC,OAAO,uIAAuI;sBACpK,4CAA4C,CACjD,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;IAED,IAAI,EAAE,CAAC,IAAI,KAAK,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;QACzD,WAAW,CACP,WAAW,EACX,cAAc,EAAE,CAAC,GAAG,4FAA4F,CACnH,CAAC;IACN,CAAC;AACL,CAAC","sourcesContent":["import type { Graphics3DOp } from \"./graphics3d\";\nimport type { Material3D } from \"./material\";\n\n/** Development warnings for 3D inputs that are accepted, typed and recorded but acted on by no renderer: the post chain, HDR/EXR/cubemap environments, `params` on a geometry or environment, `extends` on a shader material, OBJ models. Each renders exactly like a scene without it, silently, which costs an afternoon; these say so once per session, in development, naming the input and what to do instead. Nothing here changes what is recorded. */\n\nconst warned = new Set<string>();\nlet development: boolean | undefined;\n\n/** Read once: in Node, `process.env` is a lookup per access. */\nfunction isDevelopment(): boolean {\n return (development ??= process.env.NODE_ENV !== \"production\");\n}\n\n/**\n * Print `message` once per `key`, in development only.\n * @internal\n */\nexport function warnInert3D(key: string, message: string): void {\n if (!isDevelopment() || warned.has(key)) return;\n warned.add(key);\n console.warn(`[motionscript] ${message}`);\n}\n\n/** Forget what has been warned, so a test can see the same warning again. @internal */\nexport function resetInertWarnings3D(): void {\n warned.clear();\n}\n\n/**\n * Check one recorded drawable for inputs the renderer ignores.\n * @internal\n */\nexport function inspectDrawable3D(op: Graphics3DOp): void {\n if (!isDevelopment()) return;\n\n if (\"geometry\" in op) {\n const params = op.geometry.params;\n if (params && Object.keys(params).length > 0) {\n warnInert3D(\n `geometry-params:${op.geometry.type}`,\n `\\`params\\` on a \"${op.geometry.type}\" geometry is not applied: three builds a geometry from its named fields and nothing assigns \\`params\\` onto it. `\n + \"Set the geometry's own fields instead. (`params` is applied on materials, lights and cameras.)\",\n );\n }\n }\n\n if (\"material\" in op) {\n const materials = Array.isArray(op.material) ? op.material : [op.material];\n for (const material of materials as readonly Material3D[]) {\n if (material.type === \"shader\" && material.extends != null) {\n warnInert3D(\n \"shader-extends\",\n `\\`extends: \"${material.extends}\"\\` on a shader material is not applied: the shader replaces the built-in model, so scene lighting, shadows and fog do not reach it. `\n + \"Write the lighting you need in the shader.\",\n );\n }\n }\n }\n\n if (op.kind === \"model\" && /\\.obj(?:$|[?#])/i.test(op.src)) {\n warnInert3D(\n \"model-obj\",\n `The model \"${op.src}\" is an OBJ file, and only glTF/GLB models load: it will draw nothing. Convert it to .glb.`,\n );\n }\n}\n"]}
|
package/dist/render3d/light.d.ts
CHANGED
|
@@ -2,13 +2,7 @@ import type { Color } from "../attributes/shape/fill/color/parser.js";
|
|
|
2
2
|
import type { Passthrough3D } from "./geometry.js";
|
|
3
3
|
import type { Shadow3D } from "./transform.js";
|
|
4
4
|
import type { Vector3Input } from "./vector3.js";
|
|
5
|
-
/**
|
|
6
|
-
* Every light shares its colour, its strength, and what it does about shadows.
|
|
7
|
-
*
|
|
8
|
-
* `shadow` is the same {@link Shadow3D} an object carries — see that type for why
|
|
9
|
-
* one name covers both, and for the two knobs its object form exposes in place of
|
|
10
|
-
* three's seven.
|
|
11
|
-
*/
|
|
5
|
+
/** Colour, strength and shadow behaviour every light shares. `shadow` is the same {@link Shadow3D} an object carries (see that type for why one name covers both). */
|
|
12
6
|
interface LightCommon3D extends Passthrough3D {
|
|
13
7
|
color?: Color;
|
|
14
8
|
intensity?: number;
|
|
@@ -39,16 +33,7 @@ export interface DirectionalLightData3D extends LightCommon3D {
|
|
|
39
33
|
target?: Vector3Input;
|
|
40
34
|
shadow?: Shadow3D;
|
|
41
35
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Light radiating from a point in every direction — a bare bulb.
|
|
44
|
-
*
|
|
45
|
-
* `intensity` is on the same scale as a directional light's: 1 is a normal light,
|
|
46
|
-
* not one candela. three measures point and spot lights in candela and
|
|
47
|
-
* directional lights in lux, which is physically correct and means the same
|
|
48
|
-
* number produces wildly different results on the two — a scene ends up written
|
|
49
|
-
* with `intensity={2.4}` on one light beside `intensity={40}` on another. The
|
|
50
|
-
* renderer applies the steradian conversion so the numbers are comparable.
|
|
51
|
-
*/
|
|
36
|
+
/** Light radiating from a point in every direction (a bare bulb). `intensity` is on a directional light's scale (1 is a normal light, not one candela): three measures point/spot in candela and directional in lux, so the same number would differ wildly; the renderer applies the steradian conversion to keep them comparable. */
|
|
52
37
|
export interface PointLightData3D extends LightCommon3D {
|
|
53
38
|
type: "point";
|
|
54
39
|
/** Cutoff range. 0 (default) means no cutoff. */
|
|
@@ -69,15 +54,7 @@ export interface SpotLightData3D extends LightCommon3D {
|
|
|
69
54
|
decay?: number;
|
|
70
55
|
shadow?: Shadow3D;
|
|
71
56
|
}
|
|
72
|
-
/**
|
|
73
|
-
* A glowing rectangle — softboxes, strip lights, windows. Physically the nicest
|
|
74
|
-
* soft light, but it only works with `standard`/`physical` materials and casts no
|
|
75
|
-
* shadows.
|
|
76
|
-
*
|
|
77
|
-
* Named for what it is rather than for the three class behind it: "rectArea" put
|
|
78
|
-
* a renderer's internal name in the authoring surface, and `Rect` already means
|
|
79
|
-
* something else here.
|
|
80
|
-
*/
|
|
57
|
+
/** A glowing rectangle (softbox, strip light, window): the nicest soft light physically, but only with `standard`/`physical` materials and it casts no shadows. Named for what it is, not three's internal "rectArea", and `Rect` already means something else here. */
|
|
81
58
|
export interface AreaLightData3D extends LightCommon3D {
|
|
82
59
|
type: "area";
|
|
83
60
|
width?: number;
|