Index: code/branches/presentation/data/levels/templates/spaceshipAssff.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipAssff.oxt	(revision 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipAssff.oxt	(revision 8589)
@@ -3,5 +3,4 @@
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipassffcameras
-   engine                 = spaceshipassffengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
@@ -36,4 +35,8 @@
    angularDamping    = 0.9999999
   >
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+    </engines>
     <attached>
       <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="assff.mesh" />
@@ -92,9 +95,6 @@
     </EffectContainer>
     <EffectContainer condition="not idle">
-      <FadingBillboard mainstate=activity active=false scale=0.1 position="0, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
-<!--
-      <Light mainstate=visibility position=" 8, 0, 8" diffuse="0.3, 0.6, 1.0" specular="0.3, 0.6, 1.0" attenuation="600, 1.0, 0.007, 0.0002" type=point />
-      <Light mainstate=visibility position="-8, 0, 8" diffuse="0.3, 0.6, 1.0" specular="0.3, 0.6, 1.0" attenuation="600, 1.0, 0.007, 0.0002" type=point />
--->
+      <FadingBillboard mainstate=activity active=false scale=0.1 position="7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.1 position="-7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
     </EffectContainer>
     <EffectContainer condition="normal or brake">
@@ -102,6 +102,6 @@
     </EffectContainer>
     <EffectContainer condition="normal or boost">
-      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
-      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 0" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 0" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
     </EffectContainer>
     <EffectContainer condition="boost">
@@ -109,5 +109,5 @@
       <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
     </EffectContainer>
-    <EffectContainer condition="brake">
+<!--    <EffectContainer condition="brake">
       <FadingBillboard mainstate=activity active=false scale=0.3 position=" 8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
       <FadingBillboard mainstate=activity active=false scale=0.3 position="-8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
@@ -115,4 +115,5 @@
       <FadingBillboard mainstate=activity active=false scale=0.15 position="-8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
     </EffectContainer>
+-->
   </MultiStateEngine>
 </Template>
Index: code/branches/presentation/data/levels/templates/spaceshipGhost.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipGhost.oxt	(revision 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipGhost.oxt	(revision 8589)
@@ -3,5 +3,5 @@
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipghostcameras
-   engine                 = spaceshipghostengine
+
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
@@ -21,5 +21,7 @@
    angularDamping    = 0.9999999
   >
-
+    <engines>
+      <MultiStateEngine position="0,0,0" template=spaceshipghostengine/>
+    </engines>
     <attached>
       <Model position="0,0,0" scale=2 yaw=90 pitch=-90 roll=0 mesh="ghost.mesh" />
Index: code/branches/presentation/data/levels/templates/spaceshipH2.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipH2.oxt	(revision 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipH2.oxt	(revision 8589)
@@ -3,5 +3,4 @@
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipHtwocameras
-   engine                 = spaceshipHtwoengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
@@ -25,5 +24,8 @@
   include("includes/weaponSettingsH2.oxi")
 ?>
+    <engines>
+      <MultiStateEngine position="0,0,0" template=spaceshipHtwoengine />
 
+    </engines>
     <attached>
       <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale3D="3,0.833,0.833" mesh="h2_green.mesh" />
Index: code/branches/presentation/data/levels/templates/spaceshipHXY.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipHXY.oxt	(revision 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipHXY.oxt	(revision 8589)
@@ -21,4 +21,7 @@
    angularDamping    = 0.9999999
   >
+    <engines>
+      <MultiStateEngine position=" 0, 0, 0" template=spaceshipHXYengine />
+    </engines>
     <attached>
       <Model position="0,0,0" yaw=180 pitch=-90 roll=0 scale=4 mesh="HXY.mesh" />
Index: code/branches/presentation/data/levels/templates/spaceshipHXYSL.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipHXYSL.oxt	(revision 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipHXYSL.oxt	(revision 8589)
@@ -3,5 +3,4 @@
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipHXYcameras
-   engine                 = spaceshipHXYengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
@@ -21,4 +20,7 @@
    angularDamping    = 0.9999999
   >
+    <engines>
+      <MultiStateEngine position=" 0, 0, 0" template=spaceshipHXYengine />
+    </engines>
     <attached>
       <Model position="0,0,0" yaw=180 pitch=-90 roll=0 scale=4 mesh="HXY.mesh" />
Index: code/branches/presentation/data/levels/templates/spaceshipPirate.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipPirate.oxt	(revision 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipPirate.oxt	(revision 8589)
@@ -3,5 +3,4 @@
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshippiratecameras
-   engine                 = spaceshippirateengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
@@ -21,4 +20,7 @@
    angularDamping    = 0.9999999
   >
+    <engines>
+      <MultiStateEngine position=" 0, 0, 0" template=spaceshippirateengine />
+    </engines>
     <attached>
       <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="pirate.mesh" />
Index: code/branches/presentation/data/levels/templates/spaceshipSwallow.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipSwallow.oxt	(revision 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipSwallow.oxt	(revision 8589)
@@ -3,5 +3,4 @@
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipswallowcameras
-   engine                 = spaceshipswallowengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
@@ -21,5 +20,7 @@
    angularDamping    = 0.9999999
   >
-
+    <engines>
+      <MultiStateEngine position=" 0, 0, 0" template=spaceshipswallowengine />
+    </engines>
     <attached>
       <Model position="0,0,0" scale=2 yaw=90 pitch=-90 roll=0 mesh="swallow_mat.mesh" />
Index: code/branches/presentation/data/levels/templates/spaceshipTransporter.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipTransporter.oxt	(revision 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipTransporter.oxt	(revision 8589)
@@ -3,5 +3,4 @@
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipTransportercameras
-   engine                 = spaceshipTransporterengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
@@ -21,4 +20,7 @@
    angularDamping    = 0.9999999
   >
+    <engines>
+      <MultiStateEngine position=" 0, 0, 0" template=spaceshipTransporterengine />
+    </engines>
     <attached>
       <Model position="0,0,0" yaw=0 pitch=0 roll=0 scale=10 mesh="Transporter.mesh" />
Index: code/branches/presentation/data/levels/templates/spaceshipTransporterSL.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipTransporterSL.oxt	(revision 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipTransporterSL.oxt	(revision 8589)
@@ -3,5 +3,4 @@
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipTransportercameras
-   engine                 = spaceshipTransporterengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
@@ -21,4 +20,7 @@
    angularDamping    = 0.9999999
   >
+    <engines>
+      <MultiStateEngine position=" 0, 0, 0" template=spaceshipTransporterengine />
+    </engines>
     <attached>
       <Model position="0,0,0" yaw=0 pitch=0 roll=0 scale=10 mesh="Transporter.mesh" />
Index: code/branches/presentation/src/modules/overlays/hud/HUDSpeedBar.cc
===================================================================
--- code/branches/presentation/src/modules/overlays/hud/HUDSpeedBar.cc	(revision 8588)
+++ code/branches/presentation/src/modules/overlays/hud/HUDSpeedBar.cc	(revision 8589)
@@ -54,7 +54,7 @@
         SUPER(HUDSpeedBar, tick, dt);
 
-        if (this->owner_ && this->owner_->getEngine())
+        if (this->owner_)
         {
-            float value = this->owner_->getVelocity().length() / (this->owner_->getEngine()->getMaxSpeedFront() * this->owner_->getEngine()->getSpeedFactor() * this->owner_->getEngine()->getBoostFactor());
+            float value = this->owner_->getVelocity().length() / (this->owner_->getMaxSpeedFront() * this->owner_->getSpeedFactor() * this->owner_->getBoostFactor());
             this->setValue(value);
         }
Index: code/branches/presentation/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/branches/presentation/src/orxonox/controllers/HumanController.cc	(revision 8588)
+++ code/branches/presentation/src/orxonox/controllers/HumanController.cc	(revision 8589)
@@ -75,4 +75,5 @@
         this->controlPaused_ = false;
         this->boosting_ = false;
+        this->boosting_ = false;
 
         HumanController::localController_s = this;
Index: code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.cc	(revision 8588)
+++ code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.cc	(revision 8589)
@@ -151,12 +151,5 @@
                 //Give new pig boost
                 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim);
-                if (spaceship && spaceship->getEngine())
-                {
-                    spaceship->getEngine()->setSpeedFactor(5);
-                    WeakPtr<Engine>* ptr = new WeakPtr<Engine>(spaceship->getEngine());
-                    ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
-                    executor->setDefaultValue(0, ptr);
-                    new Timer(10, false, executor, true);
-                }
+                grantPigBoost(spaceship);
             }
 
@@ -252,13 +245,5 @@
                 //Give new pig boost
                 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(victim);
-                if (spaceship && spaceship->getEngine())
-                {
-                    spaceship->getEngine()->setSpeedFactor(5);
-                    WeakPtr<Engine>* ptr = new WeakPtr<Engine>(spaceship->getEngine());
-                    ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
-                    executor->setDefaultValue(0, ptr);
-                    new Timer(10, false, executor, true);
-                }
-
+                grantPigBoost(spaceship);
             }
             // killer vs piggy
@@ -321,4 +306,17 @@
     }
 
+    void Dynamicmatch::grantPigBoost(orxonox::SpaceShip* spaceship)
+    {
+        // Give pig boost
+        if (spaceship)
+        {
+            spaceship->setSpeedFactor(5);
+            WeakPtr<SpaceShip>* ptr = new WeakPtr<SpaceShip>(spaceship);
+            ExecutorPtr executor = createExecutor(createFunctor(&Dynamicmatch::resetSpeedFactor, this));
+            executor->setDefaultValue(0, ptr);
+            new Timer(10, false, executor, true);
+        }
+    }
+
     void Dynamicmatch::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn) //set party + colouring
     {
@@ -597,5 +595,5 @@
     }
 
-    void Dynamicmatch::resetSpeedFactor(WeakPtr<Engine>* ptr)// helper function
+    void Dynamicmatch::resetSpeedFactor(WeakPtr<SpaceShip>* ptr)// helper function
     {
         if (*ptr)
Index: code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.h
===================================================================
--- code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.h	(revision 8588)
+++ code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.h	(revision 8589)
@@ -73,5 +73,6 @@
             virtual void furtherInstructions();*/
             virtual void rewardPig();
-            void resetSpeedFactor(WeakPtr<Engine>* ptr);
+            void grantPigBoost(SpaceShip* spaceship); // Added this, since it's used twice on different occasions.
+            void resetSpeedFactor(WeakPtr<SpaceShip>* ptr);
             void tick (float dt);// used to end the game
             SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
Index: code/branches/presentation/src/orxonox/items/Engine.cc
===================================================================
--- code/branches/presentation/src/orxonox/items/Engine.cc	(revision 8588)
+++ code/branches/presentation/src/orxonox/items/Engine.cc	(revision 8589)
@@ -35,5 +35,5 @@
 #include "Scene.h"
 #include "worldentities/pawns/SpaceShip.h"
-#include "tools/Shader.h"
+#include "core/Template.h"
 
 namespace orxonox
@@ -47,4 +47,5 @@
         this->ship_ = 0;
         this->shipID_ = OBJECTID_UNKNOWN;
+        this->relativePosition_ = Vector3(0,0,0);
 
         this->boostFactor_ = 1.5;
@@ -62,6 +63,4 @@
         this->accelerationUpDown_ = 0.0;
 
-        this->boostBlur_ = 0;
-
         this->speedAdd_ = 0.0;
         this->speedMultiply_ = 1.0;
@@ -73,11 +72,5 @@
     Engine::~Engine()
     {
-        if (this->isInitialized() && this->ship_)
-        {
-            this->ship_->setEngine(0);
-
-            if (this->boostBlur_)
-                this->boostBlur_->destroy();
-        }
+
     }
 
@@ -98,13 +91,11 @@
         XMLPortParam(Engine, "accelerationleftright", setAccelerationLeftRight, setAccelerationLeftRight, xmlelement, mode);
         XMLPortParam(Engine, "accelerationupdown",    setAccelerationUpDown,    setAccelerationUpDown,    xmlelement, mode);
+
+        XMLPortParam(Engine, "position", setRelativePosition, getRelativePosition, xmlelement, mode);
+        XMLPortParam(Engine, "template", setEngineTemplate, getEngineTemplate, xmlelement, mode);
     }
 
     void Engine::setConfigValues()
     {
-        SetConfigValueExternal(bEnableMotionBlur_, "GraphicsSettings", "enableMotionBlur", true)
-            .description("Enable or disable the motion blur effect when moving very fast")
-            .callback(this, &Engine::changedEnableMotionBlur);
-        SetConfigValueExternal(blurStrength_, "GraphicsSettings", "blurStrength", 3.0f)
-            .description("Defines the strength of the motion blur effect");
     }
 
@@ -202,20 +193,13 @@
         }
 
-        this->ship_->setAcceleration(this->ship_->getOrientation() * (acceleration*this->getSpeedMultiply()+Vector3(0,0,-this->getSpeedAdd())));
-
-        this->ship_->setSteeringDirection(Vector3::ZERO);
-
-        if (this->bEnableMotionBlur_ && !this->boostBlur_ && this->ship_->hasLocalController() && this->ship_->hasHumanController())
-        {
-            this->boostBlur_ = new Shader(this->ship_->getScene()->getSceneManager());
-            this->boostBlur_->setCompositorName("Radial Blur");
-        }
-
-        if (this->boostBlur_ && this->maxSpeedFront_ != 0 && this->boostFactor_ != 1)
-        {
-            float blur = this->blurStrength_ * clamp((-velocity.z - this->maxSpeedFront_) / ((this->boostFactor_ - 1) * this->maxSpeedFront_), 0.0f, 1.0f);
-
-            this->boostBlur_->setVisible(blur > 0);
-            this->boostBlur_->setParameter(0, 0, "sampleStrength", blur);
+        // NOTE: Bullet always uses global coordinates.
+        this->ship_->addAcceleration(this->ship_->getOrientation() * (acceleration*this->getSpeedMultiply()+Vector3(0,0,-this->getSpeedAdd())), this->ship_->getOrientation() * this->relativePosition_);
+
+        // Hack to reset a temporary variable "direction"
+        this->ship_->oneEngineTickDone();
+        if(!this->ship_->hasEngineTicksRemaining())
+        {
+            this->ship_->setSteeringDirection(Vector3::ZERO);
+            this->ship_->resetEngineTicks();
         }
     }
@@ -224,7 +208,4 @@
     {
         SUPER(Engine, changedActivity);
-
-        if (this->boostBlur_)
-            this->boostBlur_->setVisible(this->isVisible());
     }
 
@@ -236,12 +217,6 @@
         {
             this->shipID_ = ship->getObjectID();
-            if (ship->getEngine() != this)
-                ship->setEngine(this);
-
-            if (this->boostBlur_)
-            {
-                this->boostBlur_->destroy();
-                this->boostBlur_ = 0;
-            }
+            if (!ship->hasEngine(this))
+                ship->addEngine(this);
         }
     }
@@ -265,10 +240,14 @@
     }
 
-    void Engine::changedEnableMotionBlur()
-    {
-        if (!this->bEnableMotionBlur_)
-        {
-            this->boostBlur_->destroy();
-            this->boostBlur_ = 0;
+    void Engine::loadEngineTemplate()
+    {
+        if(!this->engineTemplate_.empty())
+        {
+            COUT(4)<<"Loading an engine template: "<<this->engineTemplate_<<"\n";
+            Template *temp = Template::getTemplate(this->engineTemplate_);
+            if(temp)
+            {
+                this->addTemplate(temp);
+            }
         }
     }
Index: code/branches/presentation/src/orxonox/items/Engine.h
===================================================================
--- code/branches/presentation/src/orxonox/items/Engine.h	(revision 8588)
+++ code/branches/presentation/src/orxonox/items/Engine.h	(revision 8589)
@@ -54,4 +54,9 @@
             inline SpaceShip* getShip() const
                 { return this->ship_; }
+
+            inline void setRelativePosition(const Vector3 &position)
+                { this->relativePosition_ = position; }
+            inline Vector3& getRelativePosition()
+                { return this->relativePosition_; }
 
             inline void setBoostFactor(float factor)
@@ -119,16 +124,26 @@
                 { this->speedMultiply_=speedMultiply; }
 
+            
+            inline void setEngineTemplate(const std::string& temp)
+                { this->engineTemplate_ = temp; this->loadEngineTemplate(); }
+            inline const std::string& getEngineTemplate() const
+                { return this->engineTemplate_; }
+
         protected:
             virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const
                 { return new std::vector<PickupCarrier*>(); }
             virtual PickupCarrier* getCarrierParent(void) const;
+            
+            void loadEngineTemplate();
 
         private:
             void registerVariables();
             void networkcallback_shipID();
-            void changedEnableMotionBlur();
+
+            std::string engineTemplate_;
 
             SpaceShip* ship_;
             unsigned int shipID_;
+            Vector3 relativePosition_;
 
             float boostFactor_;
@@ -148,8 +163,4 @@
             float accelerationLeftRight_;
             float accelerationUpDown_;
-
-            Shader* boostBlur_;
-            float blurStrength_;
-            bool bEnableMotionBlur_;
     };
 }
Index: code/branches/presentation/src/orxonox/worldentities/MobileEntity.cc
===================================================================
--- code/branches/presentation/src/orxonox/worldentities/MobileEntity.cc	(revision 8588)
+++ code/branches/presentation/src/orxonox/worldentities/MobileEntity.cc	(revision 8589)
@@ -143,7 +143,18 @@
     {
         if (this->isDynamic())
+        {
             this->physicalBody_->applyCentralForce(btVector3(acceleration.x * this->getMass(), acceleration.y * this->getMass(), acceleration.z * this->getMass()));
-
+        }
+
+        // If not bullet-managed (deprecated? SpaceShip doesn't use this anymore for movement)
         this->linearAcceleration_ = acceleration;
+    }
+
+    void MobileEntity::addAcceleration(const Vector3 &acceleration, const Vector3 &relativePosition)
+    {
+        if(this->isDynamic())
+        {
+            this->physicalBody_->applyForce(this->getMass() * btVector3(acceleration.x, acceleration.y, acceleration.z), btVector3(relativePosition.x, relativePosition.y, relativePosition.z));
+        }
     }
 
Index: code/branches/presentation/src/orxonox/worldentities/MobileEntity.h
===================================================================
--- code/branches/presentation/src/orxonox/worldentities/MobileEntity.h	(revision 8588)
+++ code/branches/presentation/src/orxonox/worldentities/MobileEntity.h	(revision 8589)
@@ -70,4 +70,10 @@
                 { return this->linearAcceleration_; }
 
+            // Added for making N engines work with spaceships
+            void addAcceleration(const Vector3& acceleration, const Vector3 &relativePosition);
+            inline void addAcceleration(float x, float y, float z)
+                { this->addAcceleration(Vector3(x, y, z), Vector3(0,0,0)); }
+            // Getter function above
+
             void setAngularAcceleration(const Vector3& acceleration);
             inline void setAngularAcceleration(float x, float y, float z)
Index: code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 8588)
+++ code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc	(revision 8589)
@@ -35,8 +35,12 @@
 #include "core/Template.h"
 #include "core/XMLPort.h"
+#include "tools/Shader.h"
+#include "util/Math.h"
+
+#include "graphics/Camera.h"
 #include "items/Engine.h"
-#include "graphics/Camera.h"
+
 #include "CameraManager.h"
-#include "util/Math.h"
+#include "Scene.h"
 
 namespace orxonox
@@ -45,5 +49,5 @@
     CreateFactory(SpaceShip);
 
-    SpaceShip::SpaceShip(BaseObject* creator) : Pawn(creator)
+    SpaceShip::SpaceShip(BaseObject* creator) : Pawn(creator), boostBlur_(NULL)
     {
         RegisterObject(SpaceShip);
@@ -57,5 +61,4 @@
         this->bBoost_ = false;
         this->steering_ = Vector3::ZERO;
-        this->engine_ = 0;
 
         this->boostPower_ = 10.0f;
@@ -76,4 +79,5 @@
         this->enableCollisionCallback();
 
+        this->engineTicksNotDone = 0;
         this->setConfigValues();
         this->registerVariables();
@@ -89,6 +93,11 @@
     SpaceShip::~SpaceShip()
     {
-        if (this->isInitialized() && this->engine_)
-            this->engine_->destroy();
+        if (this->isInitialized())
+        {
+            this->removeAllEngines();
+        
+            if (this->boostBlur_)
+                this->boostBlur_->destroy();
+        }
     }
 
@@ -97,5 +106,5 @@
         SUPER(SpaceShip, XMLPort, xmlelement, mode);
 
-        XMLPortParam(SpaceShip, "engine",            setEngineTemplate,    getEngineTemplate,    xmlelement, mode);
+        //XMLPortParam(SpaceShip, "engine",            setEngineTemplate,    getEngineTemplate,    xmlelement, mode);
         XMLPortParamVariable(SpaceShip, "primaryThrust",  primaryThrust_,  xmlelement, mode);
         XMLPortParamVariable(SpaceShip, "auxilaryThrust", auxilaryThrust_, xmlelement, mode);
@@ -105,6 +114,8 @@
         XMLPortParamVariable(SpaceShip, "boostRate", boostRate_, xmlelement, mode);
         XMLPortParamVariable(SpaceShip, "boostCooldownDuration", boostCooldownDuration_, xmlelement, mode);
-        XMLPortParamVariable(SpaceShip, "shakeFrequency", shakeFrequency_, xmlelement, mode);
+		XMLPortParamVariable(SpaceShip, "shakeFrequency", shakeFrequency_, xmlelement, mode);
         XMLPortParamVariable(SpaceShip, "shakeAmplitude", shakeAmplitude_, xmlelement, mode);
+
+        XMLPortObject(SpaceShip, Engine, "engines", addEngine, getEngine, xmlelement, mode);
     }
 
@@ -126,4 +137,10 @@
     {
         SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down).");
+        
+        SetConfigValueExternal(bEnableMotionBlur_, "GraphicsSettings", "enableMotionBlur", true)
+            .description("Enable or disable the motion blur effect when moving very fast")
+            .callback(this, &SpaceShip::changedEnableMotionBlur);
+        SetConfigValueExternal(blurStrength_, "GraphicsSettings", "blurStrength", 3.0f)
+            .description("Defines the strength of the motion blur effect");
     }
 
@@ -146,15 +163,5 @@
         if (this->hasLocalController())
         {
-
-/*
-            this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_);
-            this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_);
-            if (this->localLinearAcceleration_.z() > 0)
-                this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_);
-            else
-                this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
-            this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
-            this->localLinearAcceleration_.setValue(0, 0, 0);
-*/
+            // Handle mouse look
             if (!this->isInMouseLook())
             {
@@ -162,12 +169,12 @@
                 this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
             }
-
             this->localAngularAcceleration_.setValue(0, 0, 0);
 
+            // Charge boostPower
             if(!this->bBoostCooldown_ && this->boostPower_ < this->initialBoostPower_)
             {
                 this->boostPower_ += this->boostPowerRate_*dt;
             }
-
+            // Use boostPower
             if(this->bBoost_)
             {
@@ -178,8 +185,28 @@
                     this->bBoostCooldown_ = true;
                     this->timer_.setTimer(this->boostCooldownDuration_, false, createExecutor(createFunctor(&SpaceShip::boostCooledDown, this)));
-
                 }
 
                 this->shakeCamera(dt);
+            }
+
+            // Enable Blur depending on settings
+            if (this->bEnableMotionBlur_ && !this->boostBlur_ && this->hasLocalController() && this->hasHumanController())
+            {
+                this->boostBlur_ = new Shader(this->getScene()->getSceneManager());
+                this->boostBlur_->setCompositorName("Radial Blur");
+            }
+
+            if (this->boostBlur_) // && this->maxSpeedFront_ != 0 && this->boostFactor_ != 1)
+            {
+                // TODO: this->maxSpeedFront_ gets fastest engine
+                float blur = this->blurStrength_ * clamp((-this->getLocalVelocity().z - 0.0f /*this->maxSpeedFront_*/) / ((150.0f /*boostFactor_*/ - 1) * 1.5f /*this->maxSpeedFront_*/), 0.0f, 1.0f);
+
+                // Show and hide blur effect depending on state of booster
+                if(this->bBoost_)
+                    this->boostBlur_->setVisible(blur > 0);
+                else
+                    this->boostBlur_->setVisible(false);
+
+                this->boostBlur_->setParameter(0, 0, "sampleStrength", blur);
             }
         }
@@ -239,5 +266,4 @@
         if(bBoost && !this->bBoostCooldown_)
         {
-            //COUT(0) << "Boost startet!\n";
             this->bBoost_ = true;
             Camera* camera = CameraManager::getInstance().getActiveCamera();
@@ -247,10 +273,9 @@
         if(!bBoost)
         {
-            //COUT(0) << "Boost stoppt\n";
+            this->bBoost_ = false;
             this->resetCamera();
-            this->bBoost_ = false;
-        }
-    }
-    
+        }
+    }
+
     void SpaceShip::boostCooledDown(void)
     {
@@ -310,38 +335,67 @@
     }
 
-    void SpaceShip::loadEngineTemplate()
-    {
-        if (!this->enginetemplate_.empty())
-        {
-            Template* temp = Template::getTemplate(this->enginetemplate_);
-
-            if (temp)
-            {
-                Identifier* identifier = temp->getBaseclassIdentifier();
-
-                if (identifier)
-                {
-                    BaseObject* object = identifier->fabricate(this);
-                    this->engine_ = orxonox_cast<Engine*>(object);
-
-                    if (this->engine_)
-                    {
-                        this->engine_->addTemplate(temp);
-                        this->engine_->addToSpaceShip(this);
-                    }
-                    else
-                    {
-                        object->destroy();
-                    }
-                }
-            }
-        }
-    }
-
-    void SpaceShip::setEngine(Engine* engine)
-    {
-        this->engine_ = engine;
-        if (engine && engine->getShip() != this)
-            engine->addToSpaceShip(this);
+    void SpaceShip::addEngine(orxonox::Engine* engine)
+    {
+        //COUT(0)<<"Adding an Engine: " << engine << endl;
+        this->engineList_.push_back(engine);
+        engine->addToSpaceShip(this);
+        this->resetEngineTicks();
+    }
+
+    bool SpaceShip::hasEngine(Engine* engine)
+    {
+        for(unsigned int i=0; i<this->engineList_.size(); i++)
+        {
+            if(this->engineList_[i]==engine)
+                return true;
+        }
+        return false;
+    }
+
+    Engine* SpaceShip::getEngine(unsigned int i)
+    {
+        if(this->engineList_.size()>=i)
+            return 0;
+        else
+            return this->engineList_[i];
+    }
+
+    void SpaceShip::removeAllEngines()
+    {
+        for(unsigned int i=0; i<this->engineList_.size(); i++)
+            this->engineList_[i]->~Engine();
+    }
+
+    void SpaceShip::setSpeedFactor(float factor)
+    {
+        for(unsigned int i=0; i<this->engineList_.size(); i++)
+            this->engineList_[i]->setSpeedFactor(factor);
+    }
+    float SpaceShip::getSpeedFactor() // Calculate mean SpeedFactor.
+    {
+        float ret = 0; unsigned int i = 0;
+        for(; i<this->engineList_.size(); i++)
+            ret += this->engineList_[i]->getSpeedFactor();
+        ret /= (float)i;
+        return ret;
+    }
+    float SpaceShip::getMaxSpeedFront()
+    {
+        float ret=0;
+        for(unsigned int i=0; i<this->engineList_.size(); i++)
+        {
+            if(this->engineList_[i]->getMaxSpeedFront() > ret)
+                ret = this->engineList_[i]->getMaxSpeedFront();
+        }
+        return ret;
+    }
+
+    float SpaceShip::getBoostFactor()
+    {
+        float ret = 0; unsigned int i=0;
+        for(; i<this->engineList_.size(); i++)
+            ret += this->engineList_[i]->getBoostFactor();
+        ret /= (float)i;
+        return ret;
     }
 
@@ -349,8 +403,17 @@
     {
         std::vector<PickupCarrier*>* list = new std::vector<PickupCarrier*>();
-        list->push_back(this->engine_);
+        for(unsigned int i=0; i<this->engineList_.size(); i++)
+            list->push_back(this->engineList_[i]);
         return list;
     }
     
+    void SpaceShip::changedEnableMotionBlur()
+    {
+        if (!this->bEnableMotionBlur_)
+        {
+            this->boostBlur_->destroy();
+            this->boostBlur_ = 0;
+        }
+    }
 
 }
Index: code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.h
===================================================================
--- code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 8588)
+++ code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.h	(revision 8589)
@@ -61,7 +61,15 @@
             virtual void boost(bool bBoost); // Starts or stops boosting.
 
-            void setEngine(Engine* engine);
-            inline Engine* getEngine() const
-                { return this->engine_; }
+            void addEngine(Engine* engine);
+            bool hasEngine(Engine* engine);
+            Engine* getEngine(unsigned int i); // This one's for XMLPort
+            inline const std::vector<Engine*>& getEngineList()
+                { return this->engineList_; }
+            void removeAllEngines();
+
+            void setSpeedFactor(float factor);
+            float getSpeedFactor(); // Gets mean speed factor
+            float getMaxSpeedFront(); // gets largest speed forward
+            float getBoostFactor(); // gets mean boost factor
 
             inline void setSteeringDirection(const Vector3& direction)
@@ -69,12 +77,13 @@
             inline const Vector3& getSteeringDirection() const
                 { return this->steering_; }
+            inline void resetEngineTicks()
+                { this->engineTicksNotDone = this->engineList_.size(); }
+            inline void oneEngineTickDone()
+                { this->engineTicksNotDone--; }
+            inline const bool hasEngineTicksRemaining()
+                { return (this->engineTicksNotDone>0); }
 
             inline bool getBoost() const
                 { return this->bBoost_; }
-
-            inline void setEngineTemplate(const std::string& temp)
-                { this->enginetemplate_ = temp; this->loadEngineTemplate(); }
-            inline const std::string& getEngineTemplate() const
-                { return this->enginetemplate_; }
 
         protected:
@@ -102,7 +111,7 @@
             void registerVariables();
             virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
-
-            void loadEngineTemplate();
             
+            //All things booster
+            void changedEnableMotionBlur();
             void boostCooledDown(void);
         
@@ -111,6 +120,10 @@
             void shakeCamera(float dt);
 
-            std::string enginetemplate_;
-            Engine* engine_;
+            Shader* boostBlur_;
+            float blurStrength_;
+            bool bEnableMotionBlur_;
+
+            std::vector<Engine*> engineList_;
+            int engineTicksNotDone; // Used for knowing when to reset temporary variables.
             Timer timer_;
             Vector3 cameraOriginalPosition_;
