summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-09 16:04:37 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-09 16:04:37 +0300
commitc0ce2565918af03f1dabcb02dedb87c1c447008a (patch)
treeed7539289121ecf3c599d4d63136474bd7b470bc /indra
parent8cb9bcf1d6379afb3f0784c3741f77b5df437dea (diff)
SL-11445 Fix fmod studio position and orientation attributes
Diffstat (limited to 'indra')
-rw-r--r--indra/llaudio/llaudioengine_fmodstudio.cpp2
-rw-r--r--indra/llaudio/lllistener_fmodstudio.cpp13
2 files changed, 5 insertions, 10 deletions
diff --git a/indra/llaudio/llaudioengine_fmodstudio.cpp b/indra/llaudio/llaudioengine_fmodstudio.cpp
index 8f07c81c57..49ae01b44d 100644
--- a/indra/llaudio/llaudioengine_fmodstudio.cpp
+++ b/indra/llaudio/llaudioengine_fmodstudio.cpp
@@ -725,8 +725,6 @@ FMOD_RESULT F_CALLBACK windCallback(FMOD_DSP_STATE *dsp_state, float *inbuffer,
FMOD::DSP *thisdsp = (FMOD::DSP *)dsp_state->instance;
thisdsp->getUserData((void **)&windgen);
- S32 channels, configwidth, configheight;
- thisdsp->getInfo(0, 0, &channels, &configwidth, &configheight);
windgen->windGenerate((LLAudioEngine_FMODSTUDIO::MIXBUFFERFORMAT *)outbuffer, length);
diff --git a/indra/llaudio/lllistener_fmodstudio.cpp b/indra/llaudio/lllistener_fmodstudio.cpp
index 34f3d00eae..abd5e345b5 100644
--- a/indra/llaudio/lllistener_fmodstudio.cpp
+++ b/indra/llaudio/lllistener_fmodstudio.cpp
@@ -82,11 +82,8 @@ void LLListener_FMODSTUDIO::orient(LLVector3 up, LLVector3 at)
{
LLListener::orient(up, at);
- // Welcome to the transition between right and left
- // (coordinate systems, that is)
- // Leaving the at vector alone results in a L/R reversal
- // since DX is left-handed and we (LL, OpenGL, OpenAL) are right-handed
- at = -at;
+ // at = -at; by default Fmod studio is 'left-handed' but we are providing
+ // flag FMOD_INIT_3D_RIGHTHANDED so no correction are needed
mSystem->set3DListenerAttributes(0, NULL, NULL, (FMOD_VECTOR*)at.mV, (FMOD_VECTOR*)up.mV);
}
@@ -106,14 +103,14 @@ void LLListener_FMODSTUDIO::commitDeferredChanges()
void LLListener_FMODSTUDIO::setRolloffFactor(F32 factor)
{
//An internal FMOD optimization skips 3D updates if there have not been changes to the 3D sound environment.
- // (this was true for FMODex, looks to be still true for FMOD STUDIO)
+ // (this was true for FMODex, looks to be still true for FMOD STUDIO, but needs a recheck)
//Sadly, a change in rolloff is not accounted for, thus we must touch the listener properties as well.
//In short: Changing the position ticks a dirtyflag inside fmod, which makes it not skip 3D processing next update call.
if (mRolloffFactor != factor)
{
- LLVector3 pos = mVelocity - LLVector3(0.f, 0.f, .1f);
+ LLVector3 pos = mPosition - LLVector3(0.f, 0.f, .1f);
mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)pos.mV, NULL, NULL, NULL);
- mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mVelocity.mV, NULL, NULL, NULL);
+ mSystem->set3DListenerAttributes(0, (FMOD_VECTOR*)mPosition.mV, NULL, NULL, NULL);
}
mRolloffFactor = factor;
mSystem->set3DSettings(mDopplerFactor, 1.f, mRolloffFactor);