gltf-parser-plugin 1.1.4 → 1.1.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.
package/build/index.d.ts
CHANGED
|
@@ -35,7 +35,9 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
35
35
|
private _modelInfo;
|
|
36
36
|
private _modelInfoPromise;
|
|
37
37
|
private _interactionFilter;
|
|
38
|
-
private
|
|
38
|
+
private _partColorHelper;
|
|
39
|
+
private _partBlinkHelper;
|
|
40
|
+
private _partFrameHelper;
|
|
39
41
|
oids: number[];
|
|
40
42
|
private renderer;
|
|
41
43
|
private splitMeshCache;
|
|
@@ -144,45 +146,75 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
144
146
|
unisolate(): void;
|
|
145
147
|
getIsolatedOids(): number[];
|
|
146
148
|
/**
|
|
147
|
-
*
|
|
149
|
+
* 内部方法:根据 oid 获取 mesh 数组
|
|
150
|
+
*/
|
|
151
|
+
_getMeshesByOidInternal(oid: number): Mesh[];
|
|
152
|
+
/**
|
|
153
|
+
* 根据 oid 获取 MeshCollector
|
|
154
|
+
* MeshCollector 会监听瓦片变化,自动更新 meshes 并触发 mesh-change 事件
|
|
155
|
+
* 内部缓存:相同 oid 多次调用会返回同一个 collector 实例
|
|
156
|
+
*/
|
|
157
|
+
getMeshCollectorByOid(oid: number): MeshCollector;
|
|
158
|
+
/**
|
|
159
|
+
* Hide the corresponding part of the original mesh according to the OID array
|
|
160
|
+
*/
|
|
161
|
+
hideByOids(oids: number[]): void;
|
|
162
|
+
/**
|
|
163
|
+
* Restore the display of the corresponding mesh according to the OID array
|
|
164
|
+
*/
|
|
165
|
+
unhideByOids(oids: number[]): void;
|
|
166
|
+
/**
|
|
167
|
+
* 根据 oid 数组设置构件颜色
|
|
168
|
+
* 隐藏原 mesh,将 split mesh 替换材质后加入场景(使用 tiles.group)
|
|
148
169
|
* @param oids 构件 OID 数组
|
|
149
|
-
* @param color 颜色值,支持 hex
|
|
170
|
+
* @param color 颜色值,支持 hex 数字、颜色字符串(如 "#ff0000")、THREE.Color 对象
|
|
150
171
|
*/
|
|
151
|
-
|
|
172
|
+
setPartColorByOids(oids: number[], color: ColorInput): void;
|
|
152
173
|
/**
|
|
153
|
-
*
|
|
174
|
+
* 恢复指定构件的颜色
|
|
175
|
+
* 从场景移除 split mesh,unhide 原 mesh
|
|
176
|
+
* @param oids 构件 OID 数组
|
|
177
|
+
*/
|
|
178
|
+
restorePartColorByOids(oids: number[]): void;
|
|
179
|
+
/**
|
|
180
|
+
* 根据 oid 数组设置构件透明度
|
|
154
181
|
* @param oids 构件 OID 数组
|
|
155
182
|
* @param opacity 透明度,0-1,0 完全透明,1 完全不透明
|
|
156
183
|
*/
|
|
157
|
-
|
|
184
|
+
setPartOpacityByOids(oids: number[], opacity: number): void;
|
|
158
185
|
/**
|
|
159
|
-
*
|
|
186
|
+
* 恢复指定构件的透明度
|
|
160
187
|
* @param oids 构件 OID 数组
|
|
161
188
|
*/
|
|
162
|
-
|
|
189
|
+
restorePartOpacityByOids(oids: number[]): void;
|
|
163
190
|
/**
|
|
164
|
-
*
|
|
191
|
+
* 设置需要闪烁的构件
|
|
165
192
|
* @param oids 构件 OID 数组
|
|
166
193
|
*/
|
|
167
|
-
|
|
194
|
+
setBlinkPartsByOids(oids: number[]): void;
|
|
168
195
|
/**
|
|
169
|
-
*
|
|
196
|
+
* 设置闪烁颜色
|
|
197
|
+
* @param color 颜色值,支持 hex 数字、颜色字符串(如 "#ff0000")、THREE.Color 对象
|
|
170
198
|
*/
|
|
171
|
-
|
|
199
|
+
setBlinkColor(color: ColorInput): void;
|
|
172
200
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
* 内部缓存:相同 oid 多次调用会返回同一个 collector 实例
|
|
201
|
+
* 设置闪烁周期时间(毫秒)
|
|
202
|
+
* @param ms 一个完整闪烁周期(暗->亮->暗)的时长,默认 1000
|
|
176
203
|
*/
|
|
177
|
-
|
|
204
|
+
setBlinkIntervalTime(ms: number): void;
|
|
178
205
|
/**
|
|
179
|
-
*
|
|
206
|
+
* 清除所有闪烁构件
|
|
180
207
|
*/
|
|
181
|
-
|
|
208
|
+
clearAllBlinkParts(): void;
|
|
182
209
|
/**
|
|
183
|
-
*
|
|
210
|
+
* 设置需要线框显示的构件
|
|
211
|
+
* @param oids 构件 OID 数组
|
|
184
212
|
*/
|
|
185
|
-
|
|
213
|
+
setFramePartsByOids(oids: number[]): void;
|
|
214
|
+
/**
|
|
215
|
+
* 清除所有线框显示构件
|
|
216
|
+
*/
|
|
217
|
+
clearAllFrameParts(): void;
|
|
186
218
|
/**
|
|
187
219
|
* Restore the original materials of the mesh
|
|
188
220
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gltf-parser-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "A plugin for parsing GLTF files",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/gltf-parser-plugin.module.js",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"author": "maptalks",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/node": "^25.
|
|
31
|
+
"@types/node": "^25.5.0",
|
|
32
32
|
"@types/three": "^0.183.1",
|
|
33
33
|
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
34
34
|
"@typescript-eslint/parser": "^8.57.0",
|
|
35
35
|
"eslint": "^10.0.3",
|
|
36
36
|
"typescript": "^5.9.3",
|
|
37
|
-
"vite": "^
|
|
37
|
+
"vite": "^8.0.0",
|
|
38
38
|
"vite-plugin-dts": "^4.5.4",
|
|
39
|
-
"vitest": "^4.0
|
|
39
|
+
"vitest": "^4.1.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"3d-tiles-renderer": "^0.4.22",
|