场景周围的天空盒,用于绘制星星。天空盒使用真赤道平均春分点(TEME)轴定义。
此功能仅在 3D 中支持。当变形为 2D 或哥伦布视图时,天空盒会逐渐消失。天空盒的大小不得超过 Scene#maximumCubeMapSize。
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
包含以下属性的对象:
|
Example:
scene.skyBox = new Cesium.SkyBox({
sources : {
positiveX : 'skybox_px.png',
negativeX : 'skybox_nx.png',
positiveY : 'skybox_py.png',
negativeY : 'skybox_ny.png',
positiveZ : 'skybox_pz.png',
negativeZ : 'skybox_nz.png'
}
});
See:
Members
确定天空盒是否将被显示。
-
Default Value:
true
用于创建立方体贴图面的源:一个具有
positiveX、negativeX、positiveY、
negativeY、positiveZ 和 negativeZ 属性的对象。
这些可以是 URL 或 Image 对象。
-
Default Value:
undefined
Methods
static Cesium.SkyBox.createEarthSkyBox() → SkyBox
创建一个带有地球默认星图的天空盒实例。
Returns:
地球的默认天空盒
Example:
viewer.scene.skyBox = Cesium.SkyBox.createEarthSkyBox();
销毁此对象持有的 WebGL 资源。销毁对象允许确定性地释放 WebGL 资源,而不是依赖垃圾回收器销毁此对象。
一旦对象被销毁,就不应使用;调用除
一旦对象被销毁,就不应使用;调用除
isDestroyed 以外的任何函数将导致 DeveloperError 异常。因此,
应将返回值(undefined)分配给该对象,如示例所示。
Throws:
-
DeveloperError : 此对象已被销毁,即,已调用 destroy()。
Example:
skyBox = skyBox && skyBox.destroy();
See:
Returns:
如果此对象已被销毁,则返回
true;否则返回 false。
See:
Throws:
-
DeveloperError : this.sources 是必需的,必须具有 positiveX、negativeX、positiveY、negativeY、positiveZ 和 negativeZ 属性。
-
DeveloperError : this.sources 属性必须全部为相同类型。
