Index: code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/CMakeLists.txt	(revision 5774)
+++ code/trunk/src/orxonox/CMakeLists.txt	(revision 5781)
@@ -26,15 +26,56 @@
 SET_SOURCE_FILES(ORXONOX_SRC_FILES
   Main.cc
-  GSRoot.cc
+
+  CameraManager.cc
+  LevelManager.cc
+  PawnManager.cc
+  PlayerManager.cc
+
+  Level.cc
+  Radar.cc
+  Scene.cc
 )
+
+ADD_SUBDIRECTORY(collisionshapes)
+ADD_SUBDIRECTORY(controllers)
+ADD_SUBDIRECTORY(gametypes)
+ADD_SUBDIRECTORY(graphics)
+ADD_SUBDIRECTORY(infos)
+ADD_SUBDIRECTORY(interfaces)
+ADD_SUBDIRECTORY(items)
+ADD_SUBDIRECTORY(overlays)
+ADD_SUBDIRECTORY(pickup)
+ADD_SUBDIRECTORY(sound)
+ADD_SUBDIRECTORY(weaponsystem)
+ADD_SUBDIRECTORY(worldentities)
 
 ORXONOX_ADD_LIBRARY(orxonox
   FIND_HEADER_FILES
+  TOLUA_FILES
+    LevelManager.h
+    pickup/BaseItem.h
+    pickup/PickupInventory.h
   DEFINE_SYMBOL
     "ORXONOX_SHARED_BUILD"
+  PCH_FILE
+    OrxonoxPrecompiledHeaders.h
   LINK_LIBRARIES
+    ${Boost_FILESYSTEM_LIBRARY}
+    ${Boost_SYSTEM_LIBRARY} # Filesystem dependency
+    ${Boost_THREAD_LIBRARY}
+    ${Boost_DATE_TIME_LIBRARY} # Thread dependency
+    ${OGRE_LIBRARY}
+    ${OPENAL_LIBRARY}
+    ${ALUT_LIBRARY}
+    ${VORBISFILE_LIBRARY}
+    ${VORBIS_LIBRARY}
+    ${OGG_LIBRARY}
+    tinyxml++_orxonox
     tolua++_orxonox
+    bullet_orxonox
     util
     core
+    network
+    tools
   SOURCE_FILES ${ORXONOX_SRC_FILES}
 )
Index: code/trunk/src/orxonox/CameraManager.cc
===================================================================
--- code/trunk/src/orxonox/CameraManager.cc	(revision 5781)
+++ code/trunk/src/orxonox/CameraManager.cc	(revision 5781)
@@ -0,0 +1,143 @@
+/*
+ *   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:
+ *      Benjamin Knecht
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+#include "CameraManager.h"
+
+#include <OgreSceneManager.h>
+#include <OgreViewport.h>
+#include <OgreCompositorManager.h>
+
+#include "util/StringUtils.h"
+#include "core/GameMode.h"
+#include "core/GUIManager.h"
+#include "core/ObjectList.h"
+#include "tools/Shader.h"
+#include "graphics/Camera.h"
+#include "Scene.h"
+
+namespace orxonox
+{
+    CameraManager* CameraManager::singletonPtr_s = 0;
+
+    CameraManager::CameraManager(Ogre::Viewport* viewport)
+        : viewport_(viewport)
+    {
+        this->fallbackCamera_ = 0;
+    }
+
+    CameraManager::~CameraManager()
+    {
+        if (this->fallbackCamera_)
+            this->fallbackCamera_->getSceneManager()->destroyCamera(this->fallbackCamera_);
+    }
+
+    Camera* CameraManager::getActiveCamera() const
+    {
+        if (this->cameraList_.size() > 0)
+            return this->cameraList_.front();
+        else
+            return 0;
+    }
+
+    void CameraManager::requestFocus(Camera* camera)
+    {
+        if (!GameMode::showsGraphics())
+            return;
+
+        // notify old camera (if it exists)
+        if (this->cameraList_.size() > 0)
+            this->cameraList_.front()->removeFocus();
+        else if (this->fallbackCamera_)
+        {
+            this->fallbackCamera_->getSceneManager()->destroyCamera(this->fallbackCamera_);
+            this->fallbackCamera_ = 0;
+        }
+
+        camera->setFocus();
+
+        // make sure we don't add it twice
+        for (std::list<Camera*>::iterator it = this->cameraList_.begin(); it != this->cameraList_.end(); ++it)
+            if ((*it) == camera)
+                return;
+
+        // add to list
+        this->cameraList_.push_front(camera);
+    }
+
+    void CameraManager::releaseFocus(Camera* camera)
+    {
+        if (!GameMode::showsGraphics())
+            return;
+
+        // notify the cam of releasing the focus
+        if (this->cameraList_.front() == camera)
+        {
+            camera->removeFocus();
+            this->cameraList_.pop_front();
+
+            // set new focus if possible
+            if (this->cameraList_.size() > 0)
+                this->cameraList_.front()->setFocus();
+            else
+            {
+                // there are no more cameras, create a fallback
+                if (!this->fallbackCamera_)
+                    this->fallbackCamera_ = camera->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
+                this->useCamera(this->fallbackCamera_);
+            }
+        }
+        else
+        {
+            this->cameraList_.remove(camera);
+        }
+    }
+
+    void CameraManager::useCamera(Ogre::Camera* camera)
+    {
+        // This workaround is needed to avoid weird behaviour with active compositors while
+        // switching the camera (like freezing the image)
+        //
+        // Last known Ogre version needing this workaround:
+        // 1.4.8
+
+        // deactivate all compositors
+        {
+            Ogre::ResourceManager::ResourceMapIterator iterator = Ogre::CompositorManager::getSingleton().getResourceIterator();
+            while (iterator.hasMoreElements())
+                Ogre::CompositorManager::getSingleton().setCompositorEnabled(this->viewport_, iterator.getNext()->getName(), false);
+        }
+
+        this->viewport_->setCamera(camera);
+        GUIManager::getInstance().setCamera(camera);
+
+        // reactivate all visible compositors
+        {
+            for (ObjectList<Shader>::iterator it = ObjectList<Shader>::begin(); it != ObjectList<Shader>::end(); ++it)
+                it->updateVisibility();
+        }
+    }
+}
Index: code/trunk/src/orxonox/CameraManager.h
===================================================================
--- code/trunk/src/orxonox/CameraManager.h	(revision 5781)
+++ code/trunk/src/orxonox/CameraManager.h	(revision 5781)
@@ -0,0 +1,74 @@
+/*
+ *   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:
+ *      Benjamin Knecht
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+
+ /**
+ @file
+ @brief Handles the instances of Camera class
+ @author Benjamin Knecht <beni_at_orxonox.net>
+  */
+
+#ifndef _CameraManager_H__
+#define _CameraManager_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <cassert>
+#include <list>
+#include "util/OgreForwardRefs.h"
+#include "util/Singleton.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport CameraManager : public Singleton<CameraManager>
+    {
+            friend class Singleton<CameraManager>;
+        public:
+            CameraManager(Ogre::Viewport* viewport);
+            ~CameraManager();
+
+            Camera* getActiveCamera() const;
+
+            void requestFocus(Camera* camera);
+            void releaseFocus(Camera* camera);
+
+            void useCamera(Ogre::Camera* camera);
+
+            static CameraManager* getInstancePtr() { return singletonPtr_s; }
+
+        private:
+            CameraManager(const CameraManager&); // don't use
+
+            std::list<Camera*>    cameraList_;
+            Ogre::Viewport*       viewport_;
+            Ogre::Camera*         fallbackCamera_;
+
+            static CameraManager* singletonPtr_s;
+    };
+}
+
+#endif /* _CameraManager_H__ */
Index: code/trunk/src/orxonox/GSRoot.cc
===================================================================
--- code/trunk/src/orxonox/GSRoot.cc	(revision 5774)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/*
- *   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:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "GSRoot.h"
-
-#include "core/Clock.h"
-#include "core/Game.h"
-
-namespace orxonox
-{
-    DeclareGameState(GSRoot, "root", false, false);
-
-    GSRoot::GSRoot(const GameStateInfo& info)
-        : GameState(info)
-    {
-    }
-
-    GSRoot::~GSRoot()
-    {
-    }
-
-    void GSRoot::activate()
-    {
-    }
-
-    void GSRoot::deactivate()
-    {
-    }
-
-    void GSRoot::update(const Clock& time)
-    {
-    }
-}
Index: code/trunk/src/orxonox/GSRoot.h
===================================================================
--- code/trunk/src/orxonox/GSRoot.h	(revision 5774)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- *   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:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _GSRoot_H__
-#define _GSRoot_H__
-
-#include "OrxonoxPrereqs.h"
-#include "core/GameState.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport GSRoot : public GameState
-    {
-    public:
-        GSRoot(const GameStateInfo& info);
-        ~GSRoot();
-
-        void activate();
-        void deactivate();
-        void update(const Clock& time);
-
-    private:
-    };
-}
-
-#endif /* _GSRoot_H__ */
Index: code/trunk/src/orxonox/Level.cc
===================================================================
--- code/trunk/src/orxonox/Level.cc	(revision 5781)
+++ code/trunk/src/orxonox/Level.cc	(revision 5781)
@@ -0,0 +1,177 @@
+/*
+ *   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 "Level.h"
+
+#include "util/Math.h"
+#include "core/Core.h"
+#include "core/CoreIncludes.h"
+#include "core/Loader.h"
+#include "core/Template.h"
+#include "core/XMLFile.h"
+#include "core/XMLPort.h"
+
+#include "infos/PlayerInfo.h"
+#include "gametypes/Gametype.h"
+#include "overlays/OverlayGroup.h"
+#include "sound/SoundBase.h"
+#include "LevelManager.h"
+
+namespace orxonox
+{
+    CreateFactory(Level);
+
+    Level::Level(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
+    {
+        RegisterObject(Level);
+
+        this->registerVariables();
+        this->xmlfilename_ = this->getFilename();
+    }
+
+    Level::~Level()
+    {
+        if (this->isInitialized())
+        {
+            if (LevelManager::getInstancePtr())
+                LevelManager::getInstance().releaseActivity(this);
+
+            if (this->xmlfile_)
+                Loader::unload(this->xmlfile_);
+
+            if(this->ambientsound_ != NULL)
+                delete this->ambientsound_;
+        }
+    }
+
+    void Level::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Level, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode);
+        XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
+
+        XMLPortParamLoadOnly(Level, "ambientsound", loadAmbientSound, xmlelement, mode);
+
+        XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);
+    }
+
+    void Level::registerVariables()
+    {
+        registerVariable(this->xmlfilename_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
+        registerVariable(this->name_,        VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::changedName));
+        registerVariable(this->description_, VariableDirection::ToClient);
+    }
+
+    void Level::networkcallback_applyXMLFile()
+    {
+        COUT(0) << "Loading level \"" << this->xmlfilename_ << "\"..." << std::endl;
+
+        ClassTreeMask mask;
+        mask.exclude(Class(BaseObject));
+        mask.include(Class(Template));
+        mask.include(Class(OverlayGroup)); // HACK to include the ChatOverlay
+
+        this->xmlfile_ = new XMLFile(mask, this->xmlfilename_);
+
+        Loader::open(this->xmlfile_);
+    }
+
+    void Level::setGametypeString(const std::string& gametype)
+    {
+        Identifier* identifier = ClassByString(gametype);
+
+        if (!identifier || !identifier->isA(Class(Gametype)))
+        {
+            COUT(0) << "Error: \"" << gametype << "\" is not a valid gametype." << std::endl;
+            identifier = Class(Gametype);
+            this->gametype_ = "Gametype";
+        }
+        else
+            this->gametype_ = gametype;
+
+std::cout << "Load Gametype: " << this->gametype_ << std::endl;
+
+        Gametype* rootgametype = orxonox_cast<Gametype*>(identifier->fabricate(this));
+        this->setGametype(rootgametype);
+
+std::cout << "root gametype: " << rootgametype->getIdentifier()->getName() << std::endl;
+
+        for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
+            (*it)->setGametype(rootgametype);
+
+        if (LevelManager::getInstancePtr())
+            LevelManager::getInstance().requestActivity(this);
+    }
+
+
+    void Level::addObject(BaseObject* object)
+    {
+        this->objects_.push_back(object);
+        object->setGametype(this->getGametype());
+    }
+
+    BaseObject* Level::getObject(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<BaseObject*>::const_iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+
+    void Level::loadAmbientSound(const std::string& filename)
+    {
+        if(filename == "") return;
+        else
+        {
+            if(this->ambientsound_ == NULL)
+            {
+                this->ambientsound_ = new SoundBase();
+            }
+
+            this->ambientsound_->loadFile(filename);
+            this->ambientsound_->play(true);
+        }
+    }
+
+    void Level::playerEntered(PlayerInfo* player)
+    {
+        COUT(3) << "player entered level (id: " << player->getClientID() << ", name: " << player->getName() << ")" << std::endl;
+        player->setGametype(this->getGametype());
+    }
+
+    void Level::playerLeft(PlayerInfo* player)
+    {
+        COUT(3) << "player left level (id: " << player->getClientID() << ", name: " << player->getName() << ")" << std::endl;
+        player->setGametype(0);
+    }
+}
Index: code/trunk/src/orxonox/Level.h
===================================================================
--- code/trunk/src/orxonox/Level.h	(revision 5781)
+++ code/trunk/src/orxonox/Level.h	(revision 5781)
@@ -0,0 +1,80 @@
+/*
+ *   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 _Level_H__
+#define _Level_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <list>
+#include <string>
+#include "core/BaseObject.h"
+#include "network/synchronisable/Synchronisable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Level : public BaseObject, public Synchronisable
+    {
+        public:
+            Level(BaseObject* creator);
+            virtual ~Level();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            inline void setDescription(const std::string& description)
+                { this->description_ = description; }
+            inline const std::string& getDescription() const
+                { return this->description_; }
+
+            void loadAmbientSound(const std::string& filename);
+
+            void playerEntered(PlayerInfo* player);
+            void playerLeft(PlayerInfo* player);
+
+        private:
+            void addObject(BaseObject* object);
+            BaseObject* getObject(unsigned int index) const;
+
+            void setGametypeString(const std::string& gametype);
+            inline const std::string& getGametypeString() const
+                { return this->gametype_; }
+
+            void networkcallback_applyXMLFile();
+
+            std::string            description_;
+            std::string            gametype_;
+            std::string            xmlfilename_;
+            XMLFile*               xmlfile_;
+            std::list<BaseObject*> objects_;
+
+            SoundBase*             ambientsound_;
+    };
+}
+
+#endif /* _Level_H__ */
Index: code/trunk/src/orxonox/LevelManager.cc
===================================================================
--- code/trunk/src/orxonox/LevelManager.cc	(revision 5781)
+++ code/trunk/src/orxonox/LevelManager.cc	(revision 5781)
@@ -0,0 +1,150 @@
+/*
+ *   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 "LevelManager.h"
+
+#include <map>
+#include <OgreResourceGroupManager.h>
+
+#include "core/CommandLine.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/Core.h"
+#include "core/CoreIncludes.h"
+#include "core/Loader.h"
+#include "PlayerManager.h"
+#include "Level.h"
+#include "infos/HumanPlayer.h"
+
+namespace orxonox
+{
+    SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)");
+
+    LevelManager* LevelManager::singletonPtr_s = 0;
+
+    LevelManager::LevelManager()
+    {
+        RegisterRootObject(LevelManager);
+        this->setConfigValues();
+
+        // check override
+        if (!CommandLine::getArgument("level")->hasDefaultValue())
+        {
+            ModifyConfigValue(defaultLevelName_, tset, CommandLine::getValue("level").getString());
+        }
+    }
+
+    LevelManager::~LevelManager()
+    {
+    }
+
+    void LevelManager::setConfigValues()
+    {
+        SetConfigValue(defaultLevelName_, "presentation_dm.oxw")
+            .description("Sets the preselection of the level in the main menu.");
+    }
+
+    void LevelManager::requestActivity(Level* level)
+    {
+        this->levels_s.push_back(level);
+        if (this->levels_s.size() == 1)
+            this->activateNextLevel();
+    }
+
+    void LevelManager::releaseActivity(Level* level)
+    {
+        if (this->levels_s.size() > 0)
+        {
+            if (this->levels_s.front() == level)
+            {
+                level->setActive(false);
+                this->levels_s.pop_front();
+                this->activateNextLevel();
+            }
+            else
+            {
+                for (std::list<Level*>::iterator it = this->levels_s.begin(); it != this->levels_s.end(); ++it)
+                    if ((*it) == level)
+                        this->levels_s.erase(it);
+            }
+        }
+    }
+
+    Level* LevelManager::getActiveLevel()
+    {
+        if (this->levels_s.size() > 0)
+            return this->levels_s.front();
+        else
+            return 0;
+    }
+
+    void LevelManager::activateNextLevel()
+    {
+        if (this->levels_s.size() > 0)
+        {
+            this->levels_s.front()->setActive(true);
+            for (std::map<unsigned int, PlayerInfo*>::const_iterator it = PlayerManager::getInstance().getClients().begin(); it != PlayerManager::getInstance().getClients().end(); ++it)
+                this->levels_s.front()->playerEntered(it->second);
+        }
+    }
+
+    void LevelManager::setDefaultLevel(const std::string& levelName)
+    {
+        ModifyConfigValue(defaultLevelName_, set, levelName);
+    }
+
+    const std::string& LevelManager::getDefaultLevel() const
+    {
+        return defaultLevelName_;
+    }
+
+    std::string LevelManager::getAvailableLevelListItem(unsigned int index) const
+    {
+        if (index >= availableLevels_.size())
+            return std::string();
+        else
+            return availableLevels_[index];
+    }
+
+    void LevelManager::compileAvailableLevelList()
+    {
+        availableLevels_.clear();
+
+        availableLevels_ = *Ogre::ResourceGroupManager::getSingleton().findResourceNames(
+            Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, "*.oxw");
+
+        for (std::vector<std::string>::iterator it = availableLevels_.begin(); it != availableLevels_.end();)
+            if (it->find("old/") == 0)
+                it = availableLevels_.erase(it);
+            else
+            {
+                size_t pos = it->find(".oxw");
+                *it = it->substr(0, pos);
+                ++it;
+            }
+    }
+}
Index: code/trunk/src/orxonox/LevelManager.h
===================================================================
--- code/trunk/src/orxonox/LevelManager.h	(revision 5781)
+++ code/trunk/src/orxonox/LevelManager.h	(revision 5781)
@@ -0,0 +1,82 @@
+/*
+ *   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 _LevelManager_H__
+#define _LevelManager_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <cassert>
+#include <list>
+#include <string>
+
+#include "util/Singleton.h"
+#include "core/OrxonoxClass.h"
+
+// tolua_begin
+namespace orxonox
+{
+    class _OrxonoxExport LevelManager
+    // tolua_end
+        : public Singleton<LevelManager>, public OrxonoxClass
+    { // tolua_export
+            friend class Singleton<LevelManager>;
+        public:
+            LevelManager();
+            virtual ~LevelManager();
+
+            void setConfigValues();
+
+            void requestActivity(Level* level);
+            void releaseActivity(Level* level);
+            Level* getActiveLevel();
+
+            void setDefaultLevel(const std::string& levelName); //tolua_export
+            const std::string& getDefaultLevel() const; //tolua_export
+            void compileAvailableLevelList(); //tolua_export
+            std::string getAvailableLevelListItem(unsigned int index) const; //tolua_export
+
+            static LevelManager* getInstancePtr() { return singletonPtr_s; }
+            static LevelManager& getInstance()    { return Singleton<LevelManager>::getInstance(); } // tolua_export
+
+        private:
+            LevelManager(const LevelManager&);
+
+            void activateNextLevel();
+
+            std::list<Level*> levels_s;
+            std::vector<std::string> availableLevels_;
+
+            // config values
+            std::string defaultLevelName_;
+
+            static LevelManager* singletonPtr_s;
+    }; // tolua_export
+} // tolua_export
+
+#endif /* _LevelManager_H__ */
Index: code/trunk/src/orxonox/Main.cc
===================================================================
--- code/trunk/src/orxonox/Main.cc	(revision 5774)
+++ code/trunk/src/orxonox/Main.cc	(revision 5781)
@@ -41,5 +41,15 @@
 #include "core/Game.h"
 #include "core/LuaState.h"
+#include "ToluaBindOrxonox.h"
 #include "Main.h"
+
+SetCommandLineSwitch(console).information("Start in console mode (text IO only)");
+// Shortcuts for easy direct loading
+SetCommandLineSwitch(server).information("Start in server mode");
+SetCommandLineSwitch(client).information("Start in client mode");
+SetCommandLineSwitch(dedicated).information("Start in dedicated server mode");
+SetCommandLineSwitch(standalone).information("Start in standalone mode");
+
+DeclareToluaInterface(Orxonox);
 
 namespace orxonox
@@ -55,7 +65,32 @@
         game->setStateHierarchy(
         "root"
+        " graphics"
+        "  mainMenu"
+        "  standalone"
+        "   level"
+        "  server"
+        "   level"
+        "  client"
+        "   level"
+        " dedicated"
+        "  level"
+        " ioConsole"
         );
 
         game->requestState("root");
+
+        // Some development hacks (not really, but in the future, this calls won't make sense anymore)
+        if (CommandLine::getValue("standalone").getBool())
+            Game::getInstance().requestStates("graphics, standalone, level");
+        else if (CommandLine::getValue("server").getBool())
+            Game::getInstance().requestStates("graphics, server, level");
+        else if (CommandLine::getValue("client").getBool())
+            Game::getInstance().requestStates("graphics, client, level");
+        else if (CommandLine::getValue("dedicated").getBool())
+            Game::getInstance().requestStates("dedicated, level");
+        else if (CommandLine::getValue("console").getBool())
+            Game::getInstance().requestStates("ioConsole");
+        else
+            Game::getInstance().requestStates("graphics, mainMenu");
 
         game->run();
Index: code/trunk/src/orxonox/OrxonoxPrecompiledHeaders.h
===================================================================
--- code/trunk/src/orxonox/OrxonoxPrecompiledHeaders.h	(revision 5781)
+++ code/trunk/src/orxonox/OrxonoxPrecompiledHeaders.h	(revision 5781)
@@ -0,0 +1,97 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Compilation of the most often used header files in the orxonox library
+@details
+    Updated: 13. September 2009
+    Total Files: 88
+*/
+
+#include "OrxonoxConfig.h"
+
+///////////////////////////////////////////
+/////          Stable Headers         /////
+///////////////////////////////////////////
+
+#include <cassert>  // 87
+#include <cstring>  // 87
+#include <fstream>  // 87
+#include <iostream> // 87
+#include <map>      // 87
+#include <set>      // 87
+#include <sstream>  // 87
+#include <string>   // 87
+#include <vector>   // 87
+#include <list>     // 86
+#include <ctime>    // 82
+#include <cmath>    // 81
+#include <deque>    // 81
+#include <queue>    // 81
+
+#include <OgreMath.h>        // 81
+#include <OgreVector2.h>     // 81
+#include <OgreVector3.h>     // 81
+#include <OgreVector4.h>     // 81
+#include <OgreQuaternion.h>  // 81
+#include <OgreColourValue.h> // 81
+
+#include "util/OgreForwardRefs.h"     // 67
+#include <LinearMath/btMotionState.h> // 60
+#include "util/SubString.h" // 55
+#include <tinyxml/ticpp.h>  // 41
+
+//#include <OgreRenderable.h> // 14, 5.1MB
+//#include <OgreSceneNode.h>  // 13, 1MB
+//#include <OgreResourceGroupManager.h> // 12, 1.5MB
+//#include <OgreTexture.h>       // 11, 0.6MB
+//#include <OgreMovableObject.h> // 10, 1.6MB
+//#include <OgreSceneManager.h>  // 9, 8.7MB
+
+///////////////////////////////////////////
+/////       All Rebuild Headers       /////
+///////////////////////////////////////////
+
+#include "core/BaseObject.h"   // 82
+#include "core/CoreIncludes.h" // 80
+
+///////////////////////////////////////////
+/////      Not so Stable Headers      /////
+///////////////////////////////////////////
+
+#include "network/synchronisable/Synchronisable.h" // 70
+#include "util/MultiType.h"    // 65
+#include "core/Executor.h"     // 55
+//#include "core/XMLPort.h"     // 41
+
+
+// Just in case some header included windows.h
+#undef min
+#undef max
Index: code/trunk/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 5774)
+++ code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 5781)
@@ -36,4 +36,6 @@
 
 #include "OrxonoxConfig.h"
+
+#include "tools/ToolsPrereqs.h"
 
 //-----------------------------------------------------------------------
Index: code/trunk/src/orxonox/PawnManager.cc
===================================================================
--- code/trunk/src/orxonox/PawnManager.cc	(revision 5781)
+++ code/trunk/src/orxonox/PawnManager.cc	(revision 5781)
@@ -0,0 +1,67 @@
+/*
+ *   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 "PawnManager.h"
+
+#include "core/CoreIncludes.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    PawnManager* PawnManager::singletonPtr_s = 0;
+
+    PawnManager::PawnManager()
+    {
+        RegisterRootObject(PawnManager);
+    }
+
+    PawnManager::~PawnManager()
+    {
+    }
+
+    void PawnManager::touch()
+    {
+        if (!PawnManager::singletonPtr_s)
+            new PawnManager();
+    }
+
+    void PawnManager::tick(float dt)
+    {
+        unsigned int count = 0;
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++count)
+        {
+            if (!it->isAlive())
+                delete (*(it++));
+            else
+                ++it;
+        }
+
+        if (count == 0)
+            delete this;
+    }
+}
Index: code/trunk/src/orxonox/PawnManager.h
===================================================================
--- code/trunk/src/orxonox/PawnManager.h	(revision 5781)
+++ code/trunk/src/orxonox/PawnManager.h	(revision 5781)
@@ -0,0 +1,55 @@
+/*
+ *   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 _PawnManager_H__
+#define _PawnManager_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Singleton.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PawnManager : protected Singleton<PawnManager>, public Tickable
+    {
+            friend class Singleton<PawnManager>;
+        public:
+            static void touch();
+
+            virtual void tick(float dt);
+
+        private:
+            PawnManager();
+            virtual ~PawnManager();
+
+            static PawnManager* singletonPtr_s;
+    };
+}
+
+#endif /* _PawnManager_H__ */
Index: code/trunk/src/orxonox/PlayerManager.cc
===================================================================
--- code/trunk/src/orxonox/PlayerManager.cc	(revision 5781)
+++ code/trunk/src/orxonox/PlayerManager.cc	(revision 5781)
@@ -0,0 +1,108 @@
+/*
+ *   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 "PlayerManager.h"
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "Level.h"
+#include "infos/HumanPlayer.h"
+#include "LevelManager.h"
+
+namespace orxonox
+{
+    PlayerManager* PlayerManager::singletonPtr_s = 0;
+
+    PlayerManager::PlayerManager()
+    {
+        RegisterRootObject(PlayerManager);
+
+        this->getConnectedClients();
+    }
+
+    PlayerManager::~PlayerManager()
+    {
+    }
+
+    void PlayerManager::clientConnected(unsigned int clientID)
+    {
+        if (GameMode::isMaster())
+        {
+            if (clientID != 0)
+                COUT(3) << "client connected" << std::endl;
+
+            // create new HumanPlayer instance
+            HumanPlayer* player = new HumanPlayer(0);
+            player->setClientID(clientID);
+
+            // add to clients-map
+            assert(!this->clients_[clientID]);
+            this->clients_[clientID] = player;
+
+            if (LevelManager::getInstancePtr() && LevelManager::getInstance().getActiveLevel())
+                LevelManager::getInstance().getActiveLevel()->playerEntered(player);
+        }
+    }
+
+    void PlayerManager::clientDisconnected(unsigned int clientID)
+    {
+        if (GameMode::isMaster())
+        {
+            COUT(3) << "client disconnected" << std::endl;
+
+            // remove from clients-map
+            PlayerInfo* player = this->clients_[clientID];
+            this->clients_.erase(clientID);
+
+            if (LevelManager::getInstancePtr() && LevelManager::getInstance().getActiveLevel())
+                LevelManager::getInstance().getActiveLevel()->playerLeft(player);
+
+            // delete PlayerInfo instance
+            if (player)
+                delete player;
+        }
+    }
+
+
+    PlayerInfo* PlayerManager::getClient(unsigned int clientID) const
+    {
+        if (GameMode::isMaster())
+        {
+            std::map<unsigned int, PlayerInfo*>::const_iterator it = this->clients_.find(clientID);
+            if (it != this->clients_.end())
+                return it->second;
+        }
+        else
+        {
+            for (ObjectList<PlayerInfo>::iterator it = ObjectList<PlayerInfo>::begin(); it != ObjectList<PlayerInfo>::end(); ++it)
+                if (it->getClientID() == clientID)
+                    return (*it);
+        }
+        return 0;
+    }
+}
Index: code/trunk/src/orxonox/PlayerManager.h
===================================================================
--- code/trunk/src/orxonox/PlayerManager.h	(revision 5781)
+++ code/trunk/src/orxonox/PlayerManager.h	(revision 5781)
@@ -0,0 +1,62 @@
+/*
+ *   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 _PlayerManager_H__
+#define _PlayerManager_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <cassert>
+#include <map>
+#include "util/Singleton.h"
+#include "network/ClientConnectionListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PlayerManager : public Singleton<PlayerManager>, public ClientConnectionListener
+    {
+            friend class Singleton<PlayerManager>;
+        public:
+            PlayerManager();
+            virtual ~PlayerManager();
+
+            PlayerInfo* getClient(unsigned int clientID) const;
+            inline const std::map<unsigned int, PlayerInfo*>& getClients() const
+                { return this->clients_; }
+
+        private:
+            void clientConnected(unsigned int clientID);
+            void clientDisconnected(unsigned int clientID);
+
+            std::map<unsigned int, PlayerInfo*> clients_;
+
+            static PlayerManager* singletonPtr_s;
+    };
+}
+
+#endif /* _PlayerManager_H__ */
Index: code/trunk/src/orxonox/Radar.cc
===================================================================
--- code/trunk/src/orxonox/Radar.cc	(revision 5781)
+++ code/trunk/src/orxonox/Radar.cc	(revision 5781)
@@ -0,0 +1,216 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      Felix Schulthess
+ *
+ */
+
+/**
+@file
+@brief
+*/
+
+#include "Radar.h"
+
+#include <cassert>
+
+//#include "util/Math.h"
+#include "core/ConsoleCommand.h"
+#include "core/ObjectList.h"
+#include "interfaces/RadarListener.h"
+
+namespace orxonox
+{
+    SetConsoleCommand(Radar, cycleNavigationFocus, true).accessLevel(AccessLevel::User);
+    SetConsoleCommand(Radar, releaseNavigationFocus, true).accessLevel(AccessLevel::User);
+
+    Radar* Radar::instance_s = 0;
+
+    Radar::Radar()
+        : focus_(0)
+        , objectTypeCounter_(0)
+    {
+        assert(instance_s == 0);
+        instance_s = this;
+
+        // TODO: make this mapping configurable. Maybe there's a possibility with self configured
+        //       configValues..
+        this->objectTypes_["Asteroid"] = RadarViewable::Dot;
+        this->objectTypes_["SpaceShip"] = RadarViewable::Square;
+        this->objectTypes_["AsdfQwerty"] = RadarViewable::Triangle;
+
+        /*WorldEntity* object;
+        object = new WorldEntity();
+        object->setPosition(2000.0, 0.0, 0.0);
+        addRadarObject(object, ColourValue(0.5, 0, 0, 1));
+        object = new WorldEntity();
+        object->setPosition(0.0, 2000.0, 0.0);
+        addRadarObject(object, ColourValue(0.5, 0, 0, 1));
+        object = new WorldEntity();
+        object->setPosition(0.0, 0.0, 2000.0);
+        addRadarObject(object, ColourValue(0.5, 0, 0, 1));
+        object = new WorldEntity();
+        object->setPosition(10000.0,16000.0,0.0);
+        addRadarObject(object);*/
+
+    }
+
+    Radar::~Radar()
+    {
+        instance_s = 0;
+    }
+
+    const RadarViewable* Radar::getFocus()
+    {
+        return *(this->itFocus_);
+    }
+
+    RadarViewable::Shape Radar::addObjectDescription(const std::string name)
+    {
+        std::map<std::string, RadarViewable::Shape>::iterator it = this->objectTypes_.find(name);
+        if (it == this->objectTypes_.end())
+            return this->objectTypes_[name] = RadarViewable::Square; // default, configure!!
+        else
+            return this->objectTypes_[name];
+    }
+
+
+    void Radar::tick(float dt)
+    {
+        SUPER(Radar, tick, dt);
+
+        if (this->focus_ != *(this->itFocus_))
+        {
+            // focus object was deleted, release focus
+            this->focus_ = 0;
+            this->itFocus_ = 0;
+        }
+
+        for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
+        {
+            (*itListener)->radarTick(dt);
+
+            for (ObjectList<RadarViewable>::iterator itElement = ObjectList<RadarViewable>::begin(); itElement; ++itElement)
+            {
+                if ((*itElement)->getRadarVisibility())
+                    if ((*itListener)->getRadarSensitivity() > (*itElement)->getRadarObjectCamouflage())
+                        (*itListener)->displayObject(*itElement, *itElement == this->focus_);
+            }
+        }
+    }
+
+    void Radar::cycleFocus()
+    {
+        if (ObjectList<RadarViewable>::begin() == 0)
+        {
+            // list is empty
+            this->itFocus_ = 0;
+            this->focus_ = 0;
+        }
+/*
+        else if (this->owner_)
+        {
+            Vector3 localPosition = this->owner_->getPosition();
+            Vector3 targetPosition = localPosition;
+            if (*(this->itFocus_))
+                targetPosition = this->itFocus_->getRVWorldPosition();
+
+            // find the closed object further away than targetPosition
+            float currentDistance = localPosition.squaredDistance(targetPosition);
+            float nextDistance = FLT_MAX;
+            float minimumDistance = FLT_MAX;
+            ObjectList<RadarViewable>::iterator itFallback = 0;
+
+            for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it)
+            {
+                if (*it == static_cast<RadarViewable*>(this)->owner_)
+                    continue;
+
+                float targetDistance = localPosition.squaredDistance((*it)->getRVWorldPosition());
+                if (targetDistance > currentDistance && targetDistance < nextDistance)
+                {
+                    this->itFocus_ = it;
+                    nextDistance = targetDistance;
+                }
+                if (targetDistance < minimumDistance)
+                {
+                    itFallback = it;
+                    minimumDistance = targetDistance;
+                }
+            }
+
+            if (nextDistance == FLT_MAX)
+            {
+                // we already had the furthest object
+                this->itFocus_ = itFallback;
+                this->focus_ = *itFallback;
+            }
+            else
+            {
+                this->focus_ = *(this->itFocus_);
+            }
+        }
+*/
+    }
+
+    void Radar::releaseFocus()
+    {
+        this->itFocus_ = 0;
+        this->focus_ = 0;
+    }
+
+    void Radar::listObjects() const
+    {
+        COUT(3) << "List of RadarObjects:\n";
+        // iterate through all Radar Objects
+        unsigned int i = 0;
+        for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it, ++i)
+        {
+            COUT(3) << i++ << ": " << (*it)->getRVWorldPosition() << std::endl;
+        }
+    }
+
+
+    /*static*/ Radar& Radar::getInstance()
+    {
+        assert(instance_s);
+        return *instance_s;
+    }
+
+    /*static*/ void Radar::cycleNavigationFocus()
+    {
+        // avoid using getInstance because of the assert().
+        // User might call this fuction even if HUDNavigation doesn't exist.
+        if (instance_s)
+            instance_s->cycleFocus();
+    }
+
+    /*static*/ void Radar::releaseNavigationFocus()
+    {
+        // avoid using getInstance because of the assert().
+        // User might call this fuction even if HUDNavigation doesn't exist.
+        if (instance_s)
+            instance_s->releaseFocus();
+    }
+}
Index: code/trunk/src/orxonox/Radar.h
===================================================================
--- code/trunk/src/orxonox/Radar.h	(revision 5781)
+++ code/trunk/src/orxonox/Radar.h	(revision 5781)
@@ -0,0 +1,92 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      Felix Schulthess
+ *
+ */
+
+/**
+@file
+@brief
+*/
+
+#ifndef _Radar_H__
+#define _Radar_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <string>
+
+#include "core/ObjectListIterator.h"
+#include "interfaces/RadarViewable.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+    /**
+    @brief This class merely ensures that no one can inherit from Radar.
+    */
+    class _OrxonoxExport RadarBase
+    {
+    private:
+        friend class Radar;
+        RadarBase() { }
+    };
+
+    class _OrxonoxExport Radar : public Tickable, private virtual RadarBase
+    {
+    public:
+        Radar();
+        ~Radar();
+
+        virtual void tick(float dt);
+
+        const RadarViewable* getFocus();
+        RadarViewable::Shape addObjectDescription(const std::string name);
+
+        void listObjects() const;
+
+        static Radar& getInstance();
+        static Radar* getInstancePtr() { return instance_s; }
+
+        static void cycleNavigationFocus();
+        static void releaseNavigationFocus();
+
+    private:
+        Radar(Radar& instance);
+
+        void releaseFocus();
+        void updateFocus();
+        void cycleFocus();
+
+        ObjectListIterator<RadarViewable> itFocus_;
+        RadarViewable* focus_;
+        std::map<std::string, RadarViewable::Shape> objectTypes_;
+        int objectTypeCounter_;
+
+        static Radar* instance_s;
+    };
+}
+#endif /* _Radar_H__ */
Index: code/trunk/src/orxonox/Scene.cc
===================================================================
--- code/trunk/src/orxonox/Scene.cc	(revision 5781)
+++ code/trunk/src/orxonox/Scene.cc	(revision 5781)
@@ -0,0 +1,345 @@
+/*
+ *   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
+ *      Reto Grieder (physics)
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Scene.h"
+
+#include <OgreRoot.h>
+#include <OgreSceneManager.h>
+#include <OgreSceneManagerEnumerator.h>
+#include <OgreSceneNode.h>
+
+#include <BulletCollision/BroadphaseCollision/btAxisSweep3.h>
+#include <BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h>
+#include <BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h>
+#include <BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "tools/BulletConversions.h"
+#include "worldentities/WorldEntity.h"
+
+namespace orxonox
+{
+    CreateFactory(Scene);
+
+    Scene::Scene(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
+    {
+        RegisterObject(Scene);
+
+        this->setScene(this);
+        this->bShadows_ = true;
+
+        if (GameMode::showsGraphics())
+        {
+            assert(Ogre::Root::getSingletonPtr());
+            this->sceneManager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
+            this->rootSceneNode_ = this->sceneManager_->getRootSceneNode();
+        }
+        else
+        {
+            // create a dummy SceneManager of our own since we don't have Ogre::Root.
+            this->sceneManager_ = new Ogre::DefaultSceneManager("");
+            this->rootSceneNode_ = this->sceneManager_->getRootSceneNode();
+        }
+
+        // No physics yet, XMLPort will do that.
+        const int defaultMaxWorldSize = 100000;
+        this->negativeWorldRange_ = Vector3::UNIT_SCALE * -defaultMaxWorldSize;
+        this->positiveWorldRange_ = Vector3::UNIT_SCALE *  defaultMaxWorldSize;
+        this->gravity_ = Vector3::ZERO;
+        this->physicalWorld_   = 0;
+        this->solver_          = 0;
+        this->dispatcher_      = 0;
+        this->collisionConfig_ = 0;
+        this->broadphase_      = 0;
+
+        this->registerVariables();
+    }
+
+    Scene::~Scene()
+    {
+        if (this->isInitialized())
+        {
+            if (GameMode::showsGraphics())
+                Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_);
+            else
+                delete this->sceneManager_;
+
+            this->setPhysicalWorld(false);
+        }
+    }
+
+    void Scene::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Scene, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Scene, "skybox", setSkybox, getSkybox, xmlelement, mode);
+        XMLPortParam(Scene, "ambientlight", setAmbientLight, getAmbientLight, xmlelement, mode).defaultValues(ColourValue(0.2f, 0.2f, 0.2f, 1.0f));
+        XMLPortParam(Scene, "shadow", setShadow, getShadow, xmlelement, mode).defaultValues(true);
+
+        XMLPortParam(Scene, "gravity", setGravity, getGravity, xmlelement, mode);
+        XMLPortParam(Scene, "negativeWorldRange", setNegativeWorldRange, getNegativeWorldRange, xmlelement, mode);
+        XMLPortParam(Scene, "positiveWorldRange", setPositiveWorldRange, getPositiveWorldRange, xmlelement, mode);
+        XMLPortParam(Scene, "hasPhysics", setPhysicalWorld, hasPhysics, xmlelement, mode).defaultValues(true);
+
+        XMLPortObjectExtended(Scene, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);
+    }
+
+    void Scene::registerVariables()
+    {
+        registerVariable(this->skybox_,             VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
+        registerVariable(this->ambientLight_,       VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
+        registerVariable(this->negativeWorldRange_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_negativeWorldRange));
+        registerVariable(this->positiveWorldRange_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_positiveWorldRange));
+        registerVariable(this->gravity_,            VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_gravity));
+        registerVariable(this->bHasPhysics_,        VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_hasPhysics));
+        registerVariable(this->bShadows_,           VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyShadows));
+    }
+
+    void Scene::setNegativeWorldRange(const Vector3& range)
+    {
+        if (range.length() < 10.0f)
+        {
+            CCOUT(2) << "Warning: Setting the negative world range to a very small value: "
+                     << multi_cast<std::string>(range) << std::endl;
+        }
+        if (this->hasPhysics())
+        {
+            CCOUT(2) << "Warning: Attempting to set the physical world range at run time. "
+                     << "This causes a complete physical reload which might take some time." << std::endl;
+            this->setPhysicalWorld(false);
+            this->negativeWorldRange_ = range;
+            this->setPhysicalWorld(true);
+        }
+        else
+            this->negativeWorldRange_ = range;
+    }
+
+    void Scene::setPositiveWorldRange(const Vector3& range)
+    {
+        if (range.length() < 10.0f)
+        {
+            CCOUT(2) << "Warning: Setting the positive world range to a very small value: "
+                     << multi_cast<std::string>(range) << std::endl;
+        }
+        if (this->hasPhysics())
+        {
+            CCOUT(2) << "Warning: Attempting to set the physical world range at run time. "
+                     << "This causes a complete physical reload which might take some time." << std::endl;
+            this->setPhysicalWorld(false);
+            this->positiveWorldRange_ = range;
+            this->setPhysicalWorld(true);
+        }
+        else
+            this->positiveWorldRange_ = range;
+    }
+
+    void Scene::setGravity(const Vector3& gravity)
+    {
+        this->gravity_ = gravity;
+        if (this->hasPhysics())
+            this->physicalWorld_->setGravity(multi_cast<btVector3>(this->gravity_));
+    }
+
+    void Scene::setPhysicalWorld(bool wantPhysics)
+    {
+        this->bHasPhysics_ = wantPhysics;
+        if (wantPhysics && !hasPhysics())
+        {
+            // Note: These are all little known default classes and values.
+            //       It would require further investigation to properly dertermine the right choices.
+            this->broadphase_      = new bt32BitAxisSweep3(
+                multi_cast<btVector3>(this->negativeWorldRange_), multi_cast<btVector3>(this->positiveWorldRange_));
+            this->collisionConfig_ = new btDefaultCollisionConfiguration();
+            this->dispatcher_      = new btCollisionDispatcher(this->collisionConfig_);
+            this->solver_          = new btSequentialImpulseConstraintSolver();
+
+            this->physicalWorld_   = new btDiscreteDynamicsWorld(this->dispatcher_, this->broadphase_, this->solver_, this->collisionConfig_);
+            this->physicalWorld_->setGravity(multi_cast<btVector3>(this->gravity_));
+
+            // also set the collision callback variable.
+            // Note: This is a global variable which we assign a static function.
+            // TODO: Check whether this (or anything about Bullet) works with multiple physics engine instances.
+            gContactAddedCallback = &Scene::collisionCallback;
+        }
+        else if (!wantPhysics && hasPhysics())
+        {
+            // Remove all WorldEntities and shove them to the queue since they would still like to be in a physical world.
+            for (std::set<WorldEntity*>::const_iterator it = this->physicalObjects_.begin();
+                it != this->physicalObjects_.end(); ++it)
+            {
+                this->physicalWorld_->removeRigidBody((*it)->physicalBody_);
+                this->physicalObjectQueue_.insert(*it);
+            }
+            this->physicalObjects_.clear();
+
+            delete this->physicalWorld_;
+            delete this->solver_;
+            delete this->dispatcher_;
+            delete this->collisionConfig_;
+            delete this->broadphase_;
+            this->physicalWorld_   = 0;
+            this->solver_          = 0;
+            this->dispatcher_      = 0;
+            this->collisionConfig_ = 0;
+            this->broadphase_      = 0;
+        }
+    }
+
+    void Scene::tick(float dt)
+    {
+        if (!GameMode::showsGraphics())
+        {
+            // We need to update the scene nodes if we don't render
+            this->rootSceneNode_->_update(true, false);
+        }
+        if (this->hasPhysics())
+        {
+            // TODO: This here is bad practice! It will slow down the first tick() by ages.
+            //       Rather have an initialise() method as well, called by the Level after everything has been loaded.
+            if (this->physicalObjectQueue_.size() > 0)
+            {
+                // Add all scheduled WorldEntities
+                for (std::set<WorldEntity*>::const_iterator it = this->physicalObjectQueue_.begin();
+                    it != this->physicalObjectQueue_.end(); ++it)
+                {
+                    this->physicalWorld_->addRigidBody((*it)->physicalBody_);
+                    this->physicalObjects_.insert(*it);
+                }
+                this->physicalObjectQueue_.clear();
+            }
+
+            // Note: 60 means that Bullet will do physics correctly down to 1 frames per seconds.
+            //       Under that mark, the simulation will "loose time" and get unusable.
+            physicalWorld_->stepSimulation(dt, 60);
+        }
+    }
+
+    void Scene::setSkybox(const std::string& skybox)
+    {
+        if (GameMode::showsGraphics() && this->sceneManager_)
+            this->sceneManager_->setSkyBox(true, skybox);
+
+        this->skybox_ = skybox;
+    }
+
+    void Scene::setAmbientLight(const ColourValue& colour)
+    {
+        if (GameMode::showsGraphics() && this->sceneManager_)
+            this->sceneManager_->setAmbientLight(colour);
+
+        this->ambientLight_ = colour;
+    }
+
+    void Scene::setShadow(bool bShadow)
+    {
+        if (GameMode::showsGraphics() && this->sceneManager_)
+        {
+            if (bShadow)
+                this->sceneManager_->setShadowTechnique(Ogre::SHADOWTYPE_STENCIL_ADDITIVE);
+            else
+                this->sceneManager_->setShadowTechnique(Ogre::SHADOWTYPE_NONE);
+        }
+
+        this->bShadows_ = bShadow;
+    }
+
+    void Scene::addObject(BaseObject* object)
+    {
+        this->objects_.push_back(object);
+        object->setScene(this);
+    }
+
+    BaseObject* Scene::getObject(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<BaseObject*>::const_iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+
+    void Scene::addPhysicalObject(WorldEntity* object)
+    {
+        if (object)
+        {
+            std::set<WorldEntity*>::iterator it = this->physicalObjects_.find(object);
+            if (it != this->physicalObjects_.end())
+                return;
+
+            this->physicalObjectQueue_.insert(object);
+        }
+    }
+
+    void Scene::removePhysicalObject(WorldEntity* object)
+    {
+        // check queue first
+        std::set<WorldEntity*>::iterator it = this->physicalObjectQueue_.find(object);
+        if (it != this->physicalObjectQueue_.end())
+        {
+            this->physicalObjectQueue_.erase(it);
+            return;
+        }
+
+        it = this->physicalObjects_.find(object);
+        if (it == this->physicalObjects_.end())
+            return;
+        this->physicalObjects_.erase(it);
+
+        if (this->hasPhysics())
+            this->physicalWorld_->removeRigidBody(object->physicalBody_);
+    }
+
+    /*static*/ bool Scene::collisionCallback(btManifoldPoint& cp, const btCollisionObject* colObj0, int partId0,
+                                             int index0, const btCollisionObject* colObj1, int partId1, int index1)
+    {
+        // get the WorldEntity pointers
+        WorldEntity* object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
+        assert(orxonox_cast<WorldEntity*>(object0));
+        WorldEntity* object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
+        assert(orxonox_cast<WorldEntity*>(object1));
+
+        // false means that bullet will assume we didn't modify the contact
+        bool modified = false;
+        if (object0->isCollisionCallbackActive())
+        {
+            modified |= object0->collidesAgainst(object1, cp);
+            if (object1->isCollisionCallbackActive())
+                modified |= object1->collidesAgainst(object0, cp);
+        }
+        else
+            modified |= object1->collidesAgainst(object0, cp);
+
+        return modified;
+    }
+}
Index: code/trunk/src/orxonox/Scene.h
===================================================================
--- code/trunk/src/orxonox/Scene.h	(revision 5781)
+++ code/trunk/src/orxonox/Scene.h	(revision 5781)
@@ -0,0 +1,149 @@
+/*
+ *   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
+ *      Reto Grieder (physics)
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Scene_H__
+#define _Scene_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <list>
+#include <set>
+#include <string>
+
+#include "util/Math.h"
+#include "util/OgreForwardRefs.h"
+#include "core/BaseObject.h"
+#include "network/synchronisable/Synchronisable.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Scene : public BaseObject, public Synchronisable, public Tickable
+    {
+        public:
+            Scene(BaseObject* creator);
+            virtual ~Scene();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            inline Ogre::SceneManager* getSceneManager() const
+                { return this->sceneManager_; }
+            inline Ogre::SceneNode* getRootSceneNode() const
+                { return this->rootSceneNode_; }
+
+            void setSkybox(const std::string& skybox);
+            inline const std::string& getSkybox() const
+                { return this->skybox_; }
+
+            void setAmbientLight(const ColourValue& colour);
+            inline const ColourValue& getAmbientLight() const
+                { return this->ambientLight_; }
+
+            void setShadow(bool bShadow);
+            inline bool getShadow() const
+                { return this->bShadows_; }
+
+            virtual void tick(float dt);
+
+        private:
+            void addObject(BaseObject* object);
+            BaseObject* getObject(unsigned int index) const;
+
+            void networkcallback_applySkybox()
+                { this->setSkybox(this->skybox_); }
+            void networkcallback_applyAmbientLight()
+                { this->setAmbientLight(this->ambientLight_); }
+            void networkcallback_applyShadows()
+                { this->setShadow(this->bShadows_); }
+
+            Ogre::SceneManager*      sceneManager_;
+            Ogre::SceneNode*         rootSceneNode_;
+
+            std::string              skybox_;
+            ColourValue              ambientLight_;
+            std::list<BaseObject*>   objects_;
+            bool                     bShadows_;
+
+
+        /////////////
+        // Physics //
+        /////////////
+
+        public:
+            inline bool hasPhysics()
+                { return this->physicalWorld_ != 0; }
+            void setPhysicalWorld(bool wantsPhysics);
+
+            void setNegativeWorldRange(const Vector3& range);
+            inline const Vector3& getNegativeWorldRange() const
+                { return this->negativeWorldRange_; }
+
+            void setPositiveWorldRange(const Vector3& range);
+            inline const Vector3& getPositiveWorldRange() const
+                { return this->positiveWorldRange_; }
+
+            void setGravity(const Vector3& gravity);
+            inline const Vector3& getGravity() const
+                { return this->gravity_; }
+
+            void addPhysicalObject(WorldEntity* object);
+            void removePhysicalObject(WorldEntity* object);
+
+        private:
+            inline void networkcallback_hasPhysics()
+                { this->setPhysicalWorld(this->bHasPhysics_); }
+            inline void networkcallback_negativeWorldRange()
+                { this->setNegativeWorldRange(this->negativeWorldRange_); }
+            inline void networkcallback_positiveWorldRange()
+                { this->setPositiveWorldRange(this->positiveWorldRange_); }
+            inline void networkcallback_gravity()
+                { this->setGravity(this->gravity_); }
+
+            // collision callback from bullet
+            static bool collisionCallback(btManifoldPoint& cp, const btCollisionObject* colObj0, int partId0,
+                                          int index0, const btCollisionObject* colObj1, int partId1, int index1);
+
+            // Bullet objects
+            btDiscreteDynamicsWorld*             physicalWorld_;
+            bt32BitAxisSweep3*                   broadphase_;
+            btDefaultCollisionConfiguration*     collisionConfig_;
+            btCollisionDispatcher*               dispatcher_;
+            btSequentialImpulseConstraintSolver* solver_;
+
+            std::set<WorldEntity*>               physicalObjectQueue_;
+            std::set<WorldEntity*>               physicalObjects_;
+            bool                                 bHasPhysics_;
+            Vector3                              negativeWorldRange_;
+            Vector3                              positiveWorldRange_;
+            Vector3                              gravity_;
+    };
+}
+
+#endif /* _Scene_H__ */
Index: code/trunk/src/orxonox/Test.cc
===================================================================
--- code/trunk/src/orxonox/Test.cc	(revision 5781)
+++ code/trunk/src/orxonox/Test.cc	(revision 5781)
@@ -0,0 +1,145 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "network/NetworkFunction.h"
+#include "Test.h"
+#include "util/MultiType.h"
+
+namespace orxonox
+{
+	CreateFactory ( Test );
+  
+  SetConsoleCommand(Test, printV1, true).accessLevel(AccessLevel::User);
+  SetConsoleCommand(Test, printV2, true).accessLevel(AccessLevel::User);
+  SetConsoleCommand(Test, printV3, true).accessLevel(AccessLevel::User);
+  SetConsoleCommand(Test, printV4, true).accessLevel(AccessLevel::User);
+  SetConsoleCommand(Test, call, true).accessLevel(AccessLevel::User);
+  SetConsoleCommand(Test, call2, true).accessLevel(AccessLevel::User);
+  
+  
+  //void=* aaaaa = copyPtr<sizeof(&Test::printV1)>( &NETWORK_FUNCTION_POINTER, &Test::printV1 );
+  //void* NETWORK_FUNCTION_TEST_B = memcpy(&NETWORK_FUNCTION_POINTER, &a, sizeof(a));
+//   NetworkFunctionBase* NETWORK_FUNCTION_TEST_C = new NetworkFunctionStatic( createFunctor(&Test::printV1), "bla", NETWORK_FUNCTION_POINTER );
+  
+  registerStaticNetworkFunction( &Test::printV1 );
+  registerMemberNetworkFunction( Test, checkU1 );
+  registerMemberNetworkFunction( Test, printBlaBla );
+  
+  Test* Test::instance_ = 0;
+
+	Test::Test(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
+	{
+    assert(instance_==0);
+    instance_=this;
+		RegisterObject ( Test );
+    setConfigValues();
+    registerVariables();
+		setObjectMode(0x3);
+	}
+
+	Test::~Test()
+	{
+    instance_=0;
+	}
+
+	void Test::setConfigValues()
+	{
+		SetConfigValue ( u1, 1 )/*.callback ( this, &Test::checkV1 )*/;
+    SetConfigValue ( u2, 2 )/*.callback ( this, &Test::checkV2 )*/;
+    SetConfigValue ( u3, 3 )/*.callback ( this, &Test::checkV3 )*/;
+    SetConfigValue ( u4, 4 )/*.callback ( this, &Test::checkV4 )*/;
+    
+    SetConfigValue ( s1, 1 )/*.callback ( this, &Test::checkV1 )*/;
+    SetConfigValue ( s2, 2 )/*.callback ( this, &Test::checkV2 )*/;
+    SetConfigValue ( s3, 3 )/*.callback ( this, &Test::checkV3 )*/;
+    SetConfigValue ( s4, 4 )/*.callback ( this, &Test::checkV4 )*/;
+	}
+
+
+  void Test::registerVariables()
+  {
+    registerVariable ( u1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkU1 ));
+    registerVariable ( u2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkU2 ));
+    registerVariable ( u3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true );
+    registerVariable ( u4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true );
+    
+    registerVariable ( s1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkS1 ));
+    registerVariable ( s2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkS2 ));
+    registerVariable ( s3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true );
+    registerVariable ( s4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true );
+  }
+  
+  void Test::call(unsigned int clientID)
+  {
+    callStaticNetworkFunction( &Test::printV1, clientID );
+    callStaticNetworkFunction( &Test::printV1, clientID );
+  }
+  
+  void Test::call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4)
+  {
+    callMemberNetworkFunction( Test, printBlaBla, this->getObjectID(), clientID, s1, s2, s3, s4, s4 );
+  }
+  
+  void Test::tick(float dt)
+  {
+//     std::string str1 = "blub";
+//     //MultiType mt1(std::string("blub"));
+//     MultiType mt1(str1);
+//     uint8_t* mem = new uint8_t[mt1.getNetworkSize()];
+//     uint8_t* temp = mem;
+//     mt1.exportData( temp );
+//     assert( temp-mem == mt1.getNetworkSize() );
+//     MultiType mt2;
+//     temp = mem;
+//     mt2.importData( temp );
+//     assert( temp-mem == mt1.getNetworkSize() );
+//     COUT(0) << mt2 << endl;
+    if(!Core::isMaster())
+      call2(0, "bal", "a", "n", "ce");
+//       callMemberNetworkFunction( Test, checkU1, this->getObjectID(), 0 );
+  }
+  
+  void Test::printBlaBla(std::string s1, std::string s2, std::string s3, std::string s4, std::string s5)
+  {
+    COUT(0) << s1 << s2 << s3 << s4 << s5 << endl;
+  }
+  
+  void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; }
+  void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; }
+  void Test::checkU3(){ COUT(1) << "U3 changed: " << u3 << std::endl; }
+  void Test::checkU4(){ COUT(1) << "U4 changed: " << u4 << std::endl; }
+
+  void Test::checkS1(){ COUT(1) << "S1 changed: " << s1 << std::endl; }
+  void Test::checkS2(){ COUT(1) << "S2 changed: " << s2 << std::endl; }
+  void Test::checkS3(){ COUT(1) << "S3 changed: " << s3 << std::endl; }
+  void Test::checkS4(){ COUT(1) << "S4 changed: " << s4 << std::endl; }
+
+}
Index: code/trunk/src/orxonox/Test.h
===================================================================
--- code/trunk/src/orxonox/Test.h	(revision 5781)
+++ code/trunk/src/orxonox/Test.h	(revision 5781)
@@ -0,0 +1,100 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Test_H__
+#define _Test_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/BaseObject.h"
+#include "network/synchronisable/Synchronisable.h"
+#include "tools/interfaces/Tickable.h"
+
+
+typedef int TYPE;
+typedef unsigned int UTYPE;
+
+
+namespace orxonox
+{
+  class _OrxonoxExport Test: public BaseObject, public Synchronisable, public Tickable
+  {
+    public:
+      Test(BaseObject* creator);
+      virtual ~Test();
+
+      void setConfigValues();
+      void registerVariables();
+
+      static void call(unsigned int clientID);
+      void call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4);
+      virtual void tick(float dt);
+
+
+      //unsigned functions
+      void setU1(UTYPE value){ u1 = value; }
+      void setU2(UTYPE value){ u2 = value; }
+      void setU3(UTYPE value){ u3 = value; }
+      void setU4(UTYPE value){ u4 = value; }
+      void checkU1();
+      void checkU2();
+      void checkU3();
+      void checkU4();
+
+      //signed functions
+      void setS1(TYPE value){ s1 = value; }
+      void setS2(TYPE value){ s2 = value; }
+      void setS3(TYPE value){ s3 = value; }
+      void setS4(TYPE value){ s4 = value; }
+      void checkS1();
+      void checkS2();
+      void checkS3();
+      void checkS4();
+
+      static void printV1(){ instance_->checkU1(); }
+      static void printV2(){ instance_->checkU2(); }
+      static void printV3(){ instance_->checkU3(); }
+      static void printV4(){ instance_->checkU4(); }
+
+      void printBlaBla(std::string s1, std::string s2, std::string s3, std::string s4, std::string s5);
+
+    private:
+      UTYPE u1;
+      UTYPE u2;
+      UTYPE u3;
+      UTYPE u4;
+
+      TYPE s1;
+      TYPE s2;
+      TYPE s3;
+      TYPE s4;
+
+      static Test* instance_;
+  };
+}
+
+#endif /* _Test_H__ */
Index: code/trunk/src/orxonox/collisionshapes/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/collisionshapes/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/collisionshapes/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,5 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  CollisionShape.cc
+  CompoundCollisionShape.cc
+  WorldEntityCollisionShape.cc
+)
Index: code/trunk/src/orxonox/collisionshapes/CollisionShape.cc
===================================================================
--- code/trunk/src/orxonox/collisionshapes/CollisionShape.cc	(revision 5781)
+++ code/trunk/src/orxonox/collisionshapes/CollisionShape.cc	(revision 5781)
@@ -0,0 +1,159 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "CollisionShape.h"
+
+#include <BulletCollision/CollisionShapes/btCollisionShape.h>
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/WorldEntity.h"
+#include "CompoundCollisionShape.h"
+#include "WorldEntityCollisionShape.h"
+
+namespace orxonox
+{
+    CollisionShape::CollisionShape(BaseObject* creator)
+        : BaseObject(creator)
+        , Synchronisable(creator)
+    {
+        RegisterObject(CollisionShape);
+
+        this->parent_ = 0;
+        this->parentID_ = OBJECTID_UNKNOWN;
+        this->collisionShape_ = 0;
+        this->position_ = Vector3::ZERO;
+        this->orientation_ = Quaternion::IDENTITY;
+        this->scale_ = Vector3::UNIT_SCALE;
+
+        this->registerVariables();
+    }
+
+    CollisionShape::~CollisionShape()
+    {
+        // Detach from parent
+        if (this->isInitialized() && this->parent_)
+            this->parent_->detach(this);
+    }
+
+    void CollisionShape::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(CollisionShape, XMLPort, xmlelement, mode);
+
+        XMLPortParamTemplate(CollisionShape, "position", setPosition, getPosition, xmlelement, mode, const Vector3&);
+        XMLPortParamTemplate(CollisionShape, "orientation", setOrientation, getOrientation, xmlelement, mode, const Quaternion&);
+        XMLPortParamTemplate(CollisionShape, "scale3D", setScale3D, getScale3D, xmlelement, mode, const Vector3&);
+        XMLPortParamLoadOnly(CollisionShape, "scale", setScale, xmlelement, mode);
+        XMLPortParamLoadOnly(CollisionShape, "yaw",   yaw,   xmlelement, mode);
+        XMLPortParamLoadOnly(CollisionShape, "pitch", pitch, xmlelement, mode);
+        XMLPortParamLoadOnly(CollisionShape, "roll",  roll,  xmlelement, mode);
+    }
+
+    void CollisionShape::registerVariables()
+    {
+        registerVariable(this->parentID_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::parentChanged));
+    }
+
+    void CollisionShape::parentChanged()
+    {
+        Synchronisable* parent = Synchronisable::getSynchronisable(this->parentID_);
+        // Parent can either be a WorldEntity or a CompoundCollisionShape. The reason is that the
+        // internal collision shape (which is compound) of a WE doesn't get synchronised.
+        CompoundCollisionShape* parentCCS = orxonox_cast<CompoundCollisionShape*>(parent);
+        if (parentCCS)
+            parentCCS->attach(this);
+        else
+        {
+            WorldEntity* parentWE = orxonox_cast<WorldEntity*>(parent);
+            if (parentWE)
+                parentWE->attachCollisionShape(this);
+        }
+    }
+
+    bool CollisionShape::notifyBeingAttached(CompoundCollisionShape* newParent)
+    {
+        if (this->parent_)
+            this->parent_->detach(this);
+
+        this->parent_ = newParent;
+
+        WorldEntityCollisionShape* parentWECCS = orxonox_cast<WorldEntityCollisionShape*>(newParent);
+        if (parentWECCS)
+            this->parentID_ = parentWECCS->getWorldEntityOwner()->getObjectID();
+        else
+            this->parentID_ = newParent->getObjectID();
+
+        return true;
+    }
+
+    void CollisionShape::notifyDetached()
+    {
+        this->parent_ = 0;
+        this->parentID_ = OBJECTID_UNKNOWN;
+    }
+
+    void CollisionShape::updateParent()
+    {
+        if (this->parent_)
+            this->parent_->updateAttachedShape(this);
+    }
+
+    bool CollisionShape::hasTransform() const
+    {
+        return (!this->position_.positionEquals(Vector3(0, 0, 0), 0.001f) ||
+                !this->orientation_.equals(Quaternion(1,0,0,0), Degree(0.1f)));
+    }
+
+    void CollisionShape::setScale3D(const Vector3& scale)
+    {
+        CCOUT(2) << "Warning: Cannot set the scale of a collision shape: Not yet implemented." << std::endl;
+    }
+
+    void CollisionShape::setScale(float scale)
+    {
+        CCOUT(2) << "Warning: Cannot set the scale of a collision shape: Not yet implemented." << std::endl;
+    }
+
+    void CollisionShape::updateShape()
+    {
+        btCollisionShape* oldShape = this->collisionShape_;
+        this->collisionShape_ = this->createNewShape();
+        // When we recreate the shape, we have to inform the parent about this to update the shape
+        this->updateParent();
+        if (oldShape)
+            delete oldShape;
+    }
+
+    void CollisionShape::calculateLocalInertia(btScalar mass, btVector3& inertia) const
+    {
+        if (this->collisionShape_)
+            this->collisionShape_->calculateLocalInertia(mass, inertia);
+        else
+            inertia.setValue(0, 0, 0);
+    }
+}
Index: code/trunk/src/orxonox/collisionshapes/CollisionShape.h
===================================================================
--- code/trunk/src/orxonox/collisionshapes/CollisionShape.h	(revision 5781)
+++ code/trunk/src/orxonox/collisionshapes/CollisionShape.h	(revision 5781)
@@ -0,0 +1,96 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _CollisionShape_H__
+#define _CollisionShape_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Math.h"
+#include "core/BaseObject.h"
+#include "network/synchronisable/Synchronisable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport CollisionShape : public BaseObject, public Synchronisable
+    {
+        public:
+            CollisionShape(BaseObject* creator);
+            virtual ~CollisionShape();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            inline void setPosition(const Vector3& position)
+                { this->position_ = position; this->updateParent(); }
+            inline const Vector3& getPosition() const
+                { return this->position_; }
+
+            inline void setOrientation(const Quaternion& orientation)
+                { this->orientation_ = orientation; this->updateParent(); }
+            inline const Quaternion& getOrientation() const
+                { return this->orientation_; }
+
+            void yaw(const Degree& angle)   { this->setOrientation(this->orientation_ * Quaternion(angle, Vector3::UNIT_Y)); }
+            void pitch(const Degree& angle) { this->setOrientation(this->orientation_ * Quaternion(angle, Vector3::UNIT_X)); }
+            void roll(const Degree& angle)  { this->setOrientation(this->orientation_ * Quaternion(angle, Vector3::UNIT_Z)); }
+
+            virtual void setScale3D(const Vector3& scale);
+            virtual void setScale(float scale);
+            inline const Vector3& getScale3D() const
+                { return this->scale_; }
+
+            void updateShape();
+
+            void calculateLocalInertia(float mass, btVector3& inertia) const;
+
+            inline btCollisionShape* getCollisionShape() const
+                { return this->collisionShape_; }
+
+            bool hasTransform() const;
+
+            bool notifyBeingAttached(CompoundCollisionShape* newParent);
+            void notifyDetached();
+
+        protected:
+            virtual void updateParent();
+            virtual void parentChanged();
+            virtual btCollisionShape* createNewShape() const = 0;
+
+            btCollisionShape*       collisionShape_;
+            CompoundCollisionShape* parent_;
+            unsigned int            parentID_;
+
+        private:
+            Vector3                 position_;
+            Quaternion              orientation_;
+            Vector3                 scale_;
+    };
+}
+
+#endif /* _CollisionShape_H__ */
Index: code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc
===================================================================
--- code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc	(revision 5781)
+++ code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc	(revision 5781)
@@ -0,0 +1,192 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "CompoundCollisionShape.h"
+
+#include <BulletCollision/CollisionShapes/btCompoundShape.h>
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "tools/BulletConversions.h"
+
+namespace orxonox
+{
+    CreateFactory(CompoundCollisionShape);
+
+    CompoundCollisionShape::CompoundCollisionShape(BaseObject* creator) : CollisionShape(creator)
+    {
+        RegisterObject(CompoundCollisionShape);
+
+        this->compoundShape_  = new btCompoundShape();
+    }
+
+    CompoundCollisionShape::~CompoundCollisionShape()
+    {
+        if (this->isInitialized())
+        {
+            // Delete all children
+            for (std::map<CollisionShape*, btCollisionShape*>::iterator it = this->attachedShapes_.begin();
+                it != this->attachedShapes_.end(); ++it)
+            {
+                // make sure that the child doesn't want to detach itself --> speedup because of the missing update
+                it->first->notifyDetached();
+                delete it->first;
+            }
+
+            delete this->compoundShape_;
+        }
+    }
+
+    void CompoundCollisionShape::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(CompoundCollisionShape, XMLPort, xmlelement, mode);
+        // Attached collision shapes
+        XMLPortObject(CompoundCollisionShape, CollisionShape, "", attach, detach, xmlelement, mode);
+    }
+
+    void CompoundCollisionShape::attach(CollisionShape* shape)
+    {
+        if (!shape || static_cast<CollisionShape*>(this) == shape)
+            return;
+        if (this->attachedShapes_.find(shape) != this->attachedShapes_.end())
+        {
+            CCOUT(2) << "Warning: Attaching a CollisionShape twice is not yet supported." << std::endl;
+            return;
+        }
+
+        if (!shape->notifyBeingAttached(this))
+            return;
+
+        this->attachedShapes_[shape] = shape->getCollisionShape();
+
+        if (shape->getCollisionShape())
+        {
+            // Only actually attach if we didn't pick a CompoundCollisionShape with no content
+            btTransform transf(multi_cast<btQuaternion>(shape->getOrientation()), multi_cast<btVector3>(shape->getPosition()));
+            this->compoundShape_->addChildShape(transf, shape->getCollisionShape());
+
+            this->updatePublicShape();
+        }
+    }
+
+    void CompoundCollisionShape::detach(CollisionShape* shape)
+    {
+        if (this->attachedShapes_.find(shape) != this->attachedShapes_.end())
+        {
+            this->attachedShapes_.erase(shape);
+            if (shape->getCollisionShape())
+                this->compoundShape_->removeChildShape(shape->getCollisionShape());
+            shape->notifyDetached();
+
+            this->updatePublicShape();
+        }
+        else
+            CCOUT(2) << "Warning: Cannot detach non child collision shape" << std::endl;
+    }
+
+    void CompoundCollisionShape::detachAll()
+    {
+        while (this->attachedShapes_.size() > 0)
+            this->detach(this->attachedShapes_.begin()->first);
+    }
+
+    void CompoundCollisionShape::updateAttachedShape(CollisionShape* shape)
+    {
+        if (!shape)
+            return;
+        std::map<CollisionShape*, btCollisionShape*>::iterator it = this->attachedShapes_.find(shape);
+        if (it == this->attachedShapes_.end())
+        {
+            CCOUT(2) << "Warning: Cannot update child shape: Instance not a child." << std::endl;
+            return;
+        }
+
+        // Remove old btCollisionShape, stored in the children map
+        if (it->second)
+            this->compoundShape_->removeChildShape(it->second);
+        if (shape->getCollisionShape())
+        {
+            // Only actually attach if we didn't pick a CompoundCollisionShape with no content
+            btTransform transf(multi_cast<btQuaternion>(shape->getOrientation()), multi_cast<btVector3>(shape->getPosition()));
+            this->compoundShape_->addChildShape(transf, shape->getCollisionShape());
+            it->second = shape->getCollisionShape();
+        }
+
+        this->updatePublicShape();
+    }
+
+    void CompoundCollisionShape::updatePublicShape()
+    {
+        btCollisionShape* primitive = 0;
+        bool bPrimitive = true;
+        bool bEmpty = true;
+        for (std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->attachedShapes_.begin(); it != this->attachedShapes_.end(); ++it)
+        {
+            if (it->second)
+            {
+                bEmpty = false;
+                if (!it->first->hasTransform() && !bPrimitive)
+                    primitive = it->second;
+                else
+                    bPrimitive = false;
+            }
+        }
+        if (bEmpty)
+        {
+            if (this->collisionShape_ == 0)
+            {
+                this->collisionShape_ = 0;
+                return;
+            }
+            this->collisionShape_ = 0;
+        }
+        else if (bPrimitive)
+        {
+            // --> Only one shape to be added, no transform; return it directly
+            this->collisionShape_ = primitive;
+        }
+        else
+        {
+            // Make sure we use the compound shape when returning a btCollisionShape
+            this->collisionShape_ = this->compoundShape_;
+        }
+        this->updateParent();
+    }
+
+    CollisionShape* CompoundCollisionShape::getAttachedShape(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->attachedShapes_.begin(); it != this->attachedShapes_.end(); ++it)
+        {
+            if (i == index)
+                return it->first;
+            ++i;
+        }
+        return 0;
+    }
+}
Index: code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.h
===================================================================
--- code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.h	(revision 5781)
+++ code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.h	(revision 5781)
@@ -0,0 +1,65 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _CompoundCollisionShape_H__
+#define _CompoundCollisionShape_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <cassert>
+#include <map>
+#include "CollisionShape.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport CompoundCollisionShape : public CollisionShape
+    {
+        public:
+            CompoundCollisionShape(BaseObject* creator);
+            virtual ~CompoundCollisionShape();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void attach(CollisionShape* shape);
+            void detach(CollisionShape* shape);
+            void detachAll();
+            CollisionShape* getAttachedShape(unsigned int index) const;
+
+            void updateAttachedShape(CollisionShape* shape);
+
+        private:
+            void updatePublicShape();
+            inline virtual btCollisionShape* createNewShape() const
+                { assert(false); return 0; }
+
+            btCompoundShape* compoundShape_;
+            std::map<CollisionShape*, btCollisionShape*> attachedShapes_;
+    };
+}
+
+#endif /* _CompoundCollisionShape_H__ */
Index: code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc
===================================================================
--- code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc	(revision 5781)
+++ code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc	(revision 5781)
@@ -0,0 +1,68 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "WorldEntityCollisionShape.h"
+
+#include <BulletCollision/CollisionShapes/btCompoundShape.h>
+
+#include "util/OrxAssert.h"
+#include "core/CoreIncludes.h"
+#include "worldentities/WorldEntity.h"
+
+namespace orxonox
+{
+    WorldEntityCollisionShape::WorldEntityCollisionShape(WorldEntity* creator) : CompoundCollisionShape(creator)
+    {
+        RegisterObject(WorldEntityCollisionShape);
+
+        this->worldEntityOwner_ = creator;
+        // suppress synchronisation
+        this->setObjectMode(0x0);
+    }
+
+    WorldEntityCollisionShape::~WorldEntityCollisionShape()
+    {
+        // Called always by WE destructor
+    }
+
+    void WorldEntityCollisionShape::updateParent()
+    {
+        // Note: This shape may also be attached to a CompoundCollisionShape because it's hosting
+        // WorldEntity has been attached to another one.
+        CollisionShape::updateParent();
+
+        assert(this->worldEntityOwner_ != 0);
+        this->worldEntityOwner_->notifyCollisionShapeChanged();
+    }
+
+    void WorldEntityCollisionShape::parentChanged()
+    {
+        // This object does not get synchronised. This method should never be called then!
+        OrxAssert(false, "parentChanged has been called on a non synchronised WorldEntityCollisionShape!");
+    }
+}
Index: code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h
===================================================================
--- code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h	(revision 5781)
+++ code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h	(revision 5781)
@@ -0,0 +1,56 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _WorldEntityCollisionShape_H__
+#define _WorldEntityCollisionShape_H__
+
+#include "OrxonoxPrereqs.h"
+#include "CompoundCollisionShape.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WorldEntityCollisionShape : public CompoundCollisionShape
+    {
+        public:
+            WorldEntityCollisionShape(WorldEntity* creator);
+            virtual ~WorldEntityCollisionShape();
+
+            inline WorldEntity* getWorldEntityOwner()
+                { return this->worldEntityOwner_; }
+
+        protected:
+            virtual void updateParent();
+
+        private:
+            void parentChanged();
+
+            WorldEntity* worldEntityOwner_;
+    };
+}
+
+#endif /* _WorldEntityCollisionShape_H__ */
Index: code/trunk/src/orxonox/controllers/AIController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/AIController.cc	(revision 5781)
+++ code/trunk/src/orxonox/controllers/AIController.cc	(revision 5781)
@@ -0,0 +1,116 @@
+/*
+ *   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 "AIController.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    static const float ACTION_INTERVAL = 1.0f;
+
+    CreateFactory(AIController);
+
+    AIController::AIController(BaseObject* creator) : ArtificialController(creator)
+    {
+        RegisterObject(AIController);
+
+        this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action)));
+    }
+
+    AIController::~AIController()
+    {
+    }
+
+    void AIController::action()
+    {
+        float random;
+        float maxrand = 100.0f / ACTION_INTERVAL;
+
+        // search enemy
+        random = rnd(maxrand);
+        if (random < 15 && (!this->target_))
+            this->searchNewTarget();
+
+        // forget enemy
+        random = rnd(maxrand);
+        if (random < 5 && (this->target_))
+            this->forgetTarget();
+
+        // next enemy
+        random = rnd(maxrand);
+        if (random < 10 && (this->target_))
+            this->searchNewTarget();
+
+        // fly somewhere
+        random = rnd(maxrand);
+        if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
+            this->searchRandomTargetPosition();
+
+        // stop flying
+        random = rnd(maxrand);
+        if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
+            this->bHasTargetPosition_ = false;
+
+        // fly somewhere else
+        random = rnd(maxrand);
+        if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
+            this->searchRandomTargetPosition();
+
+        // shoot
+        random = rnd(maxrand);
+        if (random < 75 && (this->target_ && !this->bShooting_))
+            this->bShooting_ = true;
+
+        // stop shooting
+        random = rnd(maxrand);
+        if (random < 25 && (this->bShooting_))
+            this->bShooting_ = false;
+    }
+
+    void AIController::tick(float dt)
+    {
+        if (!this->isActive())
+            return;
+
+        if (this->target_)
+            this->aimAtTarget();
+
+        if (this->bHasTargetPosition_)
+            this->moveToTargetPosition();
+
+        if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
+            this->getControllableEntity()->fire(0);
+
+        SUPER(AIController, tick, dt);
+    }
+
+}
Index: code/trunk/src/orxonox/controllers/AIController.h
===================================================================
--- code/trunk/src/orxonox/controllers/AIController.h	(revision 5781)
+++ code/trunk/src/orxonox/controllers/AIController.h	(revision 5781)
@@ -0,0 +1,56 @@
+/*
+ *   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 _AIController_H__
+#define _AIController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/Timer.h"
+#include "tools/interfaces/Tickable.h"
+#include "ArtificialController.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport AIController : public ArtificialController, public Tickable
+    {
+        public:
+            AIController(BaseObject* creator);
+            virtual ~AIController();
+
+            virtual void tick(float dt);
+
+        protected:
+            virtual void action();
+
+        private:
+            Timer<AIController> actionTimer_;
+    };
+}
+
+#endif /* _AIController_H__ */
Index: code/trunk/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/ArtificialController.cc	(revision 5781)
+++ code/trunk/src/orxonox/controllers/ArtificialController.cc	(revision 5781)
@@ -0,0 +1,240 @@
+/*
+ *   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 "ArtificialController.h"
+
+#include "core/CoreIncludes.h"
+#include "worldentities/ControllableEntity.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/pawns/TeamBaseMatchBase.h"
+#include "gametypes/TeamDeathmatch.h"
+#include "controllers/WaypointPatrolController.h"
+
+namespace orxonox
+{
+    ArtificialController::ArtificialController(BaseObject* creator) : Controller(creator)
+    {
+        RegisterObject(ArtificialController);
+
+        this->target_ = 0;
+        this->bShooting_ = false;
+        this->bHasTargetPosition_ = false;
+        this->targetPosition_ = Vector3::ZERO;
+    }
+
+    ArtificialController::~ArtificialController()
+    {
+    }
+
+    void ArtificialController::moveToPosition(const Vector3& target)
+    {
+        if (!this->getControllableEntity())
+            return;
+
+        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+        float distance = (target - this->getControllableEntity()->getPosition()).length();
+
+        if (this->target_ || distance > 10)
+        {
+            // Multiply with 0.8 to make them a bit slower
+            this->getControllableEntity()->rotateYaw(-0.8 * sgn(coord.x) * coord.x*coord.x);
+            this->getControllableEntity()->rotatePitch(0.8 * sgn(coord.y) * coord.y*coord.y);
+        }
+
+        if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+            this->getControllableEntity()->moveFrontBack(-0.5); // They don't brake with full power to give the player a chance
+        else
+            this->getControllableEntity()->moveFrontBack(0.8);
+    }
+
+    void ArtificialController::moveToTargetPosition()
+    {
+        this->moveToPosition(this->targetPosition_);
+    }
+
+    void ArtificialController::setTargetPosition(const Vector3& target)
+    {
+        this->targetPosition_ = target;
+        this->bHasTargetPosition_ = true;
+    }
+
+    void ArtificialController::searchRandomTargetPosition()
+    {
+        this->targetPosition_ = Vector3(rnd(-2000,2000), rnd(-2000,2000), rnd(-2000,2000));
+        this->bHasTargetPosition_ = true;
+    }
+
+    void ArtificialController::setTarget(Pawn* target)
+    {
+        this->target_ = target;
+
+        if (target)
+            this->targetPosition_ = target->getPosition();
+    }
+
+    void ArtificialController::searchNewTarget()
+    {
+        if (!this->getControllableEntity())
+            return;
+
+        this->targetPosition_ = this->getControllableEntity()->getPosition();
+        this->forgetTarget();
+
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
+                continue;
+
+            if (static_cast<ControllableEntity*>(*it) != this->getControllableEntity())
+            {
+                float speed = this->getControllableEntity()->getVelocity().length();
+                Vector3 distanceCurrent = this->targetPosition_ - this->getControllableEntity()->getPosition();
+                Vector3 distanceNew = it->getPosition() - this->getControllableEntity()->getPosition();
+                if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / (2 * Ogre::Math::PI))
+                        < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * Ogre::Math::PI)) + rnd(-250, 250))
+                {
+                    this->target_ = (*it);
+                    this->targetPosition_ = it->getPosition();
+                }
+            }
+        }
+    }
+
+    void ArtificialController::forgetTarget()
+    {
+        this->target_ = 0;
+        this->bShooting_ = false;
+    }
+
+    void ArtificialController::aimAtTarget()
+    {
+        if (!this->target_ || !this->getControllableEntity())
+            return;
+
+        static const float hardcoded_projectile_speed = 1250;
+
+        this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getPosition(), hardcoded_projectile_speed, this->target_->getPosition(), this->target_->getVelocity());
+        this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO);
+    }
+
+    bool ArtificialController::isCloseAtTarget(float distance) const
+    {
+        if (!this->getControllableEntity())
+            return false;
+
+        if (!this->target_)
+            return (this->getControllableEntity()->getPosition().squaredDistance(this->targetPosition_) < distance*distance);
+        else
+            return (this->getControllableEntity()->getPosition().squaredDistance(this->target_->getPosition()) < distance*distance);
+    }
+
+    bool ArtificialController::isLookingAtTarget(float angle) const
+    {
+        if (!this->getControllableEntity())
+            return false;
+
+        return (getAngle(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->targetPosition_) < angle);
+    }
+
+    void ArtificialController::destroyedPawn(Pawn* ship)
+    {
+        if (ship == this->target_)
+        {
+            this->forgetTarget();
+            this->searchRandomTargetPosition();
+        }
+    }
+
+    bool ArtificialController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
+    {
+        if (entity1 == entity2)
+            return true;
+
+        int team1 = -1;
+        int team2 = -1;
+
+        if (entity1->getXMLController())
+        {
+            WaypointPatrolController* wpc = orxonox_cast<WaypointPatrolController*>(entity1->getXMLController());
+            if (wpc)
+                team1 = wpc->getTeam();
+        }
+        if (entity2->getXMLController())
+        {
+            WaypointPatrolController* wpc = orxonox_cast<WaypointPatrolController*>(entity2->getXMLController());
+            if (wpc)
+                team2 = wpc->getTeam();
+        }
+
+        TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch*>(gametype);
+        if (tdm)
+        {
+            if (entity1->getPlayer())
+                team1 = tdm->getTeam(entity1->getPlayer());
+
+            if (entity2->getPlayer())
+                team2 = tdm->getTeam(entity2->getPlayer());
+        }
+
+        TeamBaseMatchBase* base = 0;
+        base = orxonox_cast<TeamBaseMatchBase*>(entity1);
+        if (base)
+        {
+            switch (base->getState())
+            {
+                case BaseState::ControlTeam1:
+                    team1 = 0;
+                    break;
+                case BaseState::ControlTeam2:
+                    team1 = 1;
+                    break;
+                case BaseState::Uncontrolled:
+                default:
+                    team1 = -1;
+            }
+        }
+        base = orxonox_cast<TeamBaseMatchBase*>(entity2);
+        if (base)
+        {
+            switch (base->getState())
+            {
+                case BaseState::ControlTeam1:
+                    team2 = 0;
+                    break;
+                case BaseState::ControlTeam2:
+                    team2 = 1;
+                    break;
+                case BaseState::Uncontrolled:
+                default:
+                    team2 = -1;
+            }
+        }
+
+        return (team1 == team2 && team1 != -1);
+    }
+}
Index: code/trunk/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/trunk/src/orxonox/controllers/ArtificialController.h	(revision 5781)
+++ code/trunk/src/orxonox/controllers/ArtificialController.h	(revision 5781)
@@ -0,0 +1,74 @@
+/*
+ *   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 _ArtificialController_H__
+#define _ArtificialController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Math.h"
+#include "interfaces/PawnListener.h"
+#include "Controller.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ArtificialController : public Controller, public PawnListener
+    {
+        public:
+            ArtificialController(BaseObject* creator);
+            virtual ~ArtificialController();
+
+            virtual void destroyedPawn(Pawn* pawn);
+
+        protected:
+            void moveToPosition(const Vector3& target);
+            void moveToTargetPosition();
+
+            void setTargetPosition(const Vector3& target);
+            void searchRandomTargetPosition();
+
+            void setTarget(Pawn* target);
+            void searchNewTarget();
+            void forgetTarget();
+            void aimAtTarget();
+
+            bool isCloseAtTarget(float distance) const;
+            bool isLookingAtTarget(float angle) const;
+
+            static bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype); // hack
+
+            bool bHasTargetPosition_;
+            Vector3 targetPosition_;
+            Pawn* target_;
+            bool bShooting_;
+
+        private:
+    };
+}
+
+#endif /* _ArtificialController_H__ */
Index: code/trunk/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/controllers/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/controllers/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,9 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  Controller.cc
+  HumanController.cc
+  ArtificialController.cc
+  AIController.cc
+  ScriptController.cc
+  WaypointController.cc
+  WaypointPatrolController.cc
+)
Index: code/trunk/src/orxonox/controllers/Controller.cc
===================================================================
--- code/trunk/src/orxonox/controllers/Controller.cc	(revision 5781)
+++ code/trunk/src/orxonox/controllers/Controller.cc	(revision 5781)
@@ -0,0 +1,47 @@
+/*
+ *   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 "Controller.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(Controller);
+
+    Controller::Controller(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(Controller);
+
+        this->player_ = 0;
+        this->controllableEntity_ = 0;
+    }
+
+    Controller::~Controller()
+    {
+    }
+}
Index: code/trunk/src/orxonox/controllers/Controller.h
===================================================================
--- code/trunk/src/orxonox/controllers/Controller.h	(revision 5781)
+++ code/trunk/src/orxonox/controllers/Controller.h	(revision 5781)
@@ -0,0 +1,66 @@
+/*
+ *   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 _Controller_H__
+#define _Controller_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Controller : public BaseObject
+    {
+        public:
+            Controller(BaseObject* creator);
+            virtual ~Controller();
+
+            inline void setPlayer(PlayerInfo* player)
+                { this->player_ = player; }
+            inline PlayerInfo* getPlayer() const
+                { return this->player_; }
+
+            inline void setControllableEntity(ControllableEntity* entity)
+            {
+                if (entity != this->controllableEntity_)
+                {
+                    this->controllableEntity_ = entity;
+                    this->changedControllableEntity();
+                }
+            }
+            inline ControllableEntity* getControllableEntity() const
+                { return this->controllableEntity_; }
+            virtual void changedControllableEntity() {}
+
+        protected:
+            PlayerInfo* player_;
+            ControllableEntity* controllableEntity_;
+    };
+}
+
+#endif /* _Controller_H__ */
Index: code/trunk/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/HumanController.cc	(revision 5781)
+++ code/trunk/src/orxonox/controllers/HumanController.cc	(revision 5781)
@@ -0,0 +1,202 @@
+/*
+ *   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 "HumanController.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "worldentities/ControllableEntity.h"
+#include "worldentities/pawns/Pawn.h"
+#include "gametypes/Gametype.h"
+#include "infos/PlayerInfo.h"
+#include "overlays/Map.h"
+
+namespace orxonox
+{
+    SetConsoleCommand(HumanController, moveFrontBack, true).setAsInputCommand();
+    SetConsoleCommand(HumanController, moveRightLeft, true).setAsInputCommand();
+    SetConsoleCommand(HumanController, moveUpDown,    true).setAsInputCommand();
+    SetConsoleCommand(HumanController, rotateYaw,     true).setAsInputCommand();
+    SetConsoleCommand(HumanController, rotatePitch,   true).setAsInputCommand();
+    SetConsoleCommand(HumanController, rotateRoll,    true).setAsInputCommand();
+    SetConsoleCommand(HumanController, fire,          true).keybindMode(KeybindMode::OnHold);
+    SetConsoleCommand(HumanController, reload,        true);
+    SetConsoleCommand(HumanController, boost,         true).keybindMode(KeybindMode::OnHold);
+    SetConsoleCommand(HumanController, greet,         true);
+    SetConsoleCommand(HumanController, switchCamera,  true);
+    SetConsoleCommand(HumanController, mouseLook,     true);
+    SetConsoleCommand(HumanController, suicide,       true);
+    SetConsoleCommand(HumanController, addBots,       true).defaultValues(1);
+    SetConsoleCommand(HumanController, killBots,      true).defaultValues(0);
+    SetConsoleCommand(HumanController, dropItems,     true);
+    SetConsoleCommand(HumanController, useItem,       true);
+
+    CreateUnloadableFactory(HumanController);
+
+    HumanController* HumanController::localController_s = 0;
+
+    HumanController::HumanController(BaseObject* creator) : Controller(creator)
+    {
+        RegisterObject(HumanController);
+
+        HumanController::localController_s = this;
+    }
+
+    HumanController::~HumanController()
+    {
+        HumanController::localController_s = 0;
+    }
+
+    void HumanController::moveFrontBack(const Vector2& value)
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->moveFrontBack(value);
+    }
+
+    void HumanController::moveRightLeft(const Vector2& value)
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->moveRightLeft(value);
+    }
+
+    void HumanController::moveUpDown(const Vector2& value)
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->moveUpDown(value);
+    }
+
+    void HumanController::rotateYaw(const Vector2& value)
+    {
+        //Hack to enable mouselook in map
+        if ( Map::getSingletonPtr() && Map::getSingletonPtr()->getVisibility() && HumanController::localController_s->controllableEntity_->isInMouseLook() )
+        {
+            Map::getSingletonPtr()->rotateYaw(value);
+            return;
+        }
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->rotateYaw(value);
+    }
+
+    void HumanController::rotatePitch(const Vector2& value)
+    {
+        //Hack to enable mouselook in map
+        if ( Map::getSingletonPtr() && Map::getSingletonPtr()->getVisibility() && HumanController::localController_s->controllableEntity_->isInMouseLook() )
+        {
+            Map::getSingletonPtr()->rotatePitch(value);
+            return;
+        }
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->rotatePitch(value);
+    }
+
+    void HumanController::rotateRoll(const Vector2& value)
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->rotateRoll(value);
+    }
+
+    void HumanController::fire(unsigned int firemode)
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->fire(firemode);
+    }
+
+    void HumanController::reload()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->reload();
+    }
+
+    void HumanController::boost()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->boost();
+    }
+
+    void HumanController::greet()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->greet();
+    }
+
+    void HumanController::switchCamera()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->switchCamera();
+    }
+
+    void HumanController::mouseLook()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->mouseLook();
+    }
+
+    void HumanController::suicide()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+        {
+            Pawn* pawn = orxonox_cast<Pawn*>(HumanController::localController_s->controllableEntity_);
+            if (pawn)
+                pawn->kill();
+            else if (HumanController::localController_s->player_)
+                HumanController::localController_s->player_->stopControl();
+        }
+    }
+
+    void HumanController::useItem()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->useItem();
+    }
+
+    void HumanController::addBots(unsigned int amount)
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype())
+            HumanController::localController_s->controllableEntity_->getGametype()->addBots(amount);
+    }
+
+    void HumanController::killBots(unsigned int amount)
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype())
+            HumanController::localController_s->controllableEntity_->getGametype()->killBots(amount);
+    }
+
+    void HumanController::dropItems()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->dropItems();
+    }
+
+    Pawn* HumanController::getLocalControllerEntityAsPawn()
+    {
+        if (HumanController::localController_s)
+            return orxonox_cast<Pawn*>(HumanController::localController_s->getControllableEntity());
+        else
+            return NULL;
+    }
+}
Index: code/trunk/src/orxonox/controllers/HumanController.h
===================================================================
--- code/trunk/src/orxonox/controllers/HumanController.h	(revision 5781)
+++ code/trunk/src/orxonox/controllers/HumanController.h	(revision 5781)
@@ -0,0 +1,77 @@
+/*
+ *   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 _HumanController_H__
+#define _HumanController_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Controller.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HumanController : public Controller
+    {
+        public:
+            HumanController(BaseObject* creator);
+            virtual ~HumanController();
+
+            static void moveFrontBack(const Vector2& value);
+            static void moveRightLeft(const Vector2& value);
+            static void moveUpDown(const Vector2& value);
+
+            static void rotateYaw(const Vector2& value);
+            static void rotatePitch(const Vector2& value);
+            static void rotateRoll(const Vector2& value);
+
+            static void fire(unsigned int firemode);
+            static void reload();
+
+            static void boost();
+            static void greet();
+            static void switchCamera();
+            static void mouseLook();
+            static void dropItems();
+            static void useItem();
+
+            static void suicide();
+
+            static void addBots(unsigned int amount);
+            static void killBots(unsigned int amount = 0);
+
+            static inline HumanController* getLocalControllerSingleton()
+                { return HumanController::localController_s; }
+            static Pawn* getLocalControllerEntityAsPawn();
+            //friend class, for mouselook
+            friend class Map;
+
+        private:
+            static HumanController* localController_s;
+    };
+}
+
+#endif /* _HumanController_H__ */
Index: code/trunk/src/orxonox/controllers/ScriptController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/ScriptController.cc	(revision 5781)
+++ code/trunk/src/orxonox/controllers/ScriptController.cc	(revision 5781)
@@ -0,0 +1,40 @@
+/*
+ *   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 "ScriptController.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(ScriptController);
+
+    ScriptController::ScriptController(BaseObject* creator) : ArtificialController(creator)
+    {
+        RegisterObject(ScriptController);
+    }
+}
Index: code/trunk/src/orxonox/controllers/ScriptController.h
===================================================================
--- code/trunk/src/orxonox/controllers/ScriptController.h	(revision 5781)
+++ code/trunk/src/orxonox/controllers/ScriptController.h	(revision 5781)
@@ -0,0 +1,47 @@
+/*
+ *   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 _ScriptController_H__
+#define _ScriptController_H__
+
+#include "OrxonoxPrereqs.h"
+#include "ArtificialController.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ScriptController : public ArtificialController
+    {
+        public:
+            ScriptController(BaseObject* creator);
+            virtual ~ScriptController() { }
+
+        private:
+    };
+}
+
+#endif /* _ScriptController_H__ */
Index: code/trunk/src/orxonox/controllers/WaypointController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/WaypointController.cc	(revision 5781)
+++ code/trunk/src/orxonox/controllers/WaypointController.cc	(revision 5781)
@@ -0,0 +1,90 @@
+/*
+ *   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 "WaypointController.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    CreateFactory(WaypointController);
+
+    WaypointController::WaypointController(BaseObject* creator) : ArtificialController(creator)
+    {
+        RegisterObject(WaypointController);
+
+        this->currentWaypoint_ = 0;
+        this->setAccuracy(100);
+    }
+
+    WaypointController::~WaypointController()
+    {
+        if (this->isInitialized())
+        {
+            for (size_t i = 0; i < this->waypoints_.size(); ++i)
+                delete this->waypoints_[i];
+        }
+    }
+
+    void WaypointController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WaypointController, XMLPort, xmlelement, mode);
+
+        XMLPortParam(WaypointController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
+        XMLPortObject(WaypointController, WorldEntity, "waypoints", addWaypoint, getWaypoint,  xmlelement, mode);
+    }
+
+    void WaypointController::tick(float dt)
+    {
+        if (!this->isActive())
+            return;
+
+        if (this->waypoints_.size() == 0 || !this->getControllableEntity())
+            return;
+
+        if (this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_)
+            this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size();
+
+        this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition());
+    }
+
+    void WaypointController::addWaypoint(WorldEntity* waypoint)
+    {
+        this->waypoints_.push_back(waypoint);
+    }
+
+    WorldEntity* WaypointController::getWaypoint(unsigned int index) const
+    {
+        if (index < this->waypoints_.size())
+            return this->waypoints_[index];
+        else
+            return 0;
+    }
+}
Index: code/trunk/src/orxonox/controllers/WaypointController.h
===================================================================
--- code/trunk/src/orxonox/controllers/WaypointController.h	(revision 5781)
+++ code/trunk/src/orxonox/controllers/WaypointController.h	(revision 5781)
@@ -0,0 +1,64 @@
+/*
+ *   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 _WaypointController_H__
+#define _WaypointController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <vector>
+#include "tools/interfaces/Tickable.h"
+#include "ArtificialController.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WaypointController : public ArtificialController, public Tickable
+    {
+        public:
+            WaypointController(BaseObject* creator);
+            virtual ~WaypointController();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+
+            void addWaypoint(WorldEntity* waypoint);
+            WorldEntity* getWaypoint(unsigned int index) const;
+
+            inline void setAccuracy(float accuracy)
+                { this->squaredaccuracy_ = accuracy*accuracy; }
+            inline float getAccuracy() const
+                { return sqrt(this->squaredaccuracy_); }
+
+        protected:
+            std::vector<WorldEntity*> waypoints_;
+            size_t currentWaypoint_;
+            float squaredaccuracy_;
+    };
+}
+
+#endif /* _WaypointController_H__ */
Index: code/trunk/src/orxonox/controllers/WaypointPatrolController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/WaypointPatrolController.cc	(revision 5781)
+++ code/trunk/src/orxonox/controllers/WaypointPatrolController.cc	(revision 5781)
@@ -0,0 +1,105 @@
+/*
+ *   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 "WaypointPatrolController.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateFactory(WaypointPatrolController);
+
+    WaypointPatrolController::WaypointPatrolController(BaseObject* creator) : WaypointController(creator)
+    {
+        RegisterObject(WaypointPatrolController);
+
+        this->team_ = 0;
+        this->alertnessradius_ = 500;
+
+        this->patrolTimer_.setTimer(rnd(), true, this, createExecutor(createFunctor(&WaypointPatrolController::searchEnemy)));
+    }
+
+    void WaypointPatrolController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WaypointPatrolController, XMLPort, xmlelement, mode);
+
+        XMLPortParam(WaypointPatrolController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
+        XMLPortParam(WaypointPatrolController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);
+    }
+
+    void WaypointPatrolController::tick(float dt)
+    {
+        if (!this->isActive())
+            return;
+
+        if (this->target_)
+        {
+            this->aimAtTarget();
+
+            if (this->bHasTargetPosition_)
+                this->moveToTargetPosition();
+
+            if (this->getControllableEntity() && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
+                this->getControllableEntity()->fire(0);
+        }
+        else
+        {
+            SUPER(WaypointPatrolController, tick, dt);
+        }
+    }
+
+    void WaypointPatrolController::searchEnemy()
+    {
+        this->patrolTimer_.setInterval(rnd());
+
+        if (!this->getControllableEntity())
+            return;
+
+        Vector3 myposition = this->getControllableEntity()->getPosition();
+        float shortestsqdistance = static_cast<unsigned int>(-1);
+
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+        {
+            if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
+                continue;
+
+            float sqdistance = it->getPosition().squaredDistance(myposition);
+            if (sqdistance < shortestsqdistance)
+            {
+                shortestsqdistance = sqdistance;
+                this->target_ = (*it);
+            }
+        }
+
+        if (shortestsqdistance > (this->alertnessradius_ * this->alertnessradius_))
+            this->target_ = 0;
+    }
+}
Index: code/trunk/src/orxonox/controllers/WaypointPatrolController.h
===================================================================
--- code/trunk/src/orxonox/controllers/WaypointPatrolController.h	(revision 5781)
+++ code/trunk/src/orxonox/controllers/WaypointPatrolController.h	(revision 5781)
@@ -0,0 +1,67 @@
+/*
+ *   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 _WaypointPatrolController_H__
+#define _WaypointPatrolController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/Timer.h"
+#include "WaypointController.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WaypointPatrolController : public WaypointController
+    {
+        public:
+            WaypointPatrolController(BaseObject* creator);
+            virtual ~WaypointPatrolController() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+
+            inline void setTeam(int team)
+                { this->team_ = team; }
+            inline int getTeam() const
+                { return this->team_; }
+
+            inline void setAlertnessRadius(float radius)
+                { this->alertnessradius_ = radius; }
+            inline float getAlertnessRadius() const
+                { return this->alertnessradius_; }
+
+        protected:
+            void searchEnemy();
+
+            int team_;
+            float alertnessradius_;
+            Timer<WaypointPatrolController> patrolTimer_;
+    };
+}
+
+#endif /* _WaypointPatrolController_H__ */
Index: code/trunk/src/orxonox/gametypes/Asteroids.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Asteroids.cc	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/Asteroids.cc	(revision 5781)
@@ -0,0 +1,87 @@
+/*
+ *   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:
+ *      Aurelian Jaggi
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Asteroids.h"
+
+#include "core/CoreIncludes.h"
+#include "network/Host.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(Asteroids);
+
+    Asteroids::Asteroids(BaseObject* creator) : Gametype(creator)
+    {
+        RegisterObject(Asteroids);
+        this->firstCheckpointReached_ = false;
+    }
+
+    void Asteroids::tick(float dt)
+    {
+        SUPER(Asteroids, tick, dt);
+
+        if (firstCheckpointReached_ && !this->timerIsActive_)
+        {
+            this->startTimer();
+        }
+
+        if (this->time_ < 0 && !this->hasEnded() && this->timerIsActive_)
+        {
+            this->gtinfo_.sendAnnounceMessage("Time's up - you have lost the match!");
+            this->end();
+        }
+    }
+
+    void Asteroids::pawnKilled(Pawn* victim, Pawn* killer)
+    {
+        if (victim && victim->getPlayer())
+        {
+            this->gtinfo_.sendAnnounceMessage("You're dead - you have lost the match!");
+            this->end();
+        }
+    }
+
+    void Asteroids::start()
+    {
+        Gametype::start();
+
+        std::string message = "The match has started! Reach the first chekpoint within 15 seconds! But be aware, there may be pirates around...";
+        COUT(0) << message << std::endl;
+        Host::Broadcast(message);
+    }
+
+    void Asteroids::end()
+    {
+        Gametype::end();
+
+        std::string message = "The match has ended.";
+        COUT(0) << message << std::endl;
+        Host::Broadcast(message);
+    }
+}
Index: code/trunk/src/orxonox/gametypes/Asteroids.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Asteroids.h	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/Asteroids.h	(revision 5781)
@@ -0,0 +1,60 @@
+/*
+ *   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:
+ *      Aurelian Jaggi
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Asteroids_H__
+#define _Asteroids_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Gametype.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Asteroids : public Gametype
+    {
+        public:
+            Asteroids(BaseObject* creator);
+            virtual ~Asteroids() {}
+
+            virtual void tick(float dt);
+
+            virtual void start();
+            virtual void end();
+
+            inline void firstCheckpointReached(bool reached)
+                { this->firstCheckpointReached_ = reached; }
+
+        protected:
+            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+
+        private:
+            bool firstCheckpointReached_;
+            bool gameEnded_;
+    };
+}
+
+#endif /* _Asteroids_H__ */
Index: code/trunk/src/orxonox/gametypes/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/gametypes/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,8 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  Gametype.cc
+  Deathmatch.cc
+  TeamDeathmatch.cc
+  TeamBaseMatch.cc
+  UnderAttack.cc
+  Asteroids.cc
+)
Index: code/trunk/src/orxonox/gametypes/Deathmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Deathmatch.cc	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/Deathmatch.cc	(revision 5781)
@@ -0,0 +1,133 @@
+/*
+ *   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 "Deathmatch.h"
+
+#include "core/CoreIncludes.h"
+#include "network/Host.h"
+#include "infos/PlayerInfo.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(Deathmatch);
+
+    Deathmatch::Deathmatch(BaseObject* creator) : Gametype(creator)
+    {
+        RegisterObject(Deathmatch);
+    }
+
+    void Deathmatch::start()
+    {
+        Gametype::start();
+
+        std::string message = "The match has started!";
+        COUT(0) << message << std::endl;
+        Host::Broadcast(message);
+    }
+
+    void Deathmatch::end()
+    {
+        Gametype::end();
+
+        std::string message = "The match has ended.";
+        COUT(0) << message << std::endl;
+        Host::Broadcast(message);
+    }
+
+    void Deathmatch::playerEntered(PlayerInfo* player)
+    {
+        Gametype::playerEntered(player);
+
+        std::string message = player->getName() + " entered the game";
+        COUT(0) << message << std::endl;
+        Host::Broadcast(message);
+    }
+
+    bool Deathmatch::playerLeft(PlayerInfo* player)
+    {
+        bool valid_player = Gametype::playerLeft(player);
+
+        if (valid_player)
+        {
+            std::string message = player->getName() + " left the game";
+            COUT(0) << message << std::endl;
+            Host::Broadcast(message);
+        }
+
+        return valid_player;
+    }
+
+    bool Deathmatch::playerChangedName(PlayerInfo* player)
+    {
+        bool valid_player = Gametype::playerChangedName(player);
+
+        if (valid_player)
+        {
+            std::string message = player->getOldName() + " changed name to " + player->getName();
+            COUT(0) << message << std::endl;
+            Host::Broadcast(message);
+        }
+
+        return valid_player;
+    }
+
+    void Deathmatch::pawnKilled(Pawn* victim, Pawn* killer)
+    {
+        if (victim && victim->getPlayer())
+        {
+            std::string message;
+            if (killer)
+            {
+                if (killer->getPlayer())
+                    message = victim->getPlayer()->getName() + " was killed by " + killer->getPlayer()->getName();
+                else
+                    message = victim->getPlayer()->getName() + " was killed";
+            }
+            else
+                message = victim->getPlayer()->getName() + " died";
+
+            COUT(0) << message << std::endl;
+            Host::Broadcast(message);
+        }
+
+        Gametype::pawnKilled(victim, killer);
+    }
+
+    void Deathmatch::playerScored(PlayerInfo* player)
+    {
+        Gametype::playerScored(player);
+
+        if (player)
+        {
+            std::string message = player->getName() + " scores!";
+            COUT(0) << message << std::endl;
+            Host::Broadcast(message);
+        }
+    }
+}
Index: code/trunk/src/orxonox/gametypes/Deathmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Deathmatch.h	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/Deathmatch.h	(revision 5781)
@@ -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 _Deathmatch_H__
+#define _Deathmatch_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Gametype.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Deathmatch : public Gametype
+    {
+        public:
+            Deathmatch(BaseObject* creator);
+            virtual ~Deathmatch() {}
+
+            virtual void start();
+            virtual void end();
+            virtual void playerEntered(PlayerInfo* player);
+            virtual bool playerLeft(PlayerInfo* player);
+            virtual bool playerChangedName(PlayerInfo* player);
+
+            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+            virtual void playerScored(PlayerInfo* player);
+    };
+}
+
+#endif /* _Deathmatch_H__ */
Index: code/trunk/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.cc	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/Gametype.cc	(revision 5781)
@@ -0,0 +1,453 @@
+/*
+ *   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 "Gametype.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/GameMode.h"
+
+#include "infos/PlayerInfo.h"
+#include "infos/Bot.h"
+#include "graphics/Camera.h"
+#include "worldentities/ControllableEntity.h"
+#include "worldentities/SpawnPoint.h"
+#include "worldentities/pawns/Spectator.h"
+#include "worldentities/pawns/Pawn.h"
+#include "overlays/OverlayGroup.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(Gametype);
+
+    Gametype::Gametype(BaseObject* creator) : BaseObject(creator), gtinfo_(creator)
+    {
+        RegisterObject(Gametype);
+
+        this->setGametype(this);
+
+        this->defaultControllableEntity_ = Class(Spectator);
+
+        this->bAutoStart_ = false;
+        this->bForceSpawn_ = false;
+        this->numberOfBots_ = 0;
+
+        this->timeLimit_ = 0;
+        this->time_ = 0;
+        this->timerIsActive_ = false;
+
+        this->initialStartCountdown_ = 3;
+
+        this->setConfigValues();
+
+        // load the corresponding score board
+        if (GameMode::showsGraphics() && this->scoreboardTemplate_ != "")
+        {
+            this->scoreboard_ = new OverlayGroup(this);
+            this->scoreboard_->addTemplate(this->scoreboardTemplate_);
+            this->scoreboard_->setGametype(this);
+        }
+        else
+            this->scoreboard_ = 0;
+    }
+
+    void Gametype::setConfigValues()
+    {
+        SetConfigValue(initialStartCountdown_, 3.0f);
+        SetConfigValue(bAutoStart_, false);
+        SetConfigValue(bForceSpawn_, false);
+        SetConfigValue(numberOfBots_, 0);
+        SetConfigValue(scoreboardTemplate_, "defaultScoreboard");
+    }
+
+    void Gametype::tick(float dt)
+    {
+        SUPER(Gametype, tick, dt);
+
+        //count timer
+        if (timerIsActive_)
+        {
+            if (this->timeLimit_ == 0)
+                this->time_ += dt;
+            else
+                this->time_ -= dt;
+        }
+
+        if (this->gtinfo_.bStartCountdownRunning_ && !this->gtinfo_.bStarted_)
+            this->gtinfo_.startCountdown_ -= dt;
+
+        if (!this->gtinfo_.bStarted_)
+            this->checkStart();
+        else if (!this->gtinfo_.bEnded_)
+            this->spawnDeadPlayersIfRequested();
+
+        this->assignDefaultPawnsIfNeeded();
+    }
+
+    void Gametype::start()
+    {
+        this->addBots(this->numberOfBots_);
+
+        this->gtinfo_.bStarted_ = true;
+
+        this->spawnPlayersIfRequested();
+    }
+
+    void Gametype::end()
+    {
+        this->gtinfo_.bEnded_ = true;
+
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        {
+            if (it->first->getControllableEntity())
+            {
+                ControllableEntity* oldentity = it->first->getControllableEntity();
+
+                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(oldentity->getCreator());
+                if (oldentity->getCamera())
+                {
+                    entity->setPosition(oldentity->getCamera()->getWorldPosition());
+                    entity->setOrientation(oldentity->getCamera()->getWorldOrientation());
+                }
+                else
+                {
+                    entity->setPosition(oldentity->getWorldPosition());
+                    entity->setOrientation(oldentity->getWorldOrientation());
+                }
+
+                it->first->startControl(entity);
+            }
+            else
+                this->spawnPlayerAsDefaultPawn(it->first);
+        }
+    }
+
+    void Gametype::playerEntered(PlayerInfo* player)
+    {
+        this->players_[player].state_ = PlayerState::Joined;
+    }
+
+    bool Gametype::playerLeft(PlayerInfo* player)
+    {
+        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
+        if (it != this->players_.end())
+        {
+            this->players_.erase(it);
+            return true;
+        }
+        return false;
+    }
+
+    void Gametype::playerSwitched(PlayerInfo* player, Gametype* newgametype)
+    {
+    }
+
+    void Gametype::playerSwitchedBack(PlayerInfo* player, Gametype* oldgametype)
+    {
+    }
+
+    bool Gametype::playerChangedName(PlayerInfo* player)
+    {
+        if (this->players_.find(player) != this->players_.end())
+        {
+            if (player->getName() != player->getOldName())
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    void Gametype::pawnPreSpawn(Pawn* pawn)
+    {
+    }
+
+    void Gametype::pawnPostSpawn(Pawn* pawn)
+    {
+    }
+
+    void Gametype::playerPreSpawn(PlayerInfo* player)
+    {
+    }
+
+    void Gametype::playerPostSpawn(PlayerInfo* player)
+    {
+    }
+
+    void Gametype::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
+    {
+    }
+
+    void Gametype::playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn)
+    {
+    }
+
+    bool Gametype::allowPawnHit(Pawn* victim, Pawn* originator)
+    {
+        return true;
+    }
+
+    bool Gametype::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        return true;
+    }
+
+    bool Gametype::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        return true;
+    }
+
+    void Gametype::pawnKilled(Pawn* victim, Pawn* killer)
+    {
+        if (victim && victim->getPlayer())
+        {
+            std::map<PlayerInfo*, Player>::iterator it = this->players_.find(victim->getPlayer());
+            if (it != this->players_.end())
+            {
+                it->second.state_ = PlayerState::Dead;
+                it->second.killed_++;
+
+                // Reward killer
+                if (killer && killer->getPlayer())
+                {
+                    std::map<PlayerInfo*, Player>::iterator it = this->players_.find(killer->getPlayer());
+                    if (it != this->players_.end())
+                    {
+                        it->second.frags_++;
+
+                        if (killer->getPlayer()->getClientID() != CLIENTID_UNKNOWN)
+                            this->gtinfo_.sendKillMessage("You killed " + victim->getPlayer()->getName(), killer->getPlayer()->getClientID());
+                        if (victim->getPlayer()->getClientID() != CLIENTID_UNKNOWN)
+                            this->gtinfo_.sendDeathMessage("You were killed by " + killer->getPlayer()->getName(), victim->getPlayer()->getClientID());
+                    }
+                }
+
+                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator());
+                if (victim->getCamera())
+                {
+                    entity->setPosition(victim->getCamera()->getWorldPosition());
+                    entity->setOrientation(victim->getCamera()->getWorldOrientation());
+                }
+                else
+                {
+                    entity->setPosition(victim->getWorldPosition());
+                    entity->setOrientation(victim->getWorldOrientation());
+                }
+                it->first->startControl(entity);
+            }
+            else
+                COUT(2) << "Warning: Killed Pawn was not in the playerlist" << std::endl;
+        }
+    }
+
+    void Gametype::playerScored(PlayerInfo* player)
+    {
+        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
+        if (it != this->players_.end())
+            it->second.frags_++;
+    }
+
+    int Gametype::getScore(PlayerInfo* player) const
+    {
+        std::map<PlayerInfo*, Player>::const_iterator it = this->players_.find(player);
+        if (it != this->players_.end())
+            return it->second.frags_;
+        else
+            return 0;
+    }
+
+    SpawnPoint* Gametype::getBestSpawnPoint(PlayerInfo* player) const
+    {
+        if (this->spawnpoints_.size() > 0)
+        {
+            unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(this->spawnpoints_.size())));
+            unsigned int index = 0;
+            for (std::set<SpawnPoint*>::const_iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); ++it)
+            {
+                if (index == randomspawn)
+                    return (*it);
+
+                ++index;
+            }
+        }
+        return 0;
+    }
+
+    void Gametype::assignDefaultPawnsIfNeeded()
+    {
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        {
+            if (!it->first->getControllableEntity())
+            {
+                it->second.state_ = PlayerState::Dead;
+
+                if (!it->first->isReadyToSpawn() || !this->gtinfo_.bStarted_)
+                {
+                    this->spawnPlayerAsDefaultPawn(it->first);
+                    it->second.state_ = PlayerState::Dead;
+                }
+            }
+        }
+    }
+
+    void Gametype::checkStart()
+    {
+        if (!this->gtinfo_.bStarted_)
+        {
+            if (this->gtinfo_.bStartCountdownRunning_)
+            {
+                if (this->gtinfo_.startCountdown_ <= 0)
+                {
+                    this->gtinfo_.bStartCountdownRunning_ = false;
+                    this->gtinfo_.startCountdown_ = 0;
+                    this->start();
+                }
+            }
+            else if (this->players_.size() > 0)
+            {
+                if (this->bAutoStart_)
+                {
+                    this->start();
+                }
+                else
+                {
+                    bool allplayersready = true;
+                    bool hashumanplayers = false;
+                    for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+                    {
+                        if (!it->first->isReadyToSpawn())
+                            allplayersready = false;
+                        if (it->first->isHumanPlayer())
+                            hashumanplayers = true;
+                    }
+                    if (allplayersready && hashumanplayers)
+                    {
+                        this->gtinfo_.startCountdown_ = this->initialStartCountdown_;
+                        this->gtinfo_.bStartCountdownRunning_ = true;
+                    }
+                }
+            }
+        }
+    }
+
+    void Gametype::spawnPlayersIfRequested()
+    {
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (it->first->isReadyToSpawn() || this->bForceSpawn_)
+                this->spawnPlayer(it->first);
+    }
+
+    void Gametype::spawnDeadPlayersIfRequested()
+    {
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (it->second.state_ == PlayerState::Dead)
+                if (it->first->isReadyToSpawn() || this->bForceSpawn_)
+                    this->spawnPlayer(it->first);
+    }
+
+    void Gametype::spawnPlayer(PlayerInfo* player)
+    {
+        SpawnPoint* spawnpoint = this->getBestSpawnPoint(player);
+        if (spawnpoint)
+        {
+            this->playerPreSpawn(player);
+            player->startControl(spawnpoint->spawn());
+            this->players_[player].state_ = PlayerState::Alive;
+            this->playerPostSpawn(player);
+        }
+        else
+        {
+            COUT(1) << "Error: No SpawnPoints in current Gametype" << std::endl;
+            abort();
+        }
+    }
+
+    void Gametype::spawnPlayerAsDefaultPawn(PlayerInfo* player)
+    {
+        SpawnPoint* spawn = this->getBestSpawnPoint(player);
+        if (spawn)
+        {
+            // force spawn at spawnpoint with default pawn
+            ControllableEntity* entity = this->defaultControllableEntity_.fabricate(spawn);
+            spawn->spawn(entity);
+            player->startControl(entity);
+        }
+        else
+        {
+            COUT(1) << "Error: No SpawnPoints in current Gametype" << std::endl;
+            abort();
+        }
+    }
+
+    void Gametype::addBots(unsigned int amount)
+    {
+        for (unsigned int i = 0; i < amount; ++i)
+            this->botclass_.fabricate(this);
+    }
+
+    void Gametype::killBots(unsigned int amount)
+    {
+        unsigned int i = 0;
+        for (ObjectList<Bot>::iterator it = ObjectList<Bot>::begin(); (it != ObjectList<Bot>::end()) && ((amount == 0) || (i < amount)); )
+        {
+            if (it->getGametype() == this)
+            {
+                delete (*(it++));
+                ++i;
+            }
+        }
+    }
+
+    void Gametype::addTime(float t)
+    {
+        if (this->timeLimit_ == 0)
+          this->time_ -= t;
+        else
+          this->time_ += t;
+    }
+
+    void Gametype::removeTime(float t)
+    {
+        if (this->timeLimit_ == 0)
+          this->time_ += t;
+        else
+          this->time_ -= t;
+    }
+
+    void Gametype::resetTimer()
+    {
+        this->resetTimer(timeLimit_);
+    }
+
+    void Gametype::resetTimer(float t)
+    {
+        this->timeLimit_ = t;
+        this->time_ = t;
+    }
+}
Index: code/trunk/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/trunk/src/orxonox/gametypes/Gametype.h	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/Gametype.h	(revision 5781)
@@ -0,0 +1,189 @@
+/*
+ *   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 _Gametype_H__
+#define _Gametype_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <set>
+#include <string>
+
+#include "core/BaseObject.h"
+#include "core/Identifier.h"
+#include "tools/interfaces/Tickable.h"
+#include "infos/GametypeInfo.h"
+
+namespace orxonox
+{
+    namespace PlayerState
+    {
+        enum Value
+        {
+            Uninitialized,
+            Joined,
+            Alive,
+            Dead
+        };
+    }
+
+    struct Player
+    {
+        PlayerInfo* info_;
+        PlayerState::Value state_;
+        int frags_;
+        int killed_;
+    };
+
+    class _OrxonoxExport Gametype : public BaseObject, public Tickable
+    {
+        friend class PlayerInfo;
+
+        public:
+            Gametype(BaseObject* creator);
+            virtual ~Gametype() {}
+
+            void setConfigValues();
+
+            virtual void tick(float dt);
+
+            inline const GametypeInfo* getGametypeInfo() const
+                { return &this->gtinfo_; }
+
+            inline bool hasStarted() const
+                { return this->gtinfo_.bStarted_; }
+            inline bool hasEnded() const
+                { return this->gtinfo_.bEnded_; }
+
+            virtual void start();
+            virtual void end();
+            virtual void playerEntered(PlayerInfo* player);
+            virtual bool playerLeft(PlayerInfo* player);
+            virtual void playerSwitched(PlayerInfo* player, Gametype* newgametype);
+            virtual void playerSwitchedBack(PlayerInfo* player, Gametype* oldgametype);
+            virtual bool playerChangedName(PlayerInfo* player);
+
+            virtual void playerScored(PlayerInfo* player);
+
+            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+
+            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+            virtual void pawnPreSpawn(Pawn* pawn);
+            virtual void pawnPostSpawn(Pawn* pawn);
+            virtual void playerPreSpawn(PlayerInfo* player);
+            virtual void playerPostSpawn(PlayerInfo* player);
+
+            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
+            virtual void playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn);
+
+            inline const std::map<PlayerInfo*, Player>& getPlayers() const
+                { return this->players_; }
+
+            int getScore(PlayerInfo* player) const;
+
+            inline void registerSpawnPoint(SpawnPoint* spawnpoint)
+                { this->spawnpoints_.insert(spawnpoint); }
+
+            inline bool isStartCountdownRunning() const
+                { return this->gtinfo_.bStartCountdownRunning_; }
+            inline float getStartCountdown() const
+                { return this->gtinfo_.startCountdown_; }
+
+            inline void setHUDTemplate(const std::string& name)
+                { this->gtinfo_.hudtemplate_ = name; }
+            inline const std::string& getHUDTemplate() const
+                { return this->gtinfo_.hudtemplate_; }
+
+            void addBots(unsigned int amount);
+            void killBots(unsigned int amount = 0);
+
+            inline unsigned int getNumberOfPlayers() const
+                { return this->players_.size(); }
+
+            virtual void addTime(float t);
+            virtual void removeTime(float t);
+
+            inline  void startTimer()
+            {
+                this->time_ = this->timeLimit_;
+                this->timerIsActive_ = true;
+            }
+
+            inline void stopTimer()
+              { this->timerIsActive_ = false; }
+
+            inline float getTime()
+              { return this->time_; }
+
+            inline bool getTimerIsActive()
+              { return timerIsActive_; }
+
+            inline void setTimeLimit(float t)
+              { this->timeLimit_ = t; }
+
+            virtual void resetTimer();
+            virtual void resetTimer(float t);
+
+        protected:
+            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
+
+            virtual void assignDefaultPawnsIfNeeded();
+            virtual void checkStart();
+            virtual void spawnPlayer(PlayerInfo* player);
+            virtual void spawnPlayerAsDefaultPawn(PlayerInfo* player);
+            virtual void spawnPlayersIfRequested();
+            virtual void spawnDeadPlayersIfRequested();
+
+            GametypeInfo gtinfo_;
+
+            bool bAutoStart_;
+            bool bForceSpawn_;
+
+            float time_;
+            float timeLimit_;
+            bool timerIsActive_;
+
+            float initialStartCountdown_;
+            unsigned int numberOfBots_;
+            SubclassIdentifier<Bot> botclass_;
+
+            std::map<PlayerInfo*, Player> players_;
+            std::set<SpawnPoint*> spawnpoints_;
+            SubclassIdentifier<ControllableEntity> defaultControllableEntity_;
+
+            OverlayGroup* scoreboard_;
+
+            // Config Values
+            std::string scoreboardTemplate_;
+    };
+}
+
+#endif /* _Gametype_H__ */
Index: code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/TeamBaseMatch.cc	(revision 5781)
@@ -0,0 +1,272 @@
+/*
+ *   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:
+ *      Val Mikos
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "TeamBaseMatch.h"
+
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "worldentities/pawns/TeamBaseMatchBase.h"
+#include "infos/PlayerInfo.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(TeamBaseMatch);
+
+    TeamBaseMatch::TeamBaseMatch(BaseObject* creator) : TeamDeathmatch(creator)
+    {
+        RegisterObject(TeamBaseMatch);
+
+        this->scoreTimer_.setTimer(10, true, this, createExecutor(createFunctor(&TeamBaseMatch::winPoints)));
+        this->outputTimer_.setTimer(10, true, this, createExecutor(createFunctor(&TeamBaseMatch::showPoints)));
+
+        this->pointsTeam1_ = 0;
+        this->pointsTeam2_ = 0;
+
+        this->setHUDTemplate("TeamBaseMatchHUD");
+    }
+
+    // Change the control of the defeated base and respawn it with its initial health
+    bool TeamBaseMatch::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        TeamBaseMatchBase* base = orxonox_cast<TeamBaseMatchBase*>(victim);
+        if (base)
+        {
+            if (!originator)
+                return false;
+
+            std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.find(base);
+            if (it != this->bases_.end())
+            {
+                int teamnr = this->getTeam(originator->getPlayer());
+                if (teamnr == 0)
+                {
+                    base->setState(BaseState::ControlTeam1);
+                    this->gtinfo_.sendAnnounceMessage("The red team captured a base");
+                }
+                if (teamnr == 1)
+                {
+                    base->setState(BaseState::ControlTeam2);
+                    this->gtinfo_.sendAnnounceMessage("The blue team captured a base");
+                }
+            }
+
+            victim->setHealth(victim->getInitialHealth());
+            return false;
+        }
+
+        return TeamDeathmatch::allowPawnDeath(victim, originator);
+    }
+
+
+    // if the player is in the same team as the base, he can't make any damage to it
+    bool TeamBaseMatch::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        TeamBaseMatchBase* base = orxonox_cast<TeamBaseMatchBase*>(victim);
+        if (base)
+        {
+            std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.find(base);
+            if (it != this->bases_.end())
+                return (!this->pawnsAreInTheSameTeam(originator, base));
+        }
+        return TeamDeathmatch::allowPawnDamage(victim, originator);
+    }
+
+    bool TeamBaseMatch::pawnsAreInTheSameTeam(Pawn* pawn1, TeamBaseMatchBase* base)
+    {
+        if (pawn1 && base)
+        {
+            std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
+            int teamnrbase = -1;
+            int teamnrplayer = this->getTeam(pawn1->getPlayer());
+
+            switch (base->getState())
+            {
+                case BaseState::ControlTeam1:
+                    teamnrbase = 0;
+                    break;
+                case BaseState::ControlTeam2:
+                    teamnrbase = 1;
+                    break;
+                case BaseState::Uncontrolled:
+                default:
+                    teamnrbase = -1;
+            }
+
+            if (teamnrbase == teamnrplayer)
+                return true;
+        }
+        return false;
+    }
+
+
+
+
+
+    // collect Points for killing oppenents
+    void TeamBaseMatch::playerScored(PlayerInfo* player)
+    {
+        int teamnr = this->getTeam(player);
+        this->addTeamPoints(teamnr, 5);
+    }
+
+    // show points or each interval of time
+    void TeamBaseMatch::showPoints()
+    {
+        if (!this->hasStarted() || this->hasEnded())
+            return;
+
+        COUT(0) << "Points standing:" << std::endl << "Team 1: "<< pointsTeam1_ << std::endl << "Team 2: " << pointsTeam2_ << std::endl;
+        if(pointsTeam1_ >=1700 && pointsTeam1_ < 2000) COUT(0) << "Team 1 is near victory!" << std::endl;
+        if(pointsTeam2_ >=1700 && pointsTeam2_ < 2000) COUT(0) << "Team 2 is near victory!" << std::endl;
+    }
+
+
+    // collect Points while controlling Bases
+    void TeamBaseMatch::winPoints()
+    {
+        int amountControlled = 0;
+        int amountControlled2 = 0;
+
+        for (std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)
+        {
+            if((*it)->getState() == BaseState::ControlTeam1)
+            {
+                amountControlled++;
+            }
+            if((*it)->getState() == BaseState::ControlTeam2)
+            {
+                amountControlled2++;
+            }
+        }
+
+        this->addTeamPoints(0, (amountControlled * 30));
+        this->addTeamPoints(1, (amountControlled2 * 30));
+    }
+
+
+    // end game if one team reaches 2000 points
+    void TeamBaseMatch::endGame()
+    {
+        if (this->pointsTeam1_ >= 2000 || this->pointsTeam2_ >= 2000)
+        {
+            int winningteam = -1;
+
+            if (this->pointsTeam1_ > this->pointsTeam2_)
+            {
+                COUT(0) << "Team 1 has won the match" << std::endl;
+                winningteam = 0;
+            }
+            else
+            {
+                COUT(0) << "Team 2 has won the match" << std::endl;
+                winningteam = 1;
+            }
+
+            for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+            {
+                if (it->first->getClientID() == CLIENTID_UNKNOWN)
+                    continue;
+
+                if (it->second == winningteam)
+                    this->gtinfo_.sendAnnounceMessage("You have won the match!", it->first->getClientID());
+                else
+                    this->gtinfo_.sendAnnounceMessage("You have lost the match!", it->first->getClientID());
+            }
+
+            this->end();
+            this->scoreTimer_.stopTimer();
+            this->outputTimer_.stopTimer();
+        }
+    }
+
+
+    // this function is called by the function winPoints() which adds points to the teams for every base and killed openents at a certain time
+    void TeamBaseMatch::addTeamPoints(int team, int points)
+    {
+        if(team == 0)
+        {
+            this->pointsTeam1_ += points;
+        }
+        if(team == 1)
+        {
+            this->pointsTeam2_ += points;
+        }
+
+        this->endGame();
+    }
+
+    int TeamBaseMatch::getTeamPoints(int team)
+    {
+        if(team == 0)
+        {
+            return this->pointsTeam1_;
+        }
+        if(team == 1)
+        {
+            return this->pointsTeam2_;
+        }
+
+        return 0;
+    }
+
+    int TeamBaseMatch::getTeamBases(int team)
+    {
+        int count = 0;
+
+        for (std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)
+        {
+            if ((*it)->getState() == BaseState::ControlTeam1 && team == 0)
+                count++;
+            if ((*it)->getState() == BaseState::ControlTeam2 && team == 1)
+                count++;
+        }
+
+        return count;
+    }
+
+    void TeamBaseMatch::addBase(TeamBaseMatchBase* base)
+    {
+        this->bases_.insert(base);
+        base->setState(BaseState::Uncontrolled);
+    }
+
+    TeamBaseMatchBase* TeamBaseMatch::getBase(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)
+        {
+            i++;
+            if (i > index)
+                return (*it);
+        }
+        return 0;
+    }
+
+}
+
+
Index: code/trunk/src/orxonox/gametypes/TeamBaseMatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamBaseMatch.h	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/TeamBaseMatch.h	(revision 5781)
@@ -0,0 +1,76 @@
+/*
+ *   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:
+ *      Val Mikos
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TeamBaseMatch_H__
+#define _TeamBaseMatch_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <set>
+#include "tools/Timer.h"
+#include "TeamDeathmatch.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TeamBaseMatch : public TeamDeathmatch
+    {
+        public:
+            TeamBaseMatch(BaseObject* creator);
+            virtual ~TeamBaseMatch() {}
+
+            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator);
+
+            virtual void playerScored(PlayerInfo* player);
+            virtual void showPoints();
+            virtual void endGame();
+
+            void addBase(TeamBaseMatchBase* base);
+            TeamBaseMatchBase* getBase(unsigned int index) const;
+
+            void addTeamPoints(int team, int points);
+            int getTeamPoints(int team);
+            int getTeamBases(int team);
+
+        protected:
+            void winPoints();
+
+            bool pawnsAreInTheSameTeam(Pawn* pawn1, TeamBaseMatchBase* base);
+            using TeamDeathmatch::pawnsAreInTheSameTeam;
+
+            std::set<TeamBaseMatchBase*> bases_;
+            Timer<TeamBaseMatch> scoreTimer_;
+            Timer<TeamBaseMatch> outputTimer_;
+
+            //points for each team
+            int pointsTeam1_;
+            int pointsTeam2_;
+    };
+}
+
+#endif /* _TeamBaseMatch_H__ */
Index: code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/TeamDeathmatch.cc	(revision 5781)
@@ -0,0 +1,202 @@
+/*
+ *   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 "TeamDeathmatch.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "interfaces/TeamColourable.h"
+#include "worldentities/TeamSpawnPoint.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(TeamDeathmatch);
+
+    TeamDeathmatch::TeamDeathmatch(BaseObject* creator) : Deathmatch(creator)
+    {
+        RegisterObject(TeamDeathmatch);
+
+        this->teams_ = 2;
+
+        this->setConfigValues();
+    }
+
+    void TeamDeathmatch::setConfigValues()
+    {
+        SetConfigValue(teams_, 2);
+
+        static ColourValue colours[] =
+        {
+            ColourValue(1.0f, 0.3f, 0.3f),
+            ColourValue(0.3f, 0.3f, 1.0f),
+            ColourValue(0.3f, 1.0f, 0.3f),
+            ColourValue(1.0f, 1.0f, 0.0f)
+        };
+        static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
+
+        SetConfigValueVector(teamcolours_, defaultcolours);
+    }
+
+    void TeamDeathmatch::playerEntered(PlayerInfo* player)
+    {
+        Deathmatch::playerEntered(player);
+
+        std::vector<unsigned int> playersperteam(this->teams_, 0);
+
+        for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+            if (it->second < static_cast<int>(this->teams_) && it->second >= 0)
+                playersperteam[it->second]++;
+
+        unsigned int minplayers = static_cast<unsigned int>(-1);
+        size_t minplayersteam = 0;
+        for (size_t i = 0; i < this->teams_; ++i)
+        {
+            if (playersperteam[i] < minplayers)
+            {
+                minplayers = playersperteam[i];
+                minplayersteam = i;
+            }
+        }
+
+        this->teamnumbers_[player] = minplayersteam;
+    }
+
+    bool TeamDeathmatch::playerLeft(PlayerInfo* player)
+    {
+        bool valid_player = Deathmatch::playerLeft(player);
+
+        if (valid_player)
+            this->players_.erase(player);
+
+        return valid_player;
+    }
+
+    bool TeamDeathmatch::allowPawnHit(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator));
+    }
+
+    bool TeamDeathmatch::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator));
+    }
+
+    bool TeamDeathmatch::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        return (!this->pawnsAreInTheSameTeam(victim, originator));
+    }
+
+    SpawnPoint* TeamDeathmatch::getBestSpawnPoint(PlayerInfo* player) const
+    {
+        int desiredTeamNr = -1;
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end())
+            desiredTeamNr = it_player->second;
+
+        // Only use spawnpoints of the own team (or non-team-spawnpoints)
+        std::set<SpawnPoint*> teamSpawnPoints = this->spawnpoints_;
+        for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+        {
+            if ((*it)->isA(Class(TeamSpawnPoint)))
+            {
+                TeamSpawnPoint* tsp = orxonox_cast<TeamSpawnPoint*>(*it);
+                if (tsp && static_cast<int>(tsp->getTeamNumber()) != desiredTeamNr)
+                {
+                    teamSpawnPoints.erase(it++);
+                    continue;
+                }
+            }
+
+            ++it;
+        }
+
+        if (teamSpawnPoints.size() > 0)
+        {
+            unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
+            unsigned int index = 0;
+            for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
+            {
+                if (index == randomspawn)
+                    return (*it);
+
+                ++index;
+            }
+        }
+
+        return 0;
+    }
+
+    void TeamDeathmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
+    {
+        if (!player)
+            return;
+
+        // Set the team colour
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end() && it_player->second >= 0 && it_player->second < static_cast<int>(this->teamcolours_.size()))
+        {
+            if (pawn)
+            {
+                pawn->setRadarObjectColour(this->teamcolours_[it_player->second]);
+
+                std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
+                for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it)
+                {
+                    if ((*it)->isA(Class(TeamColourable)))
+                    {
+                        TeamColourable* tc = orxonox_cast<TeamColourable*>(*it);
+                        tc->setTeamColour(this->teamcolours_[it_player->second]);
+                    }
+                }
+            }
+        }
+    }
+
+    bool TeamDeathmatch::pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2)
+    {
+        if (pawn1 && pawn2)
+        {
+            std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
+            std::map<PlayerInfo*, int>::const_iterator it2 = this->teamnumbers_.find(pawn2->getPlayer());
+
+            if (it1 != this->teamnumbers_.end() && it2 != this->teamnumbers_.end())
+                return (it1->second == it2->second);
+        }
+        return false;
+    }
+
+    int TeamDeathmatch::getTeam(PlayerInfo* player)
+    {
+        std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+        if (it_player != this->teamnumbers_.end())
+            return it_player->second;
+        else
+            return -1;
+    }
+}
Index: code/trunk/src/orxonox/gametypes/TeamDeathmatch.h
===================================================================
--- code/trunk/src/orxonox/gametypes/TeamDeathmatch.h	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/TeamDeathmatch.h	(revision 5781)
@@ -0,0 +1,72 @@
+/*
+ *   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 _TeamDeathmatch_H__
+#define _TeamDeathmatch_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <vector>
+#include "Deathmatch.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TeamDeathmatch : public Deathmatch
+    {
+        public:
+            TeamDeathmatch(BaseObject* creator);
+            virtual ~TeamDeathmatch() {}
+
+            void setConfigValues();
+
+            virtual void playerEntered(PlayerInfo* player);
+            virtual bool playerLeft(PlayerInfo* player);
+
+            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+
+            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
+
+            int getTeam(PlayerInfo* player);
+
+            inline const ColourValue& getTeamColour(int teamnr) const
+                { return this->teamcolours_[teamnr]; }
+
+        protected:
+            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
+            bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
+
+            std::map<PlayerInfo*, int> teamnumbers_;
+            std::vector<ColourValue> teamcolours_;
+            unsigned int teams_;
+    };
+}
+
+#endif /* _TeamDeathmatch_H__ */
Index: code/trunk/src/orxonox/gametypes/UnderAttack.cc
===================================================================
--- code/trunk/src/orxonox/gametypes/UnderAttack.cc	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/UnderAttack.cc	(revision 5781)
@@ -0,0 +1,197 @@
+/*
+ *   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:
+ *      Matthias Mock
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "UnderAttack.h"
+
+#include "util/Convert.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "network/Host.h"
+#include "worldentities/pawns/Destroyer.h"
+#include "infos/PlayerInfo.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(UnderAttack);
+
+    UnderAttack::UnderAttack(BaseObject* creator) : TeamDeathmatch(creator)
+    {
+        RegisterObject(UnderAttack);
+        this->gameTime_ = 180;
+        this->teams_ = 2;
+        this->destroyer_ = 0;
+        this->gameEnded_ = false;
+
+        this->setHUDTemplate("UnderAttackHUD");
+
+        this->setConfigValues();
+        this->timesequence_ = static_cast<int>(this->gameTime_);
+    }
+
+    void UnderAttack::setConfigValues()
+    {
+        SetConfigValue(gameTime_, 180);
+    }
+
+    void UnderAttack::addDestroyer(Destroyer* destroyer)
+    {
+        this->destroyer_ = destroyer;
+    }
+
+
+    void UnderAttack::destroyedPawn(Pawn* pawn)
+    {
+        if (pawn == this->destroyer_)
+        {
+            this->end(); //end gametype
+            std::string message = "Ship destroyed! Team 0 has won!";
+            COUT(0) << message << std::endl;
+            Host::Broadcast(message);
+            this->gameEnded_ = true;
+
+            for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+            {
+                if (it->first->getClientID() == CLIENTID_UNKNOWN)
+                    continue;
+
+                if (it->second == 0)
+                    this->gtinfo_.sendAnnounceMessage("You have won the match!", it->first->getClientID());
+                else
+                    this->gtinfo_.sendAnnounceMessage("You have lost the match!", it->first->getClientID());
+            }
+        }
+    }
+
+    bool UnderAttack::allowPawnHit(Pawn* victim, Pawn* originator)
+    {
+        if (victim == this->destroyer_)
+        {
+            if (originator && originator->getPlayer() && !gameEnded_)
+            {
+                if (this->getTeam(originator->getPlayer()) == 0)
+                    return true;
+                else
+                    return false;
+            }
+
+            return false;
+        }
+
+        return TeamDeathmatch::allowPawnHit(victim, originator);
+    }
+
+    bool UnderAttack::allowPawnDamage(Pawn* victim, Pawn* originator)
+    {
+        if (victim == this->destroyer_)
+        {
+            if (originator && originator->getPlayer() && !gameEnded_)
+            {
+                if (this->getTeam(originator->getPlayer()) == 0)
+                    return true;
+                else
+                    return false;
+            }
+
+            return false;
+        }
+
+        return TeamDeathmatch::allowPawnDamage(victim, originator);
+    }
+
+    bool UnderAttack::allowPawnDeath(Pawn* victim, Pawn* originator)
+    {
+        if (victim == this->destroyer_)
+        {
+            if (originator && originator->getPlayer() && !gameEnded_)
+            {
+                if (this->getTeam(originator->getPlayer()) == 0)
+                    return true;
+                else
+                    return false;
+            }
+
+            return false;
+        }
+
+        return TeamDeathmatch::allowPawnDeath(victim, originator);
+    }
+
+
+    void UnderAttack::tick(float dt)
+    {
+        SUPER(UnderAttack, tick, dt);
+
+        if (this->hasStarted() && !gameEnded_)
+        {
+            gameTime_ = gameTime_ - dt;
+            if (gameTime_<= 0)
+            {
+                this->gameEnded_ = true;
+                this->end();
+                std::string message = "Time is up! Team 1 has won!";
+                COUT(0) << message << std::endl;
+                Host::Broadcast(message);
+
+                for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+                {
+                    if (it->first->getClientID() == CLIENTID_UNKNOWN)
+                        continue;
+
+                    if (it->second == 1)
+                        this->gtinfo_.sendAnnounceMessage("You have won the match!", it->first->getClientID());
+                    else
+                        this->gtinfo_.sendAnnounceMessage("You have lost the match!", it->first->getClientID());
+                }
+            }
+
+             //prints gametime
+            if ( gameTime_ <= timesequence_ && gameTime_ > 0)
+            {
+                std::string message = multi_cast<std::string>(timesequence_) + " seconds left!";
+/*
+                COUT(0) << message << std::endl;
+                Host::Broadcast(message);
+*/
+                this->gtinfo_.sendAnnounceMessage(message);
+
+                if (timesequence_ >= 30 && timesequence_ <= 60)
+                {
+                    timesequence_ = timesequence_ - 10;
+                }
+                else if (timesequence_ <= 30)
+                {
+                    timesequence_ = timesequence_ - 5;
+                }
+                else
+                {
+                    timesequence_ = timesequence_ - 30;
+                }
+            }
+        }
+    }
+}
Index: code/trunk/src/orxonox/gametypes/UnderAttack.h
===================================================================
--- code/trunk/src/orxonox/gametypes/UnderAttack.h	(revision 5781)
+++ code/trunk/src/orxonox/gametypes/UnderAttack.h	(revision 5781)
@@ -0,0 +1,66 @@
+/*
+ *   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:
+ *      Matthias Mock
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _UnderAttack_H__
+#define _UnderAttack_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "interfaces/PawnListener.h"
+#include "TeamDeathmatch.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport UnderAttack : public TeamDeathmatch, public PawnListener
+    {
+        public:
+            UnderAttack(BaseObject* creator);
+            virtual ~UnderAttack() {}
+
+            void setConfigValues();
+            void tick (float dt);
+            void addDestroyer(Destroyer* destroyer);
+            inline Destroyer* getDestroyer() const
+                { return this->destroyer_; }
+
+            virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
+            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+
+        protected:
+            virtual void destroyedPawn(Pawn* pawn);
+
+            Destroyer* destroyer_;
+            unsigned int teams_;
+            float gameTime_;
+            int timesequence_;
+            bool gameEnded_;
+    };
+}
+
+#endif /* _TeamDeathmatch_H__ */
Index: code/trunk/src/orxonox/graphics/Backlight.cc
===================================================================
--- code/trunk/src/orxonox/graphics/Backlight.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Backlight.cc	(revision 5781)
@@ -0,0 +1,234 @@
+/*
+ *   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 "Backlight.h"
+
+#include <algorithm>
+#include <OgreRibbonTrail.h>
+#include <OgreSceneManager.h>
+#include <OgreSceneNode.h>
+
+#include "util/Exception.h"
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(Backlight);
+
+    Backlight::Backlight(BaseObject* creator) : FadingBillboard(creator)
+    {
+        RegisterObject(Backlight);
+
+        this->ribbonTrail_ = 0;
+        this->ribbonTrailNode_ = 0;
+
+        this->width_ = 0;
+        this->length_ = 1.0f;
+        this->lifetime_ = 0.001f;
+        this->maxelements_ = 1;
+
+        this->tickcount_ = 0;
+
+        if (GameMode::showsGraphics())
+        {
+            if (!this->getScene())
+                ThrowException(AbortLoading, "Can't create Backlight, no scene given.");
+            if (!this->getScene()->getSceneManager())
+                ThrowException(AbortLoading, "Can't create Backlight, no scene manager given.");
+            if (!this->getScene()->getRootSceneNode())
+                ThrowException(AbortLoading, "Can't create Backlight, no root scene node given.");
+
+            this->ribbonTrail_ = this->getScene()->getSceneManager()->createRibbonTrail(this->getNode()->getName());
+
+            this->ribbonTrailNode_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
+            this->ribbonTrailNode_->attachObject(this->ribbonTrail_);
+
+            this->ribbonTrail_->setMaxChainElements(this->maxelements_);
+            this->ribbonTrail_->setTrailLength(this->length_);
+            this->ribbonTrail_->setInitialWidth(0, 0);
+        }
+
+        this->registerVariables();
+    }
+
+    Backlight::~Backlight()
+    {
+        if (this->isInitialized())
+        {
+            if (this->ribbonTrail_)
+            {
+                if (this->ribbonTrailNode_)
+                {
+                    this->ribbonTrailNode_->detachObject(this->ribbonTrail_);
+                    this->getScene()->getSceneManager()->destroySceneNode(this->ribbonTrailNode_->getName());
+                }
+                this->getScene()->getSceneManager()->destroyRibbonTrail(this->ribbonTrail_);
+            }
+        }
+    }
+
+    void Backlight::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Backlight, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Backlight, "length",        setLength,        getLength,        xmlelement, mode).defaultValues(100.0f);
+        XMLPortParam(Backlight, "width",         setWidth,         getWidth,         xmlelement, mode).defaultValues(1.0f);
+        XMLPortParam(Backlight, "elements",      setMaxElements,   getMaxElements,   xmlelement, mode).defaultValues(10);
+        XMLPortParam(Backlight, "lifetime",      setLifetime,      getLifetime,      xmlelement, mode).defaultValues(1.0f);
+        XMLPortParam(Backlight, "trailmaterial", setTrailMaterial, getTrailMaterial, xmlelement, mode);
+    }
+
+    void Backlight::registerVariables()
+    {
+        registerVariable(this->width_,         VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_width));
+        registerVariable(this->lifetime_,      VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_lifetime));
+        registerVariable(this->length_,        VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_length));
+        registerVariable(this->maxelements_,   VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_maxelements));
+        registerVariable(this->trailmaterial_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_trailmaterial));
+    }
+
+    void Backlight::changedColour()
+    {
+        FadingBillboard::changedColour();
+
+        if (this->ribbonTrail_ && this->tickcount_ >= 2)
+            this->ribbonTrail_->setInitialColour(0, this->getFadedColour());
+    }
+
+    void Backlight::update_width()
+    {
+        if (this->ribbonTrail_ && this->tickcount_ >= 2)
+            this->ribbonTrail_->setInitialWidth(0, this->width_ * this->getWorldScale());
+        this->update_lifetime();
+    }
+
+    void Backlight::update_lifetime()
+    {
+        if (this->ribbonTrail_ && this->tickcount_ >= 2)
+        {
+            this->ribbonTrail_->setWidthChange(0, this->width_ * this->getWorldScale() / this->lifetime_ * this->getTimeFactor());
+            this->ribbonTrail_->setColourChange(0, 0, 0, 0, 1.0f / this->lifetime_ * this->getTimeFactor());
+        }
+    }
+
+    void Backlight::update_length()
+    {
+        if (this->ribbonTrail_ && this->tickcount_ >= 2)
+            this->ribbonTrail_->setTrailLength(this->length_ * this->getWorldScale());
+    }
+
+    void Backlight::update_maxelements()
+    {
+        if (this->ribbonTrail_ && this->tickcount_ >= 2)
+            this->ribbonTrail_->setMaxChainElements(this->maxelements_);
+    }
+
+    void Backlight::update_trailmaterial()
+    {
+        if (this->ribbonTrail_ && this->tickcount_ >= 2)
+            this->ribbonTrail_->setMaterialName(this->trailmaterial_);
+    }
+
+    void Backlight::changedVisibility()
+    {
+        SUPER(Backlight, changedVisibility);
+
+        if (this->ribbonTrail_)
+            this->ribbonTrail_->setVisible(this->isVisible());
+    }
+
+    void Backlight::startturnonoff()
+    {
+        FadingBillboard::startturnonoff();
+
+        if (this->ribbonTrail_ && this->isActive() && this->isVisible())
+            this->ribbonTrail_->setVisible(true);
+    }
+
+    void Backlight::stopturnonoff()
+    {
+        this->postprocessingtime_ = std::max(0.0f, this->lifetime_ - this->turnofftime_);
+
+        FadingBillboard::stopturnonoff();
+
+        if (this->ribbonTrail_)
+            this->ribbonTrail_->setInitialColour(0, this->getFadedColour());
+    }
+
+    void Backlight::poststopturnonoff()
+    {
+        FadingBillboard::poststopturnonoff();
+
+        if (this->ribbonTrail_)
+            this->ribbonTrail_->setVisible(false);
+    }
+
+    void Backlight::changedScale()
+    {
+        SUPER(Backlight, changedScale);
+
+        this->update_width();
+        this->update_length();
+    }
+
+    void Backlight::tick(float dt)
+    {
+        if (this->tickcount_ < 2)
+        {
+            ++this->tickcount_;
+            if (this->tickcount_ == 2)
+            {
+                this->changedColour();
+                this->update_width();
+                this->update_lifetime();
+                this->update_length();
+                this->update_maxelements();
+                this->update_trailmaterial();
+                if (this->ribbonTrail_)
+                    this->ribbonTrail_->addNode(this->node_);
+            }
+        }
+
+        SUPER(Backlight, tick, dt);
+
+        if (this->ribbonTrail_ && this->changedirection_ != 0)
+        {
+            // we use alpha_blend, only adjust alpha
+            const ColourValue& colour = this->getColour();
+            this->ribbonTrail_->setInitialColour(0, colour.r, colour.g, colour.b, this->getFadedColour().a);
+        }
+    }
+
+    void Backlight::changedTimeFactor(float factor_new, float factor_old)
+    {
+        this->update_lifetime();
+    }
+}
Index: code/trunk/src/orxonox/graphics/Backlight.h
===================================================================
--- code/trunk/src/orxonox/graphics/Backlight.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Backlight.h	(revision 5781)
@@ -0,0 +1,104 @@
+/*
+ *   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 _Backlight_H__
+#define _Backlight_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "tools/interfaces/TimeFactorListener.h"
+#include "FadingBillboard.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Backlight : public FadingBillboard, public TimeFactorListener
+    {
+        public:
+            Backlight(BaseObject* creator);
+            virtual ~Backlight();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void tick(float dt);
+            virtual void changedVisibility();
+
+            inline void setWidth(float width)
+                { this->width_ = width; this->update_width(); }
+            inline float getWidth() const
+                { return this->width_; }
+
+            inline void setLifetime(float lifetime)
+                { this->lifetime_ = lifetime; this->update_lifetime(); }
+            inline float getLifetime() const
+                { return this->lifetime_; }
+
+            inline void setLength(float length)
+                { this->length_ = length; this->update_length(); }
+            inline float getLength() const
+                { return this->length_; }
+
+            inline void setMaxElements(size_t maxelements)
+                { this->maxelements_ = maxelements; this->update_maxelements(); }
+            inline size_t getMaxElements() const
+                { return this->maxelements_; }
+
+            inline void setTrailMaterial(const std::string& material)
+                { this->trailmaterial_ = material; this->update_trailmaterial(); }
+            inline const std::string& getTrailMaterial() const
+                { return this->trailmaterial_; }
+
+            virtual void changedScale();
+
+        protected:
+            virtual void changedTimeFactor(float factor_new, float factor_old);
+
+        private:
+            virtual void startturnonoff();
+            virtual void stopturnonoff();
+            virtual void poststopturnonoff();
+            virtual void changedColour();
+            void update_width();
+            void update_lifetime();
+            void update_length();
+            void update_maxelements();
+            void update_trailmaterial();
+
+            Ogre::RibbonTrail* ribbonTrail_;
+            Ogre::SceneNode* ribbonTrailNode_;
+            float width_;
+            float length_;
+            float lifetime_;
+            size_t maxelements_;
+            std::string trailmaterial_;
+            char tickcount_;
+    };
+}
+
+#endif /* _Backlight_H__ */
Index: code/trunk/src/orxonox/graphics/Billboard.cc
===================================================================
--- code/trunk/src/orxonox/graphics/Billboard.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Billboard.cc	(revision 5781)
@@ -0,0 +1,128 @@
+/*
+ *   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 "Billboard.h"
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(Billboard);
+
+    Billboard::Billboard(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(Billboard);
+
+        this->material_ = "";
+        this->colour_ = ColourValue::White;
+//        this->rotation_ = 0;
+
+        this->registerVariables();
+    }
+
+    Billboard::~Billboard()
+    {
+        if (this->isInitialized())
+        {
+            if (this->isInitialized() && this->billboard_.getBillboardSet())
+                this->detachOgreObject(this->billboard_.getBillboardSet());
+        }
+    }
+
+    void Billboard::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Billboard, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Billboard, "material", setMaterial, getMaterial, xmlelement, mode);
+        XMLPortParam(Billboard, "colour",   setColour,   getColour,   xmlelement, mode).defaultValues(ColourValue::White);
+//        XMLPortParam(Billboard, "rotation", setRotation, getRotation, xmlelement, mode).defaultValues(0);
+    }
+
+    void Billboard::registerVariables()
+    {
+        registerVariable(this->material_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
+        registerVariable(this->colour_,   VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
+//        registerVariable(this->rotation_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation));
+    }
+
+    void Billboard::changedMaterial()
+    {
+        if (this->material_ == "")
+            return;
+
+        if (!this->billboard_.getBillboardSet())
+        {
+            if (this->getScene() && GameMode::showsGraphics())
+            {
+                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
+                if (this->billboard_.getBillboardSet())
+                     this->attachOgreObject(this->billboard_.getBillboardSet());
+                this->billboard_.setVisible(this->isVisible());
+//                this->changedRotation();
+            }
+        }
+        else
+            this->billboard_.setMaterial(this->material_);
+    }
+
+    void Billboard::changedColour()
+    {
+        if (!this->billboard_.getBillboardSet())
+        {
+/*
+            if (this->getScene() && GameMode::showsGraphics() && (this->material_ != ""))
+            {
+                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
+                if (this->billboard_.getBillboardSet())
+                    this->attachOgreObject(this->billboard_.getBillboardSet());
+                this->billboard_.setVisible(this->isVisible());
+            }
+*/
+        }
+        else
+            this->billboard_.setColour(this->colour_);
+    }
+
+/*
+    void Billboard::changedRotation()
+    {
+        if (this->billboard_.getBillboardSet())
+            this->billboard_.getBillboardSet()->setRotation(this->rotation_);
+    }
+*/
+
+    void Billboard::changedVisibility()
+    {
+        SUPER(Billboard, changedVisibility);
+
+        this->billboard_.setVisible(this->isVisible());
+    }
+}
Index: code/trunk/src/orxonox/graphics/Billboard.h
===================================================================
--- code/trunk/src/orxonox/graphics/Billboard.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Billboard.h	(revision 5781)
@@ -0,0 +1,90 @@
+/*
+ *   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 _Billboard_H__
+#define _Billboard_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Math.h"
+#include "tools/BillboardSet.h"
+#include "interfaces/TeamColourable.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Billboard : public StaticEntity, public TeamColourable
+    {
+        public:
+            Billboard(BaseObject* creator);
+            virtual ~Billboard();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void changedVisibility();
+
+            inline const BillboardSet& getBillboardSet() const
+                { return this->billboard_; }
+
+            inline void setMaterial(const std::string& material)
+                { this->material_ = material; this->changedMaterial(); }
+            inline const std::string& getMaterial() const
+                { return this->material_; }
+
+            inline void setColour(const ColourValue& colour)
+                { this->colour_ = colour; this->changedColour(); }
+            inline const ColourValue& getColour() const
+                { return this->colour_; }
+/*
+            inline void setRotation(const Radian& rotation)
+                { this->rotation_ = rotation; this->changedRotation(); }
+            inline const Radian& getRotation() const
+                { return this->rotation_; }
+*/
+            virtual void setTeamColour(const ColourValue& colour)
+                { this->setColour(colour); }
+
+        protected:
+            inline BillboardSet& getBillboardSet()
+                { return this->billboard_; }
+
+            virtual void changedColour();
+
+        private:
+            void changedMaterial();
+//            void changedRotation();
+
+            BillboardSet billboard_;
+            std::string material_;
+            ColourValue colour_;
+//            Radian rotation_;
+    };
+}
+
+#endif /* _Billboard_H__ */
Index: code/trunk/src/orxonox/graphics/BlinkingBillboard.cc
===================================================================
--- code/trunk/src/orxonox/graphics/BlinkingBillboard.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/BlinkingBillboard.cc	(revision 5781)
@@ -0,0 +1,86 @@
+/*
+ *   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 "BlinkingBillboard.h"
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(BlinkingBillboard);
+
+    BlinkingBillboard::BlinkingBillboard(BaseObject* creator) : Billboard(creator)
+    {
+        RegisterObject(BlinkingBillboard);
+
+        this->amplitude_ = 1.0f;
+        this->frequency_ = 1.0f;
+        this->phase_ = 0;
+        this->bQuadratic_ = false;
+        this->time_ = 0;
+
+        this->registerVariables();
+    }
+
+    BlinkingBillboard::~BlinkingBillboard()
+    {
+    }
+
+    void BlinkingBillboard::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(BlinkingBillboard, XMLPort, xmlelement, mode);
+
+        XMLPortParam(BlinkingBillboard, "amplitude", setAmplitude, getAmplitude, xmlelement, mode).defaultValues(1.0f);
+        XMLPortParam(BlinkingBillboard, "frequency", setFrequency, getFrequency, xmlelement, mode).defaultValues(1.0f);
+        XMLPortParam(BlinkingBillboard, "phase",     setPhase,     getPhase,     xmlelement, mode).defaultValues(Degree(0));
+        XMLPortParam(BlinkingBillboard, "quadratic", setQuadratic, isQuadratic,  xmlelement, mode).defaultValues(false);
+    }
+
+    void BlinkingBillboard::registerVariables()
+    {
+//        registerVariable(this->amplitude_, VariableDirection::ToClient);
+//        registerVariable(this->frequency_, VariableDirection::ToClient);
+//        registerVariable(this->phase_,     VariableDirection::ToClient);
+    }
+
+    void BlinkingBillboard::tick(float dt)
+    {
+        SUPER(BlinkingBillboard, tick, dt);
+
+        if (GameMode::isMaster() && this->isActive())
+        {
+            this->time_ += dt;
+            if (this->bQuadratic_)
+                this->setScale(this->amplitude_ * static_cast<float>(square(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_))));
+            else
+                this->setScale(this->amplitude_ * static_cast<float>(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_)));
+        }
+    }
+}
Index: code/trunk/src/orxonox/graphics/BlinkingBillboard.h
===================================================================
--- code/trunk/src/orxonox/graphics/BlinkingBillboard.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/BlinkingBillboard.h	(revision 5781)
@@ -0,0 +1,80 @@
+/*
+ *   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 _BlinkingBillboard_H__
+#define _BlinkingBillboard_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Math.h"
+#include "tools/interfaces/Tickable.h"
+#include "Billboard.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport BlinkingBillboard : public Billboard, public Tickable
+    {
+        public:
+            BlinkingBillboard(BaseObject* creator);
+            virtual ~BlinkingBillboard();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void tick(float dt);
+
+            inline void setAmplitude(float amplitude)
+                { this->amplitude_ = amplitude; }
+            inline float getAmplitude() const
+                { return this->amplitude_; }
+
+            inline void setFrequency(float frequency)
+                { this->frequency_ = frequency; }
+            inline float getFrequency() const
+                { return this->frequency_; }
+
+            inline void setPhase(const Degree& phase)
+                { this->phase_ = phase; }
+            inline const Degree& getPhase() const
+                { return this->phase_; }
+
+            inline void setQuadratic(bool bQuadratic)
+                { this->bQuadratic_ = bQuadratic; }
+            inline bool isQuadratic() const
+                { return this->bQuadratic_; }
+
+        private:
+            float amplitude_;
+            float frequency_;
+            Degree phase_;
+            bool bQuadratic_;
+            long double time_;
+    };
+}
+
+#endif /* _BlinkingBillboard_H__ */
Index: code/trunk/src/orxonox/graphics/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/graphics/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/graphics/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,12 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  Backlight.cc
+  Billboard.cc
+  BlinkingBillboard.cc
+  Camera.cc
+  FadingBillboard.cc
+  GlobalShader.cc
+  Light.cc
+  Model.cc
+  ParticleEmitter.cc
+  ParticleSpawner.cc
+)
Index: code/trunk/src/orxonox/graphics/Camera.cc
===================================================================
--- code/trunk/src/orxonox/graphics/Camera.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Camera.cc	(revision 5781)
@@ -0,0 +1,162 @@
+/*
+ *   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:
+ *      Benjamin Knecht
+ *
+ */
+
+#include "Camera.h"
+
+#include <algorithm>
+#include <OgreCamera.h>
+#include <OgreSceneManager.h>
+#include <OgreSceneNode.h>
+
+#include "util/Exception.h"
+#include "util/StringUtils.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "Scene.h"
+#include "CameraManager.h"
+
+namespace orxonox
+{
+    CreateFactory(Camera);
+
+    Camera::Camera(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(Camera);
+
+        if (!this->getScene())
+            ThrowException(AbortLoading, "Can't create Camera, no scene.");
+        if (!this->getScene()->getSceneManager())
+            ThrowException(AbortLoading, "Can't create Camera, no scene-manager given.");
+        if (!this->getScene()->getRootSceneNode())
+            ThrowException(AbortLoading, "Can't create Camera, no root-scene-node given.");
+
+        this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
+        this->cameraNode_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
+        this->attachNode(this->cameraNode_);
+        this->cameraNode_->attachObject(this->camera_);
+
+        this->bHasFocus_ = false;
+        this->bDrag_ = false;
+        this->nearClipDistance_ = 1;
+
+        this->setObjectMode(0x0);
+
+        this->setConfigValues();
+        this->configvaluecallback_changedNearClipDistance();
+    }
+
+    Camera::~Camera()
+    {
+        if (this->isInitialized())
+        {
+            this->releaseFocus();
+
+            this->cameraNode_->detachAllObjects();
+            this->getScene()->getSceneManager()->destroyCamera(this->camera_);
+
+            if (this->bDrag_)
+                this->detachNode(this->cameraNode_);
+
+            if (this->getScene()->getSceneManager())
+                this->getScene()->getSceneManager()->destroySceneNode(this->cameraNode_->getName());
+        }
+    }
+
+    void Camera::setConfigValues()
+    {
+        SetConfigValue(nearClipDistance_, 1.0f).callback(this, &Camera::configvaluecallback_changedNearClipDistance);
+    }
+
+    void Camera::configvaluecallback_changedNearClipDistance()
+    {
+        this->camera_->setNearClipDistance(this->nearClipDistance_);
+    }
+
+    void Camera::tick(float dt)
+    {
+        SUPER(Camera, tick, dt);
+
+        if (this->bDrag_)
+        {
+            // this stuff here may need some adjustments
+            float coeff = std::min(1.0f, 15.0f * dt);
+
+            Vector3 offset = this->getWorldPosition() - this->cameraNode_->_getDerivedPosition();
+            this->cameraNode_->translate(coeff * offset);
+
+            this->cameraNode_->setOrientation(Quaternion::Slerp(coeff, this->cameraNode_->_getDerivedOrientation(), this->getWorldOrientation(), true));
+            //this->cameraNode_->setOrientation(this->getWorldOrientation());
+        }
+    }
+
+    void Camera::requestFocus()
+    {
+        CameraManager::getInstance().requestFocus(this);
+    }
+
+    void Camera::releaseFocus()
+    {
+        CameraManager::getInstance().releaseFocus(this);
+    }
+
+    /**
+        what to do when camera loses focus (do not request focus in this function!!)
+        this is called by the CameraManager singleton class to notify the camera
+    */
+    void Camera::removeFocus()
+    {
+        this->bHasFocus_ = false;
+    }
+
+    void Camera::setFocus()
+    {
+        this->bHasFocus_ = true;
+        CameraManager::getInstance().useCamera(this->camera_);
+    }
+
+    void Camera::setDrag(bool bDrag)
+    {
+        if (bDrag != this->bDrag_)
+        {
+            this->bDrag_ = bDrag;
+
+            if (!bDrag)
+            {
+                this->attachNode(this->cameraNode_);
+                this->cameraNode_->setPosition(Vector3::ZERO);
+                this->cameraNode_->setOrientation(Quaternion::IDENTITY);
+            }
+            else
+            {
+                this->detachNode(this->cameraNode_);
+                this->cameraNode_->setPosition(this->getWorldPosition());
+                this->cameraNode_->setOrientation(this->getWorldOrientation());
+            }
+        }
+    }
+}
Index: code/trunk/src/orxonox/graphics/Camera.h
===================================================================
--- code/trunk/src/orxonox/graphics/Camera.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Camera.h	(revision 5781)
@@ -0,0 +1,74 @@
+/*
+ *   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:
+ *      Benjamin Knecht
+ *
+ */
+
+#ifndef _Camera_H__
+#define _Camera_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/OgreForwardRefs.h"
+#include "tools/interfaces/Tickable.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Camera : public StaticEntity, public Tickable
+    {
+        friend class CameraManager;
+
+        public:
+            Camera(BaseObject* creator);
+            virtual ~Camera();
+
+            void setConfigValues();
+            virtual void tick(float dt);
+
+            void requestFocus();
+            void releaseFocus();
+
+            inline bool hasFocus()
+                { return this->bHasFocus_; }
+
+            void setDrag(bool bDrag);
+            inline bool getDrag() const
+                { return this->bDrag_; }
+
+        private:
+            void removeFocus();
+            void setFocus();
+            void configvaluecallback_changedNearClipDistance();
+
+            Ogre::Camera*    camera_;
+            Ogre::SceneNode* cameraNode_;
+            float            nearClipDistance_;
+            bool             bHasFocus_;
+            bool             bDrag_;
+    };
+}
+
+#endif /* _Camera_H__ */
Index: code/trunk/src/orxonox/graphics/FadingBillboard.cc
===================================================================
--- code/trunk/src/orxonox/graphics/FadingBillboard.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/FadingBillboard.cc	(revision 5781)
@@ -0,0 +1,163 @@
+/*
+ *   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 "FadingBillboard.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(FadingBillboard);
+
+    FadingBillboard::FadingBillboard(BaseObject* creator) : Billboard(creator)
+    {
+        RegisterObject(FadingBillboard);
+
+        this->turnontime_ = 0.0f;
+        this->turnofftime_ = 0.0f;
+        this->postprocessingtime_ = 0.0f;
+        this->changedirection_ = 0;
+
+        this->fadedColour_ = ColourValue::White;
+
+        this->registerVariables();
+    }
+
+    FadingBillboard::~FadingBillboard()
+    {
+    }
+
+    void FadingBillboard::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(FadingBillboard, XMLPort, xmlelement, mode);
+
+        XMLPortParam(FadingBillboard, "turnontime",  setTurnOnTime,  getTurnOnTime,  xmlelement, mode).defaultValues(0.5f);
+        XMLPortParam(FadingBillboard, "turnofftime", setTurnOffTime, getTurnOffTime, xmlelement, mode).defaultValues(0.5f);
+    }
+
+    void FadingBillboard::registerVariables()
+    {
+        registerVariable(this->turnontime_,  VariableDirection::ToClient);
+        registerVariable(this->turnofftime_, VariableDirection::ToClient);
+    }
+
+    void FadingBillboard::changedColour()
+    {
+        Billboard::changedColour();
+
+        if (this->isActive())
+            this->fadedColour_ = this->getColour();
+        else
+            this->fadedColour_ = ColourValue::ZERO;
+
+        this->getBillboardSet().setColour(this->fadedColour_);
+    }
+
+    void FadingBillboard::changedActivity()
+    {
+        SUPER(FadingBillboard, changedActivity);
+
+        this->startturnonoff();
+    }
+
+    void FadingBillboard::changedVisibility()
+    {
+        SUPER(FadingBillboard, changedVisibility);
+
+        if (this->isVisible() && !this->isActive() && this->changedirection_ == 0)
+        {
+            // Billboard shouldn't be visible
+            this->getBillboardSet().setVisible(false);
+        }
+    }
+
+    void FadingBillboard::startturnonoff()
+    {
+        if (this->isActive())
+        {
+            this->changedirection_ = 1;
+            this->turnonofftimer_.setTimer(this->turnontime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));
+
+            if (this->isVisible())
+                this->getBillboardSet().setVisible(true);
+        }
+        else
+        {
+            this->changedirection_ = -1;
+            this->turnonofftimer_.setTimer(this->turnofftime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));
+        }
+    }
+
+    void FadingBillboard::stopturnonoff()
+    {
+        if (this->changedirection_ > 0)
+        {
+            this->fadedColour_ = this->getColour();
+            this->getBillboardSet().setColour(this->fadedColour_);
+        }
+        else if (this->changedirection_ < 0)
+        {
+            this->fadedColour_ = ColourValue::ZERO;
+            this->getBillboardSet().setColour(this->fadedColour_);
+            this->turnonofftimer_.setTimer(this->postprocessingtime_, false, this, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff)));
+        }
+        this->changedirection_ = 0;
+    }
+
+    void FadingBillboard::poststopturnonoff()
+    {
+        this->getBillboardSet().setVisible(false);
+    }
+
+    void FadingBillboard::tick(float dt)
+    {
+        SUPER(FadingBillboard, tick, dt);
+
+        if (this->changedirection_ > 0 && (this->fadedColour_.a < this->getColour().a))
+        {
+            ColourValue colour = this->fadedColour_ + this->getColour() / this->turnontime_ * dt;
+
+            if (colour.a < this->getColour().a)
+            {
+                this->fadedColour_ = colour;
+                this->getBillboardSet().setColour(this->fadedColour_);
+            }
+        }
+        else if (this->changedirection_ < 0 && (this->fadedColour_.a > 0))
+        {
+            ColourValue colour = this->fadedColour_ - this->getColour() / this->turnofftime_ * dt;
+
+            if (colour.a > 0)
+            {
+                this->fadedColour_ = colour;
+                this->getBillboardSet().setColour(this->fadedColour_);
+            }
+        }
+    }
+}
Index: code/trunk/src/orxonox/graphics/FadingBillboard.h
===================================================================
--- code/trunk/src/orxonox/graphics/FadingBillboard.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/FadingBillboard.h	(revision 5781)
@@ -0,0 +1,82 @@
+/*
+ *   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 _FadingBillboard_H__
+#define _FadingBillboard_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Math.h"
+#include "tools/Timer.h"
+#include "tools/interfaces/Tickable.h"
+#include "Billboard.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport FadingBillboard : public Billboard, public Tickable
+    {
+        public:
+            FadingBillboard(BaseObject* creator);
+            virtual ~FadingBillboard();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void tick(float dt);
+            virtual void changedActivity();
+            virtual void changedVisibility();
+
+            inline void setTurnOnTime(float turnontime)
+                { this->turnontime_ = turnontime; }
+            inline float getTurnOnTime() const
+                { return this->turnontime_; }
+
+            inline void setTurnOffTime(float turnofftime)
+                { this->turnofftime_ = turnofftime; }
+            inline float getTurnOffTime() const
+                { return this->turnofftime_; }
+
+            inline const ColourValue& getFadedColour() const
+                { return this->fadedColour_; }
+
+        protected:
+            virtual void startturnonoff();
+            virtual void stopturnonoff();
+            virtual void poststopturnonoff();
+            virtual void changedColour();
+
+            float turnontime_;
+            float turnofftime_;
+            float postprocessingtime_;
+            Timer<FadingBillboard> turnonofftimer_;
+            char changedirection_;
+            ColourValue fadedColour_;
+    };
+}
+
+#endif /* _FadingBillboard_H__ */
Index: code/trunk/src/orxonox/graphics/GlobalShader.cc
===================================================================
--- code/trunk/src/orxonox/graphics/GlobalShader.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/GlobalShader.cc	(revision 5781)
@@ -0,0 +1,78 @@
+/*
+ *   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 "GlobalShader.h"
+
+#include "util/Exception.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(GlobalShader);
+
+    GlobalShader::GlobalShader(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
+    {
+        RegisterObject(GlobalShader);
+
+        if (!this->getScene())
+            ThrowException(AbortLoading, "Can't create GlobalShader, no scene given.");
+//        if (!this->getScene()->getSceneManager())
+//            ThrowException(AbortLoading, "Can't create GlobalShader, no scene manager given.");
+
+        if (this->getScene()->getSceneManager())
+            this->shader_.setSceneManager(this->getScene()->getSceneManager());
+
+        this->registerVariables();
+    }
+
+    GlobalShader::~GlobalShader()
+    {
+    }
+
+    void GlobalShader::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(GlobalShader, XMLPort, xmlelement, mode);
+
+        XMLPortParamExtern(GlobalShader, Shader, &this->shader_, "compositor", setCompositor, getCompositor, xmlelement, mode);
+    }
+
+    void GlobalShader::registerVariables()
+    {
+        registerVariable(this->bVisible_,                                         VariableDirection::ToClient, new NetworkCallback<GlobalShader>(this, &GlobalShader::changedVisibility));
+        registerVariable(const_cast<std::string&>(this->shader_.getCompositor()), VariableDirection::ToClient, new NetworkCallback<Shader>(&this->shader_, &Shader::changedCompositor));
+    }
+
+    void GlobalShader::changedVisibility()
+    {
+        SUPER(GlobalShader, changedVisibility);
+
+        this->shader_.setVisible(this->isVisible());
+    }
+}
Index: code/trunk/src/orxonox/graphics/GlobalShader.h
===================================================================
--- code/trunk/src/orxonox/graphics/GlobalShader.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/GlobalShader.h	(revision 5781)
@@ -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:
+ *      ...
+ *
+ */
+
+#ifndef _GlobalShader_H__
+#define _GlobalShader_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/BaseObject.h"
+#include "network/synchronisable/Synchronisable.h"
+#include "tools/Shader.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport GlobalShader : public BaseObject, public Synchronisable
+    {
+        public:
+            GlobalShader(BaseObject* creator);
+            virtual ~GlobalShader();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void changedVisibility();
+
+            inline const Shader& getShader() const
+                { return this->shader_; }
+
+        private:
+            void changedCompositor();
+
+            Shader shader_;
+    };
+}
+
+#endif /* _GlobalShader_H__ */
Index: code/trunk/src/orxonox/graphics/Light.cc
===================================================================
--- code/trunk/src/orxonox/graphics/Light.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Light.cc	(revision 5781)
@@ -0,0 +1,185 @@
+/*
+ *   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 "Light.h"
+
+#include <OgreSceneManager.h>
+#include <OgreLight.h>
+#include <boost/static_assert.hpp>
+
+#include "util/StringUtils.h"
+#include "util/Exception.h"
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(Light);
+
+    // Be sure we don't do bad conversions
+    BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT       == (int)Light::Point);
+    BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Directional);
+    BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT   == (int)Light::Spotlight);
+
+    Light::Light(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(Light);
+
+        this->light_ = 0;
+        this->diffuse_ = ColourValue::White;
+        this->specular_ = ColourValue::White;
+        this->type_ = Light::Point;
+        this->attenuation_ = Vector4(100000, 1, 0, 0);
+        this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f);
+
+        if (GameMode::showsGraphics())
+        {
+            if (!this->getScene())
+                ThrowException(AbortLoading, "Can't create Light, no scene given.");
+            if (!this->getScene()->getSceneManager())
+                ThrowException(AbortLoading, "Can't create Light, no scene manager given.");
+
+            if (this->getScene() && this->getScene()->getSceneManager())
+            {
+                this->light_ = this->getScene()->getSceneManager()->createLight("Light" + getUniqueNumberString());
+                this->light_->setDirection(WorldEntity::FRONT);
+                this->attachOgreObject(this->light_);
+
+                this->updateType();
+                this->updateDiffuseColour();
+                this->updateSpecularColour();
+                this->updateAttenuation();
+                this->updateSpotlightRange();
+            }
+        }
+
+        this->registerVariables();
+    }
+
+    Light::~Light()
+    {
+        if (this->isInitialized())
+        {
+            if (this->light_ && this->getScene() && this->getScene()->getSceneManager())
+                this->getScene()->getSceneManager()->destroyLight(this->light_);
+        }
+    }
+
+    void Light::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Light, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Light, "type",           setTypeString,     getTypeString,     xmlelement, mode).defaultValues("point");
+        XMLPortParam(Light, "diffuse",        setDiffuseColour,  getDiffuseColour,  xmlelement, mode).defaultValues(ColourValue::White);
+        XMLPortParam(Light, "specular",       setSpecularColour, getSpecularColour, xmlelement, mode).defaultValues(ColourValue::White);
+        XMLPortParam(Light, "attenuation",    setAttenuation,    getAttenuation,    xmlelement, mode).defaultValues(Vector4(100000, 1, 0, 0));
+        XMLPortParam(Light, "spotlightrange", setSpotlightRange, getSpotlightRange, xmlelement, mode).defaultValues(Vector3(40.0f, 30.0f, 1.0f));
+    }
+
+    void Light::registerVariables()
+    {
+        registerVariable((int&)this->type_,     VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateType));
+        registerVariable(this->diffuse_,        VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour));
+        registerVariable(this->specular_,       VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpecularColour));
+        registerVariable(this->attenuation_,    VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateAttenuation));
+        registerVariable(this->spotlightRange_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpotlightRange));
+    }
+
+    void Light::updateDiffuseColour()
+    {
+        if (this->light_)
+            this->light_->setDiffuseColour(this->diffuse_);
+    }
+
+    void Light::updateSpecularColour()
+    {
+        if (this->light_)
+            this->light_->setSpecularColour(this->specular_);
+    }
+
+    void Light::updateAttenuation()
+    {
+        if (this->light_ && this->type_ != Light::Directional)
+            this->light_->setAttenuation(this->attenuation_.x, this->attenuation_.y, this->attenuation_.z, this->attenuation_.w);
+    }
+
+    void Light::updateSpotlightRange()
+    {
+        if (this->light_ && this->type_ == Light::Spotlight)
+            this->light_->setSpotlightRange(Degree(this->spotlightRange_.x), Degree(this->spotlightRange_.y), this->spotlightRange_.z);
+    }
+
+    void Light::setTypeString(const std::string& type)
+    {
+        if (type == "point")
+            this->setType(Light::Point);
+        else if (type == "directional")
+            this->setType(Light::Directional);
+        else if (type == "spotlight")
+            this->setType(Light::Spotlight);
+        else
+            this->setType(Light::Point);
+    }
+
+    std::string Light::getTypeString() const
+    {
+        switch (this->type_)
+        {
+            case Light::Directional:
+                return "directional";
+            case Light::Spotlight:
+                return "spotlight";
+            case Light::Point:
+            default:
+                return "point";
+        }
+    }
+
+    void Light::updateType()
+    {
+        if (this->light_)
+        {
+            this->light_->setType(static_cast<Ogre::Light::LightTypes>(this->type_));
+
+            if (this->type_ != Light::Directional)
+                this->updateAttenuation();
+            if (this->type_ == Light::Spotlight)
+                this->updateSpotlightRange();
+        }
+    }
+
+    void Light::changedVisibility()
+    {
+        SUPER(Light, changedVisibility);
+
+        if (this->light_)
+            this->light_->setVisible(this->isVisible());
+    }
+}
Index: code/trunk/src/orxonox/graphics/Light.h
===================================================================
--- code/trunk/src/orxonox/graphics/Light.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Light.h	(revision 5781)
@@ -0,0 +1,152 @@
+/*
+ *   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 _Light_H__
+#define _Light_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "util/Math.h"
+#include "interfaces/TeamColourable.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Light : public StaticEntity, public TeamColourable
+    {
+        public:
+            enum LightTypes // Copy from the Ogre enum
+            {
+                /// Point light sources give off light equally in all directions, so require only position not direction
+                Point,
+                /// Directional lights simulate parallel light beams from a distant source, hence have direction but no position
+                Directional,
+                /// Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff
+                Spotlight
+            };
+
+        public:
+            Light(BaseObject* creator);
+            virtual ~Light();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void changedVisibility();
+
+            inline Ogre::Light* getLight()
+                { return this->light_; }
+
+            inline void setType(Light::LightTypes type)
+                { this->type_ = type; this->updateType(); }
+            inline Light::LightTypes getType() const
+                { return this->type_; }
+
+            inline void setDiffuseColour(const ColourValue& colour)
+                { this->diffuse_ = colour; this->updateDiffuseColour(); }
+            inline const ColourValue& getDiffuseColour() const
+                { return this->diffuse_; }
+
+            inline void setSpecularColour(const ColourValue& colour)
+                { this->specular_ = colour; this->updateSpecularColour(); }
+            inline const ColourValue& getSpecularColour() const
+                { return this->specular_; }
+
+            virtual void setTeamColour(const ColourValue& colour)
+                { this->setDiffuseColour(colour); this->setSpecularColour(colour); }
+
+            /**
+                @brief Sets the attenuation parameters of the light source i.e. how it diminishes with distance.
+
+                @param attenuation.x range (The absolute upper range of the light in world units)
+                @param attenuation.y constant (The constant factor in the attenuation formula: 1.0 means never attenuate, 0.0 is complete attenuation)
+                @param attenuation.z linear (The linear factor in the attenuation formula: 1 means attenuate evenly over the distance)
+                @param attenuation.w quadratic (The quadratic factor in the attenuation formula: adds a curvature to the attenuation formula)
+
+                Quote from the Ogre API:
+                Lights normally get fainter the further they are away. Also, each light is given a maximum range beyond which it cannot affect any objects.
+                Light attenuation is not applicable to directional lights since they have an infinite range and constant intensity.
+                This follows a standard attenuation approach - see any good 3D text for the details of what they mean since i don't have room here!
+
+                Quote from the Ogre wiki:
+                "Using these numbers, the light has 100% intensity at 0 distance, and
+                trails off to near black at a distance equal to the Range. Keep in mind
+                that most of the light falls in the first 20% of the range."
+
+                Range   Constant   Linear     Quadratic
+                3250,     1.0,     0.0014,    0.000007
+                600,      1.0,     0.007,     0.0002
+                325,      1.0,     0.014,     0.0007
+                200,      1.0,     0.022,     0.0019
+                160,      1.0,     0.027,     0.0028
+                100,      1.0,     0.045,     0.0075
+                65,       1.0,     0.07,      0.017
+                50,       1.0,     0.09,      0.032
+                32,       1.0,     0.14,      0.07
+                20,       1.0,     0.22,      0.20
+                13,       1.0,     0.35,      0.44
+                7,        1.0,     0.7,       1.8
+            */
+            inline void setAttenuation(const Vector4& attenuation)
+                { this->attenuation_ = attenuation; this->updateAttenuation(); }
+            inline const Vector4& getAttenuation() const
+                { return this->attenuation_; }
+
+            /**
+                @brief Sets the range of a spotlight, i.e. the angle of the inner and outer cones and the rate of falloff between them.
+
+                @param spotlightRange.x innerAngle (The angle covered by the bright inner cone)
+                @param spotlightRange.x outerAngle (The angle covered by the outer cone)
+                @param spotlightRange.x falloff (The rate of falloff between the inner and outer cones. 1.0 means a linear falloff, less means slower falloff, higher means faster falloff.)
+            */
+            inline void setSpotlightRange(const Vector3& spotlightRange)
+                { this->spotlightRange_ = spotlightRange; this->updateSpotlightRange(); }
+            inline const Vector3& getSpotlightRange() const
+                { return this->spotlightRange_; }
+
+        private:
+            void setTypeString(const std::string& type);
+            std::string getTypeString() const;
+
+            void updateType();
+            void updateDiffuseColour();
+            void updateSpecularColour();
+            void updateAttenuation();
+            void updateSpotlightRange();
+
+            Ogre::Light* light_;
+            LightTypes type_;
+            ColourValue diffuse_;
+            ColourValue specular_;
+            Vector4 attenuation_;
+            Vector3 spotlightRange_;
+    };
+}
+
+#endif /* _Light_H__ */
Index: code/trunk/src/orxonox/graphics/Model.cc
===================================================================
--- code/trunk/src/orxonox/graphics/Model.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Model.cc	(revision 5781)
@@ -0,0 +1,100 @@
+/*
+ *   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 "Model.h"
+
+#include <OgreEntity.h>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(Model);
+
+    Model::Model(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(Model);
+
+        this->bCastShadows_ = true;
+
+        this->registerVariables();
+    }
+
+    Model::~Model()
+    {
+        if (this->isInitialized() && this->mesh_.getEntity())
+            this->detachOgreObject(this->mesh_.getEntity());
+    }
+
+    void Model::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Model, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Model, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
+        XMLPortParam(Model, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
+    }
+
+    void Model::registerVariables()
+    {
+        registerVariable(this->meshSrc_,    VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedMesh));
+        registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedShadows));
+    }
+
+    void Model::changedMesh()
+    {
+        if (GameMode::showsGraphics())
+        {
+            if (this->mesh_.getEntity())
+                this->detachOgreObject(this->mesh_.getEntity());
+
+            this->mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);
+
+            if (this->mesh_.getEntity())
+            {
+                this->attachOgreObject(this->mesh_.getEntity());
+                this->mesh_.getEntity()->setCastShadows(this->bCastShadows_);
+                this->mesh_.setVisible(this->isVisible());
+            }
+        }
+    }
+
+    void Model::changedShadows()
+    {
+        this->mesh_.setCastShadows(this->bCastShadows_);
+    }
+
+    void Model::changedVisibility()
+    {
+        SUPER(Model, changedVisibility);
+
+        this->mesh_.setVisible(this->isVisible());
+    }
+}
Index: code/trunk/src/orxonox/graphics/Model.h
===================================================================
--- code/trunk/src/orxonox/graphics/Model.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Model.h	(revision 5781)
@@ -0,0 +1,74 @@
+/*
+ *   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 _Model_H__
+#define _Model_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "tools/Mesh.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Model : public StaticEntity
+    {
+        public:
+            Model(BaseObject* creator);
+            virtual ~Model();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void changedVisibility();
+
+            inline const Mesh& getMesh() const
+                { return this->mesh_; }
+
+            inline void setMeshSource(const std::string& meshname)
+                { this->meshSrc_ = meshname; this->changedMesh(); }
+            inline const std::string& getMeshSource() const
+                { return this->meshSrc_; }
+
+            inline void setCastShadows(bool bCastShadows)
+                { this->bCastShadows_ = bCastShadows; this->changedShadows(); }
+            inline bool getCastShadows() const
+                { return this->bCastShadows_; }
+
+        private:
+            void changedMesh();
+            void changedShadows();
+
+            std::string meshSrc_;
+            Mesh mesh_;
+            bool bCastShadows_;
+    };
+}
+
+#endif /* _Model_H__ */
Index: code/trunk/src/orxonox/graphics/ParticleEmitter.cc
===================================================================
--- code/trunk/src/orxonox/graphics/ParticleEmitter.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/ParticleEmitter.cc	(revision 5781)
@@ -0,0 +1,129 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+* @file
+* @brief class to control praticle effects
+*/
+
+#include "ParticleEmitter.h"
+
+#include "util/Exception.h"
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "tools/ParticleInterface.h"
+#include "Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(ParticleEmitter);
+
+    ParticleEmitter::ParticleEmitter(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(ParticleEmitter);
+
+        if (GameMode::showsGraphics() && (!this->getScene() || !this->getScene()->getSceneManager()))
+            ThrowException(AbortLoading, "Can't create ParticleEmitter, no scene or no scene manager given.");
+
+        this->particles_ = 0;
+        this->LOD_ = LODParticle::Normal;
+
+        this->registerVariables();
+    }
+
+    ParticleEmitter::~ParticleEmitter()
+    {
+        if (this->isInitialized() && this->particles_)
+        {
+            this->detachOgreObject(this->particles_->getParticleSystem());
+            delete this->particles_;
+        }
+    }
+
+    void ParticleEmitter::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(ParticleEmitter, XMLPort, xmlelement, mode);
+
+        XMLPortParam(ParticleEmitter, "lod",    setLODxml, getLODxml, xmlelement, mode).defaultValues(LODParticle::Normal);
+        XMLPortParam(ParticleEmitter, "source", setSource, getSource, xmlelement, mode);
+    }
+
+    void ParticleEmitter::registerVariables()
+    {
+        registerVariable(this->source_, VariableDirection::ToClient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
+        registerVariable((int&)(this->LOD_),    VariableDirection::ToClient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
+    }
+
+    void ParticleEmitter::changedVisibility()
+    {
+        SUPER(ParticleEmitter, changedVisibility);
+
+        if (this->particles_)
+            this->particles_->setVisible(this->isVisible());
+    }
+
+    void ParticleEmitter::changedActivity()
+    {
+        SUPER(ParticleEmitter, changedActivity);
+
+        if (this->particles_)
+            this->particles_->setEnabled(this->isActive());
+    }
+
+    void ParticleEmitter::sourceChanged()
+    {
+        if (this->particles_)
+        {
+            delete this->particles_;
+            this->particles_ = 0;
+        }
+
+        if (GameMode::showsGraphics() && this->getScene() && this->getScene()->getSceneManager())
+        {
+            try
+            {
+                this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), this->source_, this->LOD_);
+                this->attachOgreObject(this->particles_->getParticleSystem());
+                this->particles_->setVisible(this->isVisible());
+                this->particles_->setEnabled(this->isActive());
+            }
+            catch (...)
+            {
+                COUT(1) << "Error: Couln't load particle effect \"" << this->source_ << "\" because:" << std::endl
+                        << Exception::handleMessage() << std::endl;
+            }
+        }
+    }
+
+    void ParticleEmitter::LODchanged()
+    {
+        if (this->particles_)
+            this->particles_->setDetailLevel(this->LOD_);
+    }
+}
Index: code/trunk/src/orxonox/graphics/ParticleEmitter.h
===================================================================
--- code/trunk/src/orxonox/graphics/ParticleEmitter.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/ParticleEmitter.h	(revision 5781)
@@ -0,0 +1,79 @@
+/*
+ *   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 _ParticleEmitter_H__
+#define _ParticleEmitter_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ParticleEmitter : public StaticEntity
+    {
+        public:
+            ParticleEmitter(BaseObject* creator);
+            ~ParticleEmitter();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void changedVisibility();
+            virtual void changedActivity();
+
+            inline ParticleInterface* getParticleInterface() const
+                { return this->particles_; }
+
+            inline void setSource(const std::string& source)
+                { this->source_ = source; this->sourceChanged(); }
+            inline const std::string& getSource() const
+                { return this->source_; }
+
+            inline void setLOD(LODParticle::Value level)
+                { this->LOD_ = level; this->LODchanged(); }
+            inline LODParticle::Value getLOD() const
+                { return this->LOD_; }
+
+        protected:
+            inline void setLODxml(unsigned int level)
+                { this->LOD_ = static_cast<LODParticle::Value>(level); this->LODchanged(); }
+            inline unsigned int getLODxml() const
+                { return static_cast<unsigned int>(this->LOD_); }
+
+            void sourceChanged();
+            void LODchanged();
+
+            ParticleInterface* particles_;
+            std::string        source_;
+            LODParticle::Value   LOD_;
+    };
+}
+
+#endif /* _ParticleEmitter_H__ */
Index: code/trunk/src/orxonox/graphics/ParticleSpawner.cc
===================================================================
--- code/trunk/src/orxonox/graphics/ParticleSpawner.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/ParticleSpawner.cc	(revision 5781)
@@ -0,0 +1,130 @@
+/*
+ *   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 "ParticleSpawner.h"
+
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+#include "core/Executor.h"
+#include "core/XMLPort.h"
+#include "tools/ParticleInterface.h"
+
+namespace orxonox
+{
+    CreateFactory(ParticleSpawner);
+
+    ParticleSpawner::ParticleSpawner(BaseObject* creator) : ParticleEmitter(creator)
+    {
+        RegisterObject(ParticleSpawner);
+
+        this->bAutostart_ = true;
+        this->bSuppressStart_ = false;
+        this->bAutoDestroy_ = true;
+        this->bForceDestroy_ = false;
+        this->bLoop_ = false;
+        this->startdelay_ = 0;
+        this->lifetime_ = 0;
+        this->destroydelay_ = 0;
+
+        this->startParticleSpawner();
+    }
+
+    ParticleSpawner::~ParticleSpawner()
+    {
+    }
+
+    void ParticleSpawner::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(ParticleSpawner, XMLPort, xmlelement, mode);
+
+        XMLPortParam(ParticleSpawner, "autostart",    setAutoStart,        getAutoStart,        xmlelement, mode).defaultValues(true);
+        XMLPortParam(ParticleSpawner, "autodestroy",  setDestroyAfterLife, getDestroyAfterLife, xmlelement, mode).defaultValues(false);
+        XMLPortParam(ParticleSpawner, "loop",         setLoop,             getLoop,             xmlelement, mode).defaultValues(false);
+        XMLPortParam(ParticleSpawner, "lifetime",     setLifetime,         getLifetime,         xmlelement, mode).defaultValues(0.0f);
+        XMLPortParam(ParticleSpawner, "startdelay",   setStartdelay,       getStartdelay,       xmlelement, mode).defaultValues(0.0f);
+        XMLPortParam(ParticleSpawner, "destroydelay", setDestroydelay,     getDestroydelay,     xmlelement, mode).defaultValues(0.0f);
+    }
+
+    void ParticleSpawner::processEvent(Event& event)
+    {
+        SUPER(ParticleSpawner, processEvent, event);
+
+        ORXONOX_SET_EVENT(ParticleSpawner, "spawn", spawn, event);
+    }
+
+    void ParticleSpawner::configure(float lifetime, float startdelay, float destroydelay, bool autodestroy)
+    {
+        this->bAutoDestroy_ = autodestroy;
+        this->startdelay_ = startdelay;
+        this->lifetime_ = lifetime;
+        this->destroydelay_ = destroydelay;
+    }
+
+    void ParticleSpawner::startParticleSpawner()
+    {
+        if (!this->particles_)
+            return;
+
+        this->setActive(false);
+
+        if (this->bForceDestroy_ || this->bSuppressStart_)
+            return;
+
+        this->timer_.setTimer(this->startdelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner)));
+    }
+
+    void ParticleSpawner::fireParticleSpawner()
+    {
+        this->setActive(true);
+        if (this->lifetime_ != 0)
+            this->timer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner)));
+    }
+
+    void ParticleSpawner::stopParticleSpawner()
+    {
+        this->setActive(false);
+
+        if (this->bAutoDestroy_ || this->bForceDestroy_)
+        {
+            this->setPosition(this->getWorldPosition());
+            this->detachFromParent();
+
+            if (!this->timer_.isActive() || this->timer_.getRemainingTime() > this->destroydelay_)
+                this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
+        }
+        else if (this->bLoop_)
+        {
+            this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner)));
+        }
+    }
+
+    void ParticleSpawner::destroyParticleSpawner()
+    {
+        delete this;
+    }
+}
Index: code/trunk/src/orxonox/graphics/ParticleSpawner.h
===================================================================
--- code/trunk/src/orxonox/graphics/ParticleSpawner.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/ParticleSpawner.h	(revision 5781)
@@ -0,0 +1,104 @@
+/*
+ *   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 _ParticleSpawner_H__
+#define _ParticleSpawner_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/Timer.h"
+#include "ParticleEmitter.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ParticleSpawner : public ParticleEmitter
+    {
+        public:
+            ParticleSpawner(BaseObject* creator);
+            virtual ~ParticleSpawner();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void processEvent(Event& event);
+
+            inline void destroy()
+                { this->bForceDestroy_ = true; this->stopParticleSpawner(); }
+            inline void spawn()
+                { this->bSuppressStart_ = false; this->startParticleSpawner(); }
+
+            void configure(float lifetime = 0, float startdelay = 0, float destroydelay = 0, bool autodestroy = true);
+
+            inline void setAutoStart(bool autostart)
+                { this->bAutostart_ = autostart; this->bSuppressStart_ = !autostart; }
+            inline bool getAutoStart() const
+                { return this->bAutostart_; }
+
+            inline void setDestroyAfterLife(bool destroy)
+                { this->bAutoDestroy_ = destroy; }
+            inline bool getDestroyAfterLife() const
+                { return this->bAutoDestroy_; }
+
+            inline void setLoop(bool loop)
+                { this->bLoop_ = loop; }
+            inline bool getLoop() const
+                { return this->bLoop_; }
+
+            inline void setLifetime(float lifetime)
+                { this->lifetime_ = lifetime; this->startParticleSpawner(); }
+            inline float getLifetime() const
+                { return this->lifetime_; }
+
+            inline void setStartdelay(float startdelay)
+                { this->startdelay_ = startdelay; this->startParticleSpawner(); }
+            inline float getStartdelay() const
+                { return this->startdelay_; }
+
+            inline void setDestroydelay(float destroydelay)
+                { this->destroydelay_ = destroydelay; this->startParticleSpawner(); }
+            inline float getDestroydelay() const
+                { return this->destroydelay_; }
+
+        private:
+            void startParticleSpawner();
+            void fireParticleSpawner();
+            void stopParticleSpawner();
+            void destroyParticleSpawner();
+
+            Timer<ParticleSpawner> timer_;
+
+            bool  bSuppressStart_;
+            bool  bAutostart_;
+            bool  bForceDestroy_;
+            bool  bAutoDestroy_;
+            bool  bLoop_;
+            float startdelay_;
+            float lifetime_;
+            float destroydelay_;
+    };
+}
+
+#endif /* _ParticleSpawner_H__ */
Index: code/trunk/src/orxonox/infos/Bot.cc
===================================================================
--- code/trunk/src/orxonox/infos/Bot.cc	(revision 5781)
+++ code/trunk/src/orxonox/infos/Bot.cc	(revision 5781)
@@ -0,0 +1,98 @@
+/*
+ *   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 "Bot.h"
+
+#include "util/Math.h"
+#include "core/GameMode.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "gametypes/Gametype.h"
+#include "controllers/AIController.h"
+
+namespace orxonox
+{
+    CreateFactory(Bot);
+
+    Bot::Bot(BaseObject* creator) : PlayerInfo(creator)
+    {
+        RegisterObject(Bot);
+
+        this->bHumanPlayer_ = false;
+        this->bLocalPlayer_ = GameMode::isMaster();
+        this->bSetUnreadyAfterSpawn_ = false;
+        this->setReadyToSpawn(true);
+        this->defaultController_ = Class(AIController);
+
+        this->setConfigValues();
+
+        this->setName(this->names_[static_cast<size_t>(rnd() * this->names_.size())]);
+
+        if (this->getGametype())
+            this->getGametype()->playerEntered(this);
+
+        this->createController();
+    }
+
+    Bot::~Bot()
+    {
+    }
+
+    void Bot::setConfigValues()
+    {
+        static const std::string names[] =
+        {
+            "Dr. Julius No",
+            "Rosa Klebb",
+            "Auric Goldfinger",
+            "Emilio Largo",
+            "Ernst Stavro Blofeld",
+            "Dr. Kananga",
+            "Francisco Scaramanga",
+            "Karl Stromberg",
+            "Sir Hugo Drax",
+            "Aris Kristatos",
+            "Kamal Khan",
+            "General Orlov",
+            "Max Zorin",
+            "Brad Whitaker",
+            "General Koskov",
+            "Franz Sanchez",
+            "Alec Trevelyan",
+            "Elliot Carver",
+            "Viktor Zokas",
+            "Gustav Graves",
+            "Le Chiffre",
+            "Mr. White",
+            "Dominic Greene"
+        };
+        static std::vector<std::string> defaultnames(names, names + sizeof(names) / sizeof(std::string));
+
+        SetConfigValueVector(names_, defaultnames);
+    }
+}
Index: code/trunk/src/orxonox/infos/Bot.h
===================================================================
--- code/trunk/src/orxonox/infos/Bot.h	(revision 5781)
+++ code/trunk/src/orxonox/infos/Bot.h	(revision 5781)
@@ -0,0 +1,59 @@
+/*
+ *   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 _Bot_H__
+#define _Bot_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <vector>
+#include "PlayerInfo.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Bot : public PlayerInfo
+    {
+        public:
+            Bot(BaseObject* creator);
+            virtual ~Bot();
+
+            void setConfigValues();
+
+            inline bool isInitialized() const
+                { return true; }
+            inline float getPing() const
+                { return 0; }
+            inline float getPacketLossRatio() const
+                { return 0; }
+
+        private:
+            std::vector<std::string> names_;
+    };
+}
+
+#endif /* _Bot_H__ */
Index: code/trunk/src/orxonox/infos/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/infos/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/infos/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,7 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  Bot.cc
+  Info.cc
+  PlayerInfo.cc
+  HumanPlayer.cc
+  GametypeInfo.cc
+)
Index: code/trunk/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/GametypeInfo.cc	(revision 5781)
+++ code/trunk/src/orxonox/infos/GametypeInfo.cc	(revision 5781)
@@ -0,0 +1,129 @@
+/*
+ *   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 "GametypeInfo.h"
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "network/NetworkFunction.h"
+#include "network/Host.h"
+#include "interfaces/GametypeMessageListener.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(GametypeInfo);
+
+    registerMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage);
+    registerMemberNetworkFunction(GametypeInfo, dispatchKillMessage);
+    registerMemberNetworkFunction(GametypeInfo, dispatchDeathMessage);
+
+    GametypeInfo::GametypeInfo(BaseObject* creator) : Info(creator)
+    {
+        RegisterObject(GametypeInfo);
+
+        this->bStarted_ = false;
+        this->bEnded_ = false;
+        this->startCountdown_ = 0;
+        this->bStartCountdownRunning_ = false;
+
+        this->registerVariables();
+    }
+
+    GametypeInfo::~GametypeInfo()
+    {
+    }
+
+    void GametypeInfo::registerVariables()
+    {
+        registerVariable(this->bStarted_,               VariableDirection::ToClient);
+        registerVariable(this->bEnded_,                 VariableDirection::ToClient);
+        registerVariable(this->startCountdown_,         VariableDirection::ToClient);
+        registerVariable(this->bStartCountdownRunning_, VariableDirection::ToClient);
+        registerVariable(this->hudtemplate_,            VariableDirection::ToClient);
+    }
+
+    void GametypeInfo::sendAnnounceMessage(const std::string& message)
+    {
+        if (GameMode::isMaster())
+        {
+            callMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage, this->getObjectID(), CLIENTID_UNKNOWN, message);
+            this->dispatchAnnounceMessage(message);
+        }
+    }
+
+    void GametypeInfo::sendAnnounceMessage(const std::string& message, unsigned int clientID)
+    {
+        if (GameMode::isMaster())
+        {
+            if (clientID == CLIENTID_SERVER)
+                this->dispatchAnnounceMessage(message);
+            else
+                callMemberNetworkFunction(GametypeInfo, dispatchAnnounceMessage, this->getObjectID(), clientID, message);
+        }
+    }
+
+    void GametypeInfo::sendKillMessage(const std::string& message, unsigned int clientID)
+    {
+        if (GameMode::isMaster())
+        {
+            if (clientID == CLIENTID_SERVER)
+                this->dispatchKillMessage(message);
+            else
+                callMemberNetworkFunction(GametypeInfo, dispatchKillMessage, this->getObjectID(), clientID, message);
+        }
+    }
+
+    void GametypeInfo::sendDeathMessage(const std::string& message, unsigned int clientID)
+    {
+        if (GameMode::isMaster())
+        {
+            if (clientID == CLIENTID_SERVER)
+                this->dispatchDeathMessage(message);
+            else
+                callMemberNetworkFunction(GametypeInfo, dispatchDeathMessage, this->getObjectID(), clientID, message);
+        }
+    }
+
+    void GametypeInfo::dispatchAnnounceMessage(const std::string& message)
+    {
+        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
+            it->announcemessage(this, message);
+    }
+
+    void GametypeInfo::dispatchKillMessage(const std::string& message)
+    {
+        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
+            it->killmessage(this, message);
+    }
+
+    void GametypeInfo::dispatchDeathMessage(const std::string& message)
+    {
+        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
+            it->deathmessage(this, message);
+    }
+}
Index: code/trunk/src/orxonox/infos/GametypeInfo.h
===================================================================
--- code/trunk/src/orxonox/infos/GametypeInfo.h	(revision 5781)
+++ code/trunk/src/orxonox/infos/GametypeInfo.h	(revision 5781)
@@ -0,0 +1,80 @@
+/*
+ *   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 _GametypeInfo_H__
+#define _GametypeInfo_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "Info.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport GametypeInfo : public Info
+    {
+        friend class Gametype;
+
+        public:
+            GametypeInfo(BaseObject* creator);
+            virtual ~GametypeInfo();
+
+            void registerVariables();
+
+            inline bool hasStarted() const
+                { return this->bStarted_; }
+            inline bool hasEnded() const
+                { return this->bEnded_; }
+
+            inline bool isStartCountdownRunning() const
+                { return this->bStartCountdownRunning_; }
+            inline float getStartCountdown() const
+                { return this->startCountdown_; }
+
+            inline const std::string& getHUDTemplate() const
+                { return this->hudtemplate_; }
+
+            void sendAnnounceMessage(const std::string& message);
+            void sendAnnounceMessage(const std::string& message, unsigned int clientID);
+            void sendKillMessage(const std::string& message, unsigned int clientID);
+            void sendDeathMessage(const std::string& message, unsigned int clientID);
+
+            void dispatchAnnounceMessage(const std::string& message);
+            void dispatchKillMessage(const std::string& message);
+            void dispatchDeathMessage(const std::string& message);
+
+        private:
+            bool bStarted_;
+            bool bEnded_;
+            bool bStartCountdownRunning_;
+            float startCountdown_;
+            std::string hudtemplate_;
+    };
+}
+
+#endif /* _GametypeInfo_H__ */
Index: code/trunk/src/orxonox/infos/HumanPlayer.cc
===================================================================
--- code/trunk/src/orxonox/infos/HumanPlayer.cc	(revision 5781)
+++ code/trunk/src/orxonox/infos/HumanPlayer.cc	(revision 5781)
@@ -0,0 +1,199 @@
+/*
+ *   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 "HumanPlayer.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/GameMode.h"
+#include "network/ClientInformation.h"
+#include "network/Host.h"
+#include "controllers/HumanController.h"
+#include "gametypes/Gametype.h"
+#include "overlays/OverlayGroup.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(HumanPlayer);
+
+    HumanPlayer::HumanPlayer(BaseObject* creator) : PlayerInfo(creator)
+    {
+        RegisterObject(HumanPlayer);
+
+        this->server_initialized_ = GameMode::isMaster();
+        this->client_initialized_ = false;
+
+        this->bHumanPlayer_ = true;
+        this->defaultController_ = Class(HumanController);
+
+        this->humanHud_ = 0;
+        this->gametypeHud_ = 0;
+
+        this->setConfigValues();
+        this->registerVariables();
+    }
+
+    HumanPlayer::~HumanPlayer()
+    {
+        if (this->BaseObject::isInitialized())
+        {
+            if (this->humanHud_)
+                delete this->humanHud_;
+
+            if (this->gametypeHud_)
+                delete this->gametypeHud_;
+        }
+    }
+
+    void HumanPlayer::setConfigValues()
+    {
+        SetConfigValue(nick_, "Player").callback(this, &HumanPlayer::configvaluecallback_changednick);
+        SetConfigValue(hudtemplate_, "defaultHUD").callback(this, &HumanPlayer::configvaluecallback_changedHUDTemplate);
+    }
+
+    void HumanPlayer::registerVariables()
+    {
+        registerVariable(this->synchronize_nick_, VariableDirection::ToServer, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
+
+        registerVariable(this->clientID_,           VariableDirection::ToClient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
+        registerVariable(this->server_initialized_, VariableDirection::ToClient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));
+        registerVariable(this->client_initialized_, VariableDirection::ToServer, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));
+    }
+
+    void HumanPlayer::configvaluecallback_changednick()
+    {
+        if (this->isLocalPlayer())
+        {
+            this->synchronize_nick_ = this->nick_;
+
+            if (GameMode::isMaster())
+                this->setName(this->nick_);
+        }
+    }
+
+    void HumanPlayer::configvaluecallback_changedHUDTemplate()
+    {
+        this->setHumanHUDTemplate(this->hudtemplate_);
+    }
+
+    void HumanPlayer::networkcallback_changednick()
+    {
+        this->setName(this->synchronize_nick_);
+    }
+
+    void HumanPlayer::networkcallback_clientIDchanged()
+    {
+        if (this->clientID_ == Host::getPlayerID())
+        {
+            this->bLocalPlayer_ = true;
+            this->synchronize_nick_ = this->nick_;
+            this->client_initialized_ = true;
+
+            if (!GameMode::isMaster())
+                this->setObjectMode(ObjectDirection::Bidirectional);
+            else
+                this->setName(this->nick_);
+
+            this->createController();
+            this->updateHumanHUD();
+        }
+    }
+
+    void HumanPlayer::networkcallback_server_initialized()
+    {
+        this->client_initialized_ = true;
+    }
+
+    void HumanPlayer::networkcallback_client_initialized()
+    {
+        if (this->getGametype())
+            this->getGametype()->playerEntered(this);
+    }
+
+    bool HumanPlayer::isInitialized() const
+    {
+        return (this->server_initialized_ && this->client_initialized_);
+    }
+
+    float HumanPlayer::getPing() const
+    {
+        return static_cast<float>(ClientInformation::findClient(this->getClientID())->getRTT());
+    }
+
+    float HumanPlayer::getPacketLossRatio() const
+    {
+        return static_cast<float>(ClientInformation::findClient(this->getClientID())->getPacketLoss());
+    }
+
+    void HumanPlayer::setClientID(unsigned int clientID)
+    {
+        this->clientID_ = clientID;
+        this->networkcallback_clientIDchanged();
+    }
+
+    void HumanPlayer::changedGametype()
+    {
+        PlayerInfo::changedGametype();
+
+        if (this->isInitialized() && this->isLocalPlayer())
+            if (this->getGametype()->getHUDTemplate() != "")
+                this->setGametypeHUDTemplate(this->getGametype()->getHUDTemplate());
+    }
+
+    void HumanPlayer::updateHumanHUD()
+    {
+        if (this->humanHud_)
+        {
+            delete this->humanHud_;
+            this->humanHud_ = 0;
+        }
+
+        if (this->isLocalPlayer() && this->humanHudTemplate_ != "")
+        {
+            this->humanHud_ = new OverlayGroup(this);
+            this->humanHud_->addTemplate(this->humanHudTemplate_);
+            this->humanHud_->setOwner(this);
+        }
+    }
+
+    void HumanPlayer::updateGametypeHUD()
+    {
+        if (this->gametypeHud_)
+        {
+            delete this->gametypeHud_;
+            this->gametypeHud_ = 0;
+        }
+
+        if (this->isLocalPlayer() && this->gametypeHudTemplate_ != "")
+        {
+            this->gametypeHud_ = new OverlayGroup(this);
+            this->gametypeHud_->addTemplate(this->gametypeHudTemplate_);
+            this->gametypeHud_->setOwner(this);
+        }
+    }
+}
Index: code/trunk/src/orxonox/infos/HumanPlayer.h
===================================================================
--- code/trunk/src/orxonox/infos/HumanPlayer.h	(revision 5781)
+++ code/trunk/src/orxonox/infos/HumanPlayer.h	(revision 5781)
@@ -0,0 +1,106 @@
+/*
+ *   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 _HumanPlayer_H__
+#define _HumanPlayer_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "PlayerInfo.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HumanPlayer : public PlayerInfo
+    {
+        public:
+            HumanPlayer(BaseObject* creator);
+            virtual ~HumanPlayer();
+
+            void registerVariables();
+            void setConfigValues();
+
+            bool isInitialized() const;
+            float getPing() const;
+            float getPacketLossRatio() const;
+
+            void setClientID(unsigned int clientID);
+
+            virtual void changedGametype();
+
+            inline void setHumanHUDTemplate(const std::string& name)
+            {
+                if (name != this->humanHudTemplate_)
+                {
+                    this->humanHudTemplate_ = name;
+                    this->updateHumanHUD();
+                }
+            }
+            inline const std::string& getHumanHUDTemplate() const
+                { return this->humanHudTemplate_; }
+            inline OverlayGroup* getHumanHUD() const
+                { return this->humanHud_; }
+
+            inline void setGametypeHUDTemplate(const std::string& name)
+            {
+                if (name != this->gametypeHudTemplate_)
+                {
+                    this->gametypeHudTemplate_ = name;
+                    this->updateGametypeHUD();
+                }
+            }
+            inline const std::string& getGametypeHUDTemplate() const
+                { return this->gametypeHudTemplate_; }
+            inline OverlayGroup* getGametypeHUD() const
+                { return this->gametypeHud_; }
+
+        protected:
+            void configvaluecallback_changednick();
+            void configvaluecallback_changedHUDTemplate();
+            void networkcallback_changednick();
+            void networkcallback_clientIDchanged();
+            void networkcallback_server_initialized();
+            void networkcallback_client_initialized();
+
+            void updateHumanHUD();
+            void updateGametypeHUD();
+
+            std::string nick_;
+            std::string synchronize_nick_;
+            std::string hudtemplate_;
+            bool server_initialized_;
+            bool client_initialized_;
+
+            std::string humanHudTemplate_;
+            OverlayGroup* humanHud_;
+            std::string gametypeHudTemplate_;
+            OverlayGroup* gametypeHud_;
+    };
+}
+
+#endif /* _HumanPlayer_H__ */
Index: code/trunk/src/orxonox/infos/Info.cc
===================================================================
--- code/trunk/src/orxonox/infos/Info.cc	(revision 5781)
+++ code/trunk/src/orxonox/infos/Info.cc	(revision 5781)
@@ -0,0 +1,38 @@
+/*
+ *   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 "Info.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    Info::Info(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
+    {
+        RegisterObject(Info);
+    }
+}
Index: code/trunk/src/orxonox/infos/Info.h
===================================================================
--- code/trunk/src/orxonox/infos/Info.h	(revision 5781)
+++ code/trunk/src/orxonox/infos/Info.h	(revision 5781)
@@ -0,0 +1,47 @@
+/*
+ *   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 _Info_H__
+#define _Info_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "network/synchronisable/Synchronisable.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Info : public BaseObject, public Synchronisable
+    {
+        public:
+            Info(BaseObject* creator);
+            virtual ~Info() {}
+    };
+}
+
+#endif /* _Info_H__ */
Index: code/trunk/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/PlayerInfo.cc	(revision 5781)
+++ code/trunk/src/orxonox/infos/PlayerInfo.cc	(revision 5781)
@@ -0,0 +1,207 @@
+/*
+ *   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 <cassert>
+
+#include "PlayerInfo.h"
+
+#include "core/CoreIncludes.h"
+#include "network/ClientInformation.h"
+#include "gametypes/Gametype.h"
+#include "worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    PlayerInfo::PlayerInfo(BaseObject* creator) : Info(creator)
+    {
+        RegisterObject(PlayerInfo);
+
+        this->clientID_ = CLIENTID_UNKNOWN;
+        this->bHumanPlayer_ = false;
+        this->bLocalPlayer_ = false;
+        this->bReadyToSpawn_ = false;
+        this->bSetUnreadyAfterSpawn_ = true;
+        this->controller_ = 0;
+        this->controllableEntity_ = 0;
+        this->controllableEntityID_ = CLIENTID_UNKNOWN;
+
+        this->gtinfo_ = 0;
+        this->gtinfoID_ = OBJECTID_UNKNOWN;
+        this->updateGametypeInfo();
+
+        this->registerVariables();
+    }
+
+    PlayerInfo::~PlayerInfo()
+    {
+        if (this->BaseObject::isInitialized())
+        {
+            this->stopControl();
+
+            if (this->controller_)
+            {
+                delete this->controller_;
+                this->controller_ = 0;
+            }
+
+            if (this->getGametype())
+                this->getGametype()->playerLeft(this);
+        }
+    }
+
+    void PlayerInfo::registerVariables()
+    {
+        registerVariable(this->name_,                 VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
+        registerVariable(this->controllableEntityID_, VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
+        registerVariable(this->bReadyToSpawn_,        VariableDirection::ToServer);
+        registerVariable(this->gtinfoID_,             VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedgtinfoID));
+    }
+
+    void PlayerInfo::changedName()
+    {
+        SUPER(PlayerInfo, changedName);
+
+        if (this->isInitialized() && this->getGametype())
+            this->getGametype()->playerChangedName(this);
+    }
+
+    void PlayerInfo::changedGametype()
+    {
+        this->updateGametypeInfo();
+
+        if (this->isInitialized())
+        {
+            if (this->getOldGametype())
+            {
+                if (this->getGametype())
+                    this->getOldGametype()->playerSwitched(this, this->getGametype());
+                else
+                    this->getOldGametype()->playerLeft(this);
+            }
+
+            if (this->getGametype())
+            {
+                if (this->getOldGametype())
+                    this->getGametype()->playerSwitchedBack(this, this->getOldGametype());
+                else
+                    this->getGametype()->playerEntered(this);
+            }
+        }
+    }
+
+    void PlayerInfo::updateGametypeInfo()
+    {
+        this->gtinfo_ = 0;
+        this->gtinfoID_ = OBJECTID_UNKNOWN;
+
+        if (this->getGametype() && this->getGametype()->getGametypeInfo())
+        {
+            this->gtinfo_ = this->getGametype()->getGametypeInfo();
+            this->gtinfoID_ = this->gtinfo_->getObjectID();
+        }
+    }
+
+    void PlayerInfo::createController()
+    {
+        if (this->controller_)
+        {
+            delete this->controller_;
+            this->controller_ = 0;
+        }
+        this->controller_ = this->defaultController_.fabricate(this);
+        assert(this->controller_);
+        this->controller_->setPlayer(this);
+        if (this->controllableEntity_)
+            this->controller_->setControllableEntity(this->controllableEntity_);
+        this->changedController();
+    }
+
+    void PlayerInfo::startControl(ControllableEntity* entity)
+    {
+        if (!entity || entity == this->controllableEntity_)
+            return;
+
+        if (this->controllableEntity_)
+            this->stopControl();
+
+        this->controllableEntity_ = entity;
+        this->controllableEntityID_ = entity->getObjectID();
+
+        entity->setPlayer(this);
+
+        this->bReadyToSpawn_ &= (!this->bSetUnreadyAfterSpawn_);
+
+        if (this->controller_)
+            this->controller_->setControllableEntity(entity);
+
+        this->changedControllableEntity();
+    }
+
+    void PlayerInfo::stopControl()
+    {
+        ControllableEntity* entity = this->controllableEntity_;
+
+        if (!entity)
+            return;
+
+        this->controllableEntity_ = 0;
+        this->controllableEntityID_ = OBJECTID_UNKNOWN;
+
+        if (this->controller_)
+            this->controller_->setControllableEntity(0);
+
+        entity->removePlayer();
+
+        this->changedControllableEntity();
+    }
+
+    void PlayerInfo::networkcallback_changedcontrollableentityID()
+    {
+        if (this->controllableEntityID_ != OBJECTID_UNKNOWN)
+        {
+            Synchronisable* temp = Synchronisable::getSynchronisable(this->controllableEntityID_);
+            ControllableEntity* entity = orxonox_cast<ControllableEntity*>(temp);
+            this->startControl(entity);
+        }
+        else
+        {
+            this->stopControl();
+        }
+    }
+
+    void PlayerInfo::networkcallback_changedgtinfoID()
+    {
+        if (this->gtinfoID_ != OBJECTID_UNKNOWN)
+        {
+            this->gtinfo_ = orxonox_cast<GametypeInfo*>(Synchronisable::getSynchronisable(this->gtinfoID_));
+
+            if (!this->gtinfo_)
+                this->gtinfoID_ = OBJECTID_UNKNOWN;
+        }
+    }
+}
Index: code/trunk/src/orxonox/infos/PlayerInfo.h
===================================================================
--- code/trunk/src/orxonox/infos/PlayerInfo.h	(revision 5781)
+++ code/trunk/src/orxonox/infos/PlayerInfo.h	(revision 5781)
@@ -0,0 +1,106 @@
+/*
+ *   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 _PlayerInfo_H__
+#define _PlayerInfo_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "Info.h"
+#include "core/Identifier.h"
+#include "controllers/Controller.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PlayerInfo : public Info
+    {
+        public:
+            PlayerInfo(BaseObject* creator);
+            virtual ~PlayerInfo();
+
+            void registerVariables();
+
+            virtual void changedName();
+            virtual void changedGametype();
+
+            virtual void changedController() {}
+            virtual void changedControllableEntity() {}
+
+            inline bool isHumanPlayer() const
+                { return this->bHumanPlayer_; }
+            inline bool isLocalPlayer() const
+                { return this->bLocalPlayer_; }
+            inline unsigned int getClientID() const
+                { return this->clientID_; }
+
+            virtual bool isInitialized() const = 0;
+            virtual float getPing() const = 0;
+            virtual float getPacketLossRatio() const = 0;
+
+            inline void setReadyToSpawn(bool bReady)
+                { this->bReadyToSpawn_ = bReady; }
+            inline bool isReadyToSpawn() const
+                { return this->bReadyToSpawn_; }
+
+            void startControl(ControllableEntity* entity);
+            void stopControl();
+
+            inline ControllableEntity* getControllableEntity() const
+                { return this->controllableEntity_; }
+
+            inline Controller* getController() const
+                { return this->controller_; }
+
+            inline const GametypeInfo* getGametypeInfo() const
+                { return this->gtinfo_; }
+
+        protected:
+            void createController();
+
+            bool bHumanPlayer_;
+            bool bLocalPlayer_;
+            bool bSetUnreadyAfterSpawn_;
+            SubclassIdentifier<Controller> defaultController_;
+            unsigned int clientID_;
+
+        private:
+            void networkcallback_changedcontrollableentityID();
+            void networkcallback_changedgtinfoID();
+            void updateGametypeInfo();
+
+            bool bReadyToSpawn_;
+            Controller* controller_;
+            ControllableEntity* controllableEntity_;
+            unsigned int controllableEntityID_;
+
+            const GametypeInfo* gtinfo_;
+            unsigned int gtinfoID_;
+    };
+}
+
+#endif /* _PlayerInfo_H__ */
Index: code/trunk/src/orxonox/interfaces/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/interfaces/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,4 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  InterfaceCompilation.cc
+  RadarViewable.cc
+)
Index: code/trunk/src/orxonox/interfaces/GametypeMessageListener.h
===================================================================
--- code/trunk/src/orxonox/interfaces/GametypeMessageListener.h	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/GametypeMessageListener.h	(revision 5781)
@@ -0,0 +1,49 @@
+/*
+ *   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 _GametypeMessageListener_H__
+#define _GametypeMessageListener_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport GametypeMessageListener : virtual public OrxonoxClass
+    {
+        public:
+            GametypeMessageListener();
+            virtual ~GametypeMessageListener() {}
+
+            virtual void announcemessage(const GametypeInfo* gtinfo, const std::string& message) {}
+            virtual void killmessage(const GametypeInfo* gtinfo, const std::string& message) {}
+            virtual void deathmessage(const GametypeInfo* gtinfo, const std::string& message) {}
+    };
+}
+
+#endif /* _GametypeMessageListener_H__ */
Index: code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc	(revision 5781)
@@ -0,0 +1,108 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Compiles all the interfaces in the orxonox library with mostly just a constructor.
+*/
+
+#include "GametypeMessageListener.h"
+#include "PawnListener.h"
+#include "PlayerTrigger.h"
+#include "RadarListener.h"
+#include "Rewardable.h"
+#include "TeamColourable.h"
+#include "NotificationListener.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    //----------------------------
+    // GametypeMessageListener
+    //----------------------------
+    GametypeMessageListener::GametypeMessageListener()
+    {
+        RegisterRootObject(GametypeMessageListener);
+    }
+
+    //----------------------------
+    // PawnListener
+    //----------------------------
+    /**
+        @brief Constructor for the PawnListener.
+    */
+    PawnListener::PawnListener()
+    {
+        RegisterRootObject(PawnListener);
+    }
+
+    //----------------------------
+    // RadarListener
+    //----------------------------
+    RadarListener::RadarListener()
+    {
+        RegisterRootObject(RadarListener);
+    }
+
+    //----------------------------
+    // TeamColourable
+    //----------------------------
+    TeamColourable::TeamColourable()
+    {
+        RegisterRootObject(TeamColourable);
+    }
+
+    //----------------------------
+    // Rewardable
+    //----------------------------
+    Rewardable::Rewardable()
+    {
+        RegisterRootObject(Rewardable);
+    }
+
+    //----------------------------
+    // NotificationListener
+    //----------------------------
+    NotificationListener::NotificationListener()
+    {
+        RegisterRootObject(NotificationListener);
+    }
+
+    //----------------------------
+    // PlayerTrigger
+    //----------------------------
+    PlayerTrigger::PlayerTrigger()
+    {
+        RegisterRootObject(PlayerTrigger);
+
+        this->player_ = NULL;
+        this->isForPlayer_ = true;
+    }
+}
Index: code/trunk/src/orxonox/interfaces/NotificationListener.h
===================================================================
--- code/trunk/src/orxonox/interfaces/NotificationListener.h	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/NotificationListener.h	(revision 5781)
@@ -0,0 +1,59 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the NotificationListener class.
+*/
+
+#ifndef _NotificationListener_H__
+#define _NotificationListener_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <ctime>
+#include <set>
+#include <string>
+
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport NotificationListener : virtual public OrxonoxClass
+    {
+        public:
+            NotificationListener();
+            virtual ~NotificationListener() {}
+
+            virtual const std::set<std::string> & getTargetsSet() = 0;
+            virtual void update(void) = 0;
+            virtual void update(Notification* notification, const std::time_t & time) = 0;
+    };
+}
+
+#endif /* _NotificationListener_H__ */
Index: code/trunk/src/orxonox/interfaces/PawnListener.h
===================================================================
--- code/trunk/src/orxonox/interfaces/PawnListener.h	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/PawnListener.h	(revision 5781)
@@ -0,0 +1,47 @@
+/*
+ *   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 _PawnListener_H__
+#define _PawnListener_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PawnListener : virtual public OrxonoxClass
+    {
+        public:
+            PawnListener();
+            virtual ~PawnListener() {}
+
+            virtual void destroyedPawn(Pawn* pawn) = 0;
+    };
+}
+
+#endif /* _PawnListener_H__ */
Index: code/trunk/src/orxonox/interfaces/PlayerTrigger.h
===================================================================
--- code/trunk/src/orxonox/interfaces/PlayerTrigger.h	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/PlayerTrigger.h	(revision 5781)
@@ -0,0 +1,92 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief
+    Definition of the PlayerTrigger class.
+*/
+
+#ifndef _PlayerTrigger_H__
+#define _PlayerTrigger_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        A PlayerTrigger is a trigger which is normally triggered by ControllableEntities and can as such return a pointer to the ControllableEntity which triggered it.
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _OrxonoxExport PlayerTrigger : virtual public OrxonoxClass
+    {
+    public:
+        PlayerTrigger();
+        virtual ~PlayerTrigger() {}
+
+        /**
+        @brief Returns the player that triggered the PlayerTrigger.
+        @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger.
+        */
+        inline Pawn* getTriggeringPlayer(void) const
+            { return this->player_; }
+
+        /**
+        @brief Checks whether the PlayerTrigger normally returns a ControllableEntity.
+        @return Returns true if the PlayerTrigger normally returns a ControllableEntity.
+        */
+        inline bool isForPlayer(void) const
+           { return this->isForPlayer_; }
+
+    protected:
+        /**
+        @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.
+        @param player A pointer to the ControllableEntity that triggered the PlayerTrigger.
+        */
+        inline void setTriggeringPlayer(Pawn* player)
+           { this->player_ = player; }
+
+            /**
+            @brief Set whether the PlayerTrigger normally is triggered by ControllableEntities.
+            @param isForPlayer Should be true when the PlayerTrigger should be set to normally be triggered by ControllableEntities, false if not.
+            */
+        inline void setForPlayer(bool isForPlayer)
+           { this->isForPlayer_ = isForPlayer; }
+
+    private:
+        Pawn* player_; //!< The player that triggered the PlayerTrigger.
+        bool isForPlayer_; //!< Is true when the PlayerTrigger should be set to normally be triggered by ControllableEntities.
+
+    };
+
+}
+
+#endif /* _PlayerTrigger_H__ */
Index: code/trunk/src/orxonox/interfaces/RadarListener.h
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarListener.h	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/RadarListener.h	(revision 5781)
@@ -0,0 +1,49 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _RadarListener_H__
+#define _RadarListener_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport RadarListener : virtual public OrxonoxClass
+    {
+    public:
+        RadarListener();
+        virtual ~RadarListener() { }
+
+        virtual void displayObject(RadarViewable* viewable, bool bIsMarked) = 0;
+        virtual float getRadarSensitivity() const = 0;
+        virtual void radarTick(float dt) = 0;
+    };
+}
+
+#endif /* _RadarListener_H__ */
Index: code/trunk/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.cc	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.cc	(revision 5781)
@@ -0,0 +1,169 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "RadarViewable.h"
+
+#include <OgreSceneManager.h>
+#include <OgreSceneNode.h>
+#include <OgreEntity.h>
+
+#include "util/StringUtils.h"
+#include "core/CoreIncludes.h"
+#include "tools/DynamicLines.h"
+#include "worldentities/WorldEntity.h"
+#include "Radar.h"
+#include "overlays/Map.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor.
+    */
+    RadarViewable::RadarViewable()
+        : MapNode_(NULL)
+        , MapEntity_(NULL)
+        , line_(NULL)
+        , LineNode_(NULL)
+        , radarObjectCamouflage_(0.0f)
+        , radarObjectShape_(Dot)
+        , radarObjectDescription_("staticObject")
+    {
+        RegisterRootObject(RadarViewable);
+
+        this->bVisibility_ = true;
+        this->isHumanShip_ = false;
+
+        this->uniqueId_=getUniqueNumberString();
+/*
+        if(Map::getSingletonPtr() && Map::getSingletonPtr()->getMapSceneManagerPtr())
+        {
+            this->addEntity();
+        }
+
+        */
+    }
+
+
+    RadarViewable::~RadarViewable()
+    {
+        if (this->isHumanShip_ && MapNode_)
+            MapNode_->removeAllChildren();
+
+        if (MapNode_)
+            delete MapNode_;
+
+        if (MapEntity_)
+            delete MapEntity_;
+
+        if (line_)
+            delete line_;
+
+        if (LineNode_)
+            delete LineNode_;
+    }
+
+    void RadarViewable::addMapEntity()
+    { //TODO Check shape and add accordantly
+        if( this->MapNode_ && !this->MapEntity_ && Map::getSingletonPtr() && Map::getSingletonPtr()->getMapSceneManagerPtr() )
+        {
+            COUT(0) << "Adding " << this->uniqueId_ << " to Map.\n";
+            this->MapEntity_ = Map::getSingletonPtr()->getMapSceneManagerPtr()->createEntity( this->uniqueId_, "drone.mesh");
+            /*this->line_ =  Map::getSingletonPtr()->getMapSceneManagerPtr()->createManualObject(this->uniqueId_ + "_l");
+            this->line_->begin("Map/line_", Ogre::RenderOperation::OT_LINE_STRIP);
+            //line_->position(0, -it->getRVWorldPosition().y, 0);
+            //this->line_->position(0, -20, 0);
+            this->line_->position(0, 0, -10); //Front Arrow
+            this->line_->position(0, 0, 0);
+
+            this->line_->end(); */
+            this->line_ = new Ogre::DynamicLines(Ogre::RenderOperation::OT_LINE_LIST);
+            this->line_->addPoint( Vector3(0,0,0) );
+            this->line_->addPoint( Vector3(0,0,0) );
+
+            this->MapNode_->attachObject( this->MapEntity_ );
+
+            this->LineNode_ = this->MapNode_->createChildSceneNode();
+            this->LineNode_->attachObject( this->line_ );
+        }
+        else
+        {
+            COUT(0) << "Unable to load " << this->uniqueId_ << " to Map.\n";
+        }
+    }
+
+    void RadarViewable::updateMapPosition()
+    {
+        if( this->MapNode_ )
+        {
+            this->MapNode_->setPosition( this->getRVWorldPosition() );
+            this->MapNode_->translate( this->getRVOrientedVelocity(), static_cast<Ogre::Node::TransformSpace>(3) );
+            this->MapNode_->setOrientation( this->getWorldEntity()->getOrientation() );
+//Vector3 v = this->getRVWorldPosition();
+            //this->line_->setPoint(1, Vector3(0,v.y,0) );
+            this->line_->setPoint(1, Vector3( 0, static_cast<float>(static_cast<int>( -Map::getSingletonPtr()->movablePlane_->getDistance( this->getRVWorldPosition() ) ) ) ,0 ));
+            this->line_->update();
+            if( Map::getSingletonPtr()->playerShipNode_ )
+                this->LineNode_->setDirection( Map::getSingletonPtr()->playerShipNode_->getLocalAxes().GetColumn(1) ,Ogre::Node::TS_WORLD,Vector3::UNIT_Y);
+        }
+    }
+
+    void RadarViewable::setRadarObjectDescription(const std::string& str)
+    {
+        Radar* radar = Radar::getInstancePtr();
+        if (radar)
+            this->radarObjectShape_ = radar->addObjectDescription(str);
+        else
+        {
+            CCOUT(2) << "Attempting to access the radar, but the radar is non existent." << std::endl;
+        }
+        this->radarObjectDescription_ = str;
+    }
+
+    const Vector3& RadarViewable::getRVWorldPosition() const
+    {
+        const WorldEntity* object = this->getWorldEntity();
+        validate(object);
+        return object->getWorldPosition();
+    }
+
+    Vector3 RadarViewable::getRVOrientedVelocity() const
+    {
+        const WorldEntity* object = this->getWorldEntity();
+        validate(object);
+        return object->getWorldOrientation() * object->getVelocity();
+    }
+
+    void RadarViewable::validate(const WorldEntity* object) const
+    {
+        if (!object)
+        {
+            COUT(1) << "Assertation: Every RadarViewable has to be assigned a WorldEntity pointer!" << std::endl;
+            assert(0);
+        }
+    }
+}
Index: code/trunk/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.h	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.h	(revision 5781)
@@ -0,0 +1,130 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _RadarViewable_H__
+#define _RadarViewable_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include <cassert>
+
+#include "util/Math.h"
+#include "util/OgreForwardRefs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    /**
+    @brief Interface for receiving window events.
+    */
+    class _OrxonoxExport RadarViewable : virtual public OrxonoxClass
+    {
+    public:
+        enum Shape
+        {
+            Square,
+            Dot,
+            Triangle
+        };
+
+
+    public:
+        RadarViewable();
+        virtual ~RadarViewable();
+
+        inline void setRadarObjectCamouflage(float camouflage)
+            { this->radarObjectCamouflage_ = camouflage; }
+        inline float getRadarObjectCamouflage() const
+            { return this->radarObjectCamouflage_; }
+
+        inline void setRadarObjectColour(const ColourValue& colour)
+            { this->radarObjectColour_ = colour; }
+        inline const ColourValue& getRadarObjectColour() const
+            { return this->radarObjectColour_; }
+
+        void setRadarObjectDescription(const std::string& str);
+        inline const std::string& getRadarObjectDescription() const
+            { return this->radarObjectDescription_; }
+
+        inline void setRadarVisibility(bool b)
+            { this->bVisibility_ = b; }
+        inline bool getRadarVisibility() const
+            { return this->bVisibility_; }
+
+        virtual const WorldEntity* getWorldEntity() const = 0;
+
+        const Vector3& getRVWorldPosition() const;
+        Vector3 getRVOrientedVelocity() const;
+
+        inline void setRadarObjectShape(Shape shape)
+            { this->radarObjectShape_ = shape; }
+        inline Shape getRadarObjectShape() const
+            { return this->radarObjectShape_; }
+
+/*
+        inline void setMapNode(Ogre::SceneNode * node)
+            { this->MapNode_ = node; }
+        inline Ogre::SceneNode * getMapNode() const
+            { return this->MapNode_; }
+        inline void setMapEntity(Ogre::Entity * ent)
+            { this->MapEntity_ = ent; }
+        inline Ogre::Entity * getMapEntity() const
+            { return this->MapEntity_; }
+*/
+        //Used for Map
+        Ogre::SceneNode * MapNode_;
+        Ogre::Entity * MapEntity_;
+        Ogre::DynamicLines* line_;
+        Ogre::SceneNode * LineNode_;
+        void addMapEntity();
+        void updateMapPosition();
+        bool isHumanShip_;
+        inline const std::string& getUniqueId()
+        {
+            return this->uniqueId_;
+        }
+        //friend class Map;
+
+    private:
+        void validate(const WorldEntity* object) const;
+        bool bVisibility_;
+        //Map
+        std::string uniqueId_;
+
+
+        //Radar
+        float radarObjectCamouflage_;
+        Shape radarObjectShape_;
+        std::string radarObjectDescription_;
+        ColourValue radarObjectColour_;
+
+    };
+}
+
+#endif /* _RadarViewable_H__ */
Index: code/trunk/src/orxonox/interfaces/Rewardable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/Rewardable.h	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/Rewardable.h	(revision 5781)
@@ -0,0 +1,70 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the Rewardable class.
+*/
+
+#ifndef _Rewardable_H__
+#define _Rewardable_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        Rewardable is an Interface, that can be implemented by any object to enable it to be given as reward to a player through QuestEffects. (With the AddReward effect.)
+        
+        It just needs to inherit form Rewardable, and implement the reward() method.
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _OrxonoxExport Rewardable : public OrxonoxClass
+    {
+        public:
+            Rewardable();
+            virtual ~Rewardable() {}
+
+            /**
+            @brief
+                Method to transcribe a rewardable object to the player.
+                Must be implemented by every class inheriting from Rewardable.
+            @param player
+                A pointer to the ControllableEntity, do whatever you want with it.
+            @return
+                Return true if successful.
+            */
+            virtual bool reward(PlayerInfo* player) = 0;
+
+    };
+}
+
+#endif /* _Rewardable_H__ */
Index: code/trunk/src/orxonox/interfaces/TeamColourable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/TeamColourable.h	(revision 5781)
+++ code/trunk/src/orxonox/interfaces/TeamColourable.h	(revision 5781)
@@ -0,0 +1,49 @@
+/*
+ *   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 _TeamColourable_H__
+#define _TeamColourable_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/UtilPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TeamColourable : virtual public OrxonoxClass
+    {
+        public:
+            virtual void setTeamColour(const ColourValue& colour) = 0;
+
+        protected:
+            TeamColourable();
+    };
+}
+
+#endif /* _TeamColourable_H__ */
Index: code/trunk/src/orxonox/items/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/items/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/items/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,5 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  Item.cc
+  Engine.cc
+  MultiStateEngine.cc
+)
Index: code/trunk/src/orxonox/items/Engine.cc
===================================================================
--- code/trunk/src/orxonox/items/Engine.cc	(revision 5781)
+++ code/trunk/src/orxonox/items/Engine.cc	(revision 5781)
@@ -0,0 +1,270 @@
+/*
+ *   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 "Engine.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/XMLPort.h"
+#include "Scene.h"
+#include "worldentities/pawns/SpaceShip.h"
+#include "pickup/ModifierType.h"
+#include "tools/Shader.h"
+#include "sound/SoundBase.h"
+
+namespace orxonox
+{
+    CreateFactory(Engine);
+
+    Engine::Engine(BaseObject* creator) : Item(creator)
+    {
+        RegisterObject(Engine);
+
+        this->ship_ = 0;
+        this->shipID_ = OBJECTID_UNKNOWN;
+
+        this->boostFactor_ = 1.5;
+        this->speedFactor_ = 1.0;
+
+        this->maxSpeedFront_ = 0.0;
+        this->maxSpeedBack_ = 0.0;
+        this->maxSpeedLeftRight_ = 0.0;
+        this->maxSpeedUpDown_ = 0.0;
+
+        this->accelerationFront_ = 0.0;
+        this->accelerationBrake_ = 0.0;
+        this->accelerationBack_ = 0.0;
+        this->accelerationLeftRight_ = 0.0;
+        this->accelerationUpDown_ = 0.0;
+
+        this->boostBlur_ = 0;
+
+        this->setConfigValues();
+        this->registerVariables();
+
+        this->sound_ = NULL;
+    }
+
+    Engine::~Engine()
+    {
+        if (this->isInitialized() && this->ship_)
+        {
+            this->ship_->setEngine(0);
+
+            if (this->boostBlur_)
+                delete this->boostBlur_;
+
+            if(this->sound_ != NULL)
+                delete this->sound_;
+        }
+    }
+
+    void Engine::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Engine, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Engine, "boostfactor", setBoostFactor, getBoostFactor, xmlelement, mode);
+
+        XMLPortParam(Engine, "speedfront",     setMaxSpeedFront,     setMaxSpeedFront,     xmlelement, mode);
+        XMLPortParam(Engine, "speedback",      setMaxSpeedBack,      setMaxSpeedBack,      xmlelement, mode);
+        XMLPortParam(Engine, "speedleftright", setMaxSpeedLeftRight, setMaxSpeedLeftRight, xmlelement, mode);
+        XMLPortParam(Engine, "speedupdown",    setMaxSpeedUpDown,    setMaxSpeedUpDown,    xmlelement, mode);
+
+        XMLPortParam(Engine, "accelerationfront",     setAccelerationFront,     setAccelerationFront,     xmlelement, mode);
+        XMLPortParam(Engine, "accelerationbrake",     setAccelerationBrake,     setAccelerationBrake,     xmlelement, mode);
+        XMLPortParam(Engine, "accelerationback",      setAccelerationBack,      setAccelerationBack,      xmlelement, mode);
+        XMLPortParam(Engine, "accelerationleftright", setAccelerationLeftRight, setAccelerationLeftRight, xmlelement, mode);
+        XMLPortParam(Engine, "accelerationupdown",    setAccelerationUpDown,    setAccelerationUpDown,    xmlelement, mode);
+
+        XMLPortParamLoadOnly(Engine, "sound", loadSound, xmlelement, mode);
+    }
+
+    void Engine::setConfigValues()
+    {
+        SetConfigValue(blurStrength_, 3.0f);
+    }
+
+    void Engine::registerVariables()
+    {
+        registerVariable(this->shipID_, VariableDirection::ToClient, new NetworkCallback<Engine>(this, &Engine::networkcallback_shipID));
+
+        registerVariable(this->speedFactor_, VariableDirection::ToClient);
+        registerVariable(this->boostFactor_, VariableDirection::ToClient);
+
+        registerVariable(this->maxSpeedFront_,     VariableDirection::ToClient);
+        registerVariable(this->maxSpeedBack_,      VariableDirection::ToClient);
+        registerVariable(this->maxSpeedLeftRight_, VariableDirection::ToClient);
+        registerVariable(this->maxSpeedUpDown_,    VariableDirection::ToClient);
+
+        registerVariable(this->accelerationFront_,     VariableDirection::ToClient);
+        registerVariable(this->accelerationBrake_,     VariableDirection::ToClient);
+        registerVariable(this->accelerationBack_,      VariableDirection::ToClient);
+        registerVariable(this->accelerationLeftRight_, VariableDirection::ToClient);
+        registerVariable(this->accelerationUpDown_,    VariableDirection::ToClient);
+    }
+
+    void Engine::networkcallback_shipID()
+    {
+        this->ship_ = 0;
+
+        if (this->shipID_ != OBJECTID_UNKNOWN)
+        {
+            Synchronisable* object = Synchronisable::getSynchronisable(this->shipID_);
+            if (object)
+                this->addToSpaceShip(orxonox_cast<SpaceShip*>(object));
+        }
+    }
+
+    void Engine::tick(float dt)
+    {
+        if (!this->ship_)
+        {
+            if (this->shipID_)
+            {
+                this->networkcallback_shipID();
+
+                if (!this->ship_)
+                    return;
+            }
+            else
+                return;
+        }
+
+        if (!this->isActive())
+            return;
+
+        SUPER(Engine, tick, dt);
+
+        const Vector3& direction = this->getDirection();
+        Vector3 velocity = this->ship_->getLocalVelocity();
+        Vector3 acceleration = Vector3::ZERO;
+
+        float factor = 1.0f / this->speedFactor_;
+        velocity *= factor;
+
+        if (direction.z < 0)
+        {
+            if (this->maxSpeedFront_ != 0)
+            {
+                float boostfactor = (this->ship_->getBoost() ? this->boostFactor_ : 1.0f);
+                acceleration.z = direction.z * this->accelerationFront_ * boostfactor * clamp((this->maxSpeedFront_ - -velocity.z/boostfactor) / this->maxSpeedFront_, 0.0f, 1.0f);
+            }
+        }
+        else if (direction.z > 0)
+        {
+            if (velocity.z < 0)
+                acceleration.z = direction.z * this->accelerationBrake_;
+            else if (this->maxSpeedBack_ != 0)
+                acceleration.z = direction.z * this->accelerationBack_ * clamp((this->maxSpeedBack_ - velocity.z) / this->maxSpeedBack_, 0.0f, 1.0f);
+        }
+
+        if (this->maxSpeedLeftRight_ != 0)
+        {
+            if (direction.x < 0)
+                acceleration.x = direction.x * this->accelerationLeftRight_ * clamp((this->maxSpeedLeftRight_ - -velocity.x) / this->maxSpeedLeftRight_, 0.0f, 1.0f);
+            else if (direction.x > 0)
+                acceleration.x = direction.x * this->accelerationLeftRight_ * clamp((this->maxSpeedLeftRight_ - velocity.x) / this->maxSpeedLeftRight_, 0.0f, 1.0f);
+        }
+
+        if (this->maxSpeedUpDown_ != 0)
+        {
+            if (direction.y < 0)
+                acceleration.y = direction.y * this->accelerationUpDown_ * clamp((this->maxSpeedUpDown_ - -velocity.y) / this->maxSpeedUpDown_, 0.0f, 1.0f);
+            else if (direction.y > 0)
+                acceleration.y = direction.y * this->accelerationUpDown_ * clamp((this->maxSpeedUpDown_ - velocity.y) / this->maxSpeedUpDown_, 0.0f, 1.0f);
+        }
+
+        this->ship_->setAcceleration(this->ship_->getPickups().processModifiers(ModifierType::Acceleration, this->ship_->getOrientation() * acceleration, false));
+
+        if (!this->ship_->getPermanentBoost())
+            this->ship_->setBoost(false);
+        this->ship_->setSteeringDirection(Vector3::ZERO);
+
+        if (!this->boostBlur_ && this->ship_->hasLocalController() && this->ship_->hasHumanController())
+        {
+            this->boostBlur_ = new Shader(this->ship_->getScene()->getSceneManager());
+            this->boostBlur_->setCompositor("Radial Blur");
+        }
+
+        if (this->boostBlur_ && this->maxSpeedFront_ != 0 && this->boostFactor_ != 1)
+            this->boostBlur_->setParameter("Ogre/Compositor/Radial_Blur", 0, 0, "sampleStrength", this->blurStrength_ * clamp((-velocity.z - this->maxSpeedFront_) / ((this->boostFactor_ - 1) * this->maxSpeedFront_), 0.0f, 1.0f));
+    }
+
+    void Engine::changedActivity()
+    {
+        SUPER(Engine, changedActivity);
+
+        if (this->boostBlur_)
+            this->boostBlur_->setVisible(this->isVisible());
+    }
+
+    void Engine::addToSpaceShip(SpaceShip* ship)
+    {
+        this->ship_ = ship;
+
+        if (ship)
+        {
+            this->shipID_ = ship->getObjectID();
+            if (ship->getEngine() != this)
+                ship->setEngine(this);
+
+            if (this->boostBlur_)
+            {
+                delete this->boostBlur_;
+                this->boostBlur_ = 0;
+            }
+
+            if(this->sound_ != NULL)
+                this->sound_->attachToEntity(ship);
+        }
+    }
+
+    const Vector3& Engine::getDirection() const
+    {
+        if (this->ship_)
+            return this->ship_->getSteeringDirection();
+        else
+            return Vector3::ZERO;
+    }
+
+    void Engine::loadSound(const std::string filename)
+    {
+        if(filename == "") return;
+        else
+        {
+            if(this->sound_ == NULL)
+            {
+                this->sound_ = new SoundBase(this->ship_);
+            }
+
+            this->sound_->loadFile(filename);
+            this->sound_->play(true);
+        }
+    }
+}
Index: code/trunk/src/orxonox/items/Engine.h
===================================================================
--- code/trunk/src/orxonox/items/Engine.h	(revision 5781)
+++ code/trunk/src/orxonox/items/Engine.h	(revision 5781)
@@ -0,0 +1,137 @@
+/*
+ *   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 _Engine_H__
+#define _Engine_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "Item.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Engine : public Item, public Tickable
+    {
+        public:
+            Engine(BaseObject* creator);
+            virtual ~Engine();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+            void setConfigValues();
+
+            virtual void tick(float dt);
+            virtual void changedActivity();
+
+            virtual void addToSpaceShip(SpaceShip* ship);
+            inline SpaceShip* getShip() const
+                { return this->ship_; }
+
+            inline void setBoostFactor(float factor)
+                { this->boostFactor_ = factor; }
+            inline float getBoostFactor() const
+                { return this->boostFactor_; }
+
+            inline void setSpeedFactor(float factor)
+                { this->speedFactor_ = factor; }
+            inline float getSpeedFactor() const
+                { return this->speedFactor_; }
+
+            inline void setMaxSpeedFront(float speed)
+                { this->maxSpeedFront_ = speed; }
+            inline void setMaxSpeedBack(float speed)
+                { this->maxSpeedBack_ = speed; }
+            inline void setMaxSpeedLeftRight(float speed)
+                { this->maxSpeedLeftRight_ = speed; }
+            inline void setMaxSpeedUpDown(float speed)
+                { this->maxSpeedUpDown_ = speed; }
+
+            inline float getMaxSpeedFront() const
+                { return this->maxSpeedFront_; }
+            inline float getMaxSpeedBack() const
+                { return this->maxSpeedBack_; }
+            inline float getMaxSpeedLeftRight() const
+                { return this->maxSpeedLeftRight_; }
+            inline float getMaxSpeedUpDown() const
+                { return this->maxSpeedUpDown_; }
+
+            inline void setAccelerationFront(float acceleration)
+                { this->accelerationFront_ = acceleration; }
+            inline void setAccelerationBrake(float acceleration)
+                { this->accelerationBrake_ = acceleration; }
+            inline void setAccelerationBack(float acceleration)
+                { this->accelerationBack_ = acceleration; }
+            inline void setAccelerationLeftRight(float acceleration)
+                { this->accelerationLeftRight_ = acceleration; }
+            inline void setAccelerationUpDown(float acceleration)
+                { this->accelerationUpDown_ = acceleration; }
+
+            inline float getAccelerationFront() const
+                { return this->accelerationFront_; }
+            inline float getAccelerationBrake() const
+                { return this->accelerationBrake_; }
+            inline float getAccelerationBack() const
+                { return this->accelerationBack_; }
+            inline float getAccelerationLeftRight() const
+                { return this->accelerationLeftRight_; }
+            inline float getAccelerationUpDown() const
+                { return this->accelerationUpDown_; }
+
+            virtual const Vector3& getDirection() const;
+
+            void loadSound(const std::string filename);
+
+        private:
+            void networkcallback_shipID();
+
+            SpaceShip* ship_;
+            unsigned int shipID_;
+
+            float boostFactor_;
+            float speedFactor_;
+
+            float maxSpeedFront_;
+            float maxSpeedBack_;
+            float maxSpeedLeftRight_;
+            float maxSpeedUpDown_;
+
+            float accelerationFront_;
+            float accelerationBrake_;
+            float accelerationBack_;
+            float accelerationLeftRight_;
+            float accelerationUpDown_;
+
+            Shader* boostBlur_;
+            float blurStrength_;
+
+            SoundBase* sound_;
+    };
+}
+
+#endif /* _Engine_H__ */
Index: code/trunk/src/orxonox/items/Item.cc
===================================================================
--- code/trunk/src/orxonox/items/Item.cc	(revision 5781)
+++ code/trunk/src/orxonox/items/Item.cc	(revision 5781)
@@ -0,0 +1,38 @@
+/*
+ *   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 "Item.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    Item::Item(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
+    {
+        RegisterObject(Item);
+    }
+}
Index: code/trunk/src/orxonox/items/Item.h
===================================================================
--- code/trunk/src/orxonox/items/Item.h	(revision 5781)
+++ code/trunk/src/orxonox/items/Item.h	(revision 5781)
@@ -0,0 +1,47 @@
+/*
+ *   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 _Item_H__
+#define _Item_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/BaseObject.h"
+#include "network/synchronisable/Synchronisable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Item : public BaseObject, public Synchronisable
+    {
+        public:
+            Item(BaseObject* creator);
+            virtual ~Item() {}
+    };
+}
+
+#endif /* _Item_H__ */
Index: code/trunk/src/orxonox/items/MultiStateEngine.cc
===================================================================
--- code/trunk/src/orxonox/items/MultiStateEngine.cc	(revision 5781)
+++ code/trunk/src/orxonox/items/MultiStateEngine.cc	(revision 5781)
@@ -0,0 +1,232 @@
+/*
+ *   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 "MultiStateEngine.h"
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+    static const float FORWARD_EFFECT_VELOCITY_THRESHOLD = 20;
+
+    static const unsigned char STATE_ACTIVE  = 1;
+    static const unsigned char STATE_FORWARD = 2;
+    static const unsigned char STATE_BOOST   = 4;
+    static const unsigned char STATE_BRAKE   = 8;
+
+    CreateFactory(MultiStateEngine);
+
+    MultiStateEngine::MultiStateEngine(BaseObject* creator) : Engine(creator)
+    {
+        RegisterObject(MultiStateEngine);
+
+        this->state_ = 0;
+
+        this->registerVariables();
+    }
+
+    MultiStateEngine::~MultiStateEngine()
+    {
+        if (this->isInitialized() && !this->getShip())
+        {
+            // We have no ship, so the effects are not attached and won't be destroyed automatically
+            for (std::list<WorldEntity*>::const_iterator it = this->activeEffects_.begin(); it != this->activeEffects_.end(); ++it)
+                delete (*it);
+            for (std::list<WorldEntity*>::const_iterator it = this->forwardEffects_.begin(); it != this->forwardEffects_.end(); ++it)
+                delete (*it);
+            for (std::list<WorldEntity*>::const_iterator it = this->boostEffects_.begin(); it != this->boostEffects_.end(); ++it)
+                delete (*it);
+            for (std::list<WorldEntity*>::const_iterator it = this->brakeEffects_.begin(); it != this->brakeEffects_.end(); ++it)
+                delete (*it);
+        }
+    }
+
+    void MultiStateEngine::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(MultiStateEngine, XMLPort, xmlelement, mode);
+
+        XMLPortObject(MultiStateEngine, WorldEntity, "active",  addActiveEffect,  getActiveEffect,  xmlelement, mode);
+        XMLPortObject(MultiStateEngine, WorldEntity, "forward", addForwardEffect, getForwardEffect, xmlelement, mode);
+        XMLPortObject(MultiStateEngine, WorldEntity, "boost",   addBoostEffect,   getBoostEffect,   xmlelement, mode);
+        XMLPortObject(MultiStateEngine, WorldEntity, "brake",   addBrakeEffect,   getBrakeEffect,   xmlelement, mode);
+    }
+
+    void MultiStateEngine::registerVariables()
+    {
+        registerVariable(this->state_, VariableDirection::ToServer);
+    }
+
+    void MultiStateEngine::tick(float dt)
+    {
+        if (this->getShip())
+        {
+            if (this->getShip()->hasLocalController())
+            {
+                this->setObjectMode(ObjectDirection::Bidirectional);
+
+                const Vector3& direction = this->getDirection();
+                const Vector3& velocity = this->getShip()->getLocalVelocity();
+
+                bool forward = (direction.z < 0 && velocity.z < -FORWARD_EFFECT_VELOCITY_THRESHOLD);
+                bool boost = (this->getShip()->getBoost() && forward);
+                bool brake = (direction.z > 0 && velocity.z < 0);
+                bool active = (direction != Vector3::ZERO && !brake);
+
+                if (active)
+                    this->state_ |= STATE_ACTIVE;
+                else
+                    this->state_ &= ~STATE_ACTIVE;
+
+                if (forward)
+                    this->state_ |= STATE_FORWARD;
+                else
+                    this->state_ &= ~STATE_FORWARD;
+
+                if (boost)
+                    this->state_ |= STATE_BOOST;
+                else
+                    this->state_ &= ~STATE_BOOST;
+
+                if (brake)
+                    this->state_ |= STATE_BRAKE;
+                else
+                    this->state_ &= ~STATE_BRAKE;
+            }
+
+            if (GameMode::isMaster())
+            {
+                for (std::list<WorldEntity*>::const_iterator it = this->activeEffects_.begin(); it != this->activeEffects_.end(); ++it)
+                    (*it)->setMainState(this->state_ & STATE_ACTIVE);
+                for (std::list<WorldEntity*>::const_iterator it = this->forwardEffects_.begin(); it != this->forwardEffects_.end(); ++it)
+                    (*it)->setMainState(this->state_ & STATE_FORWARD);
+                for (std::list<WorldEntity*>::const_iterator it = this->boostEffects_.begin(); it != this->boostEffects_.end(); ++it)
+                    (*it)->setMainState(this->state_ & STATE_BOOST);
+                for (std::list<WorldEntity*>::const_iterator it = this->brakeEffects_.begin(); it != this->brakeEffects_.end(); ++it)
+                    (*it)->setMainState(this->state_ & STATE_BRAKE);
+            }
+        }
+
+        SUPER(MultiStateEngine, tick, dt);
+    }
+
+    void MultiStateEngine::addToSpaceShip(SpaceShip* ship)
+    {
+        Engine::addToSpaceShip(ship);
+
+        if (!ship)
+            return;
+
+        for (std::list<WorldEntity*>::const_iterator it = this->activeEffects_.begin(); it != this->activeEffects_.end(); ++it)
+            ship->attach(*it);
+        for (std::list<WorldEntity*>::const_iterator it = this->forwardEffects_.begin(); it != this->forwardEffects_.end(); ++it)
+            ship->attach(*it);
+        for (std::list<WorldEntity*>::const_iterator it = this->boostEffects_.begin(); it != this->boostEffects_.end(); ++it)
+            ship->attach(*it);
+        for (std::list<WorldEntity*>::const_iterator it = this->brakeEffects_.begin(); it != this->brakeEffects_.end(); ++it)
+            ship->attach(*it);
+    }
+
+    void MultiStateEngine::addActiveEffect(WorldEntity* effect)
+    {
+        this->activeEffects_.push_back(effect);
+        if (this->getShip())
+            this->getShip()->attach(effect);
+    }
+
+    void MultiStateEngine::addForwardEffect(WorldEntity* effect)
+    {
+        this->forwardEffects_.push_back(effect);
+        if (this->getShip())
+            this->getShip()->attach(effect);
+    }
+
+    void MultiStateEngine::addBoostEffect(WorldEntity* effect)
+    {
+        this->boostEffects_.push_back(effect);
+        if (this->getShip())
+            this->getShip()->attach(effect);
+    }
+
+    void MultiStateEngine::addBrakeEffect(WorldEntity* effect)
+    {
+        this->brakeEffects_.push_back(effect);
+        if (this->getShip())
+            this->getShip()->attach(effect);
+    }
+
+    WorldEntity* MultiStateEngine::getActiveEffect(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<WorldEntity*>::const_iterator it = this->activeEffects_.begin(); it != this->activeEffects_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+
+    WorldEntity* MultiStateEngine::getForwardEffect(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<WorldEntity*>::const_iterator it = this->forwardEffects_.begin(); it != this->forwardEffects_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+
+    WorldEntity* MultiStateEngine::getBoostEffect(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<WorldEntity*>::const_iterator it = this->boostEffects_.begin(); it != this->boostEffects_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+
+    WorldEntity* MultiStateEngine::getBrakeEffect(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<WorldEntity*>::const_iterator it = this->brakeEffects_.begin(); it != this->brakeEffects_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+}
Index: code/trunk/src/orxonox/items/MultiStateEngine.h
===================================================================
--- code/trunk/src/orxonox/items/MultiStateEngine.h	(revision 5781)
+++ code/trunk/src/orxonox/items/MultiStateEngine.h	(revision 5781)
@@ -0,0 +1,71 @@
+/*
+ *   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 _MultiStateEngine_H__
+#define _MultiStateEngine_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <list>
+#include "Engine.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport MultiStateEngine : public Engine
+    {
+        public:
+            MultiStateEngine(BaseObject* creator);
+            virtual ~MultiStateEngine();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void tick(float dt);
+
+            virtual void addToSpaceShip(SpaceShip* ship);
+
+            void addActiveEffect(WorldEntity* effect);
+            void addForwardEffect(WorldEntity* effect);
+            void addBoostEffect(WorldEntity* effect);
+            void addBrakeEffect(WorldEntity* effect);
+
+            WorldEntity* getActiveEffect(unsigned int index) const;
+            WorldEntity* getForwardEffect(unsigned int index) const;
+            WorldEntity* getBoostEffect(unsigned int index) const;
+            WorldEntity* getBrakeEffect(unsigned int index) const;
+
+        private:
+            unsigned char state_;
+            std::list<WorldEntity*> activeEffects_;
+            std::list<WorldEntity*> forwardEffects_;
+            std::list<WorldEntity*> boostEffects_;
+            std::list<WorldEntity*> brakeEffects_;
+    };
+}
+
+#endif /* _MultiStateEngine_H__ */
Index: code/trunk/src/orxonox/overlays/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/overlays/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/overlays/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,7 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  OrxonoxOverlay.cc
+  OverlayGroup.cc
+
+  InGameConsole.cc
+  Map.cc
+)
Index: code/trunk/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/trunk/src/orxonox/overlays/InGameConsole.cc	(revision 5781)
+++ code/trunk/src/orxonox/overlays/InGameConsole.cc	(revision 5781)
@@ -0,0 +1,606 @@
+/*
+ *   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:
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+
+
+#include "InGameConsole.h"
+
+#include <algorithm>
+#include <string>
+#include <OgreOverlay.h>
+#include <OgreOverlayElement.h>
+#include <OgreOverlayManager.h>
+#include <OgreOverlayContainer.h>
+#include <OgreBorderPanelOverlayElement.h>
+#include <OgreTextAreaOverlayElement.h>
+#include <OgreFontManager.h>
+#include <OgreFont.h>
+
+#include "util/Math.h"
+#include "util/Convert.h"
+#include "util/UTFStringConversions.h"
+#include "core/Clock.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "core/input/InputManager.h"
+#include "core/input/InputState.h"
+#include "core/input/InputBuffer.h"
+
+namespace orxonox
+{
+    const int LINES = 30;
+    const float CHAR_WIDTH = 7.45f; // fix this please - determine the char-width dynamically
+
+    SetConsoleCommand(InGameConsole, openConsole, true);
+    SetConsoleCommand(InGameConsole, closeConsole, true);
+
+    InGameConsole* InGameConsole::singletonPtr_s = 0;
+
+    /**
+        @brief Constructor: Creates and initializes the InGameConsole.
+    */
+    InGameConsole::InGameConsole()
+        : consoleOverlay_(0)
+        , consoleOverlayContainer_(0)
+        , consoleOverlayNoise_(0)
+        , consoleOverlayCursor_(0)
+        , consoleOverlayBorder_(0)
+        , consoleOverlayTextAreas_(0)
+        , inputState_(0)
+    {
+        RegisterObject(InGameConsole);
+
+        this->bActive_ = false;
+        this->cursor_ = 0.0f;
+        this->cursorSymbol_ = '|';
+        this->inputWindowStart_ = 0;
+        this->numLinesShifted_ = LINES - 1;
+        // for the beginning, don't scroll
+        this->scroll_ = 0;
+
+        this->setConfigValues();
+    }
+
+    /**
+        @brief Destructor: Destroys the TextAreas.
+    */
+    InGameConsole::~InGameConsole()
+    {
+        this->deactivate();
+
+        // destroy the input state previously created (InputBuffer gets destroyed by the Shell)
+        InputManager::getInstance().destroyState("console");
+
+        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
+        if (ovMan)
+        {
+            if (this->consoleOverlayNoise_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayNoise_);
+            if (this->consoleOverlayCursor_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayCursor_);
+            Ogre::FontManager::getSingleton().remove("MonofurConsole");
+            if (this->consoleOverlayBorder_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayBorder_);
+            if (this->consoleOverlayTextAreas_)
+            {
+                for (int i = 0; i < LINES; i++)
+                {
+                    if (this->consoleOverlayTextAreas_[i])
+                      Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayTextAreas_[i]);
+                    this->consoleOverlayTextAreas_[i] = 0;
+                }
+
+            }
+            if (this->consoleOverlayContainer_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayContainer_);
+        }
+        if (this->consoleOverlayTextAreas_)
+        {
+            delete[] this->consoleOverlayTextAreas_;
+            this->consoleOverlayTextAreas_ = 0;
+        }
+
+        if (this->consoleOverlay_)
+            Ogre::OverlayManager::getSingleton().destroy(consoleOverlay_);
+    }
+
+    /**
+        @brief Sets the config values, describing the size of the console.
+    */
+    void InGameConsole::setConfigValues()
+    {
+        SetConfigValue(relativeWidth, 0.8);
+        SetConfigValue(relativeHeight, 0.4);
+        SetConfigValue(blinkTime, 0.5);
+        SetConfigValue(scrollSpeed_, 3.0f);
+        SetConfigValue(noiseSize_, 1.0f);
+        SetConfigValue(cursorSymbol_, '|');
+        SetConfigValue(bHidesAllInput_, false).callback(this, &InGameConsole::bHidesAllInputChanged);
+    }
+
+    /**
+        @brief Called whenever bHidesAllInput_ changes.
+    */
+    void InGameConsole::bHidesAllInputChanged()
+    {
+        if (inputState_)
+        {
+            if (bHidesAllInput_)
+            {
+                inputState_->setMouseHandler(&InputHandler::EMPTY);
+                inputState_->setJoyStickHandler(&InputHandler::EMPTY);
+            }
+            else
+            {
+                inputState_->setMouseHandler(0);
+                inputState_->setJoyStickHandler(0);
+            }
+        }
+    }
+
+    /**
+        @brief Initializes the InGameConsole.
+    */
+    void InGameConsole::initialise()
+    {
+        // create the corresponding input state
+        inputState_ = InputManager::getInstance().createInputState("console", false, false, InputStatePriority::Console);
+        inputState_->setKeyHandler(Shell::getInstance().getInputBuffer());
+        bHidesAllInputChanged();
+
+        // create overlay and elements
+        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
+
+        // create actual overlay
+        this->consoleOverlay_ = ovMan->create("InGameConsoleConsole");
+
+        // create a container
+        this->consoleOverlayContainer_ = static_cast<Ogre::OverlayContainer*>(ovMan->createOverlayElement("Panel", "InGameConsoleContainer"));
+        this->consoleOverlayContainer_->setMetricsMode(Ogre::GMM_RELATIVE);
+        this->consoleOverlayContainer_->setPosition((1 - this->relativeWidth) / 2, 0);
+        this->consoleOverlayContainer_->setDimensions(this->relativeWidth, this->relativeHeight);
+        this->consoleOverlay_->add2D(this->consoleOverlayContainer_);
+
+        // create BorderPanel
+        this->consoleOverlayBorder_ = static_cast<Ogre::BorderPanelOverlayElement*>(ovMan->createOverlayElement("BorderPanel", "InGameConsoleBorderPanel"));
+        this->consoleOverlayBorder_->setMetricsMode(Ogre::GMM_PIXELS);
+        this->consoleOverlayBorder_->setMaterialName("ConsoleCenter");
+        this->consoleOverlayBorder_->setBorderSize(16, 16, 0, 16);
+        this->consoleOverlayBorder_->setBorderMaterialName("ConsoleBorder");
+        this->consoleOverlayBorder_->setLeftBorderUV(0.0, 0.49, 0.5, 0.51);
+        this->consoleOverlayBorder_->setRightBorderUV(0.5, 0.49, 1.0, 0.5);
+        this->consoleOverlayBorder_->setBottomBorderUV(0.49, 0.5, 0.51, 1.0);
+        this->consoleOverlayBorder_->setBottomLeftBorderUV(0.0, 0.5, 0.5, 1.0);
+        this->consoleOverlayBorder_->setBottomRightBorderUV(0.5, 0.5, 1.0, 1.0);
+        this->consoleOverlayContainer_->addChild(this->consoleOverlayBorder_);
+
+        // create a new font to match the requested size exactly
+        Ogre::FontPtr font = static_cast<Ogre::FontPtr>
+            (Ogre::FontManager::getSingleton().create("MonofurConsole", "General"));
+        font->setType(Ogre::FT_TRUETYPE);
+        font->setSource("Monofur.ttf");
+        font->setTrueTypeSize(18);
+        // reto: I don't know why, but setting the resolution twice as high makes the font look a lot clearer
+        font->setTrueTypeResolution(192);
+        font->addCodePointRange(Ogre::Font::CodePointRange(33, 126));
+        font->addCodePointRange(Ogre::Font::CodePointRange(161, 255));
+
+        // create the text lines
+        this->consoleOverlayTextAreas_ = new Ogre::TextAreaOverlayElement*[LINES];
+        for (int i = 0; i < LINES; i++)
+        {
+            this->consoleOverlayTextAreas_[i] = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleTextArea" + multi_cast<std::string>(i)));
+            this->consoleOverlayTextAreas_[i]->setMetricsMode(Ogre::GMM_PIXELS);
+            this->consoleOverlayTextAreas_[i]->setFontName("MonofurConsole");
+            this->consoleOverlayTextAreas_[i]->setCharHeight(18);
+            this->consoleOverlayTextAreas_[i]->setParameter("colour_top", "0.21 0.69 0.21");
+            this->consoleOverlayTextAreas_[i]->setLeft(8);
+            this->consoleOverlayTextAreas_[i]->setCaption("");
+            this->consoleOverlayContainer_->addChild(this->consoleOverlayTextAreas_[i]);
+        }
+
+        // create cursor (also a text area overlay element)
+        this->consoleOverlayCursor_ = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleCursor"));
+        this->consoleOverlayCursor_->setMetricsMode(Ogre::GMM_PIXELS);
+        this->consoleOverlayCursor_->setFontName("MonofurConsole");
+        this->consoleOverlayCursor_->setCharHeight(18);
+        this->consoleOverlayCursor_->setParameter("colour_top", "0.21 0.69 0.21");
+        this->consoleOverlayCursor_->setLeft(7);
+        this->consoleOverlayCursor_->setCaption(std::string(this->cursorSymbol_, 1));
+        this->consoleOverlayContainer_->addChild(this->consoleOverlayCursor_);
+
+        // create noise
+        this->consoleOverlayNoise_ = static_cast<Ogre::PanelOverlayElement*>(ovMan->createOverlayElement("Panel", "InGameConsoleNoise"));
+        this->consoleOverlayNoise_->setMetricsMode(Ogre::GMM_PIXELS);
+        this->consoleOverlayNoise_->setPosition(5,0);
+        this->consoleOverlayNoise_->setMaterialName("ConsoleNoiseSmall");
+        // comment following line to disable noise
+        this->consoleOverlayContainer_->addChild(this->consoleOverlayNoise_);
+
+        this->windowResized(this->getWindowWidth(), this->getWindowWidth());
+
+        // move overlay "above" the top edge of the screen
+        // we take -1.2 because the border makes the panel bigger
+        this->consoleOverlayContainer_->setTop(-1.2 * this->relativeHeight);
+
+        Shell::getInstance().addOutputLevel(true);
+
+        COUT(4) << "Info: InGameConsole initialized" << std::endl;
+    }
+
+    // ###############################
+    // ###  ShellListener methods  ###
+    // ###############################
+
+    /**
+        @brief Called if all output-lines have to be redrawn.
+    */
+    void InGameConsole::linesChanged()
+    {
+        std::list<std::string>::const_iterator it = Shell::getInstance().getNewestLineIterator();
+        int max = 0;
+        for (int i = 1; i < LINES; ++i)
+        {
+            if (it != Shell::getInstance().getEndIterator())
+            {
+                ++it;
+                max = i;
+            }
+            else
+                break;
+        }
+
+        for (int i = LINES - 1; i > max; --i)
+            this->print("", i, true);
+
+        for (int i = max; i >= 1; --i)
+        {
+            --it;
+            this->print(*it, i, true);
+        }
+    }
+
+    /**
+        @brief Called if only the last output-line has changed.
+    */
+    void InGameConsole::onlyLastLineChanged()
+    {
+        if (LINES > 1)
+            this->print(*Shell::getInstance().getNewestLineIterator(), 1);
+    }
+
+    /**
+        @brief Called if a new output-line was added.
+    */
+    void InGameConsole::lineAdded()
+    {
+        this->numLinesShifted_ = 0;
+        this->shiftLines();
+        this->onlyLastLineChanged();
+    }
+
+    /**
+        @brief Called if the text in the input-line has changed.
+    */
+    void InGameConsole::inputChanged()
+    {
+        if (LINES > 0)
+            this->print(Shell::getInstance().getInput(), 0);
+
+        if (Shell::getInstance().getInput() == "" || Shell::getInstance().getInput().size() == 0)
+            this->inputWindowStart_ = 0;
+    }
+
+    /**
+        @brief Called if the position of the cursor in the input-line has changed.
+    */
+    void InGameConsole::cursorChanged()
+    {
+        unsigned int pos = Shell::getInstance().getCursorPosition() - inputWindowStart_;
+        if (pos > maxCharsPerLine_)
+            pos = maxCharsPerLine_;
+
+        this->consoleOverlayCursor_->setCaption(std::string(pos,' ') + cursorSymbol_);
+        this->consoleOverlayCursor_->setTop(static_cast<int>(this->windowH_ * this->relativeHeight) - 24);
+    }
+
+    /**
+        @brief Called if the console gets closed.
+    */
+    void InGameConsole::exit()
+    {
+        this->deactivate();
+    }
+
+    // ###############################
+    // ###  other external calls   ###
+    // ###############################
+
+    /**
+        @brief Used to control the actual scrolling and the cursor.
+    */
+    void InGameConsole::update(const Clock& time)
+    {
+        if (this->scroll_ != 0)
+        {
+            float oldTop = this->consoleOverlayContainer_->getTop();
+
+            if (this->scroll_ > 0)
+            {
+                // scrolling down
+                // enlarge oldTop a little bit so that this exponential function
+                // reaches 0 before infinite time has passed...
+                float deltaScroll = (oldTop - 0.01) * time.getDeltaTime() * this->scrollSpeed_;
+                if (oldTop - deltaScroll >= 0)
+                {
+                    // window has completely scrolled down
+                    this->consoleOverlayContainer_->setTop(0);
+                    this->scroll_ = 0;
+                }
+                else
+                    this->consoleOverlayContainer_->setTop(oldTop - deltaScroll);
+            }
+
+            else
+            {
+                // scrolling up
+                // note: +0.01 for the same reason as when scrolling down
+                float deltaScroll = (1.2 * this->relativeHeight + 0.01 + oldTop) * time.getDeltaTime() * this->scrollSpeed_;
+                if (oldTop - deltaScroll <= -1.2 * this->relativeHeight)
+                {
+                    // window has completely scrolled up
+                    this->consoleOverlayContainer_->setTop(-1.2 * this->relativeHeight);
+                    this->scroll_ = 0;
+                    this->consoleOverlay_->hide();
+                }
+                else
+                    this->consoleOverlayContainer_->setTop(oldTop - deltaScroll);
+            }
+        }
+
+        if (this->bActive_)
+        {
+            this->cursor_ += time.getDeltaTime();
+            if (this->cursor_ >= this->blinkTime)
+            {
+                this->cursor_ = 0;
+                bShowCursor_ = !bShowCursor_;
+                if (bShowCursor_)
+                    this->consoleOverlayCursor_->show();
+                else
+                    this->consoleOverlayCursor_->hide();
+            }
+
+            // this creates a flickering effect (extracts exactly 80% of the texture at a random location)
+            float uRand = (rand() & 1023) / 1023.0f * 0.2f;
+            float vRand = (rand() & 1023) / 1023.0f * 0.2f;
+            this->consoleOverlayNoise_->setUV(uRand, vRand, 0.8f + uRand, 0.8f + vRand);
+        }
+    }
+
+    /**
+        @brief Resizes the console elements. Call if window size changes.
+    */
+    void InGameConsole::windowResized(unsigned int newWidth, unsigned int newHeight)
+    {
+        this->windowW_ = newWidth;
+        this->windowH_ = newHeight;
+        this->consoleOverlayBorder_->setWidth(static_cast<int>(this->windowW_* this->relativeWidth));
+        this->consoleOverlayBorder_->setHeight(static_cast<int>(this->windowH_ * this->relativeHeight));
+        this->consoleOverlayNoise_->setWidth(static_cast<int>(this->windowW_ * this->relativeWidth) - 10);
+        this->consoleOverlayNoise_->setHeight(static_cast<int>(this->windowH_ * this->relativeHeight) - 5);
+        this->consoleOverlayNoise_->setTiling(consoleOverlayNoise_->getWidth() / (50.0f * this->noiseSize_), consoleOverlayNoise_->getHeight() / (50.0f * this->noiseSize_));
+
+        // now adjust the text lines...
+        this->desiredTextWidth_ = static_cast<int>(this->windowW_ * this->relativeWidth) - 12;
+
+        if (LINES > 0)
+            this->maxCharsPerLine_ = std::max(10U, static_cast<unsigned int>(static_cast<float>(this->desiredTextWidth_) / CHAR_WIDTH));
+        else
+            this->maxCharsPerLine_ = 10;
+
+        for (int i = 0; i < LINES; i++)
+        {
+            this->consoleOverlayTextAreas_[i]->setWidth(this->desiredTextWidth_);
+            this->consoleOverlayTextAreas_[i]->setTop(static_cast<int>(this->windowH_ * this->relativeHeight) - 24 - 14*i);
+        }
+
+        this->linesChanged();
+        this->cursorChanged();
+    }
+
+    // ###############################
+    // ###    internal methods     ###
+    // ###############################
+
+    /**
+        @brief Prints string to bottom line.
+        @param s String to be printed
+    */
+    void InGameConsole::print(const std::string& text, int index, bool alwaysShift)
+    {
+        char level = 0;
+        if (text.size() > 0)
+            level = text[0];
+
+        std::string output = text;
+
+        if (level >= -1 && level <= 5)
+            output.erase(0, 1);
+
+        if (LINES > index)
+        {
+            this->colourLine(level, index);
+
+            if (index > 0)
+            {
+                unsigned int linesUsed = 1;
+                while (output.size() > this->maxCharsPerLine_)
+                {
+                    ++linesUsed;
+                    this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output.substr(0, this->maxCharsPerLine_)));
+                    output.erase(0, this->maxCharsPerLine_);
+                    output.insert(0, 1, ' ');
+                    if (linesUsed > numLinesShifted_ || alwaysShift)
+                        this->shiftLines();
+                    this->colourLine(level, index);
+                }
+                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
+                this->displayedText_ = output;
+                this->numLinesShifted_ = linesUsed;
+            }
+            else
+            {
+                if (output.size() > this->maxCharsPerLine_)
+                {
+                    if (Shell::getInstance().getInputBuffer()->getCursorPosition() < this->inputWindowStart_)
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition();
+                    else if (Shell::getInstance().getInputBuffer()->getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition() - this->maxCharsPerLine_ + 1;
+
+                    output = output.substr(this->inputWindowStart_, this->maxCharsPerLine_);
+                }
+                else
+                  this->inputWindowStart_ = 0;
+                this->displayedText_ = output;
+                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
+            }
+        }
+    }
+
+    /**
+        @brief Shows the InGameConsole.
+    */
+    void InGameConsole::activate()
+    {
+        if (!this->bActive_)
+        {
+            this->bActive_ = true;
+            InputManager::getInstance().enterState("console");
+            Shell::getInstance().registerListener(this);
+
+            this->windowResized(this->windowW_, this->windowH_);
+            this->linesChanged();
+            this->cursorChanged();
+            this->consoleOverlay_->show();
+
+            // scroll down
+            this->scroll_ = 1;
+            // the rest is done by tick
+        }
+    }
+
+    /**
+    @brief Hides the InGameConsole.
+    */
+    void InGameConsole::deactivate()
+    {
+        if (this->bActive_)
+        {
+            this->bActive_ = false;
+            InputManager::getInstance().leaveState("console");
+            Shell::getInstance().unregisterListener(this);
+
+            // scroll up
+            this->scroll_ = -1;
+            // the rest is done by tick
+        }
+    }
+
+    /**
+        @brief Shifts all output lines one line up
+    */
+    void InGameConsole::shiftLines()
+    {
+        for (unsigned int i = LINES - 1; i > 1; --i)
+        {
+            this->consoleOverlayTextAreas_[i]->setCaption(this->consoleOverlayTextAreas_[i - 1]->getCaption());
+            this->consoleOverlayTextAreas_[i]->setColourTop(this->consoleOverlayTextAreas_[i - 1]->getColourTop());
+            this->consoleOverlayTextAreas_[i]->setColourBottom(this->consoleOverlayTextAreas_[i - 1]->getColourBottom());
+        }
+    }
+
+    void InGameConsole::colourLine(int colourcode, int index)
+    {
+        if (colourcode == -1)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.90, 0.90, 0.90, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 1.00, 1.00, 1.00));
+        }
+        else if (colourcode == 1)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.25, 0.25, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.50, 0.50, 1.00));
+        }
+        else if (colourcode == 2)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.50, 0.20, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.70, 0.50, 1.00));
+        }
+        else if (colourcode == 3)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.50, 0.50, 0.95, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.80, 1.00, 1.00));
+        }
+        else if (colourcode == 4)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.65, 0.48, 0.44, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.90, 0.90, 1.00));
+        }
+        else if (colourcode == 5)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.40, 0.20, 0.40, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.60, 0.80, 1.00));
+        }
+        else
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.21, 0.69, 0.21, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 1.00, 0.80, 1.00));
+        }
+    }
+
+    // ###############################
+    // ###      satic methods      ###
+    // ###############################
+
+    /**
+        @brief Activates the console.
+    */
+    /*static*/ void InGameConsole::openConsole()
+    {
+        InGameConsole::getInstance().activate();
+    }
+
+    /**
+        @brief Deactivates the console.
+    */
+    /*static*/ void InGameConsole::closeConsole()
+    {
+        InGameConsole::getInstance().deactivate();
+    }
+}
Index: code/trunk/src/orxonox/overlays/InGameConsole.h
===================================================================
--- code/trunk/src/orxonox/overlays/InGameConsole.h	(revision 5781)
+++ code/trunk/src/orxonox/overlays/InGameConsole.h	(revision 5781)
@@ -0,0 +1,118 @@
+/*
+ *   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:
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+
+#ifndef _InGameConsole_H__
+#define _InGameConsole_H__
+
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+
+#include "util/OgreForwardRefs.h"
+#include "util/Singleton.h"
+#include "core/Shell.h"
+#include "core/WindowEventListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener
+    {
+        friend class Singleton<InGameConsole>;
+    public: // functions
+        InGameConsole();
+        ~InGameConsole();
+
+        void initialise();
+        void destroy();
+        void setConfigValues();
+
+        void update(const Clock& time);
+
+        static void openConsole();
+        static void closeConsole();
+
+    private: // functions
+        InGameConsole(const InGameConsole& other);
+
+        void activate();
+        void deactivate();
+
+        void linesChanged();
+        void onlyLastLineChanged();
+        void lineAdded();
+        void inputChanged();
+        void cursorChanged();
+        void exit();
+
+        void shiftLines();
+        void colourLine(int colourcode, int index);
+        void setCursorPosition(unsigned int pos);
+        void print(const std::string& text, int index, bool alwaysShift = false);
+
+        void windowResized(unsigned int newWidth, unsigned int newHeight);
+
+        // config value related
+        void bHidesAllInputChanged();
+
+    private: // variables
+        bool bActive_;
+        int windowW_;
+        int windowH_;
+        int desiredTextWidth_;
+        unsigned int maxCharsPerLine_;
+        unsigned int numLinesShifted_;
+        int scroll_;
+        float cursor_;
+        unsigned int inputWindowStart_;
+        bool bShowCursor_;
+        std::string displayedText_;
+        Ogre::Overlay* consoleOverlay_;
+        Ogre::OverlayContainer* consoleOverlayContainer_;
+        Ogre::PanelOverlayElement* consoleOverlayNoise_;
+        Ogre::TextAreaOverlayElement* consoleOverlayCursor_;
+        Ogre::BorderPanelOverlayElement* consoleOverlayBorder_;
+        Ogre::TextAreaOverlayElement** consoleOverlayTextAreas_;
+
+        // input related
+        InputState* inputState_;
+
+        // config values
+        float relativeWidth;
+        float relativeHeight;
+        float blinkTime;
+        float scrollSpeed_;
+        float noiseSize_;
+        char cursorSymbol_;
+        bool bHidesAllInput_;
+
+        static InGameConsole* singletonPtr_s;
+    };
+}
+
+#endif /* _InGameConsole_H__ */
Index: code/trunk/src/orxonox/overlays/Map.cc
===================================================================
--- code/trunk/src/orxonox/overlays/Map.cc	(revision 5781)
+++ code/trunk/src/orxonox/overlays/Map.cc	(revision 5781)
@@ -0,0 +1,456 @@
+/*
+ *   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:
+ *      Si Sun
+ *
+ */
+
+#include "Map.h"
+
+#include <string>
+
+#include <OgreBorderPanelOverlayElement.h>
+#include <OgreCamera.h>
+#include <OgreEntity.h>
+#include <OgreHardwarePixelBuffer.h>
+#include <OgreMaterialManager.h>
+#include <OgreMovablePlane.h>
+#include <OgreOverlay.h>
+#include <OgreOverlayContainer.h>
+#include <OgreOverlayManager.h>
+#include <OgrePass.h>
+#include <OgreRenderTexture.h>
+#include <OgreResourceGroupManager.h>
+#include <OgreRoot.h>
+#include <OgreSceneManager.h>
+#include <OgreSceneNode.h>
+#include <OgreTechnique.h>
+#include <OgreTexture.h>
+#include <OgreTextureManager.h>
+#include <OgreViewport.h>
+
+#include "core/ConsoleCommand.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "interfaces/RadarViewable.h"
+#include "Scene.h"
+#include "controllers/HumanController.h"
+#include "worldentities/CameraPosition.h"
+#include "worldentities/ControllableEntity.h"
+
+ namespace orxonox
+ {
+    CreateFactory(Map);
+    SetConsoleCommand(Map, openMap, true);
+    //SetConsoleCommand(Map, rotateYaw, true).setAsInputCommand();
+    //SetConsoleCommand(Map, rotatePitch, true).setAsInputCommand();
+    SetConsoleCommand(Map, Zoom, true).setAsInputCommand();
+
+
+    Map* Map::singletonMap_s = 0;
+    Ogre::SceneManager* Map::mapSceneM_s = 0;
+    Ogre::Camera* Map::Cam_ = 0;
+    Ogre::SceneNode* Map::CamNode_ = 0;
+    Ogre::MaterialPtr Map::OverlayMaterial_;// = init();
+    Ogre::Overlay* Map::overlay_ = 0;
+/*
+Ogre::MaterialPtr Map::init()
+{
+    Ogre::MaterialPtr tmp;
+    tmp.setNull();
+    return tmp;
+}
+*/
+
+    //int Map::mouseLookSpeed_ = 200;
+    //Ogre::SceneNode* Map::playerShipNode_ = 0;
+
+    const int PITCH=-30;
+    const int DISTANCE=200;
+
+    Map::Map(BaseObject* creator) : OrxonoxOverlay(creator)
+    {
+        RegisterObject(Map);
+        Map::singletonMap_s=this;
+
+        //Getting Scene Manager (Hack)
+        if( !sManager_ )
+        {
+            ObjectList<Scene>::iterator it = ObjectList<Scene>::begin();
+            this->sManager_ = it->getSceneManager();
+        }
+        if( !Map::getMapSceneManager() )
+        {
+            Map::setMapSceneManager( Ogre::Root::getSingletonPtr()->createSceneManager( Ogre::ST_GENERIC,"MapScene" ) );
+        }
+
+        this->playerShipNode_ = 0;
+        //this->sNode_ = new Ogre::SceneNode(sManager_);
+        //oManager_ = Ogre::OverlayManager::getSingletonPtr();
+        //overlay_ = oManager_->create("Map");
+        //overlay_ is member of OrxonoxOverlay
+
+        //Not Showing the map as default
+        //this->isVisible_=false;
+        //overlay_->hide();
+        this->mouseLookSpeed_ = 200;
+
+        //TestEntity
+        //Ogre::Entity * ent = mapSceneM_s->createEntity("ent", "drone.mesh");
+
+        //Map::getMapSceneManager()->getRootSceneNode()->attachObject( ent );
+        /*sNode_->setPosition(0,0,-50);
+        overlay_->add3D(sNode_);
+        */
+
+
+
+
+
+        // Alter the camera aspect ratio to match the viewport
+        //mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+        if(!Map::Cam_)
+            Cam_ = Map::getMapSceneManager()->createCamera("ReflectCam");
+        //Cam_->setPosition(200,170, -160);
+        //Cam_->lookAt(0,0,0);
+        Cam_->setAspectRatio(1);
+        //Cam_->setRenderingDistance(0);
+        if(!Map::CamNode_)
+            CamNode_ = Map::getMapSceneManager()->getRootSceneNode()->createChildSceneNode();
+
+
+        //Create overlay material
+        if(Map::OverlayMaterial_.isNull())
+            Map::OverlayMaterial_ = this->createRenderCamera(Cam_, "RttMat");
+/*
+        Ogre::TexturePtr rttTex = Ogre::TextureManager::getSingleton().createManual("RttTex", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 512, 512, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET);
+
+        Ogre::RenderTexture *renderTexture = rttTex->getBuffer()->getRenderTarget();
+
+        renderTexture->addViewport(Cam_);
+        renderTexture->getViewport(0)->setClearEveryFrame(true);
+        renderTexture->getViewport(0)->setBackgroundColour(ColourValue::Black);
+        renderTexture->getViewport(0)->setOverlaysEnabled(false);
+
+        Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create("RttMat", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        Ogre::Technique *technique = material->createTechnique();
+        technique->createPass();
+        material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+        material->getTechnique(0)->getPass(0)->createTextureUnitState("RttTex");
+*/
+
+
+        // create overlay
+/*
+        Ogre::Overlay* pOverlay = Ogre::OverlayManager::getSingleton().create("Overlay1");
+
+        // Create a panel with RenderToTexture texture
+        Ogre::OverlayContainer* m_pOverlayPanel = static_cast<Ogre::OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel","OverlayPanelName%d"));
+        m_pOverlayPanel->setMetricsMode(Ogre::GMM_PIXELS);
+        m_pOverlayPanel->setPosition(10, 10);
+        m_pOverlayPanel->setDimensions(500, 300);
+        // Give overlay a texture
+        m_pOverlayPanel->setMaterialName(camMat_id);
+        pOverlay->add2D(m_pOverlayPanel);
+        pOverlay->show();
+*/
+        if(!this->overlay_)
+        {
+            this->overlay_ = Ogre::OverlayManager::getSingletonPtr()->create("MapOverlay");
+            Ogre::OverlayContainer* m_pOverlayPanel = static_cast<Ogre::OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel","OverlayPanelName%d"));
+            //m_pOverlayPanel->setMetricsMode(Ogre::GMM_PIXELS);
+            //m_pOverlayPanel->setPosition(10, 10);
+            //m_pOverlayPanel->setDimensions(600, 400);
+            m_pOverlayPanel->setPosition(0.01, 0.003);
+            m_pOverlayPanel->setDimensions(0.5, 0.4);
+            // Give overlay a texture
+            m_pOverlayPanel->setMaterialName("RttMat");
+            overlay_->add2D(m_pOverlayPanel);
+
+            //Add Borders
+            Ogre::BorderPanelOverlayElement* oBorder = static_cast<Ogre::BorderPanelOverlayElement*>(Ogre::OverlayManager::getSingletonPtr()->createOverlayElement("BorderPanel", "MapBorderPanel" + getUniqueNumberString()));
+            oBorder->setBorderSize( 0.003, 0.003 );
+            oBorder->setDimensions(0.5, 0.4);
+            oBorder->setBorderMaterialName("StatsBorder");
+            oBorder->setTopBorderUV(0.49, 0.0, 0.51, 0.5);
+            oBorder->setTopLeftBorderUV(0.0, 0.0, 0.5, 0.5);
+            oBorder->setTopRightBorderUV(0.5, 0.0, 1.0, 0.5);
+            oBorder->setLeftBorderUV(0.0, 0.49, 0.5, 0.51);
+            oBorder->setRightBorderUV(0.5, 0.49, 1.0, 0.5);
+            oBorder->setBottomBorderUV(0.49, 0.5, 0.51, 1.0);
+            oBorder->setBottomLeftBorderUV(0.0, 0.5, 0.5, 1.0);
+            oBorder->setBottomRightBorderUV(0.5, 0.5, 1.0, 1.0);
+            //overlay_->add2D(oBorder);
+            m_pOverlayPanel->addChild(oBorder);
+        }
+
+
+        //Not Showing the map as default
+        this->isVisible_=false;
+        overlay_->hide();
+
+        //Create plane to show gridTypeError: blimport() takes no keyword arguments
+/*        Ogre::Entity* plane_ent;
+        if(Map::getMapSceneManager()->hasEntity("MapPlane"))
+            plane_ent = Map::getMapSceneManager()->getEntity("MapPlane");
+        else
+            plane_ent = Map::getMapSceneManager()->createEntity( "MapPlane", "plane.mesh");
+*/
+        this->movablePlane_ = new Ogre::MovablePlane( Vector3::UNIT_Y, 0 );
+        this->movablePlane_->normalise();
+
+        if(!Map::getMapSceneManager()->hasEntity("MapPlane"))
+        {
+            Ogre::Entity* plane_ent = Map::getMapSceneManager()->createEntity( "MapPlane", "plane.mesh");
+            planeNode_ = Map::getMapSceneManager()->createSceneNode();
+        //Create plane for calculations
+
+
+        //Ogre::MaterialPtr plane_mat = Ogre::MaterialManager::getSingleton().create("mapgrid", "General");
+        //plane_mat->getTechnique(0)->getPass(0)->createTextureUnitState("mapgrid.tga");
+        //plane_ent->setMaterialName("mapgrid");
+            plane_ent->setMaterialName("Map/Grid");
+            planeNode_->attachObject(plane_ent);
+
+            planeNode_->scale(160,1,160);
+//        planeNode_->attachObject(movablePlane_);
+        //Ogre::Material plane_mat = Ogre::MaterialManager::getSingletonPtr()->getByName("rock");
+
+
+        //ToDo create material script
+            Ogre::MaterialPtr myManualObjectMaterial = Ogre::MaterialManager::getSingleton().create("Map/Line","General");
+            myManualObjectMaterial->setReceiveShadows(false);
+            myManualObjectMaterial->getTechnique(0)->setLightingEnabled(true);
+            myManualObjectMaterial->getTechnique(0)->getPass(0)->setDiffuse(1,1,0,0);
+            myManualObjectMaterial->getTechnique(0)->getPass(0)->setAmbient(1,1,0);
+            myManualObjectMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(1,1,0);
+        }
+    }
+
+    Map::~Map()
+    {
+        this->singletonMap_s = 0;
+        //delete this->overlay_;
+        /*if (this->isInitialized())
+        {
+        //delete sManager_;
+        //delete Map::getMapSceneManager()->getRootSceneNode();
+        //delete oManager_;
+        //delete CamNode_;
+        //delete Cam_;
+        //delete mapSceneM_s;
+        //Map::getMapSceneManager()->destroyAllEntities();
+        //Map::getMapSceneManager()->destroyAllCameras();
+        delete Map::getMapSceneManager();
+        }*/
+    }
+
+    Ogre::MaterialPtr Map::createRenderCamera(Ogre::Camera * cam, const std::string& matName)
+    {
+        Ogre::TexturePtr rttTex = Ogre::TextureManager::getSingleton().createManual(matName+"_tex", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 512, 512, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET);
+
+        Ogre::RenderTexture *renderTexture = rttTex->getBuffer()->getRenderTarget();
+
+        renderTexture->addViewport(cam);
+        renderTexture->getViewport(0)->setClearEveryFrame(true);
+        renderTexture->getViewport(0)->setBackgroundColour(ColourValue::Black);
+        renderTexture->getViewport(0)->setOverlaysEnabled(false);
+
+        Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create(matName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        Ogre::Technique *technique = material->createTechnique();
+        technique->createPass();
+        material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+        material->getTechnique(0)->getPass(0)->createTextureUnitState(matName+"_tex");
+        return material;
+    }
+
+    void Map::updatePositions()
+    {
+
+//Ogre::Entity * ent;// = mapSceneM_s->createEntity("ent1", "drone.mesh");
+       for(ObjectList<orxonox::RadarViewable>::iterator it = ObjectList<orxonox::RadarViewable>::begin();
+            it!=ObjectList<orxonox::RadarViewable>::end();
+            it++)
+        {
+            //COUT(0) << "Radar_Position: " << it->getRVWorldPosition() << std::endl;
+            //Ogre::SceneNode node = it->getMapNode();
+            //Ogre::Entity ent = it->getMapEntity();
+            if( !(it->MapNode_) )
+            {
+                it->MapNode_ = Map::getMapSceneManager()->getRootSceneNode()->createChildSceneNode( it->getRVWorldPosition() );
+                //it->MapNode_->translate( it->getRVOrientedVelocity(), Ogre::TS_WORLD );
+                /*if(it->getRadarObjectShape() == RadarViewable::Dot)
+                {
+                    //if( !(it->MapEntity_) )//check wether the entity is already attached
+                    //{
+                        //it->MapEntity_ = Map::getMapSceneManager()->createEntity( getUniqueNumberString(), "drone.mesh");
+                        //it->addEntity();
+                        //it->MapNode_->attachObject( it->MapEntity_ );
+                        //it->MapNode_->attachObject( it->line_ );
+                   // }
+                }*/
+                it->addMapEntity();
+            }
+            if(it->isHumanShip_)
+            {
+                this->movablePlane_->redefine(it->MapNode_->getLocalAxes().GetColumn(1) , it->MapNode_->getPosition());
+                if(it->isHumanShip_ && it->MapNode_ != this->playerShipNode_)
+                {
+                    this->playerShipNode_ = it->MapNode_;
+                    if(planeNode_ && this->planeNode_->getParent())
+                        this->planeNode_->getParent()->removeChild(this->planeNode_);
+                    this->playerShipNode_->addChild(this->planeNode_);
+                //Movable Plane needs to be attached direcly for calculations
+                //this->movablePlane_->detatchFromParent();
+                //this->movablePlane_->getParentSceneNode()->detachObject(this->movablePlane_);
+                //this->movablePlane_->redefine(it->MapNode_->getLocalAxes().GetColumn(1) , it->MapNode_->getPosition());
+                //it->MapNode_->attachObject(this->movablePlane_);
+                    if(planeNode_ && this->CamNode_->getParent())
+                        this->CamNode_->getParent()->removeChild(this->CamNode_);
+                    this->playerShipNode_->addChild(this->CamNode_);
+                    this->CamNode_->attachObject(this->Cam_);
+                //this->CamNodeHelper_ = this->CamNode_->createChildSceneNode();
+                //this->CamNodeHelper_->attachObject(this->Cam_);
+                    this->Cam_->setPosition(0, 0, DISTANCE);
+                    this->Cam_->pitch( static_cast<Degree>(PITCH) );
+                    this->Cam_->lookAt(this->playerShipNode_->getPosition());
+                //this->Cam_->setAutoTracking(true, this->playerShipNode_);
+                }
+            }
+            it->updateMapPosition();
+
+
+
+
+
+
+        }
+    }
+
+
+
+    void Map::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        SUPER(Map, XMLPort, xmlElement, mode);
+    }
+
+    void Map::changedOwner()
+    {
+        SUPER(Map, changedOwner);
+        //COUT(0) << "shipptr" << this->getOwner()->getReverseCamera() << std::endl;
+
+        ControllableEntity* entity = orxonox_cast<ControllableEntity*>(this->getOwner());
+        if(entity && entity->getReverseCamera())
+        {
+            //COUT(0) << "foo";
+            entity->getReverseCamera()->attachCamera(this->Cam_);
+        }
+    }
+
+
+    void Map::toggleVisibility()
+    {
+        if (!(this->isVisible_))
+        {
+            this->overlay_->show();
+            this->isVisible_=1;
+            //set mouselook when showing map
+            if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && !HumanController::localController_s->controllableEntity_->isInMouseLook())
+            HumanController::localController_s->controllableEntity_->mouseLook();
+        }
+        else
+        {
+            this->overlay_->hide();
+            this->isVisible_=0;
+            if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->isInMouseLook())
+            HumanController::localController_s->controllableEntity_->mouseLook();
+        }
+    }
+
+    //Static function to toggle visibility of the map
+    void Map::openMap()
+    {
+        for(ObjectList<orxonox::Map>::iterator it = ObjectList<orxonox::Map>::begin();
+            it!=ObjectList<orxonox::Map>::end();
+            it++)
+        {
+        //Map * m = it->getMap();
+        //COUT(0) << it->isVisible_ << std::endl;
+        it->toggleVisibility();
+        //it->updatePositions();
+        }
+    }
+
+    // HACK!
+    void Map::hackDestroyMap()
+    {
+        Map::OverlayMaterial_.setNull();
+    }
+
+    void Map::tick(float dt)
+    {
+        //Debug
+        //COUT(0) << "MovablePlane Position: " << this->movablePlane_->getParentSceneNode()->getName() << this->movablePlane_->getParentSceneNode()->getPosition() << std::endl;
+        //COUT(0) << "planeNode_ Position: " << this->planeNode_ ->getName() << this->planeNode_->getPosition() << std::endl;
+        //COUT(0) <<  "planeNode_ Parrent Position" << this->planeNode_->getParent()->getName() << this->planeNode_->getParent()->getPosition() << std::endl;
+        if( this->isVisible_ )
+            updatePositions();
+        //Cam_->roll(Degree(1));
+
+    }
+
+    void Map::rotateYaw(const Vector2& value)
+    {
+        if(!( Map::singletonMap_s && Map::singletonMap_s->CamNode_ ))
+            return;
+
+/*
+        singletonMap_s->CamNode_->setOrientation(singletonMap_s->CamNode_->getOrientation() * Quaternion( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_) , singletonMap_s->playerShipNode_->getLocalAxes().GetColumn(1) ));
+
+        Map::singletonMap_s->CamNodeHelper_->setDirection(Vector3::UNIT_Y, Ogre::Node::TS_PARENT, Vector3::UNIT_Y);
+        Map::singletonMap_s->CamNodeHelper_->lookAt(Vector3(0,0,0), Ogre::Node::TS_PARENT);
+*/
+        singletonMap_s->CamNode_->yaw( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_), Ogre::Node::TS_PARENT);
+    }
+
+    void Map::rotatePitch(const Vector2& value)
+    {
+        if(!( Map::singletonMap_s && Map::singletonMap_s->CamNode_ ))
+            return;
+            //singletonMap_s->Cam_->setOrientation(singletonMap_s->Cam_->getOrientation() * Quaternion( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_) , Vector3::UNIT_X));
+/*        singletonMap_s->CamNode_->setOrientation(singletonMap_s->CamNode_->getOrientation() * Quaternion( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_) , singletonMap_s->playerShipNode_->getLocalAxes().GetColumn(0) ));
+
+        Map::singletonMap_s->CamNodeHelper_->setDirection(Vector3::UNIT_Y, Ogre::Node::TS_PARENT, Vector3::UNIT_Y);
+        Map::singletonMap_s->CamNodeHelper_->lookAt(Vector3(0,0,0), Ogre::Node::TS_PARENT);
+*/
+        singletonMap_s->CamNode_->pitch( static_cast<Degree>(value.y * singletonMap_s->mouseLookSpeed_), Ogre::Node::TS_LOCAL);
+
+    }
+
+    void Map::Zoom(const Vector2& value)
+    {
+        if(!( Map::singletonMap_s && Map::singletonMap_s->CamNode_ ))
+            return;
+        //COUT(0) << value.y << std::endl;
+        Map::singletonMap_s->Cam_->setPosition(0,0, Map::singletonMap_s->Cam_->getPosition().z + value.y * Map::singletonMap_s->mouseLookSpeed_ );
+    }
+ }
Index: code/trunk/src/orxonox/overlays/Map.h
===================================================================
--- code/trunk/src/orxonox/overlays/Map.h	(revision 5781)
+++ code/trunk/src/orxonox/overlays/Map.h	(revision 5781)
@@ -0,0 +1,118 @@
+/*
+ *   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:
+ *      Si Sun
+ *
+ */
+
+#ifndef _Map_H__
+#define _Map_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <OgreMaterial.h>
+
+#include "util/UtilPrereqs.h"
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OrxonoxOverlay.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Map : public OrxonoxOverlay, public Tickable
+    {
+
+    public: // functions
+        Map(BaseObject* creator);
+        virtual ~Map();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+        virtual void tick(float dt);
+        virtual void changedOwner();
+
+        static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, const std::string& matName);
+
+        static void openMap();
+        // HACK!
+        static void hackDestroyMap();
+
+//Not yet implemented
+        static const int maxRange_s=1000;
+
+        static void rotateYaw(const Vector2& value);
+        static void rotatePitch(const Vector2& value);
+        static void Zoom(const Vector2& value);
+        // variables
+
+
+        bool inline getVisibility()
+            { return this->isVisible_; };
+
+        static inline Ogre::SceneManager* getMapSceneManagerPtr()
+        {
+            return Map::singletonMap_s->mapSceneM_s;
+        }
+        static inline Map* getSingletonPtr()
+        {
+            return Map::singletonMap_s;
+        }
+
+        static inline Ogre::SceneManager* getMapSceneManager()
+        {
+            return Map::mapSceneM_s;
+        }
+
+
+
+    private: // functions
+
+        void toggleVisibility();
+        void updatePositions();
+//        void changedPlayerNode();
+        static inline void setMapSceneManager( Ogre::SceneManager * sm)
+        {
+            Map::mapSceneM_s = sm;
+        }
+        //static Ogre::MaterialPtr init();
+
+    private: // variables
+        static Map* singletonMap_s;
+
+        Ogre::SceneManager* sManager_;
+        Ogre::OverlayManager * oManager_;
+
+        static Ogre::SceneManager* mapSceneM_s;
+        static Ogre::SceneNode* CamNode_;
+        static Ogre::Camera* Cam_;
+        static Ogre::MaterialPtr OverlayMaterial_;
+        static Ogre::Overlay* overlay_;
+        //Ogre::SceneNode* CamNodeHelper_;
+        Ogre::SceneNode* playerShipNode_;
+        Ogre::SceneNode* planeNode_;
+        Ogre::MovablePlane* movablePlane_;
+        int mouseLookSpeed_;
+        bool isVisible_;
+
+    friend class RadarViewable;
+    };
+}
+
+#endif /* _Map_H__ */
Index: code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 5781)
+++ code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 5781)
@@ -0,0 +1,356 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief Definition of the OrxonoxOverlay class.
+*/
+
+#include "OrxonoxOverlay.h"
+
+#include <cmath>
+#include <OgreOverlay.h>
+#include <OgreOverlayManager.h>
+#include <OgrePanelOverlayElement.h>
+#include <OgreRenderWindow.h>
+
+#include "util/Convert.h"
+#include "util/Exception.h"
+#include "util/StringUtils.h"
+#include "core/GameMode.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "core/ConsoleCommand.h"
+
+namespace orxonox
+{
+    unsigned int OrxonoxOverlay::hudOverlayCounter_s = 0;
+    std::map<std::string, OrxonoxOverlay*> OrxonoxOverlay::overlays_s;
+
+    SetConsoleCommand(OrxonoxOverlay, scaleOverlay, false).accessLevel(AccessLevel::User);
+    SetConsoleCommand(OrxonoxOverlay, scrollOverlay, false).accessLevel(AccessLevel::User);
+    SetConsoleCommand(OrxonoxOverlay, toggleVisibility, false).accessLevel(AccessLevel::User);
+    SetConsoleCommand(OrxonoxOverlay, rotateOverlay, false).accessLevel(AccessLevel::User);
+
+    OrxonoxOverlay::OrxonoxOverlay(BaseObject* creator)
+        : BaseObject(creator)
+    {
+        RegisterObject(OrxonoxOverlay);
+
+        this->owner_ = 0;
+        this->group_ = 0;
+
+        if (!GameMode::showsGraphics())
+            ThrowException(NoGraphics, "Can't create OrxonoxOverlay, graphics engine not initialized");
+
+        // create the Ogre::Overlay
+        overlay_ = Ogre::OverlayManager::getSingleton().create("OrxonoxOverlay_overlay_"
+            + multi_cast<std::string>(hudOverlayCounter_s++));
+
+        // create background panel (can be used to show any picture)
+        this->background_ = static_cast<Ogre::PanelOverlayElement*>(
+            Ogre::OverlayManager::getSingleton().createOverlayElement("Panel",
+            "OrxonoxOverlay_background_" + multi_cast<std::string>(hudOverlayCounter_s++)));
+        this->overlay_->add2D(this->background_);
+
+        // Get aspect ratio from the render window. Later on, we get informed automatically
+        this->windowAspectRatio_ = static_cast<float>(this->getWindowWidth()) / this->getWindowHeight();
+        this->sizeCorrectionChanged();
+
+        this->changedVisibility();
+
+        setSize(Vector2(1.0f, 1.0f));
+        setPickPoint(Vector2(0.0f, 0.0f));
+        setPosition(Vector2(0.0f, 0.0f));
+        setRotation(Degree(0.0));
+        setAspectCorrection(false);
+        setBackgroundMaterial("");
+    }
+
+    /**
+    @brief
+        Make sure everything gets removed/destroyed.
+    @remark
+        We assume that the Ogre::OverlayManager exists (there is an assert in Ogre for that!)
+    */
+    OrxonoxOverlay::~OrxonoxOverlay()
+    {
+        if (this->isInitialized())
+        {
+            // erase ourself from the map with all overlays
+            std::map<std::string, OrxonoxOverlay*>::iterator it = overlays_s.find(this->getName());
+            if (it != overlays_s.end())
+                overlays_s.erase(it);
+
+            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->background_);
+            Ogre::OverlayManager::getSingleton().destroy(this->overlay_);
+        }
+    }
+
+    /**
+    @brief
+        Loads the OrxonoxOverlay.
+
+        This has to be called before usage, otherwise strange behaviour is
+        guaranteed! (there should be no segfaults however).
+    @copydoc
+        BaseObject::XMLPort()
+    */
+    void OrxonoxOverlay::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        SUPER(OrxonoxOverlay, XMLPort, xmlElement, mode);
+
+        XMLPortParam(OrxonoxOverlay, "size",      setSize,      getSize,      xmlElement, mode);
+        XMLPortParam(OrxonoxOverlay, "pickpoint", setPickPoint, getPickPoint, xmlElement, mode);
+        XMLPortParam(OrxonoxOverlay, "position",  setPosition,  getPosition,  xmlElement, mode);
+        XMLPortParam(OrxonoxOverlay, "rotation",  setRotation,  getRotation,  xmlElement, mode);
+        XMLPortParam(OrxonoxOverlay, "correctaspect", setAspectCorrection,   getAspectCorrection,   xmlElement, mode);
+        XMLPortParam(OrxonoxOverlay, "background",    setBackgroundMaterial, getBackgroundMaterial, xmlElement, mode);
+    }
+
+    void OrxonoxOverlay::changedName()
+    {
+        SUPER(OrxonoxOverlay, changedName);
+
+        OrxonoxOverlay::overlays_s.erase(this->getOldName());
+
+        if (OrxonoxOverlay::overlays_s.find(this->getName()) != OrxonoxOverlay::overlays_s.end())
+            COUT(1) << "Overlay names should be unique or you cannnot access them via console. Name: \"" << this->getName() << "\"" << std::endl;
+
+        OrxonoxOverlay::overlays_s[this->getName()] = this;
+    }
+
+    //! Only sets the background material name if not ""
+    void OrxonoxOverlay::setBackgroundMaterial(const std::string& material)
+    {
+        if (this->background_ && material != "")
+            this->background_->setMaterialName(material);
+    }
+
+    //! Returns the the material name of the background
+    const std::string& OrxonoxOverlay::getBackgroundMaterial() const
+    {
+        if (this->background_)
+            return this->background_->getMaterialName();
+        else
+            return BLANKSTRING;
+    }
+
+    //! Called by BaseObject when visibility has changed.
+    void OrxonoxOverlay::changedVisibility()
+    {
+        if (!this->overlay_)
+            return;
+
+        if (this->isVisible())
+            this->overlay_->show();
+        else
+            this->overlay_->hide();
+    }
+
+    /**
+    @brief
+        Called by the GraphicsManager whenever the window size changes.
+        Calculates the aspect ratio only.
+    */
+    void OrxonoxOverlay::windowResized(unsigned int newWidth, unsigned int newHeight)
+    {
+        this->windowAspectRatio_ = static_cast<float>(newWidth) / newHeight;
+        this->sizeCorrectionChanged();
+    }
+
+    /**
+    @brief
+        Called whenever the rotation angle has changed.
+    */
+    void OrxonoxOverlay::angleChanged()
+    {
+        if (!this->overlay_)
+            return;
+
+        this->overlay_->setRotate(this->angle_);
+        this->sizeCorrectionChanged();
+    }
+
+    /**
+    @brief
+        Called whenever the aspect ratio or the angle has changed.
+        The method calculates a correction factor for the size to compensate
+        for aspect distortion if desired.
+    @remarks
+        This only works when the angle is about 0 or 90 degrees.
+    */
+    void OrxonoxOverlay::sizeCorrectionChanged()
+    {
+        if (this->bCorrectAspect_)
+        {
+            float angle = this->angle_.valueDegrees();
+            if (angle < 0.0)
+                angle = -angle;
+            angle -= 180.0f * static_cast<int>(angle / 180.0);
+
+            // take the reverse if angle is about 90 degrees
+            float tempAspect;
+            if (angle > 89.0f && angle < 91.0f)
+            {
+                tempAspect = 1.0 / this->windowAspectRatio_;
+                rotState_ = Vertical;
+            }
+            else if (angle > 179 || angle < 1)
+            {
+                tempAspect = this->windowAspectRatio_;
+                rotState_ = Horizontal;
+            }
+            else
+            {
+                tempAspect = 1.0f;
+                rotState_ = Inbetween;
+            }
+
+            // note: this is only an approximation that is mostly valid when the
+            // magnitude of the width is about the magnitude of the height.
+            // Correctly we would have to take the square root of width*height
+            this->sizeCorrection_.x = 2.0f / (tempAspect + 1.0f);
+            this->sizeCorrection_.y = tempAspect * this->sizeCorrection_.x;
+        }
+        else
+        {
+            this->sizeCorrection_ = Vector2::UNIT_SCALE;
+        }
+
+        this->sizeChanged();
+    }
+
+    /**
+    @brief
+        Sets the overlay size using the actual corrected size.
+    */
+    void OrxonoxOverlay::sizeChanged()
+    {
+        if (!this->overlay_)
+            return;
+
+        this->overlay_->setScale(size_.x * sizeCorrection_.x, size_.y * sizeCorrection_.y);
+        positionChanged();
+    }
+
+    /**
+    @brief
+        Determines the position of the overlay.
+        This works also well when a rotation angle is applied. The overlay always
+        gets aligned correctly as well as possible.
+    */
+    void OrxonoxOverlay::positionChanged()
+    {
+        if (!this->overlay_)
+            return;
+
+        // transform the angle to a range of 0 - pi/2 first.
+        float angle = this->angle_.valueRadians();
+        if (angle < 0.0)
+            angle = -angle;
+        angle -= Ogre::Math::PI * static_cast<int>(angle / (Ogre::Math::PI));
+        if (angle > Ogre::Math::PI * 0.5)
+            angle = Ogre::Math::PI - angle;
+
+        // do some mathematical fiddling for a bounding box
+        Vector2 actualSize = size_ * sizeCorrection_;
+        float radius = actualSize.length();
+        float phi = atan(actualSize.y / actualSize.x);
+        Vector2 boundingBox(radius * cos(angle - phi), radius * sin(angle + phi));
+
+        // calculate the scrolling offset
+        Vector2 scroll = (position_ - 0.5 - boundingBox * (pickPoint_ - 0.5)) * 2.0;
+        this->overlay_->setScroll(scroll.x, -scroll.y);
+    }
+
+
+    //########### Console commands ############
+
+    /**
+    @brief
+        Scales an overlay by its name.
+    @param name
+        The name of the overlay defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OrxonoxOverlay::scaleOverlay(const std::string& name, float scale)
+    {
+        std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
+        if (it != overlays_s.end())
+            (*it).second->scale(Vector2(scale, scale));
+    }
+
+    /**
+    @brief
+        Toggles the visibility of an Overlay by it's name.
+    @param name
+        The name of the overlay defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OrxonoxOverlay::toggleVisibility(const std::string& name)
+    {
+        std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
+        if (it != overlays_s.end())
+        {
+            OrxonoxOverlay* overlay= (*it).second;
+            if(overlay->isVisible())
+                overlay->hide();
+            else
+                overlay->show();
+        }
+    }
+
+    /**
+    @brief
+        Scrolls an overlay by its name.
+    @param name
+        The name of the overlay defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OrxonoxOverlay::scrollOverlay(const std::string& name, const Vector2& scroll)
+    {
+        std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
+        if (it != overlays_s.end())
+            (*it).second->scroll(scroll);
+    }
+
+    /**
+    @brief
+        Rotates an overlay by its name.
+    @param name
+        The name of the overlay defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OrxonoxOverlay::rotateOverlay(const std::string& name, const Degree& angle)
+    {
+        std::map<std::string, OrxonoxOverlay*>::const_iterator it = overlays_s.find(name);
+        if (it != overlays_s.end())
+            (*it).second->rotate(angle);
+    }
+}
Index: code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
===================================================================
--- code/trunk/src/orxonox/overlays/OrxonoxOverlay.h	(revision 5781)
+++ code/trunk/src/orxonox/overlays/OrxonoxOverlay.h	(revision 5781)
@@ -0,0 +1,219 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief Declaration of the OrxonoxOverlay class.
+*/
+
+#ifndef _OrxonoxOverlay_H__
+#define _OrxonoxOverlay_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+
+#include "util/Math.h"
+#include "util/OgreForwardRefs.h"
+#include "core/BaseObject.h"
+#include "core/WindowEventListener.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        Base class to display content directly onto the screen.
+        This is merely a wrapper of the Ogre::Overlay to implement more features and integrate it
+        in our class hierarchy for xml loading and config values.
+        The mentioned features are:
+        - Automatic positioning depending on the scale and the rotation angle.
+          You can specify a "pick point" relative to the overlay itself. This point will always be exactly
+          at the position (position_) of the overlay. That allows for margin/corner aligment.
+          It even works when a rotation angle is applied.
+        - Virtual methods for changedVisibilty() (BaseObject), angleChanged(), sizeCorrectionChanged(),
+          sizeChanged() and positionChanged(), that can be overridden by any derivative. This enables for
+          custom configurability of the size, position and rotation attributes. For intance, the HUDNavigation
+          should behave differently to sizeChanged() than a standard overlay.
+        - Console commands for scale, rotate and scroll (accessed by name)
+        - Standard Ogre::PanelOverlayElement for a background image (class doesn't have to be derived
+          only for displaying a picture).
+        - Reacts to changes of the window aspect
+        - Last but not least: On demand you can tell the overlay to automatically resale to correct for
+          aspect distortion. E.g. if you play 1024x768 you wouldn't want a round object to be oval.
+          Remark: This can (due to the Ogre::Overlay transformation order) only work for angle that are
+                  multiples of 90 degrees. But it's only a small drawback.
+    */
+    class _OrxonoxExport OrxonoxOverlay : public BaseObject, public WindowEventListener
+    {
+    public:
+        /**
+        @brief
+            Describes the rotational state of a an overlay.
+            Horizontal means 0/180 degrees, Vertical is 90/270 degrees
+            and Inbetween is everything else.
+        */
+        enum RotationState
+        {
+            Horizontal,
+            Vertical,
+            Inbetween
+        };
+
+    public:
+        OrxonoxOverlay(BaseObject* creator);
+        virtual ~OrxonoxOverlay();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        virtual void changedName();
+
+        //! Shows the overlay with an detour to BaseObject::visibility_
+        void show() { this->setVisible(true); }
+        //! Hides the overlay with an detour to BaseObject::visibility_
+        void hide() { this->setVisible(false); }
+
+        /** Sets whether the aspect of the overlay is corrected.
+            This is for instance useful for round objects that should stay round no matter
+            what the screen resolution is. */
+        void setAspectCorrection(bool val)        { this->bCorrectAspect_ = val; this->sizeCorrectionChanged(); }
+        //! Returns whether the window aspect is corrected
+        bool getAspectCorrection() const          { return this->bCorrectAspect_; }
+
+        //! Sets the position of this overlay on the screen.
+        void setPosition(Vector2 pos)             { this->position_ = pos; this->positionChanged(); }
+
+        //! Returns the current position on the screen.
+        const Vector2& getPosition() const        { return this->position_; }
+
+        //! Scrolls the overlay. @param offset The offset given.
+        void scroll(const Vector2& offset)        { this->position_ += offset; this->positionChanged(); }
+
+        /** Sets the point in the overlay where to pick it when translating.
+            For instance setting it to (1.0,1.0) means that the lower right corner of the
+            overlay will be put at position_.
+            This primarily helps aligning an overlay to any corner/margin on the screen. */
+        void setPickPoint(const Vector2& position){ this->pickPoint_ = position; this->positionChanged(); }
+
+        //! Gets the pick point of this overlay. @see setPickPoint()
+        const Vector2& getPickPoint() const       { return this->pickPoint_; }
+
+        //! Sets the rotation angle applied to this overlay in degrees.
+        void setRotation(const Degree& angle)     { this->angle_ = angle; this->angleChanged(); }
+
+        //! Gets the rotation angle applied to this overlay in degrees.
+        const Degree& getRotation() const         { return this->angle_; }
+
+        //! Rotates the overlay by angle degrees.
+        void rotate(const Degree& angle)          { this->angle_ += angle; this->angleChanged(); }
+
+        //! Sets the size of this overlay.
+        void setSize(const Vector2& size)         { this->size_ = size; this->sizeChanged(); }
+
+        //! Gets the current size that was set (uncorrected)
+        const Vector2& getSize() const            { return this->size_; }
+
+        //! Gets the actual size of the overlay on the screen (corrected)
+        Vector2 getActualSize() const             { return this->size_ * this->sizeCorrection_; }
+
+        //! Gets the current size correction (default: 1.0, 1.0)
+        const Vector2& getSizeCorrection() const  { return this->sizeCorrection_; }
+
+        //! Scales the overlay by scale.
+        void scale(const Vector2& scale)          { this->size_ *= scale; this->sizeChanged(); }
+
+        //! ConsoleCommand: Accesses the overlay by its name and scales it.
+        static void scaleOverlay(const std::string& name, float scale);
+        //! ConsoleCommand: Accesses the overlay by its name and scrolls it.
+        static void scrollOverlay(const std::string& name, const Vector2& scroll);
+        static void toggleVisibility(const std::string& name);
+        //! ConsoleCommand: Accesses the overlay by its name and rotates it.
+        static void rotateOverlay(const std::string& name, const Degree& angle);
+
+        virtual void changedVisibility();
+
+        inline void setOwner(BaseObject* owner)
+        {
+            if (this->owner_ != owner)
+            {
+                this->owner_ = owner;
+                this->changedOwner();
+            }
+        }
+        inline BaseObject* getOwner() const
+            { return this->owner_; }
+        virtual void changedOwner() {}
+
+        inline void setOverlayGroup(OverlayGroup* group)
+        {
+            if (group != this->group_)
+            {
+                this->group_ = group;
+                this->changedOverlayGroup();
+            }
+        }
+        inline OverlayGroup* getOverlayGroup() const
+            { return this->group_; }
+        virtual void changedOverlayGroup() {}
+
+    protected:
+        virtual void angleChanged();
+        virtual void sizeCorrectionChanged();
+        virtual void sizeChanged();
+        virtual void positionChanged();
+
+        void setBackgroundMaterial(const std::string& material);
+        const std::string& getBackgroundMaterial() const;
+
+        Ogre::Overlay* overlay_;                   //!< The overlay the entire class is about.
+        Ogre::PanelOverlayElement* background_;    //!< Background image (blank per default).
+
+        float windowAspectRatio_;                  //!< Screen.width / screen.height
+        bool bCorrectAspect_;                      //!< Whether or not to correct the size. @see setAspectCorrection()
+        Vector2 size_;                             //!< Internal size of the overlay.
+        Vector2 sizeCorrection_;                   //!< Value to correct the size because of the window aspect.
+        Vector2 position_;                         //!< Position of the pickPoint on the screen.
+        Vector2 pickPoint_;                        //!< Point on the overlay to pick when translating
+        Degree angle_;                             //!< Rotation angle of the overlay
+        RotationState rotState_;                   //!< horizontal, vertical or inbetween
+
+    private:
+        void windowResized(unsigned int newWidth, unsigned int newHeight);
+
+        static unsigned int hudOverlayCounter_s;   //!< Static counter for hud elements
+        /** Contains all the overlays in a map for quick access via console commands.
+            We could also use the ObjectList, but that doesn't guarantee XMLPort(.) was called and is slower. */
+        static std::map<std::string, OrxonoxOverlay*> overlays_s;
+        BaseObject* owner_;
+        OverlayGroup* group_;
+  };
+
+  SUPER_FUNCTION(7, OrxonoxOverlay, changedOwner, false);
+  SUPER_FUNCTION(8, OrxonoxOverlay, changedOverlayGroup, false);
+}
+
+#endif /* _OrxonoxOverlay_H__ */
Index: code/trunk/src/orxonox/overlays/OverlayGroup.cc
===================================================================
--- code/trunk/src/orxonox/overlays/OverlayGroup.cc	(revision 5781)
+++ code/trunk/src/orxonox/overlays/OverlayGroup.cc	(revision 5781)
@@ -0,0 +1,205 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief Definition of the OverlayGroup class.
+*/
+
+#include "OverlayGroup.h"
+
+#include "core/ConsoleCommand.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "OrxonoxOverlay.h"
+
+namespace orxonox
+{
+    CreateFactory(OverlayGroup);
+
+    SetConsoleCommand(OverlayGroup, toggleVisibility, false).accessLevel(AccessLevel::User);
+    SetConsoleCommand(OverlayGroup, scaleGroup, false).accessLevel(AccessLevel::User);
+    SetConsoleCommand(OverlayGroup, scrollGroup, false).accessLevel(AccessLevel::User);
+
+    OverlayGroup::OverlayGroup(BaseObject* creator)
+        : BaseObject(creator)
+    {
+        RegisterObject(OverlayGroup);
+
+        this->owner_ = 0;
+
+        setScale(Vector2(1.0, 1.0));
+        setScroll(Vector2(0.0, 0.0));
+    }
+
+    OverlayGroup::~OverlayGroup()
+    {
+        for (std::set<OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+            delete (*it);
+    }
+
+    /**
+    @brief
+        Loads the group and all its children OrxonoxOverlays.
+    @copydoc
+        BaseObject::XMLPort()
+    */
+    void OverlayGroup::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        SUPER(OverlayGroup, XMLPort, xmlElement, mode);
+
+        XMLPortParam(OverlayGroup, "scale",  setScale,  getScale,  xmlElement, mode);
+        XMLPortParam(OverlayGroup, "scroll", setScroll, getScroll, xmlElement, mode);
+        // loads all the child elements
+        XMLPortObject(OverlayGroup, OrxonoxOverlay, "", addElement, getElement, xmlElement, mode);
+    }
+
+    //! Scales every element in the set.
+    void OverlayGroup::setScale(const Vector2& scale)
+    {
+        for (std::set<OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+            (*it)->scale(scale / this->scale_);
+        this->scale_ = scale;
+    }
+
+    //! Scrolls every element in the set.
+    void OverlayGroup::setScroll(const Vector2& scroll)
+    {
+        for (std::set<OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+            (*it)->scroll(scroll - this->scroll_);
+        this->scroll_ = scroll;
+    }
+
+    /**
+    @brief
+        Adds an element to the set (used when loading with XMLPort).
+    @remarks
+        The names of the OrxonoxOverlays have to be unique!
+    */
+    void OverlayGroup::addElement(OrxonoxOverlay* element)
+    {
+        hudElements_.insert(element);
+        element->setVisible(this->isVisible());
+        if (this->owner_)
+            element->setOwner(this->owner_);
+    }
+
+    /**
+    @brief
+        Removes an element from the map.
+    @param name
+        The name of the element that is removed.
+    @return
+        Returns true if there was such an element to remove, false if not.
+    */
+    bool OverlayGroup::removeElement(OrxonoxOverlay* element)
+    {
+        if(this->hudElements_.erase(element) == 0)
+            return false;
+        return true;
+    }
+
+    //! Returns a different element as long as index < hudElements_.size().
+    OrxonoxOverlay* OverlayGroup::getElement(unsigned int index)
+    {
+        if (index < this->hudElements_.size())
+        {
+            std::set<OrxonoxOverlay*>::const_iterator it = hudElements_.begin();
+            for (unsigned int i = 0; i != index; ++it, ++i)
+                ;
+            return (*it);
+        }
+        else
+            return 0;
+    }
+
+    //! Changes the visibility of all elements
+    void OverlayGroup::changedVisibility()
+    {
+        for (std::set<OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+            (*it)->setVisible(this->isVisible());
+    }
+
+    void OverlayGroup::setOwner(BaseObject* owner)
+    {
+        this->owner_ = owner;
+
+        for (std::set<OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)
+            (*it)->setOwner(owner);
+    }
+
+    //########### Console commands ############
+
+    /**
+    @brief
+        Hides/shows an overlay group by its name.
+    @param name
+        The name of the group defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OverlayGroup::toggleVisibility(const std::string& name)
+    {
+        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
+        {
+            if ((*it)->getName() == name)
+                (*it)->setVisible(!((*it)->isVisible()));
+        }
+    }
+
+    /**
+    @brief
+        Scales an overlay group by its name.
+    @param name
+        The name of the group defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale)
+    {
+        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
+        {
+            if ((*it)->getName() == name)
+                (*it)->scale(Vector2(scale, scale));
+        }
+    }
+
+    /**
+    @brief
+        Scrolls an overlay group by its name.
+    @param name
+        The name of the group defined BaseObject::setName() (usually done with the "name"
+        attribute in the xml file).
+    */
+    /*static*/ void OverlayGroup::scrollGroup(const std::string& name, const Vector2& scroll)
+    {
+        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
+        {
+            if ((*it)->getName() == name)
+                (*it)->scroll(scroll);
+        }
+    }
+}
Index: code/trunk/src/orxonox/overlays/OverlayGroup.h
===================================================================
--- code/trunk/src/orxonox/overlays/OverlayGroup.h	(revision 5781)
+++ code/trunk/src/orxonox/overlays/OverlayGroup.h	(revision 5781)
@@ -0,0 +1,99 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief Declaration of the OverlayGroup class.
+*/
+
+#ifndef _OverlayGroup_H__
+#define _OverlayGroup_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <set>
+#include "util/Math.h"
+#include "util/OgreForwardRefs.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        OverlayGroup does almost exactly what it says: It groups OrxonoxOverlays together.
+        You can scroll the entire group by a certain amount. Scale however works differently
+        than expected: Each OrxonoxOverlay scales individually. That's quite useful when you
+        create your HUD with an OverlayGroup and then want to alter its size.
+    */
+    class _OrxonoxExport OverlayGroup : public BaseObject
+    {
+    public:
+        OverlayGroup(BaseObject* creator);
+        //! Empty destructor.
+        ~OverlayGroup();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        static void toggleVisibility(const std::string& name);
+        static void scaleGroup(const std::string& name, float scale);
+        static void scrollGroup(const std::string& name, const Vector2& scroll);
+
+        inline const std::set<OrxonoxOverlay*>& getOverlays() const
+            { return this->hudElements_; }
+
+        void changedVisibility();
+
+        void setOwner(BaseObject* owner);
+        inline BaseObject* getOwner() const
+            { return this->owner_; }
+
+        //! Scales each OrxonoxOverlay individually by scale.
+        void scale(const Vector2& scale) { this->setScale(scale * this->scale_); }
+        void setScale(const Vector2& scale);
+        //! Returns the current size of the group.
+        Vector2 getScale() const { return this->scale_; }
+
+        //! Scrolls each OrxonoxOverlay individually by scroll.
+        void scroll(const Vector2& scroll) { this->setScroll(scroll + this->scroll_); }
+        void setScroll(const Vector2& scroll);
+        //! Returns the current scrolling offset of the group.
+        Vector2 getScroll() const { return this->scale_; }
+
+        void addElement(OrxonoxOverlay* element);
+        bool removeElement(OrxonoxOverlay* element);
+        OrxonoxOverlay* getElement(unsigned int index);
+
+    private:
+        std::set<OrxonoxOverlay*> hudElements_;    //!< Contains all the OrxonoxOverlays of the this group.
+        Vector2 scale_;                            //!< Current scale (independent of the elements).
+        Vector2 scroll_;                           //!< Current scrolling offset.
+        BaseObject* owner_;                        //!< The owner of this OverlayGroup
+    };
+}
+
+#endif /* _OverlayGroup_H__ */
Index: code/trunk/src/orxonox/pickup/BaseItem.cc
===================================================================
--- code/trunk/src/orxonox/pickup/BaseItem.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/BaseItem.cc	(revision 5781)
@@ -0,0 +1,109 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of BaseItem (base-class for items/pickups).
+*/
+
+#include "BaseItem.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor. Registers the BaseItem.
+        @param creator Pointer to the object which created this item.
+    */
+    BaseItem::BaseItem(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(BaseItem);
+
+        this->setOwner(0);
+        this->setPickupIdentifier(this->getName());
+        this->setGUIImage("");
+        this->setGUIText("");
+    }
+    //! Destructor.
+    BaseItem::~BaseItem()
+    {
+    }
+
+    /**
+        @brief XMLPort for BaseItem.
+        @param xmlelement Element of the XML-file.
+        @param mode XMLPort mode to use.
+    */
+    void BaseItem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(BaseItem, XMLPort, xmlelement, mode);
+
+        XMLPortParam(BaseItem, "guiText", setGUIText, getGUIText, xmlelement, mode);
+        XMLPortParam(BaseItem, "guiImage", setGUIImage, getGUIImage, xmlelement, mode);
+    }
+
+    /**
+        @brief Method to add the item to a pawn.
+        @param pawn Pawn to which the item should get added.
+        @return Returns whether the pawn's PickupCollection accepted the item.
+    */
+    bool BaseItem::addTo(Pawn* pawn)
+    {
+        this->setOwner(pawn);
+
+        if (pawn->getPickups().add(this))
+        {
+            COUT(3) << "Added '" << this->getPickupIdentifier() << "' item." << std::endl;
+            return true;
+        }
+        return false;
+    }
+    /**
+        @brief Removes the item from a pawn.
+        @param pawn Pawn from which to remove the item.
+        @return Returns whether the pawn's PickupCollection was able to locate and remove the item.
+    */
+    bool BaseItem::removeFrom(Pawn* pawn)
+    {
+        this->setOwner(0);
+
+        COUT(3) << "Removing '" << this->getPickupIdentifier() << "' item." << std::endl;
+
+        pawn->getPickups().remove(this, false);
+
+        return true;
+    }
+
+    const std::string& BaseItem::getGUIText() const
+    {
+        return this->guiText_;
+    }
+}
Index: code/trunk/src/orxonox/pickup/BaseItem.h
===================================================================
--- code/trunk/src/orxonox/pickup/BaseItem.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/BaseItem.h	(revision 5781)
@@ -0,0 +1,150 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of BaseItem (base-class for items/pickups).
+*/
+
+#ifndef _BaseItem_H__
+#define _BaseItem_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "core/BaseObject.h"
+
+// tolua_begin
+namespace orxonox
+{
+    /**
+        @brief
+            Base class for all items/pickups.
+
+            Provides common methods to be used in derived classes.
+        @author
+            Daniel 'Huty' Haggenmueller
+    */
+    class _OrxonoxExport BaseItem : public BaseObject
+    {
+// tolua_end
+    public:
+        BaseItem(BaseObject* creator);
+        virtual ~BaseItem();
+
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< XMLPort
+
+        /**
+            @brief Checks how many instances of this item can be carried at a time.
+            @return How many of this item can be carried.
+        */
+        virtual int getMaxCarryAmount() const
+            { return 1; }
+
+        bool addTo(Pawn* pawn);             //!< Add the item to a pawn.
+        bool removeFrom(Pawn* pawn);        //!< Removes the item from a pawn.
+        /**
+            @brief
+                Method invoked when the item gets picked up.
+
+                Has to be overridden for an item to work,
+                should contain a call to addTo().
+
+            @param pawn Pawn who picks up the item.
+            @return Returns whether the pawn was able to pick up the item.
+        */
+        virtual bool pickedUp(Pawn* pawn)
+            { return false; }
+        /**
+            @brief
+                Method invoked when the item is dropped from a player.
+
+                Should be overridden by derived classes,
+                should also contain a call to removeFrom().
+
+            @param pawn Pawn which dropped the item.
+            @return Returns whether the item was able to get dropped by the pawn.
+        */
+        virtual bool dropped(Pawn* pawn)
+            { return false; }
+
+        /**
+            @brief Gets the current owner of the pickup.
+            @return Returns the current owner.
+        */
+        inline Pawn* getOwner() const
+            { return this->owner_; }
+        /**
+            @brief Sets the owner of the pickup.
+            @param owner New owner for the pickup.
+        */
+        inline void setOwner(Pawn* owner)
+            { this->owner_ = owner; }
+
+        /**
+            @brief Gets the pickupIdentifier of the item.
+            @return Returns the pickupIdentifier of the item.
+            @see pickupIdentifier_
+        */
+        inline const std::string& getPickupIdentifier() const
+            { return this->pickupIdentifier_; }
+        /**
+            @brief Sets the pickupIdentifier for the item.
+            @param identifier New pickupIdentifier for the item.
+            @see pickupIdentifier_
+        */
+        inline void setPickupIdentifier(const std::string& identifier)
+            { this->pickupIdentifier_ = identifier; }
+
+        // GUI stuff
+        virtual const std::string& getGUIText() const; // tolua_export
+        inline void setGUIText(const std::string& text)
+            { this->guiText_ = text; }
+
+        virtual const std::string& getGUIImage() const
+            { return this->guiImage_; }
+        inline void setGUIImage(const std::string& image)
+            { this->guiImage_ = image; }
+    private:
+        Pawn* owner_;   //!< The current owner of the item.
+
+        /**
+            @brief
+                The pickupIdentifier of the item..
+
+                Usually set to the template name used by a PickupSpawner,
+                used to index items in the PickupCollection.
+        */
+        std::string pickupIdentifier_;
+
+        std::string guiText_;
+        std::string guiImage_;
+    }; // tolua_export
+} // tolua_export
+
+#endif /* _BaseItem_H__ */
Index: code/trunk/src/orxonox/pickup/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/pickup/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/pickup/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,13 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  BaseItem.cc
+  DroppedItem.cc
+  EquipmentItem.cc
+  ModifierPickup.cc
+  PassiveItem.cc
+  PickupCollection.cc
+  PickupInventory.cc
+  PickupSpawner.cc
+  UsableItem.cc
+)
+
+ADD_SUBDIRECTORY(items)
Index: code/trunk/src/orxonox/pickup/DroppedItem.cc
===================================================================
--- code/trunk/src/orxonox/pickup/DroppedItem.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/DroppedItem.cc	(revision 5781)
@@ -0,0 +1,124 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "DroppedItem.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "BaseItem.h"
+#include "graphics/Billboard.h"
+#include "graphics/Model.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateFactory(DroppedItem);
+
+    DroppedItem::DroppedItem(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(DroppedItem);
+
+        this->triggerDistance_ = 20.0f;
+        this->timeToLive_ = 0;
+        this->item_ = 0;
+    }
+    DroppedItem::~DroppedItem()
+    {
+    }
+    void DroppedItem::tick(float dt)
+    {
+        if (this->item_)
+        {
+            for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); it++)
+            {
+                Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
+                if (distance.length() < this->triggerDistance_)
+                    this->trigger(*it);
+            }
+        }
+    }
+    void DroppedItem::trigger(Pawn* pawn)
+    {
+        if (this->item_->pickedUp(pawn))
+        {
+            COUT(3) << "DroppedItem '" << this->item_->getPickupIdentifier() << "' picked up." << std::endl;
+            delete this;
+        }
+    }
+    void DroppedItem::createTimer()
+    {
+        if (this->timeToLive_ > 0)
+        {
+            ExecutorMember<DroppedItem>* exec = createExecutor(createFunctor(&DroppedItem::timerCallback));
+            this->timer_.setTimer(this->timeToLive_, false, this, exec, false);
+        }
+    }
+    void DroppedItem::timerCallback()
+    {
+        if (this->item_)
+        {
+            COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << "'" << std::endl;
+            delete this->item_;
+        }
+
+        delete this;
+    }
+
+    DroppedItem* DroppedItem::createDefaultDrop(BaseItem* item, const Vector3& position, const ColourValue& flareColour, float timeToLive)
+    {
+        DroppedItem* drop = new DroppedItem(item);
+        Model* model = new Model(item);
+        Billboard* billboard = new Billboard(item);
+
+        model->setMeshSource("sphere.mesh");
+        model->setScale(3.0f);
+
+        billboard->setMaterial("Examples/Flare");
+        billboard->setColour(flareColour);
+        billboard->setScale(0.5f);
+
+        drop->setPosition(position);
+        drop->attach(model);
+        drop->attach(billboard);
+
+        drop->setItem(item);
+
+        drop->setTimeToLive(timeToLive);
+        drop->createTimer();
+
+        COUT(3) << "Created DroppedItem for '" << item->getPickupIdentifier() << "' at (" << position.x << "," << position.y << "," << position.z << ")." << std::endl;
+
+        return drop;
+    }
+    DroppedItem* DroppedItem::createDefaultDrop(BaseItem* item, Pawn* pawn, const ColourValue& flareColour, float timeToLive)
+    {
+        Vector3 after = pawn->getPosition() + pawn->getOrientation() * Vector3(0.0f, 0.0f, 50.0f);
+        return DroppedItem::createDefaultDrop(item, after, flareColour, timeToLive);
+    }
+}
Index: code/trunk/src/orxonox/pickup/DroppedItem.h
===================================================================
--- code/trunk/src/orxonox/pickup/DroppedItem.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/DroppedItem.h	(revision 5781)
@@ -0,0 +1,83 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of DroppedItem
+*/
+
+#ifndef _DroppedItem_H__
+#define _DroppedItem_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/Timer.h"
+#include "tools/interfaces/Tickable.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport DroppedItem : public StaticEntity, public Tickable
+    {
+    public:
+        DroppedItem(BaseObject* creator);
+        virtual ~DroppedItem();
+
+        void tick(float dt);
+        void trigger(Pawn* pawn);
+
+        static DroppedItem* createDefaultDrop(BaseItem* item, const Vector3& position, const ColourValue& flareColour = ColourValue(0.5f, 1.0f, 0.3f), float timeToLive = 0);
+        static DroppedItem* createDefaultDrop(BaseItem* item, Pawn* pawn, const ColourValue& flareColour = ColourValue(0.5f, 1.0f, 0.3f), float timeToLive = 0);
+
+        void createTimer();
+        void timerCallback();
+
+        inline float getTriggerDistance() const
+            { return this->triggerDistance_; }
+        inline void setTriggerDistance(float distance)
+            { this->triggerDistance_ = distance; }
+
+        inline BaseItem* getItem() const
+            { return this->item_; }
+        inline void setItem(BaseItem* item)
+            { this->item_ = item; }
+
+        inline float getTimeToLive() const
+            { return this->timeToLive_; }
+        inline void setTimeToLive(float time)
+            { this->timeToLive_ = time; }
+    private:
+        float timeToLive_;
+        float triggerDistance_;
+        BaseItem* item_;
+
+        Timer<DroppedItem> timer_;
+    };
+}
+
+#endif /* _DroppedItem_H__ */
Index: code/trunk/src/orxonox/pickup/EquipmentItem.cc
===================================================================
--- code/trunk/src/orxonox/pickup/EquipmentItem.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/EquipmentItem.cc	(revision 5781)
@@ -0,0 +1,47 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of EquipmentItem.
+*/
+
+#include "EquipmentItem.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor. Registers the EquipmentItem.
+        @param creator Pointer to the object which created this item.
+    */
+    EquipmentItem::EquipmentItem(BaseObject* creator) : BaseItem(creator)
+    {
+        RegisterObject(EquipmentItem);
+    }
+}
Index: code/trunk/src/orxonox/pickup/EquipmentItem.h
===================================================================
--- code/trunk/src/orxonox/pickup/EquipmentItem.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/EquipmentItem.h	(revision 5781)
@@ -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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of EquipmentItem (base-class for equipment-type items).
+*/
+
+#ifndef _EquipmentPickup_H__
+#define _EquipmentPickup_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "BaseItem.h"
+namespace orxonox
+{
+    /**
+        @brief Base class for all equipment-type items.
+        @author Daniel 'Huty' Haggenmueller
+    */
+    class _OrxonoxExport EquipmentItem : public BaseItem
+    {
+    public:
+        EquipmentItem(BaseObject* creator);
+        virtual ~EquipmentItem() {}
+    };
+}
+
+#endif /* _EquipmentPickup_H__ */
Index: code/trunk/src/orxonox/pickup/ModifierPickup.cc
===================================================================
--- code/trunk/src/orxonox/pickup/ModifierPickup.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/ModifierPickup.cc	(revision 5781)
@@ -0,0 +1,205 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of ModifierPickup (temporary(?) pickup for testing).
+*/
+
+#include "ModifierPickup.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateFactory(ModifierPickup);
+
+    /**
+        @brief Constructor. Registers the ModifierPickup.
+        @param creator Pointer to the object which created this item.
+    */
+    ModifierPickup::ModifierPickup(BaseObject* creator) : PassiveItem(creator)
+    {
+        RegisterObject(ModifierPickup);
+
+        this->duration_ = 0.0f;
+    }
+    //! Deconstructor.
+    ModifierPickup::~ModifierPickup()
+    {
+    }
+    /**
+        @brief Method for loading information from a level file.
+        @param element XMLElement from which to read the data.
+        @param mode XMLPort mode to use.
+    */
+    void ModifierPickup::XMLPort(Element& element, XMLPort::Mode mode)
+    {
+        SUPER(ModifierPickup, XMLPort, element, mode);
+
+        XMLPortParam(ModifierPickup, "duration", setDuration, getDuration, element, mode);
+
+        XMLPortParamTemplate(ModifierPickup, "damageAdd", setAdditiveDamage, getAdditiveDamage, element, mode, float);
+        XMLPortParamTemplate(ModifierPickup, "damageMulti", setMultiplicativeDamage, getMultiplicativeDamage, element, mode, float);
+
+        XMLPortParamTemplate(ModifierPickup, "accelerationAdd", setAdditiveAcceleration, getAdditiveAcceleration, element, mode, float);
+        XMLPortParamTemplate(ModifierPickup, "accelerationMulti", setMultiplicativeAcceleration, getMultiplicativeAcceleration, element, mode, float);
+    }
+    /**
+        @brief
+            Invoked when a pawn picks up the pickup.
+
+            Adds the modifiers to the pawn and sets a timer (if effect is limited)
+            if the pickup could be added to the pawn's PickupCollection.
+
+        @param pawn Pawn which picked up the pickup.
+        @return Returns whether the pickup was able to be added to the pawn.
+    */
+    bool ModifierPickup::pickedUp(Pawn* pawn)
+    {
+        if (this->addTo(pawn))
+        {
+            std::map<ModifierType::Value, float>::iterator it;
+
+            for (it = this->additiveModifiers_.begin(); it != this->additiveModifiers_.end(); it++)
+            {
+                pawn->getPickups().addAdditiveModifier((*it).first, (*it).second);
+            }
+
+            for (it = this->multiplicativeModifiers_.begin(); it != this->multiplicativeModifiers_.end(); it++)
+            {
+                pawn->getPickups().addMultiplicativeModifier((*it).first, (*it).second);
+            }
+
+            if (this->duration_ > 0.0f)
+            {
+                ExecutorMember<ModifierPickup>* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback));
+                executor->setDefaultValues(pawn);
+                this->timer_.setTimer(this->duration_, false, this, executor);
+            }
+
+            return true;
+        }
+        return false;
+    }
+    /**
+        @brief
+            Invoked when a pawn drops the pickup.
+
+            Removes the modifiers from the pawn if the pickup
+            was successfully removed from it's PickupCollection.
+
+        @param pawn Pawn which dropped the pickup.
+        @return Returns whether the pickup could be removed.
+    */
+    bool ModifierPickup::dropped(Pawn* pawn)
+    {
+        if (this->removeFrom(pawn))
+        {
+            std::map<ModifierType::Value, float>::iterator it;
+
+            for (it = this->additiveModifiers_.begin(); it != this->additiveModifiers_.end(); it++)
+            {
+                pawn->getPickups().removeAdditiveModifier((*it).first, (*it).second);
+            }
+
+            for (it = this->multiplicativeModifiers_.begin(); it != this->multiplicativeModifiers_.end(); it++)
+            {
+                pawn->getPickups().removeMultiplicativeModifier((*it).first, (*it).second);
+            }
+
+            if (this->timer_.getRemainingTime() > 0.0f)
+                this->timer_.stopTimer();
+
+            delete this;
+
+            return true;
+        }
+        return false;
+    }
+    /**
+        @brief Invoked when the timer finished, calls dropped().
+    */
+    void ModifierPickup::timerCallback(Pawn* pawn)
+    {
+        if (!this->dropped(pawn))
+            COUT(2) << "Failed to remove modifier pickup after the timer ran out!" << std::endl;
+    }
+    /**
+        @brief Gets the additive modifier of a given type.
+        @param type ModifierType for which to return the modifier.
+        @return Returns the additive modifier for type (or 0 if not exists).
+    */
+    float ModifierPickup::getAdditiveModifier(ModifierType::Value type) const
+    {
+        std::map<ModifierType::Value, float>::const_iterator it = this->additiveModifiers_.find(type);
+        if (it != this->additiveModifiers_.end())
+            return (*it).second;
+        else
+            return 0.0f;
+    }
+    /**
+        @brief Gets the multiplicative modifier of a given type.
+        @param type ModifierType for which to return the modifier.
+        @return Returns the multiplicative modifier for type (or 1 if not exists).
+    */
+    float ModifierPickup::getMultiplicativeModifier(ModifierType::Value type) const
+    {
+        std::map<ModifierType::Value, float>::const_iterator it = this->multiplicativeModifiers_.find(type);
+        if (it != this->multiplicativeModifiers_.end())
+            return (*it).second;
+        else
+            return 1.0f;
+    }
+    /**
+        @brief Gets the additive modifier of a given type.
+        @param type ModifierType for which to return the modifier.
+        @param value The new additive modifier for type.
+    */
+    void ModifierPickup::setAdditiveModifier(ModifierType::Value type, float value)
+    {
+        if (this->additiveModifiers_.find(type) == this->additiveModifiers_.end())
+            this->additiveModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
+        else
+            this->additiveModifiers_[type] = value;
+    }
+    /**
+        @brief Gets the multiplicative modifier of a given type.
+        @param type ModifierType for which to return the modifier.
+        @param value The new multiplicative modifier for type.
+    */
+    void ModifierPickup::setMultiplicativeModifier(ModifierType::Value type, float value)
+    {
+        if (this->multiplicativeModifiers_.find(type) == this->multiplicativeModifiers_.end())
+            this->multiplicativeModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
+        else
+            this->multiplicativeModifiers_[type] = value;
+    }
+}
Index: code/trunk/src/orxonox/pickup/ModifierPickup.h
===================================================================
--- code/trunk/src/orxonox/pickup/ModifierPickup.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/ModifierPickup.h	(revision 5781)
@@ -0,0 +1,145 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of ModifierPickup (temporary(?) pickup for testing).
+*/
+
+#ifndef _ModifierPickup_H__
+#define _ModifierPickup_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <climits>
+#include <map>
+
+#include "tools/Timer.h"
+#include "ModifierType.h"
+#include "PassiveItem.h"
+
+namespace orxonox
+{
+    /**
+        @brief Class for a (temporary) modifier effect.
+        @author Daniel 'Huty' Haggenmueller
+    */
+    class _OrxonoxExport ModifierPickup : public PassiveItem
+    {
+    public:
+        ModifierPickup(BaseObject* creator);
+        virtual ~ModifierPickup();
+
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< To create a ModifierPickup through the level file.
+
+        virtual bool pickedUp(Pawn* pawn);                              //!< Override of the BaseItem::pickedUp() method.
+        virtual bool dropped(Pawn* pawn);                               //!< Override of the BaseItem::dropped() method
+
+        virtual int getMaxCarryAmount(){ return INT_MAX; }              //!< Allow the player to carry infinite ModPickups
+
+        /**
+            @brief Get the duration of this pickup.
+            @return Returns how long the effect holds on.
+        */
+        inline float getDuration() const
+            { return this->duration_; }
+        /**
+            @brief Set the duration of this pickup.
+            @param duration How long the effect should hold.
+        */
+        inline void setDuration(float duration)
+            { this->duration_ = duration; }
+
+        /**
+            @brief Get the amount of damage this pickup adds.
+            @return Returns how much damage this pickup adds.
+        */
+        inline float getAdditiveDamage() const
+            { return this->getAdditiveModifier(ModifierType::Damage); }
+        /**
+            @brief Get the factor by which this pickup multiplies the damage.
+            @return Returns the factor by which to multiply damage.
+        */
+        inline float getMultiplicativeDamage() const
+            { return this->getMultiplicativeModifier(ModifierType::Damage); }
+
+        /**
+            @brief Set the amount of damage this pickup adds.
+            @param value How much damage this pickup adds.
+        */
+        inline void setAdditiveDamage(float value)
+            { this->setAdditiveModifier(ModifierType::Damage, value); }
+        /**
+            @brief Set the factor by which this pickup multiplies the damage.
+            @param value Factor by which to multiply damage.
+        */
+        inline void setMultiplicativeDamage(float value)
+            { this->setMultiplicativeModifier(ModifierType::Damage, value); }
+
+        /**
+            @brief Get the amount of acceleration this pickup adds.
+            @return Returns how much acceleration this pickup adds.
+        */
+        inline float getAdditiveAcceleration() const
+            { return this->getAdditiveModifier(ModifierType::Acceleration); }
+        /**
+            @brief Get the factor by which this pickup multiplies the acceleration.
+            @return Returns the factor by which to multiply acceleration.
+        */
+        inline float getMultiplicativeAcceleration() const
+            { return this->getMultiplicativeModifier(ModifierType::Acceleration); }
+
+        /**
+            @brief Set the amount of acceleration this pickup adds.
+            @param value How much acceleration this pickup adds.
+        */
+        inline void setAdditiveAcceleration(float value)
+            { this->setAdditiveModifier(ModifierType::Acceleration, value); }
+        /**
+            @brief Set the factor by which this pickup multiplies the acceleration.
+            @param value Factor by which to multiply acceleration.
+        */
+        inline void setMultiplicativeAcceleration(float value)
+            { this->setMultiplicativeModifier(ModifierType::Acceleration, value); }
+
+        void timerCallback(Pawn* pawn);     //!< Method called when the timer runs out.
+    private:
+        float getAdditiveModifier(ModifierType::Value type) const;               //!< Get the additive modifier for a given ModifierType.
+        float getMultiplicativeModifier(ModifierType::Value type) const;         //!< Get the multiplicative modifier for a given ModifierType.
+        void setAdditiveModifier(ModifierType::Value type, float value);         //!< Set the additive modifier for a given ModifierType.
+        void setMultiplicativeModifier(ModifierType::Value type, float value);   //!< Set the multiplicative modifier for a given ModifierType
+
+        std::map<ModifierType::Value, float> additiveModifiers_;                 //!< Map of additive modifiers, indexed by ModifierType.
+        std::map<ModifierType::Value, float> multiplicativeModifiers_;           //!< Map of multiplicative modifiers, indexed by ModifierType.
+
+        float duration_;                                                        //!< Duration of this pickup's effect (0 for unlimited).
+        Timer<ModifierPickup> timer_;                                           //!< Timer used if the pickup's effect has a time limit.
+    };
+}
+
+#endif /* _ModifierPickup_H__ */
Index: code/trunk/src/orxonox/pickup/ModifierType.h
===================================================================
--- code/trunk/src/orxonox/pickup/ModifierType.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/ModifierType.h	(revision 5781)
@@ -0,0 +1,55 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Contains enumeration for different types of modifiers.
+*/
+
+#ifndef _ModifierType_H__
+#define _ModifierType_H__
+
+#include "OrxonoxPrereqs.h"
+
+namespace orxonox
+{
+    namespace ModifierType
+    {
+        /**
+            @brief Gives the available types for modifiers.
+        */
+        enum Value
+        {
+            Unknown = 0,
+            Damage,
+            Acceleration
+        };
+    }
+}
+
+#endif /* _ModifierType_H__ */
Index: code/trunk/src/orxonox/pickup/PassiveItem.cc
===================================================================
--- code/trunk/src/orxonox/pickup/PassiveItem.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/PassiveItem.cc	(revision 5781)
@@ -0,0 +1,42 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "PassiveItem.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor. Registers the PassiveItem.
+        @param creator Pointer to the object which created this item.
+    */
+    PassiveItem::PassiveItem(BaseObject* creator) : BaseItem(creator)
+    {
+        RegisterObject(PassiveItem);
+    }
+}
Index: code/trunk/src/orxonox/pickup/PassiveItem.h
===================================================================
--- code/trunk/src/orxonox/pickup/PassiveItem.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/PassiveItem.h	(revision 5781)
@@ -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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of PassiveItem (base class for passive items).
+*/
+
+#ifndef _PassiveItem_H__
+#define _PassiveItem_H__
+
+#include "OrxonoxPrereqs.h"
+#include "BaseItem.h"
+
+namespace orxonox
+{
+    /**
+        @brief Base class for all passive items.
+        @author Daniel 'Huty' Haggenmueller
+    */
+    class _OrxonoxExport PassiveItem : public BaseItem
+    {
+    public:
+        PassiveItem(BaseObject* creator);
+        virtual ~PassiveItem() {}
+    };
+}
+
+#endif /* _PassiveItem_H__ */
Index: code/trunk/src/orxonox/pickup/PickupCollection.cc
===================================================================
--- code/trunk/src/orxonox/pickup/PickupCollection.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/PickupCollection.cc	(revision 5781)
@@ -0,0 +1,377 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of PickupCollection.
+*/
+
+#include "PickupCollection.h"
+
+#include "core/CoreIncludes.h"
+#include "EquipmentItem.h"
+#include "PassiveItem.h"
+#include "UsableItem.h"
+
+namespace orxonox
+{
+    typedef std::pair<std::multimap<std::string, BaseItem*>::iterator, std::multimap<std::string, BaseItem*>::iterator> item_range;
+    typedef std::pair<std::multimap<ModifierType::Value, float>::iterator, std::multimap<ModifierType::Value, float>::iterator> modifier_range;
+
+    //! Constructor
+    PickupCollection::PickupCollection()
+    {
+        this->bBlockRemovals_ = false;
+        this->currentUsable_ = NULL;
+    }
+
+    /**
+        @brief
+            Add an item to the collection.
+
+            Only adds the item if there's a free slot for it.
+
+        @param item Item to add to the collection.
+        @return Returns whether the item has been added to the collection.
+    */
+    bool PickupCollection::add(BaseItem* item)
+    {
+        if (this->checkSlot(item))
+        {
+            Identifier* ident = Class(UsableItem);
+            if(this->currentUsable_ == NULL && item->isA(ident))
+                this->currentUsable_ = orxonox_cast<UsableItem*>(item);
+
+            this->items_.insert( std::pair<std::string, BaseItem*> (item->getPickupIdentifier(), item) );
+            return true;
+        }
+        else
+            return false;
+    }
+    /**
+        @brief
+            Check if there's a free slot for an item.
+
+            Compares the amount of the item-type in the collection
+            against the maximal amount of the item that can be carried.
+
+        @param item Item to check for a slot.
+        @return Returns if there's a free slot for the item.
+    */
+    bool PickupCollection::checkSlot(BaseItem* item)
+    {
+        return (static_cast<int>(this->items_.count(item->getPickupIdentifier())) < item->getMaxCarryAmount());
+    }
+    /**
+        @brief
+            Empty the collection.
+
+            Calls dropped() on all the items in the collection,
+            then clears the collection.
+    */
+    void PickupCollection::clear()
+    {
+        this->bBlockRemovals_ = true;
+        for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++)
+        {
+            if((*it).second && (*it).second->getOwner())
+                (*it).second->dropped((*it).second->getOwner());
+        }
+        this->currentUsable_ = NULL;
+        this->items_.clear();
+        this->bBlockRemovals_ = false;
+    }
+    /**
+        @brief Check if an item/type of item is in the collection.
+        @param item Item to check.
+        @param anyOfType If it should look for any item of the item's type (default: false).
+        @return Whether the collection contains the item/type of item.
+    */
+    bool PickupCollection::contains(BaseItem* item, bool anyOfType)
+    {
+        if (anyOfType)
+        {
+            return (this->items_.count(item->getPickupIdentifier()) > 0);
+        }
+        else
+        {
+            item_range bounds = this->items_.equal_range(item->getPickupIdentifier());
+            for (std::multimap<std::string, BaseItem*>::iterator it = bounds.first; it != bounds.second && it != this->items_.end(); it++)
+            {
+                if ((*it).second == item)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+    }
+    //! Uses the first usable item in the collection on the owner.
+    void PickupCollection::useItem()
+    {
+        if(this->currentUsable_)
+            this->currentUsable_->used(this->owner_);
+    }
+    /**
+        @brief Uses a usable item on the owner of the collection.
+        @param item Item to use.
+    */
+    void PickupCollection::useItem(UsableItem* item)
+    {
+        if (item && this->owner_)
+            item->used(this->owner_);
+    }
+    /**
+        @brief Remove an item/all of a type from the collection.
+        @param item Item to remove.
+        @param removeAllOfType Whether to remove all the items with the item's type (default: false).
+    */
+    void PickupCollection::remove(BaseItem* item, bool removeAllOfType)
+    {
+        if (!item || !this->contains(item, removeAllOfType) || this->bBlockRemovals_)
+            return;
+
+        bool getNewUsable = false;
+        if (item == this->currentUsable_ || (this->currentUsable_ && removeAllOfType && this->currentUsable_->getPickupIdentifier() == item->getPickupIdentifier()))
+        {
+            getNewUsable = true;
+        }
+
+        if (removeAllOfType)
+        {
+            std::multimap<std::string, BaseItem*>::iterator it;
+            while ((it = this->items_.find(item->getPickupIdentifier())) != this->items_.end())
+            {
+                this->items_.erase(it);
+            }
+        }
+        else
+        {
+            item_range bounds = this->items_.equal_range(item->getPickupIdentifier());
+            for (std::multimap<std::string, BaseItem*>::iterator it = bounds.first; it != bounds.second && it != this->items_.end(); it++)
+            {
+                if ((*it).second == item)
+                {
+                    this->items_.erase(it);
+                    break;
+                }
+            }
+        }
+
+        if (getNewUsable)
+        {
+            std::deque<UsableItem*> usables = this->getUsableItems();
+
+            if(usables.size() > 0)
+                this->currentUsable_ = usables.at(0);
+            else
+                this->currentUsable_ = NULL;
+
+        }
+    }
+    /**
+        @brief Add an additive modifier.
+        @param type ModifierType to add.
+        @param value Value for the modifier.
+    */
+    void PickupCollection::addAdditiveModifier(ModifierType::Value type, float value)
+    {
+        this->additiveModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
+    }
+    /**
+        @brief Get the total amount of an additive modifier.
+        @param type Type for which to get the total.
+        @return Returns the sum of the additive modifiers of the type.
+    */
+    float PickupCollection::getAdditiveModifier(ModifierType::Value type)
+    {
+        float v = 0.0f;
+
+        modifier_range range = this->additiveModifiers_.equal_range(type);
+
+        for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++)
+        {
+            v += (*it).second;
+        }
+
+        return v;
+    }
+    /**
+        @brief Remove an additive modifier.
+        @param type Type of modifier.
+        @param value Value which is to be removed.
+    */
+    void PickupCollection::removeAdditiveModifier(ModifierType::Value type, float value)
+    {
+        modifier_range range = this->additiveModifiers_.equal_range(type);
+        for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++)
+        {
+            if ((*it).second == value)
+            {
+                this->additiveModifiers_.erase(it);
+                return;
+            }
+        }
+    }
+    /**
+        @brief Add a multiplicative modifier.
+        @param type ModifierType to add.
+        @param value Value for the modifier.
+    */
+    void PickupCollection::addMultiplicativeModifier(ModifierType::Value type, float value)
+    {
+        this->multiplicativeModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
+    }
+    /**
+        @brief Get the total amount of a multiplicative modifier.
+        @param type Type for which to get the total.
+        @return Returns the product of the multiplicative modifiers of the type.
+    */
+    float PickupCollection::getMultiplicativeModifier(ModifierType::Value type)
+    {
+        float v = 1.0f;
+
+        modifier_range range = this->multiplicativeModifiers_.equal_range(type);
+        for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++)
+        {
+            v *= (*it).second;
+        }
+
+        return v;
+    }
+    /**
+        @brief Remove a multiplicative modifier.
+        @param type Type of modifier.
+        @param value Value which is to be removed.
+    */
+    void PickupCollection::removeMultiplicativeModifier(ModifierType::Value type, float value)
+    {
+        modifier_range range = this->multiplicativeModifiers_.equal_range(type);
+        for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++)
+        {
+            if ((*it).second == value)
+            {
+                this->multiplicativeModifiers_.erase(it);
+                return;
+            }
+        }
+    }
+    /**
+        @brief Applies modifiers to a float.
+        @param type Type of modifier tp apply.
+        @param inputValue Value which is to be processed.
+        @param addBeforeMultiplication Whether to apply the additive modifier before the multiplicative one (default: false).
+        @return Returns the value after being processed.
+    */
+    float PickupCollection::processModifiers(ModifierType::Value type, float inputValue, bool addBeforeMultiplication)
+    {
+        float outputValue = inputValue;
+
+        if (addBeforeMultiplication)
+            outputValue += this->getAdditiveModifier(type);
+
+        outputValue *= this->getMultiplicativeModifier(type);
+
+        if (!addBeforeMultiplication)
+            outputValue += this->getAdditiveModifier(type);
+
+        return outputValue;
+    }
+    /**
+        @brief Applies modifiers to a Vector3.
+        @param type Type of modifier tp apply.
+        @param inputValue Value which is to be processed.
+        @param addBeforeMultiplication Whether to apply the additive modifier before the multiplicative one (default: false).
+        @return Returns the value after being processed.
+    */
+    Vector3 PickupCollection::processModifiers(ModifierType::Value type, Vector3 inputValue, bool addBeforeMultiplication)
+    {
+        Vector3 outputValue = inputValue;
+
+        if (addBeforeMultiplication)
+            outputValue += Vector3(this->getAdditiveModifier(type));
+
+        outputValue *= this->getMultiplicativeModifier(type);
+
+        if (!addBeforeMultiplication)
+            outputValue += Vector3(this->getAdditiveModifier(type));
+
+        return outputValue;
+    }
+    /**
+        @brief Get a list of equipment-type items.
+        @return Returns a list of all the equipment-type items in the collection.
+    */
+    std::deque<EquipmentItem*> PickupCollection::getEquipmentItems()
+    {
+        std::deque<EquipmentItem*> ret;
+        Identifier* ident = Class(EquipmentItem);
+
+        for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++)
+        {
+            if ((*it).second->isA(ident))
+                ret.push_back(orxonox_cast<EquipmentItem*>((*it).second));
+        }
+
+        return ret;
+    }
+    /**
+        @brief Get a list of passive items.
+        @return Returns a list of all the passive items in the collection.
+    */
+    std::deque<PassiveItem*> PickupCollection::getPassiveItems()
+    {
+        std::deque<PassiveItem*> ret;
+        Identifier* ident = Class(PassiveItem);
+
+        for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++)
+        {
+            if ((*it).second->isA(ident))
+                ret.push_back(orxonox_cast<PassiveItem*>((*it).second));
+        }
+
+        return ret;
+    }
+    /**
+        @brief Get a list of usable items.
+        @return Returns a list of all the usable items in the collection.
+    */
+    std::deque<UsableItem*> PickupCollection::getUsableItems()
+    {
+        std::deque<UsableItem*> ret;
+        Identifier* ident = Class(UsableItem);
+
+        for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++)
+        {
+            if ((*it).second->isA(ident))
+                ret.push_back(orxonox_cast<UsableItem*>((*it).second));
+        }
+
+        return ret;
+    }
+}
Index: code/trunk/src/orxonox/pickup/PickupCollection.h
===================================================================
--- code/trunk/src/orxonox/pickup/PickupCollection.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/PickupCollection.h	(revision 5781)
@@ -0,0 +1,122 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of PickupCollection.
+*/
+
+#ifndef _PickupCollection_H__
+#define _PickupCollection_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <deque>
+#include <map>
+#include <string>
+
+#include "util/Math.h"
+#include "ModifierType.h"
+
+namespace orxonox
+{
+    /**
+        @brief PickupCollection for organising items.
+        @author Daniel 'Huty' Haggenmueller
+    */
+    class _OrxonoxExport PickupCollection
+    {
+    public:
+        PickupCollection();
+
+        bool add(BaseItem* item);       //!< Add an item to the collection.
+
+        bool checkSlot(BaseItem* item); //!< Check if there's a free slot in the collection for an item.
+
+        void clear();                   //!< Empty the collection
+        bool contains(BaseItem* item, bool anyOfType = false);                      //!< Check if the collection contains an item.
+
+        void remove(BaseItem* item, bool removeAllOfType = false);                  //!< Remove an item from the collection.
+
+        void useItem();                                                             //!< Use the first usable item.
+        void useItem(UsableItem* item);                                             //!< Use a usable item.
+
+        void addAdditiveModifier(ModifierType::Value type, float value);             //!< Add an additive modifier.
+        void addMultiplicativeModifier(ModifierType::Value type, float value);       //!< Add a multiplicative modifier.
+
+        float getAdditiveModifier(ModifierType::Value type);                         //!< Get total additive modifier.
+        float getMultiplicativeModifier(ModifierType::Value type);                   //!< Get total multiplicative modifier.
+
+        void removeAdditiveModifier(ModifierType::Value type, float value);          //!< Remove an additive modifier.
+        void removeMultiplicativeModifier(ModifierType::Value type, float value);    //!< Remove a multiplicative modifier.
+
+        float processModifiers(ModifierType::Value type, float inputValue, bool addBeforeMultiplication = false);        //!< Apply the modifiers to a float.
+        Vector3 processModifiers(ModifierType::Value type, Vector3 inputValue, bool addBeforeMultiplication = false);    //!< Apply the modifiers to a Vector3.
+
+        /**
+            @brief Get the map of contained items.
+            @return The map of items.
+        */
+        std::multimap<std::string, BaseItem*> getItems() const
+            { return this->items_; }
+
+        /**
+            @brief Get the owner of the PickupCollection.
+            @return Returns the pawn which owns the PickupCollection.
+        */
+        inline Pawn* getOwner() const
+            { return this->owner_; }
+        /**
+            @brief Set the owner of the PickupCollection.
+            @param owner The new Pawn which owns the PickupCollection.
+        */
+        inline void setOwner(Pawn* owner)
+            { this->owner_ = owner; }
+
+        inline UsableItem* getCurrentUsable()
+            { return this->currentUsable_; };
+        inline void setCurrentUsable(UsableItem* usable)
+            { this->currentUsable_ = usable; }
+
+        std::deque<EquipmentItem*> getEquipmentItems();   //!< Get a list of equipment-type items.
+        std::deque<PassiveItem*> getPassiveItems();     //!< Get a list of passive items.
+        std::deque<UsableItem*> getUsableItems();      //!< Get a list of usable items.
+    private:
+        Pawn* owner_;           //!< The owner of the PickupCollection.
+        UsableItem* currentUsable_;
+
+        bool bBlockRemovals_;   //!< Whether to block direct removals through remove().
+
+        std::multimap<ModifierType::Value, float> additiveModifiers_;        //!< Contains additive modifiers (indexed by ModifierType).
+        std::multimap<ModifierType::Value, float> multiplicativeModifiers_;  //!< Contains multiplicative modifiers (indexed by ModifierType).
+
+        std::multimap<std::string, BaseItem*> items_;                       //!< Map of items in the collection (indexed by pickupIdentifier of the items).
+    };
+}
+
+#endif /* _PickupCollection_H__ */
Index: code/trunk/src/orxonox/pickup/PickupInventory.cc
===================================================================
--- code/trunk/src/orxonox/pickup/PickupInventory.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/PickupInventory.cc	(revision 5781)
@@ -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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "PickupInventory.h"
+
+#include <CEGUIImage.h>
+#include <CEGUIImageset.h>
+#include <CEGUIImagesetManager.h>
+#include <CEGUIWindow.h>
+#include <CEGUIWindowManager.h>
+#include <elements/CEGUITabControl.h>
+
+#include "core/ConsoleCommand.h"
+#include "core/GUIManager.h"
+#include "core/input/InputManager.h"
+#include "controllers/HumanController.h"
+#include "worldentities/pawns/Pawn.h"
+
+#include "EquipmentItem.h"
+#include "PassiveItem.h"
+#include "UsableItem.h"
+
+
+namespace orxonox
+{
+    SetConsoleCommandShortcut(PickupInventory, toggleInventory);
+
+    PickupInventory* PickupInventory::pickupInventory_s = NULL;
+    PickupInventory* PickupInventory::getSingleton()
+    {
+        if(!PickupInventory::pickupInventory_s)
+            PickupInventory::pickupInventory_s = new PickupInventory();
+
+        return PickupInventory::pickupInventory_s;
+    }
+
+    PickupInventory::PickupInventory()
+    {
+        this->bInventoryVisible_ = false;
+        this->visibleEquipmentWindows_ = this->visibleUsableWIndows_ = 0;
+
+        // Create some windows to avoid creating them while playing
+        CEGUI::WindowManager* winMgr = CEGUI::WindowManager::getSingletonPtr();
+        for(int i = 0; i < 10; i++)
+        {
+            std::ostringstream id;
+            id << i;
+
+            PickupInventory::createItemWindows(winMgr, "equ/" + id.str(), i % 5, i / 5);
+            PickupInventory::createItemWindows(winMgr, "use/" + id.str(), i % 5, i / 5);
+        }
+        this->createdEquipmentWindows_ = this->createdUsableWindows_ = 10;
+    }
+    PickupInventory::~PickupInventory()
+    {
+    }
+
+
+
+    void PickupInventory::toggleInventory()
+    {
+        if(PickupInventory::getSingleton()->isVisible()) {
+            GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
+            GUIManager::getInstance().executeCode("hideCursor()");
+            InputManager::getInstance().leaveState("guiMouseOnly");
+        }
+        else
+        {
+            GUIManager::getInstance().showGUI("PickupInventory");
+            GUIManager::getInstance().executeCode("showCursor()");
+            InputManager::getInstance().enterState("guiMouseOnly");
+        }
+        PickupInventory::getSingleton()->setVisible(!PickupInventory::getSingleton()->isVisible());
+    }
+
+    unsigned int PickupInventory::getCurrentUsableIndex()
+    {
+        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
+        if(pawn && pawn->getPickups().getCurrentUsable())
+        {
+            UsableItem* use = pawn->getPickups().getCurrentUsable();
+            std::deque<UsableItem*> items = pawn->getPickups().getUsableItems();
+            for(unsigned int i = 0; i < items.size(); i++)
+            {
+                if(items.at(i) == use)
+                    return i;
+            }
+        }
+
+        return 0;
+    }
+    bool PickupInventory::isCurrentUsable(const BaseItem* item)
+    {
+        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
+        if(pawn)
+            return (pawn->getPickups().getCurrentUsable() == item);
+        else
+            return false;
+    }
+    void PickupInventory::selectUsable(unsigned int i)
+    {
+        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
+        if(pawn)
+        {
+            std::deque<UsableItem*> items = pawn->getPickups().getUsableItems();
+            if(i < items.size())
+                pawn->getPickups().setCurrentUsable(items.at(i));
+        }
+    }
+
+    unsigned int PickupInventory::getEquipmentCount()
+    {
+        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
+        if(pawn)
+            return pawn->getPickups().getEquipmentItems().size();
+        else
+            return 0;
+    }
+    unsigned int PickupInventory::getUsableCount()
+    {
+        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
+        if(pawn)
+            return pawn->getPickups().getUsableItems().size();
+        else
+            return 0;
+    }
+    unsigned int PickupInventory::getPassiveCount()
+    {
+        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
+        if(pawn)
+            return pawn->getPickups().getPassiveItems().size();
+        else
+            return 0;
+    }
+    BaseItem* PickupInventory::getEquipmentItem(unsigned int i)
+    {
+        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
+        if(pawn)
+        {
+            std::deque<EquipmentItem*> l = pawn->getPickups().getEquipmentItems();
+            if (i >= l.size()) { return NULL; }
+            return l.at(i);
+        }
+        else
+            return NULL;
+    }
+    BaseItem* PickupInventory::getUsableItem(unsigned int i)
+    {
+        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
+        if(pawn)
+        {
+            std::deque<UsableItem*> l = pawn->getPickups().getUsableItems();
+            if (i >= l.size()) { return NULL; }
+            return l.at(i);
+        }
+        else
+            return NULL;
+    }
+    BaseItem* PickupInventory::getPassiveItem(unsigned int i)
+    {
+        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
+        if(pawn)
+        {
+            std::deque<PassiveItem*> l = pawn->getPickups().getPassiveItems();
+            if (i >= l.size()) { return NULL; }
+            return l.at(i);
+        }
+        else
+            return NULL;
+    }
+
+    std::string PickupInventory::getImageForItem(const BaseItem* item)
+    {
+        if(!item)
+            return "";
+
+        std::string name = "pickup_" + item->getGUIImage();
+
+        if(!CEGUI::ImagesetManager::getSingletonPtr()->isImagesetPresent(name))
+        {
+            CEGUI::ImagesetManager::getSingletonPtr()->createImagesetFromImageFile(name, item->getGUIImage(), "");
+        }
+
+        return "set:" + name + " image:full_image";
+    }
+
+    void PickupInventory::clearInventory(CEGUI::WindowManager* winMgr, CEGUI::Window* equipPane, CEGUI::Window* usablePane)
+    {
+        for(unsigned int i = 0; i < this->visibleEquipmentWindows_; i++)
+        {
+            std::ostringstream id;
+            id << i;
+
+            winMgr->getWindow("orxonox/Inventory/Frame/equ/" + id.str())->setVisible(false);
+            winMgr->getWindow("orxonox/Inventory/Title/equ/" + id.str())->setVisible(false);
+            winMgr->getWindow("orxonox/Inventory/Items/equ/" + id.str())->setVisible(false);
+
+            /*equipPane->removeChildWindow("orxonox/Inventory/Frame/equ/" + id.str());
+            equipPane->removeChildWindow("orxonox/Inventory/Title/equ/" + id.str());
+            equipPane->removeChildWindow("orxonox/Inventory/Items/equ/" + id.str());*/
+        }
+        for(unsigned int i = 0; i < this->visibleUsableWIndows_; i++)
+        {
+            std::ostringstream id;
+            id << i;
+
+            winMgr->getWindow("orxonox/Inventory/Frame/use/" + id.str())->setVisible(false);
+            winMgr->getWindow("orxonox/Inventory/Title/use/" + id.str())->setVisible(false);
+            winMgr->getWindow("orxonox/Inventory/Items/use/" + id.str())->setVisible(false);
+
+            /*usablePane->removeChildWindow("orxonox/Inventory/Frame/use/" + id.str());
+            usablePane->removeChildWindow("orxonox/Inventory/Title/use/" + id.str());
+            usablePane->removeChildWindow("orxonox/Inventory/Items/use/" + id.str());*/
+        }
+    }
+    void PickupInventory::updateTabs(CEGUI::WindowManager *winMgr, CEGUI::Window *equipWindow, CEGUI::Window *usableWindow)
+    {
+        this->updateEquipment(winMgr, equipWindow);
+        this->updateUsable(winMgr, usableWindow);
+    }
+
+    void PickupInventory::updateEquipment(CEGUI::WindowManager* winMgr, CEGUI::Window* target)
+    {
+        Pawn* pawn;
+        if((pawn = HumanController::getLocalControllerEntityAsPawn()))
+        {
+            std::deque<EquipmentItem*> items = pawn->getPickups().getEquipmentItems();
+            for(unsigned int i = 0; i < items.size(); i++)
+            {
+                std::ostringstream id;
+                id << "equ/" << i;
+
+                EquipmentItem* item = items.at(i);
+
+                if(this->createdEquipmentWindows_ <= i)
+                {
+                    PickupInventory::createItemWindows(winMgr, id.str(), i % 5, i / 5);
+                    this->createdEquipmentWindows_++;
+                }
+
+                PickupInventory::setWindowProperties(winMgr, target, id.str(), item, "FFFFFFFF");
+            }
+            this->visibleEquipmentWindows_ = items.size();
+        }
+    }
+    void PickupInventory::updateUsable(CEGUI::WindowManager* winMgr, CEGUI::Window* target)
+    {
+        Pawn* pawn;
+        if((pawn = HumanController::getLocalControllerEntityAsPawn()))
+        {
+            std::deque<UsableItem*> items = pawn->getPickups().getUsableItems();
+            for(unsigned int i = 0; i < items.size(); i++)
+            {
+                std::ostringstream id;
+                id << "use/" << i;
+
+                UsableItem* item = items.at(i);
+                std::string colour;
+
+                if(PickupInventory::isCurrentUsable(item))
+                    colour = "FFFF5555";
+                else
+                    colour = "FFFFFFFF";
+
+                if(this->createdUsableWindows_ <= i)
+                {
+                    PickupInventory::createItemWindows(winMgr, id.str(), i % 5, i / 5);
+                    this->createdUsableWindows_++;
+                }
+
+                PickupInventory::setWindowProperties(winMgr, target, id.str(), item, colour);
+            }
+            this->visibleUsableWIndows_ = items.size();
+        }
+    }
+
+    void PickupInventory::createItemWindows(CEGUI::WindowManager* winMgr, const std::string& id, int x, int y)
+    {
+        if(!winMgr) { return; }
+
+        CEGUI::Window* frame = winMgr->createWindow("TaharezLook/StaticImage", "orxonox/Inventory/Frame/" + id);
+        frame->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 5 + x * 70), CEGUI::UDim(0, 5 + y * 90)));
+        frame->setSize(CEGUI::UVector2(CEGUI::UDim(0, 65), CEGUI::UDim(0, 65)));
+        frame->setRiseOnClickEnabled(false);
+        frame->setVisible(false);
+
+        CEGUI::Window* text = winMgr->createWindow("TaharezLook/StaticText", "orxonox/Inventory/Title/" + id);
+        text->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 5 + x * 70), CEGUI::UDim(0, 70 + y * 90)));
+        text->setSize(CEGUI::UVector2(CEGUI::UDim(0, 65), CEGUI::UDim(0, 20)));
+        text->setProperty("FrameEnabled", "False");
+        text->setProperty("BackgroundEnabled", "False");
+        text->setProperty("HorzFormatting", "HorzCentred");
+        text->setProperty("VertFormatting", "VertCentred");
+        text->setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF");
+        text->setVisible(false);
+
+        CEGUI::Window* btn = winMgr->createWindow("TaharezLook/Button", "orxonox/Inventory/Items/" + id);
+        btn->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 8 + x * 70), CEGUI::UDim(0, 8 + y * 90)));
+        btn->setSize(CEGUI::UVector2(CEGUI::UDim(0, 59), CEGUI::UDim(0, 59)));
+        btn->subscribeScriptedEvent("Clicked", "PickupInventory.itemClicked");
+        btn->setVisible(false);
+    }
+    void PickupInventory::setWindowProperties(CEGUI::WindowManager* winMgr, CEGUI::Window* target, const std::string& id, const BaseItem* item, const std::string& textColour)
+    {
+        CEGUI::Window* txt = winMgr->getWindow("orxonox/Inventory/Title/" + id);
+        CEGUI::Window* btn = winMgr->getWindow("orxonox/Inventory/Items/" + id);
+        CEGUI::Window* frm = winMgr->getWindow("orxonox/Inventory/Frame/" + id);
+
+        frm->setVisible(true);
+
+        txt->setVisible(true);
+        txt->setProperty("Text", item->getGUIText());
+        txt->setProperty("TextColours", "tl:" + textColour + " tr:" + textColour + " bl:" + textColour + " br:" + textColour + "");
+
+        std::string image = PickupInventory::getImageForItem(item);
+        btn->setVisible(true);
+        btn->setProperty("NormalImage", image);
+        btn->setProperty("HoverImage", image);
+        btn->setProperty("PushedImage", image);
+        btn->setProperty("DisabledImage", image);
+        btn->setProperty("Tooltip", item->getGUIText());
+
+        target->addChildWindow(frm);
+        target->addChildWindow(txt);
+        target->addChildWindow(btn);
+    }
+}
Index: code/trunk/src/orxonox/pickup/PickupInventory.h
===================================================================
--- code/trunk/src/orxonox/pickup/PickupInventory.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/PickupInventory.h	(revision 5781)
@@ -0,0 +1,98 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Declaration of static class for the inventory GUI window.
+*/
+
+#ifndef _PickupInventory_H__
+#define _PickupInventory_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <CEGUIForwardRefs.h>
+#include "core/BaseObject.h"
+
+// tolua_begin
+namespace orxonox
+{
+    /**
+        @brief Static class for the inventory GUI window.
+        @author Daniel 'Huty' Haggenmueller
+    */
+    class _OrxonoxExport PickupInventory
+    {
+// tolua_end
+    public:
+        PickupInventory();
+        virtual ~PickupInventory();
+
+        static PickupInventory* getSingleton(); // tolua_export
+
+        static void toggleInventory(); // tolua_export
+
+        static unsigned int getEquipmentCount(); // tolua_export
+        static unsigned int getUsableCount(); // tolua_export
+        static unsigned int getPassiveCount(); // tolua_export
+
+        static unsigned int getCurrentUsableIndex(); // tolua_export
+        static bool isCurrentUsable(const BaseItem* item); // tolua_export
+        static void selectUsable(unsigned int i); // tolua_export
+
+        static BaseItem* getEquipmentItem(unsigned int i); // tolua_export
+        static BaseItem* getUsableItem(unsigned int i); // tolua_export
+        static BaseItem* getPassiveItem(unsigned int i); // tolua_export
+
+        static std::string getImageForItem(const BaseItem* item); // tolua_export
+
+        void clearInventory(CEGUI::WindowManager* winMgr, CEGUI::Window* equipPane, CEGUI::Window* usablePane); // tolua_export
+        void updateTabs(CEGUI::WindowManager* winMgr, CEGUI::Window* equipWindow, CEGUI::Window* usableWindow); // tolua_export
+
+        void updateEquipment(CEGUI::WindowManager* winMgr, CEGUI::Window* target);
+        void updateUsable(CEGUI::WindowManager* winMgr, CEGUI::Window* target);
+
+        static void createItemWindows(CEGUI::WindowManager* winMgr, const std::string& id, int x, int y);
+        static void setWindowProperties(CEGUI::WindowManager* winMgr, CEGUI::Window* target, const std::string& id, const BaseItem* item, const std::string& textColour);
+
+        const bool isVisible() const
+            { return this->bInventoryVisible_; }
+        void setVisible(bool visible)
+            { this->bInventoryVisible_ = visible; }
+    private:
+        bool bInventoryVisible_;
+        unsigned int createdEquipmentWindows_;
+        unsigned int createdUsableWindows_;
+        unsigned int visibleEquipmentWindows_;
+        unsigned int visibleUsableWIndows_;
+
+        static PickupInventory* pickupInventory_s;
+    }; // tolua_export
+} // tolua_export
+
+#endif /* _PickupInventory_H__ */
Index: code/trunk/src/orxonox/pickup/PickupSpawner.cc
===================================================================
--- code/trunk/src/orxonox/pickup/PickupSpawner.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/PickupSpawner.cc	(revision 5781)
@@ -0,0 +1,189 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of PickupSpawner.
+*/
+
+#include "PickupSpawner.h"
+
+#include "BaseItem.h"
+
+#include "core/CoreIncludes.h"
+#include "core/GUIManager.h"     // HACK; see below
+#include "core/Template.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+#include "PickupInventory.h"    // HACK; Only for hack, remove later
+
+
+namespace orxonox
+{
+    const float PickupSpawner::bounceSpeed_s = 6.0f;
+    const float PickupSpawner::rotationSpeed_s = 1.0f;
+    const float PickupSpawner::bounceDistance_s = 4.0f;
+
+    CreateFactory(PickupSpawner);
+
+    /**
+        @brief Constructor. Registers the PickupSpawner.
+        @param creator Pointer to the object which created this item.
+    */
+    PickupSpawner::PickupSpawner(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(PickupSpawner);
+
+        this->itemTemplate_ = 0;
+        this->triggerDistance_ = 20;
+        this->respawnTime_ = 0.0f;
+        this->tickSum_ = 0.0f;
+    }
+    //! Deconstructor.
+    PickupSpawner::~PickupSpawner()
+    {
+    }
+    /**
+        @brief Method for creating a PickupSpawner through XML.
+        @param xmlelement XML element which contains the PickupSpawner.
+        @param mode XMLPort mode.
+    */
+    void PickupSpawner::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(PickupSpawner, XMLPort, xmlelement, mode);
+
+        XMLPortParam(PickupSpawner, "item", setItemTemplateName, getItemTemplateName, xmlelement, mode);
+        XMLPortParam(PickupSpawner, "triggerDistance", setTriggerDistance, getTriggerDistance, xmlelement, mode);
+        XMLPortParam(PickupSpawner, "respawnTime", setRespawnTime, getRespawnTime, xmlelement, mode);
+
+        // HACKs
+        // Load the GUI image as soon as the PickupSpawner gets loaded
+        //  = less delays while running
+        BaseObject* newObject = this->itemTemplate_->getBaseclassIdentifier()->fabricate(this);
+        BaseItem* asItem = orxonox_cast<BaseItem*>(newObject);
+        if (asItem)
+        {
+            asItem->addTemplate(this->itemTemplate_);
+            PickupInventory::getImageForItem(asItem);
+            delete newObject;
+        }
+
+        //  & load the GUI itself too, along with some empty windows
+        //   = even less delays
+        GUIManager::getInstance().showGUI("PickupInventory");
+        GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
+        PickupInventory::getSingleton();
+    }
+    /**
+        @brief Invoked when the activity has changed. Sets visibility of attached objects.
+    */
+    void PickupSpawner::changedActivity()
+    {
+        SUPER(PickupSpawner, changedActivity);
+
+        for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
+            (*it)->setVisible(this->isActive());
+    }
+    /**
+        @brief Set the template name of the item to spawn, also loads the template.
+        @param name Name of the new template.
+    */
+    void PickupSpawner::setItemTemplateName(const std::string& name)
+    {
+        this->itemTemplateName_ = name;
+        this->itemTemplate_ = Template::getTemplate(name);
+    }
+    /**
+        @brief Tick, checks if any Pawn is close enough to trigger.
+        @param dt Time since last tick.
+    */
+    void PickupSpawner::tick(float dt)
+    {
+        if (this->isActive())
+        {
+            for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); it++)
+            {
+                Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
+                if (distance.length() < this->triggerDistance_)
+                    this->trigger(*it);
+            }
+            this->yaw(Radian(rotationSpeed_s*dt));
+            this->tickSum_ += bounceSpeed_s*dt;
+            this->translate(Vector3(0,bounceDistance_s*dt*sin(this->tickSum_),0));
+            if (this->tickSum_ > 2*Ogre::Math::PI)
+                this->tickSum_ -= 2*Ogre::Math::PI;
+        }
+    }
+    /**
+        @brief
+            Trigger the PickupSpawner.
+
+            Adds the pickup to the Pawn that triggered,
+            sets the timer to re-activate and deactives the PickupSpawner.
+
+        @param pawn Pawn which triggered the PickupSpawner.
+    */
+    void PickupSpawner::trigger(Pawn* pawn)
+    {
+        if (this->isActive() && this->itemTemplate_ && this->itemTemplate_->getBaseclassIdentifier())
+        {
+            BaseObject* newObject = this->itemTemplate_->getBaseclassIdentifier()->fabricate(this);
+            BaseItem* asItem = orxonox_cast<BaseItem*>(newObject);
+            if (asItem)
+            {
+                asItem->setPickupIdentifier(this->itemTemplateName_);
+                asItem->addTemplate(this->itemTemplate_);
+
+                if (asItem->pickedUp(pawn))
+                {
+                    COUT(3) << this->itemTemplateName_ << " got picked up." << std::endl;
+
+                    if (this->respawnTime_ > 0.0f)
+                    {
+                        ExecutorMember<PickupSpawner>* executor = createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback));
+                        this->respawnTimer_.setTimer(this->respawnTime_, false, this, executor);
+
+                        this->setActive(false);
+                        this->fireEvent();
+                    }
+                }
+                else
+                    delete newObject;
+            }
+        }
+    }
+    /**
+        @brief Invoked by the timer, re-activates the PickupSpawner.
+    */
+    void PickupSpawner::respawnTimerCallback()
+    {
+        COUT(3) << "PickupSpawner reactivated." << std::endl;
+
+        this->setActive(true);
+    }
+}
Index: code/trunk/src/orxonox/pickup/PickupSpawner.h
===================================================================
--- code/trunk/src/orxonox/pickup/PickupSpawner.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/PickupSpawner.h	(revision 5781)
@@ -0,0 +1,120 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of PickupSpawner.
+*/
+
+#ifndef _PickupSpawner_H__
+#define _PickupSpawner_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "tools/Timer.h"
+#include "tools/interfaces/Tickable.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    /**
+        @brief PickupSpawner.
+        @author Daniel 'Huty' Haggenmueller
+    */
+    class _OrxonoxExport PickupSpawner : public StaticEntity, public Tickable
+    {
+    public:
+        PickupSpawner(BaseObject* creator);
+        virtual ~PickupSpawner();
+
+        virtual void changedActivity();                                 //!< Invoked when activity has changed (set visibilty).
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a PickupSpawner through XML.
+        virtual void tick(float dt);
+
+        void trigger(Pawn* pawn);                                       //!< Method called when a Pawn is close enough.
+        void respawnTimerCallback();                                    //!< Method called when the timer runs out.
+
+        /**
+            @brief Get the template name for the item to spawn.
+            @return Returns the name of the template of the item to spawn.
+        */
+        inline const std::string& getItemTemplateName() const
+            { return this->itemTemplateName_; }
+        void setItemTemplateName(const std::string& name);              //!< Set the template name of the item to spawn.
+
+        /**
+            @brief Get the template for the item to spawn.
+            @return Returns the template of the item to spawn.
+        */
+        inline Template* getItemTemplate() const
+            { return this->itemTemplate_; }
+
+        /**
+            @brief Get the distance in which to trigger.
+            @return Returns the distance in which this gets triggered.
+        */
+        inline float getTriggerDistance() const
+            { return this->triggerDistance_; }
+        /**
+            @brief Set the distance in which to trigger.
+            @param value The new distance in which to trigger.
+        */
+        inline void setTriggerDistance(float value)
+            { this->triggerDistance_ = value; }
+
+        /**
+            @brief Get the time to respawn.
+            @returns Returns the time after which this gets re-actived.
+        */
+        inline float getRespawnTime() const
+            { return this->respawnTime_; }
+        /**
+            @brief Set the time to respawn.
+            @param time New time after which this gets re-actived.
+        */
+        inline void setRespawnTime(float time)
+            { this->respawnTime_ = time; }
+    private:
+        std::string itemTemplateName_;          //!< Template name of the item to spawn.
+        Template* itemTemplate_;                //!< Template of the item to spawn.
+
+        float triggerDistance_;                 //!< Distance in which this gets triggered.
+
+        /* Pickup animation */
+        float tickSum_;                         //!< Adds up tick to use in sine movement
+        static const float bounceSpeed_s;       //!< Speed of pickup to bounce up and down
+        static const float bounceDistance_s;    //!< Distance the pickup bounces up and down
+        static const float rotationSpeed_s;     //!< Rotation speed of pickup
+
+        float respawnTime_;                     //!< Time after which this gets re-actived.
+        Timer<PickupSpawner> respawnTimer_;     //!< Timer used for re-activating.
+    };
+}
+
+#endif /* _PickupSpawner_H__ */
Index: code/trunk/src/orxonox/pickup/UsableItem.cc
===================================================================
--- code/trunk/src/orxonox/pickup/UsableItem.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/UsableItem.cc	(revision 5781)
@@ -0,0 +1,47 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+        
+/**
+    @file
+    @brief Implementation of UsableItem.
+*/
+
+#include "UsableItem.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    /**
+        @brief Constructor. Registers the UsableItem.
+        @param creator Pointer to the object which created this item.
+    */
+    UsableItem::UsableItem(BaseObject* creator) : BaseItem(creator) 
+    {
+        RegisterObject(UsableItem);
+    }
+}
Index: code/trunk/src/orxonox/pickup/UsableItem.h
===================================================================
--- code/trunk/src/orxonox/pickup/UsableItem.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/UsableItem.h	(revision 5781)
@@ -0,0 +1,60 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of UsableItem.
+*/
+
+#ifndef _UsableItem_H__
+#define _UsableItem_H__
+
+#include "OrxonoxPrereqs.h"
+#include "BaseItem.h"
+
+namespace orxonox
+{
+    /**
+        @brief Base class for all usable items (not usable yet).
+        @author Daniel 'Huty' Haggenmueller
+    */
+    class _OrxonoxExport UsableItem : public BaseItem
+    {
+    public:
+        UsableItem(BaseObject* creator);
+        virtual ~UsableItem() { }
+
+        /**
+            @brief Method invoked when the item is being used.
+            @param pawn Pawn which is using the item.
+        */
+        virtual void used(Pawn* pawn) { }
+    };
+}
+
+#endif /* _UsableItem_H__ */
Index: code/trunk/src/orxonox/pickup/items/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/pickup/items/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/pickup/items/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,5 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  HealthImmediate.cc
+  HealthUsable.cc
+  Jump.cc
+)
Index: code/trunk/src/orxonox/pickup/items/HealthImmediate.cc
===================================================================
--- code/trunk/src/orxonox/pickup/items/HealthImmediate.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/items/HealthImmediate.cc	(revision 5781)
@@ -0,0 +1,74 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of HealthImmediate.
+*/
+
+#include "HealthImmediate.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateFactory(HealthImmediate);
+
+    HealthImmediate::HealthImmediate(BaseObject* creator) : PassiveItem(creator)
+    {
+        RegisterObject(HealthImmediate);
+
+        this->recoveredHealth_ = 0;
+    }
+    HealthImmediate::~HealthImmediate()
+    {
+    }
+
+    void HealthImmediate::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(HealthImmediate, XMLPort, xmlelement, mode);
+
+        XMLPortParam(HealthImmediate, "recoveredHealth", setRecoveredHealth, getRecoveredHealth, xmlelement, mode);
+    }
+
+    bool HealthImmediate::pickedUp(Pawn* pawn)
+    {
+        float maxH = pawn->getMaxHealth();
+        float curH = pawn->getHealth();
+
+        if (curH < maxH)
+        {
+            pawn->addHealth(this->recoveredHealth_);
+            delete this;
+        }
+
+        return (curH < maxH);
+    }
+}
Index: code/trunk/src/orxonox/pickup/items/HealthImmediate.h
===================================================================
--- code/trunk/src/orxonox/pickup/items/HealthImmediate.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/items/HealthImmediate.h	(revision 5781)
@@ -0,0 +1,65 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of HealthImmediate.
+*/
+
+#ifndef _HealthImmediate_H__
+#define _HealthImmediate_H__
+
+#include "OrxonoxPrereqs.h"
+#include "pickup/PassiveItem.h"
+
+namespace orxonox
+{
+    /**
+        @brief Health-item, immediatly recovers health when picked up.
+    */
+    class _OrxonoxExport HealthImmediate : public PassiveItem
+    {
+    public:
+        HealthImmediate(BaseObject* creator);
+        virtual ~HealthImmediate();
+
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+        virtual bool pickedUp(Pawn* pawn);
+
+        inline float getRecoveredHealth() const
+            { return this->recoveredHealth_; }
+        inline void setRecoveredHealth(float recovery)
+            { this->recoveredHealth_ = recovery; }
+
+    private:
+        float recoveredHealth_;
+    };
+}
+
+#endif /* _HealthImmediate_H__ */
Index: code/trunk/src/orxonox/pickup/items/HealthUsable.cc
===================================================================
--- code/trunk/src/orxonox/pickup/items/HealthUsable.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/items/HealthUsable.cc	(revision 5781)
@@ -0,0 +1,104 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of HealthUsable.
+*/
+
+#include "HealthUsable.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "pickup/DroppedItem.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateFactory(HealthUsable);
+
+    /**
+        @brief Constructor
+        @param creator Object that created this item.
+    */
+    HealthUsable::HealthUsable(BaseObject* creator) : UsableItem(creator)
+    {
+        RegisterObject(HealthUsable);
+
+        this->recoveredHealth_ = 0;
+    }
+    //! Deconstructor
+    HealthUsable::~HealthUsable()
+    {
+    }
+    /**
+        @brief XMLPort for Jump.
+        @param xmlelement Element of the XML-file.
+        @param mode XMLPort mode to use.
+    */
+    void HealthUsable::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(HealthUsable, XMLPort, xmlelement, mode);
+
+        XMLPortParam(HealthUsable, "recoveredHealth", setRecoveredHealth, getRecoveredHealth, xmlelement, mode);
+    }
+    /**
+        @brief Called when the item is used, makes the user "jump".
+        @param pawn Pawn which used te item.
+    */
+    void HealthUsable::used(Pawn* pawn)
+    {
+        float maxH = pawn->getMaxHealth();
+        float curH = pawn->getHealth();
+
+        if (curH < maxH) {
+            pawn->addHealth(this->recoveredHealth_);
+
+            this->removeFrom(pawn);
+            delete this;
+        }
+    }
+    /**
+        @brief Called when the item is picked up.
+        @param pawn Pawn which picked up the item.
+    */
+    bool HealthUsable::pickedUp(Pawn* pawn)
+    {
+        return this->addTo(pawn);
+    }
+    /**
+        @brief Called when the item is dropped, creates a DroppedItem behind the pawn.
+        @param pawn Pawn which dropped the item.
+    */
+    bool HealthUsable::dropped(Pawn* pawn)
+    {
+        DroppedItem::createDefaultDrop(this, pawn, ColourValue(1.0f, 0.0f, 0.0f), 30.0f);
+        return this->removeFrom(pawn);
+    }
+}
Index: code/trunk/src/orxonox/pickup/items/HealthUsable.h
===================================================================
--- code/trunk/src/orxonox/pickup/items/HealthUsable.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/items/HealthUsable.h	(revision 5781)
@@ -0,0 +1,80 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of HealthUsable.
+*/
+
+#ifndef _HealthUsable_H__
+#define _HealthUsable_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <climits>
+#include "pickup/UsableItem.h"
+
+namespace orxonox
+{
+    /**
+        @brief Health-item, enables player recover health when used.
+    */
+    class _OrxonoxExport HealthUsable : public UsableItem
+    {
+    public:
+        HealthUsable(BaseObject* creator);      //!< Constructor
+        virtual ~HealthUsable();                //!< Deconstructor
+
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< XMLPort
+
+        virtual int getMaxCarryAmount() const
+            { return INT_MAX; }
+
+        virtual void used(Pawn* pawn);          //!< Called when the item is used.
+
+        virtual bool pickedUp(Pawn* pawn);      //!< Called when the item is picked up.
+        virtual bool dropped(Pawn* pawn);       //!< Called when the item is dropped.
+
+        /**
+            @brief Get the amount of jumps available.
+            @return Returns how many times the item can be used.
+        */
+        inline float getRecoveredHealth() const
+            { return this->recoveredHealth_; }
+        /**
+            @brief Set the amount of jumps available.
+            @param num New number of available jumps.
+        */
+        inline void setRecoveredHealth(float recovery)
+            { this->recoveredHealth_ = recovery; }
+    private:
+        float recoveredHealth_;    //!< Amount of jumps still available.
+    };
+}
+
+#endif /* _HealthUsable_H__ */
Index: code/trunk/src/orxonox/pickup/items/Jump.cc
===================================================================
--- code/trunk/src/orxonox/pickup/items/Jump.cc	(revision 5781)
+++ code/trunk/src/orxonox/pickup/items/Jump.cc	(revision 5781)
@@ -0,0 +1,106 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of Jump.
+*/
+
+#include "Jump.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "pickup/DroppedItem.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateFactory(Jump);
+
+    /**
+        @brief Constructor
+        @param creator Object that created this item.
+    */
+    Jump::Jump(BaseObject* creator) : UsableItem(creator)
+    {
+        RegisterObject(Jump);
+
+        this->velocity_ = Vector3(0.0f, 0.0f, 0.0f);
+        this->jumpsAvailable_ = 1;
+    }
+    //! Deconstructor
+    Jump::~Jump()
+    {
+    }
+    /**
+        @brief XMLPort for Jump.
+        @param xmlelement Element of the XML-file.
+        @param mode XMLPort mode to use.
+    */
+    void Jump::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Jump, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Jump, "velocity", setVelocity, getVelocity, xmlelement, mode);
+        XMLPortParam(Jump, "jumpsAvailable", setJumpsAvailable, getJumpsAvailable, xmlelement, mode);
+    }
+    /**
+        @brief Called when the item is used, makes the user "jump".
+        @param pawn Pawn which used the item.
+    */
+    void Jump::used(Pawn* pawn)
+    {
+        if (this->jumpsAvailable_ > 0){
+            pawn->setVelocity(pawn->getVelocity() + pawn->getOrientation() * this->velocity_);
+        }
+
+        this->jumpsAvailable_--;
+        if (this->jumpsAvailable_ <= 0)
+        {
+            this->removeFrom(pawn);
+            delete this;
+        }
+    }
+    /**
+        @brief Called when the item is picked up.
+        @param pawn Pawn which picked up the item.
+    */
+    bool Jump::pickedUp(Pawn* pawn)
+    {
+        return this->addTo(pawn);
+    }
+    /**
+        @brief Called when the item is dropped, creates a DroppedItem behind the pawn.
+        @param pawn Pawn which dropped the item.
+    */
+    bool Jump::dropped(Pawn* pawn)
+    {
+        DroppedItem::createDefaultDrop(this, pawn, ColourValue(1.0f, 0.0f, 0.0f), 30.0f);
+        return this->removeFrom(pawn);
+    }
+}
Index: code/trunk/src/orxonox/pickup/items/Jump.h
===================================================================
--- code/trunk/src/orxonox/pickup/items/Jump.h	(revision 5781)
+++ code/trunk/src/orxonox/pickup/items/Jump.h	(revision 5781)
@@ -0,0 +1,96 @@
+/*
+ *   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:
+ *      Daniel 'Huty' Haggenmueller
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of Jump.
+*/
+
+#ifndef _Jump_H__
+#define _Jump_H__
+
+#include <climits>
+
+#include "OrxonoxPrereqs.h"
+
+#include <climits>
+#include "util/Math.h"
+#include "pickup/UsableItem.h"
+
+namespace orxonox
+{
+    /**
+        @brief Jump-item, enables player to "jump" into a direction.
+    */
+    class _OrxonoxExport Jump : public UsableItem
+    {
+    public:
+        Jump(BaseObject* creator);      //!< Constructor
+        virtual ~Jump();                //!< Deconstructor
+
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< XMLPort
+
+        virtual int getMaxCarryAmount() const
+            { return INT_MAX; }
+
+        virtual void used(Pawn* pawn);          //!< Called when the item is used.
+
+        virtual bool pickedUp(Pawn* pawn);      //!< Called when the item is picked up.
+        virtual bool dropped(Pawn* pawn);       //!< Called when the item is dropped.
+
+        /**
+            @brief Get the velocity added when the item is used.
+            @return Returns the added velocity (relative to the Pawn).
+        */
+        inline const Vector3& getVelocity() const
+            { return this->velocity_; }
+        /**
+            @brief Set the velocity added when the item is used.
+            @param velocity New added velocity (relative to Pawn).
+        */
+        inline void setVelocity(const Vector3& velocity)
+            { this->velocity_ = velocity; }
+        /**
+            @brief Get the amount of jumps available.
+            @return Returns how many times the item can be used.
+        */
+        inline int getJumpsAvailable() const
+            { return this->jumpsAvailable_; }
+        /**
+            @brief Set the amount of jumps available.
+            @param num New number of available jumps.
+        */
+        inline void setJumpsAvailable(int num)
+            { this->jumpsAvailable_ = num; }
+    private:
+        Vector3 velocity_;      //!< The velocity added when the item is used.
+        int jumpsAvailable_;    //!< Amount of jumps still available.
+    };
+}
+
+#endif /* _Jump_H__ */
Index: code/trunk/src/orxonox/sound/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/sound/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/sound/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,6 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+    SoundManager.cc
+    SoundBase.cc
+    SoundMainMenu.cc
+)
+
Index: code/trunk/src/orxonox/sound/SoundBase.cc
===================================================================
--- code/trunk/src/orxonox/sound/SoundBase.cc	(revision 5781)
+++ code/trunk/src/orxonox/sound/SoundBase.cc	(revision 5781)
@@ -0,0 +1,240 @@
+/*
+ *   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:
+ *       Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "SoundBase.h"
+
+#include <string>
+#include <vector>
+#include <AL/alut.h>
+#include <vorbis/vorbisfile.h>
+
+#include "util/Math.h"
+#include "core/Core.h"
+#include "core/Resource.h"
+#include "worldentities/WorldEntity.h"
+#include "SoundManager.h"
+
+namespace orxonox
+{
+    SoundBase::SoundBase(WorldEntity* entity)
+    {
+        this->source_ = 0;
+        this->buffer_ = 0;
+        this->entity_ = entity;
+
+        SoundManager::getInstance().addSound(this);
+    }
+
+    SoundBase::~SoundBase()
+    {
+        alSourcei(this->source_, AL_BUFFER, 0);
+        alDeleteSources(1, &this->source_);
+        alDeleteBuffers(1, &this->buffer_);
+    }
+
+    void SoundBase::attachToEntity(WorldEntity* entity)
+    {
+        this->entity_ = entity;
+        this->update();
+    }
+
+    void SoundBase::update() {
+        if(this->entity_ != NULL && alIsSource(this->source_)) {
+            const Vector3& pos = this->entity_->getPosition();
+            alSource3f(this->source_, AL_POSITION, pos.x, pos.y, pos.z);
+            ALenum error = alGetError();
+            if(error == AL_INVALID_VALUE)
+                COUT(2) << "Sound: OpenAL: Invalid sound position" << std::endl;
+
+            const Vector3& vel = this->entity_->getVelocity();
+            alSource3f(this->source_, AL_VELOCITY, vel.x, vel.y, vel.z);
+            error = alGetError();
+            if(error == AL_INVALID_VALUE)
+                COUT(2) << "Sound: OpenAL: Invalid sound velocity" << std::endl;
+
+            const Quaternion& orient = this->entity_->getOrientation();
+            Vector3 at = orient.zAxis();
+            alSource3f(this->source_, AL_DIRECTION, at.x, at.y, at.z);
+            error = alGetError();
+            if(error == AL_INVALID_VALUE)
+                COUT(2) << "Sound: OpenAL: Invalid sound direction" << std::endl;
+        }
+    }
+
+    void SoundBase::play(bool loop) {
+        if(alIsSource(this->source_)) {
+            if(loop)
+                alSourcei(this->source_, AL_LOOPING, AL_TRUE);
+            else
+                alSourcei(this->source_, AL_LOOPING, AL_FALSE);
+            alSourcePlay(this->source_);
+
+            if(alGetError() != AL_NO_ERROR)
+            {
+                 COUT(2) << "Sound: OpenAL: Error playin sound " << this->source_ << std::endl;
+            }
+        }
+    }
+
+    void SoundBase::stop() {
+        if(alIsSource(this->source_)) {
+            alSourceStop(this->source_);
+        }
+    }
+
+    void SoundBase::pause() {
+        if(alIsSource(this->source_)) {
+            alSourcePause(this->source_);
+        }
+    }
+
+    bool SoundBase::isPlaying() {
+        if(alIsSource(this->source_)) {
+            return getSourceState() == AL_PLAYING;
+        }
+        return false;
+    }
+
+    bool SoundBase::isPaused() {
+        if(alIsSource(this->source_)) {
+            return getSourceState() == AL_PAUSED;
+        }
+        return true;
+    }
+
+    bool SoundBase::isStopped() {
+        if(alIsSource(this->source_)) {
+            return getSourceState() == AL_INITIAL || getSourceState() == AL_STOPPED;
+        }
+        return true;
+    }
+
+    bool SoundBase::loadFile(const std::string& filename) {
+        if(!SoundManager::getInstance().isSoundAvailable())
+        {
+            COUT(3) << "Sound: not available, skipping " << filename << std::endl;
+            return false;
+        }
+
+        COUT(3) << "Sound: OpenAL ALUT: loading file " << filename << std::endl;
+        // Get DataStream from the resources
+        shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename);
+        if (fileInfo == NULL) {
+            COUT(2) << "Warning: Sound file '" << filename << "' not found" << std::endl;
+            return false;
+        }
+        DataStreamPtr stream = Resource::open(filename);
+        // Read everything into a temporary buffer
+        char* buffer = new char[fileInfo->size];
+        stream->read(buffer, fileInfo->size);
+
+        this->buffer_ = alutCreateBufferFromFileImage(buffer, fileInfo->size);
+        delete[] buffer;
+
+        if(this->buffer_ == AL_NONE) {
+            COUT(2) << "Sound: OpenAL ALUT: " << alutGetErrorString(alutGetError()) << std::endl;
+            if(filename.find("ogg", 0) != std::string::npos)
+            {
+                COUT(2) << "Sound: Trying fallback ogg loader" << std::endl;
+                this->buffer_ = loadOggFile(filename);
+            }
+
+            if(this->buffer_ == AL_NONE)
+            {
+                COUT(2) << "Sound: fallback ogg loader failed: " << alutGetErrorString(alutGetError()) << std::endl;
+                return false;
+            }
+        }
+
+        alGenSources(1, &this->source_);
+        alSourcei(this->source_, AL_BUFFER, this->buffer_);
+        if(alGetError() != AL_NO_ERROR) {
+            COUT(2) << "Sound: OpenAL: Error loading sample file: " << filename << std::endl;
+            return false;
+        }
+        return true;
+    }
+
+    ALint SoundBase::getSourceState() {
+        ALint state;
+        alGetSourcei(this->source_, AL_SOURCE_STATE, &state);
+        return state;
+    }
+
+    ALuint SoundBase::loadOggFile(const std::string& filename)
+    {
+        char inbuffer[4096];
+        std::vector<char> outbuffer;
+        OggVorbis_File vf;
+        vorbis_info* vorbisInfo;
+        int eof = false;
+        int current_section;
+        ALuint buffer;
+        ALenum format;
+
+        FILE* f = fopen(filename.c_str(), "rb");
+
+        if(ov_open(f, &vf, NULL, 0) < 0)
+        {
+            COUT(2) << "Sound: libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << std::endl;
+            ov_clear(&vf);
+            return AL_NONE;
+        }
+
+        while(!eof)
+        {
+            long ret = ov_read(&vf, inbuffer, sizeof(inbuffer), 0, 2, 1, &current_section);
+            if (ret == 0)
+            {
+                eof = true;
+            }
+            else if (ret < 0)
+            {
+                COUT(2) << "Sound: libvorbisfile: error reading the file" << std::endl;
+                ov_clear(&vf);
+                return AL_NONE;
+            }
+            else
+            {
+                outbuffer.insert(outbuffer.end(), inbuffer, inbuffer + sizeof(inbuffer));
+            }
+        }
+
+        vorbisInfo = ov_info(&vf, -1);
+        if(vorbisInfo->channels == 1)
+            format = AL_FORMAT_MONO16;
+        else
+            format = AL_FORMAT_STEREO16;
+
+        alGenBuffers(1, &buffer);
+        alBufferData(buffer, format, &outbuffer[0], outbuffer.size(), vorbisInfo->rate);
+        ov_clear(&vf);
+
+        return buffer;
+    }
+} // namespace: orxonox
Index: code/trunk/src/orxonox/sound/SoundBase.h
===================================================================
--- code/trunk/src/orxonox/sound/SoundBase.h	(revision 5781)
+++ code/trunk/src/orxonox/sound/SoundBase.h	(revision 5781)
@@ -0,0 +1,69 @@
+/*
+ *   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:
+ *       Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      ...
+ *
+ */
+#ifndef _SoundBase_H__
+#define _SoundBase_H__
+
+#include "OrxonoxPrereqs.h"
+#include <cstring> // define NULL
+
+namespace orxonox
+{
+    /**
+     * The SoundBase class is the base class for all sound file loader classes.
+     * It server as main interface to the OpenAL library.
+     *
+     */
+    class _OrxonoxExport SoundBase
+    {
+    public:
+        SoundBase(WorldEntity* entity = NULL);
+        ~SoundBase();
+
+        void attachToEntity(WorldEntity* entity);
+        void update();
+        void play(bool loop = false);
+        void stop();
+        void pause();
+
+        bool isPlaying();
+        bool isPaused();
+        bool isStopped();
+
+        bool loadFile(const std::string& filename);
+
+    private:
+        ALuint loadOggFile(const std::string& filename);
+        ALuint source_;
+        ALuint buffer_;
+        WorldEntity* entity_;
+
+        ALint getSourceState();
+    }; // class SoundBase
+} // namepsace orxonox
+
+#endif /* _SoundBase_H__ */
Index: code/trunk/src/orxonox/sound/SoundMainMenu.cc
===================================================================
--- code/trunk/src/orxonox/sound/SoundMainMenu.cc	(revision 5781)
+++ code/trunk/src/orxonox/sound/SoundMainMenu.cc	(revision 5781)
@@ -0,0 +1,47 @@
+/*
+ *   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:
+ *       Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "SoundMainMenu.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+
+namespace orxonox
+{
+    SoundMainMenu::SoundMainMenu()
+    {
+        RegisterObject(SoundMainMenu);
+        setConfigValues();
+        loadFile(this->filename_);
+    }
+
+    void SoundMainMenu::setConfigValues()
+    {
+        SetConfigValue(filename_, "ambient/mainmenu.wav");
+    }
+}
Index: code/trunk/src/orxonox/sound/SoundMainMenu.h
===================================================================
--- code/trunk/src/orxonox/sound/SoundMainMenu.h	(revision 5781)
+++ code/trunk/src/orxonox/sound/SoundMainMenu.h	(revision 5781)
@@ -0,0 +1,51 @@
+/*
+ *   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:
+ *       Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _SoundMainMenu_H__
+#define _SoundMainMenu_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "core/OrxonoxClass.h"
+#include "SoundBase.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport SoundMainMenu : public SoundBase, public virtual OrxonoxClass
+    {
+        public:
+            SoundMainMenu();
+            void setConfigValues();
+
+        private:
+            std::string filename_;
+    };
+}
+
+#endif /* _SoundMainMenu_H__ */
Index: code/trunk/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/trunk/src/orxonox/sound/SoundManager.cc	(revision 5781)
+++ code/trunk/src/orxonox/sound/SoundManager.cc	(revision 5781)
@@ -0,0 +1,168 @@
+/*
+ *   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:
+ *       Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "SoundManager.h"
+
+#include <AL/alut.h>
+
+#include "util/Math.h"
+#include "CameraManager.h"
+#include "graphics/Camera.h"
+#include "SoundBase.h"
+
+namespace orxonox
+{
+    SoundManager* SoundManager::singletonPtr_s = NULL;
+
+    /**
+     * Default constructor
+     */
+    SoundManager::SoundManager()
+    {
+        this->device_ = NULL;
+        this->soundavailable_ = true;
+        if(!alutInitWithoutContext(NULL,NULL))
+        {
+            COUT(2) << "Sound: OpenAL ALUT: " << alutGetErrorString(alutGetError()) << std::endl;
+            this->soundavailable_ = false;
+        }
+        else
+        {
+            assert(this->device_ == NULL);
+            COUT(3) << "Sound: OpenAL: Open sound device..." << std::endl;
+            this->device_ = alcOpenDevice(NULL);
+
+            if(this->device_ == NULL)
+            {
+                COUT(2) << "Sound: OpenAL: Could not open sound device" << std::endl;
+                this->soundavailable_ = false;
+            }
+            else
+            {
+                COUT(3) << "Sound: OpenAL: Sound device opened" << std::endl;
+                this->context_ = alcCreateContext(this->device_, NULL);
+                if(this->context_ == NULL)
+                {
+                    COUT(2) << "Sound: OpenAL: Could not create sound context" << std::endl;
+                    this->soundavailable_ = false;
+                }
+                else
+                {
+                    if(alcMakeContextCurrent(this->context_) == AL_TRUE)
+                        COUT(3) << "Sound: OpenAL: Context " << this->context_ << " loaded" << std::endl;
+
+                    COUT(4) << "Sound: OpenAL ALUT version: " << alutGetMajorVersion() << "." << alutGetMinorVersion() << std::endl;
+                    const char* str = alutGetMIMETypes(ALUT_LOADER_BUFFER);
+                    if (str == NULL)
+                        COUT(2) << "Sound: OpenAL ALUT: " << alutGetErrorString(alutGetError()) << std::endl;
+                    else
+                        COUT(4) << "Sound: OpenAL ALUT supported MIME types: " << str << std::endl;
+                }
+            }
+        }
+    }
+
+    SoundManager::~SoundManager()
+    {
+        alcDestroyContext(this->context_);
+        alcCloseDevice(this->device_);
+        alutExit();
+    }
+
+    /**
+     * Add a SoundBase object to the list. Every SoundBase object should be in
+     * this list.
+     *
+     * @param sound Pointer to the SoundBase object to add
+     */
+    void SoundManager::addSound(SoundBase* sound)
+    {
+        this->soundlist_.push_back(sound);
+    }
+
+    /**
+     * Remove a SoundBase object from the list and destroy it.
+     */
+    void SoundManager::removeSound(SoundBase* sound)
+    {
+        std::list<SoundBase*>::iterator pos = this->soundlist_.end();
+        for(std::list<SoundBase*>::iterator i = this->soundlist_.begin(); i != this->soundlist_.end(); i++)
+        {
+            if((*i) == sound)
+                pos = i;
+        }
+
+        delete (*pos);
+        this->soundlist_.erase(pos);
+    }
+
+    /**
+     * Tick function, updates listener and registred SoundBase objects
+     *
+     * @param dt @see Orxonox::Tickable
+     */
+    void SoundManager::tick(float dt)
+    {
+        if (!CameraManager::getInstancePtr())
+            return;
+
+        // update listener position
+        Camera* camera = CameraManager::getInstance().getActiveCamera();
+        if(camera == NULL) return;
+        Vector3 pos = camera->getPosition();
+        alListener3f(AL_POSITION, pos.x, pos.y, pos.z);
+        ALenum error = alGetError();
+        if(error == AL_INVALID_VALUE)
+            COUT(2) << "Sound: OpenAL: Invalid listener position" << std::endl;
+
+        // update listener orientation
+        const Quaternion& orient = camera->getOrientation();
+        Vector3 up = orient.xAxis(); // just a wild guess
+        Vector3 at = orient.zAxis();
+
+        ALfloat orientation[6] = { at.x, at.y, at.z,
+                                 up.x, up.y, up.z };
+
+        alListenerfv(AL_POSITION, orientation);
+        error = alGetError();
+        if(error == AL_INVALID_VALUE)
+            COUT(2) << "Sound: OpenAL: Invalid listener orientation" << std::endl;
+
+        // update sounds
+        for(std::list<SoundBase*>::iterator i = this->soundlist_.begin(); i != this->soundlist_.end(); i++)
+            (*i)->update();
+    }
+
+    /**
+    * Check if sound is available
+    */
+    bool SoundManager::isSoundAvailable()
+    {
+        return this->soundavailable_;
+    }
+}
Index: code/trunk/src/orxonox/sound/SoundManager.h
===================================================================
--- code/trunk/src/orxonox/sound/SoundManager.h	(revision 5781)
+++ code/trunk/src/orxonox/sound/SoundManager.h	(revision 5781)
@@ -0,0 +1,66 @@
+/*
+ *   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:
+ *       Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      ...
+ */
+#ifndef _SoundManager_H__
+#define _SoundManager_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <cassert>
+#include <list>
+#include "util/Singleton.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+    /**
+     * The SoundManager class manages the OpenAL device, context and listener
+     * position. It has a list of all SoundBase objects and calls their update
+     * function every tick. It is a singleton.
+     *
+     */
+    class _OrxonoxExport SoundManager : public Singleton<SoundManager>, public Tickable
+    {
+        friend class Singleton<SoundManager>;
+    public:
+        SoundManager();
+        ~SoundManager();
+        void addSound(SoundBase* sound);
+        void removeSound(SoundBase* sound);
+        void tick(float dt);
+        bool isSoundAvailable();
+
+    private:
+        ALCdevice* device_;
+        ALCcontext* context_;
+        std::list<SoundBase*> soundlist_;
+        bool soundavailable_;
+
+        static SoundManager* singletonPtr_s;
+    }; // class SoundManager
+} // namespace orxonox
+
+#endif /* _SoundManager_H__ */
Index: code/trunk/src/orxonox/weaponsystem/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/weaponsystem/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,10 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  Munition.cc
+  Weapon.cc
+  WeaponMode.cc
+  WeaponPack.cc
+  WeaponSet.cc
+  WeaponSlot.cc
+  WeaponSystem.cc
+  DefaultWeaponmodeLink.cc
+)
Index: code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.cc	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.cc	(revision 5781)
@@ -0,0 +1,58 @@
+/*
+ *   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 "DefaultWeaponmodeLink.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(DefaultWeaponmodeLink);
+
+    DefaultWeaponmodeLink::DefaultWeaponmodeLink(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(DefaultWeaponmodeLink);
+
+        this->firemode_ = WeaponSystem::FIRE_MODE_UNASSIGNED;
+        this->weaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
+    }
+
+    DefaultWeaponmodeLink::~DefaultWeaponmodeLink()
+    {
+    }
+
+    void DefaultWeaponmodeLink::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(DefaultWeaponmodeLink, XMLPort, xmlelement, mode);
+
+        XMLPortParam(DefaultWeaponmodeLink, "firemode",   setFiremode,   getFiremode,   xmlelement, mode);
+        XMLPortParam(DefaultWeaponmodeLink, "weaponmode", setWeaponmode, getWeaponmode, xmlelement, mode);
+    }
+}
Index: code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.h	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/DefaultWeaponmodeLink.h	(revision 5781)
@@ -0,0 +1,62 @@
+/*
+ *   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 _DefaultWeaponmodeLink_H__
+#define _DefaultWeaponmodeLink_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport DefaultWeaponmodeLink : public BaseObject
+    {
+        public:
+            DefaultWeaponmodeLink(BaseObject* creator);
+            virtual ~DefaultWeaponmodeLink();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            inline void setFiremode(const unsigned int firemode)
+                { this->firemode_ = firemode; }
+            inline unsigned int getFiremode() const
+                { return this->firemode_; }
+
+            inline void setWeaponmode(const unsigned int weaponmode)
+                { this->weaponmode_ = weaponmode; }
+            inline unsigned int getWeaponmode() const
+                { return this->weaponmode_; }
+
+        private:
+            unsigned int firemode_;
+            unsigned int weaponmode_;
+    };
+}
+
+#endif /* _DefaultWeaponmodeLink_H__ */
Index: code/trunk/src/orxonox/weaponsystem/Munition.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Munition.cc	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/Munition.cc	(revision 5781)
@@ -0,0 +1,477 @@
+/*
+ *   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.
+ *
+ *   Authors:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Munition.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(Munition);
+
+    Munition::Munition(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(Munition);
+
+        this->maxMunitionPerMagazine_ = 10;
+        this->maxMagazines_ = 10;
+        this->magazines_ = 10;
+
+        this->bUseSeparateMagazines_ = false;
+        this->bStackMunition_ = true;
+        this->bAllowMunitionRefilling_ = true;
+        this->bAllowMultiMunitionRemovementUnderflow_ = true;
+
+        this->reloadTime_ = 0;
+    }
+
+    Munition::~Munition()
+    {
+        for (std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.begin(); it != this->currentMagazines_.end(); ++it)
+            delete it->second;
+    }
+
+    Munition::Magazine* Munition::getMagazine(WeaponMode* user) const
+    {
+        if (this->bUseSeparateMagazines_)
+        {
+            // For separated magazines we definitively need a given user
+            if (!user)
+                return 0;
+
+            // Use the map to get the magazine assigned to the given user
+            std::map<WeaponMode*, Magazine*>::const_iterator it = this->currentMagazines_.find(user);
+            if (it != this->currentMagazines_.end())
+                return it->second;
+        }
+        else
+        {
+            // We don't use separate magazines for each user, so just take the first magazine
+            if (this->currentMagazines_.size() > 0)
+                return this->currentMagazines_.begin()->second;
+        }
+
+        return 0;
+    }
+
+    unsigned int Munition::getNumMunition(WeaponMode* user) const
+    {
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine)
+        {
+            if (this->bStackMunition_)
+                // With stacked munition every magazine contributes to the total amount
+                return this->maxMunitionPerMagazine_ * this->magazines_ + magazine->munition_;
+            else
+                // Wihtout stacked munition we just consider the current magazine
+                return magazine->munition_;
+        }
+        return 0;
+    }
+
+    unsigned int Munition::getNumMunitionInCurrentMagazine(WeaponMode* user) const
+    {
+        // In contrast to getNumMunition() we really just consider the current magazine, even if we're stacking munition
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine)
+            return magazine->munition_;
+        else
+            return 0;
+    }
+
+    unsigned int Munition::getNumMagazines() const
+    {
+        if (this->bStackMunition_)
+        {
+            // If we stack munition and the current magazine is still full, it counts too
+            Magazine* magazine = this->getMagazine(0);
+            if (magazine && magazine->munition_ == this->maxMunitionPerMagazine_)
+                return this->magazines_ + 1;
+        }
+
+        return this->magazines_;
+    }
+
+    unsigned int Munition::getMaxMunition() const
+    {
+        if (this->bStackMunition_)
+            return this->maxMunitionPerMagazine_ * this->maxMagazines_;
+        else
+            return this->maxMunitionPerMagazine_;
+    }
+
+    bool Munition::canTakeMunition(unsigned int amount, WeaponMode* user) const
+    {
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine && magazine->bLoaded_)
+        {
+            unsigned int munition = magazine->munition_;
+
+            // If we stack munition, we con't care about the current magazine - we just need enough munition in total
+            if (this->bStackMunition_)
+                munition += this->maxMunitionPerMagazine_ * this->magazines_;
+
+            if (munition == 0)
+                // Absolutely no munition - no chance to take munition
+                return false;
+            else if (this->bAllowMultiMunitionRemovementUnderflow_)
+                // We're not empty AND we allow underflow, so this will always work
+                return true;
+            else
+                // We don't allow underflow, so we have to check the amount
+                return (munition >= amount);
+        }
+        return false;
+    }
+
+    bool Munition::takeMunition(unsigned int amount, WeaponMode* user)
+    {
+        if (!this->canTakeMunition(amount, user))
+            return false;
+
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine && magazine->bLoaded_)
+        {
+            if (magazine->munition_ >= amount)
+            {
+                // Enough munition
+                magazine->munition_ -= amount;
+                return true;
+            }
+            else
+            {
+                // Not enough munition
+                if (this->bStackMunition_)
+                {
+                    // We stack munition, so just take what we can and then load the next magazine
+                    amount -= magazine->munition_;
+                    magazine->munition_ = 0;
+
+                    if (this->reload(0))
+                        // Successfully reloaded, continue recursively
+                        return this->takeMunition(amount, 0);
+                    else
+                        // We don't have more magazines, so let's just hope we allow underflow
+                        return this->bAllowMultiMunitionRemovementUnderflow_;
+                }
+                else
+                {
+                    // We don't stack, so we can only take munition if this is allowed
+                    if (magazine->munition_ > 0 && this->bAllowMultiMunitionRemovementUnderflow_)
+                    {
+                        magazine->munition_ -= 0;
+                        return true;
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    bool Munition::canReload() const
+    {
+        // As long as we have enough magazines (and don't stack munition) we can reload
+        return (this->magazines_ > 0 && !this->bStackMunition_);
+    }
+
+    bool Munition::needReload(WeaponMode* user) const
+    {
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine)
+        {
+            if (this->bStackMunition_)
+                // With stacked munition, we never have to reload
+                return false;
+            else
+                // We need to reload if an already loaded magazine is empty
+                return (magazine->bLoaded_ && magazine->munition_ == 0);
+        }
+        else
+            // No magazine - we definitively need to reload
+            return true;
+    }
+
+    bool Munition::reload(WeaponMode* user, bool bUseReloadTime)
+    {
+        // Don't reload if we're already reloading
+        Magazine* magazine = this->getMagazine(user);
+        if (magazine && !magazine->bLoaded_)
+            return false;
+
+        // Check if we actually can reload
+        if (this->magazines_ == 0)
+            return false;
+
+        // If we use separate magazines for each user, we definitively need a user given
+        if (this->bUseSeparateMagazines_ && !user)
+            return false;
+
+        // If we don't use separate magazines, set user to 0
+        if (!this->bUseSeparateMagazines_)
+            user = 0;
+
+        // Remove the current magazine for the given user
+        std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.find(user);
+        if (it != this->currentMagazines_.end())
+        {
+            delete it->second;
+            this->currentMagazines_.erase(it);
+        }
+
+        // Load a new magazine
+        this->currentMagazines_[user] = new Magazine(this, bUseReloadTime);
+        this->magazines_--;
+
+        return true;
+    }
+
+    bool Munition::canAddMunition(unsigned int amount) const
+    {
+        if (!this->bAllowMunitionRefilling_)
+            return false;
+
+        if (this->bStackMunition_)
+        {
+            // If we stack munition, we can always add munition until we reach the limit
+            return (this->getNumMunition(0) < this->getMaxMunition());
+        }
+        else
+        {
+            // Return true if any of the current magazines is not full (loading counts as full although it returns 0 munition)
+            for (std::map<WeaponMode*, Magazine*>::const_iterator it = this->currentMagazines_.begin(); it != this->currentMagazines_.end(); ++it)
+                if (it->second->munition_ < this->maxMunitionPerMagazine_ && it->second->bLoaded_)
+                    return true;
+        }
+
+        return false;
+    }
+
+    bool Munition::addMunition(unsigned int amount)
+    {
+        if (!this->canAddMunition(amount))
+            return false;
+
+        if (this->bStackMunition_)
+        {
+            // Stacking munition means, if a magazine gets full, the munition adds to a new magazine
+            Magazine* magazine = this->getMagazine(0);
+            if (magazine)
+            {
+                // Add the whole amount
+                magazine->munition_ += amount;
+
+                // Add new magazines if the current magazine is overfull
+                while (magazine->munition_ > this->maxMunitionPerMagazine_)
+                {
+                    magazine->munition_ -= this->maxMunitionPerMagazine_;
+                    this->magazines_++;
+                }
+
+                // If we reached the limit, reduze both magazines and munition to the maximum
+                if (this->magazines_ >= this->maxMagazines_)
+                {
+                    this->magazines_ = this->maxMagazines_ - 1;
+                    magazine->munition_ = this->maxMunitionPerMagazine_;
+                }
+
+                return true;
+            }
+
+            // Something went wrong
+            return false;
+        }
+        else
+        {
+            // Share the munition equally to the current magazines
+            while (amount > 0)
+            {
+                bool change = false;
+                for (std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.begin(); it != this->currentMagazines_.end(); ++it)
+                {
+                    // Add munition if the magazine isn't full (but only to loaded magazines)
+                    if (amount > 0 && it->second->munition_ < this->maxMunitionPerMagazine_ && it->second->bLoaded_)
+                    {
+                        it->second->munition_++;
+                        amount--;
+                        change = true;
+                    }
+                }
+
+                // If there was no change in a loop, all magazines are full (or locked due to loading)
+                if (!change)
+                    break;
+            }
+
+            return true;
+        }
+    }
+
+    bool Munition::canAddMagazines(unsigned int amount) const
+    {
+        if (this->bStackMunition_)
+            // If we stack munition, we can always add new magazines because they contribute directly to the munition
+            return (this->getNumMunition(0) < this->getMaxMunition());
+        else
+            // If we don't stack munition, we're more limited
+            return ((this->currentMagazines_.size() + this->magazines_) < this->maxMagazines_);
+    }
+
+    bool Munition::addMagazines(unsigned int amount)
+    {
+        if (!this->canAddMagazines(amount))
+            return false;
+
+        // Calculate how many magazines are needed
+        int needed_magazines = this->maxMagazines_ - this->magazines_ - this->currentMagazines_.size();
+
+        // If zero or less magazines are needed, we definitively don't need more magazines (unless we stack munition - then a magazine contributes directly to the munition)
+        if (needed_magazines <= 0 && !this->bStackMunition_)
+            return false;
+
+        if (amount <= static_cast<unsigned int>(needed_magazines))
+        {
+            // We need more magazines than we get, so just add them
+            this->magazines_ += amount;
+        }
+        else
+        {
+            // We get more magazines than we need, so just add the needed amount
+            this->magazines_ += needed_magazines;
+            if (this->bStackMunition_)
+            {
+                // We stack munition, so the additional amount contributes directly to the munition of the current magazine
+                Magazine* magazine = this->getMagazine(0);
+                if (magazine)
+                    magazine->munition_ = this->maxMunitionPerMagazine_;
+            }
+        }
+
+        return true;
+    }
+
+    bool Munition::canRemoveMagazines(unsigned int amount) const
+    {
+        if (this->bStackMunition_)
+        {
+            if (this->magazines_ >= amount)
+            {
+                // We have enough magazines
+                return true;
+            }
+            else if (this->magazines_ == amount - 1)
+            {
+                // We lack one magazine, check if the current magazine is still full, if yes we're fine
+                Magazine* magazine = this->getMagazine(0);
+                if (magazine && magazine->munition_ == this->maxMunitionPerMagazine_)
+                    return true;
+            }
+            else
+            {
+                // We don't have enough magazines
+                return false;
+            }
+        }
+        else
+        {
+            // In case we're not stacking munition, just check the number of magazines
+            return (this->magazines_ >= amount);
+        }
+
+        return false;
+    }
+
+    bool Munition::removeMagazines(unsigned int amount)
+    {
+        if (!this->canRemoveMagazines(amount))
+            return false;
+
+        if (this->magazines_ >= amount)
+        {
+            // We have enough magazines, just remove the amount
+            this->magazines_ -= amount;
+        }
+        else if (this->bStackMunition_)
+        {
+            // We don't have enough magazines, but we're stacking munition, so additionally remove the bullets from the current magazine
+            this->magazines_ = 0;
+            Magazine* magazine = this->getMagazine(0);
+            if (magazine)
+                magazine->munition_ = 0;
+        }
+
+        return true;
+    }
+
+    bool Munition::dropMagazine(WeaponMode* user)
+    {
+        // If we use separate magazines, we need a user
+        if (this->bUseSeparateMagazines_ && !user)
+            return false;
+
+        // If we don't use separate magazines, set user to 0
+        if (!this->bUseSeparateMagazines_)
+            user = 0;
+
+        // Remove the current magazine for the given user
+        std::map<WeaponMode*, Magazine*>::iterator it = this->currentMagazines_.find(user);
+        if (it != this->currentMagazines_.end())
+        {
+            delete it->second;
+            this->currentMagazines_.erase(it);
+            return true;
+        }
+
+        return false;
+    }
+
+
+    /////////////////////
+    // Magazine struct //
+    /////////////////////
+    Munition::Magazine::Magazine(Munition* munition, bool bUseReloadTime)
+    {
+        this->munition_ = 0;
+        this->bLoaded_ = false;
+
+        if (bUseReloadTime && (munition->reloadTime_ > 0 || munition->bStackMunition_))
+        {
+            ExecutorMember<Magazine>* executor = createExecutor(createFunctor(&Magazine::loaded));
+            executor->setDefaultValues(munition);
+
+            this->loadTimer_.setTimer(munition->reloadTime_, false, this, executor);
+        }
+        else
+            this->loaded(munition);
+    }
+
+    void Munition::Magazine::loaded(Munition* munition)
+    {
+        this->bLoaded_ = true;
+        this->munition_ = munition->maxMunitionPerMagazine_;
+    }
+}
Index: code/trunk/src/orxonox/weaponsystem/Munition.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Munition.h	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/Munition.h	(revision 5781)
@@ -0,0 +1,108 @@
+/*
+ *   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.
+ *
+ *   Authors:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Munition_H__
+#define _Munition_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include "core/BaseObject.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Munition : public BaseObject
+    {
+        struct Magazine
+        {
+            public:
+                Magazine(Munition* munition, bool bUseReloadTime = true);
+
+                unsigned int munition_;
+                Timer<Magazine> loadTimer_;
+                bool bLoaded_;
+
+            private:
+                void loaded(Munition* munition);
+        };
+
+        public:
+            Munition(BaseObject* creator);
+            virtual ~Munition();
+
+            unsigned int getNumMunition(WeaponMode* user) const;
+            unsigned int getNumMunitionInCurrentMagazine(WeaponMode* user) const;
+            unsigned int getNumMagazines() const;
+
+            unsigned int getMaxMunition() const;
+            inline unsigned int getMaxMagazines() const
+                { return this->maxMagazines_; }
+            inline unsigned int getMaxMunitionPerMagazine() const
+                { return this->maxMunitionPerMagazine_; }
+
+            bool canTakeMunition(unsigned int amount, WeaponMode* user) const;
+            bool takeMunition(unsigned int amount, WeaponMode* user);
+
+            bool canReload() const;
+            bool needReload(WeaponMode* user) const;
+            bool reload(WeaponMode* user, bool bUseReloadTime = true);
+            inline float getReloadTime() const
+                { return this->reloadTime_; }
+
+            bool canAddMunition(unsigned int amount) const;
+            bool addMunition(unsigned int amount);
+
+            bool canAddMagazines(unsigned int amount) const;
+            bool addMagazines(unsigned int amount);
+
+            bool canRemoveMagazines(unsigned int amount) const;
+            bool removeMagazines(unsigned int amount);
+
+            bool dropMagazine(WeaponMode* user);
+
+        protected:
+            unsigned int maxMunitionPerMagazine_;
+            unsigned int maxMagazines_;
+            unsigned int magazines_;
+            std::map<WeaponMode*, Magazine*> currentMagazines_;
+
+            bool bUseSeparateMagazines_;
+            bool bStackMunition_;
+            bool bAllowMunitionRefilling_;
+            bool bAllowMultiMunitionRemovementUnderflow_;
+
+            float reloadTime_;
+
+        private:
+            Magazine* getMagazine(WeaponMode* user) const;
+    };
+}
+
+#endif /* _Munition_H__ */
Index: code/trunk/src/orxonox/weaponsystem/Weapon.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Weapon.cc	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/Weapon.cc	(revision 5781)
@@ -0,0 +1,149 @@
+/*
+ *   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:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Weapon.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "WeaponMode.h"
+#include "WeaponPack.h"
+#include "WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(Weapon);
+
+    Weapon::Weapon(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(Weapon);
+
+        this->weaponPack_ = 0;
+        this->weaponSlot_ = 0;
+        this->bReloading_ = false;
+        this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
+
+        this->reloadTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&Weapon::reloaded)));
+        this->reloadTimer_.stopTimer();
+    }
+
+    Weapon::~Weapon()
+    {
+        if (this->isInitialized())
+        {
+            if (this->weaponPack_)
+                this->weaponPack_->removeWeapon(this);
+
+            for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
+                delete it->second;
+        }
+    }
+
+    void Weapon::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Weapon, XMLPort, xmlelement, mode);
+
+        XMLPortObject(Weapon, WeaponMode, "", addWeaponmode, getWeaponmode, xmlelement, mode);
+    }
+
+    void Weapon::addWeaponmode(WeaponMode* weaponmode)
+    {
+        if (!weaponmode)
+            return;
+
+        this->weaponmodes_.insert(std::pair<unsigned int, WeaponMode*>(weaponmode->getMode(), weaponmode));
+        weaponmode->setWeapon(this);
+    }
+
+    WeaponMode* Weapon::getWeaponmode(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::multimap<unsigned int, WeaponMode*>::const_iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
+        {
+            if (i == index)
+                return it->second;
+
+            ++i;
+        }
+        return 0;
+    }
+
+    void Weapon::fire(unsigned int mode)
+    {
+        // To avoid firing with more than one mode at the same time, we lock the weapon (reloading) for
+        // all modes except the one which is currently reloading.
+        //
+        // Example:
+        // WeaponMode A -> mode 0
+        // WeaponMode B -> mode 0
+        // WeaponMode C -> mode 1
+        //
+        // -> A and B can fire at the same time, but C has to wait until both (A and B) have reloaded
+        // -> If C fires, A and B have to wait until C has reloaded
+        //
+        // Note: The reloading of each WeaponMode is internally handled by each A, B and C.
+        //       The reloading of the weapon is only performed to avoid firing with different modes at the same time.
+        if (this->bReloading_ && this->reloadingWeaponmode_ != mode)
+            return;
+
+        std::multimap<unsigned int, WeaponMode*>::iterator start = this->weaponmodes_.lower_bound(mode);
+        std::multimap<unsigned int, WeaponMode*>::iterator end   = this->weaponmodes_.upper_bound(mode);
+
+        for (std::multimap<unsigned int, WeaponMode*>::iterator it = start; it != end; ++it)
+        {
+            float reloading_time = 0;
+            if (it->second->fire(&reloading_time))
+            {
+                this->bReloading_ = true;
+                this->reloadingWeaponmode_ = mode;
+
+                this->reloadTimer_.setInterval(reloading_time);
+                this->reloadTimer_.startTimer();
+            }
+        }
+    }
+
+    void Weapon::reload()
+    {
+        for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
+            it->second->reload();
+    }
+
+    void Weapon::reloaded()
+    {
+        this->bReloading_ = false;
+        this->reloadingWeaponmode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
+    }
+
+    void Weapon::notifyWeaponModes()
+    {
+        for (std::multimap<unsigned int, WeaponMode*>::iterator it = this->weaponmodes_.begin(); it != this->weaponmodes_.end(); ++it)
+            it->second->setWeapon(this);
+    }
+}
Index: code/trunk/src/orxonox/weaponsystem/Weapon.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/Weapon.h	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/Weapon.h	(revision 5781)
@@ -0,0 +1,79 @@
+/*
+ *   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:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Weapon_H__
+#define _Weapon_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include "tools/Timer.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Weapon : public StaticEntity
+    {
+        public:
+            Weapon(BaseObject* creator);
+            virtual ~Weapon();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void fire(unsigned int mode);
+            void reload();
+
+            void addWeaponmode(WeaponMode* weaponmode);
+            WeaponMode* getWeaponmode(unsigned int index) const;
+
+            inline void setWeaponPack(WeaponPack * weaponPack)
+                { this->weaponPack_ = weaponPack; this->notifyWeaponModes(); }
+            inline WeaponPack * getWeaponPack() const
+                { return this->weaponPack_; }
+
+            inline void setWeaponSlot(WeaponSlot * wSlot)
+                { this->weaponSlot_ = wSlot; }
+            inline WeaponSlot * getWeaponSlot() const
+                { return this->weaponSlot_; }
+
+        private:
+            void reloaded();
+            void notifyWeaponModes();
+
+            WeaponPack* weaponPack_;
+            WeaponSlot* weaponSlot_;
+            std::multimap<unsigned int, WeaponMode*> weaponmodes_;
+
+            Timer<Weapon> reloadTimer_;
+            bool bReloading_;
+            unsigned int reloadingWeaponmode_;
+    };
+}
+
+#endif /* _Weapon_H__ */
Index: code/trunk/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponMode.cc	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/WeaponMode.cc	(revision 5781)
@@ -0,0 +1,219 @@
+/*
+ *   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:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "WeaponMode.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "Munition.h"
+#include "Weapon.h"
+#include "WeaponPack.h"
+#include "WeaponSystem.h"
+
+namespace orxonox
+{
+    WeaponMode::WeaponMode(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(WeaponMode);
+
+        this->weapon_ = 0;
+        this->mode_ = WeaponSystem::WEAPON_MODE_UNASSIGNED;
+
+        this->munition_ = 0;
+        this->initialMunition_ = 0;
+        this->initialMagazines_ = 0;
+        this->munitionPerShot_ = 1;
+
+        this->reloadTime_ = 0.25;
+        this->bReloading_ = false;
+        this->bAutoReload_ = true;
+        this->bParallelReload_ = true;
+
+        this->reloadTimer_.setTimer(0.0f, false, this, createExecutor(createFunctor(&WeaponMode::reloaded)));
+        this->reloadTimer_.stopTimer();
+
+        this->damage_ = 0;
+        this->muzzleOffset_ = Vector3::ZERO;
+    }
+
+    WeaponMode::~WeaponMode()
+    {
+    }
+
+    void WeaponMode::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponMode, XMLPort, xmlelement, mode);
+
+        XMLPortParam(WeaponMode, "mode",             setMode,             getMode,             xmlelement, mode);
+
+        XMLPortParam(WeaponMode, "munitiontype",     setMunitionName,     getMunitionName,     xmlelement, mode);
+        XMLPortParam(WeaponMode, "initialmunition",  setInitialMunition,  getInitialMunition,  xmlelement, mode);
+        XMLPortParam(WeaponMode, "initialmagazines", setInitialMagazines, getInitialMagazines, xmlelement, mode);
+        XMLPortParam(WeaponMode, "munitionpershot",  setMunitionPerShot,  getMunitionPerShot,  xmlelement, mode);
+
+        XMLPortParam(WeaponMode, "reloadtime",       setReloadTime,       getReloadTime,       xmlelement, mode);
+        XMLPortParam(WeaponMode, "autoreload",       setAutoReload,       getAutoReload,       xmlelement, mode).description("If true, the weapon reloads the magazine automatically");
+        XMLPortParam(WeaponMode, "parallelreload",   setParallelReload,   getParallelReload,   xmlelement, mode).description("If true, the weapon reloads in parallel to the magazine reloading");
+
+        XMLPortParam(WeaponMode, "damage",           setDamage,           getDamage,           xmlelement, mode);
+        XMLPortParam(WeaponMode, "muzzleoffset",     setMuzzleOffset,     getMuzzleOffset,     xmlelement, mode);
+    }
+
+    bool WeaponMode::fire(float* reloadTime)
+    {
+        (*reloadTime) = this->reloadTime_;
+
+        if (!this->bReloading_ && this->munition_ && this->munition_->takeMunition(this->munitionPerShot_, this))
+        {
+            float reloadtime = this->reloadTime_;
+
+            if (this->bAutoReload_ && this->munition_->needReload(this))
+            {
+                if (this->munition_->reload(this))
+                {
+                    if (!this->bParallelReload_)
+                        reloadtime += this->munition_->getReloadTime();
+                }
+            }
+
+            this->bReloading_ = true;
+            this->reloadTimer_.setInterval(reloadtime);
+            this->reloadTimer_.startTimer();
+
+            this->fire();
+
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+    bool WeaponMode::reload()
+    {
+        if (this->munition_ && this->munition_->reload(this))
+        {
+            if (!this->bParallelReload_)
+            {
+                this->bReloading_ = true;
+                this->reloadTimer_.setInterval(this->reloadTime_ + this->munition_->getReloadTime());
+                this->reloadTimer_.startTimer();
+            }
+
+            return true;
+        }
+
+        return false;
+    }
+
+    void WeaponMode::setMunitionType(Identifier* identifier)
+    {
+        this->munitionname_ = identifier->getName();
+        this->munitiontype_ = identifier;
+        this->updateMunition();
+    }
+
+    void WeaponMode::setMunitionName(const std::string& munitionname)
+    {
+        this->munitionname_ = munitionname;
+        this->munitiontype_ = ClassByString(this->munitionname_);
+        this->updateMunition();
+    }
+
+    void WeaponMode::updateMunition()
+    {
+        if (this->munitiontype_ && this->weapon_ && this->weapon_->getWeaponPack() && this->weapon_->getWeaponPack()->getWeaponSystem())
+        {
+            this->munition_ = this->weapon_->getWeaponPack()->getWeaponSystem()->getMunition(&this->munitiontype_);
+
+            if (this->munition_)
+            {
+                // Add the initial magazines
+                this->munition_->addMagazines(this->initialMagazines_);
+
+                // Maybe we have to reload (if this munition is used the first time or if there weren't any magazines available before)
+                if (this->munition_->needReload(this))
+                    this->munition_->reload(this, false);
+
+                // Add the initial munition
+                if (this->initialMunition_ > 0 && this->munition_->getNumMunitionInCurrentMagazine(this) == this->munition_->getMaxMunitionPerMagazine())
+                {
+                    // The current magazine is still full, so let's just add another magazine to
+                    // the stack and reduce the current magazine to the given amount of munition
+
+                    unsigned int initialmunition = this->initialMunition_;
+                    if (initialmunition > this->munition_->getMaxMunitionPerMagazine())
+                        initialmunition = this->munition_->getMaxMunitionPerMagazine();
+
+                    this->munition_->takeMunition(this->munition_->getMaxMunitionPerMagazine() - initialmunition, this);
+                    this->munition_->addMagazines(1);
+                }
+                else
+                {
+                    // The current magazine isn't full, add the munition directly
+
+                    this->munition_->addMunition(this->initialMunition_);
+                }
+            }
+        }
+        else
+            this->munition_ = 0;
+    }
+
+    void WeaponMode::reloaded()
+    {
+        this->bReloading_ = false;
+    }
+
+    Vector3 WeaponMode::getMuzzlePosition() const
+    {
+        if (this->weapon_)
+            return (this->weapon_->getWorldPosition() + this->weapon_->getWorldOrientation() * this->muzzleOffset_);
+        else
+            return this->muzzleOffset_;
+    }
+
+    const Quaternion& WeaponMode::getMuzzleOrientation() const
+    {
+        if (this->weapon_)
+            return this->weapon_->getWorldOrientation();
+        else
+            return Quaternion::IDENTITY;
+    }
+
+    Vector3 WeaponMode::getMuzzleDirection() const
+    {
+        if (this->weapon_)
+            return (this->weapon_->getWorldOrientation() * WorldEntity::FRONT);
+        else
+            return WorldEntity::FRONT;
+    }
+}
Index: code/trunk/src/orxonox/weaponsystem/WeaponMode.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponMode.h	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/WeaponMode.h	(revision 5781)
@@ -0,0 +1,157 @@
+/*
+ *   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:
+ *      Martin Polak
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _WeaponMode_H__
+#define _WeaponMode_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "util/Math.h"
+#include "core/BaseObject.h"
+#include "core/Identifier.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WeaponMode : public BaseObject
+    {
+        public:
+            WeaponMode(BaseObject* creator);
+            virtual ~WeaponMode();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            bool fire(float* reloadTime);
+            bool reload();
+
+
+            // Munition
+            inline Munition* getMunition() const
+                { return this->munition_; }
+
+            void setMunitionType(Identifier* identifier);
+            inline Identifier* getMunitionType() const
+                { return this->munitiontype_; }
+
+            void setMunitionName(const std::string& munitionname);
+            inline const std::string& getMunitionName() const
+                { return this->munitionname_; }
+
+            inline void setInitialMunition(unsigned int amount)
+                { this->initialMunition_ = amount; }
+            inline unsigned int getInitialMunition() const
+                { return this->initialMunition_; }
+
+            inline void setInitialMagazines(unsigned int amount)
+                { this->initialMagazines_ = amount; }
+            inline unsigned int getInitialMagazines() const
+                { return this->initialMagazines_; }
+
+            inline void setMunitionPerShot(unsigned int amount)
+                { this->munitionPerShot_ = amount; }
+            inline unsigned int getMunitionPerShot() const
+                { return this->munitionPerShot_; }
+
+
+            // Reloading
+            inline void setReloadTime(float time)
+                { this->reloadTime_ = time; }
+            inline float getReloadTime() const
+                { return this->reloadTime_; }
+
+            inline void setAutoReload(bool autoreload)
+                { this->bAutoReload_ = autoreload; }
+            inline bool getAutoReload() const
+                { return this->bAutoReload_; }
+
+            inline void setParallelReload(bool parallelreload)
+                { this->bParallelReload_ = parallelreload; }
+            inline bool getParallelReload() const
+                { return this->bParallelReload_; }
+
+
+            // Fire
+            inline void setDamage(float damage)
+                { this->damage_ = damage; }
+            inline float getDamage() const
+                { return this->damage_; }
+
+            inline void setMuzzleOffset(const Vector3& offset)
+                { this->muzzleOffset_ = offset; }
+            inline const Vector3& getMuzzleOffset() const
+                { return this->muzzleOffset_; }
+
+            Vector3 getMuzzlePosition() const;
+            const Quaternion& getMuzzleOrientation() const;
+            Vector3 getMuzzleDirection() const;
+
+
+            // Weapon
+            inline void setWeapon(Weapon* weapon)
+                { this->weapon_ = weapon; this->updateMunition(); }
+            inline Weapon* getWeapon() const
+                { return this->weapon_; }
+
+            inline void setMode(unsigned int mode)
+                { this->mode_ = mode; }
+            inline unsigned int getMode() const
+                { return this->mode_; }
+
+        protected:
+            virtual void fire() = 0;
+
+            unsigned int initialMunition_;
+            unsigned int initialMagazines_;
+            unsigned int munitionPerShot_;
+
+            float reloadTime_;
+            bool bAutoReload_;
+            bool bParallelReload_;
+
+            float damage_;
+            Vector3 muzzleOffset_;
+
+        private:
+            void updateMunition();
+            void reloaded();
+
+            Weapon* weapon_;
+            unsigned int mode_;
+
+            Munition* munition_;
+            SubclassIdentifier<Munition> munitiontype_;
+            std::string munitionname_;
+
+            Timer<WeaponMode> reloadTimer_;
+            bool bReloading_;
+    };
+}
+
+#endif /* _WeaponMode_H__ */
Index: code/trunk/src/orxonox/weaponsystem/WeaponPack.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponPack.cc	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/WeaponPack.cc	(revision 5781)
@@ -0,0 +1,147 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "WeaponPack.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "Weapon.h"
+#include "WeaponSystem.h"
+#include "DefaultWeaponmodeLink.h"
+
+namespace orxonox
+{
+    CreateFactory(WeaponPack);
+
+    WeaponPack::WeaponPack(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(WeaponPack);
+
+        this->weaponSystem_ = 0;
+    }
+
+    WeaponPack::~WeaponPack()
+    {
+        if (this->isInitialized() && this->weaponSystem_)
+        {
+            this->weaponSystem_->removeWeaponPack(this);
+
+            while (!this->weapons_.empty())
+                delete (*this->weapons_.begin());
+
+            for (std::set<DefaultWeaponmodeLink*>::iterator it = this->links_.begin(); it != this->links_.end(); )
+                delete (*(it++));
+        }
+    }
+
+    void WeaponPack::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponPack, XMLPort, xmlelement, mode);
+
+        XMLPortObjectExtended(WeaponPack, Weapon, "", addWeapon, getWeapon, xmlelement, mode, false, false);
+        XMLPortObject(WeaponPack, DefaultWeaponmodeLink, "links", addDefaultWeaponmodeLink, getDefaultWeaponmodeLink, xmlelement, mode);
+    }
+
+    void WeaponPack::fire(unsigned int weaponmode)
+    {
+        for (std::set<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+            (*it)->fire(weaponmode);
+    }
+
+    void WeaponPack::reload()
+    {
+        for (std::set<Weapon *>::iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+            (*it)->reload();
+    }
+
+    void WeaponPack::addWeapon(Weapon * weapon)
+    {
+        if (!weapon)
+            return;
+
+        this->weapons_.insert(weapon);
+        weapon->setWeaponPack(this);
+    }
+
+    void WeaponPack::removeWeapon(Weapon * weapon)
+    {
+        if (!weapon)
+            return;
+
+        this->weapons_.erase(weapon);
+        weapon->setWeaponPack(0);
+    }
+
+    Weapon * WeaponPack::getWeapon(unsigned int index) const
+    {
+        unsigned int i = 0;
+
+        for (std::set<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+
+        return 0;
+    }
+
+    void WeaponPack::addDefaultWeaponmodeLink(DefaultWeaponmodeLink* link)
+    {
+        this->links_.insert(link);
+    }
+
+    DefaultWeaponmodeLink* WeaponPack::getDefaultWeaponmodeLink(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::set<DefaultWeaponmodeLink*>::const_iterator it = this->links_.begin(); it != this->links_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+
+            ++i;
+        }
+        return 0;
+    }
+
+    unsigned int WeaponPack::getDesiredWeaponmode(unsigned int firemode) const
+    {
+        for (std::set<DefaultWeaponmodeLink*>::const_iterator it = this->links_.begin(); it != this->links_.end(); ++it)
+            if ((*it)->getFiremode() == firemode)
+                return (*it)->getWeaponmode();
+
+        return WeaponSystem::WEAPON_MODE_UNASSIGNED;
+    }
+
+    void WeaponPack::notifyWeapons()
+    {
+        for (std::set<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
+            (*it)->setWeaponPack(this);
+    }
+}
Index: code/trunk/src/orxonox/weaponsystem/WeaponPack.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponPack.h	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/WeaponPack.h	(revision 5781)
@@ -0,0 +1,77 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _WeaponPack_H__
+#define _WeaponPack_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <set>
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WeaponPack : public BaseObject
+    {
+        public:
+            WeaponPack(BaseObject* creator);
+            virtual ~WeaponPack();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void fire(unsigned int weaponmode);
+            void reload();
+
+            void addWeapon(Weapon * weapon);
+            void removeWeapon(Weapon * weapon);
+            Weapon * getWeapon(unsigned int index) const;
+
+            inline size_t getNumWeapons() const
+                { return this->weapons_.size(); }
+
+            void addDefaultWeaponmodeLink(DefaultWeaponmodeLink* link);
+            DefaultWeaponmodeLink* getDefaultWeaponmodeLink(unsigned int index) const;
+
+            unsigned int getDesiredWeaponmode(unsigned int firemode) const;
+
+            inline void setWeaponSystem(WeaponSystem * weaponSystem)
+                { this->weaponSystem_ = weaponSystem; this->notifyWeapons(); }
+            inline WeaponSystem * getWeaponSystem() const
+                { return this->weaponSystem_; }
+
+        private:
+            void notifyWeapons();
+
+            std::set<Weapon *> weapons_;
+            std::set<DefaultWeaponmodeLink *> links_;
+            WeaponSystem * weaponSystem_;
+    };
+}
+
+#endif /* _WeaponPack_H__ */
Index: code/trunk/src/orxonox/weaponsystem/WeaponSet.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSet.cc	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSet.cc	(revision 5781)
@@ -0,0 +1,95 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "WeaponSet.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "WeaponSystem.h"
+#include "WeaponPack.h"
+
+namespace orxonox
+{
+    CreateFactory(WeaponSet);
+
+    WeaponSet::WeaponSet(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(WeaponSet);
+
+        this->weaponSystem_ = 0;
+        this->desiredFiremode_ = WeaponSystem::FIRE_MODE_UNASSIGNED;
+    }
+
+    WeaponSet::~WeaponSet()
+    {
+        if (this->isInitialized() && this->weaponSystem_)
+            this->weaponSystem_->removeWeaponSet(this);
+    }
+
+    void WeaponSet::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponSet, XMLPort, xmlelement, mode);
+
+        XMLPortParam(WeaponSet, "firemode", setDesiredFiremode, getDesiredFiremode, xmlelement, mode);
+    }
+
+    void WeaponSet::fire()
+    {
+        // fire all WeaponPacks with their defined weaponmode
+        for (std::map<WeaponPack*, unsigned int>::iterator it = this->weaponpacks_.begin(); it != this->weaponpacks_.end(); ++it)
+            if (it->second != WeaponSystem::WEAPON_MODE_UNASSIGNED)
+                it->first->fire(it->second);
+    }
+
+    void WeaponSet::reload()
+    {
+        // fire all WeaponPacks with their defined weaponmode
+        for (std::map<WeaponPack*, unsigned int>::iterator it = this->weaponpacks_.begin(); it != this->weaponpacks_.end(); ++it)
+            it->first->reload();
+    }
+
+    void WeaponSet::setWeaponmodeLink(WeaponPack* weaponpack, unsigned int weaponmode)
+    {
+        this->weaponpacks_[weaponpack] = weaponmode;
+    }
+
+    void WeaponSet::removeWeaponmodeLink(WeaponPack* weaponpack)
+    {
+        this->weaponpacks_.erase(weaponpack);
+    }
+
+    unsigned int WeaponSet::getWeaponmodeLink(WeaponPack* weaponpack)
+    {
+        std::map<WeaponPack*, unsigned int>::iterator it = this->weaponpacks_.find(weaponpack);
+        if (it != this->weaponpacks_.end())
+            return it->second;
+        else
+            return WeaponSystem::WEAPON_MODE_UNASSIGNED;
+    }
+}
Index: code/trunk/src/orxonox/weaponsystem/WeaponSet.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSet.h	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSet.h	(revision 5781)
@@ -0,0 +1,72 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _WeaponSet_H__
+#define _WeaponSet_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WeaponSet : public BaseObject
+    {
+        public:
+            WeaponSet(BaseObject* creator);
+            virtual ~WeaponSet();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void fire();
+            void reload();
+
+            void setWeaponmodeLink(WeaponPack* weaponpack, unsigned int weaponmode);
+            void removeWeaponmodeLink(WeaponPack* weaponpack);
+            unsigned int getWeaponmodeLink(WeaponPack* weaponpack);
+
+            inline void setDesiredFiremode(const unsigned int firemode)
+                { this->desiredFiremode_ = firemode; }
+            inline unsigned int getDesiredFiremode() const
+                { return this->desiredFiremode_; }
+
+            inline void setWeaponSystem(WeaponSystem *weaponSystem)
+                { this->weaponSystem_ = weaponSystem; }
+            inline WeaponSystem * getWeaponSystem() const
+                { return this->weaponSystem_; }
+
+        private:
+            WeaponSystem * weaponSystem_;
+            unsigned int desiredFiremode_;
+            std::map<WeaponPack*, unsigned int> weaponpacks_;
+    };
+}
+
+#endif /* _WeaponSet_H__ */
Index: code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSlot.cc	(revision 5781)
@@ -0,0 +1,86 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "WeaponSlot.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "Weapon.h"
+#include "WeaponSystem.h"
+
+namespace orxonox
+{
+    CreateFactory(WeaponSlot);
+
+    WeaponSlot::WeaponSlot(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(WeaponSlot);
+
+        this->weaponSystem_ = 0;
+        this->weapon_ = 0;
+
+        this->setObjectMode(0x0);
+    }
+
+    WeaponSlot::~WeaponSlot()
+    {
+        if (this->isInitialized() && this->weaponSystem_)
+            this->weaponSystem_->removeWeaponSlot(this);
+    }
+
+    void WeaponSlot::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WeaponSlot, XMLPort, xmlelement, mode);
+
+        // In the future, there might be parameters like allowed weapon types or max size of the weapon
+    }
+
+    void WeaponSlot::attachWeapon(Weapon *weapon)
+    {
+        if (this->weapon_)
+            this->removeWeapon();
+
+        this->weapon_ = weapon;
+
+        if (this->weapon_)
+        {
+            this->weapon_->setWeaponSlot(this);
+            this->weapon_->setPosition(this->getPosition());
+        }
+    }
+
+    void WeaponSlot::removeWeapon()
+    {
+        if (this->weapon_)
+        {
+            this->weapon_->setWeaponSlot(0);
+            this->weapon_ = 0;
+        }
+    }
+}
Index: code/trunk/src/orxonox/weaponsystem/WeaponSlot.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSlot.h	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSlot.h	(revision 5781)
@@ -0,0 +1,65 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _WeaponSlot_H__
+#define _WeaponSlot_H__
+
+#include "OrxonoxPrereqs.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WeaponSlot : public StaticEntity
+    {
+        public:
+            WeaponSlot(BaseObject* creator);
+            virtual ~WeaponSlot();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void attachWeapon(Weapon * weapon);
+            void removeWeapon();
+            Weapon * getWeapon() const
+                { return this->weapon_; }
+
+            inline bool isOccupied() const
+                { return (this->weapon_ != 0); }
+
+            inline void setWeaponSystem(WeaponSystem * weaponSystem)
+                { this->weaponSystem_ = weaponSystem; }
+            inline WeaponSystem * getWeaponSystem() const
+                { return this->weaponSystem_; }
+
+
+        private:
+            WeaponSystem * weaponSystem_;
+            Weapon * weapon_;
+    };
+}
+
+#endif /* _WeaponSlot_H__ */
Index: code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSystem.cc	(revision 5781)
@@ -0,0 +1,315 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "WeaponSystem.h"
+
+#include "core/CoreIncludes.h"
+#include "worldentities/pawns/Pawn.h"
+
+#include "WeaponSlot.h"
+#include "WeaponPack.h"
+#include "WeaponSet.h"
+#include "Weapon.h"
+#include "Munition.h"
+
+/* WeaponSystem
+ *
+ *  www.orxonox.net/wiki/WeaponSystem
+ */
+
+namespace orxonox
+{
+    CreateFactory(WeaponSystem);
+
+    WeaponSystem::WeaponSystem(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(WeaponSystem);
+
+        this->pawn_ = 0;
+    }
+
+    WeaponSystem::~WeaponSystem()
+    {
+        if (this->isInitialized())
+        {
+            if (this->pawn_)
+                this->pawn_->setWeaponSystem(0);
+
+            while (!this->weaponSets_.empty())
+                delete (this->weaponSets_.begin()->second);
+
+            while (!this->weaponPacks_.empty())
+                delete (*this->weaponPacks_.begin());
+
+            while (!this->weaponSlots_.empty())
+                delete (*this->weaponSlots_.begin());
+
+            while (!this->munitions_.empty())
+                { delete (this->munitions_.begin()->second); this->munitions_.erase(this->munitions_.begin()); }
+        }
+    }
+
+    void WeaponSystem::addWeaponSlot(WeaponSlot * wSlot)
+    {
+        if (!wSlot)
+            return;
+
+        this->weaponSlots_.push_back(wSlot);
+        wSlot->setWeaponSystem(this);
+    }
+
+    void WeaponSystem::removeWeaponSlot(WeaponSlot * wSlot)
+    {
+        if (!wSlot)
+            return;
+
+        if (wSlot->getWeapon())
+            this->removeWeaponPack(wSlot->getWeapon()->getWeaponPack());
+
+        for (std::vector<WeaponSlot*>::iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
+        {
+            if ((*it) == wSlot)
+            {
+                this->weaponSlots_.erase(it);
+                break;
+            }
+        }
+    }
+
+    WeaponSlot * WeaponSystem::getWeaponSlot(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::vector<WeaponSlot*>::const_iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
+        {
+            ++i;
+            if (i > index)
+                return (*it);
+        }
+        return 0;
+    }
+
+    bool WeaponSystem::addWeaponSet(WeaponSet * wSet)
+    {
+        if (wSet)
+            return this->addWeaponSet(wSet, wSet->getDesiredFiremode());
+        else
+            return false;
+    }
+
+    bool WeaponSystem::addWeaponSet(WeaponSet * wSet, unsigned int firemode)
+    {
+        if (!wSet || firemode >= WeaponSystem::MAX_FIRE_MODES)
+            return false;
+
+        std::map<unsigned int, WeaponSet*>::const_iterator it = this->weaponSets_.find(firemode);
+        if (it == this->weaponSets_.end())
+        {
+            this->weaponSets_[firemode] = wSet;
+            wSet->setWeaponSystem(this);
+            return true;
+        }
+
+        return false;
+    }
+
+    void WeaponSystem::removeWeaponSet(WeaponSet * wSet)
+    {
+        for (std::map<unsigned int, WeaponSet*>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); )
+        {
+            if (it->second == wSet)
+                this->weaponSets_.erase(it++);
+            else
+                ++it;
+        }
+    }
+
+    WeaponSet * WeaponSystem::getWeaponSet(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::map<unsigned int, WeaponSet*>::const_iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
+        {
+            ++i;
+            if (i > index)
+                return it->second;
+        }
+        return 0;
+    }
+
+    bool WeaponSystem::canAddWeaponPack(WeaponPack * wPack)
+    {
+        if (!wPack)
+            return false;
+
+        unsigned int freeSlots = 0;
+        for (std::vector<WeaponSlot*>::iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
+        {
+            if (!(*it)->isOccupied())
+                ++freeSlots;
+        }
+
+        return (freeSlots >= wPack->getNumWeapons());
+    }
+
+    bool WeaponSystem::addWeaponPack(WeaponPack * wPack)
+    {
+        if (!this->canAddWeaponPack(wPack))
+            return false;
+
+        // Attach all weapons to the first free slots (and to the Pawn)
+        unsigned int i = 0;
+        for (std::vector<WeaponSlot*>::iterator it = this->weaponSlots_.begin(); it != this->weaponSlots_.end(); ++it)
+        {
+            if (!(*it)->isOccupied() && i < wPack->getNumWeapons())
+            {
+                Weapon* weapon = wPack->getWeapon(i);
+                (*it)->attachWeapon(weapon);
+                this->getPawn()->attach(weapon);
+                ++i;
+            }
+        }
+
+        // Assign the desired weaponmode to the firemodes
+        for (std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
+        {
+            unsigned int weaponmode = wPack->getDesiredWeaponmode(it->first);
+            if (weaponmode != WeaponSystem::WEAPON_MODE_UNASSIGNED)
+                it->second->setWeaponmodeLink(wPack, weaponmode);
+        }
+
+        this->weaponPacks_.insert(wPack);
+        wPack->setWeaponSystem(this);
+
+        return true;
+    }
+
+    void WeaponSystem::removeWeaponPack(WeaponPack * wPack)
+    {
+        // Remove all weapons from their WeaponSlot
+        unsigned int i = 0;
+        Weapon* weapon = 0;
+        while ((weapon = wPack->getWeapon(i++)))
+            weapon->getWeaponSlot()->removeWeapon();
+
+        // Remove all added links from the WeaponSets
+        for (std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
+            it->second->removeWeaponmodeLink(wPack);
+
+        // Remove the WeaponPack from the WeaponSystem
+        this->weaponPacks_.erase(wPack);
+    }
+
+    WeaponPack * WeaponSystem::getWeaponPack(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::set<WeaponPack*>::const_iterator it = this->weaponPacks_.begin(); it != this->weaponPacks_.end(); ++it)
+        {
+            ++i;
+            if (i > index)
+                return (*it);
+        }
+        return 0;
+    }
+
+    bool WeaponSystem::swapWeaponSlots(WeaponSlot * wSlot1, WeaponSlot * wSlot2)
+    {
+        if (!wSlot1 || !wSlot2)
+            return false;
+
+        Weapon* weapon1 = wSlot1->getWeapon();
+        Weapon* weapon2 = wSlot2->getWeapon();
+
+        wSlot1->attachWeapon(weapon2);
+        wSlot2->attachWeapon(weapon1);
+
+        return true;
+        // In the future, certain weapons might not fit to some slots. Swapping would then be
+        // impossible and the returnvalue would be false.
+    }
+
+    void WeaponSystem::changeWeaponmode(WeaponPack * wPack, WeaponSet * wSet, unsigned int weaponmode)
+    {
+        if (!wPack || !wSet)
+            return;
+
+        // Check if the WeaponPack belongs to this WeaponSystem
+        std::set<WeaponPack *>::iterator it1 = this->weaponPacks_.find(wPack);
+        if (it1 == this->weaponPacks_.end())
+            return;
+
+        // Check if the WeaponSet belongs to this WeaponSystem
+        bool foundWeaponSet = false;
+        for (std::map<unsigned int, WeaponSet *>::iterator it2 = this->weaponSets_.begin(); it2 != this->weaponSets_.end(); ++it2)
+        {
+            if (it2->second == wSet)
+            {
+                foundWeaponSet = true;
+                break;
+            }
+        }
+        if (!foundWeaponSet)
+            return;
+
+        // Finally set the link between firemode and weaponmode
+        wSet->setWeaponmodeLink(wPack, weaponmode);
+    }
+
+    void WeaponSystem::fire(unsigned int firemode)
+    {
+        std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.find(firemode);
+        if (it != this->weaponSets_.end() && it->second)
+            it->second->fire();
+    }
+
+    void WeaponSystem::reload()
+    {
+        for (std::map<unsigned int, WeaponSet *>::iterator it = this->weaponSets_.begin(); it != this->weaponSets_.end(); ++it)
+            it->second->reload();
+    }
+
+    Munition * WeaponSystem::getMunition(SubclassIdentifier<Munition> * identifier)
+    {
+        if (!identifier || !identifier->getIdentifier())
+            return 0;
+
+        std::map<Identifier *, Munition *>::iterator it = this->munitions_.find(identifier->getIdentifier());
+        if (it != this->munitions_.end())
+        {
+            return it->second;
+        }
+        else if (identifier->getIdentifier()->isA(Class(Munition)))
+        {
+            Munition* munition = identifier->fabricate(this);
+            this->munitions_[identifier->getIdentifier()] = munition;
+            return munition;
+        }
+        else
+        {
+            return 0;
+        }
+    }
+}
Index: code/trunk/src/orxonox/weaponsystem/WeaponSystem.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSystem.h	(revision 5781)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSystem.h	(revision 5781)
@@ -0,0 +1,100 @@
+/*
+ *   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:
+ *      Martin Polak
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef _WeaponSystem_H__
+#define _WeaponSystem_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <set>
+#include <vector>
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WeaponSystem : public BaseObject
+    {
+        public:
+            WeaponSystem(BaseObject* creator);
+            virtual ~WeaponSystem();
+
+            // adding and removing WeaponSlots
+            void addWeaponSlot(WeaponSlot * wSlot);
+            void removeWeaponSlot(WeaponSlot * wSlot);
+            WeaponSlot * getWeaponSlot(unsigned int index) const;
+
+            // adding and removing WeaponSets
+            bool addWeaponSet(WeaponSet * wSet);
+            bool addWeaponSet(WeaponSet * wSet, unsigned int firemode);
+            void removeWeaponSet(WeaponSet * wSet);
+            WeaponSet * getWeaponSet(unsigned int index) const;
+
+            // adding and removing WeaponPacks
+            bool canAddWeaponPack(WeaponPack * wPack);
+            bool addWeaponPack(WeaponPack * wPack);
+            void removeWeaponPack(WeaponPack * wPack);
+            WeaponPack * getWeaponPack(unsigned int index) const;
+
+            // configure slots and firemodes
+            bool swapWeaponSlots(WeaponSlot * wSlot1, WeaponSlot * wSlot2);
+            void changeWeaponmode(WeaponPack * wPack, WeaponSet * wSet, unsigned int weaponmode);
+
+            void fire(unsigned int firemode);
+            void reload();
+
+            Munition * getMunition(SubclassIdentifier<Munition> * identifier);
+
+            inline void setPawn(Pawn * pawn)
+                { this->pawn_ = pawn; }
+            inline Pawn * getPawn() const
+                { return this->pawn_; }
+
+            inline int getWeaponSlotSize() const
+                { return this->weaponSlots_.size(); }
+
+            static inline unsigned int getFiremodeMask(unsigned int firemode)
+                { return (0x1 << firemode); }
+
+            static const unsigned int MAX_FIRE_MODES = 8;
+            static const unsigned int FIRE_MODE_UNASSIGNED = static_cast<unsigned int>(-1);
+
+            static const unsigned int MAX_WEAPON_MODES = 8;
+            static const unsigned int WEAPON_MODE_UNASSIGNED = static_cast<unsigned int>(-1);
+
+        private:
+            std::map<unsigned int, WeaponSet *> weaponSets_;
+            std::vector<WeaponSlot *> weaponSlots_;
+            std::set<WeaponPack *> weaponPacks_;
+            std::map<Identifier *, Munition *> munitions_;
+            Pawn * pawn_;
+    };
+}
+
+#endif /* _WeaponSystem_H__ */
Index: code/trunk/src/orxonox/worldentities/BigExplosion.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/BigExplosion.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/BigExplosion.cc	(revision 5781)
@@ -0,0 +1,378 @@
+/*
+ *   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:
+ *      Benjamin de Capitani
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "BigExplosion.h"
+
+//#include <sstream>
+
+#include "util/Exception.h"
+#include "core/CoreIncludes.h"
+#include "core/CommandExecutor.h"
+#include "core/Executor.h"
+#include "core/GameMode.h"
+#include "tools/ParticleInterface.h"
+#include "Scene.h"
+#include "graphics/ParticleSpawner.h"
+#include "graphics/Model.h"
+
+namespace orxonox
+{
+    CreateFactory(BigExplosion);
+
+    BigExplosion::BigExplosion(BaseObject* creator) : MovableEntity(creator)
+    {
+        RegisterObject(BigExplosion);
+
+        if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
+            ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given.");
+/*
+        this->cps_ = 1;
+        this->firstTick_ = true;
+*/
+        this->bStop_ = false;
+        this->LOD_ = LODParticle::Normal;
+
+/*      this->stf_ = "setTimeFactor ";
+        this->timeFactor_ =  1;
+        std::ostringstream o;
+        o << stf_ << this->timeFactor_;
+        CommandExecutor::execute(o.str() ,false);
+        this->timeFactor_ = 0.1;
+*/
+
+        if ( GameMode::showsGraphics() )
+        {
+            try
+            {
+                this->init();
+            }
+            catch (...)
+            {
+                COUT(1) << "Error: Couln't load particle effect in BigExplosion: " << Exception::handleMessage() << std::endl;
+                this->initZero();
+            }
+        }
+        else
+        {
+            this->initZero();
+        }
+
+        if (GameMode::isMaster())
+        {
+            Vector3 velocity(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1));
+            velocity.normalise();
+            velocity *= rnd(20, 30);
+            this->setVelocity(velocity);
+
+            this->destroyTimer_.setTimer(rnd(2, 4), false, this, createExecutor(createFunctor(&BigExplosion::stop)));
+        }
+        this->registerVariables();
+    }
+
+    void BigExplosion::init()
+    {
+        this->debrisEntity1_ = new MovableEntity(this);
+        this->debrisEntity2_ = new MovableEntity(this);
+        this->debrisEntity3_ = new MovableEntity(this);
+        this->debrisEntity4_ = new MovableEntity(this);
+
+        this->debris1_ = new Model(this);
+        this->debris2_ = new Model(this);
+        this->debris3_ = new Model(this);
+        this->debris4_ = new Model(this);
+
+        this->explosion_ = new StaticEntity(this);
+
+        this->debrisSmoke1_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
+        this->debrisSmoke2_ =  new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
+        this->debrisSmoke3_ =  new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
+        this->debrisSmoke4_ =  new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
+
+        this->debrisFire1_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
+        this->debrisFire2_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
+        this->debrisFire3_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
+        this->debrisFire4_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
+
+        this->debris1_->attachOgreObject(this->debrisSmoke1_->getParticleSystem());
+        this->debris1_->attachOgreObject(this->debrisFire1_->getParticleSystem());
+        this->debris2_->attachOgreObject(this->debrisSmoke2_->getParticleSystem());
+        this->debris2_->attachOgreObject(this->debrisFire2_->getParticleSystem());
+        this->debris3_->attachOgreObject(this->debrisSmoke3_->getParticleSystem());
+        this->debris3_->attachOgreObject(this->debrisFire3_->getParticleSystem());
+        this->debris4_->attachOgreObject(this->debrisSmoke4_->getParticleSystem());
+        this->debris4_->attachOgreObject(this->debrisFire4_->getParticleSystem());
+
+        this->debris1_->setMeshSource("CockpitDebris.mesh");
+        this->debris2_->setMeshSource("WingDebris1.mesh");
+        this->debris3_->setMeshSource("BodyDebris1.mesh");
+        this->debris4_->setMeshSource("WingDebris2.mesh");
+
+        this->debrisEntity1_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
+        this->debrisEntity1_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+        this->debrisEntity1_->setScale(4);
+
+        this->debrisEntity2_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
+        this->debrisEntity2_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+        this->debrisEntity2_->setScale(4);
+
+        this->debrisEntity3_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
+        this->debrisEntity3_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+        this->debrisEntity3_->setScale(4);
+
+        this->debrisEntity4_->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(50,100));
+        this->debrisEntity4_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+        this->debrisEntity4_->setScale(4);
+
+        this->debrisEntity1_->attach(debris1_);
+        this->debrisEntity2_->attach(debris2_);
+        this->debrisEntity3_->attach(debris3_);
+        this->debrisEntity4_->attach(debris4_);
+
+        ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
+        effect->setDestroyAfterLife(true);
+        effect->setSource("Orxonox/explosion2b");
+        effect->setLifetime(4.0f);
+
+        ParticleSpawner* effect2 = new ParticleSpawner(this->getCreator());
+        effect2->setDestroyAfterLife(true);
+        effect2->setSource("Orxonox/smoke6");
+        effect2->setLifetime(4.0f);
+
+        this->explosion_->attach(effect);
+        this->explosion_->attach(effect2);
+
+        this->attach(explosion_);
+        this->attach(debrisEntity1_);
+        this->attach(debrisEntity2_);
+        this->attach(debrisEntity3_);
+        this->attach(debrisEntity4_);
+
+
+        for(int i=0;i<10;i++)
+        {
+            Model* part1 = new Model(this);
+            Model* part2 = new Model(this);
+
+            MovableEntity* partEntity1 = new MovableEntity(this);
+            MovableEntity* partEntity2 = new MovableEntity(this);
+
+            partEntity1->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10,100));
+            partEntity1->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+            partEntity1->setScale(rnd(1, 3));
+
+            partEntity2->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10, 100));
+            partEntity2->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
+            partEntity2->setScale(rnd(1, 3));
+
+            part1->setMeshSource("SmallPart1.mesh");
+            part2->setMeshSource("SmallPart2.mesh");
+
+            partEntity1->attach(part1);
+            partEntity2->attach(part2);
+
+            this->attach(partEntity1);
+            this->attach(partEntity2);
+        }
+    }
+
+    void BigExplosion::initZero()
+    {
+        this->debrisFire1_ = 0;
+        this->debrisFire2_ = 0;
+        this->debrisFire3_ = 0;
+        this->debrisFire4_ = 0;
+
+        this->debrisSmoke1_ = 0;
+        this->debrisSmoke2_ = 0;
+        this->debrisSmoke3_ = 0;
+        this->debrisSmoke4_ = 0;
+
+        this->explosionSmoke_=0;
+        this->explosionFire_=0;
+    }
+
+    BigExplosion::~BigExplosion()
+    {
+        CommandExecutor::execute("setTimeFactor 1", false);
+
+        if (this->isInitialized())
+        {
+            if (this->debrisFire1_)
+            {
+                this->debris1_->detachOgreObject(this->debrisFire1_->getParticleSystem());
+                delete this->debrisFire1_;
+            }
+            if (this->debrisSmoke1_)
+            {
+                this->debris1_->detachOgreObject(this->debrisSmoke1_->getParticleSystem());
+                delete this->debrisSmoke1_;
+            }
+
+            if (this->debrisFire2_)
+            {
+                this->debris2_->detachOgreObject(this->debrisFire2_->getParticleSystem());
+                delete this->debrisFire2_;
+            }
+            if (this->debrisSmoke2_)
+            {
+                this->debris2_->detachOgreObject(this->debrisSmoke2_->getParticleSystem());
+                delete this->debrisSmoke2_;
+            }
+
+            if (this->debrisFire3_)
+            {
+                this->debris3_->detachOgreObject(this->debrisFire3_->getParticleSystem());
+                delete this->debrisFire3_;
+            }
+            if (this->debrisSmoke3_)
+            {
+                this->debris3_->detachOgreObject(this->debrisSmoke3_->getParticleSystem());
+                delete this->debrisSmoke3_;
+            }
+
+            if (this->debrisFire4_)
+            {
+                this->debris4_->detachOgreObject(this->debrisFire4_->getParticleSystem());
+                delete this->debrisFire4_;
+            }
+            if (this->debrisSmoke4_)
+            {
+                this->debris4_->detachOgreObject(this->debrisSmoke4_->getParticleSystem());
+                delete this->debrisSmoke4_;
+            }
+        }
+    }
+
+    void BigExplosion::registerVariables()
+    {
+        registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::LODchanged));
+        registerVariable(this->bStop_,       VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::checkStop));
+    }
+
+    void BigExplosion::LODchanged()
+    {
+        if (this->debrisFire1_)
+            this->debrisFire1_->setDetailLevel(this->LOD_);
+        if (this->debrisSmoke1_)
+            this->debrisSmoke1_->setDetailLevel(this->LOD_);
+
+        if (this->debrisFire2_)
+            this->debrisFire2_->setDetailLevel(this->LOD_);
+        if (this->debrisSmoke2_)
+            this->debrisSmoke2_->setDetailLevel(this->LOD_);
+
+        if (this->debrisFire3_)
+            this->debrisFire3_->setDetailLevel(this->LOD_);
+        if (this->debrisSmoke3_)
+            this->debrisSmoke3_->setDetailLevel(this->LOD_);
+
+        if (this->debrisFire4_)
+            this->debrisFire4_->setDetailLevel(this->LOD_);
+        if (this->debrisSmoke4_)
+            this->debrisSmoke4_->setDetailLevel(this->LOD_);
+    }
+
+    void BigExplosion::checkStop()
+    {
+        if (this->bStop_)
+            this->stop();
+    }
+
+    void BigExplosion::stop()
+    {
+        if (this->debrisFire1_)
+            this->debrisFire1_->setEnabled(false);
+        if (this->debrisSmoke1_)
+            this->debrisSmoke1_->setEnabled(false);
+
+        if (this->debrisFire2_)
+            this->debrisFire2_->setEnabled(false);
+        if (this->debrisSmoke2_)
+            this->debrisSmoke2_->setEnabled(false);
+
+        if (this->debrisFire3_)
+            this->debrisFire3_->setEnabled(false);
+        if (this->debrisSmoke3_)
+            this->debrisSmoke3_->setEnabled(false);
+
+        if (this->debrisFire4_)
+            this->debrisFire4_->setEnabled(false);
+        if (this->debrisSmoke4_)
+            this->debrisSmoke4_->setEnabled(false);
+
+        if (GameMode::isMaster())
+        {
+            this->bStop_ = true;
+            this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&BigExplosion::destroy)));
+        }
+    }
+
+    void BigExplosion::destroy()
+    {
+        delete this;
+    }
+
+/* TODO
+
+    void BigExplosion::setDebrisMeshes()
+    {
+
+    }
+    void BigExplosion::getDebrisMeshes()
+    {
+
+    }
+*/
+
+     void BigExplosion::tick(float dt)
+    {
+//        static const unsigned int CHANGES_PER_SECOND = 10;
+
+
+/*        if (GameMode::isMaster() && rnd() < dt*(this->cps_))
+        {
+
+            if(this->timeFactor_ < 1 )
+                this->timeFactor_ += 0.05;
+
+            if(this->firstTick_)
+                this->cps_ = 256;
+
+            std::ostringstream o;
+            o << this->stf_ << this->timeFactor_;
+            CommandExecutor::execute(o.str() ,false);
+            if(this->cps_>50)
+                this->cps_/=2;
+            this->firstTick_ = false;
+            COUT(0) << timeFactor_ << std::endl;
+        }
+*/
+
+        SUPER(BigExplosion, tick, dt);
+    }
+}
Index: code/trunk/src/orxonox/worldentities/BigExplosion.h
===================================================================
--- code/trunk/src/orxonox/worldentities/BigExplosion.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/BigExplosion.h	(revision 5781)
@@ -0,0 +1,105 @@
+/*
+ *   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:
+ *      Benjamin de Capitani
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _BigExplosion_H__
+#define _BigExplosion_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "tools/Timer.h"
+#include "MovableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport BigExplosion : public MovableEntity
+    {
+        public:
+            BigExplosion(BaseObject* creator);
+            virtual ~BigExplosion();
+
+            virtual void tick(float dt);
+            void registerVariables();
+
+            inline void setLOD(LODParticle::Value level)
+                { this->LOD_ = level; this->LODchanged(); }
+            inline LODParticle::Value getLOD() const
+                { return this->LOD_; }
+
+        private:
+
+            void LODchanged();
+            void checkStop();
+            void stop();
+            void destroy();
+            void init();
+            void initZero();
+
+
+            bool                  bStop_;
+            bool                  firstTick_;
+
+            std::string           stf_;
+
+            unsigned int          cps_;
+
+            double                timeFactor_;
+
+            StaticEntity*         explosion_;
+
+            MovableEntity*        debrisEntity1_;
+            MovableEntity*        debrisEntity2_;
+            MovableEntity*        debrisEntity3_;
+            MovableEntity*        debrisEntity4_;
+
+            Model*                debris1_;
+            Model*                debris2_;
+            Model*                debris3_;
+            Model*                debris4_;
+
+
+
+            ParticleInterface*    debrisSmoke1_;
+            ParticleInterface*    debrisSmoke2_;
+            ParticleInterface*    debrisSmoke3_;
+            ParticleInterface*    debrisSmoke4_;
+
+            ParticleInterface*    debrisFire1_;
+            ParticleInterface*    debrisFire2_;
+            ParticleInterface*    debrisFire3_;
+            ParticleInterface*    debrisFire4_;
+
+            ParticleInterface*    explosionSmoke_;
+            ParticleInterface*    explosionFire_;
+
+            LODParticle::Value      LOD_;
+            Timer<BigExplosion> destroyTimer_;
+    };
+}
+
+#endif /* _BigExplosion_H__ */
Index: code/trunk/src/orxonox/worldentities/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/worldentities/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,15 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  WorldEntity.cc
+  StaticEntity.cc
+  MovableEntity.cc
+  MobileEntity.cc
+  ControllableEntity.cc
+
+  BigExplosion.cc
+  ExplosionChunk.cc
+  CameraPosition.cc
+  SpawnPoint.cc
+  TeamSpawnPoint.cc
+)
+
+ADD_SUBDIRECTORY(pawns)
Index: code/trunk/src/orxonox/worldentities/CameraPosition.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/CameraPosition.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/CameraPosition.cc	(revision 5781)
@@ -0,0 +1,80 @@
+/*
+ *   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 "CameraPosition.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "graphics/Camera.h"
+
+namespace orxonox
+{
+    CreateFactory(CameraPosition);
+
+    CameraPosition::CameraPosition(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(CameraPosition);
+
+        this->bDrag_ = false;
+        this->bAllowMouseLook_ = false;
+        this->bAbsolute_ = false;
+        this->bRenderCamera_ = false;
+
+        this->setObjectMode(0x0);
+    }
+
+    CameraPosition::~CameraPosition()
+    {
+    }
+
+    void CameraPosition::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(CameraPosition, XMLPort, xmlelement, mode);
+
+        XMLPortParam(CameraPosition, "drag", setDrag, getDrag, xmlelement, mode).defaultValues(false);
+        XMLPortParam(CameraPosition, "mouselook", setAllowMouseLook, getAllowMouseLook, xmlelement, mode).defaultValues(false);
+        XMLPortParam(CameraPosition, "absolute", setIsAbsolute, getIsAbsolute, xmlelement, mode).defaultValues(false);
+        XMLPortParam(CameraPosition, "rendercamera", setRenderCamera, getRenderCamera, xmlelement, mode).defaultValues(false);
+    }
+
+    void CameraPosition::attachCamera(Camera* camera)
+    {
+        if (!this->bDrag_)
+            camera->setDrag(false);
+
+        this->attach(camera);
+
+        if (this->bDrag_)
+            camera->setDrag(true);
+    }
+
+    void CameraPosition::attachCamera(Ogre::Camera* camera)
+    {
+        this->attachOgreObject(camera);
+    }
+}
Index: code/trunk/src/orxonox/worldentities/CameraPosition.h
===================================================================
--- code/trunk/src/orxonox/worldentities/CameraPosition.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/CameraPosition.h	(revision 5781)
@@ -0,0 +1,76 @@
+/*
+ *   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 _CameraPosition_H__
+#define _CameraPosition_H__
+
+#include "OrxonoxPrereqs.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport CameraPosition : public StaticEntity
+    {
+        public:
+            CameraPosition(BaseObject* creator);
+            virtual ~CameraPosition();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            inline void setDrag(bool bDrag)
+                { this->bDrag_ = bDrag; }
+            inline bool getDrag() const
+                { return this->bDrag_; }
+
+            inline void setAllowMouseLook(bool bAllow)
+                { this->bAllowMouseLook_ = bAllow; }
+            inline bool getAllowMouseLook() const
+                { return this->bAllowMouseLook_; }
+
+            inline void setIsAbsolute(bool bAbsolute)
+                { this->bAbsolute_ = bAbsolute; }
+            inline bool getIsAbsolute() const
+                { return this->bAbsolute_; }
+
+            inline void setRenderCamera(bool bRenderCamera)
+                { this->bRenderCamera_ = bRenderCamera; }
+            inline bool getRenderCamera() const
+                { return this->bRenderCamera_; }
+
+            void attachCamera(Camera* camera);
+            void attachCamera(Ogre::Camera* camera);
+
+        private:
+            bool bDrag_;
+            bool bAllowMouseLook_;
+            bool bAbsolute_;
+            bool bRenderCamera_;
+    };
+}
+
+#endif /* _CameraPosition_H__ */
Index: code/trunk/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.cc	(revision 5781)
@@ -0,0 +1,541 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *
+ */
+
+#include "ControllableEntity.h"
+
+#include <OgreSceneManager.h>
+#include <OgreSceneNode.h>
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+
+#include "Scene.h"
+#include "infos/PlayerInfo.h"
+#include "controllers/Controller.h"
+#include "graphics/Camera.h"
+#include "worldentities/CameraPosition.h"
+#include "overlays/OverlayGroup.h"
+
+namespace orxonox
+{
+    CreateFactory(ControllableEntity);
+
+    ControllableEntity::ControllableEntity(BaseObject* creator) : MobileEntity(creator)
+    {
+        RegisterObject(ControllableEntity);
+
+        this->bHasLocalController_ = false;
+        this->bHasHumanController_ = false;
+
+        this->server_overwrite_ = 0;
+        this->client_overwrite_ = 0;
+        this->player_ = 0;
+        this->playerID_ = OBJECTID_UNKNOWN;
+        this->hud_ = 0;
+        this->camera_ = 0;
+        this->xmlcontroller_ = 0;
+        this->reverseCamera_ = 0;
+        this->bDestroyWhenPlayerLeft_ = false;
+        this->cameraPositionRootNode_ = this->node_->createChildSceneNode();
+        this->bMouseLook_ = false;
+        this->mouseLookSpeed_ = 200;
+
+        this->server_position_         = Vector3::ZERO;
+        this->client_position_         = Vector3::ZERO;
+        this->server_linear_velocity_  = Vector3::ZERO;
+        this->client_linear_velocity_  = Vector3::ZERO;
+        this->server_orientation_      = Quaternion::IDENTITY;
+        this->client_orientation_      = Quaternion::IDENTITY;
+        this->server_angular_velocity_ = Vector3::ZERO;
+        this->client_angular_velocity_ = Vector3::ZERO;
+
+
+        this->setConfigValues();
+        this->setPriority( Priority::VeryHigh );
+        this->registerVariables();
+    }
+
+    ControllableEntity::~ControllableEntity()
+    {
+        if (this->isInitialized())
+        {
+            this->bDestroyWhenPlayerLeft_ = false;
+
+            if (this->bHasLocalController_ && this->bHasHumanController_)
+                this->stopLocalHumanControl();
+
+            if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this)
+                this->getPlayer()->stopControl();
+
+            if (this->xmlcontroller_)
+                delete this->xmlcontroller_;
+
+            if (this->hud_)
+                delete this->hud_;
+
+            if (this->camera_)
+                delete this->camera_;
+
+            for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
+                delete (*it);
+
+            if (this->getScene()->getSceneManager())
+                this->getScene()->getSceneManager()->destroySceneNode(this->cameraPositionRootNode_->getName());
+        }
+    }
+
+    void ControllableEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(ControllableEntity, XMLPort, xmlelement, mode);
+
+        XMLPortParam(ControllableEntity, "hudtemplate", setHudTemplate, getHudTemplate, xmlelement, mode);
+        XMLPortParam(ControllableEntity, "camerapositiontemplate", setCameraPositionTemplate, getCameraPositionTemkplate, xmlelement, mode);
+
+        XMLPortObject(ControllableEntity, CameraPosition, "camerapositions", addCameraPosition, getCameraPosition, xmlelement, mode);
+        XMLPortObject(ControllableEntity, Controller,     "controller",      setXMLController,  getXMLController,  xmlelement, mode);
+    }
+
+    void ControllableEntity::setConfigValues()
+    {
+        SetConfigValue(mouseLookSpeed_, 3.0f);
+    }
+
+    void ControllableEntity::addCameraPosition(CameraPosition* position)
+    {
+        if (!position->getIsAbsolute())
+        {
+            if (position->getAllowMouseLook())
+                position->attachToNode(this->cameraPositionRootNode_);
+            else
+                this->attach(position);
+        }
+        else
+        {
+            WorldEntity* parent = this->getParent();
+            if (parent)
+                parent->attach(position);
+        }
+
+        if (!position->getRenderCamera())
+            this->cameraPositions_.push_back(position);
+        else
+            this->setReverseCamera(position);
+    }
+
+    CameraPosition* ControllableEntity::getCameraPosition(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+
+    void ControllableEntity::switchCamera()
+    {
+        if (this->camera_)
+        {
+            if (this->camera_->getParent() == this && this->cameraPositions_.size() > 0)
+            {
+                this->cameraPositions_.front()->attachCamera(this->camera_);
+            }
+            else if (this->cameraPositions_.size() > 0)
+            {
+                for (std::list<CameraPosition*>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
+                {
+                    if ((*it) == this->camera_->getParent())
+                    {
+                        ++it;
+                        if (it != this->cameraPositions_.end())
+                            (*it)->attachCamera(this->camera_);
+                        else
+                            (*this->cameraPositions_.begin())->attachCamera(this->camera_);
+                        break;
+                    }
+                }
+            }
+            else
+            {
+                this->camera_->attachToNode(this->cameraPositionRootNode_);
+            }
+        }
+    }
+
+    void ControllableEntity::mouseLook()
+    {
+        this->bMouseLook_ = !this->bMouseLook_;
+
+        if (!this->bMouseLook_)
+            this->cameraPositionRootNode_->setOrientation(Quaternion::IDENTITY);
+    }
+
+    void ControllableEntity::rotateYaw(const Vector2& value)
+    {
+        if (this->bMouseLook_)
+            this->cameraPositionRootNode_->yaw(Radian(value.y * this->mouseLookSpeed_), Ogre::Node::TS_LOCAL);
+    }
+
+    void ControllableEntity::rotatePitch(const Vector2& value)
+    {
+        if (this->bMouseLook_)
+            this->cameraPositionRootNode_->pitch(Radian(value.y * this->mouseLookSpeed_), Ogre::Node::TS_LOCAL);
+    }
+
+    void ControllableEntity::rotateRoll(const Vector2& value)
+    {
+        if (this->bMouseLook_)
+            this->cameraPositionRootNode_->roll(Radian(value.y * this->mouseLookSpeed_), Ogre::Node::TS_LOCAL);
+    }
+
+    void ControllableEntity::setPlayer(PlayerInfo* player)
+    {
+        if (!player)
+        {
+            this->removePlayer();
+            return;
+        }
+
+        this->player_ = player;
+        this->playerID_ = player->getObjectID();
+        this->bHasLocalController_ = player->isLocalPlayer();
+        this->bHasHumanController_ = player->isHumanPlayer();
+
+        if (this->bHasLocalController_ && this->bHasHumanController_)
+        {
+            this->startLocalHumanControl();
+
+            if (!GameMode::isMaster())
+            {
+                this->client_overwrite_ = this->server_overwrite_;
+                this->setObjectMode(ObjectDirection::Bidirectional);
+            }
+        }
+
+        this->changedPlayer();
+    }
+
+    void ControllableEntity::removePlayer()
+    {
+        if (this->bHasLocalController_ && this->bHasHumanController_)
+            this->stopLocalHumanControl();
+
+        this->player_ = 0;
+        this->playerID_ = OBJECTID_UNKNOWN;
+        this->bHasLocalController_ = false;
+        this->bHasHumanController_ = false;
+        this->setObjectMode(ObjectDirection::ToClient);
+
+        this->changedPlayer();
+
+        if (this->bDestroyWhenPlayerLeft_)
+            delete this;
+    }
+
+    void ControllableEntity::networkcallback_changedplayerID()
+    {
+        // just do this in case the entity wasn't yet synchronized when the corresponding PlayerInfo got our objectID
+        if (this->playerID_ != OBJECTID_UNKNOWN)
+        {
+            this->player_ = orxonox_cast<PlayerInfo*>(Synchronisable::getSynchronisable(this->playerID_));
+            if (this->player_ && (this->player_->getControllableEntity() != this))
+                this->player_->startControl(this);
+        }
+    }
+
+    void ControllableEntity::startLocalHumanControl()
+    {
+        if (!this->camera_)
+        {
+            this->camera_ = new Camera(this);
+            this->camera_->requestFocus();
+            if (this->cameraPositionTemplate_ != "")
+                this->addTemplate(this->cameraPositionTemplate_);
+            if (this->cameraPositions_.size() > 0)
+                this->cameraPositions_.front()->attachCamera(this->camera_);
+            else
+                this->camera_->attachToNode(this->cameraPositionRootNode_);
+        }
+
+        if (!this->hud_)
+        {
+            if (this->hudtemplate_ != "")
+            {
+                this->hud_ = new OverlayGroup(this);
+                this->hud_->addTemplate(this->hudtemplate_);
+                this->hud_->setOwner(this);
+            }
+        }
+    }
+
+    void ControllableEntity::stopLocalHumanControl()
+    {
+        if (this->camera_)
+        {
+            this->camera_->detachFromParent();
+            delete this->camera_;
+            this->camera_ = 0;
+        }
+
+        if (this->hud_)
+        {
+            delete this->hud_;
+            this->hud_ = 0;
+        }
+    }
+
+    void ControllableEntity::setXMLController(Controller* controller)
+    {
+        if (!this->xmlcontroller_)
+        {
+            this->xmlcontroller_ = controller;
+            this->bHasLocalController_ = true;
+            this->xmlcontroller_->setControllableEntity(this);
+        }
+        else
+            COUT(2) << "Warning: ControllableEntity \"" << this->getName() << "\" already has a Controller." << std::endl;
+    }
+
+    void ControllableEntity::parentChanged()
+    {
+        WorldEntity::parentChanged();
+
+        WorldEntity* parent = this->getParent();
+        if (parent)
+        {
+            for (std::list<CameraPosition*>::iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
+                if ((*it)->getIsAbsolute())
+                    parent->attach((*it));
+        }
+    }
+
+    void ControllableEntity::tick(float dt)
+    {
+        MobileEntity::tick(dt);
+
+        if (this->isActive())
+        {
+            // Check whether Bullet doesn't do the physics for us
+            if (!this->isDynamic())
+            {
+                if (GameMode::isMaster())
+                {
+                    this->server_position_ = this->getPosition();
+                    this->server_orientation_ = this->getOrientation();
+                    this->server_linear_velocity_ = this->getVelocity();
+                    this->server_angular_velocity_ = this->getAngularVelocity();
+                }
+                else if (this->bHasLocalController_)
+                {
+                    this->client_position_ = this->getPosition();
+                    this->client_orientation_ = this->getOrientation();
+                    this->client_linear_velocity_ = this->getVelocity();
+                    this->client_angular_velocity_ = this->getAngularVelocity();
+                }
+            }
+        }
+    }
+
+    void ControllableEntity::registerVariables()
+    {
+        registerVariable(this->cameraPositionTemplate_,  VariableDirection::ToClient);
+        registerVariable(this->hudtemplate_,             VariableDirection::ToClient);
+
+        registerVariable(this->server_position_,         VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
+        registerVariable(this->server_linear_velocity_,  VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity));
+        registerVariable(this->server_orientation_,      VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
+        registerVariable(this->server_angular_velocity_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity));
+
+        registerVariable(this->server_overwrite_,        VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
+        registerVariable(this->client_overwrite_,        VariableDirection::ToServer);
+
+        registerVariable(this->client_position_,         VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
+        registerVariable(this->client_linear_velocity_,  VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity));
+        registerVariable(this->client_orientation_,      VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
+        registerVariable(this->client_angular_velocity_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity));
+
+
+        registerVariable(this->playerID_,                VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
+    }
+
+    void ControllableEntity::processServerPosition()
+    {
+        if (!this->bHasLocalController_)
+            MobileEntity::setPosition(this->server_position_);
+    }
+
+    void ControllableEntity::processServerLinearVelocity()
+    {
+        if (!this->bHasLocalController_)
+            MobileEntity::setVelocity(this->server_linear_velocity_);
+    }
+
+    void ControllableEntity::processServerOrientation()
+    {
+        if (!this->bHasLocalController_)
+            MobileEntity::setOrientation(this->server_orientation_);
+    }
+
+    void ControllableEntity::processServerAngularVelocity()
+    {
+        if (!this->bHasLocalController_)
+            MobileEntity::setAngularVelocity(this->server_angular_velocity_);
+    }
+
+    void ControllableEntity::processOverwrite()
+    {
+        if (this->bHasLocalController_)
+        {
+            this->setPosition(this->server_position_);
+            this->setOrientation(this->server_orientation_);
+            this->setVelocity(this->server_linear_velocity_);
+            this->setAngularVelocity(this->server_angular_velocity_);
+
+            this->client_overwrite_ = this->server_overwrite_;
+        }
+    }
+
+    void ControllableEntity::processClientPosition()
+    {
+        if (this->server_overwrite_ == this->client_overwrite_)
+        {
+            MobileEntity::setPosition(this->client_position_);
+            this->server_position_ = this->getPosition();
+        }
+    }
+
+    void ControllableEntity::processClientLinearVelocity()
+    {
+        if (this->server_overwrite_ == this->client_overwrite_)
+        {
+            MobileEntity::setVelocity(this->client_linear_velocity_);
+            this->server_linear_velocity_ = this->getVelocity();
+        }
+    }
+
+    void ControllableEntity::processClientOrientation()
+    {
+        if (this->server_overwrite_ == this->client_overwrite_)
+        {
+            MobileEntity::setOrientation(this->client_orientation_);
+            this->server_orientation_ = this->getOrientation();
+        }
+    }
+
+    void ControllableEntity::processClientAngularVelocity()
+    {
+        if (this->server_overwrite_ == this->client_overwrite_)
+        {
+            MobileEntity::setAngularVelocity(this->client_angular_velocity_);
+            this->server_angular_velocity_ = this->getAngularVelocity();
+        }
+    }
+
+    void ControllableEntity::setPosition(const Vector3& position)
+    {
+        if (GameMode::isMaster())
+        {
+            MobileEntity::setPosition(position);
+            this->server_position_ = this->getPosition();
+            ++this->server_overwrite_;
+        }
+        else if (this->bHasLocalController_)
+        {
+            MobileEntity::setPosition(position);
+            this->client_position_ = this->getPosition();
+        }
+    }
+
+    void ControllableEntity::setOrientation(const Quaternion& orientation)
+    {
+        if (GameMode::isMaster())
+        {
+            MobileEntity::setOrientation(orientation);
+            this->server_orientation_ = this->getOrientation();
+            ++this->server_overwrite_;
+        }
+        else if (this->bHasLocalController_)
+        {
+            MobileEntity::setOrientation(orientation);
+            this->client_orientation_ = this->getOrientation();
+        }
+    }
+
+    void ControllableEntity::setVelocity(const Vector3& velocity)
+    {
+        if (GameMode::isMaster())
+        {
+            MobileEntity::setVelocity(velocity);
+            this->server_linear_velocity_ = this->getVelocity();
+            ++this->server_overwrite_;
+        }
+        else if (this->bHasLocalController_)
+        {
+            MobileEntity::setVelocity(velocity);
+            this->client_linear_velocity_ = this->getVelocity();
+        }
+    }
+
+    void ControllableEntity::setAngularVelocity(const Vector3& velocity)
+    {
+        if (GameMode::isMaster())
+        {
+            MobileEntity::setAngularVelocity(velocity);
+            this->server_angular_velocity_ = this->getAngularVelocity();
+            ++this->server_overwrite_;
+        }
+        else if (this->bHasLocalController_)
+        {
+            MobileEntity::setAngularVelocity(velocity);
+            this->client_angular_velocity_ = this->getAngularVelocity();
+        }
+    }
+
+    void ControllableEntity::setWorldTransform(const btTransform& worldTrans)
+    {
+        MobileEntity::setWorldTransform(worldTrans);
+        if (GameMode::isMaster())
+        {
+            this->server_position_ = this->getPosition();
+            this->server_orientation_ = this->getOrientation();
+            this->server_linear_velocity_ = this->getVelocity();
+            this->server_angular_velocity_ = this->getAngularVelocity();
+        }
+        else if (this->bHasLocalController_)
+        {
+            this->client_position_ = this->getPosition();
+            this->client_orientation_ = this->getOrientation();
+            this->client_linear_velocity_ = this->getVelocity();
+            this->client_angular_velocity_ = this->getAngularVelocity();
+        }
+    }
+}
Index: code/trunk/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.h	(revision 5781)
@@ -0,0 +1,207 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *
+ */
+
+#ifndef _ControllableEntity_H__
+#define _ControllableEntity_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <list>
+#include <string>
+#include "util/Math.h"
+#include "MobileEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ControllableEntity : public MobileEntity
+    {
+        friend class PlayerInfo; // PlayerInfo uses setPlayer and removePlayer
+
+        public:
+            ControllableEntity(BaseObject* creator);
+            virtual ~ControllableEntity();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+            void registerVariables();
+            void setConfigValues();
+
+            virtual void changedPlayer() {}
+
+            inline PlayerInfo* getPlayer() const
+                { return this->player_; }
+
+            inline void setDestroyWhenPlayerLeft(bool bDestroy)
+                { this->bDestroyWhenPlayerLeft_ = bDestroy; }
+            inline bool getDestroyWhenPlayerLeft() const
+                { return this->bDestroyWhenPlayerLeft_; }
+
+            virtual void moveFrontBack(const Vector2& value) {}
+            virtual void moveRightLeft(const Vector2& value) {}
+            virtual void moveUpDown(const Vector2& value) {}
+
+            virtual void rotateYaw(const Vector2& value);
+            virtual void rotatePitch(const Vector2& value);
+            virtual void rotateRoll(const Vector2& value);
+
+            inline void moveFrontBack(float value)
+                { this->moveFrontBack(Vector2(value, 0)); }
+            inline void moveRightLeft(float value)
+                { this->moveRightLeft(Vector2(value, 0)); }
+            inline void moveUpDown(float value)
+                { this->moveUpDown(Vector2(value, 0)); }
+
+            inline void rotateYaw(float value)
+                { this->rotateYaw(Vector2(value, 0)); }
+            inline void rotatePitch(float value)
+                { this->rotatePitch(Vector2(value, 0)); }
+            inline void rotateRoll(float value)
+                { this->rotateRoll(Vector2(value, 0)); }
+
+            virtual void fire(unsigned int firemode) {}
+            virtual void reload() {}
+
+            virtual void boost() {}
+            virtual void greet() {}
+            virtual void useItem() {}
+            virtual void dropItems() {}
+            virtual void switchCamera();
+            virtual void mouseLook();
+
+            inline const std::string& getHudTemplate() const
+                { return this->hudtemplate_; }
+
+            inline Camera* getCamera() const
+                { return this->camera_; }
+            inline OverlayGroup* getHUD() const
+                { return this->hud_; }
+
+            void addCameraPosition(CameraPosition* position);
+            CameraPosition* getCameraPosition(unsigned int index) const;
+            inline const std::list<CameraPosition*>& getCameraPositions() const
+                { return this->cameraPositions_; }
+
+            inline void setCameraPositionTemplate(const std::string& name)
+                { this->cameraPositionTemplate_ = name; }
+            inline const std::string& getCameraPositionTemkplate() const
+                { return this->cameraPositionTemplate_; }
+
+            inline void setReverseCamera(CameraPosition* camera)
+                { this->reverseCamera_ = camera; }
+            inline CameraPosition* getReverseCamera() const
+                { return this->reverseCamera_; }
+
+            using WorldEntity::setPosition;
+            using WorldEntity::setOrientation;
+            using MobileEntity::setVelocity;
+            using MobileEntity::setAngularVelocity;
+
+            void setPosition(const Vector3& position);
+            void setOrientation(const Quaternion& orientation);
+            void setVelocity(const Vector3& velocity);
+            void setAngularVelocity(const Vector3& velocity);
+
+            inline bool hasLocalController() const
+                { return this->bHasLocalController_; }
+            inline bool hasHumanController() const
+                { return this->bHasHumanController_; }
+
+            inline bool isInMouseLook() const
+                { return this->bMouseLook_; }
+            inline float getMouseLookSpeed() const
+                { return this->mouseLookSpeed_; }
+
+            inline Controller* getXMLController() const
+                { return this->xmlcontroller_; }
+
+        protected:
+            virtual void setPlayer(PlayerInfo* player); // don't call this directly, use friend class PlayerInfo instead
+            virtual void removePlayer();                // don't call this directly, use friend class PlayerInfo instead
+
+            virtual void startLocalHumanControl();
+            virtual void stopLocalHumanControl();
+            virtual void parentChanged();
+
+            inline void setHudTemplate(const std::string& name)
+                { this->hudtemplate_ = name; }
+
+        private:
+            void setXMLController(Controller* controller);
+
+            void overwrite();
+            void processOverwrite();
+
+            void processServerPosition();
+            void processServerLinearVelocity();
+            void processServerOrientation();
+            void processServerAngularVelocity();
+
+            void processClientPosition();
+            void processClientLinearVelocity();
+            void processClientOrientation();
+            void processClientAngularVelocity();
+
+            void networkcallback_changedplayerID();
+
+            // Bullet btMotionState related
+            void setWorldTransform(const btTransform& worldTrans);
+
+            unsigned int server_overwrite_;
+            unsigned int client_overwrite_;
+
+            bool bHasLocalController_;
+            bool bHasHumanController_;
+            bool bDestroyWhenPlayerLeft_;
+
+            Vector3 server_position_;
+            Vector3 client_position_;
+            Vector3 server_linear_velocity_;
+            Vector3 client_linear_velocity_;
+            Quaternion server_orientation_;
+            Quaternion client_orientation_;
+            Vector3 server_angular_velocity_;
+            Vector3 client_angular_velocity_;
+
+            PlayerInfo* player_;
+            unsigned int playerID_;
+
+            std::string hudtemplate_;
+            OverlayGroup* hud_;
+
+            Camera* camera_;
+            bool bMouseLook_;
+            float mouseLookSpeed_;
+            Ogre::SceneNode* cameraPositionRootNode_;
+            std::list<CameraPosition*> cameraPositions_;
+            std::string cameraPositionTemplate_;
+            Controller* xmlcontroller_;
+            CameraPosition* reverseCamera_;
+    };
+}
+
+#endif /* _ControllableEntity_H__ */
Index: code/trunk/src/orxonox/worldentities/ExplosionChunk.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/ExplosionChunk.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/ExplosionChunk.cc	(revision 5781)
@@ -0,0 +1,165 @@
+/*
+ *   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 "ExplosionChunk.h"
+
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "core/GameMode.h"
+#include "util/Exception.h"
+#include "Scene.h"
+#include "tools/ParticleInterface.h"
+
+namespace orxonox
+{
+    CreateFactory(ExplosionChunk);
+
+    ExplosionChunk::ExplosionChunk(BaseObject* creator) : MovableEntity(creator)
+    {
+        RegisterObject(ExplosionChunk);
+
+        if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
+            ThrowException(AbortLoading, "Can't create ExplosionChunk, no scene or no scene manager given.");
+
+        this->bStop_ = false;
+        this->LOD_ = LODParticle::Normal;
+
+        if ( GameMode::showsGraphics() )
+        {
+            try
+            {
+                this->fire_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/fire4", this->LOD_);
+                this->attachOgreObject(this->fire_->getParticleSystem());
+                this->smoke_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
+                this->attachOgreObject(this->smoke_->getParticleSystem());
+            }
+            catch (...)
+            {
+                COUT(1) << "Error: Couln't load particle effect in ExplosionChunk: " << Exception::handleMessage() << std::endl;
+                this->fire_ = 0;
+                this->smoke_ = 0;
+            }
+        }
+        else
+        {
+            this->fire_ = 0;
+            this->smoke_ = 0;
+        }
+
+        if (GameMode::isMaster())
+        {
+            Vector3 velocity(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1));
+            velocity.normalise();
+            velocity *= rnd(60, 80);
+            this->setVelocity(velocity);
+
+            this->destroyTimer_.setTimer(rnd(1, 2), false, this, createExecutor(createFunctor(&ExplosionChunk::stop)));
+        }
+
+        this->registerVariables();
+    }
+
+    ExplosionChunk::~ExplosionChunk()
+    {
+        if (this->isInitialized())
+        {
+            if (this->fire_)
+            {
+                this->detachOgreObject(this->fire_->getParticleSystem());
+                delete this->fire_;
+            }
+            if (this->smoke_)
+            {
+                this->detachOgreObject(this->smoke_->getParticleSystem());
+                delete this->smoke_;
+            }
+        }
+    }
+
+    void ExplosionChunk::registerVariables()
+    {
+        registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::LODchanged));
+        registerVariable(this->bStop_,       VariableDirection::ToClient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::checkStop));
+    }
+
+    void ExplosionChunk::LODchanged()
+    {
+        if (this->fire_)
+            this->fire_->setDetailLevel(this->LOD_);
+        if (this->smoke_)
+            this->smoke_->setDetailLevel(this->LOD_);
+    }
+
+    void ExplosionChunk::checkStop()
+    {
+        if (this->bStop_)
+            this->stop();
+    }
+
+    void ExplosionChunk::stop()
+    {
+        if (this->fire_)
+            this->fire_->setEnabled(false);
+        if (this->smoke_)
+            this->smoke_->setEnabled(false);
+
+        if (GameMode::isMaster())
+        {
+            this->bStop_ = true;
+            this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&ExplosionChunk::destroy)));
+        }
+    }
+
+    void ExplosionChunk::destroy()
+    {
+        delete this;
+    }
+
+    void ExplosionChunk::tick(float dt)
+    {
+        static const unsigned int CHANGES_PER_SECOND = 5;
+
+        if (GameMode::isMaster() && rnd() < dt*CHANGES_PER_SECOND)
+        {
+            float length = this->getVelocity().length();
+
+            Vector3 change(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1));
+            change.normalise();
+            change *= rnd(0.4f, 0.8f);
+            Vector3 velocity = this->getVelocity();
+            velocity.normalise();
+            velocity += change;
+            velocity.normalise();
+            velocity *= length * rnd(0.8f, 1.0f);
+
+            this->setVelocity(velocity);
+        }
+
+        SUPER(ExplosionChunk, tick, dt);
+    }
+}
Index: code/trunk/src/orxonox/worldentities/ExplosionChunk.h
===================================================================
--- code/trunk/src/orxonox/worldentities/ExplosionChunk.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/ExplosionChunk.h	(revision 5781)
@@ -0,0 +1,67 @@
+/*
+ *   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 _ExplosionChunk_H__
+#define _ExplosionChunk_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/Timer.h"
+#include "MovableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ExplosionChunk : public MovableEntity
+    {
+        public:
+            ExplosionChunk(BaseObject* creator);
+            virtual ~ExplosionChunk();
+
+            virtual void tick(float dt);
+            void registerVariables();
+
+            inline void setLOD(LODParticle::Value level)
+                { this->LOD_ = level; this->LODchanged(); }
+            inline LODParticle::Value getLOD() const
+                { return this->LOD_; }
+
+        private:
+            void LODchanged();
+            void checkStop();
+            void stop();
+            void destroy();
+
+            bool                  bStop_;
+            ParticleInterface*    fire_;
+            ParticleInterface*    smoke_;
+            LODParticle::Value      LOD_;
+            Timer<ExplosionChunk> destroyTimer_;
+    };
+}
+
+#endif /* _ExplosionChunk_H__ */
Index: code/trunk/src/orxonox/worldentities/MobileEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/MobileEntity.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/MobileEntity.cc	(revision 5781)
@@ -0,0 +1,208 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      Martin Stypinski
+ *
+ */
+
+#include "MobileEntity.h"
+
+#include <OgreSceneNode.h>
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "Scene.h"
+
+namespace orxonox
+{
+    MobileEntity::MobileEntity(BaseObject* creator) : WorldEntity(creator)
+    {
+        RegisterObject(MobileEntity);
+
+        this->linearAcceleration_  = Vector3::ZERO;
+        this->linearVelocity_      = Vector3::ZERO;
+        this->angularAcceleration_ = Vector3::ZERO;
+        this->angularVelocity_     = Vector3::ZERO;
+
+        this->registerVariables();
+    }
+
+    MobileEntity::~MobileEntity()
+    {
+    }
+
+    void MobileEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(MobileEntity, XMLPort, xmlelement, mode);
+
+        XMLPortParamTemplate(MobileEntity, "velocity",     setVelocity,     getVelocity,     xmlelement, mode, const Vector3&);
+
+        Vector3 rotationAxis(this->getRotationAxis());
+        Degree rotationRate = this->getRotationRate();
+        XMLPortParamVariable(MobileEntity, "rotationaxis", rotationAxis, xmlelement, mode);
+        XMLPortParamVariable(MobileEntity, "rotationrate", rotationRate, xmlelement, mode);
+        if (mode == XMLPort::LoadObject)
+        {
+            if (rotationAxis == Vector3::ZERO)
+                this->setAngularVelocity(Vector3::ZERO);
+            else
+                this->setAngularVelocity(rotationAxis.normalisedCopy() * rotationRate.valueRadians());
+        }
+    }
+
+    void MobileEntity::tick(float dt)
+    {
+        if (this->isActive())
+        {
+            // Check whether Bullet doesn't do the physics for us
+            if (!this->isDynamic())
+            {
+                // Linear part
+                this->linearVelocity_.x += this->linearAcceleration_.x * dt;
+                this->linearVelocity_.y += this->linearAcceleration_.y * dt;
+                this->linearVelocity_.z += this->linearAcceleration_.z * dt;
+                this->node_->translate(this->linearVelocity_ * dt);
+
+                // Angular part
+                // Note: angularVelocity_ is a Quaternion with w = 0 while angularAcceleration_ is a Vector3
+                this->angularVelocity_.x += angularAcceleration_.x * dt;
+                this->angularVelocity_.y += angularAcceleration_.y * dt;
+                this->angularVelocity_.z += angularAcceleration_.z * dt;
+                // Calculate new orientation with quaternion derivative. This is about 30% faster than with angle/axis method.
+                float mult = dt * 0.5f;
+                // TODO: this could be optimized by writing it out. The calls currently create 4 new Quaternions!
+                Quaternion newOrientation(0.0f, this->angularVelocity_.x * mult, this->angularVelocity_.y * mult, this->angularVelocity_.z * mult);
+                newOrientation = this->node_->getOrientation() + newOrientation * this->node_->getOrientation();
+                newOrientation.normalise();
+                this->node_->setOrientation(newOrientation);
+            }
+        }
+    }
+
+    void MobileEntity::setPosition(const Vector3& position)
+    {
+        if (this->isDynamic())
+        {
+            btTransform transf = this->physicalBody_->getWorldTransform();
+            transf.setOrigin(btVector3(position.x, position.y, position.z));
+            this->physicalBody_->setWorldTransform(transf);
+        }
+
+        this->node_->setPosition(position);
+    }
+
+    void MobileEntity::setOrientation(const Quaternion& orientation)
+    {
+        if (this->isDynamic())
+        {
+            btTransform transf = this->physicalBody_->getWorldTransform();
+            transf.setRotation(btQuaternion(orientation.x, orientation.y, orientation.z, orientation.w));
+            this->physicalBody_->setWorldTransform(transf);
+        }
+
+        this->node_->setOrientation(orientation);
+    }
+
+    void MobileEntity::setVelocity(const Vector3& velocity)
+    {
+        if (this->isDynamic())
+            this->physicalBody_->setLinearVelocity(btVector3(velocity.x, velocity.y, velocity.z));
+
+        this->linearVelocity_ = velocity;
+    }
+
+    void MobileEntity::setAngularVelocity(const Vector3& velocity)
+    {
+        if (this->isDynamic())
+            this->physicalBody_->setAngularVelocity(btVector3(velocity.x, velocity.y, velocity.z));
+
+        this->angularVelocity_ = velocity;
+    }
+
+    void MobileEntity::setAcceleration(const Vector3& acceleration)
+    {
+        if (this->isDynamic())
+            this->physicalBody_->applyCentralForce(btVector3(acceleration.x * this->getMass(), acceleration.y * this->getMass(), acceleration.z * this->getMass()));
+
+        this->linearAcceleration_ = acceleration;
+    }
+
+    void MobileEntity::setAngularAcceleration(const Vector3& acceleration)
+    {
+        if (this->isDynamic())
+        {
+            btVector3 inertia(btVector3(1, 1, 1) / this->physicalBody_->getInvInertiaDiagLocal());
+            this->physicalBody_->applyTorque(btVector3(acceleration.x, acceleration.y, acceleration.z) * inertia);
+        }
+
+        this->angularAcceleration_ = acceleration;
+    }
+
+    void MobileEntity::applyCentralForce(const Vector3& force)
+    {
+        if (this->isDynamic())
+            this->physicalBody_->applyCentralForce(btVector3(force.x * this->getMass(), force.y * this->getMass(), force.z * this->getMass()));
+    }
+
+    bool MobileEntity::isCollisionTypeLegal(WorldEntity::CollisionType type) const
+    {
+        if (type == WorldEntity::Static)
+        {
+            CCOUT(1) << "Error: Cannot tell a MobileEntity to have static collision type! Ignoring." << std::endl;
+            assert(false); // Only in debug mode
+            return false;
+        }
+        else
+            return true;
+    }
+
+    void MobileEntity::setWorldTransform(const btTransform& worldTrans)
+    {
+        // We use a dynamic body. So we translate our node accordingly.
+        this->node_->setPosition(Vector3(worldTrans.getOrigin().x(), worldTrans.getOrigin().y(), worldTrans.getOrigin().z()));
+        btQuaternion temp(worldTrans.getRotation());
+        this->node_->setOrientation(Quaternion(temp.w(), temp.x(), temp.y(), temp.z()));
+        this->linearVelocity_.x = this->physicalBody_->getLinearVelocity().x();
+        this->linearVelocity_.y = this->physicalBody_->getLinearVelocity().y();
+        this->linearVelocity_.z = this->physicalBody_->getLinearVelocity().z();
+        this->angularVelocity_.x = this->physicalBody_->getAngularVelocity().x();
+        this->angularVelocity_.y = this->physicalBody_->getAngularVelocity().y();
+        this->angularVelocity_.z = this->physicalBody_->getAngularVelocity().z();
+    }
+
+    void MobileEntity::getWorldTransform(btTransform& worldTrans) const
+    {
+        // We use a kinematic body
+        worldTrans.setOrigin(btVector3(node_->getPosition().x, node_->getPosition().y, node_->getPosition().z));
+        worldTrans.setRotation(btQuaternion(node_->getOrientation().x, node_->getOrientation().y, node_->getOrientation().z, node_->getOrientation().w));
+        if (this->isDynamic())
+        {
+            // This function gets called only once for dynamic objects to set the initial conditions
+            // We have to set the velocities too.
+            this->physicalBody_->setLinearVelocity(btVector3(linearVelocity_.x, linearVelocity_.y, linearVelocity_.z));
+            this->physicalBody_->setAngularVelocity(btVector3(angularVelocity_.x, angularVelocity_.y, angularVelocity_.z));
+        }
+    }
+}
Index: code/trunk/src/orxonox/worldentities/MobileEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/MobileEntity.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/MobileEntity.h	(revision 5781)
@@ -0,0 +1,107 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      Martin Stypinski
+ *
+ */
+
+#ifndef _MobileEntity_H__
+#define _MobileEntity_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Math.h"
+#include "tools/interfaces/Tickable.h"
+#include "WorldEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport MobileEntity : public WorldEntity, public Tickable
+    {
+        public:
+            MobileEntity(BaseObject* creator);
+            virtual ~MobileEntity();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+
+            virtual void setPosition(const Vector3& position);
+            virtual void setOrientation(const Quaternion& orientation);
+
+            virtual void setVelocity(const Vector3& velocity);
+            inline void setVelocity(float x, float y, float z)
+                { this->setVelocity(Vector3(x, y, z)); }
+            inline const Vector3& getVelocity() const
+                { return this->linearVelocity_; }
+            inline Vector3 getLocalVelocity() const
+                { return (this->getOrientation().Inverse() * this->getVelocity()); }
+
+            virtual void setAngularVelocity(const Vector3& velocity);
+            inline void setAngularVelocity(float x, float y, float z)
+                { this->setAngularVelocity(Vector3(x, y, z)); }
+            inline const Vector3& getAngularVelocity() const
+                { return this->angularVelocity_; }
+
+            void setAcceleration(const Vector3& acceleration);
+            inline void setAcceleration(float x, float y, float z)
+                { this->setAcceleration(Vector3(x, y, z)); }
+            inline const Vector3& getAcceleration() const
+                { return this->linearAcceleration_; }
+
+            void setAngularAcceleration(const Vector3& acceleration);
+            inline void setAngularAcceleration(float x, float y, float z)
+                { this->setAngularAcceleration(Vector3(x, y, z)); }
+            inline const Vector3& getAngularAcceleration() const
+                { return this->angularAcceleration_; }
+
+            void applyCentralForce(const Vector3& force);
+            inline void applyCentralForce(float x, float y, float z)
+                { this->applyCentralForce(Vector3(x, y, z)); }
+
+            inline void setRotationRate(Degree rate)
+                { this->setAngularVelocity(this->getAngularVelocity().normalisedCopy() * rate.valueRadians()); }
+            inline Degree getRotationRate() const
+                { return Degree(this->getAngularVelocity().length()); }
+
+            inline void setRotationAxis(const Vector3& axis)
+                { this->setAngularVelocity(axis * this->getAngularVelocity().length()); }
+            inline Vector3 getRotationAxis() const
+                { return this->getAngularVelocity().normalisedCopy(); }
+
+        protected:
+            // Bullet btMotionState related
+            virtual void setWorldTransform(const btTransform& worldTrans);
+            void getWorldTransform(btTransform& worldTrans) const;
+
+            Vector3 linearAcceleration_;
+            Vector3 linearVelocity_;
+            Vector3 angularAcceleration_;
+            Vector3 angularVelocity_;
+
+        private:
+            virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
+    };
+}
+
+#endif /* _MobileEntity_H__ */
Index: code/trunk/src/orxonox/worldentities/MovableEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/MovableEntity.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/MovableEntity.cc	(revision 5781)
@@ -0,0 +1,119 @@
+/*
+ *   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
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "MovableEntity.h"
+
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    static const float MAX_RESYNCHRONIZE_TIME = 3.0f;
+    static const float CONTINUOUS_SYNCHRONIZATION_TIME = 10.0f;
+
+    CreateFactory(MovableEntity);
+
+    MovableEntity::MovableEntity(BaseObject* creator) : MobileEntity(creator)
+    {
+        RegisterObject(MovableEntity);
+
+        this->overwrite_position_    = Vector3::ZERO;
+        this->overwrite_orientation_ = Quaternion::IDENTITY;
+
+        this->continuousResynchroTimer_ = 0;
+
+        this->setPriority(Priority::Low);
+
+        this->registerVariables();
+    }
+
+    MovableEntity::~MovableEntity()
+    {
+        if (this->isInitialized())
+            if (this->continuousResynchroTimer_)
+                delete this->continuousResynchroTimer_;
+    }
+
+    void MovableEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(MovableEntity, XMLPort, xmlelement, mode);
+
+        XMLPortParam(MovableEntity, "enablecollisiondamage", setEnableCollisionDamage, getEnableCollisionDamage, xmlelement, mode).defaultValues(false);
+        XMLPortParam(MovableEntity, "collisiondamage", setCollisionDamage, getCollisionDamage, xmlelement, mode).defaultValues(1);
+    }
+
+    bool MovableEntity::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+    {
+        if (GameMode::isMaster() && enableCollisionDamage_)
+        {
+            Pawn* victim = orxonox_cast<Pawn*>(otherObject);
+            if (victim)
+            {
+                victim->damage(this->collisionDamage_ * (victim->getVelocity() - this->getVelocity()).length());
+            }
+        }
+
+        return false;
+    }
+
+
+    void MovableEntity::registerVariables()
+    {
+        registerVariable(this->linearVelocity_,        VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processLinearVelocity));
+        registerVariable(this->angularVelocity_,       VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processAngularVelocity));
+
+        registerVariable(this->overwrite_position_,    VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
+        registerVariable(this->overwrite_orientation_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
+    }
+
+    void MovableEntity::clientConnected(unsigned int clientID)
+    {
+        this->resynchronizeTimer_.setTimer(rnd() * MAX_RESYNCHRONIZE_TIME, false, this, createExecutor(createFunctor(&MovableEntity::resynchronize)));
+    }
+
+    void MovableEntity::clientDisconnected(unsigned int clientID)
+    {
+    }
+
+    void MovableEntity::resynchronize()
+    {
+        if (GameMode::isMaster() && !this->continuousResynchroTimer_)
+        {
+            // Resynchronise every few seconds because we only work with velocities (no positions)
+            continuousResynchroTimer_ = new Timer<MovableEntity>(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),
+                true, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), false);
+        }
+
+        this->overwrite_position_ = this->getPosition();
+        this->overwrite_orientation_ = this->getOrientation();
+    }
+}
Index: code/trunk/src/orxonox/worldentities/MovableEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/MovableEntity.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/MovableEntity.h	(revision 5781)
@@ -0,0 +1,107 @@
+/*
+ *   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
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _MovableEntity_H__
+#define _MovableEntity_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Math.h"
+#include "network/ClientConnectionListener.h"
+#include "tools/Timer.h"
+#include "MobileEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport MovableEntity : public MobileEntity, public ClientConnectionListener
+    {
+        public:
+            MovableEntity(BaseObject* creator);
+            virtual ~MovableEntity();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+            void registerVariables();
+
+            using WorldEntity::setPosition;
+            using WorldEntity::setOrientation;
+
+            inline void setPosition(const Vector3& position)
+                { MobileEntity::setPosition(position); this->overwrite_position_ = this->getPosition(); }
+            inline void setOrientation(const Quaternion& orientation)
+                { MobileEntity::setOrientation(orientation); this->overwrite_orientation_ = this->getOrientation(); }
+
+            inline void setOwner(Pawn* owner)
+                { this->owner_ = owner; }
+            inline Pawn* getOwner() const
+                { return this->owner_; }
+
+            inline void setCollisionDamage(float c)
+                { this->collisionDamage_ = c; }
+
+            inline float getCollisionDamage()
+                { return this->collisionDamage_; }
+
+            inline void setEnableCollisionDamage(bool c)
+            { 
+                this->enableCollisionDamage_ = c; 
+                this->enableCollisionCallback();
+            } 
+
+            inline bool getEnableCollisionDamage()
+                { return this->enableCollisionDamage_; }
+
+        private:
+            void clientConnected(unsigned int clientID);
+            void clientDisconnected(unsigned int clientID);
+            void resynchronize();
+
+            inline void processLinearVelocity()
+                { this->setVelocity(this->linearVelocity_); }
+            inline void processAngularVelocity()
+                { this->setAngularVelocity(this->angularVelocity_); }
+
+            inline void overwritePosition()
+                { this->setPosition(this->overwrite_position_); }
+            inline void overwriteOrientation()
+                { this->setOrientation(this->overwrite_orientation_); }
+
+            Vector3    overwrite_position_;
+            Quaternion overwrite_orientation_;
+
+            Timer<MovableEntity> resynchronizeTimer_;
+            Timer<MovableEntity>* continuousResynchroTimer_;
+
+            Pawn* owner_;
+            float collisionDamage_;
+            bool enableCollisionDamage_;
+    };
+}
+
+#endif /* _MovableEntity_H__ */
Index: code/trunk/src/orxonox/worldentities/SpawnPoint.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/SpawnPoint.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/SpawnPoint.cc	(revision 5781)
@@ -0,0 +1,107 @@
+/*
+ *   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 "SpawnPoint.h"
+
+#include "core/CoreIncludes.h"
+#include "core/Template.h"
+#include "core/XMLPort.h"
+#include "gametypes/Gametype.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    CreateFactory(SpawnPoint);
+
+    SpawnPoint::SpawnPoint(BaseObject* creator) : StaticEntity(creator)
+    {
+        RegisterObject(SpawnPoint);
+
+        this->template_ = 0;
+
+        if (this->getGametype())
+            this->getGametype()->registerSpawnPoint(this);
+        else
+            COUT(1) << "Error: SpawnPoint has no Gametype" << std::endl;
+
+        this->setObjectMode(0x0);
+    }
+
+    void SpawnPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(SpawnPoint, XMLPort, xmlelement, mode);
+
+        XMLPortParam(SpawnPoint, "spawnclass", setSpawnClassName, getSpawnClassName, xmlelement, mode);
+        XMLPortParam(SpawnPoint, "pawndesign", setTemplateName, getTemplateName, xmlelement, mode);
+    }
+
+    void SpawnPoint::setSpawnClassName(const std::string& name)
+    {
+        this->spawnclassname_ = name;
+        this->spawnclass_ = ClassByString(name);
+    }
+
+    void SpawnPoint::setTemplateName(const std::string& name)
+    {
+        this->templatename_ = name;
+        this->template_ = Template::getTemplate(name);
+    }
+
+    void SpawnPoint::setTemplate(Template* temp)
+    {
+        this->template_ = temp;
+        this->templatename_ = temp->getName();
+    }
+
+    Pawn* SpawnPoint::spawn()
+    {
+        Pawn* entity = this->spawnclass_.fabricate(this);
+        if (entity)
+        {
+            this->getGametype()->pawnPreSpawn(entity);
+
+            this->spawn(entity);
+
+            if (this->template_)
+                entity->addTemplate(this->template_);
+
+            entity->postSpawn();
+
+            this->getGametype()->pawnPostSpawn(entity);
+
+            this->fireEvent();
+        }
+        return entity;
+    }
+
+    void SpawnPoint::spawn(ControllableEntity* entity)
+    {
+        entity->setPosition(this->getWorldPosition());
+        entity->setOrientation(this->getWorldOrientation());
+    }
+}
Index: code/trunk/src/orxonox/worldentities/SpawnPoint.h
===================================================================
--- code/trunk/src/orxonox/worldentities/SpawnPoint.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/SpawnPoint.h	(revision 5781)
@@ -0,0 +1,76 @@
+/*
+ *   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 _SpawnPoint_H__
+#define _SpawnPoint_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "core/Identifier.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport SpawnPoint : public StaticEntity
+    {
+        public:
+            SpawnPoint(BaseObject* creator);
+            virtual ~SpawnPoint() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            inline void setSpawnClass(Identifier* identifier)
+                { this->spawnclass_ = identifier; this->spawnclassname_ = identifier->getName(); }
+            inline Identifier* getSpawnClass() const
+                { return this->spawnclass_; }
+
+            void setTemplate(Template* temp);
+            inline Template* getTemplate() const
+                { return this->template_; }
+
+            Pawn* spawn();
+            void spawn(ControllableEntity* entity);
+
+        private:
+            void setSpawnClassName(const std::string& name);
+            inline const std::string& getSpawnClassName() const
+                { return this->spawnclassname_; }
+
+            void setTemplateName(const std::string& name);
+            inline const std::string& getTemplateName() const
+                { return this->templatename_; }
+
+            SubclassIdentifier<Pawn> spawnclass_;
+            std::string spawnclassname_;
+            Template* template_;
+            std::string templatename_;
+    };
+}
+
+#endif /* _SpawnPoint_H__ */
Index: code/trunk/src/orxonox/worldentities/StaticEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/StaticEntity.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/StaticEntity.cc	(revision 5781)
@@ -0,0 +1,117 @@
+/*
+ *   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
+ *      Reto Grieder (physics)
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "StaticEntity.h"
+
+#include <OgreSceneNode.h>
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+#include "util/OrxAssert.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(StaticEntity);
+
+    StaticEntity::StaticEntity(BaseObject* creator) : WorldEntity(creator)
+    {
+        RegisterObject(StaticEntity);
+        
+        this->setPriority(Priority::VeryLow);
+
+        this->registerVariables();
+    }
+
+    StaticEntity::~StaticEntity()
+    {
+    }
+
+    void StaticEntity::registerVariables()
+    {
+        registerVariable(this->getPosition(),    VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged));
+        registerVariable(this->getOrientation(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged));
+    }
+
+
+    void StaticEntity::setPosition(const Vector3& position)
+    {
+        if (this->addedToPhysicalWorld())
+        {
+            CCOUT(2) << "Warning: Attempting to change the position of a StaticEntity at physics run time. Ignoring change." << std::endl;
+            return;
+        }
+        if (this->isStatic())
+        {
+            btTransform transf = this->physicalBody_->getWorldTransform();
+            transf.setOrigin(btVector3(position.x, position.y, position.z));
+            this->physicalBody_->setWorldTransform(transf);
+        }
+
+        this->node_->setPosition(position);
+    }
+
+    void StaticEntity::setOrientation(const Quaternion& orientation)
+    {
+        if (this->addedToPhysicalWorld())
+        {
+            CCOUT(2) << "Warning: Attempting to change the orientation of a StaticEntity at physics run time. Ignoring change." << std::endl;
+            return;
+        }
+        if (this->isStatic())
+        {
+            btTransform transf = this->physicalBody_->getWorldTransform();
+            transf.setRotation(btQuaternion(orientation.x, orientation.y, orientation.z, orientation.w));
+            this->physicalBody_->setWorldTransform(transf);
+        }
+
+        this->node_->setOrientation(orientation);
+    }
+
+    bool StaticEntity::isCollisionTypeLegal(WorldEntity::CollisionType type) const
+    {
+        if (type == WorldEntity::Kinematic || type == WorldEntity::Dynamic)
+        {
+            CCOUT(1) << "Error: Cannot tell a StaticEntity to have kinematic or dynamic collision type! Ignoring." << std::endl;
+            assert(false); // Only in debug mode
+            return false;
+        }
+        else
+            return true;
+    }
+
+    void StaticEntity::setWorldTransform(const btTransform& worldTrans)
+    {
+        OrxAssert(false, "Setting world transform of a StaticEntity, which is CF_STATIC!");
+    }
+
+    void StaticEntity::getWorldTransform(btTransform& worldTrans) const
+    {
+        worldTrans.setOrigin(btVector3(node_->getPosition().x, node_->getPosition().y, node_->getPosition().z));
+        worldTrans.setRotation(btQuaternion(node_->getOrientation().x, node_->getOrientation().y, node_->getOrientation().z, node_->getOrientation().w));
+    }
+}
Index: code/trunk/src/orxonox/worldentities/StaticEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/StaticEntity.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/StaticEntity.h	(revision 5781)
@@ -0,0 +1,67 @@
+/*
+ *   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
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _StaticEntity_H__
+#define _StaticEntity_H__
+
+#include "OrxonoxPrereqs.h"
+#include "WorldEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport StaticEntity : public WorldEntity
+    {
+        public:
+            StaticEntity(BaseObject* creator);
+            virtual ~StaticEntity();
+
+            void registerVariables();
+
+            using WorldEntity::setPosition;
+            using WorldEntity::setOrientation;
+
+            void setPosition(const Vector3& position);
+            void setOrientation(const Quaternion& orientation);
+
+        private:
+            bool isCollisionTypeLegal(CollisionType type) const;
+
+            // network callbacks
+            inline void positionChanged()
+                { this->setPosition(this->getPosition()); }
+            inline void orientationChanged()
+                { this->setOrientation(this->getOrientation()); }
+
+            // Bullet btMotionState related
+            void setWorldTransform(const btTransform& worldTrans);
+            void getWorldTransform(btTransform& worldTrans) const;
+    };
+}
+
+#endif /* _StaticEntity_H__ */
Index: code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/TeamSpawnPoint.cc	(revision 5781)
@@ -0,0 +1,51 @@
+/*
+ *   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 "TeamSpawnPoint.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(TeamSpawnPoint);
+
+    TeamSpawnPoint::TeamSpawnPoint(BaseObject* creator) : SpawnPoint(creator)
+    {
+        RegisterObject(TeamSpawnPoint);
+
+        this->teamNumber_ = 0;
+    }
+
+    void TeamSpawnPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(TeamSpawnPoint, XMLPort, xmlelement, mode);
+
+        XMLPortParam(TeamSpawnPoint, "team", setTeamNumber, getTeamNumber, xmlelement, mode).defaultValues(0);
+    }
+}
Index: code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h
===================================================================
--- code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/TeamSpawnPoint.h	(revision 5781)
@@ -0,0 +1,57 @@
+/*
+ *   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 _TeamSpawnPoint_H__
+#define _TeamSpawnPoint_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "worldentities/pawns/Pawn.h"
+#include "SpawnPoint.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport TeamSpawnPoint : public SpawnPoint
+    {
+        public:
+            TeamSpawnPoint(BaseObject* creator);
+            virtual ~TeamSpawnPoint() {}
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            void setTeamNumber(unsigned int team)
+                { this->teamNumber_ = team; }
+            unsigned int getTeamNumber() const
+                { return this->teamNumber_; }
+
+        private:
+            unsigned int teamNumber_;
+    };
+}
+
+#endif /* _TeamSpawnPoint_H__ */
Index: code/trunk/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/WorldEntity.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/WorldEntity.cc	(revision 5781)
@@ -0,0 +1,926 @@
+/*
+ *   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
+ *      Reto Grieder (physics)
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "WorldEntity.h"
+
+#include <OgreBillboardSet.h>
+#include <OgreCamera.h>
+#include <OgreEntity.h>
+#include <OgreParticleSystem.h>
+#include <OgreSceneManager.h>
+#include <OgreSceneNode.h>
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+#include <boost/static_assert.hpp>
+
+#include "util/OrxAssert.h"
+#include "util/Convert.h"
+#include "util/Exception.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "Scene.h"
+#include "collisionshapes/WorldEntityCollisionShape.h"
+
+namespace orxonox
+{
+    const Vector3 WorldEntity::FRONT = Vector3::NEGATIVE_UNIT_Z;
+    const Vector3 WorldEntity::BACK  = Vector3::UNIT_Z;
+    const Vector3 WorldEntity::LEFT  = Vector3::NEGATIVE_UNIT_X;
+    const Vector3 WorldEntity::RIGHT = Vector3::UNIT_X;
+    const Vector3 WorldEntity::DOWN  = Vector3::NEGATIVE_UNIT_Y;
+    const Vector3 WorldEntity::UP    = Vector3::UNIT_Y;
+
+    // Be sure we don't do bad conversions
+    BOOST_STATIC_ASSERT((int)Ogre::Node::TS_LOCAL  == (int)WorldEntity::Local);
+    BOOST_STATIC_ASSERT((int)Ogre::Node::TS_PARENT == (int)WorldEntity::Parent);
+    BOOST_STATIC_ASSERT((int)Ogre::Node::TS_WORLD  == (int)WorldEntity::World);
+
+    /**
+    @brief
+        Creates a new WorldEntity that may immediately be used.
+        All the default values are being set here.
+    */
+    WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
+    {
+        RegisterObject(WorldEntity);
+
+        if (!this->getScene() || !this->getScene()->getRootSceneNode())
+            ThrowException(AbortLoading, "Can't create WorldEntity, no scene or no root-scenenode given.");
+
+        this->node_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
+
+        this->parent_ = 0;
+        this->parentID_ = OBJECTID_UNKNOWN;
+        this->bDeleteWithParent_ = true;
+
+        this->node_->setPosition(Vector3::ZERO);
+        this->node_->setOrientation(Quaternion::IDENTITY);
+
+
+        // Default behaviour does not include physics
+        this->physicalBody_   = 0;
+        this->bPhysicsActive_ = false;
+        this->bPhysicsActiveSynchronised_    = false;
+        this->bPhysicsActiveBeforeAttaching_ = false;
+        this->collisionShape_ = new WorldEntityCollisionShape(this);
+        this->collisionType_             = None;
+        this->collisionTypeSynchronised_ = None;
+        this->mass_           = 0;
+        this->childrenMass_   = 0;
+        // Using bullet default values
+        this->restitution_    = 0;
+        this->angularFactor_  = 1;
+        this->linearDamping_  = 0;
+        this->angularDamping_ = 0;
+        this->friction_       = 0.5;
+        this->bCollisionCallbackActive_ = false;
+        this->bCollisionResponseActive_ = true;
+
+        this->registerVariables();
+    }
+
+    /**
+    @brief
+        Destroys the WorldEntity AND ALL its children with it.
+    */
+    WorldEntity::~WorldEntity()
+    {
+        if (this->isInitialized())
+        {
+            if (this->parent_)
+                this->detachFromParent();
+
+            for (std::set<WorldEntity*>::const_iterator it = this->children_.begin(); it != this->children_.end(); )
+            {
+                if ((*it)->getDeleteWithParent())
+                    delete (*(it++));
+                else
+                {
+                    (*it)->setPosition(this->getWorldPosition());
+                    this->detach(*(it++));
+                }
+            }
+
+            if (this->physicalBody_)
+            {
+                this->deactivatePhysics();
+                delete this->physicalBody_;
+            }
+            delete this->collisionShape_;
+
+            this->node_->detachAllObjects();
+            this->node_->removeAllChildren();
+
+            OrxAssert(this->getScene()->getSceneManager(), "No SceneManager defined in a WorldEntity.");
+            this->getScene()->getSceneManager()->destroySceneNode(this->node_->getName());
+        }
+    }
+
+    void WorldEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(WorldEntity, XMLPort, xmlelement, mode);
+
+        XMLPortParamTemplate(WorldEntity, "position",    setPosition,    getPosition,    xmlelement, mode, const Vector3&);
+        XMLPortParamTemplate(WorldEntity, "orientation", setOrientation, getOrientation, xmlelement, mode, const Quaternion&);
+        XMLPortParamTemplate(WorldEntity, "scale3D",     setScale3D,     getScale3D,     xmlelement, mode, const Vector3&);
+        XMLPortParam        (WorldEntity, "scale",       setScale,       getScale,       xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "lookat",      lookAt_xmlport,       xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "direction",   setDirection_xmlport, xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "yaw",         yaw_xmlport,          xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "pitch",       pitch_xmlport,        xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "roll",        roll_xmlport,         xmlelement, mode);
+        XMLPortParam        (WorldEntity, "deletewithparent", setDeleteWithParent, getDeleteWithParent, xmlelement, mode);
+
+        // Physics
+        XMLPortParam(WorldEntity, "collisionType",     setCollisionTypeStr,  getCollisionTypeStr,  xmlelement, mode);
+        XMLPortParam(WorldEntity, "collisionResponse", setCollisionResponse, hasCollisionResponse, xmlelement, mode);
+        XMLPortParam(WorldEntity, "mass",              setMass,              getMass,              xmlelement, mode);
+        XMLPortParam(WorldEntity, "restitution",       setRestitution,       getRestitution,       xmlelement, mode);
+        XMLPortParam(WorldEntity, "angularFactor",     setAngularFactor,     getAngularFactor,     xmlelement, mode);
+        XMLPortParam(WorldEntity, "linearDamping",     setLinearDamping,     getLinearDamping,     xmlelement, mode);
+        XMLPortParam(WorldEntity, "angularDamping",    setAngularDamping,    getAngularDamping,    xmlelement, mode);
+        XMLPortParam(WorldEntity, "friction",          setFriction,          getFriction,          xmlelement, mode);
+
+        // Other attached WorldEntities
+        XMLPortObject(WorldEntity, WorldEntity, "attached", attach, getAttachedObject, xmlelement, mode);
+        // Attached collision shapes
+        XMLPortObject(WorldEntity, CollisionShape, "collisionShapes", attachCollisionShape, getAttachedCollisionShape, xmlelement, mode);
+    }
+
+    void WorldEntity::registerVariables()
+    {
+        registerVariable(this->mainStateName_,  VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainState));
+
+        registerVariable(this->bActive_,        VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
+        registerVariable(this->bVisible_,       VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
+
+        registerVariable(this->getScale3D(),    VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged));
+
+        // Physics stuff
+        registerVariable(this->mass_,           VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::massChanged));
+        registerVariable(this->restitution_,    VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::restitutionChanged));
+        registerVariable(this->angularFactor_,  VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularFactorChanged));
+        registerVariable(this->linearDamping_,  VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::linearDampingChanged));
+        registerVariable(this->angularDamping_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularDampingChanged));
+        registerVariable(this->friction_,       VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::frictionChanged));
+        registerVariable(this->bCollisionCallbackActive_,
+                                                VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionCallbackActivityChanged));
+        registerVariable(this->bCollisionResponseActive_,
+                                                VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionResponseActivityChanged));
+        registerVariable((int&)this->collisionTypeSynchronised_,
+                                                VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionTypeChanged));
+        registerVariable(this->bPhysicsActiveSynchronised_,
+                                                VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::physicsActivityChanged));
+
+        // Attach to parent if necessary
+        registerVariable(this->parentID_,       VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged));
+    }
+
+    /**
+    @brief
+        Network function that object this instance to its correct parent.
+    */
+    void WorldEntity::networkcallback_parentChanged()
+    {
+        if (this->parentID_ != OBJECTID_UNKNOWN)
+        {
+            WorldEntity* parent = orxonox_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_));
+            if (parent)
+                this->attachToParent(parent);
+        }
+    }
+
+    /**
+    @brief
+        Attaches this object to a parent SceneNode.
+    @Remarks
+        Only use this method if you know exactly what you're doing!
+        Normally, attaching works internally by attaching WE's.
+    */
+    void WorldEntity::attachToNode(Ogre::SceneNode* node)
+    {
+        Ogre::Node* parent = this->node_->getParent();
+        if (parent)
+            parent->removeChild(this->node_);
+        node->addChild(this->node_);
+    }
+
+    /**
+    @brief
+        Detaches this object from a parent SceneNode.
+    @Remarks
+        Only use this method if you know exactly what you're doing!
+        Normally, attaching works internally by attaching WE's.
+    */
+    void WorldEntity::detachFromNode(Ogre::SceneNode* node)
+    {
+        node->removeChild(this->node_);
+//        this->getScene()->getRootSceneNode()->addChild(this->node_);
+    }
+
+    /**
+    @brief
+        Network callback for the collision type. Only change the type if it was valid.
+    */
+    void WorldEntity::collisionTypeChanged()
+    {
+        if (this->collisionTypeSynchronised_ != Dynamic &&
+            this->collisionTypeSynchronised_ != Kinematic &&
+            this->collisionTypeSynchronised_ != Static &&
+            this->collisionTypeSynchronised_ != None)
+        {
+            CCOUT(1) << "Error when collsion Type was received over network. Unknown enum value:" << this->collisionTypeSynchronised_ << std::endl;
+        }
+        else if (this->collisionTypeSynchronised_ != collisionType_)
+        {
+            if (this->parent_)
+                CCOUT(2) << "Warning: Network connection tried to set the collision type of an attached WE. Ignoring." << std::endl;
+            else
+                this->setCollisionType(this->collisionTypeSynchronised_);
+        }
+    }
+
+    //! Network callback for this->bPhysicsActive_
+    void WorldEntity::physicsActivityChanged()
+    {
+        if (this->bPhysicsActiveSynchronised_)
+            this->activatePhysics();
+        else
+            this->deactivatePhysics();
+    }
+
+    //! Function sets whether Bullet should issue a callback on collisions
+    void WorldEntity::collisionCallbackActivityChanged()
+    {
+        if (this->hasPhysics())
+        {
+            if (this->bCollisionCallbackActive_)
+                this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() |
+                    btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
+            else
+                this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() &
+                    ~btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK);
+        }
+    }
+
+    //! Function sets whether Bullet should react itself to a collision
+    void WorldEntity::collisionResponseActivityChanged()
+    {
+        if (this->hasPhysics())
+        {
+            if (this->bCollisionResponseActive_)
+                this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() &
+                    ~btCollisionObject::CF_NO_CONTACT_RESPONSE);
+            else
+                this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() |
+                    btCollisionObject::CF_NO_CONTACT_RESPONSE);
+        }
+    }
+
+    /**
+    @brief
+        Attaches a child WorldEntity to this object. This calls notifyBeingAttached()
+        of the child WE.
+    @Note
+        The collision shape of the child object gets attached nevertheless. That also means
+        that you can change the collision shape of the child and it correctly cascadeds the changes to this instance.
+        Be aware of this implication: When implementing attaching of kinematic objects to others, you have to change
+        this behaviour because you then might not want to merge the collision shapes.
+    */
+    void WorldEntity::attach(WorldEntity* object)
+    {
+        if (object == this)
+        {
+            COUT(2) << "Warning: Can't attach a WorldEntity to itself." << std::endl;
+            return;
+        }
+
+        if (!object->notifyBeingAttached(this))
+            return;
+
+        this->attachNode(object->node_);
+        this->children_.insert(object);
+
+        this->attachCollisionShape(object->collisionShape_);
+        // mass
+        this->childrenMass_ += object->getMass();
+        recalculateMassProps();
+    }
+
+    /**
+    @brief
+        Function gets called when this object is being attached to a new parent.
+
+        This operation is only allowed if the collision types "like" each other.
+        - You cannot a attach a non physical object to a physical one.
+        - Dynamic object can NOT be attached at all.
+        - It is also not possible to attach a kinematic to a dynamic one.
+        - Attaching of kinematic objects otherwise is not yet supported.
+    */
+    bool WorldEntity::notifyBeingAttached(WorldEntity* newParent)
+    {
+        // check first whether attaching is even allowed
+        if (this->hasPhysics())
+        {
+            if (!newParent->hasPhysics())
+            {
+                COUT(2) << "Warning: Cannot attach a physical object to a non physical one." << std::endl;
+                return false;
+            }
+            else if (this->isDynamic())
+            {
+                COUT(2) << "Warning: Cannot attach a dynamic object to a WorldEntity." << std::endl;
+                return false;
+            }
+            else if (this->isKinematic() && newParent->isDynamic())
+            {
+                COUT(2) << "Warning: Cannot attach a kinematic object to a dynamic one." << std::endl;
+                return false;
+            }
+            else if (this->isKinematic())
+            {
+                COUT(2) << "Warning: Cannot attach a kinematic object to a static or kinematic one: Not yet implemented." << std::endl;
+                return false;
+            }
+        }
+
+        if (this->isPhysicsActive())
+            this->bPhysicsActiveBeforeAttaching_ = true;
+        this->deactivatePhysics();
+
+        if (this->parent_)
+            this->detachFromParent();
+
+        this->parent_ = newParent;
+        this->parentID_ = newParent->getObjectID();
+
+        this->parentChanged();
+
+        // apply transform to collision shape
+        this->collisionShape_->setPosition(this->getPosition());
+        this->collisionShape_->setOrientation(this->getOrientation());
+        // TODO: Scale
+
+        return true;
+    }
+
+    /**
+    @brief
+        Detaches a child WorldEntity from this instance.
+    */
+    void WorldEntity::detach(WorldEntity* object)
+    {
+        if (this->children_.find(object) == this->children_.end())
+        {
+            CCOUT(2) << "Warning: Cannot detach an object that is not a child." << std::endl;
+            return;
+        }
+
+        // collision shapes
+        this->detachCollisionShape(object->collisionShape_);
+
+        // mass
+        if (object->getMass() > 0.0f)
+        {
+            this->childrenMass_ -= object->getMass();
+            recalculateMassProps();
+        }
+
+        this->detachNode(object->node_);
+        this->children_.erase(object);
+
+        object->notifyDetached();
+    }
+
+    /**
+    @brief
+        Function gets called when the object has been detached from its parent.
+    */
+    void WorldEntity::notifyDetached()
+    {
+        this->parent_ = 0;
+        this->parentID_ = OBJECTID_UNKNOWN;
+
+        this->parentChanged();
+
+        // reset orientation of the collisionShape (cannot be set within a WE usually)
+        this->collisionShape_->setPosition(Vector3::ZERO);
+        this->collisionShape_->setOrientation(Quaternion::IDENTITY);
+        // TODO: Scale
+
+        if (this->bPhysicsActiveBeforeAttaching_)
+        {
+            this->activatePhysics();
+            this->bPhysicsActiveBeforeAttaching_ = false;
+        }
+    }
+
+    //! Returns an attached object (merely for XMLPort).
+    WorldEntity* WorldEntity::getAttachedObject(unsigned int index)
+    {
+        unsigned int i = 0;
+        for (std::set<WorldEntity*>::const_iterator it = this->children_.begin(); it != this->children_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+
+    //! Attaches an Ogre::SceneNode to this WorldEntity.
+    void WorldEntity::attachNode(Ogre::SceneNode* node)
+    {
+        Ogre::Node* parent = node->getParent();
+        if (parent)
+            parent->removeChild(node);
+        this->node_->addChild(node);
+    }
+
+    //! Detaches an Ogre::SceneNode from this WorldEntity.
+    void WorldEntity::detachNode(Ogre::SceneNode* node)
+    {
+        this->node_->removeChild(node);
+//        this->getScene()->getRootSceneNode()->addChild(node);
+    }
+
+    //! Attaches an Ogre::MovableObject to this WorldEntity.
+    void WorldEntity::attachOgreObject(Ogre::MovableObject* object)
+        { this->node_->attachObject(object); }
+    void WorldEntity::attachOgreObject(Ogre::BillboardSet* object)
+        { this->node_->attachObject(object); }
+    void WorldEntity::attachOgreObject(Ogre::Camera* object)
+        { this->node_->attachObject(object); }
+    void WorldEntity::attachOgreObject(Ogre::Entity* object)
+        { this->node_->attachObject(object); }
+    void WorldEntity::attachOgreObject(Ogre::ParticleSystem* object)
+        { this->node_->attachObject(object); }
+
+    //! Detaches an Ogre::MovableObject from this WorldEntity.
+    void WorldEntity::detachOgreObject(Ogre::MovableObject* object)
+        { this->node_->detachObject(object); }
+    void WorldEntity::detachOgreObject(Ogre::BillboardSet* object)
+        { this->node_->detachObject(object); }
+    void WorldEntity::detachOgreObject(Ogre::Camera* object)
+        { this->node_->detachObject(object); }
+    void WorldEntity::detachOgreObject(Ogre::Entity* object)
+        { this->node_->detachObject(object); }
+    void WorldEntity::detachOgreObject(Ogre::ParticleSystem* object)
+        { this->node_->detachObject(object); }
+
+    //! Detaches an Ogre::MovableObject (by string) from this WorldEntity.
+    Ogre::MovableObject* WorldEntity::detachOgreObject(const Ogre::String& name)
+    {
+        return this->node_->detachObject(name);
+    }
+
+    //! Attaches a collision Shape to this object (delegated to the internal CompoundCollisionShape)
+    void WorldEntity::attachCollisionShape(CollisionShape* shape)
+    {
+        this->collisionShape_->attach(shape);
+        // Note: this->collisionShape_ already notifies us of any changes.
+    }
+
+    //! Detaches a collision Shape from this object (delegated to the internal CompoundCollisionShape)
+    void WorldEntity::detachCollisionShape(CollisionShape* shape)
+    {
+        // Note: The collision shapes may not be detached with this function!
+        this->collisionShape_->detach(shape);
+        // Note: this->collisionShape_ already notifies us of any changes.
+    }
+
+    //! Returns an attached collision Shape of this object (delegated to the internal CompoundCollisionShape)
+    CollisionShape* WorldEntity::getAttachedCollisionShape(unsigned int index)
+    {
+        return this->collisionShape_->getAttachedShape(index);
+    }
+
+    // Note: These functions are placed in WorldEntity.h as inline functions for the release build.
+#ifndef ORXONOX_RELEASE
+    const Vector3& WorldEntity::getPosition() const
+    {
+        return this->node_->getPosition();
+    }
+
+    const Quaternion& WorldEntity::getOrientation() const
+    {
+        return this->node_->getOrientation();
+    }
+
+    const Vector3& WorldEntity::getScale3D() const
+    {
+        return this->node_->getScale();
+    }
+#endif
+
+    //! Returns the position relative to the root space
+    const Vector3& WorldEntity::getWorldPosition() const
+    {
+        return this->node_->_getDerivedPosition();
+    }
+
+    //! Returns the orientation relative to the root space
+    const Quaternion& WorldEntity::getWorldOrientation() const
+    {
+        return this->node_->_getDerivedOrientation();
+    }
+
+    //! Returns the scaling applied relative to the root space in 3 coordinates
+    const Vector3& WorldEntity::getWorldScale3D() const
+    {
+        return this->node_->_getDerivedScale();
+    }
+
+    /**
+    @brief
+        Returns the scaling applied relative to the root space in 3 coordinates
+    @return
+        Returns the scaling if it is uniform, 1.0f otherwise.
+    */
+    float WorldEntity::getWorldScale() const
+    {
+        Vector3 scale = this->getWorldScale3D();
+        return (scale.x == scale.y && scale.x == scale.z) ? scale.x : 1;
+    }
+
+    /**
+    @brief
+        Sets the three dimensional scaling of this object.
+    @Note
+        Scaling physical objects has not yet been implemented and is therefore forbidden.
+    */
+    void WorldEntity::setScale3D(const Vector3& scale)
+    {
+/*
+HACK HACK HACK
+        if (bScalePhysics && this->hasPhysics() && scale != Vector3::UNIT_SCALE)
+        {
+            CCOUT(2) << "Warning: Cannot set the scale of a physical object: Not yet implemented. Ignoring scaling." << std::endl;
+            return;
+        }
+HACK HACK HACK
+*/
+        this->node_->setScale(scale);
+
+        this->changedScale();
+    }
+
+    /**
+    @brief
+        Translates this WorldEntity by a vector.
+    @param relativeTo
+        @see WorldEntity::TransformSpace
+    */
+    void WorldEntity::translate(const Vector3& distance, TransformSpace relativeTo)
+    {
+        switch (relativeTo)
+        {
+        case WorldEntity::Local:
+            // position is relative to parent so transform downwards
+            this->setPosition(this->getPosition() + this->getOrientation() * distance);
+            break;
+        case WorldEntity::Parent:
+            this->setPosition(this->getPosition() + distance);
+            break;
+        case WorldEntity::World:
+            // position is relative to parent so transform upwards
+            if (this->node_->getParent())
+                setPosition(getPosition() + (node_->getParent()->_getDerivedOrientation().Inverse() * distance)
+                    / node_->getParent()->_getDerivedScale());
+            else
+                this->setPosition(this->getPosition() + distance);
+            break;
+        }
+    }
+
+    /**
+    @brief
+        Rotates this WorldEntity by a quaternion.
+    @param relativeTo
+        @see WorldEntity::TransformSpace
+    */
+    void WorldEntity::rotate(const Quaternion& rotation, TransformSpace relativeTo)
+    {
+        switch(relativeTo)
+        {
+        case WorldEntity::Local:
+            this->setOrientation(this->getOrientation() * rotation);
+            break;
+        case WorldEntity::Parent:
+            // Rotations are normally relative to local axes, transform up
+            this->setOrientation(rotation * this->getOrientation());
+            break;
+        case WorldEntity::World:
+            // Rotations are normally relative to local axes, transform up
+            this->setOrientation(this->getOrientation() * this->getWorldOrientation().Inverse()
+                * rotation * this->getWorldOrientation());
+            break;
+        }
+    }
+
+    /**
+    @brief
+        Makes this WorldEntity look a specific target location.
+    @param relativeTo
+        @see WorldEntity::TransformSpace
+    @param localDirectionVector
+        The vector which normally describes the natural direction of the object, usually -Z.
+    */
+    void WorldEntity::lookAt(const Vector3& target, TransformSpace relativeTo, const Vector3& localDirectionVector)
+    {
+        Vector3 origin(0, 0, 0);
+        switch (relativeTo)
+        {
+        case WorldEntity::Local:
+            origin = Vector3::ZERO;
+            break;
+        case WorldEntity::Parent:
+            origin = this->getPosition();
+            break;
+        case WorldEntity::World:
+            origin = this->getWorldPosition();
+            break;
+        }
+        this->setDirection(target - origin, relativeTo, localDirectionVector);
+    }
+
+    /**
+    @brief
+        Makes this WorldEntity look in specific direction.
+    @param relativeTo
+        @see WorldEntity::TransformSpace
+    @param localDirectionVector
+        The vector which normally describes the natural direction of the object, usually -Z.
+    */
+    void WorldEntity::setDirection(const Vector3& direction, TransformSpace relativeTo, const Vector3& localDirectionVector)
+    {
+        Quaternion savedOrientation(this->getOrientation());
+        this->node_->setDirection(direction, static_cast<Ogre::Node::TransformSpace>(relativeTo), localDirectionVector);
+        Quaternion newOrientation(this->node_->getOrientation());
+        this->node_->setOrientation(savedOrientation);
+        this->setOrientation(newOrientation);
+    }
+
+    //! Activates physics if the CollisionType is not None.
+    void WorldEntity::activatePhysics()
+    {
+        if (this->isActive() && this->hasPhysics() && !this->isPhysicsActive() && !this->parent_)
+        {
+            this->getScene()->addPhysicalObject(this);
+            this->bPhysicsActive_ = true;
+            this->bPhysicsActiveSynchronised_ = true;
+        }
+    }
+
+    //! Deactivates physics but the CollisionType does not change.
+    void WorldEntity::deactivatePhysics()
+    {
+        if (this->isPhysicsActive())
+        {
+            this->getScene()->removePhysicalObject(this);
+            this->bPhysicsActive_ = false;
+            this->bPhysicsActiveSynchronised_ = false;
+        }
+    }
+
+    //! Tells whether the object has already been added to the Bullet physics World.
+    bool WorldEntity::addedToPhysicalWorld() const
+    {
+        return this->physicalBody_ && this->physicalBody_->isInWorld();
+    }
+
+    /**
+    @brief
+        Sets the CollisionType. This alters the object significantly! @see CollisionType.
+    @Note
+        Operation does not work on attached WorldEntities.
+    */
+    void WorldEntity::setCollisionType(CollisionType type)
+    {
+        if (this->collisionType_ == type)
+            return;
+
+        // If we are already attached to a parent, this would be a bad idea..
+        if (this->parent_)
+        {
+            CCOUT(2) << "Warning: Cannot set the collision type of a WorldEntity with a parent." << std::endl;
+            return;
+        }
+
+        // Check for type legality. Could be StaticEntity or MobileEntity.
+        if (!this->isCollisionTypeLegal(type))
+            return;
+
+        if (this->isPhysicsActive())
+            this->deactivatePhysics();
+
+        bool bReactivatePhysics = true;
+        if (this->hasPhysics() && !this->isPhysicsActive())
+            bReactivatePhysics = false;
+
+        // Check whether we have to create or destroy.
+        if (type != None && this->collisionType_ == None)
+        {
+/*
+HACK HACK HACK
+            // Check whether there was some scaling applied.
+            if (!this->node_->getScale().positionEquals(Vector3(1, 1, 1), 0.001))
+            {
+                CCOUT(2) << "Warning: Cannot create a physical body if there is scaling applied to the node: Not yet implemented." << std::endl;
+                return;
+            }
+HACK HACK HACK
+*/
+            // Create new rigid body
+            btRigidBody::btRigidBodyConstructionInfo bodyConstructionInfo(0, this, this->collisionShape_->getCollisionShape());
+            this->physicalBody_ = new btRigidBody(bodyConstructionInfo);
+            this->physicalBody_->setUserPointer(this);
+            this->physicalBody_->setActivationState(DISABLE_DEACTIVATION);
+        }
+        else if (type == None && this->collisionType_ != None)
+        {
+            // Destroy rigid body
+            assert(this->physicalBody_);
+            deactivatePhysics();
+            delete this->physicalBody_;
+            this->physicalBody_ = 0;
+            this->collisionType_ = None;
+            this->collisionTypeSynchronised_ = None;
+            return;
+        }
+
+        // Change type
+        switch (type)
+        {
+        case Dynamic:
+            this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_STATIC_OBJECT & !btCollisionObject::CF_KINEMATIC_OBJECT);
+            break;
+        case Kinematic:
+            this->physicalBody_->setCollisionFlags((this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_STATIC_OBJECT) | btCollisionObject::CF_KINEMATIC_OBJECT);
+            break;
+        case Static:
+            this->physicalBody_->setCollisionFlags((this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_KINEMATIC_OBJECT) | btCollisionObject::CF_STATIC_OBJECT);
+            break;
+        case None:
+            assert(false); // Doesn't happen
+            return;
+        }
+        this->collisionType_ = type;
+        this->collisionTypeSynchronised_ = type;
+
+        // update mass and inertia tensor
+        recalculateMassProps();
+        internalSetPhysicsProps();
+        collisionCallbackActivityChanged();
+        collisionResponseActivityChanged();
+        if (bReactivatePhysics)
+            activatePhysics();
+    }
+
+    //! Sets the CollisionType by string (used for the XMLPort)
+    void WorldEntity::setCollisionTypeStr(const std::string& typeStr)
+    {
+        std::string typeStrLower = getLowercase(typeStr);
+        CollisionType type;
+        if (typeStrLower == "dynamic")
+            type = Dynamic;
+        else if (typeStrLower == "static")
+            type = Static;
+        else if (typeStrLower == "kinematic")
+            type = Kinematic;
+        else if (typeStrLower == "none")
+            type = None;
+        else
+            ThrowException(ParseError, std::string("Attempting to set an unknown collision type: '") + typeStr + "'.");
+        this->setCollisionType(type);
+    }
+
+    //! Gets the CollisionType by string (used for the XMLPort)
+    std::string WorldEntity::getCollisionTypeStr() const
+    {
+        switch (this->getCollisionType())
+        {
+            case Dynamic:
+                return "dynamic";
+            case Kinematic:
+                return "kinematic";
+            case Static:
+                return "static";
+            case None:
+                return "none";
+            default:
+                assert(false);
+                return "";
+        }
+    }
+
+    /**
+    @brief
+        Recalculates the accumulated child mass and calls recalculateMassProps()
+        and notifies the parent of the change.
+    @Note
+        Called by a child WE
+    */
+    void WorldEntity::notifyChildMassChanged()
+    {
+        // Note: CollisionShape changes of a child get handled over the internal CompoundCollisionShape already
+        // Recalculate mass
+        this->childrenMass_ = 0.0f;
+        for (std::set<WorldEntity*>::const_iterator it = this->children_.begin(); it != this->children_.end(); ++it)
+            this->childrenMass_ += (*it)->getMass();
+        recalculateMassProps();
+        // Notify parent WE
+        if (this->parent_)
+            parent_->notifyChildMassChanged();
+    }
+
+    /**
+    @brief
+        Undertakes the necessary steps to change the collision shape in Bullet, even at runtime.
+    @Note
+        - called by this->collisionShape_
+        - May have a REALLY big overhead when called continuously at runtime, because then we need
+          to remove the physical body from Bullet and add it again.
+    */
+    void WorldEntity::notifyCollisionShapeChanged()
+    {
+        if (hasPhysics())
+        {
+            // Bullet doesn't like sudden changes of the collision shape, so we remove and add it again
+            if (this->addedToPhysicalWorld())
+            {
+                this->deactivatePhysics();
+                this->physicalBody_->setCollisionShape(this->collisionShape_->getCollisionShape());
+                this->activatePhysics();
+            }
+            else
+                this->physicalBody_->setCollisionShape(this->collisionShape_->getCollisionShape());
+        }
+        recalculateMassProps();
+    }
+
+    //! Updates all mass dependent parameters (mass, inertia tensor and child mass)
+    void WorldEntity::recalculateMassProps()
+    {
+        // Store local inertia for faster access. Evaluates to (0,0,0) if there is no collision shape.
+        float totalMass = this->mass_ + this->childrenMass_;
+        this->collisionShape_->calculateLocalInertia(totalMass, this->localInertia_);
+        if (this->hasPhysics())
+        {
+            if (this->isStatic())
+            {
+                // Just set everything to zero
+                this->physicalBody_->setMassProps(0.0f, btVector3(0, 0, 0));
+            }
+            else if ((this->mass_ + this->childrenMass_) == 0.0f)
+            {
+                // Use default values to avoid very large or very small values
+                CCOUT(4) << "Warning: Setting the internal physical mass to 1.0 because mass_ is 0.0" << std::endl;
+                btVector3 inertia(0, 0, 0);
+                this->collisionShape_->calculateLocalInertia(1.0f, inertia);
+                this->physicalBody_->setMassProps(1.0f, inertia);
+            }
+            else
+            {
+                this->physicalBody_->setMassProps(totalMass, this->localInertia_);
+            }
+        }
+    }
+
+    //! Copies our own parameters for restitution, angular factor, dampings and friction to the bullet rigid body.
+    void WorldEntity::internalSetPhysicsProps()
+    {
+        if (this->hasPhysics())
+        {
+            this->physicalBody_->setRestitution(this->restitution_);
+            this->physicalBody_->setAngularFactor(this->angularFactor_);
+            this->physicalBody_->setDamping(this->linearDamping_, this->angularDamping_);
+            this->physicalBody_->setFriction(this->friction_);
+        }
+    }
+}
Index: code/trunk/src/orxonox/worldentities/WorldEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/WorldEntity.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/WorldEntity.h	(revision 5781)
@@ -0,0 +1,466 @@
+/*
+ *   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
+ *      Reto Grieder (physics)
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _WorldEntity_H__
+#define _WorldEntity_H__
+
+#include "OrxonoxPrereqs.h"
+
+#ifdef ORXONOX_RELEASE
+#  include <OgreSceneNode.h>
+#endif
+#include <LinearMath/btMotionState.h>
+
+#include "util/Math.h"
+#include "util/OgreForwardRefs.h"
+#include "core/BaseObject.h"
+#include "network/synchronisable/Synchronisable.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        The WorldEntity represents everything that can be put in a Scene at a certain location.
+
+        It is supposed to be the base class of everything you would call an 'object' in a Scene.
+        The class itself is abstract which means you cannot use it directly. You may use StaticEntity
+        as the simplest derivative or (derived from MobileEntity) MovableEntity and ControllableEntity
+        as more advanced ones.
+
+        The basic task of the WorldEntity is provide a location, a direction and a scaling and the possibility
+        to create an entire hierarchy of derivated objects.
+        It is also the basis for the physics interface to the Bullet physics engine.
+        Every WorldEntity can have a specific collision type: @see CollisionType
+        This would then imply that every scene object could have any collision type. To limit this, you can always
+        override this->isCollisionTypeLegal(CollisionType). Return false if the collision type is not supported
+        for a specific object.
+        There is also support for attaching WorldEntities with physics to each other. Currently, the collision shape
+        of both objects simply get merged into one larger shape (for static collision type).
+        The phyiscal body that is internally stored and administrated has the following supported properties:
+        - Restitution, angular factor, linear damping, angular damping, fricition, mass and collision shape.
+        You can get more information at the corresponding set function.
+
+        Collision shapes: These are controlled by the internal WorldEntityCollisionShape. @see WorldEntityCollisionShape.
+    */
+    class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable, public btMotionState
+    {
+        friend class Scene;
+
+        public:
+            // Define our own transform space enum to avoid Ogre includes here
+            /**
+            @brief
+                Enumeration denoting the spaces which a transform can be relative to.
+            */
+            enum TransformSpace
+            {
+                //! Transform is relative to the local space
+                Local,
+                //! Transform is relative to the space of the parent node
+                Parent,
+                //! Transform is relative to world space
+                World
+            };
+
+        public:
+            WorldEntity(BaseObject* creator);
+            virtual ~WorldEntity();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            inline const Ogre::SceneNode* getNode() const
+                { return this->node_; }
+
+            static const Vector3 FRONT;
+            static const Vector3 BACK;
+            static const Vector3 LEFT;
+            static const Vector3 RIGHT;
+            static const Vector3 DOWN;
+            static const Vector3 UP;
+
+            virtual void setPosition(const Vector3& position) = 0;
+            inline void setPosition(float x, float y, float z)
+                { this->setPosition(Vector3(x, y, z)); }
+            const Vector3& getPosition() const;
+            const Vector3& getWorldPosition() const;
+
+            void translate(const Vector3& distance, TransformSpace relativeTo = WorldEntity::Parent);
+            inline void translate(float x, float y, float z, TransformSpace relativeTo = WorldEntity::Parent)
+                { this->translate(Vector3(x, y, z), relativeTo); }
+
+            virtual inline const Vector3& getVelocity() const
+                { return Vector3::ZERO; }
+
+            virtual void setOrientation(const Quaternion& orientation) = 0;
+            inline void setOrientation(float w, float x, float y, float z)
+                { this->setOrientation(Quaternion(w, x, y, z)); }
+            inline void setOrientation(const Vector3& axis, const Radian& angle)
+                { this->setOrientation(Quaternion(angle, axis)); }
+            inline void setOrientation(const Vector3& axis, const Degree& angle)
+                { this->setOrientation(Quaternion(angle, axis)); }
+            const Quaternion& getOrientation() const;
+            const Quaternion& getWorldOrientation() const;
+
+            void rotate(const Quaternion& rotation, TransformSpace relativeTo = WorldEntity::Local);
+            inline void rotate(const Vector3& axis, const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
+                { this->rotate(Quaternion(angle, axis), relativeTo); }
+
+            inline void yaw(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
+                { this->rotate(Quaternion(angle, Vector3::UNIT_Y), relativeTo); }
+            inline void pitch(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
+                { this->rotate(Quaternion(angle, Vector3::UNIT_X), relativeTo); }
+            inline void roll(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
+                { this->rotate(Quaternion(angle, Vector3::UNIT_Z), relativeTo); }
+
+            void lookAt(const Vector3& target, TransformSpace relativeTo = WorldEntity::Parent, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
+            void setDirection(const Vector3& direction, TransformSpace relativeTo = WorldEntity::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
+            inline void setDirection(float x, float y, float z, TransformSpace relativeTo = WorldEntity::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z)
+                { this->setDirection(Vector3(x, y, z), relativeTo, localDirectionVector); }
+
+            virtual void setScale3D(const Vector3& scale);
+            inline void setScale3D(float x, float y, float z)
+                { this->setScale3D(Vector3(x, y, z)); }
+            const Vector3& getScale3D() const;
+            const Vector3& getWorldScale3D() const;
+
+            inline void setScale(float scale)
+                { this->setScale3D(scale, scale, scale); }
+            inline float getScale() const
+                { Vector3 scale = this->getScale3D(); return (scale.x == scale.y && scale.x == scale.z) ? scale.x : 1; }
+            float getWorldScale() const;
+
+            inline void scale3D(const Vector3& scale)
+                { this->setScale3D(this->getScale3D() * scale); }
+            inline void scale3D(float x, float y, float z)
+                { this->scale3D(Vector3(x, y, z)); }
+            inline void scale(float scale)
+                { this->scale3D(scale, scale, scale); }
+
+            virtual void changedScale() {}
+
+            void attach(WorldEntity* object);
+            void detach(WorldEntity* object);
+            WorldEntity* getAttachedObject(unsigned int index);
+            inline const std::set<WorldEntity*>& getAttachedObjects() const
+                { return this->children_; }
+
+            void attachOgreObject(Ogre::MovableObject*  object);
+            void attachOgreObject(Ogre::BillboardSet*   object);
+            void attachOgreObject(Ogre::Camera*         object);
+            void attachOgreObject(Ogre::Entity*         object);
+            void attachOgreObject(Ogre::ParticleSystem* object);
+
+            void detachOgreObject(Ogre::MovableObject*  object);
+            void detachOgreObject(Ogre::BillboardSet*   object);
+            void detachOgreObject(Ogre::Camera*         object);
+            void detachOgreObject(Ogre::Entity*         object);
+            void detachOgreObject(Ogre::ParticleSystem* object);
+
+            Ogre::MovableObject* detachOgreObject(const Ogre::String& name);
+
+            inline void attachToParent(WorldEntity* parent)
+                { parent->attach(this); }
+            inline void detachFromParent()
+                { if (this->parent_) { this->parent_->detach(this); } }
+            inline WorldEntity* getParent() const
+                { return this->parent_; }
+
+            void attachNode(Ogre::SceneNode* node);
+            void detachNode(Ogre::SceneNode* node);
+            void attachToNode(Ogre::SceneNode* node);
+            void detachFromNode(Ogre::SceneNode* node);
+
+            inline void setDeleteWithParent(bool value)
+                { this->bDeleteWithParent_ = value; }
+            inline bool getDeleteWithParent() const
+                { return this->bDeleteWithParent_; }
+
+            void notifyChildPropsChanged();
+
+        protected:
+            virtual void parentChanged() {}
+
+            Ogre::SceneNode* node_;
+
+        private:
+            inline void lookAt_xmlport(const Vector3& target)
+                { this->lookAt(target); }
+            inline void setDirection_xmlport(const Vector3& direction)
+                { this->setDirection(direction); }
+            inline void yaw_xmlport(const Degree& angle)
+                { this->yaw(angle); }
+            inline void pitch_xmlport(const Degree& angle)
+                { this->pitch(angle); }
+            inline void roll_xmlport(const Degree& angle)
+                { this->roll(angle); }
+
+            // network callbacks
+            void networkcallback_parentChanged();
+            inline void scaleChanged()
+                { this->setScale3D(this->getScale3D()); }
+
+            WorldEntity* parent_;
+            unsigned int parentID_;
+            std::set<WorldEntity*> children_;
+            bool bDeleteWithParent_;
+
+
+        /////////////
+        // Physics //
+        /////////////
+
+        public:
+            /**
+            @brief
+                Denotes the possible types of physical objects in a Scene.
+
+                Dynamic:   The object is influenced by its physical environment, like for instance little ball.
+                Kinematic: The object can only influence other dynamic objects. It's movement is coordinated by your own saying.
+                Static:    Like kinematic but the object is not allowed to move during the simulation.
+                None:      The object has no physics at all.
+            */
+            enum CollisionType
+            {
+                Dynamic,
+                Kinematic,
+                Static,
+                None
+            };
+
+            //! Tells whether the object has any connection to the Bullet physics engine. If hasPhysics() is false, the object may still have a velocity.
+            bool hasPhysics()       const { return getCollisionType() != None     ; }
+            //! @see CollisionType
+            bool isStatic()         const { return getCollisionType() == Static   ; }
+            //! @see CollisionType
+            bool isKinematic()      const { return getCollisionType() == Kinematic; }
+            //! @see CollisionType
+            bool isDynamic()        const { return getCollisionType() == Dynamic  ; }
+            //! Tells whether physics has been activated (you can temporarily deactivate it)
+            bool isPhysicsActive()  const { return this->bPhysicsActive_; }
+            bool addedToPhysicalWorld() const;
+
+            void activatePhysics();
+            void deactivatePhysics();
+
+            //! Returns the CollisionType. @see CollisionType.
+            inline CollisionType getCollisionType() const
+                { return this->collisionType_; }
+            void setCollisionType(CollisionType type);
+
+            void setCollisionTypeStr(const std::string& type);
+            std::string getCollisionTypeStr() const;
+
+            //! Sets the mass of this object. Note that the total mass may be influenced by attached objects!
+            inline void setMass(float mass)
+                { this->mass_ = mass; recalculateMassProps(); }
+            //! Returns the mass of this object without its children.
+            inline float getMass() const
+                { return this->mass_; }
+
+            //! Returns the total mass of this object with all its attached children.
+            inline float getTotalMass() const
+                { return this->mass_ + this->childrenMass_; }
+
+            /**
+            @brief
+                Returns the diagonal elements of the inertia tensor when calculated in local coordinates.
+            @Note
+                The local inertia tensor cannot be set, but is calculated by Bullet according to the collisionShape.
+                With compound collision shapes, an approximation is used.
+            */
+            inline const btVector3& getLocalInertia() const
+                { return this->localInertia_; }
+
+            /**
+            @brief
+                Sets how much reaction is applied in a collision.
+
+                Consider two equal spheres colliding with equal velocities:
+                Restitution 1 means that both spheres simply reverse their velocity (no loss of energy)
+                Restitution 0 means that both spheres will immediately stop moving
+                (maximum loss of energy without violating of the preservation of momentum)
+            */
+            inline void setRestitution(float restitution)
+                { this->restitution_ = restitution; internalSetPhysicsProps(); }
+            //! Returns the restitution parameter. @see setRestitution.
+            inline float getRestitution() const
+                { return this->restitution_; }
+
+            /**
+            @brief
+                Sets an artificial parameter that tells how much torque is applied when you apply a non-central force.
+
+                Normally the angular factor is 1, which means it's physically 'correct'. Howerver if you have a player
+                character that should not rotate when hit sideways, you can set the angular factor to 0.
+            */
+            inline void setAngularFactor(float angularFactor)
+                { this->angularFactor_ = angularFactor; internalSetPhysicsProps(); }
+            //! Returns the angular factor. @see setAngularFactor.
+            inline float getAngularFactor() const
+                { return this->angularFactor_; }
+
+            //! Applies a mass independent damping. Velocities will simply diminish exponentially.
+            inline void setLinearDamping(float linearDamping)
+                { this->linearDamping_ = linearDamping; internalSetPhysicsProps(); }
+            //! Returns the linear damping. @see setLinearDamping.
+            inline float getLinearDamping() const
+                { return this->linearDamping_; }
+
+            //! Applies a tensor independent rotation damping. Angular velocities will simply diminish exponentially.
+            inline void setAngularDamping(float angularDamping)
+                { this->angularDamping_ = angularDamping; internalSetPhysicsProps(); }
+            //! Returns the angular damping. @see setAngularDamping.
+            inline float getAngularDamping() const
+                { return this->angularDamping_; }
+
+            //! Applies friction to the object. Friction occurs when two objects collide.
+            inline void setFriction(float friction)
+                { this->friction_ = friction; internalSetPhysicsProps(); }
+            //! Returns the amount of friction applied to the object.
+            inline float getFriction() const
+                { return this->friction_; }
+
+            void attachCollisionShape(CollisionShape* shape);
+            void detachCollisionShape(CollisionShape* shape);
+            CollisionShape* getAttachedCollisionShape(unsigned int index);
+
+            void notifyCollisionShapeChanged();
+            void notifyChildMassChanged();
+
+            /**
+            @brief
+                Virtual function that gets called when this object collides with another.
+            @param otherObject
+                The object this one has collided into.
+            @pram contactPoint
+                Contact point provided by Bullet. Holds more information and can me modified. See return value.
+            @Return
+                Returning false means that no modification to the contactPoint has been made. Return true otherwise!
+            @Note
+                Condition is that enableCollisionCallback() was called.
+            */
+            virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+                { return false; } /* With false, Bullet assumes no modification to the collision objects. */
+
+            //! Enables the collidesAgainst(.) function. The object doesn't respond to collision otherwise!
+            inline void enableCollisionCallback()
+                { this->bCollisionCallbackActive_ = true; this->collisionCallbackActivityChanged(); }
+            //! Disables the collidesAgainst(.) function. @see enableCollisionCallback()
+            inline void disableCollisionCallback()
+                { this->bCollisionCallbackActive_ = false; this->collisionCallbackActivityChanged(); }
+            //! Tells whether there could be a collision callback via collidesAgainst(.)
+            inline bool isCollisionCallbackActive() const
+                { return this->bCollisionCallbackActive_; }
+
+            //! Enables or disables collision response (default is of course on)
+            inline void setCollisionResponse(bool value)
+                { this->bCollisionResponseActive_ = value; this->collisionResponseActivityChanged(); }
+            //! Tells whether there could be a collision response
+            inline bool hasCollisionResponse()
+                { return this->bCollisionResponseActive_; }
+
+        protected:
+            /**
+            @brief
+                Function checks whether the requested collision type is legal to this object.
+
+                You can override this function in a derived class to constrain the collision to e.g. None or Dynamic.
+                A projectile may not prove very useful if there is no physical body. Simply set the CollisionType
+                in its constructor and override this method. But be careful that a derived classe's virtual functions
+                don't yet exist in the constructor if a base class.
+            */
+            virtual bool isCollisionTypeLegal(CollisionType type) const = 0;
+
+            btRigidBody*  physicalBody_; //!< Bullet rigid body. Everything physical is applied to this instance.
+
+        private:
+            void recalculateMassProps();
+            void internalSetPhysicsProps();
+
+            bool notifyBeingAttached(WorldEntity* newParent);
+            void notifyDetached();
+
+            // network callbacks
+            void collisionTypeChanged();
+            void physicsActivityChanged();
+            void collisionCallbackActivityChanged();
+            void collisionResponseActivityChanged();
+            //! Network callback workaround to call a function when the value changes.
+            inline void massChanged()
+                { this->setMass(this->mass_); }
+            //! Network callback workaround to call a function when the value changes.
+            inline void restitutionChanged()
+                { this->setRestitution(this->restitution_); }
+            //! Network callback workaround to call a function when the value changes.
+            inline void angularFactorChanged()
+                { this->setAngularFactor(this->angularFactor_); }
+            //! Network callback workaround to call a function when the value changes.
+            inline void linearDampingChanged()
+                { this->setLinearDamping(this->linearDamping_); }
+            //! Network callback workaround to call a function when the value changes.
+            inline void angularDampingChanged()
+                { this->setAngularDamping(this->angularDamping_); }
+            //! Network callback workaround to call a function when the value changes.
+            inline void frictionChanged()
+                { this->setFriction(this->friction_); }
+
+            CollisionType                collisionType_;                 //!< @see setCollisionType
+            CollisionType                collisionTypeSynchronised_;     //!< Network synchronised variable for collisionType_
+            bool                         bPhysicsActive_;                //!< @see isPhysicsActive
+            bool                         bPhysicsActiveSynchronised_;    //!< Network synchronised variable for bPhysicsActive_
+            //! When attaching objects hierarchically this variable tells this object (as child) whether physics was activated before attaching (because the deactivate physics while being attached).
+            bool                         bPhysicsActiveBeforeAttaching_;
+            WorldEntityCollisionShape*   collisionShape_;                //!< Attached collision shapes go here
+            btScalar                     mass_;                          //!< @see setMass
+            btVector3                    localInertia_;                  //!< @see getLocalInertia
+            btScalar                     restitution_;                   //!< @see setRestitution
+            btScalar                     angularFactor_;                 //!< @see setAngularFactor
+            btScalar                     linearDamping_;                 //!< @see setLinearDamping
+            btScalar                     angularDamping_;                //!< @see setAngularDamping
+            btScalar                     friction_;                      //!< @see setFriction
+            btScalar                     childrenMass_;                  //!< Sum of all the children's masses
+            bool                         bCollisionCallbackActive_;      //!< @see enableCollisionCallback
+            bool                         bCollisionResponseActive_;      //!< Tells whether the object should respond to collisions
+    };
+
+    // Inline heavily used functions for release builds. In debug, we better avoid including OgreSceneNode here.
+#ifdef ORXONOX_RELEASE
+    inline const Vector3& WorldEntity::getPosition() const
+        { return this->node_->getPosition(); }
+    inline const Quaternion& WorldEntity::getOrientation() const
+        { return this->node_->getOrientation(); }
+    inline const Vector3& WorldEntity::getScale3D() const
+        { return this->node_->getScale(); }
+#endif
+
+    SUPER_FUNCTION(5, WorldEntity, changedScale, false);
+}
+
+#endif /* _WorldEntity_H__ */
Index: code/trunk/src/orxonox/worldentities/pawns/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/CMakeLists.txt	(revision 5781)
@@ -0,0 +1,7 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  Spectator.cc
+  Pawn.cc
+  SpaceShip.cc
+  TeamBaseMatchBase.cc
+  Destroyer.cc
+)
Index: code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/Destroyer.cc	(revision 5781)
@@ -0,0 +1,48 @@
+/*
+ *   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:
+ *      Matthias Mock
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Destroyer.h"
+
+#include "core/CoreIncludes.h"
+#include "gametypes/UnderAttack.h"
+
+namespace orxonox
+{
+    CreateFactory(Destroyer);
+
+    Destroyer::Destroyer(BaseObject* creator) : SpaceShip(creator)
+    {
+        RegisterObject(Destroyer);
+
+        UnderAttack* gametype = orxonox_cast<UnderAttack*>(this->getGametype());
+        if (gametype)
+        {
+            gametype->addDestroyer(this);
+        }
+    }
+}
Index: code/trunk/src/orxonox/worldentities/pawns/Destroyer.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Destroyer.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/Destroyer.h	(revision 5781)
@@ -0,0 +1,47 @@
+/*
+ *   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:
+ *      Matthias Mock
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Destroyer_H__
+#define _Destroyer_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "SpaceShip.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Destroyer : public SpaceShip
+    {
+        public:
+            Destroyer(BaseObject* creator);
+            virtual ~Destroyer() {};
+
+    };
+}
+
+#endif /* _Destroyer_H__ */
Index: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc	(revision 5781)
@@ -0,0 +1,362 @@
+/*
+ *   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 "Pawn.h"
+
+#include <algorithm>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "network/NetworkFunction.h"
+
+#include "interfaces/PawnListener.h"
+#include "PawnManager.h"
+#include "infos/PlayerInfo.h"
+#include "gametypes/Gametype.h"
+#include "graphics/ParticleSpawner.h"
+#include "worldentities/ExplosionChunk.h"
+#include "worldentities/BigExplosion.h"
+#include "weaponsystem/WeaponSystem.h"
+#include "weaponsystem/WeaponSlot.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/WeaponSet.h"
+
+
+namespace orxonox
+{
+    CreateFactory(Pawn);
+
+    registerMemberNetworkFunction( Pawn, doFire );
+
+    Pawn::Pawn(BaseObject* creator) : ControllableEntity(creator)
+    {
+        RegisterObject(Pawn);
+
+        PawnManager::touch();
+        this->bAlive_ = true;
+        this->bReload_ = false;
+
+        this->health_ = 0;
+        this->maxHealth_ = 0;
+        this->initialHealth_ = 0;
+
+        this->lastHitOriginator_ = 0;
+
+        this->spawnparticleduration_ = 3.0f;
+
+        this->getPickups().setOwner(this);
+
+        if (GameMode::isMaster())
+        {
+            this->weaponSystem_ = new WeaponSystem(this);
+            this->weaponSystem_->setPawn(this);
+        }
+        else
+            this->weaponSystem_ = 0;
+
+        this->setRadarObjectColour(ColourValue::Red);
+        this->setRadarObjectShape(RadarViewable::Dot);
+
+        this->registerVariables();
+
+        this->isHumanShip_ = this->hasLocalController();
+    }
+
+    Pawn::~Pawn()
+    {
+        if (this->isInitialized())
+        {
+            for (ObjectList<PawnListener>::iterator it = ObjectList<PawnListener>::begin(); it != ObjectList<PawnListener>::end(); ++it)
+                it->destroyedPawn(this);
+
+            if (this->weaponSystem_)
+                delete this->weaponSystem_;
+        }
+    }
+
+    void Pawn::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Pawn, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Pawn, "health", setHealth, getHealth, xmlelement, mode).defaultValues(100);
+        XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
+        XMLPortParam(Pawn, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
+        XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode);
+        XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f);
+        XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(7);
+
+        XMLPortObject(Pawn, WeaponSlot, "weaponslots", addWeaponSlot, getWeaponSlot, xmlelement, mode);
+        XMLPortObject(Pawn, WeaponSet, "weaponsets", addWeaponSet, getWeaponSet, xmlelement, mode);
+        XMLPortObject(Pawn, WeaponPack, "weapons", addWeaponPack, getWeaponPack, xmlelement, mode);
+    }
+
+    void Pawn::registerVariables()
+    {
+        registerVariable(this->bAlive_,        VariableDirection::ToClient);
+        registerVariable(this->health_,        VariableDirection::ToClient);
+        registerVariable(this->initialHealth_, VariableDirection::ToClient);
+        registerVariable(this->bReload_,       VariableDirection::ToServer);
+    }
+
+    void Pawn::tick(float dt)
+    {
+        SUPER(Pawn, tick, dt);
+
+        this->bReload_ = false;
+
+        if (GameMode::isMaster())
+            if (this->health_ <= 0 && bAlive_)
+                this->death();
+    }
+
+    void Pawn::setPlayer(PlayerInfo* player)
+    {
+        ControllableEntity::setPlayer(player);
+
+        if (this->getGametype())
+            this->getGametype()->playerStartsControllingPawn(player, this);
+    }
+
+    void Pawn::removePlayer()
+    {
+        if (this->getGametype())
+            this->getGametype()->playerStopsControllingPawn(this->getPlayer(), this);
+
+        ControllableEntity::removePlayer();
+    }
+
+    void Pawn::setHealth(float health)
+    {
+        this->health_ = std::min(health, this->maxHealth_);
+    }
+
+    void Pawn::damage(float damage, Pawn* originator)
+    {
+        if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
+        {
+            this->setHealth(this->health_ - damage);
+            this->lastHitOriginator_ = originator;
+
+            // play damage effect
+        }
+    }
+
+    void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
+    {
+        if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator))
+        {
+            this->damage(damage, originator);
+            this->setVelocity(this->getVelocity() + force);
+
+            // play hit effect
+        }
+    }
+
+    void Pawn::kill()
+    {
+        this->damage(this->health_);
+        this->death();
+    }
+
+    void Pawn::spawneffect()
+    {
+        // play spawn effect
+        if (this->spawnparticlesource_ != "")
+        {
+            ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
+            effect->setPosition(this->getPosition());
+            effect->setOrientation(this->getOrientation());
+            effect->setDestroyAfterLife(true);
+            effect->setSource(this->spawnparticlesource_);
+            effect->setLifetime(this->spawnparticleduration_);
+        }
+    }
+
+    void Pawn::death()
+    {
+        this->setHealth(1);
+        if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
+        {
+            // Set bAlive_ to false and wait for PawnManager to do the destruction
+            this->bAlive_ = false;
+
+            this->setDestroyWhenPlayerLeft(false);
+
+            this->dropItems();
+
+            if (this->getGametype())
+                this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
+
+            if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this)
+                this->getPlayer()->stopControl();
+
+            if (GameMode::isMaster())
+            {
+//                this->deathEffect();
+                this->goWithStyle();
+            }
+        }
+    }
+    void Pawn::goWithStyle()
+    {
+        this->bAlive_ = false;
+        this->setDestroyWhenPlayerLeft(false);
+
+        BigExplosion* chunk = new BigExplosion(this->getCreator());
+        chunk->setPosition(this->getPosition());
+
+    }
+    void Pawn::deatheffect()
+    {
+        // play death effect
+        {
+            ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
+            effect->setPosition(this->getPosition());
+            effect->setOrientation(this->getOrientation());
+            effect->setDestroyAfterLife(true);
+            effect->setSource("Orxonox/explosion2b");
+            effect->setLifetime(4.0f);
+        }
+        {
+            ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
+            effect->setPosition(this->getPosition());
+            effect->setOrientation(this->getOrientation());
+            effect->setDestroyAfterLife(true);
+            effect->setSource("Orxonox/smoke6");
+            effect->setLifetime(4.0f);
+        }
+        {
+            ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
+            effect->setPosition(this->getPosition());
+            effect->setOrientation(this->getOrientation());
+            effect->setDestroyAfterLife(true);
+            effect->setSource("Orxonox/sparks");
+            effect->setLifetime(4.0f);
+        }
+        for (unsigned int i = 0; i < this->numexplosionchunks_; ++i)
+        {
+            ExplosionChunk* chunk = new ExplosionChunk(this->getCreator());
+            chunk->setPosition(this->getPosition());
+        }
+    }
+
+    void Pawn::fire(unsigned int firemode)
+    {
+        this->doFire(firemode);
+    }
+
+    void Pawn::doFire(uint8_t firemode)
+    {
+        if(GameMode::isMaster())
+        {
+            if (this->weaponSystem_)
+                this->weaponSystem_->fire(firemode);
+        }
+        else
+        {
+            callMemberNetworkFunction(Pawn, doFire, this->getObjectID(), 0, firemode);
+            if (this->weaponSystem_)
+                this->weaponSystem_->fire(firemode);
+        }
+    }
+
+    void Pawn::reload()
+    {
+        this->bReload_ = true;
+    }
+
+    void Pawn::postSpawn()
+    {
+        this->setHealth(this->initialHealth_);
+        if (GameMode::isMaster())
+            this->spawneffect();
+    }
+
+    void Pawn::dropItems()
+    {
+        this->getPickups().clear();
+    }
+
+
+    /* WeaponSystem:
+    *   functions load Slot, Set, Pack from XML and make sure all parent-pointers are set.
+    *   with setWeaponPack you can not just load a Pack from XML but if a Pack already exists anywhere, you can attach it.
+    *       --> e.g. Pickup-Items
+    */
+    void Pawn::addWeaponSlot(WeaponSlot * wSlot)
+    {
+        this->attach(wSlot);
+        if (this->weaponSystem_)
+            this->weaponSystem_->addWeaponSlot(wSlot);
+    }
+
+    WeaponSlot * Pawn::getWeaponSlot(unsigned int index) const
+    {
+        if (this->weaponSystem_)
+            return this->weaponSystem_->getWeaponSlot(index);
+        else
+            return 0;
+    }
+
+    void Pawn::addWeaponSet(WeaponSet * wSet)
+    {
+        if (this->weaponSystem_)
+            this->weaponSystem_->addWeaponSet(wSet);
+    }
+
+    WeaponSet * Pawn::getWeaponSet(unsigned int index) const
+    {
+        if (this->weaponSystem_)
+            return this->weaponSystem_->getWeaponSet(index);
+        else
+            return 0;
+    }
+
+    void Pawn::addWeaponPack(WeaponPack * wPack)
+    {
+        if (this->weaponSystem_)
+            this->weaponSystem_->addWeaponPack(wPack);
+    }
+
+    WeaponPack * Pawn::getWeaponPack(unsigned int index) const
+    {
+        if (this->weaponSystem_)
+            return this->weaponSystem_->getWeaponPack(index);
+        else
+            return 0;
+    }
+
+    //Tell the Map (RadarViewable), if this is a playership
+    void Pawn::startLocalHumanControl()
+    {
+//        SUPER(ControllableEntity, changedPlayer());
+        ControllableEntity::startLocalHumanControl();
+        this->isHumanShip_ = true;
+    }
+}
Index: code/trunk/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.h	(revision 5781)
@@ -0,0 +1,151 @@
+/*
+ *   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 _Pawn_H__
+#define _Pawn_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include "interfaces/RadarViewable.h"
+#include "worldentities/ControllableEntity.h"
+#include "pickup/PickupCollection.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Pawn : public ControllableEntity, public RadarViewable
+    {
+        friend class WeaponSystem;
+
+        public:
+            Pawn(BaseObject* creator);
+            virtual ~Pawn();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+            void registerVariables();
+
+            inline bool isAlive() const
+                { return this->bAlive_; }
+
+            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 ControllableEntity* getLastHitOriginator() const
+                { return this->lastHitOriginator_; }
+
+            virtual void damage(float damage, Pawn* originator = 0);
+            virtual void hit(Pawn* originator, const Vector3& force, float damage);
+            virtual void kill();
+
+            virtual void fire(unsigned int firemode);
+            virtual void reload();
+            virtual void doFire(uint8_t firemode);
+            virtual void postSpawn();
+
+            void addWeaponSlot(WeaponSlot * wSlot);
+            WeaponSlot * getWeaponSlot(unsigned int index) const;
+            void addWeaponSet(WeaponSet * wSet);
+            WeaponSet * getWeaponSet(unsigned int index) const;
+            void addWeaponPack(WeaponPack * wPack);
+            WeaponPack * getWeaponPack(unsigned int index) const;
+
+            inline const WorldEntity* getWorldEntity() const
+                { return const_cast<Pawn*>(this); }
+
+            inline void setSpawnParticleSource(const std::string& source)
+                { this->spawnparticlesource_ = source; }
+            inline const std::string& getSpawnParticleSource() const
+                { return this->spawnparticlesource_; }
+
+            inline void setSpawnParticleDuration(float duration)
+                { this->spawnparticleduration_ = duration; }
+            inline float getSpawnParticleDuration() const
+                { return this->spawnparticleduration_; }
+
+            inline void setExplosionChunks(unsigned int chunks)
+                { this->numexplosionchunks_ = chunks; }
+            inline unsigned int getExplosionChunks() const
+                { return this->numexplosionchunks_; }
+
+            virtual void dropItems();
+            inline PickupCollection& getPickups()
+                { return this->pickups_; }
+            virtual void useItem()
+                { this->pickups_.useItem(); }
+
+            virtual void startLocalHumanControl();
+
+        protected:
+            virtual void setPlayer(PlayerInfo* player);
+            virtual void removePlayer();
+
+            virtual void death();
+            virtual void goWithStyle();
+            virtual void deatheffect();
+            virtual void spawneffect();
+
+            bool bAlive_;
+
+            PickupCollection pickups_;
+
+            float health_;
+            float maxHealth_;
+            float initialHealth_;
+
+            Pawn* lastHitOriginator_;
+
+            WeaponSystem* weaponSystem_;
+            bool bReload_;
+
+            std::string spawnparticlesource_;
+            float spawnparticleduration_;
+            unsigned int numexplosionchunks_;
+
+        private:
+            inline void setWeaponSystem(WeaponSystem* weaponsystem)
+                { this->weaponSystem_ = weaponsystem; }
+    };
+}
+
+#endif /* _Pawn_H__ */
Index: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 5781)
@@ -0,0 +1,222 @@
+/*
+ *   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 "SpaceShip.h"
+
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/Template.h"
+#include "core/XMLPort.h"
+#include "items/Engine.h"
+
+namespace orxonox
+{
+    const float orientationGain = 100;
+    CreateFactory(SpaceShip);
+
+    SpaceShip::SpaceShip(BaseObject* creator) : Pawn(creator)
+    {
+        RegisterObject(SpaceShip);
+
+        this->primaryThrust_  = 100;
+        this->auxilaryThrust_ =  30;
+        this->rotationThrust_ =  10;
+
+        this->localLinearAcceleration_.setValue(0, 0, 0);
+        this->localAngularAcceleration_.setValue(0, 0, 0);
+        this->bBoost_ = false;
+        this->bPermanentBoost_ = false;
+        this->steering_ = Vector3::ZERO;
+        this->engine_ = 0;
+
+
+        this->bInvertYAxis_ = false;
+
+        this->setDestroyWhenPlayerLeft(true);
+
+        // SpaceShip is always a physical object per default
+        // Be aware of this call: The collision type legality check will not reach derived classes!
+        this->setCollisionType(WorldEntity::Dynamic);
+        // Get notification about collisions
+        this->enableCollisionCallback();
+
+        this->setConfigValues();
+        this->registerVariables();
+    }
+
+    SpaceShip::~SpaceShip()
+    {
+        if (this->isInitialized() && this->engine_)
+            delete this->engine_;
+    }
+
+    void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(SpaceShip, XMLPort, xmlelement, mode);
+
+        XMLPortParam(SpaceShip, "engine",            setEngineTemplate,    getEngineTemplate,    xmlelement, mode);
+        XMLPortParamVariable(SpaceShip, "primaryThrust",  primaryThrust_,  xmlelement, mode);
+        XMLPortParamVariable(SpaceShip, "auxilaryThrust", auxilaryThrust_, xmlelement, mode);
+        XMLPortParamVariable(SpaceShip, "rotationThrust", rotationThrust_, xmlelement, mode);
+    }
+
+    void SpaceShip::registerVariables()
+    {
+        registerVariable(this->primaryThrust_,  VariableDirection::ToClient);
+        registerVariable(this->auxilaryThrust_, VariableDirection::ToClient);
+        registerVariable(this->rotationThrust_, VariableDirection::ToClient);
+    }
+
+    void SpaceShip::setConfigValues()
+    {
+        SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
+    }
+
+    bool SpaceShip::isCollisionTypeLegal(WorldEntity::CollisionType type) const
+    {
+        if (type != WorldEntity::Dynamic)
+        {
+            CCOUT(1) << "Error: Cannot tell a SpaceShip not to be dynamic! Ignoring." << std::endl;
+            assert(false); // Only in debug mode
+            return false;
+        }
+        else
+            return true;
+    }
+
+    void SpaceShip::tick(float dt)
+    {
+        SUPER(SpaceShip, tick, dt);
+
+        if (this->hasLocalController())
+        {
+/*
+            this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_);
+            this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_);
+            if (this->localLinearAcceleration_.z() > 0)
+                this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_);
+            else
+                this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
+            this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
+            this->localLinearAcceleration_.setValue(0, 0, 0);
+*/
+            if (!this->isInMouseLook())
+            {
+                this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
+                this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
+                this->localAngularAcceleration_.setValue(0, 0, 0);
+            }
+        }
+    }
+
+    void SpaceShip::moveFrontBack(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
+        this->steering_.z = -value.x;
+    }
+
+    void SpaceShip::moveRightLeft(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
+        this->steering_.x = value.x;
+    }
+
+    void SpaceShip::moveUpDown(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
+        this->steering_.y = value.x;
+    }
+
+    void SpaceShip::rotateYaw(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() + value.x);
+
+        Pawn::rotateYaw(value);
+    }
+
+    void SpaceShip::rotatePitch(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x);
+
+        Pawn::rotatePitch(value);
+    }
+
+    void SpaceShip::rotateRoll(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
+
+        Pawn::rotateRoll(value);
+    }
+
+    void SpaceShip::fire()
+    {
+    }
+
+    void SpaceShip::boost()
+    {
+        this->bBoost_ = true;
+    }
+
+    void SpaceShip::loadEngineTemplate()
+    {
+        if (this->enginetemplate_ != "")
+        {
+            Template* temp = Template::getTemplate(this->enginetemplate_);
+
+            if (temp)
+            {
+                Identifier* identifier = temp->getBaseclassIdentifier();
+
+                if (identifier)
+                {
+                    BaseObject* object = identifier->fabricate(this);
+                    this->engine_ = orxonox_cast<Engine*>(object);
+
+                    if (this->engine_)
+                    {
+                        this->engine_->addTemplate(temp);
+                        this->engine_->addToSpaceShip(this);
+                    }
+                    else
+                    {
+                        delete object;
+                    }
+                }
+            }
+        }
+    }
+
+    void SpaceShip::setEngine(Engine* engine)
+    {
+        this->engine_ = engine;
+        if (engine && engine->getShip() != this)
+            engine->addToSpaceShip(this);
+    }
+}
Index: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 5781)
@@ -0,0 +1,110 @@
+/*
+ *   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 _SpaceShip_H__
+#define _SpaceShip_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include <LinearMath/btVector3.h>
+#include "util/Math.h"
+#include "Pawn.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport SpaceShip : public Pawn
+    {
+        public:
+            SpaceShip(BaseObject* creator);
+            virtual ~SpaceShip();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+            void registerVariables();
+            void setConfigValues();
+
+            virtual void moveFrontBack(const Vector2& value);
+            virtual void moveRightLeft(const Vector2& value);
+            virtual void moveUpDown(const Vector2& value);
+
+            virtual void rotateYaw(const Vector2& value);
+            virtual void rotatePitch(const Vector2& value);
+            virtual void rotateRoll(const Vector2& value);
+
+            virtual void fire();
+            virtual void boost();
+
+            void setEngine(Engine* engine);
+            inline Engine* getEngine() const
+                { return this->engine_; }
+
+            inline void setSteeringDirection(const Vector3& direction)
+                { this->steering_ = direction; }
+            inline const Vector3& getSteeringDirection() const
+                { return this->steering_; }
+
+            inline void setBoost(bool bBoost)
+                { this->bBoost_ = bBoost; }
+            inline bool getBoost() const
+                { return this->bBoost_; }
+
+            inline void setEngineTemplate(const std::string& temp)
+                { this->enginetemplate_ = temp; this->loadEngineTemplate(); }
+            inline const std::string& getEngineTemplate() const
+                { return this->enginetemplate_; }
+
+            inline void setPermanentBoost(bool bPermanent)
+                { this->bPermanentBoost_ = bPermanent; }
+            inline bool getPermanentBoost() const
+                { return this->bPermanentBoost_; }
+
+        protected:
+            bool bInvertYAxis_;
+
+            bool bBoost_;
+            bool bPermanentBoost_;
+            Vector3 steering_;
+            float primaryThrust_;
+            float auxilaryThrust_;
+            float rotationThrust_;
+            btVector3 localLinearAcceleration_;
+            btVector3 localAngularAcceleration_;
+
+        private:
+            virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
+
+        private:
+            void loadEngineTemplate();
+
+            std::string enginetemplate_;
+            Engine* engine_;
+    };
+}
+
+#endif /* _SpaceShip_H__ */
Index: code/trunk/src/orxonox/worldentities/pawns/Spectator.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Spectator.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/Spectator.cc	(revision 5781)
@@ -0,0 +1,207 @@
+/*
+ *   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 "Spectator.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/GameMode.h"
+
+#include "tools/BillboardSet.h"
+#include "Scene.h"
+#include "infos/PlayerInfo.h"
+
+namespace orxonox
+{
+    CreateFactory(Spectator);
+
+    Spectator::Spectator(BaseObject* creator) : ControllableEntity(creator)
+    {
+        RegisterObject(Spectator);
+
+        this->speed_ = 200;
+
+        this->yaw_ = 0;
+        this->pitch_ = 0;
+        this->roll_ = 0;
+        this->localVelocity_ = Vector3::ZERO;
+        this->setHudTemplate("spectatorhud");
+        this->greetingFlare_ = 0;
+
+        this->setDestroyWhenPlayerLeft(true);
+
+        if (GameMode::showsGraphics())
+        {
+            this->greetingFlare_ = new BillboardSet();
+            this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0f, 1.0f, 0.8f), Vector3(0, 20, 0), 1);
+            if (this->greetingFlare_->getBillboardSet())
+                this->attachOgreObject(this->greetingFlare_->getBillboardSet());
+            this->greetingFlare_->setVisible(false);
+        }
+
+        this->bGreetingFlareVisible_ = false;
+        this->bGreeting_ = false;
+
+        this->setConfigValues();
+        this->registerVariables();
+    }
+
+    Spectator::~Spectator()
+    {
+        if (this->isInitialized())
+        {
+            if (this->greetingFlare_)
+            {
+                if (this->greetingFlare_->getBillboardSet())
+                    this->detachOgreObject(this->greetingFlare_->getBillboardSet());
+
+                delete this->greetingFlare_;
+            }
+        }
+    }
+
+    void Spectator::setConfigValues()
+    {
+        SetConfigValue(speed_, 200.0f);
+    }
+
+    void Spectator::registerVariables()
+    {
+        registerVariable(this->bGreetingFlareVisible_, VariableDirection::ToClient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
+        registerVariable(this->bGreeting_,             VariableDirection::ToServer, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
+    }
+
+    void Spectator::changedGreeting()
+    {
+        this->bGreetingFlareVisible_ = this->bGreeting_;
+        this->changedFlareVisibility();
+    }
+
+    void Spectator::changedFlareVisibility()
+    {
+        if (this->greetingFlare_)
+            this->greetingFlare_->setVisible(this->bGreetingFlareVisible_);
+    }
+
+    void Spectator::tick(float dt)
+    {
+        if (this->hasLocalController())
+        {
+            float localSpeedSquared = this->localVelocity_.squaredLength();
+            float localSpeed;
+            if (localSpeedSquared > 1.0)
+                localSpeed = this->speed_ / sqrtf(localSpeedSquared);
+            else
+                localSpeed = this->speed_;
+
+            this->localVelocity_.x *= localSpeed;
+            this->localVelocity_.y *= localSpeed;
+            this->localVelocity_.z *= localSpeed;
+            this->setVelocity(this->getOrientation() * this->localVelocity_);
+            this->localVelocity_.x = 0;
+            this->localVelocity_.y = 0;
+            this->localVelocity_.z = 0;
+
+            if (!this->isInMouseLook())
+            {
+                this->yaw(Radian(this->yaw_ * this->getMouseLookSpeed()));
+                this->pitch(Radian(this->pitch_ * this->getMouseLookSpeed()));
+                this->roll(Radian(this->roll_ * this->getMouseLookSpeed()));
+            }
+
+            this->yaw_ = this->pitch_ = this->roll_ = 0;
+        }
+
+        SUPER(Spectator, tick, dt);
+    }
+
+    void Spectator::setPlayer(PlayerInfo* player)
+    {
+        ControllableEntity::setPlayer(player);
+
+//        this->setObjectMode(ObjectDirection::ToClient);
+    }
+
+    void Spectator::startLocalHumanControl()
+    {
+        ControllableEntity::startLocalHumanControl();
+    }
+
+    void Spectator::moveFrontBack(const Vector2& value)
+    {
+        this->localVelocity_.z -= value.x;
+    }
+
+    void Spectator::moveRightLeft(const Vector2& value)
+    {
+        this->localVelocity_.x += value.x;
+    }
+
+    void Spectator::moveUpDown(const Vector2& value)
+    {
+        this->localVelocity_.y += value.x;
+    }
+
+    void Spectator::rotateYaw(const Vector2& value)
+    {
+        this->yaw_ += value.y;
+
+        ControllableEntity::rotateYaw(value);
+    }
+
+    void Spectator::rotatePitch(const Vector2& value)
+    {
+        this->pitch_ += value.y;
+
+        ControllableEntity::rotatePitch(value);
+    }
+
+    void Spectator::rotateRoll(const Vector2& value)
+    {
+        this->roll_ += value.y;
+
+        ControllableEntity::rotateRoll(value);
+    }
+
+    void Spectator::fire(unsigned int firemode)
+    {
+        if (this->getPlayer())
+            this->getPlayer()->setReadyToSpawn(true);
+    }
+
+    void Spectator::greet()
+    {
+        this->bGreeting_ = !this->bGreeting_;
+
+        if (GameMode::isMaster())
+        {
+            this->bGreetingFlareVisible_ = this->bGreeting_;
+            this->changedFlareVisibility();
+        }
+    }
+}
Index: code/trunk/src/orxonox/worldentities/pawns/Spectator.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Spectator.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/Spectator.h	(revision 5781)
@@ -0,0 +1,82 @@
+/*
+ *   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 _Spectator_H__
+#define _Spectator_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Math.h"
+#include "worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Spectator : public ControllableEntity
+    {
+        public:
+            Spectator(BaseObject* creator);
+            virtual ~Spectator();
+
+            void setConfigValues();
+            void registerVariables();
+            virtual void tick(float dt);
+
+            virtual void moveFrontBack(const Vector2& value);
+            virtual void moveRightLeft(const Vector2& value);
+            virtual void moveUpDown(const Vector2& value);
+
+            virtual void rotateYaw(const Vector2& value);
+            virtual void rotatePitch(const Vector2& value);
+            virtual void rotateRoll(const Vector2& value);
+
+            virtual void fire(unsigned int firemode);
+            virtual void greet();
+
+        protected:
+            virtual void setPlayer(PlayerInfo* player);
+            virtual void startLocalHumanControl();
+
+        private:
+            void changedGreeting();
+            void changedFlareVisibility();
+
+            BillboardSet* greetingFlare_;
+            bool bGreetingFlareVisible_;
+            bool bGreeting_;
+
+            float speed_;
+
+            float yaw_;
+            float pitch_;
+            float roll_;
+
+            Vector3 localVelocity_;
+    };
+}
+
+#endif /* _Spectator_H__ */
Index: code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc	(revision 5781)
@@ -0,0 +1,98 @@
+/*
+ *   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:
+ *      Val Mikos
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#include "TeamBaseMatchBase.h"
+
+#include "core/CoreIncludes.h"
+#include "interfaces/PawnListener.h"
+#include "interfaces/TeamColourable.h"
+#include "gametypes/TeamBaseMatch.h"
+
+namespace orxonox
+{
+    CreateFactory(TeamBaseMatchBase);
+
+    TeamBaseMatchBase::TeamBaseMatchBase(BaseObject* creator) : Pawn(creator)
+    {
+        RegisterObject(TeamBaseMatchBase);
+
+        this->state_ = BaseState::Uncontrolled;
+
+        TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype());
+        if (gametype)
+        {
+            gametype->addBase(this);
+        }
+
+        this->setRadarObjectShape(RadarViewable::Triangle);
+    }
+
+    void TeamBaseMatchBase::changeTeamColour()
+    {
+        this->fireEvent();
+
+        TeamDeathmatch* gametype = orxonox_cast<TeamDeathmatch*>(this->getGametype());
+        if (!gametype)
+            return;
+
+        ColourValue colour;
+
+        switch (this->state_)
+        {
+            case BaseState::ControlTeam1:
+                colour = gametype->getTeamColour(0);
+                break;
+            case BaseState::ControlTeam2:
+                colour = gametype->getTeamColour(1);
+                break;
+            case BaseState::Uncontrolled:
+            default:
+                colour = ColourValue(0.5, 0.5, 0.5, 1.0);
+                break;
+        }
+
+
+        std::set<WorldEntity*> attachments = this->getAttachedObjects();
+        for (std::set<WorldEntity*>::iterator it = attachments.begin(); it != attachments.end(); ++it)
+        {
+            if ((*it)->isA(Class(TeamColourable)))
+            {
+                TeamColourable* tc = orxonox_cast<TeamColourable*>(*it);
+                tc->setTeamColour(colour);
+            }
+        }
+
+        this->setRadarObjectColour(colour);
+
+        // Call this so bots stop shooting at the base after they converted it
+        for (ObjectList<PawnListener>::iterator it = ObjectList<PawnListener>::begin(); it != ObjectList<PawnListener>::end(); ++it)
+            it->destroyedPawn(this);
+    }
+}
+
Index: code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.h	(revision 5781)
+++ code/trunk/src/orxonox/worldentities/pawns/TeamBaseMatchBase.h	(revision 5781)
@@ -0,0 +1,81 @@
+/*
+ *   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:
+ *      Val Mikos
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TeamBaseMatchBase_H__
+#define _TeamBaseMatchBase_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "Pawn.h"
+
+namespace orxonox
+{
+    namespace BaseState
+    {
+        enum Value
+        {
+            Uncontrolled,
+            ControlTeam1,
+            ControlTeam2,
+        };
+    }
+
+
+    class _OrxonoxExport TeamBaseMatchBase : public Pawn
+    {
+        public:
+            TeamBaseMatchBase(BaseObject* creator);
+
+            // if class closes, close everything
+            virtual ~TeamBaseMatchBase() {}
+
+
+
+            // Set the state of a base to whatever the argument of the function is
+            void setState(BaseState::Value state)
+            {
+                this->state_ = state;
+                this->changeTeamColour();
+            }
+
+
+            // Get the state of a base as a return value
+            BaseState::Value getState() const
+            {
+                return this->state_;
+            }
+
+
+        protected:
+            void changeTeamColour();
+
+            BaseState::Value state_;
+    };
+}
+
+#endif /* _TeamBaseMatchBase_H__ */
