@soonspacejs/plugin-cps-soonmanager 2.9.4 → 2.9.6

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.
@@ -10,6 +10,10 @@ export declare const SIGN_PATH = "/db/sign";
10
10
  * 模型树
11
11
  */
12
12
  export declare const TREE_DATA_FILE_PATH = "/db/tree_models.json";
13
+ /**
14
+ * poi
15
+ */
16
+ export declare const POI_DATA_FILE_PATH = "/db/pois.json";
13
17
  /**
14
18
  * 拓扑路径
15
19
  */
@@ -30,3 +34,7 @@ export declare const MODEL_VISIONS_DATA_FILE_PATH = "/db/model_visions.json";
30
34
  * 自定义属性 key
31
35
  */
32
36
  export declare const PROPERTIES_KEY = "properties";
37
+ /**
38
+ * 自定义属性 key
39
+ */
40
+ export declare const POI_PLUGIN_NAME = "poiRenderer";
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import SoonSpace, { AnimationOptions, TopologyNodeInfo } from 'soonspacejs';
2
2
  import type { BaseObject3D, TopologyInfo } from 'soonspacejs/types/Library';
3
- import { IMetadata, ITreeData, ITopologyPath, ILoadSceneOptions, TPropertiesMap, TAnimationsMap, IPlayAnimationByIdOptions, TModelVisionsMap, IPresetEffectsOptions, Options } from './types';
3
+ import { Tween } from '@tweenjs/tween.js';
4
+ import { PoiNodeData } from '@soonspacejs/plugin-poi-renderer';
5
+ import { IMetadata, ITreeData, IPoiData, ITopologyPath, ILoadSceneOptions, TPropertiesMap, TAnimationsMap, IPlayAnimationByIdOptions, TModelVisionsMap, IPresetEffectsOptions, ConstructorOptions } from './types';
4
6
  declare class CpsSoonmanagerPlugin {
5
7
  #private;
6
8
  readonly ssp: SoonSpace;
@@ -15,6 +17,10 @@ declare class CpsSoonmanagerPlugin {
15
17
  * 模型树
16
18
  */
17
19
  treeData: ITreeData[] | null;
20
+ /**
21
+ * poi 数据
22
+ */
23
+ poiData: any[] | null;
18
24
  /**
19
25
  * 拓扑路径
20
26
  */
@@ -31,14 +37,13 @@ declare class CpsSoonmanagerPlugin {
31
37
  * 模型视角
32
38
  */
33
39
  modelVisionsData: TModelVisionsMap | null;
34
- constructor(ssp: SoonSpace, option?: Options);
40
+ _objectsAnimations: Map<string, Set<Tween<any>>>;
41
+ constructor(ssp: SoonSpace, option?: ConstructorOptions);
35
42
  /**
36
43
  * 设置 key
37
44
  * @param key
38
45
  */
39
46
  setKey(key: string): void;
40
- private _resolvePath;
41
- private _fetchData;
42
47
  /**
43
48
  * 获取场景元数据
44
49
  */
@@ -48,6 +53,11 @@ declare class CpsSoonmanagerPlugin {
48
53
  * @returns
49
54
  */
50
55
  fetchTreeData(): Promise<ITreeData[]>;
56
+ /**
57
+ * 获取 Poi 数据
58
+ * @returns
59
+ */
60
+ fetchPoiData(): Promise<IPoiData[]>;
51
61
  /**
52
62
  * 获取拓扑路径
53
63
  * @returns
@@ -68,25 +78,6 @@ declare class CpsSoonmanagerPlugin {
68
78
  * @returns
69
79
  */
70
80
  fetchModelVisionsData(): Promise<TModelVisionsMap>;
71
- /**
72
- * 加载单个树节点
73
- * @param node
74
- * @param options
75
- * @returns
76
- */
77
- private loadNode;
78
- /**
79
- * 根据 id 获取树节点
80
- */
81
- private getTreeNodeById;
82
- /**
83
- * 加载场景树中的对象 (深度优先遍历)
84
- */
85
- private loadObjects;
86
- /**
87
- * 加载场景树中的对象 (广度优先遍历)
88
- */
89
- private loadObjectsBFS;
90
81
  /**
91
82
  * 设置 path
92
83
  * @param path
@@ -96,6 +87,14 @@ declare class CpsSoonmanagerPlugin {
96
87
  * 加载整个场景
97
88
  */
98
89
  loadScene(options?: ILoadSceneOptions): Promise<void>;
90
+ /**
91
+ * 格式化 Poi 数据完成 Poi Renderer 插件使用
92
+ */
93
+ formatPoiData: (poiData: IPoiData) => PoiNodeData;
94
+ /**
95
+ * 加载 Poi
96
+ */
97
+ loadPoi(): Promise<void>;
99
98
  /**
100
99
  * 预设效果
101
100
  */
@@ -117,6 +116,10 @@ declare class CpsSoonmanagerPlugin {
117
116
  * 播放动画
118
117
  */
119
118
  playObjectAnimation(object: BaseObject3D, animationIndex?: number, options?: IPlayAnimationByIdOptions): Promise<void>;
119
+ /**
120
+ * 停止对象动画
121
+ */
122
+ stopObjectAnimation(object: BaseObject3D): Promise<void>;
120
123
  /**
121
124
  * 飞向场景视角
122
125
  * @param index