// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Check a turned rectangle inside a frame // Not compiled or tested in-world // Setup: Place in a spare owned prim. Set positive artwork width/height, frame width/height and yaw. Touch for private results. // Stop / restore: Disable/remove; no scene properties change. // Notes: Tests the bounding rectangle at the chosen rotation; no search for the best angle is performed. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Planning only. float W=3.0; float H=2.0; float FRAME_W=4.0; float FRAME_H=3.0; float ANGLE=25.0; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(W<=0.0||H<=0.0||FRAME_W<=0.0||FRAME_H<=0.0) { llOwnerSay("Positive dimensions required."); return; } float a=ANGLE*DEG_TO_RAD; float width=llFabs(W*llCos(a))+llFabs(H*llSin(a)); float height=llFabs(W*llSin(a))+llFabs(H*llCos(a)); llOwnerSay("Turned bounds="+(string)+" fits="+(string)(width<=FRAME_W&&height<=FRAME_H)); } }