From: Jesse Barnett
You hit the nail on the head with your statement before your enquiry. There is no solution that works all the time or even most of the time.
Hi, the following work-around seems to work consistently, perhaps it is useful to someone..
Please give any suggestions if there's a better way to do things, i'm not really a programmer..
The end result is:
Omega rotation starts and stops consistently, and upon stopping, the prim resets itself to default rotation (pre-omega).
things to note:
- handle all llTargetOmega calls in a separate script and invoke with link messages.
- to stop omega rotation, just reset this script, since omega rotation seems linked to the script that called it in the first place
- if the script is in a child-prim, it seems necessary to reset the prim rotation also when resetting the omega script
- to set the rotation successfully after an omega call has been made it is necessary to first offset the rotation from the current rotation
- omega script must be deleted and re-copied into any freshly linked child prim, or it wont work.
in this instance, i'm reseting rotation for root prim also but dont think its necessary
<start main script>
// LINK PROTOCOL
integer ROT_START = -100;
integer ROT_STOP = -101;
integer ON = FALSE;
default
{
state_entry()
{
llSetText("",<1.0,1.0,1.0>,1.0);
}
touch_start(integer total_number)
{
if (!ON)
{
llMessageLinked(LINK_THIS,ROT_START,"",NULL_KEY);
}
else
{
llMessageLinked(LINK_THIS,ROT_STOP,"",NULL_KEY);
}
ON = !ON;
}
}
<end main script>
<start omega script>
// LINK PROTOCOL
integer ROT_START = -100;
integer ROT_STOP = -101;
// if set rot to the current rotation after stopping omega rotation, no update of rot occur
// so slightly offset first from intended rotation
setRotPostOmega(rotation rot)
{
if (llGetLinkNumber() > 1)
{
llSetLocalRot(rot + <0.0,0.0,0.1,1.0>

;
llSleep(0.1);
llSetLocalRot(rot);
}
else
{
llSetRot(rot + <0.0,0.0,0.1,1.0>

;
llSleep(0.1);
llSetRot(rot);
}
}
default
{
state_entry()
{
setRotPostOmega(ZERO_ROTATION);
}
link_message(integer sender_number, integer number, string message, key id)
{
if (number == ROT_START)
{
llTargetOmega(<0.0,0.0,1.0>,1.0,1.0);
}
else if (number == ROT_STOP)
{
llResetScript();
}
}
}
<end omega script>
<EDIT>
one more thing, after taking and rezzing a linked set containing these scripts, the child rotations dont seem to work anymore.. perhaps could make copies of = the omega scripts in the child prims and delete the originals via lsl upon a rez.. will look into this when i have more time