LlWind: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Strife Onizuka (talk | contribs)
mNo edit summary
Wulfie Reanimator (talk | contribs)
More testing and observations.
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|inject-2={{LSL Function/offset|offset|noZ=*|sim=*}}
|func=llWind
|func=llWind
|sort=Wind
|sort=Wind
Line 9: Line 10:
|p1_name=offset
|p1_name=offset
|func_footnote
|func_footnote
|return_text=that is the wind velocity at the prim position + '''offset'''
|return_text=that is the wind velocity at the prim's [[llGetPos|position]] + {{LSLPT|offset}}
|spec
|spec
|caveats
|caveats
|notes=
* Each region simulates its own wind with a random seed value, and chaos is scaled by the region's sun position.
** While the simulation is performed on a 16x16 grid, the wind has perfect resolution anywhere between those cells. (interpolated)
** This low resolution tends to result in smooth gradients of wind, however sudden and strong changes in wind speed and direction are possible.
** Vortexes and are also possible, sometimes multiple in the same region.
* Neighboring regions influence each other at the connecting border, which may lead to cascading changes for either region.
* Regions without neighbors exhibit very uniform wind across the whole region.
** Wind will occasionally change direction over time, but eventually stabilizes toward the new direction.
* Maximum wind speed can reach at least 20m/s.
|examples=
|examples=
<lsl>
<syntaxhighlight lang="lsl2">
default
default
{
{
Line 21: Line 31:
     }
     }
}
}
</lsl>
</syntaxhighlight>
<syntaxhighlight lang="lsl2">
// wind interpretation as angle and speed
default
{
    state_entry()
    {
        vector windVector = llWind( ZERO_VECTOR);
        float windSpeed = llVecMag( windVector);
        float windDirection = llAtan2( windVector.y, windVector.x);
        integer compassWind = ( 450 - (integer)( RAD_TO_DEG*windDirection))%360;
        llOwnerSay( "\nWind direction: "+(string)compassWind+"°\nWind speed: "+(string)windSpeed+" m/S");
    }
}
</syntaxhighlight>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llCloud]]}}
|also_functions={{LSL DefineRow||[[llCloud]]}}
|also_articles={{LSL DefineRow||{{LSLGC|Weather}}|SL Weather information}}
|also_articles={{LSL DefineRow||{{LSLGC|Weather}}|SL Weather information}}
{{LSL DefineRow||[[User:Dora_Gustafson/moderated_world_wind|Moderated in-world wind]]}}
|notes
|notes
|issues={{Issue|SVC-3131|llWind() and viewer wind effects do not match}}
|issues={{Issue/V1|SVC-3131|llWind() and viewer wind effects do not match}}
|haiku={{Haiku|Softly blowing breeze|Calmly rustling through the tree|A gentle whisper}}
|cat1=Region
|cat1=Region
|cat2=Weather
|cat2=Weather

Latest revision as of 09:01, 23 October 2025

Summary

Function: vector llWind( vector offset );
0.0 Forced Delay
10.0 Energy

Returns a vector that is the wind velocity at the prim's position + offset

• vector offset offset relative to the prim's position and expressed in local coordinates

The requested position needs to be in the same region. Only the x and y coordinates in offset are important, the z component is ignored.

Examples

default
{
    touch_start(integer num)
    {
        llSay(0, "Wind velocity: " + (string)llWind(ZERO_VECTOR));
    }
}
// wind interpretation as angle and speed
default
{
    state_entry()
    {
        vector windVector = llWind( ZERO_VECTOR);
        float windSpeed = llVecMag( windVector);
        float windDirection = llAtan2( windVector.y, windVector.x);
        integer compassWind = ( 450 - (integer)( RAD_TO_DEG*windDirection))%360;
        llOwnerSay( "\nWind direction: "+(string)compassWind+\nWind speed: "+(string)windSpeed+" m/S");
    }
}

Notes

  • Each region simulates its own wind with a random seed value, and chaos is scaled by the region's sun position.
    • While the simulation is performed on a 16x16 grid, the wind has perfect resolution anywhere between those cells. (interpolated)
    • This low resolution tends to result in smooth gradients of wind, however sudden and strong changes in wind speed and direction are possible.
    • Vortexes and are also possible, sometimes multiple in the same region.
  • Neighboring regions influence each other at the connecting border, which may lead to cascading changes for either region.
  • Regions without neighbors exhibit very uniform wind across the whole region.
    • Wind will occasionally change direction over time, but eventually stabilizes toward the new direction.
  • Maximum wind speed can reach at least 20m/s.

See Also

Functions

•  llCloud

Articles

•  Weather SL Weather information
•  Moderated in-world wind

Deep Notes

Signature

function vector llWind( vector offset );

Haiku

Softly blowing breeze
Calmly rustling through the tree
A gentle whisper