[Orxonox-commit 6567] r11207 - in code/branches/presentationFS16: . data/gui/scripts data/levels src/orxonox src/orxonox/controllers
fvultier at orxonox.net
fvultier at orxonox.net
Thu May 26 16:38:51 CEST 2016
Author: fvultier
Date: 2016-05-26 16:38:51 +0200 (Thu, 26 May 2016)
New Revision: 11207
Added:
code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.cc
code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.h
code/branches/presentationFS16/src/orxonox/controllers/scriptTasks/
Modified:
code/branches/presentationFS16/
code/branches/presentationFS16/data/gui/scripts/testscript.lua
code/branches/presentationFS16/data/levels/scriptController.oxw
code/branches/presentationFS16/src/orxonox/CMakeLists.txt
code/branches/presentationFS16/src/orxonox/OrxonoxPrereqs.h
code/branches/presentationFS16/src/orxonox/controllers/CMakeLists.txt
code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.cc
code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.h
code/branches/presentationFS16/src/orxonox/controllers/ScriptController.cc
code/branches/presentationFS16/src/orxonox/controllers/ScriptController.h
Log:
merged scriptable controller
Property changes on: code/branches/presentationFS16
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/AI_HS15:10640-10832
/code/branches/ParticleEffectsFS15:10309-10612
/code/branches/Racingbot:9388-9513
/code/branches/SciptableControllerFS15:10308-10613
/code/branches/ScriptableController:9999-10075
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/bindermFS16:11139-11204
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/campaignHS15:10639-10973
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/clangenb:10385-10609
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/core6:9552-9666
/code/branches/core7:10328-10623
/code/branches/cpp11:10439-10732
/code/branches/cpp11_v2:10732-11067
/code/branches/cpp11_v3:11053-11070
/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/explosionChunksHS15:10641-10961
/code/branches/fabienHS15:10685-11033
/code/branches/formation:8885-8991
/code/branches/formationFS15:10320-10610
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hoverHS15:10633-10959
/code/branches/hud:8883-8986
/code/branches/hudHS14:10083-10241
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/keckslevelHS14:10082-10222
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/levelElias:9697-9921
/code/branches/levelKaan:9695-9921
/code/branches/levelMichael:9696-9921
/code/branches/leveljoemeHS14:10087-10223
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/minigame4DHS14:10081-10230
/code/branches/miniprojects:2754-2824
/code/branches/modularships:9994-10071
/code/branches/multiplayerFS15:10324-10611
/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/particleEffectsHS15:10644-10962
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/pickupsFS14:10000-10259
/code/branches/planetLevelHS15:10637-10966
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationFS14:10069-10215
/code/branches/presentationFS15:10499
/code/branches/presentationFS15merge:10595-10621
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/presentationHS14merge:10222-10257
/code/branches/presentationHS15:10959-11055
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/sfxThilo:9691-9917
/code/branches/shaders:9379-11072
/code/branches/shaders_merge:11072-11079
/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/soundEffects:9382-11020
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/storymodeHS14:10085-10254
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10236
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/towerdefenseFS15:10283-10614
/code/branches/towerdefenseHS14:10086-10247
/code/branches/turret:9380-9501
/code/branches/turretFS14:9998-10070
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weaponFS15:10302-10615
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
/code/branches/weaponupdateHS14:10084-10237
+ /code/branches/AI_HS15:10640-10832
/code/branches/ParticleEffectsFS15:10309-10612
/code/branches/Racingbot:9388-9513
/code/branches/SciptableControllerFS15:10308-10613
/code/branches/ScriptableController:9999-10075
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/bindermFS16:11139-11204
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/campaignHS15:10639-10973
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/clangenb:10385-10609
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/core6:9552-9666
/code/branches/core7:10328-10623
/code/branches/cpp11:10439-10732
/code/branches/cpp11_v2:10732-11067
/code/branches/cpp11_v3:11053-11070
/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/explosionChunksHS15:10641-10961
/code/branches/fabienHS15:10685-11033
/code/branches/formation:8885-8991
/code/branches/formationFS15:10320-10610
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hoverHS15:10633-10959
/code/branches/hud:8883-8986
/code/branches/hudHS14:10083-10241
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/keckslevelHS14:10082-10222
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/levelElias:9697-9921
/code/branches/levelKaan:9695-9921
/code/branches/levelMichael:9696-9921
/code/branches/leveljoemeHS14:10087-10223
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/minigame4DHS14:10081-10230
/code/branches/miniprojects:2754-2824
/code/branches/modularships:9994-10071
/code/branches/multiplayerFS15:10324-10611
/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/particleEffectsHS15:10644-10962
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/pickupsFS14:10000-10259
/code/branches/planetLevelHS15:10637-10966
/code/branches/plehmannFS16:11137-11206
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationFS14:10069-10215
/code/branches/presentationFS15:10499
/code/branches/presentationFS15merge:10595-10621
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/presentationHS14merge:10222-10257
/code/branches/presentationHS15:10959-11055
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/sfxThilo:9691-9917
/code/branches/shaders:9379-11072
/code/branches/shaders_merge:11072-11079
/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/soundEffects:9382-11020
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/storymodeHS14:10085-10254
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10236
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/towerdefenseFS15:10283-10614
/code/branches/towerdefenseHS14:10086-10247
/code/branches/turret:9380-9501
/code/branches/turretFS14:9998-10070
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weaponFS15:10302-10615
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
/code/branches/weaponupdateHS14:10084-10237
Modified: code/branches/presentationFS16/data/gui/scripts/testscript.lua
===================================================================
--- code/branches/presentationFS16/data/gui/scripts/testscript.lua 2016-05-26 14:15:54 UTC (rev 11206)
+++ code/branches/presentationFS16/data/gui/scripts/testscript.lua 2016-05-26 14:38:51 UTC (rev 11207)
@@ -17,24 +17,26 @@
pi = 3.1415
-- Get a local pointer to a scriptcontroller
-local ctrl = orxonox.ScriptController:getScriptController()
+local ctrl = orxonox.NewScriptController:getNewScriptController()
-- If it worked, call its "movetoposition" function
if ctrl ~= nil then
- ctrl:eventScheduler("mal", xl,yl,zl, xl,yl,zl, 2)
- ctrl:eventScheduler("idle", 1)
- ctrl:eventScheduler("ral", xl, yl, zl, 3, 3000, 0, math.pi)
- ctrl:eventScheduler("idle", 1)
- ctrl:eventScheduler("mal", 0,0,1000, xl,yl,zl, 3)
- ctrl:eventScheduler("idle", 1)
- ctrl:eventScheduler("chl", xl, yl, zl, xr, yr, zr, 2)
- ctrl:eventScheduler("idle", 1)
- ctrl:eventScheduler("mal", xr + 600,yr,zr, xr,yr,zr, 4)
- ctrl:eventScheduler("idle", 1)
- ctrl:eventScheduler("chl", xr, yr, zr, xl, yl, zl, 3)
- ctrl:eventScheduler("idle", 1)
- ctrl:eventScheduler("spi", xm,ym,zm, 0,0,0, 4)
- ctrl:eventScheduler("idle", 1)
+ ctrl:moveTo(1, 0, 0, 100, 200)
+ ctrl:moveTo(20, 0, 0, 100, 200)
+ ctrl:moveTo(40, 0, 100, 0, 200)
+ --ctrl:eventScheduler("mal", xl,yl,zl, xl,yl,zl, 10)
+ -- ctrl:eventScheduler("ral", xl, yl, zl, 3, 3000, 0, math.pi)
+ -- ctrl:eventScheduler("idle", 1)
+ -- ctrl:eventScheduler("mal", 0,0,1000, xl,yl,zl, 3)
+ -- ctrl:eventScheduler("idle", 1)
+ -- ctrl:eventScheduler("chl", xl, yl, zl, xr, yr, zr, 2)
+ -- ctrl:eventScheduler("idle", 1)
+ -- ctrl:eventScheduler("mal", xr + 600,yr,zr, xr,yr,zr, 4)
+ -- ctrl:eventScheduler("idle", 1)
+ -- ctrl:eventScheduler("chl", xr, yr, zr, xl, yl, zl, 3)
+ -- ctrl:eventScheduler("idle", 1)
+ -- ctrl:eventScheduler("spi", xm,ym,zm, 0,0,0, 4)
+ -- ctrl:eventScheduler("idle", 1)
end
\ No newline at end of file
Modified: code/branches/presentationFS16/data/levels/scriptController.oxw
===================================================================
--- code/branches/presentationFS16/data/levels/scriptController.oxw 2016-05-26 14:15:54 UTC (rev 11206)
+++ code/branches/presentationFS16/data/levels/scriptController.oxw 2016-05-26 14:38:51 UTC (rev 11207)
@@ -38,7 +38,7 @@
<Billboard position="2500,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=10 />
<DistanceTrigger position="2500,0,0" distance="200" target="Pawn"
- beaconMode="exclude" targetname="bcnDestroyer" name="takeControl"
+ beaconMode="exclude" targetname="bcnDestroyer" name="takeControl" stayActive="true"
/>
<StaticEntity position = "2000,500,2000" mass=10000 collisionType=static >
@@ -53,8 +53,27 @@
</attached>
</StaticEntity>
+
+ <StaticEntity position = "3000,0,0" mass=10000 collisionType=static >
+ <attached>
+ <Model mesh="cube_green.mesh" mass=10 position="0,0,0" scale=10 />
+ </attached>
+ </StaticEntity>
+
+ <StaticEntity position = "2000,0,0" mass=10000 collisionType=static >
+ <attached>
+ <Model mesh="cube_green.mesh" mass=10 position="0,0,0" scale=10 />
+ </attached>
+ </StaticEntity>
+
+ <StaticEntity position = "2500,500,0" mass=10000 collisionType=static >
+ <attached>
+ <Model mesh="cube_green.mesh" mass=10 position="0,0,0" scale=10 />
+ </attached>
+ </StaticEntity>
+
<!-- ControllerDirector waits for the event takeControl to attach a new Controller -->
- <ControllerDirector position="0,0,0" scriptname="presentation">
+ <ControllerDirector position="0,0,0" scriptname="testscript">
<events>
<takeControl>
<EventListener event="takeControl" />
Modified: code/branches/presentationFS16/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/presentationFS16/src/orxonox/CMakeLists.txt 2016-05-26 14:15:54 UTC (rev 11206)
+++ code/branches/presentationFS16/src/orxonox/CMakeLists.txt 2016-05-26 14:38:51 UTC (rev 11207)
@@ -65,7 +65,7 @@
controllers/HumanController.h
infos/PlayerInfo.h
sound/SoundManager.h
- controllers/ScriptController.h
+ controllers/NewScriptController.h
overlays/CampaignMenu.h
PCH_FILE
OrxonoxPrecompiledHeaders.h
Modified: code/branches/presentationFS16/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/OrxonoxPrereqs.h 2016-05-26 14:15:54 UTC (rev 11206)
+++ code/branches/presentationFS16/src/orxonox/OrxonoxPrereqs.h 2016-05-26 14:38:51 UTC (rev 11207)
@@ -97,6 +97,7 @@
class DroneController;
class HumanController;
class ScriptController;
+ class NewScriptController;
class WaypointController;
class WaypointPatrolController;
Modified: code/branches/presentationFS16/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/CMakeLists.txt 2016-05-26 14:15:54 UTC (rev 11206)
+++ code/branches/presentationFS16/src/orxonox/controllers/CMakeLists.txt 2016-05-26 14:38:51 UTC (rev 11207)
@@ -4,7 +4,6 @@
NewHumanController.cc
ArtificialController.cc
AIController.cc
- ScriptController.cc
WaypointController.cc
WaypointPatrolController.cc
DroneController.cc
@@ -18,4 +17,6 @@
FlyingController.cc
FightingController.cc
MasterController.cc
+ NewScriptController.cc
)
+ADD_SUBDIRECTORY(scriptTasks)
\ No newline at end of file
Modified: code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.cc
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.cc 2016-05-26 14:15:54 UTC (rev 11206)
+++ code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.cc 2016-05-26 14:38:51 UTC (rev 11207)
@@ -5,7 +5,7 @@
*/
#include "ControllerDirector.h"
-#include "ScriptController.h"
+#include "NewScriptController.h"
#include "core/CoreIncludes.h"
//#include "network/NetworkFunction.h"
@@ -63,7 +63,7 @@
void ControllerDirector::takeControl(Controller * controller, BaseObject * trigger)
{
/* Output a message confirming that the function was called */
- orxout(verbose)<<"test takecontrol."<< endl;
+ orxout()<<"test takecontrol."<< endl;
/* First, we set up a new controller to attach to the unit that
* triggered our event.
@@ -73,7 +73,7 @@
if( prepok == true)
{
/* Create a scriptcontroller object */
- ScriptController *newctrl = new ScriptController(this->context_);
+ NewScriptController *newctrl = new NewScriptController(this->context_);
/* Make the player we were given its slave */
newctrl->setPlayer(this->player_);
@@ -104,6 +104,8 @@
/* Increase the controller ID so we have a different one for
* the next time it is triggered */
ctrlid += 1;
+
+ orxout()<<"swag"<< endl;
}
bool ControllerDirector::preparationToTakeControl(BaseObject * trigger)
@@ -111,7 +113,7 @@
this->pTrigger_ = orxonox_cast<PlayerTrigger*>(trigger);
this->player_ = nullptr;
- orxout(verbose) << "Preparation to take Control!" << endl;
+ orxout() << "Preparation to take Control!" << endl;
// Check whether it is a player trigger and extract pawn from it
if(this->pTrigger_ != nullptr)
@@ -120,11 +122,15 @@
this->player_ = this->pTrigger_->getTriggeringPlayer();
// Check if there actually was a player returned.
- if( this->player_ == nullptr) return false;
+ if( this->player_ == nullptr) {
+ orxout()<<"swag control"<< endl;
+
+ return false;
+ }
}
else
{
- orxout(verbose) << "ControllerDirector::preparationToTakeControl "
+ orxout() << "ControllerDirector::preparationToTakeControl "
<< "Not a player trigger, can't extract pawn from it.." << endl;
return false;
}
Modified: code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.h 2016-05-26 14:15:54 UTC (rev 11206)
+++ code/branches/presentationFS16/src/orxonox/controllers/ControllerDirector.h 2016-05-26 14:38:51 UTC (rev 11207)
@@ -26,6 +26,12 @@
*
*/
+/*
+ at todo:
+
+in the take control or preparationToTakeControl functions remove the former controller and store it somewhere so it can be put back later.
+
+*/
#ifndef _ControllerDirector_H__
#define _ControllerDirector_H__
Copied: code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.cc (from rev 11206, code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.cc)
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.cc (rev 0)
+++ code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.cc 2016-05-26 14:38:51 UTC (rev 11207)
@@ -0,0 +1,293 @@
+/*
+ * 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:
+ * Paul Lehmann
+ * Co-authors:
+ * ...
+ *
+ */
+
+ /*
+ * Currently available lua commands:
+ *
+ * IMPORTANT: ALL COMMANDS DO REQUIRE 7 PARAMETERS TO BE PROVIDED. FILL UP WITH ZEROES IN UNIMPORTANT PLACES.
+ *
+ * Command | Abbreviation | Parameter 1 | '' 2 | '' 3 | '' 4 | '' 5 | '' 6 | '' 7
+ *
+ * "Move And Look" | mal | GoTo X Coordinate | '' Y '' | '' Z '' | LookAt X Coordinate | '' Y '' | '' Y '' | Duration
+ * "Rotate And Look" | ral | GoTo X Coordinate | '' Y '' | '' Z '' | Axis (1=x, 2=y, 3=z) | - | - | Duration
+ * "Spiral" | spi | GoTo X Coordinate | '' Y '' | '' Z '' | - | - | - | Duration
+ * "Transition Look" | chl | From X Coordinate | '' Y '' | '' Z '' | To X Coordinate | '' Y '' | '' Y '' | Duration
+ * "rotate round X crd"| rotX | anchor coordinate | angle(rad)| - | | | | Duration
+ * "Idle (Do nothing)" | idle | Duration
+ */
+
+#include "NewScriptController.h"
+
+#include "scriptTasks/DebugTask.h"
+#include "scriptTasks/stringOutTask.h"
+#include "scriptTasks/MoveToTask.h"
+#include "scriptTasks/Task.h"
+#include "infos/PlayerInfo.h"
+#include "core/CoreIncludes.h"
+#include "worldentities/ControllableEntity.h"
+#include "core/LuaState.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+ RegisterClass(NewScriptController);
+
+ NewScriptController::NewScriptController(Context* context) : ArtificialController(context)
+ {
+ RegisterObject(NewScriptController);
+
+
+ // Set default values for all variables
+ // - pointers to zero
+ this->player_ = nullptr;
+ this->entity_ = nullptr;
+
+ // - times
+ this->scTime_ = 0.0f;
+
+ this->context_ = context;
+
+
+ }
+
+
+
+ void NewScriptController::takeControl(int ctrlid)
+ {
+ // Output some debugging information
+ orxout(verbose) << "NewScriptController: Taking control" << endl;
+ orxout(verbose) << "This-pointer: " << this << endl;
+
+
+ // Store the entity pointer in a private variable
+ this->entity_ = this->player_->getControllableEntity();
+ assert(this->entity_);
+
+ this->ctrlid_ = ctrlid;
+ if (this->ctrlid_ == 0)
+ {
+ this->ctrlid_ = 1;
+ }
+
+ // Add the controller here to this entity. Apparently this still leaves
+ // any preexisting human controllers in place.
+
+ this->entity_->setDestroyWhenPlayerLeft(false);
+ this->player_->stopTemporaryControl();
+ this->entity_->setController(this);
+ this->setControllableEntity(this->entity_);
+ this->entity_->mouseLook();
+ this->entity_->setVisible(true);
+
+ // TODO take the human Controllers control dont forget to give it back in the destructor
+ }
+
+
+ void NewScriptController::tick(float dt)
+ {
+ // Call the tick function of the classes we derive from
+ SUPER(NewScriptController, tick, dt);
+
+
+ // If this controller has no entity entry, do nothing
+ if( !(this->entity_) ) return;
+
+ if(!this->taskList_.empty())
+ {
+ orxout() << scTime_ << endl;
+
+ orxout() << taskList_.size() << endl;
+
+
+ if(this->taskList_.front()->getStartTime() < this->scTime_)
+ {
+ activeTasks_.push_back(this->taskList_.front());
+ this->taskList_.pop_front();
+ }
+ }
+ else
+ {
+ orxout() << "no tasks in taskList_" << endl;
+ }
+
+ std::vector<Task*>::iterator it = activeTasks_.begin();
+ while (it != activeTasks_.end() )
+ {
+ if( !((*it)->update(dt)) )
+ {
+ (*(*it)).destroyLater();
+ it = activeTasks_.erase(it);
+ }
+ else
+ {
+ it++;
+ }
+
+ }
+
+
+
+ scTime_ += dt;
+ }
+
+ void NewScriptController::debugOut(float startTime)
+ {
+
+ DebugTask* task = new DebugTask(context_);
+
+ task->initialize(startTime);
+
+ bool inserted = false;
+
+ if(taskList_.empty())
+ {
+ taskList_.push_front(task);
+ inserted = true;
+ }
+
+ else
+ {
+ for (std::list<Task*>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime
+ {
+ orxout() << "debugOutTask" << endl;
+
+ if(task->getStartTime() < (*it)->getStartTime() )
+ {
+ taskList_.insert(it, task);
+ inserted = true;
+ break;
+ }
+ }
+ }
+
+ if (!inserted)
+ {
+ taskList_.push_back(task);
+ }
+
+ }
+
+ void NewScriptController::stringOut(float startTime, std::string output)
+ {
+
+ stringOutTask* task = new stringOutTask(context_);
+
+ task->initialize(startTime, output);
+
+ bool inserted = false;
+
+ if(taskList_.empty())
+ {
+ taskList_.push_front(task);
+ inserted = true;
+ }
+
+ else
+ {
+ for (std::list<Task*>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime
+ {
+ orxout() << "stringOutTask" << endl;
+
+ if(task->getStartTime() < (*it)->getStartTime() )
+ {
+ taskList_.insert(it, task);
+ inserted = true;
+ break;
+ }
+ }
+ }
+
+ if (!inserted)
+ {
+ taskList_.push_back(task);
+ }
+
+ }
+
+ void NewScriptController::moveTo(float startTime, float x, float y, float z, float velocity)
+ {
+
+ MoveToTask* task = new MoveToTask(context_);
+
+ Vector3 destination = Vector3(x,y,z);
+
+ task->initialize(startTime, player_, destination, velocity);
+
+ bool inserted = false;
+
+ if(taskList_.empty())
+ {
+ taskList_.push_front(task);
+ inserted = true;
+ }
+
+ else
+ {
+ for (std::list<Task*>::iterator it = taskList_.begin(); it != taskList_.end(); it++) // insert sorted by starttime
+ {
+ orxout() << "stringOutTask" << endl;
+
+ if(task->getStartTime() < (*it)->getStartTime() )
+ {
+ taskList_.insert(it, task);
+ inserted = true;
+ break;
+ }
+ }
+ }
+
+ if (!inserted)
+ {
+ taskList_.push_back(task);
+ }
+
+ }
+
+ NewScriptController* NewScriptController::getNewScriptController()
+ {
+ /* Output a message that confirms this function was called */
+ orxout() << "Great success!" << std::endl;
+
+ /* Debugging: print all the scriptcontroller object pointers */
+ for(NewScriptController* controller : ObjectList<NewScriptController>())
+ { orxout() << "Have object in list: " << controller << endl; }
+
+ /* Find the first one with a nonzero ID */
+ for(NewScriptController* controller : ObjectList<NewScriptController>())
+ {
+ // TODO: do some selection here. Currently just returns the first one
+ if( controller->getID() > 0 )
+ { orxout() << "Controller to return: " << controller << endl;
+ return controller;
+ }
+
+ }
+ return nullptr;
+ }
+
+}
Copied: code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.h (from rev 11206, code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h)
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.h (rev 0)
+++ code/branches/presentationFS16/src/orxonox/controllers/NewScriptController.h 2016-05-26 14:38:51 UTC (rev 11207)
@@ -0,0 +1,125 @@
+/*
+ * 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:
+ * Paul Lehmann
+ * Co-authors:
+ * ...
+ *
+ *
+ *
+ */
+
+#ifndef _NewScriptController_H__
+#define _NewScriptController_H__
+
+#include "scriptTasks/DebugTask.h"
+#include "scriptTasks/stringOutTask.h"
+#include "scriptTasks/MoveToTask.h"
+#include "scriptTasks/Task.h"
+#include "OrxonoxPrereqs.h" /* die ganzen tolua, kopiert aus Dock.h*/
+#include "ArtificialController.h"
+#include "core/EventIncludes.h"
+
+
+
+namespace orxonox // tolua_export
+{ // tolua_export
+
+ /**
+ @brief
+
+ A scriptController to carry out tasks on an entity.
+ The tasks are provided as a lua script.
+ The commands which are exported to lua have to create the specified task, initialze it and add it to the TaskList.
+
+ Important add the export comment after functions that need to be accessed from the lua script.
+
+ @todo
+
+ take away the human controller and put it back into place when this controller is deleted.
+ This is probably better done in the controller director class.
+
+ remove the startTimes of the tasks so that the lua script is just carried out one task after the other.
+ to avoid problems when to tasks are carried out simultainiously.
+
+ also the velocity while the controller is taking control is kept and hinders the tasks.
+
+ the moveToTask does not work right.
+ */
+
+ class _OrxonoxExport NewScriptController // tolua_export
+ : public ArtificialController, public Tickable
+ { // tolua_export
+ public:
+ NewScriptController(Context* context);
+ virtual ~NewScriptController() { }
+
+ void takeControl(int ctrlid);
+ void setPlayer(PlayerInfo* player) { this->player_ = player; }
+
+ virtual void tick(float dt) override;
+
+ // LUA interface
+
+ void debugOut(float startTime);// tolua_export
+
+ void stringOut(float startTime, std::string output);// tolua_export
+
+ void moveTo(float startTime, float x, float y, float z, float velocity);// tolua_export
+
+ static NewScriptController* getNewScriptController();// tolua_export
+
+ int getID() { return ctrlid_; }// tolua_export
+
+ void printDebug() {orxout() << "fffff" << endl;} // tolua_export
+
+ private:
+ // Information about the player that this ScriptController will
+ // control
+ // - Player pointer
+ PlayerInfo* player_;
+
+ // - Entity pointer, this is for convenience and will be the same as
+ // player_->getControllableEntity()
+ ControllableEntity* entity_;
+
+ // Controller ID, defaults to 0 and is set using takeControl()
+ int ctrlid_;
+
+ // List of events to walk through sorted by starting times
+ std::list<Task*> taskList_;
+
+ //List of Tasks currently active
+ std::vector<Task*> activeTasks_;
+
+ // Time since the creation of this ScriptController object
+ float scTime_;
+
+
+ // context of the Controller to create the tasks
+ Context* context_;
+
+
+ };// tolua_export
+} // tolua_export
+
+#endif /* _NewScriptController_H__ */
\ No newline at end of file
Modified: code/branches/presentationFS16/src/orxonox/controllers/ScriptController.cc
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/ScriptController.cc 2016-05-26 14:15:54 UTC (rev 11206)
+++ code/branches/presentationFS16/src/orxonox/controllers/ScriptController.cc 2016-05-26 14:38:51 UTC (rev 11207)
@@ -33,10 +33,11 @@
*
* Command | Abbreviation | Parameter 1 | '' 2 | '' 3 | '' 4 | '' 5 | '' 6 | '' 7
*
- * "Move And Look" | mal | GoTo X Coordinate | '' Y '' | '' Z '' | LookAt X Coordinate | '' Y '' | '' Y '' | Duration
- * "Rotate And Look" | ral | GoTo X Coordinate | '' Y '' | '' Z '' | Axis (1=x, 2=z, 3=z) | - | - | Duration
- * "Spiral" | spi | GoTo X Coordinate | '' Y '' | '' Z '' | - | - | - | Duration
- * "Transition Look" | chl | From X Coordinate | '' Y '' | '' Z '' | To X Coordinate | '' Y '' | '' Y '' | Duration
+ * "Move And Look" | mal | GoTo X Coordinate | '' Y '' | '' Z '' | LookAt X Coordinate | '' Y '' | '' Y '' | Duration
+ * "Rotate And Look" | ral | GoTo X Coordinate | '' Y '' | '' Z '' | Axis (1=x, 2=y, 3=z) | - | - | Duration
+ * "Spiral" | spi | GoTo X Coordinate | '' Y '' | '' Z '' | - | - | - | Duration
+ * "Transition Look" | chl | From X Coordinate | '' Y '' | '' Z '' | To X Coordinate | '' Y '' | '' Y '' | Duration
+ * "rotate round X crd"| rotX | anchor coordinate | angle(rad)| - | | | | Duration
* "Idle (Do nothing)" | idle | Duration
*/
@@ -45,7 +46,6 @@
#include "core/CoreIncludes.h"
#include "worldentities/ControllableEntity.h"
#include "core/LuaState.h"
-#include "core/LuaState.h"
#include "util/Math.h"
namespace orxonox
@@ -89,7 +89,7 @@
{
/* Output some debugging information */
orxout(verbose) << "ScriptController: Taking control" << endl;
- orxout(verbose) << "This-pointer: " << this << endl;
+ orxout(verbose) << "This-pointer: " << this << endl;
/* Set the controller ID (the argument here should be nonzero) */
this->ctrlid_ = ctrlid;
@@ -102,11 +102,13 @@
* any preexisting human controllers in place.
*/
this->entity_->setDestroyWhenPlayerLeft(false);
- this->player_->pauseControl();
+ this->player_->stopTemporaryControl();
this->entity_->setController(this);
this->setControllableEntity(this->entity_);
- this->entity_->mouseLook();
- this->entity_->setVisible(false);
+ //this->entity_->mouseLook();
+ //this->entity_->setVisible(false);
+
+ // TODO take the human Controllers control dont forget to give it back in the destructor
}
const Vector3& ScriptController::getPosition()
@@ -200,69 +202,23 @@
if( this->processing )
{
// Abbreviation for "spiral" (rotation + translation)
- if (this->currentEvent.fctName == "spi") {
-
- // Need to know a perpendicular basis to the translation vector:
- // Given (a, b, c) we chose (b, -a, 0)norm and (0, c, -b)norm
- // Currently we set a fix rotational radius of 400
- // TODO: Add an option to adjust radius of spiral movement
- Vector3 direction = this->currentEvent.v1 - startpos;
-
- Vector3* ortho1 = new Vector3(direction.y, -direction.x, 0);
- float absOrtho1 = sqrt(direction.y * direction.y + direction.x * direction.x);
- *ortho1 = 400 * cos(2 * math::pi * dl) * (*ortho1)/absOrtho1;
-
- Vector3* ortho2 = new Vector3(0, direction.z, -direction.y);
- float absOrtho2 = sqrt(direction.y * direction.y + direction.z * direction.z);
- *ortho2 = 400 * sin(2 * math::pi * dl) * (*ortho2)/absOrtho2;
-
- this->entity_->setPosition( (1-dl)*startpos + dl * this->currentEvent.v1 + *ortho1 + *ortho2);
-
- delete ortho1;
- delete ortho2;
+ if (this->currentEvent.fctName == "spi")
+ {
+ spi(dl); // call the external function
}
// Abbreviation for "rotate and look"
- if (this->currentEvent.fctName == "ral")
+ else if (this->currentEvent.fctName == "ral")
{
- // Specify the axis
- Vector3 a;
- switch ((int) currentEvent.d) {
- case 3:
- a = Vector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*math::pi*dl),
- this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
- this->currentEvent.v1.z);
- break;
- case 2:
- a = Vector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*math::pi*dl),
- this->currentEvent.v1.y,
- this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
- break;
- case 1:
- a = Vector3(this->currentEvent.v1.x,
- this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
- this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
- break;
- }
-
- this->entity_->setPosition(a);
-
- /* Look at the specified position */
- this->entity_->lookAt(this->currentEvent.v1);
+ ral(dl);
}
else if( this->currentEvent.fctName == "mal" )
{
- /* Set the position to the correct place in the trajectory */
- this->entity_->setPosition( (1-dl)*startpos + dl * this->currentEvent.v1);
-
- /* Look at the specified position */
- this->entity_->lookAt(this->currentEvent.v2);
+ mal(dl);
}
else if( this->currentEvent.fctName == "chl" )
{
- /* Sweep the look from v1 to v2 */
- this->entity_->lookAt( (1-dl)*this->currentEvent.v1 +
- dl * this->currentEvent.v2 );
+ chl(dl);
}
@@ -340,4 +296,83 @@
this->eventno += 1;
}
+
+ // Event Functions
+
+ void ScriptController::spi(float dl)
+ {
+
+ // Need to know a perpendicular basis to the translation vector:
+ // Given (a, b, c) we chose (b, -a, 0)norm and (0, c, -b)norm
+ // Currently we set a fix rotational radius of 400
+ // TODO: Add an option to adjust radius of spiral movement
+ Vector3 direction = this->currentEvent.v1 - startpos;
+
+ Vector3* ortho1 = new Vector3(direction.y, -direction.x, 0);
+ float absOrtho1 = sqrt(direction.y * direction.y + direction.x * direction.x);
+ *ortho1 = 400 * cos(2 * math::pi * dl) * (*ortho1)/absOrtho1;
+
+ Vector3* ortho2 = new Vector3(0, direction.z, -direction.y);
+ float absOrtho2 = sqrt(direction.y * direction.y + direction.z * direction.z);
+ *ortho2 = 400 * sin(2 * math::pi * dl) * (*ortho2)/absOrtho2;
+
+ this->entity_->setPosition( (1-dl)*startpos + dl * this->currentEvent.v1 + *ortho1 + *ortho2);
+
+ delete ortho1;
+ delete ortho2;
+
+ }
+
+ void ScriptController::ral(float dl)
+ {
+ // Specify the axis
+ Vector3 a;
+ switch ((int) currentEvent.d) {
+ case 3:
+ a = Vector3(this->currentEvent.v1.x + this->currentEvent.e*cos(2*math::pi*dl),
+ this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
+ this->currentEvent.v1.z);
+ break;
+ case 2:
+ a = Vector3(this->currentEvent.v1.x + this->currentEvent.e*sin(2*math::pi*dl),
+ this->currentEvent.v1.y,
+ this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
+ break;
+ case 1:
+ a = Vector3(this->currentEvent.v1.x,
+ this->currentEvent.v1.y + this->currentEvent.e*sin(2*math::pi*dl),
+ this->currentEvent.v1.z + this->currentEvent.e*cos(2*math::pi*dl));
+ break;
+ }
+
+ this->entity_->setPosition(a);
+
+ /* Look at the specified position */
+ this->entity_->lookAt(this->currentEvent.v1);
+
+ }
+
+ void ScriptController::mal(float dl)
+ {
+ /* Set the position to the correct place in the trajectory */
+ this->entity_->setPosition( (1-dl)*startpos + dl * this->currentEvent.v1);
+
+ /* Look at the specified position */
+ this->entity_->lookAt(this->currentEvent.v2);
+
+ }
+
+ void ScriptController::chl(float dl)
+ {
+ /* Sweep the look from v1 to v2 */
+ this->entity_->lookAt( (1-dl)*this->currentEvent.v1 +
+ dl * this->currentEvent.v2 );
+
+ }
+
+ void ScriptController::rotX(float dl)
+ {
+
+
+ }
}
Modified: code/branches/presentationFS16/src/orxonox/controllers/ScriptController.h
===================================================================
--- code/branches/presentationFS16/src/orxonox/controllers/ScriptController.h 2016-05-26 14:15:54 UTC (rev 11206)
+++ code/branches/presentationFS16/src/orxonox/controllers/ScriptController.h 2016-05-26 14:38:51 UTC (rev 11207)
@@ -35,8 +35,8 @@
-namespace orxonox // tolua_export
-{ // tolua_export
+namespace orxonox
+{
/** Structure to describe a single event */
struct event
@@ -60,9 +60,9 @@
float eventTime;
};
- class _OrxonoxExport ScriptController // tolua_export
+ class _OrxonoxExport ScriptController
: public ArtificialController, public Tickable
- { // tolua_export
+ {
public:
ScriptController(Context* context);
virtual ~ScriptController() { }
@@ -72,8 +72,7 @@
virtual void tick(float dt) override;
- // LUA interface
- // tolua_begin
+
void eventScheduler(std::string instruction = "",
float x1 = 0, float y1 = 0, float z1 = 0,
float x2 = 0, float y2 = 0, float z2 = 0,
@@ -83,7 +82,7 @@
int getID() { return ctrlid_; }
- // tolua_end
+
const Vector3& getPosition();
void execute(event ev);
@@ -127,7 +126,25 @@
/* - Position to look at during that transition */
//Vector3 lookAtPosition;
- };// tolua_export
-} // tolua_export
+ /* private member functions */
+
+ /*spiral event*/
+ void spi(float dl);
+
+ /* rotate and look event */
+ void ral(float dl);
+
+ /* move and look event */
+ void mal(float dl);
+
+ /* transition look event */
+ void chl(float dl);
+
+ /* rotate around x-coordinate event */
+ void rotX(float dl);
+
+ };
+}
+
#endif /* _ScriptController_H__ */
More information about the Orxonox-commit
mailing list