[Orxonox-commit 6103] r10761 - code/branches/AI_HS15/src/orxonox/controllers
gania at orxonox.net
gania at orxonox.net
Tue Nov 3 14:11:20 CET 2015
Author: gania
Date: 2015-11-03 14:11:19 +0100 (Tue, 03 Nov 2015)
New Revision: 10761
Modified:
code/branches/AI_HS15/src/orxonox/controllers/CommonController.h
code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc
Log:
Added enums for maneuvers
Modified: code/branches/AI_HS15/src/orxonox/controllers/CommonController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/CommonController.h 2015-11-02 17:01:56 UTC (rev 10760)
+++ code/branches/AI_HS15/src/orxonox/controllers/CommonController.h 2015-11-03 13:11:19 UTC (rev 10761)
@@ -53,7 +53,27 @@
};
}
+ //none for a formation flight without attacking, neutral when opponent and this have no
+ //advantage over each other, offensive when this spotted opponent first,
+ //defensive otherwise
+ namespace ManeuverType
+ {
+ enum Value
+ {
+ NONE, NEUTRAL, OFFENSIVE, DEFENCIVE
+ };
+ }
+ //none for a formation flight
+ namespace Maneuver
+ {
+ enum Value
+ {
+ NONE, GUNSD, SCISSORS, COMBATSPREAD, DEFENSIVESPLIT, BREAK, BARRELROLL, SWOOP, IMMELMANN,
+ WINGOVER, LOWYOYO, HIGHYOYO, LAGDISPLACEMENTROLL
+ };
+ }
+
class _OrxonoxExport CommonController : public Controller
{
public:
@@ -127,14 +147,21 @@
Quaternion targetOrientation_;
+ bool bHasObjectivePosition_;
+ Vector3 objectivePosition_;
+ bool bHasObjectiveOrientation_;
+ Quaternion objectiveOrientation_;
+
WeakPtr<ControllableEntity> target_;
bool bShooting_;
+ WeakPtr<ControllableEntity> objectiveTarget_;
+
FormationMode::Value formationMode_;
Rank::Value rank_;
-
-
+ ManeuverType::Value maneuverType_;
+ Maneuver::Value maneuver_;
private:
Modified: code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc 2015-11-02 17:01:56 UTC (rev 10760)
+++ code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc 2015-11-03 13:11:19 UTC (rev 10761)
@@ -48,7 +48,66 @@
{
}
+ // void WingmanController::chooseManeuver()
+ // {
+ // if (this->maneuverType_ == ManeuverType::NONE)
+ // switch (this->maneuverType_ )
+ // {
+ // case ManeuverType::NONE:
+ // {
+ // break;
+ // }
+ // case ManeuverType::NEUTRAL:
+ // {
+
+ // break;
+ // }
+ // case ManeuverType::OFFENSIVE:
+ // {
+
+ // break;
+ // }
+ // case ManeuverType::DEFENSIVE:
+ // {
+
+ // break;
+ // }
+ // }
+ // if (!this->myWingman_)
+ // return;
+ // Vector3* targetRelativePositionOfWingman;
+ // switch (this->formationMode_){
+ // case FormationMode::WALL:
+ // {
+ // targetRelativePositionOfWingman = new Vector3 (-400, 0, 0);
+ // break;
+ // }
+ // case FormationMode::FINGER4:
+ // {
+ // targetRelativePositionOfWingman = new Vector3 (-400, 0, -200);
+ // break;
+ // }
+ // case FormationMode::VEE:
+ // {
+ // break;
+ // }
+ // case FormationMode::DIAMOND:
+ // {
+ // targetRelativePositionOfWingman = new Vector3 (400, -200, 0);
+ // break;
+ // }
+ // }
+ // Quaternion orient = this->getControllableEntity()->getWorldOrientation();
+
+ // Vector3 targetAbsolutePositionOfWingman = ((this->getControllableEntity()->getWorldPosition()) +
+ // (this->getControllableEntity()->getWorldOrientation()* (*targetRelativePositionOfWingman)));
+
+ // myWingman_->setTargetOrientation(orient);
+ // myWingman_->setTargetPosition(targetAbsolutePositionOfWingman);
+
+ // }
+
void WingmanController::tick(float dt)
{
//-------------------------------------------------------
@@ -62,9 +121,16 @@
if (!this->isActive())
return;
//--------------------------Stay in formation--------------------------
+ if (!this->target_)
+ {
+ //stay in formation
+ }
+ else
+ {
+
+ }
if (this->bHasTargetPosition_)
{
- //targetPosition_ and targetOrientation_ are set by the Leader in its action()
this->moveToTargetPosition();
}
More information about the Orxonox-commit
mailing list