Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10714 in orxonox.OLD for branches/presentation/src/lib/graphics


Ignore:
Timestamp:
Jun 18, 2007, 3:19:15 PM (17 years ago)
Author:
nicolasc
Message:

initial upload form mouse aiming in VS

Location:
branches/presentation/src/lib/graphics/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/graphics/importer/static_model.cc

    r10551 r10714  
    8282void StaticModel::finalize()
    8383{
     84  this->extractMountPoints();
    8485  data->finalize();
    8586  this->updateBase();
     
    100101void StaticModel::extractMountPoints()
    101102{
    102 
     103  printf("extracting MP...");
    103104  // go through all groups and check if they are mounts
    104   std::vector<StaticModelData::Group>::const_iterator groupIt = this->data->getGroups().begin();
    105   for( ; groupIt != this->data->getGroups().end(); groupIt++)
     105  std::vector<StaticModelData::Group>::iterator groupIt = this->data->getGroups().begin();
     106  for( ; groupIt != this->data->getGroups().end();)
    106107  {
    107108    //PRINTF(0)("Found a MountPoint: %s\n", groupName.c_str());
     
    112113
    113114    // check if the name has a "MP" prefix or else it won't work
    114     if( groupName.find("MP.", 0) == std::string::npos)
     115    if( groupName.find("MP.", 0) == std::string::npos){
     116      groupIt++;
     117//       printf("Found MP:  ");
    115118      continue;
    116 
     119    }
    117120
    118121    PRINTF(5)("Found a MountPoint: %s\n", groupName.c_str());
     
    125128      PRINTF(4)("the face count of %s is wrong, perhaps you missnamed this object or used the wrong mount point object (got %i faces)\n",
    126129                groupName.c_str(), (*groupIt)._faces.size());
     130//       printf("wrong number of faces\n\n");
     131      groupIt++;
     132      continue;
    127133    }
    128134
     
    137143    }
    138144
     145//     printf("confirmed  ");
    139146
    140147    Vector center;
     
    143150    Vector zAxis;
    144151    // now process all points
     152//     printf("entering loop: ");
    145153    for( int i = 0; i < 3; i++)
    146154    {
     155//       printf("%i ", i);
    147156      // convert the float vertices to vectors
    148157      Vector a( this->data->getVertices()[triangle[i]._elements[0].vertexNumber * 3],
    149158                this->data->getVertices()[triangle[i]._elements[0].vertexNumber * 3 + 1],
    150159                this->data->getVertices()[triangle[i]._elements[0].vertexNumber * 3 + 2]);
     160//       printf("a");
    151161      Vector b( this->data->getVertices()[triangle[i]._elements[1].vertexNumber * 3],
    152162                this->data->getVertices()[triangle[i]._elements[1].vertexNumber * 3 + 1],
    153163                this->data->getVertices()[triangle[i]._elements[1].vertexNumber * 3 + 2]);
     164//       printf("b");
    154165      Vector c( this->data->getVertices()[triangle[i]._elements[2].vertexNumber * 3],
    155166                this->data->getVertices()[triangle[i]._elements[2].vertexNumber * 3 + 1],
    156167                this->data->getVertices()[triangle[i]._elements[2].vertexNumber * 3 + 2]);
     168//       printf("c  ");
    157169
    158170      Vector ab = a - b;
     
    208220    }
    209221
     222//     printf("adding MP\n");
    210223    // now add the mount point
    211224     this->addMountPoint( zAxis, yAxis, center, groupName);
     225
     226//     printf("removing item...");
     227    // remove the group from the model list (mount points do not need to be drawn)
     228//      std::vector<StaticModelData::Group>::iterator tmpIt =  groupIt;
     229     groupIt++;
     230//     printf("   removing...");
     231//      this->data->getGroups().erase(tmpIt);
     232//     printf("   REMOVED\n");
    212233  }
     234//   printf("done\n");
    213235}
    214236
  • branches/presentation/src/lib/graphics/importer/static_model_data.h

    r10161 r10714  
    129129  ///! HACK SOLUTION sTriangleExt should be const in the modelInfo.
    130130  sTriangleExt* getTrianglesExt() { return &this->triangles[0]; };
    131   const std::vector<Group>& getGroups() { return this->_modelGroups; }
     131  std::vector<Group>& getGroups() { return this->_modelGroups; }
    132132
    133133  float getScaleFactor() const  { return scaleFactor; }
Note: See TracChangeset for help on using the changeset viewer.