0 Members and 1 Guest are viewing this topic.
---------- Capture Output ----------> "D:\C++\bin\cl.exe" @orbiter.rsp soyuztma.cppMicrosoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.cl /Ox /GX /ML /LD /I"D:\C++\include" /I"F:\Orbiter\orbitersdk\include" /link /libpath:"D:\C++\lib" /link /libpath:"F:\Orbiter\orbitersdk\lib" /link kernel32.lib user32.lib gdi32.lib /link orbitersdk.lib orbiter.lib /link /nodefaultlib:"MSVCRT.LIB" /nodefaultlib:"MSVCIRT.LIB"soyuztma.cppMicrosoft (R) Incremental Linker Version 7.10.3077Copyright (C) Microsoft Corporation. All rights reserved./out:soyuztma.dll /dll /implib:soyuztma.lib /libpath:D:\C++\lib /libpath:F:\Orbiter\orbitersdk\lib kernel32.lib user32.lib gdi32.lib orbitersdk.lib orbiter.lib /nodefaultlib:MSVCRT.LIB /nodefaultlib:MSVCIRT.LIB soyuztma.obj Creating library soyuztma.lib and object soyuztma.expsoyuztma.obj : error LNK2019: unresolved external symbol "public: __thiscall COMMON_VESSEL_EX::~COMMON_VESSEL_EX(void)" (??1COMMON_VESSEL_EX@@QAE@XZ) referenced in function "public: __thiscall TMA::~TMA(void)" (??1TMA@@QAE@XZ)soyuztma.obj : error LNK2019: unresolved external symbol "public: __thiscall COMMON_VESSEL_EX::COMMON_VESSEL_EX(void *)" (??0COMMON_VESSEL_EX@@QAE@PAX@Z) referenced in function "public: __thiscall TMA::TMA(void *,int)" (??0TMA@@QAE@PAXH@Z)soyuztma.obj : error LNK2019: unresolved external symbol "public: void __thiscall COMMON_VESSEL_EX::SaveDefaultStateEx(void *)" (?SaveDefaultStateEx@COMMON_VESSEL_EX@@QAEXPAX@Z) referenced in function "public: void __thiscall TMA::SaveState(void *)" (?SaveState@TMA@@QAEXPAX@Z)soyuztma.obj : error LNK2019: unresolved external symbol "public: void __thiscall COMMON_VESSEL_EX::Draw(union VECTOR3 const &)" (?Draw@COMMON_VESSEL_EX@@QAEXABTVECTOR3@@@Z) referenced in function "public: void __thiscall TMA::SetEntryStage(void)" (?SetEntryStage@TMA@@QAEXXZ)soyuztma.obj : error LNK2019: unresolved external symbol "public: double __thiscall COMMON_VESSEL_EX::CalculateMass(void)" (?CalculateMass@COMMON_VESSEL_EX@@QAENXZ) referenced in function "public: void __thiscall TMA::SetEntryStage(void)" (?SetEntryStage@TMA@@QAEXXZ)soyuztma.obj : error LNK2019: unresolved external symbol "public: void __thiscall COMMON_VESSEL_EX::ClearMeshesEx(void)" (?ClearMeshesEx@COMMON_VESSEL_EX@@QAEXXZ) referenced in function "public: void __thiscall TMA::SetEntryStage(void)" (?SetEntryStage@TMA@@QAEXXZ)soyuztma.obj : error LNK2019: unresolved external symbol "public: class VESSEL * __thiscall COMMON_VESSEL_EX::JettisonComponent(char *,char *,union VECTOR3 &,union VECTOR3 &,union VECTOR3 &)" (?JettisonComponent@COMMON_VESSEL_EX@@QAEPAVVESSEL@@PAD0AATVECTOR3@@11@Z) referenced in function "protected: void __thiscall TMA::BlowOrbiter(void)" (?BlowOrbiter@TMA@@IAEXXZ)soyuztma.obj : error LNK2019: unresolved external symbol "public: class VESSEL * __thiscall COMMON_VESSEL_EX::DeployPayload(void)" (?DeployPayload@COMMON_VESSEL_EX@@QAEPAVVESSEL@@XZ) referenced in function "public: int __thiscall TMA::ConsumeBufferedKey(unsigned long,bool,char const *)" (?ConsumeBufferedKey@TMA@@QAEHK_NPBD@Z)soyuztma.obj : error LNK2019: unresolved external symbol "public: bool __thiscall COMMON_VESSEL_EX::CheckCentralMessage(void)" (?CheckCentralMessage@COMMON_VESSEL_EX@@QAE_NXZ) referenced in function "public: void __thiscall TMA::TimeStep(double)" (?TimeStep@TMA@@QAEXN@Z)soyuztma.obj : error LNK2019: unresolved external symbol "public: void __thiscall COMMON_VESSEL_EX::ParsePayloadString(char *)" (?ParsePayloadString@COMMON_VESSEL_EX@@QAEXPAD@Z) referenced in function "public: void __thiscall TMA::LoadState(void *,void *)" (?LoadState@TMA@@QAEXPAX0@Z)soyuztma.dll : fatal error LNK1120: 10 unresolved externals> Terminated with exit code 2.
#include "soyuztma.h"PARTICLESTREAMSPEC rcs_exhaust = {0, 0.05, 3000, 5, 0.1, 0.1, 1, 0.0, PARTICLESTREAMSPEC::EMISSIVE,PARTICLESTREAMSPEC::LVL_PLIN, 0, 2,PARTICLESTREAMSPEC::ATM_PLOG, 0.0, 0.0};PARTICLESTREAMSPEC oms_exhaust = {0, 0.4, 3000, 150, 0.05, 0.5, 5, 0.0, PARTICLESTREAMSPEC::EMISSIVE,PARTICLESTREAMSPEC::LVL_PLIN, 0, 2,PARTICLESTREAMSPEC::ATM_PLOG, 0.0, 0.0};PARTICLESTREAMSPEC oms_exhaust2 = {0, 0.4, 3000, 50, 0.05, 0.1, 5.0/3.0, 0.0, PARTICLESTREAMSPEC::EMISSIVE,PARTICLESTREAMSPEC::LVL_PLIN, 0, 2,PARTICLESTREAMSPEC::ATM_PLOG, 0.0, 0.0};TMA::TMA (OBJHANDLE hObj, int fmodel): COMMON_VESSEL_EX (hObj){ ph_first = NULL; ph_second = NULL; ph_srm = NULL; htma = oapiLoadMesh("soyuz"); hentry = oapiLoadMesh("soyuz-descent"); hpara = oapiLoadMesh("soychute"); hdrogue = oapiLoadMesh("soydrogue"); VZERO = _V(0,0,0); status = 0; targetstatus = 0; comshift = _V(0,0,0);// anim1 = CreateAnimation (0.5);// anim2 = CreateAnimation (0.5); anim3 = CreateAnimation(0); animcomp1 = NULL; animcomp2 = NULL; int i; for( i = 0 ; i < 20 ; i++ ) { animcomp3 = NULL; } xproc = 0.0; chute = NULL; reenteractive = false; reentercoasting = false; target = 6445000.0; animstate = 0; animlevel = 0.0; refresh = 0; animactive = 0; dh=NULL;}void TMA::TimeStep( double simt ){ /* CVE-lite function ! */ /* IMPORTANT */ /* This function loops through the pending GPDS requests and returns a bool (true/false) /* if any GPDS requests have been implemented. /* If any have (eg adding a new payload), you will need to re-draw your ship, hence the /* call to the (repeatable) SetMainStage(); */ if( CheckCentralMessage() ) { while( CheckCentralMessage() ) ;// SetMainStage(); } if( animactive ) { if( animactive == 1 ) { animlevel += oapiGetSimStep() / 10.0; if( animlevel > 1.0 ) { animlevel = 1.0; animactive = 0; } } else { animlevel -= oapiGetSimStep() / 10.0; if( animlevel < 0.0 ) { animlevel = 0.0; animactive = 0; } } SetAnimation( anim3, animlevel ); } if( refresh > 0 ) { refresh++; if( refresh == 2 ) SetAnimation( anim3, 0.0 ); if( refresh == 3 ) if( status == 0 ) SetMainStage(); else if( status == 1 ) SetEntryStage(); else if( status == 2 ) SetDrogueStage(); else if( status == 3 ) SetParaStage(); else if( status == 4 ) SetEntryStage(); if( refresh == 4 ) { SetAnimation( anim3, animlevel ); refresh = 0; } } if( status == 2 || status == 3 ) { if( oapiGetTimeAcceleration() > 10.0 ) { oapiSetTimeAcceleration(10.0); } CalcParaAngles(); if( status == 3 && GetAltitude() < 2.0 && th_srm != NULL ) { chute = JettisonComponent("SoyuzChute", "soychute", (VZERO-comshift)+_V(0,0,72) , _V(0,0,0), _V(0,0,0)); status = 4; refresh = 1; } else if( status == 2 && ( ( GetAltitude() < 2000.0 && GetAirspeed() < 80.0 ) || GetAltitude() < 600.0 ) ) { status = 3; refresh = 1; } } else if( status == 1 ) { if( GetAltitude() < 12000 && GetAirspeed() < 300 ) { status = 2; refresh = 1; return; } } if( status == 4 && chute ) { if( chute->GroundContact() ){ oapiDeleteVessel(chute->GetHandle()); chute = NULL; } }}void TMA::VisualCreated ( VESSEL *vessel, VISHANDLE vis, int refcount) { SetMainStage(); // this is a good place to ask for the initial setup. refresh = 1;}void TMA::SetClassCaps( FILEHANDLE cfg ){}void TMA::SaveState( FILEHANDLE scn ){ SaveDefaultState (scn); oapiWriteScenario_int (scn, "CONFIGURATION", status ); oapiWriteScenario_float( scn, "PANELS", animlevel ); SaveDefaultStateEx(scn);}void TMA::LoadState( FILEHANDLE scn, void *vs ){ char *line; while (oapiReadScenario_nextline (scn, line)) { if( !strnicmp( line, "CONFIGURATION", 13 ) ) { status = atoi( line+13 ); } else if( !strnicmp( line, "PANELS", 6 ) ) { animlevel = atof( line+6 ); } /* CVE-lite function ! */ /* IMPORTANT */ /* Call this for every line in the scenario file. It will automatically /* deduce which lines are for it, and load the payloads from the file. */ /* load payload lines */ ParsePayloadString(line); ParseScenarioLineEx (line, vs); } /* always set the stage whenever something may have changed */ SetMainStage(); refresh = 1;}/* IMPORTANT *//* Always have a function that you can call as many times as you like that will re-draw/* all you meshes, reset all your thrusters and check to make sure the propellent is/* there. This should be called after any configuration change, or any GDPS line (see/* TimeStep(), above) */void TMA::SetMainStage( ){ SetAnimation( anim3, 0.0 ); VECTOR3 VECTOR_ZERO = _V(0,0,0); /* CVE-lite function ! */ /* ClearMeshesEx() will get rid of all the normal meshes, plus anything you've defined /* with the COMMON_MESH class (not used here) */ /* erase all meshes and thrusters so we can start afresh */ ClearMeshesEx(); SetSize (15); /* CVE-lite function ! */ /* IMPORTANT */ /* double CalculateMass() will return the all-up mass of the combined payloads and /* upper stages. Simply add this to your normal dry mass. */ /* always add payload mass [CalculateMass()] to the vessel's empty mass */ SetEmptyMass ( MASS + CalculateMass() ); ShiftCentreOfMass(VZERO-comshift); comshift = _V(0,0,0); ShiftCentreOfMass(comshift); SetTouchdownPoints (_V(0,-2,4)-comshift,_V(2,-2,-4)-comshift,_V(-2,-2,-4)-comshift); SetPMI (_V(5,5,0.85)); SetCrossSections (_V(15,32,6)); SetCW (1.1, 2.2, 3.5, 3.5); SetRotDrag (_V(0.1,0.1,0.01)); SetPitchMomentScale (-3e-6); SetBankMomentScale (3e-6); SetLiftCoeffFunc(0); SetSurfaceFrictionCoeff (0.05, 0.5); SetCameraOffset( _V( 0.0, -1.50, 1.5)-comshift ); VECTOR_ZERO = (comshift*-1.0); /* we're not using COMMON_MESH today, so draw our own */ UINT mshid = AddMesh("soyuz", &VECTOR_ZERO ); SetMeshVisibilityMode( mshid, MESHVIS_ALWAYS ); Animations(mshid); MeshVisibilityPreference(MESHVIS_ALWAYS); /* CVE-lite function ! */ /* IMPORTANT */ /* Draw() should be called to render all the loaded payloads, plus anything you've /* added with the COMMON_MESH class (not used here) */ /* call draw to render the payloads, plus anything you've added from COMMON_MESH */ Draw(comshift*-1.0); /* CVE-lite variable ! */ /* IMPORTANT */ /* Use the keyword double InitFuelLevel multipled by the maximum mass to have the /* fuel levels automatically set from the GPDS payload string */ /* verify that the propellent hasn't been created before making it */ if( ph_first == NULL ) { ph_first = CreatePropellantResource(FUEL); } if( !dh ) dh = CreateDock(_V(0,0,4.615),_V(0,0,1),_V(0,1,0)); SetDefaultPropellantResource (ph_first); AddThrusters(); EnableTransponder(true);}void TMA::SetEntryStage() { ShiftCentreOfMass(VZERO-comshift); comshift = _V(0,-0.1,-0.5); ShiftCentreOfMass(comshift); SetCameraOffset( _V( 0.0, -1.65, -0.1)-comshift ); int i; for( i = 0 ; i < 20 ; i++ ) { if( animcomp3 != NULL ) { DelAnimationComponent(anim3, animcomp3 ); animcomp3 = NULL; } }/* if( animcomp1 != NULL ) DelAnimationComponent(anim1, animcomp1 ); if( animcomp2 != NULL ) DelAnimationComponent(anim2, animcomp2 );*/ ClearExhaustRefs(); ClearAttExhaustRefs(); ClearThrusterDefinitions(); ClearMeshesEx(); SetSize (5); SetEmptyMass ( MASSENTRY + CalculateMass() ); SetTouchdownPoints (_V(-1,-1,-1.5)-comshift,_V(0,1,-1.5)-comshift,_V(1,-1,-1.5)-comshift); SetPMI (_V(2,2,0.55)); SetCrossSections (_V(5,5,5)); SetCW (1.1, 2.2, 2.5, 2.5); SetRotDrag (_V(0.05,0.05,0.05)); SetPitchMomentScale (-1e-6); SetBankMomentScale (-1e-6); SetLiftCoeffFunc(0); if( ph_first ) { DelPropellantResource(ph_first); ph_first = NULL; } if( ph_second && GetPropellantMass(ph_second) > 40.0 ) SetPropellantMass(ph_second, 40.0); if( status == 4 ) { if( ph_srm == NULL ) { ph_srm = CreatePropellantResource(FUELSRM); } th_srm = CreateThruster (_V(0, 0, -1), _V(0,0,1), 60000.0, ph_srm, 200.0, 0.0); AddExhaustStream(th_srm, _V(0,1,-0.7), &oms_exhaust); AddExhaustStream(th_srm, _V(-0.7,-0.7,-0.7), &oms_exhaust); AddExhaustStream(th_srm, _V(0.7,-0.7,-0.7), &oms_exhaust); SetThrusterLevel(th_srm,1.0); } VECTOR3 off; UINT msh; off = (VZERO-comshift); msh = AddMesh(hentry,&off); SetMeshVisibilityMode(msh,MESHVIS_ALWAYS); Draw(VZERO-comshift); th_yleft[0] = CreateThruster (_V(0, 0, 1)-comshift, _V(-1,0,0), 50.0, ph_second, 2903.0, 0.0); th_yright[0] = CreateThruster (_V(0, 0, 1)-comshift, _V(1,0,0), 50.0, ph_second, 2903.0, 0.0); th_pup[0] = CreateThruster (_V(0, 0, 1)-comshift, _V(0,1,0), 50.0, ph_second, 2903.0, 0.0); th_pdown[0] = CreateThruster (_V(0, 0, 1)-comshift, _V(0,-1,0), 50.0, ph_second, 2903.0, 0.0); th_rleft[0] = CreateThruster (_V(0, 1, 1)-comshift, _V(-1,0,0), 50.0, ph_second, 2903.0, 0.0); th_rright[0] = CreateThruster (_V(0, 1, 1)-comshift, _V(1,0,0), 50.0, ph_second, 2903.0, 0.0); CreateThrusterGroup( th_yleft, 1, THGROUP_ATT_YAWLEFT ); CreateThrusterGroup( th_yright, 1, THGROUP_ATT_YAWRIGHT ); CreateThrusterGroup( th_pup, 1, THGROUP_ATT_PITCHUP ); CreateThrusterGroup( th_pdown, 1, THGROUP_ATT_PITCHDOWN ); CreateThrusterGroup( th_rleft, 1, THGROUP_ATT_BANKLEFT ); CreateThrusterGroup( th_rright, 1, THGROUP_ATT_BANKRIGHT );}/** Handle buffered key events sent to the vessel by orbiter. * @param dwKey The scan code of the key * @param fPressed true if pressed, false if depressed * @param keystate the current state of the keyboard * * modified switch routine by dave rowbotham. */int TMA::ConsumeBufferedKey(DWORD dwKey, bool fPressed, const char *keystate){ VESSELSTATUS vs; GetStatus(vs); if (KEYMOD_SHIFT (keystate)) { // reserved for MFDs } else if (KEYMOD_CONTROL (keystate)) { if (KEYDOWN (keystate, OAPI_KEY_J) && KEYMOD_CONTROL(keystate) && !KEYMOD_SHIFT(keystate) ) { if (oapiAcceptDelayedKey (OAPI_KEY_J, 1.0)) { if( status == 0 ) { BlowOrbiter(); } else if( status < 4 ) { status++; refresh=1; } return 1; } } } else { // unmodified keys if (KEYDOWN (keystate, OAPI_KEY_K)) { // "Jettison Stage" if(oapiAcceptDelayedKey (OAPI_KEY_K, 0.5)) { if( animlevel > 0.5 ) animactive = 2; else animactive = 1; return 1; } } if (KEYDOWN (keystate, OAPI_KEY_J) && !KEYMOD_CONTROL(keystate) && !KEYMOD_SHIFT(keystate) ) { if (oapiAcceptDelayedKey (OAPI_KEY_J, 1.0)) { DeployPayload(); refresh=1; return 1; } } } return 0;}void TMA::AddThrusters(){ th_first = CreateThruster (_V(0,0,-2.64)-comshift, _V(0,0,1), 3924.0, ph_first, 2992.0); AddExhaustStream(th_first, &oms_exhaust); AddExhaustStream(th_first, &oms_exhaust2); th_pup[0] = CreateThruster (_V(-0.1, 1.38, -2.515)-comshift, _V(0,-1,0), 140.0, ph_first, 2903.0, 0.0); th_pup[1] = CreateThruster (_V(0.1, 1.38, -2.515)-comshift, _V(0,-1,0), 140.0, ph_first, 2903.0, 0.0); th_pup[2] = CreateThruster (_V(-1.12, -0.25, 0)-comshift, _V(0,1,0), 140.0, ph_first, 2903.0, 0.0); th_pup[3] = CreateThruster (_V(1.12, -0.25, 0)-comshift, _V(0,1,0), 140.0, ph_first, 2903.0, 0.0); AddExhaustStream(th_pup[0], &rcs_exhaust); AddExhaustStream(th_pup[1], &rcs_exhaust); AddExhaustStream(th_pup[2], &rcs_exhaust); AddExhaustStream(th_pup[3], &rcs_exhaust); th_pdown[0] = CreateThruster (_V(-0.1, -1.38, -2.515)-comshift, _V(0,1,0), 140.0, ph_first, 2903.0, 0.0); th_pdown[1] = CreateThruster (_V(0.1, -1.38, -2.515)-comshift, _V(0,1,0), 140.0, ph_first, 2903.0, 0.0); th_pdown[2] = CreateThruster (_V(-1.12, 0.25, 0)-comshift, _V(0,-1,0), 140.0, ph_first, 2903.0, 0.0); th_pdown[3] = CreateThruster (_V(1.12, 0.25, 0)-comshift, _V(0,-1,0), 140.0, ph_first, 2903.0, 0.0); AddExhaustStream(th_pdown[0], &rcs_exhaust); AddExhaustStream(th_pdown[1], &rcs_exhaust); AddExhaustStream(th_pdown[2], &rcs_exhaust); AddExhaustStream(th_pdown[3], &rcs_exhaust); th_rleft[0] = th_pup[3]; th_rleft[1] = th_pdown[2]; th_rright[0] = th_pup[2]; th_rright[1] = th_pdown[3]; th_yleft[0] = CreateThruster (_V(-1.38, -0.1, -2.515)-comshift, _V(1,0,0), 140.0, ph_first, 2903.0, 0.0); th_yleft[1] = CreateThruster (_V(-1.38, 0.1, -2.515)-comshift, _V(1,0,0), 140.0, ph_first, 2903.0, 0.0); th_yleft[2] = CreateThruster (_V(1.2, -0.1, 0)-comshift, _V(-1,0,0), 140.0, ph_first, 2903.0, 0.0); th_yleft[3] = CreateThruster (_V(1.2, 0.1, 0)-comshift, _V(-1,0,0), 140.0, ph_first, 2903.0, 0.0); AddExhaustStream(th_yleft[0], &rcs_exhaust); AddExhaustStream(th_yleft[1], &rcs_exhaust); AddExhaustStream(th_yleft[2], &rcs_exhaust); AddExhaustStream(th_yleft[3], &rcs_exhaust); th_yright[0] = CreateThruster (_V(1.38, -0.1, -2.515)-comshift, _V(-1,0,0), 140.0, ph_first, 2903.0, 0.0); th_yright[1] = CreateThruster (_V(1.38, 0.1, -2.515)-comshift, _V(-1,0,0), 140.0, ph_first, 2903.0, 0.0); th_yright[2] = CreateThruster (_V(-1.2, -0.1, 0)-comshift, _V(1,0,0), 140.0, ph_first, 2903.0, 0.0); th_yright[3] = CreateThruster (_V(-1.2, 0.1, 0)-comshift, _V(1,0,0), 140.0, ph_first, 2903.0, 0.0); AddExhaustStream(th_yright[0], &rcs_exhaust); AddExhaustStream(th_yright[1], &rcs_exhaust); AddExhaustStream(th_yright[2], &rcs_exhaust); AddExhaustStream(th_yright[3], &rcs_exhaust); th_left[0] = th_yleft[2]; th_left[1] = th_yleft[3]; th_right[0] = th_yright[2]; th_right[1] = th_yright[3]; th_up[0] = th_pup[2]; th_up[1] = th_pup[3]; th_down[0] = th_pdown[2]; th_down[1] = th_pdown[3]; th_fore[0] = CreateThruster (_V(-1.1, 0, -2.64)-comshift, _V(0,0,1), 140.0, ph_first, 2903.0, 0.0); th_fore[1] = CreateThruster (_V(1.1, 0, -2.64)-comshift, _V(0,0,1), 140.0, ph_first, 2903.0, 0.0); th_fore[2] = CreateThruster (_V(0, 1.1, -2.64)-comshift, _V(0,0,1), 140.0, ph_first, 2903.0, 0.0); th_fore[3] = CreateThruster (_V(0, -1.1, -2.64)-comshift, _V(0,0,1), 140.0, ph_first, 2903.0, 0.0); AddExhaustStream(th_fore[0], &rcs_exhaust); AddExhaustStream(th_fore[1], &rcs_exhaust); AddExhaustStream(th_fore[2], &rcs_exhaust); AddExhaustStream(th_fore[3], &rcs_exhaust); th_aft[0] = CreateThruster (_V(-1.15, 0, 0.15)-comshift, _V(0.141,0,-0.99), 140.0, ph_first, 2903.0, 0.0); th_aft[1] = CreateThruster (_V(1.15, 0, 0.15)-comshift, _V(-0.141,0,-0.99), 140.0, ph_first, 2903.0, 0.0); AddExhaustStream(th_aft[0], &rcs_exhaust); AddExhaustStream(th_aft[1], &rcs_exhaust); CreateThrusterGroup( th_pup, 4, THGROUP_ATT_PITCHUP ); CreateThrusterGroup( th_pdown, 4, THGROUP_ATT_PITCHDOWN ); CreateThrusterGroup( th_yleft, 4, THGROUP_ATT_YAWLEFT ); CreateThrusterGroup( th_yright, 4, THGROUP_ATT_YAWRIGHT ); CreateThrusterGroup( th_rleft, 2, THGROUP_ATT_BANKLEFT ); CreateThrusterGroup( th_rright, 2, THGROUP_ATT_BANKRIGHT ); CreateThrusterGroup( th_left, 2, THGROUP_ATT_LEFT ); CreateThrusterGroup( th_right, 2, THGROUP_ATT_RIGHT ); CreateThrusterGroup( th_down, 2, THGROUP_ATT_DOWN ); CreateThrusterGroup( th_up, 2, THGROUP_ATT_UP ); CreateThrusterGroup( th_fore, 4, THGROUP_ATT_FORWARD ); CreateThrusterGroup( th_aft, 2, THGROUP_ATT_BACK ); CreateThrusterGroup( &th_first, 1, THGROUP_MAIN ); CreateThrusterGroup( th_aft, 2, THGROUP_RETRO );}void TMA::SetDrogueStage() { int i; for( i = 0 ; i < 20 ; i++ ) { if( animcomp3 != NULL ) { DelAnimationComponent(anim3, animcomp3 ); animcomp3 = NULL; } } ShiftCentreOfMass(VZERO-comshift); comshift = _V(0,-0.1,0); ShiftCentreOfMass(comshift); SetCameraOffset( _V( 0.0, -1.65, -0.1)-comshift ); ClearExhaustRefs(); ClearAttExhaustRefs(); ClearThrusterDefinitions(); ClearMeshesEx(); SetSize (80); SetEmptyMass ( MASSENTRY + CalculateMass() ); SetTouchdownPoints (_V(-1,-1,-1.5)-comshift,_V(0,1,-1.5)-comshift,_V(1,-1,-1.5)-comshift); SetPMI (_V(2,2,0.55)); SetCrossSections (_V(5,5,40)); SetCW (1.1, 2.2, 3.5, 3.5); SetRotDrag (_V(0.05,0.05,0.05)); SetPitchMomentScale (-5e-4); SetBankMomentScale (-5e-4); SetLiftCoeffFunc(0); if( ph_first ) { DelPropellantResource(ph_first); ph_first = NULL; } if( ph_second ) { DelPropellantResource(ph_second); ph_second = NULL; } if( ph_srm == NULL ) { ph_srm = CreatePropellantResource(FUELSRM); } VECTOR3 off, off2; UINT msh, msh2; off = (VZERO-comshift); msh = AddMesh(hentry,&off); SetMeshVisibilityMode(msh,MESHVIS_ALWAYS); off2 = (VZERO-comshift)+_V(0,0,72); msh2 = AddMesh(hdrogue,&off2); SetMeshVisibilityMode(msh2,MESHVIS_ALWAYS); Draw(VZERO-comshift);/* if( animcomp1 != NULL ) DelAnimationComponent(anim1, animcomp1 ); if( animcomp2 != NULL ) DelAnimationComponent(anim2, animcomp2 );*//* static UINT groups0[5] = { 0, 1, 2, 3, 4 }; animcomp1 = AddAnimationComponent( anim1, 0, 1, new MGROUP_ROTATE ( msh2, groups0, 5, _V(0,0,1)-off2, _V(1,0,0), 30*RAD ) ); animcomp2 = AddAnimationComponent( anim2, 0, 1, new MGROUP_ROTATE ( msh2, groups0, 5, _V(0,0,1)-off2, _V(0,1,0), 30*RAD ) );*/}void TMA::SetParaStage() { int i; for( i = 0 ; i < 20 ; i++ ) { if( animcomp3 != NULL ) { DelAnimationComponent(anim3, animcomp3 ); animcomp3 = NULL; } } /* if( animcomp1 != NULL ) DelAnimationComponent(anim1, animcomp1 ); if( animcomp2 != NULL ) DelAnimationComponent(anim2, animcomp2 );*/ ShiftCentreOfMass(VZERO-comshift);// comshift = _V(0,-0.18,-1.265); comshift = _V(0,-0.1,0); ShiftCentreOfMass(comshift); SetCameraOffset( _V( 0.0, -1.65, -0.1)-comshift ); ClearExhaustRefs(); ClearAttExhaustRefs(); ClearThrusterDefinitions(); ClearMeshesEx(); SetSize (80); SetEmptyMass ( MASSENTRY + CalculateMass() ); SetTouchdownPoints (_V(-1,-1,-1.5)-comshift,_V(0,1,-1.5)-comshift,_V(1,-1,-1.5)-comshift); SetPMI (_V(2,2,0.55)); SetCrossSections (_V(5,5,1000)); SetCW (1.1, 2.2, 3.5, 3.5); SetRotDrag (_V(0.05,0.05,0.05)); SetPitchMomentScale (-5e-5); SetBankMomentScale (-5e-5); SetLiftCoeffFunc(0); if( ph_first ) { DelPropellantResource(ph_first); ph_first = NULL; } if( ph_second ) { DelPropellantResource(ph_second); ph_second = NULL; } if( ph_srm == NULL ) { ph_srm = CreatePropellantResource(FUELSRM); } th_srm = CreateThruster (_V(0, 0, -0.5)-comshift, _V(0,0,1), 150000.0, ph_srm, 2000.0, 0.0); AddExhaustStream(th_srm, &oms_exhaust); VECTOR3 off, off2; UINT msh, msh2; off2 = (VZERO-comshift)+_V(0,0,72); if( status == 3 ) { msh2 = AddMesh(hpara,&off2); SetMeshVisibilityMode(msh2,MESHVIS_ALWAYS); } off = (VZERO-comshift); msh = AddMesh(hentry,&off); SetMeshVisibilityMode(msh,MESHVIS_ALWAYS); Draw(VZERO-comshift);/* if( status == 4 ) { static UINT groups0[5] = { 0, 1, 2, 3, 4 }; animcomp1 = AddAnimationComponent( anim1, 0, 1, new MGROUP_ROTATE ( msh2, groups0, 5, _V(0,0,1)-off2, _V(1,0,0), 30*RAD ) ); animcomp2 = AddAnimationComponent( anim2, 0, 1, new MGROUP_ROTATE ( msh2, groups0, 5, _V(0,0,1)-off2, _V(0,1,0), 30*RAD ) ); }*/}void TMA::Animations(UINT mshid) { int i; for( i = 0 ; i < 20 ; i++ ) { DelAnimationComponent(anim3, animcomp3 ); } MGROUP_ROTATE *mgroup; MGROUP_TRANSLATE *mgroupt; /*** left panel */ static UINT groups0[1] = { 16 }; mgroup = new MGROUP_ROTATE ( mshid, groups0, 1, _V(-1.1,0,0), _V(0,0,1), 90*RAD ); animcomp3[0] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup); static UINT groups1[1] = { 17 }; mgroup = new MGROUP_ROTATE ( mshid, groups1, 1, _V(-1.12,0.63,0), _V(0,0,1), -178*RAD ); animcomp3[1] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[0]); static UINT groups2[1] = { 20 }; mgroup = new MGROUP_ROTATE ( mshid, groups2, 1, _V(-1.15,-0.63,0), _V(0,0,1), 178*RAD ); animcomp3[2] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[1]); static UINT groups3[2] = { 19, 18 }; mgroup = new MGROUP_ROTATE ( mshid, groups3, 2, _V(-1.18,0.63,0), _V(0,0,1), -178*RAD ); animcomp3[3] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[2]); /*** right panel */ static UINT groups4[1] = { 21 }; mgroup = new MGROUP_ROTATE ( mshid, groups4, 1, _V(1.1,0,0), _V(0,0,1), -90*RAD ); animcomp3[4] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup); static UINT groups5[1] = { 22 }; mgroup = new MGROUP_ROTATE ( mshid, groups5, 1, _V(1.12,0.63,0), _V(0,0,1), 178*RAD ); animcomp3[5] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[4]); static UINT groups6[1] = { 25 }; mgroup = new MGROUP_ROTATE ( mshid, groups6, 1, _V(1.15,-0.63,0), _V(0,0,1), -178*RAD ); animcomp3[6] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[5]); static UINT groups7[2] = { 23,24 }; mgroup = new MGROUP_ROTATE ( mshid, groups7, 2, _V(1.18,0.63,0), _V(0,0,1), 178*RAD ); animcomp3[7] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[6]); /* antennae */ static UINT groups8[1] = { 12 }; mgroup = new MGROUP_ROTATE ( mshid, groups8, 1, _V(-0.722,0.891,-2.6), _V(0.239796,0.97082,0), 178*RAD ); animcomp3[8] = AddAnimationComponent( anim3, 0.05, 0.3, mgroup); static UINT groups9[1] = { 15 }; mgroup = new MGROUP_ROTATE ( mshid, groups9, 1, _V(0,0.94,4.11), _V(1,0,0), -140*RAD ); animcomp3[9] = AddAnimationComponent( anim3, 0.31, 0.85, mgroup); static UINT groups10[1] = { 15 }; mgroup = new MGROUP_ROTATE ( mshid, groups10, 1, _V(0,0.94,4.11), _V(1,0,0), -10*RAD ); animcomp3[10] = AddAnimationComponent( anim3, 0.27, 0.3, mgroup); static UINT groups11[1] = { 14 }; mgroup = new MGROUP_ROTATE ( mshid, groups11, 1, _V(-0.94,0,4.11), _V(0,1,0), -130*RAD ); animcomp3[11] = AddAnimationComponent( anim3, 0.3, 0.9, mgroup); static UINT groups12[1] = { 14 }; mgroup = new MGROUP_ROTATE ( mshid, groups12, 1, _V(-0.94,0,4.11), _V(0,1,0), -20*RAD ); animcomp3[12] = AddAnimationComponent( anim3, 0.3, 0.35, mgroup); static UINT groups13[2] = { 0,4 }; mgroupt = new MGROUP_TRANSLATE ( mshid, groups13, 2, _V(0,-0.4,0.07) ); animcomp3[13] = AddAnimationComponent( anim3, 0.8, 1.0, mgroupt); /* thingie */ static UINT groups14[1] = { 27 }; mgroup = new MGROUP_ROTATE ( mshid, groups14, 1, _V(0.565,-0.35,4.36), _V(0.574,1,0), -50*RAD ); animcomp3[14] = AddAnimationComponent( anim3, 0.02, 0.1, mgroup); static UINT groups15[1] = { 26 }; mgroup = new MGROUP_ROTATE ( mshid, groups15, 1, _V(0.794,-0.484,4.093), _V(0.574,1,0), 50*RAD ); animcomp3[15] = AddAnimationComponent( anim3, 0.02, 0.1, mgroup, animcomp3[14]);}void TMA::makeanimation( int i, UINT groups[], int n, VECTOR3 ref, VECTOR3 axis, double range , double start = 0, double end = 1, UINT mid = 0) { if( animlevel > 0.5 ) { animlevel = 1.0; } else { animlevel = 0.0; } rot = new MGROUP_ROTATE ( mid, // mesh index groups, n, // group list and # groups ref, // rotation reference point axis, // rotation axis (float) range // angular rotation range ); animcomp3 = AddAnimationComponent (anim3, start, end, rot);}void TMA::BlowOrbiter() { JettisonComponent("SoyuzOrbitMod", "soyorbit", (VZERO-comshift)+_V(0.45,0.60,2.75) , _V(0,0,0.5), _V(0,0,0)); JettisonComponent("SoyuzServiceMod", "soyservice", (VZERO-comshift)+_V(0,0.2,-2.2) , _V(0,0,-0.5), _V(0,0,0)); status = 1; refresh = 1;}void TMA::CalcParaAngles() { double aoa; double slip; aoa = GetAOA() - PI; if( aoa < -PI ) aoa+=2.0*PI; slip = GetSlipAngle() - PI; if( slip < -PI ) slip += 2.0*PI; if( aoa > 30*RAD ) aoa = 30*RAD; else if( aoa < -30*RAD ) aoa = -30*RAD; if( slip > 30*RAD ) slip = 30*RAD; else if( slip < -30*RAD ) slip = -30*RAD; aoa /= 30*RAD; slip /= 30*RAD; // -1 to 1 aoa /= 2.0; slip /= 2.0; // -0.5 to 0.5 aoa += 0.5; // 0 to 1 slip += 0.5; slip = 1.0-slip; // correct for opposite sign/* if( animcomp1 != NULL ) { SetAnimation( anim1, aoa ); } if( animcomp2 != NULL ) { SetAnimation( anim2, slip ); }*/}
#include "cvel.h"#include "orbitersdk.h"#include <stdio.h>#include <math.h>#define MASS 6320.0 #define MASSENTRY 2950.0#define FUEL 900.0#define FUELRCS 40.0#define FUELSRM 70.0class TMA: public COMMON_VESSEL_EX {public: TMA(OBJHANDLE hObj, int fmodel); void TimeStep( double simt ); void SetMainStage (); void SetEntryStage (); void SetParaStage (); void SetDrogueStage(); void LoadState( FILEHANDLE scn, void *vs ); void SaveState( FILEHANDLE scn ); void SetClassCaps( FILEHANDLE cfg ); int ConsumeBufferedKey(DWORD dwKey, bool fPressed, const char *keystate); void Separate(); void Refresh(short r); void ImmediateRefresh(short r); void VisualCreated( VESSEL *vessel, VISHANDLE vis, int refcount ); void normalise( VECTOR3 *v ); void CalcParaAngles(); void Animations(UINT); void AddThrusters(); void makeanimation( int i, UINT groups[], int n, VECTOR3 ref, VECTOR3 axis, double range , double start, double end , UINT mid);protected: PROPELLANT_HANDLE ph_first; PROPELLANT_HANDLE ph_second; PROPELLANT_HANDLE ph_srm; THRUSTER_HANDLE th_first; THRUSTER_HANDLE th_pup[4]; THRUSTER_HANDLE th_pdown[4]; THRUSTER_HANDLE th_yleft[4]; THRUSTER_HANDLE th_yright[4]; THRUSTER_HANDLE th_rleft[4]; THRUSTER_HANDLE th_rright[4]; THRUSTER_HANDLE th_up[4]; THRUSTER_HANDLE th_down[4]; THRUSTER_HANDLE th_left[4]; THRUSTER_HANDLE th_right[4]; THRUSTER_HANDLE th_fore[4]; THRUSTER_HANDLE th_aft[4]; THRUSTER_HANDLE th_srm; MESHHANDLE htma; MESHHANDLE hentry; MESHHANDLE hpara; MESHHANDLE hdrogue; SURFHANDLE tex; VECTOR3 VZERO; short status; short targetstatus; VECTOR3 comshift; short anim1, anim2, anim3; ANIMATIONCOMPONENT_HANDLE animcomp1; ANIMATIONCOMPONENT_HANDLE animcomp2; ANIMATIONCOMPONENT_HANDLE animcomp3[20]; float xproc; VESSEL *chute; void ReEnter(); void BlowOrbiter(); bool reenteractive; bool reentercoasting; double target; UINT animstate; float animlevel; UINT refresh; DOCKHANDLE dh; short animactive; MGROUP_ROTATE *rot[30];};/*****/DLLCLBK VESSEL *ovcInit (OBJHANDLE hvessel, int flightmodel){ TMA *tma= new TMA( hvessel, flightmodel ); return tma;}/*****/DLLCLBK void ovcExit (VESSEL *vessel){ if (vessel) delete (TMA*)vessel;}/*****/DLLCLBK int ovcConsumeBufferedKey (VESSEL *vessel, DWORD dwKey, bool fPressed, const char *keystate){ TMA *tma = (TMA*)vessel; return tma->ConsumeBufferedKey( dwKey, fPressed, keystate );}/*****/DLLCLBK void ovcSetClassCaps (VESSEL *vessel, FILEHANDLE cfg){ TMA *tma = (TMA*)vessel; tma->SetClassCaps( cfg );}/*****/DLLCLBK void ovcTimestep (VESSEL *vessel, double simt){ TMA *tma = (TMA*)vessel; tma->TimeStep( simt );}/*****/DLLCLBK void ovcVisualCreated ( VESSEL *vessel, VISHANDLE vis, int refcount) { TMA *tma = (TMA*)vessel; tma->VisualCreated ( vessel, vis, refcount);}/*****/DLLCLBK void ovcLoadStateEx (VESSEL *vessel, FILEHANDLE scn, void *vs){ TMA *tma = (TMA*)vessel; tma->LoadState( scn, vs );}/*****/DLLCLBK void ovcSaveState (VESSEL *vessel, FILEHANDLE scn){ TMA *tma= (TMA*)vessel; tma->SaveState( scn );}
link orbitersdk.lib orbiter.lib cvel.lib
---------- Capture Output ----------> "D:\C++\bin\cl.exe" @orbiter.rsp soyuztma.cppMicrosoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.cl /Ox /GX /ML /LD /I"D:\C++\include" /I"F:\Orbiter\orbitersdk\include" /link /libpath:"D:\C++\lib" /link /libpath:"F:\Orbiter\orbitersdk\lib" /link kernel32.lib user32.lib gdi32.lib /link orbitersdk.lib orbiter.lib cvel.lib /link /nodefaultlib:"MSVCRT.LIB" /nodefaultlib:"MSVCIRT.LIB" /nodefaultlib:"LIBCMT.LIB"soyuztma.cppMicrosoft (R) Incremental Linker Version 7.10.3077Copyright (C) Microsoft Corporation. All rights reserved./out:soyuztma.dll /dll /implib:soyuztma.lib /libpath:D:\C++\lib /libpath:F:\Orbiter\orbitersdk\lib kernel32.lib user32.lib gdi32.lib orbitersdk.lib orbiter.lib cvel.lib /nodefaultlib:MSVCRT.LIB /nodefaultlib:MSVCIRT.LIB /nodefaultlib:LIBCMT.LIB soyuztma.obj Creating library soyuztma.lib and object soyuztma.exp> Terminated with exit code 0.
Si ça peux te rassurer, après déboguage de ton code (y'avait quelques lignes qui merdaient)
no matter a écrit:QuoteSi ça peux te rassurer, après déboguage de ton code (y'avait quelques lignes qui merdaient)Vu mon niveau en C++, il sera bien dur pour moi de debugger. Je ne sais même pas comment faire. Peux-tu me dire quelles sont ces erreurs?
#include "soyuztma.h"PARTICLESTREAMSPEC rcs_exhaust = {0, 0.05, 3000, 5, 0.1, 0.1, 1, 0.0, PARTICLESTREAMSPEC::EMISSIVE,PARTICLESTREAMSPEC::LVL_PLIN, 0, 2,PARTICLESTREAMSPEC::ATM_PLOG, 0.0, 0.0};PARTICLESTREAMSPEC oms_exhaust = {0, 0.4, 3000, 150, 0.05, 0.5, 5, 0.0, PARTICLESTREAMSPEC::EMISSIVE,PARTICLESTREAMSPEC::LVL_PLIN, 0, 2,PARTICLESTREAMSPEC::ATM_PLOG, 0.0, 0.0};PARTICLESTREAMSPEC oms_exhaust2 = {0, 0.4, 3000, 50, 0.05, 0.1, 5.0/3.0, 0.0, PARTICLESTREAMSPEC::EMISSIVE,PARTICLESTREAMSPEC::LVL_PLIN, 0, 2,PARTICLESTREAMSPEC::ATM_PLOG, 0.0, 0.0};TMA::TMA (OBJHANDLE hObj, int fmodel): COMMON_VESSEL_EX (hObj){ph_first = NULL;ph_second = NULL;ph_srm = NULL;htma = oapiLoadMesh("soyuz");hentry = oapiLoadMesh("soyuz-descent");hpara = oapiLoadMesh("soychute");hdrogue = oapiLoadMesh("soydrogue");VZERO = _V(0,0,0);status = 0;targetstatus = 0;comshift = _V(0,0,0);// anim1 = CreateAnimation (0.5);// anim2 = CreateAnimation (0.5);anim3 = CreateAnimation(0);animcomp1 = NULL;animcomp2 = NULL;int i;for( i = 0 ; i < 20 ; i++ ) {animcomp3 = NULL;}xproc = 0.0;chute = NULL;reenteractive = false;reentercoasting = false;target = 6445000.0;animstate = 0;animlevel = 0.0;refresh = 0;animactive = 0;dh=NULL;}void TMA::TimeStep( double simt ){/* CVE-lite function ! *//* IMPORTANT *//* This function loops through the pending GPDS requests and returns a bool (true/false)/* if any GPDS requests have been implemented./* If any have (eg adding a new payload), you will need to re-draw your ship, hence the/* call to the (repeatable) SetMainStage(); */if( CheckCentralMessage() ) {while( CheckCentralMessage() ) ;// SetMainStage();}if( animactive ) {if( animactive == 1 ) {animlevel += oapiGetSimStep() / 10.0;if( animlevel > 1.0 ) {animlevel = 1.0;animactive = 0;}}else {animlevel -= oapiGetSimStep() / 10.0;if( animlevel < 0.0 ) {animlevel = 0.0;animactive = 0;}}SetAnimation( anim3, animlevel );}if( refresh > 0 ) {refresh++;if( refresh == 2 )SetAnimation( anim3, 0.0 );if( refresh == 3 )if( status == 0 )SetMainStage();else if( status == 1 )SetEntryStage();else if( status == 2 )SetDrogueStage();else if( status == 3 )SetParaStage();else if( status == 4 )SetEntryStage();if( refresh == 4 ) {SetAnimation( anim3, animlevel );refresh = 0;}}if( status == 2 || status == 3 ) {if( oapiGetTimeAcceleration() > 10.0 ) {oapiSetTimeAcceleration(10.0);}CalcParaAngles();if( status == 3 && GetAltitude() < 2.0 && th_srm != NULL ) {chute = JettisonComponent("SoyuzChute", "soychute", (VZERO-comshift)+_V(0,0,72) , _V(0,0,0), _V(0,0,0));status = 4;refresh = 1;}else if( status == 2 && ( ( GetAltitude() < 2000.0 && GetAirspeed() < 80.0 ) || GetAltitude() < 600.0 ) ) {status = 3;refresh = 1;}}else if( status == 1 ) {if( GetAltitude() < 12000 && GetAirspeed() < 300 ) {status = 2;refresh = 1;return;}}if( status == 4 && chute ) {if( chute->GroundContact() ){oapiDeleteVessel(chute->GetHandle());chute = NULL;}}}void TMA::VisualCreated ( VESSEL *vessel, VISHANDLE vis, int refcount) {SetMainStage(); // this is a good place to ask for the initial setup.refresh = 1;}void TMA::SetClassCaps( FILEHANDLE cfg ){}void TMA::SaveState( FILEHANDLE scn ){SaveDefaultState (scn);oapiWriteScenario_int (scn, "CONFIGURATION", status );oapiWriteScenario_float( scn, "PANELS", animlevel );SaveDefaultStateEx(scn);}void TMA::LoadState( FILEHANDLE scn, void *vs ){char *line;while (oapiReadScenario_nextline (scn, line)) {if( !strnicmp( line, "CONFIGURATION", 13 ) ) {status = atoi( line+13 );}else if( !strnicmp( line, "PANELS", 6 ) ) {animlevel = atof( line+6 );}/* CVE-lite function ! *//* IMPORTANT *//* Call this for every line in the scenario file. It will automatically/* deduce which lines are for it, and load the payloads from the file. *//* load payload lines */ParsePayloadString(line);ParseScenarioLineEx (line, vs);}/* always set the stage whenever something may have changed */SetMainStage();refresh = 1;}/* IMPORTANT *//* Always have a function that you can call as many times as you like that will re-draw/* all you meshes, reset all your thrusters and check to make sure the propellent is/* there. This should be called after any configuration change, or any GDPS line (see/* TimeStep(), above) */void TMA::SetMainStage( ){SetAnimation( anim3, 0.0 );VECTOR3 VECTOR_ZERO = _V(0,0,0);/* CVE-lite function ! *//* ClearMeshesEx() will get rid of all the normal meshes, plus anything you've defined/* with the COMMON_MESH class (not used here) *//* erase all meshes and thrusters so we can start afresh */ClearMeshesEx();SetSize (15);/* CVE-lite function ! *//* IMPORTANT *//* double CalculateMass() will return the all-up mass of the combined payloads and/* upper stages. Simply add this to your normal dry mass. *//* always add payload mass [CalculateMass()] to the vessel's empty mass */SetEmptyMass ( MASS + CalculateMass() );ShiftCentreOfMass(VZERO-comshift);comshift = _V(0,0,0);ShiftCentreOfMass(comshift);SetTouchdownPoints (_V(0,-2,4)-comshift,_V(2,-2,-4)-comshift,_V(-2,-2,-4)-comshift);SetPMI (_V(5,5,0.85));SetCrossSections (_V(15,32,6));SetCW (1.1, 2.2, 3.5, 3.5);SetRotDrag (_V(0.1,0.1,0.01));SetPitchMomentScale (-3e-6);SetBankMomentScale (3e-6);SetLiftCoeffFunc(0); SetSurfaceFrictionCoeff (0.05, 0.5);SetCameraOffset( _V( 0.0, -1.50, 1.5)-comshift );VECTOR_ZERO = (comshift*-1.0);/* we're not using COMMON_MESH today, so draw our own */UINT mshid = AddMesh("soyuz", &VECTOR_ZERO );SetMeshVisibilityMode( mshid, MESHVIS_ALWAYS );Animations(mshid);MeshVisibilityPreference(MESHVIS_ALWAYS);/* CVE-lite function ! *//* IMPORTANT *//* Draw() should be called to render all the loaded payloads, plus anything you've/* added with the COMMON_MESH class (not used here) *//* call draw to render the payloads, plus anything you've added from COMMON_MESH */Draw(comshift*-1.0);/* CVE-lite variable ! *//* IMPORTANT *//* Use the keyword double InitFuelLevel multipled by the maximum mass to have the/* fuel levels automatically set from the GPDS payload string *//* verify that the propellent hasn't been created before making it */if( ph_first == NULL ) {ph_first = CreatePropellantResource(FUEL);}if( !dh )dh = CreateDock(_V(0,0,4.615),_V(0,0,1),_V(0,1,0));SetDefaultPropellantResource (ph_first); AddThrusters();EnableTransponder(true);}void TMA::SetEntryStage() {ShiftCentreOfMass(VZERO-comshift);comshift = _V(0,-0.1,-0.5);ShiftCentreOfMass(comshift);SetCameraOffset( _V( 0.0, -1.65, -0.1)-comshift );int i;for( i = 0 ; i < 20 ; i++ ) {if( animcomp3 != NULL ) {DelAnimationComponent(anim3, animcomp3 );animcomp3 = NULL;}}/*if( animcomp1 != NULL )DelAnimationComponent(anim1, animcomp1 );if( animcomp2 != NULL )DelAnimationComponent(anim2, animcomp2 );*/ ClearExhaustRefs();ClearAttExhaustRefs();ClearThrusterDefinitions();ClearMeshesEx(); SetSize (5);SetEmptyMass ( MASSENTRY + CalculateMass() );SetTouchdownPoints (_V(-1,-1,-1.5)-comshift,_V(0,1,-1.5)-comshift,_V(1,-1,-1.5)-comshift);SetPMI (_V(2,2,0.55));SetCrossSections (_V(5,5,5));SetCW (1.1, 2.2, 2.5, 2.5);SetRotDrag (_V(0.05,0.05,0.05));SetPitchMomentScale (-1e-6);SetBankMomentScale (-1e-6);SetLiftCoeffFunc(0);if( ph_first ) {DelPropellantResource(ph_first);ph_first = NULL;}if( ph_second && GetPropellantMass(ph_second) > 40.0 )SetPropellantMass(ph_second, 40.0);if( status == 4 ) {if( ph_srm == NULL ) {ph_srm = CreatePropellantResource(FUELSRM);}th_srm = CreateThruster (_V(0, 0, -1), _V(0,0,1), 60000.0, ph_srm, 200.0, 0.0);AddExhaustStream(th_srm, _V(0,1,-0.7), &oms_exhaust);AddExhaustStream(th_srm, _V(-0.7,-0.7,-0.7), &oms_exhaust);AddExhaustStream(th_srm, _V(0.7,-0.7,-0.7), &oms_exhaust);SetThrusterLevel(th_srm,1.0);}VECTOR3 off;UINT msh;off = (VZERO-comshift);msh = AddMesh(hentry,&off);SetMeshVisibilityMode(msh,MESHVIS_ALWAYS);Draw(VZERO-comshift);th_yleft[0] = CreateThruster (_V(0, 0, 1)-comshift, _V(-1,0,0), 50.0, ph_second, 2903.0, 0.0);th_yright[0] = CreateThruster (_V(0, 0, 1)-comshift, _V(1,0,0), 50.0, ph_second, 2903.0, 0.0);th_pup[0] = CreateThruster (_V(0, 0, 1)-comshift, _V(0,1,0), 50.0, ph_second, 2903.0, 0.0);th_pdown[0] = CreateThruster (_V(0, 0, 1)-comshift, _V(0,-1,0), 50.0, ph_second, 2903.0, 0.0);th_rleft[0] = CreateThruster (_V(0, 1, 1)-comshift, _V(-1,0,0), 50.0, ph_second, 2903.0, 0.0);th_rright[0] = CreateThruster (_V(0, 1, 1)-comshift, _V(1,0,0), 50.0, ph_second, 2903.0, 0.0);CreateThrusterGroup( th_yleft, 1, THGROUP_ATT_YAWLEFT );CreateThrusterGroup( th_yright, 1, THGROUP_ATT_YAWRIGHT );CreateThrusterGroup( th_pup, 1, THGROUP_ATT_PITCHUP );CreateThrusterGroup( th_pdown, 1, THGROUP_ATT_PITCHDOWN );CreateThrusterGroup( th_rleft, 1, THGROUP_ATT_BANKLEFT );CreateThrusterGroup( th_rright, 1, THGROUP_ATT_BANKRIGHT );}/** Handle buffered key events sent to the vessel by orbiter. * @param dwKey The scan code of the key* @param fPressed true if pressed, false if depressed* @param keystate the current state of the keyboard** modified switch routine by dave rowbotham.*/int TMA::ConsumeBufferedKey(DWORD dwKey, bool fPressed, const char *keystate){VESSELSTATUS vs;GetStatus(vs);if (KEYMOD_SHIFT (keystate)) {// reserved for MFDs}else if (KEYMOD_CONTROL (keystate)) {if (KEYDOWN (keystate, OAPI_KEY_J) && KEYMOD_CONTROL(keystate) && !KEYMOD_SHIFT(keystate) ) { if (oapiAcceptDelayedKey (OAPI_KEY_J, 1.0)) {if( status == 0 ) {BlowOrbiter();}else if( status < 4 ) {status++;refresh=1;}return 1;}}}else { // unmodified keysif (KEYDOWN (keystate, OAPI_KEY_K)) { // "Jettison Stage"if(oapiAcceptDelayedKey (OAPI_KEY_K, 0.5)) {if( animlevel > 0.5 )animactive = 2;elseanimactive = 1;return 1;}}if (KEYDOWN (keystate, OAPI_KEY_J) && !KEYMOD_CONTROL(keystate) && !KEYMOD_SHIFT(keystate) ) { if (oapiAcceptDelayedKey (OAPI_KEY_J, 1.0)) {DeployPayload();refresh=1;return 1;}}}return 0;}void TMA::AddThrusters(){th_first = CreateThruster (_V(0,0,-2.64)-comshift, _V(0,0,1), 3924.0, ph_first, 2992.0);AddExhaustStream(th_first, &oms_exhaust);AddExhaustStream(th_first, &oms_exhaust2);th_pup[0] = CreateThruster (_V(-0.1, 1.38, -2.515)-comshift, _V(0,-1,0), 140.0, ph_first, 2903.0, 0.0);th_pup[1] = CreateThruster (_V(0.1, 1.38, -2.515)-comshift, _V(0,-1,0), 140.0, ph_first, 2903.0, 0.0);th_pup[2] = CreateThruster (_V(-1.12, -0.25, 0)-comshift, _V(0,1,0), 140.0, ph_first, 2903.0, 0.0);th_pup[3] = CreateThruster (_V(1.12, -0.25, 0)-comshift, _V(0,1,0), 140.0, ph_first, 2903.0, 0.0);AddExhaustStream(th_pup[0], &rcs_exhaust);AddExhaustStream(th_pup[1], &rcs_exhaust);AddExhaustStream(th_pup[2], &rcs_exhaust);AddExhaustStream(th_pup[3], &rcs_exhaust);th_pdown[0] = CreateThruster (_V(-0.1, -1.38, -2.515)-comshift, _V(0,1,0), 140.0, ph_first, 2903.0, 0.0);th_pdown[1] = CreateThruster (_V(0.1, -1.38, -2.515)-comshift, _V(0,1,0), 140.0, ph_first, 2903.0, 0.0);th_pdown[2] = CreateThruster (_V(-1.12, 0.25, 0)-comshift, _V(0,-1,0), 140.0, ph_first, 2903.0, 0.0);th_pdown[3] = CreateThruster (_V(1.12, 0.25, 0)-comshift, _V(0,-1,0), 140.0, ph_first, 2903.0, 0.0);AddExhaustStream(th_pdown[0], &rcs_exhaust);AddExhaustStream(th_pdown[1], &rcs_exhaust);AddExhaustStream(th_pdown[2], &rcs_exhaust);AddExhaustStream(th_pdown[3], &rcs_exhaust);th_rleft[0] = th_pup[3];th_rleft[1] = th_pdown[2];th_rright[0] = th_pup[2];th_rright[1] = th_pdown[3];th_yleft[0] = CreateThruster (_V(-1.38, -0.1, -2.515)-comshift, _V(1,0,0), 140.0, ph_first, 2903.0, 0.0);th_yleft[1] = CreateThruster (_V(-1.38, 0.1, -2.515)-comshift, _V(1,0,0), 140.0, ph_first, 2903.0, 0.0);th_yleft[2] = CreateThruster (_V(1.2, -0.1, 0)-comshift, _V(-1,0,0), 140.0, ph_first, 2903.0, 0.0);th_yleft[3] = CreateThruster (_V(1.2, 0.1, 0)-comshift, _V(-1,0,0), 140.0, ph_first, 2903.0, 0.0);AddExhaustStream(th_yleft[0], &rcs_exhaust);AddExhaustStream(th_yleft[1], &rcs_exhaust);AddExhaustStream(th_yleft[2], &rcs_exhaust);AddExhaustStream(th_yleft[3], &rcs_exhaust);th_yright[0] = CreateThruster (_V(1.38, -0.1, -2.515)-comshift, _V(-1,0,0), 140.0, ph_first, 2903.0, 0.0);th_yright[1] = CreateThruster (_V(1.38, 0.1, -2.515)-comshift, _V(-1,0,0), 140.0, ph_first, 2903.0, 0.0);th_yright[2] = CreateThruster (_V(-1.2, -0.1, 0)-comshift, _V(1,0,0), 140.0, ph_first, 2903.0, 0.0);th_yright[3] = CreateThruster (_V(-1.2, 0.1, 0)-comshift, _V(1,0,0), 140.0, ph_first, 2903.0, 0.0);AddExhaustStream(th_yright[0], &rcs_exhaust);AddExhaustStream(th_yright[1], &rcs_exhaust);AddExhaustStream(th_yright[2], &rcs_exhaust);AddExhaustStream(th_yright[3], &rcs_exhaust);th_left[0] = th_yleft[2];th_left[1] = th_yleft[3];th_right[0] = th_yright[2];th_right[1] = th_yright[3];th_up[0] = th_pup[2];th_up[1] = th_pup[3];th_down[0] = th_pdown[2];th_down[1] = th_pdown[3];th_fore[0] = CreateThruster (_V(-1.1, 0, -2.64)-comshift, _V(0,0,1), 140.0, ph_first, 2903.0, 0.0);th_fore[1] = CreateThruster (_V(1.1, 0, -2.64)-comshift, _V(0,0,1), 140.0, ph_first, 2903.0, 0.0);th_fore[2] = CreateThruster (_V(0, 1.1, -2.64)-comshift, _V(0,0,1), 140.0, ph_first, 2903.0, 0.0);th_fore[3] = CreateThruster (_V(0, -1.1, -2.64)-comshift, _V(0,0,1), 140.0, ph_first, 2903.0, 0.0);AddExhaustStream(th_fore[0], &rcs_exhaust);AddExhaustStream(th_fore[1], &rcs_exhaust);AddExhaustStream(th_fore[2], &rcs_exhaust);AddExhaustStream(th_fore[3], &rcs_exhaust);th_aft[0] = CreateThruster (_V(-1.15, 0, 0.15)-comshift, _V(0.141,0,-0.99), 140.0, ph_first, 2903.0, 0.0);th_aft[1] = CreateThruster (_V(1.15, 0, 0.15)-comshift, _V(-0.141,0,-0.99), 140.0, ph_first, 2903.0, 0.0);AddExhaustStream(th_aft[0], &rcs_exhaust);AddExhaustStream(th_aft[1], &rcs_exhaust);CreateThrusterGroup( th_pup, 4, THGROUP_ATT_PITCHUP );CreateThrusterGroup( th_pdown, 4, THGROUP_ATT_PITCHDOWN );CreateThrusterGroup( th_yleft, 4, THGROUP_ATT_YAWLEFT );CreateThrusterGroup( th_yright, 4, THGROUP_ATT_YAWRIGHT );CreateThrusterGroup( th_rleft, 2, THGROUP_ATT_BANKLEFT );CreateThrusterGroup( th_rright, 2, THGROUP_ATT_BANKRIGHT );CreateThrusterGroup( th_left, 2, THGROUP_ATT_LEFT );CreateThrusterGroup( th_right, 2, THGROUP_ATT_RIGHT );CreateThrusterGroup( th_down, 2, THGROUP_ATT_DOWN );CreateThrusterGroup( th_up, 2, THGROUP_ATT_UP );CreateThrusterGroup( th_fore, 4, THGROUP_ATT_FORWARD );CreateThrusterGroup( th_aft, 2, THGROUP_ATT_BACK );CreateThrusterGroup( &th_first, 1, THGROUP_MAIN );CreateThrusterGroup( th_aft, 2, THGROUP_RETRO );}void TMA::SetDrogueStage() {int i;for( i = 0 ; i < 20 ; i++ ) {if( animcomp3 != NULL ) {DelAnimationComponent(anim3, animcomp3 );animcomp3 = NULL;}}ShiftCentreOfMass(VZERO-comshift);comshift = _V(0,-0.1,0);ShiftCentreOfMass(comshift);SetCameraOffset( _V( 0.0, -1.65, -0.1)-comshift );ClearExhaustRefs();ClearAttExhaustRefs();ClearThrusterDefinitions();ClearMeshesEx(); SetSize (80);SetEmptyMass ( MASSENTRY + CalculateMass() );SetTouchdownPoints (_V(-1,-1,-1.5)-comshift,_V(0,1,-1.5)-comshift,_V(1,-1,-1.5)-comshift);SetPMI (_V(2,2,0.55));SetCrossSections (_V(5,5,40));SetCW (1.1, 2.2, 3.5, 3.5);SetRotDrag (_V(0.05,0.05,0.05));SetPitchMomentScale (-5e-4);SetBankMomentScale (-5e-4);SetLiftCoeffFunc(0);if( ph_first ) {DelPropellantResource(ph_first);ph_first = NULL;}if( ph_second ) {DelPropellantResource(ph_second);ph_second = NULL;}if( ph_srm == NULL ) {ph_srm = CreatePropellantResource(FUELSRM);}VECTOR3 off, off2;UINT msh, msh2;off = (VZERO-comshift);msh = AddMesh(hentry,&off);SetMeshVisibilityMode(msh,MESHVIS_ALWAYS);off2 = (VZERO-comshift)+_V(0,0,72);msh2 = AddMesh(hdrogue,&off2);SetMeshVisibilityMode(msh2,MESHVIS_ALWAYS);Draw(VZERO-comshift);/*if( animcomp1 != NULL )DelAnimationComponent(anim1, animcomp1 );if( animcomp2 != NULL )DelAnimationComponent(anim2, animcomp2 );*//* static UINT groups0[5] = { 0, 1, 2, 3, 4 };animcomp1 = AddAnimationComponent( anim1, 0, 1,new MGROUP_ROTATE (msh2,groups0, 5,_V(0,0,1)-off2,_V(1,0,0),30*RAD));animcomp2 = AddAnimationComponent( anim2, 0, 1,new MGROUP_ROTATE (msh2,groups0, 5,_V(0,0,1)-off2,_V(0,1,0),30*RAD));*/}void TMA::SetParaStage() {int i;for( i = 0 ; i < 20 ; i++ ) {if( animcomp3 != NULL ) {DelAnimationComponent(anim3, animcomp3 );animcomp3 = NULL;}}/* if( animcomp1 != NULL )DelAnimationComponent(anim1, animcomp1 );if( animcomp2 != NULL )DelAnimationComponent(anim2, animcomp2 );*/ShiftCentreOfMass(VZERO-comshift);// comshift = _V(0,-0.18,-1.265);comshift = _V(0,-0.1,0);ShiftCentreOfMass(comshift);SetCameraOffset( _V( 0.0, -1.65, -0.1)-comshift );ClearExhaustRefs();ClearAttExhaustRefs();ClearThrusterDefinitions();ClearMeshesEx(); SetSize (80);SetEmptyMass ( MASSENTRY + CalculateMass() );SetTouchdownPoints (_V(-1,-1,-1.5)-comshift,_V(0,1,-1.5)-comshift,_V(1,-1,-1.5)-comshift);SetPMI (_V(2,2,0.55));SetCrossSections (_V(5,5,1000));SetCW (1.1, 2.2, 3.5, 3.5);SetRotDrag (_V(0.05,0.05,0.05));SetPitchMomentScale (-5e-5);SetBankMomentScale (-5e-5);SetLiftCoeffFunc(0);if( ph_first ) {DelPropellantResource(ph_first);ph_first = NULL;}if( ph_second ) {DelPropellantResource(ph_second);ph_second = NULL;}if( ph_srm == NULL ) {ph_srm = CreatePropellantResource(FUELSRM);}th_srm = CreateThruster (_V(0, 0, -0.5)-comshift, _V(0,0,1), 150000.0, ph_srm, 2000.0, 0.0);AddExhaustStream(th_srm, &oms_exhaust);VECTOR3 off, off2;UINT msh, msh2;off2 = (VZERO-comshift)+_V(0,0,72);if( status == 3 ) {msh2 = AddMesh(hpara,&off2);SetMeshVisibilityMode(msh2,MESHVIS_ALWAYS);}off = (VZERO-comshift);msh = AddMesh(hentry,&off);SetMeshVisibilityMode(msh,MESHVIS_ALWAYS);Draw(VZERO-comshift);/*if( status == 4 ) {static UINT groups0[5] = { 0, 1, 2, 3, 4 };animcomp1 = AddAnimationComponent( anim1, 0, 1,new MGROUP_ROTATE (msh2,groups0, 5,_V(0,0,1)-off2,_V(1,0,0),30*RAD));animcomp2 = AddAnimationComponent( anim2, 0, 1,new MGROUP_ROTATE (msh2,groups0, 5,_V(0,0,1)-off2,_V(0,1,0),30*RAD));}*/}void TMA::Animations(UINT mshid) {int i;for( i = 0 ; i < 20 ; i++ ) {DelAnimationComponent(anim3, animcomp3 );}MGROUP_ROTATE *mgroup;MGROUP_TRANSLATE *mgroupt;/*** left panel */static UINT groups0[1] = { 16 };mgroup = new MGROUP_ROTATE (mshid,groups0, 1,_V(-1.1,0,0),_V(0,0,1),90*RAD);animcomp3[0] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup);static UINT groups1[1] = { 17 };mgroup = new MGROUP_ROTATE (mshid,groups1, 1,_V(-1.12,0.63,0),_V(0,0,1),-178*RAD);animcomp3[1] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[0]);static UINT groups2[1] = { 20 };mgroup = new MGROUP_ROTATE (mshid,groups2, 1,_V(-1.15,-0.63,0),_V(0,0,1),178*RAD);animcomp3[2] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[1]);static UINT groups3[2] = { 19, 18 };mgroup = new MGROUP_ROTATE (mshid,groups3, 2,_V(-1.18,0.63,0),_V(0,0,1),-178*RAD);animcomp3[3] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[2]);/*** right panel */static UINT groups4[1] = { 21 };mgroup = new MGROUP_ROTATE (mshid,groups4, 1,_V(1.1,0,0),_V(0,0,1),-90*RAD);animcomp3[4] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup);static UINT groups5[1] = { 22 };mgroup = new MGROUP_ROTATE (mshid,groups5, 1,_V(1.12,0.63,0),_V(0,0,1),178*RAD);animcomp3[5] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[4]);static UINT groups6[1] = { 25 };mgroup = new MGROUP_ROTATE (mshid,groups6, 1,_V(1.15,-0.63,0),_V(0,0,1),-178*RAD);animcomp3[6] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[5]);static UINT groups7[2] = { 23,24 };mgroup = new MGROUP_ROTATE (mshid,groups7, 2,_V(1.18,0.63,0),_V(0,0,1),178*RAD);animcomp3[7] = AddAnimationComponent( anim3, 0.1, 0.9, mgroup, animcomp3[6]);/* antennae */static UINT groups8[1] = { 12 };mgroup = new MGROUP_ROTATE (mshid,groups8, 1,_V(-0.722,0.891,-2.6),_V(0.239796,0.97082,0),178*RAD);animcomp3[8] = AddAnimationComponent( anim3, 0.05, 0.3, mgroup);static UINT groups9[1] = { 15 };mgroup = new MGROUP_ROTATE (mshid,groups9, 1,_V(0,0.94,4.11),_V(1,0,0),-140*RAD);animcomp3[9] = AddAnimationComponent( anim3, 0.31, 0.85, mgroup);static UINT groups10[1] = { 15 };mgroup = new MGROUP_ROTATE (mshid,groups10, 1,_V(0,0.94,4.11),_V(1,0,0),-10*RAD);animcomp3[10] = AddAnimationComponent( anim3, 0.27, 0.3, mgroup);static UINT groups11[1] = { 14 };mgroup = new MGROUP_ROTATE (mshid,groups11, 1,_V(-0.94,0,4.11),_V(0,1,0),-130*RAD);animcomp3[11] = AddAnimationComponent( anim3, 0.3, 0.9, mgroup);static UINT groups12[1] = { 14 };mgroup = new MGROUP_ROTATE (mshid,groups12, 1,_V(-0.94,0,4.11),_V(0,1,0),-20*RAD);animcomp3[12] = AddAnimationComponent( anim3, 0.3, 0.35, mgroup);static UINT groups13[2] = { 0,4 };mgroupt = new MGROUP_TRANSLATE (mshid,groups13, 2,_V(0,-0.4,0.07));animcomp3[13] = AddAnimationComponent( anim3, 0.8, 1.0, mgroupt);/* thingie */static UINT groups14[1] = { 27 };mgroup = new MGROUP_ROTATE (mshid,groups14, 1,_V(0.565,-0.35,4.36),_V(0.574,1,0),-50*RAD);animcomp3[14] = AddAnimationComponent( anim3, 0.02, 0.1, mgroup);static UINT groups15[1] = { 26 };mgroup = new MGROUP_ROTATE (mshid,groups15, 1,_V(0.794,-0.484,4.093),_V(0.574,1,0),50*RAD);animcomp3[15] = AddAnimationComponent( anim3, 0.02, 0.1, mgroup, animcomp3[14]);}void TMA::makeanimation( int i, UINT groups[], int n, VECTOR3 ref, VECTOR3 axis, double range , double start = 0, double end = 1, UINT mid = 0) {if( animlevel > 0.5 ) {animlevel = 1.0;}else {animlevel = 0.0;}rot = new MGROUP_ROTATE (mid, // mesh indexgroups, n, // group list and # groupsref, // rotation reference pointaxis, // rotation axis(float) range // angular rotation range);animcomp3 = AddAnimationComponent (anim3, start, end, rot);}void TMA::BlowOrbiter() {JettisonComponent("SoyuzOrbitMod", "soyorbit", (VZERO-comshift)+_V(0.45,0.60,2.75) , _V(0,0,0.5), _V(0,0,0));JettisonComponent("SoyuzServiceMod", "soyservice", (VZERO-comshift)+_V(0,0.2,-2.2) , _V(0,0,-0.5), _V(0,0,0));status = 1;refresh = 1;}void TMA::CalcParaAngles() {double aoa;double slip;aoa = GetAOA() - PI;if( aoa < -PI )aoa+=2.0*PI;slip = GetSlipAngle() - PI;if( slip < -PI )slip += 2.0*PI;if( aoa > 30*RAD )aoa = 30*RAD;else if( aoa < -30*RAD )aoa = -30*RAD;if( slip > 30*RAD )slip = 30*RAD;else if( slip < -30*RAD )slip = -30*RAD;aoa /= 30*RAD;slip /= 30*RAD; // -1 to 1aoa /= 2.0;slip /= 2.0; // -0.5 to 0.5aoa += 0.5; // 0 to 1slip += 0.5;slip = 1.0-slip; // correct for opposite sign/*if( animcomp1 != NULL ) {SetAnimation( anim1, aoa );}if( animcomp2 != NULL ) {SetAnimation( anim2, slip );}*/}
Désolé probléme de famille