Changeset 6951 for code/branches/presentation3/src/orxonox
- Timestamp:
- May 21, 2010, 10:25:27 AM (14 years ago)
- Location:
- code/branches/presentation3
- Files:
-
- 6 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3
- Property svn:mergeinfo changed
/code/branches/rocket (added) merged: 6778-6781,6783-6785,6803,6809-6811,6813-6818,6827,6834,6863,6878,6900,6902-6905,6943,6948-6950
- Property svn:mergeinfo changed
-
code/branches/presentation3/src/orxonox/controllers/AIController.cc
r5929 r6951 57 57 58 58 // search enemy 59 random = rnd(maxrand);59 /* random = rnd(maxrand); 60 60 if (random < 15 && (!this->target_)) 61 this->searchNewTarget(); 61 this->searchNewTarget();*/ 62 62 63 63 // 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(); 67 67 68 68 // next enemy 69 random = rnd(maxrand);69 /* random = rnd(maxrand); 70 70 if (random < 10 && (this->target_)) 71 this->searchNewTarget(); 71 this->searchNewTarget();*/ 72 72 73 73 // fly somewhere … … 87 87 88 88 // 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; 92 92 93 // stop shooting94 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; 97 97 } 98 98 -
code/branches/presentation3/src/orxonox/controllers/CMakeLists.txt
r6417 r6951 8 8 WaypointController.cc 9 9 WaypointPatrolController.cc 10 DroneController.cc 10 11 ) -
code/branches/presentation3/src/orxonox/controllers/NewHumanController.cc
r6598 r6951 364 364 Ogre::RaySceneQueryResult& result = rsq->execute(); 365 365 Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity()); 366 WorldEntity* myWe = static_cast<WorldEntity*>(this->getControllableEntity()); 366 367 367 368 Ogre::RaySceneQueryResult::iterator itr; 368 369 for (itr = result.begin(); itr != result.end(); ++itr) 369 370 { 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*/) 371 373 { 372 374 // Try to cast the user pointer 373 375 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 374 381 if (wePtr) 375 382 { … … 379 386 while (parent) 380 387 { 381 if (this->targetMask_.isExcluded(parent->getIdentifier()) )388 if (this->targetMask_.isExcluded(parent->getIdentifier()) || parent==myWe) 382 389 { 383 390 parent = parent->getParent(); … … 579 586 } 580 587 } 588 589 590 591 592 581 593 } -
code/branches/presentation3/src/orxonox/controllers/NewHumanController.h
r6417 r6951 67 67 virtual void doResumeControl(); 68 68 69 69 70 protected: 70 71 void updateTarget(); -
code/branches/presentation3/src/orxonox/worldentities/CMakeLists.txt
r6417 r6951 12 12 SpawnPoint.cc 13 13 TeamSpawnPoint.cc 14 Drone.cc 14 15 ) 15 16
Note: See TracChangeset
for help on using the changeset viewer.