Difference between revisions of "LlGetRot"
Jump to navigation
Jump to search
Void Singer (talk | contribs) m (Added example=, also= (various)) |
|||
Line 43: | Line 43: | ||
|also_articles | |also_articles | ||
|also_footer | |also_footer | ||
|notes | |notes=llGetRot in [[Mouselook]] (see [[llForceMouselook]]) for an attachment returns the angle the avatar is looking in. | ||
|mode | |mode | ||
|deprecated | |deprecated |
Revision as of 15:40, 20 December 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: rotation llGetRot( );62 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a rotation that is the prim's rotation relative to the region plane.
Caveats
Examples
//-- rotates an object to face the nearest cardinal direction (N,E,S,W) //-- assumes build is aligned to root object facing default{ state_entry() { llSay( 0, "Rotate me in edit, then touch to make me face the nearest compass point" ); } touch_start( integer vIntTouches ) { //-- convert our rotation to x/y/z degrees vector vVecBase = llRot2Euler( llGetRot() ) * RAD_TO_DEG; //-- round the z-axis to the nearest 90deg float vFltCorrected = (float)(llRound(vVecBase.z / 90) * 90); llSetRot( llEuler2Rot( <.0, .0, vFltCorrected * DEG_TO_RAD> ) ); } }Void Singer 20:10, 6 November 2007 (PST)
Notes
llGetRot in Mouselook (see llForceMouselook) for an attachment returns the angle the avatar is looking in.
See Also
Functions
• | llGetLocalRot | |||
• | llGetRootRotation | |||
• | llGetPrimitiveParams | |||
• | llSetRot | |||
• | llSetLocalRot | |||
• | llSetPrimitiveParams | |||
• | llSetLinkPrimitiveParams |