// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Choose a look-ahead steering point // Not compiled or tested in-world // Setup: Put in a spare owned prim. Set POINTS, SEGMENT, FRACTION0..1 and nonnegative LOOKAHEAD. Owner touch prints calculations only. // Stop / restore: Disable/remove. No prim motion or appearance is changed. // Notes: Assumes the caller already knows its current path segment; does not locate an object in the scene. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Motion planning only. list POINTS=[<0.0,0.0,0.0>,<4.0,0.0,0.0>,<4.0,5.0,0.0>]; integer SEGMENT=0; float FRACTION=0.5; float LOOKAHEAD=3.0; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; integer n=llGetListLength(POINTS); if(SEGMENT<0||SEGMENT>=n-1||FRACTION<0.0||FRACTION>1.0||LOOKAHEAD<0.0) { llOwnerSay("Invalid route location."); return; } vector a=llList2Vector(POINTS,SEGMENT); vector b=llList2Vector(POINTS,SEGMENT+1); vector current=a+(b-a)*FRACTION; float remaining=LOOKAHEAD; integer i; for(i=SEGMENT+1;i0.0&&remaining<=length) { llOwnerSay("Lookahead="+(string)(current+(target-current)*(remaining/length))); return; } remaining-=length; current=target; } llOwnerSay("Lookahead clamped="+(string)current); } }