Changeset 5929 for code/trunk/src/orxonox/controllers/HumanController.cc
- Timestamp:
- Oct 12, 2009, 8:20:07 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core5 (added) merged: 5768-5769,5772,5775-5780,5783-5785,5791-5792,5795-5807,5809-5814,5816-5832,5836-5839,5842-5853,5855-5899,5904-5922,5924-5928
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/controllers/HumanController.cc
r5781 r5929 36 36 #include "infos/PlayerInfo.h" 37 37 #include "overlays/Map.h" 38 #include "graphics/Camera.h" 39 #include "sound/SoundManager.h" 40 #include "Radar.h" 41 #include "Scene.h" 38 42 39 43 namespace orxonox … … 56 60 SetConsoleCommand(HumanController, dropItems, true); 57 61 SetConsoleCommand(HumanController, useItem, true); 62 SetConsoleCommand(HumanController, cycleNavigationFocus, true); 63 SetConsoleCommand(HumanController, releaseNavigationFocus, true); 58 64 59 65 CreateUnloadableFactory(HumanController); … … 71 77 { 72 78 HumanController::localController_s = 0; 79 } 80 81 void HumanController::tick(float dt) 82 { 83 if (GameMode::playsSound() && HumanController::localController_s && HumanController::localController_s->controllableEntity_) 84 { 85 // Update sound listener 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 93 COUT(3) << "HumanController, Warning: Using a ControllableEntity without Camera" << std::endl; 94 } 73 95 } 74 96 … … 200 222 return NULL; 201 223 } 224 225 void HumanController::cycleNavigationFocus() 226 { 227 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 228 HumanController::localController_s->controllableEntity_->getScene()->getRadar()->cycleFocus(); 229 } 230 231 void HumanController::releaseNavigationFocus() 232 { 233 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 234 HumanController::localController_s->controllableEntity_->getScene()->getRadar()->releaseFocus(); 235 } 202 236 }
Note: See TracChangeset
for help on using the changeset viewer.