gltf-parser-plugin 1.0.9 → 1.1.1
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.
package/build/index.d.ts
CHANGED
|
@@ -24,6 +24,16 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
24
24
|
private _loader;
|
|
25
25
|
private readonly _gltfRegex;
|
|
26
26
|
private readonly _options;
|
|
27
|
+
private _structureData;
|
|
28
|
+
private _oidNodeMap;
|
|
29
|
+
private _structurePromise;
|
|
30
|
+
private _modelInfo;
|
|
31
|
+
private _modelInfoPromise;
|
|
32
|
+
private _frozenOids;
|
|
33
|
+
private _isolatedOids;
|
|
34
|
+
private _trackedMeshes;
|
|
35
|
+
private _meshListeners;
|
|
36
|
+
private _isPluginRemoving;
|
|
27
37
|
oids: number[];
|
|
28
38
|
private renderer;
|
|
29
39
|
private splitMeshCache;
|
|
@@ -49,6 +59,34 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
49
59
|
*/
|
|
50
60
|
clearCache(): Promise<void>;
|
|
51
61
|
parseTile(buffer: ArrayBuffer, tile: any, extension: any, uri: string, abortSignal: AbortSignal): Promise<any>;
|
|
62
|
+
private _getStructureUrl;
|
|
63
|
+
private _buildOidNodeMap;
|
|
64
|
+
private _fetchStructureData;
|
|
65
|
+
private _ensureStructureLoaded;
|
|
66
|
+
/**
|
|
67
|
+
* 根据 oid 获取 structure.json 中对应的节点树数据
|
|
68
|
+
* 包含 bbox、children、name 等完整结构信息
|
|
69
|
+
* 首次调用时会自动从 tileset URL 推导并请求 structure.json
|
|
70
|
+
*/
|
|
71
|
+
getNodeTreeByOid(oid: number): Promise<StructureNode | null>;
|
|
72
|
+
/**
|
|
73
|
+
* 根据 oid 数组批量获取 structure.json 中对应的节点树数据
|
|
74
|
+
*/
|
|
75
|
+
getNodeTreeByOids(oids: number[]): Promise<Map<number, StructureNode>>;
|
|
76
|
+
/**
|
|
77
|
+
* 获取完整的 structure.json 数据
|
|
78
|
+
* 首次调用时会自动请求
|
|
79
|
+
*/
|
|
80
|
+
getStructureData(): Promise<StructureData | null>;
|
|
81
|
+
private _getModelInfoUrl;
|
|
82
|
+
private _fetchModelInfo;
|
|
83
|
+
private _ensureModelInfoLoaded;
|
|
84
|
+
/**
|
|
85
|
+
* 获取 modelInfo.json 数据
|
|
86
|
+
* 包含模型的基本信息:动画支持、材质数量、顶点数、三角形数等
|
|
87
|
+
* 首次调用时会自动从 tileset URL 推导并请求 modelInfo.json
|
|
88
|
+
*/
|
|
89
|
+
getModelInfo(): Promise<ModelInfo | null>;
|
|
52
90
|
/**
|
|
53
91
|
* Load model callback
|
|
54
92
|
*/
|
|
@@ -72,8 +110,46 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
72
110
|
private _setupMaterial;
|
|
73
111
|
/**
|
|
74
112
|
* Query feature information from intersection
|
|
113
|
+
* Respects freeze and isolate filters
|
|
75
114
|
*/
|
|
76
115
|
queryFeatureFromIntersection(hit: Intersection): FeatureInfo;
|
|
116
|
+
private _isOidBlocked;
|
|
117
|
+
private _trackMesh;
|
|
118
|
+
private _untrackMesh;
|
|
119
|
+
private _onCollectorMeshChange;
|
|
120
|
+
private _syncCollectorMeshes;
|
|
121
|
+
/**
|
|
122
|
+
* 冻结指定构件,被冻结的构件不再响应任何交互和事件
|
|
123
|
+
*/
|
|
124
|
+
freezeByOids(oids: number[]): void;
|
|
125
|
+
/**
|
|
126
|
+
* 解冻指定构件
|
|
127
|
+
*/
|
|
128
|
+
unfreezeByOids(oids: number[]): void;
|
|
129
|
+
/**
|
|
130
|
+
* 解冻全部构件
|
|
131
|
+
*/
|
|
132
|
+
unfreeze(): void;
|
|
133
|
+
/**
|
|
134
|
+
* 获取当前被冻结的 OID 数组
|
|
135
|
+
*/
|
|
136
|
+
getFrozenOids(): number[];
|
|
137
|
+
/**
|
|
138
|
+
* 隔离指定构件,隔离模式下只有被隔离的构件才能响应交互和事件
|
|
139
|
+
*/
|
|
140
|
+
isolateByOids(oids: number[]): void;
|
|
141
|
+
/**
|
|
142
|
+
* 取消隔离指定构件
|
|
143
|
+
*/
|
|
144
|
+
unisolateByOids(oids: number[]): void;
|
|
145
|
+
/**
|
|
146
|
+
* 取消全部隔离,恢复所有构件的交互能力
|
|
147
|
+
*/
|
|
148
|
+
unisolate(): void;
|
|
149
|
+
/**
|
|
150
|
+
* 获取当前被隔离的 OID 数组
|
|
151
|
+
*/
|
|
152
|
+
getIsolatedOids(): number[];
|
|
77
153
|
/**
|
|
78
154
|
* 内部方法:根据 oid 获取 mesh 数组
|
|
79
155
|
*/
|
|
@@ -176,4 +252,37 @@ declare interface MeshHelperHost {
|
|
|
176
252
|
_getMeshesByOidInternal(oid: number): Mesh[];
|
|
177
253
|
}
|
|
178
254
|
|
|
255
|
+
/**
|
|
256
|
+
* modelInfo.json 的数据结构
|
|
257
|
+
*/
|
|
258
|
+
export declare interface ModelInfo {
|
|
259
|
+
animatable: boolean;
|
|
260
|
+
images: number;
|
|
261
|
+
materials: number;
|
|
262
|
+
pbr: boolean;
|
|
263
|
+
textures: number;
|
|
264
|
+
triangles: number;
|
|
265
|
+
vertices: number;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* structure.json 的完整数据结构
|
|
270
|
+
*/
|
|
271
|
+
export declare interface StructureData {
|
|
272
|
+
defaultTree?: number;
|
|
273
|
+
idField?: string;
|
|
274
|
+
trees: StructureNode[];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* structure.json 中的树节点结构
|
|
279
|
+
*/
|
|
280
|
+
export declare interface StructureNode {
|
|
281
|
+
id?: number;
|
|
282
|
+
name?: string;
|
|
283
|
+
bbox?: number[];
|
|
284
|
+
children?: StructureNode[];
|
|
285
|
+
[key: string]: unknown;
|
|
286
|
+
}
|
|
287
|
+
|
|
179
288
|
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gltf-parser-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A plugin for parsing GLTF files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/gltf-parser-plugin.module.js",
|
|
@@ -28,20 +28,20 @@
|
|
|
28
28
|
"author": "maptalks",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/node": "^25.
|
|
31
|
+
"@types/node": "^25.4.0",
|
|
32
32
|
"@types/three": "^0.183.1",
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
34
|
-
"@typescript-eslint/parser": "^8.
|
|
35
|
-
"eslint": "^10.0.
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
34
|
+
"@typescript-eslint/parser": "^8.57.0",
|
|
35
|
+
"eslint": "^10.0.3",
|
|
36
36
|
"typescript": "^5.9.3",
|
|
37
37
|
"vite": "^7.3.1",
|
|
38
38
|
"vite-plugin-dts": "^4.5.4",
|
|
39
39
|
"vitest": "^4.0.18"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"3d-tiles-renderer": "^0.4.
|
|
43
|
-
"@maptalks/gltf-loader": "^0.124.
|
|
44
|
-
"@maptalks/transcoders.draco": "^0.124.
|
|
42
|
+
"3d-tiles-renderer": "^0.4.22",
|
|
43
|
+
"@maptalks/gltf-loader": "^0.124.4",
|
|
44
|
+
"@maptalks/transcoders.draco": "^0.124.4",
|
|
45
45
|
"three": "^0.183.2"
|
|
46
46
|
}
|
|
47
47
|
}
|