[Orxonox-commit 7504] r12110 - in code/branches/WorldMap_HS18: . data/levels src/modules/flappyorx src/orxonox/controllers
linggj at orxonox.net
linggj at orxonox.net
Wed Nov 21 11:45:27 CET 2018
Author: linggj
Date: 2018-11-21 11:45:27 +0100 (Wed, 21 Nov 2018)
New Revision: 12110
Added:
code/branches/WorldMap_HS18/ToDo
Modified:
code/branches/WorldMap_HS18/data/levels/StoryModeMap.oxw
code/branches/WorldMap_HS18/src/modules/flappyorx/FlappyOrxShip.cc
code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc
code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h
code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc
code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h
Log:
some changes
Added: code/branches/WorldMap_HS18/ToDo
===================================================================
--- code/branches/WorldMap_HS18/ToDo (rev 0)
+++ code/branches/WorldMap_HS18/ToDo 2018-11-21 10:45:27 UTC (rev 12110)
@@ -0,0 +1,10 @@
+CMAKE Plugin
+
+ORXONOX_ADD_LIBRARY(superorxobros
+ PLUGIN
+ FIND_HEADER_FILES
+ LINK_LIBRARIES
+ orxonox
+ overlays
+ SOURCE_FILES ${SOB_SRC_FILES}
+)
\ No newline at end of file
Modified: code/branches/WorldMap_HS18/data/levels/StoryModeMap.oxw
===================================================================
--- code/branches/WorldMap_HS18/data/levels/StoryModeMap.oxw 2018-11-21 09:19:21 UTC (rev 12109)
+++ code/branches/WorldMap_HS18/data/levels/StoryModeMap.oxw 2018-11-21 10:45:27 UTC (rev 12110)
@@ -21,6 +21,9 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+
+
+
<?lua include("includes/notifications.oxi") ?>
<Scene
@@ -27,8 +30,25 @@
ambientlight = "0.2, 0.2, 0.2"
skybox = "Orxonox/Starbox"
>
+ <StoryModeController position="0,0,0" collisionType="dynamic">
+ <attached>
+ <Model position="550,300,0" mesh="assff.mesh" scale=20 visible="true" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="3,1,10" />
+ </collisionShapes>
+ </StoryModeController>
+ <!-- <MovableEntity>
+ <attached>
+ <StaticEntity name=asdfasdf figureTemplate=smCont>
+ <attached>
+ </attached>
+ </StaticEntity>
+ </attached>
+ </MovableEntity> -->
+
<StaticEntity position="0,0,0" direction="0,0,-1" >
<attached>
@@ -35,16 +55,15 @@
<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 />
+ <Model position="550,300,0" mesh="assff.mesh" scale=20 visible="false" orientation="-0.015,0.091,0.038,-0.995"/>
<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"/>
+ <Model position="50,300,-250" mesh="assff.mesh" scale=20 visible="false" 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 />
+ <Model position="-600,250,-500" mesh="planets/moon.mesh" scale=100 visible="false"/>
<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 />
@@ -68,6 +87,8 @@
</attached>
</StaticEntity>
+
+
<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 />
Modified: code/branches/WorldMap_HS18/src/modules/flappyorx/FlappyOrxShip.cc
===================================================================
--- code/branches/WorldMap_HS18/src/modules/flappyorx/FlappyOrxShip.cc 2018-11-21 09:19:21 UTC (rev 12109)
+++ code/branches/WorldMap_HS18/src/modules/flappyorx/FlappyOrxShip.cc 2018-11-21 10:45:27 UTC (rev 12110)
@@ -37,6 +37,7 @@
#include "core/XMLPort.h"
#include "graphics/Camera.h"
#include "graphics/ParticleSpawner.h"
+#include "worldentities/pawns/SpaceShip.h"
#include <math.h>
#include <ctime>
Modified: code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc 2018-11-21 09:19:21 UTC (rev 12109)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc 2018-11-21 10:45:27 UTC (rev 12110)
@@ -5,14 +5,77 @@
set(0);
}
+ SMCoord::~SMCoord() {
+
+ }
+
SMCoord::SMCoord(int x) {
set(x);
}
void SMCoord::set(int index) {
+ if(index<0) return;
+ if(index>8) return;
this->index = index;
}
+ Vector3 SMCoord::get3dcoordinate() {
+ Vector3 coord;
+ switch(this->index)
+ {
+ case 0:
+ coord.x= 550;
+ coord.y = 300;
+ coord.z = 0;
+ break;
+ case 1:
+ coord.x= 100;
+ coord.y = 350;
+ coord.z = -250;
+ break;
+ case 2:
+ coord.x= -600;
+ coord.y = 250;
+ coord.z = -500;
+ break;
+ case 3:
+ coord.x= -1000;
+ coord.y = 50;
+ coord.z = -750;
+ break;
+ case 4:
+ coord.x= -900;
+ coord.y = -400;
+ coord.z = -1000;
+ break;
+ case 5:
+ coord.x= -500;
+ coord.y = -700;
+ coord.z = -1250;
+ break;
+ case 6:
+ coord.x= 0;
+ coord.y = 900;
+ coord.z = -1500;
+ break;
+ case 7:
+ coord.x= 700;
+ coord.y = -1100;
+ coord.z = -1750;
+ break;
+ case 8:
+ coord.x= 1500;
+ coord.y = 1300;
+ coord.z = -2000;
+ break;
+ default:
+ coord.x= 0;
+ coord.y = 0;
+ coord.z = 0;
+ }
+ return coord;
+ }
+
int SMCoord::getIndex() {
return this->index;
}
Modified: code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h 2018-11-21 09:19:21 UTC (rev 12109)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h 2018-11-21 10:45:27 UTC (rev 12110)
@@ -12,9 +12,12 @@
public:
SMCoord();
SMCoord(int x);
- virtual void set(int index);
+ void set(int index);
virtual int getIndex();
+ virtual Vector3 get3dcoordinate();
+ virtual ~SMCoord();
+
private:
int index;
};
Modified: code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc 2018-11-21 09:19:21 UTC (rev 12109)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc 2018-11-21 10:45:27 UTC (rev 12110)
@@ -30,41 +30,60 @@
#include "core/CoreIncludes.h"
#include "worldentities/ControllableEntity.h"
+#include "graphics/Camera.h"
#include "SMCoord.h"
-
+#include "core/XMLPort.h"
namespace orxonox
{
RegisterClass(StoryModeController);
- StoryModeController::StoryModeController(Context* context) : ControllableEntity(context)
+ StoryModeController::StoryModeController(Context* context) : SpaceShip(context)
{
RegisterObject(StoryModeController);
float time_;
- moveForward_=false;
+ selectedPos_ = new SMCoord(0);
+ moveForward_= false;
moveBackward_=false;
boostPressed_=false;
- setPosition(0);
+
+
}
-
StoryModeController::~StoryModeController()
{
-
+ delete selectedPos_;
+ selectedPos_ = nullptr;
}
void StoryModeController::updatePosition(){
-
+ Vector3 pos = selectedPos_->get3dcoordinate();
+ setPosition(pos);
}
- void StoryModeController::setPosition(int index){
-
+ void StoryModeController::setLocation(int index){
+ selectedPos_->set(index);
}
void StoryModeController::tick(float dt)
{
orxout(internal_error) << "Hi" << endl;
- SUPER(StoryModeController, tick, dt);
- time_ +=dt;
+ SUPER(StoryModeController, tick, dt);
+ time_ +=dt;
+
+ if(moveForward_ == true){
+ moveForward_ = false;
+ selectedPos_->set(selectedPos_->getIndex()+1);
+ updatePosition();
+ }
+ if(moveBackward_ == true){
+ moveBackward_ = false;
+ selectedPos_->set(selectedPos_->getIndex()-1);
+ updatePosition();
+ }
+ if(boostPressed_ == true){
+ boostPressed_ = false;
+ chooseGame();
+ }
}
@@ -71,8 +90,15 @@
void StoryModeController::moveFrontBack(const Vector2& value)
{
-
+ orxout(internal_error) << "moveFrontBack" << endl;
}
+
+ void StoryModeController::chooseGame()
+ {
+ //findLevel(selectedPos_->getIndex());
+ }
+
+
void StoryModeController::moveRightLeft(const Vector2& value)
{
orxout(internal_error) << "RightLeft" << endl;
@@ -86,12 +112,19 @@
}
- void StoryModeController::rotateYaw(const Vector2& value){}
- void StoryModeController::rotatePitch(const Vector2& value){}
- void StoryModeController::rotateRoll(const Vector2& value){}
+ void StoryModeController::rotateYaw(const Vector2& value){
+ orxout(internal_error) << "RightLeft" << endl;
+ }
+ void StoryModeController::rotatePitch(const Vector2& value){
+ orxout(internal_error) << "RightLeft" << endl;
+ }
+ void StoryModeController::rotateRoll(const Vector2& value){
+ orxout(internal_error) << "RightLeft" << endl;
+ }
void StoryModeController::fire(unsigned int a){}
void StoryModeController::fired(unsigned int b){}
void StoryModeController::boost(bool bBoost){
+ orxout(internal_error) << "Boost" << endl;
boostPressed_ = true;
}
}
Modified: code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h
===================================================================
--- code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h 2018-11-21 09:19:21 UTC (rev 12109)
+++ code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h 2018-11-21 10:45:27 UTC (rev 12110)
@@ -35,10 +35,11 @@
#include "tools/interfaces/Tickable.h"
#include "worldentities/ControllableEntity.h"
#include "worldentities/pawns/SpaceShip.h"
+#include "SMCoord.h"
namespace orxonox
{
- class _OrxonoxExport StoryModeController : public ControllableEntity
+ class _OrxonoxExport StoryModeController : public SpaceShip
{
public:
StoryModeController(Context* context);
@@ -53,9 +54,10 @@
void fire(unsigned int firemode);
virtual void fired(unsigned int firemode) override;
virtual void boost(bool bBoost) override;
- virtual void setPosition(int index);
+ virtual void setLocation(int index);
bool moveRight_ ;
bool moveLeft_ ;
+ SMCoord* selectedPos_;
private:
virtual void updatePosition();
float time_;
@@ -62,6 +64,7 @@
bool moveForward_;
bool moveBackward_;
bool boostPressed_;
+ virtual void chooseGame();
};
}
More information about the Orxonox-commit
mailing list