@realsee/dnalogel 2.8.2 → 2.8.4
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/components/index.js +74 -74
- package/dist/Object3DHelperPlugin/Controller.d.ts +1 -0
- package/dist/index.cjs.js +29 -29
- package/dist/index.js +2566 -2595
- package/dist/index.umd.js +26 -26
- package/dist/shared-utils/Object3DHelper/Base/BaseHelper.d.ts +11 -25
- package/dist/shared-utils/Object3DHelper/Controller/RotateController.d.ts +4 -3
- package/dist/shared-utils/Object3DHelper/Helper/RotateHelper.d.ts +25 -16
- package/dist/shared-utils/Object3DHelper/typings/Hooks.d.ts +1 -1
- package/dist/shared-utils/Object3DHelper/utils/setObjectQuaternion.d.ts +8 -0
- package/dist/shared-utils/math/deg2Rad.d.ts +1 -0
- package/docs/classes/CSS3DRender.html +31 -31
- package/docs/classes/CruisePluginController.html +24 -24
- package/docs/classes/Magnifier.html +20 -20
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +27 -27
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoMeasurePluginLine.html +23 -23
- package/docs/classes/PanoMeasurePluginModel.html +22 -22
- package/docs/classes/PanoMeasurePluginPoint.html +14 -14
- package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
- package/docs/classes/PanoTagPluginController.html +47 -47
- package/docs/classes/Util.BetterTween.html +8 -8
- package/docs/classes/Util.FivePointSelector.html +12 -12
- package/docs/classes/Util.Interval.html +12 -12
- package/docs/classes/Util.Magnifier.html +17 -17
- package/docs/classes/Util.PointDomHelper.html +11 -11
- package/docs/classes/Util.PointHelper.html +11 -11
- package/docs/classes/Util.Rectangle.html +13 -13
- package/docs/enums/CameraMovementEffect.html +7 -7
- package/docs/enums/ContentType.html +18 -18
- package/docs/enums/DIRECTION.html +9 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/DimensionType.html +7 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/PointType.html +7 -7
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +5 -5
- package/docs/functions/CameraMovementPlugin.html +5 -5
- package/docs/functions/CruisePlugin.html +5 -5
- package/docs/functions/GuideLinePlugin.html +5 -5
- package/docs/functions/ItemLabelPlugin.html +5 -5
- package/docs/functions/MapviewFloorplanPlugin.html +5 -5
- package/docs/functions/ModelChassisCompassPlugin.html +5 -5
- package/docs/functions/ModelEntryDoorGuidePlugin.html +5 -5
- package/docs/functions/ModelFloorplanPlugin.html +5 -5
- package/docs/functions/ModelItemLabelPlugin.html +5 -5
- package/docs/functions/ModelRoomLabelPlugin.html +5 -5
- package/docs/functions/ModelTVVideoPlugin.html +5 -5
- package/docs/functions/ModelViewPlugin.html +5 -5
- package/docs/functions/Object3DHelperPlugin.html +5 -5
- package/docs/functions/PanoCompassPlugin.html +5 -5
- package/docs/functions/PanoCursorRaycasterPlugin.html +5 -5
- package/docs/functions/PanoDoorLabelPlugin.html +5 -5
- package/docs/functions/PanoFloorplanRadarPlugin.html +5 -5
- package/docs/functions/PanoMeasurePlugin.html +5 -5
- package/docs/functions/PanoRulerPlugin.html +5 -5
- package/docs/functions/PanoRulerProPlugin.html +5 -5
- package/docs/functions/PanoSpatialTagPlugin.html +5 -5
- package/docs/functions/PanoTagPlugin.html +5 -5
- package/docs/functions/TopviewFloorplanPlugin.html +5 -5
- package/docs/functions/Util.getCoordsFromClient.html +5 -5
- package/docs/functions/Util.getCoordsFromElement.html +5 -5
- package/docs/functions/Util.getFrameTime.html +5 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
- package/docs/functions/Util.isNil.html +5 -5
- package/docs/functions/Util.nextFrame.html +5 -5
- package/docs/functions/Util.notNil.html +5 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
- package/docs/functions/Util.tweenProgress.html +5 -5
- package/docs/functions/pluginFlag.html +5 -5
- package/docs/index.html +4 -4
- package/docs/interfaces/AddTagConfig.html +6 -6
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/EventMap.html +15 -15
- package/docs/interfaces/FloorplanBounding.html +8 -8
- package/docs/interfaces/FloorplanData.html +10 -10
- package/docs/interfaces/FloorplanEntrance.html +11 -11
- package/docs/interfaces/FloorplanExtraObject.html +10 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
- package/docs/interfaces/FloorplanFloorData.html +9 -9
- package/docs/interfaces/FloorplanImagePosition.html +7 -7
- package/docs/interfaces/FloorplanObserver.html +9 -9
- package/docs/interfaces/FloorplanOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanPosition.html +7 -7
- package/docs/interfaces/FloorplanRoomItem.html +13 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
- package/docs/interfaces/FloorplanServerBounding.html +8 -8
- package/docs/interfaces/FloorplanServerComputedData.html +10 -10
- package/docs/interfaces/FloorplanServerData.html +7 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
- package/docs/interfaces/FloorplanServerEntrance.html +11 -11
- package/docs/interfaces/FloorplanServerFloorData.html +9 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
- package/docs/interfaces/FloorplanServerObserver.html +9 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanServerPosition.html +7 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
- package/docs/interfaces/HelperOffset.html +8 -8
- package/docs/interfaces/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/MinMax.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
- package/docs/interfaces/ModelViewPluginExportType.html +11 -11
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/ObjectHelperControllers.html +9 -9
- package/docs/interfaces/PaintBrushAction.html +12 -12
- package/docs/interfaces/PaintBrushConfigs.html +12 -12
- package/docs/interfaces/PaintBrushState.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
- package/docs/interfaces/PanoMeasureParameterType.html +12 -12
- package/docs/interfaces/PanoMeasurePluginLineJson.html +8 -8
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPointJson.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +8 -8
- package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
- package/docs/interfaces/PanoRulerProPluginState.html +8 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
- package/docs/interfaces/Point.html +8 -8
- package/docs/interfaces/Room.html +9 -9
- package/docs/interfaces/RoomInfo.html +7 -7
- package/docs/interfaces/RoomLabel.html +14 -14
- package/docs/interfaces/RoomRules.html +5 -5
- package/docs/interfaces/Rooms.html +5 -5
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/State.html +8 -8
- package/docs/interfaces/TagCache.html +12 -12
- package/docs/interfaces/TagConfig.html +10 -10
- package/docs/interfaces/TagIconUrl.html +9 -9
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/TemporaryState.html +6 -6
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +4 -4
- package/docs/types/ArrayPosition.html +5 -5
- package/docs/types/AudioAppearance.html +5 -5
- package/docs/types/AudioTagTypeConfigKey.html +5 -5
- package/docs/types/CSS3DRenderExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
- package/docs/types/ClassFunctionParameters.html +5 -5
- package/docs/types/Color.html +5 -5
- package/docs/types/ContentTypeConfigKey.html +5 -5
- package/docs/types/ContentTypeConfigKeySplit.html +5 -5
- package/docs/types/ContentTypeMap.html +5 -5
- package/docs/types/Create3DDomContainerReturnType.html +5 -5
- package/docs/types/Create3DElementReturnType.html +5 -5
- package/docs/types/CruisePluginExportType.html +5 -5
- package/docs/types/Direction-1.html +5 -5
- package/docs/types/Direction4.html +5 -5
- package/docs/types/FloorplanRuleLabels.html +5 -5
- package/docs/types/FloorplanServerRuleLabels.html +5 -5
- package/docs/types/GuideLinePluginExportType.html +5 -5
- package/docs/types/HelperEventMap.html +9 -9
- package/docs/types/LoadTagConfig.html +5 -5
- package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/MediaData.html +5 -5
- package/docs/types/MediaStore.html +5 -5
- package/docs/types/ModelElement.html +5 -5
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
- package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
- package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
- package/docs/types/MoveArgs.html +5 -5
- package/docs/types/MoveOpts.html +5 -5
- package/docs/types/Object3DHelperEventMap.html +5 -5
- package/docs/types/ObjectFit.html +5 -5
- package/docs/types/PaintBrushEventMap.html +5 -5
- package/docs/types/PanoCompassPluginData.html +5 -5
- package/docs/types/PanoCompassPluginExportType.html +5 -5
- package/docs/types/PanoCompassPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
- package/docs/types/PanoIndex.html +5 -5
- package/docs/types/PanoMeasurePluginEvent.html +5 -5
- package/docs/types/PanoMeasureReturnType.html +5 -5
- package/docs/types/PanoSpatialTagPluginId.html +5 -5
- package/docs/types/PanoTagPluginExportInterface.html +5 -5
- package/docs/types/PanoTagPluginParamsInterface.html +5 -5
- package/docs/types/PlaneTag.html +5 -5
- package/docs/types/PlaneTagElement.html +5 -5
- package/docs/types/Point2DElement.html +5 -5
- package/docs/types/Point2DTag.html +5 -5
- package/docs/types/Point3DElement.html +5 -5
- package/docs/types/Point3DTag.html +5 -5
- package/docs/types/PointTag.html +5 -5
- package/docs/types/PointTagElement.html +5 -5
- package/docs/types/Position.html +5 -5
- package/docs/types/RotateArgs.html +5 -5
- package/docs/types/RotateOpts.html +5 -5
- package/docs/types/RuleLabelsKey.html +5 -5
- package/docs/types/RuleLabelsValue.html +5 -5
- package/docs/types/StickType.html +5 -5
- package/docs/types/Tag.html +5 -5
- package/docs/types/Tag2D.html +5 -5
- package/docs/types/Tag3D.html +5 -5
- package/docs/types/TagContentType.html +5 -5
- package/docs/types/TagDimensionType.html +5 -5
- package/docs/types/TagElement.html +5 -5
- package/docs/types/TagEvents.html +5 -5
- package/docs/types/TagGLTFObject.html +5 -5
- package/docs/types/TagHooks.html +5 -5
- package/docs/types/TagIconSize.html +5 -5
- package/docs/types/TagId.html +5 -5
- package/docs/types/TagPointType.html +5 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/WorkCode.html +5 -5
- package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
- package/docs/variables/PLUGIN.html +5 -5
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
- package/docs/variables/ROOM_TYPE_MAP.html +5 -5
- package/docs/variables/VERSION.html +5 -5
- package/docs/variables/itemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
- package/libs/Object3DHelperPlugin/Controller.d.ts +1 -0
- package/libs/Object3DHelperPlugin/Controller.js +5 -2
- package/libs/Object3DHelperPlugin/index.js +10 -7
- package/libs/PanoTagPlugin/mocks/v1/mock-80P6A03eQRQKY3oqLj.d.ts +4 -0
- package/libs/PanoTagPlugin/mocks/v1/mock-80P6A03eQRQKY3oqLj.js +6 -0
- package/libs/PanoTagPlugin/mocks/v1/mock-80QG2vMPboNv5DWrom.d.ts +93 -0
- package/libs/PanoTagPlugin/mocks/v1/mock-80QG2vMPboNv5DWrom.js +5622 -0
- package/libs/PanoTagPlugin/mocks/v1/mock-test3-realsee-cn-4zr0A5.js +1325 -0
- package/libs/PanoTagPlugin/mocks/v1/mock1.d.ts +173 -0
- package/libs/PanoTagPlugin/mocks/v1/mock1.js +122 -0
- package/libs/PanoTagPlugin/mocks/v1/mock2.d.ts +233 -0
- package/libs/PanoTagPlugin/mocks/v1/mock2.js +296 -0
- package/libs/PanoTagPlugin/mocks/v1/mock3.d.ts +22 -0
- package/libs/PanoTagPlugin/mocks/v1/mock3.js +32 -0
- package/libs/PanoTagPlugin/mocks/v1/mock4.d.ts +56 -0
- package/libs/PanoTagPlugin/mocks/v1/mock4.js +60 -0
- package/libs/PanoTagPlugin/mocks/v1/mock5.d.ts +13 -0
- package/libs/PanoTagPlugin/mocks/v1/mock5.js +17 -0
- package/libs/PanoTagPlugin/mocks/v1/mock6.d.ts +16 -0
- package/libs/PanoTagPlugin/mocks/v1/mock6.js +27 -0
- package/libs/PanoTagPlugin/mocks/v1/mock7.d.ts +22 -0
- package/libs/PanoTagPlugin/mocks/v1/mock7.js +228 -0
- package/libs/components/PaintBrush/Controller.js +98 -98
- package/libs/index.js +102 -100
- package/libs/shared-utils/Object3DHelper/Base/BaseController.js +15 -15
- package/libs/shared-utils/Object3DHelper/Base/BaseHelper.d.ts +11 -25
- package/libs/shared-utils/Object3DHelper/Base/BaseHelper.js +19 -22
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.d.ts +4 -3
- package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +102 -112
- package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.d.ts +25 -16
- package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +66 -88
- package/libs/shared-utils/Object3DHelper/typings/Hooks.d.ts +1 -1
- package/libs/shared-utils/Object3DHelper/utils/setObjectQuaternion.d.ts +8 -0
- package/libs/shared-utils/Object3DHelper/utils/setObjectQuaternion.js +11 -0
- package/libs/shared-utils/math/deg2Rad.d.ts +1 -0
- package/libs/shared-utils/math/deg2Rad.js +6 -0
- package/package.json +1 -1
|
@@ -1,161 +1,151 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { BaseController as
|
|
1
|
+
var D = Object.defineProperty;
|
|
2
|
+
var O = (g, h, n) => h in g ? D(g, h, { enumerable: !0, configurable: !0, writable: !0, value: n }) : g[h] = n;
|
|
3
|
+
var d = (g, h, n) => (O(g, typeof h != "symbol" ? h + "" : h, n), n);
|
|
4
|
+
import { BaseController as v } from "../Base/BaseController.js";
|
|
5
5
|
import * as s from "three";
|
|
6
|
-
import { getMouseRaycaster as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this.
|
|
20
|
-
|
|
6
|
+
import { getMouseRaycaster as E } from "../utils/getMouseRaycaster.js";
|
|
7
|
+
import { setObjectQuaternion as w } from "../utils/setObjectQuaternion.js";
|
|
8
|
+
import { rad2Deg as C } from "../../math/rad2Deg.js";
|
|
9
|
+
import { deg2Rad as f } from "../../math/deg2Rad.js";
|
|
10
|
+
class P extends v {
|
|
11
|
+
constructor(...n) {
|
|
12
|
+
var c, l, p;
|
|
13
|
+
super(...n);
|
|
14
|
+
d(this, "name", "RotateController");
|
|
15
|
+
d(this, "startInfo");
|
|
16
|
+
d(this, "removeListener");
|
|
17
|
+
const e = this.helperObject3D;
|
|
18
|
+
this.hoverListener([(c = e.xCircle) == null ? void 0 : c.circle, (l = e.yCircle) == null ? void 0 : l.circle, (p = e.zCircle) == null ? void 0 : p.circle].filter(Boolean));
|
|
19
|
+
const t = this.dragStart.bind(this), i = this.dragging.bind(this), o = this.dragEnd.bind(this), r = this.show.bind(this), a = this.hide.bind(this);
|
|
20
|
+
this.domEvents.addEventListener(this.helperObject3D, "mousedown", t), document.addEventListener("mousemove", i), document.addEventListener("mouseup", o), this.hooks.on("moveStart", a), this.hooks.on("moveEnd", r), this.hooks.on("moveByMouseEnable", a), this.hooks.on("moveByMouseDisable", r), this.removeListener = () => {
|
|
21
|
+
this.domEvents.removeEventListener(this.helperObject3D, "mousedown", t), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this.hooks.off("moveStart", a), this.hooks.off("moveEnd", r), this.hooks.off("moveByMouseEnable", a), this.hooks.off("moveByMouseDisable", r);
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
get rotateCenter() {
|
|
24
25
|
return this.helperObject3D.position.clone();
|
|
25
26
|
}
|
|
26
27
|
initialHelperQuaternion() {
|
|
27
|
-
this.helperObject3D.
|
|
28
|
+
this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion);
|
|
28
29
|
}
|
|
29
|
-
setRotateAngle(
|
|
30
|
-
const { x:
|
|
31
|
-
if (this.hooks.emit("wantToRotate",
|
|
30
|
+
setRotateAngle(n) {
|
|
31
|
+
const { x: e = 0, y: t = 0, z: i = 0 } = n, o = new s.Euler(f(e), f(t), f(i)), r = new s.Quaternion().setFromEuler(o);
|
|
32
|
+
if (this.hooks.emit("wantToRotate", r))
|
|
32
33
|
return;
|
|
33
|
-
const { originObject3D:
|
|
34
|
-
|
|
35
|
-
const h = new s.Vector3().subVectors(a.position, p).applyQuaternion(o).add(p);
|
|
36
|
-
a.position.copy(h);
|
|
37
|
-
}
|
|
38
|
-
a.quaternion.copy(o), this.helperObject3DQuaternion.copy(o), this.hooks.emit("setObjectRotate", o, p), this.hooks.emit("rotate", o), this.render();
|
|
34
|
+
const { originObject3D: c, rotateCenter: l } = this;
|
|
35
|
+
w(c, r, l), this.hooks.emit("setObjectRotate", r, l), this.hooks.emit("rotate", r), this.render();
|
|
39
36
|
}
|
|
40
37
|
dispose() {
|
|
41
38
|
this.removeListener(), super.dispose();
|
|
42
39
|
}
|
|
43
|
-
|
|
40
|
+
onApplyOriginObjectRotate(n) {
|
|
41
|
+
this.isDragging || super.onApplyOriginObjectRotate(n);
|
|
42
|
+
}
|
|
43
|
+
onApplyOriginObjectScale(n) {
|
|
44
44
|
}
|
|
45
|
-
dragStart(
|
|
45
|
+
dragStart(n) {
|
|
46
46
|
if (this.isDragging)
|
|
47
47
|
return;
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
48
|
+
const e = n == null ? void 0 : n.intersect;
|
|
49
|
+
if (!e)
|
|
50
50
|
return this.dragEnd();
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
51
|
+
const t = (e == null ? void 0 : e.object).direction;
|
|
52
|
+
if (!t)
|
|
53
53
|
return this.dragEnd();
|
|
54
|
-
this.
|
|
55
|
-
const r = t.point, i = this.getAngleHelper(n);
|
|
54
|
+
const i = e.point, o = this.getAngleHelper(t);
|
|
56
55
|
this.setTipsAngle(0);
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const l = u.clone().sub(this.rotateCenter), D = l.clone(), w = l.angleTo(i.baseAxes);
|
|
71
|
-
this.setAngleHelperStart(n, w), this.setAngleHelperLength(n, 0), this.rotations.push({ vector: l.clone(), direction: !0 }), this.startInfo = { direction: n, startVector: l, staticStartVector: D, plane: b, angleHelper: i }, this.helperObject3D.showDraggingHelper([n]), this.hooks.emit("rotateStart"), this.isDragging = !0;
|
|
72
|
-
}
|
|
73
|
-
dragging(e) {
|
|
56
|
+
const r = i.clone();
|
|
57
|
+
r.y += 0.2, this.setTipsPosition(r);
|
|
58
|
+
const a = (() => {
|
|
59
|
+
if (t === "x")
|
|
60
|
+
return new s.Vector3(1, 0, 0).applyQuaternion(this.originObject3D.quaternion);
|
|
61
|
+
if (t === "y")
|
|
62
|
+
return new s.Vector3(0, 1, 0).applyQuaternion(this.originObject3D.quaternion);
|
|
63
|
+
if (t === "z")
|
|
64
|
+
return new s.Vector3(0, 0, 1).applyQuaternion(this.originObject3D.quaternion);
|
|
65
|
+
})(), c = new s.Plane().setFromNormalAndCoplanarPoint(a, i), p = c.projectPoint(i.clone(), new s.Vector3()).clone().sub(this.rotateCenter), u = p.angleTo(o.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));
|
|
66
|
+
this.setAngleHelperStart(t, u), this.setAngleHelperLength(t, 0), this.startInfo = { direction: t, startVector: p, plane: c, angleHelper: o, angle: 0, objectQuaternion: this.originObject3D.quaternion.clone() }, this.helperObject3D.showDraggingHelper([t]), this.hooks.emit("rotateStart"), this.isDragging = !0;
|
|
67
|
+
}
|
|
68
|
+
dragging(n) {
|
|
74
69
|
if (!this.isDragging)
|
|
75
70
|
return;
|
|
76
|
-
const
|
|
77
|
-
return
|
|
71
|
+
const e = E(this.camera, n, this.container);
|
|
72
|
+
return e ? (this.rotate(e), !1) : this.dragEnd();
|
|
78
73
|
}
|
|
79
|
-
rotate(
|
|
74
|
+
rotate(n) {
|
|
80
75
|
if (!this.startInfo)
|
|
81
76
|
return this.dragEnd();
|
|
82
|
-
const { startVector:
|
|
77
|
+
const { startVector: e, plane: t, angleHelper: i, direction: o, objectQuaternion: r } = this.startInfo, { originObject3D: a } = this, c = n.ray.intersectPlane(t, new s.Vector3());
|
|
83
78
|
if (!c)
|
|
84
79
|
return;
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
const h = p.clone().sub(a);
|
|
88
|
-
if (t.angleTo(h) === 0 || (this.lastRotation === void 0 && (this.lastRotation = { angle: 0 }), this.rotations.length === 0))
|
|
80
|
+
const l = this.rotateCenter.clone(), u = t.projectPoint(c.clone(), new s.Vector3()).clone().sub(l);
|
|
81
|
+
if (e.angleTo(u) === 0)
|
|
89
82
|
return;
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (b === void 0)
|
|
104
|
-
return console.warn("rotationDirection is undefined");
|
|
105
|
-
const u = new s.Quaternion().setFromUnitVectors(t.clone().normalize(), h.clone().normalize()), { originObject3D: l } = this, D = l.quaternion.clone().premultiply(u);
|
|
106
|
-
if (!this.hooks.emit("wantToRotate", D)) {
|
|
107
|
-
if (this.rotations.push({ vector: h, direction: b }), this.rotations = this.rotations.slice(-2), this.lastRotation.angle = this.lastRotation.angle + h.angleTo(t) * (b ? 1 : -1), this.setAngleHelperLength(o, this.lastRotation.angle), this.setTipsAngle(this.lastRotation.angle / Math.PI * 180), a) {
|
|
108
|
-
const d = new s.Vector3().subVectors(l.position, a).applyQuaternion(u).add(a);
|
|
109
|
-
l.position.copy(d);
|
|
110
|
-
}
|
|
111
|
-
l.applyQuaternion(u), this.helperObject3DQuaternion.premultiply(u), this.hooks.emit("applyObjectRotate", { quaternion: u, origin: a }), this.hooks.emit("rotate", l.quaternion), this.startInfo.startVector = h;
|
|
83
|
+
const m = new s.Quaternion().setFromUnitVectors(e.clone().normalize(), u.clone().normalize()), b = a.quaternion.clone().premultiply(m);
|
|
84
|
+
if (this.hooks.emit("wantToRotate", b))
|
|
85
|
+
return;
|
|
86
|
+
const y = new s.Euler().setFromQuaternion(
|
|
87
|
+
new s.Quaternion().setFromUnitVectors(
|
|
88
|
+
e.clone().normalize().applyQuaternion(r.clone().inverse()),
|
|
89
|
+
u.clone().normalize().applyQuaternion(r.clone().inverse())
|
|
90
|
+
),
|
|
91
|
+
`${o.toUpperCase()}${"XZY".replace(o.toUpperCase(), "")}`
|
|
92
|
+
)[o] * i.angleDirection;
|
|
93
|
+
if (this.startInfo.angle += y, this.setAngleHelperLength(o, this.startInfo.angle), this.setTipsAngle(C(this.startInfo.angle)), l) {
|
|
94
|
+
const j = new s.Vector3().subVectors(a.position, l).applyQuaternion(m).add(l);
|
|
95
|
+
a.position.copy(j);
|
|
112
96
|
}
|
|
97
|
+
a.applyQuaternion(m), this.hooks.emit("applyObjectRotate", { quaternion: m, origin: l }), this.hooks.emit("rotate", a.quaternion), this.startInfo.startVector = u;
|
|
113
98
|
}
|
|
114
99
|
dragEnd() {
|
|
115
|
-
!this.isDragging || (this.
|
|
100
|
+
!this.isDragging || (this.hooks.emit("setObjectRotate", this.originObject3D.quaternion, this.rotateCenter), this.startInfo = void 0, this.isDragging = !1, this.helperObject3D.show(), this.hooks.emit("rotateEnd"));
|
|
116
101
|
}
|
|
117
|
-
getAngleHelper(
|
|
118
|
-
|
|
102
|
+
getAngleHelper(n) {
|
|
103
|
+
var e, t, i;
|
|
104
|
+
switch (n) {
|
|
119
105
|
case "x":
|
|
120
|
-
return this.helperObject3D.
|
|
106
|
+
return (e = this.helperObject3D.xCircle) == null ? void 0 : e.angleSector;
|
|
121
107
|
case "y":
|
|
122
|
-
return this.helperObject3D.
|
|
108
|
+
return (t = this.helperObject3D.yCircle) == null ? void 0 : t.angleSector;
|
|
123
109
|
case "z":
|
|
124
|
-
return this.helperObject3D.
|
|
110
|
+
return (i = this.helperObject3D.zCircle) == null ? void 0 : i.angleSector;
|
|
125
111
|
}
|
|
126
112
|
}
|
|
127
|
-
setAngleHelperStart(
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
113
|
+
setAngleHelperStart(n, e) {
|
|
114
|
+
const t = this.getAngleHelper(n);
|
|
115
|
+
if (!t) {
|
|
116
|
+
console.warn("angleHelper is undefined");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (t instanceof s.Mesh && t.geometry instanceof s.CircleGeometry) {
|
|
120
|
+
const { radius: i, segments: o, thetaLength: r } = t.geometry.parameters;
|
|
121
|
+
t.geometry = new s.CircleGeometry(i, o, e, r);
|
|
132
122
|
} else
|
|
133
123
|
console.warn("only support THREE.CircleGeometry");
|
|
134
124
|
}
|
|
135
|
-
setAngleHelperLength(
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
const { radius:
|
|
139
|
-
|
|
125
|
+
setAngleHelperLength(n, e) {
|
|
126
|
+
const i = e >= 0 ? Math.max(e, 1e-3) : Math.min(e, -1e-3), o = this.getAngleHelper(n);
|
|
127
|
+
if (o instanceof s.Mesh && o.geometry instanceof s.CircleGeometry) {
|
|
128
|
+
const { radius: r, thetaStart: a } = o.geometry.parameters, c = Math.ceil(Math.abs(i) * (40 / (2 * Math.PI)));
|
|
129
|
+
o.geometry = new s.CircleGeometry(r, c, a, i);
|
|
140
130
|
} else
|
|
141
131
|
console.warn("only support THREE.CircleGeometry");
|
|
142
132
|
}
|
|
143
|
-
setTipsAngle(
|
|
144
|
-
var
|
|
145
|
-
const
|
|
146
|
-
!
|
|
133
|
+
setTipsAngle(n) {
|
|
134
|
+
var t;
|
|
135
|
+
const e = (t = this.helperObject3D.angleTips) == null ? void 0 : t.element;
|
|
136
|
+
!e || (e.innerText = `${n.toFixed(0)}\xB0`);
|
|
147
137
|
}
|
|
148
|
-
setTipsPosition(
|
|
149
|
-
const
|
|
150
|
-
if (!
|
|
138
|
+
setTipsPosition(n) {
|
|
139
|
+
const e = this.helperObject3D.angleTips;
|
|
140
|
+
if (!e)
|
|
151
141
|
return;
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
142
|
+
const t = n.project(this.camera), { x: i, y: o, z: r } = t;
|
|
143
|
+
if (r > 1)
|
|
154
144
|
return;
|
|
155
|
-
const
|
|
156
|
-
|
|
145
|
+
const a = (i + 1) / 2 * 100 + "%", c = (-o + 1) / 2 * 100 + "%";
|
|
146
|
+
e.setLeftTop(a, c);
|
|
157
147
|
}
|
|
158
148
|
}
|
|
159
149
|
export {
|
|
160
|
-
|
|
150
|
+
P as RotateController
|
|
161
151
|
};
|
|
@@ -4,15 +4,10 @@ import { RotateHelperAbstract } from '../Base/BaseHelper';
|
|
|
4
4
|
import type { Color, Direction } from '../typings';
|
|
5
5
|
import { tipsDom } from './HTML/tipsDom';
|
|
6
6
|
export declare class RotateHelper extends RotateHelperAbstract {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
yRingHelper?: AxesDashedRing;
|
|
12
|
-
zRingHelper?: AxesDashedRing;
|
|
13
|
-
xAngleHelper?: Sector;
|
|
14
|
-
yAngleHelper?: Sector;
|
|
15
|
-
zAngleHelper?: Sector;
|
|
7
|
+
xCircle?: RotateCircleGroup;
|
|
8
|
+
yCircle?: RotateCircleGroup;
|
|
9
|
+
zCircle?: RotateCircleGroup;
|
|
10
|
+
children: RotateCircleGroup[];
|
|
16
11
|
angleTips?: ReturnType<typeof tipsDom>;
|
|
17
12
|
private container?;
|
|
18
13
|
constructor(originObject3D: Object3D, config?: {
|
|
@@ -20,15 +15,28 @@ export declare class RotateHelper extends RotateHelperAbstract {
|
|
|
20
15
|
yzCircleEnable?: boolean;
|
|
21
16
|
xzCircleEnable?: boolean;
|
|
22
17
|
xyCircleEnable?: boolean;
|
|
18
|
+
angleTipsEnable?: boolean;
|
|
23
19
|
});
|
|
24
|
-
updateAngleHelperQuaternion(): void;
|
|
25
|
-
applyHelperQuaternion(quaternion: THREE.Quaternion, origin?: THREE.Vector3): void;
|
|
26
20
|
hide(): void;
|
|
27
21
|
show(): void;
|
|
28
22
|
showDraggingHelper(directions: Direction[]): void;
|
|
29
23
|
dispose(): void;
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
}
|
|
25
|
+
declare class RotateCircleGroup extends THREE.Group {
|
|
26
|
+
direction: Direction;
|
|
27
|
+
/** 1/4 圆 */
|
|
28
|
+
circle: Circle;
|
|
29
|
+
/** 旋转过程中展示的背景圆环 */
|
|
30
|
+
ring: DashedRing;
|
|
31
|
+
/** 旋转过程中表示角度的扇形 */
|
|
32
|
+
angleSector: AngleSector;
|
|
33
|
+
constructor(options: {
|
|
34
|
+
direction: Direction;
|
|
35
|
+
color?: Color;
|
|
36
|
+
});
|
|
37
|
+
showCircle(): void;
|
|
38
|
+
showRing(): void;
|
|
39
|
+
hide(): void;
|
|
32
40
|
}
|
|
33
41
|
declare class Circle extends THREE.Mesh {
|
|
34
42
|
direction: Direction;
|
|
@@ -40,16 +48,17 @@ declare class Circle extends THREE.Mesh {
|
|
|
40
48
|
color?: Color;
|
|
41
49
|
});
|
|
42
50
|
}
|
|
43
|
-
declare class
|
|
51
|
+
declare class DashedRing extends THREE.Group {
|
|
44
52
|
direction: Readonly<Direction>;
|
|
45
53
|
constructor(options: {
|
|
46
54
|
direction: Direction;
|
|
47
55
|
});
|
|
48
56
|
}
|
|
49
|
-
declare class
|
|
57
|
+
declare class AngleSector extends THREE.Mesh {
|
|
50
58
|
direction: Direction;
|
|
51
|
-
material: THREE.MeshBasicMaterial;
|
|
52
59
|
baseAxes: THREE.Vector3;
|
|
60
|
+
angleDirection: 1 | -1;
|
|
61
|
+
material: THREE.MeshBasicMaterial;
|
|
53
62
|
constructor(options: {
|
|
54
63
|
direction: Direction;
|
|
55
64
|
color?: Color;
|
|
@@ -1,120 +1,98 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var w = (a, s, t) => s in a ? m(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
|
|
3
|
+
var i = (a, s, t) => (w(a, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
4
|
import * as r from "three";
|
|
5
|
-
import { RotateHelperAbstract as
|
|
6
|
-
import { AXES_THREE_COLOR as
|
|
7
|
-
import { tipsDom as
|
|
8
|
-
class
|
|
9
|
-
constructor(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
t(this, "xAngleHelper");
|
|
19
|
-
t(this, "yAngleHelper");
|
|
20
|
-
t(this, "zAngleHelper");
|
|
21
|
-
t(this, "angleTips");
|
|
22
|
-
t(this, "container");
|
|
23
|
-
(e == null ? void 0 : e.yzCircleEnable) !== !1 && (this.yzCircle = new d({ direction: "x", color: y.X }), this.xRingHelper = new H({ direction: "x" }), this.xAngleHelper = new x({ direction: "x", color: y.X })), (e == null ? void 0 : e.xzCircleEnable) !== !1 && (this.xzCircle = new d({ direction: "y", color: y.Y }), this.yRingHelper = new H({ direction: "y" }), this.yAngleHelper = new x({ direction: "y", color: y.Y })), (e == null ? void 0 : e.xyCircleEnable) !== !1 && (this.xyCircle = new d({ direction: "z", color: y.Z }), this.zRingHelper = new H({ direction: "z" }), this.zAngleHelper = new x({ direction: "z", color: y.Z })), e != null && e.container && (this.container = e == null ? void 0 : e.container, this.angleTips = w({ display: "none" }), (s = this.container) == null || s.appendChild(this.angleTips.element)), this.show();
|
|
24
|
-
}
|
|
25
|
-
updateAngleHelperQuaternion() {
|
|
26
|
-
var i, e, s, c, h, o, p, a, g, A, u, z;
|
|
27
|
-
(e = this.xAngleHelper) == null || e.quaternion.copy((i = this.yzCircle) == null ? void 0 : i.quaternion), (c = this.yAngleHelper) == null || c.quaternion.copy((s = this.xzCircle) == null ? void 0 : s.quaternion), (o = this.zAngleHelper) == null || o.quaternion.copy((h = this.xyCircle) == null ? void 0 : h.quaternion), (a = this.xRingHelper) == null || a.quaternion.copy((p = this.yzCircle) == null ? void 0 : p.quaternion), (A = this.yRingHelper) == null || A.quaternion.copy((g = this.xzCircle) == null ? void 0 : g.quaternion), (z = this.zRingHelper) == null || z.quaternion.copy((u = this.xyCircle) == null ? void 0 : u.quaternion);
|
|
28
|
-
}
|
|
29
|
-
applyHelperQuaternion(i, e) {
|
|
30
|
-
var s, c, h, o, p, a;
|
|
31
|
-
(s = this.yzCircle) == null || s.applyQuaternion(i), (c = this.xzCircle) == null || c.applyQuaternion(i), (h = this.xyCircle) == null || h.applyQuaternion(i), (o = this.xAngleHelper) == null || o.baseAxes.applyQuaternion(i), (p = this.yAngleHelper) == null || p.baseAxes.applyQuaternion(i), (a = this.zAngleHelper) == null || a.baseAxes.applyQuaternion(i);
|
|
5
|
+
import { RotateHelperAbstract as u } from "../Base/BaseHelper.js";
|
|
6
|
+
import { AXES_THREE_COLOR as l } from "../Constants/color.js";
|
|
7
|
+
import { tipsDom as y } from "./HTML/tipsDom.js";
|
|
8
|
+
class T extends u {
|
|
9
|
+
constructor(t, e) {
|
|
10
|
+
super(t);
|
|
11
|
+
i(this, "xCircle");
|
|
12
|
+
i(this, "yCircle");
|
|
13
|
+
i(this, "zCircle");
|
|
14
|
+
i(this, "children", []);
|
|
15
|
+
i(this, "angleTips");
|
|
16
|
+
i(this, "container");
|
|
17
|
+
(e == null ? void 0 : e.yzCircleEnable) !== !1 && (this.xCircle = new n({ direction: "x", color: l.X })), (e == null ? void 0 : e.xzCircleEnable) !== !1 && (this.yCircle = new n({ direction: "y", color: l.Y })), (e == null ? void 0 : e.xyCircleEnable) !== !1 && (this.zCircle = new n({ direction: "z", color: l.Z })), (e == null ? void 0 : e.container) && (e == null ? void 0 : e.angleTipsEnable) !== !1 && (this.container = e == null ? void 0 : e.container, this.angleTips = y({ display: "none" }), this.container.appendChild(this.angleTips.element)), this.add(...[this.xCircle, this.yCircle, this.zCircle].filter(Boolean)), this.show();
|
|
32
18
|
}
|
|
33
19
|
hide() {
|
|
34
|
-
this.
|
|
35
|
-
this.yzCircle,
|
|
36
|
-
this.xzCircle,
|
|
37
|
-
this.xyCircle,
|
|
38
|
-
this.xRingHelper,
|
|
39
|
-
this.yRingHelper,
|
|
40
|
-
this.zRingHelper,
|
|
41
|
-
this.xAngleHelper,
|
|
42
|
-
this.yAngleHelper,
|
|
43
|
-
this.zAngleHelper
|
|
44
|
-
);
|
|
20
|
+
this.children.forEach((t) => t.hide());
|
|
45
21
|
}
|
|
46
22
|
show() {
|
|
47
|
-
var
|
|
48
|
-
this.
|
|
23
|
+
var t;
|
|
24
|
+
this.children.forEach((e) => e.showCircle()), (t = this.angleTips) == null || t.hide();
|
|
49
25
|
}
|
|
50
|
-
showDraggingHelper(
|
|
26
|
+
showDraggingHelper(t) {
|
|
51
27
|
var e;
|
|
52
|
-
this.hide(), this.
|
|
28
|
+
this.hide(), this.children.filter((h) => t.includes(h.direction)).forEach((h) => h.showRing()), (e = this.angleTips) == null || e.show();
|
|
53
29
|
}
|
|
54
30
|
dispose() {
|
|
55
|
-
var
|
|
56
|
-
this.remove(
|
|
57
|
-
...[
|
|
58
|
-
this.yzCircle,
|
|
59
|
-
this.xzCircle,
|
|
60
|
-
this.xyCircle,
|
|
61
|
-
this.xRingHelper,
|
|
62
|
-
this.yRingHelper,
|
|
63
|
-
this.zRingHelper,
|
|
64
|
-
this.xAngleHelper,
|
|
65
|
-
this.yAngleHelper,
|
|
66
|
-
this.zAngleHelper
|
|
67
|
-
].filter(Boolean)
|
|
68
|
-
), (e = (i = this.angleTips) == null ? void 0 : i.element) == null || e.remove();
|
|
31
|
+
var t, e;
|
|
32
|
+
this.removeFromParent(), (e = (t = this.angleTips) == null ? void 0 : t.element) == null || e.remove();
|
|
69
33
|
}
|
|
70
|
-
|
|
71
|
-
|
|
34
|
+
}
|
|
35
|
+
class n extends r.Group {
|
|
36
|
+
constructor(t) {
|
|
37
|
+
super();
|
|
38
|
+
i(this, "direction");
|
|
39
|
+
i(this, "circle");
|
|
40
|
+
i(this, "ring");
|
|
41
|
+
i(this, "angleSector");
|
|
42
|
+
this.direction = t.direction, this.circle = new C(t), this.ring = new x(t), this.angleSector = new b(t), this.add(this.circle, this.ring, this.angleSector), this.direction === "y" ? this.rotateX(Math.PI / 2) : this.direction === "x" && this.rotateY(-Math.PI / 2);
|
|
72
43
|
}
|
|
73
|
-
|
|
74
|
-
|
|
44
|
+
showCircle() {
|
|
45
|
+
this.add(this.circle), this.remove(this.ring, this.angleSector);
|
|
46
|
+
}
|
|
47
|
+
showRing() {
|
|
48
|
+
this.add(this.ring, this.angleSector), this.remove(this.circle);
|
|
49
|
+
}
|
|
50
|
+
hide() {
|
|
51
|
+
this.remove(this.ring, this.angleSector, this.circle);
|
|
75
52
|
}
|
|
76
53
|
}
|
|
77
|
-
class
|
|
78
|
-
constructor(
|
|
54
|
+
class C extends r.Mesh {
|
|
55
|
+
constructor(t) {
|
|
79
56
|
var e;
|
|
80
57
|
super();
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
58
|
+
i(this, "direction");
|
|
59
|
+
i(this, "gapAngle", 0.02);
|
|
60
|
+
i(this, "geometry", new r.RingGeometry(0.25, 0.3, 20, 8, this.gapAngle, Math.PI / 2 - this.gapAngle * 2));
|
|
84
61
|
this.material = new r.MeshBasicMaterial({
|
|
85
62
|
opacity: 0.6,
|
|
86
|
-
color: (e =
|
|
63
|
+
color: (e = t.color) != null ? e : 16777215,
|
|
87
64
|
transparent: !0,
|
|
88
65
|
side: r.DoubleSide,
|
|
89
66
|
depthTest: !1
|
|
90
|
-
}), this.direction =
|
|
67
|
+
}), this.direction = t.direction, this.geometry.name = `RotateHelperCircleGeometry-${this.direction}`;
|
|
91
68
|
}
|
|
92
69
|
}
|
|
93
|
-
class
|
|
94
|
-
constructor(
|
|
70
|
+
class x extends r.Group {
|
|
71
|
+
constructor(t) {
|
|
95
72
|
super();
|
|
96
|
-
|
|
97
|
-
this.direction =
|
|
98
|
-
const e = 0.015,
|
|
99
|
-
const
|
|
73
|
+
i(this, "direction");
|
|
74
|
+
this.direction = t.direction;
|
|
75
|
+
const e = 0.015, h = new Array(8).fill(null).map((g, c) => {
|
|
76
|
+
const d = new r.RingGeometry(0.25, 0.3, 20, 8, Math.PI / 4 * c + e, Math.PI / 4 - e * 2), p = new r.MeshBasicMaterial({
|
|
100
77
|
opacity: 1,
|
|
101
78
|
color: 16777215,
|
|
102
79
|
depthTest: !1,
|
|
103
80
|
transparent: !0,
|
|
104
81
|
side: r.DoubleSide
|
|
105
|
-
}),
|
|
106
|
-
return
|
|
82
|
+
}), o = new r.Mesh(d, p);
|
|
83
|
+
return o.name = `AxesDashedRing-${this.direction}-${c}`, o;
|
|
107
84
|
});
|
|
108
|
-
this.add(...
|
|
85
|
+
this.add(...h);
|
|
109
86
|
}
|
|
110
87
|
}
|
|
111
|
-
class
|
|
112
|
-
constructor(
|
|
113
|
-
var
|
|
88
|
+
class b extends r.Mesh {
|
|
89
|
+
constructor(t) {
|
|
90
|
+
var h;
|
|
114
91
|
super();
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
92
|
+
i(this, "direction");
|
|
93
|
+
i(this, "baseAxes");
|
|
94
|
+
i(this, "angleDirection");
|
|
95
|
+
switch (t.direction) {
|
|
118
96
|
case "x":
|
|
119
97
|
this.baseAxes = new r.Vector3(0, 0, 1);
|
|
120
98
|
break;
|
|
@@ -128,13 +106,13 @@ class x extends r.Mesh {
|
|
|
128
106
|
const e = 0.3 + 5e-4;
|
|
129
107
|
this.geometry = new r.CircleGeometry(e, 48, 0, 1e-4), this.material = new r.MeshBasicMaterial({
|
|
130
108
|
opacity: 0.4,
|
|
131
|
-
color: (
|
|
109
|
+
color: (h = t.color) != null ? h : 16777215,
|
|
132
110
|
depthTest: !1,
|
|
133
111
|
transparent: !0,
|
|
134
112
|
side: r.DoubleSide
|
|
135
|
-
}), this.direction =
|
|
113
|
+
}), this.direction = t.direction, this.angleDirection = this.direction === "z" ? 1 : -1;
|
|
136
114
|
}
|
|
137
115
|
}
|
|
138
116
|
export {
|
|
139
|
-
|
|
117
|
+
T as RotateHelper
|
|
140
118
|
};
|
|
@@ -13,7 +13,7 @@ export declare type HelperEventMap = {
|
|
|
13
13
|
rotateEnd: () => void;
|
|
14
14
|
scaleEnd: () => void;
|
|
15
15
|
setObjectPosition: (position: THREE.Vector3) => void;
|
|
16
|
-
setObjectRotate: (quaternion: THREE.Quaternion, origin
|
|
16
|
+
setObjectRotate: (quaternion: THREE.Quaternion, origin?: THREE.Vector3) => void;
|
|
17
17
|
setObjectScale: (scale: THREE.Vector3) => void;
|
|
18
18
|
applyObjectPosition: (position: {
|
|
19
19
|
matrix: THREE.Matrix4;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* @description: 在指定中心点上,使用 quaternion 旋转物体。
|
|
4
|
+
* @param {THREE.Object3D} object 旋转对象
|
|
5
|
+
* @param {THREE.Quaternion} quaternion 旋转四元数
|
|
6
|
+
* @param {THREE.Vector3} rotateCenter 旋转中心
|
|
7
|
+
*/
|
|
8
|
+
export default function setObjectQuaternion(object: THREE.Object3D, quaternion: THREE.Quaternion, rotateCenter: THREE.Vector3): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i from "three";
|
|
2
|
+
function r(n, t, o) {
|
|
3
|
+
if (o) {
|
|
4
|
+
const e = new i.Vector3().subVectors(n.position, o).applyQuaternion(n.quaternion.clone().inverse()).applyQuaternion(t).add(o);
|
|
5
|
+
n.position.copy(e);
|
|
6
|
+
}
|
|
7
|
+
n.quaternion.copy(t);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
r as setObjectQuaternion
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function deg2Rad(deg: number): number;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"repository": "https://github.com/realsee-developer/dnalogel.git",
|
|
8
8
|
"description": "如视 VR 看房插件合集",
|
|
9
9
|
"private": false,
|
|
10
|
-
"version": "2.8.
|
|
10
|
+
"version": "2.8.4",
|
|
11
11
|
"license": "SEE LICENSE IN TERMS.txt",
|
|
12
12
|
"scripts": {
|
|
13
13
|
"clean": "rm -rf components dist docs libs types ./vite.config.js.timestamp*",
|