// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Classify a sphere against a plane // Not compiled or tested in-world // Setup: Use a spare owned prim. Set sphere center/radius and plane point/normal. Touch for owner-only calculation output. // Stop / restore: Remove/disable. Does not sense, collide with, or modify actual objects. // Notes: Classification concerns an ideal sphere; a zero normal is rejected. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Ideal geometry only. vector CENTER=<1.0,2.0,3.0>; float RADIUS=1.5; vector ON_PLANE=<0.0,0.0,2.0>; vector NORMAL=<0.0,0.0,1.0>; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(RADIUS<0.0||llVecMag(NORMAL)<0.000001) { llOwnerSay("Invalid radius/normal."); return; } float d=(CENTER-ON_PLANE)*llVecNorm(NORMAL); string result="intersects plane"; if(d>RADIUS)result="entirely positive"; else if(d< -RADIUS)result="entirely negative"; llOwnerSay(result+"; signed center distance="+(string)d); } }