Difference between revisions of "LlGetBoundingBox"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
{{LSL_Function
{{LSL_Function/uuid|object|sim=*}}{{LSL_Function
|func_id=277|func_sleep=0.0|func_energy=10.0
|func_id=277|func_sleep=0.0|func_energy=10.0
|func=llGetBoundingBox|return_type=list
|func=llGetBoundingBox|return_type=list
|p1_type=key|p1_name=object|p1_desc=Object or agent in the sim.
|p1_type=key|p1_name=object
|func_footnote=The bounding box is for the entire link set, not just the requested prim.<br/>Returns an empty list ([]) if object is not found.
|func_footnote=The bounding box is for the entire link set, not just the requested prim.<br/>Returns an empty list (<code>[]</code>) if '''object''' is not found.
|func_desc
|func_desc
|return_text=that is the bounding box of '''object''' relative to its root prim.<br/>Format: [ (vector) min_corner, (vector) max_corner ]
|return_text=that is the bounding box of '''object''' relative to its root prim.<br/>Format: <code>[ (vector) {{HoverText|min_corner|vector min_corner;}}, (vector) {{HoverText|max_corner|vector max_corner;}} ]</code>
|spec
|spec
|caveats=*The reported box for objects and avatars is too small by 0.1 meter in all three dimensions, missing the physics tolerance buffer. This error is retained for backward script compatibility. Subtract <0.05, 0.05, 0.05> from min_corner and add <0.05, 0.05, 0.05> to max_corner for a corrected box.
|caveats=*The reported box for objects and avatars is too small by 0.1 meter in all three dimensions, missing the physics tolerance buffer. This error is retained for backward script compatibility. Subtract <0.05, 0.05, 0.05> from min_corner and add <0.05, 0.05, 0.05> to max_corner for a corrected box.

Revision as of 09:27, 2 February 2010

Summary

Function: list llGetBoundingBox( key object );
0.0 Forced Delay
10.0 Energy

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

• key object group, avatar or prim UUID that is in the same region

The bounding box is for the entire link set, not just the requested prim.
Returns an empty list ([]) if object is not found.

Caveats

  • The reported box for objects and avatars is too small by 0.1 meter in all three dimensions, missing the physics tolerance buffer. This error is retained for backward script compatibility. Subtract <0.05, 0.05, 0.05> from min_corner and add <0.05, 0.05, 0.05> to max_corner for a corrected box.
  • For server 1.36 and up, the bounding box for an attachment is the avatar's bounding box with the 0.1 meter addition already applied.
    • Attachment bounding boxes do not include any object the avatar is sitting on.

Examples

<lsl>default//An avatar bounding box ruler thingy {

   state_entry()
   {
       llSetStatus(STATUS_PHANTOM, TRUE);
   }
   
   touch_start(integer total_number)
   {
       key target = llDetectedKey(0);
       list box = llGetBoundingBox(target);
       vector center = (llList2Vector(box, 0) + llList2Vector(box, 1)) * 0.5;
       vector size = llList2Vector(box, 1) - llList2Vector(box, 0);
       llSetPrimitiveParams([PRIM_POSITION, center, PRIM_SIZE, size]);
       llSetText("Name: " + llDetectedName(0) + ", UUID: " + (string)target + 
               "\nBounding Box Size: " + (string)size, <1.0, 1.0, 1.0>, 1.0);
   }
}</lsl>

See Also

Functions

•  llGetAgentSize

Deep Notes

Signature

function list llGetBoundingBox( key object );