Changeset 12350 for code/branches/OrxoBlox_FS19
- Timestamp:
- May 9, 2019, 1:56:28 PM (6 years ago)
- Location:
- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
r12349 r12350 225 225 226 226 this->activeWalls_.push_back(this->futureWall_); 227 228 229 for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) 227 for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) { 228 if (this->futureWall_->getStone(i) == nullptr) { 229 orxout() << "Added nullptr to std::list stones_" << endl; 230 } 231 230 232 this->stones_.push_back(this->futureWall_->getStone(i)); 233 } 231 234 //new location of ship 232 235 //new amount of balls … … 235 238 } 236 239 237 void OrxoBlox::createWall( void){240 void OrxoBlox::createWall(){ 238 241 this->futureWall_ = new OrxoBloxWall(this->center_->getContext()); 239 242 // Apply the stone template to the stone. … … 258 261 } 259 262 260 /*OrxoBloxStones* OrxoBlox::CheckForCollision(OrxoBloxBall* Ball) {263 OrxoBloxStones* OrxoBlox::CheckForCollision(OrxoBloxBall* Ball) { 261 264 262 265 orxout() << "Checking for Collision" << endl; … … 264 267 for(OrxoBloxStones* someStone : this->stones_) 265 268 { 269 if(someStone == nullptr) 270 { 271 continue; 272 } 266 273 orxout() << "Checking a stone" << endl; 267 274 const Vector3& StonePosition = someStone->getPosition(); //!< Saves the position of the currentStone 268 275 int size = someStone->getSize(); 269 if((BallPosition.x >= StonePosition.x - size && BallPosition.x <= StonePosition.x + size) ||276 if((BallPosition.x >= StonePosition.x - size && BallPosition.x <= StonePosition.x + size) && 270 277 (BallPosition.z >= StonePosition.z - size && BallPosition.z <= StonePosition.z + size)) { 271 278 orxout() << "FOUND ONE" << endl; … … 275 282 orxout() << "Found nothing...." << endl; 276 283 return nullptr; 277 } */284 } 278 285 279 286 } -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
r12349 r12350 149 149 // Set the ball to be exactly at the boundary. 150 150 position.z = this-> fieldHeight_ / 2; 151 // Set the velocity to zero152 151 153 152 orxoblox_->LevelUp(); … … 212 211 if (position != this->getPosition()) 213 212 this->setPosition(position); 214 //this->Collides((this->orxoblox_->CheckForCollision(this)));213 this->Collides((this->orxoblox_->CheckForCollision(this))); 215 214 216 215 -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc
r12346 r12350 29 29 30 30 31 void OrxoBloxWall::createWall( void){31 void OrxoBloxWall::createWall(){ 32 32 for (unsigned int i=0; i<this->num_Stones_;++i){ 33 33 unsigned int j=1 + static_cast<unsigned int>(rnd(2.0f)); //<! random number between 0 and 2; … … 35 35 this->size_ = 9.0f; 36 36 OrxoBloxStones* stone = new OrxoBloxStones(this->getContext()); 37 if (stone == nullptr) { 38 std::abort(); 39 } 37 40 this->TotalStones_.push_back(stone); 38 41 this->attach(stone); … … 56 59 57 60 } 61 62 this->num_Stones_ = TotalStones_.size(); 58 63 59 64
Note: See TracChangeset
for help on using the changeset viewer.