Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2010, 10:47:23 PM (14 years ago)
Author:
solex
Message:

formationflight as good as finished for now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai/src/orxonox/controllers/AIController.cc

    r6978 r6997  
    128128            if  (this->specificMasterAction_ != NONE)
    129129            {
    130                 if (this->specificMasterAction_  == HOLD)
    131130                    this->specificMasterActionHold();
    132131
    133                 if (this->specificMasterAction_  == TURN180)
    134                     this->turn180();
    135 
    136                 if (this->specificMasterAction_ == SPIN)
    137                     this->spin();
     132//                 if (this->specificMasterAction_  == TURN180)
     133//                     this->turn180Init();
     134
     135//                 if (this->specificMasterAction_ == SPIN)
     136//                     this->spinInit();
    138137
    139138//                 if (this->specificMasterAction_ == FOLLOWHUMAN)
     
    144143
    145144                 // make 180 degree turn - a specific Master Action
    146                 random = rnd(maxrand);
     145                random = rnd(1000.0f);
    147146                if (random < 5)
    148                    this->specificMasterAction_ = TURN180;
     147                   this->turn180Init();
    149148
    150149                // spin around - a specific Master Action
    151                 random = rnd(maxrand);
     150                random = rnd(1000.0f);
    152151                if (random < 5)
    153                    this->specificMasterAction_ = SPIN;
     152                   this->spinInit();
    154153
    155154                 // lose master status (only if less than 4 slaves in formation)
     
    191190                // shoot
    192191                random = rnd(maxrand);
    193                 if (!(this->passive_) && random < 15 && (this->target_ && !this->bShooting_))
     192                if (!(this->passive_) && random < 9 && (this->target_ && !this->bShooting_))
    194193                {
    195194                this->bShooting_ = true;
     
    214213        if (this->state_ == MASTER)
    215214        {
     215            if (this->specificMasterAction_ ==  NONE)
     216            {
     217                if (this->target_)
     218                    this->aimAtTarget();
     219
     220                if (this->bHasTargetPosition_)
     221                    this->moveToTargetPosition();
     222
     223                if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
     224                    this->getControllableEntity()->fire(0);
     225            }
     226
     227            if (this->specificMasterAction_  == TURN180)
     228                    this->turn180();
     229
     230            if (this->specificMasterAction_ == SPIN)
     231                    this->spin();
     232        }
     233
     234        if (this->state_ == SLAVE)
     235        {
     236
     237            if (this->bHasTargetPosition_)
     238                this->moveToTargetPosition();
     239
     240        }
     241
     242         if (this->state_ == FREE)
     243        {
    216244            if (this->target_)
    217245                this->aimAtTarget();
     
    219247            if (this->bHasTargetPosition_)
    220248                this->moveToTargetPosition();
    221             if (this->specificMasterAction_ ==  NONE)
    222             {
    223                 if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
    224                     this->getControllableEntity()->fire(0);
    225             }
    226         }
    227 
    228         if (this->state_ == SLAVE)
    229         {
    230 
    231             if (this->bHasTargetPosition_)
    232                 this->moveToTargetPosition();
    233 
    234         }
    235 
    236          if (this->state_ == FREE)
    237         {
    238             if (this->target_)
    239                 this->aimAtTarget();
    240 
    241             if (this->bHasTargetPosition_)
    242                 this->moveToTargetPosition();
    243249
    244250            if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
Note: See TracChangeset for help on using the changeset viewer.