[Orxonox-commit 3915] r8589 - in code/branches/presentation: . data/levels/templates src/modules/overlays/hud src/orxonox/controllers src/orxonox/gametypes src/orxonox/items src/orxonox/worldentities src/orxonox/worldentities/pawns

dafrick at orxonox.net dafrick at orxonox.net
Thu May 26 00:58:09 CEST 2011


Author: dafrick
Date: 2011-05-26 00:58:09 +0200 (Thu, 26 May 2011)
New Revision: 8589

Modified:
   code/branches/presentation/
   code/branches/presentation/data/levels/templates/spaceshipAssff.oxt
   code/branches/presentation/data/levels/templates/spaceshipGhost.oxt
   code/branches/presentation/data/levels/templates/spaceshipH2.oxt
   code/branches/presentation/data/levels/templates/spaceshipHXY.oxt
   code/branches/presentation/data/levels/templates/spaceshipHXYSL.oxt
   code/branches/presentation/data/levels/templates/spaceshipPirate.oxt
   code/branches/presentation/data/levels/templates/spaceshipSwallow.oxt
   code/branches/presentation/data/levels/templates/spaceshipTransporter.oxt
   code/branches/presentation/data/levels/templates/spaceshipTransporterSL.oxt
   code/branches/presentation/src/modules/overlays/hud/HUDSpeedBar.cc
   code/branches/presentation/src/orxonox/controllers/HumanController.cc
   code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.cc
   code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.h
   code/branches/presentation/src/orxonox/items/Engine.cc
   code/branches/presentation/src/orxonox/items/Engine.h
   code/branches/presentation/src/orxonox/worldentities/MobileEntity.cc
   code/branches/presentation/src/orxonox/worldentities/MobileEntity.h
   code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
   code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.h
Log:
Merging bigships branch into presentation branch.



Property changes on: code/branches/presentation
___________________________________________________________________
Modified: svn:mergeinfo
   - /code/branches/ai:6592-7033
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/fps:6591-7072
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hudelements:6584-6941
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/steering:5949-6091,8140-8377
/code/branches/tetris:8100-8563
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051
/code/branches/weaponsystem:2742-2890
   + /code/branches/ai:6592-7033
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/fps:6591-7072
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hudelements:6584-6941
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/steering:5949-6091,8140-8377
/code/branches/tetris:8100-8563
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051
/code/branches/weaponsystem:2742-2890

Modified: code/branches/presentation/data/levels/templates/spaceshipAssff.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipAssff.oxt	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipAssff.oxt	2011-05-25 22:58:09 UTC (rev 8589)
@@ -2,7 +2,6 @@
   <SpaceShip
    hudtemplate            = spaceshiphud
    camerapositiontemplate = spaceshipassffcameras
-   engine                 = spaceshipassffengine
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
    explosionchunks        = 6
@@ -35,6 +34,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 />
@@ -91,29 +94,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/presentation/data/levels/templates/spaceshipGhost.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipGhost.oxt	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipGhost.oxt	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/data/levels/templates/spaceshipH2.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipH2.oxt	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipH2.oxt	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/data/levels/templates/spaceshipHXY.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipHXY.oxt	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipHXY.oxt	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/data/levels/templates/spaceshipHXYSL.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipHXYSL.oxt	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipHXYSL.oxt	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/data/levels/templates/spaceshipPirate.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipPirate.oxt	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipPirate.oxt	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/data/levels/templates/spaceshipSwallow.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipSwallow.oxt	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipSwallow.oxt	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/data/levels/templates/spaceshipTransporter.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipTransporter.oxt	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipTransporter.oxt	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/data/levels/templates/spaceshipTransporterSL.oxt
===================================================================
--- code/branches/presentation/data/levels/templates/spaceshipTransporterSL.oxt	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/data/levels/templates/spaceshipTransporterSL.oxt	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/src/modules/overlays/hud/HUDSpeedBar.cc
===================================================================
--- code/branches/presentation/src/modules/overlays/hud/HUDSpeedBar.cc	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/src/modules/overlays/hud/HUDSpeedBar.cc	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/branches/presentation/src/orxonox/controllers/HumanController.cc	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/src/orxonox/controllers/HumanController.cc	2011-05-25 22:58:09 UTC (rev 8589)
@@ -74,6 +74,7 @@
 
         this->controlPaused_ = false;
         this->boosting_ = false;
+        this->boosting_ = false;
 
         HumanController::localController_s = this;
         this->boostingTimeout_.setTimer(HumanController::BOOSTING_TIME, false, createExecutor(createFunctor(&HumanController::terminateBoosting, this)));

Modified: code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.cc
===================================================================
--- code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.cc	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.cc	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/src/orxonox/gametypes/Dynamicmatch.h
===================================================================
--- code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.h	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/src/orxonox/gametypes/Dynamicmatch.h	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/src/orxonox/items/Engine.cc
===================================================================
--- code/branches/presentation/src/orxonox/items/Engine.cc	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/src/orxonox/items/Engine.cc	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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;
 
@@ -72,13 +71,7 @@
 
     Engine::~Engine()
     {
-        if (this->isInitialized() && this->ship_)
-        {
-            this->ship_->setEngine(0);
 
-            if (this->boostBlur_)
-                this->boostBlur_->destroy();
-        }
     }
 
     void Engine::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -97,15 +90,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,31 +192,21 @@
                 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_);
 
-        this->ship_->setSteeringDirection(Vector3::ZERO);
-
-        if (this->bEnableMotionBlur_ && !this->boostBlur_ && this->ship_->hasLocalController() && this->ship_->hasHumanController())
+        // Hack to reset a temporary variable "direction"
+        this->ship_->oneEngineTickDone();
+        if(!this->ship_->hasEngineTicksRemaining())
         {
-            this->boostBlur_ = new Shader(this->ship_->getScene()->getSceneManager());
-            this->boostBlur_->setCompositorName("Radial Blur");
+            this->ship_->setSteeringDirection(Vector3::ZERO);
+            this->ship_->resetEngineTicks();
         }
-
-        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);
-        }
     }
 
     void Engine::changedActivity()
     {
         SUPER(Engine, changedActivity);
-
-        if (this->boostBlur_)
-            this->boostBlur_->setVisible(this->isVisible());
     }
 
     void Engine::addToSpaceShip(SpaceShip* ship)
@@ -235,14 +216,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);
         }
     }
 
@@ -264,12 +239,16 @@
         return this->ship_->getWorldPosition();
     }
 
-    void Engine::changedEnableMotionBlur()
+    void Engine::loadEngineTemplate()
     {
-        if (!this->bEnableMotionBlur_)
+        if(!this->engineTemplate_.empty())
         {
-            this->boostBlur_->destroy();
-            this->boostBlur_ = 0;
+            COUT(4)<<"Loading an engine template: "<<this->engineTemplate_<<"\n";
+            Template *temp = Template::getTemplate(this->engineTemplate_);
+            if(temp)
+            {
+                this->addTemplate(temp);
+            }
         }
     }
 }

Modified: code/branches/presentation/src/orxonox/items/Engine.h
===================================================================
--- code/branches/presentation/src/orxonox/items/Engine.h	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/src/orxonox/items/Engine.h	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/src/orxonox/worldentities/MobileEntity.cc
===================================================================
--- code/branches/presentation/src/orxonox/worldentities/MobileEntity.cc	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/src/orxonox/worldentities/MobileEntity.cc	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/src/orxonox/worldentities/MobileEntity.h
===================================================================
--- code/branches/presentation/src/orxonox/worldentities/MobileEntity.h	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/src/orxonox/worldentities/MobileEntity.h	2011-05-25 22:58:09 UTC (rev 8589)
@@ -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/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.cc	2011-05-25 22:58:09 UTC (rev 8589)
@@ -34,17 +34,21 @@
 #include "core/ConfigValueIncludes.h"
 #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
 {
     const float orientationGain = 100;
     CreateFactory(SpaceShip);
 
-    SpaceShip::SpaceShip(BaseObject* creator) : Pawn(creator)
+    SpaceShip::SpaceShip(BaseObject* creator) : Pawn(creator), boostBlur_(NULL)
     {
         RegisterObject(SpaceShip);
 
@@ -56,7 +60,6 @@
         this->localAngularAcceleration_.setValue(0, 0, 0);
         this->bBoost_ = false;
         this->steering_ = Vector3::ZERO;
-        this->engine_ = 0;
 
         this->boostPower_ = 10.0f;
         this->initialBoostPower_ = 10.0f;
@@ -75,6 +78,7 @@
         // Get notification about collisions
         this->enableCollisionCallback();
 
+        this->engineTicksNotDone = 0;
         this->setConfigValues();
         this->registerVariables();
         
@@ -88,15 +92,20 @@
 
     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);
@@ -104,8 +113,10 @@
         XMLPortParamVariable(SpaceShip, "boostPowerRate", boostPowerRate_, xmlelement, mode);
         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);
     }
 
     void SpaceShip::registerVariables()
@@ -125,6 +136,12 @@
     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
@@ -145,30 +162,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;
@@ -177,11 +184,31 @@
                     this->boost(false);
                     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);
+            }
         }
     }
 
@@ -238,7 +265,6 @@
     {
         if(bBoost && !this->bBoostCooldown_)
         {
-            //COUT(0) << "Boost startet!\n";
             this->bBoost_ = true;
             Camera* camera = CameraManager::getInstance().getActiveCamera();
             this->cameraOriginalPosition_ = camera->getPosition();
@@ -246,12 +272,11 @@
         }
         if(!bBoost)
         {
-            //COUT(0) << "Boost stoppt\n";
+            this->bBoost_ = false;
             this->resetCamera();
-            this->bBoost_ = false;
         }
     }
-    
+
     void SpaceShip::boostCooledDown(void)
     {
         this->bBoostCooldown_ = false;
@@ -309,48 +334,86 @@
         }
     }
 
-    void SpaceShip::loadEngineTemplate()
+    void SpaceShip::addEngine(orxonox::Engine* engine)
     {
-        if (!this->enginetemplate_.empty())
+        //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++)
         {
-            Template* temp = Template::getTemplate(this->enginetemplate_);
+            if(this->engineList_[i]==engine)
+                return true;
+        }
+        return false;
+    }
 
-            if (temp)
-            {
-                Identifier* identifier = temp->getBaseclassIdentifier();
+    Engine* SpaceShip::getEngine(unsigned int i)
+    {
+        if(this->engineList_.size()>=i)
+            return 0;
+        else
+            return this->engineList_[i];
+    }
 
-                if (identifier)
-                {
-                    BaseObject* object = identifier->fabricate(this);
-                    this->engine_ = orxonox_cast<Engine*>(object);
+    void SpaceShip::removeAllEngines()
+    {
+        for(unsigned int i=0; i<this->engineList_.size(); i++)
+            this->engineList_[i]->~Engine();
+    }
 
-                    if (this->engine_)
-                    {
-                        this->engine_->addTemplate(temp);
-                        this->engine_->addToSpaceShip(this);
-                    }
-                    else
-                    {
-                        object->destroy();
-                    }
-                }
-            }
+    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;
     }
 
-    void SpaceShip::setEngine(Engine* engine)
+    float SpaceShip::getBoostFactor()
     {
-        this->engine_ = engine;
-        if (engine && engine->getShip() != this)
-            engine->addToSpaceShip(this);
+        float ret = 0; unsigned int i=0;
+        for(; i<this->engineList_.size(); i++)
+            ret += this->engineList_[i]->getBoostFactor();
+        ret /= (float)i;
+        return ret;
     }
 
     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/presentation/src/orxonox/worldentities/pawns/SpaceShip.h
===================================================================
--- code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.h	2011-05-25 22:04:42 UTC (rev 8588)
+++ code/branches/presentation/src/orxonox/worldentities/pawns/SpaceShip.h	2011-05-25 22:58:09 UTC (rev 8589)
@@ -60,23 +60,32 @@
             virtual void fire();
             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); }
 
             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:
             virtual std::vector<PickupCarrier*>* getCarrierChildren(void) const;
             bool bInvertYAxis_;
@@ -101,17 +110,21 @@
         private:
             void registerVariables();
             virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
-
-            void loadEngineTemplate();
             
+            //All things booster
+            void changedEnableMotionBlur();
             void boostCooledDown(void);
         
             void resetCamera();
             void backupCamera();
             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_;
             Quaternion cameraOriginalOrientation_;




More information about the Orxonox-commit mailing list