From e4e1e3e5a1108e8eb70264a92ce5da8b885a269b Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 1 Aug 2014 23:11:35 +0200 Subject: [PATCH] Sound orientation with HMD and Headphones --HG-- branch : multipass-stereo --- code/ryzom/client/src/main_loop.cpp | 7 +++++++ code/ryzom/client/src/user_entity.cpp | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index e6a9c50a0..0ef01f2e4 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -1407,6 +1407,13 @@ bool mainLoop() NLMISC::CMatrix mat = ((camMatrix * hmdMatrix) * posMatrix); MainCam.setPos(mat.getPos()); 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) { diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index c8652fd43..bb632cf4e 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -2384,10 +2384,13 @@ void CUserEntity::updateSound(const TTime &time) if (SoundMngr == 0) return; - SoundMngr->setListenerPos(pos()); - const CMatrix &camMat = MainCam.getMatrix(); - SoundMngr->setListenerOrientation(camMat.getJ(), camMat.getK()); - + if (!(StereoHMD && true)) // TODO: ClientCfg.Headphone + { + // 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) return;