- Timestamp:
- Oct 13, 2009, 5:05:17 PM (15 years ago)
- Location:
- code/branches/pickup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup
- Property svn:mergeinfo changed
-
code/branches/pickup/src/orxonox/controllers/HumanController.cc
r5781 r5935 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.