Object Size

From Second Life Wiki
Revision as of 17:44, 18 October 2009 by Chase Quinnell (talk | contribs) (Created page with '{{LSL Header}} ==Object Size== Reports the dimensions and footprint of a linkset. <lsl> default { state_entry() { float temp; list box = llGetBounding...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Object Size

Reports the dimensions and footprint of a linkset.

<lsl> default {

   state_entry()
   {
       float temp;
       list box = llGetBoundingBox(llGetKey());
       vector size = llList2Vector(box, 1) * llGetRot() - llList2Vector(box, 0) * llGetRot();
       if (llAbs(llRound(size.x)) < llAbs(llRound(size.y))) {
           float temp = size.y;
           size.y = size.x;
           size.x = temp;
       }
       llOwnerSay("Your object is roughly " + (string)llAbs(llRound(size.x)) + "m long by " + (string)llAbs(llRound(size.y)) + "m wide by " + (string)llAbs(llRound(size.z)) + "m tall.");
       llOwnerSay("With an area of " + (string)llAbs(llRound(size.x*size.y)));
       llRemoveInventory(llGetScriptName());
   }

}

</lsl>