Difference between revisions of "LlCloud"

From Second Life Wiki
Jump to navigation Jump to search
(Corrected reference in notes to range of values returned)
(The article content predated current layout guidelines)
Line 2: Line 2:
|func=llCloud|sort=Cloud
|func=llCloud|sort=Cloud
|return_type=float|p1_type=vector|p1_name=offset
|return_type=float|p1_type=vector|p1_name=offset
|func_footnote
|func_footnote=Returned values are in the range [0.0, 2.0]. Values above 1.0 indicate rain.{{PBR}}
|return_text=that is the cloud density at the object position + '''offset'''
The Z component of '''offset''' is ignored.
|spec
|return_text=that is the cloud density at the [[llGetPos|prim position]] + '''offset'''
|caveats
|spec=
SL features a [http://web.archive.org/web/20040703050532/http://secondlife.com/about/technology.php#14 cellular automata-based] {{LSLGC|Weather|weather}} system. There are 16x16 square cloud "cells" per [[region]].
|caveats=
* There are currently no SecondLife clients that render rain.
* The client attempts to render clouds from the cloud algorithm results sent from the server, which is why different clients can see different cloud formations and de-synchronizes cloud view from the server over time. The cloud density data is sent from the server to the client when the region is loaded by the client. This can happen when the region comes into view, during teleport or during login.
|examples=
|examples=
<lsl>
<lsl>default
default
{
{
     touch_start(integer num)
     touch_start(integer num)
Line 14: Line 17:
         llSay(0,"Cloud density:" + (string)llCloud(ZERO_VECTOR));
         llSay(0,"Cloud density:" + (string)llCloud(ZERO_VECTOR));
     }
     }
}
}</lsl>
</lsl>
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||[[llWind]]}}
{{LSL DefineRow||[[llWind]]}}
{{LSL DefineRow||[[llGetSunDirection]]}}
{{LSL DefineRow||[[llGetSunDirection]]}}
|notes= How clouds work:
|notes=
Clouds and [[llWind|wind]] are interrelated.


* SL features a cellular automata-based weather system.
=== Client ===
* There are 16x16 square cloud "cells" per sim (which means each is 16x16m in size).
* The cloud density data is sent from the server to the client once every time the agent connects to a simulator via logging in or teleporting into a simulator.
* The client attempts to render clouds from the cloud algorithm results sent from the server, which is why different clients can see different cloud formations and de-synchronizes cloud view from the server over time.
* The Z value in the vector is irrelevant (clouds are always between about 180-200m absolute height).
* It returns a value between 0.0 and 2.0, with 0.0 being no clouds, and 1.0 very dense clouds. Values returned in the range 1.0 - 2.0 indicate rainfall, but the option for rain is not currently implemented.
* Clouds and wind are related.


Clouds are always rendered between about 180-200m absolute height.


=== Algorithm ===
The cloud seed/growth/dissipation algorithm uses a solenoidal vector field, which is a vector field with zero-divergence: {{noWrap|∇ · v {{=}} 0}}
The cloud seed/growth/dissipation algorithm uses a solenoidal vector field, which is a vector field with zero-divergence: {{noWrap|∇ · v {{=}} 0}}



Revision as of 20:43, 3 February 2010

Summary

Function: float llCloud( vector offset );

Returns a float that is the cloud density at the prim position + offset

• vector offset

Returned values are in the range [0.0, 2.0]. Values above 1.0 indicate rain. The Z component of offset is ignored.

Specification

SL features a cellular automata-based weather system. There are 16x16 square cloud "cells" per region.

Caveats

  • There are currently no SecondLife clients that render rain.
  • The client attempts to render clouds from the cloud algorithm results sent from the server, which is why different clients can see different cloud formations and de-synchronizes cloud view from the server over time. The cloud density data is sent from the server to the client when the region is loaded by the client. This can happen when the region comes into view, during teleport or during login.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>default {

   touch_start(integer num)
   {
       llSay(0,"Cloud density:" + (string)llCloud(ZERO_VECTOR));
   }
}</lsl>

Notes

Clouds and wind are interrelated.

Client

Clouds are always rendered between about 180-200m absolute height.

Algorithm

The cloud seed/growth/dissipation algorithm uses a solenoidal vector field, which is a vector field with zero-divergence: ∇ · v = 0

This condition is satisfied whenever v has a vector potential A, because if v = ∇ ⨯ A then ∇ · v = ∇ · (∇ ⨯ A) = 0

See Also

Functions

•  llWind
•  llGetSunDirection

Deep Notes

Search JIRA for related Issues

Signature

function float llCloud( vector offset );