SkyBox

new Cesium.SkyBox(options)

天空盒,在场景周围画星星。天空盒使用真正的赤道平均春分点(TEME)轴定义。

只支持3D模式,大小不能超过Scene#maximumCubeMapSize

Name Type Description
options Object 具有下列属性的对象:
Name Type Default Description
sources Object optional 6个立方体映射面的每个源URL或Image对象。请参见下面的示例。
show Boolean true optional 是否显示天空盒。
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

show : Boolean

是否显示天空盒。
Default Value: true

sources : Object

天空盒的6个面的图像。
Default Value: undefined

Methods

销毁此对象持有的WebGL资源。

一旦对象被销毁,它将不能在使用; 调用除isDestroyed之外的任何函数都会导致DeveloperError异常。 因此,将返回值(undefined)赋给对象,如示例所示。
Throws:
Example:
skyBox = skyBox && skyBox.destroy();
See:

isDestroyed()Boolean

如果该对象没被销毁,返回false。

如果该对象已经被销毁,使用isDestroyed 会触发 DeveloperError 异常。
Returns:
false
See:
ViewerCesiumWidget渲染场景以获得渲染此图元所需的draw命令时调用。

不要直接调用这个函数。这被记录下来只是为了列出在场景渲染时可能传播的异常:

Throws:
  • DeveloperError : this.sources 是需要的并且必须有 positiveX,negativeX,positiveY,negativeY,positiveZ,和 negativeZ 属性。
  • DeveloperError : this.sources 属性必须是相同的类型。