From the SL Wiki:
* If the script is attached to the root prim, the entire object
rotates around theregion
<http://wiki.secondlife.com/wiki/Viewer_coordinate_frames#Region>axis.
* If the script is attached to a child prim, the prim rotates around
thelocal
<http://wiki.secondlife.com/wiki/Viewer_coordinate_frames#Local>axis.
Your first case becomes the region axis as it is using llGet"LOCAL"Rot
without the linked root prim. Avoid mixing llGetLocalRot and llRot as
if they are the same. The better syntax is your second case, which is
basically tyher same as the Wiki, which I use often to make propellors
and wheels:
//Rotates very slowly around a sphere's local X axis .... Good for
making a globe that rotates around a tilted axis
default
{
state_entry()
{
llTargetOmega(<1.0,0.0,0.0>*llGetRot(),0.1,0.01);
}
}
1. llTargetOmega : Bug or feature ? (Jeff Kelley)
----------------------------------------------------------------------
Message: 1
Date: Thu, 30 Jul 2020 22:05:42 +0200
From: Jeff Kelley<open...@pescadoo.net>
To:opensim-users@opensimulator.org
Subject: [Opensim-users] llTargetOmega : Bug or feature ?
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