[Orxonox-commit 7453] r12060 - in code/branches/WorldMap_HS18: data/levels src/orxonox/controllers

linggj at orxonox.net linggj at orxonox.net
Wed Oct 31 10:40:50 CET 2018


Author: linggj
Date: 2018-10-31 10:40:50 +0100 (Wed, 31 Oct 2018)
New Revision: 12060

Added:
   code/branches/WorldMap_HS18/data/levels/StoryModeMapDev.oxw
   code/branches/WorldMap_HS18/data/levels/emptyLevel22.oxw
   code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc
   code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h
Log:
Story Mode Controller added

Added: code/branches/WorldMap_HS18/data/levels/StoryModeMapDev.oxw
===================================================================
--- code/branches/WorldMap_HS18/data/levels/StoryModeMapDev.oxw	                        (rev 0)
+++ code/branches/WorldMap_HS18/data/levels/StoryModeMapDev.oxw	2018-10-31 09:40:50 UTC (rev 12060)
@@ -0,0 +1,100 @@
+
+
+<LevelInfo
+ name = "StoryModeMapDev"
+ description = "DEVDEVDEV"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("StoryModeHUD.oxo")
+  include("templates/lodInformation.oxt")
+  include("templates/spaceshipAssff.oxt")
+  include("templates/StoryMode.oxt")
+?>
+
+<Level
+gametype = StoryMode
+>
+
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+<?lua
+  include("templates/spaceshipEscort.oxt")
+?>
+  <Scene
+    ambientlight = "0.2, 0.2, 0.2"
+    skybox       = "Orxonox/Starbox"
+  >
+
+
+    <StaticEntity position="0,0,0" direction="0,0,-1" >
+      <attached>
+
+        <Model name="a" position="600,370,0" mesh="planets/moon.mesh" scale=100 visible="false" />
+         
+        
+         <Model position="550,300,0" mesh="assff.mesh" scale=20  visible="true" orientation="-0.015,0.091,0.038,-0.995"/>
+               <Model position="600,370,0" mesh="Coordinates.mesh" scale=10 />
+        <Billboard colour="1,1,0.05" position="600,370,-80"  material="Flares/lensflare" scale=4.5 />
+       
+
+        <Model position="100,350,-250" mesh="planets/moon.mesh" scale=100  visible="false"/>
+         <Model position="50,300,-250" mesh="assff.mesh" scale=20  visible="true" orientation="-0.015,0.091,0.038,-0.995"/>
+        <Billboard colour="1,1,0.05" position="100,350,-330"  material="Flares/lensflare" scale=4.5 />
+
+        <Model position="-600,250,-500" mesh="planets/moon.mesh" scale=100 />
+        <Billboard colour="1,1,0.05" position="-600,250,-580"  material="Flares/lensflare" scale=5 />
+
+        <Model position="-1000,50,-750" mesh="planets/moon.mesh" scale=100 />
+        <Billboard colour="1,1,0.05" position="-1000,50,-830"  material="Flares/lensflare" scale=5 />
+
+        <Model position="-900,-400,-1000" mesh="planets/moon.mesh" scale=100 />
+        <Billboard colour="1,1,0.05" position="-900,-400,-1080"  material="Flares/lensflare" scale=5 />
+
+        <Model position="-500,-700,-1250" mesh="planets/moon.mesh" scale=100 />
+        <Billboard colour="1,1,0.05" position="-500,-700,-1330"  material="Flares/lensflare" scale=5 />
+
+        <Model position="0,-900,-1500" mesh="planets/moon.mesh" scale=100 />
+        <Billboard colour="1,1,0.05" position="0,-900,-1580" material="Flares/lensflare" scale=5 />
+
+        <Model position="700,-1100,-1750" mesh="planets/moon.mesh" scale=100 />
+        <Billboard colour="1,1,0.05" position="700,-1100,-1830"  material="Flares/lensflare" scale=5 />
+
+        <Model position="1500,-1300,-2000" mesh="planets/moon.mesh" scale=100 />
+        <Billboard colour="1,1,0.05" position="1500,-1300,-2080"  material="Flares/lensflare" scale=5 />
+
+      </attached>
+    </StaticEntity>
+    
+
+<SpaceShip position="550,300,0" lookat="0,0,0" team=3 scale=10>
+    <templates>
+        <Template link=spaceshipescort />
+    </templates>
+    <controller>
+        <StoryModeController accuracy=10 team=3>
+            <waypoints>
+                <Model mesh="cube.mesh" scale=8 position="100,350,-250" />
+                <Model mesh="cube.mesh" scale=8 position="-900,-400,-1000" />
+                <Model mesh="cube.mesh" scale=8 position="0,500,0" />
+                <StaticEntity position="0,0,0" />
+            </waypoints>
+        </StoryModeController>
+    </controller>
+</SpaceShip>
+
+
+
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+
+    <SpawnPoint position="000.000, 000.000, 1000.000" orientation="0, 0, 0, -1" pawndesign=StoryMode />
+    
+    
+  </Scene>
+</Level>
+

Added: code/branches/WorldMap_HS18/data/levels/emptyLevel22.oxw
===================================================================
--- code/branches/WorldMap_HS18/data/levels/emptyLevel22.oxw	                        (rev 0)
+++ code/branches/WorldMap_HS18/data/levels/emptyLevel22.oxw	2018-10-31 09:40:50 UTC (rev 12060)
@@ -0,0 +1,50 @@
+<LevelInfo
+ name = "Empty level22"
+ description = "A level with absolutely nothing in it."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipEscort.oxt")
+?>
+
+<Level>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+    
+    <SpaceShip position="300,0,0" lookat="0,0,0" team=3>
+    <templates>
+        <Template link=spaceshipescort />
+    </templates>
+    <controller>
+        <StoryModeController accuracy=10 team=3>
+            <waypoints>
+                <Model mesh="cube.mesh" scale=8 position="300,0,0" />
+                <Model mesh="cube.mesh" scale=8 position="300,500,0" />
+                <Model mesh="cube.mesh" scale=8 position="0,500,0" />
+                <StaticEntity position="0,0,0" />
+            </waypoints>
+        </StoryModeController>
+    </controller>
+</SpaceShip>
+  </Scene>
+  
+</Level>
+

Added: code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc	                        (rev 0)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc	2018-10-31 09:40:50 UTC (rev 12060)
@@ -0,0 +1,67 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "StoryModeController.h"
+
+#include "core/CoreIncludes.h"
+#include "worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    RegisterClass(StoryModeController);
+
+   StoryModeController::StoryModeController(Context* context) : ArtificialController(context)
+    {
+        RegisterObject(StoryModeController);
+        this->setAccuracy(100);
+    }
+
+    StoryModeController::~StoryModeController()
+    {
+        for (WorldEntity* waypoint : this->waypoints_)
+        {
+            if(waypoint)
+                waypoint->destroy();
+        }
+    }
+
+    void StoryModeController::tick(float dt)
+    {
+        if (!this->isActive())
+            return;
+
+        if (this->waypoints_.size() == 0 || !this->getControllableEntity())
+            return;
+
+        if (false /* this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_*/)
+            this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size();
+
+        //this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition());
+    }
+
+}

Added: code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h	                        (rev 0)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h	2018-10-31 09:40:50 UTC (rev 12060)
@@ -0,0 +1,53 @@
+/*
+ *   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:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _StoryModeController_H__
+#define _StoryModeController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <vector>
+#include "tools/interfaces/Tickable.h"
+#include "ArtificialController.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport StoryModeController : public ArtificialController, public Tickable
+    {
+        public:
+            StoryModeController(Context* context);
+            virtual ~StoryModeController();
+
+            virtual void tick(float dt) override;
+
+        protected:
+
+    };
+}
+
+#endif /* _WaypointController_H__ */



More information about the Orxonox-commit mailing list