Index: trunk/src/lib/graphics/importer/Makefile.am
===================================================================
--- trunk/src/lib/graphics/importer/Makefile.am	(revision 10141)
+++ trunk/src/lib/graphics/importer/Makefile.am	(revision 10147)
@@ -25,4 +25,7 @@
 		\
 		obj/objModel.cc \
+		\
+		oif/object_information_file.cc \
+		oif/resource_oif.cc \
 		\
 		bsp/bsp_manager.cc \
@@ -79,4 +82,7 @@
 		obj/objModel.h \
 		\
+		oif/object_information_file.h \
+		oif/resource_oif.h \
+		\
                 md2/md2Model.h \
 		md2/resource_md2.h \
Index: trunk/src/lib/graphics/importer/model.h
===================================================================
--- trunk/src/lib/graphics/importer/model.h	(revision 10141)
+++ trunk/src/lib/graphics/importer/model.h	(revision 10147)
@@ -83,4 +83,8 @@
     inline unsigned int getTriangleCount() const { return this->pModelInfo.numTriangles; };
 
+    /** function to extract the mount points from the model data */
+    virtual void extractMountPoints() {}
+
+
   protected:
     Model();
Index: trunk/src/lib/graphics/importer/obj/objModel.cc
===================================================================
--- trunk/src/lib/graphics/importer/obj/objModel.cc	(revision 10141)
+++ trunk/src/lib/graphics/importer/obj/objModel.cc	(revision 10147)
@@ -44,4 +44,6 @@
 
   this->finalize();
+
+  this->extractMountPoints();
 }
 
@@ -138,6 +140,6 @@
           this->addVertexTexture(buffer+3);
         }
-      // case group
-      else if (!strncmp(buffer, "g ", 2))
+      // case group or object (depends on the exporter program)
+      else if (!strncmp(buffer, "g ", 2) || !strncmp(buffer, "o ", 2))
         {
           this->addGroup (buffer+2);
Index: trunk/src/lib/graphics/importer/obj/objModel.h
===================================================================
--- trunk/src/lib/graphics/importer/obj/objModel.h	(revision 10141)
+++ trunk/src/lib/graphics/importer/obj/objModel.h	(revision 10147)
@@ -16,4 +16,5 @@
   OBJModel(const std::string& fileName, float scaling = 1.0);
   virtual ~OBJModel();
+
 
 private:
Index: trunk/src/lib/graphics/importer/oif/object_information_file.cc
===================================================================
--- trunk/src/lib/graphics/importer/oif/object_information_file.cc	(revision 10147)
+++ trunk/src/lib/graphics/importer/oif/object_information_file.cc	(revision 10147)
@@ -0,0 +1,134 @@
+/*
+   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: Patrick Boenzli patrick@orxonox.net
+   co-programmer:
+*/
+
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
+
+#include "object_information_file.h"
+
+#include "resource_oif.h"
+
+#include "util/loading/factory.h"
+#include "util/loading/load_param_xml.h"
+
+
+/**
+ * constructor
+ * @param fileName name of the file
+ */
+OIFData::OIFData(const std::string& fileName)
+{
+  this->load(fileName);
+}
+
+
+/**
+ * loading the data
+ * @param fileName file name where the data can be found
+ */
+void OIFData::load(const std::string& fileName)
+{
+  //
+    if( fileName.empty())
+  {
+    PRINTF(3)("No filename specified for object information loading");
+    return;
+  }
+
+  TiXmlDocument XMLDoc(fileName);
+  // load the campaign document
+  if( !XMLDoc.LoadFile(fileName))
+  {
+    // report an error
+    PRINTF(3)("Could not load XML File %s: %s @ %d:%d\n", fileName.c_str(), XMLDoc.ErrorDesc(), XMLDoc.ErrorRow(), XMLDoc.ErrorCol());
+    return;
+  }
+
+  // check basic validity
+  TiXmlElement* root = XMLDoc.RootElement();
+  assert( root != NULL);
+
+  if( strcmp( root->Value(), "ObjectInformationFile"))
+  {
+    // report an error
+    PRINTF(2)("Specified XML File is not an orxonox object information file (<ObjectInformationFile> element missing)\n");
+    return;
+  }
+
+  // construct campaign
+//   return new Campaign( root);
+}
+
+
+
+/**
+ * standard constructor
+ */
+ObjectInformationFile::ObjectInformationFile()
+{
+  this->init();
+}
+
+/**
+ * constructor
+ * @param fileName name of the file
+ */
+ObjectInformationFile::ObjectInformationFile(const std::string& fileName)
+  : data(new OIFData(fileName))
+{
+  // load the oif file
+  this->data = ResourceOIF(fileName).data;
+
+  this->init();
+}
+
+
+/**
+ * copy constructor
+ * @param oif instance to copy from
+*/
+ObjectInformationFile::ObjectInformationFile(const ObjectInformationFile& oif)
+  :data(oif.data)
+{
+  this->init();
+}
+
+
+/**
+ * initizlizing function
+ */
+void ObjectInformationFile::init()
+{
+
+}
+
+
+/**
+ * standard deconstructor
+*/
+ObjectInformationFile::~ObjectInformationFile ()
+{
+  // delete what has to be deleted here
+}
+
+
+
+ObjectInformationFile& ObjectInformationFile::operator=(const ObjectInformationFile& oif)
+{
+  this->data = oif.data;
+  return *this;
+}
+
+
+
Index: trunk/src/lib/graphics/importer/oif/object_information_file.h
===================================================================
--- trunk/src/lib/graphics/importer/oif/object_information_file.h	(revision 10147)
+++ trunk/src/lib/graphics/importer/oif/object_information_file.h	(revision 10147)
@@ -0,0 +1,53 @@
+/*!
+ * @file object_information_file.h
+ * @brief Definition of a class that helps defining mount point connections
+*/
+
+#ifndef _OBJECT_INFORMATION_FILE_H
+#define _OBJECT_INFORMATION_FILE_H
+
+#include "base_object.h"
+
+#include "count_pointer.h"
+
+
+//! A class for object informations
+class OIFData : BaseObject
+{
+public:
+  typedef CountPointer<OIFData>    Pointer;
+
+
+public:
+  OIFData(const std::string& fileName);
+  virtual ~OIFData() {}
+
+  void load(const std::string& fileName);
+
+
+private:
+
+};
+
+//! A class for object informations
+class ObjectInformationFile : BaseObject
+{
+
+public:
+  ObjectInformationFile();
+  ObjectInformationFile(const ObjectInformationFile& oif);
+  ObjectInformationFile(const std::string& fileName);
+  virtual ~ObjectInformationFile();
+
+  ObjectInformationFile& operator=(const ObjectInformationFile& oif);
+
+  private:
+    void init();
+
+
+private:
+  CountPointer<OIFData>          data;                           //!< the oif data pointer
+
+};
+
+#endif /* _OBJECT_INFORMATION_FILE_H */
Index: trunk/src/lib/graphics/importer/oif/resource_oif.cc
===================================================================
--- trunk/src/lib/graphics/importer/oif/resource_oif.cc	(revision 10147)
+++ trunk/src/lib/graphics/importer/oif/resource_oif.cc	(revision 10147)
@@ -0,0 +1,66 @@
+/*
+   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: Patrick Boenzli patrick@orxonox.net
+   co-programmer:
+*/
+
+#include "resource_oif.h"
+
+#include "substring.h"
+#include "multi_type.h"
+#include "debug.h"
+
+
+ResourceOIF::ResourceOIF(const std::string& fileName, const Resources::KeepLevel& keepLevel)
+    : Resource(&ResourceOIF::type)
+{
+  Resources::StorePointer* ptr = this->acquireResource(fileName);
+
+  if (ptr)
+  {
+    PRINTF(0)("FOUND OIF: %s\n", fileName.c_str());
+    //this->acquireData(static_cast<ResourceOIF::OIFResourcePointer*>(ptr)->ptr());
+  }
+  else
+  {
+    PRINTF(4)("NOT FOUND OIF: %s\n", fileName.c_str());
+//     std::string modelFileName = this->Resource::locateFile(modelName);
+//     //std::string skinFileName = this->Resource::locateFile(skinName);
+//     this->MD2Model::load(modelFileName, skinName, scale);
+//     this->Resource::addResource(new ResourceOIF::OIFResourcePointer(loadString(modelName, skinName, scale), keepLevel, this->MD2Model::dataPointer()));
+  }
+
+}
+
+ResourceOIF ResourceOIF::createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel)
+{
+  SubString loadValues(loadString, ',');
+  std::string fileName;
+  if (loadValues.size() > 0)
+    fileName = loadValues[0];
+
+  return ResourceOIF(fileName);
+}
+
+
+
+Resources::tType<ResourceOIF> ResourceOIF::type("OIF");
+
+
+
+
+
+ResourceOIF::OIFResourcePointer::OIFResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const OIFData::Pointer& data)
+    : Resources::StorePointer(loadString, keepLevel) , pointer(data)
+{}
+
+
Index: trunk/src/lib/graphics/importer/oif/resource_oif.h
===================================================================
--- trunk/src/lib/graphics/importer/oif/resource_oif.h	(revision 10147)
+++ trunk/src/lib/graphics/importer/oif/resource_oif.h	(revision 10147)
@@ -0,0 +1,37 @@
+/*!
+ * @file resource_oif.h
+ * @brief Contains the ResourceOIF class, that handles the Resource-specific loading part of the OIF.
+ *
+ */
+
+#ifndef _RESOURCE_OIF_H
+#define _RESOURCE_OIF_H
+
+#include "util/loading/resource.h"
+#include "object_information_file.h"
+
+
+class ResourceOIF : public ObjectInformationFile, public Resources::Resource
+{
+public:
+  ResourceOIF(const std::string& fileName, const Resources::KeepLevel& keepLevel = Resources::KeepLevel());
+  static ResourceOIF createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel = Resources::KeepLevel());
+
+
+private:
+class OIFResourcePointer : public Resources::StorePointer
+  {
+  public:
+    OIFResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const OIFData::Pointer& data);
+    inline const OIFData::Pointer& ptr() const { return pointer; }
+    virtual bool last() const { return pointer.count() == 1; }
+  private:
+    OIFData::Pointer pointer;
+  };
+
+private:
+  static Resources::tType<ResourceOIF> type;
+};
+
+
+#endif /* _RESOURCE_OIF_H */
Index: trunk/src/lib/graphics/importer/static_model.cc
===================================================================
--- trunk/src/lib/graphics/importer/static_model.cc	(revision 10141)
+++ trunk/src/lib/graphics/importer/static_model.cc	(revision 10147)
@@ -91,4 +91,89 @@
   this->updateBase();
 }
+
+
+
+/**
+ * extract the mount points from this file: looking at each group and checking if the group realy is a mountpoint marker
+ * if so get place and orientation
+ */
+void StaticModel::extractMountPoints()
+{
+
+  // go through all groups and check if they are mounts
+  std::vector<StaticModelData::Group>::const_iterator groupIt = this->data->getGroups().begin();
+  for( ; groupIt != this->data->getGroups().end(); groupIt++)
+  {
+    //PRINTF(0)("Found a MountPoint: %s\n", groupName.c_str());
+
+    // get the name of this group and check if it's a mout point identifier
+    std::string groupName = (*groupIt).name;
+    std::vector<Vector> vertices;
+
+    if( groupName.find("MP.", 0) != std::string::npos)
+    {
+      PRINTF(0)("Found a MountPoint: %s\n", groupName.c_str());
+
+      // now check if it is a mount point identifier
+      if( this->data->getGroups().size() != 5) {
+        PRINTF(1)("the face count of %s is wrong, perhaps you missnamed this object or used the wrong mount point object\n", groupName.c_str());
+      }
+
+      // now extract the direction from the length:
+      std::vector<StaticModelData::Face>::const_iterator faceIt = (*groupIt)._faces.begin();
+      for( ; faceIt < (*groupIt)._faces.end(); faceIt++)
+      {
+        // now go through all modelfaceelements
+        std::vector<StaticModelData::FaceElement>::const_iterator faceElementIt = (*faceIt)._elements.begin();
+        for( ; faceElementIt < (*faceIt)._elements.end(); faceElementIt++)
+        {
+          int vert = (*faceElementIt).vertexNumber;
+          vertices.push_back(Vector(this->data->getVertices()[vert*3],
+                             this->data->getVertices()[vert*3 + 1],
+                             this->data->getVertices()[vert*3 + 2]));
+        }
+      }
+
+      // vertex with the max count is the up-point
+      std::vector<Vector>::const_iterator it = vertices.begin();
+      Vector tmpPoint;
+      int tmpCount;
+      Vector upPoint;
+      int maxCount = 0;
+      for( ; it < vertices.end(); it++)
+      {
+        tmpCount = 0;
+        tmpPoint = (*it);
+        //
+        std::vector<Vector>::const_iterator it2 = vertices.begin();
+        for( ; it2 < vertices.end(); it2++)
+          if( tmpPoint == *it2)
+            tmpCount++;
+
+        // if this is the vertex with the most surrounding vertices
+        if( tmpCount > maxCount)
+        {
+          upPoint = tmpPoint;
+          maxCount = tmpCount;
+        }
+      }
+
+      // now get the center of the object
+      Vector center;
+      it = vertices.begin();
+      for( ; it < vertices.end(); it++)
+        center += (*it);
+      // scale
+      center /= vertices.size();
+
+
+    }
+
+  }
+
+
+}
+
+
 
 /**
Index: trunk/src/lib/graphics/importer/static_model.h
===================================================================
--- trunk/src/lib/graphics/importer/static_model.h	(revision 10141)
+++ trunk/src/lib/graphics/importer/static_model.h	(revision 10147)
@@ -58,4 +58,5 @@
 
   void finalize();
+  void extractMountPoints();
 
   void acquireData(const StaticModelData::Pointer& data);
Index: trunk/src/lib/graphics/importer/static_model_data.cc
===================================================================
--- trunk/src/lib/graphics/importer/static_model_data.cc	(revision 10141)
+++ trunk/src/lib/graphics/importer/static_model_data.cc	(revision 10147)
@@ -276,11 +276,9 @@
 bool StaticModelData::addGroup(const std::string& groupString)
 {
-  PRINTF(5)("Read Group: %s.\n", groupString.c_str());
+  PRINTF(4)("Read Group: %s.\n", groupString.c_str());
   if (!_modelGroups.empty() && !_modelGroups.back()._faces.empty())
     _modelGroups.push_back(Group());
 
-  if (groupString == "default")
-    _modelGroups.back().name = groupString;
-  // setting the group name if not default.
+  _modelGroups.back().name = groupString;
   return true;
 }
Index: trunk/src/lib/graphics/importer/static_model_data.h
===================================================================
--- trunk/src/lib/graphics/importer/static_model_data.h	(revision 10141)
+++ trunk/src/lib/graphics/importer/static_model_data.h	(revision 10147)
@@ -129,4 +129,5 @@
   ///! HACK SOLUTION sTriangleExt should be const in the modelInfo.
   sTriangleExt* getTrianglesExt() { return &this->triangles[0]; };
+  const std::vector<Group>& getGroups() { return this->_modelGroups; }
 
   float getScaleFactor() const  { return scaleFactor; }
