Difference between revisions of "LlGetAgentSize"

From Second Life Wiki
Jump to navigation Jump to search
(moved the last change into the description and added some to the notes.)
Line 2: Line 2:
|func_id=218|func_sleep=0.0|func_energy=10.0
|func_id=218|func_sleep=0.0|func_energy=10.0
|func=llGetAgentSize|return_type=vector|p1_type=key|p1_name=id
|func=llGetAgentSize|return_type=vector|p1_type=key|p1_name=id
|func_footnote=The agent '''id''' must be in the same region as the requesting object, {{LSL Const|ZERO_VECTOR|vector|{{LSL VR|0.0|0.0|0.0}}}} is returned if not.
|func_footnote={{LSL Const|ZERO_VECTOR|vector|{{LSL VR|0.0|0.0|0.0}}}} is returned if '''id''' is not in the region or if it is not an avatar.
|func_desc
|func_desc
|return_text=that is the size of the requested avatar by '''id'''.
|return_text=that is the size of the requested avatar by '''id'''.
Line 33: Line 33:
|also_articles
|also_articles
|notes=
|notes=
* This is a good way to test if an av is in the same region.  
* This is a good way to quickly test...
** if an av is in the same region.
** if a UUID known to be in the region is an avatar.
* The returned vector holds the size of the avatar's bounding box, of which only the height (z) varies. Width (x) and depth (y) are constant. (0.45m and 0.6m respectively).
* The returned vector holds the size of the avatar's bounding box, of which only the height (z) varies. Width (x) and depth (y) are constant. (0.45m and 0.6m respectively).
* [[ZERO_VECTOR]] is returned in case '''id''' is not an avatar.
|cat1
|cat1
|cat2=Avatar
|cat2=Avatar

Revision as of 23:48, 5 October 2008

Summary

Function: vector llGetAgentSize( key id );

Returns a vector that is the size of the requested avatar by id.

• key id avatar UUID that is in the same region

ZERO_VECTOR is returned if id is not in the region or if it is not an avatar.

Examples

<lsl>//A simple script that makes a box hover above the owner's head. default {

   state_entry(integer i) {
       key owner = llGetOwner();
       vector pos = llList2Vector(llGetObjectDetails(owner, [OBJECT_POS]),0);
       vector agent = llGetAgentSize(owner);
       pos.z += 0.5 + agent.z / 2;//"pos" needs to be adjusted so it appears above the owner.
       if(agent)//makes sure it found the owner, a zero vector evaluates as false
           llSetPos(pos);
   }
   touch_start(integer num) {
       llResetScript();
   }
}</lsl>

Notes

  • This is a good way to quickly test...
    • if an av is in the same region.
    • if a UUID known to be in the region is an avatar.
  • The returned vector holds the size of the avatar's bounding box, of which only the height (z) varies. Width (x) and depth (y) are constant. (0.45m and 0.6m respectively).

See Also

Deep Notes

Search JIRA for related Issues

Signature

function vector llGetAgentSize( key id );