Difference between revisions of "LlRot2Axis"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
 
(4 intermediate revisions by 2 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=Use in conjunction with {{LSLG|llRot2Angle}}.<br/>To undo use {{LSLG|llAxisAngle2Rot}}.
|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 28: 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 );