Index: code/branches/presentation3/src/modules/weapons/RocketController.cc
===================================================================
--- code/branches/presentation3/src/modules/weapons/RocketController.cc	(revision 7013)
+++ code/branches/presentation3/src/modules/weapons/RocketController.cc	(revision 7018)
@@ -1,29 +1,29 @@
 /*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *     Gabriel Nadler, Originalfile: Oli Scheuss
- *   Co-authors:
- *      ...
- *
- */
+*   ORXONOX - the hottest 3D action shooter ever to exist
+*                    > www.orxonox.net <
+*
+*
+*   License notice:
+*
+*   This program is free software; you can redistribute it and/or
+*   modify it under the terms of the GNU General Public License
+*   as published by the Free Software Foundation; either version 2
+*   of the License, or (at your option) any later version.
+*
+*   This program is distributed in the hope that it will be useful,
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*   GNU General Public License for more details.
+*
+*   You should have received a copy of the GNU General Public License
+*   along with this program; if not, write to the Free Software
+*   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+*
+*   Author:
+*     Gabriel Nadler, Originalfile: Oli Scheuss
+*   Co-authors:
+*      ...
+*
+*/
 
 #include "RocketController.h"
@@ -39,5 +39,5 @@
     /**
     @brief
-        Constructor.
+    Constructor.
     */
     RocketController::RocketController(BaseObject* creator) : Controller(creator)
@@ -46,9 +46,9 @@
         COUT(5)<< "RocketController constructed\n";
 
-        
-        this->rocket = new SimpleRocket(this);
-        this->rocket->setController(this);
-        this->setControllableEntity(dynamic_cast<ControllableEntity*> (rocket));
-        this->haha=0;
+
+        this->rocket_ = new SimpleRocket(this);
+        this->rocket_->setController(this);
+        this->setControllableEntity(dynamic_cast<ControllableEntity*> (this->rocket_));
+        this->counter_=0;
     }
 
@@ -56,19 +56,18 @@
     /**
     @brief
-        The controlling happens here. This method defines what the controller has to do each tick.
+    The controlling happens here. This method defines what the controller has to do each tick.
     @param dt
-        The duration of the tick.
+    The duration of the tick.
     */
     void RocketController::tick(float dt)
     {
-        haha++;
+        counter_++;
 
-        //if (haha<30)this->rocket->setVelocity(rocket->getVelocity()*1.03);
-        if (this->target_) {
+        if (this->target_ && this->rocket_->hasFuel()) {
             this->setTargetPosition();
             this->moveToTargetPosition();
         }
-        if (haha>500) rocket->setDestroy();;
-
+        
+        
     }
 
@@ -81,6 +80,6 @@
     void RocketController::setTargetPosition()
     {
-        //this->targetPosition_=this->target_->getWorldPosition();
-        this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(),this->getControllableEntity()->getVelocity().length() , this->target_->getWorldPosition(), this->target_->getVelocity());
+        this->targetPosition_=this->target_->getWorldPosition(); //don't really note a difference in the rocket behaviour xD
+        //this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(),this->getControllableEntity()->getVelocity().length() , this->target_->getWorldPosition(), this->target_->getVelocity());
     }
     void RocketController::moveToTargetPosition()
@@ -100,36 +99,14 @@
         if (!this->getControllableEntity())
             return;
-        //float dx = target.x-this->getControllableEntity()->getPosition().x;
-        //float dy = target.y-this->getControllableEntity()->getPosition().y;
-        COUT(4)<<"\n diff: ";
-        COUT(4)<<target-this->getControllableEntity()->getPosition() << endl;
-        //COUT(0)<<"\n 2D view: ";
-        /* COUT(0)<<this->getControllableEntity()->getPosition().x;
-        COUT(0)<<" ";
-        COUT(0)<<this->getControllableEntity()->getPosition().y;
-        COUT(0)<<" ";
-        COUT(0)<<this->getControllableEntity()->getPosition().z;
-        COUT(0)<<"\n";*/
         Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
-        //float distance = (target - this->getControllableEntity()->getPosition()).length();
-        //Vector3D diff =target-this->rocket->getPosition();
-        COUT(4) << "viewdirection: "<< coord << endl;
-        //COUT(0)<<"  ";
-        //COUT(0)<<coord.y;
-        this->getControllableEntity()->rotateYaw(-0.8f*sgn(coord.x)*coord.x*coord.x);
-        this->getControllableEntity()->rotatePitch(0.8f*sgn(coord.y)*coord.y*coord.y);
-//         this->getControllableEntity()->rotateYaw(10);
-//         this->getControllableEntity()->rotatePitch(0);
-        //this->getControllableEntity()->rotatePitch(rotation.getPitch().valueRadians());
-        //this->getControllableEntity()->rotateYaw(rotation.getYaw().valueRadians());
-        //this->getControllableEntity()->moveUpDown(coord.y);
-        //this->getControllableEntity()->moveRightLeft(coord.x);
-        //this->getControllableEntity()->rotatePitch(coord);
-   //     if (this->target_ || distance > 10)
-   //     {
-   //         // Multiply with 0.8 to make them a bit slower
-            //this->getControllableEntity()->rotateYaw(coord.x );
-   //         this->getControllableEntity()->rotatePitch(coord.y);
-   //     }
+        float distance = (target - this->getControllableEntity()->getWorldPosition()).length();
+
+
+        if (distance > 1000&&this->getControllableEntity()->getVelocity().squaredLength()<160000) 
+            this->getControllableEntity()->setAcceleration(this->rocket_->getOrientation()*Vector3(-20,-20,-20));
+        if (distance <1000) this->rocket_->setAcceleration(0,0,0);
+        
+        this->getControllableEntity()->rotateYaw(-sgn(coord.x)*coord.x*coord.x);
+        this->getControllableEntity()->rotatePitch(sgn(coord.y)*coord.y*coord.y);
     }
 
