Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2015, 3:14:40 PM (9 years ago)
Author:
gania
Message:

cleaned source up a bit

File:
1 edited

Legend:

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

    r10925 r10935  
    3939    {
    4040        RegisterObject(WingmanController);
    41         //this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&WingmanController::action, this)));
    4241        this->myLeader_ = 0;
    4342        this->bFirstAction_ = true;
     
    6867       
    6968        SUPER(WingmanController, tick, dt);
    70         if (!this->myLeader_)
    71         {
    72             /*if (this->actionTime_ == 2.0f)
    73             {
    74                 if (this->timeOffset_ >= 0.0f && this->timeOffset_ <= 0.8f && !this->bActionCalled_)
    75                 {
    76                     this->action();
    77                     this->bActionCalled_ = true;
    78                 }
    79                 if (this->timeOffset_ > 1.6f)
    80                 {
    81                     this->bActionCalled_ = false;
    82                 }
    83             }
    84             else
    85             {
    86                 if (this->timeOffset_ > 0.8f && this->timeOffset_ <= 1.6f && !this->bActionCalled_)
    87                 {
    88                     this->action();
    89                     this->bActionCalled_ = true;
    90                 }
    91                 if (this->timeOffset_ > 2.0f)
    92                 {
    93                     this->bActionCalled_ = false;
    94                 }
    95             }*/
    96         }
    97         else
    98         {
    99            /* if (this->timeOffset_ >= this->actionTime_ && this->timeOffset_ <= this->actionTime_ + 0.4f && !this->bActionCalled_)
    100             {
    101                 this->action();
    102                 this->bActionCalled_ = true;
    103             }
    104             if (this->timeOffset_ <= 0.5f)
    105             {
    106                 this->bActionCalled_ = false;
    107             }*/
    108         }
    109        
    11069
    11170    }
     
    157116                    this->setTarget(this->myLeader_->getTarget());
    158117                }
    159                 if (this->hasTarget())
    160                 {
    161                     // this->maneuver();
    162                     // this->bShooting_ = this->canFire();
    163                     // Vector3 healthPosition = bestHealthPickup((this->target_->getWorldPosition() - this->getControllableEntity()->getWorldPosition()).length());
    164                     // if ((this->getControllableEntity()->getWorldPosition() - healthPosition).length() < this->tolerance_)
    165                     // {
    166                     //     //----choose where to go----
    167                     //     this->maneuver();
    168                     // }
    169                     // else
    170                     // {
    171                     //     this->dodgeTowards(healthPosition);
    172                     // }
    173                     // //----fire if you can----
    174                     // this->bShooting_ = this->canFire();               
    175                 }
     118               
    176119            }
    177120        }
Note: See TracChangeset for help on using the changeset viewer.