Index: code/branches/presentationFS14/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/presentationFS14/src/orxonox/CMakeLists.txt	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/CMakeLists.txt	(revision 10073)
@@ -31,4 +31,5 @@
   PawnManager.cc
   PlayerManager.cc
+  ShipPartManager.cc
   Radar.cc
 #  Test.cc
Index: code/branches/presentationFS14/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/OrxonoxPrereqs.h	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/OrxonoxPrereqs.h	(revision 10073)
@@ -142,4 +142,6 @@
 
     // items
+    class ShipPart;
+    class PartDestructionEvent;
     class Engine;
     class Item;
@@ -189,4 +191,5 @@
     class Pawn;
     class SpaceShip;
+    class ModularSpaceShip;
     class Spectator;
     class TeamBaseMatchBase;
Index: code/branches/presentationFS14/src/orxonox/Scene.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/Scene.cc	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/Scene.cc	(revision 10073)
@@ -349,10 +349,14 @@
         SmartPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
 
+        // get the CollisionShape pointers
+        const btCollisionShape* cs0 = colObj0->getCollisionShape();
+        const btCollisionShape* cs1 = colObj1->getCollisionShape();
+
         // false means that bullet will assume we didn't modify the contact
         bool modified = false;
         if (object0->isCollisionCallbackActive())
-            modified |= object0->collidesAgainst(object1, cp);
+            modified |= object0->collidesAgainst(object1, cs1, cp);
         if (object1->isCollisionCallbackActive())
-            modified |= object1->collidesAgainst(object0, cp);
+            modified |= object1->collidesAgainst(object0, cs0, cp);
 
         return modified;
Index: code/branches/presentationFS14/src/orxonox/Scene.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/Scene.h	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/Scene.h	(revision 10073)
@@ -143,4 +143,7 @@
                                           int index0, const btCollisionObject* colObj1, int partId1, int index1);
 
+            static bool customCollisionCallback(btManifoldPoint& cp, const btCollisionObject* colObj0, int partId0,
+                                                      int index0, const btCollisionObject* colObj1, int partId1, int index1);
+
             // Bullet objects
             btDiscreteDynamicsWorld*             physicalWorld_;
Index: code/branches/presentationFS14/src/orxonox/ShipPartManager.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/ShipPartManager.cc	(revision 10073)
+++ code/branches/presentationFS14/src/orxonox/ShipPartManager.cc	(revision 10073)
@@ -0,0 +1,61 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "ShipPartManager.h"
+
+#include "util/ScopedSingletonManager.h"
+#include "core/CoreIncludes.h"
+#include "items/ShipPart.h"
+
+namespace orxonox
+{
+    ManageScopedSingleton(ShipPartManager, ScopeID::Root, false);
+
+    ShipPartManager::ShipPartManager()
+    {
+        RegisterObject(ShipPartManager);
+    }
+
+    ShipPartManager::~ShipPartManager()
+    {
+        // Be sure to delete all the pawns
+        for (ObjectList<ShipPart>::iterator it = ObjectList<ShipPart>::begin(); it != ObjectList<ShipPart>::end(); )
+            (it++)->death();
+    }
+
+    void ShipPartManager::preUpdate(const Clock& time)
+    {
+        for (ObjectList<ShipPart>::iterator it = ObjectList<ShipPart>::begin(); it != ObjectList<ShipPart>::end(); )
+        {
+            if (!it->isAlive())
+                (it++)->death();
+            else
+                ++it;
+        }
+    }
+}
Index: code/branches/presentationFS14/src/orxonox/ShipPartManager.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/ShipPartManager.h	(revision 10073)
+++ code/branches/presentationFS14/src/orxonox/ShipPartManager.h	(revision 10073)
@@ -0,0 +1,54 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ShipPartManager_H__
+#define _ShipPartManager_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Singleton.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ShipPartManager : public Singleton<ShipPartManager>, public Tickable
+    {
+            friend class Singleton<ShipPartManager>;
+        public:
+            ShipPartManager();
+            virtual ~ShipPartManager();
+
+            virtual void preUpdate(const Clock& time);
+
+        private:
+
+            static ShipPartManager* singletonPtr_s;
+    };
+}
+
+#endif /* _ShipPartManager_H__ */
Index: code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.h	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.h	(revision 10073)
@@ -170,4 +170,10 @@
             void notifyDetached(); // Notifies the CollisionShape of being detached from a CompoundCollisionShape.
 
+            inline unsigned int getParentID()
+                { return this->parentID_; }
+
+            inline CompoundCollisionShape* getParent()
+                { return this->parent_; }
+
         protected:
             virtual void updateParent(); // Updates the CompoundCollisionShape the CollisionShape belongs to, after the CollisionShape has changed.
Index: code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.cc	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.cc	(revision 10073)
@@ -39,4 +39,6 @@
 #include "core/XMLPort.h"
 #include "tools/BulletConversions.h"
+
+#include "collisionshapes/WorldEntityCollisionShape.h"
 
 namespace orxonox
@@ -118,4 +120,9 @@
             this->updatePublicShape();
         }
+
+        // If the shape to be attached is not a CompoundCollisionShape (thus an actual physical shape) & this is a WorldEntity's CollisionShape,
+        // set it's userPointer to the WorldEntity this CompoundCollisionShape belongs to.
+        if (!orxonox_cast<CompoundCollisionShape*>(shape) && orxonox_cast<WorldEntityCollisionShape*>(this))
+            shape->getCollisionShape()->setUserPointer(orxonox_cast<WorldEntityCollisionShape*>(this)->getWorldEntityOwner());
     }
 
@@ -297,3 +304,8 @@
         this->updatePublicShape();*/
     }
+
+    int CompoundCollisionShape::getNumChildShapes()
+    {
+        return this->compoundShape_->getNumChildShapes();
+    }
 }
Index: code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.h	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.h	(revision 10073)
@@ -71,4 +71,10 @@
 
             virtual void changedScale();
+            int getNumChildShapes();
+
+            inline std::map<CollisionShape*, btCollisionShape*> getShapesMap()
+            {
+                return attachedShapes_;
+            }
 
         private:
Index: code/branches/presentationFS14/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/controllers/NewHumanController.cc	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/controllers/NewHumanController.cc	(revision 10073)
@@ -220,5 +220,5 @@
                 if (!controlPaused_ )
                 {
-                    if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
+                    if (this->getControllableEntity() && ((this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || (this->getControllableEntity()->isExactlyA(ClassByString("ModularSpaceShip")))) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
                         this->showOverlays();
                     else if (this->getControllableEntity() &&  this->getControllableEntity()->isExactlyA(ClassByString("FpsPlayer")))
@@ -498,5 +498,5 @@
         this->controlMode_ = 0;
         this->centerCursor();
-        if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
+        if (this->getControllableEntity() && ((this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || (this->getControllableEntity()->isExactlyA(ClassByString("ModularSpaceShip")))) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
         {
             this->showOverlays_ = true;
Index: code/branches/presentationFS14/src/orxonox/items/CMakeLists.txt
===================================================================
--- code/branches/presentationFS14/src/orxonox/items/CMakeLists.txt	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/items/CMakeLists.txt	(revision 10073)
@@ -3,3 +3,5 @@
   Engine.cc
   MultiStateEngine.cc
+  ShipPart.cc
+  PartDestructionEvent.cc
 )
Index: code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.cc	(revision 10073)
+++ code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.cc	(revision 10073)
@@ -0,0 +1,352 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Noe Pedrazzini
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "PartDestructionEvent.h"
+
+#include <algorithm>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "network/NetworkFunction.h"
+#include "Item.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/pawns/ModularSpaceShip.h"
+#include "items/Engine.h"
+#include "gametypes/Gametype.h"
+#include "chat/ChatManager.h"
+
+
+namespace orxonox
+{
+    RegisterClass(PartDestructionEvent);
+
+    PartDestructionEvent::PartDestructionEvent(Context* context)
+        : Item(context)
+    {
+        RegisterObject(PartDestructionEvent);
+        this->setValid(true);
+    }
+
+    PartDestructionEvent::~PartDestructionEvent()
+    {
+
+    }
+
+    void PartDestructionEvent::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(PartDestructionEvent, XMLPort, xmlelement, mode);
+
+        XMLPortParam(PartDestructionEvent, "targetType", setTargetType, getTargetType, xmlelement, mode).defaultValues("NULL");
+        XMLPortParam(PartDestructionEvent, "targetName", setTargetName, getTargetName, xmlelement, mode).defaultValues("NULL");
+        XMLPortParam(PartDestructionEvent, "operation", setOperation, getOperation, xmlelement, mode).defaultValues("NULL");
+        XMLPortParam(PartDestructionEvent, "targetParam", setTargetParam, getTargetParam, xmlelement, mode).defaultValues("NULL");
+        XMLPortParam(PartDestructionEvent, "value", setEventValue, getEventValue, xmlelement, mode).defaultValues(0);
+        XMLPortParam(PartDestructionEvent, "message", setMessage, getMessage, xmlelement, mode).defaultValues("NULL");
+
+        /*
+        XMLPortParam(PartDestructionEvent, "health", setHealth, getHealth, xmlelement, mode).defaultValues(100);
+        XMLPortParam(PartDestructionEvent, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
+        XMLPortParam(PartDestructionEvent, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
+        */
+    }
+
+    /**
+    @brief
+        Executes this event.
+    */
+    void PartDestructionEvent::execute()
+    {
+        // Do not execute if this event is invalid
+        if(!isValid())
+        {
+            orxout(internal_warning) << "Attempted to execute an invalid PartDestructionEvent!" << endl;
+            return;
+        }
+
+        // Output the destruction-message to the chat
+        if(this->message_ != "NULL")
+            ChatManager::message(this->message_);
+
+        // Modify parameters as configured for all cases
+        if (this->targetType_ == "ship")
+        {
+            switch (this->targetParam_) {
+            case shieldhealth:
+                this->parent_->getParent()->setShieldHealth(operate(this->parent_->getParent()->getShieldHealth()));
+                break;
+            case boostpower:
+                this->parent_->getParent()->setInitialBoostPower(operate(this->parent_->getParent()->getInitialBoostPower()));
+                break;
+            case boostpowerrate:
+                this->parent_->getParent()->setBoostPowerRate(operate(this->parent_->getParent()->getBoostPowerRate()));
+                break;
+            case rotationthrust:
+                this->parent_->getParent()->setRotationThrust(operate(this->parent_->getParent()->getRotationThrust()));
+                break;
+            default:
+                break;
+            }
+            this->setValid(false);
+            return;
+        }
+
+        if (this->targetType_ == "engine")
+        {
+            switch (this->targetParam_) {
+            case null:
+                this->parent_->getParent()->removeEngine(this->parent_->getParent()->getEngineByName(targetName_));
+                break;
+            case boostfactor:
+                this->parent_->getParent()->getEngineByName(targetName_)->setBoostFactor(operate(this->parent_->getParent()->getEngineByName(targetName_)->getBoostFactor()));
+                break;
+            case speedfront:
+                this->parent_->getParent()->getEngineByName(targetName_)->setMaxSpeedFront(operate(this->parent_->getParent()->getEngineByName(targetName_)->getMaxSpeedFront()));
+                break;
+            case accelerationfront:
+                this->parent_->getParent()->getEngineByName(targetName_)->setAccelerationFront(operate(this->parent_->getParent()->getEngineByName(targetName_)->getAccelerationFront()));
+                break;
+            default:
+                break;
+            }
+            this->setValid(false);
+            return;
+        }
+
+        if (this->targetType_ == "part")
+        {
+            switch (this->targetParam_) {
+            case null:
+                if (!this->parent_->getParent()->getShipPartByName(targetName_))
+                    return;
+                this->parent_->getParent()->getShipPartByName(targetName_)->setEventExecution(false);
+                this->parent_->getParent()->killShipPart(targetName_);
+                break;
+            default:
+                break;
+            }
+            this->setValid(false);
+            return;
+        }
+    }
+
+    void PartDestructionEvent::setParent(ShipPart* part)
+    {
+        this->parent_ = part;
+    }
+
+    /**
+    @brief
+        Set type of the target
+    @param param
+        The desired target-type as string. Valid target-types: ship engine weapon
+    */
+    void PartDestructionEvent::setTargetType(std::string type)
+    {
+        if ((type == "ship") || (type == "engine") || (type == "weapon") || (type == "part"))
+        {
+            this->targetType_ = type;
+            return;
+        }
+
+        // Error, if invalid target-type was entered.
+        orxout(internal_warning) << "\"" << type << "\" is not a valid target-type for a PartDestructionEvent. Valid types are: ship engine weapon part" << endl;
+        this->setValid(false);
+        return;
+    }
+
+    void PartDestructionEvent::setTargetName(std::string name)
+    {
+        // Error, if the target-type is "weapon" or "engine", but the name of said target was not defined.
+        if (((this->targetType_ == "weapon") || (this->targetType_ == "engine")) && (name == "NULL"))
+        {
+            orxout(internal_warning) << "The target-name of a PartDestructionEvent with target-type \"" << this->targetType_ << "\" needs to be defined!" << endl;
+            return;
+        }
+
+        this->targetName_ = name;
+    }
+
+    /**
+    @brief
+        Set the operation to be applied.
+    @param param
+        The desired parameter as string. Valid parameters: c.f. @ref orxnox::PartDestructionEvent::TargetParam
+    */
+    void PartDestructionEvent::setTargetParam(std::string param)
+    {
+        // A target-type needs to be defined in order to choose a parameter.
+        if (this->targetType_ == "NULL")
+        {
+            orxout(internal_warning) << "No valid target-type defined. Cannot set target-param for this PartDestructionEvent." << endl;
+            this->setValid(false);
+            return;
+        }
+
+        // engine: NULL boostfactor speedfront accelerationfront
+        if (this->targetType_ == "engine")
+        {
+            if (param == "NULL")
+            {
+                this->targetParam_ = null;
+                return;
+            }
+            if (param == "boostfactor")
+            {
+                this->targetParam_ = boostfactor;
+                return;
+            }
+            if (param == "speedfront")
+            {
+                this->targetParam_ = speedfront;
+                return;
+            }
+            if (param == "accelerationfront")
+            {
+                this->targetParam_ = accelerationfront;
+                return;
+            }
+
+            orxout(internal_warning) << "\"" << param << "\" is not a valid target-param for a PartDestructionEvent with target-type \"engine\". Valid types are: boostfactor speedfront accelerationfront" << endl;
+            return;
+        }
+
+        // weapon:
+
+        // ship: shieldhealth (maxshieldhealth shieldabsorption shieldrechargerate) boostpower boostpowerrate rotationthrust
+        if (this->targetType_ == "ship")
+        {
+            if (param == "shieldhealth")
+            {
+                this->targetParam_ = shieldhealth;
+                return;
+            }
+            if (param == "boostpower")
+            {
+                this->targetParam_ = boostpower;
+                return;
+            }
+            if (param == "boostpowerrate")
+            {
+                this->targetParam_ = boostpowerrate;
+                return;
+            }
+            if (param == "rotationthrust")
+            {
+                this->targetParam_ = rotationthrust;
+                return;
+            }
+
+            orxout(internal_warning) << "\"" << param << "\" is not a valid target-param for a PartDestructionEvent with target-type \"ship\". Valid types are: shieldhealth maxshieldhealth shieldabsorption shieldrechargerate boostpower boostpowerrate rotationthrust" << endl;
+            return;
+        }
+
+        if (this->targetType_ == "part")
+        {
+            if (param == "NULL")
+            {
+                this->targetParam_ = null;
+                return;
+            }
+
+            orxout(internal_warning) << "\"" << param << "\" is not a valid target-param for a PartDestructionEvent with target-type \"part\". Valid types are: NULL (set operation to \"destroy\")" << endl;
+            return;
+        }
+
+        orxout(internal_warning) << "No valid target-param defined. The chosen param is either invalid or not available for this target-type." << endl;
+        this->setValid(false);
+    }
+
+    /**
+    @brief
+        Set the operation to be applied.
+    @param operation
+        The desired operator as string. Valid operators: * + - destroy
+    */
+    void PartDestructionEvent::setOperation(std::string operation)
+    {
+        // * + - destroy
+        if ((operation == "*") || (operation == "+") || (operation == "-") || (operation == "set") || (operation == "destroy"))
+        {
+            this->operation_ = operation;
+            return;
+        }
+        this->operation_ = "NULL";
+        orxout(internal_warning) << "\"" << operation << "\" is not a valid operation for a PartDestructionEvent. Valid operations are: * + - set destroy" << endl;
+    }
+
+    /**
+    @brief
+        Set the message to be shown upon execution of the vent.
+    @param msg
+        The desired message as string.
+    */
+    void PartDestructionEvent::setMessage(std::string msg)
+    {
+        this->message_ = msg;
+    }
+
+
+    /**
+    @brief
+        Apply the configured operation and value to an input.
+    @param input
+        The value which should be modified
+    @return
+        Returns the product / sum / difference of input and configured value,
+        the configured value if the operation is "set",
+        or 0 if the operation is "destroy"
+    */
+    float PartDestructionEvent::operate(float input)
+    {
+        if (this->operation_ == "*")
+            return input * this->value_;
+        if (this->operation_ == "+")
+            return input + this->value_;
+        if (this->operation_ == "-")
+            return input - this->value_;
+        if (this->operation_ == "set")
+            return this->value_;
+        if (this->operation_ == "destroy")
+        {
+            return 0;
+        }
+        return 0;
+    }
+
+    /**
+    @brief
+        Sets the value applied with the chosen operation.
+    @param value
+        The value as float.
+    */
+    void PartDestructionEvent::setEventValue(float value)
+    {
+        this->value_ = value;
+    }
+}
Index: code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.h	(revision 10073)
+++ code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.h	(revision 10073)
@@ -0,0 +1,160 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Noe Pedrazzini
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _PartDestructionEvent_H__
+#define _PartDestructionEvent_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Item.h"
+
+#include <string>
+
+
+namespace orxonox // tolua_export
+{ // tolua_export
+    /**
+        @brief
+            In order to assign attached entities to a ShipPart, a ShipPart with the same name as the corresponding entity needs to be created in the <parts> tag.
+            Here is a (primitive) example of a ModularSpaceShip with ShipParts and PartDestructionEvents defined in XML:
+            @code
+            <ModularSpaceShip
+                ...
+                >
+                    <attached>
+                        <StaticEntity name="generator"  . . .  />
+                        <StaticEntity name="tail" . . . />
+                    </attached>
+                    <parts>
+                        <ShipPart name="generator" . . . >
+                            <destructionevents>
+                                <PartDestructionEvent targetType="ship" targetParam="boostpowerrate" operation="-" value="0.5" message="Your boost-regeneration is reduced!" />
+                            </destructionevents>
+                        </ShipPart>
+                        <ShipPart name="tail" . . . >
+                            <destructionevents>
+                                <PartDestructionEvent ... />
+                            </destructionevents>
+                        </ShipPart>
+                    </parts>
+                    <engines>
+                        <Engine />
+                        <Engine />
+                    </engines>
+                </ModularSpaceShip>
+            @endcode
+
+        @author
+            Fabian 'x3n' Landau, Noe Pedrazzini
+        */
+    class _OrxonoxExport PartDestructionEvent // tolua_export
+        : public Item
+    { // tolua_export
+
+        public:
+
+            /**
+                @brief
+                    List of all allowed parameters.
+                */
+            enum TargetParam
+            {
+                shieldhealth,
+                maxshieldhealth,
+                shieldabsorption,
+                shieldrechargerate,
+                boostpower,         // Amount of available boost
+                boostpowerrate,     // Recharge-rate of boost
+                rotationthrust,
+                boostfactor,
+                speedfront,
+                accelerationfront,
+                null
+            };
+
+            PartDestructionEvent(Context* context);
+            virtual ~PartDestructionEvent();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void execute();
+
+            inline void setValid(bool valid)
+                { this->valid_ = valid; }
+            inline bool isValid()
+                { return this->valid_; }
+
+            void setParent(ShipPart* parent);
+            inline ShipPart* getParent()
+                { return this->parent_; }
+
+            void setTargetType(std::string type);
+            inline std::string getTargetType()
+                { return this->targetType_; }
+
+            void setTargetName(std::string name);
+            inline std::string getTargetName()
+                { return this->targetName_; }
+
+            void setTargetParam(std::string param);
+            inline std::string getTargetParam()
+                { return this->targetName_; }
+
+            void setOperation(std::string operation);
+            inline std::string getOperation()
+                { return this->operation_; }
+
+            void setMessage(std::string msg);
+            inline std::string getMessage()
+                { return this->message_; }
+
+            float operate(float input);
+
+            void setEventValue(float value);
+            inline float getEventValue()
+                { return this->value_; }
+
+        protected:
+
+        private:
+
+            ShipPart* parent_;          //!< Pointer to the ShipPart this event belongs to
+            bool valid_;                //!< Whether this event is valid or not.
+
+            std::string targetType_;    //!< The type of the target. (ship weapon engine)
+            std::string targetName_;    //!< The name of the target.
+            TargetParam targetParam_;   //!< The parameter to be modified
+            std::string operation_;     //!< The operation to be applied
+            float value_;               //!< The value used to do the operation
+            std::string message_;       //!< The message which is shown in chat when the event is executed.
+
+
+
+    }; // tolua_export
+} // tolua_export
+
+#endif /* _PartDestructionEvent_H__ */
Index: code/branches/presentationFS14/src/orxonox/items/ShipPart.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/items/ShipPart.cc	(revision 10073)
+++ code/branches/presentationFS14/src/orxonox/items/ShipPart.cc	(revision 10073)
@@ -0,0 +1,291 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Noe Pedrazzini
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "ShipPart.h"
+
+#include <algorithm>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "network/NetworkFunction.h"
+#include "Item.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/pawns/ModularSpaceShip.h"
+#include "gametypes/Gametype.h"
+#include "worldentities/StaticEntity.h"
+#include "items/PartDestructionEvent.h"
+#include "worldentities/BigExplosion.h"
+#include "chat/ChatManager.h"
+
+
+namespace orxonox
+{
+    RegisterClass(ShipPart);
+
+    ShipPart::ShipPart(Context* context)
+        : Item(context)
+    {
+        RegisterObject(ShipPart);
+        this->setAlive(true);
+        this->setEventExecution(true);
+        this->healthMem_ = 100;
+    }
+
+    ShipPart::~ShipPart()
+    {
+
+    }
+
+    void ShipPart::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(ShipPart, XMLPort, xmlelement, mode);
+
+        XMLPortParam(ShipPart, "health", setHealth, getHealth, xmlelement, mode).defaultValues(100);
+        XMLPortParam(ShipPart, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
+        XMLPortParam(ShipPart, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
+
+        XMLPortParam(ShipPart, "damageabsorption", setDamageAbsorption, getDamageAbsorption, xmlelement, mode).defaultValues(0.5);
+
+        XMLPortParamTemplate(ShipPart, "explosionposition", setExplosionPosition, getExplosionPosition, xmlelement, mode, Vector3);
+
+        XMLPortObject(ShipPart, PartDestructionEvent, "destructionevents", addDestructionEvent, getDestructionEvent, xmlelement, mode);
+    }
+
+    /**
+    @brief
+        Is called when the ShipPart dies.
+        Executes PartDestructionEvents.
+        Tells the ModularSpaceShip to remove this ShipPart.
+    */
+    void ShipPart::death()
+    {
+        //if (!(this->isAlive()))
+            //return;
+
+        this->explode();
+        this->setAlive(false);
+
+        if(eventExecution_)
+        {
+            // Execute all destruction events
+            for (unsigned int i = 0; i < this->eventList_.size(); i++)
+            {
+                this->getDestructionEvent(i)->execute();
+            }
+        }
+
+        // Remove this ShipPart from the parent.
+        this->parent_->removeShipPart(this);
+        delete this;
+    }
+
+    void ShipPart::explode()
+    {
+        BigExplosion* chunk = new BigExplosion(this->getContext());
+        chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * (this->explosionPosition_));
+        //chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * Vector3(this->entityList_[0]->getLocalInertia()));
+        chunk->setVelocity(this->parent_->getVelocity());
+
+        // this->explosionSound_->setPosition(this->parent_->getPosition());
+        // this->explosionSound_->play();
+    }
+
+    /**
+    @brief
+        Add a StaticEntity to the ShipPart.
+    @param engine
+        A pointer to the StaticEntity to be added.
+    */
+    void ShipPart::addEntity(StaticEntity* entity)
+    {
+        OrxAssert(entity != NULL, "The Entity cannot be NULL.");
+        this->entityList_.push_back(entity);
+    }
+
+    /**
+    @brief
+        Get the i-th StaticEntity of the ShipPart.
+    @return
+        Returns a pointer to the i-the StaticEntity. NULL if there is no StaticEntity with that index.
+    */
+    StaticEntity* ShipPart::getEntity(unsigned int index)
+    {
+        if(this->entityList_.size() >= index)
+            return NULL;
+        else
+            return this->entityList_[index];
+    }
+
+    /**
+    @brief
+        Check whether the ShipPart has a particular Entity.
+    @param engine
+        A pointer to the Entity to be checked.
+    */
+    bool ShipPart::hasEntity(StaticEntity* entity) const
+    {
+        for(unsigned int i = 0; i < this->entityList_.size(); i++)
+        {
+            if(this->entityList_[i] == entity)
+                return true;
+        }
+        return false;
+    }
+
+    /**
+    @brief
+        Add a PartDestructionEvent to the ShipPart.
+    @param engine
+        A pointer to the PartDestructionEvent to be added.
+    */
+    void ShipPart::addDestructionEvent(PartDestructionEvent* event)
+    {
+        OrxAssert(event != NULL, "The PartDestructionEvent cannot be NULL.");
+        event->setParent(this);
+        this->eventList_.push_back(event);
+    }
+
+    /**
+    @brief
+        Get the i-th PartDestructionEvent of the ShipPart.
+    @return
+        Returns a pointer to the i-the PartDestructionEvent. NULL if there is no PartDestructionEvent with that index.
+    */
+    PartDestructionEvent* ShipPart::getDestructionEvent(unsigned int index)
+    {
+        if(this->eventList_.size() <= index)
+            return NULL;
+        else
+            return this->eventList_[index];
+    }
+
+    void ShipPart::setDamageAbsorption(float value)
+    {
+        this->damageAbsorption_ = value;
+    }
+
+    void ShipPart::setParent(ModularSpaceShip* ship)
+    {
+        this->parent_ = ship;
+    }
+
+    /**
+    @brief
+        Sets the health of the ShipPart.
+    */
+    void ShipPart::setHealth(float health)
+    {
+        this->health_ = health;
+    }
+
+    void ShipPart::setAlive(bool var)
+    {
+        this->alive_ = var;
+        orxout() << "ShipPart " << this->getName() << " alive_: " << this->alive_ << endl;
+    }
+
+    /**
+    @brief
+        Handles a received hit.
+    */
+    void ShipPart::handleHit(float damage, float healthdamage, float shielddamage, Pawn* originator)
+    {
+        if (parent_->getGametype() && parent_->getGametype()->allowPawnDamage(parent_, originator))
+        {
+            if (shielddamage >= parent_->getShieldHealth())
+            {
+                parent_->setShieldHealth(0);
+                this->setHealth(this->health_ - (healthdamage + damage) * this->damageAbsorption_);
+                parent_->setHealth(parent_->getHealth() - (healthdamage + damage) * (1 - this->damageAbsorption_));
+            }
+            else
+            {
+                parent_->setShieldHealth(parent_->getShieldHealth() - shielddamage);
+
+                // remove remaining shieldAbsorpton-Part of damage from shield
+                shielddamage = damage * parent_->getShieldAbsorption();
+                shielddamage = std::min(parent_->getShieldHealth(),shielddamage);
+                parent_->setShieldHealth(parent_->getShieldHealth() - shielddamage);
+
+                // set remaining damage to health
+                this->setHealth(this->health_ - ((damage - shielddamage) - healthdamage) * this->damageAbsorption_);
+                parent_->setHealth(parent_->getHealth() - ((damage - shielddamage) - healthdamage) * (1- this->damageAbsorption_));
+            }
+        }
+        if (this->health_ < 0)
+            this->alive_ = false;
+            //this->death();
+
+        // (Ugly) Chatoutput of health, until a GUI for modularspaceships-shipparts is implemented.
+        if ((this->health_ < 0.2 * this->maxHealth_) && (this->healthMem_ == 40))
+        {
+            this->healthMem_ = 20;
+            ChatManager::message("ShipPart " + this->getName() + " remaining health is 20%!");
+            return;
+        }
+        if ((this->health_ < 0.4 * this->maxHealth_) && (this->healthMem_ == 60))
+        {
+            this->healthMem_ = 40;
+            ChatManager::message("ShipPart " + this->getName() + " remaining health is 40%!");
+            return;
+        }
+        if ((this->health_ < 0.6 * this->maxHealth_) && (this->healthMem_ == 80))
+        {
+            this->healthMem_ = 60;
+            ChatManager::message("ShipPart " + this->getName() + " remaining health is 60%!");
+            return;
+        }
+        if ((this->health_ < 0.8 * this->maxHealth_) && (this->healthMem_ == 100))
+        {
+            this->healthMem_ = 80;
+            ChatManager::message("ShipPart " + this->getName() + " remaining health is 80%!");
+            return;
+        }
+    }
+
+
+    /**
+    @brief
+        Adds the ShipPart to the input SpaceShip.
+    @param ship
+        A pointer to the SpaceShip to which the ShipPart is added.
+    */
+    /*void ShipPart::addToSpaceShip(ModularSpaceShip* ship)
+    {
+        this->parent_ = ship;
+
+        if (ship)
+        {
+            this->parentID_ = ship->getObjectID();
+            if (!ship->hasShipPart(this))
+                ship->addShipPart(this);
+        }
+    }*/
+
+}
Index: code/branches/presentationFS14/src/orxonox/items/ShipPart.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/items/ShipPart.h	(revision 10073)
+++ code/branches/presentationFS14/src/orxonox/items/ShipPart.h	(revision 10073)
@@ -0,0 +1,134 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Noe Pedrazzini
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ShipPart_H__
+#define _ShipPart_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Item.h"
+#include "items/PartDestructionEvent.h"
+
+#include <string>
+
+
+namespace orxonox // tolua_export
+{ // tolua_export
+    class _OrxonoxExport ShipPart // tolua_export
+        : public Item
+    { // tolua_export
+
+        public:
+            ShipPart(Context* context);
+            virtual ~ShipPart();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            virtual void handleHit(float damage, float healthdamage, float shielddamage, Pawn* originator);
+
+            virtual void death();
+            virtual void explode();
+
+            //virtual void attachTo(Pawn* newParent);
+            //virtual void detach();
+
+            void addEntity(StaticEntity* entity);
+            StaticEntity* getEntity(unsigned int index);
+            bool hasEntity(StaticEntity* entity) const;
+
+            void addDestructionEvent(PartDestructionEvent* event);
+            PartDestructionEvent* getDestructionEvent(unsigned int index);
+
+            virtual void setDamageAbsorption(float value);
+            inline float getDamageAbsorption()
+                { return this->damageAbsorption_; }
+
+            void setParent(ModularSpaceShip* ship);
+            inline ModularSpaceShip* getParent()
+                { return this->parent_; }
+
+            void setAlive(bool var);
+            inline bool isAlive()
+                { return this->alive_; }
+
+            inline void setEventExecution(bool var)
+                { this->eventExecution_ = var; }
+            inline bool isEventExecution()
+                { return this->eventExecution_; }
+
+            virtual void setHealth(float health);
+            inline void addHealth(float health)
+                { this->setHealth(this->health_ + health); }
+            inline void removeHealth(float health)
+                { this->setHealth(this->health_ - health); }
+            inline float getHealth() const
+                { return this->health_; }
+
+            inline void setMaxHealth(float maxhealth)
+                { this->maxHealth_ = maxhealth; this->setHealth(this->health_); }
+            inline float getMaxHealth() const
+                { return this->maxHealth_; }
+
+            inline void setInitialHealth(float initialhealth)
+                { this->initialHealth_ = initialhealth; this->setHealth(initialhealth); }
+            inline float getInitialHealth() const
+                { return this->initialHealth_; }
+
+            inline void setExplosionPosition(Vector3 pos)
+                { this->explosionPosition_ = pos; }
+            inline Vector3 getExplosionPosition()
+                { return this->explosionPosition_; }
+
+
+            // FIXME: (noep) Why doesn't this work? Works fine in Engine.h
+            //void addToSpaceShip(ModularSpaceShip* ship);
+
+        protected:
+            ModularSpaceShip* parent_;
+            unsigned int parentID_;     // Object ID of the SpaceShip the Part is mounted on.
+
+            float damageAbsorption_;
+            float health_;
+            float maxHealth_;
+            float initialHealth_;
+
+        private:
+            std::vector<StaticEntity*> entityList_;         // List of all entities which belong to this part
+            std::vector<PartDestructionEvent*> eventList_;  // The list of all PartDestructionEvent assigned to this ShipPart.
+
+            bool alive_;
+            bool eventExecution_;
+
+            float healthMem_;
+
+            Vector3 explosionPosition_;
+
+
+    }; // tolua_export
+} // tolua_export
+
+#endif /* _ShipPart_H__ */
Index: code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.cc	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.cc	(revision 10073)
@@ -72,5 +72,5 @@
     }
 
-    bool MovableEntity::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+    bool MovableEntity::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
     {
         if (GameMode::isMaster() && enableCollisionDamage_)
@@ -80,5 +80,5 @@
             {
                 float damage = this->collisionDamage_ * (victim->getVelocity() - this->getVelocity()).length();
-                victim->hit(0, contactPoint, damage);
+                victim->hit(0, contactPoint, ownCollisionShape, damage);
             }
         }
@@ -86,5 +86,4 @@
         return false;
     }
-
 
     void MovableEntity::registerVariables()
Index: code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.h	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.h	(revision 10073)
@@ -47,5 +47,5 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
 
             using WorldEntity::setPosition;
Index: code/branches/presentationFS14/src/orxonox/worldentities/StaticEntity.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/StaticEntity.cc	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/StaticEntity.cc	(revision 10073)
@@ -34,4 +34,5 @@
 #include "util/OrxAssert.h"
 #include "core/CoreIncludes.h"
+#include "worldentities/BigExplosion.h"
 
 namespace orxonox
@@ -115,3 +116,4 @@
         worldTrans.setRotation(btQuaternion(node_->getOrientation().x, node_->getOrientation().y, node_->getOrientation().z, node_->getOrientation().w));
     }
+
 }
Index: code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.cc	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.cc	(revision 10073)
@@ -46,4 +46,5 @@
 #include "Scene.h"
 #include "collisionshapes/WorldEntityCollisionShape.h"
+#include <BulletCollision/CollisionShapes/btCollisionShape.h>
 
 namespace orxonox
Index: code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.h	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.h	(revision 10073)
@@ -72,4 +72,5 @@
     {
         friend class Scene;
+        friend class ModularSpaceShip;
 
         public:
@@ -206,4 +207,7 @@
 
             void notifyChildPropsChanged();
+
+            inline int getNumAttachedObj()
+                { return this->children_.size(); }
 
         protected:
@@ -374,5 +378,5 @@
                 Condition is that enableCollisionCallback() was called.
             */
-            virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+            virtual inline bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
                 { return false; } /* With false, Bullet assumes no modification to the collision objects. */
 
@@ -405,4 +409,7 @@
             */
             virtual bool isCollisionTypeLegal(CollisionType type) const = 0;
+
+            inline virtual WorldEntityCollisionShape* getWorldEntityCollisionShape()
+                { return this->collisionShape_; }
 
             btRigidBody*  physicalBody_; //!< Bullet rigid body. Everything physical is applied to this instance.
Index: code/branches/presentationFS14/src/orxonox/worldentities/pawns/CMakeLists.txt
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/CMakeLists.txt	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/CMakeLists.txt	(revision 10073)
@@ -4,4 +4,5 @@
   Pawn.cc
   SpaceShip.cc
+  ModularSpaceShip.cc
   TeamBaseMatchBase.cc
   Destroyer.cc
Index: code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.cc	(revision 10073)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.cc	(revision 10073)
@@ -0,0 +1,368 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Noe Pedrazzini
+ *
+ */
+
+#include "ModularSpaceShip.h"
+
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+
+#include "core/CoreIncludes.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "core/Template.h"
+#include "core/XMLPort.h"
+#include "util/Math.h"
+#include "gametypes/Gametype.h"
+#include "core/command/ConsoleCommand.h"
+
+#include "items/ShipPart.h"
+#include "items/Engine.h"
+#include "worldentities/StaticEntity.h"
+#include "collisionshapes/WorldEntityCollisionShape.h"
+#include <BulletCollision/CollisionShapes/btCollisionShape.h>
+#include <BulletCollision/CollisionShapes/btCompoundShape.h>
+
+
+
+namespace orxonox
+{
+    SetConsoleCommand("ModularSpaceShip", "killshippart", &ModularSpaceShip::killShipPartStatic);
+
+    RegisterClass(ModularSpaceShip);
+
+    std::map<StaticEntity*, ShipPart*>* ModularSpaceShip::partMap_s = 0;
+
+    ModularSpaceShip::ModularSpaceShip(Context* context) : SpaceShip(context)
+    {
+        RegisterObject(ModularSpaceShip);
+
+        this->registerVariables();
+
+        ModularSpaceShip::partMap_s = &(this->partMap_);
+
+    }
+
+    ModularSpaceShip::~ModularSpaceShip()
+    {
+        if (this->isInitialized())
+        {
+
+        }
+    }
+
+    void ModularSpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(ModularSpaceShip, XMLPort, xmlelement, mode);
+        XMLPortObject(ModularSpaceShip, ShipPart, "parts", addShipPart, getShipPart, xmlelement, mode);
+    }
+
+    void ModularSpaceShip::registerVariables()
+    {
+        return;
+    }
+
+    /**
+    @brief
+        Searches for ShipParts matching to StaticEntities.
+    */
+    void ModularSpaceShip::updatePartAssignment()
+    {
+        // iterate through all attached objects
+        for (unsigned int i=0; i < (unsigned int)(this->getNumAttachedObj()); i++)
+        {
+            if (this->getAttachedObject(i) == NULL)
+            {
+                break;
+            }
+            // iterate through all attached parts
+            for(unsigned int j = 0; j < this->partList_.size(); j++)
+            {
+                // if the name of the part matches the name of the object, add the object to that parts entitylist (unless it was already done).
+                if((this->partList_[j]->getName() == this->getAttachedObject(i)->getName()) && !this->partList_[j]->hasEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i))))
+                {
+                    // The Entity is added to the part's entityList_
+                    this->partList_[j]->addEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i)));
+                    // An entry in the partMap_ is created, assigning the part to the entity.
+                    this->addPartEntityAssignment((StaticEntity*)(this->getAttachedObject(i)), this->partList_[j]);
+                }
+            }
+        }
+    }
+
+    void ModularSpaceShip::attach(WorldEntity* object)
+    {
+        SpaceShip::attach(object);
+        this->updatePartAssignment();
+    }
+
+    /**
+    @brief
+        Creates a new assignment for the given StaticEntity and ShipPart in the partMap_
+    @param entity
+        A pointer to the StaticEntity
+    @param part
+        A pointer to the ShipPart.
+    */
+    void ModularSpaceShip::addPartEntityAssignment(StaticEntity* entity, ShipPart* part)
+    {
+        if (!entity || !part)
+            return;
+
+        if (this->partMap_.find(entity) != this->partMap_.end())
+                {
+                    orxout(internal_warning) << "Assigning an Entity to multiple parts is not yet supported." << endl;
+                    return;
+                }
+
+        this->partMap_[entity] = part;
+    }
+
+
+    /**
+    @brief
+        Get the ShipPart an attached entity belongs to.
+    @param entity
+        The entity to be searched.
+    @return
+        Returns a pointer to the ShipPart the entity belongs to.
+    */
+    ShipPart* ModularSpaceShip::getPartOfEntity(StaticEntity* entity) const
+    {
+        for (std::map<StaticEntity*, ShipPart*>::const_iterator it = this->partMap_.begin(); it != this->partMap_.end(); ++it)
+        {
+            if (it->first == entity)
+                return it->second;
+        }
+        return NULL;
+    }
+
+    /**
+    @brief
+        If the damage occurred on an attached StaticEntity, the damage is given to the corresponding ShipPart to handle.
+    */
+    void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
+    {
+        if (this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)
+            this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator);
+        else
+            SpaceShip::damage(damage, healthdamage, shielddamage, originator, cs);
+    }
+
+    /**
+    @brief
+        STATIC: Needed for consolecommand. Kills the ShipPart with the given name. Used from the console-command "ModularSpaceShip killshippart [string]".
+    @param name
+        The name of the part to be killed.
+    */
+    void ModularSpaceShip::killShipPartStatic(std::string name)
+    {
+        for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_s->begin(); it != ModularSpaceShip::partMap_s->end(); ++it)
+        {
+            if (it->second->getName() == name)
+            {
+                it->second->setAlive(false);
+                return;
+            }
+        }
+        orxout(internal_warning) << "Could not apply damage to ShipPart \"" << name << "\". Part not found." << endl;
+    }
+
+    /**
+    @brief
+        Kills the ShipPart with the given name. Used from the console-command "ModularSpaceShip killshippart [string]".
+    @param name
+        The name of the part to be killed.
+    */
+    void ModularSpaceShip::killShipPart(std::string name)
+    {
+        for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_.begin(); it != ModularSpaceShip::partMap_.end(); ++it)
+        {
+            if (it->second->getName() == name)
+            {
+                it->second->setAlive(false);
+                return;
+            }
+        }
+        orxout(internal_warning) << "Could not apply damage to ShipPart \"" << name << "\". Part not found." << endl;
+    }
+
+    /**
+    @brief
+        Add a ShipPart to the SpaceShip.
+    @param engine
+        A pointer to the ShipPart to be added.
+    */
+    void ModularSpaceShip::addShipPart(ShipPart* part)
+    {
+        OrxAssert(part != NULL, "The ShipPart cannot be NULL.");
+        this->partList_.push_back(part);
+        part->setParent(this);
+        this->updatePartAssignment();
+    }
+
+    /**
+    @brief
+        Get the i-th ShipPart of the SpaceShip.
+    @return
+        Returns a pointer to the i-the ShipPart. NULL if there is no ShipPart with that index.
+    */
+    ShipPart* ModularSpaceShip::getShipPart(unsigned int index)
+    {
+        if(this->partList_.size() <= index)
+            return NULL;
+        else
+            return this->partList_[index];
+    }
+
+    /**
+    @brief
+        Looks for an attached ShipPart with a certain name.
+    @param name
+        The name of the ShipPart to be returned.
+    @return
+        Pointer to the ShipPart with the given name, or NULL if not found.
+    */
+    ShipPart* ModularSpaceShip::getShipPartByName(std::string name)
+    {
+        for(std::vector<ShipPart*>::iterator it = this->partList_.begin(); it != this->partList_.end(); ++it)
+        {
+            if(orxonox_cast<ShipPart*>(*it)->getName() == name)
+            {
+                return orxonox_cast<ShipPart*>(*it);
+            }
+        }
+        orxout(internal_warning) << "Couldn't find ShipPart with name \"" << name << "\"." << endl;
+        return NULL;
+    }
+
+    /**
+    @brief
+        Check whether the SpaceShip has a particular Engine.
+    @param engine
+        A pointer to the Engine to be checked.
+    */
+    bool ModularSpaceShip::hasShipPart(ShipPart* part) const
+    {
+        for(unsigned int i = 0; i < this->partList_.size(); i++)
+        {
+            if(this->partList_[i] == part)
+                return true;
+        }
+        return false;
+    }
+
+
+    /**
+    @brief
+        Removes a ShipPart from the SpaceShip, destroying the corresponding StaticEntity
+    @param part
+        The ShipPart to be removed.
+    */
+    void ModularSpaceShip::removeShipPart(ShipPart* part)
+    {
+        // Remove the part from the partList_
+        std::vector<ShipPart*>::iterator it = this->partList_.begin();
+        for(unsigned int i = 0; i < this->partList_.size(); i++)
+        {
+            if(this->partList_[i] == part)
+            {
+                this->partList_.erase(it);
+                break;
+            }
+            it++;
+        }
+        // Remove the part-entity assignment and detach the Entity of this ShipPart
+        for (std::map<StaticEntity*, ShipPart*>::iterator itt = this->partMap_.begin(); itt != this->partMap_.end(); )
+        {
+            if (itt->second == part)
+            {
+                this->detach(itt->first);
+                itt->first->destroy();
+                //itt->first->setActive(false);
+                //itt->first->setVisible(false);
+                //itt->first->setCollisionResponse(false);
+                //itt->first->setCollisionType(None);
+                //itt->first->deactivatePhysics();
+                this->partMap_.erase(itt++);
+            } else {
+                ++itt;
+            }
+        }
+    }
+
+    /**
+    @brief
+        Looks for an attached Engine with a certain name.
+    @param name
+        The name of the engine to be returned.
+    @return
+        Pointer to the engine with the given name, or NULL if not found.
+    */
+    Engine* ModularSpaceShip::getEngineByName(std::string name)
+    {
+        for(std::vector<Engine*>::iterator it = this->engineList_.begin(); it != this->engineList_.end(); ++it)
+        {
+            if(orxonox_cast<Engine*>(*it)->getName() == name)
+            {
+                return orxonox_cast<Engine*>(*it);
+            }
+        }
+        orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl;
+        return NULL;
+    }
+
+    /**
+    @brief
+        Detaches a child WorldEntity from this instance.
+    */
+    void ModularSpaceShip::detach(WorldEntity* object)
+    {
+        std::set<WorldEntity*>::iterator it = this->children_.find(object);
+        if (it == this->children_.end())
+        {
+            orxout(internal_warning) << "Cannot detach an object that is not a child." << endl;
+            return;
+        }
+
+        // collision shapes
+
+        //this->printBtChildShapes((btCompoundShape*)(this->getWorldEntityCollisionShape()->getCollisionShape()), 2, 0);
+        this->detachCollisionShape(object->collisionShape_);  // after succeeding, causes a crash in the collision handling
+        //this->printBtChildShapes((btCompoundShape*)(this->getWorldEntityCollisionShape()->getCollisionShape()), 2, 0);
+
+        // mass
+        if (object->getMass() > 0.0f)
+        {
+            this->childrenMass_ -= object->getMass();
+            recalculateMassProps();
+        }
+
+        this->detachNode(object->node_);
+        this->children_.erase(it);        // this causes a crash when unloading the level. Or not?
+
+        object->notifyDetached();
+    }
+}
Index: code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.h	(revision 10073)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.h	(revision 10073)
@@ -0,0 +1,146 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Noe Pedrazzini
+ *
+ */
+
+#ifndef _ModularSpaceShip_H__
+#define _ModularSpaceShip_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include <LinearMath/btVector3.h>
+
+#include "tools/Timer.h"
+#include "util/Math.h"
+#include "util/OrxAssert.h"
+
+#include "SpaceShip.h"
+#include "items/ShipPart.h"
+#include <map>
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        The SpaceShip is the principal entity through which the player interacts with the game. Its main function is to fly, however many things, such as @ref orxonox::Engine Engines or @ref orxonox::Weapon Weapons, can be attached to it.
+        The ModularSpaceShip is an extension of a @ref orxonox::SpaceShip SpaceShip, which uses @ref orxonox::ShipPart ShipParts to allow entities attached to it to be destroyed individually.
+
+        There are several parameters that define the behavior of the ModularSpaceShip>
+        - The <b>rotationThrust</b>, specifies the force with which the ModularSpaceShip rotates.
+        - The <b>boost</b>, there are quite some parameters pertaining to boosting. The boost is a special move of the ModularSpaceShip, where, for a limited amount of time, it can fly considerably faster than usual. The <b>boostPower</b> is the amount of power available for boosting. The <b>boostPowerRate</b> is the rate at which the boost power is replenished. The <b>boostRate</b> is the rate at which boosting uses power. And the <b>boostCooldownDuration</b> is the time the ModularSpaceShip cannot boost, once all the boost power has been used up. Naturally all of these parameters must be non-negative.
+        - The <b>boost shaking</b>, when the ModularSpaceShip boosts, the camera shakes to create a more immersive effect. Two parameters can be used to adjust the effect. The <b>shakeFrequency</b> is the frequency with which the camera shakes. And the <b>shakeAmplitude</b> is the amount with which the camera shakes. Again these parameters must bee non-negative.
+        - The <b>lift</b> creates a more natural flight feeling through the addition of a lift force. There are again tow parameters that can be specified. The <b>lift</b> which is the lift force that is applied. And the <b>stallSpeed</b> which is the forward speed after which no more lift is generated.
+
+        As mentioned @ref orxonox::Engine Engines can be mounted on the ModularSpaceShip.
+        In order to assign attached entities to a ShipPart, a ShipPart with the same name as the corresponding entity needs to be created in the <parts> tag.
+        Here is a (primitive) example of a ModularSpaceShip defined in XML:
+        @code
+        <ModularSpaceShip
+            rotationThrust    = 50
+
+            lift = 1;
+            stallSpeed = 220;
+
+            boostPower            = 15
+            boostPowerRate        = 1
+            boostRate             = 5
+            boostCooldownDuration = 10
+
+            shakeFrequency = 15
+            shakeAmplitude = 9
+
+            collisionType     = "dynamic"
+            mass              = 100
+            linearDamping     = 0.7
+            angularDamping    = 0.9999999
+            >
+                <attached>
+                    <StaticEntity name="wing"  . . .  />
+                    <StaticEntity name="tail" . . . />
+                </attached>
+                <parts>
+                    <ShipPart name="wing" . . . />
+                    <ShipPart name="tail" . . . />
+                </parts>
+                <engines>
+                    <Engine />
+                    <Engine />
+                </engines>
+            </ModularSpaceShip>
+        @endcode
+
+    @author
+        Fabian 'x3n' Landau, Noe Pedrazzini
+    */
+    class _OrxonoxExport ModularSpaceShip : public SpaceShip
+    {
+        public:
+            ModularSpaceShip(Context* context);
+            virtual ~ModularSpaceShip();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void attach(WorldEntity* object);
+
+            void addPartEntityAssignment(StaticEntity* entity, ShipPart* part);
+            ShipPart* getPartOfEntity(StaticEntity* entity) const;
+
+            virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);
+
+            static void killShipPartStatic(std::string name);
+            void killShipPart(std::string name);
+
+            void addShipPart(ShipPart* part);
+            ShipPart* getShipPart(unsigned int index);
+            ShipPart* getShipPartByName(std::string name);
+            bool hasShipPart(ShipPart* part) const;
+            void removeShipPart(ShipPart* part);
+
+            inline void setRotationThrust(float val)
+                { this->rotationThrust_ = val; }
+            inline float getRotationThrust()
+                { return this->rotationThrust_; }
+
+            Engine* getEngineByName(std::string name);
+            void detach(WorldEntity* object);
+
+            virtual void updatePartAssignment();
+
+        protected:
+
+
+        private:
+            void registerVariables();
+            std::vector<ShipPart*> partList_;                       // The list of all Parts mounted on this ModularSpaceShip.
+            std::map<StaticEntity*, ShipPart*> partMap_;            // Map of Part-Entity-assignments
+            static std::map<StaticEntity*, ShipPart*>* partMap_s;
+        
+    };
+}
+
+#endif /* _ModularSpaceShip_H__ */
Index: code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.cc	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.cc	(revision 10073)
@@ -50,4 +50,10 @@
 #include "controllers/FormationController.h"
 
+#include "collisionshapes/WorldEntityCollisionShape.h"
+#include <BulletCollision/CollisionShapes/btCollisionShape.h>
+#include <BulletCollision/CollisionShapes/btCompoundShape.h>
+#include "graphics/Model.h"
+
+
 namespace orxonox
 {
@@ -244,6 +250,12 @@
     }
 
-    void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
-    {
+    void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
+    {
+        //FIXME: (noep) remove debug
+        //orxout() << "damage(): Collision detected on " << this->getName() << ", btCS*: " << cs << endl;
+
+        //int collisionShapeIndex = this->isMyCollisionShape(cs);
+        //orxout() << collisionShapeIndex << endl;
+
         // Applies multiplier given by the DamageBoost Pickup.
         if (originator)
@@ -279,19 +291,18 @@
 
 */
-    void Pawn::hit(Pawn* originator, const Vector3& force, float damage, float healthdamage, float shielddamage)
+    void Pawn::hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage, float shielddamage)
     {
         if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) )
         {
-            this->damage(damage, healthdamage, shielddamage, originator);
+            this->damage(damage, healthdamage, shielddamage, originator, cs);
             this->setVelocity(this->getVelocity() + force);
         }
     }
 
-
-    void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage, float shielddamage)
+    void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage, float shielddamage)
     {
         if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) )
         {
-            this->damage(damage, healthdamage, shielddamage, originator);
+            this->damage(damage, healthdamage, shielddamage, originator, cs);
 
             if ( this->getController() )
@@ -561,3 +572,81 @@
 
 
+    int Pawn::isMyCollisionShape(const btCollisionShape* cs)
+    {
+        // This entities WECS
+        WorldEntityCollisionShape* ownWECS = this->getWorldEntityCollisionShape();
+
+        // e.g. "Box 4: Searching for CS 0x1ad49200"
+        orxout() << this->getName() << ": Searching for btCS* " << cs << endl;
+        // e.g. "Box 4 is WorldEntityCollisionShape 0x126dd060"
+        orxout() << "  " << this->getName() << " is WorldEntityCollisionShape* " << ownWECS << endl;
+        // e.g. "Box 4 is WorldEntity 0x126dd060"
+        orxout() << "  " << this->getName() << " is WorldEntity* " << this << endl;
+        // e.g. "Box 4 is objectID 943"
+        orxout() << "  " << this->getName() << " is objectID " << this->getObjectID() << endl;
+
+        // List all attached Objects
+        orxout() << "  " << this->getName() << " has the following Objects attached:" << endl;
+        for (int i=0; i<50; i++)
+        {
+            if (this->getAttachedObject(i)==NULL)
+                break;
+            orxout() << " " << i << ": " << this->getAttachedObject(i) << " (" << this->getAttachedObject(i)->getName() << ")";
+            if(!orxonox_cast<Model*>(this->getAttachedObject(i)))
+                orxout() << " (SE)";
+            orxout() << endl;
+        }
+
+
+        // print child shapes of this WECS
+        printBtChildShapes((btCompoundShape*)(ownWECS->getCollisionShape()), 2, 0);
+
+        int temp = entityOfCollisionShape(cs);
+        if (temp==0)
+            orxout() << this->getName() << " has been hit on it's main body." << endl;
+        else
+            orxout() << this->getName() << " has been hit on the attached entity no. " << temp << endl;
+
+        // end
+        return -1;
+    }
+
+    void Pawn::printBtChildShapes(btCompoundShape* cs, int indent, int subshape)
+    {
+        // e.g. "  Childshape 1 (WECS 0x126dc8c0) has 2 childshapes:"
+        printSpaces(indent);  orxout() << "Childshape " << subshape << " (btCS* " << cs << ") has " << cs->getNumChildShapes() << " childshapes:" << endl;
+
+        for (int i=0; i < cs->getNumChildShapes(); i++)
+        {
+            printSpaces(indent+2);  orxout() << "- " << i << " - - -" << endl;
+
+            // For each childshape, print: (as long as it's not another CompoundCollisionShape)
+            if (!orxonox_cast<btCompoundShape*>(cs->getChildShape(i)))
+            {
+                // pointer to the btCollisionShape
+                printSpaces(indent+2);  orxout() << "btCollisionShape*: " << cs->getChildShape(i) << endl;
+
+                // pointer to the btCollisionShape
+                printSpaces(indent+2);  orxout() << "m_userPointer*: " << cs->getChildShape(i)->getUserPointer() << " (name_: " << ((BaseObject*)(cs->getChildShape(i)->getUserPointer()))->getName() << ")" << endl;
+            }
+
+            // if the childshape is a CompoundCollisionShape, print its children.
+            if (cs->getChildShape(i)->isCompound())
+                printBtChildShapes((btCompoundShape*)(cs->getChildShape(i)), indent+2, i);
+
+        }
+    }
+
+    int Pawn::entityOfCollisionShape(const btCollisionShape* cs)
+    {
+        btCompoundShape* ownBtCS = (btCompoundShape*)(this->getWorldEntityCollisionShape()->getCollisionShape());
+
+        return -1;
+    }
+
+    void Pawn::printSpaces(int num)
+    {
+        for(int i=0; i<num; i++)
+            orxout() << " ";
+    }
 }
Index: code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.h	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.h	(revision 10073)
@@ -126,6 +126,6 @@
             //virtual void hit(Pawn* originator, const Vector3& force, float damage);
             //virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
-            virtual void hit(Pawn* originator, const Vector3& force, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
-            virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
+            virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
+            virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
 
             virtual void kill();
@@ -196,5 +196,5 @@
 
             //virtual void damage(float damage, Pawn* originator = 0);
-            virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL);
+            virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);
 
             bool bAlive_;
@@ -229,4 +229,9 @@
             unsigned int numexplosionchunks_;
 
+            virtual int isMyCollisionShape(const btCollisionShape* cs); // FIXME: (noep) remove debug
+            void printBtChildShapes(btCompoundShape* cs, int indent, int subshape); // FIXME: (noep) remove debug
+            void printSpaces(int num);   // FIXME: (noep) remove debug
+            int entityOfCollisionShape(const btCollisionShape* cs);
+
         private:
             void registerVariables();
Index: code/branches/presentationFS14/src/orxonox/worldentities/pawns/SpaceShip.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 10073)
@@ -270,4 +270,6 @@
             float stallSpeed_; //!< The forward speed where no more lift is added.
 
+            std::vector<Engine*> engineList_; //!< The list of all Engines mounted on this SpaceShip.
+
         private:
             void registerVariables();
@@ -284,6 +286,4 @@
             void backupCamera(); // Save the original position and orientation of the camera.
             void resetCamera(); // Reset the camera to its original position.
-
-            std::vector<Engine*> engineList_; //!< The list of all Engines mounted on this SpaceShip.
 
             Timer timer_;                          //!< Timer for the cooldown duration.
