Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12110


Ignore:
Timestamp:
Nov 21, 2018, 11:45:27 AM (5 years ago)
Author:
linggj
Message:

some changes

Location:
code/branches/WorldMap_HS18
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/WorldMap_HS18/data/levels/StoryModeMap.oxw

    r12101 r12110  
    2222    <Template link=lodtemplate_default />
    2323  </templates>
     24
     25   
     26
    2427  <?lua include("includes/notifications.oxi") ?>
    2528
     
    2831    skybox       = "Orxonox/Starbox"
    2932  >
     33   <StoryModeController position="0,0,0" collisionType="dynamic">
    3034
     35          <attached>
     36              <Model position="550,300,0" mesh="assff.mesh" scale=20  visible="true" />
     37          </attached>
    3138
     39          <collisionShapes>
     40              <BoxCollisionShape position="0,0,0" halfExtents="3,1,10" />
     41          </collisionShapes>
     42      </StoryModeController>
     43  <!--   <MovableEntity>
     44        <attached>
     45            <StaticEntity name=asdfasdf figureTemplate=smCont>
     46                <attached>
     47                </attached>
     48            </StaticEntity>
     49        </attached>
     50    </MovableEntity> -->
     51   
    3252    <StaticEntity position="0,0,0" direction="0,0,-1" >
    3353      <attached>
     
    3656         
    3757       
    38          <Model position="550,300,0" mesh="assff.mesh" scale=20  visible="true" orientation="-0.015,0.091,0.038,-0.995"/>
    39         <Model position="600,370,0" mesh="Coordinates.mesh" scale=10 />
     58         <Model position="550,300,0" mesh="assff.mesh" scale=20  visible="false" orientation="-0.015,0.091,0.038,-0.995"/>
    4059        <Billboard colour="1,1,0.05" position="600,370,-80"  material="Flares/lensflare" scale=4.5 />
    4160       
    4261
    4362        <Model position="100,350,-250" mesh="planets/moon.mesh" scale=100  visible="false"/>
    44          <Model position="50,300,-250" mesh="assff.mesh" scale=20  visible="true" orientation="-0.015,0.091,0.038,-0.995"/>
     63         <Model position="50,300,-250" mesh="assff.mesh" scale=20  visible="false" orientation="-0.015,0.091,0.038,-0.995"/>
    4564        <Billboard colour="1,1,0.05" position="100,350,-330"  material="Flares/lensflare" scale=4.5 />
    4665
    47         <Model position="-600,250,-500" mesh="planets/moon.mesh" scale=100 />
     66        <Model position="-600,250,-500" mesh="planets/moon.mesh" scale=100 visible="false"/>
    4867        <Billboard colour="1,1,0.05" position="-600,250,-580"  material="Flares/lensflare" scale=5 />
    4968
     
    6988    </StaticEntity>
    7089
     90   
     91
    7192    <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"/>
    7293
  • code/branches/WorldMap_HS18/src/modules/flappyorx/FlappyOrxShip.cc

    r11781 r12110  
    3838#include "graphics/Camera.h"
    3939#include "graphics/ParticleSpawner.h"
     40#include "worldentities/pawns/SpaceShip.h"
    4041#include <math.h>
    4142#include <ctime>
  • code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.cc

    r12106 r12110  
    66    }
    77
     8     SMCoord::~SMCoord() {
     9       
     10    }
     11
    812    SMCoord::SMCoord(int x) {
    913        set(x);
     
    1115
    1216    void SMCoord::set(int index) {
     17        if(index<0) return;
     18        if(index>8) return;
    1319        this->index = index;
     20    }
     21
     22    Vector3 SMCoord::get3dcoordinate() {
     23        Vector3 coord;
     24       switch(this->index)
     25       {
     26        case 0:
     27            coord.x= 550;
     28            coord.y = 300;
     29            coord.z = 0;
     30            break;
     31        case 1:
     32            coord.x= 100;
     33            coord.y = 350;
     34            coord.z = -250;
     35            break;
     36        case 2:
     37            coord.x= -600;
     38            coord.y = 250;
     39            coord.z = -500;
     40            break;
     41        case 3:
     42            coord.x= -1000;
     43            coord.y = 50;
     44            coord.z = -750;
     45            break;
     46        case 4:
     47            coord.x= -900;
     48            coord.y = -400;
     49            coord.z = -1000;
     50            break;
     51        case 5:
     52            coord.x= -500;
     53            coord.y = -700;
     54            coord.z = -1250;
     55            break;
     56        case 6:
     57            coord.x= 0;
     58            coord.y = 900;
     59            coord.z = -1500;
     60            break;
     61        case 7:
     62            coord.x= 700;
     63            coord.y = -1100;
     64            coord.z = -1750;
     65            break;
     66        case 8:
     67            coord.x= 1500;
     68            coord.y = 1300;
     69            coord.z = -2000;
     70            break;
     71        default:
     72            coord.x= 0;
     73            coord.y = 0;
     74            coord.z = 0;
     75       }
     76       return coord;
    1477    }
    1578
  • code/branches/WorldMap_HS18/src/orxonox/controllers/SMCoord.h

    r12106 r12110  
    1313            SMCoord();
    1414            SMCoord(int x);
    15             virtual void set(int index);
     15            void set(int index);
    1616            virtual int getIndex();
     17            virtual Vector3 get3dcoordinate();
     18            virtual ~SMCoord();
     19
    1720
    1821        private:
  • code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc

    r12106 r12110  
    3131#include "core/CoreIncludes.h"
    3232#include "worldentities/ControllableEntity.h"
     33#include "graphics/Camera.h"
    3334#include "SMCoord.h"
    34 
     35#include "core/XMLPort.h"
    3536namespace orxonox
    3637{
    3738    RegisterClass(StoryModeController);
    3839
    39    StoryModeController::StoryModeController(Context* context) : ControllableEntity(context)
     40   StoryModeController::StoryModeController(Context* context) : SpaceShip(context)
    4041    {
    4142        RegisterObject(StoryModeController);
    4243        float time_;
    43         moveForward_=false;
     44        selectedPos_ = new SMCoord(0);
     45        moveForward_= false;
    4446        moveBackward_=false;                     
    4547        boostPressed_=false;
    46         setPosition(0);
     48       
     49
    4750     
    4851    }
    49 
    5052    StoryModeController::~StoryModeController()
    5153    {
    52        
     54        delete selectedPos_;
     55        selectedPos_ = nullptr;
    5356
    5457    }
    5558
    5659    void StoryModeController::updatePosition(){
    57 
     60        Vector3 pos = selectedPos_->get3dcoordinate();
     61        setPosition(pos);
    5862    }
    59     void StoryModeController::setPosition(int index){
    60 
     63    void StoryModeController::setLocation(int index){
     64         selectedPos_->set(index);
    6165    }
    6266
     
    6468    {
    6569        orxout(internal_error) << "Hi" << endl;
    66        SUPER(StoryModeController, tick, dt);
    67        time_ +=dt;
     70        SUPER(StoryModeController, tick, dt);
     71        time_ +=dt;
     72
     73        if(moveForward_ == true){
     74            moveForward_ = false;
     75            selectedPos_->set(selectedPos_->getIndex()+1);
     76            updatePosition();
     77        }
     78        if(moveBackward_ == true){
     79                moveBackward_ = false;
     80                selectedPos_->set(selectedPos_->getIndex()-1);
     81                updatePosition();
     82           }
     83           if(boostPressed_ == true){
     84                boostPressed_ = false;
     85                chooseGame();
     86           }
    6887       
    6988       
     
    7291    void StoryModeController::moveFrontBack(const Vector2& value)
    7392    {
    74                     
     93           orxout(internal_error) << "moveFrontBack" << endl;          
    7594    }
     95
     96    void StoryModeController::chooseGame()
     97    {
     98           //findLevel(selectedPos_->getIndex());           
     99    }
     100
     101
    76102    void StoryModeController::moveRightLeft(const Vector2& value)
    77103    {
     
    87113    }
    88114
    89     void StoryModeController::rotateYaw(const Vector2& value){}
    90     void StoryModeController::rotatePitch(const Vector2& value){}
    91     void StoryModeController::rotateRoll(const Vector2& value){}
     115    void StoryModeController::rotateYaw(const Vector2& value){
     116        orxout(internal_error) << "RightLeft" << endl;
     117    }
     118    void StoryModeController::rotatePitch(const Vector2& value){
     119        orxout(internal_error) << "RightLeft" << endl;
     120    }
     121    void StoryModeController::rotateRoll(const Vector2& value){
     122        orxout(internal_error) << "RightLeft" << endl;
     123    }
    92124    void StoryModeController::fire(unsigned int a){}
    93125    void StoryModeController::fired(unsigned int b){}
    94126    void StoryModeController::boost(bool bBoost){
     127        orxout(internal_error) << "Boost" << endl;
    95128        boostPressed_ = true;
    96129    }
  • code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h

    r12106 r12110  
    3636#include "worldentities/ControllableEntity.h"
    3737#include "worldentities/pawns/SpaceShip.h"
     38#include "SMCoord.h"
    3839
    3940namespace orxonox
    4041{
    41     class _OrxonoxExport StoryModeController : public ControllableEntity
     42    class _OrxonoxExport StoryModeController : public SpaceShip
    4243    {
    4344        public:
     
    5455            virtual void fired(unsigned int firemode) override;
    5556            virtual void boost(bool bBoost) override;
    56             virtual void setPosition(int index);
     57            virtual void setLocation(int index);
    5758            bool moveRight_ ;
    5859            bool moveLeft_ ;
     60            SMCoord* selectedPos_;
    5961        private:
    6062            virtual void updatePosition();                       
     
    6365            bool moveBackward_;                     
    6466            bool boostPressed_;
     67            virtual void chooseGame();
    6568
    6669    };
Note: See TracChangeset for help on using the changeset viewer.