Index: code/branches/objecthierarchy/src/orxonox/tools/Mesh.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/tools/Mesh.h	(revision 2044)
+++ code/branches/objecthierarchy/src/orxonox/tools/Mesh.h	(revision 2065)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *      ...
+ *      Fabian 'x3n' Landau
  *   Co-authors:
  *      ...
Index: code/branches/objecthierarchy/src/orxonox/tools/ParticleInterface.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/tools/ParticleInterface.cc	(revision 2044)
+++ code/branches/objecthierarchy/src/orxonox/tools/ParticleInterface.cc	(revision 2065)
@@ -1,28 +1,29 @@
 /*
-*   ORXONOX - the hottest 3D action shooter ever to exist
-*
-*
-*   License notice:
-*
-*   This program is free software; you can redistribute it and/or
-*   modify it under the terms of the GNU General Public License
-*   as published by the Free Software Foundation; either version 2
-*   of the License, or (at your option) any later version.
-*
-*   This program is distributed in the hope that it will be useful,
-*   but WITHOUT ANY WARRANTY; without even the implied warranty of
-*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*   GNU General Public License for more details.
-*
-*   You should have received a copy of the GNU General Public License
-*   along with this program; if not, write to the Free Software
-*   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-*
-*   Author:
-*      ...
-*   Co-authors:
-*      ...
-*
-*/
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
 
 /**
@@ -45,150 +46,164 @@
 namespace orxonox
 {
-  unsigned int ParticleInterface::counter_s = 0;
-  ParticleInterface* ParticleInterface::currentParticleInterface_s = 0;
-
-  ParticleInterface::ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel)
-  {
-    RegisterRootObject(ParticleInterface);
-
-    assert(scenemanager);
-
-    this->scenemanager_ = scenemanager;
-    this->sceneNode_ = 0;
-    this->bEnabled_ = true;
-    this->detaillevel_ = (unsigned int)detaillevel;
-    this->particleSystem_ = this->scenemanager_->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
-    //this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor());
-    this->particleSystem_->setSpeedFactor(1.0f);
-
-    if (GraphicsEngine::getInstance().getDetailLevelParticle() < (unsigned int)this->detaillevel_)
-    {
-      this->bVisible_ = false;
-      this->updateVisibility();
-    }
-    else
-    {
-      this->bVisible_ = true;
-    }
-  }
-
-  ParticleInterface::~ParticleInterface()
-  {
-    this->particleSystem_->removeAllEmitters();
-    this->scenemanager_->destroyParticleSystem(particleSystem_);
-  }
-
-  void ParticleInterface::addToSceneNode(Ogre::SceneNode* sceneNode)
-  {
-    this->sceneNode_ = sceneNode;
-    this->sceneNode_->attachObject(this->particleSystem_);
-  }
-
-  void ParticleInterface::detachFromSceneNode()
-  {
-    if (this->sceneNode_)
-    {
-      this->sceneNode_->detachObject(this->particleSystem_);
-      this->sceneNode_ = 0;
-    }
-  }
-
-  Ogre::ParticleEmitter* ParticleInterface::createNewEmitter()
-  {
-    if (this->particleSystem_->getNumEmitters() > 0)
-    {
-      Ogre::ParticleEmitter* newemitter = this->particleSystem_->addEmitter(this->particleSystem_->getEmitter(0)->getType());
-      this->particleSystem_->getEmitter(0)->copyParametersTo(newemitter);
-      return newemitter;
-    }
-    else
-      return 0;
-  }
-  Ogre::ParticleEmitter* ParticleInterface::getEmitter(unsigned int emitterNr) const
-  {
-    if (emitterNr < this->particleSystem_->getNumEmitters())
-      return this->particleSystem_->getEmitter(emitterNr);
-    else
-      return 0;
-  }
-  void ParticleInterface::removeEmitter(unsigned int emitterNr)
-  {
-    if (emitterNr < this->particleSystem_->getNumEmitters())
-      this->particleSystem_->removeEmitter(emitterNr);
-  }
-  void ParticleInterface::removeAllEmitters()
-  {
-    this->particleSystem_->removeAllEmitters();
-  }
-  unsigned int ParticleInterface::getNumEmitters() const
-  {
-    return this->particleSystem_->getNumEmitters();
-  }
-
-  Ogre::ParticleAffector* ParticleInterface::addAffector(const std::string& name)
-  {
-    return this->particleSystem_->addAffector(name);
-  }
-  Ogre::ParticleAffector* ParticleInterface::getAffector(unsigned int affectorNr) const
-  {
-    if (affectorNr < this->particleSystem_->getNumAffectors())
-      return this->particleSystem_->getAffector(affectorNr);
-    else
-      return 0;
-  }
-  void ParticleInterface::removeAffector(unsigned int affectorNr)
-  {
-    if (affectorNr < this->particleSystem_->getNumAffectors())
-      this->particleSystem_->removeAffector(affectorNr);
-  }
-  void ParticleInterface::removeAllAffectors()
-  {
-    this->particleSystem_->removeAllAffectors();
-  }
-  unsigned int ParticleInterface::getNumAffectors() const
-  {
-    return this->particleSystem_->getNumAffectors();
-  }
-
-  void ParticleInterface::setEnabled(bool enable)
-  {
-    this->bEnabled_ = enable;
-    this->updateVisibility();
-  }
-
-  void ParticleInterface::detailLevelChanged(unsigned int newlevel)
-  {
-    if (newlevel >= (unsigned int)this->detaillevel_)
-      this->bVisible_ = true;
-    else
-      this->bVisible_ = false;
-
-    this->updateVisibility();
-  }
-
-  void ParticleInterface::updateVisibility()
-  {
-    for (unsigned int i = 0; i < this->particleSystem_->getNumEmitters(); i++)
-      this->particleSystem_->getEmitter(i)->setEnabled(this->bEnabled_ && this->bVisible_);
-  }
-
-  void ParticleInterface::setSpeedFactor(float factor)
-  {
-    //this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor() * factor);
-    this->particleSystem_->setSpeedFactor(1.0f * factor);
-  }
-  float ParticleInterface::getSpeedFactor() const
-  {
-    //return (this->particleSystem_->getSpeedFactor() / Orxonox::getInstance().getTimeFactor());
-    return (this->particleSystem_->getSpeedFactor() / 1.0f);
-  }
-
-  bool ParticleInterface::getKeepParticlesInLocalSpace() const
-  {
-    return this->particleSystem_->getKeepParticlesInLocalSpace();
-  }
-  void ParticleInterface::setKeepParticlesInLocalSpace(bool keep)
-  {
-    this->particleSystem_->setKeepParticlesInLocalSpace(keep);
-  }
+    unsigned int ParticleInterface::counter_s = 0;
+    ParticleInterface* ParticleInterface::currentParticleInterface_s = 0;
+
+    ParticleInterface::ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel)
+    {
+        RegisterRootObject(ParticleInterface);
+
+        assert(scenemanager);
+
+        this->scenemanager_ = scenemanager;
+        this->sceneNode_ = 0;
+
+        this->bEnabled_ = true;
+        this->bVisible_ = true;
+        this->bAllowedByLOD_ = true;
+
+        this->particleSystem_ = this->scenemanager_->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName);
+        this->particleSystem_->setSpeedFactor(1.0f);
+        //this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor());
+
+        this->setDetailLevel((unsigned int)detaillevel);
+    }
+
+    ParticleInterface::~ParticleInterface()
+    {
+        this->particleSystem_->removeAllEmitters();
+        this->detachFromSceneNode();
+        this->scenemanager_->destroyParticleSystem(particleSystem_);
+    }
+
+    void ParticleInterface::addToSceneNode(Ogre::SceneNode* sceneNode)
+    {
+        if (this->sceneNode_)
+            this->detachFromSceneNode();
+
+        this->sceneNode_ = sceneNode;
+        this->sceneNode_->attachObject(this->particleSystem_);
+    }
+
+    void ParticleInterface::detachFromSceneNode()
+    {
+        if (this->sceneNode_)
+        {
+            this->sceneNode_->detachObject(this->particleSystem_);
+            this->sceneNode_ = 0;
+        }
+    }
+
+    Ogre::ParticleEmitter* ParticleInterface::createNewEmitter()
+    {
+        if (this->particleSystem_->getNumEmitters() > 0)
+        {
+            Ogre::ParticleEmitter* newemitter = this->particleSystem_->addEmitter(this->particleSystem_->getEmitter(0)->getType());
+            this->particleSystem_->getEmitter(0)->copyParametersTo(newemitter);
+            return newemitter;
+        }
+        else
+            return 0;
+    }
+    Ogre::ParticleEmitter* ParticleInterface::getEmitter(unsigned int emitterNr) const
+    {
+        if (emitterNr < this->particleSystem_->getNumEmitters())
+            return this->particleSystem_->getEmitter(emitterNr);
+        else
+            return 0;
+    }
+    void ParticleInterface::removeEmitter(unsigned int emitterNr)
+    {
+        if (emitterNr < this->particleSystem_->getNumEmitters())
+            this->particleSystem_->removeEmitter(emitterNr);
+    }
+    void ParticleInterface::removeAllEmitters()
+    {
+        this->particleSystem_->removeAllEmitters();
+    }
+    unsigned int ParticleInterface::getNumEmitters() const
+    {
+        return this->particleSystem_->getNumEmitters();
+    }
+
+    Ogre::ParticleAffector* ParticleInterface::addAffector(const std::string& name)
+    {
+        return this->particleSystem_->addAffector(name);
+    }
+    Ogre::ParticleAffector* ParticleInterface::getAffector(unsigned int affectorNr) const
+    {
+        if (affectorNr < this->particleSystem_->getNumAffectors())
+            return this->particleSystem_->getAffector(affectorNr);
+        else
+            return 0;
+    }
+    void ParticleInterface::removeAffector(unsigned int affectorNr)
+    {
+        if (affectorNr < this->particleSystem_->getNumAffectors())
+            this->particleSystem_->removeAffector(affectorNr);
+    }
+    void ParticleInterface::removeAllAffectors()
+    {
+        this->particleSystem_->removeAllAffectors();
+    }
+    unsigned int ParticleInterface::getNumAffectors() const
+    {
+        return this->particleSystem_->getNumAffectors();
+    }
+
+    void ParticleInterface::setEnabled(bool enable)
+    {
+        this->bEnabled_ = enable;
+
+        for (unsigned int i = 0; i < this->particleSystem_->getNumEmitters(); i++)
+            this->particleSystem_->getEmitter(i)->setEnabled(this->bEnabled_ && this->bAllowedByLOD_);
+    }
+
+    void ParticleInterface::setVisible(bool visible)
+    {
+        this->bVisible_ = visible;
+
+        this->particleSystem_->setVisible(this->bVisible_ && this->bAllowedByLOD_);
+    }
+
+    void ParticleInterface::setDetailLevel(unsigned int level)
+    {
+        this->detaillevel_ = level;
+        this->detailLevelChanged(GraphicsEngine::getInstance().getDetailLevelParticle());
+    }
+
+    void ParticleInterface::detailLevelChanged(unsigned int newlevel)
+    {
+        if (newlevel >= (unsigned int)this->detaillevel_)
+            this->bAllowedByLOD_ = true;
+        else
+            this->bAllowedByLOD_ = false;
+
+        this->updateVisibility();
+    }
+
+    void ParticleInterface::updateVisibility()
+    {
+        this->setEnabled(this->isEnabled());
+        this->setVisible(this->isVisible());
+    }
+
+    void ParticleInterface::setSpeedFactor(float factor)
+    {
+        //this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor() * factor);
+        this->particleSystem_->setSpeedFactor(1.0f * factor);
+    }
+    float ParticleInterface::getSpeedFactor() const
+    {
+        //return (this->particleSystem_->getSpeedFactor() / Orxonox::getInstance().getTimeFactor());
+        return (this->particleSystem_->getSpeedFactor() / 1.0f);
+    }
+
+    bool ParticleInterface::getKeepParticlesInLocalSpace() const
+    {
+        return this->particleSystem_->getKeepParticlesInLocalSpace();
+    }
+    void ParticleInterface::setKeepParticlesInLocalSpace(bool keep)
+    {
+        this->particleSystem_->setKeepParticlesInLocalSpace(keep);
+    }
 }
Index: code/branches/objecthierarchy/src/orxonox/tools/ParticleInterface.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/tools/ParticleInterface.h	(revision 2044)
+++ code/branches/objecthierarchy/src/orxonox/tools/ParticleInterface.h	(revision 2065)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *      ...
+ *      Fabian 'x3n' Landau
  *   Co-authors:
  *      ...
@@ -45,53 +45,63 @@
 namespace orxonox
 {
-  class _OrxonoxExport ParticleInterface : public OrxonoxClass
-  {
-    public:
-      ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel);
-      ~ParticleInterface();
+    class _OrxonoxExport ParticleInterface : public OrxonoxClass
+    {
+        public:
+            ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel);
+            virtual ~ParticleInterface();
 
-      inline Ogre::ParticleSystem* getParticleSystem() const
-        { return this->particleSystem_; }
+            inline Ogre::ParticleSystem* getParticleSystem() const
+                { return this->particleSystem_; }
 
-      void addToSceneNode(Ogre::SceneNode* sceneNode);
-      void detachFromSceneNode();
+            void addToSceneNode(Ogre::SceneNode* sceneNode);
+            void detachFromSceneNode();
 
-      Ogre::ParticleEmitter* createNewEmitter();
-      Ogre::ParticleEmitter* getEmitter(unsigned int emitterNr) const;
-      void removeEmitter(unsigned int emitterNr);
-      void removeAllEmitters();
-      unsigned int getNumEmitters() const;
+            Ogre::ParticleEmitter* createNewEmitter();
+            Ogre::ParticleEmitter* getEmitter(unsigned int emitterNr) const;
+            void removeEmitter(unsigned int emitterNr);
+            void removeAllEmitters();
+            unsigned int getNumEmitters() const;
 
-      Ogre::ParticleAffector* addAffector(const std::string& name);
-      Ogre::ParticleAffector* getAffector(unsigned int affectorNr) const;
-      void removeAffector(unsigned int affectorNr);
-      void removeAllAffectors();
-      unsigned int getNumAffectors() const;
+            Ogre::ParticleAffector* addAffector(const std::string& name);
+            Ogre::ParticleAffector* getAffector(unsigned int affectorNr) const;
+            void removeAffector(unsigned int affectorNr);
+            void removeAllAffectors();
+            unsigned int getNumAffectors() const;
 
-      float getSpeedFactor() const;
-      void setSpeedFactor(float factor);
-      bool getKeepParticlesInLocalSpace() const;
-      void setKeepParticlesInLocalSpace(bool keep);
+            float getSpeedFactor() const;
+            void setSpeedFactor(float factor);
+            bool getKeepParticlesInLocalSpace() const;
+            void setKeepParticlesInLocalSpace(bool keep);
 
-      void setEnabled(bool enable);
-      void detailLevelChanged(unsigned int newlevel);
+            void setEnabled(bool enable);
+            inline bool isEnabled() const
+                { return this->bEnabled_; }
 
-      inline void storeThisAsCurrentParticleInterface()
-        { ParticleInterface::currentParticleInterface_s = this; }
-      inline static ParticleInterface* getCurrentParticleInterface()
-        { return ParticleInterface::currentParticleInterface_s; }
+            void setVisible(bool visible);
+            inline bool isVisible() const
+                { return this->bVisible_; }
 
-    private:
-      void updateVisibility();
+            void detailLevelChanged(unsigned int newlevel);
+            void setDetailLevel(unsigned int level);
 
-      static ParticleInterface* currentParticleInterface_s;
-      static unsigned int counter_s;
-      Ogre::SceneNode* sceneNode_;
-      Ogre::ParticleSystem* particleSystem_;
-      bool bVisible_;
-      bool bEnabled_;
-      unsigned int detaillevel_;                            //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
-      Ogre::SceneManager* scenemanager_;
-  };
+            inline void storeThisAsCurrentParticleInterface()
+                { ParticleInterface::currentParticleInterface_s = this; }
+            inline static ParticleInterface* getCurrentParticleInterface()
+                { return ParticleInterface::currentParticleInterface_s; }
+
+        private:
+            void updateVisibility();
+
+            static ParticleInterface* currentParticleInterface_s;
+            static unsigned int       counter_s;
+
+            Ogre::SceneNode*          sceneNode_;
+            Ogre::ParticleSystem*     particleSystem_;
+            bool                      bVisible_;
+            bool                      bEnabled_;
+            bool                      bAllowedByLOD_;
+            unsigned int              detaillevel_;     //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
+            Ogre::SceneManager*       scenemanager_;
+    };
 }
 
