mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:00:44 +02:00
handle zero distance from listener to source
This commit is contained in:
parent
87b85d6951
commit
e0cb8db914
1 changed files with 7 additions and 2 deletions
|
@ -169,8 +169,13 @@ float AudioMixer::azimuthForSource(const PositionalAudioStream& streamToAdd, con
|
||||||
// project the rotated source position vector onto the XZ plane
|
// project the rotated source position vector onto the XZ plane
|
||||||
rotatedSourcePosition.y = 0.0f;
|
rotatedSourcePosition.y = 0.0f;
|
||||||
|
|
||||||
// produce an oriented angle about the y-axis
|
if (rotatedSourcePosition != glm::vec3()) {
|
||||||
return glm::orientedAngle(glm::vec3(0.0f, 0.0f, -1.0f), glm::normalize(rotatedSourcePosition), glm::vec3(0.0f, -1.0f, 0.0f));
|
// produce an oriented angle about the y-axis
|
||||||
|
return glm::orientedAngle(glm::vec3(0.0f, 0.0f, -1.0f), glm::normalize(rotatedSourcePosition), glm::vec3(0.0f, -1.0f, 0.0f));
|
||||||
|
} else {
|
||||||
|
// there is no distance between listener and source - return no azimuth
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioMixer::addStreamToMixForListeningNodeWithStream(AudioMixerClientData& listenerNodeData,
|
void AudioMixer::addStreamToMixForListeningNodeWithStream(AudioMixerClientData& listenerNodeData,
|
||||||
|
|
Loading…
Reference in a new issue