@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.
Files changed (95) hide show
  1. package/dist/index.cjs.js +2 -2
  2. package/dist/index.es.js +2 -2
  3. package/dist/index.js +2 -2
  4. package/dist/index.umd.js +2 -2
  5. package/docs/classes/CruisePluginController.html +14 -14
  6. package/docs/classes/Magnifier.html +4 -4
  7. package/docs/classes/ModelRoomLabelController.html +4 -4
  8. package/docs/classes/PaintBrush.html +3 -3
  9. package/docs/enums/CameraMovementEffect.html +2 -2
  10. package/docs/enums/DIRECTION.html +1 -1
  11. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  12. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  13. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  14. package/docs/enums/PaintBrushTypeEnum.html +1 -1
  15. package/docs/enums/Rotation.html +2 -2
  16. package/docs/index.html +1 -1
  17. package/docs/interfaces/CSS3DRenderPluginEventMap.html +2 -2
  18. package/docs/interfaces/CSS3DRenderPluginState.html +2 -2
  19. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  20. package/docs/interfaces/FloorplanBounding.html +4 -4
  21. package/docs/interfaces/FloorplanData.html +2 -2
  22. package/docs/interfaces/FloorplanEntrance.html +7 -7
  23. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  24. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  25. package/docs/interfaces/FloorplanFloorData.html +2 -2
  26. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  27. package/docs/interfaces/FloorplanObserver.html +2 -2
  28. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  29. package/docs/interfaces/FloorplanPosition.html +2 -2
  30. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  31. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  32. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  33. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  34. package/docs/interfaces/FloorplanServerData.html +2 -2
  35. package/docs/interfaces/FloorplanServerDoorItem.html +1 -1
  36. package/docs/interfaces/FloorplanServerDoorPosition.html +1 -1
  37. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  38. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  39. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  40. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  41. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  42. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  43. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  44. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  45. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  46. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  47. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  48. package/docs/interfaces/LineJson.html +1 -1
  49. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  50. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  51. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  52. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  53. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  54. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  55. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  56. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  57. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  58. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  59. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  60. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  61. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  62. package/docs/interfaces/OpenParameter.html +2 -2
  63. package/docs/interfaces/PaintBrushAction.html +7 -7
  64. package/docs/interfaces/PaintBrushConfigs.html +1 -1
  65. package/docs/interfaces/PaintBrushState.html +1 -1
  66. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  67. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  68. package/docs/interfaces/PanoMeasureParameterType.html +2 -2
  69. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  70. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  71. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  72. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
  73. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
  74. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
  75. package/docs/interfaces/PanoRulerProPluginState.html +1 -1
  76. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  77. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  78. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  79. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  80. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  81. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  82. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  83. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  84. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  85. package/docs/interfaces/Point.html +1 -1
  86. package/docs/interfaces/PointJson.html +1 -1
  87. package/docs/interfaces/Room.html +1 -1
  88. package/docs/interfaces/RoomInfo.html +1 -1
  89. package/docs/interfaces/RoomLabel.html +7 -7
  90. package/docs/interfaces/RoomRules.html +1 -1
  91. package/docs/interfaces/Rooms.html +1 -1
  92. package/docs/modules.html +17 -17
  93. package/libs/CruisePlugin/Controller.js +1 -1
  94. package/libs/ModelTVVideoPlugin/Plugin.js +51 -51
  95. 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 || e.start !== void 0 && e.end !== void 0 && e.end - e.start, !!i)
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
- }, f = I(s), y = /* @__PURE__ */ new Map(), M = (e) => {
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((n) => s.scene.add(n));
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 n = () => {
30
+ const o = () => {
31
31
  var i;
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);
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", n), t.videoTexture && t.videoMeshes.length && (t.videoTexture.image.play(), t.videoTexture.image.onplay = () => {
37
- f.hide();
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
- f.show();
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, n) => {
53
- const i = new d.BufferGeometry(), o = 128, a = [];
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 < o; r++)
55
+ for (let r = 1; r < n; r++)
56
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
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 < o; r++)
62
+ for (let r = 1; r < n; r++)
63
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
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 < o; r++)
72
- c.push(0, 1 - r / o);
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 < o; r++)
75
- c.push(1, r / o);
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 < o; r++)
79
- u.push(r, r + 1, o * 2 - r, r, o * 2 - r, o * 2 + 1 - r);
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 m = new d.MeshBasicMaterial({
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, 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);
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 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) => {
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
- 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);
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
- 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();
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 n = t.videoMeshes;
120
- if (!(!n || e.intersectObjects(n).length === 0))
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" ? f.hide() : f.show();
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((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();
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 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);
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
- (!n || n.length === 0) && M(!0);
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: f };
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--alpha.1",
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",