Changeset 11054 for code/branches/cpp11_v3/src/modules/jump/JumpFigure.cc
- Timestamp:
- Jan 10, 2016, 1:54:11 PM (8 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/modules/jump/JumpFigure.cc
r10262 r11054 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 #include "graphics/Model.h" 39 #include "JumpRocket.h" 40 #include "JumpPropeller.h" 41 #include "JumpBoots.h" 42 #include "JumpShield.h" 38 43 39 44 namespace orxonox … … 46 51 47 52 // initialize variables 48 leftHand_ = NULL;49 rightHand_ = NULL;53 leftHand_ = nullptr; 54 rightHand_ = nullptr; 50 55 fieldHeight_ = 0; 51 56 fieldWidth_ = 0; … … 70 75 animateHands_ = false; 71 76 turnUp_ = false; 72 rocketActive_ = NULL;73 propellerActive_ = NULL;74 bootsActive_ = NULL;75 shieldActive_ = NULL;77 rocketActive_ = nullptr; 78 propellerActive_ = nullptr; 79 bootsActive_ = nullptr; 80 shieldActive_ = nullptr; 76 81 rocketSpeed_ = 0.0; 77 82 propellerSpeed_ = 0.0; … … 106 111 // Move up/down 107 112 Vector3 velocity = getVelocity(); 108 if (rocketActive_ != NULL)113 if (rocketActive_ != nullptr) 109 114 { 110 115 velocity.z = rocketSpeed_; 111 116 } 112 else if (propellerActive_ != NULL)117 else if (propellerActive_ != nullptr) 113 118 { 114 119 velocity.z = propellerSpeed_; … … 139 144 } 140 145 141 if (leftHand_ != NULL)146 if (leftHand_ != nullptr) 142 147 { 143 148 leftHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(-handAngle_)); 144 149 } 145 if (rightHand_ != NULL)150 if (rightHand_ != nullptr) 146 151 { 147 152 rightHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(handAngle_)); … … 207 212 { 208 213 Vector3 velocity = getVelocity(); 209 if (bootsActive_ == NULL)214 if (bootsActive_ == nullptr) 210 215 { 211 216 velocity.z = 1.2f*jumpSpeed_; … … 234 239 void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy) 235 240 { 236 if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL)241 if (rocketActive_ == nullptr && propellerActive_ == nullptr && shieldActive_ == nullptr) 237 242 { 238 243 dead_ = true; … … 242 247 bool JumpFigure::StartRocket(JumpRocket* rocket) 243 248 { 244 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)249 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 245 250 { 246 251 attach(rocket); … … 261 266 detach(rocket); 262 267 rocket->destroy(); 263 rocketActive_ = NULL;268 rocketActive_ = nullptr; 264 269 } 265 270 266 271 bool JumpFigure::StartPropeller(JumpPropeller* propeller) 267 272 { 268 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)273 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 269 274 { 270 275 attach(propeller); … … 285 290 detach(propeller); 286 291 propeller->destroy(); 287 propellerActive_ = NULL;292 propellerActive_ = nullptr; 288 293 } 289 294 290 295 bool JumpFigure::StartBoots(JumpBoots* boots) 291 296 { 292 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)297 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 293 298 { 294 299 attach(boots); … … 309 314 detach(boots); 310 315 boots->destroy(); 311 bootsActive_ = NULL;316 bootsActive_ = nullptr; 312 317 } 313 318 314 319 bool JumpFigure::StartShield(JumpShield* shield) 315 320 { 316 if (shieldActive_ == false)321 if (shieldActive_ == nullptr) 317 322 { 318 323 attach(shield); … … 333 338 detach(shield); 334 339 shield->destroy(); 335 shieldActive_ = NULL;340 shieldActive_ = nullptr; 336 341 } 337 342
Note: See TracChangeset
for help on using the changeset viewer.