Changeset 12131 for code/branches
- Timestamp:
- Nov 29, 2018, 9:12:53 AM (6 years ago)
- Location:
- code/branches/WorldMap_HS18
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/WorldMap_HS18/data/levels/StoryModeMap.oxw
r12110 r12131 16 16 17 17 <Level 18 gametype = StoryMode18 gametype = Deathmatch 19 19 > 20 20 … … 31 31 skybox = "Orxonox/Starbox" 32 32 > 33 <StoryModeController position="0,0,0" collisionType="dynamic" >33 <StoryModeController position="0,0,0" collisionType="dynamic" mass=42000000 > 34 34 35 35 <attached> 36 <Model position=" 550,300,0" mesh="assff.mesh" scale=20 visible="true" />36 <Model position="0,0,0" mesh="assff.mesh" scale=20 visible="true" /> 37 37 </attached> 38 38 <CameraPosition position="0,0,1000" direction="0, -1, 0" drag=false /> 39 39 <collisionShapes> 40 40 <BoxCollisionShape position="0,0,0" halfExtents="3,1,10" /> … … 50 50 </MovableEntity> --> 51 51 52 53 54 52 55 <StaticEntity position="0,0,0" direction="0,0,-1" > 53 56 <attached> 57 58 <Model name="a" position="550,300,0" mesh="planets/moon.mesh" scale=100 visible="true" /> 59 <Billboard colour="1,0,0.05" position="550,300,-80" material="Flares/lensflare" scale=4.5 /> 54 60 55 61 <Model name="a" position="600,370,0" mesh="planets/moon.mesh" scale=100 visible="false" /> … … 57 63 58 64 <Model position="550,300,0" mesh="assff.mesh" scale=20 visible="false" orientation="-0.015,0.091,0.038,-0.995"/> 65 59 66 <Billboard colour="1,1,0.05" position="600,370,-80" material="Flares/lensflare" scale=4.5 /> 60 67 61 68 62 <Model position="100,350,-250" mesh="planets/moon.mesh" scale=100 visible=" false"/>69 <Model position="100,350,-250" mesh="planets/moon.mesh" scale=100 visible="true"/> 63 70 <Model position="50,300,-250" mesh="assff.mesh" scale=20 visible="false" orientation="-0.015,0.091,0.038,-0.995"/> 64 71 <Billboard colour="1,1,0.05" position="100,350,-330" material="Flares/lensflare" scale=4.5 /> … … 92 99 <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"/> 93 100 94 <SpawnPoint position="000.000, 000.000, 1000.000" orientation="0, 0, 0, -1" pawndesign=StoryMode />101 <SpawnPoint position="000.000, 000.000, 1000.000" orientation="0, 0, 0, -1" spawnclass=StoryModeController pawndesign=StoryMode /> 95 102 96 103 -
code/branches/WorldMap_HS18/data/overlays/StoryModeHUD.oxo
r11783 r12131 11 11 </OverlayGroup> 12 12 </Template> 13 <Template name="spectatorhud"> 14 <OverlayGroup name = "spectatorhud" scale = "1, 1"> 15 </OverlayGroup> 16 </Template> -
code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc
r12110 r12131 56 56 case 6: 57 57 coord.x= 0; 58 coord.y = 900;58 coord.y = -900; 59 59 coord.z = -1500; 60 60 break; -
code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc
r12110 r12131 29 29 #include "StoryModeController.h" 30 30 31 31 32 #include "core/CoreIncludes.h" 32 33 #include "worldentities/ControllableEntity.h" … … 34 35 #include "SMCoord.h" 35 36 #include "core/XMLPort.h" 37 #include "gamestates/GSLevel.h" 36 38 namespace orxonox 37 39 { … … 46 48 moveBackward_=false; 47 49 boostPressed_=false; 48 50 dtime_=50; 49 51 50 52 … … 56 58 57 59 } 58 60 //void StoryModeController:: switchCamera(){}; 59 61 void StoryModeController::updatePosition(){ 60 62 Vector3 pos = selectedPos_->get3dcoordinate(); … … 67 69 void StoryModeController::tick(float dt) 68 70 { 69 orxout(internal_error) << "Hi" << endl;71 //orxout(internal_error) << "Hi" << endl; 70 72 SUPER(StoryModeController, tick, dt); 71 73 time_ +=dt; 74 Camera* camera = this->getCamera(); 75 76 72 77 73 if( moveForward_ == true){74 moveForward_ = false;75 selectedPos_->set(selectedPos_->getIndex()+1);76 updatePosition();77 }78 if(moveBackward_ == true){79 move Backward_ = false;80 selectedPos_->set(selectedPos_->getIndex() -1);78 if(time_>= dtime_*dt){ 79 80 time_=0; 81 82 if(moveForward_ == true){ 83 orxout(internal_error) << "Position update" << endl; 84 moveForward_ = false; 85 selectedPos_->set(selectedPos_->getIndex()+1); 81 86 updatePosition(); 82 } 83 if(boostPressed_ == true){ 84 boostPressed_ = false; 85 chooseGame(); 86 } 87 87 } 88 89 if(moveBackward_ == true){ 90 orxout(internal_error) << "Position update" << endl; 91 moveBackward_ = false; 92 selectedPos_->set(selectedPos_->getIndex()-1); 93 updatePosition(); 94 } 95 96 if(boostPressed_ == true){ 97 boostPressed_ = false; 98 chooseGame(); 99 } 100 101 102 if (camera != nullptr) 103 { 104 105 Vector3 epos = selectedPos_->get3dcoordinate(); 106 orxout(internal_error) << "ex: "<< epos.x <<" ey: "<< epos.y << " ez: " << epos.z<< endl; 107 camera->setPosition(-(epos.x),-(epos.y),-(epos.z)+1000); 108 camera->setOrientation(Vector3::UNIT_Z, Degree(0)); 109 110 } 111 } 88 112 89 113 } … … 91 115 void StoryModeController::moveFrontBack(const Vector2& value) 92 116 { 93 orxout(internal_error) << "moveFrontBack" << endl;117 // orxout(internal_error) << "moveFrontBack" << endl; 94 118 } 95 119 96 120 void StoryModeController::chooseGame() 97 121 { 98 //findLevel(selectedPos_->getIndex()); 122 int ind = selectedPos_->getIndex(); 123 std::string name = "changeGame "; 124 switch(ind){ 125 case 0: 126 name = name + "pong.oxw"; 127 break; 128 case 1: 129 130 break; 131 case 2: 132 133 break; 134 case 3: 135 136 break; 137 case 4: 138 139 break; 140 case 5: 141 142 break; 143 case 6: 144 145 break; 146 case 7: 147 148 break; 149 case 8: 150 151 break; 152 default: 153 break; 154 } 155 CommandExecutor::execute(name); 156 /*for (GSLevel* level : ObjectList<GSLevel>()) 157 level->changeGame(name);*/ 158 //hideAllMenuSheets(); 99 159 } 100 160 … … 102 162 void StoryModeController::moveRightLeft(const Vector2& value) 103 163 { 104 orxout(internal_error) << "RightLeft" << endl; 105 if (value.x>0){ 106 moveForward_ =false; 107 moveBackward_ =true; 108 } else { 109 moveBackward_ = false; 110 moveForward_ = true; 164 if(!moveForward_&&!moveBackward_){ 165 if (value.x>0){ 166 orxout(internal_error) << "Right" << endl; 167 moveForward_ =true; 168 moveBackward_ =false; 169 } else { 170 orxout(internal_error) << "Left" << endl; 171 moveBackward_ = true; 172 moveForward_ = false; 173 } 111 174 } 112 175 … … 114 177 115 178 void StoryModeController::rotateYaw(const Vector2& value){ 116 orxout(internal_error) << "RightLeft" << endl;179 //orxout(internal_error) << "RightLeft" << endl; 117 180 } 118 181 void StoryModeController::rotatePitch(const Vector2& value){ 119 orxout(internal_error) << "RightLeft" << endl;182 //orxout(internal_error) << "RightLeft" << endl; 120 183 } 121 184 void StoryModeController::rotateRoll(const Vector2& value){ 122 orxout(internal_error) << "RightLeft" << endl;185 //orxout(internal_error) << "RightLeft" << endl; 123 186 } 124 187 void StoryModeController::fire(unsigned int a){} -
code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h
r12110 r12131 31 31 32 32 #include "OrxonoxPrereqs.h" 33 33 #include "core/EventIncludes.h" 34 #include "core/command/Executor.h" 35 #include "core/config/ConfigValueIncludes.h" 36 #include "core/XMLPort.h" 34 37 #include <vector> 35 38 #include "tools/interfaces/Tickable.h" … … 37 40 #include "worldentities/pawns/SpaceShip.h" 38 41 #include "SMCoord.h" 42 43 //#include <gtest/gtest.h> 44 #include "core/class/Identifier.h" 45 #include "core/class/IdentifierManager.h" 46 #include "core/command/ConsoleCommandIncludes.h" 47 #include "core/command/CommandExecutor.h" 48 #include "core/object/Destroyable.h" 49 #include "core/module/ModuleInstance.h" 39 50 40 51 namespace orxonox … … 55 66 virtual void fired(unsigned int firemode) override; 56 67 virtual void boost(bool bBoost) override; 68 //virtual void switchCamera() override; 69 57 70 virtual void setLocation(int index); 58 71 bool moveRight_ ; … … 62 75 virtual void updatePosition(); 63 76 float time_; 77 int dtime_; 64 78 bool moveForward_; 65 79 bool moveBackward_;
Note: See TracChangeset
for help on using the changeset viewer.