// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Relative touch dial // Not compiled or tested in-world // Setup: Set FACE on a flat circular or square control pad. Owner-touch away from its center. // Stop / restore: Remove/disable. It changes no setting. // Notes: Returns degrees 0–360 measured counterclockwise from surface +S. The central dead zone avoids unstable angles. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer FACE=0; default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner()||llDetectedTouchFace(0)!=FACE)return; vector p=llDetectedTouchST(0); if(p.x<0.0||p.y<0.0)return; p-=<0.5,0.5,0.0>; if(llVecMag(p)<0.1)return; float degrees=llAtan2(p.y,p.x)*RAD_TO_DEG; if(degrees<0.0)degrees+=360.0; llOwnerSay("Dial "+(string)llRound(degrees)+" degrees"); llMessageLinked(LINK_ALL_OTHERS,7845,(string)degrees,NULL_KEY); } }