[Orxonox-commit 7063] r11681 - in code/branches/Presentation_HS17: . data/levels data/levels/templates data/overlays src/modules/overlays/hud src/orxonox/gametypes src/orxonox/infos src/orxonox/worldentities src/orxonox/worldentities/pawns

patricwi at orxonox.net patricwi at orxonox.net
Sat Dec 16 13:32:02 CET 2017


Author: patricwi
Date: 2017-12-16 13:32:02 +0100 (Sat, 16 Dec 2017)
New Revision: 11681

Added:
   code/branches/Presentation_HS17/data/levels/NC_StoryModeLevel
   code/branches/Presentation_HS17/data/levels/NC_StoryModeLevel.oxw
   code/branches/Presentation_HS17/data/levels/templates/StoryModeEscort.oxt
   code/branches/Presentation_HS17/data/overlays/StoryModeHUD2.oxo
   code/branches/Presentation_HS17/src/modules/overlays/hud/StoryModeHUD.cc
   code/branches/Presentation_HS17/src/modules/overlays/hud/StoryModeHUD.h
   code/branches/Presentation_HS17/src/orxonox/worldentities/NameableStaticEntity.cc
   code/branches/Presentation_HS17/src/orxonox/worldentities/NameableStaticEntity.h
   code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/StoryModePawn.cc
   code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/StoryModePawn.h
Modified:
   code/branches/Presentation_HS17/
   code/branches/Presentation_HS17/data/levels/StoryModeMap.oxw
   code/branches/Presentation_HS17/data/levels/templates/StoryMode.oxt
   code/branches/Presentation_HS17/data/overlays/HUDTemplates3.oxo
   code/branches/Presentation_HS17/data/overlays/StoryModeHUD.oxo
   code/branches/Presentation_HS17/src/modules/overlays/hud/CMakeLists.txt
   code/branches/Presentation_HS17/src/orxonox/gametypes/StoryMode.cc
   code/branches/Presentation_HS17/src/orxonox/gametypes/StoryMode.h
   code/branches/Presentation_HS17/src/orxonox/infos/Bot.cc
   code/branches/Presentation_HS17/src/orxonox/worldentities/CMakeLists.txt
   code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/CMakeLists.txt
Log:
added storyMode

Index: code/branches/Presentation_HS17
===================================================================
--- code/branches/Presentation_HS17	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17	2017-12-16 12:32:02 UTC (rev 11681)

Property changes on: code/branches/Presentation_HS17
___________________________________________________________________
Modified: svn:mergeinfo
## -2,6 +2,7 ##
 /code/branches/Alejandro_FS17:11369-11447
 /code/branches/AsteroidMining_HS17:11461-11678
 /code/branches/BigShip_HS16:11213-11356
+/code/branches/CampaignMap_HS17:11458-11680
 /code/branches/Dialogue_FS17:11360-11450
 /code/branches/FlappyOrx_HS17:11460-11677
 /code/branches/HUD_HS16:11212-11353
Copied: code/branches/Presentation_HS17/data/levels/NC_StoryModeLevel (from rev 11680, code/branches/CampaignMap_HS17/data/levels/NC_StoryModeLevel)
===================================================================
Copied: code/branches/Presentation_HS17/data/levels/NC_StoryModeLevel.oxw (from rev 11680, code/branches/CampaignMap_HS17/data/levels/NC_StoryModeLevel.oxw)
===================================================================
--- code/branches/Presentation_HS17/data/levels/NC_StoryModeLevel.oxw	                        (rev 0)
+++ code/branches/Presentation_HS17/data/levels/NC_StoryModeLevel.oxw	2017-12-16 12:32:02 UTC (rev 11681)
@@ -0,0 +1,65 @@
+<LevelInfo
+ name = "NC StoryMode"
+ description = "A level in which the Campaign Menu is defined, which opens other levels."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/StoryMode.oxt")
+  include("StoryModeHUD2.oxo")
+  include("templates/spaceshipAssff.oxt")
+  include("templates/StoryModeEscort.oxt")
+  include("templates/endurancetest_template.oxt")
+?>
+
+<Level  gametype = StoryMode>
+
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+
+  <SpawnPoint position="000.000, 000.000, 000.000" spawnclass=StoryModePawn orientation="0, 0, 0, 1" pawndesign=StoryModeEscort /> 
+
+ <NameableStaticEntity levelName="Level 1" position="0,0,-500" direction="0,1,0">
+  <attached>
+    <Model position="0,0,0" mesh="ETH.mesh" scale=80 />
+  </attached>
+ </NameableStaticEntity>
+
+<NameableStaticEntity levelName="Level 2" position="500,0,-1000" direction="0,0,0">
+  <attached>
+    <Model position="0,0,0" mesh="planets/moon.mesh" scale=50 />
+  </attached>
+ </NameableStaticEntity>
+    
+<NameableStaticEntity levelName="Level 3" position="-500,0,-1000" direction="0,1,0">
+  <attached>
+    <Model position="0,0,0" mesh="can.mesh" scale=50 />
+  </attached>
+</NameableStaticEntity>
+
+<NameableStaticEntity levelName="Level 4" position="1000,0,-1500" direction="0,0,0">
+  <attached>
+    <Model position="0,0,0" mesh="cube.mesh" scale=50 />
+  </attached>
+ </NameableStaticEntity>
+
+ <NameableStaticEntity levelName="Level 5" position="-1000,0,-1500" direction="0,0,0">
+  <attached>
+    <Model position="0,0,0" mesh="Pilz.mesh" scale=50 />
+  </attached>
+ </NameableStaticEntity>
+
+  
+  </Scene>
+</Level>
+

Modified: code/branches/Presentation_HS17/data/levels/StoryModeMap.oxw
===================================================================
--- code/branches/Presentation_HS17/data/levels/StoryModeMap.oxw	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17/data/levels/StoryModeMap.oxw	2017-12-16 12:32:02 UTC (rev 11681)
@@ -12,8 +12,6 @@
   include("StoryModeHUD.oxo")
   include("templates/lodInformation.oxt")
   include("templates/StoryMode.oxt")
-
-  include("templates/lodInformation.oxt")
 ?>
 
 <Level

Modified: code/branches/Presentation_HS17/data/levels/templates/StoryMode.oxt
===================================================================
--- code/branches/Presentation_HS17/data/levels/templates/StoryMode.oxt	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17/data/levels/templates/StoryMode.oxt	2017-12-16 12:32:02 UTC (rev 11681)
@@ -1,8 +1,7 @@
 <Template name=StoryMode>
   <SpaceShip
-   hudtemplate            = StoryModeMap
+   hudtemplate            = StoryModeMap 
    camerapositiontemplate = spaceshipghostcameras
-   
   >
    
 

Copied: code/branches/Presentation_HS17/data/levels/templates/StoryModeEscort.oxt (from rev 11680, code/branches/CampaignMap_HS17/data/levels/templates/StoryModeEscort.oxt)
===================================================================
--- code/branches/Presentation_HS17/data/levels/templates/StoryModeEscort.oxt	                        (rev 0)
+++ code/branches/Presentation_HS17/data/levels/templates/StoryModeEscort.oxt	2017-12-16 12:32:02 UTC (rev 11681)
@@ -0,0 +1,128 @@
+<Template name=StoryModeEscort>
+  <StoryModePawn
+   hudtemplate            = StoryModeHUD2
+   camerapositiontemplate = spaceshipescortcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 10
+
+   health            = 80
+   maxhealth         = 200
+   initialhealth     = 80
+
+   shieldhealth        = 35
+   initialshieldhealth = 35
+   maxshieldhealth     = 60
+   shieldabsorption    = 0.9
+   shieldrechargerate  = 1
+   shieldrechargewaittime = 1
+
+   primaryThrust     = 150
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 20
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 6
+
+   collisionType     = "dynamic"
+   mass              = 80
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+  >
+    <engines>
+      <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" />
+      <Model position="0,0,0" yaw=180 pitch=90 roll=0 scale=4 mesh="escortWeapon.mesh" />
+<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
+<Model mesh="cube.mesh" mass=10 position="12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="-12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="0,0,-12" scale3D="4,4,7" /-->
+    </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0    ,0 ,  3" halfExtents="10,   4,8" />
+      <BoxCollisionShape position="12.6 ,-2,  3" halfExtents="2.8,2.8,11"/>
+      <BoxCollisionShape position="-12.6,-2,  3" halfExtents="2.8,2.8,11"/>
+      <BoxCollisionShape position="0,     0,-12" halfExtents="4  , 4 ,7" />
+    </collisionShapes>
+    <explosion>
+      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+
+      <ExplosionPart mesh="explosionparts/escort_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+      <ExplosionPart mesh="explosionparts/escort_part_2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+      <ExplosionPart mesh="explosionparts/escort_part_3.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+      <ExplosionPart mesh="explosionparts/escort_part_4.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+      <ExplosionPart mesh="explosionparts/escort_part_5.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+      <ExplosionPart mesh="explosionparts/escort_part_6.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+    </explosion>
+<?lua
+  include("../includes/weaponSettingsEscort.oxi")
+?>
+  </StoryModePawn>
+</Template>
+
+<Template name=spaceshipescortcameras defaults=0>
+  <StoryModePawn>
+    <camerapositions>
+      <CameraPosition position="0, 500, 400" drag=true mouselook=false />
+      <CameraPosition position="0,20, 90" drag=true mouselook=false />
+      <CameraPosition position="0,30,120" drag=true mouselook=false />
+    </camerapositions>
+  </StoryModePawn>
+</Template>
+
+<Template name=spaceshipescortengine baseclass=MultiStateEngine>
+  <MultiStateEngine
+   boostfactor    = 2.2
+
+   speedfront     = 200
+   speedback      =  70
+   speedleftright =  70
+   speedupdown    =  70
+
+   defEngineSndNormal = "sounds/Engine_low.ogg"
+   defEngineSndBoost = "sounds/Engine_high.ogg"
+
+   accelerationfront     = 700
+   accelerationbrake     = 700
+   accelerationback      =  125
+   accelerationleftright =  125
+   accelerationupdown    =  125
+  >
+    <EffectContainer condition="idle">
+      <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+
+      <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, -2, 14" colour="0.2, 0.5, 0.65, 1.0" width=150 length=15 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=2 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, -2, 14" colour="0.2, 0.5, 0.65, 1.0" width=15 length=15 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=2 turnofftime=1 material="Flares/ThrusterFlare1" />
+    </EffectContainer>
+    <EffectContainer condition="not idle">
+      <FadingBillboard mainstate=activity active=false scale=0.09 position="12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+      <FadingBillboard mainstate=activity active=false scale=0.09 position="-12, -2, 13" colour="0.2, 1.0, 0.65, 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.33 name=bltest position=" 12, -2, 14" colour="0.2, 1.0, 0.65, 1.0" width=5 length=1500 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+      <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, -2, 14" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+    </EffectContainer>
+
+    <EffectContainer condition="boost">
+      <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+      <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+    </EffectContainer>
+
+  </MultiStateEngine>
+</Template>

Modified: code/branches/Presentation_HS17/data/overlays/HUDTemplates3.oxo
===================================================================
--- code/branches/Presentation_HS17/data/overlays/HUDTemplates3.oxo	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17/data/overlays/HUDTemplates3.oxo	2017-12-16 12:32:02 UTC (rev 11681)
@@ -46,8 +46,8 @@
 
 <Template name="spaceshiphud">
   <OverlayGroup name = "spaceshiphud" scale = "1, 1">
-    <Map />
 
+
     <HUDHealthBar
      name              = "HealthBar1"
      background        = "Orxonox/HealthBarBackground"

Modified: code/branches/Presentation_HS17/data/overlays/StoryModeHUD.oxo
===================================================================
--- code/branches/Presentation_HS17/data/overlays/StoryModeHUD.oxo	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17/data/overlays/StoryModeHUD.oxo	2017-12-16 12:32:02 UTC (rev 11681)
@@ -1,9 +1,7 @@
 
 <Template name="StoryModeMap">
   <OverlayGroup name = "spaceshiphud" scale = "1, 1">
-    <Map />
 
-
      <GUIOverlay
       name = "CampaignMenu"
       guiname = "CampaignMenu"

Copied: code/branches/Presentation_HS17/data/overlays/StoryModeHUD2.oxo (from rev 11680, code/branches/CampaignMap_HS17/data/overlays/StoryModeHUD2.oxo)
===================================================================
--- code/branches/Presentation_HS17/data/overlays/StoryModeHUD2.oxo	                        (rev 0)
+++ code/branches/Presentation_HS17/data/overlays/StoryModeHUD2.oxo	2017-12-16 12:32:02 UTC (rev 11681)
@@ -0,0 +1,13 @@
+<Template name="StoryModeHUD2">
+  <OverlayGroup name = "StoryModeHUD2" scale = "1, 1">\
+
+    <StoryModeHUD
+     name           = "StoryMode"
+     correctaspect  = false
+     font           = "VeraMono"
+     textSize       = 0.0420
+     align          = "center"
+    />
+
+  </OverlayGroup>
+</Template>

Modified: code/branches/Presentation_HS17/src/modules/overlays/hud/CMakeLists.txt
===================================================================
--- code/branches/Presentation_HS17/src/modules/overlays/hud/CMakeLists.txt	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17/src/modules/overlays/hud/CMakeLists.txt	2017-12-16 12:32:02 UTC (rev 11681)
@@ -26,4 +26,5 @@
   PauseNotice.cc
   LastTeamStandingInfos.cc
   CountDown.cc
+  StoryModeHUD.cc
 )

Copied: code/branches/Presentation_HS17/src/modules/overlays/hud/StoryModeHUD.cc (from rev 11680, code/branches/CampaignMap_HS17/src/modules/overlays/hud/StoryModeHUD.cc)
===================================================================
--- code/branches/Presentation_HS17/src/modules/overlays/hud/StoryModeHUD.cc	                        (rev 0)
+++ code/branches/Presentation_HS17/src/modules/overlays/hud/StoryModeHUD.cc	2017-12-16 12:32:02 UTC (rev 11681)
@@ -0,0 +1,192 @@
+/*
+ *   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.
+ *
+ *   
+ *   This HUD is used for the implementation of the campaign map.
+ *   So far it can only be used to give names to an object planet.
+ *
+ *   Author:
+ *      Nikola Bolt
+ *   Co-authors:
+ *      Claudio Fanconi
+ */
+
+
+// Header file of this cc file
+#include "StoryModeHUD.h"
+
+// Ogre stuff
+#include <OgreCamera.h>
+#include <OgreFontManager.h>
+#include <OgreOverlayManager.h>
+#include <OgreTextAreaOverlayElement.h>
+#include <OgrePanelOverlayElement.h>
+
+// Other stuff
+#include <typeinfo>
+
+#include "util/Convert.h"
+#include "core/command/ConsoleCommandIncludes.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "CameraManager.h"
+#include "graphics/Camera.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/WorldEntity.h"
+#include "core/config/ConfigValueIncludes.h"
+#include "tools/TextureGenerator.h"
+#include "controllers/NewHumanController.h"
+
+#include "worldentities/NameableStaticEntity.h"
+
+namespace orxonox
+{
+    RegisterClass ( StoryModeHUD );
+
+    // Constructor of the StoryMode HUD
+    StoryModeHUD::StoryModeHUD(Context* context) : OrxonoxOverlay(context)
+    {
+        RegisterObject(StoryModeHUD);
+    }
+
+    // Destructor of the StoryMode HUD
+    StoryModeHUD::~StoryModeHUD()
+    {}
+
+    // Functions of the StoryMode HUD
+
+    // XML Port for Level construction.
+    void StoryModeHUD::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(StoryModeHUD, XMLPort, xmlelement, mode);
+
+        XMLPortParam(StoryModeHUD, "font", setFont, getFont, xmlelement, mode);
+        XMLPortParam(StoryModeHUD, "textSize", setTextSize, getTextSize, xmlelement, mode);
+    }
+
+    void StoryModeHUD::initialize(){
+        firstTick = false;
+        // Scales used for dimensions and text size
+        float xScale = this->getActualSize().x;
+        float yScale = this->getActualSize().y;
+
+        //Sets the Camera angle at 30 degrees above it, so levels can be seen better    
+        CameraManager::getInstance().getActiveCamera()->setOrientation(Vector3::UNIT_X, Degree(-30));
+
+        int i = 0;
+        for(NameableStaticEntity* planet : ObjectList<NameableStaticEntity>()){
+
+
+            Ogre::TextAreaOverlayElement* text = static_cast<Ogre::TextAreaOverlayElement*>( Ogre::OverlayManager::getSingleton()
+                    .createOverlayElement("TextArea", "StoryModeHUD_navText_" + getUniqueNumberString()));
+
+            texts.push_back(text);
+            texts[i]->setDimensions(xScale, yScale);
+
+            //font name of the text needs to be set here, not in the xml setter function
+            texts[i]->setFontName(this->fontName_);
+            texts[i]->setCharHeight(this->textSize_ * yScale);
+
+            //set text
+            texts[i]->setCaption(planet->getLevelName());
+
+            texts[i]->hide();
+        
+            this->background_->addChild(texts[i]);
+            i++;
+        }
+    }
+
+    // Set the Font of this HUD.
+    void StoryModeHUD::setFont(const std::string& font)
+    {
+        const Ogre::ResourcePtr& fontPtr = Ogre::FontManager::getSingleton().getByName(font);
+        if (fontPtr.isNull())
+        {
+            this->fontName_ = "Monofur";
+            orxout(internal_warning) << "StoryModeHUD: Font '" << font << "' not found. Font has been set to Monofur." << endl;
+            return;
+        }
+        this->fontName_ = font;
+    }
+   
+    // Gets the Font of this HUD    
+    const std::string& StoryModeHUD::getFont() const
+    {
+        return this->fontName_;
+    }
+
+    // Set the size of the Text
+    void StoryModeHUD::setTextSize(float size)
+    {
+        if (size <= 0.0f)
+        {
+            this->textSize_ = 0.05f;
+            orxout(internal_warning) << "StoryModeHUD: Non positive font size not allowed. Font size has been set to 0.05" << endl;
+            return;
+        }
+        this->textSize_ = size;
+        
+    }
+
+    // returns the Size of the Text
+    float StoryModeHUD::getTextSize() const
+    {
+        return this->textSize_;
+    }
+
+    // Tick: this is the most important function. It's recalled every frame and makes sure things happen on the screen.
+    void StoryModeHUD::tick(float dt)
+    {
+        SUPER(StoryModeHUD, tick, dt);
+
+        if(firstTick)
+            this->initialize();
+
+        // cam is the pointer which represents your camera
+        Camera* cam = CameraManager::getInstance().getActiveCamera();
+        if (cam == nullptr)
+            return;
+
+        // camTransform is a Matrix, which converts 3D world of the game into 2D on your screen
+        const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
+
+        int i = 0;
+        for(NameableStaticEntity* planet : ObjectList<NameableStaticEntity>()){
+
+            // Transform to screen coordinates
+            Vector3 pos = camTransform * planet->getWorldPosition();
+
+            // If you fly passed the description, it gets out of sight
+            if (!(pos.z > 1.0)){
+                    
+                // Position text
+                texts[i]->setLeft((pos.x+1)/2); // The (0,0) Coordinate is in the upper left corner.
+                texts[i]->setTop((-pos.y+1)/2);  // With those two calculations we set the desired positions
+
+                // Make sure the overlays are shown
+                texts[i]->show();
+            }
+            i++;
+
+        }
+    }
+}
\ No newline at end of file

Copied: code/branches/Presentation_HS17/src/modules/overlays/hud/StoryModeHUD.h (from rev 11680, code/branches/CampaignMap_HS17/src/modules/overlays/hud/StoryModeHUD.h)
===================================================================
--- code/branches/Presentation_HS17/src/modules/overlays/hud/StoryModeHUD.h	                        (rev 0)
+++ code/branches/Presentation_HS17/src/modules/overlays/hud/StoryModeHUD.h	2017-12-16 12:32:02 UTC (rev 11681)
@@ -0,0 +1,69 @@
+/*
+ *   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.  S
+ *   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:
+ *      Nikola Bolt
+ *   Co-authors:
+ *      Claudio Fanconi
+ *
+ */
+
+#ifndef _StoryModeHUD_H__
+#define _StoryModeHUD_H__
+
+#include "overlays/OverlaysPrereqs.h"
+
+#include <map>
+#include <string>
+
+#include "util/OgreForwardRefs.h"
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OrxonoxOverlay.h"
+
+namespace orxonox
+{
+    class _OverlaysExport StoryModeHUD : public OrxonoxOverlay, public Tickable
+    {
+    public:
+            StoryModeHUD(Context* context);
+            virtual ~StoryModeHUD();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+            virtual void tick(float dt) override;
+
+
+        private:
+            std::vector<Ogre::TextAreaOverlayElement*> texts;
+            void initialize();
+            virtual void setTextSize(float size);
+            virtual float getTextSize() const;
+
+            virtual void setFont(const std::string& font);
+            const std::string& getFont() const;
+
+            std::string fontName_;
+            float textSize_;
+            bool firstTick = true;
+   
+    };
+}
+
+#endif /* _StoryModeHUD_H__ */

Modified: code/branches/Presentation_HS17/src/orxonox/gametypes/StoryMode.cc
===================================================================
--- code/branches/Presentation_HS17/src/orxonox/gametypes/StoryMode.cc	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17/src/orxonox/gametypes/StoryMode.cc	2017-12-16 12:32:02 UTC (rev 11681)
@@ -30,6 +30,7 @@
 
 #include "items/Engine.h"
 #include "controllers/ArtificialController.h"
+#include "controllers/NewHumanController.h"
 
 #include "core/CoreIncludes.h"
 #include "core/command/ConsoleCommandIncludes.h"
@@ -47,6 +48,7 @@
     StoryMode::StoryMode(Context* context) : Gametype(context)
     {
         RegisterObject(StoryMode);
+        orxout() << "kill yourself1";
 
         this->gtinfo_ = new GametypeInfo(context);
         this->bAutoStart_ = true;
@@ -59,12 +61,11 @@
     {
         Gametype::start();
 
-        this->gtinfo_->sendAnnounceMessage("Marvin isch Chef");
+        this->gtinfo_->sendAnnounceMessage("send nudes");
     }
 */
     void StoryMode::exit()
     {
-        orxout() << "s funktioniert"<< endl;
         for (StoryMode* mission : ObjectList<StoryMode>())
         { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
             mission->end();
@@ -71,6 +72,7 @@
         }
         //Gametype::end();
     }
+
 /*
     void Mission::setTeams()
     { //Set pawn-colours

Modified: code/branches/Presentation_HS17/src/orxonox/gametypes/StoryMode.h
===================================================================
--- code/branches/Presentation_HS17/src/orxonox/gametypes/StoryMode.h	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17/src/orxonox/gametypes/StoryMode.h	2017-12-16 12:32:02 UTC (rev 11681)
@@ -40,6 +40,7 @@
             StoryMode(Context* context);
             virtual ~StoryMode() {}
             static void exit();
+//            virtual void playerEntered(PlayerInfo* player);
 
             
     };

Modified: code/branches/Presentation_HS17/src/orxonox/infos/Bot.cc
===================================================================
--- code/branches/Presentation_HS17/src/orxonox/infos/Bot.cc	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17/src/orxonox/infos/Bot.cc	2017-12-16 12:32:02 UTC (rev 11681)
@@ -76,6 +76,7 @@
             "Karl the Llama",
             "Thomas the Tankengine",
             "Rick",
+            "send nudes",
             "Morty",
             "Charlie the Unicorn",
             "Kung Fury",

Modified: code/branches/Presentation_HS17/src/orxonox/worldentities/CMakeLists.txt
===================================================================
--- code/branches/Presentation_HS17/src/orxonox/worldentities/CMakeLists.txt	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17/src/orxonox/worldentities/CMakeLists.txt	2017-12-16 12:32:02 UTC (rev 11681)
@@ -12,6 +12,7 @@
   TeamSpawnPoint.cc
   ExplosionPart.cc
   Actionpoint.cc
+  NameableStaticEntity.cc
 )
 
-ADD_SUBDIRECTORY(pawns)
+ADD_SUBDIRECTORY(pawns)
\ No newline at end of file

Copied: code/branches/Presentation_HS17/src/orxonox/worldentities/NameableStaticEntity.cc (from rev 11680, code/branches/CampaignMap_HS17/src/orxonox/worldentities/NameableStaticEntity.cc)
===================================================================
--- code/branches/Presentation_HS17/src/orxonox/worldentities/NameableStaticEntity.cc	                        (rev 0)
+++ code/branches/Presentation_HS17/src/orxonox/worldentities/NameableStaticEntity.cc	2017-12-16 12:32:02 UTC (rev 11681)
@@ -0,0 +1,55 @@
+/*
+ *   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:
+ *      Bolt Nikola
+ *   Co-authors:
+ *      Claudio Fanconi
+ *
+ *
+ *	 Authors' Note:
+ *	 The following class inherits of its superclass planet
+ * 	 It is meant only for the Campaign Map
+ *	 This subclass of planet has the addition, that they can be labeled ingame, just like bots are in a level gameplay (As it would be nice to see which level you can play) 
+ *	 
+ */
+
+#include "NameableStaticEntity.h"
+
+namespace orxonox
+{
+    RegisterClass(NameableStaticEntity);
+
+
+    NameableStaticEntity::NameableStaticEntity(Context* context) : StaticEntity(context)
+    {
+        RegisterObject(NameableStaticEntity);
+    }
+
+    NameableStaticEntity::~NameableStaticEntity()
+    {
+    }
+
+    void NameableStaticEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode){
+        SUPER(NameableStaticEntity, XMLPort, xmlelement, mode);
+        XMLPortParam(NameableStaticEntity, "levelName", setLevelName, getLevelName, xmlelement, mode);
+    }
+}
\ No newline at end of file

Copied: code/branches/Presentation_HS17/src/orxonox/worldentities/NameableStaticEntity.h (from rev 11680, code/branches/CampaignMap_HS17/src/orxonox/worldentities/NameableStaticEntity.h)
===================================================================
--- code/branches/Presentation_HS17/src/orxonox/worldentities/NameableStaticEntity.h	                        (rev 0)
+++ code/branches/Presentation_HS17/src/orxonox/worldentities/NameableStaticEntity.h	2017-12-16 12:32:02 UTC (rev 11681)
@@ -0,0 +1,36 @@
+/*
+*This is the header of the NameableStaticEntity.cc file
+*In this file we define a constructor, destructor and additional function (which is important to name a planet)
+*
+*Author: Bolt Nikole
+*Co-Author: Fanconi Claudio
+*
+*/
+
+#ifndef _NameableStaticEntity_H__
+#define _NameableStaticEntity_H__
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{ 
+    class _OrxonoxExport NameableStaticEntity : public StaticEntity
+    {
+    	public:
+    		NameableStaticEntity(Context* context);
+    		virtual ~NameableStaticEntity();
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+
+            inline void setLevelName(const std::string& levelname)
+                { this->levelName_ = levelname; }
+
+            inline const std::string& getLevelName()
+                { return this->levelName_; }
+
+        private:
+            std::string levelName_;
+    };
+}
+#endif
\ No newline at end of file

Modified: code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/CMakeLists.txt
===================================================================
--- code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/CMakeLists.txt	2017-12-16 12:04:11 UTC (rev 11680)
+++ code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/CMakeLists.txt	2017-12-16 12:32:02 UTC (rev 11681)
@@ -6,5 +6,6 @@
   ModularSpaceShip.cc
   TeamBaseMatchBase.cc
   Destroyer.cc
+  StoryModePawn.cc
   ShootableObstacle.cc
 )

Copied: code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/StoryModePawn.cc (from rev 11680, code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/StoryModePawn.cc)
===================================================================
--- code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/StoryModePawn.cc	                        (rev 0)
+++ code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/StoryModePawn.cc	2017-12-16 12:32:02 UTC (rev 11681)
@@ -0,0 +1,100 @@
+/*
+ *   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:
+ *      Nikola Bolt
+ *   Co-Author:
+ *      Claudio Fanconi
+ *
+ */
+
+/**
+    @file StoryModePawn.cc
+    @brief Implementation of the StoryModePawn control
+*/
+
+#include "StoryModePawn.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "graphics/Camera.h"
+
+#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
+
+namespace orxonox
+{
+    RegisterClass(StoryModePawn);
+
+    StoryModePawn::StoryModePawn(Context* context) : SpaceShip(context)
+    {
+        RegisterObject(StoryModePawn);
+        enableCollisionCallback();
+    }
+
+    void StoryModePawn::moveFrontBack(const Vector2& value)
+        {
+            //this->getCamera()->setOrientation(Vector3::UNIT_X, Degree(-30));
+            Vector3 newPos = this->getCamera()->getPosition();
+            newPos.z -= 5*value.x;
+            this->getCamera()->setPosition(newPos);
+        }
+
+    void StoryModePawn::moveRightLeft(const Vector2& value)
+        {   
+            Vector3 newPos = this->getCamera()->getPosition();
+            newPos.x += 5*value.x;
+            this->getCamera()->setPosition(newPos);
+        }
+
+    void StoryModePawn::moveUpDown(const Vector2& value) {}
+
+    void StoryModePawn::rotateYaw(const Vector2& value) {
+
+        Pawn::rotateYaw(value);
+    }
+
+    void StoryModePawn::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(StoryModePawn, XMLPort, xmlelement, mode);
+    }
+
+    /**
+    @brief
+        Removed, does nothing.
+    @param value
+    */
+    void StoryModePawn::rotatePitch(const Vector2& value) { }
+
+    /**
+    @brief
+        Removed, does nothing.
+    @param value
+    */
+    void StoryModePawn::rotateRoll(const Vector2& value) { }
+
+    /**
+    @brief
+        Removed, does nothing
+    @param bBoost
+    */
+    void StoryModePawn::boost(bool bBoost) { }
+}

Copied: code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/StoryModePawn.h (from rev 11680, code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/StoryModePawn.h)
===================================================================
--- code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/StoryModePawn.h	                        (rev 0)
+++ code/branches/Presentation_HS17/src/orxonox/worldentities/pawns/StoryModePawn.h	2017-12-16 12:32:02 UTC (rev 11681)
@@ -0,0 +1,63 @@
+/*
+ *   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:
+ *      Claudio Fanconi & Nikola Bolt
+ *
+ */
+
+/**
+    @file StoryModePawn.h
+    @brief Declaration of the StoryModePawn class.
+*/
+
+#ifndef _StoryModePawn_H__
+#define _StoryModePawn_H__
+
+#include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport StoryModePawn : public SpaceShip
+    {
+        public:
+            StoryModePawn(Context* context);
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+
+            virtual void moveFrontBack(const Vector2& value) override;
+
+            virtual void moveRightLeft(const Vector2& value) override;
+
+            virtual void moveUpDown(const Vector2& value) override;
+
+            virtual void rotateYaw(const Vector2& value) override;
+
+            virtual void rotatePitch(const Vector2& value) override;
+
+            virtual void rotateRoll(const Vector2& value) override;
+
+            virtual void boost(bool bBoost) override;
+
+    };
+}
+
+#endif /* _StoryModePawn_H__ */



More information about the Orxonox-commit mailing list