Jump to content

Reset llTargetOmega and Rotation


Xxaxx Constantine
 Share

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

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

Recommended Posts

I have a script that will cause (at the click of a hud button) various child prims of my target object to rotate.

I can make the target prims rotate quite nicely. I'm using llTargetOmega to rotate the prims.

THe problem is with stopping it.

Nothing I do will return the prim to its default <0.0, 0.0, 0.0> position.

I've tried:

llSetLocalRot( ZERO_ROTATION );
llSetRot( ZERO_ROTATION );
llSetLocalRot( ZERO_ROTATION / llGetRootRotation() )

Basically throwing snippets at the issue to see if any will bring the prim back to zero rotation.

Any clues would be most welcome.

Link to comment
Share on other sites

Try to force the object to send an update to your viewer, after stopping the omega rotation.

Calling zero rotation won't do the trick, because llTargetOmega is just a viewer side effect. Hence, the prim never left its original rotation on the server side. And when the set rotation isn't any different, than the original rotation, it will not send an object update to the viewer.

You would have to set a rotation different than the original rotation, to force an update, and back to the original rotation

You can also try using  

llSetText("1", ZERO_VECTOR, 1.0);llSetText("", ZERO_VECTOR, 0.0);

 to force an update.

Link to comment
Share on other sites

As you probably know, llTargetOmega is client-side unless the object is physics-enabled.   That is, the prim doesn't actually move as far as the sim is concerned;  the rotation effect is caused by your GPU and CPU drawing the prim as if it's rotating smoothly.

This means that simply setting the rotation to START_ROT doesn't have any effect, since as far as the sim is concerned, the prim is still at START_ROT.

The work-round is to do something that forces your viewer to redraw the prim for you, so it redraws it at START_ROT rather than at what the rotation seemed to be when you stopped llTargetOmega.

Two common work-rounds are to briefly to flip the alpha of a face on the prim that can't be seen to invisible and then back to visible, or briefly to have the prim "display" some hovertext set at 0.0 alpha and then wipe the invisible text.   Either of those should force a redraw.

An alternative approach would be, once you stop llTargetOmega,  actually to change the prim's rotation by 10 degrees or so, using llSetRot and then flip it right back to START_ROT. 

 

ETA arton beat me to it!

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3510 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...