iflow-engine-base 2.0.4 → 2.0.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/README.md CHANGED
@@ -1,33 +1,33 @@
1
- # iflow-engine-base
2
-
3
- BIM Engine SDK for Vue2, Vue3, React and HTML
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install iflow-engine-base
9
- ```
10
-
11
- ## Usage
12
-
13
- ### Import the SDK
14
-
15
- ```javascript
16
- import { createEngine } from 'iflow-engine-base';
17
- // CSS文件会自动引入,无需手动导入
18
- ```
19
-
20
- ### Create Engine Instance
21
-
22
- ```javascript
23
- const engine = createEngine({
24
- container: document.getElementById('app'),
25
- // ... other options
26
- });
27
- ```
28
-
29
- ## Important Notes
30
-
31
- - CSS样式已自动包含,无需手动导入
32
- - 该SDK依赖 `three` 和 `vue`,确保项目中已安装这些依赖
33
-
1
+ # iflow-engine-base
2
+
3
+ BIM Engine SDK for Vue2, Vue3, React and HTML
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install iflow-engine-base
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Import the SDK
14
+
15
+ ```javascript
16
+ import { createEngine } from 'iflow-engine-base';
17
+ // CSS文件会自动引入,无需手动导入
18
+ ```
19
+
20
+ ### Create Engine Instance
21
+
22
+ ```javascript
23
+ const engine = createEngine({
24
+ container: document.getElementById('app'),
25
+ // ... other options
26
+ });
27
+ ```
28
+
29
+ ## Important Notes
30
+
31
+ - CSS样式已自动包含,无需手动导入
32
+ - 该SDK依赖 `three` 和 `vue`,确保项目中已安装这些依赖
33
+
@@ -3267,6 +3267,9 @@ class yc {
3267
3267
  composer;
3268
3268
  saturationPass;
3269
3269
  ssaoPass;
3270
+ gtaoPass;
3271
+ outputPass;
3272
+ fxaaPass;
3270
3273
  constructor(e) {
3271
3274
  this.engine = e;
3272
3275
  }
@@ -3292,20 +3295,14 @@ class yc {
3292
3295
  });
3293
3296
  this.composer = new cc(s, a), this.composer.setPixelRatio(r), this.composer.setSize(e, t);
3294
3297
  const l = new hc(n, i);
3295
- this.composer.addPass(l);
3296
- const h = new Fe(n, i, e, t);
3297
- h.output = Fe.OUTPUT.Default, h.blendIntensity = 0.3, h.enabled = !1, h.updateGtaoMaterial && h.updateGtaoMaterial({
3298
+ this.composer.addPass(l), this.gtaoPass = new Fe(n, i, e, t), this.gtaoPass.output = Fe.OUTPUT.Default, this.gtaoPass.blendIntensity = 0.3, this.gtaoPass.enabled = !1, this.gtaoPass.updateGtaoMaterial && this.gtaoPass.updateGtaoMaterial({
3298
3299
  radius: 1,
3299
3300
  distanceExponent: 1,
3300
3301
  thickness: 1,
3301
3302
  scale: 1,
3302
3303
  distanceFallOff: 1,
3303
3304
  screenSpaceRadius: !0
3304
- }), this.composer.addPass(h), this.ssaoPass = new xt(n, i, e, t), this.ssaoPass.kernelRadius = 8, this.ssaoPass.minDistance = 5e-3, this.ssaoPass.maxDistance = 0.1, this.ssaoPass.output = xt.OUTPUT.Default, this.ssaoPass.enabled = !1, this.composer.addPass(this.ssaoPass), this.saturationPass = new Pi(gc), this.saturationPass.uniforms.saturation.value = 1.3, this.saturationPass.uniforms.contrast.value = 1.1, this.saturationPass.enabled = !1, this.composer.addPass(this.saturationPass);
3305
- const c = new pc();
3306
- c.enabled = !1, this.composer.addPass(c);
3307
- const u = new Pi(mc);
3308
- u.material.uniforms.resolution.value.x = 1 / (e * r), u.material.uniforms.resolution.value.y = 1 / (t * r), u.enabled = !1, this.composer.addPass(u);
3305
+ }), this.composer.addPass(this.gtaoPass), this.ssaoPass = new xt(n, i, e, t), this.ssaoPass.kernelRadius = 8, this.ssaoPass.minDistance = 5e-3, this.ssaoPass.maxDistance = 0.1, this.ssaoPass.output = xt.OUTPUT.Default, this.ssaoPass.enabled = !1, this.composer.addPass(this.ssaoPass), this.saturationPass = new Pi(gc), this.saturationPass.uniforms.saturation.value = 1.3, this.saturationPass.uniforms.contrast.value = 1.1, this.saturationPass.enabled = !1, this.composer.addPass(this.saturationPass), this.outputPass = new pc(), this.outputPass.enabled = !1, this.composer.addPass(this.outputPass), this.fxaaPass = new Pi(mc), this.fxaaPass.material.uniforms.resolution.value.x = 1 / (e * r), this.fxaaPass.material.uniforms.resolution.value.y = 1 / (t * r), this.fxaaPass.enabled = !1, this.composer.addPass(this.fxaaPass);
3309
3306
  }
3310
3307
  }
3311
3308
  var ii = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
@@ -10571,11 +10568,7 @@ class Yu {
10571
10568
  * 缓存 Pass 引用
10572
10569
  */
10573
10570
  cachePassReferences() {
10574
- if (!this.engine.composerModule?.composer) return;
10575
- const e = this.engine.composerModule.composer.passes;
10576
- for (const t of e)
10577
- t.constructor.name === "_GTAOPass" ? this.gtaoPass = t : t.constructor.name === "ShaderPass" ? t.material.uniforms.saturation ? this.saturationPass = t : t.material.uniforms.resolution && (this.fxaaPass = t) : t.constructor.name === "OutputPass" && (this.outputPass = t);
10578
- this.engine.composerModule.saturationPass && (this.saturationPass = this.engine.composerModule.saturationPass), this.engine.composerModule.ssaoPass && (this.ssaoPass = this.engine.composerModule.ssaoPass);
10571
+ this.engine.composerModule?.composer && (this.engine.composerModule.gtaoPass && (this.gtaoPass = this.engine.composerModule.gtaoPass), this.engine.composerModule.ssaoPass && (this.ssaoPass = this.engine.composerModule.ssaoPass), this.engine.composerModule.saturationPass && (this.saturationPass = this.engine.composerModule.saturationPass), this.engine.composerModule.outputPass && (this.outputPass = this.engine.composerModule.outputPass), this.engine.composerModule.fxaaPass && (this.fxaaPass = this.engine.composerModule.fxaaPass));
10579
10572
  }
10580
10573
  // 应用模式(私有方法)
10581
10574
  applyMode(e) {
@@ -10610,7 +10603,7 @@ class Yu {
10610
10603
  * 设置环境光遮蔽 (GTAO) 开关
10611
10604
  */
10612
10605
  setGTAO(e) {
10613
- this.engine.composerModule?.composer && (e ? this.gtaoPass.enabled = !0 : this.gtaoPass && (this.gtaoPass.enabled = !1));
10606
+ this.engine.composerModule?.composer && this.gtaoPass && (this.gtaoPass.enabled = e);
10614
10607
  }
10615
10608
  /**
10616
10609
  * 设置环境光遮蔽 (SSAO) 开关
@@ -17310,9 +17303,9 @@ class _p {
17310
17303
  try {
17311
17304
  this.config = i, this.llmApi = new xp(i.llmConfig);
17312
17305
  try {
17313
- const s = await import("./main-Bcaj0lBB.mjs");
17306
+ const s = await import("./main-2Txx2Vau.mjs");
17314
17307
  this.prompts.main = s.default;
17315
- const r = await import("./step-Ci61eU9h.mjs");
17308
+ const r = await import("./step-CkmZYIvn.mjs");
17316
17309
  this.prompts.step = r.default;
17317
17310
  const a = await import("./API文档-B1v8UcRF.mjs");
17318
17311
  this.prompts.apiDoc = a.default;