0
0

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]
  • You must to post comments
0
0

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

  • You must to post comments
0
0

😮 I don’t understand how it could get confused.

  • You must to post comments
0
0

looks like you inverted the cross products to me…

right = forward X up
up = right X forward

it’s like that:

[img:1stoxg00]http://hlpbm.free.fr/fs/tut/vect/produit_vect.png[/img:1stoxg00]

  • You must to post comments
0
0

I’m going to get the up, forward and right vectors from the cameras matrix.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.