Commit 0c1e39fe authored by Sebastian Riebeling's avatar Sebastian Riebeling

Added loop in Bformat Rotation.

parent 9b8f41ae
......@@ -65,7 +65,7 @@ CVAAmbisonicsBinauralMixdownReproduction::CVAAmbisonicsBinauralMixdownReproducti
, m_pdsStreamFilter(nullptr)
, m_iListenerID(-1)
, m_pDefaultHRIR(nullptr)
, m_matYinv(nullptr)
, m_matYinv()
, m_orderMatrices()
, m_bBFormatIsInit(false)
, m_dTrackingDelaySeconds(0)
......@@ -657,23 +657,44 @@ void CVAAmbisonicsBinauralMixdownReproduction::UpdateScene(CVASceneState* pNewSt
}
}
Eigen::MatrixXd matYinvRot = matRotation * m_matYinv;
double debugYinvRot[25][25];
for (int i = 0; i < 25; i++) {
for (int j = 0; j < 25; j++) {
debugYinvRot[i][j] = matYinvRot(i, j);
}
}
double debugYinv[25][25];
for (int i = 0; i < 25; i++) {
for (int j = 0; j < 25; j++) {
debugYinv[i][j] = m_matYinv(i, j); //matrix[zeilen][spalten]
}
}
int m, n;
int iCurrentOrder;
double dGain;
//gains
for (int i = 0; i < GetNumInputChannels(); i++){
iCurrentOrder = floor(sqrt(i));
iCurrentOrder = floor(sqrt(i));
for (int j = 0; j < GetNumVirtualLoudspeaker(); j++)
{
double dGain = matYinvRot(i, j) * m_vdRemaxWeights[iCurrentOrder];
{
for (int k = 0; k < 25; k++){
SHLinear2DegreeOrder(k, m, n);
dGain += m_matYinv(k, j) * matRotation(i,k) * m_vdRemaxWeights[n];
}
m_pDecoderMatrixPatchBay->ConnectChannels(0, i, 0, j, dGain);
dGain = 0;
}
}
}
else if ((m_sRotationMode == "ViewUp") || (m_sRotationMode == "Quaternion")) {
else if ((m_sRotationMode == "ViewUp") || (m_sRotationMode == "Quaternion") || !m_bBFormatIsInit) {
double dAzimuth, dElevation;
......@@ -764,6 +785,7 @@ void CVAAmbisonicsBinauralMixdownReproduction::UpdateScene(CVASceneState* pNewSt
pFilterChR->Release();
m_bBFormatIsInit = true;
m_pdsStreamFilter->pTrigger->trigger();
}
}
else {
......@@ -773,7 +795,7 @@ void CVAAmbisonicsBinauralMixdownReproduction::UpdateScene(CVASceneState* pNewSt
m_pdsStreamFilter->pTrigger->trigger();
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment