Index: code/branches/objecthierarchy/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/objecthierarchy/src/orxonox/CMakeLists.txt	(revision 2042)
+++ code/branches/objecthierarchy/src/orxonox/CMakeLists.txt	(revision 2044)
@@ -37,5 +37,4 @@
 
   tools/BillboardSet.cc
-  tools/Light.cc
   tools/Mesh.cc
   tools/ParticleInterface.cc
@@ -57,4 +56,7 @@
   objects/worldentities/ControllableEntity.cc
   objects/worldentities/Model.cc
+  objects/worldentities/Billboard.cc
+  objects/worldentities/BlinkingBillboard.cc
+  objects/worldentities/Light.cc
   objects/worldentities/Camera.cc
   objects/worldentities/CameraPosition.cc
Index: code/branches/objecthierarchy/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/OrxonoxPrereqs.h	(revision 2042)
+++ code/branches/objecthierarchy/src/orxonox/OrxonoxPrereqs.h	(revision 2044)
@@ -94,6 +94,6 @@
     class Model;
     class Billboard;
+    class BlinkingBillboard;
     class Light;
-    class DirectionalLight;
 
     class Camera;
Index: code/branches/objecthierarchy/src/orxonox/objects/Scene.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/Scene.cc	(revision 2042)
+++ code/branches/objecthierarchy/src/orxonox/objects/Scene.cc	(revision 2044)
@@ -74,9 +74,9 @@
         {
             Ogre::Light* light;
-            light = this->sceneManager_->createLight("Light0");
+            light = this->sceneManager_->createLight("Light-1");
             light->setType(Ogre::Light::LT_DIRECTIONAL);
             light->setDiffuseColour(ColourValue(1.0, 0.9, 0.6, 1.0));
             light->setSpecularColour(ColourValue(1.0, 0.9, 0.6, 1.0));
-            light->setDirection(1, -0.2, 0.2);
+            light->setDirection(1, -0.3, 0.3);
         }
         // test test test
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/Backlight.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/Backlight.h	(revision 2042)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/Backlight.h	(revision 2044)
@@ -32,10 +32,10 @@
 #include "OrxonoxPrereqs.h"
 
-#include "WorldEntity.h"
+#include "PositionableEntity.h"
 #include "tools/BillboardSet.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Backlight : public WorldEntity
+    class _OrxonoxExport Backlight : public PositionableEntity
     {
         public:
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/Billboard.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/Billboard.cc	(revision 2044)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/Billboard.cc	(revision 2044)
@@ -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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Billboard.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/Scene.h"
+
+namespace orxonox
+{
+    CreateFactory(Billboard);
+
+    Billboard::Billboard(BaseObject* creator) : PositionableEntity(creator)
+    {
+        RegisterObject(Billboard);
+
+        this->registerVariables();
+    }
+
+    Billboard::~Billboard()
+    {
+        if (this->isInitialized())
+        {
+            if (this->isInitialized() && this->billboard_.getBillboardSet())
+                this->getNode()->detachObject(this->billboard_.getName());
+        }
+    }
+
+    void Billboard::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Billboard, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Billboard, "material", setMaterial, getMaterial, xmlelement, mode);
+        XMLPortParam(Billboard, "colour",   setColour,   getColour,   xmlelement, mode).defaultValues(ColourValue::White);
+    }
+
+    void Billboard::registerVariables()
+    {
+        REGISTERSTRING(this->material_, network::direction::toclient, new network::NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
+        REGISTERDATA  (this->colour_,   network::direction::toclient, new network::NetworkCallback<Billboard>(this, &Billboard::changedColour));
+    }
+
+    void Billboard::changedMaterial()
+    {
+        if (!this->billboard_.getBillboardSet())
+        {
+            if (this->getScene() && this->getScene()->getSceneManager())
+            {
+                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
+                this->getNode()->attachObject(this->billboard_.getBillboardSet());
+            }
+        }
+        else
+            this->billboard_.setMaterial(this->material_);
+    }
+
+    void Billboard::changedColour()
+    {
+        if (!this->billboard_.getBillboardSet())
+        {
+            if (this->getScene() && this->getScene()->getSceneManager())
+            {
+                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
+                this->getNode()->attachObject(this->billboard_.getBillboardSet());
+            }
+        }
+        else
+            this->billboard_.setColour(this->colour_);
+    }
+
+    void Billboard::changedVisibility()
+    {
+        SUPER(Billboard, changedVisibility);
+
+        this->billboard_.setVisible(this->isVisible());
+    }
+}
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/Billboard.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/Billboard.h	(revision 2044)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/Billboard.h	(revision 2044)
@@ -0,0 +1,73 @@
+/*
+ *   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 _Billboard_H__
+#define _Billboard_H__
+
+#include "OrxonoxPrereqs.h"
+#include "PositionableEntity.h"
+#include "util/Math.h"
+#include "tools/BillboardSet.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Billboard : public PositionableEntity
+    {
+        public:
+            Billboard(BaseObject* creator);
+            virtual ~Billboard();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void changedVisibility();
+
+            inline const BillboardSet& getBillboardSet() const
+                { return this->billboard_; }
+
+            inline void setMaterial(const std::string& material)
+                { this->material_ = material; this->changedMaterial(); }
+            inline const std::string& getMaterial() const
+                { return this->material_; }
+
+            inline void setColour(const ColourValue& colour)
+                { this->colour_ = colour; this->changedColour(); }
+            inline const ColourValue& getColour() const
+                { return this->colour_; }
+
+        private:
+            void changedMaterial();
+            void changedColour();
+
+            BillboardSet billboard_;
+            std::string material_;
+            ColourValue colour_;
+    };
+}
+
+#endif /* _Billboard_H__ */
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/BlinkingBillboard.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/BlinkingBillboard.cc	(revision 2044)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/BlinkingBillboard.cc	(revision 2044)
@@ -0,0 +1,76 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "BlinkingBillboard.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(BlinkingBillboard);
+
+    BlinkingBillboard::BlinkingBillboard(BaseObject* creator) : Billboard(creator)
+    {
+        RegisterObject(BlinkingBillboard);
+
+        this->amplitude_ = 1.0f;
+        this->frequency_ = 1.0f;
+        this->phase_ = 0.0f;
+        this->time_ = 0;
+
+        this->registerVariables();
+    }
+
+    BlinkingBillboard::~BlinkingBillboard()
+    {
+    }
+
+    void BlinkingBillboard::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(BlinkingBillboard, XMLPort, xmlelement, mode);
+
+        XMLPortParam(BlinkingBillboard, "amplitude", setAmplitude, getAmplitude, xmlelement, mode).defaultValues(1.0f);
+        XMLPortParam(BlinkingBillboard, "frequency", setFrequency, getFrequency, xmlelement, mode).defaultValues(1.0f);
+        XMLPortParam(BlinkingBillboard, "phase",     setPhase,     getPhase,     xmlelement, mode).defaultValues(0.0f);
+    }
+
+    void BlinkingBillboard::registerVariables()
+    {
+        REGISTERDATA(this->amplitude_, network::direction::toclient);
+        REGISTERDATA(this->frequency_, network::direction::toclient);
+        REGISTERDATA(this->phase_,     network::direction::toclient);
+    }
+
+    void BlinkingBillboard::tick(float dt)
+    {
+        this->time_ += dt;
+        this->setScale(this->amplitude_ * sin((6.2831853 + this->phase_) * this->frequency_ * this->time_));
+    }
+}
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/BlinkingBillboard.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/BlinkingBillboard.h	(revision 2044)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/BlinkingBillboard.h	(revision 2044)
@@ -0,0 +1,72 @@
+/*
+ *   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 _BlinkingBillboard_H__
+#define _BlinkingBillboard_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Billboard.h"
+#include "objects/Tickable.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport BlinkingBillboard : public Billboard, public Tickable
+    {
+        public:
+            BlinkingBillboard(BaseObject* creator);
+            virtual ~BlinkingBillboard();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            virtual void tick(float dt);
+
+            inline void setAmplitude(float amplitude)
+                { this->amplitude_ = amplitude; }
+            inline float getAmplitude() const
+                { return this->amplitude_; }
+
+            inline void setFrequency(float frequency)
+                { this->frequency_ = frequency; }
+            inline float getFrequency() const
+                { return this->frequency_; }
+
+            inline void setPhase(float phase)
+                { this->phase_ = phase; }
+            inline float getPhase() const
+                { return this->phase_; }
+
+        private:
+            float amplitude_;
+            float frequency_;
+            float phase_;
+            long double time_;
+    };
+}
+
+#endif /* _BlinkingBillboard_H__ */
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/Light.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/Light.cc	(revision 2044)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/Light.cc	(revision 2044)
@@ -0,0 +1,167 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OrxonoxStableHeaders.h"
+#include "Light.h"
+
+#include <sstream>
+#include <cassert>
+
+#include <OgreSceneManager.h>
+
+#include "util/String.h"
+#include "util/Convert.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "objects/Scene.h"
+
+namespace orxonox
+{
+    unsigned int Light::lightCounter_s = 0;
+
+    CreateFactory(Light);
+
+    Light::Light(BaseObject* creator) : PositionableEntity(creator)
+    {
+        RegisterObject(Light);
+
+        if (this->getScene() && this->getScene()->getSceneManager())
+        this->light_ = this->getScene()->getSceneManager()->createLight("Light" + convertToString(Light::lightCounter_s++));
+        this->getNode()->attachObject(this->light_);
+
+        this->registerVariables();
+    }
+
+    Light::~Light()
+    {
+        if (this->isInitialized())
+        {
+            if (this->light_ && this->getScene() && this->getScene()->getSceneManager())
+                this->getScene()->getSceneManager()->destroyLight(this->light_);
+        }
+    }
+
+    void Light::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Light, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Light, "type", setTypeString, getTypeString, xmlelement, mode).defaultValues("point");
+        XMLPortParamExternTemplate(Light, Ogre::Light, this->light_, "diffuse",   setDiffuseColour,  getDiffuseColour,  xmlelement, mode, const ColourValue&);
+        XMLPortParamExternTemplate(Light, Ogre::Light, this->light_, "specular",  setSpecularColour, getSpecularColour, xmlelement, mode, const ColourValue&);
+        XMLPortParamExternTemplate(Light, Ogre::Light, this->light_, "direction", setDirection,      getDirection,      xmlelement, mode, const Vector3&);
+    }
+
+    void Light::registerVariables()
+    {
+        REGISTERDATA(this->type_, network::direction::toclient, new network::NetworkCallback<Light>(this, &Light::changedType));
+        REGISTERDATA(this->light_->getDiffuseColour(), network::direction::toclient);
+        REGISTERDATA(this->light_->getSpecularColour(), network::direction::toclient);
+        REGISTERDATA(this->light_->getDirection(), network::direction::toclient);
+    }
+
+    const std::string& Light::getName() const
+    {
+        if (this->light_)
+            return this->light_->getName();
+        else
+            return BLANKSTRING;
+    }
+
+    void Light::setDiffuseColour(const ColourValue& colour)
+    {
+        if (this->light_)
+            this->light_->setDiffuseColour(colour);
+    }
+
+    const ColourValue& Light::getDiffuseColour() const
+    {
+        if (this->light_)
+            return this->light_->getDiffuseColour();
+        else
+            return ColourValue::White;
+    }
+
+    void Light::setSpecularColour(const ColourValue& colour)
+    {
+        if (this->light_)
+            this->light_->setSpecularColour(colour);
+    }
+
+    const ColourValue& Light::getSpecularColour() const
+    {
+        if (this->light_)
+            return this->light_->getSpecularColour();
+        else
+            return ColourValue::White;
+    }
+
+    void Light::setDirection(const Vector3& direction)
+    {
+        if (this->light_)
+            this->light_->setDirection(direction);
+    }
+
+    const Vector3& Light::getDirection() const
+    {
+        if (this->light_)
+            return this->light_->getDirection();
+        else
+            return Vector3::ZERO;
+    }
+
+    void Light::setTypeString(const std::string& type)
+    {
+        if (type == "point")
+            this->setType(Ogre::Light::LT_POINT);
+        else if (type == "directional")
+            this->setType(Ogre::Light::LT_DIRECTIONAL);
+        else if (type == "spotlight")
+            this->setType(Ogre::Light::LT_SPOTLIGHT);
+        else
+            this->setType(Ogre::Light::LT_POINT);
+    }
+
+    std::string Light::getTypeString() const
+    {
+        switch (this->type_)
+        {
+            case Ogre::Light::LT_DIRECTIONAL:
+                return "directional";
+            case Ogre::Light::LT_SPOTLIGHT:
+                return "spotlight";
+            case Ogre::Light::LT_POINT:
+            default:
+                return "poinT";
+        }
+    }
+
+    void Light::changedType()
+    {
+        this->light_->setType(this->type_);
+    }
+}
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/Light.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/Light.h	(revision 2044)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/Light.h	(revision 2044)
@@ -0,0 +1,83 @@
+/*
+ *   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 _Light_H__
+#define _Light_H__
+
+#include "OrxonoxPrereqs.h"
+#include "PositionableEntity.h"
+
+#include <string>
+#include <OgreLight.h>
+
+#include "util/Math.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Light : public PositionableEntity
+    {
+        public:
+            Light(BaseObject* creator);
+            virtual ~Light();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            void registerVariables();
+
+            inline Ogre::Light* getLight()
+                { return this->light_; }
+
+            const std::string& getName() const;
+
+            inline void setType(Ogre::Light::LightTypes type)
+                { this->type_ = type; this->changedType(); }
+            Ogre::Light::LightTypes getType() const
+                { return this->type_; }
+
+            void setDiffuseColour(const ColourValue& colour);
+            const ColourValue& getDiffuseColour() const;
+
+            void setSpecularColour(const ColourValue& colour);
+            const ColourValue& getSpecularColour() const;
+
+            void setDirection(const Vector3& direction);
+            const Vector3& getDirection() const;
+
+        private:
+            void setTypeString(const std::string& type);
+            std::string getTypeString() const;
+
+            void changedType();
+
+            static unsigned int lightCounter_s;
+            Ogre::Light* light_;
+            Ogre::Light::LightTypes type_;
+
+    };
+}
+
+#endif /* _Light_H__ */
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/Model.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/Model.h	(revision 2042)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/Model.h	(revision 2044)
@@ -47,10 +47,11 @@
             virtual void changedVisibility();
 
+            inline const Mesh& getMesh() const
+                { return this->mesh_; }
+
             inline void setMeshSource(const std::string& meshname)
                 { this->meshSrc_ = meshname; this->changedMesh(); }
             inline const std::string& getMeshSource() const
                 { return this->meshSrc_; }
-            inline const Mesh& getMesh() const
-                { return this->mesh_; }
 
             inline void setCastShadows(bool bCastShadows)
Index: code/branches/objecthierarchy/src/orxonox/objects/worldentities/ParticleSpawner.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/objects/worldentities/ParticleSpawner.h	(revision 2042)
+++ code/branches/objecthierarchy/src/orxonox/objects/worldentities/ParticleSpawner.h	(revision 2044)
@@ -32,10 +32,10 @@
 #include "OrxonoxPrereqs.h"
 
-#include "WorldEntity.h"
+#include "PositionableEntity.h"
 #include "tools/Timer.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport ParticleSpawner : public WorldEntity
+    class _OrxonoxExport ParticleSpawner : public PositionableEntity
     {
         public:
Index: code/branches/objecthierarchy/src/orxonox/tools/BillboardSet.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/tools/BillboardSet.cc	(revision 2042)
+++ code/branches/objecthierarchy/src/orxonox/tools/BillboardSet.cc	(revision 2044)
@@ -32,7 +32,10 @@
 #include <sstream>
 #include <cassert>
+
 #include <OgreSceneManager.h>
+#include <OgreBillboard.h>
 
-#include "util/Math.h"
+#include "util/Convert.h"
+#include "util/String.h"
 
 namespace orxonox
@@ -45,28 +48,17 @@
     }
 
+    BillboardSet::~BillboardSet()
+    {
+        this->destroyBillboardSet();
+    }
+
     void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, int count)
     {
-        assert(scenemanager);
-
-        std::ostringstream name;
-        name << (BillboardSet::billboardSetCounter_s++);
-        this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count);
-        this->billboardSet_->createBillboard(Vector3::ZERO);
-        this->billboardSet_->setMaterialName(file);
-
-        this->scenemanager_ = scenemanager;
+        this->setBillboardSet(scenemanager, file, Vector3::ZERO, count);
     }
 
     void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const ColourValue& colour, int count)
     {
-        assert(scenemanager);
-
-        std::ostringstream name;
-        name << (BillboardSet::billboardSetCounter_s++);
-        this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count);
-        this->billboardSet_->createBillboard(Vector3::ZERO, colour);
-        this->billboardSet_->setMaterialName(file);
-
-        this->scenemanager_ = scenemanager;
+        this->setBillboardSet(scenemanager, file, colour, Vector3::ZERO, count);
     }
 
@@ -74,10 +66,16 @@
     {
         assert(scenemanager);
+        this->destroyBillboardSet();
 
-        std::ostringstream name;
-        name << (BillboardSet::billboardSetCounter_s++);
-        this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count);
-        this->billboardSet_->createBillboard(position);
-        this->billboardSet_->setMaterialName(file);
+        try
+        {
+            this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count);
+            this->billboardSet_->createBillboard(position);
+            this->billboardSet_->setMaterialName(file);
+        }
+        catch (...)
+        {
+            COUT(1) << "Error: Couln't load billboard \"" << file << "\"" << std::endl;
+        }
 
         this->scenemanager_ = scenemanager;
@@ -87,18 +85,79 @@
     {
         assert(scenemanager);
+        this->destroyBillboardSet();
 
-        std::ostringstream name;
-        name << (BillboardSet::billboardSetCounter_s++);
-        this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count);
-        this->billboardSet_->createBillboard(position, colour);
-        this->billboardSet_->setMaterialName(file);
+        try
+        {
+            this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(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->scenemanager_ = scenemanager;
     }
 
-    BillboardSet::~BillboardSet()
+    void BillboardSet::destroyBillboardSet()
     {
         if (this->billboardSet_ && this->scenemanager_)
             this->scenemanager_->destroyBillboardSet(this->billboardSet_);
     }
+
+    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/objecthierarchy/src/orxonox/tools/BillboardSet.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/tools/BillboardSet.h	(revision 2042)
+++ code/branches/objecthierarchy/src/orxonox/tools/BillboardSet.h	(revision 2044)
@@ -44,4 +44,5 @@
             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);
@@ -52,13 +53,18 @@
                 { return this->billboardSet_; }
 
-            inline const std::string& getName() const
-                { return this->billboardSet_->getName(); }
+            const std::string& getName() const;
 
-            inline void setVisible(bool visible)
-                { this->billboardSet_->setVisible(visible); }
-            inline bool getVisible() const
-                { return this->billboardSet_->getVisible(); }
+            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();
+
             static unsigned int billboardSetCounter_s;
             Ogre::BillboardSet* billboardSet_;
Index: code/branches/objecthierarchy/src/orxonox/tools/Light.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/tools/Light.cc	(revision 2042)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/*
- *   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:
- *      ...
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "Light.h"
-
-#include <sstream>
-#include <cassert>
-
-#include <OgreSceneManager.h>
-
-namespace orxonox
-{
-    unsigned int Light::lightCounter_s = 0;
-
-    Light::Light()
-    {
-        this->light_ = 0;
-    }
-
-    void Light::setLight(Ogre::SceneManager* scenemanager, Ogre::Light::LightTypes type, const ColourValue& diffuse, const ColourValue& specular)
-    {
-        assert(scenemanager);
-
-        std::ostringstream name;
-        name << (Light::lightCounter_s++);
-        this->light_ = scenemanager->createLight("Light" + name.str());
-        this->light_->setType(type);
-        this->light_->setDiffuseColour(diffuse);
-        this->light_->setSpecularColour(specular);
-
-        this->scenemanager_ = scenemanager;
-    }
-
-    Light::~Light()
-    {
-        if (this->light_ && this->scenemanager_)
-            this->scenemanager_->destroyLight(this->light_);
-    }
-}
Index: code/branches/objecthierarchy/src/orxonox/tools/Light.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/tools/Light.h	(revision 2042)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- *   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:
- *      ...
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _Light_H__
-#define _Light_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <string>
-
-#include <OgreLight.h>
-
-#include "util/Math.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Light
-    {
-        public:
-            Light();
-            ~Light();
-            void setLight(Ogre::SceneManager* scenemanager, Ogre::Light::LightTypes type = Ogre::Light::LT_POINT, const ColourValue& diffuse = ColourValue(1.0, 1.0, 1.0), const ColourValue& specular = ColourValue(1.0, 1.0, 1.0));
-
-            inline Ogre::Light* getLight()
-                { return this->light_; }
-
-            inline const std::string& getName() const
-                { return this->light_->getName(); }
-
-        private:
-            static unsigned int lightCounter_s;
-            Ogre::Light* light_;
-            Ogre::SceneManager* scenemanager_;
-    };
-}
-
-#endif /* _Light_H__ */
