| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 
           options
           | Object | 具有以下属性的
          
           可选
          
          对象: 
 | 
Example:
// Create a cloud collection with two cumulus clouds
const clouds = scene.primitives.add(new Cesium.CloudCollection());
clouds.add({
  position : new Cesium.Cartesian3(1.0, 2.0, 3.0),
  maximumSize: new Cesium.Cartesian3(20.0, 12.0, 8.0)
});
clouds.add({
  position : new Cesium.Cartesian3(4.0, 5.0, 6.0),
  maximumSize: new Cesium.Cartesian3(15.0, 9.0, 9.0),
  slice: 0.5
});Demo:
See:
Members
为了调试,使用一种不透明颜色渲染广告牌。
- 
      
       Default Value:
      
      
       false
      
     
       为了调试,将云绘制为不透明的单色椭圆体。如果
       
        debugBillboards
       
       也为真,则椭圆体将绘制在广告牌的顶部。
      
- 
      
       Default Value:
      
      
       false
      
     
       控制在用于渲染积云的预计算噪声纹理中捕获的细节量。为了使纹理可以平铺,这必须是 2 的幂。为获得最佳结果,请将其设置为
       
        8.0
       
       和
       
        32.0
       
       (含)之间的 2 的幂。
      
| 
           clouds.noiseDetail = 8.0;
            | 
           clouds.noiseDetail = 32.0;
            | 
- 
      
       Default Value:
      
      
       16.0
      
     noiseOffset : Cartesian3
对噪声纹理坐标应用平移以生成不同的数据。如果默认噪声不生成好看的云,则可以修改此设置。
| 
           default
            | 
           clouds.noiseOffset = new Cesium.Cartesian3(10, 20, 10);
            | 
- 
      
       Default Value:
      
      
       Cartesian3.ZERO
      
     - 
      
       Default Value:
      
      
       true
      
     Methods
add ( options ) → CumulusCloud
Performance:
      调用
      
       add
      
      是预期的恒定时间。但是,集合的顶点缓冲区被重写 - 一个
      
       O(n)
      
      操作,也会导致 CPU 到 GPU 开销。为了获得最佳性能,请在调用
      
       update
      
      之前添加尽可能多的云。
     
| Name | Type | Description | 
|---|---|---|
| 
          options
          | Object | 可选 描述云属性的模板,如示例 1 所示。 | 
Returns:
Throws:
- 
 
  DeveloperError : 该对象被销毁,即调用了destroy()。
Examples:
// Example 1:  Add a cumulus cloud, specifying all the default values.
const c = clouds.add({
  show : true,
  position : Cesium.Cartesian3.ZERO,
  scale : new Cesium.Cartesian2(20.0, 12.0),
  maximumSize: new Cesium.Cartesian3(20.0, 12.0, 12.0),
  slice: -1.0,
  cloudType : CloudType.CUMULUS
});// Example 2:  Specify only the cloud's cartographic position.
const c = clouds.add({
  position : Cesium.Cartesian3.fromDegrees(longitude, latitude, height)
});See:
| Name | Type | Description | 
|---|---|---|
| 
          cloud
          | CumulusCloud | 可选 要检查的云。 | 
Returns:
See:
一旦一个对象被销毁,它就不应该被使用;调用
       isDestroyed
      
      以外的任何函数都会导致
      
       
        DeveloperError
       
      
      异常。因此,如示例中所做的那样,将返回值 (
      
       undefined
      
      ) 分配给对象。
     Throws:
- 
 
  DeveloperError : 该对象被销毁,即调用了destroy()。
Example:
clouds = clouds && clouds.destroy();See:
get (index) → CumulusCloud
        CloudCollection#length
       
      
      一起使用,以遍历集合中的所有云。
     Performance:
      预期的恒定时间。如果从集合中删除了云并且未调用
      
       CloudCollection#update
      
      ,则执行隐式
      
       O(n)
      
      操作。
     
| Name | Type | Description | 
|---|---|---|
| 
          index
          | Number | 云的从零开始的索引。 | 
Returns:
Throws:
- 
 
  DeveloperError : 该对象被销毁,即调用了destroy()。
Example:
// Toggle the show property of every cloud in the collection
const len = clouds.length;
for (let i = 0; i < len; ++i) {
  const c = clouds.get(i);
  c.show = !c.show;
}See:
Returns:
    true
   
   ;否则,
   
    false
   
   。
  | Name | Type | Description | 
|---|---|---|
| 
          cloud
          | CumulusCloud | 要删除的云。 | 
Returns:
    true
   
   ;如果在集合中未找到云,则为
   
    false
   
   。
  Throws:
- 
 
  DeveloperError : 该对象被销毁,即调用了destroy()。
Example:
const c = clouds.add(...);
clouds.remove(c);  // Returns trueSee:
Performance:
      
       O(n)
      
      。从集合中删除所有云然后添加新云比完全创建新集合更有效。
     
Throws:
- 
 
  DeveloperError : 该对象被销毁,即调用了destroy()。
Example:
clouds.add(...);
clouds.add(...);
clouds.removeAll(); 
    