Changeset 3073 for code/trunk/src/orxonox/objects/controllers
- Timestamp:
- May 25, 2009, 8:30:15 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore
-
old new 1 1 build 2 2 codeblocks 3 dependencies
-
- Property svn:mergeinfo changed
/code/branches/pickups merged: 2828,2831,2864,2900 /code/branches/pickups2 merged: 2916-2917,2972,3001,3016,3040-3042,3046,3063
- Property svn:ignore
-
code/trunk/src/orxonox/objects/controllers/HumanController.cc
r3053 r3073 49 49 SetConsoleCommand(HumanController, boost, true).keybindMode(KeybindMode::OnHold); 50 50 SetConsoleCommand(HumanController, greet, true); 51 SetConsoleCommand(HumanController, use, true);52 51 SetConsoleCommand(HumanController, switchCamera, true); 53 52 SetConsoleCommand(HumanController, mouseLook, true); … … 56 55 SetConsoleCommand(HumanController, killBots, true).defaultValues(0); 57 56 SetConsoleCommand(HumanController, dropItems, true); 57 SetConsoleCommand(HumanController, useItem, true); 58 58 59 59 CreateUnloadableFactory(HumanController); … … 133 133 } 134 134 135 void HumanController::use()136 {137 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)138 HumanController::localController_s->controllableEntity_->use();139 }140 141 135 void HumanController::switchCamera() 142 136 { … … 163 157 } 164 158 159 void HumanController::useItem() 160 { 161 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 162 HumanController::localController_s->controllableEntity_->useItem(); 163 } 164 165 165 void HumanController::addBots(unsigned int amount) 166 166 { -
code/trunk/src/orxonox/objects/controllers/HumanController.h
r3053 r3073 34 34 #include "util/Math.h" 35 35 #include "Controller.h" 36 #include "objects/worldentities/pawns/Pawn.h" 36 37 37 38 namespace orxonox … … 56 57 static void boost(); 57 58 static void greet(); 58 static void use();59 59 static void switchCamera(); 60 60 static void mouseLook(); 61 61 static void dropItems(); 62 static void useItem(); 62 63 63 64 static void suicide(); … … 65 66 static void addBots(unsigned int amount); 66 67 static void killBots(unsigned int amount = 0); 68 69 static inline HumanController* getLocalControllerSingleton() 70 { return HumanController::localController_s; } 71 static inline Pawn* getLocalControllerEntityAsPawn() 72 { 73 if (HumanController::localController_s) { 74 return dynamic_cast<Pawn*>(HumanController::localController_s->getControllableEntity()); 75 } else { 76 return NULL; 77 } 78 } 67 79 68 80 private:
Note: See TracChangeset
for help on using the changeset viewer.