@allyhub/sdk 0.1.0-alpha.8 → 0.2.0-next.0
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/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 +97 -21
- 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/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/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/formats/schemas/comments.schema.json +152 -0
- package/node_modules/@allyhub-next/formats/schemas/config.schema.json +43 -0
- package/node_modules/@allyhub-next/formats/schemas/edits.schema.json +112 -0
- package/node_modules/@allyhub-next/formats/schemas/elements.schema.json +33 -0
- package/node_modules/@allyhub-next/formats/schemas/gen.schema.json +97 -0
- package/node_modules/@allyhub-next/formats/schemas/interpretation.schema.json +125 -0
- package/node_modules/@allyhub-next/formats/schemas/items.json +75 -0
- package/node_modules/@allyhub-next/formats/schemas/messages.schema.json +11 -0
- package/node_modules/@allyhub-next/formats/schemas/script.schema.json +162 -0
- package/node_modules/@allyhub-next/formats/schemas/sheet.schema.json +395 -0
- package/node_modules/@allyhub-next/formats/schemas/words.schema.json +63 -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 +272 -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/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/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/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
- /package/{LICENSE → LICENSE.md} +0 -0
|
@@ -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}}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { type CameraState } from "./camera.js";
|
|
2
|
+
import { type Move, type MoveTime } from "./move.js";
|
|
3
|
+
/** A turn about the camera's own axes, degrees: yaw (positive turns left), pitch (up) and roll (counterclockwise). */
|
|
4
|
+
export type Turn = readonly [yaw: number, pitch: number, roll?: number];
|
|
5
|
+
/** A move along the camera's own axes, m: right, up and forward. */
|
|
6
|
+
export type Shift = readonly [right: number, up: number, forward?: number];
|
|
7
|
+
/** A reframe: the hand going to another framing. */
|
|
8
|
+
export interface Reframe {
|
|
9
|
+
/** When it starts: seconds of scenery time or a word or anchor reference. */
|
|
10
|
+
at: MoveTime;
|
|
11
|
+
/** The framing it goes to (a camera, or a move), held until the shot ends. */
|
|
12
|
+
to?: CameraState | Move;
|
|
13
|
+
/** Or a turn of the camera about its own axes from where it is. */
|
|
14
|
+
turn?: Turn;
|
|
15
|
+
/** And a move along them. */
|
|
16
|
+
shift?: Shift;
|
|
17
|
+
/** Seconds it takes; default `reframe.duration`. */
|
|
18
|
+
duration?: number;
|
|
19
|
+
/** How far past the framing it goes before it comes back, a share of the move; default `reframe.overshoot`. */
|
|
20
|
+
overshoot?: number;
|
|
21
|
+
}
|
|
22
|
+
/** A jolt: the hand knocked, the view thrown and ringing back. */
|
|
23
|
+
export interface Jolt {
|
|
24
|
+
at: MoveTime;
|
|
25
|
+
/** How far it throws the view at most; default `jolt.turn`. */
|
|
26
|
+
turn?: Turn;
|
|
27
|
+
}
|
|
28
|
+
export interface AutofocusOptions {
|
|
29
|
+
/** Where it rests, a share of the distance to what it focuses on (negative: in front of it). */
|
|
30
|
+
miss?: number;
|
|
31
|
+
/** How far it hunts after a cut, at most, as a share of the distance. */
|
|
32
|
+
hunt?: number;
|
|
33
|
+
/** Its swings a second as it hunts, and the seconds they take to die away. */
|
|
34
|
+
rate?: number;
|
|
35
|
+
decay?: number;
|
|
36
|
+
/** The share of `hunt` a cut, a reframe and a jolt each set off. */
|
|
37
|
+
after?: {
|
|
38
|
+
cut?: number;
|
|
39
|
+
reframe?: number;
|
|
40
|
+
jolt?: number;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface AutoExposureOptions {
|
|
44
|
+
/** Seconds before it follows a reframe to a framing of another ev, and the seconds it takes to get there (with no overshoot). */
|
|
45
|
+
delay?: number;
|
|
46
|
+
settle?: number;
|
|
47
|
+
/** Stops it is off at a cut, at most (from half that, either way), settling over `settle`. */
|
|
48
|
+
cut?: number;
|
|
49
|
+
/** Its breathing as it meters: the standard deviation in stops, and the seconds of its slow swing. */
|
|
50
|
+
breathe?: number;
|
|
51
|
+
period?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface HandheldOptions {
|
|
54
|
+
/** How far the hand sways the camera's view: each of yaw and pitch's standard deviation, degrees. */
|
|
55
|
+
angle?: number;
|
|
56
|
+
/** Roll's standard deviation over the angle's (the sway's, the drift's and the tremor's). */
|
|
57
|
+
roll?: number;
|
|
58
|
+
/** How far the hand moves the camera: each axis's standard deviation, m. */
|
|
59
|
+
shift?: number;
|
|
60
|
+
/** How fast it sways: the middle of its spectrum, Hz (from a third of it to three times it, falling as 1/f²). */
|
|
61
|
+
sway?: number;
|
|
62
|
+
/**
|
|
63
|
+
* The tremor over the sway: yaw and pitch's standard deviation,
|
|
64
|
+
* degrees; the middle of its band and how far it spreads, Hz; how much
|
|
65
|
+
* its middle differs from shot to shot (a share); how much its strength
|
|
66
|
+
* swells and fades (0: steady), over about `period` seconds.
|
|
67
|
+
*/
|
|
68
|
+
tremor?: {
|
|
69
|
+
angle?: number;
|
|
70
|
+
frequency?: number;
|
|
71
|
+
spread?: number;
|
|
72
|
+
vary?: number;
|
|
73
|
+
swell?: number;
|
|
74
|
+
period?: number;
|
|
75
|
+
};
|
|
76
|
+
/** The framing's slow drift: yaw and pitch's standard deviation, degrees; each axis's, m; the seconds of its swing. */
|
|
77
|
+
drift?: {
|
|
78
|
+
angle?: number;
|
|
79
|
+
shift?: number;
|
|
80
|
+
period?: number;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* A phone's stabiliser: the share of the turning it takes out, from
|
|
84
|
+
* none at 0 Hz to `strength` well above `cutoff` Hz (the sway's slow
|
|
85
|
+
* part passes, the tremor and a jolt's ringing mostly go). Absent: none;
|
|
86
|
+
* `{}` takes STABILIZER_DEFAULTS.
|
|
87
|
+
*/
|
|
88
|
+
stabilizer?: {
|
|
89
|
+
strength?: number;
|
|
90
|
+
cutoff?: number;
|
|
91
|
+
};
|
|
92
|
+
/** Reframes the hand makes, each in the shot it starts in. */
|
|
93
|
+
reframes?: readonly Reframe[];
|
|
94
|
+
/** How a reframe moves when it does not say: its seconds, its overshoot, when its speed peaks (a share of the move), how far its path bows (a share), and how much a seed changes each from reframe to reframe. */
|
|
95
|
+
reframe?: {
|
|
96
|
+
duration?: number;
|
|
97
|
+
overshoot?: number;
|
|
98
|
+
peak?: number;
|
|
99
|
+
bow?: number;
|
|
100
|
+
vary?: number;
|
|
101
|
+
};
|
|
102
|
+
/** Jolts, each in the shot it is in. */
|
|
103
|
+
jolts?: readonly Jolt[];
|
|
104
|
+
/** How a jolt throws the view when it does not say, how fast it rings (Hz) and how soon it is gone (s), and how much a seed changes each. */
|
|
105
|
+
jolt?: {
|
|
106
|
+
turn?: Turn;
|
|
107
|
+
ring?: number;
|
|
108
|
+
decay?: number;
|
|
109
|
+
vary?: number;
|
|
110
|
+
};
|
|
111
|
+
/** The autofocus hunting, when the camera has an aperture: absent, none; `{}` takes AUTOFOCUS_DEFAULTS. */
|
|
112
|
+
autofocus?: AutofocusOptions;
|
|
113
|
+
/** The auto-exposure, when the camera has an ev: absent, none; `{}` takes AUTO_EXPOSURE_DEFAULTS. */
|
|
114
|
+
exposure?: AutoExposureOptions;
|
|
115
|
+
/** Another seed is another hand. */
|
|
116
|
+
seed?: number;
|
|
117
|
+
}
|
|
118
|
+
export declare const HANDHELD_DEFAULTS: {
|
|
119
|
+
angle: number;
|
|
120
|
+
roll: number;
|
|
121
|
+
shift: number;
|
|
122
|
+
sway: number;
|
|
123
|
+
tremor: {
|
|
124
|
+
angle: number;
|
|
125
|
+
frequency: number;
|
|
126
|
+
spread: number;
|
|
127
|
+
vary: number;
|
|
128
|
+
swell: number;
|
|
129
|
+
period: number;
|
|
130
|
+
};
|
|
131
|
+
drift: {
|
|
132
|
+
angle: number;
|
|
133
|
+
shift: number;
|
|
134
|
+
period: number;
|
|
135
|
+
};
|
|
136
|
+
reframe: {
|
|
137
|
+
duration: number;
|
|
138
|
+
overshoot: number;
|
|
139
|
+
peak: number;
|
|
140
|
+
bow: number;
|
|
141
|
+
vary: number;
|
|
142
|
+
};
|
|
143
|
+
jolt: {
|
|
144
|
+
turn: Turn;
|
|
145
|
+
ring: number;
|
|
146
|
+
decay: number;
|
|
147
|
+
vary: number;
|
|
148
|
+
};
|
|
149
|
+
seed: number;
|
|
150
|
+
};
|
|
151
|
+
export declare const STABILIZER_DEFAULTS: {
|
|
152
|
+
strength: number;
|
|
153
|
+
cutoff: number;
|
|
154
|
+
};
|
|
155
|
+
export declare const AUTOFOCUS_DEFAULTS: {
|
|
156
|
+
miss: number;
|
|
157
|
+
hunt: number;
|
|
158
|
+
rate: number;
|
|
159
|
+
decay: number;
|
|
160
|
+
after: {
|
|
161
|
+
cut: number;
|
|
162
|
+
reframe: number;
|
|
163
|
+
jolt: number;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
export declare const AUTO_EXPOSURE_DEFAULTS: {
|
|
167
|
+
delay: number;
|
|
168
|
+
settle: number;
|
|
169
|
+
cut: number;
|
|
170
|
+
breathe: number;
|
|
171
|
+
period: number;
|
|
172
|
+
};
|
|
173
|
+
/** Why handheld's options cannot be used, or undefined. */
|
|
174
|
+
export declare function handheldProblem(o: HandheldOptions): string | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* A camera, or a move, held in a hand: each moment's camera turned and
|
|
177
|
+
* moved about its own axes by the hand, reframed and jolted where asked,
|
|
178
|
+
* its focus hunting and its exposure following where asked. Its lens,
|
|
179
|
+
* aperture and focus are kept, and the cuts of a camera made by shots()
|
|
180
|
+
* (each shot a new hand); a camera aimed at a target is given as the
|
|
181
|
+
* direction it looked.
|
|
182
|
+
*/
|
|
183
|
+
export declare function handheld(camera: CameraState | Move, opts?: HandheldOptions): Move;
|
|
184
|
+
//# sourceMappingURL=handheld.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{aimAt as Fe,aimShape as $e}from"./aim.js";import{CAMERA_DEFAULTS as ke,resolveCamera as X}from"./camera.js";import{cutsOf as Ue,mixCameras as De,momentOf as re,stateOf as ne,withCuts as Ie}from"./move.js";import{bandNoise as Y,hash3 as Le,powerNoise as Te,swellOf as Ne,unit3 as _e}from"./noise.js";import{add as Z,cross as J,DEG as C,dot as I,normalize as oe,rotate as Q,scale as N,sub as Pe}from"./vec.js";export const HANDHELD_DEFAULTS={angle:.25,roll:.5,shift:.003,sway:.7,tremor:{angle:.02,frequency:9,spread:1.5,vary:.12,swell:.3,period:3},drift:{angle:.15,shift:.002,period:8},reframe:{duration:.5,overshoot:.1,peak:.36,bow:.1,vary:.5},jolt:{turn:[.15,-.35,.1],ring:5,decay:.09,vary:.3},seed:1};const Ce=2;export const STABILIZER_DEFAULTS={strength:.8,cutoff:1.5},AUTOFOCUS_DEFAULTS={miss:-.02,hunt:.12,rate:2.3,decay:.3,after:{cut:1,reframe:.7,jolt:.3}},AUTO_EXPOSURE_DEFAULTS={delay:.15,settle:.7,cut:.25,breathe:.03,period:3};export function handheldProblem(t){const o=[["angle",t.angle],["roll",t.roll],["shift",t.shift],["sway",t.sway],["tremor.angle",t.tremor?.angle],["tremor.frequency",t.tremor?.frequency],["tremor.spread",t.tremor?.spread],["tremor.vary",t.tremor?.vary],["tremor.swell",t.tremor?.swell],["drift.angle",t.drift?.angle],["drift.shift",t.drift?.shift],["stabilizer.strength",t.stabilizer?.strength],["stabilizer.cutoff",t.stabilizer?.cutoff],["reframe.bow",t.reframe?.bow],["reframe.vary",t.reframe?.vary],["jolt.vary",t.jolt?.vary],["autofocus.hunt",t.autofocus?.hunt],["autofocus.rate",t.autofocus?.rate],["exposure.cut",t.exposure?.cut],["exposure.breathe",t.exposure?.breathe],["exposure.delay",t.exposure?.delay]];for(const[i,e]of o)if(e!==void 0&&!(Number.isFinite(e)&&e>=0))return`handheld()'s ${i} is a number from 0, not ${String(e)}`;const y=[["tremor.period",t.tremor?.period],["drift.period",t.drift?.period],["reframe.duration",t.reframe?.duration],["jolt.ring",t.jolt?.ring],["jolt.decay",t.jolt?.decay],["autofocus.decay",t.autofocus?.decay],["exposure.settle",t.exposure?.settle],["exposure.period",t.exposure?.period],...(t.reframes??[]).map((i,e)=>[`reframes[${String(e)}].duration`,i.duration])];for(const[i,e]of y)if(e!==void 0&&!(Number.isFinite(e)&&e>0))return`handheld()'s ${i} is a number above 0, not ${String(e)}`;if(t.stabilizer?.strength!==void 0&&t.stabilizer.strength>1)return`handheld()'s stabilizer.strength is a share from 0 to 1, not ${String(t.stabilizer.strength)}`;for(const[i,e]of(t.reframes??[]).entries()){if(e.to===void 0&&e.turn===void 0&&e.shift===void 0)return`handheld()'s reframes[${String(i)}] has nowhere to go: give it a framing (to), a turn or a shift`;if(e.overshoot!==void 0&&!(Number.isFinite(e.overshoot)&&e.overshoot>=-.5&&e.overshoot<=1))return`handheld()'s reframes[${String(i)}].overshoot is a share from -0.5 to 1, not ${String(e.overshoot)}`}if(t.seed!==void 0&&!Number.isInteger(t.seed))return`handheld()'s seed is a whole number, not ${String(t.seed)}`}const qe=t=>{const o=Math.min(1,Math.max(0,t));return o*o*(3-2*o)},$=(t,o,y)=>2*_e(t,o,y)-1;function Re(t,o,y){if(t<=0)return 0;const i=2*Math.PI*o,e=Math.atan(i*y)/i,D=Math.exp(-e/y)*Math.sin(i*e);return Math.exp(-t/y)*Math.sin(i*t)/D}export function handheld(t,o={}){const y=handheldProblem(o);if(y)throw new Error(y);const i=HANDHELD_DEFAULTS,e={angle:o.angle??i.angle,roll:o.roll??i.roll,shift:o.shift??i.shift,sway:o.sway??i.sway,tremor:{...i.tremor,...o.tremor},drift:{...i.drift,...o.drift},reframe:{...i.reframe,...o.reframe},jolt:{...i.jolt,...o.jolt},seed:o.seed??i.seed},D=o.stabilizer?{...STABILIZER_DEFAULTS,...o.stabilizer}:void 0,M=o.autofocus?{...AUTOFOCUS_DEFAULTS,...o.autofocus,after:{...AUTOFOCUS_DEFAULTS.after,...o.autofocus.after}}:void 0,x=o.exposure?{...AUTO_EXPOSURE_DEFAULTS,...o.exposure}:void 0,_=s=>D?1-D.strength*s*s/(s*s+D.cutoff*D.cutoff):1,j=e.seed*7919,V=new Map,se=s=>{const m=V.get(s);if(m)return m;const l=Le(j,s,1),u={low:e.sway/3,high:e.sway*3,alpha:Ce},O=[0,1,2,3,4,5].map(h=>Te(l,h,u,h<3?_:()=>1)),f=e.tremor.frequency*(1+e.tremor.vary*$(l,7,0)),c=_(f),w=[10,11,12].map(h=>{const g=Y(l,h,{center:f,spread:e.tremor.spread});return F=>c*g(F)}),n={sway:O,tremor:w,swell:Ne(l,13,e.tremor.swell,e.tremor.period),drift:[20,21,22,23,24,25].map(h=>Y(l,h,{center:0,spread:1/e.drift.period})),breathe:x?Y(l,30,{center:0,spread:1/x.period}):()=>0};return V.set(s,n),n},ee=new WeakMap;let q;const ae=s=>{const m=s?.time;if(m){const f=ee.get(m);if(f)return f}else if(q)return q;const l=Ue(t,s),u=f=>l.filter(c=>c<=f).length,O={cuts:l,reframes:(o.reframes??[]).map((f,c)=>{const w=re(s,f.at,"A reframe's at"),n=e.reframe.vary;return{at:w,shot:u(w),spec:f,shape:$e({overshoot:f.overshoot??e.reframe.overshoot,peak:e.reframe.peak,vary:n,seed:j,index:c}),duration:(f.duration??e.reframe.duration)*(1+.25*n*$(j,c,40)),bow:e.reframe.bow*$(j,c,41),index:c}}).sort((f,c)=>f.at-c.at),jolts:(o.jolts??[]).map((f,c)=>{const w=re(s,f.at,"A jolt's at"),n=e.jolt.vary,h=f.turn??e.jolt.turn,g=F=>1+n*$(j,c,50+F);return{at:w,shot:u(w),turn:[h[0]*g(0),h[1]*g(1),(h[2]??0)*g(2)],ring:e.jolt.ring*g(3),decay:e.jolt.decay*g(4),index:c}})};return m?ee.set(m,O):q=O,O};return Ie(t,(s,m)=>{const l=ae(m),u=l.cuts.filter(r=>r<=s).length,O=u>0?l.cuts[u-1]??-1/0:-1/0,f=se(u),c=m?.aspect??1,w=r=>m?.pointOf(r);let n=ne(t,s,m),h=0,g=0,F=0;const S=[0,0,0];for(const r of l.reframes){if(r.shot!==u||s<=r.at)continue;const p=(s-r.at)/r.duration,d=Fe(r.shape,p),z=r.bow*Math.sin(Math.PI*Math.min(1,p));if(r.spec.to){const b=ne(r.spec.to,s,m),a=X(n,c,w),U=X(b,c,w).forward,P=I(U,a.right),B=I(U,a.up),T=I(U,a.forward),G=Math.atan2(-P,T)/C,Ee=Math.atan2(B,Math.hypot(P,T))/C;h+=-Ee*z,g+=G*z;const Oe=x?qe((s-r.at-x.delay)/x.settle):Math.min(1,Math.max(0,d));n=De(n,b,d,m,"A reframe",Oe)}if(r.spec.turn){const[b,a,E=0]=r.spec.turn;h+=b*d-a*z,g+=a*d+b*z,F+=E*d}if(r.spec.shift){const[b,a,E=0]=r.spec.shift;S[0]+=b*d,S[1]+=a*d,S[2]+=E*d}}for(const r of l.jolts){if(r.shot!==u||s<=r.at)continue;const p=Re(s-r.at,r.ring,r.decay)*_(r.ring);h+=r.turn[0]*p,g+=r.turn[1]*p,F+=(r.turn[2]??0)*p}const[ie,fe,de,ue,ce,le]=f.sway.map(r=>r(s)),[he,me,pe]=f.tremor.map(r=>r(s)),[ge,we,ve,ye,be,Me]=f.drift.map(r=>r(s)),xe=f.swell(s),R=e.tremor.angle*xe,H=_(1/e.drift.period);h+=e.angle*(ie??0)+R*(he??0)+e.drift.angle*H*(ge??0),g+=e.angle*(fe??0)+R*(me??0)+e.drift.angle*H*(we??0),F+=e.roll*(e.angle*(de??0)+R*(pe??0)+e.drift.angle*H*(ve??0)),S[0]+=e.shift*(ue??0)+e.drift.shift*(ye??0),S[1]+=e.shift*(ce??0)+e.drift.shift*(be??0),S[2]+=e.shift*(le??0)+e.drift.shift*(Me??0);const A=X(n,c,w);let k=A.forward,L=A.up,K=A.right;const W=(r,p)=>{const d=p*C;k=Q(k,r,d),L=Q(L,r,d),K=Q(K,r,d)};W(K,g),W(L,h),W(N(k,-1),F);const je=Z(Z(Z(A.position,N(A.right,S[0])),N(A.up,S[1])),N(A.forward,S[2])),v={};if(n.lens!==void 0&&(v.lens=n.lens),n.lensFrame!==void 0&&(v.lensFrame=n.lensFrame),n.fov!==void 0&&(v.fov=n.fov),n.near!==void 0&&(v.near=n.near),n.far!==void 0&&(v.far=n.far),n.aperture!==void 0&&(v.aperture=n.aperture),n.ev!==void 0&&(v.ev=n.ev),n.focus!==void 0&&(v.focus=n.focus),M&&n.aperture!==void 0&&n.focus!==void 0){const r=n.focus,p=typeof r=="number"?void 0:typeof r=="string"?m?.pointOf(r):r,d=typeof r=="number"?r:p?I(Pe(p,A.position),A.forward):void 0;if(d!==void 0&&d>0){const z=[...u>0?[{when:O,share:M.after.cut,id:0}]:[],...l.reframes.filter(a=>a.shot===u).map(a=>({when:a.at+a.duration*.5,share:M.after.reframe,id:1+a.index})),...l.jolts.filter(a=>a.shot===u).map(a=>({when:a.at,share:M.after.jolt,id:1e3+a.index}))];let b=M.miss;for(const a of z){const E=s-a.when;if(E<0||E>M.decay*12)continue;const U=a.id*4,P=M.hunt*a.share*(1+.4*$(j,u,60+U)),B=M.rate*(1+.2*$(j,u,61+U)),T=2*Math.PI*B*E,G=$(j,u,62+U)<0?-1:1;b+=G*P*Math.exp(-E/M.decay)*(a.id===0?Math.cos(T):Math.sin(T))}v.focus=d*(1+b)}}if(x&&n.ev!==void 0){let r=n.ev+x.breathe*f.breathe(s);if(u>0){const p=s-O,d=x.settle/4,z=$(j,u,70);r+=x.cut*Math.sign(z)*(.5+.5*Math.abs(z))*(1+p/d)*Math.exp(-p/d)}v.ev=r}const Se=oe(n.up??ke.up),te=J(oe(J(k,Se)),k),Ae=N(k,-1),ze=Math.atan2(I(J(te,L),Ae),I(te,L));return{...v,position:je,direction:k,...n.up?{up:n.up}:{},roll:ze/C}})}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** A point on the floor: x and z, m. */
|
|
2
|
+
export type Floor = readonly [number, number];
|
|
3
|
+
/** The convex hull, counterclockwise from the lowest x (then z), without repeats. */
|
|
4
|
+
export declare function convexHull(points: readonly Floor[]): Floor[];
|
|
5
|
+
/** The smallest rectangle round points on the floor. */
|
|
6
|
+
export interface FloorRect {
|
|
7
|
+
/** Its centre, x and z. */
|
|
8
|
+
center: Floor;
|
|
9
|
+
/** Its longer side, then its shorter, m. */
|
|
10
|
+
length: number;
|
|
11
|
+
width: number;
|
|
12
|
+
/**
|
|
13
|
+
* Degrees about +Y from +X to its longer side, in [0, 180): which way it
|
|
14
|
+
* runs on the floor, as yaw turns (counterclockwise seen from above).
|
|
15
|
+
*/
|
|
16
|
+
angle: number;
|
|
17
|
+
/** Its four corners, in order round it. */
|
|
18
|
+
corners: [Floor, Floor, Floor, Floor];
|
|
19
|
+
area: number;
|
|
20
|
+
}
|
|
21
|
+
/** The smallest-area rectangle round points on the floor; undefined for none. */
|
|
22
|
+
export declare function floorRect(points: readonly Floor[]): FloorRect | undefined;
|
|
23
|
+
//# sourceMappingURL=hull.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
const P=(r,c,e)=>(c[0]-r[0])*(e[1]-r[1])-(c[1]-r[1])*(e[0]-r[0]);export function convexHull(r){const c=[...r].sort((t,n)=>t[0]-n[0]||t[1]-n[1]),e=[];for(const t of c){const n=e.at(-1);(n?.[0]!==t[0]||n[1]!==t[1])&&e.push(t)}if(e.length<3)return e;const o=[];for(const t of e){for(;o.length>=2;){const[n,s]=[o[o.length-2],o[o.length-1]];if(n&&s&&P(n,s,t)<=0)o.pop();else break}o.push(t)}const i=[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n){for(;i.length>=2;){const[s,l]=[i[i.length-2],i[i.length-1]];if(s&&l&&P(s,l,n)<=0)i.pop();else break}i.push(n)}}return[...o.slice(0,-1),...i.slice(0,-1)]}export function floorRect(r){const c=convexHull(r),e=c[0];if(!e)return;let o;const i=c.length<2?1:c.length;for(let h=0;h<i;h++){const g=c[h]??e,k=c[(h+1)%c.length]??e;let p=k[0]-g[0],d=k[1]-g[1];const I=Math.hypot(p,d);I===0?(p=1,d=0):(p/=I,d/=I);const b=[p,d],w=[-d,p];let a=[1/0,1/0],f=[-1/0,-1/0];for(const x of c){const v=x[0]*b[0]+x[1]*b[1],H=x[0]*w[0]+x[1]*w[1];a=[Math.min(a[0],v),Math.min(a[1],H)],f=[Math.max(f[0],v),Math.max(f[1],H)]}const q=(f[0]-a[0])*(f[1]-a[1]);(!o||q<o.area-1e-12)&&(o={area:q,ux:b,uz:w,lo:a,hi:f})}if(!o)return;const{ux:t,uz:n,lo:s,hi:l,area:R}=o,u=(h,g)=>[t[0]*h+n[0]*g,t[1]*h+n[1]*g],j=[u(s[0],s[1]),u(l[0],s[1]),u(l[0],l[1]),u(s[0],l[1])],M=l[0]-s[0],m=l[1]-s[1],z=M>=m?t:n;let y=Math.atan2(-z[1],z[0])*180/Math.PI;return y=(y%180+180)%180,{center:u((s[0]+l[0])/2,(s[1]+l[1])/2),length:Math.max(M,m),width:Math.min(M,m),angle:y,corners:j,area:R}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { blurDiameter, CAMERA_DEFAULTS, CameraError, cameraProblems, directionOf, exposureOf, project, resolveCamera, yawPitchOf, type CameraState, type PointOf, type Projection, type ResolvedCamera, } from "./camera.js";
|
|
2
|
+
export { BAKE_CPU, BAKE_DEFAULTS, BAKE_MIN_SIZE, bakeProblems, bakeRenderer, resolveBake, type BakeOptions, type BakeReport, type ResolvedBake, } from "./bake.js";
|
|
3
|
+
export { Curve, SAME_POINT, type CurvePoint } from "./curve.js";
|
|
4
|
+
export { defineScenery, isScenery, type AssetRef, type Bounds, type Scenery, type SceneryDefinition, type SceneryHost, type SceneryProp, type SceneryRendererOptions, SCENERY_RENDERER_DEFAULTS, } from "./define.js";
|
|
5
|
+
export { FIT_DEFAULTS, fitCamera, type Box, type FitOptions, type Margins, } from "./fit.js";
|
|
6
|
+
export { diagonalLens, fieldOfView, fieldOfViewFromVertical, FULL_FRAME_DIAGONAL, lensForVertical, lensFrameProblem, type FieldOfView, type LensFrame, } from "./lens.js";
|
|
7
|
+
export { blend, cutsOf, focusScreen, keys, mixCameras, momentOf, orbit, path, PATH_DEFAULTS, pathCurve, shots, stateOf, withCuts, NeedsTimeError, type CameraKey, type Cuts, type Shot, type BlendOptions, type FocusScreenOptions, type ScreenFace, type KeysOptions, type LensOptions, type Move, type OrbitOptions, type PathOptions, type MoveTime, type SceneryView, } from "./move.js";
|
|
8
|
+
export { GLASS_DEFAULTS, glassIor, glassProblems, type GlassOptions, } from "./glass.js";
|
|
9
|
+
export { aimAt, aimed, AIM_DEFAULTS, aimProblem, aimShape, rise, type AimOptions, type AimShape, } from "./aim.js";
|
|
10
|
+
export { AUTO_EXPOSURE_DEFAULTS, AUTOFOCUS_DEFAULTS, handheld, HANDHELD_DEFAULTS, handheldProblem, STABILIZER_DEFAULTS, type AutoExposureOptions, type AutofocusOptions, type HandheldOptions, type Jolt, type Reframe, type Shift, type Turn, } from "./handheld.js";
|
|
11
|
+
export { bandNoise, gauss3, hash3, powerNoise, swellOf, unit3, type Band, type Slope, } from "./noise.js";
|
|
12
|
+
export { convexHull, floorRect, type Floor, type FloorRect } from "./hull.js";
|
|
13
|
+
export { solveCamera, SOLVE_DEFAULTS, SOLVE_PARAMS, type SolveLine, type SolveOptions, type SolveParam, type SolvePoint, type SolveResidual, type SolveResult, } from "./solve.js";
|
|
14
|
+
export { invert3, moireAt, moireBand, moireCamera, moireProblems, moireScreen, MOIRE_GLSL, MOIRE_SCREENS, PANEL_DEFAULTS, SENSOR_DEFAULTS, STRIPE_DEPTH, type MoireCamera, type MoireScreen, type PanelOptions, type SensorOptions, } from "./moire.js";
|
|
15
|
+
export { screenFocus, SCREEN_FOCUS_DEFAULTS, type ScreenFocus, type ScreenFocusOptions, } from "./screen-focus.js";
|
|
16
|
+
export { apply, homography, matrix3d, screenOnFrame, shownCentre, SCREEN_LIGHT_DEFAULTS, screenLightBaseProblem, type Px, type ScreenLightBase, type ScreenOnFrame, } from "./screen.js";
|
|
17
|
+
export { AROUND_DEFAULTS, FLOOR_DEFAULTS, INVENTORY_FRAME, MAP_DEFAULTS, MAP_VIEWS, MEASURE_DEFAULTS, MOTION_DEFAULTS, SIDES, type AxisBox, type CameraClearance, type CameraSource, type Channel, type ClearAhead, type Contact, type FreeFloor, type Levels, type MeasureRequest, type MeasureResult, type MeshHealth, type Motion, type MotionRequest, type SeeRequest, type SeeResult, type SeeTile, type Sight, type Support, type DrawnCamera, type Footprint, type MapPath, type MapRequest, type MapResult, type MapView, type MapViewResult, type OwnBox, type PointRef, type PointsRequest, type Seen, type Side, type UprightBox, type ViewRequest, type ViewResult, type ViewTile, type ViewTileResult, type SceneryInventory, type SceneryLight, type SceneryObject, topObjects, } from "./report.js";
|
|
18
|
+
export { channel, motionOf, type CameraSample, type MotionNumbers, } from "./motion.js";
|
|
19
|
+
export { easeValue, timedNumber, type Ease, type NumberKey } from "./timing.js";
|
|
20
|
+
export { PHONE_CAMERA, phoneCamera, type Deeper, type PhoneCamera, } from "./phone.js";
|
|
21
|
+
export type { Vec3 } from "./vec.js";
|
|
22
|
+
//# sourceMappingURL=index.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{blurDiameter,CAMERA_DEFAULTS,CameraError,cameraProblems,directionOf,exposureOf,project,resolveCamera,yawPitchOf}from"./camera.js";export{BAKE_CPU,BAKE_DEFAULTS,BAKE_MIN_SIZE,bakeProblems,bakeRenderer,resolveBake}from"./bake.js";export{Curve,SAME_POINT}from"./curve.js";export{defineScenery,isScenery,SCENERY_RENDERER_DEFAULTS}from"./define.js";export{FIT_DEFAULTS,fitCamera}from"./fit.js";export{diagonalLens,fieldOfView,fieldOfViewFromVertical,FULL_FRAME_DIAGONAL,lensForVertical,lensFrameProblem}from"./lens.js";export{blend,cutsOf,focusScreen,keys,mixCameras,momentOf,orbit,path,PATH_DEFAULTS,pathCurve,shots,stateOf,withCuts,NeedsTimeError}from"./move.js";export{GLASS_DEFAULTS,glassIor,glassProblems}from"./glass.js";export{aimAt,aimed,AIM_DEFAULTS,aimProblem,aimShape,rise}from"./aim.js";export{AUTO_EXPOSURE_DEFAULTS,AUTOFOCUS_DEFAULTS,handheld,HANDHELD_DEFAULTS,handheldProblem,STABILIZER_DEFAULTS}from"./handheld.js";export{bandNoise,gauss3,hash3,powerNoise,swellOf,unit3}from"./noise.js";export{convexHull,floorRect}from"./hull.js";export{solveCamera,SOLVE_DEFAULTS,SOLVE_PARAMS}from"./solve.js";export{invert3,moireAt,moireBand,moireCamera,moireProblems,moireScreen,MOIRE_GLSL,MOIRE_SCREENS,PANEL_DEFAULTS,SENSOR_DEFAULTS,STRIPE_DEPTH}from"./moire.js";export{screenFocus,SCREEN_FOCUS_DEFAULTS}from"./screen-focus.js";export{apply,homography,matrix3d,screenOnFrame,shownCentre,SCREEN_LIGHT_DEFAULTS,screenLightBaseProblem}from"./screen.js";export{AROUND_DEFAULTS,FLOOR_DEFAULTS,INVENTORY_FRAME,MAP_DEFAULTS,MAP_VIEWS,MEASURE_DEFAULTS,MOTION_DEFAULTS,SIDES,topObjects}from"./report.js";export{channel,motionOf}from"./motion.js";export{easeValue,timedNumber}from"./timing.js";export{PHONE_CAMERA,phoneCamera}from"./phone.js";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** The diagonal of a 36 × 24 mm frame, in mm. */
|
|
2
|
+
export declare const FULL_FRAME_DIAGONAL: number;
|
|
3
|
+
/** The long and short sides of a 36 × 24 mm frame, in mm. */
|
|
4
|
+
export declare const FULL_FRAME_LONG = 36;
|
|
5
|
+
export declare const FULL_FRAME_SHORT = 24;
|
|
6
|
+
/**
|
|
7
|
+
* What a lens is measured on:
|
|
8
|
+
* - "diagonal": the output frame's diagonal (the default);
|
|
9
|
+
* - "long", "short": the output frame's long or short side, as 36 or 24 mm;
|
|
10
|
+
* - { aspect, keep }: the diagonal of a frame of that aspect (4/3, a
|
|
11
|
+
* phone's photo), then the output frame cut from it keeping that frame's
|
|
12
|
+
* long or short side (a phone's video keeps the long side);
|
|
13
|
+
* - "phone": { aspect: 4 / 3, keep: "long" }, how a phone's camera app
|
|
14
|
+
* quotes its lenses for video.
|
|
15
|
+
*/
|
|
16
|
+
export type LensFrame = "diagonal" | "long" | "short" | "phone" | {
|
|
17
|
+
aspect: number;
|
|
18
|
+
keep: "long" | "short";
|
|
19
|
+
};
|
|
20
|
+
/** "phone" is a phone's 4:3 photo frame, its video keeping the long side. */
|
|
21
|
+
export declare const PHONE_FRAME: {
|
|
22
|
+
readonly aspect: number;
|
|
23
|
+
readonly keep: "long";
|
|
24
|
+
};
|
|
25
|
+
/** The angles a frame sees, in degrees. */
|
|
26
|
+
export interface FieldOfView {
|
|
27
|
+
horizontal: number;
|
|
28
|
+
vertical: number;
|
|
29
|
+
diagonal: number;
|
|
30
|
+
}
|
|
31
|
+
/** Whether a lens frame is one of the five forms, with a usable aspect. */
|
|
32
|
+
export declare function lensFrameProblem(frame: LensFrame): string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The angles a lens sees on a frame of `aspect` (width over height).
|
|
35
|
+
* fieldOfView(26, 16 / 9) is 71.9° × 44.4°, 79.5° on the diagonal.
|
|
36
|
+
*/
|
|
37
|
+
export declare function fieldOfView(lens: number, aspect: number, frame?: LensFrame): FieldOfView;
|
|
38
|
+
/** The lens that sees `vertical` degrees on a frame of `aspect`: fieldOfView's inverse. */
|
|
39
|
+
export declare function lensForVertical(vertical: number, aspect: number, frame?: LensFrame): number;
|
|
40
|
+
/** The angles a frame of `aspect` sees with a vertical angle of `vertical` degrees. */
|
|
41
|
+
export declare function fieldOfViewFromVertical(vertical: number, aspect: number): FieldOfView;
|
|
42
|
+
/**
|
|
43
|
+
* A lens said in the default convention: the focal length that sees the
|
|
44
|
+
* same diagonal on the output frame. A phone's 26 mm in 16:9 video
|
|
45
|
+
* (`{ aspect: 4/3, keep: "long" }`) is 28.3 mm on the diagonal.
|
|
46
|
+
*/
|
|
47
|
+
export declare function diagonalLens(lens: number, aspect: number, frame?: LensFrame): number;
|
|
48
|
+
//# sourceMappingURL=lens.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 FULL_FRAME_DIAGONAL=Math.hypot(36,24),FULL_FRAME_LONG=36,FULL_FRAME_SHORT=24,PHONE_FRAME={aspect:4/3,keep:"long"};const g=t=>Math.max(t,1/t);function p(t,n){const e=g(t),o=n==="phone"?PHONE_FRAME:n;if(o==="diagonal"){const r=FULL_FRAME_DIAGONAL/2,u=Math.hypot(1,e);return{long:r*e/u,short:r/u}}if(o==="long"){const r=FULL_FRAME_LONG/2;return{long:r,short:r/e}}if(o==="short"){const r=FULL_FRAME_SHORT/2;return{long:r*e,short:r}}const s=g(o.aspect),a=FULL_FRAME_DIAGONAL/2,i=Math.hypot(1,s);if(o.keep==="long"){const r=a*s/i;return{long:r,short:r/e}}const l=a/i;return{long:l*e,short:l}}const c=t=>2*Math.atan(t)*180/Math.PI,h=t=>Math.tan(t*Math.PI/360);export function lensFrameProblem(t){if(t==="diagonal"||t==="long"||t==="short"||t==="phone")return;if(!(Number.isFinite(t.aspect)&&t.aspect>0))return`lensFrame.aspect must be a positive number, not ${String(t.aspect)}`;const n=t.keep;if(n!=="long"&&n!=="short")return`lensFrame.keep must be "long" or "short", not ${JSON.stringify(n)}`}export function fieldOfView(t,n,e="diagonal"){const o=p(n,e),s=o.long/t,a=o.short/t,i=n>=1;return{horizontal:c(i?s:a),vertical:c(i?a:s),diagonal:c(Math.hypot(s,a))}}export function lensForVertical(t,n,e="diagonal"){const o=p(n,e);return(n>=1?o.short:o.long)/h(t)}export function fieldOfViewFromVertical(t,n){const e=h(t),o=e*n;return{horizontal:c(o),vertical:t,diagonal:c(Math.hypot(o,e))}}export function diagonalLens(t,n,e="diagonal"){const o=fieldOfView(t,n,e).diagonal;return FULL_FRAME_DIAGONAL/2/h(o)}
|