[Orxonox-commit 1446] r6164 - code/branches/presentation2/src/orxonox/controllers
landauf at orxonox.net
landauf at orxonox.net
Thu Nov 26 17:31:16 CET 2009
Author: landauf
Date: 2009-11-26 17:31:16 +0100 (Thu, 26 Nov 2009)
New Revision: 6164
Modified:
code/branches/presentation2/src/orxonox/controllers/ArtificialController.cc
Log:
bots now also hit their target
Modified: code/branches/presentation2/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/ArtificialController.cc 2009-11-26 16:14:59 UTC (rev 6163)
+++ code/branches/presentation2/src/orxonox/controllers/ArtificialController.cc 2009-11-26 16:31:16 UTC (rev 6164)
@@ -142,6 +142,10 @@
this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getPosition(), hardcoded_projectile_speed, this->target_->getPosition(), this->target_->getVelocity());
this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO);
+
+ Pawn* pawn = dynamic_cast<Pawn*>(this->getControllableEntity());
+ if (pawn)
+ pawn->setAimPosition(this->targetPosition_);
}
bool ArtificialController::isCloseAtTarget(float distance) const
More information about the Orxonox-commit
mailing list