From 81877244108714b99f7fe44a59c6ac2c943847dc Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 6 May 2013 17:30:37 -0700 Subject: [PATCH] correct the angle of delivery --- audio-mixer/src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/audio-mixer/src/main.cpp b/audio-mixer/src/main.cpp index 9e54b68c5a..9b594ec054 100644 --- a/audio-mixer/src/main.cpp +++ b/audio-mixer/src/main.cpp @@ -172,6 +172,11 @@ void *sendBuffer(void *args) { bearingRelativeAngleToSource *= (M_PI / 180); float angleOfDelivery = absoluteAngleToSource - otherAgentBuffer->getBearing(); + + if (angleOfDelivery < -180) { + angleOfDelivery += 360; + } + float offAxisCoefficient = MAX_OFF_AXIS_ATTENUATION + (OFF_AXIS_ATTENUATION_FORMULA_STEP * (fabsf(angleOfDelivery) / 90.0f));