[Orxonox-commit 4372] r9043 - code/branches/waypoints/src/orxonox/controllers

scmoritz at orxonox.net scmoritz at orxonox.net
Fri Mar 16 16:06:01 CET 2012


Author: scmoritz
Date: 2012-03-16 16:06:01 +0100 (Fri, 16 Mar 2012)
New Revision: 9043

Modified:
   code/branches/waypoints/src/orxonox/controllers/FormationController.cc
Log:


Modified: code/branches/waypoints/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/waypoints/src/orxonox/controllers/FormationController.cc	2012-03-16 15:00:38 UTC (rev 9042)
+++ code/branches/waypoints/src/orxonox/controllers/FormationController.cc	2012-03-16 15:06:01 UTC (rev 9043)
@@ -271,20 +271,24 @@
 //             return;
         }
 
-        Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+        Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
         float distance = (target - this->getControllableEntity()->getPosition()).length();
+		if(coord.x < 0.01 && coord.y < 0.01)
+		{
+			// I AM HERE 
+			//this->getControllableEntity()->setOrientation()  
+		}
 
-
         if(this->state_ == FREE)
         {
             if (this->target_ || distance > 10)
             {
                 // Multiply with ROTATEFACTOR_FREE to make them a bit slower
-                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
-                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
+                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x);
+                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y);
             }
 
-            if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+            if (this->target_ && distance <  200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
             {
               this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
             } else this->getControllableEntity()->moveFrontBack(SPEED_FREE);




More information about the Orxonox-commit mailing list