[Orxonox-commit 6371] r11028 - code/branches/presentationHS15/src/orxonox/controllers
landauf at orxonox.net
landauf at orxonox.net
Sun Jan 3 20:47:51 CET 2016
Author: landauf
Date: 2016-01-03 20:47:51 +0100 (Sun, 03 Jan 2016)
New Revision: 11028
Modified:
code/branches/presentationHS15/src/orxonox/controllers/ArtificialController.cc
code/branches/presentationHS15/src/orxonox/controllers/CommonController.cc
code/branches/presentationHS15/src/orxonox/controllers/CommonController.h
code/branches/presentationHS15/src/orxonox/controllers/FightingController.cc
code/branches/presentationHS15/src/orxonox/controllers/FlyingController.cc
code/branches/presentationHS15/src/orxonox/controllers/FlyingController.h
Log:
fixed compiler error (MSVC): static members with non-integral type must be initialized in the .cc file
using upper-case letters for constants.
Modified: code/branches/presentationHS15/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/presentationHS15/src/orxonox/controllers/ArtificialController.cc 2016-01-03 16:48:18 UTC (rev 11027)
+++ code/branches/presentationHS15/src/orxonox/controllers/ArtificialController.cc 2016-01-03 19:47:51 UTC (rev 11028)
@@ -93,9 +93,9 @@
if (!this->target_ || !this->getControllableEntity())
return;
- static const float hardcoded_projectile_speed = 750;
+ static const float HARDCODED_PROJECTILE_SPEED = 750;
- this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(), hardcoded_projectile_speed, this->target_->getWorldPosition(), this->target_->getVelocity());
+ this->targetPosition_ = getPredictedPosition(this->getControllableEntity()->getWorldPosition(), HARDCODED_PROJECTILE_SPEED, this->target_->getWorldPosition(), this->target_->getVelocity());
this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO);
Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
Modified: code/branches/presentationHS15/src/orxonox/controllers/CommonController.cc
===================================================================
--- code/branches/presentationHS15/src/orxonox/controllers/CommonController.cc 2016-01-03 16:48:18 UTC (rev 11027)
+++ code/branches/presentationHS15/src/orxonox/controllers/CommonController.cc 2016-01-03 19:47:51 UTC (rev 11028)
@@ -37,6 +37,7 @@
namespace orxonox
{
+ const float CommonController::HARDCODED_PROJECTILE_SPEED = 750;
RegisterClass(CommonController);
CommonController::CommonController(Context* context): Controller(context)
Modified: code/branches/presentationHS15/src/orxonox/controllers/CommonController.h
===================================================================
--- code/branches/presentationHS15/src/orxonox/controllers/CommonController.h 2016-01-03 16:48:18 UTC (rev 11027)
+++ code/branches/presentationHS15/src/orxonox/controllers/CommonController.h 2016-01-03 19:47:51 UTC (rev 11028)
@@ -44,7 +44,7 @@
{
public:
- static const float hardcoded_projectile_speed = 750; //<! FightingController uses it to predict enemy position
+ static const float HARDCODED_PROJECTILE_SPEED; //<! FightingController uses it to predict enemy position
CommonController(Context* context);
virtual ~CommonController();
Modified: code/branches/presentationHS15/src/orxonox/controllers/FightingController.cc
===================================================================
--- code/branches/presentationHS15/src/orxonox/controllers/FightingController.cc 2016-01-03 16:48:18 UTC (rev 11027)
+++ code/branches/presentationHS15/src/orxonox/controllers/FightingController.cc 2016-01-03 19:47:51 UTC (rev 11028)
@@ -205,7 +205,7 @@
if (!this->target_ || !this->getControllableEntity())
return false;
Vector3 newPositionOfTarget = getPredictedPosition(this->getControllableEntity()->getWorldPosition(),
- hardcoded_projectile_speed, this->target_->getWorldPosition(),
+ HARDCODED_PROJECTILE_SPEED, this->target_->getWorldPosition(),
this->target_->getVelocity());
if (!this->target_ || !this->getControllableEntity())
return false;
Modified: code/branches/presentationHS15/src/orxonox/controllers/FlyingController.cc
===================================================================
--- code/branches/presentationHS15/src/orxonox/controllers/FlyingController.cc 2016-01-03 16:48:18 UTC (rev 11027)
+++ code/branches/presentationHS15/src/orxonox/controllers/FlyingController.cc 2016-01-03 19:47:51 UTC (rev 11028)
@@ -36,6 +36,9 @@
namespace orxonox
{
+ const float FlyingController::SPEED = 0.9f/0.02f;
+ const float FlyingController::ROTATEFACTOR = 0.6f/0.02f;
+
RegisterClass (FlyingController);
FlyingController::FlyingController(Context* context): CommonController(context)
Modified: code/branches/presentationHS15/src/orxonox/controllers/FlyingController.h
===================================================================
--- code/branches/presentationHS15/src/orxonox/controllers/FlyingController.h 2016-01-03 16:48:18 UTC (rev 11027)
+++ code/branches/presentationHS15/src/orxonox/controllers/FlyingController.h 2016-01-03 19:47:51 UTC (rev 11028)
@@ -52,8 +52,8 @@
{
public:
- static const float SPEED = 0.9f/0.02f; //<! ship's speed
- static const float ROTATEFACTOR = 0.6f/0.02f; //<! ship's rotation factor
+ static const float SPEED; //<! ship's speed
+ static const float ROTATEFACTOR; //<! ship's rotation factor
FlyingController(Context* context);
virtual ~FlyingController();
More information about the Orxonox-commit
mailing list