[Orxonox-commit 3746] r8426 - in code/branches/bigships: data/levels/templates src/modules/overlays/hud src/orxonox/controllers src/orxonox/gametypes src/orxonox/items src/orxonox/worldentities src/orxonox/worldentities/pawns

decryphe at orxonox.net decryphe at orxonox.net
Mon May 9 14:59:07 CEST 2011


Author: decryphe
Date: 2011-05-09 14:59:07 +0200 (Mon, 09 May 2011)
New Revision: 8426

Modified:
   code/branches/bigships/data/levels/templates/spaceshipAssff.oxt
   code/branches/bigships/data/levels/templates/spaceshipGhost.oxt
   code/branches/bigships/data/levels/templates/spaceshipH2.oxt
   code/branches/bigships/data/levels/templates/spaceshipHXY.oxt
   code/branches/bigships/data/levels/templates/spaceshipHXYSL.oxt
   code/branches/bigships/data/levels/templates/spaceshipPirate.oxt
   code/branches/bigships/data/levels/templates/spaceshipSwallow.oxt
   code/branches/bigships/data/levels/templates/spaceshipTransporter.oxt
   code/branches/bigships/data/levels/templates/spaceshipTransporterSL.oxt
   code/branches/bigships/src/modules/overlays/hud/HUDSpeedBar.cc
   code/branches/bigships/src/orxonox/controllers/HumanController.cc
   code/branches/bigships/src/orxonox/controllers/HumanController.h
   code/branches/bigships/src/orxonox/gametypes/Dynamicmatch.cc
   code/branches/bigships/src/orxonox/gametypes/Dynamicmatch.h
   code/branches/bigships/src/orxonox/items/Engine.cc
   code/branches/bigships/src/orxonox/items/Engine.h
   code/branches/bigships/src/orxonox/worldentities/ControllableEntity.cc
   code/branches/bigships/src/orxonox/worldentities/ControllableEntity.h
   code/branches/bigships/src/orxonox/worldentities/MobileEntity.cc
   code/branches/bigships/src/orxonox/worldentities/MobileEntity.h
   code/branches/bigships/src/orxonox/worldentities/pawns/SpaceShip.cc
   code/branches/bigships/src/orxonox/worldentities/pawns/SpaceShip.h
Log:
- Moved handling of blur effect from Engine.cc to SpaceShip.cc.
- Implemented handling of multiple engines per SpaceShip, so that in future it would be possible to turn single engines on/off individually (for example if one gets destroyed on a big ship).
- Updated some pointers accessing the single Engine of a SpaceShip to ask the SpaceShip itself instead for data.

Modified: code/branches/bigships/data/levels/templates/spaceshipAssff.oxt
===================================================================
--- code/branches/bigships/data/levels/templates/spaceshipAssff.oxt	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/data/levels/templates/spaceshipAssff.oxt	2011-05-09 12:59:07 UTC (rev 8426)
@@ -2,7 +2,6 @@
   <SpaceShip
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipassffcameras
-   engine                 = spaceshipassffengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
    explosionchunks        = 6
@@ -20,6 +19,10 @@
    linearDamping     = 0.7
    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" />
       <BlinkingBillboard position="17,-1.5,0" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />
@@ -76,29 +79,27 @@
       <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
     </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">
 
     </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">
       <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" />
       <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 />
       <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 />
       <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>
 

Modified: code/branches/bigships/data/levels/templates/spaceshipGhost.oxt
===================================================================
--- code/branches/bigships/data/levels/templates/spaceshipGhost.oxt	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/data/levels/templates/spaceshipGhost.oxt	2011-05-09 12:59:07 UTC (rev 8426)
@@ -2,7 +2,7 @@
   <SpaceShip
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipghostcameras
-   engine                 = spaceshipghostengine
+
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
    explosionchunks        = 6
@@ -20,7 +20,9 @@
    linearDamping     = 0.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" />
     </attached>

Modified: code/branches/bigships/data/levels/templates/spaceshipH2.oxt
===================================================================
--- code/branches/bigships/data/levels/templates/spaceshipH2.oxt	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/data/levels/templates/spaceshipH2.oxt	2011-05-09 12:59:07 UTC (rev 8426)
@@ -2,7 +2,6 @@
   <SpaceShip
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipHtwocameras
-   engine                 = spaceshipHtwoengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
    explosionchunks        = 6
@@ -24,7 +23,10 @@
 <?lua
   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" />
       <BlinkingBillboard position=" 11.7,4.0,8.5" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />

Modified: code/branches/bigships/data/levels/templates/spaceshipHXY.oxt
===================================================================
--- code/branches/bigships/data/levels/templates/spaceshipHXY.oxt	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/data/levels/templates/spaceshipHXY.oxt	2011-05-09 12:59:07 UTC (rev 8426)
@@ -20,6 +20,9 @@
    linearDamping     = 0.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" />
     </attached>

Modified: code/branches/bigships/data/levels/templates/spaceshipHXYSL.oxt
===================================================================
--- code/branches/bigships/data/levels/templates/spaceshipHXYSL.oxt	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/data/levels/templates/spaceshipHXYSL.oxt	2011-05-09 12:59:07 UTC (rev 8426)
@@ -2,7 +2,6 @@
   <SpaceShip
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipHXYcameras
-   engine                 = spaceshipHXYengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
    explosionchunks        = 6
@@ -20,6 +19,9 @@
    linearDamping     = 0.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" />
     </attached>

Modified: code/branches/bigships/data/levels/templates/spaceshipPirate.oxt
===================================================================
--- code/branches/bigships/data/levels/templates/spaceshipPirate.oxt	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/data/levels/templates/spaceshipPirate.oxt	2011-05-09 12:59:07 UTC (rev 8426)
@@ -2,7 +2,6 @@
   <SpaceShip
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshippiratecameras
-   engine                 = spaceshippirateengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
    explosionchunks        = 6
@@ -20,6 +19,9 @@
    linearDamping     = 0.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" />
       <BlinkingBillboard position=" 12.7,-3.8,0" material="Examples/Flare" colour="1.0, 1.0, 1" amplitude=0.04 frequency=1 quadratic=1 />

Modified: code/branches/bigships/data/levels/templates/spaceshipSwallow.oxt
===================================================================
--- code/branches/bigships/data/levels/templates/spaceshipSwallow.oxt	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/data/levels/templates/spaceshipSwallow.oxt	2011-05-09 12:59:07 UTC (rev 8426)
@@ -2,7 +2,6 @@
   <SpaceShip
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipswallowcameras
-   engine                 = spaceshipswallowengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
    explosionchunks        = 6
@@ -20,7 +19,9 @@
    linearDamping     = 0.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" />
     </attached>

Modified: code/branches/bigships/data/levels/templates/spaceshipTransporter.oxt
===================================================================
--- code/branches/bigships/data/levels/templates/spaceshipTransporter.oxt	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/data/levels/templates/spaceshipTransporter.oxt	2011-05-09 12:59:07 UTC (rev 8426)
@@ -2,7 +2,6 @@
   <SpaceShip
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipTransportercameras
-   engine                 = spaceshipTransporterengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
    explosionchunks        = 6
@@ -20,6 +19,9 @@
    linearDamping     = 0.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" />
     </attached>

Modified: code/branches/bigships/data/levels/templates/spaceshipTransporterSL.oxt
===================================================================
--- code/branches/bigships/data/levels/templates/spaceshipTransporterSL.oxt	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/data/levels/templates/spaceshipTransporterSL.oxt	2011-05-09 12:59:07 UTC (rev 8426)
@@ -2,7 +2,6 @@
   <SpaceShip
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipTransportercameras
-   engine                 = spaceshipTransporterengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
    explosionchunks        = 6
@@ -20,6 +19,9 @@
    linearDamping     = 0.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" />
     </attached>

Modified: code/branches/bigships/src/modules/overlays/hud/HUDSpeedBar.cc
===================================================================
--- code/branches/bigships/src/modules/overlays/hud/HUDSpeedBar.cc	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/modules/overlays/hud/HUDSpeedBar.cc	2011-05-09 12:59:07 UTC (rev 8426)
@@ -53,9 +53,9 @@
     {
         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);
         }
     }

Modified: code/branches/bigships/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/branches/bigships/src/orxonox/controllers/HumanController.cc	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/controllers/HumanController.cc	2011-05-09 12:59:07 UTC (rev 8426)
@@ -41,6 +41,7 @@
 {
     extern const std::string __CC_fire_name = "fire";
     extern const std::string __CC_suicide_name = "suicide";
+    const std::string __CC_boost_name = "boost";
 
     SetConsoleCommand("HumanController", "moveFrontBack",          &HumanController::moveFrontBack ).addShortcut().setAsInputCommand();
     SetConsoleCommand("HumanController", "moveRightLeft",          &HumanController::moveRightLeft ).addShortcut().setAsInputCommand();
@@ -50,7 +51,7 @@
     SetConsoleCommand("HumanController", "rotateRoll",             &HumanController::rotateRoll    ).addShortcut().setAsInputCommand();
     SetConsoleCommand("HumanController", __CC_fire_name,           &HumanController::fire          ).addShortcut().keybindMode(KeybindMode::OnHold);
     SetConsoleCommand("HumanController", "reload",                 &HumanController::reload        ).addShortcut();
-    SetConsoleCommand("HumanController", "boost",                  &HumanController::boost         ).addShortcut().keybindMode(KeybindMode::OnHold);
+    SetConsoleCommand("HumanController", __CC_boost_name,          &HumanController::toggleBoost   ).addShortcut().keybindMode(KeybindMode::OnPress);
     SetConsoleCommand("HumanController", "greet",                  &HumanController::greet         ).addShortcut();
     SetConsoleCommand("HumanController", "switchCamera",           &HumanController::switchCamera  ).addShortcut();
     SetConsoleCommand("HumanController", "mouseLook",              &HumanController::mouseLook     ).addShortcut();
@@ -71,6 +72,7 @@
         RegisterObject(HumanController);
 
         controlPaused_ = false;
+        this->boosting_ = false;
 
         HumanController::localController_s = this;
     }
@@ -162,12 +164,34 @@
             HumanController::localController_s->controllableEntity_->reload();
     }
 
-    void HumanController::boost()
+    /**
+    @brief
+        Static method,toggles boosting.
+    */
+    /*static*/ void HumanController::toggleBoost()
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
-            HumanController::localController_s->controllableEntity_->boost();
+            HumanController::localController_s->toggleBoosting();
     }
+    
+    /**
+    @brief
+        Toggles the boosting mode.
+        Changes the keybind mode of the boost console command and tells the ControllableEntity to boost (or not boost anymore).
+    */
+    void HumanController::toggleBoosting(void)
+    {
+        this->boosting_ = !this->boosting_;
+        
+        // The keybind mode of the boosting console command is onRelease if in boosting mode and onPress of not in boosting mode.
+        if(this->boosting_)
+            ModifyConsoleCommand(__CC_boost_name).keybindMode(KeybindMode::OnRelease);
+        else
+            ModifyConsoleCommand(__CC_boost_name).keybindMode(KeybindMode::OnPress);
 
+        this->controllableEntity_->boost(this->boosting_);
+    }
+
     void HumanController::greet()
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)

Modified: code/branches/bigships/src/orxonox/controllers/HumanController.h
===================================================================
--- code/branches/bigships/src/orxonox/controllers/HumanController.h	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/controllers/HumanController.h	2011-05-09 12:59:07 UTC (rev 8426)
@@ -63,7 +63,15 @@
             virtual void doFire(unsigned int firemode);
             static void reload();
 
-            static void boost();
+            static void toggleBoost(); // Static method,toggles boosting.
+            /**
+            @brief Check whether the HumanController is in boosting mode.
+            @return Returns true if it is, false if not.
+            */
+            inline bool isBoosting(void)
+                { return this->boosting_; }
+            void toggleBoosting(void); // Toggles the boosting mode.
+            
             static void greet();
             static void switchCamera();
             static void mouseLook();
@@ -91,6 +99,10 @@
         protected:
             static HumanController* localController_s;
             bool controlPaused_;
+        
+        private:
+            bool boosting_; // Whether the HumanController is in boosting mode or not.
+
     }; // tolua_export
 } // tolua_export
 

Modified: code/branches/bigships/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/branches/bigships/src/orxonox/gametypes/Dynamicmatch.cc	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/gametypes/Dynamicmatch.cc	2011-05-09 12:59:07 UTC (rev 8426)
@@ -150,14 +150,7 @@
 
                 //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);
             }
 
             //Case: notEnoughKillers: party change
@@ -251,15 +244,7 @@
                 }
                 //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
             else if (source==killer &&target==piggy) //party and colour switch
@@ -320,6 +305,19 @@
         else return false;
     }
 
+	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
     {
         if (!player)
@@ -596,7 +594,7 @@
         return this->playerParty_[player];
     }
 
-    void Dynamicmatch::resetSpeedFactor(WeakPtr<Engine>* ptr)// helper function
+    void Dynamicmatch::resetSpeedFactor(WeakPtr<SpaceShip>* ptr)// helper function
     {
         if (*ptr)
         {

Modified: code/branches/bigships/src/orxonox/gametypes/Dynamicmatch.h
===================================================================
--- code/branches/bigships/src/orxonox/gametypes/Dynamicmatch.h	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/gametypes/Dynamicmatch.h	2011-05-09 12:59:07 UTC (rev 8426)
@@ -72,7 +72,8 @@
             /*virtual void instructions();
             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;
 

Modified: code/branches/bigships/src/orxonox/items/Engine.cc
===================================================================
--- code/branches/bigships/src/orxonox/items/Engine.cc	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/items/Engine.cc	2011-05-09 12:59:07 UTC (rev 8426)
@@ -34,7 +34,7 @@
 #include "core/XMLPort.h"
 #include "Scene.h"
 #include "worldentities/pawns/SpaceShip.h"
-#include "tools/Shader.h"
+#include "core/Template.h"
 
 namespace orxonox
 {
@@ -46,6 +46,7 @@
 
         this->ship_ = 0;
         this->shipID_ = OBJECTID_UNKNOWN;
+		this->relativePosition_ = Vector3(0,0,0);
 
         this->boostFactor_ = 1.5;
         this->speedFactor_ = 1.0;
@@ -61,8 +62,6 @@
         this->accelerationLeftRight_ = 0.0;
         this->accelerationUpDown_ = 0.0;
 
-        this->boostBlur_ = 0;
-
         this->speedAdd_ = 0.0;
         this->speedMultiply_ = 1.0;
 
@@ -74,10 +73,10 @@
     {
         if (this->isInitialized() && this->ship_)
         {
-            this->ship_->setEngine(0);
+            //this->ship_->setEngine(0);
 
-            if (this->boostBlur_)
-                this->boostBlur_->destroy();
+            //if (this->boostBlur_)
+            //    this->boostBlur_->destroy();
         }
     }
 
@@ -97,15 +96,13 @@
         XMLPortParam(Engine, "accelerationback",      setAccelerationBack,      setAccelerationBack,      xmlelement, mode);
         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");
     }
 
     void Engine::registerVariables()
@@ -201,33 +198,22 @@
                 acceleration.y = direction.y * this->accelerationUpDown_ * clamp((this->maxSpeedUpDown_ - velocity.y) / this->maxSpeedUpDown_, 0.0f, 1.0f);
         }
 
-        this->ship_->setAcceleration(this->ship_->getOrientation() * (acceleration*this->getSpeedMultiply()+Vector3(0,0,-this->getSpeedAdd())));
+		// 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_);
 
-        if (!this->ship_->getPermanentBoost())
-            this->ship_->setBoost(false);
-        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);
-        }
+		// Hack to reset a temporary variable "direction"
+		this->ship_->oneEngineTickDone();
+		if(!this->ship_->hasEngineTicksRemaining())
+		{
+			this->ship_->setSteeringDirection(Vector3::ZERO);
+			this->ship_->resetEngineTicks();
+		}
     }
 
     void Engine::changedActivity()
     {
         SUPER(Engine, changedActivity);
-
-        if (this->boostBlur_)
-            this->boostBlur_->setVisible(this->isVisible());
     }
 
     void Engine::addToSpaceShip(SpaceShip* ship)
@@ -237,14 +223,8 @@
         if (ship)
         {
             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);
         }
     }
 
@@ -266,12 +246,16 @@
         return this->ship_->getWorldPosition();
     }
 
-    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);
+			}
+		}
+	}
 }

Modified: code/branches/bigships/src/orxonox/items/Engine.h
===================================================================
--- code/branches/bigships/src/orxonox/items/Engine.h	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/items/Engine.h	2011-05-09 12:59:07 UTC (rev 8426)
@@ -54,6 +54,11 @@
             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)
                 { this->boostFactor_ = factor; }
             inline float getBoostFactor() const
@@ -118,18 +123,28 @@
             inline void setSpeedMultiply(float speedMultiply)
                 { 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_;
             float speedFactor_;
@@ -147,10 +162,6 @@
             float accelerationBack_;
             float accelerationLeftRight_;
             float accelerationUpDown_;
-
-            Shader* boostBlur_;
-            float blurStrength_;
-            bool bEnableMotionBlur_;
     };
 }
 

Modified: code/branches/bigships/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/bigships/src/orxonox/worldentities/ControllableEntity.cc	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/worldentities/ControllableEntity.cc	2011-05-09 12:59:07 UTC (rev 8426)
@@ -83,7 +83,6 @@
         this->server_angular_velocity_ = Vector3::ZERO;
         this->client_angular_velocity_ = Vector3::ZERO;
 
-
         this->setConfigValues();
         this->setPriority( Priority::VeryHigh );
         this->registerVariables();

Modified: code/branches/bigships/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/branches/bigships/src/orxonox/worldentities/ControllableEntity.h	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/worldentities/ControllableEntity.h	2011-05-09 12:59:07 UTC (rev 8426)
@@ -92,7 +92,13 @@
             virtual void fired(unsigned int firemode) {}
             virtual void reload() {}
 
-            virtual void boost() {}
+            /**
+            @brief Tells the ControllableEntity to either start or stop boosting.
+                   This doesn't mean, that the ControllableEntity will do so, there might be additional restrictions on boosting, but if it can, then it will.
+            @param bBoost If true the ControllableEntity is told to start boosting, if false it is told to stop.
+            */
+            virtual void boost(bool bBoost) {}
+            
             virtual void greet() {}
             virtual void switchCamera();
             virtual void mouseLook();

Modified: code/branches/bigships/src/orxonox/worldentities/MobileEntity.cc
===================================================================
--- code/branches/bigships/src/orxonox/worldentities/MobileEntity.cc	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/worldentities/MobileEntity.cc	2011-05-09 12:59:07 UTC (rev 8426)
@@ -142,11 +142,22 @@
     void MobileEntity::setAcceleration(const Vector3& acceleration)
     {
         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));
+		}
+	}
+
     void MobileEntity::setAngularAcceleration(const Vector3& acceleration)
     {
         if (this->isDynamic())

Modified: code/branches/bigships/src/orxonox/worldentities/MobileEntity.h
===================================================================
--- code/branches/bigships/src/orxonox/worldentities/MobileEntity.h	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/worldentities/MobileEntity.h	2011-05-09 12:59:07 UTC (rev 8426)
@@ -69,6 +69,12 @@
             inline const Vector3& getAcceleration() const
                 { 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)
                 { this->setAngularAcceleration(Vector3(x, y, z)); }

Modified: code/branches/bigships/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/branches/bigships/src/orxonox/worldentities/pawns/SpaceShip.cc	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/worldentities/pawns/SpaceShip.cc	2011-05-09 12:59:07 UTC (rev 8426)
@@ -36,6 +36,10 @@
 #include "core/XMLPort.h"
 #include "items/Engine.h"
 
+// New as of Booster integration
+#include "Scene.h"
+#include "tools/Shader.h"
+
 namespace orxonox
 {
     const float orientationGain = 100;
@@ -52,9 +56,10 @@
         this->localLinearAcceleration_.setValue(0, 0, 0);
         this->localAngularAcceleration_.setValue(0, 0, 0);
         this->bBoost_ = false;
-        this->bPermanentBoost_ = false;
         this->steering_ = Vector3::ZERO;
-        this->engine_ = 0;
+        //this->engine_ = 0;
+		
+        this->boostBlur_ = 0;
 
         this->boostPower_ = 10.0f;
         this->initialBoostPower_ = 10.0f;
@@ -73,21 +78,25 @@
         // Get notification about collisions
         this->enableCollisionCallback();
 
+		this->engineTicksNotDone = 0;
         this->setConfigValues();
         this->registerVariables();
     }
 
     SpaceShip::~SpaceShip()
     {
-        if (this->isInitialized() && this->engine_)
-            this->engine_->destroy();
+        if (this->isInitialized())
+            this->removeAllEngines();
+		
+        if (this->boostBlur_)
+            this->boostBlur_->destroy();
     }
 
     void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         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);
         XMLPortParamVariable(SpaceShip, "rotationThrust", rotationThrust_, xmlelement, mode);
@@ -95,6 +104,8 @@
         XMLPortParamVariable(SpaceShip, "boostPowerRate", boostPowerRate_, xmlelement, mode);
         XMLPortParamVariable(SpaceShip, "boostRate", boostRate_, xmlelement, mode);
         XMLPortParamVariable(SpaceShip, "boostCooldownDuration", boostCooldownDuration_, xmlelement, mode);
+
+		XMLPortObject(SpaceShip, Engine, "engines", addEngine, getEngine, xmlelement, mode);
     }
 
     void SpaceShip::registerVariables()
@@ -102,11 +113,21 @@
         registerVariable(this->primaryThrust_,  VariableDirection::ToClient);
         registerVariable(this->auxilaryThrust_, VariableDirection::ToClient);
         registerVariable(this->rotationThrust_, VariableDirection::ToClient);
+        registerVariable(this->boostPower_, VariableDirection::ToClient);
+        registerVariable(this->boostPowerRate_, VariableDirection::ToClient);
+        registerVariable(this->boostRate_, VariableDirection::ToClient);
+        registerVariable(this->boostCooldownDuration_, VariableDirection::ToClient);
     }
 
     void SpaceShip::setConfigValues()
     {
         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");
     }
 
     bool SpaceShip::isCollisionTypeLegal(WorldEntity::CollisionType type) const
@@ -127,28 +148,20 @@
 
         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())
             {
                 this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
                 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_)
             {
                 this->boostPower_ -=this->boostRate_*dt;
@@ -159,6 +172,27 @@
                     this->timer_.setTimer(this->boostCooldownDuration_, false, createExecutor(createFunctor(&SpaceShip::boostCooledDown, this)));
                 }
             }
+
+			// 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);
+			}
         }
     }
 
@@ -206,70 +240,100 @@
         Pawn::rotateRoll(value);
     }
 
-    // TODO: something seems to call this function every tick, could probably handled a little more efficiently!
-    void SpaceShip::setBoost(bool bBoost)
-    {
-        if(bBoost == this->bBoost_)
-            return;
-
-        if(bBoost)
-            this->boost();
-        else
-        {
-            this->bBoost_ = false;
-        }
-    }
-
     void SpaceShip::fire()
     {
     }
 
-    void SpaceShip::boost()
+    /**
+    @brief
+        Starts or stops boosting.
+    @param bBoost
+        Whether to start or stop boosting.
+    */
+    void SpaceShip::boost(bool bBoost)
     {
-        if(!this->bBoostCooldown_)
+        if(bBoost && !this->bBoostCooldown_)
             this->bBoost_ = true;
+        if(!bBoost)
+            this->bBoost_ = false;
     }
 
-    void SpaceShip::loadEngineTemplate()
-    {
-        if (!this->enginetemplate_.empty())
-        {
-            Template* temp = Template::getTemplate(this->enginetemplate_);
+	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();
+	}
 
-            if (temp)
-            {
-                Identifier* identifier = temp->getBaseclassIdentifier();
+	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;
+	}
 
-                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);
-    }
-
     std::vector<PickupCarrier*>* SpaceShip::getCarrierChildren(void) const
     {
         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;
+        }
+    }
+
 }

Modified: code/branches/bigships/src/orxonox/worldentities/pawns/SpaceShip.h
===================================================================
--- code/branches/bigships/src/orxonox/worldentities/pawns/SpaceShip.h	2011-05-09 12:21:33 UTC (rev 8425)
+++ code/branches/bigships/src/orxonox/worldentities/pawns/SpaceShip.h	2011-05-09 12:59:07 UTC (rev 8426)
@@ -58,38 +58,40 @@
             virtual void rotateRoll(const Vector2& value);
 
             virtual void fire();
-            virtual void boost();
+            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)
                 { this->steering_ = direction; }
             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); }
 
-            void setBoost(bool bBoost);
             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_; }
-
-            inline void setPermanentBoost(bool bPermanent)
-                { this->bPermanentBoost_ = bPermanent; }
-            inline bool getPermanentBoost() const
-                { return this->bPermanentBoost_; }
-
         protected:
             virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const;
             bool bInvertYAxis_;
 
             bool bBoost_;
             bool bBoostCooldown_;
-            bool bPermanentBoost_;
             float boostPower_;
             float initialBoostPower_;
             float boostRate_;
@@ -105,13 +107,17 @@
         private:
             void registerVariables();
             virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
-
-            void loadEngineTemplate();
             
+			//All things booster
+			void changedEnableMotionBlur();
             void boostCooledDown(void);
 
-            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_;
     };
 }




More information about the Orxonox-commit mailing list