@realsee/dnalogel 2.0.0-alpha.42 → 2.0.0-alpha.43

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 (130) hide show
  1. package/dist/CSS3DRenderPlugin/PanoCompassPlugin/index.d.ts +1 -1
  2. package/dist/CameraMovementPlugin/PanoCompassPlugin/index.d.ts +1 -1
  3. package/dist/CameraMovementPlugin/index.js +15 -40
  4. package/dist/ItemLabelPlugin/PanoCompassPlugin/index.d.ts +1 -1
  5. package/dist/ModelChassisCompassPlugin/PanoCompassPlugin/index.d.ts +1 -1
  6. package/dist/ModelChassisCompassPlugin/index.js +5 -30
  7. package/dist/ModelEntryDoorGuidePlugin/PanoCompassPlugin/index.d.ts +1 -1
  8. package/dist/ModelEntryDoorGuidePlugin/index.js +8 -33
  9. package/dist/ModelItemLabelPlugin/PanoCompassPlugin/index.d.ts +1 -1
  10. package/dist/ModelRoomLabelPlugin/PanoCompassPlugin/index.d.ts +1 -1
  11. package/dist/ModelTVVideoPlugin/PanoCompassPlugin/index.d.ts +1 -1
  12. package/dist/ModelTVVideoPlugin/index.js +3 -28
  13. package/dist/ModelViewPlugin/PanoCompassPlugin/index.d.ts +1 -1
  14. package/dist/PanoCompassPlugin/PanoCompassPlugin/index.d.ts +1 -1
  15. package/dist/PanoCompassPlugin/index.d.ts +1 -1
  16. package/dist/PanoCompassPlugin/index.js +64 -99
  17. package/dist/PanoCursorRaycasterPlugin/PanoCompassPlugin/index.d.ts +1 -1
  18. package/dist/PanoMeasurePlugin/PanoCompassPlugin/index.d.ts +1 -1
  19. package/dist/PanoRulerPlugin/PanoCompassPlugin/index.d.ts +1 -1
  20. package/dist/PanoRulerPlugin/index.js +3 -28
  21. package/dist/PanoRulerProPlugin/PanoCompassPlugin/index.d.ts +1 -1
  22. package/dist/PanoRulerProPlugin/index.js +29 -58
  23. package/dist/PanoSpatialTagPlugin/PanoCompassPlugin/index.d.ts +1 -1
  24. package/dist/floorplan/ModelFloorplanPlugin/PanoCompassPlugin/index.d.ts +1 -1
  25. package/dist/floorplan/ModelFloorplanPlugin/index.js +115 -156
  26. package/dist/floorplan/PanoFloorplanRadarPlugin/PanoCompassPlugin/index.d.ts +1 -1
  27. package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +71 -110
  28. package/dist/floorplan/TopviewFloorplanPlugin/PanoCompassPlugin/index.d.ts +1 -1
  29. package/dist/floorplan/TopviewFloorplanPlugin/index.js +114 -159
  30. package/dist/index.es.js +341 -416
  31. package/dist/index.js +341 -416
  32. package/dist/index.umd.js +341 -416
  33. package/docs/assets/search.js +1 -1
  34. package/docs/classes/Magnifier.html +4 -4
  35. package/docs/classes/ModelRoomLabelController.html +4 -4
  36. package/docs/enums/CameraMovementEffect.html +2 -2
  37. package/docs/enums/DIRECTION.html +1 -1
  38. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
  39. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  40. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
  41. package/docs/enums/Rotation.html +2 -2
  42. package/docs/index.html +2 -2
  43. package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
  44. package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
  45. package/docs/interfaces/FloorplanBounding.html +4 -4
  46. package/docs/interfaces/FloorplanData.html +2 -2
  47. package/docs/interfaces/FloorplanEntrance.html +7 -7
  48. package/docs/interfaces/FloorplanExtraObject.html +3 -3
  49. package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
  50. package/docs/interfaces/FloorplanFloorData.html +2 -2
  51. package/docs/interfaces/FloorplanImagePosition.html +2 -2
  52. package/docs/interfaces/FloorplanObserver.html +2 -2
  53. package/docs/interfaces/FloorplanOutlineItem.html +2 -2
  54. package/docs/interfaces/FloorplanPosition.html +2 -2
  55. package/docs/interfaces/FloorplanRoomItem.html +6 -6
  56. package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
  57. package/docs/interfaces/FloorplanServerBounding.html +4 -4
  58. package/docs/interfaces/FloorplanServerComputedData.html +1 -1
  59. package/docs/interfaces/FloorplanServerData.html +2 -2
  60. package/docs/interfaces/FloorplanServerEntrance.html +7 -7
  61. package/docs/interfaces/FloorplanServerFloorData.html +2 -2
  62. package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
  63. package/docs/interfaces/FloorplanServerObserver.html +2 -2
  64. package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
  65. package/docs/interfaces/FloorplanServerPosition.html +2 -2
  66. package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
  67. package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
  68. package/docs/interfaces/ItemLabelPluginData.html +1 -1
  69. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
  70. package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
  71. package/docs/interfaces/LineJson.html +1 -1
  72. package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
  73. package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
  74. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
  75. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
  76. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
  77. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  78. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  79. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  80. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  81. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  82. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  83. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  84. package/docs/interfaces/ModelViewPluginExportType.html +1 -1
  85. package/docs/interfaces/OpenParameter.html +2 -2
  86. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  87. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
  88. package/docs/interfaces/PanoMeasureParameterType.html +1 -1
  89. package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
  90. package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
  91. package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
  92. package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
  93. package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
  94. package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
  95. package/docs/interfaces/PanoRulerProPluginState.html +1 -1
  96. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
  97. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
  98. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  99. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
  100. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  101. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
  102. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  103. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
  104. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
  105. package/docs/interfaces/Point.html +1 -1
  106. package/docs/interfaces/PointJson.html +1 -1
  107. package/docs/interfaces/Room.html +1 -1
  108. package/docs/interfaces/RoomInfo.html +1 -1
  109. package/docs/interfaces/RoomLabel.html +7 -7
  110. package/docs/interfaces/RoomRules.html +1 -1
  111. package/docs/interfaces/Rooms.html +1 -1
  112. package/docs/modules.html +18 -18
  113. package/libs/CameraMovementPlugin/CameraMovementPlugin.js +15 -24
  114. package/libs/ModelChassisCompassPlugin/Plugin.js +5 -14
  115. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +8 -17
  116. package/libs/ModelTVVideoPlugin/Plugin.js +3 -12
  117. package/libs/PanoCompassPlugin/controller.js +56 -73
  118. package/libs/PanoCompassPlugin/index.d.ts +1 -1
  119. package/libs/PanoRulerPlugin/Plugin.js +3 -12
  120. package/libs/PanoRulerProPlugin/Controller.js +29 -42
  121. package/libs/floorplan/ModelFloorplanPlugin/Controller.js +29 -42
  122. package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +43 -60
  123. package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +58 -79
  124. package/libs/floorplan/utils/correctFiveState.js +20 -31
  125. package/libs/floorplan/utils/formatData.js +28 -43
  126. package/libs/shared-utils/five/changeMode.js +28 -39
  127. package/libs/shared-utils/three/loadFbxObj.js +9 -20
  128. package/libs/shared-utils/three/loadTexture.js +6 -17
  129. package/libs/shared-utils/to.js +10 -21
  130. package/package.json +14 -14
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -25,31 +25,6 @@ function _interopNamespace(e) {
25
25
 
26
26
  var TWEEN__namespace = /*#__PURE__*/_interopNamespace(TWEEN);
27
27
 
28
- /******************************************************************************
29
- Copyright (c) Microsoft Corporation.
30
-
31
- Permission to use, copy, modify, and/or distribute this software for any
32
- purpose with or without fee is hereby granted.
33
-
34
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
35
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
37
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
38
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
- PERFORMANCE OF THIS SOFTWARE.
41
- ***************************************************************************** */
42
-
43
- function __awaiter(thisArg, _arguments, P, generator) {
44
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
45
- return new (P || (P = Promise))(function (resolve, reject) {
46
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
47
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
49
- step((generator = generator.apply(thisArg, _arguments || [])).next());
50
- });
51
- }
52
-
53
28
  const _requestAnimationFrame = window.requestAnimationFrame || ((fn) => setTimeout(fn, 16));
54
29
  const _cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
55
30
  function nextFrame(fn, delay = 0) {
@@ -195,21 +170,21 @@ const getLongitudeParams = (from, to, rotation) => {
195
170
  */
196
171
  const CameraMovementPlugin = (five$1) => {
197
172
  const state = {};
198
- const move = (args, duration, opts = { preload: true }) => __awaiter(void 0, void 0, void 0, function* () {
173
+ const move = async (args, duration, opts = { preload: true }) => {
199
174
  if (state.interruptCallback) {
200
175
  state.interruptCallback(false);
201
176
  }
202
177
  if (opts.asyncStartCallback) {
203
- yield opts.asyncStartCallback();
178
+ await opts.asyncStartCallback();
204
179
  }
205
180
  if (args.mode && args.mode !== five$1.currentMode) {
206
- yield five$1.changeMode(args.mode);
181
+ await five$1.changeMode(args.mode);
207
182
  }
208
183
  if (opts.preload && args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
209
- yield five$1.preloadPano(args.panoIndex);
184
+ await five$1.preloadPano(args.panoIndex);
210
185
  }
211
186
  if (opts.asyncEndCallback) {
212
- yield opts.asyncEndCallback();
187
+ await opts.asyncEndCallback();
213
188
  }
214
189
  if (args.panoIndex === undefined &&
215
190
  args.fov === undefined &&
@@ -217,7 +192,7 @@ const CameraMovementPlugin = (five$1) => {
217
192
  args.longitude === undefined) {
218
193
  return true;
219
194
  }
220
- return yield new Promise((resolve, reject) => {
195
+ return await new Promise((resolve, reject) => {
221
196
  const panoIndex = args.panoIndex !== undefined ? args.panoIndex : five$1.panoIndex;
222
197
  if (panoIndex !== undefined) {
223
198
  five$1.moveToPano(panoIndex, Object.assign({
@@ -230,7 +205,7 @@ const CameraMovementPlugin = (five$1) => {
230
205
  reject(false);
231
206
  }
232
207
  });
233
- });
208
+ };
234
209
  const getAnimeParams = (args) => {
235
210
  const currentFiveState = five$1.state;
236
211
  // latitude
@@ -246,20 +221,20 @@ const CameraMovementPlugin = (five$1) => {
246
221
  to: { latitude: toLatitude, longitude: toLongitude, fov: toFov },
247
222
  };
248
223
  };
249
- const rotate = (args, duration, opts = {}) => __awaiter(void 0, void 0, void 0, function* () {
224
+ const rotate = async (args, duration, opts = {}) => {
250
225
  if (state.interruptCallback) {
251
226
  state.interruptCallback(false);
252
227
  }
253
228
  if (opts.asyncStartCallback) {
254
- yield opts.asyncStartCallback();
229
+ await opts.asyncStartCallback();
255
230
  }
256
231
  if (five$1.currentMode !== five.Five.Mode.Panorama) {
257
- yield five$1.changeMode(five.Five.Mode.Panorama);
232
+ await five$1.changeMode(five.Five.Mode.Panorama);
258
233
  }
259
234
  if (args.panoIndex !== undefined && args.panoIndex !== five$1.panoIndex) {
260
235
  if (opts.preload)
261
- yield five$1.preloadPano(args.panoIndex);
262
- yield new Promise((resolve, reject) => {
236
+ await five$1.preloadPano(args.panoIndex);
237
+ await new Promise((resolve, reject) => {
263
238
  if (!args.panoIndex) {
264
239
  resolve(true);
265
240
  return;
@@ -271,10 +246,10 @@ const CameraMovementPlugin = (five$1) => {
271
246
  });
272
247
  }
273
248
  if (opts.asyncEndCallback) {
274
- yield opts.asyncEndCallback();
249
+ await opts.asyncEndCallback();
275
250
  }
276
251
  const { from, to } = getAnimeParams(args);
277
- return yield new Promise((resolve) => {
252
+ return await new Promise((resolve) => {
278
253
  const onUpdate = ({ progress }) => {
279
254
  const state = {};
280
255
  state.longitude = progressNumber(from.longitude, to.longitude, progress);
@@ -316,7 +291,7 @@ const CameraMovementPlugin = (five$1) => {
316
291
  state.interruptCallback(true);
317
292
  }, duration);
318
293
  });
319
- });
294
+ };
320
295
  return {
321
296
  move,
322
297
  rotate,
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -25,31 +25,6 @@ function _interopNamespace(e) {
25
25
 
26
26
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
27
27
 
28
- /******************************************************************************
29
- Copyright (c) Microsoft Corporation.
30
-
31
- Permission to use, copy, modify, and/or distribute this software for any
32
- purpose with or without fee is hereby granted.
33
-
34
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
35
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
37
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
38
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
- PERFORMANCE OF THIS SOFTWARE.
41
- ***************************************************************************** */
42
-
43
- function __awaiter(thisArg, _arguments, P, generator) {
44
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
45
- return new (P || (P = Promise))(function (resolve, reject) {
46
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
47
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
49
- step((generator = generator.apply(thisArg, _arguments || [])).next());
50
- });
51
- }
52
-
53
28
  const genRotationMatrix = (x, y, z) => {
54
29
  const matrix = new THREE__namespace.Matrix4();
55
30
  const euler = new THREE__namespace.Euler(x, y, z, 'YXZ');
@@ -102,10 +77,10 @@ const ModelChassisCompassPlugin = (five, params) => {
102
77
  const defaultNorthRad = (_a = params.north_rad) !== null && _a !== void 0 ? _a : undefined;
103
78
  // 局部状态
104
79
  const state = {};
105
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
106
- var _b;
80
+ const load = async (data) => {
81
+ var _a;
107
82
  const fbxUrl = (data === null || data === void 0 ? void 0 : data.fbx_url) || defaultFbxUrl;
108
- const northRad = (_b = data === null || data === void 0 ? void 0 : data.north_rad) !== null && _b !== void 0 ? _b : defaultNorthRad;
83
+ const northRad = (_a = data === null || data === void 0 ? void 0 : data.north_rad) !== null && _a !== void 0 ? _a : defaultNorthRad;
109
84
  if (typeof northRad !== 'number') {
110
85
  throw new Error('"northRad"配置参数缺失:未配置指南针指向!');
111
86
  }
@@ -114,7 +89,7 @@ const ModelChassisCompassPlugin = (five, params) => {
114
89
  const zOffset = bounding.max.z - bounding.min.z;
115
90
  const maxOffset = Math.max(xOffset, zOffset);
116
91
  const fbxLoader = new FBXLoader.FBXLoader();
117
- const object = yield fbxLoader.loadAsync(fbxUrl);
92
+ const object = await fbxLoader.loadAsync(fbxUrl);
118
93
  transfromToMeshBasicMaterial(object, {
119
94
  transparent: true,
120
95
  side: THREE__namespace.DoubleSide,
@@ -128,7 +103,7 @@ const ModelChassisCompassPlugin = (five, params) => {
128
103
  bject3d2LocalMatrix(object, { position, rotation, scale });
129
104
  state.object = object;
130
105
  return true;
131
- });
106
+ };
132
107
  const onCameraUpdate = ({ latitude }) => {
133
108
  if (!state.object)
134
109
  return;
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -25,31 +25,6 @@ function _interopNamespace(e) {
25
25
 
26
26
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
27
27
 
28
- /******************************************************************************
29
- Copyright (c) Microsoft Corporation.
30
-
31
- Permission to use, copy, modify, and/or distribute this software for any
32
- purpose with or without fee is hereby granted.
33
-
34
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
35
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
37
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
38
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
- PERFORMANCE OF THIS SOFTWARE.
41
- ***************************************************************************** */
42
-
43
- function __awaiter(thisArg, _arguments, P, generator) {
44
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
45
- return new (P || (P = Promise))(function (resolve, reject) {
46
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
47
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
49
- step((generator = generator.apply(thisArg, _arguments || [])).next());
50
- });
51
- }
52
-
53
28
  function createCanvasTextTexture(text, config) {
54
29
  var _a, _b, _c, _d, _e;
55
30
  const size = (_a = config === null || config === void 0 ? void 0 : config.size) !== null && _a !== void 0 ? _a : 512;
@@ -99,25 +74,25 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
99
74
  const defaultRad = (_c = params.rad) !== null && _c !== void 0 ? _c : undefined;
100
75
  const defaultFbxUrl = params.fbx_url || '//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx';
101
76
  const mixers = [];
102
- const load = (data) => __awaiter(void 0, void 0, void 0, function* () {
103
- var _d, _e, _f, _g, _h, _j, _k;
104
- const position = (_d = data === null || data === void 0 ? void 0 : data.position) !== null && _d !== void 0 ? _d : defaultModelPosition;
77
+ const load = async (data) => {
78
+ var _a, _b, _c, _d, _e, _f, _g;
79
+ const position = (_a = data === null || data === void 0 ? void 0 : data.position) !== null && _a !== void 0 ? _a : defaultModelPosition;
105
80
  if (!position)
106
81
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): position is undefined`);
107
82
  const modelPosition = transformPositionToVector3(position);
108
- const rad = (_e = data === null || data === void 0 ? void 0 : data.rad) !== null && _e !== void 0 ? _e : defaultRad;
109
- const fbxUrl = (_f = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _f !== void 0 ? _f : defaultFbxUrl;
83
+ const rad = (_b = data === null || data === void 0 ? void 0 : data.rad) !== null && _b !== void 0 ? _b : defaultRad;
84
+ const fbxUrl = (_c = data === null || data === void 0 ? void 0 : data.fbx_url) !== null && _c !== void 0 ? _c : defaultFbxUrl;
110
85
  state.rad = rad;
111
86
  if (rad === undefined)
112
87
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${rad}`);
113
88
  // 加载模型
114
- const object = yield new FBXLoader.FBXLoader().loadAsync(fbxUrl);
89
+ const object = await new FBXLoader.FBXLoader().loadAsync(fbxUrl);
115
90
  // 设置位置
116
91
  object.position.copy(modelPosition);
117
92
  object.rotation.z = rad;
118
93
  object.scale.set(0.8, 0.8, 0.8);
119
94
  transfromToMeshBasicMaterial(object, { transparent: true, side: THREE__namespace.DoubleSide });
120
- const textMesh = (_k = (_j = (_h = (_g = object.children) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.children) === null || _j === void 0 ? void 0 : _j[3]) === null || _k === void 0 ? void 0 : _k.clone();
95
+ const textMesh = (_g = (_f = (_e = (_d = object.children) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.children) === null || _f === void 0 ? void 0 : _f[3]) === null || _g === void 0 ? void 0 : _g.clone();
121
96
  if (!textMesh)
122
97
  return Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${textMesh}`);
123
98
  textMesh.material = new THREE.MeshBasicMaterial({ transparent: true, map: createCanvasTextTexture('入户门') });
@@ -125,7 +100,7 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
125
100
  object.children[0].add(textMesh);
126
101
  state.object = object;
127
102
  return true;
128
- });
103
+ };
129
104
  const initAnimation = () => {
130
105
  if (state.animation)
131
106
  return;
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -24,31 +24,6 @@ function _interopNamespace(e) {
24
24
 
25
25
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
26
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
27
  exports.DIRECTION = void 0;
53
28
  (function (DIRECTION) {
54
29
  DIRECTION["TOP_LEFT"] = "topLeft";
@@ -222,7 +197,7 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
222
197
  xhr.send();
223
198
  });
224
199
  };
225
- const load = (data, videoElement) => __awaiter(void 0, void 0, void 0, function* () {
200
+ const load = async (data, videoElement) => {
226
201
  const { video_src, video_poster_src, points } = data;
227
202
  state.videoSource = video_src;
228
203
  // TODO 存疑,先处理多一次遍历 o(2n)
@@ -232,11 +207,11 @@ const ModelTVVideoPlugin = (five, { videoElement }) => {
232
207
  if (videoElement) {
233
208
  state.videoElement = videoElement;
234
209
  }
235
- state.videoTexture = yield getVideoTexture(state.videoSource, state.videoElement);
210
+ state.videoTexture = await getVideoTexture(state.videoSource, state.videoElement);
236
211
  state.enabled = !!data.enable;
237
212
  if (state.enabled)
238
213
  enable();
239
- });
214
+ };
240
215
  const dispose = () => {
241
216
  disable();
242
217
  state.videoTexture = undefined;
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -30,31 +30,6 @@ function _interopNamespace(e) {
30
30
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
31
31
  var TWEEN__default = /*#__PURE__*/_interopDefaultLegacy(TWEEN);
32
32
 
33
- /******************************************************************************
34
- Copyright (c) Microsoft Corporation.
35
-
36
- Permission to use, copy, modify, and/or distribute this software for any
37
- purpose with or without fee is hereby granted.
38
-
39
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
40
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
41
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
42
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
43
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
44
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
- PERFORMANCE OF THIS SOFTWARE.
46
- ***************************************************************************** */
47
-
48
- function __awaiter(thisArg, _arguments, P, generator) {
49
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
50
- return new (P || (P = Promise))(function (resolve, reject) {
51
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
52
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
53
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
54
- step((generator = generator.apply(thisArg, _arguments || [])).next());
55
- });
56
- }
57
-
58
33
  /**
59
34
  * plugin 的基本控制器
60
35
  */
@@ -139,14 +114,12 @@ function getRoomInfoInstance() {
139
114
  }
140
115
 
141
116
  const textureLoader = new THREE__namespace.TextureLoader();
142
- function loadTexture(url) {
143
- return __awaiter(this, void 0, void 0, function* () {
144
- return new Promise((resolve, reject) => {
145
- textureLoader.load(url, resolve, undefined, reject);
146
- }).then((texture) => {
147
- texture.encoding = THREE__namespace.sRGBEncoding;
148
- return texture;
149
- });
117
+ async function loadTexture(url) {
118
+ return new Promise((resolve, reject) => {
119
+ textureLoader.load(url, resolve, undefined, reject);
120
+ }).then((texture) => {
121
+ texture.encoding = THREE__namespace.sRGBEncoding;
122
+ return texture;
150
123
  });
151
124
  }
152
125
 
@@ -808,19 +781,17 @@ class PanoCompassController extends Controller {
808
781
  this.init();
809
782
  }
810
783
  }
811
- load(data, state, userAction = true) {
812
- return __awaiter(this, void 0, void 0, function* () {
813
- const nextData = yield this.formatData(data);
814
- if (JSON.stringify(this.data) !== JSON.stringify(nextData)) {
815
- this.hooks.emit('dataChange', nextData, this.data);
816
- this.data = Object.assign({}, nextData);
817
- this.init();
818
- if (state) {
819
- this.setState(state, { userAction });
820
- }
821
- this.hooks.emit('dataLoaded', this.data);
784
+ async load(data, state, userAction = true) {
785
+ const nextData = await this.formatData(data);
786
+ if (JSON.stringify(this.data) !== JSON.stringify(nextData)) {
787
+ this.hooks.emit('dataChange', nextData, this.data);
788
+ this.data = Object.assign({}, nextData);
789
+ this.init();
790
+ if (state) {
791
+ this.setState(state, { userAction });
822
792
  }
823
- });
793
+ this.hooks.emit('dataLoaded', this.data);
794
+ }
824
795
  }
825
796
  formatData(serverData) {
826
797
  if (serverData.version && serverData.data) {
@@ -834,64 +805,58 @@ class PanoCompassController extends Controller {
834
805
  * 初始化
835
806
  * @todo 逻辑需要细分
836
807
  */
837
- init() {
808
+ async init() {
838
809
  var _a, _b, _c, _d;
839
- return __awaiter(this, void 0, void 0, function* () {
840
- const northRad = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.north_rad) !== null && _b !== void 0 ? _b : null;
841
- this._clearCompassIfNeed();
842
- if (northRad !== null) {
843
- this.compassMesh = yield this.loadCompassMesh();
844
- this.compassMesh.rotateX(-Math.PI / 2);
845
- this.compassMesh.rotateZ(northRad - Math.PI / 2);
846
- this.group.add(this.compassMesh);
847
- }
848
- const entrance = (_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c.entrance) !== null && _d !== void 0 ? _d : null;
849
- this._clearEntryDoorIfNeed();
850
- if (entrance !== null) {
851
- this.entryDoorMesh = yield this.loadEntryDoorMesh();
852
- this.roomInfoWrapperInstance = this.loadRoomInfo();
853
- this.roomInfoInstance = getRoomInfoInstance();
854
- this.entryDoorMesh.rotateX(-Math.PI / 2);
855
- if (this.roomInfoWrapperInstance) {
856
- this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
857
- }
858
- this.group.add(this.entryDoorMesh);
810
+ const northRad = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.north_rad) !== null && _b !== void 0 ? _b : null;
811
+ this._clearCompassIfNeed();
812
+ if (northRad !== null) {
813
+ this.compassMesh = await this.loadCompassMesh();
814
+ this.compassMesh.rotateX(-Math.PI / 2);
815
+ this.compassMesh.rotateZ(northRad - Math.PI / 2);
816
+ this.group.add(this.compassMesh);
817
+ }
818
+ const entrance = (_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c.entrance) !== null && _d !== void 0 ? _d : null;
819
+ this._clearEntryDoorIfNeed();
820
+ if (entrance !== null) {
821
+ this.entryDoorMesh = await this.loadEntryDoorMesh();
822
+ this.roomInfoWrapperInstance = this.loadRoomInfo();
823
+ this.roomInfoInstance = getRoomInfoInstance();
824
+ this.entryDoorMesh.rotateX(-Math.PI / 2);
825
+ if (this.roomInfoWrapperInstance) {
826
+ this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container);
859
827
  }
860
- this.onFivePanoArrived(this.five.panoIndex || 0);
861
- this.five.needsRender = true;
862
- });
828
+ this.group.add(this.entryDoorMesh);
829
+ }
830
+ this.onFivePanoArrived(this.five.panoIndex || 0);
831
+ this.five.needsRender = true;
863
832
  }
864
- loadCompassMesh() {
865
- return __awaiter(this, void 0, void 0, function* () {
866
- const compassImageUrl = this.state.config.compassImageUrl;
867
- const compassTexture = yield loadTexture(compassImageUrl);
868
- const compassGeometry = new THREE__namespace.CircleGeometry(0.7, 32);
869
- const compassMaterial = new THREE__namespace.MeshBasicMaterial({
870
- map: compassTexture,
871
- transparent: true,
872
- opacity: 0,
873
- depthTest: false,
874
- });
875
- const compassMesh = new THREE__namespace.Mesh(compassGeometry, compassMaterial);
876
- compassMesh.name = 'pano-compass-mesh';
877
- return compassMesh;
878
- });
833
+ async loadCompassMesh() {
834
+ const compassImageUrl = this.state.config.compassImageUrl;
835
+ const compassTexture = await loadTexture(compassImageUrl);
836
+ const compassGeometry = new THREE__namespace.CircleGeometry(0.7, 32);
837
+ const compassMaterial = new THREE__namespace.MeshBasicMaterial({
838
+ map: compassTexture,
839
+ transparent: true,
840
+ opacity: 0,
841
+ depthTest: false,
842
+ });
843
+ const compassMesh = new THREE__namespace.Mesh(compassGeometry, compassMaterial);
844
+ compassMesh.name = 'pano-compass-mesh';
845
+ return compassMesh;
879
846
  }
880
- loadEntryDoorMesh() {
881
- return __awaiter(this, void 0, void 0, function* () {
882
- const entryDoorImageUrl = this.state.config.entryDoorImageUrl;
883
- const entryDoorTexture = yield loadTexture(entryDoorImageUrl);
884
- const entryDoorGeometry = new THREE__namespace.PlaneGeometry(0.2, 0.16);
885
- const entryDoorMaterial = new THREE__namespace.MeshBasicMaterial({
886
- map: entryDoorTexture,
887
- transparent: true,
888
- opacity: 0.8,
889
- depthTest: false,
890
- });
891
- const entryDoorMesh = new THREE__namespace.Mesh(entryDoorGeometry, entryDoorMaterial);
892
- entryDoorMesh.name = 'pano-compass-entry-door';
893
- return entryDoorMesh;
894
- });
847
+ async loadEntryDoorMesh() {
848
+ const entryDoorImageUrl = this.state.config.entryDoorImageUrl;
849
+ const entryDoorTexture = await loadTexture(entryDoorImageUrl);
850
+ const entryDoorGeometry = new THREE__namespace.PlaneGeometry(0.2, 0.16);
851
+ const entryDoorMaterial = new THREE__namespace.MeshBasicMaterial({
852
+ map: entryDoorTexture,
853
+ transparent: true,
854
+ opacity: 0.8,
855
+ depthTest: false,
856
+ });
857
+ const entryDoorMesh = new THREE__namespace.Mesh(entryDoorGeometry, entryDoorMaterial);
858
+ entryDoorMesh.name = 'pano-compass-entry-door';
859
+ return entryDoorMesh;
895
860
  }
896
861
  loadRoomInfo() {
897
862
  const points = [
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';
@@ -4,4 +4,4 @@ import type { PanoCompassPluginParameterType } from './typings';
4
4
  export declare type PanoCompassPluginExportType = PanoCompassController;
5
5
  export declare const PanoCompassPlugin: FivePlugin<PanoCompassPluginParameterType, PanoCompassPluginExportType>;
6
6
  export default PanoCompassPlugin;
7
- export type { PanoCompassPluginParameterType } from './typings';
7
+ export type { PanoCompassPluginParameterType, PanoCompassPluginData } from './typings';