// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Compare orientations of two clicked components // Not compiled or tested in-world // Setup: Put in a spare owned prim or linkset root. Touch the face or component to inspect. Child scripts may consume touches; face-based tools require a viewer that supplies touched-face data. // Stop / restore: Remove/disable. Inspectors read state and report only to the owner; they do not change the build. // Notes: The first click is the reference; the next click reports minimum angular difference. Clicking again starts a new pair. Root is excluded. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Owner-only live inspection. integer pending; rotation reference; integer referenceLink; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; integer link=llDetectedLinkNumber(0); if(link==0)link=LINK_THIS; integer face=llDetectedTouchFace(0); if(link<2) { llOwnerSay("Touch a linked child."); return; } rotation r=llList2Rot(llGetLinkPrimitiveParams(link,[PRIM_ROT_LOCAL]),0); if(!pending) { reference=r; referenceLink=link; pending=TRUE; llOwnerSay("Reference child recorded; touch comparison child."); return; } pending=FALSE; llOwnerSay("Children "+(string)referenceLink+" / "+(string)link+" minimum rotation difference="+(string)(llAngleBetween(reference,r)*RAD_TO_DEG)); } }