Index: trunk/src/world_entities/WorldEntities.am
===================================================================
--- trunk/src/world_entities/WorldEntities.am	(revision 10114)
+++ trunk/src/world_entities/WorldEntities.am	(revision 10147)
@@ -24,4 +24,5 @@
                 world_entities/planet.cc \
                 world_entities/bsp_entity.cc \
+                world_entities/mount_point.cc \
                 \
                 world_entities/weapons/test_gun.cc \
@@ -127,4 +128,5 @@
                 planet.h \
                 bsp_entity.h \
+                mount_point.h \
                 \
                 weapons/test_gun.h \
Index: trunk/src/world_entities/mount_point.cc
===================================================================
--- trunk/src/world_entities/mount_point.cc	(revision 10147)
+++ trunk/src/world_entities/mount_point.cc	(revision 10147)
@@ -0,0 +1,131 @@
+/*
+   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_WORLD_ENTITY
+
+
+#include "executor/executor.h"
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+
+
+#include "mount_point.h"
+#include "debug.h"
+#include "state.h"
+
+
+ObjectListDefinition(MountPoint);
+CREATE_FACTORY(MountPoint);
+
+
+/**
+ * construct
+ */
+MountPoint::MountPoint ()
+{
+  this->init();
+}
+
+
+/**
+ * constructor
+ * @param root the xml root element
+ */
+MountPoint::MountPoint(const TiXmlElement* root)
+{
+  this->init();
+
+  if( root != NULL)
+    this->loadParams(root);
+}
+
+
+/**
+ * deconstructor
+ */
+MountPoint::~MountPoint ()
+{}
+
+
+/**
+ * initializing function
+ */
+void MountPoint::init()
+{
+  this->registerObject(this, MountPoint::_objectList);
+  this->toList(OM_GROUP_00);
+
+  this->_mount = NULL;
+}
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void MountPoint::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+}
+
+
+
+/**
+ * tick
+ * @param time  time passed since the last tick
+ */
+void MountPoint::tick (float time)
+{
+
+
+}
+
+
+/**
+ * draw this entity
+ */
+void MountPoint::draw() const
+{
+
+}
+
+
+
+/**
+ *  function called to draw the mount point itself for debug purposes only
+ */
+void MountPoint::debugDraw() const
+{
+
+}
+
+
+/**
+ * adds an entity to this mount point
+ * @param entity entity to be added
+ */
+void MountPoint::mount(WorldEntity* entity)
+{
+  this->_mount = entity;
+}
+
+
+/**
+ * removes an entity from this mount point
+ */
+void MountPoint::unmount()
+{
+  this->_mount = NULL;
+}
+
Index: trunk/src/world_entities/mount_point.h
===================================================================
--- trunk/src/world_entities/mount_point.h	(revision 10147)
+++ trunk/src/world_entities/mount_point.h	(revision 10147)
@@ -0,0 +1,37 @@
+#ifndef _MOUNT_POINT_H
+#define _MOUNT_POINT_H
+
+#include "world_entity.h"
+
+class TiXmlElement;
+
+
+class MountPoint : public WorldEntity
+{
+    ObjectListDeclaration(MountPoint);
+
+  public:
+    MountPoint ();
+    MountPoint(const TiXmlElement* root);
+    virtual ~MountPoint ();
+
+    void init();
+    virtual void loadParams(const TiXmlElement* root);
+
+
+    virtual void tick (float time);
+    virtual void draw() const;
+
+    void debugDraw() const;
+
+
+    void mount(WorldEntity* entity);
+    void unmount();
+
+
+  private:
+    WorldEntity*         _mount;       //!< the entity mounted at this mount point
+
+};
+
+#endif /* _MOUNT_POINT_H */
Index: trunk/src/world_entities/npcs/npc_test.cc
===================================================================
--- trunk/src/world_entities/npcs/npc_test.cc	(revision 10114)
+++ trunk/src/world_entities/npcs/npc_test.cc	(revision 10147)
@@ -39,8 +39,8 @@
   this->registerObject(this, NPC2::_objectList);
 
-  if ((float)rand()/RAND_MAX > .5f)
-    this->loadModel("models/ships/bolido.obj", 6);
-  else
-    this->loadModel("models/ships/gobblin.obj", 6);
+//   if ((float)rand()/RAND_MAX > .5f)
+//     this->loadModel("models/ships/bolido.obj", 6);
+//   else
+//     this->loadModel("models/ships/gobblin.obj", 6);
 
 
@@ -84,29 +84,30 @@
  * Just override this function with whatever you want to be drawn.
  */
-void NPC2::draw() const
-{
-  glMatrixMode(GL_MODELVIEW);
-  glPushMatrix();
-  float matrix[4][4];
-
-  /* translate */
-  glTranslatef (this->getAbsCoor ().x,
-                this->getAbsCoor ().y,
-                this->getAbsCoor ().z);
-  /* rotate */
-  this->getAbsDir ().matrix (matrix);
-  glMultMatrixf((float*)matrix);
-
-//   if (this->shader != NULL && this->shader != Shader::getActiveShader())
-//     shader->activateShader();
-
-  this->getModel()->draw();
-//   shader->deactivateShader();
-
-
-/*  if (this->model)
-    this->model->draw();*/
-  glPopMatrix();
-}
+// void NPC2::draw() const
+// {
+//   glMatrixMode(GL_MODELVIEW);
+//   glPushMatrix();
+//   float matrix[4][4];
+//
+//   /* translate */
+//   glTranslatef (this->getAbsCoor ().x,
+//                 this->getAbsCoor ().y,
+//                 this->getAbsCoor ().z);
+//   /* rotate */
+//   this->getAbsDir ().matrix (matrix);
+//   glMultMatrixf((float*)matrix);
+//
+// //   if (this->shader != NULL && this->shader != Shader::getActiveShader())
+// //     shader->activateShader();
+//
+//   if( this->getModel())
+//     this->getModel()->draw();
+// //   shader->deactivateShader();
+//
+//
+// /*  if (this->model)
+//     this->model->draw();*/
+//   glPopMatrix();
+// }
 
 
Index: trunk/src/world_entities/npcs/npc_test.h
===================================================================
--- trunk/src/world_entities/npcs/npc_test.h	(revision 10114)
+++ trunk/src/world_entities/npcs/npc_test.h	(revision 10147)
@@ -22,5 +22,5 @@
 
   virtual void tick(float dt);
-  virtual void draw() const;
+//   virtual void draw() const;
 
  private:
Index: trunk/src/world_entities/world_entity.cc
===================================================================
--- trunk/src/world_entities/world_entity.cc	(revision 10114)
+++ trunk/src/world_entities/world_entity.cc	(revision 10147)
@@ -12,6 +12,6 @@
 
    ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer: Christian Meyer
+   main-programmer: Patrick Boenzli, Benjamin Grauer
+   co-programmer: Christian Meier
 */
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
@@ -24,4 +24,7 @@
 #include "md2/md2Model.h"
 #include "md3/md3_model.h"
+
+#include "oif/object_information_file.h"
+#include "mount_point.h"
 
 #include "aabb_tree_node.h"
@@ -69,4 +72,5 @@
   this->damage = 0.0f; // no damage dealt by a default entity
   this->scaling = 1.0f;
+  this->oiFile = NULL;
 
   /* OSOLETE */
@@ -103,4 +107,10 @@
   for (unsigned int i = 0; i < this->models.size(); i++)
     this->setModel(NULL, i);
+
+  // remove the object information file
+  if( this->oiFile)
+    delete this->oiFile;
+  // and clear all monut points
+  this->mountPoints.clear();
 
   // Delete the obbTree
@@ -191,4 +201,5 @@
     {
       PRINTF(4)("fetching OBJ file: %s\n", fileName.c_str());
+      // creating the model and loading it
       StaticModel* model = new StaticModel();
       *model = ResourceOBJ(fileName, this->scaling);
@@ -201,4 +212,8 @@
       else
         delete model;
+
+      // now get the object information file for this model, if any
+      std::string oifName = fileName.substr(0, fileName.length() - 4) + ".oif";
+      this->loadObjectInformationFile( oifName);
     }
     /// LOADING AN MD2-model
@@ -249,4 +264,17 @@
 
 
+
+/**
+ * loads the object information file for this model
+ * @param fileName the name of the file
+ */
+void WorldEntity::loadObjectInformationFile(const std::string& fileName)
+{
+  PRINTF(4)("loading the oif File: %s\n", fileName.c_str());
+
+  this->oiFile = new ObjectInformationFile(fileName);
+}
+
+
 /**
  * builds the obb-tree
@@ -290,4 +318,64 @@
   }
   return true;
+}
+
+
+/**
+ * adds a mount point to the end of the list
+ * @param mountPoint point to be added
+ */
+void WorldEntity::addMountPoint(MountPoint* mountPoint)
+{
+  // add the mount point at the last position
+  this->mountPoints.push_back(mountPoint);
+}
+
+/**
+ * adds a mount point to a world entity
+ * @param mountPoint point to be added
+ */
+void WorldEntity::addMountPoint(int slot, MountPoint* mountPoint)
+{
+  if( this->mountPoints[slot] != NULL)
+  {
+    PRINTF(0)("adding a mount point to a slot, that already exists! ignoring - maybe some object do not get connected well (object: %s)\n", this->getClassCName());
+  }
+
+  // just connect the mount point
+  this->mountPoints[slot] = mountPoint;
+}
+
+
+/**
+ * mounts a world entity on a specified mount point (~socket)
+ * @param entity entity to be connected
+ */
+void WorldEntity::mount(int slot, WorldEntity* entity)
+{
+  if( this->mountPoints[slot] == NULL)
+  {
+    PRINTF(0)("you tried to add an entity to a mount point that doesn't exist (slot %i)\n", slot);
+    return;
+  }
+
+  // mount the entity
+  this->mountPoints[slot]->mount(entity);
+}
+
+
+/**
+ * removes a mount point from a specified mount point
+ * @param mountPoint entity to be unconnected
+ */
+void WorldEntity::unmount(int slot)
+{
+    if( this->mountPoints[slot] == NULL)
+  {
+    PRINTF(0)("you tried to remove an entity from a mount point that doesn't exist (slot %i)\n", slot);
+    return;
+  }
+
+  // unmount the entity
+  this->mountPoints[slot]->unmount();
 }
 
Index: trunk/src/world_entities/world_entity.h
===================================================================
--- trunk/src/world_entities/world_entity.h	(revision 10114)
+++ trunk/src/world_entities/world_entity.h	(revision 10147)
@@ -15,10 +15,10 @@
 #include "object_manager.h"
 #include "glincl.h"
+
+#include "aabb_tree_node.h"
+
+#include "physics_interface.h"
+
 #include <vector>
-
-#include "aabb_tree_node.h"
-
-#include "physics_interface.h"
-
 
 
@@ -33,4 +33,7 @@
 class Model;
 
+class ObjectInformationFile;
+class MountPoint;
+
 
 //! Basis-class all interactive stuff in the world is derived from
@@ -50,5 +53,11 @@
   Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
 
+  void loadObjectInformationFile(const std::string& fileName);
   inline void loadMD2Texture(const std::string& fileName) { this->md2TextureFileName = fileName; }
+
+  void addMountPoint(MountPoint* mountPoint);
+  void addMountPoint(int slot, MountPoint* mountPoint);
+  void mount(int slot, WorldEntity* entity);
+  void unmount(int slot);
 
   /** @param visibility if the Entity should be visible (been draw) */
@@ -185,4 +194,6 @@
 
   std::vector<Model*>     models;             //!< The model that should be loaded for this entity.
+  ObjectInformationFile*  oiFile;             //!< Reference to the object information file discribing the model of this WE
+  std::vector<MountPoint*> mountPoints;       //!< A list with mount points for this model
   std::string             md2TextureFileName; //!< the file name of the md2 model texture, only if this
   std::string             modelLODName;       //!< the name of the model lod file
