Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/shader/src/orxonox/particle/ParticleInterface.h @ 12141

Last change on this file since 12141 was 1505, checked in by rgrieder, 17 years ago

f* svn: It doesn't even inform you if you attempt to set a non existing property. It is svn:eol-style and not eol-style when using the command by the way…

  • Property svn:eol-style set to native
File size: 3.0 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _ParticleInterface_H__
30#define _ParticleInterface_H__
31
32#include "OrxonoxPrereqs.h"
33
34#include <string>
35
36// #include "ParticleInterface.h"
37// #include <Ogre.h>
38// #include <OIS/OIS.h>
39// #include <CEGUI/CEGUI.h>
40// #include <CEGUIRenderer.h>
41#include <OgreParticleSystem.h>
42#include <OgreParticleEmitter.h>
43#include <OgreSceneManager.h>
44
45#include "util/Math.h"
46
47
48namespace orxonox
49{
50
51  class _OrxonoxExport ParticleInterface
52  {
53  public:
54
55    ParticleInterface( Ogre::SceneManager *sceneManager, std::string name, std::string templateName );
56    ~ParticleInterface( void );
57
58    inline void addToSceneNode( Ogre::SceneNode* sceneNode )
59        { sceneNode_ = sceneNode; sceneNode_->attachObject(particleSystem_);};
60    inline void detachFromSceneNode( void )
61        { sceneNode_->detachObject(particleSystem_); sceneNode_ = NULL;};
62
63    Ogre::ParticleEmitter* getEmitter ( int emitterNr );
64    void newEmitter ( void );
65
66    Vector3 getPositionOfEmitter ( int emitterNr );
67    inline void setPositionOfEmitter ( int emitterNr, Vector3 position )
68        { particleSystem_->getEmitter(emitterNr)->setPosition(position); };
69
70    inline Vector3 getDirection ( void )
71        { return particleSystem_->getEmitter(0)->getDirection(); };
72    void setDirection ( Vector3 direction );
73
74    inline Real getVelocity()
75        {return velocity_; };
76    void setVelocity( Real v );
77
78    inline float getRate()
79      { return rate_; };
80    void setRate( float r );
81
82    inline Real getDistance()
83        { return distance_; };
84    void setDistance( Real d );
85
86    inline ColourValue getColour( void )
87        {return colour_;};
88    void setColour( ColourValue colour );
89
90    void switchEnable();
91
92    inline Ogre::ParticleSystem* getParticleSystem()
93        { return this->particleSystem_; };
94
95  private:
96    Ogre::SceneNode *sceneNode_;
97    Ogre::SceneManager *sceneManager_;
98    Ogre::ParticleSystem *particleSystem_;
99    Real distance_;
100    Real velocity_;
101    float rate_;
102    ColourValue colour_;
103    int numberOfEmitters_;
104
105    void standardizeEmitters();
106  };
107
108}
109
110#endif /* _ParticleInterface_H__ */
Note: See TracBrowser for help on using the repository browser.