@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.
Files changed (135) hide show
  1. package/dist/index.cjs.js +46 -46
  2. package/dist/index.es.js +4100 -3838
  3. package/dist/index.js +4100 -3838
  4. package/dist/index.umd.js +34 -34
  5. package/docs/assets/search.js +1 -1
  6. package/docs/classes/CruisePluginController.html +14 -14
  7. package/docs/classes/Magnifier.html +4 -4
  8. package/docs/classes/ModelRoomLabelController.html +4 -4
  9. package/docs/classes/PaintBrush.html +8 -0
  10. package/docs/enums/CameraMovementEffect.html +2 -2
  11. package/docs/enums/DIRECTION.html +1 -1
  12. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  13. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  14. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  15. package/docs/enums/PaintBrushTypeEnum.html +1 -0
  16. package/docs/enums/Rotation.html +2 -2
  17. package/docs/index.html +2 -2
  18. package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -0
  19. package/docs/interfaces/CSS3DRenderPluginState.html +3 -0
  20. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  21. package/docs/interfaces/FloorplanBounding.html +4 -4
  22. package/docs/interfaces/FloorplanData.html +2 -2
  23. package/docs/interfaces/FloorplanEntrance.html +7 -7
  24. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  25. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  26. package/docs/interfaces/FloorplanFloorData.html +2 -2
  27. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  28. package/docs/interfaces/FloorplanObserver.html +2 -2
  29. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  30. package/docs/interfaces/FloorplanPosition.html +2 -2
  31. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  32. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  33. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  34. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  35. package/docs/interfaces/FloorplanServerData.html +2 -2
  36. package/docs/interfaces/FloorplanServerDoorItem.html +1 -1
  37. package/docs/interfaces/FloorplanServerDoorPosition.html +1 -1
  38. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  39. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  40. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  41. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  42. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  43. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  44. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  45. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  46. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  47. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  48. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  49. package/docs/interfaces/LineJson.html +1 -1
  50. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  51. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  52. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  53. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  54. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  55. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  56. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  57. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  58. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  59. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  60. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  61. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  62. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  63. package/docs/interfaces/OpenParameter.html +2 -2
  64. package/docs/interfaces/PaintBrushAction.html +13 -0
  65. package/docs/interfaces/PaintBrushConfigs.html +1 -0
  66. package/docs/interfaces/PaintBrushState.html +1 -0
  67. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  68. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  69. package/docs/interfaces/PanoMeasureParameterType.html +2 -2
  70. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  71. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  72. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  73. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
  74. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
  75. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
  76. package/docs/interfaces/PanoRulerProPluginState.html +1 -1
  77. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  78. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  79. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  80. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  81. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  82. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  83. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  84. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  85. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  86. package/docs/interfaces/Point.html +1 -1
  87. package/docs/interfaces/PointJson.html +1 -1
  88. package/docs/interfaces/Room.html +1 -1
  89. package/docs/interfaces/RoomInfo.html +1 -1
  90. package/docs/interfaces/RoomLabel.html +7 -7
  91. package/docs/interfaces/RoomRules.html +1 -1
  92. package/docs/interfaces/Rooms.html +1 -1
  93. package/docs/modules.html +17 -20
  94. package/libs/CSS3DRenderPlugin/CSS3DRender.d.ts +156 -0
  95. package/libs/CSS3DRenderPlugin/CSS3DRender.js +246 -0
  96. package/libs/CSS3DRenderPlugin/Controller.d.ts +78 -0
  97. package/libs/CSS3DRenderPlugin/Controller.js +59 -0
  98. package/libs/CSS3DRenderPlugin/index.d.ts +4 -3
  99. package/libs/CSS3DRenderPlugin/index.js +10 -8
  100. package/libs/CSS3DRenderPlugin/typing.d.ts +26 -0
  101. package/libs/CSS3DRenderPlugin/typing.js +1 -0
  102. package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.d.ts +16 -0
  103. package/libs/CSS3DRenderPlugin/utils/CSS3DObjectPlus.js +48 -0
  104. package/libs/CSS3DRenderPlugin/utils/centerPoint.d.ts +2 -0
  105. package/libs/CSS3DRenderPlugin/utils/centerPoint.js +10 -0
  106. package/libs/CSS3DRenderPlugin/utils/evenNumber.d.ts +3 -0
  107. package/libs/CSS3DRenderPlugin/utils/evenNumber.js +7 -0
  108. package/libs/CSS3DRenderPlugin/utils/index.d.ts +4 -0
  109. package/libs/CSS3DRenderPlugin/utils/index.js +13 -0
  110. package/libs/CSS3DRenderPlugin/utils/positionToVector3.d.ts +13 -0
  111. package/libs/CSS3DRenderPlugin/utils/positionToVector3.js +7 -0
  112. package/libs/CSS3DRenderPlugin/utils/random.d.ts +1 -0
  113. package/libs/CSS3DRenderPlugin/utils/random.js +6 -0
  114. package/libs/ModelTVVideoPlugin/Plugin.d.ts +1 -1
  115. package/libs/ModelTVVideoPlugin/Plugin.js +129 -139
  116. package/libs/ModelTVVideoPlugin/index.js +14 -5
  117. package/libs/ModelTVVideoPlugin/typings.js +0 -1
  118. package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +1 -1
  119. package/libs/ModelTVVideoPlugin/utils/parseData.js +12 -8
  120. package/libs/PanoCompassPlugin/Controller.js +19 -16
  121. package/libs/PanoCompassPlugin/index.js +11 -8
  122. package/libs/PanoDoorLabelPlugin/BaseController.js +7 -7
  123. package/libs/PanoSpatialTagPlugin/Plugin.js +11 -8
  124. package/libs/PanoSpatialTagPlugin/index.js +11 -8
  125. package/libs/index.js +80 -76
  126. package/libs/shared-utils/Subscribe.d.ts +41 -25
  127. package/libs/shared-utils/Subscribe.js +37 -45
  128. package/package.json +1 -1
  129. package/docs/interfaces/CSS3DRenderPluginExportType.html +0 -4
  130. package/libs/CSS3DRenderPlugin/Plugin.d.ts +0 -49
  131. package/libs/CSS3DRenderPlugin/Plugin.js +0 -80
  132. package/libs/CSS3DRenderPlugin/utils/createResizeObserver.d.ts +0 -7
  133. package/libs/CSS3DRenderPlugin/utils/createResizeObserver.js +0 -17
  134. package/libs/shared-utils/three/centerPoint.d.ts +0 -2
  135. package/libs/shared-utils/three/centerPoint.js +0 -7
@@ -0,0 +1,2 @@
1
+ import { Vector3 } from 'three';
2
+ export declare function centerPoint(...args: Vector3[]): Vector3;
@@ -0,0 +1,10 @@
1
+ import { Vector3 as r } from "three";
2
+ function c(...t) {
3
+ const e = new r();
4
+ return t.forEach((n) => {
5
+ e.add(n);
6
+ }), e.divideScalar(t.length), e;
7
+ }
8
+ export {
9
+ c as centerPoint
10
+ };
@@ -0,0 +1,3 @@
1
+ export declare function evenNumber(num: number, config?: {
2
+ smaller?: boolean;
3
+ }): number;
@@ -0,0 +1,7 @@
1
+ function t(u, r) {
2
+ const e = Math.round(u);
3
+ return e % 2 === 0 ? e : e + Number(r != null && r.smaller ? -1 : 1);
4
+ }
5
+ export {
6
+ t as evenNumber
7
+ };
@@ -0,0 +1,4 @@
1
+ export * from './centerPoint';
2
+ export * from './evenNumber';
3
+ export * from './random';
4
+ export * from './positionToVector3';
@@ -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;
@@ -0,0 +1,6 @@
1
+ function n() {
2
+ return Math.random().toString(36).slice(-6);
3
+ }
4
+ export {
5
+ n as random
6
+ };
@@ -1,4 +1,4 @@
1
1
  import type { FivePlugin } from '@realsee/five';
2
- import type { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from "./typings";
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 u from "three";
2
- import { parseModelTVVideoPoints as V } from "./utils/parseData.js";
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
- const F = (d, { videoElement: y }) => {
5
- const r = {
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: y
12
- }, l = (e) => {
13
- r.videoTexture && (r.videoTexture.image.muted = e, r.videoTexture.image.play());
14
- }, f = () => r.videoTexture ? r.videoTexture.image.muted : !0, h = () => {
15
- if (r.enabled || !r.videoTexture)
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
- r.enabled = !0, r.videoMeshes = T(), r.videoMeshes.forEach((o) => d.scene.add(o));
26
+ t.enabled = !0, t.videoMeshes = R(), t.videoMeshes.forEach((n) => s.scene.add(n));
18
27
  const e = () => {
19
- if (!r.videoTexture)
28
+ if (!t.videoTexture)
20
29
  return;
21
- const o = () => {
30
+ const n = () => {
22
31
  var i;
23
- !r.videoTexture || ((i = r.videoTexture) == null || i.image.removeEventListener("timeupdate", o), r.videoTextureEnabled = !0, r.videoMeshes.forEach((n) => {
24
- n.material.map !== r.videoTexture && (n.material.map = r.videoTexture);
25
- }), d.needsRender = !0);
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
- r.videoTexture.image.addEventListener("timeupdate", o), r.videoTexture && r.videoMeshes.length && r.videoTexture.image.play();
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 (d.model.loaded)
44
+ if (s.model.loaded)
30
45
  e();
31
46
  else
32
- return d.once("modelLoaded", () => e());
33
- }, b = () => {
34
- !r.enabled || (r.enabled = !1, r.videoMeshes.forEach((e) => {
35
- e.geometry.dispose(), e.material.dispose(), d.scene.remove(e), r.videoTexture && r.videoTexture.image.pause();
36
- }), r.videoMeshes = [], d.needsRender = !0);
37
- }, T = () => r.rectPoints.map((e, o) => {
38
- const i = new u.BufferGeometry(), n = 128, t = [];
39
- t.push(e[0].x, e[0].y, e[0].z);
40
- for (let a = 1; a < n; a++)
41
- t.push(
42
- e[0].x + (e[1].x - e[0].x) * a / n,
43
- e[0].y + (e[1].y - e[0].y) * a / n,
44
- e[0].z + (e[1].z - e[0].z) * a / n
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
- t.push(e[1].x, e[1].y, e[1].z), t.push(e[2].x, e[2].y, e[2].z);
47
- for (let a = 1; a < n; a++)
48
- t.push(
49
- e[2].x + (e[3].x - e[2].x) * a / n,
50
- e[2].y + (e[3].y - e[2].y) * a / n,
51
- e[2].z + (e[3].z - e[2].z) * a / n
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
- t.push(e[3].x, e[3].y, e[3].z);
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
- for (let a = 0; a < n; a++)
64
- c.push(a, a + 1, n * 2 - a, a, n * 2 - a, n * 2 + 1 - a);
65
- i.setAttribute("position", new u.BufferAttribute(new Float32Array(t), 3)), i.setAttribute("uv", new u.BufferAttribute(new Float32Array(s), 2)), i.setIndex(new u.BufferAttribute(new Uint32Array(c), 1));
66
- const x = new u.MeshBasicMaterial({
67
- map: r.videoTextureEnabled ? r.videoTexture : r.imageTexture,
68
- side: u.DoubleSide
69
- }), m = new u.Mesh(i, x);
70
- return m.renderOrder = 1, m.name = `ModelTVVideoPlugin-${o}-${performance.now()}`, m;
71
- }), g = (e) => {
72
- const o = new u.TextureLoader().load(e);
73
- return o.minFilter = u.LinearFilter, o.magFilter = u.LinearFilter, o.format = u.RGBFormat, o;
74
- }, w = (e, o) => new Promise((i, n) => {
75
- const t = new XMLHttpRequest();
76
- t.onreadystatechange = () => {
77
- if (t.readyState == 4)
78
- if (t.status == 200) {
79
- const s = window.URL || window.webkitURL;
80
- o = o || document.createElement("video"), o.crossOrigin = "anonymous", o.autoplay = !0, o.muted = !0, o.loop = !0, o.playsInline = !0, o.src = s.createObjectURL(t.response);
81
- const c = new u.VideoTexture(o);
82
- c.minFilter = u.LinearFilter, c.magFilter = u.LinearFilter, c.format = u.RGBFormat, i(Object.assign(c, { videoSource: e }));
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
- n(new Error("Video download Error: " + t.status));
85
- }, t.onerror = (s) => n(s), t.open("GET", e), t.responseType = "blob", t.send();
86
- }), v = async (e, o) => {
87
- const { video_src: i, video_poster_src: n, points: t } = e;
88
- r.videoSource = i, r.rectPoints = V(t).map((s) => s.map(({ x: c, y: x, z: m }) => new u.Vector3(c, x, m))), r.imageTexture = g(n), o && (r.videoElement = o), r.videoTexture = await w(r.videoSource, r.videoElement), r.enabled = !!e.enable, r.enabled && h();
89
- }, M = () => {
90
- b(), r.videoTexture = void 0, d.off("modeChange", () => l(!0)), d.off("wantsTapGesture", (e) => {
91
- if (!r.enabled)
92
- return;
93
- const [o] = e.intersectObjects(d.scene.children, !0);
94
- if (!!o && /^video/.test(o.object.name))
95
- return r.videoTexture && l(!r.videoTexture.image.muted), !1;
96
- }), d.off("panoArrived", () => {
97
- if (!r.enabled || f())
98
- return;
99
- const e = d.camera.position;
100
- r.rectPoints.find((i) => {
101
- const n = i.reduce(
102
- (t, s) => new u.Vector3(
103
- t.x + s.x / i.length,
104
- t.y + s.y / i.length,
105
- t.z + s.z / i.length
106
- ),
107
- new u.Vector3()
108
- );
109
- return i.map(
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
- }) || l(!0);
121
- }), d.off("renderFrame", () => {
122
- r.videoMeshes.forEach((e) => {
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 d.on("modeChange", () => l(!0)), d.on("wantsTapGesture", (e) => {
128
- if (!r.enabled)
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
- }), Object.assign(window, { $state: r }), { enable: h, disable: b, load: v, dispose: M };
152
+ }), { enable: T, disable: g, load: P, dispose: V, state: t, css3DRenderPlugin: f };
163
153
  };
164
154
  export {
165
- F as ModelTVVideoPlugin,
166
- F as default
155
+ q as ModelTVVideoPlugin,
156
+ q as default
167
157
  };
@@ -1,10 +1,19 @@
1
1
  import "./Plugin.js";
2
- import { ModelTVVideoPlugin as m, ModelTVVideoPlugin as t } from "./Plugin.js";
3
- import { DIRECTION as p } from "./typings.js";
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
- p as DIRECTION,
8
- m as ModelTVVideoPlugin,
9
- t as default
16
+ x as DIRECTION,
17
+ M as ModelTVVideoPlugin,
18
+ P as default
10
19
  };
@@ -1,4 +1,3 @@
1
- import "three";
2
1
  var o = /* @__PURE__ */ ((t) => (t.TOP_LEFT = "topLeft", t.TOP_RIGHT = "topRight", t.BOTTOM_LEFT = "bottomLeft", t.BOTTOM_RIGHT = "bottomRight", t))(o || {});
3
2
  export {
4
3
  o as DIRECTION
@@ -1,2 +1,2 @@
1
- import { DIRECTION, Point } from "../typings";
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
- import "three";
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 t = [];
9
- return r.map((T) => {
10
- const O = [T[e.TOP_LEFT], T[e.BOTTOM_LEFT], T[e.BOTTOM_RIGHT], T[e.TOP_RIGHT]];
11
- t.push(O);
12
- }), t;
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
- u as parseModelTVVideoPoints
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/Plugin.js";
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/math/evenNumber.js";
15
- import "../shared-utils/three/centerPoint.js";
16
- import "../shared-utils/three/transformPositionToVector3.js";
17
- import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
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 L extends b {
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, c, l, f, d;
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 && ((c = this.compassMeshTween) == null || c.dispose(), this.compassMeshTween = P(1e3).onUpdate(({ progress: v }) => {
74
- var m;
75
- (m = this.compassMesh) == null || m.material.setValues({ opacity: v }), this.five.needsRender = !0;
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 m = new n.Vector3(
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(m.clone().multiplyScalar(0.7)).setY(t.y + 0.01);
82
- this.entryDoorMesh.rotation.z = new n.Vector3(0, 0, -1).angleTo(m), 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 });
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, c;
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 = (c = (r = this.data) == null ? void 0 : r.entrance) != null ? c : null;
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
- L as PanoCompassController
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/Plugin.js";
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/math/evenNumber.js";
12
- import "../shared-utils/three/centerPoint.js";
13
- import "../shared-utils/three/transformPositionToVector3.js";
14
- import "../CSS3DRenderPlugin/utils/createResizeObserver.js";
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 b = (o, r) => new t(o, r);
21
+ const k = (o, r) => new t(o, r);
19
22
  export {
20
- b as PanoCompassPlugin,
21
- b as default
23
+ k as PanoCompassPlugin,
24
+ k as default
22
25
  };
@@ -1,15 +1,15 @@
1
1
  var n = Object.defineProperty;
2
- var o = (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) => (o(s, typeof t != "symbol" ? t + "" : t, e), e);
4
- import { Five as h } from "@realsee/five";
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 c extends l {
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(), console.log("base controller");
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 === h.Mode.Panorama;
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
- c as BasePanoPluginController
48
+ p as BasePanoPluginController
49
49
  };