vim-web 0.5.0-dev.1 → 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 +4 -4
- 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.iife.js
CHANGED
|
@@ -46785,6 +46785,11 @@ void main() {
|
|
|
46785
46785
|
* @param {boolean} isLegacy - Indicates whether the Vim object uses a legacy loading pipeline.
|
|
46786
46786
|
*/
|
|
46787
46787
|
constructor(header, document2, g3d2, scene, settings2, map, builder, source, format) {
|
|
46788
|
+
/**
|
|
46789
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
46790
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
46791
|
+
*/
|
|
46792
|
+
__publicField(this, "type", "webgl");
|
|
46788
46793
|
/**
|
|
46789
46794
|
* Indicates whether the vim was opened from a vim or vimx file.
|
|
46790
46795
|
*/
|
|
@@ -50841,6 +50846,164 @@ void main() {
|
|
|
50841
50846
|
}
|
|
50842
50847
|
return true;
|
|
50843
50848
|
}
|
|
50849
|
+
class Segment {
|
|
50850
|
+
constructor(origin = new Vector3(), target = new Vector3()) {
|
|
50851
|
+
__publicField(this, "origin");
|
|
50852
|
+
__publicField(this, "target");
|
|
50853
|
+
this.origin = origin;
|
|
50854
|
+
this.target = target;
|
|
50855
|
+
}
|
|
50856
|
+
static fromArray(array) {
|
|
50857
|
+
return new Segment(
|
|
50858
|
+
new Vector3(array[0], array[1], array[2]),
|
|
50859
|
+
new Vector3(array[3], array[4], array[5])
|
|
50860
|
+
);
|
|
50861
|
+
}
|
|
50862
|
+
toArray() {
|
|
50863
|
+
return [this.origin.x, this.origin.y, this.origin.z, this.target.x, this.target.y, this.target.z];
|
|
50864
|
+
}
|
|
50865
|
+
isValid() {
|
|
50866
|
+
return !this.origin.equals(this.target);
|
|
50867
|
+
}
|
|
50868
|
+
equals(segment) {
|
|
50869
|
+
return this.origin.equals(segment.origin) && this.target.equals(segment.target);
|
|
50870
|
+
}
|
|
50871
|
+
}
|
|
50872
|
+
class RGBA {
|
|
50873
|
+
constructor(r, g, b, a = 1) {
|
|
50874
|
+
__publicField(this, "r");
|
|
50875
|
+
__publicField(this, "g");
|
|
50876
|
+
__publicField(this, "b");
|
|
50877
|
+
__publicField(this, "a");
|
|
50878
|
+
this.r = r;
|
|
50879
|
+
this.g = g;
|
|
50880
|
+
this.b = b;
|
|
50881
|
+
this.a = a;
|
|
50882
|
+
}
|
|
50883
|
+
static fromThree(color, opacity = 1) {
|
|
50884
|
+
return new RGBA(color.r, color.g, color.b, opacity);
|
|
50885
|
+
}
|
|
50886
|
+
toThree() {
|
|
50887
|
+
return new Color(this.r, this.g, this.b);
|
|
50888
|
+
}
|
|
50889
|
+
clone() {
|
|
50890
|
+
return new RGBA(this.r, this.g, this.b, this.a);
|
|
50891
|
+
}
|
|
50892
|
+
isValid() {
|
|
50893
|
+
return Number.isFinite(this.r) && Number.isFinite(this.g) && Number.isFinite(this.b) && Number.isFinite(this.a);
|
|
50894
|
+
}
|
|
50895
|
+
equals(color) {
|
|
50896
|
+
return this.r === color.r && this.g === color.g && this.b === color.b && this.a === color.a;
|
|
50897
|
+
}
|
|
50898
|
+
static fromString(str) {
|
|
50899
|
+
str = str.trim();
|
|
50900
|
+
if (str.startsWith("(")) {
|
|
50901
|
+
str = str.substring(1);
|
|
50902
|
+
}
|
|
50903
|
+
if (str.endsWith(")")) {
|
|
50904
|
+
str = str.substring(0, str.length - 1);
|
|
50905
|
+
}
|
|
50906
|
+
const parts = str.split(",");
|
|
50907
|
+
if (parts.length < 3 || parts.length > 4) {
|
|
50908
|
+
throw new Error("Invalid color string format. Expected 3 or 4 components.");
|
|
50909
|
+
}
|
|
50910
|
+
const r = parseFloat(parts[0]);
|
|
50911
|
+
const g = parseFloat(parts[1]);
|
|
50912
|
+
const b = parseFloat(parts[2]);
|
|
50913
|
+
const a = parts.length === 4 ? parseFloat(parts[3]) : 1;
|
|
50914
|
+
if ([r, g, b, a].some((n) => isNaN(n))) {
|
|
50915
|
+
throw new Error("Invalid number in color string.");
|
|
50916
|
+
}
|
|
50917
|
+
return new RGBA(r, g, b, a);
|
|
50918
|
+
}
|
|
50919
|
+
}
|
|
50920
|
+
class RGB {
|
|
50921
|
+
constructor(r, g, b) {
|
|
50922
|
+
__publicField(this, "r");
|
|
50923
|
+
__publicField(this, "g");
|
|
50924
|
+
__publicField(this, "b");
|
|
50925
|
+
this.r = r;
|
|
50926
|
+
this.g = g;
|
|
50927
|
+
this.b = b;
|
|
50928
|
+
}
|
|
50929
|
+
}
|
|
50930
|
+
class RGBA32 {
|
|
50931
|
+
constructor(hex) {
|
|
50932
|
+
__publicField(this, "hex");
|
|
50933
|
+
if (!Number.isInteger(hex) || hex < 0 || hex > 4294967295) {
|
|
50934
|
+
throw new Error("Invalid value: must be a 32-bit unsigned integer");
|
|
50935
|
+
}
|
|
50936
|
+
this.hex = hex;
|
|
50937
|
+
}
|
|
50938
|
+
static fromThree(color, opacity = 1) {
|
|
50939
|
+
return this.fromFloats(color.r, color.g, color.b, opacity);
|
|
50940
|
+
}
|
|
50941
|
+
static fromInts(r, g, b, a = 1) {
|
|
50942
|
+
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 || a < 0 || a > 255) {
|
|
50943
|
+
throw new Error("Each RGBA component must be in the range 0-255.");
|
|
50944
|
+
}
|
|
50945
|
+
const hex = r * 2 ** 24 + g * 2 ** 16 + b * 2 ** 8 + a;
|
|
50946
|
+
return new RGBA32(hex);
|
|
50947
|
+
}
|
|
50948
|
+
static fromFloats(r, g, b, a = 1) {
|
|
50949
|
+
return this.fromInts(
|
|
50950
|
+
remap(r, 255),
|
|
50951
|
+
remap(g, 255),
|
|
50952
|
+
remap(b, 255),
|
|
50953
|
+
remap(a, 255)
|
|
50954
|
+
);
|
|
50955
|
+
}
|
|
50956
|
+
static fromString(str) {
|
|
50957
|
+
if (str.startsWith("#")) {
|
|
50958
|
+
str = str.slice(1);
|
|
50959
|
+
}
|
|
50960
|
+
if (str.length === 3 || str.length === 4) {
|
|
50961
|
+
str = str.split("").map((c) => c + c).join("");
|
|
50962
|
+
}
|
|
50963
|
+
let r = 0;
|
|
50964
|
+
let g = 0;
|
|
50965
|
+
let b = 0;
|
|
50966
|
+
let a = 255;
|
|
50967
|
+
if (str.length === 6 || str.length === 8) {
|
|
50968
|
+
r = parseInt(str.slice(0, 2), 16);
|
|
50969
|
+
g = parseInt(str.slice(2, 4), 16);
|
|
50970
|
+
b = parseInt(str.slice(4, 6), 16);
|
|
50971
|
+
if (str.length === 8) {
|
|
50972
|
+
a = parseInt(str.slice(6, 8), 16);
|
|
50973
|
+
}
|
|
50974
|
+
} else {
|
|
50975
|
+
throw new Error("Invalid color string format");
|
|
50976
|
+
}
|
|
50977
|
+
if ([r, g, b, a].some((v) => isNaN(v))) {
|
|
50978
|
+
throw new Error("Invalid color string format");
|
|
50979
|
+
}
|
|
50980
|
+
return this.fromInts(r, g, b, a);
|
|
50981
|
+
}
|
|
50982
|
+
/**
|
|
50983
|
+
* The red component of the color in the range [0-255].
|
|
50984
|
+
*/
|
|
50985
|
+
get r() {
|
|
50986
|
+
return this.hex >>> 24;
|
|
50987
|
+
}
|
|
50988
|
+
/**
|
|
50989
|
+
* The green component of the color in the range [0-255].
|
|
50990
|
+
*/
|
|
50991
|
+
get g() {
|
|
50992
|
+
return this.hex >>> 16 & 255;
|
|
50993
|
+
}
|
|
50994
|
+
/**
|
|
50995
|
+
* The blue component of the color in the range [0-255].
|
|
50996
|
+
*/
|
|
50997
|
+
get b() {
|
|
50998
|
+
return this.hex >>> 8 & 255;
|
|
50999
|
+
}
|
|
51000
|
+
/**
|
|
51001
|
+
* The alpha component of the color in the range [0-255].
|
|
51002
|
+
*/
|
|
51003
|
+
get a() {
|
|
51004
|
+
return this.hex & 255;
|
|
51005
|
+
}
|
|
51006
|
+
}
|
|
50844
51007
|
class Validation {
|
|
50845
51008
|
//= ===========================================================================
|
|
50846
51009
|
// BASIC NUMBER VALIDATIONS
|
|
@@ -50892,16 +51055,16 @@ void main() {
|
|
|
50892
51055
|
//= ===========================================================================
|
|
50893
51056
|
// HANDLE VALIDATIONS
|
|
50894
51057
|
//= ===========================================================================
|
|
50895
|
-
static
|
|
50896
|
-
if (!this.isPositiveInteger(
|
|
50897
|
-
if (
|
|
50898
|
-
console.warn(`Invalid
|
|
51058
|
+
static isIndex(index2) {
|
|
51059
|
+
if (!this.isPositiveInteger(index2)) return false;
|
|
51060
|
+
if (index2 === INVALID_HANDLE) {
|
|
51061
|
+
console.warn(`Invalid index ${index2}. Aborting operation.`);
|
|
50899
51062
|
return false;
|
|
50900
51063
|
}
|
|
50901
51064
|
return true;
|
|
50902
51065
|
}
|
|
50903
|
-
static
|
|
50904
|
-
return
|
|
51066
|
+
static areIndices(indices) {
|
|
51067
|
+
return indices.every((h) => this.isIndex(h));
|
|
50905
51068
|
}
|
|
50906
51069
|
static isMaterialHandle(handle) {
|
|
50907
51070
|
if (!materialHandles.includes(handle)) {
|
|
@@ -50950,23 +51113,6 @@ void main() {
|
|
|
50950
51113
|
return true;
|
|
50951
51114
|
}
|
|
50952
51115
|
//= ===========================================================================
|
|
50953
|
-
// COLOR VALIDATIONS
|
|
50954
|
-
//= ===========================================================================
|
|
50955
|
-
static isRelativeRGBA(color) {
|
|
50956
|
-
if (color.r < 0 || color.r > 1 || color.g < 0 || color.g > 1 || color.b < 0 || color.b > 1) {
|
|
50957
|
-
console.warn("Invalid value: must be a relative color (0-1, 0-1, 0-1)");
|
|
50958
|
-
return false;
|
|
50959
|
-
}
|
|
50960
|
-
return true;
|
|
50961
|
-
}
|
|
50962
|
-
static isRelativeRGB(color) {
|
|
50963
|
-
if (color.r < 0 || color.r > 1 || color.g < 0 || color.g > 1 || color.b < 0 || color.b > 1) {
|
|
50964
|
-
console.warn("Invalid value: must be a relative color (0-1, 0-1, 0-1)");
|
|
50965
|
-
return false;
|
|
50966
|
-
}
|
|
50967
|
-
return true;
|
|
50968
|
-
}
|
|
50969
|
-
//= ===========================================================================
|
|
50970
51116
|
// STRING AND URL VALIDATIONS
|
|
50971
51117
|
//= ===========================================================================
|
|
50972
51118
|
static isNonEmptyString(value) {
|
|
@@ -51053,6 +51199,13 @@ void main() {
|
|
|
51053
51199
|
}
|
|
51054
51200
|
return value;
|
|
51055
51201
|
}
|
|
51202
|
+
static clampColor01(value) {
|
|
51203
|
+
return new Color(
|
|
51204
|
+
this.clamp01(value.r),
|
|
51205
|
+
this.clamp01(value.g),
|
|
51206
|
+
this.clamp01(value.b)
|
|
51207
|
+
);
|
|
51208
|
+
}
|
|
51056
51209
|
static clampRGBA01(value) {
|
|
51057
51210
|
return new RGBA(
|
|
51058
51211
|
this.clamp01(value.r),
|
|
@@ -57009,6 +57162,11 @@ void main() {
|
|
|
57009
57162
|
};
|
|
57010
57163
|
let Viewer$3 = class Viewer {
|
|
57011
57164
|
constructor(settings2) {
|
|
57165
|
+
/**
|
|
57166
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
57167
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
57168
|
+
*/
|
|
57169
|
+
__publicField(this, "type", "webgl");
|
|
57012
57170
|
/**
|
|
57013
57171
|
* The settings configuration used by the viewer.
|
|
57014
57172
|
*/
|
|
@@ -57333,155 +57491,6 @@ void main() {
|
|
|
57333
57491
|
getDefaultVimSettings,
|
|
57334
57492
|
request: requestVim
|
|
57335
57493
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
57336
|
-
class Segment {
|
|
57337
|
-
constructor(origin = new Vector3(), target = new Vector3()) {
|
|
57338
|
-
__publicField(this, "origin");
|
|
57339
|
-
__publicField(this, "target");
|
|
57340
|
-
this.origin = origin;
|
|
57341
|
-
this.target = target;
|
|
57342
|
-
}
|
|
57343
|
-
static fromArray(array) {
|
|
57344
|
-
return new Segment(
|
|
57345
|
-
new Vector3(array[0], array[1], array[2]),
|
|
57346
|
-
new Vector3(array[3], array[4], array[5])
|
|
57347
|
-
);
|
|
57348
|
-
}
|
|
57349
|
-
toArray() {
|
|
57350
|
-
return [this.origin.x, this.origin.y, this.origin.z, this.target.x, this.target.y, this.target.z];
|
|
57351
|
-
}
|
|
57352
|
-
isValid() {
|
|
57353
|
-
return !this.origin.equals(this.target);
|
|
57354
|
-
}
|
|
57355
|
-
equals(segment) {
|
|
57356
|
-
return this.origin.equals(segment.origin) && this.target.equals(segment.target);
|
|
57357
|
-
}
|
|
57358
|
-
}
|
|
57359
|
-
class RGBA {
|
|
57360
|
-
constructor(r, g, b, a = 1) {
|
|
57361
|
-
__publicField(this, "r");
|
|
57362
|
-
__publicField(this, "g");
|
|
57363
|
-
__publicField(this, "b");
|
|
57364
|
-
__publicField(this, "a");
|
|
57365
|
-
this.r = r;
|
|
57366
|
-
this.g = g;
|
|
57367
|
-
this.b = b;
|
|
57368
|
-
this.a = a;
|
|
57369
|
-
}
|
|
57370
|
-
clone() {
|
|
57371
|
-
return new RGBA(this.r, this.g, this.b, this.a);
|
|
57372
|
-
}
|
|
57373
|
-
isValid() {
|
|
57374
|
-
return Number.isFinite(this.r) && Number.isFinite(this.g) && Number.isFinite(this.b) && Number.isFinite(this.a);
|
|
57375
|
-
}
|
|
57376
|
-
equals(color) {
|
|
57377
|
-
return this.r === color.r && this.g === color.g && this.b === color.b && this.a === color.a;
|
|
57378
|
-
}
|
|
57379
|
-
static fromString(str) {
|
|
57380
|
-
str = str.trim();
|
|
57381
|
-
if (str.startsWith("(")) {
|
|
57382
|
-
str = str.substring(1);
|
|
57383
|
-
}
|
|
57384
|
-
if (str.endsWith(")")) {
|
|
57385
|
-
str = str.substring(0, str.length - 1);
|
|
57386
|
-
}
|
|
57387
|
-
const parts = str.split(",");
|
|
57388
|
-
if (parts.length < 3 || parts.length > 4) {
|
|
57389
|
-
throw new Error("Invalid color string format. Expected 3 or 4 components.");
|
|
57390
|
-
}
|
|
57391
|
-
const r = parseFloat(parts[0]);
|
|
57392
|
-
const g = parseFloat(parts[1]);
|
|
57393
|
-
const b = parseFloat(parts[2]);
|
|
57394
|
-
const a = parts.length === 4 ? parseFloat(parts[3]) : 1;
|
|
57395
|
-
if ([r, g, b, a].some((n) => isNaN(n))) {
|
|
57396
|
-
throw new Error("Invalid number in color string.");
|
|
57397
|
-
}
|
|
57398
|
-
return new RGBA(r, g, b, a);
|
|
57399
|
-
}
|
|
57400
|
-
}
|
|
57401
|
-
class RGB {
|
|
57402
|
-
constructor(r, g, b) {
|
|
57403
|
-
__publicField(this, "r");
|
|
57404
|
-
__publicField(this, "g");
|
|
57405
|
-
__publicField(this, "b");
|
|
57406
|
-
this.r = r;
|
|
57407
|
-
this.g = g;
|
|
57408
|
-
this.b = b;
|
|
57409
|
-
}
|
|
57410
|
-
}
|
|
57411
|
-
class RGBA32 {
|
|
57412
|
-
constructor(hex) {
|
|
57413
|
-
__publicField(this, "hex");
|
|
57414
|
-
if (!Number.isInteger(hex) || hex < 0 || hex > 4294967295) {
|
|
57415
|
-
throw new Error("Invalid value: must be a 32-bit unsigned integer");
|
|
57416
|
-
}
|
|
57417
|
-
this.hex = hex;
|
|
57418
|
-
}
|
|
57419
|
-
static fromInts(r, g, b, a = 1) {
|
|
57420
|
-
if (r < 0 || r > 255 || g < 0 || g > 255 || b < 0 || b > 255 || a < 0 || a > 255) {
|
|
57421
|
-
throw new Error("Each RGBA component must be in the range 0-255.");
|
|
57422
|
-
}
|
|
57423
|
-
const hex = r * 2 ** 24 + g * 2 ** 16 + b * 2 ** 8 + a;
|
|
57424
|
-
return new RGBA32(hex);
|
|
57425
|
-
}
|
|
57426
|
-
static fromFloats(r, g, b, a = 1) {
|
|
57427
|
-
return this.fromInts(
|
|
57428
|
-
remap(r, 255),
|
|
57429
|
-
remap(g, 255),
|
|
57430
|
-
remap(b, 255),
|
|
57431
|
-
remap(a, 255)
|
|
57432
|
-
);
|
|
57433
|
-
}
|
|
57434
|
-
static fromString(str) {
|
|
57435
|
-
if (str.startsWith("#")) {
|
|
57436
|
-
str = str.slice(1);
|
|
57437
|
-
}
|
|
57438
|
-
if (str.length === 3 || str.length === 4) {
|
|
57439
|
-
str = str.split("").map((c) => c + c).join("");
|
|
57440
|
-
}
|
|
57441
|
-
let r = 0;
|
|
57442
|
-
let g = 0;
|
|
57443
|
-
let b = 0;
|
|
57444
|
-
let a = 255;
|
|
57445
|
-
if (str.length === 6 || str.length === 8) {
|
|
57446
|
-
r = parseInt(str.slice(0, 2), 16);
|
|
57447
|
-
g = parseInt(str.slice(2, 4), 16);
|
|
57448
|
-
b = parseInt(str.slice(4, 6), 16);
|
|
57449
|
-
if (str.length === 8) {
|
|
57450
|
-
a = parseInt(str.slice(6, 8), 16);
|
|
57451
|
-
}
|
|
57452
|
-
} else {
|
|
57453
|
-
throw new Error("Invalid color string format");
|
|
57454
|
-
}
|
|
57455
|
-
if ([r, g, b, a].some((v) => isNaN(v))) {
|
|
57456
|
-
throw new Error("Invalid color string format");
|
|
57457
|
-
}
|
|
57458
|
-
return this.fromInts(r, g, b, a);
|
|
57459
|
-
}
|
|
57460
|
-
/**
|
|
57461
|
-
* The red component of the color in the range [0-255].
|
|
57462
|
-
*/
|
|
57463
|
-
get r() {
|
|
57464
|
-
return this.hex >>> 24;
|
|
57465
|
-
}
|
|
57466
|
-
/**
|
|
57467
|
-
* The green component of the color in the range [0-255].
|
|
57468
|
-
*/
|
|
57469
|
-
get g() {
|
|
57470
|
-
return this.hex >>> 16 & 255;
|
|
57471
|
-
}
|
|
57472
|
-
/**
|
|
57473
|
-
* The blue component of the color in the range [0-255].
|
|
57474
|
-
*/
|
|
57475
|
-
get b() {
|
|
57476
|
-
return this.hex >>> 8 & 255;
|
|
57477
|
-
}
|
|
57478
|
-
/**
|
|
57479
|
-
* The alpha component of the color in the range [0-255].
|
|
57480
|
-
*/
|
|
57481
|
-
get a() {
|
|
57482
|
-
return this.hex & 255;
|
|
57483
|
-
}
|
|
57484
|
-
}
|
|
57485
57494
|
class Camera {
|
|
57486
57495
|
/**
|
|
57487
57496
|
* Creates a new Camera instance
|
|
@@ -57545,7 +57554,7 @@ void main() {
|
|
|
57545
57554
|
* @returns Promise that resolves when the framing animation is complete
|
|
57546
57555
|
*/
|
|
57547
57556
|
async frameAll(blendTime = this._defaultBlendTime) {
|
|
57548
|
-
const segment = await this._rpc.
|
|
57557
|
+
const segment = await this._rpc.RPCFrameScene(blendTime);
|
|
57549
57558
|
this._savedPosition = this._savedPosition ?? segment;
|
|
57550
57559
|
return segment;
|
|
57551
57560
|
}
|
|
@@ -57562,16 +57571,16 @@ void main() {
|
|
|
57562
57571
|
/**
|
|
57563
57572
|
* Frames specific nodes of a Vim model in the camera view
|
|
57564
57573
|
* @param vim - The Vim model containing the nodes to frame
|
|
57565
|
-
* @param
|
|
57574
|
+
* @param elements - Array of element indices to frame, or 'all' to frame the entire model
|
|
57566
57575
|
* @param blendTime - Duration of the camera animation in seconds (defaults to 0.5)
|
|
57567
57576
|
* @returns Promise that resolves when the framing animation is complete
|
|
57568
57577
|
*/
|
|
57569
|
-
async frameVim(vim,
|
|
57578
|
+
async frameVim(vim, elements, blendTime = this._defaultBlendTime) {
|
|
57570
57579
|
let segment;
|
|
57571
|
-
if (
|
|
57580
|
+
if (elements === "all") {
|
|
57572
57581
|
segment = await this._rpc.RPCFrameVim(vim.handle, blendTime);
|
|
57573
57582
|
} else {
|
|
57574
|
-
segment = await this._rpc.RPCFrameElements(vim.handle,
|
|
57583
|
+
segment = await this._rpc.RPCFrameElements(vim.handle, elements, blendTime);
|
|
57575
57584
|
}
|
|
57576
57585
|
this._savedPosition = this._savedPosition ?? segment;
|
|
57577
57586
|
return segment;
|
|
@@ -57654,9 +57663,9 @@ void main() {
|
|
|
57654
57663
|
// -------------------- HitCheckResult -------------------
|
|
57655
57664
|
writeHitCheckResult(data2) {
|
|
57656
57665
|
this.ensureCapacity(4 + 4 + 4 + 4 * 3 + 4 * 3);
|
|
57657
|
-
this.writeUInt(data2.
|
|
57658
|
-
this.writeUInt(data2.
|
|
57659
|
-
this.writeUInt(data2.
|
|
57666
|
+
this.writeUInt(data2.vimIndex);
|
|
57667
|
+
this.writeUInt(data2.vimElementIndex);
|
|
57668
|
+
this.writeUInt(data2.sceneElementIndex);
|
|
57660
57669
|
this.writeVector3(data2.worldPosition);
|
|
57661
57670
|
this.writeVector3(data2.worldNormal);
|
|
57662
57671
|
}
|
|
@@ -57804,15 +57813,15 @@ void main() {
|
|
|
57804
57813
|
return textDecoder.decode(stringData);
|
|
57805
57814
|
}
|
|
57806
57815
|
readHitCheckResult() {
|
|
57807
|
-
const
|
|
57808
|
-
const
|
|
57809
|
-
const
|
|
57816
|
+
const vimIndex = this.readUInt();
|
|
57817
|
+
const vimElementIndex = this.readUInt();
|
|
57818
|
+
const sceneElementIndex = this.readUInt();
|
|
57810
57819
|
const worldPosition = this.readVector3();
|
|
57811
57820
|
const worldNormal = this.readVector3();
|
|
57812
57821
|
return {
|
|
57813
|
-
|
|
57814
|
-
|
|
57815
|
-
|
|
57822
|
+
vimIndex,
|
|
57823
|
+
vimElementIndex,
|
|
57824
|
+
sceneElementIndex,
|
|
57816
57825
|
worldPosition,
|
|
57817
57826
|
worldNormal
|
|
57818
57827
|
};
|
|
@@ -57944,10 +57953,22 @@ void main() {
|
|
|
57944
57953
|
get url() {
|
|
57945
57954
|
return this._socket.url;
|
|
57946
57955
|
}
|
|
57947
|
-
|
|
57956
|
+
RPCClearMaterialOverridesForElements(vimIndex, elementIndices) {
|
|
57948
57957
|
const marshal = new Marshal();
|
|
57949
|
-
marshal.writeString("
|
|
57950
|
-
marshal.writeUInt(
|
|
57958
|
+
marshal.writeString("RPCClearMaterialOverridesForElements");
|
|
57959
|
+
marshal.writeUInt(vimIndex);
|
|
57960
|
+
marshal.writeArrayOfUInt(elementIndices);
|
|
57961
|
+
this._socket.sendRPC(marshal);
|
|
57962
|
+
}
|
|
57963
|
+
RPCClearMaterialOverridesForScene() {
|
|
57964
|
+
const marshal = new Marshal();
|
|
57965
|
+
marshal.writeString("RPCClearMaterialOverridesForScene");
|
|
57966
|
+
this._socket.sendRPC(marshal);
|
|
57967
|
+
}
|
|
57968
|
+
RPCClearMaterialOverridesForVim(vimIndex) {
|
|
57969
|
+
const marshal = new Marshal();
|
|
57970
|
+
marshal.writeString("RPCClearMaterialOverridesForVim");
|
|
57971
|
+
marshal.writeUInt(vimIndex);
|
|
57951
57972
|
this._socket.sendRPC(marshal);
|
|
57952
57973
|
}
|
|
57953
57974
|
async RPCCreateMaterialInstances(materialHandle, smoothness, colors) {
|
|
@@ -57970,10 +57991,10 @@ void main() {
|
|
|
57970
57991
|
const ret = returnMarshal.readUInt();
|
|
57971
57992
|
return ret;
|
|
57972
57993
|
}
|
|
57973
|
-
RPCDestroyMaterialInstances(
|
|
57994
|
+
RPCDestroyMaterialInstances(materialInstanceHandles) {
|
|
57974
57995
|
const marshal = new Marshal();
|
|
57975
57996
|
marshal.writeString("RPCDestroyMaterialInstances");
|
|
57976
|
-
marshal.writeArrayOfUInt(
|
|
57997
|
+
marshal.writeArrayOfUInt(materialInstanceHandles);
|
|
57977
57998
|
this._socket.sendRPC(marshal);
|
|
57978
57999
|
}
|
|
57979
58000
|
RPCDestroyText(componentHandle) {
|
|
@@ -57997,53 +58018,53 @@ void main() {
|
|
|
57997
58018
|
const ret = returnMarshal.readSegment();
|
|
57998
58019
|
return ret;
|
|
57999
58020
|
}
|
|
58000
|
-
async
|
|
58021
|
+
async RPCFrameElements(vimIndex, elementIndices, blendTime) {
|
|
58001
58022
|
const marshal = new Marshal();
|
|
58002
|
-
marshal.writeString("
|
|
58023
|
+
marshal.writeString("RPCFrameElements");
|
|
58024
|
+
marshal.writeUInt(vimIndex);
|
|
58025
|
+
marshal.writeArrayOfUInt(elementIndices);
|
|
58003
58026
|
marshal.writeFloat(blendTime);
|
|
58004
58027
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58005
58028
|
const ret = returnMarshal.readSegment();
|
|
58006
58029
|
return ret;
|
|
58007
58030
|
}
|
|
58008
|
-
async
|
|
58031
|
+
async RPCFrameScene(blendTime) {
|
|
58009
58032
|
const marshal = new Marshal();
|
|
58010
|
-
marshal.writeString("
|
|
58011
|
-
marshal.writeUInt(componentHandle);
|
|
58012
|
-
marshal.writeArrayOfUInt(elementIndices);
|
|
58033
|
+
marshal.writeString("RPCFrameScene");
|
|
58013
58034
|
marshal.writeFloat(blendTime);
|
|
58014
58035
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58015
58036
|
const ret = returnMarshal.readSegment();
|
|
58016
58037
|
return ret;
|
|
58017
58038
|
}
|
|
58018
|
-
async RPCFrameVim(
|
|
58039
|
+
async RPCFrameVim(vimIndex, blendTime) {
|
|
58019
58040
|
const marshal = new Marshal();
|
|
58020
58041
|
marshal.writeString("RPCFrameVim");
|
|
58021
|
-
marshal.writeUInt(
|
|
58042
|
+
marshal.writeUInt(vimIndex);
|
|
58022
58043
|
marshal.writeFloat(blendTime);
|
|
58023
58044
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58024
58045
|
const ret = returnMarshal.readSegment();
|
|
58025
58046
|
return ret;
|
|
58026
58047
|
}
|
|
58027
|
-
async
|
|
58048
|
+
async RPCGetAABBForElements(vimIndex, elementIndices) {
|
|
58028
58049
|
const marshal = new Marshal();
|
|
58029
|
-
marshal.writeString("
|
|
58050
|
+
marshal.writeString("RPCGetAABBForElements");
|
|
58051
|
+
marshal.writeUInt(vimIndex);
|
|
58052
|
+
marshal.writeArrayOfUInt(elementIndices);
|
|
58030
58053
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58031
58054
|
const ret = returnMarshal.readBox3();
|
|
58032
58055
|
return ret;
|
|
58033
58056
|
}
|
|
58034
|
-
async
|
|
58057
|
+
async RPCGetAABBForScene() {
|
|
58035
58058
|
const marshal = new Marshal();
|
|
58036
|
-
marshal.writeString("
|
|
58037
|
-
marshal.writeUInt(componentHandle);
|
|
58038
|
-
marshal.writeArrayOfUInt(elementIndices);
|
|
58059
|
+
marshal.writeString("RPCGetAABBForScene");
|
|
58039
58060
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58040
58061
|
const ret = returnMarshal.readBox3();
|
|
58041
58062
|
return ret;
|
|
58042
58063
|
}
|
|
58043
|
-
async RPCGetAABBForVim(
|
|
58064
|
+
async RPCGetAABBForVim(vimIndex) {
|
|
58044
58065
|
const marshal = new Marshal();
|
|
58045
58066
|
marshal.writeString("RPCGetAABBForVim");
|
|
58046
|
-
marshal.writeUInt(
|
|
58067
|
+
marshal.writeUInt(vimIndex);
|
|
58047
58068
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58048
58069
|
const ret = returnMarshal.readBox3();
|
|
58049
58070
|
return ret;
|
|
@@ -58055,25 +58076,32 @@ void main() {
|
|
|
58055
58076
|
const ret = returnMarshal.readString();
|
|
58056
58077
|
return ret;
|
|
58057
58078
|
}
|
|
58058
|
-
async
|
|
58079
|
+
async RPCGetCameraPose() {
|
|
58059
58080
|
const marshal = new Marshal();
|
|
58060
|
-
marshal.writeString("
|
|
58081
|
+
marshal.writeString("RPCGetCameraPose");
|
|
58061
58082
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58062
58083
|
const ret = returnMarshal.readSegment();
|
|
58063
58084
|
return ret;
|
|
58064
58085
|
}
|
|
58065
|
-
async
|
|
58086
|
+
async RPCGetElementCountForScene() {
|
|
58066
58087
|
const marshal = new Marshal();
|
|
58067
|
-
marshal.writeString("
|
|
58068
|
-
marshal.writeUInt(componentHandle);
|
|
58088
|
+
marshal.writeString("RPCGetElementCountForScene");
|
|
58069
58089
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58070
58090
|
const ret = returnMarshal.readUInt();
|
|
58071
58091
|
return ret;
|
|
58072
58092
|
}
|
|
58073
|
-
async
|
|
58093
|
+
async RPCGetElementCountForVim(vimIndex) {
|
|
58094
|
+
const marshal = new Marshal();
|
|
58095
|
+
marshal.writeString("RPCGetElementCountForVim");
|
|
58096
|
+
marshal.writeUInt(vimIndex);
|
|
58097
|
+
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58098
|
+
const ret = returnMarshal.readUInt();
|
|
58099
|
+
return ret;
|
|
58100
|
+
}
|
|
58101
|
+
async RPCGetElementIds(vimIndex) {
|
|
58074
58102
|
const marshal = new Marshal();
|
|
58075
58103
|
marshal.writeString("RPCGetElementIds");
|
|
58076
|
-
marshal.writeUInt(
|
|
58104
|
+
marshal.writeUInt(vimIndex);
|
|
58077
58105
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58078
58106
|
const ret = returnMarshal.readArrayOfUInt64();
|
|
58079
58107
|
return ret;
|
|
@@ -58085,10 +58113,10 @@ void main() {
|
|
|
58085
58113
|
const ret = returnMarshal.readString();
|
|
58086
58114
|
return ret;
|
|
58087
58115
|
}
|
|
58088
|
-
async RPCGetRoomElements(
|
|
58116
|
+
async RPCGetRoomElements(vimIndex) {
|
|
58089
58117
|
const marshal = new Marshal();
|
|
58090
58118
|
marshal.writeString("RPCGetRoomElements");
|
|
58091
|
-
marshal.writeUInt(
|
|
58119
|
+
marshal.writeUInt(vimIndex);
|
|
58092
58120
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58093
58121
|
const ret = returnMarshal.readArrayOfUInt();
|
|
58094
58122
|
return ret;
|
|
@@ -58100,10 +58128,10 @@ void main() {
|
|
|
58100
58128
|
const ret = returnMarshal.readSectionBoxState();
|
|
58101
58129
|
return ret;
|
|
58102
58130
|
}
|
|
58103
|
-
async RPCGetVimLoadingState(
|
|
58131
|
+
async RPCGetVimLoadingState(vimIndex) {
|
|
58104
58132
|
const marshal = new Marshal();
|
|
58105
58133
|
marshal.writeString("RPCGetVimLoadingState");
|
|
58106
|
-
marshal.writeUInt(
|
|
58134
|
+
marshal.writeUInt(vimIndex);
|
|
58107
58135
|
const returnMarshal = await this._socket.sendRPCWithReturn(marshal);
|
|
58108
58136
|
const ret = returnMarshal.readVimStatus();
|
|
58109
58137
|
return ret;
|
|
@@ -58193,6 +58221,13 @@ void main() {
|
|
|
58193
58221
|
marshal.writeBoolean(orbit2);
|
|
58194
58222
|
this._socket.sendRPC(marshal);
|
|
58195
58223
|
}
|
|
58224
|
+
RPCSetCameraPose(state, blendTime) {
|
|
58225
|
+
const marshal = new Marshal();
|
|
58226
|
+
marshal.writeString("RPCSetCameraPose");
|
|
58227
|
+
marshal.writeSegment(state);
|
|
58228
|
+
marshal.writeFloat(blendTime);
|
|
58229
|
+
this._socket.sendRPC(marshal);
|
|
58230
|
+
}
|
|
58196
58231
|
RPCSetCameraPosition(position, blendTime) {
|
|
58197
58232
|
const marshal = new Marshal();
|
|
58198
58233
|
marshal.writeString("RPCSetCameraPosition");
|
|
@@ -58213,13 +58248,6 @@ void main() {
|
|
|
58213
58248
|
marshal.writeFloat(blendTime);
|
|
58214
58249
|
this._socket.sendRPC(marshal);
|
|
58215
58250
|
}
|
|
58216
|
-
RPCSetCameraView(state, blendTime) {
|
|
58217
|
-
const marshal = new Marshal();
|
|
58218
|
-
marshal.writeString("RPCSetCameraView");
|
|
58219
|
-
marshal.writeSegment(state);
|
|
58220
|
-
marshal.writeFloat(blendTime);
|
|
58221
|
-
this._socket.sendRPC(marshal);
|
|
58222
|
-
}
|
|
58223
58251
|
RPCSetGhostColor(ghostColor) {
|
|
58224
58252
|
const marshal = new Marshal();
|
|
58225
58253
|
marshal.writeString("RPCSetGhostColor");
|
|
@@ -58237,10 +58265,10 @@ void main() {
|
|
|
58237
58265
|
marshal.writeRGBA(backgroundColor);
|
|
58238
58266
|
this._socket.sendRPC(marshal);
|
|
58239
58267
|
}
|
|
58240
|
-
|
|
58268
|
+
RPCSetMaterialOverridesForElements(vimIndex, elementIndices, materialInstanceHandles) {
|
|
58241
58269
|
const marshal = new Marshal();
|
|
58242
|
-
marshal.writeString("
|
|
58243
|
-
marshal.writeUInt(
|
|
58270
|
+
marshal.writeString("RPCSetMaterialOverridesForElements");
|
|
58271
|
+
marshal.writeUInt(vimIndex);
|
|
58244
58272
|
marshal.writeArrayOfUInt(elementIndices);
|
|
58245
58273
|
marshal.writeArrayOfUInt(materialInstanceHandles);
|
|
58246
58274
|
this._socket.sendRPC(marshal);
|
|
@@ -58251,25 +58279,31 @@ void main() {
|
|
|
58251
58279
|
marshal.writeSectionBoxState(state);
|
|
58252
58280
|
this._socket.sendRPC(marshal);
|
|
58253
58281
|
}
|
|
58254
|
-
|
|
58282
|
+
RPCSetStateElements(vimIndex, elementIndices, state) {
|
|
58255
58283
|
const marshal = new Marshal();
|
|
58256
|
-
marshal.writeString("
|
|
58257
|
-
marshal.writeUInt(
|
|
58284
|
+
marshal.writeString("RPCSetStateElements");
|
|
58285
|
+
marshal.writeUInt(vimIndex);
|
|
58286
|
+
marshal.writeArrayOfUInt(elementIndices);
|
|
58258
58287
|
marshal.writeUInt(state);
|
|
58259
58288
|
this._socket.sendRPC(marshal);
|
|
58260
58289
|
}
|
|
58261
|
-
|
|
58290
|
+
RPCSetStateScene(state) {
|
|
58262
58291
|
const marshal = new Marshal();
|
|
58263
|
-
marshal.writeString("
|
|
58264
|
-
marshal.writeUInt(componentHandle);
|
|
58265
|
-
marshal.writeArrayOfUInt(elementIndices);
|
|
58292
|
+
marshal.writeString("RPCSetStateScene");
|
|
58266
58293
|
marshal.writeUInt(state);
|
|
58267
58294
|
this._socket.sendRPC(marshal);
|
|
58268
58295
|
}
|
|
58269
|
-
|
|
58296
|
+
RPCSetStateVim(vimIndex, state) {
|
|
58297
|
+
const marshal = new Marshal();
|
|
58298
|
+
marshal.writeString("RPCSetStateVim");
|
|
58299
|
+
marshal.writeUInt(vimIndex);
|
|
58300
|
+
marshal.writeUInt(state);
|
|
58301
|
+
this._socket.sendRPC(marshal);
|
|
58302
|
+
}
|
|
58303
|
+
RPCSetStatesElements(vimIndex, elementIndices, states) {
|
|
58270
58304
|
const marshal = new Marshal();
|
|
58271
58305
|
marshal.writeString("RPCSetStatesElements");
|
|
58272
|
-
marshal.writeUInt(
|
|
58306
|
+
marshal.writeUInt(vimIndex);
|
|
58273
58307
|
marshal.writeArrayOfUInt(elementIndices);
|
|
58274
58308
|
marshal.writeArrayOfUInt(states);
|
|
58275
58309
|
this._socket.sendRPC(marshal);
|
|
@@ -58297,12 +58331,6 @@ void main() {
|
|
|
58297
58331
|
marshal.writeString("RPCUnloadAll");
|
|
58298
58332
|
this._socket.sendRPC(marshal);
|
|
58299
58333
|
}
|
|
58300
|
-
RPCUnloadVim(componentHandle) {
|
|
58301
|
-
const marshal = new Marshal();
|
|
58302
|
-
marshal.writeString("RPCUnloadVim");
|
|
58303
|
-
marshal.writeUInt(componentHandle);
|
|
58304
|
-
this._socket.sendRPC(marshal);
|
|
58305
|
-
}
|
|
58306
58334
|
}
|
|
58307
58335
|
class RemoteColor {
|
|
58308
58336
|
/**
|
|
@@ -58334,35 +58362,7 @@ void main() {
|
|
|
58334
58362
|
* @returns {number} The color value as a hexadecimal number.
|
|
58335
58363
|
*/
|
|
58336
58364
|
get hex() {
|
|
58337
|
-
return this.color.
|
|
58338
|
-
}
|
|
58339
|
-
/**
|
|
58340
|
-
* Gets the red component of the color.
|
|
58341
|
-
* @returns {number} The red component value in the range [0-255].
|
|
58342
|
-
*/
|
|
58343
|
-
get r() {
|
|
58344
|
-
return this.color.r;
|
|
58345
|
-
}
|
|
58346
|
-
/**
|
|
58347
|
-
* Gets the green component of the color.
|
|
58348
|
-
* @returns {number} The green component value in the range [0-255].
|
|
58349
|
-
*/
|
|
58350
|
-
get g() {
|
|
58351
|
-
return this.color.g;
|
|
58352
|
-
}
|
|
58353
|
-
/**
|
|
58354
|
-
* Gets the blue component of the color.
|
|
58355
|
-
* @returns {number} The blue component value in the range [0-255].
|
|
58356
|
-
*/
|
|
58357
|
-
get b() {
|
|
58358
|
-
return this.color.b;
|
|
58359
|
-
}
|
|
58360
|
-
/**
|
|
58361
|
-
* Gets the alpha (opacity) component of the color.
|
|
58362
|
-
* @returns {number} The alpha component value in the range [0-255].
|
|
58363
|
-
*/
|
|
58364
|
-
get a() {
|
|
58365
|
-
return this.color.a;
|
|
58365
|
+
return this.color.getHex();
|
|
58366
58366
|
}
|
|
58367
58367
|
/**
|
|
58368
58368
|
* Disposes of the color handle and releases associated resources.
|
|
@@ -58375,6 +58375,12 @@ void main() {
|
|
|
58375
58375
|
this._disposed = true;
|
|
58376
58376
|
}
|
|
58377
58377
|
}
|
|
58378
|
+
function RGBAfromThree(color, opacity = 1) {
|
|
58379
|
+
return new RGBA(color.r, color.g, color.b, opacity);
|
|
58380
|
+
}
|
|
58381
|
+
function RGBA32fromThree(color, opacity = 1) {
|
|
58382
|
+
return RGBA32.fromFloats(color.r, color.g, color.b, opacity);
|
|
58383
|
+
}
|
|
58378
58384
|
const MAX_BATCH_SIZE = 3e3;
|
|
58379
58385
|
class ColorManager {
|
|
58380
58386
|
/**
|
|
@@ -58394,39 +58400,48 @@ void main() {
|
|
|
58394
58400
|
* @param hex - The RGBA32 color value
|
|
58395
58401
|
* @returns Promise resolving to a ColorHandle, or undefined if creation fails
|
|
58396
58402
|
*/
|
|
58397
|
-
async getColor(
|
|
58398
|
-
const colors = await this.getColors([
|
|
58403
|
+
async getColor(color) {
|
|
58404
|
+
const colors = await this.getColors([color]);
|
|
58399
58405
|
if (!colors) return void 0;
|
|
58400
58406
|
return colors[0];
|
|
58401
58407
|
}
|
|
58402
58408
|
/**
|
|
58403
58409
|
* Creates or retrieves cached color instances for multiple hex values.
|
|
58404
|
-
* @param
|
|
58410
|
+
* @param colors - Array of color values or undefined for no color
|
|
58405
58411
|
* @returns Promise resolving to an array of ColorHandles in the same order as input, or undefined if creation fails
|
|
58406
58412
|
* @remarks Duplicate hex values will be mapped to the same color instance for efficiency
|
|
58407
58413
|
*/
|
|
58408
|
-
async getColors(
|
|
58409
|
-
const result = new Array(
|
|
58414
|
+
async getColors(colors) {
|
|
58415
|
+
const result = new Array(colors.length);
|
|
58410
58416
|
const hexToIndices = /* @__PURE__ */ new Map();
|
|
58411
58417
|
const toCreate = [];
|
|
58412
|
-
for (let i2 = 0; i2 <
|
|
58413
|
-
const color =
|
|
58414
|
-
if (
|
|
58415
|
-
result[i2] =
|
|
58416
|
-
|
|
58417
|
-
|
|
58418
|
-
|
|
58419
|
-
|
|
58420
|
-
|
|
58418
|
+
for (let i2 = 0; i2 < colors.length; i2++) {
|
|
58419
|
+
const color = colors[i2];
|
|
58420
|
+
if (color === void 0) {
|
|
58421
|
+
result[i2] = void 0;
|
|
58422
|
+
continue;
|
|
58423
|
+
}
|
|
58424
|
+
const hex = (color == null ? void 0 : color.getHex()) ?? -1;
|
|
58425
|
+
const remoteColor = this._hexToColor.get(hex);
|
|
58426
|
+
if (remoteColor) {
|
|
58427
|
+
result[i2] = remoteColor;
|
|
58428
|
+
continue;
|
|
58421
58429
|
}
|
|
58430
|
+
const indices = hexToIndices.get(hex);
|
|
58431
|
+
if (indices) {
|
|
58432
|
+
hexToIndices.get(hex).push(i2);
|
|
58433
|
+
continue;
|
|
58434
|
+
}
|
|
58435
|
+
toCreate.push(color);
|
|
58436
|
+
hexToIndices.set(hex, [i2]);
|
|
58422
58437
|
}
|
|
58423
|
-
const
|
|
58424
|
-
if (!
|
|
58425
|
-
for (let i2 = 0; i2 <
|
|
58438
|
+
const remoteColors = await this._createColors(toCreate);
|
|
58439
|
+
if (!remoteColors) return void 0;
|
|
58440
|
+
for (let i2 = 0; i2 < remoteColors.length; i2++) {
|
|
58426
58441
|
const color = toCreate[i2];
|
|
58427
|
-
const indices = hexToIndices.get(color.
|
|
58442
|
+
const indices = hexToIndices.get(color.getHex());
|
|
58428
58443
|
for (const index2 of indices) {
|
|
58429
|
-
result[index2] =
|
|
58444
|
+
result[index2] = remoteColors[i2];
|
|
58430
58445
|
}
|
|
58431
58446
|
}
|
|
58432
58447
|
return result;
|
|
@@ -58469,7 +58484,8 @@ void main() {
|
|
|
58469
58484
|
if (colors.length === 0) {
|
|
58470
58485
|
return result;
|
|
58471
58486
|
}
|
|
58472
|
-
const
|
|
58487
|
+
const rpcColors = colors.map((c) => RGBA32fromThree(c));
|
|
58488
|
+
const instances = await this._rpc.RPCCreateMaterialInstances(MaterialHandles.StandardOpaque, 1, rpcColors);
|
|
58473
58489
|
if (!instances) return void 0;
|
|
58474
58490
|
for (let i2 = 0; i2 < colors.length; i2++) {
|
|
58475
58491
|
const color = this._createColor(colors[i2], instances[i2]);
|
|
@@ -58486,7 +58502,7 @@ void main() {
|
|
|
58486
58502
|
*/
|
|
58487
58503
|
_createColor(color, id2) {
|
|
58488
58504
|
const handle = new RemoteColor(color, id2, this);
|
|
58489
|
-
this._hexToColor.set(color.
|
|
58505
|
+
this._hexToColor.set(color.getHex(), handle);
|
|
58490
58506
|
this._idToColor.set(handle.id, handle);
|
|
58491
58507
|
return handle;
|
|
58492
58508
|
}
|
|
@@ -59053,9 +59069,9 @@ void main() {
|
|
|
59053
59069
|
if (!Validation.isRelativeVector2(position)) return void 0;
|
|
59054
59070
|
const test2 = await this._rpc.RPCPerformHitTest(position);
|
|
59055
59071
|
if (!test2) return void 0;
|
|
59056
|
-
const vim = this._vims.getFromHandle(test2.
|
|
59072
|
+
const vim = this._vims.getFromHandle(test2.vimIndex);
|
|
59057
59073
|
if (!vim) return void 0;
|
|
59058
|
-
const object = vim.getElement(test2.
|
|
59074
|
+
const object = vim.getElement(test2.vimElementIndex);
|
|
59059
59075
|
if (!object) return void 0;
|
|
59060
59076
|
return new UltraRaycastResult(
|
|
59061
59077
|
object,
|
|
@@ -59084,7 +59100,7 @@ void main() {
|
|
|
59084
59100
|
hdrScale: 1.37,
|
|
59085
59101
|
hdrBackgroundScale: 1,
|
|
59086
59102
|
hdrBackgroundSaturation: 1,
|
|
59087
|
-
|
|
59103
|
+
backgroundBlur: 1,
|
|
59088
59104
|
backgroundColor: new RGBA(0.9, 0.9, 0.9, 1)
|
|
59089
59105
|
};
|
|
59090
59106
|
var VimLoadingStatus = /* @__PURE__ */ ((VimLoadingStatus2) => {
|
|
@@ -59097,15 +59113,26 @@ void main() {
|
|
|
59097
59113
|
return VimLoadingStatus2;
|
|
59098
59114
|
})(VimLoadingStatus || {});
|
|
59099
59115
|
class RpcSafeClient {
|
|
59116
|
+
/**
|
|
59117
|
+
* Creates a new RpcSafeClient instance.
|
|
59118
|
+
* @param rpc - The underlying RpcClient used for communication
|
|
59119
|
+
* @param batchSize - Maximum size of batched data for operations (default: 10000)
|
|
59120
|
+
*/
|
|
59100
59121
|
constructor(rpc, batchSize = defaultBatchSize) {
|
|
59101
59122
|
__publicField(this, "rpc");
|
|
59102
59123
|
__publicField(this, "batchSize");
|
|
59103
59124
|
this.rpc = rpc;
|
|
59104
59125
|
this.batchSize = batchSize;
|
|
59105
59126
|
}
|
|
59127
|
+
/**
|
|
59128
|
+
* The URL used by the underlying RPC connection.
|
|
59129
|
+
*/
|
|
59106
59130
|
get url() {
|
|
59107
59131
|
return this.rpc.url;
|
|
59108
59132
|
}
|
|
59133
|
+
/**
|
|
59134
|
+
* Indicates whether the RPC client is currently connected.
|
|
59135
|
+
*/
|
|
59109
59136
|
get connected() {
|
|
59110
59137
|
return this.rpc.connected;
|
|
59111
59138
|
}
|
|
@@ -59115,9 +59142,10 @@ void main() {
|
|
|
59115
59142
|
* and scene-wide settings.
|
|
59116
59143
|
******************************************************************************/
|
|
59117
59144
|
/**
|
|
59118
|
-
* Initializes and starts the scene with
|
|
59145
|
+
* Initializes and starts the scene with the given settings.
|
|
59119
59146
|
* @param settings - Optional partial scene settings to override defaults
|
|
59120
|
-
* @
|
|
59147
|
+
* @returns Promise resolving to true if the scene started successfully, false otherwise
|
|
59148
|
+
* @remarks Missing values will be filled from {@link defaultSceneSettings}
|
|
59121
59149
|
*/
|
|
59122
59150
|
async RPCStartScene(settings2) {
|
|
59123
59151
|
const s = { ...defaultSceneSettings, ...settings2 ?? {} };
|
|
@@ -59127,15 +59155,15 @@ void main() {
|
|
|
59127
59155
|
Validation.min0(s.hdrScale),
|
|
59128
59156
|
Validation.clamp01(s.hdrBackgroundScale),
|
|
59129
59157
|
Validation.clamp01(s.hdrBackgroundSaturation),
|
|
59130
|
-
Validation.clamp01(s.
|
|
59158
|
+
Validation.clamp01(s.backgroundBlur),
|
|
59131
59159
|
Validation.clampRGBA01(s.backgroundColor)
|
|
59132
59160
|
),
|
|
59133
59161
|
false
|
|
59134
59162
|
);
|
|
59135
59163
|
}
|
|
59136
59164
|
/**
|
|
59137
|
-
*
|
|
59138
|
-
* @param settings - The lighting settings to apply
|
|
59165
|
+
* Updates the scene’s lighting configuration.
|
|
59166
|
+
* @param settings - The complete lighting and background settings to apply
|
|
59139
59167
|
*/
|
|
59140
59168
|
RPCSetLighting(settings2) {
|
|
59141
59169
|
const s = settings2;
|
|
@@ -59144,43 +59172,80 @@ void main() {
|
|
|
59144
59172
|
Validation.min0(s.hdrScale),
|
|
59145
59173
|
Validation.clamp01(s.hdrBackgroundScale),
|
|
59146
59174
|
Validation.clamp01(s.hdrBackgroundSaturation),
|
|
59147
|
-
Validation.clamp01(s.
|
|
59175
|
+
Validation.clamp01(s.backgroundBlur),
|
|
59148
59176
|
Validation.clampRGBA01(s.backgroundColor)
|
|
59149
59177
|
);
|
|
59150
59178
|
}
|
|
59179
|
+
/**
|
|
59180
|
+
* Retrieves the total number of elements across the entire scene.
|
|
59181
|
+
* @returns Promise resolving to the total number of elements (0 on failure).
|
|
59182
|
+
*/
|
|
59183
|
+
RPCGetElementCountForScene() {
|
|
59184
|
+
return this.safeCall(
|
|
59185
|
+
() => this.rpc.RPCGetElementCountForScene(),
|
|
59186
|
+
0
|
|
59187
|
+
);
|
|
59188
|
+
}
|
|
59189
|
+
/**
|
|
59190
|
+
* Retrieves the number of elements within a specific loaded vim.
|
|
59191
|
+
* @param vimIndex - Index of the loaded vim to query
|
|
59192
|
+
* @returns Promise resolving to the element count (0 on failure)
|
|
59193
|
+
*/
|
|
59194
|
+
RPCGetElementCountForVim(vimIndex) {
|
|
59195
|
+
return this.safeCall(
|
|
59196
|
+
() => this.rpc.RPCGetElementCountForVim(vimIndex),
|
|
59197
|
+
0
|
|
59198
|
+
);
|
|
59199
|
+
}
|
|
59151
59200
|
/*******************************************************************************
|
|
59152
|
-
*
|
|
59153
|
-
* Methods for controlling
|
|
59201
|
+
* ELEMENTS VISIBILITY METHODS
|
|
59202
|
+
* Methods for controlling element visibility, including show/hide, ghosting,
|
|
59154
59203
|
* and highlighting functionality.
|
|
59155
59204
|
******************************************************************************/
|
|
59156
59205
|
/**
|
|
59157
|
-
*
|
|
59158
|
-
*
|
|
59159
|
-
*
|
|
59160
|
-
* @param
|
|
59161
|
-
* @
|
|
59162
|
-
|
|
59163
|
-
|
|
59164
|
-
|
|
59165
|
-
if (
|
|
59166
|
-
if (!Validation.
|
|
59167
|
-
|
|
59206
|
+
* Sets a single visibility state for given elements within a loaded vim.
|
|
59207
|
+
* The operation is automatically split into batches if the array is large.
|
|
59208
|
+
*
|
|
59209
|
+
* @param vimIndex - The index of the loaded vim containing the elements
|
|
59210
|
+
* @param vimElementIndices - Array of vim-based element indices to apply the state to
|
|
59211
|
+
* @param state - The visibility state to apply (e.g., VISIBLE, HIDDEN)
|
|
59212
|
+
*/
|
|
59213
|
+
RPCSetStateElements(vimIndex, vimElementIndices, state) {
|
|
59214
|
+
if (vimElementIndices.length === 0) return;
|
|
59215
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59216
|
+
if (!Validation.areIndices(vimElementIndices)) return;
|
|
59217
|
+
const batches = batchArray(vimElementIndices, this.batchSize);
|
|
59168
59218
|
for (const batch of batches) {
|
|
59169
|
-
this.rpc.RPCSetStateElements(
|
|
59219
|
+
this.rpc.RPCSetStateElements(vimIndex, batch, state);
|
|
59170
59220
|
}
|
|
59171
59221
|
}
|
|
59172
|
-
|
|
59173
|
-
|
|
59174
|
-
|
|
59175
|
-
|
|
59176
|
-
|
|
59222
|
+
/**
|
|
59223
|
+
* Sets individual visibility states for multiple elements in a vim.
|
|
59224
|
+
* Each element receives a corresponding visibility state from the input array.
|
|
59225
|
+
* The operation is automatically split into batches if the array is large.
|
|
59226
|
+
*
|
|
59227
|
+
* @param vimIndex - The index of the loaded vim
|
|
59228
|
+
* @param vimElementIndices - Array of vim-based element indices
|
|
59229
|
+
* @param states - Array of visibility states to apply, one per element
|
|
59230
|
+
*/
|
|
59231
|
+
RPCSetStatesElements(vimIndex, vimElementIndices, states) {
|
|
59232
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59233
|
+
if (!Validation.areIndices(vimElementIndices)) return;
|
|
59234
|
+
if (!Validation.areSameLength(vimElementIndices, states)) return;
|
|
59235
|
+
const batches = batchArrays(vimElementIndices, states, this.batchSize);
|
|
59177
59236
|
for (const [batchedElements, batchedStates] of batches) {
|
|
59178
|
-
this.rpc.RPCSetStatesElements(
|
|
59237
|
+
this.rpc.RPCSetStatesElements(vimIndex, batchedElements, batchedStates);
|
|
59179
59238
|
}
|
|
59180
59239
|
}
|
|
59181
|
-
|
|
59182
|
-
|
|
59183
|
-
|
|
59240
|
+
/**
|
|
59241
|
+
* Applies a single visibility state to all elements of a loaded vim.
|
|
59242
|
+
*
|
|
59243
|
+
* @param vimIndex - The index of the loaded vim
|
|
59244
|
+
* @param state - The visibility state to apply (e.g., VISIBLE, HIDDEN)
|
|
59245
|
+
*/
|
|
59246
|
+
RPCSetStateVim(vimIndex, state) {
|
|
59247
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59248
|
+
this.rpc.RPCSetStateVim(vimIndex, state);
|
|
59184
59249
|
}
|
|
59185
59250
|
/*******************************************************************************
|
|
59186
59251
|
* TEXT AND UI METHODS
|
|
@@ -59192,7 +59257,6 @@ void main() {
|
|
|
59192
59257
|
* @param color - The color of the text
|
|
59193
59258
|
* @param text - The content to display
|
|
59194
59259
|
* @returns Promise resolving to the handle of the created text component
|
|
59195
|
-
* @throws {Error} If the text is empty
|
|
59196
59260
|
*/
|
|
59197
59261
|
async RPCCreateText(position, color, text) {
|
|
59198
59262
|
if (!Validation.isNonEmptyString(text)) return INVALID_HANDLE;
|
|
@@ -59205,19 +59269,26 @@ void main() {
|
|
|
59205
59269
|
/**
|
|
59206
59270
|
* Destroys a text component, removing it from the scene.
|
|
59207
59271
|
* @param componentHandle - The handle of the text component to destroy
|
|
59208
|
-
* @throws {Error} If the component handle is invalid
|
|
59209
59272
|
*/
|
|
59210
59273
|
RPCDestroyText(componentHandle) {
|
|
59211
|
-
if (!Validation.
|
|
59274
|
+
if (!Validation.isIndex(componentHandle)) return;
|
|
59212
59275
|
this.rpc.RPCDestroyText(componentHandle);
|
|
59213
59276
|
}
|
|
59214
59277
|
/*******************************************************************************
|
|
59215
59278
|
* SECTION BOX METHODS
|
|
59216
59279
|
* Methods for controlling section box visibility and position.
|
|
59217
59280
|
******************************************************************************/
|
|
59281
|
+
/**
|
|
59282
|
+
* Enables or disables the section box.
|
|
59283
|
+
* @param enable - True to enable the section box, false to disable it
|
|
59284
|
+
*/
|
|
59218
59285
|
RPCEnableSectionBox(enable) {
|
|
59219
59286
|
this.rpc.RPCEnableSectionBox(enable);
|
|
59220
59287
|
}
|
|
59288
|
+
/**
|
|
59289
|
+
* Sets the parameters of the section box.
|
|
59290
|
+
* @param state - The new section box state, including visibility and bounding box
|
|
59291
|
+
*/
|
|
59221
59292
|
RPCSetSectionBox(state) {
|
|
59222
59293
|
this.rpc.RPCSetSectionBox(
|
|
59223
59294
|
{
|
|
@@ -59226,6 +59297,10 @@ void main() {
|
|
|
59226
59297
|
}
|
|
59227
59298
|
);
|
|
59228
59299
|
}
|
|
59300
|
+
/**
|
|
59301
|
+
* Retrieves the current section box state.
|
|
59302
|
+
* @returns Promise resolving to the section box state or undefined on failure
|
|
59303
|
+
*/
|
|
59229
59304
|
async RPCGetSectionBox() {
|
|
59230
59305
|
return await this.safeCall(
|
|
59231
59306
|
() => this.rpc.RPCGetSectionBox(),
|
|
@@ -59242,7 +59317,7 @@ void main() {
|
|
|
59242
59317
|
*/
|
|
59243
59318
|
async RPCGetCameraView() {
|
|
59244
59319
|
return await this.safeCall(
|
|
59245
|
-
() => this.rpc.
|
|
59320
|
+
() => this.rpc.RPCGetCameraPose(),
|
|
59246
59321
|
void 0
|
|
59247
59322
|
);
|
|
59248
59323
|
}
|
|
@@ -59254,7 +59329,7 @@ void main() {
|
|
|
59254
59329
|
RPCSetCameraView(segment, blendTime) {
|
|
59255
59330
|
if (!Validation.isValidSegment(segment)) return;
|
|
59256
59331
|
blendTime = Validation.clamp01(blendTime);
|
|
59257
|
-
this.rpc.
|
|
59332
|
+
this.rpc.RPCSetCameraPose(segment, blendTime);
|
|
59258
59333
|
}
|
|
59259
59334
|
/**
|
|
59260
59335
|
* Sets the camera's position without changing its target.
|
|
@@ -59282,52 +59357,52 @@ void main() {
|
|
|
59282
59357
|
}
|
|
59283
59358
|
/**
|
|
59284
59359
|
* Retrieves the axis-aligned bounding box (AABB) that encompasses the entire scene.
|
|
59285
|
-
* This includes all loaded geometry across all
|
|
59360
|
+
* This includes all loaded geometry across all loaded vims.
|
|
59286
59361
|
*
|
|
59287
59362
|
* @returns Promise resolving to the global AABB of the scene, or undefined on failure
|
|
59288
59363
|
*/
|
|
59289
|
-
|
|
59364
|
+
RPCGetAABBForScene() {
|
|
59290
59365
|
return this.safeCall(
|
|
59291
|
-
() => this.rpc.
|
|
59366
|
+
() => this.rpc.RPCGetAABBForScene(),
|
|
59292
59367
|
void 0
|
|
59293
59368
|
);
|
|
59294
59369
|
}
|
|
59295
59370
|
/**
|
|
59296
|
-
* Retrieves the axis-aligned bounding box (AABB) for a specific
|
|
59297
|
-
* This bounding box represents the spatial bounds of all geometry within the given
|
|
59371
|
+
* Retrieves the axis-aligned bounding box (AABB) for a specific loaded vim.
|
|
59372
|
+
* This bounding box represents the spatial bounds of all geometry within the given loaded vim.
|
|
59298
59373
|
*
|
|
59299
|
-
* @param
|
|
59300
|
-
* @returns Promise resolving to the
|
|
59374
|
+
* @param vimIndex - The index of the loaded vim to query
|
|
59375
|
+
* @returns Promise resolving to the vim bounding box, or undefined on failure
|
|
59301
59376
|
*/
|
|
59302
|
-
async RPCGetAABBForVim(
|
|
59377
|
+
async RPCGetAABBForVim(vimIndex) {
|
|
59378
|
+
if (!Validation.isIndex(vimIndex)) return void 0;
|
|
59303
59379
|
return await this.safeCall(
|
|
59304
|
-
() => this.rpc.RPCGetAABBForVim(
|
|
59380
|
+
() => this.rpc.RPCGetAABBForVim(vimIndex),
|
|
59305
59381
|
void 0
|
|
59306
59382
|
);
|
|
59307
59383
|
}
|
|
59308
59384
|
/**
|
|
59309
|
-
* Calculates the bounding box for specified
|
|
59310
|
-
* Large
|
|
59311
|
-
* @param
|
|
59312
|
-
* @param
|
|
59313
|
-
* @returns Promise resolving to the combined bounding box
|
|
59314
|
-
* @throws {Error} If the component handle is invalid or nodes array is invalid
|
|
59385
|
+
* Calculates the bounding box for specified elements of a loaded vim.
|
|
59386
|
+
* Large element arrays are automatically processed in batches.
|
|
59387
|
+
* @param vimIndex - The index of the loaded vim
|
|
59388
|
+
* @param vimElementIndices - Array of vim-based element indices to calculate bounds for
|
|
59389
|
+
* @returns Promise resolving to the combined bounding box or undefined on failure
|
|
59315
59390
|
*/
|
|
59316
|
-
async RPCGetAABBForElements(
|
|
59317
|
-
if (!Validation.
|
|
59318
|
-
if (!Validation.
|
|
59391
|
+
async RPCGetAABBForElements(vimIndex, vimElementIndices) {
|
|
59392
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59393
|
+
if (!Validation.areIndices(vimElementIndices)) return;
|
|
59319
59394
|
return await this.safeCall(
|
|
59320
|
-
() => this.RPCGetAABBForElementsBatched(
|
|
59395
|
+
() => this.RPCGetAABBForElementsBatched(vimIndex, vimElementIndices),
|
|
59321
59396
|
void 0
|
|
59322
59397
|
);
|
|
59323
59398
|
}
|
|
59324
|
-
async RPCGetAABBForElementsBatched(
|
|
59325
|
-
if (
|
|
59399
|
+
async RPCGetAABBForElementsBatched(vimIndex, vimElementIndices) {
|
|
59400
|
+
if (vimElementIndices.length === 0) {
|
|
59326
59401
|
return new Box3();
|
|
59327
59402
|
}
|
|
59328
|
-
const batches = batchArray(
|
|
59403
|
+
const batches = batchArray(vimElementIndices, this.batchSize);
|
|
59329
59404
|
const promises = batches.map(async (batch) => {
|
|
59330
|
-
const aabb = await this.rpc.RPCGetAABBForElements(
|
|
59405
|
+
const aabb = await this.rpc.RPCGetAABBForElements(vimIndex, batch);
|
|
59331
59406
|
const v1 = new Vector3(aabb.min.x, aabb.min.y, aabb.min.z);
|
|
59332
59407
|
const v2 = new Vector3(aabb.max.x, aabb.max.y, aabb.max.z);
|
|
59333
59408
|
return new Box3(v1, v2);
|
|
@@ -59338,53 +59413,51 @@ void main() {
|
|
|
59338
59413
|
return box;
|
|
59339
59414
|
}
|
|
59340
59415
|
/**
|
|
59341
|
-
* Frames the camera to show all
|
|
59416
|
+
* Frames the camera to show all elements in the scene.
|
|
59342
59417
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
59343
59418
|
* @returns Promise resolving to camera segment representing the final position
|
|
59344
59419
|
*/
|
|
59345
|
-
async
|
|
59420
|
+
async RPCFrameScene(blendTime) {
|
|
59346
59421
|
blendTime = Validation.clamp01(blendTime);
|
|
59347
59422
|
return await this.safeCall(
|
|
59348
|
-
() => this.rpc.
|
|
59423
|
+
() => this.rpc.RPCFrameScene(blendTime),
|
|
59349
59424
|
void 0
|
|
59350
59425
|
);
|
|
59351
59426
|
}
|
|
59352
59427
|
/**
|
|
59353
|
-
* Frames a specific
|
|
59354
|
-
* @param
|
|
59428
|
+
* Frames a specific vim in the scene.
|
|
59429
|
+
* @param vimIndex - The index of the loaded vim to frame
|
|
59355
59430
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
59356
59431
|
* @returns Promise resolving to camera segment representing the final position
|
|
59357
|
-
* @throws {Error} If the component handle is invalid
|
|
59358
59432
|
*/
|
|
59359
|
-
async RPCFrameVim(
|
|
59360
|
-
if (!Validation.
|
|
59433
|
+
async RPCFrameVim(vimIndex, blendTime) {
|
|
59434
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59361
59435
|
blendTime = Validation.clamp01(blendTime);
|
|
59362
59436
|
return await this.safeCall(
|
|
59363
|
-
() => this.rpc.RPCFrameVim(
|
|
59437
|
+
() => this.rpc.RPCFrameVim(vimIndex, blendTime),
|
|
59364
59438
|
void 0
|
|
59365
59439
|
);
|
|
59366
59440
|
}
|
|
59367
59441
|
/**
|
|
59368
|
-
* Frames specific
|
|
59369
|
-
*
|
|
59370
|
-
* @param
|
|
59371
|
-
* @param
|
|
59442
|
+
* Frames specific elements of a loaded vim.
|
|
59443
|
+
* Automatically batches large arrays of elements.
|
|
59444
|
+
* @param vimIndex - The index of the loaded vim
|
|
59445
|
+
* @param vimElementIndices - Array of vim-based element indices to frame
|
|
59372
59446
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
59373
59447
|
* @returns Promise resolving to camera segment representing the final position
|
|
59374
|
-
* @throws {Error} If the component handle is invalid or nodes array is empty
|
|
59375
59448
|
*/
|
|
59376
|
-
async RPCFrameElements(
|
|
59377
|
-
if (!Validation.
|
|
59378
|
-
if (!Validation.
|
|
59449
|
+
async RPCFrameElements(vimIndex, vimElementIndices, blendTime) {
|
|
59450
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59451
|
+
if (!Validation.areIndices(vimElementIndices)) return;
|
|
59379
59452
|
blendTime = Validation.clamp01(blendTime);
|
|
59380
|
-
if (
|
|
59453
|
+
if (vimElementIndices.length < this.batchSize) {
|
|
59381
59454
|
return await this.safeCall(
|
|
59382
|
-
() => this.rpc.RPCFrameElements(
|
|
59455
|
+
() => this.rpc.RPCFrameElements(vimIndex, vimElementIndices, blendTime),
|
|
59383
59456
|
void 0
|
|
59384
59457
|
);
|
|
59385
59458
|
} else {
|
|
59386
59459
|
const box = await this.safeCall(
|
|
59387
|
-
() => this.RPCGetAABBForElementsBatched(
|
|
59460
|
+
() => this.RPCGetAABBForElementsBatched(vimIndex, vimElementIndices),
|
|
59388
59461
|
void 0
|
|
59389
59462
|
);
|
|
59390
59463
|
if (!box) return void 0;
|
|
@@ -59398,7 +59471,6 @@ void main() {
|
|
|
59398
59471
|
* Frames the camera to show a specific bounding box.
|
|
59399
59472
|
* @param box - The bounding box to frame
|
|
59400
59473
|
* @param blendTime - Duration of the camera transition in seconds (non-negative)
|
|
59401
|
-
* @throws {Error} If the box is invalid (min values must be less than max values)
|
|
59402
59474
|
*/
|
|
59403
59475
|
async RPCFrameAABB(box, blendTime) {
|
|
59404
59476
|
if (!Validation.isValidBox(box)) return;
|
|
@@ -59415,12 +59487,15 @@ void main() {
|
|
|
59415
59487
|
/**
|
|
59416
59488
|
* Sets the camera movement speed.
|
|
59417
59489
|
* @param speed - The desired movement speed (must be positive)
|
|
59418
|
-
* @throws {Error} If speed is not positive
|
|
59419
59490
|
*/
|
|
59420
59491
|
RPCSetCameraSpeed(speed) {
|
|
59421
59492
|
speed = Validation.min0(speed);
|
|
59422
59493
|
this.rpc.RPCSetCameraSpeed(speed);
|
|
59423
59494
|
}
|
|
59495
|
+
/**
|
|
59496
|
+
* Sets the camera control mode.
|
|
59497
|
+
* @param mode - The desired input mode (e.g., {@link InputMode.Orbit} or {@link InputMode.Free})
|
|
59498
|
+
*/
|
|
59424
59499
|
RPCSetCameraMode(mode) {
|
|
59425
59500
|
this.rpc.RPCSetCameraMode(
|
|
59426
59501
|
mode === "orbit"
|
|
@@ -59429,9 +59504,8 @@ void main() {
|
|
|
59429
59504
|
}
|
|
59430
59505
|
/**
|
|
59431
59506
|
* Sets the viewer's aspect ratio.
|
|
59432
|
-
* @param width - The width
|
|
59433
|
-
* @param height - The height
|
|
59434
|
-
* @throws {Error} If width or height are not positive integers
|
|
59507
|
+
* @param width - The width of the desired aspect ratio
|
|
59508
|
+
* @param height - The height of the desired aspect ratio
|
|
59435
59509
|
*/
|
|
59436
59510
|
RPCSetCameraAspectRatio(width, height) {
|
|
59437
59511
|
if (!Validation.isPositiveInteger(width)) return;
|
|
@@ -59440,13 +59514,12 @@ void main() {
|
|
|
59440
59514
|
}
|
|
59441
59515
|
/*******************************************************************************
|
|
59442
59516
|
* VIM FILE MANAGEMENT METHODS
|
|
59443
|
-
* Methods for loading, unloading, and managing VIM files
|
|
59517
|
+
* Methods for loading, unloading, and managing VIM files.
|
|
59444
59518
|
******************************************************************************/
|
|
59445
59519
|
/**
|
|
59446
59520
|
* Loads a VIM file from the local filesystem.
|
|
59447
59521
|
* @param source - The path to the VIM file (supports file:// protocol)
|
|
59448
|
-
* @returns Promise resolving to the
|
|
59449
|
-
* @throws {Error} If the filename is invalid or empty
|
|
59522
|
+
* @returns Promise resolving to the index of the loaded vim
|
|
59450
59523
|
*/
|
|
59451
59524
|
async RPCLoadVim(source) {
|
|
59452
59525
|
if (!Validation.isNonEmptyString(source.url)) return INVALID_HANDLE;
|
|
@@ -59458,9 +59531,8 @@ void main() {
|
|
|
59458
59531
|
}
|
|
59459
59532
|
/**
|
|
59460
59533
|
* Loads a VIM file from a remote URL.
|
|
59461
|
-
* @param
|
|
59462
|
-
* @returns Promise resolving to the
|
|
59463
|
-
* @throws {Error} If the URL is invalid
|
|
59534
|
+
* @param source - The URL or file path of the VIM file to load
|
|
59535
|
+
* @returns Promise resolving to the index of the loaded vim
|
|
59464
59536
|
*/
|
|
59465
59537
|
async RPCLoadVimURL(source) {
|
|
59466
59538
|
if (!Validation.isURL(source.url)) return INVALID_HANDLE;
|
|
@@ -59470,17 +59542,16 @@ void main() {
|
|
|
59470
59542
|
);
|
|
59471
59543
|
}
|
|
59472
59544
|
/**
|
|
59473
|
-
* Retrieves the current loading state and progress of a
|
|
59474
|
-
* @param
|
|
59545
|
+
* Retrieves the current loading state and progress of a vim.
|
|
59546
|
+
* @param vimIndex - The index of the vim being loaded
|
|
59475
59547
|
* @returns Promise resolving to the current loading state and progress
|
|
59476
|
-
* @throws {Error} If the component handle is invalid
|
|
59477
59548
|
*/
|
|
59478
|
-
async RPCGetVimLoadingState(
|
|
59479
|
-
if (!Validation.
|
|
59549
|
+
async RPCGetVimLoadingState(vimIndex) {
|
|
59550
|
+
if (!Validation.isIndex(vimIndex)) {
|
|
59480
59551
|
return { status: 0, progress: 0 };
|
|
59481
59552
|
}
|
|
59482
59553
|
const result = await this.safeCall(
|
|
59483
|
-
() => this.rpc.RPCGetVimLoadingState(
|
|
59554
|
+
() => this.rpc.RPCGetVimLoadingState(vimIndex),
|
|
59484
59555
|
{ status: 0, progress: 0 }
|
|
59485
59556
|
);
|
|
59486
59557
|
if (!(result.status in VimLoadingStatus)) {
|
|
@@ -59489,16 +59560,7 @@ void main() {
|
|
|
59489
59560
|
return result;
|
|
59490
59561
|
}
|
|
59491
59562
|
/**
|
|
59492
|
-
*
|
|
59493
|
-
* @param componentHandle - The handle of the component to unload
|
|
59494
|
-
* @throws {Error} If the component handle is invalid
|
|
59495
|
-
*/
|
|
59496
|
-
RPCUnloadVim(componentHandle) {
|
|
59497
|
-
if (!Validation.isComponentHandle(componentHandle)) return;
|
|
59498
|
-
this.rpc.RPCUnloadVim(componentHandle);
|
|
59499
|
-
}
|
|
59500
|
-
/**
|
|
59501
|
-
* Clears the entire scene, removing all components and resetting to initial state.
|
|
59563
|
+
* Clears the entire scene, unloading all vims and resetting to initial state.
|
|
59502
59564
|
*/
|
|
59503
59565
|
RPCUnloadAll() {
|
|
59504
59566
|
this.rpc.RPCUnloadAll();
|
|
@@ -59514,7 +59576,7 @@ void main() {
|
|
|
59514
59576
|
/**
|
|
59515
59577
|
* Performs hit testing at a specified screen position.
|
|
59516
59578
|
* @param pos - Normalized screen coordinates (0-1, 0-1)
|
|
59517
|
-
* @returns Promise resolving to hit test result if
|
|
59579
|
+
* @returns Promise resolving to hit test result if a valid hit was detected, undefined otherwise
|
|
59518
59580
|
*/
|
|
59519
59581
|
async RPCPerformHitTest(pos) {
|
|
59520
59582
|
if (!Validation.isRelativeVector2(pos)) return;
|
|
@@ -59522,7 +59584,7 @@ void main() {
|
|
|
59522
59584
|
() => this.rpc.RPCPerformHitTest(pos),
|
|
59523
59585
|
void 0
|
|
59524
59586
|
);
|
|
59525
|
-
if (!result || result.
|
|
59587
|
+
if (!result || result.vimIndex === INVALID_HANDLE) {
|
|
59526
59588
|
return void 0;
|
|
59527
59589
|
}
|
|
59528
59590
|
return result;
|
|
@@ -59532,7 +59594,6 @@ void main() {
|
|
|
59532
59594
|
* @param position - The normalized screen coordinates (0-1, 0-1)
|
|
59533
59595
|
* @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
|
|
59534
59596
|
* @param down - True if button is pressed down, false if released
|
|
59535
|
-
* @throws {Error} If mouseButton is not a valid positive integer
|
|
59536
59597
|
*/
|
|
59537
59598
|
RPCMouseButtonEvent(position, mouseButton, down) {
|
|
59538
59599
|
if (!Validation.isPositiveInteger(mouseButton)) return;
|
|
@@ -59543,7 +59604,6 @@ void main() {
|
|
|
59543
59604
|
* Sends a mouse double-click event to the viewer.
|
|
59544
59605
|
* @param position - The normalized screen coordinates (0-1, 0-1)
|
|
59545
59606
|
* @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
|
|
59546
|
-
* @throws {Error} If mouseButton is not a valid positive integer
|
|
59547
59607
|
*/
|
|
59548
59608
|
RPCMouseDoubleClickEvent(position, mouseButton) {
|
|
59549
59609
|
if (!Validation.isPositiveInteger(mouseButton)) return;
|
|
@@ -59570,7 +59630,6 @@ void main() {
|
|
|
59570
59630
|
* Sends a mouse selection event to the viewer.
|
|
59571
59631
|
* @param position - The normalized screen coordinates (0-1, 0-1)
|
|
59572
59632
|
* @param mouseButton - The mouse button code (0=left, 1=middle, 2=right)
|
|
59573
|
-
* @throws {Error} If mouseButton is not a valid positive integer
|
|
59574
59633
|
*/
|
|
59575
59634
|
RPCMouseSelectEvent(position, mouseButton) {
|
|
59576
59635
|
if (!Validation.isPositiveInteger(mouseButton)) return;
|
|
@@ -59597,7 +59656,6 @@ void main() {
|
|
|
59597
59656
|
* @param smoothness - The smoothness value to apply (clamped between 0 and 1)
|
|
59598
59657
|
* @param colors - Array of colors for each material instance
|
|
59599
59658
|
* @returns Array of handles for the created material instances
|
|
59600
|
-
* @throws {Error} If the material handle is invalid or smoothness is out of range
|
|
59601
59659
|
*/
|
|
59602
59660
|
async RPCCreateMaterialInstances(materialHandle, smoothness, colors) {
|
|
59603
59661
|
if (!Validation.isMaterialHandle(materialHandle)) return;
|
|
@@ -59620,46 +59678,56 @@ void main() {
|
|
|
59620
59678
|
}
|
|
59621
59679
|
/**
|
|
59622
59680
|
* Destroys multiple material instances, freeing associated resources.
|
|
59623
|
-
* @param
|
|
59624
|
-
* @throws {Error} If any handle in the array is invalid
|
|
59681
|
+
* @param materialInstanceHandles - Array of handles for material instances to destroy
|
|
59625
59682
|
*/
|
|
59626
|
-
RPCDestroyMaterialInstances(
|
|
59627
|
-
if (!Validation.
|
|
59628
|
-
this.rpc.RPCDestroyMaterialInstances(
|
|
59683
|
+
RPCDestroyMaterialInstances(materialInstanceHandles) {
|
|
59684
|
+
if (!Validation.areIndices(materialInstanceHandles)) return;
|
|
59685
|
+
this.rpc.RPCDestroyMaterialInstances(materialInstanceHandles);
|
|
59629
59686
|
}
|
|
59630
59687
|
/**
|
|
59631
|
-
* Sets material overrides for specific
|
|
59632
|
-
* Large arrays are automatically processed in batches
|
|
59633
|
-
* @param
|
|
59634
|
-
* @param
|
|
59635
|
-
* @param materialInstanceHandles - Array of material instance handles to apply (must match
|
|
59636
|
-
* @throws {Error} If arrays have different lengths or any handle is invalid
|
|
59688
|
+
* Sets material overrides for specific elements in a loaded vim.
|
|
59689
|
+
* Large arrays are automatically processed in batches.
|
|
59690
|
+
* @param vimIndex - The index of the loaded vim
|
|
59691
|
+
* @param vimElementIndices - Array of vim-based element indices to override
|
|
59692
|
+
* @param materialInstanceHandles - Array of material instance handles to apply (must match element length)
|
|
59637
59693
|
*/
|
|
59638
|
-
|
|
59639
|
-
if (!Validation.areSameLength(
|
|
59640
|
-
if (!Validation.
|
|
59641
|
-
if (!Validation.
|
|
59694
|
+
RPCSetMaterialOverridesForElements(vimIndex, vimElementIndices, materialInstanceHandles) {
|
|
59695
|
+
if (!Validation.areSameLength(vimElementIndices, materialInstanceHandles)) return;
|
|
59696
|
+
if (!Validation.isIndex(vimIndex)) return;
|
|
59697
|
+
if (!Validation.areIndices(vimElementIndices)) return;
|
|
59642
59698
|
if (!Validation.areIntegers(materialInstanceHandles)) return;
|
|
59643
59699
|
this.setMaterialOverridesBatched(
|
|
59644
|
-
|
|
59645
|
-
|
|
59700
|
+
vimIndex,
|
|
59701
|
+
vimElementIndices,
|
|
59646
59702
|
materialInstanceHandles
|
|
59647
59703
|
);
|
|
59648
59704
|
}
|
|
59649
|
-
setMaterialOverridesBatched(
|
|
59650
|
-
const batches = batchArrays(
|
|
59651
|
-
for (const [
|
|
59652
|
-
this.rpc.
|
|
59705
|
+
setMaterialOverridesBatched(vimIndex, vimElementIndices, materialInstanceHandles) {
|
|
59706
|
+
const batches = batchArrays(vimElementIndices, materialInstanceHandles, this.batchSize);
|
|
59707
|
+
for (const [batchedElements, batchedMaterials] of batches) {
|
|
59708
|
+
this.rpc.RPCSetMaterialOverridesForElements(vimIndex, batchedElements, batchedMaterials);
|
|
59653
59709
|
}
|
|
59654
59710
|
}
|
|
59655
59711
|
/**
|
|
59656
|
-
* Clears all material overrides for the
|
|
59657
|
-
* @param componentHandle - The unique identifier of the component
|
|
59658
|
-
* @throws {Error} If the component handle is invalid or INVALID_HANDLE
|
|
59712
|
+
* Clears all material overrides for the entire scene.
|
|
59659
59713
|
*/
|
|
59660
|
-
|
|
59661
|
-
|
|
59662
|
-
|
|
59714
|
+
RPCClearMaterialOverridesForScene() {
|
|
59715
|
+
this.rpc.RPCClearMaterialOverridesForScene();
|
|
59716
|
+
}
|
|
59717
|
+
/**
|
|
59718
|
+
* Clears all material overrides for a specific loaded vim.
|
|
59719
|
+
* @param vimIndex - The index of the loaded vim
|
|
59720
|
+
*/
|
|
59721
|
+
RPCClearMaterialOverridesForVim(vimIndex) {
|
|
59722
|
+
this.rpc.RPCClearMaterialOverridesForVim(vimIndex);
|
|
59723
|
+
}
|
|
59724
|
+
/**
|
|
59725
|
+
* Clears all material overrides for specific elements in a loaded vim.
|
|
59726
|
+
* @param vimIndex - The index of the loaded vim
|
|
59727
|
+
* @param vimElementIndices - Array of vim-based element indices to clear overrides for
|
|
59728
|
+
*/
|
|
59729
|
+
RPCClearMaterialOverridesForElements(vimIndex, vimElementIndices) {
|
|
59730
|
+
this.rpc.RPCClearMaterialOverridesForElements(vimIndex, vimElementIndices);
|
|
59663
59731
|
}
|
|
59664
59732
|
/*******************************************************************************
|
|
59665
59733
|
* DEBUG AND UTILITY METHODS
|
|
@@ -59716,7 +59784,8 @@ void main() {
|
|
|
59716
59784
|
}
|
|
59717
59785
|
const defaultRenderSettings = {
|
|
59718
59786
|
...defaultSceneSettings,
|
|
59719
|
-
ghostColor: new
|
|
59787
|
+
ghostColor: new Color(14 / 255, 14 / 255, 14 / 255),
|
|
59788
|
+
ghostOpacity: 64 / 255
|
|
59720
59789
|
};
|
|
59721
59790
|
class Renderer {
|
|
59722
59791
|
/**
|
|
@@ -59763,7 +59832,8 @@ void main() {
|
|
|
59763
59832
|
* Sets up initial scene settings, ghost color, and IBL rotation
|
|
59764
59833
|
*/
|
|
59765
59834
|
onConnect() {
|
|
59766
|
-
this.
|
|
59835
|
+
const color = RGBAfromThree(this._settings.ghostColor, this._settings.ghostOpacity);
|
|
59836
|
+
this._rpc.RPCSetGhostColor(color);
|
|
59767
59837
|
}
|
|
59768
59838
|
notifySceneUpdated() {
|
|
59769
59839
|
this._onSceneUpdated.dispatch();
|
|
@@ -59771,11 +59841,14 @@ void main() {
|
|
|
59771
59841
|
// Getters
|
|
59772
59842
|
/**
|
|
59773
59843
|
* Gets the ghost color used for transparent rendering
|
|
59774
|
-
* @returns Current ghost color as
|
|
59844
|
+
* @returns Current ghost color as a THREE.Color
|
|
59775
59845
|
*/
|
|
59776
59846
|
get ghostColor() {
|
|
59777
59847
|
return this._settings.ghostColor;
|
|
59778
59848
|
}
|
|
59849
|
+
get ghostOpacity() {
|
|
59850
|
+
return this._settings.ghostOpacity;
|
|
59851
|
+
}
|
|
59779
59852
|
/**
|
|
59780
59853
|
* Gets the tone mapping white point value
|
|
59781
59854
|
* @returns Current tone mapping white point
|
|
@@ -59809,27 +59882,33 @@ void main() {
|
|
|
59809
59882
|
* @returns Current background blur
|
|
59810
59883
|
*/
|
|
59811
59884
|
get backgroundBlur() {
|
|
59812
|
-
return this._settings.
|
|
59885
|
+
return this._settings.backgroundBlur;
|
|
59813
59886
|
}
|
|
59814
59887
|
/**
|
|
59815
59888
|
* Gets the background color
|
|
59816
59889
|
* @returns Current background color as RGBA
|
|
59817
59890
|
*/
|
|
59818
59891
|
get backgroundColor() {
|
|
59819
|
-
return this._settings.backgroundColor;
|
|
59892
|
+
return this._settings.backgroundColor.toThree();
|
|
59820
59893
|
}
|
|
59821
59894
|
// Setters
|
|
59822
59895
|
/**
|
|
59823
59896
|
* Updates the ghost color used for transparent rendering
|
|
59824
|
-
* @param value - New ghost color as
|
|
59897
|
+
* @param value - New ghost color as THREE.Color
|
|
59825
59898
|
*/
|
|
59826
59899
|
set ghostColor(value) {
|
|
59827
|
-
value = Validation.clampRGBA01(value);
|
|
59828
59900
|
if (this._settings.ghostColor.equals(value)) return;
|
|
59829
59901
|
this._settings.ghostColor = value;
|
|
59830
59902
|
this._updateGhostColor = true;
|
|
59831
59903
|
this.requestSettingsUpdate();
|
|
59832
59904
|
}
|
|
59905
|
+
set ghostOpacity(value) {
|
|
59906
|
+
value = Validation.clamp01(value);
|
|
59907
|
+
if (this._settings.ghostOpacity === value) return;
|
|
59908
|
+
this._settings.ghostOpacity = value;
|
|
59909
|
+
this._updateGhostColor = true;
|
|
59910
|
+
this.requestSettingsUpdate();
|
|
59911
|
+
}
|
|
59833
59912
|
/**
|
|
59834
59913
|
* Sets the tone mapping white point value
|
|
59835
59914
|
* @param value - New tone mapping white point value
|
|
@@ -59880,24 +59959,24 @@ void main() {
|
|
|
59880
59959
|
*/
|
|
59881
59960
|
set backgroundBlur(value) {
|
|
59882
59961
|
value = Validation.clamp01(value);
|
|
59883
|
-
if (this._settings.
|
|
59884
|
-
this._settings.
|
|
59962
|
+
if (this._settings.backgroundBlur === value) return;
|
|
59963
|
+
this._settings.backgroundBlur = value;
|
|
59885
59964
|
this._updateLighting = true;
|
|
59886
59965
|
this.requestSettingsUpdate();
|
|
59887
59966
|
}
|
|
59888
59967
|
/**
|
|
59889
59968
|
* Sets the background color
|
|
59890
|
-
* @param value - New background color as
|
|
59969
|
+
* @param value - New background color as THREE.Color
|
|
59891
59970
|
*/
|
|
59892
59971
|
set backgroundColor(value) {
|
|
59893
|
-
|
|
59894
|
-
if (this._settings.backgroundColor.equals(
|
|
59895
|
-
this._settings.backgroundColor =
|
|
59972
|
+
const color = RGBAfromThree(value, 1);
|
|
59973
|
+
if (this._settings.backgroundColor.equals(color)) return;
|
|
59974
|
+
this._settings.backgroundColor = color;
|
|
59896
59975
|
this._updateLighting = true;
|
|
59897
59976
|
this.requestSettingsUpdate();
|
|
59898
59977
|
}
|
|
59899
59978
|
getBoundingBox() {
|
|
59900
|
-
return this._rpc.
|
|
59979
|
+
return this._rpc.RPCGetAABBForScene();
|
|
59901
59980
|
}
|
|
59902
59981
|
/**
|
|
59903
59982
|
* Requests an update to be performed on the next animation frame.
|
|
@@ -59912,7 +59991,10 @@ void main() {
|
|
|
59912
59991
|
}
|
|
59913
59992
|
async applySettings() {
|
|
59914
59993
|
if (this._updateLighting) await this._rpc.RPCSetLighting(this._settings);
|
|
59915
|
-
if (this._updateGhostColor)
|
|
59994
|
+
if (this._updateGhostColor) {
|
|
59995
|
+
const color = RGBAfromThree(this._settings.ghostColor, this._settings.ghostOpacity);
|
|
59996
|
+
await this._rpc.RPCSetGhostColor(color);
|
|
59997
|
+
}
|
|
59916
59998
|
this._updateLighting = false;
|
|
59917
59999
|
this._updateGhostColor = false;
|
|
59918
60000
|
this._animationFrame = void 0;
|
|
@@ -60012,7 +60094,7 @@ void main() {
|
|
|
60012
60094
|
* Fits the given box, invalid dimensions will be reversed.
|
|
60013
60095
|
* @param box - The new bounding box.
|
|
60014
60096
|
*/
|
|
60015
|
-
|
|
60097
|
+
setBox(box) {
|
|
60016
60098
|
box = safeBox(box);
|
|
60017
60099
|
this._box = box;
|
|
60018
60100
|
this.scheduleUpdate();
|
|
@@ -60036,7 +60118,7 @@ void main() {
|
|
|
60036
60118
|
VisibilityState2[VisibilityState2["GHOSTED_HIGHLIGHTED"] = 18] = "GHOSTED_HIGHLIGHTED";
|
|
60037
60119
|
return VisibilityState2;
|
|
60038
60120
|
})(VisibilityState$1 || {});
|
|
60039
|
-
class
|
|
60121
|
+
class VisibilitySynchronizer {
|
|
60040
60122
|
/**
|
|
60041
60123
|
* Creates a new StateSynchronizer instance.
|
|
60042
60124
|
*
|
|
@@ -60054,7 +60136,7 @@ void main() {
|
|
|
60054
60136
|
__publicField(this, "_onUpdate");
|
|
60055
60137
|
__publicField(this, "_isConnected");
|
|
60056
60138
|
__publicField(this, "_animationFrame");
|
|
60057
|
-
this._tracker = new
|
|
60139
|
+
this._tracker = new VisibilityTracker(defaultState);
|
|
60058
60140
|
this._rpc = rpc;
|
|
60059
60141
|
this._onUpdate = onUpdate;
|
|
60060
60142
|
this._getHandle = getHandle;
|
|
@@ -60103,7 +60185,7 @@ void main() {
|
|
|
60103
60185
|
* @param elementIndex - The element index to update
|
|
60104
60186
|
* @param state - The new state to apply
|
|
60105
60187
|
*/
|
|
60106
|
-
|
|
60188
|
+
setStateForElement(elementIndex, state) {
|
|
60107
60189
|
this._tracker.setState(elementIndex, state);
|
|
60108
60190
|
this.scheduleUpdate();
|
|
60109
60191
|
}
|
|
@@ -60167,7 +60249,7 @@ void main() {
|
|
|
60167
60249
|
this._onUpdate();
|
|
60168
60250
|
}
|
|
60169
60251
|
}
|
|
60170
|
-
class
|
|
60252
|
+
class VisibilityTracker {
|
|
60171
60253
|
/**
|
|
60172
60254
|
* Creates a new StateTracker instance.
|
|
60173
60255
|
*
|
|
@@ -60804,7 +60886,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60804
60886
|
return this.vim.visibility.getElementState(this.element);
|
|
60805
60887
|
}
|
|
60806
60888
|
set state(state) {
|
|
60807
|
-
this.vim.visibility.
|
|
60889
|
+
this.vim.visibility.setStateForElement(this.element, state);
|
|
60808
60890
|
}
|
|
60809
60891
|
/**
|
|
60810
60892
|
* Gets or sets the color override of the element.
|
|
@@ -60821,11 +60903,12 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60821
60903
|
* @returns A promise resolving to the element's bounding box.
|
|
60822
60904
|
*/
|
|
60823
60905
|
async getBoundingBox() {
|
|
60824
|
-
return this.vim.
|
|
60906
|
+
return this.vim.getBoundingBoxForElements([this.element]);
|
|
60825
60907
|
}
|
|
60826
60908
|
}
|
|
60827
60909
|
class Vim {
|
|
60828
60910
|
constructor(rpc, color, renderer, source, logger) {
|
|
60911
|
+
__publicField(this, "type", "ultra");
|
|
60829
60912
|
__publicField(this, "source");
|
|
60830
60913
|
__publicField(this, "_handle", -1);
|
|
60831
60914
|
__publicField(this, "_request");
|
|
@@ -60834,19 +60917,21 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60834
60917
|
__publicField(this, "_renderer");
|
|
60835
60918
|
__publicField(this, "_logger");
|
|
60836
60919
|
// The StateSynchronizer wraps a StateTracker and handles RPC synchronization.
|
|
60920
|
+
// Should be private
|
|
60837
60921
|
__publicField(this, "visibility");
|
|
60838
60922
|
// Color tracking remains unchanged.
|
|
60839
|
-
__publicField(this, "
|
|
60923
|
+
__publicField(this, "_elementColors", /* @__PURE__ */ new Map());
|
|
60840
60924
|
__publicField(this, "_updatedColors", /* @__PURE__ */ new Set());
|
|
60841
60925
|
// Delayed update flag.
|
|
60842
60926
|
__publicField(this, "_updateScheduled", false);
|
|
60927
|
+
__publicField(this, "_elementCount", 0);
|
|
60843
60928
|
__publicField(this, "_objects", /* @__PURE__ */ new Map());
|
|
60844
60929
|
this._rpc = rpc;
|
|
60845
60930
|
this.source = source;
|
|
60846
60931
|
this._colors = color;
|
|
60847
60932
|
this._renderer = renderer;
|
|
60848
60933
|
this._logger = logger;
|
|
60849
|
-
this.visibility = new
|
|
60934
|
+
this.visibility = new VisibilitySynchronizer(
|
|
60850
60935
|
this._rpc,
|
|
60851
60936
|
() => this._handle,
|
|
60852
60937
|
() => this.connected,
|
|
@@ -60855,6 +60940,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60855
60940
|
// default state
|
|
60856
60941
|
);
|
|
60857
60942
|
}
|
|
60943
|
+
//TODO: Rename this to getElementFromNode, prefer using element instead
|
|
60858
60944
|
getElement(elementIndex) {
|
|
60859
60945
|
if (this._objects.has(elementIndex)) {
|
|
60860
60946
|
return this._objects.get(elementIndex);
|
|
@@ -60867,13 +60953,16 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60867
60953
|
throw new Error("Method not implemented.");
|
|
60868
60954
|
}
|
|
60869
60955
|
getElementFromIndex(element) {
|
|
60870
|
-
|
|
60956
|
+
return this.getElement(element);
|
|
60871
60957
|
}
|
|
60872
60958
|
getObjectsInBox(box) {
|
|
60873
60959
|
throw new Error("Method not implemented.");
|
|
60874
60960
|
}
|
|
60875
60961
|
getAllElements() {
|
|
60876
|
-
|
|
60962
|
+
for (var i2 = 0; i2 < this._elementCount; i2++) {
|
|
60963
|
+
this.getElement(i2);
|
|
60964
|
+
}
|
|
60965
|
+
return Array.from(this._objects.values());
|
|
60877
60966
|
}
|
|
60878
60967
|
get handle() {
|
|
60879
60968
|
return this._handle;
|
|
@@ -60904,7 +60993,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60904
60993
|
(_a3 = this._request) == null ? void 0 : _a3.error("cancelled", "The request was cancelled");
|
|
60905
60994
|
this._request = void 0;
|
|
60906
60995
|
if (this.connected) {
|
|
60907
|
-
this._rpc.RPCUnloadVim(this._handle);
|
|
60908
60996
|
this._handle = -1;
|
|
60909
60997
|
}
|
|
60910
60998
|
}
|
|
@@ -60926,12 +61014,12 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60926
61014
|
case VimLoadingStatus.FailedToDownload:
|
|
60927
61015
|
case VimLoadingStatus.FailedToLoad:
|
|
60928
61016
|
case VimLoadingStatus.Unknown:
|
|
60929
|
-
this._rpc.RPCUnloadVim(handle);
|
|
60930
61017
|
const details = await this._rpc.RPCGetLastError();
|
|
60931
61018
|
const error = this.getErrorType(state.status);
|
|
60932
61019
|
return result.error(error, details);
|
|
60933
61020
|
case VimLoadingStatus.Done:
|
|
60934
61021
|
this._handle = handle;
|
|
61022
|
+
this._elementCount = await this._rpc.RPCGetElementCountForVim(handle);
|
|
60935
61023
|
return result.success(this);
|
|
60936
61024
|
}
|
|
60937
61025
|
} catch (e) {
|
|
@@ -60971,14 +61059,14 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60971
61059
|
}
|
|
60972
61060
|
return handle;
|
|
60973
61061
|
}
|
|
60974
|
-
async
|
|
60975
|
-
if (!this.connected ||
|
|
61062
|
+
async getBoundingBoxForElements(elements) {
|
|
61063
|
+
if (!this.connected || elements !== "all" && elements.length === 0) {
|
|
60976
61064
|
return Promise.resolve(void 0);
|
|
60977
61065
|
}
|
|
60978
|
-
if (
|
|
61066
|
+
if (elements === "all") {
|
|
60979
61067
|
return await this._rpc.RPCGetAABBForVim(this._handle);
|
|
60980
61068
|
}
|
|
60981
|
-
return await this._rpc.RPCGetAABBForElements(this._handle,
|
|
61069
|
+
return await this._rpc.RPCGetAABBForElements(this._handle, elements);
|
|
60982
61070
|
}
|
|
60983
61071
|
async getBoundingBox() {
|
|
60984
61072
|
if (!this.connected) {
|
|
@@ -60986,49 +61074,49 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60986
61074
|
}
|
|
60987
61075
|
return await this._rpc.RPCGetAABBForVim(this._handle);
|
|
60988
61076
|
}
|
|
60989
|
-
getColor(
|
|
60990
|
-
return this.
|
|
61077
|
+
getColor(elementIndex) {
|
|
61078
|
+
return this._elementColors.get(elementIndex);
|
|
60991
61079
|
}
|
|
60992
|
-
async setColor(
|
|
60993
|
-
const colors = new Array(
|
|
60994
|
-
this.applyColor(
|
|
61080
|
+
async setColor(elementIndex, color) {
|
|
61081
|
+
const colors = new Array(elementIndex.length).fill(color);
|
|
61082
|
+
this.applyColor(elementIndex, colors);
|
|
60995
61083
|
}
|
|
60996
|
-
async setColors(
|
|
60997
|
-
if (color.length !==
|
|
60998
|
-
throw new Error("Color and
|
|
61084
|
+
async setColors(elements, color) {
|
|
61085
|
+
if (color.length !== elements.length) {
|
|
61086
|
+
throw new Error("Color and elements length must be equal");
|
|
60999
61087
|
}
|
|
61000
|
-
this.applyColor(
|
|
61088
|
+
this.applyColor(elements, color);
|
|
61001
61089
|
}
|
|
61002
|
-
applyColor(
|
|
61090
|
+
applyColor(elements, color) {
|
|
61003
61091
|
for (let i2 = 0; i2 < color.length; i2++) {
|
|
61004
61092
|
const c = color[i2];
|
|
61005
|
-
const
|
|
61093
|
+
const element = elements[i2];
|
|
61006
61094
|
if (c === void 0) {
|
|
61007
|
-
this.
|
|
61095
|
+
this._elementColors.delete(element);
|
|
61008
61096
|
} else {
|
|
61009
|
-
this.
|
|
61097
|
+
this._elementColors.set(element, c);
|
|
61010
61098
|
}
|
|
61011
|
-
this._updatedColors.add(
|
|
61099
|
+
this._updatedColors.add(element);
|
|
61012
61100
|
}
|
|
61013
61101
|
this.scheduleColorUpdate();
|
|
61014
61102
|
}
|
|
61015
|
-
|
|
61016
|
-
|
|
61017
|
-
|
|
61103
|
+
//TODO: Remove and rely on element.color
|
|
61104
|
+
clearColor(elements) {
|
|
61105
|
+
if (elements === "all") {
|
|
61106
|
+
this._elementColors.clear();
|
|
61018
61107
|
} else {
|
|
61019
|
-
|
|
61108
|
+
elements.forEach((n) => this._elementColors.delete(n));
|
|
61020
61109
|
}
|
|
61021
61110
|
if (!this.connected) return;
|
|
61022
|
-
if (
|
|
61023
|
-
this._rpc.
|
|
61111
|
+
if (elements === "all") {
|
|
61112
|
+
this._rpc.RPCClearMaterialOverridesForVim(this._handle);
|
|
61024
61113
|
} else {
|
|
61025
|
-
|
|
61026
|
-
this._rpc.RPCSetMaterialOverrides(this._handle, nodes, ids);
|
|
61114
|
+
this._rpc.RPCClearMaterialOverridesForElements(this._handle, elements);
|
|
61027
61115
|
}
|
|
61028
61116
|
}
|
|
61029
61117
|
reapplyColors() {
|
|
61030
61118
|
this._updatedColors.clear();
|
|
61031
|
-
this.
|
|
61119
|
+
this._elementColors.forEach((c, n) => this._updatedColors.add(n));
|
|
61032
61120
|
this.scheduleColorUpdate();
|
|
61033
61121
|
}
|
|
61034
61122
|
scheduleColorUpdate() {
|
|
@@ -61044,11 +61132,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61044
61132
|
this._renderer.notifySceneUpdated();
|
|
61045
61133
|
}
|
|
61046
61134
|
async updateRemoteColors() {
|
|
61047
|
-
const
|
|
61048
|
-
const colors =
|
|
61135
|
+
const elements = Array.from(this._updatedColors);
|
|
61136
|
+
const colors = elements.map((n) => this._elementColors.get(n));
|
|
61049
61137
|
const remoteColors = await this._colors.getColors(colors);
|
|
61050
61138
|
const colorIds = remoteColors.map((c) => (c == null ? void 0 : c.id) ?? -1);
|
|
61051
|
-
this._rpc.
|
|
61139
|
+
this._rpc.RPCSetMaterialOverridesForElements(this._handle, elements, colorIds);
|
|
61052
61140
|
this._updatedColors.clear();
|
|
61053
61141
|
}
|
|
61054
61142
|
}
|
|
@@ -61126,6 +61214,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61126
61214
|
* @param logger - Optional logger for logging messages.
|
|
61127
61215
|
*/
|
|
61128
61216
|
constructor(canvas, logger) {
|
|
61217
|
+
/**
|
|
61218
|
+
* The type of the viewer, indicating it is a WebGL viewer.
|
|
61219
|
+
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
61220
|
+
*/
|
|
61221
|
+
__publicField(this, "type", "ultra");
|
|
61129
61222
|
__publicField(this, "_decoder");
|
|
61130
61223
|
__publicField(this, "_socketClient");
|
|
61131
61224
|
__publicField(this, "_input");
|
|
@@ -61349,6 +61442,9 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61349
61442
|
this._vims.getAll().forEach((vim) => vim.disconnect());
|
|
61350
61443
|
this._vims.clear();
|
|
61351
61444
|
}
|
|
61445
|
+
getElement3Ds() {
|
|
61446
|
+
return this.rpc.RPCGetElementCountForScene();
|
|
61447
|
+
}
|
|
61352
61448
|
/**
|
|
61353
61449
|
* Disposes all resources used by the viewer and disconnects from the server.
|
|
61354
61450
|
*/
|
|
@@ -61370,9 +61466,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61370
61466
|
INVALID_HANDLE,
|
|
61371
61467
|
InputMode,
|
|
61372
61468
|
MaterialHandles,
|
|
61373
|
-
RGB,
|
|
61374
|
-
RGBA,
|
|
61375
|
-
RGBA32,
|
|
61376
61469
|
Segment,
|
|
61377
61470
|
Viewer: Viewer$2,
|
|
61378
61471
|
VimLoadingStatus,
|
|
@@ -76163,7 +76256,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76163
76256
|
viewer.sectionBox.interactive = b;
|
|
76164
76257
|
},
|
|
76165
76258
|
getBox: () => viewer.sectionBox.getBox(),
|
|
76166
|
-
setBox: (box) => viewer.sectionBox.
|
|
76259
|
+
setBox: (box) => viewer.sectionBox.setBox(box),
|
|
76167
76260
|
onSelectionChanged: viewer.selection.onSelectionChanged,
|
|
76168
76261
|
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76169
76262
|
getSceneBox: () => viewer.renderer.getBoundingBox()
|
|
@@ -76244,6 +76337,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76244
76337
|
obj.state = VisibilityState.HIGHLIGHTED;
|
|
76245
76338
|
});
|
|
76246
76339
|
},
|
|
76340
|
+
// TODO: Change this api to use elements
|
|
76247
76341
|
isolate: (instances) => {
|
|
76248
76342
|
hide("all");
|
|
76249
76343
|
viewer.selection.getAll().forEach((obj) => {
|
|
@@ -76277,11 +76371,9 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76277
76371
|
}
|
|
76278
76372
|
}
|
|
76279
76373
|
},
|
|
76280
|
-
getGhostOpacity: () => viewer.renderer.
|
|
76374
|
+
getGhostOpacity: () => viewer.renderer.ghostOpacity,
|
|
76281
76375
|
setGhostOpacity: (opacity) => {
|
|
76282
|
-
|
|
76283
|
-
c.a = opacity;
|
|
76284
|
-
viewer.renderer.ghostColor = c;
|
|
76376
|
+
viewer.renderer.ghostOpacity = opacity;
|
|
76285
76377
|
},
|
|
76286
76378
|
getShowRooms: () => true,
|
|
76287
76379
|
setShowRooms: (show) => {
|