@realsee/dnalogel 2.0.4 → 2.0.5--alpha.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/index.cjs.js +46 -46
- package/dist/index.es.js +4100 -3838
- package/dist/index.js +4100 -3838
- package/dist/index.umd.js +34 -34
- package/docs/assets/search.js +1 -1
- 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 +8 -0
- 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 -0
- package/docs/enums/Rotation.html +2 -2
- package/docs/index.html +2 -2
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -0
- package/docs/interfaces/CSS3DRenderPluginState.html +3 -0
- 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 +13 -0
- package/docs/interfaces/PaintBrushConfigs.html +1 -0
- package/docs/interfaces/PaintBrushState.html +1 -0
- 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 -20
- package/libs/CSS3DRenderPlugin/CSS3DRender.d.ts +156 -0
- package/libs/CSS3DRenderPlugin/CSS3DRender.js +246 -0
- package/libs/CSS3DRenderPlugin/Controller.d.ts +78 -0
- package/libs/CSS3DRenderPlugin/Controller.js +59 -0
- package/libs/CSS3DRenderPlugin/index.d.ts +4 -3
- package/libs/CSS3DRenderPlugin/index.js +10 -8
- package/libs/CSS3DRenderPlugin/typing.d.ts +26 -0
- package/libs/CSS3DRenderPlugin/typing.js +1 -0
- package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.d.ts +16 -0
- package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +48 -0
- package/libs/CSS3DRenderPlugin/utils/centerPoint.d.ts +2 -0
- package/libs/CSS3DRenderPlugin/utils/centerPoint.js +10 -0
- package/libs/CSS3DRenderPlugin/utils/evenNumber.d.ts +3 -0
- package/libs/CSS3DRenderPlugin/utils/evenNumber.js +7 -0
- package/libs/CSS3DRenderPlugin/utils/index.d.ts +4 -0
- package/libs/CSS3DRenderPlugin/utils/index.js +13 -0
- package/libs/CSS3DRenderPlugin/utils/positionToVector3.d.ts +13 -0
- package/libs/CSS3DRenderPlugin/utils/positionToVector3.js +7 -0
- package/libs/CSS3DRenderPlugin/utils/random.d.ts +1 -0
- package/libs/CSS3DRenderPlugin/utils/random.js +6 -0
- package/libs/ModelTVVideoPlugin/Plugin.d.ts +1 -1
- package/libs/ModelTVVideoPlugin/Plugin.js +129 -139
- package/libs/ModelTVVideoPlugin/index.js +14 -5
- package/libs/ModelTVVideoPlugin/typings.js +0 -1
- package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +1 -1
- package/libs/ModelTVVideoPlugin/utils/parseData.js +12 -8
- package/libs/PanoCompassPlugin/Controller.js +19 -16
- package/libs/PanoCompassPlugin/index.js +11 -8
- package/libs/PanoDoorLabelPlugin/BaseController.js +7 -7
- package/libs/PanoSpatialTagPlugin/Plugin.js +11 -8
- package/libs/PanoSpatialTagPlugin/index.js +11 -8
- package/libs/index.js +80 -76
- package/libs/shared-utils/Subscribe.d.ts +41 -25
- package/libs/shared-utils/Subscribe.js +37 -45
- package/package.json +1 -1
- package/docs/interfaces/CSS3DRenderPluginExportType.html +0 -4
- package/libs/CSS3DRenderPlugin/Plugin.d.ts +0 -49
- package/libs/CSS3DRenderPlugin/Plugin.js +0 -80
- package/libs/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +0 -7
- package/libs/CSS3DRenderPlugin/utils/createResizeObserver.js +0 -17
- package/libs/shared-utils/three/centerPoint.d.ts +0 -2
- package/libs/shared-utils/three/centerPoint.js +0 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { centerPoint as e } from "./centerPoint.js";
|
|
2
|
+
import { evenNumber as n } from "./evenNumber.js";
|
|
3
|
+
import { random as p } from "./random.js";
|
|
4
|
+
import { anyPositionToVector3 as c, arrayPositionToVector3 as f, positionToVector3 as x } from "./positionToVector3.js";
|
|
5
|
+
import "three";
|
|
6
|
+
export {
|
|
7
|
+
c as anyPositionToVector3,
|
|
8
|
+
f as arrayPositionToVector3,
|
|
9
|
+
e as centerPoint,
|
|
10
|
+
n as evenNumber,
|
|
11
|
+
x as positionToVector3,
|
|
12
|
+
p as random
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Vector3 } from 'three';
|
|
2
|
+
export declare type AnyPosition = Vector3 | [number, number, number] | {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
z: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const positionToVector3: ({ x, y, z }: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
z: number;
|
|
11
|
+
}) => Vector3;
|
|
12
|
+
export declare const arrayPositionToVector3: ([x, y, z]: [number, number, number]) => Vector3;
|
|
13
|
+
export declare const anyPositionToVector3: (position: AnyPosition) => Vector3;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Vector3 as t } from "three";
|
|
2
|
+
const n = ({ x: r, y: e, z: o }) => new t(r, e, o), c = ([r, e, o]) => new t(r, e, o), s = (r) => r instanceof t ? r : Array.isArray(r) ? c(r) : n(r);
|
|
3
|
+
export {
|
|
4
|
+
s as anyPositionToVector3,
|
|
5
|
+
c as arrayPositionToVector3,
|
|
6
|
+
n as positionToVector3
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function random(): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { FivePlugin } from '@realsee/five';
|
|
2
|
-
import type { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from
|
|
2
|
+
import type { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from './typings';
|
|
3
3
|
export declare const ModelTVVideoPlugin: FivePlugin<ModelTVVideoPluginParameterType, ModelTVVideoPluginExportType>;
|
|
4
4
|
export default ModelTVVideoPlugin;
|
|
@@ -1,167 +1,157 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { parseModelTVVideoPoints as
|
|
1
|
+
import * as d from "three";
|
|
2
|
+
import { parseModelTVVideoPoints as z } from "./utils/parseData.js";
|
|
3
|
+
import { CSS3DRenderPlugin as I } from "../CSS3DRenderPlugin/index.js";
|
|
3
4
|
import "./typings.js";
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import "../CSS3DRenderPlugin/Controller.js";
|
|
6
|
+
import "../CSS3DRenderPlugin/CSS3DRender.js";
|
|
7
|
+
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
8
|
+
import "../shared-utils/Subscribe.js";
|
|
9
|
+
import "../CSS3DRenderPlugin/utils/evenNumber.js";
|
|
10
|
+
import "../CSS3DRenderPlugin/utils/positionToVector3.js";
|
|
11
|
+
import "../CSS3DRenderPlugin/utils/CSS3DObjectPlus.js";
|
|
12
|
+
import "../CSS3DRenderPlugin/utils/centerPoint.js";
|
|
13
|
+
const q = (s, { videoElement: E }) => {
|
|
14
|
+
const t = {
|
|
6
15
|
videoMeshes: [],
|
|
7
16
|
videoTextureEnabled: !1,
|
|
8
17
|
videoSource: "",
|
|
9
18
|
rectPoints: [],
|
|
10
19
|
enabled: !1,
|
|
11
|
-
videoElement:
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
if (
|
|
20
|
+
videoElement: E
|
|
21
|
+
}, f = I(s), y = /* @__PURE__ */ new Map(), M = (e) => {
|
|
22
|
+
t.videoTexture && (t.videoTexture.image.muted = e);
|
|
23
|
+
}, A = () => t.videoTexture ? t.videoTexture.image.muted : !0, T = () => {
|
|
24
|
+
if (t.enabled || !t.videoTexture)
|
|
16
25
|
return;
|
|
17
|
-
|
|
26
|
+
t.enabled = !0, t.videoMeshes = R(), t.videoMeshes.forEach((n) => s.scene.add(n));
|
|
18
27
|
const e = () => {
|
|
19
|
-
if (!
|
|
28
|
+
if (!t.videoTexture)
|
|
20
29
|
return;
|
|
21
|
-
const
|
|
30
|
+
const n = () => {
|
|
22
31
|
var i;
|
|
23
|
-
!
|
|
24
|
-
|
|
25
|
-
}),
|
|
32
|
+
!t.videoTexture || ((i = t.videoTexture) == null || i.image.removeEventListener("timeupdate", n), t.videoTextureEnabled = !0, t.videoMeshes.forEach((o) => {
|
|
33
|
+
o.material.map !== t.videoTexture && (o.material.map = t.videoTexture);
|
|
34
|
+
}), s.needsRender = !0);
|
|
26
35
|
};
|
|
27
|
-
|
|
36
|
+
t.videoTexture.image.addEventListener("timeupdate", n), t.videoTexture && t.videoMeshes.length && (t.videoTexture.image.play(), t.videoTexture.image.onplay = () => {
|
|
37
|
+
f.hide();
|
|
38
|
+
}, t.videoTexture.image.onpause = () => {
|
|
39
|
+
f.show();
|
|
40
|
+
}, t.videoTexture.image.onclick = () => {
|
|
41
|
+
t.videoTexture.image.muted = !1, t.videoTexture.image.play();
|
|
42
|
+
});
|
|
28
43
|
};
|
|
29
|
-
if (
|
|
44
|
+
if (s.model.loaded)
|
|
30
45
|
e();
|
|
31
46
|
else
|
|
32
|
-
return
|
|
33
|
-
},
|
|
34
|
-
!
|
|
35
|
-
e.geometry.dispose(), e.material.dispose(),
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
38
|
-
const i = new
|
|
39
|
-
|
|
40
|
-
for (let
|
|
41
|
-
|
|
42
|
-
e[0].x + (e[1].x - e[0].x) *
|
|
43
|
-
e[0].y + (e[1].y - e[0].y) *
|
|
44
|
-
e[0].z + (e[1].z - e[0].z) *
|
|
47
|
+
return s.once("modelLoaded", () => e());
|
|
48
|
+
}, g = () => {
|
|
49
|
+
!t.enabled || (t.enabled = !1, t.videoMeshes.forEach((e) => {
|
|
50
|
+
e.geometry.dispose(), e.material.dispose(), s.scene.remove(e), t.videoTexture && t.videoTexture.image.pause();
|
|
51
|
+
}), t.videoMeshes = [], s.needsRender = !0);
|
|
52
|
+
}, R = () => t.rectPoints.map((e, n) => {
|
|
53
|
+
const i = new d.BufferGeometry(), o = 128, a = [];
|
|
54
|
+
a.push(...e[0].toArray());
|
|
55
|
+
for (let r = 1; r < o; r++)
|
|
56
|
+
a.push(
|
|
57
|
+
e[0].x + (e[1].x - e[0].x) * r / o,
|
|
58
|
+
e[0].y + (e[1].y - e[0].y) * r / o,
|
|
59
|
+
e[0].z + (e[1].z - e[0].z) * r / o
|
|
45
60
|
);
|
|
46
|
-
|
|
47
|
-
for (let
|
|
48
|
-
|
|
49
|
-
e[2].x + (e[3].x - e[2].x) *
|
|
50
|
-
e[2].y + (e[3].y - e[2].y) *
|
|
51
|
-
e[2].z + (e[3].z - e[2].z) *
|
|
61
|
+
a.push(...e[1].toArray()), a.push(...e[2].toArray());
|
|
62
|
+
for (let r = 1; r < o; r++)
|
|
63
|
+
a.push(
|
|
64
|
+
e[2].x + (e[3].x - e[2].x) * r / o,
|
|
65
|
+
e[2].y + (e[3].y - e[2].y) * r / o,
|
|
66
|
+
e[2].z + (e[3].z - e[2].z) * r / o
|
|
52
67
|
);
|
|
53
|
-
|
|
54
|
-
const s = [];
|
|
55
|
-
s.push(0, 1);
|
|
56
|
-
for (let a = 1; a < n; a++)
|
|
57
|
-
s.push(0, 1 - a / n);
|
|
58
|
-
s.push(0, 0), s.push(1, 0);
|
|
59
|
-
for (let a = 1; a < n; a++)
|
|
60
|
-
s.push(1, a / n);
|
|
61
|
-
s.push(1, 1);
|
|
68
|
+
a.push(...e[3].toArray());
|
|
62
69
|
const c = [];
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
c.push(0, 1);
|
|
71
|
+
for (let r = 1; r < o; r++)
|
|
72
|
+
c.push(0, 1 - r / o);
|
|
73
|
+
c.push(0, 0), c.push(1, 0);
|
|
74
|
+
for (let r = 1; r < o; r++)
|
|
75
|
+
c.push(1, r / o);
|
|
76
|
+
c.push(1, 1);
|
|
77
|
+
const u = [];
|
|
78
|
+
for (let r = 0; r < o; r++)
|
|
79
|
+
u.push(r, r + 1, o * 2 - r, r, o * 2 - r, o * 2 + 1 - r);
|
|
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
|
+
const l = new d.AxesHelper(10);
|
|
82
|
+
s.scene.add(l);
|
|
83
|
+
const m = new d.MeshBasicMaterial({
|
|
84
|
+
map: t.videoTextureEnabled ? t.videoTexture : t.imageTexture,
|
|
85
|
+
side: d.DoubleSide
|
|
86
|
+
}), x = new d.Mesh(i, m);
|
|
87
|
+
x.renderOrder = 1, x.name = `ModelTVVideoPlugin-${n}-${performance.now()}`;
|
|
88
|
+
const S = [e[1], e[2], e[3], e[0]], p = f.create3DDomContainer(S);
|
|
89
|
+
if (p != null && p.container) {
|
|
90
|
+
const r = document.createElement("div");
|
|
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);
|
|
92
|
+
const h = document.createElement("img");
|
|
93
|
+
h.src = "//vrlab-static.ljcdn.com/release/web/play.2ada5b6f.png", h.style.width = "200px", h.style.pointerEvents = "auto", h.onclick = () => {
|
|
94
|
+
t.videoTexture.image.muted = !1, t.videoTexture.image.play();
|
|
95
|
+
}, r.appendChild(h), y.set(x, p);
|
|
96
|
+
}
|
|
97
|
+
return x;
|
|
98
|
+
}), F = (e) => {
|
|
99
|
+
const n = new d.TextureLoader().load(e);
|
|
100
|
+
return n.minFilter = d.LinearFilter, n.magFilter = d.LinearFilter, n.format = d.RGBFormat, n;
|
|
101
|
+
}, L = (e, n) => new Promise((i, o) => {
|
|
102
|
+
const a = new XMLHttpRequest();
|
|
103
|
+
a.onreadystatechange = () => {
|
|
104
|
+
if (a.readyState == 4)
|
|
105
|
+
if (a.status == 200) {
|
|
106
|
+
const c = window.URL || window.webkitURL;
|
|
107
|
+
n = n || document.createElement("video"), n.crossOrigin = "anonymous", n.muted = !0, n.loop = !0, n.playsInline = !0, n.src = c.createObjectURL(a.response);
|
|
108
|
+
const u = new d.VideoTexture(n);
|
|
109
|
+
u.minFilter = d.LinearFilter, u.magFilter = d.LinearFilter, u.format = d.RGBFormat, i(Object.assign(u, { videoSource: e }));
|
|
83
110
|
} else
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
}),
|
|
87
|
-
const { video_src: i, video_poster_src:
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
(t) => new u.Vector3(
|
|
111
|
-
(t.x + n.x) / 2,
|
|
112
|
-
(t.y + n.y) / 2,
|
|
113
|
-
(t.z + n.z) / 2
|
|
114
|
-
)
|
|
115
|
-
).filter((t) => {
|
|
116
|
-
t = t.clone().sub(e).normalize();
|
|
117
|
-
const s = new u.Raycaster(e, t), [c] = s.intersectObjects(d.scene.children, !0);
|
|
118
|
-
return !!c && /^video/.test(c.object.name);
|
|
111
|
+
o(new Error("Video download Error: " + a.status));
|
|
112
|
+
}, a.onerror = (c) => o(c), a.open("GET", e), a.responseType = "blob", a.send();
|
|
113
|
+
}), P = async (e, n) => {
|
|
114
|
+
const { video_src: i, video_poster_src: o, points: a } = e;
|
|
115
|
+
t.videoSource = i, t.rectPoints = z(a).map((c) => c.map(({ x: u, y: l, z: m }) => new d.Vector3(u, l, m))), t.imageTexture = F(o), n && (t.videoElement = n), t.videoTexture = await L(t.videoSource, t.videoElement), t.enabled = !!e.enable, t.enabled && T();
|
|
116
|
+
}, v = (e) => {
|
|
117
|
+
if (!t.enabled)
|
|
118
|
+
return;
|
|
119
|
+
const n = t.videoMeshes;
|
|
120
|
+
if (!(!n || e.intersectObjects(n).length === 0))
|
|
121
|
+
return t.videoTexture && (t.videoTexture.image.paused || t.videoTexture.image.pause()), !1;
|
|
122
|
+
}, b = (e) => {
|
|
123
|
+
e === "Floorplan" ? f.hide() : f.show();
|
|
124
|
+
}, w = () => {
|
|
125
|
+
if (!t.enabled)
|
|
126
|
+
return;
|
|
127
|
+
const e = s.camera.position;
|
|
128
|
+
if (y.forEach((n, i) => {
|
|
129
|
+
const o = n.css3DObject.position.clone(), a = o.clone().sub(e).normalize(), c = new d.Raycaster(e, a), u = s.model.intersectRaycaster(c)[0], l = o.distanceTo(e), m = 0.01;
|
|
130
|
+
u && u.distance + m < l ? n.hide() : n.show();
|
|
131
|
+
}), !A()) {
|
|
132
|
+
const n = t.rectPoints.find((i) => {
|
|
133
|
+
const o = i[0].clone().add(i[1]).add(i[2]).add(i[3]).divideScalar(4);
|
|
134
|
+
return i.map((a) => a.clone().add(o).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], m = 0.01;
|
|
136
|
+
return !(l && l.distance + m < c);
|
|
119
137
|
}).length >= 2;
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
|
|
138
|
+
});
|
|
139
|
+
(!n || n.length === 0) && M(!0);
|
|
140
|
+
}
|
|
141
|
+
}, V = () => {
|
|
142
|
+
g(), t.videoTexture = void 0, s.off("modeChange", b), s.off("wantsTapGesture", v), s.off("panoArrived", w), s.off("renderFrame", () => {
|
|
143
|
+
t.videoMeshes.forEach((e) => {
|
|
123
144
|
e && (e.needsRender = !0);
|
|
124
145
|
});
|
|
125
146
|
});
|
|
126
147
|
};
|
|
127
|
-
return
|
|
128
|
-
|
|
129
|
-
return;
|
|
130
|
-
const o = d.scene.children.filter((n) => /^ModelTVVideoPlugin/.test(n.name));
|
|
131
|
-
if (!(!o || e.intersectObjects(o).length === 0))
|
|
132
|
-
return r.videoTexture && l(!r.videoTexture.image.muted), !1;
|
|
133
|
-
}), d.on("panoArrived", () => {
|
|
134
|
-
if (!r.enabled || f())
|
|
135
|
-
return;
|
|
136
|
-
const e = d.camera.position;
|
|
137
|
-
r.rectPoints.find((i) => {
|
|
138
|
-
const n = i.reduce(
|
|
139
|
-
(t, s) => new u.Vector3(
|
|
140
|
-
t.x + s.x / i.length,
|
|
141
|
-
t.y + s.y / i.length,
|
|
142
|
-
t.z + s.z / i.length
|
|
143
|
-
),
|
|
144
|
-
new u.Vector3()
|
|
145
|
-
);
|
|
146
|
-
return i.map(
|
|
147
|
-
(t) => new u.Vector3(
|
|
148
|
-
(t.x + n.x) / 2,
|
|
149
|
-
(t.y + n.y) / 2,
|
|
150
|
-
(t.z + n.z) / 2
|
|
151
|
-
)
|
|
152
|
-
).filter((t) => {
|
|
153
|
-
t = t.clone().sub(e).normalize();
|
|
154
|
-
const s = new u.Raycaster(e, t), [c] = s.intersectObjects(d.scene.children, !0);
|
|
155
|
-
return !!c && /^video/.test(c.object.name);
|
|
156
|
-
}).length >= 2;
|
|
157
|
-
}) || l(!0);
|
|
158
|
-
}), d.on("renderFrame", () => {
|
|
159
|
-
r.videoMeshes.forEach((e) => {
|
|
148
|
+
return s.on("modeChange", b), s.on("wantsTapGesture", v), s.on("panoArrived", w), s.on("renderFrame", () => {
|
|
149
|
+
t.videoMeshes.forEach((e) => {
|
|
160
150
|
e && (e.needsRender = !0);
|
|
161
151
|
});
|
|
162
|
-
}),
|
|
152
|
+
}), { enable: T, disable: g, load: P, dispose: V, state: t, css3DRenderPlugin: f };
|
|
163
153
|
};
|
|
164
154
|
export {
|
|
165
|
-
|
|
166
|
-
|
|
155
|
+
q as ModelTVVideoPlugin,
|
|
156
|
+
q as default
|
|
167
157
|
};
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import "./Plugin.js";
|
|
2
|
-
import { ModelTVVideoPlugin as
|
|
3
|
-
import { DIRECTION as
|
|
2
|
+
import { ModelTVVideoPlugin as M, ModelTVVideoPlugin as P } from "./Plugin.js";
|
|
3
|
+
import { DIRECTION as x } from "./typings.js";
|
|
4
4
|
import "three";
|
|
5
5
|
import "./utils/parseData.js";
|
|
6
|
+
import "../CSS3DRenderPlugin/index.js";
|
|
7
|
+
import "../CSS3DRenderPlugin/Controller.js";
|
|
8
|
+
import "../CSS3DRenderPlugin/CSS3DRender.js";
|
|
9
|
+
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
10
|
+
import "../shared-utils/Subscribe.js";
|
|
11
|
+
import "../CSS3DRenderPlugin/utils/evenNumber.js";
|
|
12
|
+
import "../CSS3DRenderPlugin/utils/positionToVector3.js";
|
|
13
|
+
import "../CSS3DRenderPlugin/utils/CSS3DObjectPlus.js";
|
|
14
|
+
import "../CSS3DRenderPlugin/utils/centerPoint.js";
|
|
6
15
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
16
|
+
x as DIRECTION,
|
|
17
|
+
M as ModelTVVideoPlugin,
|
|
18
|
+
P as default
|
|
10
19
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DIRECTION, Point } from
|
|
1
|
+
import { DIRECTION, Point } from '../typings';
|
|
2
2
|
export declare function parseModelTVVideoPoints(points: Point[][] | Record<DIRECTION, Point>[]): Point[][];
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { DIRECTION as e } from "../typings.js";
|
|
2
|
-
|
|
3
|
-
function u(r) {
|
|
2
|
+
function f(r) {
|
|
4
3
|
if (r.length === 0)
|
|
5
4
|
return [];
|
|
6
5
|
if (Array.isArray(r[0]))
|
|
7
6
|
return r;
|
|
8
|
-
let
|
|
9
|
-
return r.
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
let O = [];
|
|
8
|
+
return r.forEach((T) => {
|
|
9
|
+
const n = [
|
|
10
|
+
T[e.TOP_LEFT],
|
|
11
|
+
T[e.BOTTOM_LEFT],
|
|
12
|
+
T[e.BOTTOM_RIGHT],
|
|
13
|
+
T[e.TOP_RIGHT]
|
|
14
|
+
];
|
|
15
|
+
O.push(n);
|
|
16
|
+
}), O;
|
|
13
17
|
}
|
|
14
18
|
export {
|
|
15
|
-
|
|
19
|
+
f as parseModelTVVideoPoints
|
|
16
20
|
};
|
|
@@ -6,19 +6,22 @@ import { Five as M } from "@realsee/five";
|
|
|
6
6
|
import { Controller as b } from "../base/BasePluginWithData.js";
|
|
7
7
|
import { getRoomInfoInstance as D } from "./getRoomInfoInstance.js";
|
|
8
8
|
import { loadTexture as u } from "../shared-utils/three/loadTexture.js";
|
|
9
|
-
import { CSS3DRenderPlugin as w } from "../CSS3DRenderPlugin/
|
|
9
|
+
import { CSS3DRenderPlugin as w } from "../CSS3DRenderPlugin/index.js";
|
|
10
10
|
import { tweenProgress as P } from "../shared-utils/animationFrame/BetterTween.js";
|
|
11
11
|
import "../base/BasePlugin.js";
|
|
12
12
|
import "./Assets/roomInfoIcon.js";
|
|
13
|
+
import "../CSS3DRenderPlugin/Controller.js";
|
|
14
|
+
import "../CSS3DRenderPlugin/CSS3DRender.js";
|
|
13
15
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
14
|
-
import "../shared-utils/
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../CSS3DRenderPlugin/utils/
|
|
16
|
+
import "../shared-utils/Subscribe.js";
|
|
17
|
+
import "../CSS3DRenderPlugin/utils/evenNumber.js";
|
|
18
|
+
import "../CSS3DRenderPlugin/utils/positionToVector3.js";
|
|
19
|
+
import "../CSS3DRenderPlugin/utils/CSS3DObjectPlus.js";
|
|
20
|
+
import "../CSS3DRenderPlugin/utils/centerPoint.js";
|
|
18
21
|
import "@tweenjs/tween.js";
|
|
19
22
|
import "../shared-utils/animationFrame/index.js";
|
|
20
23
|
const p = { userAction: !0 };
|
|
21
|
-
class
|
|
24
|
+
class J extends b {
|
|
22
25
|
constructor(e, t) {
|
|
23
26
|
super(e);
|
|
24
27
|
i(this, "state", {
|
|
@@ -68,18 +71,18 @@ class L extends b {
|
|
|
68
71
|
e !== this.five.panoIndex && ((t = this.compassMeshTween) == null || t.dispose(), (s = this.compassMesh) == null || s.material.setValues({ opacity: 0 }));
|
|
69
72
|
});
|
|
70
73
|
i(this, "onFivePanoArrived", (e) => {
|
|
71
|
-
var s, o, r,
|
|
74
|
+
var s, o, r, m, l, f, d;
|
|
72
75
|
const t = (r = (o = (s = this.five.work) == null ? void 0 : s.observers) == null ? void 0 : o[e]) == null ? void 0 : r.standingPosition;
|
|
73
|
-
if (this.compassMesh && (this.compassMesh.position.copy(t.clone().setY(t.y + 0.01)), this.compassMesh.material.opacity === 0 && ((
|
|
74
|
-
var
|
|
75
|
-
(
|
|
76
|
+
if (this.compassMesh && (this.compassMesh.position.copy(t.clone().setY(t.y + 0.01)), this.compassMesh.material.opacity === 0 && ((m = this.compassMeshTween) == null || m.dispose(), this.compassMeshTween = P(1e3).onUpdate(({ progress: v }) => {
|
|
77
|
+
var c;
|
|
78
|
+
(c = this.compassMesh) == null || c.material.setValues({ opacity: v }), this.five.needsRender = !0;
|
|
76
79
|
}).play())), this.entryDoorMesh) {
|
|
77
|
-
const
|
|
80
|
+
const c = new n.Vector3(
|
|
78
81
|
this.data.entrance.position.x,
|
|
79
82
|
this.data.entrance.position.y,
|
|
80
83
|
this.data.entrance.position.z
|
|
81
|
-
).clone().setY(t.y).sub(t).normalize(), I = t.clone().add(
|
|
82
|
-
this.entryDoorMesh.rotation.z = new n.Vector3(0, 0, -1).angleTo(
|
|
84
|
+
).clone().setY(t.y).sub(t).normalize(), I = t.clone().add(c.clone().multiplyScalar(0.7)).setY(t.y + 0.01);
|
|
85
|
+
this.entryDoorMesh.rotation.z = new n.Vector3(0, 0, -1).angleTo(c), this.entryDoorMesh.position.copy(I), ((l = this.data) == null ? void 0 : l.room_observers[e].room.type) === 1 ? (f = this.entryDoorMesh) == null || f.material.setValues({ opacity: 1 }) : (d = this.entryDoorMesh) == null || d.material.setValues({ opacity: 0 });
|
|
83
86
|
}
|
|
84
87
|
this.roomInfoInstance && this.roomInfoWrapperInstance && (this.roomInfoWrapperInstance.css3DObject.position.copy(
|
|
85
88
|
t.clone().setY(t.y + 0.01)
|
|
@@ -164,10 +167,10 @@ class L extends b {
|
|
|
164
167
|
return e.version && e.data ? Promise.resolve(e.data) : Promise.resolve(e);
|
|
165
168
|
}
|
|
166
169
|
async init() {
|
|
167
|
-
var s, o, r,
|
|
170
|
+
var s, o, r, m;
|
|
168
171
|
const e = (o = (s = this.data) == null ? void 0 : s.north_rad) != null ? o : null;
|
|
169
172
|
this._clearCompassIfNeed(), e !== null && (this.compassMesh = await this.loadCompassMesh(), this.compassMesh.rotateX(-Math.PI / 2), this.compassMesh.rotateZ(e - Math.PI / 2), this.group.add(this.compassMesh));
|
|
170
|
-
const t = (
|
|
173
|
+
const t = (m = (r = this.data) == null ? void 0 : r.entrance) != null ? m : null;
|
|
171
174
|
this._clearEntryDoorIfNeed(), t !== null && (this.entryDoorMesh = await this.loadEntryDoorMesh(), this.roomInfoWrapperInstance = this.loadRoomInfo(), this.roomInfoInstance = D(), this.entryDoorMesh.rotateX(-Math.PI / 2), this.roomInfoWrapperInstance && this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container), this.group.add(this.entryDoorMesh)), this.onFivePanoArrived(this.five.panoIndex || 0), this.five.needsRender = !0;
|
|
172
175
|
}
|
|
173
176
|
async loadCompassMesh() {
|
|
@@ -199,5 +202,5 @@ class L extends b {
|
|
|
199
202
|
}
|
|
200
203
|
}
|
|
201
204
|
export {
|
|
202
|
-
|
|
205
|
+
J as PanoCompassController
|
|
203
206
|
};
|
|
@@ -6,17 +6,20 @@ import "../base/BasePlugin.js";
|
|
|
6
6
|
import "./getRoomInfoInstance.js";
|
|
7
7
|
import "./Assets/roomInfoIcon.js";
|
|
8
8
|
import "../shared-utils/three/loadTexture.js";
|
|
9
|
-
import "../CSS3DRenderPlugin/
|
|
9
|
+
import "../CSS3DRenderPlugin/index.js";
|
|
10
|
+
import "../CSS3DRenderPlugin/Controller.js";
|
|
11
|
+
import "../CSS3DRenderPlugin/CSS3DRender.js";
|
|
10
12
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
11
|
-
import "../shared-utils/
|
|
12
|
-
import "../
|
|
13
|
-
import "../
|
|
14
|
-
import "../CSS3DRenderPlugin/utils/
|
|
13
|
+
import "../shared-utils/Subscribe.js";
|
|
14
|
+
import "../CSS3DRenderPlugin/utils/evenNumber.js";
|
|
15
|
+
import "../CSS3DRenderPlugin/utils/positionToVector3.js";
|
|
16
|
+
import "../CSS3DRenderPlugin/utils/CSS3DObjectPlus.js";
|
|
17
|
+
import "../CSS3DRenderPlugin/utils/centerPoint.js";
|
|
15
18
|
import "../shared-utils/animationFrame/BetterTween.js";
|
|
16
19
|
import "@tweenjs/tween.js";
|
|
17
20
|
import "../shared-utils/animationFrame/index.js";
|
|
18
|
-
const
|
|
21
|
+
const k = (o, r) => new t(o, r);
|
|
19
22
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
k as PanoCompassPlugin,
|
|
24
|
+
k as default
|
|
22
25
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var n = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var i = (s, t, e) => (
|
|
4
|
-
import { Five as
|
|
2
|
+
var h = (s, t, e) => t in s ? n(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var i = (s, t, e) => (h(s, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import { Five as o } from "@realsee/five";
|
|
5
5
|
import { Controller as l } from "../base/BasePlugin.js";
|
|
6
|
-
class
|
|
6
|
+
class p extends l {
|
|
7
7
|
constructor(e) {
|
|
8
8
|
super(e);
|
|
9
9
|
i(this, "state");
|
|
10
10
|
i(this, "container");
|
|
11
11
|
i(this, "enabled");
|
|
12
|
-
this.five = e, this.five.once("dispose", this.dispose), this.enabled = !0, this.state = this.initState()
|
|
12
|
+
this.five = e, this.five.once("dispose", this.dispose), this.enabled = !0, this.state = this.initState();
|
|
13
13
|
}
|
|
14
14
|
enable(e) {
|
|
15
15
|
this.enabled = !0, this.updateState({ ...e, userAction: !0 });
|
|
@@ -35,7 +35,7 @@ class c extends l {
|
|
|
35
35
|
this.state = { ...this.state, ...e, ...a }, this.stateChangedCallback(r, a);
|
|
36
36
|
}
|
|
37
37
|
get visible() {
|
|
38
|
-
return this.five.state.mode ===
|
|
38
|
+
return this.five.state.mode === o.Mode.Panorama;
|
|
39
39
|
}
|
|
40
40
|
appendTo(e) {
|
|
41
41
|
!this.enabled || (this.container = e, this.render());
|
|
@@ -45,5 +45,5 @@ class c extends l {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
p as BasePanoPluginController
|
|
49
49
|
};
|