Changeset 7801 for code/trunk/src/orxonox
- Timestamp:
- Dec 22, 2010, 7:24:24 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 12 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/LevelManager.cc
r7724 r7801 152 152 Ogre::StringVectorPtr levels = Resource::findResourceNames("*.oxw"); 153 153 // Iterate over all *.oxw level files. 154 COUT(3) << "Loading LevelInfos..." << std::endl; 154 155 for (Ogre::StringVector::const_iterator it = levels->begin(); it != levels->end(); ++it) 155 156 { -
code/trunk/src/orxonox/Main.cc
r7431 r7801 54 54 SetCommandLineSwitch(dedicatedClient).information("Start in dedicated client mode"); 55 55 56 /* ADD masterserver command */ 57 SetCommandLineSwitch(masterserver).information("Start in masterserver mode"); 58 56 59 SetCommandLineArgument(generateDoc, "") 57 60 .information("Generates a Doxygen file from things like SetConsoleCommand"); … … 67 70 if (CommandLineParser::getValue("generateDoc").getString().empty()) 68 71 { 72 /* TODO make this clear */ 69 73 game->setStateHierarchy( 70 74 "root" … … 73 77 " standalone,server,client" 74 78 " level" 75 " server,client "79 " server,client,masterserver" 76 80 " level" 77 81 ); … … 90 94 else if (CommandLineParser::getValue("dedicatedClient").getBool()) 91 95 Game::getInstance().requestStates("client, level"); 96 /* ADD masterserver command */ 97 else if (CommandLineParser::getValue("masterserver").getBool()) 98 Game::getInstance().requestStates("masterserver"); 92 99 else 93 100 { -
code/trunk/src/orxonox/controllers/ArtificialController.cc
r7401 r7801 69 69 70 70 this->target_ = 0; 71 this->formationFlight_ = true;71 this->formationFlight_ = false; 72 72 this->passive_ = false; 73 73 this->maxFormationSize_ = STANDARD_MAX_FORMATION_SIZE; -
code/trunk/src/orxonox/controllers/NewHumanController.cc
r7284 r7801 375 375 { 376 376 // CCOUT(0) << "testing object as target" << endl; 377 if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" /*&& itr->distance > 500*/)377 if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" && itr->distance > 200) 378 378 { 379 379 // Try to cast the user pointer -
code/trunk/src/orxonox/gamestates/CMakeLists.txt
r6105 r7801 6 6 GSRoot.cc 7 7 GSServer.cc 8 GSMasterServer.cc 8 9 GSStandalone.cc 9 10 ) -
code/trunk/src/orxonox/gamestates/GSServer.cc
r7401 r7801 34 34 #include "core/GameMode.h" 35 35 #include "network/Server.h" 36 #include "network/Connection.h" 36 37 37 38 namespace orxonox … … 39 40 DeclareGameState(GSServer, "server", false, false); 40 41 41 SetCommandLineArgument(port, 55556).shortcut("p").information("Network communication port to be used 0-65535 (default: 55556)");42 SetCommandLineArgument(port, NETWORK_PORT).shortcut("p").information("Network communication port to be used 0-65535 (default: 55556)"); 42 43 43 44 GSServer::GSServer(const GameStateInfo& info) -
code/trunk/src/orxonox/gametypes/Gametype.cc
r7284 r7801 79 79 else 80 80 this->scoreboard_ = 0; 81 82 /* HACK HACK HACK */ 83 this->dedicatedAddBots_ = createConsoleCommand( "dedicatedAddBots", createExecutor( createFunctor(&Gametype::addBots, this) ) ); 84 this->dedicatedKillBots_ = createConsoleCommand( "dedicatedKillBots", createExecutor( createFunctor(&Gametype::killBots, this) ) ); 85 /* HACK HACK HACK */ 81 86 } 82 87 … … 86 91 { 87 92 this->gtinfo_->destroy(); 93 if( this->dedicatedAddBots_ ) 94 delete this->dedicatedAddBots_; 95 if( this->dedicatedKillBots_ ) 96 delete this->dedicatedKillBots_; 88 97 } 89 98 } -
code/trunk/src/orxonox/gametypes/Gametype.h
r7284 r7801 184 184 // Config Values 185 185 std::string scoreboardTemplate_; 186 187 /* HACK HACK HACK */ 188 ConsoleCommand* dedicatedAddBots_; 189 ConsoleCommand* dedicatedKillBots_; 190 /* HACK HACK HACK */ 186 191 }; 187 192 } -
code/trunk/src/orxonox/infos/Bot.cc
r7673 r7801 86 86 "Alec Trevelyan", 87 87 "Elliot Carver", 88 "Elektra King" 88 "Elektra King", 89 89 "Viktor Zokas", 90 90 "Gustav Graves", -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
r7547 r7801 57 57 this->engine_ = 0; 58 58 59 this->boostPower_ = 10.0f; 60 this->initialBoostPower_ = 10.0f; 61 this->boostRate_ = 5.0; 62 this->boostPowerRate_ = 1.0; 63 this->boostCooldownDuration_ = 5.0; 64 this->bBoostCooldown_ = false; 59 65 60 66 this->bInvertYAxis_ = false; … … 86 92 XMLPortParamVariable(SpaceShip, "auxilaryThrust", auxilaryThrust_, xmlelement, mode); 87 93 XMLPortParamVariable(SpaceShip, "rotationThrust", rotationThrust_, xmlelement, mode); 94 XMLPortParamVariable(SpaceShip, "boostPower", initialBoostPower_, xmlelement, mode); 95 XMLPortParamVariable(SpaceShip, "boostPowerRate", boostPowerRate_, xmlelement, mode); 96 XMLPortParamVariable(SpaceShip, "boostRate", boostRate_, xmlelement, mode); 97 XMLPortParamVariable(SpaceShip, "boostCooldownDuration", boostCooldownDuration_, xmlelement, mode); 88 98 } 89 99 … … 134 144 this->localAngularAcceleration_.setValue(0, 0, 0); 135 145 } 136 } 146 147 if(!this->bBoostCooldown_ && this->boostPower_ < this->initialBoostPower_) 148 { 149 this->boostPower_ += this->boostPowerRate_*dt; 150 } 151 if(this->bBoost_) 152 { 153 this->boostPower_ -=this->boostRate_*dt; 154 if(this->boostPower_ <= 0.0f) 155 { 156 this->bBoost_ = false; 157 this->bBoostCooldown_ = true; 158 this->timer_.setTimer(this->boostCooldownDuration_, false, createExecutor(createFunctor(&SpaceShip::boostCooledDown, this))); 159 } 160 } 161 } 162 } 163 164 void SpaceShip::boostCooledDown(void) 165 { 166 this->bBoostCooldown_ = false; 137 167 } 138 168 … … 175 205 Pawn::rotateRoll(value); 176 206 } 207 208 // TODO: something seems to call this function every tick, could probably handled a little more efficiently! 209 void SpaceShip::setBoost(bool bBoost) 210 { 211 if(bBoost == this->bBoost_) 212 return; 213 214 if(bBoost) 215 this->boost(); 216 else 217 { 218 this->bBoost_ = false; 219 } 220 } 177 221 178 222 void SpaceShip::fire() … … 182 226 void SpaceShip::boost() 183 227 { 184 this->bBoost_ = true; 228 if(!this->bBoostCooldown_) 229 this->bBoost_ = true; 185 230 } 186 231 -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.h
r7547 r7801 34 34 #include <string> 35 35 #include <LinearMath/btVector3.h> 36 #include "tools/Timer.h" 36 37 #include "util/Math.h" 37 38 #include "Pawn.h" … … 69 70 { return this->steering_; } 70 71 71 inline void setBoost(bool bBoost) 72 { this->bBoost_ = bBoost; } 72 void setBoost(bool bBoost); 73 73 inline bool getBoost() const 74 74 { return this->bBoost_; } … … 89 89 90 90 bool bBoost_; 91 bool bBoostCooldown_; 91 92 bool bPermanentBoost_; 93 float boostPower_; 94 float initialBoostPower_; 95 float boostRate_; 96 float boostPowerRate_; 97 float boostCooldownDuration_; 92 98 Vector3 steering_; 93 99 float primaryThrust_; … … 102 108 103 109 void loadEngineTemplate(); 110 111 void boostCooledDown(void); 104 112 105 113 std::string enginetemplate_; 106 114 Engine* engine_; 115 Timer timer_; 107 116 }; 108 117 }
Note: See TracChangeset
for help on using the changeset viewer.