zyy-engine

图形引擎API


材质贴图特效

<h1>材质贴图特效</h1> <h2>类说明</h2> <h3>1. BCore.Extension.Effect.MaterialTextureEffectConfig</h3> <ul> <li><strong>描述</strong>: 材质贴图特效配置参数</li> <li><strong>构造</strong>: <code>new BCore.Extension.Effect.MaterialTextureEffectConfig()</code></li> </ul> <h4>成员变量</h4> <table> <thead> <tr> <th>成员变量</th> <th>类型</th> <th>说明</th> <th>是否必需</th> </tr> </thead> <tbody> <tr> <td>type</td> <td>String</td> <td>特效类型,目前支持&#039;LINE&#039;直线型或&#039;CIRCLE&#039;圆形类型,默认为直线型</td> <td>否</td> </tr> <tr> <td>map String</td> <td>贴图</td> <td>是</td> </tr> <tr> <td>color</td> <td>String</td> <td>动画效果底色</td> <td>否</td> </tr> <tr> <td>offset</td> <td>{ x, y, z }</td> <td>与原始构件偏移距离</td> <td>否</td> </tr> <tr> <td>speed</td> <td>number</td> <td>特效动画速度</td> <td>否</td> </tr> <tr> <td>k</td> <td>number</td> <td>直线型特效的斜率,圆形类型时不生效</td> <td>否</td> </tr> <tr> <td>width</td> <td>number</td> <td>直线型特效的全亮部分贴图宽度,圆形类型时不生效</td> <td>否</td> </tr> <tr> <td>gradientColorWidth</td> <td>number</td> <td>直线型特效的边缘渐变贴图宽度,圆形类型时不生效</td> <td>否</td> </tr> </tbody> </table> <h4>示例</h4> <pre><code class="language-javascript">let materialTextureConfig = new BCore.Extension.Effect.MaterialTextureEffectConfig(); materialTextureConfig.map = &amp;quot;../picture/bim.png&amp;quot;; materialTextureConfig.color = &amp;#039;#fff333&amp;#039;; materialTextureConfig.speed = 5.0;</code></pre> <hr /> <h3>2. BCore.Extension.Effect.MaterialTextureManagerConfig</h3> <ul> <li><strong>描述</strong>: 材质贴图特效管理工具配置</li> <li><strong>构造</strong>: <code>new BCore.Extension.Effect.MaterialTextureManagerConfig(Viewer3D)</code></li> </ul> <h4>参数</h4> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>viewer3D</td> <td>BCore.Viewer.Viewer3D</td> <td>三维模型视图对象</td> </tr> </tbody> </table> <hr /> <h3>3. BCore.Extension.Effect.MaterialTextureManager</h3> <ul> <li><strong>描述</strong>: 材质贴图特效管理工具</li> <li><strong>构造</strong>: <code>new BCore.Extension.Effect.MaterialTextureManager(config)</code></li> </ul> <h4>参数</h4> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>config</td> <td>BCore.Extension.Effect.MaterialTextureManagerConfig</td> <td>材质贴图特效管理工具配置</td> </tr> </tbody> </table> <h4>示例方法1. 添加构件材质贴图效果</h4> <ul> <li><strong>接口</strong>: <code>addComponentsTextureByUuid(uuid, MaterialTextureEffectConfig)</code></li> </ul> <h4>参数</h4> <table> <thead> <tr> <th>参数名</th> <th>必选</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>uuid</td> <td>是</td> <td>string</td> <td>构件唯一标识</td> </tr> <tr> <td>MaterialTextureEffectConfig</td> <td>是</td> <td>BCore.Extension.Effect.MaterialTextureEffectConfig</td> <td>材质贴图效果配置</td> </tr> </tbody> </table> <h4>示例</h4> <pre><code class="language-javascript">let materialTextureManagerConfig = new BCore.Extension.Effect.MaterialTextureManagerConfig(mViewer3D); let materialTextureManager = new BCore.Extension.Effect.MaterialTextureManager(materialTextureManagerConfig); let materialTextureConfig = new BCore.Extension.Effect.MaterialTextureEffectConfig(); materialTextureConfig.map = &amp;quot;../picture/bim6.png&amp;quot;; materialTextureConfig.speed = 5.0; materialTextureManager.addComponentsTextureByUuid(&amp;quot;3itsjDojXFh9YG8jzvJpC$&amp;quot;, materialTextureConfig);</code></pre> <h4>示例方法2. 移除材质贴图效果</h4> <ul> <li><strong>接口</strong>: <code>removeTextureComponentsByUuid(uuid)</code></li> </ul> <h4>参数</h4> <table> <thead> <tr> <th>参数名</th> <th>必选</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>uuid</td> <td>是</td> <td>类型</td> <td>构件唯一标识</td> </tr> </tbody> </table> <h4>示例</h4> <pre><code class="language-javascript">materialTextureManager.removeTextureComponentsByUuid(&amp;quot;1iiVKMU5jF$eix_dBjjB1U&amp;quot;);</code></pre> <hr /> <p>下面是关于材质贴图特效的文档整理,包含了类的说明、构造方法、成员变量及其解释,希望这能帮助您更好地理解和使用这些特效~</p>

页面列表

ITEM_HTML