1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-24 17:09:43 +00:00

Store the sound listener position as well

This commit is contained in:
Chris Robinson 2012-03-30 07:30:17 -07:00
parent fad27d99e6
commit 1ee8b963d0
2 changed files with 11 additions and 2 deletions

View file

@ -760,8 +760,9 @@ void OpenAL_Output::updateListener(const float *pos, const float *atdir, const f
atdir[0], atdir[2], -atdir[1], atdir[0], atdir[2], -atdir[1],
updir[0], updir[2], -updir[1] updir[0], updir[2], -updir[1]
}; };
mPos = Ogre::Vector3(pos[0], pos[1], pos[2]);
alListener3f(AL_POSITION, pos[0], pos[2], -pos[1]); alListener3f(AL_POSITION, mPos[0], mPos[2], -mPos[1]);
alListenerfv(AL_ORIENTATION, orient); alListenerfv(AL_ORIENTATION, orient);
throwALerror(); throwALerror();
} }

View file

@ -4,6 +4,8 @@
#include <string> #include <string>
#include <memory> #include <memory>
#include <OgreVector3.h>
#include "soundmanager.hpp" #include "soundmanager.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
@ -34,7 +36,13 @@ namespace MWSound
Sound_Output& operator=(const Sound_Output &rhs); Sound_Output& operator=(const Sound_Output &rhs);
Sound_Output(const Sound_Output &rhs); Sound_Output(const Sound_Output &rhs);
Sound_Output(SoundManager &mgr) : mManager(mgr) { } protected:
Ogre::Vector3 mPos;
Sound_Output(SoundManager &mgr)
: mManager(mgr)
, mPos(0.0f, 0.0f, 0.0f)
{ }
public: public:
virtual ~Sound_Output() { } virtual ~Sound_Output() { }