Sorry for it taking a while but at the moment we are tweaking the flight dynamics and adding some other things like sounds it shouldn't take too much longer to finish
---------- Post added at 09:13 PM ---------- Previous post was at 07:57 PM ----------
Does any one know what I need to change to increase the glide range ?
---------- Post added at 09:13 PM ---------- Previous post was at 07:57 PM ----------
Does any one know what I need to change to increase the glide range ?
Code:
void VLiftCoeff (double aoa, double M, double Re, double *cl, double *cm, double *cd)
{
static const double step = RAD*15.0;
static const double istep = 1.0/step;
static const int nabsc = 25;
static const double CL[nabsc] = {0.1, 0.17, 0.2, 0.2, 0.17, 0.1, 0, -0.11, -0.24, -0.38, -0.5, -0.5, -0.02, 0.6355, 0.63, 0.46, 0.28, 0.13, 0.0, -0.16, -0.26, -0.29, -0.24, -0.1, 0.1};
static const double CM[nabsc] = { 0, 0, 0, 0, 0, 0, 0, 0, 0,0.002,0.004, 0.0025,0.0012, 0,-0.0012,-0.0007, 0, 0, 0, 0, 0, 0, 0, 0, 0};
// lift and moment coefficients from -180 to 180 in 15 degree steps.
// This uses a documented lift slope of 0.0437/deg, everything else is rather ad-hoc
aoa += PI;
int idx = max (0, min (23, (int)(aoa*istep)));
double d = aoa*istep - idx;
*cl = CL[idx] + (CL[idx+1]-CL[idx])*d;
*cm = CM[idx] + (CM[idx+1]-CM[idx])*d;
*cd = 0.06 + oapiGetInducedDrag (*cl, 2.266, 0.6);
}
// 2. horizontal lift component (vertical stabiliser and body)
void HLiftCoeff (double beta, double M, double Re, double *cl, double *cm, double *cd)
{
static const double step = RAD*22.5;
static const double istep = 1.0/step;
static const int nabsc = 17;
static const double CL[nabsc] = {0, 0.2, 0.3, 0.2, 0, -0.2, -0.3, -0.2, 0, 0.2, 0.3, 0.2, 0, -0.2, -0.3, -0.2, 0};
beta += PI;
int idx = max (0, min (15, (int)(beta*istep)));
double d = beta*istep - idx;
*cl = CL[idx] + (CL[idx+1]-CL[idx])*d;
*cm = 0.0;
*cd = 0.02 + oapiGetInducedDrag (*cl, 1.5, 0.6);
}
// physical specs
SetSize (11);
SetEmptyMass (12000.0);
SetCW (0.3, 0.3, 0.6, 0.9);
SetWingAspect (1.7);
SetWingEffectiveness (3.1);
SetCrossSections (_V(2.28, 14.98, 2.48));
SetRotDrag (_V(3.5,3.5,3.5));
if (GetFlightModel() >= 1) {
SetPitchMomentScale (1e-4);
SetBankMomentScale (1e-4);
}
SetPMI (_V(6.42,17.23,10.77));
SetTrimScale (0.05);
SetCameraOffset (_V(0,-.335,3));
SetNosewheelSteering (true);
//SetTouchdownPoints (_V(0,-.3477,5.7), _V(-3.448,-.3477,-5.0), _V(3.448,-.3477,-5.0));;
//ATTACHMENTHANDLE P1;
P1 = CreateAttachment (false, _V(0,-.7,2.41),_V(0,1,0),_V(0,0,1),"PILOT",false);
EnableTransponder (true);
CreateAirfoil (LIFT_VERTICAL, _V(0,0,-0.5), VLiftCoeff, 20, 270, 2.266);
CreateAirfoil (LIFT_HORIZONTAL, _V(0,0,-4), HLiftCoeff, 20, 50, 1.5);
CreateControlSurface (AIRCTRL_ELEVATOR, 7, 0.5, _V( 0,0,-17), AIRCTRL_AXIS_XPOS,anim_ELEVATOR);
CreateControlSurface (AIRCTRL_RUDDER, 2, 0.5, _V( 0,2,-15), AIRCTRL_AXIS_YPOS,anim_RUDDER);
CreateControlSurface (AIRCTRL_AILERON, 4.8, 0.5, _V( 17.8,0,-17.8), AIRCTRL_AXIS_XPOS,anim_raileron);
CreateControlSurface (AIRCTRL_AILERON, 4.8, 0.5, _V(-17.8,0,-17.8), AIRCTRL_AXIS_XNEG,anim_laileron);
CreateControlSurface (AIRCTRL_ELEVATORTRIM, 11, 0.4, _V( 0,0,-15), AIRCTRL_AXIS_XPOS,anim_ELEVATOR);
CreateControlSurface (AIRCTRL_FLAP, 5, 0.5, _V( 0,0,-1), AIRCTRL_AXIS_XPOS,anim_flaps);