Difference between revisions of "LlRot2Angle"

From Second Life Wiki
Jump to navigation Jump to search
Line 17: Line 17:
{{LSL DefineRow||[[llRot2Fwd]]}}
{{LSL DefineRow||[[llRot2Fwd]]}}
{{LSL DefineRow||[[llRot2Left]]}}
{{LSL DefineRow||[[llRot2Left]]}}
{{LSL DefineRow||[[llAngleBetween]]|Similar functionality.}}
|also_tests
|also_tests
|also_events
|also_events

Revision as of 23:51, 15 March 2009

Summary

Function: float llRot2Angle( rotation rot );

Returns a float that is the rotation angle represented by rot

• rotation rot

Use in conjunction with llRot2Axis.
To undo use llAxisAngle2Rot.

Caveats

This always returns a positive angle <= PI radians, that is, it is the unsigned minimum angle. A rotation of 3/2 PI radians (270 degrees) will return an angle of PI / 2 radians, not -PI / 2.

All Issues ~ Search JIRA for related Bugs

Examples

See Also

Functions

•  llAxisAngle2Rot
•  llRot2Axis
•  llRot2Up
•  llRot2Fwd
•  llRot2Left
•  llAngleBetween Similar functionality.

Deep Notes

<lsl>float llRot2Angle(rotation a) {

   return llAcos(a.s / llSqrt(a.x * a.x + a.y * a.y + a.z * a.z + a.s * a.s)) * 2.0;

}</lsl>

Search JIRA for related Issues

Signature

function float llRot2Angle( rotation rot );