Jump to content

Seaplane floats unstable


MIVIMEX
 Share

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

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

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
Link to comment
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
Link to comment
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?

Link to comment
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
Link to comment
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
Link to comment
Share on other sites

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