Jump to content

Rotate child prim continuously around root when the root is being sat on


Britlan
 Share

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

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

Recommended Posts

I had a script worked out one way, but decided it would look better to just have the child rotating alone instead of all of the linked prims together. The script is in the root prim and when an avatar sits on the root prim, various functions are applied to the linked child prims, when the avatar stands, they are removed. The only issue I am running into is the rotation of the child link. I had the target omega line for the rotation and it works but it rotates and stops the entire linkset of course=

//When avatar sits rotation (and other functions) begin
llTargetOmega(<0.0,0.0,0.1>,TWO_PI,1.0);

//When avatar stands rotation (and other functions) stop
llTargetOmega(<0.0,0.0,0.0>,TWO_PI,1.0);

Now I am trying to figure out the easiest way, ok,  just any old way to rotate the child alone  lol. I have several different script examples that actually compiled and worked the functions except for the rotating child. I think this was one example that compiled and worked for the most part=

//When avatar sits rotation (and other functions) begin
       llSetLinkPrimitiveParamsFast(LINK_ROOT, [
          PRIM_GLOW, 1, .14 ,
                
          PRIM_LINK_TARGET, 3,
          PRIM_ROTATION,<0, 0, 2.5,  3> ,                
                
          PRIM_LINK_TARGET, 2,
          PRIM_GLOW, 1, .58 ]);

//When avatar stands rotation (and other functions) end

etc...etc...etc

As far as I can tell from reading and researching around, rotating the 1 child only seems to be possible. Obviously I keep leaving out necessary lines of coding pertaining to the rotation link in each sample I have tried. I'm just not sure what else is needed or how to write it in here. So am I missing a lot here in this example. Am I even close?  lol  

Anyway, thanks in advance for any advice and hints  :)

Link to comment
Share on other sites

That's right.  What you are trying cannot be done.  LSL does not provide heirarchical linking, so you can't link prims in a chain.  All child prims are linked to the root.  You can't have a child of a child.  That means that a function like llTargetOmega can't spin a seated av on a spinning child prim.  The only way to handle that problem is to use stepwise server-side rotations with llSetLinkPrimitiveParamsFast (and PRIM_ROT_LOCAL) and a timer.  Be prepared for some tricky math.

Link to comment
Share on other sites

Thanks for the quick reply Rolig, you should really be on LL's payroll haha. OK, just to clarify, what I am attempting to do is have the root prim (base) where the script is send various functions (no particular order) to various prims in a link set when you sit on the base. The child prims do of course all link to the root, so when you sit, you sit on the base or root prim.

I do have 2 functions (glow & texture) that happens to the root prim while sitting but it is link 3 I am trying to rotate alone. Child 3 is like a globe rotating around the base you could say :) You wrote "can't spin a seated av on a spinning child prim" OK, the way I was thinking is the avatar is sitting on the root and one of the child prims will rotate around the avatar. So I am not really trying to spin the avatar at all. Is this still undoable? 5 out of 6 functions worki perfect when sitting or standing, only the rotation of link 3 is an issue. I'll play a bit more if I can get on later today, I just figured I was missing some rotation info in the script.

Sorry if I am explaining what I was attempting to accomplish poorly or I am misunderstanding your reply. Sometimes the fingers just get drunk & stupid trying to express the thoughts of a tired brain. I do tend to end up trying to do the impossible a lot though btw, lol.  :)

Link to comment
Share on other sites

It's my fault, probably, for not explaining myself clearly and for not seeing exactly what geometry you had in mind.  When you use llTargetOmega, you are spinning an object or a set of links around withever the llTargetOmega script is in. [Or whatever link you designate as the center, if you are using llSetLinkPrimitiveParams with PRIM_OMEGA. ]  So, if you want to make a prim look like it's spinning around your av, you have to link that prim to a transparent prim, put the llTargetOmega script in it, and wear it on your head. The transparent prim and the one that you see spinning will both be turning around the center of the transparent one.  [ If it were possible to treat your av as a prim, you could link the spinning prim to yourself, drop the llTargetOmega script into your body.  Then both you and the prim would spin around your center. But that's not possible, and it's not what you want anyway. ]

I know this isn't quite the same as having the spinning object spin around the root, but that's not possible.  As soon as you sit, you become the last link in the link set, which is fine if you don't mind spinning too, but it's not what you want.

  • Like 1
Link to comment
Share on other sites

... and the confusion continues hahaha. No not really, all good now I think. Oddly enough though, I got the impossible to actually work. I guess we both somehow still missed something in the details of what I was doing or maybe a second life fluke or update. :) Anyway, I didn't get to try wearing the linked prims like you mentioned but I did experiment with PRIM_OMEGA. I had not experimented with that, just llTargetOmega. I made a mistake before when I attempted using llSetLinkPrimitiveParamsFast I guess.

//When avatar sits rotation (and other functions) beginllSetLinkPrimitiveParamsFast(3,[PRIM_OMEGA,<0,0,3.5>, .3, 3]);//When avatar stands rotation (and other functions) stopllSetLinkPrimitiveParamsFast(3,[PRIM_OMEGA,<0,0,0.0>, .3, 3]);

This snippet actually works the way I wanted. You sit on the root and the 3rd child rotates around the root, you stand and it stops. Yay, I actually got something else working. Thank you very much for the ideas and help again Rolig. I can't get you on LL's payroll but I nominated you and voted for you as most excellent adviser, and looky...You won hahaha. Thanks again :)

 



Link to comment
Share on other sites

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