Index: orxonox/trunk/src/Makefile.am
===================================================================
--- orxonox/trunk/src/Makefile.am	(revision 3395)
+++ orxonox/trunk/src/Makefile.am	(revision 3396)
@@ -25,4 +25,5 @@
 		 environment.cc \
 		 importer/model.cc \
+		 importer/objModel.cc \
 		 importer/array.cc \
 		 importer/material.cc \
Index: orxonox/trunk/src/Makefile.in
===================================================================
--- orxonox/trunk/src/Makefile.in	(revision 3395)
+++ orxonox/trunk/src/Makefile.in	(revision 3396)
@@ -59,9 +59,10 @@
 	track.$(OBJEXT) base_entity.$(OBJEXT) game_loader.$(OBJEXT) \
 	campaign.$(OBJEXT) story_entity.$(OBJEXT) \
-	environment.$(OBJEXT) model.$(OBJEXT) array.$(OBJEXT) \
-	material.$(OBJEXT) texture.$(OBJEXT) list.$(OBJEXT) \
-	p_node.$(OBJEXT) null_parent.$(OBJEXT) base_object.$(OBJEXT) \
-	helper_parent.$(OBJEXT) track_manager.$(OBJEXT) \
-	matrix.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT)
+	environment.$(OBJEXT) model.$(OBJEXT) objModel.$(OBJEXT) \
+	array.$(OBJEXT) material.$(OBJEXT) texture.$(OBJEXT) \
+	list.$(OBJEXT) p_node.$(OBJEXT) null_parent.$(OBJEXT) \
+	base_object.$(OBJEXT) helper_parent.$(OBJEXT) \
+	track_manager.$(OBJEXT) matrix.$(OBJEXT) curve.$(OBJEXT) \
+	glmenu_imagescreen.$(OBJEXT)
 orxonox_OBJECTS = $(am_orxonox_OBJECTS)
 orxonox_LDADD = $(LDADD)
@@ -82,10 +83,10 @@
 @AMDEP_TRUE@	./$(DEPDIR)/list.Po ./$(DEPDIR)/material.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/matrix.Po ./$(DEPDIR)/model.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/orxonox.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/p_node.Po ./$(DEPDIR)/player.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/texture.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/track.Po ./$(DEPDIR)/track_manager.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/vector.Po ./$(DEPDIR)/world.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/world_entity.Po
+@AMDEP_TRUE@	./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/player.Po ./$(DEPDIR)/story_entity.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/texture.Po ./$(DEPDIR)/track.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/track_manager.Po ./$(DEPDIR)/vector.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -225,4 +226,5 @@
 		 environment.cc \
 		 importer/model.cc \
+		 importer/objModel.cc \
 		 importer/array.cc \
 		 importer/material.cc \
@@ -378,4 +380,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null_parent.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@
@@ -420,4 +423,20 @@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o model.obj `if test -f 'importer/model.cc'; then $(CYGPATH_W) 'importer/model.cc'; else $(CYGPATH_W) '$(srcdir)/importer/model.cc'; fi`
+
+objModel.o: importer/objModel.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT objModel.o -MD -MP -MF "$(DEPDIR)/objModel.Tpo" -c -o objModel.o `test -f 'importer/objModel.cc' || echo '$(srcdir)/'`importer/objModel.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/objModel.Tpo" "$(DEPDIR)/objModel.Po"; else rm -f "$(DEPDIR)/objModel.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='importer/objModel.cc' object='objModel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/objModel.Po' tmpdepfile='$(DEPDIR)/objModel.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o objModel.o `test -f 'importer/objModel.cc' || echo '$(srcdir)/'`importer/objModel.cc
+
+objModel.obj: importer/objModel.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT objModel.obj -MD -MP -MF "$(DEPDIR)/objModel.Tpo" -c -o objModel.obj `if test -f 'importer/objModel.cc'; then $(CYGPATH_W) 'importer/objModel.cc'; else $(CYGPATH_W) '$(srcdir)/importer/objModel.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/objModel.Tpo" "$(DEPDIR)/objModel.Po"; else rm -f "$(DEPDIR)/objModel.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='importer/objModel.cc' object='objModel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/objModel.Po' tmpdepfile='$(DEPDIR)/objModel.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o objModel.obj `if test -f 'importer/objModel.cc'; then $(CYGPATH_W) 'importer/objModel.cc'; else $(CYGPATH_W) '$(srcdir)/importer/objModel.cc'; fi`
 
 array.o: importer/array.cc
Index: orxonox/trunk/src/environment.cc
===================================================================
--- orxonox/trunk/src/environment.cc	(revision 3395)
+++ orxonox/trunk/src/environment.cc	(revision 3396)
@@ -21,5 +21,5 @@
 #include "world_entity.h"
 #include "vector.h"
-#include "importer/model.h"
+#include "importer/objModel.h"
 
 using namespace std;
@@ -29,5 +29,5 @@
 Environment::Environment () : WorldEntity()
 {
-  this->model = new Model("../data/models/fighter.obj");
+  this->model = new OBJModel("../data/models/fighter.obj");
 }
 
Index: orxonox/trunk/src/importer/Makefile.am
===================================================================
--- orxonox/trunk/src/importer/Makefile.am	(revision 3395)
+++ orxonox/trunk/src/importer/Makefile.am	(revision 3396)
@@ -9,4 +9,5 @@
 	          windowHandler.cc \
 	  	  model.cc \
+		  objModel.cc \
 	  	  array.cc \
 	  	  material.cc \
@@ -17,4 +18,5 @@
 	  	windowHandler.h \
 	  	model.h \
+		objModel.h \
 	  	array.h \
 		material.h \
Index: orxonox/trunk/src/importer/Makefile.in
===================================================================
--- orxonox/trunk/src/importer/Makefile.in	(revision 3395)
+++ orxonox/trunk/src/importer/Makefile.in	(revision 3396)
@@ -54,6 +54,6 @@
 PROGRAMS = $(bin_PROGRAMS)
 am_importer_OBJECTS = framework.$(OBJEXT) windowHandler.$(OBJEXT) \
-	model.$(OBJEXT) array.$(OBJEXT) material.$(OBJEXT) \
-	texture.$(OBJEXT) vector.$(OBJEXT)
+	model.$(OBJEXT) objModel.$(OBJEXT) array.$(OBJEXT) \
+	material.$(OBJEXT) texture.$(OBJEXT) vector.$(OBJEXT)
 importer_OBJECTS = $(am_importer_OBJECTS)
 importer_LDADD = $(LDADD)
@@ -63,6 +63,6 @@
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po ./$(DEPDIR)/framework.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/material.Po ./$(DEPDIR)/model.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/texture.Po ./$(DEPDIR)/vector.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/windowHandler.Po
+@AMDEP_TRUE@	./$(DEPDIR)/objModel.Po ./$(DEPDIR)/texture.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/vector.Po ./$(DEPDIR)/windowHandler.Po
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -180,4 +180,5 @@
 	          windowHandler.cc \
 	  	  model.cc \
+		  objModel.cc \
 	  	  array.cc \
 	  	  material.cc \
@@ -188,4 +189,5 @@
 	  	windowHandler.h \
 	  	model.h \
+		objModel.h \
 	  	array.h \
 		material.h \
@@ -262,4 +264,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
Index: orxonox/trunk/src/importer/framework.cc
===================================================================
--- orxonox/trunk/src/importer/framework.cc	(revision 3395)
+++ orxonox/trunk/src/importer/framework.cc	(revision 3396)
@@ -71,9 +71,9 @@
   PRINTF(2)("screensize: %i, %i\n", wHandler.screen->w, wHandler.screen->h);
   if (argc>=3)
-    obj = new Model (argv[1], atof(argv[2]));
+    obj = new OBJModel (argv[1], atof(argv[2]));
   else if (argc>=2)
-    obj = new Model(argv[1]);
+    obj = new OBJModel(argv[1]);
   else 
-    obj = new Model();
+    obj = (OBJModel*) new Model();
   
   M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0); 
@@ -215,5 +215,5 @@
 	  case SDLK_c:
 	    if (!obj)
-	      obj = new Model(argv[1]);
+	      obj = new OBJModel(argv[1]);
 	    break;
 	  }
Index: orxonox/trunk/src/importer/framework.h
===================================================================
--- orxonox/trunk/src/importer/framework.h	(revision 3395)
+++ orxonox/trunk/src/importer/framework.h	(revision 3396)
@@ -3,5 +3,5 @@
  
 #include "windowHandler.h" // Include the Whandler Basecode
-#include "model.h"
+#include "objModel.h"
 #include "vector.h"
 
@@ -33,5 +33,5 @@
 
 WindowHandler wHandler;  // Create an instance of the whandler basecode class
-Model* obj;
+OBJModel* obj;
 
 
Index: orxonox/trunk/src/importer/material.cc
===================================================================
--- orxonox/trunk/src/importer/material.cc	(revision 3395)
+++ orxonox/trunk/src/importer/material.cc	(revision 3396)
@@ -112,13 +112,13 @@
   while (searcher != NULL)
     {
-      PRINTF(2)(".");
+      PRINT(2)(".");
       if (!strcmp (searcher->getName(), mtlName))
 	{
-	  PRINTF(2)("found.\n");
+	  PRINT(2)("found.\n");
 	  return searcher;
 	}
       searcher = searcher->nextMat;
     }
-  PRINTF(2)("not found\n");
+  PRINT(2)("not found\n");
   return NULL;
 }
Index: orxonox/trunk/src/importer/model.cc
===================================================================
--- orxonox/trunk/src/importer/model.cc	(revision 3395)
+++ orxonox/trunk/src/importer/model.cc	(revision 3396)
@@ -36,36 +36,4 @@
 
 /**
-   \brief Crates a 3D-Model and loads in a File.
-   \param fileName file to parse and load (must be a .obj file)
-*/
-Model::Model(char* fileName)
-{
-  this->initialize();
-
-  this->importFile (fileName);
-
-  this->importToGL ();
-
-  this->cleanup();
-}
-
-/**
-   \brief Crates a 3D-Model, loads in a File and scales it.
-   \param fileName file to parse and load (must be a .obj file)
-   \param scaling The factor that the model will be scaled with.
-*/
-Model::Model(char* fileName, float scaling)
-{
-  this->initialize();
-  this->scaleFactor = scaling;
-
-  this->importFile (fileName);
-
-  this->importToGL ();
-
-  this->cleanup();
-}
-
-/**
    \brief deletes an Model.
 
@@ -74,4 +42,13 @@
 Model::~Model()
 {
+  PRINTF(0)("Deleting Model ");
+  if (this->name)
+    {
+      PRINT(0)("%s\n");
+      delete []this->name;
+    }
+  else
+      PRINT(0)("\n");
+
   PRINTF(2)("Deleting display Lists.\n");
   Group* walker = this->firstGroup;
@@ -84,15 +61,8 @@
     }
 
-  if (this->objPath)
-    delete []this->objPath;
-  if (this->objFileName)
-    delete []this->objFileName;
-  if (this->mtlFileName)
-    delete []this->mtlFileName;
   PRINTF(2)("Deleting Materials.\n");
   if (this->material)
     delete this->material;
 }
-
 
 /**
@@ -139,5 +109,5 @@
       walker = walker->next;
     }
-  PRINTF(1)("Model number %i in %s not Found.\n", groupNumber, this->objFileName);
+  PRINTF(1)("Model number %i in %s not Found.\n", groupNumber, this->name);
   return;
 
@@ -164,5 +134,5 @@
       walker = walker->next;
     }
-  PRINTF(1)("Model Named %s in %s not Found.\n", groupName, this->objFileName);
+  PRINTF(1)("Model Named %s in %s not Found.\n", groupName, this->name);
   return;
 }
@@ -186,4 +156,5 @@
   PRINTF(2)("new 3D-Model is being created\n"); 
 
+  this->name = NULL;
   // setting the start group;
   this->firstGroup = new Group;
@@ -192,7 +163,4 @@
   
   this->initGroup (this->currentGroup);
-  this->objPath = NULL;
-  this->objFileName = NULL;
-  this->mtlFileName = NULL;
   this->scaleFactor = 1;
   this->material = new Material();
@@ -317,126 +285,4 @@
 
 /**
-   \brief Imports a obj file and handles the the relative location
-   \param fileName The file to import
-*/
-bool Model::importFile (char* fileName)
-{
-  PRINTF(3)("preparing to read in file: %s\n", fileName);
-
-
-#ifdef __WIN32__
-  // win32 path reading
-  char pathSplitter= '\\';
-#else /* __WIN32__ */
-  // unix path reading
-  char pathSplitter='/';
-#endif /* __WIN32__ */
-  char* tmpName = fileName;
-  if (tmpName[0] == pathSplitter)
-    tmpName++;
-  char* name = tmpName;
-  while (( tmpName = strchr (tmpName+1, pathSplitter)))
-    {
-      name = tmpName+1;
-    }
-  this->objPath = new char[name-fileName];
-  strncpy(this->objPath, fileName, name-fileName);
-  this->objPath[name-fileName] = '\0';
-  if (verbose >=2)
-    if (strlen(objPath)> 0)
-      PRINTF(0)("Resolved file %s to folder: %s.\n", name, objPath);
-    else
-      PRINTF(0)("Resolved file %s.\n", name);
-  
-  if (this->material)
-    this->material->addTexturePath(this->objPath);
-  this->objFileName = new char[strlen(name)+1];
-  strcpy (this->objFileName, name);
-  this->readFromObjFile ();
-  return true;
-}
-
-/**
-   \brief Reads in the .obj File and sets all the Values.
-   This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks
-*/
-bool Model::readFromObjFile (void)
-{
-  char* fileName = new char [strlen(objPath)+strlen(objFileName)+1];
-  if (this->objFileName != NULL && !strcmp(this->objFileName, ""))
-    return false;
-  strcpy(fileName, this->objPath);
-  strcat(fileName, this->objFileName);
-
-  ifstream* OBJ_FILE = new ifstream(fileName);
-  if (OBJ_FILE->fail())
-    {
-      PRINTF(1)("unable to open .OBJ file: %s\n Loading Box Model instead.\n", fileName);
-      BoxModel();
-      OBJ_FILE->close();
-      delete []fileName;
-      delete OBJ_FILE;
-      return false;
-    }
-  PRINTF(2)("Reading from opened file %s\n", fileName);
-  char Buffer[10000];
-  while(!OBJ_FILE->eof())
-    {
-      OBJ_FILE->getline(Buffer, 10000);
-      PRINTF(3)("Read input line: %s\n", Buffer);
-      
-
-      // case vertice
-      if (!strncmp(Buffer, "v ", 2))
-	{
-	  this->readVertex(Buffer+2);
-	}
-
-      // case face
-      else if (!strncmp(Buffer, "f ", 2))
-	{
-	  this->readFace (Buffer+2);
-	}
-      
-      else if (!strncmp(Buffer, "mtllib ", 7))
-	{
-	  this->readMtlLib (Buffer+7);
-	}
-
-      else if (!strncmp(Buffer, "usemtl ", 7))
-	{
-	  this->readUseMtl (Buffer+7);
-	}
-
-      // case VertexNormal
-      else if (!strncmp(Buffer, "vn ", 3))
-	{
-	  this->readVertexNormal(Buffer+3);
-	}
-      
-      // case VertexTextureCoordinate
-      else if (!strncmp(Buffer, "vt ", 3))
-	{
-	  this->readVertexTexture(Buffer+3);
-	}
-      // case group
-      else if (!strncmp(Buffer, "g ", 2))
-	{
-	  this->readGroup (Buffer+2);
-	}
-      else if (!strncmp(Buffer, "s ", 2)) //! \todo smoothing groups have to be implemented
-	{
-	  if (verbose >= 2)
-	    PRINTF(2)("smoothing groups not supportet yet. line: %s\n", Buffer);
-	}
-    }
-  OBJ_FILE->close();
-  delete OBJ_FILE;
-  delete []fileName;
-  return true;
-
-}
-
-/**
    \brief parses a group String
    \param groupString the new Group to create
@@ -445,5 +291,5 @@
    With it you should be able to import .obj-files with more than one Models inside. 
 */
-bool Model::readGroup (char* groupString)
+bool Model::addGroup (char* groupString)
 {
   PRINTF(3)("Read Group: %s.\n", groupString);
@@ -470,5 +316,5 @@
    If a vertex line is found this function will inject it into the vertex-Array
 */
-bool Model::readVertex (char* vertexString)
+bool Model::addVertex (char* vertexString)
 {
   float subbuffer1;
@@ -488,5 +334,5 @@
    The function makes a difference between QUADS and TRIANGLES, and will if changed re-open, set and re-close the gl-processe.
 */
-bool Model::readFace (char* faceString)
+bool Model::addFace (char* faceString)
 {
   if (this->currentGroup->faceCount >0)
@@ -551,5 +397,5 @@
    If a vertexNormal line is found this function will inject it into the vertexNormal-Array
 */
-bool Model::readVertexNormal (char* normalString)
+bool Model::addVertexNormal (char* normalString)
 {
   float subbuffer1;
@@ -569,5 +415,5 @@
    this function will inject it into the vertexTexture-Array
 */
-bool Model::readVertexTexture (char* vTextureString)
+bool Model::addVertexTexture (char* vTextureString)
 {
   float subbuffer1;
@@ -580,114 +426,11 @@
 }
 
-/** 
-    \brief Function to read in a mtl File.
-    \param mtlFile The .mtl file to read
-
-    This Function parses all Lines of an mtl File.
-    The reason for it not to be in the materials-class is,
-    that a material does not have to be able to read itself in from a File.
-
-*/
-bool Model::readMtlLib (char* mtlFile)
-{
-  this->mtlFileName = new char [strlen(mtlFile)+1];
-  strcpy(this->mtlFileName, mtlFile);
-  char* fileName = new char [strlen(objPath) + strlen(this->mtlFileName)+1];
-  strcpy(fileName, this->objPath);
-  strcat(fileName, this->mtlFileName);
-  
-
-  PRINTF(3)("Opening mtlFile: %s\n", fileName);
-
-  ifstream* MTL_FILE = new ifstream (fileName);
-  if (MTL_FILE->fail())
-    {
-      PRINTF(1)("unable to open file: %s\n", fileName);
-      MTL_FILE->close();
-      delete []fileName;
-      delete MTL_FILE;
-      return false;
-    }
-  char Buffer[500];
-  Material* tmpMat = material;
-  while(!MTL_FILE->eof())
-    {
-      MTL_FILE->getline(Buffer, 500);
-      PRINTF(4)("found line in mtlFile: %s\n", Buffer);
-      
-
-      // create new Material
-      if (!strncmp(Buffer, "newmtl ", 7))
-	{
-	  tmpMat = tmpMat->addMaterial(Buffer+7);
-	  //	  PRINTF(2)("%s, %p\n", tmpMat->getName(), tmpMat);
-	}
-      // setting a illumMode
-      else if (!strncmp(Buffer, "illum ", 6))
-	{
-	  tmpMat->setIllum(Buffer+6);
-
-	}
-      // setting Diffuse Color
-      else if (!strncmp(Buffer, "Kd ", 3))
-	{
-	  tmpMat->setDiffuse(Buffer+3);
-	}
-      // setting Ambient Color
-      else if (!strncmp(Buffer, "Ka ", 3))
-	{
-	  tmpMat->setAmbient(Buffer+3);
-	}
-      // setting Specular Color
-      else if (!strncmp(Buffer, "Ks ", 3))
-	{
-	  tmpMat->setSpecular(Buffer+3);
-	}
-      // setting The Specular Shininess
-      else if (!strncmp(Buffer, "Ns ", 3))
-	{
-	  tmpMat->setShininess(Buffer+3);
-	}
-      // setting up transparency
-      else if (!strncmp(Buffer, "d ", 2))
-	{
-	  tmpMat->setTransparency(Buffer+2);
-	}
-      else if (!strncmp(Buffer, "Tf ", 3))
-	{
-	  tmpMat->setTransparency(Buffer+3);
-	}
-      
-      else if (!strncmp(Buffer, "map_Kd ", 7))
-	{
-	  tmpMat->setDiffuseMap(Buffer+7);
-	}
-      else if (!strncmp(Buffer, "map_Ka ", 7))
-	{
-	  tmpMat->setAmbientMap(Buffer+7);
-	}
-      else if (!strncmp(Buffer, "map_Ks ", 7))
-	{
-	  tmpMat->setSpecularMap(Buffer+7);
-	}
-      else if (!strncmp(Buffer, "bump ", 5))
-	{
-	  tmpMat->setBump(Buffer+7);
-	}
-     
-
-    }
-  MTL_FILE->close();
-  delete []fileName;
-  delete MTL_FILE;
-  return true;
-}
-
 /**
    \brief Function that selects a material, if changed in the obj file.
    \param matString the Material that will be set.
 */
-bool Model::readUseMtl (char* matString)
-{
+bool Model::addUseMtl (char* matString)
+{
+  /*
   if (!this->mtlFileName)
     {
@@ -695,5 +438,5 @@
       return false;
     }
-      
+  */      
   if (this->currentGroup->faceCount >0)
     this->currentGroup->currentFace = this->currentGroup->currentFace->next = new Face;
@@ -743,8 +486,13 @@
 		glEnd();
 	      this->currentGroup->faceMode = 0;
-	      PRINTF(2)("using material %s for coming Faces.\n", tmpFace->materialString);
 	      Material* tmpMat;
 	      if ((tmpMat = material->search(tmpFace->materialString)) != NULL)
-		tmpMat->select();
+		{
+		  tmpMat->select();
+		  PRINTF(2)("using material %s for coming Faces.\n", tmpFace->materialString);
+		}
+	      else 
+		PRINTF(1)("material %s not found.\n", tmpFace->materialString);
+
 
 	    }
@@ -909,68 +657,68 @@
 void Model::BoxModel(void)
 {
-  this->readVertex ("-0.5 -0.5 0.5");
-  this->readVertex ("0.5 -0.5 0.5");
-  this->readVertex ("-0.5 0.5 0.5");
-  this->readVertex ("0.5 0.5 0.5");
-  this->readVertex ("-0.5 0.5 -0.5");
-  this->readVertex ("0.5 0.5 -0.5");
-  this->readVertex ("-0.5 -0.5 -0.5");
-  this->readVertex ("0.5 -0.5 -0.5");
-
-  this->readVertexTexture ("0.0 0.0");
-  this->readVertexTexture ("1.0 0.0");
-  this->readVertexTexture ("0.0 1.0");
-  this->readVertexTexture ("1.0 1.0");
-  this->readVertexTexture ("0.0 2.0");
-  this->readVertexTexture ("1.0 2.0");
-  this->readVertexTexture ("0.0 3.0");
-  this->readVertexTexture ("1.0 3.0");
-  this->readVertexTexture ("0.0 4.0");
-  this->readVertexTexture ("1.0 4.0");
-  this->readVertexTexture ("2.0 0.0");
-  this->readVertexTexture ("2.0 1.0");
-  this->readVertexTexture ("-1.0 0.0");
-  this->readVertexTexture ("-1.0 1.0");
-
-  this->readVertexNormal ("0.0 0.0 1.0");
-  this->readVertexNormal ("0.0 0.0 1.0");
-  this->readVertexNormal ("0.0 0.0 1.0");
-  this->readVertexNormal ("0.0 0.0 1.0");
-  this->readVertexNormal ("0.0 1.0 0.0");
-  this->readVertexNormal ("0.0 1.0 0.0");
-  this->readVertexNormal ("0.0 1.0 0.0");
-  this->readVertexNormal ("0.0 1.0 0.0");
-  this->readVertexNormal ("0.0 0.0 -1.0");
-  this->readVertexNormal ("0.0 0.0 -1.0");
-  this->readVertexNormal ("0.0 0.0 -1.0");
-  this->readVertexNormal ("0.0 0.0 -1.0");
-  this->readVertexNormal ("0.0 -1.0 0.0");
-  this->readVertexNormal ("0.0 -1.0 0.0");
-  this->readVertexNormal ("0.0 -1.0 0.0");
-  this->readVertexNormal ("0.0 -1.0 0.0");
-  this->readVertexNormal ("1.0 0.0 0.0");
-  this->readVertexNormal ("1.0 0.0 0.0");
-  this->readVertexNormal ("1.0 0.0 0.0");
-  this->readVertexNormal ("1.0 0.0 0.0");
-  this->readVertexNormal ("-1.0 0.0 0.0");
-  this->readVertexNormal ("-1.0 0.0 0.0");
-  this->readVertexNormal ("-1.0 0.0 0.0");
-  this->readVertexNormal ("-1.0 0.0 0.0");
+  this->addVertex ("-0.5 -0.5 0.5");
+  this->addVertex ("0.5 -0.5 0.5");
+  this->addVertex ("-0.5 0.5 0.5");
+  this->addVertex ("0.5 0.5 0.5");
+  this->addVertex ("-0.5 0.5 -0.5");
+  this->addVertex ("0.5 0.5 -0.5");
+  this->addVertex ("-0.5 -0.5 -0.5");
+  this->addVertex ("0.5 -0.5 -0.5");
+
+  this->addVertexTexture ("0.0 0.0");
+  this->addVertexTexture ("1.0 0.0");
+  this->addVertexTexture ("0.0 1.0");
+  this->addVertexTexture ("1.0 1.0");
+  this->addVertexTexture ("0.0 2.0");
+  this->addVertexTexture ("1.0 2.0");
+  this->addVertexTexture ("0.0 3.0");
+  this->addVertexTexture ("1.0 3.0");
+  this->addVertexTexture ("0.0 4.0");
+  this->addVertexTexture ("1.0 4.0");
+  this->addVertexTexture ("2.0 0.0");
+  this->addVertexTexture ("2.0 1.0");
+  this->addVertexTexture ("-1.0 0.0");
+  this->addVertexTexture ("-1.0 1.0");
+
+  this->addVertexNormal ("0.0 0.0 1.0");
+  this->addVertexNormal ("0.0 0.0 1.0");
+  this->addVertexNormal ("0.0 0.0 1.0");
+  this->addVertexNormal ("0.0 0.0 1.0");
+  this->addVertexNormal ("0.0 1.0 0.0");
+  this->addVertexNormal ("0.0 1.0 0.0");
+  this->addVertexNormal ("0.0 1.0 0.0");
+  this->addVertexNormal ("0.0 1.0 0.0");
+  this->addVertexNormal ("0.0 0.0 -1.0");
+  this->addVertexNormal ("0.0 0.0 -1.0");
+  this->addVertexNormal ("0.0 0.0 -1.0");
+  this->addVertexNormal ("0.0 0.0 -1.0");
+  this->addVertexNormal ("0.0 -1.0 0.0");
+  this->addVertexNormal ("0.0 -1.0 0.0");
+  this->addVertexNormal ("0.0 -1.0 0.0");
+  this->addVertexNormal ("0.0 -1.0 0.0");
+  this->addVertexNormal ("1.0 0.0 0.0");
+  this->addVertexNormal ("1.0 0.0 0.0");
+  this->addVertexNormal ("1.0 0.0 0.0");
+  this->addVertexNormal ("1.0 0.0 0.0");
+  this->addVertexNormal ("-1.0 0.0 0.0");
+  this->addVertexNormal ("-1.0 0.0 0.0");
+  this->addVertexNormal ("-1.0 0.0 0.0");
+  this->addVertexNormal ("-1.0 0.0 0.0");
 
   /* normaleLess-testingMode
-  this->readFace ("1 2 4 3");
-  this->readFace ("3 4 6 5");
-  this->readFace ("5 6 8 7");
-  this->readFace ("7 8 2 1");
-  this->readFace ("2 8 6 4");
-  this->readFace ("7 1 3 5");
+  this->addFace ("1 2 4 3");
+  this->addFace ("3 4 6 5");
+  this->addFace ("5 6 8 7");
+  this->addFace ("7 8 2 1");
+  this->addFace ("2 8 6 4");
+  this->addFace ("7 1 3 5");
   */
 
-  this->readFace ("1/1/1 2/2/2 4/4/3 3/3/4");
-  this->readFace ("3/3/5 4/4/6 6/6/7 5/5/8");
-  this->readFace ("5/5/9 6/6/10 8/8/11 7/7/12");
-  this->readFace ("7/7/13 8/8/14 2/10/15 1/9/16");
-  this->readFace ("2/2/17 8/11/18 6/12/19 4/4/20");
-  this->readFace ("7/13/21 1/1/22 3/3/23 5/14/24");
-
-}
+  this->addFace ("1/1/1 2/2/2 4/4/3 3/3/4");
+  this->addFace ("3/3/5 4/4/6 6/6/7 5/5/8");
+  this->addFace ("5/5/9 6/6/10 8/8/11 7/7/12");
+  this->addFace ("7/7/13 8/8/14 2/10/15 1/9/16");
+  this->addFace ("2/2/17 8/11/18 6/12/19 4/4/20");
+  this->addFace ("7/13/21 1/1/22 3/3/23 5/14/24");
+
+}
Index: orxonox/trunk/src/importer/model.h
===================================================================
--- orxonox/trunk/src/importer/model.h	(revision 3395)
+++ orxonox/trunk/src/importer/model.h	(revision 3396)
@@ -21,17 +21,16 @@
 {
  public:
-  Model ();
-  Model (char* fileName);
-  Model(char* fileName, float scaling);
-  ~Model ();
+  Model(void);
+  virtual ~Model(void);
   
-  void draw (void) const;
-  void draw (int groupNumber) const;
-  void draw (char* groupName) const;
+  void draw(void) const;
+  void draw(int groupNumber) const;
+  void draw(char* groupName) const;
   int getGroupCount() const;
 
- private:
+ protected:
+  char* name;            //!< This is the name of the Model;
   //! This is the placeholder of one Vertex beloning to a Face.
-  struct FaceElement 
+  struct FaceElement
   {
     int vertexNumber;    //!< The number of the Vertex out of the Array* vertices, this vertex points to.
@@ -87,8 +86,4 @@
   float scaleFactor;    //!< The Factor with which the Model should be scaled. \todo maybe one wants to scale the Model after Initialisation
 
-  char* objPath;        //!< The Path where the obj and mtl-file are located.
-  char* objFileName;    //!< The Name of the obj-file.
-  char* mtlFileName;    //!< The Name of the mtl-file (parsed out of the obj-file)
-
   bool initialize (void);
   bool initGroup(Group* group);
@@ -99,15 +94,10 @@
   bool cleanupFaceElement(FaceElement* faceElem);
 
-  ///// readin ///
-  bool importFile (char* fileName);
-  bool readFromObjFile (void);
-  
-  bool readGroup (char* groupString);
-  bool readVertex (char* vertexString);
-  bool readFace (char* faceString);
-  bool readVertexNormal (char* normalString);
-  bool readVertexTexture (char* vTextureString);
-  bool readMtlLib (char* matFile);
-  bool readUseMtl (char* mtlString);
+  bool addGroup (char* groupString);
+  bool addVertex (char* vertexString);
+  bool addFace (char* faceString);
+  bool addVertexNormal (char* normalString);
+  bool addVertexTexture (char* vTextureString);
+  bool addUseMtl (char* mtlString);
 
   bool importToGL (void);
Index: orxonox/trunk/src/importer/objModel.cc
===================================================================
--- orxonox/trunk/src/importer/objModel.cc	(revision 3396)
+++ orxonox/trunk/src/importer/objModel.cc	(revision 3396)
@@ -0,0 +1,306 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#include "objModel.h"
+
+/**
+   \brief Crates a 3D-Model and loads in a File.
+   \param fileName file to parse and load (must be a .obj file)
+*/
+OBJModel::OBJModel(char* fileName)
+{
+  this->initializeOBJ();
+
+  this->importFile (fileName);
+
+  this->importToGL ();
+
+  this->cleanup();
+}
+
+/**
+   \brief Crates a 3D-Model, loads in a File and scales it.
+   \param fileName file to parse and load (must be a .obj file)
+   \param scaling The factor that the model will be scaled with.
+*/
+OBJModel::OBJModel(char* fileName, float scaling)
+{
+  this->initializeOBJ();
+  this->scaleFactor = scaling;
+
+  this->importFile (fileName);
+
+  this->importToGL ();
+
+  this->cleanup();
+}
+
+/**
+   \brief deletes an OBJModel.
+
+   Looks if any from model allocated space is still in use, and if so deleted it.
+*/
+OBJModel::~OBJModel()
+{
+  PRINTF(4)("Deleting the obj-names\n");
+  if (this->objPath)
+    delete []this->objPath;
+  if (this->objFileName)
+    delete []this->objFileName;
+  if (this->mtlFileName)
+    delete []this->mtlFileName;
+}
+
+/**
+   \brief Initializes an obj-model
+*/
+void OBJModel::initializeOBJ(void)
+{
+  this->objPath = NULL;
+  this->objFileName = NULL;
+  this->mtlFileName = NULL;
+
+  this->initialize();
+}
+
+/**
+   \brief Imports a obj file and handles the the relative location
+   \param fileName The file to import
+*/
+bool OBJModel::importFile (char* fileName)
+{
+  PRINTF(3)("preparing to read in file: %s\n", fileName);
+
+
+#ifdef __WIN32__
+  // win32 path reading
+  char pathSplitter= '\\';
+#else /* __WIN32__ */
+  // unix path reading
+  char pathSplitter='/';
+#endif /* __WIN32__ */
+  char* tmpName = fileName;
+  if (tmpName[0] == pathSplitter)
+    tmpName++;
+  char* name = tmpName;
+  while (( tmpName = strchr (tmpName+1, pathSplitter)))
+    {
+      name = tmpName+1;
+    }
+  this->objPath = new char[name-fileName+1];
+  strncpy(this->objPath, fileName, name-fileName);
+  this->objPath[name-fileName] = '\0';
+  if (verbose>=2)
+    if (strlen(objPath)> 0)
+      PRINTF(0)("Resolved file %s to folder: %s.\n", name, objPath);
+    else
+      PRINTF(0)("Resolved file %s.\n", name);
+  
+  if (this->name) delete this->name;
+  this->name = new char[strlen(name)+1];
+  strcpy(this->name, name);
+
+  if (this->material)
+    this->material->addTexturePath(this->objPath);
+  this->objFileName = new char[strlen(name)+1];
+  strcpy (this->objFileName, name);
+  this->readFromObjFile ();
+  return true;
+}
+
+/**
+   \brief Reads in the .obj File and sets all the Values.
+   This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks
+*/
+bool OBJModel::readFromObjFile (void)
+{
+  char* fileName = new char [strlen(objPath)+strlen(objFileName)+1];
+  if (this->objFileName != NULL && !strcmp(this->objFileName, ""))
+    return false;
+  strcpy(fileName, this->objPath);
+  strcat(fileName, this->objFileName);
+
+  ifstream* OBJ_FILE = new ifstream(fileName);
+  if (OBJ_FILE->fail())
+    {
+      PRINTF(1)("unable to open .OBJ file: %s\n Loading Box Model instead.\n", fileName);
+      BoxModel();
+      OBJ_FILE->close();
+      delete []fileName;
+      delete OBJ_FILE;
+      return false;
+    }
+  PRINTF(2)("Reading from opened file %s\n", fileName);
+  char Buffer[10000];
+  while(!OBJ_FILE->eof())
+    {
+      OBJ_FILE->getline(Buffer, 10000);
+      PRINTF(3)("Read input line: %s\n", Buffer);
+      
+
+      // case vertice
+      if (!strncmp(Buffer, "v ", 2))
+	{
+	  this->addVertex(Buffer+2);
+	}
+
+      // case face
+      else if (!strncmp(Buffer, "f ", 2))
+	{
+	  this->addFace (Buffer+2);
+	}
+      
+      else if (!strncmp(Buffer, "mtllib ", 7))
+	{
+	  this->readMtlLib (Buffer+7);
+	}
+
+      else if (!strncmp(Buffer, "usemtl ", 7))
+	{
+	  this->addUseMtl (Buffer+7);
+	}
+
+      // case VertexNormal
+      else if (!strncmp(Buffer, "vn ", 3))
+	{
+	  this->addVertexNormal(Buffer+3);
+	}
+      
+      // case VertexTextureCoordinate
+      else if (!strncmp(Buffer, "vt ", 3))
+	{
+	  this->addVertexTexture(Buffer+3);
+	}
+      // case group
+      else if (!strncmp(Buffer, "g ", 2))
+	{
+	  this->addGroup (Buffer+2);
+	}
+      else if (!strncmp(Buffer, "s ", 2)) //! \todo smoothing groups have to be implemented
+	{
+	  if (verbose >= 2)
+	    PRINTF(2)("smoothing groups not supportet yet. line: %s\n", Buffer);
+	}
+    }
+  OBJ_FILE->close();
+  delete OBJ_FILE;
+  delete []fileName;
+  return true;
+
+}
+
+/** 
+    \brief Function to read in a mtl File.
+    \param mtlFile The .mtl file to read
+
+    This Function parses all Lines of an mtl File.
+    The reason for it not to be in the materials-class is,
+    that a material does not have to be able to read itself in from a File.
+
+*/
+bool OBJModel::readMtlLib (char* mtlFile)
+{
+  this->mtlFileName = new char [strlen(mtlFile)+1];
+  strcpy(this->mtlFileName, mtlFile);
+  char* fileName = new char [strlen(objPath) + strlen(this->mtlFileName)+1];
+  strcpy(fileName, this->objPath);
+  strcat(fileName, this->mtlFileName);
+  
+
+  PRINTF(3)("Opening mtlFile: %s\n", fileName);
+
+  ifstream* MTL_FILE = new ifstream (fileName);
+  if (MTL_FILE->fail())
+    {
+      PRINTF(1)("unable to open file: %s\n", fileName);
+      MTL_FILE->close();
+      delete []fileName;
+      delete MTL_FILE;
+      return false;
+    }
+  char Buffer[500];
+  Material* tmpMat = material;
+  while(!MTL_FILE->eof())
+    {
+      MTL_FILE->getline(Buffer, 500);
+      PRINTF(4)("found line in mtlFile: %s\n", Buffer);
+      
+
+      // create new Material
+      if (!strncmp(Buffer, "newmtl ", 7))
+	{
+	  tmpMat = tmpMat->addMaterial(Buffer+7);
+	  //	  PRINTF(2)("%s, %p\n", tmpMat->getName(), tmpMat);
+	}
+      // setting a illumMode
+      else if (!strncmp(Buffer, "illum ", 6))
+	{
+	  tmpMat->setIllum(Buffer+6);
+
+	}
+      // setting Diffuse Color
+      else if (!strncmp(Buffer, "Kd ", 3))
+	{
+	  tmpMat->setDiffuse(Buffer+3);
+	}
+      // setting Ambient Color
+      else if (!strncmp(Buffer, "Ka ", 3))
+	{
+	  tmpMat->setAmbient(Buffer+3);
+	}
+      // setting Specular Color
+      else if (!strncmp(Buffer, "Ks ", 3))
+	{
+	  tmpMat->setSpecular(Buffer+3);
+	}
+      // setting The Specular Shininess
+      else if (!strncmp(Buffer, "Ns ", 3))
+	{
+	  tmpMat->setShininess(Buffer+3);
+	}
+      // setting up transparency
+      else if (!strncmp(Buffer, "d ", 2))
+	{
+	  tmpMat->setTransparency(Buffer+2);
+	}
+      else if (!strncmp(Buffer, "Tf ", 3))
+	{
+	  tmpMat->setTransparency(Buffer+3);
+	}
+      
+      else if (!strncmp(Buffer, "map_Kd ", 7))
+	{
+	  tmpMat->setDiffuseMap(Buffer+7);
+	}
+      else if (!strncmp(Buffer, "map_Ka ", 7))
+	{
+	  tmpMat->setAmbientMap(Buffer+7);
+	}
+      else if (!strncmp(Buffer, "map_Ks ", 7))
+	{
+	  tmpMat->setSpecularMap(Buffer+7);
+	}
+      else if (!strncmp(Buffer, "bump ", 5))
+	{
+	  tmpMat->setBump(Buffer+7);
+	}
+     
+
+    }
+  MTL_FILE->close();
+  delete []fileName;
+  delete MTL_FILE;
+  return true;
+}
Index: orxonox/trunk/src/importer/objModel.h
===================================================================
--- orxonox/trunk/src/importer/objModel.h	(revision 3396)
+++ orxonox/trunk/src/importer/objModel.h	(revision 3396)
@@ -0,0 +1,33 @@
+/*!
+  \file objmodel.h
+  \brief Contains the OBJ-model Class, that reads in a Model from a .obj-file
+*/
+
+#ifndef _OBJMODEL_H
+#define _OBJMODEL_H
+
+#include "model.h"
+
+//! A Class, that handles the parsing of an obj-file, and inclusion as a Model.
+class OBJModel : public Model
+{
+ public:
+  OBJModel(char* fileName);
+  OBJModel(char* fileName, float scaling);
+  virtual ~OBJModel();
+  void initializeOBJ(void);
+
+ private:
+  // Variables
+  char* objPath;        //!< The Path where the obj and mtl-file are located.
+  char* objFileName;    //!< The Name of the obj-file.
+  char* mtlFileName;    //!< The Name of the mtl-file (parsed out of the obj-file)
+
+  ///// readin /////
+  bool importFile (char* fileName);
+  bool readFromObjFile (void);
+  bool readMtlLib (char* matFile);
+
+};
+
+#endif /* _OBJ_MODEL_H */
Index: orxonox/trunk/src/player.cc
===================================================================
--- orxonox/trunk/src/player.cc	(revision 3395)
+++ orxonox/trunk/src/player.cc	(revision 3396)
@@ -19,5 +19,5 @@
 #include "stdincl.h"
 #include "collision.h"
-#include "importer/model.h"
+#include "importer/objModel.h"
 
 using namespace std;
@@ -27,5 +27,5 @@
 {
 
-  this->model = new Model("../data/models/reaplow.obj");
+  this->model = new OBJModel("../data/models/reaplow.obj");
   /*
   objectList = glGenLists(1);
Index: orxonox/trunk/src/player.h
===================================================================
--- orxonox/trunk/src/player.h	(revision 3395)
+++ orxonox/trunk/src/player.h	(revision 3396)
@@ -9,5 +9,5 @@
 #include "world_entity.h"
 
-class Model;
+class OBJModel;
 
 //! Basic controllable WorldEntity
Index: orxonox/trunk/src/world_entity.h
===================================================================
--- orxonox/trunk/src/world_entity.h	(revision 3395)
+++ orxonox/trunk/src/world_entity.h	(revision 3396)
@@ -11,5 +11,5 @@
 
 class CollisionCluster;
-class Model;
+class OBJModel;
 
 //! Basic class from which all interactive stuff in the world is derived from
@@ -22,5 +22,5 @@
   virtual ~WorldEntity ();
 
-  Model* model;
+  OBJModel* model;
   
   void setCollision (CollisionCluster* newhull);
