Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4 5 ... 8   Go Down

Author Topic: Hip & Hind Progress - 3d artist help needed  (Read 17885 times)

0 Members and 1 Guest are viewing this topic.

xxxautoxxx

  • member
  • Offline Offline
  • Posts: 322
Re: Hip & Hind Progress
« Reply #12 on: October 17, 2018, 10:07:14 AM »

Wow!
some pretty cool stuff there !
(looove the Spetsnaz blue berets !)
Logged

vpmedia

  • Modder
  • member
  • Offline Offline
  • Posts: 6652
  • www.vpmedia.hu/il2
    • VPMEDIA SKINS
Re: Hip & Hind Progress
« Reply #13 on: October 17, 2018, 10:25:43 AM »

Actually is avaliable only in BAT, not in single mods, but I will make a "Chopper Mod" to extend it to all.
/quote]

Thanks, that would be great! :)

BT~Wasted, nice to see you back!

BT~wasted

  • Modder
  • member
  • Offline Offline
  • Posts: 1468
Re: Hip & Hind Progress
« Reply #14 on: October 17, 2018, 12:47:42 PM »

Hello Vega!

Nice to see that you are doing find and progressing great with amazing mods.

Unfortunately we went in different directions with helicopter mods.

I doubt that we can combine our codes  :-|

Here is the human side code written by Koty

Code: [Select]
        double kren = ((FlightModelMain) (super.FM)).Or.getKren();
        double tang = ((FlightModelMain) (super.FM)).Or.getTangage();
        /*Code above not used now, will be used for autopilot*/
       
       
        /** aile = aileron deflection for flightmodel*/
        /*  the two if's below it ensure it is within <-1;1>, forceTrim_x acts to basicaly re-center the cyclic*/
        float aile/*kren*/ = ((FlightModelMain) (super.FM)).CT.getAileron() + (float) forceTrim_x /*+ ((FlightModelMain) (super.FM)).CT.getTrimAileronControl()*/;
        //kren *= 35F;
        if(aile>1)aile=1;
        if(aile<-1)aile=-1;
       
        /** similar for elevator*/
        float elev/*tang*/ = ((FlightModelMain) (super.FM)).CT.getElevator() + (float) forceTrim_y /*+ ((FlightModelMain) (super.FM)).CT.getTrimElevatorControl()*/;
        if(elev>1)elev=1;
        if(elev<-1)elev=-1;
        //tang -= 0.05F;
        //tang *= tang >= 0.0F ? 35F : 50F;
       
        /** anti-torque*/
        /*  does not have force trim yet*/
        float rudd = ((FlightModelMain) (super.FM)).CT.getRudder() + ((FlightModelMain) (super.FM)).CT.getTrimRudderControl();

        /*trim setting code*/
        if(getTrim) /*getTrim goes true if Aux=20 is pressed*/
        {
        forceTrim_x=aile; /*inserts current aile value - that is, already re-centered by the force trim*/
        forceTrim_y=elev; /*similar for elev*/
        getTrim=false; /*sets the getTrim condition false so it stops after first cycle*/
        };
       

        /**Angular speeds and accelerations*/
        double Wx = ((FlightModelMain)(super.FM)).getW().x;
        double Wy = ((FlightModelMain)(super.FM)).getW().y;
        double Wz = ((FlightModelMain)(super.FM)).getW().z;
       

        double AWx = ((FlightModelMain)(super.FM)).getAW().x;
        double AWy = ((FlightModelMain)(super.FM)).getAW().y;
        double AWz = ((FlightModelMain)(super.FM)).getAW().z;
       
       
       
        /**collective is being read here*/
        /* it is an average of both pitch axes*/
        float aPitch = (((FlightModelMain) (super.FM)).EI.engines[0].getControlProp() + ((FlightModelMain) (super.FM)).EI.engines[1].getControlProp()) / 2.0F;
        /*Added this for later use ---^*/
//        vThrust.set(0.0F, 0.0F, /*(1.0F+aPitch)/2*/1F);
//        oMainRotor.set(0.0F, tang, kren);
//        oMainRotor.transform(vThrust);
//        ((FlightModelMain) (super.FM)).EI.engines[0].setVector(vThrust);
//        ((FlightModelMain) (super.FM)).EI.engines[1].setVector(vThrust);
        /**throttle not used now*/
//        float aThrottle = (((FlightModelMain) (super.FM)).EI.engines[0].getControlThrottle() + ((FlightModelMain) (super.FM)).EI.engines[1].getControlThrottle()) / 2.0F;
        float Engine1rpm = Aircraft.cvt(((FlightModelMain) (super.FM)).EI.engines[0].getRPM(), 0.0F, 12500F, 0.0F, 1.0F);
        float Engine2rpm = Aircraft.cvt(((FlightModelMain) (super.FM)).EI.engines[1].getRPM(), 0.0F, 12500F, 0.0F, 1.0F);
        //        float aThrottle = (Engine1rpm + Engine2rpm) / 2.0F;
       
        float aThrottle = (float) Math.sqrt((Math.pow(Engine1rpm, 2.0F) + Math.pow(Engine2rpm, 2.0F)) / 2.0F);
       
//    HUD.log(AircraftHotKeys.hudLogWeaponId, "PropAOA: " + ((FlightModelMain) (super.FM)).EI.engines[0].getPropAoA());
//        HUD.log(AircraftHotKeys.hudLogWeaponId, "Engine rpm: " + aThrottle);
   
        /**only thrust is, to set the rotor RPM (again, an average)*/
        /**rotor RPM code is simplified and is directly controled by
         * thrust, I wanted to add a full rotor RPM code,
         * giving the rotor certain inertia etc, + enabling autorotation
         * but that is not implemented yet*/
//        float aThrust = (((FlightModelMain) (super.FM)).EI.engines[0].getThrustOutput() + ((FlightModelMain) (super.FM)).EI.engines[1].getThrustOutput()) / 2.0F;
        float aThrust = aThrottle;

        /**helicopter speeds are loaded into vFlow*/
        Vector3d vFlow;
vFlow=((FlightModelMain)(super.FM)).getVflow();
double sinkRate = vFlow.z;

/*old debug HUD.log*/
//HUD.log(AircraftHotKeys.hudLogWeaponId, "sinkRate" + sinkRate);
float airDensity = Atmosphere.density((float)((Tuple3d) (((FlightModelMain) (super.FM)).Loc)).z);
        float antiSinkForce;
        float headOnForce;
        float sideForce;
        float tailRotorMoment;
        double rotorSurface = 20/*235*/;  //surface of main rotor
        double rotorSurface_cyclic = 10;//13.183;
        /*(above) surface of main rotor that acts when cyclic is engaged
         * the whole rotor changes AoA by a sine function around the rotor trajectory
         * so when averaged out, it is roughly equal to full deflection being applied to half of the rotor surface*/
        double tailRotorSurface =1.35;  //surface of tail rotor
        double rotorCy = 1.3;           //drag coefficient for speeds perpendicular to rotors (sinking, rotation around vertical axis)
       

       
        double rotorCx = 0.002;         //drag for flow paralel to the rotors (rotor rotation, helicopter going forward/sideways, rotation around y axis)
       
        double rotorLineCx = 0.0006 * ((aPitch) * (aPitch) * 10 * 10); //increase over rotorCx when higher pitch (collective) is applied
        double tailRotorLineCx = 0.0006 * ((rudd) * (rudd) * 10 * 10); //similar for anti-torque
        double rotorCyDyn_0 = 0.18;         //actual lift coefficient for 0 AoA of rotor blades (used for both main rotor and tail rotor)
        double rotorCyDyn_line = 0.09;      //linear increase with higher pitch angle of rotor blades
        double rotorDiameter = 17.3;        //main rotor diameter, used for rotor speed calculation
        double tailRotorDiameter = 4;       //same for tail rotor
        double rotorRPM_max = 240;            //main rotor max RPM for the simplified code
        double rotor_tailRPM_max=1112;        //tail rotor max RPM
        double rotorRPM = (aThrust*rotorRPM_max/60)*(1-(aPitch*0.05));   
        /*max thrust is 1.0, meaning if thrust is max, revolutions are max too
         * it is impossible to fly the helicopter on one engine now, because the thrust value is average!
         * I should have done some square (or square root) average instead*/
        /*the RPM get decreased at higher collective*/
        double hubDirection_x = Math.toRadians(0);
        double hubDirection_y = Math.toRadians(5);
        /*default rotur hub direction, now 5° forward*/
       
        double rotorHeight = 2;  //height of hub above the CG, important for drag moments
       
        double rotorSpeed = 2*Math.PI*(rotorDiameter/2)*0.66*rotorRPM;  //finally, rotor speed
        /**the rotor speed can be summed up to single speed (it changes with distance from center of rotation)*/
        /*this speed is equivalent to speed at two thirds of the radius from the center*/

   
        /**Autopilot code is calculated at this point**/
        /* it only reacts to angular speed at the moment*/
        /* the only purpose now is to prevent over-rolling*/
        /* the code itself is above Update*/
        double autoPitch = PitchAuto(-Wy);   
        double autoRoll = RollAuto (Wx);
       

        /**hub direction change (as difference to original position, not final value)*/
       
        double d_hubDirection_x = Math.toRadians(-(aile+autoRoll)*2);
        double d_hubDirection_y = Math.toRadians((elev+autoPitch)*5);
       
       
       
        /**L I F T S   A N D   D R A G S*/
       
       
        /*main rotor lift*/
        /**All come from
         * (1/2).C.S.ro.V^2*/
        /*C varies depending on deflection angles, S on rotor, V on RPM, ro = air density*/
        double rotorLift_dyn = 0.5 * (rotorCyDyn_0+ rotorCyDyn_line * 10 * aPitch) * rotorSurface * airDensity * rotorSpeed * rotorSpeed;
        /*torque created by rotor drag*/
        double rotorLift_moment_z = 0.5 * (rotorCx+rotorLineCx) * rotorSurface * airDensity * rotorSpeed * rotorSpeed;
        /*rotation moments*/
        double rotorLift_moment_y = -(rotorDiameter/2)*0.5 * 0.5 * (rotorCyDyn_line * 5 * (elev+autoPitch)) * rotorSurface_cyclic * airDensity * rotorSpeed * rotorSpeed;
        double rotorLift_moment_x = (rotorDiameter/2)*0.5 * 0.5 * (rotorCyDyn_line * 3 * (aile+autoRoll)) * rotorSurface_cyclic * airDensity * rotorSpeed * rotorSpeed;
       
       
        /*additional moment created by hub tilting*/
        rotorLift_moment_y += rotorLift_dyn*(rotorHeight*Math.sin(d_hubDirection_y));
        rotorLift_moment_x += rotorLift_dyn*(rotorHeight*Math.sin(d_hubDirection_x));
       
       
        /*the 2/3 radius speed on tail rotor*/
        double tailRotorSpeed = 2*Math.PI*(tailRotorDiameter/2)*0.66*aThrust*rotor_tailRPM_max/60;
       
        /*lift for anti-torque*/
        double tailRotorLift_dyn = 0.5*(rotorCyDyn_line * 10 * rudd) * airDensity * tailRotorSpeed * tailRotorSpeed;
        /*torque around Y axis*/
        double tailRotorLift_moment_y = 0.5*(tailRotorDiameter/2)*0.66 /*it acts 2/3 from center of rotation*/ * (rotorCx+tailRotorLineCx) * tailRotorSurface * airDensity * tailRotorSpeed * tailRotorSpeed;
        /*transfering the tailRotorLift_dyn into actual moment*/
        double tailRotorLift_moment_z = tailRotorLift_dyn*10;
       
       
       
       
        /**just declarations*/
        double dragMoment_x;
        double dragMoment_y;
       
        //super.update(f);
       
        double rotateSpeed_x;
        double rotateSpeed_y;
        double rotateSpeed_z;
       
       
       
        rotateSpeed_z = (Wz*(rotorDiameter/2)*0.5);
       
        rotateSpeed_y = (Wy*(rotorDiameter/2)*0.5);
       
        rotateSpeed_x = (Wx*(rotorDiameter/2)*0.5);
       
        double inertia_x = -((FlightModelMain) (super.FM)).M.getFullMass()*(AWx*(1/2)*0.033+Wx*(1/2))*3*3;
        double inertia_y = -((FlightModelMain) (super.FM)).M.getFullMass()*(AWy*(1/12)*0.033+Wy*(1/12))*17*17;
        double inertia_z = -((FlightModelMain) (super.FM)).M.getFullMass()*(AWz*(1/12)*0.033+Wz*(1/12))*17*17;
       
       
        /*these moments are caused by flow perpendicular to rotor blades as a helicopter rotates*/
        double balanceMoment_x = (rotorDiameter/2)*0.66*rotateSpeed_x*rotateSpeed_x*rotorSurface*airDensity*rotorCy*0.5;
        if(rotateSpeed_x<0){balanceMoment_x = 0-balanceMoment_x;};
        double balanceMoment_y = (rotorDiameter/2)*0.66*rotateSpeed_y*rotateSpeed_y*rotorSurface*airDensity*rotorCy*0.5;
        if(rotateSpeed_y<0){balanceMoment_y = 0-balanceMoment_y;};
        double balanceMoment_z = 10*rotateSpeed_z*rotateSpeed_z*tailRotorSurface*airDensity*rotorCy*0.5;
        if(rotateSpeed_z<0){balanceMoment_z = 0-balanceMoment_z;};
       

        /**this originally served to level the helicopter, it will be later used for autopilot code*/
        // G = 9.81 * ((FlightModelMain) (super.FM)).M.getFullMass();
        //double balanceMoment_G_x =0;// -Math.cos(Math.toRadians(tang))*G * (2*Math.sin(Math.toRadians(kren)));
       
        //double balanceMoment_G_y =0;// Math.cos(Math.toRadians(kren))*G * (/*Math.sqrt(4.25)*/2*Math.sin(Math.toRadians(/*14+*/tang)));
        //double balanceMoment_G_z =0;// Math.sin(Math.toRadians(kren))*G * (/*Math.sqrt(4.25)*/0*Math.sin(Math.toRadians(/*14+*/tang)));
       
        if(sinkRate>=0){
        antiSinkForce = -(float) (rotorCy * rotorSurface * airDensity * sinkRate * sinkRate);
        } /*force caused by flow perpendicular to rotor as helicopter sinks (or climbs)*/
        else
        {
        antiSinkForce = (float) (rotorCy * rotorSurface * airDensity * sinkRate * sinkRate);
        };
       
        /**drag caused by flow in X axis on the main rotor*/
        /*it also produces a moment around Y axis*/
       
        /**These are all multiplied by 2 to better simulate:
         * loss of AoA when going up/down
         * dihedral of the rotor
         * fuselage drag*/
        if(vFlow.x>=0){
            headOnForce = -(float) ((rotorCx+rotorLineCx) * rotorSurface * airDensity * vFlow.x * vFlow.x);
            dragMoment_y =  -(float) 2*((rotorCx+rotorLineCx) * rotorSurface * airDensity * vFlow.x * vFlow.x);
            }
            else
            {
            headOnForce = (float) ((rotorCx+rotorLineCx) * rotorSurface * airDensity * vFlow.x * vFlow.x);
            dragMoment_y =  (float) 2*((rotorCx+rotorLineCx) * rotorSurface * airDensity * vFlow.x * vFlow.x);
            };
         /**similar*/
            if(vFlow.y>=0){
                sideForce = -(float) ((rotorCx+rotorLineCx+1) * rotorSurface * airDensity * vFlow.y * vFlow.y);
                tailRotorMoment = (float) (rotorCy * tailRotorSurface * airDensity * vFlow.y * vFlow.y)*10;
                dragMoment_x =  (float) 2*((rotorCx+rotorLineCx) * rotorSurface * airDensity * vFlow.y * vFlow.y);
                }
                else
                {
                sideForce = (float) ((rotorCx+rotorLineCx+1) * rotorSurface * airDensity * vFlow.y * vFlow.y);
                tailRotorMoment = -(float) (rotorCy * tailRotorSurface * airDensity * vFlow.y * vFlow.y)*10;
                dragMoment_x =  -(float) 2*((rotorCx+rotorLineCx) * rotorSurface * airDensity * vFlow.y * vFlow.y);
                };
               
            /** code distributing lift forces into all three axes as the hub rotates*/
                /*(hubDirection_x+d_hubDirection_x) sums up default direction and direction difference*/
              double rotorLift_3D_x = Math.sin(hubDirection_y-d_hubDirection_y)*Math.cos(hubDirection_x+d_hubDirection_x)*rotorLift_dyn;
              double rotorLift_3D_y = Math.sin(hubDirection_x+d_hubDirection_x)*rotorLift_dyn;
              double rotorLift_3D_z = Math.cos(hubDirection_y-d_hubDirection_y)*Math.cos(hubDirection_x+d_hubDirection_x)*rotorLift_dyn;
               
               
        /**all forces and moments summed up and added to base flight model*/
             
              float antiLiftForce;
              if(sinkRate >= 1.0D)
              antiLiftForce = (float)(0.5D * rotorCy * rotorSurface * (double)airDensity * sinkRate * sinkRate) * 20;
              else
              antiLiftForce = 0;
             
              this.FM.producedAF.x += headOnForce+rotorLift_3D_x;
              this.FM.producedAF.y += sideForce+rotorLift_3D_y;
              this.FM.producedAF.z += antiSinkForce+rotorLift_3D_z-antiLiftForce;
              this.FM.producedAM.x += dragMoment_x - balanceMoment_x + rotorLift_moment_x;
              this.FM.producedAM.y += dragMoment_y + tailRotorLift_moment_y - balanceMoment_y + rotorLift_moment_y;
              this.FM.producedAM.z += tailRotorMoment - tailRotorLift_moment_z - balanceMoment_z + rotorLift_moment_z;
                     
        rotateSpeed_z = 0;
        rotateSpeed_y = 0;
        rotateSpeed_x = 0;
        headOnForce = 0;
        sideForce = 0;
       
       
        Vector3d localVector3d = new Vector3d();
        getSpeed(localVector3d);
        Point3d localPoint3d1 = new Point3d();
        this.pos.getAbs(localPoint3d1);
        float falt = (float)(this.FM.getAltitude() - World.land().HQ(localPoint3d1.x, localPoint3d1.y));
        if ((falt < 10.0F) && (this.FM.getSpeedKMH() < 60.0F) && (localVector3d.z < -1.0D))
        {
        localVector3d.z *= 0.9D;
        setSpeed(localVector3d);
        }
        if (this.FM.getVertSpeed() > 0.01F)
        {
        float verSPDlimit = cvt(this.FM.getVertSpeed(), 1.0F, 10.0F, 1.0F, 0.95F);
        localVector3d.z *= verSPDlimit;
        setSpeed(localVector3d);
        }
        if((double)super.FM.getSpeedKMH() >= 250D && ((FlightModelMain) (super.FM)).EI.engines[0].getStage() > 5 && ((FlightModelMain) (super.FM)).EI.engines[1].getStage() > 5)
            FM.Sq.dragParasiteCx += 0.04F;
        if((double)super.FM.getSpeedKMH() >= 260D && ((FlightModelMain) (super.FM)).EI.engines[0].getStage() > 5 && ((FlightModelMain) (super.FM)).EI.engines[1].getStage() > 5)
        FM.Sq.dragParasiteCx += 0.04F;
        if((double)super.FM.getSpeedKMH() >= 280D && ((FlightModelMain) (super.FM)).EI.engines[0].getStage() > 5 && ((FlightModelMain) (super.FM)).EI.engines[1].getStage() > 5)
        FM.Sq.dragParasiteCx += 0.05F;
       
        float angleOfattackCx;
        if(this.FM.getAOA() >= 0.5)
        angleOfattackCx = this.FM.getAOA() / 5;
        else
        angleOfattackCx = 0;
        FM.Sq.dragParasiteCx += angleOfattackCx;
        }

And here is an AI code in the same class:

Code: [Select]
    if((super.FM instanceof RealFlightModel) && ((RealFlightModel)super.FM).isRealMode() || !(super.FM instanceof Pilot)) 
        {
    isAI = false;
        } else {
        isAI = true;
        this.FM.EI.toggle();
        Squares squares = (Squares)Reflection.getValue(FM, "Sq");
        squares.squareWing = 66.0F;
        squares.squareAilerons = 1.00F;
        squares.squareFlaps = 0.81F;
        squares.liftStab = 5.20F;
        squares.squareElevators = 2.80F;
        squares.liftKeel = 0.1F;
        squares.squareRudders = 2.50F;
        squares.liftWingLIn = (squares.liftWingRIn = 10.00F);
        squares.liftWingLMid = (squares.liftWingRMid = 10.00F);
        squares.liftWingLOut = (squares.liftWingROut = 10.00F);
        squares.dragFuselageCx = 0.06F;
        squares.dragAirbrakeCx = 1.00F;
       
        Vector3f eVect = new Vector3f();
            eVect.x = 1.0F; eVect.y = 0.0F; eVect.z = 0.0F;
           
            Point3d ePos = new Point3d();
            ePos.x = 1.5F; ePos.y = 0.0F; ePos.z = 0.0F;
           
            Point3d ePropPos = new Point3d();
            ePropPos.x = 1.0F; ePropPos.y = 0.0F; ePropPos.z = 0.0F;
           
            this.FM.EI.engines[0].setVector(eVect);
            this.FM.EI.engines[0].setPos(ePos);
            this.FM.EI.engines[0].setPropPos(ePropPos);
       

        Reflection.setFloat(this.FM.EI.engines[0], "tChangeSpeed", 0.000001F);

        Reflection.setFloat(this.FM.EI.engines[0], "horsePowers", 3200.0F);

        Reflection.setFloat(this.FM.EI.engines[0], "propReductor", 1.0F);

     
            this.FM.EI.engines[1].setVector(eVect);
            this.FM.EI.engines[1].setPos(ePos);
            this.FM.EI.engines[1].setPropPos(ePropPos);
       
        Reflection.setFloat(this.FM.EI.engines[1], "tChangeSpeed", 0.000001F);

        Reflection.setFloat(this.FM.EI.engines[1], "horsePowers", 3200.0F);

        Reflection.setFloat(this.FM.EI.engines[1], "propReductor", 1.0F);

        Polares polares = (Polares)Reflection.getValue(FM, "Wing");
        polares.AOA_crit = 10.0F;
        Reflection.setFloat(FM, "Vmin", 20.0F);
        Reflection.setFloat(FM, "Vmax", 260.0F);
        Reflection.setFloat(FM, "VmaxAllowed", 280.0F);
        Reflection.setFloat(FM, "VmaxH", 280.0F);
        Reflection.setFloat(FM, "HofVmax", 7900.0F);
        Reflection.setFloat(FM, "VminFLAPS", 20.0F);
        Reflection.setFloat(FM, "VmaxFLAPS", 280.0F);
        polares.Cy0_max = 1.15F;
        polares.FlapsMult = 1.0F;
        polares.FlapsAngSh = 4.0F;
        polares.lineCyCoeff = 0.29F;
        polares.AOAMinCx_Shift = 0.0F;
        polares.Cy0_0 = 5.53F;
        polares.AOACritH_0 = 10.0F;
        polares.AOACritL_0 = -6.0F;
        polares.CyCritH_0 = 5.9934692F;
        polares.CyCritL_0 = -0.7648107F;
        polares.parabCxCoeff_0 = 5.0E-4F;
        polares.CxMin_0 = 0.0125F;
        polares.Cy0_1 = 1.53F;
        polares.AOACritH_1 = 10.0F;
        polares.AOACritL_1 = -6.0F;
        polares.CyCritH_1 = 1.2791651F;
        polares.CyCritL_1 = -0.7F;
        polares.CxMin_1 = 0.15F;
        polares.parabCxCoeff_1 = 7.5E-5F;
        polares.parabAngle = 5.0F;
        polares.declineCoeff = 0.008F;
        polares.maxDistAng = 40.0F;
       
        }
        World.cur().diffCur.Engine_Overheat = false;

Code: [Select]
private void stability() {
Vector3f eVect = new Vector3f();
eVect.x = 1.0F;
eVect.y = 0.0F;
eVect.z = 0.0F;
FM.EI.engines[0].setVector(eVect);
FM.EI.engines[1].setVector(eVect);
Point3d localPoint3d1 = new Point3d();
this.pos.getAbs(localPoint3d1);
Vector3d localVector3d = new Vector3d();
getSpeed(localVector3d);
float afZ = 0.0F;
float afX = 0.0F;
float avT = (FM.EI.engines[0].getThrustOutput() + FM.EI.engines[1].getThrustOutput()) / 2F;
float alt = FM.getAltitude() - Landscape.HQ_Air((float) this.FM.Loc.x, (float) this.FM.Loc.y);

if (!tookOff) {
if (((com.maddox.il2.ai.air.Maneuver) FM).get_maneuver() == 26 && FM.getSpeed() > 0.1F )
{
afZ = 150000;
afX = 0;
float altlim = 15.0F;
if (FM.Gears.nOfGearsOnGr > 2) {
gndYaw = FM.Or.getYaw();
gndRoll = FM.Or.getRoll();
gndPitch = FM.Or.getPitch();
}
FM.Or.set(-gndYaw, cvt(alt, 0.0F, altlim, gndPitch, gndPitch - 5.0F), gndRoll);
if (!hover)
{
float a = 0.0F;
if (alt < 7)
a = 7.0F;
if (alt > 7)
a = altlim;
float vertSpd = cvt(alt, 0.0F, a, 0.985F, 0.9F);
localVector3d.z *= vertSpd + World.cur().rnd.nextDouble(-0.05F, 0.05F);
localVector3d.x *= 0.9 + World.cur().rnd.nextDouble(-0.05F, 0.05F);
localVector3d.y *= 0.9 + World.cur().rnd.nextDouble(-0.05F, 0.05F);
setSpeed(localVector3d);
if (alt > altlim){
hover = true;
}
}
if (hover)
{
if (FM.getVertSpeed() < 0.0F)
{
localVector3d.z = 0.0;
setSpeed(localVector3d);
}
if (FM.getVertSpeed() > 0.1F)
{
float verSPDlimit = cvt(this.FM.getVertSpeed(), 0.0F, 3.0F, 1.0F, 0.85F);
localVector3d.z *= verSPDlimit;
setSpeed(localVector3d);
}
if (FM.getSpeedKMH() > 80F) {
afZ = 0.0F;
afX = 0.0F;
((com.maddox.il2.ai.air.Maneuver) FM).unblock();
tookOff = true;
hover = false;
}
}
}
}

BTW the above takeoff code if now working satisfactory. I'll fine tune it tomorrow and post a video and then move on to landing pattern.
Logged

BT~wasted

  • Modder
  • member
  • Offline Offline
  • Posts: 1468
Re: Hip & Hind Progress
« Reply #15 on: October 17, 2018, 12:52:16 PM »

So regarding a helicopter mod with combined efforts, I think that it would be great if all helicopters will use same principles. Because there are huge differences in the way you should fly them. Even that you have now collective like in real helicopter. For example when you got used to a huey and then try Hind with latest features it will seem to you like a nightmare, but when you will master it, you will never feel the huey right anymore. Same happened to me when I've tried my old works with Hind and Hip.

I hope that it wont take lots of time to finalize main features like take off and landing, after that I will release a beta for tests and you can try to remake some of your helicopters to a new standarts.

Btw now AI uses same mass and fuel as human does etc. I only change vital parameters for AI. Also try using HeloI type of the engine.
Logged

4S_Vega

  • Modder
  • member
  • Offline Offline
  • Posts: 3748
Re: Hip & Hind Progress
« Reply #16 on: October 17, 2018, 01:23:40 PM »

I don't understand.

In your codes you can use both Player/AI in same slot?
Logged

BT~wasted

  • Modder
  • member
  • Offline Offline
  • Posts: 1468
Re: Hip & Hind Progress
« Reply #17 on: October 18, 2018, 12:06:01 AM »

Yes, AI and human in the same slot.

At the mission start there is a check if the helicopter is AI or not. After that different codes are applied for AI and human controlled helicopters.

Logged

4S_Vega

  • Modder
  • member
  • Offline Offline
  • Posts: 3748
Re: Hip & Hind Progress
« Reply #18 on: October 18, 2018, 02:18:19 AM »

Yes, AI and human in the same slot.

At the mission start there is a check if the helicopter is AI or not. After that different codes are applied for AI and human controlled helicopters.

Perfect

I would to test it!

Check if some of my codes could help you, example the one for hovering.

Anyway, we can use your codes as standard for all helys if works better.

For now, before you finish, we have my chopper mod in BAT.
Logged

BT~wasted

  • Modder
  • member
  • Offline Offline
  • Posts: 1468
Re: Hip & Hind Progress
« Reply #19 on: October 18, 2018, 07:17:31 AM »

Hover is an interesting feature, but soviet helicopters didn't have it. Everything was done by pilot. Also Mi-24 uses its advantage in high speed to fire guided missiles, because the real launch range is like 3km and its is way too close to stay in hover.

But I don't know about NATO helicopters. Does they use any kind of computer to stay in hover? Because it requires lots of constant movements in all axis to stay in same position. Do you have any info on such Autopilot/computer system?
Logged

4S_Vega

  • Modder
  • member
  • Offline Offline
  • Posts: 3748
Re: Hip & Hind Progress
« Reply #20 on: October 18, 2018, 07:46:33 AM »

No, in my idea the Hover code replace the pilot work when you are on turret to aim guns or missiles.

At the same time also level stabilizer at higher speeds works to do that.

Is almost impossible use gun turrets & pilot at the same time, or aim laser guided missiles.

Just to understan, in yuour mod engine push up or to longintudinal axis.

In chopper mod all helys have piston engines that push like normal planes, vertical thrust is simulated by codes.

Logged

BT~wasted

  • Modder
  • member
  • Offline Offline
  • Posts: 1468
Re: Hip & Hind Progress
« Reply #21 on: October 18, 2018, 08:21:14 AM »

Koty has written a proper Trim code like in real Hind/Hip so I am using "Set Trim" button to level the helicopter. But you can also use level stabilizer.

As for the engine I am using Type HeloI engine like in HE-LERCHE. Human uses the Z vector and AI uses the X vector.

According to Koty's code all axes and forces are managed when human controlled. After all calculations forces are added here:

Code: [Select]
              this.FM.producedAF.x += headOnForce+rotorLift_3D_x;
              this.FM.producedAF.y += sideForce+rotorLift_3D_y;
              this.FM.producedAF.z += antiSinkForce+rotorLift_3D_z-antiLiftForce;
              this.FM.producedAM.x += dragMoment_x - balanceMoment_x + rotorLift_moment_x;
              this.FM.producedAM.y += dragMoment_y + tailRotorLift_moment_y - balanceMoment_y + rotorLift_moment_y;
              this.FM.producedAM.z += tailRotorMoment - tailRotorLift_moment_z - balanceMoment_z + rotorLift_moment_z;
Logged

4S_Vega

  • Modder
  • member
  • Offline Offline
  • Posts: 3748
Re: Hip & Hind Progress
« Reply #22 on: October 18, 2018, 08:59:41 AM »

Interesting, so separate axis between Human and AI.

If level stabilizer works properly there should not be problems with hovering and turret aiming.

Actually there are AH-64 and AH-1 cobra 3d wip, maybe you can extend your work on them?
Logged

BT~wasted

  • Modder
  • member
  • Offline Offline
  • Posts: 1468
Re: Hip & Hind Progress
« Reply #23 on: October 20, 2018, 02:33:28 PM »

Might be later I can extend my work to other helicopter mods, but now I need to finalize all the features on theses two. Mi-8 will be a good example of the features for transport helicopter and Mi-24 for attack.

As I slowly progress with code, might be there are any 3d specialties who are interested in Hip and Hind mods that can give some 3d modelling help?

Things needed:
1. Make few changes in Mi-8 meshes and transform it from T model to MT (add two more pylons, mirror the tail rotor position and add dust protection covers to the engine intakes).

2. Remove the rotating turret on Mi-24V and add the static double GSh-30 cannon on the right side (Mi-24V to Mi-24P).
Logged
Pages: 1 [2] 3 4 5 ... 8   Go Up
 

Page created in 0.036 seconds with 25 queries.