mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-24 16:16:14 +00:00
Sound orientation with HMD and Headphones
This commit is contained in:
parent
f94c65faa9
commit
6afd72bd87
2 changed files with 14 additions and 4 deletions
|
@ -1407,6 +1407,13 @@ bool mainLoop()
|
||||||
NLMISC::CMatrix mat = ((camMatrix * hmdMatrix) * posMatrix);
|
NLMISC::CMatrix mat = ((camMatrix * hmdMatrix) * posMatrix);
|
||||||
MainCam.setPos(mat.getPos());
|
MainCam.setPos(mat.getPos());
|
||||||
MainCam.setRotQuat(mat.getRot());
|
MainCam.setRotQuat(mat.getRot());
|
||||||
|
|
||||||
|
if (true) // TODO: ClientCfg.Headphone
|
||||||
|
{
|
||||||
|
// NOTE: non-(StereoHMD+Headphone) impl in user_entity.cpp
|
||||||
|
SoundMngr->setListenerPos(mat.getPos()); // TODO: Move ears back ... :)
|
||||||
|
SoundMngr->setListenerOrientation(mat.getJ(), mat.getK());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (StereoDisplay)
|
if (StereoDisplay)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2384,10 +2384,13 @@ void CUserEntity::updateSound(const TTime &time)
|
||||||
if (SoundMngr == 0)
|
if (SoundMngr == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SoundMngr->setListenerPos(pos());
|
if (!(StereoHMD && true)) // TODO: ClientCfg.Headphone
|
||||||
const CMatrix &camMat = MainCam.getMatrix();
|
{
|
||||||
SoundMngr->setListenerOrientation(camMat.getJ(), camMat.getK());
|
// NOTE: StereoHMD+Headphone impl in main_loop.cpp
|
||||||
|
SoundMngr->setListenerPos(pos());
|
||||||
|
const CMatrix &camMat = MainCam.getMatrix();
|
||||||
|
SoundMngr->setListenerOrientation(camMat.getJ(), camMat.getK());
|
||||||
|
}
|
||||||
|
|
||||||
if (ClientCfg.Light)
|
if (ClientCfg.Light)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue