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