This is for a game I'm making and it will need to interact with physical objects so I can't use the omega functions.
Basically I want a spinning flap that always spins end over end. The problem is when I set it to spin correctly, if I change the orientation of it, it spins in crazy ways because apparently it's spinning relative to the world axes and not its own.
I'm afraid if I leave it like that the final orientation of the game will matter, which is not very desirable.
Here's what I have so far:
CODE
default
{
state_entry()
{
llSetTimerEvent(0.5);
}
timer()
{
rotation rot=llGetRot();
vector eul = <5,0,0>; //5 degrees per cycle
eul *= DEG_TO_RAD; //convert to radians
rotation spin = llEuler2Rot(eul); //convert to quaternion
llSetLocalRot(spin*rot);
}
}