Difference between revisions of "LlRot2Axis"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
 
(10 intermediate revisions by 3 users not shown)
Line 3: Line 3:
|func=llRot2Axis|sort=Rot2Axis
|func=llRot2Axis|sort=Rot2Axis
|return_type=vector|p1_type=rotation|p1_name=rot
|return_type=vector|p1_type=rotation|p1_name=rot
|func_footnote
|func_footnote=Use in conjunction with {{LSLG|llRot2Angle}}.<br/>To undo use {{LSLG|llAxisAngle2Rot}} or {{LSLG|llAxes2Rot}}.
|func_desc
|func_desc
|return_text=the rotation axis represented by '''rot'''
|return_text=the rotation axis represented by '''rot'''
Line 11: Line 11:
|examples
|examples
|helpers
|helpers
|also_functions=*{{LSLG|llRot2Left}}
|also_functions={{LSL DefineRow||[[llRot2Angle]]}}
*{{LSLG|llRot2Fwd}}
{{LSL DefineRow||[[llAxisAngle2Rot]]}}
*{{LSLG|llRot2Up}}
{{LSL DefineRow||[[llRot2Left]]}}
*{{LSLG|llRot2Angle}}
{{LSL DefineRow||[[llRot2Fwd]]}}
{{LSL DefineRow||[[llRot2Up]]}}
|also_tests
|also_tests
|also_events
|also_events
|also_articles=*{{LSLG|Slerp}}
|also_articles=
{{LSL DefineRow||[[Slerp]]}}
|notes
|notes
|permission
|permission
Line 26: Line 28:
|cat3
|cat3
|cat4
|cat4
|deepnotes=<source lang="lsl2">vector llRot2Axis(rotation a) {
    if(a.s < 0)
        return -llVecNorm(<a.x, a.y, a.z>);
    return llVecNorm(<a.x, a.y, a.z>)
}</source>
<source lang="lsl2">vector llRot2Axis(rotation a) {
    return llVecNorm(<a.x, a.y, a.z>) * (1 | -(a.s < 0));
}</source>
}}
}}

Latest revision as of 13:34, 22 January 2015

Summary

Function: vector llRot2Axis( rotation rot );
0.0 Forced Delay
10.0 Energy

Returns a vector the rotation axis represented by rot

• rotation rot

Use in conjunction with llRot2Angle.
To undo use llAxisAngle2Rot or llAxes2Rot.

Examples

See Also

Functions

•  llRot2Angle
•  llAxisAngle2Rot
•  llRot2Left
•  llRot2Fwd
•  llRot2Up

Articles

•  Slerp

Deep Notes

vector llRot2Axis(rotation a) {
    if(a.s < 0)
        return -llVecNorm(<a.x, a.y, a.z>);
    return llVecNorm(<a.x, a.y, a.z>)
}
vector llRot2Axis(rotation a) {
    return llVecNorm(<a.x, a.y, a.z>) * (1 | -(a.s < 0));
}

Signature

function vector llRot2Axis( rotation rot );