CloudCollection

external class CloudCollection(source)

A renderable collection of clouds in the 3D scene.

Clouds are added and removed from the collection using CloudCollection.add and CloudCollection.remove.

// Create a cloud collection with two cumulus clouds
const clouds = scene.primitives.add(new CloudCollection());
clouds.add({
position : new Cartesian3(1.0, 2.0, 3.0),
maximumSize: new Cartesian3(20.0, 12.0, 8.0)
});
clouds.add({
position : new Cartesian3(4.0, 5.0, 6.0),
maximumSize: new Cartesian3(15.0, 9.0, 9.0),
slice: 0.5
});

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

This property is for debugging only; it is not for production use nor is it optimized.

Link copied to clipboard

This property is for debugging only; it is not for production use nor is it optimized.

Link copied to clipboard
var length: Int

Returns the number of clouds in this collection.

Link copied to clipboard

Controls the amount of detail captured in the precomputed noise texture used to render the cumulus clouds. In order for the texture to be tileable, this must be a power of two. For best results, set this to be a power of two between 8.0 and 32.0 (inclusive).

Link copied to clipboard

Applies a translation to noise texture coordinates to generate different data. This can be modified if the default noise does not generate good-looking clouds.

Link copied to clipboard

Determines if billboards in this collection will be shown.

Functions

Link copied to clipboard
fun add(options: Any? = definedExternally): CumulusCloud

Creates and adds a cloud with the specified initial properties to the collection. The added cloud is returned so it can be modified or removed from the collection later.

Link copied to clipboard
fun contains(cloud: CumulusCloud? = definedExternally): Boolean

Check whether this collection contains a given cloud.

Link copied to clipboard
fun destroy()

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.

Link copied to clipboard
operator fun get(index: Int): CumulusCloud

Returns the cloud in the collection at the specified index. Indices are zero-based and increase as clouds are added. Removing a cloud shifts all clouds after it to the left, changing their indices. This function is commonly used with CloudCollection.length to iterate over all the clouds in the collection.

Link copied to clipboard

Returns true if this object was destroyed; otherwise, false.

Link copied to clipboard

Removes a cloud from the collection.

Link copied to clipboard
fun removeAll()

Removes all clouds from the collection.