[Orxonox-commit 7402] r12019 - in code/branches/PresentationFS18: . data/levels data/levels/templates src/modules/hover
patricwi at orxonox.net
patricwi at orxonox.net
Wed May 30 14:48:17 CEST 2018
Author: patricwi
Date: 2018-05-30 14:48:17 +0200 (Wed, 30 May 2018)
New Revision: 12019
Removed:
code/branches/PresentationFS18/src/modules/hover/HoverWall.cc
code/branches/PresentationFS18/src/modules/hover/HoverWall.h
code/branches/PresentationFS18/src/modules/hover/MazeGenerator.cc
code/branches/PresentationFS18/src/modules/hover/MazeGenerator.h
Modified:
code/branches/PresentationFS18/
code/branches/PresentationFS18/data/levels/Hover.oxw
code/branches/PresentationFS18/data/levels/templates/spaceshipHover.oxt
code/branches/PresentationFS18/src/modules/hover/CMakeLists.txt
code/branches/PresentationFS18/src/modules/hover/Hover.cc
Log:
Merged Hover
Index: code/branches/PresentationFS18
===================================================================
--- code/branches/PresentationFS18 2018-05-30 12:44:47 UTC (rev 12018)
+++ code/branches/PresentationFS18 2018-05-30 12:48:17 UTC (rev 12019)
Property changes on: code/branches/PresentationFS18
___________________________________________________________________
Modified: svn:mergeinfo
## -10,6 +10,7 ##
/code/branches/FlappyOrx_HS17:11460-11751
/code/branches/HUD_HS16:11212-11390,11392-11699
/code/branches/Highscore_HS16:11226-11355
+/code/branches/Hover_FS18:11821-12018
/code/branches/OrxyRoad_FS18:11823-12013
/code/branches/ParticleEffectsFS15:10309-10612
/code/branches/Presentation_HS17_merge:11723-11782
Modified: code/branches/PresentationFS18/data/levels/Hover.oxw
===================================================================
--- code/branches/PresentationFS18/data/levels/Hover.oxw 2018-05-30 12:44:47 UTC (rev 12018)
+++ code/branches/PresentationFS18/data/levels/Hover.oxw 2018-05-30 12:48:17 UTC (rev 12019)
@@ -1,5 +1,18 @@
+<!--LevelInfo Zeilen 45-66 Waende Ebene 1
+Zeilen 69-88 Waende Ebene 2
+Zeilen 91-112 Waende Ebene 3
+Zeilen 116-119 Roehre 1
+Zeilen 121-124 Roehre 2
+Zeilen 127-128 Rampe 1
+Zeilen 130-131 Rampe 2
+133 Boden 3
+137-143 Boden 1
+145-149 Boden 2
+Probleme noch bei Rampen und Roehren
+Gravity von spaceship ist in z Richtung darum alles um -90 grad um y-achse gedreht mit pitch-->
+
<LevelInfo
- name = "Hover level"
+ name = "Hover"
description = "Level for Minigame Hover"
tags = "minigame"
screenshot = "emptylevel.png"
@@ -17,13 +30,6 @@
include("overlays/HoverHUD.oxo")
?>
-<?lua
-MAZE_NUM_CELLS = 10
-MAZE_CELL_SIZE = 100
-MAZE_CELL_HEIGHT = 30
-MAZE_SIZE = MAZE_NUM_CELLS*MAZE_CELL_SIZE
-?>
-
<Level
plugins = hover
gametype = Hover
@@ -39,31 +45,132 @@
gravity = "0, -200, 0"
>
- <StaticEntity position="0,0,0" collisionType="static">
+
+ <StaticEntity position="0,0,0" pitch="-90" collisionType="static">
+
<attached>
- <HoverOrigin
- numCells="<?lua print(MAZE_NUM_CELLS)?>"
- cellSize="<?lua print(MAZE_CELL_SIZE)?>"
- cellHeight="<?lua print(MAZE_CELL_HEIGHT)?>"
- />
- <Model
- position="<?lua print(MAZE_SIZE/2)?>,-16,<?lua print(MAZE_SIZE/2)?>"
- scale3D="<?lua print(MAZE_SIZE/2)?>,16,<?lua print(MAZE_SIZE/2)?>"
- mesh="CubeGround.mesh"
- />
- </attached>
+<Model mesh="Hover.mesh" position="-1020.544,397.472,2372.286" scale="200" />
+</attached>
<collisionShapes>
- <BoxCollisionShape
- position="<?lua print(MAZE_SIZE/2)?>,<?lua print(MAZE_CELL_HEIGHT+1)?>,<?lua print(MAZE_SIZE/2)?>"
- halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
- />
- <BoxCollisionShape
- position="<?lua print(MAZE_SIZE/2)?>,-1,<?lua print(MAZE_SIZE/2)?>"
- halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
- />
- </collisionShapes>
+
+<BoxCollisionShape position="-1019.9999999999999, -1122.528, 2572.286" halfExtents="1600.0, 80.0, 200.0" />
+<BoxCollisionShape position="500.0, 397.472, 2572.286" halfExtents="80.0, 1600.0, 200.0" />
+<BoxCollisionShape position="-2544.0, 397.472, 2572.286" halfExtents="76.0, 1600.0, 200.0" />
+<BoxCollisionShape position="-1100.0, 1997.4720000000002, 2572.286" halfExtents="1520.0, 0.0, 200.0" />
+<BoxCollisionShape position="30.0, 1445.472, 2572.286" halfExtents="43.32, 400.0, 200.0" />
+<BoxCollisionShape position="-514.0, 1386.472, 2572.286" halfExtents="500.0, 51.0, 200.0" />
+<BoxCollisionShape position="130.0, 1105.472, 2572.286" halfExtents="143.32, 60.0, 200.0" />
+<BoxCollisionShape position="-754.0, 790.472, 2572.286" halfExtents="60.0, 254.99999999999997, 200.0" />
+<BoxCollisionShape position="-1568.0, 1210.112, 2572.286" halfExtents="900.0, 57.76, 200.0" />
+<BoxCollisionShape position="-1144.0, 1473.872, 2572.286" halfExtents="475.0, 206.0, 200.0" />
+<BoxCollisionShape position="-1855.9999999999998, 854.3519999999999, 2572.286" halfExtents="68.0, 302.0, 200.0" />
+<BoxCollisionShape position="-2039.9999999999998, -642.528, 2572.286" halfExtents="71.333, 400.0, 200.0" />
+<BoxCollisionShape position="20.0, -547.9580000000001, 2572.286" halfExtents="400.0, 61.370000000000005, 200.0" />
+<BoxCollisionShape position="-320.0, -647.9580000000001, 2572.286" halfExtents="60.0, 161.37, 200.0" />
+<BoxCollisionShape position="198.0, -186.588, 2572.286" halfExtents="51.0, 300.0, 200.0" />
+<BoxCollisionShape position="20.0, 626.97, 2572.286" halfExtents="400.0, 64.132, 200.0" />
+<BoxCollisionShape position="-172.0, 162.838, 2572.286" halfExtents="48.0, 400.0, 200.0" />
+<BoxCollisionShape position="-638.0, -642.528, 2572.286" halfExtents="46.989999999999995, 400.0, 200.0" />
+<BoxCollisionShape position="-1248.0, 23.472, 2572.286" halfExtents="62.5, 500.0, 200.0" />
+<BoxCollisionShape position="-974.0, -69.50800000000001, 2572.286" halfExtents="711.881, 533.02, 200.0" />
+<BoxCollisionShape position="-1620.0, -139.52800000000002, 2572.286" halfExtents="65.625, 463.0, 200.0" />
+<BoxCollisionShape position="-1920.0, 263.47200000000004, 2572.286" halfExtents="365.625, 60.0, 200.0" />
+
+<BoxCollisionShape position="2310.0, 873.574, 1384.082" halfExtents="106.4, 2240.0, 200.0" />
+<BoxCollisionShape position="176.0, 3001.574, 1384.082" halfExtents="2239.999, 112.00000000000001, 200.0" />
+<BoxCollisionShape position="-1952.0, 873.574, 1384.082" halfExtents="112.0001, 2240.0, 200.0" />
+<BoxCollisionShape position="176.0, -1260.026, 1384.082" halfExtents="2239.9991, 106.4, 200.0" />
+<BoxCollisionShape position="834.0, 474.69, 1384.082" halfExtents="890.0, 150.0, 200.0" />
+<BoxCollisionShape position="1634.0, 124.68999999999998, 1384.082" halfExtents="90.001, 500.0, 200.0" />
+<BoxCollisionShape position="1604.0, -461.228, 1384.082" halfExtents="599.999, 85.918, 200.0" />
+<BoxCollisionShape position="463.99999999999994, -955.626, 1384.082" halfExtents="121.295, 198.0, 200.0" />
+<BoxCollisionShape position="1504.0, 1183.673, 1384.082" halfExtents="699.999, 89.785, 200.0" />
+<BoxCollisionShape position="882.0, 1583.673, 1384.082" halfExtents="78.75, 489.785, 200.0" />
+<BoxCollisionShape position="1538.0, 1873.458, 1384.082" halfExtents="105.001, 600.0, 200.0" />
+<BoxCollisionShape position="1792.0000000000002, 2098.428, 1384.082" halfExtents="147.926, 66.182, 200.0" />
+<BoxCollisionShape position="470.0, 2389.574, 1384.082" halfExtents="59.239, 500.0, 200.0" />
+<BoxCollisionShape position="-88.0, 2495.674, 1384.082" halfExtents="500.0, 67.34400000000001, 200.0" />
+<BoxCollisionShape position="-1030.0, 2489.574, 1384.082" halfExtents="90.04299999999999, 400.0, 200.0" />
+<BoxCollisionShape position="-1040.0, 1161.106, 1384.082" halfExtents="800.0, 90.972, 200.0" />
+<BoxCollisionShape position="-320.0, 1561.107, 1384.082" halfExtents="80.0, 490.97299999999996, 200.0" />
+<BoxCollisionShape position="-1146.0, 770.134, 1384.082" halfExtents="99.0, 300.0, 200.0" />
+<BoxCollisionShape position="-1282.0, -548.626, 1384.082" halfExtents="98.25, 605.0, 200.0" />
+<BoxCollisionShape position="-584.0, -366.126, 1384.082" halfExtents="600.0, 112.5, 200.0" />
+
+<BoxCollisionShape position="0.0, 2799.765, 200.0" halfExtents="2900.0, 100.23500000000001, 200.0" />
+<BoxCollisionShape position="-2814.0, 0.0, 200.0" halfExtents="85.244, 2900.0, 200.0" />
+<BoxCollisionShape position="0.0, -2802.87, 200.0" halfExtents="2900.0, 97.13000000000001, 200.0" />
+<BoxCollisionShape position="2800.0, 0.0, 200.0" halfExtents="99.593, 2900.0, 200.0" />
+<BoxCollisionShape position="2148.0, 2099.53, 200.0" halfExtents="74.97399999999999, 600.0, 200.0" />
+<BoxCollisionShape position="1636.0, 1919.53, 200.0" halfExtents="436.798, 0.0, 200.0" />
+<BoxCollisionShape position="334.0, 2295.578, 200.0" halfExtents="78.569, 403.95200000000006, 200.0" />
+<BoxCollisionShape position="-1430.0, 1940.614, 200.0" halfExtents="1300.0, 90.414, 200.0" />
+<BoxCollisionShape position="-1108.0, 1150.2, 200.0" halfExtents="146.36499999999998, 700.0, 200.0" />
+<BoxCollisionShape position="-2030.0, 694.365, 200.0" halfExtents="700.0, 83.68100000000001, 200.0" />
+<BoxCollisionShape position="-1742.0000000000002, 945.4259999999999, 200.0" halfExtents="411.89099999999996, 334.742, 200.0" />
+<BoxCollisionShape position="-2104.0, -1505.74, 200.0" halfExtents="83.16, 1200.0, 200.0" />
+<BoxCollisionShape position="2100.0, -282.036, 200.0" halfExtents="600.0, 83.284, 200.0" />
+<BoxCollisionShape position="1582.0, 373.88, 200.0" halfExtents="81.929, 572.6320000000001, 200.0" />
+<BoxCollisionShape position="1952.0, 863.876, 200.0" halfExtents="288.122, 82.636, 200.0" />
+<BoxCollisionShape position="1500.0, -1742.4410000000003, 200.0" halfExtents="1200.0, 62.007, 200.0" />
+<BoxCollisionShape position="1800.0, -2031.4969999999998, 200.0" halfExtents="73.028, 227.049, 200.0" />
+<BoxCollisionShape position="911.9999999999999, -180.435, 200.0" halfExtents="70.824, 1499.999, 200.0" />
+<BoxCollisionShape position="396.0, 802.4839999999999, 200.0" halfExtents="444.908, 91.25, 200.0" />
+<BoxCollisionShape position="-320.0, -765.87, 200.0" halfExtents="1160.473, 57.668, 200.0" />
+<BoxCollisionShape position="-786.0, -1423.538, 200.0" halfExtents="102.982, 600.0, 200.0" />
+<BoxCollisionShape position="294.0, -296.027, 200.0" halfExtents="78.744, 412.17499999999995, 200.0" />
+
+<BoxCollisionShape position="-822.0000000000001, 80.15, 1856.1" halfExtents="120.0, 10.0, 516.186" />
+<BoxCollisionShape position="-712.0, 190.15, 1856.1" halfExtents="10.0, 120.0, 516.186" />
+<BoxCollisionShape position="-822.0000000000001, 300.15, 1856.1" halfExtents="120.0, 10.0, 516.186" />
+<BoxCollisionShape position="-932.0, 190.15, 1856.1" halfExtents="10.0, 120.0, 516.186" />
+
+<BoxCollisionShape position="-1472.0, 2300.828, 752.929" halfExtents="160.0, 10.0, 437.275" />
+<BoxCollisionShape position="-1622.0, 2450.828, 752.929" halfExtents="10.001, 160.0, 437.275" />
+<BoxCollisionShape position="-1472.0, 2600.828, 752.929" halfExtents="160.0, 10.0, 437.275" />
+<BoxCollisionShape position="-1322.0, 2450.828, 752.929" halfExtents="10.0, 160.0, 437.275" />
+
+<BoxCollisionShape position="-401.99999999999994, 603.5120000000001, 1220.598" halfExtents="140.0, 140.0, 20.0" />
+<BoxCollisionShape position="-401.99999999999994, -836.4879999999999, 564.133" halfExtents="140.0, 1300.0, 676.4649999999999" />
+
+<BoxCollisionShape position="1080.0, -802.528, 1792.286" halfExtents="799.999, 100.0, 620.0" />
+<BoxCollisionShape position="180.0, -802.528, 2392.286" halfExtents="100.0, 100.0, 20.0" />
+
+<BoxCollisionShape position="0.0, 0.0, -9" halfExtents="2900.0, 2900.0, 1" />
+
+
+
+<BoxCollisionShape position="-822.0000000000001, 190.15, 2372.285" halfExtents="100.0, 100.0, 0.001" />
+<BoxCollisionShape position="-1019.9999999999999, -1052.53, 2372.285" halfExtents="1600.0, 149.99800000000002, 0.001" />
+<BoxCollisionShape position="-1270.0, -802.528, 2372.285" halfExtents="1350.0, 100.0, 0.001" />
+<BoxCollisionShape position="-72.0, 647.472, 2372.285" halfExtents="650.7850000000001, 1350.0, 0.001" />
+<BoxCollisionShape position="-1772.0, 647.472, 2372.285" halfExtents="849.215, 1350.0, 0.001" />
+<BoxCollisionShape position="-822.0000000000001, -306.189, 2372.285" halfExtents="100.0, 396.339, 0.001" />
+<BoxCollisionShape position="-822.0000000000001, 1143.811, 2372.285" halfExtents="100.0, 853.661, 0.001" />
+
+<BoxCollisionShape position="-1472.0, 2450.828, 1190.203" halfExtents="139.999, 140.0, 0.001" />
+<BoxCollisionShape position="542.0, 612.201, 1190.203" halfExtents="1874.539, 1978.6269999999997, 0.001" />
+<BoxCollisionShape position="401.99999999999994, 2852.201, 1190.203" halfExtents="2014.538, 261.373, 0.001" />
+<BoxCollisionShape position="-1838.0, 873.574, 1190.203" halfExtents="225.461, 2240.0, 0.001" />
+<BoxCollisionShape position="462.0, 1527.1699999999998, 1190.203" halfExtents="2074.538, 783.658, 0.001" />
+
+
+
+
+
+
+</collisionShapes>
+
</StaticEntity>
+
+
+
+
+
+
+
+
<Light
type=directional
position="-50,500,-50"
@@ -74,8 +181,8 @@
<SpawnPoint
team=0
- position="50,20,50"
- lookat="100,20,100"
+ position="-600,1300,-200"
+ lookat="-100,0,-1000"
spawnclass=HoverShip
pawndesign=spaceshiphover
/>
@@ -83,3 +190,7 @@
</Scene>
</Level>
+
+
+
+
Modified: code/branches/PresentationFS18/data/levels/templates/spaceshipHover.oxt
===================================================================
--- code/branches/PresentationFS18/data/levels/templates/spaceshipHover.oxt 2018-05-30 12:44:47 UTC (rev 12018)
+++ code/branches/PresentationFS18/data/levels/templates/spaceshipHover.oxt 2018-05-30 12:48:17 UTC (rev 12019)
@@ -17,7 +17,7 @@
reloadrate = 2
reloadwaittime = 0.5
- primaryThrust = 200
+ primaryThrust = 10000
auxilaryThrust = 30
rotationThrust = 25
@@ -32,7 +32,7 @@
boostCooldownDuration = 10
collisionType = "dynamic"
- mass = 100
+ mass = 10
linearDamping = 0.2
angularDamping = 0.9999999
>
@@ -78,7 +78,7 @@
<MultiStateEngine
boostfactor = 2
- speedfront = 90
+ speedfront = 200
speedback = 40
speedleftright = 40
speedupdown = 40
Modified: code/branches/PresentationFS18/src/modules/hover/CMakeLists.txt
===================================================================
--- code/branches/PresentationFS18/src/modules/hover/CMakeLists.txt 2018-05-30 12:44:47 UTC (rev 12018)
+++ code/branches/PresentationFS18/src/modules/hover/CMakeLists.txt 2018-05-30 12:48:17 UTC (rev 12019)
@@ -1,12 +1,10 @@
SET_SOURCE_FILES(Hover_SRC_FILES
Hover.cc
HoverShip.cc
- HoverWall.cc
HoverOrigin.cc
HoverFlag.cc
TimeHUD.cc
FlagHUD.cc
- MazeGenerator.cc
)
ORXONOX_ADD_LIBRARY(hover
Modified: code/branches/PresentationFS18/src/modules/hover/Hover.cc
===================================================================
--- code/branches/PresentationFS18/src/modules/hover/Hover.cc 2018-05-30 12:44:47 UTC (rev 12018)
+++ code/branches/PresentationFS18/src/modules/hover/Hover.cc 2018-05-30 12:48:17 UTC (rev 12019)
@@ -34,9 +34,7 @@
#include "Hover.h"
#include "HoverOrigin.h"
-#include "HoverWall.h"
#include "HoverFlag.h"
-#include "MazeGenerator.h"
#include "core/CoreIncludes.h"
namespace orxonox
@@ -58,58 +56,5 @@
{
SUPER(Hover, tick, dt);
- if(this->firstTick_ && this->origin_)
- {
- this->firstTick_ = false;
-
- int numCells = this->origin_->getNumCells();
- int cellSize = this->origin_->getCellSize();
- int cellHeight = this->origin_->getCellHeight();
-
- MazeGenerator generator(numCells);
- generator.generateMaze();
- generator.renderMaze();
-
- int* levelcode = generator.getLevelcode();
-
- //Outer Walls
- for(int i = 0; i<numCells; i++){
- (new HoverWall(origin_->getContext()))->init(0, i+1, cellSize, cellHeight, 1);
- (new HoverWall(origin_->getContext()))->init(numCells, i+1, cellSize, cellHeight, 1);
- (new HoverWall(origin_->getContext()))->init(i+1, 0, cellSize, cellHeight, 2);
- (new HoverWall(origin_->getContext()))->init(i+1, numCells, cellSize, cellHeight, 2);
- }
-
- //Generate inner Walls according to levelcode
- for(int y=0; y<numCells; y++){
- for(int x=0; x<numCells; x++){
- switch(levelcode[ y * numCells + x ]){
- case 1: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
- break;
- case 3: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
- case 2: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0);
- default: break;
- }
- }
- }
-
- //Generate 5 flags randomly
- for ( int i = 0; i < 5; i++ )
- {
- HoverFlag* flag = new HoverFlag(origin_->getContext());
- flag->init(rand()%numCells, rand()%numCells, cellSize);
- flags_.push_back(flag);
- }
-
- }//firsttick end
-
- // Check if ship collided with one of the flags
- for ( unsigned int i = 0; i < flags_.size(); i++ ){
- if(flags_[i]->getCollided()){
- flags_[i]->destroyLater();
- flags_.erase (flags_.begin()+i);
- }
- }
- numberOfFlags_ = flags_.size();
}
}
Deleted: code/branches/PresentationFS18/src/modules/hover/HoverWall.cc
===================================================================
--- code/branches/PresentationFS18/src/modules/hover/HoverWall.cc 2018-05-30 12:44:47 UTC (rev 12018)
+++ code/branches/PresentationFS18/src/modules/hover/HoverWall.cc 2018-05-30 12:48:17 UTC (rev 12019)
@@ -1,116 +0,0 @@
-/*
- * 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:
- * Manuel Meier
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file HoverWall.cc
- @brief Represents one Wall piece in the Hover Game
-*/
-
-#include "HoverWall.h"
-
-#include "core/CoreIncludes.h"
-#include "graphics/Model.h"
-#include "objects/collisionshapes/BoxCollisionShape.h"
-
-namespace orxonox
-{
- RegisterClass(HoverWall);
-
- HoverWall::HoverWall(Context* context) : StaticEntity(context)
- {
- RegisterObject(HoverWall);
-
- this->model_ = nullptr;
- this->cs_ = nullptr;
-
- this->enableCollisionCallback();
- this->setCollisionResponse(true);
- this->setCollisionType(CollisionType::Static);
- }
-
- /**
- @brief
- Destructor.
- */
- HoverWall::~HoverWall()
- {
- if (this->isInitialized())
- {
- if (this->model_)
- this->model_->destroy();
- if (this->cs_)
- this->cs_->destroy();
- }
- }
-
- /**
- @brief
- Initializes a HoverWall
- @param x
- x-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left
- @param y
- y-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left
- @param cellSize
- The size of a cell
- @param cellHeight
- The height of a cell
- @param orientation
- Wall on the right side (1) or on top (2) of this square, 0-1
- */
- void HoverWall::init(int x, int y, int cellSize, int cellHeight, int orientation)
- {
- int xSize_, zSize_, xPos_, zPos_;
-
- if(orientation == 1){
- xSize_ = cellSize/2;
- zSize_ = 2;
- zPos_ = x*cellSize;
- xPos_ = y*cellSize-cellSize/2;
- }
- else{
- xSize_ = 2;
- zSize_ = cellSize/2;
- zPos_ = x*cellSize-cellSize/2;
- xPos_ = y*cellSize;
- }
-
-
- model_ = new Model(this->getContext());
- model_->setMeshSource("CuboidBody.mesh");
- model_->setScale3D(Vector3(xSize_*1.0f, cellHeight*1.0f, zSize_*1.0f));
- model_->setPosition(Vector3(xPos_*1.0f, 0.0f, zPos_*1.0f));
-
- this->attach(model_);
-
- cs_ = new BoxCollisionShape(this->getContext());
- cs_->setHalfExtents(Vector3(xSize_*1.0f, cellHeight*1.0f, zSize_*1.0f));
- cs_->setPosition(Vector3(xPos_*1.0f, 0.0f, zPos_*1.0f));
-
- this->attachCollisionShape(cs_);
- }
-}
Deleted: code/branches/PresentationFS18/src/modules/hover/HoverWall.h
===================================================================
--- code/branches/PresentationFS18/src/modules/hover/HoverWall.h 2018-05-30 12:44:47 UTC (rev 12018)
+++ code/branches/PresentationFS18/src/modules/hover/HoverWall.h 2018-05-30 12:48:17 UTC (rev 12019)
@@ -1,59 +0,0 @@
-/*
- * 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:
- * Manuel Meier
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file HoverWall.h
- @brief See .cc-file for further information
- @ingroup Hover
-*/
-
-#ifndef _HoverWall_H__
-#define _HoverWall_H__
-
-#include "HoverPrereqs.h"
-#include "objects/ObjectsPrereqs.h"
-
-#include "worldentities/StaticEntity.h"
-
-namespace orxonox
-{
- class _HoverExport HoverWall : public StaticEntity
- {
- public:
- HoverWall(Context* context);
- virtual ~HoverWall();
-
- void init(int x, int y, int cellSize, int cellHeight, int orientation);
-
- private:
- Model* model_;
- BoxCollisionShape* cs_;
- };
-}
-
-#endif /* _HoverWall_H__ */
Deleted: code/branches/PresentationFS18/src/modules/hover/MazeGenerator.cc
===================================================================
--- code/branches/PresentationFS18/src/modules/hover/MazeGenerator.cc 2018-05-30 12:44:47 UTC (rev 12018)
+++ code/branches/PresentationFS18/src/modules/hover/MazeGenerator.cc 2018-05-30 12:48:17 UTC (rev 12019)
@@ -1,255 +0,0 @@
-/*
- * 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:
- * Manuel Meier
- * Co-authors:
- * Cyrill Burgener
- *
- * Based on random-maze-generator by Sergey Kosarevsky, 2014
- * https://github.com/corporateshark/random-maze-generator
- *
- */
-
-/**
- @file MazeGenerator.cc
- @brief Implementation of the MazeGenerator class. Generates the maze.
-*/
-
-#include "MazeGenerator.h"
-
-#include <vector>
-
-#include "util/Output.h"
-#include "util/Math.h"
-
-namespace orxonox
-{
- MazeGenerator::MazeGenerator(int numCells)
- {
- this->numCells_ = numCells;
-
- //levelcode_ represents the pitch: It's a 10x10 field.
- // 1 represents a Wall on the right side of this square
- // 2 represents a Wall on the top of this square
- // 3 represents 2 and 1 at the same time
- // Note: the levelcode_ is generated from the Maze-Generator functions at the beginning of the game
- this->levelcode_ = new int[ numCells_*numCells_ ];;
- std::fill( levelcode_, levelcode_ + numCells_*numCells_, 0 );
-
- this->maze_ = new unsigned char[ numCells_*numCells_ ];
- std::fill( maze_, maze_ + numCells_*numCells_, 0 );
-
- // current traversing position
- this->ptX_ = 0;
- this->ptY_ = 0;
-
- // 0 1 2 3 4 5 6 7 8
- // U R D L
- int headingX[9] = { 0, 0,+1, 0, 0, 0, 0, 0,-1 };
- int headingY[9] = { 0,-1, 0, 0,+1, 0, 0, 0, 0 };
- int mask[9] = {
- 0,
- eDirection_Down | eDirection_Down << 4,
- eDirection_Left | eDirection_Left << 4,
- 0,
- eDirection_Up | eDirection_Up << 4,
- 0,
- 0,
- 0,
- eDirection_Right | eDirection_Right << 4
- };
-
- std::copy(headingX, headingX + 9, this->headingX_);
- std::copy(headingY, headingY + 9, this->headingY_);
- std::copy(mask, mask + 9, this->mask_);
- }
-
- MazeGenerator::~MazeGenerator()
- {
- delete[] this->levelcode_;
- delete[] this->maze_;
- }
-
- /**
- @brief
- Checks if Direction is valid (for Maze-Generator)
- */
- bool MazeGenerator::isDirValid( eDirection Dir )
- {
- int NewX = ptX_ + headingX_[ Dir ];
- int NewY = ptY_ + headingY_[ Dir ];
-
- if ( !Dir || NewX < 0 || NewY < 0 || NewX >= numCells_ || NewY >= numCells_ ) return false;
-
- return !maze_[ NewX + numCells_ * NewY ];
- }
-
- /**
- @brief
- Generates new Direction (for Maze-Generator)
- */
- eDirection MazeGenerator::getDirection()
- {
- eDirection Dir = eDirection( 1 << randomInt4() );
-
- while ( true )
- {
- for ( int x = 0; x < 4; x++ )
- {
- if ( isDirValid( Dir ) ) { return eDirection( Dir ); }
-
- Dir = eDirection( Dir << 1 );
-
- if ( Dir > eDirection_Left ) { Dir = eDirection_Up; }
- }
-
- Dir = eDirection( ( maze_[ cellIdx() ] & 0xf0 ) >> 4 );
-
- // nowhere to go
- if ( !Dir ) return eDirection_Invalid;
-
- ptX_ += headingX_[ Dir ];
- ptY_ += headingY_[ Dir ];
-
- Dir = eDirection( 1 << randomInt4() );
- }
- }
-
- /**
- @brief
- Generates a Maze (for Maze-Generator)
- */
- void MazeGenerator::generateMaze()
- {
-
- for ( eDirection Dir = getDirection(); Dir != eDirection_Invalid; Dir = getDirection() )
- {
- maze_[ cellIdx() ] |= Dir;
-
- ptX_ += headingX_[ Dir ];
- ptY_ += headingY_[ Dir ];
-
- maze_[ cellIdx() ] = mask_[ Dir ];
- }
- }
-
- /**
- @brief
- Print Maze (for Debugging only)
- */
- void MazeGenerator::mazeOut(){
- for ( int y = 0; y < numCells_; y++ )
- {
- for ( int x = 0; x < numCells_; x++ )
- {
- char v = maze_[ y * numCells_ + x ];
- orxout()<<"[";
- if ( ( v & eDirection_Up ) ) orxout()<<"U";
- else orxout()<<" ";
- if ( ( v & eDirection_Right ) ) orxout()<<"R";
- else orxout()<<" ";
- if ( ( v & eDirection_Down ) ) orxout()<<" ";
- else orxout()<<" ";
- if ( ( v & eDirection_Left ) ) orxout()<<" ";
- else orxout()<<" ";
- orxout()<<"]";
- }
- orxout()<<endl;
- }
-
- }
-
- /**
- @brief
- Print levelcode_ (for Debugging only)
- */
- void MazeGenerator::levelOut(){
- for ( int y = 0; y < numCells_; y++ )
- {
- for ( int x = 0; x < numCells_; x++ )
- {
- orxout()<<"[";
- if ( levelcode_[ y * numCells_ + x ] < 2) orxout()<<"U";
- else orxout()<<" ";
- if ( levelcode_[ y * numCells_ + x ] % 2 == 0) orxout()<<"R";
- else orxout()<<" ";
-
- orxout()<<" ";
- orxout()<<" ";
- orxout()<<"]";
- }
- orxout()<<endl;
- }
- }
-
- /**
- @brief
- Generate levelcode_ from Maze
- */
- void MazeGenerator::renderMaze()
- {
- for ( int y = 0; y < numCells_; y++ )
- {
- for ( int x = 0; x < numCells_; x++ )
- {
- char v = maze_[ y * numCells_ + x ];
-
- if ( !( v & eDirection_Up ) && y >0) levelcode_[ y * numCells_ + x ] |= 2;
- if ( !( v & eDirection_Right ) && x <(numCells_-1)) levelcode_[ y * numCells_ + x ] |= 1;
- }
- }
-
- // leave an empty space in the middle of the maze
- int lowerBound = numCells_ / 2 - 2;
- int upperBound = numCells_ / 2 + 2;
- for ( int y = lowerBound; y < upperBound; y++ )
- {
- for ( int x = lowerBound; x < upperBound; x++ )
- {
-
- if(y == lowerBound && x != upperBound)
- levelcode_[ y * numCells_ + x ] &= 2;
- else if (x == upperBound && y != lowerBound)
- levelcode_[ y * numCells_ + x ] &= 1;
- else if(x != upperBound)
- levelcode_[ y * numCells_ + x ] = 0;
- }
- }
-
- }
-
- // return the current index in maze_
- int MazeGenerator::cellIdx()
- {
- return ptX_ + numCells_ * ptY_;
- }
-
- int MazeGenerator::randomInt()
- {
- return (rand() % numCells_);
- }
-
- int MazeGenerator::randomInt4()
- {
- return (rand() % 4);
- }
-}
Deleted: code/branches/PresentationFS18/src/modules/hover/MazeGenerator.h
===================================================================
--- code/branches/PresentationFS18/src/modules/hover/MazeGenerator.h 2018-05-30 12:44:47 UTC (rev 12018)
+++ code/branches/PresentationFS18/src/modules/hover/MazeGenerator.h 2018-05-30 12:48:17 UTC (rev 12019)
@@ -1,86 +0,0 @@
-/*
- * 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.
- *
- * Master of Desaster:
- * Manuel Meier
- * Co-authors:
- * Cyrill Burgener
- *
- */
-
-/**
- @file MazeGenerator.h
- @ingroup Hover
-*/
-
-#ifndef _MazeGenerator_H__
-#define _MazeGenerator_H__
-
-#include "HoverPrereqs.h"
-
-namespace orxonox
-{
- enum eDirection
- {
- eDirection_Invalid = 0,
- eDirection_Up = 1,
- eDirection_Right = 2,
- eDirection_Down = 4,
- eDirection_Left = 8
- };
-
- class _HoverExport MazeGenerator
- {
- public:
- MazeGenerator(int numCells);
- ~MazeGenerator();
-
- void generateMaze();
- void renderMaze();
- void mazeOut();
- void levelOut();
-
- int* getLevelcode() const
- { return this->levelcode_; }
-
- private:
- bool isDirValid( eDirection Dir );
- eDirection getDirection();
-
- int cellIdx();
- int randomInt();
- int randomInt4();
-
- int numCells_;
- int* levelcode_;
- unsigned char* maze_;
-
- // current traversing position
- int ptX_;
- int ptY_;
-
- int headingX_[9];
- int headingY_[9];
- int mask_[9];
- };
-}
-
-#endif /* _MazeGenerator_H__ */
More information about the Orxonox-commit
mailing list