Difference between revisions of "LlSitTarget"
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
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llSitTarget( vector offset, rotation rot );238 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Set the sit location for this object (if offset == <0.0, 0.0, 0.0> clear it)
• vector | offset | |||
• rotation | rot |
Caveats
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