// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Smooth segment through waypoints // Not compiled or tested in-world // Setup: Put in a spare prim you own. Edit P0 through P3; touch to print samples between P1 and P2. // Stop / restore: Disable or remove the script. It only reports to its owner and does not change prim properties. Reset clears its temporary state. // Notes: This is uniform Catmull–Rom, which can overshoot near unevenly spaced points. It is a planning calculation, not a collision-safe route. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Owner-only calculation; no scene changes. vector P0 = <0.0,0.0,0.0>; vector P1 = <2.0,2.0,0.0>; vector P2 = <6.0,3.0,0.0>; vector P3 = <8.0,0.0,0.0>; vector interpolate(float t) { return 0.5 * (2.0*P1 + (-P0+P2)*t + (2.0*P0-5.0*P1+4.0*P2-P3)*t*t + (-P0+3.0*P1-3.0*P2+P3)*t*t*t); } default { touch_start(integer detectedCount) { if (llDetectedKey(0) != llGetOwner()) return; integer i; for (i = 0; i <= 4; ++i) llOwnerSay((string)interpolate((float)i / 4.0)); } changed(integer change) { if (change & CHANGED_OWNER) llResetScript(); } }