Difference between revisions of "LlSetLocalRot"
Jump to navigation
Jump to search
Rolig Loon (talk | contribs) |
Lady Sumoku (talk | contribs) m (Replaced old <LSL> block with <source lang="lsl2">) |
||
Line 9: | Line 9: | ||
|constants | |constants | ||
|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. | |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. | ||
< | <source lang="lsl2">rotation rot_xyzq; | ||
default | default | ||
Line 25: | Line 25: | ||
} | } | ||
}</ | }</source> | ||
|helpers= | |helpers= | ||
< | <source lang="lsl2">//-- 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 to set the local rotation of</ | //-- where "target_prim" is the link number of the prim you want to set the local rotation of</source> | ||
|also_functions= | |also_functions= | ||
{{LSL DefineRow||[[llGetRot]]|}} | {{LSL DefineRow||[[llGetRot]]|}} |
Revision as of 14:26, 22 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llSetLocalRot( rotation rot );0.2 | Forced Delay |
10.0 | Energy |
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.
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.
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...
}
}
Useful Snippets
//-- 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