Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10761


Ignore:
Timestamp:
Nov 3, 2015, 2:11:19 PM (8 years ago)
Author:
gania
Message:

Added enums for maneuvers

Location:
code/branches/AI_HS15/src/orxonox/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/AI_HS15/src/orxonox/controllers/CommonController.h

    r10759 r10761  
    5353        };
    5454
     55    }
     56    //none for a formation flight without attacking, neutral when opponent and this have no
     57    //advantage over each other, offensive when this spotted opponent first,
     58    //defensive otherwise
     59    namespace ManeuverType
     60    {
     61        enum Value
     62        {
     63            NONE, NEUTRAL, OFFENSIVE, DEFENCIVE
     64        };
     65
     66    }
     67    //none for a formation flight
     68    namespace Maneuver
     69    {
     70        enum Value
     71        {
     72            NONE, GUNSD, SCISSORS, COMBATSPREAD, DEFENSIVESPLIT, BREAK, BARRELROLL, SWOOP, IMMELMANN,
     73            WINGOVER, LOWYOYO, HIGHYOYO, LAGDISPLACEMENTROLL
     74        };
    5575    }
    5676
     
    128148
    129149
     150            bool bHasObjectivePosition_;
     151            Vector3 objectivePosition_;
     152            bool bHasObjectiveOrientation_;
     153            Quaternion objectiveOrientation_;
     154
    130155            WeakPtr<ControllableEntity> target_;
    131156            bool bShooting_;
     157            WeakPtr<ControllableEntity> objectiveTarget_;
     158
    132159
    133160
    134161            FormationMode::Value formationMode_;
    135162            Rank::Value rank_;
    136 
    137 
     163            ManeuverType::Value maneuverType_;
     164            Maneuver::Value maneuver_;
    138165         
    139166        private:
  • code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc

    r10759 r10761  
    4949
    5050    }
     51    // void WingmanController::chooseManeuver()
     52    // {
     53    //     if (this->maneuverType_ == ManeuverType::NONE)
     54    //     switch (this->maneuverType_ )
     55    //     {
     56    //         case ManeuverType::NONE:
     57    //         {
     58
     59    //             break;
     60    //         }
     61    //         case ManeuverType::NEUTRAL:
     62    //         {
     63
     64    //             break;
     65    //         }
     66    //         case ManeuverType::OFFENSIVE:
     67    //         {
     68
     69    //             break;
     70    //         }
     71    //         case ManeuverType::DEFENSIVE:
     72    //         {
     73
     74    //             break;
     75    //         }
     76    //     }
     77    //     if (!this->myWingman_)
     78    //         return;
     79    //     Vector3* targetRelativePositionOfWingman;
     80    //     switch (this->formationMode_){
     81    //         case FormationMode::WALL:
     82    //         {
     83    //             targetRelativePositionOfWingman = new Vector3 (-400, 0, 0); 
     84    //             break;
     85    //         }
     86    //         case FormationMode::FINGER4:
     87    //         {
     88    //             targetRelativePositionOfWingman = new Vector3 (-400, 0, -200); 
     89    //             break;
     90    //         }
     91    //         case FormationMode::VEE:
     92    //         {
     93    //             break;
     94    //         }
     95    //         case FormationMode::DIAMOND:
     96    //         {
     97    //             targetRelativePositionOfWingman = new Vector3 (400, -200, 0);                 
     98    //             break;
     99    //         }
     100    //     }
     101    //     Quaternion orient = this->getControllableEntity()->getWorldOrientation();
     102       
     103    //     Vector3 targetAbsolutePositionOfWingman = ((this->getControllableEntity()->getWorldPosition()) +
     104    //     (this->getControllableEntity()->getWorldOrientation()* (*targetRelativePositionOfWingman)));
     105       
     106    //     myWingman_->setTargetOrientation(orient);
     107    //     myWingman_->setTargetPosition(targetAbsolutePositionOfWingman);
     108       
     109    // }
    51110
    52111    void WingmanController::tick(float dt)
     
    63122            return;
    64123        //--------------------------Stay in formation--------------------------
     124        if (!this->target_)
     125        {
     126            //stay in formation
     127        }
     128        else
     129        {
     130           
     131        }
    65132        if (this->bHasTargetPosition_)
    66133        {
    67             //targetPosition_ and targetOrientation_ are set by the Leader in its action()
    68134            this->moveToTargetPosition();
    69135        }
Note: See TracChangeset for help on using the changeset viewer.