mirror of
https://github.com/overte-org/overte.git
synced 2025-07-10 21:18:54 +02:00
fixes from review
This commit is contained in:
parent
1514b58700
commit
35b772bc4d
1 changed files with 9 additions and 5 deletions
|
@ -144,9 +144,9 @@ int AudioMixer::addStreamToMixForListeningNodeWithStream(PositionalAudioStream*
|
||||||
|
|
||||||
bool shouldDistanceAttenuate = true;
|
bool shouldDistanceAttenuate = true;
|
||||||
|
|
||||||
|
// Is the source that I am mixing my own?
|
||||||
bool sourceIsSelf = (streamToAdd == listeningNodeStream);
|
bool sourceIsSelf = (streamToAdd == listeningNodeStream);
|
||||||
|
|
||||||
// if the two stream pointers do not match then these are different streams
|
|
||||||
glm::vec3 relativePosition = streamToAdd->getPosition() - listeningNodeStream->getPosition();
|
glm::vec3 relativePosition = streamToAdd->getPosition() - listeningNodeStream->getPosition();
|
||||||
|
|
||||||
float distanceBetween = glm::length(relativePosition);
|
float distanceBetween = glm::length(relativePosition);
|
||||||
|
@ -169,7 +169,9 @@ int AudioMixer::addStreamToMixForListeningNodeWithStream(PositionalAudioStream*
|
||||||
|
|
||||||
if (streamToAdd->getType() == PositionalAudioStream::Injector) {
|
if (streamToAdd->getType() == PositionalAudioStream::Injector) {
|
||||||
attenuationCoefficient *= reinterpret_cast<InjectedAudioStream*>(streamToAdd)->getAttenuationRatio();
|
attenuationCoefficient *= reinterpret_cast<InjectedAudioStream*>(streamToAdd)->getAttenuationRatio();
|
||||||
if (showDebug) qDebug() << "AttenuationRatio: " << reinterpret_cast<InjectedAudioStream*>(streamToAdd)->getAttenuationRatio();
|
if (showDebug) {
|
||||||
|
qDebug() << "AttenuationRatio: " << reinterpret_cast<InjectedAudioStream*>(streamToAdd)->getAttenuationRatio();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showDebug) {
|
if (showDebug) {
|
||||||
|
@ -178,7 +180,7 @@ int AudioMixer::addStreamToMixForListeningNodeWithStream(PositionalAudioStream*
|
||||||
|
|
||||||
glm::quat inverseOrientation = glm::inverse(listeningNodeStream->getOrientation());
|
glm::quat inverseOrientation = glm::inverse(listeningNodeStream->getOrientation());
|
||||||
|
|
||||||
if (!sourceIsSelf && (streamToAdd->getType() != PositionalAudioStream::Injector)) {
|
if (!sourceIsSelf && (streamToAdd->getType() == PositionalAudioStream::Microphone)) {
|
||||||
// source is another avatar, apply fixed off-axis attenuation to make them quieter as they turn away from listener
|
// source is another avatar, apply fixed off-axis attenuation to make them quieter as they turn away from listener
|
||||||
glm::vec3 rotatedListenerPosition = glm::inverse(streamToAdd->getOrientation()) * relativePosition;
|
glm::vec3 rotatedListenerPosition = glm::inverse(streamToAdd->getOrientation()) * relativePosition;
|
||||||
|
|
||||||
|
@ -211,7 +213,9 @@ int AudioMixer::addStreamToMixForListeningNodeWithStream(PositionalAudioStream*
|
||||||
|
|
||||||
// multiply the current attenuation coefficient by the distance coefficient
|
// multiply the current attenuation coefficient by the distance coefficient
|
||||||
attenuationCoefficient *= distanceCoefficient;
|
attenuationCoefficient *= distanceCoefficient;
|
||||||
if (showDebug) qDebug() << "distanceCoefficient: " << distanceCoefficient;
|
if (showDebug) {
|
||||||
|
qDebug() << "distanceCoefficient: " << distanceCoefficient;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sourceIsSelf) {
|
if (!sourceIsSelf) {
|
||||||
|
|
Loading…
Reference in a new issue