Index: code/trunk/src/orxonox/tools/BillboardSet.cc
===================================================================
--- code/trunk/src/orxonox/tools/BillboardSet.cc	(revision 2171)
+++ code/trunk/src/orxonox/tools/BillboardSet.cc	(revision 2662)
@@ -34,4 +34,5 @@
 
 #include <OgreSceneManager.h>
+#include <OgreBillboardSet.h>
 #include <OgreBillboard.h>
 
Index: code/trunk/src/orxonox/tools/BillboardSet.h
===================================================================
--- code/trunk/src/orxonox/tools/BillboardSet.h	(revision 2171)
+++ code/trunk/src/orxonox/tools/BillboardSet.h	(revision 2662)
@@ -33,5 +33,5 @@
 
 #include <string>
-#include <OgreBillboardSet.h>
+#include <OgrePrerequisites.h>
 
 #include "util/Math.h"
@@ -52,4 +52,6 @@
             inline Ogre::BillboardSet* getBillboardSet()
                 { return this->billboardSet_; }
+            inline Ogre::SceneManager* getSceneManager()
+                { return this->scenemanager_; }
 
             const std::string& getName() const;
Index: code/trunk/src/orxonox/tools/BulletConversions.h
===================================================================
--- code/trunk/src/orxonox/tools/BulletConversions.h	(revision 2662)
+++ code/trunk/src/orxonox/tools/BulletConversions.h	(revision 2662)
@@ -0,0 +1,96 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _BulletConversions_H__
+#define _BulletConversions_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Convert.h"
+#include "util/Math.h"
+#include "LinearMath/btQuaternion.h"
+#include "LinearMath/btVector3.h"
+
+namespace orxonox
+{
+    // Vector3 to btVector3
+    template <>
+    struct ConverterExplicit<orxonox::Vector3, btVector3>
+    {
+        static bool convert(btVector3* output, const orxonox::Vector3& input)
+        {
+            output->setX(input.x);
+            output->setY(input.y);
+            output->setZ(input.z);
+            return true;
+        }
+    };
+
+    // btVector3 to Vector3
+    template <>
+    struct ConverterExplicit<btVector3, orxonox::Vector3>
+    {
+        static bool convert(orxonox::Vector3* output, const btVector3& input)
+        {
+            output->x = input.x();
+            output->y = input.y();
+            output->z = input.z();
+            return true;
+        }
+    };
+
+    // Quaternion to btQuaternion
+    template <>
+    struct ConverterExplicit<orxonox::Quaternion, btQuaternion>
+    {
+        static bool convert(btQuaternion* output, const orxonox::Quaternion& input)
+        {
+            output->setW(input.w);
+            output->setX(input.x);
+            output->setY(input.y);
+            output->setZ(input.z);
+            return true;
+        }
+    };
+
+    // btQuaternion to Vector3
+    template <>
+    struct ConverterExplicit<btQuaternion, orxonox::Quaternion>
+    {
+        static bool convert(orxonox::Quaternion* output, const btQuaternion& input)
+        {
+            output->w = input.w();
+            output->x = input.x();
+            output->y = input.y();
+            output->z = input.z();
+            return true;
+        }
+    };
+}
+
+#endif /* _BulletConversions_H__ */
Index: code/trunk/src/orxonox/tools/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/tools/CMakeLists.txt	(revision 2171)
+++ code/trunk/src/orxonox/tools/CMakeLists.txt	(revision 2662)
@@ -3,4 +3,5 @@
   Mesh.cc
   ParticleInterface.cc
+  Shader.cc
   TextureGenerator.cc
   Timer.cc
Index: code/trunk/src/orxonox/tools/Mesh.cc
===================================================================
--- code/trunk/src/orxonox/tools/Mesh.cc	(revision 2171)
+++ code/trunk/src/orxonox/tools/Mesh.cc	(revision 2662)
@@ -31,4 +31,5 @@
 
 #include <sstream>
+#include <OgreEntity.h>
 #include <OgreSceneManager.h>
 #include <cassert>
Index: code/trunk/src/orxonox/tools/Mesh.h
===================================================================
--- code/trunk/src/orxonox/tools/Mesh.h	(revision 2171)
+++ code/trunk/src/orxonox/tools/Mesh.h	(revision 2662)
@@ -33,5 +33,5 @@
 
 #include <string>
-#include <OgreEntity.h>
+#include <OgrePrerequisites.h>
 
 namespace orxonox
Index: code/trunk/src/orxonox/tools/ParticleInterface.cc
===================================================================
--- code/trunk/src/orxonox/tools/ParticleInterface.cc	(revision 2171)
+++ code/trunk/src/orxonox/tools/ParticleInterface.cc	(revision 2662)
@@ -52,10 +52,9 @@
     ParticleInterface::ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel)
     {
-        RegisterRootObject(ParticleInterface);
+        RegisterObject(ParticleInterface);
 
         assert(scenemanager);
 
         this->scenemanager_ = scenemanager;
-        this->sceneNode_ = 0;
         this->particleSystem_ = 0;
 
@@ -63,4 +62,5 @@
         this->bVisible_ = true;
         this->bAllowedByLOD_ = true;
+        this->speedFactor_ = 1.0f;
 
         if (Core::showsGraphics())
@@ -69,6 +69,5 @@
             {
                 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->setSpeedFactor(1.0f);
             }
             catch (...)
@@ -87,28 +86,5 @@
         {
             this->particleSystem_->removeAllEmitters();
-            this->detachFromSceneNode();
             this->scenemanager_->destroyParticleSystem(this->particleSystem_);
-        }
-    }
-
-    void ParticleInterface::addToSceneNode(Ogre::SceneNode* sceneNode)
-    {
-        if (this->sceneNode_)
-            this->detachFromSceneNode();
-
-        if (this->particleSystem_)
-        {
-            this->sceneNode_ = sceneNode;
-            this->sceneNode_->attachObject(this->particleSystem_);
-        }
-    }
-
-    void ParticleInterface::detachFromSceneNode()
-    {
-        if (this->sceneNode_)
-        {
-            if (this->particleSystem_)
-                this->sceneNode_->detachObject(this->particleSystem_);
-            this->sceneNode_ = 0;
         }
     }
@@ -224,19 +200,12 @@
     void ParticleInterface::setSpeedFactor(float factor)
     {
-        if (this->particleSystem_)
-        {
-//            this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor() * factor);
-            this->particleSystem_->setSpeedFactor(1.0f * factor);
-        }
-    }
-    float ParticleInterface::getSpeedFactor() const
-    {
-        if (this->particleSystem_)
-        {
-//            return (this->particleSystem_->getSpeedFactor() / Orxonox::getInstance().getTimeFactor());
-            return (this->particleSystem_->getSpeedFactor() / 1.0f);
-        }
-        else
-            return 1.0f;
+        this->speedFactor_ = factor;
+
+        if (this->particleSystem_)
+            this->particleSystem_->setSpeedFactor(factor * this->getTimeFactor());
+    }
+    void ParticleInterface::changedTimeFactor(float factor_new, float factor_old)
+    {
+        this->setSpeedFactor(this->speedFactor_);
     }
 
Index: code/trunk/src/orxonox/tools/ParticleInterface.h
===================================================================
--- code/trunk/src/orxonox/tools/ParticleInterface.h	(revision 2171)
+++ code/trunk/src/orxonox/tools/ParticleInterface.h	(revision 2662)
@@ -33,8 +33,9 @@
 
 #include <string>
-#include <OgreParticleEmitter.h>
+#include <OgrePrerequisites.h>
 
 #include "core/OrxonoxClass.h"
 #include "util/Math.h"
+#include "gamestates/GSRoot.h"
 
 #define getAllEmitters() \
@@ -45,5 +46,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport ParticleInterface : public OrxonoxClass
+    class _OrxonoxExport ParticleInterface : public TimeFactorListener
     {
         public:
@@ -53,7 +54,4 @@
             inline Ogre::ParticleSystem* getParticleSystem() const
                 { return this->particleSystem_; }
-
-            void addToSceneNode(Ogre::SceneNode* sceneNode);
-            void detachFromSceneNode();
 
             Ogre::ParticleEmitter* createNewEmitter();
@@ -69,5 +67,6 @@
             unsigned int getNumAffectors() const;
 
-            float getSpeedFactor() const;
+            inline float getSpeedFactor() const
+                { return this->speedFactor_; }
             void setSpeedFactor(float factor);
             bool getKeepParticlesInLocalSpace() const;
@@ -90,4 +89,7 @@
                 { return ParticleInterface::currentParticleInterface_s; }
 
+        protected:
+            virtual void changedTimeFactor(float factor_new, float factor_old);
+
         private:
             void updateVisibility();
@@ -96,5 +98,4 @@
             static unsigned int       counter_s;
 
-            Ogre::SceneNode*          sceneNode_;
             Ogre::ParticleSystem*     particleSystem_;
             bool                      bVisible_;
@@ -102,4 +103,5 @@
             bool                      bAllowedByLOD_;
             unsigned int              detaillevel_;     //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
+            float                     speedFactor_;
             Ogre::SceneManager*       scenemanager_;
     };
Index: code/trunk/src/orxonox/tools/Shader.cc
===================================================================
--- code/trunk/src/orxonox/tools/Shader.cc	(revision 2662)
+++ code/trunk/src/orxonox/tools/Shader.cc	(revision 2662)
@@ -0,0 +1,336 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Shader.h"
+
+#include <OgreCompositorManager.h>
+#include <OgreCompositorInstance.h>
+#include <OgreSceneManager.h>
+#include <OgreRoot.h>
+#include <OgrePlugin.h>
+
+#include "core/Core.h"
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "GraphicsEngine.h"
+#include "util/Exception.h"
+
+#include <OgreMaterial.h>
+#include <OgreTechnique.h>
+#include <OgrePass.h>
+#include <OgreMaterialManager.h>
+
+namespace orxonox
+{
+    bool Shader::bLoadedCgPlugin_s = false;
+    Shader::MaterialMap Shader::parameters_s;
+
+    Shader::Shader(Ogre::SceneManager* scenemanager) : compositorInstance_(0)
+    {
+        RegisterObject(Shader);
+
+        this->scenemanager_ = scenemanager;
+        this->compositorInstance_ = 0;
+        this->bVisible_ = true;
+        this->bLoadCompositor_ = Core::showsGraphics() && GraphicsEngine::getInstancePtr();
+        this->bViewportInitialized_ = false;
+        this->compositor_ = "";
+        this->oldcompositor_ = "";
+
+        if (this->bLoadCompositor_ && Ogre::Root::getSingletonPtr())
+        {
+            Shader::bLoadedCgPlugin_s = false;
+            const Ogre::Root::PluginInstanceList& plugins = Ogre::Root::getSingleton().getInstalledPlugins();
+            for (size_t i = 0; i < plugins.size(); ++i)
+            {
+                if (plugins[i]->getName() == "Cg Program Manager")
+                {
+                    Shader::bLoadedCgPlugin_s = true;
+                    break;
+                }
+            }
+        }
+
+        this->bLoadCompositor_ &= Shader::bLoadedCgPlugin_s;
+    }
+
+    Shader::~Shader()
+    {
+
+        if (this->bLoadCompositor_ && this->compositorInstance_)
+        {
+            Ogre::Viewport* viewport = GraphicsEngine::getInstance().getViewport();
+            assert(viewport);
+            Ogre::CompositorManager::getSingleton().removeCompositor(viewport, this->compositor_);
+        }
+
+    }
+
+    void Shader::setSceneManager(Ogre::SceneManager* scenemanager)
+    {
+        this->scenemanager_ = scenemanager;
+        this->bViewportInitialized_ = false;
+    }
+
+    void Shader::tick(float dt)
+    {
+        SUPER(Shader, tick, dt);
+
+        if (this->bLoadCompositor_ && !this->bViewportInitialized_ && this->scenemanager_ && this->scenemanager_->getCurrentViewport())
+        {
+            this->bViewportInitialized_ = true;
+            this->updateVisibility();
+        }
+    }
+
+    void Shader::changedCompositor()
+    {
+        if (this->bLoadCompositor_)
+        {
+            Ogre::Viewport* viewport = GraphicsEngine::getInstance().getViewport();
+            assert(viewport);
+            if (this->oldcompositor_ != "")
+            {
+                Ogre::CompositorManager::getSingleton().removeCompositor(viewport, this->oldcompositor_);
+                this->compositorInstance_ = 0;
+            }
+            if (this->compositor_ != "")
+            {
+                this->compositorInstance_ = Ogre::CompositorManager::getSingleton().addCompositor(viewport, this->compositor_);
+                if (!this->compositorInstance_)
+                    COUT(2) << "Warning: Couldn't load compositor with name \"" << this->compositor_ << "\"." << std::endl;
+                Ogre::CompositorManager::getSingleton().setCompositorEnabled(viewport, this->compositor_, this->bViewportInitialized_ && this->isVisible());
+            }
+            this->oldcompositor_ = this->compositor_;
+        }
+    }
+
+    void Shader::updateVisibility()
+    {
+        if (this->compositorInstance_ && this->scenemanager_)
+            this->compositorInstance_->setEnabled(this->scenemanager_->getCurrentViewport() && this->isVisible());
+    }
+
+    void Shader::setParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter, float value)
+    {
+        if (Shader::_setParameter(material, technique, pass, parameter, value))
+        {
+            if (this->bViewportInitialized_ && this->compositorInstance_ && this->isVisible())
+            {
+                this->compositorInstance_->setEnabled(false);
+                this->compositorInstance_->setEnabled(true);
+            }
+        }
+    }
+
+    void Shader::setParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter, int value)
+    {
+        if (Shader::_setParameter(material, technique, pass, parameter, value))
+        {
+            if (this->bViewportInitialized_ && this->compositorInstance_ && this->isVisible())
+            {
+                this->compositorInstance_->setEnabled(false);
+                this->compositorInstance_->setEnabled(true);
+            }
+        }
+    }
+
+    bool Shader::_setParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter, float value)
+    {
+        ParameterPointer* pointer = Shader::getParameterPointer(material, technique, pass, parameter);
+        if (pointer)
+        {
+            if (pointer->first)
+            {
+                if ((*((float*)pointer->second)) != value)
+                {
+                    (*((float*)pointer->second)) = value;
+                    return true;
+                }
+            }
+            else
+            {
+                if ((*((int*)pointer->second)) != (int)value)
+                {
+                    (*((int*)pointer->second)) = (int)value;
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    bool Shader::_setParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter, int value)
+    {
+        ParameterPointer* pointer = Shader::getParameterPointer(material, technique, pass, parameter);
+        if (pointer)
+        {
+            if (pointer->first)
+            {
+                if ((*((float*)pointer->second)) != (float)value)
+                {
+                    (*((float*)pointer->second)) = (float)value;
+                    return true;
+                }
+            }
+            else
+            {
+                if ((*((int*)pointer->second)) != value)
+                {
+                    (*((int*)pointer->second)) = value;
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    float Shader::getParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter)
+    {
+        ParameterPointer* pointer = Shader::getParameterPointer(material, technique, pass, parameter);
+        if (pointer)
+        {
+            if (pointer->first)
+                return (*((float*)pointer->second));
+            else
+                return (*((int*)pointer->second));
+        }
+        else
+            return 0;
+    }
+
+    bool Shader::getParameterIsFloat(const std::string& material, size_t technique, size_t pass, const std::string& parameter)
+    {
+        ParameterPointer* pointer = Shader::getParameterPointer(material, technique, pass, parameter);
+        if (pointer)
+            return pointer->first;
+        else
+            return false;
+    }
+
+    bool Shader::getParameterIsInt(const std::string& material, size_t technique, size_t pass, const std::string& parameter)
+    {
+        ParameterPointer* pointer = Shader::getParameterPointer(material, technique, pass, parameter);
+        if (pointer)
+            return (!pointer->first);
+        else
+            return false;
+    }
+
+    Shader::ParameterPointer* Shader::getParameterPointer(const std::string& material, size_t technique, size_t pass, const std::string& parameter)
+    {
+        if (!Core::showsGraphics() || !Shader::bLoadedCgPlugin_s)
+            return 0;
+
+        MaterialMap::iterator material_iterator = Shader::parameters_s.find(material);
+        if (material_iterator != Shader::parameters_s.end())
+        {
+            TechniqueVector& technique_vector = material_iterator->second;
+            if (technique < technique_vector.size())
+            {
+                PassVector& pass_vector = technique_vector[technique];
+                if (pass < pass_vector.size())
+                {
+                    ParameterMap& parameter_map = pass_vector[pass];
+                    ParameterMap::iterator parameter_iterator = parameter_map.find(parameter);
+
+                    if (parameter_iterator != parameter_map.end())
+                        return (&parameter_iterator->second);
+                    else
+                        COUT(2) << "Warning: No shader parameter \"" << parameter << "\" in pass " << pass << " in technique " << technique << " in material \"" << material << "\"." << std::endl;
+                }
+                else
+                    COUT(2) << "Warning: No pass " << pass << " in technique " << technique << " in material \"" << material << "\" or pass has no shader." << std::endl;
+            }
+            else
+                COUT(2) << "Warning: No technique " << technique << " in material \"" << material << "\" or technique has no pass with shader." << std::endl;
+        }
+        else
+        {
+            bool foundAtLeastOneShaderParameter = false;
+            Ogre::MaterialManager::ResourceMapIterator iterator = Ogre::MaterialManager::getSingleton().getResourceIterator();
+            Ogre::Material* material_pointer = 0;
+
+            while (iterator.hasMoreElements())
+            {
+                Ogre::Resource* resource = iterator.getNext().get();
+                if (resource->getName() == material)
+                    material_pointer = (Ogre::Material*)resource;
+            }
+
+            if (!material_pointer)
+            {
+                COUT(2) << "Warning: No material with name \"" << material << "\" found." << std::endl;
+                return 0;
+            }
+
+            for (unsigned int t = 0; t < material_pointer->getNumTechniques(); ++t)
+            {
+                Ogre::Technique* technique_pointer = material_pointer->getTechnique(t);
+                if (!technique_pointer)
+                    continue;
+
+                for (unsigned int p = 0; p < technique_pointer->getNumPasses(); ++p)
+                {
+                    Ogre::Pass* pass_pointer = technique_pointer->getPass(p);
+                    if (!pass_pointer)
+                        continue;
+
+                    if (pass_pointer->getFragmentProgramName() != "")
+                    {
+                        Ogre::GpuProgramParameters* parameter_pointer = pass_pointer->getFragmentProgramParameters().get();
+                        if (!parameter_pointer)
+                            continue;
+
+                        const Ogre::GpuConstantDefinitionMap& constant_definitions = parameter_pointer->getConstantDefinitions().map;
+                        for (Ogre::GpuConstantDefinitionMap::const_iterator definition_iterator = constant_definitions.begin(); definition_iterator != constant_definitions.end(); ++definition_iterator)
+                        {
+                            void* temp = (definition_iterator->second.isFloat())
+                                            ? (void*)parameter_pointer->getFloatPointer(definition_iterator->second.physicalIndex)
+                                            : (void*)parameter_pointer->getIntPointer(definition_iterator->second.physicalIndex);
+                            ParameterPointer parameter_pointer = ParameterPointer(definition_iterator->second.isFloat(), temp);
+
+                            TechniqueVector& technique_vector = Shader::parameters_s[material];
+                            technique_vector.resize(technique + 1);
+                            PassVector& pass_vector = technique_vector[technique];
+                            pass_vector.resize(pass + 1);
+                            pass_vector[pass][definition_iterator->first] = parameter_pointer;
+                            foundAtLeastOneShaderParameter = true;
+                        }
+                    }
+                }
+            }
+
+            // recursive call if the material was added to the map
+            if (foundAtLeastOneShaderParameter)
+                return Shader::getParameterPointer(material, technique, pass, parameter);
+        }
+        return 0;
+    }
+}
Index: code/trunk/src/orxonox/tools/Shader.h
===================================================================
--- code/trunk/src/orxonox/tools/Shader.h	(revision 2662)
+++ code/trunk/src/orxonox/tools/Shader.h	(revision 2662)
@@ -0,0 +1,107 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#ifndef _Shader_H__
+#define _Shader_H__
+
+#include "OrxonoxPrereqs.h"
+#include <OgrePrerequisites.h>
+#include <vector>
+#include <map>
+
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Shader : public Tickable
+    {
+        typedef std::pair<bool, void*>                  ParameterPointer;
+        typedef std::map<std::string, ParameterPointer> ParameterMap;
+        typedef std::vector<ParameterMap>               PassVector;
+        typedef std::vector<PassVector>                 TechniqueVector;
+        typedef std::map<std::string, TechniqueVector>  MaterialMap;
+
+        public:
+            Shader(Ogre::SceneManager* scenemanager = 0);
+            virtual ~Shader();
+
+            virtual void tick(float dt);
+
+            inline void setVisible(bool bVisible)
+            {
+                if (this->bVisible_ != bVisible)
+                {
+                    this->bVisible_ = bVisible;
+                    this->updateVisibility();
+                }
+            }
+            inline bool isVisible() const
+                { return this->bVisible_; }
+            void updateVisibility();
+
+            inline void setCompositor(const std::string& compositor)
+            {
+                if (this->compositor_ != compositor)
+                {
+                    this->compositor_ = compositor;
+                    this->changedCompositor();
+                }
+            }
+            inline const std::string& getCompositor() const
+                { return this->compositor_; }
+            void changedCompositor();
+
+            void setSceneManager(Ogre::SceneManager* scenemanager);
+            inline Ogre::SceneManager* getSceneManager() const
+                { return this->scenemanager_; }
+
+            void setParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter, float value);
+            void setParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter, int value);
+
+            static bool _setParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter, float value);
+            static bool _setParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter, int value);
+            static float getParameter(const std::string& material, size_t technique, size_t pass, const std::string& parameter);
+            static bool  getParameterIsFloat(const std::string& material, size_t technique, size_t pass, const std::string& parameter);
+            static bool  getParameterIsInt  (const std::string& material, size_t technique, size_t pass, const std::string& parameter);
+            static ParameterPointer* getParameterPointer(const std::string& material, size_t technique, size_t pass, const std::string& parameter);
+
+        private:
+            Ogre::SceneManager* scenemanager_;
+            Ogre::CompositorInstance* compositorInstance_;
+            bool bVisible_;
+            bool bLoadCompositor_;
+            bool bViewportInitialized_;
+            std::string compositor_;
+            std::string oldcompositor_;
+
+            static MaterialMap parameters_s;
+            static bool bLoadedCgPlugin_s;
+    };
+}
+
+#endif /* _Shader_H__ */
Index: code/trunk/src/orxonox/tools/Timer.cc
===================================================================
--- code/trunk/src/orxonox/tools/Timer.cc	(revision 2171)
+++ code/trunk/src/orxonox/tools/Timer.cc	(revision 2662)
@@ -96,5 +96,5 @@
         this->time_ = 0;
 
-        RegisterRootObject(TimerBase);
+        RegisterObject(TimerBase);
     }
 
@@ -137,5 +137,5 @@
         {
             // If active: Decrease the timer by the duration of the last frame
-            this->time_ -= time.getDeltaTimeMicroseconds();
+            this->time_ -= (long long)(time.getDeltaTimeMicroseconds() * this->getTimeFactor());
 
             if (this->time_ <= 0)
Index: code/trunk/src/orxonox/tools/Timer.h
===================================================================
--- code/trunk/src/orxonox/tools/Timer.h	(revision 2171)
+++ code/trunk/src/orxonox/tools/Timer.h	(revision 2662)
@@ -62,5 +62,7 @@
 
 #include "OrxonoxPrereqs.h"
+#include "core/Executor.h"
 #include "core/OrxonoxClass.h"
+#include "gamestates/GSRoot.h"
 
 namespace orxonox
@@ -72,5 +74,5 @@
 
     //! TimerBase is the parent of the Timer class.
-    class _OrxonoxExport TimerBase : public OrxonoxClass
+    class _OrxonoxExport TimerBase : public TimeFactorListener
     {
         public:
@@ -159,5 +161,5 @@
                 this->bLoop_ = bLoop;
                 executor->setObject(object);
-                this->executor_ = (Executor*)executor;
+                this->executor_ = static_cast<Executor*>(executor);
                 this->bActive_ = true;
 
@@ -197,5 +199,5 @@
                 this->setInterval(interval);
                 this->bLoop_ = bLoop;
-                this->executor_ = (Executor*)executor;
+                this->executor_ = executor;
                 this->bActive_ = true;
 
Index: code/trunk/src/orxonox/tools/WindowEventListener.h
===================================================================
--- code/trunk/src/orxonox/tools/WindowEventListener.h	(revision 2171)
+++ code/trunk/src/orxonox/tools/WindowEventListener.h	(revision 2662)
@@ -41,7 +41,7 @@
     class _OrxonoxExport WindowEventListener : virtual public OrxonoxClass
     {
-    public:
-        WindowEventListener();
-        virtual ~WindowEventListener() { }
+        public:
+            WindowEventListener();
+            virtual ~WindowEventListener() { }
 
             /** Window has moved position */
