// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Check a point against a convex boundary // Not compiled or tested in-world // Setup: Use a spare owned prim. Set ordered convex polygon VERTICES and test POINT. Touch for owner-only calculation output. // Stop / restore: Remove/disable. Does not sense, collide with, or modify actual objects. // Notes: Requires a convex polygon with consistent winding; zero cross products count as boundary and therefore inside. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Ideal geometry only. list VERTICES=[<0.0,0.0,0.0>,<4.0,0.0,0.0>,<5.0,3.0,0.0>,<1.0,5.0,0.0>]; vector POINT=<2.0,2.0,0.0>; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; integer n=llGetListLength(VERTICES); if(n<3) { llOwnerSay("Need three vertices."); return; } integer positive; integer negative; integer i; for(i=0;i0.000001)positive=TRUE; if(cross< -0.000001)negative=TRUE; } llOwnerSay("Inside/boundary="+(string)(!(positive&&negative))); } }