[Orxonox-commit 5826] r10486 - in code/branches/presentationFS15: . data/levels/includes data/particle src/modules/objects src/modules/weapons src/modules/weapons/munitions src/modules/weapons/projectiles src/modules/weapons/weaponmodes
maxima at orxonox.net
maxima at orxonox.net
Tue May 26 12:53:08 CEST 2015
Author: maxima
Date: 2015-05-26 12:53:08 +0200 (Tue, 26 May 2015)
New Revision: 10486
Added:
code/branches/presentationFS15/data/particle/FieldExplosion.particle
code/branches/presentationFS15/data/particle/GravityBombField.particle
code/branches/presentationFS15/src/modules/weapons/munitions/GravityBombMunition.cc
code/branches/presentationFS15/src/modules/weapons/munitions/GravityBombMunition.h
code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.cc
code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.h
code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.cc
code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.h
code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc
code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.h
Modified:
code/branches/presentationFS15/
code/branches/presentationFS15/data/levels/includes/weaponSettingsFS15.oxi
code/branches/presentationFS15/src/modules/objects/ForceField.h
code/branches/presentationFS15/src/modules/weapons/WeaponsPrereqs.h
code/branches/presentationFS15/src/modules/weapons/munitions/CMakeLists.txt
code/branches/presentationFS15/src/modules/weapons/projectiles/CMakeLists.txt
code/branches/presentationFS15/src/modules/weapons/projectiles/LightningGunProjectile.cc
code/branches/presentationFS15/src/modules/weapons/weaponmodes/CMakeLists.txt
Log:
weaponFS15 branch merged to presentation. spaceshipFS15 has GravityBomb on mode 2
Property changes on: code/branches/presentationFS15
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/ParticleEffectsFS15:10309-10484
/code/branches/Racingbot:9388-9513
/code/branches/ScriptableController:9999-10075
/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/clangenb:10385-10484
/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/core7:10350
/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/hudHS14:10083-10241
/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/keckslevelHS14:10082-10222
/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/leveljoemeHS14:10087-10223
/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/minigame4DHS14:10081-10230
/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/pickupsFS14:10000-10259
/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/presentationFS14:10069-10215
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/presentationHS14merge:10222-10257
/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/storymodeHS14:10085-10254
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10236
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/towerdefenseFS15:10283-10451
/code/branches/towerdefenseHS14:10086-10247
/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/weaponupdateHS14:10084-10237
+ /code/branches/ParticleEffectsFS15:10309-10484
/code/branches/Racingbot:9388-9513
/code/branches/ScriptableController:9999-10075
/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/clangenb:10385-10484
/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/core7:10350
/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/hudHS14:10083-10241
/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/keckslevelHS14:10082-10222
/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/leveljoemeHS14:10087-10223
/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/minigame4DHS14:10081-10230
/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/pickupsFS14:10000-10259
/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/presentationFS14:10069-10215
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/presentationHS14merge:10222-10257
/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/storymodeHS14:10085-10254
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10236
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/towerdefenseFS15:10283-10451
/code/branches/towerdefenseHS14:10086-10247
/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/weaponFS15:10302-10485
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
/code/branches/weaponupdateHS14:10084-10237
Modified: code/branches/presentationFS15/data/levels/includes/weaponSettingsFS15.oxi
===================================================================
--- code/branches/presentationFS15/data/levels/includes/weaponSettingsFS15.oxi 2015-05-26 10:40:33 UTC (rev 10485)
+++ code/branches/presentationFS15/data/levels/includes/weaponSettingsFS15.oxi 2015-05-26 10:53:08 UTC (rev 10486)
@@ -40,7 +40,7 @@
<LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
<Weapon>
- <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ <GravityBombFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
<RocketFireOld mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
<RocketFire mode=4 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
</Weapon>
Copied: code/branches/presentationFS15/data/particle/FieldExplosion.particle (from rev 10485, code/branches/weaponFS15/data/particle/FieldExplosion.particle)
===================================================================
--- code/branches/presentationFS15/data/particle/FieldExplosion.particle (rev 0)
+++ code/branches/presentationFS15/data/particle/FieldExplosion.particle 2015-05-26 10:53:08 UTC (rev 10486)
@@ -0,0 +1,165 @@
+particle_system Orxonox/FieldExplosion
+
+{
+
+ material PE/lensflare
+
+ particle_width 152.940002441406
+
+ particle_height 154.119995117188
+
+ quota 2000
+
+ cull_each false
+
+ sorted false
+
+ local_space false
+
+ iteration_interval 0.0
+
+ nonvisible_update_timeout 0.0
+
+ billboard_type point
+
+ billboard_origin center
+
+ billboard_rotation_type texcoord
+
+ point_rendering false
+
+ accurate_facing false
+
+
+
+ emitter Point
+
+ {
+
+ position 0.0 0.0 0.0
+
+ direction 1.0 0.0 0.0
+
+ angle 0.0
+
+ emission_rate 200.0
+
+ velocity_min -1000.0
+
+ velocity_max 1000.0
+
+ time_to_live_min 2.0
+
+ time_to_live_max 4.0
+
+ duration_min 0.0
+
+ duration_max 0.0
+
+ repeat_delay_min 0.0
+
+ repeat_delay_max 0.0
+
+ colour_range_start 1 1 1 1
+
+ colour_range_end 0.666667 0 0 1
+
+ }
+
+
+
+ emitter Point
+
+ {
+
+ position 0.0 0.0 0.0
+
+ direction 0.0 0.0 1.0
+
+ angle 0.0
+
+ emission_rate 200.0
+
+ velocity_min -1000.0
+
+ velocity_max 1000.0
+
+ time_to_live_min 2.0
+
+ time_to_live_max 4.0
+
+ duration_min 0.0
+
+ duration_max 0.0
+
+ repeat_delay_min 0.0
+
+ repeat_delay_max 0.0
+
+ colour_range_start 1 1 1 1
+
+ colour_range_end 0.333333 0 1 1
+
+ }
+
+
+
+ emitter Point
+
+ {
+
+ position 0.0 0.0 0.0
+
+ direction 0.0 1.0 0.0
+
+ angle 0.0
+
+ emission_rate 200.0
+
+ velocity_min -1000.0
+
+ velocity_max 1000.0
+
+ time_to_live_min 2.0
+
+ time_to_live_max 4.0
+
+ duration_min 0.0
+
+ duration_max 0.0
+
+ repeat_delay_min 0.0
+
+ repeat_delay_max 0.0
+
+ colour_range_start 1 1 1 1
+
+ colour_range_end 0 1 0.498039 1
+
+ }
+
+
+
+ affector LinearForce
+
+ {
+
+ force_vector 0.0 -45.62 0.0
+
+ force_application add
+
+ }
+
+
+
+ affector Scaler
+
+ {
+
+ rate 16.47
+
+ }
+
+
+}
+
Copied: code/branches/presentationFS15/data/particle/GravityBombField.particle (from rev 10485, code/branches/weaponFS15/data/particle/GravityBombField.particle)
===================================================================
--- code/branches/presentationFS15/data/particle/GravityBombField.particle (rev 0)
+++ code/branches/presentationFS15/data/particle/GravityBombField.particle 2015-05-26 10:53:08 UTC (rev 10486)
@@ -0,0 +1,65 @@
+particle_system Orxonox/GravityBombField
+{
+ material PE/lensflare
+ particle_width 33.6500015258789
+ particle_height 1.91999995708466
+ quota 2000
+ cull_each false
+ sorted false
+ local_space true
+ iteration_interval 0.0
+ nonvisible_update_timeout 0.0
+ billboard_type point
+ billboard_origin center
+ billboard_rotation_type vertex
+ point_rendering false
+ accurate_facing false
+
+ emitter HollowEllipsoid
+ {
+ position 0.0 0.0 0.0
+ direction 0.0 1.0 0.0
+ angle 180
+ width 350
+ height 350
+ depth 350
+ inner_width 0.99
+ inner_height 0.99
+ inner_depth 0.99
+ emission_rate 2000
+ velocity_min 0
+ velocity_max 5
+ time_to_live_min 2
+ time_to_live_max 5
+ duration_min 0
+ duration_max 0
+ repeat_delay_min 0
+ repeat_delay_max 0
+ colour_range_start 1 0.666667 0 1
+ colour_range_end 1 0 0 1
+ }
+
+ affector Rotator
+ {
+ rotation_speed_range_start 0
+ rotation_speed_range_end 0
+ rotation_range_start 0
+ rotation_range_end 180
+ }
+
+ affector ColourInterpolator
+ {
+ time0 0
+ colour0 1 0.666667 0 1
+ time1 0.2
+ colour1 1 0.584314 0 1
+ time2 0.4
+ colour2 1 0 0 1
+ time3 0.6
+ colour3 1 0 0 1
+ time4 0.8
+ colour4 0.666667 0 0 1
+ time5 1
+ colour5 0 0 0 1
+ }
+}
Modified: code/branches/presentationFS15/src/modules/objects/ForceField.h
===================================================================
--- code/branches/presentationFS15/src/modules/objects/ForceField.h 2015-05-26 10:40:33 UTC (rev 10485)
+++ code/branches/presentationFS15/src/modules/objects/ForceField.h 2015-05-26 10:53:08 UTC (rev 10486)
@@ -159,14 +159,16 @@
void setMode(const std::string& mode); //!< Set the mode of the ForceField.
const std::string& getMode(void); //!< Get the mode of the ForceField.
+ static const std::string modeTube_s;
+ static const std::string modeSphere_s;
+ static const std::string modeInvertedSphere_s;
+ static const std::string modeNewtonianGravity_s;
+
+ static const std::string modeHomogen_s;
+
private:
//! Strings to represent the modes.
- static const std::string modeTube_s;
- static const std::string modeSphere_s;
- static const std::string modeInvertedSphere_s;
- static const std::string modeNewtonianGravity_s;
- static const std::string modeHomogen_s;
float velocity_; //!< The velocity of the ForceField.
float radius_; //!< The radius of the ForceField.
Modified: code/branches/presentationFS15/src/modules/weapons/WeaponsPrereqs.h
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/WeaponsPrereqs.h 2015-05-26 10:40:33 UTC (rev 10485)
+++ code/branches/presentationFS15/src/modules/weapons/WeaponsPrereqs.h 2015-05-26 10:53:08 UTC (rev 10486)
@@ -74,6 +74,7 @@
class LaserMunition;
class ReplenishingMunition;
class RocketMunition;
+ class GravityBombMuntion;
// projectiles
class BillboardProjectile;
@@ -83,6 +84,7 @@
class Rocket;
class RocketOld;
class SimpleRocket;
+ class GravityBomb;
// weaponmodes
class EnergyDrink;
@@ -93,6 +95,7 @@
class RocketFire;
class RocketFireOld;
class SimpleRocketFire;
+ class GravityBombFire;
}
#endif /* _WeaponsPrereqs_H__ */
Modified: code/branches/presentationFS15/src/modules/weapons/munitions/CMakeLists.txt
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/munitions/CMakeLists.txt 2015-05-26 10:40:33 UTC (rev 10485)
+++ code/branches/presentationFS15/src/modules/weapons/munitions/CMakeLists.txt 2015-05-26 10:53:08 UTC (rev 10486)
@@ -3,4 +3,5 @@
LaserMunition.cc
FusionMunition.cc
RocketMunition.cc
+ GravityBombMunition.cc
)
Copied: code/branches/presentationFS15/src/modules/weapons/munitions/GravityBombMunition.cc (from rev 10485, code/branches/weaponFS15/src/modules/weapons/munitions/GravityBombMunition.cc)
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/munitions/GravityBombMunition.cc (rev 0)
+++ code/branches/presentationFS15/src/modules/weapons/munitions/GravityBombMunition.cc 2015-05-26 10:53:08 UTC (rev 10486)
@@ -0,0 +1,32 @@
+/*
+ * GravityBombMunition.cc
+ *
+ * Created on: Apr 16, 2015
+ * Author: Manuel Eggimann
+ */
+#include "GravityBombMunition.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+RegisterClass(GravityBombMunition);
+
+ GravityBombMunition::GravityBombMunition(Context* context) : Munition(context)
+ {
+ RegisterObject(GravityBombMunition);
+ this->maxMunitionPerMagazine_ = 1;
+ this->maxMagazines_ = 30;
+ this->magazines_ = 15;
+
+ this->bUseSeparateMagazines_ = false;
+ this->bStackMunition_ = true;
+
+ this->bAllowMunitionRefilling_ = true;
+ this->bAllowMultiMunitionRemovementUnderflow_ = false;
+ }
+
+}
+
+
+
+
Copied: code/branches/presentationFS15/src/modules/weapons/munitions/GravityBombMunition.h (from rev 10485, code/branches/weaponFS15/src/modules/weapons/munitions/GravityBombMunition.h)
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/munitions/GravityBombMunition.h (rev 0)
+++ code/branches/presentationFS15/src/modules/weapons/munitions/GravityBombMunition.h 2015-05-26 10:53:08 UTC (rev 10486)
@@ -0,0 +1,35 @@
+/*
+ * GravityBombMunition.h
+ *
+ * Created on: Apr 16, 2015
+ * Author: meggiman
+ */
+
+#ifndef GRAVITYBOMBMUNITION_H_
+#define GRAVITYBOMBMUNITION_H_
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weaponsystem/Munition.h"
+
+namespace orxonox
+{
+ /**
+ * @class GravityBombMunition
+ *
+ * @brief This class is used to set the behaviour of various
+ * munition specific attributes of the GravityBomb like max count of munition per magazine.
+ *
+ * @author Manuel
+ * @date 23.05.2015
+ */
+ class _WeaponsExport GravityBombMunition : public Munition
+ {
+ public:
+ GravityBombMunition(Context* context);
+ virtual ~GravityBombMunition() {}
+ };
+
+}
+
+
+#endif /* GRAVITYBOMBMUNITION_H_ */
Modified: code/branches/presentationFS15/src/modules/weapons/projectiles/CMakeLists.txt
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/projectiles/CMakeLists.txt 2015-05-26 10:40:33 UTC (rev 10485)
+++ code/branches/presentationFS15/src/modules/weapons/projectiles/CMakeLists.txt 2015-05-26 10:53:08 UTC (rev 10486)
@@ -7,4 +7,6 @@
Rocket.cc
RocketOld.cc
SimpleRocket.cc
+ GravityBomb.cc
+ GravityBombField.cc
)
Copied: code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.cc (from rev 10485, code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBomb.cc)
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.cc (rev 0)
+++ code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.cc 2015-05-26 10:53:08 UTC (rev 10486)
@@ -0,0 +1,112 @@
+/*
+ * GravityBomb.cc
+ *
+ * Created on: Mar 26, 2015
+ * Author: Manuel Eggimann
+ */
+#include "GravityBomb.h"
+#include "graphics/Model.h"
+
+
+namespace orxonox{
+ RegisterClass(GravityBomb);
+
+ const float GravityBomb::LIFETIME = 5; ///< The gravity bomb lifetime in seconds.
+
+ GravityBomb::GravityBomb(Context* context):
+ BasicProjectile(),
+ MovableEntity(context),
+ RadarViewable(this,static_cast<WorldEntity*>(this))
+ {
+ RegisterObject(GravityBomb);
+
+ this->setMass(10.0);
+ this->isDetonated_ = false;
+ if (GameMode::isMaster())
+ {
+ //Define CollisionType of the bomb
+ this->timeToLife_= LIFETIME;
+ this->setCollisionResponse(false);
+ this->setCollisionType(WorldEntity::Dynamic);
+ this->enableCollisionCallback();
+
+ //Add Collision Shape
+ SphereCollisionShape* collisionShape = new SphereCollisionShape(context);
+ collisionShape->setRadius(1.0);
+ this->attachCollisionShape(collisionShape);
+
+ //Create Bomb Model
+ Model* rocketModel = new Model(this->getContext());
+ rocketModel->setMeshSource("GravityBombRocket.mesh"); //Demo Model from SimpleRocket
+ rocketModel->scale(3.0f);
+ this->attach(rocketModel);
+ //Add second model because the bomb consists of the bomb and attached rockets (2 separate models)
+ Model* bombModel = new Model(this->getContext());
+ bombModel->setMeshSource("GravityBomb.mesh"); //Demo Model from SimpleRocket
+ bombModel->scale(3.0f);
+ this->attach(bombModel);
+
+ //Add particle effect to the flying rockets.
+ ParticleEmitter* fire = new ParticleEmitter(this->getContext());
+ fire->setOrientation(this->getOrientation());
+ fire->setSource("Orxonox/simplerocketfire");
+ this->attach(fire);
+
+ //Add sound effect while the bomb is flying.
+ WorldSound* bombSound = new WorldSound(context);
+ bombSound->setSource("sounds/GravityBombFlight.ogg");
+ bombSound->setLooping(true);
+ bombSound->setVolume(1.0);
+ this->attach(bombSound);
+ bombSound->play();
+ }
+ }
+
+ GravityBomb::~GravityBomb(){}
+
+ void GravityBomb::tick(float dt)
+ {
+ timeToLife_ -= dt;
+ if(timeToLife_ < 0)
+ {
+ //orxout(debug_output) << "bomb has stoped moving" <<endl;
+ setVelocity(Vector3::ZERO); //Stop the bomb.
+ isDetonated_ = true;
+ }
+ else
+ {
+ //orxout(debug_output)<< "Time to live:" << timeToLife_ <<endl;
+ destroyCheck(); //Every BasicProjectil has to call this method in each tick.
+ }
+ if(isDetonated_) detonate();
+ else SUPER(GravityBomb, tick, dt);
+ }
+
+ bool GravityBomb::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
+ {
+ if(otherObject != getShooter()) //Ensure that the bomb cannot collide with its shooter.
+ {
+ orxout(debug_output) << "collides" << endl;
+ processCollision(otherObject, contactPoint,cs);
+ isDetonated_ = true;
+ return true;
+ }
+ else{
+ //orxout(debug_output) << "collided with shooter. Has no effect..." << endl;
+ return false;
+ }
+ }
+
+ void GravityBomb::detonate()
+ {
+ //Create the GravityBombField and destroy the Projectil.
+ GravityBombField* field = new GravityBombField(this->getContext());
+ field->setShooter(this->getShooter());
+ field->setPosition(getPosition());
+ //orxout(debug_output) << "detonating. Creating GravityBombField." <<endl;
+ //orxout(debug_output) << "Field is at Position: " << getPosition() << endl;
+ this->destroy();
+ }
+}
+
+
Copied: code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.h (from rev 10485, code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBomb.h)
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.h (rev 0)
+++ code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBomb.h 2015-05-26 10:53:08 UTC (rev 10486)
@@ -0,0 +1,55 @@
+/*
+ * GravityBomb.h
+ *
+ * Created on: Mar 19, 2015
+ * Author: meggiman
+ */
+
+#ifndef GravityBOMB_H_
+#define GravityBOMB_H_
+
+#include "weapons/WeaponsPrereqs.h"
+
+#include "tools/Timer.h"
+
+#include "graphics/ParticleSpawner.h"
+#include "interfaces/RadarViewable.h"
+#include "objects/ForceField.h"
+#include "BasicProjectile.h"
+#include "worldentities/MovableEntity.h"
+#include "core/CoreIncludes.h"
+#include "objects/collisionshapes/SphereCollisionShape.h"
+#include "../../../orxonox/worldentities/WorldEntity.h"
+#include "GravityBombField.h"
+#include "sound\WorldSound.h"
+
+namespace orxonox
+{
+ /**
+ * @class GravityBomb
+ *
+ * @brief This class implements how long the bomb flies before it places the GravityField at it's last possition.
+ * The field will be created either because the timelimit of the bomb expired or it hit something. After creation of the field,
+ * the projectile (this object) is destroyed.
+ *
+ * @author Manuel Eggimann
+ * @date 23.05.2015
+ */
+ class _WeaponsExport GravityBomb : public BasicProjectile , public MovableEntity, public RadarViewable
+ {
+ public:
+ GravityBomb(Context* context);
+ virtual ~GravityBomb();
+ virtual void tick(float dt);
+
+ virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
+ void detonate();
+ private:
+ static const float LIFETIME;
+
+ bool isDetonated_; //Used to check whether the Bomb has to be destroyed during next tick.
+ float timeToLife_; //Time the bomb flies before it explodes.
+ WorldSound* bombSound_;
+ };
+}
+#endif /* GravityBOMB_H_ */
Copied: code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.cc (from rev 10485, code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBombField.cc)
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.cc (rev 0)
+++ code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.cc 2015-05-26 10:53:08 UTC (rev 10486)
@@ -0,0 +1,177 @@
+/*
+ * GravityBombField.cc
+ *
+ * Created on: Apr 2, 2015
+ * Author: Manuel Eggimann
+ */
+
+#include "GravityBombField.h"
+#include "graphics/Model.h"
+
+namespace orxonox{
+ RegisterClass(GravityBombField);
+
+ //Change these constants to alter the behaviour of the field.
+
+ const float GravityBombField::FORCE_FIELD_LIFETIME = 15;
+ const float GravityBombField::FORCE_SPHERE_START_RADIUS = 250;
+ const float GravityBombField::FORCE_SPHERE_START_STRENGTH = -500;
+ const float GravityBombField::PEAK_EXPLOSION_FORCE = 5e4;
+ const float GravityBombField::FORCE_FIELD_EXPLOSION_DAMMAGE = 100;
+ const float GravityBombField::EXPLOSION_DURATION = 1;
+ const float GravityBombField::EXPLOSION_RADIUS = 600;
+ const float GravityBombField::PEAK_ANGULAR_VELOCITY = 20;
+ const float GravityBombField::CENTRE_MODEL_END_SIZE = 1.5;
+
+ GravityBombField::GravityBombField(Context* context) : ForceField(context),RadarViewable(this, static_cast<WorldEntity*>(this))
+ {
+ RegisterObject(GravityBombField);
+ //Initialize variable with their initial values.
+ lifetime_=FORCE_FIELD_LIFETIME;
+ forceStrength_ = FORCE_SPHERE_START_STRENGTH;
+ forceSphereRadius_ = FORCE_SPHERE_START_RADIUS;
+ modelScaling_ = 1;
+ fieldExploded_ = false;
+
+ setVelocity(FORCE_SPHERE_START_STRENGTH);
+ setDiameter(2*FORCE_SPHERE_START_RADIUS);
+ setMode(modeSphere_s);
+ setCollisionResponse(false);
+
+ //Make the Field visible on Radar and minimap.
+ this->setRadarObjectColour(ColourValue(0.2, 0.2, 1.0,1)); // Blue
+ this->setRadarObjectShape(RadarViewable::Dot);
+ this->setRadarObjectScale(0.5f);
+
+
+ //Attach Model
+ Model* model = new Model(this->getContext());
+ model->setMeshSource("GravityBomb.mesh"); //Demo Model from SimpleRocket
+ model->scale(2.5f);
+ bombModel_ = new MovableEntity(context);
+ bombModel_->attach(model);
+ this->attach(bombModel_);
+
+ //Add a Backlight to the centre.
+ centreLight_ = new Backlight(context);
+ centreLight_->setColour(ColourValue(0.2,0.9,0.2,1));
+ centreLight_->setScale(0.3);
+ centreLight_->setTrailMaterial("Trail/backlighttrail");
+ centreLight_->setMaterial("Examples/Flare");
+ centreLight_->setLifetime(20);
+ bombModel_->attach(centreLight_);
+
+ //Let the Bomb Modell in the centre rotate in a random direction.
+ Vector3 randomRotation;
+ srand(time(NULL));
+ randomRotation.x = rand();
+ randomRotation.y = rand();
+ randomRotation.y = rand();
+ randomRotation.normalise();
+ bombModel_->setAngularAcceleration(randomRotation*(PEAK_ANGULAR_VELOCITY/FORCE_FIELD_LIFETIME));
+
+ //Add Collision Shape
+ SphereCollisionShape* collisionShape = new SphereCollisionShape(context);
+ collisionShape->setRadius(10.0);
+ this->attachCollisionShape(collisionShape);
+
+ //Add particle effect to visualize the force field.
+ this->particleSphere_ = new ParticleEmitter(this->getContext());
+ this->attach(this->particleSphere_);
+ particleSphere_->setSource("Orxonox/GravityBombField");
+
+ //Add a sound effect to the field.
+ WorldSound* fieldSound = new WorldSound(context);
+ fieldSound->setSource("sounds/GravityField.ogg");
+ fieldSound->setLooping(true);
+ fieldSound->setVolume(1.0);
+ this->attach(fieldSound);
+ fieldSound->play();
+ }
+
+ GravityBombField::~GravityBombField(){}
+
+
+ void GravityBombField::tick(float dt)
+ {
+ SUPER(GravityBombField,tick,dt);
+ lifetime_-=dt;
+
+ if(lifetime_ > EXPLOSION_DURATION)//If field is still alive, make it smaller and stronger.
+ {
+ modelScaling_ += ((CENTRE_MODEL_END_SIZE-1) / FORCE_FIELD_LIFETIME)*dt;
+ forceStrength_ *= (1+dt/10);
+ forceSphereRadius_ = FORCE_SPHERE_START_RADIUS*(1-((FORCE_FIELD_LIFETIME-lifetime_)/FORCE_FIELD_LIFETIME)*((FORCE_FIELD_LIFETIME-lifetime_)/FORCE_FIELD_LIFETIME)*((FORCE_FIELD_LIFETIME-lifetime_)/FORCE_FIELD_LIFETIME));
+ }
+ else if(lifetime_ > 0)
+ {
+ if (!fieldExploded_) // Start the field explosion if it has not been started yet.
+ {
+ forceStrength_ = pow((EXPLOSION_DURATION + lifetime_),4)/EXPLOSION_DURATION * PEAK_EXPLOSION_FORCE;
+ fieldExploded_ = true;
+
+ //Add particle effect to visualize explosion
+ explosionCross_ = new ParticleEmitter(this->getContext());
+ explosionCross_->setSource("Orxonox/FieldExplosion");
+ explosionCross_->setOrientation(rand(), rand(), rand(), rand());
+ explosionCross_->setScale(0.7);
+ this->attach(explosionCross_);
+
+ //Add explosion sound effect.
+ explosionSound_ = new WorldSound(getContext());
+ explosionSound_->setSource("sounds/GravityFieldExplosion.ogg");
+ explosionSound_->setVolume(1.0);
+ explosionSound_->play();
+ }
+
+ //Check if any pawn is inside the shockwave and hit it with dammage proportional to the distance between explosion centre and pawn. Make sure, the same pawn is damaged only once.
+ for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+ {
+ Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();
+ //orxout(debug_output) << "Found Pawn:" << it->getWorldPosition() << endl;
+ if(distanceVector.length()< forceSphereRadius_)
+ {
+ //orxout(debug_output) << "Force sphere radius is: " << forceSphereRadius_ << " Distance to Pawn is: " << distanceVector.length();
+ if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),*it) == victimsAlreadyDamaged_.end())
+ {
+ //orxout(debug_output) << "Found Pawn to damage: " << it->getWorldPosition() << endl;
+ float damage = FORCE_FIELD_EXPLOSION_DAMMAGE*(1-distanceVector.length()/EXPLOSION_RADIUS);
+ //orxout(debug_output) << "Damage: " << damage << endl;
+ it->hit(shooter_, it->getWorldPosition(), NULL, damage, 0,0);
+ victimsAlreadyDamaged_.push_back(*it);
+ }
+ }
+ }
+
+ forceSphereRadius_ = EXPLOSION_RADIUS*(1-lifetime_/EXPLOSION_DURATION);
+ explosionCross_->setScale(forceSphereRadius_/FORCE_SPHERE_START_RADIUS);
+ }
+ else if (lifetime_ > -6) //The field has to exist for 6 more seconds for the particles of the particle effect to vanish smoothly.
+ {
+ //Make the bomb model invisible, let the strength of the field be zero and remove all particle emitters so the particle effect will slowly vanish.
+ bombModel_->setVisible(false);
+ this->setRadarVisibility(false);
+ forceStrength_ = 0;
+ forceSphereRadius_ = 0.00001;
+ particleSphere_->getParticleInterface()->removeAllEmitters();
+ explosionCross_->getParticleInterface()->removeAllEmitters();
+ }
+
+ setDiameter(forceSphereRadius_*2);
+ setVelocity(forceStrength_);
+ if(lifetime_>0) particleSphere_->setScale(forceSphereRadius_/FORCE_SPHERE_START_RADIUS);
+ bombModel_->setScale(modelScaling_);
+
+ if (lifetime_ <= -4)
+ {
+ orxout(debug_output) << "Timeout. Destroying field." << endl;
+ this->destroy();
+ }
+ }
+
+ void GravityBombField::destroy()
+ {
+ ForceField::destroy();
+ }
+
+}
Copied: code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.h (from rev 10485, code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBombField.h)
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.h (rev 0)
+++ code/branches/presentationFS15/src/modules/weapons/projectiles/GravityBombField.h 2015-05-26 10:53:08 UTC (rev 10486)
@@ -0,0 +1,90 @@
+/*
+ * GravityBombField.h
+ *
+ * Created on: Apr 2, 2015
+ * Author: meggiman
+ */
+
+#ifndef GRAVITYBOMBFIELD_H_
+#define GRAVITYBOMBFIELD_H_
+
+#include "graphics/ParticleSpawner.h"
+#include "interfaces/RadarViewable.h"
+#include "objects/ForceField.h"
+#include "BasicProjectile.h"
+#include "worldentities/MovableEntity.h"
+#include "core/CoreIncludes.h"
+#include "GravityBomb.h"
+#include "graphics/ParticleSpawner.h"
+#include "tools/ParticleInterface.h"
+#include <stdlib.h>
+#include <time.h>
+#include <math.h>
+#include "graphics/Backlight.h"
+#include "sound\WorldSound.h"
+
+namespace orxonox {
+
+/**
+ * @class GravityBombField
+ *
+ * @brief This class is used by GravityBomb to place the ForceField and Visual effect to the environment.
+ * The field has a maximum lifetime and gets smaller and stronger the more time passes. In the end, the field explodes and damages all pawns nearby.
+ *
+ * @author Manuel Eggimann
+ * @date 23.05.2015
+ */
+class GravityBombField: public ForceField, public RadarViewable {
+public:
+ GravityBombField(Context* context);
+ virtual ~GravityBombField();
+ virtual void tick(float dt);
+ virtual void destroy();
+
+ /**
+ * @fn void GravityBombField::setShooter(Pawn* shooter)
+ *
+ * @brief This function is used to determine save the pawn who created the field and is used inside the GravityBomb class.
+ *
+ * @author Manuel Eggimann
+ * @date 23.05.2015
+ *
+ * @param [in,out] the Pawn that created the field.
+ */
+ void setShooter(Pawn* shooter)
+ { this->shooter_ = shooter; }
+
+ Pawn* getShooter()
+ { return this->shooter_; }
+
+private:
+ //Set these constants inside GravityBombField.cc to alter the behaviour of the field.
+
+ static const float FORCE_FIELD_LIFETIME; ///< The lifetime of the ForceField in seconds. After lifetime seconds, has already exploded and the particle effects will start to vanish.
+ static const float FORCE_SPHERE_START_RADIUS; ///< The initial sphere radius of the Force Field. The forcefield gets smaller by time.
+ static const float FORCE_SPHERE_START_STRENGTH; ///< The initial Force the Field exerts on every object with non-zero mass.
+ static const float FORCE_FIELD_EXPLOSION_DAMMAGE; ///< The maximum dammage a pawn gets nearby an exploding field. The farer away from explosion center the smaller the dammage.
+ static const float EXPLOSION_DURATION; ///< Determines how fast the shockwave of the Explosion expands. It takes GravityBombField::EXPLOSION_DURATION seconds for the field to expand from 0 radius to GravityBombField::EXPLOSION_RADIUS.
+ static const float EXPLOSION_RADIUS; ///< How far does the shockwave reach. All pawns which outside of a sphere witch this radius rest unharmed by the explosion.
+ static const float PEAK_ANGULAR_VELOCITY; ///< The model of the bomb in the center of the Field does rotate faster and faster as time passes until it reaches PEAK_ANGULAR_VELOCITY at the fields end of life.
+ static const float PEAK_EXPLOSION_FORCE; ///< The peak force the explosion exerts on the pawns nearby.
+ static const float CENTRE_MODEL_END_SIZE; ///< Size of the 3d-model of the bomb in the fields centre.
+
+ float forceSphereRadius_;
+ float forceStrength_;
+ float lifetime_;
+ float modelScaling_;
+ Vector3 rotationVector_;
+ bool fieldExploded_;
+ ParticleEmitter * particleSphere_;
+ ParticleEmitter * explosionCross_;
+ std::vector<Pawn*> victimsAlreadyDamaged_;
+ MovableEntity * bombModel_;
+ Pawn* shooter_;
+ Backlight* centreLight_;
+ WorldSound* explosionSound_;
+};
+
+}
+#endif /* GRAVITYBOMBFIELD_H_ */
+
Modified: code/branches/presentationFS15/src/modules/weapons/projectiles/LightningGunProjectile.cc
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/projectiles/LightningGunProjectile.cc 2015-05-26 10:40:33 UTC (rev 10485)
+++ code/branches/presentationFS15/src/modules/weapons/projectiles/LightningGunProjectile.cc 2015-05-26 10:53:08 UTC (rev 10486)
@@ -46,6 +46,8 @@
RegisterObject(LightningGunProjectile);
this->textureIndex_ = 1;
+ this->setMass(2);
+ this->setCollisionType(Dynamic);
this->maxTextureIndex_ = 8;
this->textureTimer_.setTimer(0.01f, true, createExecutor(createFunctor(&LightningGunProjectile::changeTexture, this)));
Modified: code/branches/presentationFS15/src/modules/weapons/weaponmodes/CMakeLists.txt
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/weaponmodes/CMakeLists.txt 2015-05-26 10:40:33 UTC (rev 10485)
+++ code/branches/presentationFS15/src/modules/weapons/weaponmodes/CMakeLists.txt 2015-05-26 10:53:08 UTC (rev 10486)
@@ -7,4 +7,5 @@
RocketFire.cc
RocketFireOld.cc
SimpleRocketFire.cc
+ GravityBombFire.cc
)
Copied: code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc (from rev 10485, code/branches/weaponFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc)
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc (rev 0)
+++ code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.cc 2015-05-26 10:53:08 UTC (rev 10486)
@@ -0,0 +1,56 @@
+/*
+ * GravityBombFire.cc
+ *
+ * Created on: Apr 16, 2015
+ * Author: Manuel Eggimann
+ */
+#include "GravityBombFire.h"
+
+#include "core/CoreIncludes.h"
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/WeaponSystem.h"
+#include "worldentities/pawns/Pawn.h"
+
+#include "weapons/projectiles/GravityBomb.h"
+
+namespace orxonox
+{
+ RegisterClass(GravityBombFire);
+
+ const float GravityBombFire::BOMB_VELOCITY = 400.0; ///< The velocity of the bomb after launch
+
+ GravityBombFire::GravityBombFire(Context* context) : WeaponMode(context)
+ {
+ RegisterObject(GravityBombFire);
+
+ this->reloadTime_ = 0.50f;
+ this->bParallelReload_ = false;
+ this->damage_ = 20.0f; ///< The damage of the Bomb if it hits a pawn.
+
+ this->setMunitionName("GravityBombMunition");
+ this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.8); ///< sets sound of the bomb as it is fired.
+ }
+
+ GravityBombFire::~GravityBombFire(){};
+
+ void GravityBombFire::fire()
+ {
+ GravityBomb* bomb = new GravityBomb(this->getContext());
+ //Create a new Bomb in 3D-Space and set the right direction speed and orientation.
+ this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
+ bomb->setOrientation(this->getMuzzleOrientation());
+ bomb->setPosition(this->getMuzzlePosition());
+ bomb->setVelocity(this->getMuzzleDirection() * (this->BOMB_VELOCITY+this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getVelocity().length()));
+
+ //Set the shooter of the bomb so it is possible to determine the pawn that killed another one and define damage to shield and healt the bomb does.
+ bomb->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+ bomb->setDamage(this->getDamage());
+ bomb->setShieldDamage(this->getShieldDamage());
+ bomb->setHealthDamage(this->getHealthDamage());
+ }
+
+
+}
+
+
Copied: code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.h (from rev 10485, code/branches/weaponFS15/src/modules/weapons/weaponmodes/GravityBombFire.h)
===================================================================
--- code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.h (rev 0)
+++ code/branches/presentationFS15/src/modules/weapons/weaponmodes/GravityBombFire.h 2015-05-26 10:53:08 UTC (rev 10486)
@@ -0,0 +1,43 @@
+/*
+* GravityBombFire.h
+*
+* Created on: Apr 16, 2015
+* Author: Manuel Eggimann
+*/
+
+/**
+ @file GravityBombFire.h
+ @brief Definition of the GravityBombFire class.
+*/
+
+#ifndef _GravityBombFire_H__
+#define _GravityBombFire_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weaponsystem/WeaponMode.h"
+
+namespace orxonox
+{
+
+ /**
+ *@brief
+ * Fires the GravityBomb. This class implements everything needed to fire the BasicProjectile GravityBomb.
+ * Everything that has to do with the bombs behaviour after launching it is implemented in GravityBomb and GravityBombField.
+ *@author
+ * Manuel Eggimann
+ *@ingroup WeaponsWeaponModes
+ */
+ class _WeaponsExport GravityBombFire : public WeaponMode
+ {
+ public:
+ GravityBombFire(Context* context);
+ virtual ~GravityBombFire();
+
+ virtual void fire();
+
+ private:
+ static const float BOMB_VELOCITY; //!< The initial speed of the bomb when it is launched.
+ };
+}
+
+#endif /* _GravityBombFire_H__ */
More information about the Orxonox-commit
mailing list