3D场景中可变的云集.

示例积分云
Clouds are added and removed from the collection using

示例积分云
Clouds are added and removed from the collection using
CloudCollection#add
和 CloudCollection#remove .
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
下列属性的对象 :
|
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
此属性仅用于调试;不用于生产,也不优化.
画云为不透明,单色椭圆形,为调试之用. 如果 NT 0 debugBillboards NT 1 也是真实的,那么椭圆形将画在公告牌的上方.
-
Default Value:
false
返回此收藏中的云数 .
控制预计算噪声纹理中捕获的细节量 用来制造积分云. 为使纹理可瓦, 这一定是两个力量 为了取得最佳结果, 将它设定为两个力量 在 NT+0 8.0 NT+1 和 NT+2 32.0 NT+3 (含)之间.
clouds.noiseDetail = 8.0;
|
clouds.noiseDetail = 32.0;
|
-
Default Value:
16.0
noiseOffset : Cartesian3
对噪声纹理坐标应用翻译生成不同的数据. 如果默认噪声不产生好看的云,则可以修改这个.
-NT##0 默认 NT##1 NT 2
|
clouds.noiseOffset = new Cesium.Cartesian3(10, 20, 10);
|
-
Default Value:
Cartesian3.ZERO
确定是否在此收藏中显示公告牌 .
-
Default Value:
true
Methods
add(options) → CumulusCloud
创建并添加带有指定初始属性的云.
添加的云被还原,以便日后可以修改或从收藏中移除.
Performance:
Calling add is expected constant time. However, the collection's vertex buffer
is rewritten - an O(n) operation that also incurs CPU to GPU overhead. For
最佳表现,在调用 update 前,请加入尽可能多的云.
| Name | Type | Description |
|---|---|---|
options |
object | optional A template describing the cloud's properties as shown in Example 1. |
Returns:
集中所增云.
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
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 | optional 云何应验. |
Returns:
如果本集包含云,则真实,否则是虚假的.
See:
Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
释放 WebGL 资源,而不是依赖垃圾收集器来摧毁此对象.
Once an object is destroyed, it should not be used; calling any function other than
Once an object is destroyed, it should not be used; calling any function other than
isDestroyed will result in a DeveloperError exception. Therefore,
assign the return value (undefined) to the object as done in the example.
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
clouds = clouds && clouds.destroy();
See:
get(index) → CumulusCloud
在指定的索引中返回收藏中的云。 指数为零
并随云而增. 清除云会移动所有云
在左边,改变他们的指数。 此函数通常用于
○
CloudCollection#length ○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○○□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□.
Performance:
Expected constant time. If clouds were removed from the collection and
CloudCollection#update was not called, an implicit O(n)
操作完成.
| Name | Type | Description |
|---|---|---|
index |
number | 云何无量无边无边无边无边无边无边无边. |
Returns:
指定索引上的云.
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
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:
如果此对象被销毁, 返回真实; 否则, 错误 .
If this object was destroyed, it should not be used; calling any function other than
If this object was destroyed, it should not be used; calling any function other than
isDestroyed will result in a DeveloperError exception.
Returns:
true if this object was destroyed; otherwise, false.
删除收藏中的云.
| Name | Type | Description |
|---|---|---|
cloud |
CumulusCloud | 云何为除. |
Returns:
true if the cloud was removed; false if the cloud was not found in the collection.
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
const c = clouds.add(...);
clouds.remove(c); // Returns true
See:
从集中除去一切云.
Performance:
O(n). It is more efficient to remove all the clouds
从收藏开始,然后添加新收藏,而不是完全创建新收藏.
Throws:
-
DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
clouds.add(...);
clouds.add(...);
clouds.removeAll();