Changeset 12101 for code/branches/WorldMap_HS18/src/orxonox
- Timestamp:
- Nov 14, 2018, 10:01:05 AM (6 years ago)
- 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 36 36 RegisterClass(StoryModeController); 37 37 38 StoryModeController::StoryModeController(Context* context) : ArtificialController(context)38 StoryModeController::StoryModeController(Context* context) : Pawn(context) 39 39 { 40 40 RegisterObject(StoryModeController); 41 this->setAccuracy(100); 41 moveRight_ = false; 42 moveLeft_ = false; 43 //this->setAccuracy(50); 42 44 } 43 45 44 46 StoryModeController::~StoryModeController() 45 47 { 46 for (WorldEntity* waypoint : this->waypoints_)48 /*for (WorldEntity* waypoint : this->waypoints_) 47 49 { 48 50 if(waypoint) 49 51 waypoint->destroy(); 50 } 52 }*/ 53 51 54 } 52 55 53 56 void StoryModeController::tick(float dt) 54 57 { 55 if (!this->isActive()) 58 orxout(internal_error) << "Hi" << endl; 59 60 /*if (!this->isActive()) 56 61 return; 57 62 … … 59 64 return; 60 65 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(); 63 68 64 69 //this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition()); 65 70 } 66 71 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){} 67 95 } -
code/branches/WorldMap_HS18/src/orxonox/controllers/StoryModeController.h
r12060 r12101 34 34 #include <vector> 35 35 #include "tools/interfaces/Tickable.h" 36 #include "ArtificialController.h" 36 #include "worldentities/ControllableEntity.h" 37 #include "worldentities/pawns/SpaceShip.h" 37 38 38 39 namespace orxonox 39 40 { 40 class _OrxonoxExport StoryModeController : public ArtificialController, public Tickable41 class _OrxonoxExport StoryModeController : public Pawn 41 42 { 42 43 public: … … 44 45 virtual ~StoryModeController(); 45 46 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_ ; 48 58 protected: 49 59
Note: See TracChangeset
for help on using the changeset viewer.