mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-24 17:39:42 +00:00
Store the sound listener position as well
This commit is contained in:
parent
fad27d99e6
commit
1ee8b963d0
2 changed files with 11 additions and 2 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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() { }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue