Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7068 in orxonox.OLD for trunk/src/lib/graphics/importer


Ignore:
Timestamp:
Feb 7, 2006, 1:57:54 PM (19 years ago)
Author:
patrick
Message:

trunk: the modelinfo of md2 models is now written too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/md2Model.cc

    r7059 r7068  
    9191
    9292  this->debug();
    93 }
     93
     94    //write the modelinfo information
     95  this->pModelInfo.numVertices = this->data->numVertices;
     96  this->pModelInfo.numTriangles = this->data->numTriangles;
     97  this->pModelInfo.numNormals = 0;
     98  this->pModelInfo.numTexCoor = this->data->numTexCoor;
     99  this->pModelInfo.pVertices = (float*)this->data->pVertices;
     100  this->pModelInfo.pNormals = NULL;
     101  this->pModelInfo.pTexCoor = (float*)this->data->pTexCoor;
     102
     103  // triangle conversion
     104  this->pModelInfo.pTriangles = new sTriangleExt[this->data->numTriangles];
     105  for( int i = 0; i < this->data->numTriangles; i++)
     106  {
     107    this->pModelInfo.pTriangles[i].indexToVertices[0] = this->data->pTriangles[i].indexToVertices[0];
     108    this->pModelInfo.pTriangles[i].indexToVertices[1] = this->data->pTriangles[i].indexToVertices[1];
     109    this->pModelInfo.pTriangles[i].indexToVertices[2] = this->data->pTriangles[i].indexToVertices[2];
     110
     111    this->pModelInfo.pTriangles[i].indexToTexCoor[0] = this->data->pTriangles[i].indexToTexCoor[0];
     112    this->pModelInfo.pTriangles[i].indexToTexCoor[1] = this->data->pTriangles[i].indexToTexCoor[1];
     113    this->pModelInfo.pTriangles[i].indexToTexCoor[2] = this->data->pTriangles[i].indexToTexCoor[2];
     114  }
     115}
     116
    94117
    95118/**
Note: See TracChangeset for help on using the changeset viewer.