天空盒子特效
<h1>天空盒子特效</h1>
<h2>BCore.Extension.Effect.SkyBoxConfig</h2>
<ul>
<li><strong>构造函数</strong>:
<pre><code class="language-javascript">new BCore.Extension.Effect.SkyBoxConfig(viewer)</code></pre></li>
<li><strong>参数</strong>:
<ul>
<li><strong>viewer</strong>: <code>BCore.Viewer.Viewer3D</code> - 视图对象</li>
</ul></li>
</ul>
<h2>BCore.Extension.Effect.SkyBox</h2>
<ul>
<li><strong>构造函数</strong>:
<pre><code class="language-javascript">new BCore.Extension.Effect.SkyBox(config)</code></pre></li>
<li><strong>参数</strong>:
<ul>
<li><strong>config</strong>: <code>BCore.Extension.Effect.SkyBoxConfig</code> - 天空盒子配置对象</li>
</ul></li>
</ul>
<h3>方法</h3>
<ol>
<li>
<p><strong>开启天空盒子</strong></p>
<ul>
<li><strong>描述</strong>: 用于开启天空盒子</li>
<li><strong>接口</strong>:
<pre><code class="language-javascript">skyBox.openSkyBox()</code></pre></li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">var skyBoxConfig = new BCore.Extension.Effect.SkyBoxConfig(viewer3D);
var skyBox = new BCore.Extension.Effect.SkyBox(skyBoxConfig);
skyBox.openSkyBox();</code></pre></li>
</ul>
</li>
<li>
<p><strong>关闭天空盒子</strong></p>
<ul>
<li><strong>描述</strong>: 用于关闭天空盒子</li>
<li><strong>接口</strong>:
<pre><code class="language-javascript">skyBox.closeSkyBox()</code></pre></li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">var skyBoxConfig = new BCore.Extension.Effect.SkyBoxConfig(viewer3D);
var skyBox = new BCore.Extension.Effect.SkyBox(skyBoxConfig);
skyBox.openSkyBox();
skyBox.closeSkyBox();</code></pre></li>
</ul>
</li>
<li>
<p><strong>获取天空盒子参数</strong></p>
<ul>
<li><strong>描述</strong>: 获取当前天空盒子的参数</li>
<li><strong>接口</strong>:
<pre><code class="language-javascript">var options = skyBox.getEffectOptions()</code></pre></li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">var skyBoxConfig = new BCore.Extension.Effect.SkyBoxConfig(viewer3D);
var skyBox = new BCore.Extension.Effect.SkyBox(skyBoxConfig);
skyBox.openSkyBox();
var options = skyBox.getEffectOptions();</code></pre></li>
<li><strong>返回值</strong>:
<ul>
<li><strong>options</strong>: <code>object</code> - 当前天空盒子的参数对象</li>
</ul></li>
</ul>
</li>
<li><strong>设置天空盒子参数</strong>
<ul>
<li><strong>描述</strong>: 设置天空盒子的特效参数</li>
<li><strong>接口</strong>:
<pre><code class="language-javascript">skyBox.setEffectOptions(options)</code></pre></li>
<li><strong>参数</strong>:
<ul>
<li><strong>options</strong>: <code>object</code> - 包括(turbidity, rayleigh, mieCoefficient, mieDirectionalG, inclination, azimuth等)</li>
</ul></li>
<li><strong>示例</strong>:
<pre><code class="language-javascript">var skyBoxConfig = new BCore.Extension.Effect.SkyBoxConfig(viewer3D);
var skyBox = new BCore.Extension.Effect.SkyBox(skyBoxConfig);
skyBox.openSkyBox();
var options = skyBox.getEffectOptions();
options.rayleigh = 0.9;
skyBox.setEffectOptions(options);</code></pre></li>
</ul></li>
</ol>
<h3>参考链接</h3>
<ul>
<li><a href="https://threejs.org/examples/?q=sky#webgl_shaders_sky">Three.js Sky Shader 示例</a></li>
</ul>