Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4461 in orxonox.OLD


Ignore:
Timestamp:
Jun 2, 2005, 12:32:34 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: documented the md2 class correctly now

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

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/md2Model.cc

    r4460 r4461  
    7575 ********************************************************************************/
    7676
    77 /*
     77/**
    7878  \brief simple constructor initializing all variables
    7979*/
     
    8787}
    8888
    89 /*
     89/**
    9090  \brief simple destructor, dereferencing all variables
    9191
     
    122122
    123123
    124 /*
     124/**
    125125  \brief sets the animation type
    126126  \param type: animation type
     
    146146
    147147
    148 /*
     148/**
    149149  \brief sets the time in seconds passed since the last tick
    150150  \param time: in sec
     
    156156
    157157
    158 /*
     158/**
    159159  \brief draws the model: interface for all other classes out in the world
    160160*/
     
    172172
    173173
    174 /*
     174/**
    175175  \brief this is an internal function to render this special frame selected by animate()
    176176*/
     
    216216
    217217
    218 /*
     218/**
    219219  \brief animates the current model
    220220
     
    243243
    244244
    245 /*
     245/**
    246246  \brief this is how id is precessing their lightning
    247247
     
    253253}
    254254
    255 /*
     255
     256/**
    256257  \brief prints out debug informations
    257258*/
     
    273274 ********************************************************************************/
    274275
    275 /*
     276/**
    276277  \brief simple constructor
    277278*/
     
    293294
    294295
    295 /*
     296/**
    296297  \brief simple destructor
    297298
     
    312313
    313314
    314 /*
     315/**
    315316  \brief this will load the whole model data (vertices, opengl command list, ...)
    316   \param fileName to the model file
     317  \param fileName: the name of the model file
    317318  \return true if success
    318319*/
     
    382383
    383384
    384 /*
     385/**
    385386  \brief loads the skin/material stuff
    386   \param fileName of the skin file
     387  \param fileName: name of the skin file
    387388  \return true if success
    388389*/
  • orxonox/trunk/src/lib/graphics/importer/md2Model.h

    r4459 r4461  
    3434#define MD2_MAX_FRAMESIZE               (MD2_MAX_VERTICES * 4 + 128)             //!< maximal framesize
    3535
    36 #define NUM_VERTEX_NORMALS              162                                      //!<
    37 #define SHADEDOT_QUANT                  16
     36#define NUM_VERTEX_NORMALS              162                                      //!< number of vertex normals
     37#define SHADEDOT_QUANT                  16                                       //!< shade dot quantity - no idea what it is
    3838
    3939//! This stores the speed of the animation between each key frame - currently conflicting with the animation framework
    40 #define kAnimationSpeed                 12.0f
     40#define kAnimationSpeed                 12.0f                                    //!< animation speed
    4141
    4242//! This holds the header information that is read in at the beginning of the file: id software definition
     
    113113
    114114 public:
    115   int numFrames;
    116   int numVertices;
    117   int numTriangles;
    118   int numGLCommands;
    119   char* fileName;
    120   char* skinFileName;
    121   MD2Header* header;
     115  int                numFrames;             //!< number of frames   
     116  int                numVertices;           //!< number of vertices
     117  int                numTriangles;          //!< number of triangles
     118  int                numGLCommands;         //!< number of gl commands in the glList (tells how to draw)
     119  char*              fileName;              //!< file name of the model File
     120  char*              skinFileName;          //!< file name of the skin file
     121  MD2Header*         header;                //!< the header file
    122122
    123   sVec3D* pVertices;
    124   int* pGLCommands;
    125   int* pLightNormals;
    126   glCommandVertex* pGLCommands2;
     123  sVec3D*            pVertices;             //!< pointer to the vertices data block
     124  int*               pGLCommands;           //!< pointer to the gllist data block
     125  int*               pLightNormals;         //!< pointer to the light normals
    127126
    128   Material* material;
    129   float scaleFactor;
     127  Material*          material;              //!< pointer to the material
     128  float              scaleFactor;           //!< the scale factor of the model, (global)
    130129};
    131130
     
    138137  virtual ~MD2Model();
    139138   
    140   void drawFrame(int frame);
    141139  void draw();
    142   void draw2();
    143140 
    144141  void setAnim(int type);
     142  /**
     143     \brief scales the current model
     144     \param scaleFactor: the factor [0..1] to use for scaling
     145  */
    145146  void scaleModel(float scaleFactor) { this->scaleFactor = scaleFactor;}
    146147
     
    157158 public:
    158159  /* these variables are static, because they are all the same for every model */
    159   static sVec3D anorms[NUM_VERTEX_NORMALS];
    160   static float anormsDots[SHADEDOT_QUANT][256];
    161   static sAnim animationList[21];
     160  static sVec3D       anorms[NUM_VERTEX_NORMALS];       //!< the anormals
     161  static float        anormsDots[SHADEDOT_QUANT][256];  //!< the anormals dot products
     162  static sAnim        animationList[21];                //!< the anomation list
    162163
    163164 private:
    164   MD2Data* data;
     165  MD2Data*            data;                             //!< the md2 data pointer
    165166
    166   float scaleFactor;
    167   sAnimState animationState;
     167  float               scaleFactor;                      //!< the scale factor (individual)
     168  sAnimState          animationState;                   //!< animation state of the model
    168169};
    169170
Note: See TracChangeset for help on using the changeset viewer.