@allyhub/sdk 0.1.0-alpha.8 → 0.2.0-next.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/LICENSE.md +241 -0
- package/NOTICE +85 -0
- package/client.d.ts +45 -1
- package/dist/anim.js +2 -75
- package/dist/define.d.ts +10 -4
- package/dist/define.js +2 -95
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +2 -457
- package/dist/fit.js +2 -60
- package/dist/free.d.ts +18 -0
- package/dist/free.js +2 -0
- package/dist/index.d.ts +28 -13
- package/dist/index.js +2 -11
- package/dist/input.d.ts +306 -0
- package/dist/input.js +2 -0
- package/dist/media.d.ts +3 -6
- package/dist/media.js +2 -27
- package/dist/messages.d.ts +3 -2
- package/dist/messages.js +2 -2
- package/dist/module.d.ts +24 -0
- package/dist/module.js +2 -0
- package/dist/noise.js +2 -233
- package/dist/parts.d.ts +98 -22
- package/dist/parts.js +2 -414
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +2 -720
- package/dist/phone.d.ts +26 -0
- package/dist/phone.js +2 -0
- package/dist/piece.d.ts +106 -35
- package/dist/piece.js +2 -38
- package/dist/props.d.ts +1 -1
- package/dist/props.js +2 -35
- package/dist/scenery.d.ts +2 -0
- package/dist/scenery.js +2 -0
- package/dist/text.js +2 -38
- package/dist/written.d.ts +12 -0
- package/dist/written.js +2 -0
- package/docs/README.md +18 -0
- package/docs/batches.md +148 -0
- package/docs/contract.md +51 -0
- package/docs/defaults.md +703 -0
- package/docs/docs.md +148 -0
- package/docs/footage.md +249 -0
- package/docs/layers.md +317 -0
- package/docs/modeling.md +143 -0
- package/docs/project.md +265 -0
- package/docs/scenery.md +308 -0
- package/docs/sheets.md +119 -0
- package/docs/slides.md +111 -0
- package/docs/sound.md +170 -0
- package/docs/speech.md +289 -0
- package/docs/video.md +265 -0
- package/node_modules/@allyhub-next/audio/LICENSE +241 -0
- package/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +52 -0
- package/node_modules/@allyhub-next/audio/dist/at-cut.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/decode.d.ts +33 -0
- package/node_modules/@allyhub-next/audio/dist/decode.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/envelope.d.ts +37 -0
- package/node_modules/@allyhub-next/audio/dist/envelope.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/index.d.ts +17 -0
- package/node_modules/@allyhub-next/audio/dist/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/levels.d.ts +97 -0
- package/node_modules/@allyhub-next/audio/dist/levels.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/master.d.ts +29 -0
- package/node_modules/@allyhub-next/audio/dist/master.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/music.d.ts +11 -0
- package/node_modules/@allyhub-next/audio/dist/music.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +39 -0
- package/node_modules/@allyhub-next/audio/dist/node/decode.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +25 -0
- package/node_modules/@allyhub-next/audio/dist/node/ebur128.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +31 -0
- package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/index.d.ts +8 -0
- package/node_modules/@allyhub-next/audio/dist/node/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +18 -0
- package/node_modules/@allyhub-next/audio/dist/node/loudness.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/master.d.ts +42 -0
- package/node_modules/@allyhub-next/audio/dist/node/master.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +60 -0
- package/node_modules/@allyhub-next/audio/dist/node/measure.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +31 -0
- package/node_modules/@allyhub-next/audio/dist/node/mix.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/plan.d.ts +143 -0
- package/node_modules/@allyhub-next/audio/dist/plan.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recorded.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/recorded.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +47 -0
- package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +89 -0
- package/node_modules/@allyhub-next/audio/dist/recording/chain.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +64 -0
- package/node_modules/@allyhub-next/audio/dist/recording/dynamics.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fft.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +42 -0
- package/node_modules/@allyhub-next/audio/dist/recording/filters.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +56 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fit.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +10 -0
- package/node_modules/@allyhub-next/audio/dist/recording/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +12 -0
- package/node_modules/@allyhub-next/audio/dist/recording/loudness.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +67 -0
- package/node_modules/@allyhub-next/audio/dist/recording/measure.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +32 -0
- package/node_modules/@allyhub-next/audio/dist/recording/mic.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +27 -0
- package/node_modules/@allyhub-next/audio/dist/recording/noise.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +64 -0
- package/node_modules/@allyhub-next/audio/dist/recording/presets.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +78 -0
- package/node_modules/@allyhub-next/audio/dist/recording/room.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +111 -0
- package/node_modules/@allyhub-next/audio/dist/recording/setup.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +3 -0
- package/node_modules/@allyhub-next/audio/dist/recording/vec.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/render.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/render.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/sfx.d.ts +10 -0
- package/node_modules/@allyhub-next/audio/dist/sfx.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/shape.d.ts +118 -0
- package/node_modules/@allyhub-next/audio/dist/shape.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/voice.d.ts +45 -0
- package/node_modules/@allyhub-next/audio/dist/voice.js +2 -0
- package/node_modules/@allyhub-next/audio/package.json +17 -0
- package/node_modules/@allyhub-next/formats/LICENSE +241 -0
- package/node_modules/@allyhub-next/formats/dist/data/comments.d.ts +94 -0
- package/node_modules/@allyhub-next/formats/dist/data/comments.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/config.d.ts +10 -0
- package/node_modules/@allyhub-next/formats/dist/data/config.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/edits.d.ts +28 -0
- package/node_modules/@allyhub-next/formats/dist/data/edits.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/elements.d.ts +6 -0
- package/node_modules/@allyhub-next/formats/dist/data/elements.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/faces.d.ts +38 -0
- package/node_modules/@allyhub-next/formats/dist/data/faces.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/file.d.ts +11 -0
- package/node_modules/@allyhub-next/formats/dist/data/file.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/gen.d.ts +31 -0
- package/node_modules/@allyhub-next/formats/dist/data/gen.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/messages.d.ts +34 -0
- package/node_modules/@allyhub-next/formats/dist/data/messages.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/reference.d.ts +676 -0
- package/node_modules/@allyhub-next/formats/dist/data/reference.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/script.d.ts +37 -0
- package/node_modules/@allyhub-next/formats/dist/data/script.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +214 -0
- package/node_modules/@allyhub-next/formats/dist/data/sheet.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/words.d.ts +25 -0
- package/node_modules/@allyhub-next/formats/dist/data/words.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/index.d.ts +16 -0
- package/node_modules/@allyhub-next/formats/dist/index.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/items.d.ts +94 -0
- package/node_modules/@allyhub-next/formats/dist/items.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/layout.d.ts +50 -0
- package/node_modules/@allyhub-next/formats/dist/layout.js +5 -0
- package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +301 -0
- package/node_modules/@allyhub-next/formats/dist/schemas.js +2 -0
- package/node_modules/@allyhub-next/formats/package.json +14 -0
- package/node_modules/@allyhub-next/protocol/LICENSE +241 -0
- package/node_modules/@allyhub-next/protocol/dist/app.d.ts +98 -0
- package/node_modules/@allyhub-next/protocol/dist/app.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/auth.d.ts +116 -0
- package/node_modules/@allyhub-next/protocol/dist/auth.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/cli.d.ts +59 -0
- package/node_modules/@allyhub-next/protocol/dist/cli.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +274 -0
- package/node_modules/@allyhub-next/protocol/dist/cloud.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/editor.d.ts +405 -0
- package/node_modules/@allyhub-next/protocol/dist/editor.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/files.d.ts +101 -0
- package/node_modules/@allyhub-next/protocol/dist/files.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/index.d.ts +12 -0
- package/node_modules/@allyhub-next/protocol/dist/index.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/jsonrpc.d.ts +83 -0
- package/node_modules/@allyhub-next/protocol/dist/jsonrpc.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/registry.d.ts +53 -0
- package/node_modules/@allyhub-next/protocol/dist/registry.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/runtimes.d.ts +93 -0
- package/node_modules/@allyhub-next/protocol/dist/runtimes.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/teams.d.ts +67 -0
- package/node_modules/@allyhub-next/protocol/dist/teams.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/tools.d.ts +345 -0
- package/node_modules/@allyhub-next/protocol/dist/tools.js +2 -0
- package/node_modules/@allyhub-next/protocol/package.json +13 -0
- package/node_modules/@allyhub-next/runtimes/LICENSE +241 -0
- package/node_modules/@allyhub-next/runtimes/dist/bundled.d.ts +10 -0
- package/node_modules/@allyhub-next/runtimes/dist/bundled.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/download.d.ts +15 -0
- package/node_modules/@allyhub-next/runtimes/dist/download.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/errors.d.ts +16 -0
- package/node_modules/@allyhub-next/runtimes/dist/errors.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/home.d.ts +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/home.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/index.d.ts +9 -0
- package/node_modules/@allyhub-next/runtimes/dist/index.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/lock.d.ts +6 -0
- package/node_modules/@allyhub-next/runtimes/dist/lock.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/manifest.d.ts +3 -0
- package/node_modules/@allyhub-next/runtimes/dist/manifest.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.d.ts +63 -0
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +3 -0
- package/node_modules/@allyhub-next/runtimes/dist/unpack.d.ts +7 -0
- package/node_modules/@allyhub-next/runtimes/dist/unpack.js +2 -0
- package/node_modules/@allyhub-next/runtimes/manifest.json +395 -0
- package/node_modules/@allyhub-next/runtimes/package.json +14 -0
- package/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +153 -0
- package/node_modules/@allyhub-next/scenery/LICENSE +241 -0
- package/node_modules/@allyhub-next/scenery/NOTICE +42 -0
- package/node_modules/@allyhub-next/scenery/dist/aim.d.ts +55 -0
- package/node_modules/@allyhub-next/scenery/dist/aim.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/bake.d.ts +203 -0
- package/node_modules/@allyhub-next/scenery/dist/bake.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/camera.d.ts +150 -0
- package/node_modules/@allyhub-next/scenery/dist/camera.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/curve.d.ts +40 -0
- package/node_modules/@allyhub-next/scenery/dist/curve.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/define.d.ts +164 -0
- package/node_modules/@allyhub-next/scenery/dist/define.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/fit.d.ts +64 -0
- package/node_modules/@allyhub-next/scenery/dist/fit.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/glass.d.ts +34 -0
- package/node_modules/@allyhub-next/scenery/dist/glass.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/handheld.d.ts +184 -0
- package/node_modules/@allyhub-next/scenery/dist/handheld.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/hull.d.ts +23 -0
- package/node_modules/@allyhub-next/scenery/dist/hull.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/index.d.ts +22 -0
- package/node_modules/@allyhub-next/scenery/dist/index.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/lens.d.ts +48 -0
- package/node_modules/@allyhub-next/scenery/dist/lens.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/moire.d.ts +136 -0
- package/node_modules/@allyhub-next/scenery/dist/moire.js +93 -0
- package/node_modules/@allyhub-next/scenery/dist/motion.d.ts +48 -0
- package/node_modules/@allyhub-next/scenery/dist/motion.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/move.d.ts +260 -0
- package/node_modules/@allyhub-next/scenery/dist/move.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/noise.d.ts +41 -0
- package/node_modules/@allyhub-next/scenery/dist/noise.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/phone.d.ts +34 -0
- package/node_modules/@allyhub-next/scenery/dist/phone.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/report.d.ts +677 -0
- package/node_modules/@allyhub-next/scenery/dist/report.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/screen-focus.d.ts +55 -0
- package/node_modules/@allyhub-next/scenery/dist/screen-focus.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/screen.d.ts +71 -0
- package/node_modules/@allyhub-next/scenery/dist/screen.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/solve.d.ts +82 -0
- package/node_modules/@allyhub-next/scenery/dist/solve.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/timing.d.ts +26 -0
- package/node_modules/@allyhub-next/scenery/dist/timing.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/vec.d.ts +19 -0
- package/node_modules/@allyhub-next/scenery/dist/vec.js +2 -0
- package/node_modules/@allyhub-next/scenery/package.json +13 -0
- package/node_modules/@allyhub-next/video-core/LICENSE +241 -0
- package/node_modules/@allyhub-next/video-core/dist/anchors.d.ts +164 -0
- package/node_modules/@allyhub-next/video-core/dist/anchors.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/audio-types.d.ts +148 -0
- package/node_modules/@allyhub-next/video-core/dist/audio-types.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/backdrop.d.ts +87 -0
- package/node_modules/@allyhub-next/video-core/dist/backdrop.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/captions.d.ts +122 -0
- package/node_modules/@allyhub-next/video-core/dist/captions.js +11 -0
- package/node_modules/@allyhub-next/video-core/dist/console.d.ts +91 -0
- package/node_modules/@allyhub-next/video-core/dist/console.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/contrast.d.ts +98 -0
- package/node_modules/@allyhub-next/video-core/dist/contrast.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/cut-report.d.ts +77 -0
- package/node_modules/@allyhub-next/video-core/dist/cut-report.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/edit.d.ts +77 -0
- package/node_modules/@allyhub-next/video-core/dist/edit.js +13 -0
- package/node_modules/@allyhub-next/video-core/dist/edits.d.ts +163 -0
- package/node_modules/@allyhub-next/video-core/dist/edits.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/export.d.ts +96 -0
- package/node_modules/@allyhub-next/video-core/dist/export.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/fact.d.ts +965 -0
- package/node_modules/@allyhub-next/video-core/dist/fact.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/footage-motion.d.ts +168 -0
- package/node_modules/@allyhub-next/video-core/dist/footage-motion.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/formats.d.ts +240 -0
- package/node_modules/@allyhub-next/video-core/dist/formats.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/gen.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/gen.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/index.d.ts +40 -0
- package/node_modules/@allyhub-next/video-core/dist/index.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/look.d.ts +66 -0
- package/node_modules/@allyhub-next/video-core/dist/look.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/marks.d.ts +34 -0
- package/node_modules/@allyhub-next/video-core/dist/marks.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/matrix.d.ts +289 -0
- package/node_modules/@allyhub-next/video-core/dist/matrix.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/measure.d.ts +465 -0
- package/node_modules/@allyhub-next/video-core/dist/measure.js +5 -0
- package/node_modules/@allyhub-next/video-core/dist/media.d.ts +226 -0
- package/node_modules/@allyhub-next/video-core/dist/media.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/messages.d.ts +88 -0
- package/node_modules/@allyhub-next/video-core/dist/messages.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/motion.d.ts +56 -0
- package/node_modules/@allyhub-next/video-core/dist/motion.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/music.d.ts +110 -0
- package/node_modules/@allyhub-next/video-core/dist/music.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/piece.d.ts +1146 -0
- package/node_modules/@allyhub-next/video-core/dist/piece.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/placement.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/placement.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/problem.d.ts +262 -0
- package/node_modules/@allyhub-next/video-core/dist/problem.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/render-types.d.ts +49 -0
- package/node_modules/@allyhub-next/video-core/dist/render-types.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/schema.d.ts +352 -0
- package/node_modules/@allyhub-next/video-core/dist/schema.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/script-edit.d.ts +176 -0
- package/node_modules/@allyhub-next/video-core/dist/script-edit.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/script.d.ts +67 -0
- package/node_modules/@allyhub-next/video-core/dist/script.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/seams.d.ts +214 -0
- package/node_modules/@allyhub-next/video-core/dist/seams.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/slides.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/slides.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/sound-under.d.ts +72 -0
- package/node_modules/@allyhub-next/video-core/dist/sound-under.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/speech.d.ts +83 -0
- package/node_modules/@allyhub-next/video-core/dist/speech.js +5 -0
- package/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +616 -0
- package/node_modules/@allyhub-next/video-core/dist/timeline.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/timing.d.ts +88 -0
- package/node_modules/@allyhub-next/video-core/dist/timing.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/transcript.d.ts +288 -0
- package/node_modules/@allyhub-next/video-core/dist/transcript.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/transition.d.ts +289 -0
- package/node_modules/@allyhub-next/video-core/dist/transition.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/voice.d.ts +175 -0
- package/node_modules/@allyhub-next/video-core/dist/voice.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/words.d.ts +128 -0
- package/node_modules/@allyhub-next/video-core/dist/words.js +2 -0
- package/node_modules/@allyhub-next/video-core/package.json +14 -0
- package/package.json +52 -41
- package/README.md +0 -17
- package/dist/anim.d.ts.map +0 -1
- package/dist/anim.js.map +0 -1
- package/dist/define.d.ts.map +0 -1
- package/dist/define.js.map +0 -1
- package/dist/dom.d.ts.map +0 -1
- package/dist/dom.js.map +0 -1
- package/dist/fit.d.ts.map +0 -1
- package/dist/fit.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/media.d.ts.map +0 -1
- package/dist/media.js.map +0 -1
- package/dist/messages.d.ts.map +0 -1
- package/dist/messages.js.map +0 -1
- package/dist/noise.d.ts.map +0 -1
- package/dist/noise.js.map +0 -1
- package/dist/parts.d.ts.map +0 -1
- package/dist/parts.js.map +0 -1
- package/dist/paths.d.ts.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/piece.d.ts.map +0 -1
- package/dist/piece.js.map +0 -1
- package/dist/props.d.ts.map +0 -1
- package/dist/props.js.map +0 -1
- package/dist/text.d.ts.map +0 -1
- package/dist/text.js.map +0 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { type FieldOfView, type LensFrame } from "./lens.js";
|
|
2
|
+
import { type Vec3 } from "./vec.js";
|
|
3
|
+
/**
|
|
4
|
+
* A camera as an agent writes it. It points one of three ways: at a
|
|
5
|
+
* `target` (a point, or an object's name: it turns to keep it centred as
|
|
6
|
+
* it moves), along a `direction`, or by `yaw` and `pitch`. With none of
|
|
7
|
+
* them it looks down −Z, level.
|
|
8
|
+
*/
|
|
9
|
+
export interface CameraState {
|
|
10
|
+
/** The camera's place, m. */
|
|
11
|
+
position: Vec3;
|
|
12
|
+
/** A point, or an object's name (the centre of its box). */
|
|
13
|
+
target?: Vec3 | string;
|
|
14
|
+
/** A direction to look along, instead of a target. */
|
|
15
|
+
direction?: Vec3;
|
|
16
|
+
/** Degrees about +Y, instead of a target: 0 looks down −Z, 90 down −X (left). */
|
|
17
|
+
yaw?: number;
|
|
18
|
+
/** Degrees above the horizon (negative looks down), with or without yaw. */
|
|
19
|
+
pitch?: number;
|
|
20
|
+
/** Which way is up before roll; default [0, 1, 0]. */
|
|
21
|
+
up?: Vec3;
|
|
22
|
+
/** Degrees about the view: positive turns the camera counterclockwise, as three.js's rotation.z does. */
|
|
23
|
+
roll?: number;
|
|
24
|
+
/** 35 mm-equivalent focal length, mm; default 26. */
|
|
25
|
+
lens?: number;
|
|
26
|
+
/** What the lens is measured on; default "diagonal". */
|
|
27
|
+
lensFrame?: LensFrame;
|
|
28
|
+
/** The vertical angle in degrees, instead of a lens. */
|
|
29
|
+
fov?: number;
|
|
30
|
+
/** Near plane, m; default 0.05. */
|
|
31
|
+
near?: number;
|
|
32
|
+
/** Far plane, m; default 500. */
|
|
33
|
+
far?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The aperture, an f-number in the same 35 mm-equivalent terms as `lens`
|
|
36
|
+
* (a lens's f-number times its crop factor: a phone's f/1.8 main camera
|
|
37
|
+
* is about f/8): with `focus`, how soft what is nearer or farther than
|
|
38
|
+
* the focus is drawn, as a thin lens makes it. Without it the camera is
|
|
39
|
+
* a pinhole and everything is sharp.
|
|
40
|
+
*/
|
|
41
|
+
aperture?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Where it is focused: a distance along its view, m; a point; or an
|
|
44
|
+
* object's name (the centre of its box, followed as it moves). Needed
|
|
45
|
+
* with `aperture`.
|
|
46
|
+
*/
|
|
47
|
+
focus?: number | Vec3 | string;
|
|
48
|
+
/**
|
|
49
|
+
* Its exposure, EV at ISO 100: the scenery's light is scaled by
|
|
50
|
+
* 1 / (1.2 · 2^ev) before the tone curve while it draws (three.js's
|
|
51
|
+
* toneMappingExposure, exposureOf), as a camera exposes. Without it, the
|
|
52
|
+
* scenery's own renderer.toneMappingExposure. In a scenery whose lights are
|
|
53
|
+
* physical (lux, candela) and whose screens give out their nits, a phone
|
|
54
|
+
* indoors that keeps a laptop's screen from burning out is about 8 to 9.
|
|
55
|
+
*/
|
|
56
|
+
ev?: number;
|
|
57
|
+
}
|
|
58
|
+
/** What three.js's toneMappingExposure is for a camera at `ev` (EV at ISO 100): 1 / (1.2 · 2^ev). */
|
|
59
|
+
export declare function exposureOf(ev: number): number;
|
|
60
|
+
export declare const CAMERA_DEFAULTS: {
|
|
61
|
+
lens: number;
|
|
62
|
+
lensFrame: LensFrame;
|
|
63
|
+
near: number;
|
|
64
|
+
far: number;
|
|
65
|
+
up: Vec3;
|
|
66
|
+
roll: number;
|
|
67
|
+
};
|
|
68
|
+
/** A camera ready to draw a frame: its basis, its angles, its planes. */
|
|
69
|
+
export interface ResolvedCamera {
|
|
70
|
+
position: Vec3;
|
|
71
|
+
/** Unit vector the camera looks along (its local −Z). */
|
|
72
|
+
forward: Vec3;
|
|
73
|
+
/** Unit vector up in the picture (its local +Y), after roll. */
|
|
74
|
+
up: Vec3;
|
|
75
|
+
/** Unit vector right in the picture (its local +X), after roll. */
|
|
76
|
+
right: Vec3;
|
|
77
|
+
/** The point it was aimed at, when it was given a target. */
|
|
78
|
+
target?: Vec3;
|
|
79
|
+
/** Width over height of the frame. */
|
|
80
|
+
aspect: number;
|
|
81
|
+
fov: FieldOfView;
|
|
82
|
+
/** The lens in the default convention (the output frame's diagonal), mm. */
|
|
83
|
+
lens: number;
|
|
84
|
+
near: number;
|
|
85
|
+
far: number;
|
|
86
|
+
/** The rotation from the camera's local axes to the scenery's, as x, y, z, w. */
|
|
87
|
+
quaternion: readonly [number, number, number, number];
|
|
88
|
+
/**
|
|
89
|
+
* Depth of field, when the camera has an aperture: its f-number, the
|
|
90
|
+
* focus's distance along the view (m) and the 35 mm-equivalent lens
|
|
91
|
+
* (mm, in the convention the f-number is in).
|
|
92
|
+
*/
|
|
93
|
+
dof?: {
|
|
94
|
+
aperture: number;
|
|
95
|
+
focus: number;
|
|
96
|
+
lens: number;
|
|
97
|
+
};
|
|
98
|
+
/** Its exposure, EV at ISO 100, when it has one (CameraState.ev). */
|
|
99
|
+
ev?: number;
|
|
100
|
+
}
|
|
101
|
+
/** A camera state that cannot be drawn, with every reason. */
|
|
102
|
+
export declare class CameraError extends Error {
|
|
103
|
+
readonly problems: readonly string[];
|
|
104
|
+
constructor(problems: readonly string[]);
|
|
105
|
+
}
|
|
106
|
+
/** How a name becomes a point: the host's scenery, or nothing. */
|
|
107
|
+
export type PointOf = (name: string) => Vec3 | undefined;
|
|
108
|
+
/** The direction yaw and pitch say, in degrees. */
|
|
109
|
+
export declare function directionOf(yaw?: number, pitch?: number): Vec3;
|
|
110
|
+
/** Yaw and pitch of a direction, in degrees: directionOf's inverse. */
|
|
111
|
+
export declare function yawPitchOf(direction: Vec3): {
|
|
112
|
+
yaw: number;
|
|
113
|
+
pitch: number;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* What is wrong with a camera state, whatever the frame: every reason it
|
|
117
|
+
* cannot be drawn, or none. A target given by name is checked by
|
|
118
|
+
* resolveCamera, which knows the scenery.
|
|
119
|
+
*/
|
|
120
|
+
export declare function cameraProblems(state: CameraState): string[];
|
|
121
|
+
/**
|
|
122
|
+
* A camera state resolved for a frame of `aspect` (width over height):
|
|
123
|
+
* its basis, its angles and its planes. Throws CameraError with every
|
|
124
|
+
* reason when it cannot be drawn.
|
|
125
|
+
*/
|
|
126
|
+
export declare function resolveCamera(state: CameraState, aspect: number, pointOf?: PointOf): ResolvedCamera;
|
|
127
|
+
/**
|
|
128
|
+
* The diameter, in frame pixels, of the circle a point `depth` m along a
|
|
129
|
+
* camera's view is drawn as on a frame `frameHeight` px tall: a thin lens
|
|
130
|
+
* of the camera's 35 mm-equivalent lens and f-number focused at its focus.
|
|
131
|
+
* 0 for a pinhole camera and at the focus.
|
|
132
|
+
*
|
|
133
|
+
* c = F · f / (N · (s − f)) · |d − s| / d, with F the focal length in frame
|
|
134
|
+
* pixels, f the lens and s the focus in metres, N the f-number, d the depth.
|
|
135
|
+
*/
|
|
136
|
+
export declare function blurDiameter(camera: ResolvedCamera, depth: number, frameHeight: number): number;
|
|
137
|
+
/** Where a point lands in a camera's frame. */
|
|
138
|
+
export interface Projection {
|
|
139
|
+
/** -1 at the frame's left edge, 1 at its right. */
|
|
140
|
+
x: number;
|
|
141
|
+
/** -1 at the frame's bottom edge, 1 at its top. */
|
|
142
|
+
y: number;
|
|
143
|
+
/** Distance along the view, m; at or below 0 the point is behind the camera. */
|
|
144
|
+
depth: number;
|
|
145
|
+
/** In front of the near plane, short of the far one, and inside the frame. */
|
|
146
|
+
inView: boolean;
|
|
147
|
+
}
|
|
148
|
+
/** A point projected by a resolved camera. */
|
|
149
|
+
export declare function project(camera: ResolvedCamera, point: Vec3): Projection;
|
|
150
|
+
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{diagonalLens as L,fieldOfView as V,fieldOfViewFromVertical as j,lensForVertical as k,lensFrameProblem as z}from"./lens.js";import{cross as N,DEG as g,dot as w,isFinite3 as y,length as $,normalize as M,rotate as E,scale as q,sub as x}from"./vec.js";export function exposureOf(n){return 1/(1.2*2**n)}export const CAMERA_DEFAULTS={lens:26,lensFrame:"diagonal",near:.05,far:500,up:[0,1,0],roll:0};export class CameraError extends Error{problems;constructor(i){super(`The camera cannot be drawn: ${i.join("; ")}.`),this.name="CameraError",this.problems=i}}const S=n=>n===void 0||Number.isFinite(n);export function directionOf(n=0,i=0){const u=n*g,e=i*g;return[-Math.sin(u)*Math.cos(e),Math.sin(e),-Math.cos(u)*Math.cos(e)]}export function yawPitchOf(n){const i=M(n);return{yaw:Math.atan2(-i[0],-i[2])/g,pitch:Math.asin(Math.max(-1,Math.min(1,i[1])))/g}}export function cameraProblems(n){const i=[],{position:u,target:e,direction:r,yaw:a,pitch:t,up:s,roll:l,lens:c,fov:h}=n;y(u)||i.push("its position is not three finite numbers");const p=[e!==void 0?"target":void 0,r!==void 0?"direction":void 0,a!==void 0||t!==void 0?"yaw/pitch":void 0].filter(f=>f!==void 0);if(p.length>1&&i.push(`it points ${String(p.length)} ways (${p.join(", ")}): give one`),Array.isArray(e)&&!y(e)&&i.push("its target is not three finite numbers"),r!==void 0&&(y(r)?$(r)===0&&i.push("its direction is zero"):i.push("its direction is not three finite numbers")),(!S(a)||!S(t))&&i.push("its yaw or pitch is not finite"),t!==void 0&&Math.abs(t)>=90&&i.push(`its pitch ${String(t)}° looks straight up or down, which leaves no way to turn it about its view: keep it within ±90°`),s!==void 0&&(!y(s)||$(s)===0)&&i.push("its up is not a non-zero vector"),S(l)||i.push("its roll is not finite"),c!==void 0&&h!==void 0&&i.push("it has both a lens and a fov: give one"),c!==void 0&&!(Number.isFinite(c)&&c>0)&&i.push(`its lens ${String(c)} is not a positive number of mm`),h!==void 0&&!(Number.isFinite(h)&&h>0&&h<180)&&i.push(`its fov ${String(h)}° is outside (0°, 180°)`),n.lensFrame!==void 0){const f=z(n.lensFrame);f&&i.push(f)}const{aperture:m,focus:d}=n;m!==void 0&&(Number.isFinite(m)&&m>0?d===void 0&&i.push("it has an aperture and no focus: give focus, a distance along its view (m), a point or an object's name"):i.push(`its aperture f/${String(m)} is not a positive f-number`)),n.ev!==void 0&&!Number.isFinite(n.ev)&&i.push(`its ev ${String(n.ev)} is not a number`),typeof d=="number"&&!(Number.isFinite(d)&&d>0)&&i.push(`its focus ${String(d)} m is not a distance in front of it`),Array.isArray(d)&&!y(d)&&i.push("its focus is not three finite numbers");const o=n.near??CAMERA_DEFAULTS.near,b=n.far??CAMERA_DEFAULTS.far;return Number.isFinite(o)&&o>0||i.push(`its near plane ${String(o)} m is not above 0`),Number.isFinite(b)&&b>o||i.push(`its far plane ${String(b)} m is not beyond its near plane ${String(o)} m`),i}function C(n,i,u){const[e,r,a]=n,[t,s,l]=i,[c,h,p]=u,m=e+s+p;if(m>0){const o=.5/Math.sqrt(m+1);return[(l-h)*o,(c-a)*o,(r-t)*o,.25/o]}if(e>s&&e>p){const o=2*Math.sqrt(1+e-s-p);return[.25*o,(t+r)/o,(c+a)/o,(l-h)/o]}if(s>p){const o=2*Math.sqrt(1+s-e-p);return[(t+r)/o,.25*o,(h+l)/o,(c-a)/o]}const d=2*Math.sqrt(1+p-e-s);return[(c+a)/d,(h+l)/d,.25*d,(r-t)/d]}const P=1-1e-9;export function resolveCamera(n,i,u){const e=cameraProblems(n);Number.isFinite(i)&&i>0||e.push(`the frame's aspect ${String(i)} is not a positive number`);let r;if(typeof n.target=="string"?(r=u?.(n.target),r||e.push(u?`its target "${n.target}" names nothing in the scenery`:`its target "${n.target}" is a name, and there is no scenery to find it in`)):r=n.target,e.length>0)throw new CameraError(e);const a=n.position;let t;if(r){const f=x(r,a);if($(f)===0)throw new CameraError(["its target is at its position"]);t=M(f)}else n.direction?t=M(n.direction):t=directionOf(n.yaw,n.pitch);const s=M(n.up??CAMERA_DEFAULTS.up);if(Math.abs(w(t,s))>P)throw new CameraError(["it looks straight along its up, which leaves no way to turn it about its view: move its target or give another up"]);let l=M(N(t,s)),c=N(l,t);const h=(n.roll??CAMERA_DEFAULTS.roll)*g;if(h!==0){const f=q(t,-1);l=E(l,f,h),c=E(c,f,h)}const p=n.lensFrame??CAMERA_DEFAULTS.lensFrame,m=n.fov!==void 0?j(n.fov,i):V(n.lens??CAMERA_DEFAULTS.lens,i,p),d=n.fov!==void 0?k(n.fov,i):L(n.lens??CAMERA_DEFAULTS.lens,i,p),o=n.near??CAMERA_DEFAULTS.near;let b;if(n.aperture!==void 0&&n.focus!==void 0){const f=n.focus;let v;if(typeof f=="number")v=f;else{const A=typeof f=="string"?u?.(f):f;if(!A)throw new CameraError([u?`its focus "${String(f)}" names nothing in the scenery`:`its focus "${String(f)}" is a name, and there is no scenery to find it in`]);v=w(x(A,a),t)}const F=n.fov!==void 0?d:n.lens??CAMERA_DEFAULTS.lens;if(!(v>Math.max(o,F/1e3)))throw new CameraError([`its focus is ${v.toFixed(3)} m along its view, which must be past its near plane (${String(o)} m) and its lens (${String(F)} mm)`]);b={aperture:n.aperture,focus:v,lens:F}}return{position:a,forward:t,up:c,right:l,...r?{target:r}:{},aspect:i,fov:m,lens:d,near:o,far:n.far??CAMERA_DEFAULTS.far,quaternion:C(l,c,q(t,-1)),...b?{dof:b}:{},...n.ev!==void 0?{ev:n.ev}:{}}}export function blurDiameter(n,i,u){const e=n.dof;if(!e)return 0;const r=u/2/Math.tan(n.fov.vertical*g/2),a=e.lens/1e3,t=e.focus,s=Math.max(i,n.near);return r*a/(e.aperture*(t-a))*(Math.abs(s-t)/s)}export function project(n,i){const u=x(i,n.position),e=w(u,n.forward),r=Math.tan(n.fov.horizontal*g/2),a=Math.tan(n.fov.vertical*g/2),t=w(u,n.right)/(e*r),s=w(u,n.up)/(e*a),l=e>=n.near&&e<=n.far&&Math.abs(t)<=1&&Math.abs(s)<=1;return{x:t,y:s,depth:e,inView:l}}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type Vec3 } from "./vec.js";
|
|
2
|
+
/** Points closer than this are one point, m. */
|
|
3
|
+
export declare const SAME_POINT = 1e-9;
|
|
4
|
+
/** A point on a curve, its unit tangent and where it is. */
|
|
5
|
+
export interface CurvePoint {
|
|
6
|
+
point: Vec3;
|
|
7
|
+
/** Unit tangent; [0, 0, -1] on a curve with no length. */
|
|
8
|
+
tangent: Vec3;
|
|
9
|
+
}
|
|
10
|
+
/** A curve through points, walked by distance. */
|
|
11
|
+
export declare class Curve {
|
|
12
|
+
/** The curve's length, m. */
|
|
13
|
+
readonly length: number;
|
|
14
|
+
/** The distance along the curve at each point it was given, in their order. */
|
|
15
|
+
readonly knots: readonly number[];
|
|
16
|
+
private readonly segments;
|
|
17
|
+
private readonly first;
|
|
18
|
+
private frames?;
|
|
19
|
+
/**
|
|
20
|
+
* A curve through `points`, with `alpha` 0.5 (centripetal; 0 uniform, 1
|
|
21
|
+
* chordal). A point that repeats the one before it adds nothing.
|
|
22
|
+
*/
|
|
23
|
+
constructor(points: readonly Vec3[], alpha?: number);
|
|
24
|
+
/** The segment and its u at a distance along the curve, clamped to the curve. */
|
|
25
|
+
private locate;
|
|
26
|
+
/** The point and unit tangent at a distance along the curve (clamped). */
|
|
27
|
+
at(d: number): CurvePoint;
|
|
28
|
+
/**
|
|
29
|
+
* The point `d` m along the curve, past its ends along its end tangents:
|
|
30
|
+
* what a target some way ahead of a camera near the end looks at.
|
|
31
|
+
*/
|
|
32
|
+
extended(d: number): Vec3;
|
|
33
|
+
/**
|
|
34
|
+
* Up at a distance along the curve in a frame that does not twist about
|
|
35
|
+
* it (rotation-minimizing), starting from `up` made square to the
|
|
36
|
+
* curve's first tangent.
|
|
37
|
+
*/
|
|
38
|
+
upAt(d: number, up?: Vec3): Vec3;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=curve.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{add as w,addScaled as L,cross as T,distance as y,dot as q,length as O,normalize as S,scale as o,sub as u}from"./vec.js";export const SAME_POINT=1e-9;const _=[[0,.5688888888888889],[-.5384693101056831,.4786286704993665],[.5384693101056831,.4786286704993665],[-.906179845938664,.2369268850561891],[.906179845938664,.2369268850561891]],I=16;function j(e,n,t,s){return{c0:e,c1:t,c2:w(w(o(e,-3),o(n,3)),w(o(t,-2),o(s,-1))),c3:w(w(o(e,2),o(n,-2)),w(t,s))}}const D=(e,n)=>{const t=n*n,s=t*n;return[e.c0[0]+e.c1[0]*n+e.c2[0]*t+e.c3[0]*s,e.c0[1]+e.c1[1]*n+e.c2[1]*t+e.c3[1]*s,e.c0[2]+e.c1[2]*n+e.c2[2]*t+e.c3[2]*s]},B=(e,n)=>{const t=n*n;return[e.c1[0]+2*e.c2[0]*n+3*e.c3[0]*t,e.c1[1]+2*e.c2[1]*n+3*e.c3[1]*t,e.c1[2]+2*e.c2[2]*n+3*e.c3[2]*t]};function N(e,n,t){const s=(t-n)/2,i=(n+t)/2;let d=0;for(const[g,p]of _)d+=p*O(B(e,i+s*g));return d*s}export class Curve{length;knots;segments;first;frames;constructor(n,t=.5){const s=n[0];if(!s)throw new Error("A curve needs at least one point.");this.first=s;const i=[],d=[];for(const c of n){const h=i.at(-1);(!h||y(h,c)>SAME_POINT)&&i.push(c),d.push(i.length-1)}this.segments=[];let g=0;const p=c=>{const h=i.length;if(c<0){const[r,l]=[i[0],i[1]];return r&&l?u(o(r,2),l):s}if(c>=h){const[r,l]=[i[h-1],i[h-2]];return r&&l?u(o(r,2),l):s}return i[c]??s};for(let c=0;c+1<i.length;c++){const[h,r,l,v]=[p(c-1),p(c),p(c+1),p(c+2)];let m=y(h,r)**t,a=y(r,l)**t,f=y(l,v)**t;a<1e-4&&(a=1),m<1e-4&&(m=a),f<1e-4&&(f=a);const A=o(w(u(o(u(r,h),1/m),o(u(l,h),1/(m+a))),o(u(l,r),1/a)),a),x=o(w(u(o(u(l,r),1/a),o(u(v,r),1/(a+f))),o(u(v,l),1/f)),a),k={...j(r,l,A,x),table:[0],start:g,length:0};let E=0;for(let M=0;M<I;M++)E+=N(k,M/I,(M+1)/I),k.table.push(E);k.length=E,this.segments.push(k),g+=E}this.length=g;const b=[0,...this.segments.map(c=>c.start+c.length)];this.knots=d.map(c=>b[c]??0)}locate(n){const t=this.segments;if(t.length===0)return;const s=Math.min(Math.max(n,0),this.length);let i=0,d=t.length-1;for(;i<d;){const a=i+d+1>>1;(t[a]?.start??0)<=s?i=a:d=a-1}const g=t[i];if(!g)return;const p=Math.min(Math.max(s-g.start,0),g.length);let b=0;for(;b<I-1&&(g.table[b+1]??1/0)<p;)b++;const c=b/I;let h=c,r=(b+1)/I;const l=g.table[b]??0,v=(g.table[b+1]??l)-l;let m=v>0?h+(p-l)/v*(r-h):h;for(let a=0;a<30;a++){const f=l+N(g,c,m)-p;if(Math.abs(f)<1e-12*Math.max(1,this.length))break;f>0?r=m:h=m;const A=O(B(g,m));let x=A>0?m-f/A:(h+r)/2;x>h&&x<r||(x=(h+r)/2),m=x}return{seg:g,u:m}}at(n){const t=this.locate(n);if(!t)return{point:this.first,tangent:[0,0,-1]};const s=B(t.seg,t.u),i=O(s)>0?S(s):[0,0,-1];return{point:D(t.seg,t.u),tangent:i}}extended(n){if(n<0){const{point:t,tangent:s}=this.at(0);return L(t,s,n)}if(n>this.length){const{point:t,tangent:s}=this.at(this.length);return L(t,s,n-this.length)}return this.at(n).point}upAt(n,t=[0,1,0]){if(this.length===0)return S(t);if(!this.frames){const v=Math.max(64,this.segments.length*32),m=this.length/v,a=this.at(0).tangent;let f=u(t,o(a,q(t,a)));O(f)<1e-9&&(f=Math.abs(a[2])<.9?[0,0,-1]:[1,0,0]),f=S(u(f,o(a,q(f,a))));const A=[f];let x=this.at(0);for(let k=1;k<=v;k++){const E=this.at(k*m),M=u(E.point,x.point),z=q(M,M);let C=f,G=x.tangent;z>0&&(C=u(f,o(M,2/z*q(M,f))),G=u(x.tangent,o(M,2/z*q(M,x.tangent))));const P=u(E.tangent,G),K=q(P,P);f=K>0?u(C,o(P,2/K*q(P,C))):C,A.push(f),x=E}this.frames={step:m,ups:A}}const{step:s,ups:i}=this.frames,d=Math.min(Math.max(n,0),this.length)/s,g=Math.min(Math.floor(d),i.length-2),p=i[g]??t,b=i[g+1]??p,c=d-g,h=w(o(p,1-c),o(b,c)),r=this.at(n).tangent,l=u(h,o(r,q(h,r)));return O(l)>0?S(l):S(T(r,[1,0,0]))}}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { AnimationMixer, Group, Object3D, Scene, Texture, TextureDataType, WebGLRenderer } from "three";
|
|
2
|
+
import type { WebGPURenderer } from "three/webgpu";
|
|
3
|
+
import { type BakeOptions } from "./bake.js";
|
|
4
|
+
import { type CameraState } from "./camera.js";
|
|
5
|
+
import type { Move, ScreenFace } from "./move.js";
|
|
6
|
+
import type { Vec3 } from "./vec.js";
|
|
7
|
+
/** A media import or a project file's path. */
|
|
8
|
+
export type AssetRef = string | {
|
|
9
|
+
readonly url: string;
|
|
10
|
+
};
|
|
11
|
+
/** A scenery's renderer defaults: the fastest drawing; a scenery asks for more. */
|
|
12
|
+
export declare const SCENERY_RENDERER_DEFAULTS: {
|
|
13
|
+
antialias: boolean;
|
|
14
|
+
transmissionScale: number;
|
|
15
|
+
/** A camera's depth of field: samples per pixel, and the widest blur drawn (its radius, px of the picture as drawn). */
|
|
16
|
+
focus: {
|
|
17
|
+
samples: number;
|
|
18
|
+
maxRadius: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/** How AllyHub makes the renderer: what cannot change once it exists. */
|
|
22
|
+
export interface SceneryRendererOptions {
|
|
23
|
+
/**
|
|
24
|
+
* "webgl" (default): three's WebGLRenderer. "webgpu": WebGPURenderer
|
|
25
|
+
* from three/webgpu, for node materials and TSL, drawn through its
|
|
26
|
+
* WebGL 2 back end (forceWebGL), which SwiftShader draws.
|
|
27
|
+
*/
|
|
28
|
+
kind?: "webgl" | "webgpu";
|
|
29
|
+
/**
|
|
30
|
+
* Multisampled antialiasing (default false: the fastest drawing, edges
|
|
31
|
+
* stepped). True smooths edges at about a tenth more time; a scenery
|
|
32
|
+
* layer's quality.scale above 1 supersamples instead.
|
|
33
|
+
*/
|
|
34
|
+
antialias?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The size of the pass three.js draws the scene in once more for
|
|
37
|
+
* transmissive materials (glass), a share of the frame's (three's
|
|
38
|
+
* transmissionResolutionScale): default 0.25, the fastest; 1 draws
|
|
39
|
+
* what shows through glass sharp.
|
|
40
|
+
*/
|
|
41
|
+
transmissionScale?: number;
|
|
42
|
+
/** The buffer effects draw into (three's outputBufferType: UnsignedByteType, HalfFloatType…). */
|
|
43
|
+
outputBufferType?: TextureDataType;
|
|
44
|
+
logarithmicDepthBuffer?: boolean;
|
|
45
|
+
reversedDepthBuffer?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* How a camera's depth of field (its aperture and focus) is drawn: the
|
|
48
|
+
* samples each pixel is gathered from (default 64; fewer is faster and
|
|
49
|
+
* grainier) and the widest blur drawn, as a radius in the picture's
|
|
50
|
+
* pixels as drawn (default 64; a wider circle of confusion is drawn
|
|
51
|
+
* this wide). `supersample` draws the scene that many times as wide and
|
|
52
|
+
* high (1 to 4) and averages each pixel's samples, as multisampling
|
|
53
|
+
* smooths edges without an aperture: default 2 with `antialias`, else
|
|
54
|
+
* 1 (each 2 is about four times the pass's time).
|
|
55
|
+
*/
|
|
56
|
+
focus?: {
|
|
57
|
+
samples?: number;
|
|
58
|
+
maxRadius?: number;
|
|
59
|
+
supersample?: number;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** A box in world space. */
|
|
63
|
+
export interface Bounds {
|
|
64
|
+
min: Vec3;
|
|
65
|
+
max: Vec3;
|
|
66
|
+
}
|
|
67
|
+
/** What a scenery is given to build with and to pose itself. */
|
|
68
|
+
export interface SceneryHost {
|
|
69
|
+
/** The scene the scenery builds into. */
|
|
70
|
+
readonly scene: Scene;
|
|
71
|
+
/** The renderer AllyHub made; set tone mapping, exposure, shadows, effects on it. */
|
|
72
|
+
readonly renderer: WebGLRenderer | WebGPURenderer;
|
|
73
|
+
/** A glTF or GLB's scene, with the lent decoders; its animations on userData.animations. The read is recorded. */
|
|
74
|
+
load(asset: AssetRef): Promise<Group>;
|
|
75
|
+
/**
|
|
76
|
+
* A picture as a texture. The read is recorded. Its colour space is sRGB
|
|
77
|
+
* (a colour picture, a diffuse map); `{ colorSpace: "linear" }` reads it
|
|
78
|
+
* as data (a normal, roughness, AO or displacement map).
|
|
79
|
+
*/
|
|
80
|
+
texture(asset: AssetRef, opts?: {
|
|
81
|
+
colorSpace?: "srgb" | "linear";
|
|
82
|
+
}): Promise<Texture>;
|
|
83
|
+
/** An HDR or EXR as the scene's environment, and its background when asked. The read is recorded. */
|
|
84
|
+
environment(asset: AssetRef, opts?: {
|
|
85
|
+
background?: boolean;
|
|
86
|
+
}): Promise<Texture>;
|
|
87
|
+
/** Poses an animation mixer at t: every action reset, then setTime(t). */
|
|
88
|
+
seek(mixer: AnimationMixer, t: number): void;
|
|
89
|
+
/** An object by its name: undefined for none, an error for two. */
|
|
90
|
+
object(name: string): Object3D | undefined;
|
|
91
|
+
/** Where a named object is now: the centre of its box. */
|
|
92
|
+
positionOf(name: string): Vec3;
|
|
93
|
+
/** A named object's box now, from its vertices. */
|
|
94
|
+
boundsOf(name: string): Bounds;
|
|
95
|
+
/** A project file's URL. */
|
|
96
|
+
asset(path: string): string;
|
|
97
|
+
/**
|
|
98
|
+
* The scenery time, s, of a word or anchor reference ("@tap", "@tap+0.2",
|
|
99
|
+
* a word) of the part that draws the scenery (or the times its host was
|
|
100
|
+
* given), as a move's keys find theirs: in update, so the scenery's own
|
|
101
|
+
* objects keep to the words. Throws a NeedsTimeError where there is none
|
|
102
|
+
* (in build).
|
|
103
|
+
*/
|
|
104
|
+
time(ref: string): number;
|
|
105
|
+
/**
|
|
106
|
+
* A screen's face as it is now (an object's first mesh, its +Z side):
|
|
107
|
+
* `point(x, y)` is a place on it from its content's top left, as shares
|
|
108
|
+
* of its width and height, in world space; undefined for no such object.
|
|
109
|
+
*/
|
|
110
|
+
screen(name: string): ScreenFace | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* The picture a screen drawn in the scenery shows (screen(…, { inScenery })),
|
|
113
|
+
* as a texture with its smaller levels: for a scenery's own materials, the
|
|
114
|
+
* light the screen casts on what is near it and what reflects it. Its
|
|
115
|
+
* (u, v) is a place on the screen's content from its top left. Undefined
|
|
116
|
+
* for a screen drawn over the scenery, or before its first moment.
|
|
117
|
+
*/
|
|
118
|
+
screenPicture(name: string): Texture | undefined;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A prop a video brings into a scenery (`scenery(w, { props })`): a person's stand-in in the pose a shot needs, a
|
|
122
|
+
* pointer held to a screen. It is built once the scenery is built and its bake laid, so it is never part of
|
|
123
|
+
* the bake and never stops a bake from fitting the scene; it takes the light the scenery's unbaked things take
|
|
124
|
+
* (the bake's probe, where the bake has one); it is posed at each moment from t alone, after the scenery's own
|
|
125
|
+
* update; and it shows only in the layers that add it.
|
|
126
|
+
*/
|
|
127
|
+
export interface SceneryProp<O extends Object3D = Object3D> {
|
|
128
|
+
/** What it is called in the scenery (its object's name when it has none). */
|
|
129
|
+
name: string;
|
|
130
|
+
/** Makes it: with the scenery's host, to load a model, read a texture or find where a named object is. */
|
|
131
|
+
build(w: SceneryHost): O | Promise<O>;
|
|
132
|
+
/** Poses it at scenery time t (its place, its turn, a part of it), from t alone. */
|
|
133
|
+
update?(object: O, t: number, w: SceneryHost): void;
|
|
134
|
+
}
|
|
135
|
+
/** A scenery as an agent writes it. M is what build returns and update receives. */
|
|
136
|
+
export interface SceneryDefinition<M = unknown> {
|
|
137
|
+
renderer?: SceneryRendererOptions;
|
|
138
|
+
/** Once, before anything is drawn. Awaited, with every load it starts. */
|
|
139
|
+
build(w: SceneryHost): M | Promise<M>;
|
|
140
|
+
/** Every moment, from t alone (seconds of scenery time). */
|
|
141
|
+
update?(made: M, t: number, w: SceneryHost): void;
|
|
142
|
+
/** Cameras by name, for the commands and for layers. */
|
|
143
|
+
cameras?: Readonly<Record<string, CameraState>>;
|
|
144
|
+
/** Moves by name (keys, path, orbit or the agent's own), for the commands and for layers. */
|
|
145
|
+
moves?: Readonly<Record<string, Move>>;
|
|
146
|
+
/**
|
|
147
|
+
* How the scenery's light is baked (every value has a default). A bake
|
|
148
|
+
* made for the scene as built is laid on it each time it is built,
|
|
149
|
+
* wherever it is drawn.
|
|
150
|
+
*/
|
|
151
|
+
bake?: BakeOptions;
|
|
152
|
+
}
|
|
153
|
+
/** A scenery, as defineScenery returns it: its definition, frozen, marked by its kind. */
|
|
154
|
+
export interface Scenery<M = unknown> extends SceneryDefinition<M> {
|
|
155
|
+
readonly kind: "scenery";
|
|
156
|
+
}
|
|
157
|
+
/** Whether a value is a scenery defineScenery made (also by another copy of this package). */
|
|
158
|
+
export declare function isScenery(v: unknown): v is Scenery;
|
|
159
|
+
/**
|
|
160
|
+
* A scenery: the default export of a scenery module. Checks what can be
|
|
161
|
+
* checked without drawing it (its cameras), and throws with every reason.
|
|
162
|
+
*/
|
|
163
|
+
export declare function defineScenery<M>(def: SceneryDefinition<M>): Scenery<M>;
|
|
164
|
+
//# sourceMappingURL=define.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{bakeProblems as c}from"./bake.js";import{cameraProblems as f}from"./camera.js";export const SCENERY_RENDERER_DEFAULTS={antialias:!1,transmissionScale:.25,focus:{samples:64,maxRadius:64}};export function isScenery(e){if(typeof e!="object"||e===null)return!1;const n=e;return n.kind==="scenery"&&typeof n.build=="function"}export function defineScenery(e){if(typeof e.build!="function")throw new Error("defineScenery needs build(w), the function that builds the scenery.");const n=e.renderer?.kind;if(n!==void 0&&n!=="webgl"&&n!=="webgpu")throw new Error(`defineScenery's renderer.kind is "webgl" or "webgpu", not ${JSON.stringify(n)}.`);const r=e.renderer?.transmissionScale;if(r!==void 0&&!(Number.isFinite(r)&&r>0&&r<=2))throw new Error(`defineScenery's renderer.transmissionScale is a share of the frame's size in (0, 2], not ${String(r)}.`);const i=[];for(const[o,t]of Object.entries(e.cameras??{}))for(const s of f(t))i.push(`camera "${o}": ${s}`);for(const[o,t]of Object.entries(e.moves??{}))typeof t!="function"&&i.push(`move "${o}" is not a function of time`);if(e.bake!==void 0&&i.push(...c(e.bake)),i.length>0)throw new Error(`defineScenery: ${i.join("; ")}.`);return Object.freeze({...e,kind:"scenery"})}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type CameraState } from "./camera.js";
|
|
2
|
+
import { type LensFrame } from "./lens.js";
|
|
3
|
+
import { type Vec3 } from "./vec.js";
|
|
4
|
+
/** A box by its corners. */
|
|
5
|
+
export interface Box {
|
|
6
|
+
min: Vec3;
|
|
7
|
+
max: Vec3;
|
|
8
|
+
}
|
|
9
|
+
/** Shares of the frame's width (left, right) or height (top, bottom) kept clear at each side. */
|
|
10
|
+
export interface Margins {
|
|
11
|
+
top?: number;
|
|
12
|
+
right?: number;
|
|
13
|
+
bottom?: number;
|
|
14
|
+
left?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface FitOptions {
|
|
17
|
+
/** What to frame: points, boxes (all eight corners count) or a sphere. */
|
|
18
|
+
points?: readonly Vec3[];
|
|
19
|
+
boxes?: readonly Box[];
|
|
20
|
+
sphere?: {
|
|
21
|
+
center: Vec3;
|
|
22
|
+
radius: number;
|
|
23
|
+
};
|
|
24
|
+
/** Width over height of the frame. */
|
|
25
|
+
aspect: number;
|
|
26
|
+
/** The view: a direction (from the camera toward the objects) or yaw and pitch; default yaw 0 (looking down −Z). */
|
|
27
|
+
direction?: Vec3;
|
|
28
|
+
yaw?: number;
|
|
29
|
+
pitch?: number;
|
|
30
|
+
/** The point aimed at; default the centre of the box round what is framed. */
|
|
31
|
+
aim?: Vec3;
|
|
32
|
+
/** The lens, or a vertical fov; with adjust "lens", the result's. */
|
|
33
|
+
lens?: number;
|
|
34
|
+
lensFrame?: LensFrame;
|
|
35
|
+
fov?: number;
|
|
36
|
+
/** How far toward the frame's edges what is framed may reach, 0–1; default 1. */
|
|
37
|
+
fill?: number;
|
|
38
|
+
margins?: Margins;
|
|
39
|
+
/** Which edges bound it: "both" (default), "width" or "height". */
|
|
40
|
+
axis?: "both" | "width" | "height";
|
|
41
|
+
/**
|
|
42
|
+
* "distance" (default): the camera moves along the view to fit. "lens":
|
|
43
|
+
* it stays at `position` and the lens is solved instead.
|
|
44
|
+
*/
|
|
45
|
+
adjust?: "distance" | "lens";
|
|
46
|
+
/** With adjust "lens": where the camera is. */
|
|
47
|
+
position?: Vec3;
|
|
48
|
+
up?: Vec3;
|
|
49
|
+
roll?: number;
|
|
50
|
+
/** The camera's near plane, m: nothing framed may be nearer; default 0.05. */
|
|
51
|
+
near?: number;
|
|
52
|
+
}
|
|
53
|
+
export declare const FIT_DEFAULTS: {
|
|
54
|
+
fill: number;
|
|
55
|
+
axis: "both";
|
|
56
|
+
adjust: "distance";
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* A camera state that frames what it is given: its position (or, with
|
|
60
|
+
* adjust "lens", its lens), aimed at `aim`. Throws when the options leave
|
|
61
|
+
* no room or something framed is behind a camera that cannot move.
|
|
62
|
+
*/
|
|
63
|
+
export declare function fitCamera(opts: FitOptions): CameraState;
|
|
64
|
+
//# sourceMappingURL=fit.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{resolveCamera as E}from"./camera.js";import{lensForVertical as P}from"./lens.js";import{addScaled as $,dot as l,length as z,sub as I}from"./vec.js";export const FIT_DEFAULTS={fill:1,axis:"both",adjust:"distance"};function S(t){const o=[];for(const d of[t.min[0],t.max[0]])for(const f of[t.min[1],t.max[1]])for(const n of[t.min[2],t.max[2]])o.push([d,f,n]);return o}function q(t,o){const d={right:t-2*(o.right??0),left:t-2*(o.left??0),top:t-2*(o.top??0),bottom:t-2*(o.bottom??0)};for(const[f,n]of Object.entries(d))if(!(n>0))throw new Error(`fitCamera's fill and ${f} margin leave no room on that side (${n.toFixed(3)}).`);return d}export function fitCamera(t){const o=[...t.points??[],...(t.boxes??[]).flatMap(S)];if(o.length===0&&!t.sphere)throw new Error("fitCamera needs points, boxes or a sphere to frame.");const d=t.fill??FIT_DEFAULTS.fill,f=t.axis??FIT_DEFAULTS.axis,n=q(d,t.margins??{}),F=t.near??.05,g={...t.lensFrame!==void 0?{lensFrame:t.lensFrame}:{},...t.up!==void 0?{up:t.up}:{},...t.roll!==void 0?{roll:t.roll}:{},...t.near!==void 0?{near:t.near}:{}};let h=t.aim;if(!h)if(o.length>0){const i=[1/0,1/0,1/0],a=[-1/0,-1/0,-1/0];for(const r of o)for(let e=0;e<3;e++)i[e]=Math.min(i[e]??1/0,r[e]??0),a[e]=Math.max(a[e]??-1/0,r[e]??0);h=[(i[0]+a[0])/2,(i[1]+a[1])/2,(i[2]+a[2])/2]}else h=t.sphere?.center??[0,0,0];if((t.adjust??FIT_DEFAULTS.adjust)==="lens"){const i=t.position;if(!i)throw new Error(`fitCamera with adjust "lens" needs the camera's position.`);const a=E({position:i,target:h,...g,...t.fov!==void 0?{fov:t.fov}:{lens:t.lens??26}},t.aspect);let r=0,e=0;const u=[...o],x=t.sphere;for(const y of u){const M=I(y,i),m=l(M,a.forward);if(!(m>F))throw new Error(`fitCamera: a point framed is ${m.toFixed(3)} m along the view, nearer than the near plane (${String(F)} m); no lens can frame it.`);const b=l(M,a.right)/m,p=l(M,a.up)/m;r=Math.max(r,b>=0?b/n.right:-b/n.left),e=Math.max(e,p>=0?p/n.top:-p/n.bottom)}if(x){const y=z(I(x.center,i));if(!(y>x.radius))throw new Error("fitCamera: the camera is inside the sphere it frames.");const M=Math.asin(x.radius/y),m=Math.tan(M);r=Math.max(r,m/Math.min(n.left,n.right)),e=Math.max(e,m/Math.min(n.top,n.bottom))}const j=f==="width"?r/t.aspect:f==="height"?e:Math.max(e,r/t.aspect),C=2*Math.atan(j)*180/Math.PI;return{position:i,target:h,...g,...t.fov!==void 0?{fov:C}:{lens:P(C,t.aspect,t.lensFrame)}}}const c=E({position:[0,0,0],...t.direction!==void 0?{direction:t.direction}:{yaw:t.yaw??0,pitch:t.pitch??0},...g,...t.fov!==void 0?{fov:t.fov}:{lens:t.lens??26}},t.aspect),v=Math.tan(c.fov.horizontal*Math.PI/360),w=Math.tan(c.fov.vertical*Math.PI/360);let s=-1/0;for(const i of o){const a=I(i,h),r=l(a,c.right),e=l(a,c.up),u=l(a,c.forward);f!=="height"&&(s=Math.max(s,(r>=0?r/(v*n.right):-r/(v*n.left))-u)),f!=="width"&&(s=Math.max(s,(e>=0?e/(w*n.top):-e/(w*n.bottom))-u)),s=Math.max(s,F-u)}if(t.sphere){const{center:i,radius:a}=t.sphere,r=f==="width"?v*Math.min(n.left,n.right):f==="height"?w*Math.min(n.top,n.bottom):Math.min(v*Math.min(n.left,n.right),w*Math.min(n.top,n.bottom)),e=l(I(i,h),c.forward);s=Math.max(s,a/Math.sin(Math.atan(r))-e)}return{position:$(h,c.forward,-s),target:h,...g,...t.fov!==void 0?{fov:t.fov}:{lens:t.lens??26}}}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface GlassOptions {
|
|
2
|
+
/**
|
|
3
|
+
* How much light the glass reflects looking straight at it (F0), 0 to
|
|
4
|
+
* 0.16: 0.04 is bare glass (an index of 1.5); an anti-reflective coating
|
|
5
|
+
* 0.005 to 0.01. More at a slant, by Fresnel.
|
|
6
|
+
*/
|
|
7
|
+
reflectance?: number;
|
|
8
|
+
/**
|
|
9
|
+
* How rough its surface is (three.js's roughness), 0 to 1: 0 a mirror,
|
|
10
|
+
* about 0.05 a glossy screen, 0.3 to 0.5 a matte anti-glare one. Rough
|
|
11
|
+
* glass blurs what it reflects, the more the farther it is behind it,
|
|
12
|
+
* and spreads a lamp's highlight.
|
|
13
|
+
*/
|
|
14
|
+
roughness?: number;
|
|
15
|
+
/** The reflection's pixels, as a share of the scenery layer's along each side, 0.05 to 1. */
|
|
16
|
+
scale?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const GLASS_DEFAULTS: {
|
|
19
|
+
reflectance: number;
|
|
20
|
+
roughness: number;
|
|
21
|
+
scale: number;
|
|
22
|
+
};
|
|
23
|
+
/** Every reason glass options cannot be drawn. */
|
|
24
|
+
export declare function glassProblems(o: GlassOptions | undefined): string[];
|
|
25
|
+
/**
|
|
26
|
+
* three.js's physical material makes a dielectric's reflectance from its
|
|
27
|
+
* index of refraction, ((ior − 1) / (ior + 1))², times a specular
|
|
28
|
+
* intensity of at most 1: the pair that gives `reflectance`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function glassIor(reflectance: number): {
|
|
31
|
+
ior: number;
|
|
32
|
+
specularIntensity: number;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=glass.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export const GLASS_DEFAULTS={reflectance:.04,roughness:.05,scale:1};export function glassProblems(r){if(!r)return[];const t=[],n=(s,o,e,i)=>{s!==void 0&&!(Number.isFinite(s)&&s>=e&&s<=i)&&t.push(`glass.${o} is from ${String(e)} to ${String(i)}, not ${String(s)}.`)};return n(r.reflectance,"reflectance",0,.16),n(r.roughness,"roughness",0,1),n(r.scale,"scale",.05,1),t}export function glassIor(r){if(r<=.04)return{ior:1.5,specularIntensity:r/.04};const n=Math.sqrt(r);return{ior:(1+n)/(1-n),specularIntensity:1}}
|