Beispiel #1
0
void Sat5Abort2::init()

{
	SetSize (15);
	SetCOG_elev (15.225);
	SetEmptyMass (233000);
	SetMaxFuelMass (471000);
	SetFuelMass(444760);
	//SetISP (ISP_SECOND_VAC);
	SetISP (4780);
	//slThrust = CalcSeaLevelThrust(THRUST_SECOND_VAC,ISP_SECOND_VAC,ISP_SECOND_SL, 106000);
	//vacThrust = THRUST_SECOND_VAC;
	//vessel->SetMaxThrust (ENGINE_MAIN, slThrust);
	SetMaxThrust (ENGINE_MAIN, 6008625);
	SetMaxThrust (ENGINE_RETRO, 0);
	SetMaxThrust (ENGINE_HOVER, 0);
	SetMaxThrust (ENGINE_ATTITUDE, 5e4);
	SetEngineLevel(ENGINE_MAIN, 0.0);
	SetPMI (_V(374,374,80));
	SetCrossSections (_V(524,524,97));
	SetCW (0.1, 0.3, 1.4, 1.4);
	SetRotDrag (_V(0.7,0.7,1.2));
	SetPitchMomentScale (0);
	SetBankMomentScale (0);
	SetLiftCoeffFunc (0);
    ClearMeshes();
    ClearExhaustRefs();
    ClearAttExhaustRefs();
	//vessel->ShiftCentreOfMass (_V(0,0,12.25));
	VECTOR3 mesh_dir=_V(0,0,-17.2-STG1O);
	AddMesh (hsat5stg2, &mesh_dir);
	mesh_dir=_V(0,0,2.-STG1O);
	AddMesh (hsat5stg3, &mesh_dir);
	mesh_dir=_V(-1.48,-1.48,14.55-STG1O);
	AddMesh (hsat5stg31, &mesh_dir);
	mesh_dir=_V(1.48,-1.48,14.55-STG1O);
	AddMesh (hsat5stg32, &mesh_dir);
	mesh_dir=_V(1.48,1.48,14.55-STG1O);
    AddMesh (hsat5stg33, &mesh_dir);
	mesh_dir=_V(-1.48,1.48,14.55-STG1O);
    AddMesh (hsat5stg34, &mesh_dir);
	mesh_dir=_V(0,SMVO,19.1-STG1O);
	AddMesh (hSM, &mesh_dir);
	VECTOR3 m_exhaust_ref = {0,0,-1};
	VECTOR3 m_exhaust_pos1= {0,0,-28.25-STG1O};
	VECTOR3 m_exhaust_pos2= {2,2,-28.25-STG1O};
	VECTOR3 m_exhaust_pos3= {-2,2,-28.25-STG1O};
	VECTOR3 m_exhaust_pos4 = {2,-2.0,-28.25-STG1O};
	VECTOR3 m_exhaust_pos5 = {-2,-2,-28.25-STG1O};
	AddExhaustRef (EXHAUST_MAIN, m_exhaust_pos1, 25.0, 1.5, &m_exhaust_ref);
	AddExhaustRef (EXHAUST_MAIN, m_exhaust_pos2, 25.0, 1.5, &m_exhaust_ref);
	AddExhaustRef (EXHAUST_MAIN, m_exhaust_pos3, 25.0, 1.5, &m_exhaust_ref);
	AddExhaustRef (EXHAUST_MAIN, m_exhaust_pos4, 25.0, 1.5, &m_exhaust_ref);
	AddExhaustRef (EXHAUST_MAIN, m_exhaust_pos5, 25.0, 1.5, &m_exhaust_ref);
	status = 3;
	SetCameraOffset (_V(-1,1.0,32.4-STG1O));
}
Beispiel #2
0
void LEM::SetLmLandedMesh() {

	ClearMeshes();
	VECTOR3 mesh_dir=_V(-0.003,-0.03,0.004);	
	UINT meshidx = AddMesh (hLMLanded, &mesh_dir);
	SetMeshVisibilityMode (meshidx, MESHVIS_VCEXTERNAL);

	Landed = true;
}
Beispiel #3
0
void EVA::init ()
{
	GoDock1 = false;
	SetSize (3.5);
	SetEmptyMass (115);
	SetMaxFuelMass (10);
	SetFuelMass (10);
	SetISP(10000);
	SetMaxThrust (ENGINE_ATTITUDE, 5);
	SetEngineLevel(ENGINE_MAIN, 0.0);
	SetPMI (_V(5,5,5));
	SetRotDrag (_V(0.7,0.7,1.2));
	SetPitchMomentScale (0);
	SetBankMomentScale (0);
	SetLiftCoeffFunc (0);
    ClearMeshes();
    ClearExhaustRefs();
    ClearAttExhaustRefs();
    VECTOR3 mesh_dir=_V(0,0,0);
    AddMesh (hCMPEVA, &mesh_dir);
}
ResourceManager::~ResourceManager(void)
{
	ClearMeshes();
}
Beispiel #5
0
void Overlay::RenderConsole()
{
    const UINT ConsoleStartOffset = 3;
    const UINT ConsoleXSeparation = 210;
	const UINT ConsoleYSeparation = 13;

    if(Pressed(GetAsyncKeyState(KEY_F2)))
    {
        g_Globals.UsingNullPixelShader = !g_Globals.UsingNullPixelShader;
    }

    if(g_Globals.UsingOverlay)
	{
        if(Pressed(GetAsyncKeyState(KEY_DELETE)))
        {
            for(UINT PanelIndex = 0; PanelIndex < ConsolePanelCount; PanelIndex++)
            {
                ClearPanel(PanelIndex);
            }
            ClearMeshes();
        }

        D3D9Base::LPDIRECT3DDEVICE9 Device = NULL;
        _Font->GetDevice(&Device);

        D3D9Base::LPDIRECT3DSURFACE9 BackBufferSurface = NULL;
        Device->GetBackBuffer(0, 0, D3D9Base::D3DBACKBUFFER_TYPE_MONO, &BackBufferSurface);
        
        D3DSURFACE_DESC BackBufferDesc;
        BackBufferSurface->GetDesc(&BackBufferDesc);

        D3DVIEWPORT9 Viewport;
        Viewport.X = 0;
        Viewport.Y = 0;
        Viewport.Width = BackBufferDesc.Width;
        Viewport.Height = BackBufferDesc.Height;
        Viewport.MinZ = 0.0f;
        Viewport.MaxZ = 1.0f;
        Device->SetViewport(&Viewport);

        BackBufferSurface->Release();
        Device->Release();

		_Sprite->Begin( D3DXSPRITE_ALPHABLEND | D3DXSPRITE_SORT_TEXTURE );

        for(UINT PanelIndex = 0; PanelIndex < ConsolePanelCount; PanelIndex++)
        {
            ConsolePanel &CurPanel = _Panels[PanelIndex];
		    UINT LineIndex = CurPanel.CurHeadPtr, YPos = ConsoleStartOffset;
		    UINT XPos = ConsoleStartOffset + ConsoleXSeparation * PanelIndex;
			bool FlipLineOrder = false;
			if(PanelIndex == ConsolePanelCount - 1)
			{
				FlipLineOrder = true;
				//YPos = ConsoleStartOffset + ConsoleYSeparation * CurPanel.Lines.Length();
				YPos = ConsoleStartOffset + ConsoleYSeparation;
				XPos = ConsoleStartOffset;
			}
			if(PanelIndex == ConsolePanelCount - 2)
			{
				XPos += 75;
			}

			bool Done = false;
		    while(!Done)
		    {
			    // TODO: add sprite support
				UINT ModifiedLineIndex = LineIndex;
				if(FlipLineOrder)
				{
					//ModifiedLineIndex = CurPanel.Lines.Length() - 1 - LineIndex;
				}
                const ConsoleLine &CurLine = CurPanel.Lines[ModifiedLineIndex];
                const String &CurText = CurLine.Text;
			    if(CurText.Length() > 0)
			    {
				    RECT Rect;
				    SetRect( &Rect, int(XPos), int(YPos), 0, 0 );
    				
                    //RGBColor Color = RGBColor::Black;
			        //_Font->DrawText(_Sprite, CurText.CString(), CurText.Length(), &Rect, DT_NOCLIP, D3D9Base::D3DXCOLOR(Color.r / 255.0f, Color.g / 255.0f, Color.b / 255.0f, 1.0f ));
			        //Rect.left -= 1;
			        //Rect.top -= 1;

                    RGBColor Color = CurLine.Color;
                    _Font->DrawText(_Sprite, CurText.CString(), CurText.Length(), &Rect, DT_NOCLIP, D3D9Base::D3DXCOLOR(Color.r / 255.0f, Color.g / 255.0f, Color.b / 255.0f, Color.a / 255.0f ));
			    }
			    LineIndex = Math::Mod(LineIndex + 1, CurPanel.Lines.Length());
			    YPos += ConsoleYSeparation;
			    if(LineIndex == Math::Mod(int(CurPanel.CurHeadPtr), CurPanel.Lines.Length()))
			    {
				    Done = true;
			    }
		    }
        }
		_Sprite->End();
	}
}
Beispiel #6
0
void LEM::SetLmAscentHoverStage()

{
	ClearThrusterDefinitions();
	agc.SetVesselStats(APS_ISP, APS_THRUST, true);
	ShiftCentreOfMass(_V(0.0,3.0,0.0));
	SetSize (5);
	SetCOG_elev (5);
	SetEmptyMass (1920.0);
	SetPMI(_V(2.8, 2.29, 2.37));
	SetCrossSections (_V(21,23,17));
	SetCW (0.1, 0.3, 1.4, 1.4);
	SetRotDrag (_V(0.7,0.7,0.7));
	SetPitchMomentScale (0);
	SetBankMomentScale (0);
	SetLiftCoeffFunc (0); 
	ClearMeshes();
	ClearExhaustRefs();
	ClearAttExhaustRefs();

	double tdph = -5.8;
	SetTouchdownPoints (_V(0, tdph, 5), _V(-5, tdph, -5), _V(5, tdph, -5));
	VSSetTouchdownPoints(GetHandle(), _V(0, tdph, 5), _V(-5, tdph, -5), _V(5, tdph, -5));

	VECTOR3 mesh_dir=_V(-0.191,-0.02,+0.383);	
	UINT meshidx = AddMesh (hLMAscent, &mesh_dir);
	SetMeshVisibilityMode (meshidx, MESHVIS_VCEXTERNAL);

    if (!ph_Asc)  
		ph_Asc  = CreatePropellantResource(AscentFuelMassKg);	// 2nd stage Propellant
	SetDefaultPropellantResource (ph_Asc);			// Display 2nd stage propellant level in generic HUD
	// orbiter main thrusters
    th_hover[0] = CreateThruster (_V( 0.0,  -2.5, 0.0), _V( 0,1,0), APS_THRUST, ph_Asc, APS_ISP);
	th_hover[1] = CreateThruster (_V( 0.01, -2.0, 0.0), _V( 0,1,0), 0,          ph_Asc, 0);		// this is a "virtual engine",no thrust and no fuel
																								// needed for visual gimbaling for corrected engine flames
    DelThrusterGroup(THGROUP_HOVER,true);
	thg_hover = CreateThrusterGroup (th_hover, 2, THGROUP_HOVER);
	AddExhaust (th_hover[1], 6.0, 0.8, exhaustTex);
	
	SetCameraOffset (_V(-1,1.0,0.0));
	status = 2;
	stage = 2;
	SetEngineLevel(ENGINE_HOVER,0);
	AddRCS_LMH2(-1.86);
	bModeHover=true;

	if(ph_Dsc){
		DelPropellantResource(ph_Dsc);
		ph_Dsc = 0;
	}
	
	VECTOR3 dockpos = {0.0 ,0.58, 0.0};
	VECTOR3 dockdir = {0,1,0};

	VECTOR3 dockrot = { -0.8660254, 0, 0.5 };
	SetDockParams(dockpos, dockdir, dockrot);
	hattDROGUE = CreateAttachment(true, dockpos, dockdir, dockrot, "PADROGUE");
	InitNavRadios (4);
	LDGswitch=false;
	AFEED1switch=true;
	AFEED2switch=true;
	AFEED3switch=true;
	AFEED4switch=true;

	// Descent stage detached.
	agc.SetInputChannelBit(030, DescendStageAttached, false);

	CheckRCS();
}
Beispiel #7
0
void LEM::SetLmVesselHoverStage()
{
	ClearThrusterDefinitions();
	agc.SetVesselStats(DPS_ISP, DPS_THRUST, true);

	SetEmptyMass(AscentFuelMassKg + 4374.0);

	SetSize (7);
	SetPMI (_V(3.26,2.22,3.26)); 
	SetCrossSections (_V(24.53,21.92,24.40));
	// SetPMI (_V(2.8,2.29,2.37));
	// SetCrossSections (_V(21,23,17));
	SetCW (0.1, 0.3, 1.4, 1.4);
	SetRotDrag (_V(0.7,0.7,0.7));
	SetPitchMomentScale (0);
	SetBankMomentScale (0);
	SetLiftCoeffFunc (0); 
	ClearMeshes();
	ClearExhaustRefs();
	ClearAttExhaustRefs();

	SetTouchdownPoints (_V(0, -3.86, 5), _V(-5, -3.86, -5), _V(5, -3.86, -5));
	VSSetTouchdownPoints(GetHandle(), _V(0, -3.86, 5), _V(-5, -3.86, -5), _V(5, -3.86, -5));

	VECTOR3 mesh_dir=_V(-0.003,-0.03,0.004);	
	UINT meshidx;
	if (Landed) {
		meshidx = AddMesh (hLMLanded, &mesh_dir);
	}else{
		UINT probeidx;
		meshidx = AddMesh (hLMLanded, &mesh_dir);
		probeidx = AddMesh (hLemProbes, &mesh_dir);
		SetMeshVisibilityMode (probeidx, MESHVIS_VCEXTERNAL);
	}
	SetMeshVisibilityMode (meshidx, MESHVIS_VCEXTERNAL);
    
	if (!ph_Dsc){  
		ph_Dsc  = CreatePropellantResource(DescentFuelMassKg); //2nd stage Propellant
	}

	SetDefaultPropellantResource (ph_Dsc); // display 2nd stage propellant level in generic HUD

	if (!ph_RCSA){
		ph_RCSA = CreatePropellantResource(133.084001);
	}
	if (!ph_RCSB){
		ph_RCSB = CreatePropellantResource(133.084001);
	}
	
	// orbiter main thrusters
	th_hover[0] = CreateThruster (_V(0.0  , -2.0,  0.0),   _V(0,1,0), 46706.3, ph_Dsc, 3107);
	th_hover[1] = CreateThruster (_V(0.013, -2.8, -0.034), _V(0,1,0),     0, ph_Dsc, 0);	//this is a "virtual engine",no thrust and no fuel
																							//needed for visual gimbaling for corrected engine flames
    DelThrusterGroup(THGROUP_HOVER,true);
	thg_hover = CreateThrusterGroup(th_hover, 2, THGROUP_HOVER);
	AddExhaust (th_hover[1], 10.0, 1.5, exhaustTex);
		
	SetCameraOffset (_V(-1,1.0,0.0));
	status = 1;
	stage = 1;
	SetEngineLevel(ENGINE_HOVER,0);
	AddRCS_LMH(-1.85);
	bModeHover=true;

	VECTOR3 dockpos = {0.0 ,2.6, 0.0};	
	VECTOR3 dockdir = {0,1,0};
	VECTOR3 dockrot = { -0.8660254, 0, 0.5 };
	SetDockParams(dockpos, dockdir, dockrot);
	hattDROGUE = CreateAttachment(true, dockpos, dockdir, dockrot, "PADROGUE");
	InitNavRadios (4);

	LDGswitch=true;
	ATT2switch=true;
	ATT3switch=true;
	ATT1switch=true;
	AFEED1switch=false;
	AFEED2switch=false;
	AFEED3switch=false;
	AFEED4switch=false;

	// Descent stage attached.
	agc.SetInputChannelBit(030, DescendStageAttached, true);

	CheckRCS();
}
Beispiel #8
0
void LEM::SetLmVesselDockStage()

{	
	double fuelmass;
	int mnumber;
	ClearThrusterDefinitions();
	agc.SetVesselStats(DPS_ISP, DPS_THRUST, true);
	//
	// Changed to reflect mission-specific empty and fuel mass
	//
	// From "Apollo by the Numbers"
	//
	mnumber=agc.GetApolloNo();
	if(mnumber < 15) {
		SetEmptyMass(6565);		
		fuelmass=8375.;
	} else {
		SetEmptyMass(7334);
		fuelmass=8891.;
	}
	SetSize (6);
	// SetPMI (_V(2.8,2.29,2.37));
	SetPMI(_V(2.5428, 2.2871, 2.7566));
	// SetCrossSections (_V(21,23,17));
	//SetPMI(_V(3.26, 2.22, 3.26));
	SetCrossSections (_V(24.53,21.92,24.40));
	SetCW (0.1, 0.3, 1.4, 1.4);
	SetRotDrag (_V(0.7,0.7,0.7));
	SetPitchMomentScale (0);
	SetBankMomentScale (0);
	SetLiftCoeffFunc (0); 
	ClearMeshes();
	ClearExhaustRefs();
	ClearAttExhaustRefs();
	SetTouchdownPoints (_V(0,0,10), _V(-1,0,-10), _V(1,0,-10));
    VECTOR3 mesh_dir=_V(0.0,-0.2,0.03);

	UINT meshidx = AddMesh (hLMPKD, &mesh_dir);	
	SetMeshVisibilityMode (meshidx, MESHVIS_VCEXTERNAL);
    if (!ph_Dsc)  
		ph_Dsc  = CreatePropellantResource(fuelmass); //2nd stage Propellant
	SetDefaultPropellantResource (ph_Dsc); // display 2nd stage propellant level in generic HUD

	// 133.084001 kg is 293.4 pounds, which is the fuel + oxidizer capacity of one RCS tank.
	if (!ph_RCSA) {
		ph_RCSA = CreatePropellantResource(133.084001);
	}
	if (!ph_RCSB) {
		ph_RCSB = CreatePropellantResource(133.084001);
	}

	// orbiter main thrusters
	th_hover[0] = CreateThruster (_V(0.0  , -3.3,  0.0),  _V(0,1,0), 46706.3, ph_Dsc, 3107);
	th_hover[1] = CreateThruster (_V(0.013, -3.0, -0.03), _V(0,1,0),     0, ph_Dsc, 0);		//this is a "virtual engine",no thrust and no fuel
																							//needed for visual gimbaling for corrected engine flames
	DelThrusterGroup(THGROUP_HOVER,true);
	thg_hover = CreateThrusterGroup(th_hover, 2, THGROUP_HOVER);
	AddExhaust(th_hover[1], 10.0, 1.2, exhaustTex);

	SetCameraOffset (_V(-1,1.0,0.0));
	SetEngineLevel(ENGINE_HOVER,0);
	AddRCS_LMH(-1.85);
	status = 0;
	stage = 0;
	bModeDocked=true;

	VECTOR3 dockpos = {0.0 ,2.6, 0.0};
    VECTOR3 dockdir = {0,1,0};
	VECTOR3 dockrot = { -0.8660254, 0, 0.5 };
	SetDockParams(dockpos, dockdir, dockrot);
	hattDROGUE = CreateAttachment(true, dockpos, dockdir, dockrot, "PADROGUE");
	InitNavRadios (4);
    LDGswitch=false;
	ATT2switch=true;
	ATT3switch=true;
	ATT1switch=true;
	AFEED1switch=false;
	AFEED2switch=false;
	AFEED3switch=false;
	AFEED4switch=false;

	// Descent stage attached.
	agc.SetInputChannelBit(030, DescendStageAttached, true);

	CheckRCS();
}