mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +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],
|
||||
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);
|
||||
throwALerror();
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
#include <OgreVector3.h>
|
||||
|
||||
#include "soundmanager.hpp"
|
||||
|
||||
#include "../mwworld/ptr.hpp"
|
||||
|
@ -34,7 +36,13 @@ namespace MWSound
|
|||
Sound_Output& operator=(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:
|
||||
virtual ~Sound_Output() { }
|
||||
|
||||
|
|
Loading…
Reference in a new issue