Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 31, 2015, 12:20:00 PM (9 years ago)
Author:
gania
Message:

move functions were added, everyone stays in formations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc

    r10725 r10729  
    3434
    3535    RegisterClass(WingmanController);
    36     static const int RADIUS_TO_SEARCH_FOR_LEADER = 7000;
    37     static const float ACTION_INTERVAL = 1.0f;
     36   
     37
    3838    WingmanController::WingmanController(Context* context) : CommonController(context)
    3939    {
     
    4141        this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&WingmanController::action, this)));
    4242        this->myLeader_ = 0;
    43         this->desiredRelativePosition_ = 0;
    4443    }
    4544
     
    8887    void WingmanController::action()
    8988    {
    90         //this->target_ = this->sectionTarget_;
    9189        if (!this->myLeader_)
    9290        {
     
    145143
    146144     
    147     /*void WingmanController::keepSectionTick()
    148     {
    149         if (this->myLeader_ && this->myLeader_->getControllableEntity())
    150                             //orxout(internal_error) << "MOVING" << endl;
    151 
    152         if (this->myLeader_ && this->myLeader_->getControllableEntity() && desiredRelativePosition_)
    153         {
    154             Vector3 desiredAbsolutePosition = ((this->myLeader_->getControllableEntity()->getWorldPosition()) +
    155                 (this->myLeader_->getControllableEntity()->getWorldOrientation()* (*desiredRelativePosition_)));
    156             this->moveToPosition (desiredAbsolutePosition);
    157         }
    158     }*/
     145   
    159146    void WingmanController::tick(float dt)
    160147    {   
    161        /* //-------------------------------------------------------
     148        //-------------------------------------------------------
    162149           
    163150       
     
    165152            return;
    166153        //--------------------------Stay in formation--------------------------
    167         this->keepSectionTick();*/
    168            
     154        if (this->bHasTargetPosition_)
     155        {
     156            //targetPosition_ and targetOrientation_ are set by the Leader in its action()
     157            this->moveToTargetPosition();
     158        }
    169159       
    170160        //--------------------------Attack same target as the Leader--------------------------
     
    175165            this->doFire();
    176166        }
    177 */
     167        */
    178168       
    179169        //orxout(internal_error) << "I am " << this << endl;
     
    190180    }
    191181
    192 //**********************************************NEW
    193     /*void WingmanController::defaultBehaviour(float maxrand)
    194     { 
    195        
    196     }*/
     182
    197183
    198184}
Note: See TracChangeset for help on using the changeset viewer.