Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 30, 2015, 11:07:34 PM (8 years ago)
Author:
gania
Message:

fixed pointers

File:
1 edited

Legend:

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

    r10722 r10725  
    3434
    3535    RegisterClass(DivisionController);
     36    static const float ACTION_INTERVAL = 1.0f;
    3637
    3738    DivisionController::DivisionController(Context* context) : LeaderController(context)
    3839    {
    3940        RegisterObject(DivisionController);
     41        this->setFormationMode(WALL);
     42
    4043        bIsDivisionLeader_ = true;
     44        this->myFollower_ = 0;
     45        this->myWingman_ = 0;
     46        this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&DivisionController::action, this)));
     47
    4148    }
    4249
    4350    DivisionController::~DivisionController()
    4451    {
    45         if (this->isInitialized())
    46         {
    47             if (this->myFollower_)
    48                 this->myFollower_->myDivisionLeader_ = 0;
    49             if (this->myWingman_)
    50                 this->myWingman_->myLeader_ = 0;
    51         }
    52     } void DivisionController::tick(float dt)
     52     
     53    }
     54    void DivisionController::tick(float dt)
    5355    {
    5456        SUPER(DivisionController, tick, dt);
    5557
    5658    }
     59    void DivisionController::action()
     60    {
     61/*        setDesiredPositionOfFollower();
     62        setDesiredPositionOfWingman();*/
     63    }
     64
    5765    bool DivisionController::setFollower(LeaderController* myFollower)
    5866    {
     
    6775        }
    6876    }
     77
     78   /* void DivisionController::setDesiredPositionOfWingman()
     79    {
     80        if (!this->myWingman_)
     81            return;
     82
     83        switch (this->formationMode_){
     84            case WALL:
     85            {
     86                myWingman_->desiredRelativePosition_ = new Vector3 (200, 0, 0);   
     87                break;
     88            }
     89            case FINGER4:
     90            {
     91                break;
     92            }
     93            case VEE:
     94            {
     95                break;
     96            }
     97            case DIAMOND:
     98            {
     99                break;
     100            }
     101        }
     102       
     103    }
     104    void DivisionController::setDesiredPositionOfFollower()
     105    {
     106        if (!this->myFollower_)
     107            return;
     108
     109        switch (this->formationMode_){
     110            case WALL:
     111            {
     112                myWingman_->desiredRelativePosition_ = new Vector3 (-200, 0, 0);   
     113                break;
     114            }
     115            case FINGER4:
     116            {
     117                break;
     118            }
     119            case VEE:
     120            {
     121                break;
     122            }
     123            case DIAMOND:
     124            {
     125                break;
     126            }
     127        }
     128       
     129    }*/
    69130    void DivisionController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    70131    {
Note: See TracChangeset for help on using the changeset viewer.