[Opensim-users] llTargetOmega : Bug or feature ?

Jeff Kelley opensim at pescadoo.net
Thu Jul 30 20:05:42 UTC 2020


Try the following :

Rez a cylinder, throw this script in :

default
{
     state_entry()
     {
         llTargetOmega ( llRot2Up(llGetLocalRot()), 1, 1);
     }
}


Now, edit the spinning cylinder. Change it's orientation.

The prim continues spinning around what was his up axis prior to edition.

Not quite surprising. Motion is client-side and client has not been 
telled to recalculate the motion. Or should it ? Anyway, resetting 
the script should fix things, yes ?

No. Once the prim have been rotated manually, llTargetOmega will not 
spin it again correctly.

Bug or feature ?


Here is a work-around :

Force rotation to current value with llSetRot. As this won't work 
(cache effect ?) , force it to a slightly different value, then to 
the desired value again. Wait a short time between (i guess updates 
are coalesced).

default {

     state_entry() {
         rotation rot = llGetRot();
         llSetRot (rot + <0.01,0.01,0.01,0.01>);
         llSleep (0.1);
         llSetRot (rot);

         llTargetOmega ( llRot2Up(llGetLocalRot()), 1, 1);
     }
}


Any thoughts ?



-- Jeff


More information about the Opensim-users mailing list