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