LlGetPos: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
Link also with llGetRegionName ... and sort the links, since otherwise I see no pattern in that list
m added function "sort" parameter so entry appears in correct section in category page
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|func_id=59|func_sleep=0.0|func_energy=10.0
|func_id=59|func_sleep=0.0|func_energy=10.0
|func=llGetPos
|func=llGetPos|sort=GetPos
|return_type=vector
|return_type=vector
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text=that is the prim's [[Viewer coordinate frames#Region|region]] position
|return_text=that is the the position of the task in [[Viewer coordinate frames#Region|region]] coordinates
|spec
|spec
|caveats
|caveats=*When called from the root of an attachment, returns the wearer's position. When called in any child prim, always returns that prim's region position.
|constants
|constants
|examples=<lsl>
|examples=<lsl>
Line 27: Line 27:
{{LSL DefineRow||[[llGetLocalPos]]|Gets the prim [[Viewer coordinate frames#Local|local]] position}}
{{LSL DefineRow||[[llGetLocalPos]]|Gets the prim [[Viewer coordinate frames#Local|local]] position}}
{{LSL DefineRow||[[llGetPrimitiveParams]]|Gets prim properties}}
{{LSL DefineRow||[[llGetPrimitiveParams]]|Gets prim properties}}
{{LSL DefineRow||[[llGetRegionName]]|Gets the [[Viewer coordinate frames#Region|region]] name of the prim position}}
{{LSL DefineRow||[[llGetRootPosition]]|Gets the root prims position}}
{{LSL DefineRow||[[llGetRootPosition]]|Gets the root prims position}}
{{LSL DefineRow||[[llSetPos]]|Sets the prim position}}
{{LSL DefineRow||[[llSetPos]]|Sets the prim position}}

Revision as of 06:06, 24 November 2009

Summary

Function: vector llGetPos( );
0.0 Forced Delay
10.0 Energy

Returns a vector that is the the position of the task in region coordinates

Caveats

  • When called from the root of an attachment, returns the wearer's position. When called in any child prim, always returns that prim's region position.

Examples

<lsl> default {

   touch_start(integer total_number)
   {
       // When touched, check the position of
       // the object, save it to "position",
       // then convert it into a string and
       // say it.
       vector position = llGetPos();
       llSay(0, (string)position);
   }

}

</lsl>

See Also

Functions

•  llGetLocalPos Gets the prim local position
•  llGetPrimitiveParams Gets prim properties
•  llGetRootPosition Gets the root prims position
•  llSetPos Sets the prim position
•  llSetPrimitiveParams Sets prim properties
•  llSetLinkPrimitiveParams Sets linked prim properties

Deep Notes

Signature

function vector llGetPos();