vim-web 0.5.0-dev.0 → 0.5.0-dev.10
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/dist/types/{vim-web/core-viewers → core-viewers}/ultra/camera.d.ts +2 -2
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/colorManager.d.ts +4 -4
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/element3d.d.ts +4 -4
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/index.d.ts +1 -1
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/remoteColor.d.ts +3 -23
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/renderer.d.ts +14 -11
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/rpcClient.d.ts +22 -19
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/rpcSafeClient.d.ts +200 -85
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/rpcTypes.d.ts +6 -3
- package/dist/types/core-viewers/ultra/rpcUtils.d.ts +8 -0
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/sectionBox.d.ts +1 -1
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/viewer.d.ts +6 -0
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/vim.d.ts +10 -9
- package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/visibility.d.ts +2 -2
- package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/vim.d.ts +5 -0
- package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/viewer.d.ts +5 -0
- package/dist/types/{vim-web/utils → utils}/validation.d.ts +6 -6
- package/dist/vim-web.iife.js +591 -499
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +591 -499
- package/dist/vim-web.js.map +1 -1
- package/package.json +5 -6
- package/dist/types/main.d.ts +0 -1
- /package/dist/types/{vim-web/core-viewers → core-viewers}/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/shared/baseInputHandler.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/shared/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/shared/inputAdapter.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/shared/inputHandler.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/shared/keyboardHandler.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/shared/mouseHandler.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/shared/raycaster.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/shared/selection.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/shared/touchHandler.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/shared/vim.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/decoder.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/decoderWithWorker.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/inputAdapter.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/loadRequest.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/logger.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/protocol.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/raycaster.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/rpcMarshal.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/selection.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/socketClient.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/streamLogger.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/streamRenderer.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/viewport.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/ultra/vimCollection.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/averageBoundingBox.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/colorAttribute.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/element3d.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/elementMapping.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/geometry.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/materials/ghostMaterial.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/materials/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/materials/maskMaterial.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/materials/materials.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/materials/mergeMaterial.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/materials/outlineMaterial.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/materials/simpleMaterial.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/materials/skyboxMaterial.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/materials/standardMaterial.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/materials/transferMaterial.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/mesh.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/g3dOffsets.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/g3dSubset.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/insertableGeometry.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/insertableMesh.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/insertableSubmesh.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/instancedMesh.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/instancedMeshFactory.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/instancedSubmesh.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/legacyMeshFactory.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/loadingSynchronizer.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/open.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/subsetBuilder.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/subsetRequest.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/vimRequest.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/progressive/vimx.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/scene.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/vimSettings.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/loader/webglAttribute.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/utils/boxes.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/camera/camera.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/camera/cameraInterface.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/camera/cameraMovement.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/camera/cameraMovementLerp.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/camera/cameraMovementSnap.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/camera/cameraOrthographic.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/camera/cameraPerspective.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/camera/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/environment/environment.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/environment/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/environment/light.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/environment/skybox.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/axes/axes.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/axes/axesSettings.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/axes/gizmoAxes.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/axes/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/gizmoLoading.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/gizmoOrbit.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/gizmos.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/markers/gizmoMarker.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/markers/gizmoMarkers.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/markers/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/measure/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/measure/measure.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/measure/measureGizmo.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/measure/measureHtml.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/sectionBox/SectionBoxMesh.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/sectionBox/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/sectionBox/sectionBox.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/sectionBox/sectionBoxGizmo.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/sectionBox/sectionBoxHandle.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/sectionBox/sectionBoxHandles.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/sectionBox/sectionBoxInputs.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/gizmos/sectionBox/sectionBoxOutline.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/inputAdapter.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/raycaster.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/rendering/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/rendering/mergePass.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/rendering/outlinePass.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/rendering/renderScene.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/rendering/renderer.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/rendering/renderingComposer.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/rendering/renderingSection.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/rendering/transferPass.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/selection.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/settings/index.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/settings/viewerDefaultSettings.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/settings/viewerSettings.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/settings/viewerSettingsParsing.d.ts +0 -0
- /package/dist/types/{vim-web/core-viewers → core-viewers}/webgl/viewer/viewport.d.ts +0 -0
- /package/dist/types/{vim-web/index.d.ts → index.d.ts} +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimInfoBody.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimInfoData.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimInfoHeader.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimInfoObject.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimInfoPanel.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimInfoVim.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimPanel.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimSearch.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimTree.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimTreeData.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/bimUtils.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/bim/openState.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/container.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/controlbar/controlBar.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/controlbar/controlBarButton.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/controlbar/controlBarIds.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/controlbar/controlBarSection.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/controlbar/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/controlbar/style.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/errors/errorStyle.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/errors/errors.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/errors/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/generic/genericField.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/generic/genericPanel.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/generic/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/generic/inputNumber.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/cameraObserver.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/cursor.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/customizer.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/data.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/element.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/fullScreenObserver.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/layout.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/loadRequest.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/reactUtils.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/requestResult.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/helpers/utils.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/icons.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/axesPanel.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/contextMenu.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/help.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/isolationPanel.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/loadingBox.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/logo.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/messageBox.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/modal.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/overlay.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/performance.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/restOfScreen.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/sectionBoxPanel.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/sidePanel.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/panels/toast.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/settings/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/settings/settings.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/settings/settingsPanel.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/settings/settingsState.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/settings/settingsStorage.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/settings/userBoolean.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/state/cameraState.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/state/controlBarState.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/state/fullScreenState.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/state/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/state/measureState.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/state/pointerState.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/state/sectionBoxState.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/state/sharedIsolation.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/state/sideState.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/state/viewerInputs.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/camera.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/controlBar.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/errors/fileLoadingError.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/errors/fileOpeningError.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/errors/serverCompatibilityError.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/errors/serverConnectionError.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/errors/serverFileDownloadingError.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/errors/serverStreamError.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/errors/ultraErrors.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/isolation.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/modal.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/sectionBox.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/viewer.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/ultra/viewerRef.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/urls.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/webgl/camera.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/webgl/index.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/webgl/inputsBindings.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/webgl/isolation.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/webgl/loading.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/webgl/sectionBox.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/webgl/viewer.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/webgl/viewerRef.d.ts +0 -0
- /package/dist/types/{vim-web/react-viewers → react-viewers}/webgl/viewerState.d.ts +0 -0
- /package/dist/types/{vim-web/utils → utils}/array.d.ts +0 -0
- /package/dist/types/{vim-web/utils → utils}/debounce.d.ts +0 -0
- /package/dist/types/{vim-web/utils → utils}/index.d.ts +0 -0
- /package/dist/types/{vim-web/utils → utils}/interfaces.d.ts +0 -0
- /package/dist/types/{vim-web/utils → utils}/math3d.d.ts +0 -0
- /package/dist/types/{vim-web/utils → utils}/partial.d.ts +0 -0
- /package/dist/types/{vim-web/utils → utils}/promise.d.ts +0 -0
- /package/dist/types/{vim-web/utils → utils}/result.d.ts +0 -0
- /package/dist/types/{vim-web/utils → utils}/threeUtils.d.ts +0 -0
- /package/dist/types/{vim-web/utils → utils}/url.d.ts +0 -0
package/dist/vim-web.js
CHANGED
|
@@ -46769,6 +46769,11 @@ let Vim$1 = class Vim {
|
|
|
46769
46769
|
* @param {boolean} isLegacy - Indicates whether the Vim object uses a legacy loading pipeline.
|
|
46770
46770
|
*/
|
|
46771
46771
|
constructor(header, document2, g3d2, scene, settings2, map, builder, source, format) {
|
|
46772
|
+
/**
|
|
46773
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
46774
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
46775
|
+
*/
|
|
46776
|
+
__publicField(this, "type", "webgl");
|
|
46772
46777
|
/**
|
|
46773
46778
|
* Indicates whether the vim was opened from a vim or vimx file.
|
|
46774
46779
|
*/
|
|
@@ -50825,6 +50830,164 @@ function isFilePathOrUri(input) {
|
|
|
50825
50830
|
}
|
|
50826
50831
|
return true;
|
|
50827
50832
|
}
|
|
50833
|
+
class Segment {
|
|
50834
|
+
constructor(origin = new Vector3(), target = new Vector3()) {
|
|
50835
|
+
__publicField(this, "origin");
|
|
50836
|
+
__publicField(this, "target");
|
|
50837
|
+
this.origin = origin;
|
|
50838
|
+
this.target = target;
|
|
50839
|
+
}
|
|
50840
|
+
static fromArray(array) {
|
|
50841
|
+
return new Segment(
|
|
50842
|
+
new Vector3(array[0], array[1], array[2]),
|
|
50843
|
+
new Vector3(array[3], array[4], array[5])
|
|
50844
|
+
);
|
|
50845
|
+
}
|
|
50846
|
+
toArray() {
|
|
50847
|
+
return [this.origin.x, this.origin.y, this.origin.z, this.target.x, this.target.y, this.target.z];
|
|
50848
|
+
}
|
|
50849
|
+
isValid() {
|
|
50850
|
+
return !this.origin.equals(this.target);
|
|
50851
|
+
}
|
|
50852
|
+
equals(segment) {
|
|
50853
|
+
return this.origin.equals(segment.origin) && this.target.equals(segment.target);
|
|
50854
|
+
}
|
|
50855
|
+
}
|
|
50856
|
+
class RGBA {
|
|
50857
|
+
constructor(r, g, b, a = 1) {
|
|
50858
|
+
__publicField(this, "r");
|
|
50859
|
+
__publicField(this, "g");
|
|
50860
|
+
__publicField(this, "b");
|
|
50861
|
+
__publicField(this, "a");
|
|
50862
|
+
this.r = r;
|
|
50863
|
+
this.g = g;
|
|
50864
|
+
this.b = b;
|
|
50865
|
+
this.a = a;
|
|
50866
|
+
}
|
|
50867
|
+
static fromThree(color, opacity = 1) {
|
|
50868
|
+
return new RGBA(color.r, color.g, color.b, opacity);
|
|
50869
|
+
}
|
|
50870
|
+
toThree() {
|
|
50871
|
+
return new Color(this.r, this.g, this.b);
|
|
50872
|
+
}
|
|
50873
|
+
clone() {
|
|
50874
|
+
return new RGBA(this.r, this.g, this.b, this.a);
|
|
50875
|
+
}
|
|
50876
|
+
isValid() {
|
|
50877
|
+
return Number.isFinite(this.r) && Number.isFinite(this.g) && Number.isFinite(this.b) && Number.isFinite(this.a);
|
|
50878
|
+
}
|
|
50879
|
+
equals(color) {
|
|
50880
|
+
return this.r === color.r && this.g === color.g && this.b === color.b && this.a === color.a;
|
|
50881
|
+
}
|
|
50882
|
+
static fromString(str) {
|
|
50883
|
+
str = str.trim();
|
|
50884
|
+
if (str.startsWith("(")) {
|
|
50885
|
+
str = str.substring(1);
|
|
50886
|
+
}
|
|
50887
|
+
if (str.endsWith(")")) {
|
|
50888
|
+
str = str.substring(0, str.length - 1);
|
|
50889
|
+
}
|
|
50890
|
+
const parts = str.split(",");
|
|
50891
|
+
if (parts.length < 3 || parts.length > 4) {
|
|
50892
|
+
throw new Error("Invalid color string format. Expected 3 or 4 components.");
|
|
50893
|
+
}
|
|
50894
|
+
const r = parseFloat(parts[0]);
|
|
50895
|
+
const g = parseFloat(parts[1]);
|
|
50896
|
+
const b = parseFloat(parts[2]);
|
|
50897
|
+
const a = parts.length === 4 ? parseFloat(parts[3]) : 1;
|
|
50898
|
+
if ([r, g, b, a].some((n) => isNaN(n))) {
|
|
50899
|
+
throw new Error("Invalid number in color string.");
|
|
50900
|
+
}
|
|
50901
|
+
return new RGBA(r, g, b, a);
|
|
50902
|
+
}
|
|
50903
|
+
}
|
|
50904
|
+
class RGB {
|
|
50905
|
+
constructor(r, g, b) {
|
|
50906
|
+
__publicField(this, "r");
|
|
50907
|
+
__publicField(this, "g");
|
|
50908
|
+
__publicField(this, "b");
|
|
50909
|
+
this.r = r;
|
|
50910
|
+
this.g = g;
|
|
50911
|
+
this.b = b;
|
|
50912
|
+
}
|
|
50913
|
+
}
|
|
50914
|
+
class RGBA32 {
|
|
50915
|
+
constructor(hex) {
|
|
50916
|
+
__publicField(this, "hex");
|
|
50917
|
+
if (!Number.isInteger(hex) || hex < 0 || hex > 4294967295) {
|
|
50918
|
+
throw new Error("Invalid value: must be a 32-bit unsigned integer");
|
|
50919
|
+
}
|
|
50920
|
+
this.hex = hex;
|
|
50921
|
+
}
|
|
50922
|
+
static fromThree(color, opacity = 1) {
|
|
50923
|
+
return this.fromFloats(color.r, color.g, color.b, opacity);
|
|
50924
|
+
}
|
|
50925
|
+
static fromInts(r, g, b, a = 1) {
|
|
50926
|
+
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 || a < 0 || a > 255) {
|
|
50927
|
+
throw new Error("Each RGBA component must be in the range 0-255.");
|
|
50928
|
+
}
|
|
50929
|
+
const hex = r * 2 ** 24 + g * 2 ** 16 + b * 2 ** 8 + a;
|
|
50930
|
+
return new RGBA32(hex);
|
|
50931
|
+
}
|
|
50932
|
+
static fromFloats(r, g, b, a = 1) {
|
|
50933
|
+
return this.fromInts(
|
|
50934
|
+
remap(r, 255),
|
|
50935
|
+
remap(g, 255),
|
|
50936
|
+
remap(b, 255),
|
|
50937
|
+
remap(a, 255)
|
|
50938
|
+
);
|
|
50939
|
+
}
|
|
50940
|
+
static fromString(str) {
|
|
50941
|
+
if (str.startsWith("#")) {
|
|
50942
|
+
str = str.slice(1);
|
|
50943
|
+
}
|
|
50944
|
+
if (str.length === 3 || str.length === 4) {
|
|
50945
|
+
str = str.split("").map((c) => c + c).join("");
|
|
50946
|
+
}
|
|
50947
|
+
let r = 0;
|
|
50948
|
+
let g = 0;
|
|
50949
|
+
let b = 0;
|
|
50950
|
+
let a = 255;
|
|
50951
|
+
if (str.length === 6 || str.length === 8) {
|
|
50952
|
+
r = parseInt(str.slice(0, 2), 16);
|
|
50953
|
+
g = parseInt(str.slice(2, 4), 16);
|
|
50954
|
+
b = parseInt(str.slice(4, 6), 16);
|
|
50955
|
+
if (str.length === 8) {
|
|
50956
|
+
a = parseInt(str.slice(6, 8), 16);
|
|
50957
|
+
}
|
|
50958
|
+
} else {
|
|
50959
|
+
throw new Error("Invalid color string format");
|
|
50960
|
+
}
|
|
50961
|
+
if ([r, g, b, a].some((v) => isNaN(v))) {
|
|
50962
|
+
throw new Error("Invalid color string format");
|
|
50963
|
+
}
|
|
50964
|
+
return this.fromInts(r, g, b, a);
|
|
50965
|
+
}
|
|
50966
|
+
/**
|
|
50967
|
+
* The red component of the color in the range [0-255].
|
|
50968
|
+
*/
|
|
50969
|
+
get r() {
|
|
50970
|
+
return this.hex >>> 24;
|
|
50971
|
+
}
|
|
50972
|
+
/**
|
|
50973
|
+
* The green component of the color in the range [0-255].
|
|
50974
|
+
*/
|
|
50975
|
+
get g() {
|
|
50976
|
+
return this.hex >>> 16 & 255;
|
|
50977
|
+
}
|
|
50978
|
+
/**
|
|
50979
|
+
* The blue component of the color in the range [0-255].
|
|
50980
|
+
*/
|
|
50981
|
+
get b() {
|
|
50982
|
+
return this.hex >>> 8 & 255;
|
|
50983
|
+
}
|
|
50984
|
+
/**
|
|
50985
|
+
* The alpha component of the color in the range [0-255].
|
|
50986
|
+
*/
|
|
50987
|
+
get a() {
|
|
50988
|
+
return this.hex & 255;
|
|
50989
|
+
}
|
|
50990
|
+
}
|
|
50828
50991
|
class Validation {
|
|
50829
50992
|
//= ===========================================================================
|
|
50830
50993
|
// BASIC NUMBER VALIDATIONS
|
|
@@ -50876,16 +51039,16 @@ class Validation {
|
|
|
50876
51039
|
//= ===========================================================================
|
|
50877
51040
|
// HANDLE VALIDATIONS
|
|
50878
51041
|
//= ===========================================================================
|
|
50879
|
-
static
|
|
50880
|
-
if (!this.isPositiveInteger(
|
|
50881
|
-
if (
|
|
50882
|
-
console.warn(`Invalid
|
|
51042
|
+
static isIndex(index2) {
|
|
51043
|
+
if (!this.isPositiveInteger(index2)) return false;
|
|
51044
|
+
if (index2 === INVALID_HANDLE) {
|
|
51045
|
+
console.warn(`Invalid index ${index2}. Aborting operation.`);
|
|
50883
51046
|
return false;
|
|
50884
51047
|
}
|
|
50885
51048
|
return true;
|
|
50886
51049
|
}
|
|
50887
|
-
static
|
|
50888
|
-
return
|
|
51050
|
+
static areIndices(indices) {
|
|
51051
|
+
return indices.every((h) => this.isIndex(h));
|
|
50889
51052
|
}
|
|
50890
51053
|
static isMaterialHandle(handle) {
|
|
50891
51054
|
if (!materialHandles.includes(handle)) {
|
|
@@ -50934,23 +51097,6 @@ class Validation {
|
|
|
50934
51097
|
return true;
|
|
50935
51098
|
}
|
|
50936
51099
|
//= ===========================================================================
|
|
50937
|
-
// COLOR VALIDATIONS
|
|
50938
|
-
//= ===========================================================================
|
|
50939
|
-
static isRelativeRGBA(color) {
|
|
50940
|
-
if (color.r < 0 || color.r > 1 || color.g < 0 || color.g > 1 || color.b < 0 || color.b > 1) {
|
|
50941
|
-
console.warn("Invalid value: must be a relative color (0-1, 0-1, 0-1)");
|
|
50942
|
-
return false;
|
|
50943
|
-
}
|
|
50944
|
-
return true;
|
|
50945
|
-
}
|
|
50946
|
-
static isRelativeRGB(color) {
|
|
50947
|
-
if (color.r < 0 || color.r > 1 || color.g < 0 || color.g > 1 || color.b < 0 || color.b > 1) {
|
|
50948
|
-
console.warn("Invalid value: must be a relative color (0-1, 0-1, 0-1)");
|
|
50949
|
-
return false;
|
|
50950
|
-
}
|
|
50951
|
-
return true;
|
|
50952
|
-
}
|
|
50953
|
-
//= ===========================================================================
|
|
50954
51100
|
// STRING AND URL VALIDATIONS
|
|
50955
51101
|
//= ===========================================================================
|
|
50956
51102
|
static isNonEmptyString(value) {
|
|
@@ -51037,6 +51183,13 @@ class Validation {
|
|
|
51037
51183
|
}
|
|
51038
51184
|
return value;
|
|
51039
51185
|
}
|
|
51186
|
+
static clampColor01(value) {
|
|
51187
|
+
return new Color(
|
|
51188
|
+
this.clamp01(value.r),
|
|
51189
|
+
this.clamp01(value.g),
|
|
51190
|
+
this.clamp01(value.b)
|
|
51191
|
+
);
|
|
51192
|
+
}
|
|
51040
51193
|
static clampRGBA01(value) {
|
|
51041
51194
|
return new RGBA(
|
|
51042
51195
|
this.clamp01(value.r),
|
|
@@ -56993,6 +57146,11 @@ let Renderer$1 = class Renderer {
|
|
|
56993
57146
|
};
|
|
56994
57147
|
let Viewer$3 = class Viewer {
|
|
56995
57148
|
constructor(settings2) {
|
|
57149
|
+
/**
|
|
57150
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
57151
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
57152
|
+
*/
|
|
57153
|
+
__publicField(this, "type", "webgl");
|
|
56996
57154
|
/**
|
|
56997
57155
|
* The settings configuration used by the viewer.
|
|
56998
57156
|
*/
|
|
@@ -57317,155 +57475,6 @@ const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
57317
57475
|
getDefaultVimSettings,
|
|
57318
57476
|
request: requestVim
|
|
57319
57477
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
57320
|
-
class Segment {
|
|
57321
|
-
constructor(origin = new Vector3(), target = new Vector3()) {
|
|
57322
|
-
__publicField(this, "origin");
|
|
57323
|
-
__publicField(this, "target");
|
|
57324
|
-
this.origin = origin;
|
|
57325
|
-
this.target = target;
|
|
57326
|
-
}
|
|
57327
|
-
static fromArray(array) {
|
|
57328
|
-
return new Segment(
|
|
57329
|
-
new Vector3(array[0], array[1], array[2]),
|
|
57330
|
-
new Vector3(array[3], array[4], array[5])
|
|
57331
|
-
);
|
|
57332
|
-
}
|
|
57333
|
-
toArray() {
|
|
57334
|
-
return [this.origin.x, this.origin.y, this.origin.z, this.target.x, this.target.y, this.target.z];
|
|
57335
|
-
}
|
|
57336
|
-
isValid() {
|
|
57337
|
-
return !this.origin.equals(this.target);
|
|
57338
|
-
}
|
|
57339
|
-
equals(segment) {
|
|
57340
|
-
return this.origin.equals(segment.origin) && this.target.equals(segment.target);
|
|
57341
|
-
}
|
|
57342
|
-
}
|
|
57343
|
-
class RGBA {
|
|
57344
|
-
constructor(r, g, b, a = 1) {
|
|
57345
|
-
__publicField(this, "r");
|
|
57346
|
-
__publicField(this, "g");
|
|
57347
|
-
__publicField(this, "b");
|
|
57348
|
-
__publicField(this, "a");
|
|
57349
|
-
this.r = r;
|
|
57350
|
-
this.g = g;
|
|
57351
|
-
this.b = b;
|
|
57352
|
-
this.a = a;
|
|
57353
|
-
}
|
|
57354
|
-
clone() {
|
|
57355
|
-
return new RGBA(this.r, this.g, this.b, this.a);
|
|
57356
|
-
}
|
|
57357
|
-
isValid() {
|
|
57358
|
-
return Number.isFinite(this.r) && Number.isFinite(this.g) && Number.isFinite(this.b) && Number.isFinite(this.a);
|
|
57359
|
-
}
|
|
57360
|
-
equals(color) {
|
|
57361
|
-
return this.r === color.r && this.g === color.g && this.b === color.b && this.a === color.a;
|
|
57362
|
-
}
|
|
57363
|
-
static fromString(str) {
|
|
57364
|
-
str = str.trim();
|
|
57365
|
-
if (str.startsWith("(")) {
|
|
57366
|
-
str = str.substring(1);
|
|
57367
|
-
}
|
|
57368
|
-
if (str.endsWith(")")) {
|
|
57369
|
-
str = str.substring(0, str.length - 1);
|
|
57370
|
-
}
|
|
57371
|
-
const parts = str.split(",");
|
|
57372
|
-
if (parts.length < 3 || parts.length > 4) {
|
|
57373
|
-
throw new Error("Invalid color string format. Expected 3 or 4 components.");
|
|
57374
|
-
}
|
|
57375
|
-
const r = parseFloat(parts[0]);
|
|
57376
|
-
const g = parseFloat(parts[1]);
|
|
57377
|
-
const b = parseFloat(parts[2]);
|
|
57378
|
-
const a = parts.length === 4 ? parseFloat(parts[3]) : 1;
|
|
57379
|
-
if ([r, g, b, a].some((n) => isNaN(n))) {
|
|
57380
|
-
throw new Error("Invalid number in color string.");
|
|
57381
|
-
}
|
|
57382
|
-
return new RGBA(r, g, b, a);
|
|
57383
|
-
}
|
|
57384
|
-
}
|
|
57385
|
-
class RGB {
|
|
57386
|
-
constructor(r, g, b) {
|
|
57387
|
-
__publicField(this, "r");
|
|
57388
|
-
__publicField(this, "g");
|
|
57389
|
-
__publicField(this, "b");
|
|
57390
|
-
this.r = r;
|
|
57391
|
-
this.g = g;
|
|
57392
|
-
this.b = b;
|
|
57393
|
-
}
|
|
57394
|
-
}
|
|
57395
|
-
class RGBA32 {
|
|
57396
|
-
constructor(hex) {
|
|
57397
|
-
__publicField(this, "hex");
|
|
57398
|
-
if (!Number.isInteger(hex) || hex < 0 || hex > 4294967295) {
|
|
57399
|
-
throw new Error("Invalid value: must be a 32-bit unsigned integer");
|
|
57400
|
-
}
|
|
57401
|
-
this.hex = hex;
|
|
57402
|
-
}
|
|
57403
|
-
static fromInts(r, g, b, a = 1) {
|
|
57404
|
-
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 || a < 0 || a > 255) {
|
|
57405
|
-
throw new Error("Each RGBA component must be in the range 0-255.");
|
|
57406
|
-
}
|
|
57407
|
-
const hex = r * 2 ** 24 + g * 2 ** 16 + b * 2 ** 8 + a;
|
|
57408
|
-
return new RGBA32(hex);
|
|
57409
|
-
}
|
|
57410
|
-
static fromFloats(r, g, b, a = 1) {
|
|
57411
|
-
return this.fromInts(
|
|
57412
|
-
remap(r, 255),
|
|
57413
|
-
remap(g, 255),
|
|
57414
|
-
remap(b, 255),
|
|
57415
|
-
remap(a, 255)
|
|
57416
|
-
);
|
|
57417
|
-
}
|
|
57418
|
-
static fromString(str) {
|
|
57419
|
-
if (str.startsWith("#")) {
|
|
57420
|
-
str = str.slice(1);
|
|
57421
|
-
}
|
|
57422
|
-
if (str.length === 3 || str.length === 4) {
|
|
57423
|
-
str = str.split("").map((c) => c + c).join("");
|
|
57424
|
-
}
|
|
57425
|
-
let r = 0;
|
|
57426
|
-
let g = 0;
|
|
57427
|
-
let b = 0;
|
|
57428
|
-
let a = 255;
|
|
57429
|
-
if (str.length === 6 || str.length === 8) {
|
|
57430
|
-
r = parseInt(str.slice(0, 2), 16);
|
|
57431
|
-
g = parseInt(str.slice(2, 4), 16);
|
|
57432
|
-
b = parseInt(str.slice(4, 6), 16);
|
|
57433
|
-
if (str.length === 8) {
|
|
57434
|
-
a = parseInt(str.slice(6, 8), 16);
|
|
57435
|
-
}
|
|
57436
|
-
} else {
|
|
57437
|
-
throw new Error("Invalid color string format");
|
|
57438
|
-
}
|
|
57439
|
-
if ([r, g, b, a].some((v) => isNaN(v))) {
|
|
57440
|
-
throw new Error("Invalid color string format");
|
|
57441
|
-
}
|
|
57442
|
-
return this.fromInts(r, g, b, a);
|
|
57443
|
-
}
|
|
57444
|
-
/**
|
|
57445
|
-
* The red component of the color in the range [0-255].
|
|
57446
|
-
*/
|
|
57447
|
-
get r() {
|
|
57448
|
-
return this.hex >>> 24;
|
|
57449
|
-
}
|
|
57450
|
-
/**
|
|
57451
|
-
* The green component of the color in the range [0-255].
|
|
57452
|
-
*/
|
|
57453
|
-
get g() {
|
|
57454
|
-
return this.hex >>> 16 & 255;
|
|
57455
|
-
}
|
|
57456
|
-
/**
|
|
57457
|
-
* The blue component of the color in the range [0-255].
|
|
57458
|
-
*/
|
|
57459
|
-
get b() {
|
|
57460
|
-
return this.hex >>> 8 & 255;
|
|
57461
|
-
}
|
|
57462
|
-
/**
|
|
57463
|
-
* The alpha component of the color in the range [0-255].
|
|
57464
|
-
*/
|
|
57465
|
-
get a() {
|
|
57466
|
-
return this.hex & 255;
|
|
57467
|
-
}
|
|
57468
|
-
}
|
|
57469
57478
|
class Camera3 {
|
|
57470
57479
|
/**
|
|
57471
57480
|
* Creates a new Camera instance
|
|
@@ -57529,7 +57538,7 @@ class Camera3 {
|
|
|
57529
57538
|
* @returns Promise that resolves when the framing animation is complete
|
|
57530
57539
|
*/
|
|
57531
57540
|
async frameAll(blendTime = this._defaultBlendTime) {
|
|
57532
|
-
const segment = await this._rpc.
|
|
57541
|
+
const segment = await this._rpc.RPCFrameScene(blendTime);
|
|
57533
57542
|
this._savedPosition = this._savedPosition ?? segment;
|
|
57534
57543
|
return segment;
|
|
57535
57544
|
}
|
|
@@ -57546,16 +57555,16 @@ class Camera3 {
|
|
|
57546
57555
|
/**
|
|
57547
57556
|
* Frames specific nodes of a Vim model in the camera view
|
|
57548
57557
|
* @param vim - The Vim model containing the nodes to frame
|
|
57549
|
-
* @param
|
|
57558
|
+
* @param elements - Array of element indices to frame, or 'all' to frame the entire model
|
|
57550
57559
|
* @param blendTime - Duration of the camera animation in seconds (defaults to 0.5)
|
|
57551
57560
|
* @returns Promise that resolves when the framing animation is complete
|
|
57552
57561
|
*/
|
|
57553
|
-
async frameVim(vim,
|
|
57562
|
+
async frameVim(vim, elements, blendTime = this._defaultBlendTime) {
|
|
57554
57563
|
let segment;
|
|
57555
|
-
if (
|
|
57564
|
+
if (elements === "all") {
|
|
57556
57565
|
segment = await this._rpc.RPCFrameVim(vim.handle, blendTime);
|
|
57557
57566
|
} else {
|
|
57558
|
-
segment = await this._rpc.RPCFrameElements(vim.handle,
|
|
57567
|
+
segment = await this._rpc.RPCFrameElements(vim.handle, elements, blendTime);
|
|
57559
57568
|
}
|
|
57560
57569
|
this._savedPosition = this._savedPosition ?? segment;
|
|
57561
57570
|
return segment;
|
|
@@ -57638,9 +57647,9 @@ class Marshal {
|
|
|
57638
57647
|
// -------------------- HitCheckResult -------------------
|
|
57639
57648
|
writeHitCheckResult(data2) {
|
|
57640
57649
|
this.ensureCapacity(4 + 4 + 4 + 4 * 3 + 4 * 3);
|
|
57641
|
-
this.writeUInt(data2.
|
|
57642
|
-
this.writeUInt(data2.
|
|
57643
|
-
this.writeUInt(data2.
|
|
57650
|
+
this.writeUInt(data2.vimIndex);
|
|
57651
|
+
this.writeUInt(data2.vimElementIndex);
|
|
57652
|
+
this.writeUInt(data2.sceneElementIndex);
|
|
57644
57653
|
this.writeVector3(data2.worldPosition);
|
|
57645
57654
|
this.writeVector3(data2.worldNormal);
|
|
57646
57655
|
}
|
|
@@ -57788,15 +57797,15 @@ class ReadMarshal {
|
|
|
57788
57797
|
return textDecoder.decode(stringData);
|
|
57789
57798
|
}
|
|
57790
57799
|
readHitCheckResult() {
|
|
57791
|
-
const
|
|
57792
|
-
const
|
|
57793
|
-
const
|
|
57800
|
+
const vimIndex = this.readUInt();
|
|
57801
|
+
const vimElementIndex = this.readUInt();
|
|
57802
|
+
const sceneElementIndex = this.readUInt();
|
|
57794
57803
|
const worldPosition = this.readVector3();
|
|
57795
57804
|
const worldNormal = this.readVector3();
|
|
57796
57805
|
return {
|
|
57797
|
-
|
|
57798
|
-
|
|
57799
|
-
|
|
57806
|
+
vimIndex,
|
|
57807
|
+
vimElementIndex,
|
|
57808
|
+
sceneElementIndex,
|
|
57800
57809
|
worldPosition,
|
|
57801
57810
|
worldNormal
|
|
57802
57811
|
};
|
|
@@ -57928,10 +57937,22 @@ class RpcClient {
|
|
|
57928
57937
|
get url() {
|
|
57929
57938
|
return this._socket.url;
|
|
57930
57939
|
}
|
|
57931
|
-
|
|
57940
|
+
RPCClearMaterialOverridesForElements(vimIndex, elementIndices) {
|
|
57932
57941
|
const marshal = new Marshal();
|
|
57933
|
-
marshal.writeString("
|
|
57934
|
-
marshal.writeUInt(
|
|
57942
|
+
marshal.writeString("RPCClearMaterialOverridesForElements");
|
|
57943
|
+
marshal.writeUInt(vimIndex);
|
|
57944
|
+
marshal.writeArrayOfUInt(elementIndices);
|
|
57945
|
+
this._socket.sendRPC(marshal);
|
|
57946
|
+
}
|
|
57947
|
+
RPCClearMaterialOverridesForScene() {
|
|
57948
|
+
const marshal = new Marshal();
|
|
57949
|
+
marshal.writeString("RPCClearMaterialOverridesForScene");
|
|
57950
|
+
this._socket.sendRPC(marshal);
|
|
57951
|
+
}
|
|
57952
|
+
RPCClearMaterialOverridesForVim(vimIndex) {
|
|
57953
|
+
const marshal = new Marshal();
|
|
57954
|
+
marshal.writeString("RPCClearMaterialOverridesForVim");
|
|
57955
|
+
marshal.writeUInt(vimIndex);
|
|
57935
57956
|
this._socket.sendRPC(marshal);
|
|
57936
57957
|
}
|
|
57937
57958
|
async RPCCreateMaterialInstances(materialHandle, smoothness, colors) {
|
|
@@ -57954,10 +57975,10 @@ class RpcClient {
|
|
|
57954
57975
|
const ret = returnMarshal.readUInt();
|
|
57955
57976
|
return ret;
|
|
57956
57977
|
}
|
|
57957
|
-
RPCDestroyMaterialInstances(
|
|
57978
|
+
RPCDestroyMaterialInstances(materialInstanceHandles) {
|
|
57958
57979
|
const marshal = new Marshal();
|
|
57959
57980
|
marshal.writeString("RPCDestroyMaterialInstances");
|
|
57960
|
-
marshal.writeArrayOfUInt(
|
|
57981
|
+
marshal.writeArrayOfUInt(materialInstanceHandles);
|
|
57961
57982
|
this._socket.sendRPC(marshal);
|
|
57962
57983
|
}
|
|
57963
57984
|
RPCDestroyText(componentHandle) {
|
|
@@ -57981,53 +58002,53 @@ class RpcClient {
|
|
|
57981
58002
|
const ret = returnMarshal.readSegment();
|
|
57982
58003
|
return ret;
|
|
57983
58004
|
}
|
|
57984
|
-
async
|
|
58005
|
+
async RPCFrameElements(vimIndex, elementIndices, blendTime) {
|
|
57985
58006
|
const marshal = new Marshal();
|
|
57986
|
-
marshal.writeString("
|
|
58007
|
+
marshal.writeString("RPCFrameElements");
|
|
58008
|
+
marshal.writeUInt(vimIndex);
|
|
58009
|
+
marshal.writeArrayOfUInt(elementIndices);
|
|
57987
58010
|
marshal.writeFloat(blendTime);
|
|
57988
58011
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
57989
58012
|
const ret = returnMarshal.readSegment();
|
|
57990
58013
|
return ret;
|
|
57991
58014
|
}
|
|
57992
|
-
async
|
|
58015
|
+
async RPCFrameScene(blendTime) {
|
|
57993
58016
|
const marshal = new Marshal();
|
|
57994
|
-
marshal.writeString("
|
|
57995
|
-
marshal.writeUInt(componentHandle);
|
|
57996
|
-
marshal.writeArrayOfUInt(elementIndices);
|
|
58017
|
+
marshal.writeString("RPCFrameScene");
|
|
57997
58018
|
marshal.writeFloat(blendTime);
|
|
57998
58019
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
57999
58020
|
const ret = returnMarshal.readSegment();
|
|
58000
58021
|
return ret;
|
|
58001
58022
|
}
|
|
58002
|
-
async RPCFrameVim(
|
|
58023
|
+
async RPCFrameVim(vimIndex, blendTime) {
|
|
58003
58024
|
const marshal = new Marshal();
|
|
58004
58025
|
marshal.writeString("RPCFrameVim");
|
|
58005
|
-
marshal.writeUInt(
|
|
58026
|
+
marshal.writeUInt(vimIndex);
|
|
58006
58027
|
marshal.writeFloat(blendTime);
|
|
58007
58028
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58008
58029
|
const ret = returnMarshal.readSegment();
|
|
58009
58030
|
return ret;
|
|
58010
58031
|
}
|
|
58011
|
-
async
|
|
58032
|
+
async RPCGetAABBForElements(vimIndex, elementIndices) {
|
|
58012
58033
|
const marshal = new Marshal();
|
|
58013
|
-
marshal.writeString("
|
|
58034
|
+
marshal.writeString("RPCGetAABBForElements");
|
|
58035
|
+
marshal.writeUInt(vimIndex);
|
|
58036
|
+
marshal.writeArrayOfUInt(elementIndices);
|
|
58014
58037
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58015
58038
|
const ret = returnMarshal.readBox3();
|
|
58016
58039
|
return ret;
|
|
58017
58040
|
}
|
|
58018
|
-
async
|
|
58041
|
+
async RPCGetAABBForScene() {
|
|
58019
58042
|
const marshal = new Marshal();
|
|
58020
|
-
marshal.writeString("
|
|
58021
|
-
marshal.writeUInt(componentHandle);
|
|
58022
|
-
marshal.writeArrayOfUInt(elementIndices);
|
|
58043
|
+
marshal.writeString("RPCGetAABBForScene");
|
|
58023
58044
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58024
58045
|
const ret = returnMarshal.readBox3();
|
|
58025
58046
|
return ret;
|
|
58026
58047
|
}
|
|
58027
|
-
async RPCGetAABBForVim(
|
|
58048
|
+
async RPCGetAABBForVim(vimIndex) {
|
|
58028
58049
|
const marshal = new Marshal();
|
|
58029
58050
|
marshal.writeString("RPCGetAABBForVim");
|
|
58030
|
-
marshal.writeUInt(
|
|
58051
|
+
marshal.writeUInt(vimIndex);
|
|
58031
58052
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58032
58053
|
const ret = returnMarshal.readBox3();
|
|
58033
58054
|
return ret;
|
|
@@ -58039,25 +58060,32 @@ class RpcClient {
|
|
|
58039
58060
|
const ret = returnMarshal.readString();
|
|
58040
58061
|
return ret;
|
|
58041
58062
|
}
|
|
58042
|
-
async
|
|
58063
|
+
async RPCGetCameraPose() {
|
|
58043
58064
|
const marshal = new Marshal();
|
|
58044
|
-
marshal.writeString("
|
|
58065
|
+
marshal.writeString("RPCGetCameraPose");
|
|
58045
58066
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58046
58067
|
const ret = returnMarshal.readSegment();
|
|
58047
58068
|
return ret;
|
|
58048
58069
|
}
|
|
58049
|
-
async
|
|
58070
|
+
async RPCGetElementCountForScene() {
|
|
58050
58071
|
const marshal = new Marshal();
|
|
58051
|
-
marshal.writeString("
|
|
58052
|
-
marshal.writeUInt(componentHandle);
|
|
58072
|
+
marshal.writeString("RPCGetElementCountForScene");
|
|
58053
58073
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58054
58074
|
const ret = returnMarshal.readUInt();
|
|
58055
58075
|
return ret;
|
|
58056
58076
|
}
|
|
58057
|
-
async
|
|
58077
|
+
async RPCGetElementCountForVim(vimIndex) {
|
|
58078
|
+
const marshal = new Marshal();
|
|
58079
|
+
marshal.writeString("RPCGetElementCountForVim");
|
|
58080
|
+
marshal.writeUInt(vimIndex);
|
|
58081
|
+
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58082
|
+
const ret = returnMarshal.readUInt();
|
|
58083
|
+
return ret;
|
|
58084
|
+
}
|
|
58085
|
+
async RPCGetElementIds(vimIndex) {
|
|
58058
58086
|
const marshal = new Marshal();
|
|
58059
58087
|
marshal.writeString("RPCGetElementIds");
|
|
58060
|
-
marshal.writeUInt(
|
|
58088
|
+
marshal.writeUInt(vimIndex);
|
|
58061
58089
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58062
58090
|
const ret = returnMarshal.readArrayOfUInt64();
|
|
58063
58091
|
return ret;
|
|
@@ -58069,10 +58097,10 @@ class RpcClient {
|
|
|
58069
58097
|
const ret = returnMarshal.readString();
|
|
58070
58098
|
return ret;
|
|
58071
58099
|
}
|
|
58072
|
-
async RPCGetRoomElements(
|
|
58100
|
+
async RPCGetRoomElements(vimIndex) {
|
|
58073
58101
|
const marshal = new Marshal();
|
|
58074
58102
|
marshal.writeString("RPCGetRoomElements");
|
|
58075
|
-
marshal.writeUInt(
|
|
58103
|
+
marshal.writeUInt(vimIndex);
|
|
58076
58104
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58077
58105
|
const ret = returnMarshal.readArrayOfUInt();
|
|
58078
58106
|
return ret;
|
|
@@ -58084,10 +58112,10 @@ class RpcClient {
|
|
|
58084
58112
|
const ret = returnMarshal.readSectionBoxState();
|
|
58085
58113
|
return ret;
|
|
58086
58114
|
}
|
|
58087
|
-
async RPCGetVimLoadingState(
|
|
58115
|
+
async RPCGetVimLoadingState(vimIndex) {
|
|
58088
58116
|
const marshal = new Marshal();
|
|
58089
58117
|
marshal.writeString("RPCGetVimLoadingState");
|
|
58090
|
-
marshal.writeUInt(
|
|
58118
|
+
marshal.writeUInt(vimIndex);
|
|
58091
58119
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58092
58120
|
const ret = returnMarshal.readVimStatus();
|
|
58093
58121
|
return ret;
|
|
@@ -58177,6 +58205,13 @@ class RpcClient {
|
|
|
58177
58205
|
marshal.writeBoolean(orbit2);
|
|
58178
58206
|
this._socket.sendRPC(marshal);
|
|
58179
58207
|
}
|
|
58208
|
+
RPCSetCameraPose(state, blendTime) {
|
|
58209
|
+
const marshal = new Marshal();
|
|
58210
|
+
marshal.writeString("RPCSetCameraPose");
|
|
58211
|
+
marshal.writeSegment(state);
|
|
58212
|
+
marshal.writeFloat(blendTime);
|
|
58213
|
+
this._socket.sendRPC(marshal);
|
|
58214
|
+
}
|
|
58180
58215
|
RPCSetCameraPosition(position, blendTime) {
|
|
58181
58216
|
const marshal = new Marshal();
|
|
58182
58217
|
marshal.writeString("RPCSetCameraPosition");
|
|
@@ -58197,13 +58232,6 @@ class RpcClient {
|
|
|
58197
58232
|
marshal.writeFloat(blendTime);
|
|
58198
58233
|
this._socket.sendRPC(marshal);
|
|
58199
58234
|
}
|
|
58200
|
-
RPCSetCameraView(state, blendTime) {
|
|
58201
|
-
const marshal = new Marshal();
|
|
58202
|
-
marshal.writeString("RPCSetCameraView");
|
|
58203
|
-
marshal.writeSegment(state);
|
|
58204
|
-
marshal.writeFloat(blendTime);
|
|
58205
|
-
this._socket.sendRPC(marshal);
|
|
58206
|
-
}
|
|
58207
58235
|
RPCSetGhostColor(ghostColor) {
|
|
58208
58236
|
const marshal = new Marshal();
|
|
58209
58237
|
marshal.writeString("RPCSetGhostColor");
|
|
@@ -58221,10 +58249,10 @@ class RpcClient {
|
|
|
58221
58249
|
marshal.writeRGBA(backgroundColor);
|
|
58222
58250
|
this._socket.sendRPC(marshal);
|
|
58223
58251
|
}
|
|
58224
|
-
|
|
58252
|
+
RPCSetMaterialOverridesForElements(vimIndex, elementIndices, materialInstanceHandles) {
|
|
58225
58253
|
const marshal = new Marshal();
|
|
58226
|
-
marshal.writeString("
|
|
58227
|
-
marshal.writeUInt(
|
|
58254
|
+
marshal.writeString("RPCSetMaterialOverridesForElements");
|
|
58255
|
+
marshal.writeUInt(vimIndex);
|
|
58228
58256
|
marshal.writeArrayOfUInt(elementIndices);
|
|
58229
58257
|
marshal.writeArrayOfUInt(materialInstanceHandles);
|
|
58230
58258
|
this._socket.sendRPC(marshal);
|
|
@@ -58235,25 +58263,31 @@ class RpcClient {
|
|
|
58235
58263
|
marshal.writeSectionBoxState(state);
|
|
58236
58264
|
this._socket.sendRPC(marshal);
|
|
58237
58265
|
}
|
|
58238
|
-
|
|
58266
|
+
RPCSetStateElements(vimIndex, elementIndices, state) {
|
|
58239
58267
|
const marshal = new Marshal();
|
|
58240
|
-
marshal.writeString("
|
|
58241
|
-
marshal.writeUInt(
|
|
58268
|
+
marshal.writeString("RPCSetStateElements");
|
|
58269
|
+
marshal.writeUInt(vimIndex);
|
|
58270
|
+
marshal.writeArrayOfUInt(elementIndices);
|
|
58242
58271
|
marshal.writeUInt(state);
|
|
58243
58272
|
this._socket.sendRPC(marshal);
|
|
58244
58273
|
}
|
|
58245
|
-
|
|
58274
|
+
RPCSetStateScene(state) {
|
|
58246
58275
|
const marshal = new Marshal();
|
|
58247
|
-
marshal.writeString("
|
|
58248
|
-
marshal.writeUInt(componentHandle);
|
|
58249
|
-
marshal.writeArrayOfUInt(elementIndices);
|
|
58276
|
+
marshal.writeString("RPCSetStateScene");
|
|
58250
58277
|
marshal.writeUInt(state);
|
|
58251
58278
|
this._socket.sendRPC(marshal);
|
|
58252
58279
|
}
|
|
58253
|
-
|
|
58280
|
+
RPCSetStateVim(vimIndex, state) {
|
|
58281
|
+
const marshal = new Marshal();
|
|
58282
|
+
marshal.writeString("RPCSetStateVim");
|
|
58283
|
+
marshal.writeUInt(vimIndex);
|
|
58284
|
+
marshal.writeUInt(state);
|
|
58285
|
+
this._socket.sendRPC(marshal);
|
|
58286
|
+
}
|
|
58287
|
+
RPCSetStatesElements(vimIndex, elementIndices, states) {
|
|
58254
58288
|
const marshal = new Marshal();
|
|
58255
58289
|
marshal.writeString("RPCSetStatesElements");
|
|
58256
|
-
marshal.writeUInt(
|
|
58290
|
+
marshal.writeUInt(vimIndex);
|
|
58257
58291
|
marshal.writeArrayOfUInt(elementIndices);
|
|
58258
58292
|
marshal.writeArrayOfUInt(states);
|
|
58259
58293
|
this._socket.sendRPC(marshal);
|
|
@@ -58281,12 +58315,6 @@ class RpcClient {
|
|
|
58281
58315
|
marshal.writeString("RPCUnloadAll");
|
|
58282
58316
|
this._socket.sendRPC(marshal);
|
|
58283
58317
|
}
|
|
58284
|
-
RPCUnloadVim(componentHandle) {
|
|
58285
|
-
const marshal = new Marshal();
|
|
58286
|
-
marshal.writeString("RPCUnloadVim");
|
|
58287
|
-
marshal.writeUInt(componentHandle);
|
|
58288
|
-
this._socket.sendRPC(marshal);
|
|
58289
|
-
}
|
|
58290
58318
|
}
|
|
58291
58319
|
class RemoteColor {
|
|
58292
58320
|
/**
|
|
@@ -58318,35 +58346,7 @@ class RemoteColor {
|
|
|
58318
58346
|
* @returns {number} The color value as a hexadecimal number.
|
|
58319
58347
|
*/
|
|
58320
58348
|
get hex() {
|
|
58321
|
-
return this.color.
|
|
58322
|
-
}
|
|
58323
|
-
/**
|
|
58324
|
-
* Gets the red component of the color.
|
|
58325
|
-
* @returns {number} The red component value in the range [0-255].
|
|
58326
|
-
*/
|
|
58327
|
-
get r() {
|
|
58328
|
-
return this.color.r;
|
|
58329
|
-
}
|
|
58330
|
-
/**
|
|
58331
|
-
* Gets the green component of the color.
|
|
58332
|
-
* @returns {number} The green component value in the range [0-255].
|
|
58333
|
-
*/
|
|
58334
|
-
get g() {
|
|
58335
|
-
return this.color.g;
|
|
58336
|
-
}
|
|
58337
|
-
/**
|
|
58338
|
-
* Gets the blue component of the color.
|
|
58339
|
-
* @returns {number} The blue component value in the range [0-255].
|
|
58340
|
-
*/
|
|
58341
|
-
get b() {
|
|
58342
|
-
return this.color.b;
|
|
58343
|
-
}
|
|
58344
|
-
/**
|
|
58345
|
-
* Gets the alpha (opacity) component of the color.
|
|
58346
|
-
* @returns {number} The alpha component value in the range [0-255].
|
|
58347
|
-
*/
|
|
58348
|
-
get a() {
|
|
58349
|
-
return this.color.a;
|
|
58349
|
+
return this.color.getHex();
|
|
58350
58350
|
}
|
|
58351
58351
|
/**
|
|
58352
58352
|
* Disposes of the color handle and releases associated resources.
|
|
@@ -58359,6 +58359,12 @@ class RemoteColor {
|
|
|
58359
58359
|
this._disposed = true;
|
|
58360
58360
|
}
|
|
58361
58361
|
}
|
|
58362
|
+
function RGBAfromThree(color, opacity = 1) {
|
|
58363
|
+
return new RGBA(color.r, color.g, color.b, opacity);
|
|
58364
|
+
}
|
|
58365
|
+
function RGBA32fromThree(color, opacity = 1) {
|
|
58366
|
+
return RGBA32.fromFloats(color.r, color.g, color.b, opacity);
|
|
58367
|
+
}
|
|
58362
58368
|
const MAX_BATCH_SIZE = 3e3;
|
|
58363
58369
|
class ColorManager {
|
|
58364
58370
|
/**
|
|
@@ -58378,39 +58384,48 @@ class ColorManager {
|
|
|
58378
58384
|
* @param hex - The RGBA32 color value
|
|
58379
58385
|
* @returns Promise resolving to a ColorHandle, or undefined if creation fails
|
|
58380
58386
|
*/
|
|
58381
|
-
async getColor(
|
|
58382
|
-
const colors = await this.getColors([
|
|
58387
|
+
async getColor(color) {
|
|
58388
|
+
const colors = await this.getColors([color]);
|
|
58383
58389
|
if (!colors) return void 0;
|
|
58384
58390
|
return colors[0];
|
|
58385
58391
|
}
|
|
58386
58392
|
/**
|
|
58387
58393
|
* Creates or retrieves cached color instances for multiple hex values.
|
|
58388
|
-
* @param
|
|
58394
|
+
* @param colors - Array of color values or undefined for no color
|
|
58389
58395
|
* @returns Promise resolving to an array of ColorHandles in the same order as input, or undefined if creation fails
|
|
58390
58396
|
* @remarks Duplicate hex values will be mapped to the same color instance for efficiency
|
|
58391
58397
|
*/
|
|
58392
|
-
async getColors(
|
|
58393
|
-
const result = new Array(
|
|
58398
|
+
async getColors(colors) {
|
|
58399
|
+
const result = new Array(colors.length);
|
|
58394
58400
|
const hexToIndices = /* @__PURE__ */ new Map();
|
|
58395
58401
|
const toCreate = [];
|
|
58396
|
-
for (let i = 0; i <
|
|
58397
|
-
const color =
|
|
58398
|
-
if (
|
|
58399
|
-
result[i] =
|
|
58400
|
-
|
|
58401
|
-
|
|
58402
|
-
|
|
58403
|
-
|
|
58404
|
-
|
|
58402
|
+
for (let i = 0; i < colors.length; i++) {
|
|
58403
|
+
const color = colors[i];
|
|
58404
|
+
if (color === void 0) {
|
|
58405
|
+
result[i] = void 0;
|
|
58406
|
+
continue;
|
|
58407
|
+
}
|
|
58408
|
+
const hex = (color == null ? void 0 : color.getHex()) ?? -1;
|
|
58409
|
+
const remoteColor = this._hexToColor.get(hex);
|
|
58410
|
+
if (remoteColor) {
|
|
58411
|
+
result[i] = remoteColor;
|
|
58412
|
+
continue;
|
|
58405
58413
|
}
|
|
58414
|
+
const indices = hexToIndices.get(hex);
|
|
58415
|
+
if (indices) {
|
|
58416
|
+
hexToIndices.get(hex).push(i);
|
|
58417
|
+
continue;
|
|
58418
|
+
}
|
|
58419
|
+
toCreate.push(color);
|
|
58420
|
+
hexToIndices.set(hex, [i]);
|
|
58406
58421
|
}
|
|
58407
|
-
const
|
|
58408
|
-
if (!
|
|
58409
|
-
for (let i = 0; i <
|
|
58422
|
+
const remoteColors = await this._createColors(toCreate);
|
|
58423
|
+
if (!remoteColors) return void 0;
|
|
58424
|
+
for (let i = 0; i < remoteColors.length; i++) {
|
|
58410
58425
|
const color = toCreate[i];
|
|
58411
|
-
const indices = hexToIndices.get(color.
|
|
58426
|
+
const indices = hexToIndices.get(color.getHex());
|
|
58412
58427
|
for (const index2 of indices) {
|
|
58413
|
-
result[index2] =
|
|
58428
|
+
result[index2] = remoteColors[i];
|
|
58414
58429
|
}
|
|
58415
58430
|
}
|
|
58416
58431
|
return result;
|
|
@@ -58453,7 +58468,8 @@ class ColorManager {
|
|
|
58453
58468
|
if (colors.length === 0) {
|
|
58454
58469
|
return result;
|
|
58455
58470
|
}
|
|
58456
|
-
const
|
|
58471
|
+
const rpcColors = colors.map((c) => RGBA32fromThree(c));
|
|
58472
|
+
const instances = await this._rpc.RPCCreateMaterialInstances(MaterialHandles.StandardOpaque, 1, rpcColors);
|
|
58457
58473
|
if (!instances) return void 0;
|
|
58458
58474
|
for (let i = 0; i < colors.length; i++) {
|
|
58459
58475
|
const color = this._createColor(colors[i], instances[i]);
|
|
@@ -58470,7 +58486,7 @@ class ColorManager {
|
|
|
58470
58486
|
*/
|
|
58471
58487
|
_createColor(color, id2) {
|
|
58472
58488
|
const handle = new RemoteColor(color, id2, this);
|
|
58473
|
-
this._hexToColor.set(color.
|
|
58489
|
+
this._hexToColor.set(color.getHex(), handle);
|
|
58474
58490
|
this._idToColor.set(handle.id, handle);
|
|
58475
58491
|
return handle;
|
|
58476
58492
|
}
|
|
@@ -59037,9 +59053,9 @@ class Raycaster3 {
|
|
|
59037
59053
|
if (!Validation.isRelativeVector2(position)) return void 0;
|
|
59038
59054
|
const test2 = await this._rpc.RPCPerformHitTest(position);
|
|
59039
59055
|
if (!test2) return void 0;
|
|
59040
|
-
const vim = this._vims.getFromHandle(test2.
|
|
59056
|
+
const vim = this._vims.getFromHandle(test2.vimIndex);
|
|
59041
59057
|
if (!vim) return void 0;
|
|
59042
|
-
const object = vim.getElement(test2.
|
|
59058
|
+
const object = vim.getElement(test2.vimElementIndex);
|
|
59043
59059
|
if (!object) return void 0;
|
|
59044
59060
|
return new UltraRaycastResult(
|
|
59045
59061
|
object,
|
|
@@ -59068,7 +59084,7 @@ const defaultSceneSettings = {
|
|
|
59068
59084
|
hdrScale: 1.37,
|
|
59069
59085
|
hdrBackgroundScale: 1,
|
|
59070
59086
|
hdrBackgroundSaturation: 1,
|
|
59071
|
-
|
|
59087
|
+
backgroundBlur: 1,
|
|
59072
59088
|
backgroundColor: new RGBA(0.9, 0.9, 0.9, 1)
|
|
59073
59089
|
};
|
|
59074
59090
|
var VimLoadingStatus = /* @__PURE__ */ ((VimLoadingStatus2) => {
|
|
@@ -59081,15 +59097,26 @@ var VimLoadingStatus = /* @__PURE__ */ ((VimLoadingStatus2) => {
|
|
|
59081
59097
|
return VimLoadingStatus2;
|
|
59082
59098
|
})(VimLoadingStatus || {});
|
|
59083
59099
|
class RpcSafeClient {
|
|
59100
|
+
/**
|
|
59101
|
+
* Creates a new RpcSafeClient instance.
|
|
59102
|
+
* @param rpc - The underlying RpcClient used for communication
|
|
59103
|
+
* @param batchSize - Maximum size of batched data for operations (default: 10000)
|
|
59104
|
+
*/
|
|
59084
59105
|
constructor(rpc, batchSize = defaultBatchSize) {
|
|
59085
59106
|
__publicField(this, "rpc");
|
|
59086
59107
|
__publicField(this, "batchSize");
|
|
59087
59108
|
this.rpc = rpc;
|
|
59088
59109
|
this.batchSize = batchSize;
|
|
59089
59110
|
}
|
|
59111
|
+
/**
|
|
59112
|
+
* The URL used by the underlying RPC connection.
|
|
59113
|
+
*/
|
|
59090
59114
|
get url() {
|
|
59091
59115
|
return this.rpc.url;
|
|
59092
59116
|
}
|
|
59117
|
+
/**
|
|
59118
|
+
* Indicates whether the RPC client is currently connected.
|
|
59119
|
+
*/
|
|
59093
59120
|
get connected() {
|
|
59094
59121
|
return this.rpc.connected;
|
|
59095
59122
|
}
|
|
@@ -59099,9 +59126,10 @@ class RpcSafeClient {
|
|
|
59099
59126
|
* and scene-wide settings.
|
|
59100
59127
|
******************************************************************************/
|
|
59101
59128
|
/**
|
|
59102
|
-
* Initializes and starts the scene with
|
|
59129
|
+
* Initializes and starts the scene with the given settings.
|
|
59103
59130
|
* @param settings - Optional partial scene settings to override defaults
|
|
59104
|
-
* @
|
|
59131
|
+
* @returns Promise resolving to true if the scene started successfully, false otherwise
|
|
59132
|
+
* @remarks Missing values will be filled from {@link defaultSceneSettings}
|
|
59105
59133
|
*/
|
|
59106
59134
|
async RPCStartScene(settings2) {
|
|
59107
59135
|
const s = { ...defaultSceneSettings, ...settings2 ?? {} };
|
|
@@ -59111,15 +59139,15 @@ class RpcSafeClient {
|
|
|
59111
59139
|
Validation.min0(s.hdrScale),
|
|
59112
59140
|
Validation.clamp01(s.hdrBackgroundScale),
|
|
59113
59141
|
Validation.clamp01(s.hdrBackgroundSaturation),
|
|
59114
|
-
Validation.clamp01(s.
|
|
59142
|
+
Validation.clamp01(s.backgroundBlur),
|
|
59115
59143
|
Validation.clampRGBA01(s.backgroundColor)
|
|
59116
59144
|
),
|
|
59117
59145
|
false
|
|
59118
59146
|
);
|
|
59119
59147
|
}
|
|
59120
59148
|
/**
|
|
59121
|
-
*
|
|
59122
|
-
* @param settings - The lighting settings to apply
|
|
59149
|
+
* Updates the scene’s lighting configuration.
|
|
59150
|
+
* @param settings - The complete lighting and background settings to apply
|
|
59123
59151
|
*/
|
|
59124
59152
|
RPCSetLighting(settings2) {
|
|
59125
59153
|
const s = settings2;
|
|
@@ -59128,43 +59156,80 @@ class RpcSafeClient {
|
|
|
59128
59156
|
Validation.min0(s.hdrScale),
|
|
59129
59157
|
Validation.clamp01(s.hdrBackgroundScale),
|
|
59130
59158
|
Validation.clamp01(s.hdrBackgroundSaturation),
|
|
59131
|
-
Validation.clamp01(s.
|
|
59159
|
+
Validation.clamp01(s.backgroundBlur),
|
|
59132
59160
|
Validation.clampRGBA01(s.backgroundColor)
|
|
59133
59161
|
);
|
|
59134
59162
|
}
|
|
59163
|
+
/**
|
|
59164
|
+
* Retrieves the total number of elements across the entire scene.
|
|
59165
|
+
* @returns Promise resolving to the total number of elements (0 on failure).
|
|
59166
|
+
*/
|
|
59167
|
+
RPCGetElementCountForScene() {
|
|
59168
|
+
return this.safeCall(
|
|
59169
|
+
() => this.rpc.RPCGetElementCountForScene(),
|
|
59170
|
+
0
|
|
59171
|
+
);
|
|
59172
|
+
}
|
|
59173
|
+
/**
|
|
59174
|
+
* Retrieves the number of elements within a specific loaded vim.
|
|
59175
|
+
* @param vimIndex - Index of the loaded vim to query
|
|
59176
|
+
* @returns Promise resolving to the element count (0 on failure)
|
|
59177
|
+
*/
|
|
59178
|
+
RPCGetElementCountForVim(vimIndex) {
|
|
59179
|
+
return this.safeCall(
|
|
59180
|
+
() => this.rpc.RPCGetElementCountForVim(vimIndex),
|
|
59181
|
+
0
|
|
59182
|
+
);
|
|
59183
|
+
}
|
|
59135
59184
|
/*******************************************************************************
|
|
59136
|
-
*
|
|
59137
|
-
* Methods for controlling
|
|
59185
|
+
* ELEMENTS VISIBILITY METHODS
|
|
59186
|
+
* Methods for controlling element visibility, including show/hide, ghosting,
|
|
59138
59187
|
* and highlighting functionality.
|
|
59139
59188
|
******************************************************************************/
|
|
59140
59189
|
/**
|
|
59141
|
-
*
|
|
59142
|
-
*
|
|
59143
|
-
*
|
|
59144
|
-
* @param
|
|
59145
|
-
* @
|
|
59146
|
-
|
|
59147
|
-
|
|
59148
|
-
|
|
59149
|
-
if (
|
|
59150
|
-
if (!Validation.
|
|
59151
|
-
|
|
59190
|
+
* Sets a single visibility state for given elements within a loaded vim.
|
|
59191
|
+
* The operation is automatically split into batches if the array is large.
|
|
59192
|
+
*
|
|
59193
|
+
* @param vimIndex - The index of the loaded vim containing the elements
|
|
59194
|
+
* @param vimElementIndices - Array of vim-based element indices to apply the state to
|
|
59195
|
+
* @param state - The visibility state to apply (e.g., VISIBLE, HIDDEN)
|
|
59196
|
+
*/
|
|
59197
|
+
RPCSetStateElements(vimIndex, vimElementIndices, state) {
|
|
59198
|
+
if (vimElementIndices.length === 0) return;
|
|
59199
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59200
|
+
if (!Validation.areIndices(vimElementIndices)) return;
|
|
59201
|
+
const batches = batchArray(vimElementIndices, this.batchSize);
|
|
59152
59202
|
for (const batch of batches) {
|
|
59153
|
-
this.rpc.RPCSetStateElements(
|
|
59203
|
+
this.rpc.RPCSetStateElements(vimIndex, batch, state);
|
|
59154
59204
|
}
|
|
59155
59205
|
}
|
|
59156
|
-
|
|
59157
|
-
|
|
59158
|
-
|
|
59159
|
-
|
|
59160
|
-
|
|
59206
|
+
/**
|
|
59207
|
+
* Sets individual visibility states for multiple elements in a vim.
|
|
59208
|
+
* Each element receives a corresponding visibility state from the input array.
|
|
59209
|
+
* The operation is automatically split into batches if the array is large.
|
|
59210
|
+
*
|
|
59211
|
+
* @param vimIndex - The index of the loaded vim
|
|
59212
|
+
* @param vimElementIndices - Array of vim-based element indices
|
|
59213
|
+
* @param states - Array of visibility states to apply, one per element
|
|
59214
|
+
*/
|
|
59215
|
+
RPCSetStatesElements(vimIndex, vimElementIndices, states) {
|
|
59216
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59217
|
+
if (!Validation.areIndices(vimElementIndices)) return;
|
|
59218
|
+
if (!Validation.areSameLength(vimElementIndices, states)) return;
|
|
59219
|
+
const batches = batchArrays(vimElementIndices, states, this.batchSize);
|
|
59161
59220
|
for (const [batchedElements, batchedStates] of batches) {
|
|
59162
|
-
this.rpc.RPCSetStatesElements(
|
|
59221
|
+
this.rpc.RPCSetStatesElements(vimIndex, batchedElements, batchedStates);
|
|
59163
59222
|
}
|
|
59164
59223
|
}
|
|
59165
|
-
|
|
59166
|
-
|
|
59167
|
-
|
|
59224
|
+
/**
|
|
59225
|
+
* Applies a single visibility state to all elements of a loaded vim.
|
|
59226
|
+
*
|
|
59227
|
+
* @param vimIndex - The index of the loaded vim
|
|
59228
|
+
* @param state - The visibility state to apply (e.g., VISIBLE, HIDDEN)
|
|
59229
|
+
*/
|
|
59230
|
+
RPCSetStateVim(vimIndex, state) {
|
|
59231
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59232
|
+
this.rpc.RPCSetStateVim(vimIndex, state);
|
|
59168
59233
|
}
|
|
59169
59234
|
/*******************************************************************************
|
|
59170
59235
|
* TEXT AND UI METHODS
|
|
@@ -59176,7 +59241,6 @@ class RpcSafeClient {
|
|
|
59176
59241
|
* @param color - The color of the text
|
|
59177
59242
|
* @param text - The content to display
|
|
59178
59243
|
* @returns Promise resolving to the handle of the created text component
|
|
59179
|
-
* @throws {Error} If the text is empty
|
|
59180
59244
|
*/
|
|
59181
59245
|
async RPCCreateText(position, color, text) {
|
|
59182
59246
|
if (!Validation.isNonEmptyString(text)) return INVALID_HANDLE;
|
|
@@ -59189,19 +59253,26 @@ class RpcSafeClient {
|
|
|
59189
59253
|
/**
|
|
59190
59254
|
* Destroys a text component, removing it from the scene.
|
|
59191
59255
|
* @param componentHandle - The handle of the text component to destroy
|
|
59192
|
-
* @throws {Error} If the component handle is invalid
|
|
59193
59256
|
*/
|
|
59194
59257
|
RPCDestroyText(componentHandle) {
|
|
59195
|
-
if (!Validation.
|
|
59258
|
+
if (!Validation.isIndex(componentHandle)) return;
|
|
59196
59259
|
this.rpc.RPCDestroyText(componentHandle);
|
|
59197
59260
|
}
|
|
59198
59261
|
/*******************************************************************************
|
|
59199
59262
|
* SECTION BOX METHODS
|
|
59200
59263
|
* Methods for controlling section box visibility and position.
|
|
59201
59264
|
******************************************************************************/
|
|
59265
|
+
/**
|
|
59266
|
+
* Enables or disables the section box.
|
|
59267
|
+
* @param enable - True to enable the section box, false to disable it
|
|
59268
|
+
*/
|
|
59202
59269
|
RPCEnableSectionBox(enable) {
|
|
59203
59270
|
this.rpc.RPCEnableSectionBox(enable);
|
|
59204
59271
|
}
|
|
59272
|
+
/**
|
|
59273
|
+
* Sets the parameters of the section box.
|
|
59274
|
+
* @param state - The new section box state, including visibility and bounding box
|
|
59275
|
+
*/
|
|
59205
59276
|
RPCSetSectionBox(state) {
|
|
59206
59277
|
this.rpc.RPCSetSectionBox(
|
|
59207
59278
|
{
|
|
@@ -59210,6 +59281,10 @@ class RpcSafeClient {
|
|
|
59210
59281
|
}
|
|
59211
59282
|
);
|
|
59212
59283
|
}
|
|
59284
|
+
/**
|
|
59285
|
+
* Retrieves the current section box state.
|
|
59286
|
+
* @returns Promise resolving to the section box state or undefined on failure
|
|
59287
|
+
*/
|
|
59213
59288
|
async RPCGetSectionBox() {
|
|
59214
59289
|
return await this.safeCall(
|
|
59215
59290
|
() => this.rpc.RPCGetSectionBox(),
|
|
@@ -59226,7 +59301,7 @@ class RpcSafeClient {
|
|
|
59226
59301
|
*/
|
|
59227
59302
|
async RPCGetCameraView() {
|
|
59228
59303
|
return await this.safeCall(
|
|
59229
|
-
() => this.rpc.
|
|
59304
|
+
() => this.rpc.RPCGetCameraPose(),
|
|
59230
59305
|
void 0
|
|
59231
59306
|
);
|
|
59232
59307
|
}
|
|
@@ -59238,7 +59313,7 @@ class RpcSafeClient {
|
|
|
59238
59313
|
RPCSetCameraView(segment, blendTime) {
|
|
59239
59314
|
if (!Validation.isValidSegment(segment)) return;
|
|
59240
59315
|
blendTime = Validation.clamp01(blendTime);
|
|
59241
|
-
this.rpc.
|
|
59316
|
+
this.rpc.RPCSetCameraPose(segment, blendTime);
|
|
59242
59317
|
}
|
|
59243
59318
|
/**
|
|
59244
59319
|
* Sets the camera's position without changing its target.
|
|
@@ -59266,52 +59341,52 @@ class RpcSafeClient {
|
|
|
59266
59341
|
}
|
|
59267
59342
|
/**
|
|
59268
59343
|
* Retrieves the axis-aligned bounding box (AABB) that encompasses the entire scene.
|
|
59269
|
-
* This includes all loaded geometry across all
|
|
59344
|
+
* This includes all loaded geometry across all loaded vims.
|
|
59270
59345
|
*
|
|
59271
59346
|
* @returns Promise resolving to the global AABB of the scene, or undefined on failure
|
|
59272
59347
|
*/
|
|
59273
|
-
|
|
59348
|
+
RPCGetAABBForScene() {
|
|
59274
59349
|
return this.safeCall(
|
|
59275
|
-
() => this.rpc.
|
|
59350
|
+
() => this.rpc.RPCGetAABBForScene(),
|
|
59276
59351
|
void 0
|
|
59277
59352
|
);
|
|
59278
59353
|
}
|
|
59279
59354
|
/**
|
|
59280
|
-
* Retrieves the axis-aligned bounding box (AABB) for a specific
|
|
59281
|
-
* This bounding box represents the spatial bounds of all geometry within the given
|
|
59355
|
+
* Retrieves the axis-aligned bounding box (AABB) for a specific loaded vim.
|
|
59356
|
+
* This bounding box represents the spatial bounds of all geometry within the given loaded vim.
|
|
59282
59357
|
*
|
|
59283
|
-
* @param
|
|
59284
|
-
* @returns Promise resolving to the
|
|
59358
|
+
* @param vimIndex - The index of the loaded vim to query
|
|
59359
|
+
* @returns Promise resolving to the vim bounding box, or undefined on failure
|
|
59285
59360
|
*/
|
|
59286
|
-
async RPCGetAABBForVim(
|
|
59361
|
+
async RPCGetAABBForVim(vimIndex) {
|
|
59362
|
+
if (!Validation.isIndex(vimIndex)) return void 0;
|
|
59287
59363
|
return await this.safeCall(
|
|
59288
|
-
() => this.rpc.RPCGetAABBForVim(
|
|
59364
|
+
() => this.rpc.RPCGetAABBForVim(vimIndex),
|
|
59289
59365
|
void 0
|
|
59290
59366
|
);
|
|
59291
59367
|
}
|
|
59292
59368
|
/**
|
|
59293
|
-
* Calculates the bounding box for specified
|
|
59294
|
-
* Large
|
|
59295
|
-
* @param
|
|
59296
|
-
* @param
|
|
59297
|
-
* @returns Promise resolving to the combined bounding box
|
|
59298
|
-
* @throws {Error} If the component handle is invalid or nodes array is invalid
|
|
59369
|
+
* Calculates the bounding box for specified elements of a loaded vim.
|
|
59370
|
+
* Large element arrays are automatically processed in batches.
|
|
59371
|
+
* @param vimIndex - The index of the loaded vim
|
|
59372
|
+
* @param vimElementIndices - Array of vim-based element indices to calculate bounds for
|
|
59373
|
+
* @returns Promise resolving to the combined bounding box or undefined on failure
|
|
59299
59374
|
*/
|
|
59300
|
-
async RPCGetAABBForElements(
|
|
59301
|
-
if (!Validation.
|
|
59302
|
-
if (!Validation.
|
|
59375
|
+
async RPCGetAABBForElements(vimIndex, vimElementIndices) {
|
|
59376
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59377
|
+
if (!Validation.areIndices(vimElementIndices)) return;
|
|
59303
59378
|
return await this.safeCall(
|
|
59304
|
-
() => this.RPCGetAABBForElementsBatched(
|
|
59379
|
+
() => this.RPCGetAABBForElementsBatched(vimIndex, vimElementIndices),
|
|
59305
59380
|
void 0
|
|
59306
59381
|
);
|
|
59307
59382
|
}
|
|
59308
|
-
async RPCGetAABBForElementsBatched(
|
|
59309
|
-
if (
|
|
59383
|
+
async RPCGetAABBForElementsBatched(vimIndex, vimElementIndices) {
|
|
59384
|
+
if (vimElementIndices.length === 0) {
|
|
59310
59385
|
return new Box3();
|
|
59311
59386
|
}
|
|
59312
|
-
const batches = batchArray(
|
|
59387
|
+
const batches = batchArray(vimElementIndices, this.batchSize);
|
|
59313
59388
|
const promises = batches.map(async (batch) => {
|
|
59314
|
-
const aabb = await this.rpc.RPCGetAABBForElements(
|
|
59389
|
+
const aabb = await this.rpc.RPCGetAABBForElements(vimIndex, batch);
|
|
59315
59390
|
const v1 = new Vector3(aabb.min.x, aabb.min.y, aabb.min.z);
|
|
59316
59391
|
const v2 = new Vector3(aabb.max.x, aabb.max.y, aabb.max.z);
|
|
59317
59392
|
return new Box3(v1, v2);
|
|
@@ -59322,53 +59397,51 @@ class RpcSafeClient {
|
|
|
59322
59397
|
return box;
|
|
59323
59398
|
}
|
|
59324
59399
|
/**
|
|
59325
|
-
* Frames the camera to show all
|
|
59400
|
+
* Frames the camera to show all elements in the scene.
|
|
59326
59401
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
59327
59402
|
* @returns Promise resolving to camera segment representing the final position
|
|
59328
59403
|
*/
|
|
59329
|
-
async
|
|
59404
|
+
async RPCFrameScene(blendTime) {
|
|
59330
59405
|
blendTime = Validation.clamp01(blendTime);
|
|
59331
59406
|
return await this.safeCall(
|
|
59332
|
-
() => this.rpc.
|
|
59407
|
+
() => this.rpc.RPCFrameScene(blendTime),
|
|
59333
59408
|
void 0
|
|
59334
59409
|
);
|
|
59335
59410
|
}
|
|
59336
59411
|
/**
|
|
59337
|
-
* Frames a specific
|
|
59338
|
-
* @param
|
|
59412
|
+
* Frames a specific vim in the scene.
|
|
59413
|
+
* @param vimIndex - The index of the loaded vim to frame
|
|
59339
59414
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
59340
59415
|
* @returns Promise resolving to camera segment representing the final position
|
|
59341
|
-
* @throws {Error} If the component handle is invalid
|
|
59342
59416
|
*/
|
|
59343
|
-
async RPCFrameVim(
|
|
59344
|
-
if (!Validation.
|
|
59417
|
+
async RPCFrameVim(vimIndex, blendTime) {
|
|
59418
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59345
59419
|
blendTime = Validation.clamp01(blendTime);
|
|
59346
59420
|
return await this.safeCall(
|
|
59347
|
-
() => this.rpc.RPCFrameVim(
|
|
59421
|
+
() => this.rpc.RPCFrameVim(vimIndex, blendTime),
|
|
59348
59422
|
void 0
|
|
59349
59423
|
);
|
|
59350
59424
|
}
|
|
59351
59425
|
/**
|
|
59352
|
-
* Frames specific
|
|
59353
|
-
*
|
|
59354
|
-
* @param
|
|
59355
|
-
* @param
|
|
59426
|
+
* Frames specific elements of a loaded vim.
|
|
59427
|
+
* Automatically batches large arrays of elements.
|
|
59428
|
+
* @param vimIndex - The index of the loaded vim
|
|
59429
|
+
* @param vimElementIndices - Array of vim-based element indices to frame
|
|
59356
59430
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
59357
59431
|
* @returns Promise resolving to camera segment representing the final position
|
|
59358
|
-
* @throws {Error} If the component handle is invalid or nodes array is empty
|
|
59359
59432
|
*/
|
|
59360
|
-
async RPCFrameElements(
|
|
59361
|
-
if (!Validation.
|
|
59362
|
-
if (!Validation.
|
|
59433
|
+
async RPCFrameElements(vimIndex, vimElementIndices, blendTime) {
|
|
59434
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59435
|
+
if (!Validation.areIndices(vimElementIndices)) return;
|
|
59363
59436
|
blendTime = Validation.clamp01(blendTime);
|
|
59364
|
-
if (
|
|
59437
|
+
if (vimElementIndices.length < this.batchSize) {
|
|
59365
59438
|
return await this.safeCall(
|
|
59366
|
-
() => this.rpc.RPCFrameElements(
|
|
59439
|
+
() => this.rpc.RPCFrameElements(vimIndex, vimElementIndices, blendTime),
|
|
59367
59440
|
void 0
|
|
59368
59441
|
);
|
|
59369
59442
|
} else {
|
|
59370
59443
|
const box = await this.safeCall(
|
|
59371
|
-
() => this.RPCGetAABBForElementsBatched(
|
|
59444
|
+
() => this.RPCGetAABBForElementsBatched(vimIndex, vimElementIndices),
|
|
59372
59445
|
void 0
|
|
59373
59446
|
);
|
|
59374
59447
|
if (!box) return void 0;
|
|
@@ -59382,7 +59455,6 @@ class RpcSafeClient {
|
|
|
59382
59455
|
* Frames the camera to show a specific bounding box.
|
|
59383
59456
|
* @param box - The bounding box to frame
|
|
59384
59457
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
59385
|
-
* @throws {Error} If the box is invalid (min values must be less than max values)
|
|
59386
59458
|
*/
|
|
59387
59459
|
async RPCFrameAABB(box, blendTime) {
|
|
59388
59460
|
if (!Validation.isValidBox(box)) return;
|
|
@@ -59399,12 +59471,15 @@ class RpcSafeClient {
|
|
|
59399
59471
|
/**
|
|
59400
59472
|
* Sets the camera movement speed.
|
|
59401
59473
|
* @param speed - The desired movement speed (must be positive)
|
|
59402
|
-
* @throws {Error} If speed is not positive
|
|
59403
59474
|
*/
|
|
59404
59475
|
RPCSetCameraSpeed(speed) {
|
|
59405
59476
|
speed = Validation.min0(speed);
|
|
59406
59477
|
this.rpc.RPCSetCameraSpeed(speed);
|
|
59407
59478
|
}
|
|
59479
|
+
/**
|
|
59480
|
+
* Sets the camera control mode.
|
|
59481
|
+
* @param mode - The desired input mode (e.g., {@link InputMode.Orbit} or {@link InputMode.Free})
|
|
59482
|
+
*/
|
|
59408
59483
|
RPCSetCameraMode(mode) {
|
|
59409
59484
|
this.rpc.RPCSetCameraMode(
|
|
59410
59485
|
mode === "orbit"
|
|
@@ -59413,9 +59488,8 @@ class RpcSafeClient {
|
|
|
59413
59488
|
}
|
|
59414
59489
|
/**
|
|
59415
59490
|
* Sets the viewer's aspect ratio.
|
|
59416
|
-
* @param width - The width
|
|
59417
|
-
* @param height - The height
|
|
59418
|
-
* @throws {Error} If width or height are not positive integers
|
|
59491
|
+
* @param width - The width of the desired aspect ratio
|
|
59492
|
+
* @param height - The height of the desired aspect ratio
|
|
59419
59493
|
*/
|
|
59420
59494
|
RPCSetCameraAspectRatio(width, height) {
|
|
59421
59495
|
if (!Validation.isPositiveInteger(width)) return;
|
|
@@ -59424,13 +59498,12 @@ class RpcSafeClient {
|
|
|
59424
59498
|
}
|
|
59425
59499
|
/*******************************************************************************
|
|
59426
59500
|
* VIM FILE MANAGEMENT METHODS
|
|
59427
|
-
* Methods for loading, unloading, and managing VIM files
|
|
59501
|
+
* Methods for loading, unloading, and managing VIM files.
|
|
59428
59502
|
******************************************************************************/
|
|
59429
59503
|
/**
|
|
59430
59504
|
* Loads a VIM file from the local filesystem.
|
|
59431
59505
|
* @param source - The path to the VIM file (supports file:// protocol)
|
|
59432
|
-
* @returns Promise resolving to the
|
|
59433
|
-
* @throws {Error} If the filename is invalid or empty
|
|
59506
|
+
* @returns Promise resolving to the index of the loaded vim
|
|
59434
59507
|
*/
|
|
59435
59508
|
async RPCLoadVim(source) {
|
|
59436
59509
|
if (!Validation.isNonEmptyString(source.url)) return INVALID_HANDLE;
|
|
@@ -59442,9 +59515,8 @@ class RpcSafeClient {
|
|
|
59442
59515
|
}
|
|
59443
59516
|
/**
|
|
59444
59517
|
* Loads a VIM file from a remote URL.
|
|
59445
|
-
* @param
|
|
59446
|
-
* @returns Promise resolving to the
|
|
59447
|
-
* @throws {Error} If the URL is invalid
|
|
59518
|
+
* @param source - The URL or file path of the VIM file to load
|
|
59519
|
+
* @returns Promise resolving to the index of the loaded vim
|
|
59448
59520
|
*/
|
|
59449
59521
|
async RPCLoadVimURL(source) {
|
|
59450
59522
|
if (!Validation.isURL(source.url)) return INVALID_HANDLE;
|
|
@@ -59454,17 +59526,16 @@ class RpcSafeClient {
|
|
|
59454
59526
|
);
|
|
59455
59527
|
}
|
|
59456
59528
|
/**
|
|
59457
|
-
* Retrieves the current loading state and progress of a
|
|
59458
|
-
* @param
|
|
59529
|
+
* Retrieves the current loading state and progress of a vim.
|
|
59530
|
+
* @param vimIndex - The index of the vim being loaded
|
|
59459
59531
|
* @returns Promise resolving to the current loading state and progress
|
|
59460
|
-
* @throws {Error} If the component handle is invalid
|
|
59461
59532
|
*/
|
|
59462
|
-
async RPCGetVimLoadingState(
|
|
59463
|
-
if (!Validation.
|
|
59533
|
+
async RPCGetVimLoadingState(vimIndex) {
|
|
59534
|
+
if (!Validation.isIndex(vimIndex)) {
|
|
59464
59535
|
return { status: 0, progress: 0 };
|
|
59465
59536
|
}
|
|
59466
59537
|
const result = await this.safeCall(
|
|
59467
|
-
() => this.rpc.RPCGetVimLoadingState(
|
|
59538
|
+
() => this.rpc.RPCGetVimLoadingState(vimIndex),
|
|
59468
59539
|
{ status: 0, progress: 0 }
|
|
59469
59540
|
);
|
|
59470
59541
|
if (!(result.status in VimLoadingStatus)) {
|
|
@@ -59473,16 +59544,7 @@ class RpcSafeClient {
|
|
|
59473
59544
|
return result;
|
|
59474
59545
|
}
|
|
59475
59546
|
/**
|
|
59476
|
-
*
|
|
59477
|
-
* @param componentHandle - The handle of the component to unload
|
|
59478
|
-
* @throws {Error} If the component handle is invalid
|
|
59479
|
-
*/
|
|
59480
|
-
RPCUnloadVim(componentHandle) {
|
|
59481
|
-
if (!Validation.isComponentHandle(componentHandle)) return;
|
|
59482
|
-
this.rpc.RPCUnloadVim(componentHandle);
|
|
59483
|
-
}
|
|
59484
|
-
/**
|
|
59485
|
-
* Clears the entire scene, removing all components and resetting to initial state.
|
|
59547
|
+
* Clears the entire scene, unloading all vims and resetting to initial state.
|
|
59486
59548
|
*/
|
|
59487
59549
|
RPCUnloadAll() {
|
|
59488
59550
|
this.rpc.RPCUnloadAll();
|
|
@@ -59498,7 +59560,7 @@ class RpcSafeClient {
|
|
|
59498
59560
|
/**
|
|
59499
59561
|
* Performs hit testing at a specified screen position.
|
|
59500
59562
|
* @param pos - Normalized screen coordinates (0-1, 0-1)
|
|
59501
|
-
* @returns Promise resolving to hit test result if
|
|
59563
|
+
* @returns Promise resolving to hit test result if a valid hit was detected, undefined otherwise
|
|
59502
59564
|
*/
|
|
59503
59565
|
async RPCPerformHitTest(pos) {
|
|
59504
59566
|
if (!Validation.isRelativeVector2(pos)) return;
|
|
@@ -59506,7 +59568,7 @@ class RpcSafeClient {
|
|
|
59506
59568
|
() => this.rpc.RPCPerformHitTest(pos),
|
|
59507
59569
|
void 0
|
|
59508
59570
|
);
|
|
59509
|
-
if (!result || result.
|
|
59571
|
+
if (!result || result.vimIndex === INVALID_HANDLE) {
|
|
59510
59572
|
return void 0;
|
|
59511
59573
|
}
|
|
59512
59574
|
return result;
|
|
@@ -59516,7 +59578,6 @@ class RpcSafeClient {
|
|
|
59516
59578
|
* @param position - The normalized screen coordinates (0-1, 0-1)
|
|
59517
59579
|
* @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
|
|
59518
59580
|
* @param down - True if button is pressed down, false if released
|
|
59519
|
-
* @throws {Error} If mouseButton is not a valid positive integer
|
|
59520
59581
|
*/
|
|
59521
59582
|
RPCMouseButtonEvent(position, mouseButton, down) {
|
|
59522
59583
|
if (!Validation.isPositiveInteger(mouseButton)) return;
|
|
@@ -59527,7 +59588,6 @@ class RpcSafeClient {
|
|
|
59527
59588
|
* Sends a mouse double-click event to the viewer.
|
|
59528
59589
|
* @param position - The normalized screen coordinates (0-1, 0-1)
|
|
59529
59590
|
* @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
|
|
59530
|
-
* @throws {Error} If mouseButton is not a valid positive integer
|
|
59531
59591
|
*/
|
|
59532
59592
|
RPCMouseDoubleClickEvent(position, mouseButton) {
|
|
59533
59593
|
if (!Validation.isPositiveInteger(mouseButton)) return;
|
|
@@ -59554,7 +59614,6 @@ class RpcSafeClient {
|
|
|
59554
59614
|
* Sends a mouse selection event to the viewer.
|
|
59555
59615
|
* @param position - The normalized screen coordinates (0-1, 0-1)
|
|
59556
59616
|
* @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
|
|
59557
|
-
* @throws {Error} If mouseButton is not a valid positive integer
|
|
59558
59617
|
*/
|
|
59559
59618
|
RPCMouseSelectEvent(position, mouseButton) {
|
|
59560
59619
|
if (!Validation.isPositiveInteger(mouseButton)) return;
|
|
@@ -59581,7 +59640,6 @@ class RpcSafeClient {
|
|
|
59581
59640
|
* @param smoothness - The smoothness value to apply (clamped between 0 and 1)
|
|
59582
59641
|
* @param colors - Array of colors for each material instance
|
|
59583
59642
|
* @returns Array of handles for the created material instances
|
|
59584
|
-
* @throws {Error} If the material handle is invalid or smoothness is out of range
|
|
59585
59643
|
*/
|
|
59586
59644
|
async RPCCreateMaterialInstances(materialHandle, smoothness, colors) {
|
|
59587
59645
|
if (!Validation.isMaterialHandle(materialHandle)) return;
|
|
@@ -59604,46 +59662,56 @@ class RpcSafeClient {
|
|
|
59604
59662
|
}
|
|
59605
59663
|
/**
|
|
59606
59664
|
* Destroys multiple material instances, freeing associated resources.
|
|
59607
|
-
* @param
|
|
59608
|
-
* @throws {Error} If any handle in the array is invalid
|
|
59665
|
+
* @param materialInstanceHandles - Array of handles for material instances to destroy
|
|
59609
59666
|
*/
|
|
59610
|
-
RPCDestroyMaterialInstances(
|
|
59611
|
-
if (!Validation.
|
|
59612
|
-
this.rpc.RPCDestroyMaterialInstances(
|
|
59667
|
+
RPCDestroyMaterialInstances(materialInstanceHandles) {
|
|
59668
|
+
if (!Validation.areIndices(materialInstanceHandles)) return;
|
|
59669
|
+
this.rpc.RPCDestroyMaterialInstances(materialInstanceHandles);
|
|
59613
59670
|
}
|
|
59614
59671
|
/**
|
|
59615
|
-
* Sets material overrides for specific
|
|
59616
|
-
* Large arrays are automatically processed in batches
|
|
59617
|
-
* @param
|
|
59618
|
-
* @param
|
|
59619
|
-
* @param materialInstanceHandles - Array of material instance handles to apply (must match
|
|
59620
|
-
* @throws {Error} If arrays have different lengths or any handle is invalid
|
|
59672
|
+
* Sets material overrides for specific elements in a loaded vim.
|
|
59673
|
+
* Large arrays are automatically processed in batches.
|
|
59674
|
+
* @param vimIndex - The index of the loaded vim
|
|
59675
|
+
* @param vimElementIndices - Array of vim-based element indices to override
|
|
59676
|
+
* @param materialInstanceHandles - Array of material instance handles to apply (must match element length)
|
|
59621
59677
|
*/
|
|
59622
|
-
|
|
59623
|
-
if (!Validation.areSameLength(
|
|
59624
|
-
if (!Validation.
|
|
59625
|
-
if (!Validation.
|
|
59678
|
+
RPCSetMaterialOverridesForElements(vimIndex, vimElementIndices, materialInstanceHandles) {
|
|
59679
|
+
if (!Validation.areSameLength(vimElementIndices, materialInstanceHandles)) return;
|
|
59680
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59681
|
+
if (!Validation.areIndices(vimElementIndices)) return;
|
|
59626
59682
|
if (!Validation.areIntegers(materialInstanceHandles)) return;
|
|
59627
59683
|
this.setMaterialOverridesBatched(
|
|
59628
|
-
|
|
59629
|
-
|
|
59684
|
+
vimIndex,
|
|
59685
|
+
vimElementIndices,
|
|
59630
59686
|
materialInstanceHandles
|
|
59631
59687
|
);
|
|
59632
59688
|
}
|
|
59633
|
-
setMaterialOverridesBatched(
|
|
59634
|
-
const batches = batchArrays(
|
|
59635
|
-
for (const [
|
|
59636
|
-
this.rpc.
|
|
59689
|
+
setMaterialOverridesBatched(vimIndex, vimElementIndices, materialInstanceHandles) {
|
|
59690
|
+
const batches = batchArrays(vimElementIndices, materialInstanceHandles, this.batchSize);
|
|
59691
|
+
for (const [batchedElements, batchedMaterials] of batches) {
|
|
59692
|
+
this.rpc.RPCSetMaterialOverridesForElements(vimIndex, batchedElements, batchedMaterials);
|
|
59637
59693
|
}
|
|
59638
59694
|
}
|
|
59639
59695
|
/**
|
|
59640
|
-
* Clears all material overrides for the
|
|
59641
|
-
* @param componentHandle - The unique identifier of the component
|
|
59642
|
-
* @throws {Error} If the component handle is invalid or INVALID_HANDLE
|
|
59696
|
+
* Clears all material overrides for the entire scene.
|
|
59643
59697
|
*/
|
|
59644
|
-
|
|
59645
|
-
|
|
59646
|
-
|
|
59698
|
+
RPCClearMaterialOverridesForScene() {
|
|
59699
|
+
this.rpc.RPCClearMaterialOverridesForScene();
|
|
59700
|
+
}
|
|
59701
|
+
/**
|
|
59702
|
+
* Clears all material overrides for a specific loaded vim.
|
|
59703
|
+
* @param vimIndex - The index of the loaded vim
|
|
59704
|
+
*/
|
|
59705
|
+
RPCClearMaterialOverridesForVim(vimIndex) {
|
|
59706
|
+
this.rpc.RPCClearMaterialOverridesForVim(vimIndex);
|
|
59707
|
+
}
|
|
59708
|
+
/**
|
|
59709
|
+
* Clears all material overrides for specific elements in a loaded vim.
|
|
59710
|
+
* @param vimIndex - The index of the loaded vim
|
|
59711
|
+
* @param vimElementIndices - Array of vim-based element indices to clear overrides for
|
|
59712
|
+
*/
|
|
59713
|
+
RPCClearMaterialOverridesForElements(vimIndex, vimElementIndices) {
|
|
59714
|
+
this.rpc.RPCClearMaterialOverridesForElements(vimIndex, vimElementIndices);
|
|
59647
59715
|
}
|
|
59648
59716
|
/*******************************************************************************
|
|
59649
59717
|
* DEBUG AND UTILITY METHODS
|
|
@@ -59700,7 +59768,8 @@ class RpcSafeClient {
|
|
|
59700
59768
|
}
|
|
59701
59769
|
const defaultRenderSettings = {
|
|
59702
59770
|
...defaultSceneSettings,
|
|
59703
|
-
ghostColor: new
|
|
59771
|
+
ghostColor: new Color(14 / 255, 14 / 255, 14 / 255),
|
|
59772
|
+
ghostOpacity: 64 / 255
|
|
59704
59773
|
};
|
|
59705
59774
|
class Renderer2 {
|
|
59706
59775
|
/**
|
|
@@ -59747,7 +59816,8 @@ class Renderer2 {
|
|
|
59747
59816
|
* Sets up initial scene settings, ghost color, and IBL rotation
|
|
59748
59817
|
*/
|
|
59749
59818
|
onConnect() {
|
|
59750
|
-
this.
|
|
59819
|
+
const color = RGBAfromThree(this._settings.ghostColor, this._settings.ghostOpacity);
|
|
59820
|
+
this._rpc.RPCSetGhostColor(color);
|
|
59751
59821
|
}
|
|
59752
59822
|
notifySceneUpdated() {
|
|
59753
59823
|
this._onSceneUpdated.dispatch();
|
|
@@ -59755,11 +59825,14 @@ class Renderer2 {
|
|
|
59755
59825
|
// Getters
|
|
59756
59826
|
/**
|
|
59757
59827
|
* Gets the ghost color used for transparent rendering
|
|
59758
|
-
* @returns Current ghost color as
|
|
59828
|
+
* @returns Current ghost color as a THREE.Color
|
|
59759
59829
|
*/
|
|
59760
59830
|
get ghostColor() {
|
|
59761
59831
|
return this._settings.ghostColor;
|
|
59762
59832
|
}
|
|
59833
|
+
get ghostOpacity() {
|
|
59834
|
+
return this._settings.ghostOpacity;
|
|
59835
|
+
}
|
|
59763
59836
|
/**
|
|
59764
59837
|
* Gets the tone mapping white point value
|
|
59765
59838
|
* @returns Current tone mapping white point
|
|
@@ -59793,27 +59866,33 @@ class Renderer2 {
|
|
|
59793
59866
|
* @returns Current background blur
|
|
59794
59867
|
*/
|
|
59795
59868
|
get backgroundBlur() {
|
|
59796
|
-
return this._settings.
|
|
59869
|
+
return this._settings.backgroundBlur;
|
|
59797
59870
|
}
|
|
59798
59871
|
/**
|
|
59799
59872
|
* Gets the background color
|
|
59800
59873
|
* @returns Current background color as RGBA
|
|
59801
59874
|
*/
|
|
59802
59875
|
get backgroundColor() {
|
|
59803
|
-
return this._settings.backgroundColor;
|
|
59876
|
+
return this._settings.backgroundColor.toThree();
|
|
59804
59877
|
}
|
|
59805
59878
|
// Setters
|
|
59806
59879
|
/**
|
|
59807
59880
|
* Updates the ghost color used for transparent rendering
|
|
59808
|
-
* @param value - New ghost color as
|
|
59881
|
+
* @param value - New ghost color as THREE.Color
|
|
59809
59882
|
*/
|
|
59810
59883
|
set ghostColor(value) {
|
|
59811
|
-
value = Validation.clampRGBA01(value);
|
|
59812
59884
|
if (this._settings.ghostColor.equals(value)) return;
|
|
59813
59885
|
this._settings.ghostColor = value;
|
|
59814
59886
|
this._updateGhostColor = true;
|
|
59815
59887
|
this.requestSettingsUpdate();
|
|
59816
59888
|
}
|
|
59889
|
+
set ghostOpacity(value) {
|
|
59890
|
+
value = Validation.clamp01(value);
|
|
59891
|
+
if (this._settings.ghostOpacity === value) return;
|
|
59892
|
+
this._settings.ghostOpacity = value;
|
|
59893
|
+
this._updateGhostColor = true;
|
|
59894
|
+
this.requestSettingsUpdate();
|
|
59895
|
+
}
|
|
59817
59896
|
/**
|
|
59818
59897
|
* Sets the tone mapping white point value
|
|
59819
59898
|
* @param value - New tone mapping white point value
|
|
@@ -59864,24 +59943,24 @@ class Renderer2 {
|
|
|
59864
59943
|
*/
|
|
59865
59944
|
set backgroundBlur(value) {
|
|
59866
59945
|
value = Validation.clamp01(value);
|
|
59867
|
-
if (this._settings.
|
|
59868
|
-
this._settings.
|
|
59946
|
+
if (this._settings.backgroundBlur === value) return;
|
|
59947
|
+
this._settings.backgroundBlur = value;
|
|
59869
59948
|
this._updateLighting = true;
|
|
59870
59949
|
this.requestSettingsUpdate();
|
|
59871
59950
|
}
|
|
59872
59951
|
/**
|
|
59873
59952
|
* Sets the background color
|
|
59874
|
-
* @param value - New background color as
|
|
59953
|
+
* @param value - New background color as THREE.Color
|
|
59875
59954
|
*/
|
|
59876
59955
|
set backgroundColor(value) {
|
|
59877
|
-
|
|
59878
|
-
if (this._settings.backgroundColor.equals(
|
|
59879
|
-
this._settings.backgroundColor =
|
|
59956
|
+
const color = RGBAfromThree(value, 1);
|
|
59957
|
+
if (this._settings.backgroundColor.equals(color)) return;
|
|
59958
|
+
this._settings.backgroundColor = color;
|
|
59880
59959
|
this._updateLighting = true;
|
|
59881
59960
|
this.requestSettingsUpdate();
|
|
59882
59961
|
}
|
|
59883
59962
|
getBoundingBox() {
|
|
59884
|
-
return this._rpc.
|
|
59963
|
+
return this._rpc.RPCGetAABBForScene();
|
|
59885
59964
|
}
|
|
59886
59965
|
/**
|
|
59887
59966
|
* Requests an update to be performed on the next animation frame.
|
|
@@ -59896,7 +59975,10 @@ class Renderer2 {
|
|
|
59896
59975
|
}
|
|
59897
59976
|
async applySettings() {
|
|
59898
59977
|
if (this._updateLighting) await this._rpc.RPCSetLighting(this._settings);
|
|
59899
|
-
if (this._updateGhostColor)
|
|
59978
|
+
if (this._updateGhostColor) {
|
|
59979
|
+
const color = RGBAfromThree(this._settings.ghostColor, this._settings.ghostOpacity);
|
|
59980
|
+
await this._rpc.RPCSetGhostColor(color);
|
|
59981
|
+
}
|
|
59900
59982
|
this._updateLighting = false;
|
|
59901
59983
|
this._updateGhostColor = false;
|
|
59902
59984
|
this._animationFrame = void 0;
|
|
@@ -59996,7 +60078,7 @@ class SectionBox2 {
|
|
|
59996
60078
|
* Fits the given box, invalid dimensions will be reversed.
|
|
59997
60079
|
* @param box - The new bounding box.
|
|
59998
60080
|
*/
|
|
59999
|
-
|
|
60081
|
+
setBox(box) {
|
|
60000
60082
|
box = safeBox(box);
|
|
60001
60083
|
this._box = box;
|
|
60002
60084
|
this.scheduleUpdate();
|
|
@@ -60020,7 +60102,7 @@ var VisibilityState$1 = /* @__PURE__ */ ((VisibilityState2) => {
|
|
|
60020
60102
|
VisibilityState2[VisibilityState2["GHOSTED_HIGHLIGHTED"] = 18] = "GHOSTED_HIGHLIGHTED";
|
|
60021
60103
|
return VisibilityState2;
|
|
60022
60104
|
})(VisibilityState$1 || {});
|
|
60023
|
-
class
|
|
60105
|
+
class VisibilitySynchronizer {
|
|
60024
60106
|
/**
|
|
60025
60107
|
* Creates a new StateSynchronizer instance.
|
|
60026
60108
|
*
|
|
@@ -60038,7 +60120,7 @@ class StateSynchronizer {
|
|
|
60038
60120
|
__publicField(this, "_onUpdate");
|
|
60039
60121
|
__publicField(this, "_isConnected");
|
|
60040
60122
|
__publicField(this, "_animationFrame");
|
|
60041
|
-
this._tracker = new
|
|
60123
|
+
this._tracker = new VisibilityTracker(defaultState);
|
|
60042
60124
|
this._rpc = rpc;
|
|
60043
60125
|
this._onUpdate = onUpdate;
|
|
60044
60126
|
this._getHandle = getHandle;
|
|
@@ -60087,7 +60169,7 @@ class StateSynchronizer {
|
|
|
60087
60169
|
* @param elementIndex - The element index to update
|
|
60088
60170
|
* @param state - The new state to apply
|
|
60089
60171
|
*/
|
|
60090
|
-
|
|
60172
|
+
setStateForElement(elementIndex, state) {
|
|
60091
60173
|
this._tracker.setState(elementIndex, state);
|
|
60092
60174
|
this.scheduleUpdate();
|
|
60093
60175
|
}
|
|
@@ -60151,7 +60233,7 @@ class StateSynchronizer {
|
|
|
60151
60233
|
this._onUpdate();
|
|
60152
60234
|
}
|
|
60153
60235
|
}
|
|
60154
|
-
class
|
|
60236
|
+
class VisibilityTracker {
|
|
60155
60237
|
/**
|
|
60156
60238
|
* Creates a new StateTracker instance.
|
|
60157
60239
|
*
|
|
@@ -60788,7 +60870,7 @@ class Element3D2 {
|
|
|
60788
60870
|
return this.vim.visibility.getElementState(this.element);
|
|
60789
60871
|
}
|
|
60790
60872
|
set state(state) {
|
|
60791
|
-
this.vim.visibility.
|
|
60873
|
+
this.vim.visibility.setStateForElement(this.element, state);
|
|
60792
60874
|
}
|
|
60793
60875
|
/**
|
|
60794
60876
|
* Gets or sets the color override of the element.
|
|
@@ -60805,11 +60887,12 @@ class Element3D2 {
|
|
|
60805
60887
|
* @returns A promise resolving to the element's bounding box.
|
|
60806
60888
|
*/
|
|
60807
60889
|
async getBoundingBox() {
|
|
60808
|
-
return this.vim.
|
|
60890
|
+
return this.vim.getBoundingBoxForElements([this.element]);
|
|
60809
60891
|
}
|
|
60810
60892
|
}
|
|
60811
60893
|
class Vim2 {
|
|
60812
60894
|
constructor(rpc, color, renderer, source, logger) {
|
|
60895
|
+
__publicField(this, "type", "ultra");
|
|
60813
60896
|
__publicField(this, "source");
|
|
60814
60897
|
__publicField(this, "_handle", -1);
|
|
60815
60898
|
__publicField(this, "_request");
|
|
@@ -60818,19 +60901,21 @@ class Vim2 {
|
|
|
60818
60901
|
__publicField(this, "_renderer");
|
|
60819
60902
|
__publicField(this, "_logger");
|
|
60820
60903
|
// The StateSynchronizer wraps a StateTracker and handles RPC synchronization.
|
|
60904
|
+
// Should be private
|
|
60821
60905
|
__publicField(this, "visibility");
|
|
60822
60906
|
// Color tracking remains unchanged.
|
|
60823
|
-
__publicField(this, "
|
|
60907
|
+
__publicField(this, "_elementColors", /* @__PURE__ */ new Map());
|
|
60824
60908
|
__publicField(this, "_updatedColors", /* @__PURE__ */ new Set());
|
|
60825
60909
|
// Delayed update flag.
|
|
60826
60910
|
__publicField(this, "_updateScheduled", false);
|
|
60911
|
+
__publicField(this, "_elementCount", 0);
|
|
60827
60912
|
__publicField(this, "_objects", /* @__PURE__ */ new Map());
|
|
60828
60913
|
this._rpc = rpc;
|
|
60829
60914
|
this.source = source;
|
|
60830
60915
|
this._colors = color;
|
|
60831
60916
|
this._renderer = renderer;
|
|
60832
60917
|
this._logger = logger;
|
|
60833
|
-
this.visibility = new
|
|
60918
|
+
this.visibility = new VisibilitySynchronizer(
|
|
60834
60919
|
this._rpc,
|
|
60835
60920
|
() => this._handle,
|
|
60836
60921
|
() => this.connected,
|
|
@@ -60839,6 +60924,7 @@ class Vim2 {
|
|
|
60839
60924
|
// default state
|
|
60840
60925
|
);
|
|
60841
60926
|
}
|
|
60927
|
+
//TODO: Rename this to getElementFromNode, prefer using element instead
|
|
60842
60928
|
getElement(elementIndex) {
|
|
60843
60929
|
if (this._objects.has(elementIndex)) {
|
|
60844
60930
|
return this._objects.get(elementIndex);
|
|
@@ -60851,13 +60937,16 @@ class Vim2 {
|
|
|
60851
60937
|
throw new Error("Method not implemented.");
|
|
60852
60938
|
}
|
|
60853
60939
|
getElementFromIndex(element) {
|
|
60854
|
-
|
|
60940
|
+
return this.getElement(element);
|
|
60855
60941
|
}
|
|
60856
60942
|
getObjectsInBox(box) {
|
|
60857
60943
|
throw new Error("Method not implemented.");
|
|
60858
60944
|
}
|
|
60859
60945
|
getAllElements() {
|
|
60860
|
-
|
|
60946
|
+
for (var i = 0; i < this._elementCount; i++) {
|
|
60947
|
+
this.getElement(i);
|
|
60948
|
+
}
|
|
60949
|
+
return Array.from(this._objects.values());
|
|
60861
60950
|
}
|
|
60862
60951
|
get handle() {
|
|
60863
60952
|
return this._handle;
|
|
@@ -60888,7 +60977,6 @@ class Vim2 {
|
|
|
60888
60977
|
(_a3 = this._request) == null ? void 0 : _a3.error("cancelled", "The request was cancelled");
|
|
60889
60978
|
this._request = void 0;
|
|
60890
60979
|
if (this.connected) {
|
|
60891
|
-
this._rpc.RPCUnloadVim(this._handle);
|
|
60892
60980
|
this._handle = -1;
|
|
60893
60981
|
}
|
|
60894
60982
|
}
|
|
@@ -60910,12 +60998,12 @@ class Vim2 {
|
|
|
60910
60998
|
case VimLoadingStatus.FailedToDownload:
|
|
60911
60999
|
case VimLoadingStatus.FailedToLoad:
|
|
60912
61000
|
case VimLoadingStatus.Unknown:
|
|
60913
|
-
this._rpc.RPCUnloadVim(handle);
|
|
60914
61001
|
const details = await this._rpc.RPCGetLastError();
|
|
60915
61002
|
const error = this.getErrorType(state.status);
|
|
60916
61003
|
return result.error(error, details);
|
|
60917
61004
|
case VimLoadingStatus.Done:
|
|
60918
61005
|
this._handle = handle;
|
|
61006
|
+
this._elementCount = await this._rpc.RPCGetElementCountForVim(handle);
|
|
60919
61007
|
return result.success(this);
|
|
60920
61008
|
}
|
|
60921
61009
|
} catch (e) {
|
|
@@ -60955,14 +61043,14 @@ class Vim2 {
|
|
|
60955
61043
|
}
|
|
60956
61044
|
return handle;
|
|
60957
61045
|
}
|
|
60958
|
-
async
|
|
60959
|
-
if (!this.connected ||
|
|
61046
|
+
async getBoundingBoxForElements(elements) {
|
|
61047
|
+
if (!this.connected || elements !== "all" && elements.length === 0) {
|
|
60960
61048
|
return Promise.resolve(void 0);
|
|
60961
61049
|
}
|
|
60962
|
-
if (
|
|
61050
|
+
if (elements === "all") {
|
|
60963
61051
|
return await this._rpc.RPCGetAABBForVim(this._handle);
|
|
60964
61052
|
}
|
|
60965
|
-
return await this._rpc.RPCGetAABBForElements(this._handle,
|
|
61053
|
+
return await this._rpc.RPCGetAABBForElements(this._handle, elements);
|
|
60966
61054
|
}
|
|
60967
61055
|
async getBoundingBox() {
|
|
60968
61056
|
if (!this.connected) {
|
|
@@ -60970,49 +61058,49 @@ class Vim2 {
|
|
|
60970
61058
|
}
|
|
60971
61059
|
return await this._rpc.RPCGetAABBForVim(this._handle);
|
|
60972
61060
|
}
|
|
60973
|
-
getColor(
|
|
60974
|
-
return this.
|
|
61061
|
+
getColor(elementIndex) {
|
|
61062
|
+
return this._elementColors.get(elementIndex);
|
|
60975
61063
|
}
|
|
60976
|
-
async setColor(
|
|
60977
|
-
const colors = new Array(
|
|
60978
|
-
this.applyColor(
|
|
61064
|
+
async setColor(elementIndex, color) {
|
|
61065
|
+
const colors = new Array(elementIndex.length).fill(color);
|
|
61066
|
+
this.applyColor(elementIndex, colors);
|
|
60979
61067
|
}
|
|
60980
|
-
async setColors(
|
|
60981
|
-
if (color.length !==
|
|
60982
|
-
throw new Error("Color and
|
|
61068
|
+
async setColors(elements, color) {
|
|
61069
|
+
if (color.length !== elements.length) {
|
|
61070
|
+
throw new Error("Color and elements length must be equal");
|
|
60983
61071
|
}
|
|
60984
|
-
this.applyColor(
|
|
61072
|
+
this.applyColor(elements, color);
|
|
60985
61073
|
}
|
|
60986
|
-
applyColor(
|
|
61074
|
+
applyColor(elements, color) {
|
|
60987
61075
|
for (let i = 0; i < color.length; i++) {
|
|
60988
61076
|
const c = color[i];
|
|
60989
|
-
const
|
|
61077
|
+
const element = elements[i];
|
|
60990
61078
|
if (c === void 0) {
|
|
60991
|
-
this.
|
|
61079
|
+
this._elementColors.delete(element);
|
|
60992
61080
|
} else {
|
|
60993
|
-
this.
|
|
61081
|
+
this._elementColors.set(element, c);
|
|
60994
61082
|
}
|
|
60995
|
-
this._updatedColors.add(
|
|
61083
|
+
this._updatedColors.add(element);
|
|
60996
61084
|
}
|
|
60997
61085
|
this.scheduleColorUpdate();
|
|
60998
61086
|
}
|
|
60999
|
-
|
|
61000
|
-
|
|
61001
|
-
|
|
61087
|
+
//TODO: Remove and rely on element.color
|
|
61088
|
+
clearColor(elements) {
|
|
61089
|
+
if (elements === "all") {
|
|
61090
|
+
this._elementColors.clear();
|
|
61002
61091
|
} else {
|
|
61003
|
-
|
|
61092
|
+
elements.forEach((n) => this._elementColors.delete(n));
|
|
61004
61093
|
}
|
|
61005
61094
|
if (!this.connected) return;
|
|
61006
|
-
if (
|
|
61007
|
-
this._rpc.
|
|
61095
|
+
if (elements === "all") {
|
|
61096
|
+
this._rpc.RPCClearMaterialOverridesForVim(this._handle);
|
|
61008
61097
|
} else {
|
|
61009
|
-
|
|
61010
|
-
this._rpc.RPCSetMaterialOverrides(this._handle, nodes, ids);
|
|
61098
|
+
this._rpc.RPCClearMaterialOverridesForElements(this._handle, elements);
|
|
61011
61099
|
}
|
|
61012
61100
|
}
|
|
61013
61101
|
reapplyColors() {
|
|
61014
61102
|
this._updatedColors.clear();
|
|
61015
|
-
this.
|
|
61103
|
+
this._elementColors.forEach((c, n) => this._updatedColors.add(n));
|
|
61016
61104
|
this.scheduleColorUpdate();
|
|
61017
61105
|
}
|
|
61018
61106
|
scheduleColorUpdate() {
|
|
@@ -61028,11 +61116,11 @@ class Vim2 {
|
|
|
61028
61116
|
this._renderer.notifySceneUpdated();
|
|
61029
61117
|
}
|
|
61030
61118
|
async updateRemoteColors() {
|
|
61031
|
-
const
|
|
61032
|
-
const colors =
|
|
61119
|
+
const elements = Array.from(this._updatedColors);
|
|
61120
|
+
const colors = elements.map((n) => this._elementColors.get(n));
|
|
61033
61121
|
const remoteColors = await this._colors.getColors(colors);
|
|
61034
61122
|
const colorIds = remoteColors.map((c) => (c == null ? void 0 : c.id) ?? -1);
|
|
61035
|
-
this._rpc.
|
|
61123
|
+
this._rpc.RPCSetMaterialOverridesForElements(this._handle, elements, colorIds);
|
|
61036
61124
|
this._updatedColors.clear();
|
|
61037
61125
|
}
|
|
61038
61126
|
}
|
|
@@ -61110,6 +61198,11 @@ let Viewer$2 = class Viewer2 {
|
|
|
61110
61198
|
* @param logger - Optional logger for logging messages.
|
|
61111
61199
|
*/
|
|
61112
61200
|
constructor(canvas, logger) {
|
|
61201
|
+
/**
|
|
61202
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
61203
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
61204
|
+
*/
|
|
61205
|
+
__publicField(this, "type", "ultra");
|
|
61113
61206
|
__publicField(this, "_decoder");
|
|
61114
61207
|
__publicField(this, "_socketClient");
|
|
61115
61208
|
__publicField(this, "_input");
|
|
@@ -61333,6 +61426,9 @@ let Viewer$2 = class Viewer2 {
|
|
|
61333
61426
|
this._vims.getAll().forEach((vim) => vim.disconnect());
|
|
61334
61427
|
this._vims.clear();
|
|
61335
61428
|
}
|
|
61429
|
+
getElement3Ds() {
|
|
61430
|
+
return this.rpc.RPCGetElementCountForScene();
|
|
61431
|
+
}
|
|
61336
61432
|
/**
|
|
61337
61433
|
* Disposes all resources used by the viewer and disconnects from the server.
|
|
61338
61434
|
*/
|
|
@@ -61354,9 +61450,6 @@ const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
61354
61450
|
INVALID_HANDLE,
|
|
61355
61451
|
InputMode,
|
|
61356
61452
|
MaterialHandles,
|
|
61357
|
-
RGB,
|
|
61358
|
-
RGBA,
|
|
61359
|
-
RGBA32,
|
|
61360
61453
|
Segment,
|
|
61361
61454
|
Viewer: Viewer$2,
|
|
61362
61455
|
VimLoadingStatus,
|
|
@@ -76147,7 +76240,7 @@ function useUltraSectionBox(viewer) {
|
|
|
76147
76240
|
viewer.sectionBox.interactive = b;
|
|
76148
76241
|
},
|
|
76149
76242
|
getBox: () => viewer.sectionBox.getBox(),
|
|
76150
|
-
setBox: (box) => viewer.sectionBox.
|
|
76243
|
+
setBox: (box) => viewer.sectionBox.setBox(box),
|
|
76151
76244
|
onSelectionChanged: viewer.selection.onSelectionChanged,
|
|
76152
76245
|
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76153
76246
|
getSceneBox: () => viewer.renderer.getBoundingBox()
|
|
@@ -76228,6 +76321,7 @@ function createAdapter(viewer) {
|
|
|
76228
76321
|
obj.state = VisibilityState.HIGHLIGHTED;
|
|
76229
76322
|
});
|
|
76230
76323
|
},
|
|
76324
|
+
// TODO: Change this api to use elements
|
|
76231
76325
|
isolate: (instances) => {
|
|
76232
76326
|
hide("all");
|
|
76233
76327
|
viewer.selection.getAll().forEach((obj) => {
|
|
@@ -76261,11 +76355,9 @@ function createAdapter(viewer) {
|
|
|
76261
76355
|
}
|
|
76262
76356
|
}
|
|
76263
76357
|
},
|
|
76264
|
-
getGhostOpacity: () => viewer.renderer.
|
|
76358
|
+
getGhostOpacity: () => viewer.renderer.ghostOpacity,
|
|
76265
76359
|
setGhostOpacity: (opacity) => {
|
|
76266
|
-
|
|
76267
|
-
c.a = opacity;
|
|
76268
|
-
viewer.renderer.ghostColor = c;
|
|
76360
|
+
viewer.renderer.ghostOpacity = opacity;
|
|
76269
76361
|
},
|
|
76270
76362
|
getShowRooms: () => true,
|
|
76271
76363
|
setShowRooms: (show) => {
|