mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01: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
|
||||
glm::vec3 relativePosition = streamToAdd.getPosition() - listeningNodeStream.getPosition();
|
||||
float distance = glm::length(relativePosition);
|
||||
|
||||
float d = (1.0f / ATTN_DISTANCE_REF) * std::max(distance, HRTF_NEARFIELD_MIN);
|
||||
gain = gain / d;
|
||||
gain = std::min(gain, ATTN_GAIN_MAX);
|
||||
return gain / distance;
|
||||
|
||||
// avatar: skip master gain - it is constant for all streams
|
||||
return gain;
|
||||
}
|
||||
|
||||
float computeGain(float masterListenerGain, const AvatarAudioStream& listeningNodeStream,
|
||||
|
|
Loading…
Reference in a new issue