Difference between revisions of "Interpolation/Cosine/Rotation"

From Second Life Wiki
Jump to navigation Jump to search
(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…")
 
m (<lsl> tag to <source>)
 
Line 9: Line 9:
|func_desc=
|func_desc=
Spherical-Cosine interpolation between two rotations.
Spherical-Cosine interpolation between two rotations.
|spec=<lsl>rotation rCos(rotation x, rotation y, float t){
|spec=<source lang="lsl2">rotation rCos(rotation x, rotation y, float t){
     float f = (1-llCos(t*PI))/2;
     float f = (1-llCos(t*PI))/2;
     float ang = llAngleBetween(x, y);
     float ang = llAngleBetween(x, y);
Line 15: Line 15:
     return x * llAxisAngle2Rot(llRot2Axis(y/x)*x, ang*f);
     return x * llAxisAngle2Rot(llRot2Axis(y/x)*x, ang*f);
}
}
// Released into public domain. By Nexii Malthus.</lsl>
// Released into public domain. By Nexii Malthus.</source>
|examples=<lsl></lsl>
|examples=<source lang="lsl2"></source>
|cat1=Examples
|cat1=Examples
}}
}}

Latest revision as of 16:01, 24 January 2015