iflow-engine-base 3.10.1 → 3.10.5

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/dist/index.d.ts CHANGED
@@ -122,11 +122,200 @@ declare class AngleMeasure2d extends BaseMeasureTool2d {
122
122
  handleMove(point: THREE.Vector3): void;
123
123
  }
124
124
 
125
+ /** 统一管理点线面体标记、特效和原生 HTML 窗体。 */
126
+ declare class Annotation3d {
127
+ private readonly engine;
128
+ private readonly rootGroup;
129
+ private readonly records;
130
+ private readonly textureLoader;
131
+ private readonly occlusionRaycaster;
132
+ private readonly normalizer;
133
+ private readonly materialFactory;
134
+ private readonly geometryBuilder;
135
+ private readonly effectsController;
136
+ private readonly panelLayer;
137
+ private readonly interaction;
138
+ private currentTime;
139
+ /** 初始化标记根节点、DOM 面板层以及交互控制器。 */
140
+ constructor(engine: any);
141
+ /** 新增单个标记并返回最终 id。 */
142
+ add(config: Annotation3dData): string;
143
+ /** 批量新增标记。 */
144
+ addMany(configs: Annotation3dData[]): string[];
145
+ /** 更新标记时直接重建几何和窗体,保持内部状态简单且可预测。 */
146
+ update(id: string, patch: Partial<Annotation3dData>): boolean;
147
+ /** 删除单个标记。 */
148
+ remove(id: string): boolean;
149
+ /** 清空所有标记及其 DOM 面板。 */
150
+ clear(): void;
151
+ /** 获取单个运行时实例。 */
152
+ get(id: string): Annotation3dInstance | undefined;
153
+ /** 获取全部运行时实例。 */
154
+ getAll(): Annotation3dInstance[];
155
+ /** 显示指定标记。 */
156
+ show(id: string): boolean;
157
+ /** 隐藏指定标记。 */
158
+ hide(id: string): boolean;
159
+ /** 统一控制标记显隐,并同步其面板状态。 */
160
+ setVisible(id: string, visible: boolean): boolean;
161
+ /** 手动打开面板,适用于 manual / click 等模式。 */
162
+ showPanel(id: string): boolean;
163
+ /** 手动关闭面板。 */
164
+ hidePanel(id: string): boolean;
165
+ /** 切换面板开关状态。 */
166
+ togglePanel(id: string): boolean;
167
+ /** 更新面板文本、HTML、样式或 actions。 */
168
+ updatePanel(id: string, patch: Partial<Annotation3dPanel>): boolean;
169
+ /** 导出纯数据快照,供保存和恢复。 */
170
+ getData(): Annotation3dData[];
171
+ /** 从纯数据快照恢复整套标记。 */
172
+ restoreData(data: Annotation3dData[]): void;
173
+ /** 每帧刷新特效和窗体投影位置。 */
174
+ updateFrame(deltaTime?: number): void;
175
+ /** 释放事件、几何和 DOM 资源。 */
176
+ dispose(): void;
177
+ /** 组装运行时记录,并将几何与面板初始化好。 */
178
+ private buildRecord;
179
+ /** 新记录统一走同一挂载流程,减少 add / update 重复代码。 */
180
+ private attachRecord;
181
+ /** 内部删除会负责资源回收和 hover 状态清理。 */
182
+ private removeInternal;
183
+ /** 标记显隐变化时,同时同步渲染顺序和面板显示。 */
184
+ private applyVisibility;
185
+ /** 统一生成对外事件 payload。 */
186
+ private toEventPayload;
187
+ /** 统一向引擎事件总线派发标记事件。 */
188
+ private emit;
189
+ }
190
+
191
+ /** 创建或恢复标记使用的纯数据结构。 */
192
+ export declare interface Annotation3dData {
193
+ id?: string;
194
+ type: Annotation3dType;
195
+ points: AnnotationPoint3d[];
196
+ visible?: boolean;
197
+ selectable?: boolean;
198
+ style?: Annotation3dStyle;
199
+ effect?: Annotation3dEffect;
200
+ panel?: Annotation3dPanel;
201
+ data?: any;
202
+ }
203
+
204
+ /** 点线面体统一的特效配置。 */
205
+ export declare interface Annotation3dEffect {
206
+ gradient?: AnnotationGradientEffect;
207
+ glow?: AnnotationGlowEffect;
208
+ flow?: AnnotationFlowEffect;
209
+ pulse?: AnnotationPulseEffect;
210
+ ripple?: AnnotationRippleEffect;
211
+ pillar?: AnnotationPillarEffect;
212
+ baseRing?: AnnotationBaseRingEffect;
213
+ layers?: AnnotationLayersEffect;
214
+ scan?: AnnotationScanEffect;
215
+ }
216
+
217
+ /** 引擎运行时实例,包含根节点和交互状态。 */
218
+ export declare interface Annotation3dInstance {
219
+ id: string;
220
+ type: Annotation3dType;
221
+ points: AnnotationPoint3d[];
222
+ visible: boolean;
223
+ selectable: boolean;
224
+ style: Annotation3dStyle;
225
+ effect: Annotation3dEffect;
226
+ panel?: Omit<Annotation3dPanel, 'actions'>;
227
+ data?: any;
228
+ panelVisible: boolean;
229
+ hovered: boolean;
230
+ root: THREE.Group;
231
+ }
232
+
233
+ /** 标记关联的原生 HTML 窗体配置。 */
234
+ export declare interface Annotation3dPanel {
235
+ visible?: boolean;
236
+ trigger?: 'manual' | 'hover' | 'click' | 'always';
237
+ mode?: 'text' | 'html';
238
+ text?: string;
239
+ html?: string;
240
+ anchor?: 'self' | 'top' | 'center' | 'start' | 'end' | 'centroid';
241
+ offset?: AnnotationPanelOffset3d;
242
+ screenOffset?: AnnotationPanelOffset2d;
243
+ className?: string;
244
+ style?: Record<string, string>;
245
+ interactive?: boolean;
246
+ occlusion?: 'show' | 'hide';
247
+ actions?: Record<string, (ctx: AnnotationActionContext) => void>;
248
+ }
249
+
250
+ /** 点线面体统一样式。 */
251
+ export declare interface Annotation3dStyle {
252
+ color?: string;
253
+ opacity?: number;
254
+ depthTest?: boolean;
255
+ alwaysOnTop?: boolean;
256
+ lineWidth?: number;
257
+ fillColor?: string;
258
+ fillOpacity?: number;
259
+ point?: AnnotationPointStyle;
260
+ line?: AnnotationLineStyle;
261
+ polygon?: AnnotationPolygonStyle;
262
+ volume?: AnnotationVolumeStyle;
263
+ }
264
+
265
+ /** 支持的三维标记类型。 */
266
+ export declare type Annotation3dType = 'point' | 'polyline' | 'polygon' | 'extrudePolygon' | 'box';
267
+
268
+ /** 面板 action 回调上下文。 */
269
+ export declare interface AnnotationActionContext {
270
+ engine: any;
271
+ id: string;
272
+ annotation: Annotation3dInstance;
273
+ action: string;
274
+ element: HTMLElement;
275
+ originalEvent: MouseEvent;
276
+ }
277
+
278
+ /** 底环效果配置。 */
279
+ declare interface AnnotationBaseRingEffect {
280
+ enabled: boolean;
281
+ radius?: number;
282
+ rotateSpeed?: number;
283
+ }
284
+
125
285
  /**
126
286
  * 标注联合类型
127
287
  */
128
288
  declare type AnnotationConfig720 = IconAnnotationConfig | TextAnnotationConfig | LinkAnnotationConfig;
129
289
 
290
+ /** 流动效果配置。 */
291
+ declare interface AnnotationFlowEffect {
292
+ enabled: boolean;
293
+ speed?: number;
294
+ width?: number;
295
+ direction?: 'forward' | 'backward' | 'up';
296
+ }
297
+
298
+ /** 发光效果配置。 */
299
+ declare interface AnnotationGlowEffect {
300
+ enabled: boolean;
301
+ color?: string;
302
+ intensity?: number;
303
+ }
304
+
305
+ /** 渐变色效果配置。 */
306
+ declare interface AnnotationGradientEffect {
307
+ enabled: boolean;
308
+ direction?: 'vertical' | 'horizontal' | 'path';
309
+ stops?: AnnotationGradientStop[];
310
+ }
311
+
312
+ /** 渐变色 stop。 */
313
+ declare interface AnnotationGradientStop {
314
+ offset: number;
315
+ color: string;
316
+ alpha?: number;
317
+ }
318
+
130
319
  /**
131
320
  * 标注实例(包含 DOM 元素)
132
321
  */
@@ -146,6 +335,19 @@ declare interface AnnotationInstance {
146
335
  visible: boolean;
147
336
  }
148
337
 
338
+ /** 多层围栏线效果配置。 */
339
+ declare interface AnnotationLayersEffect {
340
+ enabled: boolean;
341
+ count?: number;
342
+ offsetY?: number;
343
+ }
344
+
345
+ /** 线样式。 */
346
+ declare interface AnnotationLineStyle {
347
+ dashed?: boolean;
348
+ closed?: boolean;
349
+ }
350
+
149
351
  /**
150
352
  * 标注管理器 - 管理全景图中的标注点
151
353
  * 支持图标、文字、超链接三种类型的标注
@@ -265,6 +467,50 @@ declare class AnnotationManager720 {
265
467
  private generateId;
266
468
  }
267
469
 
470
+ /** 面板屏幕偏移。 */
471
+ declare interface AnnotationPanelOffset2d {
472
+ x?: number;
473
+ y?: number;
474
+ }
475
+
476
+ /** 面板三维偏移。 */
477
+ declare interface AnnotationPanelOffset3d {
478
+ x?: number;
479
+ y?: number;
480
+ z?: number;
481
+ }
482
+
483
+ /** 光柱效果配置。 */
484
+ declare interface AnnotationPillarEffect {
485
+ enabled: boolean;
486
+ height?: number;
487
+ width?: number;
488
+ }
489
+
490
+ /** 三维空间点。 */
491
+ declare interface AnnotationPoint3d {
492
+ x: number;
493
+ y: number;
494
+ z: number;
495
+ }
496
+
497
+ /** 点位样式。 */
498
+ declare interface AnnotationPointStyle {
499
+ mode?: 'sprite' | 'hybrid';
500
+ icon?: string;
501
+ size?: number;
502
+ iconSize?: number;
503
+ billboard?: boolean;
504
+ anchorY?: number;
505
+ }
506
+
507
+ /** 面样式。 */
508
+ declare interface AnnotationPolygonStyle {
509
+ showEdge?: boolean;
510
+ edgeColor?: string;
511
+ edgeWidth?: number;
512
+ }
513
+
268
514
  /**
269
515
  * 标注位置信息(球面坐标)
270
516
  */
@@ -274,6 +520,29 @@ declare interface AnnotationPosition {
274
520
  radius?: number;
275
521
  }
276
522
 
523
+ /** 呼吸闪烁效果配置。 */
524
+ declare interface AnnotationPulseEffect {
525
+ enabled: boolean;
526
+ speed?: number;
527
+ minOpacity?: number;
528
+ maxOpacity?: number;
529
+ }
530
+
531
+ /** 波纹扩散效果配置。 */
532
+ declare interface AnnotationRippleEffect {
533
+ enabled: boolean;
534
+ count?: number;
535
+ speed?: number;
536
+ maxRadius?: number;
537
+ }
538
+
539
+ /** 扫描效果配置。 */
540
+ declare interface AnnotationScanEffect {
541
+ enabled: boolean;
542
+ speed?: number;
543
+ width?: number;
544
+ }
545
+
277
546
  /**
278
547
  * 标注类型枚举
279
548
  */
@@ -283,6 +552,15 @@ declare enum AnnotationType720 {
283
552
  LINK = "link"
284
553
  }
285
554
 
555
+ /** 体样式。 */
556
+ declare interface AnnotationVolumeStyle {
557
+ height?: number;
558
+ showTop?: boolean;
559
+ showSide?: boolean;
560
+ showBottom?: boolean;
561
+ edgeColor?: string;
562
+ }
563
+
286
564
  declare class AreaMeasure2d extends BaseMeasureTool2d {
287
565
  /** 三点及以上可以闭合面积,双击或 Enter 结束。 */
288
566
  handleClick(point: THREE.Vector3): void;
@@ -692,12 +970,25 @@ declare class Clipping {
692
970
  filterIntersectionsByClipping<T extends {
693
971
  point?: any;
694
972
  }>(intersections: T[] | null | undefined, tolerance?: number): T[];
973
+ /**
974
+ * 判断包围盒是否仍与当前可见剖切区域相交。
975
+ * 只要包围盒被任一剖切平面完全裁掉,就可以在八叉树阶段提前跳过。
976
+ */
977
+ doesBoxIntersectClippingRange(box: THREE.Box3 | {
978
+ min: any;
979
+ max: any;
980
+ } | null | undefined, tolerance?: number): boolean;
695
981
  getClippedBoundingBox(baseBox?: THREE.Box3): THREE.Box3 | null;
696
982
  private getEffectiveClippingPlanes;
697
983
  private toBox3;
698
984
  private getBoxBoundaryPlanes;
699
985
  private intersectThreePlanes;
700
986
  private isPointInsidePlanes;
987
+ /**
988
+ * 取包围盒在平面法线方向上的最远顶点;
989
+ * 如果这个点仍落在平面外侧,说明整个包围盒都已经被该平面剔除。
990
+ */
991
+ private isBoxVisibleAgainstPlane;
701
992
  private pushUniquePoint;
702
993
  private isVector3Like;
703
994
  /**
@@ -911,6 +1202,7 @@ declare class ControlModule {
911
1202
  init(): void;
912
1203
  active(): void;
913
1204
  disActive(): void;
1205
+ private setEngineControls;
914
1206
  setMoveSpeed(value: number): void;
915
1207
  getMoveSpeed(): number;
916
1208
  setApplyCollision(value: boolean): void;
@@ -2092,7 +2384,11 @@ declare class EngineKernelV2 {
2092
2384
  private animationId;
2093
2385
  private isDisposed;
2094
2386
  private isRenderingPaused;
2387
+ private suppressComposerRenderWhenFree;
2388
+ private pendingComposerRender;
2095
2389
  private controlsEnabledBeforePause;
2390
+ private boundControl;
2391
+ private controlEventHandlers;
2096
2392
  private animate;
2097
2393
  private onWindowResize;
2098
2394
  private _fpsFrameCount;
@@ -2160,6 +2456,7 @@ declare class EngineKernelV2 {
2160
2456
  drawingPin: DrawingPin;
2161
2457
  modelLink3d: ModelLink3d;
2162
2458
  label: Label;
2459
+ annotation3d: Annotation3d;
2163
2460
  calibration: Calibration;
2164
2461
  models: any[];
2165
2462
  reactBoundingClientRect: {
@@ -2170,7 +2467,10 @@ declare class EngineKernelV2 {
2170
2467
  private versionEl;
2171
2468
  private container;
2172
2469
  constructor(options: any);
2470
+ changeHandelBehavedMode(): void;
2173
2471
  updateVersionDisplay(): void;
2472
+ bindControlEvents(control: any): void;
2473
+ requestComposerRender(): void;
2174
2474
  /**
2175
2475
  * 通过 viewToken 解析 3D 模型地址,再复用现有 loaderModule URL 加载逻辑。
2176
2476
  */
@@ -2364,6 +2664,7 @@ declare interface EngineSettings {
2364
2664
  declare class EngineStatus {
2365
2665
  private engine;
2366
2666
  isFree: boolean;
2667
+ editModel: boolean;
2367
2668
  isForceFree: boolean;
2368
2669
  isDisableContextMenu: boolean;
2369
2670
  disableModelInteractionHighlight: boolean;
@@ -3570,7 +3871,7 @@ declare class InteractionModule {
3570
3871
  handelKeyEscDown(): void;
3571
3872
  handleMouseMove(event: any): void;
3572
3873
  handleMouseUp(event: any): void;
3573
- getCatchMeshs(event: any, retainShow?: boolean): any;
3874
+ getCatchMeshs(event: any, retainShow?: boolean): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[] | null;
3574
3875
  handleMouseClick(event: any): void;
3575
3876
  handleMouseDoubleClick(event: any): void;
3576
3877
  private clearModelHighlightBeforeCameraFlight;
@@ -3597,6 +3898,8 @@ declare class InteractionModule {
3597
3898
  private keepHighlightedModels;
3598
3899
  private removeModelsFromHighlightState;
3599
3900
  private getNodeWorldBox;
3901
+ private getNodeCatchMeshes;
3902
+ private createInstanceCatchMesh;
3600
3903
  private getInstanceWorldBox;
3601
3904
  private projectBoxToScreenRect;
3602
3905
  private containsRect;
@@ -3784,19 +4087,14 @@ declare interface IssueSnapshotWithUrl extends IssueSnapshot {
3784
4087
  url: string;
3785
4088
  }
3786
4089
 
3787
- /**
3788
- * 3D 标签管理器,负责模型空间坐标拾取、DOM 标签投影和点击事件转发。
3789
- */
3790
4090
  declare class Label {
3791
4091
  private readonly engine;
3792
4092
  private readonly manager;
3793
4093
  private readonly worldToScreen;
3794
4094
  private readonly raycaster;
3795
4095
  constructor(engine: any);
3796
- /** 开启一次 3D 模型点选,返回命中的世界坐标。 */
3797
4096
  pickPoint(): Promise<LabelCoordinate | null>;
3798
4097
  startPickPoint(callback?: (coordinate: LabelCoordinate | null) => void): Promise<LabelCoordinate | null>;
3799
- /** 创建 3D 标签,坐标使用模型世界坐标 x/y/z。 */
3800
4098
  createLabel(options: LabelCreateOptions): string;
3801
4099
  updateLabel(id: string, options: LabelUpdateOptions): boolean;
3802
4100
  deleteLabel(id: string): boolean;
@@ -3806,7 +4104,6 @@ declare class Label {
3806
4104
  getLabels(): LabelInstance[];
3807
4105
  onLabelClick(callback: LabelClickCallback): () => void;
3808
4106
  offLabelClick(callback: LabelClickCallback): void;
3809
- /** 每帧同步标签位置,避免相机旋转后标签滞留。 */
3810
4107
  update(): void;
3811
4108
  dispose(): void;
3812
4109
  private projectCoordinate;
@@ -4096,6 +4393,10 @@ declare interface LevelLocationResult {
4096
4393
  isInside: boolean;
4097
4394
  }
4098
4395
 
4396
+ /**
4397
+ * 管理场景基础光照和动态阴影相机范围。
4398
+ * 主要职责是创建环境光、补光、投影灯,并随视图和模型范围更新阴影覆盖区域。
4399
+ */
4099
4400
  declare class LightModule {
4100
4401
  private engine;
4101
4402
  private lastShadowHalfSize;
@@ -4103,24 +4404,133 @@ declare class LightModule {
4103
4404
  private lastShadowFar;
4104
4405
  private lastLightPosition;
4105
4406
  private lastLightTarget;
4407
+ private lastShadowIntensity;
4408
+ private shadowCasterPolicyChecked;
4409
+ private lastShadowCasterPolicySceneSize;
4410
+ /**
4411
+ * 创建光照模块。
4412
+ * @param engine BIM 引擎实例,内部会从中读取 scene、controls、octreeBox 等对象。
4413
+ */
4106
4414
  constructor(engine: any);
4107
- /** 初始化场景基础光照,并保留投影灯的稳定引用。 */
4415
+ /**
4416
+ * 初始化场景基础光照,并把投影灯引用挂到 scene 上供后续更新使用。
4417
+ */
4108
4418
  init(): void;
4109
- /** 兼容旧调用名:更新定向光阴影的有效覆盖范围。 */
4419
+ /**
4420
+ * 兼容旧调用名:更新定向光阴影的有效覆盖范围。
4421
+ * @param camera 当前渲染相机;传 null 时只按场景范围或默认值更新。
4422
+ */
4110
4423
  updateShadowCameraRange(camera: THREE.Camera | null): void;
4111
- /** 根据当前视图和模型范围移动投影灯、target 与阴影相机。 */
4424
+ /**
4425
+ * 根据当前视图和模型范围移动投影灯、target 与阴影相机。
4426
+ * @param camera 当前渲染相机,用于估算屏幕可视范围;传 null 时退回到场景范围。
4427
+ */
4112
4428
  updateDirectionalShadow(camera: THREE.Camera | null): void;
4429
+ /**
4430
+ * 计算场景范围对阴影相机半边长的贡献。
4431
+ * @param sceneHalfExtent 场景包围盒最大边的一半,单位为世界坐标。
4432
+ * @param cameraHalfExtent 当前相机可视范围最大半边长,单位为世界坐标。
4433
+ * @returns 阴影相机应考虑的场景半边长。
4434
+ */
4113
4435
  private getSceneShadowHalfSize;
4436
+ /**
4437
+ * 根据阴影相机范围动态调整 bias,平衡阴影条纹和阴影悬浮。
4438
+ * @param light 负责投影的定向光。
4439
+ * @param shadowHalfSize 阴影正交相机半边长,单位为世界坐标。
4440
+ * @param shadowDepthRange 阴影相机深度范围。
4441
+ */
4114
4442
  private updateShadowBias;
4443
+ /**
4444
+ * 计算阴影相机沿光照方向的 near/far 范围。
4445
+ * @param sceneBox 当前场景包围盒;为 null 时使用兜底范围。
4446
+ * @param lightPosition 投影灯世界坐标。
4447
+ * @param target 投影灯 target 世界坐标。
4448
+ * @param sceneDepth 场景包围盒对角线长度,用于兜底 far 估算。
4449
+ * @param shadowHalfSize 阴影相机半边长,用于兜底 far 估算。
4450
+ * @returns 阴影相机深度范围。
4451
+ */
4115
4452
  private getShadowDepthRange;
4453
+ /**
4454
+ * 获取包围盒 8 个顶点。
4455
+ * @param box 需要拆分顶点的 three.js 包围盒。
4456
+ * @returns 包围盒所有角点的世界坐标数组。
4457
+ */
4116
4458
  private getBoxCorners;
4459
+ /**
4460
+ * 从场景中找到当前负责投影的定向光。
4461
+ * @returns 可投影的 DirectionalLight;找不到时返回 null。
4462
+ */
4117
4463
  private getShadowDirectionalLight;
4464
+ /**
4465
+ * 获取当前场景的有效包围盒。
4466
+ * @returns 有效模型包围盒;场景为空或范围异常时返回 null。
4467
+ */
4118
4468
  private getSceneBoundingBox;
4469
+ /**
4470
+ * 规范化包围盒最小点和最大点,兼容 min/max 顺序被反转的输入。
4471
+ * @param min 原始最小点。
4472
+ * @param max 原始最大点。
4473
+ * @returns 规范化后的包围盒;坐标非法或范围异常时返回 null。
4474
+ */
4119
4475
  private normalizeBox;
4476
+ /**
4477
+ * 校验包围盒是否可用于阴影计算。
4478
+ * @param box 候选包围盒。
4479
+ * @returns 有效包围盒;过小、过大或异常时返回 null。
4480
+ */
4120
4481
  private validateBox;
4482
+ /**
4483
+ * 估算当前相机视图在目标点附近需要覆盖的半边长。
4484
+ * @param camera 当前渲染相机。
4485
+ * @param fallbackTarget 没有 controls.target 时用于估算距离的目标点。
4486
+ * @returns 相机视图最大半边长;没有有效相机时返回 0。
4487
+ */
4121
4488
  private getCameraHalfExtent;
4489
+ /**
4490
+ * 解析阴影应跟随的目标点。
4491
+ * @param camera 当前渲染相机。
4492
+ * @param fallbackTarget 优先级低于 controls.target 的兜底目标点。
4493
+ * @returns 用于定位投影灯 target 的世界坐标。
4494
+ */
4122
4495
  private resolveShadowTarget;
4496
+ /**
4497
+ * 获取投影灯相对 target 的方向。
4498
+ * @returns 标准化后的世界空间光源偏移方向。
4499
+ */
4123
4500
  private getLightOffsetDirection;
4501
+ /**
4502
+ * 根据当前视角和阴影贴图密度计算最终显示强度。
4503
+ * @param camera 当前渲染相机。
4504
+ * @param lightDirection 投影灯相对 target 的方向。
4505
+ * @param shadowHalfSize 阴影正交相机半边长。
4506
+ * @param mapWidth 阴影贴图宽度。
4507
+ * @returns 本帧应使用的阴影强度。
4508
+ */
4509
+ private getShadowDisplayIntensity;
4510
+ /**
4511
+ * 把阴影 target 对齐到阴影贴图 texel 网格。
4512
+ * @param target 原始阴影目标点。
4513
+ * @param lightDirection 投影灯相对 target 的方向。
4514
+ * @param shadowHalfSize 阴影正交相机半边长。
4515
+ * @param mapWidth 阴影贴图宽度。
4516
+ * @returns 对齐后的 target,减少相机远距离移动时的阴影采样抖动和规则纹理。
4517
+ */
4518
+ private snapShadowTargetToTexel;
4519
+ /**
4520
+ * 自动降低大面积薄片构件的投影风险。
4521
+ * @param sceneBox 当前场景包围盒,用于判断场景尺寸是否变化。
4522
+ */
4523
+ private updateShadowCasterPolicy;
4524
+ /**
4525
+ * 对单个 mesh 应用投影策略。
4526
+ * @param mesh 候选投影对象。
4527
+ */
4528
+ private applyShadowCasterPolicy;
4529
+ /**
4530
+ * 对仍参与投影的实体使用背面写入阴影,降低封闭体表面的自投影条纹。
4531
+ * @param material mesh 材质或材质数组。
4532
+ */
4533
+ private setBackSideShadowCasting;
4124
4534
  }
4125
4535
 
4126
4536
  /**
@@ -4192,9 +4602,59 @@ declare interface LoaderModel2d {
4192
4602
  }
4193
4603
 
4194
4604
  declare class LoaderModule {
4605
+ private static localRequestMap;
4606
+ private static localObjectUrls;
4607
+ private static interceptorInstalled;
4195
4608
  private engine;
4196
4609
  constructor(engine: any);
4610
+ /**
4611
+ * 批量加载模型 URL。
4612
+ */
4197
4613
  loadModels(urls: string[], options?: LoadModelOptions): Promise<void>;
4614
+ /**
4615
+ * 直接加载用户在浏览器中选择的本地模型文件。
4616
+ * 支持两种输入:
4617
+ * 1. 直接选择 `info / property / edge / lod0...` 这组模型包文件。
4618
+ * 2. 选择一个外层 zip,zip 内部包含上述模型包文件或解压后的同名目录。
4619
+ */
4620
+ loadModelFile(files: File[], options?: LoadModelOptions): Promise<void>;
4621
+ /**
4622
+ * 把浏览器 File 列表整理成现有加载器可识别的本地虚拟模型入口。
4623
+ */
4624
+ private buildLocalModelEntries;
4625
+ /**
4626
+ * 展开输入文件。
4627
+ * 已经是模型包文件时直接保留;仅把“外层容器 zip”解包成内部条目。
4628
+ */
4629
+ private collectSourceEntries;
4630
+ /**
4631
+ * 识别已经打好的模型包文件,例如 `info`、`lod0.zip`。
4632
+ */
4633
+ private parseDirectPackageEntry;
4634
+ /**
4635
+ * 识别解压后的模型目录,例如 `lod0/nodes.json`、`info/info.json`。
4636
+ */
4637
+ private parseExtractedPackageEntry;
4638
+ /**
4639
+ * 把解压目录重新打包成 zip Blob,复用现有按包加载的实现。
4640
+ */
4641
+ private packEntriesAsZip;
4642
+ /**
4643
+ * 注册 axios 拦截器,把虚拟模型地址改写为对应的 Blob URL。
4644
+ */
4645
+ private static ensureLocalRequestInterceptor;
4646
+ /**
4647
+ * 为某个虚拟请求地址生成 Blob URL 映射。
4648
+ */
4649
+ private static registerLocalRequest;
4650
+ /**
4651
+ * 统一规范虚拟请求 key,兼容传入绝对地址或带 query 的地址。
4652
+ */
4653
+ private static normalizeRequestKey;
4654
+ /**
4655
+ * 生成稳定且不会冲突的本地模型虚拟 ID。
4656
+ */
4657
+ private static createLocalModelId;
4198
4658
  }
4199
4659
 
4200
4660
  declare class LoaderModule2d {