Difference between revisions of "LlGetBoundingBox"
Jump to navigation
Jump to search
(How about a avatar ruler type of thing instead? remotely useful and shows how to get the center and size of the box) |
m |
||
Line 23: | Line 23: | ||
vector size = llList2Vector(box, 1) - llList2Vector(box, 0); | vector size = llList2Vector(box, 1) - llList2Vector(box, 0); | ||
llSetPrimitiveParams([PRIM_POSITION, center, PRIM_SIZE, size]); | 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); | llSetText("Name: " + llDetectedName(0) + ", UUID: " + (string)target + | ||
"\nBounding Box Size: " + (string)size, <1.0, 1.0, 1.0>, 1.0); | |||
} | } | ||
}</lsl> | }</lsl> |
Revision as of 19:43, 16 June 2008
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 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.
Caveats
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 |