llGetRootPosition

From Second Life Wiki
Revision as of 02:48, 22 January 2015 by ObviousAltIsObvious Resident (talk | contribs) (<lsl> tag to <source>)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Summary

Function: vector llGetRootPosition( );

Returns a vector that is the region position of the root object of the object script is attached to

Examples

default{
  touch_start( integer vIntTouched ){
    string vStrMessage = "The prim with this script is ";
    if (llGetPos() != llGetRootPosition()){
      vStrMessage += "NOT ";
    }
    llSay( PUBLIC_CHANNEL, vStrMessage + "centered on the root prim." );
  }
}

Useful Snippets

//-- there is no llSetLocalPos, this adds the functionality
//-- to match llGetLocalPos() in a child prim
fSetLocalPos( vector vPosOffset ){
  llSetPos( llGetRootPosition() + vPosOffset );
}
//-- this will move a root prim by the offset, or set the
//-- position of a child prim relative to the root.

See Also

Functions

•  llGetLocalPos Gets the child prims position relative to the root
•  llGetPos Gets the prims global position
•  llSetPos Sets the prims global position

Deep Notes

Search JIRA for related Issues

Signature

function vector llGetRootPosition();