// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Wind bearing instrument // Not compiled or tested in-world // Setup: Owner-touch a rezzed weather prop at the height of interest. // Stop / restore: Remove/disable; it makes no setting changes. // Notes: Bearing is where wind points toward, clockwise from north, not meteorological wind-from direction. Grid wind models can differ. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; vector wind=llWind(ZERO_VECTOR); wind.z=0.0; float speed=llVecMag(wind); if(speed<0.001) { llOwnerSay("Calm: no stable horizontal wind bearing."); return; } float bearing=llAtan2(wind.x,wind.y)*RAD_TO_DEG; if(bearing<0.0)bearing+=360.0; llOwnerSay("Wind toward "+(string)llRound(bearing)+" degrees; horizontal speed "+(string)speed+" m/s."); } }