Changeset 11083 for code/trunk/src/orxonox
- Timestamp:
- Jan 21, 2016, 1:59:04 PM (9 years ago)
- Location:
- code/trunk/src/orxonox
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/chat/ChatInputHandler.cc
r11071 r11083 214 214 { 215 215 /* sanity checks */ 216 if( !tocolor ) 217 orxout(internal_warning) << "Empty ListBoxTextItem given to " 218 "ChatInputhandler::sub_setcolor()." << endl; 216 if (!tocolor) 217 { 218 orxout(internal_warning) << "Empty ListBoxTextItem given to " 219 "ChatInputhandler::sub_setcolor()." << endl; 220 return; 221 } 219 222 220 223 /* "hash" the name */ -
code/trunk/src/orxonox/controllers/ActionpointController.cc
r11071 r11083 74 74 void ActionpointController::tick(float dt) 75 75 { 76 if (!this || !this->getControllableEntity() || !this->isActive())76 if (!this->getControllableEntity() || !this->isActive()) 77 77 return; 78 78 … … 86 86 } 87 87 88 if (!this || !this->getControllableEntity())89 return;90 88 //fly 91 89 if (this->bHasTargetPosition_) … … 98 96 } 99 97 100 101 if (!this || !this->getControllableEntity())102 return;103 98 //don't fire rocket each tick 104 99 if (timeout_ <= 0) … … 111 106 } 112 107 113 if (!this || !this->getControllableEntity())114 return;115 108 //sometimes dodge, sometimes attack 116 109 if (this->ticks_ % 80 <= 10) … … 123 116 } 124 117 125 if (!this || !this->getControllableEntity())126 return;127 118 //fire if you can 128 119 if (this->bShooting_) … … 140 131 void ActionpointController::action() 141 132 { 142 if (!this || !this->getControllableEntity() || !this->isActive())133 if (!this->getControllableEntity() || !this->isActive()) 143 134 return; 144 135 … … 152 143 this->startAttackingEnemiesThatAreClose(); 153 144 } 154 if (!this || !this->getControllableEntity())155 return;156 145 157 146 //No action -> pop one from stack … … 161 150 if (this->parsedActionpoints_.empty() && this->loopActionpoints_.empty() && this->bDefaultFightAll_) 162 151 { 163 if (!this || !this->getControllableEntity())164 return;165 152 Point p = { Action::FIGHTALL, "", Vector3::ZERO, false }; 166 153 this->parsedActionpoints_.push_back (p); 167 154 } 168 if (!this || !this->getControllableEntity())169 return;170 155 this->executeActionpoint(); 171 if (!this || !this->getControllableEntity())172 return;173 156 this->bTakenOver_ = false; 174 157 } 175 if (!this || !this->getControllableEntity())176 return;177 158 178 159 //Action fightall -> fight till nobody alive … … 185 166 if (newTarget) 186 167 { 187 if (!this || !this->getControllableEntity())188 return;189 168 this->setAction (Action::FIGHTALL, newTarget); 190 169 } 191 170 else 192 171 { 193 if (!this || !this->getControllableEntity())194 return;195 172 this->nextActionpoint(); 196 if (!this || !this->getControllableEntity())197 return;198 173 this->executeActionpoint(); 199 174 … … 207 182 { 208 183 //----find a target---- 209 ControllableEntity* newTarget = this->closestTarget(); 210 if (!this || !this->getControllableEntity()) 211 return; 184 ControllableEntity* newTarget = this->closestTarget(); 212 185 if (newTarget && 213 186 CommonController::distance (this->getControllableEntity(), newTarget) < this->attackRange_) 214 187 { 215 if (!this || !this->getControllableEntity())216 return;217 188 this->setAction (Action::FIGHT, newTarget); 218 189 } 219 190 else 220 191 { 221 if (!this || !this->getControllableEntity())222 return;223 192 this->nextActionpoint(); 224 if (!this || !this->getControllableEntity())225 return;226 193 this->executeActionpoint(); 227 194 } … … 235 202 { 236 203 ControllableEntity* newTarget = this->closestTarget(); 237 if (!this || !this->getControllableEntity())238 return;239 204 if (newTarget && 240 205 CommonController::distance (this->getControllableEntity(), newTarget) < this->attackRange_) 241 206 { 242 if (!this || !this->getControllableEntity())243 return;244 207 this->setAction (Action::FIGHT, newTarget); 245 208 } 246 209 else 247 210 { 248 if (!this || !this->getControllableEntity())249 return;250 211 this->nextActionpoint(); 251 if (!this || !this->getControllableEntity())252 return;253 212 this->executeActionpoint(); 254 213 } … … 260 219 if (this->squaredDistanceToTarget() <= this->squaredaccuracy_) 261 220 { 262 if (!this || !this->getControllableEntity())263 return;264 221 this->nextActionpoint(); 265 if (!this || !this->getControllableEntity())266 return;267 222 this->executeActionpoint(); 268 223 } … … 272 227 if (!this->getProtect()) 273 228 { 274 if (!this || !this->getControllableEntity())275 return;276 229 this->nextActionpoint(); 277 if (!this || !this->getControllableEntity())278 return;279 230 this->executeActionpoint(); 280 231 } 281 if (!this || !this->getControllableEntity())282 return;283 232 this->stayNearProtect(); 284 233 } 285 234 else if (this->action_ == Action::ATTACK) 286 235 { 287 if (!this || !this->getControllableEntity())288 return;289 236 if (!this->hasTarget()) 290 237 { 291 if (!this || !this->getControllableEntity())292 return;293 238 this->nextActionpoint(); 294 if (!this || !this->getControllableEntity())295 return;296 239 this->executeActionpoint(); 297 240 } … … 408 351 void ActionpointController::setAction (Action action, ControllableEntity* target) 409 352 { 410 if (!this || !this->getControllableEntity())353 if (!this->getControllableEntity()) 411 354 return; 412 355 this->action_ = action; … … 425 368 void ActionpointController::setAction (Action action, const Vector3& target) 426 369 { 427 if (!this || !this->getControllableEntity())370 if (!this->getControllableEntity()) 428 371 return; 429 372 this->action_ = action; … … 436 379 void ActionpointController::setAction (Action action, const Vector3& target, const Quaternion& orient ) 437 380 { 438 if (!this || !this->getControllableEntity())381 if (!this->getControllableEntity()) 439 382 return; 440 383 this->action_ = action; … … 454 397 void ActionpointController::executeActionpoint() 455 398 { 456 if (!this || !this->getControllableEntity())399 if (!this->getControllableEntity()) 457 400 return; 458 401 … … 473 416 else 474 417 { 475 if (!this || !this->getControllableEntity())476 return;477 478 418 this->setTarget(nullptr); 479 419 this->setTargetPosition(this->getControllableEntity()->getWorldPosition()); … … 481 421 return; 482 422 } 483 if (!this || !this->getControllableEntity())484 return;485 423 if (!this->bLoop_ && this->parsedActionpoints_.back().inLoop) 486 424 { 487 425 //MOVES all points that are in loop to a loop vector 488 426 this->fillLoop(); 489 if (!this || !this->getControllableEntity())490 return;491 427 this->bLoop_ = true; 492 428 executeActionpoint(); 493 429 return; 494 430 } 495 if (!this || !this->getControllableEntity())496 return;497 431 this->setAction (p.action); 498 if (!this || !this->getControllableEntity())499 return;500 432 501 433 switch (this->action_) … … 508 440 for (Pawn* pawn : ObjectList<Pawn>()) 509 441 { 510 if (!this || !this->getControllableEntity())511 return;512 442 if (CommonController::getName(pawn) == targetName) 513 443 { … … 520 450 { 521 451 this->setTargetPosition( p.position ); 522 if (!this || !this->getControllableEntity())523 return;524 452 if (this->squaredDistanceToTarget() <= this->squaredaccuracy_) 525 453 { 526 if (!this || !this->getControllableEntity())527 return;528 454 this->nextActionpoint(); 529 if (!this || !this->getControllableEntity())530 return;531 455 this->executeActionpoint(); 532 456 } … … 535 459 case Action::PROTECT: 536 460 { 537 if (!this || !this->getControllableEntity())538 return;539 461 540 462 std::string protectName = p.name; … … 582 504 if (CommonController::getName(pawn) == targetName) 583 505 { 584 if (!this || !this->getControllableEntity())585 return;586 506 this->setTarget (static_cast<ControllableEntity*>(pawn)); 587 507 } … … 590 510 { 591 511 this->nextActionpoint(); 592 if (!this || !this->getControllableEntity())593 return;594 512 this->executeActionpoint(); 595 513 } … … 604 522 void ActionpointController::stayNearProtect() 605 523 { 606 if (!this || !this->getControllableEntity())524 if (!this->getControllableEntity()) 607 525 return; 608 526 … … 626 544 void ActionpointController::nextActionpoint() 627 545 { 628 if (!this || !this->getControllableEntity())629 return;630 546 if (this->bLoop_) 631 547 { … … 653 569 void ActionpointController::moveBackToTop() 654 570 { 655 if (!this || !this->getControllableEntity())571 if (!this->getControllableEntity()) 656 572 return; 657 573 … … 684 600 void ActionpointController::takeActionpoints (const std::vector<Point>& vector, const std::vector<Point>& loop, bool b) 685 601 { 686 if (!this || !this->getControllableEntity())602 if (!this->getControllableEntity()) 687 603 return; 688 604 this->parsedActionpoints_ = vector; 689 if (!this || !this->getControllableEntity())690 return;691 605 this->loopActionpoints_ = loop; 692 606 this->bLoop_ = b; … … 701 615 Pawn* ActionpointController::closestTarget() 702 616 { 703 if (!this || !this->getControllableEntity())617 if (!this->getControllableEntity()) 704 618 return nullptr; 705 619 … … 709 623 for (Pawn* pawn : ObjectList<Pawn>()) 710 624 { 711 if (!this || !this->getControllableEntity())712 return nullptr;713 625 if ( CommonController::sameTeam (this->getControllableEntity(), static_cast<ControllableEntity*>(pawn), gt) ) 714 626 continue; … … 730 642 void ActionpointController::startAttackingEnemiesThatAreClose() 731 643 { 732 if (!this || !this->getControllableEntity())644 if (!this->getControllableEntity()) 733 645 return; 734 646 735 647 if (!this->target_ || (this->target_ && CommonController::distance (this->getControllableEntity(), this->target_) > this->attackRange_)) 736 648 { 737 if (!this || !this->getControllableEntity())738 return;739 649 Pawn* newTarget = this->closestTarget(); 740 650 if ( newTarget && … … 742 652 <= this->attackRange_ ) 743 653 { 744 if (!this || !this->getControllableEntity())745 return;746 654 this->setTarget(newTarget); 747 655 if (this->bLoop_ && !this->bPatrolling_) -
code/trunk/src/orxonox/controllers/DivisionController.cc
r11071 r11083 57 57 void DivisionController::action() 58 58 { 59 if (!this || !this->getControllableEntity() || !this->isActive())59 if (!this->getControllableEntity() || !this->isActive()) 60 60 return; 61 61 62 62 ActionpointController::action(); 63 if (!this || !this->getControllableEntity())64 return;65 63 if (!(this->parsedActionpoints_.empty() && this->loopActionpoints_.empty())) 66 64 { -
code/trunk/src/orxonox/controllers/FightingController.cc
r11071 r11083 58 58 void FightingController::lookAtTarget(float dt) 59 59 { 60 if (!this || !this->getControllableEntity())60 if (!this->getControllableEntity()) 61 61 return; 62 62 ControllableEntity* entity = this->getControllableEntity(); … … 124 124 Vector3 diffUnit = diffVector/diffLength; 125 125 126 if (!this || !this->getControllableEntity())127 return;128 129 126 //too far? well, come closer then 130 127 if (diffLength > this->attackRange_) … … 142 139 this->bKeepFormation_ = false; 143 140 144 if (!this || !this->getControllableEntity())145 return;146 141 if (!this->bDodge_) 147 142 { … … 217 212 float FightingController::squaredDistanceToTarget() const 218 213 { 219 if (!this || !this->getControllableEntity())214 if (!this->getControllableEntity()) 220 215 return 0; 221 216 if (!this->target_ || !this->getControllableEntity()) … … 237 232 Pawn* FightingController::closestTarget() const 238 233 { 239 if (!this || !this->getControllableEntity())234 if (!this->getControllableEntity()) 240 235 return nullptr; 241 236 -
code/trunk/src/orxonox/controllers/ScriptController.cc
r11071 r11083 227 227 { 228 228 // Specify the axis 229 Vector3 *a;229 Vector3 a; 230 230 switch ((int) currentEvent.d) { 231 231 case 3: 232 a = newVector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*math::pi*dl),232 a = Vector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*math::pi*dl), 233 233 this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl), 234 234 this->currentEvent.v1.z); 235 235 break; 236 236 case 2: 237 a = newVector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*math::pi*dl),237 a = Vector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*math::pi*dl), 238 238 this->currentEvent.v1.y, 239 239 this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl)); 240 240 break; 241 241 case 1: 242 a = newVector3(this->currentEvent.v1.x,242 a = Vector3(this->currentEvent.v1.x, 243 243 this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl), 244 244 this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl)); … … 246 246 } 247 247 248 this->entity_->setPosition( *a);248 this->entity_->setPosition(a); 249 249 250 250 /* Look at the specified position */ -
code/trunk/src/orxonox/controllers/SectionController.cc
r11071 r11083 59 59 void SectionController::action() 60 60 { 61 if (!this || !this->getControllableEntity() || !this->isActive())61 if (!this->getControllableEntity() || !this->isActive()) 62 62 return; 63 63 … … 66 66 { 67 67 ActionpointController* newDivisionLeader = findNewDivisionLeader(); 68 if (!this || !this->getControllableEntity())69 return;70 68 71 69 this->myDivisionLeader_ = newDivisionLeader; … … 78 76 { 79 77 ActionpointController::action(); 80 if (!this || !this->getControllableEntity())81 return;82 78 if (!(this->parsedActionpoints_.empty() && this->loopActionpoints_.empty())) 83 79 { … … 98 94 else if (!this->myDivisionLeader_->bKeepFormation_) 99 95 { 100 if (!this || !this->getControllableEntity())101 return;102 96 103 97 if (!this->hasTarget()) … … 121 115 if (action == Action::FIGHT || action == Action::FIGHTALL || action == Action::ATTACK) 122 116 { 123 Pawn* target ;117 Pawn* target = nullptr; 124 118 //----if he has a target---- 125 119 if (this->myDivisionLeader_->hasTarget()) -
code/trunk/src/orxonox/controllers/WingmanController.cc
r11071 r11083 58 58 void WingmanController::action() 59 59 { 60 if (!this || !this->getControllableEntity() || !this->isActive())60 if (!this->getControllableEntity() || !this->isActive()) 61 61 return; 62 62 //----If no leader, find one---- … … 64 64 { 65 65 ActionpointController* newLeader = (findNewLeader()); 66 if (!this || !this->getControllableEntity())67 return;68 66 69 67 this->myLeader_ = newLeader; … … 92 90 else if (!this->myLeader_->bKeepFormation_) 93 91 { 94 if (!this || !this->getControllableEntity())95 return;96 92 97 93 if (!this->hasTarget()) -
code/trunk/src/orxonox/gametypes/LastManStanding.cc
r11071 r11083 88 88 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 89 89 return true; 90 const std::string &message = ""; // resets Camper-Warning-message90 const std::string message = ""; // resets Camper-Warning-message 91 91 this->gtinfo_->sendFadingMessage(message,it->first->getClientID()); 92 92 } … … 195 195 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 196 196 return; 197 const std::string &message = ""; // resets Camper-Warning-message197 const std::string message = ""; // resets Camper-Warning-message 198 198 this->gtinfo_->sendFadingMessage(message,it->first->getClientID()); 199 199 } … … 262 262 if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 263 263 return; 264 const std::string &message = ""; // resets Camper-Warning-message264 const std::string message = ""; // resets Camper-Warning-message 265 265 this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID()); 266 266 } … … 270 270 if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 271 271 continue; 272 const std::string &message = "Camper Warning! Don't forget to shoot.";272 const std::string message = "Camper Warning! Don't forget to shoot."; 273 273 this->gtinfo_->sendFadingMessage(message,mapEntry.first->getClientID()); 274 274 } -
code/trunk/src/orxonox/gametypes/LastTeamStanding.cc
r11071 r11083 136 136 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 137 137 return true; 138 const std::string &message = ""; // resets Camper-Warning-message138 const std::string message = ""; // resets Camper-Warning-message 139 139 this->gtinfo_->sendFadingMessage(message,it->first->getClientID()); 140 140 } … … 170 170 if (it->first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 171 171 return; 172 const std::string &message = ""; // resets Camper-Warning-message172 const std::string message = ""; // resets Camper-Warning-message 173 173 this->gtinfo_->sendFadingMessage(message,it->first->getClientID()); 174 174 } … … 209 209 if (mapEntry.first->getClientID() == NETWORK_PEER_ID_UNKNOWN) 210 210 return; 211 const std::string &message = ""; // resets Camper-Warning-message211 const std::string message = ""; // resets Camper-Warning-message 212 212 this->gtinfo_->sendFadingMessage(message, mapEntry.first->getClientID()); 213 213 } … … 217 217 if (mapEntry.first->getClientID()== NETWORK_PEER_ID_UNKNOWN) 218 218 continue; 219 const std::string &message = "Camper Warning! Don't forget to shoot.";219 const std::string message = "Camper Warning! Don't forget to shoot."; 220 220 this->gtinfo_->sendFadingMessage(message, mapEntry.first->getClientID()); 221 221 } -
code/trunk/src/orxonox/graphics/LensFlare.cc
r11080 r11083 34 34 #include "LensFlare.h" 35 35 36 #include "core/CoreIncludes.h" 36 37 #include "core/XMLPort.h" 37 38 #include "graphics/Billboard.h" 38 39 #include "CameraManager.h" 40 #include "Camera.h" 39 41 #include "RenderQueueListener.h" 42 #include "Scene.h" 40 43 41 44 #include <OgreSphere.h> 42 45 #include <OgreRenderWindow.h> 46 #include <OgreCamera.h> 43 47 44 48 namespace orxonox -
code/trunk/src/orxonox/graphics/LensFlare.h
r11080 r11083 41 41 #include "core/GraphicsManager.h" 42 42 #include "util/Math.h" 43 #include "tools/interfaces/Tickable.h" 43 44 #include "worldentities/StaticEntity.h" 44 45 #include "graphics/Billboard.h" -
code/trunk/src/orxonox/weaponsystem/Munition.cc
r11071 r11083 544 544 if (bUseReloadTime && munition->reloadTime_ > 0 && munition->deployment_ != MunitionDeployment::Stack) 545 545 { 546 const ExecutorPtr &executor = createExecutor(createFunctor(&Magazine::loaded, this));546 const ExecutorPtr executor = createExecutor(createFunctor(&Magazine::loaded, this)); 547 547 executor->setDefaultValues(munition); 548 548 -
code/trunk/src/orxonox/worldentities/StaticEntity.cc
r11071 r11083 54 54 void StaticEntity::registerVariables() 55 55 { 56 registerVariable(this->getPosition(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged)); 57 registerVariable(this->getOrientation(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged)); 56 // Ugly const casts, but are valid because position and orientation are not actually const 57 registerVariable(const_cast<Vector3&>(this->getPosition()), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged)); 58 registerVariable(const_cast<Quaternion&>(this->getOrientation()), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged)); 58 59 } 59 60 -
code/trunk/src/orxonox/worldentities/WorldEntity.cc
r11071 r11083 190 190 registerVariable(this->bVisible_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility)); 191 191 192 registerVariable(this->getScale3D(), VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged)); 192 // Ugly const cast, but is valid because the scale is not actually const 193 registerVariable(const_cast<Vector3&>(this->getScale3D()), VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged)); 193 194 194 195 // Physics stuff -
code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h
r11071 r11083 46 46 virtual ~FpsPlayer(); 47 47 48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;49 virtual void tick(float dt) ;48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 49 virtual void tick(float dt) override; 50 50 void registerVariables(); 51 51 void setConfigValues(); 52 52 53 virtual void moveFrontBack(const Vector2& value) ;54 virtual void moveRightLeft(const Vector2& value) ;55 virtual void moveUpDown(const Vector2& value) ;53 virtual void moveFrontBack(const Vector2& value) override; 54 virtual void moveRightLeft(const Vector2& value) override; 55 virtual void moveUpDown(const Vector2& value) override; 56 56 57 virtual void rotateYaw(const Vector2& value) ;58 virtual void rotatePitch(const Vector2& value) ;59 virtual void rotateRoll(const Vector2& value) ;57 virtual void rotateYaw(const Vector2& value) override; 58 virtual void rotatePitch(const Vector2& value) override; 59 virtual void rotateRoll(const Vector2& value) override; 60 60 61 61 … … 65 65 { return this->meshSrc_; } 66 66 67 void boost(bool bBoost) ; //acctually jump67 void boost(bool bBoost) override; //actually jump 68 68 69 69 virtual void fire(); … … 71 71 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 72 72 73 virtual void addedWeaponPack(WeaponPack* wPack) ;73 virtual void addedWeaponPack(WeaponPack* wPack) override; 74 74 75 75 protected: 76 virtual void setPlayer(PlayerInfo* player) ;77 virtual void startLocalHumanControl() ;76 virtual void setPlayer(PlayerInfo* player) override; 77 virtual void startLocalHumanControl() override; 78 78 bool bInvertYAxis_; 79 79 … … 89 89 90 90 private: 91 virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const ;91 virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const override; 92 92 float speed_; 93 93 -
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
r11071 r11083 235 235 236 236 // This function call adds a lift to the ship when it is rotating to make it's movement more "realistic" and enhance the feeling. 237 if (this->getLocalVelocity().z < 0 && abs(this->getLocalVelocity().z) < stallSpeed_)238 this->moveRightLeft(-lift_ / 5.0f * value * sqrt( abs(this->getLocalVelocity().z)));237 if (this->getLocalVelocity().z < 0 && std::abs(this->getLocalVelocity().z) < stallSpeed_) 238 this->moveRightLeft(-lift_ / 5.0f * value * sqrt(std::abs(this->getLocalVelocity().z))); 239 239 } 240 240 … … 257 257 258 258 // This function call adds a lift to the ship when it is pitching to make it's movement more "realistic" and enhance the feeling. 259 if (this->getLocalVelocity().z < 0 && abs(this->getLocalVelocity().z) < stallSpeed_)260 this->moveUpDown(lift_ / 5.0f * pitch * sqrt( abs(this->getLocalVelocity().z)));259 if (this->getLocalVelocity().z < 0 && std::abs(this->getLocalVelocity().z) < stallSpeed_) 260 this->moveUpDown(lift_ / 5.0f * pitch * sqrt(std::abs(this->getLocalVelocity().z))); 261 261 } 262 262 … … 505 505 this->shakeDt_ += dt; 506 506 507 float frequency = this->shakeFrequency_ * (square( abs(this->getLocalVelocity().z)));507 float frequency = this->shakeFrequency_ * (square(std::abs(this->getLocalVelocity().z))); 508 508 509 509 if (this->shakeDt_ >= 1.0f/frequency)
Note: See TracChangeset
for help on using the changeset viewer.