Index: branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc	(revision 8659)
+++ branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc	(revision 8660)
@@ -48,5 +48,5 @@
 
     // set the animation
-    this->interpolate(this->md3Data, this->config->getAnimation("Dead 1"), MD3_ANIM_NEXT, false);
+    this->interpolate(this->md3Data, this->config->getAnimation("Dead 1"), MD3_ANIM_NEXT, true);
   }
 
@@ -125,4 +125,5 @@
   void MD3Model::tick(float time)
   {
+    PRINTF(0)("tick\n");
     if(this->md3Data == NULL)
       return;
@@ -131,4 +132,5 @@
 
     this->tick(time, this->md3Data);
+    PRINTF(0)("tick finished\n");
   }
 
@@ -139,5 +141,5 @@
   void MD3Model::tick(float time, MD3Data* data)
   {
-    // draw the bones if needed
+    // draw the bones if needed#
     if( this->bDrawBones)
     {
@@ -163,8 +165,7 @@
       MD3Mesh* mesh = data->meshes[i];
 
-//       if( data->animationState.interpolationFraction != 0.0 &&
-//           data->animationState.currentFrame != data->animationState.nextFrame)
-//       {
+
         //interpolate mesh frame between the 2 current mesh frames
+      PRINTF(0)(" interpolate from %i, to %i\n", data->animationState.currentFrame, data->animationState.nextFrame);
       if( data->header->boneFrameNum > 1)
         this->interpolateMeshFrame( data,
@@ -177,10 +178,5 @@
                                     mesh->meshFrames[data->animationState.currentFrame],
                                     0.0f, mesh, i);
-//       }
-//       else
-//       {
-//         //no interpolation needed, just draw current frame
-//         frame = &mesh->meshFrames[data->animationState.currentFrame];
-//       }
+
 
 
@@ -219,6 +215,6 @@
       {
         //we need to interpolate
-        MD3Tag* nextFrameTag = data->boneFrames[data->animationState.nextFrame]->tags[child->parentTagIndex];
-        this->interpolateTransformation(child, currFrameTag, nextFrameTag, data->animationState.interpolationFraction, i);
+//         MD3Tag* nextFrameTag = data->boneFrames[data->animationState.nextFrame]->tags[child->parentTagIndex];
+//         this->interpolateTransformation(child, currFrameTag, nextFrameTag, data->animationState.interpolationFraction, i);
       }
       else
@@ -260,6 +256,8 @@
   void MD3Model::draw() const
   {
+    PRINTF(0)("draw\n");
     //draw current bone frame
     this->draw(this->md3Data);
+    PRINTF(0)("draw finished\n");
   }
 
@@ -483,10 +481,23 @@
     int vertexNum = mesh->header->vertexNum;
 
-    // calc interpolated vertices
-    for( int t = 0; t < vertexNum; t++)
-    {
-      data->tmpMesh[i][t][0]  = (1.0f - frac)   * currMeshFrame[t][0]  + frac * nextMeshFrame[t][0];
-      data->tmpMesh[i][t][1]  = (1.0f - frac)   * currMeshFrame[t][1]  + frac * nextMeshFrame[t][1];
-      data->tmpMesh[i][t][2]  = (1.0f - frac)   * currMeshFrame[t][2]  + frac * nextMeshFrame[t][2];
+    if( /*frac == 0.0f*/ true)
+    {
+      // just copy the vertices
+      for( int t = 0; t < vertexNum; t++)
+      {
+        data->tmpMesh[i][t][0]  = currMeshFrame[t][0];
+        data->tmpMesh[i][t][1]  = currMeshFrame[t][1];
+        data->tmpMesh[i][t][2]  = currMeshFrame[t][2];
+      }
+    }
+    else
+    {
+      // calc interpolated vertices
+      for( int t = 0; t < vertexNum; t++)
+      {
+        data->tmpMesh[i][t][0]  = (1.0f - frac)   * currMeshFrame[t][0]  + frac * nextMeshFrame[t][0];
+        data->tmpMesh[i][t][1]  = (1.0f - frac)   * currMeshFrame[t][1]  + frac * nextMeshFrame[t][1];
+        data->tmpMesh[i][t][2]  = (1.0f - frac)   * currMeshFrame[t][2]  + frac * nextMeshFrame[t][2];
+      }
     }
 
@@ -654,10 +665,9 @@
         data->upperBound = data->header->boneFrameNum;
       else
-        data->upperBound = (data->animation->first +
-            data->animation->numFrames);
-    }
-
-
-//     PRINTF(0)("anim op: %i\n", data->op);
+        data->upperBound = (data->animation->first + data->animation->numFrames);
+    }
+
+
+     PRINTF(0)("anim op: %i\n", data->op);
     switch( data->op) {
 
@@ -665,6 +675,7 @@
         if( data->bInterpolate)
         {
-          data->animationState.interpolationFraction += time / data->animation->fps;
-          PRINTF(0)("anim state: +=%f, =%f\n", time / data->animation->fps, data->animationState.interpolationFraction);
+          // keyframe interpolation animation
+          data->animationState.interpolationFraction += time * data->animation->fps;
+
           if( data->animationState.interpolationFraction >= 1.0f)
           {
@@ -674,11 +685,13 @@
           }
         }
-        else {
+        else
+        {
+          // only keyframe animation
           this->time += time * data->animation->fps;
-          if(this->time > 1.0f)
+          if( this->time > 1.0f)
           {
-          data->animationState.currentFrame = data->animationState.nextFrame;
-          data->animationState.nextFrame = next(data, data->animationState.nextFrame);
-          this->time = 0.0f;
+            data->animationState.currentFrame = data->animationState.nextFrame;
+            data->animationState.nextFrame = next(data, data->animationState.nextFrame);
+            this->time = 0.0f;
           }
         }
