llWind
vector llWind(vector Offset)Returns the wind velocity at the object position + Offset.
Parameters
-
Offset(vector)
Basic Wind Velocity
Section titled “Basic Wind Velocity”default{ touch_start(integer num) { llSay(0, "Wind velocity: " + (string)llWind(ZERO_VECTOR)); }}Wind as Angle and Speed
Section titled “Wind as Angle and Speed”This example interprets the wind vector as a compass direction and speed in meters per second:
// wind interpretation as angle and speeddefault{ 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"); }}The offset parameter allows you to query wind velocity at positions relative to the prim’s current location.
Issues
Section titled “Issues”- Wind effects rendered by the viewer may not always match the actual wind velocity returned by this function
See Also
Section titled “See Also”- llCloud
- Weather systems in Second Life
- Moderated in-world wind techniques