@realsee/dnalogel 2.0.0-alpha.6 → 2.0.0-alpha.9
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 +14 -0
- package/README.md +44 -5
- package/dist/CSS3DRenderPlugin/index.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.js +233 -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 +142 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.js +196 -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 +461 -0
- package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -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 +523 -0
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
- package/dist/PanoCursorRaycasterPlugin/index.js +88 -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 +12 -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 +4789 -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 +610 -0
- package/dist/PanoRulerPlugin/style.d.ts +2 -0
- package/dist/PanoRulerPlugin/typings.d.ts +21 -0
- package/dist/floorplan/Assets/camera.d.ts +1 -0
- package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Assets/compass.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +104 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.js +3827 -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 +1673 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +61 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +3466 -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 +24 -0
- package/dist/index.es.js +11887 -0
- package/dist/index.js +11925 -0
- package/dist/index.umd.js +11920 -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/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/assets/highlight.css +49 -0
- package/docs/assets/search.js +1 -1
- package/docs/classes/ModelRoomLabelController.html +6 -6
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.html +1 -1
- package/docs/index.html +37 -4
- package/docs/interfaces/LineJson.html +1 -0
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PointJson.html +1 -0
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -1
- package/docs/modules.html +11 -11
- package/libs/ModelEntryDoorGuidePlugin/index.js +1 -0
- package/libs/ModelRoomLabelPlugin/Controller.js +2 -2
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +121 -0
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +253 -0
- package/libs/ModelViewPlugin/index.js +6 -6
- package/libs/PanoCompassPlugin/index.d.ts +3 -3
- package/libs/PanoCompassPlugin/index.js +56 -44
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +36 -0
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +69 -0
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/libs/PanoMeasurePlugin/Controller/EditController.js +216 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +44 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +25 -0
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +223 -0
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +61 -0
- package/libs/PanoMeasurePlugin/Controller/index.js +176 -0
- package/libs/PanoMeasurePlugin/Model/index.d.ts +38 -0
- package/libs/PanoMeasurePlugin/Model/index.js +114 -0
- package/libs/PanoMeasurePlugin/Model/line.d.ts +30 -0
- package/libs/PanoMeasurePlugin/Model/line.js +64 -0
- package/libs/PanoMeasurePlugin/Model/point.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Model/point.js +28 -0
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Model/polyline.js +48 -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 +108 -0
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +11 -0
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +33 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +18 -0
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +75 -0
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +24 -0
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +103 -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 +102 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +35 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +16 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +69 -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 +114 -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 +32 -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 +21 -0
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.d.ts +5 -0
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +6 -0
- package/libs/floorplan/Components/BaseImage.js +217 -0
- package/libs/floorplan/Components/Normalmage.js +63 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +70 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +289 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +328 -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/SvgImage.js +83 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Camera.js +120 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +106 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/CurrentFloor/CurrentFloor.js +463 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/Main.js +375 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +171 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabels.js +265 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleItem.js +301 -0
- package/libs/floorplan/ModelFloorplanPlugin/Components/RuleLabels/RuleLabels.js +219 -0
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +1 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +152 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +248 -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 +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +1 -1
- package/libs/index.d.ts +2 -0
- package/libs/index.js +1 -0
- package/package.json +19 -11
- package/dist/dnalogel.cjs.js +0 -2
- package/dist/dnalogel.es.js +0 -37923
- 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,121 @@
|
|
|
1
|
+
/* generated by Svelte v3.47.0 */
|
|
2
|
+
import {
|
|
3
|
+
SvelteComponent,
|
|
4
|
+
append,
|
|
5
|
+
append_styles,
|
|
6
|
+
attr,
|
|
7
|
+
detach,
|
|
8
|
+
element,
|
|
9
|
+
init,
|
|
10
|
+
insert,
|
|
11
|
+
listen,
|
|
12
|
+
noop,
|
|
13
|
+
safe_not_equal,
|
|
14
|
+
set_data,
|
|
15
|
+
set_style,
|
|
16
|
+
space,
|
|
17
|
+
text,
|
|
18
|
+
toggle_class
|
|
19
|
+
} from "svelte/internal";
|
|
20
|
+
|
|
21
|
+
import { ROOM_LABEL_BG } from './Assets/roomLabelBg';
|
|
22
|
+
|
|
23
|
+
function add_css(target) {
|
|
24
|
+
append_styles(target, "svelte-17nkflf", ".room-label-item.svelte-17nkflf{position:absolute;font-size:8px;z-index:0;transform:none;cursor:pointer;pointer-events:none;user-select:none}.room-label-item__text.svelte-17nkflf{position:absolute;left:0;top:-64px;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:20px;min-width:32px;padding:0 6px;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-17nkflf{position:absolute;top:-44px;height:48px;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-17nkflf{font-size:10px}");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function create_fragment(ctx) {
|
|
28
|
+
let div1;
|
|
29
|
+
let span;
|
|
30
|
+
let t0_value = /*roomLabel*/ ctx[0].name + "";
|
|
31
|
+
let t0;
|
|
32
|
+
let t1;
|
|
33
|
+
let div0;
|
|
34
|
+
let mounted;
|
|
35
|
+
let dispose;
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
c() {
|
|
39
|
+
div1 = element("div");
|
|
40
|
+
span = element("span");
|
|
41
|
+
t0 = text(t0_value);
|
|
42
|
+
t1 = space();
|
|
43
|
+
div0 = element("div");
|
|
44
|
+
attr(span, "class", "room-label-item__text svelte-17nkflf");
|
|
45
|
+
set_style(span, "background-image", "url(" + ROOM_LABEL_BG + ")");
|
|
46
|
+
toggle_class(span, "wide", /*roomLabel*/ ctx[0].name.length > 3);
|
|
47
|
+
attr(div0, "class", "room-label-item__bar svelte-17nkflf");
|
|
48
|
+
attr(div1, "class", "room-label-item svelte-17nkflf");
|
|
49
|
+
set_style(div1, "z-index", /*roomLabel*/ ctx[0].zIndex, false);
|
|
50
|
+
set_style(div1, "transform", /*roomLabel*/ ctx[0].transform, false);
|
|
51
|
+
set_style(div1, "opacity", /*roomLabel*/ ctx[0].visible ? 1 : 0, false);
|
|
52
|
+
},
|
|
53
|
+
m(target, anchor) {
|
|
54
|
+
insert(target, div1, anchor);
|
|
55
|
+
append(div1, span);
|
|
56
|
+
append(span, t0);
|
|
57
|
+
append(div1, t1);
|
|
58
|
+
append(div1, div0);
|
|
59
|
+
|
|
60
|
+
if (!mounted) {
|
|
61
|
+
dispose = listen(span, "click", /*onClick*/ ctx[1]);
|
|
62
|
+
mounted = true;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
p(ctx, [dirty]) {
|
|
66
|
+
if (dirty & /*roomLabel*/ 1 && t0_value !== (t0_value = /*roomLabel*/ ctx[0].name + "")) set_data(t0, t0_value);
|
|
67
|
+
|
|
68
|
+
if (dirty & /*roomLabel*/ 1) {
|
|
69
|
+
toggle_class(span, "wide", /*roomLabel*/ ctx[0].name.length > 3);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (dirty & /*roomLabel*/ 1) {
|
|
73
|
+
set_style(div1, "z-index", /*roomLabel*/ ctx[0].zIndex, false);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (dirty & /*roomLabel*/ 1) {
|
|
77
|
+
set_style(div1, "transform", /*roomLabel*/ ctx[0].transform, false);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (dirty & /*roomLabel*/ 1) {
|
|
81
|
+
set_style(div1, "opacity", /*roomLabel*/ ctx[0].visible ? 1 : 0, false);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
i: noop,
|
|
85
|
+
o: noop,
|
|
86
|
+
d(detaching) {
|
|
87
|
+
if (detaching) detach(div1);
|
|
88
|
+
mounted = false;
|
|
89
|
+
dispose();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function instance($$self, $$props, $$invalidate) {
|
|
95
|
+
let { five } = $$props;
|
|
96
|
+
let { roomLabel } = $$props;
|
|
97
|
+
|
|
98
|
+
function onClick() {
|
|
99
|
+
five.setState({
|
|
100
|
+
panoIndex: roomLabel.panoIndex,
|
|
101
|
+
mode: 'Panorama',
|
|
102
|
+
longitude: roomLabel.longitude
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
$$self.$$set = $$props => {
|
|
107
|
+
if ('five' in $$props) $$invalidate(2, five = $$props.five);
|
|
108
|
+
if ('roomLabel' in $$props) $$invalidate(0, roomLabel = $$props.roomLabel);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return [roomLabel, onClick, five];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
class Component extends SvelteComponent {
|
|
115
|
+
constructor(options) {
|
|
116
|
+
super();
|
|
117
|
+
init(this, options, instance, create_fragment, safe_not_equal, { five: 2, roomLabel: 0 }, add_css);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export default Component;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/* generated by Svelte v3.47.0 */
|
|
2
|
+
import {
|
|
3
|
+
SvelteComponent,
|
|
4
|
+
add_render_callback,
|
|
5
|
+
add_resize_listener,
|
|
6
|
+
append_styles,
|
|
7
|
+
attr,
|
|
8
|
+
check_outros,
|
|
9
|
+
create_component,
|
|
10
|
+
destroy_component,
|
|
11
|
+
detach,
|
|
12
|
+
element,
|
|
13
|
+
empty,
|
|
14
|
+
group_outros,
|
|
15
|
+
init,
|
|
16
|
+
insert,
|
|
17
|
+
mount_component,
|
|
18
|
+
outro_and_destroy_block,
|
|
19
|
+
safe_not_equal,
|
|
20
|
+
transition_in,
|
|
21
|
+
transition_out,
|
|
22
|
+
update_keyed_each
|
|
23
|
+
} from "svelte/internal";
|
|
24
|
+
|
|
25
|
+
import { onDestroy, onMount } from 'svelte';
|
|
26
|
+
import { Raycaster, Vector3 } from 'three';
|
|
27
|
+
import RoomLabelItem from './RoomLabelItem';
|
|
28
|
+
|
|
29
|
+
function add_css(target) {
|
|
30
|
+
append_styles(target, "svelte-185yvaa", ".room-labels-container.svelte-185yvaa{width:100%;height:100%;position:relative;color:#fff}");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function get_each_context(ctx, list, i) {
|
|
34
|
+
const child_ctx = ctx.slice();
|
|
35
|
+
child_ctx[9] = list[i];
|
|
36
|
+
return child_ctx;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// (68:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
|
|
40
|
+
function create_each_block(key_1, ctx) {
|
|
41
|
+
let first;
|
|
42
|
+
let roomlabelitem;
|
|
43
|
+
let current;
|
|
44
|
+
|
|
45
|
+
roomlabelitem = new RoomLabelItem({
|
|
46
|
+
props: {
|
|
47
|
+
roomLabel: /*roomLableItem*/ ctx[9],
|
|
48
|
+
five: /*five*/ ctx[1]
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
key: key_1,
|
|
54
|
+
first: null,
|
|
55
|
+
c() {
|
|
56
|
+
first = empty();
|
|
57
|
+
create_component(roomlabelitem.$$.fragment);
|
|
58
|
+
this.first = first;
|
|
59
|
+
},
|
|
60
|
+
m(target, anchor) {
|
|
61
|
+
insert(target, first, anchor);
|
|
62
|
+
mount_component(roomlabelitem, target, anchor);
|
|
63
|
+
current = true;
|
|
64
|
+
},
|
|
65
|
+
p(new_ctx, dirty) {
|
|
66
|
+
ctx = new_ctx;
|
|
67
|
+
const roomlabelitem_changes = {};
|
|
68
|
+
if (dirty & /*roomLabels*/ 1) roomlabelitem_changes.roomLabel = /*roomLableItem*/ ctx[9];
|
|
69
|
+
if (dirty & /*five*/ 2) roomlabelitem_changes.five = /*five*/ ctx[1];
|
|
70
|
+
roomlabelitem.$set(roomlabelitem_changes);
|
|
71
|
+
},
|
|
72
|
+
i(local) {
|
|
73
|
+
if (current) return;
|
|
74
|
+
transition_in(roomlabelitem.$$.fragment, local);
|
|
75
|
+
current = true;
|
|
76
|
+
},
|
|
77
|
+
o(local) {
|
|
78
|
+
transition_out(roomlabelitem.$$.fragment, local);
|
|
79
|
+
current = false;
|
|
80
|
+
},
|
|
81
|
+
d(detaching) {
|
|
82
|
+
if (detaching) detach(first);
|
|
83
|
+
destroy_component(roomlabelitem, detaching);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function create_fragment(ctx) {
|
|
89
|
+
let div;
|
|
90
|
+
let each_blocks = [];
|
|
91
|
+
let each_1_lookup = new Map();
|
|
92
|
+
let div_resize_listener;
|
|
93
|
+
let current;
|
|
94
|
+
let each_value = /*roomLabels*/ ctx[0];
|
|
95
|
+
const get_key = ctx => /*roomLableItem*/ ctx[9].id;
|
|
96
|
+
|
|
97
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
98
|
+
let child_ctx = get_each_context(ctx, each_value, i);
|
|
99
|
+
let key = get_key(child_ctx);
|
|
100
|
+
each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
c() {
|
|
105
|
+
div = element("div");
|
|
106
|
+
|
|
107
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
108
|
+
each_blocks[i].c();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
attr(div, "class", "room-labels-container svelte-185yvaa");
|
|
112
|
+
add_render_callback(() => /*div_elementresize_handler*/ ctx[4].call(div));
|
|
113
|
+
},
|
|
114
|
+
m(target, anchor) {
|
|
115
|
+
insert(target, div, anchor);
|
|
116
|
+
|
|
117
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
118
|
+
each_blocks[i].m(div, null);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
div_resize_listener = add_resize_listener(div, /*div_elementresize_handler*/ ctx[4].bind(div));
|
|
122
|
+
current = true;
|
|
123
|
+
},
|
|
124
|
+
p(ctx, [dirty]) {
|
|
125
|
+
if (dirty & /*roomLabels, five*/ 3) {
|
|
126
|
+
each_value = /*roomLabels*/ ctx[0];
|
|
127
|
+
group_outros();
|
|
128
|
+
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block, null, get_each_context);
|
|
129
|
+
check_outros();
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
i(local) {
|
|
133
|
+
if (current) return;
|
|
134
|
+
|
|
135
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
136
|
+
transition_in(each_blocks[i]);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
current = true;
|
|
140
|
+
},
|
|
141
|
+
o(local) {
|
|
142
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
143
|
+
transition_out(each_blocks[i]);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
current = false;
|
|
147
|
+
},
|
|
148
|
+
d(detaching) {
|
|
149
|
+
if (detaching) detach(div);
|
|
150
|
+
|
|
151
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
152
|
+
each_blocks[i].d();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
div_resize_listener();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function instance($$self, $$props, $$invalidate) {
|
|
161
|
+
let { five } = $$props;
|
|
162
|
+
let { roomLabels } = $$props;
|
|
163
|
+
let containerWidth;
|
|
164
|
+
let containerHeight;
|
|
165
|
+
|
|
166
|
+
function getLabelVisible(five, roomLabelItem) {
|
|
167
|
+
// 先看是不是在当前展示的楼层上
|
|
168
|
+
const isLabelInFloor = five.model.shownFloor === null || roomLabelItem.floorIndex === five.model.shownFloor;
|
|
169
|
+
|
|
170
|
+
if (!isLabelInFloor) return false;
|
|
171
|
+
|
|
172
|
+
// 再看是不是被模型遮挡
|
|
173
|
+
const raycaster = new Raycaster();
|
|
174
|
+
|
|
175
|
+
const cameraPosition = five.camera.position.clone();
|
|
176
|
+
const position = new Vector3(roomLabelItem.position.x, roomLabelItem.position.y, roomLabelItem.position.z);
|
|
177
|
+
const vectorDistance = position.distanceTo(cameraPosition);
|
|
178
|
+
raycaster.set(cameraPosition.clone(), position.clone().sub(cameraPosition).normalize());
|
|
179
|
+
const [intersection] = five.model.intersectRaycaster(raycaster);
|
|
180
|
+
if (intersection && intersection.distance + 1 < vectorDistance) return false;
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function getLabelTransform(five, roomLabelItem) {
|
|
185
|
+
const position = new Vector3(roomLabelItem.position.x, roomLabelItem.position.y, roomLabelItem.position.z);
|
|
186
|
+
const mouse = position.clone().project(five.camera);
|
|
187
|
+
const xOffset = Math.ceil((mouse.x + 1) / 2 * containerWidth);
|
|
188
|
+
const yOffset = Math.ceil((-mouse.y + 1) / 2 * containerHeight);
|
|
189
|
+
return `translate(${xOffset}px, ${yOffset}px)`;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function getFormatedRoomLabels(five, labels) {
|
|
193
|
+
const newLabels = labels.map(roomLabelItem => {
|
|
194
|
+
// 计算是否可见,入股不可见,不会更新位置
|
|
195
|
+
const visible = getLabelVisible(five, roomLabelItem);
|
|
196
|
+
|
|
197
|
+
if (!visible) return { ...roomLabelItem, visible };
|
|
198
|
+
|
|
199
|
+
// 更新位置
|
|
200
|
+
const transform = getLabelTransform(five, roomLabelItem);
|
|
201
|
+
|
|
202
|
+
return { ...roomLabelItem, visible, transform };
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
const sortedRoomLabelItems = newLabels.filter(({ visible }) => visible).map(roomLabelItem => ({
|
|
206
|
+
roomLabelItem,
|
|
207
|
+
distance: new Vector3(...Object.values(roomLabelItem.position)).clone().distanceTo(five.camera.position)
|
|
208
|
+
})).sort((a, b) => a.distance - b.distance);
|
|
209
|
+
|
|
210
|
+
return newLabels.map(roomLabelItem => {
|
|
211
|
+
const sortIndex = sortedRoomLabelItems.findIndex(item => item.roomLabelItem.id === roomLabelItem.id);
|
|
212
|
+
if (sortIndex !== undefined) return { ...roomLabelItem, zIndex: sortIndex * 10 };
|
|
213
|
+
return roomLabelItem;
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function onFiveCameraUpdate() {
|
|
218
|
+
$$invalidate(0, roomLabels = getFormatedRoomLabels(five, roomLabels));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
five.on('cameraUpdate', onFiveCameraUpdate);
|
|
222
|
+
|
|
223
|
+
onDestroy(() => {
|
|
224
|
+
five.off('cameraUpdate', onFiveCameraUpdate);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
onMount(() => {
|
|
228
|
+
onFiveCameraUpdate();
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
function div_elementresize_handler() {
|
|
232
|
+
containerWidth = this.clientWidth;
|
|
233
|
+
containerHeight = this.clientHeight;
|
|
234
|
+
$$invalidate(2, containerWidth);
|
|
235
|
+
$$invalidate(3, containerHeight);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
$$self.$$set = $$props => {
|
|
239
|
+
if ('five' in $$props) $$invalidate(1, five = $$props.five);
|
|
240
|
+
if ('roomLabels' in $$props) $$invalidate(0, roomLabels = $$props.roomLabels);
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
return [roomLabels, five, containerWidth, containerHeight, div_elementresize_handler];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
class Component extends SvelteComponent {
|
|
247
|
+
constructor(options) {
|
|
248
|
+
super();
|
|
249
|
+
init(this, options, instance, create_fragment, safe_not_equal, { five: 1, roomLabels: 0 }, add_css);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export default Component;
|
|
@@ -5,6 +5,7 @@ import * as THREE from 'three';
|
|
|
5
5
|
*/
|
|
6
6
|
export const ModelViewPlugin = (five) => {
|
|
7
7
|
let needsRender = true;
|
|
8
|
+
let renderer = null;
|
|
8
9
|
const scene = new THREE.Scene();
|
|
9
10
|
const camera = new THREE.PerspectiveCamera(60, 1, 0.1, 1000);
|
|
10
11
|
let model = new THREE.Object3D();
|
|
@@ -22,7 +23,6 @@ export const ModelViewPlugin = (five) => {
|
|
|
22
23
|
scene.add(light);
|
|
23
24
|
}
|
|
24
25
|
scene.add(model);
|
|
25
|
-
let renderer = null;
|
|
26
26
|
const initRendererIfNeeds = () => {
|
|
27
27
|
if (!five.renderer)
|
|
28
28
|
return;
|
|
@@ -35,7 +35,7 @@ export const ModelViewPlugin = (five) => {
|
|
|
35
35
|
}
|
|
36
36
|
return renderer;
|
|
37
37
|
};
|
|
38
|
-
const
|
|
38
|
+
const handleModelWillLoad = () => {
|
|
39
39
|
model.traverse((object) => {
|
|
40
40
|
if (object instanceof THREE.Mesh) {
|
|
41
41
|
const materials = [].concat(object.material);
|
|
@@ -47,7 +47,7 @@ export const ModelViewPlugin = (five) => {
|
|
|
47
47
|
scene.add(model);
|
|
48
48
|
update();
|
|
49
49
|
};
|
|
50
|
-
const
|
|
50
|
+
const handleModelLoaded = () => {
|
|
51
51
|
function cloneMaterial(material) {
|
|
52
52
|
material = material.clone();
|
|
53
53
|
material.uniforms.modelAlpha.value = 1;
|
|
@@ -105,7 +105,7 @@ export const ModelViewPlugin = (five) => {
|
|
|
105
105
|
camera.aspect = width / height;
|
|
106
106
|
camera.updateProjectionMatrix();
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
update();
|
|
109
109
|
};
|
|
110
110
|
const cameraDistance = () => {
|
|
111
111
|
const bounding = five.model.bounding;
|
|
@@ -150,8 +150,8 @@ export const ModelViewPlugin = (five) => {
|
|
|
150
150
|
renderer.dispose();
|
|
151
151
|
renderer = null;
|
|
152
152
|
};
|
|
153
|
-
five.on('modelLoaded',
|
|
154
|
-
five.on('modelWillLoad',
|
|
153
|
+
five.on('modelLoaded', handleModelLoaded);
|
|
154
|
+
five.on('modelWillLoad', handleModelWillLoad);
|
|
155
155
|
five.on('cameraDirectionUpdate', update);
|
|
156
156
|
five.on('dispose', dispose);
|
|
157
157
|
five.on('renderFrame', render);
|
|
@@ -5,15 +5,15 @@ export interface PanoCompassPluginParameterType {
|
|
|
5
5
|
entryDoorImageUrl?: string;
|
|
6
6
|
}
|
|
7
7
|
export interface PanoCompassPluginData {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
north_rad: null | number;
|
|
9
|
+
entrance: null | undefined | {
|
|
10
10
|
position: {
|
|
11
11
|
x: number;
|
|
12
12
|
y: number;
|
|
13
13
|
z: number;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
room_observers: {
|
|
16
|
+
room_observers: undefined | {
|
|
17
17
|
index: number;
|
|
18
18
|
floor_index: number;
|
|
19
19
|
room: FloorplanServerRoomItem;
|
|
@@ -53,23 +53,28 @@ class PanoCompassController {
|
|
|
53
53
|
async init() {
|
|
54
54
|
if (!this.data || !this.modelLoaded)
|
|
55
55
|
return;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this.
|
|
56
|
+
const northRad = this.data.north_rad;
|
|
57
|
+
if (northRad != null) {
|
|
58
|
+
this.compassMesh = await this.loadCompassMesh();
|
|
59
|
+
this.compassMesh.rotateX(-Math.PI / 2);
|
|
60
|
+
this.compassMesh.rotateZ(northRad - Math.PI / 2);
|
|
61
|
+
this.group.add(this.compassMesh);
|
|
62
|
+
}
|
|
63
|
+
if (this.data.entrance != null) {
|
|
64
|
+
this.entryDoorMesh = await this.loadEntryDoorMesh();
|
|
65
|
+
this.roomInfoWrapperInstance = this.loadRoomInfo();
|
|
66
|
+
this.roomInfoInstance = getRoomInfoInstance();
|
|
67
|
+
this.entryDoorMesh.rotateX(-Math.PI / 2);
|
|
68
|
+
if (this.roomInfoWrapperInstance)
|
|
69
|
+
this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
|
|
70
|
+
this.group.add(this.entryDoorMesh);
|
|
71
|
+
}
|
|
64
72
|
this.onFivePanoArrived(this.five.panoIndex || 0);
|
|
65
|
-
this.group.add(this.compassMesh);
|
|
66
|
-
this.group.add(this.entryDoorMesh);
|
|
67
|
-
if (this.roomInfoWrapperInstance)
|
|
68
|
-
this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
|
|
69
73
|
this.five.needsRender = true;
|
|
70
74
|
}
|
|
71
75
|
async loadCompassMesh() {
|
|
72
|
-
const compassImageUrl = this.config?.compassImageUrl ||
|
|
76
|
+
const compassImageUrl = this.config?.compassImageUrl ||
|
|
77
|
+
'//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png';
|
|
73
78
|
const compassTexture = await loadTexture(compassImageUrl);
|
|
74
79
|
const compassGeometry = new THREE.CircleGeometry(0.7, 32);
|
|
75
80
|
const compassMaterial = new THREE.MeshBasicMaterial({
|
|
@@ -83,7 +88,8 @@ class PanoCompassController {
|
|
|
83
88
|
return compassMesh;
|
|
84
89
|
}
|
|
85
90
|
async loadEntryDoorMesh() {
|
|
86
|
-
const entryDoorImageUrl = this.config?.entryDoorImageUrl ||
|
|
91
|
+
const entryDoorImageUrl = this.config?.entryDoorImageUrl ||
|
|
92
|
+
'//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png';
|
|
87
93
|
const entryDoorTexture = await loadTexture(entryDoorImageUrl);
|
|
88
94
|
const entryDoorGeometry = new THREE.PlaneGeometry(0.2, 0.16);
|
|
89
95
|
const entryDoorMaterial = new THREE.MeshBasicMaterial({
|
|
@@ -113,42 +119,48 @@ class PanoCompassController {
|
|
|
113
119
|
this.compassMesh?.material.setValues({ opacity: 0 });
|
|
114
120
|
};
|
|
115
121
|
onFivePanoArrived = (panoIndex) => {
|
|
116
|
-
if (!this.compassMesh || !this.entryDoorMesh || !this.roomInfoInstance || !this.roomInfoWrapperInstance)
|
|
117
|
-
return;
|
|
118
|
-
if (!this.data)
|
|
119
|
-
return;
|
|
120
122
|
// ======== fix compass position ========
|
|
121
123
|
const standingPosition = this.five.work.observers[panoIndex].standingPosition;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
if (this.compassMesh) {
|
|
125
|
+
// 指南针上移 0.01m,防止与地板重合
|
|
126
|
+
this.compassMesh.position.copy(standingPosition.clone().setY(standingPosition.y + 0.01));
|
|
127
|
+
if (this.compassMesh.material.opacity !== 0)
|
|
128
|
+
return;
|
|
129
|
+
this.compassMeshTween?.dispose();
|
|
130
|
+
this.compassMeshTween = tweenProgress(1000)
|
|
131
|
+
.onUpdate(({ progress }) => {
|
|
132
|
+
this.compassMesh?.material.setValues({ opacity: progress });
|
|
133
|
+
this.five.needsRender = true;
|
|
134
|
+
})
|
|
135
|
+
.play();
|
|
136
|
+
}
|
|
124
137
|
// ======== fix entry door label position and rotation ========
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
if (this.entryDoorMesh) {
|
|
139
|
+
const entryDoorPosition = new THREE.Vector3(this.data.entrance.position.x, this.data.entrance.position.y, this.data.entrance.position.z);
|
|
140
|
+
const panoToEntryDoorVector = entryDoorPosition
|
|
141
|
+
.clone()
|
|
142
|
+
.setY(standingPosition.y)
|
|
143
|
+
.sub(standingPosition)
|
|
144
|
+
.normalize();
|
|
145
|
+
const compassEntryDoorPosition = standingPosition
|
|
146
|
+
.clone()
|
|
147
|
+
.add(panoToEntryDoorVector.clone().multiplyScalar(0.7))
|
|
148
|
+
.setY(standingPosition.y + 0.01);
|
|
149
|
+
this.entryDoorMesh.rotation.z = new THREE.Vector3(0, 0, -1).angleTo(panoToEntryDoorVector);
|
|
150
|
+
this.entryDoorMesh.position.copy(compassEntryDoorPosition);
|
|
151
|
+
// 不是客厅时,隐藏入户门指引
|
|
152
|
+
this.data?.room_observers[panoIndex].room.type === 1
|
|
153
|
+
? this.entryDoorMesh?.material.setValues({ opacity: 1 })
|
|
154
|
+
: this.entryDoorMesh?.material.setValues({ opacity: 0 });
|
|
155
|
+
}
|
|
133
156
|
// ======== fix room info ========
|
|
134
|
-
this.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
? this.entryDoorMesh?.material.setValues({ opacity: 1 })
|
|
139
|
-
: this.entryDoorMesh?.material.setValues({ opacity: 0 });
|
|
157
|
+
if (this.roomInfoInstance && this.roomInfoWrapperInstance) {
|
|
158
|
+
this.roomInfoWrapperInstance.css3DObject.position.copy(standingPosition.clone().setY(standingPosition.y + 0.01));
|
|
159
|
+
this.roomInfoInstance.setRoom(this.data.room_observers[panoIndex].room);
|
|
160
|
+
}
|
|
140
161
|
this.five.needsRender = true;
|
|
141
|
-
if (this.compassMesh.material.opacity !== 0)
|
|
142
|
-
return;
|
|
143
|
-
this.compassMeshTween?.dispose();
|
|
144
|
-
this.compassMeshTween = tweenProgress(1000)
|
|
145
|
-
.onUpdate(({ progress }) => {
|
|
146
|
-
this.compassMesh?.material.setValues({ opacity: progress });
|
|
147
|
-
this.five.needsRender = true;
|
|
148
|
-
})
|
|
149
|
-
.play();
|
|
150
162
|
};
|
|
151
|
-
onFiveCameraDirectionUpdate = ({ longitude, latitude }) => {
|
|
163
|
+
onFiveCameraDirectionUpdate = ({ longitude, latitude, }) => {
|
|
152
164
|
if (!this.roomInfoWrapperInstance)
|
|
153
165
|
return;
|
|
154
166
|
this.roomInfoWrapperInstance.css3DObject.rotation.z = longitude;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import Line from '../Model/line';
|
|
2
|
+
import Magnifier from '../Modules/Magnifier';
|
|
3
|
+
import FiveHelper from '../Modules/FiveHelper';
|
|
4
|
+
import { Group } from 'three';
|
|
5
|
+
import { Model } from '../Model';
|
|
6
|
+
import { PluginEvent } from '../typings/event.type';
|
|
7
|
+
import { Five, Intersection, IntersectMeshInterface, Subscribe } from '@realsee/five';
|
|
8
|
+
import { UserDistanceItem } from '../utils/distanceDom';
|
|
9
|
+
export interface IControllerParams {
|
|
10
|
+
five: Five;
|
|
11
|
+
group: Group;
|
|
12
|
+
model: Model;
|
|
13
|
+
mouseGroup: Group;
|
|
14
|
+
container: Element;
|
|
15
|
+
magnifier: Magnifier;
|
|
16
|
+
fiveHelper: FiveHelper;
|
|
17
|
+
hook: Subscribe<PluginEvent>;
|
|
18
|
+
userDistanceItemCreator?: () => UserDistanceItem;
|
|
19
|
+
}
|
|
20
|
+
export default abstract class BaseController {
|
|
21
|
+
protected five: Five;
|
|
22
|
+
protected group: Group;
|
|
23
|
+
protected model: Model;
|
|
24
|
+
protected disposed: boolean;
|
|
25
|
+
protected mouseGroup: Group;
|
|
26
|
+
protected container: Element;
|
|
27
|
+
protected fiveHelper: FiveHelper;
|
|
28
|
+
protected hook: IControllerParams['hook'];
|
|
29
|
+
protected magnifier: IControllerParams['magnifier'];
|
|
30
|
+
protected userDistanceItemCreator: IControllerParams['userDistanceItemCreator'];
|
|
31
|
+
constructor(params: IControllerParams);
|
|
32
|
+
protected removeLine(line: Line): void;
|
|
33
|
+
protected updateDistanceUI: () => void;
|
|
34
|
+
protected updateMouseGroup(intersection: Intersection, mesh?: IntersectMeshInterface): Group;
|
|
35
|
+
protected dispose(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { preventDefault } from '../utils/ironbox';
|
|
2
|
+
export default class BaseController {
|
|
3
|
+
five;
|
|
4
|
+
group;
|
|
5
|
+
model;
|
|
6
|
+
disposed = false;
|
|
7
|
+
mouseGroup;
|
|
8
|
+
container;
|
|
9
|
+
fiveHelper;
|
|
10
|
+
hook;
|
|
11
|
+
magnifier;
|
|
12
|
+
userDistanceItemCreator;
|
|
13
|
+
constructor(params) {
|
|
14
|
+
// ==================== Params ====================
|
|
15
|
+
this.five = params.five;
|
|
16
|
+
this.hook = params.hook;
|
|
17
|
+
this.model = params.model;
|
|
18
|
+
this.magnifier = params.magnifier;
|
|
19
|
+
this.container = params.container;
|
|
20
|
+
this.fiveHelper = params.fiveHelper;
|
|
21
|
+
this.userDistanceItemCreator = params.userDistanceItemCreator;
|
|
22
|
+
// ==================== Groups ====================
|
|
23
|
+
this.group = params.group;
|
|
24
|
+
this.mouseGroup = params.mouseGroup;
|
|
25
|
+
const fiveElement = this.five.getElement();
|
|
26
|
+
if (fiveElement) {
|
|
27
|
+
fiveElement.addEventListener('touchstart', preventDefault);
|
|
28
|
+
fiveElement.addEventListener('contextmenu', preventDefault);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
removeLine(line) {
|
|
32
|
+
this.group.remove(line.mesh, line.lightMesh);
|
|
33
|
+
line.distanceItem.remove();
|
|
34
|
+
this.five.needsRender = true;
|
|
35
|
+
}
|
|
36
|
+
updateDistanceUI = () => {
|
|
37
|
+
this.model.lines.forEach((line) => line.distanceItem.update(this.five));
|
|
38
|
+
};
|
|
39
|
+
updateMouseGroup(intersection, mesh) {
|
|
40
|
+
if (!intersection)
|
|
41
|
+
return this.mouseGroup;
|
|
42
|
+
// ============ update mouseGroup position ============
|
|
43
|
+
const adsorbentPoint = this.fiveHelper.getAdsorbentPoint(intersection);
|
|
44
|
+
const viewPosition = adsorbentPoint ? adsorbentPoint : intersection.point;
|
|
45
|
+
this.mouseGroup.position.copy(viewPosition);
|
|
46
|
+
// ============ update mouseGroup quaternion ============
|
|
47
|
+
if (mesh) {
|
|
48
|
+
this.mouseGroup.quaternion.copy(mesh.quaternion);
|
|
49
|
+
}
|
|
50
|
+
else if (intersection.face) {
|
|
51
|
+
const normal = intersection.face.normal;
|
|
52
|
+
const positionVector = normal.clone().multiplyScalar(0.05);
|
|
53
|
+
const position = intersection.point.clone().add(positionVector);
|
|
54
|
+
const lookAtVector = position.clone().add(positionVector);
|
|
55
|
+
this.mouseGroup.lookAt(lookAtVector);
|
|
56
|
+
}
|
|
57
|
+
return this.mouseGroup;
|
|
58
|
+
}
|
|
59
|
+
dispose() {
|
|
60
|
+
this.disposed = true;
|
|
61
|
+
this.magnifier.dispose();
|
|
62
|
+
this.model.lines.forEach((line) => this.removeLine(line));
|
|
63
|
+
const fiveElement = this.five.getElement();
|
|
64
|
+
if (fiveElement) {
|
|
65
|
+
fiveElement.removeEventListener('touchstart', preventDefault);
|
|
66
|
+
fiveElement.removeEventListener('contextmenu', preventDefault);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|