// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Limit a full3D pose change by angular speed // Not compiled or tested in-world // Setup: Use a spare owned prim. Set Euler current/target, positive MAX_SPEED and nonnegative DT. Touch for private calculations. // Stop / restore: Disable/remove. No camera or object settings are changed. // Notes: Uses the minimum rotation path and clamps to the target when the budget is sufficient. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Transform planning only. vector CURRENT=<10.0,15.0,20.0>; vector TARGET=<70.0,-20.0,100.0>; float MAX_SPEED=45.0; float DT=0.2; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(MAX_SPEED<=0.0||DT<0.0) { llOwnerSay("Invalid rate/time."); return; } rotation a=llEuler2Rot(CURRENT*DEG_TO_RAD); rotation b=llEuler2Rot(TARGET*DEG_TO_RAD); rotation delta=b/a; float angle=llRot2Angle(delta); if(angle<0.000001) { llOwnerSay("Already at target."); return; } float step=MAX_SPEED*DEG_TO_RAD*DT; if(step>angle)step=angle; rotation result=llAxisAngle2Rot(llRot2Axis(delta),step)*a; llOwnerSay("Next rotation="+(string)result+" fraction="+(string)(step/angle)); } }