Difference between revisions of "LlSitTarget"

From Second Life Wiki
Jump to navigation Jump to search
Line 21: Line 21:
}
}
</pre>
</pre>
|helpers
|helpers=<pre>
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
 
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
</pre>
|also_functions={{LSL DefineRow||{{LSLG|llSetSitText}}|}}
|also_functions={{LSL DefineRow||{{LSLG|llSetSitText}}|}}
{{LSL DefineRow||{{LSLG|llAvatarOnSitTarget}}|}}
{{LSL DefineRow||{{LSLG|llAvatarOnSitTarget}}|}}

Revision as of 10:08, 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

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

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 );