// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Evaluate a custom piecewise response curve // Not compiled or tested in-world // Setup: Place in a spare owned prim. Set paired KNOTS in strictly increasing input order and VALUE. Touch to run; output is private to the owner. // Stop / restore: Disable/remove. No scene changes or external calls. // Notes: Each interval is linear. The table is validated before lookup; this differs from a smooth spline. // License: see LICENSE in this distribution. // Original Incoprea. MIT. list KNOTS=[0.0,0.0,0.2,0.05,0.6,0.8,1.0,1.0]; float VALUE=0.45; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; integer n=llGetListLength(KNOTS); if(n<4||n%2) { llOwnerSay("Need at least two input/output pairs."); return; } integer i; for(i=2;i