Index: branches/bsp_model/src/lib/graphics/importer/md3/md3_data.h
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/md3/md3_data.h	(revision 8549)
+++ branches/bsp_model/src/lib/graphics/importer/md3/md3_data.h	(revision 8550)
@@ -40,80 +40,90 @@
   class MD3Mesh;
 
-//! This holds the header information that is read in at the beginning of the file: id software definition
-struct MD3Header
-{
-   int ident;                           //!< This is used to identify the file
-   int version;                         //!< The version number of the file (Must be 8)
+  //! This holds the header information that is read in at the beginning of the file: id software definition
+  typedef struct MD3Header
+  {
+    int ident;                           //!< This is used to identify the file
+    int version;                         //!< The version number of the file (Must be 8)
 
-   char filename[68];                   //!< The filename of the model
+    char filename[68];                   //!< The filename of the model
 
-   int boneFrameNum;                    //!< number of frames
-   int tagNum;                          //!< number of tags
-   int meshNum;                         //!< number of mesh
-   int maxTexNum;                       //!< number of texture
+    int boneFrameNum;                    //!< number of frames
+    int tagNum;                          //!< number of tags
+    int meshNum;                         //!< number of mesh
+    int maxTexNum;                       //!< number of texture
 
-   int boneFrameStart;                  //!< start of bone frames
-   int tagStart;                        //!< start of the tag
-   int meshStart;                       //!< mesh start
+    int boneFrameStart;                  //!< start of bone frames
+    int tagStart;                        //!< start of the tag
+    int meshStart;                       //!< mesh start
 
-   int fileSize;                        //!< file size
-};
+    int fileSize;                        //!< file size
+  };
+
+  //!< holding the informations about the current animation state
+  typedef struct MD3AnimationState
+  {
+    int     currentFrame;          //!< currently rendered animation key frame of this model. Every part has its own current frame!
+    int     nextFrame;             //!< next animation key frame of the model.
+    float   interpolationFraction; //!< interpolation position between currentFrame and nextFrame [0,1]
+  };
+
+
+  //! class to store the md2 data in
+  class MD3Data : public BaseObject
+  {
+    public:
+      MD3Data(const std::string& modelFileName, const std::string& skinFileName, float scale = 1.0f);
+      virtual ~MD3Data();
+
+      void addLinkedModel(int tagIndex, MD3Data* child);
+
+
+    private:
+      bool loadModel(const std::string& fileName);
+      bool loadSkin(const std::string& fileName = "");
+
+      int readHeader(FILE* pFile, int fileOffset);
+      int readBoneFrames(FILE* pFile, int fileOffset);
+      int readTags(FILE* pFile, int fileOffset);
+      int readMeshes(FILE* pFile, int fileOffset);
+
+
+      int readMeshTriangles(FILE* pFile, int fileOffset, int mesh);
+      int readMeshTextures(FILE* pFile, int fileOffset, int mesh);
+      int readMeshTexVecs(FILE* pFile, int fileOffset, int mesh);
+      int readMeshVertices(FILE* pFile, int fileOffset, int mesh);
+
+
+    public:
+
+      MD3Header*                header;            //!< the header file
+
+      std::map<int, MD3Data*>   sortedMap;         //!< map
+      int                       parentTagIndex;    //!< the tag index of the parent model
+      MD3Data*                  parent;            //!< the parent model
+
+      std::string               filename;          //!< the name of the file as recorded in the .md3 file
+      std::string               loadFilename;      //!< filename of the actual file from which data was loaded
+
+      int                       boneFrameNum;      //!< number of anumation key fames in the models
+      int                       tagNum;            //!< number of tags
+      int                       meshNum;           //!< number of meshes
+
+      int                       maxTextureNum;     //!< maximum number of unique used in an md3 file
+      int                       boneFrameStart;    //!< starting position of bone frame data structures
+      int                       tagStart;          //!< starting position of tag-structures
+
+      int                       meshStart;         //!< starting position of mesh structures
+
+      int                       fileSize;          //!< file size
+
+      MD3AnimationState         animationState;    //!< the animation state of this model
+
+      MD3BoneFrame**            boneFrames;        //!< array of bone frames, contains the metadata (bounding box, tags,...) for each frame
+      MD3Mesh**                 meshes;            //!< array of meshes in the model. each containing the mesh for each of the animation
 
 
 
-//! class to store the md2 data in
-class MD3Data : public BaseObject
-{
- public:
-   MD3Data(const std::string& modelFileName, const std::string& skinFileName, float scale = 1.0f);
-  virtual ~MD3Data();
-
-  void addLinkedModel(int tagIndex, MD3Data* child);
-
-
- private:
-   bool loadModel(const std::string& fileName);
-   bool loadSkin(const std::string& fileName = "");
-
-   int readHeader(FILE* pFile, int fileOffset);
-   int readBoneFrames(FILE* pFile, int fileOffset);
-   int readTags(FILE* pFile, int fileOffset);
-   int readMeshes(FILE* pFile, int fileOffset);
-
-
-   int readMeshTriangles(FILE* pFile, int fileOffset, int mesh);
-   int readMeshTextures(FILE* pFile, int fileOffset, int mesh);
-   int readMeshTexVecs(FILE* pFile, int fileOffset, int mesh);
-   int readMeshVertices(FILE* pFile, int fileOffset, int mesh);
-
-
- public:
-
-  MD3Header*          header;            //!< the header file
-
-  std::map<int, MD3Data*> sortedMap;         //!< map
-  int                 parentTagIndex;    //!< the tag index of the parent model
-  MD3Data*            parent;            //!< the parent model
-
-  std::string         filename;          //!< the name of the file as recorded in the .md3 file
-  std::string         loadFilename;      //!< filename of the actual file from which data was loaded
-
-  int                 boneFrameNum;      //!< number of anumation key fames in the models
-  int                 tagNum;            //!< number of tags
-  int                 meshNum;           //!< number of meshes
-
-  int                 maxTextureNum;     //!< maximum number of unique used in an md3 file
-  int                 boneFrameStart;    //!< starting position of bone frame data structures
-  int                 tagStart;          //!< starting position of tag-structures
-
-  int                 meshStart;         //!< starting position of mesh structures
-
-  int                 fileSize;          //!< file size
-
-
-  MD3BoneFrame**      boneFrames;        //!< array of bone frames, contains the metadata (bounding box, tags,...) for each frame
-  MD3Mesh**           meshes;            //!< array of meshes in the model. each containing the mesh for each of the animation
-
-};
+  };
 
 
Index: branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc	(revision 8549)
+++ branches/bsp_model/src/lib/graphics/importer/md3/md3_model.cc	(revision 8550)
@@ -47,81 +47,14 @@
   {
     //draw current bone frame
-#if 0
-    if( this->bDrawBones)
-    {
-      //get bone frame, interpolate if necessary
-      if( model.interpolationFraction!=0.0 && model.currentFrame!=model.nextFrame)
-        //interpolate bone frame
-        drawBoneFrame(interpolateBoneFrame(model.boneFrames[model.currentFrame], model.boneFrames[model.nextFrame], model.interpolationFraction));
-      else
-        //stick with current bone frame
-        drawBoneFrame(model.boneFrames[model.currentFrame]);
-    }
+    this->draw(this->md3Data);
+  }
 
-    //draw all meshes of current frame of this model
-    for (int i=0; i<model.meshNum; i++) {
-      MD3GLMesh mesh = (MD3GLMesh)model.meshes[i];
 
-      gl.glBlendFunc(mesh.GLSrcBlendFunc, mesh.GLDstBlendFunc);
-      gl.glDepthMask(mesh.GLDepthMask);
-      if (mesh.textureNum > 0 && mesh.textures[0]!=null)
-        gl.glBindTexture(GLEnum.GL_TEXTURE_2D, ((MD3GLTexture)mesh.textures[0]).bind);
-      else
-        gl.glBindTexture(GLEnum.GL_TEXTURE_2D, 0);
-
-      //get mesh frame, do interpolation if necessary
-      Vec3[] frame;
-      if (model.interpolationFraction!=0.0 && model.currentFrame!=model.nextFrame)
-        //interpolate mesh frame between the 2 current mesh frames
-        frame=interpolateMeshFrame(mesh.meshFrames[model.currentFrame], mesh.meshFrames[model.nextFrame], model.interpolationFraction);
-      else
-        //no interpolation needed, just draw current frame
-        frame=mesh.meshFrames[model.currentFrame];
-
-      drawMesh(mesh, frame);
-
-      //draw vertex normals
-      if (canvas.showVertexNormals) {
-                                //get vertex normals, interpolate if necessary
-        if (model.interpolationFraction!=0.0 && model.currentFrame!=model.nextFrame)
-                //interpolate vertex normals
-          drawVertexNormals(frame, interpolateVertexNormals(mesh.meshVertexNormals[model.currentFrame], mesh.meshVertexNormals[model.nextFrame], model.interpolationFraction));
-        else
-                //stick with current vertex normals
-          drawVertexNormals(frame, mesh.meshVertexNormals[model.currentFrame]);
-      }
-    }
-
-    //draw all models linked to this model
-
-    Iterator it=model.linkedModels();
-    while (it.hasNext()) {
-      MD3Model child=(MD3Model)it.next();
-
-      //build transformation array m from matrix, interpolate if necessary
-      float[] m=new float[16];
-      MD3Tag currFrameTag=model.boneFrames[model.currentFrame].tags[child.getParentTagIndex()];
-      if (model.interpolationFraction!=0.0f && model.currentFrame!=model.nextFrame) {
-        //we need to interpolate
-        MD3Tag nextFrameTag=model.boneFrames[model.nextFrame].tags[child.getParentTagIndex()];
-        m=interpolateTransformation(currFrameTag, nextFrameTag, model.interpolationFraction);
-      }
-      else {
-        //no interpolation needed, stay with last transformation
-              //OpenGL matrix is in column-major order
-        m[0] = currFrameTag.matrix[0][0]; m[4] = currFrameTag.matrix[0][1]; m[8] = currFrameTag.matrix[0][2]; m[12] = currFrameTag.position.x;
-        m[1] = currFrameTag.matrix[1][0]; m[5] = currFrameTag.matrix[1][1]; m[9] = currFrameTag.matrix[1][2]; m[13] = currFrameTag.position.y;
-        m[2] = currFrameTag.matrix[2][0]; m[6] = currFrameTag.matrix[2][1]; m[10]= currFrameTag.matrix[2][2]; m[14] = currFrameTag.position.z;
-        m[3] = 0.0f;                                              m[7] = 0.0f;                                              m[11]= 0.0f;                            m[15] = 1.0f;
-      }
-
-      //switch to child coord system and draw child
-      gl.glPushMatrix();
-      gl.glMultMatrixf(m);
-      child.accept(this);
-      gl.glPopMatrix();
-    }
-#endif
-  }
+  /**
+   * draw the md3model
+   * @param data: the data to be drawn
+   */
+  void MD3Model::draw(MD3Data* data)
+  {}
 
 
Index: branches/bsp_model/src/lib/graphics/importer/md3/md3_model.h
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/md3/md3_model.h	(revision 8549)
+++ branches/bsp_model/src/lib/graphics/importer/md3/md3_model.h	(revision 8550)
@@ -32,4 +32,9 @@
     virtual void draw();
 
+
+  private:
+    void draw(MD3Data* data);
+
+
   private:
     MD3Data*            md3Data;           //!< reference to the md3 model data
