Jump to content

Plane flaps


Tealthantos
 Share

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

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

Recommended Posts

So I've been building a Su-25, but I've been having problems with the flaps.

As we all know when you rotate a object it doesn't move leaving overlap or open joints so I added a set position command to change the relative pos as it rotates.

integer flaps=TRUE;

Flaps()

{if (flaps==TRUE) {
    
    rotation rot = llGetLocalRot();
             rot.z =  -0.644333;
             rot.s = 0.652586;
             rot.x =  0.297774;
             rot.y = -0.265136;
             llSetLocalRot(rot);
             llSetPos(llGetPos() + <0,0,-0.9>);
         flaps = FALSE;} else {if (flaps==FALSE) {
             rotation rot = llGetLocalRot();
             rot.z =  -0.707107;
             rot.s = 0.707107;
             rot.x =  0.000000;
             rot.y = 0.000000;
             llSetLocalRot(rot);
             llSetPos(llGetPos() + <0,0,0.9>);
             flaps = TRUE;}
             }
            }
             
default
{
    
    state_entry() {
        llListen(0,"", NULL_KEY, "");
    }

    listen(integer channel, string name, key id, string message) {
        if (message == "Flaps") {Flaps();}
}}

But for some reason it won't move and will just rotate on the spot.

Help would be much appreciated

 

Link to comment
Share on other sites

Assuming these are linked prims, llSetPos()  tells them how to move relative to the root, while llGetPos() returns the region coordinates of the prim.   For the prim's position relative to the root, you need llGetLocalPos().

But I think you might find this a lot easier if you try using llSetLinkPrimitiveParamsFast and PRIM_POS_LOCAL and PRIM_ROT_LOCAL.

  • Like 1
Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...