// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Root cardinal orientation cycle // Not compiled or tested in-world // Setup: Use a spare root whose modeled front is +X. Five owner touches visit four level cardinal orientations and restore. // Stop / restore: Cycle through four cardinal poses; the fifth owner touch restores Home. Restore before removing or resetting. // 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. This levels the root while previewing, so it intentionally removes pitch and roll until restored. Children follow the root. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. rotation home; integer step; default { state_entry() { home=llGetRot(); } touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner()||llGetLinkNumber()>1||llGetStatus(STATUS_PHYSICS))return; if(step==4) { llSetRot(home); step=0; llOwnerSay("Home restored."); return; } float angle=PI_BY_TWO-step*PI_BY_TWO; llSetRot(llEuler2Rot(<0.0,0.0,angle>)); ++step; } }