Changeset 10695 in orxonox.OLD for trunk/src/world_entities/effects
- Timestamp:
- Jun 14, 2007, 4:46:18 PM (18 years ago)
- Location:
- trunk/src/world_entities/effects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/effects/explosion.cc
r10665 r10695 25 25 #include "particles/sprite_particles.h" 26 26 27 #include "sound/resource_sound_buffer.h" 28 #include "sound_engine.h" 29 30 27 31 ObjectListDefinition(Explosion); 28 32 CREATE_FAST_FACTORY_STATIC(Explosion); … … 38 42 //Explode ! 39 43 ->addMethod("explode", Executor3<Explosion, lua_State*, float, float, float>(&Explosion::explode)) 44 ->addMethod("setExplosionSound", Executor1<Explosion, lua_State*, const std::string&>(&Explosion::setExplosionSound)) 40 45 ); 41 46 … … 55 60 this->lifeCycle = 0.0f; 56 61 this->lifeTime = .5f; 57 62 63 this->explosionSound.setSourceNode(this); 64 58 65 } 59 66 … … 65 72 { 66 73 delete this->emitter; 67 74 if (this->explosionSound.isPlaying()) 75 this->explosionSound.stop(); 68 76 /* this is normaly done by World.cc by deleting the ParticleEngine */ 69 77 if (Explosion::explosionParticles != NULL && Explosion::objectList().size() <= 1) … … 88 96 explosion->emitter->setSize(Vector(x,y,z)); 89 97 explosion->activate(); 98 99 90 100 } 91 101 … … 113 123 this->toList(OM_DEAD_TICK); 114 124 this->lifeCycle = 0.0; 125 126 this->explosionSound.play(this->explosionSoundBuffer, OrxSound::SoundEngine::getInstance()->getEffectsVolume(), 0.01, true); 115 127 } 116 128 -
trunk/src/world_entities/effects/explosion.h
r10665 r10695 8 8 9 9 #include "world_entity.h" 10 #include "sound_source.h" 11 #include "sound_buffer.h" 12 #include "sound/resource_sound_buffer.h" 10 13 11 14 class SpriteParticles; … … 19 22 static void explode (PNode* position, const Vector& size); 20 23 void explode (float x, float y, float z); /// Explode at the current position with size (x,y,z) 24 void setExplosionSound(const std::string& newExplosionSound){ this->explosionSoundBuffer = OrxSound::ResourceSoundBuffer(newExplosionSound); } 21 25 22 26 Explosion (); … … 36 40 static SpriteParticles* explosionParticles; 37 41 BoxEmitter* emitter; 42 43 OrxSound::SoundSource explosionSound; 44 OrxSound::SoundBuffer explosionSoundBuffer; 38 45 }; 39 46
Note: See TracChangeset
for help on using the changeset viewer.