@realsee/dnalogel 2.1.0-alpha.6 → 2.1.0-alpha.7
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 +8 -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 +126 -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 +8 -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 +8 -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 +25 -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 +143 -126
- package/dist/index.js +143 -126
- package/dist/index.umd.js +143 -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 +1 -1
- 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 +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 +3 -3
- package/docs/interfaces/FloorplanData.html +1 -1
- package/docs/interfaces/FloorplanEntrance.html +6 -6
- package/docs/interfaces/FloorplanExtraObject.html +2 -2
- package/docs/interfaces/FloorplanExtraObject3D.html +1 -1
- package/docs/interfaces/FloorplanFloorData.html +1 -1
- package/docs/interfaces/FloorplanImagePosition.html +1 -1
- package/docs/interfaces/FloorplanObserver.html +1 -1
- package/docs/interfaces/FloorplanOutlineItem.html +1 -1
- package/docs/interfaces/FloorplanPosition.html +1 -1
- package/docs/interfaces/FloorplanRoomItem.html +5 -5
- package/docs/interfaces/FloorplanRoomLabelItem.html +2 -2
- package/docs/interfaces/FloorplanServerBounding.html +3 -3
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +1 -1
- package/docs/interfaces/FloorplanServerDoorItem.html +1 -1
- package/docs/interfaces/FloorplanServerDoorPosition.html +1 -1
- package/docs/interfaces/FloorplanServerEntrance.html +6 -6
- package/docs/interfaces/FloorplanServerFloorData.html +1 -1
- package/docs/interfaces/FloorplanServerImagePosition.html +1 -1
- package/docs/interfaces/FloorplanServerObserver.html +1 -1
- package/docs/interfaces/FloorplanServerOutlineItem.html +1 -1
- package/docs/interfaces/FloorplanServerPosition.html +1 -1
- package/docs/interfaces/FloorplanServerRoomItem.html +6 -6
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +2 -2
- 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 +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- 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/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/Scissor.html +4 -4
- 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 +7 -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]);
|
|
@@ -1138,8 +1139,10 @@ class CSS3DRender {
|
|
|
1138
1139
|
configurable: true,
|
|
1139
1140
|
writable: true,
|
|
1140
1141
|
value: (element, resizeHandler, fireImmediately = true) => {
|
|
1141
|
-
if (!element
|
|
1142
|
+
if (!element) {
|
|
1143
|
+
console.error('createResizeObserver: element is undefined');
|
|
1142
1144
|
return { observe: () => { }, unobserve: () => { } };
|
|
1145
|
+
}
|
|
1143
1146
|
const resizeObserverHandler = () => {
|
|
1144
1147
|
/**
|
|
1145
1148
|
* 这里evenNumber策略是遇到奇数会加1,在某些浏览器中会触发滚动条显示,导致fiveElement变小,fiveElement变小又触发了这里的resize,宽高变小,滚动条消失,然后又触发resize。。。无限循环
|
|
@@ -1149,6 +1152,10 @@ class CSS3DRender {
|
|
|
1149
1152
|
const height = evenNumber(element.clientHeight, { smaller: true });
|
|
1150
1153
|
resizeHandler(width, height);
|
|
1151
1154
|
};
|
|
1155
|
+
if (typeof ResizeObserver === 'undefined' || !ResizeObserver) {
|
|
1156
|
+
console.warn('createResizeObserver: ResizeObserver is undefined');
|
|
1157
|
+
return { observe: () => resizeObserverHandler(), unobserve: () => { } };
|
|
1158
|
+
}
|
|
1152
1159
|
const observer = new ResizeObserver(resizeObserverHandler);
|
|
1153
1160
|
if (fireImmediately)
|
|
1154
1161
|
resizeObserverHandler();
|
|
@@ -1470,13 +1477,6 @@ class RectangleScaleHelper extends RectangleScaleHelperAbstract {
|
|
|
1470
1477
|
var _a, _b;
|
|
1471
1478
|
(_a = this.css3DInstance) === null || _a === void 0 ? void 0 : _a.css3DObject.scale.applyMatrix4(matrix);
|
|
1472
1479
|
(_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
1480
|
}
|
|
1481
1481
|
updatePoints() {
|
|
1482
1482
|
const position8 = this.calculatePointPosition(this.cornerPositions);
|
|
@@ -2092,10 +2092,16 @@ class BaseController {
|
|
|
2092
2092
|
this.scene = scene;
|
|
2093
2093
|
this.domEvents = new DomEvents(camera, container);
|
|
2094
2094
|
this.needsRender = needsRender !== null && needsRender !== void 0 ? needsRender : (() => { });
|
|
2095
|
-
this.
|
|
2096
|
-
this.
|
|
2095
|
+
this.initialHelperPosition();
|
|
2096
|
+
this.initialHelperQuaternion();
|
|
2097
2097
|
this.enable();
|
|
2098
2098
|
}
|
|
2099
|
+
initialHelperPosition() {
|
|
2100
|
+
this.helperObject3D.updatePosition();
|
|
2101
|
+
}
|
|
2102
|
+
initialHelperQuaternion() {
|
|
2103
|
+
this.helperObject3D.updateQuaternion();
|
|
2104
|
+
}
|
|
2099
2105
|
enable() {
|
|
2100
2106
|
if (this.enabled)
|
|
2101
2107
|
return;
|
|
@@ -2674,23 +2680,23 @@ class RotateController extends BaseController {
|
|
|
2674
2680
|
writable: true,
|
|
2675
2681
|
value: void 0
|
|
2676
2682
|
});
|
|
2677
|
-
Object.defineProperty(this, "
|
|
2683
|
+
Object.defineProperty(this, "a", {
|
|
2678
2684
|
enumerable: true,
|
|
2679
2685
|
configurable: true,
|
|
2680
2686
|
writable: true,
|
|
2681
|
-
value:
|
|
2687
|
+
value: void 0
|
|
2682
2688
|
});
|
|
2683
|
-
Object.defineProperty(this, "
|
|
2689
|
+
Object.defineProperty(this, "rotations", {
|
|
2684
2690
|
enumerable: true,
|
|
2685
2691
|
configurable: true,
|
|
2686
2692
|
writable: true,
|
|
2687
|
-
value:
|
|
2693
|
+
value: []
|
|
2688
2694
|
});
|
|
2689
2695
|
Object.defineProperty(this, "helperObject3DQuaternion", {
|
|
2690
2696
|
enumerable: true,
|
|
2691
2697
|
configurable: true,
|
|
2692
2698
|
writable: true,
|
|
2693
|
-
value: this.
|
|
2699
|
+
value: this.originObject3D.quaternion.clone()
|
|
2694
2700
|
});
|
|
2695
2701
|
// add hover listener
|
|
2696
2702
|
const helper = this.helperObject3D;
|
|
@@ -2702,6 +2708,10 @@ class RotateController extends BaseController {
|
|
|
2702
2708
|
document.addEventListener('mousemove', dragging);
|
|
2703
2709
|
document.addEventListener('mouseup', dragEnd);
|
|
2704
2710
|
}
|
|
2711
|
+
initialHelperQuaternion() {
|
|
2712
|
+
this.helperObject3D.updateAngleHelperQuaternion();
|
|
2713
|
+
this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion);
|
|
2714
|
+
}
|
|
2705
2715
|
/**
|
|
2706
2716
|
* @description: 拖动开始,找出拖的Direction
|
|
2707
2717
|
*/
|
|
@@ -2726,9 +2736,9 @@ class RotateController extends BaseController {
|
|
|
2726
2736
|
this.setTipsPosition(tipsPosition);
|
|
2727
2737
|
// end
|
|
2728
2738
|
// 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
|
|
2739
|
+
const directionX = new THREE__namespace.Vector3(1, 0, 0).applyQuaternion(this.helperObject3DQuaternion);
|
|
2740
|
+
const directionY = new THREE__namespace.Vector3(0, 1, 0).applyQuaternion(this.helperObject3DQuaternion);
|
|
2741
|
+
const directionZ = new THREE__namespace.Vector3(0, 0, 1).applyQuaternion(this.helperObject3DQuaternion);
|
|
2732
2742
|
const directionVector = (() => {
|
|
2733
2743
|
switch (direction) {
|
|
2734
2744
|
case 'x':
|
|
@@ -2740,6 +2750,11 @@ class RotateController extends BaseController {
|
|
|
2740
2750
|
}
|
|
2741
2751
|
})();
|
|
2742
2752
|
const plane = new THREE__namespace.Plane().setFromNormalAndCoplanarPoint(directionVector, startIntersect);
|
|
2753
|
+
// this.a && this.scene.remove(this.a)
|
|
2754
|
+
// const h = new THREE.PlaneHelper(plane, 1)
|
|
2755
|
+
// console.log(h.position)
|
|
2756
|
+
// this.scene.add(h)
|
|
2757
|
+
// this.a = h
|
|
2743
2758
|
// end
|
|
2744
2759
|
// init startVectorProject
|
|
2745
2760
|
const projectPoint = new THREE__namespace.Vector3();
|
|
@@ -2920,10 +2935,6 @@ class RotateController extends BaseController {
|
|
|
2920
2935
|
}
|
|
2921
2936
|
}
|
|
2922
2937
|
|
|
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
2938
|
class RectangleScaleController extends BaseController {
|
|
2928
2939
|
constructor(...params) {
|
|
2929
2940
|
super(...params);
|
|
@@ -2960,10 +2971,6 @@ class RectangleScaleController extends BaseController {
|
|
|
2960
2971
|
plane.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new THREE.Vector3()), positions[0]);
|
|
2961
2972
|
else
|
|
2962
2973
|
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
2974
|
return plane;
|
|
2968
2975
|
}
|
|
2969
2976
|
dragStart(mousePoint, point) {
|
|
@@ -2973,6 +2980,7 @@ class RectangleScaleController extends BaseController {
|
|
|
2973
2980
|
if (!plane)
|
|
2974
2981
|
return this.dragEnd();
|
|
2975
2982
|
this.startInfo = { startPoint: { position: point.position.clone(), direction: point.direction }, plane };
|
|
2983
|
+
// this.scene.add(getPoint(point.position.clone(), 3))
|
|
2976
2984
|
this.hooks.emit('scaleStart');
|
|
2977
2985
|
this.needsRender();
|
|
2978
2986
|
this.isDragging = true;
|
|
@@ -2985,7 +2993,7 @@ class RectangleScaleController extends BaseController {
|
|
|
2985
2993
|
if (!raycaster)
|
|
2986
2994
|
return this.dragEnd();
|
|
2987
2995
|
this.scale(raycaster);
|
|
2988
|
-
console.log('%c RectangleScaleController dragging', 'color: #49de1b')
|
|
2996
|
+
// console.log('%c RectangleScaleController dragging', 'color: #49de1b')
|
|
2989
2997
|
}
|
|
2990
2998
|
scale(raycaster) {
|
|
2991
2999
|
var _a, _b;
|
|
@@ -3001,100 +3009,108 @@ class RectangleScaleController extends BaseController {
|
|
|
3001
3009
|
return;
|
|
3002
3010
|
if (vectorIsEqual(planeIntersection, this.camera.position))
|
|
3003
3011
|
return;
|
|
3004
|
-
const referencePosition = cornerPositions[0].clone();
|
|
3005
3012
|
const planeCenter = new THREE.Vector3().addVectors(cornerPositions[0], cornerPositions[2]).divideScalar(2);
|
|
3006
3013
|
const { position: startPosition, direction } = startPoint;
|
|
3007
|
-
const ewVector = new THREE.Vector3().subVectors(cornerPositions[1],
|
|
3008
|
-
const nsVector = new THREE.Vector3().subVectors(cornerPositions[3],
|
|
3014
|
+
const ewVector = new THREE.Vector3().subVectors(cornerPositions[1], cornerPositions[0]); // west -> east vector
|
|
3015
|
+
const nsVector = new THREE.Vector3().subVectors(cornerPositions[3], cornerPositions[0]); // south -> north vector
|
|
3009
3016
|
// eslint-disable-next-line complexity
|
|
3010
|
-
const
|
|
3017
|
+
const getOffset = (direction) => {
|
|
3018
|
+
const defaultVector = new THREE.Vector3(0, 0, 0);
|
|
3019
|
+
if (!this.startInfo)
|
|
3020
|
+
return defaultVector;
|
|
3011
3021
|
const baseVector = (direction === 'ew' ? ewVector : nsVector).clone();
|
|
3012
3022
|
const startPositionProject = startPosition.clone().projectOnVector(baseVector);
|
|
3013
3023
|
const nowPositionProject = planeIntersection.clone().projectOnVector(baseVector);
|
|
3014
3024
|
const planeCenterProject = planeCenter.clone().projectOnVector(baseVector);
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3025
|
+
// this.scene.add(getPoint(startPosition, 0))
|
|
3026
|
+
// this.scene.add(getPoint(planeIntersection, 0))
|
|
3027
|
+
if (nowPositionProject.equals(startPositionProject))
|
|
3028
|
+
return defaultVector;
|
|
3029
|
+
if (direction === 'ns' && typeof this.startInfo.dragPointInCenterBottom !== 'boolean') {
|
|
3030
|
+
const offset = new THREE.Vector3().subVectors(nowPositionProject, planeCenterProject);
|
|
3031
|
+
const xIsNegative = offset.x < 0 && baseVector.x >= 0;
|
|
3032
|
+
const yIsNegative = offset.y < 0 && baseVector.y >= 0;
|
|
3033
|
+
const zIsNegative = offset.z < 0 && baseVector.z >= 0;
|
|
3034
|
+
this.startInfo.dragPointInCenterBottom = xIsNegative || yIsNegative || zIsNegative;
|
|
3035
|
+
}
|
|
3036
|
+
if (direction === 'ew' && typeof this.startInfo.dragPointInCenterLeft !== 'boolean') {
|
|
3037
|
+
const offset = new THREE.Vector3().subVectors(nowPositionProject, planeCenterProject);
|
|
3038
|
+
const xIsNegative = offset.x < 0 && baseVector.x >= 0;
|
|
3039
|
+
const yIsNegative = offset.y < 0 && baseVector.y >= 0;
|
|
3040
|
+
const zIsNegative = offset.z < 0 && baseVector.z >= 0;
|
|
3041
|
+
this.startInfo.dragPointInCenterLeft = xIsNegative || yIsNegative || zIsNegative;
|
|
3042
|
+
}
|
|
3043
|
+
const offset = new THREE.Vector3().subVectors(nowPositionProject, startPositionProject);
|
|
3044
|
+
// TODO
|
|
3045
|
+
if (offset.length() > 0.1)
|
|
3046
|
+
return defaultVector;
|
|
3047
|
+
return offset;
|
|
3048
|
+
};
|
|
3049
|
+
const ewOffset = getOffset('ew');
|
|
3050
|
+
const nsOffset = getOffset('ns');
|
|
3051
|
+
const setEWScale = () => {
|
|
3052
|
+
const offset = ewOffset;
|
|
3053
|
+
this.helperObject3D.cornerPositions.forEach((position, index) => {
|
|
3054
|
+
var _a;
|
|
3055
|
+
if ((_a = this.startInfo) === null || _a === void 0 ? void 0 : _a.dragPointInCenterLeft) {
|
|
3056
|
+
if (index === 0 || index === 3)
|
|
3057
|
+
position.add(offset); // 拖左边,只改左边点
|
|
3022
3058
|
}
|
|
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;
|
|
3059
|
+
else {
|
|
3060
|
+
if (index === 1 || index === 2)
|
|
3061
|
+
position.add(offset); // 拖右边,只改右边点
|
|
3029
3062
|
}
|
|
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;
|
|
3063
|
+
});
|
|
3040
3064
|
};
|
|
3041
|
-
const
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3065
|
+
const setNSScale = () => {
|
|
3066
|
+
const offset = nsOffset;
|
|
3067
|
+
this.helperObject3D.cornerPositions.forEach((position, index) => {
|
|
3068
|
+
var _a;
|
|
3069
|
+
if ((_a = this.startInfo) === null || _a === void 0 ? void 0 : _a.dragPointInCenterBottom) {
|
|
3070
|
+
if (index === 0 || index === 1)
|
|
3071
|
+
position.add(offset); // 拖下边,只改下边点
|
|
3072
|
+
}
|
|
3073
|
+
else {
|
|
3074
|
+
if (index === 2 || index === 3)
|
|
3075
|
+
position.add(offset); // 拖上边,只改上边点
|
|
3076
|
+
}
|
|
3077
|
+
});
|
|
3078
|
+
};
|
|
3079
|
+
switch (direction) {
|
|
3080
|
+
case 'ew':
|
|
3081
|
+
setEWScale();
|
|
3082
|
+
break;
|
|
3083
|
+
case 'ns':
|
|
3084
|
+
setNSScale();
|
|
3085
|
+
break;
|
|
3086
|
+
case 'nesw':
|
|
3087
|
+
case 'nwse':
|
|
3088
|
+
setEWScale();
|
|
3089
|
+
setNSScale();
|
|
3090
|
+
}
|
|
3091
|
+
(_b = (_a = this.helperObject3D).updatePoints) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
3092
|
+
// this.helperObject3D.cornerPositions.forEach((position, index) => {
|
|
3093
|
+
// this.scene.add(getPoint(position, index))
|
|
3094
|
+
// })
|
|
3095
|
+
const scaleX = new THREE.Vector3().subVectors(cornerPositions[1], cornerPositions[0]).length() / ewVector.length();
|
|
3096
|
+
const scaleY = new THREE.Vector3().subVectors(cornerPositions[3], cornerPositions[0]).length() / nsVector.length();
|
|
3097
|
+
const scaleXY = new THREE.Vector3(scaleX, scaleY, 1);
|
|
3098
|
+
console.log(scaleXY);
|
|
3099
|
+
const scaleMatrix = new THREE__namespace.Matrix4().scale(scaleXY);
|
|
3056
3100
|
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
3101
|
object.scale.copy(newScale); // 或者 object.scale.applyMatrix4(scaleMatrix)
|
|
3070
|
-
startPoint.position.copy(planeIntersection);
|
|
3071
3102
|
this.hooks.emit('scaleUpdate', { matrix4: scaleMatrix, helperOrigin: planeCenter });
|
|
3103
|
+
startPoint.position.copy(planeIntersection);
|
|
3104
|
+
// =================================================================================================================================================================
|
|
3105
|
+
// =================================================================================================================================================================
|
|
3072
3106
|
// 移动位置
|
|
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
|
-
}
|
|
3107
|
+
const centerPosition = new THREE.Vector3().addVectors(cornerPositions[0], cornerPositions[2]).divideScalar(2);
|
|
3108
|
+
const offset = new THREE.Vector3().subVectors(centerPosition, planeCenter);
|
|
3109
|
+
const transform = new THREE__namespace.Matrix4().setPosition(offset);
|
|
3110
|
+
object.applyMatrix4(transform);
|
|
3111
|
+
// this.hooks.emit('scaleUpdate', { matrix4: scaleMatrix, helperOrigin: planeCenter })
|
|
3112
|
+
this.hooks.emit('positionUpdate', { matrix4: transform });
|
|
3113
|
+
// 移动位置end
|
|
3098
3114
|
this.needsRender();
|
|
3099
3115
|
}
|
|
3100
3116
|
dragEnd() {
|
|
@@ -3173,6 +3189,7 @@ class Object3DHelperController extends Controller {
|
|
|
3173
3189
|
});
|
|
3174
3190
|
this.five = five;
|
|
3175
3191
|
Object.assign(window, { [`__${PLUGIN_NAME.toUpperCase()}_DEBUG__`]: this });
|
|
3192
|
+
// Object.assign(window, { THREE: THREE })
|
|
3176
3193
|
}
|
|
3177
3194
|
/**
|
|
3178
3195
|
* @description Show guide line
|
|
@@ -3238,6 +3255,8 @@ class Object3DHelperController extends Controller {
|
|
|
3238
3255
|
*/
|
|
3239
3256
|
addObject3DHelper(object3D, config = {}) {
|
|
3240
3257
|
var _a;
|
|
3258
|
+
if (!object3D)
|
|
3259
|
+
return console.error('Object3D is undefined');
|
|
3241
3260
|
if (this.objectHelperMap.has(object3D)) {
|
|
3242
3261
|
console.warn(`Object3DHelperPlugin: object3D ${object3D.name} already has helper`);
|
|
3243
3262
|
return;
|
|
@@ -3285,7 +3304,6 @@ class Object3DHelperController extends Controller {
|
|
|
3285
3304
|
helper.dispose();
|
|
3286
3305
|
}
|
|
3287
3306
|
handleEnable(enabled, userAction = true) {
|
|
3288
|
-
console.log({ enabled });
|
|
3289
3307
|
if (enabled) {
|
|
3290
3308
|
this.everyHelperDo((helper) => helper.enable());
|
|
3291
3309
|
this.hooks.emit('enable', { userAction });
|
|
@@ -3297,7 +3315,6 @@ class Object3DHelperController extends Controller {
|
|
|
3297
3315
|
this.state.enabled = enabled;
|
|
3298
3316
|
}
|
|
3299
3317
|
handleVisible(visible, userAction = true) {
|
|
3300
|
-
console.log({ visible });
|
|
3301
3318
|
if (visible) {
|
|
3302
3319
|
this.everyHelperDo((helper) => helper.show());
|
|
3303
3320
|
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]);
|
|
@@ -678,8 +679,10 @@ class CSS3DRender {
|
|
|
678
679
|
configurable: true,
|
|
679
680
|
writable: true,
|
|
680
681
|
value: (element, resizeHandler, fireImmediately = true) => {
|
|
681
|
-
if (!element
|
|
682
|
+
if (!element) {
|
|
683
|
+
console.error('createResizeObserver: element is undefined');
|
|
682
684
|
return { observe: () => { }, unobserve: () => { } };
|
|
685
|
+
}
|
|
683
686
|
const resizeObserverHandler = () => {
|
|
684
687
|
/**
|
|
685
688
|
* 这里evenNumber策略是遇到奇数会加1,在某些浏览器中会触发滚动条显示,导致fiveElement变小,fiveElement变小又触发了这里的resize,宽高变小,滚动条消失,然后又触发resize。。。无限循环
|
|
@@ -689,6 +692,10 @@ class CSS3DRender {
|
|
|
689
692
|
const height = evenNumber(element.clientHeight, { smaller: true });
|
|
690
693
|
resizeHandler(width, height);
|
|
691
694
|
};
|
|
695
|
+
if (typeof ResizeObserver === 'undefined' || !ResizeObserver) {
|
|
696
|
+
console.warn('createResizeObserver: ResizeObserver is undefined');
|
|
697
|
+
return { observe: () => resizeObserverHandler(), unobserve: () => { } };
|
|
698
|
+
}
|
|
692
699
|
const observer = new ResizeObserver(resizeObserverHandler);
|
|
693
700
|
if (fireImmediately)
|
|
694
701
|
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;
|
package/dist/PanoRulerPlugin/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>> {
|