@realsee/dnalogel 3.45.0 → 3.46.1

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 (100) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/Sculpt/Meshes/Line.d.ts +6 -1
  3. package/dist/Sculpt/utils/removeAllTag.d.ts +2 -0
  4. package/dist/index.cjs.js +53 -53
  5. package/dist/index.js +29600 -29557
  6. package/dist/index.umd.js +49 -49
  7. package/dist/shared-utils/tag.d.ts +6 -3
  8. package/libs/AreaMakerPlugin/Controller.js +151 -78
  9. package/libs/AreaMakerPlugin/index.js +77 -4
  10. package/libs/AreaMakerPlugin/utils/Item.js +191 -111
  11. package/libs/CSS3DRenderPlugin/Controller.js +90 -29
  12. package/libs/CSS3DRenderPlugin/index.js +76 -15
  13. package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +133 -58
  14. package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +182 -116
  15. package/libs/CruisePlugin/BaseController.js +122 -49
  16. package/libs/CruisePlugin/Move.js +74 -21
  17. package/libs/CruisePlugin/Work.js +99 -46
  18. package/libs/CruisePlugin/index.js +80 -27
  19. package/libs/CurrentPanoImagePlugin/Controller.js +177 -104
  20. package/libs/CurrentPanoImagePlugin/index.js +77 -4
  21. package/libs/GuideLinePlugin/Controller.js +79 -26
  22. package/libs/GuideLinePlugin/GuideLineItem.js +83 -30
  23. package/libs/GuideLinePlugin/GuideLineModeItem/index.js +3 -2
  24. package/libs/GuideLinePlugin/GuideLineModeItem.js +82 -29
  25. package/libs/GuideLinePlugin/index.js +80 -27
  26. package/libs/ModelMakerPlugin/Controller.js +140 -82
  27. package/libs/ModelMakerPlugin/index.js +76 -18
  28. package/libs/ModelTVVideoPlugin/Plugin.js +118 -57
  29. package/libs/ModelTVVideoPlugin/index.js +69 -8
  30. package/libs/Object3DHelperPlugin/Controller.js +67 -43
  31. package/libs/Object3DHelperPlugin/index.js +36 -13
  32. package/libs/PanoCompassPlugin/Controller.js +98 -42
  33. package/libs/PanoCompassPlugin/index.js +72 -16
  34. package/libs/PanoDoorLabelPlugin/BaseController.js +99 -26
  35. package/libs/PanoDoorLabelPlugin/Controller.js +188 -115
  36. package/libs/PanoDoorLabelPlugin/index.js +77 -4
  37. package/libs/PanoMeasurePlugin/Components/Controller0.js +141 -88
  38. package/libs/PanoMeasurePlugin/Components/Controller1.js +179 -126
  39. package/libs/PanoMeasurePlugin/Controller/EditController.js +125 -72
  40. package/libs/PanoMeasurePlugin/Controller/WatchController.js +168 -92
  41. package/libs/PanoMeasurePlugin/Controller/index.js +110 -64
  42. package/libs/PanoMeasurePlugin/Model/area.js +115 -38
  43. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +79 -0
  44. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +98 -45
  45. package/libs/PanoMeasurePlugin/index.js +77 -31
  46. package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +99 -20
  47. package/libs/PanoSpatialTagPlugin/Plugin.js +211 -150
  48. package/libs/PanoSpatialTagPlugin/index.js +67 -6
  49. package/libs/PanoTagPlugin/Components/Common/TagPoint.js +149 -68
  50. package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +296 -216
  51. package/libs/PanoTagPlugin/Components/Tag/index.js +258 -187
  52. package/libs/PanoTagPlugin/Components/TagContainer.js +158 -87
  53. package/libs/PanoTagPlugin/Components/TagItem.js +145 -74
  54. package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +133 -62
  55. package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +110 -39
  56. package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +106 -35
  57. package/libs/PanoTagPlugin/controller/Tag/PointTag.js +114 -43
  58. package/libs/PanoTagPlugin/controller/TagRender.js +133 -80
  59. package/libs/PanoTagPlugin/controller/TagUtil.js +137 -84
  60. package/libs/PanoTagPlugin/controller/index.js +114 -61
  61. package/libs/PanoTagPlugin/index.js +90 -37
  62. package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +122 -41
  63. package/libs/PanoVideoPlugin/Controller.js +138 -65
  64. package/libs/PanoVideoPlugin/VideoMeshController.js +150 -69
  65. package/libs/PanoVideoPlugin/index.js +83 -10
  66. package/libs/PipelinePlugin/Controller.js +200 -128
  67. package/libs/PipelinePlugin/index.js +77 -5
  68. package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +103 -22
  69. package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +96 -15
  70. package/libs/PipelinePlugin/utils/Objects/Pipe.js +137 -56
  71. package/libs/Sculpt/Meshes/Box.js +6 -5
  72. package/libs/Sculpt/Meshes/Cylinder.js +7 -6
  73. package/libs/Sculpt/Meshes/Line.d.ts +6 -1
  74. package/libs/Sculpt/Meshes/Line.js +80 -57
  75. package/libs/Sculpt/Meshes/Point.js +6 -5
  76. package/libs/Sculpt/Meshes/Polyline.js +5 -4
  77. package/libs/Sculpt/Meshes/Rectangle.js +3 -2
  78. package/libs/Sculpt/Objects/Base/index.js +20 -17
  79. package/libs/Sculpt/Objects/Line/Editor.js +11 -10
  80. package/libs/Sculpt/utils/removeAllTag.d.ts +2 -0
  81. package/libs/Sculpt/utils/removeAllTag.js +10 -0
  82. package/libs/Sculpt/utils/three/ColoredMesh.js +14 -13
  83. package/libs/base/BasePlugin.js +14 -13
  84. package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +129 -59
  85. package/libs/floorplan/MapviewFloorplanPlugin/index.js +76 -6
  86. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +130 -59
  87. package/libs/floorplan/ModelFloorplanPlugin/index.js +76 -5
  88. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +159 -86
  89. package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +77 -4
  90. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +152 -81
  91. package/libs/floorplan/TopviewFloorplanPlugin/index.js +76 -5
  92. package/libs/floorplan/index.js +1 -0
  93. package/libs/index.js +193 -192
  94. package/libs/shared-utils/five/index.js +3 -2
  95. package/libs/shared-utils/five/lookObject.js +3 -2
  96. package/libs/shared-utils/logger.js +1 -1
  97. package/libs/shared-utils/tag.d.ts +6 -3
  98. package/libs/shared-utils/tag.js +38 -24
  99. package/libs/shared-utils/three/index.js +1 -0
  100. package/package.json +1 -1
@@ -1,38 +1,111 @@
1
- var f = Object.defineProperty, b = Object.defineProperties;
2
- var m = Object.getOwnPropertyDescriptors;
3
- var c = Object.getOwnPropertySymbols;
1
+ var g = Object.defineProperty, f = Object.defineProperties;
2
+ var b = Object.getOwnPropertyDescriptors;
3
+ var d = Object.getOwnPropertySymbols;
4
4
  var M = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
5
- var l = (o, t, e) => t in o ? f(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, a = (o, t) => {
6
- for (var e in t || (t = {}))
7
- M.call(t, e) && l(o, e, t[e]);
8
- if (c)
9
- for (var e of c(t))
10
- W.call(t, e) && l(o, e, t[e]);
11
- return o;
12
- }, d = (o, t) => b(o, m(t));
13
- var s = (o, t, e) => (l(o, typeof t != "symbol" ? t + "" : t, e), e);
14
- import { VideoMeshController as p } from "./VideoMeshController.js";
5
+ var p = (e, i, r) => i in e ? g(e, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[i] = r, l = (e, i) => {
6
+ for (var r in i || (i = {}))
7
+ M.call(i, r) && p(e, r, i[r]);
8
+ if (d)
9
+ for (var r of d(i))
10
+ W.call(i, r) && p(e, r, i[r]);
11
+ return e;
12
+ }, m = (e, i) => f(e, b(i));
13
+ var s = (e, i, r) => (p(e, typeof i != "symbol" ? i + "" : i, r), r);
14
+ import { VideoMeshController as h } from "./VideoMeshController.js";
15
15
  import { Controller as _ } from "../base/BasePlugin.js";
16
16
  import "./utils/shader.js";
17
17
  import "three";
18
18
  import "hammerjs";
19
19
  import "three/examples/jsm/renderers/CSS3DRenderer";
20
20
  import "@realsee/five/line";
21
+ import "../Sculpt/utils/Modules/Global.js";
22
+ import "../Sculpt/utils/Modules/Cursor.js";
23
+ import "../Object3DHelperPlugin/Controller.js";
21
24
  import "../shared-utils/three/THREESphere.js";
25
+ import "../shared-utils/Object3DHelper/Helper/MoveHelper.js";
26
+ import "../shared-utils/Object3DHelper/Base/BaseHelper.js";
27
+ import "../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
28
+ import "../shared-utils/three/IObject3D.js";
29
+ import "../shared-utils/three/boundingBox.js";
30
+ import "../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
31
+ import "../shared-utils/Object3DHelper/utils/direction.js";
32
+ import "../shared-utils/Object3DHelper/Constants/color.js";
33
+ import "../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
34
+ import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
35
+ import "../shared-utils/positionToVector3.js";
36
+ import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
37
+ import "../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
38
+ import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
39
+ import "../CSS3DRenderPlugin/utils/even.js";
40
+ import "../shared-utils/Subscribe.js";
41
+ import "../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
42
+ import "../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
43
+ import "../shared-utils/three/centerPoint.js";
44
+ import "../shared-utils/three/getObjectVisible.js";
22
45
  import "animejs";
23
- import "../shared-utils/animationFrame/index.js";
46
+ import "../shared-utils/isNil.js";
24
47
  import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
25
- import "./utils/index.js";
26
- import "../shared-utils/Subscribe.js";
27
48
  import "../shared-utils/Utils/FiveUtil.js";
28
49
  import "../shared-utils/Utils/BaseUtil.js";
29
50
  import "../shared-utils/Utils/WorkUtil.js";
30
51
  import "../shared-utils/five/transformPosition.js";
31
52
  import "../shared-utils/five/getFiveModel.js";
32
53
  import "../shared-utils/url/absoluteUrl.js";
33
- class F extends _ {
34
- constructor(e) {
35
- super(e);
54
+ import "../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
55
+ import "../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
56
+ import "../shared-utils/util.js";
57
+ import "../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
58
+ import "../shared-utils/Object3DHelper/Helper/RotateHelper.js";
59
+ import "../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
60
+ import "../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
61
+ import "../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
62
+ import "../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
63
+ import "../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
64
+ import "../shared-utils/Object3DHelper/Controller/MoveController.js";
65
+ import "../shared-utils/Object3DHelper/Base/BaseController.js";
66
+ import "../shared-utils/threex/domevents/index.js";
67
+ import "../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
68
+ import "../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
69
+ import "../Sculpt/utils/three/rayOnLine.js";
70
+ import "../Object3DHelperPlugin/FiveControllerWrapper.js";
71
+ import "../shared-utils/Object3DHelper/index.js";
72
+ import "../shared-utils/Object3DHelper/Controller/RotateController.js";
73
+ import "../shared-utils/math/rad2Deg.js";
74
+ import "../shared-utils/math/deg2Rad.js";
75
+ import "../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
76
+ import "../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
77
+ import "../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
78
+ import "../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
79
+ import "../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
80
+ import "../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
81
+ import "../shared-utils/Object3DHelper/Controller/ScaleController.js";
82
+ import "../shared-utils/five/fiveModelLoad.js";
83
+ import "../shared-utils/five/FiveDomEvents.js";
84
+ import "../shared-utils/five/calculateThreeMouse.js";
85
+ import "../shared-utils/three/THREERaycaster.js";
86
+ import "../shared-utils/three/PointSelector/index.js";
87
+ import "../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
88
+ import "../shared-utils/three/Magnifier.js";
89
+ import "../shared-utils/three/PointSelector/utils/PointHelper.js";
90
+ import "../shared-utils/three/Assets/index.js";
91
+ import "../shared-utils/three/PointSelector/utils/html.js";
92
+ import "../shared-utils/five/initialCSS3DRender.js";
93
+ import "../shared-utils/three/PointSelector/utils/PointHelper2.js";
94
+ import "../Sculpt/Meshes/Line.js";
95
+ import "../Sculpt/typings/style.js";
96
+ import "../shared-utils/five/FiveLine.js";
97
+ import "../shared-utils/tag.js";
98
+ import "../shared-utils/five/vector3ToScreen.js";
99
+ import "../Sculpt/utils/removeAllTag.js";
100
+ import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
101
+ import "../shared-utils/isTouchDevice.js";
102
+ import "../shared-utils/five/getPosition.js";
103
+ import "../shared-utils/five/getRaycasterByNdcPosition.js";
104
+ import "../shared-utils/animationFrame/index.js";
105
+ import "./utils/index.js";
106
+ class st extends _ {
107
+ constructor(r) {
108
+ super(r);
36
109
  s(this, "controllerMap", /* @__PURE__ */ new Map());
37
110
  s(this, "data");
38
111
  s(this, "enabled", !0);
@@ -49,58 +122,58 @@ class F extends _ {
49
122
  return this._disposed;
50
123
  }
51
124
  /** 加载点位视频数据,加载数据并不代表会加载点位视频。 */
52
- load(e, r) {
53
- var i;
125
+ load(r, t) {
126
+ var o;
54
127
  if (this.disposed)
55
128
  return this.logWarning("插件已被销毁");
56
- typeof ((i = r == null ? void 0 : r.initialState) == null ? void 0 : i.enabled) != "undefined" && r.initialState.enabled !== this.enabled && (r.initialState.enabled ? this.enable() : this.disable()), e.list.forEach((n) => {
57
- const u = n.pano_index, g = n.render_id;
58
- n.video_list.forEach((h) => {
129
+ typeof ((o = t == null ? void 0 : t.initialState) == null ? void 0 : o.enabled) != "undefined" && t.initialState.enabled !== this.enabled && (t.initialState.enabled ? this.enable() : this.disable()), r.list.forEach((n) => {
130
+ const c = n.pano_index, u = n.render_id;
131
+ n.video_list.forEach((a) => {
59
132
  this.controllerMap.set(
60
- h.render_id,
61
- new p(this.five, d(a({}, h), {
62
- panoIndex: u,
63
- renderID: g,
133
+ a.render_id,
134
+ new h(this.five, m(l({}, a), {
135
+ panoIndex: c,
136
+ renderID: u,
64
137
  hooks: this.hooks,
65
138
  initialState: { enabled: this.enabled }
66
139
  }))
67
140
  );
68
141
  });
69
- }), this.data = e, this.hooks.emit("dataLoaded", e);
142
+ }), this.data = r, this.hooks.emit("dataLoaded", r);
70
143
  }
71
144
  /** 开启插件功能。 */
72
- enable(e) {
73
- var i;
145
+ enable(r) {
146
+ var o;
74
147
  if (this.disposed)
75
148
  return this.logWarning("插件已被销毁");
76
149
  if (this.enabled)
77
150
  return;
78
151
  this.enabled = !0, Array.from(this.controllerMap.values()).forEach((n) => n.enable());
79
- const r = (i = e == null ? void 0 : e.userAction) != null ? i : !0;
80
- this.hooks.emit("enable", { userAction: r });
152
+ const t = (o = r == null ? void 0 : r.userAction) != null ? o : !0;
153
+ this.hooks.emit("enable", { userAction: t });
81
154
  }
82
155
  /** 禁用插件功能。 */
83
- disable(e) {
84
- var i;
156
+ disable(r) {
157
+ var o;
85
158
  if (this.disposed)
86
159
  return this.logWarning("插件已被销毁");
87
160
  if (!this.enabled)
88
161
  return;
89
162
  this.enabled = !1, Array.from(this.controllerMap.values()).forEach((n) => n.disable());
90
- const r = (i = e == null ? void 0 : e.userAction) != null ? i : !0;
91
- this.hooks.emit("disable", { userAction: r });
163
+ const t = (o = r == null ? void 0 : r.userAction) != null ? o : !0;
164
+ this.hooks.emit("disable", { userAction: t });
92
165
  }
93
166
  /** 看向某个视频。
94
167
  * - 会自动切换到全景模式。
95
168
  * - 如果遇到不能自动播放的问题,需要放到用户交互事件中调用。
96
169
  */
97
- lookAtVideoItemByRenderID(e) {
170
+ lookAtVideoItemByRenderID(r) {
98
171
  if (this.disposed)
99
172
  return this.logWarning("插件已被销毁");
100
- const r = this.controllerMap.get(e);
101
- if (!r)
102
- return this.logWarning(`ID 为 ${e} 的点位视频不存在`);
103
- r.lookAtVideo();
173
+ const t = this.controllerMap.get(r);
174
+ if (!t)
175
+ return this.logWarning(`ID 为 ${r} 的点位视频不存在`);
176
+ t.lookAtVideo();
104
177
  }
105
178
  /**
106
179
  * 取消静音。
@@ -118,26 +191,26 @@ class F extends _ {
118
191
  * }}
119
192
  * ```
120
193
  */
121
- unmuteByRenderID(e) {
194
+ unmuteByRenderID(r) {
122
195
  if (this.disposed)
123
196
  return this.logWarning("插件已被销毁");
124
- const r = this.controllerMap.get(e);
125
- if (!r)
126
- return this.logWarning(`ID 为 ${e} 的点位视频不存在`);
127
- r.unmute();
197
+ const t = this.controllerMap.get(r);
198
+ if (!t)
199
+ return this.logWarning(`ID 为 ${r} 的点位视频不存在`);
200
+ t.unmute();
128
201
  }
129
202
  /** 为一个点位添加视频(可以是多条)。 */
130
- add(e, r) {
203
+ add(r, t) {
131
204
  if (this.disposed)
132
205
  return this.logWarning("插件已被销毁");
133
- r.forEach((i) => {
134
- if (this.controllerMap.get(i.render_id))
135
- return this.logWarning(`ID 为 ${i.render_id} 的点位视频已存在`);
136
- const n = i.render_id;
206
+ t.forEach((o) => {
207
+ if (this.controllerMap.get(o.render_id))
208
+ return this.logWarning(`ID 为 ${o.render_id} 的点位视频已存在`);
209
+ const n = o.render_id;
137
210
  this.controllerMap.set(
138
- i.render_id,
139
- new p(this.five, d(a({}, i), {
140
- panoIndex: e,
211
+ o.render_id,
212
+ new h(this.five, m(l({}, o), {
213
+ panoIndex: r,
141
214
  renderID: n,
142
215
  hooks: this.hooks,
143
216
  initialState: { enabled: this.enabled }
@@ -146,32 +219,32 @@ class F extends _ {
146
219
  });
147
220
  }
148
221
  /** 根据 VideoItem render_id 删除某个视频。 */
149
- removeByRenderID(e) {
222
+ removeByRenderID(r) {
150
223
  if (this.disposed)
151
224
  return this.logWarning("插件已被销毁");
152
- const r = this.controllerMap.get(e);
153
- if (!r)
154
- return this.logWarning(`ID 为 ${e} 的点位视频不存在`);
155
- r.dispose(), this.controllerMap.delete(e);
225
+ const t = this.controllerMap.get(r);
226
+ if (!t)
227
+ return this.logWarning(`ID 为 ${r} 的点位视频不存在`);
228
+ t.dispose(), this.controllerMap.delete(r);
156
229
  }
157
230
  /** 清空现有数据 */
158
231
  clear() {
159
232
  if (this.disposed)
160
233
  return this.logWarning("插件已被销毁");
161
- Array.from(this.controllerMap.values()).forEach((e) => e.dispose()), this.controllerMap.clear();
234
+ Array.from(this.controllerMap.values()).forEach((r) => r.dispose()), this.controllerMap.clear();
162
235
  }
163
236
  /** 销毁插件 */
164
237
  dispose() {
165
238
  if (this.disposed)
166
239
  return this.logWarning("插件已被销毁");
167
- this._disposed = !0, Array.from(this.controllerMap.values()).forEach((e) => e.dispose()), this.controllerMap.clear();
240
+ this._disposed = !0, Array.from(this.controllerMap.values()).forEach((r) => r.dispose()), this.controllerMap.clear();
168
241
  }
169
242
  /** 控制台打印警告 */
170
243
  // TODO: 全局函数 curry 化
171
- logWarning(e) {
172
- console.warn("⛔ ==> [PanoVideoPluginController]:", e);
244
+ logWarning(r) {
245
+ console.warn("⛔ ==> [PanoVideoPluginController]:", r);
173
246
  }
174
247
  }
175
248
  export {
176
- F as PanoVideoPluginController
249
+ st as PanoVideoPluginController
177
250
  };
@@ -1,19 +1,100 @@
1
1
  var g = Object.defineProperty;
2
- var I = (v, e, i) => e in v ? g(v, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : v[e] = i;
3
- var t = (v, e, i) => (I(v, typeof e != "symbol" ? e + "" : e, i), i);
2
+ var I = (v, i, e) => i in v ? g(v, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : v[i] = e;
3
+ var t = (v, i, e) => (I(v, typeof i != "symbol" ? i + "" : i, e), e);
4
4
  import { vertexShader as M, fragmentShader as P } from "./utils/shader.js";
5
- import { VideoTexture as F, LinearFilter as m, ShaderMaterial as y, Vector4 as x, SphereBufferGeometry as L, Mesh as V, Vector3 as l, Quaternion as b } from "three";
5
+ import { VideoTexture as F, LinearFilter as c, ShaderMaterial as y, Vector4 as x, SphereBufferGeometry as L, Mesh as V, Vector3 as m, Quaternion as b } from "three";
6
6
  import "hammerjs";
7
7
  import "three/examples/jsm/renderers/CSS3DRenderer";
8
8
  import "@realsee/five/line";
9
+ import "../Sculpt/utils/Modules/Global.js";
9
10
  import "../shared-utils/three/THREESphere.js";
10
11
  import A from "animejs";
11
12
  import { requestAnimationFrameInterval as D } from "../shared-utils/animationFrame/index.js";
12
13
  import E from "./utils/index.js";
14
+ import "../Sculpt/utils/Modules/Cursor.js";
15
+ import "../Object3DHelperPlugin/Controller.js";
16
+ import "../base/BasePlugin.js";
17
+ import "../shared-utils/Subscribe.js";
18
+ import "../shared-utils/Utils/FiveUtil.js";
19
+ import "../shared-utils/Utils/BaseUtil.js";
20
+ import "../shared-utils/Utils/WorkUtil.js";
21
+ import "../shared-utils/five/transformPosition.js";
22
+ import "../shared-utils/five/getFiveModel.js";
23
+ import "../shared-utils/url/absoluteUrl.js";
13
24
  import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
14
- class z {
25
+ import "../shared-utils/Object3DHelper/Helper/MoveHelper.js";
26
+ import "../shared-utils/Object3DHelper/Base/BaseHelper.js";
27
+ import "../shared-utils/Object3DHelper/utils/setObjectQuaternion.js";
28
+ import "../shared-utils/three/IObject3D.js";
29
+ import "../shared-utils/three/boundingBox.js";
30
+ import "../shared-utils/Object3DHelper/Helper/Objects/ArrowGroup.js";
31
+ import "../shared-utils/Object3DHelper/utils/direction.js";
32
+ import "../shared-utils/Object3DHelper/Constants/color.js";
33
+ import "../shared-utils/Object3DHelper/utils/calculateScaleByCamera.js";
34
+ import "../CSS3DRenderPlugin/utils/three/CSS3DRender.js";
35
+ import "../shared-utils/positionToVector3.js";
36
+ import "../CSS3DRenderPlugin/utils/three/CSS3DRenderer.js";
37
+ import "../CSS3DRenderPlugin/utils/three/THREEJS_CSS3DRenderer.js";
38
+ import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
39
+ import "../CSS3DRenderPlugin/utils/even.js";
40
+ import "../CSS3DRenderPlugin/utils/three/CSS3DObject.js";
41
+ import "../CSS3DRenderPlugin/utils/three/OpacityMesh.js";
42
+ import "../shared-utils/three/centerPoint.js";
43
+ import "../shared-utils/three/getObjectVisible.js";
44
+ import "../shared-utils/isNil.js";
45
+ import "../CSS3DRenderPlugin/utils/three/CSS3DScene.js";
46
+ import "../CSS3DRenderPlugin/utils/getAllCSS3DObject.js";
47
+ import "../shared-utils/util.js";
48
+ import "../CSS3DRenderPlugin/utils/three/CSS3DGroup.js";
49
+ import "../shared-utils/Object3DHelper/Helper/RotateHelper.js";
50
+ import "../shared-utils/Object3DHelper/Helper/HTML/tipsDom.js";
51
+ import "../shared-utils/Object3DHelper/Helper/HTML/utils/createElement.js";
52
+ import "../shared-utils/Object3DHelper/Helper/CSS3DScaleHelper.js";
53
+ import "../shared-utils/Object3DHelper/Helper/HTML/rectangleScaleDom.js";
54
+ import "../shared-utils/Object3DHelper/Helper/BoundingBoxHelper.js";
55
+ import "../shared-utils/Object3DHelper/Controller/MoveController.js";
56
+ import "../shared-utils/Object3DHelper/Base/BaseController.js";
57
+ import "../shared-utils/threex/domevents/index.js";
58
+ import "../shared-utils/Object3DHelper/utils/getMouseRaycaster.js";
59
+ import "../shared-utils/Object3DHelper/utils/calculateThreeMouse.js";
60
+ import "../Sculpt/utils/three/rayOnLine.js";
61
+ import "../Object3DHelperPlugin/FiveControllerWrapper.js";
62
+ import "../shared-utils/Object3DHelper/index.js";
63
+ import "../shared-utils/Object3DHelper/Controller/RotateController.js";
64
+ import "../shared-utils/math/rad2Deg.js";
65
+ import "../shared-utils/math/deg2Rad.js";
66
+ import "../shared-utils/Object3DHelper/Controller/CSS3DScaleController.js";
67
+ import "../shared-utils/Object3DHelper/Controller/RectangleScaleController.js";
68
+ import "../shared-utils/Object3DHelper/utils/vectorIsEqual.js";
69
+ import "../CSS3DRenderPlugin/utils/generateBehindFiveElement.js";
70
+ import "../shared-utils/Object3DHelper/Controller/BoundingBoxController.js";
71
+ import "../shared-utils/Object3DHelper/Helper/ScaleHelper.js";
72
+ import "../shared-utils/Object3DHelper/Controller/ScaleController.js";
73
+ import "../shared-utils/five/fiveModelLoad.js";
74
+ import "../shared-utils/five/FiveDomEvents.js";
75
+ import "../shared-utils/five/calculateThreeMouse.js";
76
+ import "../shared-utils/three/THREERaycaster.js";
77
+ import "../shared-utils/three/PointSelector/index.js";
78
+ import "../shared-utils/three/PointSelector/utils/PointSelectorHelper.js";
79
+ import "../shared-utils/three/Magnifier.js";
80
+ import "../shared-utils/three/PointSelector/utils/PointHelper.js";
81
+ import "../shared-utils/three/Assets/index.js";
82
+ import "../shared-utils/three/PointSelector/utils/html.js";
83
+ import "../shared-utils/five/initialCSS3DRender.js";
84
+ import "../shared-utils/three/PointSelector/utils/PointHelper2.js";
85
+ import "../Sculpt/Meshes/Line.js";
86
+ import "../Sculpt/typings/style.js";
87
+ import "../shared-utils/five/FiveLine.js";
88
+ import "../shared-utils/tag.js";
89
+ import "../shared-utils/five/vector3ToScreen.js";
90
+ import "../Sculpt/utils/removeAllTag.js";
91
+ import "../CSS3DRenderPlugin/utils/three/CSS3DSprite.js";
92
+ import "../shared-utils/isTouchDevice.js";
93
+ import "../shared-utils/five/getPosition.js";
94
+ import "../shared-utils/five/getRaycasterByNdcPosition.js";
95
+ class le {
15
96
  /** 初始化视频、模型以及相关事件监听。 */
16
- constructor(e, i) {
97
+ constructor(i, e) {
17
98
  t(this, "video");
18
99
  t(this, "_id");
19
100
  /** 视频资源地址 */
@@ -49,75 +130,75 @@ class z {
49
130
  this.video.muted = !1;
50
131
  });
51
132
  /** 把 uv 值转换成位置 */
52
- t(this, "uv2Position", (e, i) => {
53
- var p;
54
- const n = Math.PI, a = Math.PI * 2, d = e, s = 1 - i, r = new l(
55
- -1 * Math.cos(a * d) * Math.sin(n * s),
56
- 1 * Math.cos(n * s),
57
- 1 * Math.sin(a * d) * Math.sin(n * s)
133
+ t(this, "uv2Position", (i, e) => {
134
+ var f;
135
+ const o = Math.PI, a = Math.PI * 2, d = i, s = 1 - e, r = new m(
136
+ -1 * Math.cos(a * d) * Math.sin(o * s),
137
+ 1 * Math.cos(o * s),
138
+ 1 * Math.sin(a * d) * Math.sin(o * s)
58
139
  );
59
140
  r.setX(-r.x);
60
- const h = (p = this.five.work) == null ? void 0 : p.observers[this.panoIndex];
141
+ const h = (f = this.five.work) == null ? void 0 : f.observers[this.panoIndex];
61
142
  if (!h)
62
143
  return this.logWarning(`点位 ${this.panoIndex} 不存在,请检查 Five 数据是否正常。`);
63
- const f = h.position.clone(), c = h.quaternion.clone(), u = r.clone();
64
- return u.applyAxisAngle(new l(0, 1, 0), Math.PI / 2), u.applyQuaternion(c), u.add(f), u;
144
+ const u = h.position.clone(), l = h.quaternion.clone(), p = r.clone();
145
+ return p.applyAxisAngle(new m(0, 1, 0), Math.PI / 2), p.applyQuaternion(l), p.add(u), p;
65
146
  });
66
147
  /** Five 数据加载后需要根据点位位姿调整点位模型位置 */
67
148
  t(this, "onFiveDataLoaded", () => {
68
149
  var r;
69
- const e = (r = this.five.work) == null ? void 0 : r.observers[this.panoIndex];
70
- if (!e)
150
+ const i = (r = this.five.work) == null ? void 0 : r.observers[this.panoIndex];
151
+ if (!i)
71
152
  return this.logWarning(`点位 ${this.panoIndex} 不存在,请检查 Five 数据是否正常。`);
72
- this.observer = e;
73
- const { x: i, y: o, z: n, w: a } = e.quaternion, d = new b(i, o, n, a), s = e.position;
74
- this.videoMesh.position.fromArray([s.x, s.y, s.z]), this.videoMesh.quaternion.set(0, 0, 0, 1), this.videoMesh.rotateOnAxis(new l(0, 1, 0), Math.PI / 2), this.videoMesh.applyQuaternion(d);
153
+ this.observer = i;
154
+ const { x: e, y: n, z: o, w: a } = i.quaternion, d = new b(e, n, o, a), s = i.position;
155
+ this.videoMesh.position.fromArray([s.x, s.y, s.z]), this.videoMesh.quaternion.set(0, 0, 0, 1), this.videoMesh.rotateOnAxis(new m(0, 1, 0), Math.PI / 2), this.videoMesh.applyQuaternion(d);
75
156
  });
76
157
  /** 兼容视频播放 */
77
- t(this, "onFiveWantsMoveToPano", (e) => {
78
- e === this.panoIndex && (this.hasVideoEverPlayed || this.video.play().catch(() => {
158
+ t(this, "onFiveWantsMoveToPano", (i) => {
159
+ i === this.panoIndex && (this.hasVideoEverPlayed || this.video.play().catch(() => {
79
160
  }));
80
161
  });
81
162
  /** 走到某个点位上时,挂载/卸载视频 */
82
- t(this, "onFivePanoArrived", (e) => {
163
+ t(this, "onFivePanoArrived", (i) => {
83
164
  if (this.disposed)
84
165
  return this.logWarning("实例已被销毁");
85
- this.enabled && this.panoIndex === e && this.mount();
166
+ this.enabled && this.panoIndex === i && this.mount();
86
167
  });
87
- t(this, "onFivePanoWillArrive", (e) => {
88
- if (e !== this.panoIndex)
168
+ t(this, "onFivePanoWillArrive", (i) => {
169
+ if (i !== this.panoIndex)
89
170
  return this.unmount();
90
- this.panoIndex !== e && this.unmount();
171
+ this.panoIndex !== i && this.unmount();
91
172
  });
92
173
  /** Five 模型变化 */
93
- t(this, "onFiveModeChange", (e) => {
94
- e !== "Panorama" && this.hide();
174
+ t(this, "onFiveModeChange", (i) => {
175
+ i !== "Panorama" && this.hide();
95
176
  });
96
177
  /** Five mode change 动画结束 */
97
178
  t(this, "onFiveInitAnimationEnded", () => {
98
- const e = this.five.getCurrentState();
99
- e.mode === "Panorama" && e.panoIndex === this.panoIndex && this.mount();
179
+ const i = this.five.getCurrentState();
180
+ i.mode === "Panorama" && i.panoIndex === this.panoIndex && this.mount();
100
181
  });
101
182
  /** Five Canvas 点击 */
102
- t(this, "onFiveWantsTapGesture", (e) => {
183
+ t(this, "onFiveWantsTapGesture", (i) => {
103
184
  if (!this.five.scene.children.includes(this.videoMesh))
104
185
  return;
105
186
  if (this.disposed)
106
187
  return this.logWarning("实例已被销毁");
107
188
  if (!this.enabled)
108
189
  return this.logWarning("实例已被禁用");
109
- const [i] = e.intersectObject(this.videoMesh);
110
- if (!i)
190
+ const [e] = i.intersectObject(this.videoMesh);
191
+ if (!e)
111
192
  return;
112
- if (this.checkIntersectionInBounding(this.origin, i)) {
113
- const n = {
193
+ if (this.checkIntersectionInBounding(this.origin, e)) {
194
+ const o = {
114
195
  target: this,
115
196
  _preventDefaultReturn: !1,
116
197
  preventDefault: () => {
117
- n._preventDefaultReturn = !0;
198
+ o._preventDefaultReturn = !0;
118
199
  }
119
200
  };
120
- return this.hooks.emit("click", n), n._preventDefaultReturn === !1 && (this.video.muted = !this.video.muted), !1;
201
+ return this.hooks.emit("click", o), o._preventDefaultReturn === !1 && (this.video.muted = !this.video.muted), !1;
121
202
  }
122
203
  });
123
204
  /** video canplaythrough 事件触发 */
@@ -146,16 +227,16 @@ class z {
146
227
  if (this.enabled && this.panoIndex === this.five.getCurrentState().panoIndex && this.five.getCurrentState().mode === "Panorama" && (this.renderFiveDisposer || (this.renderFiveDisposer = D(() => {
147
228
  this.five.needsRender = !0;
148
229
  }, 30)), this.five.scene.add(this.videoMesh), this.videoMesh.material.uniforms.opacity.value === 0)) {
149
- const e = {
230
+ const i = {
150
231
  value: 0
151
232
  };
152
233
  A({
153
- targets: e,
234
+ targets: i,
154
235
  value: 1,
155
236
  duration: 300,
156
237
  easing: "linear",
157
238
  update: () => {
158
- this.videoMesh.material.uniforms.opacity.value = e.value;
239
+ this.videoMesh.material.uniforms.opacity.value = i.value;
159
240
  },
160
241
  complete: () => {
161
242
  this.videoMesh.material.uniforms.opacity.value = 1;
@@ -168,20 +249,20 @@ class z {
168
249
  });
169
250
  /** video pause 事件触发 */
170
251
  t(this, "onVideoPaused", () => {
171
- var e;
172
- (e = this.renderFiveDisposer) == null || e.call(this), this.renderFiveDisposer = void 0;
252
+ var i;
253
+ (i = this.renderFiveDisposer) == null || i.call(this), this.renderFiveDisposer = void 0;
173
254
  });
174
255
  var r, h;
175
- this.five = e, this.panoIndex = i.panoIndex, this._id = i.renderID, this.url = i.url, this.origin = i.origin.slice(), this.hooks = i.hooks, this._enabled = (h = (r = i.initialState) == null ? void 0 : r.enabled) != null ? h : !0;
176
- const o = document.createElement("video");
177
- o.crossOrigin = "anonymous", o.autoplay = !1, o.muted = !0, o.loop = !0, o.playsInline = !0, this.video = o;
178
- const n = new F(this.video);
179
- n.minFilter = m, n.magFilter = m;
256
+ this.five = i, this.panoIndex = e.panoIndex, this._id = e.renderID, this.url = e.url, this.origin = e.origin.slice(), this.hooks = e.hooks, this._enabled = (h = (r = e.initialState) == null ? void 0 : r.enabled) != null ? h : !0;
257
+ const n = document.createElement("video");
258
+ n.crossOrigin = "anonymous", n.autoplay = !1, n.muted = !0, n.loop = !0, n.playsInline = !0, this.video = n;
259
+ const o = new F(this.video);
260
+ o.minFilter = c, o.magFilter = c;
180
261
  const a = new y({
181
262
  vertexShader: M,
182
263
  fragmentShader: P,
183
264
  uniforms: {
184
- map: { value: n },
265
+ map: { value: o },
185
266
  size: {
186
267
  value: new x(this.origin[0], 1 - this.origin[1] - this.origin[3], this.origin[2], this.origin[3])
187
268
  },
@@ -223,21 +304,21 @@ class z {
223
304
  lookAtVideo() {
224
305
  if (!this.observer)
225
306
  return;
226
- const e = this.getUVCenter();
227
- if (!e)
228
- return;
229
- const i = this.uv2Position(e[0], e[1]);
307
+ const i = this.getUVCenter();
230
308
  if (!i)
231
309
  return;
232
- const o = new l().subVectors(i, this.observer.position).normalize(), { longitude: n, latitude: a } = E(o);
233
- this.five.setState({ panoIndex: this.panoIndex, longitude: n, latitude: a }), this.onFiveWantsMoveToPano(this.panoIndex);
310
+ const e = this.uv2Position(i[0], i[1]);
311
+ if (!e)
312
+ return;
313
+ const n = new m().subVectors(e, this.observer.position).normalize(), { longitude: o, latitude: a } = E(n);
314
+ this.five.setState({ panoIndex: this.panoIndex, longitude: o, latitude: a }), this.onFiveWantsMoveToPano(this.panoIndex);
234
315
  }
235
316
  /** 获取视频中心点的 uv */
236
317
  getUVCenter() {
237
318
  if (!this.origin)
238
319
  return;
239
- const e = this.origin[0] + this.origin[2] / 2, i = this.origin[1] + this.origin[3] / 2;
240
- return [e, i];
320
+ const i = this.origin[0] + this.origin[2] / 2, e = this.origin[1] + this.origin[3] / 2;
321
+ return [i, e];
241
322
  }
242
323
  /** 添加时间监听 */
243
324
  addEventListeners() {
@@ -249,8 +330,8 @@ class z {
249
330
  }
250
331
  /** 如果满足 mount 条件,mount */
251
332
  mountIfNeeded() {
252
- const e = this.five.getCurrentState();
253
- e.mode === "Panorama" && e.panoIndex === this.panoIndex && this.enabled && this.mount();
333
+ const i = this.five.getCurrentState();
334
+ i.mode === "Panorama" && i.panoIndex === this.panoIndex && this.enabled && this.mount();
254
335
  }
255
336
  /** 挂载:加载视频资源;添加模型。 */
256
337
  mount() {
@@ -258,10 +339,10 @@ class z {
258
339
  return this.logWarning("插件已经销毁,无法挂载。");
259
340
  if (this.url === "")
260
341
  return this.logWarning("视频资源不存在。");
261
- this.video.src !== this.url && (this.video.src = this.url), this.video.paused && this.video.play().catch((e) => {
262
- this.logWarning(e instanceof Error ? e.message : "视频播放失败。"), this.five.once("gesture", () => {
263
- this.video.play().catch((i) => {
264
- this.logWarning(i instanceof Error ? i.message : "自动播放视频失败。");
342
+ this.video.src !== this.url && (this.video.src = this.url), this.video.paused && this.video.play().catch((i) => {
343
+ this.logWarning(i instanceof Error ? i.message : "视频播放失败。"), this.five.once("gesture", () => {
344
+ this.video.play().catch((e) => {
345
+ this.logWarning(e instanceof Error ? e.message : "自动播放视频失败。");
265
346
  });
266
347
  });
267
348
  });
@@ -275,17 +356,17 @@ class z {
275
356
  this.video.pause(), this.videoMesh.material.uniforms.opacity.value = 0, this.five.scene.remove(this.videoMesh);
276
357
  }
277
358
  /** 控制台打印警告 */
278
- logWarning(e) {
279
- console.warn("⛔ ==> [VideoMeshController]:", e);
359
+ logWarning(i) {
360
+ console.warn("⛔ ==> [VideoMeshController]:", i);
280
361
  }
281
362
  /** 检测射线与模型的交点是不是在视频的范围内 */
282
- checkIntersectionInBounding(e, i) {
283
- if (!i.uv)
363
+ checkIntersectionInBounding(i, e) {
364
+ if (!e.uv)
284
365
  return !1;
285
- const [o, n] = i.uv.toArray(), [a, d, s, r] = e, h = 1 - d - r, f = a + s, c = h + r;
286
- return o >= a && o <= f && n >= h && n <= c;
366
+ const [n, o] = e.uv.toArray(), [a, d, s, r] = i, h = 1 - d - r, u = a + s, l = h + r;
367
+ return n >= a && n <= u && o >= h && o <= l;
287
368
  }
288
369
  }
289
370
  export {
290
- z as VideoMeshController
371
+ le as VideoMeshController
291
372
  };