@glowjs/core 2022.9.5 → 2023.4.4

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 (47) hide show
  1. package/dist/glow.core.js +1 -1
  2. package/dist/typings/camera/AutoRotate.d.ts +36 -0
  3. package/dist/typings/camera/CameraMgr.d.ts +14 -4
  4. package/dist/typings/core/App.d.ts +5 -0
  5. package/dist/typings/core/AppOptions.d.ts +8 -2
  6. package/dist/typings/effect/EffectMgr.d.ts +1 -2
  7. package/dist/typings/effect/HighLight.d.ts +2 -1
  8. package/dist/typings/effect/SkyBox.d.ts +5 -0
  9. package/dist/typings/effect/SkyBoxSource.d.ts +4 -0
  10. package/dist/typings/entity/Entity.d.ts +1 -6
  11. package/dist/typings/entity/Floor.d.ts +1 -1
  12. package/dist/typings/entity/Path.d.ts +1 -45
  13. package/dist/typings/entity/Thing.d.ts +2 -2
  14. package/dist/typings/entity/component/Animator.d.ts +1 -1
  15. package/dist/typings/entity/component/Style.d.ts +1 -24
  16. package/dist/typings/entity/component/archive/ArchiveCabinet.d.ts +7 -0
  17. package/dist/typings/entity/component/archive/ArchiveCabinetGroup.d.ts +13 -4
  18. package/dist/typings/entity/component/cabinet/Cabinet.d.ts +64 -14
  19. package/dist/typings/entity/component/cabinet/CabinetCapacityData.d.ts +17 -0
  20. package/dist/typings/entity/component/cabinet/CabinetMgr.d.ts +13 -1
  21. package/dist/typings/entity/component/cabinet/RackMounted.d.ts +14 -0
  22. package/dist/typings/entity/component/cabinet/events/onCabinetLeftDoubleClick.d.ts +1 -2
  23. package/dist/typings/entity/component/roaming/Roaming.d.ts +6 -2
  24. package/dist/typings/entity/path/Path.d.ts +48 -0
  25. package/dist/typings/entity/path/attachDrag.d.ts +2 -0
  26. package/dist/typings/entity/path/createLineMeshData.d.ts +3 -0
  27. package/dist/typings/entity/path/createPointInstance.d.ts +5 -0
  28. package/dist/typings/entity/path/detachDrag.d.ts +2 -0
  29. package/dist/typings/entity/path/dragData.d.ts +9 -0
  30. package/dist/typings/entity/path/getLineMaterial.d.ts +2 -0
  31. package/dist/typings/entity/util/getPathIconMesh.d.ts +7 -0
  32. package/dist/typings/entity/util/getPathLineMesh.d.ts +2 -0
  33. package/dist/typings/event/EventMgr.d.ts +1 -1
  34. package/dist/typings/event/KeyCode.d.ts +2 -1
  35. package/dist/typings/gui/Billboard.d.ts +2 -1
  36. package/dist/typings/gui/GradientRectangle.d.ts +1 -1
  37. package/dist/typings/gui/LinkTip.d.ts +30 -0
  38. package/dist/typings/gui/getTextWidth.d.ts +6 -0
  39. package/dist/typings/index.d.ts +8 -2
  40. package/dist/typings/misc/SystemResId.d.ts +2 -2
  41. package/dist/typings/misc/math/vec/isClockwise.d.ts +6 -0
  42. package/dist/typings/res/ResOptions.d.ts +5 -0
  43. package/dist/typings/res/ResPool.d.ts +2 -2
  44. package/dist/typings/res/registerBuffer.d.ts +6 -0
  45. package/dist/typings/runtime/RunTime.d.ts +45 -0
  46. package/dist/typings/runtime/index.d.ts +1 -0
  47. package/package.json +6 -6
@@ -0,0 +1,5 @@
1
+ import { InstancedMesh } from '../../runtime';
2
+ /**
3
+ * 创建点材质
4
+ */
5
+ export declare function createPointInstance(): InstancedMesh;
@@ -0,0 +1,2 @@
1
+ import { Path } from './Path';
2
+ export declare function detachDrag(this: Path): void;
@@ -0,0 +1,9 @@
1
+ import { Point3D } from '../../misc';
2
+ import { Path } from './Path';
3
+ export declare const dragData: {
4
+ eventIds: string[];
5
+ dragging: boolean;
6
+ path: Path;
7
+ pointIndex: number;
8
+ oldPosition: Point3D;
9
+ };
@@ -0,0 +1,2 @@
1
+ import { PBRMaterial } from '../../runtime';
2
+ export declare function getLineMaterial(): PBRMaterial;
@@ -0,0 +1,7 @@
1
+ import { InstancedMesh, Scene } from '../../runtime';
2
+ /**
3
+ * 获取路径点网格
4
+ * @param name 路径点名称
5
+ * @param scene 场景
6
+ */
7
+ export declare function getPathIconMesh(name: string, scene: Scene): InstancedMesh;
@@ -0,0 +1,2 @@
1
+ import { InstancedMesh, Scene } from '../../runtime';
2
+ export declare function getPathLineMesh(name: string, scene: Scene): InstancedMesh;
@@ -26,7 +26,7 @@ export declare class EventMgr extends Base {
26
26
  * 热键字典
27
27
  */
28
28
  private _hotKeyMap;
29
- private _pressedKeys;
29
+ _pressedKeys: Set<KeyCode>;
30
30
  /**
31
31
  * 实例化一个事件管理器对象
32
32
  * @param app
@@ -50,5 +50,6 @@ export declare enum KeyCode {
50
50
  Left = 37,
51
51
  Up = 38,
52
52
  Right = 39,
53
- Down = 40
53
+ Down = 40,
54
+ Delete = 46
54
55
  }
@@ -1,4 +1,5 @@
1
1
  import { EventDispatcher } from '../event/EventDispatcher';
2
+ import { AdvancedDynamicTexture } from '../runtime';
2
3
  import { BillboardOptions } from './BillboardOptions';
3
4
  import { Point3D } from '../misc';
4
5
  /**
@@ -8,7 +9,7 @@ export declare class Billboard extends EventDispatcher {
8
9
  /**
9
10
  * 2D广告牌根
10
11
  */
11
- private static _root2d;
12
+ static _root2d: AdvancedDynamicTexture | null;
12
13
  private _data;
13
14
  /**
14
15
  * 锚点
@@ -9,7 +9,7 @@ export declare class GradientRectangle extends Container {
9
9
  private _gradientMiddle;
10
10
  private _gradientEnd;
11
11
  private _gradientVertical;
12
- private _gradient;
12
+ private _gradient2;
13
13
  /**
14
14
  * 实例化一个渐变矩形对象
15
15
  * @param name 控件名称
@@ -0,0 +1,30 @@
1
+ import { Point3D } from '../misc';
2
+ import { Container } from '../runtime';
3
+ /**
4
+ * 链路提示信息
5
+ */
6
+ export declare class LinkTip extends Container {
7
+ private _title;
8
+ private _name;
9
+ private _anchor;
10
+ private _line;
11
+ /**
12
+ * 链路提示信息
13
+ */
14
+ constructor();
15
+ /**
16
+ * 获取或设置位置
17
+ */
18
+ get position(): Point3D;
19
+ set position(value: Point3D);
20
+ /**
21
+ * 获取或设置标题
22
+ */
23
+ get title(): string;
24
+ set title(value: string);
25
+ /**
26
+ * 获取或设置提示信息
27
+ */
28
+ get tip(): string;
29
+ set tip(value: string);
30
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 获取文本宽度
3
+ * @param text 文本
4
+ * @param fontSize 字体大小
5
+ */
6
+ export declare function getTextWidth(text: string, fontSize: string): number;
@@ -15,6 +15,8 @@ export { ColorCorrection } from './effect/ColorCorrection';
15
15
  export { EffectMgr } from './effect/EffectMgr';
16
16
  export { EnvironmentTextureSource } from './effect/EnvironmentTextureSource';
17
17
  export { SkyBoxSource } from './effect/SkyBoxSource';
18
+ export { FogMode } from './effect/FogMode';
19
+ export { Fog } from './effect/Fog';
18
20
  export type { EventArg } from './event/EventArg';
19
21
  export { EventDispatcher } from './event/EventDispatcher';
20
22
  export { EventMgr } from './event/EventMgr';
@@ -44,6 +46,8 @@ export * from './entity/placement';
44
46
  export { EntityType } from './entity/EntityType';
45
47
  export { DoorWindowDirection } from './entity/DoorWindowDirection';
46
48
  export { Path } from './entity/Path';
49
+ export { Group } from './entity/Group';
50
+ export { Thing } from './entity/Thing';
47
51
  export { Component } from './entity/component/Component';
48
52
  export { Style } from './entity/component/Style';
49
53
  export { Animator } from './entity/component/Animator';
@@ -62,9 +66,11 @@ export { ArchiveCabinet } from './entity/component/archive/ArchiveCabinet';
62
66
  export { ArchiveGrid } from './entity/component/archive/ArchiveGrid';
63
67
  export { ArchiveBox } from './entity/component/archive/ArchiveBox';
64
68
  export { ArchiveCabinetGroupCount } from './entity/component/archive/ArchiveCabinetGroupCount';
69
+ export { CabinetMgr } from './entity/component/cabinet/CabinetMgr';
70
+ export { CabinetCapacityData } from './entity/component/cabinet/CabinetCapacityData';
65
71
  export { MaterialMgr } from './material/MaterialMgr';
66
- export { Group } from './entity/Group';
67
- export { Thing } from './entity/Thing';
72
+ export { Link } from './link/Link';
73
+ export { LinkMgr } from './link/LinkMgr';
68
74
  export { ResPool } from './res/ResPool';
69
75
  export type { ResOptions } from './res/ResOptions';
70
76
  export * from './misc';
@@ -43,9 +43,9 @@ export declare enum SystemResId {
43
43
  */
44
44
  DefaultCeilingTexture = "bd68f59792c7af353b47b68eeb43b36c",
45
45
  /**
46
- * 默认地板贴图
46
+ * 默认地板贴图(防静电地板)
47
47
  */
48
- DefaultFloorTexture = "5e57fc77091c1445c44c17c770ff2dcd",
48
+ DefaultFloorTexture = "d3c168a23f0e0318d4e20283ab6cf9af",
49
49
  /**
50
50
  * 科技风地板贴图
51
51
  */
@@ -0,0 +1,6 @@
1
+ import { Point2D } from '../../Point2D';
2
+ /**
3
+ * 判断多边形顶点顺序是否为顺时针
4
+ * @param poly 多边形顶点
5
+ */
6
+ export declare function isClockwise(poly: Point2D[]): boolean;
@@ -1,3 +1,4 @@
1
+ import { Point3D } from '../misc';
1
2
  /**
2
3
  * 资源参数选项
3
4
  */
@@ -35,4 +36,8 @@ export declare type ResOptions = {
35
36
  * 是否资产图片
36
37
  */
37
38
  asset?: boolean;
39
+ /**
40
+ * 偏移量,有的模型的轴心点不在底部中心
41
+ */
42
+ offset?: Point3D;
38
43
  };
@@ -31,9 +31,9 @@ export declare class ResPool extends Base {
31
31
  /**
32
32
  * 获取指定资源
33
33
  * @param id 编号
34
- * @param optimized 是否优化网格,1=强制优化,0=无动画时优化,其它=不优化,默认强制优化
34
+ * @param optimized 是否优化网格
35
35
  */
36
- getRes(id: string, optimized?: -1 | 0 | 1): Promise<Texture | InstantiatedEntries | NodeMaterial | undefined>;
36
+ getRes(id: string, optimized?: boolean): Promise<Texture | InstantiatedEntries | NodeMaterial | undefined>;
37
37
  /**
38
38
  * 判断指定编号的的资源是否已缓存
39
39
  * @param id 编号
@@ -0,0 +1,6 @@
1
+ import { TransformNode } from '../runtime';
2
+ /**
3
+ * 注册缓冲区
4
+ * @param rootNode 根节点
5
+ */
6
+ export declare function registerBuffer(rootNode: TransformNode): void;
@@ -1,4 +1,5 @@
1
1
  import { Scene } from '@babylonjs/core/scene';
2
+ import { FunctionModule } from './FunctionModule';
2
3
  import { WASMExports } from './wasm/WASMExports';
3
4
  /**
4
5
  * 应用对象
@@ -70,7 +71,35 @@ export declare class RunTime {
70
71
  * @param projectFile 项目文件地址
71
72
  */
72
73
  static getProjectResList(projectFile: string): Promise<ResItem[]>;
74
+ /**
75
+ * 获取项目文件的序列号
76
+ * @param projectFile 项目文件地址
77
+ */
73
78
  static getProjectSerialNum(projectFile: string): Promise<string>;
79
+ /**
80
+ * 获取项目文件的园区列表
81
+ * @param projectFile 项目文件地址
82
+ */
83
+ static getCampuses(projectFile: string): Promise<{
84
+ id: string;
85
+ name: string;
86
+ }[]>;
87
+ /**
88
+ * 获取功能模块
89
+ * @param projectFile 项目文件地址
90
+ * @param licenseFile 授权文件地址
91
+ */
92
+ static getFunctionModule(projectFile: string, licenseFile: string): Promise<FunctionModule[]>;
93
+ /**
94
+ * 获取完整授权信息
95
+ * @param projectFile 项目文件地址
96
+ * @param licenseFile 授权文件地址
97
+ */
98
+ static getFullLicenseInfo(projectFile: string, licenseFile: string): Promise<{
99
+ serialNum: string;
100
+ info: string;
101
+ modules: FunctionModule[];
102
+ }>;
74
103
  /**
75
104
  * 应用
76
105
  */
@@ -103,6 +132,22 @@ export declare class RunTime {
103
132
  * 获取序列号
104
133
  */
105
134
  getSerialNum(): string;
135
+ /**
136
+ * 动环监控模块
137
+ */
138
+ hasPowerEnvir(): boolean;
139
+ /**
140
+ * 资产容量模块
141
+ */
142
+ hasAssetVolume(): boolean;
143
+ /**
144
+ * 配线拓扑模块
145
+ */
146
+ hasLink(): boolean;
147
+ /**
148
+ * 档案库房模块
149
+ */
150
+ hasArchive(): boolean;
106
151
  /**
107
152
  * 持久化成项目文件
108
153
  */
@@ -5,3 +5,4 @@ export * from './babylonjs/babylonjs-materials';
5
5
  import './extension';
6
6
  export * from './tweenjs';
7
7
  export * from './RunTime';
8
+ export * from './FunctionModule';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glowjs/core",
3
- "version": "2022.09.05",
3
+ "version": "2023.04.04",
4
4
  "description": "GlowJS数字孪生引擎核心库。",
5
5
  "main": "./dist/glow.core.js",
6
6
  "types": "./dist/typings/index.d.ts",
@@ -45,11 +45,11 @@
45
45
  "license": "ISC",
46
46
  "dependencies": {
47
47
  "@babel/plugin-transform-runtime": "^7.18.10",
48
- "@babylonjs/core": "^5.22.0",
49
- "@babylonjs/gui": "^5.22.0",
50
- "@babylonjs/inspector": "^5.22.0",
51
- "@babylonjs/loaders": "^5.22.0",
52
- "@babylonjs/materials": "^5.22.0",
48
+ "@babylonjs/core": "^5.50.1",
49
+ "@babylonjs/gui": "^5.50.1",
50
+ "@babylonjs/inspector": "^5.50.1",
51
+ "@babylonjs/loaders": "^5.50.1",
52
+ "@babylonjs/materials": "^5.50.1",
53
53
  "@tweenjs/tween.js": "^18.6.4",
54
54
  "earcut": "^2.2.2",
55
55
  "heatmap.js": "^2.0.5",