llGetBoundingBox

From Second Life Wiki
Revision as of 14:51, 16 June 2008 by Meyermagic Salome (talk | contribs) (Added an example, although I am not sure if it is the best possible demonstration of the function.)
Jump to navigation Jump to search

Summary

Function: list llGetBoundingBox( key object );

Returns a list that is the bounding box of object relative to it's root prim.
Format: [ (vector) min_corner, (vector) max_corner ]

• key object Object or agent in the sim.

The bounding box is for the entire link set, not just the requested prim.

Examples

<lsl>vector min = <1, 1, 1>;

default {

   touch_start(integer total_number)
   {
       llSensor("", NULL_KEY, PASSIVE, 96.0, PI);
   }
   sensor(integer num_detected)
   {
       list box;
       integer i;
       for(i; i < num_detected; ++i)
       {
           box = llGetBoundingBox(llDetectedKey(i));
           if(llVecDist(llList2Vector(box, 0), llList2Vector(box, 1)) > llVecMag(min))
           {
               llOwnerSay(llDetectedName(i) + "'s diagonal is longer than " + (string)llVecMag(min) + " meters.");
           }
       }
   }
}</lsl>

See Also

Functions

•  llGetAgentSize

Deep Notes

Search JIRA for related Issues

Signature

function list llGetBoundingBox( key object );