Index: code/branches/presentation2/src/libraries/core/input/InputManager.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/input/InputManager.cc	(revision 6107)
+++ code/branches/presentation2/src/libraries/core/input/InputManager.cc	(revision 6108)
@@ -631,9 +631,14 @@
                 {
                     // not scheduled for destruction
-                    // prevents a state being added multiple times
+                    // prevents a state from being added multiple times
                     stateEnterRequests_.insert(it->second);
                     return true;
                 }
             }
+            else if (this->stateLeaveRequests_.find(it->second) != this->stateLeaveRequests_.end())
+            {
+                // State already scheduled for leaving --> cancel
+                this->stateLeaveRequests_.erase(this->stateLeaveRequests_.find(it->second));
+            }
         }
         return false;
@@ -658,4 +663,9 @@
                 return true;
             }
+            else if (this->stateEnterRequests_.find(it->second) != this->stateEnterRequests_.end())
+            {
+                // State already scheduled for entering --> cancel
+                this->stateEnterRequests_.erase(this->stateEnterRequests_.find(it->second));
+            }
         }
         return false;
Index: code/branches/presentation2/src/modules/weapons/weaponmodes/HsW01.cc
===================================================================
--- code/branches/presentation2/src/modules/weapons/weaponmodes/HsW01.cc	(revision 6107)
+++ code/branches/presentation2/src/modules/weapons/weaponmodes/HsW01.cc	(revision 6108)
@@ -39,4 +39,5 @@
 #include "weaponsystem/WeaponPack.h"
 #include "weaponsystem/WeaponSystem.h"
+#include "worldentities/WorldEntity.h"
 
 namespace orxonox
@@ -110,4 +111,5 @@
         model->setScale(5);
 
+        this->computeMuzzleParameters();
         projectile->setOrientation(this->getMuzzleOrientation());
         projectile->setPosition(this->getMuzzlePosition());
Index: code/branches/presentation2/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/CMakeLists.txt	(revision 6107)
+++ code/branches/presentation2/src/orxonox/controllers/CMakeLists.txt	(revision 6108)
@@ -2,4 +2,5 @@
   Controller.cc
   HumanController.cc
+  NewHumanController.cc
   ArtificialController.cc
   AIController.cc
Index: code/branches/presentation2/src/orxonox/controllers/Controller.cc
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/Controller.cc	(revision 6107)
+++ code/branches/presentation2/src/orxonox/controllers/Controller.cc	(revision 6108)
@@ -29,4 +29,5 @@
 #include "Controller.h"
 #include "core/CoreIncludes.h"
+#include "worldentities/ControllableEntity.h"
 
 namespace orxonox
Index: code/branches/presentation2/src/orxonox/controllers/Controller.h
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/Controller.h	(revision 6107)
+++ code/branches/presentation2/src/orxonox/controllers/Controller.h	(revision 6108)
@@ -54,4 +54,9 @@
             virtual void changedControllableEntity() {}
 
+            virtual bool canFindTarget()
+                { return false; }
+            virtual Vector3 getTarget()
+                { return Vector3::ZERO; }
+
         protected:
             // don't use this directly, use getPlayer()->startControl(entity) (unless you know exactly what you do)
@@ -65,4 +70,5 @@
             }
 
+        protected:
             PlayerInfo* player_;
             ControllableEntity* controllableEntity_;
Index: code/branches/presentation2/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/HumanController.cc	(revision 6107)
+++ code/branches/presentation2/src/orxonox/controllers/HumanController.cc	(revision 6108)
@@ -113,5 +113,5 @@
     }
 
-    void HumanController::rotateYaw(const Vector2& value)
+    void HumanController::yaw(const Vector2& value)
     {
         //Hack to enable mouselook in map
@@ -125,5 +125,5 @@
     }
 
-    void HumanController::rotatePitch(const Vector2& value)
+    void HumanController::pitch(const Vector2& value)
     {
         //Hack to enable mouselook in map
@@ -143,5 +143,5 @@
     }
 
-    void HumanController::fire(unsigned int firemode)
+    void HumanController::doFire(unsigned int firemode)
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
Index: code/branches/presentation2/src/orxonox/controllers/HumanController.h
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/HumanController.h	(revision 6107)
+++ code/branches/presentation2/src/orxonox/controllers/HumanController.h	(revision 6108)
@@ -49,9 +49,13 @@
             static void moveUpDown(const Vector2& value);
 
-            static void rotateYaw(const Vector2& value);
-            static void rotatePitch(const Vector2& value);
+            static void rotateYaw(const Vector2& value){ HumanController::localController_s->yaw(value); }
+            static void rotatePitch(const Vector2& value){ HumanController::localController_s->pitch(value); }
             static void rotateRoll(const Vector2& value);
+            
+            virtual void yaw(const Vector2& value);
+            virtual void pitch(const Vector2& value);
 
-            static void fire(unsigned int firemode);
+            static void fire(unsigned int firemode) { HumanController::localController_s->doFire(firemode); }
+            virtual void doFire(unsigned int firemode);
             static void reload();
 
@@ -76,5 +80,5 @@
             friend class Map;
 
-        private:
+        protected:
             static HumanController* localController_s;
     };
Index: code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc	(revision 6108)
+++ code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc	(revision 6108)
@@ -0,0 +1,196 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Michael Wirth
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "NewHumanController.h"
+
+#include <OgreRay.h>
+#include <OgreSceneQuery.h>
+#include <OgreCamera.h>
+#include <OgreSceneManager.h>
+
+#include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "worldentities/ControllableEntity.h"
+#include "infos/PlayerInfo.h"
+#include "overlays/OrxonoxOverlay.h"
+#include "graphics/Camera.h"
+#include "sound/SoundManager.h"
+#include "Scene.h"
+
+namespace orxonox
+{
+    SetConsoleCommand(NewHumanController, changeMode,          false).keybindMode(KeybindMode::OnPress);
+
+    CreateUnloadableFactory(NewHumanController);
+
+    NewHumanController* NewHumanController::localController_s = 0;
+
+    NewHumanController::NewHumanController(BaseObject* creator) : HumanController(creator)
+    {
+        RegisterObject(NewHumanController);
+
+        overlaySize_ = 0.08;
+        controlMode_ = 0;
+
+        crossHairOverlay_ = new OrxonoxOverlay(this);
+        crossHairOverlay_->setBackgroundMaterial("Orxonox/Crosshair3");
+        crossHairOverlay_->setSize(Vector2(overlaySize_, overlaySize_));
+        crossHairOverlay_->show();
+
+        // HACK: Define which objects are targetable when considering the creator of an orxonox::Model
+        this->targetMask_.exclude(ClassByString("BaseObject"));
+        this->targetMask_.include(ClassByString("WorldEntity"));
+        this->targetMask_.exclude(ClassByString("Projectile"));
+
+        NewHumanController::localController_s = this;
+    }
+
+    NewHumanController::~NewHumanController()
+    {
+        if (this->isInitialized())
+        {
+        }
+    }
+
+    void NewHumanController::tick(float dt)
+    {
+        crossHairOverlay_->setPosition(Vector2(static_cast<float>(this->currentYaw_)/2*-1+.5-overlaySize_/2, static_cast<float>(this->currentPitch_)/2*-1+.5-overlaySize_/2));
+
+        HumanController::tick(dt);
+    }
+
+    /*void NewHumanController::tick(float dt)
+    {
+        if (GameMode::playsSound() && NewHumanController::localController_s && NewHumanController::localController_s->controllableEntity_)
+        {
+            // Update sound listener
+            Camera* camera = NewHumanController::localController_s->controllableEntity_->getCamera();
+            if (camera)
+            {
+                SoundManager::getInstance().setListenerPosition(camera->getWorldPosition());
+                SoundManager::getInstance().setListenerOrientation(camera->getWorldOrientation());
+            }
+            else
+                COUT(3) << "NewHumanController, Warning: Using a ControllableEntity without Camera" << std::endl;
+        }
+    }*/
+    
+    void NewHumanController::doFire(unsigned int firemode)
+    {
+        //if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) {
+
+/*
+        // Get results, create a node/entity on the position
+        for ( itr = result.begin(); itr != result.end(); itr++ )
+        {
+            if (itr->movable && itr->movable->getName() == "Head")
+            {
+                soundMgr->StopSound( &jaguarSoundChannel );
+                soundMgr->PlaySound( jaguarSound, headNode, &jaguarSoundChannel );
+                break;
+            } // if
+        }
+*/
+
+        HumanController::localController_s->getControllableEntity()->fire(firemode);
+    }
+
+    Vector3 NewHumanController::getTarget()
+    {
+        Ogre::RaySceneQuery * rsq = HumanController::localController_s->getControllableEntity()->getScene()->getSceneManager()->createRayQuery(Ogre::Ray());
+
+        Ogre::Ray mouseRay = HumanController::localController_s->getControllableEntity()->getCamera()->getOgreCamera()->getCameraToViewportRay(static_cast<float>(this->currentYaw_)/2*-1+.5, static_cast<float>(this->currentPitch_)/2*-1+.5);
+
+        rsq->setRay(mouseRay);
+        rsq->setSortByDistance(true);
+
+        /*
+        Distance of objects:
+        ignore everything under 200 maybe even take 1000 as min distance to shoot at
+
+        shots are regularly traced and are entities!!!!!!!!! this is the biggest problem
+        they vanish only after a distance of 10'000
+        */
+
+
+        Ogre::RaySceneQueryResult& result = rsq->execute();
+
+        Ogre::RaySceneQueryResult::iterator itr;
+        for (itr = result.begin(); itr != result.end(); ++itr)
+        {
+            if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" && itr->distance > 500)
+            {
+                // Try to cast the user pointer
+                WorldEntity* wePtr = dynamic_cast<WorldEntity*>(itr->movable->getUserObject());
+                if (wePtr)
+                {
+                    BaseObject* creator = wePtr->getCreator();
+                    if (this->targetMask_.isExcluded(creator->getIdentifier()))
+                        continue;
+                }
+
+                itr->movable->getParentSceneNode()->showBoundingBox(true);
+                //std::cout << itr->movable->getParentSceneNode()->_getDerivedPosition() << endl;
+                return mouseRay.getOrigin() + mouseRay.getDirection() * itr->distance; //or itr->movable->getParentSceneNode()->_getDerivedPosition()
+            }
+
+        }
+
+	return mouseRay.getOrigin() + mouseRay.getDirection() * 1200;
+
+        //return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getWorldOrientation() * Vector3::NEGATIVE_UNIT_Z * 2000);
+        //return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getCamera()->getOgreCamera()->getOrientation() * Vector3::NEGATIVE_UNIT_Z);
+    }
+
+    void NewHumanController::yaw(const Vector2& value)
+    {
+//         SUPER(NewHumanController, yaw, value);
+        if (this->controlMode_ == 0)
+            HumanController::yaw(value);
+        
+        this->currentYaw_ = value.x;
+        //std::cout << "Y: " << static_cast<float>(this->currentPitch_) << " X: " << static_cast<float>(this->currentYaw_) << endl;
+    }
+
+    void NewHumanController::pitch(const Vector2& value)
+    {
+//         SUPER(NewHumanController, pitch, value);
+        if (this->controlMode_ == 0)
+            HumanController::pitch(value);
+
+        this->currentPitch_ = value.x;
+        //std::cout << "Y: " << static_cast<float>(this->currentPitch_) << " X: " << static_cast<float>(this->currentYaw_) << endl;
+    }
+
+    void NewHumanController::changeMode() {
+        if (NewHumanController::localController_s->controlMode_ == 0)
+            NewHumanController::localController_s->controlMode_ = 1;
+        else
+            NewHumanController::localController_s->controlMode_ = 0;
+    }
+}
Index: code/branches/presentation2/src/orxonox/controllers/NewHumanController.h
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/NewHumanController.h	(revision 6108)
+++ code/branches/presentation2/src/orxonox/controllers/NewHumanController.h	(revision 6108)
@@ -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:
+ *      Michael Wirth
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _NewNewHumanController_H__	
+#define _NewNewHumanController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/ClassTreeMask.h"
+#include "HumanController.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport NewHumanController : public HumanController
+    {
+        public:
+            NewHumanController(BaseObject* creator);
+            virtual ~NewHumanController();
+
+            virtual void tick(float dt);
+
+            virtual void yaw(const Vector2& value);
+            virtual void pitch(const Vector2& value);
+
+            virtual void doFire(unsigned int firemode);
+
+            static void changeMode();
+
+            virtual bool canFindTarget() { return true; }
+            virtual Vector3 getTarget();
+
+        protected:
+            unsigned int                controlMode_;
+            static NewHumanController* localController_s;
+        private:
+            float                       currentYaw_;
+            float                       currentPitch_;
+            OrxonoxOverlay*             crossHairOverlay_;
+            float			            overlaySize_;
+            ClassTreeMask               targetMask_;
+    };
+}
+
+#endif /* _NewHumanController_H__ */
Index: code/branches/presentation2/src/orxonox/graphics/Camera.cc
===================================================================
--- code/branches/presentation2/src/orxonox/graphics/Camera.cc	(revision 6107)
+++ code/branches/presentation2/src/orxonox/graphics/Camera.cc	(revision 6108)
@@ -61,4 +61,5 @@
 
         this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
+        this->camera_->setUserObject(this);
         this->cameraNode_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
         this->attachNode(this->cameraNode_);
Index: code/branches/presentation2/src/orxonox/graphics/Camera.h
===================================================================
--- code/branches/presentation2/src/orxonox/graphics/Camera.h	(revision 6107)
+++ code/branches/presentation2/src/orxonox/graphics/Camera.h	(revision 6108)
@@ -52,4 +52,7 @@
             void releaseFocus();
 
+            inline Ogre::Camera* getOgreCamera()
+               { return this->camera_; }
+
             inline bool hasFocus()
                 { return this->bHasFocus_; }
Index: code/branches/presentation2/src/orxonox/infos/HumanPlayer.cc
===================================================================
--- code/branches/presentation2/src/orxonox/infos/HumanPlayer.cc	(revision 6107)
+++ code/branches/presentation2/src/orxonox/infos/HumanPlayer.cc	(revision 6108)
@@ -35,4 +35,5 @@
 #include "network/Host.h"
 #include "controllers/HumanController.h"
+#include "controllers/NewHumanController.h"
 #include "gametypes/Gametype.h"
 #include "overlays/OverlayGroup.h"
@@ -50,5 +51,5 @@
 
         this->bHumanPlayer_ = true;
-        this->defaultController_ = Class(HumanController);
+        this->defaultController_ = Class(NewHumanController);
 
         this->humanHud_ = 0;
Index: code/branches/presentation2/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/branches/presentation2/src/orxonox/infos/PlayerInfo.cc	(revision 6107)
+++ code/branches/presentation2/src/orxonox/infos/PlayerInfo.cc	(revision 6108)
@@ -139,5 +139,8 @@
         this->controller_->setPlayer(this);
         if (this->controllableEntity_)
+        {
             this->controller_->setControllableEntity(this->controllableEntity_);
+            this->controllableEntity_->setController(this->controller_);
+        }
         this->changedController();
     }
@@ -161,5 +164,8 @@
 
         if (this->controller_)
+        {
             this->controller_->setControllableEntity(entity);
+            this->controllableEntity_->setController(this->controller_);
+        }
 
         this->changedControllableEntity();
@@ -195,4 +201,5 @@
             return;
 
+        this->controllableEntity_->setController(0);
         this->controllableEntity_ = 0;
         this->controllableEntityID_ = OBJECTID_UNKNOWN;
Index: code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.h
===================================================================
--- code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.h	(revision 6107)
+++ code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.h	(revision 6108)
@@ -155,4 +155,7 @@
         static void rotateOverlay(const std::string& name, const Degree& angle);
 
+        void setBackgroundMaterial(const std::string& material);
+        const std::string& getBackgroundMaterial() const;
+
         virtual void changedVisibility();
 
@@ -181,7 +184,4 @@
         virtual void positionChanged();
 
-        void setBackgroundMaterial(const std::string& material);
-        const std::string& getBackgroundMaterial() const;
-
         Ogre::Overlay* overlay_;                   //!< The overlay the entire class is about.
         Ogre::PanelOverlayElement* background_;    //!< Background image (blank per default).
Index: code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc	(revision 6107)
+++ code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.cc	(revision 6108)
@@ -32,4 +32,6 @@
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
+#include "controllers/Controller.h"
+#include "worldentities/pawns/Pawn.h"
 
 #include "Munition.h"
@@ -194,24 +196,30 @@
     }
 
-    Vector3 WeaponMode::getMuzzlePosition() const
+    void WeaponMode::computeMuzzleParameters()
     {
         if (this->weapon_)
-            return (this->weapon_->getWorldPosition() + this->weapon_->getWorldOrientation() * this->muzzleOffset_);
-        else
-            return this->muzzleOffset_;
-    }
-
-    const Quaternion& WeaponMode::getMuzzleOrientation() const
+        {
+            this->muzzlePosition_ = this->weapon_->getWorldPosition() + this->weapon_->getWorldOrientation() * this->muzzleOffset_;
+
+            Controller* controller = this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getController();
+            if (controller->canFindTarget())
+            {
+                Vector3 muzzleDirection(controller->getTarget() - this->muzzlePosition_);
+                this->muzzleOrientation_ = (this->weapon_->getWorldOrientation() * WorldEntity::FRONT).getRotationTo(muzzleDirection) * this->weapon_->getWorldOrientation();
+            }
+            else
+                this->muzzleOrientation_ = this->weapon_->getWorldOrientation();
+        }
+        else
+        {
+            this->muzzlePosition_ = this->muzzleOffset_;
+            this->muzzleOrientation_ = Quaternion::IDENTITY;
+        }
+    }
+
+    Vector3 WeaponMode::getMuzzleDirection() const
     {
         if (this->weapon_)
-            return this->weapon_->getWorldOrientation();
-        else
-            return Quaternion::IDENTITY;
-    }
-
-    Vector3 WeaponMode::getMuzzleDirection() const
-    {
-        if (this->weapon_)
-            return (this->weapon_->getWorldOrientation() * WorldEntity::FRONT);
+            return (this->getMuzzleOrientation() * WorldEntity::FRONT);
         else
             return WorldEntity::FRONT;
Index: code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.h
===================================================================
--- code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.h	(revision 6107)
+++ code/branches/presentation2/src/orxonox/weaponsystem/WeaponMode.h	(revision 6108)
@@ -109,6 +109,9 @@
                 { return this->muzzleOffset_; }
 
-            Vector3 getMuzzlePosition() const;
-            const Quaternion& getMuzzleOrientation() const;
+            void computeMuzzleParameters();
+            const Vector3& getMuzzlePosition() const
+                { return this->muzzlePosition_; }
+            const Quaternion& getMuzzleOrientation() const
+                { return this->muzzleOrientation_; }
             Vector3 getMuzzleDirection() const;
 
@@ -124,4 +127,6 @@
             inline unsigned int getMode() const
                 { return this->mode_; }
+
+            Vector3 getTarget();
 
         protected:
@@ -152,4 +157,7 @@
             Timer reloadTimer_;
             bool bReloading_;
+
+            Vector3 muzzlePosition_;
+            Quaternion muzzleOrientation_;
     };
 }
Index: code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc	(revision 6107)
+++ code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc	(revision 6108)
@@ -65,4 +65,5 @@
         this->camera_ = 0;
         this->xmlcontroller_ = 0;
+        this->controller_ = 0;
         this->reverseCamera_ = 0;
         this->bDestroyWhenPlayerLeft_ = false;
Index: code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h	(revision 6107)
+++ code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h	(revision 6108)
@@ -140,4 +140,9 @@
             inline Controller* getXMLController() const
                 { return this->xmlcontroller_; }
+
+            inline Controller* getController() const
+                { return this->controller_; }
+            inline void setController(Controller* val)
+                { this->controller_ = val; }
 
         protected:
@@ -202,4 +207,5 @@
             std::string cameraPositionTemplate_;
             Controller* xmlcontroller_;
+            Controller* controller_;
             CameraPosition* reverseCamera_;
     };
Index: code/branches/presentation2/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/branches/presentation2/src/orxonox/worldentities/WorldEntity.cc	(revision 6107)
+++ code/branches/presentation2/src/orxonox/worldentities/WorldEntity.cc	(revision 6108)
@@ -472,25 +472,33 @@
     //! Attaches an Ogre::MovableObject to this WorldEntity.
     void WorldEntity::attachOgreObject(Ogre::MovableObject* object)
-        { this->node_->attachObject(object); }
+    {
+        this->node_->attachObject(object);
+        object->setUserObject(this);
+    }
+
     void WorldEntity::attachOgreObject(Ogre::BillboardSet* object)
-        { this->node_->attachObject(object); }
+        { this->attachOgreObject(static_cast<Ogre::MovableObject*>(object)); }
     void WorldEntity::attachOgreObject(Ogre::Camera* object)
-        { this->node_->attachObject(object); }
+        { this->attachOgreObject(static_cast<Ogre::MovableObject*>(object)); }
     void WorldEntity::attachOgreObject(Ogre::Entity* object)
-        { this->node_->attachObject(object); }
+        { this->attachOgreObject(static_cast<Ogre::MovableObject*>(object)); }
     void WorldEntity::attachOgreObject(Ogre::ParticleSystem* object)
-        { this->node_->attachObject(object); }
+        { this->attachOgreObject(static_cast<Ogre::MovableObject*>(object)); }
 
     //! Detaches an Ogre::MovableObject from this WorldEntity.
     void WorldEntity::detachOgreObject(Ogre::MovableObject* object)
-        { this->node_->detachObject(object); }
+    {
+        object->setUserObject(NULL);
+        this->node_->detachObject(object);
+    }
+
     void WorldEntity::detachOgreObject(Ogre::BillboardSet* object)
-        { this->node_->detachObject(object); }
+        { this->detachOgreObject(static_cast<Ogre::MovableObject*>(object)); }
     void WorldEntity::detachOgreObject(Ogre::Camera* object)
-        { this->node_->detachObject(object); }
+        { this->detachOgreObject(static_cast<Ogre::MovableObject*>(object)); }
     void WorldEntity::detachOgreObject(Ogre::Entity* object)
-        { this->node_->detachObject(object); }
+        { this->detachOgreObject(static_cast<Ogre::MovableObject*>(object)); }
     void WorldEntity::detachOgreObject(Ogre::ParticleSystem* object)
-        { this->node_->detachObject(object); }
+        { this->detachOgreObject(static_cast<Ogre::MovableObject*>(object)); }
 
     //! Detaches an Ogre::MovableObject (by string) from this WorldEntity.
@@ -646,5 +654,5 @@
     /**
     @brief
-        Makes this WorldEntity look a specific target location.
+        Makes this WorldEntity look at a specific target location.
     @param relativeTo
         @see WorldEntity::TransformSpace
@@ -913,5 +921,5 @@
     }
 
-    //! Copies our own parameters for restitution, angular factor, dampings and friction to the bullet rigid body.
+    //! Copies our own parameters for restitution, angular factor, damping and friction to the bullet rigid body.
     void WorldEntity::internalSetPhysicsProps()
     {
Index: code/branches/presentation2/src/orxonox/worldentities/WorldEntity.h
===================================================================
--- code/branches/presentation2/src/orxonox/worldentities/WorldEntity.h	(revision 6107)
+++ code/branches/presentation2/src/orxonox/worldentities/WorldEntity.h	(revision 6108)
@@ -33,4 +33,5 @@
 #include "OrxonoxPrereqs.h"
 
+#include <OgreUserDefinedObject.h>
 #ifdef ORXONOX_RELEASE
 #  include <OgreSceneNode.h>
@@ -55,5 +56,5 @@
 
         The basic task of the WorldEntity is provide a location, a direction and a scaling and the possibility
-        to create an entire hierarchy of derivated objects.
+        to create an entire hierarchy of derived objects.
         It is also the basis for the physics interface to the Bullet physics engine.
         Every WorldEntity can have a specific collision type: @see CollisionType
@@ -63,11 +64,11 @@
         There is also support for attaching WorldEntities with physics to each other. Currently, the collision shape
         of both objects simply get merged into one larger shape (for static collision type).
-        The phyiscal body that is internally stored and administrated has the following supported properties:
-        - Restitution, angular factor, linear damping, angular damping, fricition, mass and collision shape.
+        The physical body that is internally stored and administrated has the following supported properties:
+        - Restitution, angular factor, linear damping, angular damping, friction, mass and collision shape.
         You can get more information at the corresponding set function.
 
         Collision shapes: These are controlled by the internal WorldEntityCollisionShape. @see WorldEntityCollisionShape.
     */
-    class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable, public btMotionState
+    class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable, public btMotionState, public Ogre::UserDefinedObject
     {
         friend class Scene;
@@ -318,5 +319,5 @@
                 Sets an artificial parameter that tells how much torque is applied when you apply a non-central force.
 
-                Normally the angular factor is 1, which means it's physically 'correct'. Howerver if you have a player
+                Normally the angular factor is 1, which means it's physically 'correct'. However if you have a player
                 character that should not rotate when hit sideways, you can set the angular factor to 0.
             */
@@ -394,5 +395,5 @@
                 You can override this function in a derived class to constrain the collision to e.g. None or Dynamic.
                 A projectile may not prove very useful if there is no physical body. Simply set the CollisionType
-                in its constructor and override this method. But be careful that a derived classe's virtual functions
+                in its constructor and override this method. But be careful that a derived class's virtual functions
                 don't yet exist in the constructor if a base class.
             */
