Difference between revisions of "LlSetLocalRot"
Jump to navigation
Jump to search
m (Added to Category:LSL_Rotation) |
VictorH Enzo (talk | contribs) |
||
Line 8: | Line 8: | ||
|caveats | |caveats | ||
|constants | |constants | ||
|examples | |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 degee 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(llGetRot()*rot_xyzq); //Do the Rotation... | |||
} | |||
}</lsl> | |||
|helpers | |helpers | ||
|also_functions={{LSL DefineRow||[[llSetRot]]|}} | |also_functions={{LSL DefineRow||[[llSetRot]]|}} |
Revision as of 21:26, 25 June 2008
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: llSetLocalRot( rotation rot );284 | Function ID |
0.2 | Forced Delay |
10.0 | Energy |
Sets the rotation of a child prim relative to the root prim
• rotation | rot |
Caveats
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 degee 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(llGetRot()*rot_xyzq); //Do the Rotation... }}</lsl>
See Also
Functions
• | llSetRot | |||
• | llGetRot | |||
• | llGetLocalRot | |||
• | llGetRootRotation |