Difference between revisions of "LlGetRootRotation"
Jump to navigation
Jump to search
m (Linked to Prim) |
(Added example and note about attached objects) |
||
Line 4: | Line 4: | ||
|func_footnote | |func_footnote | ||
|func_desc | |func_desc | ||
|return_text=that is the [[Viewer coordinate frames#Region|region]] rotation of the root | |return_text=that is the [[Viewer coordinate frames#Region|region]] rotation of the root prim of the [[Object|object]]. | ||
|spec | |spec | ||
|caveats | |caveats | ||
|constants | |constants | ||
|examples | |examples= | ||
Simple example to set region rotation of child prim in unattached link set | |||
<lsl> | |||
default | |||
{ | |||
state_entry() | |||
{ | |||
//Rotate 45 degrees about Y-axis | |||
rotation globalRot = llEuler2Rot(<0.0, 45.0, 0.0> * DEG_TO_RAD); | |||
llSetLocalRot(globalRot / llGetRootRotation()); | |||
} | |||
} | |||
</lsl> | |||
|helpers | |helpers | ||
|also_functions= | |also_functions= | ||
Line 16: | Line 28: | ||
|also_tests | |also_tests | ||
|also_articles | |also_articles | ||
|notes | |notes=In an attached object, returns region rotation of avatar NOT of the object's root prim. See [[Rotation#Single_or_Root_Prims_vs_Linked_Prims_vs_Attachments|special cases of rotation]]. | ||
|permission | |permission | ||
|negative_index | |negative_index |
Revision as of 14:37, 1 May 2009
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: rotation llGetRootRotation( );269 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a rotation that is the region rotation of the root prim of the object.
Caveats
Examples
Simple example to set region rotation of child prim in unattached link set <lsl> default {
state_entry() { //Rotate 45 degrees about Y-axis rotation globalRot = llEuler2Rot(<0.0, 45.0, 0.0> * DEG_TO_RAD); llSetLocalRot(globalRot / llGetRootRotation()); }
}
</lsl>Notes
In an attached object, returns region rotation of avatar NOT of the object's root prim. See special cases of rotation.
See Also
Functions
• | llGetLocalRot | |||
• | llGetRot |