Difference between revisions of "LlGetBoundingBox"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
(attachments and avatars) |
(I was thinking about avatars too much. All the bounding boxes are too small.) |
||
Line 7: | Line 7: | ||
|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: [ (vector) min_corner, (vector) max_corner ] | ||
|spec | |spec | ||
|caveats=* | |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. | *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. | ** Attachment bounding boxes do ''not'' include any object the avatar is sitting on. |
Revision as of 07:05, 26 January 2010
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: list llGetBoundingBox( key object );277 | Function ID |
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 | – | Object or agent in the sim. |
The bounding box is for the entire link set, not just the requested prim.
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 |