Difference between revisions of "LlGetBoundingBox"
Jump to navigation
Jump to search
(Added an example, although I am not sure if it is the best possible demonstration of the function.) |
|||
Line 9: | Line 9: | ||
|caveats | |caveats | ||
|constants | |constants | ||
|examples | |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> | |||
|helpers | |helpers | ||
|also_functions={{LSL DefineRow||[[llGetAgentSize]]|}} | |also_functions={{LSL DefineRow||[[llGetAgentSize]]|}} |
Revision as of 14:51, 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>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 |