Jump to content

Child prim to stay at zero rotation while root prim rotates at any orientation


Elite Runner
 Share

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

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

Recommended Posts

I need some sort of scripting help. I need to know how to make the child prim to stay upright at zero rotation when the object (including root prim) rotates at any orientation. An example would be a something similar to to a gyrometer or equivalent. Another example is when the smoke or steam goes upright from a smokestack on a train and when emitting particles from a child prim, that prim and the particles needs to keep upright.

Edited by Elite Runner
Link to comment
Share on other sites

That's not possible. All child prims are linked directly to the root. Rotating the root rotates all child prims.

To keep a child prim stay upright you need to rotate it upright in a fast timer event. (max. 15 times per second, more moves will not be visible in the viewer)

additional info:

If the root rotates by a TargetOmega rotation - that's viewer sided and child prim rotations can't work in sync

If the root is moved by KFM - you can't change the linkset while KFM is active.

Edited by Nova Convair
Link to comment
Share on other sites

Provided that you are not using KFM or a client-side rotation to move your object, you should be able to rotate the child prim incrementally, using something like

rotation rPrimRot = llList2Rot(llGetLinkPrimitiveParams(link_number,[PRIM_ROTATION]),0);

rotation rNewRot = llAxisAngle2Rot( <0,0,1>, <rPrimRot.x, rPrimRot.y, rPrimRot.z> * <0,0,1> * llRot2Angle(rPrimRot);

llSetLinkPrimitiveParamsFast(link_number,[PRIM_ROTATION, rNewRot]);

As Nova says, however, to keep the child prim upright in a smooth, non-jerky way means making that adjustment with a fast timer (triggering at least every 0.066 seconds). That's very wasteful of server resources.  It might be worth considering with a much slower timer if your root prim isn't rotating very much or is rotating very slowly, or if you are willing to put up with some jittery behavior.  Even then, though, Nova is right ... you won't be able to combine this approach with llTargetOmega or llSetKeyframedMotion.

Link to comment
Share on other sites

You could simulate it with Animesh, albeit using hard animations targeting specific bones.

Maybe someday we'll get a new animation function to override an animation's fps, start/end frame, number of frames, looping, ease in/out, priority and lastly, whether a global start time should be referenced or not to keep things in synch at all times.

Link to comment
Share on other sites

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