[Orxonox-commit 7015] r11634 - in code/branches/CampaignMap_HS17: data/levels data/levels/templates data/overlays src/orxonox/worldentities/pawns

fanconic at orxonox.net fanconic at orxonox.net
Mon Dec 4 16:12:53 CET 2017


Author: fanconic
Date: 2017-12-04 16:12:52 +0100 (Mon, 04 Dec 2017)
New Revision: 11634

Added:
   code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/StoryModePawn.cc
   code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/StoryModePawn.h
Modified:
   code/branches/CampaignMap_HS17/data/levels/NC_StoryModeLevel.oxw
   code/branches/CampaignMap_HS17/data/levels/templates/StoryModeEscort.oxt
   code/branches/CampaignMap_HS17/data/overlays/StoryModeHUD2.oxo
   code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/CMakeLists.txt
Log:
Camera can now move freely, with mpressing the arrows.

Modified: code/branches/CampaignMap_HS17/data/levels/NC_StoryModeLevel.oxw
===================================================================
--- code/branches/CampaignMap_HS17/data/levels/NC_StoryModeLevel.oxw	2017-12-04 15:12:06 UTC (rev 11633)
+++ code/branches/CampaignMap_HS17/data/levels/NC_StoryModeLevel.oxw	2017-12-04 15:12:52 UTC (rev 11634)
@@ -27,7 +27,7 @@
     skybox       = "Orxonox/Starbox"
   >
 
-  <SpawnPoint position="000.000, 000.000, 1000.000" spawnclass=SpaceShip orientation="0, 0, 0, 1" pawndesign= StoryModeEscort />
+  <SpawnPoint position="000.000, 000.000, 1000.000" spawnclass=StoryModePawn orientation="0, 0, 0, 1" pawndesign= StoryModeEscort />
    
 
  <StoryModePlanet levelName="plizzanet1" position="0,0,0" direction="0,0,0">

Modified: code/branches/CampaignMap_HS17/data/levels/templates/StoryModeEscort.oxt
===================================================================
--- code/branches/CampaignMap_HS17/data/levels/templates/StoryModeEscort.oxt	2017-12-04 15:12:06 UTC (rev 11633)
+++ code/branches/CampaignMap_HS17/data/levels/templates/StoryModeEscort.oxt	2017-12-04 15:12:52 UTC (rev 11634)
@@ -1,6 +1,6 @@
 <Template name=StoryModeEscort>
-  <SpaceShip
-   hudtemplate            = StoryModeHUD
+  <StoryModePawn
+   hudtemplate            = StoryModeHUD2
    camerapositiontemplate = spaceshipghostcameras
    spawnparticlesource    = "Orxonox/fairytwirl"
    spawnparticleduration  = 3
@@ -70,17 +70,17 @@
 <?lua
   include("../includes/weaponSettingsEscort.oxi")
 ?>
-  </SpaceShip>
+  </StoryModePawn>
 </Template>
 
 <Template name=spaceshipescortcameras defaults=0>
-  <SpaceShip>
+  <StoryModePawn>
     <camerapositions>
       <CameraPosition position="0,0, 1000" drag=true mouselook=true />
       <CameraPosition position="0,20, 90" drag=true mouselook=true />
       <CameraPosition position="0,30,120" drag=true mouselook=true />
     </camerapositions>
-  </SpaceShip>
+  </StoryModePawn>
 </Template>
 
 <Template name=spaceshipescortengine baseclass=MultiStateEngine>

Modified: code/branches/CampaignMap_HS17/data/overlays/StoryModeHUD2.oxo
===================================================================
--- code/branches/CampaignMap_HS17/data/overlays/StoryModeHUD2.oxo	2017-12-04 15:12:06 UTC (rev 11633)
+++ code/branches/CampaignMap_HS17/data/overlays/StoryModeHUD2.oxo	2017-12-04 15:12:52 UTC (rev 11634)
@@ -1,5 +1,5 @@
-<Template name="StoryModeHUD">
-  <OverlayGroup name = "StoryModeHUD" scale = "1, 1">\
+<Template name="StoryModeHUD2">
+  <OverlayGroup name = "StoryModeHUD2" scale = "1, 1">\
 
     <StoryModeHUD
      name           = "StoryMode"

Modified: code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/CMakeLists.txt
===================================================================
--- code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/CMakeLists.txt	2017-12-04 15:12:06 UTC (rev 11633)
+++ code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/CMakeLists.txt	2017-12-04 15:12:52 UTC (rev 11634)
@@ -6,4 +6,5 @@
   ModularSpaceShip.cc
   TeamBaseMatchBase.cc
   Destroyer.cc
+  StoryModePawn.cc
 )

Added: code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/StoryModePawn.cc
===================================================================
--- code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/StoryModePawn.cc	                        (rev 0)
+++ code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/StoryModePawn.cc	2017-12-04 15:12:52 UTC (rev 11634)
@@ -0,0 +1,99 @@
+/*
+ *   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)
+        {
+            Vector3 newPos = this->getCamera()->getPosition();
+            newPos.y += value.x;
+            this->getCamera()->setPosition(newPos);
+        }
+
+    void StoryModePawn::moveRightLeft(const Vector2& value)
+        {   
+            Vector3 newPos = this->getCamera()->getPosition();
+            newPos.x += 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) { }
+}

Added: code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/StoryModePawn.h
===================================================================
--- code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/StoryModePawn.h	                        (rev 0)
+++ code/branches/CampaignMap_HS17/src/orxonox/worldentities/pawns/StoryModePawn.h	2017-12-04 15:12:52 UTC (rev 11634)
@@ -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:
+ *      Cyrill Burgener
+ *
+ */
+
+/**
+    @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