Difference between revisions of "LlWind"

From Second Life Wiki
Jump to navigation Jump to search
m (Replaced <source> with <syntaxhighlight> and added haiku generated by https://tasklab.ai/haiku)
 
Line 14: Line 14:
|caveats
|caveats
|examples=
|examples=
<source lang="lsl2">
<syntaxhighlight lang="lsl2">
default
default
{
{
Line 22: Line 22:
     }
     }
}
}
</source>
</syntaxhighlight>
<source lang="lsl2">
<syntaxhighlight lang="lsl2">
// wind interpretation as angle and speed
// wind interpretation as angle and speed
default
default
Line 36: Line 36:
     }
     }
}
}
</source>
</syntaxhighlight>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llCloud]]}}
|also_functions={{LSL DefineRow||[[llCloud]]}}
Line 43: Line 43:
|notes
|notes
|issues={{Issue/V1|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 07:52, 12 October 2023

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

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