Index: code/trunk/src/orxonox/objects/Ambient.cc
===================================================================
--- code/trunk/src/orxonox/objects/Ambient.cc	(revision 1937)
+++ 	(revision )
@@ -1,102 +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:
- *      ...
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "Ambient.h"
-
-#include <vector>
-#include <string>
-
-#include <OgreSceneManager.h>
-
-#include "tinyxml/tinyxml.h"
-#include "util/SubString.h"
-#include "util/Math.h"
-#include "util/Debug.h"
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "core/ConsoleCommand.h"
-#include "Settings.h"
-#include "GraphicsEngine.h"
-
-namespace orxonox
-{
-    SetConsoleCommandAlias(Ambient, setAmbientLightTest, "setAmbientLight", false).defaultValues(ColourValue(1, 1, 1, 1)).accessLevel(AccessLevel::Offline);
-
-    CreateFactory(Ambient);
-
-    Ambient* Ambient::instance_s;
-
-    Ambient::Ambient()
-    {
-        RegisterObject(Ambient);
-        Ambient::instance_s = this;
-        registerAllVariables();
-    }
-
-    Ambient::~Ambient()
-    {
-    }
-
-    bool Ambient::create()
-    {
-        if (Settings::showsGraphics())
-            GraphicsEngine::getInstance().getLevelSceneManager()->setAmbientLight(ambientLight_);
-        return Synchronisable::create();
-    }
-
-    void Ambient::registerAllVariables()
-    {
-        registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
-    }
-
-    void Ambient::setAmbientLight(const ColourValue& colour)
-    {
-        if (Settings::showsGraphics())
-            GraphicsEngine::getInstance().getLevelSceneManager()->setAmbientLight(colour);
-        ambientLight_ = colour;
-    }
-
-    /**
-    @brief
-        XML loading and saving.
-    @param
-        xmlelement The XML-element
-    @param
-        loading Loading (true) or saving (false)
-    @return
-        The XML-element
-    */
-    void Ambient::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(Ambient, XMLPort, xmlelement, mode);
-
-        XMLPortParam(Ambient, "colourvalue", setAmbientLight, getAmbienetLight, xmlelement, mode);
-        create();
-    }
-}
Index: code/trunk/src/orxonox/objects/Ambient.h
===================================================================
--- code/trunk/src/orxonox/objects/Ambient.h	(revision 1937)
+++ 	(revision )
@@ -1,64 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _Ambient_H__
-#define _Ambient_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "util/Math.h"
-#include "core/BaseObject.h"
-#include "network/Synchronisable.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Ambient : public BaseObject, public network::Synchronisable
-    {
-        public:
-            Ambient();
-            virtual ~Ambient();
-
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual bool create();
-            void registerAllVariables();
-
-            void setAmbientLight(const ColourValue& colour);
-            inline const ColourValue& getAmbienetLight() const
-                { return this->ambientLight_; }
-
-            static void setAmbientLightTest(const ColourValue& colour)
-                { Ambient::instance_s->setAmbientLight(colour); }
-
-        private:
-            static Ambient* instance_s;
-            ColourValue ambientLight_;
-
-    };
-}
-
-#endif /* _Ambient_H__ */
Index: code/trunk/src/orxonox/objects/Backlight.cc
===================================================================
--- code/trunk/src/orxonox/objects/Backlight.cc	(revision 1937)
+++ 	(revision )
@@ -1,170 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "Backlight.h"
-
-#include <OgreBillboard.h>
-#include <OgreRibbonTrail.h>
-#include <OgreSceneManager.h>
-
-#include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
-#include "core/Executor.h"
-#include "util/Math.h"
-#include "GraphicsEngine.h"
-
-namespace orxonox
-{
-    CreateFactory(Backlight);
-
-    float Backlight::timeFactor_s = 1.0;
-
-    Backlight::Backlight(float maxspeed, float brakingtime, float scale)
-    {
-        RegisterObject(Backlight);
-
-        this->setConfigValues();
-        this->traillength_ = 1;
-
-        this->configure(maxspeed, brakingtime, scale);
-    }
-    
-    bool Backlight::create(){
-      if(!WorldEntity::create())
-        return false;
-      
-      this->getNode()->setInheritScale(false);
-
-      this->billboard_.setBillboardSet("Flares/backlightflare");
-      this->attachObject(this->billboard_.getBillboardSet());
-
-      this->ribbonTrail_ = GraphicsEngine::getInstance().getLevelSceneManager()->createRibbonTrail(this->getName() + "RibbonTrail");
-      this->ribbonTrailNode_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName() + "RibbonTrailNode");
-      this->ribbonTrailNode_->attachObject(this->ribbonTrail_);
-      this->ribbonTrail_->addNode(this->getNode());
-
-
-      this->ribbonTrail_->setTrailLength(this->maxTraillength_);
-      this->ribbonTrail_->setMaterialName("Trail/backlighttrail");
-
-        //this->setTimeFactor(Orxonox::getInstance().getTimeFactor());
-      this->setTimeFactor(1.0f);
-      
-      this->ribbonTrail_->setMaxChainElements(this->maxTrailsegments_);
-      this->ribbonTrail_->setTrailLength(this->traillength_ = 2 * this->maxTrailsegments_);
-      this->ribbonTrail_->setInitialWidth(0, this->width_ * this->getScale());
-      this->ribbonTrail_->setWidthChange(0, this->width_ * this->getScale() / this->maxLifeTime_ * Backlight::timeFactor_s);
-      return true;
-    }
-
-    Backlight::~Backlight()
-    {
-        if (this->isInitialized())
-        {
-            this->detachObject(this->billboard_.getBillboardSet());
-            GraphicsEngine::getInstance().getLevelSceneManager()->destroySceneNode(this->getName() + "RibbonTrailNode");
-            GraphicsEngine::getInstance().getLevelSceneManager()->destroyRibbonTrail(this->ribbonTrail_);
-        }
-    }
-
-    void Backlight::setConfigValues()
-    {
-        SetConfigValue(maxLifeTime_, 4.0).description("The maximal amount of seconds the trail behind a SpaceShip stays visible");
-        SetConfigValue(trailSegmentLength_, 50).description("The length of one segment of the trail behind a SpaceShip (lower values make it more smooth)");
-        SetConfigValue(width_, 7.0).description("The width of the trail");
-    }
-
-    void Backlight::setTimeFactor(float factor)
-    {
-        Backlight::timeFactor_s = factor;
-        float change = Backlight::timeFactor_s / this->maxLifeTime_;
-        this->ribbonTrail_->setWidthChange(0, this->width_ * change);
-        this->updateColourChange();
-    }
-
-    void Backlight::updateColourChange()
-    {
-        this->ribbonTrail_->setColourChange(0, ColourValue(0, 0, 0, this->maxTraillength_ / this->traillength_ / this->maxLifeTime_ * Backlight::timeFactor_s));
-    }
-    
-    
-    void Backlight::XMLPort(Element& xmlelement, XMLPort::Mode mode){
-      SUPER(Backlight, XMLPort, xmlelement, mode);
-      
-      Backlight::create();
-    }
-
-    void Backlight::tick(float dt)
-    {
-        SUPER(Backlight, tick, dt);
-
-        if (this->isActive())
-        {
-            if (this->traillength_ < this->maxTraillength_)
-            {
-                this->traillength_ = min<float>(this->maxTraillength_, this->traillength_ + dt * this->maxTraillength_ / this->maxLifeTime_);
-                this->updateColourChange();
-            }
-        }
-        else
-        {
-            if (this->traillength_ > 1)
-            {
-                this->traillength_ = max<float>(1, this->traillength_ - this->brakefactor_ * dt * this->maxTraillength_ / this->maxLifeTime_);
-                this->updateColourChange();
-            }
-        }
-
-        this->ribbonTrail_->setTrailLength(this->traillength_);
-    }
-
-    void Backlight::setColour(const ColourValue& colour)
-    {
-        this->billboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
-        this->ribbonTrail_->setInitialColour(0, ColourValue(colour.r / 4 + 0.75, colour.g / 4 + 0.75, colour.b / 4 + 0.75));
-    }
-
-    void Backlight::configure(float maxspeed, float brakingtime, float scale)
-    {
-        this->maxTraillength_ = this->maxLifeTime_ * maxspeed;
-        this->maxTrailsegments_ = (size_t)(this->maxTraillength_ / this->trailSegmentLength_);
-
-        this->brakefactor_ = this->maxLifeTime_ / brakingtime;
-
-        this->scale(scale);
-    }
-
-    void Backlight::changedVisibility()
-    {
-        SUPER(Backlight, changedVisibility);
-
-        this->billboard_.setVisible(this->isVisible());
-        this->ribbonTrail_->setVisible(this->isVisible());
-    }
-}
Index: code/trunk/src/orxonox/objects/Backlight.h
===================================================================
--- code/trunk/src/orxonox/objects/Backlight.h	(revision 1937)
+++ 	(revision )
@@ -1,77 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _Backlight_H__
-#define _Backlight_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "WorldEntity.h"
-#include "tools/Timer.h"
-#include "tools/BillboardSet.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Backlight : public WorldEntity
-    {
-        public:
-            Backlight(float maxspeed = 1.0, float brakingtime = 1.0, float scale = 1.0);
-            virtual ~Backlight();
-
-            void setConfigValues();
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void tick(float dt);
-            virtual void changedVisibility();
-            virtual bool create();
-
-            void setColour(const ColourValue& colour);
-            void setTimeFactor(float factor);
-
-        private:
-            void configure(float maxspeed, float brakingtime, float scale = 1);
-            void updateColourChange();
-
-            static float timeFactor_s;
-            BillboardSet billboard_;
-            Ogre::SceneNode* ribbonTrailNode_;
-            Ogre::RibbonTrail* ribbonTrail_;
-
-            float maxLifeTime_;
-            float trailSegmentLength_;
-            float width_;
-
-            float brakefactor_;
-
-            float maxTraillength_;
-            float traillength_;
-
-            size_t maxTrailsegments_;
-    };
-}
-
-#endif /* _Backlight_H__ */
Index: code/trunk/src/orxonox/objects/BillboardProjectile.cc
===================================================================
--- code/trunk/src/orxonox/objects/BillboardProjectile.cc	(revision 1937)
+++ 	(revision )
@@ -1,65 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "BillboardProjectile.h"
-
-#include <OgreBillboard.h>
-
-#include "core/CoreIncludes.h"
-
-namespace orxonox
-{
-    CreateFactory(BillboardProjectile);
-
-    BillboardProjectile::BillboardProjectile(SpaceShip* owner) : Projectile(owner)
-    {
-        RegisterObject(BillboardProjectile);
-
-        this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1);
-        this->attachObject(this->billboard_.getBillboardSet());
-        this->scale(0.5);
-    }
-
-    BillboardProjectile::~BillboardProjectile()
-    {
-        if (this->isInitialized() && this->owner_)
-            this->detachObject(this->billboard_.getBillboardSet());
-    }
-
-    void BillboardProjectile::setColour(const ColourValue& colour)
-    {
-        this->billboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
-    }
-
-    void BillboardProjectile::changedVisibility()
-    {
-        SUPER(BillboardProjectile, changedVisibility);
-        this->billboard_.setVisible(this->isVisible());
-    }
-}
Index: code/trunk/src/orxonox/objects/BillboardProjectile.h
===================================================================
--- code/trunk/src/orxonox/objects/BillboardProjectile.h	(revision 1937)
+++ 	(revision )
@@ -1,54 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _BillboardProjectile_H__
-#define _BillboardProjectile_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "Projectile.h"
-#include "tools/BillboardSet.h"
-#include "util/Math.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport BillboardProjectile : public Projectile
-    {
-        public:
-            BillboardProjectile(SpaceShip* owner = 0);
-            virtual ~BillboardProjectile();
-
-            virtual void setColour(const ColourValue& colour);
-            virtual void changedVisibility();
-
-        private:
-            BillboardSet billboard_;
-    };
-}
-
-#endif /* _BillboardProjectile_H__ */
Index: code/trunk/src/orxonox/objects/Camera.cc
===================================================================
--- code/trunk/src/orxonox/objects/Camera.cc	(revision 1937)
+++ 	(revision )
@@ -1,121 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      Benjamin Knecht
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "Camera.h"
-#include "CameraHandler.h"
-
-#include <string>
-
-#include <OgreSceneManager.h>
-#include <OgreSceneNode.h>
-#include <OgreRenderWindow.h>
-#include <OgreViewport.h>
-
-#include "tinyxml/tinyxml.h"
-#include "util/SubString.h"
-#include "util/Math.h"
-#include "util/Debug.h"
-#include "core/CoreIncludes.h"
-#include "GraphicsEngine.h"
-
-namespace orxonox
-{
-
-  Camera::Camera(Ogre::SceneNode* node)
-  {
-    this->bHasFocus_ = false;
-    this->cameraNode_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(node->getName() + "Camera");
-    if( node != NULL )
-      this->setPositionNode(node);
-  }
-
-  Camera::~Camera()
-  {
-    CameraHandler::getInstance()->releaseFocus(this);
-    GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->removeAndDestroyChild(cameraNode_->getName());
-  }
-
-  void Camera::setPositionNode(Ogre::SceneNode* node)
-  {
-    this->positionNode_ = node;
-    // set camera to node values according to camera mode
-  }
-
-  void Camera::setTargetNode(Ogre::SceneNode* obj)
-  {
-    this->targetNode_ = obj;
-  }
-
-  void Camera::tick(float dt)
-  {
-    if (this->positionNode_ != NULL)
-    {
-      // this stuff here may need some adjustments
-      Vector3 offset = this->positionNode_->getWorldPosition() - this->cameraNode_->getWorldPosition();
-      float coeff = 15.0f * dt;
-      if (coeff > 1.0f)
-        coeff = 1.0f;
-
-      this->cameraNode_->translate(coeff * offset);
-
-      this->cameraNode_->setOrientation(Quaternion::Slerp(1-coeff, this->positionNode_->getWorldOrientation(), this->cameraNode_->getWorldOrientation(), false));
-    }
-  }
-
-  /**
-    don't move anything before here! here the Ogre camera is set to values of this camera
-    always call update after changes
-  */
-  void Camera::update()
-  {
-    if(this->positionNode_ != NULL)
-    {
-      this->cameraNode_->setPosition(this->positionNode_->getWorldPosition());
-      this->cameraNode_->setOrientation(this->positionNode_->getWorldOrientation());
-    }
-  }
-
-  /**
-    what to do when camera loses focus (do not request focus in this function!!)
-    this is called by the CameraHandler singleton class to notify the camera
-  */
-  void Camera::removeFocus()
-  {
-    this->bHasFocus_ = false;
-    this->cameraNode_->detachObject(this->cam_);
-  }
-
-  void Camera::setFocus(Ogre::Camera* ogreCam)
-  {
-    this->bHasFocus_ = true;
-    this->cam_ = ogreCam;
-    this->cam_->setOrientation(this->cameraNode_->getWorldOrientation());
-    this->cameraNode_->attachObject(this->cam_);
-  }
-}
Index: code/trunk/src/orxonox/objects/Camera.h
===================================================================
--- code/trunk/src/orxonox/objects/Camera.h	(revision 1937)
+++ 	(revision )
@@ -1,71 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      Benjamin Knecht
- *
- */
-
-#ifndef _Camera_H__
-#define _Camera_H__
-
-#include <OgrePrerequisites.h>
-#include <OgreSceneNode.h>
-#include <OgreCamera.h>
-
-#include "OrxonoxPrereqs.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Camera
-    {
-      friend class CameraHandler;
-      public:
-        Camera(Ogre::SceneNode* node = NULL);
-        virtual ~Camera();
-
-        void setPositionNode(Ogre::SceneNode* node);
-        inline Ogre::SceneNode* getCameraNode() { return this->positionNode_; }
-        // maybe also BaseObject
-        void setTargetNode(Ogre::SceneNode* obj);
-
-        Ogre::Camera* cam_;
-
-        void tick(float dt);
-        void update();
-        inline bool hasFocus() { return this->bHasFocus_; }
-
-      private:
-        void removeFocus();
-        void setFocus(Ogre::Camera* ogreCam);
-
-      private:
-        Ogre::SceneNode* targetNode_;
-        Ogre::SceneNode* positionNode_;
-        Ogre::SceneNode* cameraNode_;
-        Ogre::Vector3 oldPos;
-        bool bHasFocus_;
-    };
-}
-
-#endif /* _Camera_H__ */
Index: code/trunk/src/orxonox/objects/CameraHandler.cc
===================================================================
--- code/trunk/src/orxonox/objects/CameraHandler.cc	(revision 1937)
+++ 	(revision )
@@ -1,96 +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:
- *      Benjamin Knecht
- *   Co-authors:
- *      ...
- *
- */
-#include "OrxonoxStableHeaders.h"
-#include "CameraHandler.h"
-
-#include <OgreSceneManager.h>
-#include <OgreRenderWindow.h>
-
-#include "core/ObjectList.h"
-#include "Camera.h"
-#include "GraphicsEngine.h"
-
-#include <OgreCamera.h>
-
-namespace orxonox {
-
-  CameraHandler* CameraHandler::singletonRef = NULL;
-
-  CameraHandler::CameraHandler()
-  {
-    this->cam_ = GraphicsEngine::getInstance().getLevelSceneManager()->createCamera("Cam");
-    GraphicsEngine::getInstance().getViewport()->setCamera(this->cam_);
-    //GraphicsEngine::getInstance().getRenderWindow()->addViewport(this->cam_, 2, 0.4, 0.4, 0.2, 0.2);
-    /*this->activeCamera_ = *ObjectList<Camera>::begin();
-    this->activeCamera_->cam_ = this->cam_;*/
-  }
-
-  void CameraHandler::requestFocus(Camera* requestCam)
-  {
-    // notify old camera (if it exists)
-    if(focusList_.size() > 0)
-      focusList_.back()->removeFocus();
-    // add to list
-    focusList_.push_back(requestCam);
-    // set focus to new camera and update (if necessary)
-    if(!requestCam->hasFocus()) {
-      requestCam->setFocus(this->cam_);
-      requestCam->update();
-    }
-    // delete dublicates
-    focusList_.unique();
-  }
-
-  void CameraHandler::releaseFocus(Camera* cam)
-  {
-    // notify the cam of releasing the focus
-    if(cam->hasFocus())
-      cam->removeFocus();
-    // delete camera from list
-    focusList_.remove(cam);
-    // set new focus if necessary
-    if(focusList_.size() > 0 && !(focusList_.back()->hasFocus()))
-      focusList_.back()->setFocus(this->cam_);
-  }
-/*
-  void CameraHandler::changeActiveCamera(Camera* setCam)
-  {
-    cam_->getParentSceneNode()->detachObject(cam_);
-    //setCam->attachCamera(cam_);
-    activeCamera_ = setCam;
-  }
-*/
-/*  bool isInVector(Camera* cam)
-  {
-    for(std::vector<Camera*>::iterator it = cams_.begin(); it != cams_.end(); it++)
-    {
-      if (*it == cam) return true;
-    }
-    return false;
-  }*/
-}
Index: code/trunk/src/orxonox/objects/CameraHandler.h
===================================================================
--- code/trunk/src/orxonox/objects/CameraHandler.h	(revision 1937)
+++ 	(revision )
@@ -1,75 +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:
- *      Benjamin Knecht
- *   Co-authors:
- *      ...
- *
- */
-
- /**
- @file  CameraHandler.h
- @brief Handles the instances of Camera class
- @author Benjamin Knecht <beni_at_orxonox.net>
-  */
-
-#ifndef _Camera_Handler_H__
-#define _Camera_Handler_H__
-
-#include <list>
-
-#include <OgreCamera.h>
-
-#include "OrxonoxPrereqs.h"
-
-#include "core/BaseObject.h"
-
-#include "Camera.h"
-
-namespace orxonox
-{
-  class _OrxonoxExport CameraHandler
-  {
-
-    public:
-      inline static CameraHandler* getInstance() { if (!CameraHandler::singletonRef) CameraHandler::singletonRef = new CameraHandler(); return CameraHandler::singletonRef; }
-      inline ~CameraHandler() { CameraHandler::singletonRef = NULL; }
-      inline Camera* getActiveCamera() { return this->focusList_.back(); }
-      /*void registerCamera(Camera* newCam);
-      void changeActiveCamera(Camera* setCam);*/
-      void requestFocus(Camera* requestCam);
-      void releaseFocus(Camera* cam);
-
-    private:
-      CameraHandler();
-      //bool isInVector(Camera* cam);
-
-    private:
-      static CameraHandler* singletonRef;
-      Ogre::Camera* cam_;
-      std::list<Camera*> focusList_;
-      //std::vector<Camera*> cams_;
-
-  };
-}
-
-#endif /* _Camera_Handler_H__ */
Index: code/trunk/src/orxonox/objects/EventDispatcher.cc
===================================================================
--- code/trunk/src/orxonox/objects/EventDispatcher.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/EventDispatcher.cc	(revision 2087)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "EventDispatcher.h"
+
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+#include "core/XMLPort.h"
+#include "core/EventIncludes.h"
+#include "EventTarget.h"
+
+namespace orxonox
+{
+    CreateFactory(EventDispatcher);
+
+    EventDispatcher::EventDispatcher(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(EventDispatcher);
+    }
+
+    EventDispatcher::~EventDispatcher()
+    {
+        if (this->isInitialized())
+            for (std::list<EventTarget*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
+                delete (*it);
+    }
+
+    void EventDispatcher::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(EventDispatcher, XMLPort, xmlelement, mode);
+
+        XMLPortObject(EventDispatcher, EventTarget, "targets", addTarget, getTarget, xmlelement, mode);
+    }
+
+    void EventDispatcher::processEvent(Event& event)
+    {
+        for (std::list<EventTarget*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
+            (*it)->fireEvent(event);
+    }
+
+    void EventDispatcher::addTarget(EventTarget* target)
+    {
+        this->targets_.push_back(target);
+    }
+
+    EventTarget* EventDispatcher::getTarget(unsigned int index) const
+    {
+        unsigned int i = 0;
+        for (std::list<EventTarget*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
+        {
+            if (i == index)
+                return (*it);
+            ++i;
+        }
+        return 0;
+    }
+}
Index: code/trunk/src/orxonox/objects/EventDispatcher.h
===================================================================
--- code/trunk/src/orxonox/objects/EventDispatcher.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/EventDispatcher.h	(revision 2087)
@@ -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 _EventDispatcher_H__
+#define _EventDispatcher_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport EventDispatcher : public BaseObject
+    {
+        public:
+            EventDispatcher(BaseObject* creator);
+            virtual ~EventDispatcher();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            virtual void processEvent(Event& event);
+
+            void addTarget(EventTarget* target);
+            EventTarget* getTarget(unsigned int index) const;
+
+        private:
+            std::list<EventTarget*> targets_;
+    };
+}
+
+#endif /* _EventDispatcher_H__ */
Index: code/trunk/src/orxonox/objects/EventListener.cc
===================================================================
--- code/trunk/src/orxonox/objects/EventListener.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/EventListener.cc	(revision 2087)
@@ -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 "OrxonoxStableHeaders.h"
+#include "EventListener.h"
+
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(EventListener);
+
+    EventListener::EventListener(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(EventListener);
+
+        this->bActive_ = false;
+    }
+
+    EventListener::~EventListener()
+    {
+    }
+
+    void EventListener::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(EventListener, XMLPort, xmlelement, mode);
+
+        XMLPortParam(EventListener, "event", setEventName, getEventName, xmlelement, mode);
+    }
+
+    void EventListener::processEvent(Event& event)
+    {
+        if (this->bActive_)
+        {
+            COUT(2) << "Warning: Detected Event loop in EventListener \"" << this->getName() << "\"" << std::endl;
+            return;
+        }
+
+        this->bActive_ = true;
+
+        this->fireEvent(event.activate_, event.originator_);
+
+        this->bActive_ = false;
+    }
+
+    void EventListener::setEventName(const std::string& eventname)
+    {
+        this->eventName_ = eventname;
+
+        if (this->eventName_ == "")
+            return;
+
+        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
+            if (it->getName() == this->eventName_)
+                this->registerAsListener(*it);
+    }
+
+    void EventListener::loadedNewXMLName(BaseObject* object)
+    {
+        if (this->eventName_ == "")
+            return;
+
+        if (object->getName() == this->eventName_)
+            this->registerAsListener(object);
+    }
+
+    void EventListener::registerAsListener(BaseObject* object)
+    {
+        object->registerEventListener(this, "");
+    }
+}
Index: code/trunk/src/orxonox/objects/EventListener.h
===================================================================
--- code/trunk/src/orxonox/objects/EventListener.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/EventListener.h	(revision 2087)
@@ -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 _EventListener_H__
+#define _EventListener_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/BaseObject.h"
+#include "core/XMLNameListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport EventListener : public BaseObject, public XMLNameListener
+    {
+        public:
+            EventListener(BaseObject* creator);
+            virtual ~EventListener();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+            virtual void processEvent(Event& event);
+
+            void setEventName(const std::string& eventname);
+            inline const std::string& getEventName() const
+                { return this->eventName_; }
+
+        private:
+            virtual void loadedNewXMLName(BaseObject* object);
+            void registerAsListener(BaseObject* object);
+
+            std::string eventName_;
+            bool bActive_;
+    };
+}
+
+#endif /* _EventListener_H__ */
Index: code/trunk/src/orxonox/objects/EventTarget.cc
===================================================================
--- code/trunk/src/orxonox/objects/EventTarget.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/EventTarget.cc	(revision 2087)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "EventTarget.h"
+
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(EventTarget);
+
+    EventTarget::EventTarget(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(EventTarget);
+    }
+
+    EventTarget::~EventTarget()
+    {
+    }
+
+    void EventTarget::changedName()
+    {
+        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
+            if (it->getName() == this->getName())
+                this->addAsEvent(*it);
+    }
+
+    void EventTarget::loadedNewXMLName(BaseObject* object)
+    {
+        if (this->getName() == "")
+            return;
+
+        if (object->getName() == this->getName())
+            this->addAsEvent(object);
+    }
+
+    void EventTarget::addAsEvent(BaseObject* object)
+    {
+        if (object != (BaseObject*)this)
+            object->addEvent(this, "");
+    }
+}
Index: code/trunk/src/orxonox/objects/EventTarget.h
===================================================================
--- code/trunk/src/orxonox/objects/EventTarget.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/EventTarget.h	(revision 2087)
@@ -0,0 +1,52 @@
+/*
+ *   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 _EventTarget_H__
+#define _EventTarget_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/BaseObject.h"
+#include "core/XMLNameListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport EventTarget : public BaseObject, public XMLNameListener
+    {
+        public:
+            EventTarget(BaseObject* creator);
+            virtual ~EventTarget();
+
+            virtual void changedName();
+
+        private:
+            virtual void loadedNewXMLName(BaseObject* object);
+            void addAsEvent(BaseObject* object);
+    };
+}
+
+#endif /* _EventTarget_H__ */
Index: code/trunk/src/orxonox/objects/Model.cc
===================================================================
--- code/trunk/src/orxonox/objects/Model.cc	(revision 1937)
+++ 	(revision )
@@ -1,107 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "Model.h"
-
-#include "tinyxml/tinyxml.h"
-#include "core/CoreIncludes.h"
-#include "GraphicsEngine.h"
-#include "core/XMLPort.h"
-
-#include <OgreEntity.h>
-#include <OgreMesh.h>
-#include <OgreHardwareVertexBuffer.h>
-#include <OgreMeshManager.h>
-
-
-namespace orxonox
-{
-    CreateFactory(Model);
-
-    /**
-     * @brief Constructor
-     */
-    Model::Model()
-    {
-        RegisterObject(Model);
-        registerAllVariables();
-    }
-
-    /**
-     * @brief Destructor
-     */
-    Model::~Model()
-    {
-        if (this->isInitialized() && (this->meshSrc_ != "") && (this->meshSrc_.size() > 0))
-            this->detachObject(this->mesh_.getEntity());
-    }
-
-    /**
-        @brief XML loading and saving.
-        @param xmlelement The XML-element
-        @param loading Loading (true) or saving (false)
-        @return The XML-element
-    */
-    void Model::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(Model, XMLPort, xmlelement, mode);
-
-        XMLPortParam(Model, "mesh", setMesh, getMesh, xmlelement, mode);
-
-        Model::create();
-    }
-
-    bool Model::create(){
-      if(!WorldEntity::create())
-        return false;
-      if ((this->meshSrc_ != "") && (this->meshSrc_.size() > 0))
-      {
-        this->mesh_.setMesh(meshSrc_);
-        this->attachObject(this->mesh_.getEntity());
-
-        COUT(4) << "Loader (Model.cc): Created model" << std::endl;
-      }
-      if(this->isExactlyA(Class(Model)))
-        setObjectFrequency(300); //sync all 10 seconds (this only applies to asteroids and other isExactlyA(Model)'s
-      return true;
-    }
-
-    void Model::registerAllVariables(){
-//       WorldEntity::registerAllVariables();
-      COUT(5) << "Model.cc:registering new meshsrc with size: " << meshSrc_.length()+1 << " this: " << this << std::endl;
-      registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING);
-    }
-
-    void Model::changedVisibility()
-    {
-        SUPER(Model, changedVisibility);
-        if (this->isInitialized())
-            this->mesh_.setVisible(this->isVisible());
-    }
-}
Index: code/trunk/src/orxonox/objects/Model.h
===================================================================
--- code/trunk/src/orxonox/objects/Model.h	(revision 1937)
+++ 	(revision )
@@ -1,62 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _Model_H__
-#define _Model_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "WorldEntity.h"
-#include "../tools/Mesh.h"
-
-namespace orxonox
-{
-
-    class _OrxonoxExport Model : public WorldEntity
-    {
-        public:
-            Model();
-            virtual ~Model();
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void changedVisibility();
-            inline void setMesh(const std::string& meshname)
-                { this->meshSrc_ = meshname; }
-            inline const std::string& getMesh() const
-                { return this->meshSrc_; }
-            virtual bool create();
-
-        protected:
-            void registerAllVariables();
-
-        private:
-            std::string meshSrc_;
-            Mesh mesh_;
-    };
-}
-
-#endif /* _Model_H__ */
Index: code/trunk/src/orxonox/objects/NPC.cc
===================================================================
--- code/trunk/src/orxonox/objects/NPC.cc	(revision 1937)
+++ 	(revision )
@@ -1,176 +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:
- *      Benjamin Knecht, beni_at_orxonox.net
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "NPC.h"
-
-#include "core/CoreIncludes.h"
-#include "core/Iterator.h"
-
-namespace orxonox {
-
-  CreateFactory(NPC);
-
-  NPC::NPC() :
-    movable_(true)
-  {
-    RegisterObject(NPC);
-    registerAllVariables();
-  }
-
-  NPC::~NPC()
-  {
-  }
-
-  /**
-   * function to chance values of an element
-   */
-  void NPC::setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable) {
-    this->setAcceleration(acceleration);
-    this->setVelocity(speed);
-    this->translate(location);
-    movable_ = movable;
-  }
-
-  void NPC::registerAllVariables(){
-    Model::registerAllVariables();
-    registerVar(&movable_, sizeof(movable_), network::DATA);
-  }
-
-
-  /**
-   * calculates the distance between the element and an other point given by temp
-   */
-  float NPC::getDistance(WorldEntity* temp)
-  {
-    Vector3 distance = temp->getPosition() - this->getPosition();
-    return distance.length();
-  }
-
-  /**
-   * updates the data of an element
-   */
-  void NPC::update()
-  {
-
-    //if element is movable, calculate acceleration
-    if (this->movable_ == true) calculateAcceleration();
-
-  }
-
-  /**
-   * tick this NPC
-   */
-  void NPC::tick(float dt)
-  {
-    update();
-    this->setVelocity(0.995*this->getVelocity() + this->getAcceleration()*dt);
-    this->translate(this->getVelocity()*dt);
-    this->setAcceleration(Vector3(0,0,0));
-  }
-
-  /**
-   * calculates the new acceleration of an element
-   */
-  void NPC::calculateAcceleration()
-  {
-    //acceleration consisting of flocking-functions
-    this->setAcceleration(separation() + alignment() + cohesion());
-  }
-
-  /**
-   * separation-function (keep elements separated, avoid crashs)
-   */
-  Vector3 NPC::separation()
-  {
-    Vector3 steering = Vector3(0,0,0); //steeringvector
-    Vector3 inverseDistance = Vector3(0,0,0);  //vector pointing away from possible collisions
-    int numberOfNeighbour = 0;  //number of observed neighbours
-    float distance = 0;  // distance to the actual element
-    for(ObjectList<WorldEntity>::iterator it = ObjectList<WorldEntity>::begin(); it; ++it) {  //go through all elements
-      distance = getDistance(*it);  //get distance between this and actual
-      if ((distance > 0) && (distance < SEPERATIONDISTANCE)) {  //do only if actual is inside detectionradius
-        inverseDistance = Vector3(0,0,0);
-        inverseDistance = this->getPosition() - it->getPosition();  //calculate the distancevector heading towards this
-        //adaptation of the inverseDistance to the distance
-        if ((distance < 200) && (distance >= 120)) {inverseDistance = 2*inverseDistance;}
-        if ((distance < 120) && (distance >= 80)) {inverseDistance = 5*inverseDistance;}
-        if ((distance < 80) && (distance >= 40)) {inverseDistance = 10*inverseDistance;}
-        if ((distance < 40) && (distance > 0)) {inverseDistance = 10*inverseDistance;}
-        steering = steering + inverseDistance;  //add up all significant steeringvectors
-        numberOfNeighbour++;  //counts the elements inside the detectionradius
-      }
-    }
-    if(numberOfNeighbour > 0) { steering = steering / (float)numberOfNeighbour; }  //devide the sum of steeringvectors by the number of elements -> separation steeringvector
-    return steering;
-  }
-
-  /**
-   * alignment-function (lead elements to the same heading)
-   */
-  Vector3 NPC::alignment()
-  {
-    Vector3 steering = Vector3(0,0,0); //steeringvector
-    int numberOfNeighbour = 0;  //number of observed neighbours
-    //float distance = 0;
-    //go through all elements
-    for(ObjectList<NPC>::iterator it = ObjectList<NPC>::begin(); it; ++it) {  //just working with 3 elements at the moment
-      float distance = getDistance(*it);  //get distance between this and actual
-      if ((distance > 0) && (distance < ALIGNMENTDISTANCE)) {  //check if actual element is inside detectionradius
-        steering = steering + it->getVelocity();  //add up all speedvectors inside the detectionradius
-        numberOfNeighbour++;  //counts the elements inside the detectionradius
-      }
-    }
-    if(numberOfNeighbour > 0) { steering = steering / (float)numberOfNeighbour; }  //devide the sum of steeringvectors by the number of elements -> alignment steeringvector
-    return steering;
-  }
-
-  /**
-   * cohseion-function (keep elements close to each other)
-   */
-  Vector3 NPC::cohesion()
-  {
-    Vector3 steering = Vector3(0,0,0); //steeringvector
-    int numberOfNeighbour = 0;  //number of observed neighbours
-    //float distance = 0;
-    //go through all elements
-    for(ObjectList<NPC>::iterator it = ObjectList<NPC>::begin(); it; ++it) {  //just working with 3 elements at the moment
-      float distance = getDistance(*it);  //get distance between this and actual
-      if ((distance > 0) && (distance < COHESIONDISTANCE)) {  //check if actual element is inside detectionradius
-        steering = steering + it->getPosition();  //add up all locations of elements inside the detectionradius
-        numberOfNeighbour++;  //counts the elements inside the detectionradius
-      }
-    }
-    if(numberOfNeighbour > 0) {
-      steering = steering  / (float)numberOfNeighbour;  //devide the sum steeringvector by the number of elements -> cohesion steeringvector
-      steering = steering - this->getPosition();  //transform the vector for the ship
-    }
-    return steering;
-  }
-
-} // end of class NPC
Index: code/trunk/src/orxonox/objects/NPC.h
===================================================================
--- code/trunk/src/orxonox/objects/NPC.h	(revision 1937)
+++ 	(revision )
@@ -1,74 +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:
- *      ...
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-  @file NPC.h
-  @brief AI using WorldEntity
-  @author Benjamin Knecht <beni_at_orxonox.net>
- */
-
-#ifndef _NPC_H__
-#define _NPC_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "Model.h"
-
-namespace orxonox {
-
-  class _OrxonoxExport NPC : public Model
-  {
-    public:
-
-      NPC();
-      virtual ~NPC();
-      virtual void tick(float dt);
-      void update();
-      void setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable);
-      void registerAllVariables();
-      virtual bool create(){return Model::create();}
-
-    private:
-      float getDistance(WorldEntity* temp);
-      void calculateAcceleration();
-      Vector3 separation();
-      Vector3 alignment();
-      Vector3 cohesion();
-
-
-    private:
-      bool movable_;  // movability of the element, (false) gives the possiblity that an object can`t be moved by flocking but still gets into the calculation
-
-      // those values should maybe be controlled by a higher power and should maybe be parameters that can be changed
-      static int const SEPERATIONDISTANCE = 300;  //detectionradius of seperation
-      static int const ALIGNMENTDISTANCE = 300;  //detectionradius of alignment
-      static int const COHESIONDISTANCE = 5000;  //detectionradius of cohesion
-      static int const NUMELEMENTS = 9;  //number of elements
-  };
-}
-#endif /* _NPC_H__ */
Index: code/trunk/src/orxonox/objects/ParticleProjectile.cc
===================================================================
--- code/trunk/src/orxonox/objects/ParticleProjectile.cc	(revision 1937)
+++ 	(revision )
@@ -1,81 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "ParticleProjectile.h"
-
-#include "SpaceShip.h"
-#include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
-
-namespace orxonox
-{
-    CreateFactory(ParticleProjectile);
-
-    ParticleProjectile::ParticleProjectile(SpaceShip* owner) : BillboardProjectile(owner)
-    {
-        RegisterObject(ParticleProjectile);
-
-        this->particles_ = new ParticleInterface("Orxonox/shot2", LODParticle::normal);
-        this->particles_->addToSceneNode(this->getNode());
-        this->particles_->setKeepParticlesInLocalSpace(true);
-        if (this->owner_)
-        {
-        }
-//        else
-//        {
-//            this->particles_ = 0;
-//        }
-
-        this->setConfigValues();
-    }
-
-    ParticleProjectile::~ParticleProjectile()
-    {
-        if (this->isInitialized() && this->particles_)
-            delete this->particles_;
-    }
-
-    void ParticleProjectile::setConfigValues()
-    {
-        SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback((Projectile*)this, &ParticleProjectile::speedChanged);
-    }
-
-    void ParticleProjectile::changedVisibility()
-    {
-        SUPER(ParticleProjectile, changedVisibility);
-        this->particles_->setEnabled(this->isVisible());
-    }
-    
-    bool ParticleProjectile::create(){
-      if(!Projectile::create())
-        return false;
-      this->particles_->getAllEmitters()->setDirection(-this->getOrientation()*Vector3(1,0,0));
-      return true;
-    }
-}
Index: code/trunk/src/orxonox/objects/ParticleProjectile.h
===================================================================
--- code/trunk/src/orxonox/objects/ParticleProjectile.h	(revision 1937)
+++ 	(revision )
@@ -1,55 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _ParticleProjectile_H__
-#define _ParticleProjectile_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "BillboardProjectile.h"
-#include "tools/ParticleInterface.h"
-#include "util/Math.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport ParticleProjectile : public BillboardProjectile
-    {
-        public:
-            ParticleProjectile(SpaceShip* owner = 0);
-            virtual ~ParticleProjectile();
-            virtual void changedVisibility();
-            void setConfigValues();
-            
-            virtual bool create();
-
-        private:
-            ParticleInterface* particles_;
-    };
-}
-
-#endif /* _ParticleProjectile_H__ */
Index: code/trunk/src/orxonox/objects/ParticleSpawner.cc
===================================================================
--- code/trunk/src/orxonox/objects/ParticleSpawner.cc	(revision 1937)
+++ 	(revision )
@@ -1,106 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "ParticleSpawner.h"
-
-#include <OgreSceneManager.h>
-#include "core/CoreIncludes.h"
-#include "core/Executor.h"
-#include "tools/ParticleInterface.h"
-#include "GraphicsEngine.h"
-
-namespace orxonox
-{
-    CreateFactory(ParticleSpawner);
-
-    ParticleSpawner::ParticleSpawner()
-    {
-        RegisterObject(ParticleSpawner);
-        this->particle_ = 0;
-    }
-
-    ParticleSpawner::ParticleSpawner(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime, float startdelay, float destroydelay, const Vector3& direction)
-    {
-        RegisterObject(ParticleSpawner);
-        this->setParticle(templateName, detaillevel, lifetime, startdelay, destroydelay, direction);
-    }
-
-    void ParticleSpawner::setParticle(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime, float startdelay, float destroydelay, const Vector3& direction)
-    {
-        ExecutorMember<ParticleSpawner>* executor = createExecutor(createFunctor(&ParticleSpawner::createParticleSpawner));
-        this->destroydelay_ = destroydelay;
-        executor->setDefaultValues(lifetime);
-        this->timer_.setTimer(startdelay, false, this, executor);
-        this->particle_ = new ParticleInterface(templateName, detaillevel);
-        this->particle_->addToSceneNode(this->getNode());
-        this->particle_->setEnabled(false);
-        if (direction != Vector3::ZERO)
-        {
-            this->particle_->getAllEmitters()->setDirection(direction);
-        }
-    }
-
-    ParticleSpawner::~ParticleSpawner()
-    {
-        if (this->isInitialized() && this->particle_)
-        {
-            this->particle_->detachFromSceneNode();
-            delete this->particle_;
-        }
-    };
-
-    void ParticleSpawner::destroy()
-    {
-        this->setPosition(this->getNode()->getParent()->getPosition());
-        this->getNode()->getParent()->removeChild(this->getNode());
-        GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->addChild(this->getNode());
-        if (this->particle_)
-            this->particle_->setEnabled(false);
-        if (!this->timer_.isActive() || this->timer_.getRemainingTime() > this->destroydelay_)
-            this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
-    }
-
-    void ParticleSpawner::createParticleSpawner(float lifetime)
-    {
-        this->particle_->setEnabled(true);
-        if (lifetime != 0)
-            this->timer_.setTimer(lifetime, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
-    }
-
-    void ParticleSpawner::destroyParticleSpawner()
-    {
-        delete this;
-    }
-
-    void ParticleSpawner::setVisible(bool visible)
-    {
-        if (this->particle_)
-            this->particle_->setEnabled(visible);
-    }
-}
Index: code/trunk/src/orxonox/objects/ParticleSpawner.h
===================================================================
--- code/trunk/src/orxonox/objects/ParticleSpawner.h	(revision 1937)
+++ 	(revision )
@@ -1,63 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _ParticleSpawner_H__
-#define _ParticleSpawner_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "WorldEntity.h"
-#include "tools/Timer.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport ParticleSpawner : public WorldEntity
-    {
-        public:
-            ParticleSpawner();
-            ParticleSpawner(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime = 0, float startdelay = 0, float destroydelay = 0, const Vector3& direction = Vector3::ZERO);
-            virtual ~ParticleSpawner();
-            void destroy();
-
-            void setParticle(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime = 0, float startdelay = 0, float destroydelay = 0, const Vector3& direction = Vector3::ZERO);
-            inline ParticleInterface* getParticleInterface() const
-                { return this->particle_; }
-
-            void setVisible(bool visible);
-
-        private:
-            void createParticleSpawner(float lifetime);
-            void destroyParticleSpawner();
-
-            Timer<ParticleSpawner> timer_;
-            ParticleInterface* particle_;
-            float destroydelay_;
-    };
-}
-
-#endif /* _ParticleSpawner_H__ */
Index: code/trunk/src/orxonox/objects/Projectile.cc
===================================================================
--- code/trunk/src/orxonox/objects/Projectile.cc	(revision 1937)
+++ 	(revision )
@@ -1,130 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "Projectile.h"
-
-#include <OgreBillboard.h>
-
-#include "core/CoreIncludes.h"
-#include "core/Executor.h"
-#include "core/ConfigValueIncludes.h"
-#include "core/Iterator.h"
-#include "tools/ParticleInterface.h"
-
-#include "SpaceShipAI.h"
-#include "ParticleSpawner.h"
-#include "Model.h"
-#include "Settings.h"
-
-namespace orxonox
-{
-    float Projectile::speed_s = 5000;
-
-    Projectile::Projectile(SpaceShip* owner) : owner_(owner)
-    {
-        RegisterObject(Projectile);
-
-        this->setConfigValues();
-        this->explosionTemplateName_ = "Orxonox/explosion3";
-        this->smokeTemplateName_ = "Orxonox/smoke4";
-
-        this->setStatic(false);
-        this->translate(Vector3(55, 0, 0), Ogre::Node::TS_LOCAL);
-        
-        if (this->owner_)
-        {
-            this->setOrientation(this->owner_->getOrientation());
-            this->setPosition(this->owner_->getPosition());
-            this->setVelocity(this->owner_->getInitialDir() * this->speed_);
-        }
-
-        if(!orxonox::Settings::isClient()) //only if not on client
-          this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject)));
-    }
-
-    Projectile::~Projectile()
-    {
-    }
-
-    void Projectile::setConfigValues()
-    {
-        SetConfigValue(damage_, 15.0).description("The damage caused by the projectile");
-        SetConfigValue(lifetime_, 4.0).description("The time in seconds a projectile stays alive");
-        SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback(this, &Projectile::speedChanged);
-    }
-
-    void Projectile::speedChanged()
-    {
-        Projectile::speed_s = this->speed_;
-        if (this->owner_)
-            this->setVelocity(this->owner_->getInitialDir() * this->speed_);
-    }
-
-    void Projectile::tick(float dt)
-    {
-        SUPER(Projectile, tick, dt);
-
-        if (!this->isActive())
-            return;
-
-        float radius;
-        for (ObjectList<Model>::iterator it = ObjectList<Model>::begin(); it; ++it)
-        {
-            if ((*it) != this->owner_)
-            {
-                radius = it->getScale3D().x * 3.0;
-
-                if (this->getPosition().squaredDistance(it->getPosition()) <= (radius*radius))
-                {
-                    // hit
-                    if (it->isA(Class(SpaceShipAI)))
-                        ((SpaceShipAI*)(*it))->damage(this->damage_);
-                    ParticleSpawner* explosion = new ParticleSpawner(this->explosionTemplateName_, LODParticle::low, 2.0);
-                    explosion->setPosition(this->getPosition());
-                    explosion->create();
-                    ParticleSpawner* smoke = new ParticleSpawner(this->smokeTemplateName_, LODParticle::normal, 2.0, 0.0);
-                    smoke->setPosition(this->getPosition());
-//                    smoke->getParticleInterface()->setSpeedFactor(3.0);
-                    smoke->create();
-                    delete this;
-                    return;
-                }
-            }
-        }
-    }
-
-    void Projectile::destroyObject()
-    {
-        delete this;
-    }
-    
-    bool Projectile::create(){
-      return WorldEntity::create();
-    }
-}
Index: code/trunk/src/orxonox/objects/Projectile.h
===================================================================
--- code/trunk/src/orxonox/objects/Projectile.h	(revision 1937)
+++ 	(revision )
@@ -1,70 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _Projectile_H__
-#define _Projectile_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "WorldEntity.h"
-#include "tools/Timer.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Projectile : public WorldEntity
-    {
-        public:
-            virtual ~Projectile();
-            void setConfigValues();
-            void speedChanged();
-            void destroyObject();
-            virtual void tick(float dt);
-            
-            virtual bool create();
-
-            static float getSpeed()
-                { return Projectile::speed_s; }
-
-        protected:
-            Projectile(SpaceShip* owner = 0);
-            SpaceShip* owner_;
-
-        private:
-            std::string explosionTemplateName_;
-            std::string smokeTemplateName_;
-        protected:
-            static float speed_s;
-            float speed_;
-        private:
-            float lifetime_;
-            float damage_;
-            Timer<Projectile> destroyTimer_;
-    };
-}
-
-#endif /* _Projectile_H__ */
Index: code/trunk/src/orxonox/objects/Radar.cc
===================================================================
--- code/trunk/src/orxonox/objects/Radar.cc	(revision 1937)
+++ code/trunk/src/orxonox/objects/Radar.cc	(revision 2087)
@@ -36,6 +36,4 @@
 #include <cfloat>
 #include <cassert>
-#include "objects/WorldEntity.h"
-#include "objects/SpaceShip.h"
 #include "core/CoreIncludes.h"
 #include "core/ConsoleCommand.h"
@@ -114,6 +112,8 @@
             for (ObjectList<RadarViewable>::iterator itElement = ObjectList<RadarViewable>::begin(); itElement; ++itElement)
             {
+/*
                 if ((*itElement) != SpaceShip::getLocalShip() && (*itListener)->getRadarSensitivity() > (*itElement)->getRadarObjectCamouflage())
                     (*itListener)->displayObject(*itElement, *itElement == this->focus_);
+*/
             }
         }
@@ -130,5 +130,5 @@
         else
         {
-            Vector3 localPosition = SpaceShip::getLocalShip()->getPosition();
+            Vector3 localPosition;// = SpaceShip::getLocalShip()->getPosition();
             Vector3 targetPosition = localPosition;
             if (*(this->itFocus_))
@@ -143,7 +143,8 @@
             for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it)
             {
+/*
                 if (*it == SpaceShip::getLocalShip())
                     continue;
-
+*/
                 float targetDistance = localPosition.squaredDistance((*it)->getWorldPosition());
                 if (targetDistance > currentDistance && targetDistance < nextDistance)
Index: code/trunk/src/orxonox/objects/RadarViewable.cc
===================================================================
--- code/trunk/src/orxonox/objects/RadarViewable.cc	(revision 1937)
+++ code/trunk/src/orxonox/objects/RadarViewable.cc	(revision 2087)
@@ -31,5 +31,5 @@
 #include "util/Debug.h"
 #include "core/CoreIncludes.h"
-#include "objects/WorldEntity.h"
+//#include "objects/WorldEntity.h"
 #include "Radar.h"
 
@@ -63,5 +63,5 @@
     {
         validate();
-        return this->radarObject_->getWorldPosition();
+        return Vector3::ZERO;//this->radarObject_->getWorldPosition();
     }
 
@@ -69,5 +69,5 @@
     {
         validate();
-        return this->radarObject_->getOrientation() * this->radarObject_->getVelocity();
+        return Vector3::ZERO;//this->radarObject_->getOrientation() * this->radarObject_->getVelocity();
     }
 }
Index: code/trunk/src/orxonox/objects/RadarViewable.h
===================================================================
--- code/trunk/src/orxonox/objects/RadarViewable.h	(revision 1937)
+++ code/trunk/src/orxonox/objects/RadarViewable.h	(revision 2087)
@@ -44,4 +44,6 @@
     class _OrxonoxExport RadarViewable : virtual public OrxonoxClass
     {
+    class WorldEntity;
+
     public:
         enum Shape
Index: code/trunk/src/orxonox/objects/RotatingProjectile.cc
===================================================================
--- code/trunk/src/orxonox/objects/RotatingProjectile.cc	(revision 1937)
+++ 	(revision )
@@ -1,98 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *
- *
- *   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 "OrxonoxStableHeaders.h"
-#include "RotatingProjectile.h"
-
-#include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
-#include <OgreBillboard.h>
-
-namespace orxonox
-{
-    CreateFactory(RotatingProjectile);
-
-    RotatingProjectile::RotatingProjectile(SpaceShip* owner) : BillboardProjectile(owner)
-    {
-        RegisterObject(RotatingProjectile);
-
-        this->time_ = 0;
-
-        if (/*this->owner_*/true)
-        {
-            this->rotatingBillboard1_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
-            this->rotatingBillboard2_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
-
-            this->rotatingNode1_ = this->getNode()->createChildSceneNode(this->getName() + "rotating1", Vector3(0, 50, 0));
-            this->rotatingNode2_ = this->getNode()->createChildSceneNode(this->getName() + "rotating2", Vector3(0, -50, 0));
-            this->rotatingNode1_->attachObject(this->rotatingBillboard1_.getBillboardSet());
-            this->rotatingNode2_->attachObject(this->rotatingBillboard2_.getBillboardSet());
-            this->rotatingNode1_->scale(0.3, 0.3, 0.3);
-            this->rotatingNode2_->scale(0.3, 0.3, 0.3);
-        }
-
-        this->setConfigValues();
-    }
-
-    RotatingProjectile::~RotatingProjectile()
-    {
-    }
-
-    void RotatingProjectile::setConfigValues()
-    {
-        SetConfigValue(colour_, ColourValue(1.0, 0.0, 0.0)).callback(this, &RotatingProjectile::colourChanged);
-    }
-
-    void RotatingProjectile::colourChanged()
-    {
-        if (this->isInitialized())
-        {
-            this->rotatingBillboard1_.getBillboardSet()->getBillboard(0)->setColour(this->colour_);
-            this->rotatingBillboard2_.getBillboardSet()->getBillboard(0)->setColour(this->colour_);
-        }
-    }
-
-    void RotatingProjectile::tick(float dt)
-    {
-        if (this->isActive())
-        {
-            this->time_ += dt;
-
-            this->rotatingNode1_->setPosition(0, 50 * sin(this->time_ * 20), 50 * cos(this->time_ * 20));
-            this->rotatingNode2_->setPosition(0, -50 * sin(this->time_ * 20), -50 * cos(this->time_ * 20));
-        }
-
-        SUPER(RotatingProjectile, tick, dt);
-    }
-
-    void RotatingProjectile::changedVisibility()
-    {
-        SUPER(RotatingProjectile, changedVisibility);
-        this->rotatingBillboard1_.setVisible(this->isVisible());
-        this->rotatingBillboard2_.setVisible(this->isVisible());
-    }
-}
Index: code/trunk/src/orxonox/objects/RotatingProjectile.h
===================================================================
--- code/trunk/src/orxonox/objects/RotatingProjectile.h	(revision 1937)
+++ 	(revision )
@@ -1,30 +1,0 @@
-#ifndef _RotatingProjectile_H__
-#define _RotatingProjectile_H__
-
-#include "OrxonoxPrereqs.h"
-#include "util/Math.h"
-#include "BillboardProjectile.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport RotatingProjectile : public BillboardProjectile
-    {
-        public:
-            RotatingProjectile(SpaceShip* owner = 0);
-            virtual ~RotatingProjectile();
-            void setConfigValues();
-            void colourChanged();
-            virtual void tick(float dt);
-            virtual void changedVisibility();
-
-        private:
-            ColourValue colour_;
-            BillboardSet rotatingBillboard1_;
-            BillboardSet rotatingBillboard2_;
-            Ogre::SceneNode* rotatingNode1_;
-            Ogre::SceneNode* rotatingNode2_;
-            float time_;
-    };
-}
-
-#endif /* _RotatingProjectile_H__ */
Index: code/trunk/src/orxonox/objects/Scene.cc
===================================================================
--- code/trunk/src/orxonox/objects/Scene.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/Scene.cc	(revision 2087)
@@ -0,0 +1,166 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "Scene.h"
+
+#include <OgreRoot.h>
+#include <OgreSceneManagerEnumerator.h>
+#include <OgreSceneNode.h>
+#include <OgreLight.h>
+
+#include "core/CoreIncludes.h"
+#include "core/Core.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(Scene);
+
+    Scene::Scene(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
+    {
+        RegisterObject(Scene);
+
+        this->setScene(this);
+        this->bShadows_ = false;
+
+        if (Core::showsGraphics())
+        {
+            if (Ogre::Root::getSingletonPtr())
+            {
+                this->sceneManager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
+                this->rootSceneNode_ = this->sceneManager_->getRootSceneNode();
+            }
+            else
+            {
+                this->sceneManager_ = 0;
+                this->rootSceneNode_ = 0;
+            }
+        }
+        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();
+        }
+
+        // test test test
+        if (Core::showsGraphics() && this->sceneManager_)
+        {
+            Ogre::Light* light;
+            light = this->sceneManager_->createLight("Light-1");
+            light->setType(Ogre::Light::LT_DIRECTIONAL);
+            light->setDiffuseColour(ColourValue(1.0, 0.9, 0.6, 1.0));
+            light->setSpecularColour(ColourValue(1.0, 0.9, 0.6, 1.0));
+            light->setDirection(1, -0.3, 0.3);
+        }
+        // test test test
+
+        this->registerVariables();
+    }
+
+    Scene::~Scene()
+    {
+        if (this->isInitialized())
+        {
+            if (Ogre::Root::getSingletonPtr())
+            {
+//                this->sceneManager_->destroySceneNode(this->rootSceneNode_->getName()); // TODO: remove getName() for newer versions of Ogre
+                Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_);
+            }
+            else if (!Core::showsGraphics())
+            {
+                delete this->sceneManager_;
+            }
+        }
+    }
+
+    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.2, 0.2, 0.2, 1));
+        XMLPortParam(Scene, "shadow", setShadow, getShadow, xmlelement, mode).defaultValues(true);
+
+        XMLPortObjectExtended(Scene, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);
+    }
+
+    void Scene::registerVariables()
+    {
+        REGISTERSTRING(this->skybox_,     network::direction::toclient, new network::NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
+        REGISTERDATA(this->ambientLight_, network::direction::toclient, new network::NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
+    }
+
+    void Scene::setSkybox(const std::string& skybox)
+    {
+        if (Core::showsGraphics() && this->sceneManager_)
+            this->sceneManager_->setSkyBox(true, skybox);
+
+        this->skybox_ = skybox;
+    }
+
+    void Scene::setAmbientLight(const ColourValue& colour)
+    {
+        if (Core::showsGraphics() && this->sceneManager_)
+            this->sceneManager_->setAmbientLight(colour);
+
+        this->ambientLight_ = colour;
+    }
+
+    void Scene::setShadow(bool bShadow)
+    {
+        if (Core::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;
+    }
+}
Index: code/trunk/src/orxonox/objects/Scene.h
===================================================================
--- code/trunk/src/orxonox/objects/Scene.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/Scene.h	(revision 2087)
@@ -0,0 +1,84 @@
+/*
+ *   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 _Scene_H__
+#define _Scene_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "network/Synchronisable.h"
+#include "core/BaseObject.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Scene : public BaseObject, public network::Synchronisable
+    {
+        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_; }
+
+        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_); }
+
+            Ogre::SceneManager*    sceneManager_;
+            Ogre::SceneNode*       rootSceneNode_;
+            std::string            skybox_;
+            ColourValue            ambientLight_;
+            std::list<BaseObject*> objects_;
+            bool                   bShadows_;
+    };
+}
+
+#endif /* _Scene_H__ */
Index: code/trunk/src/orxonox/objects/Script.cc
===================================================================
--- code/trunk/src/orxonox/objects/Script.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/Script.cc	(revision 2087)
@@ -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:
+ *      Benjamin Knecht
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Script.h"
+
+#include "util/Debug.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "core/LuaBind.h"
+
+namespace orxonox
+{
+  CreateFactory(Script);
+
+  Script::Script(BaseObject* creator) : BaseObject(creator)
+  {
+    RegisterObject(Script);
+
+    code_ = "";
+  }
+
+  Script::~Script()
+  {
+  }
+
+  /**
+  @brief XML loading and saving.
+  @param xmlelement The XML-element
+  @param loading Loading (true) or saving (false)
+   */
+  void Script::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+  {
+    BaseObject::XMLPort(xmlelement, mode);
+
+    code_ = xmlelement.GetText(false);
+  }
+
+  void Script::execute()
+  {
+    LuaBind* lua = LuaBind::getInstance();
+    lua->loadString(this->code_);
+    lua->run();
+  }
+}
Index: code/trunk/src/orxonox/objects/Script.h
===================================================================
--- code/trunk/src/orxonox/objects/Script.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/Script.h	(revision 2087)
@@ -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:
+ *      Benjamin Knecht
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Script_H__
+#define _Script_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+  class _OrxonoxExport Script : public BaseObject
+  {
+    public:
+      Script(BaseObject* creator);
+      ~Script();
+      void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+      void execute();
+
+    private:
+      std::string code_;
+  };
+}
+
+#endif /* _Script_H__ */
Index: code/trunk/src/orxonox/objects/Skybox.cc
===================================================================
--- code/trunk/src/orxonox/objects/Skybox.cc	(revision 1937)
+++ 	(revision )
@@ -1,94 +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:
- *      ...
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "Skybox.h"
-
-#include <string>
-
-#include <OgreSceneManager.h>
-
-#include "tinyxml/tinyxml.h"
-#include "GraphicsEngine.h"
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Debug.h"
-#include "Settings.h"
-
-namespace orxonox
-{
-    CreateFactory(Skybox);
-
-    Skybox::Skybox()
-    {
-        RegisterObject(Skybox);
-        registerAllVariables();
-    }
-
-    Skybox::~Skybox()
-    {
-    }
-
-    void Skybox::setSkybox(const std::string& skyboxname)
-    {
-        if (Settings::showsGraphics())
-            GraphicsEngine::getInstance().getLevelSceneManager()->setSkyBox(true, skyboxname);
-    }
-
-    /**
-        @brief XML loading and saving.
-        @param xmlelement The XML-element
-        @param loading Loading (true) or saving (false)
-        @return The XML-element
-    */
-    void Skybox::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(Skybox, XMLPort, xmlelement, mode);
-
-        XMLPortParam(Skybox, "src", setSkyboxSrc, getSkyboxSrc, xmlelement, mode);
-        create();
-    }
-
-    bool Skybox::create()
-    {
-        this->setSkybox(this->skyboxSrc_);
-        return Synchronisable::create();
-    }
-
-    void Skybox::registerAllVariables()
-    {
-        registerVar(&skyboxSrc_, skyboxSrc_.length()+1 ,network::STRING);
-    }
-
-    void Skybox::changedVisibility()
-    {
-        SUPER(Skybox, changedVisibility);
-        if (Settings::showsGraphics())
-            GraphicsEngine::getInstance().getLevelSceneManager()->setSkyBox(this->isVisible(), this->skyboxSrc_);
-    }
-}
Index: code/trunk/src/orxonox/objects/Skybox.h
===================================================================
--- code/trunk/src/orxonox/objects/Skybox.h	(revision 1937)
+++ 	(revision )
@@ -1,64 +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:
- *      ...
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _Skybox_H__
-#define _Skybox_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "core/BaseObject.h"
-#include "network/Synchronisable.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Skybox : public BaseObject, public network::Synchronisable
-    {
-        public:
-            Skybox();
-            virtual ~Skybox();
-
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void changedVisibility();
-            void setSkybox(const std::string& skyboxname);
-
-            virtual bool create();
-            void registerAllVariables();
-
-            inline void setSkyboxSrc(const std::string &src)
-                { this->skyboxSrc_ = src; }
-            inline const std::string& getSkyboxSrc() const
-                { return this->skyboxSrc_; }
-
-        private:
-            std::string skyboxSrc_;
-
-
-    };
-}
-
-#endif /* _Skybox_H__ */
Index: code/trunk/src/orxonox/objects/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1937)
+++ 	(revision )
@@ -1,637 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      Benjamin Knecht
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "SpaceShip.h"
-
-#include <OgreCamera.h>
-#include <OgreRenderWindow.h>
-#include <OgreParticleSystem.h>
-#include <OgreSceneNode.h>
-
-#include "util/Convert.h"
-#include "util/Math.h"
-#include "util/Debug.h"
-#include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
-#include "core/Iterator.h"
-#include "core/input/InputManager.h"
-#include "core/XMLPort.h"
-#include "core/ConsoleCommand.h"
-#include "tools/ParticleInterface.h"
-#include "network/Client.h"
-#include "Backlight.h"
-#include "CameraHandler.h"
-#include "ParticleSpawner.h"
-#include "Settings.h"
-#include "RotatingProjectile.h"
-#include "ParticleProjectile.h"
-#include "GraphicsEngine.h"
-#include "SpaceShipAI.h"
-
-namespace orxonox
-{
-    SetConsoleCommand(SpaceShip, setMaxSpeedTest, false).accessLevel(AccessLevel::Debug);
-    SetConsoleCommand(SpaceShip, whereAmI, true).accessLevel(AccessLevel::User);
-    SetConsoleCommand(SpaceShip, moveLongitudinal, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
-    SetConsoleCommand(SpaceShip, moveLateral, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
-    SetConsoleCommand(SpaceShip, moveYaw, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
-    SetConsoleCommand(SpaceShip, movePitch, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
-    SetConsoleCommand(SpaceShip, moveRoll, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold);
-    SetConsoleCommand(SpaceShip, fire, true).accessLevel(AccessLevel::User).keybindMode(KeybindMode::OnHold);
-    SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxSpeed", 1, false).accessLevel(AccessLevel::Debug);
-    SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxBlubber", 2, false).accessLevel(AccessLevel::Debug);
-    SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setRofl", 3, false).accessLevel(AccessLevel::Debug);
-
-    CreateFactory(SpaceShip);
-
-    SpaceShip* SpaceShip::instance_s;
-
-
-    SpaceShip *SpaceShip::getLocalShip(){
-      ObjectList<SpaceShip>::iterator it;
-      for(it = ObjectList<SpaceShip>::begin(); it; ++it){
-	assert(it->isA(Class(SpaceShip)));
-        if( (it)->myShip_ || (network::Host::running() && network::Host::getShipID()==(it)->getObjectID()) ){
-//	  COUT(1) << "^^^^^^^^^^ myShip_:" << *it << " classname: " << (*it)->getIdentifier()->getName() << " objectid: " << (*it)->objectID << std::endl;
-          return *it;
-	}
-      }
-      return 0;
-    }
-
-    SpaceShip::SpaceShip()
-    {
-        RegisterObject(SpaceShip);
-
-        this->setRotationAxis(1, 0, 0);
-        this->setStatic(false);
-
-        this->zeroRadian_ = 0;
-        this->maxSideAndBackSpeed_ = 0;
-        this->maxSpeed_ = 0;
-        this->maxRotation_ = 0;
-        this->translationAcceleration_ = 0;
-        this->rotationAcceleration_ = 0;
-        this->translationDamping_ = 0;
-        this->rotationDamping_ = 0;
-        this->maxRotationRadian_ = 0;
-        this->rotationAccelerationRadian_ = 0;
-        this->rotationDampingRadian_ = 0;
-
-        this->cam_ = 0;
-        this->tt1_ = 0;
-        this->tt2_ = 0;
-        this->smoke_ = 0;
-        this->fire_ = 0;
-
-        this->backlight_ = 0;
-
-        this->redNode_ = 0;
-        this->greenNode_ = 0;
-        this->blinkTime_ = 0;
-
-        this->timeToReload_ = 0;
-
-        this->bLMousePressed_ = false;
-        this->bRMousePressed_ = false;
-        this->mouseXRotation_ = 0;
-        this->mouseYRotation_ = 0;
-        this->myShip_ = false;
-
-        this->registerAllVariables();
-
-        SpaceShip::instance_s = this;
-
-        this->setConfigValues();
-
-        this->initialDir_ = Vector3(1.0, 0.0, 0.0);
-        this->currentDir_ = initialDir_;
-        this->initialOrth_ = Vector3(0.0, 0.0, 1.0);
-        this->currentOrth_ = initialOrth_;
-
-        this->camName_ = this->getName() + "CamNode";
-
-        this->teamNr_ = 0;
-        this->health_ = 100;
-
-        this->radarObject_ = static_cast<WorldEntity*>(this);
-    }
-
-    SpaceShip::~SpaceShip()
-    {
-        for (ObjectList<SpaceShipAI>::iterator it = ObjectList<SpaceShipAI>::begin(); it; ++it)
-            it->shipDied(this);
-      
-        if (this->isInitialized())
-        {
-            if (this->tt1_)
-                delete this->tt1_;
-            if (this->tt2_)
-                delete this->tt2_;
-
-            if (this->smoke_)
-                this->smoke_->destroy();
-            if (this->fire_)
-                this->fire_->destroy();
-
-            if (this->backlight_)
-                delete this->backlight_;
-
-            if (this->cam_)
-                delete this->cam_;
-        }
-    }
-
-    bool SpaceShip::create()
-    {
-        if (!myShip_)
-        {
-            if (network::Host::running() && getObjectID() == network::Host::getShipID())
-            {
-                if (!network::Host::isServer())
-                    setObjectMode(0x3);
-                myShip_ = true;
-            }
-        }
-        else
-            this->setRadarObjectColour(this->getProjectileColour());
-        Model::create();
-        this->init();
-        return true;
-    }
-
-    void SpaceShip::registerAllVariables()
-    {
-        registerVar( &camName_, camName_.length()+1, network::STRING, 0x1 );
-        registerVar( &maxSpeed_, sizeof(maxSpeed_), network::DATA, 0x1);
-        registerVar( &maxSideAndBackSpeed_, sizeof(maxSideAndBackSpeed_), network::DATA, 0x1);
-        registerVar( &maxRotation_, sizeof(maxRotation_), network::DATA, 0x1);
-        registerVar( &translationAcceleration_, sizeof(translationAcceleration_), network::DATA, 0x1);
-        registerVar( &rotationAcceleration_, sizeof(rotationAcceleration_), network::DATA, 0x1);
-        registerVar( &rotationAccelerationRadian_, sizeof(rotationAccelerationRadian_), network::DATA, 0x1);
-        registerVar( &translationDamping_, sizeof(translationDamping_), network::DATA, 0x1);
-        registerVar( &rotationDamping_, sizeof(rotationDamping_), network::DATA, 0x1);
-        registerVar( &rotationDampingRadian_, sizeof(rotationDampingRadian_), network::DATA, 0x1);
-    }
-
-    void SpaceShip::init()
-    {
-        if (Settings::showsGraphics())
-        {
-            // START CREATING THRUSTERS
-            this->tt1_ = new ParticleInterface("Orxonox/thruster1", LODParticle::low);
-            this->tt1_->createNewEmitter();
-            this->tt1_->getAllEmitters()->setDirection(-this->getInitialDir());
-            this->tt1_->getEmitter(0)->setPosition(Vector3(-15, 20, -1));
-            this->tt1_->getEmitter(1)->setPosition(Vector3(-15, -20, -1));
-            this->tt1_->setSpeedFactor(3.0);
-
-            Ogre::SceneNode* node2a = this->getNode()->createChildSceneNode(this->getName() + "particle2a");
-            node2a->setInheritScale(false);
-            node2a->setScale(1, 1, 1);
-            tt1_->addToSceneNode(node2a);
-
-            this->tt2_ = new ParticleInterface("Orxonox/thruster2", LODParticle::normal);
-            this->tt2_->createNewEmitter();
-            this->tt2_->getAllEmitters()->setDirection(Vector3(-1, 0, 0));
-            this->tt2_->getEmitter(0)->setPosition(Vector3(-30, 40, -2));
-            this->tt2_->getEmitter(1)->setPosition(Vector3(-30, -40, -2));
-
-            Ogre::SceneNode* node2b = this->getNode()->createChildSceneNode(this->getName() + "particle2b");
-            node2b->setInheritScale(false);
-            node2b->setScale(0.5, 0.5, 0.5);
-            tt2_->addToSceneNode(node2b);
-
-            this->leftThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, -10, -0.5));
-            this->rightThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, 10, -0.5));
-
-            Ogre::SceneNode* node2c = this->getNode()->createChildSceneNode(this->getName() + "particle2c");
-            node2c->setInheritScale(false);
-            node2c->setScale(2, 2, 2);
-            node2c->attachObject(this->leftThrusterFlare_.getBillboardSet());
-            node2c->attachObject(this->rightThrusterFlare_.getBillboardSet());
-            // END CREATING THRUSTERS
-
-            // START CREATING BLINKING LIGHTS
-            this->redBillboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
-            this->greenBillboard_.setBillboardSet("Examples/Flare", ColourValue(0.0, 1.0, 0.0), 1);
-
-            this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0.3, 4.0, -0.3));
-            this->redNode_->setInheritScale(false);
-            this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0.3, -4.0, -0.3));
-            this->greenNode_->setInheritScale(false);
-
-            this->redNode_->attachObject(this->redBillboard_.getBillboardSet());
-            this->redNode_->setScale(0.3, 0.3, 0.3);
-
-            this->greenNode_->attachObject(this->greenBillboard_.getBillboardSet());
-            this->greenNode_->setScale(0.3, 0.3, 0.3);
-            // END CREATING BLINKING LIGHTS
-
-            // START CREATING ADDITIONAL EFFECTS
-            if(!network::Host::running()){
-              this->backlight_ = new Backlight(this->maxSpeed_, 0.8);
-              this->attachObject(this->backlight_);
-              this->backlight_->setPosition(-2.35, 0, 0.2);
-              this->backlight_->create();
-              this->backlight_->setColour(this->getProjectileColour());
-  
-              this->smoke_ = new ParticleSpawner();
-              this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3);
-              this->attachObject(this->smoke_);
-  
-              this->fire_ = new ParticleSpawner();
-              this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1);
-              this->attachObject(this->fire_);
-            }
-            
-            // END CREATING ADDITIONAL EFFECTS
-
-            if (this->isExactlyA(Class(SpaceShip)))
-            {
-                // START of testing crosshair
-                this->crosshairNear_.setBillboardSet("Orxonox/Crosshair", ColourValue(1.0, 1.0, 0.0), 1);
-                this->crosshairFar_.setBillboardSet("Orxonox/Crosshair", ColourValue(1.0, 1.0, 0.0), 1);
-
-                this->chNearNode_ = this->getNode()->createChildSceneNode(this->getName() + "near", Vector3(50.0, 0.0, 0.0));
-                this->chNearNode_->setInheritScale(false);
-                this->chFarNode_ = this->getNode()->createChildSceneNode(this->getName() + "far", Vector3(200.0, 0.0, 0.0));
-                this->chFarNode_->setInheritScale(false);
-
-                this->chNearNode_->attachObject(this->crosshairNear_.getBillboardSet());
-                this->chNearNode_->setScale(0.2, 0.2, 0.2);
-
-                this->chFarNode_->attachObject(this->crosshairFar_.getBillboardSet());
-                this->chFarNode_->setScale(0.4, 0.4, 0.4);
-                // END of testing crosshair
-            }
-        }
-        // END of testing crosshair
-
-        createCamera();
-    }
-
-    void SpaceShip::setConfigValues()
-    {
-        SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
-        SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds");
-        SetConfigValue(testvector_, Vector3()).description("asdfblah");
-    }
-
-    void SpaceShip::changedVisibility()
-    {
-        SUPER(SpaceShip, changedVisibility);
-
-        this->tt1_->setEnabled(this->isVisible());
-        this->tt2_->setEnabled(this->isVisible());
-        this->redBillboard_.setVisible(this->isVisible());
-        this->greenBillboard_.setVisible(this->isVisible());
-        this->crosshairNear_.setVisible(this->isVisible());
-        this->crosshairFar_.setVisible(this->isVisible());
-        this->rightThrusterFlare_.setVisible(this->isVisible());
-        this->leftThrusterFlare_.setVisible(this->isVisible());
-        this->smoke_->setVisible(this->isVisible());
-        this->fire_->setVisible(this->isVisible());
-        this->backlight_->setVisible(this->isVisible());
-    }
-
-    void SpaceShip::changedActivity()
-    {
-        SUPER(SpaceShip, changedActivity);
-
-        this->tt1_->setEnabled(this->isVisible());
-        this->tt2_->setEnabled(this->isVisible());
-        this->redBillboard_.setVisible(this->isVisible());
-        this->greenBillboard_.setVisible(this->isVisible());
-        this->crosshairNear_.setVisible(this->isVisible());
-        this->crosshairFar_.setVisible(this->isVisible());
-        this->rightThrusterFlare_.setVisible(this->isVisible());
-        this->leftThrusterFlare_.setVisible(this->isVisible());
-    }
-
-    void SpaceShip::setCamera(const std::string& camera)
-    {
-      camName_=camera;
-      // change camera attributes here, if you want to ;)
-    }
-
-    void SpaceShip::getFocus(){
-      COUT(4) << "requesting focus" << std::endl;
-      //if(!network::Host::running() || network::Host::getShipID()==objectID)
-      if(myShip_)
-        CameraHandler::getInstance()->requestFocus(cam_);
-
-    }
-
-    Camera* SpaceShip::getCamera(){
-        return cam_;
-    }
-
-    void SpaceShip::createCamera(){
-//       COUT(4) << "begin camera creation" << std::endl;
-      this->camNode_ = this->getNode()->createChildSceneNode(camName_);
-      COUT(4) << "position: (this)" << this->getNode()->getPosition() << std::endl;
-      this->camNode_->setPosition(Vector3(-25,0,5));
-//      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
-//      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,0,-1));
-//      camNode_->setOrientation(q1*q2);
-      COUT(4) << "position: (cam)" << this->camNode_->getPosition() << std::endl;
-      cam_ = new Camera(this->camNode_);
-
-      cam_->setTargetNode(this->getNode());
-//        cam->setPosition(Vector3(0,-350,0));
-//      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,0,1));
-//      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,1,0));
-      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
-      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(1,0,0));
-
-       this->camNode_->setOrientation(q2*q1);
-      if(myShip_){
-        COUT(5) << "requesting focus for camera" << std::endl;
-        //CameraHandler::getInstance()->requestFocus(cam_);
-        if(this->isExactlyA(Class(SpaceShip))){
-          getFocus();
-          COUT(4) << "getting focus for obj id: " << getObjectID() << std::endl;
-        }else
-          COUT(5) << "not getting focus (not exactly spaceship) for obj id: " << getObjectID() << std::endl;
-      }else
-        COUT(5) << "not getting focus (not my ship) for obj id: " << getObjectID() << std::endl;
-    }
-
-    void SpaceShip::setMaxSpeed(float value)
-    { this->maxSpeed_ = value; }
-    void SpaceShip::setMaxSideAndBackSpeed(float value)
-    { this->maxSideAndBackSpeed_ = value; }
-    void SpaceShip::setMaxRotation(float value)
-    { this->maxRotation_ = value; this->maxRotationRadian_ = Radian(value); }
-    void SpaceShip::setTransAcc(float value)
-    { this->translationAcceleration_ = value; }
-    void SpaceShip::setRotAcc(float value)
-    { this->rotationAcceleration_ = value; this->rotationAccelerationRadian_ = Radian(value); }
-    void SpaceShip::setTransDamp(float value)
-    { this->translationDamping_ = value; }
-    void SpaceShip::setRotDamp(float value)
-    { this->rotationDamping_ = value; this->rotationDampingRadian_ = Radian(value); }
-
-    /**
-        @brief XML loading and saving.
-        @param xmlelement The XML-element
-        @param loading Loading (true) or saving (false)
-        @return The XML-element
-    */
-    void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(SpaceShip, XMLPort, xmlelement, mode);
-
-        XMLPortParam(SpaceShip, "camera", setCamera, getCamera, xmlelement, mode);
-        XMLPortParam(SpaceShip, "maxSpeed", setMaxSpeed, getMaxSpeed, xmlelement, mode);
-        XMLPortParam(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, getMaxSideAndBackSpeed, xmlelement, mode);
-        XMLPortParam(SpaceShip, "maxRotation", setMaxRotation, getMaxRotation, xmlelement, mode);
-        XMLPortParam(SpaceShip, "transAcc", setTransAcc, getTransAcc, xmlelement, mode);
-        XMLPortParam(SpaceShip, "rotAcc", setRotAcc, getRotAcc, xmlelement, mode);
-        XMLPortParam(SpaceShip, "transDamp", setTransDamp, getTransDamp, xmlelement, mode);
-        XMLPortParam(SpaceShip, "rotDamp", setRotDamp, getRotDamp, xmlelement, mode);
-
-        myShip_=true; //TODO: this is a hack
-        SpaceShip::create();
-        /*if (this->isExactlyA(Class(SpaceShip)))
-            getFocus();*/
-    }
-
-    std::string SpaceShip::whereAmI() {
-        return getConvertedValue<float, std::string>(SpaceShip::getLocalShip()->getPosition().x)
-        + "  " + getConvertedValue<float, std::string>(SpaceShip::getLocalShip()->getPosition().y)
-        + "  " + getConvertedValue<float, std::string>(SpaceShip::getLocalShip()->getPosition().z);
-    }
-
-    void SpaceShip::tick(float dt)
-    {
-        if (!this->isActive())
-            return;
-
-        currentDir_ = getOrientation()*initialDir_;
-        currentOrth_ = getOrientation()*initialOrth_;
-
-        if (this->cam_)
-            this->cam_->tick(dt);
-
-        if (Settings::showsGraphics())
-        {
-            if (this->smoke_)
-                this->smoke_->setVisible(this->isVisible() && this->health_ < 40);
-            if (this->fire_)
-                this->fire_->setVisible(this->isVisible() && this->health_ < 20);
-
-            if (this->backlight_)
-            {   // (there's already fire ||                 we're to slow                 ||                  we're moving backwards                  )
-                if (this->health_ < 20   || this->getVelocity().squaredLength() < 150*150 || this->getVelocity().dotProduct(this->getInitialDir()) < 0)
-                    this->backlight_->setActive(false);
-                else
-                    this->backlight_->setActive(true);
-            }
-
-            if (this->redNode_ && this->greenNode_)
-            {
-                this->blinkTime_ += dt;
-                float redScale = 0.15 + 0.15 * sin(this->blinkTime_ * 10.0);
-                float greenScale = 0.15 - 0.15 * sin(this->blinkTime_ * 10.0);
-                this->redNode_->setScale(redScale, redScale, redScale);
-                this->greenNode_->setScale(greenScale, greenScale, greenScale);
-            }
-        }
-
-        if (this->timeToReload_ > 0)
-            this->timeToReload_ -= dt;
-        else
-            this->timeToReload_ = 0;
-
-        if (this->bLMousePressed_ && this->timeToReload_ <= 0)
-        {
-
-            BillboardProjectile* projectile = new ParticleProjectile(this);
-            projectile->setColour(this->getProjectileColour());
-            projectile->create();
-            if (projectile->getClassID() == 0)
-            {
-              COUT(3) << "generated projectile with classid 0" <<  std::endl; // TODO: remove this output
-            }
-
-            projectile->setObjectMode(0x3);
-            this->timeToReload_ = this->reloadTime_;
-        }
-
-
-        // #####################################
-        // ############# STEERING ##############
-        // #####################################
-
-        if (this->velocity_.x > this->maxSpeed_)
-            this->velocity_.x = this->maxSpeed_;
-        if (this->velocity_.x < -this->maxSideAndBackSpeed_)
-            this->velocity_.x = -this->maxSideAndBackSpeed_;
-        if (this->velocity_.y > this->maxSideAndBackSpeed_)
-            this->velocity_.y = this->maxSideAndBackSpeed_;
-        if (this->velocity_.y < -this->maxSideAndBackSpeed_)
-            this->velocity_.y = -this->maxSideAndBackSpeed_;
-        if (this->rotationRate_ > this->maxRotationRadian_)
-            this->rotationRate_ = this->maxRotationRadian_;
-        if (this->rotationRate_ < -this->maxRotationRadian_)
-            this->rotationRate_ = -this->maxRotationRadian_;
-
-        if (this->acceleration_.x == 0)
-        {
-            if (this->velocity_.x > 0)
-            {
-                this->velocity_.x -= (this->translationDamping_ * dt);
-                if (this->velocity_.x < 0)
-                    this->velocity_.x = 0;
-            }
-            else if (this->velocity_.x < 0)
-            {
-                this->velocity_.x += (this->translationDamping_ * dt);
-                if (this->velocity_.x > 0)
-                    this->velocity_.x = 0;
-            }
-        }
-
-        if (this->acceleration_.y == 0)
-        {
-            if (this->velocity_.y > 0)
-            {
-                this->velocity_.y -= (this->translationDamping_ * dt);
-                if (this->velocity_.y < 0)
-                    this->velocity_.y = 0;
-            }
-            else if (this->velocity_.y < 0)
-            {
-                this->velocity_.y += (this->translationDamping_ * dt);
-                if (this->velocity_.y > 0)
-                    this->velocity_.y = 0;
-            }
-        }
-
-        if (this->momentum_ == this->zeroRadian_)
-        {
-            if (this->rotationRate_ > this->zeroRadian_)
-            {
-                this->rotationRate_ -= (this->rotationDampingRadian_ * dt);
-                if (this->rotationRate_ < this->zeroRadian_)
-                    this->rotationRate_ = 0;
-            }
-            else if (this->rotationRate_ < this->zeroRadian_)
-            {
-                this->rotationRate_ += (this->rotationDampingRadian_ * dt);
-                if (this->rotationRate_ > this->zeroRadian_)
-                    this->rotationRate_ = 0;
-            }
-        }
-
-
-        SUPER(SpaceShip, tick, dt);
-
-        this->roll(this->mouseXRotation_ * dt);
-        if (this->bInvertYAxis_)
-            this->yaw(Radian(-this->mouseYRotation_ * dt));
-        else
-            this->yaw(Radian(this->mouseYRotation_ * dt));
-
-        if (this->acceleration_.x > 0)
-        {
-            this->tt1_->setEnabled(true);
-            this->tt2_->setEnabled(true);
-        }
-        else
-        {
-            this->tt1_->setEnabled(false);
-            this->tt2_->setEnabled(false);
-        }
-
-        COUT(5) << "steering our ship: " << getObjectID() << std::endl;
-        this->acceleration_.x = 0;
-        this->acceleration_.y = 0;
-        this->momentum_ = 0;
-        this->mouseXRotation_ = Radian(0);
-        this->mouseYRotation_ = Radian(0);
-        this->bLMousePressed_ = false;
-    }
-
-    void SpaceShip::movePitch(float val)
-    {   getLocalShip()->setMovePitch(val);   }
-    void SpaceShip::moveYaw(float val)
-    {   getLocalShip()->setMoveYaw(val);   }
-    void SpaceShip::moveRoll(float val)
-    {   getLocalShip()->setMoveRoll(val);   }
-    void SpaceShip::moveLongitudinal(float val)
-    {   getLocalShip()->setMoveLongitudinal(val);   }
-    void SpaceShip::moveLateral(float val)
-    {   getLocalShip()->setMoveLateral(val);   }
-    void SpaceShip::fire()
-    {   getLocalShip()->doFire();   }
-
-    void SpaceShip::setMovePitch(float val)
-    {
-        val = -val * val * sgn(val) * this->rotationAcceleration_;
-        if (val > this->maxRotation_)
-            val = this->maxRotation_;
-        if (val < -this->maxRotation_)
-            val = -this->maxRotation_;
-        this->mouseYRotation_ = Radian(val);
-    }
-
-    void SpaceShip::setMoveYaw(float val)
-    {
-        val = -val * val * sgn(val) * this->rotationAcceleration_;
-        if (val > this->maxRotation_)
-            val = this->maxRotation_;
-        if (val < -this->maxRotation_)
-            val = -this->maxRotation_;
-        this->mouseXRotation_ = Radian(val);
-    }
-
-    void SpaceShip::setMoveRoll(float val)
-    {
-        this->momentum_ = Radian(-this->rotationAccelerationRadian_ * val);
-        //COUT(3) << "rotating val: " << val << " acceleration: " << this->rotationAccelerationRadian_.valueDegrees() << std::endl;
-    }
-
-    void SpaceShip::setMoveLongitudinal(float val)
-    {
-        this->acceleration_.x = this->translationAcceleration_ * val;
-    }
-
-    void SpaceShip::setMoveLateral(float val)
-    {
-        this->acceleration_.y = -this->translationAcceleration_ * val;
-    }
-
-    void SpaceShip::doFire()
-    {
-        this->bLMousePressed_ = true;
-    }
-}
Index: code/trunk/src/orxonox/objects/SpaceShip.h
===================================================================
--- code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1937)
+++ 	(revision )
@@ -1,193 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      Benjamin Knecht
- *
- */
-
-#ifndef _SpaceShip_H__
-#define _SpaceShip_H__
-#include <string>
-#include "OrxonoxPrereqs.h"
-#include <OgrePrerequisites.h>
-
-#include "util/Math.h"
-#include "Camera.h"
-#include "Model.h"
-#include "RadarViewable.h"
-#include "tools/BillboardSet.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport SpaceShip : public Model, public RadarViewable
-    {
-        public:
-            static SpaceShip *getLocalShip();
-
-            SpaceShip();
-            ~SpaceShip();
-            virtual bool create();
-            void registerAllVariables();
-            void init();
-            void setConfigValues();
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void tick(float dt);
-            virtual void changedVisibility();
-            virtual void changedActivity();
-
-            void setCamera(const std::string& camera = "");
-            void setMaxSpeed(float value);
-            void setMaxSideAndBackSpeed(float value);
-            void setMaxRotation(float value);
-            void setTransAcc(float value);
-            void setRotAcc(float value);
-            void setTransDamp(float value);
-            void setRotDamp(float value);
-            void getFocus();
-
-            inline float getMaxSpeed() const
-                { return this->maxSpeed_; }
-            inline float getMaxSideAndBackSpeed() const
-                { return this->maxSideAndBackSpeed_; }
-            inline float getMaxRotation() const
-                { return this->maxRotation_; }
-            inline float getTransAcc() const
-                { return this->translationAcceleration_; }
-            inline float getRotAcc() const
-                { return this->rotationAcceleration_; }
-            inline float getTransDamp() const
-                { return this->translationDamping_; }
-            inline float getRotDamp() const
-                { return this->rotationDamping_; }
-
-            static std::string whereAmI();
-            static void setMaxSpeedTest(float value)
-                { SpaceShip::instance_s->setMaxSpeed(value); }
-
-            static void movePitch(float value);
-            static void moveYaw(float value);
-            static void moveRoll(float value);
-            static void moveLongitudinal(float value);
-            static void moveLateral(float value);
-            static void fire();
-            void setMovePitch(float value);
-            void setMoveYaw(float value);
-            void setMoveRoll(float value);
-            void setMoveLongitudinal(float value);
-            void setMoveLateral(float value);
-            void doFire();
-
-            inline const Vector3& getDir() const
-                { return this->currentDir_; }
-            inline const Vector3& getInitialDir() const
-                { return this->initialDir_; }
-            inline const Vector3& getOrth() const
-                { return this->currentOrth_; }
-            inline const Vector3& getInitialOrth() const
-                { return this->initialOrth_; }
-
-            Camera* getCamera();
-
-            int getTeamNr() const
-                { return this->teamNr_; }
-            float getHealth() const
-                { return this->health_; }
-
-            bool getMyShip(){return myShip_;}
-
-        protected:
-            void setTeamNr(int teamNr)
-                { this->teamNr_ = teamNr; }
-
-        private:
-            void createCamera();
-            virtual ColourValue getProjectileColour() const
-                { return ColourValue(1.0, 1.0, 0.5); }
-
-            Vector3 testvector_;
-            Vector3 initialDir_;
-            Vector3 currentDir_;
-            Vector3 initialOrth_;
-            Vector3 currentOrth_;
-            bool bInvertYAxis_;
-            bool bLMousePressed_;
-            bool bRMousePressed_;
-
-            Ogre::SceneNode* camNode_;
-            Camera* cam_;
-            std::string camName_;
-
-            ParticleInterface* tt1_;
-            ParticleInterface* tt2_;
-            BillboardSet leftThrusterFlare_;
-            BillboardSet rightThrusterFlare_;
-
-            Backlight* backlight_;
-
-            BillboardSet redBillboard_;
-            BillboardSet greenBillboard_;
-            Ogre::SceneNode* redNode_;
-            Ogre::SceneNode* greenNode_;
-            float blinkTime_;
-
-            ParticleSpawner* smoke_;
-            ParticleSpawner* fire_;
-
-            BillboardSet crosshairNear_;
-            BillboardSet crosshairFar_;
-            Ogre::SceneNode* chNearNode_;
-            Ogre::SceneNode* chFarNode_;
-
-            float timeToReload_;
-            float reloadTime_;
-
-            float maxSideAndBackSpeed_;
-            float maxSpeed_;
-            float maxRotation_;
-            float translationAcceleration_;
-            float rotationAcceleration_;
-            float translationDamping_;
-            float rotationDamping_;
-
-            Radian maxRotationRadian_;
-            Radian rotationAccelerationRadian_;
-            Radian rotationDampingRadian_;
-            Radian zeroRadian_;
-            Radian mouseXRotation_;
-            Radian mouseYRotation_;
-
-            float mouseX_;
-            float mouseY_;
-
-        protected:
-            bool myShip_;
-
-            int teamNr_;
-            float health_;
-
-            static SpaceShip* instance_s;
-    };
-}
-
-#endif /* _SpaceShip_H__ */
Index: code/trunk/src/orxonox/objects/SpaceShipAI.cc
===================================================================
--- code/trunk/src/orxonox/objects/SpaceShipAI.cc	(revision 1937)
+++ 	(revision )
@@ -1,324 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "SpaceShipAI.h"
-
-#include <OgreMath.h>
-#include "Projectile.h"
-#include "ParticleSpawner.h"
-#include "core/CoreIncludes.h"
-#include "core/Iterator.h"
-#include "core/Executor.h"
-#include "core/ConsoleCommand.h"
-#include "core/XMLPort.h"
-#include "tools/ParticleInterface.h"
-#include "Settings.h"
-
-
-namespace orxonox
-{
-    const float ACTION_INTERVAL = 1.0f;
-
-    SetConsoleCommand(SpaceShipAI, createEnemy, true).defaultValue(0, 1);
-    SetConsoleCommand(SpaceShipAI, killEnemies, true).defaultValue(0, 0);
-
-    CreateFactory(SpaceShipAI);
-
-    SpaceShipAI::SpaceShipAI()
-    {
-        RegisterObject(SpaceShipAI);
-
-        this->target_ = 0;
-        this->bShooting_ = 0;
-        this->bHasTargetPosition_ = false;
-
-        this->setTeamNr((int)rnd(NUM_AI_TEAMS) % NUM_AI_TEAMS + 1);
-
-        if (NUM_AI_TEAMS > 0)
-            this->teamColours_[1] = ColourValue(1, 0, 0, 1);
-        if (NUM_AI_TEAMS > 1)
-            this->teamColours_[2] = ColourValue(0, 1, 0, 1);
-        if (NUM_AI_TEAMS > 2)
-            this->teamColours_[3] = ColourValue(0, 0, 1, 1);
-
-        for (int i = 4; i <= NUM_AI_TEAMS; ++i)
-            this->teamColours_[i] = ColourValue(rnd(), rnd(), rnd(), 1);
-    }
-
-    SpaceShipAI::~SpaceShipAI()
-    {
-    }
-
-    void SpaceShipAI::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(SpaceShipAI, XMLPort, xmlelement, mode);
-
-        this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&SpaceShipAI::action)));
-    }
-
-    void SpaceShipAI::createEnemy(int num)
-    {
-        for (int i = 0; i < num; ++i)
-        {
-            SpaceShipAI* newenemy = new SpaceShipAI();
-            newenemy->setMesh("assff.mesh");
-//            newenemy->setPosition(0, 0, 0);
-            newenemy->setPosition(Vector3(rnd(-3000, 3000), rnd(-3000, 3000), rnd(-3000, 3000)));
-            newenemy->setScale(10);
-            newenemy->setMaxSpeed(500);
-            newenemy->setMaxSideAndBackSpeed(50);
-            newenemy->setMaxRotation(1.0);
-            newenemy->setTransAcc(200);
-            newenemy->setRotAcc(3.0);
-            newenemy->setTransDamp(75);
-            newenemy->setRotDamp(1.0);
-            Element xmlelement;
-            newenemy->XMLPort(xmlelement, XMLPort::LoadObject);
-
-            if (Settings::showsGraphics())
-            {
-                ParticleSpawner* spawneffect = new ParticleSpawner("Orxonox/fairytwirl", LODParticle::normal, 2.0, 0, 0, newenemy->getOrth());
-                spawneffect->setPosition(newenemy->getPosition() - newenemy->getOrth() * 50);
-                spawneffect->create();
-            }
-        }
-    }
-
-    void SpaceShipAI::killEnemies(int num)
-    {
-        int i = 0;
-        for (ObjectList<SpaceShipAI>::iterator it = ObjectList<SpaceShipAI>::begin(); it; )
-        {
-            (it++)->kill();
-            if (num && i >= num)
-                break;
-        }
-    }
-
-    ColourValue SpaceShipAI::getProjectileColour() const
-    {
-        return this->teamColours_[this->getTeamNr()];
-    }
-
-    void SpaceShipAI::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->searchNewTargetPosition();
-
-        // 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->searchNewTargetPosition();
-
-        // 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 SpaceShipAI::damage(float damage)
-    {
-        this->health_ -= damage;
-        if (this->health_ <= 0)
-        {
-            this->kill();
-            SpaceShipAI::createEnemy(1);
-        }
-    }
-
-    void SpaceShipAI::kill()
-    {
-        if (Settings::showsGraphics())
-        {
-            ParticleSpawner* explosion = new ParticleSpawner("Orxonox/BigExplosion1part1", LODParticle::low, 3.0);
-            explosion->setPosition(this->getPosition());
-            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
-            explosion->setScale(4);
-            explosion->create();
-
-            explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::normal, 3.0);
-            explosion->setPosition(this->getPosition());
-            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
-            explosion->setScale(4);
-            explosion->create();
-            explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::high, 3.0);
-            explosion->setPosition(this->getPosition());
-            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
-            explosion->setScale(4);
-            explosion->create();
-
-            Vector3 ringdirection = Vector3(rnd(), rnd(), rnd());
-            ringdirection.normalise();
-            explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::normal, 3.0, 0.5, 0, ringdirection);
-            explosion->setPosition(this->getPosition());
-            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
-            explosion->setScale(4);
-            explosion->create();
-            explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::high, 3.0, 0.5, 0, ringdirection);
-            explosion->setPosition(this->getPosition());
-            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
-            explosion->setScale(4);
-            explosion->create();
-        }
-
-        delete this;
-    }
-
-    void SpaceShipAI::tick(float dt)
-    {
-        if (!this->isActive())
-            return;
-
-        if (this->target_)
-            this->aimAtTarget();
-
-        if (this->bHasTargetPosition_)
-            this->moveToTargetPosition(dt);
-
-        if (this->bShooting_ && this->isCloseAtTarget(2500) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
-            this->doFire();
-
-        SUPER(SpaceShipAI, tick, dt);
-    }
-
-    void SpaceShipAI::moveToTargetPosition(float dt)
-    {
-        Vector2 coord = get2DViewdirection(this->getPosition(), this->getDir(), this->getOrth(), this->targetPosition_);
-
-        float distance = (this->targetPosition_ - this->getPosition()).length();
-        if (this->target_ || distance > 50)
-        {
-            // Multiply with 0.8 to make them a bit slower
-            this->setMoveYaw(0.8 * sgn(coord.x) * coord.x*coord.x);
-            this->setMovePitch(0.8 * sgn(coord.y) * coord.y*coord.y);
-        }
-
-        if (this->target_ && distance < 1000 && this->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
-            this->setMoveLongitudinal(-0.5); // They don't brake with full power to give the player a chance
-        else if (!this->target_ && distance <= this->getVelocity().length() / (2 * this->getTransAcc()))
-            this->setMoveLongitudinal(-1.0);
-        else
-            this->setMoveLongitudinal(0.8);
-    }
-
-    void SpaceShipAI::searchNewTargetPosition()
-    {
-        this->targetPosition_ = Vector3(rnd(-5000,5000), rnd(-5000,5000), rnd(-5000,5000));
-        this->bHasTargetPosition_ = true;
-    }
-
-    void SpaceShipAI::searchNewTarget()
-    {
-        this->targetPosition_ = this->getPosition();
-        this->forgetTarget();
-
-        for (ObjectList<SpaceShip>::iterator it = ObjectList<SpaceShip>::begin(); it; ++it)
-        {
-            if (it->getTeamNr() != this->getTeamNr())
-            {
-                float speed = this->getVelocity().length();
-                Vector3 distanceCurrent = this->targetPosition_ - this->getPosition();
-                Vector3 distanceNew = it->getPosition() - this->getPosition();
-                if (!this->target_ || it->getPosition().squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceNew) / speed / distanceNew.length()) / (2 * Ogre::Math::PI))
-                        < this->targetPosition_.squaredDistance(this->getPosition()) * (1.5f + acos((this->getOrientation() * Ogre::Vector3::UNIT_X).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / (2 * Ogre::Math::PI)) + rnd(-250, 250))
-                {
-                    this->target_ = (*it);
-                    this->targetPosition_ = it->getPosition();
-                }
-            }
-        }
-    }
-
-    void SpaceShipAI::forgetTarget()
-    {
-        this->target_ = 0;
-        this->bShooting_ = false;
-    }
-
-    void SpaceShipAI::aimAtTarget()
-    {
-        if (!this->target_)
-            return;
-
-        this->targetPosition_ = getPredictedPosition(this->getPosition(), Projectile::getSpeed(), this->target_->getPosition(), this->target_->getOrientation() * this->target_->getVelocity());
-        this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO);
-    }
-
-    bool SpaceShipAI::isCloseAtTarget(float distance)
-    {
-        if (!this->target_)
-            return (this->getPosition().squaredDistance(this->targetPosition_) < distance*distance);
-        else
-            return (this->getPosition().squaredDistance(this->target_->getPosition()) < distance*distance);
-    }
-
-    bool SpaceShipAI::isLookingAtTarget(float angle)
-    {
-        return (getAngle(this->getPosition(), this->getDir(), this->targetPosition_) < angle);
-    }
-
-    void SpaceShipAI::shipDied(SpaceShip* ship)
-    {
-        if (ship == this->target_)
-        {
-            this->forgetTarget();
-            this->searchNewTargetPosition();
-        }
-    }
-}
Index: code/trunk/src/orxonox/objects/SpaceShipAI.h
===================================================================
--- code/trunk/src/orxonox/objects/SpaceShipAI.h	(revision 1937)
+++ 	(revision )
@@ -1,81 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _SpaceShipAI_H__
-#define _SpaceShipAI_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "SpaceShip.h"
-#include "tools/Timer.h"
-#include "util/Math.h"
-
-
-namespace orxonox
-{
-    const int NUM_AI_TEAMS = 3;
-
-    class SpaceShipAI : public SpaceShip
-    {
-        public:
-            SpaceShipAI();
-            virtual ~SpaceShipAI();
-
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void tick(float dt);
-            static void createEnemy(int num);
-            static void killEnemies(int num);
-            void shipDied(SpaceShip* ship);
-            void damage(float damage);
-            void kill();
-
-        private:
-            virtual ColourValue getProjectileColour() const;
-
-            void action();
-
-            void moveToTargetPosition(float dt);
-            void searchNewTargetPosition();
-            void forgetTarget();
-            void searchNewTarget();
-            void aimAtTarget();
-            bool isCloseAtTarget(float distance);
-            bool isLookingAtTarget(float angle);
-
-            Timer<SpaceShipAI> actionTimer_;
-
-            bool bHasTargetPosition_;
-            Vector3 targetPosition_;
-            SpaceShip* target_;
-            bool bShooting_;
-
-            ColourValue teamColours_[NUM_AI_TEAMS + 1];
-    };
-}
-
-#endif /* _SpaceShipAI_H__ */
Index: code/trunk/src/orxonox/objects/Test.cc
===================================================================
--- code/trunk/src/orxonox/objects/Test.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/Test.cc	(revision 2087)
@@ -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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "Test.h"
+
+namespace orxonox
+{
+	CreateFactory ( Test );
+
+	Test::Test(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
+	{
+		RegisterObject ( Test );
+                setConfigValues();
+                registerVariables();
+		setObjectMode(0x3);
+	}
+
+	Test::~Test()
+	{
+
+	}
+
+	void Test::setConfigValues()
+	{
+		SetConfigValue ( v1, 1 ).callback ( this, &Test::checkV1 );
+                SetConfigValue ( v2, 2 ).callback ( this, &Test::checkV2 );
+                SetConfigValue ( v3, 3 ).callback ( this, &Test::checkV3 );
+	}
+
+
+	void Test::registerVariables()
+	{
+		REGISTERDATA ( v1,network::direction::toclient, new network::NetworkCallback<Test> ( this, &Test::checkV1 ) );
+                REGISTERDATA ( v2,network::direction::toserver, new network::NetworkCallback<Test> ( this, &Test::checkV2 ) );
+		REGISTERDATA ( v3,network::direction::bidirectional, new network::NetworkCallback<Test> ( this, &Test::checkV3 ) );
+	}
+
+        void Test::checkV1(){
+                COUT(1) << "V1 changed: " << v1 << std::endl;
+        }
+
+        void Test::checkV2(){
+                COUT(1) << "V2 changed: " << v2 << std::endl;
+        }
+
+        void Test::checkV3(){
+                COUT(1) << "V3 changed: " << v3 << std::endl;
+        }
+
+
+}
Index: code/trunk/src/orxonox/objects/Test.h
===================================================================
--- code/trunk/src/orxonox/objects/Test.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/Test.h	(revision 2087)
@@ -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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Test_H__
+#define _Test_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/BaseObject.h"
+#include "network/Synchronisable.h"
+
+namespace orxonox
+{
+  class _OrxonoxExport Test: public BaseObject, public network::Synchronisable
+  {
+    public:
+      Test(BaseObject* creator);
+      virtual ~Test();
+
+      void setConfigValues();
+      void registerVariables();
+
+      void setV1(unsigned int value){ v1 = value; }
+      void setV2(unsigned int value){ v2 = value; }
+      void setV3(unsigned int value){ v3 = value; }
+
+      void checkV1();
+      void checkV2();
+      void checkV3();
+
+    private:
+      unsigned int v1;
+      unsigned int v2;
+      unsigned int v3;
+  };
+}
+
+#endif /* _Test_H__ */
Index: code/trunk/src/orxonox/objects/WorldEntity.cc
===================================================================
--- code/trunk/src/orxonox/objects/WorldEntity.cc	(revision 1937)
+++ 	(revision )
@@ -1,189 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "WorldEntity.h"
-
-#include <string>
-#include <sstream>
-#include <OgreSceneManager.h>
-
-#include "tinyxml/tinyxml.h"
-#include "util/SubString.h"
-#include "core/CoreIncludes.h"
-#include "GraphicsEngine.h"
-#include "core/XMLPort.h"
-
-namespace orxonox
-{
-    CreateFactory(WorldEntity);
-
-    unsigned int WorldEntity::worldEntityCounter_s = 0;
-
-    WorldEntity::WorldEntity()
-    {
-        RegisterObject(WorldEntity);
-
-        if (GraphicsEngine::getInstance().getLevelSceneManager())
-        {
-            std::ostringstream name;
-            name << (WorldEntity::worldEntityCounter_s++);
-            this->setName("WorldEntity" + name.str());
-            this->node_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());
-
-            registerAllVariables();
-        }
-        else
-        {
-            this->node_ = 0;
-        }
-
-        this->bStatic_ = true;
-        this->velocity_ = Vector3(0, 0, 0);
-        this->acceleration_ = Vector3(0, 0, 0);
-        this->rotationAxis_ = Vector3(0, 1, 0);
-        this->rotationRate_ = 0;
-        this->momentum_ = 0;
-    }
-
-
-    WorldEntity::~WorldEntity()
-    {
-        if (this->isInitialized())
-        {
-            this->getNode()->removeAndDestroyAllChildren();
-            GraphicsEngine::getInstance().getLevelSceneManager()->destroySceneNode(this->getName());
-        }
-    }
-
-    void WorldEntity::tick(float dt)
-    {
-        if (!this->bStatic_ && this->isActive())
-        {
-//             COUT(4) << "acceleration: " << this->acceleration_ << " velocity: " << this->velocity_ << std::endl;
-            this->velocity_ += (dt * this->acceleration_);
-            this->translate(dt * this->velocity_, Ogre::Node::TS_LOCAL);
-
-            this->rotationRate_ += (dt * this->momentum_);
-            this->rotate(this->rotationAxis_, dt * this->rotationRate_);
-            //COUT(3) << "rotationrate: " << this->rotationRate_.valueDegrees() << " momentum: " << this->momentum_.valueDegrees() << std::endl;
-        }
-    }
-
-    void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
-    {
-        this->yaw(yaw);
-        this->pitch(pitch);
-        this->roll(roll);
-    }
-
-    /**
-        @brief XML loading and saving.
-        @param xmlelement The XML-element
-        @param loading Loading (true) or saving (false)
-        @return The XML-element
-    */
-    void WorldEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(WorldEntity, XMLPort, xmlelement, mode);
-
-        XMLPortParamExternTemplate(WorldEntity, Ogre::Node, this->node_, "position", setPosition, getPosition, xmlelement, mode, const Vector3&);
-        XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionSimple, xmlelement, mode);
-        XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, mode);
-        XMLPortParam(WorldEntity, "scale", setScale, getScale, xmlelement, mode);
-        XMLPortParamTemplate(WorldEntity, "rotationAxis", setRotationAxis, getRotationAxis, xmlelement, mode, const Vector3&);
-        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, mode);
-
-        XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, mode);
-
-        WorldEntity::create();
-    }
-
-
-    void WorldEntity::registerAllVariables()
-    {
-      // register inheritec variables from BaseObject
-      registerVar( (void*) &(this->bActive_), sizeof(this->bActive_), network::DATA, 0x3);
-      registerVar( (void*) &(this->bVisible_), sizeof(this->bVisible_), network::DATA, 0x3);
-      // register coordinates
-      registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA, 0x3);
-      registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA, 0x3);
-      registerVar( (void*) &(this->getPosition().z), sizeof(this->getPosition().z), network::DATA, 0x3);
-      // register orientation
-      registerVar( (void*) &(this->getOrientation().w), sizeof(this->getOrientation().w), network::DATA, 0x3);
-      registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA, 0x3);
-      registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA, 0x3);
-      registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA, 0x3);
-      // register velocity_
-      registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA, 0x3);
-      registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA, 0x3);
-      registerVar( (void*) &(this->getVelocity().z), sizeof(this->getVelocity().z), network::DATA, 0x3);
-      // register rotationAxis/rate
-      registerVar( (void*) &(this->getRotationRate()), sizeof(this->getRotationRate()), network::DATA, 0x3);
-      registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA, 0x3);
-      registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA, 0x3);
-      registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA, 0x3);
-      // register scale of node
-      registerVar( (void*) &(this->getScale3D().x), sizeof(this->getScale3D().x), network::DATA, 0x3);
-      registerVar( (void*) &(this->getScale3D().y), sizeof(this->getScale3D().y), network::DATA, 0x3);
-      registerVar( (void*) &(this->getScale3D().z), sizeof(this->getScale3D().z), network::DATA, 0x3);
-      //register staticity
-      registerVar( (void*) &(this->bStatic_), sizeof(this->bStatic_), network::DATA, 0x3);
-      //register acceleration & momentum
-//       registerVar( (void*) &(this->getAcceleration().x), sizeof(this->getAcceleration().x), network::DATA, 0x2);
-//       registerVar( (void*) &(this->getAcceleration().y), sizeof(this->getAcceleration().y), network::DATA, 0x2);
-//       registerVar( (void*) &(this->getAcceleration().z), sizeof(this->getAcceleration().z), network::DATA, 0x2);
-//       registerVar( (void*) &(this->getMomentum()), sizeof(this->getMomentum()), network::DATA, 0x2); // only backsync
-    }
-
-    void WorldEntity::attachWorldEntity(WorldEntity* entity)
-    {
-        this->attachedWorldEntities_.push_back(entity);
-        this->attachObject(entity);
-    }
-
-    const WorldEntity* WorldEntity::getAttachedWorldEntity(unsigned int index) const
-    {
-        if (index < this->attachedWorldEntities_.size())
-            return this->attachedWorldEntities_[index];
-        else
-            return 0;
-    }
-
-    void WorldEntity::attachObject(const WorldEntity& obj) const
-    {
-        GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->removeChild(obj.getNode());
-        this->getNode()->addChild(obj.getNode());
-    }
-
-    void WorldEntity::attachObject(WorldEntity* obj) const
-    {
-        GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->removeChild(obj->getNode());
-        this->getNode()->addChild(obj->getNode());
-    }
-}
Index: code/trunk/src/orxonox/objects/WorldEntity.h
===================================================================
--- code/trunk/src/orxonox/objects/WorldEntity.h	(revision 1937)
+++ 	(revision )
@@ -1,199 +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:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _WorldEntity_H__
-#define _WorldEntity_H__
-
-#include "OrxonoxPrereqs.h"
-#include <OgrePrerequisites.h>
-
-#include <OgreSceneNode.h>
-#include "util/Math.h"
-#include "network/Synchronisable.h"
-#include "core/XMLIncludes.h"
-#include "core/BaseObject.h"
-#include "Tickable.h"
-#include "tools/Mesh.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport WorldEntity : public BaseObject, public Tickable, public network::Synchronisable
-    {
-        public:
-            WorldEntity();
-            virtual ~WorldEntity();
-
-            virtual void tick(float dt);
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual inline bool create(){ return Synchronisable::create(); }
-
-            void attachWorldEntity(WorldEntity* entity);
-            const WorldEntity* getAttachedWorldEntity(unsigned int index) const;
-
-            inline Ogre::SceneNode* getNode() const
-                { return this->node_; }
-
-            inline void setNode(Ogre::SceneNode* node)
-                { this->node_ = node; }
-
-            inline void setPosition(const Vector3& pos)
-                { this->node_->setPosition(pos); }
-            inline void setPosition(Real x, Real y, Real z)
-                { this->node_->setPosition(x, y, z); }
-            inline const Vector3& getPosition() const
-                { return this->node_->getPosition(); }
-            inline const Vector3& getWorldPosition() const
-                { return this->node_->getWorldPosition(); }
-
-            inline void translate(const Vector3& d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
-                { this->node_->translate(d, relativeTo); }
-            inline void translate(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
-                { this->node_->translate(x, y, z, relativeTo); }
-            inline void translate(const Matrix3& axes, const Vector3& move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
-                { this->node_->translate(axes, move, relativeTo); }
-            inline void translate(const Matrix3& axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
-                { this->node_->translate(axes, x, y, z, relativeTo); }
-
-            inline void yaw(const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
-                { this->node_->yaw(angle, relativeTo); }
-            inline void pitch(const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
-                { this->node_->pitch(angle, relativeTo); }
-            inline void roll(const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
-                { this->node_->roll(angle, relativeTo); }
-            void setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll);
-
-            inline void setYaw(const Degree& angle)
-                { this->node_->yaw(angle, Ogre::Node::TS_LOCAL); }
-            inline void setPitch(const Degree& angle)
-                { this->node_->pitch(angle, Ogre::Node::TS_LOCAL); }
-            inline void setRoll(const Degree& angle)
-                { this->node_->roll(angle, Ogre::Node::TS_LOCAL); }
-
-            inline const Ogre::Quaternion& getOrientation()
-              { return this->node_->getOrientation(); }
-            inline const Ogre::Quaternion& getWorldOrientation()
-              { return this->node_->getWorldOrientation(); }
-            inline void setOrientation(const Ogre::Quaternion& quat)
-              { this->node_->setOrientation(quat); }
-            inline void rotate(const Vector3& axis, const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
-              { this->node_->rotate(axis, angle, relativeTo); }
-            inline void setDirectionSimple(Real x, Real y, Real z)
-              { this->setDirection(x, y, z); }
-            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
-              { this->node_->setDirection(x, y, z, relativeTo, localDirectionVector); }
-            inline void setDirection(const Vector3& vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
-              { this->node_->setDirection(vec, relativeTo, localDirectionVector); }
-            inline void lookAt(const Vector3& targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
-              { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
-
-            inline void setScale3D(const Vector3 &scale)
-              { this->node_->setScale(scale); }
-            inline void setScale3D(Real x, Real y, Real z)
-              { this->node_->setScale(x, y, z); }
-            inline const Vector3& getScale3D(void) const
-              { return this->node_->getScale(); }
-            inline void setScale(float scale)
-              { this->node_->setScale(scale, scale, scale); }
-            inline float getScale() const
-              { Vector3 scale = this->getScale3D(); return (scale.x == scale.y && scale.x == scale.z) ? scale.x : 1; }
-            inline void scale3D(const Vector3 &scale)
-              { this->node_->scale(scale); }
-            inline void scale3D(Real x, Real y, Real z)
-              { this->node_->scale(x, y, z); }
-            inline void scale(Real scale)
-              { this->node_->scale(scale, scale, scale); }
-
-            void attachObject(const WorldEntity& obj) const;
-            void attachObject(WorldEntity* obj) const;
-            inline void attachObject(Ogre::MovableObject* obj) const
-              { this->node_->attachObject(obj); }
-            inline void attachObject(Mesh& mesh) const
-              { this->node_->attachObject(mesh.getEntity()); }
-            inline void detachObject(Ogre::MovableObject* obj) const
-              { this->node_->detachObject(obj); }
-            inline void detachAllObjects() const
-              { this->node_->detachAllObjects(); }
-
-            inline void setVelocity(const Vector3& velocity)
-                { this->velocity_ = velocity; }
-            inline void setVelocity(Real x, Real y, Real z)
-                { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; }
-            inline const Vector3& getVelocity() const
-                { return this->velocity_; }
-
-            inline void setAcceleration(const Vector3& acceleration)
-                { this->acceleration_ = acceleration; }
-            inline void setAcceleration(Real x, Real y, Real z)
-                { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; }
-            inline const Vector3& getAcceleration() const
-                { return this->acceleration_; }
-
-            inline void setRotationAxis(const Vector3& axis)
-                { this->rotationAxis_ = axis; this->rotationAxis_.normalise(); }
-            inline void setRotationAxis(Real x, Real y, Real z)
-                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; rotationAxis_.normalise(); }
-            inline const Vector3& getRotationAxis() const
-                { return this->rotationAxis_; }
-
-//            inline void setRotationRate(const Radian& angle)
-//                { this->rotationRate_ = angle; }
-            inline void setRotationRate(const Degree& angle)
-                { this->rotationRate_ = angle; this->setStatic(angle == Degree(0)); }
-            inline const Radian& getRotationRate() const
-                { return this->rotationRate_; }
-
-            inline void setMomentum(const Radian& angle)
-                { this->momentum_ = angle; }
-            inline void setMomentum(const Degree& angle)
-                { this->momentum_ = angle; }
-            inline const Radian& getMomentum() const
-                { return this->momentum_; }
-
-            inline void setStatic(bool bStatic)
-                { this->bStatic_ = bStatic; }
-            inline bool isStatic() const
-                { return this->bStatic_; }
-
-        protected:
-            void registerAllVariables();
-
-            Vector3 velocity_;
-            Vector3 acceleration_;
-            Vector3 rotationAxis_;
-            Radian rotationRate_;
-            Radian momentum_;
-
-        private:
-            static unsigned int worldEntityCounter_s;
-            Ogre::SceneNode* node_;
-            bool bStatic_;
-            std::vector<WorldEntity*> attachedWorldEntities_;
-    };
-}
-
-#endif /* _WorldEntity_H__ */
Index: code/trunk/src/orxonox/objects/controllers/Controller.cc
===================================================================
--- code/trunk/src/orxonox/objects/controllers/Controller.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/controllers/Controller.cc	(revision 2087)
@@ -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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#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/objects/controllers/Controller.h
===================================================================
--- code/trunk/src/orxonox/objects/controllers/Controller.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/controllers/Controller.h	(revision 2087)
@@ -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:
+ *      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_; }
+
+            virtual inline void setControllableEntity(ControllableEntity* entity)
+                { this->controllableEntity_ = entity; }
+            virtual inline ControllableEntity* getControllableEntity() const
+                { return this->controllableEntity_; }
+
+        protected:
+            PlayerInfo* player_;
+            ControllableEntity* controllableEntity_;
+    };
+}
+
+#endif /* _Controller_H__ */
Index: code/trunk/src/orxonox/objects/controllers/HumanController.cc
===================================================================
--- code/trunk/src/orxonox/objects/controllers/HumanController.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/controllers/HumanController.cc	(revision 2087)
@@ -0,0 +1,131 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "HumanController.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "objects/worldentities/ControllableEntity.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, altFire,       true).keybindMode(KeybindMode::OnHold);
+    SetConsoleCommand(HumanController, greet,         true);
+    SetConsoleCommand(HumanController, use,           true);
+    SetConsoleCommand(HumanController, switchCamera,  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)
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->rotateYaw(value);
+    }
+
+    void HumanController::rotatePitch(const Vector2& value)
+    {
+        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()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->fire();
+    }
+
+    void HumanController::altFire()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->altFire();
+    }
+
+    void HumanController::greet()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->greet();
+    }
+
+    void HumanController::use()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->use();
+    }
+
+    void HumanController::switchCamera()
+    {
+        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
+            HumanController::localController_s->controllableEntity_->switchCamera();
+    }
+}
Index: code/trunk/src/orxonox/objects/controllers/HumanController.h
===================================================================
--- code/trunk/src/orxonox/objects/controllers/HumanController.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/controllers/HumanController.h	(revision 2087)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HumanController_H__
+#define _HumanController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Math.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();
+            static void altFire();
+
+            static void greet();
+            static void use();
+            static void switchCamera();
+
+        private:
+            static HumanController* localController_s;
+    };
+}
+
+#endif /* _HumanController_H__ */
Index: code/trunk/src/orxonox/objects/gametypes/Gametype.cc
===================================================================
--- code/trunk/src/orxonox/objects/gametypes/Gametype.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/gametypes/Gametype.cc	(revision 2087)
@@ -0,0 +1,255 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "Gametype.h"
+
+#include <cstdlib>
+#include <ctime>
+
+#include "core/CoreIncludes.h"
+#include "objects/infos/PlayerInfo.h"
+#include "objects/worldentities/pawns/Spectator.h"
+#include "objects/worldentities/SpawnPoint.h"
+
+#include "network/Host.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(Gametype);
+
+    Gametype::Gametype(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(Gametype);
+
+        this->defaultControllableEntity_ = Class(Spectator);
+
+        this->bStarted_ = false;
+        this->bEnded_ = false;
+        this->bAutoStart_ = false;
+        this->bForceSpawn_ = false;
+
+        this->initialStartCountdown_ = 3;
+        this->startCountdown_ = 0;
+        this->bStartCountdownRunning_ = false;
+    }
+
+    void Gametype::tick(float dt)
+    {
+        if (this->bStartCountdownRunning_ && !this->bStarted_)
+            this->startCountdown_ -= dt;
+
+        if (!this->bStarted_)
+            this->checkStart();
+
+        this->assignDefaultPawnsIfNeeded();
+        this->spawnDeadPlayersIfRequested();
+    }
+
+    void Gametype::start()
+    {
+        COUT(0) << "game started" << std::endl;
+        this->bStarted_ = true;
+
+        this->spawnPlayersIfRequested();
+    }
+
+    void Gametype::end()
+    {
+        COUT(0) << "game ended" << std::endl;
+        this->bEnded_ = true;
+    }
+
+    void Gametype::playerEntered(PlayerInfo* player)
+    {
+        this->players_.insert(player);
+
+        std::string message = player->getName() + " entered the game";
+        COUT(0) << message << std::endl;
+        network::Host::Broadcast(message);
+    }
+
+    void Gametype::playerLeft(PlayerInfo* player)
+    {
+        std::set<PlayerInfo*>::iterator it = this->players_.find(player);
+        if (it != this->players_.end())
+        {
+            this->players_.erase(it);
+
+            std::string message = player->getName() + " left the game";
+            COUT(0) << message << std::endl;
+            network::Host::Broadcast(message);
+        }
+    }
+
+    void Gametype::playerSwitched(PlayerInfo* player, Gametype* newgametype)
+    {
+    }
+
+    void Gametype::playerSwitchedBack(PlayerInfo* player, Gametype* oldgametype)
+    {
+    }
+
+    void Gametype::playerChangedName(PlayerInfo* player)
+    {
+        if (this->players_.find(player) != this->players_.end())
+        {
+            if (player->getName() != player->getOldName())
+            {
+                std::string message = player->getOldName() + " changed name to " + player->getName();
+                COUT(0) << message << std::endl;
+                network::Host::Broadcast(message);
+            }
+        }
+    }
+
+    void Gametype::pawnPreSpawn(Pawn* pawn)
+    {
+    }
+
+    void Gametype::pawnPostSpawn(Pawn* pawn)
+    {
+    }
+
+    void Gametype::pawnKilled(Pawn* victim, Pawn* killer)
+    {
+    }
+
+    void Gametype::playerScored(PlayerInfo* player)
+    {
+    }
+
+    SpawnPoint* Gametype::getBestSpawnPoint(PlayerInfo* player) const
+    {
+        if (this->spawnpoints_.size() > 0)
+        {
+            srand(time(0));
+            rnd();
+
+            unsigned int randomspawn = (unsigned int)rnd(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() const
+    {
+        for (std::set<PlayerInfo*>::const_iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        {
+            if (!(*it)->getControllableEntity() && (!(*it)->isReadyToSpawn() || !this->bStarted_))
+            {
+                SpawnPoint* spawn = this->getBestSpawnPoint(*it);
+                if (spawn)
+                {
+                    // force spawn at spawnpoint with default pawn
+                    ControllableEntity* entity = this->defaultControllableEntity_.fabricate(spawn);
+                    spawn->spawn(entity);
+                    (*it)->startControl(entity);
+                }
+                else
+                {
+                    COUT(1) << "Error: No SpawnPoints in current Gametype" << std::endl;
+                    abort();
+                }
+            }
+        }
+    }
+
+    void Gametype::checkStart()
+    {
+        if (!this->bStarted_)
+        {
+            if (this->bStartCountdownRunning_)
+            {
+                if (this->startCountdown_ <= 0)
+                {
+                    this->bStartCountdownRunning_ = false;
+                    this->startCountdown_ = 0;
+                    this->start();
+                }
+            }
+            else if (this->players_.size() > 0)
+            {
+                if (this->bAutoStart_)
+                {
+                    this->start();
+                }
+                else
+                {
+                    bool allplayersready = true;
+                    for (std::set<PlayerInfo*>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+                    {
+                        if (!(*it)->isReadyToSpawn())
+                            allplayersready = false;
+                    }
+                    if (allplayersready)
+                    {
+                        this->startCountdown_ = this->initialStartCountdown_;
+                        this->bStartCountdownRunning_ = true;
+                    }
+                }
+            }
+        }
+    }
+
+    void Gametype::spawnPlayersIfRequested()
+    {
+        for (std::set<PlayerInfo*>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if ((*it)->isReadyToSpawn() || this->bForceSpawn_)
+                this->spawnPlayer(*it);
+    }
+
+    void Gametype::spawnDeadPlayersIfRequested()
+    {
+        for (std::set<PlayerInfo*>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+            if (!(*it)->getControllableEntity())
+                if ((*it)->isReadyToSpawn() || this->bForceSpawn_)
+                    this->spawnPlayer(*it);
+    }
+
+    void Gametype::spawnPlayer(PlayerInfo* player)
+    {
+        SpawnPoint* spawnpoint = this->getBestSpawnPoint(player);
+        if (spawnpoint)
+        {
+            player->startControl(spawnpoint->spawn());
+        }
+        else
+        {
+            COUT(1) << "Error: No SpawnPoints in current Gametype" << std::endl;
+            abort();
+        }
+    }
+}
Index: code/trunk/src/orxonox/objects/gametypes/Gametype.h
===================================================================
--- code/trunk/src/orxonox/objects/gametypes/Gametype.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/gametypes/Gametype.h	(revision 2087)
@@ -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 _Gametype_H__
+#define _Gametype_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+
+#include "core/BaseObject.h"
+#include "core/Identifier.h"
+#include "objects/worldentities/ControllableEntity.h"
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Gametype : public BaseObject, public Tickable
+    {
+        friend class PlayerInfo;
+
+        public:
+            Gametype(BaseObject* creator);
+            virtual ~Gametype() {}
+
+            virtual void tick(float dt);
+
+            inline bool hasStarted() const
+                { return this->bStarted_; }
+            inline bool hasEnded() const
+                { return this->bEnded_; }
+
+            virtual void start();
+            virtual void end();
+            virtual void playerEntered(PlayerInfo* player);
+            virtual void playerLeft(PlayerInfo* player);
+            virtual void playerSwitched(PlayerInfo* player, Gametype* newgametype);
+            virtual void playerSwitchedBack(PlayerInfo* player, Gametype* oldgametype);
+            virtual void playerChangedName(PlayerInfo* player);
+
+            virtual void playerScored(PlayerInfo* player);
+
+            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+            virtual void pawnPreSpawn(Pawn* pawn);
+            virtual void pawnPostSpawn(Pawn* pawn);
+
+            inline const std::set<PlayerInfo*>& getPlayers() const
+                { return this->players_; }
+
+            inline void registerSpawnPoint(SpawnPoint* spawnpoint)
+                { this->spawnpoints_.insert(spawnpoint); }
+
+            inline bool isStartCountdownRunning() const
+                { return this->bStartCountdownRunning_; }
+            inline float getStartCountdown() const
+                { return this->startCountdown_; }
+
+        private:
+            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
+
+            void addPlayer(PlayerInfo* player);
+            void removePlayer(PlayerInfo* player);
+
+            void assignDefaultPawnsIfNeeded() const;
+            void checkStart();
+            void spawnPlayer(PlayerInfo* player);
+            void spawnPlayersIfRequested();
+            void spawnDeadPlayersIfRequested();
+
+            bool bStarted_;
+            bool bEnded_;
+            bool bAutoStart_;
+            bool bForceSpawn_;
+
+            float initialStartCountdown_;
+            float startCountdown_;
+            bool bStartCountdownRunning_;
+
+            std::set<PlayerInfo*> players_;
+            std::set<SpawnPoint*> spawnpoints_;
+            SubclassIdentifier<ControllableEntity> defaultControllableEntity_;
+    };
+}
+
+#endif /* _Gametype_H__ */
Index: code/trunk/src/orxonox/objects/infos/HumanPlayer.cc
===================================================================
--- code/trunk/src/orxonox/objects/infos/HumanPlayer.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/infos/HumanPlayer.cc	(revision 2087)
@@ -0,0 +1,140 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "HumanPlayer.h"
+
+#include "core/Core.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "network/ClientInformation.h"
+#include "network/Host.h"
+#include "objects/controllers/HumanController.h"
+#include "objects/gametypes/Gametype.h"
+
+namespace orxonox
+{
+    CreateUnloadableFactory(HumanPlayer);
+
+    HumanPlayer::HumanPlayer(BaseObject* creator) : PlayerInfo(creator)
+    {
+        RegisterObject(HumanPlayer);
+
+        this->server_ready_ = Core::isMaster();
+        this->client_ready_ = false;
+
+        this->bHumanPlayer_ = true;
+        this->defaultController_ = Class(HumanController);
+
+        this->setConfigValues();
+        this->registerVariables();
+    }
+
+    HumanPlayer::~HumanPlayer()
+    {
+    }
+
+    void HumanPlayer::setConfigValues()
+    {
+        SetConfigValue(nick_, "Player").callback(this, &HumanPlayer::configvaluecallback_changednick);
+    }
+
+    void HumanPlayer::registerVariables()
+    {
+        REGISTERSTRING(this->synchronize_nick_, network::direction::toserver, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
+
+        REGISTERDATA(this->clientID_,     network::direction::toclient, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
+        REGISTERDATA(this->server_ready_, network::direction::toclient, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_ready));
+        REGISTERDATA(this->client_ready_, network::direction::toserver, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_ready));
+    }
+
+    void HumanPlayer::configvaluecallback_changednick()
+    {
+        if (this->isLocalPlayer())
+        {
+            this->synchronize_nick_ = this->nick_;
+
+            if (Core::isMaster())
+                this->setName(this->nick_);
+        }
+    }
+
+    void HumanPlayer::networkcallback_changednick()
+    {
+        this->setName(this->synchronize_nick_);
+    }
+
+    void HumanPlayer::networkcallback_clientIDchanged()
+    {
+        if (this->clientID_ == network::Host::getPlayerID())
+        {
+            this->bLocalPlayer_ = true;
+            this->synchronize_nick_ = this->nick_;
+            this->client_ready_ = true;
+
+            if (!Core::isMaster())
+                this->setObjectMode(network::direction::bidirectional);
+            else
+                this->setName(this->nick_);
+
+            this->createController();
+        }
+    }
+
+    void HumanPlayer::networkcallback_server_ready()
+    {
+        this->client_ready_ = true;
+    }
+
+    void HumanPlayer::networkcallback_client_ready()
+    {
+        if (this->getGametype())
+            this->getGametype()->playerEntered(this);
+    }
+
+    bool HumanPlayer::isReady() const
+    {
+        return (this->server_ready_ && this->client_ready_);
+    }
+
+    float HumanPlayer::getPing() const
+    {
+        return network::ClientInformation::findClient(this->getClientID())->getRTT();
+    }
+
+    float HumanPlayer::getPacketLossRatio() const
+    {
+        return network::ClientInformation::findClient(this->getClientID())->getPacketLoss();
+    }
+
+    void HumanPlayer::setClientID(unsigned int clientID)
+    {
+        this->clientID_ = clientID;
+        this->networkcallback_clientIDchanged();
+    }
+}
Index: code/trunk/src/orxonox/objects/infos/HumanPlayer.h
===================================================================
--- code/trunk/src/orxonox/objects/infos/HumanPlayer.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/infos/HumanPlayer.h	(revision 2087)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _HumanPlayer_H__
+#define _HumanPlayer_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "PlayerInfo.h"
+#include "core/Identifier.h"
+#include "objects/controllers/Controller.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport HumanPlayer : public PlayerInfo
+    {
+        public:
+            HumanPlayer(BaseObject* creator);
+            virtual ~HumanPlayer();
+
+            void registerVariables();
+            void setConfigValues();
+
+            bool isReady() const;
+            float getPing() const;
+            float getPacketLossRatio() const;
+
+            void setClientID(unsigned int clientID);
+
+        protected:
+            void configvaluecallback_changednick();
+            void networkcallback_changednick();
+            void networkcallback_clientIDchanged();
+            void networkcallback_server_ready();
+            void networkcallback_client_ready();
+
+            std::string nick_;
+            std::string synchronize_nick_;
+            bool server_ready_;
+            bool client_ready_;
+    };
+}
+
+#endif /* _HumanPlayer_H__ */
Index: code/trunk/src/orxonox/objects/infos/Info.cc
===================================================================
--- code/trunk/src/orxonox/objects/infos/Info.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/infos/Info.cc	(revision 2087)
@@ -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 "OrxonoxStableHeaders.h"
+#include "Info.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    Info::Info(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
+    {
+        RegisterObject(Info);
+    }
+}
Index: code/trunk/src/orxonox/objects/infos/Info.h
===================================================================
--- code/trunk/src/orxonox/objects/infos/Info.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/infos/Info.h	(revision 2087)
@@ -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.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Info : public BaseObject, public network::Synchronisable
+    {
+        public:
+            Info(BaseObject* creator);
+            virtual ~Info() {}
+    };
+}
+
+#endif /* _Info_H__ */
Index: code/trunk/src/orxonox/objects/infos/Level.cc
===================================================================
--- code/trunk/src/orxonox/objects/infos/Level.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/infos/Level.cc	(revision 2087)
@@ -0,0 +1,148 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "Level.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "core/Loader.h"
+#include "core/XMLFile.h"
+#include "core/Template.h"
+
+#include "Settings.h"
+#include "LevelManager.h"
+#include "PlayerInfo.h"
+#include "objects/gametypes/Gametype.h"
+
+#include "util/Math.h"
+
+namespace orxonox
+{
+    CreateFactory(Level);
+
+    Level::Level(BaseObject* creator) : Info(creator)
+    {
+        RegisterObject(Level);
+
+        this->registerVariables();
+        this->xmlfilename_ = this->getFilename();
+
+        if (this->xmlfilename_.length() >= Settings::getDataPath().length())
+            this->xmlfilename_ = this->xmlfilename_.substr(Settings::getDataPath().length());
+    }
+
+    Level::~Level()
+    {
+        if (this->isInitialized())
+        {
+            LevelManager::getInstance().releaseActivity(this);
+
+            if (this->xmlfile_)
+                Loader::unload(this->xmlfile_);
+        }
+    }
+
+    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");
+
+        XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);
+    }
+
+    void Level::registerVariables()
+    {
+        REGISTERSTRING(this->xmlfilename_, network::direction::toclient, new network::NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
+        REGISTERSTRING(this->name_,        network::direction::toclient, new network::NetworkCallback<Level>(this, &Level::changedName));
+        REGISTERSTRING(this->description_, network::direction::toclient);
+    }
+
+    void Level::networkcallback_applyXMLFile()
+    {
+        COUT(0) << "Loading level \"" << this->xmlfilename_ << "\"..." << std::endl;
+
+        ClassTreeMask mask;
+        mask.exclude(Class(BaseObject));
+        mask.include(Class(Template));
+
+        this->xmlfile_ = new XMLFile(Settings::getDataPath() + this->xmlfilename_, mask);
+
+        Loader::open(this->xmlfile_);
+    }
+
+    void Level::setGametypeString(const std::string& gametype)
+    {
+        Identifier* identifier = ClassByString(gametype);
+        if (identifier && identifier->isA(Class(Gametype)))
+        {
+            this->gametype_ = gametype;
+
+            Gametype* rootgametype = dynamic_cast<Gametype*>(identifier->fabricate(this));
+            this->setGametype(rootgametype);
+
+            for (std::list<BaseObject*>::iterator it = this->objects_.begin(); it != this->objects_.end(); ++it)
+                (*it)->setGametype(rootgametype);
+
+            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::playerEntered(PlayerInfo* player)
+    {
+        COUT(3) << "player entered level" << std::endl;
+        player->setGametype(this->getGametype());
+    }
+
+    void Level::playerLeft(PlayerInfo* player)
+    {
+        COUT(3) << "player left level" << std::endl;
+        player->setGametype(0);
+    }
+}
Index: code/trunk/src/orxonox/objects/infos/Level.h
===================================================================
--- code/trunk/src/orxonox/objects/infos/Level.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/infos/Level.h	(revision 2087)
@@ -0,0 +1,73 @@
+/*
+ *   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 "Info.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Level : public Info
+    {
+        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 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_;
+    };
+}
+
+#endif /* _Level_H__ */
Index: code/trunk/src/orxonox/objects/infos/PlayerInfo.cc
===================================================================
--- code/trunk/src/orxonox/objects/infos/PlayerInfo.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/infos/PlayerInfo.cc	(revision 2087)
@@ -0,0 +1,164 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "PlayerInfo.h"
+
+#include "core/CoreIncludes.h"
+#include "network/ClientInformation.h"
+#include "objects/gametypes/Gametype.h"
+
+namespace orxonox
+{
+    PlayerInfo::PlayerInfo(BaseObject* creator) : Info(creator)
+    {
+        RegisterObject(PlayerInfo);
+
+        this->clientID_ = network::CLIENTID_UNKNOWN;
+        this->bHumanPlayer_ = false;
+        this->bLocalPlayer_ = false;
+        this->bReadyToSpawn_ = false;
+        this->controller_ = 0;
+        this->controllableEntity_ = 0;
+        this->controllableEntityID_ = network::CLIENTID_UNKNOWN;
+
+        this->registerVariables();
+    }
+
+    PlayerInfo::~PlayerInfo()
+    {
+        if (this->isInitialized())
+        {
+            this->stopControl(this->controllableEntity_);
+
+            if (this->controller_)
+            {
+                delete this->controller_;
+                this->controller_ = 0;
+            }
+        }
+    }
+
+    void PlayerInfo::registerVariables()
+    {
+        REGISTERSTRING(this->name_,                 network::direction::toclient, new network::NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
+        REGISTERDATA  (this->controllableEntityID_, network::direction::toclient, new network::NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
+        REGISTERDATA  (this->bReadyToSpawn_,        network::direction::toserver);
+    }
+
+    void PlayerInfo::changedName()
+    {
+        if (this->isReady() && this->getGametype())
+            this->getGametype()->playerChangedName(this);
+    }
+
+    void PlayerInfo::changedGametype()
+    {
+        if (this->isReady())
+        {
+            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::createController()
+    {
+        this->controller_ = this->defaultController_.fabricate(this);
+        assert(this->controller_);
+        this->controller_->setPlayer(this);
+        if (this->controllableEntity_)
+            this->controller_->setControllableEntity(this->controllableEntity_);
+    }
+
+    void PlayerInfo::startControl(ControllableEntity* entity)
+    {
+        if (this->controllableEntity_)
+            this->stopControl(this->controllableEntity_);
+
+        this->controllableEntity_ = entity;
+
+        if (entity)
+        {
+            this->controllableEntityID_ = entity->getObjectID();
+            entity->setPlayer(this);
+            this->bReadyToSpawn_ = false;
+        }
+        else
+        {
+            this->controllableEntityID_ = network::OBJECTID_UNKNOWN;
+        }
+
+        if (this->controller_)
+            this->controller_->setControllableEntity(entity);
+    }
+
+    void PlayerInfo::stopControl(ControllableEntity* entity, bool callback)
+    {
+        if (entity && this->controllableEntity_ == entity)
+        {
+            this->controllableEntity_ = 0;
+            this->controllableEntityID_ = network::OBJECTID_UNKNOWN;
+
+            if (this->controller_)
+                this->controller_->setControllableEntity(0);
+
+            if (callback)
+                entity->removePlayer();
+        }
+    }
+
+    void PlayerInfo::networkcallback_changedcontrollableentityID()
+    {
+        if (this->controllableEntityID_ != network::OBJECTID_UNKNOWN)
+        {
+            Synchronisable* temp = Synchronisable::getSynchronisable(this->controllableEntityID_);
+            ControllableEntity* entity = dynamic_cast<ControllableEntity*>(temp);
+
+            this->startControl(entity);
+        }
+        else
+        {
+            this->stopControl(this->controllableEntity_);
+        }
+    }
+}
Index: code/trunk/src/orxonox/objects/infos/PlayerInfo.h
===================================================================
--- code/trunk/src/orxonox/objects/infos/PlayerInfo.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/infos/PlayerInfo.h	(revision 2087)
@@ -0,0 +1,88 @@
+/*
+ *   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 "objects/controllers/Controller.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PlayerInfo : public Info
+    {
+        public:
+            PlayerInfo(BaseObject* creator);
+            virtual ~PlayerInfo();
+
+            void registerVariables();
+
+            virtual void changedName();
+            virtual void changedGametype();
+
+            inline bool isHumanPlayer() const
+                { return this->bHumanPlayer_; }
+            inline bool isLocalPlayer() const
+                { return this->bLocalPlayer_; }
+            inline unsigned int getClientID() const
+                { return this->clientID_; }
+            inline bool isReadyToSpawn() const
+                { return this->bReadyToSpawn_; }
+
+            virtual bool isReady() const = 0;
+            virtual float getPing() const = 0;
+            virtual float getPacketLossRatio() const = 0;
+
+            inline void setReadyToSpawn(bool bReady)
+                { this->bReadyToSpawn_ = bReady; }
+
+            void startControl(ControllableEntity* entity);
+            void stopControl(ControllableEntity* entity, bool callback = true);
+
+            inline ControllableEntity* getControllableEntity() const
+                { return this->controllableEntity_; }
+
+        protected:
+            void createController();
+            void networkcallback_changedcontrollableentityID();
+
+            bool bHumanPlayer_;
+            bool bLocalPlayer_;
+            bool bReadyToSpawn_;
+            SubclassIdentifier<Controller> defaultController_;
+            Controller* controller_;
+            ControllableEntity* controllableEntity_;
+            unsigned int controllableEntityID_;
+            unsigned int clientID_;
+    };
+}
+
+#endif /* _PlayerInfo_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/Backlight.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Backlight.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/Backlight.cc	(revision 2087)
@@ -0,0 +1,170 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "Backlight.h"
+
+#include <OgreBillboard.h>
+#include <OgreRibbonTrail.h>
+#include <OgreSceneManager.h>
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/Executor.h"
+#include "util/Math.h"
+#include "GraphicsEngine.h"
+
+namespace orxonox
+{
+    CreateFactory(Backlight);
+
+    float Backlight::timeFactor_s = 1.0;
+
+    Backlight::Backlight(float maxspeed, float brakingtime, float scale)
+    {
+        RegisterObject(Backlight);
+
+        this->setConfigValues();
+        this->traillength_ = 1;
+
+        this->configure(maxspeed, brakingtime, scale);
+    }
+    
+    bool Backlight::create(){
+      if(!WorldEntity::create())
+        return false;
+      
+      this->getNode()->setInheritScale(false);
+
+      this->billboard_.setBillboardSet("Flares/backlightflare");
+      this->attachObject(this->billboard_.getBillboardSet());
+
+      this->ribbonTrail_ = GraphicsEngine::getInstance().getLevelSceneManager()->createRibbonTrail(this->getName() + "RibbonTrail");
+      this->ribbonTrailNode_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName() + "RibbonTrailNode");
+      this->ribbonTrailNode_->attachObject(this->ribbonTrail_);
+      this->ribbonTrail_->addNode(this->getNode());
+
+
+      this->ribbonTrail_->setTrailLength(this->maxTraillength_);
+      this->ribbonTrail_->setMaterialName("Trail/backlighttrail");
+
+        //this->setTimeFactor(Orxonox::getInstance().getTimeFactor());
+      this->setTimeFactor(1.0f);
+      
+      this->ribbonTrail_->setMaxChainElements(this->maxTrailsegments_);
+      this->ribbonTrail_->setTrailLength(this->traillength_ = 2 * this->maxTrailsegments_);
+      this->ribbonTrail_->setInitialWidth(0, this->width_ * this->getScale());
+      this->ribbonTrail_->setWidthChange(0, this->width_ * this->getScale() / this->maxLifeTime_ * Backlight::timeFactor_s);
+      return true;
+    }
+
+    Backlight::~Backlight()
+    {
+        if (this->isInitialized())
+        {
+            this->detachObject(this->billboard_.getBillboardSet());
+            GraphicsEngine::getInstance().getLevelSceneManager()->destroySceneNode(this->getName() + "RibbonTrailNode");
+            GraphicsEngine::getInstance().getLevelSceneManager()->destroyRibbonTrail(this->ribbonTrail_);
+        }
+    }
+
+    void Backlight::setConfigValues()
+    {
+        SetConfigValue(maxLifeTime_, 4.0).description("The maximal amount of seconds the trail behind a SpaceShip stays visible");
+        SetConfigValue(trailSegmentLength_, 50).description("The length of one segment of the trail behind a SpaceShip (lower values make it more smooth)");
+        SetConfigValue(width_, 7.0).description("The width of the trail");
+    }
+
+    void Backlight::setTimeFactor(float factor)
+    {
+        Backlight::timeFactor_s = factor;
+        float change = Backlight::timeFactor_s / this->maxLifeTime_;
+        this->ribbonTrail_->setWidthChange(0, this->width_ * change);
+        this->updateColourChange();
+    }
+
+    void Backlight::updateColourChange()
+    {
+        this->ribbonTrail_->setColourChange(0, ColourValue(0, 0, 0, this->maxTraillength_ / this->traillength_ / this->maxLifeTime_ * Backlight::timeFactor_s));
+    }
+    
+    
+    void Backlight::XMLPort(Element& xmlelement, XMLPort::Mode mode){
+      SUPER(Backlight, XMLPort, xmlelement, mode);
+      
+      Backlight::create();
+    }
+
+    void Backlight::tick(float dt)
+    {
+        SUPER(Backlight, tick, dt);
+
+        if (this->isActive())
+        {
+            if (this->traillength_ < this->maxTraillength_)
+            {
+                this->traillength_ = min<float>(this->maxTraillength_, this->traillength_ + dt * this->maxTraillength_ / this->maxLifeTime_);
+                this->updateColourChange();
+            }
+        }
+        else
+        {
+            if (this->traillength_ > 1)
+            {
+                this->traillength_ = max<float>(1, this->traillength_ - this->brakefactor_ * dt * this->maxTraillength_ / this->maxLifeTime_);
+                this->updateColourChange();
+            }
+        }
+
+        this->ribbonTrail_->setTrailLength(this->traillength_);
+    }
+
+    void Backlight::setColour(const ColourValue& colour)
+    {
+        this->billboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
+        this->ribbonTrail_->setInitialColour(0, ColourValue(colour.r / 4 + 0.75, colour.g / 4 + 0.75, colour.b / 4 + 0.75));
+    }
+
+    void Backlight::configure(float maxspeed, float brakingtime, float scale)
+    {
+        this->maxTraillength_ = this->maxLifeTime_ * maxspeed;
+        this->maxTrailsegments_ = (size_t)(this->maxTraillength_ / this->trailSegmentLength_);
+
+        this->brakefactor_ = this->maxLifeTime_ / brakingtime;
+
+        this->scale(scale);
+    }
+
+    void Backlight::changedVisibility()
+    {
+        SUPER(Backlight, changedVisibility);
+
+        this->billboard_.setVisible(this->isVisible());
+        this->ribbonTrail_->setVisible(this->isVisible());
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/Backlight.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Backlight.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/Backlight.h	(revision 2087)
@@ -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 _Backlight_H__
+#define _Backlight_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "PositionableEntity.h"
+#include "tools/BillboardSet.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Backlight : public PositionableEntity
+    {
+        public:
+            Backlight(float maxspeed = 1.0, float brakingtime = 1.0, float scale = 1.0);
+            virtual ~Backlight();
+
+            void setConfigValues();
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+            virtual void changedVisibility();
+            virtual bool create();
+
+            void setColour(const ColourValue& colour);
+            void setTimeFactor(float factor);
+
+        private:
+            void configure(float maxspeed, float brakingtime, float scale = 1);
+            void updateColourChange();
+
+            static float timeFactor_s;
+            BillboardSet billboard_;
+            Ogre::SceneNode* ribbonTrailNode_;
+            Ogre::RibbonTrail* ribbonTrail_;
+
+            float maxLifeTime_;
+            float trailSegmentLength_;
+            float width_;
+
+            float brakefactor_;
+
+            float maxTraillength_;
+            float traillength_;
+
+            size_t maxTrailsegments_;
+    };
+}
+
+#endif /* _Backlight_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/Billboard.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Billboard.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/Billboard.cc	(revision 2087)
@@ -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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Billboard.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(Billboard);
+
+    Billboard::Billboard(BaseObject* creator) : PositionableEntity(creator)
+    {
+        RegisterObject(Billboard);
+
+        this->registerVariables();
+    }
+
+    Billboard::~Billboard()
+    {
+        if (this->isInitialized())
+        {
+            if (this->isInitialized() && this->billboard_.getBillboardSet())
+                this->getNode()->detachObject(this->billboard_.getName());
+        }
+    }
+
+    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);
+    }
+
+    void Billboard::registerVariables()
+    {
+        REGISTERSTRING(this->material_, network::direction::toclient, new network::NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
+        REGISTERDATA  (this->colour_,   network::direction::toclient, new network::NetworkCallback<Billboard>(this, &Billboard::changedColour));
+    }
+
+    void Billboard::changedMaterial()
+    {
+        if (!this->billboard_.getBillboardSet())
+        {
+            if (this->getScene() && this->getScene()->getSceneManager())
+            {
+                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
+                this->getNode()->attachObject(this->billboard_.getBillboardSet());
+                this->billboard_.setVisible(this->isVisible());
+            }
+        }
+        else
+            this->billboard_.setMaterial(this->material_);
+    }
+
+    void Billboard::changedColour()
+    {
+        if (!this->billboard_.getBillboardSet())
+        {
+            if (this->getScene() && this->getScene()->getSceneManager())
+            {
+                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
+                this->getNode()->attachObject(this->billboard_.getBillboardSet());
+                this->billboard_.setVisible(this->isVisible());
+            }
+        }
+        else
+            this->billboard_.setColour(this->colour_);
+    }
+
+    void Billboard::changedVisibility()
+    {
+        SUPER(Billboard, changedVisibility);
+
+        this->billboard_.setVisible(this->isVisible());
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/Billboard.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Billboard.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/Billboard.h	(revision 2087)
@@ -0,0 +1,73 @@
+/*
+ *   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 "PositionableEntity.h"
+#include "util/Math.h"
+#include "tools/BillboardSet.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Billboard : public PositionableEntity
+    {
+        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_; }
+
+        private:
+            void changedMaterial();
+            void changedColour();
+
+            BillboardSet billboard_;
+            std::string material_;
+            ColourValue colour_;
+    };
+}
+
+#endif /* _Billboard_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.cc	(revision 2087)
@@ -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 "OrxonoxStableHeaders.h"
+#include "BlinkingBillboard.h"
+
+#include "core/Core.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Math.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()
+    {
+//        REGISTERDATA(this->amplitude_, network::direction::toclient);
+//        REGISTERDATA(this->frequency_, network::direction::toclient);
+//        REGISTERDATA(this->phase_,     network::direction::toclient);
+    }
+
+    void BlinkingBillboard::tick(float dt)
+    {
+        if (Core::isMaster() && this->isActive())
+        {
+            this->time_ += dt;
+            if (this->bQuadratic_)
+                this->setScale(this->amplitude_ * square(sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_)));
+            else
+                this->setScale(this->amplitude_ * sin((6.2831853 * this->time_ + this->phase_.valueRadians()) * this->frequency_));
+        }
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.h	(revision 2087)
@@ -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:
+ *      ...
+ *
+ */
+
+#ifndef _BlinkingBillboard_H__
+#define _BlinkingBillboard_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Billboard.h"
+#include "objects/Tickable.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/objects/worldentities/Camera.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Camera.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/Camera.cc	(revision 2087)
@@ -0,0 +1,126 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "Camera.h"
+
+#include <string>
+#include <cassert>
+
+#include <OgreCamera.h>
+#include <OgreSceneManager.h>
+#include <OgreSceneNode.h>
+#include <OgreViewport.h>
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "objects/Scene.h"
+#include "CameraManager.h"
+
+namespace orxonox
+{
+    CreateFactory(Camera);
+
+    Camera::Camera(BaseObject* creator) : PositionableEntity(creator)
+    {
+        RegisterObject(Camera);
+
+        assert(this->getScene());
+        assert(this->getScene()->getSceneManager());
+
+        this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
+        this->getNode()->attachObject(this->camera_);
+
+        this->bHasFocus_ = false;
+        this->bDrag_ = false;
+        this->nearClipDistance_ = 1;
+
+        this->setObjectMode(0x0);
+
+        this->setConfigValues();
+        this->configvaluecallback_changedNearClipDistance();
+
+        this->requestFocus(); // ! HACK ! REMOVE THIS !
+    }
+
+    Camera::~Camera()
+    {
+        if (this->isInitialized())
+        {
+            this->releaseFocus();
+        }
+    }
+
+    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)
+    {
+/*
+        // this stuff here may need some adjustments
+        float coeff = (this->bDrag_) ? min(1.0f, 15.0f * dt) : (1.0f);
+
+        Vector3 offset = this->getNode()->getWorldPosition() - this->cameraNode_->getWorldPosition();
+        this->cameraNode_->translate(coeff * offset);
+
+        this->cameraNode_->setOrientation(Quaternion::Slerp(coeff, this->cameraNode_->getWorldOrientation(), this->getWorldOrientation(), false));
+*/
+    }
+
+    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(Ogre::Viewport* viewport)
+    {
+        this->bHasFocus_ = true;
+        viewport->setCamera(this->camera_);
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/Camera.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Camera.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/Camera.h	(revision 2087)
@@ -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 <OgrePrerequisites.h>
+#include "objects/worldentities/PositionableEntity.h"
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Camera : public PositionableEntity, 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_; }
+
+            inline void setDrag(bool bDrag)
+                { this->bDrag_ = bDrag; }
+            inline bool getDrag() const
+                { return this->bDrag_; }
+
+        private:
+            void removeFocus();
+            void setFocus(Ogre::Viewport* viewport);
+            void configvaluecallback_changedNearClipDistance();
+
+            Ogre::Camera*   camera_;
+            float           nearClipDistance_;
+            bool            bHasFocus_;
+            bool            bDrag_;
+    };
+}
+
+#endif /* _Camera_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/CameraPosition.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/CameraPosition.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/CameraPosition.cc	(revision 2087)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "CameraPosition.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "Camera.h"
+
+namespace orxonox
+{
+    CreateFactory(CameraPosition);
+
+    CameraPosition::CameraPosition(BaseObject* creator) : PositionableEntity(creator)
+    {
+        RegisterObject(CameraPosition);
+
+        this->bDrag_ = 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);
+    }
+
+    void CameraPosition::attachCamera(Camera* camera)
+    {
+        camera->setDrag(this->bDrag_);
+        this->attach(camera);
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/CameraPosition.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/CameraPosition.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/CameraPosition.h	(revision 2087)
@@ -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:
+ *      ...
+ *
+ */
+
+#ifndef _CameraPosition_H__
+#define _CameraPosition_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/PositionableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport CameraPosition : public PositionableEntity
+    {
+        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_; }
+
+            void attachCamera(Camera* camera);
+
+        private:
+            bool bDrag_;
+    };
+}
+
+#endif /* _CameraPosition_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2087)
@@ -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.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "ControllableEntity.h"
+
+#include "core/CoreIncludes.h"
+#include "core/Core.h"
+#include "core/XMLPort.h"
+#include "core/Template.h"
+
+#include "objects/infos/PlayerInfo.h"
+#include "objects/worldentities/Camera.h"
+#include "objects/worldentities/CameraPosition.h"
+#include "overlays/OverlayGroup.h"
+
+namespace orxonox
+{
+    CreateFactory(ControllableEntity);
+
+    ControllableEntity::ControllableEntity(BaseObject* creator) : WorldEntity(creator)
+    {
+        RegisterObject(ControllableEntity);
+
+        this->bControlled_ = false;
+        this->server_overwrite_ = 0;
+        this->client_overwrite_ = 0;
+        this->player_ = 0;
+        this->playerID_ = network::OBJECTID_UNKNOWN;
+        this->hud_ = 0;
+        this->camera_ = 0;
+        this->bDestroyWhenPlayerLeft_ = false;
+
+        this->velocity_ = Vector3::ZERO;
+        this->acceleration_ = Vector3::ZERO;
+
+        this->server_position_ = Vector3::ZERO;
+        this->client_position_ = Vector3::ZERO;
+        this->server_velocity_ = Vector3::ZERO;
+        this->client_velocity_ = Vector3::ZERO;
+        this->server_orientation_ = Quaternion::IDENTITY;
+        this->client_orientation_ = Quaternion::IDENTITY;
+
+        this->registerVariables();
+    }
+
+    ControllableEntity::~ControllableEntity()
+    {
+        if (this->isInitialized())
+        {
+            if (this->bControlled_)
+                this->stopLocalControl();
+
+            if (this->hud_)
+                delete this->hud_;
+
+            if (this->camera_)
+                delete this->camera_;
+
+            if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this)
+                this->getPlayer()->stopControl(this, false);
+        }
+    }
+
+    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);
+    }
+
+    void ControllableEntity::addCameraPosition(CameraPosition* position)
+    {
+        this->attach(position);
+        this->cameraPositions_.push_back(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->attach(this->camera_);
+            }
+        }
+    }
+
+    void ControllableEntity::setPlayer(PlayerInfo* player)
+    {
+        if (!player)
+        {
+            this->removePlayer();
+            return;
+        }
+
+        this->player_ = player;
+        this->playerID_ = player->getObjectID();
+        this->bControlled_ = (player->isLocalPlayer() && player->isHumanPlayer());
+        if (this->bControlled_)
+        {
+            this->startLocalControl();
+
+            if (!Core::isMaster())
+            {
+                this->client_overwrite_ = this->server_overwrite_;
+COUT(0) << "CE: bidirectional synchronization" << std::endl;
+                this->setObjectMode(network::direction::bidirectional);
+            }
+        }
+    }
+
+    void ControllableEntity::removePlayer()
+    {
+        if (this->bControlled_)
+            this->stopLocalControl();
+
+        this->player_ = 0;
+        this->playerID_ = network::OBJECTID_UNKNOWN;
+        this->bControlled_ = false;
+        this->setObjectMode(network::direction::toclient);
+
+        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_ != network::OBJECTID_UNKNOWN)
+        {
+            this->player_ = dynamic_cast<PlayerInfo*>(network::Synchronisable::getSynchronisable(this->playerID_));
+            if (this->player_ && (this->player_->getControllableEntity() != this))
+                this->player_->startControl(this);
+        }
+    }
+
+    void ControllableEntity::startLocalControl()
+    {
+//        std::cout << this->getObjectID() << " ###### start local control" << std::endl;
+        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->attach(this->camera_);
+
+        if (this->hudtemplate_ != "")
+        {
+            this->hud_ = new OverlayGroup(this);
+            this->hud_->addTemplate(this->hudtemplate_);
+        }
+    }
+
+    void ControllableEntity::stopLocalControl()
+    {
+//        std::cout << "###### stop local control" << std::endl;
+        this->camera_->detachFromParent();
+        delete this->camera_;
+        this->camera_ = 0;
+
+        delete this->hud_;
+        this->hud_ = 0;
+    }
+
+    void ControllableEntity::tick(float dt)
+    {
+        if (this->isActive())
+        {
+            this->velocity_ += (dt * this->acceleration_);
+            this->node_->translate(dt * this->velocity_, Ogre::Node::TS_LOCAL);
+
+            if (Core::isMaster())
+            {
+                this->server_velocity_ = this->velocity_;
+                this->server_position_ = this->node_->getPosition();
+            }
+            else if (this->bControlled_)
+            {
+//                COUT(2) << "setting client position" << endl;
+                this->client_velocity_ = this->velocity_;
+                this->client_position_ = this->node_->getPosition();
+            }
+        }
+    }
+
+    void ControllableEntity::registerVariables()
+    {
+        REGISTERSTRING(this->cameraPositionTemplate_, network::direction::toclient);
+
+        REGISTERDATA(this->server_position_,    network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
+        REGISTERDATA(this->server_velocity_,    network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerVelocity));
+        REGISTERDATA(this->server_orientation_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
+
+        REGISTERDATA(this->server_overwrite_,   network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
+        REGISTERDATA(this->client_overwrite_,   network::direction::toserver);
+
+        REGISTERDATA(this->client_position_,    network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
+        REGISTERDATA(this->client_velocity_,    network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientVelocity));
+        REGISTERDATA(this->client_orientation_, network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
+
+
+        REGISTERDATA(this->playerID_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
+    }
+
+    void ControllableEntity::processServerPosition()
+    {
+        if (!this->bControlled_)
+            this->node_->setPosition(this->server_position_);
+    }
+
+    void ControllableEntity::processServerVelocity()
+    {
+        if (!this->bControlled_)
+            this->velocity_ = this->server_velocity_;
+    }
+
+    void ControllableEntity::processServerOrientation()
+    {
+        if (!this->bControlled_)
+            this->node_->setOrientation(this->server_orientation_);
+    }
+
+    void ControllableEntity::processOverwrite()
+    {
+        if (this->bControlled_)
+        {
+            this->setPosition(this->server_position_);
+            this->setVelocity(this->server_velocity_);
+            this->setOrientation(this->server_orientation_);
+
+            this->client_overwrite_ = this->server_overwrite_;
+        }
+    }
+
+    void ControllableEntity::processClientPosition()
+    {
+        if (this->server_overwrite_ == this->client_overwrite_)
+        {
+//            COUT(2) << "callback: setting client position" << endl;
+            this->node_->setPosition(this->client_position_);
+            this->server_position_ = this->client_position_;
+        }
+//        else
+//          COUT(2) << "callback: not setting client position" << endl;
+    }
+
+    void ControllableEntity::processClientVelocity()
+    {
+        if (this->server_overwrite_ == this->client_overwrite_)
+        {
+            this->velocity_ = this->client_velocity_;
+            this->server_velocity_ = this->client_velocity_;
+        }
+    }
+
+    void ControllableEntity::processClientOrientation()
+    {
+        if (this->server_overwrite_ == this->client_overwrite_)
+        {
+            this->node_->setOrientation(this->client_orientation_);
+            this->server_orientation_ = this->client_orientation_;
+        }
+    }
+
+
+    void ControllableEntity::setPosition(const Vector3& position)
+    {
+        if (Core::isMaster())
+        {
+            this->node_->setPosition(position);
+            this->server_position_ = position;
+            ++this->server_overwrite_;
+        }
+        else if (this->bControlled_)
+        {
+            this->node_->setPosition(position);
+            this->client_position_ = position;
+        }
+    }
+
+    void ControllableEntity::setVelocity(const Vector3& velocity)
+    {
+        if (Core::isMaster())
+        {
+            this->velocity_ = velocity;
+            this->server_velocity_ = velocity;
+            ++this->server_overwrite_;
+        }
+        else if (this->bControlled_)
+        {
+            this->velocity_ = velocity;
+            this->client_velocity_ = velocity;
+        }
+    }
+
+    void ControllableEntity::translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo)
+    {
+        if (Core::isMaster())
+        {
+            this->node_->translate(distance, relativeTo);
+            this->server_position_ = this->node_->getPosition();
+            ++this->server_overwrite_;
+        }
+        else if (this->bControlled_)
+        {
+            this->node_->translate(distance, relativeTo);
+            this->client_position_ = this->node_->getPosition();
+        }
+    }
+
+    void ControllableEntity::setOrientation(const Quaternion& orientation)
+    {
+        if (Core::isMaster())
+        {
+            this->node_->setOrientation(orientation);
+            this->server_orientation_ = orientation;
+            ++this->server_overwrite_;
+        }
+        else if (this->bControlled_)
+        {
+            this->node_->setOrientation(orientation);
+            this->client_orientation_ = orientation;
+        }
+    }
+
+    void ControllableEntity::rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo)
+    {
+        if (Core::isMaster())
+        {
+            this->node_->rotate(rotation, relativeTo);
+            this->server_orientation_ = this->node_->getOrientation();
+            ++this->server_overwrite_;
+        }
+        else if (this->bControlled_)
+        {
+            this->node_->rotate(rotation, relativeTo);
+            this->client_orientation_ = this->node_->getOrientation();
+        }
+    }
+
+    void ControllableEntity::yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
+    {
+        if (Core::isMaster())
+        {
+            this->node_->yaw(angle, relativeTo);
+            this->server_orientation_ = this->node_->getOrientation();
+            ++this->server_overwrite_;
+        }
+        else if (this->bControlled_)
+        {
+            this->node_->yaw(angle, relativeTo);
+            this->client_orientation_ = this->node_->getOrientation();
+        }
+    }
+
+    void ControllableEntity::pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
+    {
+        if (Core::isMaster())
+        {
+            this->node_->pitch(angle, relativeTo);
+            this->server_orientation_ = this->node_->getOrientation();
+            ++this->server_overwrite_;
+        }
+        else if (this->bControlled_)
+        {
+            this->node_->pitch(angle, relativeTo);
+            this->client_orientation_ = this->node_->getOrientation();
+        }
+    }
+
+    void ControllableEntity::roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
+    {
+        if (Core::isMaster())
+        {
+            this->node_->roll(angle, relativeTo);
+            this->server_orientation_ = this->node_->getOrientation();
+            ++this->server_overwrite_;
+        }
+        else if (this->bControlled_)
+        {
+            this->node_->roll(angle, relativeTo);
+            this->client_orientation_ = this->node_->getOrientation();
+        }
+    }
+
+    void ControllableEntity::lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector)
+    {
+        if (Core::isMaster())
+        {
+            this->node_->lookAt(target, relativeTo, localDirectionVector);
+            this->server_orientation_ = this->node_->getOrientation();
+            ++this->server_overwrite_;
+        }
+        else if (this->bControlled_)
+        {
+            this->node_->lookAt(target, relativeTo, localDirectionVector);
+            this->client_orientation_ = this->node_->getOrientation();
+        }
+    }
+
+    void ControllableEntity::setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector)
+    {
+        if (Core::isMaster())
+        {
+            this->node_->setDirection(direction, relativeTo, localDirectionVector);
+            this->server_orientation_ = this->node_->getOrientation();
+            ++this->server_overwrite_;
+        }
+        else if (this->bControlled_)
+        {
+            this->node_->setDirection(direction, relativeTo, localDirectionVector);
+            this->client_orientation_ = this->node_->getOrientation();
+        }
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/ControllableEntity.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 2087)
@@ -0,0 +1,176 @@
+/*
+ *   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 _ControllableEntity_H__
+#define _ControllableEntity_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "WorldEntity.h"
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ControllableEntity : public WorldEntity, public Tickable
+    {
+        public:
+            ControllableEntity(BaseObject* creator);
+            virtual ~ControllableEntity();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+            void registerVariables();
+
+            virtual void setPlayer(PlayerInfo* player);
+            virtual void removePlayer();
+            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) {}
+
+            virtual void fire() {}
+            virtual void altFire() {}
+
+            virtual void greet() {}
+            virtual void use() {}
+            virtual void switchCamera();
+
+            inline const Vector3& getVelocity() const
+                { return this->velocity_; }
+            inline const Vector3& getAcceleration() const
+                { return this->acceleration_; }
+            inline const std::string& getHudTemplate() const
+                { return this->hudtemplate_; }
+
+            using WorldEntity::setPosition;
+            using WorldEntity::translate;
+            using WorldEntity::setOrientation;
+            using WorldEntity::rotate;
+            using WorldEntity::yaw;
+            using WorldEntity::pitch;
+            using WorldEntity::roll;
+            using WorldEntity::lookAt;
+            using WorldEntity::setDirection;
+
+            void setPosition(const Vector3& position);
+            void translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
+            void setOrientation(const Quaternion& orientation);
+            void rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
+            void yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
+            void pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
+            void roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
+            void lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
+            void setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
+
+            void setVelocity(const Vector3& velocity);
+            inline void setVelocity(float x, float y, float z)
+                { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; }
+
+            inline void setAcceleration(const Vector3& acceleration)
+                { this->acceleration_ = acceleration; }
+            inline void setAcceleration(float x, float y, float z)
+                { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; }
+
+            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_; }
+
+        protected:
+            virtual void startLocalControl();
+            virtual void stopLocalControl();
+
+            inline void setHudTemplate(const std::string& name)
+                { this->hudtemplate_ = name; }
+
+            inline bool isLocallyControlled() const
+                { return this->bControlled_; }
+
+            Vector3 acceleration_;
+
+        private:
+            void overwrite();
+            void processOverwrite();
+
+            void processServerPosition();
+            void processServerVelocity();
+            void processServerOrientation();
+
+            void processClientPosition();
+            void processClientVelocity();
+            void processClientOrientation();
+
+            void networkcallback_changedplayerID();
+
+            unsigned int server_overwrite_;
+            unsigned int client_overwrite_;
+
+            Vector3 velocity_;
+
+            bool bControlled_;
+            Vector3 server_position_;
+            Vector3 client_position_;
+            Vector3 server_velocity_;
+            Vector3 client_velocity_;
+            Quaternion server_orientation_;
+            Quaternion client_orientation_;
+
+            PlayerInfo* player_;
+            unsigned int playerID_;
+            std::string hudtemplate_;
+            OverlayGroup* hud_;
+            Camera* camera_;
+            bool bDestroyWhenPlayerLeft_;
+
+            std::list<CameraPosition*> cameraPositions_;
+            std::string cameraPositionTemplate_;
+    };
+}
+
+#endif /* _ControllableEntity_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/Light.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Light.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/Light.cc	(revision 2087)
@@ -0,0 +1,174 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "Light.h"
+
+#include <sstream>
+#include <cassert>
+
+#include <OgreSceneManager.h>
+
+#include "util/String.h"
+#include "util/Convert.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/Scene.h"
+
+namespace orxonox
+{
+    unsigned int Light::lightCounter_s = 0;
+
+    CreateFactory(Light);
+
+    Light::Light(BaseObject* creator) : PositionableEntity(creator)
+    {
+        RegisterObject(Light);
+
+        if (this->getScene() && this->getScene()->getSceneManager())
+        this->light_ = this->getScene()->getSceneManager()->createLight("Light" + convertToString(Light::lightCounter_s++));
+        this->getNode()->attachObject(this->light_);
+
+        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");
+        XMLPortParamExternTemplate(Light, Ogre::Light, this->light_, "diffuse",   setDiffuseColour,  getDiffuseColour,  xmlelement, mode, const ColourValue&);
+        XMLPortParamExternTemplate(Light, Ogre::Light, this->light_, "specular",  setSpecularColour, getSpecularColour, xmlelement, mode, const ColourValue&);
+        XMLPortParamExternTemplate(Light, Ogre::Light, this->light_, "direction", setDirection,      getDirection,      xmlelement, mode, const Vector3&);
+    }
+
+    void Light::registerVariables()
+    {
+        REGISTERDATA(this->type_, network::direction::toclient, new network::NetworkCallback<Light>(this, &Light::changedType));
+        REGISTERDATA(this->light_->getDiffuseColour(), network::direction::toclient);
+        REGISTERDATA(this->light_->getSpecularColour(), network::direction::toclient);
+        REGISTERDATA(this->light_->getDirection(), network::direction::toclient);
+    }
+
+    const std::string& Light::getName() const
+    {
+        if (this->light_)
+            return this->light_->getName();
+        else
+            return BLANKSTRING;
+    }
+
+    void Light::setDiffuseColour(const ColourValue& colour)
+    {
+        if (this->light_)
+            this->light_->setDiffuseColour(colour);
+    }
+
+    const ColourValue& Light::getDiffuseColour() const
+    {
+        if (this->light_)
+            return this->light_->getDiffuseColour();
+        else
+            return ColourValue::White;
+    }
+
+    void Light::setSpecularColour(const ColourValue& colour)
+    {
+        if (this->light_)
+            this->light_->setSpecularColour(colour);
+    }
+
+    const ColourValue& Light::getSpecularColour() const
+    {
+        if (this->light_)
+            return this->light_->getSpecularColour();
+        else
+            return ColourValue::White;
+    }
+
+    void Light::setDirection(const Vector3& direction)
+    {
+        if (this->light_)
+            this->light_->setDirection(direction);
+    }
+
+    const Vector3& Light::getDirection() const
+    {
+        if (this->light_)
+            return this->light_->getDirection();
+        else
+            return Vector3::ZERO;
+    }
+
+    void Light::setTypeString(const std::string& type)
+    {
+        if (type == "point")
+            this->setType(Ogre::Light::LT_POINT);
+        else if (type == "directional")
+            this->setType(Ogre::Light::LT_DIRECTIONAL);
+        else if (type == "spotlight")
+            this->setType(Ogre::Light::LT_SPOTLIGHT);
+        else
+            this->setType(Ogre::Light::LT_POINT);
+    }
+
+    std::string Light::getTypeString() const
+    {
+        switch (this->type_)
+        {
+            case Ogre::Light::LT_DIRECTIONAL:
+                return "directional";
+            case Ogre::Light::LT_SPOTLIGHT:
+                return "spotlight";
+            case Ogre::Light::LT_POINT:
+            default:
+                return "poinT";
+        }
+    }
+
+    void Light::changedType()
+    {
+        this->light_->setType(this->type_);
+    }
+
+    void Light::changedVisibility()
+    {
+        SUPER(Light, changedVisibility);
+
+        this->light_->setVisible(this->isVisible());
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/Light.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Light.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/Light.h	(revision 2087)
@@ -0,0 +1,85 @@
+/*
+ *   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 "PositionableEntity.h"
+
+#include <string>
+#include <OgreLight.h>
+
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Light : public PositionableEntity
+    {
+        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_; }
+
+            const std::string& getName() const;
+
+            inline void setType(Ogre::Light::LightTypes type)
+                { this->type_ = type; this->changedType(); }
+            Ogre::Light::LightTypes getType() const
+                { return this->type_; }
+
+            void setDiffuseColour(const ColourValue& colour);
+            const ColourValue& getDiffuseColour() const;
+
+            void setSpecularColour(const ColourValue& colour);
+            const ColourValue& getSpecularColour() const;
+
+            void setDirection(const Vector3& direction);
+            const Vector3& getDirection() const;
+
+        private:
+            void setTypeString(const std::string& type);
+            std::string getTypeString() const;
+
+            void changedType();
+
+            static unsigned int lightCounter_s;
+            Ogre::Light* light_;
+            Ogre::Light::LightTypes type_;
+
+    };
+}
+
+#endif /* _Light_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/Model.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Model.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/Model.cc	(revision 2087)
@@ -0,0 +1,93 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+
+#include "Model.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(Model);
+
+    Model::Model(BaseObject* creator) : PositionableEntity(creator)
+    {
+        RegisterObject(Model);
+
+        this->registerVariables();
+    }
+
+    Model::~Model()
+    {
+        if (this->isInitialized() && this->mesh_.getEntity())
+            this->getNode()->detachObject(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()
+    {
+        REGISTERSTRING(this->meshSrc_,    network::direction::toclient, new network::NetworkCallback<Model>(this, &Model::changedMesh));
+        REGISTERDATA(this->bCastShadows_, network::direction::toclient, new network::NetworkCallback<Model>(this, &Model::changedShadows));
+    }
+
+    void Model::changedMesh()
+    {
+        if (this->mesh_.getEntity())
+            this->getNode()->detachObject(this->mesh_.getEntity());
+
+        this->mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);
+
+        if (this->mesh_.getEntity())
+        {
+            this->getNode()->attachObject(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/objects/worldentities/Model.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Model.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/Model.h	(revision 2087)
@@ -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 _Model_H__
+#define _Model_H__
+
+#include "OrxonoxPrereqs.h"
+#include "PositionableEntity.h"
+#include "tools/Mesh.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Model : public PositionableEntity
+    {
+        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 /* _PositionableEntity_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/MovableEntity.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/MovableEntity.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/MovableEntity.cc	(revision 2087)
@@ -0,0 +1,178 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "MovableEntity.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "core/Executor.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+    static const float MAX_RESYNCHRONIZE_TIME = 3.0f;
+
+    CreateFactory(MovableEntity);
+
+    MovableEntity::MovableEntity(BaseObject* creator) : WorldEntity(creator)
+    {
+        RegisterObject(MovableEntity);
+
+        this->velocity_ = Vector3::ZERO;
+        this->acceleration_ = Vector3::ZERO;
+        this->rotationAxis_ = Vector3::ZERO;
+        this->rotationRate_ = 0;
+        this->momentum_ = 0;
+
+        this->overwrite_position_ = Vector3::ZERO;
+        this->overwrite_orientation_ = Quaternion::IDENTITY;
+
+        this->registerVariables();
+    }
+
+    MovableEntity::~MovableEntity()
+    {
+    }
+
+    void MovableEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(MovableEntity, XMLPort, xmlelement, mode);
+
+        XMLPortParamTemplate(MovableEntity, "velocity", setVelocity, getVelocity, xmlelement, mode, const Vector3&);
+        XMLPortParamTemplate(MovableEntity, "rotationaxis", setRotationAxis, getRotationAxis, xmlelement, mode, const Vector3&);
+        XMLPortParamTemplate(MovableEntity, "rotationrate", setRotationRate, getRotationRate, xmlelement, mode, const Degree&);
+    }
+
+    void MovableEntity::tick(float dt)
+    {
+        if (this->isActive())
+        {
+            this->velocity_ += (dt * this->acceleration_);
+            this->node_->translate(dt * this->velocity_);
+
+            this->rotationRate_ += (dt * this->momentum_);
+            this->node_->rotate(this->rotationAxis_, this->rotationRate_  * dt);
+        }
+    }
+
+    void MovableEntity::registerVariables()
+    {
+        REGISTERDATA(this->velocity_.x, network::direction::toclient);
+        REGISTERDATA(this->velocity_.y, network::direction::toclient);
+        REGISTERDATA(this->velocity_.z, network::direction::toclient);
+
+        REGISTERDATA(this->rotationAxis_.x, network::direction::toclient);
+        REGISTERDATA(this->rotationAxis_.y, network::direction::toclient);
+        REGISTERDATA(this->rotationAxis_.z, network::direction::toclient);
+
+        REGISTERDATA(this->rotationRate_, network::direction::toclient);
+
+        REGISTERDATA(this->overwrite_position_,    network::direction::toclient, new network::NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
+        REGISTERDATA(this->overwrite_orientation_, network::direction::toclient, new network::NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
+    }
+
+    void MovableEntity::overwritePosition()
+    {
+        this->node_->setPosition(this->overwrite_position_);
+    }
+
+    void MovableEntity::overwriteOrientation()
+    {
+        this->node_->setOrientation(this->overwrite_orientation_);
+    }
+
+    void MovableEntity::clientConnected(unsigned int clientID)
+    {
+        new Timer<MovableEntity>(rnd() * MAX_RESYNCHRONIZE_TIME, false, this, createExecutor(createFunctor(&MovableEntity::resynchronize)), true);
+    }
+
+    void MovableEntity::clientDisconnected(unsigned int clientID)
+    {
+    }
+
+    void MovableEntity::resynchronize()
+    {
+        this->overwrite_position_ = this->getPosition();
+        this->overwrite_orientation_ = this->getOrientation();
+    }
+
+    void MovableEntity::setPosition(const Vector3& position)
+    {
+        this->node_->setPosition(position);
+        this->overwrite_position_ = this->node_->getPosition();
+    }
+
+    void MovableEntity::translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo)
+    {
+        this->node_->translate(distance, relativeTo);
+        this->overwrite_position_ = this->node_->getPosition();
+    }
+
+    void MovableEntity::setOrientation(const Quaternion& orientation)
+    {
+        this->node_->setOrientation(orientation);
+        this->overwrite_orientation_ = this->node_->getOrientation();
+    }
+
+    void MovableEntity::rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo)
+    {
+        this->node_->rotate(rotation, relativeTo);
+        this->overwrite_orientation_ = this->node_->getOrientation();
+    }
+
+    void MovableEntity::yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
+    {
+        this->node_->yaw(angle, relativeTo);
+        this->overwrite_orientation_ = this->node_->getOrientation();
+    }
+
+    void MovableEntity::pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
+    {
+        this->node_->pitch(angle, relativeTo);
+        this->overwrite_orientation_ = this->node_->getOrientation();
+    }
+
+    void MovableEntity::roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
+    {
+        this->node_->roll(angle, relativeTo);
+        this->overwrite_orientation_ = this->node_->getOrientation();
+    }
+
+    void MovableEntity::lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector)
+    {
+        this->node_->lookAt(target, relativeTo, localDirectionVector);
+        this->overwrite_orientation_ = this->node_->getOrientation();
+    }
+
+    void MovableEntity::setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector)
+    {
+        this->node_->setDirection(direction, relativeTo, localDirectionVector);
+        this->overwrite_orientation_ = this->node_->getOrientation();
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/MovableEntity.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/MovableEntity.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/MovableEntity.h	(revision 2087)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _MovableEntity_H__
+#define _MovableEntity_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "WorldEntity.h"
+#include "objects/Tickable.h"
+#include "network/ClientConnectionListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport MovableEntity : public WorldEntity, public Tickable, public network::ClientConnectionListener
+    {
+        public:
+            MovableEntity(BaseObject* creator);
+            virtual ~MovableEntity();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void tick(float dt);
+            void registerVariables();
+
+            using WorldEntity::setPosition;
+            using WorldEntity::translate;
+            using WorldEntity::setOrientation;
+            using WorldEntity::rotate;
+            using WorldEntity::yaw;
+            using WorldEntity::pitch;
+            using WorldEntity::roll;
+            using WorldEntity::lookAt;
+            using WorldEntity::setDirection;
+
+            void setPosition(const Vector3& position);
+            void translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
+            void setOrientation(const Quaternion& orientation);
+            void rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
+            void yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
+            void pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
+            void roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL);
+            void lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
+            void setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
+
+            inline void setVelocity(const Vector3& velocity)
+                { this->velocity_ = velocity; }
+            inline void setVelocity(float x, float y, float z)
+                { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; }
+            inline const Vector3& getVelocity() const
+                { return this->velocity_; }
+
+            inline void setAcceleration(const Vector3& acceleration)
+                { this->acceleration_ = acceleration; }
+            inline void setAcceleration(float x, float y, float z)
+                { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; }
+            inline const Vector3& getAcceleration() const
+                { return this->acceleration_; }
+
+            inline void setRotationAxis(const Vector3& axis)
+                { this->rotationAxis_ = axis; this->rotationAxis_.normalise(); }
+            inline void setRotationAxis(float x, float y, float z)
+                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; rotationAxis_.normalise(); }
+            inline const Vector3& getRotationAxis() const
+                { return this->rotationAxis_; }
+
+            inline void setRotationRate(const Degree& angle)
+                { this->rotationRate_ = angle; }
+            inline void setRotationRate(const Radian& angle)
+                { this->rotationRate_ = angle; }
+            inline const Degree& getRotationRate() const
+                { return this->rotationRate_; }
+
+            inline void setMomentum(const Degree& angle)
+                { this->momentum_ = angle; }
+            inline void setMomentum(const Radian& angle)
+                { this->momentum_ = angle; }
+            inline const Degree& getMomentum() const
+                { return this->momentum_; }
+
+        private:
+            void clientConnected(unsigned int clientID);
+            void clientDisconnected(unsigned int clientID);
+            void resynchronize();
+
+            void overwritePosition();
+            void overwriteOrientation();
+
+            Vector3 velocity_;
+            Vector3 acceleration_;
+            Vector3 rotationAxis_;
+            Degree rotationRate_;
+            Degree momentum_;
+
+            Vector3 overwrite_position_;
+            Quaternion overwrite_orientation_;
+    };
+}
+
+#endif /* _MovableEntity_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.cc	(revision 2087)
@@ -0,0 +1,125 @@
+/*
+ *   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 ParticleInterface.cc
+* @brief class to control praticle effects
+*/
+
+#include "OrxonoxStableHeaders.h"
+
+#include "ParticleEmitter.h"
+
+#include "tools/ParticleInterface.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(ParticleEmitter);
+
+    ParticleEmitter::ParticleEmitter(BaseObject* creator) : PositionableEntity(creator)
+    {
+        RegisterObject(ParticleEmitter);
+
+        assert(this->getScene());
+        assert(this->getScene()->getSceneManager());
+
+        this->particles_ = 0;
+        this->LOD_ = LODParticle::normal;
+
+        this->registerVariables();
+    }
+
+    ParticleEmitter::~ParticleEmitter()
+    {
+        if (this->isInitialized() && this->particles_)
+            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()
+    {
+        REGISTERSTRING(this->source_, network::direction::toclient, new network::NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
+        REGISTERDATA  (this->LOD_,    network::direction::toclient, new network::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_;
+
+        if (this->getScene() && this->getScene()->getSceneManager())
+        {
+            try
+            {
+                this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), this->source_, this->LOD_);
+                this->particles_->addToSceneNode(this->getNode());
+                this->particles_->setVisible(this->isVisible());
+                this->particles_->setEnabled(this->isActive());
+            }
+            catch (...)
+            {
+                COUT(1) << "Error: Couln't load particle effect \"" << this->source_ << "\"" << std::endl;
+                this->particles_ = 0;
+            }
+        }
+        else
+            this->particles_ = 0;
+    }
+
+    void ParticleEmitter::LODchanged()
+    {
+        if (this->particles_)
+            this->particles_->setDetailLevel(this->LOD_);
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/ParticleEmitter.h	(revision 2087)
@@ -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 _ParticleEmitter_H__
+#define _ParticleEmitter_H__
+
+#include "OrxonoxPrereqs.h"
+#include "PositionableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport ParticleEmitter : public PositionableEntity
+    {
+        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::LOD level)
+                { this->LOD_ = level; this->LODchanged(); }
+            inline LODParticle::LOD getLOD() const
+                { return this->LOD_; }
+
+        protected:
+            inline void setLODxml(unsigned int level)
+                { this->LOD_ = (LODParticle::LOD)level; this->LODchanged(); }
+            inline unsigned int getLODxml() const
+                { return (unsigned int)this->LOD_; }
+
+            void sourceChanged();
+            void LODchanged();
+
+            ParticleInterface* particles_;
+            std::string        source_;
+            LODParticle::LOD   LOD_;
+    };
+}
+
+#endif /* _ParticleEmitter_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.cc	(revision 2087)
@@ -0,0 +1,131 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#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);
+
+        SetEvent(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/objects/worldentities/ParticleSpawner.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/ParticleSpawner.h	(revision 2087)
@@ -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 "ParticleEmitter.h"
+#include "tools/Timer.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/objects/worldentities/PositionableEntity.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PositionableEntity.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/PositionableEntity.cc	(revision 2087)
@@ -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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "PositionableEntity.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(PositionableEntity);
+
+    PositionableEntity::PositionableEntity(BaseObject* creator) : WorldEntity(creator)
+    {
+        RegisterObject(PositionableEntity);
+
+        this->registerVariables();
+    }
+
+    PositionableEntity::~PositionableEntity()
+    {
+    }
+
+    void PositionableEntity::registerVariables()
+    {
+        REGISTERDATA(this->getPosition().x, network::direction::toclient);
+        REGISTERDATA(this->getPosition().y, network::direction::toclient);
+        REGISTERDATA(this->getPosition().z, network::direction::toclient);
+
+        REGISTERDATA(this->getOrientation().w, network::direction::toclient);
+        REGISTERDATA(this->getOrientation().x, network::direction::toclient);
+        REGISTERDATA(this->getOrientation().y, network::direction::toclient);
+        REGISTERDATA(this->getOrientation().z, network::direction::toclient);
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/PositionableEntity.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PositionableEntity.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/PositionableEntity.h	(revision 2087)
@@ -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 _PositionableEntity_H__
+#define _PositionableEntity_H__
+
+#include "OrxonoxPrereqs.h"
+#include "WorldEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport PositionableEntity : public WorldEntity
+    {
+        public:
+            PositionableEntity(BaseObject* creator);
+            virtual ~PositionableEntity();
+
+            void registerVariables();
+
+            using WorldEntity::setPosition;
+            using WorldEntity::translate;
+            using WorldEntity::setOrientation;
+            using WorldEntity::rotate;
+            using WorldEntity::yaw;
+            using WorldEntity::pitch;
+            using WorldEntity::roll;
+            using WorldEntity::lookAt;
+            using WorldEntity::setDirection;
+
+            inline void setPosition(const Vector3& position)
+                { this->node_->setPosition(position); }
+            inline void translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->node_->translate(distance, relativeTo); }
+            inline void setOrientation(const Quaternion& orientation)
+                { this->node_->setOrientation(orientation); }
+            inline void rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->node_->rotate(rotation, relativeTo); }
+            inline void yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->node_->yaw(angle, relativeTo); }
+            inline void pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->node_->pitch(angle, relativeTo); }
+            inline void roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->node_->roll(angle, relativeTo); }
+            inline void lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z)
+                { this->node_->lookAt(target, relativeTo, localDirectionVector); }
+            inline void setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z)
+                { this->node_->setDirection(direction, relativeTo, localDirectionVector); }
+    };
+}
+
+#endif /* _PositionableEntity_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/SpawnPoint.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/SpawnPoint.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/SpawnPoint.cc	(revision 2087)
@@ -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 "OrxonoxStableHeaders.h"
+#include "SpawnPoint.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/gametypes/Gametype.h"
+
+namespace orxonox
+{
+    CreateFactory(SpawnPoint);
+
+    SpawnPoint::SpawnPoint(BaseObject* creator) : PositionableEntity(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);
+    }
+
+    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->getPosition());
+        entity->setOrientation(this->getOrientation());
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/SpawnPoint.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/SpawnPoint.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/SpawnPoint.h	(revision 2087)
@@ -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:
+ *      ...
+ *
+ */
+
+#ifndef _SpawnPoint_H__
+#define _SpawnPoint_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/Identifier.h"
+#include "core/Template.h"
+#include "PositionableEntity.h"
+#include "objects/worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport SpawnPoint : public PositionableEntity
+    {
+        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_; }
+
+            inline void setTemplate(Template* temp)
+                { this->template_ = temp; this->templatename_ = temp->getName(); }
+            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/objects/worldentities/WorldEntity.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2087)
@@ -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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "WorldEntity.h"
+
+#include <cassert>
+#include <OgreSceneManager.h>
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+
+#include "objects/Scene.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;
+
+    WorldEntity::WorldEntity(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
+    {
+        RegisterObject(WorldEntity);
+
+        assert(this->getScene());
+        assert(this->getScene()->getRootSceneNode());
+
+        this->node_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
+
+        this->parent_ = 0;
+        this->parentID_ = (unsigned int)-1;
+
+        this->node_->setPosition(Vector3::ZERO);
+        this->node_->setOrientation(Quaternion::IDENTITY);
+
+        this->registerVariables();
+    }
+
+    WorldEntity::~WorldEntity()
+    {
+        if (this->isInitialized())
+        {
+            this->node_->detachAllObjects();
+            if (this->getScene()->getSceneManager())
+                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&);
+        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);
+        XMLPortParamTemplate(WorldEntity, "scale3D", setScale3D, getScale3D, xmlelement, mode, const Vector3&);
+        XMLPortParam(WorldEntity, "scale", setScale, getScale, xmlelement, mode);
+
+        XMLPortObject(WorldEntity, WorldEntity, "attached", attach, getAttachedObject, xmlelement, mode);
+    }
+
+    void WorldEntity::registerVariables()
+    {
+        REGISTERDATA(this->bActive_,  network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
+        REGISTERDATA(this->bVisible_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
+
+        REGISTERDATA(this->getScale3D().x, network::direction::toclient);
+        REGISTERDATA(this->getScale3D().y, network::direction::toclient);
+        REGISTERDATA(this->getScale3D().z, network::direction::toclient);
+
+        REGISTERDATA(this->parentID_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
+    }
+
+    void WorldEntity::updateParent()
+    {
+        WorldEntity* parent = dynamic_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_));
+        if (parent)
+            this->attachToParent(parent);
+    }
+
+    void WorldEntity::attach(WorldEntity* object)
+    {
+        if (object->getParent())
+            object->detachFromParent();
+        else
+        {
+            Ogre::Node* parent = object->node_->getParent();
+            if (parent)
+                parent->removeChild(object->node_);
+        }
+
+        this->node_->addChild(object->node_);
+        this->children_.insert(object);
+        object->parent_ = this;
+        object->parentID_ = this->getObjectID();
+    }
+
+    void WorldEntity::detach(WorldEntity* object)
+    {
+        this->node_->removeChild(object->node_);
+        this->children_.erase(object);
+        object->parent_ = 0;
+        object->parentID_ = (unsigned int)-1;
+
+//        this->getScene()->getRootSceneNode()->addChild(object->node_);
+    }
+
+    WorldEntity* WorldEntity::getAttachedObject(unsigned int index) const
+    {
+        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;
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/WorldEntity.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2087)
@@ -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:
+ *      ...
+ *
+ */
+
+#ifndef _WorldEntity_H__
+#define _WorldEntity_H__
+
+#include "OrxonoxPrereqs.h"
+
+#define OGRE_FORCE_ANGLE_TYPES
+
+#include <OgreSceneNode.h>
+
+#include "network/Synchronisable.h"
+#include "core/BaseObject.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport WorldEntity : public BaseObject, public network::Synchronisable
+    {
+        public:
+            WorldEntity(BaseObject* creator);
+            virtual ~WorldEntity();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            inline 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)); }
+            inline const Vector3& getPosition() const
+                { return this->node_->getPosition(); }
+            inline const Vector3& getWorldPosition() const
+                { return this->node_->getWorldPosition(); }
+
+            virtual void translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL) = 0;
+            inline void translate(float x, float y, float z, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->translate(Vector3(x, y, z), relativeTo); }
+
+            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)); }
+            inline const Quaternion& getOrientation() const
+                { return this->node_->getOrientation(); }
+            inline const Quaternion& getWorldOrientation() const
+                { return this->node_->getWorldOrientation(); }
+
+            virtual void rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL) = 0;
+            inline void rotate(const Vector3& axis, const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->rotate(Quaternion(angle, axis), relativeTo); }
+            inline void rotate(const Vector3& axis, const Radian& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->rotate(Quaternion(angle, axis), relativeTo); }
+
+            virtual void yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL) = 0;
+            inline void yaw(const Radian& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->yaw(Degree(angle), relativeTo); }
+            virtual void pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL) = 0;
+            inline void pitch(const Radian& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->pitch(Degree(angle), relativeTo); }
+            virtual void roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL) = 0;
+            inline void roll(const Radian& angle, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL)
+                { this->roll(Degree(angle), relativeTo); }
+
+            virtual void lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z) = 0;
+            virtual void setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z) = 0;
+            inline void setDirection(float x, float y, float z, Ogre::Node::TransformSpace relativeTo = Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z)
+                { this->setDirection(Vector3(x, y, z), relativeTo, localDirectionVector); }
+
+            inline void setScale3D(const Vector3& scale)
+                { this->node_->setScale(scale); }
+            inline void setScale3D(float x, float y, float z)
+                { this->node_->setScale(x, y, z); }
+            inline const Vector3& getScale3D(void) const
+                { return this->node_->getScale(); }
+
+            inline void setScale(float scale)
+                { this->node_->setScale(scale, scale, scale); }
+            inline float getScale() const
+                { Vector3 scale = this->getScale3D(); return (scale.x == scale.y && scale.x == scale.z) ? scale.x : 1; }
+
+            inline void scale3D(const Vector3& scale)
+                { this->node_->scale(scale); }
+            inline void scale3D(float x, float y, float z)
+                { this->node_->scale(x, y, z); }
+            inline void scale(float scale)
+                { this->node_->scale(scale, scale, scale); }
+
+            void attach(WorldEntity* object);
+            void detach(WorldEntity* object);
+            WorldEntity* getAttachedObject(unsigned int index) const;
+            inline const std::set<WorldEntity*>& getAttachedObjects() const
+                { return this->children_; }
+
+            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_; }
+
+        protected:
+            Ogre::SceneNode* node_;
+
+        private:
+            void updateParent();
+
+            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); }
+
+            WorldEntity* parent_;
+            unsigned int parentID_;
+            std::set<WorldEntity*> children_;
+    };
+}
+
+#endif /* _WorldEntity_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 2087)
@@ -0,0 +1,134 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Pawn.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Math.h"
+#include "objects/infos/PlayerInfo.h"
+#include "objects/gametypes/Gametype.h"
+
+namespace orxonox
+{
+    CreateFactory(Pawn);
+
+    Pawn::Pawn(BaseObject* creator) : ControllableEntity(creator)
+    {
+        RegisterObject(Pawn);
+
+        this->bAlive_ = false;
+
+        this->health_ = 0;
+        this->maxHealth_ = 0;
+        this->initialHealth_ = 0;
+
+        this->lastHitOriginator_ = 0;
+
+        this->registerVariables();
+    }
+
+    Pawn::~Pawn()
+    {
+    }
+
+    void Pawn::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Pawn, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Pawn, "health", setHealth, getHealht, xmlelement, mode).defaultValues(100);
+        XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
+        XMLPortParam(Pawn, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
+    }
+
+    void Pawn::registerVariables()
+    {
+        REGISTERDATA(this->bAlive_, network::direction::toclient);
+        REGISTERDATA(this->health_, network::direction::toclient);
+    }
+
+    void Pawn::tick(float dt)
+    {
+        SUPER(Pawn, tick, dt);
+
+        if (this->health_ <= 0)
+            this->death();
+    }
+
+    void Pawn::setHealth(float health)
+    {
+        this->health_ = min(health, this->maxHealth_);
+    }
+
+    void Pawn::damage(float damage, Pawn* originator)
+    {
+        this->setHealth(this->health_ - damage);
+        this->lastHitOriginator_ = originator;
+
+        // play damage effect
+    }
+
+    void Pawn::hit(Pawn* originator, const Vector3& force, float damage)
+    {
+        this->damage(damage, originator);
+        this->setVelocity(this->getVelocity() + force);
+
+        // play hit effect
+    }
+
+    void Pawn::kill()
+    {
+        this->damage(this->health_);
+        this->death();
+    }
+
+    void Pawn::spawn()
+    {
+        // play spawn effect
+    }
+
+    void Pawn::death()
+    {
+        this->bAlive_ = false;
+        if (this->getGametype())
+            this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
+        if (this->getPlayer())
+            this->getPlayer()->stopControl(this);
+
+        delete this;
+
+        // play death effect
+    }
+
+    void Pawn::postSpawn()
+    {
+        this->setHealth(this->initialHealth_);
+        this->spawn();
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 2087)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Pawn_H__
+#define _Pawn_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Pawn : public ControllableEntity
+    {
+        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 getHealht() 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 postSpawn();
+
+        protected:
+            virtual void spawn();
+            virtual void death();
+
+            bool bAlive_;
+
+            float health_;
+            float maxHealth_;
+            float initialHealth_;
+
+            Pawn* lastHitOriginator_;
+    };
+}
+
+#endif /* _Pawn_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.cc	(revision 2087)
@@ -0,0 +1,213 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "SpaceShip.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    CreateFactory(SpaceShip);
+
+    SpaceShip::SpaceShip(BaseObject* creator) : Pawn(creator)
+    {
+        RegisterObject(SpaceShip);
+
+        this->zeroDegree_ = 0;
+
+        this->maxSpeed_ = 0;
+        this->maxSecondarySpeed_ = 0;
+        this->maxRotation_ = 0;
+        this->translationAcceleration_ = 0;
+        this->rotationAcceleration_ = 0;
+        this->translationDamping_ = 0;
+
+        this->yawRotation_ = 0;
+        this->pitchRotation_ = 0;
+        this->rollRotation_ = 0;
+
+        this->bInvertYAxis_ = false;
+
+        this->setDestroyWhenPlayerLeft(true);
+
+        this->setConfigValues();
+        this->registerVariables();
+    }
+
+    SpaceShip::~SpaceShip()
+    {
+    }
+
+    void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(SpaceShip, XMLPort, xmlelement, mode);
+
+        XMLPortParam(SpaceShip, "maxspeed",          setMaxSpeed,          getMaxSpeed,          xmlelement, mode);
+        XMLPortParam(SpaceShip, "maxsecondaryspeed", setMaxSecondarySpeed, getMaxSecondarySpeed, xmlelement, mode);
+        XMLPortParam(SpaceShip, "maxrotation",       setMaxRotation,       getMaxRotation,       xmlelement, mode);
+        XMLPortParam(SpaceShip, "transacc",          setTransAcc,          getTransAcc,          xmlelement, mode);
+        XMLPortParam(SpaceShip, "rotacc",            setRotAcc,            getRotAcc,            xmlelement, mode);
+        XMLPortParam(SpaceShip, "transdamp",         setTransDamp,         getTransDamp,         xmlelement, mode);
+    }
+
+    void SpaceShip::registerVariables()
+    {
+        REGISTERDATA(this->maxSpeed_,                network::direction::toclient);
+        REGISTERDATA(this->maxSecondarySpeed_,       network::direction::toclient);
+        REGISTERDATA(this->maxRotation_,             network::direction::toclient);
+        REGISTERDATA(this->translationAcceleration_, network::direction::toclient);
+        REGISTERDATA(this->rotationAcceleration_,    network::direction::toclient);
+        REGISTERDATA(this->translationDamping_,      network::direction::toclient);
+    }
+
+    void SpaceShip::setConfigValues()
+    {
+        SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
+    }
+
+    void SpaceShip::tick(float dt)
+    {
+        if (this->isLocallyControlled())
+        {
+            // #####################################
+            // ############# STEERING ##############
+            // #####################################
+
+            Vector3 velocity = this->getVelocity();
+            if (velocity.x > this->maxSecondarySpeed_)
+                velocity.x = this->maxSecondarySpeed_;
+            if (velocity.x < -this->maxSecondarySpeed_)
+                velocity.x = -this->maxSecondarySpeed_;
+            if (velocity.y > this->maxSecondarySpeed_)
+                velocity.y = this->maxSecondarySpeed_;
+            if (velocity.y < -this->maxSecondarySpeed_)
+                velocity.y = -this->maxSecondarySpeed_;
+            if (velocity.z > this->maxSecondarySpeed_)
+                velocity.z = this->maxSecondarySpeed_;
+            if (velocity.z < -this->maxSpeed_)
+                velocity.z = -this->maxSpeed_;
+
+            // normalize velocity and acceleration
+            for (size_t dimension = 0; dimension < 3; ++dimension)
+            {
+                if (this->acceleration_[dimension] == 0)
+                {
+                    if (velocity[dimension] > 0)
+                    {
+                        velocity[dimension] -= (this->translationDamping_ * dt);
+                        if (velocity[dimension] < 0)
+                            velocity[dimension] = 0;
+                    }
+                    else if (velocity[dimension] < 0)
+                    {
+                        velocity[dimension] += (this->translationDamping_ * dt);
+                        if (velocity[dimension] > 0)
+                            velocity[dimension] = 0;
+                    }
+                }
+            }
+
+            this->setVelocity(velocity);
+        }
+
+
+        SUPER(SpaceShip, tick, dt);
+
+
+        if (this->isLocallyControlled())
+        {
+            this->yaw(this->yawRotation_ * dt);
+            if (this->bInvertYAxis_)
+                this->pitch(Degree(-this->pitchRotation_ * dt));
+            else
+                this->pitch(Degree( this->pitchRotation_ * dt));
+            this->roll(this->rollRotation_ * dt);
+
+            this->acceleration_.x = 0;
+            this->acceleration_.y = 0;
+            this->acceleration_.z = 0;
+
+            this->yawRotation_   = this->zeroDegree_;
+            this->pitchRotation_ = this->zeroDegree_;
+            this->rollRotation_  = this->zeroDegree_;
+        }
+    }
+
+    void SpaceShip::moveFrontBack(const Vector2& value)
+    {
+        this->acceleration_.z = -this->translationAcceleration_ * value.x;
+    }
+
+    void SpaceShip::moveRightLeft(const Vector2& value)
+    {
+        this->acceleration_.x = this->translationAcceleration_ * value.x;
+    }
+
+    void SpaceShip::moveUpDown(const Vector2& value)
+    {
+        this->acceleration_.y = this->translationAcceleration_ * value.x;
+    }
+
+    void SpaceShip::rotateYaw(const Vector2& value)
+    {
+        Degree temp = value.x * value.x * sgn(value.x) * this->rotationAcceleration_;
+        if (temp > this->maxRotation_)
+            temp = this->maxRotation_;
+        if (temp < -this->maxRotation_)
+            temp = -this->maxRotation_;
+        this->yawRotation_ = Degree(temp);
+    }
+
+    void SpaceShip::rotatePitch(const Vector2& value)
+    {
+        Degree temp = value.x * value.x * sgn(value.x) * this->rotationAcceleration_;
+        if (temp > this->maxRotation_)
+            temp = this->maxRotation_;
+        if (temp < -this->maxRotation_)
+            temp = -this->maxRotation_;
+        this->pitchRotation_ = Degree(temp);
+    }
+
+    void SpaceShip::rotateRoll(const Vector2& value)
+    {
+        Degree temp = value.x * value.x * sgn(value.x) * this->rotationAcceleration_;
+        if (temp > this->maxRotation_)
+            temp = this->maxRotation_;
+        if (temp < -this->maxRotation_)
+            temp = -this->maxRotation_;
+        this->rollRotation_ = Degree(temp);
+    }
+
+    void SpaceShip::fire()
+    {
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.h	(revision 2087)
@@ -0,0 +1,103 @@
+/*
+ *   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 "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();
+
+            void setMaxSpeed(float value)
+                { this->maxSpeed_ = value; }
+            void setMaxSecondarySpeed(float value)
+                { this->maxSecondarySpeed_ = value; }
+            void setMaxRotation(const Degree& value)
+                { this->maxRotation_ = value; }
+            void setTransAcc(float value)
+                { this->translationAcceleration_ = value; }
+            void setRotAcc(const Degree& value)
+                { this->rotationAcceleration_ = value; }
+            void setTransDamp(float value)
+                { this->translationDamping_ = value; }
+
+            inline float getMaxSpeed() const
+                { return this->maxSpeed_; }
+            inline float getMaxSecondarySpeed() const
+                { return this->maxSecondarySpeed_; }
+            inline float getMaxRotation() const
+                { return this->maxRotation_.valueDegrees(); }
+            inline float getTransAcc() const
+                { return this->translationAcceleration_; }
+            inline float getRotAcc() const
+                { return this->rotationAcceleration_.valueDegrees(); }
+            inline float getTransDamp() const
+                { return this->translationDamping_; }
+
+        protected:
+            bool bInvertYAxis_;
+
+            float maxSpeed_;
+            float maxSecondarySpeed_;
+            float translationAcceleration_;
+            float translationDamping_;
+
+            Degree maxRotation_;
+            Degree rotationAcceleration_;
+
+            Degree zeroDegree_;
+            Degree pitchRotation_;
+            Degree yawRotation_;
+            Degree rollRotation_;
+    };
+}
+
+#endif /* _SpaceShip_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.cc	(revision 2087)
@@ -0,0 +1,255 @@
+/*
+ *   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 "OrxonoxStableHeaders.h"
+#include "Spectator.h"
+
+#include "core/CoreIncludes.h"
+#include "core/Core.h"
+#include "objects/worldentities/Model.h"
+#include "objects/Scene.h"
+#include "objects/infos/PlayerInfo.h"
+#include "objects/gametypes/Gametype.h"
+#include "tools/BillboardSet.h"
+#include "overlays/OverlayText.h"
+#include "overlays/OverlayGroup.h"
+#include "util/Convert.h"
+
+namespace orxonox
+{
+    CreateFactory(Spectator);
+
+    Spectator::Spectator(BaseObject* creator) : ControllableEntity(creator)
+    {
+        RegisterObject(Spectator);
+
+        this->speed_ = 100;
+        this->rotationSpeed_ = 3;
+
+        this->yaw_ = 0;
+        this->pitch_ = 0;
+        this->roll_ = 0;
+        this->setHudTemplate("spectatorhud");
+        this->hudmode_ = 0;
+
+        this->setDestroyWhenPlayerLeft(true);
+
+        this->greetingFlare_ = new BillboardSet();
+        this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 20, 0), 1);
+        this->getNode()->attachObject(this->greetingFlare_->getBillboardSet());
+        this->greetingFlare_->setVisible(false);
+        this->bGreetingFlareVisible_ = false;
+        this->bGreeting_ = false;
+
+        this->registerVariables();
+    }
+
+    Spectator::~Spectator()
+    {
+        if (this->isInitialized())
+        {
+            if (this->greetingFlare_)
+            {
+                this->getNode()->detachObject(this->greetingFlare_->getBillboardSet());
+                delete this->greetingFlare_;
+            }
+        }
+    }
+
+    void Spectator::registerVariables()
+    {
+        REGISTERDATA(this->bGreetingFlareVisible_, network::direction::toclient, new network::NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
+        REGISTERDATA(this->bGreeting_,             network::direction::toserver, new network::NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
+        REGISTERDATA(this->hudmode_,               network::direction::toclient);
+    }
+
+    void Spectator::changedGreeting()
+    {
+        this->bGreetingFlareVisible_ = this->bGreeting_;
+        this->changedFlareVisibility();
+    }
+
+    void Spectator::changedFlareVisibility()
+    {
+        this->greetingFlare_->setVisible(this->bGreetingFlareVisible_);
+    }
+
+    void Spectator::tick(float dt)
+    {
+        this->updateHUD();
+
+        if (this->isLocallyControlled())
+        {
+            Vector3 velocity = this->getVelocity();
+            velocity.normalise();
+            this->setVelocity(velocity * this->speed_);
+
+            this->yaw(Radian(this->yaw_ * this->rotationSpeed_));
+            this->pitch(Radian(this->pitch_ * this->rotationSpeed_));
+            this->roll(Radian(this->roll_ * this->rotationSpeed_));
+
+            this->yaw_ = this->pitch_ = this->roll_ = 0;
+        }
+
+        SUPER(Spectator, tick, dt);
+
+        if (this->isLocallyControlled())
+        {
+            this->setVelocity(Vector3::ZERO);
+        }
+    }
+
+    void Spectator::setPlayer(PlayerInfo* player)
+    {
+        ControllableEntity::setPlayer(player);
+
+//        this->setObjectMode(network::direction::toclient);
+    }
+
+    void Spectator::startLocalControl()
+    {
+        ControllableEntity::startLocalControl();
+//        if (this->isLocallyControlled())
+//            this->testmesh_->setVisible(false);
+    }
+
+    void Spectator::moveFrontBack(const Vector2& value)
+    {
+        this->setVelocity(this->getVelocity() + value.y * this->speed_ * WorldEntity::FRONT);
+    }
+
+    void Spectator::moveRightLeft(const Vector2& value)
+    {
+        this->setVelocity(this->getVelocity() + value.y * this->speed_ * WorldEntity::RIGHT);
+    }
+
+    void Spectator::moveUpDown(const Vector2& value)
+    {
+        this->setVelocity(this->getVelocity() + value.y * this->speed_ * WorldEntity::UP);
+    }
+
+    void Spectator::rotateYaw(const Vector2& value)
+    {
+        this->yaw_ = value.y;
+    }
+
+    void Spectator::rotatePitch(const Vector2& value)
+    {
+        this->pitch_ = value.y;
+    }
+
+    void Spectator::rotateRoll(const Vector2& value)
+    {
+        this->roll_ = value.y;
+    }
+
+    void Spectator::fire()
+    {
+        if (this->getPlayer())
+            this->getPlayer()->setReadyToSpawn(true);
+    }
+
+    void Spectator::greet()
+    {
+        this->bGreeting_ = !this->bGreeting_;
+
+        if (Core::isMaster())
+        {
+            this->bGreetingFlareVisible_ = this->bGreeting_;
+            this->changedFlareVisibility();
+        }
+    }
+
+    void Spectator::updateHUD()
+    {
+        // <hack>
+        if (Core::isMaster())
+        {
+            if (this->getPlayer() && this->getGametype())
+            {
+                if (!this->getGametype()->hasStarted() && !this->getGametype()->isStartCountdownRunning())
+                {
+                    if (!this->getPlayer()->isReadyToSpawn())
+                        this->hudmode_ = 0;
+                    else
+                        this->hudmode_ = 1;
+                }
+                else if (!this->getGametype()->hasEnded())
+                {
+                    if (this->getGametype()->isStartCountdownRunning())
+                        this->hudmode_ = 2 + 10*ceil(this->getGametype()->getStartCountdown());
+                    else
+                        this->hudmode_ = 3;
+                }
+                else
+                    this->hudmode_ = 4;
+            }
+            else
+                return;
+        }
+
+        if (this->getHUD())
+        {
+            std::string text;
+            int hudmode = this->hudmode_ % 10;
+
+            switch (hudmode)
+            {
+                case 0:
+                    text = "Press [Fire] to start the match";
+                    break;
+                case 1:
+                    text = "Waiting for other players";
+                    break;
+                case 2:
+                    text = convertToString((this->hudmode_ - 2) / 10);
+                    break;
+                case 3:
+                    text = "Press [Fire] to respawn";
+                    break;
+                case 4:
+                    text = "Game has ended";
+                    break;
+                default:;
+            }
+
+            std::map<std::string, OrxonoxOverlay*>::const_iterator it = this->getHUD()->getOverlays().begin();
+            for (; it != this->getHUD()->getOverlays().end(); ++it)
+            {
+                if (it->second->isA(Class(OverlayText)) && it->second->getName() == "state")
+                {
+                    OverlayText* overlay = dynamic_cast<OverlayText*>(it->second);
+                    if (overlay)
+                        overlay->setCaption(text);
+                    break;
+                }
+            }
+        }
+        // </hack>
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/Spectator.h	(revision 2087)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Spectator_H__
+#define _Spectator_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Spectator : public ControllableEntity
+    {
+        public:
+            Spectator(BaseObject* creator);
+            virtual ~Spectator();
+
+            void registerVariables();
+            virtual void tick(float dt);
+
+            virtual void setPlayer(PlayerInfo* player);
+            virtual void startLocalControl();
+
+            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 greet();
+
+        private:
+            void changedGreeting();
+            void changedFlareVisibility();
+            void updateHUD();
+
+            BillboardSet* greetingFlare_;
+            bool bGreetingFlareVisible_;
+            bool bGreeting_;
+
+            float speed_;
+            float rotationSpeed_;
+
+            float yaw_;
+            float pitch_;
+            float roll_;
+
+            int hudmode_;
+    };
+}
+
+#endif /* _Spectator_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc	(revision 2087)
@@ -0,0 +1,132 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "DistanceTrigger.h"
+
+#include <OgreNode.h>
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+  CreateFactory(DistanceTrigger);
+
+  DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator)
+  {
+    RegisterObject(DistanceTrigger);
+
+    this->distance_ = 100;
+    this->targetMask_.exclude(Class(BaseObject));
+  }
+
+  DistanceTrigger::~DistanceTrigger()
+  {
+  }
+
+  void DistanceTrigger::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+  {
+    SUPER(DistanceTrigger, XMLPort, xmlelement, mode);
+
+    XMLPortParam(DistanceTrigger, "distance", setDistance, getDistance, xmlelement, mode).defaultValues(100.0f);
+    XMLPortParamLoadOnly(DistanceTrigger, "target", addTargets, xmlelement, mode).defaultValues("ControllableEntity");
+  }
+
+  void DistanceTrigger::addTarget(Ogre::Node* targetNode)
+  {
+    this->targetSet_.insert(targetNode);
+  }
+
+  void DistanceTrigger::removeTarget(Ogre::Node* targetNode)
+  {
+    int returnval = this->targetSet_.erase(targetNode);
+    if (returnval == 0)
+    {
+      COUT(2) << "Warning: Node " << targetNode << " did not exist in targetSet of trigger " << this << " !" << std::endl;
+      COUT(4) << "Content of targetSet of trigger " << this << " :" << std::endl;
+      std::set<Ogre::Node*>::iterator it;
+      for (it = this->targetSet_.begin(); it != this->targetSet_.end(); ++it)
+      {
+        COUT(4) << *it << std::endl;
+      }
+      COUT(4) << "End of targetSet of trigger " << this << std::endl;
+    }
+  }
+
+  void DistanceTrigger::addTargets(const std::string& targets)
+  {
+    Identifier* targetId = ClassByString(targets);
+    if (!targetId)
+    {
+        COUT(1) << "Error: \"" << targets << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << std::endl;
+        return;
+    }
+
+    this->targetMask_.include(targetId);
+
+    // trigger shouldn't react on itself or other triggers
+    this->targetMask_.exclude(Class(Trigger), true);
+
+    // we only want WorldEntities
+    ClassTreeMask WEMask;
+    WEMask.include(Class(WorldEntity));
+    this->targetMask_ *= WEMask;
+  }
+
+  void DistanceTrigger::removeTargets(const std::string& targets)
+  {
+    Identifier* targetId = ClassByString(targets);
+    this->targetMask_.exclude(targetId);
+  }
+
+  bool DistanceTrigger::checkDistance()
+  {
+    // Iterate through all objects
+    for (ClassTreeMaskObjectIterator it = this->targetMask_.begin(); it != this->targetMask_.end(); ++it)
+    {
+      WorldEntity* entity = dynamic_cast<WorldEntity*>(*it);
+      if (!entity)
+        continue;
+
+      Vector3 distanceVec = entity->getWorldPosition() - this->getWorldPosition();
+      if (distanceVec.length() < this->distance_)
+        return true;
+    }
+    return false;
+
+  }
+
+  bool DistanceTrigger::isTriggered(TriggerMode mode)
+  {
+    if (Trigger::isTriggered(mode))
+      return checkDistance();
+    else
+      return false;
+  }
+}
Index: code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h	(revision 2087)
@@ -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:
+ *      Benjamin Knecht
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _DistanceTrigger_H__
+#define _DistanceTrigger_H__
+
+#include "Trigger.h"
+
+#include <set>
+
+#include "core/ClassTreeMask.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+  class _OrxonoxExport DistanceTrigger : public Trigger
+  {
+    public:
+      DistanceTrigger(BaseObject* creator);
+      virtual ~DistanceTrigger();
+
+      virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+      void addTarget(Ogre::Node* targetNode);
+      void addTargets(const std::string& targets);
+      void removeTarget(Ogre::Node* targetNode);
+      void removeTargets(const std::string& targets);
+
+      inline void setDistance(float distance)
+        { this->distance_ = distance; }
+      inline float getDistance() const
+        { return this->distance_; }
+
+      bool checkDistance();
+
+    protected:
+      virtual bool isTriggered(TriggerMode mode);
+
+    private:
+      ClassTreeMask targetMask_;
+      std::set<Ogre::Node*> targetSet_;
+      float distance_;
+  };
+}
+
+#endif /* _DistanceTrigger_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/triggers/EventTrigger.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/triggers/EventTrigger.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/triggers/EventTrigger.cc	(revision 2087)
@@ -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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "EventTrigger.h"
+
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+
+namespace orxonox
+{
+    CreateFactory(EventTrigger);
+
+    EventTrigger::EventTrigger(BaseObject* creator) : Trigger(creator)
+    {
+        RegisterObject(EventTrigger);
+
+        this->bEventTriggered_ = false;
+    }
+
+    EventTrigger::~EventTrigger()
+    {
+    }
+
+    void EventTrigger::processEvent(Event& event)
+    {
+        SUPER(EventTrigger, processEvent, event);
+
+        SetEvent(EventTrigger, "trigger", trigger, event);
+    }
+
+    bool EventTrigger::isTriggered(TriggerMode mode)
+    {
+        if (Trigger::isTriggered(mode))
+            return this->bEventTriggered_;
+        else
+            return false;
+    }
+}
Index: code/trunk/src/orxonox/objects/worldentities/triggers/EventTrigger.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/triggers/EventTrigger.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/triggers/EventTrigger.h	(revision 2087)
@@ -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:
+ *      ...
+ *
+ */
+
+#ifndef _EventTrigger_H__
+#define _EventTrigger_H__
+
+#include "Trigger.h"
+
+#include "core/ClassTreeMask.h"
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport EventTrigger : public Trigger
+    {
+        public:
+            EventTrigger(BaseObject* creator);
+            virtual ~EventTrigger();
+
+            virtual void processEvent(Event& event);
+
+            inline void trigger(bool bTriggered)
+                { this->bEventTriggered_ = bTriggered; this->tick(0); }
+
+        protected:
+            virtual bool isTriggered(TriggerMode mode);
+
+        private:
+            bool bEventTriggered_;
+    };
+}
+
+#endif /* _EventTrigger_H__ */
Index: code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.cc	(revision 2087)
@@ -0,0 +1,321 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Trigger.h"
+
+#include <OgreBillboard.h>
+#include "util/Debug.h"
+#include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "core/XMLPort.h"
+#include "objects/Scene.h"
+
+namespace orxonox
+{
+
+  SetConsoleCommand(Trigger, debugFlares, false).defaultValues(false);
+
+  CreateFactory(Trigger);
+
+  Trigger::Trigger(BaseObject* creator) : PositionableEntity(creator)
+  {
+    RegisterObject(Trigger);
+
+    this->mode_ = TM_EventTriggerAND;
+
+    this->bFirstTick_ = true;
+    this->bActive_ = false;
+    this->bTriggered_ = false;
+    this->latestState_ = 0x0;
+
+    this->bInvertMode_ = false;
+    this->bSwitch_ = false;
+    this->bStayActive_ = false;
+    this->delay_ = 0.0f;
+    this->remainingTime_ = 0.0f;
+    this->timeSinceLastEvent_ = 0.0f;
+    this->remainingActivations_ = -1;
+
+//    this->bUpdating_ = false;
+
+    if (this->getScene() && this->getScene()->getSceneManager())
+    {
+      this->debugBillboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
+      this->debugBillboard_.setVisible(false);
+    }
+
+    this->getNode()->attachObject(this->debugBillboard_.getBillboardSet());
+    this->setObjectMode(0x0);
+  }
+
+  Trigger::~Trigger()
+  {
+  }
+
+  void Trigger::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+  {
+    SUPER(Trigger, XMLPort, xmlelement, mode);
+
+    XMLPortParam(Trigger, "delay",       setDelay,       getDelay,       xmlelement, mode).defaultValues(0.0f);
+    XMLPortParam(Trigger, "switch",      setSwitch,      getSwitch,      xmlelement, mode).defaultValues(false);
+    XMLPortParam(Trigger, "stayactive",  setStayActive,  getStayActive,  xmlelement, mode).defaultValues(false);
+    XMLPortParam(Trigger, "activations", setActivations, getActivations, xmlelement, mode).defaultValues(-1);
+    XMLPortParam(Trigger, "invert",      setInvert,      getInvert,      xmlelement, mode).defaultValues(false);
+    XMLPortParamTemplate(Trigger, "mode", setMode, getModeString, xmlelement, mode, const std::string&).defaultValues("or");
+
+    XMLPortObject(Trigger, Trigger, "", addTrigger, getTrigger, xmlelement, mode);
+  }
+
+  void Trigger::tick(float dt)
+  {
+    if (this->bFirstTick_)
+    {
+      this->bFirstTick_ = false;
+      this->fireEvent(false);
+    }
+
+    // Check if the object is active (this is NOT Trigger::isActive()!)
+    if (!this->BaseObject::isActive())
+        return;
+
+    bool newTriggered = this->isTriggered() ^ this->bInvertMode_;
+
+    // check if new triggering event is really new
+    if ((this->latestState_ & 0x1) != newTriggered)
+    {
+      // create new state
+      if (newTriggered)
+      {
+        this->latestState_ |= 1; // set trigger bit to 1
+        this->switchState();
+      }
+      else
+      {
+        this->latestState_ &= 0xFE; // set trigger bit to 0
+        if (!this->bSwitch_)
+          this->switchState();
+      }
+    }
+
+    if (this->remainingTime_ > 0.0)
+    {
+      this->remainingTime_ -= dt;
+      // only increase when acctually waiting for a state in the queue
+      if (this->timeSinceLastEvent_ >= 0.0)
+        this->timeSinceLastEvent_ += dt;
+    }
+
+    while (this->remainingTime_ <= 0.0 && this->stateChanges_.size() > 0)
+    {
+      // time ran out, change state to new one
+      char newState = this->stateChanges_.front().second;
+      this->bTriggered_ = (newState & 0x1);
+      this->bActive_ = newState & 2;
+      this->fireEvent(this->bActive_);
+      this->stateChanges_.pop();
+      if (this->stateChanges_.size() != 0)
+        this->remainingTime_ = this->stateChanges_.front().first;
+      else
+        this->timeSinceLastEvent_ = this->delay_;
+    }
+
+    if (this->bTriggered_ && this->bActive_)
+      this->setBillboardColour(ColourValue(0.5, 1.0, 0.0));
+    else if (!this->bTriggered_ && this->bActive_)
+      this->setBillboardColour(ColourValue(0.0, 1.0, 0.0));
+    else if (this->bTriggered_ && !this->bActive_)
+      this->setBillboardColour(ColourValue(1.0, 0.5, 0.0));
+    else
+      this->setBillboardColour(ColourValue(1.0, 0.0, 0.0));
+  }
+
+  bool Trigger::isTriggered(TriggerMode mode)
+  {
+//    if (this->bUpdating_)
+//      return this->bTriggered_;
+
+//    this->bUpdating_ = true;
+    if (this->children_.size() != 0)
+    {
+      bool returnval = false;
+
+      switch (mode)
+      {
+        case TM_EventTriggerAND:
+          returnval = checkAnd();
+          break;
+        case TM_EventTriggerOR:
+          returnval = checkOr();
+          break;
+        case TM_EventTriggerXOR:
+          returnval = checkXor();
+          break;
+        default:
+          returnval = false;
+          break;
+      }
+//      this->bUpdating_ = false;
+
+      return returnval;
+    }
+    return true;
+  }
+
+  bool Trigger::checkAnd()
+  {
+    std::set<Trigger*>::iterator it;
+    for(it = this->children_.begin(); it != this->children_.end(); ++it)
+    {
+      if (!(*it)->isActive())
+        return false;
+    }
+    return true;
+  }
+
+  bool Trigger::checkOr()
+  {
+    std::set<Trigger*>::iterator it;
+    for(it = this->children_.begin(); it != this->children_.end(); ++it)
+    {
+      if ((*it)->isActive())
+        return true;
+    }
+    return false;
+  }
+
+  bool Trigger::checkXor()
+  {
+    std::set<Trigger*>::iterator it;
+    bool test = false;
+    for(it = this->children_.begin(); it != this->children_.end(); ++it)
+    {
+      if (test && (*it)->isActive())
+        return false;
+      if ((*it)->isActive())
+        test = true;
+    }
+    return test;
+  }
+
+  bool Trigger::switchState()
+  {
+    if (( (this->latestState_ & 2) && this->bStayActive_ && (this->remainingActivations_ <= 0))
+     || (!(this->latestState_ & 2))                      && (this->remainingActivations_ == 0))
+      return false;
+    else
+    {
+      this->latestState_ ^= 2; // toggle state bit
+
+      // increase activation count
+      if (this->latestState_ & 2 && this->remainingActivations_ > 0)
+        this->remainingActivations_--;
+
+      this->storeState();
+
+      return true;
+    }
+  }
+
+  void Trigger::storeState()
+  {
+    // put state change into queue
+    this->stateChanges_.push(std::pair<float, char>(this->timeSinceLastEvent_, this->latestState_));
+    // reset time since last event
+    this->timeSinceLastEvent_ = 0.0;
+
+    if (this->stateChanges_.size() == 1)
+      this->remainingTime_ = this->stateChanges_.front().first;
+  }
+
+  void Trigger::setDelay(float delay)
+  {
+    this->delay_ = delay;
+    this->timeSinceLastEvent_ = delay;
+  }
+
+  void Trigger::setMode(const std::string& modeName)
+  {
+    if (modeName == "and")
+      this->setMode(TM_EventTriggerAND);
+    else if (modeName == "or")
+      this->setMode(TM_EventTriggerOR);
+    else if (modeName == "xor")
+      this->setMode(TM_EventTriggerXOR);
+  }
+
+  std::string Trigger::getModeString() const
+  {
+    if (this->mode_ == TM_EventTriggerAND)
+      return std::string("and");
+    else if (this->mode_ == TM_EventTriggerOR)
+      return std::string("or");
+    else if (this->mode_ == TM_EventTriggerXOR)
+      return std::string("xor");
+    else
+      return std::string("and");
+  }
+
+  void Trigger::addTrigger(Trigger* trigger)
+  {
+    if (this != trigger)
+      this->children_.insert(trigger);
+  }
+
+  const Trigger* Trigger::getTrigger(unsigned int index) const
+  {
+    if (this->children_.size() <= index)
+      return NULL;
+
+    std::set<Trigger*>::const_iterator it;
+    it = this->children_.begin();
+
+    for (unsigned int i = 0; i != index; ++i)
+      ++it;
+
+    return (*it);
+  }
+
+  void Trigger::debugFlares(bool bVisible)
+  {
+    for (ObjectList<Trigger>::iterator it = ObjectList<Trigger>::begin(); it != ObjectList<Trigger>::end(); ++it)
+      it->setVisible(bVisible);
+  }
+
+  void Trigger::setBillboardColour(const ColourValue& colour)
+  {
+    this->debugBillboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
+  }
+
+  void Trigger::changedVisibility()
+  {
+    SUPER(Trigger, changedVisibility);
+
+    this->debugBillboard_.setVisible(this->isVisible());
+  }
+}
Index: code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h	(revision 2087)
+++ code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h	(revision 2087)
@@ -0,0 +1,136 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#ifndef _Trigger_H__
+#define _Trigger_H__
+
+#include <set>
+#include <queue>
+
+#include "OrxonoxPrereqs.h"
+
+#include "objects/Tickable.h"
+#include "objects/worldentities/PositionableEntity.h"
+#include "tools/BillboardSet.h"
+
+namespace orxonox
+{
+  enum TriggerMode
+  {
+    TM_EventTriggerAND,
+    TM_EventTriggerOR,
+    TM_EventTriggerXOR,
+  };
+
+  class _OrxonoxExport Trigger : public PositionableEntity, public Tickable
+  {
+    public:
+      Trigger(BaseObject* creator);
+      virtual ~Trigger();
+
+      virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+      virtual void tick(float dt);
+
+      inline bool isActive() const
+        { return bActive_; }
+
+      void addTrigger(Trigger* trigger);
+      const Trigger* getTrigger(unsigned int index) const;
+
+      void setMode(const std::string& modeName);
+      inline void setMode(TriggerMode mode)
+        { this->mode_ = mode; }
+      inline TriggerMode getMode() const
+        { return mode_; }
+
+      inline void setInvert(bool bInvert)
+        { this->bInvertMode_ = bInvert; }
+      inline bool getInvert() const
+        { return this->bInvertMode_; }
+
+      inline void setSwitch(bool bSwitch)
+        { this->bSwitch_ = bSwitch; }
+      inline bool getSwitch() const
+        { return this->bSwitch_; }
+
+      inline void setStayActive(bool bStayActive)
+        { this->bStayActive_ = bStayActive; }
+      inline bool getStayActive() const
+        { return this->bStayActive_; }
+
+      inline void setActivations(int activations)
+        { this->remainingActivations_ = activations; }
+      inline int getActivations() const
+        { return this->remainingActivations_; }
+
+      void setDelay(float delay);
+      inline float getDelay() const
+        { return this->delay_; }
+
+      bool switchState();
+
+      static void debugFlares(bool bVisible);
+      virtual void changedVisibility();
+
+    protected:
+      inline bool isTriggered() { return this->isTriggered(this->mode_); }
+      virtual bool isTriggered(TriggerMode mode);
+
+    private:
+      bool checkAnd();
+      bool checkOr();
+      bool checkXor();
+      void setBillboardColour(const ColourValue& colour);
+      void storeState();
+      std::string getModeString() const;
+
+      bool bActive_;
+      bool bTriggered_;
+      bool bFirstTick_;
+
+      TriggerMode mode_;
+      bool bInvertMode_;
+      bool bSwitch_;
+      bool bStayActive_;
+      float delay_;
+      int remainingActivations_;
+
+      char latestState_;
+      float remainingTime_;
+      float timeSinceLastEvent_;
+
+//      bool bUpdating_;
+      BillboardSet debugBillboard_;
+
+      std::set<Trigger*> children_;
+      std::queue<std::pair<float, char> > stateChanges_;
+  };
+
+}
+
+#endif /* _Trigger_H__ */
