iflow-engine-base 4.0.12 → 4.0.13

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
@@ -5659,15 +5659,19 @@ declare class Ground_2 {
5659
5659
  private groundMesh;
5660
5660
  /** 当前为官方 Water 水面时为 true,用于 update/dispose 分支 */
5661
5661
  private isWaterAddon;
5662
+ /** 未显式配置太阳方向时,使水面高光跟随场景主定向光。 */
5663
+ private syncWaterSunDirection;
5662
5664
  private groundY;
5663
- /** 默认水面法线贴图路径(项目内为 public/textture/waternormals.jpg) */
5665
+ private readonly lightWorldPosition;
5666
+ private readonly lightTargetWorldPosition;
5667
+ /** 官网案例使用的水面法线贴图。 */
5664
5668
  private static readonly DEFAULT_WATER_NORMALS;
5665
5669
  private groundList;
5666
5670
  constructor(engine: any);
5667
5671
  init(): void;
5668
5672
  /**
5669
5673
  * 切换地面类型
5670
- * @param id 地面 id:"0" 无 | "1" 草地 | "2" 混凝土 | "3" 地砖 | "4" 湖面 | "5" 海面
5674
+ * @param id 地面预设 ID,其中“13”为湖面,“14”为海面。
5671
5675
  */
5672
5676
  setGround(id: GroundId_2, config?: GroundConfig_2): void;
5673
5677
  /**
@@ -5677,7 +5681,7 @@ declare class Ground_2 {
5677
5681
  setHeight(y: number): void;
5678
5682
  /** 获取当前地面高度 */
5679
5683
  getHeight(): number;
5680
- /** 每帧调用,驱动水面动画并与场景阳光/相机同步 */
5684
+ /** 每帧同步场景主光;水面动画和相机位置由 TSL 节点自动更新。 */
5681
5685
  update(): void;
5682
5686
  /** 获取地面列表(id + 名称) */
5683
5687
  getGroundList(): Array<{
@@ -5690,13 +5694,11 @@ declare class Ground_2 {
5690
5694
  show(): void;
5691
5695
  hide(): void;
5692
5696
  dispose(): void;
5693
- /**
5694
- * 兼容项目内本地 three 渲染器。
5695
- * 本地渲染器会向 lights uniforms 写入 directional/spot/point 的 shadowMap,
5696
- * 但 npm Water 使用的 three 版本没有把这些 sampler 挂到 UniformsLib['lights'] 上。
5697
- */
5698
- private ensureWaterShadowUniforms;
5699
5697
  private _dispose;
5698
+ /** 计算从定向光目标指向光源的单位向量,作为水面的太阳方向。 */
5699
+ private getSceneSunDirection;
5700
+ /** 水面可见时关闭空闲限帧,保证 TSL 时间节点持续产生平滑波纹。 */
5701
+ private updateWaterFrameRateExemption;
5700
5702
  }
5701
5703
 
5702
5704
  declare interface GroundConfig {
@@ -5717,25 +5719,39 @@ declare interface GroundConfig {
5717
5719
  }
5718
5720
 
5719
5721
  declare interface GroundConfig_2 {
5720
- /** 地面尺寸(默认 300) */
5722
+ /** 地面尺寸;水面默认 10000,其他地面默认 30000 */
5721
5723
  size?: number;
5722
5724
  /** 贴图 URL(仅实体地面有效) */
5723
5725
  textureUrl?: string;
5724
5726
  /** 阳光方向(默认斜上方) */
5725
5727
  sunDirection?: THREE.Vector3;
5726
- /** 水面透明度(默认 0.82) */
5728
+ /** 水面透明度,范围 0 至 1(默认 0.92) */
5727
5729
  opacity?: number;
5728
5730
  /** 水面法线贴图 URL(默认使用 public 下的 waternormals.jpg) */
5729
5731
  waterNormalsUrl?: string;
5732
+ /** @deprecated 官网 WaterMesh 方案只使用一张法线贴图。 */
5733
+ waterNormalsUrl2?: string;
5734
+ /** 水体颜色,默认与官网案例一致为 0x001e0f */
5735
+ waterColor?: THREE.ColorRepresentation;
5736
+ /** 太阳光颜色,默认与官网案例一致为白色 */
5737
+ sunColor?: THREE.ColorRepresentation;
5730
5738
  /** 水面反射扭曲强度,覆盖预设 */
5731
5739
  distortionScale?: number;
5732
5740
  /** 水面波纹密度(size uniform),覆盖预设 */
5733
5741
  waterSize?: number;
5742
+ /** 反射通道的分辨率倍率,默认与官网 WaterMesh 一致为 0.5 */
5743
+ resolutionScale?: number;
5744
+ /** @deprecated 官网 WaterMesh 方案不使用定向水流。 */
5745
+ flowDirection?: THREE.Vector2;
5746
+ /** @deprecated 官网 WaterMesh 方案由内置 time 节点驱动波纹。 */
5747
+ flowSpeed?: number;
5748
+ /** @deprecated 官网 WaterMesh 使用固定的菲涅尔基础反射率。 */
5749
+ reflectivity?: number;
5734
5750
  }
5735
5751
 
5736
- declare type GroundId = "0" | "1" | "2" | "3" | "4" | "5";
5752
+ declare type GroundId = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14";
5737
5753
 
5738
- declare type GroundId_2 = "0" | "1" | "2" | "3" | "4" | "5";
5754
+ declare type GroundId_2 = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13" | "14";
5739
5755
 
5740
5756
  /** GTAO 参数。 */
5741
5757
  export declare interface GTAOPostProcessingSettings {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iflow-engine-base",
3
- "version": "4.0.12",
3
+ "version": "4.0.13",
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",