Index: branches/mount_points/src/lib/graphics/importer/static_model.cc
===================================================================
--- branches/mount_points/src/lib/graphics/importer/static_model.cc	(revision 10182)
+++ branches/mount_points/src/lib/graphics/importer/static_model.cc	(revision 10183)
@@ -45,5 +45,5 @@
 
 StaticModel::StaticModel(const StaticModel& staticModel)
-  : data(staticModel.data)
+    : data(staticModel.data)
 {
   this->registerObject(this, StaticModel::_objectList);
@@ -112,89 +112,91 @@
     std::vector<Vector> vertices;
 
-    if( groupName.find("MP.", 0) != std::string::npos)
+    // check if the name has a "MP" prefix or else it won't work
+    if( groupName.find("MP.", 0) == std::string::npos)
+      continue;
+
+
+    PRINTF(0)("Found a MountPoint: %s\n", groupName.c_str());
+
+    // now check if it is a mount point identifier
+    if( (*groupIt)._faces.size() != 6)
     {
-      PRINTF(0)("Found a MountPoint: %s\n", groupName.c_str());
-
-      // now check if it is a mount point identifier
-      if( (*groupIt)._faces.size() != 6) {
-        PRINTF(1)("the face count of %s is wrong, perhaps you missnamed this object or used the wrong mount point object (got %i faces)\n",
-                  groupName.c_str(), (*groupIt)._faces.size());
+      PRINTF(1)("the face count of %s is wrong, perhaps you missnamed this object or used the wrong mount point object (got %i faces)\n",
+                groupName.c_str(), (*groupIt)._faces.size());
+    }
+
+    // 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]));
       }
-
-      // now extract the direction from the length:
-      std::vector<StaticModelData::Face>::const_iterator faceIt = (*groupIt)._faces.begin();
-      for( ; faceIt < (*groupIt)._faces.end(); faceIt++)
+    }
+
+    // vertex with the max surrounding faces is the up-point (pyramid like object)
+    std::vector<Vector>::const_iterator it = vertices.begin();
+    Vector tmpPoint;
+    int tmpCount;
+    Vector up;
+    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)
       {
-        // 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]));
-        }
+        up = tmpPoint;
+        maxCount = tmpCount;
       }
-
-      // vertex with the max surrounding faces is the up-point (pyramid like object)
-      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 longest side of the first face, this will be the forward vector
-      Vector forward;
-      Vector side1 = vertices[0] - vertices[1];
-      Vector side2 = vertices[1] - vertices[2];
-      Vector side3 = vertices[2] - vertices[3];
-
-      if( fabs(side1.len()) > fabs(side2.len()) && fabs(side1.len()) > fabs(side3.len()))
-        forward = side1;
-      else if( fabs(side2.len()) > fabs(side1.len()) && fabs(side2.len()) > fabs(side3.len()))
-        forward = side2;
-      else if( fabs(side3.len()) > fabs(side1.len()) && fabs(side3.len()) > fabs(side2.len()))
-        forward = side3;
-
-      // now get the center of the object
-      Vector center;
-      it = vertices.begin();
-      for( ; it < vertices.end(); it++)
-        center += (*it);
-      // scale
-      center /= vertices.size();
-
-      PRINTF(0)("Up Point\n");
-      upPoint.debug();
-
-      PRINTF(0)("Center\n");
-      center.debug();
-
-      PRINTF(0)("Forward\n");
-      forward.debug();
-
     }
 
+
+    // now get the longest side of the first face, this will be the forward vector
+    Vector forward;
+    Vector side1 = vertices[0] - vertices[1];
+    Vector side2 = vertices[1] - vertices[2];
+    Vector side3 = vertices[2] - vertices[3];
+
+    if( fabs(side1.len()) > fabs(side2.len()) && fabs(side1.len()) > fabs(side3.len()))
+      forward = side1;
+    else if( fabs(side2.len()) > fabs(side1.len()) && fabs(side2.len()) > fabs(side3.len()))
+      forward = side2;
+    else if( fabs(side3.len()) > fabs(side1.len()) && fabs(side3.len()) > fabs(side2.len()))
+      forward = side3;
+
+    // now get the center of the object
+    Vector center;
+    it = vertices.begin();
+    for( ; it < vertices.end(); it++)
+      center += (*it);
+    // scale
+    center /= vertices.size();
+
+    PRINTF(0)("Up Point\n");
+    up.debug();
+
+    PRINTF(0)("Center\n");
+    center.debug();
+
+    PRINTF(0)("Forward\n");
+    forward.debug();
+
+    // now add the mount point
+    this->addMountPoint( up, forward, center);
   }
-
-
 }
 
