Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3063 in orxonox.OLD for orxonox/trunk/importer/object.h


Ignore:
Timestamp:
Dec 3, 2004, 1:59:29 PM (21 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: Changed importToGL-process. now the import process startts after the end of reading the File.
Group-specific arrays have been reverted to obj-file-specific.
other minor bug-fixes.

THIS VERSION IS NOT COMPLETED. will do this in the next few releases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/object.h

    r2934 r3063  
    1616using namespace std;
    1717
    18 extern int verbose; //!< fill be removed and added again as a verbose-class
     18extern int verbose; //!< Will be removed and added again as a verbose-class.
    1919
    2020
    21 struct FaceElement
    22 {
    23   char value[20];
    24   FaceElement* next;
    25 };
    2621
    2722//! Class that handles 3D-Objects. it can also read them in and display them.
     
    3732  bool initialize (void);
    3833  bool finalize(void);
    39   void draw (void);
    40   void draw (int groupNumber);
    41   void draw (char* groupName);
    42   int getGroupCount();
     34  void draw (void) const;
     35  void draw (int groupNumber) const;
     36  void draw (char* groupName) const;
     37  int getGroupCount() const;
    4338
    4439 private:
     40  struct FaceElement
     41  {
     42    char* value;
     43    FaceElement* next;
     44  };
     45
     46  //! Face
     47  struct Face
     48  {
     49    int vertexCount;
     50
     51    FaceElement* firstElem;
     52
     53    char* material;
     54
     55    Face* next;
     56  };
     57
    4558  //! Group to handle multiple Objects per obj-file
    4659  struct Group
     
    4962
    5063    GLuint listNumber;
    51     Array* vertices;
    52     int verticesCount;
    53     Array* colors;
    54     Array* normals;
    55     Array* vTexture;
     64    Face* firstFace;
     65    Face* currentFace;
    5666    int faceMode;
    5767    int faceCount;
    5868
    59     int firstVertex;
    60     int firstNormal;
    61     int firstVertexTexture;
     69    Group* next;
     70  };
    6271
    63     Group* nextGroup;
    64   };
     72
     73  Array* vertices;
     74  int verticesCount;
     75  Array* colors;
     76  Array* normals;
     77  Array* vTexture;
     78
    6579 
    6680  Group* firstGroup; //!< the first of all groups.
    6781  Group* currentGroup; //!< the currentGroup. this is the one we will work with.
    6882  int groupCount;
    69 
    70   bool readingVertices;
    7183
    7284  char* objFileName;
     
    7688  float scaleFactor;
    7789
     90  char* objPath;
    7891  ifstream* OBJ_FILE;
    7992  ifstream* MTL_FILE;
     
    8194  bool initGroup(Group* group);
    8295  bool finalizeGroup (Group* group);
    83   bool cleanupGroup(Group* group);
    8496
    8597
     
    96108  bool readUseMtl (char* mtlString);
    97109
     110  bool initFace (Face* face);
     111  bool importToGL (void);
    98112  bool addGLElement (char* elementString);
    99113
Note: See TracChangeset for help on using the changeset viewer.