// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Extract child along its own axis // Not compiled or tested in-world // Setup: Set DISTANCE between -5 and 5 meters. Use nonphysical child; touch previews/restores. // Stop / restore: Owner-touch again to restore the startup snapshot before removal or reset, unless setup describes a different cycle. Do not relink during a preview. // Notes: Use a spare modifiable build. Saved state lives only in script memory. Displacement follows saved child orientation, not root axes. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer preview; float DISTANCE=0.3; vector home; rotation r; default { state_entry() { home=llGetLocalPos(); r=llGetLocalRot(); } touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; if(llGetLinkNumber()<2||llGetStatus(STATUS_PHYSICS)||llFabs(DISTANCE)>5.0)return; preview=!preview; if(preview) { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POS_LOCAL,home+*r]); } else { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POS_LOCAL,home]); } } }