@realsee/dnalogel 2.0.0-alpha.12 → 2.0.0-alpha.15

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 (122) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +78 -28
  3. package/dist/CSS3DRenderPlugin/index.js +17 -14
  4. package/dist/CameraMovementPlugin/index.js +40 -15
  5. package/dist/ModelChassisCompassPlugin/index.js +32 -6
  6. package/dist/ModelEntryDoorGuidePlugin/index.js +48 -18
  7. package/dist/ModelItemLabelPlugin/index.js +81 -95
  8. package/dist/ModelRoomLabelPlugin/index.js +67 -26
  9. package/dist/ModelTVVideoPlugin/index.d.ts +4 -0
  10. package/dist/ModelTVVideoPlugin/index.js +326 -0
  11. package/dist/ModelTVVideoPlugin/typings.d.ts +25 -0
  12. package/dist/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  13. package/dist/PanoCompassPlugin/index.js +311 -164
  14. package/dist/PanoCursorRaycasterPlugin/index.js +5 -3
  15. package/dist/PanoMeasurePlugin/index.js +1335 -581
  16. package/dist/PanoRulerPlugin/index.js +32 -5
  17. package/dist/PanoSpatialTagPlugin/index.js +64 -29
  18. package/dist/floorplan/ModelFloorplanPlugin/index.js +586 -362
  19. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +164 -72
  20. package/dist/floorplan/TopviewFloorplanPlugin/index.js +311 -153
  21. package/dist/index.d.ts +3 -0
  22. package/dist/index.es.js +2999 -1419
  23. package/dist/index.js +3003 -1422
  24. package/dist/index.umd.js +3003 -1422
  25. package/docs/assets/search.js +1 -1
  26. package/docs/classes/ModelRoomLabelController.html +6 -6
  27. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  28. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  29. package/docs/index.html +78 -33
  30. package/docs/interfaces/LineJson.html +1 -1
  31. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  32. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  33. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  34. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  35. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  36. package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
  37. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  38. package/docs/interfaces/ModelItemLabelPluginData.html +1 -0
  39. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -0
  40. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -0
  41. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  42. package/docs/interfaces/ModelTVVideoPluginData.html +1 -0
  43. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -0
  44. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -0
  45. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  46. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  47. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  48. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  49. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  50. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  51. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  52. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  53. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  54. package/docs/interfaces/PointJson.html +1 -1
  55. package/docs/interfaces/RoomLabel.html +7 -7
  56. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +1 -1
  57. package/docs/modules.html +12 -12
  58. package/libs/CSS3DRenderPlugin/index.js +16 -13
  59. package/libs/CameraMovementPlugin/index.js +24 -15
  60. package/libs/ModelChassisCompassPlugin/index.js +14 -5
  61. package/libs/ModelEntryDoorGuidePlugin/index.js +24 -12
  62. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +54 -67
  63. package/libs/ModelItemLabelPlugin/index.js +8 -59
  64. package/libs/ModelItemLabelPlugin/utils/parseData.js +1 -4
  65. package/libs/ModelRoomLabelPlugin/Controller.js +64 -23
  66. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +3 -3
  67. package/libs/ModelTVVideoPlugin/index.d.ts +4 -0
  68. package/libs/ModelTVVideoPlugin/index.js +263 -0
  69. package/libs/ModelTVVideoPlugin/typings.d.ts +25 -0
  70. package/libs/ModelTVVideoPlugin/typings.js +7 -0
  71. package/libs/ModelTVVideoPlugin/utils/parseData.d.ts +2 -0
  72. package/libs/ModelTVVideoPlugin/utils/parseData.js +13 -0
  73. package/libs/PanoCompassPlugin/index.js +225 -128
  74. package/libs/PanoCursorRaycasterPlugin/index.js +5 -3
  75. package/libs/PanoMeasurePlugin/Controller/BaseController.js +68 -13
  76. package/libs/PanoMeasurePlugin/Controller/EditController.js +267 -154
  77. package/libs/PanoMeasurePlugin/Controller/ShortcutKeyController.js +40 -20
  78. package/libs/PanoMeasurePlugin/Controller/WatchController.js +234 -152
  79. package/libs/PanoMeasurePlugin/Controller/index.js +131 -47
  80. package/libs/PanoMeasurePlugin/Model/index.js +30 -5
  81. package/libs/PanoMeasurePlugin/Model/line.js +60 -10
  82. package/libs/PanoMeasurePlugin/Model/point.js +24 -4
  83. package/libs/PanoMeasurePlugin/Model/polyline.js +20 -3
  84. package/libs/PanoMeasurePlugin/Modules/DeleteDom/index.js +59 -14
  85. package/libs/PanoMeasurePlugin/Modules/FiveHelper.js +23 -8
  86. package/libs/PanoMeasurePlugin/Modules/GuideController.js +61 -26
  87. package/libs/PanoMeasurePlugin/Modules/Magnifier.js +60 -10
  88. package/libs/PanoMeasurePlugin/Modules/UIController/MainBtnController.js +83 -37
  89. package/libs/PanoMeasurePlugin/Modules/UIController/Revoke/index.js +52 -17
  90. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +61 -30
  91. package/libs/PanoMeasurePlugin/utils/distanceDom.js +3 -2
  92. package/libs/PanoMeasurePlugin/utils/line.js +8 -7
  93. package/libs/PanoRulerPlugin/index.js +16 -5
  94. package/libs/PanoSpatialTagPlugin/index.js +11 -9
  95. package/libs/floorplan/Components/BaseImage.js +10 -5
  96. package/libs/floorplan/Components/RoomHighlight/RoomHighlight.js +3 -1
  97. package/libs/floorplan/Components/RoomMaterials/RoomMaterial.js +5 -6
  98. package/libs/floorplan/ModelFloorplanPlugin/Components/Compass.js +7 -2
  99. package/libs/floorplan/ModelFloorplanPlugin/Components/RoomLabels/RoomLabel.js +3 -1
  100. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +456 -273
  101. package/libs/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +33 -22
  102. package/libs/floorplan/PanoFloorplanRadarPlugin/Components/CurrentFloor/CurrentFloor.js +3 -1
  103. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +97 -36
  104. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +231 -108
  105. package/libs/floorplan/utils/formatData.js +43 -28
  106. package/libs/floorplan/utils/formatPosition.js +1 -1
  107. package/libs/index.d.ts +3 -0
  108. package/libs/index.js +1 -1
  109. package/libs/shared-utils/Subscribe.js +8 -1
  110. package/libs/shared-utils/animationFrame/BetterTween.js +47 -18
  111. package/libs/shared-utils/createCanvasTextTexture.js +6 -5
  112. package/libs/shared-utils/five/changeMode.js +23 -12
  113. package/libs/shared-utils/getPxmm.js +1 -1
  114. package/libs/shared-utils/math/evenNumber.js +1 -1
  115. package/libs/shared-utils/three/loadFbxObj.js +20 -9
  116. package/libs/shared-utils/three/loadTexture.js +17 -6
  117. package/libs/shared-utils/three/transfromToMeshBasicMaterial.js +2 -1
  118. package/libs/shared-utils/tinyEJSrender.js +36 -6
  119. package/libs/shared-utils/to.js +21 -10
  120. package/libs/shared-utils/useDebounce.js +1 -1
  121. package/libs/shared-utils/useThrottle.js +2 -1
  122. package/package.json +2 -1
@@ -0,0 +1,326 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var THREE = require('three');
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
26
+
27
+ /*! *****************************************************************************
28
+ Copyright (c) Microsoft Corporation.
29
+
30
+ Permission to use, copy, modify, and/or distribute this software for any
31
+ purpose with or without fee is hereby granted.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
34
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
35
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
36
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
37
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39
+ PERFORMANCE OF THIS SOFTWARE.
40
+ ***************************************************************************** */
41
+
42
+ function __awaiter(thisArg, _arguments, P, generator) {
43
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
44
+ return new (P || (P = Promise))(function (resolve, reject) {
45
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
46
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
47
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
48
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
49
+ });
50
+ }
51
+
52
+ var DIRECTION;
53
+ (function (DIRECTION) {
54
+ DIRECTION["TOP_LEFT"] = "topLeft";
55
+ DIRECTION["TOP_RIGHT"] = "topRight";
56
+ DIRECTION["BOTTOM_LEFT"] = "bottomLeft";
57
+ DIRECTION["BOTTOM_RIGHT"] = "bottomRight";
58
+ })(DIRECTION || (DIRECTION = {}));
59
+
60
+ function parseModelTVVideoPoints(points) {
61
+ if (points.length === 0)
62
+ return [];
63
+ if (Array.isArray(points[0]))
64
+ return points;
65
+ let newPoints = [];
66
+ points.map(point => {
67
+ const newPoint = [point[DIRECTION.TOP_LEFT], point[DIRECTION.BOTTOM_LEFT], point[DIRECTION.BOTTOM_RIGHT], point[DIRECTION.TOP_RIGHT]];
68
+ newPoints.push(newPoint);
69
+ });
70
+ return newPoints;
71
+ }
72
+
73
+ const ModelTVVideoPlugin = (five, { videoElement }) => {
74
+ const state = {
75
+ videoMeshes: [],
76
+ videoTextureEnabled: false,
77
+ videoSource: '',
78
+ rectPoints: [],
79
+ enabled: false,
80
+ videoElement: videoElement,
81
+ };
82
+ const setMuted = (muted) => {
83
+ if (state.videoTexture) {
84
+ state.videoTexture.image.muted = muted;
85
+ state.videoTexture.image.play();
86
+ }
87
+ };
88
+ const getMuted = () => {
89
+ if (state.videoTexture)
90
+ return state.videoTexture.image.muted;
91
+ else
92
+ return true;
93
+ };
94
+ const enable = () => {
95
+ if (state.enabled)
96
+ return;
97
+ if (!state.videoTexture)
98
+ return;
99
+ state.enabled = true;
100
+ state.videoMeshes = createPanoVideoMeshes();
101
+ console.log('state.videoMeshes', state.videoMeshes);
102
+ state.videoMeshes.forEach((mesh) => five.scene.add(mesh));
103
+ const play = () => {
104
+ console.log('play', state.videoTexture);
105
+ if (!state.videoTexture)
106
+ return;
107
+ const timeupdate = () => {
108
+ var _a;
109
+ if (!state.videoTexture)
110
+ return;
111
+ (_a = state.videoTexture) === null || _a === void 0 ? void 0 : _a.image.removeEventListener('timeupdate', timeupdate);
112
+ state.videoTextureEnabled = true;
113
+ state.videoMeshes.forEach((mesh) => {
114
+ if (mesh.material.map !== state.videoTexture)
115
+ mesh.material.map = state.videoTexture;
116
+ });
117
+ five.needsRender = true;
118
+ };
119
+ state.videoTexture.image.addEventListener('timeupdate', timeupdate);
120
+ if (state.videoTexture && state.videoMeshes.length) {
121
+ state.videoTexture.image.play();
122
+ }
123
+ };
124
+ if (five.model.loaded)
125
+ play();
126
+ else {
127
+ return five.once('modelLoaded', () => play());
128
+ }
129
+ };
130
+ const disable = () => {
131
+ if (!state.enabled)
132
+ return;
133
+ state.enabled = false;
134
+ state.videoMeshes.forEach((mesh) => {
135
+ mesh.geometry.dispose();
136
+ mesh.material.dispose();
137
+ five.scene.remove(mesh);
138
+ if (state.videoTexture)
139
+ state.videoTexture.image.pause();
140
+ });
141
+ state.videoMeshes = [];
142
+ five.needsRender = true;
143
+ };
144
+ const createPanoVideoMeshes = () => {
145
+ return state.rectPoints.map((points, index) => {
146
+ const geometry = new THREE__namespace.BufferGeometry();
147
+ const segments = 128;
148
+ const verticesArray = [];
149
+ verticesArray.push(points[0].x, points[0].y, points[0].z);
150
+ for (let i = 1; i < segments; i++) {
151
+ verticesArray.push(points[0].x + ((points[1].x - points[0].x) * i) / segments, points[0].y + ((points[1].y - points[0].y) * i) / segments, points[0].z + ((points[1].z - points[0].z) * i) / segments);
152
+ }
153
+ verticesArray.push(points[1].x, points[1].y, points[1].z);
154
+ verticesArray.push(points[2].x, points[2].y, points[2].z);
155
+ for (let i = 1; i < segments; i++) {
156
+ verticesArray.push(points[2].x + ((points[3].x - points[2].x) * i) / segments, points[2].y + ((points[3].y - points[2].y) * i) / segments, points[2].z + ((points[3].z - points[2].z) * i) / segments);
157
+ }
158
+ verticesArray.push(points[3].x, points[3].y, points[3].z);
159
+ const uvArray = [];
160
+ uvArray.push(0, 1);
161
+ for (let i = 1; i < segments; i++) {
162
+ uvArray.push(0, 1 - i / segments);
163
+ }
164
+ uvArray.push(0, 0);
165
+ uvArray.push(1, 0);
166
+ for (let i = 1; i < segments; i++) {
167
+ uvArray.push(1, i / segments);
168
+ }
169
+ uvArray.push(1, 1);
170
+ const indicesArray = [];
171
+ for (let i = 0; i < segments; i++) {
172
+ indicesArray.push(i, i + 1, segments * 2 - i, i, segments * 2 - i, segments * 2 + 1 - i);
173
+ }
174
+ geometry.setAttribute('position', new THREE__namespace.BufferAttribute(new Float32Array(verticesArray), 3));
175
+ geometry.setAttribute('uv', new THREE__namespace.BufferAttribute(new Float32Array(uvArray), 2));
176
+ geometry.setIndex(new THREE__namespace.BufferAttribute(new Uint32Array(indicesArray), 1));
177
+ const material = new THREE__namespace.MeshBasicMaterial({
178
+ map: state.videoTextureEnabled ? state.videoTexture : state.imageTexture,
179
+ side: THREE__namespace.DoubleSide,
180
+ });
181
+ const mesh = new THREE__namespace.Mesh(geometry, material);
182
+ mesh.renderOrder = 1;
183
+ mesh.name = `ModelTVVideoPlugin-${index}-${performance.now()}`;
184
+ return mesh;
185
+ });
186
+ };
187
+ const getImageTexture = (source) => {
188
+ const texture = new THREE__namespace.TextureLoader().load(source);
189
+ texture.minFilter = THREE__namespace.LinearFilter;
190
+ texture.magFilter = THREE__namespace.LinearFilter;
191
+ texture.format = THREE__namespace.RGBFormat;
192
+ return texture;
193
+ };
194
+ const getVideoTexture = (source, video) => {
195
+ return new Promise((resolve, reject) => {
196
+ const xhr = new XMLHttpRequest();
197
+ xhr.onreadystatechange = () => {
198
+ if (xhr.readyState == 4) {
199
+ if (xhr.status == 200) {
200
+ const url = window.URL || window.webkitURL;
201
+ video = video || document.createElement('video');
202
+ video.crossOrigin = 'anonymous';
203
+ video.autoplay = true;
204
+ video.muted = true;
205
+ video.loop = true;
206
+ video.playsInline = true;
207
+ video.src = url.createObjectURL(xhr.response);
208
+ const texture = new THREE__namespace.VideoTexture(video);
209
+ texture.minFilter = THREE__namespace.LinearFilter;
210
+ texture.magFilter = THREE__namespace.LinearFilter;
211
+ texture.format = THREE__namespace.RGBFormat;
212
+ resolve(Object.assign(texture, { videoSource: source }));
213
+ }
214
+ else {
215
+ reject(new Error('Video download Error: ' + xhr.status));
216
+ }
217
+ }
218
+ };
219
+ xhr.onerror = (error) => reject(error);
220
+ xhr.open('GET', source);
221
+ xhr.responseType = 'blob';
222
+ xhr.send();
223
+ });
224
+ };
225
+ const load = (data, videoElement) => __awaiter(void 0, void 0, void 0, function* () {
226
+ const { video_src, video_poster_src, points } = data;
227
+ state.videoSource = video_src;
228
+ // TODO 存疑,先处理多一次遍历 o(2n)
229
+ state.rectPoints = parseModelTVVideoPoints(points)
230
+ .map((items) => items.map(({ x, y, z }) => new THREE__namespace.Vector3(x, y, z)));
231
+ state.imageTexture = getImageTexture(video_poster_src);
232
+ if (videoElement) {
233
+ state.videoElement = videoElement;
234
+ }
235
+ state.videoTexture = yield getVideoTexture(state.videoSource, state.videoElement);
236
+ state.enabled = !!data.enable;
237
+ if (state.enabled)
238
+ enable();
239
+ });
240
+ const dispose = () => {
241
+ disable();
242
+ state.videoTexture = undefined;
243
+ five.off('modeChange', () => setMuted(true));
244
+ five.off('wantsTapGesture', (raycaster) => {
245
+ if (!state.enabled)
246
+ return;
247
+ const [intersect] = raycaster.intersectObjects(five.scene.children, true);
248
+ if (!!intersect && /^video/.test(intersect.object.name)) {
249
+ if (state.videoTexture)
250
+ setMuted(!state.videoTexture.image.muted);
251
+ return false;
252
+ }
253
+ });
254
+ five.off('panoArrived', () => {
255
+ if (!state.enabled)
256
+ return;
257
+ if (getMuted())
258
+ return;
259
+ const cameraPosition = five.camera.position;
260
+ const visible = state.rectPoints.find((points) => {
261
+ const centerVector = points.reduce((total, curr) => new THREE__namespace.Vector3(total.x + curr.x / points.length, total.y + curr.y / points.length, total.z + curr.z / points.length), new THREE__namespace.Vector3());
262
+ return (points.map((point) => new THREE__namespace.Vector3((point.x + centerVector.x) / 2, (point.y + centerVector.y) / 2, (point.z + centerVector.z) / 2)).filter((vector) => {
263
+ vector = vector.clone().sub(cameraPosition).normalize();
264
+ const raycaster = new THREE__namespace.Raycaster(cameraPosition, vector);
265
+ const [intersect] = raycaster.intersectObjects(five.scene.children, true);
266
+ return !!intersect && /^video/.test(intersect.object.name);
267
+ }).length >= 2);
268
+ });
269
+ if (!visible)
270
+ setMuted(true);
271
+ });
272
+ five.off('renderFrame', () => {
273
+ // console.log('renderFrame', state.videoMeshes)
274
+ state.videoMeshes.forEach((meshes) => {
275
+ if (meshes)
276
+ //@ts-ignore
277
+ meshes.needsRender = true;
278
+ });
279
+ });
280
+ };
281
+ five.on('modeChange', () => setMuted(true));
282
+ five.on('wantsTapGesture', (raycaster) => {
283
+ if (!state.enabled)
284
+ return;
285
+ const targetMesh = five.scene.children.find(item => /^ModelTVVideoPlugin/.test(item.name));
286
+ if (!targetMesh)
287
+ return;
288
+ const intersectObjects = raycaster.intersectObjects([targetMesh]);
289
+ if (intersectObjects.length === 0)
290
+ return;
291
+ if (state.videoTexture)
292
+ setMuted(!state.videoTexture.image.muted); // TODO toggle video play
293
+ return false;
294
+ });
295
+ five.on('panoArrived', () => {
296
+ if (!state.enabled)
297
+ return;
298
+ if (getMuted())
299
+ return;
300
+ const cameraPosition = five.camera.position;
301
+ const visible = state.rectPoints.find((points) => {
302
+ const centerVector = points.reduce((total, curr) => new THREE__namespace.Vector3(total.x + curr.x / points.length, total.y + curr.y / points.length, total.z + curr.z / points.length), new THREE__namespace.Vector3());
303
+ return (points.map((point) => new THREE__namespace.Vector3((point.x + centerVector.x) / 2, (point.y + centerVector.y) / 2, (point.z + centerVector.z) / 2)).filter((vector) => {
304
+ vector = vector.clone().sub(cameraPosition).normalize();
305
+ const raycaster = new THREE__namespace.Raycaster(cameraPosition, vector);
306
+ const [intersect] = raycaster.intersectObjects(five.scene.children, true);
307
+ return !!intersect && /^video/.test(intersect.object.name);
308
+ }).length >= 2);
309
+ });
310
+ if (!visible)
311
+ setMuted(true);
312
+ });
313
+ five.on('renderFrame', () => {
314
+ // console.log('renderFrame', state.videoMeshes)
315
+ state.videoMeshes.forEach((meshes) => {
316
+ if (meshes)
317
+ //@ts-ignore
318
+ meshes.needsRender = true;
319
+ });
320
+ });
321
+ Object.assign(window, { $state: state });
322
+ return { enable, disable, load, dispose };
323
+ };
324
+
325
+ exports.ModelTVVideoPlugin = ModelTVVideoPlugin;
326
+ exports["default"] = ModelTVVideoPlugin;
@@ -0,0 +1,25 @@
1
+ export interface ModelTVVideoPluginParameterType {
2
+ videoElement?: HTMLVideoElement;
3
+ }
4
+ export declare enum DIRECTION {
5
+ TOP_LEFT = "topLeft",
6
+ TOP_RIGHT = "topRight",
7
+ BOTTOM_LEFT = "bottomLeft",
8
+ BOTTOM_RIGHT = "bottomRight"
9
+ }
10
+ export interface Point {
11
+ x: number;
12
+ y: number;
13
+ z: number;
14
+ }
15
+ export interface ModelTVVideoPluginData {
16
+ enable?: boolean;
17
+ video_src: string;
18
+ video_poster_src: string;
19
+ points: Point[][] | Record<DIRECTION, Point>[];
20
+ }
21
+ export interface ModelTVVideoPluginExportType {
22
+ enable: () => void;
23
+ disable: () => void;
24
+ load: (data: ModelTVVideoPluginData, videoElement?: HTMLVideoElement) => Promise<void>;
25
+ }
@@ -0,0 +1,2 @@
1
+ import { DIRECTION, Point } from "../typings";
2
+ export declare function parseModelTVVideoPoints(points: Point[][] | Record<DIRECTION, Point>[]): Point[][];