zyy-engine

图形引擎API


火焰特效

<h1>火焰特效</h1> <h2>火焰特效相关类简介</h2> <table> <thead> <tr> <th>类名</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td><code>BCore.Extension.Effect.FlameEffectConfig</code></td> <td>火焰特效配置参数</td> </tr> <tr> <td><code>BCore.Extension.Effect.FlameEffect</code></td> <td>火焰特效对象</td> </tr> <tr> <td><code>BCore.Extension.Effect.FlameEffectManagerConfig</code></td> <td>火焰特效管理工具配置</td> </tr> <tr> <td><code>BCore.Extension.Effect.FlameEffectManager</code></td> <td>火焰特效管理工具</td> </tr> </tbody> </table> <hr /> <h2>1. BCore.Extension.Effect.FlameEffectConfig</h2> <p><strong>构造方法</strong>: </p> <pre><code class="language-javascript">new BCore.Extension.Effect.FlameEffectConfig()</code></pre> <p><strong>成员变量说明</strong>:</p> <table> <thead> <tr> <th>成员变量</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td><code>name</code></td> <td>String</td> <td>特效名称,全局唯一</td> </tr> <tr> <td><code>FlameLightColor</code></td> <td>String</td> <td>火焰渐变颜色1</td> </tr> <tr> <td><code>FlameLightColor2</code></td> <td>String</td> <td>火焰渐变颜色2</td> </tr> <tr> <td><code>FlameDarkColor</code></td> <td>String</td> <td>火焰渐变颜色3</td> </tr> <tr> <td><code>FlameDarkColor2</code></td> <td>String</td> <td>火焰渐变颜色4</td> </tr> <tr> <td><code>FlameNormalColor</code></td> <td>String</td> <td>火焰渐变颜色5</td> </tr> <tr> <td><code>FlameGreyColor</code></td> <td>String</td> <td>火焰渐变颜色6</td> </tr> <tr> <td><code>FlareSpread</code></td> <td>Number</td> <td>火焰边缘颗粒范围</td> </tr> <tr> <td><code>FlareColor</code></td> <td>String</td> <td>火焰边缘颗粒颜色</td> </tr> <tr> <td><code>TimeScale</code></td> <td>Number</td> <td>燃烧速度</td> </tr> <tr> <td><code>scale</code></td> <td>Number</td> <td>火焰大小</td> </tr> <tr> <td><code>position</code></td> <td>Object</td> <td>特效中心坐标 <code>{ x: 0, y: 0, z: 0 }</code></td> </tr> <tr> <td><code>rotation</code></td> <td>Object</td> <td>特效旋转程度 <code>{ x: 0, y: 0, z: 0 }</code></td> </tr> </tbody> </table> <hr /> <h2>2. BCore.Extension.Effect.FlameEffect</h2> <p><strong>构造方法</strong>: </p> <pre><code class="language-javascript">new BCore.Extension.Effect.FlameEffect(config)</code></pre> <p><strong>参数说明</strong>:</p> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td><code>config</code></td> <td><code>BCore.Extension.Effect.FlameEffectConfig</code></td> <td>火焰特效配置参数</td> </tr> </tbody> </table> <p><strong>示例</strong>:</p> <pre><code class="language-javascript">let flameEffectConfig = new BCore.Extension.Effect.FlameEffectConfig(); flameEffectConfig.FlameLightColor2 = &amp;#039;#FFD6D7&amp;#039;; flameEffectConfig.FlameLightColor = &amp;#039;#7B2F31&amp;#039;; flameEffectConfig.FlameNormalColor = &amp;#039;#675656&amp;#039;; flameEffectConfig.FlameDarkColor2 = &amp;#039;#566758&amp;#039;; flameEffectConfig.FlameGreyColor = &amp;#039;#562269&amp;#039;; flameEffectConfig.FlameDarkColor = &amp;#039;#696922&amp;#039;; flameEffectConfig.FlareSpread = 2.0; flameEffectConfig.FlareColor &amp;#039;#000000&amp;#039;; flameEffectConfig.TimeScale = 10; flameEffectConfig.scale = 0.03; flameEffectConfig.position = { x: 10, y: 0, z: 0 }; flameEffectConfig.rotation = { x: 1.57, y: 0, z: 0 }; let flameEffect = new BCore.Extension.Effect.FlameEffect(flameEffectConfig);</code></pre> <hr /> <h2>3. BCore.Extension.Effect.FlameEffectManagerConfig</h2> <p><strong>构造方法</strong>: </p> <pre><code class="language-javascript">new BCore.Extension.Effect.FlameEffectManagerConfig(Viewer3D)</code></pre> <p><strong>参数说明</strong>:</p> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td><code>viewer3D</code></td> <td><code>BCore.Viewer.Viewer3D</code></td> <td>三维模型视图对象</td> </tr> </tbody> </table> <hr /> <h2>4. BCore.Extension.Effect.FlameEffectManager</h2> <p><strong>构造方法</strong>: </p> <pre><code class="language-javascript">new BCore.Extension.Effect.FlameEffectManager(config)</code></pre> <p><strong>参数说明</strong>:</p> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td><code>config</code></td> <td><code>BCore.Extension.Effect.FlameEffectManagerConfig</code></td> <td>火焰特效管理工具配置</td> </tr> </tbody> </table> <hr /> <h2>方法示例</h2> <h3>添加火焰特效</h3> <ul> <li><strong>接口</strong>: <pre><code class="language-javascript"> addFlameEffect(name, flameEffect);</code></pre></li> <li> <p><strong>参数</strong>: <code>name</code> : <code>String</code> - 特效名称</p> <p><code>flameEffect</code> : <code>BCore.Extension.Effect.FlameEffect</code> - 火焰特效对象</p> <p><strong>示例</strong>:</p> <pre><code class="language-javascript">let flameEffectManagerConfig = new BCore.Extension.Effect.FlameEffectManagerConfig(mViewer3D); let flameEffectManager = new BCore.Extension.Effect.FlameEffectManager(flameEffectManagerConfig); let flameEffectConfig = new BCore.Extension.Effect.FlameEffectConfig(); flameEffectConfig.scale = 0.01; flameEffectConfig.position = { x: 0, y: 0, z: 0 }; flameEffectConfig.rotation = { x: 1.57, y: 0, z: 0 }; let flameEffect = new BCore.Extension.Effect.FlameEffect(flameEffectConfig); flameEffectManager.addFlameEffect(&amp;quot;name&amp;quot;, flameEffect);</code></pre> </li> </ul> <h3>移除火焰特效</h3> <ul> <li><strong>接口</strong>: <pre><code class="language-javascript"> removeFlameEffect(name);</code></pre></li> <li> <p><strong>参数</strong>: <code>name</code> : <code>String</code> - 特效名称</p> <p><strong>示例</strong>:</p> <pre><code class="language-javascript">flameEffectManager.removeFlameEffect(&amp;quot;name&amp;quot;);</code></pre> </li> </ul> <hr /> <p>以上是火焰特效相关的说明及使用示例。可根据实际需求进行修改和使用~</p>

页面列表

ITEM_HTML