// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Mirror a child position across a local plane // Not compiled or tested in-world // Setup: Use a spare nonphysical rezzed linkset; disable competing scripts and do not edit or relink during the preview. Put this in the root. Set NORMAL and PLANE_POINT. Owner-touch the child to preview; touch again to restore. // Stop / restore: Owner-touch again to restore before removing, resetting, relinking or transferring. Snapshots are memory-only; deletion/reset does not undo changes. Keep an untouched backup. // Notes: Mirrors position only; it does not reverse mesh handedness or reflect orientation. The original position, rotation and size are restored together. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Test on a spare copy first. integer selected; key identity; list original; vector NORMAL=<1.0,0.0,0.0>; vector PLANE_POINT=ZERO_VECTOR; default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; if(llGetAttached()||llGetStatus(STATUS_PHYSICS)||llGetLinkNumber()>1) { llOwnerSay("Use a nonphysical rezzed root."); return; } if(selected) { if(llGetLinkKey(selected)==identity)llSetLinkPrimitiveParamsFast(selected,[PRIM_POS_LOCAL,llList2Vector(original,0),PRIM_ROT_LOCAL,llList2Rot(original,1),PRIM_SIZE,llList2Vector(original,2)]); else llOwnerSay("Topology changed; restore manually from backup."); selected=0; return; } integer link=llDetectedLinkNumber(0); if(link<2||link>llGetObjectPrimCount(llGetKey())) { llOwnerSay("Touch a child prim."); return; } list data=llGetLinkPrimitiveParams(link,[PRIM_POS_LOCAL,PRIM_ROT_LOCAL,PRIM_SIZE]); vector p=llList2Vector(data,0); rotation r=llList2Rot(data,1); vector size=llList2Vector(data,2); if(llVecMag(NORMAL)<0.001)return; vector normal=llVecNorm(NORMAL); p=p-2.0*((p-PLANE_POINT)*normal)*normal; selected=link; identity=llGetLinkKey(link); original=data; llSetLinkPrimitiveParamsFast(link,[PRIM_POS_LOCAL,p,PRIM_ROT_LOCAL,r,PRIM_SIZE,size]); llOwnerSay("Preview applied; touch again to restore."); } changed(integer flags) { if(flags&CHANGED_OWNER)llResetScript(); } }