@realsee/dnalogel 2.8.1 → 2.8.3

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.
Files changed (294) hide show
  1. package/components/index.js +74 -74
  2. package/dist/Object3DHelperPlugin/Controller.d.ts +1 -0
  3. package/dist/PanoTagPlugin/controller/TagComputer.d.ts +1 -1
  4. package/dist/index.cjs.js +29 -29
  5. package/dist/index.js +2579 -2603
  6. package/dist/index.umd.js +26 -26
  7. package/dist/shared-utils/Object3DHelper/Base/BaseHelper.d.ts +11 -25
  8. package/dist/shared-utils/Object3DHelper/Controller/RotateController.d.ts +4 -3
  9. package/dist/shared-utils/Object3DHelper/Helper/RotateHelper.d.ts +25 -16
  10. package/dist/shared-utils/Object3DHelper/typings/Hooks.d.ts +1 -1
  11. package/dist/shared-utils/Object3DHelper/utils/setObjectQuaternion.d.ts +8 -0
  12. package/dist/shared-utils/math/deg2Rad.d.ts +1 -0
  13. package/docs/classes/CSS3DRender.html +31 -31
  14. package/docs/classes/CruisePluginController.html +24 -24
  15. package/docs/classes/Magnifier.html +20 -20
  16. package/docs/classes/ModelRoomLabelController.html +11 -11
  17. package/docs/classes/Object3DHelperController.html +27 -27
  18. package/docs/classes/PaintBrush.html +15 -15
  19. package/docs/classes/PanoMeasurePluginLine.html +23 -23
  20. package/docs/classes/PanoMeasurePluginModel.html +22 -22
  21. package/docs/classes/PanoMeasurePluginPoint.html +14 -14
  22. package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
  23. package/docs/classes/PanoTagPluginController.html +47 -47
  24. package/docs/classes/Util.BetterTween.html +8 -8
  25. package/docs/classes/Util.FivePointSelector.html +12 -12
  26. package/docs/classes/Util.Interval.html +12 -12
  27. package/docs/classes/Util.Magnifier.html +17 -17
  28. package/docs/classes/Util.PointDomHelper.html +11 -11
  29. package/docs/classes/Util.PointHelper.html +11 -11
  30. package/docs/classes/Util.Rectangle.html +13 -13
  31. package/docs/enums/CameraMovementEffect.html +7 -7
  32. package/docs/enums/ContentType.html +18 -18
  33. package/docs/enums/DIRECTION.html +9 -9
  34. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
  35. package/docs/enums/DimensionType.html +7 -7
  36. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
  37. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
  38. package/docs/enums/PaintBrushTypeEnum.html +8 -8
  39. package/docs/enums/PointType.html +7 -7
  40. package/docs/enums/Rotation.html +8 -8
  41. package/docs/functions/CSS3DRenderPlugin.html +4 -4
  42. package/docs/functions/CameraMovementPlugin.html +4 -4
  43. package/docs/functions/CruisePlugin.html +4 -4
  44. package/docs/functions/GuideLinePlugin.html +5 -5
  45. package/docs/functions/ItemLabelPlugin.html +4 -4
  46. package/docs/functions/MapviewFloorplanPlugin.html +4 -4
  47. package/docs/functions/ModelChassisCompassPlugin.html +4 -4
  48. package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
  49. package/docs/functions/ModelFloorplanPlugin.html +4 -4
  50. package/docs/functions/ModelItemLabelPlugin.html +4 -4
  51. package/docs/functions/ModelRoomLabelPlugin.html +4 -4
  52. package/docs/functions/ModelTVVideoPlugin.html +4 -4
  53. package/docs/functions/ModelViewPlugin.html +4 -4
  54. package/docs/functions/Object3DHelperPlugin.html +4 -4
  55. package/docs/functions/PanoCompassPlugin.html +4 -4
  56. package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
  57. package/docs/functions/PanoDoorLabelPlugin.html +4 -4
  58. package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
  59. package/docs/functions/PanoMeasurePlugin.html +4 -4
  60. package/docs/functions/PanoRulerPlugin.html +4 -4
  61. package/docs/functions/PanoRulerProPlugin.html +4 -4
  62. package/docs/functions/PanoSpatialTagPlugin.html +4 -4
  63. package/docs/functions/PanoTagPlugin.html +4 -4
  64. package/docs/functions/TopviewFloorplanPlugin.html +4 -4
  65. package/docs/functions/Util.getCoordsFromClient.html +5 -5
  66. package/docs/functions/Util.getCoordsFromElement.html +5 -5
  67. package/docs/functions/Util.getFrameTime.html +5 -5
  68. package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
  69. package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
  70. package/docs/functions/Util.isNil.html +5 -5
  71. package/docs/functions/Util.nextFrame.html +5 -5
  72. package/docs/functions/Util.notNil.html +5 -5
  73. package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
  74. package/docs/functions/Util.tweenProgress.html +5 -5
  75. package/docs/functions/pluginFlag.html +5 -5
  76. package/docs/index.html +4 -4
  77. package/docs/interfaces/AddTagConfig.html +6 -6
  78. package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
  79. package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
  80. package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
  81. package/docs/interfaces/EventMap.html +15 -15
  82. package/docs/interfaces/FloorplanBounding.html +8 -8
  83. package/docs/interfaces/FloorplanData.html +10 -10
  84. package/docs/interfaces/FloorplanEntrance.html +11 -11
  85. package/docs/interfaces/FloorplanExtraObject.html +10 -10
  86. package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
  87. package/docs/interfaces/FloorplanFloorData.html +9 -9
  88. package/docs/interfaces/FloorplanImagePosition.html +7 -7
  89. package/docs/interfaces/FloorplanObserver.html +9 -9
  90. package/docs/interfaces/FloorplanOutlineItem.html +9 -9
  91. package/docs/interfaces/FloorplanPosition.html +7 -7
  92. package/docs/interfaces/FloorplanRoomItem.html +13 -13
  93. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
  94. package/docs/interfaces/FloorplanServerBounding.html +8 -8
  95. package/docs/interfaces/FloorplanServerComputedData.html +10 -10
  96. package/docs/interfaces/FloorplanServerData.html +7 -7
  97. package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
  98. package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
  99. package/docs/interfaces/FloorplanServerEntrance.html +11 -11
  100. package/docs/interfaces/FloorplanServerFloorData.html +9 -9
  101. package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
  102. package/docs/interfaces/FloorplanServerObserver.html +9 -9
  103. package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
  104. package/docs/interfaces/FloorplanServerPosition.html +7 -7
  105. package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
  106. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
  107. package/docs/interfaces/HelperOffset.html +8 -8
  108. package/docs/interfaces/ItemLabelPluginData.html +6 -6
  109. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
  110. package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
  111. package/docs/interfaces/MinMax.html +7 -7
  112. package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
  113. package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
  114. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
  115. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
  116. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
  117. package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
  118. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
  119. package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
  120. package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
  121. package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
  122. package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
  123. package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
  124. package/docs/interfaces/ModelViewPluginExportType.html +11 -11
  125. package/docs/interfaces/Object3DHelperState.html +8 -8
  126. package/docs/interfaces/ObjectHelperControllers.html +9 -9
  127. package/docs/interfaces/PaintBrushAction.html +12 -12
  128. package/docs/interfaces/PaintBrushConfigs.html +12 -12
  129. package/docs/interfaces/PaintBrushState.html +10 -10
  130. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
  131. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
  132. package/docs/interfaces/PanoMeasureParameterType.html +12 -12
  133. package/docs/interfaces/PanoMeasurePluginLineJson.html +8 -8
  134. package/docs/interfaces/PanoMeasurePluginOpenParameter.html +7 -7
  135. package/docs/interfaces/PanoMeasurePluginPointJson.html +7 -7
  136. package/docs/interfaces/PanoMeasurePluginPolylineJson.html +8 -8
  137. package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
  138. package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
  139. package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
  140. package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
  141. package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
  142. package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
  143. package/docs/interfaces/PanoRulerProPluginState.html +8 -8
  144. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
  145. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
  146. package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
  147. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
  148. package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
  149. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
  150. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
  151. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
  152. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
  153. package/docs/interfaces/Point.html +8 -8
  154. package/docs/interfaces/Room.html +9 -9
  155. package/docs/interfaces/RoomInfo.html +7 -7
  156. package/docs/interfaces/RoomLabel.html +14 -14
  157. package/docs/interfaces/RoomRules.html +5 -5
  158. package/docs/interfaces/Rooms.html +5 -5
  159. package/docs/interfaces/Scissor.html +9 -9
  160. package/docs/interfaces/State.html +8 -8
  161. package/docs/interfaces/TagCache.html +12 -12
  162. package/docs/interfaces/TagConfig.html +10 -10
  163. package/docs/interfaces/TagIconUrl.html +9 -9
  164. package/docs/interfaces/Tags.html +9 -9
  165. package/docs/interfaces/TemporaryState.html +6 -6
  166. package/docs/interfaces/Util.MagnifierParameter.html +11 -11
  167. package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
  168. package/docs/modules/Util.html +5 -5
  169. package/docs/modules.html +4 -4
  170. package/docs/types/ArrayPosition.html +5 -5
  171. package/docs/types/AudioAppearance.html +5 -5
  172. package/docs/types/AudioTagTypeConfigKey.html +5 -5
  173. package/docs/types/CSS3DRenderExportType.html +5 -5
  174. package/docs/types/CSS3DRenderPluginExportType.html +5 -5
  175. package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
  176. package/docs/types/ClassFunctionParameters.html +5 -5
  177. package/docs/types/Color.html +5 -5
  178. package/docs/types/ContentTypeConfigKey.html +5 -5
  179. package/docs/types/ContentTypeConfigKeySplit.html +5 -5
  180. package/docs/types/ContentTypeMap.html +5 -5
  181. package/docs/types/Create3DDomContainerReturnType.html +5 -5
  182. package/docs/types/Create3DElementReturnType.html +5 -5
  183. package/docs/types/CruisePluginExportType.html +5 -5
  184. package/docs/types/Direction-1.html +5 -5
  185. package/docs/types/Direction4.html +5 -5
  186. package/docs/types/FloorplanRuleLabels.html +5 -5
  187. package/docs/types/FloorplanServerRuleLabels.html +5 -5
  188. package/docs/types/GuideLinePluginExportType.html +5 -5
  189. package/docs/types/HelperEventMap.html +9 -9
  190. package/docs/types/LoadTagConfig.html +5 -5
  191. package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
  192. package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
  193. package/docs/types/MediaData.html +5 -5
  194. package/docs/types/MediaStore.html +5 -5
  195. package/docs/types/ModelElement.html +5 -5
  196. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
  197. package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
  198. package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
  199. package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
  200. package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
  201. package/docs/types/MoveArgs.html +5 -5
  202. package/docs/types/MoveOpts.html +5 -5
  203. package/docs/types/Object3DHelperEventMap.html +5 -5
  204. package/docs/types/ObjectFit.html +5 -5
  205. package/docs/types/PaintBrushEventMap.html +5 -5
  206. package/docs/types/PanoCompassPluginData.html +5 -5
  207. package/docs/types/PanoCompassPluginExportType.html +5 -5
  208. package/docs/types/PanoCompassPluginParameterType.html +5 -5
  209. package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
  210. package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
  211. package/docs/types/PanoIndex.html +5 -5
  212. package/docs/types/PanoMeasurePluginEvent.html +5 -5
  213. package/docs/types/PanoMeasureReturnType.html +5 -5
  214. package/docs/types/PanoSpatialTagPluginId.html +5 -5
  215. package/docs/types/PanoTagPluginExportInterface.html +5 -5
  216. package/docs/types/PanoTagPluginParamsInterface.html +5 -5
  217. package/docs/types/PlaneTag.html +5 -5
  218. package/docs/types/PlaneTagElement.html +5 -5
  219. package/docs/types/Point2DElement.html +5 -5
  220. package/docs/types/Point2DTag.html +5 -5
  221. package/docs/types/Point3DElement.html +5 -5
  222. package/docs/types/Point3DTag.html +5 -5
  223. package/docs/types/PointTag.html +5 -5
  224. package/docs/types/PointTagElement.html +5 -5
  225. package/docs/types/Position.html +5 -5
  226. package/docs/types/RotateArgs.html +5 -5
  227. package/docs/types/RotateOpts.html +5 -5
  228. package/docs/types/RuleLabelsKey.html +5 -5
  229. package/docs/types/RuleLabelsValue.html +5 -5
  230. package/docs/types/StickType.html +5 -5
  231. package/docs/types/Tag.html +5 -5
  232. package/docs/types/Tag2D.html +5 -5
  233. package/docs/types/Tag3D.html +5 -5
  234. package/docs/types/TagContentType.html +5 -5
  235. package/docs/types/TagDimensionType.html +5 -5
  236. package/docs/types/TagElement.html +5 -5
  237. package/docs/types/TagEvents.html +5 -5
  238. package/docs/types/TagGLTFObject.html +5 -5
  239. package/docs/types/TagHooks.html +5 -5
  240. package/docs/types/TagIconSize.html +5 -5
  241. package/docs/types/TagId.html +5 -5
  242. package/docs/types/TagPointType.html +5 -5
  243. package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
  244. package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
  245. package/docs/types/WorkCode.html +5 -5
  246. package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
  247. package/docs/variables/PLUGIN.html +5 -5
  248. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
  249. package/docs/variables/ROOM_TYPE_MAP.html +5 -5
  250. package/docs/variables/VERSION.html +5 -5
  251. package/docs/variables/itemLabelPluginServerParams.html +5 -5
  252. package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
  253. package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
  254. package/libs/Object3DHelperPlugin/Controller.d.ts +1 -0
  255. package/libs/Object3DHelperPlugin/Controller.js +5 -2
  256. package/libs/Object3DHelperPlugin/index.js +10 -7
  257. package/libs/PanoTagPlugin/Components/Tag/index.js +1 -1
  258. package/libs/PanoTagPlugin/controller/TagComputer.d.ts +1 -1
  259. package/libs/PanoTagPlugin/controller/TagComputer.js +19 -13
  260. package/libs/PanoTagPlugin/controller/index.js +12 -12
  261. package/libs/PanoTagPlugin/mocks/v1/mock-80P6A03eQRQKY3oqLj.d.ts +4 -0
  262. package/libs/PanoTagPlugin/mocks/v1/mock-80P6A03eQRQKY3oqLj.js +6 -0
  263. package/libs/PanoTagPlugin/mocks/v1/mock-80QG2vMPboNv5DWrom.d.ts +93 -0
  264. package/libs/PanoTagPlugin/mocks/v1/mock-80QG2vMPboNv5DWrom.js +5622 -0
  265. package/libs/PanoTagPlugin/mocks/v1/mock-test3-realsee-cn-4zr0A5.js +1325 -0
  266. package/libs/PanoTagPlugin/mocks/v1/mock1.d.ts +173 -0
  267. package/libs/PanoTagPlugin/mocks/v1/mock1.js +122 -0
  268. package/libs/PanoTagPlugin/mocks/v1/mock2.d.ts +233 -0
  269. package/libs/PanoTagPlugin/mocks/v1/mock2.js +296 -0
  270. package/libs/PanoTagPlugin/mocks/v1/mock3.d.ts +22 -0
  271. package/libs/PanoTagPlugin/mocks/v1/mock3.js +32 -0
  272. package/libs/PanoTagPlugin/mocks/v1/mock4.d.ts +56 -0
  273. package/libs/PanoTagPlugin/mocks/v1/mock4.js +60 -0
  274. package/libs/PanoTagPlugin/mocks/v1/mock5.d.ts +13 -0
  275. package/libs/PanoTagPlugin/mocks/v1/mock5.js +17 -0
  276. package/libs/PanoTagPlugin/mocks/v1/mock6.d.ts +16 -0
  277. package/libs/PanoTagPlugin/mocks/v1/mock6.js +27 -0
  278. package/libs/PanoTagPlugin/mocks/v1/mock7.d.ts +22 -0
  279. package/libs/PanoTagPlugin/mocks/v1/mock7.js +228 -0
  280. package/libs/components/PaintBrush/Controller.js +98 -98
  281. package/libs/index.js +102 -100
  282. package/libs/shared-utils/Object3DHelper/Base/BaseController.js +15 -15
  283. package/libs/shared-utils/Object3DHelper/Base/BaseHelper.d.ts +11 -25
  284. package/libs/shared-utils/Object3DHelper/Base/BaseHelper.js +19 -22
  285. package/libs/shared-utils/Object3DHelper/Controller/RotateController.d.ts +4 -3
  286. package/libs/shared-utils/Object3DHelper/Controller/RotateController.js +98 -109
  287. package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.d.ts +25 -16
  288. package/libs/shared-utils/Object3DHelper/Helper/RotateHelper.js +66 -88
  289. package/libs/shared-utils/Object3DHelper/typings/Hooks.d.ts +1 -1
  290. package/libs/shared-utils/Object3DHelper/utils/setObjectQuaternion.d.ts +8 -0
  291. package/libs/shared-utils/Object3DHelper/utils/setObjectQuaternion.js +11 -0
  292. package/libs/shared-utils/math/deg2Rad.d.ts +1 -0
  293. package/libs/shared-utils/math/deg2Rad.js +6 -0
  294. package/package.json +1 -1
@@ -1,161 +1,150 @@
1
- var O = Object.defineProperty;
2
- var T = (f, g, e) => g in f ? O(f, g, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[g] = e;
3
- var m = (f, g, e) => (T(f, typeof g != "symbol" ? g + "" : g, e), e);
4
- import { BaseController as A } from "../Base/BaseController.js";
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 m = (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 H } from "../utils/getMouseRaycaster.js";
7
- class C extends A {
8
- constructor(...e) {
9
- super(...e);
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
+ super(...n);
10
13
  m(this, "name", "RotateController");
11
14
  m(this, "startInfo");
12
- m(this, "lastRotation");
13
- m(this, "rotations", []);
14
- m(this, "helperObject3DQuaternion", this.originObject3D.quaternion.clone());
15
15
  m(this, "removeListener");
16
- const t = this.helperObject3D;
17
- this.hoverListener([t.xyCircle, t.xzCircle, t.yzCircle]);
18
- const n = this.dragStart.bind(this), r = this.dragging.bind(this), i = this.dragEnd.bind(this), o = this.show.bind(this), c = this.hide.bind(this);
19
- this.domEvents.addEventListener(this.helperObject3D, "mousedown", n), document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), this.hooks.on("moveStart", c), this.hooks.on("moveEnd", o), this.hooks.on("moveByMouseEnable", c), this.hooks.on("moveByMouseDisable", o), this.removeListener = () => {
20
- this.domEvents.removeEventListener(this.helperObject3D, "mousedown", n), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), this.hooks.off("moveStart", c), this.hooks.off("moveEnd", o), this.hooks.off("moveByMouseEnable", c), this.hooks.off("moveByMouseDisable", o);
16
+ const e = this.helperObject3D;
17
+ this.hoverListener([e.xCircle.circle, e.yCircle.circle, e.zCircle.circle]);
18
+ 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);
19
+ 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 = () => {
20
+ 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
21
  };
22
22
  }
23
23
  get rotateCenter() {
24
24
  return this.helperObject3D.position.clone();
25
25
  }
26
26
  initialHelperQuaternion() {
27
- this.helperObject3D.updateAngleHelperQuaternion(), this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion);
27
+ this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion);
28
28
  }
29
- setRotateAngle(e) {
30
- const { x: t = 0, y: n = 0, z: r = 0 } = e, i = new s.Euler(Math.PI * t / 180, Math.PI * n / 180, Math.PI * r / 180), o = new s.Quaternion().setFromEuler(i);
31
- if (this.hooks.emit("wantToRotate", o))
29
+ setRotateAngle(n) {
30
+ 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);
31
+ if (this.hooks.emit("wantToRotate", r))
32
32
  return;
33
- const { originObject3D: a, rotateCenter: p } = this;
34
- if (p) {
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();
33
+ const { originObject3D: c, rotateCenter: l } = this;
34
+ w(c, r, l), this.hooks.emit("setObjectRotate", r, l), this.hooks.emit("rotate", r), this.render();
39
35
  }
40
36
  dispose() {
41
37
  this.removeListener(), super.dispose();
42
38
  }
43
- onApplyOriginObjectScale(e) {
39
+ onApplyOriginObjectRotate(n) {
40
+ this.isDragging || super.onApplyOriginObjectRotate(n);
41
+ }
42
+ onApplyOriginObjectScale(n) {
44
43
  }
45
- dragStart(e) {
44
+ dragStart(n) {
46
45
  if (this.isDragging)
47
46
  return;
48
- const t = e == null ? void 0 : e.intersect;
49
- if (!t)
47
+ const e = n == null ? void 0 : n.intersect;
48
+ if (!e)
50
49
  return this.dragEnd();
51
- const n = (t == null ? void 0 : t.object).direction;
52
- if (!n)
50
+ const t = (e == null ? void 0 : e.object).direction;
51
+ if (!t)
53
52
  return this.dragEnd();
54
- this.helperObject3D.updateAngleHelperQuaternion();
55
- const r = t.point, i = this.getAngleHelper(n);
53
+ const i = e.point, o = this.getAngleHelper(t);
56
54
  this.setTipsAngle(0);
57
- const o = r.clone();
58
- o.y += 0.2, this.setTipsPosition(o);
59
- const c = new s.Vector3(1, 0, 0).applyQuaternion(this.helperObject3DQuaternion), a = new s.Vector3(0, 1, 0).applyQuaternion(this.helperObject3DQuaternion), p = new s.Vector3(0, 0, 1).applyQuaternion(this.helperObject3DQuaternion), h = (() => {
60
- switch (n) {
61
- case "x":
62
- return c;
63
- case "y":
64
- return a;
65
- case "z":
66
- return p;
67
- }
68
- })(), b = new s.Plane().setFromNormalAndCoplanarPoint(h, r), u = new s.Vector3();
69
- b.projectPoint(r.clone(), u);
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) {
55
+ const r = i.clone();
56
+ r.y += 0.2, this.setTipsPosition(r);
57
+ const a = (() => {
58
+ if (t === "x")
59
+ return new s.Vector3(1, 0, 0).applyQuaternion(this.originObject3D.quaternion);
60
+ if (t === "y")
61
+ return new s.Vector3(0, 1, 0).applyQuaternion(this.originObject3D.quaternion);
62
+ if (t === "z")
63
+ return new s.Vector3(0, 0, 1).applyQuaternion(this.originObject3D.quaternion);
64
+ })(), c = new s.Plane().setFromNormalAndCoplanarPoint(a, i), d = c.projectPoint(i.clone(), new s.Vector3()).clone().sub(this.rotateCenter), p = d.angleTo(o.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));
65
+ this.setAngleHelperStart(t, p), this.setAngleHelperLength(t, 0), this.startInfo = { direction: t, startVector: d, plane: c, angleHelper: o, angle: 0, objectQuaternion: this.originObject3D.quaternion.clone() }, this.helperObject3D.showDraggingHelper([t]), this.hooks.emit("rotateStart"), this.isDragging = !0;
66
+ }
67
+ dragging(n) {
74
68
  if (!this.isDragging)
75
69
  return;
76
- const t = H(this.camera, e, this.container);
77
- return t ? (this.rotate(t), !1) : this.dragEnd();
70
+ const e = E(this.camera, n, this.container);
71
+ return e ? (this.rotate(e), !1) : this.dragEnd();
78
72
  }
79
- rotate(e) {
73
+ rotate(n) {
80
74
  if (!this.startInfo)
81
75
  return this.dragEnd();
82
- const { startVector: t, plane: n, angleHelper: r, staticStartVector: i, direction: o } = this.startInfo, c = e.ray.intersectPlane(n, new s.Vector3());
76
+ 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
77
  if (!c)
84
78
  return;
85
- const a = this.rotateCenter, p = new s.Vector3();
86
- n.projectPoint(c.clone(), p);
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))
79
+ const l = this.rotateCenter.clone(), p = t.projectPoint(c.clone(), new s.Vector3()).clone().sub(l);
80
+ if (e.angleTo(p) === 0)
89
81
  return;
90
- const b = (() => {
91
- if (this.rotations.length === 1)
92
- return h.angleTo(r.baseAxes) > i.angleTo(r.baseAxes);
93
- {
94
- const d = this.rotations[this.rotations.length - 1], E = this.rotations[this.rotations.length - 2], y = h.angleTo(E.vector), v = h.angleTo(d.vector), j = d.vector.angleTo(E.vector);
95
- if (j === 0 || v === 0 || y === 0)
96
- return;
97
- if (y > v && y > j)
98
- return d.direction;
99
- if (y < j && v < j || y < v && v > j)
100
- return !d.direction;
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;
82
+ const u = new s.Quaternion().setFromUnitVectors(e.clone().normalize(), p.clone().normalize()), b = a.quaternion.clone().premultiply(u);
83
+ if (this.hooks.emit("wantToRotate", b))
84
+ return;
85
+ const y = new s.Euler().setFromQuaternion(
86
+ new s.Quaternion().setFromUnitVectors(
87
+ e.clone().normalize().applyQuaternion(r.clone().inverse()),
88
+ p.clone().normalize().applyQuaternion(r.clone().inverse())
89
+ ),
90
+ `${o.toUpperCase()}${"XZY".replace(o.toUpperCase(), "")}`
91
+ )[o] * i.angleDirection;
92
+ if (this.startInfo.angle += y, this.setAngleHelperLength(o, this.startInfo.angle), this.setTipsAngle(C(this.startInfo.angle)), l) {
93
+ const j = new s.Vector3().subVectors(a.position, l).applyQuaternion(u).add(l);
94
+ a.position.copy(j);
112
95
  }
96
+ a.applyQuaternion(u), this.hooks.emit("applyObjectRotate", { quaternion: u, origin: l }), this.hooks.emit("rotate", a.quaternion), this.startInfo.startVector = p;
113
97
  }
114
98
  dragEnd() {
115
- !this.isDragging || (this.startInfo = void 0, this.isDragging = !1, this.lastRotation = void 0, this.rotations = [], this.helperObject3D.show(), this.hooks.emit("rotateEnd"));
99
+ !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
100
  }
117
- getAngleHelper(e) {
118
- switch (e) {
101
+ getAngleHelper(n) {
102
+ var e, t, i;
103
+ switch (n) {
119
104
  case "x":
120
- return this.helperObject3D.xAngleHelper;
105
+ return (e = this.helperObject3D.xCircle) == null ? void 0 : e.angleSector;
121
106
  case "y":
122
- return this.helperObject3D.yAngleHelper;
107
+ return (t = this.helperObject3D.yCircle) == null ? void 0 : t.angleSector;
123
108
  case "z":
124
- return this.helperObject3D.zAngleHelper;
109
+ return (i = this.helperObject3D.zCircle) == null ? void 0 : i.angleSector;
125
110
  }
126
111
  }
127
- setAngleHelperStart(e, t) {
128
- const n = this.getAngleHelper(e);
129
- if (n instanceof s.Mesh && n.geometry instanceof s.CircleGeometry) {
130
- const { radius: r, segments: i, thetaLength: o } = n.geometry.parameters;
131
- n.geometry = new s.CircleGeometry(r, i, t, o);
112
+ setAngleHelperStart(n, e) {
113
+ const t = this.getAngleHelper(n);
114
+ if (!t) {
115
+ console.warn("angleHelper is undefined");
116
+ return;
117
+ }
118
+ if (t instanceof s.Mesh && t.geometry instanceof s.CircleGeometry) {
119
+ const { radius: i, segments: o, thetaLength: r } = t.geometry.parameters;
120
+ t.geometry = new s.CircleGeometry(i, o, e, r);
132
121
  } else
133
122
  console.warn("only support THREE.CircleGeometry");
134
123
  }
135
- setAngleHelperLength(e, t) {
136
- const r = t >= 0 ? Math.max(t, 1e-3) : Math.min(t, -1e-3), i = this.getAngleHelper(e);
137
- if (i instanceof s.Mesh && i.geometry instanceof s.CircleGeometry) {
138
- const { radius: o, thetaStart: c } = i.geometry.parameters, a = Math.ceil(Math.abs(r) * (40 / (2 * Math.PI)));
139
- i.geometry = new s.CircleGeometry(o, a, c, r);
124
+ setAngleHelperLength(n, e) {
125
+ const i = e >= 0 ? Math.max(e, 1e-3) : Math.min(e, -1e-3), o = this.getAngleHelper(n);
126
+ if (o instanceof s.Mesh && o.geometry instanceof s.CircleGeometry) {
127
+ const { radius: r, thetaStart: a } = o.geometry.parameters, c = Math.ceil(Math.abs(i) * (40 / (2 * Math.PI)));
128
+ o.geometry = new s.CircleGeometry(r, c, a, i);
140
129
  } else
141
130
  console.warn("only support THREE.CircleGeometry");
142
131
  }
143
- setTipsAngle(e) {
144
- var n;
145
- const t = (n = this.helperObject3D.angleTips) == null ? void 0 : n.element;
146
- !t || (t.innerText = `${e.toFixed(0)}\xB0`);
132
+ setTipsAngle(n) {
133
+ var t;
134
+ const e = (t = this.helperObject3D.angleTips) == null ? void 0 : t.element;
135
+ !e || (e.innerText = `${n.toFixed(0)}\xB0`);
147
136
  }
148
- setTipsPosition(e) {
149
- const t = this.helperObject3D.angleTips;
150
- if (!t)
137
+ setTipsPosition(n) {
138
+ const e = this.helperObject3D.angleTips;
139
+ if (!e)
151
140
  return;
152
- const n = e.project(this.camera), { x: r, y: i, z: o } = n;
153
- if (o > 1)
141
+ const t = n.project(this.camera), { x: i, y: o, z: r } = t;
142
+ if (r > 1)
154
143
  return;
155
- const c = (r + 1) / 2 * 100 + "%", a = (-i + 1) / 2 * 100 + "%";
156
- t.setLeftTop(c, a);
144
+ const a = (i + 1) / 2 * 100 + "%", c = (-o + 1) / 2 * 100 + "%";
145
+ e.setLeftTop(a, c);
157
146
  }
158
147
  }
159
148
  export {
160
- C as RotateController
149
+ P as RotateController
161
150
  };
@@ -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
- yzCircle?: Circle;
8
- xzCircle?: Circle;
9
- xyCircle?: Circle;
10
- xRingHelper?: AxesDashedRing;
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
- private filterRingHelper;
31
- private filterAngleHelper;
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 AxesDashedRing extends THREE.Group {
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 Sector extends THREE.Mesh {
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 R = Object.defineProperty;
2
- var C = (n, l, i) => l in n ? R(n, l, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[l] = i;
3
- var t = (n, l, i) => (C(n, typeof l != "symbol" ? l + "" : l, i), i);
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 m } from "../Base/BaseHelper.js";
6
- import { AXES_THREE_COLOR as y } from "../Constants/color.js";
7
- import { tipsDom as w } from "./HTML/tipsDom.js";
8
- class P extends m {
9
- constructor(i, e) {
10
- var s;
11
- super(i);
12
- t(this, "yzCircle");
13
- t(this, "xzCircle");
14
- t(this, "xyCircle");
15
- t(this, "xRingHelper");
16
- t(this, "yRingHelper");
17
- t(this, "zRingHelper");
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.remove(
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 i;
48
- this.add(this.xyCircle, this.xzCircle, this.yzCircle), this.remove(this.xRingHelper, this.yRingHelper, this.zRingHelper, this.xAngleHelper, this.yAngleHelper, this.zAngleHelper), (i = this.angleTips) == null || i.hide();
23
+ var t;
24
+ this.children.forEach((e) => e.showCircle()), (t = this.angleTips) == null || t.hide();
49
25
  }
50
- showDraggingHelper(i) {
26
+ showDraggingHelper(t) {
51
27
  var e;
52
- this.hide(), this.add(...this.filterRingHelper(i)), this.add(...this.filterAngleHelper(i)), (e = this.angleTips) == null || e.show();
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 i, e;
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
- filterRingHelper(i) {
71
- return [this.xRingHelper, this.yRingHelper, this.zRingHelper].filter((e) => i.includes(e == null ? void 0 : e.direction)).filter(Boolean);
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
- filterAngleHelper(i) {
74
- return [this.xAngleHelper, this.yAngleHelper, this.zAngleHelper].filter((e) => i.includes(e == null ? void 0 : e.direction)).filter(Boolean);
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 d extends r.Mesh {
78
- constructor(i) {
54
+ class C extends r.Mesh {
55
+ constructor(t) {
79
56
  var e;
80
57
  super();
81
- t(this, "direction");
82
- t(this, "gapAngle", 0.02);
83
- t(this, "geometry", new r.RingGeometry(0.25, 0.3, 20, 8, this.gapAngle, Math.PI / 2 - this.gapAngle * 2));
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 = i.color) != null ? e : 16777215,
63
+ color: (e = t.color) != null ? e : 16777215,
87
64
  transparent: !0,
88
65
  side: r.DoubleSide,
89
66
  depthTest: !1
90
- }), this.direction = i.direction, this.geometry.name = `RotateHelperCircleGeometry-${this.direction}`, this.direction === "y" ? this.rotateX(Math.PI / 2) : this.direction === "x" && this.rotateY(-Math.PI / 2);
67
+ }), this.direction = t.direction, this.geometry.name = `RotateHelperCircleGeometry-${this.direction}`;
91
68
  }
92
69
  }
93
- class H extends r.Group {
94
- constructor(i) {
70
+ class x extends r.Group {
71
+ constructor(t) {
95
72
  super();
96
- t(this, "direction");
97
- this.direction = i.direction;
98
- const e = 0.015, s = new Array(8).fill(null).map((c, h) => {
99
- const o = new r.RingGeometry(0.25, 0.3, 20, 8, Math.PI / 4 * h + e, Math.PI / 4 - e * 2), p = new r.MeshBasicMaterial({
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
- }), a = new r.Mesh(o, p);
106
- return a.name = `AxesDashedRing-${this.direction}-${h}`, a;
82
+ }), o = new r.Mesh(d, p);
83
+ return o.name = `AxesDashedRing-${this.direction}-${c}`, o;
107
84
  });
108
- this.add(...s), this.direction === "y" ? this.rotateX(Math.PI / 2) : this.direction === "x" && this.rotateY(-Math.PI / 2);
85
+ this.add(...h);
109
86
  }
110
87
  }
111
- class x extends r.Mesh {
112
- constructor(i) {
113
- var s;
88
+ class b extends r.Mesh {
89
+ constructor(t) {
90
+ var h;
114
91
  super();
115
- t(this, "direction");
116
- t(this, "baseAxes");
117
- switch (i.direction) {
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: (s = i.color) != null ? s : 16777215,
109
+ color: (h = t.color) != null ? h : 16777215,
132
110
  depthTest: !1,
133
111
  transparent: !0,
134
112
  side: r.DoubleSide
135
- }), this.direction = i.direction, this.direction === "y" ? this.rotateX(Math.PI / 2) : this.direction === "x" && this.rotateY(-Math.PI / 2);
113
+ }), this.direction = t.direction, this.angleDirection = this.direction === "z" ? 1 : -1;
136
114
  }
137
115
  }
138
116
  export {
139
- P as RotateHelper
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: THREE.Vector3) => void;
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;
@@ -0,0 +1,6 @@
1
+ function e(t) {
2
+ return t * Math.PI / 180;
3
+ }
4
+ export {
5
+ e as deg2Rad
6
+ };
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.1",
10
+ "version": "2.8.3",
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*",