Changeset 11735 for code/branches/Presentation_HS17_merge/src/modules/asteroidmining/AsteroidMinable.cc
- Timestamp:
- Feb 11, 2018, 7:19:57 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Presentation_HS17_merge/src/modules/asteroidmining/AsteroidMinable.cc
r11734 r11735 177 177 reborn->setVelocity(this->getVelocity()); 178 178 // reborn->setAngularVelocity(this->getAngularVelocity()); // Add all other stuff, too? 179 (void)reborn; // avoid compiler warning180 179 181 180 this->bAlive_ = false; … … 361 360 for(int fisch = 0; fisch<num; ++fisch){ 362 361 363 Vector3 * pos = new Vector3(0,0,0); // Position offset362 Vector3 pos = Vector3::ZERO; // Position offset 364 363 if(num > 1){// not required if there-s just one child 365 364 float r = masses[fisch]/rScaling; 366 pos = newVector3(r*sin(theta[fisch])*cos(phi[fisch]), r*sin(theta[fisch])*sin(phi[fisch]), r*cos(theta[fisch])); // convert spheric coordinates to vector365 pos = Vector3(r*sin(theta[fisch])*cos(phi[fisch]), r*sin(theta[fisch])*sin(phi[fisch]), r*cos(theta[fisch])); // convert spheric coordinates to vector 367 366 } 368 367 369 AsteroidMinable* child = new AsteroidMinable(this->context, masses[fisch], this->getPosition() + *pos, this->dropStuff);368 AsteroidMinable* child = new AsteroidMinable(this->context, masses[fisch], this->getPosition() + pos, this->dropStuff); 370 369 child->setVelocity(this->getVelocity()); 371 372 if(child == nullptr){373 orxout(internal_error, context::pickups) << "Weird, can't create new AsteroidMinable." << endl;374 }375 370 376 371 }
Note: See TracChangeset
for help on using the changeset viewer.