Difference between revisions of "LlGetRootPosition"
Jump to navigation
Jump to search
m (typo of script as scipt) |
m (<lsl> tag to <source>) |
||
Line 9: | Line 9: | ||
|constants | |constants | ||
|examples= | |examples= | ||
< | <source lang="lsl2"> | ||
default{ | default{ | ||
touch_start( integer vIntTouched ){ | touch_start( integer vIntTouched ){ | ||
Line 19: | Line 19: | ||
} | } | ||
} | } | ||
</ | </source> | ||
|helpers= | |helpers= | ||
< | <source lang="lsl2"> | ||
//-- there is no llSetLocalPos, this adds the functionality | //-- there is no llSetLocalPos, this adds the functionality | ||
//-- to match llGetLocalPos() in a child prim | //-- to match llGetLocalPos() in a child prim | ||
Line 29: | Line 29: | ||
//-- this will move a root prim by the offset, or set the | //-- this will move a root prim by the offset, or set the | ||
//-- position of a child prim relative to the root. | //-- position of a child prim relative to the root. | ||
</ | </source> | ||
|also_functions= | |also_functions= | ||
{{LSL DefineRow||[[llGetLocalPos]]|Gets the child prims position relative to the root}} | {{LSL DefineRow||[[llGetLocalPos]]|Gets the child prims position relative to the root}} |
Latest revision as of 02:48, 22 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: vector llGetRootPosition( );268 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a vector that is the region position of the root object of the object script is attached to
Caveats
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 |