// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Point inside an irregular boundary // Not compiled or tested in-world // Setup: Place in a spare prim. Set ordered boundary POINTS and test P. Owner touch prints results without altering the scene. // Stop / restore: Disable or remove. No prim properties are changed. // Notes: Boundary points are not assigned a special inside/outside guarantee; use a distance-to-edge tolerance when boundaries matter. Z is ignored. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Owner-only calculation. list POINTS=[<0.0,0.0,0.0>,<5.0,0.0,0.0>,<5.0,2.0,0.0>,<2.0,2.0,0.0>,<2.0,5.0,0.0>,<0.0,5.0,0.0>]; vector P=<1.0,3.0,0.0>; default { touch_start(integer detectedCount) { if (llDetectedKey(0)!=llGetOwner()) return; integer n=llGetListLength(POINTS); if(n<3) { llOwnerSay("Need three or more vertices."); return; } integer inside=FALSE; integer i; integer j=n-1; for(i=0;iP.y)!=(b.y>P.y)) { float crossing=(b.x-a.x)*(P.y-a.y)/(b.y-a.y)+a.x; if(P.x