Changeset 659 for code/branches/FICN/src/orxonox/particle
- Timestamp:
- Dec 20, 2007, 4:10:08 PM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/particle
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/particle/ParticleInterface.cc
r658 r659 43 43 namespace particle { 44 44 45 ParticleInterface::~ParticleInterface(void)46 {47 sceneManager_->destroyParticleSystem(particleSystem_);48 }49 50 45 ParticleInterface::ParticleInterface( SceneManager *sceneManager, String name, String templateName ) 51 46 { … … 62 57 numberOfEmitters_ = particleSystem_->getNumEmitters(); 63 58 standardizeEmitters(); 59 } 60 61 ParticleInterface::~ParticleInterface(void) 62 { 63 sceneManager_->destroyParticleSystem(particleSystem_); 64 64 } 65 65 … … 95 95 distance_ = d; 96 96 //partikel anpassen 97 for (int i=0; i <numberOfEmitters_; i++) {97 for (int i=0; i < numberOfEmitters_; i++) { 98 98 particleSystem_->getEmitter(i)->setTimeToLive(distance_); 99 99 } … … 104 104 colour_ = colour; 105 105 //partikel anpassen 106 for (int i=0; i <numberOfEmitters_; i++) {106 for (int i=0; i < numberOfEmitters_; i++) { 107 107 particleSystem_->getEmitter(i)->setColour(colour_); 108 108 } … … 111 111 ParticleEmitter* ParticleInterface::getEmitter( int emitterNr ) 112 112 { 113 if ( !(emitterNr<numberOfEmitters_)) return NULL;113 if ( (emitterNr >= numberOfEmitters_) || (emitterNr < 0) ) return NULL; 114 114 return particleSystem_->getEmitter(emitterNr); 115 115 } 116 116 117 void ParticleInterface::newEmitter ( void)117 void ParticleInterface::newEmitter () 118 118 { 119 119 particleSystem_->addEmitter(particleSystem_->getEmitter(0)->getType()); 120 numberOfEmitters_=numberOfEmitters_+1;121 particleSystem_->getEmitter(0)->copyParametersTo( particleSystem_->getEmitter(numberOfEmitters_-1) );120 particleSystem_->getEmitter(0)->copyParametersTo( particleSystem_->getEmitter(numberOfEmitters_) ); 121 numberOfEmitters_++; 122 122 } 123 123 -
code/branches/FICN/src/orxonox/particle/ParticleInterface.h
r658 r659 19 19 public: 20 20 21 22 21 ParticleInterface( Ogre::SceneManager *sceneManager, Ogre::String name, Ogre::String templateName ); 22 ~ParticleInterface( void ); 23 23 24 24 void inline addToSceneNode( Ogre::SceneNode* sceneNode ) { sceneNode_ = sceneNode; sceneNode_->attachObject(particleSystem_);}; 25 25 void inline detachFromSceneNode( void ) { sceneNode_->detachObject(particleSystem_); sceneNode_ = NULL;}; 26 26 27 28 27 Ogre::ParticleEmitter* getEmitter ( int emitterNr ); 28 void newEmitter ( void ); 29 29 30 30 Ogre::Vector3 getPositionOfEmitter ( int emitterNr ); … … 32 32 33 33 inline Ogre::Vector3 getDirection ( void ) { return particleSystem_->getEmitter(0)->getDirection(); }; 34 34 void setDirection ( Ogre::Vector3 direction ); 35 35 36 37 36 inline Ogre::Real getVelocity() {return velocity_; }; 37 void setVelocity( Ogre::Real v ); 38 38 39 40 39 inline int getRate() { return rate_; }; 40 void setRate( int r ); 41 41 42 43 42 inline Ogre::Real getDistance() { return distance_; }; 43 void setDistance( Ogre::Real d ); 44 44 45 46 45 inline Ogre::ColourValue getColour( void ) {return colour_;}; 46 void setColour( Ogre::ColourValue colour ); 47 47 48 void switchEnable( void);48 void switchEnable(); 49 49 50 inline Ogre::ParticleSystem* getParticleSystem() { return this->particleSystem_; };50 inline Ogre::ParticleSystem* getParticleSystem() { return this->particleSystem_; }; 51 51 52 52 private: 53 54 53 Ogre::SceneNode *sceneNode_; 54 Ogre::SceneManager *sceneManager_; 55 55 Ogre::ParticleSystem *particleSystem_; 56 57 58 59 60 56 Ogre::Real distance_; 57 Ogre::Real velocity_; 58 int rate_; 59 Ogre::ColourValue colour_; 60 int numberOfEmitters_; 61 61 62 62 void standardizeEmitters(); 63 63 }; 64 65 64 66 65 }
Note: See TracChangeset
for help on using the changeset viewer.