// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Find the six neighboring hex cells // Not compiled or tested in-world // Setup: Use a spare owned prim. Set axial Q/R and positive hex RADIUS. Owner touch prints sample coordinates. // Stop / restore: Remove/disable. Nothing is rezzed or moved. // Notes: Axial coordinates are integers; radius is center-to-corner distance. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Planning only. integer Q=2; integer R=-1; float RADIUS=1.0; list DIRECTIONS=[<1.0,0.0,0.0>,<1.0,-1.0,0.0>,<0.0,-1.0,0.0>,<-1.0,0.0,0.0>,<-1.0,1.0,0.0>,<0.0,1.0,0.0>]; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(RADIUS<=0.0) { llOwnerSay("Positive radius required."); return; } integer i; for(i=0;i<6;++i) { vector d=llList2Vector(DIRECTIONS,i); float q=Q+d.x; float r=R+d.y; llOwnerSay("Neighbor axial="+(string)+" center="+(string)); } } }