Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 14, 2018, 10:01:05 AM (6 years ago)
Author:
linggj
Message:

12

Location:
code/branches/WorldMap_HS18/src/orxonox/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.cc

    r12060 r12101  
    3636    RegisterClass(StoryModeController);
    3737
    38    StoryModeController::StoryModeController(Context* context) : ArtificialController(context)
     38   StoryModeController::StoryModeController(Context* context) : Pawn(context)
    3939    {
    4040        RegisterObject(StoryModeController);
    41         this->setAccuracy(100);
     41        moveRight_ = false;
     42        moveLeft_ = false;
     43        //this->setAccuracy(50);
    4244    }
    4345
    4446    StoryModeController::~StoryModeController()
    4547    {
    46         for (WorldEntity* waypoint : this->waypoints_)
     48        /*for (WorldEntity* waypoint : this->waypoints_)
    4749        {
    4850            if(waypoint)
    4951                waypoint->destroy();
    50         }
     52        }*/
     53
    5154    }
    5255
    5356    void StoryModeController::tick(float dt)
    5457    {
    55         if (!this->isActive())
     58        orxout(internal_error) << "Hi" << endl;
     59       
     60        /*if (!this->isActive())
    5661            return;
    5762
     
    5964            return;
    6065
    61         if (false /* this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_*/)
    62             this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size();
     66        if (false /* this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_*///)
     67            //this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size();
    6368
    6469        //this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition());
    6570    }
    6671
     72    void StoryModeController::moveFrontBack(const Vector2& value)
     73    {
     74        orxout(internal_error) << "FrontBack" << endl;
     75
     76           
     77    }
     78    void StoryModeController::moveRightLeft(const Vector2& value)
     79    {
     80        orxout(internal_error) << "RightLeft" << endl;
     81        if (value.x>0){
     82            moveRight_ =false;
     83            moveLeft_ =true;
     84
     85        }
     86
     87    }
     88
     89    void StoryModeController::rotateYaw(const Vector2& value){}
     90    void StoryModeController::rotatePitch(const Vector2& value){}
     91    void StoryModeController::rotateRoll(const Vector2& value){}
     92    void StoryModeController::fire(unsigned int a){}
     93    void StoryModeController::fired(unsigned int b){}
     94    void StoryModeController::boost(bool bBoost){}
    6795}
  • code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h

    r12060 r12101  
    3434#include <vector>
    3535#include "tools/interfaces/Tickable.h"
    36 #include "ArtificialController.h"
     36#include "worldentities/ControllableEntity.h"
     37#include "worldentities/pawns/SpaceShip.h"
    3738
    3839namespace orxonox
    3940{
    40     class _OrxonoxExport StoryModeController : public ArtificialController, public Tickable
     41    class _OrxonoxExport StoryModeController : public Pawn
    4142    {
    4243        public:
     
    4445            virtual ~StoryModeController();
    4546
    46             virtual void tick(float dt) override;
    47 
     47            virtual void tick(float dt) override;           
     48            virtual void moveFrontBack(const Vector2& value) override;
     49            virtual void moveRightLeft(const Vector2& value) override;
     50            virtual void rotateYaw(const Vector2& value) override;
     51            virtual void rotatePitch(const Vector2& value) override;
     52            virtual void rotateRoll(const Vector2& value) override;
     53            void fire(unsigned int firemode);
     54            virtual void fired(unsigned int firemode) override;
     55            virtual void boost(bool bBoost) override;
     56            bool moveRight_ ;
     57            bool moveLeft_ ;
    4858        protected:
    4959
Note: See TracChangeset for help on using the changeset viewer.