Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 22, 2015, 5:06:38 PM (8 years ago)
Author:
gania
Message:

some comments added

File:
1 edited

Legend:

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

    r10805 r10826  
    4646
    4747    RegisterClass( CommonController );
    48     float SPEED = 0.9f/0.02f;
    49     float ROTATEFACTOR = 1.0f/0.02f;
     48    const float SPEED = 0.9f/0.02f;
     49    const float ROTATEFACTOR = 1.0f/0.02f;
    5050
    5151    CommonController::CommonController( Context* context ): Controller( context )
     
    5353        this->bSetupWorked = false;
    5454
    55         this->executingManeuver_ = false;
     55       
    5656        this->executingMoveToPoint_ = false;
    5757        this->action_ = Action::FLY;
    5858        this->stopLookingAtTarget();
    59         this->maneuverType_ = ManeuverType::NONE;
     59       
    6060        RegisterObject( CommonController );
    6161    }
     
    6464    CommonController::~CommonController()
    6565    {
    66         orxout(internal_error) << "I died, my Rank is " << rank_ << endl;
     66        //orxout(internal_error) << "I died, my Rank is " << rank_ << endl;
    6767    }
    6868
     
    7777        const std::string valUpper = getUppercase( val );
    7878        FormationMode::Value value;
    79         if ( valUpper == "VEE" )
    80             value = FormationMode::VEE;
    81         else if ( valUpper == "WALL" )
     79       
     80        if ( valUpper == "WALL" )
    8281            value = FormationMode::WALL;
    8382        else if ( valUpper == "FINGER4" )
     
    9493        switch ( this->formationMode_ )
    9594        {
    96             case FormationMode::VEE:
    97             {
    98                 return "VEE";
    99                 break;
    100             }
    10195            case FormationMode::WALL:
    10296            {
     
    246240            }
    247241        }
    248         if ( this->getControllableEntity()  && !this->target_ )
    249         {
    250 
    251             this->maneuverType_ = ManeuverType::NONE;
    252         }
     242       
    253243        //orxout ( internal_error ) << "ManeuverType = " << this->maneuverType_ << endl;
    254244    }
     
    606596
    607597    }
     598    float CommonController::distance (ControllableEntity* entity1, ControllableEntity* entity2)
     599    {
     600        if (!entity1 || !entity2)
     601            return std::numeric_limits<float>::infinity();
     602        return ( entity1->getPosition() - entity2->getPosition() ).length();
     603    }
     604    bool CommonController::sameTeam (ControllableEntity* entity1, ControllableEntity* entity2)
     605    {
     606        if (!entity1 || !entity2)
     607            return false;
     608        return entity1->getTeam() == entity2->getTeam();
     609    }
    608610    void CommonController::doFire()
    609611    {
Note: See TracChangeset for help on using the changeset viewer.