@automovie/viewer 0.3.4 → 0.4.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/README.md +8 -87
- package/lib/IAutoMovieViewerCompletedFrame.d.ts +19 -11
- package/lib/IAutoMovieViewerDisplayMetadata.d.ts +0 -5
- package/lib/IAutoMovieViewerHandle.d.ts +3 -25
- package/lib/IMountViewerOptions.d.ts +24 -38
- package/lib/IViewerCameraStateSnapshot.d.ts +0 -5
- package/lib/IViewerFrameTransfer.d.ts +11 -0
- package/lib/IViewerFrameTransfer.js +3 -0
- package/lib/IViewerFrameTransfer.js.map +1 -0
- package/lib/IViewerFrameTransfer.mjs +0 -0
- package/lib/applyCaptureCanvasSize.d.ts +9 -10
- package/lib/applyCaptureCanvasSize.js +7 -13
- package/lib/applyCaptureCanvasSize.js.map +1 -1
- package/lib/applyCaptureCanvasSize.mjs +7 -10
- package/lib/applyCaptureCanvasSize.mjs.map +1 -1
- package/lib/audio/IAutoMovieAudioCue.d.ts +3 -8
- package/lib/audio/planAutoMovieAudioPlayback.d.ts +8 -21
- package/lib/audio/planAutoMovieAudioPlayback.js +8 -14
- package/lib/audio/planAutoMovieAudioPlayback.js.map +1 -1
- package/lib/audio/planAutoMovieAudioPlayback.mjs +8 -14
- package/lib/audio/planAutoMovieAudioPlayback.mjs.map +1 -1
- package/lib/audio/playAutoMovieAudioCues.d.ts +4 -11
- package/lib/audio/playAutoMovieAudioCues.js +4 -11
- package/lib/audio/playAutoMovieAudioCues.js.map +1 -1
- package/lib/audio/playAutoMovieAudioCues.mjs +4 -11
- package/lib/audio/playAutoMovieAudioCues.mjs.map +1 -1
- package/lib/createViewerCameraState.d.ts +3 -11
- package/lib/createViewerCameraState.js +80 -121
- package/lib/createViewerCameraState.js.map +1 -1
- package/lib/createViewerCameraState.mjs +46 -98
- package/lib/createViewerCameraState.mjs.map +1 -1
- package/lib/createViewerDisplayClock.d.ts +2 -10
- package/lib/createViewerDisplayClock.js +4 -12
- package/lib/createViewerDisplayClock.js.map +1 -1
- package/lib/createViewerDisplayClock.mjs +3 -11
- package/lib/createViewerDisplayClock.mjs.map +1 -1
- package/lib/createViewerDisplayPublication.d.ts +7 -15
- package/lib/createViewerDisplayPublication.js +7 -15
- package/lib/createViewerDisplayPublication.js.map +1 -1
- package/lib/createViewerDisplayPublication.mjs +7 -15
- package/lib/createViewerDisplayPublication.mjs.map +1 -1
- package/lib/createViewerDisplaySave.d.ts +8 -16
- package/lib/createViewerDisplaySave.js +8 -16
- package/lib/createViewerDisplaySave.js.map +1 -1
- package/lib/createViewerDisplaySave.mjs +8 -16
- package/lib/createViewerDisplaySave.mjs.map +1 -1
- package/lib/createViewerFrameControl.d.ts +8 -10
- package/lib/createViewerFrameControl.js +3 -15
- package/lib/createViewerFrameControl.js.map +1 -1
- package/lib/createViewerFrameControl.mjs +3 -12
- package/lib/createViewerFrameControl.mjs.map +1 -1
- package/lib/createViewerViewportResize.d.ts +4 -12
- package/lib/createViewerViewportResize.js +7 -20
- package/lib/createViewerViewportResize.js.map +1 -1
- package/lib/createViewerViewportResize.mjs +6 -14
- package/lib/createViewerViewportResize.mjs.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +6 -1
- package/lib/inspector/AutoMovieInspector.d.ts +33 -13
- package/lib/inspector/AutoMovieInspector.js +110 -19
- package/lib/inspector/AutoMovieInspector.js.map +1 -1
- package/lib/inspector/AutoMovieInspector.mjs +121 -18
- package/lib/inspector/AutoMovieInspector.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorBeauty.d.ts +41 -0
- package/lib/inspector/AutoMovieInspectorBeauty.js +56 -0
- package/lib/inspector/AutoMovieInspectorBeauty.js.map +1 -0
- package/lib/inspector/AutoMovieInspectorBeauty.mjs +55 -0
- package/lib/inspector/AutoMovieInspectorBeauty.mjs.map +1 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticLog.d.ts +48 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticLog.js +186 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticLog.js.map +1 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticLog.mjs +171 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticLog.mjs.map +1 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.d.ts +23 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.js +37 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.js.map +1 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.mjs +85 -0
- package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.mjs.map +1 -0
- package/lib/inspector/AutoMovieInspectorMarksPanel.d.ts +4 -10
- package/lib/inspector/AutoMovieInspectorMarksPanel.js +18 -35
- package/lib/inspector/AutoMovieInspectorMarksPanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorMarksPanel.mjs +32 -38
- package/lib/inspector/AutoMovieInspectorMarksPanel.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorPlayhead.d.ts +35 -96
- package/lib/inspector/AutoMovieInspectorPlayhead.js +41 -101
- package/lib/inspector/AutoMovieInspectorPlayhead.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorPlayhead.mjs +44 -98
- package/lib/inspector/AutoMovieInspectorPlayhead.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorRequestPanel.d.ts +9 -10
- package/lib/inspector/AutoMovieInspectorRequestPanel.js +18 -12
- package/lib/inspector/AutoMovieInspectorRequestPanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorRequestPanel.mjs +32 -14
- package/lib/inspector/AutoMovieInspectorRequestPanel.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorSelectionPanel.d.ts +0 -8
- package/lib/inspector/AutoMovieInspectorSelectionPanel.js +0 -8
- package/lib/inspector/AutoMovieInspectorSelectionPanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorSelectionPanel.mjs +0 -8
- package/lib/inspector/AutoMovieInspectorSelectionPanel.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorShadePanel.d.ts +2 -9
- package/lib/inspector/AutoMovieInspectorShadePanel.js +18 -25
- package/lib/inspector/AutoMovieInspectorShadePanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorShadePanel.mjs +18 -27
- package/lib/inspector/AutoMovieInspectorShadePanel.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorTimePanel.d.ts +0 -8
- package/lib/inspector/AutoMovieInspectorTimePanel.js +0 -8
- package/lib/inspector/AutoMovieInspectorTimePanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorTimePanel.mjs +0 -8
- package/lib/inspector/AutoMovieInspectorTimePanel.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorTimeReadout.d.ts +0 -8
- package/lib/inspector/AutoMovieInspectorTimeReadout.js +4 -10
- package/lib/inspector/AutoMovieInspectorTimeReadout.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorTimeReadout.mjs +3 -12
- package/lib/inspector/AutoMovieInspectorTimeReadout.mjs.map +1 -1
- package/lib/inspector/AutoMovieInspectorTransition.d.ts +79 -0
- package/lib/inspector/AutoMovieInspectorTransition.js +131 -0
- package/lib/inspector/AutoMovieInspectorTransition.js.map +1 -0
- package/lib/inspector/AutoMovieInspectorTransition.mjs +119 -0
- package/lib/inspector/AutoMovieInspectorTransition.mjs.map +1 -0
- package/lib/inspector/AutoMovieInspectorViewPanel.d.ts +0 -8
- package/lib/inspector/AutoMovieInspectorViewPanel.js +0 -8
- package/lib/inspector/AutoMovieInspectorViewPanel.js.map +1 -1
- package/lib/inspector/AutoMovieInspectorViewPanel.mjs +0 -8
- package/lib/inspector/AutoMovieInspectorViewPanel.mjs.map +1 -1
- package/lib/inspector/IAutoMovieInspectorAction.d.ts +54 -95
- package/lib/inspector/IAutoMovieInspectorLive.d.ts +43 -0
- package/lib/inspector/IAutoMovieInspectorLive.js +3 -0
- package/lib/inspector/IAutoMovieInspectorLive.js.map +1 -0
- package/lib/inspector/IAutoMovieInspectorLive.mjs +0 -0
- package/lib/inspector/IAutoMovieInspectorPathNode.d.ts +14 -9
- package/lib/inspector/IAutoMovieInspectorProps.d.ts +3 -14
- package/lib/inspector/IAutoMovieInspectorScene.d.ts +96 -100
- package/lib/inspector/IAutoMovieInspectorSceneHost.d.ts +37 -102
- package/lib/inspector/IAutoMovieInspectorState.d.ts +6 -7
- package/lib/inspector/assertAutoMovieInspectorRaster.d.ts +7 -0
- package/lib/inspector/assertAutoMovieInspectorRaster.js +19 -0
- package/lib/inspector/assertAutoMovieInspectorRaster.js.map +1 -0
- package/lib/inspector/assertAutoMovieInspectorRaster.mjs +17 -0
- package/lib/inspector/assertAutoMovieInspectorRaster.mjs.map +1 -0
- package/lib/inspector/buildAutoMovieInspectorPathTree.d.ts +9 -10
- package/lib/inspector/buildAutoMovieInspectorPathTree.js +9 -10
- package/lib/inspector/buildAutoMovieInspectorPathTree.js.map +1 -1
- package/lib/inspector/buildAutoMovieInspectorPathTree.mjs +9 -10
- package/lib/inspector/buildAutoMovieInspectorPathTree.mjs.map +1 -1
- package/lib/inspector/changesAutoMovieObservedScene.d.ts +16 -0
- package/lib/inspector/changesAutoMovieObservedScene.js +28 -0
- package/lib/inspector/changesAutoMovieObservedScene.js.map +1 -0
- package/lib/inspector/changesAutoMovieObservedScene.mjs +21 -0
- package/lib/inspector/changesAutoMovieObservedScene.mjs.map +1 -0
- package/lib/inspector/createAutoMovieInspectorAddressWriter.d.ts +13 -11
- package/lib/inspector/createAutoMovieInspectorAddressWriter.js +13 -11
- package/lib/inspector/createAutoMovieInspectorAddressWriter.js.map +1 -1
- package/lib/inspector/createAutoMovieInspectorAddressWriter.mjs +13 -11
- package/lib/inspector/createAutoMovieInspectorAddressWriter.mjs.map +1 -1
- package/lib/inspector/createAutoMovieInspectorCanvasHost.d.ts +7 -10
- package/lib/inspector/createAutoMovieInspectorCanvasHost.js +14 -11
- package/lib/inspector/createAutoMovieInspectorCanvasHost.js.map +1 -1
- package/lib/inspector/createAutoMovieInspectorCanvasHost.mjs +17 -14
- package/lib/inspector/createAutoMovieInspectorCanvasHost.mjs.map +1 -1
- package/lib/inspector/createAutoMovieInspectorState.d.ts +3 -9
- package/lib/inspector/createAutoMovieInspectorState.js +3 -9
- package/lib/inspector/createAutoMovieInspectorState.js.map +1 -1
- package/lib/inspector/createAutoMovieInspectorState.mjs +3 -9
- package/lib/inspector/createAutoMovieInspectorState.mjs.map +1 -1
- package/lib/inspector/firstAutoMovieInspectorSecond.d.ts +6 -0
- package/lib/inspector/firstAutoMovieInspectorSecond.js +13 -0
- package/lib/inspector/firstAutoMovieInspectorSecond.js.map +1 -0
- package/lib/inspector/firstAutoMovieInspectorSecond.mjs +11 -0
- package/lib/inspector/firstAutoMovieInspectorSecond.mjs.map +1 -0
- package/lib/inspector/followAutoMovieInspectorSize.d.ts +11 -0
- package/lib/inspector/followAutoMovieInspectorSize.js +26 -0
- package/lib/inspector/followAutoMovieInspectorSize.js.map +1 -0
- package/lib/inspector/followAutoMovieInspectorSize.mjs +26 -0
- package/lib/inspector/followAutoMovieInspectorSize.mjs.map +1 -0
- package/lib/inspector/formatAutoMovieInspectorAddress.d.ts +11 -10
- package/lib/inspector/formatAutoMovieInspectorAddress.js +15 -11
- package/lib/inspector/formatAutoMovieInspectorAddress.js.map +1 -1
- package/lib/inspector/formatAutoMovieInspectorAddress.mjs +15 -11
- package/lib/inspector/formatAutoMovieInspectorAddress.mjs.map +1 -1
- package/lib/inspector/formatAutoMovieInspectorCommand.d.ts +20 -14
- package/lib/inspector/formatAutoMovieInspectorCommand.js +33 -14
- package/lib/inspector/formatAutoMovieInspectorCommand.js.map +1 -1
- package/lib/inspector/formatAutoMovieInspectorCommand.mjs +26 -15
- package/lib/inspector/formatAutoMovieInspectorCommand.mjs.map +1 -1
- package/lib/inspector/handleAutoMovieInspectorKey.d.ts +24 -15
- package/lib/inspector/handleAutoMovieInspectorKey.js +27 -16
- package/lib/inspector/handleAutoMovieInspectorKey.js.map +1 -1
- package/lib/inspector/handleAutoMovieInspectorKey.mjs +27 -16
- package/lib/inspector/handleAutoMovieInspectorKey.mjs.map +1 -1
- package/lib/inspector/index.d.ts +5 -0
- package/lib/inspector/index.js +5 -0
- package/lib/inspector/index.js.map +1 -1
- package/lib/inspector/index.mjs +6 -1
- package/lib/inspector/inspectAutoMovieInspectorRequest.d.ts +19 -0
- package/lib/inspector/inspectAutoMovieInspectorRequest.js +20 -0
- package/lib/inspector/inspectAutoMovieInspectorRequest.js.map +1 -0
- package/lib/inspector/inspectAutoMovieInspectorRequest.mjs +20 -0
- package/lib/inspector/inspectAutoMovieInspectorRequest.mjs.map +1 -0
- package/lib/inspector/installAutoMovieInspectorRequest.d.ts +20 -0
- package/lib/inspector/installAutoMovieInspectorRequest.js +36 -0
- package/lib/inspector/installAutoMovieInspectorRequest.js.map +1 -0
- package/lib/inspector/installAutoMovieInspectorRequest.mjs +35 -0
- package/lib/inspector/installAutoMovieInspectorRequest.mjs.map +1 -0
- package/lib/inspector/locateAutoMovieInspectorFinding.d.ts +19 -0
- package/lib/inspector/locateAutoMovieInspectorFinding.js +34 -0
- package/lib/inspector/locateAutoMovieInspectorFinding.js.map +1 -0
- package/lib/inspector/locateAutoMovieInspectorFinding.mjs +37 -0
- package/lib/inspector/locateAutoMovieInspectorFinding.mjs.map +1 -0
- package/lib/inspector/messageOfAutoMovieInspectorError.d.ts +2 -0
- package/lib/inspector/messageOfAutoMovieInspectorError.js +8 -0
- package/lib/inspector/messageOfAutoMovieInspectorError.js.map +1 -0
- package/lib/inspector/messageOfAutoMovieInspectorError.mjs +8 -0
- package/lib/inspector/messageOfAutoMovieInspectorError.mjs.map +1 -0
- package/lib/inspector/mountAutoMovieInspectorPage.d.ts +5 -8
- package/lib/inspector/mountAutoMovieInspectorPage.js +3 -9
- package/lib/inspector/mountAutoMovieInspectorPage.js.map +1 -1
- package/lib/inspector/mountAutoMovieInspectorPage.mjs +4 -9
- package/lib/inspector/mountAutoMovieInspectorPage.mjs.map +1 -1
- package/lib/inspector/mountAutoMovieInspectorScene.d.ts +55 -12
- package/lib/inspector/mountAutoMovieInspectorScene.js +238 -164
- package/lib/inspector/mountAutoMovieInspectorScene.js.map +1 -1
- package/lib/inspector/mountAutoMovieInspectorScene.mjs +223 -149
- package/lib/inspector/mountAutoMovieInspectorScene.mjs.map +1 -1
- package/lib/inspector/placeAutoMovieInspectorLabels.d.ts +29 -0
- package/lib/inspector/placeAutoMovieInspectorLabels.js +33 -0
- package/lib/inspector/placeAutoMovieInspectorLabels.js.map +1 -0
- package/lib/inspector/placeAutoMovieInspectorLabels.mjs +32 -0
- package/lib/inspector/placeAutoMovieInspectorLabels.mjs.map +1 -0
- package/lib/inspector/readAutoMovieInspectorAddress.d.ts +8 -11
- package/lib/inspector/readAutoMovieInspectorAddress.js +8 -11
- package/lib/inspector/readAutoMovieInspectorAddress.js.map +1 -1
- package/lib/inspector/readAutoMovieInspectorAddress.mjs +8 -11
- package/lib/inspector/readAutoMovieInspectorAddress.mjs.map +1 -1
- package/lib/inspector/readAutoMovieInspectorFacts.d.ts +17 -0
- package/lib/inspector/readAutoMovieInspectorFacts.js +34 -0
- package/lib/inspector/readAutoMovieInspectorFacts.js.map +1 -0
- package/lib/inspector/readAutoMovieInspectorFacts.mjs +28 -0
- package/lib/inspector/readAutoMovieInspectorFacts.mjs.map +1 -0
- package/lib/inspector/readsAutoMovieInspectorPlacedScene.d.ts +9 -0
- package/lib/inspector/readsAutoMovieInspectorPlacedScene.js +14 -0
- package/lib/inspector/readsAutoMovieInspectorPlacedScene.js.map +1 -0
- package/lib/inspector/readsAutoMovieInspectorPlacedScene.mjs +14 -0
- package/lib/inspector/readsAutoMovieInspectorPlacedScene.mjs.map +1 -0
- package/lib/inspector/reduceAutoMovieInspectorState.d.ts +10 -10
- package/lib/inspector/reduceAutoMovieInspectorState.js +17 -11
- package/lib/inspector/reduceAutoMovieInspectorState.js.map +1 -1
- package/lib/inspector/reduceAutoMovieInspectorState.mjs +16 -11
- package/lib/inspector/reduceAutoMovieInspectorState.mjs.map +1 -1
- package/lib/inspector/releaseAutoMovieInspectorSteps.d.ts +6 -0
- package/lib/inspector/releaseAutoMovieInspectorSteps.js +23 -0
- package/lib/inspector/releaseAutoMovieInspectorSteps.js.map +1 -0
- package/lib/inspector/releaseAutoMovieInspectorSteps.mjs +19 -0
- package/lib/inspector/releaseAutoMovieInspectorSteps.mjs.map +1 -0
- package/lib/inspector/reportAutoMovieInspectorLabels.d.ts +21 -0
- package/lib/inspector/reportAutoMovieInspectorLabels.js +27 -0
- package/lib/inspector/reportAutoMovieInspectorLabels.js.map +1 -0
- package/lib/inspector/reportAutoMovieInspectorLabels.mjs +30 -0
- package/lib/inspector/reportAutoMovieInspectorLabels.mjs.map +1 -0
- package/lib/inspector/resolveAutoMovieInspectorCamera.d.ts +22 -0
- package/lib/inspector/resolveAutoMovieInspectorCamera.js +34 -0
- package/lib/inspector/resolveAutoMovieInspectorCamera.js.map +1 -0
- package/lib/inspector/resolveAutoMovieInspectorCamera.mjs +34 -0
- package/lib/inspector/resolveAutoMovieInspectorCamera.mjs.map +1 -0
- package/lib/inspector/showAutoMovieInspectorFinding.d.ts +25 -0
- package/lib/inspector/showAutoMovieInspectorFinding.js +26 -0
- package/lib/inspector/showAutoMovieInspectorFinding.js.map +1 -0
- package/lib/inspector/showAutoMovieInspectorFinding.mjs +26 -0
- package/lib/inspector/showAutoMovieInspectorFinding.mjs.map +1 -0
- package/lib/inspector/stopAutoMovieInspectorTime.d.ts +11 -0
- package/lib/inspector/stopAutoMovieInspectorTime.js +17 -0
- package/lib/inspector/stopAutoMovieInspectorTime.js.map +1 -0
- package/lib/inspector/stopAutoMovieInspectorTime.mjs +18 -0
- package/lib/inspector/stopAutoMovieInspectorTime.mjs.map +1 -0
- package/lib/inspector/writeAutoMovieInspectorInspection.d.ts +6 -0
- package/lib/inspector/writeAutoMovieInspectorInspection.js +12 -0
- package/lib/inspector/writeAutoMovieInspectorInspection.js.map +1 -0
- package/lib/inspector/writeAutoMovieInspectorInspection.mjs +12 -0
- package/lib/inspector/writeAutoMovieInspectorInspection.mjs.map +1 -0
- package/lib/internal.d.ts +7 -0
- package/lib/internal.js +25 -0
- package/lib/internal.js.map +1 -0
- package/lib/internal.mjs +8 -0
- package/lib/mountViewer.d.ts +16 -10
- package/lib/mountViewer.js +17 -14
- package/lib/mountViewer.js.map +1 -1
- package/lib/mountViewer.mjs +18 -12
- package/lib/mountViewer.mjs.map +1 -1
- package/lib/publishViewerCompletedFrame.d.ts +12 -10
- package/lib/publishViewerCompletedFrame.js +11 -9
- package/lib/publishViewerCompletedFrame.js.map +1 -1
- package/lib/publishViewerCompletedFrame.mjs +11 -9
- package/lib/publishViewerCompletedFrame.mjs.map +1 -1
- package/lib/redrawViewerCompletedFrame.d.ts +2 -10
- package/lib/redrawViewerCompletedFrame.js +4 -12
- package/lib/redrawViewerCompletedFrame.js.map +1 -1
- package/lib/redrawViewerCompletedFrame.mjs +3 -11
- package/lib/redrawViewerCompletedFrame.mjs.map +1 -1
- package/lib/releaseMountedViewer.d.ts +5 -9
- package/lib/releaseMountedViewer.js +5 -9
- package/lib/releaseMountedViewer.js.map +1 -1
- package/lib/releaseMountedViewer.mjs +5 -9
- package/lib/releaseMountedViewer.mjs.map +1 -1
- package/lib/transport/AutoMovieViewerTransport.d.ts +13 -122
- package/lib/transport/AutoMovieViewerTransport.js +10 -74
- package/lib/transport/AutoMovieViewerTransport.js.map +1 -1
- package/lib/transport/AutoMovieViewerTransport.mjs +10 -65
- package/lib/transport/AutoMovieViewerTransport.mjs.map +1 -1
- package/lib/transport/readAutoMovieReviewInterval.d.ts +3 -10
- package/lib/transport/readAutoMovieReviewInterval.js +11 -16
- package/lib/transport/readAutoMovieReviewInterval.js.map +1 -1
- package/lib/transport/readAutoMovieReviewInterval.mjs +8 -14
- package/lib/transport/readAutoMovieReviewInterval.mjs.map +1 -1
- package/package.json +12 -8
- package/src/IAutoMovieViewerCompletedFrame.ts +21 -11
- package/src/IAutoMovieViewerDisplayMetadata.ts +0 -5
- package/src/IAutoMovieViewerHandle.ts +3 -25
- package/src/IMountViewerOptions.ts +24 -38
- package/src/IViewerCameraStateSnapshot.ts +0 -5
- package/src/IViewerFrameTransfer.ts +13 -0
- package/src/applyCaptureCanvasSize.ts +9 -18
- package/src/audio/IAutoMovieAudioCue.ts +3 -8
- package/src/audio/planAutoMovieAudioPlayback.ts +9 -23
- package/src/audio/playAutoMovieAudioCues.ts +4 -11
- package/src/createViewerCameraState.ts +119 -175
- package/src/createViewerDisplayClock.ts +4 -12
- package/src/createViewerDisplayPublication.ts +7 -15
- package/src/createViewerDisplaySave.ts +8 -16
- package/src/createViewerFrameControl.ts +16 -24
- package/src/createViewerViewportResize.ts +7 -23
- package/src/index.ts +1 -0
- package/src/inspector/AutoMovieInspector.tsx +183 -20
- package/src/inspector/AutoMovieInspectorBeauty.ts +89 -0
- package/src/inspector/AutoMovieInspectorDiagnosticLog.ts +235 -0
- package/src/inspector/AutoMovieInspectorDiagnosticsPanel.tsx +118 -0
- package/src/inspector/AutoMovieInspectorMarksPanel.tsx +26 -34
- package/src/inspector/AutoMovieInspectorPlayhead.ts +53 -110
- package/src/inspector/AutoMovieInspectorRequestPanel.tsx +57 -29
- package/src/inspector/AutoMovieInspectorSelectionPanel.tsx +0 -8
- package/src/inspector/AutoMovieInspectorShadePanel.tsx +24 -29
- package/src/inspector/AutoMovieInspectorTimePanel.tsx +0 -8
- package/src/inspector/AutoMovieInspectorTimeReadout.tsx +4 -10
- package/src/inspector/AutoMovieInspectorTransition.ts +178 -0
- package/src/inspector/AutoMovieInspectorViewPanel.tsx +0 -8
- package/src/inspector/IAutoMovieInspectorAction.ts +57 -94
- package/src/inspector/IAutoMovieInspectorLive.ts +62 -0
- package/src/inspector/IAutoMovieInspectorPathNode.ts +14 -9
- package/src/inspector/IAutoMovieInspectorProps.ts +4 -14
- package/src/inspector/IAutoMovieInspectorScene.ts +104 -99
- package/src/inspector/IAutoMovieInspectorSceneHost.ts +43 -102
- package/src/inspector/IAutoMovieInspectorState.ts +6 -7
- package/src/inspector/assertAutoMovieInspectorRaster.ts +23 -0
- package/src/inspector/buildAutoMovieInspectorPathTree.ts +9 -10
- package/src/inspector/changesAutoMovieObservedScene.ts +30 -0
- package/src/inspector/createAutoMovieInspectorAddressWriter.ts +13 -11
- package/src/inspector/createAutoMovieInspectorCanvasHost.ts +14 -12
- package/src/inspector/createAutoMovieInspectorState.ts +3 -9
- package/src/inspector/firstAutoMovieInspectorSecond.ts +13 -0
- package/src/inspector/followAutoMovieInspectorSize.ts +32 -0
- package/src/inspector/formatAutoMovieInspectorAddress.ts +15 -11
- package/src/inspector/formatAutoMovieInspectorCommand.ts +44 -15
- package/src/inspector/handleAutoMovieInspectorKey.ts +27 -16
- package/src/inspector/index.ts +5 -0
- package/src/inspector/inspectAutoMovieInspectorRequest.ts +37 -0
- package/src/inspector/installAutoMovieInspectorRequest.ts +50 -0
- package/src/inspector/locateAutoMovieInspectorFinding.ts +40 -0
- package/src/inspector/messageOfAutoMovieInspectorError.ts +4 -0
- package/src/inspector/mountAutoMovieInspectorPage.tsx +7 -8
- package/src/inspector/mountAutoMovieInspectorScene.ts +290 -232
- package/src/inspector/placeAutoMovieInspectorLabels.ts +53 -0
- package/src/inspector/readAutoMovieInspectorAddress.ts +8 -11
- package/src/inspector/readAutoMovieInspectorFacts.ts +50 -0
- package/src/inspector/readsAutoMovieInspectorPlacedScene.ts +16 -0
- package/src/inspector/reduceAutoMovieInspectorState.ts +17 -11
- package/src/inspector/releaseAutoMovieInspectorSteps.ts +19 -0
- package/src/inspector/reportAutoMovieInspectorLabels.ts +45 -0
- package/src/inspector/resolveAutoMovieInspectorCamera.ts +50 -0
- package/src/inspector/showAutoMovieInspectorFinding.ts +40 -0
- package/src/inspector/stopAutoMovieInspectorTime.ts +19 -0
- package/src/inspector/writeAutoMovieInspectorInspection.ts +12 -0
- package/src/internal.ts +9 -0
- package/src/mountViewer.ts +17 -14
- package/src/publishViewerCompletedFrame.ts +14 -10
- package/src/redrawViewerCompletedFrame.ts +3 -12
- package/src/releaseMountedViewer.ts +5 -9
- package/src/transport/AutoMovieViewerTransport.ts +17 -144
- package/src/transport/readAutoMovieReviewInterval.ts +15 -16
|
@@ -2,27 +2,21 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Which cues sound when playback starts at a film instant and runs at a
|
|
4
4
|
* transport rate, and how each is started: a cue already sounding starts at
|
|
5
|
-
* once part-way into its excerpt, a later cue after its film delay divided
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* once part-way into its excerpt, a later cue after its film delay divided by
|
|
6
|
+
* the transport rate, and an ended cue not at all. Source offsets advance by
|
|
7
|
+
* the cue's own rate times the elapsed film seconds, and the playback rate
|
|
8
|
+
* multiplies the cue rate by the transport rate. Pure, so a seek and a resume
|
|
9
|
+
* plan the same playback from the same instant.
|
|
10
10
|
*
|
|
11
11
|
* @param cues The cue list.
|
|
12
12
|
* @param seconds The film instant playback starts from.
|
|
13
13
|
* @param rate Film seconds per wall second; positive.
|
|
14
|
-
* @param lengths Source length in seconds by asset, for cues without a
|
|
14
|
+
* @param lengths Source length in seconds by asset, for cues without a
|
|
15
|
+
* duration.
|
|
15
16
|
* @returns One start per sounding cue, in cue order.
|
|
16
|
-
* @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (Which cues sound when playback starts at a film instant and runs at a transport rate, and how each is started: a cue already sounding starts at once part-way into its excerpt, a later cue after its film delay divided by the transport rate, and an ended cue not at all) and documents parameters `cues`, `seconds`, `rate`, `lengths`, the returned value as stated in this comment.
|
|
17
|
-
* @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Which cues sound when playback starts at a film instant and runs at a transport rate, and how each is started: a cue already sounding starts at once part-way into its excerpt, a later cue after its film delay divided by the transport rate, and an ended cue not at all) directly over its typed inputs (`cues`, `seconds`, `rate`, `lengths`) as a single pass (for-of over cues), delegating to `Number.isFinite`, `Math.max`, `starts.push`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body throws (2 throw sites). Apart from structural 0, 1 and 2 the body uses no numeric literal.
|
|
18
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 25 lines and 4 top-level statements that reuses `Number.isFinite`, `Math.max`, `starts.push` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.
|
|
19
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Scanning the body finds no `any`, type assertion, non-null assertion, suppression directive or TODO, and no branch keyed on a consumer, fixture or expected answer; values come from its parameters.
|
|
20
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `cues`, `seconds`, `rate`, `lengths`; the dominant cost is a single pass (for-of over cues), performed once per call with 4 allocation sites (literals and constructed values). No speedup is claimed and none is measured.
|
|
21
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.
|
|
22
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 4 allocation sites become the returned value or die with the call, so nothing grows.
|
|
23
17
|
*/
|
|
24
18
|
function planAutoMovieAudioPlayback(cues, seconds, rate, lengths) {
|
|
25
|
-
if (!(rate > 0)
|
|
19
|
+
if (!(rate > 0)) throw new Error("Invalid audio playback instant or rate");
|
|
26
20
|
const starts = [];
|
|
27
21
|
for (const cue of cues) {
|
|
28
22
|
const speed = cue.rate ?? 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planAutoMovieAudioPlayback.mjs","names":[],"sources":["../../src/audio/planAutoMovieAudioPlayback.ts"],"sourcesContent":["import type { IAutoMovieAudioCue } from \"./IAutoMovieAudioCue.js\";\n\n/**\n * Which cues sound when playback starts at a film instant and runs at a\n * transport rate, and how each is started: a cue already sounding starts at\n * once part-way into its excerpt, a later cue after its film delay divided\n *
|
|
1
|
+
{"version":3,"file":"planAutoMovieAudioPlayback.mjs","names":[],"sources":["../../src/audio/planAutoMovieAudioPlayback.ts"],"sourcesContent":["import type { IAutoMovieAudioCue } from \"./IAutoMovieAudioCue.js\";\n\n/**\n * Which cues sound when playback starts at a film instant and runs at a\n * transport rate, and how each is started: a cue already sounding starts at\n * once part-way into its excerpt, a later cue after its film delay divided by\n * the transport rate, and an ended cue not at all. Source offsets advance by\n * the cue's own rate times the elapsed film seconds, and the playback rate\n * multiplies the cue rate by the transport rate. Pure, so a seek and a resume\n * plan the same playback from the same instant.\n *\n * @param cues The cue list.\n * @param seconds The film instant playback starts from.\n * @param rate Film seconds per wall second; positive.\n * @param lengths Source length in seconds by asset, for cues without a\n * duration.\n * @returns One start per sounding cue, in cue order.\n */\nexport function planAutoMovieAudioPlayback(\n cues: readonly IAutoMovieAudioCue[],\n seconds: number,\n rate: number,\n lengths: Readonly<Record<string, number>>,\n): planAutoMovieAudioPlayback.IStart[] {\n if (!(rate > 0)) throw new Error(\"Invalid audio playback instant or rate\");\n const starts: planAutoMovieAudioPlayback.IStart[] = [];\n for (const cue of cues) {\n const speed: number = cue.rate ?? 1;\n const offset: number = cue.offsetSeconds ?? 0;\n const length: number | undefined = lengths[cue.asset];\n if (length === undefined)\n throw new Error(`Unknown audio asset ${cue.asset}`);\n const duration: number = cue.durationSeconds ?? (length - offset) / speed;\n const elapsed: number = Math.max(0, seconds - cue.seconds);\n if (elapsed >= duration) continue;\n starts.push({\n asset: cue.asset,\n delay: Math.max(0, cue.seconds - seconds) / rate,\n offset: offset + elapsed * speed,\n duration: (duration - elapsed) / rate,\n gain: cue.gain,\n pan: cue.pan ?? 0,\n playbackRate: speed * rate,\n });\n }\n return starts;\n}\n/** Companion types of {@link planAutoMovieAudioPlayback}. */\nexport namespace planAutoMovieAudioPlayback {\n /** One planned source start. */\n export interface IStart {\n /** Source id. */\n asset: string;\n\n /** Wall seconds from now until it starts. */\n delay: number;\n\n /** Source seconds it starts from. */\n offset: number;\n\n /** Wall seconds it sounds. */\n duration: number;\n\n /** Linear gain. */\n gain: number;\n\n /** Equal-power pan in [-1, 1]. */\n pan: number;\n\n /** Source seconds per wall second. */\n playbackRate: number;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,2BACd,MACA,SACA,MACA,SACqC;CACrC,IAAI,EAAE,OAAO,IAAI,MAAM,IAAI,MAAM,wCAAwC;CACzE,MAAM,SAA8C,CAAC;CACrD,KAAK,MAAM,OAAO,MAAM;EACtB,MAAM,QAAgB,IAAI,QAAQ;EAClC,MAAM,SAAiB,IAAI,iBAAiB;EAC5C,MAAM,SAA6B,QAAQ,IAAI;EAC/C,IAAI,WAAW,KAAA,GACb,MAAM,IAAI,MAAM,uBAAuB,IAAI,OAAO;EACpD,MAAM,WAAmB,IAAI,oBAAoB,SAAS,UAAU;EACpE,MAAM,UAAkB,KAAK,IAAI,GAAG,UAAU,IAAI,OAAO;EACzD,IAAI,WAAW,UAAU;EACzB,OAAO,KAAK;GACV,OAAO,IAAI;GACX,OAAO,KAAK,IAAI,GAAG,IAAI,UAAU,OAAO,IAAI;GAC5C,QAAQ,SAAS,UAAU;GAC3B,WAAW,WAAW,WAAW;GACjC,MAAM,IAAI;GACV,KAAK,IAAI,OAAO;GAChB,cAAc,QAAQ;EACxB,CAAC;CACH;CACA,OAAO;AACT"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { IAutoMovieAudioCue } from "./IAutoMovieAudioCue.js";
|
|
2
2
|
/**
|
|
3
|
-
* Play a cue list through Web Audio from a film instant at a transport rate,
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* Play a cue list through Web Audio from a film instant at a transport rate, as
|
|
4
|
+
* {@link planAutoMovieAudioPlayback} plans it: one buffer source per sounding
|
|
5
|
+
* cue, through a gain and an equal-power stereo panner, started at the
|
|
6
|
+
* context's current time plus its delay. The returned stop releases every
|
|
7
7
|
* started source, so a pause, seek or rate change stops and replans.
|
|
8
8
|
*
|
|
9
9
|
* @param context The audio context.
|
|
@@ -12,12 +12,5 @@ import type { IAutoMovieAudioCue } from "./IAutoMovieAudioCue.js";
|
|
|
12
12
|
* @param seconds The film instant to start from.
|
|
13
13
|
* @param rate Film seconds per wall second.
|
|
14
14
|
* @returns A function stopping every started source once.
|
|
15
|
-
* @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (Play a cue list through Web Audio from a film instant at a transport rate, as plans it: one buffer source per sounding cue, through a gain and an equal-power stereo panner, started at the context's current time plus its delay) and documents parameters `context`, `decoded`, `cues`, `seconds`, `rate`, the returned value as stated in this comment.
|
|
16
|
-
* @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Play a cue list through Web Audio from a film instant at a transport rate, as plans it: one buffer source per sounding cue, through a gain and an equal-power stereo panner, started at the context's current time plus its delay) directly over its typed inputs (`context`, `decoded`, `cues`, `seconds`, `rate`) as 3 sequential passes (map over Object.entries(decoded); for-of over planAutoMovieAudioPlayback( cues, ; for-of over sources), delegating to `Object.fromEntries`, `Object.entries(decoded).map`, `Object.entries`, `planAutoMovieAudioPlayback`, `context.createBufferSource`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body performs no validation and relies on its callers. Apart from structural 0, 1 and 2 the body uses no numeric literal.
|
|
17
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 46 lines and 6 top-level statements that reuses `Object.fromEntries`, `Object.entries(decoded).map`, `Object.entries`, `planAutoMovieAudioPlayback`, `context.createBufferSource` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.
|
|
18
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The body contains 0 `any`, 0 type assertion(s), 1 non-null assertion(s); these are the remaining shortcuts and are not justified here.
|
|
19
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `context`, `decoded`, `cues`, `seconds`, `rate`; the dominant cost is 3 sequential passes (map over Object.entries(decoded); for-of over planAutoMovieAudioPlayback( cues, ; for-of over sources), performed once per call with 2 allocation sites (literals and constructed values). No speedup is claimed and none is measured.
|
|
20
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.
|
|
21
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 2 allocation sites become the returned value or die with the call, so nothing grows.
|
|
22
15
|
*/
|
|
23
16
|
export declare function playAutoMovieAudioCues(context: BaseAudioContext, decoded: Readonly<Record<string, AudioBuffer>>, cues: readonly IAutoMovieAudioCue[], seconds: number, rate: number): () => void;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.playAutoMovieAudioCues = playAutoMovieAudioCues;
|
|
4
4
|
const planAutoMovieAudioPlayback_js_1 = require("./planAutoMovieAudioPlayback.js");
|
|
5
5
|
/**
|
|
6
|
-
* Play a cue list through Web Audio from a film instant at a transport rate,
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Play a cue list through Web Audio from a film instant at a transport rate, as
|
|
7
|
+
* {@link planAutoMovieAudioPlayback} plans it: one buffer source per sounding
|
|
8
|
+
* cue, through a gain and an equal-power stereo panner, started at the
|
|
9
|
+
* context's current time plus its delay. The returned stop releases every
|
|
10
10
|
* started source, so a pause, seek or rate change stops and replans.
|
|
11
11
|
*
|
|
12
12
|
* @param context The audio context.
|
|
@@ -15,13 +15,6 @@ const planAutoMovieAudioPlayback_js_1 = require("./planAutoMovieAudioPlayback.js
|
|
|
15
15
|
* @param seconds The film instant to start from.
|
|
16
16
|
* @param rate Film seconds per wall second.
|
|
17
17
|
* @returns A function stopping every started source once.
|
|
18
|
-
* @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (Play a cue list through Web Audio from a film instant at a transport rate, as plans it: one buffer source per sounding cue, through a gain and an equal-power stereo panner, started at the context's current time plus its delay) and documents parameters `context`, `decoded`, `cues`, `seconds`, `rate`, the returned value as stated in this comment.
|
|
19
|
-
* @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Play a cue list through Web Audio from a film instant at a transport rate, as plans it: one buffer source per sounding cue, through a gain and an equal-power stereo panner, started at the context's current time plus its delay) directly over its typed inputs (`context`, `decoded`, `cues`, `seconds`, `rate`) as 3 sequential passes (map over Object.entries(decoded); for-of over planAutoMovieAudioPlayback( cues, ; for-of over sources), delegating to `Object.fromEntries`, `Object.entries(decoded).map`, `Object.entries`, `planAutoMovieAudioPlayback`, `context.createBufferSource`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body performs no validation and relies on its callers. Apart from structural 0, 1 and 2 the body uses no numeric literal.
|
|
20
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 46 lines and 6 top-level statements that reuses `Object.fromEntries`, `Object.entries(decoded).map`, `Object.entries`, `planAutoMovieAudioPlayback`, `context.createBufferSource` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.
|
|
21
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The body contains 0 `any`, 0 type assertion(s), 1 non-null assertion(s); these are the remaining shortcuts and are not justified here.
|
|
22
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `context`, `decoded`, `cues`, `seconds`, `rate`; the dominant cost is 3 sequential passes (map over Object.entries(decoded); for-of over planAutoMovieAudioPlayback( cues, ; for-of over sources), performed once per call with 2 allocation sites (literals and constructed values). No speedup is claimed and none is measured.
|
|
23
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.
|
|
24
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 2 allocation sites become the returned value or die with the call, so nothing grows.
|
|
25
18
|
*/
|
|
26
19
|
function playAutoMovieAudioCues(context, decoded, cues, seconds, rate) {
|
|
27
20
|
const lengths = Object.fromEntries(Object.entries(decoded).map(([id, buffer]) => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playAutoMovieAudioCues.js","sourceRoot":"","sources":["../../src/audio/playAutoMovieAudioCues.ts"],"names":[],"mappings":";;;AACA,mFAA6E;AAE7E
|
|
1
|
+
{"version":3,"file":"playAutoMovieAudioCues.js","sourceRoot":"","sources":["../../src/audio/playAutoMovieAudioCues.ts"],"names":[],"mappings":";;;AACA,mFAA6E;AAE7E;;;;;;;;;;;;;GAaG;AACH,gCACE,OAAyB,EACzB,OAA8C,EAC9C,IAAmC,EACnC,OAAe,EACf,IAAY;IAEZ,MAAM,OAAO,GAA2B,MAAM,CAAC,WAAW,CACxD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CACzB,CAAC,CAAC,EAAE,EAAE,MAAM,CAAwB,EAAoB,EAAE,CAAC;QACzD,EAAE;QACF,MAAM,CAAC,QAAQ;KAChB,CACF,CACF,CAAC;IACF,MAAM,GAAG,GAAW,OAAO,CAAC,WAAW,CAAC;IACxC,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,KAAK,MAAM,KAAK,IAAI,IAAA,0DAA0B,EAC5C,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,OAAO,CACR,EAAE,CAAC;QACF,MAAM,MAAM,GAA0B,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACnE,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAE,CAAC;QACtC,MAAM,CAAC,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC;QAC/C,MAAM,IAAI,GAAa,OAAO,CAAC,UAAU,EAAE,CAAC;QAC5C,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;QAC7B,MAAM,MAAM,GAAqB,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC9D,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC;QAC7B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAClE,MAAM,CAAC,KAAK,CACV,GAAG,GAAG,KAAK,CAAC,KAAK,EACjB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,YAAY,CACpC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,GAAY,KAAK,CAAC;IAC7B,OAAO,GAAS,EAAE;QAChB,IAAI,OAAO;YAAE,OAAO;QACpB,OAAO,GAAG,IAAI,CAAC;QACf,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC;gBACH,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,CAAC;YAAC,MAAM,CAAC;gBACP,mDAAmD;YACrD,CAAC;YACD,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { planAutoMovieAudioPlayback } from "./planAutoMovieAudioPlayback.mjs";
|
|
2
2
|
// src/audio/playAutoMovieAudioCues.ts
|
|
3
3
|
/**
|
|
4
|
-
* Play a cue list through Web Audio from a film instant at a transport rate,
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Play a cue list through Web Audio from a film instant at a transport rate, as
|
|
5
|
+
* {@link planAutoMovieAudioPlayback} plans it: one buffer source per sounding
|
|
6
|
+
* cue, through a gain and an equal-power stereo panner, started at the
|
|
7
|
+
* context's current time plus its delay. The returned stop releases every
|
|
8
8
|
* started source, so a pause, seek or rate change stops and replans.
|
|
9
9
|
*
|
|
10
10
|
* @param context The audio context.
|
|
@@ -13,13 +13,6 @@ import { planAutoMovieAudioPlayback } from "./planAutoMovieAudioPlayback.mjs";
|
|
|
13
13
|
* @param seconds The film instant to start from.
|
|
14
14
|
* @param rate Film seconds per wall second.
|
|
15
15
|
* @returns A function stopping every started source once.
|
|
16
|
-
* @evidence contracts/development/common.md#meaningful-documentation Gives the purpose (Play a cue list through Web Audio from a film instant at a transport rate, as plans it: one buffer source per sounding cue, through a gain and an equal-power stereo panner, started at the context's current time plus its delay) and documents parameters `context`, `decoded`, `cues`, `seconds`, `rate`, the returned value as stated in this comment.
|
|
17
|
-
* @evidence contracts/development/implementation.md#principled-implementation Implements the documented behavior (Play a cue list through Web Audio from a film instant at a transport rate, as plans it: one buffer source per sounding cue, through a gain and an equal-power stereo panner, started at the context's current time plus its delay) directly over its typed inputs (`context`, `decoded`, `cues`, `seconds`, `rate`) as 3 sequential passes (map over Object.entries(decoded); for-of over planAutoMovieAudioPlayback( cues, ; for-of over sources), delegating to `Object.fromEntries`, `Object.entries(decoded).map`, `Object.entries`, `planAutoMovieAudioPlayback`, `context.createBufferSource`; the premises are the units, frames and ranges stated in its parameter documentation, enforced only where the body performs no validation and relies on its callers. Apart from structural 0, 1 and 2 the body uses no numeric literal.
|
|
18
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure One operation of 46 lines and 6 top-level statements that reuses `Object.fromEntries`, `Object.entries(decoded).map`, `Object.entries`, `planAutoMovieAudioPlayback`, `context.createBufferSource` from their owners instead of copying them; it adds no option, layer or abstraction beyond its documented parameters.
|
|
19
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The body contains 0 `any`, 0 type assertion(s), 1 non-null assertion(s); these are the remaining shortcuts and are not justified here.
|
|
20
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Cost is driven by the sizes of `context`, `decoded`, `cues`, `seconds`, `rate`; the dominant cost is 3 sequential passes (map over Object.entries(decoded); for-of over planAutoMovieAudioPlayback( cues, ; for-of over sources), performed once per call with 2 allocation sites (literals and constructed values). No speedup is claimed and none is measured.
|
|
21
|
-
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The operation coordinates no requests, phases or consumers and holds no cache: each call recomputes from its arguments and shares nothing, which is correct because its result depends only on them.
|
|
22
|
-
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function acquires no handle, timer, listener or task and keeps no state between calls; its 2 allocation sites become the returned value or die with the call, so nothing grows.
|
|
23
16
|
*/
|
|
24
17
|
function playAutoMovieAudioCues(context, decoded, cues, seconds, rate) {
|
|
25
18
|
const lengths = Object.fromEntries(Object.entries(decoded).map(([id, buffer]) => [id, buffer.duration]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playAutoMovieAudioCues.mjs","names":[],"sources":["../../src/audio/playAutoMovieAudioCues.ts"],"sourcesContent":["import type { IAutoMovieAudioCue } from \"./IAutoMovieAudioCue.js\";\nimport { planAutoMovieAudioPlayback } from \"./planAutoMovieAudioPlayback.js\";\n\n/**\n * Play a cue list through Web Audio from a film instant at a transport rate
|
|
1
|
+
{"version":3,"file":"playAutoMovieAudioCues.mjs","names":[],"sources":["../../src/audio/playAutoMovieAudioCues.ts"],"sourcesContent":["import type { IAutoMovieAudioCue } from \"./IAutoMovieAudioCue.js\";\nimport { planAutoMovieAudioPlayback } from \"./planAutoMovieAudioPlayback.js\";\n\n/**\n * Play a cue list through Web Audio from a film instant at a transport rate, as\n * {@link planAutoMovieAudioPlayback} plans it: one buffer source per sounding\n * cue, through a gain and an equal-power stereo panner, started at the\n * context's current time plus its delay. The returned stop releases every\n * started source, so a pause, seek or rate change stops and replans.\n *\n * @param context The audio context.\n * @param decoded Decoded buffers by asset.\n * @param cues The cue list.\n * @param seconds The film instant to start from.\n * @param rate Film seconds per wall second.\n * @returns A function stopping every started source once.\n */\nexport function playAutoMovieAudioCues(\n context: BaseAudioContext,\n decoded: Readonly<Record<string, AudioBuffer>>,\n cues: readonly IAutoMovieAudioCue[],\n seconds: number,\n rate: number,\n): () => void {\n const lengths: Record<string, number> = Object.fromEntries(\n Object.entries(decoded).map(\n ([id, buffer]: [string, AudioBuffer]): [string, number] => [\n id,\n buffer.duration,\n ],\n ),\n );\n const now: number = context.currentTime;\n const sources: AudioBufferSourceNode[] = [];\n for (const start of planAutoMovieAudioPlayback(\n cues,\n seconds,\n rate,\n lengths,\n )) {\n const source: AudioBufferSourceNode = context.createBufferSource();\n source.buffer = decoded[start.asset]!;\n source.playbackRate.value = start.playbackRate;\n const gain: GainNode = context.createGain();\n gain.gain.value = start.gain;\n const panner: StereoPannerNode = context.createStereoPanner();\n panner.pan.value = start.pan;\n source.connect(gain).connect(panner).connect(context.destination);\n source.start(\n now + start.delay,\n start.offset,\n start.duration * start.playbackRate,\n );\n sources.push(source);\n }\n let stopped: boolean = false;\n return (): void => {\n if (stopped) return;\n stopped = true;\n for (const source of sources) {\n try {\n source.stop();\n } catch {\n // A source that already ended has nothing to stop.\n }\n source.disconnect();\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,SAAgB,uBACd,SACA,SACA,MACA,SACA,MACY;CACZ,MAAM,UAAkC,OAAO,YAC7C,OAAO,QAAQ,OAAO,CAAC,CAAC,KACrB,CAAC,IAAI,YAAqD,CACzD,IACA,OAAO,QACT,CACF,CACF;CACA,MAAM,MAAc,QAAQ;CAC5B,MAAM,UAAmC,CAAC;CAC1C,KAAK,MAAM,SAAS,2BAClB,MACA,SACA,MACA,OACF,GAAG;EACD,MAAM,SAAgC,QAAQ,mBAAmB;EACjE,OAAO,SAAS,QAAQ,MAAM;EAC9B,OAAO,aAAa,QAAQ,MAAM;EAClC,MAAM,OAAiB,QAAQ,WAAW;EAC1C,KAAK,KAAK,QAAQ,MAAM;EACxB,MAAM,SAA2B,QAAQ,mBAAmB;EAC5D,OAAO,IAAI,QAAQ,MAAM;EACzB,OAAO,QAAQ,IAAI,CAAC,CAAC,QAAQ,MAAM,CAAC,CAAC,QAAQ,QAAQ,WAAW;EAChE,OAAO,MACL,MAAM,MAAM,OACZ,MAAM,QACN,MAAM,WAAW,MAAM,YACzB;EACA,QAAQ,KAAK,MAAM;CACrB;CACA,IAAI,UAAmB;CACvB,aAAmB;EACjB,IAAI,SAAS;EACb,UAAU;EACV,KAAK,MAAM,UAAU,SAAS;GAC5B,IAAI;IACF,OAAO,KAAK;GACd,QAAQ,CAER;GACA,OAAO,WAAW;EACpB;CACF;AACF"}
|
|
@@ -4,18 +4,10 @@ import type { IViewerCameraStateSnapshot } from "./IViewerCameraStateSnapshot.js
|
|
|
4
4
|
* Transfer detached, auto-updating Perspective/Orthographic cameras through
|
|
5
5
|
* their public native lens/transform API, including film and view offsets.
|
|
6
6
|
* Parented, manual-matrix and custom-projection cameras are explicitly refused:
|
|
7
|
-
* another owner must transfer those relationships rather than guess them.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @evidence contracts/development/implementation.md#principled-implementation Captures native detached auto-updating lens/TRS/view state and admits unknown input on a temporary camera clone, requiring finite dimensions, nondegenerate transforms and exact native projection parity before copy; custom/manual/parented cameras refuse, while non-unit quaternions are not normalized and only resulting finite invertibility is tested.
|
|
11
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure Keeps capture and restore with the same native camera/lens owner, preserving view offsets/film settings instead of applying an unexplained raw matrix snapshot; a named transfer record describes existing fields without another projection solver.
|
|
12
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Uses actual native projection recomputation and exact parity rather than fixture lens defaults, patched matrix methods or tolerance-based acceptance of an unsupported custom projection.
|
|
13
|
-
* @evidence contracts/development/common.md#meaningful-documentation States detached/auto-updating supported classes, refused custom state and admission-before-mutation; the transfer record's field docs give vector/matrix conventions, layer mask and lens/view units.
|
|
14
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Each capture/restore reads fixed-size lens/vector/matrix state and one temporary camera clone, constant adapter work/storage; camera.clone is recursive by native default, so a camera with children may additionally clone its child subtree despite parentless admission.
|
|
15
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work Capture/restore share native lens semantics and one borrowed camera identity; mutable lens/pose/view input requires new snapshots/candidate validation, with no cached custom projection or alternate math.
|
|
16
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Returned closures retain the borrowed camera and each capture transfers copied scalar/array/view state; temporary clones acquire no GPU handle themselves but may retain cloned child references until unreachable. The original camera/children remain host-owned and no task starts.
|
|
7
|
+
* another owner must transfer those relationships rather than guess them. A
|
|
8
|
+
* degenerate state is refused before the original camera is mutated.
|
|
17
9
|
*/
|
|
18
10
|
export declare function createViewerCameraState(camera: THREE.Camera): {
|
|
19
11
|
capture: () => IViewerCameraStateSnapshot;
|
|
20
|
-
restore: (state:
|
|
12
|
+
restore: (state: IViewerCameraStateSnapshot) => void;
|
|
21
13
|
};
|
|
@@ -34,26 +34,19 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.createViewerCameraState = createViewerCameraState;
|
|
37
|
+
const render_1 = require("@automovie/render");
|
|
37
38
|
const THREE = __importStar(require("three"));
|
|
38
39
|
/**
|
|
39
40
|
* Transfer detached, auto-updating Perspective/Orthographic cameras through
|
|
40
41
|
* their public native lens/transform API, including film and view offsets.
|
|
41
42
|
* Parented, manual-matrix and custom-projection cameras are explicitly refused:
|
|
42
|
-
* another owner must transfer those relationships rather than guess them.
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* @evidence contracts/development/implementation.md#principled-implementation Captures native detached auto-updating lens/TRS/view state and admits unknown input on a temporary camera clone, requiring finite dimensions, nondegenerate transforms and exact native projection parity before copy; custom/manual/parented cameras refuse, while non-unit quaternions are not normalized and only resulting finite invertibility is tested.
|
|
46
|
-
* @evidence contracts/development/implementation.md#clear-and-simple-structure Keeps capture and restore with the same native camera/lens owner, preserving view offsets/film settings instead of applying an unexplained raw matrix snapshot; a named transfer record describes existing fields without another projection solver.
|
|
47
|
-
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Uses actual native projection recomputation and exact parity rather than fixture lens defaults, patched matrix methods or tolerance-based acceptance of an unsupported custom projection.
|
|
48
|
-
* @evidence contracts/development/common.md#meaningful-documentation States detached/auto-updating supported classes, refused custom state and admission-before-mutation; the transfer record's field docs give vector/matrix conventions, layer mask and lens/view units.
|
|
49
|
-
* @evidence contracts/development/implementation.md#efficient-algorithms Each capture/restore reads fixed-size lens/vector/matrix state and one temporary camera clone, constant adapter work/storage; camera.clone is recursive by native default, so a camera with children may additionally clone its child subtree despite parentless admission.
|
|
50
|
-
* @evidence contracts/development/implementation.md#reuse-equivalent-work Capture/restore share native lens semantics and one borrowed camera identity; mutable lens/pose/view input requires new snapshots/candidate validation, with no cached custom projection or alternate math.
|
|
51
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Returned closures retain the borrowed camera and each capture transfers copied scalar/array/view state; temporary clones acquire no GPU handle themselves but may retain cloned child references until unreachable. The original camera/children remain host-owned and no task starts.
|
|
43
|
+
* another owner must transfer those relationships rather than guess them. A
|
|
44
|
+
* degenerate state is refused before the original camera is mutated.
|
|
52
45
|
*/
|
|
53
46
|
function createViewerCameraState(camera) {
|
|
54
47
|
const supported = () => {
|
|
55
|
-
if (!(camera
|
|
56
|
-
camera
|
|
48
|
+
if (!(render_1.AutoMovieThreeKind.isPerspectiveCamera(camera) ||
|
|
49
|
+
render_1.AutoMovieThreeKind.isOrthographicCamera(camera)) ||
|
|
57
50
|
camera.parent !== null ||
|
|
58
51
|
!camera.matrixAutoUpdate ||
|
|
59
52
|
!camera.matrixWorldAutoUpdate)
|
|
@@ -75,7 +68,7 @@ function createViewerCameraState(camera) {
|
|
|
75
68
|
layers: owned.layers.mask,
|
|
76
69
|
projection: owned.projectionMatrix.toArray(),
|
|
77
70
|
view: owned.view === null ? null : { ...owned.view },
|
|
78
|
-
lens: owned
|
|
71
|
+
lens: render_1.AutoMovieThreeKind.isPerspectiveCamera(owned)
|
|
79
72
|
? {
|
|
80
73
|
kind: "perspective",
|
|
81
74
|
fov: owned.fov,
|
|
@@ -101,144 +94,110 @@ function createViewerCameraState(camera) {
|
|
|
101
94
|
};
|
|
102
95
|
const restore = (state) => {
|
|
103
96
|
const owned = supported();
|
|
104
|
-
if (state
|
|
105
|
-
typeof state !== "object" ||
|
|
106
|
-
Reflect.get(state, "type") !== owned.type)
|
|
97
|
+
if (state.type !== owned.type)
|
|
107
98
|
throw new Error("Camera transfer changed camera type.");
|
|
108
|
-
const read = (name, length) => {
|
|
109
|
-
const value = Reflect.get(state, name);
|
|
110
|
-
if (!Array.isArray(value) ||
|
|
111
|
-
value.length !== length ||
|
|
112
|
-
!value.every((part) => typeof part === "number" && Number.isFinite(part)))
|
|
113
|
-
throw new Error("Camera transfer has no finite " + name + ".");
|
|
114
|
-
return value;
|
|
115
|
-
};
|
|
116
|
-
const position = read("position", 3), quaternion = read("quaternion", 4);
|
|
117
|
-
const scale = read("scale", 3), up = read("up", 3), projection = read("projection", 16);
|
|
118
99
|
const determinant = new THREE.Matrix4()
|
|
119
|
-
.fromArray(projection)
|
|
100
|
+
.fromArray(state.projection)
|
|
120
101
|
.determinant();
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
102
|
+
// The rotation squares the quaternion, so one whose length overflows would
|
|
103
|
+
// turn the world transform into infinities less infinities.
|
|
104
|
+
const turn = Math.hypot(...state.quaternion);
|
|
105
|
+
// The world determinant is the scales' product; one that overflows or
|
|
106
|
+
// vanishes leaves no invertible transform.
|
|
107
|
+
const volume = state.scale[0] * state.scale[1] * state.scale[2];
|
|
108
|
+
if (!(turn > 0) ||
|
|
109
|
+
turn === Infinity ||
|
|
110
|
+
!(Math.hypot(...state.up) > 0) ||
|
|
111
|
+
volume === 0 ||
|
|
112
|
+
volume === Infinity ||
|
|
113
|
+
volume === -Infinity ||
|
|
124
114
|
determinant === 0 ||
|
|
125
|
-
|
|
115
|
+
determinant === Infinity ||
|
|
116
|
+
determinant === -Infinity)
|
|
126
117
|
throw new Error("Camera transfer has a degenerate pose/projection.");
|
|
127
|
-
|
|
128
|
-
if (typeof layers !== "number" ||
|
|
129
|
-
!Number.isInteger(layers) ||
|
|
130
|
-
layers < -2147483648 ||
|
|
131
|
-
layers > 4294967295)
|
|
118
|
+
if (state.layers < -2147483648 || state.layers > 4294967295)
|
|
132
119
|
throw new Error("Camera transfer has no valid layer mask.");
|
|
133
|
-
const lens = Reflect.get(state, "lens");
|
|
134
|
-
if (lens === null || typeof lens !== "object")
|
|
135
|
-
throw new Error("Camera transfer has no lens.");
|
|
136
|
-
const number = (name) => {
|
|
137
|
-
const value = Reflect.get(lens, name);
|
|
138
|
-
if (typeof value !== "number" || !Number.isFinite(value))
|
|
139
|
-
throw new Error("Camera transfer has no finite " + name + ".");
|
|
140
|
-
return value;
|
|
141
|
-
};
|
|
142
120
|
const candidate = owned.clone();
|
|
143
|
-
|
|
144
|
-
|
|
121
|
+
const lens = state.lens;
|
|
122
|
+
if (render_1.AutoMovieThreeKind.isPerspectiveCamera(candidate)) {
|
|
123
|
+
if (lens.kind !== "perspective")
|
|
145
124
|
throw new Error("Camera transfer changed projection type.");
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
"focus",
|
|
155
|
-
].map(number);
|
|
156
|
-
if (!(fov > 0 &&
|
|
157
|
-
fov < 180 &&
|
|
158
|
-
aspect > 0 &&
|
|
159
|
-
near > 0 &&
|
|
160
|
-
far > near &&
|
|
161
|
-
zoom > 0 &&
|
|
162
|
-
filmGauge > 0 &&
|
|
163
|
-
focus > 0))
|
|
125
|
+
if (!(lens.fov > 0 &&
|
|
126
|
+
lens.fov < 180 &&
|
|
127
|
+
lens.aspect > 0 &&
|
|
128
|
+
lens.near > 0 &&
|
|
129
|
+
lens.far > lens.near &&
|
|
130
|
+
lens.zoom > 0 &&
|
|
131
|
+
lens.filmGauge > 0 &&
|
|
132
|
+
lens.focus > 0))
|
|
164
133
|
throw new Error("Camera transfer lens is invalid.");
|
|
165
134
|
Object.assign(candidate, {
|
|
166
|
-
fov,
|
|
167
|
-
aspect,
|
|
168
|
-
near,
|
|
169
|
-
far,
|
|
170
|
-
zoom,
|
|
171
|
-
filmGauge,
|
|
172
|
-
filmOffset,
|
|
173
|
-
focus,
|
|
135
|
+
fov: lens.fov,
|
|
136
|
+
aspect: lens.aspect,
|
|
137
|
+
near: lens.near,
|
|
138
|
+
far: lens.far,
|
|
139
|
+
zoom: lens.zoom,
|
|
140
|
+
filmGauge: lens.filmGauge,
|
|
141
|
+
filmOffset: lens.filmOffset,
|
|
142
|
+
focus: lens.focus,
|
|
174
143
|
});
|
|
175
144
|
}
|
|
176
145
|
else {
|
|
177
|
-
if (
|
|
146
|
+
if (lens.kind !== "orthographic")
|
|
178
147
|
throw new Error("Camera transfer changed projection type.");
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
"near",
|
|
185
|
-
"far",
|
|
186
|
-
"zoom",
|
|
187
|
-
].map(number);
|
|
188
|
-
if (!(right > left && top > bottom && near >= 0 && far > near && zoom > 0))
|
|
148
|
+
if (!(lens.right > lens.left &&
|
|
149
|
+
lens.top > lens.bottom &&
|
|
150
|
+
lens.near >= 0 &&
|
|
151
|
+
lens.far > lens.near &&
|
|
152
|
+
lens.zoom > 0))
|
|
189
153
|
throw new Error("Camera transfer lens is invalid.");
|
|
190
|
-
Object.assign(candidate, {
|
|
154
|
+
Object.assign(candidate, {
|
|
155
|
+
left: lens.left,
|
|
156
|
+
right: lens.right,
|
|
157
|
+
top: lens.top,
|
|
158
|
+
bottom: lens.bottom,
|
|
159
|
+
near: lens.near,
|
|
160
|
+
far: lens.far,
|
|
161
|
+
zoom: lens.zoom,
|
|
162
|
+
});
|
|
191
163
|
}
|
|
192
|
-
const view =
|
|
164
|
+
const view = state.view;
|
|
193
165
|
if (view !== null) {
|
|
194
|
-
if (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
"fullWidth",
|
|
199
|
-
"fullHeight",
|
|
200
|
-
"offsetX",
|
|
201
|
-
"offsetY",
|
|
202
|
-
"width",
|
|
203
|
-
"height",
|
|
204
|
-
].map((key) => {
|
|
205
|
-
const value = Reflect.get(view, key);
|
|
206
|
-
if (typeof value !== "number" || !Number.isFinite(value))
|
|
207
|
-
throw new Error("Camera transfer has no finite view " + key + ".");
|
|
208
|
-
return value;
|
|
209
|
-
});
|
|
210
|
-
const [fullWidth, fullHeight, offsetX, offsetY, width, height] = values;
|
|
211
|
-
if (typeof enabled !== "boolean" ||
|
|
212
|
-
!(fullWidth > 0 && fullHeight > 0 && width > 0 && height > 0))
|
|
166
|
+
if (!(view.fullWidth > 0 &&
|
|
167
|
+
view.fullHeight > 0 &&
|
|
168
|
+
view.width > 0 &&
|
|
169
|
+
view.height > 0))
|
|
213
170
|
throw new Error("Camera transfer view dimensions are invalid.");
|
|
214
|
-
candidate.setViewOffset(fullWidth, fullHeight, offsetX, offsetY, width, height);
|
|
215
|
-
candidate.view.enabled = enabled;
|
|
171
|
+
candidate.setViewOffset(view.fullWidth, view.fullHeight, view.offsetX, view.offsetY, view.width, view.height);
|
|
172
|
+
candidate.view.enabled = view.enabled;
|
|
216
173
|
}
|
|
217
174
|
else
|
|
218
175
|
candidate.view = null;
|
|
219
176
|
// setViewOffset also writes Perspective.aspect. A later native resize may
|
|
220
177
|
// legitimately have changed that lens while preserving the crop window.
|
|
221
|
-
if (candidate
|
|
222
|
-
|
|
178
|
+
if (render_1.AutoMovieThreeKind.isPerspectiveCamera(candidate) &&
|
|
179
|
+
lens.kind === "perspective")
|
|
180
|
+
candidate.aspect = lens.aspect;
|
|
223
181
|
candidate.updateProjectionMatrix();
|
|
224
|
-
if (!candidate.projectionMatrix.elements.every((value, index) => value === projection[index]))
|
|
182
|
+
if (!candidate.projectionMatrix.elements.every((value, index) => value === state.projection[index]))
|
|
225
183
|
throw new Error("The projection does not match the transferred native lens.");
|
|
226
|
-
candidate.position.fromArray(position);
|
|
227
|
-
candidate.quaternion.fromArray(quaternion);
|
|
228
|
-
candidate.scale.fromArray(scale);
|
|
229
|
-
candidate.up.fromArray(up);
|
|
230
|
-
candidate.layers.mask = layers;
|
|
184
|
+
candidate.position.fromArray(state.position);
|
|
185
|
+
candidate.quaternion.fromArray(state.quaternion);
|
|
186
|
+
candidate.scale.fromArray(state.scale);
|
|
187
|
+
candidate.up.fromArray(state.up);
|
|
188
|
+
candidate.layers.mask = state.layers;
|
|
231
189
|
candidate.updateMatrixWorld(true);
|
|
232
190
|
const worldDeterminant = candidate.matrixWorld.determinant();
|
|
233
|
-
if (
|
|
191
|
+
if (candidate.matrixWorld.elements.some((value) => value === Infinity || value === -Infinity) ||
|
|
234
192
|
worldDeterminant === 0 ||
|
|
235
|
-
|
|
193
|
+
worldDeterminant === Infinity ||
|
|
194
|
+
worldDeterminant === -Infinity)
|
|
236
195
|
throw new Error("The transferred camera world transform is degenerate.");
|
|
237
|
-
if (owned
|
|
238
|
-
candidate
|
|
196
|
+
if (render_1.AutoMovieThreeKind.isPerspectiveCamera(owned) &&
|
|
197
|
+
render_1.AutoMovieThreeKind.isPerspectiveCamera(candidate))
|
|
239
198
|
owned.copy(candidate, false);
|
|
240
|
-
else if (owned
|
|
241
|
-
candidate
|
|
199
|
+
else if (render_1.AutoMovieThreeKind.isOrthographicCamera(owned) &&
|
|
200
|
+
render_1.AutoMovieThreeKind.isOrthographicCamera(candidate))
|
|
242
201
|
owned.copy(candidate, false);
|
|
243
202
|
else
|
|
244
203
|
throw new Error("The validated camera projection changed type.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createViewerCameraState.js","sourceRoot":"","sources":["../src/createViewerCameraState.ts"],"names":[],"mappings":";;;;;;;;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