mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:01:09 +02:00
Revert to simpler approximation for stream sorting
This commit is contained in:
parent
83e1efd2f0
commit
4c502cdbc9
1 changed files with 1 additions and 5 deletions
|
@ -727,13 +727,9 @@ float approximateGain(const AvatarAudioStream& listeningNodeStream, const Positi
|
||||||
// distance attenuation: approximate, ignore zone-specific attenuations
|
// distance attenuation: approximate, ignore zone-specific attenuations
|
||||||
glm::vec3 relativePosition = streamToAdd.getPosition() - listeningNodeStream.getPosition();
|
glm::vec3 relativePosition = streamToAdd.getPosition() - listeningNodeStream.getPosition();
|
||||||
float distance = glm::length(relativePosition);
|
float distance = glm::length(relativePosition);
|
||||||
|
return gain / distance;
|
||||||
float d = (1.0f / ATTN_DISTANCE_REF) * std::max(distance, HRTF_NEARFIELD_MIN);
|
|
||||||
gain = gain / d;
|
|
||||||
gain = std::min(gain, ATTN_GAIN_MAX);
|
|
||||||
|
|
||||||
// avatar: skip master gain - it is constant for all streams
|
// avatar: skip master gain - it is constant for all streams
|
||||||
return gain;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float computeGain(float masterListenerGain, const AvatarAudioStream& listeningNodeStream,
|
float computeGain(float masterListenerGain, const AvatarAudioStream& listeningNodeStream,
|
||||||
|
|
Loading…
Reference in a new issue