Difference between revisions of "LlSitTarget"

From Second Life Wiki
Jump to navigation Jump to search
Line 22: Line 22:
</pre>
</pre>
|helpers=<pre>
|helpers=<pre>
//Sets / Updates the sit target moving the avatar on it if necessary.
UpdateSitTarget(vector pos, rotation rot)
UpdateSitTarget(vector pos, rotation rot)
{
{
Line 31: Line 32:
}//Written by Strife Onizuka
}//Written by Strife Onizuka


//Gets the link number of a seated avatar
integer GetAgentLinkNumber(key c)
integer GetAgentLinkNumber(key c)
{
{

Revision as of 10:45, 28 April 2007

Summary

Function: llSitTarget( vector offset, rotation rot );

Set the sit location for this object (if offset == <0.0, 0.0, 0.0> clear it)

• vector offset
• rotation rot

Examples

default
{
    state_entry()
    {
        llSitTarget(<0.0, 0.0, 1.0>, ZERO_ROTATION); //The vector's components must not all be set to 0 for effect to take place.
    }
}

Useful Snippets

//Sets / Updates the sit target moving the avatar on it if necessary.
UpdateSitTarget(vector pos, rotation rot)
{
    key a = llAvatarOnSitTarget();
    if(a)
        llSetLinkPrimitiveParams(GetAgentLinkNumber(a), [PRIM_POSITION, llGetLocalPos() + (pos * llGetLocalRot()),
                                                         PRIM_ROTATION, rot *llGetLocalRot()]);
    llSitTarget(pos, rot);
}//Written by Strife Onizuka

//Gets the link number of a seated avatar
integer GetAgentLinkNumber(key c)
{
    integer a = -~llGetNumberOfPrims();
    key b;
    if(a > 2)
        while(llGetAgentSize(b = llGetLinkKey(a = ~-a)))
            if(b == c)
                return a;
    return 0;
}//Written by Strife Onizuka

See Also

Events

•  changed

Functions

•  llSetSitText
•  llAvatarOnSitTarget
•  llUnSit

Deep Notes

Search JIRA for related Issues

Signature

function void llSitTarget( vector offset, rotation rot );