Jump to content

llTargetOmega Always Stop at Certain Rotation


Tanshin Denothar
 Share

You are about to reply to a thread that has been inactive for 4715 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Is there a way to have an llTargetOmega rotation that will always stop rotating at one spot? Specifically, is there a way to make it continually slow down until it reaches that point from when an object was touched?

For example: An object is rotating around the X-axis and it is touched when the rotation is at 134,0,0. The object needs to stop rotating in 5 seconds and stop at 0,0,0.

Can a script be made to determine a number of steps required to bring that object to a stop at 0,0,0 gradually in 5 seconds, etc?

Link to comment
Share on other sites

No.  llTargetOmega is a client-side effect for non-physical objects, which means that all rotation is happening on your computer, not in SL's servers.  Each person viewing the effect is potentially seeing it at a different point in the rotation too.  When you stop a llTargetOmega rotation, you see the object right where it was before you started, because that's where it really is, in SL's servers.

The only way to beat the problem is to do a series of llSetRot or llSetLocalRot steps to update the object's actual rotation while llTargetOmega is doing its thing.  That way, when the rotation stops it will be wherever you told the servers to rotate it to.  This is the technique that's used in the Smooth Rotating Door, for example.  It works nicely when you simply want to open a door by 90 degrees and then close it again.  For your application, though, it will be much tricker.  Take a look at it anyway, though.  You might get a clever idea from it.

Link to comment
Share on other sites

Kind of.

Something like this may work for you, but if you give me more info about the application Ic ould probably help more:

rotation rDefault;rotation rTwo = <-0.000, 1.00000, 0.00000, 0.000>;SmoothRotate3(rotation One,rotation Two){    rotation Temp = Two / One;    vector DTemp = llRot2Axis(Temp);    float Speed = 15.0;float Dist = llAngleBetween(One,Two) * RAD_TO_DEG;    llTargetOmega(DTemp,Speed * DEG_TO_RAD,1.0);    llSleep( (Dist / Speed) );    llTargetOmega(<0,0,0>,1.0,1.0);    llSetRot(Two);}default{    state_entry()    {        rDefault = llGetRot();        SmoothRotate3(rDefault,rTwo);        llSleep(2.0);        state two;    }}state two{    state_entry()    {        SmoothRotate3(rTwo,rDefault);        llSleep(2.0);        state default;    }}

 

Link to comment
Share on other sites

The tricky part comes in satisfying the OP's requirement ... "Specifically, is there a way to make it continually slow down until it reaches that point from when an object was touched?"    The Smooth Rotating Door suggestion that I made and Acheron has illustrated in his script will make the object start and stop its rotation at the right spots and in a graceful fashion, but it won't make it continually slow down.  To do that, you'd have to do the rotation in steps, changing the speed of llTargetOmega in each step.  You could still do the llSetRot part in a single step, because you only care about where the object ends up, not where it is along the way.

Link to comment
Share on other sites

Thanks for the responses, I'll have to look through them.

If you guys have every played Riven you'll know what I'm taking about here. I'm trying to make a replica of the Firemarble Domes that you find in the game. I'm in the middle of rewriting the script and was going to give llTargetOmega a try instead of what I was doing previously (progressively lessening the speed of a texture animation). The issue we had there was that the animation would always click back into it's original place when stopped.

I guess that brings up another question then. Say we eneded up using a texture animation, is there an algorithm or some way to get that to automatically reduce in steps and stop at a certain point? Perhaps we can modify the solution posted before?

Link to comment
Share on other sites

you can force it end at a certain physical position, but it'll either jump to that position, or you would have to make the object physical and then try to calculate the position to end at when using target omega.... because there no way to determine the non physical rot on a viewers screen (which starts when they view it, and is determined by their hardware).

I don't know if anyone has written such a function for target omega operating physically, though it's definitely possible at that level.

alternatively you can use incremental step rot, but it's very slow to be relatively smooth, and there is a viewer threshold for how small those changes can be on a given size object.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4715 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...