@realsee/dnalogel 2.0.0-alpha.7 → 2.0.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -28
- package/components/index.js +1450 -0
- package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/dist/CSS3DRenderPlugin/index.d.ts +4 -0
- package/dist/CSS3DRenderPlugin/index.js +234 -0
- package/dist/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +7 -0
- package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/dist/CameraMovementPlugin/index.d.ts +5 -0
- package/dist/CameraMovementPlugin/index.js +302 -0
- package/dist/CameraMovementPlugin/typing.d.ts +68 -0
- package/dist/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/dist/ItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.d.ts +9 -0
- package/dist/ItemLabelPlugin/index.js +941 -0
- package/dist/ItemLabelPlugin/typings.d.ts +59 -0
- package/dist/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/dist/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/dist/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/dist/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/dist/ModelChassisCompassPlugin/index.d.ts +4 -0
- package/dist/ModelChassisCompassPlugin/index.js +145 -0
- package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/dist/ModelEntryDoorGuidePlugin/index.d.ts +4 -0
- package/dist/ModelEntryDoorGuidePlugin/index.js +196 -0
- package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/dist/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.d.ts +9 -0
- package/dist/ModelItemLabelPlugin/index.js +674 -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 +541 -0
- package/dist/ModelRoomLabelPlugin/typings.d.ts +35 -0
- package/dist/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
- package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/dist/ModelTVVideoPlugin/index.d.ts +5 -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/Plugin.d.ts +17 -0
- package/dist/ModelViewPlugin/index.d.ts +4 -0
- package/dist/ModelViewPlugin/index.js +187 -0
- package/dist/PanoCompassPlugin/Assets/roomInfoIcon.d.ts +1 -0
- package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/dist/PanoCompassPlugin/getRoomInfoInstance.d.ts +8 -0
- package/dist/PanoCompassPlugin/index.d.ts +8 -0
- package/dist/PanoCompassPlugin/index.js +636 -0
- package/dist/PanoCursorRaycasterPlugin/index.d.ts +48 -0
- package/dist/PanoCursorRaycasterPlugin/index.js +90 -0
- package/dist/PanoMeasurePlugin/Controller/BaseController.d.ts +39 -0
- package/dist/PanoMeasurePlugin/Controller/EditController.d.ts +52 -0
- package/dist/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/dist/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Controller/WatchController.d.ts +26 -0
- package/dist/PanoMeasurePlugin/Controller/index.d.ts +70 -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 +25 -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 +59 -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/NewMainBtnController.d.ts +12 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +13 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/index.d.ts +20 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/dist/PanoMeasurePlugin/Modules/UIController/style.d.ts +19 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/dist/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/dist/PanoMeasurePlugin/index.d.ts +10 -0
- package/dist/PanoMeasurePlugin/index.js +3996 -0
- package/dist/PanoMeasurePlugin/typings/data.d.ts +32 -0
- package/dist/PanoMeasurePlugin/typings/event.type.d.ts +37 -0
- package/dist/PanoMeasurePlugin/typings/utils.type.d.ts +1 -0
- package/dist/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -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/Plugin.d.ts +31 -0
- package/dist/PanoRulerPlugin/index.d.ts +5 -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/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/dist/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/dist/PanoSpatialTagPlugin/index.js +1307 -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/base/BasePlugin.d.ts +100 -0
- package/dist/base/BasePluginWithData.d.ts +34 -0
- package/dist/components/PaintBrush/Controller.d.ts +43 -0
- package/dist/components/PaintBrush/Subscribe.d.ts +76 -0
- package/dist/components/PaintBrush/index.d.ts +27 -0
- package/dist/components/PaintBrush/style.d.ts +2 -0
- package/dist/components/PaintBrush/tween.d.ts +62 -0
- package/dist/components/PaintBrush/typings.d.ts +58 -0
- package/dist/components/PaintBrush/utils.d.ts +26 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/floorplan/Assets/camera.d.ts +1 -0
- package/dist/floorplan/Assets/compass.d.ts +1 -0
- package/dist/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/Controller.d.ts +97 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.d.ts +7 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.js +4526 -0
- package/dist/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -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 +36 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.d.ts +7 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +2008 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/dist/floorplan/TopviewFloorplanPlugin/Controller.d.ts +67 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.d.ts +7 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.js +4236 -0
- package/dist/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
- package/dist/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/dist/floorplan/constant.d.ts +5 -0
- package/dist/floorplan/index.d.ts +6 -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/constant.d.ts +22 -0
- package/dist/floorplan/utils/correctFiveState.d.ts +15 -0
- package/dist/floorplan/utils/formatData.d.ts +5 -0
- package/dist/floorplan/utils/formatPosition.d.ts +36 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.es.js +15436 -0
- package/dist/index.js +15488 -0
- package/dist/index.umd.js +15480 -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 +5 -0
- package/dist/shared-utils/formatRad.d.ts +7 -0
- package/dist/shared-utils/getPxmm.d.ts +19 -0
- package/dist/shared-utils/getRandomColor.d.ts +1 -0
- package/dist/shared-utils/index.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/Interval.d.ts +13 -0
- package/dist/shared-utils/math/Rectangle.d.ts +27 -0
- package/dist/shared-utils/math/evenNumber.d.ts +3 -0
- package/dist/shared-utils/math/index.d.ts +2 -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/uuid.d.ts +5 -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/Magnifier.html +9 -0
- package/docs/classes/ModelRoomLabelController.html +17 -0
- package/docs/enums/CameraMovementEffect.html +3 -0
- package/docs/enums/DIRECTION.html +1 -0
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -0
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -0
- package/docs/enums/Rotation.html +3 -0
- package/docs/index.html +88 -0
- package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
- package/docs/interfaces/FloorplanBounding.html +10 -0
- package/docs/interfaces/FloorplanData.html +3 -0
- package/docs/interfaces/FloorplanEntrance.html +15 -0
- package/docs/interfaces/FloorplanExtraObject.html +7 -0
- package/docs/interfaces/FloorplanExtraObject3D.html +3 -0
- package/docs/interfaces/FloorplanFloorData.html +3 -0
- package/docs/interfaces/FloorplanImagePosition.html +3 -0
- package/docs/interfaces/FloorplanObserver.html +5 -0
- package/docs/interfaces/FloorplanOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanPosition.html +3 -0
- package/docs/interfaces/FloorplanRoomItem.html +17 -0
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -0
- package/docs/interfaces/FloorplanServerBounding.html +10 -0
- package/docs/interfaces/FloorplanServerComputedData.html +1 -0
- package/docs/interfaces/FloorplanServerData.html +3 -0
- package/docs/interfaces/FloorplanServerEntrance.html +15 -0
- package/docs/interfaces/FloorplanServerFloorData.html +3 -0
- package/docs/interfaces/FloorplanServerImagePosition.html +3 -0
- package/docs/interfaces/FloorplanServerObserver.html +5 -0
- package/docs/interfaces/FloorplanServerOutlineItem.html +3 -0
- package/docs/interfaces/FloorplanServerPosition.html +3 -0
- package/docs/interfaces/FloorplanServerRoomItem.html +20 -0
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -0
- package/docs/interfaces/ItemLabelPluginData.html +1 -0
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -0
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -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/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/ModelViewPluginExportType.html +1 -0
- package/docs/interfaces/OpenParameter.html +3 -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/PanoCursorRaycasterPluginParameterType.html +1 -0
- package/docs/interfaces/PanoMeasureParameterType.html +1 -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/PanoSpatialTagPluginContentEvent.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
- package/docs/interfaces/Point.html +1 -0
- package/docs/interfaces/PointJson.html +1 -0
- package/docs/interfaces/Room.html +1 -0
- package/docs/interfaces/RoomInfo.html +1 -0
- package/docs/interfaces/RoomLabel.html +13 -0
- package/docs/interfaces/RoomRules.html +1 -0
- package/docs/interfaces/Rooms.html +1 -0
- package/docs/modules.html +34 -0
- package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
- package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
- package/libs/CSS3DRenderPlugin/index.js +2 -180
- package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
- package/libs/CameraMovementPlugin/index.d.ts +4 -6
- package/libs/CameraMovementPlugin/index.js +3 -158
- package/libs/CameraMovementPlugin/typing.d.ts +1 -1
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +577 -0
- package/libs/ItemLabelPlugin/ItemLabelItem.js +227 -0
- package/libs/ItemLabelPlugin/Plugin.d.ts +4 -0
- package/libs/ItemLabelPlugin/Plugin.js +120 -0
- package/libs/ItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ItemLabelPlugin/events.type.js +1 -0
- package/libs/ItemLabelPlugin/index.d.ts +9 -0
- package/libs/ItemLabelPlugin/index.js +8 -0
- package/libs/ItemLabelPlugin/typings.d.ts +59 -0
- package/libs/ItemLabelPlugin/typings.js +7 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.d.ts +1 -0
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +3 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.d.ts +5 -0
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.d.ts +6 -0
- package/libs/ItemLabelPlugin/utils/isImpacted.js +13 -0
- package/libs/ItemLabelPlugin/utils/parseData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/parseData.js +4 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.d.ts +3 -0
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +4 -0
- package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
- package/libs/ModelChassisCompassPlugin/Plugin.js +77 -0
- package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
- package/libs/ModelChassisCompassPlugin/index.js +2 -74
- package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
- package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
- package/libs/ModelEntryDoorGuidePlugin/index.js +2 -135
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +409 -0
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +133 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
- package/libs/ModelItemLabelPlugin/events.type.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/events.type.js +1 -0
- package/libs/ModelItemLabelPlugin/index.d.ts +9 -0
- package/libs/ModelItemLabelPlugin/index.js +8 -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 +291 -0
- package/libs/ModelRoomLabelPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelSimulationPlugin/index.d.ts +33 -0
- package/libs/ModelSimulationPlugin/index.js +166 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/fragment.js +96 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.d.ts +2 -0
- package/libs/ModelSimulationPlugin/shaders/vertex.js +23 -0
- package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
- package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
- package/libs/ModelTVVideoPlugin/index.d.ts +5 -0
- package/libs/ModelTVVideoPlugin/index.js +4 -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/Plugin.d.ts +17 -0
- package/libs/ModelViewPlugin/Plugin.js +160 -0
- package/libs/ModelViewPlugin/index.d.ts +3 -16
- package/libs/ModelViewPlugin/index.js +2 -159
- package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
- package/libs/PanoCompassPlugin/Plugin.js +249 -0
- package/libs/PanoCompassPlugin/index.d.ts +4 -47
- package/libs/PanoCompassPlugin/index.js +3 -167
- package/libs/PanoCursorRaycasterPlugin/index.d.ts +1 -1
- package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
- package/libs/PanoMeasurePlugin/Controller/BaseController.d.ts +12 -9
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +77 -14
- package/libs/PanoMeasurePlugin/Controller/EditController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
- package/libs/PanoMeasurePlugin/Controller/MixedController.d.ts +44 -0
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +337 -0
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
- package/libs/PanoMeasurePlugin/Controller/WatchController.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +246 -153
- package/libs/PanoMeasurePlugin/Controller/index.d.ts +18 -9
- package/libs/PanoMeasurePlugin/Controller/index.js +182 -54
- package/libs/PanoMeasurePlugin/Model/index.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/index.js +30 -5
- package/libs/PanoMeasurePlugin/Model/line.d.ts +5 -5
- package/libs/PanoMeasurePlugin/Model/line.js +61 -11
- package/libs/PanoMeasurePlugin/Model/point.d.ts +2 -2
- package/libs/PanoMeasurePlugin/Model/point.js +24 -4
- package/libs/PanoMeasurePlugin/Model/polyline.d.ts +3 -3
- package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +11 -14
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.d.ts +5 -2
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +107 -25
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
- package/libs/PanoMeasurePlugin/Modules/GuideController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
- package/libs/PanoMeasurePlugin/Modules/Magnifier.d.ts +50 -15
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +234 -59
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.d.ts +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +84 -38
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.d.ts +12 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/NewMainBtnController.js +98 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.d.ts +2 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
- package/libs/PanoMeasurePlugin/Modules/UIController/index.d.ts +5 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +84 -34
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +80 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.d.ts +2 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +11 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.d.ts +4 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +64 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.d.ts +42 -0
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +265 -0
- package/libs/PanoMeasurePlugin/index.d.ts +9 -6
- package/libs/PanoMeasurePlugin/index.js +3 -1
- package/libs/PanoMeasurePlugin/typings/data.d.ts +4 -0
- package/libs/PanoMeasurePlugin/typings/event.type.d.ts +14 -5
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.d.ts +10 -0
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +15 -0
- package/libs/PanoMeasurePlugin/utils/clearGroup.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/constants.js +7 -7
- package/libs/PanoMeasurePlugin/utils/distanceDom.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +22 -16
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.d.ts +3 -3
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/line.js +8 -7
- package/libs/PanoMeasurePlugin/utils/mouseGroup.d.ts +2 -2
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +5 -5
- package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
- package/libs/PanoRulerPlugin/Plugin.js +403 -0
- package/libs/PanoRulerPlugin/index.d.ts +4 -30
- package/libs/PanoRulerPlugin/index.js +2 -397
- package/libs/PanoSpatialTagPlugin/Components/origins.js +168 -0
- package/libs/PanoSpatialTagPlugin/Components/tag.js +302 -0
- package/libs/PanoSpatialTagPlugin/Plugin.d.ts +35 -0
- package/libs/PanoSpatialTagPlugin/Plugin.js +426 -0
- package/libs/PanoSpatialTagPlugin/index.d.ts +5 -0
- package/libs/PanoSpatialTagPlugin/index.js +5 -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/base/BasePlugin.d.ts +100 -0
- package/libs/base/BasePlugin.js +31 -0
- package/libs/base/BasePluginWithData.d.ts +34 -0
- package/libs/base/BasePluginWithData.js +4 -0
- package/libs/components/PaintBrush/Controller.d.ts +43 -0
- package/libs/components/PaintBrush/Controller.js +575 -0
- package/libs/components/PaintBrush/Subscribe.d.ts +76 -0
- package/libs/components/PaintBrush/Subscribe.js +121 -0
- package/libs/components/PaintBrush/index.d.ts +27 -0
- package/libs/components/PaintBrush/index.js +57 -0
- package/libs/components/PaintBrush/style.d.ts +2 -0
- package/libs/components/PaintBrush/style.js +102 -0
- package/libs/components/PaintBrush/tween.d.ts +62 -0
- package/libs/components/PaintBrush/tween.js +15 -0
- package/libs/components/PaintBrush/typings.d.ts +58 -0
- package/libs/components/PaintBrush/typings.js +6 -0
- package/libs/components/PaintBrush/utils.d.ts +26 -0
- package/libs/components/PaintBrush/utils.js +51 -0
- package/libs/components/index.d.ts +2 -0
- package/libs/components/index.js +3 -0
- package/libs/floorplan/Assets/compass.d.ts +1 -0
- package/libs/floorplan/Assets/compass.js +1 -0
- package/libs/floorplan/Components/BaseImage.js +222 -0
- package/libs/floorplan/Components/Camera.js +120 -0
- package/libs/floorplan/Components/Compass.js +120 -0
- package/libs/floorplan/Components/CurrentFloor.js +469 -0
- package/libs/floorplan/Components/Main.js +470 -0
- package/libs/floorplan/Components/Normalmage.js +63 -0
- package/libs/floorplan/Components/RoomHighlight/Room.js +107 -0
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +216 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +322 -0
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +309 -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 +104 -0
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +142 -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/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.d.ts +70 -77
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +661 -326
- package/libs/floorplan/ModelFloorplanPlugin/index.d.ts +5 -7
- package/libs/floorplan/ModelFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/ModelFloorplanPlugin/typing.d.ts +107 -0
- package/libs/floorplan/ModelFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +168 -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 +373 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +24 -16
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +195 -43
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.d.ts +5 -6
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +2 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.d.ts +52 -0
- package/libs/floorplan/PanoFloorplanRadarPlugin/typing.js +1 -0
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.d.ts +53 -47
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +450 -154
- package/libs/floorplan/TopviewFloorplanPlugin/index.d.ts +6 -4
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +2 -2
- package/libs/floorplan/TopviewFloorplanPlugin/style.js +1 -1
- package/libs/floorplan/TopviewFloorplanPlugin/typing.d.ts +86 -0
- package/libs/floorplan/TopviewFloorplanPlugin/typing.js +1 -0
- package/libs/floorplan/index.d.ts +6 -0
- package/libs/floorplan/index.js +7 -0
- package/libs/floorplan/utils/constant.d.ts +22 -0
- package/libs/floorplan/utils/constant.js +23 -0
- package/libs/floorplan/utils/correctFiveState.d.ts +15 -0
- package/libs/floorplan/utils/correctFiveState.js +46 -0
- package/libs/floorplan/utils/formatPosition.d.ts +1 -1
- package/libs/floorplan/utils/formatPosition.js +3 -3
- package/libs/index.d.ts +15 -24
- package/libs/index.js +25 -14
- 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/five/changeMode.d.ts +4 -1
- package/libs/shared-utils/five/changeMode.js +34 -13
- package/libs/shared-utils/getPxmm.d.ts +8 -0
- package/libs/shared-utils/getPxmm.js +25 -20
- package/libs/shared-utils/index.d.ts +1 -0
- package/libs/shared-utils/index.js +1 -0
- package/libs/shared-utils/math/Interval.d.ts +13 -0
- package/libs/shared-utils/math/Interval.js +40 -0
- package/libs/shared-utils/math/Rectangle.d.ts +27 -0
- package/libs/shared-utils/math/Rectangle.js +50 -0
- package/libs/shared-utils/math/evenNumber.js +1 -1
- package/libs/shared-utils/math/index.d.ts +2 -0
- package/libs/shared-utils/math/index.js +2 -0
- 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/uuid.d.ts +1 -0
- package/libs/shared-utils/uuid.js +1 -0
- package/libs/shared-utils/vectorTocoordinates.d.ts +1 -1
- package/package.json +29 -14
- package/CHANGELOG.md +0 -21
- package/dist/dnalogel.cjs.js +0 -7
- package/dist/dnalogel.es.js +0 -41280
- package/dist/dnalogel.umd.js +0 -7
- 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,166 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import vertexShader from './shaders/vertex';
|
|
3
|
+
import fragmentShader from './shaders/fragment';
|
|
4
|
+
import tap from '../shared-utils/tap';
|
|
5
|
+
const houseOutLinePath = [
|
|
6
|
+
[-3.089, -4.219], [-4.834, -4.219],
|
|
7
|
+
[-8.197, -4.219], [-10.31, -4.219],
|
|
8
|
+
[-10.31, -1.002], [-10.31, 0.835],
|
|
9
|
+
[-10.31, 3.927], [-11.237, 3.927],
|
|
10
|
+
[-11.237, 5.45], [-8.104, 5.45],
|
|
11
|
+
[-8.104, 4.557], [-6.914, 4.557],
|
|
12
|
+
[-6.244, 4.557], [-6.244, 5.436],
|
|
13
|
+
[-3.78, 5.436], [-0.356, 5.436],
|
|
14
|
+
[0.286, 5.436], [0.286, 4.073],
|
|
15
|
+
[0.286, 0.395], [2.31, 0.395],
|
|
16
|
+
[2.31, -1.323], [2.31, -4.199],
|
|
17
|
+
[0.468, -4.199], [0.468, -3.547],
|
|
18
|
+
[-2.969, -3.547], [-3.089, -3.547]
|
|
19
|
+
];
|
|
20
|
+
const defaultKeyframes = 50;
|
|
21
|
+
const defaultBoundingOffset = 0.2;
|
|
22
|
+
let isTexutreReady = false;
|
|
23
|
+
const ModelSimulationPlugin = (five, options) => {
|
|
24
|
+
let heatTexutres = [];
|
|
25
|
+
let geometryTexture = null;
|
|
26
|
+
let simulationMaterial = null;
|
|
27
|
+
let boundingMaterial = null;
|
|
28
|
+
let boundingMesh = null;
|
|
29
|
+
let originMaterial = null;
|
|
30
|
+
const enable = () => {
|
|
31
|
+
};
|
|
32
|
+
const disable = () => {
|
|
33
|
+
five.model.setMaterial(originMaterial);
|
|
34
|
+
};
|
|
35
|
+
const createBounding = (path, material) => {
|
|
36
|
+
const shape = tap(new THREE.Shape(), shape => {
|
|
37
|
+
shape.moveTo(path[path.length - 1][0], path[path.length - 1][1]);
|
|
38
|
+
path.forEach(xz => shape.lineTo(xz[0], xz[1]));
|
|
39
|
+
});
|
|
40
|
+
const settings = {
|
|
41
|
+
depth: options.simulationWorkData.houseHeight + 2 * options.simulationOptions.boundingOffset ?? defaultBoundingOffset,
|
|
42
|
+
bevelEnabled: false,
|
|
43
|
+
};
|
|
44
|
+
const geometry = new THREE.ExtrudeGeometry(shape, settings);
|
|
45
|
+
boundingMesh = new THREE.Mesh(geometry, material);
|
|
46
|
+
boundingMesh.rotateX(Math.PI / 2);
|
|
47
|
+
boundingMesh.translateZ(-options.simulationWorkData.houseHeight - options.simulationOptions.boundingOffset);
|
|
48
|
+
boundingMesh.updateMatrix();
|
|
49
|
+
boundingMesh.updateMatrixWorld();
|
|
50
|
+
return boundingMesh;
|
|
51
|
+
};
|
|
52
|
+
const createSimulationMaterial = (isBounding) => {
|
|
53
|
+
const simulationMaterial = new THREE.RawShaderMaterial({
|
|
54
|
+
uniforms: {
|
|
55
|
+
heatMap: { value: new THREE.Texture() },
|
|
56
|
+
geometryMap: { value: new THREE.Texture() },
|
|
57
|
+
colorMap: { value: new THREE.TextureLoader().load(options.simulationWorkData.colorMapPath) },
|
|
58
|
+
bboxMin: { value: new THREE.Vector3().fromArray(options.simulationWorkData.origin) },
|
|
59
|
+
bboxMax: { value: new THREE.Vector3().fromArray(options.simulationWorkData.origin).add(new THREE.Vector3(options.simulationWorkData.width, options.simulationWorkData.height, options.simulationWorkData.depth).multiplyScalar(options.simulationWorkData.step)) },
|
|
60
|
+
step: { value: options.simulationWorkData.step },
|
|
61
|
+
maxT: { value: options.simulationWorkData.maxT },
|
|
62
|
+
minT: { value: options.simulationWorkData.minT },
|
|
63
|
+
opacity: { value: isBounding ? options.simulationOptions.boundingOpacity : options.simulationOptions.globalOpacity }
|
|
64
|
+
},
|
|
65
|
+
vertexShader,
|
|
66
|
+
fragmentShader,
|
|
67
|
+
});
|
|
68
|
+
if (isBounding)
|
|
69
|
+
simulationMaterial.transparent = true;
|
|
70
|
+
return simulationMaterial;
|
|
71
|
+
};
|
|
72
|
+
const create3DTextureTask = (url) => {
|
|
73
|
+
return fetch(url)
|
|
74
|
+
.then(res => {
|
|
75
|
+
return res.arrayBuffer();
|
|
76
|
+
})
|
|
77
|
+
.then(res => {
|
|
78
|
+
const texture = new THREE.DataTexture3D(new Float32Array(res), options.simulationWorkData.width, options.simulationWorkData.height, options.simulationWorkData.depth);
|
|
79
|
+
texture.type = THREE.FloatType;
|
|
80
|
+
texture.format = THREE.RedFormat;
|
|
81
|
+
texture.minFilter = THREE.LinearMipmapLinearFilter;
|
|
82
|
+
texture.magFilter = THREE.LinearFilter;
|
|
83
|
+
texture.generateMipmaps = true;
|
|
84
|
+
texture.unpackAlignment = 1;
|
|
85
|
+
return texture;
|
|
86
|
+
})
|
|
87
|
+
.catch(err => console.error("拉取三维纹理数据时发生错误"));
|
|
88
|
+
};
|
|
89
|
+
const init = () => {
|
|
90
|
+
simulationMaterial = createSimulationMaterial(false);
|
|
91
|
+
boundingMaterial = createSimulationMaterial(true);
|
|
92
|
+
//加载外bounding
|
|
93
|
+
five.scene.add(createBounding(houseOutLinePath, boundingMaterial));
|
|
94
|
+
//缓存原来的材质
|
|
95
|
+
originMaterial = five.model.getMaterial();
|
|
96
|
+
five.model.traverse(obj => {
|
|
97
|
+
if (!(obj instanceof THREE.Mesh))
|
|
98
|
+
return;
|
|
99
|
+
if (Array.isArray(obj.material)) {
|
|
100
|
+
obj.material = obj.material.map(_mtl => simulationMaterial);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
obj.material = simulationMaterial;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
//温度数据
|
|
107
|
+
// const geometryTaskUrl = options.resourceUrl + 'geometry.vti'
|
|
108
|
+
const heatTextureTasks = [];
|
|
109
|
+
for (let i = 0; i < options.simulationWorkData.maxKeyframes; i++) {
|
|
110
|
+
const fileUrl = options.simulationWorkData.resourceUrl + i + '.vti';
|
|
111
|
+
heatTextureTasks.push(create3DTextureTask(fileUrl));
|
|
112
|
+
}
|
|
113
|
+
// //有效值数据
|
|
114
|
+
// create3DTextureTask(geometryTaskUrl)
|
|
115
|
+
// .then(texture => {
|
|
116
|
+
// simulationMaterial.uniforms.geometryMap.value = texture
|
|
117
|
+
// boundingMaterial.uniforms.geometryMap.value = texture
|
|
118
|
+
// })
|
|
119
|
+
// .catch(err => console.error("geometry texture loading failed"))
|
|
120
|
+
//加载首帧进行初始化
|
|
121
|
+
create3DTextureTask(options.simulationWorkData.resourceUrl + '0.vti')
|
|
122
|
+
.then(texture => {
|
|
123
|
+
simulationMaterial.uniforms.heatMap.value = texture;
|
|
124
|
+
boundingMaterial.uniforms.heatMap.value = texture;
|
|
125
|
+
five.needsRender = true;
|
|
126
|
+
})
|
|
127
|
+
.catch(err => console.error("loading textures failed"));
|
|
128
|
+
//加载全部
|
|
129
|
+
Promise.all(heatTextureTasks)
|
|
130
|
+
.then(textures => {
|
|
131
|
+
//缓存结果
|
|
132
|
+
isTexutreReady = true;
|
|
133
|
+
console.log("ready");
|
|
134
|
+
heatTexutres = textures;
|
|
135
|
+
})
|
|
136
|
+
.catch(err => console.error("loading textures failed"));
|
|
137
|
+
};
|
|
138
|
+
const play = () => {
|
|
139
|
+
if (!isTexutreReady)
|
|
140
|
+
throw new Error("textures are not ready yet,plz try again later");
|
|
141
|
+
let timeCount = 0;
|
|
142
|
+
const stop = setInterval(() => {
|
|
143
|
+
if (timeCount < options.simulationWorkData.maxKeyframes) {
|
|
144
|
+
simulationMaterial.uniforms.heatMap.value = heatTexutres[timeCount];
|
|
145
|
+
boundingMaterial.uniforms.heatMap.value = heatTexutres[timeCount];
|
|
146
|
+
timeCount++;
|
|
147
|
+
five.needsRender = true;
|
|
148
|
+
}
|
|
149
|
+
}, 1000 / options.simulationOptions.keyFrameRate ?? defaultKeyframes);
|
|
150
|
+
};
|
|
151
|
+
const dispose = () => {
|
|
152
|
+
simulationMaterial.dispose();
|
|
153
|
+
boundingMaterial.dispose();
|
|
154
|
+
boundingMesh.geometry.dispose();
|
|
155
|
+
geometryTexture.dispose();
|
|
156
|
+
heatTexutres.forEach(texture => texture.dispose());
|
|
157
|
+
};
|
|
158
|
+
return {
|
|
159
|
+
enable,
|
|
160
|
+
disable,
|
|
161
|
+
play,
|
|
162
|
+
init,
|
|
163
|
+
dispose
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
export default ModelSimulationPlugin;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare var _default: "#version 300 es\n#define MAX_STEPS 50\nprecision highp float;\nprecision highp sampler3D;\n\nuniform sampler3D heatMap;\nuniform sampler3D geometryMap;\nuniform sampler2D colorMap;\n\nuniform vec3 bboxMin;\nuniform vec3 bboxMax;\nuniform float step;\nuniform float minT;\nuniform float maxT;\nuniform float opacity;\n\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 linearToOutputTexel( vec4 value ) { return LinearTosRGB( value ); }\n\n\nfloat getHeatByLegalPos(vec3 pos){\n\tfloat geometryFactor = texture(geometryMap,pos).r;\n\tfloat legalFactor = clamp(geometryFactor,0.0,1.0);\n\treturn texture(heatMap,pos).r * legalFactor;\n}\n\nfloat sampleOc(vec3 pos){\n\t//平滑滤波步长\n\t//todo:可以作为define传入的外部常量还是直接传\n\tfloat step_x = step / (bboxMax.x - bboxMin.x) * 0.5;\n\tfloat step_y = step / (bboxMax.y - bboxMin.y) * 0.5;\n\tfloat step_z = step / (bboxMax.z - bboxMin.z) * 0.5;\n\tvec3 p1 = pos + vec3(step_x,step_y,step_z);\n\tvec3 p2 = pos + vec3(step_x,-step_y,step_z);\n\tvec3 p3 = pos + vec3(step_x,step_y,-step_z);\n\tvec3 p4 = pos + vec3(step_x,-step_y,-step_z);\n\tvec3 p5 = pos + vec3(-step_x,step_y,step_z);\n\tvec3 p6 = pos + vec3(-step_x,-step_y,step_z);\n\tvec3 p7 = pos + vec3(-step_x,step_y,-step_z);\n\tvec3 p8 = pos + vec3(-step_x,-step_y,-step_z);\n\n\treturn (getHeatByLegalPos(p1) + getHeatByLegalPos(p2) + getHeatByLegalPos(p3) + getHeatByLegalPos(p4) + getHeatByLegalPos(p5) + getHeatByLegalPos(p6) + getHeatByLegalPos(p7) + getHeatByLegalPos(p8)) * 0.125;\n\n}\n\n//考虑到有效仿真值连通域在三维空间中是封闭流形,这里直接按照normal方向搜索,牺牲一定精度,以保证展示效果\nfloat sampleByNormal(vec3 normal, vec3 pos){\n\tfloat searchStep = step ;\n\tvec3 currentPos = pos;\n\tfor (int iter=0; iter < MAX_STEPS; iter++) {\n\t\tif(iter >= MAX_STEPS){\n\t\t\treturn texture(heatMap,currentPos).r;\n\t\t}\n\t\tif(texture(geometryMap,currentPos).r < 0.5){\n\t\t\tcurrentPos += normal * searchStep;\n\t\t}else{\n\t\t\treturn texture(heatMap,currentPos).r;\n\t\t}\n\t}\n}\n\nfloat sample1(vec3 normal, vec3 pos){\n\treturn texture(heatMap,pos).r;\n}\n\nin vec2 vUv;\nin vec3 vPosition;\nin vec3 vNormal;\nout highp vec4 pc_fragColor;\n\n\nfloat normalizeHeat(float t){\n\tfloat _t = clamp(t,minT,maxT);\n\treturn (_t - minT)/(maxT - minT);\n}\n\nvec3 posToTexCood(vec3 pos){\n\tfloat x = (pos.x - bboxMin.x) / (bboxMax.x - bboxMin.x);\n\tfloat y = (pos.y - bboxMin.y) / (bboxMax.y - bboxMin.y);\n\tfloat z = (pos.z - bboxMin.z) / (bboxMax.z - bboxMin.z);\n\treturn vec3(x,y,z);\n}\n\n\nvoid main() {\n\tvec3 texCood = posToTexCood(vPosition);\n\t// float color = sampleByNormal(vNormal,texCood);\n\tfloat color = sample1(vNormal,texCood);\n\tfloat normalColor= normalizeHeat(color);\n\tvec4 colorMapColor = texture(colorMap,vec2(normalColor,0.2));\n\tpc_fragColor = vec4(colorMapColor.xyz,opacity);\n\t// pc_fragColor = linearToOutputTexel(vec4(colorMapColor.xyz,opacity));\n\t}\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export default `#version 300 es
|
|
2
|
+
#define MAX_STEPS 50
|
|
3
|
+
precision highp float;
|
|
4
|
+
precision highp sampler3D;
|
|
5
|
+
|
|
6
|
+
uniform sampler3D heatMap;
|
|
7
|
+
uniform sampler3D geometryMap;
|
|
8
|
+
uniform sampler2D colorMap;
|
|
9
|
+
|
|
10
|
+
uniform vec3 bboxMin;
|
|
11
|
+
uniform vec3 bboxMax;
|
|
12
|
+
uniform float step;
|
|
13
|
+
uniform float minT;
|
|
14
|
+
uniform float maxT;
|
|
15
|
+
uniform float opacity;
|
|
16
|
+
|
|
17
|
+
vec4 LinearTosRGB( in vec4 value ) {
|
|
18
|
+
return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
|
|
19
|
+
}
|
|
20
|
+
vec4 linearToOutputTexel( vec4 value ) { return LinearTosRGB( value ); }
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
float getHeatByLegalPos(vec3 pos){
|
|
24
|
+
float geometryFactor = texture(geometryMap,pos).r;
|
|
25
|
+
float legalFactor = clamp(geometryFactor,0.0,1.0);
|
|
26
|
+
return texture(heatMap,pos).r * legalFactor;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
float sampleOc(vec3 pos){
|
|
30
|
+
//平滑滤波步长
|
|
31
|
+
//todo:可以作为define传入的外部常量还是直接传
|
|
32
|
+
float step_x = step / (bboxMax.x - bboxMin.x) * 0.5;
|
|
33
|
+
float step_y = step / (bboxMax.y - bboxMin.y) * 0.5;
|
|
34
|
+
float step_z = step / (bboxMax.z - bboxMin.z) * 0.5;
|
|
35
|
+
vec3 p1 = pos + vec3(step_x,step_y,step_z);
|
|
36
|
+
vec3 p2 = pos + vec3(step_x,-step_y,step_z);
|
|
37
|
+
vec3 p3 = pos + vec3(step_x,step_y,-step_z);
|
|
38
|
+
vec3 p4 = pos + vec3(step_x,-step_y,-step_z);
|
|
39
|
+
vec3 p5 = pos + vec3(-step_x,step_y,step_z);
|
|
40
|
+
vec3 p6 = pos + vec3(-step_x,-step_y,step_z);
|
|
41
|
+
vec3 p7 = pos + vec3(-step_x,step_y,-step_z);
|
|
42
|
+
vec3 p8 = pos + vec3(-step_x,-step_y,-step_z);
|
|
43
|
+
|
|
44
|
+
return (getHeatByLegalPos(p1) + getHeatByLegalPos(p2) + getHeatByLegalPos(p3) + getHeatByLegalPos(p4) + getHeatByLegalPos(p5) + getHeatByLegalPos(p6) + getHeatByLegalPos(p7) + getHeatByLegalPos(p8)) * 0.125;
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//考虑到有效仿真值连通域在三维空间中是封闭流形,这里直接按照normal方向搜索,牺牲一定精度,以保证展示效果
|
|
49
|
+
float sampleByNormal(vec3 normal, vec3 pos){
|
|
50
|
+
float searchStep = step ;
|
|
51
|
+
vec3 currentPos = pos;
|
|
52
|
+
for (int iter=0; iter < MAX_STEPS; iter++) {
|
|
53
|
+
if(iter >= MAX_STEPS){
|
|
54
|
+
return texture(heatMap,currentPos).r;
|
|
55
|
+
}
|
|
56
|
+
if(texture(geometryMap,currentPos).r < 0.5){
|
|
57
|
+
currentPos += normal * searchStep;
|
|
58
|
+
}else{
|
|
59
|
+
return texture(heatMap,currentPos).r;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
float sample1(vec3 normal, vec3 pos){
|
|
65
|
+
return texture(heatMap,pos).r;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
in vec2 vUv;
|
|
69
|
+
in vec3 vPosition;
|
|
70
|
+
in vec3 vNormal;
|
|
71
|
+
out highp vec4 pc_fragColor;
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
float normalizeHeat(float t){
|
|
75
|
+
float _t = clamp(t,minT,maxT);
|
|
76
|
+
return (_t - minT)/(maxT - minT);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
vec3 posToTexCood(vec3 pos){
|
|
80
|
+
float x = (pos.x - bboxMin.x) / (bboxMax.x - bboxMin.x);
|
|
81
|
+
float y = (pos.y - bboxMin.y) / (bboxMax.y - bboxMin.y);
|
|
82
|
+
float z = (pos.z - bboxMin.z) / (bboxMax.z - bboxMin.z);
|
|
83
|
+
return vec3(x,y,z);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
void main() {
|
|
88
|
+
vec3 texCood = posToTexCood(vPosition);
|
|
89
|
+
// float color = sampleByNormal(vNormal,texCood);
|
|
90
|
+
float color = sample1(vNormal,texCood);
|
|
91
|
+
float normalColor= normalizeHeat(color);
|
|
92
|
+
vec4 colorMapColor = texture(colorMap,vec2(normalColor,0.2));
|
|
93
|
+
pc_fragColor = vec4(colorMapColor.xyz,opacity);
|
|
94
|
+
// pc_fragColor = linearToOutputTexel(vec4(colorMapColor.xyz,opacity));
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare var _default: "#version 300 es\n\tin vec3 position;\n\tin vec3 normal;\n\tout vec3 vPosition;\n\tout vec3 vNormal;\n\n\tuniform mat4 modelViewMatrix;\n\tuniform mat4 projectionMatrix;\n\tuniform vec3 cameraPos;\n\t// uniform vec3 normalMatrix;\n\tuniform mat4 modelMatrix;\n\n\tvoid main() {\n\n\t\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\t\tvec4 worldPosition = modelMatrix * vec4(position.xyz,1.0);\n\t\tvPosition = worldPosition.xyz;\n\t\t// vec3 transformedNormal = normalMatrix * normal;\n\t\tvNormal = normalize(normal);\n\n\t\tgl_Position = projectionMatrix * mvPosition;\n\t}\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export default `#version 300 es
|
|
2
|
+
in vec3 position;
|
|
3
|
+
in vec3 normal;
|
|
4
|
+
out vec3 vPosition;
|
|
5
|
+
out vec3 vNormal;
|
|
6
|
+
|
|
7
|
+
uniform mat4 modelViewMatrix;
|
|
8
|
+
uniform mat4 projectionMatrix;
|
|
9
|
+
uniform vec3 cameraPos;
|
|
10
|
+
// uniform vec3 normalMatrix;
|
|
11
|
+
uniform mat4 modelMatrix;
|
|
12
|
+
|
|
13
|
+
void main() {
|
|
14
|
+
|
|
15
|
+
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
16
|
+
vec4 worldPosition = modelMatrix * vec4(position.xyz,1.0);
|
|
17
|
+
vPosition = worldPosition.xyz;
|
|
18
|
+
// vec3 transformedNormal = normalMatrix * normal;
|
|
19
|
+
vNormal = normalize(normal);
|
|
20
|
+
|
|
21
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FivePlugin } from '@realsee/five';
|
|
2
|
+
import type { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from "./typings";
|
|
3
|
+
export declare const ModelTVVideoPlugin: FivePlugin<ModelTVVideoPluginParameterType, ModelTVVideoPluginExportType>;
|
|
4
|
+
export default ModelTVVideoPlugin;
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { parseModelTVVideoPoints } from "./utils/parseData";
|
|
3
|
+
export const ModelTVVideoPlugin = (five, { videoElement }) => {
|
|
4
|
+
const state = {
|
|
5
|
+
videoMeshes: [],
|
|
6
|
+
videoTextureEnabled: false,
|
|
7
|
+
videoSource: '',
|
|
8
|
+
rectPoints: [],
|
|
9
|
+
enabled: false,
|
|
10
|
+
videoElement: videoElement,
|
|
11
|
+
};
|
|
12
|
+
const setMuted = (muted) => {
|
|
13
|
+
if (state.videoTexture) {
|
|
14
|
+
state.videoTexture.image.muted = muted;
|
|
15
|
+
state.videoTexture.image.play();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const getMuted = () => {
|
|
19
|
+
if (state.videoTexture)
|
|
20
|
+
return state.videoTexture.image.muted;
|
|
21
|
+
else
|
|
22
|
+
return true;
|
|
23
|
+
};
|
|
24
|
+
const enable = () => {
|
|
25
|
+
if (state.enabled)
|
|
26
|
+
return;
|
|
27
|
+
if (!state.videoTexture)
|
|
28
|
+
return;
|
|
29
|
+
state.enabled = true;
|
|
30
|
+
state.videoMeshes = createPanoVideoMeshes();
|
|
31
|
+
console.log('state.videoMeshes', state.videoMeshes);
|
|
32
|
+
state.videoMeshes.forEach((mesh) => five.scene.add(mesh));
|
|
33
|
+
const play = () => {
|
|
34
|
+
console.log('play', state.videoTexture);
|
|
35
|
+
if (!state.videoTexture)
|
|
36
|
+
return;
|
|
37
|
+
const timeupdate = () => {
|
|
38
|
+
var _a;
|
|
39
|
+
if (!state.videoTexture)
|
|
40
|
+
return;
|
|
41
|
+
(_a = state.videoTexture) === null || _a === void 0 ? void 0 : _a.image.removeEventListener('timeupdate', timeupdate);
|
|
42
|
+
state.videoTextureEnabled = true;
|
|
43
|
+
state.videoMeshes.forEach((mesh) => {
|
|
44
|
+
if (mesh.material.map !== state.videoTexture)
|
|
45
|
+
mesh.material.map = state.videoTexture;
|
|
46
|
+
});
|
|
47
|
+
five.needsRender = true;
|
|
48
|
+
};
|
|
49
|
+
state.videoTexture.image.addEventListener('timeupdate', timeupdate);
|
|
50
|
+
if (state.videoTexture && state.videoMeshes.length) {
|
|
51
|
+
state.videoTexture.image.play();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
if (five.model.loaded)
|
|
55
|
+
play();
|
|
56
|
+
else {
|
|
57
|
+
return five.once('modelLoaded', () => play());
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const disable = () => {
|
|
61
|
+
if (!state.enabled)
|
|
62
|
+
return;
|
|
63
|
+
state.enabled = false;
|
|
64
|
+
state.videoMeshes.forEach((mesh) => {
|
|
65
|
+
mesh.geometry.dispose();
|
|
66
|
+
mesh.material.dispose();
|
|
67
|
+
five.scene.remove(mesh);
|
|
68
|
+
if (state.videoTexture)
|
|
69
|
+
state.videoTexture.image.pause();
|
|
70
|
+
});
|
|
71
|
+
state.videoMeshes = [];
|
|
72
|
+
five.needsRender = true;
|
|
73
|
+
};
|
|
74
|
+
const createPanoVideoMeshes = () => {
|
|
75
|
+
return state.rectPoints.map((points, index) => {
|
|
76
|
+
const geometry = new THREE.BufferGeometry();
|
|
77
|
+
const segments = 128;
|
|
78
|
+
const verticesArray = [];
|
|
79
|
+
verticesArray.push(points[0].x, points[0].y, points[0].z);
|
|
80
|
+
for (let i = 1; i < segments; i++) {
|
|
81
|
+
verticesArray.push(points[0].x + ((points[1].x - points[0].x) * i) / segments, points[0].y + ((points[1].y - points[0].y) * i) / segments, points[0].z + ((points[1].z - points[0].z) * i) / segments);
|
|
82
|
+
}
|
|
83
|
+
verticesArray.push(points[1].x, points[1].y, points[1].z);
|
|
84
|
+
verticesArray.push(points[2].x, points[2].y, points[2].z);
|
|
85
|
+
for (let i = 1; i < segments; i++) {
|
|
86
|
+
verticesArray.push(points[2].x + ((points[3].x - points[2].x) * i) / segments, points[2].y + ((points[3].y - points[2].y) * i) / segments, points[2].z + ((points[3].z - points[2].z) * i) / segments);
|
|
87
|
+
}
|
|
88
|
+
verticesArray.push(points[3].x, points[3].y, points[3].z);
|
|
89
|
+
const uvArray = [];
|
|
90
|
+
uvArray.push(0, 1);
|
|
91
|
+
for (let i = 1; i < segments; i++) {
|
|
92
|
+
uvArray.push(0, 1 - i / segments);
|
|
93
|
+
}
|
|
94
|
+
uvArray.push(0, 0);
|
|
95
|
+
uvArray.push(1, 0);
|
|
96
|
+
for (let i = 1; i < segments; i++) {
|
|
97
|
+
uvArray.push(1, i / segments);
|
|
98
|
+
}
|
|
99
|
+
uvArray.push(1, 1);
|
|
100
|
+
const indicesArray = [];
|
|
101
|
+
for (let i = 0; i < segments; i++) {
|
|
102
|
+
indicesArray.push(i, i + 1, segments * 2 - i, i, segments * 2 - i, segments * 2 + 1 - i);
|
|
103
|
+
}
|
|
104
|
+
geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(verticesArray), 3));
|
|
105
|
+
geometry.setAttribute('uv', new THREE.BufferAttribute(new Float32Array(uvArray), 2));
|
|
106
|
+
geometry.setIndex(new THREE.BufferAttribute(new Uint32Array(indicesArray), 1));
|
|
107
|
+
const material = new THREE.MeshBasicMaterial({
|
|
108
|
+
map: state.videoTextureEnabled ? state.videoTexture : state.imageTexture,
|
|
109
|
+
side: THREE.DoubleSide,
|
|
110
|
+
});
|
|
111
|
+
const mesh = new THREE.Mesh(geometry, material);
|
|
112
|
+
mesh.renderOrder = 1;
|
|
113
|
+
mesh.name = `ModelTVVideoPlugin-${index}-${performance.now()}`;
|
|
114
|
+
return mesh;
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
const getImageTexture = (source) => {
|
|
118
|
+
const texture = new THREE.TextureLoader().load(source);
|
|
119
|
+
texture.minFilter = THREE.LinearFilter;
|
|
120
|
+
texture.magFilter = THREE.LinearFilter;
|
|
121
|
+
texture.format = THREE.RGBFormat;
|
|
122
|
+
return texture;
|
|
123
|
+
};
|
|
124
|
+
const getVideoTexture = (source, video) => {
|
|
125
|
+
return new Promise((resolve, reject) => {
|
|
126
|
+
const xhr = new XMLHttpRequest();
|
|
127
|
+
xhr.onreadystatechange = () => {
|
|
128
|
+
if (xhr.readyState == 4) {
|
|
129
|
+
if (xhr.status == 200) {
|
|
130
|
+
const url = window.URL || window.webkitURL;
|
|
131
|
+
video = video || document.createElement('video');
|
|
132
|
+
video.crossOrigin = 'anonymous';
|
|
133
|
+
video.autoplay = true;
|
|
134
|
+
video.muted = true;
|
|
135
|
+
video.loop = true;
|
|
136
|
+
video.playsInline = true;
|
|
137
|
+
video.src = url.createObjectURL(xhr.response);
|
|
138
|
+
const texture = new THREE.VideoTexture(video);
|
|
139
|
+
texture.minFilter = THREE.LinearFilter;
|
|
140
|
+
texture.magFilter = THREE.LinearFilter;
|
|
141
|
+
texture.format = THREE.RGBFormat;
|
|
142
|
+
resolve(Object.assign(texture, { videoSource: source }));
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
reject(new Error('Video download Error: ' + xhr.status));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
xhr.onerror = (error) => reject(error);
|
|
150
|
+
xhr.open('GET', source);
|
|
151
|
+
xhr.responseType = 'blob';
|
|
152
|
+
xhr.send();
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
const load = async (data, videoElement) => {
|
|
156
|
+
const { video_src, video_poster_src, points } = data;
|
|
157
|
+
state.videoSource = video_src;
|
|
158
|
+
// TODO 存疑,先处理多一次遍历 o(2n)
|
|
159
|
+
state.rectPoints = parseModelTVVideoPoints(points)
|
|
160
|
+
.map((items) => items.map(({ x, y, z }) => new THREE.Vector3(x, y, z)));
|
|
161
|
+
state.imageTexture = getImageTexture(video_poster_src);
|
|
162
|
+
if (videoElement) {
|
|
163
|
+
state.videoElement = videoElement;
|
|
164
|
+
}
|
|
165
|
+
state.videoTexture = await getVideoTexture(state.videoSource, state.videoElement);
|
|
166
|
+
state.enabled = !!data.enable;
|
|
167
|
+
if (state.enabled)
|
|
168
|
+
enable();
|
|
169
|
+
};
|
|
170
|
+
const dispose = () => {
|
|
171
|
+
disable();
|
|
172
|
+
state.videoTexture = undefined;
|
|
173
|
+
five.off('modeChange', () => setMuted(true));
|
|
174
|
+
five.off('wantsTapGesture', (raycaster) => {
|
|
175
|
+
if (!state.enabled)
|
|
176
|
+
return;
|
|
177
|
+
const [intersect] = raycaster.intersectObjects(five.scene.children, true);
|
|
178
|
+
if (!!intersect && /^video/.test(intersect.object.name)) {
|
|
179
|
+
if (state.videoTexture)
|
|
180
|
+
setMuted(!state.videoTexture.image.muted);
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
five.off('panoArrived', () => {
|
|
185
|
+
if (!state.enabled)
|
|
186
|
+
return;
|
|
187
|
+
if (getMuted())
|
|
188
|
+
return;
|
|
189
|
+
const cameraPosition = five.camera.position;
|
|
190
|
+
const visible = state.rectPoints.find((points) => {
|
|
191
|
+
const centerVector = points.reduce((total, curr) => new THREE.Vector3(total.x + curr.x / points.length, total.y + curr.y / points.length, total.z + curr.z / points.length), new THREE.Vector3());
|
|
192
|
+
return (points.map((point) => new THREE.Vector3((point.x + centerVector.x) / 2, (point.y + centerVector.y) / 2, (point.z + centerVector.z) / 2)).filter((vector) => {
|
|
193
|
+
vector = vector.clone().sub(cameraPosition).normalize();
|
|
194
|
+
const raycaster = new THREE.Raycaster(cameraPosition, vector);
|
|
195
|
+
const [intersect] = raycaster.intersectObjects(five.scene.children, true);
|
|
196
|
+
return !!intersect && /^video/.test(intersect.object.name);
|
|
197
|
+
}).length >= 2);
|
|
198
|
+
});
|
|
199
|
+
if (!visible)
|
|
200
|
+
setMuted(true);
|
|
201
|
+
});
|
|
202
|
+
five.off('renderFrame', () => {
|
|
203
|
+
// console.log('renderFrame', state.videoMeshes)
|
|
204
|
+
state.videoMeshes.forEach((meshes) => {
|
|
205
|
+
if (meshes)
|
|
206
|
+
//@ts-ignore
|
|
207
|
+
meshes.needsRender = true;
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
five.on('modeChange', () => setMuted(true));
|
|
212
|
+
five.on('wantsTapGesture', (raycaster) => {
|
|
213
|
+
if (!state.enabled)
|
|
214
|
+
return;
|
|
215
|
+
const targetMesh = five.scene.children.find(item => /^ModelTVVideoPlugin/.test(item.name));
|
|
216
|
+
if (!targetMesh)
|
|
217
|
+
return;
|
|
218
|
+
const intersectObjects = raycaster.intersectObjects([targetMesh]);
|
|
219
|
+
if (intersectObjects.length === 0)
|
|
220
|
+
return;
|
|
221
|
+
if (state.videoTexture)
|
|
222
|
+
setMuted(!state.videoTexture.image.muted); // TODO toggle video play
|
|
223
|
+
return false;
|
|
224
|
+
});
|
|
225
|
+
five.on('panoArrived', () => {
|
|
226
|
+
if (!state.enabled)
|
|
227
|
+
return;
|
|
228
|
+
if (getMuted())
|
|
229
|
+
return;
|
|
230
|
+
const cameraPosition = five.camera.position;
|
|
231
|
+
const visible = state.rectPoints.find((points) => {
|
|
232
|
+
const centerVector = points.reduce((total, curr) => new THREE.Vector3(total.x + curr.x / points.length, total.y + curr.y / points.length, total.z + curr.z / points.length), new THREE.Vector3());
|
|
233
|
+
return (points.map((point) => new THREE.Vector3((point.x + centerVector.x) / 2, (point.y + centerVector.y) / 2, (point.z + centerVector.z) / 2)).filter((vector) => {
|
|
234
|
+
vector = vector.clone().sub(cameraPosition).normalize();
|
|
235
|
+
const raycaster = new THREE.Raycaster(cameraPosition, vector);
|
|
236
|
+
const [intersect] = raycaster.intersectObjects(five.scene.children, true);
|
|
237
|
+
return !!intersect && /^video/.test(intersect.object.name);
|
|
238
|
+
}).length >= 2);
|
|
239
|
+
});
|
|
240
|
+
if (!visible)
|
|
241
|
+
setMuted(true);
|
|
242
|
+
});
|
|
243
|
+
five.on('renderFrame', () => {
|
|
244
|
+
// console.log('renderFrame', state.videoMeshes)
|
|
245
|
+
state.videoMeshes.forEach((meshes) => {
|
|
246
|
+
if (meshes)
|
|
247
|
+
//@ts-ignore
|
|
248
|
+
meshes.needsRender = true;
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
Object.assign(window, { $state: state });
|
|
252
|
+
return { enable, disable, load, dispose };
|
|
253
|
+
};
|
|
254
|
+
export default ModelTVVideoPlugin;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import ModelTVVideoPlugin from './Plugin';
|
|
2
|
+
export { ModelTVVideoPlugin };
|
|
3
|
+
export default ModelTVVideoPlugin;
|
|
4
|
+
export type { ModelTVVideoPluginParameterType, ModelTVVideoPluginData, Point, ModelTVVideoPluginExportType } from './typings';
|
|
5
|
+
export { DIRECTION } from './typings';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ModelTVVideoPluginParameterType {
|
|
2
|
+
videoElement?: HTMLVideoElement;
|
|
3
|
+
}
|
|
4
|
+
export declare enum DIRECTION {
|
|
5
|
+
TOP_LEFT = "topLeft",
|
|
6
|
+
TOP_RIGHT = "topRight",
|
|
7
|
+
BOTTOM_LEFT = "bottomLeft",
|
|
8
|
+
BOTTOM_RIGHT = "bottomRight"
|
|
9
|
+
}
|
|
10
|
+
export interface Point {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
z: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ModelTVVideoPluginData {
|
|
16
|
+
enable?: boolean;
|
|
17
|
+
video_src: string;
|
|
18
|
+
video_poster_src: string;
|
|
19
|
+
points: Point[][] | Record<DIRECTION, Point>[];
|
|
20
|
+
}
|
|
21
|
+
export interface ModelTVVideoPluginExportType {
|
|
22
|
+
enable: () => void;
|
|
23
|
+
disable: () => void;
|
|
24
|
+
load: (data: ModelTVVideoPluginData, videoElement?: HTMLVideoElement) => Promise<void>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "three";
|
|
2
|
+
export var DIRECTION;
|
|
3
|
+
(function (DIRECTION) {
|
|
4
|
+
DIRECTION["TOP_LEFT"] = "topLeft";
|
|
5
|
+
DIRECTION["TOP_RIGHT"] = "topRight";
|
|
6
|
+
DIRECTION["BOTTOM_LEFT"] = "bottomLeft";
|
|
7
|
+
DIRECTION["BOTTOM_RIGHT"] = "bottomRight";
|
|
8
|
+
})(DIRECTION || (DIRECTION = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DIRECTION } from "../typings";
|
|
2
|
+
export function parseModelTVVideoPoints(points) {
|
|
3
|
+
if (points.length === 0)
|
|
4
|
+
return [];
|
|
5
|
+
if (Array.isArray(points[0]))
|
|
6
|
+
return points;
|
|
7
|
+
let newPoints = [];
|
|
8
|
+
points.map(point => {
|
|
9
|
+
const newPoint = [point[DIRECTION.TOP_LEFT], point[DIRECTION.BOTTOM_LEFT], point[DIRECTION.BOTTOM_RIGHT], point[DIRECTION.TOP_RIGHT]];
|
|
10
|
+
newPoints.push(newPoint);
|
|
11
|
+
});
|
|
12
|
+
return newPoints;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FivePlugin } from '@realsee/five';
|
|
2
|
+
export interface ModelViewPluginExportType {
|
|
3
|
+
appendTo(element: HTMLElement, size?: {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
}): void;
|
|
7
|
+
refresh(size?: {
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
}): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Five 模型插件
|
|
14
|
+
* @template ExportType 导出方法
|
|
15
|
+
*/
|
|
16
|
+
export declare const ModelViewPlugin: FivePlugin<void, ModelViewPluginExportType>;
|
|
17
|
+
export default ModelViewPlugin;
|