[Orxonox-commit 5410] r10073 - in code/branches/presentationFS14: . data/levels data/levels/templates src/external/bullet/BulletCollision/CollisionDispatch src/modules/weapons/projectiles src/orxonox src/orxonox/collisionshapes src/orxonox/controllers src/orxonox/items src/orxonox/worldentities src/orxonox/worldentities/pawns
smerkli at orxonox.net
smerkli at orxonox.net
Thu May 22 14:49:17 CEST 2014
Author: smerkli
Date: 2014-05-22 14:49:16 +0200 (Thu, 22 May 2014)
New Revision: 10073
Added:
code/branches/presentationFS14/data/levels/ModularShipsTest0.oxw
code/branches/presentationFS14/data/levels/ModularShipsTest1.oxw
code/branches/presentationFS14/data/levels/templates/ModularSpaceShipTest.oxt
code/branches/presentationFS14/src/orxonox/ShipPartManager.cc
code/branches/presentationFS14/src/orxonox/ShipPartManager.h
code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.cc
code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.h
code/branches/presentationFS14/src/orxonox/items/ShipPart.cc
code/branches/presentationFS14/src/orxonox/items/ShipPart.h
code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.h
Modified:
code/branches/presentationFS14/
code/branches/presentationFS14/data/levels/templates/HeavyCruiser.oxt
code/branches/presentationFS14/src/external/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
code/branches/presentationFS14/src/modules/weapons/projectiles/BasicProjectile.cc
code/branches/presentationFS14/src/modules/weapons/projectiles/BasicProjectile.h
code/branches/presentationFS14/src/modules/weapons/projectiles/Projectile.cc
code/branches/presentationFS14/src/modules/weapons/projectiles/Projectile.h
code/branches/presentationFS14/src/modules/weapons/projectiles/Rocket.cc
code/branches/presentationFS14/src/modules/weapons/projectiles/Rocket.h
code/branches/presentationFS14/src/modules/weapons/projectiles/SimpleRocket.cc
code/branches/presentationFS14/src/modules/weapons/projectiles/SimpleRocket.h
code/branches/presentationFS14/src/orxonox/CMakeLists.txt
code/branches/presentationFS14/src/orxonox/OrxonoxPrereqs.h
code/branches/presentationFS14/src/orxonox/Scene.cc
code/branches/presentationFS14/src/orxonox/Scene.h
code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.h
code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.cc
code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.h
code/branches/presentationFS14/src/orxonox/controllers/NewHumanController.cc
code/branches/presentationFS14/src/orxonox/items/CMakeLists.txt
code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.cc
code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.h
code/branches/presentationFS14/src/orxonox/worldentities/StaticEntity.cc
code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.cc
code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.h
code/branches/presentationFS14/src/orxonox/worldentities/pawns/CMakeLists.txt
code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.cc
code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.h
code/branches/presentationFS14/src/orxonox/worldentities/pawns/SpaceShip.h
Log:
Merged modularships branch
Property changes on: code/branches/presentationFS14
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/Racingbot:9388-9513
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/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/core6:9552-9666
/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/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/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/hud:8883-8986
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/levelElias:9697-9921
/code/branches/levelKaan:9695-9921
/code/branches/levelMichael:9696-9921
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/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/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/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/newlevel2012:9033-9244
/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/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/pCuts:9023-9284
/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/pickup2012:9029-9189
/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/portals2:8460-8602
/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,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/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/sfxThilo:9691-9917
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/surfaceRace:9028-9199
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/turret:9380-9501
/code/branches/turretFS14:9998-10070
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
+ /code/branches/Racingbot:9388-9513
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/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/core6:9552-9666
/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/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/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/hud:8883-8986
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/levelElias:9697-9921
/code/branches/levelKaan:9695-9921
/code/branches/levelMichael:9696-9921
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/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/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/miniprojects:2754-2824
/code/branches/modularships:9994-10071
/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/newlevel2012:9033-9244
/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/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/pCuts:9023-9284
/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/pickup2012:9029-9189
/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/portals2:8460-8602
/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,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/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/sfxThilo:9691-9917
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/surfaceRace:9028-9199
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/turret:9380-9501
/code/branches/turretFS14:9998-10070
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
Copied: code/branches/presentationFS14/data/levels/ModularShipsTest0.oxw (from rev 10071, code/branches/modularships/data/levels/ModularShipsTest0.oxw)
===================================================================
--- code/branches/presentationFS14/data/levels/ModularShipsTest0.oxw (rev 0)
+++ code/branches/presentationFS14/data/levels/ModularShipsTest0.oxw 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,76 @@
+<LevelInfo
+ name = "Modular Ships - Test 0"
+ description = "A level to test the basic functions of modular spaceships using simple boxes."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff2.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipEscort.oxt")
+ include("templates/HeavyCruiser.oxt")
+ include("templates/ModularSpaceShipTest.oxt")
+?>
+
+<Level>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox"
+ >
+
+ <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+ <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+ <ModularSpaceShip position="0,0,0" health="2000" maxhealth="4000" initialhealth="2000">
+ <templates>
+ <Template link=ModularSpaceShipTest />
+ </templates>
+ </ModularSpaceShip>
+
+ <StaticEntity position="0,0,60" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" />
+ </attached>
+ <collisionShapes>
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity position="0,60,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" />
+ </attached>
+ <collisionShapes>
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity position="0,0,-60" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" />
+ </attached>
+ <collisionShapes>
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity position="0,-60,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" />
+ </attached>
+ <collisionShapes>
+ </collisionShapes>
+ </StaticEntity>
+
+ </Scene>
+</Level>
+
Copied: code/branches/presentationFS14/data/levels/ModularShipsTest1.oxw (from rev 10071, code/branches/modularships/data/levels/ModularShipsTest1.oxw)
===================================================================
--- code/branches/presentationFS14/data/levels/ModularShipsTest1.oxw (rev 0)
+++ code/branches/presentationFS14/data/levels/ModularShipsTest1.oxw 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,109 @@
+<LevelInfo
+ name = "Modular Ships - Test 1"
+ description = "A level to test the implementation of HeavyCruiser as modular spaceship."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff2.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipEscort.oxt")
+ include("templates/HeavyCruiser.oxt")
+?>
+
+<Level>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox"
+ >
+
+ <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+ <!-- <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort /> -->
+ <SpawnPoint team=0 position="-500,0,0" lookat="0,0,0" spawnclass=ModularSpaceShip pawndesign=HeavyCruiser />
+
+ <MovableEntity position="0,0,0" collisionType=dynamic scale=1 linearDamping=0.8 angularDamping=0 collisiondamage=0.005 enablecollisiondamage=true>
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="40,40,40" />
+ <StaticEntity position="0,90,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="30,30,30" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </StaticEntity>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="40,40,40" />
+ </collisionShapes>
+ </MovableEntity>
+
+ <Pawn health=1000 initialhealth=1000 maxhealth=1000 position="0,-100,-100" direction="0,0,0" collisionType=dynamic mass=1000 name=box radarname = "Pawn 0" >
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="6,6,6" />
+ <Model position="0,-60,0" mesh="cube.mesh" scale3D="30,30,30" />
+ <StaticEntity position="0,-120,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="6,6,6" />
+ <Model position="0,0,60" mesh="cube.mesh" scale3D="30,30,30" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ <BoxCollisionShape position="0,0,60" halfExtents="30,30,30" />
+ </collisionShapes>
+ </StaticEntity>
+ <StaticEntity position="0,-180,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="6,6,6" />
+ <Model position="0,-60,0" mesh="cube.mesh" scale3D="30,30,30" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ <BoxCollisionShape position="0,-60,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </StaticEntity>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ <BoxCollisionShape position="0,-60,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </Pawn>
+
+ <Pawn health=1000 initialhealth=1000 maxhealth=1000 position="0,-100,100" direction="0,0,0" collisionType=dynamic mass=1000 name=box radarname = "Pawn 1" >
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="6,6,6" />
+ <Model position="0,-60,0" mesh="cube.mesh" scale3D="30,30,30" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ <BoxCollisionShape position="0,-60,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </Pawn>
+
+ <ModularSpaceShip position="0,-100,-200">
+ <templates>
+ <Template link=spaceshippirate />
+ </templates>
+ </ModularSpaceShip>
+
+ <ModularSpaceShip position="0,-1000,-200" health="2000" maxhealth="4000" initialhealth="2000">
+ <templates>
+ <Template link=HeavyCruiser />
+ </templates>
+ </ModularSpaceShip>
+
+ </Scene>
+</Level>
+
Modified: code/branches/presentationFS14/data/levels/templates/HeavyCruiser.oxt
===================================================================
--- code/branches/presentationFS14/data/levels/templates/HeavyCruiser.oxt 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/data/levels/templates/HeavyCruiser.oxt 2014-05-22 12:49:16 UTC (rev 10073)
@@ -1,16 +1,18 @@
<!-- This template includes HeavyCruiser with all its parts (not individually destructible) -->
<Template name=HeavyCruiser>
- <SpaceShip
+ <ModularSpaceShip
+ name = HeavyCruiser
+
hudtemplate = spaceshiphud
camerapositiontemplate = heavycruisercameras
spawnparticlesource = "Orxonox/fairytwirl"
spawnparticleduration = 3
explosionchunks = 6
- health = 100
- maxhealth = 200
- initialhealth = 100
+ health = 2000
+ maxhealth = 4000
+ initialhealth = 2000
shieldhealth = 100
initialshieldhealth = 30
@@ -40,31 +42,192 @@
angularDamping = 0.5
>
<engines>
- <MultiStateEngine position="85,0,0" template=HeavyCruiser_body_engine1 />
- <MultiStateEngine position="-85,0,0" template=HeavyCruiser_body_engine1 />
+ <MultiStateEngine position="0,0,0" template=HeavyCruiser_body_engine1 />
<MultiStateEngine position="-140,0,308" template=HeavyCruiser_sidearmL_engine1 />
<MultiStateEngine position="140,0,308" template=HeavyCruiser_sidearmR_engine1 />
</engines>
+
+ <parts>
+ <ShipPart name="frontL" initialhealth="10" maxhealth="10" damageabsorption="0.5" explosionposition="-76,30,-330">
+ <destructionevents>
+ <PartDestructionEvent targetType="ship" targetParam="shieldhealth" operation="*" value="0.5"/>
+ </destructionevents>
+ </ShipPart>
+ <ShipPart name="frontR" initialhealth="10" maxhealth="10" damageabsorption="0.5" explosionposition="76,30,-330">
+ <destructionevents>
+ <PartDestructionEvent targetType="ship" targetParam="shieldhealth" operation="*" value="0.5"/>
+ </destructionevents>
+ </ShipPart>
+ <ShipPart name="partL" initialhealth="10" maxhealth="10" damageabsorption="0.5" explosionposition="-100,33,-200">
+ <destructionevents>
+ <PartDestructionEvent targetType="ship" targetParam="boostpowerrate" operation="-" value="0.5" message="One of your ship's generators was destroyed!"/>
+ <PartDestructionEvent targetType="engine" targetName="bodyengine" targetParam="speedfront" operation="-" value="50"/>
+ <PartDestructionEvent targetType="engine" targetName="bodyengine" targetParam="accelerationfront" operation="-" value="3"/>
+ <PartDestructionEvent targetType="engine" targetName="bodyengine" targetParam="boostfactor" operation="set" value="1"/>
+ </destructionevents>
+ </ShipPart>
+ <ShipPart name="partR" initialhealth="10" maxhealth="10" damageabsorption="0.5" explosionposition="100,33,-200">
+ <destructionevents>
+ <PartDestructionEvent targetType="ship" targetParam="boostpowerrate" operation="-" value="0.5" message="One of your ship's generators was destroyed!"/>
+ <PartDestructionEvent targetType="engine" targetName="bodyengine" targetParam="speedfront" operation="-" value="50"/>
+ <PartDestructionEvent targetType="engine" targetName="bodyengine" targetParam="accelerationfront" operation="-" value="3"/>
+ <PartDestructionEvent targetType="engine" targetName="bodyengine" targetParam="boostfactor" operation="set" value="1"/>
+ </destructionevents>
+ </ShipPart>
+ <ShipPart name="sidearmL" initialhealth="20" maxhealth="20" damageabsorption="0.2" explosionposition="-140,30,100">
+ <destructionevents>
+ <PartDestructionEvent targetType="engine" targetName="sidearmLengine" operation="destroy" message="The left auxiliary engine was destroyed!"/>
+ <PartDestructionEvent targetType="part" targetName="sidearmLfront" operation="destroy"/>
+ <PartDestructionEvent targetType="ship" targetParam="rotationthrust" operation="-" value="0.04" />
+ </destructionevents>
+ </ShipPart>
+ <ShipPart name="sidearmLfront" initialhealth="10" maxhealth="10" damageabsorption="0.5" explosionposition="-140,20,-50">
+ <destructionevents>
+ <PartDestructionEvent targetType="engine" targetName="sidearmLengine" targetParam="boostfactor" operation="set" value="1" message="The left auxiliary engine lost it's booster!"/>
+ </destructionevents>
+ </ShipPart>
+ <ShipPart name="sidearmR" initialhealth="20" maxhealth="20" damageabsorption="0.2" explosionposition="140,30,100">
+ <destructionevents>
+ <PartDestructionEvent targetType="engine" targetName="sidearmRengine" operation="destroy" message="The right auxiliary engine was destroyed!"/>
+ <PartDestructionEvent targetType="part" targetName="sidearmRfront" operation="destroy"/>
+ <PartDestructionEvent targetType="ship" targetParam="rotationthrust" operation="-" value="0.04" />
+ </destructionevents>
+ </ShipPart>
+ <ShipPart name="sidearmRfront" initialhealth="10" maxhealth="10" damageabsorption="0.5" explosionposition="140,20,-50">
+ <destructionevents>
+ <PartDestructionEvent targetType="engine" targetName="sidearmRengine" targetParam="boostfactor" operation="set" value="1" message="The right auxiliary engine lost it's booster!"/>
+ </destructionevents>
+ </ShipPart>
+ </parts>
+
<attached>
-
<Model mesh="HeavyCruiser_body.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
- <Model mesh="HeavyCruiser_frontL.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
- <Model mesh="HeavyCruiser_frontR.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
- <Model mesh="HeavyCruiser_partL.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
- <Model mesh="HeavyCruiser_partR.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
- <Model mesh="HeavyCruiser_sidearmL.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
- <Model mesh="HeavyCruiser_sidearmLfront.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
- <Model mesh="HeavyCruiser_sidearmR.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
- <Model mesh="HeavyCruiser_sidearmRfront.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
+
+ <StaticEntity name="frontL" position="0,0,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model mesh="HeavyCruiser_frontL.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
+ <BlinkingBillboard position="-75,30,-416" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.05 frequency=0.3 phase=240 quadratic=1 />
+ <BlinkingBillboard position="-74,30,-402" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.1 frequency=0.3 phase=120 quadratic=1 />
+ <BlinkingBillboard position="-73,30,-388" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.15 frequency=0.3 phase=0 quadratic=1 />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="-80,33,-320" halfExtents="7,11,54" info="frontL"/>
+ <BoxCollisionShape position="-79,31,-399" halfExtents="3,6,26" info="frontL"/>
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="frontR" position="0,0,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model mesh="HeavyCruiser_frontR.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
+ <BlinkingBillboard position="75,30,-416" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.05 frequency=0.3 phase=240 quadratic=1 />
+ <BlinkingBillboard position="74,30,-402" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.1 frequency=0.3 phase=120 quadratic=1 />
+ <BlinkingBillboard position="73,30,-388" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.15 frequency=0.3 phase=0 quadratic=1 />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="80,33,-320" halfExtents="7,11,54" info="frontR"/>
+ <BoxCollisionShape position="79,31,-399" halfExtents="3,6,26" info="frontR"/>
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="partL" position="0,0,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model mesh="HeavyCruiser_partL.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="-94,33,-179" halfExtents="11,13,45" info="partL"/>
+ <BoxCollisionShape position="-96,33,-230" halfExtents="13,17,22" info="partL"/>
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="partR" position="0,0,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model mesh="HeavyCruiser_partR.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="94,33,-179" halfExtents="11,13,45" info="partR"/>
+ <BoxCollisionShape position="96,33,-230" halfExtents="13,17,22" info="partR"/>
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="sidearmL" position="0,0,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model mesh="HeavyCruiser_sidearmL.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="-109,47,87" halfExtents="29,8,26" info="sidearmL, upper connection"/>
+ <BoxCollisionShape position="-99,-1,79" roll="15" halfExtents="40,4,9" info="sidearmL, lower connection"/>
+ <BoxCollisionShape position="-145,21,115" roll="15" halfExtents="19,31,105" info="sidearmL, front"/>
+ <BoxCollisionShape position="-140,12,261" roll="15" halfExtents="22,41,43" info="sidearmL, back"/>
+ <BoxCollisionShape position="-145,25,5" roll="15" halfExtents="10,18,5" info="sidearmL, front break"/>
+ <BoxCollisionShape position="-133,-13,29" roll="15" halfExtents="12,6,17" info="sidearmL, bottom cylinder"/>
+ <BoxCollisionShape position="-165,-4,31" roll="15" halfExtents="7,21,13" info="sidearmL, box"/>
+ <BoxCollisionShape position="-153,59,96" roll="15" halfExtents="6,7,60" info="sidearmL, upper beam"/>
+ <BoxCollisionShape position="-143,57,119" roll="15" halfExtents="3,4,85" info="sidearmL, upper inner beam"/>
+ <BoxCollisionShape position="-142,53,212" pitch="21" yaw="5" roll="15" halfExtents="3,4,10" info="sidearmL, upper inner beam"/>
+ <BoxCollisionShape position="-160,52,119" roll="15" halfExtents="3,4,85" info="sidearmL, upper outer beam"/>
+ <BoxCollisionShape position="-159,48,212" pitch="21" yaw="5" roll="15" halfExtents="3,4,10" info="sidearmL, upper outer beam"/>
+ <BoxCollisionShape position="-152,54,34" pitch="-46" yaw="-14" roll="15" halfExtents="6,7,10" info="sidearmL, upper beam front"/>
+ <BoxCollisionShape position="-152,54,162" pitch="30" yaw="9" roll="15" halfExtents="6,7,12" info="sidearmL, upper beam back"/>
+ <BoxCollisionShape position="-168,21,119" roll="15" halfExtents="3,5,109" info="sidearmL, outer beam"/>
+ <BoxCollisionShape position="-134,-10,169" roll="15" halfExtents="6,4,55" info="sidearmL, lower beam front"/>
+ <BoxCollisionShape position="-131,-20,217" pitch="-20" roll="15" yaw="-5" halfExtents="6,12,3" info="sidearmL, lower beam middle"/>
+ <BoxCollisionShape position="-130,-29,233" roll="15" halfExtents="6,3,15" info="sidearmL, lower beam back"/>
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="sidearmLfront" position="0,0,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model mesh="HeavyCruiser_sidearmLfront.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="-141,15,-53" roll="15" halfExtents="27,44,62" info="sidearmLfront"/>
+ <BoxCollisionShape position="-153,59,-30" roll="15" halfExtents="4,2,38" info="sidearmLfront, top"/>
+ <BoxCollisionShape position="-153,61,-41" roll="15" halfExtents="4,4,11" info="sidearmLfront, top"/>
+ <BoxCollisionShape position="-153,60,-65" roll="15" halfExtents="4,3,4" info="sidearmLfront, top"/>
+ <BoxCollisionShape position="-153,59,-41" roll="15" halfExtents="8,2,11" info="sidearmLfront, top"/>
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="sidearmR" position="0,0,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model mesh="HeavyCruiser_sidearmR.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="109,47,87" halfExtents="29,8,26" info="sidearmR, upper connection"/>
+ <BoxCollisionShape position="99,-1,79" roll="-15" halfExtents="40,4,9" info="sidearmR, lower connection"/>
+ <BoxCollisionShape position="145,21,115" roll="-15" halfExtents="19,31,105" info="sidearmR, front"/>
+ <BoxCollisionShape position="140,12,261" roll="-15" halfExtents="22,41,43" info="sidearmR, back"/>
+ <BoxCollisionShape position="145,25,5" roll="-15" halfExtents="10,18,5" info="sidearmR, front break"/>
+ <BoxCollisionShape position="133,-13,29" roll="-15" halfExtents="12,6,17" info="sidearmR, bottom cylinder"/>
+ <BoxCollisionShape position="165,-4,31" roll="-15" halfExtents="7,21,13" info="sidearmR, box"/>
+ <BoxCollisionShape position="153,59,96" roll="-15" halfExtents="6,7,60" info="sidearmR, upper beam"/>
+ <BoxCollisionShape position="143,57,119" roll="-15" halfExtents="3,4,85" info="sidearmR, upper inner beam"/>
+ <BoxCollisionShape position="142,53,212" pitch="21" yaw="-5" roll="-15" halfExtents="3,4,10" info="sidearmR, upper inner beam"/>
+ <BoxCollisionShape position="160,52,119" roll="-15" halfExtents="3,4,85" info="sidearmR, upper outer beam"/>
+ <BoxCollisionShape position="159,48,212" pitch="21" yaw="-5" roll="-15" halfExtents="3,4,10" info="sidearmR, upper outer beam"/>
+ <BoxCollisionShape position="152,54,34" pitch="-46" yaw="14" roll="-15" halfExtents="6,7,10" info="sidearmR, upper beam front"/>
+ <BoxCollisionShape position="152,54,162" pitch="30" yaw="-9" roll="-15" halfExtents="6,7,12" info="sidearmR, upper beam back"/>
+ <BoxCollisionShape position="168,21,119" roll="-15" halfExtents="3,5,109" info="sidearmR, outer beam"/>
+ <BoxCollisionShape position="134,-10,169" roll="-15" halfExtents="6,4,55" info="sidearmR, lower beam front"/>
+ <BoxCollisionShape position="131,-20,217" pitch="-20" roll="-15" yaw="5" halfExtents="6,12,3" info="sidearmR, lower beam middle"/>
+ <BoxCollisionShape position="130,-29,233" roll="-15" halfExtents="6,3,15" info="sidearmR, lower beam back"/>
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="sidearmRfront" position="0,0,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model mesh="HeavyCruiser_sidearmRfront.mesh" direction="-1,0,0" position="0,0,0" scale="40"/>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="141,15,-53" roll="-15" halfExtents="27,44,62" info="sidearmRfront"/>
+ <BoxCollisionShape position="153,59,-30" roll="-15" halfExtents="4,2,38" info="sidearmRfront, top"/>
+ <BoxCollisionShape position="153,61,-41" roll="-15" halfExtents="4,4,11" info="sidearmRfront, top"/>
+ <BoxCollisionShape position="153,60,-65" roll="-15" halfExtents="4,3,4" info="sidearmRfront, top"/>
+ <BoxCollisionShape position="153,59,-41" roll="-15" halfExtents="8,2,11" info="sidearmRfront, top"/>
+ </collisionShapes>
+ </StaticEntity>
- <!-- bay1 lights -->
- <BlinkingBillboard position="75,30,-416" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.05 frequency=0.3 phase=240 quadratic=1 />
- <BlinkingBillboard position="-75,30,-416" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.05 frequency=0.3 phase=240 quadratic=1 />
- <BlinkingBillboard position="74,30,-402" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.1 frequency=0.3 phase=120 quadratic=1 />
- <BlinkingBillboard position="-74,30,-402" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.1 frequency=0.3 phase=120 quadratic=1 />
- <BlinkingBillboard position="73,30,-388" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.15 frequency=0.3 phase=0 quadratic=1 />
- <BlinkingBillboard position="-73,30,-388" material="Examples/Flare" colour="0.8, 0.8, 0, 0.1" amplitude=0.15 frequency=0.3 phase=0 quadratic=1 />
<!-- front position lights -->
<BlinkingBillboard position="67,-5,-240" material="Examples/Flare" colour="0, 0.7, 0, 0.1" amplitude=0.3 frequency=0.15 phase=0 quadratic=1 />
<BlinkingBillboard position="-67,-5,-240" material="Examples/Flare" colour="0.7, 0, 0, 0.1" amplitude=0.3 frequency=0.15 phase=360 quadratic=1 />
@@ -78,76 +241,6 @@
</attached>
<collisionShapes>
- <BoxCollisionShape position="80,33,-320" halfExtents="7,11,54" info="frontR"/>
- <BoxCollisionShape position="79,31,-399" halfExtents="3,6,26" info="frontR"/>
-
-
- <BoxCollisionShape position="-80,33,-320" halfExtents="7,11,54" info="frontL"/>
- <BoxCollisionShape position="-79,31,-399" halfExtents="3,6,26" info="frontL"/>
-
-
- <BoxCollisionShape position="94,33,-179" halfExtents="11,13,45" info="partR"/>
- <BoxCollisionShape position="96,33,-230" halfExtents="13,17,22" info="partR"/>
-
-
- <BoxCollisionShape position="-94,33,-179" halfExtents="11,13,45" info="partL"/>
- <BoxCollisionShape position="-96,33,-230" halfExtents="13,17,22" info="partL"/>
-
-
- <BoxCollisionShape position="109,47,87" halfExtents="29,8,26" info="sidearmR, upper connection"/>
- <BoxCollisionShape position="99,-1,79" roll="-15" halfExtents="40,4,9" info="sidearmR, lower connection"/>
- <BoxCollisionShape position="145,21,115" roll="-15" halfExtents="19,31,105" info="sidearmR, front"/>
- <BoxCollisionShape position="140,12,261" roll="-15" halfExtents="22,41,43" info="sidearmR, back"/>
- <BoxCollisionShape position="145,25,5" roll="-15" halfExtents="10,18,5" info="sidearmR, front break"/>
- <BoxCollisionShape position="133,-13,29" roll="-15" halfExtents="12,6,17" info="sidearmR, bottom cylinder"/>
- <BoxCollisionShape position="165,-4,31" roll="-15" halfExtents="7,21,13" info="sidearmR, box"/>
- <BoxCollisionShape position="153,59,96" roll="-15" halfExtents="6,7,60" info="sidearmR, upper beam"/>
- <BoxCollisionShape position="143,57,119" roll="-15" halfExtents="3,4,85" info="sidearmR, upper inner beam"/>
- <BoxCollisionShape position="142,53,212" pitch="21" yaw="-5" roll="-15" halfExtents="3,4,10" info="sidearmR, upper inner beam"/>
- <BoxCollisionShape position="160,52,119" roll="-15" halfExtents="3,4,85" info="sidearmR, upper outer beam"/>
- <BoxCollisionShape position="159,48,212" pitch="21" yaw="-5" roll="-15" halfExtents="3,4,10" info="sidearmR, upper outer beam"/>
- <BoxCollisionShape position="152,54,34" pitch="-46" yaw="14" roll="-15" halfExtents="6,7,10" info="sidearmR, upper beam front"/>
- <BoxCollisionShape position="152,54,162" pitch="30" yaw="-9" roll="-15" halfExtents="6,7,12" info="sidearmR, upper beam back"/>
- <BoxCollisionShape position="168,21,119" roll="-15" halfExtents="3,5,109" info="sidearmR, outer beam"/>
- <BoxCollisionShape position="134,-10,169" roll="-15" halfExtents="6,4,55" info="sidearmR, lower beam front"/>
- <BoxCollisionShape position="131,-20,217" pitch="-20" roll="-15" yaw="5" halfExtents="6,12,3" info="sidearmR, lower beam middle"/>
- <BoxCollisionShape position="130,-29,233" roll="-15" halfExtents="6,3,15" info="sidearmR, lower beam back"/>
-
-
- <BoxCollisionShape position="141,15,-53" roll="-15" halfExtents="27,44,62" info="sidearmRfront"/>
- <BoxCollisionShape position="153,59,-30" roll="-15" halfExtents="4,2,38" info="sidearmRfront, top"/>
- <BoxCollisionShape position="153,61,-41" roll="-15" halfExtents="4,4,11" info="sidearmRfront, top"/>
- <BoxCollisionShape position="153,60,-65" roll="-15" halfExtents="4,3,4" info="sidearmRfront, top"/>
- <BoxCollisionShape position="153,59,-41" roll="-15" halfExtents="8,2,11" info="sidearmRfront, top"/>
-
-
- <BoxCollisionShape position="-109,47,87" halfExtents="29,8,26" info="sidearmL, upper connection"/>
- <BoxCollisionShape position="-99,-1,79" roll="15" halfExtents="40,4,9" info="sidearmL, lower connection"/>
- <BoxCollisionShape position="-145,21,115" roll="15" halfExtents="19,31,105" info="sidearmL, front"/>
- <BoxCollisionShape position="-140,12,261" roll="15" halfExtents="22,41,43" info="sidearmL, back"/>
- <BoxCollisionShape position="-145,25,5" roll="15" halfExtents="10,18,5" info="sidearmL, front break"/>
- <BoxCollisionShape position="-133,-13,29" roll="15" halfExtents="12,6,17" info="sidearmL, bottom cylinder"/>
- <BoxCollisionShape position="-165,-4,31" roll="15" halfExtents="7,21,13" info="sidearmL, box"/>
- <BoxCollisionShape position="-153,59,96" roll="15" halfExtents="6,7,60" info="sidearmL, upper beam"/>
- <BoxCollisionShape position="-143,57,119" roll="15" halfExtents="3,4,85" info="sidearmL, upper inner beam"/>
- <BoxCollisionShape position="-142,53,212" pitch="21" yaw="5" roll="15" halfExtents="3,4,10" info="sidearmL, upper inner beam"/>
- <BoxCollisionShape position="-160,52,119" roll="15" halfExtents="3,4,85" info="sidearmL, upper outer beam"/>
- <BoxCollisionShape position="-159,48,212" pitch="21" yaw="5" roll="15" halfExtents="3,4,10" info="sidearmL, upper outer beam"/>
- <BoxCollisionShape position="-152,54,34" pitch="-46" yaw="-14" roll="15" halfExtents="6,7,10" info="sidearmL, upper beam front"/>
- <BoxCollisionShape position="-152,54,162" pitch="30" yaw="9" roll="15" halfExtents="6,7,12" info="sidearmL, upper beam back"/>
- <BoxCollisionShape position="-168,21,119" roll="15" halfExtents="3,5,109" info="sidearmL, outer beam"/>
- <BoxCollisionShape position="-134,-10,169" roll="15" halfExtents="6,4,55" info="sidearmL, lower beam front"/>
- <BoxCollisionShape position="-131,-20,217" pitch="-20" roll="15" yaw="-5" halfExtents="6,12,3" info="sidearmL, lower beam middle"/>
- <BoxCollisionShape position="-130,-29,233" roll="15" halfExtents="6,3,15" info="sidearmL, lower beam back"/>
-
-
- <BoxCollisionShape position="-141,15,-53" roll="15" halfExtents="27,44,62" info="sidearmLfront"/>
- <BoxCollisionShape position="-153,59,-30" roll="15" halfExtents="4,2,38" info="sidearmLfront, top"/>
- <BoxCollisionShape position="-153,61,-41" roll="15" halfExtents="4,4,11" info="sidearmLfront, top"/>
- <BoxCollisionShape position="-153,60,-65" roll="15" halfExtents="4,3,4" info="sidearmLfront, top"/>
- <BoxCollisionShape position="-153,59,-41" roll="15" halfExtents="8,2,11" info="sidearmLfront, top"/>
-
-
<BoxCollisionShape position="60,35,-310" halfExtents="13,28,60" info="body, bay1, Rwall"/>
<BoxCollisionShape position="-60,35,-310" halfExtents="13,28,60" info="body, bay1, Lwall"/>
<BoxCollisionShape position="0,56,-310" halfExtents="65,6,60" info="body, bay1, Twall"/>
@@ -292,7 +385,7 @@
<?lua
include("../includes/weaponSettingsHeavyCruiser.oxi")
?>
- </SpaceShip>
+ </ModularSpaceShip>
</Template>
@@ -317,6 +410,7 @@
<Template name=HeavyCruiser_body_engine1 baseclass=MultiStateEngine>
<MultiStateEngine
+ name = bodyengine
boostfactor = 2
speedfront = 150
@@ -411,6 +505,7 @@
<Template name=HeavyCruiser_sidearmL_engine1 baseclass=MultiStateEngine>
<MultiStateEngine
+ name = sidearmLengine
boostfactor = 2
speedfront = 300
@@ -460,6 +555,7 @@
<Template name=HeavyCruiser_sidearmR_engine1 baseclass=MultiStateEngine>
<MultiStateEngine
+ name = sidearmRengine
boostfactor = 2
speedfront = 300
Copied: code/branches/presentationFS14/data/levels/templates/ModularSpaceShipTest.oxt (from rev 10071, code/branches/modularships/data/levels/templates/ModularSpaceShipTest.oxt)
===================================================================
--- code/branches/presentationFS14/data/levels/templates/ModularSpaceShipTest.oxt (rev 0)
+++ code/branches/presentationFS14/data/levels/templates/ModularSpaceShipTest.oxt 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,166 @@
+<Template name=ModularSpaceShipTest>
+ <ModularSpaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipassffcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 6
+
+ health = 1000
+ maxhealth = 2000
+ initialhealth = 1000
+
+ shieldhealth = 30
+ initialshieldhealth = 30
+ maxshieldhealth = 50
+ shieldabsorption = 0.8
+ reloadrate = 1
+ reloadwaittime = 1
+
+ primaryThrust = 100
+ auxilaryThrust = 30
+ rotationThrust = 50
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 15
+ boostPowerRate = 1
+ boostRate = 5
+ boostCooldownDuration = 10
+
+ shakeFrequency = 15
+ shakeAmplitude = 9
+
+ collisionType = "dynamic"
+ mass = 100
+ linearDamping = 0.7
+ angularDamping = 0.9999999
+
+ explosionSound = "sounds/Explosion2.ogg"
+ >
+ <engines>
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+ </engines>
+ <attached>
+
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="6,6,6" />
+
+ <StaticEntity name="one" position="0,60,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="30,30,30" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="two" position="0,0,62" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="30,30,30" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="two_2" position="0,0,124" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="30,30,30" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="three" position="0,-60,0" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="30,30,30" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="four" position="0,0,-59" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="30,30,30" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity name="four_2" position="0,0,-118" direction="0,0,0" collisionType=static mass=100 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cube.mesh" scale3D="30,30,30" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ </collisionShapes>
+ </StaticEntity>
+
+ </attached>
+
+ <parts>
+ <ShipPart name="one" initialhealth="20" damageabsorption="1" />
+ <ShipPart name="two" initialhealth="20" damageabsorption="1" />
+ <ShipPart name="two_2" initialhealth="20" damageabsorption="1" />
+ <ShipPart name="three" initialhealth="20" damageabsorption="1" />
+ <ShipPart name="four" initialhealth="20" damageabsorption="1" />
+ <ShipPart name="four_2" initialhealth="20" damageabsorption="1" />
+ </parts>
+
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="30,30,30" />
+ </collisionShapes>
+<?lua
+ include("../includes/weaponSettingsAssff.oxi")
+?>
+ </ModularSpaceShip>
+</Template>
+
+<Template name=spaceshipassffcameras defaults=0>
+ <ModularSpaceShip>
+ <camerapositions>
+ <CameraPosition position="0,10, 40" drag=true mouselook=true />
+ </camerapositions>
+ </ModularSpaceShip>
+</Template>
+
+<Template name=spaceshipassffengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 2
+
+ speedfront = 150
+ speedback = 50
+ speedleftright = 50
+ speedupdown = 50
+
+ defEngineSndNormal = "sounds/Engine_low.ogg"
+ defEngineSndBoost = "sounds/Engine_high.ogg"
+
+ accelerationfront = 500
+ accelerationbrake = 500
+ accelerationback = 125
+ accelerationleftright = 125
+ accelerationupdown = 125
+ >
+ <EffectContainer condition="idle">
+
+ </EffectContainer>
+ <EffectContainer condition="not idle">
+
+ </EffectContainer>
+ <EffectContainer condition="normal or brake">
+
+ </EffectContainer>
+ <EffectContainer condition="normal or boost">
+
+ </EffectContainer>
+ <EffectContainer condition="boost">
+
+ </EffectContainer>
+ </MultiStateEngine>
+</Template>
Modified: code/branches/presentationFS14/src/external/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
===================================================================
--- code/branches/presentationFS14/src/external/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/external/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp 2014-05-22 12:49:16 UTC (rev 10073)
@@ -20,6 +20,7 @@
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btAabbUtil2.h"
#include "btManifoldResult.h"
+#include <iostream>
btCompoundCollisionAlgorithm::btCompoundCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped)
:btActivatingCollisionAlgorithm(ci,body0,body1),
@@ -114,7 +115,8 @@
void ProcessChildShape(btCollisionShape* childShape,int index)
{
- btAssert(index>=0);
+ // std::cout << "PCS: " << childShape << std::endl; // FIXME: (noep) remove DEBUG
+ btAssert(index>=0);
btCompoundShape* compoundShape = static_cast<btCompoundShape*>(m_compoundColObj->getCollisionShape());
btAssert(index<compoundShape->getNumChildShapes());
Modified: code/branches/presentationFS14/src/modules/weapons/projectiles/BasicProjectile.cc
===================================================================
--- code/branches/presentationFS14/src/modules/weapons/projectiles/BasicProjectile.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/modules/weapons/projectiles/BasicProjectile.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -77,7 +77,7 @@
Returns true if the collision resulted in a successful hit.
@see Pawn.h
*/
- bool BasicProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+ bool BasicProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
{
if (!this->bDestroy_ && GameMode::isMaster())
{
@@ -95,7 +95,7 @@
// If visual effects after destruction cause problems, put this block below the effects code block
if (victim)
{
- victim->hit(this->getShooter(), contactPoint, this->getDamage(), this->getHealthDamage(), this->getShieldDamage());
+ victim->hit(this->getShooter(), contactPoint, cs, this->getDamage(), this->getHealthDamage(), this->getShieldDamage());
victim->startReloadCountdown();
}
@@ -140,6 +140,7 @@
return false;
}
+
/**
@brief
Check whether the projectile needs to be destroyed and destroys it if so.
Modified: code/branches/presentationFS14/src/modules/weapons/projectiles/BasicProjectile.h
===================================================================
--- code/branches/presentationFS14/src/modules/weapons/projectiles/BasicProjectile.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/modules/weapons/projectiles/BasicProjectile.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -118,7 +118,7 @@
virtual void destroyObject(void);
protected:
- bool processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+ bool processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs);
void destroyCheck(void);
private:
Modified: code/branches/presentationFS14/src/modules/weapons/projectiles/Projectile.cc
===================================================================
--- code/branches/presentationFS14/src/modules/weapons/projectiles/Projectile.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/modules/weapons/projectiles/Projectile.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -87,9 +87,9 @@
this->destroyCheck();
}
- bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+ bool Projectile::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
{
- return this->processCollision(otherObject, contactPoint);
+ return this->processCollision(otherObject, contactPoint, cs);
}
}
Modified: code/branches/presentationFS14/src/modules/weapons/projectiles/Projectile.h
===================================================================
--- code/branches/presentationFS14/src/modules/weapons/projectiles/Projectile.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/modules/weapons/projectiles/Projectile.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -63,7 +63,7 @@
void setConfigValues();
virtual void tick(float dt);
- virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+ virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
private:
float lifetime_; //!< The time the projectile exists.
Modified: code/branches/presentationFS14/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/branches/presentationFS14/src/modules/weapons/projectiles/Rocket.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/modules/weapons/projectiles/Rocket.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -190,9 +190,9 @@
this->destroyCheck();
}
- bool Rocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+ bool Rocket::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
{
- return this->processCollision(otherObject, contactPoint);
+ return this->processCollision(otherObject, contactPoint, cs);
}
/**
Modified: code/branches/presentationFS14/src/modules/weapons/projectiles/Rocket.h
===================================================================
--- code/branches/presentationFS14/src/modules/weapons/projectiles/Rocket.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/modules/weapons/projectiles/Rocket.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -63,7 +63,7 @@
virtual void tick(float dt); //!< Defines which actions the Rocket has to take in each tick.
- virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+ virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
virtual void destroyObject(void);
void destructionEffect();
Modified: code/branches/presentationFS14/src/modules/weapons/projectiles/SimpleRocket.cc
===================================================================
--- code/branches/presentationFS14/src/modules/weapons/projectiles/SimpleRocket.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/modules/weapons/projectiles/SimpleRocket.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -171,9 +171,9 @@
this->player_ = this->getShooter()->getPlayer();
}
- bool SimpleRocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+ bool SimpleRocket::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
{
- return this->processCollision(otherObject, contactPoint);
+ return this->processCollision(otherObject, contactPoint, cs);
}
/**
Modified: code/branches/presentationFS14/src/modules/weapons/projectiles/SimpleRocket.h
===================================================================
--- code/branches/presentationFS14/src/modules/weapons/projectiles/SimpleRocket.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/modules/weapons/projectiles/SimpleRocket.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -63,7 +63,7 @@
virtual ~SimpleRocket();
virtual void tick(float dt);
- virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+ virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
void disableFire(); //!< Method to disable the fire and stop all acceleration
Modified: code/branches/presentationFS14/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/presentationFS14/src/orxonox/CMakeLists.txt 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/CMakeLists.txt 2014-05-22 12:49:16 UTC (rev 10073)
@@ -30,6 +30,7 @@
MoodManager.cc
PawnManager.cc
PlayerManager.cc
+ ShipPartManager.cc
Radar.cc
# Test.cc
Modified: code/branches/presentationFS14/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/OrxonoxPrereqs.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/OrxonoxPrereqs.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -141,6 +141,8 @@
class TeamColourable;
// items
+ class ShipPart;
+ class PartDestructionEvent;
class Engine;
class Item;
class MultiStateEngine;
@@ -188,6 +190,7 @@
class Destroyer;
class Pawn;
class SpaceShip;
+ class ModularSpaceShip;
class Spectator;
class TeamBaseMatchBase;
}
Modified: code/branches/presentationFS14/src/orxonox/Scene.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/Scene.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/Scene.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -348,12 +348,16 @@
SmartPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
SmartPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
+ // get the CollisionShape pointers
+ const btCollisionShape* cs0 = colObj0->getCollisionShape();
+ const btCollisionShape* cs1 = colObj1->getCollisionShape();
+
// false means that bullet will assume we didn't modify the contact
bool modified = false;
if (object0->isCollisionCallbackActive())
- modified |= object0->collidesAgainst(object1, cp);
+ modified |= object0->collidesAgainst(object1, cs1, cp);
if (object1->isCollisionCallbackActive())
- modified |= object1->collidesAgainst(object0, cp);
+ modified |= object1->collidesAgainst(object0, cs0, cp);
return modified;
}
Modified: code/branches/presentationFS14/src/orxonox/Scene.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/Scene.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/Scene.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -142,6 +142,9 @@
static bool collisionCallback(btManifoldPoint& cp, const btCollisionObject* colObj0, int partId0,
int index0, const btCollisionObject* colObj1, int partId1, int index1);
+ static bool customCollisionCallback(btManifoldPoint& cp, const btCollisionObject* colObj0, int partId0,
+ int index0, const btCollisionObject* colObj1, int partId1, int index1);
+
// Bullet objects
btDiscreteDynamicsWorld* physicalWorld_;
bt32BitAxisSweep3* broadphase_;
Copied: code/branches/presentationFS14/src/orxonox/ShipPartManager.cc (from rev 10071, code/branches/modularships/src/orxonox/ShipPartManager.cc)
===================================================================
--- code/branches/presentationFS14/src/orxonox/ShipPartManager.cc (rev 0)
+++ code/branches/presentationFS14/src/orxonox/ShipPartManager.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,61 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "ShipPartManager.h"
+
+#include "util/ScopedSingletonManager.h"
+#include "core/CoreIncludes.h"
+#include "items/ShipPart.h"
+
+namespace orxonox
+{
+ ManageScopedSingleton(ShipPartManager, ScopeID::Root, false);
+
+ ShipPartManager::ShipPartManager()
+ {
+ RegisterObject(ShipPartManager);
+ }
+
+ ShipPartManager::~ShipPartManager()
+ {
+ // Be sure to delete all the pawns
+ for (ObjectList<ShipPart>::iterator it = ObjectList<ShipPart>::begin(); it != ObjectList<ShipPart>::end(); )
+ (it++)->death();
+ }
+
+ void ShipPartManager::preUpdate(const Clock& time)
+ {
+ for (ObjectList<ShipPart>::iterator it = ObjectList<ShipPart>::begin(); it != ObjectList<ShipPart>::end(); )
+ {
+ if (!it->isAlive())
+ (it++)->death();
+ else
+ ++it;
+ }
+ }
+}
Copied: code/branches/presentationFS14/src/orxonox/ShipPartManager.h (from rev 10071, code/branches/modularships/src/orxonox/ShipPartManager.h)
===================================================================
--- code/branches/presentationFS14/src/orxonox/ShipPartManager.h (rev 0)
+++ code/branches/presentationFS14/src/orxonox/ShipPartManager.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,54 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _ShipPartManager_H__
+#define _ShipPartManager_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "util/Singleton.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+ class _OrxonoxExport ShipPartManager : public Singleton<ShipPartManager>, public Tickable
+ {
+ friend class Singleton<ShipPartManager>;
+ public:
+ ShipPartManager();
+ virtual ~ShipPartManager();
+
+ virtual void preUpdate(const Clock& time);
+
+ private:
+
+ static ShipPartManager* singletonPtr_s;
+ };
+}
+
+#endif /* _ShipPartManager_H__ */
Modified: code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/collisionshapes/CollisionShape.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -169,6 +169,12 @@
bool notifyBeingAttached(CompoundCollisionShape* newParent); // Notifies the CollisionShape of being attached to a CompoundCollisionShape.
void notifyDetached(); // Notifies the CollisionShape of being detached from a CompoundCollisionShape.
+ inline unsigned int getParentID()
+ { return this->parentID_; }
+
+ inline CompoundCollisionShape* getParent()
+ { return this->parent_; }
+
protected:
virtual void updateParent(); // Updates the CompoundCollisionShape the CollisionShape belongs to, after the CollisionShape has changed.
virtual void parentChanged(); // Is called when the parentID of the CollisionShape has changed.
Modified: code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -39,6 +39,8 @@
#include "core/XMLPort.h"
#include "tools/BulletConversions.h"
+#include "collisionshapes/WorldEntityCollisionShape.h"
+
namespace orxonox
{
RegisterClass(CompoundCollisionShape);
@@ -117,6 +119,11 @@
this->updatePublicShape();
}
+
+ // If the shape to be attached is not a CompoundCollisionShape (thus an actual physical shape) & this is a WorldEntity's CollisionShape,
+ // set it's userPointer to the WorldEntity this CompoundCollisionShape belongs to.
+ if (!orxonox_cast<CompoundCollisionShape*>(shape) && orxonox_cast<WorldEntityCollisionShape*>(this))
+ shape->getCollisionShape()->setUserPointer(orxonox_cast<WorldEntityCollisionShape*>(this)->getWorldEntityOwner());
}
/**
@@ -296,4 +303,9 @@
this->updatePublicShape();*/
}
+
+ int CompoundCollisionShape::getNumChildShapes()
+ {
+ return this->compoundShape_->getNumChildShapes();
+ }
}
Modified: code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/collisionshapes/CompoundCollisionShape.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -70,7 +70,13 @@
void updateAttachedShape(CollisionShape* shape);
virtual void changedScale();
+ int getNumChildShapes();
+ inline std::map<CollisionShape*, btCollisionShape*> getShapesMap()
+ {
+ return attachedShapes_;
+ }
+
private:
void updatePublicShape();
inline virtual btCollisionShape* createNewShape() const
Modified: code/branches/presentationFS14/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/controllers/NewHumanController.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/controllers/NewHumanController.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -219,7 +219,7 @@
if (!controlPaused_ )
{
- if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
+ if (this->getControllableEntity() && ((this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || (this->getControllableEntity()->isExactlyA(ClassByString("ModularSpaceShip")))) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
this->showOverlays();
else if (this->getControllableEntity() && this->getControllableEntity()->isExactlyA(ClassByString("FpsPlayer")))
{
@@ -497,7 +497,7 @@
{
this->controlMode_ = 0;
this->centerCursor();
- if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
+ if (this->getControllableEntity() && ((this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || (this->getControllableEntity()->isExactlyA(ClassByString("ModularSpaceShip")))) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
{
this->showOverlays_ = true;
if (!this->controlPaused_)
Modified: code/branches/presentationFS14/src/orxonox/items/CMakeLists.txt
===================================================================
--- code/branches/presentationFS14/src/orxonox/items/CMakeLists.txt 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/items/CMakeLists.txt 2014-05-22 12:49:16 UTC (rev 10073)
@@ -2,4 +2,6 @@
Item.cc
Engine.cc
MultiStateEngine.cc
+ ShipPart.cc
+ PartDestructionEvent.cc
)
Copied: code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.cc (from rev 10071, code/branches/modularships/src/orxonox/items/PartDestructionEvent.cc)
===================================================================
--- code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.cc (rev 0)
+++ code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,352 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Noe Pedrazzini
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "PartDestructionEvent.h"
+
+#include <algorithm>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "network/NetworkFunction.h"
+#include "Item.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/pawns/ModularSpaceShip.h"
+#include "items/Engine.h"
+#include "gametypes/Gametype.h"
+#include "chat/ChatManager.h"
+
+
+namespace orxonox
+{
+ RegisterClass(PartDestructionEvent);
+
+ PartDestructionEvent::PartDestructionEvent(Context* context)
+ : Item(context)
+ {
+ RegisterObject(PartDestructionEvent);
+ this->setValid(true);
+ }
+
+ PartDestructionEvent::~PartDestructionEvent()
+ {
+
+ }
+
+ void PartDestructionEvent::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(PartDestructionEvent, XMLPort, xmlelement, mode);
+
+ XMLPortParam(PartDestructionEvent, "targetType", setTargetType, getTargetType, xmlelement, mode).defaultValues("NULL");
+ XMLPortParam(PartDestructionEvent, "targetName", setTargetName, getTargetName, xmlelement, mode).defaultValues("NULL");
+ XMLPortParam(PartDestructionEvent, "operation", setOperation, getOperation, xmlelement, mode).defaultValues("NULL");
+ XMLPortParam(PartDestructionEvent, "targetParam", setTargetParam, getTargetParam, xmlelement, mode).defaultValues("NULL");
+ XMLPortParam(PartDestructionEvent, "value", setEventValue, getEventValue, xmlelement, mode).defaultValues(0);
+ XMLPortParam(PartDestructionEvent, "message", setMessage, getMessage, xmlelement, mode).defaultValues("NULL");
+
+ /*
+ XMLPortParam(PartDestructionEvent, "health", setHealth, getHealth, xmlelement, mode).defaultValues(100);
+ XMLPortParam(PartDestructionEvent, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
+ XMLPortParam(PartDestructionEvent, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
+ */
+ }
+
+ /**
+ @brief
+ Executes this event.
+ */
+ void PartDestructionEvent::execute()
+ {
+ // Do not execute if this event is invalid
+ if(!isValid())
+ {
+ orxout(internal_warning) << "Attempted to execute an invalid PartDestructionEvent!" << endl;
+ return;
+ }
+
+ // Output the destruction-message to the chat
+ if(this->message_ != "NULL")
+ ChatManager::message(this->message_);
+
+ // Modify parameters as configured for all cases
+ if (this->targetType_ == "ship")
+ {
+ switch (this->targetParam_) {
+ case shieldhealth:
+ this->parent_->getParent()->setShieldHealth(operate(this->parent_->getParent()->getShieldHealth()));
+ break;
+ case boostpower:
+ this->parent_->getParent()->setInitialBoostPower(operate(this->parent_->getParent()->getInitialBoostPower()));
+ break;
+ case boostpowerrate:
+ this->parent_->getParent()->setBoostPowerRate(operate(this->parent_->getParent()->getBoostPowerRate()));
+ break;
+ case rotationthrust:
+ this->parent_->getParent()->setRotationThrust(operate(this->parent_->getParent()->getRotationThrust()));
+ break;
+ default:
+ break;
+ }
+ this->setValid(false);
+ return;
+ }
+
+ if (this->targetType_ == "engine")
+ {
+ switch (this->targetParam_) {
+ case null:
+ this->parent_->getParent()->removeEngine(this->parent_->getParent()->getEngineByName(targetName_));
+ break;
+ case boostfactor:
+ this->parent_->getParent()->getEngineByName(targetName_)->setBoostFactor(operate(this->parent_->getParent()->getEngineByName(targetName_)->getBoostFactor()));
+ break;
+ case speedfront:
+ this->parent_->getParent()->getEngineByName(targetName_)->setMaxSpeedFront(operate(this->parent_->getParent()->getEngineByName(targetName_)->getMaxSpeedFront()));
+ break;
+ case accelerationfront:
+ this->parent_->getParent()->getEngineByName(targetName_)->setAccelerationFront(operate(this->parent_->getParent()->getEngineByName(targetName_)->getAccelerationFront()));
+ break;
+ default:
+ break;
+ }
+ this->setValid(false);
+ return;
+ }
+
+ if (this->targetType_ == "part")
+ {
+ switch (this->targetParam_) {
+ case null:
+ if (!this->parent_->getParent()->getShipPartByName(targetName_))
+ return;
+ this->parent_->getParent()->getShipPartByName(targetName_)->setEventExecution(false);
+ this->parent_->getParent()->killShipPart(targetName_);
+ break;
+ default:
+ break;
+ }
+ this->setValid(false);
+ return;
+ }
+ }
+
+ void PartDestructionEvent::setParent(ShipPart* part)
+ {
+ this->parent_ = part;
+ }
+
+ /**
+ @brief
+ Set type of the target
+ @param param
+ The desired target-type as string. Valid target-types: ship engine weapon
+ */
+ void PartDestructionEvent::setTargetType(std::string type)
+ {
+ if ((type == "ship") || (type == "engine") || (type == "weapon") || (type == "part"))
+ {
+ this->targetType_ = type;
+ return;
+ }
+
+ // Error, if invalid target-type was entered.
+ orxout(internal_warning) << "\"" << type << "\" is not a valid target-type for a PartDestructionEvent. Valid types are: ship engine weapon part" << endl;
+ this->setValid(false);
+ return;
+ }
+
+ void PartDestructionEvent::setTargetName(std::string name)
+ {
+ // Error, if the target-type is "weapon" or "engine", but the name of said target was not defined.
+ if (((this->targetType_ == "weapon") || (this->targetType_ == "engine")) && (name == "NULL"))
+ {
+ orxout(internal_warning) << "The target-name of a PartDestructionEvent with target-type \"" << this->targetType_ << "\" needs to be defined!" << endl;
+ return;
+ }
+
+ this->targetName_ = name;
+ }
+
+ /**
+ @brief
+ Set the operation to be applied.
+ @param param
+ The desired parameter as string. Valid parameters: c.f. @ref orxnox::PartDestructionEvent::TargetParam
+ */
+ void PartDestructionEvent::setTargetParam(std::string param)
+ {
+ // A target-type needs to be defined in order to choose a parameter.
+ if (this->targetType_ == "NULL")
+ {
+ orxout(internal_warning) << "No valid target-type defined. Cannot set target-param for this PartDestructionEvent." << endl;
+ this->setValid(false);
+ return;
+ }
+
+ // engine: NULL boostfactor speedfront accelerationfront
+ if (this->targetType_ == "engine")
+ {
+ if (param == "NULL")
+ {
+ this->targetParam_ = null;
+ return;
+ }
+ if (param == "boostfactor")
+ {
+ this->targetParam_ = boostfactor;
+ return;
+ }
+ if (param == "speedfront")
+ {
+ this->targetParam_ = speedfront;
+ return;
+ }
+ if (param == "accelerationfront")
+ {
+ this->targetParam_ = accelerationfront;
+ return;
+ }
+
+ orxout(internal_warning) << "\"" << param << "\" is not a valid target-param for a PartDestructionEvent with target-type \"engine\". Valid types are: boostfactor speedfront accelerationfront" << endl;
+ return;
+ }
+
+ // weapon:
+
+ // ship: shieldhealth (maxshieldhealth shieldabsorption shieldrechargerate) boostpower boostpowerrate rotationthrust
+ if (this->targetType_ == "ship")
+ {
+ if (param == "shieldhealth")
+ {
+ this->targetParam_ = shieldhealth;
+ return;
+ }
+ if (param == "boostpower")
+ {
+ this->targetParam_ = boostpower;
+ return;
+ }
+ if (param == "boostpowerrate")
+ {
+ this->targetParam_ = boostpowerrate;
+ return;
+ }
+ if (param == "rotationthrust")
+ {
+ this->targetParam_ = rotationthrust;
+ return;
+ }
+
+ orxout(internal_warning) << "\"" << param << "\" is not a valid target-param for a PartDestructionEvent with target-type \"ship\". Valid types are: shieldhealth maxshieldhealth shieldabsorption shieldrechargerate boostpower boostpowerrate rotationthrust" << endl;
+ return;
+ }
+
+ if (this->targetType_ == "part")
+ {
+ if (param == "NULL")
+ {
+ this->targetParam_ = null;
+ return;
+ }
+
+ orxout(internal_warning) << "\"" << param << "\" is not a valid target-param for a PartDestructionEvent with target-type \"part\". Valid types are: NULL (set operation to \"destroy\")" << endl;
+ return;
+ }
+
+ orxout(internal_warning) << "No valid target-param defined. The chosen param is either invalid or not available for this target-type." << endl;
+ this->setValid(false);
+ }
+
+ /**
+ @brief
+ Set the operation to be applied.
+ @param operation
+ The desired operator as string. Valid operators: * + - destroy
+ */
+ void PartDestructionEvent::setOperation(std::string operation)
+ {
+ // * + - destroy
+ if ((operation == "*") || (operation == "+") || (operation == "-") || (operation == "set") || (operation == "destroy"))
+ {
+ this->operation_ = operation;
+ return;
+ }
+ this->operation_ = "NULL";
+ orxout(internal_warning) << "\"" << operation << "\" is not a valid operation for a PartDestructionEvent. Valid operations are: * + - set destroy" << endl;
+ }
+
+ /**
+ @brief
+ Set the message to be shown upon execution of the vent.
+ @param msg
+ The desired message as string.
+ */
+ void PartDestructionEvent::setMessage(std::string msg)
+ {
+ this->message_ = msg;
+ }
+
+
+ /**
+ @brief
+ Apply the configured operation and value to an input.
+ @param input
+ The value which should be modified
+ @return
+ Returns the product / sum / difference of input and configured value,
+ the configured value if the operation is "set",
+ or 0 if the operation is "destroy"
+ */
+ float PartDestructionEvent::operate(float input)
+ {
+ if (this->operation_ == "*")
+ return input * this->value_;
+ if (this->operation_ == "+")
+ return input + this->value_;
+ if (this->operation_ == "-")
+ return input - this->value_;
+ if (this->operation_ == "set")
+ return this->value_;
+ if (this->operation_ == "destroy")
+ {
+ return 0;
+ }
+ return 0;
+ }
+
+ /**
+ @brief
+ Sets the value applied with the chosen operation.
+ @param value
+ The value as float.
+ */
+ void PartDestructionEvent::setEventValue(float value)
+ {
+ this->value_ = value;
+ }
+}
Copied: code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.h (from rev 10071, code/branches/modularships/src/orxonox/items/PartDestructionEvent.h)
===================================================================
--- code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.h (rev 0)
+++ code/branches/presentationFS14/src/orxonox/items/PartDestructionEvent.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,160 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Noe Pedrazzini
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _PartDestructionEvent_H__
+#define _PartDestructionEvent_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Item.h"
+
+#include <string>
+
+
+namespace orxonox // tolua_export
+{ // tolua_export
+ /**
+ @brief
+ In order to assign attached entities to a ShipPart, a ShipPart with the same name as the corresponding entity needs to be created in the <parts> tag.
+ Here is a (primitive) example of a ModularSpaceShip with ShipParts and PartDestructionEvents defined in XML:
+ @code
+ <ModularSpaceShip
+ ...
+ >
+ <attached>
+ <StaticEntity name="generator" . . . />
+ <StaticEntity name="tail" . . . />
+ </attached>
+ <parts>
+ <ShipPart name="generator" . . . >
+ <destructionevents>
+ <PartDestructionEvent targetType="ship" targetParam="boostpowerrate" operation="-" value="0.5" message="Your boost-regeneration is reduced!" />
+ </destructionevents>
+ </ShipPart>
+ <ShipPart name="tail" . . . >
+ <destructionevents>
+ <PartDestructionEvent ... />
+ </destructionevents>
+ </ShipPart>
+ </parts>
+ <engines>
+ <Engine />
+ <Engine />
+ </engines>
+ </ModularSpaceShip>
+ @endcode
+
+ @author
+ Fabian 'x3n' Landau, Noe Pedrazzini
+ */
+ class _OrxonoxExport PartDestructionEvent // tolua_export
+ : public Item
+ { // tolua_export
+
+ public:
+
+ /**
+ @brief
+ List of all allowed parameters.
+ */
+ enum TargetParam
+ {
+ shieldhealth,
+ maxshieldhealth,
+ shieldabsorption,
+ shieldrechargerate,
+ boostpower, // Amount of available boost
+ boostpowerrate, // Recharge-rate of boost
+ rotationthrust,
+ boostfactor,
+ speedfront,
+ accelerationfront,
+ null
+ };
+
+ PartDestructionEvent(Context* context);
+ virtual ~PartDestructionEvent();
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ void execute();
+
+ inline void setValid(bool valid)
+ { this->valid_ = valid; }
+ inline bool isValid()
+ { return this->valid_; }
+
+ void setParent(ShipPart* parent);
+ inline ShipPart* getParent()
+ { return this->parent_; }
+
+ void setTargetType(std::string type);
+ inline std::string getTargetType()
+ { return this->targetType_; }
+
+ void setTargetName(std::string name);
+ inline std::string getTargetName()
+ { return this->targetName_; }
+
+ void setTargetParam(std::string param);
+ inline std::string getTargetParam()
+ { return this->targetName_; }
+
+ void setOperation(std::string operation);
+ inline std::string getOperation()
+ { return this->operation_; }
+
+ void setMessage(std::string msg);
+ inline std::string getMessage()
+ { return this->message_; }
+
+ float operate(float input);
+
+ void setEventValue(float value);
+ inline float getEventValue()
+ { return this->value_; }
+
+ protected:
+
+ private:
+
+ ShipPart* parent_; //!< Pointer to the ShipPart this event belongs to
+ bool valid_; //!< Whether this event is valid or not.
+
+ std::string targetType_; //!< The type of the target. (ship weapon engine)
+ std::string targetName_; //!< The name of the target.
+ TargetParam targetParam_; //!< The parameter to be modified
+ std::string operation_; //!< The operation to be applied
+ float value_; //!< The value used to do the operation
+ std::string message_; //!< The message which is shown in chat when the event is executed.
+
+
+
+ }; // tolua_export
+} // tolua_export
+
+#endif /* _PartDestructionEvent_H__ */
Copied: code/branches/presentationFS14/src/orxonox/items/ShipPart.cc (from rev 10071, code/branches/modularships/src/orxonox/items/ShipPart.cc)
===================================================================
--- code/branches/presentationFS14/src/orxonox/items/ShipPart.cc (rev 0)
+++ code/branches/presentationFS14/src/orxonox/items/ShipPart.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,291 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Noe Pedrazzini
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "ShipPart.h"
+
+#include <algorithm>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "network/NetworkFunction.h"
+#include "Item.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/pawns/ModularSpaceShip.h"
+#include "gametypes/Gametype.h"
+#include "worldentities/StaticEntity.h"
+#include "items/PartDestructionEvent.h"
+#include "worldentities/BigExplosion.h"
+#include "chat/ChatManager.h"
+
+
+namespace orxonox
+{
+ RegisterClass(ShipPart);
+
+ ShipPart::ShipPart(Context* context)
+ : Item(context)
+ {
+ RegisterObject(ShipPart);
+ this->setAlive(true);
+ this->setEventExecution(true);
+ this->healthMem_ = 100;
+ }
+
+ ShipPart::~ShipPart()
+ {
+
+ }
+
+ void ShipPart::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(ShipPart, XMLPort, xmlelement, mode);
+
+ XMLPortParam(ShipPart, "health", setHealth, getHealth, xmlelement, mode).defaultValues(100);
+ XMLPortParam(ShipPart, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
+ XMLPortParam(ShipPart, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
+
+ XMLPortParam(ShipPart, "damageabsorption", setDamageAbsorption, getDamageAbsorption, xmlelement, mode).defaultValues(0.5);
+
+ XMLPortParamTemplate(ShipPart, "explosionposition", setExplosionPosition, getExplosionPosition, xmlelement, mode, Vector3);
+
+ XMLPortObject(ShipPart, PartDestructionEvent, "destructionevents", addDestructionEvent, getDestructionEvent, xmlelement, mode);
+ }
+
+ /**
+ @brief
+ Is called when the ShipPart dies.
+ Executes PartDestructionEvents.
+ Tells the ModularSpaceShip to remove this ShipPart.
+ */
+ void ShipPart::death()
+ {
+ //if (!(this->isAlive()))
+ //return;
+
+ this->explode();
+ this->setAlive(false);
+
+ if(eventExecution_)
+ {
+ // Execute all destruction events
+ for (unsigned int i = 0; i < this->eventList_.size(); i++)
+ {
+ this->getDestructionEvent(i)->execute();
+ }
+ }
+
+ // Remove this ShipPart from the parent.
+ this->parent_->removeShipPart(this);
+ delete this;
+ }
+
+ void ShipPart::explode()
+ {
+ BigExplosion* chunk = new BigExplosion(this->getContext());
+ chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * (this->explosionPosition_));
+ //chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * Vector3(this->entityList_[0]->getLocalInertia()));
+ chunk->setVelocity(this->parent_->getVelocity());
+
+ // this->explosionSound_->setPosition(this->parent_->getPosition());
+ // this->explosionSound_->play();
+ }
+
+ /**
+ @brief
+ Add a StaticEntity to the ShipPart.
+ @param engine
+ A pointer to the StaticEntity to be added.
+ */
+ void ShipPart::addEntity(StaticEntity* entity)
+ {
+ OrxAssert(entity != NULL, "The Entity cannot be NULL.");
+ this->entityList_.push_back(entity);
+ }
+
+ /**
+ @brief
+ Get the i-th StaticEntity of the ShipPart.
+ @return
+ Returns a pointer to the i-the StaticEntity. NULL if there is no StaticEntity with that index.
+ */
+ StaticEntity* ShipPart::getEntity(unsigned int index)
+ {
+ if(this->entityList_.size() >= index)
+ return NULL;
+ else
+ return this->entityList_[index];
+ }
+
+ /**
+ @brief
+ Check whether the ShipPart has a particular Entity.
+ @param engine
+ A pointer to the Entity to be checked.
+ */
+ bool ShipPart::hasEntity(StaticEntity* entity) const
+ {
+ for(unsigned int i = 0; i < this->entityList_.size(); i++)
+ {
+ if(this->entityList_[i] == entity)
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ @brief
+ Add a PartDestructionEvent to the ShipPart.
+ @param engine
+ A pointer to the PartDestructionEvent to be added.
+ */
+ void ShipPart::addDestructionEvent(PartDestructionEvent* event)
+ {
+ OrxAssert(event != NULL, "The PartDestructionEvent cannot be NULL.");
+ event->setParent(this);
+ this->eventList_.push_back(event);
+ }
+
+ /**
+ @brief
+ Get the i-th PartDestructionEvent of the ShipPart.
+ @return
+ Returns a pointer to the i-the PartDestructionEvent. NULL if there is no PartDestructionEvent with that index.
+ */
+ PartDestructionEvent* ShipPart::getDestructionEvent(unsigned int index)
+ {
+ if(this->eventList_.size() <= index)
+ return NULL;
+ else
+ return this->eventList_[index];
+ }
+
+ void ShipPart::setDamageAbsorption(float value)
+ {
+ this->damageAbsorption_ = value;
+ }
+
+ void ShipPart::setParent(ModularSpaceShip* ship)
+ {
+ this->parent_ = ship;
+ }
+
+ /**
+ @brief
+ Sets the health of the ShipPart.
+ */
+ void ShipPart::setHealth(float health)
+ {
+ this->health_ = health;
+ }
+
+ void ShipPart::setAlive(bool var)
+ {
+ this->alive_ = var;
+ orxout() << "ShipPart " << this->getName() << " alive_: " << this->alive_ << endl;
+ }
+
+ /**
+ @brief
+ Handles a received hit.
+ */
+ void ShipPart::handleHit(float damage, float healthdamage, float shielddamage, Pawn* originator)
+ {
+ if (parent_->getGametype() && parent_->getGametype()->allowPawnDamage(parent_, originator))
+ {
+ if (shielddamage >= parent_->getShieldHealth())
+ {
+ parent_->setShieldHealth(0);
+ this->setHealth(this->health_ - (healthdamage + damage) * this->damageAbsorption_);
+ parent_->setHealth(parent_->getHealth() - (healthdamage + damage) * (1 - this->damageAbsorption_));
+ }
+ else
+ {
+ parent_->setShieldHealth(parent_->getShieldHealth() - shielddamage);
+
+ // remove remaining shieldAbsorpton-Part of damage from shield
+ shielddamage = damage * parent_->getShieldAbsorption();
+ shielddamage = std::min(parent_->getShieldHealth(),shielddamage);
+ parent_->setShieldHealth(parent_->getShieldHealth() - shielddamage);
+
+ // set remaining damage to health
+ this->setHealth(this->health_ - ((damage - shielddamage) - healthdamage) * this->damageAbsorption_);
+ parent_->setHealth(parent_->getHealth() - ((damage - shielddamage) - healthdamage) * (1- this->damageAbsorption_));
+ }
+ }
+ if (this->health_ < 0)
+ this->alive_ = false;
+ //this->death();
+
+ // (Ugly) Chatoutput of health, until a GUI for modularspaceships-shipparts is implemented.
+ if ((this->health_ < 0.2 * this->maxHealth_) && (this->healthMem_ == 40))
+ {
+ this->healthMem_ = 20;
+ ChatManager::message("ShipPart " + this->getName() + " remaining health is 20%!");
+ return;
+ }
+ if ((this->health_ < 0.4 * this->maxHealth_) && (this->healthMem_ == 60))
+ {
+ this->healthMem_ = 40;
+ ChatManager::message("ShipPart " + this->getName() + " remaining health is 40%!");
+ return;
+ }
+ if ((this->health_ < 0.6 * this->maxHealth_) && (this->healthMem_ == 80))
+ {
+ this->healthMem_ = 60;
+ ChatManager::message("ShipPart " + this->getName() + " remaining health is 60%!");
+ return;
+ }
+ if ((this->health_ < 0.8 * this->maxHealth_) && (this->healthMem_ == 100))
+ {
+ this->healthMem_ = 80;
+ ChatManager::message("ShipPart " + this->getName() + " remaining health is 80%!");
+ return;
+ }
+ }
+
+
+ /**
+ @brief
+ Adds the ShipPart to the input SpaceShip.
+ @param ship
+ A pointer to the SpaceShip to which the ShipPart is added.
+ */
+ /*void ShipPart::addToSpaceShip(ModularSpaceShip* ship)
+ {
+ this->parent_ = ship;
+
+ if (ship)
+ {
+ this->parentID_ = ship->getObjectID();
+ if (!ship->hasShipPart(this))
+ ship->addShipPart(this);
+ }
+ }*/
+
+}
Copied: code/branches/presentationFS14/src/orxonox/items/ShipPart.h (from rev 10071, code/branches/modularships/src/orxonox/items/ShipPart.h)
===================================================================
--- code/branches/presentationFS14/src/orxonox/items/ShipPart.h (rev 0)
+++ code/branches/presentationFS14/src/orxonox/items/ShipPart.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,134 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Noe Pedrazzini
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _ShipPart_H__
+#define _ShipPart_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Item.h"
+#include "items/PartDestructionEvent.h"
+
+#include <string>
+
+
+namespace orxonox // tolua_export
+{ // tolua_export
+ class _OrxonoxExport ShipPart // tolua_export
+ : public Item
+ { // tolua_export
+
+ public:
+ ShipPart(Context* context);
+ virtual ~ShipPart();
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ virtual void handleHit(float damage, float healthdamage, float shielddamage, Pawn* originator);
+
+ virtual void death();
+ virtual void explode();
+
+ //virtual void attachTo(Pawn* newParent);
+ //virtual void detach();
+
+ void addEntity(StaticEntity* entity);
+ StaticEntity* getEntity(unsigned int index);
+ bool hasEntity(StaticEntity* entity) const;
+
+ void addDestructionEvent(PartDestructionEvent* event);
+ PartDestructionEvent* getDestructionEvent(unsigned int index);
+
+ virtual void setDamageAbsorption(float value);
+ inline float getDamageAbsorption()
+ { return this->damageAbsorption_; }
+
+ void setParent(ModularSpaceShip* ship);
+ inline ModularSpaceShip* getParent()
+ { return this->parent_; }
+
+ void setAlive(bool var);
+ inline bool isAlive()
+ { return this->alive_; }
+
+ inline void setEventExecution(bool var)
+ { this->eventExecution_ = var; }
+ inline bool isEventExecution()
+ { return this->eventExecution_; }
+
+ virtual void setHealth(float health);
+ inline void addHealth(float health)
+ { this->setHealth(this->health_ + health); }
+ inline void removeHealth(float health)
+ { this->setHealth(this->health_ - health); }
+ inline float getHealth() const
+ { return this->health_; }
+
+ inline void setMaxHealth(float maxhealth)
+ { this->maxHealth_ = maxhealth; this->setHealth(this->health_); }
+ inline float getMaxHealth() const
+ { return this->maxHealth_; }
+
+ inline void setInitialHealth(float initialhealth)
+ { this->initialHealth_ = initialhealth; this->setHealth(initialhealth); }
+ inline float getInitialHealth() const
+ { return this->initialHealth_; }
+
+ inline void setExplosionPosition(Vector3 pos)
+ { this->explosionPosition_ = pos; }
+ inline Vector3 getExplosionPosition()
+ { return this->explosionPosition_; }
+
+
+ // FIXME: (noep) Why doesn't this work? Works fine in Engine.h
+ //void addToSpaceShip(ModularSpaceShip* ship);
+
+ protected:
+ ModularSpaceShip* parent_;
+ unsigned int parentID_; // Object ID of the SpaceShip the Part is mounted on.
+
+ float damageAbsorption_;
+ float health_;
+ float maxHealth_;
+ float initialHealth_;
+
+ private:
+ std::vector<StaticEntity*> entityList_; // List of all entities which belong to this part
+ std::vector<PartDestructionEvent*> eventList_; // The list of all PartDestructionEvent assigned to this ShipPart.
+
+ bool alive_;
+ bool eventExecution_;
+
+ float healthMem_;
+
+ Vector3 explosionPosition_;
+
+
+ }; // tolua_export
+} // tolua_export
+
+#endif /* _ShipPart_H__ */
Modified: code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -71,7 +71,7 @@
XMLPortParam(MovableEntity, "collisiondamage", setCollisionDamage, getCollisionDamage, xmlelement, mode).defaultValues(1);
}
- bool MovableEntity::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+ bool MovableEntity::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
{
if (GameMode::isMaster() && enableCollisionDamage_)
{
@@ -79,14 +79,13 @@
if (victim)
{
float damage = this->collisionDamage_ * (victim->getVelocity() - this->getVelocity()).length();
- victim->hit(0, contactPoint, damage);
+ victim->hit(0, contactPoint, ownCollisionShape, damage);
}
}
return false;
}
-
void MovableEntity::registerVariables()
{
registerVariable(this->linearVelocity_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processLinearVelocity));
Modified: code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/MovableEntity.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -46,7 +46,7 @@
virtual ~MovableEntity();
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+ virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
using WorldEntity::setPosition;
using WorldEntity::setOrientation;
Modified: code/branches/presentationFS14/src/orxonox/worldentities/StaticEntity.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/StaticEntity.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/StaticEntity.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -33,6 +33,7 @@
#include <BulletDynamics/Dynamics/btRigidBody.h>
#include "util/OrxAssert.h"
#include "core/CoreIncludes.h"
+#include "worldentities/BigExplosion.h"
namespace orxonox
{
@@ -114,4 +115,5 @@
worldTrans.setOrigin(btVector3(node_->getPosition().x, node_->getPosition().y, node_->getPosition().z));
worldTrans.setRotation(btQuaternion(node_->getOrientation().x, node_->getOrientation().y, node_->getOrientation().z, node_->getOrientation().w));
}
+
}
Modified: code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -45,6 +45,7 @@
#include "core/XMLPort.h"
#include "Scene.h"
#include "collisionshapes/WorldEntityCollisionShape.h"
+#include <BulletCollision/CollisionShapes/btCollisionShape.h>
namespace orxonox
{
Modified: code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/WorldEntity.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -71,6 +71,7 @@
class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable, public btMotionState
{
friend class Scene;
+ friend class ModularSpaceShip;
public:
// Define our own transform space enum to avoid Ogre includes here
@@ -206,6 +207,9 @@
void notifyChildPropsChanged();
+ inline int getNumAttachedObj()
+ { return this->children_.size(); }
+
protected:
virtual void parentChanged() {}
@@ -373,7 +377,7 @@
@note
Condition is that enableCollisionCallback() was called.
*/
- virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+ virtual inline bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
{ return false; } /* With false, Bullet assumes no modification to the collision objects. */
//! Enables the collidesAgainst(.) function. The object doesn't respond to collision otherwise!
@@ -405,6 +409,9 @@
*/
virtual bool isCollisionTypeLegal(CollisionType type) const = 0;
+ inline virtual WorldEntityCollisionShape* getWorldEntityCollisionShape()
+ { return this->collisionShape_; }
+
btRigidBody* physicalBody_; //!< Bullet rigid body. Everything physical is applied to this instance.
private:
Modified: code/branches/presentationFS14/src/orxonox/worldentities/pawns/CMakeLists.txt
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/CMakeLists.txt 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/CMakeLists.txt 2014-05-22 12:49:16 UTC (rev 10073)
@@ -3,6 +3,7 @@
Spectator.cc
Pawn.cc
SpaceShip.cc
+ ModularSpaceShip.cc
TeamBaseMatchBase.cc
Destroyer.cc
)
Copied: code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.cc (from rev 10071, code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.cc)
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.cc (rev 0)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,368 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * Noe Pedrazzini
+ *
+ */
+
+#include "ModularSpaceShip.h"
+
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+
+#include "core/CoreIncludes.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "core/Template.h"
+#include "core/XMLPort.h"
+#include "util/Math.h"
+#include "gametypes/Gametype.h"
+#include "core/command/ConsoleCommand.h"
+
+#include "items/ShipPart.h"
+#include "items/Engine.h"
+#include "worldentities/StaticEntity.h"
+#include "collisionshapes/WorldEntityCollisionShape.h"
+#include <BulletCollision/CollisionShapes/btCollisionShape.h>
+#include <BulletCollision/CollisionShapes/btCompoundShape.h>
+
+
+
+namespace orxonox
+{
+ SetConsoleCommand("ModularSpaceShip", "killshippart", &ModularSpaceShip::killShipPartStatic);
+
+ RegisterClass(ModularSpaceShip);
+
+ std::map<StaticEntity*, ShipPart*>* ModularSpaceShip::partMap_s = 0;
+
+ ModularSpaceShip::ModularSpaceShip(Context* context) : SpaceShip(context)
+ {
+ RegisterObject(ModularSpaceShip);
+
+ this->registerVariables();
+
+ ModularSpaceShip::partMap_s = &(this->partMap_);
+
+ }
+
+ ModularSpaceShip::~ModularSpaceShip()
+ {
+ if (this->isInitialized())
+ {
+
+ }
+ }
+
+ void ModularSpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(ModularSpaceShip, XMLPort, xmlelement, mode);
+ XMLPortObject(ModularSpaceShip, ShipPart, "parts", addShipPart, getShipPart, xmlelement, mode);
+ }
+
+ void ModularSpaceShip::registerVariables()
+ {
+ return;
+ }
+
+ /**
+ @brief
+ Searches for ShipParts matching to StaticEntities.
+ */
+ void ModularSpaceShip::updatePartAssignment()
+ {
+ // iterate through all attached objects
+ for (unsigned int i=0; i < (unsigned int)(this->getNumAttachedObj()); i++)
+ {
+ if (this->getAttachedObject(i) == NULL)
+ {
+ break;
+ }
+ // iterate through all attached parts
+ for(unsigned int j = 0; j < this->partList_.size(); j++)
+ {
+ // if the name of the part matches the name of the object, add the object to that parts entitylist (unless it was already done).
+ if((this->partList_[j]->getName() == this->getAttachedObject(i)->getName()) && !this->partList_[j]->hasEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i))))
+ {
+ // The Entity is added to the part's entityList_
+ this->partList_[j]->addEntity(orxonox_cast<StaticEntity*>(this->getAttachedObject(i)));
+ // An entry in the partMap_ is created, assigning the part to the entity.
+ this->addPartEntityAssignment((StaticEntity*)(this->getAttachedObject(i)), this->partList_[j]);
+ }
+ }
+ }
+ }
+
+ void ModularSpaceShip::attach(WorldEntity* object)
+ {
+ SpaceShip::attach(object);
+ this->updatePartAssignment();
+ }
+
+ /**
+ @brief
+ Creates a new assignment for the given StaticEntity and ShipPart in the partMap_
+ @param entity
+ A pointer to the StaticEntity
+ @param part
+ A pointer to the ShipPart.
+ */
+ void ModularSpaceShip::addPartEntityAssignment(StaticEntity* entity, ShipPart* part)
+ {
+ if (!entity || !part)
+ return;
+
+ if (this->partMap_.find(entity) != this->partMap_.end())
+ {
+ orxout(internal_warning) << "Assigning an Entity to multiple parts is not yet supported." << endl;
+ return;
+ }
+
+ this->partMap_[entity] = part;
+ }
+
+
+ /**
+ @brief
+ Get the ShipPart an attached entity belongs to.
+ @param entity
+ The entity to be searched.
+ @return
+ Returns a pointer to the ShipPart the entity belongs to.
+ */
+ ShipPart* ModularSpaceShip::getPartOfEntity(StaticEntity* entity) const
+ {
+ for (std::map<StaticEntity*, ShipPart*>::const_iterator it = this->partMap_.begin(); it != this->partMap_.end(); ++it)
+ {
+ if (it->first == entity)
+ return it->second;
+ }
+ return NULL;
+ }
+
+ /**
+ @brief
+ If the damage occurred on an attached StaticEntity, the damage is given to the corresponding ShipPart to handle.
+ */
+ void ModularSpaceShip::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
+ {
+ if (this->getPartOfEntity((StaticEntity*)(cs->getUserPointer())) != NULL)
+ this->getPartOfEntity((StaticEntity*)(cs->getUserPointer()))->handleHit(damage, healthdamage, shielddamage, originator);
+ else
+ SpaceShip::damage(damage, healthdamage, shielddamage, originator, cs);
+ }
+
+ /**
+ @brief
+ STATIC: Needed for consolecommand. Kills the ShipPart with the given name. Used from the console-command "ModularSpaceShip killshippart [string]".
+ @param name
+ The name of the part to be killed.
+ */
+ void ModularSpaceShip::killShipPartStatic(std::string name)
+ {
+ for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_s->begin(); it != ModularSpaceShip::partMap_s->end(); ++it)
+ {
+ if (it->second->getName() == name)
+ {
+ it->second->setAlive(false);
+ return;
+ }
+ }
+ orxout(internal_warning) << "Could not apply damage to ShipPart \"" << name << "\". Part not found." << endl;
+ }
+
+ /**
+ @brief
+ Kills the ShipPart with the given name. Used from the console-command "ModularSpaceShip killshippart [string]".
+ @param name
+ The name of the part to be killed.
+ */
+ void ModularSpaceShip::killShipPart(std::string name)
+ {
+ for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_.begin(); it != ModularSpaceShip::partMap_.end(); ++it)
+ {
+ if (it->second->getName() == name)
+ {
+ it->second->setAlive(false);
+ return;
+ }
+ }
+ orxout(internal_warning) << "Could not apply damage to ShipPart \"" << name << "\". Part not found." << endl;
+ }
+
+ /**
+ @brief
+ Add a ShipPart to the SpaceShip.
+ @param engine
+ A pointer to the ShipPart to be added.
+ */
+ void ModularSpaceShip::addShipPart(ShipPart* part)
+ {
+ OrxAssert(part != NULL, "The ShipPart cannot be NULL.");
+ this->partList_.push_back(part);
+ part->setParent(this);
+ this->updatePartAssignment();
+ }
+
+ /**
+ @brief
+ Get the i-th ShipPart of the SpaceShip.
+ @return
+ Returns a pointer to the i-the ShipPart. NULL if there is no ShipPart with that index.
+ */
+ ShipPart* ModularSpaceShip::getShipPart(unsigned int index)
+ {
+ if(this->partList_.size() <= index)
+ return NULL;
+ else
+ return this->partList_[index];
+ }
+
+ /**
+ @brief
+ Looks for an attached ShipPart with a certain name.
+ @param name
+ The name of the ShipPart to be returned.
+ @return
+ Pointer to the ShipPart with the given name, or NULL if not found.
+ */
+ ShipPart* ModularSpaceShip::getShipPartByName(std::string name)
+ {
+ for(std::vector<ShipPart*>::iterator it = this->partList_.begin(); it != this->partList_.end(); ++it)
+ {
+ if(orxonox_cast<ShipPart*>(*it)->getName() == name)
+ {
+ return orxonox_cast<ShipPart*>(*it);
+ }
+ }
+ orxout(internal_warning) << "Couldn't find ShipPart with name \"" << name << "\"." << endl;
+ return NULL;
+ }
+
+ /**
+ @brief
+ Check whether the SpaceShip has a particular Engine.
+ @param engine
+ A pointer to the Engine to be checked.
+ */
+ bool ModularSpaceShip::hasShipPart(ShipPart* part) const
+ {
+ for(unsigned int i = 0; i < this->partList_.size(); i++)
+ {
+ if(this->partList_[i] == part)
+ return true;
+ }
+ return false;
+ }
+
+
+ /**
+ @brief
+ Removes a ShipPart from the SpaceShip, destroying the corresponding StaticEntity
+ @param part
+ The ShipPart to be removed.
+ */
+ void ModularSpaceShip::removeShipPart(ShipPart* part)
+ {
+ // Remove the part from the partList_
+ std::vector<ShipPart*>::iterator it = this->partList_.begin();
+ for(unsigned int i = 0; i < this->partList_.size(); i++)
+ {
+ if(this->partList_[i] == part)
+ {
+ this->partList_.erase(it);
+ break;
+ }
+ it++;
+ }
+ // Remove the part-entity assignment and detach the Entity of this ShipPart
+ for (std::map<StaticEntity*, ShipPart*>::iterator itt = this->partMap_.begin(); itt != this->partMap_.end(); )
+ {
+ if (itt->second == part)
+ {
+ this->detach(itt->first);
+ itt->first->destroy();
+ //itt->first->setActive(false);
+ //itt->first->setVisible(false);
+ //itt->first->setCollisionResponse(false);
+ //itt->first->setCollisionType(None);
+ //itt->first->deactivatePhysics();
+ this->partMap_.erase(itt++);
+ } else {
+ ++itt;
+ }
+ }
+ }
+
+ /**
+ @brief
+ Looks for an attached Engine with a certain name.
+ @param name
+ The name of the engine to be returned.
+ @return
+ Pointer to the engine with the given name, or NULL if not found.
+ */
+ Engine* ModularSpaceShip::getEngineByName(std::string name)
+ {
+ for(std::vector<Engine*>::iterator it = this->engineList_.begin(); it != this->engineList_.end(); ++it)
+ {
+ if(orxonox_cast<Engine*>(*it)->getName() == name)
+ {
+ return orxonox_cast<Engine*>(*it);
+ }
+ }
+ orxout(internal_warning) << "Couldn't find Engine with name \"" << name << "\"." << endl;
+ return NULL;
+ }
+
+ /**
+ @brief
+ Detaches a child WorldEntity from this instance.
+ */
+ void ModularSpaceShip::detach(WorldEntity* object)
+ {
+ std::set<WorldEntity*>::iterator it = this->children_.find(object);
+ if (it == this->children_.end())
+ {
+ orxout(internal_warning) << "Cannot detach an object that is not a child." << endl;
+ return;
+ }
+
+ // collision shapes
+
+ //this->printBtChildShapes((btCompoundShape*)(this->getWorldEntityCollisionShape()->getCollisionShape()), 2, 0);
+ this->detachCollisionShape(object->collisionShape_); // after succeeding, causes a crash in the collision handling
+ //this->printBtChildShapes((btCompoundShape*)(this->getWorldEntityCollisionShape()->getCollisionShape()), 2, 0);
+
+ // mass
+ if (object->getMass() > 0.0f)
+ {
+ this->childrenMass_ -= object->getMass();
+ recalculateMassProps();
+ }
+
+ this->detachNode(object->node_);
+ this->children_.erase(it); // this causes a crash when unloading the level. Or not?
+
+ object->notifyDetached();
+ }
+}
Copied: code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.h (from rev 10071, code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.h)
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.h (rev 0)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/ModularSpaceShip.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -0,0 +1,146 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * Noe Pedrazzini
+ *
+ */
+
+#ifndef _ModularSpaceShip_H__
+#define _ModularSpaceShip_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include <LinearMath/btVector3.h>
+
+#include "tools/Timer.h"
+#include "util/Math.h"
+#include "util/OrxAssert.h"
+
+#include "SpaceShip.h"
+#include "items/ShipPart.h"
+#include <map>
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ The SpaceShip is the principal entity through which the player interacts with the game. Its main function is to fly, however many things, such as @ref orxonox::Engine Engines or @ref orxonox::Weapon Weapons, can be attached to it.
+ The ModularSpaceShip is an extension of a @ref orxonox::SpaceShip SpaceShip, which uses @ref orxonox::ShipPart ShipParts to allow entities attached to it to be destroyed individually.
+
+ There are several parameters that define the behavior of the ModularSpaceShip>
+ - The <b>rotationThrust</b>, specifies the force with which the ModularSpaceShip rotates.
+ - The <b>boost</b>, there are quite some parameters pertaining to boosting. The boost is a special move of the ModularSpaceShip, where, for a limited amount of time, it can fly considerably faster than usual. The <b>boostPower</b> is the amount of power available for boosting. The <b>boostPowerRate</b> is the rate at which the boost power is replenished. The <b>boostRate</b> is the rate at which boosting uses power. And the <b>boostCooldownDuration</b> is the time the ModularSpaceShip cannot boost, once all the boost power has been used up. Naturally all of these parameters must be non-negative.
+ - The <b>boost shaking</b>, when the ModularSpaceShip boosts, the camera shakes to create a more immersive effect. Two parameters can be used to adjust the effect. The <b>shakeFrequency</b> is the frequency with which the camera shakes. And the <b>shakeAmplitude</b> is the amount with which the camera shakes. Again these parameters must bee non-negative.
+ - The <b>lift</b> creates a more natural flight feeling through the addition of a lift force. There are again tow parameters that can be specified. The <b>lift</b> which is the lift force that is applied. And the <b>stallSpeed</b> which is the forward speed after which no more lift is generated.
+
+ As mentioned @ref orxonox::Engine Engines can be mounted on the ModularSpaceShip.
+ In order to assign attached entities to a ShipPart, a ShipPart with the same name as the corresponding entity needs to be created in the <parts> tag.
+ Here is a (primitive) example of a ModularSpaceShip defined in XML:
+ @code
+ <ModularSpaceShip
+ rotationThrust = 50
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 15
+ boostPowerRate = 1
+ boostRate = 5
+ boostCooldownDuration = 10
+
+ shakeFrequency = 15
+ shakeAmplitude = 9
+
+ collisionType = "dynamic"
+ mass = 100
+ linearDamping = 0.7
+ angularDamping = 0.9999999
+ >
+ <attached>
+ <StaticEntity name="wing" . . . />
+ <StaticEntity name="tail" . . . />
+ </attached>
+ <parts>
+ <ShipPart name="wing" . . . />
+ <ShipPart name="tail" . . . />
+ </parts>
+ <engines>
+ <Engine />
+ <Engine />
+ </engines>
+ </ModularSpaceShip>
+ @endcode
+
+ @author
+ Fabian 'x3n' Landau, Noe Pedrazzini
+ */
+ class _OrxonoxExport ModularSpaceShip : public SpaceShip
+ {
+ public:
+ ModularSpaceShip(Context* context);
+ virtual ~ModularSpaceShip();
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ void attach(WorldEntity* object);
+
+ void addPartEntityAssignment(StaticEntity* entity, ShipPart* part);
+ ShipPart* getPartOfEntity(StaticEntity* entity) const;
+
+ virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);
+
+ static void killShipPartStatic(std::string name);
+ void killShipPart(std::string name);
+
+ void addShipPart(ShipPart* part);
+ ShipPart* getShipPart(unsigned int index);
+ ShipPart* getShipPartByName(std::string name);
+ bool hasShipPart(ShipPart* part) const;
+ void removeShipPart(ShipPart* part);
+
+ inline void setRotationThrust(float val)
+ { this->rotationThrust_ = val; }
+ inline float getRotationThrust()
+ { return this->rotationThrust_; }
+
+ Engine* getEngineByName(std::string name);
+ void detach(WorldEntity* object);
+
+ virtual void updatePartAssignment();
+
+ protected:
+
+
+ private:
+ void registerVariables();
+ std::vector<ShipPart*> partList_; // The list of all Parts mounted on this ModularSpaceShip.
+ std::map<StaticEntity*, ShipPart*> partMap_; // Map of Part-Entity-assignments
+ static std::map<StaticEntity*, ShipPart*>* partMap_s;
+
+ };
+}
+
+#endif /* _ModularSpaceShip_H__ */
Modified: code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.cc 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.cc 2014-05-22 12:49:16 UTC (rev 10073)
@@ -49,6 +49,12 @@
#include "controllers/FormationController.h"
+#include "collisionshapes/WorldEntityCollisionShape.h"
+#include <BulletCollision/CollisionShapes/btCollisionShape.h>
+#include <BulletCollision/CollisionShapes/btCompoundShape.h>
+#include "graphics/Model.h"
+
+
namespace orxonox
{
RegisterClass(Pawn);
@@ -243,8 +249,14 @@
this->reloadWaitCountdown_ -= dt;
}
- void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
+ void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs)
{
+ //FIXME: (noep) remove debug
+ //orxout() << "damage(): Collision detected on " << this->getName() << ", btCS*: " << cs << endl;
+
+ //int collisionShapeIndex = this->isMyCollisionShape(cs);
+ //orxout() << collisionShapeIndex << endl;
+
// Applies multiplier given by the DamageBoost Pickup.
if (originator)
damage *= originator->getDamageMultiplier();
@@ -278,21 +290,20 @@
Die hit-Funktionen muessen auch in src/orxonox/controllers/Controller.h angepasst werden! (Visuelle Effekte)
*/
- void Pawn::hit(Pawn* originator, const Vector3& force, float damage, float healthdamage, float shielddamage)
+ void Pawn::hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage, float shielddamage)
{
if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) )
{
- this->damage(damage, healthdamage, shielddamage, originator);
+ this->damage(damage, healthdamage, shielddamage, originator, cs);
this->setVelocity(this->getVelocity() + force);
}
}
-
- void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage, float shielddamage)
+ void Pawn::hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage, float shielddamage)
{
if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator) && (!this->getController() || !this->getController()->getGodMode()) )
{
- this->damage(damage, healthdamage, shielddamage, originator);
+ this->damage(damage, healthdamage, shielddamage, originator, cs);
if ( this->getController() )
this->getController()->hit(originator, contactpoint, damage); // changed to damage, why shielddamage?
@@ -560,4 +571,82 @@
}
+ int Pawn::isMyCollisionShape(const btCollisionShape* cs)
+ {
+ // This entities WECS
+ WorldEntityCollisionShape* ownWECS = this->getWorldEntityCollisionShape();
+
+ // e.g. "Box 4: Searching for CS 0x1ad49200"
+ orxout() << this->getName() << ": Searching for btCS* " << cs << endl;
+ // e.g. "Box 4 is WorldEntityCollisionShape 0x126dd060"
+ orxout() << " " << this->getName() << " is WorldEntityCollisionShape* " << ownWECS << endl;
+ // e.g. "Box 4 is WorldEntity 0x126dd060"
+ orxout() << " " << this->getName() << " is WorldEntity* " << this << endl;
+ // e.g. "Box 4 is objectID 943"
+ orxout() << " " << this->getName() << " is objectID " << this->getObjectID() << endl;
+
+ // List all attached Objects
+ orxout() << " " << this->getName() << " has the following Objects attached:" << endl;
+ for (int i=0; i<50; i++)
+ {
+ if (this->getAttachedObject(i)==NULL)
+ break;
+ orxout() << " " << i << ": " << this->getAttachedObject(i) << " (" << this->getAttachedObject(i)->getName() << ")";
+ if(!orxonox_cast<Model*>(this->getAttachedObject(i)))
+ orxout() << " (SE)";
+ orxout() << endl;
+ }
+
+
+ // print child shapes of this WECS
+ printBtChildShapes((btCompoundShape*)(ownWECS->getCollisionShape()), 2, 0);
+
+ int temp = entityOfCollisionShape(cs);
+ if (temp==0)
+ orxout() << this->getName() << " has been hit on it's main body." << endl;
+ else
+ orxout() << this->getName() << " has been hit on the attached entity no. " << temp << endl;
+
+ // end
+ return -1;
+ }
+
+ void Pawn::printBtChildShapes(btCompoundShape* cs, int indent, int subshape)
+ {
+ // e.g. " Childshape 1 (WECS 0x126dc8c0) has 2 childshapes:"
+ printSpaces(indent); orxout() << "Childshape " << subshape << " (btCS* " << cs << ") has " << cs->getNumChildShapes() << " childshapes:" << endl;
+
+ for (int i=0; i < cs->getNumChildShapes(); i++)
+ {
+ printSpaces(indent+2); orxout() << "- " << i << " - - -" << endl;
+
+ // For each childshape, print: (as long as it's not another CompoundCollisionShape)
+ if (!orxonox_cast<btCompoundShape*>(cs->getChildShape(i)))
+ {
+ // pointer to the btCollisionShape
+ printSpaces(indent+2); orxout() << "btCollisionShape*: " << cs->getChildShape(i) << endl;
+
+ // pointer to the btCollisionShape
+ printSpaces(indent+2); orxout() << "m_userPointer*: " << cs->getChildShape(i)->getUserPointer() << " (name_: " << ((BaseObject*)(cs->getChildShape(i)->getUserPointer()))->getName() << ")" << endl;
+ }
+
+ // if the childshape is a CompoundCollisionShape, print its children.
+ if (cs->getChildShape(i)->isCompound())
+ printBtChildShapes((btCompoundShape*)(cs->getChildShape(i)), indent+2, i);
+
+ }
+ }
+
+ int Pawn::entityOfCollisionShape(const btCollisionShape* cs)
+ {
+ btCompoundShape* ownBtCS = (btCompoundShape*)(this->getWorldEntityCollisionShape()->getCollisionShape());
+
+ return -1;
+ }
+
+ void Pawn::printSpaces(int num)
+ {
+ for(int i=0; i<num; i++)
+ orxout() << " ";
+ }
}
Modified: code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/Pawn.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -125,8 +125,8 @@
//virtual void hit(Pawn* originator, const Vector3& force, float damage);
//virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
- virtual void hit(Pawn* originator, const Vector3& force, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
- virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
+ virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
+ virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
virtual void kill();
@@ -195,7 +195,7 @@
virtual void spawneffect();
//virtual void damage(float damage, Pawn* originator = 0);
- virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL);
+ virtual void damage(float damage, float healthdamage = 0.0f, float shielddamage = 0.0f, Pawn* originator = NULL, const btCollisionShape* cs = NULL);
bool bAlive_;
@@ -228,6 +228,11 @@
float spawnparticleduration_;
unsigned int numexplosionchunks_;
+ virtual int isMyCollisionShape(const btCollisionShape* cs); // FIXME: (noep) remove debug
+ void printBtChildShapes(btCompoundShape* cs, int indent, int subshape); // FIXME: (noep) remove debug
+ void printSpaces(int num); // FIXME: (noep) remove debug
+ int entityOfCollisionShape(const btCollisionShape* cs);
+
private:
void registerVariables();
inline void setWeaponSystem(WeaponSystem* weaponsystem)
Modified: code/branches/presentationFS14/src/orxonox/worldentities/pawns/SpaceShip.h
===================================================================
--- code/branches/presentationFS14/src/orxonox/worldentities/pawns/SpaceShip.h 2014-05-22 12:35:02 UTC (rev 10072)
+++ code/branches/presentationFS14/src/orxonox/worldentities/pawns/SpaceShip.h 2014-05-22 12:49:16 UTC (rev 10073)
@@ -269,6 +269,8 @@
float lift_; //!< The amount of lift that is added.
float stallSpeed_; //!< The forward speed where no more lift is added.
+ std::vector<Engine*> engineList_; //!< The list of all Engines mounted on this SpaceShip.
+
private:
void registerVariables();
virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
@@ -284,8 +286,6 @@
void backupCamera(); // Save the original position and orientation of the camera.
void resetCamera(); // Reset the camera to its original position.
- std::vector<Engine*> engineList_; //!< The list of all Engines mounted on this SpaceShip.
-
Timer timer_; //!< Timer for the cooldown duration.
float shakeDt_; //!< Temporary variable for the shaking of the camera.
Vector3 cameraOriginalPosition_; //!< The original position of the camera before shaking it.
More information about the Orxonox-commit
mailing list