Changeset 5913 for code/branches/core5/src
- Timestamp:
- Oct 8, 2009, 11:23:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/orxonox/controllers/HumanController.cc
r5896 r5913 36 36 #include "infos/PlayerInfo.h" 37 37 #include "overlays/Map.h" 38 #include "graphics/Camera.h" 38 39 #include "sound/SoundManager.h" 39 40 #include "Radar.h" … … 80 81 void HumanController::tick(float dt) 81 82 { 82 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 83 { 84 if (GameMode::playsSound()) 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) 85 88 { 86 // Update sound listener 87 SoundManager::getInstance().setListenerPosition(HumanController::localController_s->controllableEntity_->getPosition()); 88 SoundManager::getInstance().setListenerOrientation(HumanController::localController_s->controllableEntity_->getOrientation()); 89 SoundManager::getInstance().setListenerPosition(camera->getPosition()); 90 SoundManager::getInstance().setListenerOrientation(camera->getOrientation()); 89 91 } 92 else 93 COUT(3) << "HumanController, Warning: Using a ControllableEntity without Camera" << std::endl; 90 94 } 91 95 }
Note: See TracChangeset
for help on using the changeset viewer.