Index: orxonox/trunk/src/array.cc
===================================================================
--- orxonox/trunk/src/array.cc	(revision 2835)
+++ orxonox/trunk/src/array.cc	(revision 2853)
@@ -16,10 +16,37 @@
 #include "array.h"
 
+/**
+   \brief creates a new Array
+*/
 Array::Array ()
 {
-  createArray ();
+  initializeArray ();
 }
 
-void Array::createArray ()
+/**
+   \brief deletes an Array.
+   It does this by first deleting all the array-entries, and then delete the array[] itself
+*/
+Array::~Array()
+{
+  if (verbose >= 2)
+    printf("deleting array\n");
+  Entry* walker = firstEntry;
+  Entry* last;
+  while (walker != NULL)
+    {
+      last = walker;
+      walker = walker->next;
+      delete last;
+    }
+  if (finalized)
+    delete [] array;
+}
+
+/**
+   \brief initializes an Array
+   the Function does this by setting up a fistEntry, and setting the entryCount.
+*/
+void Array::initializeArray ()
 {
   if (verbose >= 2)
@@ -33,4 +60,8 @@
 }
 
+/**
+   \brief finalizes an array.
+   This Function creates the array, and makes it ready to be sent to the application.
+*/
 void Array::finalizeArray (void)
 {
@@ -49,5 +80,8 @@
 }
 
-
+/**
+   \brief adds a new Entry to the Array
+   \param entry Entry to add.
+*/
 void Array::addEntry (GLfloat entry)
 {
@@ -68,4 +102,7 @@
 }
 
+/**
+   \brief Adds 3 entries at once (convenience)
+*/
 void Array::addEntry (GLfloat entry0, GLfloat entry1, GLfloat entry2)
 {
@@ -75,5 +112,8 @@
 }
   
-
+/**
+   \brief Gives back the array !! MUST be executed AFTER finalize.
+   \returns The created array.
+*/
 GLfloat* Array::getArray ()
 {
@@ -81,4 +121,7 @@
 }
 
+/**
+   \returns The Count of entries in the Array
+*/
 int Array::getCount()
 {
@@ -86,6 +129,7 @@
 }
 
-
-
+/**
+   \brief Simple debug info about the Array
+*/
 void Array::debug ()
 {
Index: orxonox/trunk/src/array.h
===================================================================
--- orxonox/trunk/src/array.h	(revision 2835)
+++ orxonox/trunk/src/array.h	(revision 2853)
@@ -1,16 +1,27 @@
+/*!
+  \file array.h
+  \brief Contains the Array Class that handles float arrays.
+  this class creates a Array of a semi-Dynamic length.
+  beware, that after finalizing the array may not be resized again.
+*/
+
 #ifndef _ARRAY_H
 #define _ARRAY_H
 
-extern int verbose;
+extern int verbose; //!< will be obsolete soon
 
 #include <GL/gl.h>
 #include <GL/glu.h>
 #include <fstream>
+
+
+//! Array Class that handles dynamic-float arrays.
 class Array
 {
  public:
   Array ();
+  ~Array();
 
-  void createArray ();
+  void initializeArray ();
   void finalizeArray (void);
   void addEntry (GLfloat entry);
Index: orxonox/trunk/src/material.cc
===================================================================
--- orxonox/trunk/src/material.cc	(revision 2835)
+++ orxonox/trunk/src/material.cc	(revision 2853)
@@ -16,4 +16,8 @@
 #include "material.h"
 
+/**
+   \brief creates a default Material with no Name
+   normally you call this to create a material List (for an obj-file) and then append with addMaterial()
+*/
 Material::Material()
 {
@@ -23,4 +27,8 @@
 }
 
+/**
+   \brief creates a Material.
+   \param mtlName Name of the Material to be added to the Material List
+*/
 Material::Material (char* mtlName)
 {
@@ -30,4 +38,20 @@
 }
 
+/** 
+    \brief deletes a Material
+*/
+Material::~Material()
+{
+  if (verbose >= 2)
+    printf ("delete Material %s\n", name);
+  if (nextMat != NULL)
+    delete nextMat;
+}
+
+/**
+   \brief adds a new Material to the List.
+   this Function will append a new Material to the end of a Material List.
+   \param mtlName The name of the Material to be added.
+*/
 Material* Material::addMaterial(char* mtlName)
 {
@@ -45,4 +69,7 @@
 }
 
+/**
+   \brief initializes a new Material with its default Values
+*/
 void Material::init(void)
 {
@@ -55,8 +82,13 @@
   setAmbient(0,0,0);
   setSpecular(0,0,0);
+  setShininess(2.0);
   setTransparency(0.0);
-}
-
-
+  
+}
+
+/**
+   \brief Set the Name of the Material. (Important for searching)
+   \param mtlName the Name of the Material to be set.
+*/ 
 void Material::setName (char* mtlName)
 {
@@ -67,4 +99,7 @@
 
 }
+/**
+   \returns The Name of The Material
+*/
 char* Material::getName (void)
 {
@@ -72,5 +107,8 @@
 }
 
-
+/**
+   \brief Sets the Material Illumination Model. 
+   \brief illu illumination Model in int form
+*/
 void Material::setIllum (int illum)
 {
@@ -80,9 +118,18 @@
   //  printf ("setting illumModel to: %i\n", illumModel);
 }
-void Material::setIllum (char* illum)
+/**
+   \brief Sets the Material Illumination Model. 
+   \brief illu illumination Model in char* form
+*/void Material::setIllum (char* illum)
 {
   setIllum (atoi(illum));
 }
 
+/**
+   \brief Sets the Material Diffuse Color.
+   \param r Red Color Channel.
+   \param g Green Color Channel.
+   \param b Blue Color Channel.
+*/
 void Material::setDiffuse (float r, float g, float b)
 {
@@ -95,4 +142,8 @@
 
 }
+/**
+   \brief Sets the Material Diffuse Color.
+   \param rgb The red, green, blue channel in char format (with spaces between them)
+*/
 void Material::setDiffuse (char* rgb)
 {
@@ -102,4 +153,10 @@
 }
 
+/**
+   \brief Sets the Material Ambient Color. 
+   \param r Red Color Channel.
+   \param g Green Color Channel.
+   \param b Blue Color Channel.
+*/
 void Material::setAmbient (float r, float g, float b)
 {
@@ -111,4 +168,8 @@
   ambient[3] = 1.0;
 }
+/**
+   \brief Sets the Material Ambient Color.
+   \param rgb The red, green, blue channel in char format (with spaces between them)
+*/
 void Material::setAmbient (char* rgb)
 {
@@ -118,4 +179,10 @@
 }
 
+/**
+   \brief Sets the Material Specular Color. 
+   \param r Red Color Channel.
+   \param g Green Color Channel.
+   \param b Blue Color Channel.
+*/
 void Material::setSpecular (float r, float g, float b)
 {
@@ -127,4 +194,8 @@
   specular[3] = 1.0;
  }
+/**
+   \brief Sets the Material Specular Color.
+   \param rgb The red, green, blue channel in char format (with spaces between them)
+*/
 void Material::setSpecular (char* rgb)
 {
@@ -134,5 +205,25 @@
 }
 
-
+/**
+   \brief Sets the Material Shininess.
+   \param shini stes the Shininess from float.
+*/
+void Material::setShininess (float shini)
+{
+  shininess = shini;
+}
+/**
+   \brief Sets the Material Shininess.
+   \param shini stes the Shininess from char*.
+*/
+void Material::setShininess (char* shini)
+{
+  setShininess (atof(shini));
+}
+
+/**
+   \brief Sets the Material Transparency.
+   \param trans stes the Transparency from int.
+*/
 void Material::setTransparency (float trans)
 {
@@ -141,4 +232,8 @@
   transparency = trans;
 }
+/**
+   \brief Sets the Material Transparency.
+   \param trans stes the Transparency from char*.
+*/
 void Material::setTransparency (char* trans)
 {
@@ -148,5 +243,9 @@
 }
 
-
+/**
+   \brief Search for a Material called mtlName
+   \param mtlName the Name of the Material to search for
+   \returns Material named mtlName if it is found. NULL otherwise.
+*/
 Material* Material::search (char* mtlName)
 {
@@ -169,4 +268,7 @@
 }
 
+/**
+   \brief sets the material with which the following Faces will be painted
+*/
 bool Material::select (void)
 {
@@ -180,4 +282,7 @@
   // setting up Sprecular
   glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
+
+  // setting up Shininess
+  glMaterialf(GL_FRONT, GL_SHININESS, shininess);
   
   // setting illumination Model 
Index: orxonox/trunk/src/material.h
===================================================================
--- orxonox/trunk/src/material.h	(revision 2835)
+++ orxonox/trunk/src/material.h	(revision 2853)
@@ -1,6 +1,11 @@
+/*!
+  \file material.h
+  \brief Contains the Material Class that handles Material for 3D-Objects.
+*/
+
 #ifndef _MATERIAL_H
 #define _MATERIAL_H
 
-extern int verbose;
+extern int verbose; //!< will be obsolete soon.
 
 #include <GL/gl.h>
@@ -9,4 +14,5 @@
 #include <fstream>
 
+//! Class to handle Materials.
 class Material
 {
@@ -30,4 +36,6 @@
   void setSpecular (float r, float g, float b);
   void setSpecular (char* rgb);
+  void setShininess (float shini);
+  void setShininess (char* shini);
   void setTransparency (float trans);
   void setTransparency (char* trans);
@@ -37,5 +45,5 @@
   bool select (void);
 
-  Material* nextMat;
+  Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.
 
  private:
@@ -45,4 +53,5 @@
   float ambient [4];
   float specular [4];
+  float shininess;
   float transparency;
 
Index: orxonox/trunk/src/object.cc
===================================================================
--- orxonox/trunk/src/object.cc	(revision 2835)
+++ orxonox/trunk/src/object.cc	(revision 2853)
@@ -18,4 +18,8 @@
 #include "object.h"
 
+/**
+   \brief Creates a 3D-Object, but does not load any 3D-models
+   pretty useless
+*/
 Object::Object ()
 {
@@ -23,9 +27,13 @@
   initialize();
 
-  importFile ("reaphigh.obj");
+  BoxObject();
 
   finalize();
 }
 
+/**
+   \brief Crates a 3D-Object and loads in a File
+   \param fileName file to parse and load (must be a .obj file)
+*/
 Object::Object(char* fileName)
 {
@@ -36,4 +44,10 @@
   finalize();
 }
+
+/**
+   \brief Crates a 3D-Object, 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 object will be scaled with.
+*/
 
 Object::Object(char* fileName, float scaling)
@@ -47,29 +61,52 @@
 }
 
+/**
+   \brief deletes an Object
+*/
+Object::~Object()
+{
+  if (verbose >= 2)
+    printf ("Deleting display List.\n");
+  Group* walker = firstGroup;
+  while (walker != NULL)
+    {
+      glDeleteLists (walker->listNumber, 1);
+      Group* lastWalker = walker;
+      walker = walker->nextGroup;
+      delete lastWalker;
+    } 
+}
+
+/** 
+    \brief initializes the Object
+    This Function initializes all the needed arrays, Lists and clientStates
+*/
 bool Object::initialize (void)
 {
   if (verbose >=3)
     printf("new 3D-Object is being created\n"); 
-  faceMode = -1;
-  if ( (listNumber = glGenLists(1)) == 0 )
-    {
-      printf ("list could not be created for this Object\n");
-      return false;
-    }
-
+
+  // setting the start group;
+  firstGroup = new Group;
+  currentGroup = firstGroup;
+  groupCount = 0;
+  
+  initGroup (currentGroup);
   mtlFileName = "";
   scaleFactor = 1;
-  vertices = new Array();
-  normals = new Array();
-  vTexture = new Array();
-
-  glNewList (listNumber, GL_COMPILE);
+  material = new Material();
+
   glEnableClientState (GL_VERTEX_ARRAY);
-  glEnableClientState (GL_NORMAL_ARRAY);
+  //  glEnableClientState (GL_NORMAL_ARRAY);
   //  glEnableClientState (GL_TEXTURE_COORD_ARRAY);
 
+
   return true;
 }
 
+/**
+   \brief Imports a obj file and handles the the relative location
+   \param fileName The file to import
+*/
 bool Object::importFile (char* fileName)
 {
@@ -81,22 +118,157 @@
 }
 
+/**
+   \brief finalizes an Object.
+   This funcion is needed, to close the glList and all the other lists.
+*/
 bool Object::finalize(void)
 {
-  if (verbose >=3)
+  //  if (verbose >=3)
     printf("finalizing the 3D-Object\n"); 
-  OBJ_FILE->close();
+  finalizeGroup (currentGroup);
+  if (material != NULL)
+    delete material;
+  return true;
+}
+
+/**
+   \brief Draws the Objects of all Groups.
+   It does this by just calling the Lists that must have been created earlier.
+*/
+void Object::draw (void)
+{
+  if (verbose >=2)
+    printf("drawing the 3D-Objects\n"); 
+  Group* walker = firstGroup;
+  while (walker != NULL)
+    {
+      if (verbose >= 3)
+	printf ("Drawing object %s\n", walker->name);
+      glCallList (walker->listNumber);
+      walker = walker->nextGroup;
+    }
+}
+
+/**
+   \brief Draws the Object number groupNumber
+   It does this by just calling the List that must have been created earlier.
+   \param groupNumber The number of the group that will be displayed.
+*/
+void Object::draw (int groupNumber)
+{
+  if (groupNumber >= groupCount)
+    {
+      if (verbose>=2)
+	printf ("You requested object number %i, but this File only contains of %i Objects.\n", groupNumber-1, groupCount);
+      return;
+    }
+  if (verbose >=2)
+    printf("drawing the requested 3D-Objects if found.\n"); 
+  Group* walker = firstGroup;
+  int counter = 0;
+  while (walker != NULL)
+    {
+      if (counter == groupNumber)
+	{
+	  if (verbose >= 2)
+	    printf ("Drawing object number %s named %s\n", counter, walker->name);
+	  glCallList (walker->listNumber);
+	  return;
+	}
+      ++counter;
+      walker = walker->nextGroup;
+    }
+  if (verbose >= 2)
+    printf("Object number %i in %s not Found.\n", groupNumber, objFileName);
+  return;
+
+}
+
+/**
+   \brief Draws the Object with a specific groupname
+   It does this by just calling the List that must have been created earlier.
+   \param groupName The name of the group that will be displayed.
+*/
+void Object::draw (char* groupName)
+{
+  if (verbose >=2)
+    printf("drawing the requested 3D-Objects if found.\n"); 
+  Group* walker = firstGroup;
+  while (walker != NULL)
+    {
+      if (!strcmp(walker->name, groupName))
+	{
+	  if (verbose >= 2)
+	    printf ("Drawing object %s\n", walker->name);
+	  glCallList (walker->listNumber);
+	  return;
+	}
+      walker = walker->nextGroup;
+    }
+  if (verbose >= 2)
+    printf("Object Named %s in %s not Found.\n", groupName, objFileName);
+  return;
+}
+
+/**
+   \returns Count of the Objects in this File
+*/
+int Object::getGroupCount (void)
+{
+  return groupCount;
+}
+
+/**
+   \brief initializes a new Group object
+*/
+bool Object::initGroup(Group* group)
+{
+  if (verbose >= 2)
+    printf("Adding new Group\n");
+  group->faceMode = -1;
+  group->name = "";
+  if ((group->listNumber = glGenLists(1)) == 0 )
+    {
+      printf ("list could not be created for this Object\n");
+      return false;
+    }
+  
+  if (groupCount == 0)
+    {
+      group->firstVertex = 0;
+      group->firstNormal = 0;
+      group->firstNormal = 0;
+    }
+  else
+    {
+      group->firstVertex = currentGroup->firstVertex + currentGroup->vertices->getCount()/3;
+      group->firstNormal = currentGroup->firstNormal + currentGroup->normals->getCount()/3;
+      group->firstVertexTexture = currentGroup->firstVertexTexture + currentGroup->vTexture->getCount()/2;
+    }
+
+  group->vertices = new Array();
+  group->normals = new Array();
+  group->vTexture = new Array();
+
+  glNewList (group->listNumber, GL_COMPILE);
+}
+
+/**
+   \brief finalizes a Group.
+*/
+bool Object::finalizeGroup(Group* group)
+{
   glEnd();
   glEndList();
-  return true;
-}
-
-void Object::draw (void)
-{
-  if (verbose >=3)
-    printf("drawing the 3D-Object\n"); 
-  glCallList (listNumber);
-}
-
-
+  
+  delete group->vertices;
+  delete group->normals;
+  delete group->vTexture;
+}
+/**
+   \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
+   \param fileName the File that will be parsed (.obj-file)
+*/
 bool Object::readFromObjFile (char* fileName)
 {
@@ -146,22 +318,27 @@
       }
 
-      // case vt
+      // case VertexTextureCoordinate
       else if (!strncmp(Buffer, "vt ", 2))
       {
 	readVertexTexture(Buffer+3);
       }
-	  
-
-    }
-  
-
-  
-  
-}
-
-
+      // case group
+      else if (!strncmp(Buffer, "g", 1))
+	{
+	  readGroup (Buffer+2);
+	}
+    }
+  OBJ_FILE->close();
+
+}
+
+/**
+   \brief parses a vertex-String
+   If a vertex line is found this function will inject it into the vertex-Array
+   \param vertexString The String that will be parsed.
+*/
 bool Object::readVertex (char* vertexString)
 {
-  readVertices = true;
+  readingVertices = true;
   char subbuffer1[20];
   char subbuffer2[20];
@@ -170,20 +347,27 @@
   if (verbose >= 3)
     printf ("reading in a vertex: %s %s %s\n", subbuffer1, subbuffer2, subbuffer3);
-  vertices->addEntry(atof(subbuffer1)*scaleFactor, atof(subbuffer2)*scaleFactor, atof(subbuffer3)*scaleFactor);
+  currentGroup->vertices->addEntry(atof(subbuffer1)*scaleFactor, atof(subbuffer2)*scaleFactor, atof(subbuffer3)*scaleFactor);
   return true;
 }
 
+/**
+   \brief parses a face-string
+   If a face line is found this function will add it to the glList.
+   The function makes a difference between QUADS and TRIANGLES, and will if changed re-open, set and re-close the gl-processe.
+   \param faceString The String that will be parsed.
+*/
 bool Object::readFace (char* faceString)
 {
-  if (readVertices == true)
-    {
-      vertices->finalizeArray();
-      glVertexPointer(3, GL_FLOAT, 0, vertices->getArray());
-      normals->finalizeArray();
-      glNormalPointer(GL_FLOAT, 0, normals->getArray());
-      vTexture->finalizeArray();
-    }
-
-  readVertices = false;
+  // finalize the Arrays;
+  if (readingVertices == true)
+    {
+      currentGroup->vertices->finalizeArray();
+      glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray());
+      currentGroup->normals->finalizeArray();
+      glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray());
+      currentGroup->vTexture->finalizeArray();
+    }
+
+  readingVertices = false;
   char subbuffer1[20];
   char subbuffer2[20];
@@ -193,12 +377,12 @@
   if (!strcmp(subbuffer4, ""))
     {
-      if (faceMode != 3)
-	{
-	  if (faceMode != -1)
+      if (currentGroup->faceMode != 3)
+	{
+	  if (currentGroup->faceMode != -1)
 	    glEnd();
 	  glBegin(GL_TRIANGLES);
 	}
       
-      faceMode = 3;
+      currentGroup->faceMode = 3;
       if (verbose >=3)
 	printf ("found triag: %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3);
@@ -210,11 +394,11 @@
   else
     {
-      if (faceMode != 4)
-	{
-	  if (faceMode != -1)
+      if (currentGroup->faceMode != 4)
+	{
+	  if (currentGroup->faceMode != -1)
 	    glEnd();
 	  glBegin(GL_QUADS);
 	}
-      faceMode = 4;
+      currentGroup->faceMode = 4;
       if (verbose >=3 )
 	printf ("found quad: %s, %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3, subbuffer4);
@@ -227,4 +411,13 @@
 }
 
+/**
+   \brief Adds a Face-element (one vertex of a face) with all its information. 
+   It does this by searching:
+   1. The Vertex itself
+   2. The VertexNormale
+   3. The VertexTextureCoordinate
+   merging this information, the face will be drawn.
+
+*/
 bool Object::addGLElement (char* elementString)
 {
@@ -237,5 +430,5 @@
   texture[0] = '\0';
   texture ++;
-  glTexCoord2fv(vTexture->getArray()+(atoi(texture)-1)*2);
+  glTexCoord2fv(currentGroup->vTexture->getArray()+(atoi(texture)-1 - currentGroup->firstVertexTexture)*2);
 
   char* normal;
@@ -245,13 +438,18 @@
       normal ++;
       //glArrayElement(atoi(vertex)-1);
-      glNormal3fv(normals->getArray() +(atoi(normal)-1)*3);
-    }
-  glVertex3fv(vertices->getArray() +(atoi(vertex)-1)*3);
-
-}
-
+      glNormal3fv(currentGroup->normals->getArray() +(atoi(normal)-1 - currentGroup->firstNormal)*3);
+    }
+  glVertex3fv(currentGroup->vertices->getArray() +(atoi(vertex)-1 - currentGroup->firstVertex)*3);
+
+}
+
+/**
+   \brief parses a vertexNormal-String
+   If a vertexNormal line is found this function will inject it into the vertexNormal-Array
+   \param normalString The String that will be parsed.
+*/
 bool Object::readVertexNormal (char* normalString)
 {
-  readVertices = true;
+  readingVertices = true;
   char subbuffer1[20];
   char subbuffer2[20];
@@ -260,11 +458,16 @@
   if (verbose >=3 )
     printf("found vertex-Normal %s, %s, %s\n", subbuffer1,subbuffer2,subbuffer3);
-  normals->addEntry(atof(subbuffer1), atof(subbuffer2), atof(subbuffer3));
+  currentGroup->normals->addEntry(atof(subbuffer1), atof(subbuffer2), atof(subbuffer3));
   return true;
 }
 
+/**
+   \brief parses a vertexTextureCoordinate-String
+   If a vertexTextureCoordinate line is found this function will inject it into the vertexTexture-Array
+   \param vTextureString The String that will be parsed.
+*/
 bool Object::readVertexTexture (char* vTextureString)
 {
-  readVertices = true;
+  readingVertices = true;
   char subbuffer1[20];
   char subbuffer2[20];
@@ -272,10 +475,43 @@
   if (verbose >=3 )
     printf("found vertex-Texture %s, %s\n", subbuffer1,subbuffer2);
-  vTexture->addEntry(atof(subbuffer1));
-  vTexture->addEntry(atof(subbuffer2));
+  currentGroup->vTexture->addEntry(atof(subbuffer1));
+  currentGroup->vTexture->addEntry(atof(subbuffer2));
   return true;
 }
 
-
+/**
+   \brief parses a group String
+   This function initializes a new Group. 
+   With it you should be able to import .obj-files with more than one Objects inside. 
+   \param groupString the new Group to create
+*/
+bool Object::readGroup (char* groupString)
+{
+  //  printf ("test\n");
+  if (!strcmp(groupString, "default"))
+    {
+      if (groupCount != 0)
+	{
+	  Group* newGroup = new Group;
+	  finalizeGroup(currentGroup);
+	  currentGroup->nextGroup = newGroup;
+	  initGroup(newGroup);
+	  currentGroup = newGroup; // must be after init see initGroup for more info
+	}
+      ++groupCount;
+    }
+  else
+    {
+      
+      currentGroup->name = new char [strlen(groupString)];      
+      strcpy(currentGroup->name, groupString);
+    }
+}
+
+/** 
+    \brief Function to read in a mtl File.
+    this Function parses all Lines of an mtl File
+    \param mtlFile The .mtl file to read
+*/
 bool Object::readMtlLib (char* mtlFile)
 {
@@ -291,6 +527,4 @@
     printf ("Opening mtlFile: %s\n", mtlFileName);
   char Buffer[500];
-  vertices = new Array();
-  material = new Material();
   Material* tmpMat = material;
   while(!MTL_FILE->eof())
@@ -328,7 +562,27 @@
 	  tmpMat->setSpecular(Buffer+3);
 	}
+      // setting The Specular Shininess
+      else if (!strncmp(Buffer, "Ns", 2))
+	{
+	  tmpMat->setShininess(Buffer+3);
+	}
+      // setting up transparency
+      else if (!strncmp(Buffer, "d", 1))
+	{
+	  tmpMat->setTransparency(Buffer+2);
+	}
+      else if (!strncpy(Buffer, "Tf", 2))
+	{
+	  tmpMat->setTransparency(Buffer+3);
+	}
+
     }
   return true;
 }
+
+/**
+   \brief Function that selects a material, if changed in the obj file.
+   \param matString the Material that will be set.
+*/
 
 bool Object::readUseMtl (char* matString)
@@ -341,7 +595,7 @@
     }
       
-  if (faceMode != -1)
+  if (currentGroup->faceMode != -1)
     glEnd();
-  faceMode = 0;
+  currentGroup->faceMode = 0;
   if (verbose >= 2)
     printf ("using material %s for coming Faces.\n", matString);
@@ -349,5 +603,8 @@
 }
 
-
+/**
+   \brief Includes a default object
+   This will inject a Cube, because this is the most basic object.
+*/
 void Object::BoxObject(void)
 {
Index: orxonox/trunk/src/object.h
===================================================================
--- orxonox/trunk/src/object.h	(revision 2835)
+++ orxonox/trunk/src/object.h	(revision 2853)
@@ -1,5 +1,5 @@
 /*!
- \file object.h
- \brief Contains the Object Class that handles 3D-Objects
+  \file object.h
+  \brief Contains the Object Class that handles 3D-Objects
 */
 
@@ -16,4 +16,7 @@
 using namespace std;
 
+extern int verbose; //!< fill be removed and added again as a verbose-class
+
+
 //! Class that handles 3D-Objects. it can also read them in and display them.
 class Object
@@ -29,19 +32,38 @@
   bool finalize(void);
   void draw (void);
-
-  bool readFromObjFile (char* fileName);
-
+  void draw (int groupNumber);
+  void draw (char* groupName);
+  int getGroupCount();
 
  private:
-  GLuint listNumber;
-  Array* vertices;
-  int verticesCount;
-  Array* colors;
-  Array* normals;
-  Array* vTexture;
+  //! Group to handle multiple Objects per obj-file
+  struct Group
+  {
+    char* name;
+
+    GLuint listNumber;
+    Array* vertices;
+    int verticesCount;
+    Array* colors;
+    Array* normals;
+    Array* vTexture;
+    int faceMode;
+
+    int firstVertex;
+    int firstNormal;
+    int firstVertexTexture;
+
+    Group* nextGroup;
+  };
+  
+  Group* firstGroup; //!< the first of all groups.
+  Group* currentGroup; //!< the currentGroup. this is the one we will work with.
+  int groupCount;
+
+  bool readingVertices;
+
   char* objFileName;
   char* mtlFileName;
-  int faceMode;
-  bool readVertices;
+
   Material* material;
   float scaleFactor;
@@ -49,4 +71,11 @@
   ifstream* OBJ_FILE;
   ifstream* MTL_FILE;
+
+  bool initGroup(Group* group);
+  bool finalizeGroup (Group* group);
+
+
+  ///// readin ///
+  bool readFromObjFile (char* fileName);
   
   bool readVertex (char* vertexString);
@@ -55,4 +84,5 @@
   bool readVertexNormal (char* normalString);
   bool readVertexTexture (char* vTextureString);
+  bool readGroup (char* groupString);
   bool readMtlLib (char* matFile);
   bool readUseMtl (char* mtlString);
