iflow-engine-base 2.0.3 → 2.0.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.
package/dist/index.d.ts CHANGED
@@ -295,6 +295,8 @@ declare class EngineKernelV2 {
295
295
  grid: Grid;
296
296
  level: Level;
297
297
  text: Text_2;
298
+ hdr: Hdr;
299
+ ground: Ground;
298
300
  models: any[];
299
301
  reactBoundingClientRect: {
300
302
  left: number;
@@ -585,6 +587,58 @@ declare interface GridAxisPoint {
585
587
  Z: number;
586
588
  }
587
589
 
590
+ declare class Ground {
591
+ private engine;
592
+ private currentId;
593
+ private readonly groundGroup;
594
+ private groundMesh;
595
+ private waterMaterial;
596
+ private readonly clock;
597
+ private groundY;
598
+ private groundList;
599
+ constructor(engine: any);
600
+ init(): void;
601
+ /**
602
+ * 切换地面类型
603
+ * @param id 地面 id:"0" 无 | "1" 草地 | "2" 混凝土 | "3" 地砖 | "4" 湖面 | "5" 海面
604
+ */
605
+ setGround(id: GroundId, config?: GroundConfig): void;
606
+ /**
607
+ * 设置地面高度(默认 0)
608
+ * @param y 世界空间 Y 坐标
609
+ */
610
+ setHeight(y: number): void;
611
+ /** 获取当前地面高度 */
612
+ getHeight(): number;
613
+ private _createWaterMaterial;
614
+ /** 每帧调用,驱动水面动画 */
615
+ update(): void;
616
+ /** 获取地面列表(id + 名称) */
617
+ getGroundList(): Array<{
618
+ id: string;
619
+ name: string;
620
+ }>;
621
+ /** 获取当前地面 id */
622
+ getCurrentId(): GroundId;
623
+ show(): void;
624
+ hide(): void;
625
+ dispose(): void;
626
+ private _dispose;
627
+ }
628
+
629
+ declare interface GroundConfig {
630
+ /** 地面尺寸(默认 300) */
631
+ size?: number;
632
+ /** 贴图 URL(仅实体地面有效) */
633
+ textureUrl?: string;
634
+ /** 阳光方向(默认斜上方) */
635
+ sunDirection?: THREE.Vector3;
636
+ /** 水面透明度(默认 0.82) */
637
+ opacity?: number;
638
+ }
639
+
640
+ declare type GroundId = "0" | "1" | "2" | "3" | "4" | "5";
641
+
588
642
  /**
589
643
  * 行为处理器 - 管理引擎的交互行为(鼠标、键盘事件等)
590
644
  * @param engine 引擎实例
@@ -592,6 +646,75 @@ declare interface GridAxisPoint {
592
646
  */
593
647
  declare function HandelBehaved(engine: any): any;
594
648
 
649
+ declare class Hdr {
650
+ private engine;
651
+ private currentHdrId;
652
+ private isVisible;
653
+ private currentIntensity;
654
+ private currentTexture;
655
+ private skybox;
656
+ private readonly textureCache;
657
+ private readonly hdrList;
658
+ constructor(engine: any);
659
+ /**
660
+ * 获取 HDR 列表
661
+ */
662
+ getHdrList(): HdrItem[];
663
+ /**
664
+ * 切换 HDR 背景
665
+ * @param id - HDR id,"0" 表示清除 HDR
666
+ */
667
+ setHdr(id: string): Promise<void>;
668
+ /**
669
+ * 设置 HDR 天空球可见性(不影响环境光照)
670
+ * @param visible - true 显示,false 隐藏
671
+ */
672
+ setVisible(visible: boolean): void;
673
+ /**
674
+ * 获取当前 HDR id
675
+ */
676
+ getCurrentHdrId(): string;
677
+ /**
678
+ * 获取 HDR 背景是否可见
679
+ */
680
+ getVisible(): boolean;
681
+ /**
682
+ * 设置 HDR 整体亮度
683
+ * @param intensity - 亮度倍率,1 为原始亮度,推荐范围 0.1 ~ 3
684
+ */
685
+ setIntensity(intensity: number): void;
686
+ /**
687
+ * 获取当前 HDR 亮度
688
+ */
689
+ getIntensity(): number;
690
+ /**
691
+ * 动态添加自定义 HDR 条目(用于外部扩展)
692
+ */
693
+ addHdrItem(item: HdrItem): void;
694
+ /**
695
+ * 释放所有缓存纹理
696
+ */
697
+ dispose(): void;
698
+ private _loadHdr;
699
+ private _applyTexture;
700
+ /**
701
+ * 创建超大天空球,兼容正交/透视两种相机
702
+ * - radius 5000:远超任何场景对象,确保始终在背景层
703
+ * - BackSide:从内部观察球面
704
+ * - depthWrite false + renderOrder -1:不写入深度缓冲,始终渲染在最底层
705
+ * - frustumCulled false:防止大球被裁剪掉
706
+ */
707
+ private _createSkybox;
708
+ private _removeSkybox;
709
+ private _clearHdr;
710
+ }
711
+
712
+ declare interface HdrItem {
713
+ id: string;
714
+ name: string;
715
+ url?: string;
716
+ }
717
+
595
718
  declare class HoverHighLight {
596
719
  private engine;
597
720
  private overlayMaterial;
@@ -896,8 +1019,6 @@ declare class ModelToolModule {
896
1019
  private highlightMaterial;
897
1020
  private hideMaterial;
898
1021
  private translucentMaterial;
899
- private cloneModels;
900
- private clonetranslucentModels;
901
1022
  constructor(engine_: any);
902
1023
  split_merge_model(model: any): void;
903
1024
  un_split_merge_model(model: any): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iflow-engine-base",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "BIM Engine SDK for Vue2, Vue3, React and HTML",
5
5
  "main": "./dist/bim-engine-sdk.umd.js",
6
6
  "module": "./dist/bim-engine-sdk.es.js",