Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2009, 9:06:19 AM (15 years ago)
Author:
rgrieder
Message:

Moved sound listener to the active camera and fixed the ambient distance trigger (now acts on cameras and we only have one in a Scene so far).

Location:
code/branches/presentation2/src/orxonox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/controllers/HumanController.cc

    r6159 r6191  
    3636#include "infos/PlayerInfo.h"
    3737#include "overlays/Map.h"
    38 #include "graphics/Camera.h"
    39 #include "sound/SoundManager.h"
    4038#include "Radar.h"
    4139#include "Scene.h"
     
    8381        if (GameMode::playsSound() && HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    8482        {
    85             // Update sound listener
    8683            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
     84            if (!camera)
    9385                COUT(3) << "HumanController, Warning: Using a ControllableEntity without Camera" << std::endl;
    9486        }
  • code/branches/presentation2/src/orxonox/graphics/Camera.cc

    r6170 r6191  
    4242#include "Scene.h"
    4343#include "CameraManager.h"
     44#include "sound/SoundManager.h"
    4445
    4546namespace orxonox
     
    131132            this->cameraNode_->setOrientation(Quaternion::Slerp(coeff, this->cameraNode_->_getDerivedOrientation(), this->getWorldOrientation(), true));
    132133        }
     134
     135        // Update sound listener transformation
     136        if (GameMode::playsSound() && this->bHasFocus_)
     137        {
     138            SoundManager::getInstance().setListenerPosition(this->getWorldPosition());
     139            SoundManager::getInstance().setListenerOrientation(this->getWorldOrientation());
     140        }
    133141    }
    134142
Note: See TracChangeset for help on using the changeset viewer.