Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3398 in orxonox.OLD for orxonox/trunk/src/importer/model.h


Ignore:
Timestamp:
Feb 6, 2005, 11:02:45 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: Made the Model-class externalizable
meaning:

  1. There is now a possibility to initialize a Model without adding default vertex info
  2. Then you can add your vertices
  3. Then you can add any other model-specific stuff, like normals/texcoords/Faces
  4. For the time-being Materials have to be handled externaly, but this will change.

PATRICK: if you read this, you should be able, to implement this into the loading-screen, look at src/importer/framework.cc→main and then the big table.

with this aproach the Developer is farther away from OpenGL and closer to logic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/importer/model.h

    r3396 r3398  
    1515using namespace std;
    1616
    17 
     17enum PRIMITIVE {PLANE, CUBE, SPHERE, CYLINDER};
    1818
    1919//! Class that handles 3D-Models. it can also read them in and display them.
     
    2222 public:
    2323  Model(void);
     24  Model(PRIMITIVE type);
     25  Model(char* modelName);
    2426  virtual ~Model(void);
     27
     28  void setName(const char* name);
    2529 
    2630  void draw(void) const;
     
    3034
    3135 protected:
    32   char* name;            //!< This is the name of the Model;
     36  char* name;            //!< This is the name of the Model.
     37  bool finalized;        //!< Sets the Object to be finalized.
     38 
    3339  //! This is the placeholder of one Vertex beloning to a Face.
    3440  struct FaceElement
     
    94100  bool cleanupFaceElement(FaceElement* faceElem);
    95101
     102 public:
    96103  bool addGroup (char* groupString);
    97104  bool addVertex (char* vertexString);
     
    100107  bool addVertexTexture (char* vTextureString);
    101108  bool addUseMtl (char* mtlString);
     109  void finalize(void);
    102110
     111 protected:
    103112  bool importToGL (void);
    104113  bool addGLElement (FaceElement* elem);
Note: See TracChangeset for help on using the changeset viewer.