Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10858


Ignore:
Timestamp:
Nov 25, 2015, 2:53:58 PM (8 years ago)
Author:
gania
Message:

should work, didn't compile

Location:
code/branches/campaignHS15/src/orxonox/controllers
Files:
3 edited

Legend:

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

    r10856 r10858  
    5353        {
    5454            this->myFollower_->takeActionpoints(this->parsedActionpoints_, this->loopActionpoints_, this->bLoop_);
     55            if (this->myWingman_)
     56            {
     57                this->myWingman_->setAction(Action::FIGHTALL);
     58            }
    5559        }
    5660        else if (this->myWingman_)
  • code/branches/campaignHS15/src/orxonox/controllers/SectionController.cc

    r10856 r10858  
    102102            switch (myDivisionLeader_->getAction())
    103103            {
    104                 // case Action::FLY:
    105                 // {
    106                 //     // Vector3 targetRelativePosition = getFormationPosition();
    107                 //     // Quaternion orient =
    108                 //     //     this->myDivisionLeader_->getControllableEntity()->getWorldOrientation();
    109                 //     // Vector3 targetAbsolutePosition =
    110                 //     //     ((this->myDivisionLeader_->getControllableEntity()->getWorldPosition()) +
    111                 //     //         (orient* (targetRelativePosition)));
    112                 //     // this->setAction (Action::FLY, targetAbsolutePosition, orient);
    113                 //     break;
    114                 // }
    115                 // case Action::FIGHT:
    116                 // {
    117 
    118                 //     // this->setAction (Action::FLY, targetAbsolutePosition, orient);
    119                 //     break;
    120                 // }
     104                case Action::FIGHT:
     105                {
     106                    if (!this->hasTarget())
     107                    {
     108                        this->chooseTarget();
     109                    }
     110                    break;
     111                }
     112                case Action::FIGHTALL:
     113                {
     114                    if (!this->hasTarget())
     115                    {
     116                        this->chooseTarget();
     117                    }
     118                    break;
     119                }
     120                case Action::ATTACK:
     121                {
     122                    if (!this->hasTarget())
     123                    {
     124                        this->chooseTarget();
     125                    }
     126                    break;
     127                }
    121128                default:
    122129                {
     
    150157                    }
    151158                }
     159            }
     160            if (this->hasTarget())
     161            {
     162                //----choose where to go----
     163                this->maneuver();
     164                //----fire if you can----
     165                this->bShooting_ = this->canFire();               
    152166            }
    153167        }
     
    210224
    211225            }
    212             this->setAction (Action::FIGHT, orxonox_cast<ControllableEntity*>(target));
     226            this->setTarget (orxonox_cast<ControllableEntity*>(target));
    213227        }
    214228        else
  • code/branches/campaignHS15/src/orxonox/controllers/WingmanController.cc

    r10856 r10858  
    9898            switch (this->myLeader_->getAction())
    9999            {
    100                 // case Action::FLY:
    101                 // {
    102                 //     // Vector3 targetRelativePosition = getFormationPosition();
    103                 //     // Quaternion orient =
    104                 //     //     this->myDivisionLeader_->getControllableEntity()->getWorldOrientation();
    105                 //     // Vector3 targetAbsolutePosition =
    106                 //     //     ((this->myDivisionLeader_->getControllableEntity()->getWorldPosition()) +
    107                 //     //         (orient* (targetRelativePosition)));
    108                 //     // this->setAction (Action::FLY, targetAbsolutePosition, orient);
    109                 //     break;
    110                 // }
    111                 // case Action::FIGHT:
    112                 // {
    113 
    114                 //     // this->setAction (Action::FLY, targetAbsolutePosition, orient);
    115                 //     break;
    116                 // }
     100                case Action::FIGHT:
     101                {
     102                    if (!this->hasTarget())
     103                    {
     104                        this->setTarget(this->myLeader_->getTarget());
     105                    }
     106                    break;
     107                }
     108                case Action::FIGHTALL:
     109                {
     110                    if (!this->hasTarget())
     111                    {
     112                        this->setTarget(this->myLeader_->getTarget());
     113                    }
     114                    break;
     115                }
     116                case Action::ATTACK:
     117                {
     118                    if (!this->hasTarget())
     119                    {
     120                        this->setTarget(this->myLeader_->getTarget());
     121                    }
     122                    break;
     123                }
    117124                default:
    118125                {
     
    146153                    }
    147154                }
     155            }
     156            if (this->hasTarget())
     157            {
     158                //----choose where to go----
     159                this->maneuver();
     160                //----fire if you can----
     161                this->bShooting_ = this->canFire();               
    148162            }
    149163        }
Note: See TracChangeset for help on using the changeset viewer.