Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

What's the proper way to do a constant rotation?

Astro Raymaker
Registered User
Join date: 25 Mar 2007
Posts: 1
04-22-2007 09:06
Found the llTargetOmega function myself,

I'm new to SL scripting and would like some advice from the more experianced scripters.
I can make an object rotate constantly by calculating the rotation vectors 1 Deg_to_Rad at a time and then using the llSetLocalRot function, placing this in a TRUE while loop. While this works, it doesn't seem very efficient to me. Is there a better way?
Thanks
=============================
float Rdeg = 0.0;
vector Vdeg = <0,0,0>;

default
{
state_entry()
{
while (TRUE)
{
if (Rdeg > 6.27) Rdeg = 0;
else Rdeg += DEG_TO_RAD;
llSetLocalRot(llEuler2Rot((vector)<0,0,Rdeg>;));
}
}
}
===============================
Simil Miles
Creator
Join date: 1 Mar 2007
Posts: 300
04-22-2007 11:27
It's llTargetOmega
_____________________
UnConWTech @ Flo (144, 84, 224) http://unconwtech.free.fr

SL books http://astore.amazon.com/secondlife-sl-20/

Need a beta tester for quality assurance ?
Need a translator for English, French, Spanish ?