Discussion Space: 1999 updates ?

HELP!!! The eagle 3 is fine is space. But in air it is horrible. Not sure how to make it more aerodynamic?

Code:
void VLiftCoeff (double aoa, double M, double Re, double *cl, double *cm, double *cd)
{
	const int nabsc = 9;
	static const double AOA[nabsc] = {-180*RAD,-60*RAD,-30*RAD,-2*RAD, 15*RAD,20*RAD,25*RAD,60*RAD,180*RAD};
	static const double CL[nabsc]  = {       0,      0,   -0.4,     0,    0.7,     1,   0.8,     0,      0};
	static const double CM[nabsc]  = {       0,      0,  0.014, 0.004,-0.0074,-0.094,-0.012,     0,      0};
	int i;
	for (i = 0; i < nabsc-1 && AOA[i+1] < aoa; i++);
	double f = (aoa-AOA[i]) / (AOA[i+1]-AOA[i]);
	*cl = CL[i] + (CL[i+1]-CL[i]) * f; 
	*cm = CM[i] + (CM[i+1]-CM[i]) * f;  
	double saoa = sin(aoa);
	double pd = 0.015 + 0.4*saoa*saoa; 
	*cd = pd + oapiGetInducedDrag (*cl, 1.5, 0.7) + oapiGetWaveDrag (M, 0.75, 1.0, 1.1, 0.04);
	
}


void HLiftCoeff (double beta, double M, double Re, double *cl, double *cm, double *cd)
{
	const int nabsc = 8;
	static const double BETA[nabsc] = {-180*RAD,-135*RAD,-90*RAD,-45*RAD,45*RAD,90*RAD,135*RAD,180*RAD};
	static const double CL[nabsc]   = {       0,    +0.3,      0,   -0.3,  +0.3,     0,   -0.3,      0};
	int i;
	for (i = 0; i < nabsc-1 && BETA[i+1] < beta; i++);
	*cl = CL[i] + (CL[i+1]-CL[i]) * (beta-BETA[i]) / (BETA[i+1]-BETA[i]);
	*cm = 0.0;
	*cd = 0.015 + oapiGetInducedDrag (*cl, 1.5, 0.6) + oapiGetWaveDrag (M, 0.75, 1.0, 1.1, 0.04);
}

Code:
void EAGLE3::clbkSetClassCaps (FILEHANDLE cfg)
{
	// physical specs
	SetSize (32);
	SetEmptyMass (8000.0);
	SetCW (0.9, 0.9, 2, 1.4);
	SetWingAspect (0.1);
	SetWingEffectiveness (0.1);
	SetCrossSections (_V(85.24,163.99,40.59));
	SetRotDrag (_V(0.1,0.1,0.1));
	if (GetFlightModel() >= 1) {
		SetPitchMomentScale (1e-4);
		SetBankMomentScale (1e-4);
	}
	SetPMI (_V(15.5,22.1,7.7));
	SetTrimScale (0.05);
	//SetCameraOffset (_V(-1.362,1.633,11.752));
	SetCameraOffset (_V(-2.18532,2.9,13));
	SetClipRadius(0.1);
	SetTouchdownPoints  (_V(0,-3.124,8.7), _V(-5.45,-3.124,-9.6), _V(5.45,-3.124,-9.6));; 
...
	th_main = CreateThruster (_V(0,0,-4.3), _V(0,0,1), MAXMAINTH, TANK, ISP);
	CreateThrusterGroup (&th_main, 1, THGROUP_MAIN);
	AddExhaust (th_main, 12, 2, _V(2.45,0.57,-15.9), _V(0,0,-1),tex_main);	
	AddExhaust (th_main, 12, 2, _V(-2.41,0.57,-15.9), _V(0,0,-1),tex_main);	
	AddExhaust (th_main, 12, 2, _V(0,-0.76,-15.9), _V(0,0,-1),tex_main);	
	AddExhaust (th_main, 12, 2, _V(0,1.89,-15.9), _V(0,0,-1),tex_main);	
AddExhaustStream (th_main, _V(2.45,0.57,-15.9), &contrail_main);
AddExhaustStream (th_main, _V(-2.45,0.57,-15.9), &contrail_main);
AddExhaustStream (th_main, _V(0,-0.76,-15.9), &contrail_main);
AddExhaustStream (th_main, _V(0,1.89,-15.9), &contrail_main);
PARTICLESTREAMSPEC contrail_hover = {
		0,1, 3, 33, .3, 1, 4, 3,  PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_PSQRT, 0, 2,
		PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
	};
	
	PARTICLESTREAMSPEC exhaust_hover = {
		0,.5, 25, 50, .1, .05, 7, 1,  PARTICLESTREAMSPEC::EMISSIVE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, 1e-5, 0.1
	};
 
		th_hover = CreateThruster (_V(0,0,0), _V(0,1,0), MAXHOVERTH, TANK, ISP);
	CreateThrusterGroup (&th_hover, 1, THGROUP_HOVER);
	AddExhaust (th_hover, 6, 1, _V(0.64,-1.5,9.378), _V(0,-1,0),tex_hover);
	AddExhaust (th_hover, 6, 1, _V(-0.64,-1.5,9.378), _V(0,-1,0),tex_hover);	
	AddExhaust (th_hover, 6, 1, _V(-0.64,-1.5,-9.399), _V(0,-1,0),tex_hover);	
	AddExhaust (th_hover, 6, 1, _V(0.64,-1.5,-9.399), _V(0,-1,0),tex_hover);	
AddExhaustStream (th_hover, _V(0.64,-1.5,9.378), &contrail_hover);
AddExhaustStream (th_hover, _V(0.64,-1.5,9.378), &contrail_hover);
AddExhaustStream (th_hover, _V(0.64,-1.5,-9.399), &contrail_hover);
AddExhaustStream (th_hover, _V(0.64,-1.5,-9.399), &contrail_hover);

	th_retro = CreateThruster (_V(0,0,4.3), _V(0,0,-1), MAXRETROTH, TANK, ISP);
	CreateThrusterGroup (&th_retro, 1, THGROUP_RETRO);
AddExhaust (th_retro, 1, .1, _V(6.234,-0.34,7.375), _V(0,0,1),tex_retro);	
AddExhaust (th_retro, 1, .1, _V(-6.234,-0.34,7.375), _V(0,0,1),tex_retro);	
AddExhaust (th_retro, 1, .1, _V(6.234,-0.34,-8.45), _V(0,0,1),tex_retro);	
AddExhaust (th_retro, 1, .1, _V(-6.234,-0.34,-8.45), _V(0,0,1),tex_retro);


i looked at the new eagle sources and it has no flight dynamics. So what I'm missing?

Code:
// Class NewEagle
// Archivo de código NewEagle.cpp
// By Hispaorbiter; February, 2004
// =================================

#include "NewEagle.h"

	// Banderas booleanas de estado de la nave
	bool bPodSeparate=false;
	bool bModuleSeparate=false;
	
	// Por defecto, la vista es exterior
	int bExtInt=1;

	//Características de las partículas de humo
	static PARTICLESTREAMSPEC contrail_main = {
		0, 8.0, 5, 150, 0.3, 4.0, 4, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
	};
	static PARTICLESTREAMSPEC exhaust_main = {
		0, 2.0, 20, 150, 0.1, 0.2, 16, 2.0, PARTICLESTREAMSPEC::EMISSIVE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, 1e-5, 0.1
	};
	static PARTICLESTREAMSPEC exhaust_hover = {
		0, 1.0, 5, 50, 0.3, 2.0, 3, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, -0.1, 0.1
	};

// Constructor
NewEagle::NewEagle (OBJHANDLE hObj, int fmodel) : VESSEL (hObj, fmodel)
{
	// Banderas booleanas de estado de la nave
	bPodSeparate = false;
	bModuleSeparate = false;
	bVistaInt = 1;

	stage=0;

	// Localización de los motores principales
	MainEngineOfs[0]=_V(    0,-0.75,-15.5);
	MainEngineOfs[1]=_V(    0, 1.91,-15.5);
	MainEngineOfs[2]=_V( 2.45, 0.59,-15.5);
	MainEngineOfs[3]=_V(-2.45, 0.59,-15.5);
	//Motores elevadores
	// Los de la estructura principal
	HoverEngineOfs[0]=_V( 0.63,-2.83,12);
	HoverEngineOfs[1]=_V(-0.63,-2.83,12);
	HoverEngineOfs[2]=_V(-0.63,-2.83,-6.71);
	HoverEngineOfs[3]=_V( 0.63,-2.83,-6.71);
	// Los del módulo de carga
	HoverEngineOfs[4]=_V( 1.00,-3.15, 6.56);
	HoverEngineOfs[5]=_V(-1.00,-3.15, 6.56);
	HoverEngineOfs[6]=_V(-1.00,-3.15,-1.32);
	HoverEngineOfs[7]=_V( 1.00,-3.15,-1.32);
	// Impulsores de control de posición del cuerpo principal
	RCSTransporterOfs[0]=_V(6.224432,-0.3,10.238448);
	RCSTransporterOfs[1]=_V(-6.224432,-0.3,10.238448);
	RCSTransporterOfs[2]=_V(6.224432,-0.3,-5.573767);
	RCSTransporterOfs[3]=_V(-6.224432,-0.3,-5.573767);

	// Creación del tanque de combustible
	ph_main=CreatePropellantResource(MAX_FUEL);
}

// Destructor
NewEagle::~NewEagle ()
{
	
}

bool NewEagle::PasarLosHumos(bool humo)
{
	int NumHover, i;
	double level, alt;
	level=GetThrusterGroupLevel(THGROUP_HOVER);
	alt=GetAltitude();
	// If stage=1 only 4 hovers, here's no cargo module
	if (stage == 1)
		NumHover=4;
	else
		NumHover=8;
	// Conditions to add smoke to hovers:
	// 1: Altitude below 10m
	// 2: Here's no previous defined smoke for hovers (humo flag in false condition)
	if ((alt <10) && (!humo))
	{
		for (i=0; i<NumHover; i++)
			hover_humo[i]=AddExhaustStream (th_hover[i], _V(HoverEngineOfs[i].x,HoverEngineOfs[i].y-7.5,HoverEngineOfs[i].z), &exhaust_hover);
		return true;
	};
	// Conditions to delete smoke to hovers:
	// 1: Altitude above 10m
	// 2: Previosly defined smoke for hovers (humo flag in true condition)
	if ((alt>10) && (humo))
	{
		SetThrusterGroupLevel(THGROUP_HOVER,0.0);
		for (i=0; i<NumHover; i++)
			DelExhaustStream (hover_humo[i]);
		SetThrusterGroupLevel(THGROUP_HOVER,level);
		return false;
	}
	return humo;
}

void NewEagle::UbicarVista(int i)
{
	switch (i)
		{
		case 1:
			SetCameraOffset(_V(0,0,20));
			break;
		case 2:
			SetCameraOffset(CAMERA_OFFSET_PILOT);
			break;
		case 3:
			SetCameraOffset(CAMERA_OFFSET_COPILOT);
			break;
		};
	bVistaInt=i;
}

// Ubicar los motores y las salidas de gases para el cuerpo principal según el estado de la nave
void NewEagle::AddTransporterExhaust()
{
	int i,NumHover;

	//Se crean los motores principales y sus escapes con humo
	for (i=0; i<4; i++)
	{
		th_main[i] = CreateThruster (_V(0,0,0), _V(0,0,1), MAX_MAIN_THRUST, ph_main, ISP_FUS);
		AddExhaust (th_main[i],2,0.5,_V(MainEngineOfs[i].x,MainEngineOfs[i].y,MainEngineOfs[i].z+2.3),_V(0,0,-1));
		AddExhaustStream (th_main[i], MainEngineOfs[i], &exhaust_main);
	};
	AddExhaustStream (th_main[1],_V(0,0,-24),&contrail_main);

	// Se crea el grupo motor principal
	thg_main = CreateThrusterGroup (th_main, 4, THGROUP_MAIN);
	
	//Motores elevadores
	if (stage ==1)
	{
		SetEngineLevel(ENGINE_HOVER,0.0);
		for (i=3; i<8; i++)
			DelThruster (th_hover[i]);
		NumHover=4;
	}

	else
		NumHover=8;
	for (i=0; i<NumHover; i++)
	{
		th_hover[i] = CreateThruster (_V(0,0,0), _V(0,1,0), MAX_HOVER_THRUST, ph_main, ISP_QUI);
		AddExhaust (th_hover[i], 0.3, 0.5,_V(HoverEngineOfs[i].x,HoverEngineOfs[i].y+1.3,HoverEngineOfs[i].z),_V(0,-1,1));
	}
	
	// Se crea el grupo motor elevador
	thg_hover = CreateThrusterGroup (th_hover, NumHover, THGROUP_HOVER);

	// Impulsores de control de posición
	// Para mejorar la navegabilidad, los motores están ubicados en posiciones diferentes a los escapes

	// Grupo delantero derecho

	// Delantero derecho superior
	th_rcs[0]=CreateThruster(_V(6,0,10),_V(0,-1,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[0],1,0.1,RCSTransporterOfs[0],_V(0,1,0));
	// Delantero derecho inferior
	th_rcs[1]=CreateThruster(_V(6,0,10),_V(0,1,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[1],1,0.1,RCSTransporterOfs[0],_V(0,-1,0));
	// Delantero derecho proa
	th_rcs[2]=CreateThruster(_V(6,0,10),_V(0,0,-1),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[2],1,0.1,RCSTransporterOfs[0],_V(0,0,1));
	// Delantero derecho popa
	th_rcs[3]=CreateThruster(_V(6,0,10),_V(0,0,1),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[3],1,0.1,RCSTransporterOfs[0],_V(0,0,-1));
	// Delantero derecho exterior
	th_rcs[4]=CreateThruster(_V(6,0,10),_V(-1,0,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[4],1,0.1,RCSTransporterOfs[0],_V(1,0,0));

	// Grupo delantero izquierdo

	// Delantero izquierdo superior
	th_rcs[5]=CreateThruster(_V(-6,0,10),_V(0,-1,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[5],1,0.1,RCSTransporterOfs[1],_V(0,1,0));
	// Delantero izquierdo inferior
	th_rcs[6]=CreateThruster(_V(-6,0,10),_V(0,1,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[6],1,0.1,RCSTransporterOfs[1],_V(0,-1,0));
	// Delantero izquierdo proa
	th_rcs[7]=CreateThruster(_V(-6,0,10),_V(0,0,-1),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[7],1,0.1,RCSTransporterOfs[1],_V(0,0,1));
	// Delantero izquierdo popa
	th_rcs[8]=CreateThruster(_V(-6,0,10),_V(0,0,1),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[8],1,0.1,RCSTransporterOfs[1],_V(0,0,-1));
	// Delantero izquierdo exterior
	th_rcs[9]=CreateThruster(_V(-6,0,10),_V(1,0,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[9],1,0.1,RCSTransporterOfs[1],_V(-1,0,0));

	// Grupo trasero derecho

	// Trasero derecho superior
	th_rcs[10]=CreateThruster(_V(6,0,-10),_V(0,-1,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[10],1,0.1,RCSTransporterOfs[2],_V(0,1,0));
	// Trasero derecho inferior
	th_rcs[11]=CreateThruster(_V(6,0,-10),_V(0,1,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[11],1,0.1,RCSTransporterOfs[2],_V(0,-1,0));
	// Trasero derecho proa
	th_rcs[12]=CreateThruster(_V(6,0,-10),_V(0,0,-1),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[12],1,0.1,RCSTransporterOfs[2],_V(0,0,1));
	// Trasero derecho popa
	th_rcs[13]=CreateThruster(_V(6,0,-10),_V(0,0,1),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[13],1,0.1,RCSTransporterOfs[2],_V(0,0,-1));
	// Trasero derecho exterior
	th_rcs[14]=CreateThruster(_V(6,0,-10),_V(-1,0,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[14],1,0.1,RCSTransporterOfs[2],_V(1,0,0));

	// Grupo trasero izquierdo

	// Trasero izquierdo superior
	th_rcs[15]=CreateThruster(_V(-6,0,-10),_V(0,-1,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[15],1,0.1,RCSTransporterOfs[3],_V(0,1,0));
	// Trasero izquierdo inferior
	th_rcs[16]=CreateThruster(_V(-6,0,-10),_V(0,1,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[16],1,0.1,RCSTransporterOfs[3],_V(0,-1,0));
	// Trasero izquierdo proa
	th_rcs[17]=CreateThruster(_V(-6,0,-10),_V(0,0,-1),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[17],1,0.1,RCSTransporterOfs[3],_V(0,0,1));
	// Trasero izquierdo popa
	th_rcs[18]=CreateThruster(_V(-6,0,-10),_V(0,0,1),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[18],1,0.1,RCSTransporterOfs[3],_V(0,0,-1));
	// Trasero izquierdo exterior
	th_rcs[19]=CreateThruster(_V(-6,0,-10),_V(1,0,0),MAX_RCS_THRUST,ph_main,ISP_QUI);
	AddExhaust (th_rcs[19],1,0.1,RCSTransporterOfs[3],_V(-1,0,0));

	// Se crean los grupos motores para los diferentes movimientos de la nave

	// 1-Movimientos rotacionales

	// Grupo motor de cabeceo hacia arriba "PITCH-UP"
	th_group[0]=th_rcs[1];
	th_group[1]=th_rcs[6];
	th_group[2]=th_rcs[10];
	th_group[3]=th_rcs[15];
	CreateThrusterGroup(th_group,4,THGROUP_ATT_PITCHUP);

	// Grupo motor de cabeceo hacia abajo "PITCH-DOWN"
	th_group[0]=th_rcs[0];
	th_group[1]=th_rcs[5];
	th_group[2]=th_rcs[11];
	th_group[3]=th_rcs[16];
	CreateThrusterGroup(th_group,4,THGROUP_ATT_PITCHDOWN);

	// Grupo motor de balanceo izquierda "YAW-RIGHT"
	th_group[0]=th_rcs[8];
	th_group[1]=th_rcs[18];
	th_group[2]=th_rcs[2];
	th_group[3]=th_rcs[12];
	CreateThrusterGroup(th_group,4,THGROUP_ATT_YAWRIGHT);

	// Grupo motor de balanceo derecha "YAW-LEFT"
	th_group[0]=th_rcs[3];
	th_group[1]=th_rcs[13];
	th_group[2]=th_rcs[7];
	th_group[3]=th_rcs[17];
	CreateThrusterGroup(th_group,4,THGROUP_ATT_YAWLEFT);

	// Grupo motor de alabeo derecho "BANK-RIGHT"
	th_group[0]=th_rcs[0];
	th_group[1]=th_rcs[6];
	th_group[2]=th_rcs[10];
	th_group[3]=th_rcs[16];
	CreateThrusterGroup(th_group,4,THGROUP_ATT_BANKRIGHT);

	// Grupo motor de alabeo izquierdo "BANK-LEFT"
	th_group[0]=th_rcs[1];
	th_group[1]=th_rcs[5];
	th_group[2]=th_rcs[11];
	th_group[3]=th_rcs[15];
	CreateThrusterGroup(th_group,4,THGROUP_ATT_BANKLEFT);

	// 2-Movimientos traslacionales

	// Grupo motor de traslación derecha "RIGHT"
	// Este grupo lo podían formar los impulsores izquierdos delantero de proa y trasero de popa
	th_group[0]=th_rcs[9];
	th_group[1]=th_rcs[19];
	CreateThrusterGroup(th_group,2,THGROUP_ATT_RIGHT);

	// Grupo motor de traslación izquierda "LEFT"
	// Este grupo lo podían formar los impulsores derechos delantero de proa y trasero de popa
	th_group[0]=th_rcs[4];
	th_group[1]=th_rcs[14];
	CreateThrusterGroup(th_group,2,THGROUP_ATT_LEFT);

	// Grupo motor de traslación arriba "DOWN"
	th_group[0]=th_rcs[0];
	th_group[1]=th_rcs[5];
	th_group[2]=th_rcs[10];
	th_group[3]=th_rcs[15];
	CreateThrusterGroup(th_group,4,THGROUP_ATT_DOWN);

	// Grupo motor de traslación abajo "UP"
	th_group[0]=th_rcs[1];
	th_group[1]=th_rcs[6];
	th_group[2]=th_rcs[11];
	th_group[3]=th_rcs[16];
	CreateThrusterGroup(th_group,4,THGROUP_ATT_UP);

	// Grupo motor de traslación adelante "FORWARD"
	th_group[0]=th_rcs[3];
	th_group[1]=th_rcs[8];
	th_group[2]=th_rcs[13];
	th_group[3]=th_rcs[18];
	CreateThrusterGroup(th_group,4,THGROUP_ATT_FORWARD);

	// Grupo motor de traslación atrás "BACK"
	th_group[0]=th_rcs[2];
	th_group[1]=th_rcs[7];
	th_group[2]=th_rcs[12];
	th_group[3]=th_rcs[17];
	CreateThrusterGroup(th_group,4,THGROUP_ATT_BACK);
}

void NewEagle::SetRetros(bool ban)
{
	int i;
	double MAX_RETRO_THRUST;

	if (ban)
		MAX_RETRO_THRUST=160000.0;
	else
		MAX_RETRO_THRUST=0.0;
	//Se crean los motores retropropulsores
	for (i=0; i<4; i++)
	{
		th_retro[i]=CreateThruster(_V(0,0,0),_V(0,0,-1), MAX_RETRO_THRUST, ph_main, ISP_QUI);
		AddExhaust (th_retro[i],2,0.1,RCSTransporterOfs[i],_V(0,0,1));
	}

	// Se crea el grupo motor retropropulsor
	thg_retro=CreateThrusterGroup(th_retro,4,THGROUP_RETRO);
}

// Inicialización del Eagle completo
void NewEagle::SetTransporter()
{
	int i;
	SetSize(EAGLE_SIZE);
	SetPMI (PMI);
	SetCrossSections (CROSS_SECTION);
	SetCW (0.2, 0.2, 1.5, 1.5);
	SetRotDrag (ROT_DRAG);
	SetPitchMomentScale(PITCH_MOMENT_SCALE);
	SetBankMomentScale (BANK_MOMENT_SCALE);
	SetDockParams(MODULE_DOCK_OFS,_V(1,0,0),_V(0,1,0));
	SetTouchdownPoints(TP1,TP2,TP3);
	ClearMeshes();
	ClearExhaustRefs();
	AddMesh ("eagle1y", &OFS_TRANSPORTER);
	i=AddMesh ("eagle1p", &OFS_POD);
	SetMeshVisibilityMode(i,MESHVIS_ALWAYS);
	AddTransporterExhaust();
	// Llamada a PasarLosHumos forzando la situación de los humos según la altura
	if (GetAltitude()<10)
		// Esta llamada fuerza los humos a activos
		HoverSmoke=PasarLosHumos(false);
	else
		// En caso contrario, se fuerzan los humos a inactivos
		HoverSmoke=PasarLosHumos(true);
}

// Lectura de estado del escenario
void NewEagle::LoadState(FILEHANDLE scn, void *vs)
{
    char *line;

	stage=0;			// Transporter completo por defecto
	bVistaInt=1;		// Vista exterior por defecto
	MODULE_MASS=0;		// Masa del módulo por defecto, también por si las moscas

	while (oapiReadScenario_nextline (scn, line)) 
	{
		// Lectura de STAGE (con o sin modulo)
        if (!strnicmp (line, "STAGE", 5)) 
			sscanf (line+5, "%d%lf", &stage);
		// Lectura de modo vista de cabina
		else if (!strnicmp (line, "INTVIEW", 7))
			sscanf (line+7, "%d%lf", &bVistaInt);	
		// Lectura del mesh del módulo
		else if (!strnicmp (line, "MODULE", 6))
				sscanf (line+6, "%s", module);
		// Masa del modulo
		else if (!strnicmp (line, "MASSMODULE", 10))
				sscanf (line+10, "%d%lf", &MODULE_MASS);							
		// Lectura del estado de los retros
		else if (!strnicmp (line, "RETRO", 5))
				sscanf (line+5, "%s", retro);
		else
		{
			 // Si la opción no es reconocida, pasarsela al orbiter para que la analice
			 ParseScenarioLineEx (line, vs);
        }
    }
	SetTransporter();
	// Y poner los retros (o no)
	if (retro == "OFF")
		SetRetros(false);
	else
		SetRetros(true);
	if (stage == 0)
	{
		AddMesh(module,&OFS_MODULE);
		SetEmptyMass(EAGLE_EMPTY_MASS+MODULE_MASS+POD_MASS);
	}
	else
		SetEmptyMass(EAGLE_EMPTY_MASS+POD_MASS);
	UbicarVista(bVistaInt);
}

// Grabación de estado en el escenario
void NewEagle::SaveState(FILEHANDLE scn)
{
	SaveDefaultState(scn);
	oapiWriteScenario_int (scn, "STAGE", stage);
	oapiWriteScenario_int (scn, "INTVIEW", bVistaInt);
	if (stage == 0)
	{
		oapiWriteScenario_string (scn,"MODULE", module);
		oapiWriteScenario_int (scn, "MASSMODULE", MODULE_MASS);
	}
	oapiWriteScenario_string (scn,"RETRO", retro);
}

// Gestión del estado de la nave
void NewEagle::Estado()
{
	HoverSmoke=PasarLosHumos(HoverSmoke);
}

// ==============================================================
// API interface
// ==============================================================

// Inicialización
DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel)
{
	return new NewEagle (hvessel, flightmodel);
}

// Destrucción
DLLCLBK void ovcExit (VESSEL *vessel)
{
	if (vessel) delete (NewEagle*)vessel;
}

// Gestión de entradas por teclado
DLLCLBK int ovcConsumeKey (VESSEL *vessel, const char *keystate)
{
	// OBJHANDLE hvessel;
	if (KEYMOD_SHIFT (keystate)) 
	{
		return 0; // shift combinations are reserved
	}
	else if (KEYMOD_CONTROL (keystate)) 
	{
		// insert ctrl key combinations here
	}
	else 
	{ // unmodified keys
		if (KEYDOWN (keystate, OAPI_KEY_1)) { // Cambio a vista externa
			if (oapiAcceptDelayedKey (OAPI_KEY_1, 1.0))
				((NewEagle*)vessel)->UbicarVista(1);
		}
		if (KEYDOWN (keystate, OAPI_KEY_2)) { // Cambio a vista piloto
			if (oapiAcceptDelayedKey (OAPI_KEY_2, 1.0))
				((NewEagle*)vessel)->UbicarVista(2);
		}
			if (KEYDOWN (keystate, OAPI_KEY_3)) { // Cambio a vista copiloto
			if (oapiAcceptDelayedKey (OAPI_KEY_3, 1.0))
				((NewEagle*)vessel)->UbicarVista(3);
		}
	}

	return 0;
}

// Inicialización del Eagle completo
DLLCLBK void ovcSetClassCaps (VESSEL *vessel, FILEHANDLE cfg)
{
	((NewEagle*)vessel)->SetTransporter();
}

// Llamada a la gestión de la nane en función de la situación actual
DLLCLBK void ovcTimestep (VESSEL *vessel, double simt)
{
	((NewEagle*)vessel)->Estado();
}

// Lee el estado de la nave desde el archivo de escenario
DLLCLBK void ovcLoadStateEx (VESSEL *vessel, FILEHANDLE scn, void *vs)
{
	((NewEagle*)vessel)->LoadState (scn, vs);
}

// Graba el estado de la nave en el archivo de escenario
DLLCLBK void ovcSaveState (VESSEL *vessel, FILEHANDLE scn)
{
	((NewEagle*)vessel)->SaveState (scn);
}
 
Ok I have modified the eagle3 to match the NEWeagle. It flys much better.

But one thing I haven't gotten to work yet. is this.

If you are below 10m then add exhaust stream which is the hover dust.

I can't get it to show the smoke.

Here is the neweagle code:
Code:
...
if (GetAltitude()<10)
		// Esta llamada fuerza los humos a activos
		HoverSmoke=PasarLosHumos(false);
	else
		// En caso contrario, se fuerzan los humos a inactivos
		HoverSmoke=PasarLosHumos(true);
...



bool NewEagle::PasarLosHumos(bool humo)
{
	int NumHover, i;
	double level, alt;
	level=GetThrusterGroupLevel(THGROUP_HOVER);
	alt=GetAltitude();
	// If stage=1 only 4 hovers, here's no cargo module
	if (stage == 1)
		NumHover=4;
	else
		NumHover=8;
	// Conditions to add smoke to hovers:
	// 1: Altitude below 10m
	// 2: Here's no previous defined smoke for hovers (humo flag in false condition)
	if ((alt <10) && (!humo))
	{
		for (i=0; i<NumHover; i++)
			hover_humo[i]=AddExhaustStream (th_hover[i], _V(HoverEngineOfs[i].x,HoverEngineOfs[i].y-7.5,HoverEngineOfs[i].z), &exhaust_hover);
		return true;
	};
	// Conditions to delete smoke to hovers:
	// 1: Altitude above 10m
	// 2: Previosly defined smoke for hovers (humo flag in true condition)
	if ((alt>10) && (humo))
	{
		SetThrusterGroupLevel(THGROUP_HOVER,0.0);
		for (i=0; i<NumHover; i++)
			DelExhaustStream (hover_humo[i]);
		SetThrusterGroupLevel(THGROUP_HOVER,level);
		return false;
	}
	return humo;
}

void NewEagle::Estado()
{
	HoverSmoke=PasarLosHumos(HoverSmoke);
}

I know that humo translates into smoke.

But appears it never goes to the add exhaust stream.

here is my code.
Code:
bool EAGLE3::PasarLosHumos(bool humo)
{
	//PARTICLESTREAMSPEC contrail_hover = {
	//	0,1, 3, 33, .3, 1, 4, 3,  PARTICLESTREAMSPEC::DIFFUSE,
	//	PARTICLESTREAMSPEC::LVL_PSQRT, 0, 2,
	//	PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
	//};
	PARTICLESTREAMSPEC exhaust_hover = {
		0, 1.0, 5, 50, 0.3, 2.0, 3, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, -0.1, 0.1
	};



	double level, alt;
	level=GetThrusterGroupLevel(THGROUP_HOVER);
	alt=GetAltitude();
	
	// Conditions to add smoke to hovers:
	// 1: Altitude below 10m
	// 2: Here's no previous defined smoke for hovers (SMOKE flag in false condition)
	if ((alt <10) && (!humo))
	{

		return true;
AddExhaustStream (th_hover, _V(0.64,-1.5,9.378), &exhaust_hover);
AddExhaustStream (th_hover, _V(-0.64,-1.5,9.378), &exhaust_hover);
AddExhaustStream (th_hover, _V(-0.64,-1.5,-9.399), &exhaust_hover);
AddExhaustStream (th_hover, _V(0.64,-1.5,-9.399), &exhaust_hover);
				return true;
	};
	// Conditions to delete smoke to hovers:
	// 1: Altitude above 10m
	// 2: Previosly defined smoke for hovers (humo flag in true condition)
	if ((alt>10) && (humo))
	{
//			DelExhaustStream (th_hover);
		return false;
	}
	return humo;
}
....


void EAGLE3::Estado()
{
	HoverSmoke=PasarLosHumos(HoverSmoke);
}


ALSO no retros.
Code:
void NewEagle::SetRetros(bool ban)
{
	int i;
	double MAX_RETRO_THRUST;

	if (ban)
		MAX_RETRO_THRUST=160000.0;
	else
		MAX_RETRO_THRUST=0.0;
	//Se crean los motores retropropulsores
	for (i=0; i<4; i++)
	{
		th_retro[i]=CreateThruster(_V(0,0,0),_V(0,0,-1), MAX_RETRO_THRUST, ph_main, ISP_QUI);
		AddExhaust (th_retro[i],2,0.1,RCSTransporterOfs[i],_V(0,0,1));
	}

	// Se crea el grupo motor retropropulsor
	thg_retro=CreateThrusterGroup(th_retro,4,THGROUP_RETRO);
}

not sure where is see if the retro are fired. I assumed it is ban. But no where is ban defined.
 
Last edited:
I think I recognize this code. :) Are you sure you're calling all these functions from the apropiate DLLCLBK?

Code:
// Llamada a la gestión de la nane en función de la situación actual
DLLCLBK void ovcTimestep (VESSEL *vessel, double simt)
{
	((NewEagle*)vessel)->Estado();

Also you could test smoke function forcing it to "smoke on" condition on initialization function.

As for aerodynamics questions, I've no idea; I'm too sorry.
 
I think I recognize this code. :) Are you sure you're calling all these functions from the apropiate DLLCLBK?

Code:
// Llamada a la gestión de la nane en función de la situación actual
DLLCLBK void ovcTimestep (VESSEL *vessel, double simt)
{
    ((NewEagle*)vessel)->Estado();
Also you could test smoke function forcing it to "smoke on" condition on initialization function.

As for aerodynamics questions, I've no idea; I'm too sorry.

yep i have that also where is the smoke on
 
Some updates. EAGLE3
I have been in contact with Hispa. He has helped me get the eagle 3 flight much better in air. Got the smoke to work now can't get it to turn off and no retros as yet. I am working on getting the hover thrust to show if a Pod is attached labeled XS. The Lab Pod will have another id as it has different hover thruster.

MoonbaseAlpha

one thing we are adding is a crane/rail system to move an Eagle from the pad to the hangar.

eaglecrane1.jpg


eaglecrane.jpg



I have the crane and rail added and animation works it is just a matter of getting the attachment to move at the correct angles.
 
Sweet, love the idea of being able to reel it in and store it. Apad gets the same treatment?
 
yes, Apad is easier as the attachment is only in the z direction. The MBA pads are at angle. So I may need help on the coding
 
Got the crane and rails to work in MBA Yeah still have that bounce.

Also working on Eagle3. Can not delete the exhaust stream if above 10 meters

h - PSTREAM_HANDLE hover_humo[8];

cpp - // Conditions to delete smoke to hovers:
// 1: Altitude above 10m
// 2: Previosly defined smoke for hovers (humo flag in true condition)
if ((alt>10) && (humo))
{
SetThrusterGroupLevel(THGROUP_HOVER,0.0);
for (i=0; i<NumHover; i++)
DelExhaustStream (hover_humo);
SetThrusterGroupLevel(THGROUP_HOVER,level);
return false;
}
 
I'm loving this spanglish code :yes: but still no idea of why the damned exhausts are not deleted.
 
yeah got it. I added this in the void EAGLE3::clbkPostStep(double simt, double simdt, double mjd)
Code:
{
	int NumHover, i;
	double level, alt;
	level=GetThrusterGroupLevel(THGROUP_HOVER);
	alt=GetAltitude();
	// If stage=1 only 4 hovers, here's no cargo module
	if (stage == 1)
		NumHover=4;
	else
		NumHover=8;
	// Conditions to add smoke to hovers:
	// 1: Altitude below 10m
	// 2: Here's no previous defined smoke for hovers (humo flag in false condition)
	if ((alt <10) && (smoke==0))
	{
		for (i=0; i<NumHover; i++)
			hover_humo[i]=AddExhaustStream (th_hover[i], _V(HoverEngineOfs[i].x,HoverEngineOfs[i].y-7.5,HoverEngineOfs[i].z), &exhaust_hover);
		
		(smoke=1);
	};
	//sprintf(oapiDebugString(),"anim %2.2f", alt);
	// Conditions to delete smoke to hovers:
	// 1: Altitude above 10m
	//(humo=true);// 2: Previosly defined smoke for hovers (humo flag in true condition)
	if ((alt>10) &&(smoke==1))//&& (humo))
	{
		//sprintf(oapiDebugString(),"anim %2.2f", alt);

		SetThrusterGroupLevel(THGROUP_HOVER,0.0);
		for (i=0; i<NumHover; i++)
			DelExhaustStream (hover_humo[i]);
		SetThrusterGroupLevel(THGROUP_HOVER,level);
		(smoke=0);
	}
	
}

Now to get it to see the id of xs this let the eagle know that a pod is attached and to show the hover thruster under the pod
 
You should really compile all the current download links into the original post. I've had to start a whole new installation for P1 and I'm just not going to take the time and energy to dig through the entire thread again.
 
Thanks. I understand.

---------- Post added 09-21-10 at 07:36 AM ---------- Previous post was 09-20-10 at 08:53 PM ----------

Ok the eagle 3 runs good in 2006 but I have it running in 2010. The exception is the hover exhaust.

not sure what I am missing.

Code:
PARTICLESTREAMSPEC exhaust_hover = {
		0, 1.0, 5, 50, 0.3, 2.0, 3, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, -0.1, 0.1
	};

		th_hover = CreateThruster (_V(0,0,0), _V(0,1,0), MAXHOVERTH, TANK, ISP_FUS);
	CreateThrusterGroup (&th_hover, 1, THGROUP_HOVER);
AddExhaustStream (th_hover,_V(0.64,-1.5,9.378) , &exhaust_hover);
			AddExhaustStream (th_hover,_V(-0.64,-1.5,9.378) , &exhaust_hover);
			AddExhaustStream (th_hover,_V(-0.64,-1.5,-9.399) , &exhaust_hover);
			AddExhaustStream (th_hover,_V(0.64,-1.5,-9.399) , &exhaust_hover);

no hover smoke

but if I change the name to contrail_main I do get smoke.
Code:
PARTICLESTREAMSPEC contrail_main = {
		0,7, 3, 150, .3, 3.5, 4, 3,  PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_PSQRT, 0, 2,
		PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
	};
 
no hover smoke
You need to add both exhaust and contrail to the engine, like for example it's done for DeltaGlider in DeltaGlider.cpp:
Code:
PARTICLESTREAMSPEC contrail = {
	0, 8.0, 4, 150, 0.25, 3.0, 4, 3.0, PARTICLESTREAMSPEC::DIFFUSE,
	PARTICLESTREAMSPEC::LVL_PSQRT, 0, 2,
	PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1,
	contrail_tex
};

PARTICLESTREAMSPEC exhaust_hover = {
	0, 1.5, 20, 150, 0.1, 0.15, 9, 1.0, PARTICLESTREAMSPEC::EMISSIVE,
	PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
	PARTICLESTREAMSPEC::ATM_PLOG, 1e-5, 0.1
};


//...
// snip
//...

AddExhaustStream (th_hover[0], _V(0,-4,0), &contrail);
AddExhaustStream (th_hover[0], _V(0,-2,3), &exhaust_hover);
The contrail here is the smoke you're missing.
 
Sorry i have this set up like this:
Code:
		th_hover = CreateThruster (_V(0,0,0), _V(0,1,0), MAXHOVERTH, TANK, ISP_FUS);
	CreateThrusterGroup (&th_hover, 1, THGROUP_HOVER);
			//AddExhaustStream (th_hover,_V(0.64,-1.5,9.378) , &contrail_main);
			//AddExhaustStream (th_hover,_V(-0.64,-1.5,9.378) , &exhaust_hover);
			//AddExhaustStream (th_hover,_V(-0.64,-1.5,-9.399) , &exhaust_hover);
			//AddExhaustStream (th_hover,_V(0.64,-1.5,-9.399) , &exhaust_hover);






	//thg_hover = CreateThrusterGroup (th_hover, 8, THGROUP_HOVER);	


	AddExhaust (th_hover, 0.3, 0.5, _V(0.64,-1.5,9.378), _V(0,-1,0));
	AddExhaust (th_hover, 0.3, 0.5, _V(-0.64,-1.5,9.378), _V(0,-1,0));	
	AddExhaust (th_hover, 0.3, 0.5, _V(-0.64,-1.5,-9.399), _V(0,-1,0));	
AddExhaust (th_hover,  0.3, 0.5, _V(0.64,-1.5,-9.399), _V(0,-1,0));
I get the flame part.

But in the :
Code:
void EAGLE3::clbkPostStep(double simt, double simdt, double mjd)

{
 	PARTICLESTREAMSPEC contrail_hover = {
		0, 1.0, 5, 50, 0.3, 2.0, 3, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, -0.1, 0.1
	};

...


AddExhaustStream (th_hover,_V(0.64,-8,9.378) , &contrail_hover);

I did this so I can del the smoke if above 10m. Right now I am trying just to get the hovers to smoke.
 
The clbkPostStep is called every frame after it has been rendered, so if there is no condition that is checked before calling AddExhaustStream, you set the AddExhaustStream after every frame. I can't check it right now, but this could be the problem.

Are you using some flag, that is set after exhaust stream was added or deleted? The stream should be added or deleted only once after the altitude condition was met. Also, have you tried to do this all in clbkPreStep?
 
ok thanks. I have redone the code. Only the contrail_main is smoking

Code:
PARTICLESTREAMSPEC contrail_hover = {
		0, 1.0, 5, 50, 0.3, 2.0, 3, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, -0.1, 0.1
	};


	th_hover = CreateThruster (_V(0,0,0), _V(0,1,0), MAXHOVERTH, TANK, ISP_FUS);
	CreateThrusterGroup (&th_hover, 1, THGROUP_HOVER);
			AddExhaustStream (th_hover,_V(0.64,-1.5,9.378) , &contrail_main);
			AddExhaustStream (th_hover,_V(-0.64,-1.5,9.378) , &contrail_hover);
			AddExhaustStream (th_hover,_V(-0.64,-1.5,-9.399) , &contrail_hover);
			AddExhaustStream (th_hover,_V(0.64,-1.5,-9.399) , &contrail_hover);

	AddExhaust (th_hover, 0.3, 0.5, _V(0.64,-1.5,9.378), _V(0,-1,0));
	AddExhaust (th_hover, 0.3, 0.5, _V(-0.64,-1.5,9.378), _V(0,-1,0));	
	AddExhaust (th_hover, 0.3, 0.5, _V(-0.64,-1.5,-9.399), _V(0,-1,0));	
AddExhaust (th_hover,  0.3, 0.5, _V(0.64,-1.5,-9.399), _V(0,-1,0));


once I get this going. Then there are conditions to smoke or not to smoke.

---------- Post added at 10:00 AM ---------- Previous post was at 08:54 AM ----------

Ok this is odd

Add changed the name to match the dg and then smoke:
Code:
PARTICLESTREAMSPEC contrail = {
	0, 8.0, 4, 150, 0.25, 3.0, 4, 3.0, PARTICLESTREAMSPEC::DIFFUSE,
	PARTICLESTREAMSPEC::LVL_PSQRT, 0, 2,
	PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1,
};

Then I copied my spec over into it and now no smoke.
Code:
PARTICLESTREAMSPEC contrail = {
	0, 1.0, 5, 50, 0.3, 2.0, 3, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
		PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
		PARTICLESTREAMSPEC::ATM_PLOG, -0.1, 0.1

};

These work great for 2006. These are the spec for the NEWEAGLE which runs in 2006 and 2010

---------- Post added at 08:21 PM ---------- Previous post was at 10:00 AM ----------

still no smoke in 2010.
Code:
   PROPELLANT_HANDLE TANK;
   TANK = CreatePropellantResource (MAX_FUEL);
    PARTICLESTREAMSPEC contrail_main = {
        0,7, 3, 150, .3, 3.5, 4, 3,  PARTICLESTREAMSPEC::DIFFUSE,
        PARTICLESTREAMSPEC::LVL_PSQRT, 0, 2,
        PARTICLESTREAMSPEC::ATM_PLOG, 1e-4, 1
    };
    
    PARTICLESTREAMSPEC exhaust_main = {
        0,1.7, 10, 150, .1, .2, 16, 1,  PARTICLESTREAMSPEC::EMISSIVE,
        PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
        PARTICLESTREAMSPEC::ATM_PLOG, 1e-5, 0.1
    };
 PARTICLESTREAMSPEC contrail_hover= {
    0, 1.0, 5, 50, 0.3, 2.0, 3, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
        PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
        PARTICLESTREAMSPEC::ATM_PLOG, -0.1, 0.1
    };


    th_main[0] = CreateThruster (_V(0,0,-4.3), _V(0,0,1), MAXMAINTH, TANK, ISP_QUI);
    th_main[1] = CreateThruster (_V(0,0,-4.3), _V(0,0,1), MAXMAINTH, TANK, ISP_QUI);
    th_main[2] = CreateThruster (_V(0,0,-4.3), _V(0,0,1), MAXMAINTH, TANK, ISP_QUI);
    th_main[3] = CreateThruster (_V(0,0,-4.3), _V(0,0,1), MAXMAINTH, TANK, ISP_QUI);

thg_main = CreateThrusterGroup (th_main, 4, THGROUP_MAIN);
AddExhaust (th_main[0],2,0.5, _V(2.45,0.57,-15.9), _V(0,0,-1));    
    AddExhaust (th_main[1],2,0.5, _V(-2.41,0.57,-15.9), _V(0,0,-1));    
    AddExhaust (th_main[2],2,0.5, _V(0,-0.76,-15.9), _V(0,0,-1));    
    AddExhaust (th_main[3], 2,0.5, _V(0,1.89,-15.9), _V(0,0,-1));

    AddExhaustStream (th_main[1], _V(0,0,-24), &contrail_main);

//hover
        th_hover = CreateThruster (_V(0,0,0), _V(0,1,0), MAXHOVERTH, TANK, ISP_FUS);
    CreateThrusterGroup (&th_hover, 1, THGROUP_HOVER);
    AddExhaust (th_hover, 0.3, 0.5, _V(0.64,-1.5,9.378), _V(0,-1,0));
    AddExhaust (th_hover, 0.3, 0.5, _V(-0.64,-1.5,9.378), _V(0,-1,0));    
    AddExhaust (th_hover, 0.3, 0.5, _V(-0.64,-1.5,-9.399), _V(0,-1,0));    
AddExhaust (th_hover,  0.3, 0.5, _V(0.64,-1.5,-9.399), _V(0,-1,0));

            AddExhaustStream (th_hover,_V(0.64,-1.5,9.378) , &contrail_hover);
            AddExhaustStream (th_hover,_V(-0.64,-1.5,9.378) , &contrail_hover);
            AddExhaustStream (th_hover,_V(-0.64,-1.5,-9.399) , &contrail_hover);
            AddExhaustStream (th_hover,_V(0.64,-1.5,-9.399) , &contrail_hover);

I get smoke for the main. It is like it doesn't recognize the contrail_hover. If I put contrail_main there I do get smoke. If I put Contrail_hover for the main then no smoke.
 
Last edited:
It recognizes contrail_hover, but alpha mapping is set wrong.
Code:
PARTICLESTREAMSPEC contrail_hover= {
    0, 1.0, 5, 50, 0.3, 2.0, 3, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
    PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
    PARTICLESTREAMSPEC::[color=red]ATM_PLOG[/color], [color=red]-0.1[/color], 0.1
};
The problem is with either minimum value for atmospheric alpha mapping, that needs to be higher than 0 for ATM_PLOG, or with mapping type selected for the chosen min and max mapping values. I didn't check this in Orbiter 2006, but I can reproduce the lack of smoke with your contrail_hover specifications in Orbiter 2010.


Try this one. I only changed atmospheric to alpha mapping to ATM_PLIN:
Code:
PARTICLESTREAMSPEC contrail_hover= {
    0, 1.0, 5, 50, 0.3, 2.0, 3, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
    PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
    PARTICLESTREAMSPEC::[color=blue]ATM_PLIN[/color], -0.1, 0.1
};
This contrail works in vacuum too.
 
Thanks that did it.:thumbup::tiphat:

Now I have moved it to :
Code:
void EAGLE3::clbkPostStep(double simt, double simdt, double mjd)

{
     PARTICLESTREAMSPEC contrail_hover= {
    0, 1.0, 5, 50, 0.3, 2.0, 3, 2.0, PARTICLESTREAMSPEC::DIFFUSE,
        PARTICLESTREAMSPEC::LVL_SQRT, 0, 1,
        PARTICLESTREAMSPEC::ATM_PLIN, -0.1, 0.1
    };

now the alitude is below 10m and smoke has NOT been on Smoke =0 then smoke
If Alt is above 10m and smoke and been on smoke =1 then turn off smoke.
but it looks like I have 2 sets of hover exhaust at the ground and then 1 set above the ground.




I have commented out this
Code:
//hover
        th_hover = CreateThruster (_V(0,0,0), _V(0,1,0), MAXHOVERTH, TANK, ISP_FUS);
    CreateThrusterGroup (&th_hover, 1, THGROUP_HOVER);
    AddExhaust (th_hover, 0.3, 0.5, _V(0.64,-1.5,9.378), _V(0,-1,0));
    AddExhaust (th_hover, 0.3, 0.5, _V(-0.64,-1.5,9.378), _V(0,-1,0));    
    AddExhaust (th_hover, 0.3, 0.5, _V(-0.64,-1.5,-9.399), _V(0,-1,0));    
AddExhaust (th_hover,  0.3, 0.5, _V(0.64,-1.5,-9.399), _V(0,-1,0));

    //        AddExhaustStream (th_hover,_V(0.64,-8,9.378) , &contrail_hover);
    //        AddExhaustStream (th_hover,_V(-0.64,-8,9.378) , &contrail_hover);
    //        AddExhaustStream (th_hover,_V(-0.64,-8,-9.399) , &contrail_hover);
    //        AddExhaustStream (th_hover,_V(0.64,-8,-9.399) , &contrail_hover);


Code:
//smoke
{
    
    };
    int NumHover, i;
    double level, alt;
    level=GetThrusterGroupLevel(THGROUP_HOVER);
    alt=GetAltitude();
    // If stage=1 only 4 hovers, here's no cargo module
    if (stage == 1)
        NumHover=4;
    else
        NumHover=8;
    // Conditions to add smoke to hovers:
    // 1: Altitude below 10m
    // 2: Here's no previous defined smoke for hovers (humo flag in false condition)
    if ((alt <10) && (smoke==0))
    {
        for (i=0; i<NumHover; i++)
            AddExhaustStream (th_hover,_V(0.64,-8,9.378) , &contrail_hover);
            AddExhaustStream (th_hover,_V(-0.64,-8,9.378) , &contrail_hover);
            AddExhaustStream (th_hover,_V(-0.64,-8,-9.399) , &contrail_hover);
            AddExhaustStream (th_hover,_V(0.64,-8,-9.399) , &contrail_hover);

        
        (smoke=1);
    };
    //sprintf(oapiDebugString(),"anim %2.2f", alt);
    // Conditions to delete smoke to hovers:
    // 1: Altitude above 10m
    //(humo=true);// 2: Previosly defined smoke for hovers (humo flag in true condition)
    if ((alt>10) &&(smoke==1))//&& (humo))
    //{
        //sprintf(oapiDebugString(),"anim %2.2f", alt);

        SetThrusterGroupLevel(THGROUP_HOVER,0.0);
    //    for (i=0; i<NumHover; i++)
            DelExhaustStream (th_hover);
        SetThrusterGroupLevel(THGROUP_HOVER,level);
        (smoke=0);
    }
 
Last edited:
You're giving wrong parameter to DelExhaustStream function. It shouldn't be thruster handle, but particle stream handle. You should do it rather this way:
PHP:
// defined in the class
PSTREAM_HANDLE hover_pstream [4];

/*...*/

// in function that adds hover contrail streams
hover_pstream [0] = AddExhaustStream (th_hover,_V(0.64,-8,9.378) , &contrail_hover);
hover_pstream [1] = AddExhaustStream (th_hover,_V(-0.64,-8,9.378) , &contrail_hover);
hover_pstream [2] = AddExhaustStream (th_hover,_V(-0.64,-8,-9.399) , &contrail_hover);
hover_pstream [3] = AddExhaustStream (th_hover,_V(0.64,-8,-9.399) , &contrail_hover);

/*...*/

// in function that deletes hover contrail streams
for (i = 0; i < NumHover; ++i) DelExhaustStream (hover_pstream [i]);
 
Last edited:
Thanks

I need to cut back on the smoke and there is still in the front a more defined smoke

no smoke above 10 yeah

Code:
/smoke
{
    
    };
    int NumHover, i;
    double level, alt;
    level=GetThrusterGroupLevel(THGROUP_HOVER);
    alt=GetAltitude();
    // If stage=1 only 4 hovers, here's no cargo module
    if (stage == 1)
        NumHover=4;
    else
        NumHover=8;
    // Conditions to add smoke to hovers:
    // 1: Altitude below 10m
    // 2: Here's no previous defined smoke for hovers (humo flag in false condition)
    if ((alt <10) && (smoke==0))
    {
        for (i=0; i<NumHover; i++)
hover_pstream [0] = AddExhaustStream (th_hover,_V(0.64,-8,9.378) , &contrail_hover);
hover_pstream [1] = AddExhaustStream (th_hover,_V(-0.64,-8,9.378) , &contrail_hover);
hover_pstream [2] = AddExhaustStream (th_hover,_V(-0.64,-8,-9.399) , &contrail_hover);
hover_pstream [3] = AddExhaustStream (th_hover,_V(0.64,-8,-9.399) , &contrail_hover);


        
        (smoke=1);
    };
    //sprintf(oapiDebugString(),"anim %2.2f", alt);
    // Conditions to delete smoke to hovers:
    // 1: Altitude above 10m
    //(humo=true);// 2: Previosly defined smoke for hovers (humo flag in true condition)
    if ((alt>10) &&(smoke==1))//&& (humo))
    //{
        //sprintf(oapiDebugString(),"anim %2.2f", alt);

        SetThrusterGroupLevel(THGROUP_HOVER,0.0);
    for (i = 0; i < NumHover; ++i) DelExhaustStream (hover_pstream [i]); 
        SetThrusterGroupLevel(THGROUP_HOVER,level);
        (smoke=0);
    }
    
//}

this is in the H
PSTREAM_HANDLE hover_pstream [4];
 
Last edited:
Back
Top