@realsee/dnalogel 2.0.0-alpha.26-beta → 2.0.0-alpha.28-beta

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 (139) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/CSS3DRenderPlugin/Plugin.d.ts +49 -0
  3. package/dist/CSS3DRenderPlugin/index.d.ts +3 -48
  4. package/dist/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
  5. package/dist/CameraMovementPlugin/index.d.ts +4 -6
  6. package/dist/CameraMovementPlugin/index.js +12 -12
  7. package/dist/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
  8. package/dist/ModelChassisCompassPlugin/index.d.ts +3 -18
  9. package/dist/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
  10. package/dist/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
  11. package/dist/ModelEntryDoorGuidePlugin/index.js +0 -5
  12. package/dist/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
  13. package/dist/ModelItemLabelPlugin/index.d.ts +8 -3
  14. package/dist/ModelItemLabelPlugin/index.js +14 -8
  15. package/dist/ModelRoomLabelPlugin/index.js +82 -46
  16. package/dist/ModelTVVideoPlugin/Plugin.d.ts +4 -0
  17. package/dist/ModelTVVideoPlugin/index.d.ts +4 -3
  18. package/dist/ModelTVVideoPlugin/index.js +3 -3
  19. package/dist/ModelViewPlugin/Plugin.d.ts +17 -0
  20. package/dist/ModelViewPlugin/index.d.ts +3 -16
  21. package/dist/PanoCompassPlugin/Plugin.d.ts +47 -0
  22. package/dist/PanoCompassPlugin/index.d.ts +4 -47
  23. package/dist/PanoCompassPlugin/index.js +5 -4
  24. package/dist/PanoMeasurePlugin/index.d.ts +1 -1
  25. package/dist/PanoMeasurePlugin/index.js +4 -1
  26. package/dist/PanoRulerPlugin/Plugin.d.ts +31 -0
  27. package/dist/PanoRulerPlugin/index.d.ts +4 -30
  28. package/dist/PanoRulerPlugin/index.js +0 -5
  29. package/dist/PanoSpatialTagPlugin/Plugin.d.ts +33 -0
  30. package/dist/PanoSpatialTagPlugin/index.d.ts +4 -32
  31. package/dist/PanoSpatialTagPlugin/index.js +23 -21
  32. package/dist/_index.d.ts +30 -0
  33. package/dist/index.d.ts +16 -29
  34. package/dist/index.es.js +122 -70
  35. package/dist/index.js +145 -90
  36. package/dist/index.umd.js +145 -90
  37. package/docs/assets/search.js +1 -1
  38. package/docs/classes/ModelRoomLabelController.html +6 -6
  39. package/docs/classes/PanoFloorplanRadarPluginController.html +3 -0
  40. package/docs/enums/CameraMovementEffect.html +3 -0
  41. package/docs/enums/DIRECTION.html +1 -0
  42. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -0
  43. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
  44. package/docs/enums/ModelFloorplanErrorType.html +1 -1
  45. package/docs/enums/Rotation.html +3 -0
  46. package/docs/index.html +1 -1
  47. package/docs/interfaces/CSS3DRenderPluginExportType.html +4 -0
  48. package/docs/interfaces/CameraMovementPluginExportType.html +17 -0
  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/ModelFloorplanParameterType.html +1 -1
  56. package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
  57. package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
  58. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
  59. package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
  60. package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
  61. package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
  62. package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
  63. package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
  64. package/docs/interfaces/ModelViewPluginExportType.html +1 -0
  65. package/docs/interfaces/PanoCompassPluginData.html +1 -1
  66. package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
  67. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
  68. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -0
  69. package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -0
  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/PanoSpatialTagPluginContentEvent.html +1 -0
  74. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -0
  75. package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
  76. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -0
  77. package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
  78. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -0
  79. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
  80. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -0
  81. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -0
  82. package/docs/interfaces/Point.html +1 -0
  83. package/docs/interfaces/PointJson.html +1 -1
  84. package/docs/interfaces/Room.html +1 -0
  85. package/docs/interfaces/RoomInfo.html +1 -0
  86. package/docs/interfaces/RoomLabel.html +7 -7
  87. package/docs/interfaces/RoomRules.html +1 -0
  88. package/docs/interfaces/Rooms.html +1 -0
  89. package/docs/interfaces/TopviewFloorplanPluginParameterType.html +8 -8
  90. package/docs/modules.html +20 -12
  91. package/libs/CSS3DRenderPlugin/Plugin.d.ts +49 -0
  92. package/libs/CSS3DRenderPlugin/Plugin.js +182 -0
  93. package/libs/CSS3DRenderPlugin/index.d.ts +3 -48
  94. package/libs/CSS3DRenderPlugin/index.js +2 -181
  95. package/libs/CameraMovementPlugin/CameraMovementPlugin.d.ts +7 -0
  96. package/libs/CameraMovementPlugin/CameraMovementPlugin.js +159 -0
  97. package/libs/CameraMovementPlugin/index.d.ts +4 -6
  98. package/libs/CameraMovementPlugin/index.js +3 -158
  99. package/libs/ModelChassisCompassPlugin/Plugin.d.ts +19 -0
  100. package/libs/ModelChassisCompassPlugin/Plugin.js +75 -0
  101. package/libs/ModelChassisCompassPlugin/index.d.ts +3 -18
  102. package/libs/ModelChassisCompassPlugin/index.js +2 -74
  103. package/libs/ModelEntryDoorGuidePlugin/Plugin.d.ts +26 -0
  104. package/libs/ModelEntryDoorGuidePlugin/Plugin.js +140 -0
  105. package/libs/ModelEntryDoorGuidePlugin/index.d.ts +3 -25
  106. package/libs/ModelEntryDoorGuidePlugin/index.js +2 -139
  107. package/libs/ModelItemLabelPlugin/ItemLabelComponent.js +1 -1
  108. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.d.ts +4 -0
  109. package/libs/ModelItemLabelPlugin/ModelItemLabelPlugin.js +120 -0
  110. package/libs/ModelItemLabelPlugin/index.d.ts +8 -3
  111. package/libs/ModelItemLabelPlugin/index.js +7 -119
  112. package/libs/ModelRoomLabelPlugin/RoomLabelItems.js +83 -47
  113. package/libs/ModelTVVideoPlugin/Plugin.d.ts +4 -0
  114. package/libs/ModelTVVideoPlugin/Plugin.js +254 -0
  115. package/libs/ModelTVVideoPlugin/index.d.ts +4 -3
  116. package/libs/ModelTVVideoPlugin/index.js +3 -253
  117. package/libs/ModelViewPlugin/Plugin.d.ts +17 -0
  118. package/libs/ModelViewPlugin/Plugin.js +160 -0
  119. package/libs/ModelViewPlugin/index.d.ts +3 -16
  120. package/libs/ModelViewPlugin/index.js +2 -159
  121. package/libs/PanoCompassPlugin/Plugin.d.ts +47 -0
  122. package/libs/PanoCompassPlugin/Plugin.js +249 -0
  123. package/libs/PanoCompassPlugin/index.d.ts +4 -47
  124. package/libs/PanoCompassPlugin/index.js +3 -249
  125. package/libs/PanoMeasurePlugin/index.d.ts +1 -1
  126. package/libs/PanoMeasurePlugin/index.js +1 -1
  127. package/libs/PanoRulerPlugin/Plugin.d.ts +31 -0
  128. package/libs/PanoRulerPlugin/Plugin.js +402 -0
  129. package/libs/PanoRulerPlugin/index.d.ts +4 -30
  130. package/libs/PanoRulerPlugin/index.js +2 -401
  131. package/libs/PanoSpatialTagPlugin/Plugin.d.ts +33 -0
  132. package/libs/PanoSpatialTagPlugin/Plugin.js +415 -0
  133. package/libs/PanoSpatialTagPlugin/index.d.ts +4 -32
  134. package/libs/PanoSpatialTagPlugin/index.js +4 -412
  135. package/libs/_index.d.ts +30 -0
  136. package/libs/_index.js +18 -0
  137. package/libs/index.d.ts +16 -29
  138. package/libs/index.js +25 -16
  139. package/package.json +6 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.0.0-alpha.28
4
+ - 1.chore: 优化打包输出路径.
5
+
6
+ ## 2.0.0-alpha.27
7
+ - 1.feat: PanoSpatialTagPlugin 兼容 bvh 为 false 模式.
8
+
9
+ ## 2.0.0-alpha.26
10
+ - 1.fix: ModelRoomLabelPlugin - 修复渲染区域大小改变时,标签位置没有更新
11
+ - 2.pref: ModelRoomLabelPlugin - 优化渲染逻辑
12
+
3
13
  ## 2.0.0-alpha.25
4
14
  - 1.refactor: 恢复发版
5
15
 
@@ -0,0 +1,49 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ import type { Vector3Position } from '../typings/math.type';
3
+ import { Vector3 } from 'three';
4
+ import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
5
+ export declare type CSS3DRenderPluginParameterType = undefined;
6
+ export interface CSS3DRenderPluginExportType {
7
+ /**
8
+ * @description: 根据传入的四个点位创建一个3d dom容器,可以通过ReactDom.render()的方式将react组件放到容器中
9
+ * @param {Five} five
10
+ * @param {Vector3[] | Vector3Position[]} points: 矩形四个点坐标
11
+ * @param {number} config.ratio: 1px对应多少米,默认为 0.002,即1px对应2mm
12
+ * @param {number} config.dpr: dpr, 默认为1
13
+ * @param {HTMLElement} config.container: HTMLElement
14
+ * @param {number} config.autoRender: 默认为true,如果需要手动render则传false
15
+ * @param {'front' | 'behind'} config.mode: 两种模式
16
+ * @param {HTMLElement} config.behindFiveContainer: 如果config.mode为'behind',需要传入容器,并确保此容器位five下方,且中间没有其他dom元素遮挡
17
+ * @return {{ container: HTMLElement; dispose: () => void }}: container: dom容器, dispose: 清理函数
18
+ */
19
+ create3DDomContainer: (points: Vector3[] | Vector3Position[], config?: {
20
+ ratio?: number;
21
+ dpr?: number;
22
+ autoRender?: boolean;
23
+ container?: HTMLElement;
24
+ [key: string]: any;
25
+ } & ({
26
+ mode?: 'front';
27
+ } | {
28
+ mode: 'behind';
29
+ behindFiveContainer: HTMLElement;
30
+ })) => {
31
+ container: HTMLElement;
32
+ dispose: () => void;
33
+ css3DObject: CSS3DObject;
34
+ render?: () => void;
35
+ } | void;
36
+ /**
37
+ * @description: 销毁所有的渲染内容
38
+ * @return {void}
39
+ */
40
+ disposeAll: () => void;
41
+ }
42
+ /**
43
+ * **CSS3DRenderPlugin** 提供矩形区域(三维空间四个坐标点),你可以在此矩形区域中渲染 DOM 内容。
44
+ * 实现原理参考[CSS3DRenderer](https://threejs.org/docs/index.html?q=CSS3D#examples/en/renderers/CSS3DRenderer)。
45
+ *
46
+ * @returns
47
+ */
48
+ export declare const CSS3DRenderPlugin: FivePlugin<CSS3DRenderPluginParameterType, CSS3DRenderPluginExportType>;
49
+ export default CSS3DRenderPlugin;
@@ -1,49 +1,4 @@
1
- import type { FivePlugin } from '@realsee/five';
2
- import type { Vector3Position } from '../typings/math.type';
3
- import { Vector3 } from 'three';
4
- import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer';
5
- export declare type CSS3DRenderPluginParameterType = undefined;
6
- export interface CSS3DRenderPluginExportType {
7
- /**
8
- * @description: 根据传入的四个点位创建一个3d dom容器,可以通过ReactDom.render()的方式将react组件放到容器中
9
- * @param {Five} five
10
- * @param {Vector3[] | Vector3Position[]} points: 矩形四个点坐标
11
- * @param {number} config.ratio: 1px对应多少米,默认为 0.002,即1px对应2mm
12
- * @param {number} config.dpr: dpr, 默认为1
13
- * @param {HTMLElement} config.container: HTMLElement
14
- * @param {number} config.autoRender: 默认为true,如果需要手动render则传false
15
- * @param {'front' | 'behind'} config.mode: 两种模式
16
- * @param {HTMLElement} config.behindFiveContainer: 如果config.mode为'behind',需要传入容器,并确保此容器位five下方,且中间没有其他dom元素遮挡
17
- * @return {{ container: HTMLElement; dispose: () => void }}: container: dom容器, dispose: 清理函数
18
- */
19
- create3DDomContainer: (points: Vector3[] | Vector3Position[], config?: {
20
- ratio?: number;
21
- dpr?: number;
22
- autoRender?: boolean;
23
- container?: HTMLElement;
24
- [key: string]: any;
25
- } & ({
26
- mode?: 'front';
27
- } | {
28
- mode: 'behind';
29
- behindFiveContainer: HTMLElement;
30
- })) => {
31
- container: HTMLElement;
32
- dispose: () => void;
33
- css3DObject: CSS3DObject;
34
- render?: () => void;
35
- } | void;
36
- /**
37
- * @description: 销毁所有的渲染内容
38
- * @return {void}
39
- */
40
- disposeAll: () => void;
41
- }
42
- /**
43
- * **CSS3DRenderPlugin** 提供矩形区域(三维空间四个坐标点),你可以在此矩形区域中渲染 DOM 内容。
44
- * 实现原理参考[CSS3DRenderer](https://threejs.org/docs/index.html?q=CSS3D#examples/en/renderers/CSS3DRenderer)。
45
- *
46
- * @returns
47
- */
48
- export declare const CSS3DRenderPlugin: FivePlugin<CSS3DRenderPluginParameterType, CSS3DRenderPluginExportType>;
1
+ import CSS3DRenderPlugin from './Plugin';
2
+ export { CSS3DRenderPlugin };
49
3
  export default CSS3DRenderPlugin;
4
+ export type { CSS3DRenderPluginExportType } from './Plugin';
@@ -0,0 +1,7 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ import { CameraMovementPluginExportType, CameraMovementPluginParameterType } from './typing';
3
+ /**
4
+ * **运镜插件** 模拟类似于电影运镜效果。
5
+ */
6
+ export declare const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType, CameraMovementPluginExportType>;
7
+ export default CameraMovementPlugin;
@@ -1,7 +1,5 @@
1
- import type { FivePlugin } from '@realsee/five';
2
- import { CameraMovementPluginExportType, CameraMovementPluginParameterType } from './typing';
3
- /**
4
- * **运镜插件** 模拟类似于电影运镜效果。
5
- */
6
- export declare const CameraMovementPlugin: FivePlugin<CameraMovementPluginParameterType, CameraMovementPluginExportType>;
1
+ import CameraMovementPlugin from "./CameraMovementPlugin";
2
+ export { CameraMovementPlugin };
7
3
  export default CameraMovementPlugin;
4
+ export type { MoveArgs, MoveOpts, RotateArgs, RotateOpts, CameraMovementPluginExportType } from './typing';
5
+ export { CameraMovementEffect, Rotation } from './typing';
@@ -107,20 +107,20 @@ function tweenProgress(duration, easing) {
107
107
  /**
108
108
  * 运镜效果
109
109
  */
110
- var CameraMovementEffect;
110
+ exports.CameraMovementEffect = void 0;
111
111
  (function (CameraMovementEffect) {
112
112
  CameraMovementEffect["Move"] = "Move";
113
113
  CameraMovementEffect["Rotate"] = "Rotate";
114
- })(CameraMovementEffect || (CameraMovementEffect = {}));
114
+ })(exports.CameraMovementEffect || (exports.CameraMovementEffect = {}));
115
115
  /**
116
116
  * 旋转类型
117
117
  */
118
- var Rotation;
118
+ exports.Rotation = void 0;
119
119
  (function (Rotation) {
120
120
  Rotation["Clockwise"] = "Clockwise";
121
121
  Rotation["Anticlockwise"] = "Anticlockwise";
122
122
  Rotation["Loop"] = "Loop";
123
- })(Rotation || (Rotation = {}));
123
+ })(exports.Rotation || (exports.Rotation = {}));
124
124
 
125
125
  const PI_2 = Math.PI * 2;
126
126
  /**
@@ -151,18 +151,18 @@ const getLongitudeParams = (from, to, rotation) => {
151
151
  from = formatLongitude(from);
152
152
  to = formatLongitude(to);
153
153
  // 逆时针旋转,初始值必须是较大的值
154
- if (rotation === Rotation.Anticlockwise && from < to)
154
+ if (rotation === exports.Rotation.Anticlockwise && from < to)
155
155
  from += PI_2;
156
156
  // 顺时针旋转,结束值必须是较大值
157
- if (rotation === Rotation.Clockwise && to < from)
157
+ if (rotation === exports.Rotation.Clockwise && to < from)
158
158
  to += PI_2;
159
159
  // Loop 旋转,找锐角旋转
160
160
  // 如果 to 比 from 大 180°,逆时针转
161
161
  // 如果 from 比 to 大 180°,顺时针转
162
- if (rotation === Rotation.Loop && to - from > PI)
163
- return getLongitudeParams(from, to, Rotation.Anticlockwise);
164
- if (rotation === Rotation.Loop && from - to > PI)
165
- return getLongitudeParams(from, to, Rotation.Clockwise);
162
+ if (rotation === exports.Rotation.Loop && to - from > PI)
163
+ return getLongitudeParams(from, to, exports.Rotation.Anticlockwise);
164
+ if (rotation === exports.Rotation.Loop && from - to > PI)
165
+ return getLongitudeParams(from, to, exports.Rotation.Clockwise);
166
166
  return { from, to };
167
167
  };
168
168
  /**
@@ -212,7 +212,7 @@ const CameraMovementPlugin = (five$1) => {
212
212
  const fromLatitude = formatLatitude(currentFiveState.latitude);
213
213
  const toLatitude = formatLatitude(args.latitude);
214
214
  // longitude
215
- const { from: fromLongitude, to: toLongitude } = getLongitudeParams(currentFiveState.longitude, args.longitude, args.rotation || Rotation.Loop);
215
+ const { from: fromLongitude, to: toLongitude } = getLongitudeParams(currentFiveState.longitude, args.longitude, args.rotation || exports.Rotation.Loop);
216
216
  // fov
217
217
  const fromFov = currentFiveState.fov;
218
218
  const toFov = args.fov;
@@ -270,7 +270,7 @@ const CameraMovementPlugin = (five$1) => {
270
270
  .onUpdate(onUpdate)
271
271
  .onComplete(onComplete)
272
272
  .onDestroy(onDestroy);
273
- if (args.rotation === Rotation.Loop) {
273
+ if (args.rotation === exports.Rotation.Loop) {
274
274
  tween.repeat(Infinity).yoyo(true);
275
275
  }
276
276
  /**
@@ -0,0 +1,19 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ export interface ModelChassisCompassPluginParameterType {
3
+ north_rad?: number;
4
+ fbx_url?: string;
5
+ }
6
+ export interface ModelChassisCompassPluginData {
7
+ north_rad?: number;
8
+ fbx_url?: string;
9
+ }
10
+ export interface ModelChassisCompassPluginExportType {
11
+ enable: () => void;
12
+ disable: () => void;
13
+ load: (data?: ModelChassisCompassPluginData) => Promise<boolean>;
14
+ }
15
+ /**
16
+ * 模型底盘指南针插件
17
+ */
18
+ export declare const ModelChassisCompassPlugin: FivePlugin<ModelChassisCompassPluginParameterType, ModelChassisCompassPluginExportType>;
19
+ export default ModelChassisCompassPlugin;
@@ -1,19 +1,4 @@
1
- import type { FivePlugin } from '@realsee/five';
2
- export interface ModelChassisCompassPluginParameterType {
3
- north_rad?: number;
4
- fbx_url?: string;
5
- }
6
- export interface ModelChassisCompassPluginData {
7
- north_rad?: number;
8
- fbx_url?: string;
9
- }
10
- export interface ModelChassisCompassPluginExportType {
11
- enable: () => void;
12
- disable: () => void;
13
- load: (data?: ModelChassisCompassPluginData) => Promise<boolean>;
14
- }
15
- /**
16
- * 模型底盘指南针插件
17
- */
18
- export declare const ModelChassisCompassPlugin: FivePlugin<ModelChassisCompassPluginParameterType, ModelChassisCompassPluginExportType>;
1
+ import ModelChassisCompassPlugin from './Plugin';
2
+ export { ModelChassisCompassPlugin };
19
3
  export default ModelChassisCompassPlugin;
4
+ export type { ModelChassisCompassPluginParameterType, ModelChassisCompassPluginData, ModelChassisCompassPluginExportType } from './Plugin';
@@ -0,0 +1,26 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ import type { Vector3Position } from '../typings/math.type';
3
+ export interface ModelEntryDoorGuidePluginData {
4
+ position?: Vector3Position;
5
+ rad?: number;
6
+ fbx_url?: string;
7
+ }
8
+ export declare type ModelEntryDoorGuidePluginParameterType = {
9
+ animationEnabled?: boolean;
10
+ } & ModelEntryDoorGuidePluginData;
11
+ export interface ModelEntryDoorGuidePluginExportType {
12
+ enable: (config?: {
13
+ animationEnable?: boolean;
14
+ }) => boolean;
15
+ disable: () => boolean;
16
+ load: (data?: Partial<ModelEntryDoorGuidePluginData>) => Promise<boolean>;
17
+ }
18
+ /**
19
+ * 模型入户门引导插件
20
+ */
21
+ export declare const ModelEntryDoorGuidePlugin: FivePlugin<ModelEntryDoorGuidePluginParameterType, ModelEntryDoorGuidePluginExportType>;
22
+ export declare const modelEntryDoorGuidePluginServerParams: {
23
+ name: string;
24
+ version: number;
25
+ };
26
+ export default ModelEntryDoorGuidePlugin;
@@ -1,26 +1,4 @@
1
- import type { FivePlugin } from '@realsee/five';
2
- import type { Vector3Position } from '../typings/math.type';
3
- export interface ModelEntryDoorGuidePluginData {
4
- position?: Vector3Position;
5
- rad?: number;
6
- fbx_url?: string;
7
- }
8
- export declare type ModelEntryDoorGuidePluginParameterType = {
9
- animationEnabled?: boolean;
10
- } & ModelEntryDoorGuidePluginData;
11
- export interface ModelEntryDoorGuidePluginExportType {
12
- enable: (config?: {
13
- animationEnable?: boolean;
14
- }) => boolean;
15
- disable: () => boolean;
16
- load: (data?: Partial<ModelEntryDoorGuidePluginData>) => Promise<boolean>;
17
- }
18
- /**
19
- * 模型入户门引导插件
20
- */
21
- export declare const ModelEntryDoorGuidePlugin: FivePlugin<ModelEntryDoorGuidePluginParameterType, ModelEntryDoorGuidePluginExportType>;
22
- export declare const modelEntryDoorGuidePluginServerParams: {
23
- name: string;
24
- version: number;
25
- };
1
+ import ModelEntryDoorGuidePlugin from './Plugin';
2
+ export { ModelEntryDoorGuidePlugin };
26
3
  export default ModelEntryDoorGuidePlugin;
4
+ export type { ModelEntryDoorGuidePluginData, ModelEntryDoorGuidePluginParameterType, ModelEntryDoorGuidePluginExportType } from './Plugin';
@@ -191,11 +191,6 @@ const ModelEntryDoorGuidePlugin = (five, params) => {
191
191
  };
192
192
  return { load, enable, disable };
193
193
  };
194
- const modelEntryDoorGuidePluginServerParams = {
195
- name: 'ModelEntryDoorGuidePlugin',
196
- version: 0,
197
- };
198
194
 
199
195
  exports.ModelEntryDoorGuidePlugin = ModelEntryDoorGuidePlugin;
200
196
  exports["default"] = ModelEntryDoorGuidePlugin;
201
- exports.modelEntryDoorGuidePluginServerParams = modelEntryDoorGuidePluginServerParams;
@@ -0,0 +1,4 @@
1
+ import type { FivePlugin } from "@realsee/five";
2
+ import { ModelItemLabelPluginExportReturnsType, ModelItemLabelPluginParametersType } from "./typings";
3
+ export declare const ModelItemLabelPlugin: FivePlugin<ModelItemLabelPluginParametersType, ModelItemLabelPluginExportReturnsType>;
4
+ export default ModelItemLabelPlugin;
@@ -1,4 +1,9 @@
1
- import type { FivePlugin } from "@realsee/five";
2
- import { ModelItemLabelPluginExportReturnsType, ModelItemLabelPluginParametersType } from "./typings";
3
- export declare const ModelItemLabelPlugin: FivePlugin<ModelItemLabelPluginParametersType, ModelItemLabelPluginExportReturnsType>;
1
+ import ModelItemLabelPlugin from './ModelItemLabelPlugin';
2
+ export { ModelItemLabelPlugin };
4
3
  export default ModelItemLabelPlugin;
4
+ export declare const modelItemLabelPluginServerParams: {
5
+ name: string;
6
+ version: number;
7
+ };
8
+ export type { ModelItemLabelPluginParametersType, ModelItemLabelPluginData, ModelItemLabelPluginExportReturnsType } from './typings';
9
+ export { DISPLAY_STRATEGY_TYPE } from './typings';
@@ -31,13 +31,13 @@ function _interopNamespace(e) {
31
31
  var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
32
32
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
33
33
 
34
- var DISPLAY_STRATEGY_TYPE;
34
+ exports.DISPLAY_STRATEGY_TYPE = void 0;
35
35
  (function (DISPLAY_STRATEGY_TYPE) {
36
36
  DISPLAY_STRATEGY_TYPE["SMALL"] = "small";
37
37
  DISPLAY_STRATEGY_TYPE["MIDLLE"] = "middle";
38
38
  DISPLAY_STRATEGY_TYPE["LARGE"] = "large";
39
39
  DISPLAY_STRATEGY_TYPE["EXTRA_LARGE"] = "x-large";
40
- })(DISPLAY_STRATEGY_TYPE || (DISPLAY_STRATEGY_TYPE = {}));
40
+ })(exports.DISPLAY_STRATEGY_TYPE || (exports.DISPLAY_STRATEGY_TYPE = {}));
41
41
 
42
42
  /* src/ModelItemLabelPlugin/ItemLabelItem.svelte generated by Svelte v3.47.0 */
43
43
 
@@ -177,7 +177,7 @@ function get_each_context(ctx, list, i) {
177
177
  return child_ctx;
178
178
  }
179
179
 
180
- // (162:1) {#each renderItemLabels as itemLabelItem (itemLabelItem.id)}
180
+ // (163:1) {#each renderItemLabels as itemLabelItem (itemLabelItem.id)}
181
181
  function create_each_block(key_1, ctx) {
182
182
  let first;
183
183
  let itemlabelitem;
@@ -378,13 +378,13 @@ function instance($$self, $$props, $$invalidate) {
378
378
 
379
379
  function getStrokeLength(itemSpaceHeight, type) {
380
380
  switch (type) {
381
- case DISPLAY_STRATEGY_TYPE.SMALL:
381
+ case exports.DISPLAY_STRATEGY_TYPE.SMALL:
382
382
  return Math.ceil(-27.78 * itemSpaceHeight + 85);
383
- case DISPLAY_STRATEGY_TYPE.MIDLLE:
383
+ case exports.DISPLAY_STRATEGY_TYPE.MIDLLE:
384
384
  return Math.ceil(-38.9 * itemSpaceHeight + 130);
385
- case DISPLAY_STRATEGY_TYPE.LARGE:
385
+ case exports.DISPLAY_STRATEGY_TYPE.LARGE:
386
386
  return Math.ceil(-44.44 * itemSpaceHeight + 140);
387
- case DISPLAY_STRATEGY_TYPE.EXTRA_LARGE:
387
+ case exports.DISPLAY_STRATEGY_TYPE.EXTRA_LARGE:
388
388
  return Math.ceil(-92.59 * itemSpaceHeight + 300);
389
389
  }
390
390
  }
@@ -560,7 +560,7 @@ const ModelItemLabelPlugin = (five$1, params) => {
560
560
  app: undefined,
561
561
  hooks: new five.Subscribe(),
562
562
  modelOcclusionEnable: (_a = params === null || params === void 0 ? void 0 : params.modelOcclusionEnable) !== null && _a !== void 0 ? _a : true,
563
- displayStrategyType: (_b = params === null || params === void 0 ? void 0 : params.displayStrategyType) !== null && _b !== void 0 ? _b : DISPLAY_STRATEGY_TYPE.SMALL,
563
+ displayStrategyType: (_b = params === null || params === void 0 ? void 0 : params.displayStrategyType) !== null && _b !== void 0 ? _b : exports.DISPLAY_STRATEGY_TYPE.SMALL,
564
564
  };
565
565
  pluginState.container.setAttribute('class', 'model-item-label-plugin-container');
566
566
  pluginState.container.style.cssText = `
@@ -664,5 +664,11 @@ const ModelItemLabelPlugin = (five$1, params) => {
664
664
  };
665
665
  };
666
666
 
667
+ const modelItemLabelPluginServerParams = {
668
+ name: 'ModelItemLabelPlugin',
669
+ version: 0,
670
+ };
671
+
667
672
  exports.ModelItemLabelPlugin = ModelItemLabelPlugin;
668
673
  exports["default"] = ModelItemLabelPlugin;
674
+ exports.modelItemLabelPluginServerParams = modelItemLabelPluginServerParams;
@@ -110,17 +110,19 @@ class RoomLabelItem extends internal.SvelteComponent {
110
110
 
111
111
  /* src/ModelRoomLabelPlugin/RoomLabelItems.svelte generated by Svelte v3.47.0 */
112
112
 
113
+ const { Map: Map_1 } = internal.globals;
114
+
113
115
  function add_css(target) {
114
116
  internal.append_styles(target, "svelte-9eg4zi", ".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}");
115
117
  }
116
118
 
117
119
  function get_each_context(ctx, list, i) {
118
120
  const child_ctx = ctx.slice();
119
- child_ctx[9] = list[i];
121
+ child_ctx[12] = list[i];
120
122
  return child_ctx;
121
123
  }
122
124
 
123
- // (70:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
125
+ // (82:2) {#each roomLabels as roomLableItem (roomLableItem.id)}
124
126
  function create_each_block(key_1, ctx) {
125
127
  let first;
126
128
  let roomlabelitem;
@@ -128,7 +130,7 @@ function create_each_block(key_1, ctx) {
128
130
 
129
131
  roomlabelitem = new RoomLabelItem({
130
132
  props: {
131
- roomLabel: /*roomLableItem*/ ctx[9],
133
+ roomLabel: /*roomLableItem*/ ctx[12],
132
134
  five: /*five*/ ctx[1]
133
135
  }
134
136
  });
@@ -149,7 +151,7 @@ function create_each_block(key_1, ctx) {
149
151
  p(new_ctx, dirty) {
150
152
  ctx = new_ctx;
151
153
  const roomlabelitem_changes = {};
152
- if (dirty & /*roomLabels*/ 1) roomlabelitem_changes.roomLabel = /*roomLableItem*/ ctx[9];
154
+ if (dirty & /*roomLabels*/ 1) roomlabelitem_changes.roomLabel = /*roomLableItem*/ ctx[12];
153
155
  if (dirty & /*five*/ 2) roomlabelitem_changes.five = /*five*/ ctx[1];
154
156
  roomlabelitem.$set(roomlabelitem_changes);
155
157
  },
@@ -172,11 +174,11 @@ function create_each_block(key_1, ctx) {
172
174
  function create_fragment(ctx) {
173
175
  let div;
174
176
  let each_blocks = [];
175
- let each_1_lookup = new Map();
177
+ let each_1_lookup = new Map_1();
176
178
  let div_resize_listener;
177
179
  let current;
178
180
  let each_value = /*roomLabels*/ ctx[0];
179
- const get_key = ctx => /*roomLableItem*/ ctx[9].id;
181
+ const get_key = ctx => /*roomLableItem*/ ctx[12].id;
180
182
 
181
183
  for (let i = 0; i < each_value.length; i += 1) {
182
184
  let child_ctx = get_each_context(ctx, each_value, i);
@@ -193,7 +195,7 @@ function create_fragment(ctx) {
193
195
  }
194
196
 
195
197
  internal.attr(div, "class", "room-labels-container svelte-9eg4zi");
196
- internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[4].call(div));
198
+ internal.add_render_callback(() => /*div_elementresize_handler*/ ctx[6].call(div));
197
199
  },
198
200
  m(target, anchor) {
199
201
  internal.insert(target, div, anchor);
@@ -202,7 +204,7 @@ function create_fragment(ctx) {
202
204
  each_blocks[i].m(div, null);
203
205
  }
204
206
 
205
- div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[4].bind(div));
207
+ div_resize_listener = internal.add_resize_listener(div, /*div_elementresize_handler*/ ctx[6].bind(div));
206
208
  current = true;
207
209
  },
208
210
  p(ctx, [dirty]) {
@@ -242,22 +244,17 @@ function create_fragment(ctx) {
242
244
  }
243
245
 
244
246
  function instance($$self, $$props, $$invalidate) {
247
+ let rendererSize;
245
248
  let { five } = $$props;
246
249
  let { roomLabels } = $$props;
247
250
  let containerWidth;
248
251
  let containerHeight;
252
+ let shownFloor = null;
249
253
 
250
- function getLabelVisible(five, roomLabelItem) {
251
- // 先看是不是在当前展示的楼层上
252
- const isLabelInFloor = five.model.shownFloor === null || roomLabelItem.floorIndex === five.model.shownFloor;
253
-
254
- if (!isLabelInFloor) return false;
255
-
256
- // 再看是不是被模型遮挡
254
+ function getLabelVisible(item) {
257
255
  const raycaster = new three.Raycaster();
258
-
259
256
  const cameraPosition = five.camera.position.clone();
260
- const position = new three.Vector3(roomLabelItem.position.x, roomLabelItem.position.y, roomLabelItem.position.z);
257
+ const position = new three.Vector3(item.position.x, item.position.y, item.position.z);
261
258
  const vectorDistance = position.distanceTo(cameraPosition);
262
259
  raycaster.set(cameraPosition.clone(), position.clone().sub(cameraPosition).normalize());
263
260
  const [intersection] = five.model.intersectRaycaster(raycaster);
@@ -265,53 +262,60 @@ function instance($$self, $$props, $$invalidate) {
265
262
  return true;
266
263
  }
267
264
 
268
- function getLabelTransform(five, roomLabelItem) {
269
- const position = new three.Vector3(roomLabelItem.position.x, roomLabelItem.position.y, roomLabelItem.position.z);
265
+ function getLabelTransform(item, rendererSize) {
266
+ const position = new three.Vector3(item.position.x, item.position.y, item.position.z);
270
267
  const mouse = position.clone().project(five.camera);
271
- const xOffset = Math.ceil((mouse.x + 1) / 2 * containerWidth);
272
- const yOffset = Math.ceil((-mouse.y + 1) / 2 * containerHeight);
268
+ const xOffset = Math.ceil((mouse.x + 1) / 2 * rendererSize.x);
269
+ const yOffset = Math.ceil((-mouse.y + 1) / 2 * rendererSize.y);
273
270
  return `translate(${xOffset}px, ${yOffset}px)`;
274
271
  }
275
272
 
276
- function getFormatedRoomLabels(five, labels) {
277
- const newLabels = labels.map(roomLabelItem => {
278
- // 计算是否可见,如果不可见,不会更新位置
279
- const visible = getLabelVisible(five, roomLabelItem);
273
+ function getFormatedRoomLabels(rendererSize) {
274
+ // 因为 item distance 需要重复计算,所以缓存一下
275
+ const distanceMap = new Map();
276
+
277
+ function getItemDistance(item) {
278
+ const cacheDistance = distanceMap.get(item.id);
279
+ if (cacheDistance) return cacheDistance;
280
+ const { x, y, z } = item.position;
281
+ const distance = new three.Vector3(x, y, z).clone().distanceTo(five.camera.position);
282
+ distanceMap.set(item.id, distance);
283
+ return distance;
284
+ }
280
285
 
281
- if (!visible) return Object.assign(Object.assign({}, roomLabelItem), { visible });
286
+ const formatedItems = roomLabels.map(item => {
287
+ const visible = getLabelVisible(item);
282
288
 
283
- // 更新位置
284
- const transform = getLabelTransform(five, roomLabelItem);
289
+ const transform = visible
290
+ ? getLabelTransform(item, rendererSize)
291
+ : item.transform;
285
292
 
286
- return Object.assign(Object.assign({}, roomLabelItem), { visible, transform });
287
- });
293
+ const itemDistance = getItemDistance(item);
288
294
 
289
- const sortedRoomLabelItems = newLabels.filter(({ visible }) => visible).map(roomLabelItem => ({
290
- roomLabelItem,
291
- distance: new three.Vector3(...Object.values(roomLabelItem.position)).clone().distanceTo(five.camera.position)
292
- })).sort((a, b) => a.distance - b.distance);
295
+ // visible === true item 中,distance 比自己小的 item 个数
296
+ const minItemLen = roomLabels.filter(item => item.visible && getItemDistance(item) < itemDistance).length;
293
297
 
294
- return newLabels.map(roomLabelItem => {
295
- const sortIndex = sortedRoomLabelItems.findIndex(item => item.roomLabelItem.id === roomLabelItem.id);
296
- if (sortIndex !== undefined) return Object.assign(Object.assign({}, roomLabelItem), { zIndex: sortIndex * 10 });
297
- return roomLabelItem;
298
+ const zIndex = minItemLen * 10;
299
+ return Object.assign(Object.assign({}, item), { visible, transform, zIndex });
298
300
  });
301
+
302
+ return formatedItems;
299
303
  }
300
304
 
301
305
  function onFiveCameraUpdate() {
302
- $$invalidate(0, roomLabels = getFormatedRoomLabels(five, roomLabels));
306
+ $$invalidate(0, roomLabels = getFormatedRoomLabels(rendererSize));
307
+ }
308
+
309
+ function onFiveModelShownFloorChange(floorIndex) {
310
+ $$invalidate(4, shownFloor = floorIndex);
303
311
  }
304
312
 
305
313
  five.on('cameraUpdate', onFiveCameraUpdate);
306
- five.on('modelShownFloorChange', onFiveCameraUpdate);
314
+ five.on('modelShownFloorChange', onFiveModelShownFloorChange);
307
315
 
308
316
  svelte.onDestroy(() => {
309
317
  five.off('cameraUpdate', onFiveCameraUpdate);
310
- five.off('modelShownFloorChange', onFiveCameraUpdate);
311
- });
312
-
313
- svelte.onMount(() => {
314
- onFiveCameraUpdate();
318
+ five.off('modelShownFloorChange', onFiveModelShownFloorChange);
315
319
  });
316
320
 
317
321
  function div_elementresize_handler() {
@@ -326,7 +330,39 @@ function instance($$self, $$props, $$invalidate) {
326
330
  if ('roomLabels' in $$props) $$invalidate(0, roomLabels = $$props.roomLabels);
327
331
  };
328
332
 
329
- return [roomLabels, five, containerWidth, containerHeight, div_elementresize_handler];
333
+ $$self.$$.update = () => {
334
+ if ($$self.$$.dirty & /*containerWidth, containerHeight*/ 12) {
335
+ $$invalidate(5, rendererSize = { x: containerWidth, y: containerHeight });
336
+ }
337
+
338
+ if ($$self.$$.dirty & /*rendererSize*/ 32) {
339
+ {
340
+ // rendererSize 变化时,触发 reRender
341
+ $$invalidate(0, roomLabels = getFormatedRoomLabels(rendererSize));
342
+ }
343
+ }
344
+
345
+ if ($$self.$$.dirty & /*roomLabels, shownFloor*/ 17) {
346
+ {
347
+ // shownFloor 变化时,更新 item visible
348
+ $$invalidate(0, roomLabels = roomLabels.map(item => {
349
+ const isLabelInFloor = shownFloor === null || item.floorIndex === shownFloor;
350
+ const visible = isLabelInFloor ? item.visible : false;
351
+ return Object.assign(Object.assign({}, item), { visible });
352
+ }));
353
+ }
354
+ }
355
+ };
356
+
357
+ return [
358
+ roomLabels,
359
+ five,
360
+ containerWidth,
361
+ containerHeight,
362
+ shownFloor,
363
+ rendererSize,
364
+ div_elementresize_handler
365
+ ];
330
366
  }
331
367
 
332
368
  class RoomLabelItems extends internal.SvelteComponent {
@@ -0,0 +1,4 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ import type { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from "./typings";
3
+ export declare const ModelTVVideoPlugin: FivePlugin<ModelTVVideoPluginParameterType, ModelTVVideoPluginExportType>;
4
+ export default ModelTVVideoPlugin;
@@ -1,4 +1,5 @@
1
- import type { FivePlugin } from '@realsee/five';
2
- import type { ModelTVVideoPluginExportType, ModelTVVideoPluginParameterType } from "./typings";
3
- export declare const ModelTVVideoPlugin: FivePlugin<ModelTVVideoPluginParameterType, ModelTVVideoPluginExportType>;
1
+ import ModelTVVideoPlugin from './Plugin';
2
+ export { ModelTVVideoPlugin };
4
3
  export default ModelTVVideoPlugin;
4
+ export type { ModelTVVideoPluginParameterType, ModelTVVideoPluginData, Point, ModelTVVideoPluginExportType } from './typings';
5
+ export { DIRECTION } from './typings';