Difference between revisions of "LlRot2Axis"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
 
Line 28: Line 28:
|cat3
|cat3
|cat4
|cat4
|deepnotes=<lsl>vector llRot2Axis(rotation a) {
|deepnotes=<source lang="lsl2">vector llRot2Axis(rotation a) {
     if(a.s < 0)
     if(a.s < 0)
         return -llVecNorm(<a.x, a.y, a.z>);
         return -llVecNorm(<a.x, a.y, a.z>);
     return llVecNorm(<a.x, a.y, a.z>)
     return llVecNorm(<a.x, a.y, a.z>)
}</lsl>
}</source>


<lsl>vector llRot2Axis(rotation a) {
<source lang="lsl2">vector llRot2Axis(rotation a) {
     return llVecNorm(<a.x, a.y, a.z>) * (1 | -(a.s < 0));
     return llVecNorm(<a.x, a.y, a.z>) * (1 | -(a.s < 0));
}</lsl>
}</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 );