Changeset 9879 for code/branches/invaders/src/orxonox
- Timestamp:
- Dec 9, 2013, 2:08:26 PM (11 years ago)
- Location:
- code/branches/invaders/src/orxonox/worldentities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/invaders/src/orxonox/worldentities/BigExplosion.cc
r9869 r9879 78 78 } 79 79 80 BigExplosion::BigExplosion(Context* context, Vector3 initVelocity) : MobileEntity(context) 81 { 82 RegisterObject(BigExplosion); 83 this->setVelocity(initVelocity); 84 85 if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) ) 86 ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given."); 87 88 this->bStop_ = false; 89 this->LOD_ = LODParticle::Normal; 90 91 if ( GameMode::showsGraphics() ) 92 { 93 try 94 { 95 this->init(); 96 } 97 catch (const std::exception& ex) 98 { 99 orxout(internal_error) << "Couldn't load particle effect in BigExplosion: " << ex.what() << endl; 100 this->initZero(); 101 } 102 } 103 else 104 { 105 this->initZero(); 106 } 107 108 if (GameMode::isMaster()) 109 { 110 this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this))); 111 } 112 113 this->registerVariables(); 114 } 115 80 116 void BigExplosion::init() 81 117 { … … 152 188 // 153 189 ParticleSpawner* effect = new ParticleSpawner(this->getContext()); 154 // orxout() << "vel " <<getVelocity() << endl;155 // effect->setVelocity( Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10, 200));190 orxout() << "vel " << this->getVelocity() << endl; 191 // effect->setVelocity(this->getVelocity()); 156 192 effect->setDestroyAfterLife(true); 157 193 effect->setSource("Orxonox/explosion2b"); -
code/branches/invaders/src/orxonox/worldentities/BigExplosion.h
r9837 r9879 41 41 public: 42 42 BigExplosion(Context* context); 43 BigExplosion(Context* context, Vector3 initVelocity); 43 44 virtual ~BigExplosion(); 44 45 -
code/branches/invaders/src/orxonox/worldentities/pawns/Pawn.cc
r9837 r9879 365 365 this->setDestroyWhenPlayerLeft(false); 366 366 367 BigExplosion* chunk = new BigExplosion(this->getContext()); 367 orxout() << "big explosion: " << this->getVelocity() << endl; 368 BigExplosion* chunk = new BigExplosion(this->getContext(), this->getVelocity()); 368 369 chunk->setPosition(this->getPosition()); 369 chunk->setVelocity(this->getVelocity());370 // chunk->setVelocity(this->getVelocity()); 370 371 371 372 } … … 377 378 effect->setPosition(this->getPosition()); 378 379 effect->setOrientation(this->getOrientation()); 380 effect->setVelocity(this->getVelocity()); 379 381 effect->setDestroyAfterLife(true); 380 382 effect->setSource("Orxonox/explosion2b"); … … 385 387 effect->setPosition(this->getPosition()); 386 388 effect->setOrientation(this->getOrientation()); 389 effect->setVelocity(this->getVelocity()); 387 390 effect->setDestroyAfterLife(true); 388 391 effect->setSource("Orxonox/smoke6"); … … 393 396 effect->setPosition(this->getPosition()); 394 397 effect->setOrientation(this->getOrientation()); 398 effect->setVelocity(this->getVelocity()); 395 399 effect->setDestroyAfterLife(true); 396 400 effect->setSource("Orxonox/sparks");
Note: See TracChangeset
for help on using the changeset viewer.