@realsee/dnalogel 2.0.0-alpha.2 → 2.0.0-alpha.20
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/CHANGELOG.md +72 -0
- package/README.md +93 -4
- package/TERMS.txt +56 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.js +234 -0
- package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.js +302 -0
- package/dist/CameraMovementPlugin/typing.d.ts +68 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.js +143 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.js +201 -0
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/index.js +668 -0
- package/dist/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/dist/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelRoomLabelPlugin/Assets/roomLabelBg.d.ts +1 -0
- package/dist/ModelRoomLabelPlugin/Controller.d.ts +36 -0
- package/dist/ModelRoomLabelPlugin/index.d.ts +12 -0
- package/dist/ModelRoomLabelPlugin/index.js +505 -0
- package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelTVVideoPlugin/index.d.ts +4 -0
- package/dist/ModelTVVideoPlugin/index.js +301 -0
- package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/dist/ModelViewPlugin/index.d.ts +17 -0
- package/dist/ModelViewPlugin/index.js +187 -0
- package/dist/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/dist/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/dist/PanoCompassPlugin/index.d.ts +51 -0
- package/dist/PanoCompassPlugin/index.js +635 -0
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
- package/dist/PanoCursorRaycasterPlugin/index.js +90 -0
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +61 -0
- package/dist/PanoMeasurePlugin/Model/index.d.ts +38 -0
- package/dist/PanoMeasurePlugin/Model/line.d.ts +30 -0
- package/dist/PanoMeasurePlugin/Model/point.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
- package/dist/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
- package/dist/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
- package/dist/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
- package/dist/PanoMeasurePlugin/index.d.ts +7 -0
- package/dist/PanoMeasurePlugin/index.js +5525 -0
- package/dist/PanoMeasurePlugin/typings/data.d.ts +28 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
- package/dist/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/constants.d.ts +4 -0
- package/dist/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
- package/dist/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
- package/dist/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
- package/dist/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/line.d.ts +17 -0
- package/dist/PanoMeasurePlugin/utils/math.d.ts +17 -0
- package/dist/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
- package/dist/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
- package/dist/PanoRulerPlugin/index.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.js +612 -0
- package/dist/PanoRulerPlugin/style.d.ts +2 -0
- package/dist/PanoRulerPlugin/typings.d.ts +21 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +33 -0
- package/dist/PanoSpatialTagPlugin/index.js +1294 -0
- package/dist/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/dist/floorplan/Assets/camera.d.ts +1 -0
- package/{libs/floorplan/ModelFloorplanPlugin → dist/floorplan}/Assets/compass.d.ts +0 -0
- package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +105 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.js +4034 -0
- package/dist/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
- package/dist/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
- package/dist/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +28 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +1642 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +75 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +3646 -0
- package/dist/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
- package/dist/floorplan/constant.d.ts +5 -0
- package/dist/floorplan/typings/floorplanData.d.ts +137 -0
- package/dist/floorplan/typings/floorplanServerData.d.ts +131 -0
- package/dist/floorplan/typings/utility.d.ts +2 -0
- package/dist/floorplan/utils/formatData.d.ts +5 -0
- package/dist/floorplan/utils/formatPosition.d.ts +36 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.es.js +15132 -0
- package/dist/index.js +15174 -0
- package/dist/index.umd.js +15167 -0
- package/dist/shared-utils/Preloader.d.ts +6 -0
- package/dist/shared-utils/Subscribe.d.ts +45 -0
- package/dist/shared-utils/animationFrame/BetterTween.d.ts +11 -0
- package/dist/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
- package/dist/shared-utils/animationFrame/formatRad.d.ts +15 -0
- package/dist/shared-utils/animationFrame/index.d.ts +15 -0
- package/dist/shared-utils/animationFrame/tween.d.ts +75 -0
- package/dist/shared-utils/changeModelCanvasOpacity.d.ts +2 -0
- package/dist/shared-utils/createCanvasTextTexture.d.ts +8 -0
- package/dist/shared-utils/createLine/index.d.ts +3 -0
- package/dist/shared-utils/debounce.d.ts +6 -0
- package/dist/shared-utils/equal.d.ts +11 -0
- package/dist/shared-utils/filter.d.ts +27 -0
- package/dist/shared-utils/five/changeMode.d.ts +2 -0
- package/dist/shared-utils/five/useFivePlugin.d.ts +1 -0
- package/dist/shared-utils/formatRad.d.ts +7 -0
- package/dist/shared-utils/getPxmm.d.ts +11 -0
- package/dist/shared-utils/getRandomColor.d.ts +1 -0
- package/dist/shared-utils/isNil.d.ts +10 -0
- package/dist/shared-utils/isTruelyObject.d.ts +18 -0
- package/dist/shared-utils/math/evenNumber.d.ts +3 -0
- package/dist/shared-utils/math/planimetry.d.ts +116 -0
- package/dist/shared-utils/math/rad2Deg.d.ts +1 -0
- package/dist/shared-utils/nearlyEqual.d.ts +7 -0
- package/dist/shared-utils/nextFrame.d.ts +1 -0
- package/dist/shared-utils/noop.d.ts +5 -0
- package/dist/shared-utils/object3d2LocalMatrix.d.ts +12 -0
- package/dist/shared-utils/px2rem.d.ts +1 -0
- package/dist/shared-utils/removeArrayItem.d.ts +7 -0
- package/dist/shared-utils/tap.d.ts +8 -0
- package/dist/shared-utils/three/centerPoint.d.ts +2 -0
- package/dist/shared-utils/three/getExtraModelLoader.d.ts +6 -0
- package/dist/shared-utils/three/getNormal.d.ts +2 -0
- package/dist/shared-utils/three/getTextureLoader.d.ts +6 -0
- package/dist/shared-utils/three/loadFbxObj.d.ts +2 -0
- package/dist/shared-utils/three/loadTexture.d.ts +2 -0
- package/dist/shared-utils/three/transformPositionToVector3.d.ts +7 -0
- package/dist/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
- package/dist/shared-utils/throttle.d.ts +7 -0
- package/dist/shared-utils/tinyEJSrender.d.ts +5 -0
- package/dist/shared-utils/to.d.ts +8 -0
- package/dist/shared-utils/useDebounce.d.ts +8 -0
- package/dist/shared-utils/useThrottle.d.ts +8 -0
- package/dist/shared-utils/uuid.d.ts +4 -0
- package/dist/shared-utils/vectorTocoordinates.d.ts +7 -0
- package/dist/typings/math.type.d.ts +44 -0
- package/dist/typings/utils.type.d.ts +2 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +78 -0
- package/docs/assets/icons.css +1043 -0
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/main.js +52 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1413 -0
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/ModelRoomLabelController.html +20 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
- package/docs/enums/ModelFloorplanErrorType.html +1 -0
- package/docs/index.html +88 -0
- package/docs/interfaces/LineJson.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -0
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -0
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -0
- package/docs/interfaces/ModelFloorplanViewEvent.html +5 -0
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
- package/docs/interfaces/PanoCompassPluginData.html +1 -0
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -0
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +11 -0
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -0
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -0
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
- package/docs/interfaces/PointJson.html +1 -0
- package/docs/interfaces/RoomLabel.html +13 -0
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +19 -0
- package/docs/modules.html +28 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +2 -2
- package/libs/CSS3DRenderPlugin/index.js +27 -26
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ModelChassisCompassPlugin/index.js +2 -2
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +1 -1
- package/libs/ModelEntryDoorGuidePlugin/index.js +13 -9
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/index.js +120 -0
- package/libs/ModelItemLabelPlugin/typings.d.ts +56 -0
- package/libs/ModelItemLabelPlugin/typings.js +7 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ModelItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +67 -25
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +121 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +255 -0
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelTVVideoPlugin/index.d.ts +4 -0
- package/libs/ModelTVVideoPlugin/index.js +254 -0
- package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
- package/libs/ModelTVVideoPlugin/typings.js +8 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
- package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
- package/libs/ModelViewPlugin/index.js +6 -6
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +1 -0
- package/libs/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/libs/PanoCompassPlugin/getRoomInfoInstance.js +48 -0
- package/libs/PanoCompassPlugin/index.d.ts +51 -0
- package/libs/PanoCompassPlugin/index.js +253 -0
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +124 -0
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/libs/PanoMeasurePlugin/Controller/EditController.js +329 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +64 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +305 -0
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +61 -0
- package/libs/PanoMeasurePlugin/Controller/index.js +260 -0
- package/libs/PanoMeasurePlugin/Model/index.d.ts +38 -0
- package/libs/PanoMeasurePlugin/Model/index.js +139 -0
- package/libs/PanoMeasurePlugin/Model/line.d.ts +30 -0
- package/libs/PanoMeasurePlugin/Model/line.js +114 -0
- package/libs/PanoMeasurePlugin/Model/point.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Model/point.js +48 -0
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Model/polyline.js +65 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +15 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +2 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +22 -0
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +153 -0
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +48 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +110 -0
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +153 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.d.ts +6 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +117 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +18 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +148 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +70 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +102 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +17 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +78 -0
- package/libs/PanoMeasurePlugin/index.d.ts +7 -0
- package/libs/PanoMeasurePlugin/index.js +5 -0
- package/libs/PanoMeasurePlugin/typings/data.d.ts +28 -0
- package/libs/PanoMeasurePlugin/typings/data.js +1 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +28 -0
- package/libs/PanoMeasurePlugin/typings/event.type.js +1 -0
- package/libs/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/libs/PanoMeasurePlugin/typings/utils.type.js +1 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.js +3 -0
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +4 -0
- package/libs/PanoMeasurePlugin/utils/constants.js +31 -0
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +28 -0
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +115 -0
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +21 -0
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +27 -0
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +4 -0
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +9 -0
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +14 -0
- package/libs/PanoMeasurePlugin/utils/ironbox.d.ts +1 -0
- package/libs/PanoMeasurePlugin/utils/ironbox.js +1 -0
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +6 -0
- package/libs/PanoMeasurePlugin/utils/line.d.ts +17 -0
- package/libs/PanoMeasurePlugin/utils/line.js +33 -0
- package/libs/PanoMeasurePlugin/utils/math.d.ts +17 -0
- package/libs/PanoMeasurePlugin/utils/math.js +44 -0
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -0
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +22 -0
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +6 -0
- package/libs/PanoRulerPlugin/index.d.ts +31 -0
- package/libs/PanoRulerPlugin/index.js +400 -0
- package/libs/PanoRulerPlugin/style.d.ts +2 -0
- package/libs/PanoRulerPlugin/style.js +88 -0
- package/libs/PanoRulerPlugin/typings.d.ts +21 -0
- package/libs/PanoRulerPlugin/typings.js +1 -0
- package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +33 -0
- package/libs/PanoSpatialTagPlugin/index.js +413 -0
- package/libs/PanoSpatialTagPlugin/store.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/store.js +2 -0
- package/libs/PanoSpatialTagPlugin/style.d.ts +1 -0
- package/libs/PanoSpatialTagPlugin/style.js +8 -0
- package/libs/PanoSpatialTagPlugin/typings.d.ts +40 -0
- package/libs/PanoSpatialTagPlugin/typings.js +1 -0
- package/libs/floorplan/Assets/compass.d.ts +1 -0
- package/libs/floorplan/{ModelFloorplanPlugin/Assets → Assets}/compass.js +0 -0
- package/libs/floorplan/Components/BaseImage.js +222 -0
- package/libs/floorplan/Components/Camera.js +120 -0
- package/libs/floorplan/Components/Compass.js +119 -0
- package/libs/floorplan/Components/CurrentFloor.js +456 -0
- package/libs/floorplan/Components/Main.js +464 -0
- package/libs/floorplan/Components/Normalmage.js +63 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +68 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +199 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +173 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +265 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +331 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +64 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +103 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +140 -0
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +284 -0
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +269 -0
- package/libs/floorplan/Components/SvgImage.js +83 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.d.ts +4 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +455 -279
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +152 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +250 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +154 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +312 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +89 -37
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +30 -14
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +269 -118
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +0 -1
- package/libs/floorplan/constant.d.ts +5 -0
- package/libs/floorplan/constant.js +6 -0
- package/libs/floorplan/typings/floorplanServerData.d.ts +4 -0
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +3 -3
- package/libs/index.d.ts +22 -9
- package/libs/index.js +11 -3
- package/libs/shared-utils/Subscribe.js +8 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
- package/libs/shared-utils/createCanvasTextTexture.js +6 -5
- package/libs/shared-utils/getPxmm.d.ts +6 -1
- package/libs/shared-utils/getPxmm.js +26 -12
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/three/getExtraModelLoader.d.ts +1 -1
- package/libs/shared-utils/three/getNormal.d.ts +1 -1
- package/libs/shared-utils/three/getTextureLoader.d.ts +1 -1
- package/libs/shared-utils/three/loadFbxObj.d.ts +1 -1
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
- package/libs/shared-utils/tinyEJSrender.d.ts +5 -0
- package/libs/shared-utils/tinyEJSrender.js +210 -0
- package/libs/shared-utils/useDebounce.js +1 -1
- package/libs/shared-utils/useThrottle.js +2 -1
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +26 -13
- package/dist/dnalogel.cjs.js +0 -2
- package/dist/dnalogel.es.js +0 -37145
- package/dist/dnalogel.umd.js +0 -2
- package/dist/style.css +0 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte +0 -63
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.svelte.map +0 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte +0 -80
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.svelte.map +0 -1
- package/libs/floorplan/Components/BaseImage.svelte +0 -25
- package/libs/floorplan/Components/BaseImage.svelte.map +0 -1
- package/libs/floorplan/Components/Normalmage.svelte +0 -11
- package/libs/floorplan/Components/Normalmage.svelte.map +0 -1
- package/libs/floorplan/Components/RoomHighlight/Room.svelte +0 -21
- package/libs/floorplan/Components/RoomHighlight/Room.svelte.map +0 -1
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte +0 -60
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte +0 -35
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte +0 -7
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte +0 -16
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.svelte.map +0 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte +0 -17
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.svelte.map +0 -1
- package/libs/floorplan/Components/SvgImage.svelte +0 -25
- package/libs/floorplan/Components/SvgImage.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte +0 -46
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte +0 -48
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -37
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte +0 -50
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte +0 -41
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte +0 -25
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte +0 -148
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.svelte.map +0 -1
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte +0 -15
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte +0 -84
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte +0 -18
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte +0 -40
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.svelte.map +0 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte +0 -61
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.svelte.map +0 -1
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var five = require('@realsee/five');
|
|
6
|
+
var TWEEN = require('@tweenjs/tween.js');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var TWEEN__namespace = /*#__PURE__*/_interopNamespace(TWEEN);
|
|
27
|
+
|
|
28
|
+
const _requestAnimationFrame = window.requestAnimationFrame || ((fn) => setTimeout(fn, 16));
|
|
29
|
+
const _cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
|
|
30
|
+
function nextFrame(fn, delay = 0) {
|
|
31
|
+
if (delay <= 0)
|
|
32
|
+
_requestAnimationFrame(fn);
|
|
33
|
+
else
|
|
34
|
+
_requestAnimationFrame(() => nextFrame(fn, delay - 1));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 在每个 AnimationFrame 中调用传入的函数
|
|
38
|
+
* @param callback 每次 AnimationFrame 中调用的函数
|
|
39
|
+
* @param frame 每秒运行多少次
|
|
40
|
+
* @returns 返回一个函数,调用可以停止 AnimationFrameLoop
|
|
41
|
+
*/
|
|
42
|
+
function requestAnimationFrameInterval(callback, frame = 60) {
|
|
43
|
+
let index = -1;
|
|
44
|
+
let oldTime = 0;
|
|
45
|
+
let startTime = -1;
|
|
46
|
+
const minDeltaTime = 1000 / frame;
|
|
47
|
+
function loop(time) {
|
|
48
|
+
startTime === -1 && (startTime = time);
|
|
49
|
+
index = _requestAnimationFrame(loop);
|
|
50
|
+
const deltaTime = time - oldTime;
|
|
51
|
+
if (deltaTime < minDeltaTime)
|
|
52
|
+
return;
|
|
53
|
+
oldTime = time;
|
|
54
|
+
callback && callback(time - startTime);
|
|
55
|
+
}
|
|
56
|
+
index = _requestAnimationFrame(loop);
|
|
57
|
+
return function stop() {
|
|
58
|
+
_cancelAnimationFrame(index);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
// export { Easing } from './tween'
|
|
62
|
+
// export { default as tween } from './tween'
|
|
63
|
+
|
|
64
|
+
const Easing = TWEEN__namespace.Easing;
|
|
65
|
+
/**
|
|
66
|
+
* 对象变化的补间动画
|
|
67
|
+
* 1. 应用 requestAnimationFrameInterval 做 update
|
|
68
|
+
* 2. 在原生 tween 上新增 destroy 方法和 onDestroy 监听
|
|
69
|
+
* DOC: https://github.com/tweenjs/tween.js
|
|
70
|
+
* @param from 对象起始状态
|
|
71
|
+
* @param to 对象末尾状态
|
|
72
|
+
* @param duration 经历时间(s)
|
|
73
|
+
* @param easing 过程动画,默认是 Easing.Linear.None
|
|
74
|
+
*/
|
|
75
|
+
function tween(from, to, duration, easing = Easing.Linear.None) {
|
|
76
|
+
const tween = new TWEEN__namespace.Tween(from).to(to, duration).easing(easing);
|
|
77
|
+
// 这里注意一下,因为 requestAnimationFrameInterval 给的时间是从 0 开始的,tween 动画也从 0 开始
|
|
78
|
+
nextFrame(() => tween.start(0));
|
|
79
|
+
const cancelAnimationFrame = requestAnimationFrameInterval((time) => {
|
|
80
|
+
if (tween.update(time) === false)
|
|
81
|
+
cancelAnimationFrame();
|
|
82
|
+
});
|
|
83
|
+
const destroyMethods = [];
|
|
84
|
+
tween.onDestroy = (fn) => {
|
|
85
|
+
destroyMethods.push(fn);
|
|
86
|
+
return tween;
|
|
87
|
+
};
|
|
88
|
+
tween.destroy = function () {
|
|
89
|
+
this.stop();
|
|
90
|
+
Object.assign(tween, {
|
|
91
|
+
_onStartCallback: null,
|
|
92
|
+
_onUpdateCallback: null,
|
|
93
|
+
_onCompleteCallback: null,
|
|
94
|
+
_onStopCallbackL: null,
|
|
95
|
+
});
|
|
96
|
+
let destroyMethod;
|
|
97
|
+
while ((destroyMethod = destroyMethods.shift()))
|
|
98
|
+
destroyMethod();
|
|
99
|
+
cancelAnimationFrame();
|
|
100
|
+
};
|
|
101
|
+
return tween;
|
|
102
|
+
}
|
|
103
|
+
function tweenProgress(duration, easing) {
|
|
104
|
+
return tween({ progress: 0 }, { progress: 1 }, duration, easing);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 运镜效果
|
|
109
|
+
*/
|
|
110
|
+
var CameraMovementEffect;
|
|
111
|
+
(function (CameraMovementEffect) {
|
|
112
|
+
CameraMovementEffect["Move"] = "Move";
|
|
113
|
+
CameraMovementEffect["Rotate"] = "Rotate";
|
|
114
|
+
})(CameraMovementEffect || (CameraMovementEffect = {}));
|
|
115
|
+
/**
|
|
116
|
+
* 旋转类型
|
|
117
|
+
*/
|
|
118
|
+
var Rotation;
|
|
119
|
+
(function (Rotation) {
|
|
120
|
+
Rotation["Clockwise"] = "Clockwise";
|
|
121
|
+
Rotation["Anticlockwise"] = "Anticlockwise";
|
|
122
|
+
Rotation["Loop"] = "Loop";
|
|
123
|
+
})(Rotation || (Rotation = {}));
|
|
124
|
+
|
|
125
|
+
const PI_2 = Math.PI * 2;
|
|
126
|
+
/**
|
|
127
|
+
* 把一个任意角度的弧度值转换为一个 [0, 2PI] 的弧度值
|
|
128
|
+
* @param rad 弧度值
|
|
129
|
+
*/
|
|
130
|
+
function formatLongitude(rad) {
|
|
131
|
+
return ((rad % PI_2) + PI_2) % PI_2;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* 把一个任意角度的弧度值转换为一个 [-2PI, 2PI] 的弧度值
|
|
135
|
+
* @param rad 弧度值
|
|
136
|
+
*/
|
|
137
|
+
function formatLatitude(rad) {
|
|
138
|
+
return rad % PI_2;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* 线性过程插值
|
|
143
|
+
*/
|
|
144
|
+
function progressNumber(from, to, pst) {
|
|
145
|
+
return from + (to - from) * pst;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const getLongitudeParams = (from, to, rotation) => {
|
|
149
|
+
const PI = Math.PI;
|
|
150
|
+
const PI_2 = PI * 2;
|
|
151
|
+
from = formatLongitude(from);
|
|
152
|
+
to = formatLongitude(to);
|
|
153
|
+
// 逆时针旋转,初始值必须是较大的值
|
|
154
|
+
if (rotation === Rotation.Anticlockwise && from < to)
|
|
155
|
+
from += PI_2;
|
|
156
|
+
// 顺时针旋转,结束值必须是较大值
|
|
157
|
+
if (rotation === Rotation.Clockwise && to < from)
|
|
158
|
+
to += PI_2;
|
|
159
|
+
// Loop 旋转,找锐角旋转
|
|
160
|
+
// 如果 to 比 from 大 180°,逆时针转
|
|
161
|
+
// 如果 from 比 to 大 180°,顺时针转
|
|
162
|
+
if (rotation === Rotation.Loop && to - from > PI)
|
|
163
|
+
return getLongitudeParams(from, to, Rotation.Anticlockwise);
|
|
164
|
+
if (rotation === Rotation.Loop && from - to > PI)
|
|
165
|
+
return getLongitudeParams(from, to, Rotation.Clockwise);
|
|
166
|
+
return { from, to };
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* **运镜插件** 模拟类似于电影运镜效果。
|
|
170
|
+
*/
|
|
171
|
+
const CameraMovementPlugin = (five$1) => {
|
|
172
|
+
const state = {};
|
|
173
|
+
const move = async (args, duration, opts = { preload: true }) => {
|
|
174
|
+
if (state.interruptCallback) {
|
|
175
|
+
state.interruptCallback(false);
|
|
176
|
+
}
|
|
177
|
+
if (opts.asyncStartCallback) {
|
|
178
|
+
await opts.asyncStartCallback();
|
|
179
|
+
}
|
|
180
|
+
if (args.mode && args.mode !== five$1.currentMode) {
|
|
181
|
+
await five$1.changeMode(args.mode);
|
|
182
|
+
}
|
|
183
|
+
if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
|
|
184
|
+
await five$1.preloadPano(args.panoIndex);
|
|
185
|
+
}
|
|
186
|
+
if (opts.asyncEndCallback) {
|
|
187
|
+
await opts.asyncEndCallback();
|
|
188
|
+
}
|
|
189
|
+
if (args.panoIndex === undefined &&
|
|
190
|
+
args.fov === undefined &&
|
|
191
|
+
args.latitude === undefined &&
|
|
192
|
+
args.longitude === undefined) {
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
return await new Promise((resolve, reject) => {
|
|
196
|
+
const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five$1.panoIndex;
|
|
197
|
+
if (panoIndex !== undefined) {
|
|
198
|
+
five$1.moveToPano(panoIndex, Object.assign({
|
|
199
|
+
duration,
|
|
200
|
+
moveEndCallback: () => resolve(true),
|
|
201
|
+
moveCancelCallback: () => reject(false), // 移动开始
|
|
202
|
+
}, args));
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
reject(false);
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
const getAnimeParams = (args) => {
|
|
210
|
+
const currentFiveState = five$1.state;
|
|
211
|
+
// latitude
|
|
212
|
+
const fromLatitude = formatLatitude(currentFiveState.latitude);
|
|
213
|
+
const toLatitude = formatLatitude(args.latitude);
|
|
214
|
+
// longitude
|
|
215
|
+
const { from: fromLongitude, to: toLongitude } = getLongitudeParams(currentFiveState.longitude, args.longitude, args.rotation || Rotation.Loop);
|
|
216
|
+
// fov
|
|
217
|
+
const fromFov = currentFiveState.fov;
|
|
218
|
+
const toFov = args.fov;
|
|
219
|
+
return {
|
|
220
|
+
from: { latitude: fromLatitude, longitude: fromLongitude, fov: fromFov },
|
|
221
|
+
to: { latitude: toLatitude, longitude: toLongitude, fov: toFov },
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
const rotate = async (args, duration, opts = {}) => {
|
|
225
|
+
if (state.interruptCallback) {
|
|
226
|
+
state.interruptCallback(false);
|
|
227
|
+
}
|
|
228
|
+
if (opts.asyncStartCallback) {
|
|
229
|
+
await opts.asyncStartCallback();
|
|
230
|
+
}
|
|
231
|
+
if (five$1.currentMode !== five.Five.Mode.Panorama) {
|
|
232
|
+
await five$1.changeMode(five.Five.Mode.Panorama);
|
|
233
|
+
}
|
|
234
|
+
if (args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
|
|
235
|
+
if (opts.preload)
|
|
236
|
+
await five$1.preloadPano(args.panoIndex);
|
|
237
|
+
await new Promise((resolve, reject) => {
|
|
238
|
+
if (!args.panoIndex) {
|
|
239
|
+
resolve(true);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
five$1.moveToPano(args.panoIndex, {
|
|
243
|
+
moveEndCallback: () => resolve(true),
|
|
244
|
+
moveCancelCallback: () => reject(false), // 移动开始
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
if (opts.asyncEndCallback) {
|
|
249
|
+
await opts.asyncEndCallback();
|
|
250
|
+
}
|
|
251
|
+
const { from, to } = getAnimeParams(args);
|
|
252
|
+
return await new Promise((resolve) => {
|
|
253
|
+
const onUpdate = ({ progress }) => {
|
|
254
|
+
const state = {};
|
|
255
|
+
state.longitude = progressNumber(from.longitude, to.longitude, progress);
|
|
256
|
+
state.latitude = progressNumber(from.latitude, to.latitude, progress);
|
|
257
|
+
state.fov = progressNumber(from.fov, to.fov, progress);
|
|
258
|
+
five$1.setState(state, true);
|
|
259
|
+
};
|
|
260
|
+
const onComplete = () => {
|
|
261
|
+
resolve(true);
|
|
262
|
+
};
|
|
263
|
+
const onDestroy = () => {
|
|
264
|
+
resolve(false);
|
|
265
|
+
};
|
|
266
|
+
const animeDuration = args.rotateSpeed
|
|
267
|
+
? Math.ceil((Math.abs(to.longitude - from.longitude) / args.rotateSpeed) * 1000)
|
|
268
|
+
: duration;
|
|
269
|
+
const tween = tweenProgress(animeDuration, TWEEN__namespace.Easing.Linear.None)
|
|
270
|
+
.onUpdate(onUpdate)
|
|
271
|
+
.onComplete(onComplete)
|
|
272
|
+
.onDestroy(onDestroy);
|
|
273
|
+
if (args.rotation === Rotation.Loop) {
|
|
274
|
+
tween.repeat(Infinity).yoyo(true);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* 中断回调:可能会被其他动画中断。
|
|
278
|
+
*/
|
|
279
|
+
state.interruptCallback = (flag = true) => {
|
|
280
|
+
tween.destroy();
|
|
281
|
+
state.interruptCallback = undefined;
|
|
282
|
+
if (state.timeoutId) {
|
|
283
|
+
clearTimeout(state.timeoutId);
|
|
284
|
+
state.timeoutId = undefined;
|
|
285
|
+
}
|
|
286
|
+
resolve(flag);
|
|
287
|
+
};
|
|
288
|
+
state.timeoutId = setTimeout(() => {
|
|
289
|
+
// 总时间到了之后强制结束,同时也是 Loop 模式的结束方式
|
|
290
|
+
if (state.interruptCallback)
|
|
291
|
+
state.interruptCallback(true);
|
|
292
|
+
}, duration);
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
return {
|
|
296
|
+
move,
|
|
297
|
+
rotate,
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
exports.CameraMovementPlugin = CameraMovementPlugin;
|
|
302
|
+
exports["default"] = CameraMovementPlugin;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Mode, Pose } from '@realsee/five';
|
|
2
|
+
export interface CameraMovementPluginParameterType {
|
|
3
|
+
}
|
|
4
|
+
export interface CameraMovementPluginExportType {
|
|
5
|
+
/**
|
|
6
|
+
* 运镜:移动
|
|
7
|
+
* @param moveArgs 移动参数
|
|
8
|
+
* @param duration 移动耗时
|
|
9
|
+
* @param opts 额外配置
|
|
10
|
+
*/
|
|
11
|
+
move(moveArgs: Partial<MoveArgs>, duration: number, opts?: MoveOpts): Promise<boolean>;
|
|
12
|
+
/**
|
|
13
|
+
* 运镜:旋转
|
|
14
|
+
* @param rotateArgs 旋转参数
|
|
15
|
+
* @param duration 旋转耗时
|
|
16
|
+
* @param opts 额外配置
|
|
17
|
+
*/
|
|
18
|
+
rotate(rotateArgs: Partial<RotateArgs>, duration: number, opts?: RotateOpts): Promise<boolean>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 运镜效果
|
|
22
|
+
*/
|
|
23
|
+
export declare enum CameraMovementEffect {
|
|
24
|
+
Move = "Move",
|
|
25
|
+
Rotate = "Rotate"
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 旋转类型
|
|
29
|
+
*/
|
|
30
|
+
export declare enum Rotation {
|
|
31
|
+
Clockwise = "Clockwise",
|
|
32
|
+
Anticlockwise = "Anticlockwise",
|
|
33
|
+
Loop = "Loop"
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 回调配置
|
|
37
|
+
*/
|
|
38
|
+
export interface CameraMovementOptsCallback {
|
|
39
|
+
asyncStartCallback?: () => void;
|
|
40
|
+
asyncEndCallback?: () => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 移动运镜参数
|
|
44
|
+
*/
|
|
45
|
+
export declare type MoveArgs = {
|
|
46
|
+
mode: Mode;
|
|
47
|
+
panoIndex: number;
|
|
48
|
+
} & Pose;
|
|
49
|
+
/**
|
|
50
|
+
* 移动运镜配置
|
|
51
|
+
*/
|
|
52
|
+
export declare type MoveOpts = {
|
|
53
|
+
preload?: boolean;
|
|
54
|
+
} & CameraMovementOptsCallback;
|
|
55
|
+
/**
|
|
56
|
+
* 旋转运镜参数
|
|
57
|
+
*/
|
|
58
|
+
export declare type RotateArgs = {
|
|
59
|
+
panoIndex?: number;
|
|
60
|
+
rotateSpeed?: number;
|
|
61
|
+
rotation?: Rotation;
|
|
62
|
+
} & Pose;
|
|
63
|
+
/**
|
|
64
|
+
* 旋转运镜配置
|
|
65
|
+
*/
|
|
66
|
+
export declare type RotateOpts = {
|
|
67
|
+
preload?: boolean;
|
|
68
|
+
} & CameraMovementOptsCallback;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FivePlugin } from '@realsee/five';
|
|
2
|
+
export interface ModelChassisCompassPluginParameterType {
|
|
3
|
+
north_rad?: number;
|
|
4
|
+
fbx_url?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ModelChassisCompassPluginData {
|
|
7
|
+
north_rad?: number;
|
|
8
|
+
fbx_url?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ModelChassisCompassPluginExportType {
|
|
11
|
+
enable: () => void;
|
|
12
|
+
disable: () => void;
|
|
13
|
+
load: (data?: ModelChassisCompassPluginData) => Promise<boolean>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 模型底盘指南针插件
|
|
17
|
+
*/
|
|
18
|
+
export declare const ModelChassisCompassPlugin: FivePlugin<ModelChassisCompassPluginParameterType, ModelChassisCompassPluginExportType>;
|
|
19
|
+
export default ModelChassisCompassPlugin;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var THREE = require('three');
|
|
6
|
+
var FBXLoader = require('three/examples/jsm/loaders/FBXLoader');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
|
|
27
|
+
|
|
28
|
+
const genRotationMatrix = (x, y, z) => {
|
|
29
|
+
const matrix = new THREE__namespace.Matrix4();
|
|
30
|
+
const euler = new THREE__namespace.Euler(x, y, z, 'YXZ');
|
|
31
|
+
matrix.makeRotationFromEuler(euler);
|
|
32
|
+
return matrix;
|
|
33
|
+
};
|
|
34
|
+
const bject3d2LocalMatrix = (mesh, { scale, rotation, position, }) => {
|
|
35
|
+
if (scale) {
|
|
36
|
+
mesh.scale.set(scale, scale, scale);
|
|
37
|
+
}
|
|
38
|
+
if (rotation) {
|
|
39
|
+
const [x, y, z] = rotation;
|
|
40
|
+
if (x) {
|
|
41
|
+
mesh.applyMatrix4(genRotationMatrix(x, 0, 0));
|
|
42
|
+
}
|
|
43
|
+
if (y) {
|
|
44
|
+
mesh.applyMatrix4(genRotationMatrix(0, y, 0));
|
|
45
|
+
}
|
|
46
|
+
if (z) {
|
|
47
|
+
mesh.applyMatrix4(genRotationMatrix(0, 0, z));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (position) {
|
|
51
|
+
mesh.position.set(position.x, position.y, position.z);
|
|
52
|
+
}
|
|
53
|
+
return mesh;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
function transfromToMeshBasicMaterial(object, options) {
|
|
57
|
+
object.traverse((ele) => {
|
|
58
|
+
var _a;
|
|
59
|
+
if (ele.type === 'Mesh') {
|
|
60
|
+
const mesh = ele;
|
|
61
|
+
const materialConf = Object.assign({ map: mesh.material.map || {} }, options);
|
|
62
|
+
mesh.material = new THREE.MeshBasicMaterial(materialConf);
|
|
63
|
+
mesh.renderOrder = 1;
|
|
64
|
+
if (((_a = ele.parent) === null || _a === void 0 ? void 0 : _a.type) === 'Mesh') {
|
|
65
|
+
ele.renderOrder = ele.parent.renderOrder + 1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 模型底盘指南针插件
|
|
73
|
+
*/
|
|
74
|
+
const ModelChassisCompassPlugin = (five, params) => {
|
|
75
|
+
const defaultFbxUrl = params.fbx_url || '//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX';
|
|
76
|
+
const defaultNorthRad = params.north_rad || undefined;
|
|
77
|
+
// 局部状态
|
|
78
|
+
const state = {};
|
|
79
|
+
const load = async (data) => {
|
|
80
|
+
const fbxUrl = (data === null || data === void 0 ? void 0 : data.fbx_url) || defaultFbxUrl;
|
|
81
|
+
const northRad = (data === null || data === void 0 ? void 0 : data.north_rad) || defaultNorthRad;
|
|
82
|
+
if (!northRad) {
|
|
83
|
+
throw new Error('"northRad"配置参数缺失:未配置指南针指向!');
|
|
84
|
+
}
|
|
85
|
+
const bounding = five.model.bounding;
|
|
86
|
+
const xOffset = bounding.max.x - bounding.min.x;
|
|
87
|
+
const zOffset = bounding.max.z - bounding.min.z;
|
|
88
|
+
const maxOffset = Math.max(xOffset, zOffset);
|
|
89
|
+
const fbxLoader = new FBXLoader.FBXLoader();
|
|
90
|
+
const object = await fbxLoader.loadAsync(fbxUrl);
|
|
91
|
+
transfromToMeshBasicMaterial(object, {
|
|
92
|
+
transparent: true,
|
|
93
|
+
side: THREE__namespace.DoubleSide,
|
|
94
|
+
blending: THREE__namespace.AdditiveBlending,
|
|
95
|
+
});
|
|
96
|
+
const rotation = [0, northRad - Math.PI / 2, 0];
|
|
97
|
+
const { model: { bounding: { max: { x: xMax, z: zMax }, min: { x: xMin, y: yMin, z: zMin }, }, }, } = five;
|
|
98
|
+
state.yBase = yMin;
|
|
99
|
+
const position = { x: (xMax + xMin) / 2, y: yMin - 1.6, z: (zMax + zMin) / 2 };
|
|
100
|
+
const scale = 0.0045 * maxOffset;
|
|
101
|
+
bject3d2LocalMatrix(object, { position, rotation, scale });
|
|
102
|
+
state.object = object;
|
|
103
|
+
return true;
|
|
104
|
+
};
|
|
105
|
+
const onCameraUpdate = ({ latitude }) => {
|
|
106
|
+
if (!state.object)
|
|
107
|
+
return;
|
|
108
|
+
const y = getPositionY(latitude);
|
|
109
|
+
if (y) {
|
|
110
|
+
state.object.position.y = y;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const getPositionY = (latitude) => {
|
|
114
|
+
if (state.yBase === undefined)
|
|
115
|
+
return;
|
|
116
|
+
const difference = 0.6;
|
|
117
|
+
if (latitude >= Math.PI / 4)
|
|
118
|
+
return state.yBase - (difference + 1.6);
|
|
119
|
+
const ratio = latitude * (4 / Math.PI);
|
|
120
|
+
return state.yBase - (difference * ratio + 1.6);
|
|
121
|
+
};
|
|
122
|
+
const enable = () => {
|
|
123
|
+
if (!state.object)
|
|
124
|
+
return;
|
|
125
|
+
const y = getPositionY(five.getPose().latitude);
|
|
126
|
+
if (y)
|
|
127
|
+
state.object.position.y = y;
|
|
128
|
+
five.scene.add(state.object);
|
|
129
|
+
five.needsRender = true;
|
|
130
|
+
five.on('cameraDirectionUpdate', onCameraUpdate);
|
|
131
|
+
};
|
|
132
|
+
const disable = () => {
|
|
133
|
+
if (!state.object)
|
|
134
|
+
return;
|
|
135
|
+
five.scene.remove(state.object);
|
|
136
|
+
five.needsRender = true;
|
|
137
|
+
five.off('cameraDirectionUpdate', onCameraUpdate);
|
|
138
|
+
};
|
|
139
|
+
return { load, disable, enable };
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
exports.ModelChassisCompassPlugin = ModelChassisCompassPlugin;
|
|
143
|
+
exports["default"] = ModelChassisCompassPlugin;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FivePlugin } from '@realsee/five';
|
|
2
|
+
import type { Vector3Position } from '../typings/math.type';
|
|
3
|
+
export interface ModelEntryDoorGuidePluginData {
|
|
4
|
+
position?: Vector3Position;
|
|
5
|
+
rad?: number;
|
|
6
|
+
fbx_url?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare type ModelEntryDoorGuidePluginParameterType = {
|
|
9
|
+
animationEnabled?: boolean;
|
|
10
|
+
} & ModelEntryDoorGuidePluginData;
|
|
11
|
+
export interface ModelEntryDoorGuidePluginExportType {
|
|
12
|
+
enable: (config?: {
|
|
13
|
+
animationEnable?: boolean;
|
|
14
|
+
}) => boolean;
|
|
15
|
+
disable: () => boolean;
|
|
16
|
+
load: (data?: Partial<ModelEntryDoorGuidePluginData>) => Promise<boolean>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 模型入户门引导插件
|
|
20
|
+
*/
|
|
21
|
+
export declare const ModelEntryDoorGuidePlugin: FivePlugin<ModelEntryDoorGuidePluginParameterType, ModelEntryDoorGuidePluginExportType>;
|
|
22
|
+
export declare const modelEntryDoorGuidePluginServerParams: {
|
|
23
|
+
name: string;
|
|
24
|
+
version: number;
|
|
25
|
+
};
|
|
26
|
+
export default ModelEntryDoorGuidePlugin;
|