RandomCloudsLayer

A clouds layer where the clouds are randomly positioned according to noise functions

Constructor

new RandomCloudsLayer(properties)

Renders random clouds all over the planet with density entirely based on noise functions. Only one visible CloudsLayer (first in list) will be taken into account at a time.
Parameters:
NameTypeDescription
propertiesObject
Properties
NameTypeAttributesDefaultDescription
idString | Numberlayer id should be unique
nameStringthe name can be anything you want and is intended for labeling
qualityNumber<optional>
0.3general quality setting
minHeightNumber<optional>
500clouds min height in earth radii
maxHeightNumber<optional>
12000clouds max height in earth radii
densityNumber<optional>
0.5cloud density multiplier
luminanceNumber<optional>
0.5sun intensity multiplier
coverageNumber<optional>
0.2average sky coverage between 0 and 1 (a high coverage can negatively impact performance)
windSpeedNumber<optional>
0.05wind speed
windDirectionNumber<optional>
new THREE.Vector2(1.0,0.0)wind direction
colorTHREE.Vector3<optional>
new THREE.Vector3(1.0,1.0,1.0)base cloud color.
visibleBoolean<optional>
truelayer will be rendered if true (true by default)

Extends

Methods

addListener(key, listener)

Adds a listener for layer events
Parameters:
NameTypeDescription
key*can be anything but should be unique
listenerfunctiona function : (layer, eventType)=>{}

dispose()

disposes of any resources used by this layer

getBounds() → {THREE.Box2}

Returns:
bounds in longitude latitude (degrees)
Type: 
THREE.Box2

getCenter(sfct) → {THREE.Vector3}

Moves a given point to this layer's center in degree longitude/latitude
Parameters:
NameTypeDescription
sfctTHREE.Vector3a point to move
Returns:
the input point
Type: 
THREE.Vector3

getID()

Returns:
layer id

getName()

Returns:
layer name

getSelectableObjects()

Get all the selectable objects of this layer.
Returns:
an array of ray-castable objects with a property "layer" pointing to this layer.

removeListener(key)

Removes the listener associated to the given key
Parameters:
NameTypeDescription
key*can be anything but should be unique

select(objectsToSelect) → {Boolean}

selects an object from this layer
Parameters:
NameTypeDescription
objectsToSelectObject
Returns:
true if the object was selected, false otherwise
Type: 
Boolean

setName(name)

change the layer name
Parameters:
NameTypeDescription
nameString

setVisible(visible)

Modifies the layer visibility
Parameters:
NameTypeDescription
visibleBoolean

unselect(objectsToUnselect) → {Boolean}

un-selects an object from this layer
Parameters:
NameTypeDescription
objectsToUnselectObject
Returns:
true if the object was un-selected, false otherwise
Type: 
Boolean