Difference between revisions of "LlWind"

From Second Life Wiki
Jump to: navigation, search
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{LSLFunctionAll
+
{{LSL_Function
 +
|inject-2={{LSL Function/offset|offset|noZ=*|sim=*}}
 +
|func=llWind
 +
|sort=Wind
 
|func_id=44
 
|func_id=44
 
|func_sleep=0.0
 
|func_sleep=0.0
 
|func_energy=10.0
 
|func_energy=10.0
|func=llWind
 
 
|return_type=vector
 
|return_type=vector
 
|p1_type=vector
 
|p1_type=vector
 
|p1_name=offset
 
|p1_name=offset
 
|func_footnote
 
|func_footnote
|return_text=that is the wind velocity at the object position + offset
+
|return_text=that is the wind velocity at the prim's [[llGetPos|position]] + {{LSLPT|offset}}
 
|spec
 
|spec
 
|caveats
 
|caveats
|examples
+
|examples=
 +
<source lang="lsl2">
 +
default
 +
{
 +
    touch_start(integer num)
 +
    {
 +
        llSay(0, "Wind velocity: " + (string)llWind(ZERO_VECTOR));
 +
    }
 +
}
 +
</source>
 +
<source 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");
 +
    }
 +
}
 +
</source>
 
|helpers
 
|helpers
|also_functions=*{{LSLG|llCloud}}
+
|also_functions={{LSL DefineRow||[[llCloud]]}}
 +
|also_articles={{LSL DefineRow||{{LSLGC|Weather}}|SL Weather information}}
 +
{{LSL DefineRow||[[User:Dora_Gustafson/moderated_world_wind|Moderated in-world wind]]}}
 
|notes
 
|notes
}}[[Category:LSL_Functions]][[Category:LSL_Stub]]
+
|issues={{Issue/V1|SVC-3131|llWind() and viewer wind effects do not match}}
 +
|cat1=Region
 +
|cat2=Weather
 +
|cat3
 +
|cat4
 +
}}

Latest revision as of 12:26, 19 September 2016

Summary

Function: vector llWind( vector offset );

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");
    }
}

See Also

Functions

•  llCloud

Articles

•  Weather SL Weather information
•  Moderated in-world wind

Deep Notes

All Issues

~ Search JIRA for related Issues
   llWind() and viewer wind effects do not match

Signature

function vector llWind( vector offset );