[Orxonox-commit 4857] r9526 - in code/trunk: . data/defaultConfig data/levels data/levels/includes data/levels/templates data/overlays src/modules/gametypes src/modules/objects src/modules/overlays src/modules/overlays/hud src/modules/portals src/modules/weapons/weaponmodes src/orxonox/interfaces
jo at orxonox.net
jo at orxonox.net
Tue Feb 19 10:25:43 CET 2013
Author: jo
Date: 2013-02-19 10:25:42 +0100 (Tue, 19 Feb 2013)
New Revision: 9526
Added:
code/trunk/data/levels/bigshipPresentation.oxw
code/trunk/data/levels/collateralDamageDemo.oxw
code/trunk/data/levels/includes/weaponSettingsCollateral.oxi
code/trunk/data/levels/includes/weaponSettingsTurret.oxi
code/trunk/data/levels/includes/weaponSettingsbigship.oxi
code/trunk/data/levels/presentationHS12.oxw
code/trunk/data/levels/templates/bigship.oxt
code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt
code/trunk/data/levels/templates/spaceshipTurret.oxt
code/trunk/data/levels/turretTest.oxw
code/trunk/src/modules/gametypes/SpaceRaceBot.cc
code/trunk/src/modules/gametypes/SpaceRaceBot.h
code/trunk/src/modules/gametypes/SpaceRaceController.cc
code/trunk/src/modules/gametypes/SpaceRaceController.h
code/trunk/src/modules/objects/Turret.cc
code/trunk/src/modules/objects/Turret.h
Modified:
code/trunk/
code/trunk/data/defaultConfig/keybindings.ini
code/trunk/data/levels/gallery.oxw
code/trunk/data/levels/includes/weaponSettingsEscort.oxi
code/trunk/data/levels/pong.oxw
code/trunk/data/levels/templates/lodInformation.oxt
code/trunk/data/levels/templates/spaceshipEscort.oxt
code/trunk/data/overlays/HUD.oxo
code/trunk/data/overlays/HUDTemplates3.oxo
code/trunk/src/modules/gametypes/CMakeLists.txt
code/trunk/src/modules/gametypes/GametypesPrereqs.h
code/trunk/src/modules/gametypes/RaceCheckPoint.cc
code/trunk/src/modules/gametypes/RaceCheckPoint.h
code/trunk/src/modules/gametypes/SpaceRace.cc
code/trunk/src/modules/gametypes/SpaceRaceManager.cc
code/trunk/src/modules/gametypes/SpaceRaceManager.h
code/trunk/src/modules/objects/CMakeLists.txt
code/trunk/src/modules/objects/ObjectsPrereqs.h
code/trunk/src/modules/overlays/OverlaysPrereqs.h
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
code/trunk/src/modules/overlays/hud/HUDNavigation.h
code/trunk/src/modules/portals/PortalEndPoint.cc
code/trunk/src/modules/portals/PortalEndPoint.h
code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
code/trunk/src/modules/weapons/weaponmodes/HsW01.h
code/trunk/src/orxonox/interfaces/RadarViewable.cc
code/trunk/src/orxonox/interfaces/RadarViewable.h
Log:
Merging presentationHS12 back to the trunk.
Property changes on: code/trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /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/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/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/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/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/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/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/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/steering:5949-6091,8140-8595
/code/branches/surfaceRace:9028-9199
/code/branches/tetris:8100-8563
/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/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/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/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/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/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/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/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/steering:5949-6091,8140-8595
/code/branches/surfaceRace:9028-9199
/code/branches/tetris:8100-8563
/code/branches/turret:9380-9501
/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
Modified: code/trunk/data/defaultConfig/keybindings.ini
===================================================================
--- code/trunk/data/defaultConfig/keybindings.ini 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/data/defaultConfig/keybindings.ini 2013-02-19 09:25:42 UTC (rev 9526)
@@ -54,7 +54,7 @@
KeyLeftAlt=
KeyLeftBracket=
KeyLeftControl=mouseLook
-KeyLeftShift=
+KeyLeftShif
KeyLeftWindows=
KeyLessThan=
KeyM=
@@ -140,10 +140,10 @@
KeyWebRefresh=
KeyWebSearch=
KeyWebStop=
-KeyX=
+KeyX="selectClosest"
KeyY=
KeyYen=
-KeyZ=
+KeyZ="selectNext"
[MouseButtons]
Button3=
Copied: code/trunk/data/levels/bigshipPresentation.oxw (from rev 9525, code/branches/presentationHS12/data/levels/bigshipPresentation.oxw)
===================================================================
--- code/trunk/data/levels/bigshipPresentation.oxw (rev 0)
+++ code/trunk/data/levels/bigshipPresentation.oxw 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,34 @@
+<LevelInfo
+ name = "bigship Presentation"
+ description = "A level with absolutely nothing in it."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/bigship.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=bigship />
+
+ </Scene>
+</Level>
+
Copied: code/trunk/data/levels/collateralDamageDemo.oxw (from rev 9525, code/branches/presentationHS12/data/levels/collateralDamageDemo.oxw)
===================================================================
--- code/trunk/data/levels/collateralDamageDemo.oxw (rev 0)
+++ code/trunk/data/levels/collateralDamageDemo.oxw 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,36 @@
+<LevelInfo
+ name = "Collateral Damage Demo"
+ description = " "
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipCollateralDamage.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=spaceshipcollateraldamage />
+
+ </Scene>
+</Level>
+
Modified: code/trunk/data/levels/gallery.oxw
===================================================================
--- code/trunk/data/levels/gallery.oxw 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/data/levels/gallery.oxw 2013-02-19 09:25:42 UTC (rev 9526)
@@ -67,7 +67,7 @@
<!--Model position="0,0,-40" yaw="90" pitch="-90" roll="0" scale="1" mesh="stunweapon.mesh" /-->
<Model position="0,20,-40" yaw="90" pitch="-90" roll="0" scale="2" mesh="LightningGun.mesh" />
<Model position="0,40,-40" yaw="90" pitch="-90" roll="0" scale="2" mesh="LightningGun-s.mesh" />
- <Model position="0,60,-40" yaw="90" pitch="-90" roll="0" scale="1.5" mesh="laserbeam.mesh" />
+ <Model position="0,60,-40" yaw="90" pitch="-90" roll="0" scale="1.5" mesh="LaserBeam.mesh" />
<Model position="0,80,-40" yaw="90" pitch="-90" roll="0" scale="2" mesh="rocket.mesh" />
<Model position="0,-20,-40" yaw="90" pitch="-90" roll="0" scale="5" mesh="hs-w01.mesh" />
<Model position="0,-40,-40" yaw="90" pitch="-90" roll="0" scale="5" mesh="hs-w01s.mesh" />
Copied: code/trunk/data/levels/includes/weaponSettingsCollateral.oxi (from rev 9525, code/branches/presentationHS12/data/levels/includes/weaponSettingsCollateral.oxi)
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsCollateral.oxi (rev 0)
+++ code/trunk/data/levels/includes/weaponSettingsCollateral.oxi 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,47 @@
+ <weaponslots>
+ <WeaponSlot position="-15.0,-1.5,0" />
+ <WeaponSlot position=" 15.0,-1.5,0" />
+ <WeaponSlot position=" 0, 0,0" />
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ <WeaponSet firemode=1 />
+ <WeaponSet firemode=2 />
+ <WeaponSet firemode=3 />
+ </weaponsets>
+ <weapons>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+ <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
+ <DefaultWeaponmodeLink firemode=3 weaponmode=3 />
+ </links>
+
+ <Weapon>
+ <attached>
+ <!--Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="5,-1.3,0" /--> <!-- ROCKET LAUNCHER -->
+ <!--Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" /--> <!-- THING BETWEEN -->
+ <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="90" yaw="-90" position="-1.5, 1, -0.3" scale=0.6 /> <!-- MACHINE GUN -->
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+ </Weapon>
+
+ <Weapon>
+ <attached>
+ <!--Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" /-->
+ <!--Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" /-->
+ <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="90" yaw="-90" position="1.8, 1, -0.3" scale=0.6 /> <!-- MACHINE GUN -->
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+ </Weapon>
+ <Weapon>
+ <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ </Weapon>
+ </WeaponPack>
+ </weapons>
Modified: code/trunk/data/levels/includes/weaponSettingsEscort.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsEscort.oxi 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/data/levels/includes/weaponSettingsEscort.oxi 2013-02-19 09:25:42 UTC (rev 9526)
@@ -13,24 +13,12 @@
<DefaultWeaponmodeLink firemode=1 weaponmode=1 />
</links>
<Weapon>
- <attached>
- <!--Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,0,0" />
- <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
- <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 /-->
- </attached>
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
- <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="LaserBeam.mesh" />
+ <!--HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" projectileMesh="LaserBeam.mesh" /-->
</Weapon>
<Weapon>
- <attached>
- <!--Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,0,0" />
- <Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
- <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 /-->
- </attached>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
- <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam.mesh" />
+ <!--HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" projectileMesh="LaserBeam.mesh" /-->
</Weapon>
</WeaponPack>
<WeaponPack>
Copied: code/trunk/data/levels/includes/weaponSettingsTurret.oxi (from rev 9525, code/branches/presentationHS12/data/levels/includes/weaponSettingsTurret.oxi)
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsTurret.oxi (rev 0)
+++ code/trunk/data/levels/includes/weaponSettingsTurret.oxi 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,22 @@
+ <weaponslots>
+ <WeaponSlot position="0,0,0" />
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ </weaponsets>
+ <weapons>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ </links>
+ <Weapon>
+ <attached>
+ <Model mesh="sphere.mesh" position="3,3,-2.2" scale=0.6 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 3, 3,-2.2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 3,-3,-2.2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-3, 3,-2.2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-3,-3,-2.2" />
+ </Weapon>
+ </WeaponPack>
+ </weapons>
Copied: code/trunk/data/levels/includes/weaponSettingsbigship.oxi (from rev 9525, code/branches/presentationHS12/data/levels/includes/weaponSettingsbigship.oxi)
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsbigship.oxi (rev 0)
+++ code/trunk/data/levels/includes/weaponSettingsbigship.oxi 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,48 @@
+ <weaponslots>
+ <WeaponSlot position="-1.5,-5,-3" />
+ <WeaponSlot position=" 1.5,-5,-3" />
+ <WeaponSlot position=" 0, 0,0" />
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ <WeaponSet firemode=1 />
+ <WeaponSet firemode=2 />
+ <WeaponSet firemode=3 />
+ </weaponsets>
+ <weapons>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+ <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
+ <DefaultWeaponmodeLink firemode=3 weaponmode=3 />
+ </links>
+ <Weapon>
+ <attached>
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+ </Weapon>
+ <Weapon>
+ <attached>
+
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+ </Weapon>
+ <Weapon>
+ <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ </Weapon>
+ </WeaponPack>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+ </links>
+ <!--Weapon>
+ <EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
+ </Weapon-->
+ </WeaponPack>
+ </weapons>
Modified: code/trunk/data/levels/pong.oxw
===================================================================
--- code/trunk/data/levels/pong.oxw 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/data/levels/pong.oxw 2013-02-19 09:25:42 UTC (rev 9526)
@@ -92,7 +92,7 @@
<!-- TODO: Create a Pong Score Sound and include it here.
This WorldSound works, but doesn't make sense, since it is played together with ambient/moodDependedDirectory/Ganymede.ogg -->
- <!--WorldSound name="scoreSound" position="0,0,0" source="ambient/default/Earth.ogg" >
+ <!--WorldSound name="scoreSound" position="0,0,0" source="sounds/PongScore_cut.ogg" >
<events>
<play>
<EventListener event=pongcenter />
Copied: code/trunk/data/levels/presentationHS12.oxw (from rev 9525, code/branches/presentationHS12/data/levels/presentationHS12.oxw)
===================================================================
--- code/trunk/data/levels/presentationHS12.oxw (rev 0)
+++ code/trunk/data/levels/presentationHS12.oxw 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,501 @@
+<!-- NEW FEATURES:
+- Three new Spaceships: collateralDamage; planetDestroyer; lightEscortship;
+- Shaders (not included here, since the ogre plugin is missing on Ubuntu)
+- Sound Effects (not included)
+- Animation (not included)
+- HUD aiming assistant
+- Turret
+- Racing Bots
+-->
+<LevelInfo
+ name = "Presentation HS 2012"
+ description = "New Features: new Spaceships, Racing AI, HUD Aiming Assistant, Turret, Shaders, Sound Effects"
+ tags = "presentation"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+ include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipEscort.oxt")
+ include("templates/bigship.oxt")
+ include("templates/spaceshipTurret.oxt")
+ include("templates/spaceshipCollateralDamage.oxt")
+?>
+
+<Level
+ gametype = SpaceRace
+>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <NotificationQueueCEGUI
+ name="narrative"
+ targets="simpleNotification"
+ size=1
+ displayTime=30
+ position="0.2, 0, 0.1, 0"
+ fontSize="24"
+ fontColor="0.3, 1, 0.2, 0.8"
+ alignment="HorzCentred"
+ displaySize="0.6, 0, 0, 0"
+ />
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/skyBoxMoreNebula"
+ > <!-- Orxonox/Starbox -->
+ <?lua
+ include("includes/pickups.oxi")
+ ?>
+
+ <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="-900,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+ <!--SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=bigship /-->
+ <!--SpawnPoint team=0 position="-900,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipcollateraldamage /-->
+ <!--SpawnPoint team=0 position="6000,0,2000" lookat="1,1,0" spawnclass=SpaceShip pawndesign=spaceshipcollateraldamage /-->
+
+ <SpaceRaceManager>
+ <checkpoints>
+ <RaceCheckPoint name="checkpoint1" position="000,0,0" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="0" islast="false" nextcheckpoints="1,2,3">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+ </attached>
+ </RaceCheckPoint>
+<!--- first three alternative paths --->
+ <RaceCheckPoint name="checkpoint2" position="1300,0,-800" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="1" islast="false" nextcheckpoints="7,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90/>
+ </attached>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint3" position="1200,-400,0" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="2" islast="false" nextcheckpoints="4,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+ </attached>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint4" position="1200,100,700" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="3" islast="false" nextcheckpoints="5,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+ </attached>
+ </RaceCheckPoint>
+
+<!--- second three alternative paths --->
+ <RaceCheckPoint name="checkpoint5" position="2000,0,0" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="4" islast="false" nextcheckpoints="7,8,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+ </attached>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint6" position="2000,-500,400" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="5" islast="false" nextcheckpoints="9,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+ </attached>
+ </RaceCheckPoint>
+
+
+<!--- third generation --->
+
+ <RaceCheckPoint name="checkpoint7" position="5000,0,-3000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="6" islast="false" nextcheckpoints="11,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=135 />
+ </attached>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint8" position="3500,800,0" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="7" islast="false" nextcheckpoints="10,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+ </attached>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint9" position="3500,-800,0" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="8" islast="false" nextcheckpoints="10,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+ </attached>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint10" position="3500,0,1000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="9" islast="false" nextcheckpoints="11,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+ </attached>
+ </RaceCheckPoint>
+
+<!-- Intermediate Solo Gate -->
+ <RaceCheckPoint name="checkpoint11" position="4500,0,-100" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="10" islast="false" nextcheckpoints="11,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=90 />
+ </attached>
+ </RaceCheckPoint>
+
+<!---- First Common Point ---->
+ <RaceCheckPoint name="checkpoint12" position="6000,0,2000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="11" islast="false" nextcheckpoints="12,14,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=45 />
+ </attached>
+ </RaceCheckPoint>
+
+<!-- Two Paths (1) -->
+ <RaceCheckPoint name="checkpoint13" position="7500,-1500,2500" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="12" islast="false" nextcheckpoints="14,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=130 roll=1 />
+ </attached>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint14" position="7500,-1500,1500" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="13" islast="false" nextcheckpoints="15,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=90 />
+ </attached>
+ </RaceCheckPoint>
+
+<!-- Two Paths (2) -->
+ <RaceCheckPoint name="checkpoint15" position="9000,-3000, 3000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="14" islast="false" nextcheckpoints="16,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=130 roll=1 />
+ </attached>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint16" position="9000,-3000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="15" islast="false" nextcheckpoints="16,-1,-1">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=110 />
+ </attached>
+ </RaceCheckPoint>
+
+<!-- GOAL -->
+ <RaceCheckPoint name="checkpoint17" position="12000,-4000,2000" direction="0,-1,1" collisionType="static" scale="1" distance="100" checkpointindex="16" islast="true">
+ <attached>
+ <Model mass="50" scale="6" mesh="BigSpacegate.mesh" yaw=100 pitch=135 />
+ </attached>
+ </RaceCheckPoint>
+ </checkpoints>
+ </SpaceRaceManager>
+
+
+<!-- Simplify paths -->
+ <!-- PORTALS -->
+
+ <Template name=PortalDefault>
+ <PortalEndPoint>
+ <attached>
+ <Billboard material="Portals/Default" scale="3"/>
+ </attached>
+ </PortalEndPoint>
+ </Template>
+
+ <PortalEndPoint position="2000,0,-1000" id="3" distance="60" target="MobileEntity" design="PortalDefault" />
+ <PortalEndPoint position="4500,0,-3400" id="4" distance="60" target="MobileEntity" design="PortalDefault" />
+ <PortalLink fromID="3" toID="4" />
+ <PortalLink fromID="4" toID="3" />
+
+
+ <!-- ForceField -->
+800,400,0
+ <ForceField position="1200,-400,0" direction="8,4,0" diameter=500 velocity=2000 length=500 />
+ <MovableEntity position="1200,-400,0">
+ <attached>
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.1,0.1,0.1" scale=1/>
+ <?lua for i=0,4,1 do ?>
+ <Billboard position="<?lua print(i*200) ?>,<?lua print(i*100) ?>,-100" material="Examples/Flare" colour="0.1,0.1,0.1" scale=1/>
+ <Billboard position="<?lua print(i*200) ?>,<?lua print(i*100) ?>,100" material="Examples/Flare" colour="0.1,0.1,0.1" scale=1/>
+ <?lua end ?>
+ </attached>
+ </MovableEntity>
+
+
+ <!-- Pickup -->
+ <PickupSpawner pickup=smallspeedpickup position="5300,0,-2300" triggerDistance="60" respawnTime="10" maxSpawnedItems="99" scale="12" />
+
+
+<!--- SCENERY --->
+ <!-- @Objects: HYDROGEN FARMER-->
+ <StaticEntity position="5700,0,-3700" mass=10000 >
+ <attached>
+ <Model mesh="HydroHarvester.mesh" mass=10 position="0,0,0" scale=50 />
+ <ParticleEmitter position="0,0,0" source="Orxonox/ThrusterFire" scale=1.2 />
+ <!-- <Model mesh="cube.mesh" mass=10 position="-560,0,0" scale3D="115,100,245" />
+ <Model mesh="cube.mesh" mass=10 position="290,0,-480" scale3D="115,100,245" yaw=-120 />
+ <Model mesh="cube.mesh" mass=10 position="290,0,480" scale3D="115,100,245" yaw=-240 />
+ <Model mesh="cube.mesh" mass=10 position="-280,0,0" scale3D="163,50,50" />
+ <Model mesh="cube.mesh" mass=10 position="140,0,-240" scale3D="163,50,50" yaw=-120/>
+ <Model mesh="cube.mesh" mass=10 position="140,0,240" scale3D="163,50,50" yaw=-240/>
+ <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" />
+ <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" yaw=-120/>
+ <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" yaw=-240/>
+ <Model mesh="cube.mesh" mass=10 position="0,400,0" scale3D="43,110,26" yaw=-30 />
+ <Model mesh="cube.mesh" mass=10 position="-200,100,0" scale3D="26,50,43" />
+ <Model mesh="cube.mesh" mass=10 position="100,100,-173" scale3D="43,50,26" yaw=-30/>
+ <Model mesh="cube.mesh" mass=10 position="100,100,173" scale3D="43,50,26" yaw=30/>
+ <Model mesh="cube.mesh" mass=10 position="-100,264,0" scale3D="26,105,43" roll=-49/>
+ <Model mesh="cube.mesh" mass=10 position="50,264,-87" scale3D="26,105,43" roll=-49 yaw=-120/>
+ <Model mesh="cube.mesh" mass=10 position="50,264,87" scale3D="26,105,43" roll=-49 yaw=-240/> -->
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
+ <BoxCollisionShape position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
+ <BoxCollisionShape position="290,0,480" halfExtents="115,100,245" yaw=-240 />
+ <BoxCollisionShape position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
+ <BoxCollisionShape position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
+ <BoxCollisionShape position="140,0,240" halfExtents="163,50,50" yaw=-240 />
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-120 />
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-240 />
+ <BoxCollisionShape position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
+ <BoxCollisionShape position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
+ <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
+ <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=30 />
+ <BoxCollisionShape position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
+ <BoxCollisionShape position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
+ <BoxCollisionShape position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
+ </collisionShapes>
+ </StaticEntity>
+
+ <StaticEntity position="2800,0,0" mass=10000 pitch=0 roll=45 yaw=240 >
+ <attached>
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsBody.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsDuseL.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsDuseR.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsKuppelV.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsKuppelK.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsAntL.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsAntR.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsGarage.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=40 mesh="bsStation.mesh" />
+
+ <BlinkingBillboard position="20,-24,160" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="-20,-24,160" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="20,-25,190" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=40 quadratic=1 />
+ <BlinkingBillboard position="-20,-25,190" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=40 quadratic=1 />
+ <BlinkingBillboard position="20,-25,220" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=80 quadratic=0 />
+ <BlinkingBillboard position="-20,-25,220" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=80 quadratic=0 />
+ <BlinkingBillboard position="20,-26,250" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=120 quadratic=0 />
+ <BlinkingBillboard position="-20,-26,250" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=120 quadratic=0 />
+ <BlinkingBillboard position="20,-26,28" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=160 quadratic=0 />
+ <BlinkingBillboard position="-20,-26,28" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=160 quadratic=0 />
+ <BlinkingBillboard position="29,-35,142" material="Examples/Flare" colour="1, 0.4, 0.4, 0.1" amplitude=0.2 frequency=30 phase=0 quadratic=0 />
+ <BlinkingBillboard position="-29,-35,142" material="Examples/Flare" colour="1, 0.4, 0.4, 0.1" amplitude=0.2 frequency=30 phase=0 quadratic=0 />
+ </attached>
+ </StaticEntity>
+
+ <!-- Docking -->
+ <Dock position="2830,20,50" roll=0 yaw=0 >
+ <animations>
+ <MoveToDockingTarget target="destroyer" />
+ </animations>
+ <effects>
+ <DockToShip target="spaceShip" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockMe" />
+ </execute>
+ <activity>
+ <EventListener event=notGameEnd />
+ </activity>
+ </events>
+ <attached>
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 />
+ <BlinkingBillboard position="10,0,0" material="Examples/Flare" colour="1, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="20,0,0" material="Examples/Flare" colour="1, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="30,0,0" material="Examples/Flare" colour="1, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="0,10,0" material="Examples/Flare" colour="0.3, 1, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="0,20,0" material="Examples/Flare" colour="0.3, 1, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="0,30,0" material="Examples/Flare" colour="0.3, 1, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="0,0,10" material="Examples/Flare" colour="0.3, 0.3, 1, 1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="0,0,20" material="Examples/Flare" colour="0.3, 0.3, 1, 1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="0,0,30" material="Examples/Flare" colour="0.3, 0.3, 1, 1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+ <DistanceTrigger position="0,0,0" distance="200" target="Pawn"
+ beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
+ />
+ </attached>
+
+ </Dock>
+ <SpaceShip
+ template = "spaceshipcollateraldamage"
+ team = "0"
+ position = "2890,-40,6"
+ orientation = "-0.14, 0.68, 0.68, 0.223"
+ lookat = "0,0,0"
+ roll = "180"
+ name = "collateralDamage"
+ radarname = "Collateral Damage" >
+ <!--
+ pitch = "90"
+ yaw = "0"-->
+ <attached>
+ <DockingTarget name="spaceShip" />
+ <DistanceTriggerBeacon name="bcnDestroyer" />
+ <DockingTarget name="destroyer" />
+ </attached>
+ </SpaceShip>
+
+ <!-- triple large belt around the planet -->
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 7190, 7800, 250, 1)
+ ?>
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 10000, 11000, 300, 1)
+ ?>
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
+ ?>
+
+ <Planet
+ position="15000,0,-1000"
+ scale="5000"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="10000000"
+ pitch="0"
+ mesh="planets/ganymede.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage = 2
+ enablecollisiondamage = true
+ >
+ <attached>
+ <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="5000" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
+
+<StaticEntity position="6750,-750,2000" yaw=0 pitch=0>
+ <attached>
+ <Model position="0,0,0" mesh="turretSocketFront.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketIn.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketTop.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketLeft.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketRight.mesh" scale3D="10,10,10" />
+ </attached>
+</StaticEntity>
+<SpaceShip position="6750,-740,2000" pitch="90" yaw="0" roll="0" radarname="Automatic Turret">
+ <templates>
+ <Template link=spaceshipturret />
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=1000 team=10>
+ </WaypointPatrolController>
+ </controller>
+</SpaceShip>
+
+
+ <!--- Some Randomn Asteroids --->
+ <?lua
+ for i = 1, 250, 1
+ do
+ j = math.random()
+ ?>
+
+ <MovableEntity
+ position = "<?lua print(math.random()* 15000 - 1000) ?>,<?lua print(math.random() * 12000 - 4000) ?>,<?lua print(math.random() * 12000 - 4000) ?>"
+ collisionType = dynamic
+ linearDamping = 0.8
+ angularDamping = 0
+ scale = "<?lua print(j * 150)?>"
+ collisiondamage = 1
+ enablecollisiondamage = true
+ >
+ <attached>
+ <Model mass="<?lua print(j * 1000) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="<?lua print(j * 350) ?>" />
+ </collisionShapes>
+ </MovableEntity>
+
+ <?lua
+ end
+ ?>
+
+
+
+
+
+
+<!-- INTERACTIVE PART -->
+ <DistanceTrigger name="start" position="-900,0,0" target="Pawn" distance=100 stayActive="true" delay=0.5 />
+ <DistanceTrigger name="spawnBots" position="-900,0,0" target="Pawn" distance=100 stayActive="true" delay=4.5 />
+ <DistanceTrigger name="creditPetar" position="2000,0,0" target="Pawn" distance=100 stayActive="true" delay=0.5 />
+ <DistanceTrigger name="creditDario" position="4500,0,-100" target="Pawn" distance=200 stayActive="true" delay=5 />
+
+ <SimpleNotification message="Sound Effetcs by Mike." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=start />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Racing Bots by Michael." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=spawnBots />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Planetary Destroyer by Petar." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=creditPetar />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Collateral Damage by Raphael." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=dockMe />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Automatic Turret by Dario." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=creditDario />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <Script code="addBots 3" onLoad="false">
+ <events>
+ <trigger>
+ <EventListener event=spawnBots />
+ </trigger>
+ </events>
+ </Script>
+
+
+<!-- SOUNDS & MUSIC -->
+ <WorldSound name="scoreSound" position="-920,0,0" source="sounds/ReadyGo.ogg" >
+ <events>
+ <play>
+ <EventListener event="start" />
+ </play>
+ </events>
+ </WorldSound>
+
+
+
+
+ </Scene>
+</Level>
+
Copied: code/trunk/data/levels/templates/bigship.oxt (from rev 9525, code/branches/presentationHS12/data/levels/templates/bigship.oxt)
===================================================================
--- code/trunk/data/levels/templates/bigship.oxt (rev 0)
+++ code/trunk/data/levels/templates/bigship.oxt 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,146 @@
+<Template name=bigship>
+ <SpaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = bigshipcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 6
+
+ health = 100
+ maxhealth = 200
+ initialhealth = 100
+
+ shieldhealth = 100
+ initialshieldhealth = 30
+ maxshieldhealth = 50
+ shieldabsorption = 0.8
+ reloadrate = 1
+ reloadwaittime = 1
+
+ primaryThrust = 30
+ auxilaryThrust = 30
+ rotationThrust = 10
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 30
+ boostPowerRate = 1.5
+ boostRate = 4
+ boostCooldownDuration = 10
+
+ shakeFrequency = 15
+ shakeAmplitude = 9
+
+ collisionType = "dynamic"
+ mass = 1000
+ linearDamping = 0.7
+ angularDamping = 0.9999999
+ >
+ <engines>
+ <MultiStateEngine position=" 15, 0, 0" template=bigshipengine />
+ <MultiStateEngine position="-15, 0, 0" template=bigshipengine />
+ </engines>
+ <attached>
+
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsBody.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsDuseL.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsDuseR.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsKuppelV.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsKuppelK.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsAntL.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsAntR.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsGarage.mesh" />
+ <Model position="0,0,0" yaw=0 pitch=180 roll=0 scale=4 mesh="bsStation.mesh" />
+
+ <BlinkingBillboard position="2,-2.4,16" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="-2,-2.4,16" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=0 quadratic=1 />
+ <BlinkingBillboard position="2,-2.5,19" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=40 quadratic=1 />
+ <BlinkingBillboard position="-2,-2.5,19" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=40 quadratic=1 />
+ <BlinkingBillboard position="2,-2.5,22" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=80 quadratic=0 />
+ <BlinkingBillboard position="-2,-2.5,22" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=80 quadratic=0 />
+ <BlinkingBillboard position="2,-2.6,25" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=120 quadratic=0 />
+ <BlinkingBillboard position="-2,-2.6,25" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=120 quadratic=0 />
+ <BlinkingBillboard position="2,-2.6,28" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=160 quadratic=0 />
+ <BlinkingBillboard position="-2,-2.6,28" material="Examples/Flare" colour="0.3, 0.3, 1, 0.1" amplitude=0.02 frequency=0.4 phase=160 quadratic=0 />
+ <BlinkingBillboard position="2.9,-3.5,14.2" material="Examples/Flare" colour="1, 0.4, 0.4, 0.1" amplitude=0.02 frequency=30 phase=0 quadratic=0 />
+ <BlinkingBillboard position="-2.9,-3.5,14.2" material="Examples/Flare" colour="1, 0.4, 0.4, 0.1" amplitude=0.02 frequency=30 phase=0 quadratic=0 />
+
+
+
+<!-- <Model position="0,8,17" yaw=0 pitch=180 roll=0 scale3D="8, 10, 10" mesh="cube.mesh" />
+ <Model position="0,0,22" yaw=0 pitch=180 roll=0 scale3D="18, 2, 10" mesh="cube.mesh" />
+ <Model position="0,0,9" yaw=0 pitch=180 roll=0 scale3D="12, 2, 20" mesh="cube.mesh" />
+ <Model position="0,0,-18" yaw=0 pitch=180 roll=0 scale3D="6, 2, 18" mesh="cube.mesh" />
+-->
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,8,17" halfExtents="8,10,10" />
+ <BoxCollisionShape position="0,0,22" halfExtents="18, 2, 10" />
+ <BoxCollisionShape position="0,0,9" halfExtents="12, 2, 20" />
+ <BoxCollisionShape position="0,0,-18" halfExtents="6, 2, 18" />
+
+ </collisionShapes>
+<?lua
+ include("../includes/weaponSettingsbigship.oxi")
+?>
+ </SpaceShip>
+</Template>
+
+<Template name=bigshipcameras defaults=0>
+ <SpaceShip>
+ <camerapositions>
+ <CameraPosition position="0,30, 50" drag=true mouselook=true />
+ <CameraPosition position="0,10,80" drag=true mouselook=true />
+ <CameraPosition position="0,40,120" drag=true mouselook=true />
+ </camerapositions>
+ </SpaceShip>
+</Template>
+
+<Template name=bigshipengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 2
+
+ speedfront = 150
+ speedback = 50
+ speedleftright = 50
+ speedupdown = 50
+
+ defEngineSndNormal = "sounds/Engine_low.ogg"
+ defEngineSndBoost = "sounds/Engine_high.ogg"
+
+ accelerationfront = 10
+ accelerationbrake = 10
+ accelerationback = 10
+ accelerationleftright = 10
+ accelerationupdown = 10
+ >
+ <EffectContainer condition="idle">
+ <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+ </EffectContainer>
+ <EffectContainer condition="not idle">
+ <FadingBillboard mainstate=activity active=false scale=0.1 position="7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.1 position="-7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ </EffectContainer>
+ <EffectContainer condition="normal or brake">
+ </EffectContainer>
+ <EffectContainer condition="normal or boost">
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 10.5, 0, 32" colour="0.2, 0.65, 1.0, 1.0" width=10 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-10.5, 0, 32" colour="0.2, 0.65, 1.0, 1.0" width=10 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 2.5, 13, 26.5" colour="0.2, 0.65, 1, 0.4" width=5 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-2.5, 13, 26.5" colour="0.2, 0.65, 1, 0.4" width=5 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </EffectContainer>
+ <EffectContainer condition="boost">
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 10, 0, 32" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-10, 0, 32" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ </EffectContainer>
+<!-- <EffectContainer condition="brake">
+ <FadingBillboard mainstate=activity active=false scale=0.3 position=" 8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.3 position="-8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.15 position=" 8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.15 position="-8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+ </EffectContainer>
+-->
+ </MultiStateEngine>
+</Template>
Modified: code/trunk/data/levels/templates/lodInformation.oxt
===================================================================
--- code/trunk/data/levels/templates/lodInformation.oxt 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/data/levels/templates/lodInformation.oxt 2013-02-19 09:25:42 UTC (rev 9526)
@@ -14,6 +14,8 @@
<MeshLodInformation mesh=SolarPanel.mesh enabled=false/>
<MeshLodInformation mesh=CuboidLandingZone.mesh enabled=false/>
<MeshLodInformation mesh=HydroHarvester.mesh enabled=false />
+ <MeshLodInformation mesh=turretHead.mesh enabled=false />
+ <MeshLodInformation mesh=LaserBeam.mesh enabled=false/>
<!-- disable LOD for some debris meshes which caused a crash (fixed in Ogre 1.7.3) -->
<MeshLodInformation mesh=BodyDebris1.mesh enabled=false/>
Copied: code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt (from rev 9525, code/branches/presentationHS12/data/levels/templates/spaceshipCollateralDamage.oxt)
===================================================================
--- code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt (rev 0)
+++ code/trunk/data/levels/templates/spaceshipCollateralDamage.oxt 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,142 @@
+<!-- keuschr /-->
+<Template name=spaceshipcollateraldamage>
+ <SpaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipCDcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 6
+
+ health = 200
+ maxhealth = 400
+ initialhealth = 200
+
+ 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 = 12
+
+ collisionType = "dynamic"
+ mass = 100
+ linearDamping = 0.7
+ angularDamping = 0.9999999
+ >
+ <engines>
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipCDengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipCDengine />
+ </engines>
+ <attached>
+ <Model position="0,0,0" yaw=-90 pitch=0 roll=0 scale=4 mesh="collateralDamage.mesh" />
+
+ <BlinkingBillboard position="18.5,0.5,1.5" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=.5 quadratic=1 />
+ <BlinkingBillboard position="-18.5,0.5,1.5" material="Examples/Flare" colour="0.5, 1.0, 0.3" amplitude=0.1 frequency=.5 phase=180 quadratic=1 />
+
+ <!--Model mesh="cube.mesh" mass=10 position="0,0,0" scale3D="18,2,14" /-->
+ <!--Model mesh="cube.mesh" mass=10 position="0,2.5,0" scale3D="8,2.5,14" /-->
+
+ </attached>
+
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="18,2,14" />
+ <BoxCollisionShape position="0,2.5,0" halfExtents="8,2.5,14" />
+
+
+
+
+ </collisionShapes>
+
+
+
+<?lua
+ include("../includes/weaponSettingsCollateral.oxi")
+?>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipCDcameras defaults=0>
+ <SpaceShip>
+ <camerapositions>
+ <CameraPosition position="0,10, 40" drag=true mouselook=true />
+ <CameraPosition position="0,20, 80" drag=true mouselook=true />
+ <CameraPosition position="0,30,120" drag=true mouselook=true />
+ <CameraPosition position="0,50,150" drag=true mouselook=true />
+ </camerapositions>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipCDengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 5
+
+ 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">
+ <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+ </EffectContainer>
+
+<EffectContainer condition="not idle">
+ <FadingBillboard mainstate=activity active=false scale=0.05 position="1, 0.5, 14" colour="1.0, 0.65, 0.2, 1.0" material="Examples/Flare" turnontime=0.2 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.05 position="-1, 0.5, 14" colour="1.0, 0.65, 0.2, 1.0" material="Examples/Flare" turnontime=0.2 turnofftime=0.5 />
+ </EffectContainer>
+ <EffectContainer condition="normal or brake">
+ </EffectContainer>
+
+ <EffectContainer condition="normal or boost">
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 1, 0, 17" colour="1, 0.4, 0.15, 1.0" width=6 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1.5 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-1, 0, 17" colour="1, 0.4, 0.15, 1.0" width=6 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1.5 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </EffectContainer>
+
+ <EffectContainer condition="normal or boost">
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 8, 0, 12" colour="1, 0.8, 0, 0.3" width=6 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=3 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-8, 0, 12" colour="1, 0.8, 0, 0.3" width=6 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=3 turnofftime=1 material="Flares/ThrusterFlare1" />
+
+ <FadingBillboard mainstate=activity active=false scale=0.05 position="8, -1, 12" colour="1, 0.8, 0, 0.3" material="Examples/Flare" turnontime=1 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.05 position="-8, -1, 12" colour="1, 0.8, 0, 0.3" material="Examples/Flare" turnontime=1 turnofftime=0.5 />
+
+ </EffectContainer>
+
+
+ <EffectContainer condition="boost">
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 3, 0, 20" colour="0.8,0.4,0, 0.15" width=5 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1.5 turnofftime=0.5 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-3, 0, 20" colour="0.8,0.4,0, 0.15" width=5 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1.5 turnofftime=0.5 material="Examples/Flare" />
+ </EffectContainer>
+
+<!-- <EffectContainer condition="brake">
+ <FadingBillboard mainstate=activity active=false scale=0.3 position=" 8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.3 position="-8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.15 position=" 8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.15 position="-8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+ </EffectContainer>
+-->
+ </MultiStateEngine>
+</Template>
Modified: code/trunk/data/levels/templates/spaceshipEscort.oxt
===================================================================
--- code/trunk/data/levels/templates/spaceshipEscort.oxt 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/data/levels/templates/spaceshipEscort.oxt 2013-02-19 09:25:42 UTC (rev 9526)
@@ -1,7 +1,7 @@
<Template name=spaceshipescort>
<SpaceShip
hudtemplate = spaceshiphud
- camerapositiontemplate = spaceshipassffcameras
+ camerapositiontemplate = spaceshipescortcameras
spawnparticlesource = "Orxonox/fairytwirl"
spawnparticleduration = 3
explosionchunks = 4
@@ -38,8 +38,8 @@
angularDamping = 0.9999999
>
<engines>
- <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
- <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipescortengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipescortengine />
</engines>
<attached>
<Model position="0,0,0" yaw=90 pitch=0 roll=0 scale=4 mesh="escortShip.mesh" />
@@ -61,17 +61,17 @@
</SpaceShip>
</Template>
-<Template name=spaceshipassffcameras defaults=0>
+<Template name=spaceshipescortcameras defaults=0>
<SpaceShip>
<camerapositions>
- <CameraPosition position="0,13, 40" drag=true mouselook=true />
- <CameraPosition position="0,20, 80" drag=true mouselook=true />
+ <CameraPosition position="0,15, 60" drag=true mouselook=true />
+ <CameraPosition position="0,20, 90" drag=true mouselook=true />
<CameraPosition position="0,30,120" drag=true mouselook=true />
</camerapositions>
</SpaceShip>
</Template>
-<Template name=spaceshipassffengine baseclass=MultiStateEngine>
+<Template name=spaceshipescortengine baseclass=MultiStateEngine>
<MultiStateEngine
boostfactor = 2.2
Copied: code/trunk/data/levels/templates/spaceshipTurret.oxt (from rev 9525, code/branches/presentationHS12/data/levels/templates/spaceshipTurret.oxt)
===================================================================
--- code/trunk/data/levels/templates/spaceshipTurret.oxt (rev 0)
+++ code/trunk/data/levels/templates/spaceshipTurret.oxt 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,60 @@
+<Template name=spaceshipturret>
+ <SpaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipturretcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 6
+
+ health = 100
+ maxhealth = 200
+ initialhealth = 100
+
+ 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
+ >
+ <attached>
+ <Model position="0,0,0" yaw="90" roll="-90" mesh="turretHead.mesh" scale3D="10,10,10"/>
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="10" position = "0,0,0"/>
+ </collisionShapes>
+<?lua
+ include("../includes/weaponSettingsTurret.oxi")
+?>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipturretcameras defaults=0>
+ <SpaceShip>
+ <camerapositions>
+ <CameraPosition position="0,10, 40" drag=true mouselook=true />
+ <CameraPosition position="0,20, 80" drag=true mouselook=true />
+ <CameraPosition position="0,30,120" drag=true mouselook=true />
+ </camerapositions>
+ </SpaceShip>
+</Template>
Copied: code/trunk/data/levels/turretTest.oxw (from rev 9525, code/branches/presentationHS12/data/levels/turretTest.oxw)
===================================================================
--- code/trunk/data/levels/turretTest.oxw (rev 0)
+++ code/trunk/data/levels/turretTest.oxw 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,61 @@
+<LevelInfo
+ name = "turret Test"
+ description = "A level with a turret in it."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipTurret.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=spaceshipassff />
+
+
+<StaticEntity position="0,0,0" yaw=0 pitch=0>
+ <attached>
+ <Model position="0,0,0" mesh="turretSocketFront.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketIn.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketTop.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketLeft.mesh" scale3D="10,10,10" />
+ <Model position="0,0,0" mesh="turretSocketRight.mesh" scale3D="10,10,10" />
+ </attached>
+</StaticEntity>
+
+
+
+<Turret position="0,10,0" pitch="90" yaw="0" roll="0">
+ <templates>
+ <Template link=spaceshipturret />
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=100 team=10>
+ </WaypointPatrolController>
+ </controller>
+</Turret>
+
+
+
+
+ </Scene>
+</Level>
+
Modified: code/trunk/data/overlays/HUD.oxo
===================================================================
--- code/trunk/data/overlays/HUD.oxo 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/data/overlays/HUD.oxo 2013-02-19 09:25:42 UTC (rev 9526)
@@ -51,7 +51,7 @@
rotation = 0
value = 0
>
- <BarColour position = 0.7 colour = "0.2,0.7,0.2" />
+ <BarColounar position = 0.7 colour = "0.2,0.7,0.2" />
<BarColour position = 0.4 colour = "0.7,0.5,0.2" />
<BarColour position = 0.1 colour = "0.7,0.2,0.2" />
</HUDSpeedBar-->
@@ -62,7 +62,7 @@
font = "Monofur"
textSize = 0.05
navMarkerSize = 0.03
- aimMarkerSize = 0.04
+ aimMarkerSize = 0.02
/>
<HUDRadar
Modified: code/trunk/data/overlays/HUDTemplates3.oxo
===================================================================
--- code/trunk/data/overlays/HUDTemplates3.oxo 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/data/overlays/HUDTemplates3.oxo 2013-02-19 09:25:42 UTC (rev 9526)
@@ -104,7 +104,7 @@
font = "Monofur"
textsize = 0.05
navMarkerSize = 0.03
- aimMarkerSize = 0.04
+ aimMarkerSize = 0.02
/>
<HUDRadar
Modified: code/trunk/src/modules/gametypes/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/gametypes/CMakeLists.txt 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/gametypes/CMakeLists.txt 2013-02-19 09:25:42 UTC (rev 9526)
@@ -4,6 +4,8 @@
SpaceRaceManager.cc
OldSpaceRace.cc
OldRaceCheckPoint.cc
+ SpaceRaceBot.cc
+ SpaceRaceController.cc
)
ORXONOX_ADD_LIBRARY(gametypes
Modified: code/trunk/src/modules/gametypes/GametypesPrereqs.h
===================================================================
--- code/trunk/src/modules/gametypes/GametypesPrereqs.h 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/gametypes/GametypesPrereqs.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -66,6 +66,9 @@
{
class SpaceRace;
class OldSpaceRace;
+ class SpaceRaceManager;
+ class SpaceRaceBot;
+ class SpaceRaceController;
}
#endif /* _GametypesPrereqs_H__ */
Modified: code/trunk/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/trunk/src/modules/gametypes/RaceCheckPoint.cc 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/gametypes/RaceCheckPoint.cc 2013-02-19 09:25:42 UTC (rev 9526)
@@ -42,10 +42,10 @@
{
CreateFactory(RaceCheckPoint);
- RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceMultiTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
+ RaceCheckPoint::RaceCheckPoint(BaseObject* creator) : DistanceMultiTrigger(creator),
+ RadarViewable(creator, static_cast<WorldEntity*> (this))
{
RegisterObject(RaceCheckPoint);
-
this->setDistance(100);
this->setBeaconMode("off");
this->setBroadcast(false);
@@ -59,13 +59,16 @@
this->checkpointIndex_ = 0;
this->bIsLast_ = false;
this->timeLimit_ = 0;
- this->player_ = NULL;
+ //this->players_ = vector<PlayerInfo*>();
+
+ myPosition_= this->getPosition(); //eingefuegt
+ //orxout(user_status) << "test" << std::endl;
}
+ RaceCheckPoint::~RaceCheckPoint()
+ {
- RaceCheckPoint::~RaceCheckPoint()
- {
- }
+ }
void RaceCheckPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
@@ -85,7 +88,7 @@
{
ControllableEntity* entity = orxonox_cast<ControllableEntity*>(originator);
if (entity)
- this->player_ = entity->getPlayer();
+ this->players_.push_back(entity->getPlayer());
}
}
@@ -94,31 +97,131 @@
this->timeLimit_ = timeLimit;
if (this->timeLimit_ != 0)
{
- std::string message = "You have " + multi_cast<std::string>(this->timeLimit_)
- + " seconds to reach the check point " + multi_cast<std::string>(this->checkpointIndex_ + 1);
+ std::string message = "You have " + multi_cast<std::string>(this->timeLimit_)
+ + " seconds to reach the check point " + multi_cast<std::string>(this->checkpointIndex_ + 1);
this->getGametype()->getGametypeInfo()->sendAnnounceMessage(message);
ChatManager::message(message);
}
}
+ //Must not be called before setNextCheckpointsAsVector3 at least once has been called
+ void RaceCheckPoint::setNextVirtualCheckpointsAsVector3(const Vector3& checkpoints){
+ /*std::set<int> lastcheckpoints=this->nextCheckpoints_;
+ nextCheckpoints_.clear();
+ std::set<int>::iterator it = lastcheckpoints.begin();
+ if(checkpoints.x<-1){
+ virtualToRealCheckPoints_.insert(std::pair<int,int>(checkpoints.x,(*it)));
+ it++;
+ }
+ if(checkpoints.x!=-1)
+ this->nextCheckpoints_.insert(static_cast<int>(checkpoints.x + 0.5)); // the red number has the type double and for the cast (to int) is added 0.5 so that the cast works correctly
+
+ if(checkpoints.y<-1){
+ virtualToRealCheckPoints_.insert(std::pair<int,int>(checkpoints.y,(*it)));
+ it++;
+ }
+ if(checkpoints.y!=-1)
+ this->nextCheckpoints_.insert(static_cast<int>(checkpoints.y + 0.5));
+
+ if(checkpoints.z<-1){
+ virtualToRealCheckPoints_.insert(std::pair<int,int>(checkpoints.z,(*it)));
+ it++;
+ }
+ if(checkpoints.z!=-1)
+ this->nextCheckpoints_.insert(static_cast<int>(checkpoints.z + 0.5));*/
+ nextCheckpointsVirtual_.clear();
+ if(checkpoints.x!=-1)
+ nextCheckpointsVirtual_.insert(checkpoints.x);
+ if(checkpoints.y!=-1)
+ nextCheckpointsVirtual_.insert(checkpoints.y);
+ if(checkpoints.z!=-1)
+ nextCheckpointsVirtual_.insert(checkpoints.z);
+ }
+
void RaceCheckPoint::setNextCheckpointsAsVector3(const Vector3& checkpoints)
{
this->nextCheckpoints_.clear();
if (checkpoints.x > -1)
- this->nextCheckpoints_.insert(static_cast<int>(checkpoints.x + 0.5));
+ this->nextCheckpoints_.insert(static_cast<int>(checkpoints.x + 0.5)); // the red number has the type double and for the cast (to int) is added 0.5 so that the cast works correctly
if (checkpoints.y > -1)
- this->nextCheckpoints_.insert(static_cast<int>(checkpoints.y + 0.5));
+ this->nextCheckpoints_.insert(static_cast<int>(checkpoints.y + 0.5));
if (checkpoints.z > -1)
- this->nextCheckpoints_.insert(static_cast<int>(checkpoints.z + 0.5));
+ this->nextCheckpoints_.insert(static_cast<int>(checkpoints.z + 0.5));
+
+ this->nextCheckpointsVirtual_=nextCheckpoints_;
}
- Vector3 RaceCheckPoint::getNextCheckpointsAsVector3() const
+ PlayerInfo* RaceCheckPoint::getPlayer(unsigned int clientID) const
{
+ if (players_.size() > 0)
+ {
+ for (int i = 0; i < players_.size(); i++)
+ {
+ if (this->players_[i]->getClientID() == clientID)
+ {
+ return players_[i];
+ }
+ }
+ }
+ return NULL;
+ }
+
+ bool RaceCheckPoint::playerWasHere(PlayerInfo* player) const
+ {
+ if (players_.size() > 0)
+ {
+ for (int i = 0; i < players_.size(); i++)
+ {
+ if (this->players_[i] == player)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ Vector3 RaceCheckPoint::getNextCheckpointsAsVector3()
+ {
+ Vector3 checkpoints(-1,-1,-1); int count=0;
+ for (std::set<int>::iterator it= nextCheckpoints_.begin();it!=nextCheckpoints_.end(); it++ ){
+ switch (count)
+ {
+ case 0: checkpoints.x = static_cast<Ogre::Real>(*it); break;
+ case 1: checkpoints.y = static_cast<Ogre::Real>(*it); break;
+ case 2: checkpoints.z = static_cast<Ogre::Real>(*it); break;
+ }
+ ++count;
+ }
+ return checkpoints;
+ //= getVirtualNextCheckpointsAsVector3();
+ int j[3];
+ j[0]=changeVirtualToRealCheckPoint(checkpoints.x);
+ j[1]=changeVirtualToRealCheckPoint(checkpoints.y);
+ j[2]=changeVirtualToRealCheckPoint(checkpoints.z);
+
+
+ return Vector3(j[0],j[1],j[2]);
+
+
+ }
+
+ int RaceCheckPoint::changeVirtualToRealCheckPoint(int checkpointID) {
+ int temp=checkpointID;
+ while(temp<-1){
+ temp = this->virtualToRealCheckPoints_[temp];
+ }
+ return temp;
+ }
+
+
+ Vector3 RaceCheckPoint::getVirtualNextCheckpointsAsVector3() const
+ {
Vector3 checkpoints = Vector3(-1, -1, -1);
size_t count = 0;
- for (std::set<int>::iterator it = this->nextCheckpoints_.begin(); it != this->nextCheckpoints_.end(); ++it)
+ for (std::set<int>::iterator it = this->nextCheckpointsVirtual_.begin(); it != this->nextCheckpointsVirtual_.end(); ++it)
{
switch (count)
{
Modified: code/trunk/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- code/trunk/src/modules/gametypes/RaceCheckPoint.h 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/gametypes/RaceCheckPoint.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -36,11 +36,12 @@
namespace orxonox
{
/**
- @brief
- The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
- Don't forget to control the indexes of your check points and to set one last check point
- */
- class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable
+ @brief
+ The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
+ Don't forget to control the indexes of your check points and to set one last check point
+ */
+ class _GametypesExport RaceCheckPoint: public DistanceMultiTrigger,
+ public RadarViewable
{
public:
RaceCheckPoint(BaseObject* creator);
@@ -49,41 +50,78 @@
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
inline void setCheckpointIndex(int checkpointIndex)
- { this->checkpointIndex_ = checkpointIndex; }
+ {
+ this->checkpointIndex_ = checkpointIndex;
+ }
inline int getCheckpointIndex() const
- { return this->checkpointIndex_; }
+ {
+ return this->checkpointIndex_;
+ }
void setNextCheckpointsAsVector3(const Vector3& checkpoints);
- Vector3 getNextCheckpointsAsVector3() const;
- const std::set<int>& getNextCheckpoints() const
- { return this->nextCheckpoints_; }
+ Vector3 getNextCheckpointsAsVector3();
+ Vector3 getVirtualNextCheckpointsAsVector3() const;
+ void setNextVirtualCheckpointsAsVector3(const Vector3& checkpoints);
+ int changeVirtualToRealCheckPoint(int);
+ const std::set<int>& getVirtualNextCheckpoints() const
+ {
+ return this->nextCheckpointsVirtual_;
+ }
+
+ const std::set<int>& getNextCheckpoints()
+ {
+ return nextCheckpoints_;
+ std::set<int> temp;
+ std::set<int> temp2=getVirtualNextCheckpoints();
+ for (std::set<int>::iterator it = temp2.begin(); it!=temp2.end(); ++it){
+ temp.insert(changeVirtualToRealCheckPoint((*it)));
+ }
+ return temp;
+ }
inline void setLast(bool isLast)
- { this->bIsLast_ = isLast; }
+ {
+ this->bIsLast_ = isLast;
+ }
inline bool isLast() const
- { return this->bIsLast_; }
+ {
+ return this->bIsLast_;
+ }
virtual void setTimelimit(float timeLimit);
inline float getTimeLimit() const
- { return this->timeLimit_; }
+ {
+ return this->timeLimit_;
+ }
- inline PlayerInfo* getPlayer() const
- { return this->player_; }
+ PlayerInfo* getPlayer(unsigned int clientID) const;
+
+ bool playerWasHere(PlayerInfo* ) const;
+
inline void resetPlayer()
- { this->player_ = NULL; }
+ {
+ this->players_.clear();
+ }
protected:
+
virtual void fire(bool bIsTriggered, BaseObject* originator);
inline const WorldEntity* getWorldEntity() const
- { return this; }
+ {
+ return this;
+ }
private:
- int checkpointIndex_; ///< The index of this check point. The race starts with the check point with the index 0
+
+ int checkpointIndex_; ///< The index of this check point. The race starts with the check point with the index 0
std::set<int> nextCheckpoints_; ///< the indexes of the next check points
- bool bIsLast_; ///< True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
- float timeLimit_; ///< The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
- PlayerInfo* player_; ///< The player that reached the checkpoint
+ bool bIsLast_; ///< True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
+ float timeLimit_; ///< The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
+ std::vector<PlayerInfo*> players_; ///< The player that reached the checkpoint
+ Vector3 myPosition_;
+ std::set<int> nextCheckpointsVirtual_;
+ std::map<int,int> virtualToRealCheckPoints_; // if virtualChepoint was inserted the original can be reconstructed
};
}
Modified: code/trunk/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRace.cc 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/gametypes/SpaceRace.cc 2013-02-19 09:25:42 UTC (rev 9526)
@@ -34,7 +34,7 @@
#include "chat/ChatManager.h"
#include "util/Convert.h"
#include "util/Math.h"
-
+#include "SpaceRaceBot.h"
#include "items/Engine.h"
namespace orxonox
@@ -45,6 +45,7 @@
{
RegisterObject(SpaceRace);
+ this->botclass_ = Class(SpaceRaceBot);//ClassByString("")
this->cantMove_ = false;
this->bTimeIsUp_ = false;
this->numberOfBots_ = 0; // quick fix: don't allow default-bots to enter the race
Copied: code/trunk/src/modules/gametypes/SpaceRaceBot.cc (from rev 9525, code/branches/presentationHS12/src/modules/gametypes/SpaceRaceBot.cc)
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceBot.cc (rev 0)
+++ code/trunk/src/modules/gametypes/SpaceRaceBot.cc 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ *
+ * Created on: Oct 8, 2012
+ * Author: purgham
+ */
+
+#include "SpaceRaceBot.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+ CreateFactory(SpaceRaceBot);
+
+ SpaceRaceBot::SpaceRaceBot(BaseObject* creator) : Bot(creator){
+ RegisterObject(SpaceRaceBot);
+ this->defaultController_ = Class(SpaceRaceController);// ClassByString("")
+ this->createController();
+ }
+}
Copied: code/trunk/src/modules/gametypes/SpaceRaceBot.h (from rev 9525, code/branches/presentationHS12/src/modules/gametypes/SpaceRaceBot.h)
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceBot.h (rev 0)
+++ code/trunk/src/modules/gametypes/SpaceRaceBot.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ *
+ * Created on: Oct 8, 2012
+ * Author: purgham
+ */
+
+#ifndef SPACERACEBOT_H_
+#define SPACERACEBOT_H_
+
+#include "infos/Bot.h"
+#include "gametypes/GametypesPrereqs.h"
+#include "gametypes/SpaceRaceController.h"
+
+
+namespace orxonox
+{
+
+ /**
+
+ */
+ class _GametypesExport SpaceRaceBot: public Bot
+ {
+ public:
+ SpaceRaceBot(BaseObject* creator);
+ virtual ~SpaceRaceBot() {}
+ };
+}
+
+
+#endif /* SPACERACEBOT_H_ */
Copied: code/trunk/src/modules/gametypes/SpaceRaceController.cc (from rev 9525, code/branches/presentationHS12/src/modules/gametypes/SpaceRaceController.cc)
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceController.cc (rev 0)
+++ code/trunk/src/modules/gametypes/SpaceRaceController.cc 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,606 @@
+/*
+ * 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.
+ *
+ * Created on: Oct 8, 2012
+ * Author: purgham
+ */
+
+/**
+ * Conventions:
+ * -first Checkpoint has index 0
+ * -staticCheckPoint= static Point (see def over = constructor)
+ */
+
+/*TODO:
+ * tICK KORRIGIEREN
+ *
+ *
+ */
+#include <gametypes/SpaceRaceController.h>
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "gametypes/SpaceRaceManager.h"
+#include "collisionshapes/CollisionShape.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+
+
+namespace orxonox
+{
+ CreateFactory(SpaceRaceController);
+
+ const int ADJUSTDISTANCE = 500;
+ const int MINDISTANCE = 5;
+ /*
+ * Idea: Find static Point (checkpoints the spaceship has to reach)
+ */
+ SpaceRaceController::SpaceRaceController(BaseObject* creator) :
+ ArtificialController(creator)
+ {
+ RegisterObject(SpaceRaceController)
+; std::vector<RaceCheckPoint*> checkpoints;
+
+ virtualCheckPointIndex = -2;
+ for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it != ObjectList<SpaceRaceManager>::end(); ++it)
+ {
+ checkpoints = it->getAllCheckpoints();
+ nextRaceCheckpoint_ = it->findCheckpoint(0);
+ }
+
+ OrxAssert(!checkpoints.empty(), "No Checkpoints in Level");
+ checkpoints_ = checkpoints;
+ /*orxout()<<"es gibt: "<<checkpoints_.size()<<"checkpoints"<<endl;
+ for(std::vector<RaceCheckPoint*>::iterator it=checkpoints_.begin(); it!=checkpoints_.end(); it++)
+ {
+ orxout()<<"Checkpoint "<<(*it)->getCheckpointIndex()<<"; NExtReal: ";
+ std::set<int> temp =(*it)->getNextCheckpoints();
+ for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
+ {
+ orxout()<<(*ii)<<", ";
+ }
+
+ orxout()<<" NextVirtual: ";
+ temp=(*it)->getVirtualNextCheckpoints();
+ for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
+ {
+ orxout()<<(*ii)<<", ";
+ }
+ orxout()<<endl<<endl;
+
+ }//ausgabe*/
+
+ for (std::vector<RaceCheckPoint*>::iterator it = checkpoints.begin(); it != checkpoints.end(); ++it)
+ {
+ std::set<int> nextCheckPoints = ((*it)->getNextCheckpoints());
+ if(!nextCheckPoints.empty())
+ {
+ for (std::set<int>::iterator numb = nextCheckPoints.begin(); numb!=nextCheckPoints.end(); numb++)
+ {
+ RaceCheckPoint* point2 = findCheckpoint((*numb));
+
+ //if(point2 != NULL)
+ //placeVirtualCheckpoints((*it), point2);
+ }
+ }
+ }/*
+ for(std::vector<RaceCheckPoint*>::iterator it=checkpoints_.begin(); it!=checkpoints_.end(); it++)
+ {
+ orxout()<<"Checkpoint "<<(*it)->getCheckpointIndex()<<"; NExtReal: ";
+ std::set<int> temp =(*it)->getNextCheckpoints();
+ for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
+ {
+ orxout()<<(*ii)<<", ";
+ }
+
+ orxout()<<" NextVirtual: ";
+ temp=(*it)->getVirtualNextCheckpoints();
+ for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
+ {
+ orxout()<<(*ii)<<", ";
+ }
+ orxout()<<endl;
+
+ }//ausgabe
+ orxout()<<"es gibt: "<<checkpoints_.size()<<"checkpoints"<<endl;*/
+ staticRacePoints_ = findStaticCheckpoints(checkpoints);
+ // initialisation of currentRaceCheckpoint_
+ currentRaceCheckpoint_ = NULL;
+
+ int i;
+ for (i = -2; findCheckpoint(i) != NULL; i--)
+ {
+ continue;
+ }
+ //orxout()<<"Die ANzahl der virtuellen CP betraegt: "<< (-i)-2<<endl;
+
+ }
+
+ //------------------------------
+ // functions for initialisation
+
+ void SpaceRaceController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(SpaceRaceController, XMLPort, xmlelement, mode);
+ XMLPortParam(ArtificialController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
+ XMLPortObject(ArtificialController, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode);
+ }
+
+ /*
+ * called from constructor 'SpaceRaceController'
+ * returns a vector of static Point (checkpoints the spaceship has to reach)
+ */
+ std::vector<RaceCheckPoint*> SpaceRaceController::findStaticCheckpoints(std::vector<RaceCheckPoint*> allCheckpoints)
+ {
+ std::map<RaceCheckPoint*, int> * zaehler = new std::map<RaceCheckPoint*, int>(); // counts how many times the checkpoint was reached (for simulation)
+ for (unsigned int i = 0; i < allCheckpoints.size(); i++)
+ {
+ zaehler->insert(std::pair<RaceCheckPoint*, int>(allCheckpoints[i],0));
+ }
+ int maxWays = rekSimulationCheckpointsReached(zaehler->begin()->first, zaehler);
+
+ std::vector<RaceCheckPoint*> returnVec;
+ returnVec.clear();
+ for (std::map<RaceCheckPoint*, int>::iterator iter = zaehler->begin(); iter != zaehler->end(); iter++)
+ {
+ if (iter->second == maxWays)
+ {
+ //returnVec.insert(allCheckpoints[1]);
+ returnVec.insert(returnVec.end(), iter->first);
+ }
+ }
+ delete zaehler;
+ return returnVec;
+ }
+
+ /*
+ * called from 'findStaticCheckpoints'
+ * return how many ways go from the given Checkpoint to the last Checkpoint (of the Game)
+ */
+ int SpaceRaceController::rekSimulationCheckpointsReached(RaceCheckPoint* currentCheckpoint, std::map<RaceCheckPoint*, int>* zaehler)
+ {
+
+ if (currentCheckpoint->isLast())
+ {// last point reached
+
+ (*zaehler)[currentCheckpoint] += 1;
+ return 1; // 1 Way form the last point to this one
+ }
+ else
+ {
+ int numberOfWays = 0; // counts number of ways from this Point to the last point
+ for (std::set<int>::iterator it = currentCheckpoint->getVirtualNextCheckpoints().begin(); it!= currentCheckpoint->getVirtualNextCheckpoints().end(); ++it)
+ {
+ if(currentCheckpoint == findCheckpoint(*it))
+ {
+ //orxout() << currentCheckpoint->getCheckpointIndex()<<endl;
+ continue;
+ }
+ if(findCheckpoint(*it) == NULL)
+ {orxout()<<"Problematic Point: "<<(*it)<<endl;}
+ numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(*it), zaehler);
+ }
+ (*zaehler)[currentCheckpoint] += numberOfWays;
+ return numberOfWays; // returns the number of ways from this point to the last one
+ }
+ }
+
+ //-------------------------------------
+ // functions for dynamic Way-search
+
+ int SpaceRaceController::distanceSpaceshipToCheckPoint(RaceCheckPoint* CheckPoint)
+ {
+ if (this->getControllableEntity() != NULL)
+ {
+ return (CheckPoint->getPosition()- this->getControllableEntity()->getPosition()).length();
+ }
+ return -1;
+ }
+
+ /*
+ * called by: 'tick' or 'adjustNextPoint'
+ * returns the next Checkpoint which the shortest way contains
+ */
+ RaceCheckPoint* SpaceRaceController::nextPointFind(RaceCheckPoint* raceCheckpoint)
+ {
+ int distances[] = {-1, -1, -1};
+ int temp_i = 0;
+ for (std::set<int>::iterator it =raceCheckpoint->getVirtualNextCheckpoints().begin(); it!= raceCheckpoint->getVirtualNextCheckpoints().end(); ++it)
+ {
+ distances[temp_i] = recCalculateDistance(findCheckpoint(*it), this->getControllableEntity()->getPosition());
+ temp_i++;
+ }
+ if (distances[0] > distances[1] && distances[1] != -1)
+ {
+ if (distances[2] < distances[1] && distances[2] != -1)
+ {
+ return findCheckpoint(*raceCheckpoint->getVirtualNextCheckpoints().end()); // return checkpoint with ID of raceCheckpoint->getNextCheckpoints() [2]
+ }
+ else
+ {
+ std::set<int>::iterator temp = raceCheckpoint->getVirtualNextCheckpoints().begin();
+ return findCheckpoint(*(++temp)); // return [1]
+ }
+ }
+ else
+ {
+ if (distances[2] < distances[0] && distances[2] != -1)
+ {
+ return findCheckpoint(*raceCheckpoint->getVirtualNextCheckpoints().end()); // return [2]
+ }
+ else
+ {
+ return findCheckpoint(*raceCheckpoint->getVirtualNextCheckpoints().begin()); // return [0]
+ }
+ }
+ }
+
+ /*
+ * called from 'nextPointFind'
+ * returns the distance between "currentPosition" and the next static checkpoint that can be reached from "currentCheckPoint"
+ */
+ int SpaceRaceController::recCalculateDistance(RaceCheckPoint* currentCheckPoint, Vector3 currentPosition)
+ {
+ // find: looks if the currentCheckPoint is a staticCheckPoint (staticCheckPoint is the same as: static Point)
+ if (std::find(staticRacePoints_.begin(), staticRacePoints_.end(), currentCheckPoint) != staticRacePoints_.end())
+ {
+ return (currentCheckPoint->getPosition() - currentPosition).length();
+ }
+ else
+ {
+ int minimum = std::numeric_limits<int>::max();
+ for (std::set<int>::iterator it = currentCheckPoint->getVirtualNextCheckpoints().begin(); it != currentCheckPoint->getVirtualNextCheckpoints().end(); ++it)
+ {
+ int dist_currentCheckPoint_currentPosition = static_cast<int> ((currentPosition- currentCheckPoint->getPosition()).length());
+
+ minimum = std::min(minimum, dist_currentCheckPoint_currentPosition + recCalculateDistance(findCheckpoint(*it), currentCheckPoint->getPosition()));
+ // minimum of distanz from 'currentPosition' to the next static Checkpoint
+ }
+ return minimum;
+ }
+ }
+
+ /*called by 'tick'
+ *adjust chosen way of the Spaceship every "AdjustDistance" because spaceship could be displaced through an other one
+ */
+ RaceCheckPoint* SpaceRaceController::adjustNextPoint()
+ {
+ if (currentRaceCheckpoint_ == NULL) // no Adjust possible
+
+ {
+ return nextRaceCheckpoint_;
+ }
+ if ((currentRaceCheckpoint_->getVirtualNextCheckpoints()).size() == 1) // no Adjust possible
+
+ {
+ return nextRaceCheckpoint_;
+ }
+
+ //Adjust possible
+
+ return nextPointFind(currentRaceCheckpoint_);
+ }
+
+ RaceCheckPoint* SpaceRaceController::findCheckpoint(int index) const
+ {
+ for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+ if (this->checkpoints_[i]->getCheckpointIndex() == index)
+ return this->checkpoints_[i];
+ return NULL;
+ }
+
+ /*RaceCheckPoint* SpaceRaceController::addVirtualCheckPoint( RaceCheckPoint* previousCheckpoint, int indexFollowingCheckPoint , Vector3 virtualCheckPointPosition )
+ {
+ orxout()<<"add VCP at"<<virtualCheckPointPosition.x<<", "<<virtualCheckPointPosition.y<<", "<<virtualCheckPointPosition.z<<endl;
+ RaceCheckPoint* newTempRaceCheckPoint;
+ for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it!= ObjectList<SpaceRaceManager>::end(); ++it)
+ {
+ newTempRaceCheckPoint = new RaceCheckPoint((*it));
+ }
+ newTempRaceCheckPoint->setVisible(false);
+ newTempRaceCheckPoint->setPosition(virtualCheckPointPosition);
+ newTempRaceCheckPoint->setCheckpointIndex(virtualCheckPointIndex);
+ newTempRaceCheckPoint->setLast(false);
+ newTempRaceCheckPoint->setNextVirtualCheckpointsAsVector3(Vector3(indexFollowingCheckPoint,-1,-1));
+
+ Vector3 temp = previousCheckpoint->getVirtualNextCheckpointsAsVector3();
+ //orxout()<<"temp bei 0: ="<< temp.x<< temp.y<< temp.z<<endl;
+ checkpoints_.insert(checkpoints_.end(), newTempRaceCheckPoint);
+ int positionInNextCheckPoint;
+ for (int i = 0; i <3; i++)
+ {
+ if(previousCheckpoint->getVirtualNextCheckpointsAsVector3()[i] == indexFollowingCheckPoint)
+ positionInNextCheckPoint=i;
+ }
+ switch(positionInNextCheckPoint)
+ {
+ case 0: temp.x=virtualCheckPointIndex; break;
+ case 1: temp.y=virtualCheckPointIndex; break;
+ case 2: temp.z=virtualCheckPointIndex; break;
+ }
+ previousCheckpoint->setNextVirtualCheckpointsAsVector3(temp); //Existiert internes Problem bei negativen index fueer next Checkpoint
+ virtualCheckPointIndex--;
+ //orxout()<<"temp bei 1: ="<< temp.x<< temp.y<< temp.z<<endl;
+ //orxout()<<"temp nach ausgabe: "<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().x<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().y<<previousCheckpoint->getVirtualNextCheckpointsAsVector3().z<<endl;
+ //OrxAssert(virtualCheckPointIndex < -1, "TO much virtual cp");
+ /*orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<", following:"<<indexFollowingCheckPoint<<" : "<<temp.x<<", "<<temp.y<<", "<<temp.z<<"; ";
+ temp=previousCheckpoint->getNextCheckpointsAsVector3();
+ orxout()<<"id: "<< previousCheckpoint->getCheckpointIndex() <<": "<<temp.x<<", "<<temp.y<<", "<<temp.z<<"; ";
+ orxout()<<endl;*//*
+ return newTempRaceCheckPoint;
+ }*/
+
+ SpaceRaceController::~SpaceRaceController()
+ {
+ for (int i =-1; i>virtualCheckPointIndex; i--)
+ {
+ delete findCheckpoint(i);
+ }
+ }
+
+ void SpaceRaceController::tick(float dt)
+ {
+ if (this->getControllableEntity() == NULL || this->getControllableEntity()->getPlayer() == NULL )
+ {
+ //orxout()<< this->getControllableEntity() << " in tick"<<endl;
+ return;
+ }
+ //FOR virtual Checkpoints
+ if(nextRaceCheckpoint_->getCheckpointIndex() < 0)
+ {
+ if( distanceSpaceshipToCheckPoint(nextRaceCheckpoint_) < 200)
+ {
+ currentRaceCheckpoint_=nextRaceCheckpoint_;
+ nextRaceCheckpoint_ = nextPointFind(nextRaceCheckpoint_);
+ lastPositionSpaceship=this->getControllableEntity()->getPosition();
+ //orxout()<< "CP "<< currentRaceCheckpoint_->getCheckpointIndex()<<" chanched to: "<< nextRaceCheckpoint_->getCheckpointIndex()<<endl;
+ }
+ }
+
+ if (nextRaceCheckpoint_->playerWasHere(this->getControllableEntity()->getPlayer()))
+ {//Checkpoint erreicht
+
+ currentRaceCheckpoint_ = nextRaceCheckpoint_;
+ OrxAssert(nextRaceCheckpoint_, "next race checkpoint undefined");
+ nextRaceCheckpoint_ = nextPointFind(nextRaceCheckpoint_);
+ lastPositionSpaceship = this->getControllableEntity()->getPosition();
+ //orxout()<< "CP "<< currentRaceCheckpoint_->getCheckpointIndex()<<" chanched to: "<< nextRaceCheckpoint_->getCheckpointIndex()<<endl;
+ }
+ else if ((lastPositionSpaceship-this->getControllableEntity()->getPosition()).length()/dt > ADJUSTDISTANCE)
+ {
+ nextRaceCheckpoint_ = adjustNextPoint();
+ lastPositionSpaceship = this->getControllableEntity()->getPosition();
+ }
+
+ // Abmessung fuer MINDISTANCE gut;
+
+ else if((lastPositionSpaceship - this->getControllableEntity()->getPosition()).length()/dt < MINDISTANCE )
+ {
+ this->moveToPosition(Vector3(rnd()*100, rnd()*100, rnd()*100));
+ this->spin();
+ //orxout(user_status) << "Mindistance reached" << std::endl;
+ return;
+ }
+ //orxout(user_status) << "dt= " << dt << "; distance= " << (lastPositionSpaceship-this->getControllableEntity()->getPosition()).length() <<std::endl;
+ lastPositionSpaceship = this->getControllableEntity()->getPosition();
+ this->moveToPosition(nextRaceCheckpoint_->getPosition());
+ }
+
+ // True if a coordinate of 'pointToPoint' is smaller then the corresponding coordinate of 'groesse'
+ bool SpaceRaceController::vergleicheQuader(Vector3 pointToPoint, Vector3 groesse)
+ {
+ if(abs(pointToPoint.x) < groesse.x)
+ return true;
+ if(abs(pointToPoint.y) < groesse.y)
+ return true;
+ if(abs(pointToPoint.z) < groesse.z)
+ return true;
+ return false;
+
+ }
+
+ bool SpaceRaceController::directLinePossible(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2,std::vector<StaticEntity*> allObjects)
+ {
+
+ Vector3 cP1ToCP2 = (racepoint2->getPosition() - racepoint1->getPosition()) / (racepoint2->getPosition() - racepoint1->getPosition()).length(); //unit Vector
+ Vector3 centerCP1 = racepoint1->getPosition();
+ btVector3 positionObject;
+ btScalar radiusObject;
+
+ for (std::vector<StaticEntity*>::iterator it = allObjects.begin(); it != allObjects.end(); ++it)
+ {
+ for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape) != 0; everyShape++)
+ {
+ btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();
+ if(currentShape == NULL)
+ continue;
+
+ currentShape->getBoundingSphere(positionObject,radiusObject);
+ Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
+ if((powf((cP1ToCP2.dotProduct(centerCP1-positionObjectNonBT)),2)-(centerCP1-positionObjectNonBT).dotProduct(centerCP1-positionObjectNonBT)+powf(radiusObject, 2))>0)
+ {
+ return false;
+ }
+
+ }
+ }
+ return true;
+
+ }
+
+ /*void SpaceRaceController::computeVirtualCheckpoint(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2, std::vector<StaticEntity*> allObjects)
+ {
+ Vector3 cP1ToCP2=(racepoint2->getPosition()-racepoint1->getPosition()) / (racepoint2->getPosition()-racepoint1->getPosition()).length(); //unit Vector
+ Vector3 centerCP1=racepoint1->getPosition();
+ btVector3 positionObject;
+ btScalar radiusObject;
+
+ for (std::vector<StaticEntity*>::iterator it = allObjects.begin(); it != allObjects.end(); ++it)
+ {
+ for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape) != 0; everyShape++)
+ {
+ btCollisionShape* currentShape = (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape();
+ if(currentShape == NULL)
+ continue;
+
+ currentShape->getBoundingSphere(positionObject,radiusObject);
+ Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
+ Vector3 norm_r_CP = cP1ToCP2.crossProduct(centerCP1-positionObjectNonBT);
+
+ if(norm_r_CP.length() == 0){
+ Vector3 zufall;
+ do{
+ zufall=Vector3(rnd(),rnd(),rnd());//random
+ }while((zufall.crossProduct(cP1ToCP2)).length() == 0);
+ norm_r_CP=zufall.crossProduct(cP1ToCP2);
+ }
+ Vector3 VecToVCP = norm_r_CP.crossProduct(cP1ToCP2);
+ float distanzToCP1 = sqrt(powf(radiusObject,4)/(powf((centerCP1-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));
+ float distanzToCP2 = sqrt(powf(radiusObject,4)/(powf((racepoint2->getPosition()-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2));
+ float distanz = std::max(distanzToCP1,distanzToCP2);
+ //float distanz = 0.0f; //TEMPORARY
+ Vector3 newCheckpointPositionPos = positionObjectNonBT+(distanz*VecToVCP)/VecToVCP.length();
+ Vector3 newCheckpointPositionNeg = positionObjectNonBT-(distanz*VecToVCP)/VecToVCP.length();
+ if((newCheckpointPositionPos - centerCP1).length() + (newCheckpointPositionPos - (centerCP1+cP1ToCP2)).length() < (newCheckpointPositionNeg - centerCP1).length() + (newCheckpointPositionNeg - (centerCP1+cP1ToCP2)).length() )
+ {
+ RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionPos);
+ }
+ else
+ {
+ RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionNeg);
+ }
+ return;
+ }
+ }
+
+ }*/
+
+ /*void SpaceRaceController::placeVirtualCheckpoints(RaceCheckPoint* racepoint1, RaceCheckPoint* racepoint2)
+ {
+ Vector3 point1 = racepoint1->getPosition();
+ Vector3 point2 = racepoint2->getPosition();
+ std::vector<StaticEntity*> problematicObjects;
+
+ for (ObjectList<StaticEntity>::iterator it = ObjectList<StaticEntity>::begin(); it!= ObjectList<StaticEntity>::end(); ++it)
+ {
+
+ if (dynamic_cast<RaceCheckPoint*>(*it) != NULL)
+ {
+ continue;
+ } // does not work jet
+
+ problematicObjects.insert(problematicObjects.end(), *it);
+ //it->getScale3D();// vector fuer halbe wuerfellaenge
+ }
+
+ if(!directLinePossible(racepoint1, racepoint2, problematicObjects))
+ {
+ //orxout()<<"From "<<racepoint1->getCheckpointIndex()<<" to "<<racepoint2->getCheckpointIndex()<<"produces: "<< virtualCheckPointIndex<<endl;
+ computeVirtualCheckpoint(racepoint1, racepoint2, problematicObjects);
+ }
+
+ //
+ // do{
+ // zufall=Vector3(rnd(),rnd(),rnd());//random
+ // }while((zufall.crossProduct(objectmiddle-racepoint1->getPosition())).length()==0);
+ //
+ // Vector3 normalvec=zufall.crossProduct(objectmiddle-racepoint1->getPosition());
+ // // a'/b'=a/b => a' =b'*a/b
+ // float laengeNormalvec=(objectmiddle-racepoint1->getPosition()).length()/sqrt((objectmiddle-racepoint1->getPosition()).squaredLength()-radius*radius)*radius;
+ // addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), objectmiddle+normalvec/normalvec.length()*laengeNormalvec);
+
+ // Vector3 richtungen [6];
+ // richtungen[0]= Vector3(1,0,0);
+ // richtungen[1]= Vector3(-1,0,0);
+ // richtungen[2]= Vector3(0,1,0);
+ // richtungen[3]= Vector3(0,-1,0);
+ // richtungen[4]= Vector3(0,0,1);
+ // richtungen[5]= Vector3(0,0,-1);
+ //
+ // for (int i = 0; i< 6; i++)
+ // {
+ // const int STEPS=100;
+ // const float PHI=1.1;
+ // bool collision=false;
+ //
+ // for (int j =0; j<STEPS; j++)
+ // {
+ // Vector3 tempPosition=(point1 - (point2-point1+richtungen[i]*PHI)*(float)j/STEPS);
+ // for (std::vector<StaticEntity*>::iterator it = problematicObjects.begin(); it!=problematicObjects.end(); ++it)
+ // {
+ // btVector3 positionObject;
+ // btScalar radiusObject;
+ // if((*it)==NULL)
+ // { orxout()<<"Problempoint 1.1"<<endl; continue;}
+ // //TODO: Probably it points on a wrong object
+ // for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++)
+ // {
+ // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==NULL)
+ // { continue;}
+ //
+ // orxout()<<"Problempoint 2.1"<<endl;
+ // (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject);
+ // Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
+ // if (((tempPosition - positionObjectNonBT).length()<radiusObject) && (vergleicheQuader((tempPosition-positionObjectNonBT),(*it)->getScale3D())))
+ // {
+ // collision=true; break;
+ // }
+ // }
+ // if(collision) break;
+ // }
+ // if(collision)break;
+ // }
+ // if(collision) continue;
+ // // no collision => possible Way
+ // for (float j =0; j<STEPS; j++)
+ // {
+ // Vector3 possiblePosition=(point1 - (point2-point1+richtungen[i]*PHI)*j/STEPS);
+ // collision=false;
+ // for(int ij=0; ij<STEPS; j++)
+ // {
+ // Vector3 tempPosition=(possiblePosition - (point2-possiblePosition)*(float)ij/STEPS);
+ // for (std::vector<StaticEntity*>::iterator it = problematicObjects.begin(); it!=problematicObjects.end(); ++it)
+ // {
+ // btVector3 positionObject;
+ // btScalar radiusObject;
+ // if((*it)==NULL)
+ // { orxout()<<"Problempoint 1"<<endl; continue;}
+ // for (int everyShape=0; (*it)->getAttachedCollisionShape(everyShape)!=0; everyShape++)
+ // {
+ // if((*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()==NULL)
+ // { orxout()<<"Problempoint 2.2"<<endl; continue;}
+ // (*it)->getAttachedCollisionShape(everyShape)->getCollisionShape()->getBoundingSphere(positionObject,radiusObject);
+ // Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z());
+ // if (((tempPosition-positionObjectNonBT).length()<radiusObject) && (vergleicheQuader((tempPosition-positionObjectNonBT),(*it)->getScale3D())))
+ // {
+ // collision=true; break;
+ // }
+ // }
+ // if(collision) break;
+ // }
+ // if(collision)break;
+ // //addVirtualCheckPoint(racepoint1, racepoint2->getCheckpointIndex(), possiblePosition);
+ // return;
+ // }
+ //
+ // }
+ // }
+
+ }*/
+}
Copied: code/trunk/src/modules/gametypes/SpaceRaceController.h (from rev 9525, code/branches/presentationHS12/src/modules/gametypes/SpaceRaceController.h)
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceController.h (rev 0)
+++ code/trunk/src/modules/gametypes/SpaceRaceController.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ *
+ *
+ * Created on: Oct 8, 2012
+ * Author: purgham
+ */
+
+#ifndef SPACERACECONTROLLER_H_
+#define SPACERACECONTROLLER_H_
+
+#include "gametypes/GametypesPrereqs.h"
+#include "controllers/ArtificialController.h"
+#include "gametypes/Gametype.h"
+#include "gametypes/RaceCheckPoint.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+ class _GametypesExport SpaceRaceController: public ArtificialController,
+ public Tickable
+ {
+ private:
+ std::vector<RaceCheckPoint*> staticRacePoints_;
+ RaceCheckPoint* nextRaceCheckpoint_; // checkpoint that should be reached
+ RaceCheckPoint* currentRaceCheckpoint_; // last checkPoint (already reached)
+ std::vector<RaceCheckPoint*> checkpoints_;
+ Vector3 lastPositionSpaceship;
+ int virtualCheckPointIndex;
+
+ int recCalculateDistance(RaceCheckPoint*, Vector3 currentPosition);
+ int distanceSpaceshipToCheckPoint(RaceCheckPoint*);
+ RaceCheckPoint* nextPointFind(RaceCheckPoint*);
+ RaceCheckPoint* adjustNextPoint();
+ std::vector<RaceCheckPoint*> findStaticCheckpoints(std::vector<
+ RaceCheckPoint*>);
+ std::vector<RaceCheckPoint*> staticCheckpoints();
+ int rekSimulationCheckpointsReached(RaceCheckPoint*, std::map<
+ RaceCheckPoint*, int>*);
+ // same as SpaceRaceManager, but needed to add virtuell Checkpoints ( Checkpoints which don't exist but needed to avoid collisions with big Objects)
+ RaceCheckPoint* findCheckpoint(int index) const;
+ //RaceCheckPoint * addVirtualCheckPoint(RaceCheckPoint*, int , Vector3);
+ //void placeVirtualCheckpoints(RaceCheckPoint*, RaceCheckPoint*);
+ bool vergleicheQuader(Vector3, Vector3);
+ bool directLinePossible(RaceCheckPoint*, RaceCheckPoint*, std::vector<StaticEntity*>);
+ //void computeVirtualCheckpoint(RaceCheckPoint*, RaceCheckPoint*, std::vector<StaticEntity*>);
+
+ public:
+ SpaceRaceController(BaseObject* creator);
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual ~SpaceRaceController();
+ virtual void tick(float dt);
+ };
+
+}
+
+#endif /* SPACERACECONTROLLER_H_ */
Modified: code/trunk/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.cc 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.cc 2013-02-19 09:25:42 UTC (rev 9526)
@@ -37,47 +37,56 @@
#include "util/Convert.h"
#include "util/Math.h"
-
-
namespace orxonox
{
CreateFactory(SpaceRaceManager);
- SpaceRaceManager::SpaceRaceManager(BaseObject* creator) : BaseObject(creator)
+ SpaceRaceManager::SpaceRaceManager(BaseObject* creator) :
+ BaseObject(creator)
{
RegisterObject(SpaceRaceManager);
-
+ this->race_ = orxonox_cast<SpaceRace*>(this->getGametype().get());
+ assert(race_);
+ //amountOfPlayers=(race_->getPlayers()).size();
this->firstcheckpointvisible_ = false;
}
SpaceRaceManager::~SpaceRaceManager()
{
for (size_t i = 0; i < this->checkpoints_.size(); ++i)
- this->checkpoints_[i]->destroy();
+ this->checkpoints_[i]->destroy();
}
void SpaceRaceManager::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(SpaceRaceManager, XMLPort, xmlelement, mode);
- XMLPortObject(SpaceRaceManager, RaceCheckPoint, "checkpoints", addCheckpoint, getCheckpoint, xmlelement, mode);
+ XMLPortObject(SpaceRaceManager, RaceCheckPoint, "checkpoints", addCheckpoint, getCheckpoint, xmlelement, mode);
}
void SpaceRaceManager::tick(float dt)
{
SUPER(SpaceRaceManager,tick,dt);
+ this->players_ = this->race_->getPlayers();
+
if (this->checkpoints_[0] != NULL && !this->firstcheckpointvisible_)
{
this->checkpoints_[0]->setRadarVisibility(true);
this->firstcheckpointvisible_ = true;
}
- for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+ for ( std::map< PlayerInfo*, Player>::iterator it = players_.begin(); it != players_.end(); ++it)
{
- if (this->checkpoints_[i]->getPlayer() != NULL)
- this->checkpointReached(this->checkpoints_[i], this->checkpoints_[i]->getPlayer());
+
+ for (size_t i = 0; i < this->checkpoints_.size(); ++i)
+ {
+ if (this->checkpoints_[i]->playerWasHere(it->first)){
+ this->checkpointReached(this->checkpoints_[i], it->first /*this->checkpoints_[i]->getPlayer()*/);
+ }
+ }
}
+
}
void SpaceRaceManager::addCheckpoint(RaceCheckPoint* checkpoint)
@@ -88,31 +97,36 @@
RaceCheckPoint* SpaceRaceManager::getCheckpoint(unsigned int index) const
{
if (index < this->checkpoints_.size())
- return this->checkpoints_[index];
+ return this->checkpoints_[index];
else
- return 0;
+ return 0;
}
+ std::vector<RaceCheckPoint*> SpaceRaceManager::getAllCheckpoints()
+ {
+ return checkpoints_;
+ }
+
/**
- @brief Returns the checkpoint with the given checkpoint-index (@see RaceCheckPoint::getCheckpointIndex).
- */
+ @brief Returns the checkpoint with the given checkpoint-index (@see RaceCheckPoint::getCheckpointIndex).
+ */
RaceCheckPoint* SpaceRaceManager::findCheckpoint(int index) const
{
for (size_t i = 0; i < this->checkpoints_.size(); ++i)
- if (this->checkpoints_[i]->getCheckpointIndex() == index)
- return this->checkpoints_[i];
+ if (this->checkpoints_[i]->getCheckpointIndex() == index)
+ return this->checkpoints_[i];
return 0;
}
bool SpaceRaceManager::reachedValidCheckpoint(RaceCheckPoint* oldCheckpoint, RaceCheckPoint* newCheckpoint, PlayerInfo* player) const
{
- if (oldCheckpoint)
+ if (oldCheckpoint != NULL)
{
// the player already visited an old checkpoint; see which checkpoints are possible now
const std::set<int>& possibleCheckpoints = oldCheckpoint->getNextCheckpoints();
for (std::set<int>::const_iterator it = possibleCheckpoints.begin(); it != possibleCheckpoints.end(); ++it)
- if (this->findCheckpoint(*it) == newCheckpoint)
- return true;
+ if (this->findCheckpoint(*it) == newCheckpoint)
+ return true;
return false;
}
else
@@ -127,9 +141,9 @@
SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
assert(gametype);
if (!gametype)
- return;
+ return;
- RaceCheckPoint* oldCheckpoint = gametype->getCheckpointReached(player);
+ RaceCheckPoint* oldCheckpoint = gametype->getCheckpointReached(player); // returns the last from player reached checkpoint
if (this->reachedValidCheckpoint(oldCheckpoint, newCheckpoint, player))
{
@@ -151,11 +165,12 @@
{
// adjust the radarvisibility
gametype->newCheckpointReached(newCheckpoint, player);
- this->updateRadarVisibility(oldCheckpoint, newCheckpoint);
+ if(player->isHumanPlayer())
+ this->updateRadarVisibility(oldCheckpoint, newCheckpoint);
}
}
- newCheckpoint->resetPlayer();
+ // newCheckpoint->resetPlayer(); loescht playerpointer TODO: check if problems occur
}
void SpaceRaceManager::updateRadarVisibility(RaceCheckPoint* oldCheckpoint, RaceCheckPoint* newCheckpoint) const
@@ -164,7 +179,7 @@
{
const std::set<int>& oldVisible = oldCheckpoint->getNextCheckpoints();
for (std::set<int>::const_iterator it = oldVisible.begin(); it != oldVisible.end(); ++it)
- this->findCheckpoint(*it)->setRadarVisibility(false);
+ this->findCheckpoint(*it)->setRadarVisibility(false);
}
if (newCheckpoint)
@@ -173,7 +188,7 @@
const std::set<int>& newVisible = newCheckpoint->getNextCheckpoints();
for (std::set<int>::const_iterator it = newVisible.begin(); it != newVisible.end(); ++it)
- this->findCheckpoint(*it)->setRadarVisibility(true);
+ this->findCheckpoint(*it)->setRadarVisibility(true);
}
}
}
Modified: code/trunk/src/modules/gametypes/SpaceRaceManager.h
===================================================================
--- code/trunk/src/modules/gametypes/SpaceRaceManager.h 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/gametypes/SpaceRaceManager.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -66,6 +66,8 @@
void checkpointReached(RaceCheckPoint* newCheckpoint, PlayerInfo* player);
+ std::vector<RaceCheckPoint*> getAllCheckpoints();
+
void tick(float dt);
protected:
@@ -75,6 +77,9 @@
private:
std::vector<RaceCheckPoint*> checkpoints_;
bool firstcheckpointvisible_; ///< true if the first check point is visible.
+ SpaceRace* race_; // needed to get the players
+ //int amountOfPlayers;
+ std::map<PlayerInfo*, Player> players_;
};
}
Modified: code/trunk/src/modules/objects/CMakeLists.txt
===================================================================
--- code/trunk/src/modules/objects/CMakeLists.txt 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/objects/CMakeLists.txt 2013-02-19 09:25:42 UTC (rev 9526)
@@ -4,6 +4,7 @@
Planet.cc
Script.cc
SpaceBoundaries.cc
+ Turret.cc
)
ADD_SUBDIRECTORY(collisionshapes)
Modified: code/trunk/src/modules/objects/ObjectsPrereqs.h
===================================================================
--- code/trunk/src/modules/objects/ObjectsPrereqs.h 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/objects/ObjectsPrereqs.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -72,6 +72,7 @@
class Planet;
class Script;
class SpaceBoundaries;
+ class Turret;
// collisionshapes
class BoxCollisionShape;
Copied: code/trunk/src/modules/objects/Turret.cc (from rev 9525, code/branches/presentationHS12/src/modules/objects/Turret.cc)
===================================================================
--- code/trunk/src/modules/objects/Turret.cc (rev 0)
+++ code/trunk/src/modules/objects/Turret.cc 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,85 @@
+/*
+ * 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:
+ * Marian Runo
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "Turret.h"
+#include "core/CoreIncludes.h"
+#include "OgreQuaternion.h"
+#include "core/XMLPort.h"
+#include "controllers/WaypointPatrolController.h"
+
+namespace orxonox
+{
+ CreateFactory(Turret);
+
+ /**
+ * @brief Constructor
+ */
+ Turret::Turret(BaseObject* creator) : SpaceShip(creator)
+ {
+ RegisterObject(Turret);
+ this->controller_ = new WaypointPatrolController(this);
+ }
+
+ /**
+ * @brief Destructor
+ */
+ Turret::~Turret()
+ {
+
+ }
+
+
+ void Turret::rotatePitch(const Vector2& value)
+ {
+ orxout()<< "Turret rotate Pitch"<< endl;
+
+ const Quaternion& orient = this->getOrientation();
+ Radian pitch = orient.getPitch();
+
+ if((value.x > 0 && pitch < Radian(180)) || (value.x < 0 && pitch > Radian(0)))
+ SpaceShip::rotatePitch(value);
+ }
+
+
+ void Turret::setAlertnessRadius(float value)
+ {
+ this->controller_->setAlertnessRadius(value);
+ }
+ float Turret::getAlertnessRadius()
+ {
+ return this->controller_->getAlertnessRadius();
+ }
+
+ void Turret::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(Turret, XMLPort, xmlelement, mode);
+ XMLPortParam(Turret, "alertnessRadius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues("400");
+ }
+
+
+}
Copied: code/trunk/src/modules/objects/Turret.h (from rev 9525, code/branches/presentationHS12/src/modules/objects/Turret.h)
===================================================================
--- code/trunk/src/modules/objects/Turret.h (rev 0)
+++ code/trunk/src/modules/objects/Turret.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -0,0 +1,68 @@
+/*
+ * 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:
+ * Marian Runo
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file Turret.h
+ @brief Definition of the Turret class.
+ @ingroup Objects
+*/
+
+#ifndef _Turret_H__
+#define _Turret_H__
+
+#include "objects/ObjectsPrereqs.h"
+
+#include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+ class _ObjectsExport Turret : public SpaceShip
+ {
+ public:
+ Turret(BaseObject* creator);
+ virtual ~Turret();
+
+ //virtual void tick(float dt);
+
+ virtual void rotatePitch(const Vector2& value);
+
+ void setAlertnessRadius(float value);
+ float getAlertnessRadius();
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+
+ protected:
+ WaypointPatrolController* controller_;
+ private:
+
+ };
+}
+
+#endif
+
Modified: code/trunk/src/modules/overlays/OverlaysPrereqs.h
===================================================================
--- code/trunk/src/modules/overlays/OverlaysPrereqs.h 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/overlays/OverlaysPrereqs.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -90,6 +90,7 @@
class HUDSpeedBar;
class HUDBoostBar;
class HUDTimer;
+ class HUDAimAssistant;
class KillMessage;
class LastManStandingInfos;
class PauseNotice;
Modified: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc 2013-02-19 09:25:42 UTC (rev 9526)
@@ -36,8 +36,11 @@
#include <OgreTextAreaOverlayElement.h>
#include <OgrePanelOverlayElement.h>
+#include <typeinfo>
+
#include "util/Math.h"
#include "util/Convert.h"
+#include "core/command/ConsoleCommand.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "CameraManager.h"
@@ -54,23 +57,37 @@
namespace orxonox
{
- bool compareDistance(std::pair<RadarViewable*, unsigned int> a, std::pair<RadarViewable*, unsigned int> b)
+
+ SetConsoleCommand("HUDNavigation","selectClosest", &HUDNavigation::selectClosestTarget).addShortcut().keybindMode(KeybindMode::OnPress);
+ SetConsoleCommand("HUDNavigation","selectNext", &HUDNavigation::selectNextTarget).addShortcut().keybindMode(KeybindMode::OnPress);
+
+ static bool compareDistance(std::pair<RadarViewable*, unsigned int> a,
+ std::pair<RadarViewable*, unsigned int> b)
{
return a.second < b.second;
}
-
CreateFactory ( HUDNavigation );
- HUDNavigation::HUDNavigation(BaseObject* creator) : OrxonoxOverlay(creator)
+ HUDNavigation* HUDNavigation::localHUD_s = 0;
+
+ HUDNavigation::HUDNavigation(BaseObject* creator) :
+ OrxonoxOverlay(creator)
{
- RegisterObject(HUDNavigation);
- this->setConfigValues();
+ RegisterObject(HUDNavigation)
+; this->setConfigValues();
// Set default values
this->setFont("Monofur");
this->setTextSize(0.05f);
- this->setNavMarkerSize(0.05f);
+ this->setNavMarkerSize(0.03f);
+ this->setAimMarkerSize(0.02f);
+
this->setDetectionLimit(10000.0f);
+ this->currentMunitionSpeed_ = 2500.0f;
+
+ this->closestTarget_ = true;
+ this->nextTarget_ = false;
+ HUDNavigation::localHUD_s = this;
}
HUDNavigation::~HUDNavigation()
@@ -78,7 +95,7 @@
if (this->isInitialized())
{
for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end();)
- removeObject((it++)->first);
+ removeObject((it++)->first);
}
this->sortedObjectList_.clear();
}
@@ -93,10 +110,11 @@
{
SUPER(HUDNavigation, XMLPort, xmlelement, mode);
- XMLPortParam(HUDNavigation, "font", setFont, getFont, xmlelement, mode);
- XMLPortParam(HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode);
- XMLPortParam(HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode);
+ XMLPortParam(HUDNavigation, "font", setFont, getFont, xmlelement, mode);
+ XMLPortParam(HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode);
+ XMLPortParam(HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode);
XMLPortParam(HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode);
+ XMLPortParam(HUDNavigation, "aimMarkerSize", setAimMarkerSize, getAimMarkerSize, xmlelement, mode);
}
void HUDNavigation::setFont(const std::string& font)
@@ -111,7 +129,7 @@
for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)
{
if (it->second.text_ != NULL)
- it->second.text_->setFontName(this->fontName_);
+ it->second.text_->setFontName(this->fontName_);
}
}
@@ -131,7 +149,7 @@
for (std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it!=this->activeObjectList_.end(); ++it)
{
if (it->second.text_)
- it->second.text_->setCharHeight(size);
+ it->second.text_->setCharHeight(size);
}
}
@@ -143,14 +161,14 @@
float HUDNavigation::getArrowSizeX(int dist) const
{
if (dist < 600)
- dist = 600;
+ dist = 600;
return this->getActualSize().x * 900 * this->navMarkerSize_ / dist;
}
float HUDNavigation::getArrowSizeY(int dist) const
{
if (dist < 600)
- dist = 600;
+ dist = 600;
return this->getActualSize().y * 900 * this->navMarkerSize_ / dist;
}
@@ -160,24 +178,37 @@
Camera* cam = CameraManager::getInstance().getActiveCamera();
if (cam == NULL)
- return;
+ return;
const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
-
for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)
- listIt->second = (int)((listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
+ listIt->second = (int)((listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);
this->sortedObjectList_.sort(compareDistance);
unsigned int markerCount = 0;
bool closeEnough = false; // only display objects that are close enough to be relevant for the player
+ // if the selected object doesn't exist any more or is now out of range select the closest object
+ std::map<RadarViewable*, ObjectInfo>::iterator selectedActiveObject = this->activeObjectList_.find(this->selectedTarget_);
+ if(selectedActiveObject == this->activeObjectList_.end())
+ {
+ this->closestTarget_ = true;
+ }
+ else if(this->detectionLimit_ < (this->selectedTarget_->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f)
+ {
+ this->closestTarget_ = true;
+ selectedActiveObject->second.selected_ = false;
+ }
+
+ bool nextHasToBeSelected = false;
+
for (std::list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt)
{
std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.find(listIt->first);
closeEnough = listIt->second < this->detectionLimit_;
// display radarviewables on HUD if the marker limit and max-distance is not exceeded
- if (markerCount < this->markerLimit_ && (closeEnough || this->detectionLimit_ < 0))
+ if (markerCount < this->markerLimit_ && (closeEnough || this->detectionLimit_ < 0))
{
// Get Distance to HumanController and save it in the TextAreaOverlayElement.
int dist = listIt->second;
@@ -196,6 +227,53 @@
textLength = it->first->getRadarName().size() * it->second.text_->getCharHeight() * 0.3f;
}
+ // select the object that aim-assistant indicates
+ if(this->closestTarget_)
+ // select the closest object
+ {
+ if(listIt == this->sortedObjectList_.begin())
+ {
+ it->second.selected_ = true;
+ this->selectedTarget_ = it->first;
+ }
+ else if(it->second.selected_)
+ {
+ it->second.selected_ = false;
+ }
+
+ }
+ else if(this->nextTarget_)
+ // select the next object in sortedObjectList
+ {
+ if(nextHasToBeSelected){
+ it->second.selected_ = true;
+ this->selectedTarget_ = it->first;
+ nextHasToBeSelected = false;
+ }
+ else if(it->second.selected_)
+ {
+ nextHasToBeSelected = true;
+ it->second.selected_ = false;
+
+ // check if there's a next object
+ listIt++;
+ if(listIt != this->sortedObjectList_.end())
+ {
+ // and if the marker limit and max-distance are not exceeded for it
+ if (markerCount + 1 >= this->markerLimit_ ||
+ (listIt->second > this->detectionLimit_ && detectionLimit_ >= 0))
+ {
+ // otherwise select the closest object
+ this->activeObjectList_.find(this->sortedObjectList_.begin()->first)->second.selected_ = true;
+ this->selectedTarget_ = it->first;
+ nextHasToBeSelected = false;
+ }
+ }
+ listIt--;
+ }
+ }
+
+
// Transform to screen coordinates
Vector3 pos = camTransform * it->first->getRVWorldPosition();
@@ -221,6 +299,7 @@
{
it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("arrows.png", it->first->getRadarObjectColour()));
it->second.wasOutOfView_ = true;
+ it->second.target_->hide();
}
//float xDistScale = this->getActualSize().x * 1000.0f * this->navMarkerSize_ / dist;
@@ -283,6 +362,7 @@
//it->second.panel_->setMaterialName("Orxonox/NavTDC");
it->second.panel_->setMaterialName(TextureGenerator::getMaterialName("tdc.png", it->first->getRadarObjectColour()));
it->second.panel_->setDimensions(this->navMarkerSize_ * this->getActualSize().x, this->navMarkerSize_ * this->getActualSize().y);
+ it->second.target_->setDimensions(this->aimMarkerSize_ * this->getActualSize().x, this->aimMarkerSize_ * this->getActualSize().y);
it->second.wasOutOfView_ = false;
}
@@ -294,25 +374,65 @@
// Position text
it->second.text_->setLeft((pos.x + 1.0f + it->second.panel_->getWidth()) * 0.5f);
it->second.text_->setTop((-pos.y + 1.0f + it->second.panel_->getHeight()) * 0.5f);
+
+ // Make sure the overlays are shown
+ it->second.panel_->show();
+ it->second.text_->show();
+
+ // Target marker
+ const Pawn* pawn = dynamic_cast<const Pawn*>(it->first->getWorldEntity());
+ /* Pawn* humanPawn = HumanController::getLocalControllerEntityAsPawn();*/
+ if(!it->second.selected_
+ || it->first->getRVVelocity().squaredLength() == 0
+ || pawn == NULL
+ /* TODO : improve getTeam in such a way that it works
+ * || humanPawn == NULL
+ * || pawn->getTeam() == humanPawn->getTeam()*/)
+ {
+ // don't show marker for not selected enemies nor if the selected doesn't move
+ it->second.target_->hide();
+ }
+ else // object is selected and moves
+ {
+ // get the aim position
+ Vector3* targetPos = this->toAimPosition(it->first);
+ // Transform to screen coordinates
+ Vector3 screenPos = camTransform * (*targetPos);
+ // Check if the target marker is in view too
+ if(screenPos.z > 1 || screenPos.x < -1.0 || screenPos.x > 1.0
+ || screenPos.y < -1.0 || screenPos.y > 1.0)
+ {
+ it->second.target_->hide();
+ }
+ else
+ {
+ it->second.target_->setLeft((screenPos.x + 1.0f - it->second.target_->getWidth()) * 0.5f);
+ it->second.target_->setTop((-screenPos.y + 1.0f - it->second.target_->getHeight()) * 0.5f);
+ it->second.target_->show();
+ }
+ delete targetPos;
+ }
+
}
-
- // Make sure the overlays are shown
- it->second.panel_->show();
- it->second.text_->show();
}
else // do not display on HUD
+
{
it->second.panel_->hide();
it->second.text_->hide();
+ it->second.target_->hide();
}
}
+
+ this->closestTarget_ = false;
+ this->nextTarget_ = false;
}
/** Overridden method of OrxonoxOverlay.
- @details
- Usually the entire overlay scales with scale().
- Here we obviously have to adjust this.
- */
+ @details
+ Usually the entire overlay scales with scale().
+ Here we obviously have to adjust this.
+ */
void HUDNavigation::sizeChanged()
{
// Use size to compensate for aspect ratio if enabled.
@@ -325,17 +445,19 @@
it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
if (it->second.text_ != NULL)
it->second.text_->setCharHeight(it->second.text_->getCharHeight() * yScale);
+ if (it->second.target_ != NULL)
+ it->second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
}
}
void HUDNavigation::addObject(RadarViewable* object)
{
if (showObject(object) == false)
- return;
+ return;
if (this->activeObjectList_.size() >= this->markerLimit_)
- if (object == NULL)
- return;
+ if (object == NULL)
+ return;
// Object hasn't been added yet (we know that)
assert(this->activeObjectList_.find(object) == this->activeObjectList_.end());
@@ -348,25 +470,35 @@
// Create arrow/marker
Ogre::PanelOverlayElement* panel = static_cast<Ogre::PanelOverlayElement*>( Ogre::OverlayManager::getSingleton()
- .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberString()));
+ .createOverlayElement("Panel", "HUDNavigation_navMarker_" + getUniqueNumberString()));
//panel->setMaterialName("Orxonox/NavTDC");
panel->setMaterialName(TextureGenerator::getMaterialName("tdc.png", object->getRadarObjectColour()));
panel->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);
//panel->setColour(object->getRadarObjectColour());
+ // Create target marker
+ Ogre::PanelOverlayElement* target = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
+ .createOverlayElement("Panel", "HUDNavigation_targetMarker_" + getUniqueNumberString()));
+ target->setMaterialName(TextureGenerator::getMaterialName("target.png", object->getRadarObjectColour()));
+ target->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);
+
+ // Create text
Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*>( Ogre::OverlayManager::getSingleton()
- .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
+ .createOverlayElement("TextArea", "HUDNavigation_navText_" + getUniqueNumberString()));
text->setFontName(this->fontName_);
text->setCharHeight(text->getCharHeight() * yScale);
text->setColour(object->getRadarObjectColour());
panel->hide();
+ target->hide();
text->hide();
- ObjectInfo tempStruct = {panel, text, false /*, TODO: initialize wasOutOfView_ */};
+ ObjectInfo tempStruct =
+ { panel, target, text, false, false, false};
this->activeObjectList_[object] = tempStruct;
this->background_->addChild(panel);
+ this->background_->addChild(target);
this->background_->addChild(text);
this->sortedObjectList_.push_front(std::make_pair(object, (unsigned int)0));
@@ -380,9 +512,11 @@
{
// Detach overlays
this->background_->removeChild(it->second.panel_->getName());
+ this->background_->removeChild(it->second.target_->getName());
this->background_->removeChild(it->second.text_->getName());
// Properly destroy the overlay elements (do not use delete!)
Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.panel_);
+ Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.target_);
Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.text_);
// Remove from the list
this->activeObjectList_.erase(viewable);
@@ -408,10 +542,10 @@
bool HUDNavigation::showObject(RadarViewable* rv)
{
if (rv == orxonox_cast<RadarViewable*>(this->getOwner()))
- return false;
+ return false;
assert(rv->getWorldEntity());
if (rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() == false)
- return false;
+ return false;
return true;
}
@@ -421,7 +555,37 @@
for (std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it)
{
if (!(*it)->isHumanShip_)
- this->addObject(*it);
+ this->addObject(*it);
}
}
+
+ Vector3* HUDNavigation::toAimPosition(RadarViewable* target) const
+ {
+ Vector3 wePosition = HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition();
+ Vector3 targetPosition = target->getRVWorldPosition();
+ Vector3 targetSpeed = target->getRVVelocity();
+ Vector3 relativePosition = targetPosition - wePosition; //Vector from attacker to target
+
+ float p_half = relativePosition.dotProduct(targetSpeed)/(targetSpeed.squaredLength() - this->currentMunitionSpeed_ * this->currentMunitionSpeed_);
+ float time1 = -p_half + sqrt(p_half * p_half - relativePosition.squaredLength()/(targetSpeed.squaredLength() - this->currentMunitionSpeed_ * this->currentMunitionSpeed_));
+
+ Vector3* result = new Vector3(targetPosition + targetSpeed * time1);
+ return result;
+ }
+
+ void HUDNavigation::selectClosestTarget()
+ {
+ if(HUDNavigation::localHUD_s)
+ {
+ HUDNavigation::localHUD_s->closestTarget_ = true;
+ }
+ }
+
+ void HUDNavigation::selectNextTarget()
+ {
+ if(HUDNavigation::localHUD_s)
+ {
+ HUDNavigation::localHUD_s->nextTarget_ = true;
+ }
+ }
}
Modified: code/trunk/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.h 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -70,13 +70,18 @@
inline unsigned int getMarkerLimit() const
{ return this->markerLimit_; }
+ static void selectClosestTarget();
+ static void selectNextTarget();
+
private:
struct ObjectInfo
{
Ogre::PanelOverlayElement* panel_;
+ Ogre::PanelOverlayElement* target_;
Ogre::TextAreaOverlayElement* text_;
bool outOfView_;
bool wasOutOfView_;
+ bool selected_;
};
bool showObject(RadarViewable* rv);
@@ -84,11 +89,18 @@
// XMLPort accessors
inline void setNavMarkerSize(float size)
{
- navMarkerSize_ = size;
+ this->navMarkerSize_ = size;
this->sizeChanged();
}
inline float getNavMarkerSize() const
{ return navMarkerSize_; }
+ inline void setAimMarkerSize(float size)
+ {
+ this->aimMarkerSize_ = size;
+ this->sizeChanged();
+ }
+ inline float getAimMarkerSize() const
+ { return aimMarkerSize_; }
inline void setDetectionLimit(float limit)
{ this->detectionLimit_ = limit; }
inline float getDetectionLimit() const
@@ -103,14 +115,27 @@
float getArrowSizeX(int dist) const;
float getArrowSizeY(int dist) const;
+ Vector3* toAimPosition(RadarViewable* target) const;
+
std::map<RadarViewable*, ObjectInfo> activeObjectList_;
std::list<std::pair<RadarViewable*, unsigned int> > sortedObjectList_;
float navMarkerSize_;
+ float aimMarkerSize_;
std::string fontName_;
float textSize_;
bool showDistance_;
+ RadarViewable* selectedTarget_;
+
+ bool closestTarget_;
+ bool nextTarget_;
+
+ static HUDNavigation* localHUD_s; //!< This is used as a filter. Only the local HUD should be influenced by the static Console Command functions.
+
+
+ float currentMunitionSpeed_;
+
unsigned int markerLimit_;
float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value.
};
Modified: code/trunk/src/modules/portals/PortalEndPoint.cc
===================================================================
--- code/trunk/src/modules/portals/PortalEndPoint.cc 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/portals/PortalEndPoint.cc 2013-02-19 09:25:42 UTC (rev 9526)
@@ -27,6 +27,7 @@
*/
#include "PortalEndPoint.h"
+#include "portals/PortalLink.h"
#include <ctime>
@@ -34,10 +35,9 @@
#include "core/XMLPort.h"
#include "worldentities/MobileEntity.h"
-
#include "objects/triggers/MultiTriggerContainer.h"
-#include "portals/PortalLink.h"
+#include "sound/WorldSound.h"
namespace orxonox
{
@@ -58,6 +58,13 @@
this->setRadarObjectColour(ColourValue::White);
this->setRadarObjectShape(RadarViewable::Dot);
this->setRadarVisibility(true);
+ if( GameMode::isMaster() )
+ {
+ this->portalSound_ = new WorldSound(this);
+ this->portalSound_->setLooping(false);
+ this->attach(this->portalSound_);
+ this->portalSound_->setSource("sounds/Weapon_HsW01.ogg"); //TODO: change sound file
+ }
}
PortalEndPoint::~PortalEndPoint()
@@ -157,6 +164,11 @@
entity->setPosition(this->getWorldPosition());
entity->rotate(this->getWorldOrientation());
entity->setVelocity(this->getWorldOrientation() * entity->getVelocity());
+ //play Sound
+ if( this->portalSound_ && !(this->portalSound_->isPlaying()))
+ {
+ this->portalSound_->play();
+ }
}
}
Modified: code/trunk/src/modules/portals/PortalEndPoint.h
===================================================================
--- code/trunk/src/modules/portals/PortalEndPoint.h 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/portals/PortalEndPoint.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -114,6 +114,8 @@
int reenterDelay_;
std::map<MobileEntity *, time_t> jumpOutTimes_; //!< Stores the time at which a certain MobileEntity @ref jumpOut "jumped out" of this PortalEndPoint
std::set<MobileEntity *> recentlyJumpedOut_; //!< Stores the entities witch recently jumped out of this PortalEndPoint and haven't left the activation radius yet. This is needed in order to prevent them from beeing pulled into the PortalEndPoint they have just come out of.
+
+ WorldSound* portalSound_;
};
}
Modified: code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/HsW01.cc 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/weapons/weaponmodes/HsW01.cc 2013-02-19 09:25:42 UTC (rev 9526)
@@ -60,11 +60,14 @@
this->speed_ = 2500.0f;
this->delay_ = 0.0f;
this->setMunitionName("LaserMunition");
+ this->mesh_ = "laserbeam.mesh";
+ this->sound_ = "sounds/Weapon_HsW01.ogg";
+
this->delayTimer_.setTimer(1.0f, false, createExecutor(createFunctor(&HsW01::shot, this)));
this->delayTimer_.stopTimer();
- this->setDefaultSound("sounds/Weapon_HsW01.ogg");
+ this->setDefaultSound(this->sound_);
}
HsW01::~HsW01()
@@ -77,6 +80,8 @@
XMLPortParam(HsW01, "delay", setDelay, getDelay, xmlelement, mode);
XMLPortParam(HsW01, "material", setMaterial, getMaterial, xmlelement, mode);
+ XMLPortParam(HsW01, "projectileMesh", setMesh, getMesh, xmlelement, mode);
+ XMLPortParam(HsW01, "sound", setSound, getSound, xmlelement, mode);
}
/**
@@ -107,7 +112,7 @@
// Create the projectile.
Projectile* projectile = new Projectile(this);
Model* model = new Model(projectile);
- model->setMeshSource("laserbeam.mesh");
+ model->setMeshSource(mesh_);
model->setCastShadows(false);
projectile->attach(model);
model->setScale(5);
Modified: code/trunk/src/modules/weapons/weaponmodes/HsW01.h
===================================================================
--- code/trunk/src/modules/weapons/weaponmodes/HsW01.h 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/modules/weapons/weaponmodes/HsW01.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -60,6 +60,34 @@
private:
/**
+ @brief Set the mesh.
+ @param mesh The mesh name.
+ */
+ void setMesh(const std::string& mesh)
+ { this->mesh_ = mesh; }
+
+ /**
+ @brief Get the mesh.
+ @return Returns the mesh name.
+ */
+ const std::string& getMesh() const
+ { return this->mesh_; }
+
+ /**
+ @brief Set the sound.
+ @param mesh The Sound name.
+ */
+ void setSound(const std::string& sound)
+ { this->sound_ = sound; }
+
+ /**
+ @brief Get the sound.
+ @return Returns the sound name.
+ */
+ const std::string& getSound() const
+ { return this->sound_; }
+
+ /**
@brief Set the material.
@param material The material name.
*/
@@ -84,6 +112,11 @@
void muzzleflash();
std::string material_; //!< The material.
+ std::string mesh_; //!< The mesh.
+ std::string sound_; //!< The sound.
+
+
+
float speed_; //!< The speed of the fired projectile.
float delay_; //!< The firing delay.
Timer delayTimer_; //!< A timer to delay the firing.
Modified: code/trunk/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.cc 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.cc 2013-02-19 09:25:42 UTC (rev 9526)
@@ -101,6 +101,13 @@
return object->getWorldOrientation() * object->getVelocity();
}
+ Vector3 RadarViewable::getRVVelocity() const
+ {
+ const WorldEntity* object = this->getWorldEntity();
+ validate(object);
+ return object->getVelocity();
+ }
+
void RadarViewable::validate(const WorldEntity* object) const
{
if (!object)
Modified: code/trunk/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.h 2013-01-19 10:01:13 UTC (rev 9525)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.h 2013-02-19 09:25:42 UTC (rev 9526)
@@ -112,6 +112,7 @@
const Vector3& getRVWorldPosition() const;
Vector3 getRVOrientedVelocity() const;
+ Vector3 getRVVelocity() const;
inline void setRadarObjectShape(Shape shape)
{
More information about the Orxonox-commit
mailing list