Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4212 in orxonox.OLD


Ignore:
Timestamp:
May 18, 2005, 2:06:17 AM (19 years ago)
Author:
patrick
Message:

orxonox/branches/md2_model: fixed some segfaults, model doesnt get rendered correctly yet

Location:
orxonox/branches/md2_loader/src
Files:
3 edited

Legend:

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

    r4211 r4212  
    511511 
    512512  this->textureID = 0;
    513   this->scaleFactor = 1.0f;
    514 
    515   //this->setAnim(0);
     513  this->scaleFactor = 0.1f;
     514
     515  this->setAnim(0);
    516516}
    517517
     
    568568  for(int i = 0; i < this->numFrames; ++i)
    569569    {
     570      /*
     571        faster but evt. buggy
    570572      frame = (sFrame*)(buffer + header.frameSize * i);
    571573      pVertex = this->pVertices + this->numVertices  * i;
    572574      pNormals = this->pLightNormals + this->numVertices * i;
     575      */
     576      frame = (sFrame *)&buffer[header.frameSize * i];
     577      pVertex = &this->pVertices[this->numVertices * i];
     578      pNormals = &this->pLightNormals[this->numVertices * i];
    573579
    574580      for(int j = 0; j < this->numVertices; ++j)
     
    623629
    624630  currVec = &this->pVertices[this->numVertices * this->animationState.currentFrame];
    625   nextVec = &this->pVertices[this->numVertices * this->animationState.currentFrame];
    626 
     631  nextVec = &this->pVertices[this->numVertices * this->animationState.nextFrame];
     632
     633  //printf("currVec: %f, %f, %f\n", currVec[0][0], currVec[0][1], currVec[0][2]);
     634  //printf("nextVec: %f, %f, %f\n", nextVec[0], nextVec[1], nextVec[2]);
     635 
    627636  for(int i = 0; i < this->numFrames; ++i)
    628637    {
     
    697706     
    698707  this->processLighting();
    699   //this->interpolate(verticesList);
     708  this->interpolate(verticesList);
    700709  this->material->select();
    701710
  • orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.h

    r4188 r4212  
    193193  void tick(float dtS);
    194194
     195  void animate(float time); 
    195196private:
    196   void animate(float time); 
     197
    197198  void processLighting();
    198199  void interpolate(sVec3D* verticesList);
  • orxonox/branches/md2_loader/src/world_entities/test_entity.cc

    r4191 r4212  
    3333  this->md2Model2->loadModel("../data/models/tris.md2");
    3434  this->md2Model2->loadSkin("../data/models/tris.pcx");
     35  this->md2Model2->animate(0);
    3536}
    3637
Note: See TracChangeset for help on using the changeset viewer.