[673] | 1 | #ifndef _ParticleInterface_H__ |
---|
| 2 | #define _ParticleInterface_H__ |
---|
[535] | 3 | |
---|
[715] | 4 | #include <string> |
---|
| 5 | |
---|
[535] | 6 | // #include "ParticleInterface.h" |
---|
[618] | 7 | // #include <Ogre.h> |
---|
| 8 | // #include <OIS/OIS.h> |
---|
[535] | 9 | // #include <CEGUI/CEGUI.h> |
---|
| 10 | // #include <CEGUIRenderer.h> |
---|
[618] | 11 | #include <OgreParticleSystem.h> |
---|
| 12 | #include <OgreParticleEmitter.h> |
---|
| 13 | #include <OgreSceneManager.h> |
---|
[535] | 14 | |
---|
[708] | 15 | #include "../OrxonoxPrereqs.h" |
---|
[535] | 16 | |
---|
[708] | 17 | #include "misc/Vector3.h" |
---|
| 18 | #include "misc/ColourValue.h" |
---|
[535] | 19 | |
---|
[708] | 20 | |
---|
| 21 | namespace orxonox |
---|
[535] | 22 | { |
---|
| 23 | |
---|
[708] | 24 | class ParticleInterface |
---|
| 25 | { |
---|
| 26 | public: |
---|
[658] | 27 | |
---|
[715] | 28 | ParticleInterface( Ogre::SceneManager *sceneManager, std::string name, std::string templateName ); |
---|
[708] | 29 | ~ParticleInterface( void ); |
---|
[658] | 30 | |
---|
[708] | 31 | void inline addToSceneNode( Ogre::SceneNode* sceneNode ) { sceneNode_ = sceneNode; sceneNode_->attachObject(particleSystem_);}; |
---|
| 32 | void inline detachFromSceneNode( void ) { sceneNode_->detachObject(particleSystem_); sceneNode_ = NULL;}; |
---|
[658] | 33 | |
---|
[708] | 34 | Ogre::ParticleEmitter* getEmitter ( int emitterNr ); |
---|
| 35 | void newEmitter ( void ); |
---|
[658] | 36 | |
---|
[708] | 37 | Vector3 getPositionOfEmitter ( int emitterNr ); |
---|
| 38 | inline void setPositionOfEmitter ( int emitterNr, Vector3 position ) { particleSystem_->getEmitter(emitterNr)->setPosition(position); }; |
---|
[658] | 39 | |
---|
[708] | 40 | inline Vector3 getDirection ( void ) { return particleSystem_->getEmitter(0)->getDirection(); }; |
---|
| 41 | void setDirection ( Vector3 direction ); |
---|
[658] | 42 | |
---|
[708] | 43 | inline Real getVelocity() {return velocity_; }; |
---|
| 44 | void setVelocity( Real v ); |
---|
[658] | 45 | |
---|
[708] | 46 | inline int getRate() { return rate_; }; |
---|
| 47 | void setRate( int r ); |
---|
[658] | 48 | |
---|
[708] | 49 | inline Real getDistance() { return distance_; }; |
---|
| 50 | void setDistance( Real d ); |
---|
[658] | 51 | |
---|
[708] | 52 | inline ColourValue getColour( void ) {return colour_;}; |
---|
| 53 | void setColour( ColourValue colour ); |
---|
[535] | 54 | |
---|
[708] | 55 | void switchEnable(); |
---|
[621] | 56 | |
---|
[708] | 57 | inline Ogre::ParticleSystem* getParticleSystem() { return this->particleSystem_; }; |
---|
[535] | 58 | |
---|
[708] | 59 | private: |
---|
| 60 | Ogre::SceneNode *sceneNode_; |
---|
| 61 | Ogre::SceneManager *sceneManager_; |
---|
| 62 | Ogre::ParticleSystem *particleSystem_; |
---|
| 63 | Real distance_; |
---|
| 64 | Real velocity_; |
---|
| 65 | int rate_; |
---|
| 66 | ColourValue colour_; |
---|
| 67 | int numberOfEmitters_; |
---|
[535] | 68 | |
---|
[708] | 69 | void standardizeEmitters(); |
---|
| 70 | }; |
---|
| 71 | |
---|
[535] | 72 | } |
---|
[708] | 73 | |
---|
[673] | 74 | #endif /* _ParticleInterface_H__ */ |
---|