Difference between revisions of "LlGetRootRotation"

From Second Life Wiki
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 object of the prim the script is attached to.
|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

Summary

Function: rotation llGetRootRotation( );

Returns a rotation that is the region rotation of the root prim of the object.

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

Deep Notes

Search JIRA for related Issues

Signature

function rotation llGetRootRotation();