Changeset 11054 for code/branches/cpp11_v3/src/modules/pong/PongBall.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/pong/PongBall.cc
r9945 r11054 61 61 this->speed_ = 0; 62 62 this->accelerationFactor_ = 1.0f; 63 this->bat_ = 0;63 this->bat_ = nullptr; 64 64 this->bDeleteBats_ = false; 65 65 this->batID_ = new unsigned int[2]; … … 82 82 else 83 83 { 84 this->defScoreSound_ = 0;85 this->defBatSound_ = 0;86 this->defBoundarySound_ = 0;84 this->defScoreSound_ = nullptr; 85 this->defBatSound_ = nullptr; 86 this->defBoundarySound_ = nullptr; 87 87 } 88 88 } … … 163 163 float distance = 0; 164 164 165 if (this->bat_ != NULL) // If there are bats.165 if (this->bat_ != nullptr) // If there are bats. 166 166 { 167 167 // If the right boundary has been crossed. 168 if (position.x > this->fieldWidth_ / 2 && this->bat_[1] != NULL)168 if (position.x > this->fieldWidth_ / 2 && this->bat_[1] != nullptr) 169 169 { 170 170 // Calculate the distance (in z-direction) between the ball and the center of the bat, weighted by half of the effective length of the bat (with additional 10%) … … 195 195 } 196 196 // If the left boundary has been crossed. 197 else if (position.x < -this->fieldWidth_ / 2 && this->bat_[0] != NULL)197 else if (position.x < -this->fieldWidth_ / 2 && this->bat_[0] != nullptr) 198 198 { 199 199 // Calculate the distance (in z-direction) between the ball and the center of the bat, weighted by half of the effective length of the bat (with additional 10%) … … 285 285 { 286 286 // Make space for the bats, if they don't exist, yet. 287 if (this->bat_ == NULL)287 if (this->bat_ == nullptr) 288 288 { 289 289 this->bat_ = new WeakPtr<PongBat>[2];
Note: See TracChangeset
for help on using the changeset viewer.