@realsee/dnalogel 2.1.0-alpha.6 → 2.1.0-alpha.8
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 +9 -1
- package/dist/CSS3DRenderPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/CSS3DRenderPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/CSS3DRenderPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/CSS3DRenderPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/CameraMovementPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/CameraMovementPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/CameraMovementPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/CameraMovementPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/CruisePlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/CruisePlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/CruisePlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/CruisePlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/GuideLinePlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/GuideLinePlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/GuideLinePlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/GuideLinePlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/ItemLabelPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/ItemLabelPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/ItemLabelPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/ItemLabelPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/ModelChassisCompassPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/ModelChassisCompassPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/ModelChassisCompassPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/ModelChassisCompassPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/ModelEntryDoorGuidePlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/ModelEntryDoorGuidePlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/ModelEntryDoorGuidePlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/ModelEntryDoorGuidePlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/ModelItemLabelPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/ModelItemLabelPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/ModelItemLabelPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/ModelItemLabelPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/ModelRoomLabelPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/ModelRoomLabelPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/ModelRoomLabelPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/ModelRoomLabelPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/ModelTVVideoPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/ModelTVVideoPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/ModelTVVideoPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/ModelTVVideoPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/ModelViewPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/ModelViewPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/ModelViewPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/ModelViewPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/Object3DHelperPlugin/index.js +127 -109
- package/dist/Object3DHelperPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/Object3DHelperPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/Object3DHelperPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/Object3DHelperPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/PanoCompassPlugin/index.js +9 -1
- package/dist/PanoCompassPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/PanoCompassPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/PanoCompassPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/PanoCompassPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/PanoCursorRaycasterPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/PanoCursorRaycasterPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/PanoCursorRaycasterPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/PanoCursorRaycasterPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/PanoDoorLabelPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/PanoDoorLabelPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/PanoDoorLabelPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/PanoDoorLabelPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/PanoMeasurePlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/PanoMeasurePlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/PanoMeasurePlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/PanoMeasurePlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/PanoRulerPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/PanoRulerPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/PanoRulerPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/PanoRulerPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/PanoRulerProPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/PanoRulerProPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/PanoRulerProPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/PanoRulerProPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/PanoSpatialTagPlugin/index.js +9 -1
- package/dist/PanoSpatialTagPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/PanoSpatialTagPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/PanoSpatialTagPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/PanoSpatialTagPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/PanoTagPlugin/index.js +26 -18
- package/dist/PanoTagPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/PanoTagPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/PanoTagPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/PanoTagPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/floorplan/MapviewFloorplanPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/floorplan/MapviewFloorplanPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/floorplan/MapviewFloorplanPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/floorplan/MapviewFloorplanPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/floorplan/ModelFloorplanPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/floorplan/ModelFloorplanPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/floorplan/ModelFloorplanPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/floorplan/ModelFloorplanPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/floorplan/PanoFloorplanRadarPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/floorplan/PanoFloorplanRadarPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/floorplan/PanoFloorplanRadarPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/floorplan/TopviewFloorplanPlugin/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/floorplan/TopviewFloorplanPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/floorplan/TopviewFloorplanPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/floorplan/TopviewFloorplanPlugin/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/dist/index.es.js +144 -126
- package/dist/index.js +144 -126
- package/dist/index.umd.js +144 -126
- package/dist/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/dist/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/dist/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/dist/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/docs/classes/CruisePluginController.html +14 -14
- package/docs/classes/Magnifier.html +4 -4
- package/docs/classes/ModelRoomLabelController.html +4 -4
- package/docs/classes/Object3DHelperController.html +9 -9
- package/docs/classes/PanoTagPluginController.html +25 -25
- package/docs/enums/CameraMovementEffect.html +2 -2
- package/docs/enums/ContentType.html +7 -7
- package/docs/enums/DIRECTION.html +1 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/DimensionType.html +1 -1
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/LinkType.html +1 -1
- package/docs/enums/PointType.html +1 -1
- package/docs/enums/Rotation.html +2 -2
- package/docs/index.html +1 -1
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +2 -2
- package/docs/interfaces/CSS3DRenderPluginState.html +2 -2
- package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/FloorplanBounding.html +4 -4
- package/docs/interfaces/FloorplanData.html +2 -2
- package/docs/interfaces/FloorplanEntrance.html +7 -7
- package/docs/interfaces/FloorplanExtraObject.html +3 -3
- package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
- package/docs/interfaces/FloorplanFloorData.html +2 -2
- package/docs/interfaces/FloorplanImagePosition.html +2 -2
- package/docs/interfaces/FloorplanObserver.html +2 -2
- package/docs/interfaces/FloorplanOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanPosition.html +2 -2
- package/docs/interfaces/FloorplanRoomItem.html +6 -6
- package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
- package/docs/interfaces/FloorplanServerBounding.html +4 -4
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +2 -2
- package/docs/interfaces/FloorplanServerDoorItem.html +1 -1
- package/docs/interfaces/FloorplanServerDoorPosition.html +1 -1
- package/docs/interfaces/FloorplanServerEntrance.html +7 -7
- package/docs/interfaces/FloorplanServerFloorData.html +2 -2
- package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
- package/docs/interfaces/FloorplanServerObserver.html +2 -2
- package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanServerPosition.html +2 -2
- package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
- package/docs/interfaces/ItemLabelPluginData.html +1 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -1
- package/docs/interfaces/Object3DHelperState.html +1 -1
- package/docs/interfaces/OpenParameter.html +2 -2
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
- package/docs/interfaces/PanoMeasureParameterType.html +1 -1
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginState.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
- package/docs/interfaces/Point.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -1
- package/docs/interfaces/RoomInfo.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -1
- package/docs/interfaces/Rooms.html +1 -1
- package/docs/interfaces/Scissor.html +5 -5
- package/docs/interfaces/TagConfig.html +3 -3
- package/docs/interfaces/Tags.html +3 -3
- package/docs/modules.html +21 -21
- package/libs/CSS3DRenderPlugin/CSS3DRender.js +8 -1
- package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +1 -0
- package/libs/Object3DHelperPlugin/Controller.js +3 -2
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +15 -15
- package/libs/PanoTagPlugin/controller/index.js +1 -1
- package/libs/PanoTagPlugin/tag.config.js +1 -1
- package/libs/shared-utils/Object3DHelper/Base/BaseController.d.ts +2 -0
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +8 -2
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts +2 -2
- package/libs/shared-utils/Object3DHelper/Controller/RectangleScaleController.js +92 -86
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.d.ts +2 -1
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +17 -8
- package/libs/shared-utils/Object3DHelper/Helper/RectangleScaleHelper.js +1 -7
- package/libs/shared-utils/Object3DHelper/utils/finiteNumber.d.ts +1 -0
- package/libs/shared-utils/Object3DHelper/utils/finiteNumber.js +9 -0
- package/package.json +1 -1
|
@@ -728,6 +728,7 @@ const NAME$1 = `CSS3DObjectPlus@${VERSION$3}`;
|
|
|
728
728
|
const MinRatio = 0.00216;
|
|
729
729
|
const DefaultRatio = 0.003;
|
|
730
730
|
class CSS3DObjectPlus extends CSS3DRenderer.CSS3DObject {
|
|
731
|
+
// eslint-disable-next-line max-params
|
|
731
732
|
constructor(container, cornerPoints, ratio = DefaultRatio, dpr = 1) {
|
|
732
733
|
const realRatio = Math.max(MinRatio, ratio);
|
|
733
734
|
const planeWidth = cornerPoints[0].distanceTo(cornerPoints[1]);
|
|
@@ -1041,6 +1042,7 @@ class CSS3DRender {
|
|
|
1041
1042
|
globalStore.frontModeStore = undefined;
|
|
1042
1043
|
if (mode === 'behind')
|
|
1043
1044
|
globalStore.behindModeStore = undefined;
|
|
1045
|
+
globalStore.resizeObserver = undefined;
|
|
1044
1046
|
}
|
|
1045
1047
|
return true;
|
|
1046
1048
|
};
|
|
@@ -1138,8 +1140,10 @@ class CSS3DRender {
|
|
|
1138
1140
|
configurable: true,
|
|
1139
1141
|
writable: true,
|
|
1140
1142
|
value: (element, resizeHandler, fireImmediately = true) => {
|
|
1141
|
-
if (!element
|
|
1143
|
+
if (!element) {
|
|
1144
|
+
console.error('createResizeObserver: element is undefined');
|
|
1142
1145
|
return { observe: () => { }, unobserve: () => { } };
|
|
1146
|
+
}
|
|
1143
1147
|
const resizeObserverHandler = () => {
|
|
1144
1148
|
/**
|
|
1145
1149
|
* 这里evenNumber策略是遇到奇数会加1,在某些浏览器中会触发滚动条显示,导致fiveElement变小,fiveElement变小又触发了这里的resize,宽高变小,滚动条消失,然后又触发resize。。。无限循环
|
|
@@ -1149,6 +1153,10 @@ class CSS3DRender {
|
|
|
1149
1153
|
const height = evenNumber(element.clientHeight, { smaller: true });
|
|
1150
1154
|
resizeHandler(width, height);
|
|
1151
1155
|
};
|
|
1156
|
+
if (typeof ResizeObserver === 'undefined' || !ResizeObserver) {
|
|
1157
|
+
console.warn('createResizeObserver: ResizeObserver is undefined');
|
|
1158
|
+
return { observe: () => resizeObserverHandler(), unobserve: () => { } };
|
|
1159
|
+
}
|
|
1152
1160
|
const observer = new ResizeObserver(resizeObserverHandler);
|
|
1153
1161
|
if (fireImmediately)
|
|
1154
1162
|
resizeObserverHandler();
|
|
@@ -1470,13 +1478,6 @@ class RectangleScaleHelper extends RectangleScaleHelperAbstract {
|
|
|
1470
1478
|
var _a, _b;
|
|
1471
1479
|
(_a = this.css3DInstance) === null || _a === void 0 ? void 0 : _a.css3DObject.scale.applyMatrix4(matrix);
|
|
1472
1480
|
(_b = this.plane) === null || _b === void 0 ? void 0 : _b.scale.applyMatrix4(matrix);
|
|
1473
|
-
const { origin, helperOrigin } = params !== null && params !== void 0 ? params : {};
|
|
1474
|
-
if (!helperOrigin)
|
|
1475
|
-
return;
|
|
1476
|
-
this.cornerPositions.forEach((position) => {
|
|
1477
|
-
position.subVectors(position, helperOrigin).applyMatrix4(matrix).add(helperOrigin);
|
|
1478
|
-
});
|
|
1479
|
-
this.updatePoints();
|
|
1480
1481
|
}
|
|
1481
1482
|
updatePoints() {
|
|
1482
1483
|
const position8 = this.calculatePointPosition(this.cornerPositions);
|
|
@@ -2092,10 +2093,16 @@ class BaseController {
|
|
|
2092
2093
|
this.scene = scene;
|
|
2093
2094
|
this.domEvents = new DomEvents(camera, container);
|
|
2094
2095
|
this.needsRender = needsRender !== null && needsRender !== void 0 ? needsRender : (() => { });
|
|
2095
|
-
this.
|
|
2096
|
-
this.
|
|
2096
|
+
this.initialHelperPosition();
|
|
2097
|
+
this.initialHelperQuaternion();
|
|
2097
2098
|
this.enable();
|
|
2098
2099
|
}
|
|
2100
|
+
initialHelperPosition() {
|
|
2101
|
+
this.helperObject3D.updatePosition();
|
|
2102
|
+
}
|
|
2103
|
+
initialHelperQuaternion() {
|
|
2104
|
+
this.helperObject3D.updateQuaternion();
|
|
2105
|
+
}
|
|
2099
2106
|
enable() {
|
|
2100
2107
|
if (this.enabled)
|
|
2101
2108
|
return;
|
|
@@ -2674,23 +2681,23 @@ class RotateController extends BaseController {
|
|
|
2674
2681
|
writable: true,
|
|
2675
2682
|
value: void 0
|
|
2676
2683
|
});
|
|
2677
|
-
Object.defineProperty(this, "
|
|
2684
|
+
Object.defineProperty(this, "a", {
|
|
2678
2685
|
enumerable: true,
|
|
2679
2686
|
configurable: true,
|
|
2680
2687
|
writable: true,
|
|
2681
|
-
value:
|
|
2688
|
+
value: void 0
|
|
2682
2689
|
});
|
|
2683
|
-
Object.defineProperty(this, "
|
|
2690
|
+
Object.defineProperty(this, "rotations", {
|
|
2684
2691
|
enumerable: true,
|
|
2685
2692
|
configurable: true,
|
|
2686
2693
|
writable: true,
|
|
2687
|
-
value:
|
|
2694
|
+
value: []
|
|
2688
2695
|
});
|
|
2689
2696
|
Object.defineProperty(this, "helperObject3DQuaternion", {
|
|
2690
2697
|
enumerable: true,
|
|
2691
2698
|
configurable: true,
|
|
2692
2699
|
writable: true,
|
|
2693
|
-
value: this.
|
|
2700
|
+
value: this.originObject3D.quaternion.clone()
|
|
2694
2701
|
});
|
|
2695
2702
|
// add hover listener
|
|
2696
2703
|
const helper = this.helperObject3D;
|
|
@@ -2702,6 +2709,10 @@ class RotateController extends BaseController {
|
|
|
2702
2709
|
document.addEventListener('mousemove', dragging);
|
|
2703
2710
|
document.addEventListener('mouseup', dragEnd);
|
|
2704
2711
|
}
|
|
2712
|
+
initialHelperQuaternion() {
|
|
2713
|
+
this.helperObject3D.updateAngleHelperQuaternion();
|
|
2714
|
+
this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion);
|
|
2715
|
+
}
|
|
2705
2716
|
/**
|
|
2706
2717
|
* @description: 拖动开始,找出拖的Direction
|
|
2707
2718
|
*/
|
|
@@ -2726,9 +2737,9 @@ class RotateController extends BaseController {
|
|
|
2726
2737
|
this.setTipsPosition(tipsPosition);
|
|
2727
2738
|
// end
|
|
2728
2739
|
// init plane
|
|
2729
|
-
const directionX = new THREE__namespace.Vector3(1, 0, 0).applyQuaternion(this.helperObject3DQuaternion
|
|
2730
|
-
const directionY = new THREE__namespace.Vector3(0, 1, 0).applyQuaternion(this.helperObject3DQuaternion
|
|
2731
|
-
const directionZ = new THREE__namespace.Vector3(0, 0, 1).applyQuaternion(this.helperObject3DQuaternion
|
|
2740
|
+
const directionX = new THREE__namespace.Vector3(1, 0, 0).applyQuaternion(this.helperObject3DQuaternion);
|
|
2741
|
+
const directionY = new THREE__namespace.Vector3(0, 1, 0).applyQuaternion(this.helperObject3DQuaternion);
|
|
2742
|
+
const directionZ = new THREE__namespace.Vector3(0, 0, 1).applyQuaternion(this.helperObject3DQuaternion);
|
|
2732
2743
|
const directionVector = (() => {
|
|
2733
2744
|
switch (direction) {
|
|
2734
2745
|
case 'x':
|
|
@@ -2740,6 +2751,11 @@ class RotateController extends BaseController {
|
|
|
2740
2751
|
}
|
|
2741
2752
|
})();
|
|
2742
2753
|
const plane = new THREE__namespace.Plane().setFromNormalAndCoplanarPoint(directionVector, startIntersect);
|
|
2754
|
+
// this.a && this.scene.remove(this.a)
|
|
2755
|
+
// const h = new THREE.PlaneHelper(plane, 1)
|
|
2756
|
+
// console.log(h.position)
|
|
2757
|
+
// this.scene.add(h)
|
|
2758
|
+
// this.a = h
|
|
2743
2759
|
// end
|
|
2744
2760
|
// init startVectorProject
|
|
2745
2761
|
const projectPoint = new THREE__namespace.Vector3();
|
|
@@ -2920,10 +2936,6 @@ class RotateController extends BaseController {
|
|
|
2920
2936
|
}
|
|
2921
2937
|
}
|
|
2922
2938
|
|
|
2923
|
-
function negateScale(scale) {
|
|
2924
|
-
return scale.clone().sub(new THREE__namespace.Vector3(1, 1, 1)).negate().add(new THREE__namespace.Vector3(1, 1, 1));
|
|
2925
|
-
}
|
|
2926
|
-
|
|
2927
2939
|
class RectangleScaleController extends BaseController {
|
|
2928
2940
|
constructor(...params) {
|
|
2929
2941
|
super(...params);
|
|
@@ -2960,10 +2972,6 @@ class RectangleScaleController extends BaseController {
|
|
|
2960
2972
|
plane.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new THREE.Vector3()), positions[0]);
|
|
2961
2973
|
else
|
|
2962
2974
|
plane.setFromCoplanarPoints(positions[0], positions[1], positions[2]);
|
|
2963
|
-
// const p0 = getPoint(positions[0]!, 0)
|
|
2964
|
-
// const p1 = getPoint(positions[1]!, 1)
|
|
2965
|
-
// const p2 = getPoint(positions[2]!, 2)
|
|
2966
|
-
// this.scene.add(p0, p1, p2)
|
|
2967
2975
|
return plane;
|
|
2968
2976
|
}
|
|
2969
2977
|
dragStart(mousePoint, point) {
|
|
@@ -2973,6 +2981,7 @@ class RectangleScaleController extends BaseController {
|
|
|
2973
2981
|
if (!plane)
|
|
2974
2982
|
return this.dragEnd();
|
|
2975
2983
|
this.startInfo = { startPoint: { position: point.position.clone(), direction: point.direction }, plane };
|
|
2984
|
+
// this.scene.add(getPoint(point.position.clone(), 3))
|
|
2976
2985
|
this.hooks.emit('scaleStart');
|
|
2977
2986
|
this.needsRender();
|
|
2978
2987
|
this.isDragging = true;
|
|
@@ -2985,7 +2994,7 @@ class RectangleScaleController extends BaseController {
|
|
|
2985
2994
|
if (!raycaster)
|
|
2986
2995
|
return this.dragEnd();
|
|
2987
2996
|
this.scale(raycaster);
|
|
2988
|
-
console.log('%c RectangleScaleController dragging', 'color: #49de1b')
|
|
2997
|
+
// console.log('%c RectangleScaleController dragging', 'color: #49de1b')
|
|
2989
2998
|
}
|
|
2990
2999
|
scale(raycaster) {
|
|
2991
3000
|
var _a, _b;
|
|
@@ -3001,100 +3010,108 @@ class RectangleScaleController extends BaseController {
|
|
|
3001
3010
|
return;
|
|
3002
3011
|
if (vectorIsEqual(planeIntersection, this.camera.position))
|
|
3003
3012
|
return;
|
|
3004
|
-
const referencePosition = cornerPositions[0].clone();
|
|
3005
3013
|
const planeCenter = new THREE.Vector3().addVectors(cornerPositions[0], cornerPositions[2]).divideScalar(2);
|
|
3006
3014
|
const { position: startPosition, direction } = startPoint;
|
|
3007
|
-
const ewVector = new THREE.Vector3().subVectors(cornerPositions[1],
|
|
3008
|
-
const nsVector = new THREE.Vector3().subVectors(cornerPositions[3],
|
|
3015
|
+
const ewVector = new THREE.Vector3().subVectors(cornerPositions[1], cornerPositions[0]); // west -> east vector
|
|
3016
|
+
const nsVector = new THREE.Vector3().subVectors(cornerPositions[3], cornerPositions[0]); // south -> north vector
|
|
3009
3017
|
// eslint-disable-next-line complexity
|
|
3010
|
-
const
|
|
3018
|
+
const getOffset = (direction) => {
|
|
3019
|
+
const defaultVector = new THREE.Vector3(0, 0, 0);
|
|
3020
|
+
if (!this.startInfo)
|
|
3021
|
+
return defaultVector;
|
|
3011
3022
|
const baseVector = (direction === 'ew' ? ewVector : nsVector).clone();
|
|
3012
3023
|
const startPositionProject = startPosition.clone().projectOnVector(baseVector);
|
|
3013
3024
|
const nowPositionProject = planeIntersection.clone().projectOnVector(baseVector);
|
|
3014
3025
|
const planeCenterProject = planeCenter.clone().projectOnVector(baseVector);
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3026
|
+
// this.scene.add(getPoint(startPosition, 0))
|
|
3027
|
+
// this.scene.add(getPoint(planeIntersection, 0))
|
|
3028
|
+
if (nowPositionProject.equals(startPositionProject))
|
|
3029
|
+
return defaultVector;
|
|
3030
|
+
if (direction === 'ns' && typeof this.startInfo.dragPointInCenterBottom !== 'boolean') {
|
|
3031
|
+
const offset = new THREE.Vector3().subVectors(nowPositionProject, planeCenterProject);
|
|
3032
|
+
const xIsNegative = offset.x < 0 && baseVector.x >= 0;
|
|
3033
|
+
const yIsNegative = offset.y < 0 && baseVector.y >= 0;
|
|
3034
|
+
const zIsNegative = offset.z < 0 && baseVector.z >= 0;
|
|
3035
|
+
this.startInfo.dragPointInCenterBottom = xIsNegative || yIsNegative || zIsNegative;
|
|
3036
|
+
}
|
|
3037
|
+
if (direction === 'ew' && typeof this.startInfo.dragPointInCenterLeft !== 'boolean') {
|
|
3038
|
+
const offset = new THREE.Vector3().subVectors(nowPositionProject, planeCenterProject);
|
|
3039
|
+
const xIsNegative = offset.x < 0 && baseVector.x >= 0;
|
|
3040
|
+
const yIsNegative = offset.y < 0 && baseVector.y >= 0;
|
|
3041
|
+
const zIsNegative = offset.z < 0 && baseVector.z >= 0;
|
|
3042
|
+
this.startInfo.dragPointInCenterLeft = xIsNegative || yIsNegative || zIsNegative;
|
|
3043
|
+
}
|
|
3044
|
+
const offset = new THREE.Vector3().subVectors(nowPositionProject, startPositionProject);
|
|
3045
|
+
// TODO
|
|
3046
|
+
if (offset.length() > 0.1)
|
|
3047
|
+
return defaultVector;
|
|
3048
|
+
return offset;
|
|
3049
|
+
};
|
|
3050
|
+
const ewOffset = getOffset('ew');
|
|
3051
|
+
const nsOffset = getOffset('ns');
|
|
3052
|
+
const setEWScale = () => {
|
|
3053
|
+
const offset = ewOffset;
|
|
3054
|
+
this.helperObject3D.cornerPositions.forEach((position, index) => {
|
|
3055
|
+
var _a;
|
|
3056
|
+
if ((_a = this.startInfo) === null || _a === void 0 ? void 0 : _a.dragPointInCenterLeft) {
|
|
3057
|
+
if (index === 0 || index === 3)
|
|
3058
|
+
position.add(offset); // 拖左边,只改左边点
|
|
3022
3059
|
}
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
const yIsNegative = offset.y < 0 && baseVector.y >= 0;
|
|
3027
|
-
const zIsNegative = offset.z < 0 && baseVector.z >= 0;
|
|
3028
|
-
this.startInfo.ewMoveIsNegative = xIsNegative || yIsNegative || zIsNegative;
|
|
3060
|
+
else {
|
|
3061
|
+
if (index === 1 || index === 2)
|
|
3062
|
+
position.add(offset); // 拖右边,只改右边点
|
|
3029
3063
|
}
|
|
3030
|
-
}
|
|
3031
|
-
if (nowPositionProject.equals(startPositionProject))
|
|
3032
|
-
return;
|
|
3033
|
-
const startPositionProjectOffset = new THREE.Vector3().subVectors(startPositionProject, planeCenterProject);
|
|
3034
|
-
const nowPositionProjectOffset = new THREE.Vector3().subVectors(nowPositionProject, planeCenterProject);
|
|
3035
|
-
const scale = nowPositionProjectOffset.clone().divide(startPositionProjectOffset);
|
|
3036
|
-
scale.x = isNaN(scale.x) ? 1 : scale.x;
|
|
3037
|
-
scale.y = isNaN(scale.y) ? 1 : scale.y;
|
|
3038
|
-
scale.z = isNaN(scale.z) ? 1 : scale.z;
|
|
3039
|
-
return scale;
|
|
3064
|
+
});
|
|
3040
3065
|
};
|
|
3041
|
-
const
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3066
|
+
const setNSScale = () => {
|
|
3067
|
+
const offset = nsOffset;
|
|
3068
|
+
this.helperObject3D.cornerPositions.forEach((position, index) => {
|
|
3069
|
+
var _a;
|
|
3070
|
+
if ((_a = this.startInfo) === null || _a === void 0 ? void 0 : _a.dragPointInCenterBottom) {
|
|
3071
|
+
if (index === 0 || index === 1)
|
|
3072
|
+
position.add(offset); // 拖下边,只改下边点
|
|
3073
|
+
}
|
|
3074
|
+
else {
|
|
3075
|
+
if (index === 2 || index === 3)
|
|
3076
|
+
position.add(offset); // 拖上边,只改上边点
|
|
3077
|
+
}
|
|
3078
|
+
});
|
|
3079
|
+
};
|
|
3080
|
+
switch (direction) {
|
|
3081
|
+
case 'ew':
|
|
3082
|
+
setEWScale();
|
|
3083
|
+
break;
|
|
3084
|
+
case 'ns':
|
|
3085
|
+
setNSScale();
|
|
3086
|
+
break;
|
|
3087
|
+
case 'nesw':
|
|
3088
|
+
case 'nwse':
|
|
3089
|
+
setEWScale();
|
|
3090
|
+
setNSScale();
|
|
3091
|
+
}
|
|
3092
|
+
(_b = (_a = this.helperObject3D).updatePoints) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3093
|
+
// this.helperObject3D.cornerPositions.forEach((position, index) => {
|
|
3094
|
+
// this.scene.add(getPoint(position, index))
|
|
3095
|
+
// })
|
|
3096
|
+
const scaleX = new THREE.Vector3().subVectors(cornerPositions[1], cornerPositions[0]).length() / ewVector.length();
|
|
3097
|
+
const scaleY = new THREE.Vector3().subVectors(cornerPositions[3], cornerPositions[0]).length() / nsVector.length();
|
|
3098
|
+
const scaleXY = new THREE.Vector3(scaleX, scaleY, 1);
|
|
3099
|
+
console.log(scaleXY);
|
|
3100
|
+
const scaleMatrix = new THREE__namespace.Matrix4().scale(scaleXY);
|
|
3056
3101
|
const newScale = object.scale.clone().applyMatrix4(scaleMatrix);
|
|
3057
|
-
// const minScale = 0.000001
|
|
3058
|
-
// newScale.x = Math.max(newScale.x, minScale)
|
|
3059
|
-
// newScale.y = Math.max(newScale.y, minScale)
|
|
3060
|
-
// newScale.z = Math.max(newScale.z, minScale)
|
|
3061
|
-
// if (direction === 'ew' || direction === 'ns') {
|
|
3062
|
-
// if (newScale.x === minScale || newScale.y === minScale || newScale.z === minScale) return
|
|
3063
|
-
// }
|
|
3064
|
-
// if (direction === 'nesw' || direction === 'nwse') {
|
|
3065
|
-
// if (newScale.x === minScale && newScale.y === minScale) return
|
|
3066
|
-
// if (newScale.x === minScale && newScale.z === minScale) return
|
|
3067
|
-
// if (newScale.y === minScale && newScale.z === minScale) return
|
|
3068
|
-
// }
|
|
3069
3102
|
object.scale.copy(newScale); // 或者 object.scale.applyMatrix4(scaleMatrix)
|
|
3070
|
-
startPoint.position.copy(planeIntersection);
|
|
3071
3103
|
this.hooks.emit('scaleUpdate', { matrix4: scaleMatrix, helperOrigin: planeCenter });
|
|
3104
|
+
startPoint.position.copy(planeIntersection);
|
|
3105
|
+
// =================================================================================================================================================================
|
|
3106
|
+
// =================================================================================================================================================================
|
|
3072
3107
|
// 移动位置
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
case 'ns':
|
|
3081
|
-
return nsMoveScale;
|
|
3082
|
-
case 'nesw':
|
|
3083
|
-
case 'nwse':
|
|
3084
|
-
return new THREE.Vector3().multiplyVectors(ewMoveScale, nsMoveScale);
|
|
3085
|
-
}
|
|
3086
|
-
})();
|
|
3087
|
-
const halfMoveScale = moveScale.clone().sub(new THREE.Vector3(1, 1, 1)).multiplyScalar(0.5).add(new THREE.Vector3(1, 1, 1));
|
|
3088
|
-
const objectPosition = object.position.clone();
|
|
3089
|
-
const newPosition = new THREE.Vector3()
|
|
3090
|
-
.subVectors(objectPosition, referencePosition)
|
|
3091
|
-
.multiply(halfMoveScale)
|
|
3092
|
-
.add(referencePosition)
|
|
3093
|
-
.sub(objectPosition);
|
|
3094
|
-
const transform = new THREE__namespace.Matrix4().setPosition(newPosition);
|
|
3095
|
-
object.applyMatrix4(transform);
|
|
3096
|
-
this.hooks.emit('positionUpdate', { matrix4: transform });
|
|
3097
|
-
}
|
|
3108
|
+
const centerPosition = new THREE.Vector3().addVectors(cornerPositions[0], cornerPositions[2]).divideScalar(2);
|
|
3109
|
+
const offset = new THREE.Vector3().subVectors(centerPosition, planeCenter);
|
|
3110
|
+
const transform = new THREE__namespace.Matrix4().setPosition(offset);
|
|
3111
|
+
object.applyMatrix4(transform);
|
|
3112
|
+
// this.hooks.emit('scaleUpdate', { matrix4: scaleMatrix, helperOrigin: planeCenter })
|
|
3113
|
+
this.hooks.emit('positionUpdate', { matrix4: transform });
|
|
3114
|
+
// 移动位置end
|
|
3098
3115
|
this.needsRender();
|
|
3099
3116
|
}
|
|
3100
3117
|
dragEnd() {
|
|
@@ -3173,6 +3190,7 @@ class Object3DHelperController extends Controller {
|
|
|
3173
3190
|
});
|
|
3174
3191
|
this.five = five;
|
|
3175
3192
|
Object.assign(window, { [`__${PLUGIN_NAME.toUpperCase()}_DEBUG__`]: this });
|
|
3193
|
+
// Object.assign(window, { THREE: THREE })
|
|
3176
3194
|
}
|
|
3177
3195
|
/**
|
|
3178
3196
|
* @description Show guide line
|
|
@@ -3238,6 +3256,8 @@ class Object3DHelperController extends Controller {
|
|
|
3238
3256
|
*/
|
|
3239
3257
|
addObject3DHelper(object3D, config = {}) {
|
|
3240
3258
|
var _a;
|
|
3259
|
+
if (!object3D)
|
|
3260
|
+
return console.error('Object3D is undefined');
|
|
3241
3261
|
if (this.objectHelperMap.has(object3D)) {
|
|
3242
3262
|
console.warn(`Object3DHelperPlugin: object3D ${object3D.name} already has helper`);
|
|
3243
3263
|
return;
|
|
@@ -3285,7 +3305,6 @@ class Object3DHelperController extends Controller {
|
|
|
3285
3305
|
helper.dispose();
|
|
3286
3306
|
}
|
|
3287
3307
|
handleEnable(enabled, userAction = true) {
|
|
3288
|
-
console.log({ enabled });
|
|
3289
3308
|
if (enabled) {
|
|
3290
3309
|
this.everyHelperDo((helper) => helper.enable());
|
|
3291
3310
|
this.hooks.emit('enable', { userAction });
|
|
@@ -3297,7 +3316,6 @@ class Object3DHelperController extends Controller {
|
|
|
3297
3316
|
this.state.enabled = enabled;
|
|
3298
3317
|
}
|
|
3299
3318
|
handleVisible(visible, userAction = true) {
|
|
3300
|
-
console.log({ visible });
|
|
3301
3319
|
if (visible) {
|
|
3302
3320
|
this.everyHelperDo((helper) => helper.show());
|
|
3303
3321
|
this.actionIfStateIsEnabled(() => this.hooks.emit('show', { userAction }));
|
|
@@ -16,6 +16,8 @@ export declare abstract class BaseController<T extends BaseHelper = BaseHelper,
|
|
|
16
16
|
protected needsRender: () => void;
|
|
17
17
|
protected enabled: boolean;
|
|
18
18
|
constructor(camera: THREE.Camera, model: THREE.Object3D, originObject3D: K, helperObject3D: T, container: HTMLElement, scene: THREE.Scene, needsRender?: () => void);
|
|
19
|
+
initialHelperPosition(): void;
|
|
20
|
+
initialHelperQuaternion(): void;
|
|
19
21
|
enable(): void;
|
|
20
22
|
disable(): void;
|
|
21
23
|
show(): void;
|
|
@@ -8,8 +8,8 @@ interface StartInfo {
|
|
|
8
8
|
position: Vector3;
|
|
9
9
|
direction: Direction4;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
dragPointInCenterBottom?: boolean | null;
|
|
12
|
+
dragPointInCenterLeft?: boolean | null;
|
|
13
13
|
plane: THREE.Plane;
|
|
14
14
|
}
|
|
15
15
|
export declare abstract class RectangleScaleController<OriginObject3D extends THREE.Object3D, PointType extends THREE.Object3D | HTMLElement> extends BaseController<RectangleScaleHelperAbstract<OriginObject3D, PointType>> {
|
package/dist/Object3DHelperPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import type { RotateHelperAbstract } from '../Helper';
|
|
|
3
3
|
export declare class RotateController<T extends RotateHelperAbstract = RotateHelperAbstract> extends BaseController<T> {
|
|
4
4
|
private startInfo?;
|
|
5
5
|
private lastRotation?;
|
|
6
|
+
private a?;
|
|
6
7
|
private rotations;
|
|
7
|
-
private a;
|
|
8
8
|
private helperObject3DQuaternion;
|
|
9
9
|
constructor(...params: ConstructorParameters<typeof BaseController<T>>);
|
|
10
|
+
initialHelperQuaternion(): void;
|
|
10
11
|
/**
|
|
11
12
|
* @description: 拖动开始,找出拖的Direction
|
|
12
13
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function finiteNumber(value: number | undefined | null | void, defaultValue?: number): number;
|
|
@@ -268,6 +268,7 @@ const NAME = `CSS3DObjectPlus@${VERSION$2}`;
|
|
|
268
268
|
const MinRatio = 0.00216;
|
|
269
269
|
const DefaultRatio = 0.003;
|
|
270
270
|
class CSS3DObjectPlus extends CSS3DRenderer.CSS3DObject {
|
|
271
|
+
// eslint-disable-next-line max-params
|
|
271
272
|
constructor(container, cornerPoints, ratio = DefaultRatio, dpr = 1) {
|
|
272
273
|
const realRatio = Math.max(MinRatio, ratio);
|
|
273
274
|
const planeWidth = cornerPoints[0].distanceTo(cornerPoints[1]);
|
|
@@ -581,6 +582,7 @@ class CSS3DRender {
|
|
|
581
582
|
globalStore.frontModeStore = undefined;
|
|
582
583
|
if (mode === 'behind')
|
|
583
584
|
globalStore.behindModeStore = undefined;
|
|
585
|
+
globalStore.resizeObserver = undefined;
|
|
584
586
|
}
|
|
585
587
|
return true;
|
|
586
588
|
};
|
|
@@ -678,8 +680,10 @@ class CSS3DRender {
|
|
|
678
680
|
configurable: true,
|
|
679
681
|
writable: true,
|
|
680
682
|
value: (element, resizeHandler, fireImmediately = true) => {
|
|
681
|
-
if (!element
|
|
683
|
+
if (!element) {
|
|
684
|
+
console.error('createResizeObserver: element is undefined');
|
|
682
685
|
return { observe: () => { }, unobserve: () => { } };
|
|
686
|
+
}
|
|
683
687
|
const resizeObserverHandler = () => {
|
|
684
688
|
/**
|
|
685
689
|
* 这里evenNumber策略是遇到奇数会加1,在某些浏览器中会触发滚动条显示,导致fiveElement变小,fiveElement变小又触发了这里的resize,宽高变小,滚动条消失,然后又触发resize。。。无限循环
|
|
@@ -689,6 +693,10 @@ class CSS3DRender {
|
|
|
689
693
|
const height = evenNumber(element.clientHeight, { smaller: true });
|
|
690
694
|
resizeHandler(width, height);
|
|
691
695
|
};
|
|
696
|
+
if (typeof ResizeObserver === 'undefined' || !ResizeObserver) {
|
|
697
|
+
console.warn('createResizeObserver: ResizeObserver is undefined');
|
|
698
|
+
return { observe: () => resizeObserverHandler(), unobserve: () => { } };
|
|
699
|
+
}
|
|
692
700
|
const observer = new ResizeObserver(resizeObserverHandler);
|
|
693
701
|
if (fireImmediately)
|
|
694
702
|
resizeObserverHandler();
|
|
@@ -16,6 +16,8 @@ export declare abstract class BaseController<T extends BaseHelper = BaseHelper,
|
|
|
16
16
|
protected needsRender: () => void;
|
|
17
17
|
protected enabled: boolean;
|
|
18
18
|
constructor(camera: THREE.Camera, model: THREE.Object3D, originObject3D: K, helperObject3D: T, container: HTMLElement, scene: THREE.Scene, needsRender?: () => void);
|
|
19
|
+
initialHelperPosition(): void;
|
|
20
|
+
initialHelperQuaternion(): void;
|
|
19
21
|
enable(): void;
|
|
20
22
|
disable(): void;
|
|
21
23
|
show(): void;
|
package/dist/PanoCompassPlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ interface StartInfo {
|
|
|
8
8
|
position: Vector3;
|
|
9
9
|
direction: Direction4;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
dragPointInCenterBottom?: boolean | null;
|
|
12
|
+
dragPointInCenterLeft?: boolean | null;
|
|
13
13
|
plane: THREE.Plane;
|
|
14
14
|
}
|
|
15
15
|
export declare abstract class RectangleScaleController<OriginObject3D extends THREE.Object3D, PointType extends THREE.Object3D | HTMLElement> extends BaseController<RectangleScaleHelperAbstract<OriginObject3D, PointType>> {
|
|
@@ -3,10 +3,11 @@ import type { RotateHelperAbstract } from '../Helper';
|
|
|
3
3
|
export declare class RotateController<T extends RotateHelperAbstract = RotateHelperAbstract> extends BaseController<T> {
|
|
4
4
|
private startInfo?;
|
|
5
5
|
private lastRotation?;
|
|
6
|
+
private a?;
|
|
6
7
|
private rotations;
|
|
7
|
-
private a;
|
|
8
8
|
private helperObject3DQuaternion;
|
|
9
9
|
constructor(...params: ConstructorParameters<typeof BaseController<T>>);
|
|
10
|
+
initialHelperQuaternion(): void;
|
|
10
11
|
/**
|
|
11
12
|
* @description: 拖动开始,找出拖的Direction
|
|
12
13
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function finiteNumber(value: number | undefined | null | void, defaultValue?: number): number;
|
|
@@ -16,6 +16,8 @@ export declare abstract class BaseController<T extends BaseHelper = BaseHelper,
|
|
|
16
16
|
protected needsRender: () => void;
|
|
17
17
|
protected enabled: boolean;
|
|
18
18
|
constructor(camera: THREE.Camera, model: THREE.Object3D, originObject3D: K, helperObject3D: T, container: HTMLElement, scene: THREE.Scene, needsRender?: () => void);
|
|
19
|
+
initialHelperPosition(): void;
|
|
20
|
+
initialHelperQuaternion(): void;
|
|
19
21
|
enable(): void;
|
|
20
22
|
disable(): void;
|
|
21
23
|
show(): void;
|
|
@@ -8,8 +8,8 @@ interface StartInfo {
|
|
|
8
8
|
position: Vector3;
|
|
9
9
|
direction: Direction4;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
dragPointInCenterBottom?: boolean | null;
|
|
12
|
+
dragPointInCenterLeft?: boolean | null;
|
|
13
13
|
plane: THREE.Plane;
|
|
14
14
|
}
|
|
15
15
|
export declare abstract class RectangleScaleController<OriginObject3D extends THREE.Object3D, PointType extends THREE.Object3D | HTMLElement> extends BaseController<RectangleScaleHelperAbstract<OriginObject3D, PointType>> {
|
package/dist/PanoCursorRaycasterPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import type { RotateHelperAbstract } from '../Helper';
|
|
|
3
3
|
export declare class RotateController<T extends RotateHelperAbstract = RotateHelperAbstract> extends BaseController<T> {
|
|
4
4
|
private startInfo?;
|
|
5
5
|
private lastRotation?;
|
|
6
|
+
private a?;
|
|
6
7
|
private rotations;
|
|
7
|
-
private a;
|
|
8
8
|
private helperObject3DQuaternion;
|
|
9
9
|
constructor(...params: ConstructorParameters<typeof BaseController<T>>);
|
|
10
|
+
initialHelperQuaternion(): void;
|
|
10
11
|
/**
|
|
11
12
|
* @description: 拖动开始,找出拖的Direction
|
|
12
13
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function finiteNumber(value: number | undefined | null | void, defaultValue?: number): number;
|
|
@@ -16,6 +16,8 @@ export declare abstract class BaseController<T extends BaseHelper = BaseHelper,
|
|
|
16
16
|
protected needsRender: () => void;
|
|
17
17
|
protected enabled: boolean;
|
|
18
18
|
constructor(camera: THREE.Camera, model: THREE.Object3D, originObject3D: K, helperObject3D: T, container: HTMLElement, scene: THREE.Scene, needsRender?: () => void);
|
|
19
|
+
initialHelperPosition(): void;
|
|
20
|
+
initialHelperQuaternion(): void;
|
|
19
21
|
enable(): void;
|
|
20
22
|
disable(): void;
|
|
21
23
|
show(): void;
|
|
@@ -8,8 +8,8 @@ interface StartInfo {
|
|
|
8
8
|
position: Vector3;
|
|
9
9
|
direction: Direction4;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
dragPointInCenterBottom?: boolean | null;
|
|
12
|
+
dragPointInCenterLeft?: boolean | null;
|
|
13
13
|
plane: THREE.Plane;
|
|
14
14
|
}
|
|
15
15
|
export declare abstract class RectangleScaleController<OriginObject3D extends THREE.Object3D, PointType extends THREE.Object3D | HTMLElement> extends BaseController<RectangleScaleHelperAbstract<OriginObject3D, PointType>> {
|
package/dist/PanoDoorLabelPlugin/shared-utils/Object3DHelper/Controller/RotateController.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import type { RotateHelperAbstract } from '../Helper';
|
|
|
3
3
|
export declare class RotateController<T extends RotateHelperAbstract = RotateHelperAbstract> extends BaseController<T> {
|
|
4
4
|
private startInfo?;
|
|
5
5
|
private lastRotation?;
|
|
6
|
+
private a?;
|
|
6
7
|
private rotations;
|
|
7
|
-
private a;
|
|
8
8
|
private helperObject3DQuaternion;
|
|
9
9
|
constructor(...params: ConstructorParameters<typeof BaseController<T>>);
|
|
10
|
+
initialHelperQuaternion(): void;
|
|
10
11
|
/**
|
|
11
12
|
* @description: 拖动开始,找出拖的Direction
|
|
12
13
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function finiteNumber(value: number | undefined | null | void, defaultValue?: number): number;
|
|
@@ -16,6 +16,8 @@ export declare abstract class BaseController<T extends BaseHelper = BaseHelper,
|
|
|
16
16
|
protected needsRender: () => void;
|
|
17
17
|
protected enabled: boolean;
|
|
18
18
|
constructor(camera: THREE.Camera, model: THREE.Object3D, originObject3D: K, helperObject3D: T, container: HTMLElement, scene: THREE.Scene, needsRender?: () => void);
|
|
19
|
+
initialHelperPosition(): void;
|
|
20
|
+
initialHelperQuaternion(): void;
|
|
19
21
|
enable(): void;
|
|
20
22
|
disable(): void;
|
|
21
23
|
show(): void;
|
package/dist/PanoMeasurePlugin/shared-utils/Object3DHelper/Controller/RectangleScaleController.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ interface StartInfo {
|
|
|
8
8
|
position: Vector3;
|
|
9
9
|
direction: Direction4;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
dragPointInCenterBottom?: boolean | null;
|
|
12
|
+
dragPointInCenterLeft?: boolean | null;
|
|
13
13
|
plane: THREE.Plane;
|
|
14
14
|
}
|
|
15
15
|
export declare abstract class RectangleScaleController<OriginObject3D extends THREE.Object3D, PointType extends THREE.Object3D | HTMLElement> extends BaseController<RectangleScaleHelperAbstract<OriginObject3D, PointType>> {
|
|
@@ -3,10 +3,11 @@ import type { RotateHelperAbstract } from '../Helper';
|
|
|
3
3
|
export declare class RotateController<T extends RotateHelperAbstract = RotateHelperAbstract> extends BaseController<T> {
|
|
4
4
|
private startInfo?;
|
|
5
5
|
private lastRotation?;
|
|
6
|
+
private a?;
|
|
6
7
|
private rotations;
|
|
7
|
-
private a;
|
|
8
8
|
private helperObject3DQuaternion;
|
|
9
9
|
constructor(...params: ConstructorParameters<typeof BaseController<T>>);
|
|
10
|
+
initialHelperQuaternion(): void;
|
|
10
11
|
/**
|
|
11
12
|
* @description: 拖动开始,找出拖的Direction
|
|
12
13
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function finiteNumber(value: number | undefined | null | void, defaultValue?: number): number;
|
|
@@ -16,6 +16,8 @@ export declare abstract class BaseController<T extends BaseHelper = BaseHelper,
|
|
|
16
16
|
protected needsRender: () => void;
|
|
17
17
|
protected enabled: boolean;
|
|
18
18
|
constructor(camera: THREE.Camera, model: THREE.Object3D, originObject3D: K, helperObject3D: T, container: HTMLElement, scene: THREE.Scene, needsRender?: () => void);
|
|
19
|
+
initialHelperPosition(): void;
|
|
20
|
+
initialHelperQuaternion(): void;
|
|
19
21
|
enable(): void;
|
|
20
22
|
disable(): void;
|
|
21
23
|
show(): void;
|