[Orxonox-commit 2320] r7035 - code/branches/presentation3/src/orxonox/controllers
dafrick at orxonox.net
dafrick at orxonox.net
Mon May 31 07:43:51 CEST 2010
Author: dafrick
Date: 2010-05-31 07:43:51 +0200 (Mon, 31 May 2010)
New Revision: 7035
Modified:
code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc
code/branches/presentation3/src/orxonox/controllers/DroneController.cc
Log:
Added include in ArtificialController to make it work under linux. Commented some unused variables in DroneController.
Modified: code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc 2010-05-31 03:31:50 UTC (rev 7034)
+++ code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc 2010-05-31 05:43:51 UTC (rev 7035)
@@ -29,6 +29,7 @@
#include "ArtificialController.h"
#include <vector>
+#include "limits.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "worldentities/ControllableEntity.h"
Modified: code/branches/presentation3/src/orxonox/controllers/DroneController.cc
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/DroneController.cc 2010-05-31 03:31:50 UTC (rev 7034)
+++ code/branches/presentation3/src/orxonox/controllers/DroneController.cc 2010-05-31 05:43:51 UTC (rev 7035)
@@ -75,10 +75,10 @@
float random;
float maxrand = 100.0f / ACTION_INTERVAL;
- const Vector3& ownerPosition = getOwner()->getWorldPosition();
- const Vector3& dronePosition = getDrone()->getWorldPosition();
+ // const Vector3& ownerPosition = getOwner()->getWorldPosition();
+ // const Vector3& dronePosition = getDrone()->getWorldPosition();
- const Vector3& locOwnerDir = getDrone()->getOrientation().UnitInverse()*(ownerPosition-dronePosition); //Vector from Drone To Owner out of drones local coordinate system
+ // const Vector3& locOwnerDir = getDrone()->getOrientation().UnitInverse()*(ownerPosition-dronePosition); //Vector from Drone To Owner out of drones local coordinate system
random = rnd(maxrand);
if ( random < 30 && (!this->target_))
@@ -104,9 +104,7 @@
*/
void DroneController::tick(float dt)
{
-
-
- Drone *myDrone = static_cast<Drone*>(this->getControllableEntity());
+ // Drone *myDrone = static_cast<Drone*>(this->getControllableEntity());
float maxDistanceSquared = this->getDrone()->getMaxDistanceToOwner()*this->getDrone()->getMaxDistanceToOwner();
float minDistanceSquared = this->getDrone()->getMinDistanceToOwner()*this->getDrone()->getMinDistanceToOwner();
if ((this->getDrone()->getWorldPosition() - this->getOwner()->getWorldPosition()).squaredLength() > maxDistanceSquared) {
@@ -125,6 +123,7 @@
else if((int)randomSelection==4) drone_->rotatePitch(random);
else if((int)randomSelection==5) drone_->rotateRoll(random);
}
+
SUPER(AIController, tick, dt);
}
More information about the Orxonox-commit
mailing list