@realsee/dnalogel 3.73.1-alpha.1 → 3.73.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.
- package/dist/PanoTagPlugin/controller/Tag/PlaneTag.d.ts +1 -9
- package/dist/PanoTagPlugin/utils/model/mediaPlane.d.ts +0 -4
- package/dist/index.cjs.js +47 -47
- package/dist/index.js +1903 -1969
- package/dist/index.umd.js +47 -47
- package/libs/CruisePlugin/Move.js +2 -3
- package/libs/CruisePlugin/Work.js +2 -3
- package/libs/CruisePlugin/index.js +6 -7
- package/libs/GuideLinePlugin/Controller.js +4 -5
- package/libs/GuideLinePlugin/GuideLineItem.js +2 -3
- package/libs/GuideLinePlugin/GuideLineModeItem.js +2 -3
- package/libs/GuideLinePlugin/index.js +6 -7
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.d.ts +1 -9
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +131 -179
- package/libs/PanoTagPlugin/controller/index.js +5 -6
- package/libs/PanoTagPlugin/index.js +11 -12
- package/libs/PanoTagPlugin/utils/model/mediaPlane.d.ts +0 -4
- package/libs/PanoTagPlugin/utils/model/mediaPlane.js +71 -85
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +148 -149
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +2 -2
- package/dist/shared-utils/five/getFloorMesh.d.ts +0 -3
- package/libs/shared-utils/five/getFloorMesh.d.ts +0 -3
- package/libs/shared-utils/five/getFloorMesh.js +0 -11
|
@@ -312,7 +312,6 @@ import "../../Sculpt/Editors/BoxMeshEditor.js";
|
|
|
312
312
|
import "../../Sculpt/Meshes/Box.js";
|
|
313
313
|
import "../../shared-utils/forReverseEach.js";
|
|
314
314
|
import "../../Sculpt/Objects/Line/index.js";
|
|
315
|
-
import "../../shared-utils/five/getFloorMesh.js";
|
|
316
315
|
import "../Components/TagItem.js";
|
|
317
316
|
import "../Components/Common/TagPoint.js";
|
|
318
317
|
import "../Components/Tag/AudioTag/AudioPoint.js";
|
|
@@ -329,8 +328,8 @@ import "../Components/Common/TagPopover/TagPopoverToolBar.js";
|
|
|
329
328
|
import "../Components/Common/TagPopover/ArrowRightIcon.js";
|
|
330
329
|
import "../Components/Common/TagPopover/ShareIcon.js";
|
|
331
330
|
import "../utils/popoverContainer.js";
|
|
332
|
-
const D = "Dnalogel-PanoTagPlugin",
|
|
333
|
-
class
|
|
331
|
+
const D = "Dnalogel-PanoTagPlugin", Us = (h) => `${D}--${h}`;
|
|
332
|
+
class _s extends R {
|
|
334
333
|
constructor(e, t) {
|
|
335
334
|
super(e);
|
|
336
335
|
/** state */
|
|
@@ -803,7 +802,7 @@ class Fs extends R {
|
|
|
803
802
|
}
|
|
804
803
|
}
|
|
805
804
|
export {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
805
|
+
_s as PanoTagPluginController,
|
|
806
|
+
_s as default,
|
|
807
|
+
Us as pluginFlag
|
|
809
808
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import r from "./controller/index.js";
|
|
2
|
-
import { pluginFlag as
|
|
3
|
-
import { defaultGlobalConfig as
|
|
4
|
-
import { ContentType as
|
|
2
|
+
import { pluginFlag as Ki } from "./controller/index.js";
|
|
3
|
+
import { defaultGlobalConfig as Mi } from "./typings/tag/TagConfig.js";
|
|
4
|
+
import { ContentType as Oi, DimensionType as Qi, PointType as Ri } from "./Archive/deprecated.js";
|
|
5
5
|
import "three";
|
|
6
6
|
import "../vendor/object-assign-deep/objectAssignDeep.js";
|
|
7
7
|
import "../shared-utils/positionToVector3.js";
|
|
@@ -284,7 +284,6 @@ import "../Sculpt/Editors/BoxMeshEditor.js";
|
|
|
284
284
|
import "../Sculpt/Meshes/Box.js";
|
|
285
285
|
import "../shared-utils/forReverseEach.js";
|
|
286
286
|
import "../Sculpt/Objects/Line/index.js";
|
|
287
|
-
import "../shared-utils/five/getFloorMesh.js";
|
|
288
287
|
import "./Components/TagContainer.js";
|
|
289
288
|
import "./Components/TagItem.js";
|
|
290
289
|
import "./Components/Common/TagPoint.js";
|
|
@@ -303,14 +302,14 @@ import "./Components/Common/TagPopover/ArrowRightIcon.js";
|
|
|
303
302
|
import "./Components/Common/TagPopover/ShareIcon.js";
|
|
304
303
|
import "./utils/popoverContainer.js";
|
|
305
304
|
import "../shared-utils/animationFrame/BetterTween.js";
|
|
306
|
-
const
|
|
305
|
+
const Hi = (o, t) => new r(o, t);
|
|
307
306
|
export {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
307
|
+
Oi as ContentType,
|
|
308
|
+
Qi as DimensionType,
|
|
309
|
+
Hi as PanoTagPlugin,
|
|
311
310
|
r as PanoTagPluginController,
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
311
|
+
Ri as PointType,
|
|
312
|
+
Hi as default,
|
|
313
|
+
Mi as defaultGlobalConfig,
|
|
314
|
+
Ki as pluginFlag
|
|
316
315
|
};
|
|
@@ -15,10 +15,6 @@ declare abstract class MediaPlane extends THREE.Mesh<THREE.BufferGeometry | THRE
|
|
|
15
15
|
name: string;
|
|
16
16
|
src?: string;
|
|
17
17
|
objectFit: ObjectFit;
|
|
18
|
-
/** 获取透明度 */
|
|
19
|
-
get opacity(): number;
|
|
20
|
-
/** 设置透明度 (0-1) */
|
|
21
|
-
set opacity(value: number);
|
|
22
18
|
removeFromParent(): this;
|
|
23
19
|
dispose(): void;
|
|
24
20
|
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
var _ = Object.defineProperty;
|
|
2
2
|
var G = (p, l, e) => l in p ? _(p, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : p[l] = e;
|
|
3
3
|
var r = (p, l, e) => (G(p, typeof l != "symbol" ? l + "" : l, e), e);
|
|
4
|
-
var d = (p, l, e) => new Promise((t,
|
|
5
|
-
var
|
|
4
|
+
var d = (p, l, e) => new Promise((t, s) => {
|
|
5
|
+
var i = (o) => {
|
|
6
6
|
try {
|
|
7
7
|
n(e.next(o));
|
|
8
8
|
} catch (a) {
|
|
9
|
-
|
|
9
|
+
s(a);
|
|
10
10
|
}
|
|
11
11
|
}, h = (o) => {
|
|
12
12
|
try {
|
|
13
13
|
n(e.throw(o));
|
|
14
14
|
} catch (a) {
|
|
15
|
-
|
|
15
|
+
s(a);
|
|
16
16
|
}
|
|
17
|
-
}, n = (o) => o.done ? t(o.value) : Promise.resolve(o.value).then(
|
|
17
|
+
}, n = (o) => o.done ? t(o.value) : Promise.resolve(o.value).then(i, h);
|
|
18
18
|
n((e = e.apply(p, l)).next());
|
|
19
19
|
});
|
|
20
20
|
import * as y from "three";
|
|
21
|
-
import { Vector3 as
|
|
21
|
+
import { Vector3 as T } from "three";
|
|
22
22
|
import { centerPoint as I } from "../../../shared-utils/three/centerPoint.js";
|
|
23
23
|
import { loadPicture as E } from "../../../shared-utils/three/loadTexture.js";
|
|
24
24
|
import { QuadrangleGeometry as F, QuadrangleMesh as x } from "../../../shared-utils/three/Quadrangle.js";
|
|
25
|
-
import { getVideoTexture as
|
|
26
|
-
import { Image_Play_Icon_With_Text as
|
|
25
|
+
import { getVideoTexture as j } from "../../../shared-utils/three/loadVideoTexture.js";
|
|
26
|
+
import { Image_Play_Icon_With_Text as V, Image_Play_Icon as S } from "../../Assets/Icon.js";
|
|
27
27
|
import { getPositionsByObjectFit as M } from "../../../shared-utils/three/getPositionsByObjectFit.js";
|
|
28
|
-
import { FragmentTransparencyMaterial as
|
|
28
|
+
import { FragmentTransparencyMaterial as B } from "../../../shared-utils/three/FragmentTransparencyMaterial.js";
|
|
29
29
|
import { getNormal as P } from "../../../shared-utils/three/getNormal.js";
|
|
30
|
-
import { CONST as
|
|
30
|
+
import { CONST as b } from "../../../shared-utils/constants.js";
|
|
31
31
|
import "../../../shared-utils/math/pointsIsRectangle.js";
|
|
32
32
|
import "../../../shared-utils/device.js";
|
|
33
33
|
class H extends y.Mesh {
|
|
@@ -37,20 +37,6 @@ class H extends y.Mesh {
|
|
|
37
37
|
r(this, "src");
|
|
38
38
|
r(this, "objectFit");
|
|
39
39
|
}
|
|
40
|
-
/** 获取透明度 */
|
|
41
|
-
get opacity() {
|
|
42
|
-
var e, t;
|
|
43
|
-
return (t = (e = this.material) == null ? void 0 : e.opacity) != null ? t : 1;
|
|
44
|
-
}
|
|
45
|
-
/** 设置透明度 (0-1) */
|
|
46
|
-
set opacity(e) {
|
|
47
|
-
this.material && (this.material.opacity = e, this.material.transparent = e < 1, this.material.needsUpdate = !0), this.traverse((t) => {
|
|
48
|
-
if (t.isMesh && t !== this) {
|
|
49
|
-
const i = t;
|
|
50
|
-
i.material && (i.material.opacity = e, i.material.transparent = e < 1, i.material.needsUpdate = !0);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
40
|
removeFromParent() {
|
|
55
41
|
const e = this.parent;
|
|
56
42
|
return e !== null && e.remove(this), this;
|
|
@@ -59,60 +45,60 @@ class H extends y.Mesh {
|
|
|
59
45
|
this.traverse((e) => {
|
|
60
46
|
if (e.isMesh) {
|
|
61
47
|
const t = e;
|
|
62
|
-
t.geometry.dispose(), (t.material instanceof Array ? t.material : [t.material]).forEach((
|
|
63
|
-
|
|
48
|
+
t.geometry.dispose(), (t.material instanceof Array ? t.material : [t.material]).forEach((i) => {
|
|
49
|
+
i.dispose();
|
|
64
50
|
});
|
|
65
51
|
}
|
|
66
52
|
});
|
|
67
53
|
}
|
|
68
54
|
}
|
|
69
55
|
class z extends H {
|
|
70
|
-
constructor(e, t,
|
|
56
|
+
constructor(e, t, s) {
|
|
71
57
|
var n;
|
|
72
58
|
super();
|
|
73
59
|
r(this, "name", "PanoTagPluginImagePlane");
|
|
74
60
|
r(this, "originRatio");
|
|
75
61
|
this.src = e;
|
|
76
|
-
const
|
|
62
|
+
const i = (n = s == null ? void 0 : s.resolveZFighting) != null ? n : !0;
|
|
77
63
|
let h = t;
|
|
78
|
-
if (
|
|
79
|
-
const o = P(t).multiplyScalar(
|
|
64
|
+
if (i) {
|
|
65
|
+
const o = P(t).multiplyScalar(b.Z_FIGHTING_OFFSET);
|
|
80
66
|
h = t.map((a) => a.clone().add(o));
|
|
81
67
|
}
|
|
82
68
|
E(e).then(({ texture: o, transparent: a }) => {
|
|
83
69
|
var g;
|
|
84
70
|
const v = new y.MeshBasicMaterial({ map: o, transparent: a, side: y.DoubleSide });
|
|
85
|
-
this.originRatio = o.image.width / o.image.height, this.objectFit = (g =
|
|
86
|
-
const c = M(this.objectFit, h, o.image.width / o.image.height),
|
|
87
|
-
this.position.copy(
|
|
71
|
+
this.originRatio = o.image.width / o.image.height, this.objectFit = (g = s == null ? void 0 : s.objectFit) != null ? g : "contain";
|
|
72
|
+
const c = M(this.objectFit, h, o.image.width / o.image.height), u = I(...c), m = c.map((w) => w.clone().sub(u)), f = new F(m);
|
|
73
|
+
this.position.copy(u), this.geometry = f, this.material = v;
|
|
88
74
|
}).catch((o) => {
|
|
89
75
|
console.error(`Imageplane error: ${o == null ? void 0 : o.message}`);
|
|
90
76
|
});
|
|
91
77
|
}
|
|
92
78
|
changePointsOrParams(e) {
|
|
93
|
-
const { cornerPoints: t, params:
|
|
79
|
+
const { cornerPoints: t, params: s = {} } = e, { objectFit: i = this.objectFit } = s;
|
|
94
80
|
let h = t;
|
|
95
|
-
const { resolveZFighting: n } =
|
|
81
|
+
const { resolveZFighting: n } = s != null ? s : {};
|
|
96
82
|
if (n) {
|
|
97
|
-
const
|
|
98
|
-
h = t.map((
|
|
83
|
+
const u = P(t).multiplyScalar(b.Z_FIGHTING_OFFSET);
|
|
84
|
+
h = t.map((m) => m.clone().add(u));
|
|
99
85
|
}
|
|
100
|
-
const o = M(
|
|
101
|
-
this.objectFit =
|
|
86
|
+
const o = M(i != null ? i : "contain", h, this.originRatio), a = I(...o), v = o.map((u) => u.clone().sub(a)), c = new F(v);
|
|
87
|
+
this.objectFit = i != null ? i : "contain", this.position.copy(a), this.geometry = c;
|
|
102
88
|
}
|
|
103
89
|
}
|
|
104
90
|
class J extends H {
|
|
105
91
|
// eslint-disable-next-line max-params
|
|
106
|
-
constructor(e, t,
|
|
92
|
+
constructor(e, t, s) {
|
|
107
93
|
const {
|
|
108
|
-
videoCoverSrc:
|
|
94
|
+
videoCoverSrc: i,
|
|
109
95
|
objectFit: h = "contain",
|
|
110
96
|
playButton: n = "withText",
|
|
111
97
|
paused: o = !0,
|
|
112
98
|
videoTextureMap: a,
|
|
113
99
|
ImageTextureMap: v,
|
|
114
100
|
domEvents: c
|
|
115
|
-
} =
|
|
101
|
+
} = s != null ? s : {};
|
|
116
102
|
super();
|
|
117
103
|
r(this, "isVideoPlane", !0);
|
|
118
104
|
r(this, "name", "PanoTagPluginImagePlane");
|
|
@@ -128,13 +114,13 @@ class J extends H {
|
|
|
128
114
|
r(this, "buttonMesh");
|
|
129
115
|
r(this, "videoTextureMap");
|
|
130
116
|
r(this, "ImageTextureMap");
|
|
131
|
-
this.cornerPoints = t, this.src = e, this.buttonSrc = (() => n === "withText" ?
|
|
117
|
+
this.cornerPoints = t, this.src = e, this.buttonSrc = (() => n === "withText" ? V : n === "withoutText" ? S : typeof n == "string" ? n : S)(), this.videoCoverSrc = i, this.objectFit = h, this.videoTextureMap = a, this.ImageTextureMap = v, this.domEvents = c, this.position.copy(I(...t)), this.videoCoverSrc && o ? this.addCoverMesh().then(() => this.addButtonMesh()) : this.addVideoMesh().then(() => {
|
|
132
118
|
o ? this.addButtonMesh() : this.play(!0);
|
|
133
119
|
}), this.addEventListener("removed", () => {
|
|
134
120
|
this.remove(...this.children);
|
|
135
121
|
}), this.addEventListener("dispose", () => {
|
|
136
|
-
var
|
|
137
|
-
(
|
|
122
|
+
var u;
|
|
123
|
+
(u = this.disposers) == null || u.forEach((m) => m == null ? void 0 : m());
|
|
138
124
|
});
|
|
139
125
|
}
|
|
140
126
|
play(e = !1) {
|
|
@@ -148,11 +134,11 @@ class J extends H {
|
|
|
148
134
|
this.videoInstance && (this.videoInstance.pause(), this.showPauseUI().then(() => this.render()));
|
|
149
135
|
}
|
|
150
136
|
initialRenderHooks(e) {
|
|
151
|
-
const
|
|
152
|
-
var
|
|
153
|
-
this.videoMesh && ((
|
|
137
|
+
const s = e(() => {
|
|
138
|
+
var i;
|
|
139
|
+
this.videoMesh && ((i = this.videoInstance) == null ? void 0 : i.paused) === !1 && (this.videoMesh.needsRender = !0);
|
|
154
140
|
});
|
|
155
|
-
this.disposers.push(() =>
|
|
141
|
+
this.disposers.push(() => s);
|
|
156
142
|
}
|
|
157
143
|
showPlayUI() {
|
|
158
144
|
this.coverMesh && (this.coverMesh.visible = !1), this.remove(this.buttonMesh), this.videoMesh.visible = !0;
|
|
@@ -175,9 +161,9 @@ class J extends H {
|
|
|
175
161
|
return this.coverMesh;
|
|
176
162
|
if (!this.videoCoverSrc)
|
|
177
163
|
return;
|
|
178
|
-
const { texture: t, transparent:
|
|
179
|
-
n.position.copy(new
|
|
180
|
-
const o = P(h).multiplyScalar(
|
|
164
|
+
const { texture: t, transparent: s } = yield this.getImageTexture(this.videoCoverSrc), i = new y.MeshBasicMaterial({ transparent: !1, map: t, side: y.DoubleSide }), h = M(this.objectFit, this.cornerPoints, t.image.width / t.image.height), n = new x(h, i);
|
|
165
|
+
n.position.copy(new T(0, 0, 0)), n.name = "videoCoverMesh";
|
|
166
|
+
const o = P(h).multiplyScalar(b.Z_FIGHTING_OFFSET);
|
|
181
167
|
return n.position.add(o), n;
|
|
182
168
|
}))();
|
|
183
169
|
return e && (this.children.includes(this.coverMesh) || (this.add(e), this.coverMesh = e)), e;
|
|
@@ -185,7 +171,7 @@ class J extends H {
|
|
|
185
171
|
}
|
|
186
172
|
addVideoMesh() {
|
|
187
173
|
return d(this, null, function* () {
|
|
188
|
-
var
|
|
174
|
+
var s;
|
|
189
175
|
if (this.children.includes(this.videoMesh))
|
|
190
176
|
return;
|
|
191
177
|
const e = yield (() => d(this, null, function* () {
|
|
@@ -193,14 +179,14 @@ class J extends H {
|
|
|
193
179
|
return this.videoMesh;
|
|
194
180
|
if (!this.src)
|
|
195
181
|
return;
|
|
196
|
-
const
|
|
197
|
-
|
|
182
|
+
const i = this.getVideoTexture(this.src), h = new y.MeshBasicMaterial({ transparent: !1, map: i, side: y.DoubleSide }), n = yield new Promise((v) => {
|
|
183
|
+
i.metadataLoaded ? v(M(this.objectFit, this.cornerPoints, i.image.videoWidth / i.image.videoHeight)) : i.addEventListener(
|
|
198
184
|
"videoLoaded",
|
|
199
|
-
() => v(M(this.objectFit, this.cornerPoints,
|
|
185
|
+
() => v(M(this.objectFit, this.cornerPoints, i.image.videoWidth / i.image.videoHeight))
|
|
200
186
|
);
|
|
201
187
|
}), o = new x(n, h);
|
|
202
|
-
o.name = "videoMesh", o.position.copy(new
|
|
203
|
-
const a = P(n).multiplyScalar(
|
|
188
|
+
o.name = "videoMesh", o.position.copy(new T(0, 0, 0));
|
|
189
|
+
const a = P(n).multiplyScalar(b.Z_FIGHTING_OFFSET);
|
|
204
190
|
return o.position.add(a), o;
|
|
205
191
|
}))();
|
|
206
192
|
if (!e)
|
|
@@ -209,13 +195,13 @@ class J extends H {
|
|
|
209
195
|
e,
|
|
210
196
|
"click",
|
|
211
197
|
() => {
|
|
212
|
-
var
|
|
213
|
-
!this.videoInstance.paused && ((
|
|
198
|
+
var i;
|
|
199
|
+
!this.videoInstance.paused && ((i = this.videoInstance) != null && i.muted) ? this.videoInstance.muted = !1 : this.pause();
|
|
214
200
|
},
|
|
215
201
|
{ noEmitWhenHide: !0 }
|
|
216
202
|
);
|
|
217
203
|
const t = e.material.map.image;
|
|
218
|
-
return (
|
|
204
|
+
return (s = this.onVideoReady) == null || s.call(this, t), t.addEventListener("playing", () => {
|
|
219
205
|
this.coverMesh || this.remove(this.buttonMesh), this.render();
|
|
220
206
|
}), t.addEventListener("pause", () => {
|
|
221
207
|
this.videoInstance.paused && (this.showPauseUI(), this.render());
|
|
@@ -227,11 +213,11 @@ class J extends H {
|
|
|
227
213
|
if (this.children.includes(this.buttonMesh))
|
|
228
214
|
return;
|
|
229
215
|
const e = yield (() => d(this, null, function* () {
|
|
230
|
-
var
|
|
216
|
+
var m, f, g, w;
|
|
231
217
|
if (this.buttonMesh)
|
|
232
218
|
return this.buttonMesh;
|
|
233
|
-
const t = (f = (
|
|
234
|
-
c.position.copy(new
|
|
219
|
+
const t = (f = (m = this.videoMesh) == null ? void 0 : m.geometry.points[0].distanceTo(this.videoMesh.geometry.points[3])) != null ? f : 1 / 0, s = (w = (g = this.coverMesh) == null ? void 0 : g.geometry.points[0].distanceTo(this.coverMesh.geometry.points[3])) != null ? w : 1 / 0, i = this.cornerPoints[0].distanceTo(this.cornerPoints[3]), n = Math.min(t, s, i) / i * 0.3, { texture: o, transparent: a } = yield this.getImageTexture(this.buttonSrc), v = M("contain", this.cornerPoints, o.image.width / o.image.height), c = new x(v, new B(o));
|
|
220
|
+
c.position.copy(new T(0, 0, 0)), c.name = "buttonMesh", c.scale.set(n, n, n), c.material.side = y.DoubleSide, this.domEvents.addAutoBindEventListener(
|
|
235
221
|
c,
|
|
236
222
|
"click",
|
|
237
223
|
() => {
|
|
@@ -239,32 +225,32 @@ class J extends H {
|
|
|
239
225
|
},
|
|
240
226
|
{ noEmitWhenHide: !0 }
|
|
241
227
|
);
|
|
242
|
-
const
|
|
243
|
-
return c.position.add(
|
|
228
|
+
const u = P(v).multiplyScalar(b.Z_FIGHTING_OFFSET * 2);
|
|
229
|
+
return c.position.add(u), c;
|
|
244
230
|
}))();
|
|
245
231
|
return this.children.includes(this.buttonMesh) || (this.add(e), this.buttonMesh = e), e;
|
|
246
232
|
});
|
|
247
233
|
}
|
|
248
234
|
getImageTexture(e) {
|
|
249
235
|
return d(this, null, function* () {
|
|
250
|
-
var
|
|
251
|
-
if ((
|
|
236
|
+
var s, i;
|
|
237
|
+
if ((s = this.ImageTextureMap) != null && s.has(e))
|
|
252
238
|
return this.ImageTextureMap.get(e);
|
|
253
239
|
const t = yield E(e);
|
|
254
|
-
return (
|
|
240
|
+
return (i = this.ImageTextureMap) == null || i.set(e, t), t;
|
|
255
241
|
});
|
|
256
242
|
}
|
|
257
243
|
getVideoTexture(e) {
|
|
258
|
-
var
|
|
259
|
-
if ((
|
|
244
|
+
var s, i;
|
|
245
|
+
if ((s = this.videoTextureMap) != null && s.has(e))
|
|
260
246
|
return this.videoTextureMap.get(e);
|
|
261
|
-
const t =
|
|
262
|
-
return (
|
|
247
|
+
const t = j(e);
|
|
248
|
+
return (i = this.videoTextureMap) == null || i.set(e, t), t;
|
|
263
249
|
}
|
|
264
250
|
changePointsOrParams(e) {
|
|
265
251
|
return d(this, null, function* () {
|
|
266
|
-
const { cornerPoints: t, params:
|
|
267
|
-
t && (this.cornerPoints = t, this.position.copy(I(...t))),
|
|
252
|
+
const { cornerPoints: t, params: s } = e;
|
|
253
|
+
t && (this.cornerPoints = t, this.position.copy(I(...t))), s != null && s.objectFit && (this.objectFit = s.objectFit), yield this.updateAllMeshes();
|
|
268
254
|
});
|
|
269
255
|
}
|
|
270
256
|
updateAllMeshes() {
|
|
@@ -281,9 +267,9 @@ class J extends H {
|
|
|
281
267
|
"videoLoaded",
|
|
282
268
|
() => o(M(this.objectFit, this.cornerPoints, e.image.videoWidth / e.image.videoHeight))
|
|
283
269
|
);
|
|
284
|
-
}),
|
|
285
|
-
this.videoMesh.geometry.dispose(), this.videoMesh.geometry = h, this.videoMesh.position.copy(new
|
|
286
|
-
const n = P(t).multiplyScalar(
|
|
270
|
+
}), s = I(...t), i = t.map((o) => o.clone().sub(s)), h = new F(i);
|
|
271
|
+
this.videoMesh.geometry.dispose(), this.videoMesh.geometry = h, this.videoMesh.position.copy(new T(0, 0, 0));
|
|
272
|
+
const n = P(t).multiplyScalar(b.Z_FIGHTING_OFFSET);
|
|
287
273
|
this.videoMesh.position.add(n);
|
|
288
274
|
});
|
|
289
275
|
}
|
|
@@ -291,19 +277,19 @@ class J extends H {
|
|
|
291
277
|
return d(this, null, function* () {
|
|
292
278
|
if (!this.coverMesh || !this.videoCoverSrc)
|
|
293
279
|
return;
|
|
294
|
-
const { texture: e } = yield this.getImageTexture(this.videoCoverSrc), t = M(this.objectFit, this.cornerPoints, e.image.width / e.image.height),
|
|
295
|
-
this.coverMesh.geometry.dispose(), this.coverMesh.geometry = h, this.coverMesh.position.copy(new
|
|
280
|
+
const { texture: e } = yield this.getImageTexture(this.videoCoverSrc), t = M(this.objectFit, this.cornerPoints, e.image.width / e.image.height), s = I(...t), i = t.map((n) => n.clone().sub(s)), h = new F(i);
|
|
281
|
+
this.coverMesh.geometry.dispose(), this.coverMesh.geometry = h, this.coverMesh.position.copy(new T(0, 0, 0));
|
|
296
282
|
});
|
|
297
283
|
}
|
|
298
284
|
updateButtonMesh() {
|
|
299
285
|
return d(this, null, function* () {
|
|
300
|
-
var
|
|
286
|
+
var m, f, g, w;
|
|
301
287
|
if (!this.buttonMesh)
|
|
302
288
|
return;
|
|
303
|
-
const { texture: e } = yield this.getImageTexture(this.buttonSrc), t = M("contain", this.cornerPoints, e.image.width / e.image.height),
|
|
304
|
-
this.buttonMesh.geometry.dispose(), this.buttonMesh.geometry = h, this.buttonMesh.position.copy(new
|
|
305
|
-
const
|
|
306
|
-
this.buttonMesh.position.add(
|
|
289
|
+
const { texture: e } = yield this.getImageTexture(this.buttonSrc), t = M("contain", this.cornerPoints, e.image.width / e.image.height), s = I(...t), i = t.map((C) => C.clone().sub(s)), h = new F(i), n = (f = (m = this.videoMesh) == null ? void 0 : m.geometry.points[0].distanceTo(this.videoMesh.geometry.points[3])) != null ? f : 1 / 0, o = (w = (g = this.coverMesh) == null ? void 0 : g.geometry.points[0].distanceTo(this.coverMesh.geometry.points[3])) != null ? w : 1 / 0, a = this.cornerPoints[0].distanceTo(this.cornerPoints[3]), c = Math.min(n, o, a) / a * 0.3;
|
|
290
|
+
this.buttonMesh.geometry.dispose(), this.buttonMesh.geometry = h, this.buttonMesh.position.copy(new T(0, 0, 0)), this.buttonMesh.scale.set(c, c, c);
|
|
291
|
+
const u = P(t).multiplyScalar(b.Z_FIGHTING_OFFSET * 2);
|
|
292
|
+
this.buttonMesh.position.add(u);
|
|
307
293
|
});
|
|
308
294
|
}
|
|
309
295
|
}
|