@realsee/dnalogel 2.0.5--alpha.1 → 2.0.5-alpha.2
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/index.cjs.js +2 -2
- package/dist/index.es.js +2 -2
- package/dist/index.js +2 -2
- package/dist/index.umd.js +2 -2
- package/docs/classes/CruisePluginController.html +14 -14
- package/docs/classes/Magnifier.html +4 -4
- package/docs/classes/ModelRoomLabelController.html +4 -4
- package/docs/classes/PaintBrush.html +3 -3
- package/docs/enums/CameraMovementEffect.html +2 -2
- package/docs/enums/DIRECTION.html +1 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/PaintBrushTypeEnum.html +1 -1
- package/docs/enums/Rotation.html +2 -2
- package/docs/index.html +1 -1
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +2 -2
- package/docs/interfaces/CSS3DRenderPluginState.html +2 -2
- package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/FloorplanBounding.html +4 -4
- package/docs/interfaces/FloorplanData.html +2 -2
- package/docs/interfaces/FloorplanEntrance.html +7 -7
- package/docs/interfaces/FloorplanExtraObject.html +3 -3
- package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
- package/docs/interfaces/FloorplanFloorData.html +2 -2
- package/docs/interfaces/FloorplanImagePosition.html +2 -2
- package/docs/interfaces/FloorplanObserver.html +2 -2
- package/docs/interfaces/FloorplanOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanPosition.html +2 -2
- package/docs/interfaces/FloorplanRoomItem.html +6 -6
- package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
- package/docs/interfaces/FloorplanServerBounding.html +4 -4
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +2 -2
- package/docs/interfaces/FloorplanServerDoorItem.html +1 -1
- package/docs/interfaces/FloorplanServerDoorPosition.html +1 -1
- package/docs/interfaces/FloorplanServerEntrance.html +7 -7
- package/docs/interfaces/FloorplanServerFloorData.html +2 -2
- package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
- package/docs/interfaces/FloorplanServerObserver.html +2 -2
- package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanServerPosition.html +2 -2
- package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
- package/docs/interfaces/ItemLabelPluginData.html +1 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -1
- package/docs/interfaces/OpenParameter.html +2 -2
- package/docs/interfaces/PaintBrushAction.html +7 -7
- package/docs/interfaces/PaintBrushConfigs.html +1 -1
- package/docs/interfaces/PaintBrushState.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
- package/docs/interfaces/PanoMeasureParameterType.html +2 -2
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginState.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
- package/docs/interfaces/Point.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -1
- package/docs/interfaces/RoomInfo.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -1
- package/docs/interfaces/Rooms.html +1 -1
- package/docs/modules.html +17 -17
- package/libs/CruisePlugin/Controller.js +1 -1
- package/libs/ModelTVVideoPlugin/Plugin.js +51 -51
- package/package.json +1 -1
|
@@ -240,7 +240,7 @@ class $ extends C {
|
|
|
240
240
|
async getPlayPromise(e, t) {
|
|
241
241
|
var r;
|
|
242
242
|
const i = e.data;
|
|
243
|
-
if ((r = t == null ? void 0 : t.duration) != null
|
|
243
|
+
if (t.duration = (r = t == null ? void 0 : t.duration) != null ? r : e.start !== void 0 && e.end !== void 0 ? e.end - e.start : void 0, !!i)
|
|
244
244
|
return new Promise((d, s) => {
|
|
245
245
|
let n = !1;
|
|
246
246
|
this.addInterruptListener(() => {
|
|
@@ -18,25 +18,25 @@ const q = (s, { videoElement: E }) => {
|
|
|
18
18
|
rectPoints: [],
|
|
19
19
|
enabled: !1,
|
|
20
20
|
videoElement: E
|
|
21
|
-
},
|
|
21
|
+
}, m = I(s), y = /* @__PURE__ */ new Map(), M = (e) => {
|
|
22
22
|
t.videoTexture && (t.videoTexture.image.muted = e);
|
|
23
23
|
}, A = () => t.videoTexture ? t.videoTexture.image.muted : !0, T = () => {
|
|
24
24
|
if (t.enabled || !t.videoTexture)
|
|
25
25
|
return;
|
|
26
|
-
t.enabled = !0, t.videoMeshes = R(), t.videoMeshes.forEach((
|
|
26
|
+
t.enabled = !0, t.videoMeshes = R(), t.videoMeshes.forEach((o) => s.scene.add(o));
|
|
27
27
|
const e = () => {
|
|
28
28
|
if (!t.videoTexture)
|
|
29
29
|
return;
|
|
30
|
-
const
|
|
30
|
+
const o = () => {
|
|
31
31
|
var i;
|
|
32
|
-
!t.videoTexture || ((i = t.videoTexture) == null || i.image.removeEventListener("timeupdate",
|
|
33
|
-
|
|
32
|
+
!t.videoTexture || ((i = t.videoTexture) == null || i.image.removeEventListener("timeupdate", o), t.videoTextureEnabled = !0, t.videoMeshes.forEach((n) => {
|
|
33
|
+
n.material.map !== t.videoTexture && (n.material.map = t.videoTexture);
|
|
34
34
|
}), s.needsRender = !0);
|
|
35
35
|
};
|
|
36
|
-
t.videoTexture.image.addEventListener("timeupdate",
|
|
37
|
-
|
|
36
|
+
t.videoTexture.image.addEventListener("timeupdate", o), t.videoTexture && t.videoMeshes.length && (t.videoTexture.image.play(), t.videoTexture.image.onplay = () => {
|
|
37
|
+
m.hide();
|
|
38
38
|
}, t.videoTexture.image.onpause = () => {
|
|
39
|
-
|
|
39
|
+
m.show();
|
|
40
40
|
}, t.videoTexture.image.onclick = () => {
|
|
41
41
|
t.videoTexture.image.muted = !1, t.videoTexture.image.play();
|
|
42
42
|
});
|
|
@@ -49,43 +49,43 @@ const q = (s, { videoElement: E }) => {
|
|
|
49
49
|
!t.enabled || (t.enabled = !1, t.videoMeshes.forEach((e) => {
|
|
50
50
|
e.geometry.dispose(), e.material.dispose(), s.scene.remove(e), t.videoTexture && t.videoTexture.image.pause();
|
|
51
51
|
}), t.videoMeshes = [], s.needsRender = !0);
|
|
52
|
-
}, R = () => t.rectPoints.map((e,
|
|
53
|
-
const i = new d.BufferGeometry(),
|
|
52
|
+
}, R = () => t.rectPoints.map((e, o) => {
|
|
53
|
+
const i = new d.BufferGeometry(), n = 128, a = [];
|
|
54
54
|
a.push(...e[0].toArray());
|
|
55
|
-
for (let r = 1; r <
|
|
55
|
+
for (let r = 1; r < n; r++)
|
|
56
56
|
a.push(
|
|
57
|
-
e[0].x + (e[1].x - e[0].x) * r /
|
|
58
|
-
e[0].y + (e[1].y - e[0].y) * r /
|
|
59
|
-
e[0].z + (e[1].z - e[0].z) * r /
|
|
57
|
+
e[0].x + (e[1].x - e[0].x) * r / n,
|
|
58
|
+
e[0].y + (e[1].y - e[0].y) * r / n,
|
|
59
|
+
e[0].z + (e[1].z - e[0].z) * r / n
|
|
60
60
|
);
|
|
61
61
|
a.push(...e[1].toArray()), a.push(...e[2].toArray());
|
|
62
|
-
for (let r = 1; r <
|
|
62
|
+
for (let r = 1; r < n; r++)
|
|
63
63
|
a.push(
|
|
64
|
-
e[2].x + (e[3].x - e[2].x) * r /
|
|
65
|
-
e[2].y + (e[3].y - e[2].y) * r /
|
|
66
|
-
e[2].z + (e[3].z - e[2].z) * r /
|
|
64
|
+
e[2].x + (e[3].x - e[2].x) * r / n,
|
|
65
|
+
e[2].y + (e[3].y - e[2].y) * r / n,
|
|
66
|
+
e[2].z + (e[3].z - e[2].z) * r / n
|
|
67
67
|
);
|
|
68
68
|
a.push(...e[3].toArray());
|
|
69
69
|
const c = [];
|
|
70
70
|
c.push(0, 1);
|
|
71
|
-
for (let r = 1; r <
|
|
72
|
-
c.push(0, 1 - r /
|
|
71
|
+
for (let r = 1; r < n; r++)
|
|
72
|
+
c.push(0, 1 - r / n);
|
|
73
73
|
c.push(0, 0), c.push(1, 0);
|
|
74
|
-
for (let r = 1; r <
|
|
75
|
-
c.push(1, r /
|
|
74
|
+
for (let r = 1; r < n; r++)
|
|
75
|
+
c.push(1, r / n);
|
|
76
76
|
c.push(1, 1);
|
|
77
77
|
const u = [];
|
|
78
|
-
for (let r = 0; r <
|
|
79
|
-
u.push(r, r + 1,
|
|
78
|
+
for (let r = 0; r < n; r++)
|
|
79
|
+
u.push(r, r + 1, n * 2 - r, r, n * 2 - r, n * 2 + 1 - r);
|
|
80
80
|
i.setAttribute("position", new d.BufferAttribute(new Float32Array(a), 3)), i.setAttribute("uv", new d.BufferAttribute(new Float32Array(c), 2)), i.setIndex(new d.BufferAttribute(new Uint32Array(u), 1));
|
|
81
81
|
const l = new d.AxesHelper(10);
|
|
82
82
|
s.scene.add(l);
|
|
83
|
-
const
|
|
83
|
+
const f = new d.MeshBasicMaterial({
|
|
84
84
|
map: t.videoTextureEnabled ? t.videoTexture : t.imageTexture,
|
|
85
85
|
side: d.DoubleSide
|
|
86
|
-
}), x = new d.Mesh(i,
|
|
87
|
-
x.renderOrder = 1, x.name = `ModelTVVideoPlugin-${
|
|
88
|
-
const S = [e[1], e[2], e[3], e[0]], p =
|
|
86
|
+
}), x = new d.Mesh(i, f);
|
|
87
|
+
x.renderOrder = 1, x.name = `ModelTVVideoPlugin-${o}-${performance.now()}`;
|
|
88
|
+
const S = [e[1], e[2], e[3], e[0]], p = m.create3DDomContainer(S);
|
|
89
89
|
if (p != null && p.container) {
|
|
90
90
|
const r = document.createElement("div");
|
|
91
91
|
r.classList.add("play-icon"), r.style.width = "100%", r.style.height = "100%", r.style.display = "flex", r.style.justifyContent = "center", r.style.alignItems = "center", r.style.pointerEvents = "none", p.container.appendChild(r);
|
|
@@ -96,47 +96,47 @@ const q = (s, { videoElement: E }) => {
|
|
|
96
96
|
}
|
|
97
97
|
return x;
|
|
98
98
|
}), F = (e) => {
|
|
99
|
-
const
|
|
100
|
-
return
|
|
101
|
-
}, L = (e,
|
|
99
|
+
const o = new d.TextureLoader().load(e);
|
|
100
|
+
return o.minFilter = d.LinearFilter, o.magFilter = d.LinearFilter, o.format = d.RGBFormat, o;
|
|
101
|
+
}, L = (e, o) => new Promise((i, n) => {
|
|
102
102
|
const a = new XMLHttpRequest();
|
|
103
103
|
a.onreadystatechange = () => {
|
|
104
104
|
if (a.readyState == 4)
|
|
105
105
|
if (a.status == 200) {
|
|
106
106
|
const c = window.URL || window.webkitURL;
|
|
107
|
-
|
|
108
|
-
const u = new d.VideoTexture(
|
|
107
|
+
o = o || document.createElement("video"), o.crossOrigin = "anonymous", o.muted = !0, o.loop = !0, o.playsInline = !0, o.src = c.createObjectURL(a.response);
|
|
108
|
+
const u = new d.VideoTexture(o);
|
|
109
109
|
u.minFilter = d.LinearFilter, u.magFilter = d.LinearFilter, u.format = d.RGBFormat, i(Object.assign(u, { videoSource: e }));
|
|
110
110
|
} else
|
|
111
|
-
|
|
112
|
-
}, a.onerror = (c) =>
|
|
113
|
-
}), P = async (e,
|
|
114
|
-
const { video_src: i, video_poster_src:
|
|
115
|
-
t.videoSource = i, t.rectPoints = z(a).map((c) => c.map(({ x: u, y: l, z:
|
|
111
|
+
n(new Error("Video download Error: " + a.status));
|
|
112
|
+
}, a.onerror = (c) => n(c), a.open("GET", e), a.responseType = "blob", a.send();
|
|
113
|
+
}), P = async (e, o) => {
|
|
114
|
+
const { video_src: i, video_poster_src: n, points: a } = e;
|
|
115
|
+
t.videoSource = i, t.rectPoints = z(a).map((c) => c.map(({ x: u, y: l, z: f }) => new d.Vector3(u, l, f))), t.imageTexture = F(n), o && (t.videoElement = o), t.videoTexture = await L(t.videoSource, t.videoElement), t.enabled = !!e.enable, t.enabled && T();
|
|
116
116
|
}, v = (e) => {
|
|
117
117
|
if (!t.enabled)
|
|
118
118
|
return;
|
|
119
|
-
const
|
|
120
|
-
if (!(!
|
|
119
|
+
const o = t.videoMeshes;
|
|
120
|
+
if (!(!o || e.intersectObjects(o).length === 0))
|
|
121
121
|
return t.videoTexture && (t.videoTexture.image.paused || t.videoTexture.image.pause()), !1;
|
|
122
122
|
}, b = (e) => {
|
|
123
|
-
e === "Floorplan" ?
|
|
123
|
+
e === "Floorplan" || t.videoTexture.image.played ? m.hide() : m.show();
|
|
124
124
|
}, w = () => {
|
|
125
125
|
if (!t.enabled)
|
|
126
126
|
return;
|
|
127
127
|
const e = s.camera.position;
|
|
128
|
-
if (y.forEach((
|
|
129
|
-
const
|
|
130
|
-
u && u.distance +
|
|
128
|
+
if (y.forEach((o, i) => {
|
|
129
|
+
const n = o.css3DObject.position.clone(), a = n.clone().sub(e).normalize(), c = new d.Raycaster(e, a), u = s.model.intersectRaycaster(c)[0], l = n.distanceTo(e), f = 0.01;
|
|
130
|
+
u && u.distance + f < l ? o.hide() : o.show();
|
|
131
131
|
}), !A()) {
|
|
132
|
-
const
|
|
133
|
-
const
|
|
134
|
-
return i.map((a) => a.clone().add(
|
|
135
|
-
const c = a.distanceTo(e), u = new d.Raycaster(e, a.clone().sub(e).normalize()), l = s.model.intersectRaycaster(u)[0],
|
|
136
|
-
return !(l && l.distance +
|
|
132
|
+
const o = t.rectPoints.find((i) => {
|
|
133
|
+
const n = i[0].clone().add(i[1]).add(i[2]).add(i[3]).divideScalar(4);
|
|
134
|
+
return i.map((a) => a.clone().add(n).divideScalar(2)).filter((a) => {
|
|
135
|
+
const c = a.distanceTo(e), u = new d.Raycaster(e, a.clone().sub(e).normalize()), l = s.model.intersectRaycaster(u)[0], f = 0.01;
|
|
136
|
+
return !(l && l.distance + f < c);
|
|
137
137
|
}).length >= 2;
|
|
138
138
|
});
|
|
139
|
-
(!
|
|
139
|
+
(!o || o.length === 0) && M(!0);
|
|
140
140
|
}
|
|
141
141
|
}, V = () => {
|
|
142
142
|
g(), t.videoTexture = void 0, s.off("modeChange", b), s.off("wantsTapGesture", v), s.off("panoArrived", w), s.off("renderFrame", () => {
|
|
@@ -149,7 +149,7 @@ const q = (s, { videoElement: E }) => {
|
|
|
149
149
|
t.videoMeshes.forEach((e) => {
|
|
150
150
|
e && (e.needsRender = !0);
|
|
151
151
|
});
|
|
152
|
-
}), { enable: T, disable: g, load: P, dispose: V, state: t, css3DRenderPlugin:
|
|
152
|
+
}), { enable: T, disable: g, load: P, dispose: V, state: t, css3DRenderPlugin: m };
|
|
153
153
|
};
|
|
154
154
|
export {
|
|
155
155
|
q as ModelTVVideoPlugin,
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"repository": "https://github.com/realsee-developer/dnalogel.git",
|
|
10
10
|
"description": "如视 VR 看房插件合集",
|
|
11
11
|
"private": false,
|
|
12
|
-
"version": "2.0.5
|
|
12
|
+
"version": "2.0.5-alpha.2",
|
|
13
13
|
"license": "SEE LICENSE IN TERMS.txt",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "sh bin/build-production.sh",
|