Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 30, 2008, 2:44:48 AM (16 years ago)
Author:
landauf
Message:

added two more graphical classes, ParticleEmitter and ParticleSpawner

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/tools/ParticleInterface.h

    r2019 r2065  
    2121 *
    2222 *   Author:
    23  *      ...
     23 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
    2525 *      ...
     
    4545namespace orxonox
    4646{
    47   class _OrxonoxExport ParticleInterface : public OrxonoxClass
    48   {
    49     public:
    50       ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel);
    51       ~ParticleInterface();
     47    class _OrxonoxExport ParticleInterface : public OrxonoxClass
     48    {
     49        public:
     50            ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel);
     51            virtual ~ParticleInterface();
    5252
    53       inline Ogre::ParticleSystem* getParticleSystem() const
    54         { return this->particleSystem_; }
     53            inline Ogre::ParticleSystem* getParticleSystem() const
     54                { return this->particleSystem_; }
    5555
    56       void addToSceneNode(Ogre::SceneNode* sceneNode);
    57       void detachFromSceneNode();
     56            void addToSceneNode(Ogre::SceneNode* sceneNode);
     57            void detachFromSceneNode();
    5858
    59       Ogre::ParticleEmitter* createNewEmitter();
    60       Ogre::ParticleEmitter* getEmitter(unsigned int emitterNr) const;
    61       void removeEmitter(unsigned int emitterNr);
    62       void removeAllEmitters();
    63       unsigned int getNumEmitters() const;
     59            Ogre::ParticleEmitter* createNewEmitter();
     60            Ogre::ParticleEmitter* getEmitter(unsigned int emitterNr) const;
     61            void removeEmitter(unsigned int emitterNr);
     62            void removeAllEmitters();
     63            unsigned int getNumEmitters() const;
    6464
    65       Ogre::ParticleAffector* addAffector(const std::string& name);
    66       Ogre::ParticleAffector* getAffector(unsigned int affectorNr) const;
    67       void removeAffector(unsigned int affectorNr);
    68       void removeAllAffectors();
    69       unsigned int getNumAffectors() const;
     65            Ogre::ParticleAffector* addAffector(const std::string& name);
     66            Ogre::ParticleAffector* getAffector(unsigned int affectorNr) const;
     67            void removeAffector(unsigned int affectorNr);
     68            void removeAllAffectors();
     69            unsigned int getNumAffectors() const;
    7070
    71       float getSpeedFactor() const;
    72       void setSpeedFactor(float factor);
    73       bool getKeepParticlesInLocalSpace() const;
    74       void setKeepParticlesInLocalSpace(bool keep);
     71            float getSpeedFactor() const;
     72            void setSpeedFactor(float factor);
     73            bool getKeepParticlesInLocalSpace() const;
     74            void setKeepParticlesInLocalSpace(bool keep);
    7575
    76       void setEnabled(bool enable);
    77       void detailLevelChanged(unsigned int newlevel);
     76            void setEnabled(bool enable);
     77            inline bool isEnabled() const
     78                { return this->bEnabled_; }
    7879
    79       inline void storeThisAsCurrentParticleInterface()
    80         { ParticleInterface::currentParticleInterface_s = this; }
    81       inline static ParticleInterface* getCurrentParticleInterface()
    82         { return ParticleInterface::currentParticleInterface_s; }
     80            void setVisible(bool visible);
     81            inline bool isVisible() const
     82                { return this->bVisible_; }
    8383
    84     private:
    85       void updateVisibility();
     84            void detailLevelChanged(unsigned int newlevel);
     85            void setDetailLevel(unsigned int level);
    8686
    87       static ParticleInterface* currentParticleInterface_s;
    88       static unsigned int counter_s;
    89       Ogre::SceneNode* sceneNode_;
    90       Ogre::ParticleSystem* particleSystem_;
    91       bool bVisible_;
    92       bool bEnabled_;
    93       unsigned int detaillevel_;                            //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
    94       Ogre::SceneManager* scenemanager_;
    95   };
     87            inline void storeThisAsCurrentParticleInterface()
     88                { ParticleInterface::currentParticleInterface_s = this; }
     89            inline static ParticleInterface* getCurrentParticleInterface()
     90                { return ParticleInterface::currentParticleInterface_s; }
     91
     92        private:
     93            void updateVisibility();
     94
     95            static ParticleInterface* currentParticleInterface_s;
     96            static unsigned int       counter_s;
     97
     98            Ogre::SceneNode*          sceneNode_;
     99            Ogre::ParticleSystem*     particleSystem_;
     100            bool                      bVisible_;
     101            bool                      bEnabled_;
     102            bool                      bAllowedByLOD_;
     103            unsigned int              detaillevel_;     //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
     104            Ogre::SceneManager*       scenemanager_;
     105    };
    96106}
    97107
Note: See TracChangeset for help on using the changeset viewer.