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
_______________________________________________
Opensim-users mailing list
Opensim-users@opensimulator.org
http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users

Reply via email to