Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6207 in orxonox.OLD for branches/christmas_branche/src/lib


Ignore:
Timestamp:
Dec 21, 2005, 2:31:24 AM (19 years ago)
Author:
patrick
Message:

christmas: test_entity is now also loadable and heavily used in the christmas branche

Location:
branches/christmas_branche/src/lib/graphics/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/christmas_branche/src/lib/graphics/importer/md2Model.cc

    r6205 r6207  
    3333  #include "anormtab.h"
    3434};
    35 
    36 //! again one of these strange id software parts
    37 static float *shadeDots = MD2Model::anormsDots[0];
    38 
    39 
    40 static sVec3D verticesList[MD2_MAX_VERTICES];
    4135
    4236
     
    9084  this->scaleFactor = this->data->scaleFactor;
    9185
     86  shadeDots = MD2Model::anormsDots[0];
    9287  /* set the animation stat mannualy */
    9388  this->animationState.type = STAND;
     
    111106/**
    112107 *  initializes an array of vert with the current frame scaled vertices
    113  * @param verticesList: the list of vertices to interpolate between
     108 * @param this->verticesList: the list of vertices to interpolate between
    114109
    115110   we won't use the pVertices array directly, since its much easier and we need
    116111   saving of data anyway
    117112*/
    118 void MD2Model::interpolate(/*sVec3D* verticesList*/)
     113void MD2Model::interpolate(/*sVec3D* this->verticesList*/)
    119114{
    120115  sVec3D* currVec;
     
    126121  for( int i = 0; i < this->data->numVertices; ++i)
    127122    {
    128       verticesList[i][0] = currVec[i][0] + this->animationState.interpolationState * (nextVec[i][0] - currVec[i][0]);
    129       verticesList[i][1] = currVec[i][1] + this->animationState.interpolationState * (nextVec[i][1] - currVec[i][1]);
    130       verticesList[i][2] = currVec[i][2] + this->animationState.interpolationState * (nextVec[i][2] - currVec[i][2]);
     123      this->verticesList[i][0] = currVec[i][0] + this->animationState.interpolationState * (nextVec[i][0] - currVec[i][0]);
     124      this->verticesList[i][1] = currVec[i][1] + this->animationState.interpolationState * (nextVec[i][1] - currVec[i][1]);
     125      this->verticesList[i][2] = currVec[i][2] + this->animationState.interpolationState * (nextVec[i][2] - currVec[i][2]);
    131126    }
    132127}
     
    172167  this->animate(time);
    173168  this->processLighting();
    174   this->interpolate(/*verticesList*/);
     169  this->interpolate(/*this->verticesList*/);
    175170}
    176171
     
    185180  glPushMatrix();
    186181  this->renderFrame();
    187 //  renderFrameTriangles();
     182  // renderFrameTriangles();
    188183  glPopMatrix();
    189184}
     
    222217          glTexCoord2f( ((float *)pCommands)[0], ((float *)pCommands)[1] );
    223218          glNormal3fv(anorms[this->data->pLightNormals[pCommands[2]]]);
    224           glVertex3fv(verticesList[pCommands[2]]);
     219          glVertex3fv(this->verticesList[pCommands[2]]);
    225220        }
    226221      glEnd();
     
    234229void MD2Model::renderFrameTriangles() const
    235230{
    236   //static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */
     231  //static sVec3D this->verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */
    237232  int* pCommands = this->data->pGLCommands;
    238233  /* some face culling stuff */
     
    243238//
    244239//   this->processLighting();
    245 //   this->interpolate(/*verticesList*/);
     240//   this->interpolate(/*this->verticesList*/);
    246241  this->data->material->select();
    247242
  • branches/christmas_branche/src/lib/graphics/importer/md2Model.h

    r6199 r6207  
    241241  static float        anormsDots[SHADEDOT_QUANT][256];  //!< the anormals dot products
    242242  static sAnim        animationList[21];                //!< the anomation list
     243   //! again one of these strange id software parts
     244  float*              shadeDots;
    243245
    244246  MD2Data*            data;                             //!< the md2 data pointer
     
    247249  float               scaleFactor;                      //!< the scale factor (individual)
    248250  sAnimState          animationState;                   //!< animation state of the model
     251  sVec3D              verticesList[MD2_MAX_VERTICES];   //!< place to temp sav the vert
    249252};
    250253
Note: See TracChangeset for help on using the changeset viewer.