Jump to content

Recommended Posts

Hello, I build a small seaplane, but when on the water (it floats ok) wings or nose go under the water. On the land all ok. The root is a 0,5 prim cube. Is it script or construction (primmy)? Please help! Thank you!

Seaplane is about 3x3 meters

Edited by MIVIMEX

Share this post


Link to post
Share on other sites

Try playing with llSetVehicleVectorParam (VEHICLE_LINEAR_MOTOR_OFFSET).  You sometimes need to build an offset into vehicles when their center of gravity doesn't necessarily coincide with the point where the forward thrust of the engine is being applied.  I have found that shifting the motor's position forward or backward, even doing it dynamically when a new av sits down or when I reverse direction, will often keep a vehicle from nosing over.  I've included a function like this in some scripts:

SetEnginePosition()
{
    vector diff;
    if (fFwd >= 0.0)    // moving forward, don't tip on your nose
    {
        diff = llGetCenterOfMass() - llGetPos() + <-3.25,0.0,0.0>;
    }
    else        // Moving backwards, don't tip onto your tail
    {
        diff = llGetCenterOfMass() - llGetPos() + <0.0,0.0,0.0>;
    }
    llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_OFFSET, diff );
}

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
20 minutes ago, Rolig Loon said:

 


SetEnginePosition()
{
    vector diff;
    if (fFwd >= 0.0)    // moving forward, don't tip on your nose
    {
        diff = llGetCenterOfMass() - llGetPos() + <-3.25,0.0,0.0>;
    }
    else        // Moving backwards, don't tip onto your tail
    {
        diff = llGetCenterOfMass() - llGetPos() + <0.0,0.0,0.0>;
    }
    llSetVehicleVectorParam( VEHICLE_LINEAR_MOTOR_OFFSET, diff );
}

 

Wow! Thank you very much for this! I will try it! So it's a script, not construction?

Share this post


Link to post
Share on other sites

Well, the construction of your vehicle certainly makes a lot of difference, but it's sometimes impossible to get rid of instability without really making your vehicle look stupid.  I have tried adding extra transparent prims (bumper guards and whatnot), but a scripting solution has the advantage of being dynamic and not adding klunky elements to your model.  If it works.  :|

BTW, that fFwd parameter in my function is a variable toggle that's set when I change direction.  I would normally use an integer switch rather than a float in a toggle, but I sometimes need that variable for other things as well, where it's handy to have a float.

Edited by Rolig Loon
  • Thanks 1

Share this post


Link to post
Share on other sites
23 hours ago, MIVIMEX said:

when on the water (it floats ok) wings or nose go under the water.

Do you mean when it's in motion, as in takeoff or landing? A real seaplane can do that.

There's enough reality to the physics engine that it can replicate the problems of a top-heavy vehicle with high friction ground contact. Check the coefficient of friction of the floats, which should be reasonably low, like 0.1.  Also, maybe the center of gravity is too high. SL objects have a center of gravity, separate from the object root, and it matters.  Sometimes you need to put more mass near the bottom.

The vehicle system applies various fake forces and torques to stabilize the vehicle, but they're just inputs to the physics engine, along with the real simulation.

If you're really serious about it, you can just apply forces and torques yourself, and not use the vehicle calls at all. Kelly Shergood's helicopters do this, which makes them realistic and as hard to fly as the real thing.

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...