Difference between revisions of "LlGetLocalPos"

From Second Life Wiki
Jump to navigation Jump to search
m (formatted example)
Line 13: Line 13:
There is no llSetLocalPos function.
There is no llSetLocalPos function.
To set the position of a root prim local to itself you would have to do something like:
To set the position of a root prim local to itself you would have to do something like:
<pre>
<lsl>
SetLocalPosition(vector local_position)
SetLocalPosition(vector local_position)
{
{
Line 20: Line 20:
   llSetPos(absolute_position);
   llSetPos(absolute_position);
}
}
</pre>
</lsl>
|also_functions={{LSL DefineRow||[[llGetPos]]|Gets the root prim global position}}
|also_functions={{LSL DefineRow||[[llGetPos]]|Gets the root prim global position}}
{{LSL DefineRow||[[llSetPos]]|Sets the prim position}}
{{LSL DefineRow||[[llSetPos]]|Sets the prim position}}

Revision as of 20:42, 18 February 2008

Summary

Function: vector llGetLocalPos( );

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.

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: <lsl> SetLocalPosition(vector local_position) {

  vector root_position = llGetPos();
  vector absolute_position = root_position + local_position;
  llSetPos(absolute_position);

} </lsl>

See Also

Functions

•  llGetPos Gets the root prim global position
•  llSetPos Sets the prim position

Deep Notes

Search JIRA for related Issues

Signature

function vector llGetLocalPos();