Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2005, 5:10:32 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: vertex_array_model implemented

File:
1 edited

Legend:

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

    r6009 r6010  
    11/*!
    2   \file vertex_list_model.h
    3   \brief Contains the VertexListModel Class that handles 3D-Models rendered out of VertexArrays
    4 */
     2 * @file vertex_array_model.h
     3 * @brief Contains the VertexArrayModel Class that handles 3D-Models rendered out of VertexArrays
     4 */
    55
    6 #ifndef _MODEL_H
    7 #define _MODEL_H
     6#ifndef _VERTEX_ARRAY_MODEL_H
     7#define _VERTEX_ARRAY_MODEL_H
    88
    99#include "abstract_model.h"
     
    1414#include <list>
    1515
    16 // FORWARD DECLARATION //
    17 template<class T> class tArray;
     16/* Forward Declaration */
     17class Material;
     18
    1819
    1920/////////////
     
    2122/////////////
    2223//! Class that handles 3D-Models. it can also read them in and display them.
    23 class Model : public AbstractModel
     24class VertexArrayModel : public AbstractModel
    2425{
    2526 public:
    26   Model();
    27   virtual ~Model();
     27  VertexArrayModel();
     28  virtual ~VertexArrayModel();
    2829
    2930  void draw() const;
    3031
    31   Material* addMaterial(Material* material);
    32   Material* addMaterial(const char* materialName);
     32  void addVertex(float x, float y, float z);
    3333
    34   bool addVertex(float x, float y, float z);
     34  void addNormal(float x, float y, float z);
    3535
    36   bool addVertexNormal(float x, float y, float z);
     36  void addTexCoor(float u, float v);
    3737
    38   bool addVertexTexture(float u, float v);
    39 
    40   bool addFace(int faceElemCount, VERTEX_FORMAT type, ...);
    41 
    42   bool addGroup(const char* groupString);
    43 
    44   bool setMaterial(Material* mtl);
     38  void addIndice(GLubyte indice);
    4539
    4640  void finalize();
    4741
    4842
     43  void cubeModel();
     44
    4945 private:
    50   bool buildTriangleList();
    51 
    52   bool addGLElement(ModelFaceElement* elem);
    53 
    5446  bool importToVertexArray();
    5547
    56   bool deleteArrays();
    5748  bool cleanup();
    5849
     
    6253  tArray<GLfloat>            vertices;        //!< The Array that handles the Vertices.
    6354  tArray<GLfloat>            normals;         //!< The Array that handles the Normals.
    64   tArray<GLfloat>            textures;        //!< The Array that handles the VertexTextureCoordinates.
     55  tArray<GLfloat>            texCoords;       //!< The Array that handles the VertexTextureCoordinates.
    6556
    66   tArray<GLfloat>            indices;         //!< The Array that tells us what Vertex is connected to which other one.
    67 
    68   std::list<ModelMaterial*>  materialList;    //!< A list for all the Materials in this Model
     57  tArray<GLubyte>            indices;         //!< The Array that tells us what Vertex is connected to which other one.
    6958};
    7059
Note: See TracChangeset for help on using the changeset viewer.