A simple modified example from the scripting WIKI:
setrot(integer a)
{
vector eul = <0, 0, a>;
eul *= DEG_TO_RAD;
rotation quat = llEuler2Rot(eul);
llSetRot(quat);
}
Calling ' setrot(90); ' will set the z rotation to 90 degrees.
I also want to get the current 'y' rotation in vector form and pass it into this function.
setrot(integer a)
{
vector currot = ?????? //define currot in vector form
vector eul = <0, currot.y, a>;
eul *= DEG_TO_RAD;
rotation quat = llEuler2Rot(eul);
llSetRot(quat);
}
Basically I want to rotate an object on its z axis as defined by ' a ' while preserving the current 'y' rotation.
I could probally figure it out if the grid was online, but ah well.. Thanks in advance for your help.