@realsee/dnalogel 2.1.2-alpha.1 → 2.1.2-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CSS3DRenderPlugin/index..js +88 -0
- package/dist/CSS3DRenderPlugin/index.cjs.js +1 -0
- package/dist/CameraMovementPlugin/index..js +11 -0
- package/dist/CameraMovementPlugin/index.cjs.js +1 -0
- package/dist/CruisePlugin/index..js +527 -0
- package/dist/CruisePlugin/index.cjs.js +1 -0
- package/dist/GuideLinePlugin/index..js +214 -0
- package/dist/GuideLinePlugin/index.cjs.js +1 -0
- package/dist/ItemLabelPlugin/index..js +508 -0
- package/dist/ItemLabelPlugin/index.cjs.js +10 -0
- package/dist/ModelChassisCompassPlugin/index..js +9 -0
- package/dist/ModelChassisCompassPlugin/index.cjs.js +1 -0
- package/dist/ModelEntryDoorGuidePlugin/index..js +9 -0
- package/dist/ModelEntryDoorGuidePlugin/index.cjs.js +1 -0
- package/dist/ModelItemLabelPlugin/index..js +334 -0
- package/dist/ModelItemLabelPlugin/index.cjs.js +10 -0
- package/dist/ModelRoomLabelPlugin/index..js +274 -0
- package/dist/ModelRoomLabelPlugin/index.cjs.js +1 -0
- package/dist/ModelTVVideoPlugin/index..js +12 -0
- package/dist/ModelTVVideoPlugin/index.cjs.js +1 -0
- package/dist/ModelViewPlugin/index..js +8 -0
- package/dist/ModelViewPlugin/index.cjs.js +1 -0
- package/dist/Object3DHelperPlugin/index..js +1414 -0
- package/dist/Object3DHelperPlugin/index.cjs.js +1 -0
- package/dist/PanoCompassPlugin/index..js +258 -0
- package/dist/PanoCompassPlugin/index.cjs.js +1 -0
- package/dist/PanoCursorRaycasterPlugin/index..js +63 -0
- package/dist/PanoCursorRaycasterPlugin/index.cjs.js +1 -0
- package/dist/PanoDoorLabelPlugin/index..js +340 -0
- package/dist/PanoDoorLabelPlugin/index.cjs.js +1 -0
- package/dist/PanoMeasurePlugin/index..js +15 -0
- package/dist/PanoMeasurePlugin/index.cjs.js +1 -0
- package/dist/PanoRulerPlugin/index..js +9 -0
- package/dist/PanoRulerPlugin/index.cjs.js +1 -0
- package/dist/PanoRulerProPlugin/index..js +395 -0
- package/dist/PanoRulerProPlugin/index.cjs.js +1 -0
- package/dist/PanoSpatialTagPlugin/index..js +15 -0
- package/dist/PanoSpatialTagPlugin/index.cjs.js +1 -0
- package/dist/PanoTagPlugin/index..js +4522 -0
- package/dist/PanoTagPlugin/index.cjs.js +17 -0
- package/dist/chunks/cjs/BasePlugin.57e5204f.cjs.js +1 -0
- package/dist/chunks/cjs/BasePluginWithData.0a28882d.cjs.js +1 -0
- package/dist/chunks/cjs/CSS3DRender.15349564.cjs.js +1 -0
- package/dist/chunks/cjs/CameraMovementPlugin.2b342576.cjs.js +1 -0
- package/dist/chunks/cjs/Plugin.5f616fb3.cjs.js +1 -0
- package/dist/chunks/cjs/Plugin.609da4aa.cjs.js +94 -0
- package/dist/chunks/cjs/Plugin.67936d0e.cjs.js +16 -0
- package/dist/chunks/cjs/Plugin.8a110c53.cjs.js +1 -0
- package/dist/chunks/cjs/Plugin.9971108a.cjs.js +1 -0
- package/dist/chunks/cjs/Plugin.fd42bf8a.cjs.js +1 -0
- package/dist/chunks/cjs/Subscribe.5398d5c6.cjs.js +1 -0
- package/dist/chunks/cjs/changeModelCanvasOpacity.8d84f111.cjs.js +1 -0
- package/dist/chunks/cjs/correctFiveState.4c8472bd.cjs.js +1 -0
- package/dist/chunks/cjs/debounce.93dfb637.cjs.js +1 -0
- package/dist/chunks/cjs/equal.e9fcbd4e.cjs.js +1 -0
- package/dist/chunks/cjs/filter.cf9ebbb3.cjs.js +1 -0
- package/dist/chunks/cjs/formatData.81e95011.cjs.js +10 -0
- package/dist/chunks/cjs/index.30b7baeb.cjs.js +101 -0
- package/dist/chunks/cjs/index.686e84d1.cjs.js +290 -0
- package/dist/chunks/cjs/index.7d2010ce.cjs.js +1 -0
- package/dist/chunks/cjs/isNil.b3a58990.cjs.js +1 -0
- package/dist/chunks/cjs/planimetry.7fce816a.cjs.js +1 -0
- package/dist/chunks/cjs/throttle.86c209eb.cjs.js +1 -0
- package/dist/chunks/cjs/transfromToMeshBasicMaterial.9db6d46a.cjs.js +1 -0
- package/dist/chunks/cjs/uuid.29ed9c88.cjs.js +1 -0
- package/dist/chunks/es/BasePlugin.813e25f7.es.js +18 -0
- package/dist/chunks/es/BasePluginWithData.4bf4e649.es.js +6 -0
- package/dist/chunks/es/CSS3DRender.5652510e.es.js +393 -0
- package/dist/chunks/es/CameraMovementPlugin.4a7c3e46.es.js +120 -0
- package/dist/chunks/es/Plugin.26c2df05.es.js +106 -0
- package/dist/chunks/es/Plugin.435485ed.es.js +584 -0
- package/dist/chunks/es/Plugin.a98418f0.es.js +82 -0
- package/dist/chunks/es/Plugin.ae4ee6f8.es.js +82 -0
- package/dist/chunks/es/Plugin.dd11e0ad.es.js +180 -0
- package/dist/chunks/es/Plugin.f4cf895f.es.js +355 -0
- package/dist/chunks/es/Subscribe.c73e0f91.es.js +50 -0
- package/dist/chunks/es/changeModelCanvasOpacity.45ef9fd6.es.js +1551 -0
- package/dist/chunks/es/correctFiveState.e7feab9f.es.js +66 -0
- package/dist/chunks/es/debounce.ef83f417.es.js +11 -0
- package/dist/chunks/es/equal.7db4a6f7.es.js +56 -0
- package/dist/chunks/es/filter.97ec06c4.es.js +12 -0
- package/dist/chunks/es/formatData.a2b39ef9.es.js +483 -0
- package/dist/chunks/es/index.a273f06e.es.js +532 -0
- package/dist/chunks/es/index.b8fdb59b.es.js +50 -0
- package/dist/chunks/es/index.f74f4851.es.js +1787 -0
- package/dist/chunks/es/isNil.212842d9.es.js +10 -0
- package/dist/chunks/es/planimetry.b0b4a28d.es.js +43 -0
- package/dist/chunks/es/throttle.db66bac3.es.js +11 -0
- package/dist/chunks/es/transfromToMeshBasicMaterial.849ee069.es.js +24 -0
- package/dist/chunks/es/uuid.676cb2c8.es.js +9 -0
- package/dist/components/PaintBrush/index..js +6 -0
- package/dist/components/PaintBrush/index.cjs.js +1 -0
- package/dist/components/index..js +7 -0
- package/dist/components/index.cjs.js +1 -0
- package/dist/floorplan/MapviewFloorplanPlugin/index..js +324 -0
- package/dist/floorplan/MapviewFloorplanPlugin/index.cjs.js +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/index..js +320 -0
- package/dist/floorplan/ModelFloorplanPlugin/index.cjs.js +1 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index..js +613 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.cjs.js +1 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index..js +277 -0
- package/dist/floorplan/TopviewFloorplanPlugin/index.cjs.js +1 -0
- package/dist/index..js +530 -0
- package/dist/index.cjs.js +3 -543
- package/docs/classes/CruisePluginController.html +24 -24
- package/docs/classes/Magnifier.html +16 -16
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoTagPluginController.html +39 -39
- package/docs/classes/Util.BetterTween.html +8 -8
- package/docs/classes/Util.FivePointSelector.html +12 -12
- package/docs/classes/Util.Interval.html +12 -12
- package/docs/classes/Util.Magnifier.html +17 -17
- package/docs/classes/Util.PointDomHelper.html +11 -11
- package/docs/classes/Util.PointHelper.html +11 -11
- package/docs/classes/Util.Rectangle.html +13 -13
- package/docs/enums/CameraMovementEffect.html +7 -7
- package/docs/enums/ContentType.html +12 -12
- package/docs/enums/DIRECTION.html +9 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/DimensionType.html +7 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/LinkType.html +7 -7
- package/docs/enums/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/PointType.html +7 -7
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +4 -4
- package/docs/functions/CameraMovementPlugin.html +4 -4
- package/docs/functions/CruisePlugin.html +4 -4
- package/docs/functions/GuideLinePlugin.html +5 -5
- package/docs/functions/ItemLabelPlugin.html +4 -4
- package/docs/functions/MapviewFloorplanPlugin.html +4 -4
- package/docs/functions/ModelChassisCompassPlugin.html +4 -4
- package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
- package/docs/functions/ModelFloorplanPlugin.html +4 -4
- package/docs/functions/ModelItemLabelPlugin.html +4 -4
- package/docs/functions/ModelRoomLabelPlugin.html +4 -4
- package/docs/functions/ModelTVVideoPlugin.html +4 -4
- package/docs/functions/ModelViewPlugin.html +4 -4
- package/docs/functions/Object3DHelperPlugin.html +4 -4
- package/docs/functions/PanoCompassPlugin.html +4 -4
- package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
- package/docs/functions/PanoDoorLabelPlugin.html +4 -4
- package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
- package/docs/functions/PanoMeasurePlugin.html +4 -4
- package/docs/functions/PanoRulerPlugin.html +4 -4
- package/docs/functions/PanoRulerProPlugin.html +4 -4
- package/docs/functions/PanoSpatialTagPlugin.html +4 -4
- package/docs/functions/PanoTagPlugin.html +4 -4
- package/docs/functions/TopviewFloorplanPlugin.html +4 -4
- package/docs/functions/Util.getCoordsFromClient.html +5 -5
- package/docs/functions/Util.getCoordsFromElement.html +5 -5
- package/docs/functions/Util.getFrameTime.html +5 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
- package/docs/functions/Util.isNil.html +5 -5
- package/docs/functions/Util.nextFrame.html +5 -5
- package/docs/functions/Util.notNil.html +5 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
- package/docs/functions/Util.tweenProgress.html +5 -5
- package/docs/functions/pluginFlag.html +5 -5
- package/docs/index.html +4 -4
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/ContentTypeMap.html +12 -12
- package/docs/interfaces/FloorplanBounding.html +8 -8
- package/docs/interfaces/FloorplanData.html +10 -10
- package/docs/interfaces/FloorplanEntrance.html +11 -11
- package/docs/interfaces/FloorplanExtraObject.html +10 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
- package/docs/interfaces/FloorplanFloorData.html +9 -9
- package/docs/interfaces/FloorplanImagePosition.html +7 -7
- package/docs/interfaces/FloorplanObserver.html +9 -9
- package/docs/interfaces/FloorplanOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanPosition.html +7 -7
- package/docs/interfaces/FloorplanRoomItem.html +13 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
- package/docs/interfaces/FloorplanServerBounding.html +8 -8
- package/docs/interfaces/FloorplanServerComputedData.html +10 -10
- package/docs/interfaces/FloorplanServerData.html +7 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
- package/docs/interfaces/FloorplanServerEntrance.html +11 -11
- package/docs/interfaces/FloorplanServerFloorData.html +9 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
- package/docs/interfaces/FloorplanServerObserver.html +9 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanServerPosition.html +7 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
- package/docs/interfaces/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/LineJson.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
- package/docs/interfaces/ModelViewPluginExportType.html +8 -8
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/OpenParameter.html +7 -7
- package/docs/interfaces/PaintBrushAction.html +12 -12
- package/docs/interfaces/PaintBrushConfigs.html +12 -12
- package/docs/interfaces/PaintBrushState.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
- package/docs/interfaces/PanoMeasureParameterType.html +11 -11
- package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
- package/docs/interfaces/PanoRulerProPluginState.html +8 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
- package/docs/interfaces/Point.html +8 -8
- package/docs/interfaces/PointJson.html +8 -8
- package/docs/interfaces/Room.html +9 -9
- package/docs/interfaces/RoomInfo.html +7 -7
- package/docs/interfaces/RoomLabel.html +14 -14
- package/docs/interfaces/RoomRules.html +5 -5
- package/docs/interfaces/Rooms.html +5 -5
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/TagConfig.html +10 -10
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +4 -4
- package/docs/types/ArrayPosition.html +5 -5
- package/docs/types/CSS3DRenderExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
- package/docs/types/Color.html +5 -5
- package/docs/types/ContentTypeConfigKey.html +5 -5
- package/docs/types/ContentTypeConfigKeyArray.html +5 -5
- package/docs/types/Create3DDomContainerReturnType.html +5 -5
- package/docs/types/Create3DElementReturnType.html +5 -5
- package/docs/types/CruisePluginExportType.html +5 -5
- package/docs/types/Direction-1.html +5 -5
- package/docs/types/Direction4.html +5 -5
- package/docs/types/FloorplanRuleLabels.html +5 -5
- package/docs/types/FloorplanServerRuleLabels.html +5 -5
- package/docs/types/GuideLinePluginExportType.html +5 -5
- package/docs/types/HelperEventMap.html +5 -5
- package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/MediaData.html +5 -5
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
- package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
- package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
- package/docs/types/MoveArgs.html +5 -5
- package/docs/types/MoveOpts.html +5 -5
- package/docs/types/Object3DHelperEventMap.html +5 -5
- package/docs/types/ObjectFit.html +5 -5
- package/docs/types/PaintBrushEventMap.html +5 -5
- package/docs/types/PanoCompassPluginData.html +5 -5
- package/docs/types/PanoCompassPluginExportType.html +5 -5
- package/docs/types/PanoCompassPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
- package/docs/types/PanoMeasurePluginEvent.html +5 -5
- package/docs/types/PanoMeasureReturnType.html +5 -5
- package/docs/types/PanoSpatialTagPluginId.html +5 -5
- package/docs/types/PanoTagPluginExportInterface.html +5 -5
- package/docs/types/PanoTagPluginParamsInterface.html +5 -5
- package/docs/types/PlaneTag.html +5 -5
- package/docs/types/PointTag.html +5 -5
- package/docs/types/Position.html +5 -5
- package/docs/types/RotateArgs.html +5 -5
- package/docs/types/RotateOpts.html +5 -5
- package/docs/types/RuleLabelsKey.html +5 -5
- package/docs/types/RuleLabelsValue.html +5 -5
- package/docs/types/Tag.html +5 -5
- package/docs/types/Tag2D.html +5 -5
- package/docs/types/Tag3D.html +5 -5
- package/docs/types/TagId.html +5 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
- package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
- package/docs/variables/PLUGIN.html +5 -5
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
- package/docs/variables/ROOM_TYPE_MAP.html +5 -5
- package/docs/variables/VERSION.html +5 -5
- package/docs/variables/itemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
- package/libs/CSS3DRenderPlugin/CSS3DRender.js +327 -1
- package/libs/CSS3DRenderPlugin/Controller.js +83 -1
- package/libs/CSS3DRenderPlugin/index.js +5 -1
- package/libs/CSS3DRenderPlugin/typing.js +1 -1
- package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +65 -1
- package/libs/CSS3DRenderPlugin/utils/centerPoint.js +10 -1
- package/libs/CSS3DRenderPlugin/utils/evenNumber.js +7 -1
- package/libs/CSS3DRenderPlugin/utils/index.js +1 -1
- package/libs/CSS3DRenderPlugin/utils/positionToVector3.js +6 -1
- package/libs/CSS3DRenderPlugin/utils/random.js +1 -1
- package/libs/CameraMovementPlugin/CameraMovementPlugin.js +87 -1
- package/libs/CameraMovementPlugin/index.js +3 -1
- package/libs/CameraMovementPlugin/typing.js +5 -1
- package/libs/CruisePlugin/Controller.js +484 -1
- package/libs/CruisePlugin/index.js +5 -1
- package/libs/CruisePlugin/utils/coordinatesAngle.js +8 -1
- package/libs/CruisePlugin/utils/coordinatesToVector.js +12 -1
- package/libs/CruisePlugin/utils/formatRad.js +7 -1
- package/libs/CruisePlugin/utils/linerValue.js +7 -1
- package/libs/CruisePlugin/utils/safeCall.js +28 -1
- package/libs/CruisePlugin/utils/sleep.js +10 -1
- package/libs/CruisePlugin/utils/vectorToCoordinates.js +10 -1
- package/libs/GuideLinePlugin/Controller.js +143 -1
- package/libs/GuideLinePlugin/index.js +5 -1
- package/libs/GuideLinePlugin/utils/getArrowMaterial.js +13 -1
- package/libs/GuideLinePlugin/utils/getLineGeometries.js +64 -1
- package/libs/ItemLabelPlugin/ItemLabelComponent.js +273 -1
- package/libs/ItemLabelPlugin/ItemLabelItem.js +133 -2
- package/libs/ItemLabelPlugin/Plugin.js +75 -2
- package/libs/ItemLabelPlugin/index.js +12 -1
- package/libs/ItemLabelPlugin/typings.js +4 -1
- package/libs/ItemLabelPlugin/utils/getLabelTransform.js +4 -1
- package/libs/ItemLabelPlugin/utils/getStrokeLength.js +16 -1
- package/libs/ItemLabelPlugin/utils/isImpacted.js +10 -1
- package/libs/ItemLabelPlugin/utils/parseData.js +21 -1
- package/libs/ItemLabelPlugin/utils/transform2RenderData.js +21 -1
- package/libs/ModelChassisCompassPlugin/Plugin.js +70 -1
- package/libs/ModelChassisCompassPlugin/index.js +2 -1
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +77 -1
- package/libs/ModelEntryDoorGuidePlugin/index.js +2 -1
- package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +213 -1
- package/libs/ModelItemLabelPlugin/ItemLabelItem.js +42 -2
- package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +73 -2
- package/libs/ModelItemLabelPlugin/events.type.js +1 -1
- package/libs/ModelItemLabelPlugin/index.js +12 -1
- package/libs/ModelItemLabelPlugin/typings.js +4 -1
- package/libs/ModelItemLabelPlugin/utils/parseData.js +19 -1
- package/libs/ModelRoomLabelPlugin/Assets/roomLabelBg.js +4 -1
- package/libs/ModelRoomLabelPlugin/Controller.js +60 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItem.js +45 -1
- package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +163 -1
- package/libs/ModelRoomLabelPlugin/index.js +9 -1
- package/libs/ModelRoomLabelPlugin/utils/parseData.js +16 -1
- package/libs/ModelTVVideoPlugin/Plugin.js +163 -1
- package/libs/ModelTVVideoPlugin/index.js +2 -1
- package/libs/ModelTVVideoPlugin/typings.js +4 -1
- package/libs/ModelTVVideoPlugin/utils/parseData.js +20 -1
- package/libs/ModelViewPlugin/Plugin.js +106 -1
- package/libs/ModelViewPlugin/index.js +2 -1
- package/libs/Object3DHelperPlugin/Controller.js +145 -1
- package/libs/Object3DHelperPlugin/FiveControllerWrapper.js +31 -1
- package/libs/Object3DHelperPlugin/index.js +5 -1
- package/libs/PanoCompassPlugin/Assets/roomInfoIcon.js +4 -1
- package/libs/PanoCompassPlugin/Controller.js +224 -1
- package/libs/PanoCompassPlugin/getRoomInfoInstance.js +24 -1
- package/libs/PanoCompassPlugin/index.js +5 -1
- package/libs/PanoCursorRaycasterPlugin/index.js +58 -1
- package/libs/PanoDoorLabelPlugin/BaseController.js +59 -1
- package/libs/PanoDoorLabelPlugin/Controller.js +219 -1
- package/libs/PanoDoorLabelPlugin/DoorLabelItem.js +65 -1
- package/libs/PanoDoorLabelPlugin/index.js +5 -1
- package/libs/PanoDoorLabelPlugin/utils.js +23 -1
- package/libs/PanoMeasurePlugin/Controller/BaseController.js +53 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +102 -1
- package/libs/PanoMeasurePlugin/Controller/MixedController.js +125 -1
- package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +33 -1
- package/libs/PanoMeasurePlugin/Controller/ViewController.js +90 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +154 -1
- package/libs/PanoMeasurePlugin/Controller/index.js +140 -1
- package/libs/PanoMeasurePlugin/Model/index.js +92 -1
- package/libs/PanoMeasurePlugin/Model/line.js +56 -1
- package/libs/PanoMeasurePlugin/Model/point.js +30 -1
- package/libs/PanoMeasurePlugin/Model/polyline.js +47 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete.svg.js +5 -2
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_bg.png.js +4 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/_Assets/delete_hover_bg.png.js +4 -1
- package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +67 -3
- package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +28 -1
- package/libs/PanoMeasurePlugin/Modules/GuideController.js +41 -1
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +103 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/HTML.js +12 -8
- package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +50 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +36 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +48 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileHTML.js +8 -3
- package/libs/PanoMeasurePlugin/Modules/UIController/mobileMainBtnController.js +39 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +62 -1
- package/libs/PanoMeasurePlugin/Modules/rangePiece/html.js +6 -2
- package/libs/PanoMeasurePlugin/Modules/rangePiece/index.js +130 -1
- package/libs/PanoMeasurePlugin/index.js +10 -1
- package/libs/PanoMeasurePlugin/utils/calculateThreeMouse.js +12 -1
- package/libs/PanoMeasurePlugin/utils/constants.js +36 -1
- package/libs/PanoMeasurePlugin/utils/distanceDom.js +62 -1
- package/libs/PanoMeasurePlugin/utils/findAssociatedLines.js +13 -1
- package/libs/PanoMeasurePlugin/utils/findClosestPoint.js +15 -1
- package/libs/PanoMeasurePlugin/utils/getIntersectionFromEvent.js +9 -1
- package/libs/PanoMeasurePlugin/utils/getPointFromHammerEvent.js +8 -1
- package/libs/PanoMeasurePlugin/utils/ironbox.js +4 -1
- package/libs/PanoMeasurePlugin/utils/isNDCPointInScreen.js +7 -1
- package/libs/PanoMeasurePlugin/utils/line.js +17 -1
- package/libs/PanoMeasurePlugin/utils/math.js +12 -1
- package/libs/PanoMeasurePlugin/utils/mouseGroup.js +33 -3
- package/libs/PanoMeasurePlugin/utils/ndc2Screen.js +8 -1
- package/libs/PanoRulerPlugin/Plugin.js +262 -2
- package/libs/PanoRulerPlugin/index.js +2 -1
- package/libs/PanoRulerPlugin/style.js +5 -2
- package/libs/PanoRulerProPlugin/Controller.js +93 -1
- package/libs/PanoRulerProPlugin/RulerItem.js +128 -1
- package/libs/PanoRulerProPlugin/RulerItems.js +183 -1
- package/libs/PanoRulerProPlugin/index.js +5 -1
- package/libs/PanoSpatialTagPlugin/Components/origins.js +82 -1
- package/libs/PanoSpatialTagPlugin/Components/tag.js +125 -1
- package/libs/PanoSpatialTagPlugin/Plugin.js +246 -1
- package/libs/PanoSpatialTagPlugin/index.js +6 -1
- package/libs/PanoSpatialTagPlugin/store.js +5 -1
- package/libs/PanoSpatialTagPlugin/style.js +11 -1
- package/libs/PanoSpatialTagPlugin/typings.js +1 -1
- package/libs/PanoTagPlugin/Assets/Icon.js +6 -1
- package/libs/PanoTagPlugin/Components/Common/Arrow.js +103 -1
- package/libs/PanoTagPlugin/Components/Common/Audio.js +166 -1
- package/libs/PanoTagPlugin/Components/Common/Line/Polyline.js +93 -1
- package/libs/PanoTagPlugin/Components/Common/Line/Straight.js +90 -1
- package/libs/PanoTagPlugin/Components/Common/Media.js +400 -1
- package/libs/PanoTagPlugin/Components/Common/MediaItem.js +139 -1
- package/libs/PanoTagPlugin/Components/Common/MultiLineText.js +180 -1
- package/libs/PanoTagPlugin/Components/Common/Point/CustomPoint.js +52 -1
- package/libs/PanoTagPlugin/Components/Common/Point/DefaultPoint.js +52 -1
- package/libs/PanoTagPlugin/Components/Common/Point/PointSwitch.js +169 -1
- package/libs/PanoTagPlugin/Components/Common/Shadow.js +124 -15
- package/libs/PanoTagPlugin/Components/Common/Text.js +131 -1
- package/libs/PanoTagPlugin/Components/Common/TextItem.js +106 -0
- package/libs/PanoTagPlugin/Components/Tag/AudioTag.js +140 -1
- package/libs/PanoTagPlugin/Components/Tag/CustomTag.js +73 -1
- package/libs/PanoTagPlugin/Components/Tag/ImageTextTag.js +214 -1
- package/libs/PanoTagPlugin/Components/Tag/LinkTag.js +127 -1
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +259 -1
- package/libs/PanoTagPlugin/Components/Tag/MediaPlane.js +106 -1
- package/libs/PanoTagPlugin/Components/Tag/TextTag.js +134 -1
- package/libs/PanoTagPlugin/Components/Tag/index.js +318 -2
- package/libs/PanoTagPlugin/Components/TagContainer.js +200 -1
- package/libs/PanoTagPlugin/Components/TagWrapper.js +191 -1
- package/libs/PanoTagPlugin/controller/TagCacheController.js +31 -1
- package/libs/PanoTagPlugin/controller/TagComputer.js +264 -1
- package/libs/PanoTagPlugin/controller/index.js +376 -1
- package/libs/PanoTagPlugin/index.js +5 -1
- package/libs/PanoTagPlugin/tag.config.js +43 -1
- package/libs/PanoTagPlugin/typings/controller.js +1 -1
- package/libs/PanoTagPlugin/typings/index.js +1 -1
- package/libs/PanoTagPlugin/typings/tag.js +7 -1
- package/libs/PanoTagPlugin/utils/actionAfterFiveModelLoad.js +6 -1
- package/libs/PanoTagPlugin/utils/addDebugPoints.js +27 -1
- package/libs/PanoTagPlugin/utils/checkRange.js +10 -1
- package/libs/PanoTagPlugin/utils/constants.js +7 -1
- package/libs/PanoTagPlugin/utils/debounce.js +12 -1
- package/libs/PanoTagPlugin/utils/doUtil.js +12 -1
- package/libs/PanoTagPlugin/utils/index.js +1 -1
- package/libs/PanoTagPlugin/utils/noTypecheck.js +4 -1
- package/libs/PanoTagPlugin/utils/normalPositionToPositions.js +13 -1
- package/libs/PanoTagPlugin/utils/planeNormal.js +11 -1
- package/libs/PanoTagPlugin/utils/resizeObserver.js +17 -1
- package/libs/PanoTagPlugin/utils/search.js +15 -1
- package/libs/PanoTagPlugin/utils/tagPosition.js +13 -1
- package/libs/PanoTagPlugin/utils/throttle.js +11 -1
- package/libs/base/BasePlugin.js +18 -1
- package/libs/base/BasePluginWithData.js +6 -1
- package/libs/components/PaintBrush/Controller.js +308 -1
- package/libs/components/PaintBrush/Subscribe.js +47 -1
- package/libs/components/PaintBrush/index.js +45 -1
- package/libs/components/PaintBrush/style.js +5 -2
- package/libs/components/PaintBrush/tween.js +11 -1
- package/libs/components/PaintBrush/typings.js +4 -1
- package/libs/components/PaintBrush/utils.js +45 -1
- package/libs/components/index.js +2 -1
- package/libs/floorplan/Assets/camera.js +4 -1
- package/libs/floorplan/Assets/compass.js +4 -1
- package/libs/floorplan/Assets/floorplanExtraObject.js +4 -1
- package/libs/floorplan/Components/BaseImage.js +103 -1
- package/libs/floorplan/Components/Camera.js +62 -1
- package/libs/floorplan/Components/Compass.js +60 -1
- package/libs/floorplan/Components/CurrentFloor.js +256 -1
- package/libs/floorplan/Components/Main.js +283 -1
- package/libs/floorplan/Components/Normalmage.js +37 -1
- package/libs/floorplan/Components/RoomHighlight/Room.js +61 -1
- package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +122 -1
- package/libs/floorplan/Components/RoomLabels/RoomLabel.js +153 -1
- package/libs/floorplan/Components/RoomLabels/RoomLabels.js +175 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +196 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_0.js +37 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_1.js +39 -1
- package/libs/floorplan/Components/RoomMaterials/RoomMaterial_2.js +37 -1
- package/libs/floorplan/Components/RuleLabels/RuleItem.js +134 -1
- package/libs/floorplan/Components/RuleLabels/RuleLabels.js +139 -1
- package/libs/floorplan/Components/SvgImage.js +39 -2
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +321 -1
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +5 -1
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +316 -1
- package/libs/floorplan/ModelFloorplanPlugin/index.js +5 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +85 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +133 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/ExtraObjects.js +72 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Main.js +192 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +164 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +5 -1
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +273 -1
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +5 -1
- package/libs/floorplan/constant.js +4 -1
- package/libs/floorplan/index.js +6 -1
- package/libs/floorplan/typings/floorplanData.js +1 -1
- package/libs/floorplan/typings/floorplanServerData.js +101 -1
- package/libs/floorplan/utils/constant.js +7 -1
- package/libs/floorplan/utils/correctFiveState.js +54 -1
- package/libs/floorplan/utils/formatData.js +104 -1
- package/libs/floorplan/utils/formatPosition.js +35 -1
- package/libs/index.js +346 -1
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +151 -1
- package/libs/shared-utils/Object3DHelper/Base/BaseHelper.js +51 -1
- package/libs/shared-utils/Object3DHelper/Constants/color.js +20 -1
- package/libs/shared-utils/Object3DHelper/Controller/CSS3DScaleController.js +18 -1
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +66 -1
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +109 -1
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +134 -1
- package/libs/shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js +79 -1
- package/libs/shared-utils/Object3DHelper/Helper/HTML/tipsDom.js +41 -1
- package/libs/shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js +13 -1
- package/libs/shared-utils/Object3DHelper/Helper/MoveHelper.js +30 -1
- package/libs/shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js +35 -1
- package/libs/shared-utils/Object3DHelper/Helper/OutlineHelper.js +2 -1
- package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.js +137 -1
- package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +136 -1
- package/libs/shared-utils/Object3DHelper/Helper/index.js +3 -1
- package/libs/shared-utils/Object3DHelper/index.js +169 -1
- package/libs/shared-utils/Object3DHelper/typings/Direction.js +1 -1
- package/libs/shared-utils/Object3DHelper/typings/Hooks.js +1 -1
- package/libs/shared-utils/Object3DHelper/typings/Scissor.js +1 -1
- package/libs/shared-utils/Object3DHelper/typings/index.js +1 -1
- package/libs/shared-utils/Object3DHelper/utils/calculateThreeMouse.js +11 -1
- package/libs/shared-utils/Object3DHelper/utils/direction.js +22 -1
- package/libs/shared-utils/Object3DHelper/utils/filterNotColinearPoints.js +1 -1
- package/libs/shared-utils/Object3DHelper/utils/getMouseRaycaster.js +14 -1
- package/libs/shared-utils/Object3DHelper/utils/getPoint.js +1 -1
- package/libs/shared-utils/Object3DHelper/utils/index.js +1 -1
- package/libs/shared-utils/Object3DHelper/utils/normalPositionToPositions.js +1 -1
- package/libs/shared-utils/Object3DHelper/utils/object3DBoundingPosition.js +1 -1
- package/libs/shared-utils/Object3DHelper/utils/threex/domevents/index.js +191 -1
- package/libs/shared-utils/Object3DHelper/utils/vectorIsEqual.js +6 -1
- package/libs/shared-utils/Subscribe.js +50 -1
- package/libs/shared-utils/animationFrame/BetterTween.js +26 -1
- package/libs/shared-utils/animationFrame/calculateProgress.js +6 -1
- package/libs/shared-utils/animationFrame/formatRad.js +11 -1
- package/libs/shared-utils/animationFrame/index.js +28 -1
- package/libs/shared-utils/animationFrame/tween.js +28 -1
- package/libs/shared-utils/changeModelCanvasOpacity.js +12 -1
- package/libs/shared-utils/createCanvasTextTexture.js +11 -1
- package/libs/shared-utils/createLine/index.js +9 -1
- package/libs/shared-utils/debounce.js +11 -1
- package/libs/shared-utils/equal.js +54 -1
- package/libs/shared-utils/filter.js +10 -1
- package/libs/shared-utils/five/changeMode.js +39 -1
- package/libs/shared-utils/getPxmm.js +20 -1
- package/libs/shared-utils/index.js +35 -1
- package/libs/shared-utils/isNil.js +10 -1
- package/libs/shared-utils/isTruelyObject.js +6 -1
- package/libs/shared-utils/math/Interval.js +23 -1
- package/libs/shared-utils/math/Rectangle.js +23 -1
- package/libs/shared-utils/math/index.js +1 -1
- package/libs/shared-utils/math/planimetry.js +43 -1
- package/libs/shared-utils/math/rad2Deg.js +6 -1
- package/libs/shared-utils/nearlyEqual.js +6 -1
- package/libs/shared-utils/nextFrame.js +6 -1
- package/libs/shared-utils/noop.js +5 -1
- package/libs/shared-utils/object3d2LocalMatrix.js +18 -1
- package/libs/shared-utils/removeArrayItem.js +8 -1
- package/libs/shared-utils/tap.js +6 -1
- package/libs/shared-utils/three/Assets/index.js +4 -1
- package/libs/shared-utils/three/FivePointSelector.js +49 -1
- package/libs/shared-utils/three/Magnifier.js +104 -1
- package/libs/shared-utils/three/PointDomHelper.js +60 -1
- package/libs/shared-utils/three/PointHelper.js +60 -3
- package/libs/shared-utils/three/getCoords.js +13 -1
- package/libs/shared-utils/three/getIntersect.js +8 -1
- package/libs/shared-utils/three/getRaycaster.js +12 -1
- package/libs/shared-utils/three/index.js +6 -1
- package/libs/shared-utils/three/loadTexture.js +28 -1
- package/libs/shared-utils/three/transformPositionToVector3.js +5 -1
- package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +24 -1
- package/libs/shared-utils/throttle.js +11 -1
- package/libs/shared-utils/tinyEJSrender.js +138 -14
- package/libs/shared-utils/to.js +28 -1
- package/libs/shared-utils/uuid.js +9 -1
- package/libs/vendor/swiper/components-shared/get-changed-params.js +29 -1
- package/libs/vendor/swiper/components-shared/get-params.js +23 -1
- package/libs/vendor/swiper/components-shared/mount-swiper.js +14 -1
- package/libs/vendor/swiper/components-shared/params-list.js +120 -1
- package/libs/vendor/swiper/components-shared/update-swiper.js +36 -1
- package/libs/vendor/swiper/components-shared/utils.js +32 -1
- package/libs/vendor/swiper/svelte/swiper-slide.js +182 -1
- package/libs/vendor/swiper/svelte/swiper-svelte.js +3 -1
- package/libs/vendor/swiper/svelte/swiper.js +254 -1
- package/package.json +13 -181
- package/dist/index.es.js +0 -16650
- package/dist/index.js +0 -16650
- package/dist/index.umd.js +0 -556
|
@@ -0,0 +1,1414 @@
|
|
|
1
|
+
var de = Object.defineProperty;
|
|
2
|
+
var ie = Object.getOwnPropertySymbols;
|
|
3
|
+
var ue = Object.prototype.hasOwnProperty, fe = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var Q = (o, s, e) => s in o ? de(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e, v = (o, s) => {
|
|
5
|
+
for (var e in s || (s = {}))
|
|
6
|
+
ue.call(s, e) && Q(o, e, s[e]);
|
|
7
|
+
if (ie)
|
|
8
|
+
for (var e of ie(s))
|
|
9
|
+
fe.call(s, e) && Q(o, e, s[e]);
|
|
10
|
+
return o;
|
|
11
|
+
};
|
|
12
|
+
var l = (o, s, e) => (Q(o, typeof s != "symbol" ? s + "" : s, e), e);
|
|
13
|
+
var R = (o, s, e) => new Promise((t, n) => {
|
|
14
|
+
var r = (c) => {
|
|
15
|
+
try {
|
|
16
|
+
a(e.next(c));
|
|
17
|
+
} catch (p) {
|
|
18
|
+
n(p);
|
|
19
|
+
}
|
|
20
|
+
}, i = (c) => {
|
|
21
|
+
try {
|
|
22
|
+
a(e.throw(c));
|
|
23
|
+
} catch (p) {
|
|
24
|
+
n(p);
|
|
25
|
+
}
|
|
26
|
+
}, a = (c) => c.done ? t(c.value) : Promise.resolve(c.value).then(r, i);
|
|
27
|
+
a((e = e.apply(o, s)).next());
|
|
28
|
+
});
|
|
29
|
+
import { Controller as ge } from "../chunks/es/BasePlugin.813e25f7.es.js";
|
|
30
|
+
import * as h from "three";
|
|
31
|
+
import { Object3D as be, Vector3 as y } from "three";
|
|
32
|
+
import { CSS3DObject as ye } from "three/examples/jsm/renderers/CSS3DRenderer";
|
|
33
|
+
import { CSS3DRender as me, CSS3DObjectPlus as ve } from "../chunks/es/CSS3DRender.5652510e.es.js";
|
|
34
|
+
import { Subscribe as ae } from "../chunks/es/Subscribe.c73e0f91.es.js";
|
|
35
|
+
import { notNil as we } from "../chunks/es/isNil.212842d9.es.js";
|
|
36
|
+
class W extends be {
|
|
37
|
+
constructor(e, t) {
|
|
38
|
+
var n;
|
|
39
|
+
super();
|
|
40
|
+
l(this, "originObject3D");
|
|
41
|
+
l(this, "onRender");
|
|
42
|
+
this.originObject3D = e, this.onRender = (n = t == null ? void 0 : t.onRender) != null ? n : () => {
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
get helperObject() {
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
this.onRender();
|
|
50
|
+
}
|
|
51
|
+
show() {
|
|
52
|
+
this.visible = !0, this.render();
|
|
53
|
+
}
|
|
54
|
+
hide() {
|
|
55
|
+
this.visible = !1, this.render();
|
|
56
|
+
}
|
|
57
|
+
updatePosition() {
|
|
58
|
+
this.position.copy(this.originObject3D.position);
|
|
59
|
+
}
|
|
60
|
+
updateQuaternion() {
|
|
61
|
+
this.quaternion.copy(this.originObject3D.quaternion);
|
|
62
|
+
}
|
|
63
|
+
applyHelperScaleMatrix4(e, t) {
|
|
64
|
+
this.scale.applyMatrix4(e);
|
|
65
|
+
}
|
|
66
|
+
applyHelperQuaternion(e, t) {
|
|
67
|
+
this.applyQuaternion(e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
class xe extends W {
|
|
71
|
+
}
|
|
72
|
+
class De extends W {
|
|
73
|
+
}
|
|
74
|
+
class Ce extends W {
|
|
75
|
+
}
|
|
76
|
+
class Ee extends Ce {
|
|
77
|
+
}
|
|
78
|
+
class je extends h.Group {
|
|
79
|
+
constructor(e) {
|
|
80
|
+
super();
|
|
81
|
+
l(this, "direction");
|
|
82
|
+
this.direction = e || "x";
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
class re extends h.Mesh {
|
|
86
|
+
constructor(e, t, n) {
|
|
87
|
+
super(e, t);
|
|
88
|
+
l(this, "direction");
|
|
89
|
+
this.direction = n || "x";
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function He(o, s) {
|
|
93
|
+
const { offsetWidth: e, offsetHeight: t } = s, { top: n, left: r } = s.getBoundingClientRect();
|
|
94
|
+
return Object.assign(new h.Vector2(), {
|
|
95
|
+
x: (o.x - r) / e * 2 - 1,
|
|
96
|
+
y: -(o.y - n) / t * 2 + 1
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function Z(o, s, e) {
|
|
100
|
+
if (!s || !e || !o)
|
|
101
|
+
return;
|
|
102
|
+
const t = He(s, e);
|
|
103
|
+
if (Math.abs(t.x) === 1 || Math.abs(t.y) === 1)
|
|
104
|
+
return;
|
|
105
|
+
const n = new h.Raycaster();
|
|
106
|
+
return n.setFromCamera(t, o), n;
|
|
107
|
+
}
|
|
108
|
+
function Oe(o, s) {
|
|
109
|
+
return !(Math.abs(o.x - s.x) > 1e-5 || Math.abs(o.y - s.y) > 1e-5 || Math.abs(o.z - s.z) > 1e-5);
|
|
110
|
+
}
|
|
111
|
+
class G extends je {
|
|
112
|
+
constructor(e) {
|
|
113
|
+
var u;
|
|
114
|
+
super(e.direction);
|
|
115
|
+
l(this, "line");
|
|
116
|
+
l(this, "arrow");
|
|
117
|
+
l(this, "lineHeight", 0.4);
|
|
118
|
+
l(this, "arrowHeight", 0.1);
|
|
119
|
+
this.name = "ArrowGroup";
|
|
120
|
+
const t = new h.Color((u = e.color) != null ? u : 16214315), n = new h.MeshBasicMaterial({
|
|
121
|
+
color: t,
|
|
122
|
+
depthTest: !1,
|
|
123
|
+
opacity: 1,
|
|
124
|
+
transparent: !0,
|
|
125
|
+
side: h.DoubleSide
|
|
126
|
+
}), r = new h.ConeGeometry(0.04, 0.1, 32), i = new re(r, n.clone(), e.direction);
|
|
127
|
+
i.name = `arrow-${e.direction}`, this.arrow = i;
|
|
128
|
+
const a = 4e-3, c = new h.CylinderGeometry(a, a, 0.4, 32), p = new re(c, n.clone(), e.direction);
|
|
129
|
+
p.name = `line-${e.direction}`, this.line = p, this.formatArrow(), this.formatLine(), this.add(this.arrow, this.line);
|
|
130
|
+
}
|
|
131
|
+
formatArrow() {
|
|
132
|
+
this.arrow.geometry.translate(0, this.lineHeight + this.arrowHeight / 2, 0), this.direction === "x" ? (this.arrow.geometry.rotateX(Math.PI / 2), this.arrow.geometry.rotateY(Math.PI / 2)) : this.direction === "z" && this.arrow.geometry.rotateX(Math.PI / 2);
|
|
133
|
+
}
|
|
134
|
+
formatLine() {
|
|
135
|
+
this.line.geometry.translate(0, this.lineHeight / 2, 0), this.direction === "x" ? (this.line.geometry.rotateX(Math.PI / 2), this.line.geometry.rotateY(Math.PI / 2)) : this.direction === "z" && this.line.geometry.rotateX(Math.PI / 2);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const F = {
|
|
139
|
+
X: 15618642,
|
|
140
|
+
Y: 4765519,
|
|
141
|
+
Z: 4227839
|
|
142
|
+
};
|
|
143
|
+
class j {
|
|
144
|
+
static get X() {
|
|
145
|
+
return new h.Color(F.X).convertSRGBToLinear().clone();
|
|
146
|
+
}
|
|
147
|
+
static get Y() {
|
|
148
|
+
return new h.Color(F.Y).convertSRGBToLinear().clone();
|
|
149
|
+
}
|
|
150
|
+
static get Z() {
|
|
151
|
+
return new h.Color(F.Z).convertSRGBToLinear().clone();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
class _e extends xe {
|
|
155
|
+
constructor(e) {
|
|
156
|
+
super(e);
|
|
157
|
+
l(this, "xArrow", new G({ direction: "x", color: j.X }));
|
|
158
|
+
l(this, "yArrow", new G({ direction: "y", color: j.Y }));
|
|
159
|
+
l(this, "zArrow", new G({ direction: "z", color: j.Z }));
|
|
160
|
+
this.add(this.xArrow), this.add(this.yArrow), this.add(this.zArrow);
|
|
161
|
+
}
|
|
162
|
+
show() {
|
|
163
|
+
super.show(), this.xArrow.visible = !0, this.yArrow.visible = !0, this.zArrow.visible = !0;
|
|
164
|
+
}
|
|
165
|
+
showDraggingHelper(e) {
|
|
166
|
+
this.xArrow.visible = e.includes("x"), this.yArrow.visible = e.includes("y"), this.zArrow.visible = e.includes("z");
|
|
167
|
+
}
|
|
168
|
+
dispose() {
|
|
169
|
+
this.remove(this.xArrow, this.yArrow, this.zArrow);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function A(o, s) {
|
|
173
|
+
return Me(document.createElement(s != null ? s : "div"), o);
|
|
174
|
+
}
|
|
175
|
+
function Me(o, s) {
|
|
176
|
+
if (!s)
|
|
177
|
+
return o;
|
|
178
|
+
for (const e in s)
|
|
179
|
+
e && s[e] && (o.style[e] = s[e]);
|
|
180
|
+
return o;
|
|
181
|
+
}
|
|
182
|
+
function Se(o) {
|
|
183
|
+
const s = A(v({
|
|
184
|
+
position: "absolute",
|
|
185
|
+
display: "block",
|
|
186
|
+
borderRadius: "4px",
|
|
187
|
+
paddingTop: "1px",
|
|
188
|
+
paddingBottom: "1px",
|
|
189
|
+
paddingLeft: "4px",
|
|
190
|
+
paddingRight: "4px",
|
|
191
|
+
pointerEvents: "none",
|
|
192
|
+
userSelect: "none",
|
|
193
|
+
zIndex: "9999",
|
|
194
|
+
backgroundColor: "rgba(0,0,0,0.7)",
|
|
195
|
+
fontSize: "12px",
|
|
196
|
+
color: "#fff",
|
|
197
|
+
letterSpacing: "0",
|
|
198
|
+
lineHeight: "18px"
|
|
199
|
+
}, o)), e = () => {
|
|
200
|
+
s.style.display !== "block" && (!s.style.top || !s.style.left || (s.style.display = "block"));
|
|
201
|
+
};
|
|
202
|
+
return { element: s, show: e, hide: () => {
|
|
203
|
+
s.style.display = "none", s.style.top = "", s.style.left = "";
|
|
204
|
+
}, setLeftTop: (r, i) => {
|
|
205
|
+
s.style.left = r, s.style.top = i, e();
|
|
206
|
+
} };
|
|
207
|
+
}
|
|
208
|
+
class Ie extends De {
|
|
209
|
+
constructor(e, t) {
|
|
210
|
+
var n;
|
|
211
|
+
super(e);
|
|
212
|
+
l(this, "yzCircle", new q({ direction: "x", color: j.X }));
|
|
213
|
+
l(this, "xzCircle", new q({ direction: "y", color: j.Y }));
|
|
214
|
+
l(this, "xyCircle", new q({ direction: "z", color: j.Z }));
|
|
215
|
+
l(this, "xRingHelper", new U({ direction: "x" }));
|
|
216
|
+
l(this, "yRingHelper", new U({ direction: "y" }));
|
|
217
|
+
l(this, "zRingHelper", new U({ direction: "z" }));
|
|
218
|
+
l(this, "xAngleHelper", new X({ direction: "x", color: j.X }));
|
|
219
|
+
l(this, "yAngleHelper", new X({ direction: "y", color: j.Y }));
|
|
220
|
+
l(this, "zAngleHelper", new X({ direction: "z", color: j.Z }));
|
|
221
|
+
l(this, "angleTips");
|
|
222
|
+
l(this, "container");
|
|
223
|
+
t && (this.container = t == null ? void 0 : t.container, this.angleTips = Se({ display: "none" }), (n = this.container) == null || n.appendChild(this.angleTips.element)), this.show();
|
|
224
|
+
}
|
|
225
|
+
updateAngleHelperQuaternion() {
|
|
226
|
+
this.xAngleHelper.quaternion.copy(this.yzCircle.quaternion), this.yAngleHelper.quaternion.copy(this.xzCircle.quaternion), this.zAngleHelper.quaternion.copy(this.xyCircle.quaternion), this.xRingHelper.quaternion.copy(this.yzCircle.quaternion), this.yRingHelper.quaternion.copy(this.xzCircle.quaternion), this.zRingHelper.quaternion.copy(this.xyCircle.quaternion);
|
|
227
|
+
}
|
|
228
|
+
applyHelperQuaternion(e, t) {
|
|
229
|
+
this.yzCircle.applyQuaternion(e), this.xzCircle.applyQuaternion(e), this.xyCircle.applyQuaternion(e), this.xAngleHelper.baseAxes.applyQuaternion(e), this.yAngleHelper.baseAxes.applyQuaternion(e), this.zAngleHelper.baseAxes.applyQuaternion(e);
|
|
230
|
+
}
|
|
231
|
+
hide() {
|
|
232
|
+
this.remove(
|
|
233
|
+
this.yzCircle,
|
|
234
|
+
this.xzCircle,
|
|
235
|
+
this.xyCircle,
|
|
236
|
+
this.xRingHelper,
|
|
237
|
+
this.yRingHelper,
|
|
238
|
+
this.zRingHelper,
|
|
239
|
+
this.xAngleHelper,
|
|
240
|
+
this.yAngleHelper,
|
|
241
|
+
this.zAngleHelper
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
show() {
|
|
245
|
+
var e;
|
|
246
|
+
this.add(this.xyCircle, this.xzCircle, this.yzCircle), this.remove(this.xRingHelper, this.yRingHelper, this.zRingHelper, this.xAngleHelper, this.yAngleHelper, this.zAngleHelper), (e = this.angleTips) == null || e.hide();
|
|
247
|
+
}
|
|
248
|
+
showDraggingHelper(e) {
|
|
249
|
+
var t;
|
|
250
|
+
this.hide(), this.add(...this.filterRingHelper(e)), this.add(...this.filterAngleHelper(e)), (t = this.angleTips) == null || t.show();
|
|
251
|
+
}
|
|
252
|
+
dispose() {
|
|
253
|
+
var e, t;
|
|
254
|
+
this.remove(
|
|
255
|
+
this.yzCircle,
|
|
256
|
+
this.xzCircle,
|
|
257
|
+
this.xyCircle,
|
|
258
|
+
this.xRingHelper,
|
|
259
|
+
this.yRingHelper,
|
|
260
|
+
this.zRingHelper,
|
|
261
|
+
this.xAngleHelper,
|
|
262
|
+
this.yAngleHelper,
|
|
263
|
+
this.zAngleHelper
|
|
264
|
+
), (e = this.angleTips) != null && e.element && ((t = this.container) == null || t.removeChild(this.angleTips.element));
|
|
265
|
+
}
|
|
266
|
+
filterRingHelper(e) {
|
|
267
|
+
return [this.xRingHelper, this.yRingHelper, this.zRingHelper].filter((t) => e.includes(t.direction));
|
|
268
|
+
}
|
|
269
|
+
filterAngleHelper(e) {
|
|
270
|
+
return [this.xAngleHelper, this.yAngleHelper, this.zAngleHelper].filter((t) => e.includes(t.direction));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
class q extends h.Mesh {
|
|
274
|
+
constructor(e) {
|
|
275
|
+
var t;
|
|
276
|
+
super();
|
|
277
|
+
l(this, "direction");
|
|
278
|
+
l(this, "gapAngle", 0.02);
|
|
279
|
+
l(this, "geometry", new h.RingGeometry(0.25, 0.3, 20, 8, this.gapAngle, Math.PI / 2 - this.gapAngle * 2));
|
|
280
|
+
this.material = new h.MeshBasicMaterial({
|
|
281
|
+
opacity: 0.6,
|
|
282
|
+
color: (t = e.color) != null ? t : 16777215,
|
|
283
|
+
transparent: !0,
|
|
284
|
+
side: h.DoubleSide,
|
|
285
|
+
depthTest: !1
|
|
286
|
+
}), this.direction = e.direction, this.geometry.name = `RotateHelperCircleGeometry-${this.direction}`, this.direction === "y" ? this.rotateX(Math.PI / 2) : this.direction === "x" && this.rotateY(-Math.PI / 2);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
class U extends h.Group {
|
|
290
|
+
constructor(e) {
|
|
291
|
+
super();
|
|
292
|
+
l(this, "direction");
|
|
293
|
+
this.direction = e.direction;
|
|
294
|
+
const t = 0.015, n = new Array(8).fill(null).map((r, i) => {
|
|
295
|
+
const a = new h.RingGeometry(0.25, 0.3, 20, 8, Math.PI / 4 * i + t, Math.PI / 4 - t * 2), c = new h.MeshBasicMaterial({
|
|
296
|
+
opacity: 1,
|
|
297
|
+
color: 16777215,
|
|
298
|
+
depthTest: !1,
|
|
299
|
+
transparent: !0,
|
|
300
|
+
side: h.DoubleSide
|
|
301
|
+
}), p = new h.Mesh(a, c);
|
|
302
|
+
return p.name = `AxesDashedRing-${this.direction}-${i}`, p;
|
|
303
|
+
});
|
|
304
|
+
this.add(...n), this.direction === "y" ? this.rotateX(Math.PI / 2) : this.direction === "x" && this.rotateY(-Math.PI / 2);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
class X extends h.Mesh {
|
|
308
|
+
constructor(e) {
|
|
309
|
+
var n;
|
|
310
|
+
super();
|
|
311
|
+
l(this, "direction");
|
|
312
|
+
l(this, "baseAxes");
|
|
313
|
+
switch (e.direction) {
|
|
314
|
+
case "x":
|
|
315
|
+
this.baseAxes = new h.Vector3(0, 0, 1);
|
|
316
|
+
break;
|
|
317
|
+
case "y":
|
|
318
|
+
this.baseAxes = new h.Vector3(1, 0, 0);
|
|
319
|
+
break;
|
|
320
|
+
case "z":
|
|
321
|
+
this.baseAxes = new h.Vector3(1, 0, 0);
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
const t = 0.3 + 5e-4;
|
|
325
|
+
this.geometry = new h.CircleGeometry(t, 48, 0, 1e-4), this.material = new h.MeshBasicMaterial({
|
|
326
|
+
opacity: 0.4,
|
|
327
|
+
color: (n = e.color) != null ? n : 16777215,
|
|
328
|
+
depthTest: !1,
|
|
329
|
+
transparent: !0,
|
|
330
|
+
side: h.DoubleSide
|
|
331
|
+
}), this.direction = e.direction, this.direction === "y" ? this.rotateX(Math.PI / 2) : this.direction === "x" && this.rotateY(-Math.PI / 2);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function Pe() {
|
|
335
|
+
const o = A({
|
|
336
|
+
width: "100%",
|
|
337
|
+
height: "100%",
|
|
338
|
+
left: "0",
|
|
339
|
+
top: "0",
|
|
340
|
+
position: "absolute",
|
|
341
|
+
pointerEvents: "none"
|
|
342
|
+
}), s = A({
|
|
343
|
+
boxSizing: "border-box",
|
|
344
|
+
width: "100%",
|
|
345
|
+
height: "100%",
|
|
346
|
+
left: "0",
|
|
347
|
+
top: "0",
|
|
348
|
+
position: "relative",
|
|
349
|
+
display: "flex",
|
|
350
|
+
alignItems: "center",
|
|
351
|
+
justifyContent: "center"
|
|
352
|
+
}), e = A({
|
|
353
|
+
boxSizing: "border-box",
|
|
354
|
+
width: "100%",
|
|
355
|
+
height: "100%",
|
|
356
|
+
left: "0",
|
|
357
|
+
top: "0",
|
|
358
|
+
position: "absolute",
|
|
359
|
+
border: "1px solid rgba(255,255,255,0.4)"
|
|
360
|
+
});
|
|
361
|
+
o.appendChild(s), s.appendChild(e);
|
|
362
|
+
const t = "-4px", n = { direction: "nesw", element: O({ cursor: "nesw-resize", left: t, bottom: t }) }, r = { direction: "ns", element: O({ cursor: "ns-resize", bottom: t }) }, i = { direction: "nwse", element: O({ cursor: "nwse-resize", right: t, bottom: t }) }, a = { direction: "ew", element: O({ cursor: "ew-resize", right: t }) }, c = { direction: "nesw", element: O({ cursor: "nesw-resize", right: t, top: t }) }, p = { direction: "ns", element: O({ cursor: "ns-resize", top: t }) }, u = { direction: "nwse", element: O({ cursor: "nwse-resize", left: t, top: t }) }, g = { direction: "ew", element: O({ cursor: "ew-resize", left: t }) };
|
|
363
|
+
return new Array(r, a, p, g, n, i, c, u).forEach((m) => s.appendChild(m.element)), { container: o, squares: [
|
|
364
|
+
n,
|
|
365
|
+
r,
|
|
366
|
+
i,
|
|
367
|
+
a,
|
|
368
|
+
c,
|
|
369
|
+
p,
|
|
370
|
+
u,
|
|
371
|
+
g
|
|
372
|
+
] };
|
|
373
|
+
}
|
|
374
|
+
function O(o) {
|
|
375
|
+
const s = A(v({
|
|
376
|
+
background: "#FFFFFF",
|
|
377
|
+
width: "9px",
|
|
378
|
+
height: "9px",
|
|
379
|
+
position: "absolute",
|
|
380
|
+
pointerEvents: "none"
|
|
381
|
+
}, o)), e = A({
|
|
382
|
+
width: "15px",
|
|
383
|
+
height: "15px",
|
|
384
|
+
position: "absolute",
|
|
385
|
+
left: "50%",
|
|
386
|
+
top: "50%",
|
|
387
|
+
transform: "translate(-50%, -50%)",
|
|
388
|
+
pointerEvents: "none"
|
|
389
|
+
}), t = A({
|
|
390
|
+
width: "15px",
|
|
391
|
+
height: "15px",
|
|
392
|
+
cursor: o == null ? void 0 : o.cursor,
|
|
393
|
+
pointerEvents: "auto",
|
|
394
|
+
background: "transparent"
|
|
395
|
+
});
|
|
396
|
+
return t.draggable = !0, e.appendChild(t), s.appendChild(e), s;
|
|
397
|
+
}
|
|
398
|
+
class Ae extends Ee {
|
|
399
|
+
constructor(e, t, n, r) {
|
|
400
|
+
super(e);
|
|
401
|
+
l(this, "points", []);
|
|
402
|
+
l(this, "cornerPositions", []);
|
|
403
|
+
l(this, "css3DInstance");
|
|
404
|
+
l(this, "plane");
|
|
405
|
+
l(this, "css3DRenderer", new me());
|
|
406
|
+
l(this, "camera");
|
|
407
|
+
l(this, "scene");
|
|
408
|
+
l(this, "container");
|
|
409
|
+
l(this, "enabled", !1);
|
|
410
|
+
this.camera = n, this.scene = r, this.container = t, this.initRectangleScaleHelper();
|
|
411
|
+
}
|
|
412
|
+
get helperObject() {
|
|
413
|
+
var e;
|
|
414
|
+
if (!((e = this.css3DInstance) != null && e.css3DObject))
|
|
415
|
+
throw new Error("css3DInstance is not initialized");
|
|
416
|
+
return this.css3DInstance.css3DObject;
|
|
417
|
+
}
|
|
418
|
+
updatePosition() {
|
|
419
|
+
var e;
|
|
420
|
+
this.helperObject.position.copy(this.originObject3D.position), (e = this.plane) == null || e.position.copy(this.originObject3D.position);
|
|
421
|
+
}
|
|
422
|
+
updateQuaternion() {
|
|
423
|
+
var e;
|
|
424
|
+
(e = this.plane) == null || e.quaternion.copy(this.originObject3D.quaternion);
|
|
425
|
+
}
|
|
426
|
+
applyMatrix4(e) {
|
|
427
|
+
var t;
|
|
428
|
+
super.applyMatrix4(e), this.helperObject.applyMatrix4(e), (t = this.plane) == null || t.applyMatrix4(e), this.cornerPositions.forEach((n) => n.applyMatrix4(e));
|
|
429
|
+
}
|
|
430
|
+
showDraggingHelper() {
|
|
431
|
+
}
|
|
432
|
+
applyHelperScaleMatrix4(e, t) {
|
|
433
|
+
var n;
|
|
434
|
+
(n = this.plane) == null || n.scale.applyMatrix4(e), this.helperObject.applyScaleMatrix4(e);
|
|
435
|
+
}
|
|
436
|
+
updatePoints() {
|
|
437
|
+
const e = this.calculatePointPosition(this.cornerPositions);
|
|
438
|
+
this.points.forEach((t, n) => {
|
|
439
|
+
t.position.copy(e[n]);
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
applyHelperQuaternion(e, t) {
|
|
443
|
+
var r;
|
|
444
|
+
const n = (r = this.css3DInstance) == null ? void 0 : r.css3DObject;
|
|
445
|
+
if (n) {
|
|
446
|
+
const i = new h.Vector3().subVectors(n.position, t).applyQuaternion(e).add(t);
|
|
447
|
+
n.position.copy(i), n.applyQuaternion(e);
|
|
448
|
+
}
|
|
449
|
+
if (this.plane) {
|
|
450
|
+
const i = new h.Vector3().subVectors(this.plane.position, t).applyQuaternion(e).add(t);
|
|
451
|
+
this.plane.position.copy(i), this.plane.applyQuaternion(e);
|
|
452
|
+
}
|
|
453
|
+
this.cornerPositions.forEach((i) => {
|
|
454
|
+
const a = new h.Vector3().subVectors(i, t).applyQuaternion(e).add(t);
|
|
455
|
+
i.copy(a);
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
enable() {
|
|
459
|
+
var e;
|
|
460
|
+
this.enabled || (this.enabled = !0, (e = this.css3DInstance) == null || e.enable(), this.plane && this.scene.add(this.plane));
|
|
461
|
+
}
|
|
462
|
+
disable() {
|
|
463
|
+
var e;
|
|
464
|
+
!this.enabled || (this.enabled = !1, (e = this.css3DInstance) == null || e.disable(), this.plane && this.scene.remove(this.plane));
|
|
465
|
+
}
|
|
466
|
+
show() {
|
|
467
|
+
var e;
|
|
468
|
+
(e = this.css3DInstance) == null || e.show(), this.plane && (this.plane.visible = !0);
|
|
469
|
+
}
|
|
470
|
+
hide() {
|
|
471
|
+
var e;
|
|
472
|
+
(e = this.css3DInstance) == null || e.hide(), this.plane && (this.plane.visible = !1);
|
|
473
|
+
}
|
|
474
|
+
dispose() {
|
|
475
|
+
this.disable(), this.css3DRenderer.dispose();
|
|
476
|
+
}
|
|
477
|
+
initRectangleScaleHelper() {
|
|
478
|
+
var u;
|
|
479
|
+
const e = this.getCornerPositions();
|
|
480
|
+
if (!e)
|
|
481
|
+
return;
|
|
482
|
+
this.cornerPositions = e;
|
|
483
|
+
const t = this.css3DRenderer.create3DElement(this.camera, e, { ratio: 3e-3 });
|
|
484
|
+
if (!t)
|
|
485
|
+
return;
|
|
486
|
+
this.css3DInstance = t, t.appendToElement(this.container);
|
|
487
|
+
const n = t.css3DObject.container, { container: r, squares: i } = Pe();
|
|
488
|
+
this.points = i.map((g, d) => ({
|
|
489
|
+
direction: g.direction,
|
|
490
|
+
point: g.element,
|
|
491
|
+
position: this.calculatePointPosition(e)[d]
|
|
492
|
+
})), n.insertBefore(r, (u = n.children[0]) != null ? u : null);
|
|
493
|
+
const a = new h.PlaneGeometry(t.css3DObject.width, t.css3DObject.height), c = new h.MeshBasicMaterial({
|
|
494
|
+
color: 0,
|
|
495
|
+
opacity: 0.15,
|
|
496
|
+
transparent: !0,
|
|
497
|
+
side: h.DoubleSide
|
|
498
|
+
}), p = new h.Mesh(a, c);
|
|
499
|
+
this.scene.add(p), this.updatePosition();
|
|
500
|
+
}
|
|
501
|
+
getCornerPositions() {
|
|
502
|
+
const { originObject3D: e } = this;
|
|
503
|
+
if (e instanceof ye) {
|
|
504
|
+
if (e.isCSS3DObjectPlus)
|
|
505
|
+
return e.cornerPoints;
|
|
506
|
+
console.error("\u6682\u65F6\u53EA\u652F\u6301 CSS3DRenderPlugin \u751F\u6210\u7684\u7269\u4F53");
|
|
507
|
+
} else
|
|
508
|
+
console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper");
|
|
509
|
+
}
|
|
510
|
+
calculatePointPosition(e) {
|
|
511
|
+
return [
|
|
512
|
+
e[0].clone(),
|
|
513
|
+
e[0].clone().add(e[1]).divideScalar(2),
|
|
514
|
+
e[1].clone(),
|
|
515
|
+
e[1].clone().add(e[2]).divideScalar(2),
|
|
516
|
+
e[2].clone(),
|
|
517
|
+
e[2].clone().add(e[3]).divideScalar(2),
|
|
518
|
+
e[3].clone(),
|
|
519
|
+
e[3].clone().add(e[0]).divideScalar(2)
|
|
520
|
+
];
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
new h.Vector3();
|
|
524
|
+
function f(o, s) {
|
|
525
|
+
this._camera = o || null, this._domElement = s || document, this._raycaster = new h.Raycaster(), this._selected = null, this._boundObjs = {};
|
|
526
|
+
var e = this;
|
|
527
|
+
this._$onClick = function() {
|
|
528
|
+
e._onClick.apply(e, arguments);
|
|
529
|
+
}, this._$onDblClick = function() {
|
|
530
|
+
e._onDblClick.apply(e, arguments);
|
|
531
|
+
}, this._$onMouseMove = function() {
|
|
532
|
+
e._onMouseMove.apply(e, arguments);
|
|
533
|
+
}, this._$onMouseDown = function() {
|
|
534
|
+
e._onMouseDown.apply(e, arguments);
|
|
535
|
+
}, this._$onMouseUp = function() {
|
|
536
|
+
e._onMouseUp.apply(e, arguments);
|
|
537
|
+
}, this._$onTouchMove = function() {
|
|
538
|
+
e._onTouchMove.apply(e, arguments);
|
|
539
|
+
}, this._$onTouchStart = function() {
|
|
540
|
+
e._onTouchStart.apply(e, arguments);
|
|
541
|
+
}, this._$onTouchEnd = function() {
|
|
542
|
+
e._onTouchEnd.apply(e, arguments);
|
|
543
|
+
}, this._$onContextmenu = function() {
|
|
544
|
+
e._onContextmenu.apply(e, arguments);
|
|
545
|
+
}, this._domElement.addEventListener("click", this._$onClick, !1), this._domElement.addEventListener("dblclick", this._$onDblClick, !1), this._domElement.addEventListener("mousemove", this._$onMouseMove, !1), this._domElement.addEventListener("mousedown", this._$onMouseDown, !1), this._domElement.addEventListener("mouseup", this._$onMouseUp, !1), this._domElement.addEventListener("touchmove", this._$onTouchMove, !1), this._domElement.addEventListener("touchstart", this._$onTouchStart, !1), this._domElement.addEventListener("touchend", this._$onTouchEnd, !1), this._domElement.addEventListener("contextmenu", this._$onContextmenu, !1);
|
|
546
|
+
}
|
|
547
|
+
f.prototype.destroy = function() {
|
|
548
|
+
this._domElement.removeEventListener("click", this._$onClick, !1), this._domElement.removeEventListener("dblclick", this._$onDblClick, !1), this._domElement.removeEventListener("mousemove", this._$onMouseMove, !1), this._domElement.removeEventListener("mousedown", this._$onMouseDown, !1), this._domElement.removeEventListener("mouseup", this._$onMouseUp, !1), this._domElement.removeEventListener("touchmove", this._$onTouchMove, !1), this._domElement.removeEventListener("touchstart", this._$onTouchStart, !1), this._domElement.removeEventListener("touchend", this._$onTouchEnd, !1), this._domElement.removeEventListener("contextmenu", this._$onContextmenu, !1);
|
|
549
|
+
};
|
|
550
|
+
f.eventNames = [
|
|
551
|
+
"click",
|
|
552
|
+
"dblclick",
|
|
553
|
+
"mouseover",
|
|
554
|
+
"mouseout",
|
|
555
|
+
"mousemove",
|
|
556
|
+
"mousedown",
|
|
557
|
+
"mouseup",
|
|
558
|
+
"contextmenu",
|
|
559
|
+
"touchstart",
|
|
560
|
+
"touchend"
|
|
561
|
+
];
|
|
562
|
+
f.prototype._getRelativeMouseXY = function(o) {
|
|
563
|
+
var s = o.target || o.srcElement;
|
|
564
|
+
s.nodeType === 3 && (s = s.parentNode);
|
|
565
|
+
var e = { x: 0, y: 0 }, t = s, n = getComputedStyle(t, null);
|
|
566
|
+
e.y += parseInt(n.getPropertyValue("padding-top"), 10), e.x += parseInt(n.getPropertyValue("padding-left"), 10);
|
|
567
|
+
do
|
|
568
|
+
e.x += t.offsetLeft, e.y += t.offsetTop, n = getComputedStyle(t, null), e.x += parseInt(n.getPropertyValue("border-left-width"), 10), e.y += parseInt(n.getPropertyValue("border-top-width"), 10);
|
|
569
|
+
while (t = t.offsetParent);
|
|
570
|
+
var r = {
|
|
571
|
+
width: s === window ? window.innerWidth : s.offsetWidth,
|
|
572
|
+
height: s === window ? window.innerHeight : s.offsetHeight
|
|
573
|
+
};
|
|
574
|
+
return {
|
|
575
|
+
x: Number((o.pageX - e.x) / r.width) * 2 - 1,
|
|
576
|
+
y: -((o.pageY - e.y) / r.height) * 2 + 1
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
f.prototype._objectCtxInit = function(o) {
|
|
580
|
+
o._3xDomEvent = {};
|
|
581
|
+
};
|
|
582
|
+
f.prototype._objectCtxDeinit = function(o) {
|
|
583
|
+
delete o._3xDomEvent;
|
|
584
|
+
};
|
|
585
|
+
f.prototype._objectCtxIsInit = function(o) {
|
|
586
|
+
return !!o._3xDomEvent;
|
|
587
|
+
};
|
|
588
|
+
f.prototype._objectCtxGet = function(o) {
|
|
589
|
+
return o._3xDomEvent;
|
|
590
|
+
};
|
|
591
|
+
f.prototype.camera = function(o) {
|
|
592
|
+
return o && (this._camera = o), this._camera;
|
|
593
|
+
};
|
|
594
|
+
f.prototype.bind = function(o, s, e, t) {
|
|
595
|
+
console.assert(f.eventNames.indexOf(s) !== -1, "not available events:" + s), this._objectCtxIsInit(o) || this._objectCtxInit(o);
|
|
596
|
+
var n = this._objectCtxGet(o);
|
|
597
|
+
n[s + "Handlers"] || (n[s + "Handlers"] = []), n[s + "Handlers"].push({
|
|
598
|
+
callback: e,
|
|
599
|
+
useCapture: t
|
|
600
|
+
}), this._boundObjs[s] === void 0 && (this._boundObjs[s] = []), this._boundObjs[s].push(o);
|
|
601
|
+
};
|
|
602
|
+
f.prototype.addEventListener = f.prototype.bind;
|
|
603
|
+
f.prototype.unbind = function(o, s, e, t) {
|
|
604
|
+
console.assert(f.eventNames.indexOf(s) !== -1, "not available events:" + s), this._objectCtxIsInit(o) || this._objectCtxInit(o);
|
|
605
|
+
var n = this._objectCtxGet(o);
|
|
606
|
+
n[s + "Handlers"] || (n[s + "Handlers"] = []);
|
|
607
|
+
for (var r = n[s + "Handlers"], i = 0; i < r.length; i++) {
|
|
608
|
+
var a = r[i];
|
|
609
|
+
if (e == a.callback && t == a.useCapture) {
|
|
610
|
+
r.splice(i, 1);
|
|
611
|
+
break;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
var c = this._boundObjs[s].indexOf(o);
|
|
615
|
+
console.assert(c !== -1), this._boundObjs[s].splice(c, 1);
|
|
616
|
+
};
|
|
617
|
+
f.prototype.removeEventListener = f.prototype.unbind;
|
|
618
|
+
f.prototype._bound = function(o, s) {
|
|
619
|
+
var e = this._objectCtxGet(s);
|
|
620
|
+
return e ? !!e[o + "Handlers"] : !1;
|
|
621
|
+
};
|
|
622
|
+
f.prototype._onMove = function(o, s, e, t) {
|
|
623
|
+
var n = this._boundObjs[o];
|
|
624
|
+
if (!(n === void 0 || n.length === 0)) {
|
|
625
|
+
var r = new h.Vector2();
|
|
626
|
+
r.set(s, e), this._raycaster.setFromCamera(r, this._camera);
|
|
627
|
+
var i = this._raycaster.intersectObjects(n), a = this._selected;
|
|
628
|
+
if (i.length > 0) {
|
|
629
|
+
var c, p, u, g = i[0], d = g.object;
|
|
630
|
+
this._selected = d, u = this._bound("mousemove", d), a != d && (c = this._bound("mouseover", d), p = a && this._bound("mouseout", a));
|
|
631
|
+
} else
|
|
632
|
+
p = a && this._bound("mouseout", a), this._selected = null;
|
|
633
|
+
u && this._notify("mousemove", d, t, g), c && this._notify("mouseover", d, t, g), p && this._notify("mouseout", a, t, g);
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
f.prototype._onEvent = function(o, s, e, t) {
|
|
637
|
+
var n = this._boundObjs[o];
|
|
638
|
+
if (!(n === void 0 || n.length === 0)) {
|
|
639
|
+
var r = new h.Vector2();
|
|
640
|
+
r.set(s, e), this._raycaster.setFromCamera(r, this._camera);
|
|
641
|
+
var i = this._raycaster.intersectObjects(n, !0);
|
|
642
|
+
if (i.length !== 0) {
|
|
643
|
+
for (var a = i[0], c = a.object, p = this._objectCtxGet(c), u = c.parent; typeof p == "undefined" && u; )
|
|
644
|
+
p = this._objectCtxGet(u), u = u.parent;
|
|
645
|
+
!p || this._notify(o, c, t, a);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
f.prototype._notify = function(o, s, e, t) {
|
|
650
|
+
var n = this._objectCtxGet(s), r = n ? n[o + "Handlers"] : null;
|
|
651
|
+
if (console.assert(arguments.length === 4), !n || !r || r.length === 0) {
|
|
652
|
+
s.parent && this._notify(o, s.parent, e, t);
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
for (var r = n[o + "Handlers"], i = 0; i < r.length; i++) {
|
|
656
|
+
var a = r[i], c = !0;
|
|
657
|
+
a.callback({
|
|
658
|
+
type: o,
|
|
659
|
+
target: s,
|
|
660
|
+
origDomEvent: e,
|
|
661
|
+
intersect: t,
|
|
662
|
+
stopPropagation: function() {
|
|
663
|
+
c = !1;
|
|
664
|
+
}
|
|
665
|
+
}), !!c && a.useCapture === !1 && s.parent && this._notify(o, s.parent, e, t);
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
f.prototype._onMouseDown = function(o) {
|
|
669
|
+
return this._onMouseEvent("mousedown", o);
|
|
670
|
+
};
|
|
671
|
+
f.prototype._onMouseUp = function(o) {
|
|
672
|
+
return this._onMouseEvent("mouseup", o);
|
|
673
|
+
};
|
|
674
|
+
f.prototype._onMouseEvent = function(o, s) {
|
|
675
|
+
var e = this._getRelativeMouseXY(s);
|
|
676
|
+
this._onEvent(o, e.x, e.y, s);
|
|
677
|
+
};
|
|
678
|
+
f.prototype._onMouseMove = function(o) {
|
|
679
|
+
var s = this._getRelativeMouseXY(o);
|
|
680
|
+
this._onMove("mousemove", s.x, s.y, o), this._onMove("mouseover", s.x, s.y, o), this._onMove("mouseout", s.x, s.y, o);
|
|
681
|
+
};
|
|
682
|
+
f.prototype._onClick = function(o) {
|
|
683
|
+
this._onMouseEvent("click", o);
|
|
684
|
+
};
|
|
685
|
+
f.prototype._onDblClick = function(o) {
|
|
686
|
+
this._onMouseEvent("dblclick", o);
|
|
687
|
+
};
|
|
688
|
+
f.prototype._onContextmenu = function(o) {
|
|
689
|
+
this._onMouseEvent("contextmenu", o);
|
|
690
|
+
};
|
|
691
|
+
f.prototype._onTouchStart = function(o) {
|
|
692
|
+
return this._onTouchEvent("touchstart", o);
|
|
693
|
+
};
|
|
694
|
+
f.prototype._onTouchEnd = function(o) {
|
|
695
|
+
return this._onTouchEvent("touchend", o);
|
|
696
|
+
};
|
|
697
|
+
f.prototype._onTouchMove = function(o) {
|
|
698
|
+
if (o.touches.length == 1) {
|
|
699
|
+
o.preventDefault();
|
|
700
|
+
var s = Number(o.touches[0].pageX / window.innerWidth) * 2 - 1, e = -(o.touches[0].pageY / window.innerHeight) * 2 + 1;
|
|
701
|
+
this._onMove("mousemove", s, e, o), this._onMove("mouseover", s, e, o), this._onMove("mouseout", s, e, o);
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
f.prototype._onTouchEvent = function(o, s) {
|
|
705
|
+
if (s.touches.length == 1) {
|
|
706
|
+
s.preventDefault();
|
|
707
|
+
var e = Number(s.touches[0].pageX / window.innerWidth) * 2 - 1, t = -(s.touches[0].pageY / window.innerHeight) * 2 + 1;
|
|
708
|
+
this._onEvent(o, e, t, s);
|
|
709
|
+
}
|
|
710
|
+
};
|
|
711
|
+
let P = null;
|
|
712
|
+
class N {
|
|
713
|
+
constructor(s, e, t, n, r, i, a) {
|
|
714
|
+
l(this, "hooks", new ae());
|
|
715
|
+
l(this, "helperObject3D");
|
|
716
|
+
l(this, "originObject3D");
|
|
717
|
+
l(this, "camera");
|
|
718
|
+
l(this, "model");
|
|
719
|
+
l(this, "scene");
|
|
720
|
+
l(this, "container");
|
|
721
|
+
l(this, "domEvents");
|
|
722
|
+
l(this, "isDragging", !1);
|
|
723
|
+
l(this, "onRender");
|
|
724
|
+
l(this, "enabled", !1);
|
|
725
|
+
l(this, "onWantsTapGesture", (s) => {
|
|
726
|
+
if (this.getIntersectObject(s))
|
|
727
|
+
return !1;
|
|
728
|
+
});
|
|
729
|
+
this.camera = s, this.model = e, this.originObject3D = t, this.helperObject3D = n, this.container = r, this.scene = i, this.domEvents = new f(s, r), this.onRender = a != null ? a : () => {
|
|
730
|
+
}, this.initialHelperPosition(), this.initialHelperQuaternion(), this.enable();
|
|
731
|
+
}
|
|
732
|
+
initialHelperPosition() {
|
|
733
|
+
this.helperObject3D.updatePosition();
|
|
734
|
+
}
|
|
735
|
+
initialHelperQuaternion() {
|
|
736
|
+
this.helperObject3D.updateQuaternion();
|
|
737
|
+
}
|
|
738
|
+
enable() {
|
|
739
|
+
this.enabled || (this.enabled = !0, this.scene.add(this.helperObject3D), this.render());
|
|
740
|
+
}
|
|
741
|
+
disable() {
|
|
742
|
+
!this.enabled || (this.enabled = !1, this.scene.remove(this.helperObject3D), this.render());
|
|
743
|
+
}
|
|
744
|
+
show() {
|
|
745
|
+
this.helperObject3D.show(), this.render();
|
|
746
|
+
}
|
|
747
|
+
hide() {
|
|
748
|
+
this.helperObject3D.hide(), this.render();
|
|
749
|
+
}
|
|
750
|
+
dispose() {
|
|
751
|
+
this.helperObject3D.dispose(), this.scene.remove(this.helperObject3D), this.render();
|
|
752
|
+
}
|
|
753
|
+
setOpacity(s) {
|
|
754
|
+
this.setOriginOpacityProperty();
|
|
755
|
+
const e = this.originObject3D;
|
|
756
|
+
if (e instanceof h.Mesh && (e.material.opacity = s), e.isCSS3DObjectPlus) {
|
|
757
|
+
const t = e;
|
|
758
|
+
t.container.style.opacity = s.toString();
|
|
759
|
+
}
|
|
760
|
+
this.render();
|
|
761
|
+
}
|
|
762
|
+
restoreOpacity() {
|
|
763
|
+
if (P === null)
|
|
764
|
+
return;
|
|
765
|
+
const s = this.originObject3D;
|
|
766
|
+
if (s instanceof h.Mesh && (s.material.opacity = P.opacity), s.isCSS3DObjectPlus) {
|
|
767
|
+
const e = s;
|
|
768
|
+
e.container.style.opacity = P.opacity.toString();
|
|
769
|
+
}
|
|
770
|
+
this.render();
|
|
771
|
+
}
|
|
772
|
+
setOriginOpacityProperty() {
|
|
773
|
+
var s, e;
|
|
774
|
+
if (P === null) {
|
|
775
|
+
const t = this.originObject3D;
|
|
776
|
+
t instanceof h.Mesh && (P = {
|
|
777
|
+
opacity: t.material.opacity
|
|
778
|
+
}), t instanceof ve && (P = {
|
|
779
|
+
opacity: (s = t.container.style.opacity) != null ? s : 1
|
|
780
|
+
}), t.isCSS3DObjectPlus && (P = {
|
|
781
|
+
opacity: Number((e = t.container.style.opacity) != null ? e : 1)
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
updateHelperPosition() {
|
|
786
|
+
this.helperObject3D.updatePosition();
|
|
787
|
+
}
|
|
788
|
+
updateHelperQuaternion() {
|
|
789
|
+
this.helperObject3D.updateQuaternion();
|
|
790
|
+
}
|
|
791
|
+
applyHelperMatrix4(s) {
|
|
792
|
+
this.helperObject3D.applyMatrix4(s);
|
|
793
|
+
}
|
|
794
|
+
applyHelperQuaternion(s, e) {
|
|
795
|
+
this.helperObject3D.applyHelperQuaternion(s, e);
|
|
796
|
+
}
|
|
797
|
+
applyHelperScaleMatrix4(s, e) {
|
|
798
|
+
this.helperObject3D.applyHelperScaleMatrix4(s, e);
|
|
799
|
+
}
|
|
800
|
+
onWantsGesture(s, e, t) {
|
|
801
|
+
if (this.isDragging)
|
|
802
|
+
return !1;
|
|
803
|
+
}
|
|
804
|
+
render() {
|
|
805
|
+
this.onRender();
|
|
806
|
+
}
|
|
807
|
+
hoverListener(s, e = 16777215, t = 1) {
|
|
808
|
+
const n = (Array.isArray(s) ? s : [s]).filter(we), r = [];
|
|
809
|
+
for (const i of n)
|
|
810
|
+
if (i instanceof h.Mesh || i instanceof h.Group) {
|
|
811
|
+
const a = i instanceof h.Group ? i.children.filter((d) => d instanceof h.Mesh) : [i];
|
|
812
|
+
a.forEach((d) => {
|
|
813
|
+
d.__originalColor__ = d.material.color.clone(), d.__originalOpacity__ = d.material.opacity;
|
|
814
|
+
});
|
|
815
|
+
const c = () => {
|
|
816
|
+
a.forEach((d) => {
|
|
817
|
+
d.material.color.set(e), d.material.opacity = t;
|
|
818
|
+
}), this.render();
|
|
819
|
+
}, p = () => {
|
|
820
|
+
a.forEach((d) => {
|
|
821
|
+
d.material.color.copy(d.__originalColor__), d.material.opacity = d.__originalOpacity__;
|
|
822
|
+
}), this.render();
|
|
823
|
+
}, u = () => {
|
|
824
|
+
this.isDragging || c();
|
|
825
|
+
}, g = () => {
|
|
826
|
+
this.isDragging || p();
|
|
827
|
+
};
|
|
828
|
+
for (const d of a)
|
|
829
|
+
this.domEvents.addEventListener(d, "mouseover", u), this.domEvents.addEventListener(d, "mouseout", g), this.hooks.on("moveStart", c), this.hooks.on("moveEnd", p), this.hooks.on("rotateEnd", p), r.push(() => {
|
|
830
|
+
this.domEvents.removeEventListener(d, "mouseover", u), this.domEvents.removeEventListener(d, "mouseout", g), this.hooks.off("moveStart", c), this.hooks.off("moveEnd", p), this.hooks.off("rotateEnd", p);
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
return () => r.forEach((i) => i == null ? void 0 : i());
|
|
834
|
+
}
|
|
835
|
+
getIntersectObject(s) {
|
|
836
|
+
const e = this.camera.position, t = this.helperObject3D;
|
|
837
|
+
if (!t)
|
|
838
|
+
return;
|
|
839
|
+
let n;
|
|
840
|
+
const r = s.intersectObject(t, !0)[0];
|
|
841
|
+
if (!!r && (n = r, n.object = t, !!n)) {
|
|
842
|
+
if (this.model.intersectRaycaster) {
|
|
843
|
+
const i = this.model.intersectRaycaster(s)[0];
|
|
844
|
+
if (i && i.point.distanceTo(e) < n.point.distanceTo(e))
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
return n.object;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
class Re extends N {
|
|
852
|
+
constructor(...e) {
|
|
853
|
+
super(...e);
|
|
854
|
+
l(this, "startInfo");
|
|
855
|
+
const t = this.helperObject3D;
|
|
856
|
+
this.hoverListener([t.xArrow, t.yArrow, t.zArrow]);
|
|
857
|
+
const n = this.dragStart.bind(this), r = this.dragging.bind(this), i = this.dragEnd.bind(this);
|
|
858
|
+
this.domEvents.addEventListener(this.helperObject3D, "mousedown", n), document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
859
|
+
}
|
|
860
|
+
dragStart(e) {
|
|
861
|
+
if (this.isDragging)
|
|
862
|
+
return;
|
|
863
|
+
const t = e == null ? void 0 : e.intersect;
|
|
864
|
+
if (!t)
|
|
865
|
+
return this.dragEnd();
|
|
866
|
+
const n = (t == null ? void 0 : t.object).direction;
|
|
867
|
+
if (!n)
|
|
868
|
+
return this.dragEnd();
|
|
869
|
+
const r = new h.Vector3(1, 0, 0).applyQuaternion(this.helperObject3D.quaternion), i = new h.Vector3(0, 1, 0).applyQuaternion(this.helperObject3D.quaternion), a = new h.Vector3(0, 0, 1).applyQuaternion(this.helperObject3D.quaternion), c = (() => {
|
|
870
|
+
switch (n) {
|
|
871
|
+
case "x":
|
|
872
|
+
return r;
|
|
873
|
+
case "y":
|
|
874
|
+
return i;
|
|
875
|
+
case "z":
|
|
876
|
+
return a;
|
|
877
|
+
}
|
|
878
|
+
})(), p = (() => {
|
|
879
|
+
switch (n) {
|
|
880
|
+
case "x":
|
|
881
|
+
case "y":
|
|
882
|
+
return a;
|
|
883
|
+
case "z":
|
|
884
|
+
return r;
|
|
885
|
+
}
|
|
886
|
+
})(), u = t.point.clone(), g = new h.Plane();
|
|
887
|
+
g.setFromNormalAndCoplanarPoint(p, u), this.startInfo = { startVectorProject: u.clone().projectOnVector(c), directionVector: c, plane: g }, this.helperObject3D.showDraggingHelper([n]), this.hooks.emit("moveStart"), this.isDragging = !0, console.log("%c MoveController dragStart", "color: #e5af2e");
|
|
888
|
+
}
|
|
889
|
+
dragging(e) {
|
|
890
|
+
if (!this.isDragging || !this.startInfo)
|
|
891
|
+
return;
|
|
892
|
+
const t = Z(this.camera, e, this.container);
|
|
893
|
+
return t ? (console.log("%c RotateController dragging", "color: #49de1b"), this.move(t), !1) : this.dragEnd();
|
|
894
|
+
}
|
|
895
|
+
move(e) {
|
|
896
|
+
if (!this.startInfo)
|
|
897
|
+
return this.dragEnd();
|
|
898
|
+
const { plane: t, directionVector: n, startVectorProject: r } = this.startInfo, i = this.originObject3D, a = e.ray.intersectPlane(t, new h.Vector3());
|
|
899
|
+
if (!a)
|
|
900
|
+
return;
|
|
901
|
+
const c = a.clone().projectOnVector(n), p = c.clone().sub(r), u = new h.Matrix4();
|
|
902
|
+
u.setPosition(p), i.applyMatrix4(u), this.helperObject3D.applyMatrix4(u), r.copy(c), this.hooks.emit("positionUpdate", { matrix4: u });
|
|
903
|
+
}
|
|
904
|
+
dragEnd() {
|
|
905
|
+
!this.isDragging || (console.log("%c MoveController dragEnd", "color: #e94e4e"), this.startInfo = void 0, this.isDragging = !1, this.helperObject3D.show(), this.hooks.emit("moveEnd"));
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
class Y {
|
|
909
|
+
constructor(s, e, t, n) {
|
|
910
|
+
l(this, "helperController");
|
|
911
|
+
l(this, "five");
|
|
912
|
+
l(this, "onFiveWantsTapGesture", (s) => {
|
|
913
|
+
if (!this.helperController)
|
|
914
|
+
return;
|
|
915
|
+
const e = this.helperController.onWantsTapGesture(s);
|
|
916
|
+
return this.five.needsRender = !0, e;
|
|
917
|
+
});
|
|
918
|
+
l(this, "onFiveWantsGesture", (...s) => {
|
|
919
|
+
if (!this.helperController)
|
|
920
|
+
return;
|
|
921
|
+
const e = this.helperController.onWantsGesture(...s);
|
|
922
|
+
return this.five.needsRender = !0, e;
|
|
923
|
+
});
|
|
924
|
+
const { camera: r, model: i, scene: a } = s, c = s.getElement();
|
|
925
|
+
if (this.five = s, !r || !i || !c || !a)
|
|
926
|
+
return;
|
|
927
|
+
const p = () => {
|
|
928
|
+
s.needsRender = !0;
|
|
929
|
+
};
|
|
930
|
+
this.helperController = new e(r, i, t, n, c, a, p), s.on("wantsTapGesture", this.onFiveWantsTapGesture), s.on("wantsGesture", this.onFiveWantsGesture);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
const ke = "v1.0.1", Le = "Object3DHelper", J = `${Le}@${ke}`, ze = () => {
|
|
934
|
+
console.error(`${J} is disposed`);
|
|
935
|
+
}, Ve = () => {
|
|
936
|
+
console.warn(`${J} is disabled`);
|
|
937
|
+
}, Te = () => {
|
|
938
|
+
console.error(`${J} is disabled`);
|
|
939
|
+
};
|
|
940
|
+
class $e {
|
|
941
|
+
constructor(s, e) {
|
|
942
|
+
l(this, "controllers", {});
|
|
943
|
+
l(this, "state", {
|
|
944
|
+
visible: !0,
|
|
945
|
+
enabled: !0,
|
|
946
|
+
disposed: !1
|
|
947
|
+
});
|
|
948
|
+
l(this, "hooks", new ae());
|
|
949
|
+
l(this, "helpers");
|
|
950
|
+
l(this, "eventListener", {});
|
|
951
|
+
l(this, "handlePositionUpdate", (s, ...e) => {
|
|
952
|
+
var r, i, a, c;
|
|
953
|
+
const [t] = e, n = t == null ? void 0 : t.matrix4;
|
|
954
|
+
n && (s !== this.controllers.moveController && ((r = this.controllers.moveController) == null || r.applyHelperMatrix4(n)), s !== this.controllers.rotateController && ((i = this.controllers.rotateController) == null || i.applyHelperMatrix4(n)), s !== this.controllers.scaleController && ((a = this.controllers.scaleController) == null || a.applyHelperMatrix4(n)), (c = this.helpers.outlineHelper) == null || c.applyMatrix4(n));
|
|
955
|
+
});
|
|
956
|
+
l(this, "handleScaleUpdate", (s, ...e) => {
|
|
957
|
+
var r, i;
|
|
958
|
+
const [t] = e, n = t == null ? void 0 : t.matrix4;
|
|
959
|
+
n && ((r = this.controllers.scaleController) == null || r.applyHelperScaleMatrix4(n, t), (i = this.helpers.outlineHelper) == null || i.scale.applyMatrix4(n));
|
|
960
|
+
});
|
|
961
|
+
l(this, "handleRotateUpdate", (s, ...e) => {
|
|
962
|
+
var n, r, i, a;
|
|
963
|
+
const [t] = e;
|
|
964
|
+
if (t) {
|
|
965
|
+
const { quaternion: c, origin: p } = t;
|
|
966
|
+
c && (s !== this.controllers.moveController && ((n = this.controllers.moveController) == null || n.applyHelperQuaternion(c, p)), s !== this.controllers.rotateController && ((r = this.controllers.rotateController) == null || r.applyHelperQuaternion(c, p)), s !== this.controllers.scaleController && ((i = this.controllers.scaleController) == null || i.applyHelperQuaternion(c, p)), (a = this.helpers.outlineHelper) == null || a.applyQuaternion(c));
|
|
967
|
+
}
|
|
968
|
+
});
|
|
969
|
+
s && this.addControllers(s), this.helpers = e != null ? e : {}, this.setState(this.state);
|
|
970
|
+
}
|
|
971
|
+
show(s) {
|
|
972
|
+
return R(this, null, function* () {
|
|
973
|
+
this.setState({ visible: !0 }, s);
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
hide(s) {
|
|
977
|
+
return R(this, null, function* () {
|
|
978
|
+
this.setState({ visible: !1 }, s);
|
|
979
|
+
});
|
|
980
|
+
}
|
|
981
|
+
enable(s) {
|
|
982
|
+
this.setState({ enabled: !0 }, s);
|
|
983
|
+
}
|
|
984
|
+
disable(s) {
|
|
985
|
+
this.setState({ enabled: !1 }, s);
|
|
986
|
+
}
|
|
987
|
+
dispose() {
|
|
988
|
+
this.setState({ disposed: !0 });
|
|
989
|
+
}
|
|
990
|
+
setState(s, e) {
|
|
991
|
+
if (this.state.disposed)
|
|
992
|
+
return ze();
|
|
993
|
+
if (!this.state.enabled && s.enabled !== !0 && s.disposed !== !0)
|
|
994
|
+
return Te();
|
|
995
|
+
const t = v({}, this.state);
|
|
996
|
+
this.state = v(v({}, this.state), s), s.disposed !== void 0 && s.disposed !== t.disposed && s.disposed && this.handleDispose(), s.visible !== void 0 && this.handleVisible(s.visible), s.enabled !== void 0 && this.handleEnable(s.enabled), this.hooks.emit("stateChange", { state: this.state, prevState: t });
|
|
997
|
+
}
|
|
998
|
+
addControllers(s) {
|
|
999
|
+
this.controllers = v(v({}, this.controllers), s), this.addEventListener(), this.setState(this.state);
|
|
1000
|
+
}
|
|
1001
|
+
addHelpers(s) {
|
|
1002
|
+
this.helpers = v(v({}, this.helpers), s);
|
|
1003
|
+
}
|
|
1004
|
+
getCurrentState() {
|
|
1005
|
+
return this.state;
|
|
1006
|
+
}
|
|
1007
|
+
addEventListener() {
|
|
1008
|
+
for (const s in this.controllers) {
|
|
1009
|
+
if (!s)
|
|
1010
|
+
continue;
|
|
1011
|
+
const e = s;
|
|
1012
|
+
this.eventListener[e] || (this.eventListener[e] = (() => {
|
|
1013
|
+
const t = this.controllers[e];
|
|
1014
|
+
if (!t)
|
|
1015
|
+
return;
|
|
1016
|
+
const n = () => this.handleStart(t), r = () => this.handleEnd(t), i = (...p) => this.handlePositionUpdate(t, ...p), a = (...p) => this.handleRotateUpdate(t, ...p), c = (...p) => this.handleScaleUpdate(t, ...p);
|
|
1017
|
+
return t.hooks.on("moveStart", n), t.hooks.on("rotateStart", n), t.hooks.on("scaleStart", n), t.hooks.on("positionUpdate", i), t.hooks.on("rotateUpdate", a), t.hooks.on("scaleUpdate", c), t.hooks.on("moveEnd", r), t.hooks.on("rotateEnd", r), t.hooks.on("scaleEnd", r), () => {
|
|
1018
|
+
t.hooks.off("moveStart", n), t.hooks.off("rotateStart", n), t.hooks.off("scaleStart", n), t.hooks.off("positionUpdate", i), t.hooks.off("rotateUpdate", a), t.hooks.off("scaleUpdate", c), t.hooks.off("moveEnd", r), t.hooks.off("rotateEnd", r), t.hooks.off("scaleEnd", r);
|
|
1019
|
+
};
|
|
1020
|
+
})());
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
handleEnd(s) {
|
|
1024
|
+
s && this.setOtherHelpersVisible(!0, s);
|
|
1025
|
+
}
|
|
1026
|
+
handleStart(s) {
|
|
1027
|
+
s && this.setOtherHelpersVisible(!1, s);
|
|
1028
|
+
}
|
|
1029
|
+
setOtherHelpersVisible(s, e) {
|
|
1030
|
+
var t, n, r, i;
|
|
1031
|
+
s ? ((r = this.controllers.moveController) == null || r.helperObject3D.show(), (i = this.controllers.rotateController) == null || i.helperObject3D.show()) : (e !== this.controllers.moveController && ((t = this.controllers.moveController) == null || t.helperObject3D.hide()), e !== this.controllers.rotateController && ((n = this.controllers.rotateController) == null || n.helperObject3D.hide()));
|
|
1032
|
+
}
|
|
1033
|
+
handleEnable(s, e = !0) {
|
|
1034
|
+
s ? (this.everyControllerDo((t) => {
|
|
1035
|
+
t.enable();
|
|
1036
|
+
}), this.hooks.emit("enable", { userAction: e })) : (this.everyControllerDo((t) => {
|
|
1037
|
+
t.disable(), t.restoreOpacity();
|
|
1038
|
+
}), this.hooks.emit("disable", { userAction: e })), this.state.enabled = s;
|
|
1039
|
+
}
|
|
1040
|
+
handleVisible(s, e = !0) {
|
|
1041
|
+
s ? (this.everyControllerDo((t) => {
|
|
1042
|
+
t.show();
|
|
1043
|
+
}), this.actionIfStateIsEnabled(() => this.hooks.emit("show", { userAction: e }))) : (this.everyControllerDo((t) => {
|
|
1044
|
+
t.hide(), t.restoreOpacity();
|
|
1045
|
+
}), this.actionIfStateIsEnabled(() => this.hooks.emit("hide", { userAction: e }))), this.state.visible = s;
|
|
1046
|
+
}
|
|
1047
|
+
everyControllerDo(s) {
|
|
1048
|
+
Object.values(this.controllers).forEach((e) => {
|
|
1049
|
+
e && s(e);
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
handleDispose() {
|
|
1053
|
+
var s, e;
|
|
1054
|
+
Object.values(this.controllers).forEach((t) => {
|
|
1055
|
+
t == null || t.dispose(), t == null || t.restoreOpacity();
|
|
1056
|
+
});
|
|
1057
|
+
for (const t in this.controllers) {
|
|
1058
|
+
if (!t)
|
|
1059
|
+
continue;
|
|
1060
|
+
const n = t;
|
|
1061
|
+
(e = (s = this.eventListener)[n]) == null || e.call(s);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
actionIfStateIsEnabled(s, e) {
|
|
1065
|
+
if (this.state.enabled)
|
|
1066
|
+
return s();
|
|
1067
|
+
e != null && e.warnLog && Ve();
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
class Qe extends N {
|
|
1071
|
+
constructor(...e) {
|
|
1072
|
+
super(...e);
|
|
1073
|
+
l(this, "startInfo");
|
|
1074
|
+
l(this, "lastRotation");
|
|
1075
|
+
l(this, "rotations", []);
|
|
1076
|
+
l(this, "helperObject3DQuaternion", this.originObject3D.quaternion.clone());
|
|
1077
|
+
const t = this.helperObject3D;
|
|
1078
|
+
this.hoverListener([t.xyCircle, t.xzCircle, t.yzCircle]);
|
|
1079
|
+
const n = this.dragStart.bind(this), r = this.dragging.bind(this), i = this.dragEnd.bind(this);
|
|
1080
|
+
this.domEvents.addEventListener(this.helperObject3D, "mousedown", n), document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
1081
|
+
}
|
|
1082
|
+
initialHelperQuaternion() {
|
|
1083
|
+
this.helperObject3D.updateAngleHelperQuaternion(), this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion);
|
|
1084
|
+
}
|
|
1085
|
+
dragStart(e) {
|
|
1086
|
+
if (this.isDragging)
|
|
1087
|
+
return;
|
|
1088
|
+
const t = e == null ? void 0 : e.intersect;
|
|
1089
|
+
if (!t)
|
|
1090
|
+
return this.dragEnd();
|
|
1091
|
+
const n = (t == null ? void 0 : t.object).direction;
|
|
1092
|
+
if (!n)
|
|
1093
|
+
return this.dragEnd();
|
|
1094
|
+
this.helperObject3D.updateAngleHelperQuaternion();
|
|
1095
|
+
const r = t.point, i = this.originObject3D.position.clone(), a = this.getAngleHelper(n);
|
|
1096
|
+
this.setTipsAngle(0);
|
|
1097
|
+
const c = r.clone();
|
|
1098
|
+
c.y += 0.2, this.setTipsPosition(c);
|
|
1099
|
+
const p = new h.Vector3(1, 0, 0).applyQuaternion(this.helperObject3DQuaternion), u = new h.Vector3(0, 1, 0).applyQuaternion(this.helperObject3DQuaternion), g = new h.Vector3(0, 0, 1).applyQuaternion(this.helperObject3DQuaternion), d = (() => {
|
|
1100
|
+
switch (n) {
|
|
1101
|
+
case "x":
|
|
1102
|
+
return p;
|
|
1103
|
+
case "y":
|
|
1104
|
+
return u;
|
|
1105
|
+
case "z":
|
|
1106
|
+
return g;
|
|
1107
|
+
}
|
|
1108
|
+
})(), m = new h.Plane().setFromNormalAndCoplanarPoint(d, r), D = new h.Vector3();
|
|
1109
|
+
m.projectPoint(r.clone(), D);
|
|
1110
|
+
const w = D.clone().sub(i), _ = w.clone(), x = w.angleTo(a.baseAxes);
|
|
1111
|
+
this.setAngleHelperStart(n, x), this.setAngleHelperLength(n, 0), this.rotations.push({ vector: w.clone(), direction: !0 }), this.startInfo = { direction: n, startVector: w, staticStartVector: _, plane: m, angleHelper: a }, this.helperObject3D.showDraggingHelper([n]), this.hooks.emit("rotateStart"), this.isDragging = !0, console.log(`%c RotateController dragStart ${n}`, "color: #e5af2e");
|
|
1112
|
+
}
|
|
1113
|
+
dragging(e) {
|
|
1114
|
+
var n;
|
|
1115
|
+
if (!this.isDragging)
|
|
1116
|
+
return;
|
|
1117
|
+
const t = Z(this.camera, e, this.container);
|
|
1118
|
+
return t ? (console.log(`%c RotateController dragging ${(n = this.startInfo) == null ? void 0 : n.direction}`, "color: #49de1b"), this.rotate(t), !1) : this.dragEnd();
|
|
1119
|
+
}
|
|
1120
|
+
rotate(e) {
|
|
1121
|
+
if (!this.startInfo)
|
|
1122
|
+
return this.dragEnd();
|
|
1123
|
+
const { startVector: t, plane: n, angleHelper: r, staticStartVector: i, direction: a } = this.startInfo, c = this.originObject3D, p = e.ray.intersectPlane(n, new h.Vector3());
|
|
1124
|
+
if (!p)
|
|
1125
|
+
return;
|
|
1126
|
+
const u = c.position.clone(), g = new h.Vector3();
|
|
1127
|
+
n.projectPoint(p.clone(), g);
|
|
1128
|
+
const d = g.clone().sub(u);
|
|
1129
|
+
if (t.angleTo(d) === 0 || (this.lastRotation === void 0 && (this.lastRotation = { angle: 0 }), this.rotations.length === 0))
|
|
1130
|
+
return;
|
|
1131
|
+
const m = (() => {
|
|
1132
|
+
if (this.rotations.length === 1)
|
|
1133
|
+
return d.angleTo(r.baseAxes) > i.angleTo(r.baseAxes);
|
|
1134
|
+
{
|
|
1135
|
+
const w = this.rotations[this.rotations.length - 1], _ = this.rotations[this.rotations.length - 2], x = d.angleTo(_.vector), M = d.angleTo(w.vector), S = w.vector.angleTo(_.vector);
|
|
1136
|
+
if (S === 0 || M === 0 || x === 0)
|
|
1137
|
+
return;
|
|
1138
|
+
if (x > M && x > S)
|
|
1139
|
+
return w.direction;
|
|
1140
|
+
if (x < S && M < S || x < M && M > S)
|
|
1141
|
+
return !w.direction;
|
|
1142
|
+
}
|
|
1143
|
+
})();
|
|
1144
|
+
if (m === void 0)
|
|
1145
|
+
return console.warn("rotationDirection is undefined");
|
|
1146
|
+
this.rotations.push({ vector: d, direction: m }), this.rotations = this.rotations.slice(-2), this.lastRotation.angle = this.lastRotation.angle + d.angleTo(t) * (m ? 1 : -1), this.setAngleHelperLength(a, this.lastRotation.angle), this.setTipsAngle(this.lastRotation.angle / Math.PI * 180);
|
|
1147
|
+
const D = new h.Quaternion().setFromUnitVectors(t.clone().normalize(), d.clone().normalize());
|
|
1148
|
+
c.applyQuaternion(D), this.helperObject3D.applyHelperQuaternion(D), this.helperObject3DQuaternion.premultiply(D), this.hooks.emit("rotateUpdate", { quaternion: D, origin: u }), this.startInfo.startVector = d;
|
|
1149
|
+
}
|
|
1150
|
+
dragEnd() {
|
|
1151
|
+
!this.isDragging || (console.log("%c RotateController dragEnd", "color: #e94e4e"), this.startInfo = void 0, this.isDragging = !1, this.lastRotation = void 0, this.rotations = [], this.helperObject3D.show(), this.hooks.emit("rotateEnd"));
|
|
1152
|
+
}
|
|
1153
|
+
getAngleHelper(e) {
|
|
1154
|
+
switch (e) {
|
|
1155
|
+
case "x":
|
|
1156
|
+
return this.helperObject3D.xAngleHelper;
|
|
1157
|
+
case "y":
|
|
1158
|
+
return this.helperObject3D.yAngleHelper;
|
|
1159
|
+
case "z":
|
|
1160
|
+
return this.helperObject3D.zAngleHelper;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
setAngleHelperStart(e, t) {
|
|
1164
|
+
const n = this.getAngleHelper(e);
|
|
1165
|
+
if (n instanceof h.Mesh && n.geometry instanceof h.CircleGeometry) {
|
|
1166
|
+
const { radius: r, segments: i, thetaLength: a } = n.geometry.parameters;
|
|
1167
|
+
n.geometry = new h.CircleGeometry(r, i, t, a);
|
|
1168
|
+
} else
|
|
1169
|
+
console.warn("only support THREE.CircleGeometry");
|
|
1170
|
+
}
|
|
1171
|
+
setAngleHelperLength(e, t) {
|
|
1172
|
+
const r = t >= 0 ? Math.max(t, 1e-3) : Math.min(t, -1e-3), i = this.getAngleHelper(e);
|
|
1173
|
+
if (i instanceof h.Mesh && i.geometry instanceof h.CircleGeometry) {
|
|
1174
|
+
const { radius: a, thetaStart: c } = i.geometry.parameters, p = Math.ceil(Math.abs(r) * (40 / (2 * Math.PI)));
|
|
1175
|
+
i.geometry = new h.CircleGeometry(a, p, c, r);
|
|
1176
|
+
} else
|
|
1177
|
+
console.warn("only support THREE.CircleGeometry");
|
|
1178
|
+
}
|
|
1179
|
+
setTipsAngle(e) {
|
|
1180
|
+
var n;
|
|
1181
|
+
const t = (n = this.helperObject3D.angleTips) == null ? void 0 : n.element;
|
|
1182
|
+
!t || (t.innerText = `${e.toFixed(0)}\xB0`);
|
|
1183
|
+
}
|
|
1184
|
+
setTipsPosition(e) {
|
|
1185
|
+
const t = this.helperObject3D.angleTips;
|
|
1186
|
+
if (!t)
|
|
1187
|
+
return;
|
|
1188
|
+
const n = e.project(this.camera), { x: r, y: i, z: a } = n;
|
|
1189
|
+
if (a > 1)
|
|
1190
|
+
return;
|
|
1191
|
+
const c = (r + 1) / 2 * 100 + "%", p = (-i + 1) / 2 * 100 + "%";
|
|
1192
|
+
t.setLeftTop(c, p);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
class Ge extends N {
|
|
1196
|
+
constructor(...e) {
|
|
1197
|
+
super(...e);
|
|
1198
|
+
l(this, "startInfo");
|
|
1199
|
+
}
|
|
1200
|
+
enable() {
|
|
1201
|
+
this.helperObject3D.enable(), super.enable();
|
|
1202
|
+
}
|
|
1203
|
+
disable() {
|
|
1204
|
+
this.helperObject3D.disable(), super.disable();
|
|
1205
|
+
}
|
|
1206
|
+
show() {
|
|
1207
|
+
this.helperObject3D.show(), super.show();
|
|
1208
|
+
}
|
|
1209
|
+
hide() {
|
|
1210
|
+
this.helperObject3D.hide(), super.hide();
|
|
1211
|
+
}
|
|
1212
|
+
getDragPlane() {
|
|
1213
|
+
const e = new h.Plane(), t = this.helperObject3D.cornerPositions;
|
|
1214
|
+
if (t.length !== 0)
|
|
1215
|
+
return t.length < 3 ? e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new y()), t[0]) : e.setFromCoplanarPoints(t[0], t[1], t[2]), e;
|
|
1216
|
+
}
|
|
1217
|
+
dragStart(e, t) {
|
|
1218
|
+
var r, i;
|
|
1219
|
+
(i = (r = this.helperObject3D).updatePoints) == null || i.call(r);
|
|
1220
|
+
const n = this.getDragPlane();
|
|
1221
|
+
if (!n)
|
|
1222
|
+
return this.dragEnd();
|
|
1223
|
+
this.startInfo = { startPoint: { position: t.position.clone(), direction: t.direction }, plane: n }, this.hooks.emit("scaleStart"), this.render(), this.isDragging = !0, console.log("%c RectangleScaleController dragStart", "color: #e5af2e");
|
|
1224
|
+
}
|
|
1225
|
+
dragging(e) {
|
|
1226
|
+
if (!this.isDragging)
|
|
1227
|
+
return;
|
|
1228
|
+
const t = Z(this.camera, e, this.container);
|
|
1229
|
+
if (!t)
|
|
1230
|
+
return this.dragEnd();
|
|
1231
|
+
this.scale(t), console.log("%c RectangleScaleController dragging", "color: #49de1b");
|
|
1232
|
+
}
|
|
1233
|
+
scale(e) {
|
|
1234
|
+
var ee, te;
|
|
1235
|
+
if (!this.startInfo)
|
|
1236
|
+
return;
|
|
1237
|
+
const t = this.originObject3D, { startPoint: n, plane: r } = this.startInfo, i = this.helperObject3D.cornerPositions;
|
|
1238
|
+
if (i.length < 4)
|
|
1239
|
+
return this.dragEnd();
|
|
1240
|
+
const a = e.ray.intersectPlane(r, new y());
|
|
1241
|
+
if (!a || Oe(a, this.camera.position))
|
|
1242
|
+
return;
|
|
1243
|
+
const c = new y().addVectors(i[0], i[2]).divideScalar(2), { position: p, direction: u } = n, g = new y().subVectors(i[1], i[0]), d = new y().subVectors(i[3], i[0]), m = (C) => {
|
|
1244
|
+
const E = new y(0, 0, 0);
|
|
1245
|
+
if (!this.startInfo)
|
|
1246
|
+
return E;
|
|
1247
|
+
const b = (C === "ew" ? g : d).clone(), H = p.clone().projectOnVector(b), L = a.clone().projectOnVector(b), se = c.clone().projectOnVector(b);
|
|
1248
|
+
if (L.equals(H))
|
|
1249
|
+
return E;
|
|
1250
|
+
if (C === "ns" && typeof this.startInfo.dragPointInCenterBottom != "boolean") {
|
|
1251
|
+
const I = new y().subVectors(L, se), V = I.x < 0 && b.x >= 0, T = I.y < 0 && b.y >= 0, $ = I.z < 0 && b.z >= 0;
|
|
1252
|
+
this.startInfo.dragPointInCenterBottom = V || T || $;
|
|
1253
|
+
}
|
|
1254
|
+
if (C === "ew" && typeof this.startInfo.dragPointInCenterLeft != "boolean") {
|
|
1255
|
+
const I = new y().subVectors(L, se), V = I.x < 0 && b.x >= 0, T = I.y < 0 && b.y >= 0, $ = I.z < 0 && b.z >= 0;
|
|
1256
|
+
this.startInfo.dragPointInCenterLeft = V || T || $;
|
|
1257
|
+
}
|
|
1258
|
+
const ne = new y().subVectors(L, H), oe = ne.length();
|
|
1259
|
+
return oe > 0.3 ? (console.warn("offset.length() > 0.3, skipped", oe), E) : ne;
|
|
1260
|
+
}, D = m("ew"), w = m("ns"), _ = () => {
|
|
1261
|
+
const C = D;
|
|
1262
|
+
this.helperObject3D.cornerPositions.forEach((E, b) => {
|
|
1263
|
+
var H;
|
|
1264
|
+
(H = this.startInfo) != null && H.dragPointInCenterLeft ? (b === 0 || b === 3) && E.add(C) : (b === 1 || b === 2) && E.add(C);
|
|
1265
|
+
});
|
|
1266
|
+
}, x = () => {
|
|
1267
|
+
const C = w;
|
|
1268
|
+
this.helperObject3D.cornerPositions.forEach((E, b) => {
|
|
1269
|
+
var H;
|
|
1270
|
+
(H = this.startInfo) != null && H.dragPointInCenterBottom ? (b === 0 || b === 1) && E.add(C) : (b === 2 || b === 3) && E.add(C);
|
|
1271
|
+
});
|
|
1272
|
+
};
|
|
1273
|
+
switch (u) {
|
|
1274
|
+
case "ew":
|
|
1275
|
+
_();
|
|
1276
|
+
break;
|
|
1277
|
+
case "ns":
|
|
1278
|
+
x();
|
|
1279
|
+
break;
|
|
1280
|
+
case "nesw":
|
|
1281
|
+
case "nwse":
|
|
1282
|
+
_(), x();
|
|
1283
|
+
}
|
|
1284
|
+
const M = new y().subVectors(i[1], i[0]).length() / g.length(), S = new y().subVectors(i[3], i[0]).length() / d.length(), ce = new y(M, S, 1), z = new h.Matrix4().scale(ce);
|
|
1285
|
+
t.isCSS3DObjectPlus ? t.applyScaleMatrix4(z) : t.scale.applyMatrix4(z), n.position.copy(a);
|
|
1286
|
+
const he = new y().addVectors(i[0], i[2]).divideScalar(2), pe = new y().subVectors(he, c), k = new h.Matrix4().setPosition(pe);
|
|
1287
|
+
t.applyMatrix4(k), (ee = this.helperObject3D.css3DInstance) == null || ee.css3DObject.applyMatrix4(k), (te = this.helperObject3D.plane) == null || te.applyMatrix4(k), this.hooks.emit("scaleUpdate", { matrix4: z, helperOrigin: c }), this.hooks.emit("positionUpdate", { matrix4: k }), this.render();
|
|
1288
|
+
}
|
|
1289
|
+
dragEnd() {
|
|
1290
|
+
!this.isDragging || (this.startInfo = void 0, this.isDragging = !1, this.hooks.emit("scaleEnd"), this.render(), console.log("%c RectangleScaleController dragEnd", "color: #e94e4e"));
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
class Fe extends Ge {
|
|
1294
|
+
constructor(...s) {
|
|
1295
|
+
super(...s), this.addHTMLEventListener();
|
|
1296
|
+
}
|
|
1297
|
+
addHTMLEventListener() {
|
|
1298
|
+
this.helperObject3D.points.forEach((s) => {
|
|
1299
|
+
if (!s)
|
|
1300
|
+
return;
|
|
1301
|
+
const e = s.point, t = (i) => this.dragStart(i, s), n = this.dragging.bind(this), r = this.dragEnd.bind(this);
|
|
1302
|
+
e.addEventListener("dragstart", t), e.addEventListener("drag", n), e.addEventListener("dragend", r);
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
const le = "v1.0.0", B = "Object3DHelperPlugin", K = `${B}@${le}`, qe = () => {
|
|
1307
|
+
console.error(`${K} is disposed`);
|
|
1308
|
+
}, Ue = () => {
|
|
1309
|
+
console.warn(`${K} is disabled`);
|
|
1310
|
+
}, Xe = () => {
|
|
1311
|
+
console.error(`${K} is disabled`);
|
|
1312
|
+
};
|
|
1313
|
+
class Ye extends ge {
|
|
1314
|
+
constructor(e) {
|
|
1315
|
+
super(e);
|
|
1316
|
+
l(this, "version", le);
|
|
1317
|
+
l(this, "name", B);
|
|
1318
|
+
l(this, "state", {
|
|
1319
|
+
visible: !0,
|
|
1320
|
+
enabled: !0,
|
|
1321
|
+
disposed: !1
|
|
1322
|
+
});
|
|
1323
|
+
l(this, "objectHelperMap", /* @__PURE__ */ new Map());
|
|
1324
|
+
this.five = e, console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"), Object.assign(window, { [`__${B.toUpperCase()}_DEBUG__`]: this });
|
|
1325
|
+
}
|
|
1326
|
+
show(e) {
|
|
1327
|
+
return R(this, null, function* () {
|
|
1328
|
+
this.setState({ visible: !0 }, e);
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
hide(e) {
|
|
1332
|
+
return R(this, null, function* () {
|
|
1333
|
+
this.setState({ visible: !1 }, e);
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1336
|
+
enable(e) {
|
|
1337
|
+
this.setState({ enabled: !0 }, e);
|
|
1338
|
+
}
|
|
1339
|
+
disable(e) {
|
|
1340
|
+
this.setState({ enabled: !1 }, e);
|
|
1341
|
+
}
|
|
1342
|
+
dispose() {
|
|
1343
|
+
this.setState({ disposed: !0 });
|
|
1344
|
+
}
|
|
1345
|
+
setState(e, t) {
|
|
1346
|
+
if (this.state.disposed)
|
|
1347
|
+
return qe();
|
|
1348
|
+
if (!this.state.enabled && e.enabled !== !0 && e.disposed !== !0)
|
|
1349
|
+
return Xe();
|
|
1350
|
+
const n = v({}, this.state);
|
|
1351
|
+
this.state = v(v({}, this.state), e), e.disposed !== void 0 && e.disposed !== n.disposed && e.disposed && this.handleDispose(), e.visible !== void 0 && e.visible !== n.visible && this.handleVisible(e.visible), e.enabled !== void 0 && e.enabled !== n.enabled && this.handleEnable(e.enabled), this.hooks.emit("stateChange", { state: this.state, prevState: n });
|
|
1352
|
+
}
|
|
1353
|
+
getObject3DHelper(e) {
|
|
1354
|
+
return this.objectHelperMap.get(e);
|
|
1355
|
+
}
|
|
1356
|
+
addObject3DHelper(e, t = {}) {
|
|
1357
|
+
var u;
|
|
1358
|
+
if (!e)
|
|
1359
|
+
return console.error("Object3D is undefined");
|
|
1360
|
+
if (this.objectHelperMap.has(e)) {
|
|
1361
|
+
console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);
|
|
1362
|
+
return;
|
|
1363
|
+
}
|
|
1364
|
+
const n = new $e();
|
|
1365
|
+
this.objectHelperMap.set(e, n);
|
|
1366
|
+
const r = (u = this.five.getElement()) == null ? void 0 : u.parentElement, i = this.five.camera, { moveHelper: a = !0, rotateHelper: c = !0, scaleHelper: p = !0 } = t;
|
|
1367
|
+
if (a) {
|
|
1368
|
+
const g = new _e(e), d = new Y(this.five, Re, e, g);
|
|
1369
|
+
n.addControllers({ moveController: d.helperController });
|
|
1370
|
+
}
|
|
1371
|
+
if (c) {
|
|
1372
|
+
let g;
|
|
1373
|
+
r && i && (g = { container: r });
|
|
1374
|
+
const d = new Ie(e, g), m = new Y(this.five, Qe, e, d);
|
|
1375
|
+
n.addControllers({ rotateController: m.helperController });
|
|
1376
|
+
}
|
|
1377
|
+
if (p && r) {
|
|
1378
|
+
const g = new Ae(e, r, i, this.five.scene), d = new Y(this.five, Fe, e, g);
|
|
1379
|
+
n.addControllers({ scaleController: d.helperController });
|
|
1380
|
+
}
|
|
1381
|
+
e.isCSS3DObjectPlus && e.changeMode("behind", this.five.scene);
|
|
1382
|
+
}
|
|
1383
|
+
removeObject3DHelper(e) {
|
|
1384
|
+
const t = this.objectHelperMap.get(e);
|
|
1385
|
+
!t || (e.isCSS3DObjectPlus && e.changeMode("front"), this.objectHelperMap.delete(e), t.dispose());
|
|
1386
|
+
}
|
|
1387
|
+
handleEnable(e, t = !0) {
|
|
1388
|
+
e ? (this.everyHelperDo((n) => n.enable()), this.hooks.emit("enable", { userAction: t })) : (this.everyHelperDo((n) => n.disable()), this.hooks.emit("disable", { userAction: t })), this.state.enabled = e;
|
|
1389
|
+
}
|
|
1390
|
+
handleVisible(e, t = !0) {
|
|
1391
|
+
e ? (this.everyHelperDo((n) => n.show()), this.actionIfStateIsEnabled(() => this.hooks.emit("show", { userAction: t }))) : (this.everyHelperDo((n) => n.hide()), this.actionIfStateIsEnabled(() => this.hooks.emit("hide", { userAction: t }))), this.state.visible = e;
|
|
1392
|
+
}
|
|
1393
|
+
handleDispose() {
|
|
1394
|
+
this.everyHelperDo((e) => e.dispose());
|
|
1395
|
+
}
|
|
1396
|
+
everyHelperDo(e) {
|
|
1397
|
+
this.objectHelperMap.forEach((t) => {
|
|
1398
|
+
t && e(t);
|
|
1399
|
+
});
|
|
1400
|
+
}
|
|
1401
|
+
actionIfStateIsEnabled(e, t) {
|
|
1402
|
+
if (this.state.enabled)
|
|
1403
|
+
return e();
|
|
1404
|
+
t != null && t.warnLog && Ue();
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
const tt = (o) => new Ye(o);
|
|
1408
|
+
export {
|
|
1409
|
+
Ye as Object3DHelperController,
|
|
1410
|
+
tt as Object3DHelperPlugin,
|
|
1411
|
+
K as PLUGIN,
|
|
1412
|
+
le as VERSION,
|
|
1413
|
+
tt as default
|
|
1414
|
+
};
|