interpolation/Cosine/Rotation
< Interpolation | Cosine
Jump to navigation
Jump to search
Revision as of 03:46, 14 September 2011 by Nexii Malthus (talk | contribs) (Created page with "{{LSL_Function |mode=user |func=rCos |p1_type=rotation|p1_name=x |p2_type=rotation|p2_name=y |p3_type=float|p3_name=t |return_type=rotation |return_value=returns the interpolatio…")
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: rotation rCos( rotation x, rotation y, float t );
Spherical-Cosine interpolation between two rotations.
Returns a rotation
• rotation | x | |||
• rotation | y | |||
• float | t |
Specification
<lsl>rotation rCos(rotation x, rotation y, float t){
float f = (1-llCos(t*PI))/2; float ang = llAngleBetween(x, y); if(ang > PI) ang -= TWO_PI; return x * llAxisAngle2Rot(llRot2Axis(y/x)*x, ang*f);
} // Released into public domain. By Nexii Malthus.</lsl>
Examples
<lsl></lsl>