Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4804 in orxonox.OLD


Ignore:
Timestamp:
Jul 7, 2005, 11:17:56 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: introduced the modelInfo struct which contains refereces to all data a model needs, this will serve as an interface

Location:
orxonox/trunk/src/lib/graphics/importer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/abstract_model.h

    r4802 r4804  
    118118
    119119
     120typedef struct
     121{
     122  unsigned int     numVertices;
     123  unsigned int     numTriangles;
     124  unsigned int     numNormals;
     125  unsigned int     numTexCoor;
     126
     127  const float*     pVertices;
     128  sTriangleExt*    pTriangles;
     129  const float*     pNormals;
     130  const float*     pTexCoor;
     131
     132} modelInfo;
     133
     134
     135
    120136//! This class defines the basic components of a model
    121137class AbstractModel : public BaseObject {
     
    129145
    130146
     147
    131148#endif /* _ABSTRACT_MODEL_H */
  • orxonox/trunk/src/lib/graphics/importer/model.cc

    r4803 r4804  
    150150  this->triangleCount = 0;
    151151  this->triangles = NULL;
     152  this->pModelInfo = NULL;
    152153
    153154  this->scaleFactor = 1;
     
    212213    //this->deleteArrays();
    213214  this->cleanup();
     215
     216  /* load the ModelInfo */
     217  this->pModelInfo = new modelInfo;
     218  this->pModelInfo->numVertices = this->vertexCount;
     219  this->pModelInfo->pVertices = this->vertices->getArray();
     220  this->pModelInfo->numTriangles = this->triangleCount;
     221  this->pModelInfo->pTriangles = this->triangles;
     222  this->pModelInfo->numNormals = this->normalCount;
     223  this->pModelInfo->pNormals = this->normals->getArray();
     224  this->pModelInfo->numTexCoor = this->vTexture->getCount();
     225  this->pModelInfo->pTexCoor = this->vTexture->getArray();
    214226
    215227  this->finalized = true;
  • orxonox/trunk/src/lib/graphics/importer/model.h

    r4798 r4804  
    128128  inline unsigned int getFaceCount() const { return this->faceCount; };
    129129
     130  inline modelInfo* getModelInfo() const { return this->pModelInfo; }
    130131
    131132  Material* addMaterial(Material* material);
     
    180181  Array<GLfloat>*  vTexture;        //!< The Array that handles the VertexTextureCoordinates.
    181182  sTriangleExt*    triangles;       //!< The Array of triangles in the abstract_model.h style
     183  modelInfo*       pModelInfo;      //!< Reference to the modelInfo defined in abstract_model.h
    182184
    183185  ModelGroup*      firstGroup;      //!< The first of all groups.
Note: See TracChangeset for help on using the changeset viewer.