Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 15, 2015, 4:47:35 PM (9 years ago)
Author:
gania
Message:

Finished groundwork: AI fights enemies like I want it to. TODO implement all the functionality of old AI, like Waypoints, XMLPort

File:
1 edited

Legend:

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

    r10793 r10805  
    8787            for(std::vector<WeakPtr<DivisionController> >::iterator it = divisions_.begin(); it != divisions_.end(); ++it)
    8888            {
    89                 if (static_cast<ControllableEntity*>(*itP) != (*it)->getControllableEntity() && !(*it)->hasTarget())
     89                if (static_cast<ControllableEntity*>(*itP) != (*it)->getControllableEntity() && !(*it)->hasTarget()
     90                    && ((*itP)->getWorldPosition() - (*it)->getControllableEntity()->getWorldPosition()).length() < 10000)
    9091                {
    91                     (*it)->setTarget(*itP);
     92                    (*it)->setAction(Action::FIGHT, *itP);
    9293                }
    9394               
     
    9596           
    9697        }
    97 
     98        /*for(std::vector<WeakPtr<DivisionController> >::iterator it = divisions_.begin(); it != divisions_.end(); ++it)
     99        {
     100            Vector3* target = new Vector3 (0, 0, 2000);
     101            (*it)->setAction (Action::FLY, *target);           
     102        }   
     103*/
    98104    }
    99105    void FleetController::tick(float dt)
Note: See TracChangeset for help on using the changeset viewer.