Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 21, 2010, 10:25:27 AM (14 years ago)
Author:
scheusso
Message:

merged rocket branch into presentation3 and cleaned up some things (mostly debug output and intendation)

Location:
code/branches/presentation3
Files:
6 edited
8 copied

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3

  • code/branches/presentation3/src/orxonox/controllers/AIController.cc

    r5929 r6951  
    5757
    5858        // search enemy
    59         random = rnd(maxrand);
     59      /*  random = rnd(maxrand);
    6060        if (random < 15 && (!this->target_))
    61             this->searchNewTarget();
     61            this->searchNewTarget();*/
    6262
    6363        // forget enemy
    64         random = rnd(maxrand);
    65         if (random < 5 && (this->target_))
    66             this->forgetTarget();
     64        //random = rnd(maxrand);
     65        //if (random < 5 && (this->target_))
     66        //    this->forgetTarget();
    6767
    6868        // next enemy
    69         random = rnd(maxrand);
     69  /*      random = rnd(maxrand);
    7070        if (random < 10 && (this->target_))
    71             this->searchNewTarget();
     71            this->searchNewTarget();*/
    7272
    7373        // fly somewhere
     
    8787
    8888        // shoot
    89         random = rnd(maxrand);
    90         if (random < 75 && (this->target_ && !this->bShooting_))
    91             this->bShooting_ = true;
     89        //random = rnd(maxrand);
     90        //if (random < 75 && (this->target_ && !this->bShooting_))
     91        //    this->bShooting_ = true;
    9292
    93         // stop shooting
    94         random = rnd(maxrand);
    95         if (random < 25 && (this->bShooting_))
    96             this->bShooting_ = false;
     93        //// stop shooting
     94        //random = rnd(maxrand);
     95        //if (random < 25 && (this->bShooting_))
     96        //    this->bShooting_ = false;
    9797    }
    9898
  • code/branches/presentation3/src/orxonox/controllers/CMakeLists.txt

    r6417 r6951  
    88  WaypointController.cc
    99  WaypointPatrolController.cc
     10  DroneController.cc
    1011)
  • code/branches/presentation3/src/orxonox/controllers/NewHumanController.cc

    r6598 r6951  
    364364        Ogre::RaySceneQueryResult& result = rsq->execute();
    365365        Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
     366        WorldEntity* myWe = static_cast<WorldEntity*>(this->getControllableEntity());
    366367
    367368        Ogre::RaySceneQueryResult::iterator itr;
    368369        for (itr = result.begin(); itr != result.end(); ++itr)
    369370        {
    370             if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" && itr->distance > 500)
     371//             CCOUT(0) << "testing object as target" << endl;
     372            if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" /*&& itr->distance > 500*/)
    371373            {
    372374                // Try to cast the user pointer
    373375                WorldEntity* wePtr = dynamic_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
     376               
     377                // make sure we don't shoot ourselves
     378                if( wePtr==myWe )
     379                    continue;
     380               
    374381                if (wePtr)
    375382                {
     
    379386                    while (parent)
    380387                    {
    381                         if (this->targetMask_.isExcluded(parent->getIdentifier()))
     388                        if (this->targetMask_.isExcluded(parent->getIdentifier()) || parent==myWe)
    382389                        {
    383390                            parent = parent->getParent();
     
    579586        }
    580587    }
     588       
     589
     590   
     591
     592
    581593}
  • code/branches/presentation3/src/orxonox/controllers/NewHumanController.h

    r6417 r6951  
    6767            virtual void doResumeControl();
    6868
     69
    6970        protected:
    7071            void updateTarget();
  • code/branches/presentation3/src/orxonox/worldentities/CMakeLists.txt

    r6417 r6951  
    1212  SpawnPoint.cc
    1313  TeamSpawnPoint.cc
     14  Drone.cc
    1415)
    1516
Note: See TracChangeset for help on using the changeset viewer.