See site in english Voir le site en francais
Website skin:
home  download  forum  link  contact

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Author Topic: Problème pour recompiler (solutionné)  (Read 6498 times)

0 Members and 1 Guest are viewing this topic.

Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
23 September 2006, 04:13:02
Je commence à avoir grillé un peu trop de cigarettes devant mon écran sur ce problème...:damn:
Je n'arrive pas à recompiler la source du soyuzTMA CVEL.
J'utilise le SDK de Korben et j'ai réussi à compiler sans erreurs mon LL918, quelques exemples (MMU et
ShuttlePB) du SDK et l'exemple "surveyor" du site "www.orbiterwiki.org.

Je n'ai rien changé à mon installation et tout ce qui fonctionnait avant fonctionne toujours. Mais dès que je veux
recompiler du CVEL, rien à faire toujours le même genre de réponse:
Quote
---------- Capture Output ----------
> "D:\C++\bin\cl.exe" @orbiter.rsp soyuztma.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (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.cpp
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (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.exp
soyuztma.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.


Désolé pour la mise en forme un peu brute. J'obtient ce message même sans mes modifications avec la source
originale telle qu'elle est distribuée dans l'archive originale du TMA CVEL.

J'ajoute que le code nécessite CVEL (cvel.h, cvelmessage.h et cvel.lib).

Quelqu'un aurait-il une idée sur la raison de ce problème?



Message modifié ( 23-09-2006 21:33 )

------------

no matter.

Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #1 - 23 September 2006, 04:15:05
Voici le fichier .cpp

Quote
#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 );
   }
*/
}


------------

no matter.

Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #2 - 23 September 2006, 04:16:17
Et son ami, soyuztma.h
Quote
#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.0

class 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 );
}


Désolé pour la longueur du gratin :siffle:



Message modifié ( 23-09-2006 04:22 )

------------

no matter.

Offline korben62

  • Hero Member
  • *****
  • Posts: 561
  • Karma: 0
Reply #3 - 23 September 2006, 15:31:05
Tu n'aurais pas, par hazard, essayé d'installer DEVC++?




Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #4 - 23 September 2006, 15:41:46
Auparavant DevC++ était installé sur mon pc effectivement!!
EDIT: Il est normalement désinstallé maintenant, depuis quelques temps déjà.



Message modifié ( 23-09-2006 16:36 )

------------

no matter.

Offline korben62

  • Hero Member
  • *****
  • Posts: 561
  • Karma: 0
Reply #5 - 23 September 2006, 16:48:39
je dis ça, car j'ai eu le méme probléme

et le debut du message d'erreur contiens les lignes du fichier orbiter.rsp

dev c++ ajoute des lignes dans ce fichier qui provoque des erreurs de compilation
regarde dans ton orbiter rsp si il y a des lignes en trop  et suprimme les




Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #6 - 23 September 2006, 17:01:00
Mon orbiter.rsp a été crée après la désinstallation de DevC++ et n'a pas été modifié. Mis à part les chemins des
dossier include et lib, rien n'a changé par rapport à la version donné dans ton SDK (merci d'ailleurs pour celui-ci).
Merci pour ta réponse.

Bah, je crois qu'une fois encore il va falloir que j'abandonne, F...K!!

------------

no matter.

Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #7 - 23 September 2006, 17:12:50
Humm c'est génial, j'obtient les mêmes erreurs avec tous les pc où j'ai testé!!

Il n'y a plus de mots assez durs pour indiquer la rage que j'éprouve.

EDIT: Çà peut avoir son intérêt, j'utilise Windows2000.



Message modifié ( 23-09-2006 17:40 )

------------

no matter.

Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #8 - 23 September 2006, 17:36:39
:cry:SNIF!




Message modifié ( 23-09-2006 17:37 )

------------

no matter.

Offline brainstorm

  • Legend
  • ******
  • Posts: 2694
  • Karma: 0
Reply #9 - 23 September 2006, 17:45:37
Si ça peux te rassurer, après déboguage de ton code (y'avait quelques lignes qui merdaient), j'ai exactement le
même soucis avec mon SDK (qui est celui de korben à la base.).



Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #10 - 23 September 2006, 17:58:36
Merci, d'avoir essayé Brainstorm, c'est sympa ;)

Déjà, effectivement çà me rassure, çà ne viens sans doute pas d'une erreur de configuration ou d'installation. Je
n'arrive pas à comprendre et il faut dire que mes lacunes en C++ sont immensément immenses.

Par contre, ce n'est pas mon code!!!! C'est l'original du soyuz TMA de D. Henderson (dh219) que je comptais réutiliser
pour avoir un TMA avec un dock APAS.

Le même genre d'erreur survient avec tout les codes utilisant CVEL-lib que j'ai testés (ATV...). Çà semblerait provenir
de là donc mais je ne sais vraiment pas où précisement et surtout pourquoi.
Sur le forum anglo, daver (apparemment de l'équipe CVEL) m'a assuré "qu'avec un compileur bien configuré tous les
addons cvel se compilaient sans soucis".

J'ai remarqué que la compilation en .exe ne produisait aucune erreur (terminated with exit code 0) même si l'exe n'est pas créé.



Message modifié ( 23-09-2006 18:01 )

------------

no matter.

Offline Momo

  • Legend
  • ******
  • Posts: 2682
  • Karma: 1
Reply #11 - 23 September 2006, 18:28:03
Heu... je suis rien... mais pourquoi recompiler la source du soyuzTMA CVEL?
ya une idée derriere la tête? ou c'est pour reproduire la phase de séparation?
desolé...


Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #12 - 23 September 2006, 18:54:11
Mon idée n'était pas de propser cet addon, c'était surtout pour moi une occasion d'apprendre un peu plus en C++.
Je voulais simplement rajouter un dock APAS, regarde bien la capture, le port n'est pas le port original, c'est un APAS,
le TMA-APAS a bel et bien existé.



------------

no matter.

Offline brainstorm

  • Legend
  • ******
  • Posts: 2694
  • Karma: 0
Reply #13 - 23 September 2006, 19:04:03
J'ai fouiné un peu, et visiblement ce serait un librairie manquante pour la compilation. Je n'ai pas encore trouvé
laquelle, mais y'a quelque post sur le net concernant le bug "unresolved external symbol ...."
il faut ensuite la rajouter dans orbiterRSP suite à "/link kernel32.lib user32.lib gdi32.lib" (je suposse ! ;) ) et ça devrait
le faire. Le tout est de savoir laquelle. A priori, je cherchais MSVCRT.LIB à ajouter. Il faudrait essayer pour voir.



Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #14 - 23 September 2006, 19:09:00
Ok, je vais chercher également car je n'ai bien sûr pas cette librairie. Je n'ai recherché que sur le forum anglophone,
mais la fonction recherche bugge trop souvent chez moi et le navigateur ne peut pas afficher toutes les réponses, je
n'ai trouvé aucun post mantionnant ce souci.
Je pense que ce sera même que la librairie manquante sera assez dure à trouver .

Merci Brainstorm, je vais essayer au moin de trouver MSVCRT.LIB et tester.

------------

no matter.

Offline brainstorm

  • Legend
  • ******
  • Posts: 2694
  • Karma: 0
Reply #15 - 23 September 2006, 19:28:16
Pour info, j'ai lancé le mess d'erreur sous google, et y'a pas mal de réponse mais faut faire le tri car les applis n'ont
rien à voir. Du de faire le recoupement. Si je trouve, je te le dis ! ;)



Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #16 - 23 September 2006, 20:33:03
J'ai essayé avec msvcrt.lib et même msvcirt.lib enfin bref çà ne marche pas, ce n'est pas çà, à moins que j'ai mal linké
mais Crimson me retourne une erreur de conflit avec "libc", donc çà semble être bien pris en compte, j'ai essayé en
excluant "libc" mais sans succès. Je continue à chercher sur google...

------------

no matter.

Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #17 - 23 September 2006, 21:06:23
Quote
link orbitersdk.lib orbiter.lib cvel.lib

Bref, il fallait prendre le linker par la main pour l'amener à l'école ^^
Bon, j'ai d'autres problème actuellement (libcimt.lib/conflits entre librairies etc) mais je pense que je vais y arriver.

Thanks to Urwumpe!



Message modifié ( 23-09-2006 21:19 )

------------

no matter.

Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #18 - 23 September 2006, 21:15:55
Héhé, je renais:
Quote
---------- Capture Output ----------
> "D:\C++\bin\cl.exe" @orbiter.rsp soyuztma.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (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.cpp
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (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.:ptdr:



Message modifié ( 23-09-2006 21:16 )

------------

no matter.

Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #19 - 23 September 2006, 21:31:07
Quote
Si ç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?

------------

no matter.

Offline brainstorm

  • Legend
  • ******
  • Posts: 2694
  • Karma: 0
Reply #20 - 23 September 2006, 22:25:47
T génial ! ;) Ca va m'aider peut être un de ces quatre !! ;)
Par contre, pour ma part, j'ai du ajouter : /nodefaultlib:LIBCMT.LIB dans orbiter.rsp



Offline brainstorm

  • Legend
  • ******
  • Posts: 2694
  • Karma: 0
Reply #21 - 23 September 2006, 23:10:41
Quote
no matter a écrit:
Quote
Si ç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?

Pas de soucis, j'avais loupé ce post ! ;) Vla le code une fois modifié ! ;)

Quote
#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 );
}
*/
}

Bon, ça fait un peu barbare mais ça marche !! :) J'ai mis en gras ce que j'ai modifié



Offline korben62

  • Hero Member
  • *****
  • Posts: 561
  • Karma: 0
Reply #22 - 24 September 2006, 00:52:59
Désolé probléme de famille, j'ai pas pu suivre le tread
mais bon si crimson te l'a compilé avec 0 erreur, c'est qu'il ne doit pas y en avoir beaucoup.
Mais c'est possible, cela m'est deja arrivé.




Offline no matter

  • Legend
  • ******
  • Posts: 2826
  • Karma: 1
Reply #23 - 24 September 2006, 15:25:12
Oki, merci Brainstorm ;)

Quote
Désolé probléme de famille

Korben, j'espère que tout vas bien.



Message modifié ( 24-09-2006 15:27 )

« Last Edit: 24 September 2006, 15:25:12 by no matter »
------------

no matter.