Difference between revisions of "LlSetLocalRot"

From Second Life Wiki
Jump to navigation Jump to search
m (+equivalent link call)
m (added some also and tweaked the previous helper)
Line 29: Line 29:
<lsl>//-- this is an equivalent call from any prim in the same link set
<lsl>//-- this is an equivalent call from any prim in the same link set
llSetLinkPrimitiveParamsFast( target_prim, [PRIM_ROT_LOCAL, rot] );
llSetLinkPrimitiveParamsFast( target_prim, [PRIM_ROT_LOCAL, rot] );
//-- where "target_prim" is the link number of the prim you want the local rotation of</lsl>
//-- where "target_prim" is the link number of the prim you want to set the local rotation of</lsl>
|also_functions={{LSL DefineRow||[[llSetRot]]|}}
|also_functions=
{{LSL DefineRow||[[llGetRot]]|}}
{{LSL DefineRow||[[llGetRot]]|}}
{{LSL DefineRow||[[llGetLocalRot]]|}}
{{LSL DefineRow||[[llGetLocalRot]]|}}
{{LSL DefineRow||[[llGetRootRotation]]|}}
{{LSL DefineRow||[[llGetRootRotation]]|}}
{{LSL DefineRow||[[llGetPrimitiveParams]]|}}
{{LSL DefineRow||[[llGetLinkPrimitiveParams]]|}}
{{LSL DefineRow||[[llSetRot]]|}}
{{LSL DefineRow||[[llSetPrimitiveParams]]|}}
{{LSL DefineRow||[[llSetLinkPrimitiveParams]]|}}
{{LSL DefineRow||[[llSetLinkPrimitiveParamsFast]]|}}
|also_tests
|also_tests
|also_events
|also_events

Revision as of 02:25, 24 October 2010

Summary

Function: llSetLocalRot( rotation rot );

Sets the rotation of a child prim relative to the root prim

• rotation rot

Caveats

  • This function causes the script to sleep for 0.2 seconds.
All Issues ~ Search JIRA for related Bugs

Examples

Drop this script in a prim* to rotate it in 1 degree increments. *This prim must be attached as child of a root prim. <lsl>rotation rot_xyzq;

default {

   state_entry()
   {
       vector xyz_angles = <0,1.0,0>; // This is to define a 1 degree change
       vector angles_in_radians = xyz_angles*DEG_TO_RAD; // Change to Radians
       rot_xyzq = llEuler2Rot(angles_in_radians); // Change to a Rotation
   }

   touch_start(integer s)
   {
       llSetLocalRot(llGetLocalRot()*rot_xyzq); //Do the Rotation...

   }
}</lsl>

Useful Snippets

<lsl>//-- this is an equivalent call from any prim in the same link set llSetLinkPrimitiveParamsFast( target_prim, [PRIM_ROT_LOCAL, rot] ); //-- where "target_prim" is the link number of the prim you want to set the local rotation of</lsl>

Deep Notes

Search JIRA for related Issues

Signature

function void llSetLocalRot( rotation rot );