// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Bounded angular sweep study // Not compiled or tested in-world // Setup: Place in a hinge-centered child. Owner-touch starts a ten-second sweep from 0 to 60 degrees and back. // Stop / restore: Owner-touch to stop and restore the captured starting pose before removing, resetting, or relinking. // Notes: Use a small nonphysical rezzed build with clear space. Actual prim transforms change. Original poses live only in script memory. Do not change physical status or link topology during use. An angular inspection sweep is useful for clearance review. It does not sense collisions; observe the build on a copy. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. rotation home; integer active; default { state_entry() { home=llGetLocalRot(); } touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner()||llGetLinkNumber()<2||llGetStatus(STATUS_PHYSICS))return; if(active) { active=FALSE; llSetTimerEvent(0.0); llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROT_LOCAL,home]); return; } active=TRUE; llResetTime(); llSetTimerEvent(0.2); } timer() { if(llGetLinkNumber()<2||llGetStatus(STATUS_PHYSICS)) { llSetTimerEvent(0.0); active=FALSE; return; } float t=llGetTime(); if(t>=10.0) { active=FALSE; llSetTimerEvent(0.0); llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROT_LOCAL,home]); return; } float f=t/5.0; if(f>1.0)f=2.0-f; llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROT_LOCAL,llEuler2Rot(<0.0,0.0,60.0*DEG_TO_RAD*f>)*home]); } changed(integer change) { if(change&CHANGED_LINK) { llSetTimerEvent(0.0); active=FALSE; home=llGetLocalRot(); llOwnerSay("Links changed; current pose is the new Home."); } } }