Index: /branches/single_player_map/src/defs/class_id.h
===================================================================
--- /branches/single_player_map/src/defs/class_id.h	(revision 8926)
+++ /branches/single_player_map/src/defs/class_id.h	(revision 8927)
@@ -188,4 +188,7 @@
   CL_SKYDOME                    =    0x00000313,
   CL_DOOR                       =    0x00000314,
+  CL_REPAIR_STATION             =    0x00000315,
+  CL_CRANE                      =    0x00000316,
+  CL_BRAKING_WALL               =    0X00000317,
 
   // Playables
Index: /branches/single_player_map/src/lib/collision_reaction/cr_physics_ground_walk.cc
===================================================================
--- /branches/single_player_map/src/lib/collision_reaction/cr_physics_ground_walk.cc	(revision 8926)
+++ /branches/single_player_map/src/lib/collision_reaction/cr_physics_ground_walk.cc	(revision 8927)
@@ -87,5 +87,5 @@
     Vector normal = ce->getGroundNormal();
 
-    // collision position maths
+    // calculate the collision position
     Vector collPos =  collision->getEntityB()->getAbsCoor()  + box->center - ce->getCollisionPosition();
 
@@ -98,6 +98,6 @@
         front = collPos.x - box->halfLength[0];
 
-        PRINTF(0)("front: %f\n", front);
-        PRINTF(0)("in wall %i\n", ce->isInWall());
+//         PRINTF(0)("front: %f\n", front);
+//         PRINTF(0)("in wall %i\n", ce->isInWall());
 
         // object is beneath the plane (ground)
@@ -119,6 +119,6 @@
         height = collPos.y - box->halfLength[1];
 
-        PRINTF(0)("height: %f\n", height);
-        PRINTF(0)("in wall %i\n", ce->isInWall());
+//         PRINTF(0)("height: %f\n", height);
+//         PRINTF(0)("in wall %i\n", ce->isInWall());
 
         // object is beneath the plane (ground)
@@ -140,6 +140,6 @@
         side = collPos.z - box->halfLength[2];
 
-        PRINTF(0)("side: %f\n", side);
-        PRINTF(0)("in wall %i\n", ce->isInWall());
+//         PRINTF(0)("side: %f\n", side);
+//         PRINTF(0)("in wall %i\n", ce->isInWall());
 
         // object is beneath the plane (ground)
@@ -155,4 +155,5 @@
         break;
     }
+    PRINTF(0)("collision distanzes: x: %f, y: %f, z: %f\n", front, height, side);
   }
 
Index: /branches/single_player_map/src/world_entities/WorldEntities.am
===================================================================
--- /branches/single_player_map/src/world_entities/WorldEntities.am	(revision 8926)
+++ /branches/single_player_map/src/world_entities/WorldEntities.am	(revision 8927)
@@ -5,4 +5,5 @@
                 world_entities/npcs/ground_turret.cc \
                 world_entities/npcs/generic_npc.cc \
+                world_entities/npcs/door.cc \
                 \
                 world_entities/environment.cc \
@@ -16,5 +17,4 @@
                 world_entities/character_attributes.cc \
                 world_entities/test_entity.cc \
-                world_entities/door.cc \
                 world_entities/planet.cc \
                 world_entities/bsp_entity.cc \
@@ -66,4 +66,6 @@
                 npcs/npc_test1.h \
                 npcs/ground_turret.h \
+                npcs/door.cc \
+                \
                 environment.h \
                 skysphere.h \
@@ -76,5 +78,4 @@
                 character_attributes.h \
                 test_entity.h \
-                door.h \
                 planet.h \
                 bsp_entity.h \
Index: anches/single_player_map/src/world_entities/door.cc
===================================================================
--- /branches/single_player_map/src/world_entities/door.cc	(revision 8926)
+++ 	(revision )
@@ -1,200 +1,0 @@
-
-
-/*
-   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
-   co-programmer:
-*/
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
-
-
-#include "util/loading/factory.h"
-#include "util/loading/load_param.h"
-
-#include "interactive_model.h"
-
-
-#include "door.h"
-#include "class_list.h"
-
-
-using namespace std;
-
-
-CREATE_FACTORY(Door, CL_DOOR);
-
-
-
-//! list of all different animations a std md2model supports
-sAnim Door::animationList[2] =
-{
- // begin, end, fps, interruptable
-  {   0,  15,  30,  0 },   //!< OPEN
-  {   15, 29,  30,  0 }    //!< CLOSE
-};
-
-
-
-Door::Door ()
-{
-  this->init();
-}
-
-
-Door::Door(const TiXmlElement* root)
-{
-
-  this->setClassID(CL_DOOR, "Door");
-  this->scale = 1.0f;
-
-  if( root != NULL)
-    this->loadParams(root);
-
-  this->toList(OM_COMMON);
-  this->bLocked = false;
-
-  this->loadMD2Texture("maps/doors.jpg");
-  this->loadModel("models/creatures/doors.md2", this->scale);
-
-  this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
-}
-
-
-Door::~Door ()
-{}
-
-
-
-/**
- * loads the Settings of a MD2Creature from an XML-element.
- * @param root the XML-element to load the MD2Creature's properties from
- */
-void Door::loadParams(const TiXmlElement* root)
-{
-  WorldEntity::loadParams(root);
-
-  LoadParam(root, "action-radius", this, Door, setActionRadius)
-      .describe("sets the action radius of the door")
-      .defaultValues(3.0);
-  LoadParam(root, "scale", this, Door, setScale)
-      .describe("sets the scale of the door")
-      .defaultValues(1.0);
-}
-
-
-/**
- * sets the animatin of this entity
- */
-void  Door::setAnimation(int animNum, int playbackMode)
-{
-  if( likely(this->getModel(0) != NULL))
-    ((InteractiveModel*)this->getModel(0))->setAnimation(animationList[animNum].firstFrame,
-                                                         animationList[animNum].lastFrame,
-                                                         animationList[animNum].fps,
-                                                         animationList[animNum].bStoppable,
-                                                         playbackMode);
-}
-
-
-/**
- * ticks the door
- * @param time: time since last tick
- */
-void Door::tick (float time)
-{
-  if( likely(this->getModel(0) != NULL))
-    ((InteractiveModel*)this->getModel(0))->tick(time);
-
-  if( !this->bOpen)
-  {
-    if( this->checkOpen())
-    {
-      this->open();
-    }
-  }
-  else
-  {
-    if( !this->checkOpen())
-    {
-      this->close();
-    }
-  }
-
-}
-
-
-/**
- * open the door
- */
-void Door::open()
-{
-  if( this->bLocked)
-    return;
-
-  this->setAnimation(DOOR_OPEN, MD2_ANIM_ONCE);
-  this->bOpen = true;
-}
-
-
-/**
- * close the door
- */
-void Door::close()
-{
-  this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
-  this->bOpen = false;
-}
-
-
-
-/**
- * checks if the door is open
- */
-bool Door::checkOpen()
-{
-
-  std::list<BaseObject*>::const_iterator it;
-  const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);
-  WorldEntity* entity;
-  float distance;
-
-  if( list == NULL)
-    return false;
-
-  // for all players
-  for( it = list->begin(); it != list->end(); it++)
-  {
-    entity = dynamic_cast<WorldEntity*>(*it);
-
-    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
-    if( distance < this->actionRadius)
-      return true;
-  }
-
-
-  list = ClassList::getList(CL_GENERIC_NPC);
-  if( list == NULL)
-    return false;
-  for( it = list->begin(); it != list->end(); it++)
-  {
-    entity = dynamic_cast<WorldEntity*>(*it);
-
-    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
-    if( distance < this->actionRadius)
-      return true;
-  }
-
-  return false;
-}
-
-
-
Index: anches/single_player_map/src/world_entities/door.h
===================================================================
--- /branches/single_player_map/src/world_entities/door.h	(revision 8926)
+++ 	(revision )
@@ -1,60 +1,0 @@
-#ifndef _DOOR_H
-#define _DOOR_H
-
-#include "world_entity.h"
-
-#include "md2/md2Model.h"
-
-class TiXmlElement;
-
-
-//! animation names enumeration
-typedef enum DoorAnimType
-{
-  DOOR_OPEN = 0,
-  DOOR_CLOSE,
-
-  DOOR_MAX_ANIMATIONS
-};
-
-
-class Door : public WorldEntity
-{
-  public:
-    Door ();
-    Door(const TiXmlElement* root);
-    virtual ~Door ();
-
-    virtual void loadParams(const TiXmlElement* root);
-
-    void setActionRadius(float radius) { this->actionRadius = radius; }
-    void setScale(float scale) { this->scale = scale; }
-
-    void open();
-    void close();
-
-    void lock() { this->bLocked = true; }
-    void unlock() { this->bLocked = false; }
-    bool isLocked() const { return this->bLocked; }
-
-
-    virtual void tick (float time);
-
-
-  private:
-    bool checkOpen();
-    void setAnimation(int animNum, int playbackMode = 0);
-
-
-  private:
-    bool           bOpen;             //!< true if the door is open
-    bool           bLocked;           //!< true if this door is locked
-    float          actionRadius;      //!< action radius
-    float          scale;             //!< the scale of the model
-
-    static sAnim   animationList[2];  //!< list of the animations
-
-
-};
-
-#endif /* _DOOR_H */
Index: /branches/single_player_map/src/world_entities/npcs/door.cc
===================================================================
--- /branches/single_player_map/src/world_entities/npcs/door.cc	(revision 8927)
+++ /branches/single_player_map/src/world_entities/npcs/door.cc	(revision 8927)
@@ -0,0 +1,200 @@
+
+
+/*
+   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
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+
+#include "interactive_model.h"
+
+
+#include "door.h"
+#include "class_list.h"
+
+
+using namespace std;
+
+
+CREATE_FACTORY(Door, CL_DOOR);
+
+
+
+//! list of all different animations a std md2model supports
+sAnim Door::animationList[2] =
+{
+ // begin, end, fps, interruptable
+  {   0,  15,  30,  0 },   //!< OPEN
+  {   15, 29,  30,  0 }    //!< CLOSE
+};
+
+
+
+Door::Door ()
+{
+  this->init();
+}
+
+
+Door::Door(const TiXmlElement* root)
+{
+
+  this->setClassID(CL_DOOR, "Door");
+  this->scale = 1.0f;
+
+  if( root != NULL)
+    this->loadParams(root);
+
+  this->toList(OM_COMMON);
+  this->bLocked = false;
+
+  this->loadMD2Texture("maps/doors.jpg");
+  this->loadModel("models/creatures/doors.md2", this->scale);
+
+  this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
+}
+
+
+Door::~Door ()
+{}
+
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void Door::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "action-radius", this, Door, setActionRadius)
+      .describe("sets the action radius of the door")
+      .defaultValues(3.0);
+  LoadParam(root, "scale", this, Door, setScale)
+      .describe("sets the scale of the door")
+      .defaultValues(1.0);
+}
+
+
+/**
+ * sets the animatin of this entity
+ */
+void  Door::setAnimation(int animNum, int playbackMode)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->setAnimation(animationList[animNum].firstFrame,
+                                                         animationList[animNum].lastFrame,
+                                                         animationList[animNum].fps,
+                                                         animationList[animNum].bStoppable,
+                                                         playbackMode);
+}
+
+
+/**
+ * ticks the door
+ * @param time: time since last tick
+ */
+void Door::tick (float time)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->tick(time);
+
+  if( !this->bOpen)
+  {
+    if( this->checkOpen())
+    {
+      this->open();
+    }
+  }
+  else
+  {
+    if( !this->checkOpen())
+    {
+      this->close();
+    }
+  }
+
+}
+
+
+/**
+ * open the door
+ */
+void Door::open()
+{
+  if( this->bLocked)
+    return;
+
+  this->setAnimation(DOOR_OPEN, MD2_ANIM_ONCE);
+  this->bOpen = true;
+}
+
+
+/**
+ * close the door
+ */
+void Door::close()
+{
+  this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
+  this->bOpen = false;
+}
+
+
+
+/**
+ * checks if the door is open
+ */
+bool Door::checkOpen()
+{
+
+  std::list<BaseObject*>::const_iterator it;
+  const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);
+  WorldEntity* entity;
+  float distance;
+
+  if( list == NULL)
+    return false;
+
+  // for all players
+  for( it = list->begin(); it != list->end(); it++)
+  {
+    entity = dynamic_cast<WorldEntity*>(*it);
+
+    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
+    if( distance < this->actionRadius)
+      return true;
+  }
+
+
+  list = ClassList::getList(CL_GENERIC_NPC);
+  if( list == NULL)
+    return false;
+  for( it = list->begin(); it != list->end(); it++)
+  {
+    entity = dynamic_cast<WorldEntity*>(*it);
+
+    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
+    if( distance < this->actionRadius)
+      return true;
+  }
+
+  return false;
+}
+
+
+
Index: /branches/single_player_map/src/world_entities/npcs/door.h
===================================================================
--- /branches/single_player_map/src/world_entities/npcs/door.h	(revision 8927)
+++ /branches/single_player_map/src/world_entities/npcs/door.h	(revision 8927)
@@ -0,0 +1,60 @@
+#ifndef _DOOR_H
+#define _DOOR_H
+
+#include "world_entity.h"
+
+#include "md2/md2Model.h"
+
+class TiXmlElement;
+
+
+//! animation names enumeration
+typedef enum DoorAnimType
+{
+  DOOR_OPEN = 0,
+  DOOR_CLOSE,
+
+  DOOR_MAX_ANIMATIONS
+};
+
+
+class Door : public WorldEntity
+{
+  public:
+    Door ();
+    Door(const TiXmlElement* root);
+    virtual ~Door ();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    void setActionRadius(float radius) { this->actionRadius = radius; }
+    void setScale(float scale) { this->scale = scale; }
+
+    void open();
+    void close();
+
+    void lock() { this->bLocked = true; }
+    void unlock() { this->bLocked = false; }
+    bool isLocked() const { return this->bLocked; }
+
+
+    virtual void tick (float time);
+
+
+  private:
+    bool checkOpen();
+    void setAnimation(int animNum, int playbackMode = 0);
+
+
+  private:
+    bool           bOpen;             //!< true if the door is open
+    bool           bLocked;           //!< true if this door is locked
+    float          actionRadius;      //!< action radius
+    float          scale;             //!< the scale of the model
+
+    static sAnim   animationList[2];  //!< list of the animations
+
+
+};
+
+#endif /* _DOOR_H */
Index: /branches/single_player_map/src/world_entities/npcs/repair_station.cc
===================================================================
--- /branches/single_player_map/src/world_entities/npcs/repair_station.cc	(revision 8927)
+++ /branches/single_player_map/src/world_entities/npcs/repair_station.cc	(revision 8927)
@@ -0,0 +1,200 @@
+
+
+/*
+   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
+   co-programmer:
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
+
+#include "util/loading/factory.h"
+#include "util/loading/load_param.h"
+
+#include "interactive_model.h"
+
+
+#include "repair_station.h"
+#include "class_list.h"
+
+
+using namespace std;
+
+
+CREATE_FACTORY(RepairStation, CL_DOOR);
+
+
+
+//! list of all different animations a std md2model supports
+sAnim RepairStation::animationList[2] =
+{
+ // begin, end, fps, interruptable
+  {   0,  10,  30,  0 },   //!< OPEN
+  {   10, 20,  30,  0 }    //!< CLOSE
+};
+
+
+
+RepairStation::RepairStation ()
+{
+  this->init();
+}
+
+
+RepairStation::RepairStation(const TiXmlElement* root)
+{
+
+  this->setClassID(CL_DOOR, "RepairStation");
+  this->scale = 1.0f;
+
+  if( root != NULL)
+    this->loadParams(root);
+
+  this->toList(OM_COMMON);
+  this->bLocked = false;
+
+  this->loadMD2Texture("maps/doors.jpg");
+  this->loadModel("models/creatures/doors.md2", this->scale);
+
+  this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
+}
+
+
+RepairStation::~RepairStation ()
+{}
+
+
+
+/**
+ * loads the Settings of a MD2Creature from an XML-element.
+ * @param root the XML-element to load the MD2Creature's properties from
+ */
+void RepairStation::loadParams(const TiXmlElement* root)
+{
+  WorldEntity::loadParams(root);
+
+  LoadParam(root, "action-radius", this, RepairStation, setActionRadius)
+      .describe("sets the action radius of the door")
+      .defaultValues(3.0);
+  LoadParam(root, "scale", this, RepairStation, setScale)
+      .describe("sets the scale of the door")
+      .defaultValues(1.0);
+}
+
+
+/**
+ * sets the animatin of this entity
+ */
+void  RepairStation::setAnimation(int animNum, int playbackMode)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->setAnimation(animationList[animNum].firstFrame,
+                                                         animationList[animNum].lastFrame,
+                                                         animationList[animNum].fps,
+                                                         animationList[animNum].bStoppable,
+                                                         playbackMode);
+}
+
+
+/**
+ * ticks the door
+ * @param time: time since last tick
+ */
+void RepairStation::tick (float time)
+{
+  if( likely(this->getModel(0) != NULL))
+    ((InteractiveModel*)this->getModel(0))->tick(time);
+
+  if( !this->bOpen)
+  {
+    if( this->checkOpen())
+    {
+      this->open();
+    }
+  }
+  else
+  {
+    if( !this->checkOpen())
+    {
+      this->close();
+    }
+  }
+
+}
+
+
+/**
+ * open the door
+ */
+void RepairStation::open()
+{
+  if( this->bLocked)
+    return;
+
+  this->setAnimation(DOOR_OPEN, MD2_ANIM_ONCE);
+  this->bOpen = true;
+}
+
+
+/**
+ * close the door
+ */
+void RepairStation::close()
+{
+  this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
+  this->bOpen = false;
+}
+
+
+
+/**
+ * checks if the door is open
+ */
+bool RepairStation::checkOpen()
+{
+
+  std::list<BaseObject*>::const_iterator it;
+  const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);
+  WorldEntity* entity;
+  float distance;
+
+  if( list == NULL)
+    return false;
+
+  // for all players
+  for( it = list->begin(); it != list->end(); it++)
+  {
+    entity = dynamic_cast<WorldEntity*>(*it);
+
+    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
+    if( distance < this->actionRadius)
+      return true;
+  }
+
+
+  list = ClassList::getList(CL_GENERIC_NPC);
+  if( list == NULL)
+    return false;
+  for( it = list->begin(); it != list->end(); it++)
+  {
+    entity = dynamic_cast<WorldEntity*>(*it);
+
+    distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len());
+    if( distance < this->actionRadius)
+      return true;
+  }
+
+  return false;
+}
+
+
+
Index: /branches/single_player_map/src/world_entities/npcs/repair_station.h
===================================================================
--- /branches/single_player_map/src/world_entities/npcs/repair_station.h	(revision 8927)
+++ /branches/single_player_map/src/world_entities/npcs/repair_station.h	(revision 8927)
@@ -0,0 +1,60 @@
+#ifndef _REPAIR_STATION_H
+#define _REPAIR_STATION_H
+
+#include "world_entity.h"
+
+#include "md2/md2Model.h"
+
+class TiXmlElement;
+
+
+//! animation names enumeration
+typedef enum RepairStationAnimType
+{
+  STATION_OPEN = 0,
+  STATION_CLOSE,
+
+  DOOR_MAX_ANIMATIONS
+};
+
+
+class RepairStation : public WorldEntity
+{
+  public:
+    RepairStation ();
+    RepairStation(const TiXmlElement* root);
+    virtual ~RepairStation ();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    void setActionRadius(float radius) { this->actionRadius = radius; }
+    void setScale(float scale) { this->scale = scale; }
+
+    void open();
+    void close();
+
+    void lock() { this->bLocked = true; }
+    void unlock() { this->bLocked = false; }
+    bool isLocked() const { return this->bLocked; }
+
+
+    virtual void tick (float time);
+
+
+  private:
+    bool checkOpen();
+    void setAnimation(int animNum, int playbackMode = 0);
+
+
+  private:
+    bool           bOpen;             //!< true if the door is open
+    bool           bLocked;           //!< true if this door is locked
+    float          actionRadius;      //!< action radius
+    float          scale;             //!< the scale of the model
+
+    static sAnim   animationList[2];  //!< list of the animations
+
+
+};
+
+#endif /* _REPAIR_STATION_H */
