User:Dora Gustafson/Replacing llTargetOmega/function
< User:Dora Gustafson | Replacing llTargetOmega
Jump to navigation
Jump to search
Revision as of 17:17, 22 October 2022 by Gwyneth Llewelyn (talk | contribs) (→Replacing llTargetOmega, the function: Replaced <source> with <syntaxhighlight>)
Replacing llTargetOmega, the function
KeyFramedOmega( vector axis, float spinrate)
{
llSetKeyframedMotion( [], []);
if ( spinrate )
{
float v = TWO_PI/3.0;
if ( spinrate < 0 ) v = -v;
list L = [llAxisAngle2Rot( axis/llGetRot(), v), v/spinrate];
llSetKeyframedMotion( L+L+L, [KFM_DATA, KFM_ROTATION, KFM_MODE, KFM_LOOP]);
}
}