Changeset 2414
- Timestamp:
- Dec 12, 2008, 4:39:13 AM (16 years ago)
- Location:
- code/branches/objecthierarchy2/src/orxonox
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/objects/GlobalShader.cc
r2350 r2414 44 44 45 45 if (!this->getScene()) 46 ThrowException(AbortLoading, "Can't create Camera, no scene given.");46 ThrowException(AbortLoading, "Can't create GlobalShader, no scene given."); 47 47 if (!this->getScene()->getSceneManager()) 48 ThrowException(AbortLoading, "Can't create Camera, no scene manager given.");48 ThrowException(AbortLoading, "Can't create GlobalShader, no scene manager given."); 49 49 50 50 this->shader_.setSceneManager(this->getScene()->getSceneManager()); -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Backlight.cc
r2406 r2414 61 61 { 62 62 if (!this->getScene()) 63 ThrowException(AbortLoading, "Can't create Camera, no scene given.");63 ThrowException(AbortLoading, "Can't create Backlight, no scene given."); 64 64 if (!this->getScene()->getSceneManager()) 65 ThrowException(AbortLoading, "Can't create Camera, no scene manager given.");65 ThrowException(AbortLoading, "Can't create Backlight, no scene manager given."); 66 66 if (!this->getScene()->getRootSceneNode()) 67 ThrowException(AbortLoading, "Can't create Camera, no root scene node given.");67 ThrowException(AbortLoading, "Can't create Backlight, no root scene node given."); 68 68 69 69 this->ribbonTrail_ = this->getScene()->getSceneManager()->createRibbonTrail(this->getNode()->getName()); -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/CMakeLists.txt
r2254 r2414 8 8 Billboard.cc 9 9 BlinkingBillboard.cc 10 ExplosionChunk.cc 10 11 FadingBillboard.cc 11 12 Light.cc -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/ParticleEmitter.cc
r2171 r2414 51 51 52 52 if (!this->getScene() || !this->getScene()->getSceneManager()) 53 ThrowException(AbortLoading, "Can't create Camera, no scene or no scene manager given.");53 ThrowException(AbortLoading, "Can't create ParticleEmitter, no scene or no scene manager given."); 54 54 55 55 this->particles_ = 0; -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Pawn.cc
r2369 r2414 37 37 #include "objects/gametypes/Gametype.h" 38 38 #include "objects/weaponSystem/WeaponSystem.h" 39 #include "objects/worldentities/ParticleSpawner.h" 40 #include "objects/worldentities/ExplosionChunk.h" 39 41 40 42 namespace orxonox … … 56 58 this->lastHitOriginator_ = 0; 57 59 this->weaponSystem_ = 0; 60 61 this->spawnparticleduration_ = 3.0f; 58 62 59 63 /* … … 87 91 XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200); 88 92 XMLPortParam(Pawn, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100); 93 XMLPortParam(Pawn, "spawnparticlesource", setSpawnParticleSource, getSpawnParticleSource, xmlelement, mode); 94 XMLPortParam(Pawn, "spawnparticleduration", setSpawnParticleDuration, getSpawnParticleDuration, xmlelement, mode).defaultValues(3.0f); 95 XMLPortParam(Pawn, "explosionchunks", setExplosionChunks, getExplosionChunks, xmlelement, mode).defaultValues(7); 89 96 } 90 97 … … 133 140 } 134 141 135 void Pawn::spawn ()142 void Pawn::spawneffect() 136 143 { 137 144 // play spawn effect 145 if (this->spawnparticlesource_ != "") 146 { 147 ParticleSpawner* effect = new ParticleSpawner(this); 148 effect->setPosition(this->getPosition()); 149 effect->setOrientation(this->getOrientation()); 150 effect->setDestroyAfterLife(true); 151 effect->setSource(this->spawnparticlesource_); 152 effect->setLifetime(this->spawnparticleduration_); 153 } 138 154 } 139 155 … … 151 167 this->getPlayer()->stopControl(this); 152 168 169 this->deatheffect(); 170 } 171 172 void Pawn::deatheffect() 173 { 153 174 // play death effect 175 { 176 ParticleSpawner* effect = new ParticleSpawner(this); 177 effect->setPosition(this->getPosition()); 178 effect->setOrientation(this->getOrientation()); 179 effect->setDestroyAfterLife(true); 180 effect->setSource("Orxonox/explosion2"); 181 effect->setLifetime(4.0f); 182 } 183 { 184 ParticleSpawner* effect = new ParticleSpawner(this); 185 effect->setPosition(this->getPosition()); 186 effect->setOrientation(this->getOrientation()); 187 effect->setDestroyAfterLife(true); 188 effect->setSource("Orxonox/smoke6"); 189 effect->setLifetime(4.0f); 190 } 191 { 192 ParticleSpawner* effect = new ParticleSpawner(this); 193 effect->setPosition(this->getPosition()); 194 effect->setOrientation(this->getOrientation()); 195 effect->setDestroyAfterLife(true); 196 effect->setSource("Orxonox/sparks"); 197 effect->setLifetime(4.0f); 198 } 199 for (unsigned int i = 0; i < this->numexplosionchunks_; ++i) 200 { 201 ExplosionChunk* chunk = new ExplosionChunk(this); 202 chunk->setPosition(this->getPosition()); 203 204 } 154 205 } 155 206 … … 163 214 { 164 215 this->setHealth(this->initialHealth_); 165 this->spawn ();216 this->spawneffect(); 166 217 } 167 218 -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Pawn.h
r2369 r2414 82 82 { return (WorldEntity*)this; } 83 83 84 inline void setSpawnParticleSource(const std::string& source) 85 { this->spawnparticlesource_ = source; } 86 inline const std::string& getSpawnParticleSource() const 87 { return this->spawnparticlesource_; } 88 89 inline void setSpawnParticleDuration(float duration) 90 { this->spawnparticleduration_ = duration; } 91 inline float getSpawnParticleDuration() const 92 { return this->spawnparticleduration_; } 93 94 inline void setExplosionChunks(unsigned int chunks) 95 { this->numexplosionchunks_ = chunks; } 96 inline unsigned int getExplosionChunks() const 97 { return this->numexplosionchunks_; } 98 84 99 protected: 85 virtual void spawn();86 100 virtual void death(); 101 virtual void deatheffect(); 102 virtual void spawneffect(); 87 103 88 104 bool bAlive_; … … 95 111 96 112 WeaponSystem* weaponSystem_; 113 114 std::string spawnparticlesource_; 115 float spawnparticleduration_; 116 unsigned int numexplosionchunks_; 97 117 }; 98 118 -
code/branches/objecthierarchy2/src/orxonox/tools/ParticleInterface.cc
r2406 r2414 63 63 this->bVisible_ = true; 64 64 this->bAllowedByLOD_ = true; 65 this->speedFactor_ = 1.0f; 65 66 66 67 if (Core::showsGraphics())
Note: See TracChangeset
for help on using the changeset viewer.