Difference between revisions of "LlGetAgentSize"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
{{LSL_Function
{{LSL Function/avatar|id|sim=*}}{{LSL_Function
|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
Line 28: Line 28:
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||[[llGetObjectDetails]]|}}
{{LSL DefineRow||[[llGetBoundingBox]]|}}
{{LSL DefineRow||[[llGetBoundingBox]]|}}
{{LSL DefineRow||[[llGetAgentInfo]]|}}
{{LSL DefineRow||[[llGetAgentInfo]]|}}

Revision as of 08:04, 12 November 2007

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

The agent id must be in the same region as the requesting object, ZERO_VECTOR is returned if not.

Examples

//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_POSITION]),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();
    }
}

Notes

This is a good way to test if an av is in the same region.

See Also

Deep Notes

Search JIRA for related Issues

Signature

function vector llGetAgentSize( key id );