Changeset 11735
- Timestamp:
- Feb 11, 2018, 7:19:57 PM (7 years ago)
- Location:
- code/branches/Presentation_HS17_merge/src/modules/asteroidmining
- Files:
-
- 3 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 } -
code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidBelt.cc
r11732 r11735 80 80 81 81 this->mDensity = 0.3; 82 this->foggy = true; 82 83 this->fogDensity = 0.5; 83 84 … … 113 114 } 114 115 115 Vector3 * pos = new Vector3(radius*cos(sepp)*sin(globi), radius*sin(sepp)*sin(globi), radius*cos(globi));116 new SpicedAsteroidField(this->context, this->position + *pos, this->minSize, this->maxSize, width, segmentCount, this->foggy, this->mDensity, this->fogDensity);116 Vector3 pos(radius*cos(sepp)*sin(globi), radius*sin(sepp)*sin(globi), radius*cos(globi)); 117 new SpicedAsteroidField(this->context, this->position + pos, this->minSize, this->maxSize, width, segmentCount, this->foggy, this->mDensity, this->fogDensity); 117 118 118 119 } -
code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidField.cc
r11667 r11735 107 107 int pZ; 108 108 109 Vector3* relPos;110 111 109 for(int gertrud = 0; gertrud<count; ++gertrud){ 112 110 … … 119 117 pY = round(rnd()*2*this->radius) - radius; 120 118 pZ = round(rnd()*2*this->radius) - radius; 121 relPos = new Vector3(pX, pY, pZ);122 a->setPosition(this->position + *relPos);119 Vector3 relPos(pX, pY, pZ); 120 a->setPosition(this->position + relPos); 123 121 124 122 bool spiced = (rnd() < (this->mDensity)); // Whether the asteroid does drop pickups etc. … … 128 126 129 127 // Fog is iplemented with billboards (as in asteroidField.lua, that bloke had the idea) 130 Billboard* bb;131 128 if(this->foggy && mod(gertrud, 5) == 0){ 132 bb = new Billboard(this->context);133 bb->setPosition(this->position + *relPos);129 Billboard* bb = new Billboard(this->context); 130 bb->setPosition(this->position + relPos); 134 131 bb->setMaterial("Smoke/Smoke"); 135 132 bb->setScale(size);
Note: See TracChangeset
for help on using the changeset viewer.