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