I don’t know why, but with software mixing I must invert the forward vector to have sounds correctly panned for 3D audio.
In hardware mode I do not need to invert the forward vector, but after using every peice of advice from these forums hardware mode still pops, stutters and overall just doesn’t play nice with others on my Audigy SE, but at least the panning is correct. 😉
This is the code for calculating the listeners vectors:
[code:u6c2tduy] // We calculate the forward, right and up vectors for the listener (the camera)
// so we can correctly hear sound effects/streams in 3D.
irr::core::vector3df WorldUpVector = irr::core::vector3df( 0.0f, 1.0f, 0.0f );
irr::core::vector3df cameraPosition = GetCamera()->getPosition();
irr::core::vector3df cameraTarget = GetCamera()->getTarget();
// Compute new forward vector irr::core::vector3df forwardVector = cameraTarget - cameraPosition; // Set the Y to 0 so the vectors are calculated on the XZ plane forwardVector.Y = 0.0f; forwardVector.normalize(); // Compute new right vector irr::core::vector3df rightVector = WorldUpVector.crossProduct ( forwardVector ); rightVector.normalize(); // Compute new up vector irr::core::vector3df upVector = forwardVector.crossProduct( rightVector ); upVector.normalize(); if(m_Audio->GetAttributes()->IS3D) m_Audio->Set3DListener( m_Camera->getAbsolutePosition(), vector3df(0.0f, 0.0f, 0.0f), -forwardVector, upVector );[/code:u6c2tduy]
- Mikenoworth asked 10 years ago
It sounds to me like your system isn’t 100% sure of which speaker is Left & which is Right and FMOD’s software panner & the hardware are at odds over it.
Which would explain why you need to "turn the listener around" for the panning to be consistant
Please login first to submit.