@glowjs/core 2025.3.28 → 2025.4.21

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.
@@ -265,6 +265,10 @@ export declare class CameraMgr extends Base {
265
265
  * 从给定位置和目标重建角度(alpha, beta)和半径
266
266
  */
267
267
  rebuildAnglesAndRadius(): void;
268
+ /**
269
+ * 从给定位置和目标重置相机
270
+ */
271
+ reset(target: Point3D, position: Point3D): void;
268
272
  /**
269
273
  * 使用一个位置来定义当前相机的相关信息,如alpha, beta和半径
270
274
  * @param position 定义要设置摄像机的位置
@@ -17,6 +17,14 @@ export declare class Building extends Entity {
17
17
  * 鼠标移入楼层链接的透明度
18
18
  */
19
19
  static floorLinkAlpha: number;
20
+ /**
21
+ * 链接ID
22
+ */
23
+ linkId: string | null;
24
+ /**
25
+ * 链接名称
26
+ */
27
+ linkName: string | null;
20
28
  /**
21
29
  * 是否总是显示建筑结构
22
30
  */
@@ -51,6 +51,10 @@ export declare class Entity extends Base {
51
51
  * 父元素
52
52
  */
53
53
  parent: Entity | null;
54
+ /**
55
+ * 前置层级(用于存储园区转场、热点跳转、POI跳转、楼层跳转时的返回层级)
56
+ */
57
+ preLevel: Entity | null;
54
58
  /**
55
59
  * 获取子节点列表
56
60
  */
@@ -73,5 +73,9 @@ export declare enum EntityType {
73
73
  /**
74
74
  * 视频融合
75
75
  */
76
- VideoFusion = 131072
76
+ VideoFusion = 131072,
77
+ /**
78
+ * POI加强版
79
+ */
80
+ POIPlus = 262144
77
81
  }
@@ -5,10 +5,11 @@ import { Text3D } from './Text3D';
5
5
  import { POI } from './POI';
6
6
  import { Pipe } from './Pipe';
7
7
  import { VideoFusion } from './VideoFusion';
8
+ import { POIPlus } from './poi_plus/POIPlus';
8
9
  /**
9
10
  * 其它实体
10
11
  */
11
- export type OtherEntity = Text3D | LeakLine | POI | Pipe | VideoFusion;
12
+ export type OtherEntity = Text3D | LeakLine | POI | POIPlus | Pipe | VideoFusion;
12
13
  /**
13
14
  * 判断实体是否为其它实体
14
15
  * @param entity 实体
@@ -0,0 +1,6 @@
1
+ import { LevelMgr } from "../LevelMgr";
2
+ /**
3
+ * 设置转场
4
+ * @param this
5
+ */
6
+ export declare function setTransition(this: LevelMgr): void;
@@ -0,0 +1,14 @@
1
+ import { Img } from "./Img";
2
+ import { Line } from "./Line";
3
+ import { Txt } from "./Txt";
4
+ /** 容器 */
5
+ export declare class Container {
6
+ /** 图片 */
7
+ img: Img;
8
+ /** 线 */
9
+ line: Line;
10
+ /** 文本列表 */
11
+ txts: Txt[];
12
+ /** 构造函数 */
13
+ constructor();
14
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 图片
3
+ */
4
+ export declare class Img {
5
+ /** 资源ID */
6
+ resId: string;
7
+ /** 原始宽度 */
8
+ srcWidth: number;
9
+ /** 原始高度 */
10
+ srcHeight: number;
11
+ /** 实际宽度 */
12
+ width: number;
13
+ /** 实际高度 */
14
+ height: number;
15
+ /** X 坐标 */
16
+ x: number;
17
+ /** Y 坐标 */
18
+ y: number;
19
+ /** 构造函数 */
20
+ constructor();
21
+ }
@@ -0,0 +1,15 @@
1
+ import { Point2D } from "../../misc";
2
+ /**
3
+ * 线
4
+ */
5
+ export declare class Line {
6
+ points: Point2D[];
7
+ /** 线宽 */
8
+ width: number;
9
+ /** 颜色 */
10
+ color: string;
11
+ /** 是否显示 */
12
+ enable: boolean;
13
+ /** 构造函数 */
14
+ constructor();
15
+ }
@@ -0,0 +1,138 @@
1
+ import { App } from "../../core/App";
2
+ import { Entity } from "../Entity";
3
+ import { Container } from "./Container";
4
+ import { Point2D } from "../../misc";
5
+ /**
6
+ * POI加强版
7
+ */
8
+ export declare class POIPlus extends Entity {
9
+ /** 容器 */
10
+ container: Container;
11
+ /**
12
+ * 父物体计算包围盒时是否排除此物体,默认排除
13
+ */
14
+ excludeBoundingBox: boolean;
15
+ /**
16
+ * 模式
17
+ */
18
+ mode: '2D' | '3D';
19
+ /**
20
+ * 宽度
21
+ */
22
+ width: number;
23
+ /**
24
+ * 高度
25
+ */
26
+ height: number;
27
+ /**
28
+ * 像素宽度
29
+ */
30
+ pixWidth: number;
31
+ /**
32
+ * 是否默认隐藏
33
+ */
34
+ defaultHidden: boolean;
35
+ /**
36
+ * 链接ID
37
+ */
38
+ linkId: string | null;
39
+ /**
40
+ * Base64图片
41
+ */
42
+ base64: string;
43
+ /**
44
+ * Base64图片原始宽度
45
+ */
46
+ srcWidth: number;
47
+ /**
48
+ * Base64图片原始高度
49
+ */
50
+ srcHeight: number;
51
+ /**
52
+ * 像素高度
53
+ */
54
+ pixHeight: number;
55
+ private _img2D;
56
+ private _canvas;
57
+ private _pointerClickObserver;
58
+ private _pointerEnterObserver;
59
+ private _pointerLeaveObserver;
60
+ private _pointerDownObserver;
61
+ private _pointerUpObserver;
62
+ private _mesh;
63
+ private _showBoundingBox;
64
+ private _visable;
65
+ private _pivot;
66
+ /**
67
+ * 上一次点击的时间点,用于计算双击事件
68
+ */
69
+ private _lastClickTime;
70
+ /**
71
+ * 构造函数
72
+ * @param app 应用
73
+ */
74
+ constructor(app: App);
75
+ get visable(): boolean;
76
+ set visable(value: boolean);
77
+ /**
78
+ * 获取或设置轴心点
79
+ */
80
+ get pivot(): Point2D;
81
+ set pivot(value: Point2D);
82
+ get pickable(): boolean;
83
+ set pickable(value: boolean);
84
+ get cursor(): string;
85
+ set cursor(value: string);
86
+ get showBoundingBox(): boolean;
87
+ set showBoundingBox(value: boolean);
88
+ /**
89
+ * 获取或设置贴图ID
90
+ */
91
+ get textureId(): string;
92
+ build(force?: boolean): Promise<void>;
93
+ unbuild(): void;
94
+ toJson(): any;
95
+ fromJson(json: any): void;
96
+ private _build2D;
97
+ private _onResize;
98
+ private _build3D;
99
+ private _updatePovit;
100
+ dispose(): void;
101
+ /**
102
+ * 获取原始贴图的像素大小,编辑器中用来实现等比缩放
103
+ */
104
+ get _ssize(): Point2D;
105
+ /**
106
+ * 计算内容大小(编辑器用)
107
+ */
108
+ _calaculateContentSize(): Point2D;
109
+ /**
110
+ * 获取或设置所有文本
111
+ */
112
+ get txts(): string[];
113
+ set txts(value: string[]);
114
+ /**
115
+ * 获取或设置所有文本的颜色
116
+ */
117
+ get txtColors(): string[];
118
+ set txtColors(value: string[]);
119
+ /**
120
+ * 设置单个文本内容
121
+ * @param index 索引
122
+ * @param value 文本内容
123
+ */
124
+ setTxtValue(index: number, value: string): void;
125
+ /**
126
+ * 设置单个文本颜色
127
+ * @param index 索引
128
+ * @param color 颜色
129
+ */
130
+ setTxtColor(index: number, color: string): void;
131
+ /**
132
+ * 设置单个文本
133
+ * @param index 索引
134
+ * @param value 文本内容
135
+ * @param color 颜色
136
+ */
137
+ setTxt(index: number, value: string, color: string): void;
138
+ }
@@ -0,0 +1,20 @@
1
+ import { TxtAlign } from "./TxtAlign";
2
+ /**
3
+ * 文本
4
+ */
5
+ export declare class Txt {
6
+ /** 文本内容 */
7
+ value: string;
8
+ /** 对齐方式 */
9
+ align: TxtAlign;
10
+ /** 字体大小 */
11
+ fontSize: number;
12
+ /** 字体颜色 */
13
+ color: string;
14
+ /** X 坐标 */
15
+ x: number;
16
+ /** Y 坐标 */
17
+ y: number;
18
+ /** 构造函数 */
19
+ constructor();
20
+ }
@@ -0,0 +1,9 @@
1
+ /** 文本对齐方式 */
2
+ export declare enum TxtAlign {
3
+ /** 左对齐 */
4
+ Left = "left",
5
+ /** 居中对齐 */
6
+ Center = "center",
7
+ /** 右对齐 */
8
+ Right = "right"
9
+ }
@@ -0,0 +1,7 @@
1
+ import { App } from "../../core/App";
2
+ import { Container } from "./Container";
3
+ export declare function render(app: App, container: Container): Promise<{
4
+ base64: string;
5
+ width: number;
6
+ height: number;
7
+ }>;
@@ -58,6 +58,8 @@ export { DecorateGrid } from './entity/DecorateGrid';
58
58
  export { POI } from './entity/POI';
59
59
  export { Pipe } from './entity/Pipe';
60
60
  export { VideoFusion } from './entity/VideoFusion';
61
+ export { POIPlus } from './entity/poi_plus/POIPlus';
62
+ export { TxtAlign } from './entity/poi_plus/TxtAlign';
61
63
  export { Component } from './entity/component/Component';
62
64
  export { Style } from './entity/component/Style';
63
65
  export { Animator } from './entity/component/Animator';
@@ -9,6 +9,7 @@ import { ParticleData } from '../effect/ParticleData';
9
9
  * 资源池
10
10
  */
11
11
  export declare class ResPool extends Base {
12
+ readonly random: string;
12
13
  /**
13
14
  * 资源列表
14
15
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glowjs/core",
3
- "version": "2025.03.28",
3
+ "version": "2025.04.21",
4
4
  "description": "GlowJS数字孪生引擎核心库。",
5
5
  "main": "./dist/glow.core.js",
6
6
  "types": "./dist/typings/index.d.ts",