zyy-engine

图形引擎API


光罩特效

<h1>光罩特效</h1> <h2>1. 类说明</h2> <table> <thead> <tr> <th>类名</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td><code>BCore.Extension.Effect.LightMaskEffectConfig</code></td> <td>光环扩散特效配置参数</td> </tr> <tr> <td><code>BCore.Extension.Effect.LightMaskEffect</code></td> <td>光环扩散特效对象</td> </tr> <tr> <td><code>BCore.Extension.Effect.LightMaskEffectManagerConfig</code></td> <td>光环扩散特效管理工具配置</td> </tr> <tr> <td><code>BCore.Extension.Effect.LightMaskEffectManager</code></td> <td>光环扩散特效管理工具</td> </tr> </tbody> </table> <hr /> <h3>2. 光罩特效配置参数</h3> <p><strong>构造函数:</strong></p> <pre><code class="language-javascript">new BCore.Extension.Effect.LightMaskEffectConfig()</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>color</code></td> <td>String</td> <td>颜色</td> </tr> <tr> <td><code>wSeg</code></td> <td>number</td> <td>宽度分段数</td> </tr> <tr> <td><code>hSeg</code></td> <td>number</td> <td>高度分段数</td> </tr> <tr> <td><code>radius</code></td> <td>number</td> <td>特效范围半径</td> </tr> <tr> <td><code>opacity</code></td> <td>number</td> <td>透明度</td> </tr> <tr> <td><code>phiLength</code></td> <td>number</td> <td>左右半圆参数</td> </tr> <tr> <td><code>thetaLength</code></td> <td>number</td> <td>上下半圆参数</td> </tr> <tr> <td><code>position</code></td> <td>{ x: 0, y: 0, z: 0 }</td> <td>特效中心坐标</td> </tr> <tr> <td><code>rotation</code></td> <td>{ x: 0, y: 0, z: 0 }</td> <td>特效旋转程度</td> </tr> </tbody> </table> <hr /> <h3>3. 光罩特效对象</h3> <p><strong>构造函数:</strong></p> <pre><code class="language-javascript">new BCore.Extension.Effect.LightMaskEffect(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.LightMaskEffectConfig</code></td> <td>光罩特效配置参数</td> </tr> </tbody> </table> <p><strong>示例代码:</strong></p> <pre><code class="language-javascript">let lightMaskEffectConfig = new BCore.Extension.Effect.LightMaskEffectConfig(); lightMaskEffectConfig.name = 'defaultName'; lightMaskEffectConfig.color = &amp;quot;#ff0000&amp;quot;; lightMaskEffectConfig.radius = 10; lightMaskEffectConfig.opacity = 1; lightMaskEffect.wSeg = 50; lightMaskEffectConfig.hSeg = 50; lightMaskEffectConfig.phiLength = Math.PI * 1; lightMaskEffectConfig.thetaLength = Math.PI * 1; lightMaskEffectConfig.position = { x: 0, y: 0, z: 0 }; lightMaskEffectConfig.rotation = { x: 0, y: 0, z: 0 }; let lightMaskEffect = new B.Extension.Effect.LightMaskEffect(lightMaskEffectConfig);</code></pre> <hr /> <h3>4. 光罩特效管理工具配置</h3> <p><strong>构造函数:</strong></p> <pre><code class="language-javascript">new BCore.Extension.Effect.LightMaskEffectManagerConfig(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 /> <h3>5. 光罩特效管理工具</h3> <p><strong>构造函数:</strong></p> <pre><code class="language-javascript">new BCore.Extension.Effect.LightMaskEffectManager(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.LightMaskEffectManagerConfig</code></td> <td>光罩特效管理工具配置</td> </tr> </tbody> </table> <hr /> <h4>6. 添加光罩特效</h4> <p><strong>简要描述:</strong></p> <ul> <li>添加光罩特效对象</li> </ul> <p><strong>接口:</strong></p> <pre><code class="language-javascript">addLightMaskEffect(name, lightMaskEffect);</code></pre> <p><strong>参数说明:</strong></p> <table> <thead> <tr> <th>参数名</th> <th>必选</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td><code>name</code></td> <td>是</td> <td>string</td> <td>名称</td> </tr> <tr> <td><code>lightMaskEffect</code></td> <td>是</td> <td><code>BCore.Extension.Effect.LightMaskEffect</code></td> <td>光罩特效对象</td> </tr> </tbody> </table> <p><strong>示例代码:</strong></p> <pre><code class="language-javascript">let lightMaskEffectManagerConfig = new BCore.Extension.Effect.LightMaskEffectManagerConfig(mViewer3D); let lightMaskEffectManager = new BCore.Extension.Effect.LightMaskEffectManager(lightMaskEffectManagerConfig); let lightMaskEffectConfig = new BCore.Extension.Effect.LightMaskEffectConfig(); let lightMaskEffect = new BCore.Extension.Effect.LightMaskEffect(lightMaskEffectConfig); lightMaskEffectManager.addLightMaskEffect(&amp;quot;name&amp;quot;, lightMaskEffect);</code></pre> <hr /> <h4>7. 移除光罩特效</h4> <p><strong>简要描述:</strong></p> <ul> <li>移除光罩特效对象</li> </ul> <p><strong>接口:</strong></p> <pre><code class="language-javascript">removeLightMaskEffect(name);</code></pre> <p><strong>参数说明:</strong></p> <table> <thead> <tr> <th>参数名</th> <th>必</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td><code>name</code></td> <td>是</td> <td>string</td> <td>名称</td> </tr> </tbody> </table> <p><strong>示例代码:</strong></p> <pre><code class="language-javascript">lightMaskEffectManager.removeLightMaskEffect(&amp;quot;name&amp;quot;);</code></pre> <hr /> <p>以上是光罩特效相关的文档,若有进一步的问题或需要示例,请联系我们~</p>

页面列表

ITEM_HTML