Index: /code/branches/libraries2/src/libraries/CMakeLists.txt
===================================================================
--- /code/branches/libraries2/src/libraries/CMakeLists.txt	(revision 5716)
+++ /code/branches/libraries2/src/libraries/CMakeLists.txt	(revision 5717)
@@ -22,3 +22,4 @@
 ADD_SUBDIRECTORY(core)
 ADD_SUBDIRECTORY(network)
+ADD_SUBDIRECTORY(tools)
 ADD_SUBDIRECTORY(util)
Index: /code/branches/libraries2/src/libraries/tools/BillboardSet.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/BillboardSet.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/BillboardSet.cc	(revision 5717)
@@ -0,0 +1,174 @@
+/*
+ *   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 "BillboardSet.h"
+
+#include <cassert>
+#include <string>
+#include <sstream>
+#include <OgreSceneManager.h>
+#include <OgreBillboardSet.h>
+#include <OgreBillboard.h>
+
+#include "util/Convert.h"
+#include "util/Math.h"
+#include "util/StringUtils.h"
+#include "core/GameMode.h"
+
+namespace orxonox
+{
+    unsigned int BillboardSet::billboardSetCounter_s = 0;
+
+    BillboardSet::BillboardSet()
+    {
+        this->billboardSet_ = 0;
+    }
+
+    BillboardSet::~BillboardSet()
+    {
+        this->destroyBillboardSet();
+    }
+
+    void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, int count)
+    {
+        this->setBillboardSet(scenemanager, file, Vector3::ZERO, count);
+    }
+
+    void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const ColourValue& colour, int count)
+    {
+        this->setBillboardSet(scenemanager, file, colour, Vector3::ZERO, count);
+    }
+
+    void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const Vector3& position, int count)
+    {
+        assert(scenemanager);
+        this->destroyBillboardSet();
+
+        try
+        {
+            if (GameMode::showsGraphics())
+            {
+                this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + multi_cast<std::string>(BillboardSet::billboardSetCounter_s++), count);
+                this->billboardSet_->createBillboard(position);
+                this->billboardSet_->setMaterialName(file);
+            }
+        }
+        catch (...)
+        {
+            COUT(1) << "Error: Couln't load billboard \"" << file << "\"" << std::endl;
+            this->billboardSet_ = 0;
+        }
+
+        this->scenemanager_ = scenemanager;
+    }
+
+    void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const ColourValue& colour, const Vector3& position, int count)
+    {
+        assert(scenemanager);
+        this->destroyBillboardSet();
+
+        try
+        {
+            if (GameMode::showsGraphics())
+            {
+                this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + multi_cast<std::string>(BillboardSet::billboardSetCounter_s++), count);
+                this->billboardSet_->createBillboard(position, colour);
+                this->billboardSet_->setMaterialName(file);
+            }
+        }
+        catch (...)
+        {
+            COUT(1) << "Error: Couln't load billboard \"" << file << "\"" << std::endl;
+            this->billboardSet_ = 0;
+        }
+
+        this->scenemanager_ = scenemanager;
+    }
+
+    void BillboardSet::destroyBillboardSet()
+    {
+        if (this->billboardSet_ && this->scenemanager_)
+            this->scenemanager_->destroyBillboardSet(this->billboardSet_);
+        this->billboardSet_ = 0;
+    }
+
+    const std::string& BillboardSet::getName() const
+    {
+        if (this->billboardSet_)
+            return this->billboardSet_->getName();
+        else
+            return BLANKSTRING;
+    }
+
+    void BillboardSet::setVisible(bool visible)
+    {
+        if (this->billboardSet_)
+            this->billboardSet_->setVisible(visible);
+    }
+
+    bool BillboardSet::getVisible() const
+    {
+        if (this->billboardSet_)
+            return this->billboardSet_->getVisible();
+        else
+            return false;
+    }
+
+    void BillboardSet::setColour(const ColourValue& colour)
+    {
+        if (this->billboardSet_)
+        {
+            for (int i = 0; i < this->billboardSet_->getNumBillboards(); ++i)
+                this->billboardSet_->getBillboard(i)->setColour(colour);
+        }
+    }
+
+    const ColourValue& BillboardSet::getColour() const
+    {
+        if (this->billboardSet_ && this->billboardSet_->getNumBillboards() > 0)
+        {
+            return this->billboardSet_->getBillboard(0)->getColour();
+        }
+        else
+            return ColourValue::White;
+    }
+
+    void BillboardSet::setMaterial(const std::string& material)
+    {
+        if (this->billboardSet_)
+            this->billboardSet_->setMaterialName(material);
+    }
+
+    const std::string& BillboardSet::getMaterial() const
+    {
+        if (this->billboardSet_)
+            return this->billboardSet_->getMaterialName();
+        else
+            return BLANKSTRING;
+    }
+}
Index: /code/branches/libraries2/src/libraries/tools/BillboardSet.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/BillboardSet.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/BillboardSet.h	(revision 5717)
@@ -0,0 +1,74 @@
+/*
+ *   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 _BillboardSet_H__
+#define _BillboardSet_H__
+
+#include "tools/ToolsPrereqs.h"
+#include "util/OgreForwardRefs.h"
+
+namespace orxonox
+{
+    class _ToolsExport BillboardSet
+    {
+        public:
+            BillboardSet();
+            ~BillboardSet();
+
+            void setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, int count = 1);
+            void setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const ColourValue& colour, int count = 1);
+            void setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const Vector3& position, int count = 1);
+            void setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const ColourValue& colour, const Vector3& position, int count = 1);
+
+            inline Ogre::BillboardSet* getBillboardSet()
+                { return this->billboardSet_; }
+            inline Ogre::SceneManager* getSceneManager() const
+                { return this->scenemanager_; }
+
+            const std::string& getName() const;
+
+            void setVisible(bool visible);
+            bool getVisible() const;
+
+            void setColour(const ColourValue& colour);
+            const ColourValue& getColour() const;
+
+            void setMaterial(const std::string& material);
+            const std::string& getMaterial() const;
+
+        private:
+            void destroyBillboardSet();
+
+            Ogre::BillboardSet* billboardSet_;
+            Ogre::SceneManager* scenemanager_;
+
+            static unsigned int billboardSetCounter_s;
+    };
+}
+
+#endif /* _BillboardSet_H__ */
Index: /code/branches/libraries2/src/libraries/tools/BulletConversions.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/BulletConversions.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/BulletConversions.h	(revision 5717)
@@ -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 "tools/ToolsPrereqs.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>
+    {
+        FORCEINLINE 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>
+    {
+        FORCEINLINE 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>
+    {
+        FORCEINLINE 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>
+    {
+        FORCEINLINE 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/branches/libraries2/src/libraries/tools/CMakeLists.txt
===================================================================
--- /code/branches/libraries2/src/libraries/tools/CMakeLists.txt	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/CMakeLists.txt	(revision 5717)
@@ -0,0 +1,21 @@
+ADD_SOURCE_FILES(TOOLS_SRC_FILES
+  BillboardSet.cc
+  DynamicLines.cc
+  DynamicRenderable.cc
+  Mesh.cc
+  ParticleInterface.cc
+  ResourceCollection.cc
+  ResourceLocation.cc
+  Shader.cc
+  TextureGenerator.cc
+  Timer.cc
+)
+ADD_SUBDIRECTORY(interfaces)
+
+ORXONOX_ADD_LIBRARY(tools
+  DEFINE_SYMBOL
+    "TOOLS_SHARED_BUILD"
+  LINK_LIBRARIES
+    core
+  SOURCE_FILES ${TOOLS_SRC_FILES}
+)
Index: /code/branches/libraries2/src/libraries/tools/DynamicLines.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/DynamicLines.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/DynamicLines.cc	(revision 5717)
@@ -0,0 +1,178 @@
+/*
+ *   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:
+ *      Baxissimo, Emmeran, DWORD, EtherDrive (OGRE Wiki)
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "DynamicLines.h"
+
+#include <cassert>
+#include <cmath>
+
+namespace Ogre
+{
+    enum
+    {
+        POSITION_BINDING,
+        TEXCOORD_BINDING
+    };
+
+    DynamicLines::DynamicLines(OperationType opType)
+    {
+        initialize(opType,false);
+        setMaterial("BaseWhiteNoLighting");
+        mDirty = true;
+    }
+
+    DynamicLines::~DynamicLines()
+    {
+    }
+
+    void DynamicLines::setOperationType(OperationType opType)
+    {
+        mRenderOp.operationType = opType;
+    }
+
+    RenderOperation::OperationType DynamicLines::getOperationType() const
+    {
+        return mRenderOp.operationType;
+    }
+
+    void DynamicLines::addPoint(const Vector3 &p)
+    {
+        mPoints.push_back(p);
+        mDirty = true;
+    }
+
+    void DynamicLines::addPoint(Real x, Real y, Real z)
+    {
+        mPoints.push_back(Vector3(x,y,z));
+        mDirty = true;
+    }
+
+    const Vector3& DynamicLines::getPoint(unsigned short index) const
+    {
+        assert(index < mPoints.size() && "Point index is out of bounds!!");
+        return mPoints[index];
+    }
+
+    unsigned short DynamicLines::getNumPoints(void) const
+    {
+        return (unsigned short)mPoints.size();
+    }
+
+    void DynamicLines::setPoint(unsigned short index, const Vector3 &value)
+    {
+        assert(index < mPoints.size() && "Point index is out of bounds!!");
+
+        mPoints[index] = value;
+        mDirty = true;
+    }
+
+    void DynamicLines::clear()
+    {
+        mPoints.clear();
+        mDirty = true;
+    }
+
+    void DynamicLines::update()
+    {
+        if (mDirty)
+            fillHardwareBuffers();
+    }
+
+    void DynamicLines::createVertexDeclaration()
+    {
+        VertexDeclaration *decl = mRenderOp.vertexData->vertexDeclaration;
+        decl->addElement(POSITION_BINDING, 0, VET_FLOAT3, VES_POSITION);
+    }
+
+    void DynamicLines::fillHardwareBuffers()
+    {
+        int size = mPoints.size();
+
+        prepareHardwareBuffers(size,0);
+
+        if (!size)
+        {
+            mBox.setExtents(Vector3::ZERO,Vector3::ZERO);
+            mDirty=false;
+            return;
+        }
+
+        Vector3 vaabMin = mPoints[0];
+        Vector3 vaabMax = mPoints[0];
+
+        HardwareVertexBufferSharedPtr vbuf =
+            mRenderOp.vertexData->vertexBufferBinding->getBuffer(0);
+
+        Real *prPos = static_cast<Real*>(vbuf->lock(HardwareBuffer::HBL_DISCARD));
+        for (int i = 0; i < size; i++)
+        {
+            *prPos++ = mPoints[i].x;
+            *prPos++ = mPoints[i].y;
+            *prPos++ = mPoints[i].z;
+
+            if (mPoints[i].x < vaabMin.x)
+                vaabMin.x = mPoints[i].x;
+            if (mPoints[i].y < vaabMin.y)
+                vaabMin.y = mPoints[i].y;
+            if (mPoints[i].z < vaabMin.z)
+                vaabMin.z = mPoints[i].z;
+
+            if (mPoints[i].x > vaabMax.x)
+                vaabMax.x = mPoints[i].x;
+            if (mPoints[i].y > vaabMax.y)
+                vaabMax.y = mPoints[i].y;
+            if (mPoints[i].z > vaabMax.z)
+                vaabMax.z = mPoints[i].z;
+        }
+        vbuf->unlock();
+
+        mBox.setExtents(vaabMin, vaabMax);
+
+        mDirty = false;
+    }
+
+    /*
+    void DynamicLines::getWorldTransforms(Matrix4 *xform) const
+    {
+        // return identity matrix to prevent parent transforms
+        *xform = Matrix4::IDENTITY;
+    }
+    */
+
+    /*
+    const Quaternion &DynamicLines::getWorldOrientation(void) const
+    {
+        return Quaternion::IDENTITY;
+    }
+
+    const Vector3 &DynamicLines::getWorldPosition(void) const
+    {
+        return Vector3::ZERO;
+    }
+    */
+}
Index: /code/branches/libraries2/src/libraries/tools/DynamicLines.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/DynamicLines.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/DynamicLines.h	(revision 5717)
@@ -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:
+ *      Baxissimo, Emmeran, DWORD, EtherDrive (OGRE Wiki)
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _DynamicLines_H__
+#define _DynamicLines_H__
+
+#include "tools/ToolsPrereqs.h"
+
+#include <vector>
+#include "DynamicRenderable.h"
+
+namespace Ogre
+{
+    class _ToolsExport DynamicLines : public DynamicRenderable
+    {
+        typedef RenderOperation::OperationType OperationType;
+
+    public:
+        /// Constructor - see setOperationType() for description of argument.
+        DynamicLines(OperationType opType = RenderOperation::OT_LINE_STRIP);
+        virtual ~DynamicLines();
+
+        /// Add a point to the point list
+        void addPoint(const Vector3 &p);
+        /// Add a point to the point list
+        void addPoint(Real x, Real y, Real z);
+
+        /// Change the location of an existing point in the point list
+        void setPoint(unsigned short index, const Vector3 &value);
+
+        /// Return the location of an existing point in the point list
+        const Vector3& getPoint(unsigned short index) const;
+
+        /// Return the total number of points in the point list
+        unsigned short getNumPoints(void) const;
+
+        /// Remove all points from the point list
+        void clear();
+
+        /// Call this to update the hardware buffer after making changes.
+        void update();
+
+        /**
+        @brief
+            Set the type of operation to draw with.
+        @param opType
+            Can be one of
+                - RenderOperation::OT_LINE_STRIP
+                - RenderOperation::OT_LINE_LIST
+                - RenderOperation::OT_POINT_LIST
+                - RenderOperation::OT_TRIANGLE_LIST
+                - RenderOperation::OT_TRIANGLE_STRIP
+                - RenderOperation::OT_TRIANGLE_FAN
+            The default is OT_LINE_STRIP.
+        */
+        void setOperationType(OperationType opType);
+        OperationType getOperationType() const;
+
+    protected:
+        /// Implementation DynamicRenderable, creates a simple vertex-only decl
+        virtual void createVertexDeclaration();
+        /// Implementation DynamicRenderable, pushes point list out to hardware memory
+        virtual void fillHardwareBuffers();
+
+    private:
+        std::vector<Vector3> mPoints;
+        bool mDirty;
+    };
+}
+
+#endif /* _DynamicLines_H__ */
Index: /code/branches/libraries2/src/libraries/tools/DynamicRenderable.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/DynamicRenderable.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/DynamicRenderable.cc	(revision 5717)
@@ -0,0 +1,160 @@
+/*
+ *   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:
+ *      Sinbad, Baxissimo, DWORD, TheBren (OGRE Wiki)
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "DynamicRenderable.h"
+
+#include <OgreCamera.h>
+#include <OgreHardwareBufferManager.h>
+
+namespace Ogre
+{
+    DynamicRenderable::DynamicRenderable()
+    {
+    }
+
+    DynamicRenderable::~DynamicRenderable()
+    {
+        delete mRenderOp.vertexData;
+        delete mRenderOp.indexData;
+    }
+
+    void DynamicRenderable::initialize(RenderOperation::OperationType operationType,
+           bool useIndices)
+    {
+        // Initialize render operation
+        mRenderOp.operationType = operationType;
+        mRenderOp.useIndexes = useIndices;
+        mRenderOp.vertexData = new VertexData;
+        if (mRenderOp.useIndexes)
+            mRenderOp.indexData = new IndexData;
+
+        // Reset buffer capacities
+        mVertexBufferCapacity = 0;
+        mIndexBufferCapacity = 0;
+
+        // Create vertex declaration
+        createVertexDeclaration();
+    }
+
+    void DynamicRenderable::prepareHardwareBuffers(size_t vertexCount, size_t indexCount)
+    {
+        // Prepare vertex buffer
+        size_t newVertCapacity = mVertexBufferCapacity;
+        if ((vertexCount > mVertexBufferCapacity) || (!mVertexBufferCapacity))
+        {
+            // vertexCount exceeds current capacity!
+            // It is necessary to reallocate the buffer.
+
+            // Check if this is the first call
+            if (!newVertCapacity)
+                newVertCapacity = 1;
+
+            // Make capacity the next power of two
+            while (newVertCapacity < vertexCount)
+                newVertCapacity <<= 1;
+        }
+        else if (vertexCount < mVertexBufferCapacity>>1)
+        {
+            // Make capacity the previous power of two
+            while (vertexCount < newVertCapacity>>1)
+                newVertCapacity >>= 1;
+        }
+        if (newVertCapacity != mVertexBufferCapacity)
+        {
+            mVertexBufferCapacity = newVertCapacity;
+            // Create new vertex buffer
+            HardwareVertexBufferSharedPtr vbuf =
+                HardwareBufferManager::getSingleton().createVertexBuffer(
+                mRenderOp.vertexData->vertexDeclaration->getVertexSize(0),
+                mVertexBufferCapacity,
+                HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY); // TODO: Custom HBU_?
+
+            // Bind buffer
+            mRenderOp.vertexData->vertexBufferBinding->setBinding(0, vbuf);
+        }
+        // Update vertex count in the render operation
+        mRenderOp.vertexData->vertexCount = vertexCount;
+
+        if (mRenderOp.useIndexes)
+        {
+            OgreAssert(indexCount <= std::numeric_limits<unsigned short>::max(), "indexCount exceeds 16 bit");
+
+            size_t newIndexCapacity = mIndexBufferCapacity;
+            // Prepare index buffer
+            if ((indexCount > newIndexCapacity) || (!newIndexCapacity))
+            {
+                // indexCount exceeds current capacity!
+                // It is necessary to reallocate the buffer.
+
+                // Check if this is the first call
+                if (!newIndexCapacity)
+                    newIndexCapacity = 1;
+
+                // Make capacity the next power of two
+                while (newIndexCapacity < indexCount)
+                    newIndexCapacity <<= 1;
+            }
+            else if (indexCount < newIndexCapacity>>1)
+            {
+                // Make capacity the previous power of two
+                while (indexCount < newIndexCapacity>>1)
+                    newIndexCapacity >>= 1;
+            }
+
+            if (newIndexCapacity != mIndexBufferCapacity)
+            {
+                mIndexBufferCapacity = newIndexCapacity;
+                // Create new index buffer
+                mRenderOp.indexData->indexBuffer =
+                    HardwareBufferManager::getSingleton().createIndexBuffer(
+                    HardwareIndexBuffer::IT_16BIT,
+                    mIndexBufferCapacity,
+                    HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY); // TODO: Custom HBU_?
+            }
+
+            // Update index count in the render operation
+            mRenderOp.indexData->indexCount = indexCount;
+        }
+    }
+
+    Real DynamicRenderable::getBoundingRadius(void) const
+    {
+        return Math::Sqrt(std::max(mBox.getMaximum().squaredLength(), mBox.getMinimum().squaredLength()));
+    }
+
+    Real DynamicRenderable::getSquaredViewDepth(const Camera* cam) const
+    {
+        Vector3 vMin, vMax, vMid, vDist;
+        vMin = mBox.getMinimum();
+        vMax = mBox.getMaximum();
+        vMid = ((vMax - vMin) * 0.5) + vMin;
+        vDist = cam->getDerivedPosition() - vMid;
+
+        return vDist.squaredLength();
+    }
+}
Index: /code/branches/libraries2/src/libraries/tools/DynamicRenderable.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/DynamicRenderable.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/DynamicRenderable.h	(revision 5717)
@@ -0,0 +1,116 @@
+/*
+ *   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:
+ *      Sinbad, Baxissimo, DWORD, TheBren (OGRE Wiki)
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _DynamicRenderable_H__
+#define _DynamicRenderable_H__
+
+#include "tools/ToolsPrereqs.h"
+
+#include <OgreSimpleRenderable.h>
+
+namespace Ogre
+{
+    /// Abstract base class providing mechanisms for dynamically growing hardware buffers.
+    class _ToolsExport DynamicRenderable : public SimpleRenderable
+    {
+    public:
+        /// Constructor
+        DynamicRenderable();
+        /// Virtual destructor
+        virtual ~DynamicRenderable();
+
+        /**
+        @brief
+            Initializes the dynamic renderable.
+        @remarks
+            This function should only be called once. It initializes the
+            render operation, and calls the abstract function
+            createVertexDeclaration().
+        @param operationType
+            The type of render operation to perform.
+        @param useIndices
+            Specifies whether to use indices to determine the vertices to use as input.
+        */
+        void initialize(RenderOperation::OperationType operationType,
+        bool useIndices);
+
+        /// Implementation of SimpleRenderable
+        virtual Real getBoundingRadius(void) const;
+        /// Implementation of SimpleRenderable
+        virtual Real getSquaredViewDepth(const Camera* cam) const;
+
+    protected:
+        /// Maximum capacity of the currently allocated vertex buffer.
+        size_t mVertexBufferCapacity;
+        /// Maximum capacity of the currently allocated index buffer.
+        size_t mIndexBufferCapacity;
+
+        /**
+        @brief
+            Creates the vertex declaration.
+        @remarks
+            Override and set mRenderOp.vertexData->vertexDeclaration here.
+            mRenderOp.vertexData will be created for you before this method
+            is called.
+        */
+        virtual void createVertexDeclaration() = 0;
+
+        /**
+        @brief
+            Prepares the hardware buffers for the requested vertex and index counts.
+        @remarks
+            This function must be called before locking the buffers in
+            fillHardwareBuffers(). It guarantees that the hardware buffers
+            are large enough to hold at least the requested number of
+            vertices and indices (if using indices). The buffers are
+            possibly reallocated to achieve this.
+        @par
+            The vertex and index count in the render operation are set to
+            the values of vertexCount and indexCount respectively.
+        @param vertexCount
+            The number of vertices the buffer must hold.
+        @param indexCount
+            The number of indices the buffer must hold. This
+            parameter is ignored if not using indices.
+        */
+        void prepareHardwareBuffers(size_t vertexCount, size_t indexCount);
+
+        /**
+        @brief
+            Fills the hardware vertex and index buffers with data.
+        @remarks
+            This function must call prepareHardwareBuffers() before locking
+            the buffers to ensure the they are large enough for the data to
+            be written. Afterwards the vertex and index buffers (if using
+            indices) can be locked, and data can be written to them.
+        */
+        virtual void fillHardwareBuffers() = 0;
+    };
+}
+
+#endif /* _DynamicRenderable_H__ */
Index: /code/branches/libraries2/src/libraries/tools/Mesh.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/Mesh.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/Mesh.cc	(revision 5717)
@@ -0,0 +1,120 @@
+/*
+ *   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 "Mesh.h"
+
+#include <cassert>
+#include <sstream>
+#include <string>
+#include <OgreEntity.h>
+#include <OgreSceneManager.h>
+
+#include "util/Convert.h"
+#include "util/StringUtils.h"
+#include "core/GameMode.h"
+
+namespace orxonox
+{
+    unsigned int Mesh::meshCounter_s = 0;
+
+    Mesh::Mesh()
+    {
+        this->entity_ = 0;
+        this->bCastShadows_ = true;
+    }
+
+    Mesh::~Mesh()
+    {
+        if (this->entity_ && this->scenemanager_)
+            this->scenemanager_->destroyEntity(this->entity_);
+    }
+
+    void Mesh::setMeshSource(Ogre::SceneManager* scenemanager, const std::string& meshsource)
+    {
+        assert(scenemanager);
+
+        this->scenemanager_ = scenemanager;
+
+        if (this->entity_)
+            this->scenemanager_->destroyEntity(this->entity_);
+
+        if (GameMode::showsGraphics())
+        {
+            try
+            {
+                this->entity_ = this->scenemanager_->createEntity("Mesh" + multi_cast<std::string>(Mesh::meshCounter_s++), meshsource);
+                this->entity_->setCastShadows(this->bCastShadows_);
+
+#if OGRE_VERSION < 0x010600
+                this->entity_->setNormaliseNormals(true);
+                /*
+                    Excerpt from Ogre forum:
+                    "Note that the above is only for the fixed function pipeline.
+                    If/when you get into shaders, you'll need to manually normalize() the normal inside the vertex or pixel shader."
+
+                    I don't know exactly what this means, but I put this here if there will be problems with shaders.
+                */
+#endif
+            }
+            catch (...)
+            {
+                COUT(1) << "Error: Couln't load mesh \"" << meshsource << "\"" << std::endl;
+                this->entity_ = 0;
+            }
+        }
+    }
+
+    void Mesh::setCastShadows(bool bCastShadows)
+    {
+        this->bCastShadows_ = bCastShadows;
+        if (this->entity_)
+            this->entity_->setCastShadows(this->bCastShadows_);
+    }
+
+    const std::string& Mesh::getName() const
+    {
+        if (this->entity_)
+            return this->entity_->getName();
+        else
+            return BLANKSTRING;
+    }
+
+    void Mesh::setVisible(bool bVisible)
+    {
+        if (this->entity_)
+            this->entity_->setVisible(bVisible);
+    }
+
+    bool Mesh::isVisible() const
+    {
+        if (this->entity_)
+            return this->entity_->getVisible();
+        else
+            return false;
+    }
+}
Index: /code/branches/libraries2/src/libraries/tools/Mesh.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/Mesh.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/Mesh.h	(revision 5717)
@@ -0,0 +1,66 @@
+/*
+ *   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 _Mesh_H__
+#define _Mesh_H__
+
+#include "tools/ToolsPrereqs.h"
+#include "util/OgreForwardRefs.h"
+
+namespace orxonox
+{
+    class _ToolsExport Mesh
+    {
+        public:
+            Mesh();
+            ~Mesh();
+
+            void setMeshSource(Ogre::SceneManager* scenemanager, const std::string& file);
+
+            inline Ogre::Entity* getEntity()
+                { return this->entity_; }
+
+            const std::string& getName() const;
+
+            void setVisible(bool bVisible);
+            bool isVisible() const;
+
+            void setCastShadows(bool bCastShadows);
+            inline bool getCastShadows() const
+                { return this->bCastShadows_; }
+
+        private:
+            Ogre::Entity* entity_;
+            bool bCastShadows_;
+            Ogre::SceneManager* scenemanager_;
+
+            static unsigned int meshCounter_s;
+    };
+}
+
+#endif /* _Mesh_H__ */
Index: /code/branches/libraries2/src/libraries/tools/ParticleInterface.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/ParticleInterface.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/ParticleInterface.cc	(revision 5717)
@@ -0,0 +1,231 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+* @file
+* @brief class to control praticle effects
+*/
+
+#include "ParticleInterface.h"
+
+#include <cassert>
+#include <string>
+#include <OgreParticleSystem.h>
+#include <OgreParticleEmitter.h>
+#include <OgreSceneManager.h>
+
+#include "util/Convert.h"
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/GameMode.h"
+
+namespace orxonox
+{
+    unsigned int ParticleInterface::counter_s = 0;
+    ParticleInterface* ParticleInterface::currentParticleInterface_s = 0;
+
+    ParticleInterface::ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::Value detaillevel)
+    {
+        RegisterObject(ParticleInterface);
+
+        assert(scenemanager);
+
+        this->scenemanager_ = scenemanager;
+        this->particleSystem_ = 0;
+
+        this->bEnabled_ = true;
+        this->bVisible_ = true;
+        this->bAllowedByLOD_ = true;
+        this->speedFactor_ = 1.0f;
+
+        if (GameMode::showsGraphics())
+        {
+            try
+            {
+                this->particleSystem_ = this->scenemanager_->createParticleSystem("particles" + multi_cast<std::string>(ParticleInterface::counter_s++), templateName);
+                this->setSpeedFactor(1.0f);
+            }
+            catch (...)
+            {
+                COUT(1) << "Error: Couln't load particle system \"" << templateName << "\"" << std::endl;
+                this->particleSystem_ = 0;
+            }
+        }
+
+        this->setDetailLevel(static_cast<unsigned int>(detaillevel));
+    }
+
+    ParticleInterface::~ParticleInterface()
+    {
+        if (this->particleSystem_)
+        {
+            this->particleSystem_->removeAllEmitters();
+            this->scenemanager_->destroyParticleSystem(this->particleSystem_);
+        }
+    }
+
+    void ParticleInterface::setConfigValues()
+    {
+        SetConfigValue(globalDetailLevel_, 2)
+            .description("O: off, 1: low, 2: normal, 3: high").callback(this, &ParticleInterface::detailLevelChanged);
+    }
+
+    Ogre::ParticleEmitter* ParticleInterface::createNewEmitter()
+    {
+        if (this->particleSystem_ && 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 (this->particleSystem_ && (emitterNr < this->particleSystem_->getNumEmitters()))
+            return this->particleSystem_->getEmitter(emitterNr);
+        else
+            return 0;
+    }
+    void ParticleInterface::removeEmitter(unsigned int emitterNr)
+    {
+        if (this->particleSystem_ && (emitterNr < this->particleSystem_->getNumEmitters()))
+            this->particleSystem_->removeEmitter(emitterNr);
+    }
+    void ParticleInterface::removeAllEmitters()
+    {
+        if (this->particleSystem_)
+            this->particleSystem_->removeAllEmitters();
+    }
+    unsigned int ParticleInterface::getNumEmitters() const
+    {
+        if (this->particleSystem_)
+            return this->particleSystem_->getNumEmitters();
+        else
+            return 0;
+    }
+
+    Ogre::ParticleAffector* ParticleInterface::addAffector(const std::string& name)
+    {
+        if (this->particleSystem_)
+            return this->particleSystem_->addAffector(name);
+        else
+            return 0;
+    }
+    Ogre::ParticleAffector* ParticleInterface::getAffector(unsigned int affectorNr)
+    {
+        if (this->particleSystem_ && (affectorNr < this->particleSystem_->getNumAffectors()))
+            return this->particleSystem_->getAffector(affectorNr);
+        else
+            return 0;
+    }
+    void ParticleInterface::removeAffector(unsigned int affectorNr)
+    {
+        if (this->particleSystem_ && (affectorNr < this->particleSystem_->getNumAffectors()))
+            this->particleSystem_->removeAffector(affectorNr);
+    }
+    void ParticleInterface::removeAllAffectors()
+    {
+        if (this->particleSystem_)
+            this->particleSystem_->removeAllAffectors();
+    }
+    unsigned int ParticleInterface::getNumAffectors() const
+    {
+        if (this->particleSystem_)
+            return this->particleSystem_->getNumAffectors();
+        else
+            return 0;
+    }
+
+    void ParticleInterface::setEnabled(bool enable)
+    {
+        this->bEnabled_ = enable;
+
+        if (this->particleSystem_)
+            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;
+
+        if (this->particleSystem_)
+            this->particleSystem_->setVisible(this->bVisible_ && this->bAllowedByLOD_);
+    }
+
+    void ParticleInterface::setDetailLevel(unsigned int level)
+    {
+        this->detaillevel_ = level;
+        if (GameMode::showsGraphics())
+            this->detailLevelChanged();
+    }
+
+    void ParticleInterface::detailLevelChanged()
+    {
+        if (this->globalDetailLevel_ >= 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->speedFactor_ = factor;
+
+        if (this->particleSystem_)
+            this->particleSystem_->setSpeedFactor(factor * this->getTimeFactor());
+    }
+    void ParticleInterface::changedTimeFactor(float factor_new, float factor_old)
+    {
+        this->setSpeedFactor(this->speedFactor_);
+    }
+
+    bool ParticleInterface::getKeepParticlesInLocalSpace() const
+    {
+        if (this->particleSystem_)
+            return this->particleSystem_->getKeepParticlesInLocalSpace();
+        else
+            return false;
+    }
+    void ParticleInterface::setKeepParticlesInLocalSpace(bool keep)
+    {
+        if (this->particleSystem_)
+            this->particleSystem_->setKeepParticlesInLocalSpace(keep);
+    }
+}
Index: /code/branches/libraries2/src/libraries/tools/ParticleInterface.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/ParticleInterface.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/ParticleInterface.h	(revision 5717)
@@ -0,0 +1,110 @@
+/*
+ *   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 _ParticleInterface_H__
+#define _ParticleInterface_H__
+
+#include "tools/ToolsPrereqs.h"
+
+#include "util/OgreForwardRefs.h"
+#include "tools/interfaces/TimeFactorListener.h"
+
+#define getAllEmitters() \
+  storeThisAsCurrentParticleInterface(); \
+  for (unsigned int i = 0; i < ParticleInterface::getCurrentParticleInterface()->getNumEmitters(); ++i) \
+    ParticleInterface::getCurrentParticleInterface()->getEmitter(i)
+
+namespace orxonox
+{
+    class _ToolsExport ParticleInterface : public TimeFactorListener
+    {
+        public:
+            ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::Value detaillevel);
+            virtual ~ParticleInterface();
+            void setConfigValues();
+
+            inline Ogre::ParticleSystem* getParticleSystem()
+                { return this->particleSystem_; }
+
+            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);
+            void removeAffector(unsigned int affectorNr);
+            void removeAllAffectors();
+            unsigned int getNumAffectors() const;
+
+            inline float getSpeedFactor() const
+                { return this->speedFactor_; }
+            void setSpeedFactor(float factor);
+            bool getKeepParticlesInLocalSpace() const;
+            void setKeepParticlesInLocalSpace(bool keep);
+
+            void setEnabled(bool enable);
+            inline bool isEnabled() const
+                { return this->bEnabled_; }
+
+            void setVisible(bool visible);
+            inline bool isVisible() const
+                { return this->bVisible_; }
+
+            void setDetailLevel(unsigned int level);
+
+            inline void storeThisAsCurrentParticleInterface()
+                { ParticleInterface::currentParticleInterface_s = this; }
+            inline static ParticleInterface* getCurrentParticleInterface()
+                { return ParticleInterface::currentParticleInterface_s; }
+
+        protected:
+            virtual void changedTimeFactor(float factor_new, float factor_old);
+
+        private:
+            void updateVisibility();
+            void detailLevelChanged();
+
+            Ogre::ParticleSystem*     particleSystem_;
+            Ogre::SceneManager*       scenemanager_;
+            bool                      bVisible_;
+            bool                      bEnabled_;
+            bool                      bAllowedByLOD_;
+            unsigned int              detaillevel_;       //!< Detail level of this particle effect (0: off, 1: low, 2: normal, 3: high)
+            float                     speedFactor_;
+
+            // config values
+            unsigned int              globalDetailLevel_; //!< Global maximum detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
+
+            static ParticleInterface* currentParticleInterface_s;
+            static unsigned int       counter_s;
+    };
+}
+
+#endif /* _ParticleInterface_H__ */
Index: /code/branches/libraries2/src/libraries/tools/ResourceCollection.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/ResourceCollection.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/ResourceCollection.cc	(revision 5717)
@@ -0,0 +1,99 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "ResourceCollection.h"
+
+#include "util/Exception.h"
+#include "core/CoreIncludes.h"
+#include "core/Resource.h"
+#include "core/XMLPort.h"
+#include "ResourceLocation.h"
+
+namespace orxonox
+{
+    CreateFactory(ResourceCollection);
+
+    ResourceCollection::ResourceCollection(BaseObject* creator)
+        : BaseObject(creator)
+    {
+        RegisterObject(ResourceCollection);
+
+        // Default group is "General"
+        this->setResourceGroup(Resource::DEFAULT_GROUP);
+    }
+
+    ResourceCollection::~ResourceCollection()
+    {
+    }
+
+    void ResourceCollection::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        XMLPortParam(ResourceCollection, "resourceGroup", setResourceGroup, getResourceGroup, xmlElement, mode);
+        XMLPortObject(ResourceCollection, ResourceLocation, "", addResourceLocation, getResourceLocation, xmlElement, mode);
+    }
+
+    void ResourceCollection::setResourceGroup(const std::string& resourceGroup)
+    {
+        if (resourceGroup.empty())
+        {
+            COUT(2) << "Warning: \"\" is not a valid resource group." << std::endl;
+            return;
+        }
+        if (!resourceLocations_.empty())
+            ThrowException(InitialisationFailed, "ResourceGroup: Group change not allowed with locations already added!");
+        resourceGroup_ = resourceGroup;
+    }
+
+    void ResourceCollection::addResourceLocation(ResourceLocation* location)
+    {
+        location->load(resourceGroup_);
+        this->resourceLocations_.push_back(location);
+    }
+
+    void ResourceCollection::removeResourceLocation(ResourceLocation* location)
+    {
+        for (std::vector<ResourceLocation*>::iterator it = resourceLocations_.begin(); it != resourceLocations_.end(); )
+        {
+            if (*it == location)
+            {
+                it = resourceLocations_.erase(it);
+                location->unload(); // doesn't throw
+            }
+            else
+                ++it;
+        }
+    }
+
+    ResourceLocation* ResourceCollection::getResourceLocation(unsigned int index) const
+    {
+        if (index >= resourceLocations_.size())
+            return NULL;
+        else
+            return resourceLocations_[index];
+    }
+}
Index: /code/branches/libraries2/src/libraries/tools/ResourceCollection.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/ResourceCollection.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/ResourceCollection.h	(revision 5717)
@@ -0,0 +1,65 @@
+/*
+ *   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 _ResourceCollection_H__
+#define _ResourceCollection_H__
+
+#include "tools/ToolsPrereqs.h"
+
+#include <string>
+#include <vector>
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class ResourceLocation;
+
+    class _ToolsExport ResourceCollection : public BaseObject
+    {
+    public:
+        ResourceCollection(BaseObject* creator);
+        virtual ~ResourceCollection();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        void setResourceGroup(const std::string& resourceGroup);
+        const std::string& getResourceGroup() const { return resourceGroup_; }
+
+        void addResourceLocation(ResourceLocation* location);
+        void removeResourceLocation(ResourceLocation* location);
+        ResourceLocation* getResourceLocation(unsigned int index) const;
+
+    private:
+        ResourceCollection(const ResourceCollection&);
+
+        std::string resourceGroup_;
+        std::vector<ResourceLocation*> resourceLocations_;
+    };
+}
+
+#endif /* _ResourceCollection_H__ */
Index: /code/branches/libraries2/src/libraries/tools/ResourceLocation.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/ResourceLocation.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/ResourceLocation.cc	(revision 5717)
@@ -0,0 +1,104 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "ResourceLocation.h"
+
+#include <OgreResourceGroupManager.h>
+#include <boost/filesystem.hpp>
+
+#include "util/Exception.h"
+#include "core/Core.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLFile.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(ResourceLocation);
+
+    ResourceLocation::ResourceLocation(BaseObject* creator)
+        : BaseObject(creator)
+    {
+        RegisterObject(ResourceLocation);
+
+        // Default values
+        archiveType_ = "FileSystem";
+        bRecursive_  = true;
+    }
+
+    ResourceLocation::~ResourceLocation()
+    {
+    }
+
+    void ResourceLocation::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        XMLPortParam(ResourceLocation, "path",        setPath,        getPath,        xmlElement, mode);
+        XMLPortParam(ResourceLocation, "archiveType", setArchiveType, getArchiveType, xmlElement, mode);
+        XMLPortParam(ResourceLocation, "recursive",   setRecursive,   getRecursive,   xmlElement, mode);
+        if (path_.empty())
+            ThrowException(AbortLoading, "ResourceLocation: No path given.");
+    }
+
+    void ResourceLocation::load(const std::string& resourceGroup)
+    {
+        if (path_.empty())
+            ThrowException(InitialisationFailed, "ResourceLocation: Trying to add one without the path being set");
+
+        // Find the path
+        boost::filesystem::path path;
+        if (boost::filesystem::exists(Core::getDataPath() / this->getPath()))
+            path = Core::getDataPath() / this->getPath();
+        else if (Core::isDevelopmentRun() && boost::filesystem::exists(Core::getExternalDataPath() / this->getPath()))
+            path = Core::getExternalDataPath() / this->getPath();
+        else
+        {
+            COUT(2) << "Warning: ResourceLocation '" << this->getPath() << "' does not seem to exist" << std::endl;
+            return;
+        }
+
+        // Add it to the Ogre paths
+        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
+            path.string(), this->getArchiveType(), resourceGroup, this->getRecursive());
+        resourceGroup_ = resourceGroup;
+    }
+
+    void ResourceLocation::unload()
+    {
+        // Remove from Ogre paths
+        resourceGroup_.erase();
+        try
+        {
+            Ogre::ResourceGroupManager::getSingleton().removeResourceLocation(
+                this->getPath(), this->getResourceGroup());
+        }
+        catch (const std::exception& ex)
+        {
+            COUT(1) << "Removing of a ResourceLocation failed: " << ex.what() << std::endl;
+        }
+    }
+}
Index: /code/branches/libraries2/src/libraries/tools/ResourceLocation.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/ResourceLocation.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/ResourceLocation.h	(revision 5717)
@@ -0,0 +1,74 @@
+/*
+ *   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 _ResourceLocation_H__
+#define _ResourceLocation_H__
+
+#include "tools/ToolsPrereqs.h"
+
+#include <string>
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+    class _ToolsExport ResourceLocation : public BaseObject
+    {
+        // for load/unload
+        friend class ResourceCollection;
+
+    public:
+        ResourceLocation(BaseObject* creator);
+        virtual ~ResourceLocation();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+
+        void setPath(const std::string& path) { path_ = path; }
+        const std::string& getPath() const { return path_; }
+
+        void setArchiveType(const std::string& archiveType) { archiveType_ = archiveType; }
+        const std::string& getArchiveType() const { return archiveType_; }
+
+        void setRecursive(bool bRecursive) { bRecursive_ = bRecursive; }
+        bool getRecursive() const { return bRecursive_; }
+
+        const std::string& getResourceGroup() const { return resourceGroup_; }
+
+    private:
+        ResourceLocation(const ResourceLocation&);
+
+        void load(const std::string& resourceGroup);
+        void unload();
+
+        std::string path_;
+        std::string archiveType_;
+        std::string resourceGroup_;
+        bool bRecursive_;
+    };
+}
+
+#endif /* _ResourceLocation_H__ */
Index: /code/branches/libraries2/src/libraries/tools/Shader.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/Shader.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/Shader.cc	(revision 5717)
@@ -0,0 +1,332 @@
+/*
+ *   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 "Shader.h"
+
+#include <OgreCompositorManager.h>
+#include <OgreCompositorInstance.h>
+#include <OgreSceneManager.h>
+#include <OgreRoot.h>
+#include <OgrePlugin.h>
+#include <OgreMaterial.h>
+#include <OgreTechnique.h>
+#include <OgrePass.h>
+#include <OgreMaterialManager.h>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/GraphicsManager.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_ = GameMode::showsGraphics();
+        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 = GraphicsManager::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 = GraphicsManager::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 ((*static_cast<float*>(pointer->second)) != value)
+                {
+                    (*static_cast<float*>(pointer->second)) = value;
+                    return true;
+                }
+            }
+            else
+            {
+                if ((*static_cast<int*>(pointer->second)) != static_cast<int>(value))
+                {
+                    (*static_cast<int*>(pointer->second)) = static_cast<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 ((*static_cast<float*>(pointer->second)) != static_cast<float>(value))
+                {
+                    (*static_cast<float*>(pointer->second)) = static_cast<float>(value);
+                    return true;
+                }
+            }
+            else
+            {
+                if ((*static_cast<int*>(pointer->second)) != value)
+                {
+                    (*static_cast<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 (*static_cast<float*>(pointer->second));
+            else
+                return static_cast<float>(*static_cast<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 (!GameMode::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())
+                                            ? static_cast<void*>(parameter_pointer->getFloatPointer(definition_iterator->second.physicalIndex))
+                                            : static_cast<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/branches/libraries2/src/libraries/tools/Shader.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/Shader.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/Shader.h	(revision 5717)
@@ -0,0 +1,109 @@
+/*
+ *   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 "tools/ToolsPrereqs.h"
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include "util/OgreForwardRefs.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+    class _ToolsExport 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/branches/libraries2/src/libraries/tools/TextureGenerator.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/TextureGenerator.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/TextureGenerator.cc	(revision 5717)
@@ -0,0 +1,87 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the TextureGenerator.
+*/
+
+#include "TextureGenerator.h"
+
+#include <OgreMaterialManager.h>
+#include <OgreTechnique.h>
+#include "util/Convert.h"
+#include "util/Math.h"
+
+namespace std
+{
+    template <>
+    inline bool less<orxonox::ColourValue>::operator()(const orxonox::ColourValue& __x, const orxonox::ColourValue& __y) const
+    {
+        if (__x.r == __y.r)
+        {
+            if (__x.g == __y.g)
+            {
+                if (__x.b == __y.b)
+                {
+                    return __x.a < __y.a;
+                }
+                return __x.b < __y.b;
+            }
+            return __x.g < __y.g;
+        }
+        return __x.r < __y.r;
+    }
+}
+
+namespace orxonox
+{
+    std::map<std::string, std::map<ColourValue, std::string> > TextureGenerator::materials_s;
+    unsigned int TextureGenerator::materialCount_s = 0;
+
+    /*static*/ const std::string& TextureGenerator::getMaterialName(const std::string& textureName, const ColourValue& colour)
+    {
+        std::map<ColourValue, std::string>& colourMap = materials_s[textureName];
+        std::map<ColourValue, std::string>::const_iterator it = colourMap.find(colour);
+
+        if (it == colourMap.end())
+        {
+            std::string materialName = textureName + "_Material_" + multi_cast<std::string>(materialCount_s++);
+            Ogre::MaterialPtr material = static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().create(materialName, "General"));
+            material->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
+            Ogre::TextureUnitState* textureUnitState = material->getTechnique(0)->getPass(0)->createTextureUnitState();
+            textureUnitState->setTextureName(textureName);
+            textureUnitState->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, colour);
+            return (colourMap[colour] = materialName);
+        }
+        else
+        {
+            return (*it).second;
+        }
+    }
+}
Index: /code/branches/libraries2/src/libraries/tools/TextureGenerator.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/TextureGenerator.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/TextureGenerator.h	(revision 5717)
@@ -0,0 +1,60 @@
+/*
+ *   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:
+ *      Reto Grieder
+ *
+ */
+
+/**
+    @file
+    @brief
+*/
+
+#ifndef _TextureGenerator_H__
+#define _TextureGenerator_H__
+
+#include "tools/ToolsPrereqs.h"
+
+#include <map>
+#include <string>
+#include "util/UtilPrereqs.h"
+
+namespace orxonox
+{
+    class _ToolsExport TextureGenerator
+    {
+    public:
+        static const std::string& getMaterialName(const std::string& textureName, const ColourValue& colour);
+
+    private:
+        TextureGenerator();
+        TextureGenerator(const TextureGenerator&);
+        ~TextureGenerator();
+
+        static std::map<std::string, std::map<ColourValue, std::string> > materials_s;
+        static unsigned int materialCount_s;
+    };
+}
+
+#endif /* _TextureGenerator_H__ */
Index: /code/branches/libraries2/src/libraries/tools/Timer.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/Timer.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/Timer.cc	(revision 5717)
@@ -0,0 +1,160 @@
+/*
+ *   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 "Timer.h"
+
+#include <set>
+
+#include "core/CoreIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "core/CommandExecutor.h"
+#include "core/Clock.h"
+#include "core/Functor.h"
+
+namespace orxonox
+{
+    SetConsoleCommandShortcutExtern(delay);
+    SetConsoleCommandShortcutExtern(killdelays);
+
+    static std::set<StaticTimer*> delaytimerset;
+
+    /**
+        @brief Calls a console command after 'delay' seconds.
+        @param delay The delay in seconds
+        @param command The console command
+    */
+    void delay(float delay, const std::string& command)
+    {
+        StaticTimer *delaytimer = new StaticTimer();
+        delaytimerset.insert(delaytimer);
+
+        ExecutorStatic* delayexecutor = createExecutor(createFunctor(&executeDelayedCommand));
+        delayexecutor->setDefaultValues(delaytimer, command);
+        delaytimer->setTimer(delay, false, delayexecutor);
+    }
+
+    /**
+        @brief Executes the command.
+        @param timer The timer to destroy after the command-execution
+        @param command The command to execute
+    */
+    void executeDelayedCommand(StaticTimer* timer, const std::string& command)
+    {
+        CommandExecutor::execute(command);
+        delete timer;
+        delaytimerset.erase(timer);
+    }
+
+    /**
+        @brief Kills all delayed commands.
+    */
+    void killdelays()
+    {
+        for (std::set<StaticTimer*>::iterator it = delaytimerset.begin(); it != delaytimerset.end(); ++it)
+            delete (*it);
+
+        delaytimerset.clear();
+    }
+
+    /**
+        @brief Constructor: Sets the default-values.
+    */
+    TimerBase::TimerBase()
+    {
+        this->executor_ = 0;
+        this->interval_ = 0;
+        this->bLoop_ = false;
+        this->bActive_ = false;
+        this->bKillAfterCall_ = false;
+
+        this->time_ = 0;
+
+        RegisterObject(TimerBase);
+    }
+
+    /**
+        @brief Deletes the executor.
+    */
+    TimerBase::~TimerBase()
+    {
+        this->deleteExecutor();
+    }
+
+    /**
+        @brief Executes the executor.
+    */
+    void TimerBase::run() const
+    {
+        bool temp = this->bKillAfterCall_; // to avoid errors with bKillAfterCall_=false and an exutors which destroy the timer
+
+        (*this->executor_)();
+
+        if (temp)
+            delete this;
+    }
+
+    /**
+        @brief Deletes the executor.
+    */
+    void TimerBase::deleteExecutor()
+    {
+      if (this->executor_)
+          delete this->executor_;
+    }
+
+    /**
+        @brief Updates the timer before the frames are rendered.
+    */
+    void TimerBase::tick(const Clock& time)
+    {
+        if (this->bActive_)
+        {
+            // If active: Decrease the timer by the duration of the last frame
+            this->time_ -= static_cast<long long>(time.getDeltaTimeMicroseconds() * this->getTimeFactor());
+
+            if (this->time_ <= 0)
+            {
+                // It's time to call the function
+                if (this->bLoop_ && !this->bKillAfterCall_)
+                {
+                    this->time_ += this->interval_; // Q: Why '+=' and not '='? A: Think about it. It's more accurate like that. Seriously.
+                    while (this->time_ <= 0)
+                    {
+                        // The interval was shorter than one tick, so execute the function more than once
+                        this->run();
+                        this->time_ += this->interval_;
+                    }
+                }
+                else
+                    this->stopTimer(); // Stop the timer if we don't want to loop
+
+                this->run();
+            }
+        }
+    }
+}
Index: /code/branches/libraries2/src/libraries/tools/Timer.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/Timer.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/Timer.h	(revision 5717)
@@ -0,0 +1,212 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/*!
+    @file
+    @brief Definition and Implementation of the Timer class.
+
+    The Timer is a callback-object, calling a given function after a given time-interval.
+
+    Usage:
+    header.h:
+        class ClassName
+        {
+            public:
+                ClassName();
+                void functionName();
+                Timer<ClassName> myTimer;
+        };
+
+    source.cc:
+        include "core/Executor.h"
+
+        ClassName::ClassName()
+        {
+            myTimer.setTimer(interval_in_seconds, bLoop, this, createExecutor(createFunctor(&ClassName::functionName)));
+        }
+
+        void ClassName::functionName()
+        {
+            whateveryouwant();
+            something(else);
+        }
+*/
+
+#ifndef _Timer_H__
+#define _Timer_H__
+
+#include "tools/ToolsPrereqs.h"
+
+#include "core/Executor.h"
+#include "core/OrxonoxClass.h"
+#include "tools/interfaces/TimeFactorListener.h"
+
+namespace orxonox
+{
+    class StaticTimer;
+    void delay(float delay, const std::string& command);
+    void killdelays();
+    void executeDelayedCommand(StaticTimer* timer, const std::string& command);
+
+    //! TimerBase is the parent of the Timer class.
+    class _ToolsExport TimerBase : public TimeFactorListener
+    {
+        public:
+            ~TimerBase();
+
+            void run() const;
+            void deleteExecutor();
+
+            /** @brief Starts the Timer: Function-call after 'interval' seconds. */
+            inline void startTimer()
+                { this->bActive_ = true; this->time_ = this->interval_; }
+            /** @brief Stops the Timer. */
+            inline void stopTimer()
+                { this->bActive_ = false; this->time_ = this->interval_; }
+            /** @brief Pauses the Timer - it will continue with the actual state if you unpause it. */
+            inline void pauseTimer()
+                { this->bActive_ = false; }
+            /** @brief Unpauses the Timer - continues with the given state. */
+            inline void unpauseTimer()
+                { this->bActive_ = true; }
+            /** @brief Returns true if the Timer is active (= not stoped, not paused). @return True = Time is active */
+            inline bool isActive() const
+                { return this->bActive_; }
+            /** @brief Returns the remaining time until the Timer calls the function. @return The remaining time */
+            inline float getRemainingTime() const
+                { return static_cast<float>(this->time_ / 1000000.0f); }
+            /** @brief Gives the Timer some extra time. @param time The amount of extra time in seconds */
+            inline void addTime(float time)
+                { if (time > 0.0f) this->time_ += static_cast<long long>(time * 1000000.0f); }
+            /** @brief Decreases the remaining time of the Timer. @param time The amount of time to remove */
+            inline void removeTime(float time)
+                { if (time > 0.0f) this->time_ -= static_cast<long long>(time * 1000000.0f); }
+            /** @brief Sets the interval of the Timer. @param interval The interval */
+            inline void setInterval(float interval)
+                { this->interval_ = static_cast<long long>(interval * 1000000.0f); }
+            /** @brief Sets bLoop to a given value. @param bLoop True = loop */
+            inline void setLoop(bool bLoop)
+                { this->bLoop_ = bLoop; }
+
+            void tick(const Clock& time);
+
+        protected:
+            TimerBase();
+
+            Executor* executor_;  //!< The executor of the function that should be called when the time expires
+
+            long long interval_;  //!< The time-interval in micro seconds
+            bool bLoop_;          //!< If true, the function gets called every 'interval' seconds
+            bool bActive_;        //!< If true, the Timer ticks and calls the function if the time's up
+            bool bKillAfterCall_; //!< If true the timer gets deleted after it called the function
+
+            long long time_;      //!< Internal variable, counting the time till the next function-call
+    };
+
+    //! The Timer is a callback-object, calling a given function after a given time-interval.
+    template <class T = BaseObject>
+    class Timer : public TimerBase
+    {
+        public:
+            Timer() {}
+
+            /**
+                @brief Constructor: Initializes the Timer with given values.
+                @param interval The timer-interval in seconds
+                @param bLoop If true, the function gets called every 'interval' seconds
+                @param object The object owning the timer and the function
+                @param exeuctor A executor of the function to call
+            */
+            Timer(float interval, bool bLoop, T* object, ExecutorMember<T>* exeuctor, bool bKillAfterCall = false)
+            {
+                this->setTimer(interval, bLoop, object, exeuctor, bKillAfterCall);
+            }
+
+            /**
+                @brief Initializes the Timer with given values.
+                @param interval The timer-interval in seconds
+                @param bLoop If true, the function gets called every 'interval' seconds
+                @param object The object owning the timer and the function
+                @param exeuctor A executor of the function to call
+            */
+            void setTimer(float interval, bool bLoop, T* object, ExecutorMember<T>* executor, bool bKillAfterCall = false)
+            {
+                this->deleteExecutor();
+
+                this->setInterval(interval);
+                this->bLoop_ = bLoop;
+                executor->setObject(object);
+                this->executor_ = static_cast<Executor*>(executor);
+                this->bActive_ = true;
+
+                this->time_ = this->interval_;
+                this->bKillAfterCall_ = bKillAfterCall;
+            }
+    };
+
+    //! The StaticTimer is a callback-object, calling a static function after a given time-interval.
+    class _ToolsExport StaticTimer : public TimerBase
+    {
+        public:
+            StaticTimer() {}
+
+            /**
+                @brief Constructor: Initializes the Timer with given values.
+                @param interval The timer-interval in seconds
+                @param bLoop If true, the function gets called every 'interval' seconds
+                @param exeuctor A executor of the function to call
+            */
+            StaticTimer(float interval, bool bLoop, ExecutorStatic* executor, bool bKillAfterCall = false)
+            {
+                this->setTimer(interval, bLoop, executor, bKillAfterCall);
+            }
+
+            /**
+                @brief Initializes the Timer with given values.
+                @param interval The timer-interval in seconds
+                @param bLoop If true, the function gets called every 'interval' seconds
+                @param object The object owning the timer and the function
+                @param executor A executor of the function to call
+            */
+            void setTimer(float interval, bool bLoop, ExecutorStatic* executor, bool bKillAfterCall = false)
+            {
+                this->deleteExecutor();
+
+                this->setInterval(interval);
+                this->bLoop_ = bLoop;
+                this->executor_ = executor;
+                this->bActive_ = true;
+
+                this->time_ = this->interval_;
+                this->bKillAfterCall_ = bKillAfterCall;
+            }
+    };
+
+}
+
+#endif /* _Timer_H__ */
Index: /code/branches/libraries2/src/libraries/tools/ToolsPrereqs.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/ToolsPrereqs.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/ToolsPrereqs.h	(revision 5717)
@@ -0,0 +1,91 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+  @file
+  @brief Contains all the necessary forward declarations for all classes and structs.
+*/
+
+#ifndef _ToolsPrereqs_H__
+#define _ToolsPrereqs_H__
+
+#include "OrxonoxConfig.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#  ifdef TOOLS_SHARED_BUILD
+#    define _ToolsExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _ToolsExport
+#    else
+#      define _ToolsExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _ToolsExport  __attribute__ ((visibility("default")))
+#else
+#  define _ToolsExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    namespace LODParticle
+    {
+        enum Value
+        {
+            Off = 0,
+            Low = 1,
+            Normal = 2,
+            High = 3
+        };
+    }
+
+    class BillboardSet;
+    class Mesh;
+    class ParticleInterface;
+    class Shader;
+    template <class T>
+    class Timer;
+    class StaticTimer;
+}
+
+namespace Ogre
+{
+    // OGRE Wiki adapted code
+    class DynamicLines;
+    class DynamicRenderable;
+}
+
+#endif /* _ToolsPrereqs_H__ */
Index: /code/branches/libraries2/src/libraries/tools/interfaces/CMakeLists.txt
===================================================================
--- /code/branches/libraries2/src/libraries/tools/interfaces/CMakeLists.txt	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/interfaces/CMakeLists.txt	(revision 5717)
@@ -0,0 +1,3 @@
+ADD_SOURCE_FILES(TOOLS_SRC_FILES
+  ToolsInterfaceCompilation.cc
+)
Index: /code/branches/libraries2/src/libraries/tools/interfaces/Tickable.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/interfaces/Tickable.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/interfaces/Tickable.h	(revision 5717)
@@ -0,0 +1,68 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/*!
+    @file
+    @brief Declaration of the Tickable interface.
+
+    The Tickable interface provides a tick(dt) function, that gets called every frame.
+    float dt is the time since the last frame in seconds.
+
+    Attention:
+    Classes derived from a Tickable that want to have a tick(dt) function on their part, MUST call the
+    parent::tick(dt) function explicitly in their implementation of tick(dt) because it's a virtual function.
+*/
+
+#ifndef _Tickable_H__
+#define _Tickable_H__
+
+#include "tools/ToolsPrereqs.h"
+
+#include "core/OrxonoxClass.h"
+#include "core/Super.h"
+
+namespace orxonox
+{
+    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
+    class _ToolsExport Tickable : virtual public OrxonoxClass
+    {
+        public:
+            /**
+                @brief Gets called every frame.
+                @param dt The time since the last frame in seconds
+            */
+            virtual void tick(float dt) { }
+
+        protected:
+            Tickable();
+    };
+
+    SUPER_FUNCTION(1, Tickable, tick, true);
+}
+
+#endif /* _Tickable_H__ */
Index: /code/branches/libraries2/src/libraries/tools/interfaces/TimeFactorListener.h
===================================================================
--- /code/branches/libraries2/src/libraries/tools/interfaces/TimeFactorListener.h	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/interfaces/TimeFactorListener.h	(revision 5717)
@@ -0,0 +1,55 @@
+/*
+ *   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 _TimeFactorListener_H__
+#define _TimeFactorListener_H__
+
+#include "tools/ToolsPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _ToolsExport TimeFactorListener : virtual public OrxonoxClass
+    {
+        friend class GSRoot;
+
+        public:
+            TimeFactorListener();
+            virtual ~TimeFactorListener() {}
+
+        protected:
+            virtual void changedTimeFactor(float factor_new, float factor_old) {}
+            inline float getTimeFactor() const
+                { return TimeFactorListener::timefactor_s; }
+
+        private:
+            static float timefactor_s;
+    };
+}
+
+#endif /* _TimeFactorListener_H__ */
Index: /code/branches/libraries2/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc
===================================================================
--- /code/branches/libraries2/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc	(revision 5717)
+++ /code/branches/libraries2/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc	(revision 5717)
@@ -0,0 +1,62 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Compiles all the interfaces in the tools library with mostly just a constructor.
+*/
+
+#include "Tickable.h"
+#include "TimeFactorListener.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    //----------------------------
+    // TimeFactorListener
+    //----------------------------
+    float TimeFactorListener::timefactor_s = 1.0f;
+
+    TimeFactorListener::TimeFactorListener()
+    {
+        RegisterRootObject(TimeFactorListener);
+    }
+
+    //----------------------------
+    // Tickable
+    //----------------------------
+    /**
+        @brief Constructor: Registers the object in the Tickable-list
+    */
+    Tickable::Tickable()
+    {
+        RegisterRootObject(Tickable);
+    }
+}
Index: /code/branches/libraries2/src/orxonox/CMakeLists.txt
===================================================================
--- /code/branches/libraries2/src/orxonox/CMakeLists.txt	(revision 5716)
+++ /code/branches/libraries2/src/orxonox/CMakeLists.txt	(revision 5717)
@@ -34,5 +34,4 @@
 ADD_SUBDIRECTORY(objects)
 ADD_SUBDIRECTORY(sound)
-ADD_SUBDIRECTORY(tools)
 
 # Translate argument
Index: /code/branches/libraries2/src/orxonox/objects/pickup/ModifierPickup.h
===================================================================
--- /code/branches/libraries2/src/orxonox/objects/pickup/ModifierPickup.h	(revision 5716)
+++ /code/branches/libraries2/src/orxonox/objects/pickup/ModifierPickup.h	(revision 5717)
@@ -40,5 +40,5 @@
 #include <map>
 
-#include "orxonox/tools/Timer.h"
+#include "tools/Timer.h"
 #include "ModifierType.h"
 #include "PassiveItem.h"
