Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6169 in orxonox.OLD for branches/christmas_branche/src/lib/graphics


Ignore:
Timestamp:
Dec 20, 2005, 12:22:17 AM (18 years ago)
Author:
patrick
Message:

christmas: model loading progress

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

Legend:

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

    r6022 r6169  
    156156{
    157157  this->animationState.localTime += time;
     158
     159  if( likely(this->animationState.localTime > 0.0))
     160    this->animate();
     161
     162  static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */
     163  this->processLighting();
     164  this->interpolate(verticesList);
    158165}
    159166
     
    164171 * FIXME
    165172 */
    166 void MD2Model::draw()
    167 {
    168   if( likely(this->animationState.localTime > 0.0))
    169     this->animate();
    170 
    171   glPushMatrix();
     173void MD2Model::draw() const
     174{
     175//   glPushMatrix();
    172176
    173177  this->renderFrame();
    174178
    175   glPopMatrix();
     179//   glPopMatrix();
    176180}
    177181
     
    180184  \brief this is an internal function to render this special frame selected by animate()
    181185*/
    182 void MD2Model::renderFrame()
     186void MD2Model::renderFrame() const
    183187{
    184188  static sVec3D verticesList[MD2_MAX_VERTICES]; /* performance: created only once in a lifetime */
     
    191195  glCullFace(GL_BACK);
    192196
    193   this->processLighting();
    194   this->interpolate(verticesList);
     197
    195198  this->data->material->select();
    196199
     
    406409        }
    407410    }
     411    PRINTF(4)("Finished loading the md2 file\n");
    408412
    409413  delete [] buffer;
  • branches/christmas_branche/src/lib/graphics/importer/md2Model.h

    r6022 r6169  
    143143  virtual ~MD2Model();
    144144
    145   void draw();
     145  virtual void draw() const;
    146146
    147147  void setAnim(int type);
     
    160160  void processLighting();
    161161  void interpolate(sVec3D* verticesList);
    162   void renderFrame();
     162  void renderFrame() const;
    163163
    164164
Note: See TracChangeset for help on using the changeset viewer.