// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Surface normal probe // Not compiled or tested in-world // Setup: Put in the prim being inspected. Owner-touch a surface; the viewer must supply touch-normal data. // Stop / restore: Remove or disable. It only reports to owner chat. // Notes: Uses the visual touched surface normal, not a guarantee of the physics shape’s slope. A flat upward-facing surface is 0 degrees; a vertical wall is 90. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Not compiled or tested in-world. default { touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; vector normal = llDetectedTouchNormal(0); if (llVecMag(normal) < 0.1) { llOwnerSay("No usable touch normal returned."); return; } normal = llVecNorm(normal); float z = normal.z; if (z > 1.0) z = 1.0; if (z < -1.0) z = -1.0; llOwnerSay("Surface normal " + (string)normal + " | angle from up " + (string)(llAcos(z) * RAD_TO_DEG) + " degrees."); } }