- Timestamp:
- Dec 25, 2009, 1:18:03 PM (15 years ago)
- Location:
- code/branches/pickup2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup2
- Property svn:mergeinfo changed
-
code/branches/pickup2/src/orxonox/controllers/HumanController.cc
r5929 r6412 36 36 #include "infos/PlayerInfo.h" 37 37 #include "overlays/Map.h" 38 #include "graphics/Camera.h"39 #include "sound/SoundManager.h"40 38 #include "Radar.h" 41 39 #include "Scene.h" … … 56 54 SetConsoleCommand(HumanController, mouseLook, true); 57 55 SetConsoleCommand(HumanController, suicide, true); 56 SetConsoleCommand(HumanController, toggleGodMode, true); 58 57 SetConsoleCommand(HumanController, addBots, true).defaultValues(1); 59 58 SetConsoleCommand(HumanController, killBots, true).defaultValues(0); … … 71 70 RegisterObject(HumanController); 72 71 72 controlPaused_ = false; 73 73 74 HumanController::localController_s = this; 74 75 } … … 83 84 if (GameMode::playsSound() && HumanController::localController_s && HumanController::localController_s->controllableEntity_) 84 85 { 85 // Update sound listener86 86 Camera* camera = HumanController::localController_s->controllableEntity_->getCamera(); 87 if (camera) 88 { 89 SoundManager::getInstance().setListenerPosition(camera->getWorldPosition()); 90 SoundManager::getInstance().setListenerOrientation(camera->getWorldOrientation()); 91 } 92 else 87 if (!camera) 93 88 COUT(3) << "HumanController, Warning: Using a ControllableEntity without Camera" << std::endl; 94 89 } … … 97 92 void HumanController::moveFrontBack(const Vector2& value) 98 93 { 94 if (HumanController::localController_s) 95 HumanController::localController_s->frontback(value); 96 } 97 98 void HumanController::frontback(const Vector2& value) 99 { 99 100 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 100 101 HumanController::localController_s->controllableEntity_->moveFrontBack(value); … … 113 114 } 114 115 115 void HumanController:: rotateYaw(const Vector2& value)116 void HumanController::yaw(const Vector2& value) 116 117 { 117 118 //Hack to enable mouselook in map … … 125 126 } 126 127 127 void HumanController:: rotatePitch(const Vector2& value)128 void HumanController::pitch(const Vector2& value) 128 129 { 129 130 //Hack to enable mouselook in map … … 137 138 } 138 139 140 void HumanController::rotateYaw(const Vector2& value) 141 { 142 if (HumanController::localController_s) 143 HumanController::localController_s->yaw(value); 144 } 145 146 void HumanController::rotatePitch(const Vector2& value) 147 { 148 if (HumanController::localController_s) 149 HumanController::localController_s->pitch(value); 150 } 151 139 152 void HumanController::rotateRoll(const Vector2& value) 140 153 { … … 144 157 145 158 void HumanController::fire(unsigned int firemode) 159 { 160 if (HumanController::localController_s) 161 HumanController::localController_s->doFire(firemode); 162 } 163 164 void HumanController::doFire(unsigned int firemode) 146 165 { 147 166 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) … … 191 210 } 192 211 212 void HumanController::toggleGodMode() 213 { 214 HumanController::getLocalControllerSingleton()->setGodMode( !HumanController::getLocalControllerSingleton()->getGodMode() ); 215 } 216 193 217 void HumanController::useItem() 194 218 { … … 234 258 HumanController::localController_s->controllableEntity_->getScene()->getRadar()->releaseFocus(); 235 259 } 260 261 void HumanController::pauseControl() 262 { 263 if (HumanController::localController_s) 264 HumanController::localController_s->doPauseControl(); 265 } 266 267 void HumanController::resumeControl() 268 { 269 if (HumanController::localController_s) 270 HumanController::localController_s->doResumeControl(); 271 } 236 272 }
Note: See TracChangeset
for help on using the changeset viewer.