Jump to content

BWind Sailing Engine mod question


Miguelito Shilova
 Share

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

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

Recommended Posts

I am looking to modify the heeling behavior of the BWind engine script in a boat that I am building. The boat has an outrigger on one side ...

Snapshot_001.jpg

The BWind has a routine that calculates the heel angle and then 'rolls' the boat to the leeward side (the side of the boat opposite the direction of the wind). In a regular keel boat this heel angle is the same on either side of the boat, but what I'm looking to have happen is that if the outrigger is on the leeward side, the heel angle is almost nothing - given in RL the bouyancy of the outrigger float would keep the boat sailing 'flat', however if the outrigger is on the windward side, the heel would be normal, the boat rolls to leeward, and the float comes out of the water ...

Snapshot_002.jpg

Here is the routine that gets called at runtime, as well as the declarations and initial values ...

float windAngle;
integer SAIL_UP=FALSE;
float maxWindSpeed=14.0;
float windSpeed=7.75;
float heelTweak=0.55;
integer sailingAngle;
float heelAngle;
float heelTorque;
float heelAdd;



calcHeelAngle() {
    heelAngle=llAsin(leftVec.z);
    if (SAIL_UP)
        if (llFabs(windAngle+sailingAngle)>3*DEG_TO_RAD)
            heelTorque=SAIL_UP*llSin(windAngle)*llCos(heelAngle)*PI_BY_TWO*(windSpeed/maxWindSpeed)*llCos(sailingAngle*DEG_TO_RAD)*heelTweak;
        else heelTorque=0;
    else heelTorque=0;
    heelAdd=heelTorque-heelAngle;
    eulerRot=<heelAdd,0,0>;
    quatRot=llEuler2Rot(eulerRot);
integer SAIL_UP=FALSE;}

Does someone have a suggestion or two on how I could modify the routine so that the heelTweak value doesn't exceed .55 when the outrigger is on the leeward side?

Much appreciated!

Mig 

Link to comment
Share on other sites

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