// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Compare child orientations // Not compiled or tested in-world // Setup: Set REFERENCE and LIMIT_DEGREES. Use a rezzed linkset of 2-32 prims and touch as owner. // Stop / restore: Remove or disable. This planner does not apply the reported changes. // Notes: Uses quaternion angular distance, avoiding Euler wraparound errors. Does not detect whether differently authored meshes visually face the same way. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. rotation REFERENCE=ZERO_ROTATION; float LIMIT_DEGREES=1.0; default { touch_start(integer touches) { if(llDetectedKey(0)!=llGetOwner())return; if(llGetAttached()) { llOwnerSay("Use a rezzed build."); return; } integer total=llGetObjectPrimCount(llGetKey()); if(total<2 || total>32) { llOwnerSay("Use a linkset of 2-32 prims."); return; } if(LIMIT_DEGREES<0 || LIMIT_DEGREES>180) { llOwnerSay("Angle limit must be 0-180."); return; } integer i; for(i=2;i<=total;++i) { rotation r=llList2Rot(llGetLinkPrimitiveParams(i,[PRIM_ROT_LOCAL]),0); float angle=llAngleBetween(r,REFERENCE)*RAD_TO_DEG; if(angle>LIMIT_DEGREES)llOwnerSay("Link "+(string)i+" differs by "+(string)angle+" degrees."); } } changed(integer flags) { if(flags & CHANGED_OWNER)llResetScript(); } }