Changeset 2493 for code/branches/presentation/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc
- Timestamp:
- Dec 17, 2008, 2:10:11 AM (15 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
- Property svn:mergeinfo changed
/code/branches/weapon2 (added) merged: 2108,2145,2186,2203,2232,2272-2273,2288,2308,2319,2327,2331,2337,2347,2354,2366-2368,2379,2391,2393,2398,2410
- Property svn:mergeinfo changed
-
code/branches/presentation/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc
r2099 r2493 30 30 #include "ParticleProjectile.h" 31 31 32 #include "SpaceShip.h" 32 #include <OgreParticleSystem.h> 33 #include <OgreParticleEmitter.h> 34 35 #include "../../worldentities/pawns/SpaceShip.h" 33 36 #include "core/CoreIncludes.h" 34 37 #include "core/ConfigValueIncludes.h" 38 #include "objects/Scene.h" 35 39 36 40 namespace orxonox … … 38 42 CreateFactory(ParticleProjectile); 39 43 40 ParticleProjectile::ParticleProjectile(BaseObject* creator , Weapon* owner) : BillboardProjectile(creator, owner)44 ParticleProjectile::ParticleProjectile(BaseObject* creator) : BillboardProjectile(creator) 41 45 { 42 46 RegisterObject(ParticleProjectile); 43 47 44 this->particles_ = new ParticleInterface("Orxonox/shot2", LODParticle::normal); 45 this->particles_->addToSceneNode(this->getNode()); 46 this->particles_->setKeepParticlesInLocalSpace(true); 48 this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::normal); 49 this->attachOgreObject(this->particles_->getParticleSystem()); 50 this->particles_->setKeepParticlesInLocalSpace(0); 51 52 this->particles_->getAllEmitters()->setDirection(-WorldEntity::FRONT); 53 /* 47 54 if (this->owner_) 48 55 { … … 52 59 // this->particles_ = 0; 53 60 // } 61 */ 54 62 55 63 this->setConfigValues(); … … 59 67 { 60 68 if (this->isInitialized() && this->particles_) 69 { 70 this->detachOgreObject(this->particles_->getParticleSystem()); 61 71 delete this->particles_; 72 } 62 73 } 63 74 64 75 void ParticleProjectile::setConfigValues() 65 76 { 66 SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback((Projectile*)this, &ParticleProjectile::speedChanged);77 //SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback((Projectile*)this, &ParticleProjectile::speedChanged); 67 78 } 68 79 … … 72 83 this->particles_->setEnabled(this->isVisible()); 73 84 } 74 75 bool ParticleProjectile::create(){76 if(!Projectile::create())77 return false;78 this->particles_->getAllEmitters()->setDirection(-this->getOrientation()*Vector3(1,0,0));79 return true;80 }81 85 }
Note: See TracChangeset
for help on using the changeset viewer.