Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5709 in orxonox.OLD for branches/collision_detection/src


Ignore:
Timestamp:
Nov 22, 2005, 4:03:53 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: new ModelInfo-member in AbstractModel

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

Legend:

Unmodified
Added
Removed
  • branches/collision_detection/src/lib/graphics/importer/abstract_model.h

    r5672 r5709  
    128128
    129129  public:
    130     AbstractModel() {}
     130    AbstractModel() {
     131      this->pModelInfo.numVertices = 0;
     132      this->pModelInfo.numTriangles = 0;
     133      this->pModelInfo.numNormals = 0;
     134      this->pModelInfo.numTexCoor = 0;
     135
     136      this->pModelInfo.pVertices = NULL;
     137      this->pModelInfo.pTriangles = NULL;
     138      this->pModelInfo.pNormals = NULL;
     139      this->pModelInfo.pTexCoor = NULL;
     140    }
    131141    virtual ~AbstractModel() {}
    132142
    133     inline const modelInfo* getModelInfo() const { return this->pModelInfo; }
     143    inline const modelInfo* getModelInfo() const { return &this->pModelInfo; }
    134144
    135145
    136146  protected:
    137     modelInfo*     pModelInfo;      //!< Reference to the modelInfo
     147    modelInfo      pModelInfo;      //!< Reference to the modelInfo
    138148};
    139149
  • branches/collision_detection/src/lib/graphics/importer/model.cc

    r5676 r5709  
    158158  this->triangleCount = 0;
    159159  this->triangles = NULL;
    160   this->pModelInfo = NULL;
    161160
    162161  this->scaleFactor = 1;
     
    208207  delete tmpIt;
    209208  delete materialList;
    210   delete this->pModelInfo;
    211209}
    212210
     
    226224
    227225  /* load the ModelInfo */
    228   this->pModelInfo = new modelInfo;
    229   this->pModelInfo->numVertices = this->vertexCount;
    230   this->pModelInfo->pVertices = this->vertices->getArray();
    231   this->pModelInfo->numTriangles = this->triangleCount;
    232   this->pModelInfo->pTriangles = this->triangles;
    233   this->pModelInfo->numNormals = this->normalCount;
    234   this->pModelInfo->pNormals = this->normals->getArray();
    235   this->pModelInfo->numTexCoor = this->vTexture->getCount();
    236   this->pModelInfo->pTexCoor = this->vTexture->getArray();
     226  this->pModelInfo.numVertices = this->vertexCount;
     227  this->pModelInfo.pVertices = this->vertices->getArray();
     228  this->pModelInfo.numTriangles = this->triangleCount;
     229  this->pModelInfo.pTriangles = this->triangles;
     230  this->pModelInfo.numNormals = this->normalCount;
     231  this->pModelInfo.pNormals = this->normals->getArray();
     232  this->pModelInfo.numTexCoor = this->vTexture->getCount();
     233  this->pModelInfo.pTexCoor = this->vTexture->getArray();
    237234
    238235  this->finalized = true;
     
    929926  PRINTF(3)("got %i triangles, %i vertices\n", this->triangleCount, this->vertexCount);
    930927
    931  
     928
    932929  /* write MODELINFO structure */
    933930
Note: See TracChangeset for help on using the changeset viewer.