Index: code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc	(revision 6376)
+++ code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc	(revision 6377)
@@ -34,4 +34,5 @@
 #include <OgreCamera.h>
 #include <OgreSceneManager.h>
+#include <bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
 
 #include "core/CoreIncludes.h"
@@ -43,14 +44,13 @@
 #include "graphics/Camera.h"
 #include "sound/SoundManager.h"
+#include "tools/BulletConversions.h"
 #include "Scene.h"
-#include "tools/BulletConversions.h"
-#include "bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
 
 namespace orxonox
 {
-    SetConsoleCommand(NewHumanController, changeMode,          false).keybindMode(KeybindMode::OnPress);
-    SetConsoleCommand(NewHumanController, accelerate,          false).keybindMode(KeybindMode::OnPress);
-    SetConsoleCommand(NewHumanController, decelerate,          false).keybindMode(KeybindMode::OnPress);
-    SetConsoleCommand(NewHumanController, unfire,              true).keybindMode(KeybindMode::OnRelease);
+    SetConsoleCommand(NewHumanController, changeMode, false).keybindMode(KeybindMode::OnPress);
+    SetConsoleCommand(NewHumanController, accelerate, false).keybindMode(KeybindMode::OnPress);
+    SetConsoleCommand(NewHumanController, decelerate, false).keybindMode(KeybindMode::OnPress);
+    SetConsoleCommand(NewHumanController, unfire,      true).keybindMode(KeybindMode::OnRelease);
 
     CreateUnloadableFactory(NewHumanController);
@@ -102,13 +102,13 @@
             centerOverlay_->setBackgroundMaterial("Orxonox/CenterOverlay");
             centerOverlay_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
-            centerOverlay_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
+            centerOverlay_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));
             centerOverlay_->hide();
 
-            if ( showDamageOverlay_ )
+            if (showDamageOverlay_)
             {
                 damageOverlayTop_ = new OrxonoxOverlay(this);
                 damageOverlayTop_->setBackgroundMaterial("Orxonox/DamageOverlayTop");
                 damageOverlayTop_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
-                damageOverlayTop_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
+                damageOverlayTop_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));
                 damageOverlayTop_->hide();
 
@@ -116,5 +116,5 @@
                 damageOverlayRight_->setBackgroundMaterial("Orxonox/DamageOverlayRight");
                 damageOverlayRight_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
-                damageOverlayRight_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
+                damageOverlayRight_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));
                 damageOverlayRight_->hide();
 
@@ -122,5 +122,5 @@
                 damageOverlayBottom_->setBackgroundMaterial("Orxonox/DamageOverlayBottom");
                 damageOverlayBottom_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
-                damageOverlayBottom_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
+                damageOverlayBottom_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));
                 damageOverlayBottom_->hide();
 
@@ -128,9 +128,9 @@
                 damageOverlayLeft_->setBackgroundMaterial("Orxonox/DamageOverlayLeft");
                 damageOverlayLeft_->setSize(Vector2(overlaySize_ * 2.5, overlaySize_ * 2.5));
-                damageOverlayLeft_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));\
+                damageOverlayLeft_->setPosition(Vector2(0.5 - overlaySize_*2.5/2.0, 0.5 - overlaySize_*2.5/2.0));
                 damageOverlayLeft_->hide();
             }
 
-            if ( showArrows_ )
+            if (showArrows_)
             {
                 arrowsOverlay1_ = new OrxonoxOverlay(this);
@@ -173,5 +173,5 @@
         controlPaused_ = false;
 
-//HumanController::localController_s->getControllableEntity()->getCamera()->setDrag(true);
+        //HumanController::localController_s->getControllableEntity()->getCamera()->setDrag(true);
     }
 
@@ -204,17 +204,18 @@
         {
 
-            if( this->controllableEntity_ && !this->controllableEntity_->isInMouseLook() )
+            if (this->controllableEntity_ && !this->controllableEntity_->isInMouseLook())
             {
                 this->updateTarget();
 
-                if ( !controlPaused_ ) {
-                    if (this->getControllableEntity() && (this->getControllableEntity()->getIdentifier()->getName() == "SpaceShip" || this->getControllableEntity()->getIdentifier()->getName() == "Rocket"))
+                if (!controlPaused_ )
+                {
+                    if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
                         this->showOverlays();
 
                     this->crossHairOverlay_->setPosition(Vector2(static_cast<float>(this->currentYaw_)/2*-1+.5-overlaySize_/2, static_cast<float>(this->currentPitch_)/2*-1+.5-overlaySize_/2));
 
-                    if ( this->controlMode_ == 0 || ( this->controlMode_ == 1 && this->firemode_ == 1 ) )
+                    if (this->controlMode_ == 0 || (this->controlMode_ == 1 && this->firemode_ == 1))
                     {
-                        if ( this->showOverlays_ && this->showArrows_)
+                        if (this->showOverlays_ && this->showArrows_)
                             alignArrows();
                     }
@@ -222,16 +223,17 @@
                         hideArrows();
 
-                    if ( this->showDamageOverlay_ && ( this->damageOverlayTT_ > 0 || this->damageOverlayTR_ > 0 || this->damageOverlayTB_ > 0 || this->damageOverlayTL_ > 0 ) ) {
+                    if (this->showDamageOverlay_ && (this->damageOverlayTT_ > 0 || this->damageOverlayTR_ > 0 || this->damageOverlayTB_ > 0 || this->damageOverlayTL_ > 0))
+                    {
                         this->damageOverlayTT_ -= dt;
                         this->damageOverlayTR_ -= dt;
                         this->damageOverlayTB_ -= dt;
                         this->damageOverlayTL_ -= dt;
-                        if ( this->damageOverlayTT_ <= 0 )
+                        if (this->damageOverlayTT_ <= 0)
                             this->damageOverlayTop_->hide();
-                        if ( this->damageOverlayTR_ <= 0 )
+                        if (this->damageOverlayTR_ <= 0)
                             this->damageOverlayRight_->hide();
-                        if ( this->damageOverlayTB_ <= 0 )
+                        if (this->damageOverlayTB_ <= 0)
                             this->damageOverlayBottom_->hide();
-                        if ( this->damageOverlayTL_ <= 0 )
+                        if (this->damageOverlayTL_ <= 0)
                             this->damageOverlayLeft_->hide();
                     }
@@ -241,12 +243,7 @@
                 this->hideOverlays();
 
-            if ( this->acceleration_ > 0 )
-            {
-/*
-if (this->controllableEntity_ && this->controllableEntity_->getEngine()) {
-    std::cout << this->controllableEntity_->getEngine()->getAccelerationFront() << endl;
-}
-*/
-                if ( this->accelerating_ )
+            if (this->acceleration_ > 0)
+            {
+                if (this->accelerating_)
                     HumanController::moveFrontBack(Vector2(1, 0));
                 else
@@ -265,38 +262,8 @@
     }
 
-    /*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 ( !this->controllableEntity_ )
+        if (!this->controllableEntity_)
             return;
-        //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
-        }
-*/
 
         this->firemode_ = firemode;
@@ -313,8 +280,10 @@
     }
 
-    void NewHumanController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) {
-        if ( this->showDamageOverlay_ && !this->controlPaused_ && this->controllableEntity_ && !this->controllableEntity_->isInMouseLook() ) {
+    void NewHumanController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage)
+    {
+        if (this->showDamageOverlay_ && !this->controlPaused_ && this->controllableEntity_ && !this->controllableEntity_->isInMouseLook())
+        {
             Vector3 posA;
-            if ( originator )
+            if (originator)
                 posA = originator->getWorldPosition();
             else
@@ -329,9 +298,7 @@
             //y is down positive
             relativeHit.normalise();
-//            COUT(0) << relativeHit << endl;
 
             float threshold = 0.3;
-            // && abs(relativeHit.y) < 0.5 
-            if ( relativeHit.x > threshold) // Left
+            if (relativeHit.x > threshold) // Left
             {
                 this->damageOverlayLeft_->show();
@@ -339,5 +306,5 @@
                 //this->damageOverlayLeft_->setBackgroundAlpha(0.3);
             }
-            if ( relativeHit.x < -threshold) //Right
+            if (relativeHit.x < -threshold) //Right
             {
                 this->damageOverlayRight_->show();
@@ -345,5 +312,5 @@
                 //this->damageOverlayRight_->setBackgroundAlpha(0.3);
             }
-            if ( relativeHit.y > threshold) //Top
+            if (relativeHit.y > threshold) //Top
             {
                 this->damageOverlayBottom_->show();
@@ -351,5 +318,5 @@
                 //this->damageOverlayTop_->setBackgroundAlpha(0.3);
             }
-            if ( relativeHit.y < -threshold) //Bottom
+            if (relativeHit.y < -threshold) //Bottom
             {
                 this->damageOverlayTop_->show();
@@ -357,5 +324,4 @@
                 //this->damageOverlayBottom_->setBackgroundAlpha(0.3);
             }
-
         }
     }
@@ -403,8 +369,8 @@
                 if (wePtr)
                 {
-                    // go through all parents of object and look wheter they are Sightable or not
+                    // go through all parents of object and look whether they are sightable or not
                     bool isSightable = false;
                     WorldEntity* parent = wePtr->getParent();
-                    while( parent )
+                    while (parent)
                     {
                         if (this->targetMask_.isExcluded(parent->getIdentifier()))
@@ -419,33 +385,25 @@
                         }
                     }
-                    if ( !isSightable )
+                    if (!isSightable)
                         continue;
                 }
 
-                if ( this->getControllableEntity() && this->getControllableEntity()->getTarget() != wePtr )
-                {
+                if (this->getControllableEntity() && this->getControllableEntity()->getTarget() != wePtr)
                     this->getControllableEntity()->setTarget(wePtr);
-                }
-
-                if( pawn )
-                {
+
+                if (pawn)
                     pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * itr->distance );
-                }
 
                 //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;
             }
-
-        }
-        if ( pawn )
-        {
+        }
+
+        if (pawn)
             pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * 1200 );
-        }
 
         if( this->getControllableEntity() && this->getControllableEntity()->getTarget() != 0 )
             this->getControllableEntity()->setTarget( 0 );
-    
 
         //return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getWorldOrientation() * Vector3::NEGATIVE_UNIT_Z * 2000);
@@ -458,11 +416,11 @@
 
         //if (this->acceleration_ == 0)
-            HumanController::frontback(value);
+        HumanController::frontback(value);
     }
 
     void NewHumanController::yaw(const Vector2& value)
     {
-//         SUPER(NewHumanController, yaw, value);
-        if (this->controlMode_ == 0 || ( this->controllableEntity_ && this->controllableEntity_->isInMouseLook() ) )
+        //SUPER(NewHumanController, yaw, value);
+        if (this->controlMode_ == 0 || (this->controllableEntity_ && this->controllableEntity_->isInMouseLook()))
             HumanController::yaw(value);
 
@@ -472,6 +430,6 @@
     void NewHumanController::pitch(const Vector2& value)
     {
-//         SUPER(NewHumanController, pitch, value);
-        if (this->controlMode_ == 0 || ( this->controllableEntity_ && this->controllableEntity_->isInMouseLook() ) )
+        //SUPER(NewHumanController, pitch, value);
+        if (this->controlMode_ == 0 || (this->controllableEntity_ && this->controllableEntity_->isInMouseLook()))
             HumanController::pitch(value);
 
@@ -495,17 +453,11 @@
     void NewHumanController::changedControllableEntity()
     {
-/*
-        if( this->getControllableEntity() )
-            CCOUT(0) << "changed controllable entity to: " << this->getControllableEntity()->getIdentifier()->getName() << endl;
-        else
-            CCOUT(0) << "changed controllable entity to: " << this->getControllableEntity() << endl;
-*/
         this->controlMode_ = 0;
         this->currentYaw_ = 0;
         this->currentPitch_ = 0;
-        if (this->getControllableEntity() && ( this->getControllableEntity()->getIdentifier()->getName() == "SpaceShip" || this->getControllableEntity()->getIdentifier()->getName() == "Rocket" ))
+        if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
         {
             this->showOverlays_ = true;
-            if( !this->controlPaused_ )
+            if (!this->controlPaused_)
             {
                 this->showOverlays();
@@ -522,55 +474,53 @@
     void NewHumanController::accelerate()
     {
-        if ( NewHumanController::localController_s )
-        {
+        if (NewHumanController::localController_s)
             NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ + 0.2f, 0.00f, 1.0f);
-        }
     }
 
     void NewHumanController::decelerate()
     {
-        if ( NewHumanController::localController_s )
-        {
+        if (NewHumanController::localController_s)
             NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ - 0.1f, 0.0f, 1.0f);
-        }
-    }
-
-    void NewHumanController::doResumeControl() {
+    }
+
+    void NewHumanController::doResumeControl()
+    {
         this->controlPaused_ = false;
-        if( this->showOverlays_ ) {
+        if (this->showOverlays_)
             this->showOverlays();
-        }
-    }
-
-    void NewHumanController::doPauseControl() {
+    }
+
+    void NewHumanController::doPauseControl()
+    {
         this->controlPaused_ = true;
-//        COUT(0) << "pause control" << endl;
         this->hideOverlays();
     }
 
-    void NewHumanController::alignArrows() {
-        if (showArrows_) {
+    void NewHumanController::alignArrows()
+    {
+        if (showArrows_)
+        {
             hideArrows();
     
             float distance = sqrt(pow(static_cast<float>(this->currentYaw_)/2*-1,2) + pow(static_cast<float>(this->currentPitch_)/2*-1,2));
     
-            if ( distance > 0.04 && distance <= 0.59 * arrowsSize_ / 2.0 ) {
+            if (distance > 0.04 && distance <= 0.59 * arrowsSize_ / 2.0 )
+            {
                 this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
-    
                 this->arrowsOverlay1_->show();
             }
-            else if ( distance > 0.59 * arrowsSize_ / 2.0 && distance <= 0.77 * arrowsSize_ / 2.0 ) {
+            else if (distance > 0.59 * arrowsSize_ / 2.0 && distance <= 0.77 * arrowsSize_ / 2.0 )
+            {
                 this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
-    
                 this->arrowsOverlay2_->show();
             }
-            else if ( distance > 0.77 * arrowsSize_ / 2.0 && distance <= arrowsSize_ / 2.0 ) {
+            else if (distance > 0.77 * arrowsSize_ / 2.0 && distance <= arrowsSize_ / 2.0)
+            {
                 this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
-    
                 this->arrowsOverlay3_->show();
             }
-            else if ( distance > arrowsSize_ / 2.0 ) {
+            else if (distance > arrowsSize_ / 2.0)
+            {
                 this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0 * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
-    
                 this->arrowsOverlay4_->show();
             }
@@ -578,11 +528,13 @@
     }
 
-    void NewHumanController::showOverlays() {
-        if( !GameMode::showsGraphics() )
+    void NewHumanController::showOverlays()
+    {
+        if (!GameMode::showsGraphics())
             return;
         this->crossHairOverlay_->show();
         this->centerOverlay_->show();
 
-        if (showArrows_) {
+        if (showArrows_)
+        {
             this->arrowsOverlay1_->show();
             this->arrowsOverlay2_->show();
@@ -592,11 +544,13 @@
     }
 
-    void NewHumanController::hideOverlays() {
-        if( !GameMode::showsGraphics() )
+    void NewHumanController::hideOverlays()
+    {
+        if (!GameMode::showsGraphics())
             return;
         this->crossHairOverlay_->hide();
         this->centerOverlay_->hide();
 
-        if ( showDamageOverlay_ ) {
+        if (showDamageOverlay_)
+        {
             this->damageOverlayTop_->hide();
             this->damageOverlayRight_->hide();
@@ -608,8 +562,10 @@
     }
 
-    void NewHumanController::hideArrows() {
-        if( !GameMode::showsGraphics() )
+    void NewHumanController::hideArrows()
+    {
+        if(!GameMode::showsGraphics())
             return;
-        if (showArrows_) {
+        if (showArrows_)
+        {
             this->arrowsOverlay1_->hide();
             this->arrowsOverlay2_->hide();
Index: code/branches/presentation2/src/orxonox/controllers/NewHumanController.h
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/NewHumanController.h	(revision 6376)
+++ code/branches/presentation2/src/orxonox/controllers/NewHumanController.h	(revision 6377)
@@ -76,4 +76,5 @@
             unsigned int                controlMode_;
             static NewHumanController*  localController_s;
+
         private:
             float                       currentYaw_;
