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).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.