Difference between revisions of "LlGetLocalPos"
Jump to navigation
Jump to search
Anylyn Hax (talk | contribs) |
|||
Line 3: | Line 3: | ||
|func=llGetLocalPos|sort=GetLocalPos | |func=llGetLocalPos|sort=GetLocalPos | ||
|return_type=vector | |return_type=vector | ||
|func_footnote | |func_footnote=If called from the root prim it returns the [[Viewer coordinate frames#Region|position in the region]] unless it is [[llGetAttached|attached]] to which it returns the position relative to the [[Viewer coordinate frames#Attachments|attach point]]. | ||
|func_desc | |func_desc | ||
|return_text=that is the position relative | |return_text=that is the position relative ([[Viewer coordinate frames#Local|local]]) to the root. | ||
|spec | |spec | ||
|caveats | |caveats | ||
|constants | |constants | ||
|examples= | |examples | ||
|helpers= | |||
There is no llSetLocalPos function. | |||
To set the position of a root prim local to itself you would have to do something like: | |||
<pre> | |||
SetLocalPosition(vector local_position) | SetLocalPosition(vector local_position) | ||
{ | { | ||
Line 19: | Line 19: | ||
vector absolute_position = root_position + local_position; | vector absolute_position = root_position + local_position; | ||
llSetPos(absolute_position); | llSetPos(absolute_position); | ||
} | } | ||
</pre> | </pre> | ||
|also_functions | |also_functions | ||
|also_tests | |also_tests |
Revision as of 16:52, 31 July 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: vector llGetLocalPos( );60 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a vector that is the position relative (local) to the root.
If called from the root prim it returns the position in the region unless it is attached to which it returns the position relative to the attach point.
Caveats
Examples
Useful Snippets
There is no llSetLocalPos function. To set the position of a root prim local to itself you would have to do something like:
SetLocalPosition(vector local_position) { vector root_position = llGetPos(); vector absolute_position = root_position + local_position; llSetPos(absolute_position); }