Jump to content

llSetLinkPrimitiveParams and flexibility


Postmark Jensen
 Share

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

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

Recommended Posts

I'm reworking a wing flapping script I found online.  The original script was overly complicated so I pared it down to the following.  Problem is it doesn't work.  The child prims *are* set to flexible and the gravity is indeed changed, but nothing happens.  Well, it appears that there is a small amount of tapering going on, but it's sporadic...


Any help would be appreciated!

 

// Gravity settings for the flaps
float UP = 1.0;
float DOWN = -1.0;
float MID = 0.0;
// Looping order of the flaps
list FLAPS;
// internal values
integer current_flap = 0;

 
default
{
    state_entry() {
        FLAPS = [ UP, DOWN, UP, DOWN, UP, DOWN, MID, MID, MID, MID ];
        llSetTimerEvent( 1.0 );
    }
 
    timer() {
        if ( current_flap >= 9 ) current_flap = 0;
        {
          
           llSetLinkPrimitiveParams( LINK_ALL_CHILDREN, 
                                     [PRIM_FLEXIBLE, TRUE,
                                     3, 
                                     llList2Integer(FLAPS, current_flap), 
                                     0.0, 
                                     0.0, 
                                     1.0 , 
                                     <0, 0, 0>]);
                }
 
        ++current_flap;
    } 
}

 

Link to comment
Share on other sites

True that float, thank you, but the child prims still just stay there statically.  I believe that the intended result is to have the two child prims droop via gravity, then rise via gravity, mimicing wings.

[prim2](prim1)[prim3]

I might just have to make three sets of wings and cycle through their transparencies.

Link to comment
Share on other sites

Well, for one thing, you are using llSetLinkPrimitiveParams, which has a 0.2 second delay and then you are switching its parameters once a second with your timer event.  I'd use llSetLinkPrimitiveParamsFast, which has no bulit-in delay at all. Even with SLPPF, though, you may not get a big effect unless you also apply a little impulse each time you switch from UP to DOWN.  I'd have to experiment a bit, but you may not be able to get a good response by just switching the gravity parameter in PRIM_FLEXIBLE that quickly.

Link to comment
Share on other sites

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