Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8592 in orxonox.OLD for branches/bsp_model/src/lib/graphics


Ignore:
Timestamp:
Jun 19, 2006, 11:28:27 PM (18 years ago)
Author:
patrick
Message:

bsp: loading the all of the md3 models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc

    r8591 r8592  
    7979  void MD3Model::autoAssemblePlayerModel(std::string filename, float scaling)
    8080  {
     81    // loading the config file
    8182    std::string cfgName(filename + "/animation.cfg");
    8283    this->config = (MD3AnimationCfg*)ResourceManager::getInstance()->load(cfgName, MD3_CONFIG, RP_GAME);
    8384
    84 
    85     //first load the torso
    86     std::string name(filename + "/upper.md3");
    87     this->md3Data = (MD3Data*)ResourceManager::getInstance()->load(name, MD3, RP_GAME, name, scaling);
    88 
    89 
     85    //first load the torso or the upper part
     86    std::string nameUpper(filename + "/upper.md3");
     87    if( (this->md3Data = (MD3Data*)ResourceManager::getInstance()->load(nameUpper, MD3, RP_GAME, nameUpper, scaling)) == NULL)
     88    {
     89      std::string nameTorso(filename + "/torso.md3");
     90      this->md3Data = (MD3Data*)ResourceManager::getInstance()->load(nameTorso, MD3, RP_GAME, nameTorso, scaling);
     91    }
     92
     93    if( this->md3Data == NULL)
     94    {
     95      PRINTF(1)("Problems loading the MD3Model. Abording\n");
     96      return;
     97    }
    9098
    9199    // load lower
     100    std::string nameLower(filename + "/lower.md3");
     101    MD3Data* lower = (MD3Data*)ResourceManager::getInstance()->load(nameLower, MD3, RP_GAME, nameLower, scaling);
     102    if( lower != NULL)
     103    {
     104      PRINTF(0)("Loaded the %s model\n", nameLower.c_str());
     105//       this->md3Data->addLinkedModel(0, lower);
     106    }
     107
     108
     109    // load head
     110    std::string nameHead(filename + "/head.md3");
     111    MD3Data* head = (MD3Data*)ResourceManager::getInstance()->load(nameHead, MD3, RP_GAME, nameLower, scaling);
     112    if( lower != NULL)
     113    {
     114      PRINTF(0)("Loaded the %s model\n", nameHead.c_str());
     115//       this->md3Data->addLinkedModel(0, head);
     116    }
     117
     118
    92119
    93120
Note: See TracChangeset for help on using the changeset viewer.